@egovernments/digit-ui-module-core 1.8.2-beta.17 → 1.8.2-beta.18

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-components"),n=require("react"),l=e(n),o=require("react-i18next"),r=require("react-query"),a=require("react-redux"),i=require("react-router-dom"),s=require("@egovernments/digit-ui-react-components"),c=require("redux"),u=e(require("redux-thunk"));const d={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:"MODULE_NOT_FOUND",buttonInfo:"ACTION_TEST_HOME"}},m=e=>{const{type:t="error"}=Digit.Hooks.useQueryParams(),n=d[t],{t:r}=o.useTranslation();return l.createElement("div",{className:"error-boundary"},l.createElement("div",{className:"error-container"},l.createElement("img",{src:n.imgUrl,alt:"error"}),l.createElement("h1",null,r(n.infoMessage)),l.createElement("button",{onClick:()=>{e.goToHome()}},r(n.buttonInfo))))},p=()=>{var e,t;const 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),l.createElement("span",null)};class v extends l.Component{constructor(e){super(e),this.state={error:null,errorStack:null,hasError:!1}}static getDerivedStateFromError(e){return{error:null==e?void 0:e.message,hasError:!0,errorStack:null==e?void 0:e.stack}}componentDidCatch(e,t){this.setState({error:null==e?void 0:e.message,hasError:!0,errorStack:null==e?void 0:e.stack})}render(){return this.state.hasError?l.createElement("div",{className:"error-boundary"},l.createElement(p,null),l.createElement(m,{initData:this.props.initData})):this.props.children}}const g=(e,t,n)=>{const l=null==e?void 0:e[""+t];l&&l.map(e=>{e.link=e.navigationURL,e.i18nKey=n(e.name)});const o={links:null==l?void 0:l.reverse(),header:Digit.Utils.locale.getTransformedLocale("ACTION_TEST_"+t),iconName:`CITIZEN_${t}_ICON`};var r;return"FSM"===t&&[{role:"FSM_DSO",from:`/${null===(r=window)||void 0===r?void 0:r.contextPath}/citizen/fsm/dso-dashboard`,dashoardLink:"CS_LINK_DSO_DASHBOARD",loginLink:"CS_LINK_LOGIN_DSO"}].map(e=>{var t,l,r;let{role:a,from:i,loginLink:s,dashoardLink:c}=e;Digit.UserService.hasAccess(a)?null==o||null===(t=o.links)||void 0===t||t.push({link:i,i18nKey:n(c)}):null==o||null===(l=o.links)||void 0===l||l.push({link:`/${null===(r=window)||void 0===r?void 0:r.contextPath}/citizen/login`,state:{role:"FSM_DSO",from:i},i18nKey:n(s)})}),o},f=e=>{let{modules:n,getCitizenMenu:r,fetchedCitizen:a,isLoading:i}=e;const s=[n.filter(e=>{let{code:t}=e;return"Payment"===t})[0],...n.filter(e=>{let{code:t}=e;return"Payment"!==t})],{t:c}=o.useTranslation();return i?l.createElement(t.Loader,null):l.createElement(l.Fragment,null,l.createElement("div",{className:"citizen-all-services-wrapper"},location.pathname.includes("sanitation-ui/citizen/all-services")?null:l.createElement(t.BackButton,null),l.createElement("div",{className:"citizenAllServiceGrid"},s.filter(e=>e).map((e,n)=>{var o,i;let s,{code:u}=e;var d,m,p,v;return a&&(s=a?g(r,u,c):void 0),(null===(o=s)||void 0===o||null===(i=o.links)||void 0===i?void 0:i.length)>0?l.createElement(t.CitizenHomeCard,{header:c(null===(d=s)||void 0===d?void 0:d.header),links:null===(m=s)||void 0===m||null===(p=m.links)||void 0===p||null===(v=p.filter(e=>null==e?void 0:e.link))||void 0===v?void 0:v.sort((e,t)=>(null==e?void 0:e.orderNumber)-(null==t?void 0:t.orderNumber)),Icon:()=>(e=>{switch(e){case"PT":return l.createElement(PTIcon,{className:"fill-path-primary-main"});case"WS":return l.createElement(WSICon,{className:"fill-path-primary-main"});case"FSM":return l.createElement(t.FSMIcon,{className:"fill-path-primary-main"});case"MCollect":return l.createElement(t.MCollectIcon,{className:"fill-path-primary-main"});case"PGR":return l.createElement(PGRIcon,{className:"fill-path-primary-main"});case"TL":return l.createElement(TLIcon,{className:"fill-path-primary-main"});case"OBPS":return l.createElement(OBPSIcon,{className:"fill-path-primary-main"});case"Bills":return l.createElement(t.BillsIcon,{className:"fill-path-primary-main"});default:return l.createElement(PTIcon,{className:"fill-path-primary-main"})}})(u),Info:"OBPS"===u?()=>l.createElement(t.CitizenInfoLabel,{style:{margin:"0px",padding:"10px"},info:c("CS_FILE_APPLICATION_INFO_LABEL"),text:c("BPA_CITIZEN_HOME_STAKEHOLDER_INCLUDES_INFO_LABEL")}):null,isInfo:"OBPS"===u}):l.createElement(l.Fragment,null)}))))},E=e=>{let{modules:t,additionalComponent:o}=e;return l.createElement(n.Fragment,null,l.createElement("div",{className:"employee-app-container digit-home-employee-app"},l.createElement("div",{className:"ground-container moduleCardWrapper gridModuleWrapper digit-home-moduleCardWrapper"},t.map((e,t)=>{let{code:n}=e;const o=Digit.ComponentRegistryService.getComponent(n+"Card")||(()=>l.createElement(l.Fragment,null));return l.createElement(o,{key:t})}))),o&&(null==o?void 0:o.length)>0&&o.map(e=>{const t="string"==typeof e?Digit.ComponentRegistryService.getComponent(e):null;return t?l.createElement("div",{className:"additional-component-wrapper"},l.createElement(t,null)):null}))},y=e=>{let{userType:t,modules:n,getCitizenMenu:o,fetchedCitizen:r,isLoading:a,additionalComponent:i}=e;return"citizen"===t?l.createElement(f,{modules:n,getCitizenMenu:o,fetchedCitizen:r,isLoading:a}):l.createElement(E,{modules:n,additionalComponent:i})},h=function(e,t,n){if(void 0===e&&(e=""),void 0===t&&(t=""),void 0===n&&(n=""),""==t)return e;for(;null!==(l=e)&&void 0!==l&&l.includes(t);){var l,o;e=null===(o=e)||void 0===o?void 0:o.replace(t,n)}return e},C=e=>{var o;const[r,a]=n.useState(null),[s,c]=n.useState([]),[u,d]=n.useState([]),m=i.useHistory();let p=[];return n.useEffect(()=>{var e,t;const n=Digit.SessionStorage.get("citizen.userRequestObject");let l=[],o=[];null==n||null===(e=n.info)||void 0===e||null===(t=e.roles)||void 0===t||t.forEach(e=>l.push(e.tenantId));let r=l.filter((e,t,n)=>n.indexOf(e)===t);null==r||r.forEach(e=>{var t;o.push({label:"TENANT_TENANTS_"+(null===(t=h(e,".","_"))||void 0===t?void 0:t.toUpperCase()),value:e})}),p=null==o?void 0:o.filter(e=>e.value==Digit.SessionStorage.get("Employee.tenantId")),c(o)},[r]),l.createElement("div",{style:null!=e&&e.mobileView?{color:"#767676"}:{}},l.createElement(t.Dropdown,{t:null==e?void 0:e.t,option:s,selected:s.find(e=>e.value===(null==r?void 0:r.value)),optionKey:"label",select:e=>{var t,n,l,o;const r=Digit.SessionStorage.get("citizen.userRequestObject"),i=null===(t=Digit.SessionStorage.get("citizen.userRequestObject"))||void 0===t||null===(n=t.info)||void 0===n||null===(l=n.roles)||void 0===l?void 0:l.filter(t=>t.tenantId===e.value);if((null==i?void 0:i.length)>0&&(r.info.roles=i,r.info.tenantId=null==e?void 0:e.value),Digit.SessionStorage.set("Employee.tenantId",null==e?void 0:e.value),Digit.UserService.setUser(r),a(e),window.location.href.includes(`/${null===(o=window)||void 0===o?void 0:o.contextPath}/employee/`)){var s,c;const e=(null===(s=location.state)||void 0===s?void 0:s.from)||`/${null===(c=window)||void 0===c?void 0:c.contextPath}/employee`;m.replace(e)}window.location.reload()},freeze:!0,customSelector:l.createElement("label",{className:"cp"},null==e?void 0:e.t("TENANT_TENANTS_"+(null===(o=h(Digit.SessionStorage.get("Employee.tenantId"),".","_"))||void 0===o?void 0:o.toUpperCase())))}))},b=e=>{const o=e.dropdown||!1,{data:r,isLoading:a}=Digit.Hooks.useStore.getInitData(),{languages:i,stateInfo:s}=r||{},c=Digit.StoreData.getCurrentLanguage(),[u,d]=n.useState(c),m=e=>{d(e.value),Digit.LocalizationService.changeLanguage(e.value,s.code)};return a?null:o?l.createElement("div",null,l.createElement(t.Dropdown,{className:"language-dropdown",option:i,selected:null==i?void 0:i.find(e=>(null==e?void 0:e.value)===c),optionKey:"label",select:m,freeze:!0,customSelector:l.createElement("label",{className:"cp"},null==i||null===(p=i.find(e=>(null==e?void 0:e.value)===u))||void 0===p?void 0:p.label)})):l.createElement(l.Fragment,null,l.createElement("div",{style:{marginBottom:"5px"}},"Language"),l.createElement("div",{className:"language-selector"},i.map((e,n)=>l.createElement("div",{className:"language-button-container",key:n},l.createElement(t.Button,{label:e.label,onClick:()=>m(e),variation:e.value===u?"primary":""})))));var p},S=e=>{var o,r,a,c,u,d,m,p;let{t:v,stateInfo:g,toggleSidebar:f,isSidebarOpen:E,handleLogout:y,userDetails:h,CITIZEN:S,cityDetails:O,mobileView:N,userOptions:I,handleUserDropdownSelection:w,logoUrl:_,showLanguageChange:D=!0}=e;const[T,L]=l.useState(null);l.useEffect(function(){try{var e;const t=Digit.ULBService.getCurrentTenantId(),n=null==h||null===(e=h.info)||void 0===e?void 0:e.uuid,l=function(){if(n)return Promise.resolve(Digit.UserService.userSearch(t,{uuid:[n]},{})).then(function(e){if(e&&e.user&&e.user.length){var t;const n=e.user[0],l=null==n||null===(t=n.photo)||void 0===t?void 0:t.split(",");L(null==l?void 0:l.at(0))}})}();return Promise.resolve(l&&l.then?l.then(function(){}):void 0)}catch(e){return Promise.reject(e)}},[null!==T,null==h||null===(o=h.info)||void 0===o?void 0:o.uuid]);const R=Digit.ULBService.getCitizenCurrentTenant(!0);let P=i.useHistory();const{pathname:A}=i.useLocation(),{data:{unreadCount:x}={},isSuccess:M}=Digit.Hooks.useNotificationCount({tenantId:R,config:{enabled:"EMPLOYEE"!==(null===(k=Digit.UserService)||void 0===k||null===(U=k.getUser())||void 0===U||null===(B=U.info)||void 0===B?void 0:B.type)&&"CITIZEN"===(null===(F=Digit.UserService)||void 0===F||null===(j=F.getUser())||void 0===j||null===(V=j.info)||void 0===V?void 0:V.type)&&!!R}});var k,U,B,F,j,V;if(S)return l.createElement("div",null,l.createElement(s.TopBar,{img:null==g?void 0:g.logoUrlWhite,isMobile:!0,toggleSidebar:()=>{Digit.clikOusideFired?Digit.clikOusideFired=!1:f(!0)},logoUrl:null==g?void 0:g.logoUrlWhite,onLogout:y,userDetails:h,notificationCount:x<99?x:99,notificationCountLoaded:M,cityOfCitizenShownBesideLogo:v(R),onNotificationIconClick:function(){var e;P.push(`/${null===(e=window)||void 0===e?void 0:e.contextPath}/citizen/engagement/notifications`)},hideNotificationIconOnSomeUrlsWhenNotLoggedIn:(e=>{var t,n,l,o;return(null===(t=Digit.UserService)||void 0===t||null===(n=t.getUser())||void 0===n||!n.access_token)&&[`/${null===(l=window)||void 0===l?void 0:l.contextPath}/citizen/select-language`,`/${null===(o=window)||void 0===o?void 0:o.contextPath}/citizen/select-location`].includes(e)})(A),changeLanguage:N?null:l.createElement(b,{dropdown:!0})}));const H=!(null==h||!h.access_token),z=null===(r=Digit.ComponentRegistryService)||void 0===r?void 0:r.getComponent("CustomEmployeeTopBar");return z?l.createElement(z,{t:v,stateInfo:g,toggleSidebar:f,isSidebarOpen:E,handleLogout:y,userDetails:h,CITIZEN:S,cityDetails:O,mobileView:N,userOptions:I,handleUserDropdownSelection:w,logoUrl:_,showLanguageChange:D,loggedin:H}):l.createElement(t.TopBar,{actionFields:[l.createElement(C,{dropdown:!0,t:v}),D&&l.createElement(b,{dropdown:!0}),(null==h?void 0:h.access_token)&&l.createElement(t.Dropdown,{option:I,optionKey:"name",profilePic:T||(null==h||null===(a=h.info)||void 0===a?void 0:a.name)||(null==h||null===(c=h.info)||void 0===c||null===(u=c.userInfo)||void 0===u?void 0:u.name)||"Employee",select:w,showArrow:!0,menuStyles:{marginTop:"1rem"},theme:"light"})],onHamburgerClick:()=>{f()},className:"",img:_,logoWidth:"48px",logoHeight:"48px",logo:H?null==O?void 0:O.logoId:null==g?void 0:g.statelogo,onImageClick:()=>{},onLogoClick:()=>{},props:{},showDeafultImg:!0,style:{},theme:"light",ulb:H?null!=O&&null!==(d=O.city)&&void 0!==d&&d.ulbGrade?l.createElement(n.Fragment,null,v(null==O?void 0:O.i18nKey).toUpperCase()," ",v("ULBGRADE_"+(null==O||null===(m=O.city)||void 0===m?void 0:m.ulbGrade.toUpperCase().replace(" ","_").replace(".","_"))).toUpperCase()):l.createElement("img",{className:"state",src:_,alt:"State Logo"}):l.createElement(n.Fragment,null,v(`MYCITY_${null==g||null===(p=g.code)||void 0===p?void 0:p.toUpperCase()}_LABEL`)," ",v("MYCITY_STATECODE_LABEL"))})},O=(e,t,n,o)=>{var r,a;return[{type:"link",element:"HOME",text:e("COMMON_BOTTOM_NAVIGATION_HOME"),link:o?`/${null===(r=window)||void 0===r?void 0:r.contextPath}/employee`:`/${null===(a=window)||void 0===a?void 0:a.contextPath}/citizen`,icon:"Home",populators:{onClick:t}},{type:"component",element:"LANGUAGE",action:l.createElement(b,null),icon:"LanguageIcon"},{id:"login-btn",element:"LOGIN",text:e("CORE_COMMON_LOGIN"),icon:l.createElement(s.LogoutIcon,{className:"icon"}),populators:{onClick:n}}]};function N(){return(N=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var l in n)({}).hasOwnProperty.call(n,l)&&(e[l]=n[l])}return e}).apply(null,arguments)}const I=e=>{let{onSelect:n,onCancel:r,onDismiss:a,PopupStyles:i,isDisabled:s,hideSubmit:c}=e;const{t:u}=o.useTranslation(),d=[l.createElement("div",null,l.createElement(t.CardText,null,u("CORE_LOGOUT_WEB_CONFIRMATION_MESSAGE")+" ",l.createElement("strong",null,u("CORE_LOGOUT_MESSAGE"))))],m=[l.createElement(t.Button,{type:"button",size:"large",variation:"secondary",label:u("CORE_LOGOUT_CANCEL"),className:"logout-cancel-button",onClick:r}),l.createElement(t.Button,{type:"button",size:"large",variation:"primary",label:u("CORE_LOGOUT_WEB_YES"),formId:"modal-action",onClick:n,isDisabled:s})],p=[l.createElement(t.Button,{type:"button",size:"large",variation:"digit-action-cancel",label:u("CORE_LOGOUT_CANCEL"),className:"logout-cancel-button",onClick:r})];return l.createElement(t.PopUp,{type:"default",children:d,heading:u("CORE_LOGOUT_WEB_HEADER"),footerChildren:c?p:m,sortFooterButtons:!0,onClose:a,className:"digit-logout-popup-wrapper",onOverlayClick:a,equalWidthButtons:!0,style:i})},w=e=>{let{info:t,t:n}=e;return l.createElement("div",{className:"profile-section"},l.createElement("div",{className:"imageloader imageloader-loaded"},l.createElement("img",{className:"img-responsive img-circle img-Profile",src:"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"})),l.createElement("div",{id:"profile-name",className:"label-container name-Profile"},l.createElement("div",{className:"label-text"}," ",null==t?void 0:t.name," ")),l.createElement("div",{id:"profile-location",className:"label-container loc-Profile"},l.createElement("div",{className:"label-text"}," ",null==t?void 0:t.mobileNumber," ")),(null==t?void 0:t.emailId)&&l.createElement("div",{id:"profile-emailid",className:"label-container loc-Profile"},l.createElement("div",{className:"label-text"}," ",t.emailId," ")),l.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")&&l.createElement(C,{t:n,mobileView:!0}))},_={CommonPTIcon:l.createElement(t.PTIcon,{className:"icon"}),OBPSIcon:l.createElement(t.OBPSIcon,{className:"icon"}),propertyIcon:l.createElement(t.PropertyHouse,{className:"icon"}),TLIcon:l.createElement(t.CaseIcon,{className:"icon"}),PGRIcon:l.createElement(t.PGRIcon,{className:"icon"}),FSMIcon:l.createElement(t.FSMIcon,{className:"icon"}),WSIcon:l.createElement(t.WSICon,{className:"icon"}),MCollectIcon:l.createElement(t.MCollectIcon,{className:"icon"}),BillsIcon:l.createElement(t.CollectionIcon,{className:"icon"}),BirthIcon:l.createElement(t.BirthIcon,{className:"icon"}),DeathIcon:l.createElement(t.DeathIcon,{className:"icon"}),FirenocIcon:l.createElement(t.FirenocIcon,{className:"icon"}),HomeIcon:l.createElement(t.HomeIcon,{className:"icon"}),EditPencilIcon:l.createElement(t.EditPencilIcon,{className:"icon"}),LogoutIcon:l.createElement(t.LogoutIcon,{className:"icon"}),Phone:l.createElement(t.Phone,{className:"icon"})},D=e=>{var r,a,s;let{linkData:c,islinkDataLoading:u}=e;const{t:d}=o.useTranslation(),m=i.useHistory(),p=i.useLocation(),{pathname:v}=p,{data:g,isFetched:f}=Digit.Hooks.useStore.getInitData(),{stateInfo:E}=g||{},y=Digit.UserService.getUser();let h=window.Digit.Utils.browser.isMobile();const[C,b]=n.useState(!1),[S,D]=n.useState(!1),[T,L]=n.useState(!1),R=()=>{L(!1)};if(u)return l.createElement(t.Loader,null);const P=()=>{var e;m.push(`/${null===(e=window)||void 0===e?void 0:e.contextPath}/citizen/user/profile`)};let A=[...O(d,P,()=>{var e;m.push(`/${null===(e=window)||void 0===e?void 0:e.contextPath}/citizen/login`)},C)];A=A.filter(e=>"LANGUAGE"!==e.element),Digit.ULBService.getCurrentTenantId();const x=e=>{var t,n;let{item:o}=e;const r=(null==o?void 0:o.icon)||(null===(t=o.icon)||void 0===t||null===(n=t.type)||void 0===n?void 0:n.name),a=r?_[r]:_.BillsIcon;let s;s="component"===o.type?o.action:o.text;const c=()=>l.createElement("span",N({className:"menu-item"},o.populators),a,l.createElement("div",{className:"menu-label"},s));return"external-link"===o.type?l.createElement("a",{href:o.link},l.createElement(c,null)):"link"===o.type?l.createElement(i.Link,{to:null==o?void 0:o.link},l.createElement(c,null)):l.createElement(c,null)};let M;return f&&y&&y.access_token&&(M=l.createElement(w,{info:null==y?void 0:y.info,stateName:null==E?void 0:E.name,t:d}),A=A.filter(e=>"login-btn"!==(null==e?void 0:e.id)),A=[...A,{text:d("EDIT_PROFILE"),element:"PROFILE",icon:"EditPencilIcon",populators:{onClick:P}},{text:d("CORE_COMMON_LOGOUT"),element:"LOGOUT",icon:"LogoutIcon",populators:{onClick:()=>{D(!1),L(!0)}}},{text:l.createElement(l.Fragment,null,d("CS_COMMON_HELPLINE"),l.createElement("div",{className:"telephone",style:{marginTop:"-10%"}},null==g?void 0:g.tenants.map(e=>{}),l.createElement("div",{className:"link"},l.createElement("a",{href:"tel:"+(null==g?void 0:g.tenants[0].contactNumber)},null==g?void 0:g.tenants[0].contactNumber)))),element:"Helpline",icon:"Phone"}]),null===(r=Object.keys(c))||void 0===r||null===(a=r.sort((e,t)=>t.localeCompare(e)))||void 0===a||a.map(e=>{var t,n,l,o,r,a;(null===(t=c[e][0])||void 0===t?void 0:t.sidebar)===window.contextPath+"-links"&&A.splice(1,0,{type:null!==(n=c[e][0])&&void 0!==n&&null!==(l=n.sidebarURL)&&void 0!==l&&l.includes(null===(o=window)||void 0===o?void 0:o.contextPath)?"link":"external-link",text:d("ACTION_TEST_"+Digit.Utils.locale.getTransformedLocale(e)),links:c[e],icon:null===(r=c[e][0])||void 0===r?void 0:r.leftIcon,link:null===(a=c[e][0])||void 0===a?void 0:a.sidebarURL})}),l.createElement(l.Fragment,null,l.createElement("div",null,l.createElement("div",{style:{height:"100%",width:"100%",top:"0px",backgroundColor:"rgba(0, 0, 0, 0.54)",pointerzevents:"auto"}}),l.createElement("div",{style:{display:"flex",flexDirection:"column",height:h?"calc(100vh - 56px)":"auto",zIndex:"99"}},M,l.createElement("div",{className:"drawer-desktop"},null===(s=A)||void 0===s?void 0:s.map((e,t)=>l.createElement("div",{className:"sidebar-list "+(v===(null==e?void 0:e.link)||v===(null==e?void 0:e.sidebarURL)?"active":""),key:t},l.createElement(x,{item:e}))))),l.createElement("div",null,T&&l.createElement(I,{onSelect:()=>{Digit.UserService.logout(),L(!1)},onCancel:R,onDismiss:R}))))},T=e=>{var r,a,s;let{isMobile:c=!1,toggleSidebar:u,onLogout:d,isEmployee:m=!1,linkData:p,islinkDataLoading:v,userProfile:g}=e;const{data:f,isFetched:E}=Digit.Hooks.useStore.getInitData(),y=Digit.StoreData.getCurrentLanguage(),[h,C]=n.useState(null),{languages:b,stateInfo:S}=f||{},N=Digit.UserService.getUser(),[I,w]=n.useState(""),[_,T]=n.useState(null),[L,R]=n.useState([]),[P,A]=n.useState([]),[x,M]=n.useState(y);let k=[];const{isLoading:U,data:B}=Digit.Hooks.useAccessControl(),{t:F}=(Digit.ULBService.getCurrentTenantId(),o.useTranslation()),j=i.useHistory(),V=function(e,t,n){if(void 0===e&&(e=""),void 0===t&&(t=""),void 0===n&&(n=""),""==t)return e;for(;null!==(l=e)&&void 0!==l&&l.includes(t);){var l,o;e=null===(o=e)||void 0===o?void 0:o.replace(t,n)}return e};n.useEffect(()=>{var e,t;const n=Digit.SessionStorage.get("citizen.userRequestObject");let l=[],o=[];null==n||null===(e=n.info)||void 0===e||null===(t=e.roles)||void 0===t||t.forEach(e=>l.push(e.tenantId));let r=l.filter((e,t,n)=>n.indexOf(e)===t);null==r||r.forEach(e=>{var t;o.push({label:"TENANT_TENANTS_"+(null===(t=V(e,".","_"))||void 0===t?void 0:t.toUpperCase()),value:e})}),k=null==o?void 0:o.filter(e=>e.value==Digit.SessionStorage.get("Employee.tenantId")),R(o)},[_]);const H=()=>{Digit.clikOusideFired=!0,u(!1)};n.useEffect(()=>{h||function(){try{var e;const t=Digit.ULBService.getCurrentTenantId(),n=null==N||null===(e=N.info)||void 0===e?void 0:e.uuid,l=function(){if(n)return Promise.resolve(Digit.UserService.userSearch(t,{uuid:[n]},{})).then(function(e){if(e&&e.user&&e.user.length){var t;const n=e.user[0],l=null==n||null===(t=n.photo)||void 0===t?void 0:t.split(",");C(null==l?void 0:l.at(0))}})}();Promise.resolve(l&&l.then?l.then(function(){}):void 0)}catch(e){return Promise.reject(e)}}()},[h]);const z=e=>{var t,n;j.push("/"===e[0]?`/${null===(t=window)||void 0===t?void 0:t.contextPath}/${m?"employee":"citizen"}${e}`:`/${null===(n=window)||void 0===n?void 0:n.contextPath}/${m?"employee":"citizen"}/${e}`),u()};if(v||U)return l.createElement(t.Loader,null);let G=[...O(F,H,()=>{var e;j.push(`/${null===(e=window)||void 0===e?void 0:e.contextPath}/citizen/login`),H()},m)];E&&N&&N.access_token&&(G=G.filter(e=>"login-btn"!==(null==e?void 0:e.id)));let $={};if(m){var W;null==B||B.actions.filter(e=>"url"===e.url&&"Home"!==e.displayName).forEach(e=>{var t;if(""==I&&""!==e.path){let t=e.path.split(".")[0];"TradeLicense"===t&&(t="Trade License"),$[t]?$[t].push(e):$[t]=[e]}else if(""!==e.path&&null!=e&&null!==(t=e.displayName)&&void 0!==t&&t.toLowerCase().includes(I.toLowerCase())){let t=e.path.split(".")[0];"TradeLicense"===t&&(t="Trade License"),$[t]?$[t].push(e):$[t]=[e]}});const e=Object.keys($);for(let t=0;t<e.length;t++){var q,X,Z,Y,J;const n=null===(q=$[e[t]][0])||void 0===q||null===(X=q.displayName)||void 0===X||null===(Z=X.toUpperCase())||void 0===Z?void 0:Z.replace(/[ -]/g,"_"),l=null===(Y=e[t])||void 0===Y||null===(J=Y.toUpperCase())||void 0===J?void 0:J.replace(/[ -]/g,"_");var K,Q,ee,te;-1===$[e[t]][0].path.indexOf(".")?G.splice(1,0,{type:"link",text:F("ACTION_TEST_"+n),link:null===(K=$[e[t]][0])||void 0===K?void 0:K.navigationURL,icon:null===(Q=$[e[t]][0])||void 0===Q?void 0:Q.leftIcon,populators:{onClick:()=>{var n;j.push(null===(n=$[e[t]][0])||void 0===n?void 0:n.navigationURL),H()}}}):G.splice(1,0,{type:"dynamic",moduleName:F("ACTION_TEST_"+l),links:null===(ee=$[e[t]])||void 0===ee?void 0:ee.map(e=>{var t,n;return{...e,displayName:F("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===(te=$[e[t]][1])||void 0===te?void 0:te.leftIcon})}const t=G.findIndex(e=>"HOME"===e.element),n=G.splice(t,1),l=G.findIndex(e=>"LANGUAGE"===e.element),o=G.splice(l,(null===(W=G)||void 0===W?void 0:W.length)-l);G.sort((e,t)=>("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==n?void 0:n[0])&&G.splice(0,0,n[0]),G=(null==o?void 0:o.length)>0?G.concat(o):G}else{var ne,le;null===(ne=Object.keys(p))||void 0===ne||null===(le=ne.sort((e,t)=>t.localeCompare(e)))||void 0===le||le.map(e=>{var t,n,l,o,r,a;"digit-ui-links"===(null===(t=p[e][0])||void 0===t?void 0:t.sidebar)&&G.splice(1,0,{type:null!==(n=p[e][0])&&void 0!==n&&null!==(l=n.sidebarURL)&&void 0!==l&&l.includes(null===(o=window)||void 0===o?void 0:o.contextPath)?"link":"external-link",text:F("ACTION_TEST_"+Digit.Utils.locale.getTransformedLocale(e)),links:p[e],icon:null===(r=p[e][0])||void 0===r?void 0:r.leftIcon,link:null===(a=p[e][0])||void 0===a?void 0:a.sidebarURL})})}j.location.pathname.includes("/openlink")&&(G=G.filter(e=>"LANGUAGE"===e.element)),G=G.map(e=>({...e,label:(null==e?void 0:e.text)||(null==e?void 0:e.moduleName)||"",icon:null!=e&&e.icon?null==e?void 0:e.icon:void 0}));const oe=F("TENANT_TENANTS_"+(null===(r=V(Digit.SessionStorage.get("Employee.tenantId"),".","_"))||void 0===r?void 0:r.toUpperCase())),re=G.map(e=>"dynamic"===(null==e?void 0:e.type)?{...e,children:e.links.map(e=>({...e,label:null==e?void 0:e.displayName,icon:e.leftIcon}))}:e),ae=L.map(e=>({...e,type:"custom",key:"city"})),ie=b.map(e=>({...e,type:"custom",key:"language"})),se=[{label:oe,value:oe,children:ae.length>0?ae:void 0,type:"custom",key:"city"},{label:F("Language"),children:ie.length>0?ie:void 0,type:"custom",key:"language"},{label:F("EDIT_PROFILE"),type:"custom",key:"editProfile"},{label:F("Modules"),children:re}];return c?l.createElement(t.MobileSidebar,{items:se,profileName:null==N||null===(a=N.info)||void 0===a?void 0:a.name,profileNumber:null==N||null===(s=N.info)||void 0===s?void 0:s.mobileNumber,theme:"dark",transitionDuration:.3,styles:{marginTop:"64px",height:"93%"},onLogout:d,hideUserManuals:!0,profile:h||void 0,isSearchable:!0,onSelect:e=>{let{item:t,index:n,parentIndex:l}=e;return(e=>{let{item:t}=e;if(null!=t&&t.navigationURL)z(null==t?void 0:t.navigationURL);else if(null!=t&&t.link)z(null==t?void 0:t.link);else{if("custom"!==(null==t?void 0:t.type))return;switch(null==t?void 0:t.key){case"editProfile":g(),u();break;case"language":M((n=t).value),Digit.LocalizationService.changeLanguage(n.value,S.code),u();break;case"city":(e=>{var t,n,l,o;const r=Digit.SessionStorage.get("citizen.userRequestObject"),a=null===(t=Digit.SessionStorage.get("citizen.userRequestObject"))||void 0===t||null===(n=t.info)||void 0===n||null===(l=n.roles)||void 0===l?void 0:l.filter(t=>t.tenantId===e.value);if((null==a?void 0:a.length)>0&&(r.info.roles=a,r.info.tenantId=null==e?void 0:e.value),Digit.SessionStorage.set("Employee.tenantId",null==e?void 0:e.value),Digit.UserService.setUser(r),T(e),window.location.href.includes(`/${null===(o=window)||void 0===o?void 0:o.contextPath}/employee/`)){var i,s;const e=(null===(i=location.state)||void 0===i?void 0:i.from)||`/${null===(s=window)||void 0===s?void 0:s.contextPath}/employee`;j.replace(e)}window.location.reload()})(t),u()}}var n})({item:t,index:n,parentIndex:l})}}):l.createElement(D,{logout:d})},L=["digit-ui","works-ui","workbench-ui","health-ui","sanitation-ui","core-ui","mgramseva-web"],R=()=>{const{isLoading:e,data:n}=Digit.Hooks.useAccessControl(),r=(o.useTranslation(),i.useHistory()),a={};null==n||n.actions.filter(e=>"url"===e.url).forEach(e=>{var t;if(null==e||null===(t=e.path)||void 0===t||t.split("."),""!==(null==e?void 0:e.path)){var n;const t=null==e||null===(n=e.path)||void 0===n?void 0:n.split(".");let l={};t.reduce((n,l,o)=>{if(o!==t.length-1)return n[l]={},n[l];n[l]={item:e}},l),function e(t,n){for(const l in n)n.hasOwnProperty(l)&&("object"!=typeof n[l]||Array.isArray(n[l])?t[l]||(t[l]=n[l]):(t[l]||(t[l]={}),e(t[l],n[l])))}(a,l)}});const s=function(e){const t=(e,n)=>{if(n.item)return{label:n.item.displayName,icon:{icon:n.item.leftIcon,width:"1.5rem",height:"1.5rem"},navigationUrl:n.item.navigationURL};const l=Object.keys(n).map(e=>t(e,n[e]));return{label:e,icon:{icon:function e(t){void 0===t&&(t={});for(const n in t){const l=t[n];if("item"===n&&""!==(null==l?void 0:l.leftIcon))return null==l?void 0:l.leftIcon;if("object"==typeof t[n]&&!Array.isArray(t[n])){const l=e(t[n]);if(l)return l}}return null}(n),width:"1.5rem",height:"1.5rem"},children:l}};return Object.keys(e).map(n=>t(n,e[n]))}((e=>{const t=Object.entries(e);return t.sort((e,t)=>e[0]<t[0]?-1:e[0]>t[0]?1:0),Object.fromEntries(t)})(a));return e?l.createElement(t.Loader,null):a?l.createElement(t.Sidebar,{items:s,hideAccessbilityTools:!0,onSelect:e=>{let{item:t,index:n,parentIndex:l}=e;return(e=>{let{item:t}=e;null!=t&&t.navigationUrl&&function(e,t){var n,l;if(void 0===e&&(e={}),void 0===t&&(t=""),"/"!=t)if(-1===(null===(n=t)||void 0===n?void 0:n.indexOf("/"+(null===(l=window)||void 0===l?void 0:l.contextPath)))){const e=window.location.origin,n=null!=L&&L.every(e=>{var n;return-1===(null===(n=t)||void 0===n?void 0:n.indexOf("/"+e))})?e+"/employee/"+t:e+t;window.location.href=n}else e.push(t)}(r,null==t?void 0:t.navigationUrl)})({item:t,index:n,parentIndex:l})},theme:"dark",variant:"primary",transitionDuration:"",className:"",styles:{},expandedWidth:"",collapsedWidth:"",onBottomItemClick:()=>{}}):""},P=e=>{let{CITIZEN:t,isSidebarOpen:n,toggleSidebar:o,handleLogout:r,mobileView:a,userDetails:i,modules:s,linkData:c,islinkDataLoading:u,userProfile:d}=e;return t?l.createElement(T,{isOpen:n,isMobile:!0,toggleSidebar:o,onLogout:r,linkData:c,islinkDataLoading:u,userProfile:d}):!n&&null!=i&&i.access_token?l.createElement("div",{className:"digit-employeeSidebar"},l.createElement(R,{mobileView:a,userDetails:i,modules:s})):l.createElement("div",{className:"digit-citizenSidebar"},l.createElement(T,{isOpen:n,isMobile:!0,toggleSidebar:o,onLogout:r,isEmployee:!0,userProfile:d}))},A=e=>{let{t:t,stateInfo:o,userDetails:r,CITIZEN:a,cityDetails:s,mobileView:c,handleUserDropdownSelection:u,logoUrl:d,showSidebar:m=!0,showLanguageChange:p,linkData:v,islinkDataLoading:g}=e;const[f,E]=n.useState(!1),y=i.useHistory(),[h,C]=n.useState(!1),b=()=>{E(!1),C(!0)},O=()=>{C(!1)},N=()=>{E(!f)},w=()=>{var e;y.push(`/${null===(e=window)||void 0===e?void 0:e.contextPath}/employee/user/profile`)},_=[{name:t("EDIT_PROFILE"),icon:"Edit",func:w},{name:t("CORE_COMMON_LOGOUT"),icon:"Logout",func:b}];return l.createElement(l.Fragment,null,l.createElement(S,{t:t,stateInfo:o,toggleSidebar:N,isSidebarOpen:f,handleLogout:b,userDetails:r,CITIZEN:a,cityDetails:s,mobileView:c,userOptions:_,handleUserDropdownSelection:u,logoUrl:d,showLanguageChange:p}),h&&l.createElement(I,{onSelect:()=>{Digit.UserService.logout(),C(!1)},onCancel:O,onDismiss:O}),m&&l.createElement(P,{t:t,CITIZEN:a,isSidebarOpen:f,toggleSidebar:N,handleLogout:b,mobileView:c,userDetails:r,linkData:v,userProfile:w,islinkDataLoading:g}))},x=e=>{const{question:r,answer:a,lastIndex:i}=e,[s,c]=n.useState(!1),{t:u}=o.useTranslation();return l.createElement("div",{className:"faqs border-none",onClick:()=>c(!s)},l.createElement("div",{className:"faq-question",style:{justifyContent:"space-between",display:"flex"}},l.createElement("span",null,u(r)),l.createElement("span",{className:s?"faqicon rotate":"faqicon",style:{float:"right"}},l.createElement(t.ArrowForward,null))),l.createElement("div",{className:"faq-answer",style:s?{display:"block"}:{display:"none"}},l.createElement("span",null,u(a))),i?null:l.createElement("div",{className:"cs-box-border"}))},M=e=>{var r,a,i;let{module:s}=e;const c=Digit.UserService.getUser(),{t:u}=((null==c||null===(r=c.info)||void 0===r?void 0:r.tenantId)||Digit.ULBService.getCurrentTenantId(),o.useTranslation()),{isLoading:d,data:m}=Digit.Hooks.useGetFAQsJSON(Digit.ULBService.getStateId()),p=null==m||null===(a=m.MdmsRes["common-masters"])||void 0===a||null===(i=a.faqs[0])||void 0===i?void 0:i[""+s].faqs;return d?l.createElement(t.Loader,null):l.createElement(n.Fragment,null,l.createElement("div",{className:"faq-page"},l.createElement(t.BackButton,{style:{marginLeft:"unset"}}),l.createElement("div",{style:{marginBottom:"15px"}},l.createElement(t.Header,{styles:{marginLeft:"0px",paddingTop:"10px",fontSize:"32px"}},u("FAQ_S"))),l.createElement("div",{className:"faq-list"},p.map((e,t)=>l.createElement(x,{key:"faq_"+t,question:e.question,answer:e.answer,lastIndex:t===(null==p?void 0:p.length)-1})))))},k=()=>{var e,n,r,a,s,c,u,d,m,p,v,g,f,E,y,h,C,b,S,O,I,w,_;const{t:D}=o.useTranslation(),T=i.useHistory(),L=Digit.ULBService.getCitizenCurrentTenant(!0),{data:{uiHomePage:R}={},isLoading:P}=Digit.Hooks.useStore.getInitData();let A=window.Digit.Utils.browser.isMobile();const x=()=>{var e,t,n,l,o;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===(l=Digit.UserService)||void 0===l||null===(o=l.getUser())||void 0===o||!o.access_token)},{data:M,isLoading:k}=Digit.Hooks.useEvents({tenantId:L,variant:"whats-new",config:{enabled:x()}});var U;L||T.push(`/${null===(U=window)||void 0===U?void 0:U.contextPath}/citizen/select-language`);const B=null==R?void 0:R.appBannerDesktop,F=null==R?void 0:R.appBannerMobile,j=null==R?void 0:R.citizenServicesCard,V=null==R?void 0:R.informationAndUpdatesCard,H=null==R?void 0:R.whatsAppBannerDesktop,z=null==R?void 0:R.whatsAppBannerMobile,G=null==R?void 0:R.whatsNewSection,$=null==R?void 0:R.redirectURL;var W,q;$&&T.push(`/${null===(W=window)||void 0===W?void 0:W.contextPath}/citizen/${$}`),null!==(e=window)&&void 0!==e&&null!==(n=e.location)&&void 0!==n&&null!==(r=n.href)&&void 0!==r&&null!==(a=r.includes)&&void 0!==a&&a.call(r,"sanitation-ui")&&T.push(`/${null===(q=window)||void 0===q?void 0:q.contextPath}/citizen/all-services`);const X=e=>{window.open(null==e?void 0:e.navigationUrl)},Z={header:D(null==j?void 0:j.headerLabel),sideOption:{name:D(null==j||null===(s=j.sideOption)||void 0===s?void 0:s.name),onClick:()=>{var e;return T.push(null==j||null===(e=j.sideOption)||void 0===e?void 0:e.navigationUrl)}},options:[{name:D(null==j||null===(c=j.props)||void 0===c||null===(u=c[0])||void 0===u?void 0:u.label),Icon:l.createElement(t.ComplaintIcon,null),onClick:()=>{var e,t;return T.push(null==j||null===(e=j.props)||void 0===e||null===(t=e[0])||void 0===t?void 0:t.navigationUrl)}},{name:D(null==j||null===(d=j.props)||void 0===d||null===(m=d[1])||void 0===m?void 0:m.label),Icon:l.createElement(t.PTIcon,{className:"fill-path-primary-main"}),onClick:()=>{var e,t;return T.push(null==j||null===(e=j.props)||void 0===e||null===(t=e[1])||void 0===t?void 0:t.navigationUrl)}},{name:D(null==j||null===(p=j.props)||void 0===p||null===(v=p[2])||void 0===v?void 0:v.label),Icon:l.createElement(t.CaseIcon,{className:"fill-path-primary-main"}),onClick:()=>{var e,t;return T.push(null==j||null===(e=j.props)||void 0===e||null===(t=e[2])||void 0===t?void 0:t.navigationUrl)}},{name:D(null==j||null===(g=j.props)||void 0===g||null===(f=g[3])||void 0===f?void 0:f.label),Icon:l.createElement(t.OBPSIcon,null),onClick:()=>{var e,t;return T.push(null==j||null===(e=j.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%"}},Y={header:D(null==V?void 0:V.headerLabel),sideOption:{name:D(null==V||null===(E=V.sideOption)||void 0===E?void 0:E.name),onClick:()=>{var e;return T.push(null==V||null===(e=V.sideOption)||void 0===e?void 0:e.navigationUrl)}},options:[{name:D(null==V||null===(y=V.props)||void 0===y||null===(h=y[0])||void 0===h?void 0:h.label),Icon:l.createElement(t.HomeIcon,null),onClick:()=>{var e,t;return T.push(null==V||null===(e=V.props)||void 0===e||null===(t=e[0])||void 0===t?void 0:t.navigationUrl)}},{name:D(null==V||null===(C=V.props)||void 0===C||null===(b=C[1])||void 0===b?void 0:b.label),Icon:l.createElement(t.Calender,null),onClick:()=>{var e,t;return T.push(null==V||null===(e=V.props)||void 0===e||null===(t=e[1])||void 0===t?void 0:t.navigationUrl)}},{name:D(null==V||null===(S=V.props)||void 0===S||null===(O=S[2])||void 0===O?void 0:O.label),Icon:l.createElement(t.DocumentIcon,null),onClick:()=>{var e,t;return T.push(null==V||null===(e=V.props)||void 0===e||null===(t=e[2])||void 0===t?void 0:t.navigationUrl)}},{name:D(null==V||null===(I=V.props)||void 0===I||null===(w=I[3])||void 0===w?void 0:w.label),Icon:l.createElement(t.DocumentIcon,null),onClick:()=>{var e,t;return T.push(null==V||null===(e=V.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 P?l.createElement(t.Loader,null):l.createElement("div",{className:"HomePageContainer"},l.createElement("div",{className:"HomePageWrapper"},l.createElement("div",{className:"BannerWithSearch"},l.createElement("img",A?{src:null==F?void 0:F.bannerUrl}:{src:null==B?void 0:B.bannerUrl}),l.createElement("div",{className:"ServicesSection"},l.createElement(t.CardBasedOptions,N({style:{marginTop:"-30px"}},Z)),l.createElement(t.CardBasedOptions,N({style:A?{}:{marginTop:"-30px"}},Y)))),(z||H)&&l.createElement("div",{className:"WhatsAppBanner"},l.createElement("img",A?{src:null==z?void 0:z.bannerUrl,onClick:()=>X(z)}:{src:null==H?void 0:H.bannerUrl,onClick:()=>X(H)})),x()?k?l.createElement(t.Loader,null):l.createElement("div",{className:"WhatsNewSection"},l.createElement("div",{className:"headSection"},l.createElement("h2",null,D(null==G?void 0:G.headerLabel)),l.createElement("p",{onClick:()=>{var e;return T.push(null==G||null===(e=G.sideOption)||void 0===e?void 0:e.navigationUrl)}},D(null==G||null===(_=G.sideOption)||void 0===_?void 0:_.name))),l.createElement(t.WhatsNewCard,null==M?void 0:M[0])):null))},U=()=>{const{t:e}=o.useTranslation(),r=i.useHistory(),{data:{languages:a,stateInfo:s}={},isLoading:c}=Digit.Hooks.useStore.getInitData(),u=Digit.StoreData.getCurrentLanguage(),d=n.useMemo(()=>({header:e("CS_COMMON_CHOOSE_LANGUAGE"),submitBarLabel:e("CORE_COMMON_CONTINUE")}),[e]),m=n.useMemo(()=>({options:a,optionsKey:"label",additionalWrapperClass:"digit-reverse-radio-selection-wrapper",onSelect:e=>Digit.LocalizationService.changeLanguage(e.value,s.code),selectedOption:null==a?void 0:a.filter(e=>e.value===u)[0]}),[u,a]);return c?l.createElement(t.Loader,null):l.createElement("div",{className:"selection-card-wrapper"},l.createElement(t.PageBasedInput,{texts:d,onSubmit:function(){var e;r.push(`/${null===(e=window)||void 0===e?void 0:e.contextPath}/citizen/select-location`)}},l.createElement(t.CardHeader,null,e("CS_COMMON_CHOOSE_LANGUAGE")),l.createElement(t.RadioButtons,m)))},B=()=>{const{t:e}=o.useTranslation(),r=i.useHistory(),a=i.useLocation(),{data:s,isLoading:c}=Digit.Hooks.useTenants(),[u,d]=n.useState(()=>({code:Digit.ULBService.getCitizenCurrentTenant(!0)})),[m,p]=n.useState(!1),v=n.useMemo(()=>({header:e("CS_COMMON_CHOOSE_LOCATION"),submitBarLabel:e("CORE_COMMON_CONTINUE")}),[e]);function g(e){d(e),p(!1)}const f=n.useMemo(()=>({options:s,optionsKey:"i18nKey",additionalWrapperClass:"digit-reverse-radio-selection-wrapper",onSelect:g,selectedOption:u}),[s,e,u]);return c?l.createElement("loader",null):l.createElement("div",{className:"selection-card-wrapper"},l.createElement(t.BackButton,null),l.createElement(t.PageBasedInput,{texts:v,onSubmit:function(){if(u){var e,t;Digit.SessionStorage.set("CITIZEN.COMMON.HOME.CITY",u);const n=null===(e=a.state)||void 0===e?void 0:e.redirectBackTo;n?r.replace(n):r.push(`/${null===(t=window)||void 0===t?void 0:t.contextPath}/citizen`)}else p(!0)},className:"location-selection-container"},l.createElement(t.CardHeader,null,e("CS_COMMON_CHOOSE_LOCATION")),l.createElement(t.SearchOnRadioButtons,N({},f,{placeholder:e("COMMON_TABLE_SEARCH")})),m?l.createElement(t.CardLabelError,null,e("CS_COMMON_LOCATION_SELECTION_ERROR")):null))},F=function(){function e(){}return e.prototype.then=function(t,n){const l=new e,o=this.s;if(o){const e=1&o?t:n;if(e){try{j(l,1,e(this.v))}catch(e){j(l,2,e)}return l}return this}return this.o=function(e){try{const o=e.v;1&e.s?j(l,1,t?t(o):o):n?j(l,1,n(o)):j(l,2,o)}catch(e){j(l,2,e)}},l},e}();function j(e,t,n){if(!e.s){if(n instanceof F){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;const l=e.o;l&&l(e)}}function V(e){return e instanceof F&&1&e.s}const H="undefined"!=typeof Symbol?Symbol.iterator||(Symbol.iterator=Symbol("Symbol.iterator")):"@@iterator";function z(e,t,n){if("function"==typeof e[H]){var l,o,r,a=e[H]();if(function e(i){try{for(;!((l=a.next()).done||n&&n());)if((i=t(l.value))&&i.then){if(!V(i))return void i.then(e,r||(r=j.bind(null,o=new F,2)));i=i.v}o?j(o,1,i):o=i}catch(e){j(o||(o=new F),2,e)}}(),a.return){var i=function(e){try{l.done||a.return()}catch(e){}return e};if(o&&o.then)return o.then(i,function(e){throw i(e)});i()}return o}if(!("length"in e))throw new TypeError("Object is not iterable");for(var s=[],c=0;c<e.length;c++)s.push(e[c]);return function(e,t,n){var l,o,r=-1;return function a(i){try{for(;++r<e.length&&(!n||!n());)if((i=t(r))&&i.then){if(!V(i))return void i.then(a,o||(o=j.bind(null,l=new F,2)));i=i.v}l?j(l,1,i):l=i}catch(e){j(l||(l=new F),2,e)}}(),l}(s,function(e){return t(s[e])},n)}function G(e,t){try{var n=e()}catch(e){return t(e)}return n&&n.then?n.then(void 0,t):n}function $(e){let{setProfilePic:t,closeDrawer:r,userType:a,removeProfilePic:i,showToast:c}=e;const[u,d]=n.useState(null),[m,p]=n.useState(""),[v,g]=n.useState(null),{t:f}=o.useTranslation();return n.useEffect(()=>{!function(){try{g(null);const e=function(){if(m){const e=function(){if(m.size>=1e6)c("error",f("CORE_COMMON_PROFILE_MAXIMUM_UPLOAD_SIZE_EXCEEDED")),g(f("CORE_COMMON_PROFILE_MAXIMUM_UPLOAD_SIZE_EXCEEDED"));else{const e=G(function(){return Promise.resolve(Digit.UploadServices.Filestorage(a+"-profile",m,Digit.ULBService.getStateId())).then(function(e){var n,l;if((null==e||null===(n=e.data)||void 0===n||null===(l=n.files)||void 0===l?void 0:l.length)>0){var o,r;const n=null==e||null===(o=e.data)||void 0===o||null===(r=o.files[0])||void 0===r?void 0:r.fileStoreId;d(n),t(n)}else c("error",f("CORE_COMMON_PROFILE_FILE_UPLOAD_ERROR")),g(f("CORE_COMMON_PROFILE_FILE_UPLOAD_ERROR"))})},function(){c("error",f("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]),l.createElement(l.Fragment,null,l.createElement("div",{style:{position:"fixed",top:"0",left:"0",right:"0",bottom:"0",width:"100%",height:"100vh",backgroundColor:"rgba(0,0,0,.5)"},onClick:()=>r()}),l.createElement("div",{style:{width:"100%",justifyContent:"space-between",display:"flex",backgroundColor:"white",alignItems:"center",position:"fixed",left:"0",right:"0",height:"20%",bottom:"citizen"===a?"2.5rem":"0",zIndex:"1000"}},l.createElement("div",{style:{display:"flex",flex:"1",flexDirection:"column",width:"100%",justifyContent:"center",alignItems:"center",gap:"8px 0"}},l.createElement("label",{for:"file",style:{cursor:"pointer"}}," ",l.createElement(s.GalleryIcon,null)),l.createElement("label",{style:{cursor:"pointer"}}," Gallery"),l.createElement("input",{type:"file",id:"file",accept:"image/*, .png, .jpeg, .jpg",onChange:e=>p(e.target.files[0]),style:{display:"none"}})),l.createElement("div",{style:{display:"flex",flex:"1",width:"100%",justifyContent:"center",alignItems:"center",flexDirection:"column",gap:"8px 0"}},l.createElement("button",{onClick:()=>{i(),r()}},l.createElement(s.RemoveIcon,null)),l.createElement("label",{style:{cursor:"pointer"}},"Remove"))))}"undefined"!=typeof Symbol&&(Symbol.asyncIterator||(Symbol.asyncIterator=Symbol("Symbol.asyncIterator")));const W=e=>{var r,a,c,u,d,m,p,v,g,f,E;let{stateCode:y,userType:h,cityDetails:C}=e;i.useHistory();const{t:b}=o.useTranslation(),S=window.location.href,O=Digit.ULBService.getStateId(),I=Digit.ULBService.getCurrentTenantId(),w=(null===(r=Digit.UserService.getUser())||void 0===r?void 0:r.info)||{},[_,D]=n.useState(null),[T,L]=n.useState(null!=w&&w.name?w.name:""),[R,P]=n.useState(null!=w&&w.emailId?w.emailId:""),[A,x]=n.useState(null==_?void 0:_.gender),[M,k]=n.useState(null!=w&&w.permanentCity?w.permanentCity:C.name),[U,B]=n.useState(null!=w&&w.mobileNumber?w.mobileNumber:""),[F,j]=n.useState(null),[V,H]=n.useState(""),[z,W]=n.useState(!1),[q,X]=n.useState(!1),[Z,Y]=n.useState(""),[J,K]=n.useState(""),[Q,ee]=n.useState(""),[te,ne]=n.useState(null),[le,oe]=n.useState(!1),[re,ae]=l.useState(window.innerWidth),[ie,se]=l.useState({}),ce=window.Digit.Utils.browser.isMobile();l.useEffect(()=>(window.addEventListener("resize",()=>ae(window.innerWidth)),()=>{window.removeEventListener("resize",()=>ae(window.innerWidth))})),n.useEffect(()=>{var e;oe(!0),function(){try{const e=null==w?void 0:w.uuid,t=function(){if(e)return Promise.resolve(Digit.UserService.userSearch(I,{uuid:[e]},{})).then(function(e){e&&e.user&&e.user.length&&D(e.user[0])})}();Promise.resolve(t&&t.then?t.then(function(){}):void 0)}catch(e){return Promise.reject(e)}}(),x({i18nKey:void 0,code:null==_?void 0:_.gender,value:null==_?void 0:_.gender});const t=null==_||null===(e=_.photo)||void 0===e?void 0:e.split(",");H(null==t?void 0:t.at(0)),oe(!1)},[null!==_]);let ue={};const de=e=>x(e),me=()=>W(!1),pe=e=>{L(e),!new RegExp(/^[a-zA-Z ]+$/i).test(e)||0===e.length||e.length>50?se({...ie,userName:{type:"pattern",message:"CORE_COMMON_PROFILE_NAME_INVALID"}}):se({...ie,userName:null})},ve=e=>{(null==w?void 0:w.userName)!==e?(P(e),!e.length||e.includes("@")&&e.includes(".")?se({...ie,emailAddress:null}):se({...ie,emailAddress:{type:"pattern",message:"CORE_COMMON_PROFILE_EMAIL_INVALID"}})):se({...ie,emailAddress:null})},ge=function(e,t,n){void 0===n&&(n=5e3),ne({key:e,action:t}),setTimeout(()=>{ne(null)},n)},fe=function(){try{let t=!1;function e(e){if(t)return e;oe(!1)}oe(!0);const n=G(function(){const e={...w,name:T,gender:null==A?void 0:A.value,emailId:R,photo:F};if(!new RegExp(/^([a-zA-Z ])*$/).test(T)||""===T||T.length>50||T.length<1)throw JSON.stringify({type:"error",message:b("CORE_COMMON_PROFILE_NAME_INVALID")});if("employee"===h&&!new RegExp(/^[6-9]{1}[0-9]{9}$/).test(U))throw JSON.stringify({type:"error",message:b("CORE_COMMON_PROFILE_MOBILE_NUMBER_INVALID")});if(R.length&&(!R.includes("@")||!R.includes(".")))throw JSON.stringify({type:"error",message:b("CORE_COMMON_PROFILE_EMAIL_INVALID")});if(q&&(Z.length||J.length||Q.length)){if(J!==Q)throw JSON.stringify({type:"error",message:b("CORE_COMMON_PROFILE_PASSWORD_MISMATCH")});if(!(Z.length&&J.length&&Q.length))throw JSON.stringify({type:"error",message:b("CORE_COMMON_PROFILE_PASSWORD_INVALID")});if(!new RegExp(/^([a-zA-Z0-9@#$%]{8,15})$/i).test(J)&&!new RegExp(/^([a-zA-Z0-9@#$%]{8,15})$/i).test(Q))throw JSON.stringify({type:"error",message:b("CORE_COMMON_PROFILE_PASSWORD_INVALID")})}return Promise.resolve(Digit.UserService.updateUser(e,y)).then(function(e){let{responseInfo:t}=e;if(t&&"200"===t.status){const e=Digit.UserService.getUser();e&&Digit.UserService.setUser({...e,info:{...e.info,name:T,mobileNumber:U,emailId:R,permanentCity:M}})}return function(){if(Z.length&&J.length&&Q.length){const e={existingPassword:Z,newPassword:J,tenantId:I,type:"EMPLOYEE",username:null==w?void 0:w.userName,confirmPassword:Q};return function(){if(J===Q)return G(function(){return Promise.resolve(Digit.UserService.changePassword(e,I)).then(function(e){const{responseInfo:t}=e;if(null==t||!t.status||"200"!==t.status)throw"";ge("success",b("CORE_COMMON_PROFILE_UPDATE_SUCCESS_WITH_PASSWORD"),5e3),setTimeout(()=>Digit.UserService.logout(),2e3)})},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&&ge("success",b("CORE_COMMON_PROFILE_UPDATE_SUCCESS"),5e3)}()})},function(e){const t=JSON.parse(e);ge(t.type,b(t.message),5e3)});return Promise.resolve(n&&n.then?n.then(e):e(n))}catch(e){return Promise.reject(e)}};let Ee=[];const{data:ye}=Digit.Hooks.useGenderMDMS(O,"common-masters","GenderType");return ye&&ye.map(e=>{Ee.push({i18nKey:"PT_COMMON_GENDER_"+e.code,code:""+e.code,value:""+e.code})}),le?l.createElement(t.Loader,null):l.createElement("div",{className:"user-profile"},l.createElement("section",{style:{margin:"citizen"===h||ce?"8px":"24px"}},"citizen"===h||ce?l.createElement(t.BackLink,null):l.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")}]})),l.createElement("div",{style:{display:"flex",flex:1,flexDirection:re<768||"citizen"===h?"column":"row",margin:"citizen"===h?"8px":"16px",gap:"citizen"===h?"":"0 24px",boxShadow:"citizen"===h?"1px 1px 4px 0px rgba(0,0,0,0.2)":"",background:"citizen"===h?"white":"",borderRadius:"citizen"===h?"4px":"",maxWidth:"citizen"===h?"960px":""}},l.createElement("section",{style:{position:"relative",display:"flex",flex:"citizen"===h?1:2.5,justifyContent:"center",alignItems:"center",maxWidth:"100%",borderRadius:"4px",boxShadow:"citizen"===h?"":"1px 1px 4px 0px rgba(0,0,0,0.2)",border:("citizen"===h?"8px":"24px")+" solid #fff",background:"#EEEEEE",padding:"citizen"===h?"8px":"16px"}},l.createElement("div",{style:{position:"relative",height:"citizen"===h?"114px":"150px",width:"citizen"===h?"114px":"150px",margin:"16px"}},l.createElement("img",{style:{margin:"auto",borderRadius:"300px",justifyContent:"center",height:"100%",width:"100%"},src:V&&""!==V?V:"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"}),l.createElement("button",{style:{position:"absolute",left:"50%",bottom:"-24px",transform:"translateX(-50%)"},onClick:()=>W(!z)},l.createElement(s.CameraIcon,null)))),l.createElement("section",{style:{display:"flex",flexDirection:"column",flex:"citizen"===h?1:7.5,width:"100%",borderRadius:"4px",height:"fit-content",boxShadow:"citizen"===h?"":"1px 1px 4px 0px rgba(0,0,0,0.2)",background:"white",padding:"citizen"===h?"8px":"24px",paddingBottom:"20px"}},"citizen"===h?l.createElement(l.Fragment,null,l.createElement(t.LabelFieldPair,null,l.createElement(t.CardLabel,{style:{}},""+b("CORE_COMMON_PROFILE_NAME"),"*"),l.createElement("div",{style:{width:"100%",maxWidth:"960px"}},l.createElement(t.TextInput,N({t:b,style:{width:"100%"},type:"text",isMandatory:!1,name:"name",value:T,onChange:e=>pe(e.target.value)},ue={isRequired:!0,pattern:"^[a-zA-Z-.`' ]*$",type:"tel",title:b("CORE_COMMON_PROFILE_NAME_ERROR_MESSAGE")},{disable:!1})),(null==ie?void 0:ie.userName)&&l.createElement(t.ErrorMessage,{message:b(null==ie||null===(u=ie.userName)||void 0===u?void 0:u.message),truncateMessage:!0,maxLength:256,className:"",wrapperClassName:"",showIcon:!0}))),l.createElement(t.LabelFieldPair,null,l.createElement(t.CardLabel,{style:{}},""+b("CORE_COMMON_PROFILE_GENDER")),l.createElement(t.Dropdown,{style:{width:"100%"},className:"form-field",selected:1===(null==A?void 0:A.length)?A[0]:A,disable:1===(null==A?void 0:A.length)||!1,option:Ee,select:de,value:A,optionKey:"code",t:b,name:"gender"})),l.createElement(t.LabelFieldPair,null,l.createElement(t.CardLabel,{style:{}},""+b("CORE_COMMON_PROFILE_EMAIL")),l.createElement("div",{style:{width:"100%"}},l.createElement(t.TextInput,{t:b,style:{width:"100%"},type:"email",isMandatory:!1,optionKey:"i18nKey",name:"email",value:R,onChange:e=>ve(e.target.value),disabled:!1}),(null==ie?void 0:ie.emailAddress)&&l.createElement(t.ErrorMessage,{message:b(null==ie||null===(d=ie.emailAddress)||void 0===d?void 0:d.message),truncateMessage:!0,maxLength:256,className:"",wrapperClassName:"",showIcon:!0}))),l.createElement("button",{onClick:fe,style:{marginTop:"24px",backgroundColor:"#F47738",width:"100%",height:"40px",color:"white",maxWidth:ce?"100%":"240px",borderBottom:"1px solid black"}},b("CORE_COMMON_SAVE"))):l.createElement(l.Fragment,null,l.createElement(t.LabelFieldPair,{style:{display:"flex"}},l.createElement(t.CardLabel,{className:"profile-label-margin",style:{width:"300px"}},""+b("CORE_COMMON_PROFILE_NAME"),"*"),l.createElement("div",{style:{width:"100%"}},l.createElement(t.TextInput,N({t:b,type:"text",isMandatory:!1,name:"name",value:T,onChange:e=>pe(e.target.value),placeholder:"Enter Your Name"},ue={isRequired:!0,pattern:"^[a-zA-Z-.`' ]*$",type:"text",title:b("CORE_COMMON_PROFILE_NAME_ERROR_MESSAGE")},{disabled:!1})),(null==ie?void 0:ie.userName)&&l.createElement(t.ErrorMessage,{message:b(null==ie||null===(m=ie.userName)||void 0===m?void 0:m.message),truncateMessage:!0,maxLength:256,className:"",wrapperClassName:"",showIcon:!0}))),l.createElement(t.LabelFieldPair,{style:{display:"flex"}},l.createElement(t.CardLabel,{className:"profile-label-margin",style:{width:"300px"}},""+b("CORE_COMMON_PROFILE_GENDER")),l.createElement("div",{style:{width:"100%"}},l.createElement(t.Dropdown,{selected:1===(null==A?void 0:A.length)?A[0]:A,disable:1===(null==A?void 0:A.length)||!1,option:Ee,select:de,value:A,optionKey:"code",t:b,name:"gender"}))),l.createElement(t.LabelFieldPair,{style:{display:"flex"}},l.createElement(t.CardLabel,{className:"profile-label-margin",style:{width:"300px"}},""+b("CORE_COMMON_PROFILE_CITY")),l.createElement("div",{style:{width:"100%"}},l.createElement(t.TextInput,N({t:b,type:"text",isMandatory:!1,name:"city",value:b(Digit.Utils.locale.getTransformedLocale("TENANT_TENANTS_"+I)),onChange:e=>k(e.target.value),placeholder:"Enter Your City Name"},ue={isRequired:!0,type:"text",title:b("CORE_COMMON_PROFILE_CITY_ERROR_MESSAGE")},{disabled:!0})),l.createElement(t.ErrorMessage,null))),l.createElement(t.LabelFieldPair,{style:{display:"flex"}},l.createElement(t.CardLabel,{className:"profile-label-margin",style:{width:"300px"}},b("CORE_COMMON_PROFILE_MOBILE_NUMBER")+"*"),l.createElement("div",{style:{width:"100%"}},l.createElement(t.MobileNumber,{value:U,style:{width:"100%"},name:"mobileNumber",placeholder:"Enter a valid Mobile No.",onChange:e=>(e=>{B(e),"employee"!==h||new RegExp(/^[6-9]{1}[0-9]{9}$/).test(e)?se({...ie,mobileNumber:null}):se({...ie,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==ie?void 0:ie.mobileNumber)&&l.createElement(t.ErrorMessage,{message:b(null==ie||null===(p=ie.mobileNumber)||void 0===p?void 0:p.message),truncateMessage:!0,maxLength:256,className:"",wrapperClassName:"",showIcon:!0}))),l.createElement(t.LabelFieldPair,{style:{display:"flex"}},l.createElement(t.CardLabel,{className:"profile-label-margin",style:{width:"300px"}},""+b("CORE_COMMON_PROFILE_EMAIL")),l.createElement("div",{style:{width:"100%"}},l.createElement(t.TextInput,{t:b,type:"email",isMandatory:!1,placeholder:b("EMAIL_VALIDATION"),optionKey:"i18nKey",name:"email",value:R,onChange:e=>ve(e.target.value),disabled:!1}),(null==ie?void 0:ie.emailAddress)&&l.createElement(t.ErrorMessage,{message:b(null==ie||null===(v=ie.emailAddress)||void 0===v?void 0:v.message),truncateMessage:!0,maxLength:256,className:"",wrapperClassName:"",showIcon:!0}))),l.createElement(t.LabelFieldPair,null,l.createElement("div",{style:{width:"100%"}},0==q?l.createElement(t.Button,{label:b("CORE_COMMON_CHANGE_PASSWORD"),variation:"teritiary",onClick:()=>X(!q),style:{paddingLeft:"0rem"}}):null,q?l.createElement("div",{style:{marginTop:"10px"}},l.createElement(t.LabelFieldPair,{style:{display:"flex"}},l.createElement(t.CardLabel,{className:"profile-label-margin",style:{width:"300px"}},""+b("CORE_COMMON_PROFILE_CURRENT_PASSWORD")),l.createElement("div",{style:{width:"100%"}},l.createElement(t.TextInput,{t:b,type:"password",isMandatory:!1,name:"name",pattern:"^([a-zA-Z0-9@#$%])+$",onChange:e=>{return Y(t=e.target.value),void(new RegExp(/^([a-zA-Z0-9@#$%]{8,15})$/i).test(t)?se({...ie,currentPassword:null}):se({...ie,currentPassword:{type:"pattern",message:"CORE_COMMON_PROFILE_PASSWORD_INVALID"}}));var t},disabled:!1}),(null==ie?void 0:ie.currentPassword)&&l.createElement(t.ErrorMessage,{message:b(null==ie||null===(g=ie.currentPassword)||void 0===g?void 0:g.message),truncateMessage:!0,maxLength:256,className:"",wrapperClassName:"",showIcon:!0}))),l.createElement(t.LabelFieldPair,{style:{display:"flex"}},l.createElement(t.CardLabel,{className:"profile-label-margin",style:{width:"300px"}},""+b("CORE_COMMON_PROFILE_NEW_PASSWORD")),l.createElement("div",{style:{width:"100%"}},l.createElement(t.TextInput,{t:b,type:"password",isMandatory:!1,name:"name",pattern:"^([a-zA-Z0-9@#$%])+$",onChange:e=>{return K(t=e.target.value),void(new RegExp(/^([a-zA-Z0-9@#$%]{8,15})$/i).test(t)?se({...ie,newPassword:null}):se({...ie,newPassword:{type:"pattern",message:"CORE_COMMON_PROFILE_PASSWORD_INVALID"}}));var t},disabled:!1}),(null==ie?void 0:ie.newPassword)&&l.createElement(t.ErrorMessage,{message:b(null==ie||null===(f=ie.newPassword)||void 0===f?void 0:f.message),truncateMessage:!0,maxLength:256,className:"",wrapperClassName:"",showIcon:!0}))),l.createElement(t.LabelFieldPair,{style:{display:"flex"}},l.createElement(t.CardLabel,{className:"profile-label-margin",style:{width:"300px"}},""+b("CORE_COMMON_PROFILE_CONFIRM_PASSWORD")),l.createElement("div",{style:{width:"100%"}},l.createElement(t.TextInput,{t:b,type:"password",isMandatory:!1,name:"name",pattern:"^([a-zA-Z0-9@#$%])+$",onChange:e=>{return ee(t=e.target.value),void(new RegExp(/^([a-zA-Z0-9@#$%]{8,15})$/i).test(t)?se({...ie,confirmPassword:null}):se({...ie,confirmPassword:{type:"pattern",message:"CORE_COMMON_PROFILE_PASSWORD_INVALID"}}));var t},disabled:!1}),(null==ie?void 0:ie.confirmPassword)&&l.createElement(t.ErrorMessage,{message:b(null==ie||null===(E=ie.confirmPassword)||void 0===E?void 0:E.message),truncateMessage:!0,maxLength:256,className:"",wrapperClassName:"",showIcon:!0})))):"")),"employee"===h&&ce?l.createElement("button",{onClick:fe,style:{marginTop:"24px",backgroundColor:"#F47738",width:"100%",height:"40px",color:"white",maxWidth:ce?"100%":"240px",borderBottom:"1px solid black",fontWeight:"700",fontSize:"17px"}},b("CORE_COMMON_SAVE")):null))),"employee"!==h||ce?null:l.createElement(t.ActionBar,{actionFields:[l.createElement(t.SubmitBar,{t:b,label:b("CORE_COMMON_SAVE"),onSubmit:fe})],className:"",setactionFieldsToRight:!0}),te&&l.createElement(t.Toast,{type:te.key,label:b("success"===te.key?"CORE_COMMON_PROFILE_UPDATE_SUCCESS":te.action),onClose:()=>ne(null),style:{maxWidth:"670px"}}),1==z?l.createElement($,{setProfilePic:function(e){try{function t(e){H(null==e?void 0:e.thumbs[0]),me()}return j(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(e=>e.url.split(",")[3]),images:e.data.fileStoreIds.map(e=>Digit.Utils.getFileUrl(e.url))}:null})}catch(e){return Promise.reject(e)}}([e],O)).then(t):t(null))}catch(e){return Promise.reject(e)}},closeDrawer:me,userType:h,removeProfilePic:()=>{j(null),H(null)},showToast:ge}):"")},q=e=>{var r,a,i;let{module:c}=e;const u=Digit.UserService.getUser(),{t:d}=((null==u||null===(r=u.info)||void 0===r?void 0:r.tenantId)||Digit.ULBService.getCurrentTenantId(),o.useTranslation()),m=Digit.SessionStorage.get("initData").stateInfo,p=Digit.StoreData.getCurrentLanguage(),[v,g]=n.useState(p),[f,E]=n.useState(!1),[y,h]=n.useState(""),C=()=>l.createElement("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},l.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"})),{isLoading:b,data:S}=Digit.Hooks.useGetHowItWorksJSON(Digit.ULBService.getStateId()),O=null==S||null===(a=S.MdmsRes["common-masters"])||void 0===a||null===(i=a.howItWorks[0])||void 0===i?void 0:i[""+c];return b?l.createElement(t.Loader,null):l.createElement(n.Fragment,null,l.createElement("div",{className:"how-it-works-page"},l.createElement(t.BackButton,null),l.createElement("div",{className:"how-it-works-page-header"},l.createElement(t.Header,null,d(O.screenHeader?O.screenHeader:"HOW_IT_WORKS"))),l.createElement("div",{className:"language-selector",style:{margin:"10px"}},[{label:"ENGLISH",value:"en_IN"},{label:"हिंदी",value:"hi_IN"}].map((e,t)=>l.createElement("div",{className:"language-button-container",key:t},l.createElement(s.CustomButton,{selected:e.value===v,text:e.label,onClick:()=>(e=>{g(e.value),Digit.LocalizationService.changeLanguage(e.value,m.code)})(e)})))),O.videosJson.map((e,t)=>l.createElement("div",null,l.createElement("div",{className:"WhatsNewCard",style:{float:"left",position:"relative",width:"100%",marginBottom:10}},l.createElement("div",{className:"video-icon",onClick:()=>{return t=e,h("hi_IN"===v?t.hi_IN:t.en_IN),void E(!0);var t}},l.createElement("div",{className:"vid-svg"},l.createElement(C,null))),l.createElement("div",{className:"how-it-works-header-description"},l.createElement("h2",null,d(e.headerLabel)),l.createElement("p",null,d(e.description)))))),O.pdfHeader&&O.pdfDesc&&l.createElement("div",{className:"WhatsNewCard",style:{position:"relative",width:"100%",marginBottom:10,display:"inline-block"}},l.createElement("div",{className:"how-it-works-pdf-section"},l.createElement("div",{className:"pdf-icon-header-desc"},l.createElement("div",{className:"pdf-icon"},l.createElement(t.PDFSvg,null)),l.createElement("div",{className:"pdf-header-desc"},l.createElement("h2",null,d(O.pdfHeader)),l.createElement("p",null,d(O.pdfDesc)))),l.createElement("div",{className:"download-icon"},l.createElement(t.DownloadImgIcon,null)))),f&&l.createElement("div",{className:"how-it-works-video-play"},l.createElement("div",{className:"close-button"},l.createElement(t.CloseSvg,{onClick:()=>{E(!1)}})),l.createElement("video",{width:500,height:500,controls:!0,autoPlay:!0},l.createElement("source",{src:y,type:"video/mp4"})))))},X=[{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}}]}],Z=e=>{let{t:n,onSelect:o,mobileNumber:r,onMobileChange:a,config:i,canSubmit:s}=e;return l.createElement(t.FormStep,{isDisabled:!(10===r.length&&s),onSelect:o,config:i,t:n,componentInFront:"+91",onChange:a,value:r})},Y=e=>{let{config:n,onSelect:o,t:r,isDisabled:a}=e;return l.createElement(t.FormStep,{config:n,onSelect:o,t:r,isDisabled:a})};function J(e,t){const l=n.useRef();n.useEffect(()=>{l.current=e},[e]),n.useEffect(()=>{if(null!==t){const e=setInterval(function(){l.current()},t);return()=>clearInterval(e)}},[t])}const K=e=>{let{config:o,otp:r,onOtpChange:a,onResend:i,onSelect:s,t:c,error:u,userType:d="citizen",canSubmit:m}=e;const[p,v]=n.useState(30);J(()=>{v(p-1)},p>0?1e3:null);const g=()=>{i(),v(2)};return"employee"===d?l.createElement(n.Fragment,null,l.createElement(t.OTPInput,{length:6,onChange:a,value:r}),p>0?l.createElement(t.CardText,null,`${c("CS_RESEND_ANOTHER_OTP")} ${p} ${c("CS_RESEND_SECONDS")}`):l.createElement("p",{className:"card-text-button resend-otp",onClick:g},c("CS_RESEND_OTP")),!u&&l.createElement(t.CardLabelError,null,c("CS_INVALID_OTP"))):l.createElement(t.FormStep,{onSelect:s,config:o,t:c,isDisabled:!(6===(null==r?void 0:r.length)&&m)},l.createElement(t.OTPInput,{length:6,onChange:a,value:r}),p>0?l.createElement(t.CardText,null,`${c("CS_RESEND_ANOTHER_OTP")} ${p} ${c("CS_RESEND_SECONDS")}`):l.createElement("p",{className:"card-text-button",onClick:g},c("CS_RESEND_OTP")),!u&&l.createElement(t.CardLabelError,null,c("CS_INVALID_OTP")))};var Q;const ee={type:"register"},te={type:"login"},ne=`/${null===(Q=window)||void 0===Q?void 0:Q.contextPath}/citizen`,le=(e,t)=>(null==e?void 0:e.from)||(null==t?void 0:t.from)||ne,oe=e=>{var r,a;let{stateCode:s,isUserRegistered:c=!0}=e;const{t:u}=o.useTranslation(),d=i.useLocation(),{path:m}=i.useRouteMatch(),p=i.useHistory(),[v,g]=n.useState(null),[f,E]=n.useState(null),[y,h]=n.useState(!0),[C,b]=n.useState(null),[S,O]=n.useState(c?{}:null==d||null===(r=d.state)||void 0===r?void 0:r.data),[N,I]=n.useState(null),w=Digit.Hooks.useQueryParams(),[_,D]=n.useState(!1),[T,L]=n.useState(!0),[R,P]=n.useState(!0);n.useEffect(()=>{let e;return f&&(N&&(clearTimeout(N),I(null)),e=setTimeout(()=>{E("")},5e3),I(e)),()=>{e&&clearTimeout(e)}},[f]),n.useEffect(()=>{var e;if(!v)return;Digit.SessionStorage.set("citizen.userRequestObject",v),Digit.UserService.setUser(v),((e,t,n)=>{var l,o;let r=null===(l=JSON.parse(sessionStorage.getItem("Digit.initData")))||void 0===l||null===(o=l.value)||void 0===o?void 0:o.selectedLanguage;localStorage.setItem("Citizen.tenant-id",n),localStorage.setItem("tenant-id",n),localStorage.setItem("citizen.userRequestObject",JSON.stringify(e)),localStorage.setItem("locale",r),localStorage.setItem("Citizen.locale",r),localStorage.setItem("token",t),localStorage.setItem("Citizen.token",t),localStorage.setItem("user-info",JSON.stringify(e)),localStorage.setItem("Citizen.user-info",JSON.stringify(e))})(null==v?void 0:v.info,null==v?void 0:v.access_token,s);const t=(null===(e=d.state)||void 0===e?void 0:e.from)||ne;var n;Digit.ULBService.getCitizenCurrentTenant(!0)?p.replace(t):p.replace(`/${null===(n=window)||void 0===n?void 0:n.contextPath}/citizen/select-location`,{redirectBackTo:t})},[v]);const A=n.useMemo(()=>X.map(e=>{const t={};for(const n in e.texts)t[n]=u(e.texts[n]);return{...e,texts:t}},[X])),x=()=>Digit.UserService.getType(),M=function(e){return Promise.resolve(G(function(){return Promise.resolve(Digit.UserService.sendOtp(e,s)).then(function(e){return[e,null]})},function(e){return[null,e]}))};return l.createElement("div",{className:"citizen-form-wrapper"},l.createElement(i.Switch,null,l.createElement(t.AppContainer,null,l.createElement(t.BackButton,null),l.createElement(i.Route,{path:""+m,exact:!0},l.createElement(Z,{onSelect:function(e){try{P(!1),O({...S,...e});const t={...e,tenantId:s,userType:x()};return Promise.resolve(c?Promise.resolve(M({otp:{...t,...te}})).then(function(e){var n;let[l,o]=e;var r,a,i;if(!o)return P(!0),void p.replace(m+"/otp",{from:le(d.state,w),role:null===(r=d.state)||void 0===r?void 0:r.role});P(!0),d.state&&"FSM_DSO"===d.state.role||p.push(`/${null===(a=window)||void 0===a?void 0:a.contextPath}/citizen/register/name`,{from:le(d.state,w),data:t}),null!==(n=d.state)&&void 0!==n&&n.role&&(P(!0),E("FSM_DSO"===(null===(i=d.state)||void 0===i?void 0:i.role)?u("ES_ERROR_DSO_LOGIN"):"User not registered."))}):Promise.resolve(M({otp:{...t,...ee}})).then(function(e){let[t,n]=e;if(!n)return P(!0),void p.replace(m+"/otp",{from:le(d.state,w)});P(!0)}))}catch(e){return Promise.reject(e)}},config:A[0],mobileNumber:S.mobileNumber||"",onMobileChange:e=>{const{value:t}=e.target;O({...S,mobileNumber:t})},canSubmit:R,showRegisterLink:c&&!(null!==(a=d.state)&&void 0!==a&&a.role),t:u})),l.createElement(i.Route,{path:m+"/otp"},l.createElement(K,{config:{...A[1],texts:{...A[1].texts,cardText:`${A[1].texts.cardText} ${S.mobileNumber||""}`}},onOtpChange:e=>{O({...S,otp:e})},onResend:function(){try{const{mobileNumber:e}=S,t={mobileNumber:e,tenantId:s,userType:x()},n=function(){if(!c)return Promise.resolve(M({otp:{...t,...ee}})).then(function(){});{const e=function(){if(c)return Promise.resolve(M({otp:{...t,...te}})).then(function(){})}();if(e&&e.then)return e.then(function(){})}}();return Promise.resolve(n&&n.then?n.then(function(){}):void 0)}catch(e){return Promise.reject(e)}},onSelect:function(){try{return Promise.resolve(G(function(){h(!0),L(!1);const{mobileNumber:e,otp:t,name:n}=S;return function(){if(c){const n={username:e,password:t,tenantId:s,userType:x()};return Promise.resolve(Digit.UserService.authenticate(n)).then(function(e){var t,n,l;let{UserRequest:o,...r}=e;if(null!==(t=d.state)&&void 0!==t&&t.role){const e=o.roles.find(e=>e.code===d.state.role);if(!e||!e.code)return E(u("ES_ERROR_USER_NOT_PERMITTED")),void setTimeout(()=>p.replace(ne),5e3)}null!==(n=window)&&void 0!==n&&null!==(l=n.globalConfigs)&&void 0!==l&&l.getConfig("ENABLE_SINGLEINSTANCE")&&(o.tenantId=Digit.ULBService.getStateId()),g({info:o,...r})})}{const l=function(){if(!c)return Promise.resolve(Digit.UserService.registerUser({name:n,username:e,otpReference:t,tenantId:s},s)).then(function(e){var t,n;let{UserRequest:l,...o}=e;null!==(t=window)&&void 0!==t&&null!==(n=t.globalConfigs)&&void 0!==n&&n.getConfig("ENABLE_SINGLEINSTANCE")&&(l.tenantId=Digit.ULBService.getStateId()),g({info:l,...o})})}();if(l&&l.then)return l.then(function(){})}}()},function(){L(!0),h(!1)}))}catch(e){return Promise.reject(e)}},otp:S.otp,error:y,canSubmit:T,t:u})),l.createElement(i.Route,{path:m+"/name"},l.createElement(Y,{config:A[2],onSelect:function(e){try{const t={...S,tenantId:s,userType:x(),...e};return O({...S,...e}),D(!0),Promise.resolve(M({otp:{...t,...ee}})).then(function(e){let[t,n]=e;t?(D(!1),p.replace(m+"/otp",{from:le(d.state,w)})):D(!1)})}catch(e){return Promise.reject(e)}},t:u,isDisabled:_})),f&&l.createElement(t.Toast,{type:"error",label:f,onClose:()=>E(null)}))))};var re=e=>e instanceof HTMLElement;const ae={onBlur:"onBlur",onChange:"onChange",onSubmit:"onSubmit",onTouched:"onTouched",all:"all"};var ie=e=>null==e;const se=e=>"object"==typeof e;var ce=e=>!ie(e)&&!Array.isArray(e)&&se(e)&&!(e instanceof Date),ue=e=>/^\w*$/.test(e),de=e=>e.filter(Boolean),me=e=>de(e.replace(/["|']/g,"").replace(/\[/g,".").replace(/\]/g,"").split("."));function pe(e,t,n){let l=-1;const o=ue(t)?[t]:me(t),r=o.length,a=r-1;for(;++l<r;){const t=o[l];let r=n;if(l!==a){const n=e[t];r=ce(n)||Array.isArray(n)?n:isNaN(+o[l+1])?{}:[]}e[t]=r,e=e[t]}return e}var ve=function(e,t){void 0===t&&(t={});for(const n in e)ue(n)?t[n]=e[n]:pe(t,n,e[n]);return t},ge=e=>void 0===e,fe=function(e,t,n){void 0===e&&(e={});const l=de(t.split(/[,[\].]+?/)).reduce((e,t)=>ie(e)?e:e[t],e);return ge(l)||l===e?ge(e[t])?n:e[t]:l},Ee=(e,t)=>{re(e)&&e.removeEventListener&&(e.removeEventListener("input",t),e.removeEventListener("change",t),e.removeEventListener("blur",t))};const ye={isValid:!1,value:null};var he=e=>Array.isArray(e)?e.reduce((e,t)=>t&&t.ref.checked?{isValid:!0,value:t.ref.value}:e,ye):ye,Ce=e=>"radio"===e.type,be=e=>"file"===e.type,Se=e=>"checkbox"===e.type,Oe=e=>"select-multiple"===e.type;const Ne={value:!1,isValid:!1},Ie={value:!0,isValid:!0};var we=e=>{if(Array.isArray(e)){if(e.length>1){const t=e.filter(e=>e&&e.ref.checked).map(e=>{let{ref:{value:t}}=e;return t});return{value:t,isValid:!!t.length}}const{checked:t,value:n,attributes:l}=e[0].ref;return t?l&&!ge(l.value)?ge(n)||""===n?Ie:{value:n,isValid:!0}:Ie:Ne}return Ne};function _e(e,t,n,l,o){const r=e.current[t];if(r){const{ref:{value:e,disabled:t},ref:n,valueAsNumber:i,valueAsDate:s,setValueAs:c}=r;if(t&&l)return;return be(n)?n.files:Ce(n)?he(r.options).value:Oe(n)?(a=n.options,[...a].filter(e=>{let{selected:t}=e;return t}).map(e=>{let{value:t}=e;return t})):Se(n)?we(r.options).value:o?e:i?""===e?NaN:+e:s?n.valueAsDate:c?c(e):e}var a;if(n)return fe(n.current,t)}function De(e){return!e||e instanceof HTMLElement&&e.nodeType!==Node.DOCUMENT_NODE&&De(e.parentNode)}var Te=e=>ce(e)&&!Object.keys(e).length,Le=e=>"boolean"==typeof e;function Re(e,t){const n=ue(t)?[t]:me(t),l=1==n.length?e:function(e,t){const n=t.slice(0,-1).length;let l=0;for(;l<n;)e=ge(e)?l++:e[t[l++]];return e}(e,n);let o;l&&delete l[n[n.length-1]];for(let t=0;t<n.slice(0,-1).length;t++){let l,r=-1;const a=n.slice(0,-(t+1)),i=a.length-1;for(t>0&&(o=e);++r<a.length;){const t=a[r];l=l?l[t]:e[t],i===r&&(ce(l)&&Te(l)||Array.isArray(l)&&!l.filter(e=>ce(e)&&!Te(e)||Le(e)).length)&&(o?delete o[t]:delete e[t]),o=l}}return e}const Pe=(e,t)=>e&&e.ref===t;var Ae=e=>ie(e)||!se(e);function xe(e,t){if(Ae(e)||Ae(t))return t;for(const n in t){const l=e[n],o=t[n];try{e[n]=ce(l)&&ce(o)||Array.isArray(l)&&Array.isArray(o)?xe(l,o):o}catch(e){}}return e}function Me(e,t,l){if(Ae(e)||Ae(t)||e instanceof Date||t instanceof Date)return e===t;if(!n.isValidElement(e)){const n=Object.keys(e),o=Object.keys(t);if(n.length!==o.length)return!1;for(const o of n){const n=e[o];if(!l||"ref"!==o){const e=t[o];if((ce(n)||Array.isArray(n))&&(ce(e)||Array.isArray(e))?!Me(n,e,l):n!==e)return!1}}}return!0}function ke(e,t,n,l,o){let r=-1;for(;++r<e.length;){for(const l in e[r])Array.isArray(e[r][l])?(!n[r]&&(n[r]={}),n[r][l]=[],ke(e[r][l],fe(t[r]||{},l,[]),n[r][l],n[r],l)):Me(fe(t[r]||{},l),e[r][l])?pe(n[r]||{},l):n[r]=Object.assign(Object.assign({},n[r]),{[l]:!0});l&&!n.length&&delete l[o]}return n}var Ue=e=>"string"==typeof e,Be=(e,t,n,l,o)=>{const r={};for(const t in e.current)(ge(o)||(Ue(o)?t.startsWith(o):Array.isArray(o)&&o.find(e=>t.startsWith(e))))&&(r[t]=_e(e,t,void 0,l));return n?ve(r):xe(t,ve(r))},Fe=e=>e instanceof RegExp,je=e=>ce(e)&&!Fe(e)?e:{value:e,message:""},Ve=e=>"function"==typeof e,He=e=>Ue(e)||n.isValidElement(e);function ze(e,t,n){if(void 0===n&&(n="validate"),He(e)||Le(e)&&!e)return{type:n,message:He(e)?e:"",ref:t}}var Ge=(e,t,n,l,o)=>t?Object.assign(Object.assign({},n[e]),{types:Object.assign(Object.assign({},n[e]&&n[e].types?n[e].types:{}),{[l]:o||!0})}):{},$e=function(e,t,n,l){let{ref:o,ref:{value:r},options:a,required:i,maxLength:s,minLength:c,min:u,max:d,pattern:m,validate:p}=n;try{let n=!1;const v=o.name,g={},f=Ce(o),E=Se(o),y=f||E,h=""===r,C=Ge.bind(null,v,t,g),b=function(e,t,n,l,r){void 0===l&&(l="maxLength"),void 0===r&&(r="minLength");const a=e?t:n;g[v]=Object.assign({type:e?l:r,message:a,ref:o},C(e?l:r,a))};if(i&&(!f&&!E&&(h||ie(r))||Le(r)&&!r||E&&!we(a).isValid||f&&!he(a).isValid)){const{value:n,message:l}=He(i)?{value:!!i,message:i}:je(i);if(n&&(g[v]=Object.assign({type:"required",message:l,ref:y?((e.current[v].options||[])[0]||{}).ref:o},C("required",l)),!t))return Promise.resolve(g)}if(!(ie(u)&&ie(d)||""===r)){let e,n;const l=je(d),a=je(u);if(isNaN(r)){const t=o.valueAsDate||new Date(r);Ue(l.value)&&(e=t>new Date(l.value)),Ue(a.value)&&(n=t<new Date(a.value))}else{const t=o.valueAsNumber||parseFloat(r);ie(l.value)||(e=t>l.value),ie(a.value)||(n=t<a.value)}if((e||n)&&(b(!!e,l.message,a.message,"max","min"),!t))return Promise.resolve(g)}if(Ue(r)&&!h&&(s||c)){const e=je(s),n=je(c),l=!ie(e.value)&&r.length>e.value,o=!ie(n.value)&&r.length<n.value;if((l||o)&&(b(l,e.message,n.message),!t))return Promise.resolve(g)}if(Ue(r)&&m&&!h){const{value:e,message:n}=je(m);if(Fe(e)&&!e.test(r)&&(g[v]=Object.assign({type:"pattern",message:n,ref:o},C("pattern",n)),!t))return Promise.resolve(g)}const S=function(){if(p){const r=_e(e,v,l,!1,!0),i=y&&a?a[0].ref:o;return Ve(p)?Promise.resolve(p(r)).then(function(e){const l=ze(e,i);if(l&&(g[v]=Object.assign(Object.assign({},l),C("validate",l.message)),!t))return n=!0,g}):function(){if(ce(p)){let l=!1;function e(){if(!Te(o)&&(g[v]=Object.assign({ref:i},o),!t))return n=!0,g}let o={};const a=z(Object.entries(p),function(e){let[n,a]=e;if(Te(o)||t)return Promise.resolve(a(r)).then(function(e){const l=ze(e,i,n);l&&(o=Object.assign(Object.assign({},l),C(n,l.message)),t&&(g[v]=o))});l=!0},function(){return l});return a&&a.then?a.then(e):e()}}()}}();return Promise.resolve(S&&S.then?S.then(function(e){return n?e:g}):n?S:g)}catch(e){return Promise.reject(e)}};const We=function(e,t,n){void 0===n&&(n=[]);for(const l in t){const o=e+(ce(t)?"."+l:`[${l}]`);Ae(t[l])?n.push(o):We(o,t[l],n)}return n};var qe=(e,t,n,l,o)=>{let r=void 0;return n.add(t),Te(e)||(r=fe(e,t),(ce(r)||Array.isArray(r))&&We(t,r).forEach(e=>n.add(e))),ge(r)?o?l:fe(l,t):r},Xe=e=>{let{isOnBlur:t,isOnChange:n,isOnTouch:l,isTouched:o,isReValidateOnBlur:r,isReValidateOnChange:a,isBlurEvent:i,isSubmitted:s,isOnAll:c}=e;return!c&&(!s&&l?!(o||i):(s?r:t)?!i:!(s?a:n)||i)},Ze=e=>e.substring(0,e.indexOf("[")),Ye=(e,t)=>[...e].some(e=>((e,t)=>RegExp(`^${t}([|.)\\d+`.replace(/\[/g,"\\[").replace(/\]/g,"\\]")).test(e))(t,e)),Je="undefined"!=typeof window&&"undefined"!=typeof document;function Ke(e){var t;let n;if(Ae(e)||Je&&(e instanceof File||re(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 n=new Date(e.getTime()),n;if(e instanceof Set){n=new Set;for(const t of e)n.add(t);return n}if(e instanceof Map){n=new Map;for(const t of e.keys())n.set(t,Ke(e.get(t)));return n}n=Array.isArray(e)?[]:{};for(const t in e)n[t]=Ke(e[t]);return n}var Qe=e=>({isOnSubmit:!e||e===ae.onSubmit,isOnBlur:e===ae.onBlur,isOnChange:e===ae.onChange,isOnAll:e===ae.all,isOnTouch:e===ae.onTouched}),et=e=>Ce(e)||Se(e);const tt="undefined"==typeof window,nt=Je?"Proxy"in window:"undefined"!=typeof Proxy,lt=n.createContext(null);lt.displayName="RHFContext";const ot=e=>{const{as:t,render:l}=e,o=function(e,t){var n={};for(var l in e)Object.prototype.hasOwnProperty.call(e,l)&&t.indexOf(l)<0&&(n[l]=e[l]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(l=Object.getOwnPropertySymbols(e);o<l.length;o++)t.indexOf(l[o])<0&&Object.prototype.propertyIsEnumerable.call(e,l[o])&&(n[l[o]]=e[l[o]])}return n}(e,["rules","as","render","defaultValue","control","onFocus"]),{field:r,meta:a}=function(e){let{name:t,rules:l,defaultValue:o,control:r,onFocus:a}=e;const i=n.useContext(lt);if("production"!==process.env.NODE_ENV&&!r&&!i)throw new Error("📋 Controller is missing `control` prop. https://react-hook-form.com/api#Controller");const{defaultValuesRef:s,setValue:c,register:u,unregister:d,trigger:m,mode:p,reValidateMode:{isReValidateOnBlur:v,isReValidateOnChange:g},formState:f,formStateRef:{current:{isSubmitted:E,touched:y,errors:h}},updateFormState:C,readFormStateRef:b,fieldsRef:S,fieldArrayNamesRef:O,shallowFieldsStateRef:N}=r||i.control,I=!Ye(O.current,t),w=()=>!ge(fe(N.current,t))&&I?fe(N.current,t):ge(o)?fe(s.current,t):o,[_,D]=n.useState(w()),T=n.useRef(_),L=n.useRef({focus:()=>null}),R=n.useRef(a||(()=>{Ve(L.current.focus)&&L.current.focus(),"production"!==process.env.NODE_ENV&&(Ve(L.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"))})),P=n.useCallback(e=>!Xe(Object.assign({isBlurEvent:e,isReValidateOnBlur:v,isReValidateOnChange:g,isSubmitted:E,isTouched:!!fe(y,t)},p)),[v,g,E,y,t,p]),A=n.useCallback(e=>{let[t]=e;const n=(e=>Ae(e)||!ce(e.target)||ce(e.target)&&!e.type?e:ge(e.target.value)?e.target.checked:e.target.value)(t);return D(n),T.current=n,n},[]),x=n.useCallback(e=>{if("production"!==process.env.NODE_ENV&&!t)return console.warn("📋 Field is missing `name` prop. https://react-hook-form.com/api#Controller");S.current[t]?S.current[t]=Object.assign({ref:S.current[t].ref},l):(u(Object.defineProperties({name:t,focus:R.current},{value:{set(e){D(e),T.current=e},get:()=>T.current}}),l),e=ge(fe(s.current,t))),e&&I&&D(w())},[l,t,u]);n.useEffect(()=>()=>d(t),[t]),n.useEffect(()=>{"production"!==process.env.NODE_ENV&&(ge(_)&&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)`),!I&&ge(o)&&console.warn("📋 Controller is missing `defaultValue` prop when using `useFieldArray`. https://react-hook-form.com/api#Controller")),x()},[x]),n.useEffect(()=>{!S.current[t]&&x(!0)});const M=n.useCallback(()=>{b.current.touched&&!fe(y,t)&&(pe(y,t,!0),C({touched:y})),P(!0)&&m(t)},[t,C,P,m,b]);return{field:{onChange:n.useCallback(function(){for(var e=arguments.length,n=new Array(e),l=0;l<e;l++)n[l]=arguments[l];return c(t,A(n),{shouldValidate:P(),shouldDirty:!0})},[c,t,P]),onBlur:M,name:t,value:_,ref:L},meta:Object.defineProperties({invalid:!!fe(h,t)},{isDirty:{get:()=>!!fe(f.dirtyFields,t)},isTouched:{get:()=>!!fe(f.touched,t)}})}}(e),i=Object.assign(Object.assign({},o),r);return t?n.isValidElement(t)?n.cloneElement(t,i):n.createElement(t,i):l?l(r,a):null},rt=e=>{let{control:n,t:o}=e;const r=window.Digit.Utils.browser.isMobile();return l.createElement(Fragment,null,l.createElement(t.SearchField,{className:"pt-form-field"},l.createElement("label",null,o("AUDIT_FROM_DATE_LABEL")),l.createElement(ot,{render:e=>l.createElement(t.DatePicker,{date:e.value,onChange:e.onChange}),name:"fromDate",control:n})),l.createElement(t.SearchField,{className:"pt-form-field"},l.createElement("label",null,o("AUDIT_TO_DATE_LABEL")),l.createElement(ot,{render:e=>l.createElement(t.DatePicker,{date:e.value,onChange:e.onChange}),name:"toDate",control:n})),l.createElement(t.SearchField,{className:"pt-search-action-submit"},l.createElement(t.Button,{style:{marginTop:r?"510px":"25px",marginLeft:r?"0":"-30px",maxWidth:r?"100%":"240px"},label:o("ES_COMMON_APPLY"),submit:!0})))},at=e=>{var o;let{Controller:r,register:a,control:i,t:s,reset:c,previousPage:u,handleSubmit:d,tenantId:m,data:p,onSubmit:v,isLoading:g}=e;const[f,E]=n.useState([]),y=e=>l.createElement("div",{onClick:e.onClick},l.createElement(t.DownloadBtnCommon,null));n.useEffect(()=>{(null==p?void 0:p.length)>0&&E([null==p?void 0:p.map(e=>{let t={};return t[s("AUDIT_DATE_LABEL")]=h(null==e?void 0:e.timestamp),t[s("AUDIT_TIME_LABEL")]=C(null==e?void 0:e.timestamp),t[s("AUDIT_DATAVIEWED_LABEL")]=(null==e?void 0:e.dataView[0])+","+(null==e?void 0:e.dataView[1]),t[s("AUDIT_DATAVIEWED_BY_LABEL")]=null==e?void 0:e.dataViewedBy,t[s("AUDIT_ROLE_LABEL")]=null==e?void 0:e.roles.map(e=>e.name).join(","),{...t}})])},[p]);const h=e=>{if(null==e||null==e||""==e)return"NA";const t=new Date(e);let n=t.getMonth()+1,l=t.getDate();return n=(n>9?"":"0")+n,l=(l>9?"":"0")+l,`${l}/${n}/${t.getFullYear()}`},C=e=>{if(null==e||null==e||""==e)return"NA";const t=new Date(e);let n=t.getHours(),l=t.getMinutes(),o=n>12?"PM":"AM";return n=n>12?n-12:n,n=(n>9?"":"0")+n,l=(l>9?"":"0")+l,`${n}:${l} ${o}`},[b,S]=n.useReducer(function(e,t){switch(t.type){case"set":return t.payload;case"remove":return!1}},!1),O=()=>{S({type:"remove"})},I=()=>l.createElement("div",{className:"InboxMobilePopupCloseButtonWrapper",onClick:O},l.createElement(t.CloseSvg,null)),w={Controller:r,register:a,control:i,t:s,reset:c,previousPage:u},_=n.useCallback(e=>{let{currentlyActiveMobileModal:n,searchFormFieldsComponentProps:o,tenantId:r,...a}=e;return(e=>{let{currentlyActiveMobileModal:n,searchFormFieldsComponentProps:o,tenantId:r,...a}=e;const{closeMobilePopupModal:i}=a;switch(n){case"SearchFormComponent":return l.createElement(t.SearchForm,a,l.createElement(I,null),l.createElement("div",{className:"MobilePopupHeadingWrapper"},l.createElement("h2",null,s("PRIVACY_AUDIT_REPORT"),":")),l.createElement(rt,N({},o,{closeMobilePopupModal:i,tenantId:r,t:s})));default:return l.createElement("span",null)}})({currentlyActiveMobileModal:n,searchFormFieldsComponentProps:o,tenantId:r,...a})},[b]);null==p||null===(o=p.roles)||void 0===o||o.forEach(e=>{});const D=n.useMemo(()=>null!=p&&p.display||""===p?[]:null==p?void 0:p.map(e=>{var t;return{[s("AUDIT_DATE_LABEL")]:h(e.timestamp),[s("AUDIT_TIME_LABEL")]:C(e.timestamp),[s("AUDIT_DATAVIEWED_LABEL")]:e.dataView[0]+","+e.dataView[1],[s("AUDIT_DATAVIEWED_BY_LABEL")]:e.dataViewedBy,[s("AUDIT_ROLE_LABEL")]:null===(t=e.roles.slice(0,3))||void 0===t?void 0:t.map(e=>e.name).join(",")}}),[p]);return l.createElement(l.Fragment,null,l.createElement(t.BackButton,null),l.createElement("div",{className:"sideContent",style:{marginLeft:"70%",marginTop:"-12%"}},l.createElement(y,{className:"mrlg cursorPointer",onClick:()=>(e=>{if(void 0!==(null==e?void 0:e[0]))return Digit.Download.Excel(null==e?void 0:e[0],"AuditReport")})(f)})),l.createElement(t.Header,null,s("PRIVACY_AUDIT_REPORT"),":"),l.createElement("div",{className:"digit-search-box"},l.createElement(t.SearchAction,{text:s("ES_COMMON_SEARCH"),handleActionClick:()=>S({type:"set",payload:"SearchFormComponent"}),tenantId:m,t:s})),b?l.createElement(t.PopUp,null,l.createElement(_,{onSubmit:e=>{S({type:"remove"}),v(e)},handleSubmit:d,id:"search-form",className:"rm-mb form-field-flex-one inboxPopupMobileWrapper",searchFormFieldsComponentProps:w,currentlyActiveMobileModal:b,closeMobilePopupModal:O,tenantId:m})):null,g&&l.createElement(t.Loader,null),l.createElement(t.DetailsCard,{data:D}))},it=e=>{let{tenantId:o,t:r,onSubmit:a,data:i,count:c}=e;const u=Digit.SessionStorage.get("AUDIT_APPLICATION_DETAIL")||{offset:0,limit:5,sortOrder:"DESC"},{register:d,control:m,handleSubmit:p,setValue:v,getValues:g,reset:f}=function(e){let{mode:t=ae.onSubmit,reValidateMode:l=ae.onChange,resolver:o,context:r,defaultValues:a={},shouldFocusError:i=!0,shouldUnregister:s=!0,criteriaMode:c}=void 0===e?{}:e;const u=n.useRef({}),d=n.useRef({}),m=n.useRef({}),p=n.useRef(new Set),v=n.useRef({}),g=n.useRef({}),f=n.useRef({}),E=n.useRef({}),y=n.useRef(a),h=n.useRef(!1),C=n.useRef(!1),b=n.useRef(),S=n.useRef({}),O=n.useRef({}),N=n.useRef(r),I=n.useRef(o),w=n.useRef(new Set),_=n.useRef(Qe(t)),{isOnSubmit:D,isOnTouch:T}=_.current,L=c===ae.all,[R,P]=n.useState({isDirty:!1,isValidating:!1,dirtyFields:{},isSubmitted:!1,submitCount:0,touched:{},isSubmitting:!1,isSubmitSuccessful:!1,isValid:!D,errors:{}}),A=n.useRef({isDirty:!nt,dirtyFields:!nt,touched:!nt||T,isValidating:!nt,isSubmitting:!nt,isValid:!nt}),x=n.useRef(R),M=n.useRef(),{isOnBlur:k,isOnChange:U}=n.useRef(Qe(l)).current;N.current=r,I.current=o,x.current=R,S.current=s?{}:Te(S.current)?Ke(a):S.current;const B=n.useCallback(function(e){void 0===e&&(e={}),h.current||(x.current=Object.assign(Object.assign({},x.current),e),P(x.current))},[]),F=()=>A.current.isValidating&&B({isValidating:!0}),j=n.useCallback(function(e,t,n,l,o){void 0===n&&(n=!1),void 0===l&&(l={});let r=n||(e=>{let{errors:t,name:n,error:l,validFields:o,fieldsWithValidation:r}=e;const a=ge(l),i=fe(t,n);return a&&!!i||!a&&!Me(i,l,!0)||a&&fe(r,n)&&!fe(o,n)})({errors:x.current.errors,error:t,name:e,validFields:E.current,fieldsWithValidation:f.current});const a=fe(x.current.errors,e);t?(Re(E.current,e),r=r||!a||!Me(a,t,!0),pe(x.current.errors,e,t)):((fe(f.current,e)||I.current)&&(pe(E.current,e,!0),r=r||a),Re(x.current.errors,e)),(r&&!ie(n)||!Te(l)||A.current.isValidating)&&B(Object.assign(Object.assign(Object.assign({},l),I.current?{isValid:!!o}:{}),{isValidating:!1}))},[]),V=n.useCallback((e,t)=>{const{ref:n,options:l}=u.current[e],o=Je&&re(n)&&ie(t)?"":t;Ce(n)?(l||[]).forEach(e=>{let{ref:t}=e;return t.checked=t.value===o}):be(n)&&!Ue(o)?n.files=o:Oe(n)?[...n.options].forEach(e=>e.selected=o.includes(e.value)):Se(n)&&l?l.length>1?l.forEach(e=>{let{ref:t}=e;return t.checked=Array.isArray(o)?!!o.find(e=>e===t.value):o===t.value}):l[0].ref.checked=!!o:n.value=o},[]),H=n.useCallback((e,t)=>{if(A.current.isDirty){const n=Q();return e&&t&&pe(n,e,t),!Me(n,y.current)}return!1},[]),G=n.useCallback(function(e,t){if(void 0===t&&(t=!0),A.current.isDirty||A.current.dirtyFields){const n=!Me(fe(y.current,e),_e(u,e,S)),l=fe(x.current.dirtyFields,e),o=x.current.isDirty;n?pe(x.current.dirtyFields,e,!0):Re(x.current.dirtyFields,e);const r={isDirty:H(),dirtyFields:x.current.dirtyFields},a=A.current.isDirty&&o!==r.isDirty||A.current.dirtyFields&&l!==fe(x.current.dirtyFields,e);return a&&t&&B(r),a?r:{}}return{}},[]),$=n.useCallback(function(e,t){try{return"production"===process.env.NODE_ENV||u.current[e]?Promise.resolve($e(u,L,u.current[e],S)).then(function(n){const l=n[e];return j(e,l,t),ge(l)}):(console.warn("📋 Field is missing with `name` attribute: ",e),Promise.resolve(!1))}catch(e){return Promise.reject(e)}},[j,L]),W=n.useCallback(function(e){try{return Promise.resolve(I.current(Q(),N.current,L)).then(function(t){let{errors:n}=t;const l=x.current.isValid;if(Array.isArray(e)){const t=e.map(e=>{const t=fe(n,e);return t?pe(x.current.errors,e,t):Re(x.current.errors,e),!t}).every(Boolean);return B({isValid:Te(n),isValidating:!1}),t}{const t=fe(n,e);return j(e,t,l!==Te(n),{},Te(n)),!t}})}catch(e){return Promise.reject(e)}},[j,L]),q=n.useCallback(function(e){try{let n=!1;function t(e){return n?e:Promise.resolve($(l))}const l=e||Object.keys(u.current);if(F(),I.current)return Promise.resolve(W(l));const o=function(){if(Array.isArray(l))return!e&&(x.current.errors={}),Promise.resolve(Promise.all(l.map(function(e){try{return Promise.resolve($(e,null))}catch(e){return Promise.reject(e)}}))).then(function(e){B({isValidating:!1});const t=e.every(Boolean);return n=!0,t})}();return Promise.resolve(o&&o.then?o.then(t):t(o))}catch(e){return Promise.reject(e)}},[W,$]),X=n.useCallback((e,t,n)=>{let{shouldDirty:l,shouldValidate:o}=n;const r={};pe(r,e,t);for(const n of We(e,t))u.current[n]&&(V(n,fe(r,n)),l&&G(n),o&&q(n))},[q,V,G]),Z=n.useCallback((e,t,n)=>{if(!s&&!Ae(t)&&pe(S.current,e,Array.isArray(t)?[...t]:Object.assign({},t)),u.current[e])V(e,t),n.shouldDirty&&G(e),n.shouldValidate&&q(e);else if(!Ae(t)&&(X(e,t,n),w.current.has(e))){const l=Ze(e)||e;pe(d.current,e,t),O.current[l]({[l]:fe(d.current,l)}),(A.current.isDirty||A.current.dirtyFields)&&n.shouldDirty&&(pe(x.current.dirtyFields,e,((e,t,n)=>xe(ke(e,t,n.slice(0,e.length)),ke(t,e,n.slice(0,e.length))))(t,fe(y.current,e,[]),fe(x.current.dirtyFields,e,[]))),B({isDirty:!Me(Object.assign(Object.assign({},Q()),{[e]:t}),y.current)}))}!s&&pe(S.current,e,t)},[G,V,X]),Y=e=>C.current||p.current.has(e)||p.current.has((e.match(/\w+/)||[])[0]),J=e=>{let t=!0;if(!Te(v.current))for(const n in v.current)e&&v.current[n].size&&!v.current[n].has(e)&&!v.current[n].has(Ze(e))||(g.current[n](),t=!1);return t};function K(e){if(!s){let t=Ke(e);for(const e of w.current)ue(e)&&!t[e]&&(t=Object.assign(Object.assign({},t),{[e]:[]}));return t}return e}function Q(e){if(Ue(e))return _e(u,e,S);if(Array.isArray(e)){const t={};for(const n of e)pe(t,n,_e(u,n,S));return t}return K(Be(u,Ke(S.current),s))}b.current=b.current?b.current:function(e){let{type:t,target:n}=e;try{let e=n.name;const l=u.current[e];let o,r;return Promise.resolve(function(){if(l){function a(){!i&&J(e),j(e,o,m,d,r)}const i="blur"===t,c=Xe(Object.assign({isBlurEvent:i,isReValidateOnChange:U,isReValidateOnBlur:k,isTouched:!!fe(x.current.touched,e),isSubmitted:x.current.isSubmitted},_.current));let d=G(e,!1),m=!Te(d)||!i&&Y(e);if(i&&!fe(x.current.touched,e)&&A.current.touched&&(pe(x.current.touched,e,!0),d=Object.assign(Object.assign({},d),{touched:x.current.touched})),!s&&Se(n)&&pe(S.current,e,_e(u,e)),c)return!i&&J(e),(!Te(d)||m&&Te(d))&&B(d);F();const p=I.current?Promise.resolve(I.current(Q(),N.current,L)).then(function(t){let{errors:l}=t;const a=x.current.isValid;if(o=fe(l,e),Se(n)&&!o&&I.current){const t=Ze(e),n=fe(l,t,{});n.type&&n.message&&(o=n),t&&(n||fe(x.current.errors,t))&&(e=t)}r=Te(l),a!==r&&(m=!0)}):Promise.resolve($e(u,L,l,S)).then(function(t){o=t[e]});return p&&p.then?p.then(a):a()}}())}catch(e){return Promise.reject(e)}};const ee=n.useCallback(function(e){void 0===e&&(e={});try{const t=Te(u.current)?y.current:{};return Promise.resolve(I.current(Object.assign(Object.assign(Object.assign({},t),Q()),e),N.current,L)).then(function(e){let{errors:t}=e;const n=Te(t);x.current.isValid!==n&&B({isValid:n})})}catch(e){return Promise.reject(e)}},[L]),te=n.useCallback((e,t)=>{!function(e,t,n,l,o,r){const{ref:a,ref:{name:i}}=n,s=e.current[i];if(!o){const t=_e(e,i,l);!ge(t)&&pe(l.current,i,t)}a.type&&s?Ce(a)||Se(a)?Array.isArray(s.options)&&s.options.length?(de(s.options).forEach(function(e,n){void 0===e&&(e={}),(De(e.ref)&&Pe(e,e.ref)||r)&&(Ee(e.ref,t),Re(s.options,`[${n}]`))}),s.options&&!de(s.options).length&&delete e.current[i]):delete e.current[i]:(De(a)&&Pe(s,a)||r)&&(Ee(a,t),delete e.current[i]):delete e.current[i]}(u,b.current,e,S,s,t),s&&(Re(E.current,e.ref.name),Re(f.current,e.ref.name))},[s]),ne=n.useCallback(e=>{if(C.current)B();else{for(const t of p.current)if(t.startsWith(e)){B();break}J(e)}},[]),le=n.useCallback((e,t)=>{e&&(te(e,t),s&&!de(e.options||[]).length&&(Re(x.current.errors,e.ref.name),pe(x.current.dirtyFields,e.ref.name,!0),B({isDirty:H()}),A.current.isValid&&I.current&&ee(),ne(e.ref.name)))},[ee,te]),oe=n.useCallback((e,t,n)=>{const l=n?v.current[n]:p.current;let o=Be(u,Ke(S.current),s,!1,e);if(Ue(e)){const n=Ze(e)||e;return w.current.has(n)&&(o=Object.assign(Object.assign({},m.current),o)),qe(o,e,l,ge(fe(y.current,e))?t:fe(y.current,e),!0)}const r=ge(t)?y.current:t;return Array.isArray(e)?e.reduce((e,t)=>Object.assign(Object.assign({},e),{[t]:qe(o,t,l,r)}),{}):(C.current=ge(n),ve(!Te(o)&&o||r))},[]);function se(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(w.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")}const{name:n,type:l,value:o}=e,r=Object.assign({ref:e},t),a=u.current,i=et(e),c=Ye(w.current,n),d=t=>Je&&(!re(e)||t===e);let m,p=a[n],v=!0;if(p&&(i?Array.isArray(p.options)&&de(p.options).find(e=>o===e.ref.value&&d(e.ref)):d(p.ref)))return void(a[n]=Object.assign(Object.assign({},p),t));p=l?i?Object.assign({options:[...de(p&&p.options||[]),{ref:e}],ref:{type:l,name:n}},t):Object.assign({},r):r,a[n]=p;const g=ge(fe(S.current,n));Te(y.current)&&g||(m=fe(g?y.current:S.current,n),v=ge(m),v||c||V(n,m)),Te(t)||(pe(f.current,n,!0),!D&&A.current.isValid&&$e(u,L,p,S).then(e=>{const t=x.current.isValid;Te(e)?pe(E.current,n,!0):Re(E.current,n),t!==Te(e)&&B()})),!s||c&&v||!c&&Re(x.current.dirtyFields,n),l&&function(e,t,n){let{ref:l}=e;re(l)&&n&&(l.addEventListener(t?"change":"input",n),l.addEventListener("blur",n))}(i&&p.options?p.options[p.options.length-1]:p,i||"select-one"===e.type,b.current)}const me=n.useCallback((e,t)=>function(n){try{n&&n.preventDefault&&(n.preventDefault(),n.persist());let l={},o=K(Be(u,Ke(S.current),s,!0));return A.current.isSubmitting&&B({isSubmitting:!0}),Promise.resolve(function(r,a){try{var s=function(){function r(){const r=function(){if(Te(l)&&Object.keys(x.current.errors).every(e=>e in u.current))return B({errors:{},isSubmitting:!0}),Promise.resolve(e(o,n)).then(function(){});{function r(e){i&&((e,t)=>{for(const n in e)if(fe(t,n)){const t=e[n];if(t){if(t.ref.focus&&ge(t.ref.focus()))break;if(t.options){t.options[0].ref.focus();break}}}})(u.current,x.current.errors)}return x.current.errors=Object.assign(Object.assign({},x.current.errors),l),t?Promise.resolve(t(x.current.errors,n)).then(r):r()}}();if(r&&r.then)return r.then(function(){})}const a=I.current?Promise.resolve(I.current(o,N.current,L)).then(function(e){let{errors:t,values:n}=e;x.current.errors=l=t,o=n}):z(Object.values(u.current),function(e){const t=function(){if(e){const{name:t}=e.ref;return Promise.resolve($e(u,L,e,S)).then(function(e){e[t]?(pe(l,t,e[t]),Re(E.current,t)):fe(f.current,t)&&(Re(x.current.errors,t),pe(E.current,t,!0))})}}();if(t&&t.then)return t.then(function(){})});return a&&a.then?a.then(r):r()}()}catch(e){return a(!0,e)}return s&&s.then?s.then(a.bind(null,!1),a.bind(null,!0)):a(!1,s)}(0,function(e,t){if(x.current.isSubmitting=!1,B({isSubmitted:!0,isSubmitting:!1,isSubmitSuccessful:Te(x.current.errors),submitCount:x.current.submitCount+1}),e)throw t;return t}))}catch(n){return Promise.reject(n)}},[i,L]);n.useEffect(()=>{o&&A.current.isValid&&ee(),M.current=M.current||!Je?M.current:function(e,t){const n=new MutationObserver(()=>{for(const n of Object.values(e.current))if(n&&n.options)for(const e of n.options)e&&e.ref&&De(e.ref)&&t(n);else n&&De(n.ref)&&t(n)});return n.observe(window.document,{childList:!0,subtree:!0}),n}(u,le)},[le,y.current]),n.useEffect(()=>()=>{M.current&&M.current.disconnect(),h.current=!0,"production"===process.env.NODE_ENV&&Object.values(u.current).forEach(e=>le(e,!0))},[]),!o&&A.current.isValid&&(R.isValid=Me(E.current,f.current)&&Te(x.current.errors));const ye={trigger:q,setValue:n.useCallback(function(e,t,n){Z(e,t,n||{}),Y(e)&&B(),J(e)},[Z,q]),getValues:n.useCallback(Q,[]),register:n.useCallback(function(e,t){if(!tt)if(Ue(e))se({name:e},t);else{if(!ce(e)||!("name"in e))return t=>t&&se(t,e);se(e,t)}},[y.current]),unregister:n.useCallback(function(e){for(const t of Array.isArray(e)?e:[e])le(u.current[t],!0)},[]),formState:nt?new Proxy(R,{get:(e,t)=>{if("production"!==process.env.NODE_ENV&&"isValid"===t&&D&&console.warn("📋 `formState.isValid` is applicable with `onTouched`, `onChange` or `onBlur` mode. https://react-hook-form.com/api#formState"),t in e)return A.current[t]=!0,e[t]}}):R},he=n.useMemo(()=>Object.assign({isFormDirty:H,updateWatchedValue:ne,shouldUnregister:s,updateFormState:B,removeFieldEventListener:te,watchInternal:oe,mode:_.current,reValidateMode:{isReValidateOnBlur:k,isReValidateOnChange:U},validateResolver:o?ee:void 0,fieldsRef:u,resetFieldArrayFunctionRef:O,useWatchFieldsRef:v,useWatchRenderFunctionsRef:g,fieldArrayDefaultValuesRef:d,validFieldsRef:E,fieldsWithValidationRef:f,fieldArrayNamesRef:w,readFormStateRef:A,formStateRef:x,defaultValuesRef:y,shallowFieldsStateRef:S,fieldArrayValuesRef:m},ye),[y.current,ne,s,te,oe]);return Object.assign({watch:function(e,t){return oe(e,t)},control:he,handleSubmit:me,reset:n.useCallback(function(e,t){if(void 0===t&&(t={}),Je)for(const e of Object.values(u.current))if(e){const{ref:t,options:n}=e,l=et(t)&&Array.isArray(n)?n[0].ref:t;if(re(l))try{l.closest("form").reset();break}catch(e){}}u.current={},y.current=Object.assign({},e||y.current),e&&J(""),Object.values(O.current).forEach(e=>Ve(e)&&e()),S.current=s?{}:Ke(e||y.current),(e=>{let{errors:t,isDirty:n,isSubmitted:l,touched:o,isValid:r,submitCount:a,dirtyFields:i}=e;r||(E.current={},f.current={}),d.current={},p.current=new Set,C.current=!1,B({submitCount:a?x.current.submitCount:0,isDirty:!!n&&x.current.isDirty,isSubmitted:!!l&&x.current.isSubmitted,isValid:!!r&&x.current.isValid,dirtyFields:i?x.current.dirtyFields:{},touched:o?x.current.touched:{},errors:t?x.current.errors:{},isSubmitting:!1,isSubmitSuccessful:!1})})(t)},[]),clearErrors:n.useCallback(function(e){e&&(Array.isArray(e)?e:[e]).forEach(e=>u.current[e]&&ue(e)?delete x.current.errors[e]:Re(x.current.errors,e)),B({errors:e?x.current.errors:{}})},[]),setError:n.useCallback(function(e,t){const n=(u.current[e]||{}).ref;pe(x.current.errors,e,Object.assign(Object.assign({},t),{ref:n})),B({isValid:!1}),t.shouldFocus&&n&&n.focus&&n.focus()},[]),errors:R.errors},ye)}({defaultValues:u}),E=e=>{if(null==e||null==e||""==e)return"NA";const t=new Date(e);let n=t.getMonth()+1,l=t.getDate();return n=(n>9?"":"0")+n,l=(l>9?"":"0")+l,`${l}/${n}/${t.getFullYear()}`},y=e=>{if(null==e||null==e||""==e)return"NA";const t=new Date(e);let n=t.getHours(),l=t.getMinutes(),o=n>12?"PM":"AM";return n=n>12?n-12:n,n=(n>9?"":"0")+n,l=(l>9?"":"0")+l,`${n}:${l} ${o}`},[h,C]=n.useState([]),b=e=>l.createElement("div",{onClick:e.onClick},l.createElement(s.DownloadBtnCommon,null));n.useEffect(()=>{d("offset",0),d("limit",5),d("sortOrder","DESC")},[d]),n.useEffect(()=>{(null==i?void 0:i.length)>0&&C([null==i?void 0:i.map(e=>{let t={};return t[r("AUDIT_DATE_LABEL")]=E(null==e?void 0:e.timestamp),t[r("AUDIT_TIME_LABEL")]=y(null==e?void 0:e.timestamp),t[r("AUDIT_DATAVIEWED_LABEL")]=(null==e?void 0:e.dataView[0])+","+(null==e?void 0:e.dataView[1]),t[r("AUDIT_DATAVIEWED_BY_LABEL")]=null==e?void 0:e.dataViewedBy,t[r("AUDIT_ROLE_LABEL")]=null==e?void 0:e.roles.map(e=>e.name).join(","),{...t}})])},[i]);const S=n.useCallback(e=>{0!==e.length&&(v("sortBy",e.id),v("sortOrder",e.desc?"DESC":"ASC"))},[]);function O(){v("offset",g("offset")-g("limit")),p(a)()}const N=window.Digit.Utils.browser.isMobile();if(N)return l.createElement(at,{Controller:ot,register:d,control:m,t:r,reset:f,previousPage:O,handleSubmit:p,tenantId:o,data:i,onSubmit:a});const I=e=>l.createElement("span",{className:"cell-text"},e),w=n.useMemo(()=>[{Header:r("AUDIT_DATE_LABEL"),disableSortBy:!0,accessor:e=>{const t="NA"===e.timestamp?r("WS_NA"):E(e.timestamp);return I(""+t)}},{Header:r("AUDIT_TIME_LABEL"),disableSortBy:!0,accessor:e=>{const t="NA"===e.timestamp?r("WS_NA"):y(e.timestamp);return I(""+t)}},{Header:r(N?"AUDIT_DATAVIEWED_LABEL":"AUDIT_DATAVIEWED_PRIVACY"),disableSortBy:!0,accessor:e=>I(""+(null==e?void 0:e.dataView))},{Header:r(N?"AUDIT_DATAVIEWED_BY_LABEL":"AUDIT_DATAVIEWED_BY_PRIVACY"),disableSortBy:!0,accessor:e=>I(""+(null==e?void 0:e.dataViewedBy))},{Header:r("AUDIT_ROLE_LABEL"),disableSortBy:!0,accessor:e=>{var t;return I(""+(null==e||null===(t=e.roles.slice(0,3))||void 0===t?void 0:t.map(e=>e.name)))}}],[]);return l.createElement(l.Fragment,null,l.createElement("div",{style:{marginRight:"-70px"}}," ",l.createElement(t.BackButton,null)," "),l.createElement("div",{style:{marginTop:"30px",marginLeft:"30px"}}," ",l.createElement(t.Header,null,r("PRIVACY_AUDIT_REPORT"))," "),l.createElement(t.SearchForm,{className:"audit-card",onSubmit:a,handleSubmit:p},l.createElement(rt,{register:d,control:m,reset:f,tenantId:o,t:r,previousPage:O})),l.createElement("div",{style:{marginTop:"240px",marginLeft:"-55%",maxWidth:"80%",marginRight:"52px"}},null!=i&&i.display?l.createElement("div",{style:{marginTop:"20x",width:"1025px",marginLeft:"25px",backgroundColor:"white",height:"60px"}},r(i.display).split("\\n").map((e,t)=>l.createElement("p",{key:t,style:{textAlign:"center"}},e))):""!==i?l.createElement("div",{style:{backgroundColor:"white",marginRight:"-30px",marginLeft:"30px"}},l.createElement("div",{className:"sideContent",style:{float:"right",padding:"10px 30px"}},l.createElement(b,{className:"mrlg cursorPointer",onClick:()=>(e=>{if(void 0!==(null==e?void 0:e[0]))return Digit.Download.Excel(null==e?void 0:e[0],"AuditReport")})(h)})),l.createElement(s.Table,{t:r,data:i,totalRecords:c,columns:w,getCellProps:e=>({style:{minWidth:e.column.Header===r("ES_INBOX_APPLICATION_NO")?"240px":"",padding:"20px 18px",fontSize:"16px"}}),onPageSizeChange:function(e){v("limit",Number(e.target.value)),p(a)()},currentPage:g("offset")/g("limit"),onNextPage:function(){v("offset",g("offset")+g("limit")),p(a)()},onPrevPage:O,manualPagination:!1,pageSizeLimit:g("limit"),onSort:S,disableSort:!1,sortParams:[{id:g("sortBy"),desc:"DESC"===g("sortOrder")}]})):l.createElement(t.Loader,null)))},st=e=>{var t,r;const{t:a}=o.useTranslation(),i=Digit.ULBService.getCitizenCurrentTenant(),[s,c]=n.useState({}),u=function(e,t){void 0===t&&(t="dayend");try{const n=e.match(/(\d{4})-(\d{1,2})-(\d{1,2})/),l=new Date(Date.UTC(n[1],n[2]-1,n[3]));return l.setMinutes(l.getMinutes()+l.getTimezoneOffset()),"dayend"===t&&(l.setHours(l.getHours()+24),l.setSeconds(l.getSeconds()-1)),l.getTime()}catch(t){return e}};n.useEffect(()=>{const e=Digit.SessionStorage.get("AUDIT_APPLICATION_DETAIL")||{};if(e){const t={...e};c(Object.keys(t).filter(e=>t[e]).reduce((e,n)=>({...e,[n]:"object"==typeof t[n]?t[n].code:t[n]}),{}))}},[]);const d={enabled:!!(s&&Object.keys(s).length>0)},m={...s},{isLoading:p,data:v}=Digit.Hooks.useAudit({tenantId:i,filters:{...m},config:d});return l.createElement(it,{t:a,tenantId:i,onSubmit:function(e){Digit.SessionStorage.set("AUDIT_APPLICATION_DETAIL",{offset:0,limit:5,sortBy:"commencementDate",sortOrder:"DESC"});const t={...e,fromDate:u(null==e?void 0:e.fromDate),toDate:u(null==e?void 0:e.toDate)};c(Object.keys(t).filter(e=>t[e]).reduce((e,n)=>({...e,[n]:t[n]}),{}))},data:p?"":(null==v||null===(t=v.ElasticSearchData)||void 0===t?void 0:t.length)>0?null==v?void 0:v.ElasticSearchData:{display:"ES_COMMON_NO_DATA"},count:null==v||null===(r=v.ElasticSearchData)||void 0===r?void 0:r.length})},ct=e=>{var n,r,a,i,s,c,u,d,m,p,v,g,f,E,y,h;let{moduleCode:C}=e;const{t:b}=o.useTranslation(),S=Digit.ULBService.getCitizenCurrentTenant(),{isLoading:O,data:N}=Digit.Hooks.useStaticData(Digit.ULBService.getStateId()),{isLoading:I,error:w,data:_}=Digit.Hooks.useDynamicData({moduleCode:C,tenantId:S,filters:{},t:b}),D=e=>{let{module:n,styles:o}=e;switch(n){case"TL":return l.createElement(t.CaseIcon,{className:"fill-path-primary-main",styles:o});case"PT":return l.createElement(t.PTIcon,{className:"fill-path-primary-main",styles:o});case"MCOLLECT":return l.createElement(t.MCollectIcon,{className:"fill-path-primary-main",styles:o});case"PGR":return l.createElement(t.ComplaintIcon,{className:"fill-path-primary-main",styles:o});default:return l.createElement(t.CaseIcon,{className:"fill-path-primary-main",styles:o})}},T=null==N||null===(n=N.MdmsRes["common-masters"])||void 0===n||null===(r=n.StaticData[0])||void 0===r?void 0:r[""+C],L=e=>{let{module:n}=e;switch(n){case"PT":case"WS":return l.createElement("span",{className:"timerIcon"},l.createElement(t.TimerIcon,null));default:return null}},R=e=>{let{module:n}=e;switch(n){case"PT":return l.createElement("span",{className:"rupeeSymbol"},l.createElement(t.RupeeSymbol,null));case"WS":return l.createElement("span",{className:"timerIcon"},l.createElement(t.TimerIcon,null));default:return null}},P=e=>{switch(e){case"TL":case"PT":case"MCOLLECT":return{staticCommonContent:b("COMMON_VALIDITY"),validity:(null==T?void 0:T.validity)+b("1"===(null==T?void 0:T.validity)?"COMMON_DAY":"COMMON_DAYS")};case"PGR":return{staticCommonContent:b("ACTION_TEST_COMPLAINT_TYPES")};case"OBPS":return{staticCommonContent:b("BUILDING_PLAN_PERMIT_VALIDITY"),validity:(null==T?void 0:T.validity)+" "+b("1"===(null==T?void 0:T.validity)?"COMMON_DAY":"COMMON_DAYS")};default:return{staticCommonContent:""}}},A=e=>{switch(e){case"PT":return{staticDataOne:(null==T?void 0:T.staticDataOne)+" "+b("COMMON_DAYS"),staticDataOneHeader:b("APPLICATION_PROCESSING_TIME"),staticDataTwo:null==T?void 0:T.staticDataTwo,staticDataTwoHeader:b("APPLICATION_PROCESSING_FEE")};case"WS":return{staticDataOne:"",staticDataOneHeader:b("PAY_WATER_CHARGES_BY")+" "+(null==T?void 0:T.staticDataOne)+" "+b("COMMON_DAYS")+" "+b("OF_BILL_GEN_TO_AVOID_LATE_FEE"),staticDataTwo:(null==T?void 0:T.staticDataTwo)+" "+b("COMMON_DAYS"),staticDataTwoHeader:b("APPLICATION_PROCESSING_TIME")};default:return{}}};return O||I?l.createElement(t.Loader,null):T?l.createElement(l.Fragment,null,T&&null!=T&&T.payViaWhatsApp?l.createElement(t.Card,{style:{margin:"16px",padding:"16px",maxWidth:"unset"}},l.createElement("div",{className:"pay-whatsapp-card",onClick:()=>{window.open(null==T?void 0:T.payViaWhatsApp)}},l.createElement("div",{className:"pay-whatsapp-text"},b("PAY_VIA_WHATSAPP")),l.createElement("div",{className:"whatsAppIconG"},l.createElement(t.WhatsappIconGreen,null)))):null,T&&null!=T&&T.helpline?l.createElement(t.Card,{style:{margin:"16px",padding:"16px",maxWidth:"unset"}},l.createElement("div",{className:"static-home-Card"},l.createElement("div",{className:"static-home-Card-header"},b("CALL_CENTER_HELPLINE")),l.createElement("div",{className:"helplineIcon"},l.createElement(t.HelpLineIcon,null))),l.createElement("div",{className:"call-center-card-text"},null!=T&&null!==(a=T.helpline)&&void 0!==a&&a.contactOne?l.createElement("div",{className:"call-center-card-content"},l.createElement("a",{href:"tel:"+(null==T||null===(i=T.helpline)||void 0===i?void 0:i.contactOne)},null==T||null===(s=T.helpline)||void 0===s?void 0:s.contactOne)):null,null!=T&&null!==(c=T.helpline)&&void 0!==c&&c.contactTwo?l.createElement("div",{className:"call-center-card-content"},l.createElement("a",{href:"tel:"+(null==T||null===(u=T.helpline)||void 0===u?void 0:u.contactTwo)},null==T||null===(d=T.helpline)||void 0===d?void 0:d.contactTwo)):null)):null,T&&null!=T&&T.serviceCenter?l.createElement(t.Card,{style:{margin:"16px",padding:"16px",maxWidth:"unset"}},l.createElement("div",{className:"static-home-Card"},l.createElement("div",{className:"static-home-Card-header"},b("CITIZEN_SERVICE_CENTER")),l.createElement("div",{className:"serviceCentrIcon"},l.createElement(t.ServiceCenterIcon,null))),l.createElement("div",{className:"service-center-details-card"},l.createElement("div",{className:"service-center-details-text"},null==T?void 0:T.serviceCenter)),null!=T&&T.viewMapLocation?l.createElement("div",{className:"link"},l.createElement("a",{href:null==T?void 0:T.viewMapLocation},b("VIEW_ON_MAP"))):null):l.createElement("div",null),l.createElement(t.Card,{style:{margin:"16px",padding:"16px",maxWidth:"unset"}},w||null==_||null===(null==_?void 0:_.dynamicDataOne)?l.createElement("div",null):l.createElement("div",{className:"dynamicDataCard"},l.createElement("div",{className:"dynamicData"},l.createElement(D,{module:C,styles:{width:"24px",height:"24px"}}),l.createElement("span",{className:"dynamicData-content"},null==_?void 0:_.dynamicDataOne))),w||null==_||null===(null==_?void 0:_.dynamicDataTwo)?l.createElement("div",null):l.createElement("div",{className:"dynamicDataCard"},l.createElement("div",{className:"dynamicData"},l.createElement(D,{module:C,styles:{width:"24px",height:"24px"}}),l.createElement("span",{className:"dynamicData-content"},null==_?void 0:_.dynamicDataTwo))),T&&null!=T&&T.staticDataOne?l.createElement("div",{className:"staticDataCard"},l.createElement("div",{className:"staticData"},l.createElement(L,{module:C}),l.createElement("span",{className:"static-data-content"},l.createElement("span",{className:"static-data-content-first",style:{marginTop:""===(null===(m=A(C))||void 0===m?void 0:m.staticDataOne)?"8px":"unset"}},null===(p=A(C))||void 0===p?void 0:p.staticDataOneHeader),l.createElement("span",{className:"static-data-content-second"},""+(null===(v=A(C))||void 0===v?void 0:v.staticDataOne))))):l.createElement("div",null),T&&null!=T&&T.staticDataTwo?l.createElement("div",{className:"staticDataCard"},l.createElement("div",{className:"staticData"},l.createElement(R,{module:C}),l.createElement("span",{className:"static-data-content"},l.createElement("span",{className:"static-data-content-first"},null===(g=A(C))||void 0===g?void 0:g.staticDataTwoHeader),l.createElement("span",{className:"static-data-content-second"},null===(f=A(C))||void 0===f?void 0:f.staticDataTwo)))):l.createElement("div",null),T&&null!=T&&T.validity?l.createElement("div",{className:"staticDataCard"},l.createElement("div",{className:"staticData"},l.createElement("span",{className:"validityIcon"},l.createElement(t.ValidityTimeIcon,null)),l.createElement("span",{className:"static-data-content"},l.createElement("span",{className:"static-data-content-first"},null===(E=P(C))||void 0===E?void 0:E.staticCommonContent),l.createElement("span",{className:"static-data-content-second"},null===(y=P(C))||void 0===y?void 0:y.validity)))):l.createElement("div",null),w||null==_||null==_||!_.staticData||null===(null==_?void 0:_.staticData)?l.createElement("div",null):l.createElement("div",{className:"staticDataCard"},l.createElement("div",{className:"staticData"},"PGR"===C?l.createElement(D,{module:C,styles:{width:"24px",height:"24px",marginLeft:"13px",marginTop:"12px"}}):l.createElement("span",{className:"validityIcon"},l.createElement(t.ValidityTimeIcon,null)),l.createElement("span",{className:"static-data-content"},l.createElement("span",{className:"static-data-content-first"},null===(h=P(C))||void 0===h?void 0:h.staticCommonContent),l.createElement("span",{className:"static-data-content-second"},null==_?void 0:_.staticData)))))):l.createElement(l.Fragment,null)};var ut,dt,mt,pt,vt;const gt=[(null===(ut=window)||void 0===ut?void 0:ut.contextPath)+"/citizen/register/name",`/${null===(dt=window)||void 0===dt?void 0:dt.contextPath}/citizen/select-language`,`/${null===(mt=window)||void 0===mt?void 0:mt.contextPath}/citizen/select-location`,`/${null===(pt=window)||void 0===pt?void 0:pt.contextPath}/citizen/login`,`/${null===(vt=window)||void 0===vt?void 0:vt.contextPath}/citizen/register/otp`],ft=(e,t)=>t.filter(t=>e.map(e=>e.code).includes(t.code)),Et=e=>{var n,r,a;let{stateInfo:s,userDetails:c,CITIZEN:u,cityDetails:d,mobileView:p,handleUserDropdownSelection:f,logoUrl:E,stateCode:h,modules:C,appTenants:b,pathname:S,initData:O}=e;const{isLoading:N,data:I,isFetched:w}=Digit.Hooks.useCustomMDMS(Digit.ULBService.getStateId(),"ACCESSCONTROL-ACTIONS-TEST",[{name:"actions-test",filter:`[?(@.url == '${window.contextPath}-card')]`}],{select: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(e=>!0===e.enabled).reduce((e,t)=>{var n;return e[t.parentModule]=(null===(n=e[t.parentModule])||void 0===n?void 0:n.length)>0?[t,...e[t.parentModule]]:[t],e},{})}}),_=Digit.Hooks.useRouteSubscription(S),{t:T}=o.useTranslation(),{path:L}=i.useRouteMatch(),R=i.useHistory(),P=gt.some(e=>window.location.href.includes(e)),x=C.map((e,t)=>{let{code:n,tenants:o}=e;const r=Digit.ComponentRegistryService.getComponent(n+"Module");return r?l.createElement(i.Route,{key:t,path:`${L}/${n.toLowerCase()}`},l.createElement(r,{stateCode:h,moduleCode:n,userType:"citizen",tenants:ft(o,b)})):null}),F=C.map((e,n)=>{let{code:o,bannerImage:r}=e,a=(Digit.ComponentRegistryService.getComponent(o+"Links"),w?g(I,o,T):void 0);return"ACTION_TEST_WS"===(null==a?void 0:a.header)&&(null==a||a.links.sort((e,t)=>t.orderNumber-e.orderNumber)),l.createElement(l.Fragment,null,l.createElement(i.Route,{key:n,path:`${L}/${o.toLowerCase()}-home`},l.createElement("div",{className:"moduleLinkHomePage"},l.createElement("img",{src:r||(null==s?void 0:s.bannerUrl),alt:"noimagefound"}),l.createElement(t.BackButton,{className:"moduleLinkHomePageBackButton"}),l.createElement("h1",null,T("MODULE_"+o.toUpperCase())),l.createElement("div",{className:"moduleLinkHomePageModuleLinks"},a&&l.createElement(t.CitizenHomeCard,{header:T(null==a?void 0:a.header),links:null==a?void 0:a.links,Icon:()=>l.createElement("span",null),Info:"OBPS"===o?()=>l.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"===o})),l.createElement(ct,{moduleCode:null==o?void 0:o.toUpperCase()}))),l.createElement(i.Route,{key:"faq"+n,path:`${L}/${o.toLowerCase()}-faq`},l.createElement(M,{module:null==o?void 0:o.toUpperCase()})),l.createElement(i.Route,{key:"hiw"+n,path:`${L}/${o.toLowerCase()}-how-it-works`},l.createElement(q,{module:null==o?void 0:o.toUpperCase()})))});return l.createElement("div",{className:_},l.createElement(A,{t:T,stateInfo:s,userDetails:c,CITIZEN:u,cityDetails:d,mobileView:p,handleUserDropdownSelection:f,logoUrl:E,showSidebar:!0,linkData:I,islinkDataLoading:N}),l.createElement("div",{className:"main center-container citizen-home-container mb-25"},P?null:l.createElement("div",{className:"SideBarStatic"},l.createElement(D,{linkData:I,islinkDataLoading:N})),l.createElement(i.Switch,null,l.createElement(i.Route,{exact:!0,path:L},l.createElement(k,null)),l.createElement(i.Route,{exact:!0,path:L+"/select-language"},l.createElement(U,null)),l.createElement(i.Route,{exact:!0,path:L+"/select-location"},l.createElement(B,null)),l.createElement(i.Route,{path:L+"/error"},l.createElement(m,{initData:O,goToHome:()=>{var e,t,n,l;R.push(`/${null===(e=window)||void 0===e?void 0:e.contextPath}/${null===(t=Digit)||void 0===t||null===(n=t.UserService)||void 0===n||null===(l=n.getType)||void 0===l?void 0:l.call(n)}`)}})),l.createElement(i.Route,{path:L+"/all-services"},l.createElement(y,{userType:"citizen",modules:C,getCitizenMenu:I,fetchedCitizen:w,isLoading:N})),l.createElement(i.Route,{path:L+"/login"},l.createElement(oe,{stateCode:h})),l.createElement(i.Route,{path:L+"/register"},l.createElement(oe,{stateCode:h,isUserRegistered:!1})),l.createElement(i.Route,{path:L+"/user/profile"},l.createElement(W,{stateCode:h,userType:"citizen",cityDetails:d})),l.createElement(i.Route,{path:L+"/Audit"},l.createElement(st,null)),l.createElement(v,{initData:O},x,F))),l.createElement("div",{className:"citizen-home-footer",style:window.location.href.includes("citizen/obps")?{zIndex:"-1"}:{}},l.createElement("img",{alt:"Powered by DIGIT",src:null===(n=window)||void 0===n||null===(r=n.globalConfigs)||void 0===r||null===(a=r.getConfig)||void 0===a?void 0:a.call(r,"DIGIT_FOOTER"),style:{height:"1.2em",cursor:"pointer"},onClick:()=>{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 yt(e,t){return e(t={exports:{}},t.exports),t.exports}var ht="function"==typeof Symbol&&Symbol.for,Ct=ht?Symbol.for("react.element"):60103,bt=ht?Symbol.for("react.portal"):60106,St=ht?Symbol.for("react.fragment"):60107,Ot=ht?Symbol.for("react.strict_mode"):60108,Nt=ht?Symbol.for("react.profiler"):60114,It=ht?Symbol.for("react.provider"):60109,wt=ht?Symbol.for("react.context"):60110,_t=ht?Symbol.for("react.async_mode"):60111,Dt=ht?Symbol.for("react.concurrent_mode"):60111,Tt=ht?Symbol.for("react.forward_ref"):60112,Lt=ht?Symbol.for("react.suspense"):60113,Rt=ht?Symbol.for("react.suspense_list"):60120,Pt=ht?Symbol.for("react.memo"):60115,At=ht?Symbol.for("react.lazy"):60116,xt=ht?Symbol.for("react.block"):60121,Mt=ht?Symbol.for("react.fundamental"):60117,kt=ht?Symbol.for("react.responder"):60118,Ut=ht?Symbol.for("react.scope"):60119;function Bt(e){if("object"==typeof e&&null!==e){var t=e.$$typeof;switch(t){case Ct:switch(e=e.type){case _t:case Dt:case St:case Nt:case Ot:case Lt:return e;default:switch(e=e&&e.$$typeof){case wt:case Tt:case At:case Pt:case It:return e;default:return t}}case bt:return t}}}function Ft(e){return Bt(e)===Dt}var jt={AsyncMode:_t,ConcurrentMode:Dt,ContextConsumer:wt,ContextProvider:It,Element:Ct,ForwardRef:Tt,Fragment:St,Lazy:At,Memo:Pt,Portal:bt,Profiler:Nt,StrictMode:Ot,Suspense:Lt,isAsyncMode:function(e){return Ft(e)||Bt(e)===_t},isConcurrentMode:Ft,isContextConsumer:function(e){return Bt(e)===wt},isContextProvider:function(e){return Bt(e)===It},isElement:function(e){return"object"==typeof e&&null!==e&&e.$$typeof===Ct},isForwardRef:function(e){return Bt(e)===Tt},isFragment:function(e){return Bt(e)===St},isLazy:function(e){return Bt(e)===At},isMemo:function(e){return Bt(e)===Pt},isPortal:function(e){return Bt(e)===bt},isProfiler:function(e){return Bt(e)===Nt},isStrictMode:function(e){return Bt(e)===Ot},isSuspense:function(e){return Bt(e)===Lt},isValidElementType:function(e){return"string"==typeof e||"function"==typeof e||e===St||e===Dt||e===Nt||e===Ot||e===Lt||e===Rt||"object"==typeof e&&null!==e&&(e.$$typeof===At||e.$$typeof===Pt||e.$$typeof===It||e.$$typeof===wt||e.$$typeof===Tt||e.$$typeof===Mt||e.$$typeof===kt||e.$$typeof===Ut||e.$$typeof===xt)},typeOf:Bt},Vt=yt(function(e,t){"production"!==process.env.NODE_ENV&&function(){var e="function"==typeof Symbol&&Symbol.for,n=e?Symbol.for("react.element"):60103,l=e?Symbol.for("react.portal"):60106,o=e?Symbol.for("react.fragment"):60107,r=e?Symbol.for("react.strict_mode"):60108,a=e?Symbol.for("react.profiler"):60114,i=e?Symbol.for("react.provider"):60109,s=e?Symbol.for("react.context"):60110,c=e?Symbol.for("react.async_mode"):60111,u=e?Symbol.for("react.concurrent_mode"):60111,d=e?Symbol.for("react.forward_ref"):60112,m=e?Symbol.for("react.suspense"):60113,p=e?Symbol.for("react.suspense_list"):60120,v=e?Symbol.for("react.memo"):60115,g=e?Symbol.for("react.lazy"):60116,f=e?Symbol.for("react.block"):60121,E=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 p=e.type;switch(p){case c:case u:case o:case a:case r:case m:return p;default:var f=p&&p.$$typeof;switch(f){case s:case d:case g:case v:case i:return f;default:return t}}case l:return t}}}var b=u,S=s,O=i,N=n,I=d,w=o,_=g,D=v,T=l,L=a,R=r,P=m,A=!1;function x(e){return C(e)===u}t.AsyncMode=c,t.ConcurrentMode=b,t.ContextConsumer=S,t.ContextProvider=O,t.Element=N,t.ForwardRef=I,t.Fragment=w,t.Lazy=_,t.Memo=D,t.Portal=T,t.Profiler=L,t.StrictMode=R,t.Suspense=P,t.isAsyncMode=function(e){return A||(A=!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)===c},t.isConcurrentMode=x,t.isContextConsumer=function(e){return C(e)===s},t.isContextProvider=function(e){return C(e)===i},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)===o},t.isLazy=function(e){return C(e)===g},t.isMemo=function(e){return C(e)===v},t.isPortal=function(e){return C(e)===l},t.isProfiler=function(e){return C(e)===a},t.isStrictMode=function(e){return C(e)===r},t.isSuspense=function(e){return C(e)===m},t.isValidElementType=function(e){return"string"==typeof e||"function"==typeof e||e===o||e===u||e===a||e===r||e===m||e===p||"object"==typeof e&&null!==e&&(e.$$typeof===g||e.$$typeof===v||e.$$typeof===i||e.$$typeof===s||e.$$typeof===d||e.$$typeof===E||e.$$typeof===y||e.$$typeof===h||e.$$typeof===f)},t.typeOf=C}()}),Ht=yt(function(e){e.exports="production"===process.env.NODE_ENV?jt:Vt}),zt=Object.getOwnPropertySymbols,Gt=Object.prototype.hasOwnProperty,$t=Object.prototype.propertyIsEnumerable;function Wt(e){if(null==e)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(e)}var qt=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 l={};return"abcdefghijklmnopqrst".split("").forEach(function(e){l[e]=e}),"abcdefghijklmnopqrst"===Object.keys(Object.assign({},l)).join("")}catch(e){return!1}}()?Object.assign:function(e,t){for(var n,l,o=Wt(e),r=1;r<arguments.length;r++){for(var a in n=Object(arguments[r]))Gt.call(n,a)&&(o[a]=n[a]);if(zt){l=zt(n);for(var i=0;i<l.length;i++)$t.call(n,l[i])&&(o[l[i]]=n[l[i]])}}return o},Xt="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED",Zt=Function.call.bind(Object.prototype.hasOwnProperty),Yt=function(){};if("production"!==process.env.NODE_ENV){var Jt=Xt,Kt={},Qt=Zt;Yt=function(e){var t="Warning: "+e;"undefined"!=typeof console&&console.error(t);try{throw new Error(t)}catch(e){}}}function en(e,t,n,l,o){if("production"!==process.env.NODE_ENV)for(var r in e)if(Qt(e,r)){var a;try{if("function"!=typeof e[r]){var i=Error((l||"React class")+": "+n+" type `"+r+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof e[r]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw i.name="Invariant Violation",i}a=e[r](t,r,l,n,null,Jt)}catch(e){a=e}if(!a||a instanceof Error||Yt((l||"React class")+": type specification of "+n+" `"+r+"` 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 Kt)){Kt[a.message]=!0;var s=o?o():"";Yt("Failed "+n+" type: "+a.message+(null!=s?s:""))}}}en.resetWarningCache=function(){"production"!==process.env.NODE_ENV&&(Kt={})};var tn=en,nn=function(){};function ln(){return null}function on(){}function rn(){}"production"!==process.env.NODE_ENV&&(nn=function(e){var t="Warning: "+e;"undefined"!=typeof console&&console.error(t);try{throw new Error(t)}catch(e){}}),rn.resetWarningCache=on;var an=yt(function(e){e.exports="production"!==process.env.NODE_ENV?function(e,t){var n="function"==typeof Symbol&&Symbol.iterator,l={array:i("array"),bigint:i("bigint"),bool:i("boolean"),func:i("function"),number:i("number"),object:i("object"),string:i("string"),symbol:i("symbol"),any:a(ln),arrayOf:function(e){return a(function(t,n,l,o,a){if("function"!=typeof e)return new r("Property `"+a+"` of component `"+l+"` has invalid PropType notation inside arrayOf.");var i=t[n];if(!Array.isArray(i))return new r("Invalid "+o+" `"+a+"` of type `"+u(i)+"` supplied to `"+l+"`, expected an array.");for(var s=0;s<i.length;s++){var c=e(i,s,l,o,a+"["+s+"]",Xt);if(c instanceof Error)return c}return null})},element:a(function(t,n,l,o,a){var i=t[n];return e(i)?null:new r("Invalid "+o+" `"+a+"` of type `"+u(i)+"` supplied to `"+l+"`, expected a single ReactElement.")}),elementType:a(function(e,t,n,l,o){var a=e[t];return Ht.isValidElementType(a)?null:new r("Invalid "+l+" `"+o+"` of type `"+u(a)+"` supplied to `"+n+"`, expected a single ReactElement type.")}),instanceOf:function(e){return a(function(t,n,l,o,a){var i;return t[n]instanceof e?null:new r("Invalid "+o+" `"+a+"` of type `"+((i=t[n]).constructor&&i.constructor.name?i.constructor.name:"<<anonymous>>")+"` supplied to `"+l+"`, expected instance of `"+(e.name||"<<anonymous>>")+"`.")})},node:a(function(e,t,n,l,o){return c(e[t])?null:new r("Invalid "+l+" `"+o+"` supplied to `"+n+"`, expected a ReactNode.")}),objectOf:function(e){return a(function(t,n,l,o,a){if("function"!=typeof e)return new r("Property `"+a+"` of component `"+l+"` has invalid PropType notation inside objectOf.");var i=t[n],s=u(i);if("object"!==s)return new r("Invalid "+o+" `"+a+"` of type `"+s+"` supplied to `"+l+"`, expected an object.");for(var c in i)if(Zt(i,c)){var d=e(i,c,l,o,a+"."+c,Xt);if(d instanceof Error)return d}return null})},oneOf:function(e){if(!Array.isArray(e))return"production"!==process.env.NODE_ENV&&nn(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."),ln;function t(t,n,l,a,i){for(var s=t[n],c=0;c<e.length;c++)if(o(s,e[c]))return null;var u=JSON.stringify(e,function(e,t){return"symbol"===d(t)?String(t):t});return new r("Invalid "+a+" `"+i+"` of value `"+String(s)+"` supplied to `"+l+"`, expected one of "+u+".")}return a(t)},oneOfType:function(e){if(!Array.isArray(e))return"production"!==process.env.NODE_ENV&&nn("Invalid argument supplied to oneOfType, expected an instance of array."),ln;for(var t=0;t<e.length;t++){var n=e[t];if("function"!=typeof n)return nn("Invalid argument supplied to oneOfType. Expected an array of check functions, but received "+m(n)+" at index "+t+"."),ln}return a(function(t,n,l,o,a){for(var i=[],s=0;s<e.length;s++){var c=(0,e[s])(t,n,l,o,a,Xt);if(null==c)return null;c.data&&Zt(c.data,"expectedType")&&i.push(c.data.expectedType)}return new r("Invalid "+o+" `"+a+"` supplied to `"+l+"`"+(i.length>0?", expected one of type ["+i.join(", ")+"]":"")+".")})},shape:function(e){return a(function(t,n,l,o,a){var i=t[n],c=u(i);if("object"!==c)return new r("Invalid "+o+" `"+a+"` of type `"+c+"` supplied to `"+l+"`, expected `object`.");for(var m in e){var p=e[m];if("function"!=typeof p)return s(l,o,a,m,d(p));var v=p(i,m,l,o,a+"."+m,Xt);if(v)return v}return null})},exact:function(e){return a(function(t,n,l,o,a){var i=t[n],c=u(i);if("object"!==c)return new r("Invalid "+o+" `"+a+"` of type `"+c+"` supplied to `"+l+"`, expected `object`.");var m=qt({},t[n],e);for(var p in m){var v=e[p];if(Zt(e,p)&&"function"!=typeof v)return s(l,o,a,p,d(v));if(!v)return new r("Invalid "+o+" `"+a+"` key `"+p+"` supplied to `"+l+"`.\nBad object: "+JSON.stringify(t[n],null," ")+"\nValid keys: "+JSON.stringify(Object.keys(e),null," "));var g=v(i,p,l,o,a+"."+p,Xt);if(g)return g}return null})}};function o(e,t){return e===t?0!==e||1/e==1/t:e!=e&&t!=t}function r(e,t){this.message=e,this.data=t&&"object"==typeof t?t:{},this.stack=""}function a(e){function t(t,n,l,o,a,i,s){if(o=o||"<<anonymous>>",i=i||l,s!==Xt){var c=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 c.name="Invariant Violation",c}return null==n[l]?t?new r(null===n[l]?"The "+a+" `"+i+"` is marked as required in `"+o+"`, but its value is `null`.":"The "+a+" `"+i+"` is marked as required in `"+o+"`, but its value is `undefined`."):null:e(n,l,o,a,i)}process;var n=t.bind(null,!1);return n.isRequired=t.bind(null,!0),n}function i(e){return a(function(t,n,l,o,a,i){var s=t[n];return u(s)!==e?new r("Invalid "+o+" `"+a+"` of type `"+d(s)+"` supplied to `"+l+"`, expected `"+e+"`.",{expectedType:e}):null})}function s(e,t,n,l,o){return new r((e||"React class")+": "+t+" type `"+n+"."+l+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+o+"`.")}function c(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(c);if(null===t||e(t))return!0;var l=function(e){var t=e&&(n&&e[n]||e["@@iterator"]);if("function"==typeof t)return t}(t);if(!l)return!1;var o,r=l.call(t);if(l!==t.entries){for(;!(o=r.next()).done;)if(!c(o.value))return!1}else for(;!(o=r.next()).done;){var a=o.value;if(a&&!c(a[1]))return!1}return!0;default:return!1}}function u(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=u(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 r.prototype=Error.prototype,l.checkPropTypes=tn,l.resetWarningCache=tn.resetWarningCache,l.PropTypes=l,l}(Ht.isElement):function(){function e(e,t,n,l,o,r){if(r!==Xt){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:rn,resetWarningCache:on};return n.PropTypes=n,n}()});const sn=e=>{let{children:t}=e;return l.createElement("div",{className:"banner banner-container"},t)},cn=e=>{var n;let{showTenant:r=!0}=e;const{data:a,isLoading:i}=Digit.Hooks.useStore.getInitData(),{stateInfo:s}=a||{},{t:c}=o.useTranslation();return i?l.createElement(t.Loader,null):l.createElement("div",{className:"bannerHeader"},l.createElement("img",{className:"bannerLogo",src:null==s?void 0:s.logoUrl,style:r?{}:{borderRight:"unset"}}),r&&l.createElement("p",null,c("TENANT_TENANTS_"+(null==s||null===(n=s.code)||void 0===n?void 0:n.toUpperCase()))))},un=e=>{var o,r,a;let{config:c,t:u}=e;const[d,m]=n.useState(null),{mobile_number:p,tenantId:v}=Digit.Hooks.useQueryParams(),g=i.useHistory(),[f,E]=n.useState(""),[y,h]=n.useState(!0),[C,b]=n.useState(null),S=()=>Digit.UserService.getType();n.useEffect(()=>{var e,t;if(!d)return void Digit.UserService.setType("employee");Digit.UserService.setUser(d);const n=(null===(e=location.state)||void 0===e?void 0:e.from)||`/${null===(t=window)||void 0===t?void 0:t.contextPath}/employee`;g.replace(n)},[d]);const O=()=>{b(null)},[N,I,w]=c.inputs,_=[{body:[{label:u(N.label),type:N.type,populators:{name:N.name},isMandatory:!0},{label:u(I.label),type:I.type,populators:{name:I.name},isMandatory:!0},{label:u(w.label),type:w.type,populators:{name:w.name},isMandatory:!0}]}];return l.createElement(sn,null,l.createElement("div",{className:"employeeBackbuttonAlign"},l.createElement(t.BackButton,{variant:"white",style:{borderBottom:"none"}})),l.createElement(s.FormComposer,{onSubmit:function(e){try{return Promise.resolve(G(function(){if(e.newPassword!==e.confirmPassword)return b(u("ERR_PASSWORD_DO_NOT_MATCH"));const t={...e,otpReference:f,tenantId:v,type:S().toUpperCase()};return Promise.resolve(Digit.UserService.changePassword(t,v)).then(function(e){(()=>{var e;g.replace(`/${null===(e=window)||void 0===e?void 0:e.contextPath}/employee/user/login`)})()})},function(e){var t,n,l,o,r;b((null==e||null===(t=e.response)||void 0===t||null===(n=t.data)||void 0===n||null===(l=n.error)||void 0===l||null===(o=l.fields)||void 0===o||null===(r=o[0])||void 0===r?void 0:r.message)||u("ES_SOMETHING_WRONG")),setTimeout(O,5e3)}))}catch(e){return Promise.reject(e)}},noBoxShadow:!0,inline:!0,submitInForm:!0,config:_,label:c.texts.submitButtonLabel,cardStyle:{maxWidth:"408px",margin:"auto"},className:"employeeChangePassword"},l.createElement(cn,null),l.createElement(s.CardSubHeader,{style:{textAlign:"center"}}," ",c.texts.header," "),l.createElement(t.CardText,null,u("CS_LOGIN_OTP_TEXT")+" ",l.createElement("b",null," ",""+u("+ 91 - ")," ",p)),l.createElement(K,{t:u,userType:"employee",otp:f,onOtpChange:E,error:y,onResend:function(){try{function e(){setTimeout(O,5e3)}const t={otp:{mobileNumber:p,userType:S().toUpperCase(),type:"passwordreset",tenantId:v}},n=G(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)}}})),C&&l.createElement(t.Toast,{type:"error",label:u(C),onClose:O}),l.createElement("div",{className:"EmployeeLoginFooter"},l.createElement("img",{alt:"Powered by DIGIT",src:null===(o=window)||void 0===o||null===(r=o.globalConfigs)||void 0===r||null===(a=r.getConfig)||void 0===a?void 0:a.call(r,"DIGIT_FOOTER_BW"),style:{cursor:"pointer"},onClick:()=>{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()}})," "))};un.propTypes={loginParams:an.any},un.defaultProps={loginParams:null};const dn=[{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"}]}],mn=()=>{const{t:e}=o.useTranslation(),{path:t}=i.useRouteMatch(),r=n.useMemo(()=>dn.map(t=>{const n={};for(const l in t.texts)n[l]=e(t.texts[l]);return{...t,texts:n}},[dn]));return l.createElement(i.Switch,null,l.createElement(i.Route,{path:""+t,exact:!0},l.createElement(un,{config:r[0],t:e})))},pn=[{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"}]}],vn=e=>{var o,r,a;let{config:c,t:u}=e;const{data:d,isLoading:m}=Digit.Hooks.useTenants(),[p,v]=n.useState(null),g=i.useHistory(),[f,E]=n.useState(null);n.useEffect(()=>{var e,t;if(!p)return void Digit.UserService.setType("employee");Digit.UserService.setUser(p);const n=(null===(e=location.state)||void 0===e?void 0:e.from)||`/${null===(t=window)||void 0===t?void 0:t.contextPath}/employee`;g.replace(n)},[p]);const y=()=>{E(null)},[h,C]=c.inputs,b=[{body:[{label:u(h.label),type:h.type,populators:{name:h.name,componentInFront:"+91"},isMandatory:!0},{label:u(C.label),type:C.type,populators:{name:C.name,customProps:{},component:(e,n)=>l.createElement(t.Dropdown,N({option:d,optionKey:"name",id:C.name,className:"login-city-dd",select:t=>{e.onChange(t)}},n))},isMandatory:!0}]}];return m?l.createElement(t.Loader,null):l.createElement(sn,null,l.createElement("div",{className:"employeeBackbuttonAlign"},l.createElement(t.BackLink,null)),l.createElement(s.FormComposer,{onSubmit:function(e){try{if(!e.city)return alert("Please Select City!"),Promise.resolve();const t={otp:{mobileNumber:e.mobileNumber,userType:Digit.UserService.getType().toUpperCase(),type:"passwordreset",tenantId:e.city.code}},n=G(function(){return Promise.resolve(Digit.UserService.sendOtp(t,e.city.code)).then(function(){var t;g.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,l,o,r;E((null==e||null===(t=e.response)||void 0===t||null===(n=t.data)||void 0===n||null===(l=n.error)||void 0===l||null===(o=l.fields)||void 0===o||null===(r=o[0])||void 0===r?void 0:r.message)||"Invalid login credentials!"),setTimeout(y,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:b,label:c.texts.submitButtonLabel,secondaryActionLabel:c.texts.secondaryButtonLabel,onSecondayActionClick:()=>{var e;g.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"},l.createElement(cn,null)),f&&l.createElement(t.Toast,{type:"error",label:u(f),onClose:y}),l.createElement("div",{className:"EmployeeLoginFooter"},l.createElement("img",{alt:"Powered by DIGIT",src:null===(o=window)||void 0===o||null===(r=o.globalConfigs)||void 0===r||null===(a=r.getConfig)||void 0===a?void 0:a.call(r,"DIGIT_FOOTER_BW"),style:{cursor:"pointer"},onClick:()=>{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()}})," "))};vn.propTypes={loginParams:an.any},vn.defaultProps={loginParams:null};const gn=()=>{const{t:e}=o.useTranslation(),{path:t}=i.useRouteMatch(),r=n.useMemo(()=>pn.map(t=>{const n={};for(const l in t.texts)n[l]=e(t.texts[l]);return{...t,texts:n}},[pn]));return l.createElement(i.Switch,null,l.createElement(i.Route,{path:""+t,exact:!0},l.createElement(vn,{config:r[0],t:e})))},fn=(e,t)=>t.filter(t=>{var n;return null==e||null===(n=e.map)||void 0===n?void 0:n.call(e,e=>e.code).includes(t.code)}),En=e=>{var t;let{stateCode:n,userType:o,modules:r,appTenants:a,additionalComponent:s}=e;Digit;const{path:c}=i.useRouteMatch(),u=i.useLocation(),d=Digit.UserService.getUser();var m;if(!d||null==d||!d.access_token||null==d||!d.info)return l.createElement(i.Redirect,{to:{pathname:`/${null===(m=window)||void 0===m?void 0:m.contextPath}/employee/user/login`,state:{from:u.pathname+u.search}}});const p=null==r?void 0:r.map((e,t)=>{var r;let{code:s,tenants:u}=e;const d=Digit.ComponentRegistryService.getComponent(s+"Module");return l.createElement(i.Route,{key:t,path:`${c}/${s.toLowerCase()}`},d?l.createElement(d,{stateCode:n,moduleCode:s,userType:o,tenants:fn(u,a)}):l.createElement(i.Redirect,{to:`/${null===(r=window)||void 0===r?void 0:r.contextPath}/employee/user/error?type=notfound&module=${s}`}))});return l.createElement("div",{className:"ground-container digit-home-ground"},l.createElement(i.Switch,null,p,l.createElement(i.Route,{path:c+"/login"},l.createElement(i.Redirect,{to:{pathname:`/${null===(t=window)||void 0===t?void 0:t.contextPath}/employee/user/login`,state:{from:u.pathname+u.search}}})),l.createElement(i.Route,{path:c+"/forgot-password"},l.createElement(gn,null)),l.createElement(i.Route,{path:c+"/change-password"},l.createElement(mn,null)),l.createElement(i.Route,null,l.createElement(y,{userType:o,modules:r,additionalComponent:s}))))},yn={label:"English",value:Digit.Utils.getDefaultLanguage()},hn=()=>{var e,r,a,c,u;const{data:d,isLoading:m}=Digit.Hooks.useStore.getInitData(),{t:p}=o.useTranslation(),v=i.useHistory(),{languages:g,stateInfo:f}=d||{};let E=g;E&&0!=(null===(e=E)||void 0===e?void 0:e.length)||(E=[yn]);const y=Digit.StoreData.getCurrentLanguage(),[h,C]=n.useState(y);return m?l.createElement(t.Loader,null):l.createElement(sn,null,l.createElement(t.Card,{className:"bannerCard removeBottomMargin languageSelection"},l.createElement("div",{className:"bannerHeader"},l.createElement("img",{className:"bannerLogo",src:null==f?void 0:f.logoUrl,alt:"Digit"}),l.createElement("p",null,p("TENANT_TENANTS_"+(null==f||null===(r=f.code)||void 0===r?void 0:r.toUpperCase())))),l.createElement("div",{className:"language-selector",style:{justifyContent:"space-around",marginBottom:"24px",padding:"0 5%"}},E.map((e,t)=>l.createElement("div",{className:"language-button-container",key:t},l.createElement(s.CustomButton,{selected:e.value===h,text:e.label,onClick:()=>(e=>{C(e.value),Digit.LocalizationService.changeLanguage(e.value,f.code)})(e)})))),l.createElement(t.SubmitBar,{style:{width:"100%"},label:p("CORE_COMMON_CONTINUE"),onSubmit:e=>{var t;v.push(`/${null===(t=window)||void 0===t?void 0:t.contextPath}/employee/user/login`)}})),l.createElement("div",{className:"EmployeeLoginFooter"},l.createElement("img",{alt:"Powered by DIGIT",src:null===(a=window)||void 0===a||null===(c=a.globalConfigs)||void 0===c||null===(u=c.getConfig)||void 0===u?void 0:u.call(c,"DIGIT_FOOTER_BW"),style:{cursor:"pointer"},onClick:()=>{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()}})," "))},Cn=[{texts:{header:"CORE_COMMON_LOGIN",submitButtonLabel:"CORE_COMMON_CONTINUE",secondaryButtonLabel:"CORE_COMMON_FORGOT_PASSWORD"},inputs:[{label:"CORE_LOGIN_USERNAME",type:"text",key:"username",isMandatory:!0,populators:{name:"username",validation:{required:!0},error:"ERR_USERNAME_REQUIRED"}},{label:"CORE_LOGIN_PASSWORD",type:"password",key:"password",isMandatory:!0,populators:{name:"password",validation:{required:!0},error:"ERR_PASSWORD_REQUIRED"}},{isMandatory:!0,type:"dropdown",key:"city",label:"CORE_COMMON_CITY",disable:!1,populators:{name:"city",optionsKey:"name",error:"ERR_HRMS_INVALID_CITY",mdmsConfig:{masterName:"tenants",moduleName:"tenant",localePrefix:"TENANT_TENANTS",select:"(data)=>{ return Array.isArray(data['tenant'].tenants) && Digit.Utils.getUnique(data['tenant'].tenants).map(ele=>({code:ele.code,name:Digit.Utils.locale.getTransformedLocale('TENANT_TENANTS_'+ele.code)}))}"}}}]}],bn=[{texts:{header:"CORE_COMMON_LOGIN",submitButtonLabel:"CORE_COMMON_CONTINUE"},inputs:[{label:"CORE_SIGNUP_EMAILID",type:"text",key:"email",isMandatory:!0,populators:{name:"email",validation:{required:!0,pattern:/^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$/},error:"ERR_EMAIL_REQUIRED"}},{isMandatory:!1,key:"check",type:"component",component:"PrivacyComponent",withoutLabel:!0,disable:!1,customProps:{module:"Sandbox"},populators:{name:"check"}}]}],Sn=e=>{var o,r,a,s,c,u,d,m,p,v,g,f,E;let{config:y,t:h,isDisabled:C,loginOTPBased:b}=e;const{isLoading:S}=Digit.Hooks.useTenants(),{isLoading:O}=Digit.Hooks.useStore.getInitData(),[N,I]=n.useState(null),[w,_]=n.useState(null),[D,T]=n.useState(!1),L=i.useHistory();n.useEffect(()=>{var e,t,n,l,o,r,a,i,s,c,u,d,m,p,v,g,f,E;if(!N)return;Digit.SessionStorage.set("citizen.userRequestObject",N);const y=null==N||null===(e=N.info)||void 0===e||null===(t=e.roles)||void 0===t?void 0:t.filter(e=>e.tenantId===Digit.SessionStorage.get("Employee.tenantId"));(null==N||null===(n=N.info)||void 0===n||null===(l=n.roles)||void 0===l?void 0:l.length)>0&&(N.info.roles=y),Digit.UserService.setUser(N),((e,t)=>{var n;let l=(null===(n=JSON.parse(sessionStorage.getItem("Digit.locale")))||void 0===n?void 0:n.value)||Digit.Utils.getDefaultLanguage();localStorage.setItem("Employee.tenant-id",null==e?void 0:e.tenantId),localStorage.setItem("tenant-id",null==e?void 0:e.tenantId),localStorage.setItem("citizen.userRequestObject",JSON.stringify(e)),localStorage.setItem("locale",l),localStorage.setItem("Employee.locale",l),localStorage.setItem("token",t),localStorage.setItem("Employee.token",t),localStorage.setItem("user-info",JSON.stringify(e)),localStorage.setItem("Employee.user-info",JSON.stringify(e))})(null==N?void 0:N.info,null==N?void 0:N.access_token);let h=`/${null===(o=window)||void 0===o?void 0:o.contextPath}/employee`;var C,b,S,O,I,w,_;null!==(r=window)&&void 0!==r&&null!==(a=r.location)&&void 0!==a&&null!==(i=a.href)&&void 0!==i&&i.includes("from=")&&(h=decodeURIComponent(null===(C=window)||void 0===C||null===(b=C.location)||void 0===b||null===(S=b.href)||void 0===S||null===(O=S.split("from="))||void 0===O?void 0:O[1])||`/${null===(I=window)||void 0===I?void 0:I.contextPath}/employee`),null!=N&&null!==(s=N.info)&&void 0!==s&&s.roles&&(null==N||null===(c=N.info)||void 0===c||null===(u=c.roles)||void 0===u?void 0:u.length)>0&&null!=N&&null!==(d=N.info)&&void 0!==d&&null!==(m=d.roles)&&void 0!==m&&m.every(e=>"NATADMIN"===e.code)&&(h=`/${null===(w=window)||void 0===w?void 0:w.contextPath}/employee/dss/landing/NURT_DASHBOARD`),null!=N&&null!==(p=N.info)&&void 0!==p&&p.roles&&(null==N||null===(v=N.info)||void 0===v||null===(g=v.roles)||void 0===g?void 0:g.length)>0&&null!=N&&null!==(f=N.info)&&void 0!==f&&null!==(E=f.roles)&&void 0!==E&&E.every(e=>"STADMIN"===e.code)&&(h=`/${null===(_=window)||void 0===_?void 0:_.contextPath}/employee/dss/landing/home`),L.replace(h)},[N]);const R={url:"/user-otp/v1/_send",params:{tenantId:Digit.ULBService.getStateId()},body:{},config:{enable:!1}},P=Digit.Hooks.useCustomAPIMutationHook(R),A=()=>{_(null)},x={code:Digit.ULBService.getStateId(),name:Digit.Utils.locale.getTransformedLocale("TENANT_TENANTS_"+Digit.ULBService.getStateId())};let M=[{body:null==y?void 0:y.inputs}];const{mode:k}=Digit.Hooks.useQueryParams();return"admin"===k&&0==(null==M||null===(o=M[0])||void 0===o||null===(r=o.body)||void 0===r||null===(a=r[2])||void 0===a?void 0:a.disable)&&null==(null==M||null===(s=M[0])||void 0===s||null===(c=s.body)||void 0===c||null===(u=c[2])||void 0===u||null===(d=u.populators)||void 0===d?void 0:d.defaultValue)&&(M[0].body[2].disable=!0,M[0].body[2].isMandatory=!1,M[0].body[2].populators.defaultValue=x),S||O?l.createElement(t.Loader,null):l.createElement(sn,null,l.createElement("div",{className:"employeeBackbuttonAlign"},l.createElement(t.BackLink,null)),l.createElement(t.FormComposerV2,{onSubmit:b?function(e){try{const t=e.email;return Promise.resolve(P.mutate({body:{otp:{userName:e.email,type:"login",tenantId:Digit.ULBService.getStateId(),userType:"EMPLOYEE"}},config:{enable:!0}},{onError:(e,t)=>{var n,l,o,r,a,i,s;_({key:"error",label:null!=e&&null!==(n=e.response)&&void 0!==n&&null!==(l=n.data)&&void 0!==l&&null!==(o=l.Errors)&&void 0!==o&&o[0].code?"SANDBOX_RESEND_OTP"+(null==e||null===(r=e.response)||void 0===r||null===(a=r.data)||void 0===a||null===(i=a.Errors)||void 0===i||null===(s=i[0])||void 0===s?void 0:s.code):"SANDBOX_RESEND_OTP_ERROR"}),setTimeout(A,5e3)},onSuccess:function(e){try{var n;return L.push({pathname:`/${null===(n=window)||void 0===n?void 0:n.contextPath}/employee/user/login/otp`,state:{email:t,tenant:Digit.ULBService.getStateId()}}),Promise.resolve()}catch(e){return Promise.reject(e)}}})).then(function(){})}catch(e){return Promise.reject(e)}}:function(e){try{var t;function n(){T(!1)}T(!0);const l={...e,userType:"EMPLOYEE"};l.tenantId=(null==e||null===(t=e.city)||void 0===t?void 0:t.code)||Digit.ULBService.getStateId(),delete l.city;const o=G(function(){return Promise.resolve(Digit.UserService.authenticate(l)).then(function(e){let{UserRequest:t,...n}=e;Digit.SessionStorage.set("Employee.tenantId",null==t?void 0:t.tenantId),I({info:t,...n})})},function(e){var t,n;_((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)&&h("ES_ERROR_USER_NOT_PERMITTED")||h("INVALID_LOGIN_CREDENTIALS")),setTimeout(A,5e3)});return Promise.resolve(o&&o.then?o.then(n):n())}catch(e){return Promise.reject(e)}},isDisabled:C||D,noBoxShadow:!0,inline:!0,submitInForm:!0,config:M,label:null==y||null===(m=y.texts)||void 0===m?void 0:m.submitButtonLabel,secondaryActionLabel:null==y||null===(p=y.texts)||void 0===p?void 0:p.secondaryButtonLabel,onSecondayActionClick:()=>{var e;L.push(`/${null===(e=window)||void 0===e?void 0:e.contextPath}/employee/user/forgot-password`)},onFormValueChange:(e,t,n)=>{const l=M[0].body.map(e=>e.key).some(e=>{const n=t[e];return null==n||""===n||"check"===e&&!1===n||"captcha"===e&&!1===n});T(l)},heading:null==y||null===(v=y.texts)||void 0===v?void 0:v.header,className:"loginFormStyleEmployee "+(b?"sandbox-onboarding-wrapper":""),cardSubHeaderClassName:"loginCardSubHeaderClassName",cardClassName:"loginCardClassName",buttonClassName:"buttonClassName"},l.createElement(cn,null)),w&&l.createElement(t.Toast,{type:"error",label:h(w),onClose:A}),l.createElement("div",{className:"employee-login-home-footer",style:{backgroundColor:"unset"}},l.createElement("img",{alt:"Powered by DIGIT",src:null===(g=window)||void 0===g||null===(f=g.globalConfigs)||void 0===f||null===(E=f.getConfig)||void 0===E?void 0:E.call(f,"DIGIT_FOOTER_BW"),style:{cursor:"pointer"},onClick:()=>{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()}})," "))};Sn.propTypes={loginParams:an.any},Sn.defaultProps={loginParams:null};const On=e=>{var t,r;let{stateCode:a}=e;const{t:s}=o.useTranslation(),{path:c}=i.useRouteMatch(),[u,d]=n.useState(Cn),[m,p]=n.useState(bn),v=Digit.StoreData.getCurrentLanguage(),g=(null===(t=window)||void 0===t||null===(r=t.globalConfigs)||void 0===r?void 0:r.getConfig("OTP_BASED_LOGIN"))||!1,{data:f,isLoading:E}=(Digit.Services.useStore({stateCode:a,moduleCode:["privacy-policy"],language:v,modulePrefix:"digit"}),Digit.Hooks.useCommonMDMS(a,"commonUiConfig",["LoginConfig"],{select:e=>{var t;return{config:null==e||null===(t=e.commonUiConfig)||void 0===t?void 0:t.LoginConfig}},retry:!1}));n.useEffect(()=>{d(0==E&&null!=f&&f.config?null==f?void 0:f.config:Cn)},[f,E]);const y=n.useMemo(()=>u.map(e=>{const t={};for(const n in e.texts)t[n]=s(e.texts[n]);return{...e,texts:t}},[u])),h=n.useMemo(()=>m.map(e=>{const t={};for(const n in e.texts)t[n]=s(e.texts[n]);return{...e,texts:t}},[m]));return l.createElement(i.Switch,null,l.createElement(i.Route,{path:""+c,exact:!0},l.createElement(Sn,g?{config:h[0],t:s,loginOTPBased:g}:{config:y[0],t:s})))},Nn=[{texts:{header:"CORE_COMMON_SIGN_UP",submitButtonLabel:"CORE_COMMON_SIGN_UP_BUTTON"},inputs:[{label:"CORE_SIGNUP_EMAILID",type:"text",key:"email",isMandatory:!0,populators:{name:"email",validation:{required:!0,pattern:/^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$/},error:"ERR_EMAIL_REQUIRED"}},{label:"CORE_SIGNUP_ACCOUNT_NAME",type:"text",key:"accountName",isMandatory:!0,populators:{name:"accountName",validation:{required:!0,patter:/^[A-Za-z][A-Za-z-' ]*[A-Za-z]$/},error:"ERR_ACCOUNT_NAME_REQUIRED"}},{isMandatory:!1,key:"check",type:"component",component:"PrivacyComponent",withoutLabel:!0,disable:!1,customProps:{module:"SandboxSignUp"},populators:{name:"check"}}]}],In=e=>{var o,r,a,s,c,u,d,m,p,v,g,f,E;let{config:y,t:h,isDisabled:C}=e;const{isLoading:b}=Digit.Hooks.useTenants(),{isLoading:S}=Digit.Hooks.useStore.getInitData(),[O,N]=n.useState(null),[I,w]=n.useState(!1),_=i.useHistory(),D=Digit.Hooks.useCustomAPIMutationHook({url:"/tenant-management/tenant/_create",params:{},body:{},config:{enable:!1}});let T=[{body:null==y?void 0:y.inputs}];const{mode:L}=Digit.Hooks.useQueryParams();return"admin"===L&&0==(null==T||null===(o=T[0])||void 0===o||null===(r=o.body)||void 0===r||null===(a=r[2])||void 0===a?void 0:a.disable)&&null==(null==T||null===(s=T[0])||void 0===s||null===(c=s.body)||void 0===c||null===(u=c[2])||void 0===u||null===(d=u.populators)||void 0===d?void 0:d.defaultValue)&&(T[0].body[2].disable=!0,T[0].body[2].isMandatory=!1,T[0].body[2].populators.defaultValue=defaultValue),b||S?l.createElement(t.Loader,null):l.createElement(sn,null,l.createElement("div",{className:"employeeBackbuttonAlign"},l.createElement(t.BackLink,null)),l.createElement(t.FormComposerV2,{onSubmit:function(e){try{return Promise.resolve(D.mutate({body:{tenant:{name:e.accountName,email:e.email}},config:{enable:!0}},{onError:(e,t)=>{var n,l,o,r,a,i,s,c;N({key:"error",label:null!=e&&null!==(n=e.response)&&void 0!==n&&null!==(l=n.data)&&void 0!==l&&null!==(o=l.Errors)&&void 0!==o&&null!==(r=o[0])&&void 0!==r&&r.code?"SANDBOX_SIGNUP_"+(null==e||null===(a=e.response)||void 0===a||null===(i=a.data)||void 0===i||null===(s=i.Errors)||void 0===s||null===(c=s[0])||void 0===c?void 0:c.code):"SANDBOX_SIGNUP_ERROR"})},onSuccess:function(e){try{var t,n,l;return _.push({pathname:`/${null===(t=window)||void 0===t?void 0:t.globalPath}/user/otp`,state:{email:null==e||null===(n=e.Tenants[0])||void 0===n?void 0:n.email,tenant:null==e||null===(l=e.Tenants[0])||void 0===l?void 0:l.code}}),Promise.resolve()}catch(e){return Promise.reject(e)}}})).then(function(){})}catch(e){return Promise.reject(e)}},isDisabled:C||I,noBoxShadow:!0,inline:!0,submitInForm:!0,config:T,label:null==y||null===(m=y.texts)||void 0===m?void 0:m.submitButtonLabel,secondaryActionLabel:null==y||null===(p=y.texts)||void 0===p?void 0:p.secondaryButtonLabel,onFormValueChange:(e,t,n)=>{const l=T[0].body.map(e=>e.key).some(e=>{const n=t[e];return null==n||""===n||"check"===e&&!1===n||"captcha"===e&&!1===n});w(l)},heading:null==y||null===(v=y.texts)||void 0===v?void 0:v.header,className:"sandbox-signup-form",cardSubHeaderClassName:"signupCardSubHeaderClassName",cardClassName:"signupCardClassName sandbox-onboarding-wrapper",buttonClassName:"buttonClassName"},l.createElement(cn,{showTenant:!1})),O&&l.createElement(t.Toast,{type:"error",label:h(null==O?void 0:O.label),onClose:()=>{N(null)}}),l.createElement("div",{className:"employee-login-home-footer",style:{backgroundColor:"unset"}},l.createElement("img",{alt:"Powered by DIGIT",src:null===(g=window)||void 0===g||null===(f=g.globalConfigs)||void 0===f||null===(E=f.getConfig)||void 0===E?void 0:E.call(f,"DIGIT_FOOTER_BW"),style:{cursor:"pointer"},onClick:()=>{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()}})))};In.propTypes={loginParams:an.any},In.defaultProps={loginParams:null};const wn=e=>{let{stateCode:t}=e;const{t:r}=o.useTranslation(),{path:a}=i.useRouteMatch(),[s,c]=n.useState(Nn),u=Digit.StoreData.getCurrentLanguage(),{data:d,isLoading:m}=(Digit.Services.useStore({stateCode:t,moduleCode:["privacy-policy"],language:u,modulePrefix:"digit"}),Digit.Hooks.useCommonMDMS(t,"commonUiConfig",["SignUpConfig"],{select:e=>{var t;return{config:null==e||null===(t=e.commonUiConfig)||void 0===t?void 0:t.SignUpConfig}},retry:!1}));n.useEffect(()=>{c(0==m&&null!=d&&d.config?null==d?void 0:d.config:Nn)},[d,m]);const p=n.useMemo(()=>s.map(e=>{const t={};for(const n in e.texts)t[n]=r(e.texts[n]);return{...e,texts:t}},[s]));return l.createElement(i.Switch,null,l.createElement(i.Route,{path:""+a,exact:!0},l.createElement(In,{config:p[0],t:r})))},_n=e=>{var r,a,c,u;let{isLogin:d=!1}=e;const{t:m}=o.useTranslation(),p=(i.useRouteMatch(),i.useHistory()),v=i.useLocation(),[g,f]=n.useState(null),[E,y]=n.useState(!1),[h,C]=n.useState(null),[b,S]=n.useState((null==v||null===(r=v.state)||void 0===r?void 0:r.data)||{}),{email:O,tenant:N}=v.state||{},I=[{body:[{type:"component",component:"OtpComponent",key:"OtpComponent",withoutLabel:!0,isMandatory:!1,customProps:{email:O,tenant:N},populators:{required:!0}}]}],w=[{texts:{header:m("SANDBOX_OTP_VERIFICATION"),submitButtonLabel:"CORE_COMMON_SUBMIT"}}],_=()=>{f(null)};return n.useEffect(()=>{var e,t,n,l,o,r;if(!h)return;Digit.SessionStorage.set("citizen.userRequestObject",h);const a=null==h||null===(e=h.info)||void 0===e||null===(t=e.roles)||void 0===t?void 0:t.filter(e=>e.tenantId===Digit.SessionStorage.get("Employee.tenantId"));(null==h||null===(n=h.info)||void 0===n||null===(l=n.roles)||void 0===l?void 0:l.length)>0&&(h.info.roles=a),Digit.UserService.setUser(h),((e,t)=>{var n;let l=(null===(n=JSON.parse(sessionStorage.getItem("Digit.locale")))||void 0===n?void 0:n.value)||Digit.Utils.getDefaultLanguage();localStorage.setItem("Employee.tenant-id",null==e?void 0:e.tenantId),localStorage.setItem("tenant-id",null==e?void 0:e.tenantId),localStorage.setItem("citizen.userRequestObject",JSON.stringify(e)),localStorage.setItem("locale",l),localStorage.setItem("Employee.locale",l),localStorage.setItem("token",t),localStorage.setItem("Employee.token",t),localStorage.setItem("user-info",JSON.stringify(e)),localStorage.setItem("Employee.user-info",JSON.stringify(e))})(null==h?void 0:h.info,null==h?void 0:h.access_token);let i=`/${null===(o=window)||void 0===o?void 0:o.globalPath}/user/url`,s=`/${null===(r=window)||void 0===r?void 0:r.contextPath}/employee`;return d?void p.push(s):void p.push({pathname:i,state:{tenant:N}})},[h]),l.createElement(sn,null,l.createElement("div",{className:"employeeBackbuttonAlign"},l.createElement(t.BackLink,null)),l.createElement(s.FormComposerV2,{onSubmit:function(e){try{var t;const n={username:O,password:null==e||null===(t=e.OtpComponent)||void 0===t?void 0:t.otp,tenantId:N,userType:"EMPLOYEE"},l=G(function(){return Promise.resolve(Digit.UserService.authenticate(n)).then(function(e){let{UserRequest:t,...n}=e;Digit.SessionStorage.set("Employee.tenantId",null==t?void 0:t.tenantId),C({info:t,...n})})},function(e){var t,n;f((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)&&m("ES_ERROR_USER_NOT_PERMITTED")||m("INVALID_LOGIN_CREDENTIALS")),setTimeout(_,5e3)});return Promise.resolve(l&&l.then?l.then(function(){}):void 0)}catch(e){return Promise.reject(e)}},noBoxShadow:!0,inline:!0,submitInForm:!0,onFormValueChange:(e,t)=>{var n;const l=t.OtpComponent;6===(null==l||null===(n=l.otp)||void 0===n?void 0:n.length)?y(!0):y(!1)},isDisabled:!E,config:I,label:w[0].texts.submitButtonLabel,heading:w[0].texts.header,headingStyle:{textAlign:"center"},cardStyle:{maxWidth:"408px",margin:"auto"},className:"sandbox-onboarding-wrapper"},l.createElement(cn,{showTenant:!1})),g&&l.createElement(t.Toast,{type:"error",label:m(g),onClose:_}),l.createElement("div",{className:"EmployeeLoginFooter"},l.createElement("img",{alt:"Powered by DIGIT",src:null===(a=window)||void 0===a||null===(c=a.globalConfigs)||void 0===c||null===(u=c.getConfig)||void 0===u?void 0:u.call(c,"DIGIT_FOOTER_BW"),style:{cursor:"pointer"},onClick:()=>{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=()=>{var e,n,r,a;const{t:s}=o.useTranslation(),c=i.useLocation(),{tenant:u}=c.state||{};return i.useHistory(),l.createElement(sn,null,l.createElement("div",{className:"employeeBackbuttonAlign"},l.createElement(t.BackLink,null)),l.createElement(t.Card,{className:"card-sandbox"},l.createElement(cn,{showTenant:!1}),l.createElement("div",{className:"sandbox-success-signup"},l.createElement(t.SVG.TickMark,{fill:"#fff",height:40,width:60})),l.createElement(t.CardHeader,{className:"cardHeader-sandbox",styles:{color:"#00703c"}},s("SANDBOX_HEADER")),l.createElement(t.CardText,{className:"cardText-sandbox"},s("SAMDBOX_URL_SUB")),l.createElement(t.FieldV1,{className:"field-sandbox",withoutLabel:!1,label:s("SANDBOX_URL"),type:"text",nonEditable:!1,value:`${window.location.host}/${null===(e=window)||void 0===e?void 0:e.globalPath}/${u}`,placeholder:s("SANDBOX_URL_PLACEHOLDER"),populators:{}}),l.createElement("div",{className:"sandbox-url-footer"},s("SANDBOX_URL_FOOT")),l.createElement(t.Button,{onClick:()=>{var e;window.location.href=`/${null===(e=window)||void 0===e?void 0:e.globalPath}/${u}/employee`},label:s("SIGN_IN")})),l.createElement("div",{className:"EmployeeLoginFooter"},l.createElement("img",{alt:"Powered by DIGIT",src:null===(n=window)||void 0===n||null===(r=n.globalConfigs)||void 0===r||null===(a=r.getConfig)||void 0===a?void 0:a.call(r,"DIGIT_FOOTER_BW"),style:{cursor:"pointer"},onClick:()=>{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()}})))},Tn=["user/profile","user/error"],Ln=e=>{var r,a,s,c,u,d;let{stateInfo:p,userDetails:g,CITIZEN:f,cityDetails:E,mobileView:y,handleUserDropdownSelection:h,logoUrl:C,DSO:b,stateCode:S,modules:O,appTenants:N,initData:I}=e;const w=i.useHistory(),{t:_}=o.useTranslation(),{path:D}=i.useRouteMatch(),T=i.useLocation(),L=null==T||null===(r=T.pathname)||void 0===r?void 0:r.includes("language-selection"),R=Tn.some(e=>{var t;return null==T||null===(t=T.pathname)||void 0===t?void 0:t.includes(e)});n.useEffect(()=>{Digit.UserService.setType("employee")},[]);const P=null==I||null===(a=I.modules)||void 0===a||null===(s=a.filter(e=>null==e?void 0:e.additionalComponent))||void 0===s?void 0:s.map(e=>null==e?void 0:e.additionalComponent);return l.createElement("div",{className:"employee"},l.createElement(i.Switch,null,l.createElement(i.Route,{path:D+"/user"},R&&l.createElement(A,{t:_,stateInfo:p,userDetails:g,CITIZEN:f,cityDetails:E,mobileView:y,handleUserDropdownSelection:h,logoUrl:C,showSidebar:!!R,showLanguageChange:!L}),l.createElement("div",{className:R?"grounded-container":"loginContainer",style:R?{padding:0,paddingTop:"80px",marginLeft:y?"":"64px"}:{"--banner-url":`url(${null==p?void 0:p.bannerUrl})`,padding:"0px"}},l.createElement(i.Switch,null,l.createElement(i.Route,{exact:!0,path:D+"/user/login"},l.createElement(On,{stateCode:S})),l.createElement(i.Route,{exact:!0,path:D+"/user/login/otp"},l.createElement(_n,{isLogin:!0})),l.createElement(i.Route,{path:D+"/user/forgot-password"},l.createElement(gn,null)),l.createElement(i.Route,{path:D+"/user/change-password"},l.createElement(mn,null)),l.createElement(t.PrivateRoute,{path:D+"/user/profile"},l.createElement(W,{stateCode:S,userType:"employee",cityDetails:E})),l.createElement(i.Route,{path:D+"/user/error"},l.createElement(m,{initData:I,goToHome:()=>{var e,t,n,l;w.push(`/${null===(e=window)||void 0===e?void 0:e.contextPath}/${null===(t=Digit)||void 0===t||null===(n=t.UserService)||void 0===n||null===(l=n.getType)||void 0===l?void 0:l.call(n)}`)}})),l.createElement(i.Route,{path:D+"/user/language-selection"},l.createElement(hn,null)),l.createElement(i.Route,null,l.createElement(i.Redirect,{to:D+"/user/language-selection"}))))),l.createElement(i.Route,null,l.createElement(A,{t:_,stateInfo:p,userDetails:g,CITIZEN:f,cityDetails:E,mobileView:y,handleUserDropdownSelection:h,logoUrl:C,modules:O}),l.createElement("div",{className:`main ${b?"m-auto":""} digit-home-main`},l.createElement("div",{className:"employee-app-wrapper digit-home-app-wrapper"},l.createElement(v,{initData:I},l.createElement(En,{stateCode:S,userType:"employee",modules:O,appTenants:N,additionalComponent:P}))),l.createElement("div",{className:"employee-home-footer"},l.createElement("img",{alt:"Powered by DIGIT",src:null===(c=window)||void 0===c||null===(u=c.globalConfigs)||void 0===u||null===(d=u.getConfig)||void 0===d?void 0:d.call(u,"DIGIT_FOOTER"),style:{height:"1.1em",cursor:"pointer"},onClick:()=>{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()}})))),l.createElement(i.Route,null,l.createElement(i.Redirect,{to:D+"/user/language-selection"}))))},Rn=e=>{var t,o,r,a;let{stateCode:s,modules:c,appTenants:u,logoUrl:d,initData:m,defaultLanding:p="citizen"}=e;const v=i.useHistory(),{pathname:g}=i.useLocation(),f=window.innerWidth,E=Digit.ULBService.getCurrentUlb(),y=Digit.UserService.getUser(),{data:h}=Digit.Hooks.useStore.getInitData(),{stateInfo:C}=h||{},b=Digit.UserService.hasAccess(["FSM_DSO"]);let S="CITIZEN"===(null==y||null===(t=y.info)||void 0===t?void 0:t.type)||!window.location.pathname.split("/").includes("employee");window.location.pathname.split("/").includes("employee")&&(S=!1),n.useEffect(()=>{var e,t,n;null!=g&&g.includes("application-details")||(null!=g&&g.includes("inbox")||Digit.SessionStorage.del("fsm/inbox/searchParams"),null!=g&&g.includes("search")&&Digit.SessionStorage.del("fsm/search/searchParams")),null!=g&&g.includes("dss")||Digit.SessionStorage.del("DSS_FILTERS"),(null==g?void 0:g.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==g?void 0:g.toString())!==`/${null===(t=window)||void 0===t?void 0:t.contextPath}/citizen`&&(null==g?void 0:g.toString())!==`/${null===(n=window)||void 0===n?void 0:n.contextPath}/employee`||Digit.SessionStorage.del("WS_DISCONNECTION")},[g]),v.listen(()=>{var e;null===(e=window)||void 0===e||e.scrollTo({top:0,left:0,behavior:"smooth"})});const O={stateInfo:C,userDetails:y,CITIZEN:S,cityDetails:E,mobileView:f<=640,handleUserDropdownSelection:e=>{e.func()},logoUrl:d,DSO:b,stateCode:s,modules:c,appTenants:u,sourceUrl:window.location.origin+"/citizen",pathname:g,initData:m};return l.createElement(i.Switch,null,l.createElement(i.Route,{path:`/${null===(o=window)||void 0===o?void 0:o.contextPath}/employee`},l.createElement(Ln,O)),l.createElement(i.Route,{path:`/${null===(r=window)||void 0===r?void 0:r.contextPath}/citizen`},l.createElement(Et,O)),l.createElement(i.Route,null,l.createElement(i.Redirect,{to:`/${null===(a=window)||void 0===a?void 0:a.contextPath}/${p}`})))},Pn=e=>{var t,n,o,r,a,s,c;let{stateCode:u,modules:d,appTenants:m,logoUrl:p,initData:v,defaultLanding:g="citizen"}=e;const{data:f}=Digit.Hooks.useStore.getInitData(),{stateInfo:E}=f||{},y=["user/profile","user/error"].some(e=>{var t,n;return null===(t=location)||void 0===t||null===(n=t.pathname)||void 0===n?void 0:n.includes(e)});return l.createElement("div",{className:y?"grounded-container":"loginContainer",style:y?{padding:0,paddingTop:"80px",marginLeft:"64px"}:{"--banner-url":`url(${null==E?void 0:E.bannerUrl})`,padding:"0px"}},l.createElement(i.Switch,null,l.createElement(i.Route,{exact:!0,path:`/${null===(t=window)||void 0===t?void 0:t.globalPath}/user/sign-up`},l.createElement(wn,{stateCode:u})),l.createElement(i.Route,{exact:!0,path:`/${null===(n=window)||void 0===n?void 0:n.globalPath}/user/otp`},l.createElement(_n,null)),l.createElement(i.Route,{exact:!0,path:`/${null===(o=window)||void 0===o?void 0:o.globalPath}/user/url`},l.createElement(Dn,null)),(null===(r=window)||void 0===r?void 0:r.globalPath)!==(null===(a=window)||void 0===a?void 0:a.contextPath)&&l.createElement(i.Route,{path:"/"+(null===(s=window)||void 0===s?void 0:s.contextPath)},l.createElement(Rn,{stateCode:u,modules:d,appTenants:m,logoUrl:p,initData:v,defaultLanding:g})),l.createElement(i.Route,null,l.createElement(i.Redirect,{to:`/${null===(c=window)||void 0===c?void 0:c.globalPath}/user/sign-up`}))))},An=[u],xn=("object"==typeof window&&window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__?window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__({}):c.compose)(c.applyMiddleware(...An)),Mn=e=>{let{onSelect:r,...a}=e;const{t:i}=o.useTranslation(),s=Digit.ULBService.getCurrentTenantId(),[c,u]=n.useState(!1),[d,m]=n.useState(!1),{data:p}=Digit.Hooks.useCustomMDMS(s,"commonUiConfig",[{name:"PrivacyPolicy"}],{select:e=>{var t;return null==e||null===(t=e.commonUiConfig)||void 0===t?void 0:t.PrivacyPolicy.find(e=>{var t;return e.module===(null==a||null===(t=a.props)||void 0===t?void 0:t.module)})}});return n.useEffect(()=>{r("check",c)},[c]),l.createElement(l.Fragment,null,l.createElement("div",{className:"digit-privacy-checkbox"},l.createElement(t.CheckBox,{label:i("ES_BY_CLICKING"),checked:c,onChange:e=>{u(e.target.checked)}}),l.createElement(t.Button,{label:i("ES_PRIVACY_POLICY"),variation:"link",size:"medium",onClick:()=>{m(!0)},style:{marginBottom:"1.18rem",paddingLeft:"0.2rem"}})),d&&l.createElement(t.PopUp,{type:"default",className:"privacy-popUpClass",footerclassName:"popUpFooter",heading:i(null==p?void 0:p.header),onOverlayClick:()=>{m(!1)},footerChildren:[l.createElement(t.Button,{type:"button",size:"large",variation:"secondary",label:i("DIGIT_I_DO_NOT_ACCEPT"),onClick:()=>{u(!1),m(!1)}}),l.createElement(t.Button,{type:"button",size:"large",variation:"primary",label:i("DIGIT_I_ACCEPT"),className:"accept-class",onClick:()=>{u(!0),m(!1)}})],sortFooterChildren:!0,onClose:()=>{m(!1)}},l.createElement("div",null,l.createElement("div",{className:"privacy-table"},i("DIGIT_TABLE_OF_CONTENTS")),l.createElement("ul",null,null==p?void 0:p.contents.map((e,n)=>l.createElement("li",{key:n,style:{display:"flex",alignItems:"center"}},l.createElement("span",{style:{marginRight:"0.5rem"}},n+1,". "),l.createElement(t.Button,{label:i(e.header),variation:"link",size:"medium",onClick:t=>{t.preventDefault(),(e=>{const t=document.getElementById(e);t&&t.scrollIntoView({behavior:"smooth"})})(null==e?void 0:e.header)}}))))),null==p?void 0:p.contents.map((e,t)=>l.createElement("div",{key:t,id:null==e?void 0:e.header},l.createElement("div",{style:{fontWeight:"bold",paddingLeft:null!=e&&e.isSpaceRequired?"1rem":"0"}},i(e.header)),e.descriptions.map((e,t)=>l.createElement("div",{key:t,style:{paddingLeft:e.isSpaceRequired?"1rem":"0",marginBottom:"0.5rem"}},l.createElement("div",{style:{fontWeight:null!=e&&e.isBold?700:400,display:"flex",alignItems:"center"}},"points"===e.type&&l.createElement("span",{style:{marginRight:"0.5rem",listStyleType:"disc"}},"•"),"step"===e.type&&l.createElement("span",{style:{marginRight:"0.5rem",listStyleType:"decimal"}},t+1,". "),i(e.text)),(null==e?void 0:e.subDescriptions)&&(null==e?void 0:e.subDescriptions.length)>0&&l.createElement("div",{className:"policy-subdescription"},e.subDescriptions.map((e,t)=>l.createElement("div",{key:t,className:"policy-subdescription-points"},"points"===e.type&&l.createElement("span",{style:{marginRight:"0.5rem",listStyleType:"disc",paddingLeft:"1rem"}},"•"),"step"===e.type&&l.createElement("span",{style:{marginRight:"0.5rem",listStyleType:"decimal",paddingLeft:"1rem"}},t+1,". "),null===e.type&&l.createElement("span",{style:{marginRight:"0.5rem",paddingLeft:"1rem"}}," "),i(e.text))))))))))},kn=e=>{var n;let{stateCode:r,enabledModules:s,moduleReducers:u,defaultLanding:d}=e;const{isLoading:m,data:p={}}=Digit.Hooks.useInitStore(r,s);if(m)return l.createElement(t.Loader,{page:!0});const v=function(e,t){return void 0===t&&(t={}),c.createStore(((e,t)=>{return c.combineReducers({common:(n=e,function(e,t){switch(void 0===e&&(e=n),t.type){case"LANGUAGE_SELECT":return{...e,selectedLanguage:t.payload};default:return e}}),...t});var n})(e,t),xn)}(p,u(p))||{};return o.getI18n(),Digit.ComponentRegistryService.getComponent("PrivacyComponent")||Digit.ComponentRegistryService.setComponent("PrivacyComponent",Mn),l.createElement(a.Provider,{store:v},l.createElement(i.BrowserRouter,null,l.createElement(t.BodyContainer,null,l.createElement(Pn,{initData:p,stateCode:r,modules:null==p?void 0:p.modules,appTenants:p.tenants,logoUrl:null==p||null===(n=p.stateInfo)||void 0===n?void 0:n.logoUrl,defaultLanding:d}))))},Un={SelectOtp:K,ChangeCity:C,ChangeLanguage:b,PrivacyComponent:Mn,OtpComponent:e=>{var r,a;let{onSelect:c,...u}=e;const{t:d}=o.useTranslation(),[m,p]=(i.useLocation(),n.useState(null)),[v,g]=n.useState({}),[f,E]=n.useState(!0),[y,h]=n.useState(30),C=()=>{p(null)};J(()=>{h(y-1)},y>0?1e3:null),n.useEffect(()=>{c("OtpComponent",v)},[v]);const b={url:"/user-otp/v1/_send",params:{tenantId:null==u||null===(r=u.props)||void 0===r?void 0:r.code},body:{},config:{enable:!1}},S=Digit.Hooks.useCustomAPIMutationHook(b);return l.createElement(n.Fragment,null,l.createElement(t.CardLabel,{className:"sandbox-custom-otp-header"},d("CS_OTP_EMAIL")),l.createElement(t.CardLabel,{className:"sandbox-custom-otp-email"},null==u||null===(a=u.props)||void 0===a?void 0:a.email),l.createElement(t.CardLabel,{className:"sandbox-custom-otp-subheader"},d("SANDBOX_ENTER_OTP")),l.createElement(s.OTPInput,{className:"sandbox-otp-input",length:6,onChange:e=>{g({...v,otp:e})},value:null==v?void 0:v.otp}),y>0?l.createElement(t.CardText,{className:"sandbox-resend-otp"},`${d("CS_RESEND_ANOTHER_OTP")} ${y} ${d("CS_RESEND_SECONDS")}`):l.createElement("p",{className:"card-text-button sandbox-otp-input",onClick:function(){try{var e,t;return h(30),Promise.resolve(S.mutate({body:{otp:{userName:null==u||null===(e=u.props)||void 0===e?void 0:e.email,type:"login",tenantId:null==u||null===(t=u.props)||void 0===t?void 0:t.tenant,userType:"EMPLOYEE"}},config:{enable:!0}},{onError:(e,t)=>{var n,l,o,r,a,i,s;p({key:"error",label:null!=e&&null!==(n=e.response)&&void 0!==n&&null!==(l=n.data)&&void 0!==l&&null!==(o=l.Errors)&&void 0!==o&&o[0].code?"SANDBOX_RESEND_OTP"+(null==e||null===(r=e.response)||void 0===r||null===(a=r.data)||void 0===a||null===(i=a.Errors)||void 0===i||null===(s=i[0])||void 0===s?void 0:s.code):"SANDBOX_RESEND_OTP_ERROR"}),setTimeout(C,5e3)},onSuccess:function(e){try{return p({key:"info",label:d("OTP_RESNED_SUCCESFULL")}),setTimeout(C,5e3),Promise.resolve()}catch(e){return Promise.reject(e)}}})).then(function(){})}catch(e){return Promise.reject(e)}}},d("CS_RESEND_OTP")),!f&&l.createElement(t.CardLabelError,null,d("CS_INVALID_OTP")),m&&l.createElement(t.Toast,{type:null==m?void 0:m.key,label:d(null==m?void 0:m.label),onClose:C}))}};exports.DigitUI=e=>{let{stateCode:t,registry:o,enabledModules:a,moduleReducers:i,defaultLanding:s}=e;const[c,u]=n.useState(Digit.Utils.getPrivacyObject()||{}),d=(Digit.UserService.getType(),new r.QueryClient({defaultOptions:{queries:{staleTime:9e5,cacheTime:3e6,retry:!1,retryDelay:e=>Infinity}}})),m=Digit.Contexts.ComponentProvider,p=Digit.Contexts.PrivacyProvider;return Digit.UserService.hasAccess(["FSM_DSO"]),l.createElement("div",null,l.createElement(v,null,l.createElement(r.QueryClientProvider,{client:d},l.createElement(m.Provider,{value:o},l.createElement(p.Provider,{value:{privacy:null==c?void 0:c[window.location.pathname],resetPrivacy:e=>{Digit.Utils.setPrivacyObject({}),u({})},getPrivacy:()=>{const e=Digit.Utils.getPrivacyObject();return u(e),e},updatePrivacyDescoped:e=>{const t=Digit.Utils.getAllPrivacyObject(),n={...t,[window.location.pathname]:e};Digit.Utils.setPrivacyObject({...n}),u((null==t?void 0:t[window.location.pathname])||{})},updatePrivacy:(e,t)=>{u(Digit.Utils.updatePrivacy(e,t)||{})}}},l.createElement(kn,{stateCode:t,enabledModules:a,moduleReducers:i,defaultLanding:s}))))))},exports.initCoreComponents=()=>{Object.entries(Un).forEach(e=>{let[t,n]=e;Digit.ComponentRegistryService.setComponent(t,n)})};
1
+ function e(e){return e&&"object"==typeof e&&"default"in e?e.default:e}var t=require("@egovernments/digit-ui-components"),n=require("react"),l=e(n),o=require("react-i18next"),r=require("react-query"),i=require("react-redux"),a=require("react-router-dom"),s=require("@egovernments/digit-ui-react-components"),c=require("redux"),u=e(require("redux-thunk"));const d={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:"MODULE_NOT_FOUND",buttonInfo:"ACTION_TEST_HOME"}},m=e=>{const{type:t="error"}=Digit.Hooks.useQueryParams(),n=d[t],{t:r}=o.useTranslation();return l.createElement("div",{className:"error-boundary"},l.createElement("div",{className:"error-container"},l.createElement("img",{src:n.imgUrl,alt:"error"}),l.createElement("h1",null,r(n.infoMessage)),l.createElement("button",{onClick:()=>{e.goToHome()}},r(n.buttonInfo))))},p=()=>{var e,t;const 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),l.createElement("span",null)};class v extends l.Component{constructor(e){super(e),this.state={error:null,errorStack:null,hasError:!1}}static getDerivedStateFromError(e){return{error:null==e?void 0:e.message,hasError:!0,errorStack:null==e?void 0:e.stack}}componentDidCatch(e,t){this.setState({error:null==e?void 0:e.message,hasError:!0,errorStack:null==e?void 0:e.stack})}render(){return this.state.hasError?l.createElement("div",{className:"error-boundary"},l.createElement(p,null),l.createElement(m,{initData:this.props.initData})):this.props.children}}const g=(e,t,n)=>{const l=null==e?void 0:e[""+t];l&&l.map(e=>{e.link=e.navigationURL,e.i18nKey=n(e.name)});const o={links:null==l?void 0:l.reverse(),header:Digit.Utils.locale.getTransformedLocale("ACTION_TEST_"+t),iconName:`CITIZEN_${t}_ICON`};var r;return"FSM"===t&&[{role:"FSM_DSO",from:`/${null===(r=window)||void 0===r?void 0:r.contextPath}/citizen/fsm/dso-dashboard`,dashoardLink:"CS_LINK_DSO_DASHBOARD",loginLink:"CS_LINK_LOGIN_DSO"}].map(e=>{var t,l,r;let{role:i,from:a,loginLink:s,dashoardLink:c}=e;Digit.UserService.hasAccess(i)?null==o||null===(t=o.links)||void 0===t||t.push({link:a,i18nKey:n(c)}):null==o||null===(l=o.links)||void 0===l||l.push({link:`/${null===(r=window)||void 0===r?void 0:r.contextPath}/citizen/login`,state:{role:"FSM_DSO",from:a},i18nKey:n(s)})}),o},f=e=>{let{modules:n,getCitizenMenu:r,fetchedCitizen:i,isLoading:a}=e;const s=[n.filter(e=>{let{code:t}=e;return"Payment"===t})[0],...n.filter(e=>{let{code:t}=e;return"Payment"!==t})],{t:c}=o.useTranslation();return a?l.createElement(t.Loader,null):l.createElement(l.Fragment,null,l.createElement("div",{className:"citizen-all-services-wrapper"},location.pathname.includes("sanitation-ui/citizen/all-services")?null:l.createElement(t.BackButton,null),l.createElement("div",{className:"citizenAllServiceGrid"},s.filter(e=>e).map((e,n)=>{var o,a;let s,{code:u}=e;var d,m,p,v;return i&&(s=i?g(r,u,c):void 0),(null===(o=s)||void 0===o||null===(a=o.links)||void 0===a?void 0:a.length)>0?l.createElement(t.CitizenHomeCard,{header:c(null===(d=s)||void 0===d?void 0:d.header),links:null===(m=s)||void 0===m||null===(p=m.links)||void 0===p||null===(v=p.filter(e=>null==e?void 0:e.link))||void 0===v?void 0:v.sort((e,t)=>(null==e?void 0:e.orderNumber)-(null==t?void 0:t.orderNumber)),Icon:()=>(e=>{switch(e){case"PT":return l.createElement(PTIcon,{className:"fill-path-primary-main"});case"WS":return l.createElement(WSICon,{className:"fill-path-primary-main"});case"FSM":return l.createElement(t.FSMIcon,{className:"fill-path-primary-main"});case"MCollect":return l.createElement(t.MCollectIcon,{className:"fill-path-primary-main"});case"PGR":return l.createElement(PGRIcon,{className:"fill-path-primary-main"});case"TL":return l.createElement(TLIcon,{className:"fill-path-primary-main"});case"OBPS":return l.createElement(OBPSIcon,{className:"fill-path-primary-main"});case"Bills":return l.createElement(t.BillsIcon,{className:"fill-path-primary-main"});default:return l.createElement(PTIcon,{className:"fill-path-primary-main"})}})(u),Info:"OBPS"===u?()=>l.createElement(t.CitizenInfoLabel,{style:{margin:"0px",padding:"10px"},info:c("CS_FILE_APPLICATION_INFO_LABEL"),text:c("BPA_CITIZEN_HOME_STAKEHOLDER_INCLUDES_INFO_LABEL")}):null,isInfo:"OBPS"===u}):l.createElement(l.Fragment,null)}))))},E=e=>{let{modules:t,additionalComponent:o}=e;return l.createElement(n.Fragment,null,l.createElement("div",{className:"employee-app-container digit-home-employee-app"},l.createElement("div",{className:"ground-container moduleCardWrapper gridModuleWrapper digit-home-moduleCardWrapper"},null==t?void 0:t.map((e,t)=>{let{code:n}=e;const o=Digit.ComponentRegistryService.getComponent(n+"Card")||(()=>l.createElement(l.Fragment,null));return l.createElement(o,{key:t})}))),o&&(null==o?void 0:o.length)>0&&o.map(e=>{const t="string"==typeof e?Digit.ComponentRegistryService.getComponent(e):null;return t?l.createElement("div",{className:"additional-component-wrapper"},l.createElement(t,null)):null}))},y=e=>{let{userType:t,modules:n,getCitizenMenu:o,fetchedCitizen:r,isLoading:i,additionalComponent:a}=e;return"citizen"===t?l.createElement(f,{modules:n,getCitizenMenu:o,fetchedCitizen:r,isLoading:i}):l.createElement(E,{modules:n,additionalComponent:a})},h=function(e,t,n){if(void 0===e&&(e=""),void 0===t&&(t=""),void 0===n&&(n=""),""==t)return e;for(;null!==(l=e)&&void 0!==l&&l.includes(t);){var l,o;e=null===(o=e)||void 0===o?void 0:o.replace(t,n)}return e},C=e=>{var o;const[r,i]=n.useState(null),[s,c]=n.useState([]),[u,d]=n.useState([]),m=a.useHistory();let p=[];return n.useEffect(()=>{var e,t;const n=Digit.SessionStorage.get("citizen.userRequestObject");let l=[],o=[];null==n||null===(e=n.info)||void 0===e||null===(t=e.roles)||void 0===t||t.forEach(e=>l.push(e.tenantId));let r=l.filter((e,t,n)=>n.indexOf(e)===t);null==r||r.forEach(e=>{var t;o.push({label:"TENANT_TENANTS_"+(null===(t=h(e,".","_"))||void 0===t?void 0:t.toUpperCase()),value:e})}),p=null==o?void 0:o.filter(e=>e.value==Digit.SessionStorage.get("Employee.tenantId")),c(o)},[r]),l.createElement("div",{style:null!=e&&e.mobileView?{color:"#767676"}:{}},l.createElement(t.Dropdown,{t:null==e?void 0:e.t,option:s,selected:s.find(e=>e.value===(null==r?void 0:r.value)),optionKey:"label",select:e=>{var t,n,l,o;const r=Digit.SessionStorage.get("citizen.userRequestObject"),a=null===(t=Digit.SessionStorage.get("citizen.userRequestObject"))||void 0===t||null===(n=t.info)||void 0===n||null===(l=n.roles)||void 0===l?void 0:l.filter(t=>t.tenantId===e.value);if((null==a?void 0:a.length)>0&&(r.info.roles=a,r.info.tenantId=null==e?void 0:e.value),Digit.SessionStorage.set("Employee.tenantId",null==e?void 0:e.value),Digit.UserService.setUser(r),i(e),window.location.href.includes(`/${null===(o=window)||void 0===o?void 0:o.contextPath}/employee/`)){var s,c;const e=(null===(s=location.state)||void 0===s?void 0:s.from)||`/${null===(c=window)||void 0===c?void 0:c.contextPath}/employee`;m.replace(e)}window.location.reload()},freeze:!0,customSelector:l.createElement("label",{className:"cp"},null==e?void 0:e.t("TENANT_TENANTS_"+(null===(o=h(Digit.SessionStorage.get("Employee.tenantId"),".","_"))||void 0===o?void 0:o.toUpperCase())))}))},b=e=>{const o=e.dropdown||!1,{data:r,isLoading:i}=Digit.Hooks.useStore.getInitData(),{languages:a,stateInfo:s}=r||{},c=Digit.StoreData.getCurrentLanguage(),[u,d]=n.useState(c),m=e=>{d(e.value),Digit.LocalizationService.changeLanguage(e.value,s.code)};return i?null:o?l.createElement("div",null,l.createElement(t.Dropdown,{className:"language-dropdown",option:a,selected:null==a?void 0:a.find(e=>(null==e?void 0:e.value)===c),optionKey:"label",select:m,freeze:!0,customSelector:l.createElement("label",{className:"cp"},null==a||null===(p=a.find(e=>(null==e?void 0:e.value)===u))||void 0===p?void 0:p.label)})):l.createElement(l.Fragment,null,l.createElement("div",{style:{marginBottom:"5px"}},"Language"),l.createElement("div",{className:"language-selector"},a.map((e,n)=>l.createElement("div",{className:"language-button-container",key:n},l.createElement(t.Button,{label:e.label,onClick:()=>m(e),variation:e.value===u?"primary":""})))));var p},S=e=>{var o,r,i,c,u,d,m,p;let{t:v,stateInfo:g,toggleSidebar:f,isSidebarOpen:E,handleLogout:y,userDetails:h,CITIZEN:S,cityDetails:O,mobileView:N,userOptions:I,handleUserDropdownSelection:w,logoUrl:_,showLanguageChange:D=!0}=e;const[T,L]=l.useState(null);l.useEffect(function(){try{var e;const t=Digit.ULBService.getCurrentTenantId(),n=null==h||null===(e=h.info)||void 0===e?void 0:e.uuid,l=function(){if(n)return Promise.resolve(Digit.UserService.userSearch(t,{uuid:[n]},{})).then(function(e){if(e&&e.user&&e.user.length){var t;const n=e.user[0],l=null==n||null===(t=n.photo)||void 0===t?void 0:t.split(",");L(null==l?void 0:l.at(0))}})}();return Promise.resolve(l&&l.then?l.then(function(){}):void 0)}catch(e){return Promise.reject(e)}},[null!==T,null==h||null===(o=h.info)||void 0===o?void 0:o.uuid]);const R=Digit.ULBService.getCitizenCurrentTenant(!0);let P=a.useHistory();const{pathname:A}=a.useLocation(),{data:{unreadCount:x}={},isSuccess:M}=Digit.Hooks.useNotificationCount({tenantId:R,config:{enabled:"EMPLOYEE"!==(null===(k=Digit.UserService)||void 0===k||null===(U=k.getUser())||void 0===U||null===(B=U.info)||void 0===B?void 0:B.type)&&"CITIZEN"===(null===(F=Digit.UserService)||void 0===F||null===(j=F.getUser())||void 0===j||null===(V=j.info)||void 0===V?void 0:V.type)&&!!R}});var k,U,B,F,j,V;if(S)return l.createElement("div",null,l.createElement(s.TopBar,{img:null==g?void 0:g.logoUrlWhite,isMobile:!0,toggleSidebar:()=>{Digit.clikOusideFired?Digit.clikOusideFired=!1:f(!0)},logoUrl:null==g?void 0:g.logoUrlWhite,onLogout:y,userDetails:h,notificationCount:x<99?x:99,notificationCountLoaded:M,cityOfCitizenShownBesideLogo:v(R),onNotificationIconClick:function(){var e;P.push(`/${null===(e=window)||void 0===e?void 0:e.contextPath}/citizen/engagement/notifications`)},hideNotificationIconOnSomeUrlsWhenNotLoggedIn:(e=>{var t,n,l,o;return(null===(t=Digit.UserService)||void 0===t||null===(n=t.getUser())||void 0===n||!n.access_token)&&[`/${null===(l=window)||void 0===l?void 0:l.contextPath}/citizen/select-language`,`/${null===(o=window)||void 0===o?void 0:o.contextPath}/citizen/select-location`].includes(e)})(A),changeLanguage:N?null:l.createElement(b,{dropdown:!0})}));const H=!(null==h||!h.access_token),z=null===(r=Digit.ComponentRegistryService)||void 0===r?void 0:r.getComponent("CustomEmployeeTopBar");return z?l.createElement(z,{t:v,stateInfo:g,toggleSidebar:f,isSidebarOpen:E,handleLogout:y,userDetails:h,CITIZEN:S,cityDetails:O,mobileView:N,userOptions:I,handleUserDropdownSelection:w,logoUrl:_,showLanguageChange:D,loggedin:H}):l.createElement(t.TopBar,{actionFields:[l.createElement(C,{dropdown:!0,t:v}),D&&l.createElement(b,{dropdown:!0}),(null==h?void 0:h.access_token)&&l.createElement(t.Dropdown,{option:I,optionKey:"name",profilePic:T||(null==h||null===(i=h.info)||void 0===i?void 0:i.name)||(null==h||null===(c=h.info)||void 0===c||null===(u=c.userInfo)||void 0===u?void 0:u.name)||"Employee",select:w,showArrow:!0,menuStyles:{marginTop:"1rem"},theme:"light"})],onHamburgerClick:()=>{f()},className:"",img:_,logoWidth:"48px",logoHeight:"48px",logo:H?null==O?void 0:O.logoId:null==g?void 0:g.statelogo,onImageClick:()=>{},onLogoClick:()=>{},props:{},showDeafultImg:!0,style:{},theme:"light",ulb:H?null!=O&&null!==(d=O.city)&&void 0!==d&&d.ulbGrade?l.createElement(n.Fragment,null,v(null==O?void 0:O.i18nKey).toUpperCase()," ",v("ULBGRADE_"+(null==O||null===(m=O.city)||void 0===m?void 0:m.ulbGrade.toUpperCase().replace(" ","_").replace(".","_"))).toUpperCase()):l.createElement("img",{className:"state",src:_,alt:"State Logo"}):l.createElement(n.Fragment,null,v(`MYCITY_${null==g||null===(p=g.code)||void 0===p?void 0:p.toUpperCase()}_LABEL`)," ",v("MYCITY_STATECODE_LABEL"))})},O=(e,t,n,o)=>{var r,i;return[{type:"link",element:"HOME",text:e("COMMON_BOTTOM_NAVIGATION_HOME"),link:o?`/${null===(r=window)||void 0===r?void 0:r.contextPath}/employee`:`/${null===(i=window)||void 0===i?void 0:i.contextPath}/citizen`,icon:"Home",populators:{onClick:t}},{type:"component",element:"LANGUAGE",action:l.createElement(b,null),icon:"LanguageIcon"},{id:"login-btn",element:"LOGIN",text:e("CORE_COMMON_LOGIN"),icon:l.createElement(s.LogoutIcon,{className:"icon"}),populators:{onClick:n}}]};function N(){return(N=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var l in n)({}).hasOwnProperty.call(n,l)&&(e[l]=n[l])}return e}).apply(null,arguments)}const I=e=>{let{onSelect:n,onCancel:r,onDismiss:i,PopupStyles:a,isDisabled:s,hideSubmit:c}=e;const{t:u}=o.useTranslation(),d=[l.createElement("div",null,l.createElement(t.CardText,null,u("CORE_LOGOUT_WEB_CONFIRMATION_MESSAGE")+" ",l.createElement("strong",null,u("CORE_LOGOUT_MESSAGE"))))],m=[l.createElement(t.Button,{type:"button",size:"large",variation:"secondary",label:u("CORE_LOGOUT_CANCEL"),className:"logout-cancel-button",onClick:r}),l.createElement(t.Button,{type:"button",size:"large",variation:"primary",label:u("CORE_LOGOUT_WEB_YES"),formId:"modal-action",onClick:n,isDisabled:s})],p=[l.createElement(t.Button,{type:"button",size:"large",variation:"digit-action-cancel",label:u("CORE_LOGOUT_CANCEL"),className:"logout-cancel-button",onClick:r})];return l.createElement(t.PopUp,{type:"default",children:d,heading:u("CORE_LOGOUT_WEB_HEADER"),footerChildren:c?p:m,sortFooterButtons:!0,onClose:i,className:"digit-logout-popup-wrapper",onOverlayClick:i,equalWidthButtons:!0,style:a})},w=e=>{let{info:t,t:n}=e;return l.createElement("div",{className:"profile-section"},l.createElement("div",{className:"imageloader imageloader-loaded"},l.createElement("img",{className:"img-responsive img-circle img-Profile",src:"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"})),l.createElement("div",{id:"profile-name",className:"label-container name-Profile"},l.createElement("div",{className:"label-text"}," ",null==t?void 0:t.name," ")),l.createElement("div",{id:"profile-location",className:"label-container loc-Profile"},l.createElement("div",{className:"label-text"}," ",null==t?void 0:t.mobileNumber," ")),(null==t?void 0:t.emailId)&&l.createElement("div",{id:"profile-emailid",className:"label-container loc-Profile"},l.createElement("div",{className:"label-text"}," ",t.emailId," ")),l.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")&&l.createElement(C,{t:n,mobileView:!0}))},_={CommonPTIcon:l.createElement(t.PTIcon,{className:"icon"}),OBPSIcon:l.createElement(t.OBPSIcon,{className:"icon"}),propertyIcon:l.createElement(t.PropertyHouse,{className:"icon"}),TLIcon:l.createElement(t.CaseIcon,{className:"icon"}),PGRIcon:l.createElement(t.PGRIcon,{className:"icon"}),FSMIcon:l.createElement(t.FSMIcon,{className:"icon"}),WSIcon:l.createElement(t.WSICon,{className:"icon"}),MCollectIcon:l.createElement(t.MCollectIcon,{className:"icon"}),BillsIcon:l.createElement(t.CollectionIcon,{className:"icon"}),BirthIcon:l.createElement(t.BirthIcon,{className:"icon"}),DeathIcon:l.createElement(t.DeathIcon,{className:"icon"}),FirenocIcon:l.createElement(t.FirenocIcon,{className:"icon"}),HomeIcon:l.createElement(t.HomeIcon,{className:"icon"}),EditPencilIcon:l.createElement(t.EditPencilIcon,{className:"icon"}),LogoutIcon:l.createElement(t.LogoutIcon,{className:"icon"}),Phone:l.createElement(t.Phone,{className:"icon"})},D=e=>{var r,i,s;let{linkData:c,islinkDataLoading:u}=e;const{t:d}=o.useTranslation(),m=a.useHistory(),p=a.useLocation(),{pathname:v}=p,{data:g,isFetched:f}=Digit.Hooks.useStore.getInitData(),{stateInfo:E}=g||{},y=Digit.UserService.getUser();let h=window.Digit.Utils.browser.isMobile();const[C,b]=n.useState(!1),[S,D]=n.useState(!1),[T,L]=n.useState(!1),R=()=>{L(!1)};if(u)return l.createElement(t.Loader,null);const P=()=>{var e;m.push(`/${null===(e=window)||void 0===e?void 0:e.contextPath}/citizen/user/profile`)};let A=[...O(d,P,()=>{var e;m.push(`/${null===(e=window)||void 0===e?void 0:e.contextPath}/citizen/login`)},C)];A=A.filter(e=>"LANGUAGE"!==e.element),Digit.ULBService.getCurrentTenantId();const x=e=>{var t,n;let{item:o}=e;const r=(null==o?void 0:o.icon)||(null===(t=o.icon)||void 0===t||null===(n=t.type)||void 0===n?void 0:n.name),i=r?_[r]:_.BillsIcon;let s;s="component"===o.type?o.action:o.text;const c=()=>l.createElement("span",N({className:"menu-item"},o.populators),i,l.createElement("div",{className:"menu-label"},s));return"external-link"===o.type?l.createElement("a",{href:o.link},l.createElement(c,null)):"link"===o.type?l.createElement(a.Link,{to:null==o?void 0:o.link},l.createElement(c,null)):l.createElement(c,null)};let M;return f&&y&&y.access_token&&(M=l.createElement(w,{info:null==y?void 0:y.info,stateName:null==E?void 0:E.name,t:d}),A=A.filter(e=>"login-btn"!==(null==e?void 0:e.id)),A=[...A,{text:d("EDIT_PROFILE"),element:"PROFILE",icon:"EditPencilIcon",populators:{onClick:P}},{text:d("CORE_COMMON_LOGOUT"),element:"LOGOUT",icon:"LogoutIcon",populators:{onClick:()=>{D(!1),L(!0)}}},{text:l.createElement(l.Fragment,null,d("CS_COMMON_HELPLINE"),l.createElement("div",{className:"telephone",style:{marginTop:"-10%"}},null==g?void 0:g.tenants.map(e=>{}),l.createElement("div",{className:"link"},l.createElement("a",{href:"tel:"+(null==g?void 0:g.tenants[0].contactNumber)},null==g?void 0:g.tenants[0].contactNumber)))),element:"Helpline",icon:"Phone"}]),null===(r=Object.keys(c))||void 0===r||null===(i=r.sort((e,t)=>t.localeCompare(e)))||void 0===i||i.map(e=>{var t,n,l,o,r,i;(null===(t=c[e][0])||void 0===t?void 0:t.sidebar)===window.contextPath+"-links"&&A.splice(1,0,{type:null!==(n=c[e][0])&&void 0!==n&&null!==(l=n.sidebarURL)&&void 0!==l&&l.includes(null===(o=window)||void 0===o?void 0:o.contextPath)?"link":"external-link",text:d("ACTION_TEST_"+Digit.Utils.locale.getTransformedLocale(e)),links:c[e],icon:null===(r=c[e][0])||void 0===r?void 0:r.leftIcon,link:null===(i=c[e][0])||void 0===i?void 0:i.sidebarURL})}),l.createElement(l.Fragment,null,l.createElement("div",null,l.createElement("div",{style:{height:"100%",width:"100%",top:"0px",backgroundColor:"rgba(0, 0, 0, 0.54)",pointerzevents:"auto"}}),l.createElement("div",{style:{display:"flex",flexDirection:"column",height:h?"calc(100vh - 56px)":"auto",zIndex:"99"}},M,l.createElement("div",{className:"drawer-desktop"},null===(s=A)||void 0===s?void 0:s.map((e,t)=>l.createElement("div",{className:"sidebar-list "+(v===(null==e?void 0:e.link)||v===(null==e?void 0:e.sidebarURL)?"active":""),key:t},l.createElement(x,{item:e}))))),l.createElement("div",null,T&&l.createElement(I,{onSelect:()=>{Digit.UserService.logout(),L(!1)},onCancel:R,onDismiss:R}))))},T=e=>{var r,i,s,c,u;let{isMobile:d=!1,toggleSidebar:m,onLogout:p,isEmployee:v=!1,linkData:g,islinkDataLoading:f,userProfile:E}=e;const{data:y,isFetched:h}=Digit.Hooks.useStore.getInitData(),C=Digit.StoreData.getCurrentLanguage(),[b,S]=n.useState(null),{languages:N,stateInfo:I}=y||{},w=Digit.UserService.getUser(),[_,T]=n.useState(""),[L,R]=n.useState(null),[P,A]=n.useState([]),[x,M]=n.useState([]),[k,U]=n.useState(C);let B=[];const{isLoading:F,data:j}=Digit.Hooks.useAccessControl(),{t:V}=(Digit.ULBService.getCurrentTenantId(),o.useTranslation()),H=a.useHistory(),z=function(e,t,n){if(void 0===e&&(e=""),void 0===t&&(t=""),void 0===n&&(n=""),""==t)return e;for(;null!==(l=e)&&void 0!==l&&l.includes(t);){var l,o;e=null===(o=e)||void 0===o?void 0:o.replace(t,n)}return e};n.useEffect(()=>{var e,t;const n=Digit.SessionStorage.get("citizen.userRequestObject");let l=[],o=[];null==n||null===(e=n.info)||void 0===e||null===(t=e.roles)||void 0===t||t.forEach(e=>l.push(e.tenantId));let r=l.filter((e,t,n)=>n.indexOf(e)===t);null==r||r.forEach(e=>{var t;o.push({label:"TENANT_TENANTS_"+(null===(t=z(e,".","_"))||void 0===t?void 0:t.toUpperCase()),value:e})}),B=null==o?void 0:o.filter(e=>e.value==Digit.SessionStorage.get("Employee.tenantId")),A(o)},[L]);const G=()=>{Digit.clikOusideFired=!0,m(!1)};n.useEffect(()=>{b||function(){try{var e;const t=Digit.ULBService.getCurrentTenantId(),n=null==w||null===(e=w.info)||void 0===e?void 0:e.uuid,l=function(){if(n)return Promise.resolve(Digit.UserService.userSearch(t,{uuid:[n]},{})).then(function(e){var t;if(e&&e.user&&null!=e&&null!==(t=e.user)&&void 0!==t&&t.length){var n;const t=e.user[0],l=null==t||null===(n=t.photo)||void 0===n?void 0:n.split(",");S(null==l?void 0:l.at(0))}})}();Promise.resolve(l&&l.then?l.then(function(){}):void 0)}catch(e){return Promise.reject(e)}}()},[b]);const $=e=>{var t,n;H.push("/"===e[0]?`/${null===(t=window)||void 0===t?void 0:t.contextPath}/${v?"employee":"citizen"}${e}`:`/${null===(n=window)||void 0===n?void 0:n.contextPath}/${v?"employee":"citizen"}/${e}`),m()};if(f||F)return l.createElement(t.Loader,null);let W=[...O(V,G,()=>{var e;H.push(`/${null===(e=window)||void 0===e?void 0:e.contextPath}/citizen/login`),G()},v)];h&&w&&w.access_token&&(W=W.filter(e=>"login-btn"!==(null==e?void 0:e.id)));let q={};if(v){var X;null==j||j.actions.filter(e=>"url"===e.url&&"Home"!==e.displayName).forEach(e=>{var t;if(""==_&&""!==e.path){let t=e.path.split(".")[0];"TradeLicense"===t&&(t="Trade License"),q[t]?q[t].push(e):q[t]=[e]}else if(""!==e.path&&null!=e&&null!==(t=e.displayName)&&void 0!==t&&t.toLowerCase().includes(_.toLowerCase())){let t=e.path.split(".")[0];"TradeLicense"===t&&(t="Trade License"),q[t]?q[t].push(e):q[t]=[e]}});const e=Object.keys(q);for(let t=0;t<(null==e?void 0:e.length);t++){var Z,Y,J,K,Q;const n=null===(Z=q[e[t]][0])||void 0===Z||null===(Y=Z.displayName)||void 0===Y||null===(J=Y.toUpperCase())||void 0===J?void 0:J.replace(/[ -]/g,"_"),l=null===(K=e[t])||void 0===K||null===(Q=K.toUpperCase())||void 0===Q?void 0:Q.replace(/[ -]/g,"_");var ee,te,ne,le;-1===q[e[t]][0].path.indexOf(".")?W.splice(1,0,{type:"link",text:V("ACTION_TEST_"+n),link:null===(ee=q[e[t]][0])||void 0===ee?void 0:ee.navigationURL,icon:null===(te=q[e[t]][0])||void 0===te?void 0:te.leftIcon,populators:{onClick:()=>{var n;H.push(null===(n=q[e[t]][0])||void 0===n?void 0:n.navigationURL),G()}}}):W.splice(1,0,{type:"dynamic",moduleName:V("ACTION_TEST_"+l),links:null===(ne=q[e[t]])||void 0===ne?void 0:ne.map(e=>{var t,n;return{...e,displayName:V("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===(le=q[e[t]][1])||void 0===le?void 0:le.leftIcon})}const t=W.findIndex(e=>"HOME"===e.element),n=W.splice(t,1),l=W.findIndex(e=>"LANGUAGE"===e.element),o=W.splice(l,(null===(X=W)||void 0===X?void 0:X.length)-l);W.sort((e,t)=>("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==n?void 0:n[0])&&W.splice(0,0,n[0]),W=(null==o?void 0:o.length)>0?W.concat(o):W}else{var oe,re;null===(oe=Object.keys(g))||void 0===oe||null===(re=oe.sort((e,t)=>t.localeCompare(e)))||void 0===re||re.map(e=>{var t,n,l,o,r,i;"digit-ui-links"===(null===(t=g[e][0])||void 0===t?void 0:t.sidebar)&&W.splice(1,0,{type:null!==(n=g[e][0])&&void 0!==n&&null!==(l=n.sidebarURL)&&void 0!==l&&l.includes(null===(o=window)||void 0===o?void 0:o.contextPath)?"link":"external-link",text:V("ACTION_TEST_"+Digit.Utils.locale.getTransformedLocale(e)),links:g[e],icon:null===(r=g[e][0])||void 0===r?void 0:r.leftIcon,link:null===(i=g[e][0])||void 0===i?void 0:i.sidebarURL})})}H.location.pathname.includes("/openlink")&&(W=W.filter(e=>"LANGUAGE"===e.element)),W=null===(r=W)||void 0===r?void 0:r.map(e=>({...e,label:(null==e?void 0:e.text)||(null==e?void 0:e.moduleName)||"",icon:null!=e&&e.icon?null==e?void 0:e.icon:void 0}));const ie=V("TENANT_TENANTS_"+(null===(i=z(Digit.SessionStorage.get("Employee.tenantId"),".","_"))||void 0===i?void 0:i.toUpperCase())),ae=null===(s=W)||void 0===s?void 0:s.map(e=>{var t;return"dynamic"===(null==e?void 0:e.type)?{...e,children:null==e||null===(t=e.links)||void 0===t?void 0:t.map(e=>({...e,label:null==e?void 0:e.displayName,icon:null==e?void 0:e.leftIcon}))}:e}),se=null==P?void 0:P.map(e=>({...e,type:"custom",key:"city"})),ce=null==N?void 0:N.map(e=>({...e,type:"custom",key:"language"})),ue=[{label:ie,value:ie,children:(null==se?void 0:se.length)>0?se:void 0,type:"custom",key:"city"},{label:V("Language"),children:(null==ce?void 0:ce.length)>0?ce:void 0,type:"custom",key:"language"},{label:V("EDIT_PROFILE"),type:"custom",key:"editProfile"},{label:V("Modules"),children:ae}];return d?l.createElement(t.MobileSidebar,{items:ue,profileName:null==w||null===(c=w.info)||void 0===c?void 0:c.name,profileNumber:null==w||null===(u=w.info)||void 0===u?void 0:u.mobileNumber,theme:"dark",transitionDuration:.3,styles:{marginTop:"64px",height:"93%"},onLogout:p,hideUserManuals:!0,profile:b||void 0,isSearchable:!0,onSelect:e=>{let{item:t,index:n,parentIndex:l}=e;return(e=>{let{item:t}=e;if(null!=t&&t.navigationURL)$(null==t?void 0:t.navigationURL);else if(null!=t&&t.link)$(null==t?void 0:t.link);else{if("custom"!==(null==t?void 0:t.type))return;switch(null==t?void 0:t.key){case"editProfile":E(),m();break;case"language":U((n=t).value),Digit.LocalizationService.changeLanguage(n.value,I.code),m();break;case"city":(e=>{var t,n,l,o;const r=Digit.SessionStorage.get("citizen.userRequestObject"),i=null===(t=Digit.SessionStorage.get("citizen.userRequestObject"))||void 0===t||null===(n=t.info)||void 0===n||null===(l=n.roles)||void 0===l?void 0:l.filter(t=>t.tenantId===e.value);if((null==i?void 0:i.length)>0&&(r.info.roles=i,r.info.tenantId=null==e?void 0:e.value),Digit.SessionStorage.set("Employee.tenantId",null==e?void 0:e.value),Digit.UserService.setUser(r),R(e),window.location.href.includes(`/${null===(o=window)||void 0===o?void 0:o.contextPath}/employee/`)){var a,s;const e=(null===(a=location.state)||void 0===a?void 0:a.from)||`/${null===(s=window)||void 0===s?void 0:s.contextPath}/employee`;H.replace(e)}window.location.reload()})(t),m()}}var n})({item:t,index:n,parentIndex:l})}}):l.createElement(D,{logout:p})},L=["digit-ui","works-ui","workbench-ui","health-ui","sanitation-ui","core-ui","mgramseva-web"],R=()=>{const{isLoading:e,data:n}=Digit.Hooks.useAccessControl(),r=(o.useTranslation(),a.useHistory()),i={};null==n||n.actions.filter(e=>"url"===e.url).forEach(e=>{var t;if(null==e||null===(t=e.path)||void 0===t||t.split("."),""!==(null==e?void 0:e.path)){var n;const t=null==e||null===(n=e.path)||void 0===n?void 0:n.split(".");let l={};t.reduce((n,l,o)=>{if(o!==t.length-1)return n[l]={},n[l];n[l]={item:e}},l),function e(t,n){for(const l in n)n.hasOwnProperty(l)&&("object"!=typeof n[l]||Array.isArray(n[l])?t[l]||(t[l]=n[l]):(t[l]||(t[l]={}),e(t[l],n[l])))}(i,l)}});const s=function(e){const t=(e,n)=>{if(n.item)return{label:n.item.displayName,icon:{icon:n.item.leftIcon,width:"1.5rem",height:"1.5rem"},navigationUrl:n.item.navigationURL};const l=Object.keys(n).map(e=>t(e,n[e]));return{label:e,icon:{icon:function e(t){void 0===t&&(t={});for(const n in t){const l=t[n];if("item"===n&&""!==(null==l?void 0:l.leftIcon))return null==l?void 0:l.leftIcon;if("object"==typeof t[n]&&!Array.isArray(t[n])){const l=e(t[n]);if(l)return l}}return null}(n),width:"1.5rem",height:"1.5rem"},children:l}};return Object.keys(e).map(n=>t(n,e[n]))}((e=>{const t=Object.entries(e);return t.sort((e,t)=>e[0]<t[0]?-1:e[0]>t[0]?1:0),Object.fromEntries(t)})(i));return e?l.createElement(t.Loader,null):i?l.createElement(t.Sidebar,{items:s,hideAccessbilityTools:!0,onSelect:e=>{let{item:t,index:n,parentIndex:l}=e;return(e=>{let{item:t}=e;null!=t&&t.navigationUrl&&function(e,t){var n,l;if(void 0===e&&(e={}),void 0===t&&(t=""),"/"!=t)if(-1===(null===(n=t)||void 0===n?void 0:n.indexOf("/"+(null===(l=window)||void 0===l?void 0:l.contextPath)))){const e=window.location.origin,n=null!=L&&L.every(e=>{var n;return-1===(null===(n=t)||void 0===n?void 0:n.indexOf("/"+e))})?e+"/employee/"+t:e+t;window.location.href=n}else e.push(t)}(r,null==t?void 0:t.navigationUrl)})({item:t,index:n,parentIndex:l})},theme:"dark",variant:"primary",transitionDuration:"",className:"",styles:{},expandedWidth:"",collapsedWidth:"",onBottomItemClick:()=>{}}):""},P=e=>{let{CITIZEN:t,isSidebarOpen:n,toggleSidebar:o,handleLogout:r,mobileView:i,userDetails:a,modules:s,linkData:c,islinkDataLoading:u,userProfile:d}=e;return t?l.createElement(T,{isOpen:n,isMobile:!0,toggleSidebar:o,onLogout:r,linkData:c,islinkDataLoading:u,userProfile:d}):!n&&null!=a&&a.access_token?l.createElement("div",{className:"digit-employeeSidebar"},l.createElement(R,{mobileView:i,userDetails:a,modules:s})):l.createElement("div",{className:"digit-citizenSidebar"},l.createElement(T,{isOpen:n,isMobile:!0,toggleSidebar:o,onLogout:r,isEmployee:!0,userProfile:d}))},A=e=>{let{t:t,stateInfo:o,userDetails:r,CITIZEN:i,cityDetails:s,mobileView:c,handleUserDropdownSelection:u,logoUrl:d,showSidebar:m=!0,showLanguageChange:p,linkData:v,islinkDataLoading:g}=e;const[f,E]=n.useState(!1),y=a.useHistory(),[h,C]=n.useState(!1),b=()=>{E(!1),C(!0)},O=()=>{C(!1)},N=()=>{E(!f)},w=()=>{var e;y.push(`/${null===(e=window)||void 0===e?void 0:e.contextPath}/employee/user/profile`)},_=[{name:t("EDIT_PROFILE"),icon:"Edit",func:w},{name:t("CORE_COMMON_LOGOUT"),icon:"Logout",func:b}];return l.createElement(l.Fragment,null,l.createElement(S,{t:t,stateInfo:o,toggleSidebar:N,isSidebarOpen:f,handleLogout:b,userDetails:r,CITIZEN:i,cityDetails:s,mobileView:c,userOptions:_,handleUserDropdownSelection:u,logoUrl:d,showLanguageChange:p}),h&&l.createElement(I,{onSelect:()=>{Digit.UserService.logout(),C(!1)},onCancel:O,onDismiss:O}),m&&l.createElement(P,{t:t,CITIZEN:i,isSidebarOpen:f,toggleSidebar:N,handleLogout:b,mobileView:c,userDetails:r,linkData:v,userProfile:w,islinkDataLoading:g}))},x=e=>{const{question:r,answer:i,lastIndex:a}=e,[s,c]=n.useState(!1),{t:u}=o.useTranslation();return l.createElement("div",{className:"faqs border-none",onClick:()=>c(!s)},l.createElement("div",{className:"faq-question",style:{justifyContent:"space-between",display:"flex"}},l.createElement("span",null,u(r)),l.createElement("span",{className:s?"faqicon rotate":"faqicon",style:{float:"right"}},l.createElement(t.ArrowForward,null))),l.createElement("div",{className:"faq-answer",style:s?{display:"block"}:{display:"none"}},l.createElement("span",null,u(i))),a?null:l.createElement("div",{className:"cs-box-border"}))},M=e=>{var r,i,a;let{module:s}=e;const c=Digit.UserService.getUser(),{t:u}=((null==c||null===(r=c.info)||void 0===r?void 0:r.tenantId)||Digit.ULBService.getCurrentTenantId(),o.useTranslation()),{isLoading:d,data:m}=Digit.Hooks.useGetFAQsJSON(Digit.ULBService.getStateId()),p=null==m||null===(i=m.MdmsRes["common-masters"])||void 0===i||null===(a=i.faqs[0])||void 0===a?void 0:a[""+s].faqs;return d?l.createElement(t.Loader,null):l.createElement(n.Fragment,null,l.createElement("div",{className:"faq-page"},l.createElement(t.BackButton,{style:{marginLeft:"unset"}}),l.createElement("div",{style:{marginBottom:"15px"}},l.createElement(t.Header,{styles:{marginLeft:"0px",paddingTop:"10px",fontSize:"32px"}},u("FAQ_S"))),l.createElement("div",{className:"faq-list"},p.map((e,t)=>l.createElement(x,{key:"faq_"+t,question:e.question,answer:e.answer,lastIndex:t===(null==p?void 0:p.length)-1})))))},k=()=>{var e,n,r,i,s,c,u,d,m,p,v,g,f,E,y,h,C,b,S,O,I,w,_;const{t:D}=o.useTranslation(),T=a.useHistory(),L=Digit.ULBService.getCitizenCurrentTenant(!0),{data:{uiHomePage:R}={},isLoading:P}=Digit.Hooks.useStore.getInitData();let A=window.Digit.Utils.browser.isMobile();const x=()=>{var e,t,n,l,o;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===(l=Digit.UserService)||void 0===l||null===(o=l.getUser())||void 0===o||!o.access_token)},{data:M,isLoading:k}=Digit.Hooks.useEvents({tenantId:L,variant:"whats-new",config:{enabled:x()}});var U;L||T.push(`/${null===(U=window)||void 0===U?void 0:U.contextPath}/citizen/select-language`);const B=null==R?void 0:R.appBannerDesktop,F=null==R?void 0:R.appBannerMobile,j=null==R?void 0:R.citizenServicesCard,V=null==R?void 0:R.informationAndUpdatesCard,H=null==R?void 0:R.whatsAppBannerDesktop,z=null==R?void 0:R.whatsAppBannerMobile,G=null==R?void 0:R.whatsNewSection,$=null==R?void 0:R.redirectURL;var W,q;$&&T.push(`/${null===(W=window)||void 0===W?void 0:W.contextPath}/citizen/${$}`),null!==(e=window)&&void 0!==e&&null!==(n=e.location)&&void 0!==n&&null!==(r=n.href)&&void 0!==r&&null!==(i=r.includes)&&void 0!==i&&i.call(r,"sanitation-ui")&&T.push(`/${null===(q=window)||void 0===q?void 0:q.contextPath}/citizen/all-services`);const X=e=>{window.open(null==e?void 0:e.navigationUrl)},Z={header:D(null==j?void 0:j.headerLabel),sideOption:{name:D(null==j||null===(s=j.sideOption)||void 0===s?void 0:s.name),onClick:()=>{var e;return T.push(null==j||null===(e=j.sideOption)||void 0===e?void 0:e.navigationUrl)}},options:[{name:D(null==j||null===(c=j.props)||void 0===c||null===(u=c[0])||void 0===u?void 0:u.label),Icon:l.createElement(t.ComplaintIcon,null),onClick:()=>{var e,t;return T.push(null==j||null===(e=j.props)||void 0===e||null===(t=e[0])||void 0===t?void 0:t.navigationUrl)}},{name:D(null==j||null===(d=j.props)||void 0===d||null===(m=d[1])||void 0===m?void 0:m.label),Icon:l.createElement(t.PTIcon,{className:"fill-path-primary-main"}),onClick:()=>{var e,t;return T.push(null==j||null===(e=j.props)||void 0===e||null===(t=e[1])||void 0===t?void 0:t.navigationUrl)}},{name:D(null==j||null===(p=j.props)||void 0===p||null===(v=p[2])||void 0===v?void 0:v.label),Icon:l.createElement(t.CaseIcon,{className:"fill-path-primary-main"}),onClick:()=>{var e,t;return T.push(null==j||null===(e=j.props)||void 0===e||null===(t=e[2])||void 0===t?void 0:t.navigationUrl)}},{name:D(null==j||null===(g=j.props)||void 0===g||null===(f=g[3])||void 0===f?void 0:f.label),Icon:l.createElement(t.OBPSIcon,null),onClick:()=>{var e,t;return T.push(null==j||null===(e=j.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%"}},Y={header:D(null==V?void 0:V.headerLabel),sideOption:{name:D(null==V||null===(E=V.sideOption)||void 0===E?void 0:E.name),onClick:()=>{var e;return T.push(null==V||null===(e=V.sideOption)||void 0===e?void 0:e.navigationUrl)}},options:[{name:D(null==V||null===(y=V.props)||void 0===y||null===(h=y[0])||void 0===h?void 0:h.label),Icon:l.createElement(t.HomeIcon,null),onClick:()=>{var e,t;return T.push(null==V||null===(e=V.props)||void 0===e||null===(t=e[0])||void 0===t?void 0:t.navigationUrl)}},{name:D(null==V||null===(C=V.props)||void 0===C||null===(b=C[1])||void 0===b?void 0:b.label),Icon:l.createElement(t.Calender,null),onClick:()=>{var e,t;return T.push(null==V||null===(e=V.props)||void 0===e||null===(t=e[1])||void 0===t?void 0:t.navigationUrl)}},{name:D(null==V||null===(S=V.props)||void 0===S||null===(O=S[2])||void 0===O?void 0:O.label),Icon:l.createElement(t.DocumentIcon,null),onClick:()=>{var e,t;return T.push(null==V||null===(e=V.props)||void 0===e||null===(t=e[2])||void 0===t?void 0:t.navigationUrl)}},{name:D(null==V||null===(I=V.props)||void 0===I||null===(w=I[3])||void 0===w?void 0:w.label),Icon:l.createElement(t.DocumentIcon,null),onClick:()=>{var e,t;return T.push(null==V||null===(e=V.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 P?l.createElement(t.Loader,null):l.createElement("div",{className:"HomePageContainer"},l.createElement("div",{className:"HomePageWrapper"},l.createElement("div",{className:"BannerWithSearch"},l.createElement("img",A?{src:null==F?void 0:F.bannerUrl}:{src:null==B?void 0:B.bannerUrl}),l.createElement("div",{className:"ServicesSection"},l.createElement(t.CardBasedOptions,N({style:{marginTop:"-30px"}},Z)),l.createElement(t.CardBasedOptions,N({style:A?{}:{marginTop:"-30px"}},Y)))),(z||H)&&l.createElement("div",{className:"WhatsAppBanner"},l.createElement("img",A?{src:null==z?void 0:z.bannerUrl,onClick:()=>X(z)}:{src:null==H?void 0:H.bannerUrl,onClick:()=>X(H)})),x()?k?l.createElement(t.Loader,null):l.createElement("div",{className:"WhatsNewSection"},l.createElement("div",{className:"headSection"},l.createElement("h2",null,D(null==G?void 0:G.headerLabel)),l.createElement("p",{onClick:()=>{var e;return T.push(null==G||null===(e=G.sideOption)||void 0===e?void 0:e.navigationUrl)}},D(null==G||null===(_=G.sideOption)||void 0===_?void 0:_.name))),l.createElement(t.WhatsNewCard,null==M?void 0:M[0])):null))},U=()=>{const{t:e}=o.useTranslation(),r=a.useHistory(),{data:{languages:i,stateInfo:s}={},isLoading:c}=Digit.Hooks.useStore.getInitData(),u=Digit.StoreData.getCurrentLanguage(),d=n.useMemo(()=>({header:e("CS_COMMON_CHOOSE_LANGUAGE"),submitBarLabel:e("CORE_COMMON_CONTINUE")}),[e]),m=n.useMemo(()=>({options:i,optionsKey:"label",additionalWrapperClass:"digit-reverse-radio-selection-wrapper",onSelect:e=>Digit.LocalizationService.changeLanguage(e.value,s.code),selectedOption:null==i?void 0:i.filter(e=>e.value===u)[0]}),[u,i]);return c?l.createElement(t.Loader,null):l.createElement("div",{className:"selection-card-wrapper"},l.createElement(t.PageBasedInput,{texts:d,onSubmit:function(){var e;r.push(`/${null===(e=window)||void 0===e?void 0:e.contextPath}/citizen/select-location`)}},l.createElement(t.CardHeader,null,e("CS_COMMON_CHOOSE_LANGUAGE")),l.createElement(t.RadioButtons,m)))},B=()=>{const{t:e}=o.useTranslation(),r=a.useHistory(),i=a.useLocation(),{data:s,isLoading:c}=Digit.Hooks.useTenants(),[u,d]=n.useState(()=>({code:Digit.ULBService.getCitizenCurrentTenant(!0)})),[m,p]=n.useState(!1),v=n.useMemo(()=>({header:e("CS_COMMON_CHOOSE_LOCATION"),submitBarLabel:e("CORE_COMMON_CONTINUE")}),[e]);function g(e){d(e),p(!1)}const f=n.useMemo(()=>({options:s,optionsKey:"i18nKey",additionalWrapperClass:"digit-reverse-radio-selection-wrapper",onSelect:g,selectedOption:u}),[s,e,u]);return c?l.createElement("loader",null):l.createElement("div",{className:"selection-card-wrapper"},l.createElement(t.BackButton,null),l.createElement(t.PageBasedInput,{texts:v,onSubmit:function(){if(u){var e,t;Digit.SessionStorage.set("CITIZEN.COMMON.HOME.CITY",u);const n=null===(e=i.state)||void 0===e?void 0:e.redirectBackTo;n?r.replace(n):r.push(`/${null===(t=window)||void 0===t?void 0:t.contextPath}/citizen`)}else p(!0)},className:"location-selection-container"},l.createElement(t.CardHeader,null,e("CS_COMMON_CHOOSE_LOCATION")),l.createElement(t.SearchOnRadioButtons,N({},f,{placeholder:e("COMMON_TABLE_SEARCH")})),m?l.createElement(t.CardLabelError,null,e("CS_COMMON_LOCATION_SELECTION_ERROR")):null))},F=function(){function e(){}return e.prototype.then=function(t,n){const l=new e,o=this.s;if(o){const e=1&o?t:n;if(e){try{j(l,1,e(this.v))}catch(e){j(l,2,e)}return l}return this}return this.o=function(e){try{const o=e.v;1&e.s?j(l,1,t?t(o):o):n?j(l,1,n(o)):j(l,2,o)}catch(e){j(l,2,e)}},l},e}();function j(e,t,n){if(!e.s){if(n instanceof F){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;const l=e.o;l&&l(e)}}function V(e){return e instanceof F&&1&e.s}const H="undefined"!=typeof Symbol?Symbol.iterator||(Symbol.iterator=Symbol("Symbol.iterator")):"@@iterator";function z(e,t,n){if("function"==typeof e[H]){var l,o,r,i=e[H]();if(function e(a){try{for(;!((l=i.next()).done||n&&n());)if((a=t(l.value))&&a.then){if(!V(a))return void a.then(e,r||(r=j.bind(null,o=new F,2)));a=a.v}o?j(o,1,a):o=a}catch(e){j(o||(o=new F),2,e)}}(),i.return){var a=function(e){try{l.done||i.return()}catch(e){}return e};if(o&&o.then)return o.then(a,function(e){throw a(e)});a()}return o}if(!("length"in e))throw new TypeError("Object is not iterable");for(var s=[],c=0;c<e.length;c++)s.push(e[c]);return function(e,t,n){var l,o,r=-1;return function i(a){try{for(;++r<e.length&&(!n||!n());)if((a=t(r))&&a.then){if(!V(a))return void a.then(i,o||(o=j.bind(null,l=new F,2)));a=a.v}l?j(l,1,a):l=a}catch(e){j(l||(l=new F),2,e)}}(),l}(s,function(e){return t(s[e])},n)}function G(e,t){try{var n=e()}catch(e){return t(e)}return n&&n.then?n.then(void 0,t):n}function $(e){let{setProfilePic:t,closeDrawer:r,userType:i,removeProfilePic:a,showToast:c}=e;const[u,d]=n.useState(null),[m,p]=n.useState(""),[v,g]=n.useState(null),{t:f}=o.useTranslation();return n.useEffect(()=>{!function(){try{g(null);const e=function(){if(m){const e=function(){if(m.size>=1e6)c("error",f("CORE_COMMON_PROFILE_MAXIMUM_UPLOAD_SIZE_EXCEEDED")),g(f("CORE_COMMON_PROFILE_MAXIMUM_UPLOAD_SIZE_EXCEEDED"));else{const e=G(function(){return Promise.resolve(Digit.UploadServices.Filestorage(i+"-profile",m,Digit.ULBService.getStateId())).then(function(e){var n,l;if((null==e||null===(n=e.data)||void 0===n||null===(l=n.files)||void 0===l?void 0:l.length)>0){var o,r;const n=null==e||null===(o=e.data)||void 0===o||null===(r=o.files[0])||void 0===r?void 0:r.fileStoreId;d(n),t(n)}else c("error",f("CORE_COMMON_PROFILE_FILE_UPLOAD_ERROR")),g(f("CORE_COMMON_PROFILE_FILE_UPLOAD_ERROR"))})},function(){c("error",f("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]),l.createElement(l.Fragment,null,l.createElement("div",{style:{position:"fixed",top:"0",left:"0",right:"0",bottom:"0",width:"100%",height:"100vh",backgroundColor:"rgba(0,0,0,.5)"},onClick:()=>r()}),l.createElement("div",{style:{width:"100%",justifyContent:"space-between",display:"flex",backgroundColor:"white",alignItems:"center",position:"fixed",left:"0",right:"0",height:"20%",bottom:"citizen"===i?"2.5rem":"0",zIndex:"1000"}},l.createElement("div",{style:{display:"flex",flex:"1",flexDirection:"column",width:"100%",justifyContent:"center",alignItems:"center",gap:"8px 0"}},l.createElement("label",{for:"file",style:{cursor:"pointer"}}," ",l.createElement(s.GalleryIcon,null)),l.createElement("label",{style:{cursor:"pointer"}}," Gallery"),l.createElement("input",{type:"file",id:"file",accept:"image/*, .png, .jpeg, .jpg",onChange:e=>p(e.target.files[0]),style:{display:"none"}})),l.createElement("div",{style:{display:"flex",flex:"1",width:"100%",justifyContent:"center",alignItems:"center",flexDirection:"column",gap:"8px 0"}},l.createElement("button",{onClick:()=>{a(),r()}},l.createElement(s.RemoveIcon,null)),l.createElement("label",{style:{cursor:"pointer"}},"Remove"))))}"undefined"!=typeof Symbol&&(Symbol.asyncIterator||(Symbol.asyncIterator=Symbol("Symbol.asyncIterator")));const W=e=>{var r,i,c,u,d,m,p,v,g,f,E;let{stateCode:y,userType:h,cityDetails:C}=e;a.useHistory();const{t:b}=o.useTranslation(),S=window.location.href,O=Digit.ULBService.getStateId(),I=Digit.ULBService.getCurrentTenantId(),w=(null===(r=Digit.UserService.getUser())||void 0===r?void 0:r.info)||{},[_,D]=n.useState(null),[T,L]=n.useState(null!=w&&w.name?w.name:""),[R,P]=n.useState(null!=w&&w.emailId?w.emailId:""),[A,x]=n.useState(null==_?void 0:_.gender),[M,k]=n.useState(null!=w&&w.permanentCity?w.permanentCity:C.name),[U,B]=n.useState(null!=w&&w.mobileNumber?w.mobileNumber:""),[F,j]=n.useState(null),[V,H]=n.useState(""),[z,W]=n.useState(!1),[q,X]=n.useState(!1),[Z,Y]=n.useState(""),[J,K]=n.useState(""),[Q,ee]=n.useState(""),[te,ne]=n.useState(null),[le,oe]=n.useState(!1),[re,ie]=l.useState(window.innerWidth),[ae,se]=l.useState({}),ce=window.Digit.Utils.browser.isMobile();l.useEffect(()=>(window.addEventListener("resize",()=>ie(window.innerWidth)),()=>{window.removeEventListener("resize",()=>ie(window.innerWidth))})),n.useEffect(()=>{var e;oe(!0),function(){try{const e=null==w?void 0:w.uuid,t=function(){if(e)return Promise.resolve(Digit.UserService.userSearch(I,{uuid:[e]},{})).then(function(e){e&&e.user&&e.user.length&&D(e.user[0])})}();Promise.resolve(t&&t.then?t.then(function(){}):void 0)}catch(e){return Promise.reject(e)}}(),x({i18nKey:void 0,code:null==_?void 0:_.gender,value:null==_?void 0:_.gender});const t=null==_||null===(e=_.photo)||void 0===e?void 0:e.split(",");H(null==t?void 0:t.at(0)),oe(!1)},[null!==_]);let ue={};const de=e=>x(e),me=()=>W(!1),pe=e=>{L(e),!new RegExp(/^[a-zA-Z ]+$/i).test(e)||0===e.length||e.length>50?se({...ae,userName:{type:"pattern",message:"CORE_COMMON_PROFILE_NAME_INVALID"}}):se({...ae,userName:null})},ve=e=>{(null==w?void 0:w.userName)!==e?(P(e),!e.length||e.includes("@")&&e.includes(".")?se({...ae,emailAddress:null}):se({...ae,emailAddress:{type:"pattern",message:"CORE_COMMON_PROFILE_EMAIL_INVALID"}})):se({...ae,emailAddress:null})},ge=function(e,t,n){void 0===n&&(n=5e3),ne({key:e,action:t}),setTimeout(()=>{ne(null)},n)},fe=function(){try{let t=!1;function e(e){if(t)return e;oe(!1)}oe(!0);const n=G(function(){const e={...w,name:T,gender:null==A?void 0:A.value,emailId:R,photo:F};if(!new RegExp(/^([a-zA-Z ])*$/).test(T)||""===T||T.length>50||T.length<1)throw JSON.stringify({type:"error",message:b("CORE_COMMON_PROFILE_NAME_INVALID")});if("employee"===h&&!new RegExp(/^[6-9]{1}[0-9]{9}$/).test(U))throw JSON.stringify({type:"error",message:b("CORE_COMMON_PROFILE_MOBILE_NUMBER_INVALID")});if(R.length&&(!R.includes("@")||!R.includes(".")))throw JSON.stringify({type:"error",message:b("CORE_COMMON_PROFILE_EMAIL_INVALID")});if(q&&(Z.length||J.length||Q.length)){if(J!==Q)throw JSON.stringify({type:"error",message:b("CORE_COMMON_PROFILE_PASSWORD_MISMATCH")});if(!(Z.length&&J.length&&Q.length))throw JSON.stringify({type:"error",message:b("CORE_COMMON_PROFILE_PASSWORD_INVALID")});if(!new RegExp(/^([a-zA-Z0-9@#$%]{8,15})$/i).test(J)&&!new RegExp(/^([a-zA-Z0-9@#$%]{8,15})$/i).test(Q))throw JSON.stringify({type:"error",message:b("CORE_COMMON_PROFILE_PASSWORD_INVALID")})}return Promise.resolve(Digit.UserService.updateUser(e,y)).then(function(e){let{responseInfo:t}=e;if(t&&"200"===t.status){const e=Digit.UserService.getUser();e&&Digit.UserService.setUser({...e,info:{...e.info,name:T,mobileNumber:U,emailId:R,permanentCity:M}})}return function(){if(Z.length&&J.length&&Q.length){const e={existingPassword:Z,newPassword:J,tenantId:I,type:"EMPLOYEE",username:null==w?void 0:w.userName,confirmPassword:Q};return function(){if(J===Q)return G(function(){return Promise.resolve(Digit.UserService.changePassword(e,I)).then(function(e){const{responseInfo:t}=e;if(null==t||!t.status||"200"!==t.status)throw"";ge("success",b("CORE_COMMON_PROFILE_UPDATE_SUCCESS_WITH_PASSWORD"),5e3),setTimeout(()=>Digit.UserService.logout(),2e3)})},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&&ge("success",b("CORE_COMMON_PROFILE_UPDATE_SUCCESS"),5e3)}()})},function(e){const t=JSON.parse(e);ge(t.type,b(t.message),5e3)});return Promise.resolve(n&&n.then?n.then(e):e(n))}catch(e){return Promise.reject(e)}};let Ee=[];const{data:ye}=Digit.Hooks.useGenderMDMS(O,"common-masters","GenderType");return ye&&ye.map(e=>{Ee.push({i18nKey:"PT_COMMON_GENDER_"+e.code,code:""+e.code,value:""+e.code})}),le?l.createElement(t.Loader,null):l.createElement("div",{className:"user-profile"},l.createElement("section",{style:{margin:"citizen"===h||ce?"8px":"24px"}},"citizen"===h||ce?l.createElement(t.BackLink,null):l.createElement(t.BreadCrumb,{crumbs:[{path:`/${null===(i=window)||void 0===i?void 0:i.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")}]})),l.createElement("div",{style:{display:"flex",flex:1,flexDirection:re<768||"citizen"===h?"column":"row",margin:"citizen"===h?"8px":"16px",gap:"citizen"===h?"":"0 24px",boxShadow:"citizen"===h?"1px 1px 4px 0px rgba(0,0,0,0.2)":"",background:"citizen"===h?"white":"",borderRadius:"citizen"===h?"4px":"",maxWidth:"citizen"===h?"960px":""}},l.createElement("section",{style:{position:"relative",display:"flex",flex:"citizen"===h?1:2.5,justifyContent:"center",alignItems:"center",maxWidth:"100%",borderRadius:"4px",boxShadow:"citizen"===h?"":"1px 1px 4px 0px rgba(0,0,0,0.2)",border:("citizen"===h?"8px":"24px")+" solid #fff",background:"#EEEEEE",padding:"citizen"===h?"8px":"16px"}},l.createElement("div",{style:{position:"relative",height:"citizen"===h?"114px":"150px",width:"citizen"===h?"114px":"150px",margin:"16px"}},l.createElement("img",{style:{margin:"auto",borderRadius:"300px",justifyContent:"center",height:"100%",width:"100%"},src:V&&""!==V?V:"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"}),l.createElement("button",{style:{position:"absolute",left:"50%",bottom:"-24px",transform:"translateX(-50%)"},onClick:()=>W(!z)},l.createElement(s.CameraIcon,null)))),l.createElement("section",{style:{display:"flex",flexDirection:"column",flex:"citizen"===h?1:7.5,width:"100%",borderRadius:"4px",height:"fit-content",boxShadow:"citizen"===h?"":"1px 1px 4px 0px rgba(0,0,0,0.2)",background:"white",padding:"citizen"===h?"8px":"24px",paddingBottom:"20px"}},"citizen"===h?l.createElement(l.Fragment,null,l.createElement(t.LabelFieldPair,null,l.createElement(t.CardLabel,{style:{}},""+b("CORE_COMMON_PROFILE_NAME"),"*"),l.createElement("div",{style:{width:"100%",maxWidth:"960px"}},l.createElement(t.TextInput,N({t:b,style:{width:"100%"},type:"text",isMandatory:!1,name:"name",value:T,onChange:e=>pe(e.target.value)},ue={isRequired:!0,pattern:"^[a-zA-Z-.`' ]*$",type:"tel",title:b("CORE_COMMON_PROFILE_NAME_ERROR_MESSAGE")},{disable:!1})),(null==ae?void 0:ae.userName)&&l.createElement(t.ErrorMessage,{message:b(null==ae||null===(u=ae.userName)||void 0===u?void 0:u.message),truncateMessage:!0,maxLength:256,className:"",wrapperClassName:"",showIcon:!0}))),l.createElement(t.LabelFieldPair,null,l.createElement(t.CardLabel,{style:{}},""+b("CORE_COMMON_PROFILE_GENDER")),l.createElement(t.Dropdown,{style:{width:"100%"},className:"form-field",selected:1===(null==A?void 0:A.length)?A[0]:A,disable:1===(null==A?void 0:A.length)||!1,option:Ee,select:de,value:A,optionKey:"code",t:b,name:"gender"})),l.createElement(t.LabelFieldPair,null,l.createElement(t.CardLabel,{style:{}},""+b("CORE_COMMON_PROFILE_EMAIL")),l.createElement("div",{style:{width:"100%"}},l.createElement(t.TextInput,{t:b,style:{width:"100%"},type:"email",isMandatory:!1,optionKey:"i18nKey",name:"email",value:R,onChange:e=>ve(e.target.value),disabled:!1}),(null==ae?void 0:ae.emailAddress)&&l.createElement(t.ErrorMessage,{message:b(null==ae||null===(d=ae.emailAddress)||void 0===d?void 0:d.message),truncateMessage:!0,maxLength:256,className:"",wrapperClassName:"",showIcon:!0}))),l.createElement("button",{onClick:fe,style:{marginTop:"24px",backgroundColor:"#F47738",width:"100%",height:"40px",color:"white",maxWidth:ce?"100%":"240px",borderBottom:"1px solid black"}},b("CORE_COMMON_SAVE"))):l.createElement(l.Fragment,null,l.createElement(t.LabelFieldPair,{style:{display:"flex"}},l.createElement(t.CardLabel,{className:"profile-label-margin",style:{width:"300px"}},""+b("CORE_COMMON_PROFILE_NAME"),"*"),l.createElement("div",{style:{width:"100%"}},l.createElement(t.TextInput,N({t:b,type:"text",isMandatory:!1,name:"name",value:T,onChange:e=>pe(e.target.value),placeholder:"Enter Your Name"},ue={isRequired:!0,pattern:"^[a-zA-Z-.`' ]*$",type:"text",title:b("CORE_COMMON_PROFILE_NAME_ERROR_MESSAGE")},{disabled:!1})),(null==ae?void 0:ae.userName)&&l.createElement(t.ErrorMessage,{message:b(null==ae||null===(m=ae.userName)||void 0===m?void 0:m.message),truncateMessage:!0,maxLength:256,className:"",wrapperClassName:"",showIcon:!0}))),l.createElement(t.LabelFieldPair,{style:{display:"flex"}},l.createElement(t.CardLabel,{className:"profile-label-margin",style:{width:"300px"}},""+b("CORE_COMMON_PROFILE_GENDER")),l.createElement("div",{style:{width:"100%"}},l.createElement(t.Dropdown,{selected:1===(null==A?void 0:A.length)?A[0]:A,disable:1===(null==A?void 0:A.length)||!1,option:Ee,select:de,value:A,optionKey:"code",t:b,name:"gender"}))),l.createElement(t.LabelFieldPair,{style:{display:"flex"}},l.createElement(t.CardLabel,{className:"profile-label-margin",style:{width:"300px"}},""+b("CORE_COMMON_PROFILE_CITY")),l.createElement("div",{style:{width:"100%"}},l.createElement(t.TextInput,N({t:b,type:"text",isMandatory:!1,name:"city",value:b(Digit.Utils.locale.getTransformedLocale("TENANT_TENANTS_"+I)),onChange:e=>k(e.target.value),placeholder:"Enter Your City Name"},ue={isRequired:!0,type:"text",title:b("CORE_COMMON_PROFILE_CITY_ERROR_MESSAGE")},{disabled:!0})),l.createElement(t.ErrorMessage,null))),l.createElement(t.LabelFieldPair,{style:{display:"flex"}},l.createElement(t.CardLabel,{className:"profile-label-margin",style:{width:"300px"}},b("CORE_COMMON_PROFILE_MOBILE_NUMBER")+"*"),l.createElement("div",{style:{width:"100%"}},l.createElement(t.MobileNumber,{value:U,style:{width:"100%"},name:"mobileNumber",placeholder:"Enter a valid Mobile No.",onChange:e=>(e=>{B(e),"employee"!==h||new RegExp(/^[6-9]{1}[0-9]{9}$/).test(e)?se({...ae,mobileNumber:null}):se({...ae,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==ae?void 0:ae.mobileNumber)&&l.createElement(t.ErrorMessage,{message:b(null==ae||null===(p=ae.mobileNumber)||void 0===p?void 0:p.message),truncateMessage:!0,maxLength:256,className:"",wrapperClassName:"",showIcon:!0}))),l.createElement(t.LabelFieldPair,{style:{display:"flex"}},l.createElement(t.CardLabel,{className:"profile-label-margin",style:{width:"300px"}},""+b("CORE_COMMON_PROFILE_EMAIL")),l.createElement("div",{style:{width:"100%"}},l.createElement(t.TextInput,{t:b,type:"email",isMandatory:!1,placeholder:b("EMAIL_VALIDATION"),optionKey:"i18nKey",name:"email",value:R,onChange:e=>ve(e.target.value),disabled:!1}),(null==ae?void 0:ae.emailAddress)&&l.createElement(t.ErrorMessage,{message:b(null==ae||null===(v=ae.emailAddress)||void 0===v?void 0:v.message),truncateMessage:!0,maxLength:256,className:"",wrapperClassName:"",showIcon:!0}))),l.createElement(t.LabelFieldPair,null,l.createElement("div",{style:{width:"100%"}},0==q?l.createElement(t.Button,{label:b("CORE_COMMON_CHANGE_PASSWORD"),variation:"teritiary",onClick:()=>X(!q),style:{paddingLeft:"0rem"}}):null,q?l.createElement("div",{style:{marginTop:"10px"}},l.createElement(t.LabelFieldPair,{style:{display:"flex"}},l.createElement(t.CardLabel,{className:"profile-label-margin",style:{width:"300px"}},""+b("CORE_COMMON_PROFILE_CURRENT_PASSWORD")),l.createElement("div",{style:{width:"100%"}},l.createElement(t.TextInput,{t:b,type:"password",isMandatory:!1,name:"name",pattern:"^([a-zA-Z0-9@#$%])+$",onChange:e=>{return Y(t=e.target.value),void(new RegExp(/^([a-zA-Z0-9@#$%]{8,15})$/i).test(t)?se({...ae,currentPassword:null}):se({...ae,currentPassword:{type:"pattern",message:"CORE_COMMON_PROFILE_PASSWORD_INVALID"}}));var t},disabled:!1}),(null==ae?void 0:ae.currentPassword)&&l.createElement(t.ErrorMessage,{message:b(null==ae||null===(g=ae.currentPassword)||void 0===g?void 0:g.message),truncateMessage:!0,maxLength:256,className:"",wrapperClassName:"",showIcon:!0}))),l.createElement(t.LabelFieldPair,{style:{display:"flex"}},l.createElement(t.CardLabel,{className:"profile-label-margin",style:{width:"300px"}},""+b("CORE_COMMON_PROFILE_NEW_PASSWORD")),l.createElement("div",{style:{width:"100%"}},l.createElement(t.TextInput,{t:b,type:"password",isMandatory:!1,name:"name",pattern:"^([a-zA-Z0-9@#$%])+$",onChange:e=>{return K(t=e.target.value),void(new RegExp(/^([a-zA-Z0-9@#$%]{8,15})$/i).test(t)?se({...ae,newPassword:null}):se({...ae,newPassword:{type:"pattern",message:"CORE_COMMON_PROFILE_PASSWORD_INVALID"}}));var t},disabled:!1}),(null==ae?void 0:ae.newPassword)&&l.createElement(t.ErrorMessage,{message:b(null==ae||null===(f=ae.newPassword)||void 0===f?void 0:f.message),truncateMessage:!0,maxLength:256,className:"",wrapperClassName:"",showIcon:!0}))),l.createElement(t.LabelFieldPair,{style:{display:"flex"}},l.createElement(t.CardLabel,{className:"profile-label-margin",style:{width:"300px"}},""+b("CORE_COMMON_PROFILE_CONFIRM_PASSWORD")),l.createElement("div",{style:{width:"100%"}},l.createElement(t.TextInput,{t:b,type:"password",isMandatory:!1,name:"name",pattern:"^([a-zA-Z0-9@#$%])+$",onChange:e=>{return ee(t=e.target.value),void(new RegExp(/^([a-zA-Z0-9@#$%]{8,15})$/i).test(t)?se({...ae,confirmPassword:null}):se({...ae,confirmPassword:{type:"pattern",message:"CORE_COMMON_PROFILE_PASSWORD_INVALID"}}));var t},disabled:!1}),(null==ae?void 0:ae.confirmPassword)&&l.createElement(t.ErrorMessage,{message:b(null==ae||null===(E=ae.confirmPassword)||void 0===E?void 0:E.message),truncateMessage:!0,maxLength:256,className:"",wrapperClassName:"",showIcon:!0})))):"")),"employee"===h&&ce?l.createElement("button",{onClick:fe,style:{marginTop:"24px",backgroundColor:"#F47738",width:"100%",height:"40px",color:"white",maxWidth:ce?"100%":"240px",borderBottom:"1px solid black",fontWeight:"700",fontSize:"17px"}},b("CORE_COMMON_SAVE")):null))),"employee"!==h||ce?null:l.createElement(t.ActionBar,{actionFields:[l.createElement(t.SubmitBar,{t:b,label:b("CORE_COMMON_SAVE"),onSubmit:fe})],className:"",setactionFieldsToRight:!0}),te&&l.createElement(t.Toast,{type:te.key,label:b("success"===te.key?"CORE_COMMON_PROFILE_UPDATE_SUCCESS":te.action),onClose:()=>ne(null),style:{maxWidth:"670px"}}),1==z?l.createElement($,{setProfilePic:function(e){try{function t(e){H(null==e?void 0:e.thumbs[0]),me()}return j(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(e=>e.url.split(",")[3]),images:e.data.fileStoreIds.map(e=>Digit.Utils.getFileUrl(e.url))}:null})}catch(e){return Promise.reject(e)}}([e],O)).then(t):t(null))}catch(e){return Promise.reject(e)}},closeDrawer:me,userType:h,removeProfilePic:()=>{j(null),H(null)},showToast:ge}):"")},q=e=>{var r,i,a;let{module:c}=e;const u=Digit.UserService.getUser(),{t:d}=((null==u||null===(r=u.info)||void 0===r?void 0:r.tenantId)||Digit.ULBService.getCurrentTenantId(),o.useTranslation()),m=Digit.SessionStorage.get("initData").stateInfo,p=Digit.StoreData.getCurrentLanguage(),[v,g]=n.useState(p),[f,E]=n.useState(!1),[y,h]=n.useState(""),C=()=>l.createElement("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},l.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"})),{isLoading:b,data:S}=Digit.Hooks.useGetHowItWorksJSON(Digit.ULBService.getStateId()),O=null==S||null===(i=S.MdmsRes["common-masters"])||void 0===i||null===(a=i.howItWorks[0])||void 0===a?void 0:a[""+c];return b?l.createElement(t.Loader,null):l.createElement(n.Fragment,null,l.createElement("div",{className:"how-it-works-page"},l.createElement(t.BackButton,null),l.createElement("div",{className:"how-it-works-page-header"},l.createElement(t.Header,null,d(O.screenHeader?O.screenHeader:"HOW_IT_WORKS"))),l.createElement("div",{className:"language-selector",style:{margin:"10px"}},[{label:"ENGLISH",value:"en_IN"},{label:"हिंदी",value:"hi_IN"}].map((e,t)=>l.createElement("div",{className:"language-button-container",key:t},l.createElement(s.CustomButton,{selected:e.value===v,text:e.label,onClick:()=>(e=>{g(e.value),Digit.LocalizationService.changeLanguage(e.value,m.code)})(e)})))),O.videosJson.map((e,t)=>l.createElement("div",null,l.createElement("div",{className:"WhatsNewCard",style:{float:"left",position:"relative",width:"100%",marginBottom:10}},l.createElement("div",{className:"video-icon",onClick:()=>{return t=e,h("hi_IN"===v?t.hi_IN:t.en_IN),void E(!0);var t}},l.createElement("div",{className:"vid-svg"},l.createElement(C,null))),l.createElement("div",{className:"how-it-works-header-description"},l.createElement("h2",null,d(e.headerLabel)),l.createElement("p",null,d(e.description)))))),O.pdfHeader&&O.pdfDesc&&l.createElement("div",{className:"WhatsNewCard",style:{position:"relative",width:"100%",marginBottom:10,display:"inline-block"}},l.createElement("div",{className:"how-it-works-pdf-section"},l.createElement("div",{className:"pdf-icon-header-desc"},l.createElement("div",{className:"pdf-icon"},l.createElement(t.PDFSvg,null)),l.createElement("div",{className:"pdf-header-desc"},l.createElement("h2",null,d(O.pdfHeader)),l.createElement("p",null,d(O.pdfDesc)))),l.createElement("div",{className:"download-icon"},l.createElement(t.DownloadImgIcon,null)))),f&&l.createElement("div",{className:"how-it-works-video-play"},l.createElement("div",{className:"close-button"},l.createElement(t.CloseSvg,{onClick:()=>{E(!1)}})),l.createElement("video",{width:500,height:500,controls:!0,autoPlay:!0},l.createElement("source",{src:y,type:"video/mp4"})))))},X=[{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}}]}],Z=e=>{let{t:n,onSelect:o,mobileNumber:r,onMobileChange:i,config:a,canSubmit:s}=e;return l.createElement(t.FormStep,{isDisabled:!(10===r.length&&s),onSelect:o,config:a,t:n,componentInFront:"+91",onChange:i,value:r})},Y=e=>{let{config:n,onSelect:o,t:r,isDisabled:i}=e;return l.createElement(t.FormStep,{config:n,onSelect:o,t:r,isDisabled:i})};function J(e,t){const l=n.useRef();n.useEffect(()=>{l.current=e},[e]),n.useEffect(()=>{if(null!==t){const e=setInterval(function(){l.current()},t);return()=>clearInterval(e)}},[t])}const K=e=>{let{config:o,otp:r,onOtpChange:i,onResend:a,onSelect:s,t:c,error:u,userType:d="citizen",canSubmit:m}=e;const[p,v]=n.useState(30);J(()=>{v(p-1)},p>0?1e3:null);const g=()=>{a(),v(2)};return"employee"===d?l.createElement(n.Fragment,null,l.createElement(t.OTPInput,{length:6,onChange:i,value:r}),p>0?l.createElement(t.CardText,null,`${c("CS_RESEND_ANOTHER_OTP")} ${p} ${c("CS_RESEND_SECONDS")}`):l.createElement("p",{className:"card-text-button resend-otp",onClick:g},c("CS_RESEND_OTP")),!u&&l.createElement(t.CardLabelError,null,c("CS_INVALID_OTP"))):l.createElement(t.FormStep,{onSelect:s,config:o,t:c,isDisabled:!(6===(null==r?void 0:r.length)&&m)},l.createElement(t.OTPInput,{length:6,onChange:i,value:r}),p>0?l.createElement(t.CardText,null,`${c("CS_RESEND_ANOTHER_OTP")} ${p} ${c("CS_RESEND_SECONDS")}`):l.createElement("p",{className:"card-text-button",onClick:g},c("CS_RESEND_OTP")),!u&&l.createElement(t.CardLabelError,null,c("CS_INVALID_OTP")))};var Q;const ee={type:"register"},te={type:"login"},ne=`/${null===(Q=window)||void 0===Q?void 0:Q.contextPath}/citizen`,le=(e,t)=>(null==e?void 0:e.from)||(null==t?void 0:t.from)||ne,oe=e=>{var r,i;let{stateCode:s,isUserRegistered:c=!0}=e;const{t:u}=o.useTranslation(),d=a.useLocation(),{path:m}=a.useRouteMatch(),p=a.useHistory(),[v,g]=n.useState(null),[f,E]=n.useState(null),[y,h]=n.useState(!0),[C,b]=n.useState(null),[S,O]=n.useState(c?{}:null==d||null===(r=d.state)||void 0===r?void 0:r.data),[N,I]=n.useState(null),w=Digit.Hooks.useQueryParams(),[_,D]=n.useState(!1),[T,L]=n.useState(!0),[R,P]=n.useState(!0);n.useEffect(()=>{let e;return f&&(N&&(clearTimeout(N),I(null)),e=setTimeout(()=>{E("")},5e3),I(e)),()=>{e&&clearTimeout(e)}},[f]),n.useEffect(()=>{var e;if(!v)return;Digit.SessionStorage.set("citizen.userRequestObject",v),Digit.UserService.setUser(v),((e,t,n)=>{var l,o;let r=null===(l=JSON.parse(sessionStorage.getItem("Digit.initData")))||void 0===l||null===(o=l.value)||void 0===o?void 0:o.selectedLanguage;localStorage.setItem("Citizen.tenant-id",n),localStorage.setItem("tenant-id",n),localStorage.setItem("citizen.userRequestObject",JSON.stringify(e)),localStorage.setItem("locale",r),localStorage.setItem("Citizen.locale",r),localStorage.setItem("token",t),localStorage.setItem("Citizen.token",t),localStorage.setItem("user-info",JSON.stringify(e)),localStorage.setItem("Citizen.user-info",JSON.stringify(e))})(null==v?void 0:v.info,null==v?void 0:v.access_token,s);const t=(null===(e=d.state)||void 0===e?void 0:e.from)||ne;var n;Digit.ULBService.getCitizenCurrentTenant(!0)?p.replace(t):p.replace(`/${null===(n=window)||void 0===n?void 0:n.contextPath}/citizen/select-location`,{redirectBackTo:t})},[v]);const A=n.useMemo(()=>X.map(e=>{const t={};for(const n in e.texts)t[n]=u(e.texts[n]);return{...e,texts:t}},[X])),x=()=>Digit.UserService.getType(),M=function(e){return Promise.resolve(G(function(){return Promise.resolve(Digit.UserService.sendOtp(e,s)).then(function(e){return[e,null]})},function(e){return[null,e]}))};return l.createElement("div",{className:"citizen-form-wrapper"},l.createElement(a.Switch,null,l.createElement(t.AppContainer,null,l.createElement(t.BackButton,null),l.createElement(a.Route,{path:""+m,exact:!0},l.createElement(Z,{onSelect:function(e){try{P(!1),O({...S,...e});const t={...e,tenantId:s,userType:x()};return Promise.resolve(c?Promise.resolve(M({otp:{...t,...te}})).then(function(e){var n;let[l,o]=e;var r,i,a;if(!o)return P(!0),void p.replace(m+"/otp",{from:le(d.state,w),role:null===(r=d.state)||void 0===r?void 0:r.role});P(!0),d.state&&"FSM_DSO"===d.state.role||p.push(`/${null===(i=window)||void 0===i?void 0:i.contextPath}/citizen/register/name`,{from:le(d.state,w),data:t}),null!==(n=d.state)&&void 0!==n&&n.role&&(P(!0),E("FSM_DSO"===(null===(a=d.state)||void 0===a?void 0:a.role)?u("ES_ERROR_DSO_LOGIN"):"User not registered."))}):Promise.resolve(M({otp:{...t,...ee}})).then(function(e){let[t,n]=e;if(!n)return P(!0),void p.replace(m+"/otp",{from:le(d.state,w)});P(!0)}))}catch(e){return Promise.reject(e)}},config:A[0],mobileNumber:S.mobileNumber||"",onMobileChange:e=>{const{value:t}=e.target;O({...S,mobileNumber:t})},canSubmit:R,showRegisterLink:c&&!(null!==(i=d.state)&&void 0!==i&&i.role),t:u})),l.createElement(a.Route,{path:m+"/otp"},l.createElement(K,{config:{...A[1],texts:{...A[1].texts,cardText:`${A[1].texts.cardText} ${S.mobileNumber||""}`}},onOtpChange:e=>{O({...S,otp:e})},onResend:function(){try{const{mobileNumber:e}=S,t={mobileNumber:e,tenantId:s,userType:x()},n=function(){if(!c)return Promise.resolve(M({otp:{...t,...ee}})).then(function(){});{const e=function(){if(c)return Promise.resolve(M({otp:{...t,...te}})).then(function(){})}();if(e&&e.then)return e.then(function(){})}}();return Promise.resolve(n&&n.then?n.then(function(){}):void 0)}catch(e){return Promise.reject(e)}},onSelect:function(){try{return Promise.resolve(G(function(){h(!0),L(!1);const{mobileNumber:e,otp:t,name:n}=S;return function(){if(c){const n={username:e,password:t,tenantId:s,userType:x()};return Promise.resolve(Digit.UserService.authenticate(n)).then(function(e){var t,n,l;let{UserRequest:o,...r}=e;if(null!==(t=d.state)&&void 0!==t&&t.role){const e=o.roles.find(e=>e.code===d.state.role);if(!e||!e.code)return E(u("ES_ERROR_USER_NOT_PERMITTED")),void setTimeout(()=>p.replace(ne),5e3)}null!==(n=window)&&void 0!==n&&null!==(l=n.globalConfigs)&&void 0!==l&&l.getConfig("ENABLE_SINGLEINSTANCE")&&(o.tenantId=Digit.ULBService.getStateId()),g({info:o,...r})})}{const l=function(){if(!c)return Promise.resolve(Digit.UserService.registerUser({name:n,username:e,otpReference:t,tenantId:s},s)).then(function(e){var t,n;let{UserRequest:l,...o}=e;null!==(t=window)&&void 0!==t&&null!==(n=t.globalConfigs)&&void 0!==n&&n.getConfig("ENABLE_SINGLEINSTANCE")&&(l.tenantId=Digit.ULBService.getStateId()),g({info:l,...o})})}();if(l&&l.then)return l.then(function(){})}}()},function(){L(!0),h(!1)}))}catch(e){return Promise.reject(e)}},otp:S.otp,error:y,canSubmit:T,t:u})),l.createElement(a.Route,{path:m+"/name"},l.createElement(Y,{config:A[2],onSelect:function(e){try{const t={...S,tenantId:s,userType:x(),...e};return O({...S,...e}),D(!0),Promise.resolve(M({otp:{...t,...ee}})).then(function(e){let[t,n]=e;t?(D(!1),p.replace(m+"/otp",{from:le(d.state,w)})):D(!1)})}catch(e){return Promise.reject(e)}},t:u,isDisabled:_})),f&&l.createElement(t.Toast,{type:"error",label:f,onClose:()=>E(null)}))))};var re=e=>e instanceof HTMLElement;const ie={onBlur:"onBlur",onChange:"onChange",onSubmit:"onSubmit",onTouched:"onTouched",all:"all"};var ae=e=>null==e;const se=e=>"object"==typeof e;var ce=e=>!ae(e)&&!Array.isArray(e)&&se(e)&&!(e instanceof Date),ue=e=>/^\w*$/.test(e),de=e=>e.filter(Boolean),me=e=>de(e.replace(/["|']/g,"").replace(/\[/g,".").replace(/\]/g,"").split("."));function pe(e,t,n){let l=-1;const o=ue(t)?[t]:me(t),r=o.length,i=r-1;for(;++l<r;){const t=o[l];let r=n;if(l!==i){const n=e[t];r=ce(n)||Array.isArray(n)?n:isNaN(+o[l+1])?{}:[]}e[t]=r,e=e[t]}return e}var ve=function(e,t){void 0===t&&(t={});for(const n in e)ue(n)?t[n]=e[n]:pe(t,n,e[n]);return t},ge=e=>void 0===e,fe=function(e,t,n){void 0===e&&(e={});const l=de(t.split(/[,[\].]+?/)).reduce((e,t)=>ae(e)?e:e[t],e);return ge(l)||l===e?ge(e[t])?n:e[t]:l},Ee=(e,t)=>{re(e)&&e.removeEventListener&&(e.removeEventListener("input",t),e.removeEventListener("change",t),e.removeEventListener("blur",t))};const ye={isValid:!1,value:null};var he=e=>Array.isArray(e)?e.reduce((e,t)=>t&&t.ref.checked?{isValid:!0,value:t.ref.value}:e,ye):ye,Ce=e=>"radio"===e.type,be=e=>"file"===e.type,Se=e=>"checkbox"===e.type,Oe=e=>"select-multiple"===e.type;const Ne={value:!1,isValid:!1},Ie={value:!0,isValid:!0};var we=e=>{if(Array.isArray(e)){if(e.length>1){const t=e.filter(e=>e&&e.ref.checked).map(e=>{let{ref:{value:t}}=e;return t});return{value:t,isValid:!!t.length}}const{checked:t,value:n,attributes:l}=e[0].ref;return t?l&&!ge(l.value)?ge(n)||""===n?Ie:{value:n,isValid:!0}:Ie:Ne}return Ne};function _e(e,t,n,l,o){const r=e.current[t];if(r){const{ref:{value:e,disabled:t},ref:n,valueAsNumber:a,valueAsDate:s,setValueAs:c}=r;if(t&&l)return;return be(n)?n.files:Ce(n)?he(r.options).value:Oe(n)?(i=n.options,[...i].filter(e=>{let{selected:t}=e;return t}).map(e=>{let{value:t}=e;return t})):Se(n)?we(r.options).value:o?e:a?""===e?NaN:+e:s?n.valueAsDate:c?c(e):e}var i;if(n)return fe(n.current,t)}function De(e){return!e||e instanceof HTMLElement&&e.nodeType!==Node.DOCUMENT_NODE&&De(e.parentNode)}var Te=e=>ce(e)&&!Object.keys(e).length,Le=e=>"boolean"==typeof e;function Re(e,t){const n=ue(t)?[t]:me(t),l=1==n.length?e:function(e,t){const n=t.slice(0,-1).length;let l=0;for(;l<n;)e=ge(e)?l++:e[t[l++]];return e}(e,n);let o;l&&delete l[n[n.length-1]];for(let t=0;t<n.slice(0,-1).length;t++){let l,r=-1;const i=n.slice(0,-(t+1)),a=i.length-1;for(t>0&&(o=e);++r<i.length;){const t=i[r];l=l?l[t]:e[t],a===r&&(ce(l)&&Te(l)||Array.isArray(l)&&!l.filter(e=>ce(e)&&!Te(e)||Le(e)).length)&&(o?delete o[t]:delete e[t]),o=l}}return e}const Pe=(e,t)=>e&&e.ref===t;var Ae=e=>ae(e)||!se(e);function xe(e,t){if(Ae(e)||Ae(t))return t;for(const n in t){const l=e[n],o=t[n];try{e[n]=ce(l)&&ce(o)||Array.isArray(l)&&Array.isArray(o)?xe(l,o):o}catch(e){}}return e}function Me(e,t,l){if(Ae(e)||Ae(t)||e instanceof Date||t instanceof Date)return e===t;if(!n.isValidElement(e)){const n=Object.keys(e),o=Object.keys(t);if(n.length!==o.length)return!1;for(const o of n){const n=e[o];if(!l||"ref"!==o){const e=t[o];if((ce(n)||Array.isArray(n))&&(ce(e)||Array.isArray(e))?!Me(n,e,l):n!==e)return!1}}}return!0}function ke(e,t,n,l,o){let r=-1;for(;++r<e.length;){for(const l in e[r])Array.isArray(e[r][l])?(!n[r]&&(n[r]={}),n[r][l]=[],ke(e[r][l],fe(t[r]||{},l,[]),n[r][l],n[r],l)):Me(fe(t[r]||{},l),e[r][l])?pe(n[r]||{},l):n[r]=Object.assign(Object.assign({},n[r]),{[l]:!0});l&&!n.length&&delete l[o]}return n}var Ue=e=>"string"==typeof e,Be=(e,t,n,l,o)=>{const r={};for(const t in e.current)(ge(o)||(Ue(o)?t.startsWith(o):Array.isArray(o)&&o.find(e=>t.startsWith(e))))&&(r[t]=_e(e,t,void 0,l));return n?ve(r):xe(t,ve(r))},Fe=e=>e instanceof RegExp,je=e=>ce(e)&&!Fe(e)?e:{value:e,message:""},Ve=e=>"function"==typeof e,He=e=>Ue(e)||n.isValidElement(e);function ze(e,t,n){if(void 0===n&&(n="validate"),He(e)||Le(e)&&!e)return{type:n,message:He(e)?e:"",ref:t}}var Ge=(e,t,n,l,o)=>t?Object.assign(Object.assign({},n[e]),{types:Object.assign(Object.assign({},n[e]&&n[e].types?n[e].types:{}),{[l]:o||!0})}):{},$e=function(e,t,n,l){let{ref:o,ref:{value:r},options:i,required:a,maxLength:s,minLength:c,min:u,max:d,pattern:m,validate:p}=n;try{let n=!1;const v=o.name,g={},f=Ce(o),E=Se(o),y=f||E,h=""===r,C=Ge.bind(null,v,t,g),b=function(e,t,n,l,r){void 0===l&&(l="maxLength"),void 0===r&&(r="minLength");const i=e?t:n;g[v]=Object.assign({type:e?l:r,message:i,ref:o},C(e?l:r,i))};if(a&&(!f&&!E&&(h||ae(r))||Le(r)&&!r||E&&!we(i).isValid||f&&!he(i).isValid)){const{value:n,message:l}=He(a)?{value:!!a,message:a}:je(a);if(n&&(g[v]=Object.assign({type:"required",message:l,ref:y?((e.current[v].options||[])[0]||{}).ref:o},C("required",l)),!t))return Promise.resolve(g)}if(!(ae(u)&&ae(d)||""===r)){let e,n;const l=je(d),i=je(u);if(isNaN(r)){const t=o.valueAsDate||new Date(r);Ue(l.value)&&(e=t>new Date(l.value)),Ue(i.value)&&(n=t<new Date(i.value))}else{const t=o.valueAsNumber||parseFloat(r);ae(l.value)||(e=t>l.value),ae(i.value)||(n=t<i.value)}if((e||n)&&(b(!!e,l.message,i.message,"max","min"),!t))return Promise.resolve(g)}if(Ue(r)&&!h&&(s||c)){const e=je(s),n=je(c),l=!ae(e.value)&&r.length>e.value,o=!ae(n.value)&&r.length<n.value;if((l||o)&&(b(l,e.message,n.message),!t))return Promise.resolve(g)}if(Ue(r)&&m&&!h){const{value:e,message:n}=je(m);if(Fe(e)&&!e.test(r)&&(g[v]=Object.assign({type:"pattern",message:n,ref:o},C("pattern",n)),!t))return Promise.resolve(g)}const S=function(){if(p){const r=_e(e,v,l,!1,!0),a=y&&i?i[0].ref:o;return Ve(p)?Promise.resolve(p(r)).then(function(e){const l=ze(e,a);if(l&&(g[v]=Object.assign(Object.assign({},l),C("validate",l.message)),!t))return n=!0,g}):function(){if(ce(p)){let l=!1;function e(){if(!Te(o)&&(g[v]=Object.assign({ref:a},o),!t))return n=!0,g}let o={};const i=z(Object.entries(p),function(e){let[n,i]=e;if(Te(o)||t)return Promise.resolve(i(r)).then(function(e){const l=ze(e,a,n);l&&(o=Object.assign(Object.assign({},l),C(n,l.message)),t&&(g[v]=o))});l=!0},function(){return l});return i&&i.then?i.then(e):e()}}()}}();return Promise.resolve(S&&S.then?S.then(function(e){return n?e:g}):n?S:g)}catch(e){return Promise.reject(e)}};const We=function(e,t,n){void 0===n&&(n=[]);for(const l in t){const o=e+(ce(t)?"."+l:`[${l}]`);Ae(t[l])?n.push(o):We(o,t[l],n)}return n};var qe=(e,t,n,l,o)=>{let r=void 0;return n.add(t),Te(e)||(r=fe(e,t),(ce(r)||Array.isArray(r))&&We(t,r).forEach(e=>n.add(e))),ge(r)?o?l:fe(l,t):r},Xe=e=>{let{isOnBlur:t,isOnChange:n,isOnTouch:l,isTouched:o,isReValidateOnBlur:r,isReValidateOnChange:i,isBlurEvent:a,isSubmitted:s,isOnAll:c}=e;return!c&&(!s&&l?!(o||a):(s?r:t)?!a:!(s?i:n)||a)},Ze=e=>e.substring(0,e.indexOf("[")),Ye=(e,t)=>[...e].some(e=>((e,t)=>RegExp(`^${t}([|.)\\d+`.replace(/\[/g,"\\[").replace(/\]/g,"\\]")).test(e))(t,e)),Je="undefined"!=typeof window&&"undefined"!=typeof document;function Ke(e){var t;let n;if(Ae(e)||Je&&(e instanceof File||re(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 n=new Date(e.getTime()),n;if(e instanceof Set){n=new Set;for(const t of e)n.add(t);return n}if(e instanceof Map){n=new Map;for(const t of e.keys())n.set(t,Ke(e.get(t)));return n}n=Array.isArray(e)?[]:{};for(const t in e)n[t]=Ke(e[t]);return n}var Qe=e=>({isOnSubmit:!e||e===ie.onSubmit,isOnBlur:e===ie.onBlur,isOnChange:e===ie.onChange,isOnAll:e===ie.all,isOnTouch:e===ie.onTouched}),et=e=>Ce(e)||Se(e);const tt="undefined"==typeof window,nt=Je?"Proxy"in window:"undefined"!=typeof Proxy,lt=n.createContext(null);lt.displayName="RHFContext";const ot=e=>{const{as:t,render:l}=e,o=function(e,t){var n={};for(var l in e)Object.prototype.hasOwnProperty.call(e,l)&&t.indexOf(l)<0&&(n[l]=e[l]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(l=Object.getOwnPropertySymbols(e);o<l.length;o++)t.indexOf(l[o])<0&&Object.prototype.propertyIsEnumerable.call(e,l[o])&&(n[l[o]]=e[l[o]])}return n}(e,["rules","as","render","defaultValue","control","onFocus"]),{field:r,meta:i}=function(e){let{name:t,rules:l,defaultValue:o,control:r,onFocus:i}=e;const a=n.useContext(lt);if("production"!==process.env.NODE_ENV&&!r&&!a)throw new Error("📋 Controller is missing `control` prop. https://react-hook-form.com/api#Controller");const{defaultValuesRef:s,setValue:c,register:u,unregister:d,trigger:m,mode:p,reValidateMode:{isReValidateOnBlur:v,isReValidateOnChange:g},formState:f,formStateRef:{current:{isSubmitted:E,touched:y,errors:h}},updateFormState:C,readFormStateRef:b,fieldsRef:S,fieldArrayNamesRef:O,shallowFieldsStateRef:N}=r||a.control,I=!Ye(O.current,t),w=()=>!ge(fe(N.current,t))&&I?fe(N.current,t):ge(o)?fe(s.current,t):o,[_,D]=n.useState(w()),T=n.useRef(_),L=n.useRef({focus:()=>null}),R=n.useRef(i||(()=>{Ve(L.current.focus)&&L.current.focus(),"production"!==process.env.NODE_ENV&&(Ve(L.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"))})),P=n.useCallback(e=>!Xe(Object.assign({isBlurEvent:e,isReValidateOnBlur:v,isReValidateOnChange:g,isSubmitted:E,isTouched:!!fe(y,t)},p)),[v,g,E,y,t,p]),A=n.useCallback(e=>{let[t]=e;const n=(e=>Ae(e)||!ce(e.target)||ce(e.target)&&!e.type?e:ge(e.target.value)?e.target.checked:e.target.value)(t);return D(n),T.current=n,n},[]),x=n.useCallback(e=>{if("production"!==process.env.NODE_ENV&&!t)return console.warn("📋 Field is missing `name` prop. https://react-hook-form.com/api#Controller");S.current[t]?S.current[t]=Object.assign({ref:S.current[t].ref},l):(u(Object.defineProperties({name:t,focus:R.current},{value:{set(e){D(e),T.current=e},get:()=>T.current}}),l),e=ge(fe(s.current,t))),e&&I&&D(w())},[l,t,u]);n.useEffect(()=>()=>d(t),[t]),n.useEffect(()=>{"production"!==process.env.NODE_ENV&&(ge(_)&&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)`),!I&&ge(o)&&console.warn("📋 Controller is missing `defaultValue` prop when using `useFieldArray`. https://react-hook-form.com/api#Controller")),x()},[x]),n.useEffect(()=>{!S.current[t]&&x(!0)});const M=n.useCallback(()=>{b.current.touched&&!fe(y,t)&&(pe(y,t,!0),C({touched:y})),P(!0)&&m(t)},[t,C,P,m,b]);return{field:{onChange:n.useCallback(function(){for(var e=arguments.length,n=new Array(e),l=0;l<e;l++)n[l]=arguments[l];return c(t,A(n),{shouldValidate:P(),shouldDirty:!0})},[c,t,P]),onBlur:M,name:t,value:_,ref:L},meta:Object.defineProperties({invalid:!!fe(h,t)},{isDirty:{get:()=>!!fe(f.dirtyFields,t)},isTouched:{get:()=>!!fe(f.touched,t)}})}}(e),a=Object.assign(Object.assign({},o),r);return t?n.isValidElement(t)?n.cloneElement(t,a):n.createElement(t,a):l?l(r,i):null},rt=e=>{let{control:n,t:o}=e;const r=window.Digit.Utils.browser.isMobile();return l.createElement(Fragment,null,l.createElement(t.SearchField,{className:"pt-form-field"},l.createElement("label",null,o("AUDIT_FROM_DATE_LABEL")),l.createElement(ot,{render:e=>l.createElement(t.DatePicker,{date:e.value,onChange:e.onChange}),name:"fromDate",control:n})),l.createElement(t.SearchField,{className:"pt-form-field"},l.createElement("label",null,o("AUDIT_TO_DATE_LABEL")),l.createElement(ot,{render:e=>l.createElement(t.DatePicker,{date:e.value,onChange:e.onChange}),name:"toDate",control:n})),l.createElement(t.SearchField,{className:"pt-search-action-submit"},l.createElement(t.Button,{style:{marginTop:r?"510px":"25px",marginLeft:r?"0":"-30px",maxWidth:r?"100%":"240px"},label:o("ES_COMMON_APPLY"),submit:!0})))},it=e=>{var o;let{Controller:r,register:i,control:a,t:s,reset:c,previousPage:u,handleSubmit:d,tenantId:m,data:p,onSubmit:v,isLoading:g}=e;const[f,E]=n.useState([]),y=e=>l.createElement("div",{onClick:e.onClick},l.createElement(t.DownloadBtnCommon,null));n.useEffect(()=>{(null==p?void 0:p.length)>0&&E([null==p?void 0:p.map(e=>{let t={};return t[s("AUDIT_DATE_LABEL")]=h(null==e?void 0:e.timestamp),t[s("AUDIT_TIME_LABEL")]=C(null==e?void 0:e.timestamp),t[s("AUDIT_DATAVIEWED_LABEL")]=(null==e?void 0:e.dataView[0])+","+(null==e?void 0:e.dataView[1]),t[s("AUDIT_DATAVIEWED_BY_LABEL")]=null==e?void 0:e.dataViewedBy,t[s("AUDIT_ROLE_LABEL")]=null==e?void 0:e.roles.map(e=>e.name).join(","),{...t}})])},[p]);const h=e=>{if(null==e||null==e||""==e)return"NA";const t=new Date(e);let n=t.getMonth()+1,l=t.getDate();return n=(n>9?"":"0")+n,l=(l>9?"":"0")+l,`${l}/${n}/${t.getFullYear()}`},C=e=>{if(null==e||null==e||""==e)return"NA";const t=new Date(e);let n=t.getHours(),l=t.getMinutes(),o=n>12?"PM":"AM";return n=n>12?n-12:n,n=(n>9?"":"0")+n,l=(l>9?"":"0")+l,`${n}:${l} ${o}`},[b,S]=n.useReducer(function(e,t){switch(t.type){case"set":return t.payload;case"remove":return!1}},!1),O=()=>{S({type:"remove"})},I=()=>l.createElement("div",{className:"InboxMobilePopupCloseButtonWrapper",onClick:O},l.createElement(t.CloseSvg,null)),w={Controller:r,register:i,control:a,t:s,reset:c,previousPage:u},_=n.useCallback(e=>{let{currentlyActiveMobileModal:n,searchFormFieldsComponentProps:o,tenantId:r,...i}=e;return(e=>{let{currentlyActiveMobileModal:n,searchFormFieldsComponentProps:o,tenantId:r,...i}=e;const{closeMobilePopupModal:a}=i;switch(n){case"SearchFormComponent":return l.createElement(t.SearchForm,i,l.createElement(I,null),l.createElement("div",{className:"MobilePopupHeadingWrapper"},l.createElement("h2",null,s("PRIVACY_AUDIT_REPORT"),":")),l.createElement(rt,N({},o,{closeMobilePopupModal:a,tenantId:r,t:s})));default:return l.createElement("span",null)}})({currentlyActiveMobileModal:n,searchFormFieldsComponentProps:o,tenantId:r,...i})},[b]);null==p||null===(o=p.roles)||void 0===o||o.forEach(e=>{});const D=n.useMemo(()=>null!=p&&p.display||""===p?[]:null==p?void 0:p.map(e=>{var t;return{[s("AUDIT_DATE_LABEL")]:h(e.timestamp),[s("AUDIT_TIME_LABEL")]:C(e.timestamp),[s("AUDIT_DATAVIEWED_LABEL")]:e.dataView[0]+","+e.dataView[1],[s("AUDIT_DATAVIEWED_BY_LABEL")]:e.dataViewedBy,[s("AUDIT_ROLE_LABEL")]:null===(t=e.roles.slice(0,3))||void 0===t?void 0:t.map(e=>e.name).join(",")}}),[p]);return l.createElement(l.Fragment,null,l.createElement(t.BackButton,null),l.createElement("div",{className:"sideContent",style:{marginLeft:"70%",marginTop:"-12%"}},l.createElement(y,{className:"mrlg cursorPointer",onClick:()=>(e=>{if(void 0!==(null==e?void 0:e[0]))return Digit.Download.Excel(null==e?void 0:e[0],"AuditReport")})(f)})),l.createElement(t.Header,null,s("PRIVACY_AUDIT_REPORT"),":"),l.createElement("div",{className:"digit-search-box"},l.createElement(t.SearchAction,{text:s("ES_COMMON_SEARCH"),handleActionClick:()=>S({type:"set",payload:"SearchFormComponent"}),tenantId:m,t:s})),b?l.createElement(t.PopUp,null,l.createElement(_,{onSubmit:e=>{S({type:"remove"}),v(e)},handleSubmit:d,id:"search-form",className:"rm-mb form-field-flex-one inboxPopupMobileWrapper",searchFormFieldsComponentProps:w,currentlyActiveMobileModal:b,closeMobilePopupModal:O,tenantId:m})):null,g&&l.createElement(t.Loader,null),l.createElement(t.DetailsCard,{data:D}))},at=e=>{let{tenantId:o,t:r,onSubmit:i,data:a,count:c}=e;const u=Digit.SessionStorage.get("AUDIT_APPLICATION_DETAIL")||{offset:0,limit:5,sortOrder:"DESC"},{register:d,control:m,handleSubmit:p,setValue:v,getValues:g,reset:f}=function(e){let{mode:t=ie.onSubmit,reValidateMode:l=ie.onChange,resolver:o,context:r,defaultValues:i={},shouldFocusError:a=!0,shouldUnregister:s=!0,criteriaMode:c}=void 0===e?{}:e;const u=n.useRef({}),d=n.useRef({}),m=n.useRef({}),p=n.useRef(new Set),v=n.useRef({}),g=n.useRef({}),f=n.useRef({}),E=n.useRef({}),y=n.useRef(i),h=n.useRef(!1),C=n.useRef(!1),b=n.useRef(),S=n.useRef({}),O=n.useRef({}),N=n.useRef(r),I=n.useRef(o),w=n.useRef(new Set),_=n.useRef(Qe(t)),{isOnSubmit:D,isOnTouch:T}=_.current,L=c===ie.all,[R,P]=n.useState({isDirty:!1,isValidating:!1,dirtyFields:{},isSubmitted:!1,submitCount:0,touched:{},isSubmitting:!1,isSubmitSuccessful:!1,isValid:!D,errors:{}}),A=n.useRef({isDirty:!nt,dirtyFields:!nt,touched:!nt||T,isValidating:!nt,isSubmitting:!nt,isValid:!nt}),x=n.useRef(R),M=n.useRef(),{isOnBlur:k,isOnChange:U}=n.useRef(Qe(l)).current;N.current=r,I.current=o,x.current=R,S.current=s?{}:Te(S.current)?Ke(i):S.current;const B=n.useCallback(function(e){void 0===e&&(e={}),h.current||(x.current=Object.assign(Object.assign({},x.current),e),P(x.current))},[]),F=()=>A.current.isValidating&&B({isValidating:!0}),j=n.useCallback(function(e,t,n,l,o){void 0===n&&(n=!1),void 0===l&&(l={});let r=n||(e=>{let{errors:t,name:n,error:l,validFields:o,fieldsWithValidation:r}=e;const i=ge(l),a=fe(t,n);return i&&!!a||!i&&!Me(a,l,!0)||i&&fe(r,n)&&!fe(o,n)})({errors:x.current.errors,error:t,name:e,validFields:E.current,fieldsWithValidation:f.current});const i=fe(x.current.errors,e);t?(Re(E.current,e),r=r||!i||!Me(i,t,!0),pe(x.current.errors,e,t)):((fe(f.current,e)||I.current)&&(pe(E.current,e,!0),r=r||i),Re(x.current.errors,e)),(r&&!ae(n)||!Te(l)||A.current.isValidating)&&B(Object.assign(Object.assign(Object.assign({},l),I.current?{isValid:!!o}:{}),{isValidating:!1}))},[]),V=n.useCallback((e,t)=>{const{ref:n,options:l}=u.current[e],o=Je&&re(n)&&ae(t)?"":t;Ce(n)?(l||[]).forEach(e=>{let{ref:t}=e;return t.checked=t.value===o}):be(n)&&!Ue(o)?n.files=o:Oe(n)?[...n.options].forEach(e=>e.selected=o.includes(e.value)):Se(n)&&l?l.length>1?l.forEach(e=>{let{ref:t}=e;return t.checked=Array.isArray(o)?!!o.find(e=>e===t.value):o===t.value}):l[0].ref.checked=!!o:n.value=o},[]),H=n.useCallback((e,t)=>{if(A.current.isDirty){const n=Q();return e&&t&&pe(n,e,t),!Me(n,y.current)}return!1},[]),G=n.useCallback(function(e,t){if(void 0===t&&(t=!0),A.current.isDirty||A.current.dirtyFields){const n=!Me(fe(y.current,e),_e(u,e,S)),l=fe(x.current.dirtyFields,e),o=x.current.isDirty;n?pe(x.current.dirtyFields,e,!0):Re(x.current.dirtyFields,e);const r={isDirty:H(),dirtyFields:x.current.dirtyFields},i=A.current.isDirty&&o!==r.isDirty||A.current.dirtyFields&&l!==fe(x.current.dirtyFields,e);return i&&t&&B(r),i?r:{}}return{}},[]),$=n.useCallback(function(e,t){try{return"production"===process.env.NODE_ENV||u.current[e]?Promise.resolve($e(u,L,u.current[e],S)).then(function(n){const l=n[e];return j(e,l,t),ge(l)}):(console.warn("📋 Field is missing with `name` attribute: ",e),Promise.resolve(!1))}catch(e){return Promise.reject(e)}},[j,L]),W=n.useCallback(function(e){try{return Promise.resolve(I.current(Q(),N.current,L)).then(function(t){let{errors:n}=t;const l=x.current.isValid;if(Array.isArray(e)){const t=e.map(e=>{const t=fe(n,e);return t?pe(x.current.errors,e,t):Re(x.current.errors,e),!t}).every(Boolean);return B({isValid:Te(n),isValidating:!1}),t}{const t=fe(n,e);return j(e,t,l!==Te(n),{},Te(n)),!t}})}catch(e){return Promise.reject(e)}},[j,L]),q=n.useCallback(function(e){try{let n=!1;function t(e){return n?e:Promise.resolve($(l))}const l=e||Object.keys(u.current);if(F(),I.current)return Promise.resolve(W(l));const o=function(){if(Array.isArray(l))return!e&&(x.current.errors={}),Promise.resolve(Promise.all(l.map(function(e){try{return Promise.resolve($(e,null))}catch(e){return Promise.reject(e)}}))).then(function(e){B({isValidating:!1});const t=e.every(Boolean);return n=!0,t})}();return Promise.resolve(o&&o.then?o.then(t):t(o))}catch(e){return Promise.reject(e)}},[W,$]),X=n.useCallback((e,t,n)=>{let{shouldDirty:l,shouldValidate:o}=n;const r={};pe(r,e,t);for(const n of We(e,t))u.current[n]&&(V(n,fe(r,n)),l&&G(n),o&&q(n))},[q,V,G]),Z=n.useCallback((e,t,n)=>{if(!s&&!Ae(t)&&pe(S.current,e,Array.isArray(t)?[...t]:Object.assign({},t)),u.current[e])V(e,t),n.shouldDirty&&G(e),n.shouldValidate&&q(e);else if(!Ae(t)&&(X(e,t,n),w.current.has(e))){const l=Ze(e)||e;pe(d.current,e,t),O.current[l]({[l]:fe(d.current,l)}),(A.current.isDirty||A.current.dirtyFields)&&n.shouldDirty&&(pe(x.current.dirtyFields,e,((e,t,n)=>xe(ke(e,t,n.slice(0,e.length)),ke(t,e,n.slice(0,e.length))))(t,fe(y.current,e,[]),fe(x.current.dirtyFields,e,[]))),B({isDirty:!Me(Object.assign(Object.assign({},Q()),{[e]:t}),y.current)}))}!s&&pe(S.current,e,t)},[G,V,X]),Y=e=>C.current||p.current.has(e)||p.current.has((e.match(/\w+/)||[])[0]),J=e=>{let t=!0;if(!Te(v.current))for(const n in v.current)e&&v.current[n].size&&!v.current[n].has(e)&&!v.current[n].has(Ze(e))||(g.current[n](),t=!1);return t};function K(e){if(!s){let t=Ke(e);for(const e of w.current)ue(e)&&!t[e]&&(t=Object.assign(Object.assign({},t),{[e]:[]}));return t}return e}function Q(e){if(Ue(e))return _e(u,e,S);if(Array.isArray(e)){const t={};for(const n of e)pe(t,n,_e(u,n,S));return t}return K(Be(u,Ke(S.current),s))}b.current=b.current?b.current:function(e){let{type:t,target:n}=e;try{let e=n.name;const l=u.current[e];let o,r;return Promise.resolve(function(){if(l){function i(){!a&&J(e),j(e,o,m,d,r)}const a="blur"===t,c=Xe(Object.assign({isBlurEvent:a,isReValidateOnChange:U,isReValidateOnBlur:k,isTouched:!!fe(x.current.touched,e),isSubmitted:x.current.isSubmitted},_.current));let d=G(e,!1),m=!Te(d)||!a&&Y(e);if(a&&!fe(x.current.touched,e)&&A.current.touched&&(pe(x.current.touched,e,!0),d=Object.assign(Object.assign({},d),{touched:x.current.touched})),!s&&Se(n)&&pe(S.current,e,_e(u,e)),c)return!a&&J(e),(!Te(d)||m&&Te(d))&&B(d);F();const p=I.current?Promise.resolve(I.current(Q(),N.current,L)).then(function(t){let{errors:l}=t;const i=x.current.isValid;if(o=fe(l,e),Se(n)&&!o&&I.current){const t=Ze(e),n=fe(l,t,{});n.type&&n.message&&(o=n),t&&(n||fe(x.current.errors,t))&&(e=t)}r=Te(l),i!==r&&(m=!0)}):Promise.resolve($e(u,L,l,S)).then(function(t){o=t[e]});return p&&p.then?p.then(i):i()}}())}catch(e){return Promise.reject(e)}};const ee=n.useCallback(function(e){void 0===e&&(e={});try{const t=Te(u.current)?y.current:{};return Promise.resolve(I.current(Object.assign(Object.assign(Object.assign({},t),Q()),e),N.current,L)).then(function(e){let{errors:t}=e;const n=Te(t);x.current.isValid!==n&&B({isValid:n})})}catch(e){return Promise.reject(e)}},[L]),te=n.useCallback((e,t)=>{!function(e,t,n,l,o,r){const{ref:i,ref:{name:a}}=n,s=e.current[a];if(!o){const t=_e(e,a,l);!ge(t)&&pe(l.current,a,t)}i.type&&s?Ce(i)||Se(i)?Array.isArray(s.options)&&s.options.length?(de(s.options).forEach(function(e,n){void 0===e&&(e={}),(De(e.ref)&&Pe(e,e.ref)||r)&&(Ee(e.ref,t),Re(s.options,`[${n}]`))}),s.options&&!de(s.options).length&&delete e.current[a]):delete e.current[a]:(De(i)&&Pe(s,i)||r)&&(Ee(i,t),delete e.current[a]):delete e.current[a]}(u,b.current,e,S,s,t),s&&(Re(E.current,e.ref.name),Re(f.current,e.ref.name))},[s]),ne=n.useCallback(e=>{if(C.current)B();else{for(const t of p.current)if(t.startsWith(e)){B();break}J(e)}},[]),le=n.useCallback((e,t)=>{e&&(te(e,t),s&&!de(e.options||[]).length&&(Re(x.current.errors,e.ref.name),pe(x.current.dirtyFields,e.ref.name,!0),B({isDirty:H()}),A.current.isValid&&I.current&&ee(),ne(e.ref.name)))},[ee,te]),oe=n.useCallback((e,t,n)=>{const l=n?v.current[n]:p.current;let o=Be(u,Ke(S.current),s,!1,e);if(Ue(e)){const n=Ze(e)||e;return w.current.has(n)&&(o=Object.assign(Object.assign({},m.current),o)),qe(o,e,l,ge(fe(y.current,e))?t:fe(y.current,e),!0)}const r=ge(t)?y.current:t;return Array.isArray(e)?e.reduce((e,t)=>Object.assign(Object.assign({},e),{[t]:qe(o,t,l,r)}),{}):(C.current=ge(n),ve(!Te(o)&&o||r))},[]);function se(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(w.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")}const{name:n,type:l,value:o}=e,r=Object.assign({ref:e},t),i=u.current,a=et(e),c=Ye(w.current,n),d=t=>Je&&(!re(e)||t===e);let m,p=i[n],v=!0;if(p&&(a?Array.isArray(p.options)&&de(p.options).find(e=>o===e.ref.value&&d(e.ref)):d(p.ref)))return void(i[n]=Object.assign(Object.assign({},p),t));p=l?a?Object.assign({options:[...de(p&&p.options||[]),{ref:e}],ref:{type:l,name:n}},t):Object.assign({},r):r,i[n]=p;const g=ge(fe(S.current,n));Te(y.current)&&g||(m=fe(g?y.current:S.current,n),v=ge(m),v||c||V(n,m)),Te(t)||(pe(f.current,n,!0),!D&&A.current.isValid&&$e(u,L,p,S).then(e=>{const t=x.current.isValid;Te(e)?pe(E.current,n,!0):Re(E.current,n),t!==Te(e)&&B()})),!s||c&&v||!c&&Re(x.current.dirtyFields,n),l&&function(e,t,n){let{ref:l}=e;re(l)&&n&&(l.addEventListener(t?"change":"input",n),l.addEventListener("blur",n))}(a&&p.options?p.options[p.options.length-1]:p,a||"select-one"===e.type,b.current)}const me=n.useCallback((e,t)=>function(n){try{n&&n.preventDefault&&(n.preventDefault(),n.persist());let l={},o=K(Be(u,Ke(S.current),s,!0));return A.current.isSubmitting&&B({isSubmitting:!0}),Promise.resolve(function(r,i){try{var s=function(){function r(){const r=function(){if(Te(l)&&Object.keys(x.current.errors).every(e=>e in u.current))return B({errors:{},isSubmitting:!0}),Promise.resolve(e(o,n)).then(function(){});{function r(e){a&&((e,t)=>{for(const n in e)if(fe(t,n)){const t=e[n];if(t){if(t.ref.focus&&ge(t.ref.focus()))break;if(t.options){t.options[0].ref.focus();break}}}})(u.current,x.current.errors)}return x.current.errors=Object.assign(Object.assign({},x.current.errors),l),t?Promise.resolve(t(x.current.errors,n)).then(r):r()}}();if(r&&r.then)return r.then(function(){})}const i=I.current?Promise.resolve(I.current(o,N.current,L)).then(function(e){let{errors:t,values:n}=e;x.current.errors=l=t,o=n}):z(Object.values(u.current),function(e){const t=function(){if(e){const{name:t}=e.ref;return Promise.resolve($e(u,L,e,S)).then(function(e){e[t]?(pe(l,t,e[t]),Re(E.current,t)):fe(f.current,t)&&(Re(x.current.errors,t),pe(E.current,t,!0))})}}();if(t&&t.then)return t.then(function(){})});return i&&i.then?i.then(r):r()}()}catch(e){return i(!0,e)}return s&&s.then?s.then(i.bind(null,!1),i.bind(null,!0)):i(!1,s)}(0,function(e,t){if(x.current.isSubmitting=!1,B({isSubmitted:!0,isSubmitting:!1,isSubmitSuccessful:Te(x.current.errors),submitCount:x.current.submitCount+1}),e)throw t;return t}))}catch(n){return Promise.reject(n)}},[a,L]);n.useEffect(()=>{o&&A.current.isValid&&ee(),M.current=M.current||!Je?M.current:function(e,t){const n=new MutationObserver(()=>{for(const n of Object.values(e.current))if(n&&n.options)for(const e of n.options)e&&e.ref&&De(e.ref)&&t(n);else n&&De(n.ref)&&t(n)});return n.observe(window.document,{childList:!0,subtree:!0}),n}(u,le)},[le,y.current]),n.useEffect(()=>()=>{M.current&&M.current.disconnect(),h.current=!0,"production"===process.env.NODE_ENV&&Object.values(u.current).forEach(e=>le(e,!0))},[]),!o&&A.current.isValid&&(R.isValid=Me(E.current,f.current)&&Te(x.current.errors));const ye={trigger:q,setValue:n.useCallback(function(e,t,n){Z(e,t,n||{}),Y(e)&&B(),J(e)},[Z,q]),getValues:n.useCallback(Q,[]),register:n.useCallback(function(e,t){if(!tt)if(Ue(e))se({name:e},t);else{if(!ce(e)||!("name"in e))return t=>t&&se(t,e);se(e,t)}},[y.current]),unregister:n.useCallback(function(e){for(const t of Array.isArray(e)?e:[e])le(u.current[t],!0)},[]),formState:nt?new Proxy(R,{get:(e,t)=>{if("production"!==process.env.NODE_ENV&&"isValid"===t&&D&&console.warn("📋 `formState.isValid` is applicable with `onTouched`, `onChange` or `onBlur` mode. https://react-hook-form.com/api#formState"),t in e)return A.current[t]=!0,e[t]}}):R},he=n.useMemo(()=>Object.assign({isFormDirty:H,updateWatchedValue:ne,shouldUnregister:s,updateFormState:B,removeFieldEventListener:te,watchInternal:oe,mode:_.current,reValidateMode:{isReValidateOnBlur:k,isReValidateOnChange:U},validateResolver:o?ee:void 0,fieldsRef:u,resetFieldArrayFunctionRef:O,useWatchFieldsRef:v,useWatchRenderFunctionsRef:g,fieldArrayDefaultValuesRef:d,validFieldsRef:E,fieldsWithValidationRef:f,fieldArrayNamesRef:w,readFormStateRef:A,formStateRef:x,defaultValuesRef:y,shallowFieldsStateRef:S,fieldArrayValuesRef:m},ye),[y.current,ne,s,te,oe]);return Object.assign({watch:function(e,t){return oe(e,t)},control:he,handleSubmit:me,reset:n.useCallback(function(e,t){if(void 0===t&&(t={}),Je)for(const e of Object.values(u.current))if(e){const{ref:t,options:n}=e,l=et(t)&&Array.isArray(n)?n[0].ref:t;if(re(l))try{l.closest("form").reset();break}catch(e){}}u.current={},y.current=Object.assign({},e||y.current),e&&J(""),Object.values(O.current).forEach(e=>Ve(e)&&e()),S.current=s?{}:Ke(e||y.current),(e=>{let{errors:t,isDirty:n,isSubmitted:l,touched:o,isValid:r,submitCount:i,dirtyFields:a}=e;r||(E.current={},f.current={}),d.current={},p.current=new Set,C.current=!1,B({submitCount:i?x.current.submitCount:0,isDirty:!!n&&x.current.isDirty,isSubmitted:!!l&&x.current.isSubmitted,isValid:!!r&&x.current.isValid,dirtyFields:a?x.current.dirtyFields:{},touched:o?x.current.touched:{},errors:t?x.current.errors:{},isSubmitting:!1,isSubmitSuccessful:!1})})(t)},[]),clearErrors:n.useCallback(function(e){e&&(Array.isArray(e)?e:[e]).forEach(e=>u.current[e]&&ue(e)?delete x.current.errors[e]:Re(x.current.errors,e)),B({errors:e?x.current.errors:{}})},[]),setError:n.useCallback(function(e,t){const n=(u.current[e]||{}).ref;pe(x.current.errors,e,Object.assign(Object.assign({},t),{ref:n})),B({isValid:!1}),t.shouldFocus&&n&&n.focus&&n.focus()},[]),errors:R.errors},ye)}({defaultValues:u}),E=e=>{if(null==e||null==e||""==e)return"NA";const t=new Date(e);let n=t.getMonth()+1,l=t.getDate();return n=(n>9?"":"0")+n,l=(l>9?"":"0")+l,`${l}/${n}/${t.getFullYear()}`},y=e=>{if(null==e||null==e||""==e)return"NA";const t=new Date(e);let n=t.getHours(),l=t.getMinutes(),o=n>12?"PM":"AM";return n=n>12?n-12:n,n=(n>9?"":"0")+n,l=(l>9?"":"0")+l,`${n}:${l} ${o}`},[h,C]=n.useState([]),b=e=>l.createElement("div",{onClick:e.onClick},l.createElement(s.DownloadBtnCommon,null));n.useEffect(()=>{d("offset",0),d("limit",5),d("sortOrder","DESC")},[d]),n.useEffect(()=>{(null==a?void 0:a.length)>0&&C([null==a?void 0:a.map(e=>{let t={};return t[r("AUDIT_DATE_LABEL")]=E(null==e?void 0:e.timestamp),t[r("AUDIT_TIME_LABEL")]=y(null==e?void 0:e.timestamp),t[r("AUDIT_DATAVIEWED_LABEL")]=(null==e?void 0:e.dataView[0])+","+(null==e?void 0:e.dataView[1]),t[r("AUDIT_DATAVIEWED_BY_LABEL")]=null==e?void 0:e.dataViewedBy,t[r("AUDIT_ROLE_LABEL")]=null==e?void 0:e.roles.map(e=>e.name).join(","),{...t}})])},[a]);const S=n.useCallback(e=>{0!==e.length&&(v("sortBy",e.id),v("sortOrder",e.desc?"DESC":"ASC"))},[]);function O(){v("offset",g("offset")-g("limit")),p(i)()}const N=window.Digit.Utils.browser.isMobile();if(N)return l.createElement(it,{Controller:ot,register:d,control:m,t:r,reset:f,previousPage:O,handleSubmit:p,tenantId:o,data:a,onSubmit:i});const I=e=>l.createElement("span",{className:"cell-text"},e),w=n.useMemo(()=>[{Header:r("AUDIT_DATE_LABEL"),disableSortBy:!0,accessor:e=>{const t="NA"===e.timestamp?r("WS_NA"):E(e.timestamp);return I(""+t)}},{Header:r("AUDIT_TIME_LABEL"),disableSortBy:!0,accessor:e=>{const t="NA"===e.timestamp?r("WS_NA"):y(e.timestamp);return I(""+t)}},{Header:r(N?"AUDIT_DATAVIEWED_LABEL":"AUDIT_DATAVIEWED_PRIVACY"),disableSortBy:!0,accessor:e=>I(""+(null==e?void 0:e.dataView))},{Header:r(N?"AUDIT_DATAVIEWED_BY_LABEL":"AUDIT_DATAVIEWED_BY_PRIVACY"),disableSortBy:!0,accessor:e=>I(""+(null==e?void 0:e.dataViewedBy))},{Header:r("AUDIT_ROLE_LABEL"),disableSortBy:!0,accessor:e=>{var t;return I(""+(null==e||null===(t=e.roles.slice(0,3))||void 0===t?void 0:t.map(e=>e.name)))}}],[]);return l.createElement(l.Fragment,null,l.createElement("div",{style:{marginRight:"-70px"}}," ",l.createElement(t.BackButton,null)," "),l.createElement("div",{style:{marginTop:"30px",marginLeft:"30px"}}," ",l.createElement(t.Header,null,r("PRIVACY_AUDIT_REPORT"))," "),l.createElement(t.SearchForm,{className:"audit-card",onSubmit:i,handleSubmit:p},l.createElement(rt,{register:d,control:m,reset:f,tenantId:o,t:r,previousPage:O})),l.createElement("div",{style:{marginTop:"240px",marginLeft:"-55%",maxWidth:"80%",marginRight:"52px"}},null!=a&&a.display?l.createElement("div",{style:{marginTop:"20x",width:"1025px",marginLeft:"25px",backgroundColor:"white",height:"60px"}},r(a.display).split("\\n").map((e,t)=>l.createElement("p",{key:t,style:{textAlign:"center"}},e))):""!==a?l.createElement("div",{style:{backgroundColor:"white",marginRight:"-30px",marginLeft:"30px"}},l.createElement("div",{className:"sideContent",style:{float:"right",padding:"10px 30px"}},l.createElement(b,{className:"mrlg cursorPointer",onClick:()=>(e=>{if(void 0!==(null==e?void 0:e[0]))return Digit.Download.Excel(null==e?void 0:e[0],"AuditReport")})(h)})),l.createElement(s.Table,{t:r,data:a,totalRecords:c,columns:w,getCellProps:e=>({style:{minWidth:e.column.Header===r("ES_INBOX_APPLICATION_NO")?"240px":"",padding:"20px 18px",fontSize:"16px"}}),onPageSizeChange:function(e){v("limit",Number(e.target.value)),p(i)()},currentPage:g("offset")/g("limit"),onNextPage:function(){v("offset",g("offset")+g("limit")),p(i)()},onPrevPage:O,manualPagination:!1,pageSizeLimit:g("limit"),onSort:S,disableSort:!1,sortParams:[{id:g("sortBy"),desc:"DESC"===g("sortOrder")}]})):l.createElement(t.Loader,null)))},st=e=>{var t,r;const{t:i}=o.useTranslation(),a=Digit.ULBService.getCitizenCurrentTenant(),[s,c]=n.useState({}),u=function(e,t){void 0===t&&(t="dayend");try{const n=e.match(/(\d{4})-(\d{1,2})-(\d{1,2})/),l=new Date(Date.UTC(n[1],n[2]-1,n[3]));return l.setMinutes(l.getMinutes()+l.getTimezoneOffset()),"dayend"===t&&(l.setHours(l.getHours()+24),l.setSeconds(l.getSeconds()-1)),l.getTime()}catch(t){return e}};n.useEffect(()=>{const e=Digit.SessionStorage.get("AUDIT_APPLICATION_DETAIL")||{};if(e){const t={...e};c(Object.keys(t).filter(e=>t[e]).reduce((e,n)=>({...e,[n]:"object"==typeof t[n]?t[n].code:t[n]}),{}))}},[]);const d={enabled:!!(s&&Object.keys(s).length>0)},m={...s},{isLoading:p,data:v}=Digit.Hooks.useAudit({tenantId:a,filters:{...m},config:d});return l.createElement(at,{t:i,tenantId:a,onSubmit:function(e){Digit.SessionStorage.set("AUDIT_APPLICATION_DETAIL",{offset:0,limit:5,sortBy:"commencementDate",sortOrder:"DESC"});const t={...e,fromDate:u(null==e?void 0:e.fromDate),toDate:u(null==e?void 0:e.toDate)};c(Object.keys(t).filter(e=>t[e]).reduce((e,n)=>({...e,[n]:t[n]}),{}))},data:p?"":(null==v||null===(t=v.ElasticSearchData)||void 0===t?void 0:t.length)>0?null==v?void 0:v.ElasticSearchData:{display:"ES_COMMON_NO_DATA"},count:null==v||null===(r=v.ElasticSearchData)||void 0===r?void 0:r.length})},ct=e=>{var n,r,i,a,s,c,u,d,m,p,v,g,f,E,y,h;let{moduleCode:C}=e;const{t:b}=o.useTranslation(),S=Digit.ULBService.getCitizenCurrentTenant(),{isLoading:O,data:N}=Digit.Hooks.useStaticData(Digit.ULBService.getStateId()),{isLoading:I,error:w,data:_}=Digit.Hooks.useDynamicData({moduleCode:C,tenantId:S,filters:{},t:b}),D=e=>{let{module:n,styles:o}=e;switch(n){case"TL":return l.createElement(t.CaseIcon,{className:"fill-path-primary-main",styles:o});case"PT":return l.createElement(t.PTIcon,{className:"fill-path-primary-main",styles:o});case"MCOLLECT":return l.createElement(t.MCollectIcon,{className:"fill-path-primary-main",styles:o});case"PGR":return l.createElement(t.ComplaintIcon,{className:"fill-path-primary-main",styles:o});default:return l.createElement(t.CaseIcon,{className:"fill-path-primary-main",styles:o})}},T=null==N||null===(n=N.MdmsRes["common-masters"])||void 0===n||null===(r=n.StaticData[0])||void 0===r?void 0:r[""+C],L=e=>{let{module:n}=e;switch(n){case"PT":case"WS":return l.createElement("span",{className:"timerIcon"},l.createElement(t.TimerIcon,null));default:return null}},R=e=>{let{module:n}=e;switch(n){case"PT":return l.createElement("span",{className:"rupeeSymbol"},l.createElement(t.RupeeSymbol,null));case"WS":return l.createElement("span",{className:"timerIcon"},l.createElement(t.TimerIcon,null));default:return null}},P=e=>{switch(e){case"TL":case"PT":case"MCOLLECT":return{staticCommonContent:b("COMMON_VALIDITY"),validity:(null==T?void 0:T.validity)+b("1"===(null==T?void 0:T.validity)?"COMMON_DAY":"COMMON_DAYS")};case"PGR":return{staticCommonContent:b("ACTION_TEST_COMPLAINT_TYPES")};case"OBPS":return{staticCommonContent:b("BUILDING_PLAN_PERMIT_VALIDITY"),validity:(null==T?void 0:T.validity)+" "+b("1"===(null==T?void 0:T.validity)?"COMMON_DAY":"COMMON_DAYS")};default:return{staticCommonContent:""}}},A=e=>{switch(e){case"PT":return{staticDataOne:(null==T?void 0:T.staticDataOne)+" "+b("COMMON_DAYS"),staticDataOneHeader:b("APPLICATION_PROCESSING_TIME"),staticDataTwo:null==T?void 0:T.staticDataTwo,staticDataTwoHeader:b("APPLICATION_PROCESSING_FEE")};case"WS":return{staticDataOne:"",staticDataOneHeader:b("PAY_WATER_CHARGES_BY")+" "+(null==T?void 0:T.staticDataOne)+" "+b("COMMON_DAYS")+" "+b("OF_BILL_GEN_TO_AVOID_LATE_FEE"),staticDataTwo:(null==T?void 0:T.staticDataTwo)+" "+b("COMMON_DAYS"),staticDataTwoHeader:b("APPLICATION_PROCESSING_TIME")};default:return{}}};return O||I?l.createElement(t.Loader,null):T?l.createElement(l.Fragment,null,T&&null!=T&&T.payViaWhatsApp?l.createElement(t.Card,{style:{margin:"16px",padding:"16px",maxWidth:"unset"}},l.createElement("div",{className:"pay-whatsapp-card",onClick:()=>{window.open(null==T?void 0:T.payViaWhatsApp)}},l.createElement("div",{className:"pay-whatsapp-text"},b("PAY_VIA_WHATSAPP")),l.createElement("div",{className:"whatsAppIconG"},l.createElement(t.WhatsappIconGreen,null)))):null,T&&null!=T&&T.helpline?l.createElement(t.Card,{style:{margin:"16px",padding:"16px",maxWidth:"unset"}},l.createElement("div",{className:"static-home-Card"},l.createElement("div",{className:"static-home-Card-header"},b("CALL_CENTER_HELPLINE")),l.createElement("div",{className:"helplineIcon"},l.createElement(t.HelpLineIcon,null))),l.createElement("div",{className:"call-center-card-text"},null!=T&&null!==(i=T.helpline)&&void 0!==i&&i.contactOne?l.createElement("div",{className:"call-center-card-content"},l.createElement("a",{href:"tel:"+(null==T||null===(a=T.helpline)||void 0===a?void 0:a.contactOne)},null==T||null===(s=T.helpline)||void 0===s?void 0:s.contactOne)):null,null!=T&&null!==(c=T.helpline)&&void 0!==c&&c.contactTwo?l.createElement("div",{className:"call-center-card-content"},l.createElement("a",{href:"tel:"+(null==T||null===(u=T.helpline)||void 0===u?void 0:u.contactTwo)},null==T||null===(d=T.helpline)||void 0===d?void 0:d.contactTwo)):null)):null,T&&null!=T&&T.serviceCenter?l.createElement(t.Card,{style:{margin:"16px",padding:"16px",maxWidth:"unset"}},l.createElement("div",{className:"static-home-Card"},l.createElement("div",{className:"static-home-Card-header"},b("CITIZEN_SERVICE_CENTER")),l.createElement("div",{className:"serviceCentrIcon"},l.createElement(t.ServiceCenterIcon,null))),l.createElement("div",{className:"service-center-details-card"},l.createElement("div",{className:"service-center-details-text"},null==T?void 0:T.serviceCenter)),null!=T&&T.viewMapLocation?l.createElement("div",{className:"link"},l.createElement("a",{href:null==T?void 0:T.viewMapLocation},b("VIEW_ON_MAP"))):null):l.createElement("div",null),l.createElement(t.Card,{style:{margin:"16px",padding:"16px",maxWidth:"unset"}},w||null==_||null===(null==_?void 0:_.dynamicDataOne)?l.createElement("div",null):l.createElement("div",{className:"dynamicDataCard"},l.createElement("div",{className:"dynamicData"},l.createElement(D,{module:C,styles:{width:"24px",height:"24px"}}),l.createElement("span",{className:"dynamicData-content"},null==_?void 0:_.dynamicDataOne))),w||null==_||null===(null==_?void 0:_.dynamicDataTwo)?l.createElement("div",null):l.createElement("div",{className:"dynamicDataCard"},l.createElement("div",{className:"dynamicData"},l.createElement(D,{module:C,styles:{width:"24px",height:"24px"}}),l.createElement("span",{className:"dynamicData-content"},null==_?void 0:_.dynamicDataTwo))),T&&null!=T&&T.staticDataOne?l.createElement("div",{className:"staticDataCard"},l.createElement("div",{className:"staticData"},l.createElement(L,{module:C}),l.createElement("span",{className:"static-data-content"},l.createElement("span",{className:"static-data-content-first",style:{marginTop:""===(null===(m=A(C))||void 0===m?void 0:m.staticDataOne)?"8px":"unset"}},null===(p=A(C))||void 0===p?void 0:p.staticDataOneHeader),l.createElement("span",{className:"static-data-content-second"},""+(null===(v=A(C))||void 0===v?void 0:v.staticDataOne))))):l.createElement("div",null),T&&null!=T&&T.staticDataTwo?l.createElement("div",{className:"staticDataCard"},l.createElement("div",{className:"staticData"},l.createElement(R,{module:C}),l.createElement("span",{className:"static-data-content"},l.createElement("span",{className:"static-data-content-first"},null===(g=A(C))||void 0===g?void 0:g.staticDataTwoHeader),l.createElement("span",{className:"static-data-content-second"},null===(f=A(C))||void 0===f?void 0:f.staticDataTwo)))):l.createElement("div",null),T&&null!=T&&T.validity?l.createElement("div",{className:"staticDataCard"},l.createElement("div",{className:"staticData"},l.createElement("span",{className:"validityIcon"},l.createElement(t.ValidityTimeIcon,null)),l.createElement("span",{className:"static-data-content"},l.createElement("span",{className:"static-data-content-first"},null===(E=P(C))||void 0===E?void 0:E.staticCommonContent),l.createElement("span",{className:"static-data-content-second"},null===(y=P(C))||void 0===y?void 0:y.validity)))):l.createElement("div",null),w||null==_||null==_||!_.staticData||null===(null==_?void 0:_.staticData)?l.createElement("div",null):l.createElement("div",{className:"staticDataCard"},l.createElement("div",{className:"staticData"},"PGR"===C?l.createElement(D,{module:C,styles:{width:"24px",height:"24px",marginLeft:"13px",marginTop:"12px"}}):l.createElement("span",{className:"validityIcon"},l.createElement(t.ValidityTimeIcon,null)),l.createElement("span",{className:"static-data-content"},l.createElement("span",{className:"static-data-content-first"},null===(h=P(C))||void 0===h?void 0:h.staticCommonContent),l.createElement("span",{className:"static-data-content-second"},null==_?void 0:_.staticData)))))):l.createElement(l.Fragment,null)};var ut,dt,mt,pt,vt;const gt=[(null===(ut=window)||void 0===ut?void 0:ut.contextPath)+"/citizen/register/name",`/${null===(dt=window)||void 0===dt?void 0:dt.contextPath}/citizen/select-language`,`/${null===(mt=window)||void 0===mt?void 0:mt.contextPath}/citizen/select-location`,`/${null===(pt=window)||void 0===pt?void 0:pt.contextPath}/citizen/login`,`/${null===(vt=window)||void 0===vt?void 0:vt.contextPath}/citizen/register/otp`],ft=(e,t)=>t.filter(t=>e.map(e=>e.code).includes(t.code)),Et=e=>{var n,r,i;let{stateInfo:s,userDetails:c,CITIZEN:u,cityDetails:d,mobileView:p,handleUserDropdownSelection:f,logoUrl:E,stateCode:h,modules:C,appTenants:b,pathname:S,initData:O}=e;const{isLoading:N,data:I,isFetched:w}=Digit.Hooks.useCustomMDMS(Digit.ULBService.getStateId(),"ACCESSCONTROL-ACTIONS-TEST",[{name:"actions-test",filter:`[?(@.url == '${window.contextPath}-card')]`}],{select: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(e=>!0===e.enabled).reduce((e,t)=>{var n;return e[t.parentModule]=(null===(n=e[t.parentModule])||void 0===n?void 0:n.length)>0?[t,...e[t.parentModule]]:[t],e},{})}}),_=Digit.Hooks.useRouteSubscription(S),{t:T}=o.useTranslation(),{path:L}=a.useRouteMatch(),R=a.useHistory(),P=gt.some(e=>window.location.href.includes(e)),x=C.map((e,t)=>{let{code:n,tenants:o}=e;const r=Digit.ComponentRegistryService.getComponent(n+"Module");return r?l.createElement(a.Route,{key:t,path:`${L}/${n.toLowerCase()}`},l.createElement(r,{stateCode:h,moduleCode:n,userType:"citizen",tenants:ft(o,b)})):null}),F=C.map((e,n)=>{let{code:o,bannerImage:r}=e,i=(Digit.ComponentRegistryService.getComponent(o+"Links"),w?g(I,o,T):void 0);return"ACTION_TEST_WS"===(null==i?void 0:i.header)&&(null==i||i.links.sort((e,t)=>t.orderNumber-e.orderNumber)),l.createElement(l.Fragment,null,l.createElement(a.Route,{key:n,path:`${L}/${o.toLowerCase()}-home`},l.createElement("div",{className:"moduleLinkHomePage"},l.createElement("img",{src:r||(null==s?void 0:s.bannerUrl),alt:"noimagefound"}),l.createElement(t.BackButton,{className:"moduleLinkHomePageBackButton"}),l.createElement("h1",null,T("MODULE_"+o.toUpperCase())),l.createElement("div",{className:"moduleLinkHomePageModuleLinks"},i&&l.createElement(t.CitizenHomeCard,{header:T(null==i?void 0:i.header),links:null==i?void 0:i.links,Icon:()=>l.createElement("span",null),Info:"OBPS"===o?()=>l.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"===o})),l.createElement(ct,{moduleCode:null==o?void 0:o.toUpperCase()}))),l.createElement(a.Route,{key:"faq"+n,path:`${L}/${o.toLowerCase()}-faq`},l.createElement(M,{module:null==o?void 0:o.toUpperCase()})),l.createElement(a.Route,{key:"hiw"+n,path:`${L}/${o.toLowerCase()}-how-it-works`},l.createElement(q,{module:null==o?void 0:o.toUpperCase()})))});return l.createElement("div",{className:_},l.createElement(A,{t:T,stateInfo:s,userDetails:c,CITIZEN:u,cityDetails:d,mobileView:p,handleUserDropdownSelection:f,logoUrl:E,showSidebar:!0,linkData:I,islinkDataLoading:N}),l.createElement("div",{className:"main center-container citizen-home-container mb-25"},P?null:l.createElement("div",{className:"SideBarStatic"},l.createElement(D,{linkData:I,islinkDataLoading:N})),l.createElement(a.Switch,null,l.createElement(a.Route,{exact:!0,path:L},l.createElement(k,null)),l.createElement(a.Route,{exact:!0,path:L+"/select-language"},l.createElement(U,null)),l.createElement(a.Route,{exact:!0,path:L+"/select-location"},l.createElement(B,null)),l.createElement(a.Route,{path:L+"/error"},l.createElement(m,{initData:O,goToHome:()=>{var e,t,n,l;R.push(`/${null===(e=window)||void 0===e?void 0:e.contextPath}/${null===(t=Digit)||void 0===t||null===(n=t.UserService)||void 0===n||null===(l=n.getType)||void 0===l?void 0:l.call(n)}`)}})),l.createElement(a.Route,{path:L+"/all-services"},l.createElement(y,{userType:"citizen",modules:C,getCitizenMenu:I,fetchedCitizen:w,isLoading:N})),l.createElement(a.Route,{path:L+"/login"},l.createElement(oe,{stateCode:h})),l.createElement(a.Route,{path:L+"/register"},l.createElement(oe,{stateCode:h,isUserRegistered:!1})),l.createElement(a.Route,{path:L+"/user/profile"},l.createElement(W,{stateCode:h,userType:"citizen",cityDetails:d})),l.createElement(a.Route,{path:L+"/Audit"},l.createElement(st,null)),l.createElement(v,{initData:O},x,F))),l.createElement("div",{className:"citizen-home-footer",style:window.location.href.includes("citizen/obps")?{zIndex:"-1"}:{}},l.createElement("img",{alt:"Powered by DIGIT",src:null===(n=window)||void 0===n||null===(r=n.globalConfigs)||void 0===r||null===(i=r.getConfig)||void 0===i?void 0:i.call(r,"DIGIT_FOOTER"),style:{height:"1.2em",cursor:"pointer"},onClick:()=>{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 yt(e,t){return e(t={exports:{}},t.exports),t.exports}var ht="function"==typeof Symbol&&Symbol.for,Ct=ht?Symbol.for("react.element"):60103,bt=ht?Symbol.for("react.portal"):60106,St=ht?Symbol.for("react.fragment"):60107,Ot=ht?Symbol.for("react.strict_mode"):60108,Nt=ht?Symbol.for("react.profiler"):60114,It=ht?Symbol.for("react.provider"):60109,wt=ht?Symbol.for("react.context"):60110,_t=ht?Symbol.for("react.async_mode"):60111,Dt=ht?Symbol.for("react.concurrent_mode"):60111,Tt=ht?Symbol.for("react.forward_ref"):60112,Lt=ht?Symbol.for("react.suspense"):60113,Rt=ht?Symbol.for("react.suspense_list"):60120,Pt=ht?Symbol.for("react.memo"):60115,At=ht?Symbol.for("react.lazy"):60116,xt=ht?Symbol.for("react.block"):60121,Mt=ht?Symbol.for("react.fundamental"):60117,kt=ht?Symbol.for("react.responder"):60118,Ut=ht?Symbol.for("react.scope"):60119;function Bt(e){if("object"==typeof e&&null!==e){var t=e.$$typeof;switch(t){case Ct:switch(e=e.type){case _t:case Dt:case St:case Nt:case Ot:case Lt:return e;default:switch(e=e&&e.$$typeof){case wt:case Tt:case At:case Pt:case It:return e;default:return t}}case bt:return t}}}function Ft(e){return Bt(e)===Dt}var jt={AsyncMode:_t,ConcurrentMode:Dt,ContextConsumer:wt,ContextProvider:It,Element:Ct,ForwardRef:Tt,Fragment:St,Lazy:At,Memo:Pt,Portal:bt,Profiler:Nt,StrictMode:Ot,Suspense:Lt,isAsyncMode:function(e){return Ft(e)||Bt(e)===_t},isConcurrentMode:Ft,isContextConsumer:function(e){return Bt(e)===wt},isContextProvider:function(e){return Bt(e)===It},isElement:function(e){return"object"==typeof e&&null!==e&&e.$$typeof===Ct},isForwardRef:function(e){return Bt(e)===Tt},isFragment:function(e){return Bt(e)===St},isLazy:function(e){return Bt(e)===At},isMemo:function(e){return Bt(e)===Pt},isPortal:function(e){return Bt(e)===bt},isProfiler:function(e){return Bt(e)===Nt},isStrictMode:function(e){return Bt(e)===Ot},isSuspense:function(e){return Bt(e)===Lt},isValidElementType:function(e){return"string"==typeof e||"function"==typeof e||e===St||e===Dt||e===Nt||e===Ot||e===Lt||e===Rt||"object"==typeof e&&null!==e&&(e.$$typeof===At||e.$$typeof===Pt||e.$$typeof===It||e.$$typeof===wt||e.$$typeof===Tt||e.$$typeof===Mt||e.$$typeof===kt||e.$$typeof===Ut||e.$$typeof===xt)},typeOf:Bt},Vt=yt(function(e,t){"production"!==process.env.NODE_ENV&&function(){var e="function"==typeof Symbol&&Symbol.for,n=e?Symbol.for("react.element"):60103,l=e?Symbol.for("react.portal"):60106,o=e?Symbol.for("react.fragment"):60107,r=e?Symbol.for("react.strict_mode"):60108,i=e?Symbol.for("react.profiler"):60114,a=e?Symbol.for("react.provider"):60109,s=e?Symbol.for("react.context"):60110,c=e?Symbol.for("react.async_mode"):60111,u=e?Symbol.for("react.concurrent_mode"):60111,d=e?Symbol.for("react.forward_ref"):60112,m=e?Symbol.for("react.suspense"):60113,p=e?Symbol.for("react.suspense_list"):60120,v=e?Symbol.for("react.memo"):60115,g=e?Symbol.for("react.lazy"):60116,f=e?Symbol.for("react.block"):60121,E=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 p=e.type;switch(p){case c:case u:case o:case i:case r:case m:return p;default:var f=p&&p.$$typeof;switch(f){case s:case d:case g:case v:case a:return f;default:return t}}case l:return t}}}var b=u,S=s,O=a,N=n,I=d,w=o,_=g,D=v,T=l,L=i,R=r,P=m,A=!1;function x(e){return C(e)===u}t.AsyncMode=c,t.ConcurrentMode=b,t.ContextConsumer=S,t.ContextProvider=O,t.Element=N,t.ForwardRef=I,t.Fragment=w,t.Lazy=_,t.Memo=D,t.Portal=T,t.Profiler=L,t.StrictMode=R,t.Suspense=P,t.isAsyncMode=function(e){return A||(A=!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)===c},t.isConcurrentMode=x,t.isContextConsumer=function(e){return C(e)===s},t.isContextProvider=function(e){return C(e)===a},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)===o},t.isLazy=function(e){return C(e)===g},t.isMemo=function(e){return C(e)===v},t.isPortal=function(e){return C(e)===l},t.isProfiler=function(e){return C(e)===i},t.isStrictMode=function(e){return C(e)===r},t.isSuspense=function(e){return C(e)===m},t.isValidElementType=function(e){return"string"==typeof e||"function"==typeof e||e===o||e===u||e===i||e===r||e===m||e===p||"object"==typeof e&&null!==e&&(e.$$typeof===g||e.$$typeof===v||e.$$typeof===a||e.$$typeof===s||e.$$typeof===d||e.$$typeof===E||e.$$typeof===y||e.$$typeof===h||e.$$typeof===f)},t.typeOf=C}()}),Ht=yt(function(e){e.exports="production"===process.env.NODE_ENV?jt:Vt}),zt=Object.getOwnPropertySymbols,Gt=Object.prototype.hasOwnProperty,$t=Object.prototype.propertyIsEnumerable;function Wt(e){if(null==e)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(e)}var qt=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 l={};return"abcdefghijklmnopqrst".split("").forEach(function(e){l[e]=e}),"abcdefghijklmnopqrst"===Object.keys(Object.assign({},l)).join("")}catch(e){return!1}}()?Object.assign:function(e,t){for(var n,l,o=Wt(e),r=1;r<arguments.length;r++){for(var i in n=Object(arguments[r]))Gt.call(n,i)&&(o[i]=n[i]);if(zt){l=zt(n);for(var a=0;a<l.length;a++)$t.call(n,l[a])&&(o[l[a]]=n[l[a]])}}return o},Xt="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED",Zt=Function.call.bind(Object.prototype.hasOwnProperty),Yt=function(){};if("production"!==process.env.NODE_ENV){var Jt=Xt,Kt={},Qt=Zt;Yt=function(e){var t="Warning: "+e;"undefined"!=typeof console&&console.error(t);try{throw new Error(t)}catch(e){}}}function en(e,t,n,l,o){if("production"!==process.env.NODE_ENV)for(var r in e)if(Qt(e,r)){var i;try{if("function"!=typeof e[r]){var a=Error((l||"React class")+": "+n+" type `"+r+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof e[r]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw a.name="Invariant Violation",a}i=e[r](t,r,l,n,null,Jt)}catch(e){i=e}if(!i||i instanceof Error||Yt((l||"React class")+": type specification of "+n+" `"+r+"` is invalid; the type checker function must return `null` or an `Error` but returned a "+typeof i+". You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument)."),i instanceof Error&&!(i.message in Kt)){Kt[i.message]=!0;var s=o?o():"";Yt("Failed "+n+" type: "+i.message+(null!=s?s:""))}}}en.resetWarningCache=function(){"production"!==process.env.NODE_ENV&&(Kt={})};var tn=en,nn=function(){};function ln(){return null}function on(){}function rn(){}"production"!==process.env.NODE_ENV&&(nn=function(e){var t="Warning: "+e;"undefined"!=typeof console&&console.error(t);try{throw new Error(t)}catch(e){}}),rn.resetWarningCache=on;var an=yt(function(e){e.exports="production"!==process.env.NODE_ENV?function(e,t){var n="function"==typeof Symbol&&Symbol.iterator,l={array:a("array"),bigint:a("bigint"),bool:a("boolean"),func:a("function"),number:a("number"),object:a("object"),string:a("string"),symbol:a("symbol"),any:i(ln),arrayOf:function(e){return i(function(t,n,l,o,i){if("function"!=typeof e)return new r("Property `"+i+"` of component `"+l+"` has invalid PropType notation inside arrayOf.");var a=t[n];if(!Array.isArray(a))return new r("Invalid "+o+" `"+i+"` of type `"+u(a)+"` supplied to `"+l+"`, expected an array.");for(var s=0;s<a.length;s++){var c=e(a,s,l,o,i+"["+s+"]",Xt);if(c instanceof Error)return c}return null})},element:i(function(t,n,l,o,i){var a=t[n];return e(a)?null:new r("Invalid "+o+" `"+i+"` of type `"+u(a)+"` supplied to `"+l+"`, expected a single ReactElement.")}),elementType:i(function(e,t,n,l,o){var i=e[t];return Ht.isValidElementType(i)?null:new r("Invalid "+l+" `"+o+"` of type `"+u(i)+"` supplied to `"+n+"`, expected a single ReactElement type.")}),instanceOf:function(e){return i(function(t,n,l,o,i){var a;return t[n]instanceof e?null:new r("Invalid "+o+" `"+i+"` of type `"+((a=t[n]).constructor&&a.constructor.name?a.constructor.name:"<<anonymous>>")+"` supplied to `"+l+"`, expected instance of `"+(e.name||"<<anonymous>>")+"`.")})},node:i(function(e,t,n,l,o){return c(e[t])?null:new r("Invalid "+l+" `"+o+"` supplied to `"+n+"`, expected a ReactNode.")}),objectOf:function(e){return i(function(t,n,l,o,i){if("function"!=typeof e)return new r("Property `"+i+"` of component `"+l+"` has invalid PropType notation inside objectOf.");var a=t[n],s=u(a);if("object"!==s)return new r("Invalid "+o+" `"+i+"` of type `"+s+"` supplied to `"+l+"`, expected an object.");for(var c in a)if(Zt(a,c)){var d=e(a,c,l,o,i+"."+c,Xt);if(d instanceof Error)return d}return null})},oneOf:function(e){if(!Array.isArray(e))return"production"!==process.env.NODE_ENV&&nn(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."),ln;function t(t,n,l,i,a){for(var s=t[n],c=0;c<e.length;c++)if(o(s,e[c]))return null;var u=JSON.stringify(e,function(e,t){return"symbol"===d(t)?String(t):t});return new r("Invalid "+i+" `"+a+"` of value `"+String(s)+"` supplied to `"+l+"`, expected one of "+u+".")}return i(t)},oneOfType:function(e){if(!Array.isArray(e))return"production"!==process.env.NODE_ENV&&nn("Invalid argument supplied to oneOfType, expected an instance of array."),ln;for(var t=0;t<e.length;t++){var n=e[t];if("function"!=typeof n)return nn("Invalid argument supplied to oneOfType. Expected an array of check functions, but received "+m(n)+" at index "+t+"."),ln}return i(function(t,n,l,o,i){for(var a=[],s=0;s<e.length;s++){var c=(0,e[s])(t,n,l,o,i,Xt);if(null==c)return null;c.data&&Zt(c.data,"expectedType")&&a.push(c.data.expectedType)}return new r("Invalid "+o+" `"+i+"` supplied to `"+l+"`"+(a.length>0?", expected one of type ["+a.join(", ")+"]":"")+".")})},shape:function(e){return i(function(t,n,l,o,i){var a=t[n],c=u(a);if("object"!==c)return new r("Invalid "+o+" `"+i+"` of type `"+c+"` supplied to `"+l+"`, expected `object`.");for(var m in e){var p=e[m];if("function"!=typeof p)return s(l,o,i,m,d(p));var v=p(a,m,l,o,i+"."+m,Xt);if(v)return v}return null})},exact:function(e){return i(function(t,n,l,o,i){var a=t[n],c=u(a);if("object"!==c)return new r("Invalid "+o+" `"+i+"` of type `"+c+"` supplied to `"+l+"`, expected `object`.");var m=qt({},t[n],e);for(var p in m){var v=e[p];if(Zt(e,p)&&"function"!=typeof v)return s(l,o,i,p,d(v));if(!v)return new r("Invalid "+o+" `"+i+"` key `"+p+"` supplied to `"+l+"`.\nBad object: "+JSON.stringify(t[n],null," ")+"\nValid keys: "+JSON.stringify(Object.keys(e),null," "));var g=v(a,p,l,o,i+"."+p,Xt);if(g)return g}return null})}};function o(e,t){return e===t?0!==e||1/e==1/t:e!=e&&t!=t}function r(e,t){this.message=e,this.data=t&&"object"==typeof t?t:{},this.stack=""}function i(e){function t(t,n,l,o,i,a,s){if(o=o||"<<anonymous>>",a=a||l,s!==Xt){var c=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 c.name="Invariant Violation",c}return null==n[l]?t?new r(null===n[l]?"The "+i+" `"+a+"` is marked as required in `"+o+"`, but its value is `null`.":"The "+i+" `"+a+"` is marked as required in `"+o+"`, but its value is `undefined`."):null:e(n,l,o,i,a)}process;var n=t.bind(null,!1);return n.isRequired=t.bind(null,!0),n}function a(e){return i(function(t,n,l,o,i,a){var s=t[n];return u(s)!==e?new r("Invalid "+o+" `"+i+"` of type `"+d(s)+"` supplied to `"+l+"`, expected `"+e+"`.",{expectedType:e}):null})}function s(e,t,n,l,o){return new r((e||"React class")+": "+t+" type `"+n+"."+l+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+o+"`.")}function c(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(c);if(null===t||e(t))return!0;var l=function(e){var t=e&&(n&&e[n]||e["@@iterator"]);if("function"==typeof t)return t}(t);if(!l)return!1;var o,r=l.call(t);if(l!==t.entries){for(;!(o=r.next()).done;)if(!c(o.value))return!1}else for(;!(o=r.next()).done;){var i=o.value;if(i&&!c(i[1]))return!1}return!0;default:return!1}}function u(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=u(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 r.prototype=Error.prototype,l.checkPropTypes=tn,l.resetWarningCache=tn.resetWarningCache,l.PropTypes=l,l}(Ht.isElement):function(){function e(e,t,n,l,o,r){if(r!==Xt){var i=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 i.name="Invariant Violation",i}}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:rn,resetWarningCache:on};return n.PropTypes=n,n}()});const sn=e=>{let{children:t}=e;return l.createElement("div",{className:"banner banner-container"},t)},cn=e=>{var n;let{showTenant:r=!0}=e;const{data:i,isLoading:a}=Digit.Hooks.useStore.getInitData(),{stateInfo:s}=i||{},{t:c}=o.useTranslation();return a?l.createElement(t.Loader,null):l.createElement("div",{className:"bannerHeader"},l.createElement("img",{className:"bannerLogo",src:null==s?void 0:s.logoUrl,style:r?{}:{borderRight:"unset"}}),r&&l.createElement("p",null,c("TENANT_TENANTS_"+(null==s||null===(n=s.code)||void 0===n?void 0:n.toUpperCase()))))},un=e=>{var o,r,i;let{config:c,t:u}=e;const[d,m]=n.useState(null),{mobile_number:p,tenantId:v}=Digit.Hooks.useQueryParams(),g=a.useHistory(),[f,E]=n.useState(""),[y,h]=n.useState(!0),[C,b]=n.useState(null),S=()=>Digit.UserService.getType();n.useEffect(()=>{var e,t;if(!d)return void Digit.UserService.setType("employee");Digit.UserService.setUser(d);const n=(null===(e=location.state)||void 0===e?void 0:e.from)||`/${null===(t=window)||void 0===t?void 0:t.contextPath}/employee`;g.replace(n)},[d]);const O=()=>{b(null)},[N,I,w]=c.inputs,_=[{body:[{label:u(N.label),type:N.type,populators:{name:N.name},isMandatory:!0},{label:u(I.label),type:I.type,populators:{name:I.name},isMandatory:!0},{label:u(w.label),type:w.type,populators:{name:w.name},isMandatory:!0}]}];return l.createElement(sn,null,l.createElement("div",{className:"employeeBackbuttonAlign"},l.createElement(t.BackButton,{variant:"white",style:{borderBottom:"none"}})),l.createElement(s.FormComposer,{onSubmit:function(e){try{return Promise.resolve(G(function(){if(e.newPassword!==e.confirmPassword)return b(u("ERR_PASSWORD_DO_NOT_MATCH"));const t={...e,otpReference:f,tenantId:v,type:S().toUpperCase()};return Promise.resolve(Digit.UserService.changePassword(t,v)).then(function(e){(()=>{var e;g.replace(`/${null===(e=window)||void 0===e?void 0:e.contextPath}/employee/user/login`)})()})},function(e){var t,n,l,o,r;b((null==e||null===(t=e.response)||void 0===t||null===(n=t.data)||void 0===n||null===(l=n.error)||void 0===l||null===(o=l.fields)||void 0===o||null===(r=o[0])||void 0===r?void 0:r.message)||u("ES_SOMETHING_WRONG")),setTimeout(O,5e3)}))}catch(e){return Promise.reject(e)}},noBoxShadow:!0,inline:!0,submitInForm:!0,config:_,label:c.texts.submitButtonLabel,cardStyle:{maxWidth:"408px",margin:"auto"},className:"employeeChangePassword"},l.createElement(cn,null),l.createElement(s.CardSubHeader,{style:{textAlign:"center"}}," ",c.texts.header," "),l.createElement(t.CardText,null,u("CS_LOGIN_OTP_TEXT")+" ",l.createElement("b",null," ",""+u("+ 91 - ")," ",p)),l.createElement(K,{t:u,userType:"employee",otp:f,onOtpChange:E,error:y,onResend:function(){try{function e(){setTimeout(O,5e3)}const t={otp:{mobileNumber:p,userType:S().toUpperCase(),type:"passwordreset",tenantId:v}},n=G(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)}}})),C&&l.createElement(t.Toast,{type:"error",label:u(C),onClose:O}),l.createElement("div",{className:"EmployeeLoginFooter"},l.createElement("img",{alt:"Powered by DIGIT",src:null===(o=window)||void 0===o||null===(r=o.globalConfigs)||void 0===r||null===(i=r.getConfig)||void 0===i?void 0:i.call(r,"DIGIT_FOOTER_BW"),style:{cursor:"pointer"},onClick:()=>{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()}})," "))};un.propTypes={loginParams:an.any},un.defaultProps={loginParams:null};const dn=[{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"}]}],mn=()=>{const{t:e}=o.useTranslation(),{path:t}=a.useRouteMatch(),r=n.useMemo(()=>dn.map(t=>{const n={};for(const l in t.texts)n[l]=e(t.texts[l]);return{...t,texts:n}},[dn]));return l.createElement(a.Switch,null,l.createElement(a.Route,{path:""+t,exact:!0},l.createElement(un,{config:r[0],t:e})))},pn=[{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"}]}],vn=e=>{var o,r,i;let{config:c,t:u}=e;const{data:d,isLoading:m}=Digit.Hooks.useTenants(),[p,v]=n.useState(null),g=a.useHistory(),[f,E]=n.useState(null);n.useEffect(()=>{var e,t;if(!p)return void Digit.UserService.setType("employee");Digit.UserService.setUser(p);const n=(null===(e=location.state)||void 0===e?void 0:e.from)||`/${null===(t=window)||void 0===t?void 0:t.contextPath}/employee`;g.replace(n)},[p]);const y=()=>{E(null)},[h,C]=c.inputs,b=[{body:[{label:u(h.label),type:h.type,populators:{name:h.name,componentInFront:"+91"},isMandatory:!0},{label:u(C.label),type:C.type,populators:{name:C.name,customProps:{},component:(e,n)=>l.createElement(t.Dropdown,N({option:d,optionKey:"name",id:C.name,className:"login-city-dd",select:t=>{e.onChange(t)}},n))},isMandatory:!0}]}];return m?l.createElement(t.Loader,null):l.createElement(sn,null,l.createElement("div",{className:"employeeBackbuttonAlign"},l.createElement(t.BackLink,null)),l.createElement(s.FormComposer,{onSubmit:function(e){try{if(!e.city)return alert("Please Select City!"),Promise.resolve();const t={otp:{mobileNumber:e.mobileNumber,userType:Digit.UserService.getType().toUpperCase(),type:"passwordreset",tenantId:e.city.code}},n=G(function(){return Promise.resolve(Digit.UserService.sendOtp(t,e.city.code)).then(function(){var t;g.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,l,o,r;E((null==e||null===(t=e.response)||void 0===t||null===(n=t.data)||void 0===n||null===(l=n.error)||void 0===l||null===(o=l.fields)||void 0===o||null===(r=o[0])||void 0===r?void 0:r.message)||"Invalid login credentials!"),setTimeout(y,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:b,label:c.texts.submitButtonLabel,secondaryActionLabel:c.texts.secondaryButtonLabel,onSecondayActionClick:()=>{var e;g.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"},l.createElement(cn,null)),f&&l.createElement(t.Toast,{type:"error",label:u(f),onClose:y}),l.createElement("div",{className:"EmployeeLoginFooter"},l.createElement("img",{alt:"Powered by DIGIT",src:null===(o=window)||void 0===o||null===(r=o.globalConfigs)||void 0===r||null===(i=r.getConfig)||void 0===i?void 0:i.call(r,"DIGIT_FOOTER_BW"),style:{cursor:"pointer"},onClick:()=>{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()}})," "))};vn.propTypes={loginParams:an.any},vn.defaultProps={loginParams:null};const gn=()=>{const{t:e}=o.useTranslation(),{path:t}=a.useRouteMatch(),r=n.useMemo(()=>pn.map(t=>{const n={};for(const l in t.texts)n[l]=e(t.texts[l]);return{...t,texts:n}},[pn]));return l.createElement(a.Switch,null,l.createElement(a.Route,{path:""+t,exact:!0},l.createElement(vn,{config:r[0],t:e})))},fn=(e,t)=>t.filter(t=>{var n;return null==e||null===(n=e.map)||void 0===n?void 0:n.call(e,e=>e.code).includes(t.code)}),En=e=>{var t;let{stateCode:n,userType:o,modules:r,appTenants:i,additionalComponent:s}=e;Digit;const{path:c}=a.useRouteMatch(),u=a.useLocation(),d=Digit.UserService.getUser();var m;if(!d||null==d||!d.access_token||null==d||!d.info)return l.createElement(a.Redirect,{to:{pathname:`/${null===(m=window)||void 0===m?void 0:m.contextPath}/employee/user/login`,state:{from:u.pathname+u.search}}});const p=null==r?void 0:r.map((e,t)=>{var r;let{code:s,tenants:u}=e;const d=Digit.ComponentRegistryService.getComponent(s+"Module");return l.createElement(a.Route,{key:t,path:`${c}/${s.toLowerCase()}`},d?l.createElement(d,{stateCode:n,moduleCode:s,userType:o,tenants:fn(u,i)}):l.createElement(a.Redirect,{to:`/${null===(r=window)||void 0===r?void 0:r.contextPath}/employee/user/error?type=notfound&module=${s}`}))});return l.createElement("div",{className:"ground-container digit-home-ground"},l.createElement(a.Switch,null,p,l.createElement(a.Route,{path:c+"/login"},l.createElement(a.Redirect,{to:{pathname:`/${null===(t=window)||void 0===t?void 0:t.contextPath}/employee/user/login`,state:{from:u.pathname+u.search}}})),l.createElement(a.Route,{path:c+"/forgot-password"},l.createElement(gn,null)),l.createElement(a.Route,{path:c+"/change-password"},l.createElement(mn,null)),l.createElement(a.Route,null,l.createElement(y,{userType:o,modules:r,additionalComponent:s}))))},yn={label:"English",value:Digit.Utils.getDefaultLanguage()},hn=()=>{var e,r,i,c,u;const{data:d,isLoading:m}=Digit.Hooks.useStore.getInitData(),{t:p}=o.useTranslation(),v=a.useHistory(),{languages:g,stateInfo:f}=d||{};let E=g;E&&0!=(null===(e=E)||void 0===e?void 0:e.length)||(E=[yn]);const y=Digit.StoreData.getCurrentLanguage(),[h,C]=n.useState(y);return m?l.createElement(t.Loader,null):l.createElement(sn,null,l.createElement(t.Card,{className:"bannerCard removeBottomMargin languageSelection"},l.createElement("div",{className:"bannerHeader"},l.createElement("img",{className:"bannerLogo",src:null==f?void 0:f.logoUrl,alt:"Digit"}),l.createElement("p",null,p("TENANT_TENANTS_"+(null==f||null===(r=f.code)||void 0===r?void 0:r.toUpperCase())))),l.createElement("div",{className:"language-selector",style:{justifyContent:"space-around",marginBottom:"24px",padding:"0 5%"}},E.map((e,t)=>l.createElement("div",{className:"language-button-container",key:t},l.createElement(s.CustomButton,{selected:e.value===h,text:e.label,onClick:()=>(e=>{C(e.value),Digit.LocalizationService.changeLanguage(e.value,f.code)})(e)})))),l.createElement(t.SubmitBar,{style:{width:"100%"},label:p("CORE_COMMON_CONTINUE"),onSubmit:e=>{var t;v.push(`/${null===(t=window)||void 0===t?void 0:t.contextPath}/employee/user/login`)}})),l.createElement("div",{className:"EmployeeLoginFooter"},l.createElement("img",{alt:"Powered by DIGIT",src:null===(i=window)||void 0===i||null===(c=i.globalConfigs)||void 0===c||null===(u=c.getConfig)||void 0===u?void 0:u.call(c,"DIGIT_FOOTER_BW"),style:{cursor:"pointer"},onClick:()=>{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()}})," "))},Cn=[{texts:{header:"CORE_COMMON_LOGIN",submitButtonLabel:"CORE_COMMON_CONTINUE",secondaryButtonLabel:"CORE_COMMON_FORGOT_PASSWORD"},inputs:[{label:"CORE_LOGIN_USERNAME",type:"text",key:"username",isMandatory:!0,populators:{name:"username",validation:{required:!0},error:"ERR_USERNAME_REQUIRED"}},{label:"CORE_LOGIN_PASSWORD",type:"password",key:"password",isMandatory:!0,populators:{name:"password",validation:{required:!0},error:"ERR_PASSWORD_REQUIRED"}},{isMandatory:!0,type:"dropdown",key:"city",label:"CORE_COMMON_CITY",disable:!1,populators:{name:"city",optionsKey:"name",error:"ERR_HRMS_INVALID_CITY",mdmsConfig:{masterName:"tenants",moduleName:"tenant",localePrefix:"TENANT_TENANTS",select:"(data)=>{ return Array.isArray(data['tenant'].tenants) && Digit.Utils.getUnique(data['tenant'].tenants).map(ele=>({code:ele.code,name:Digit.Utils.locale.getTransformedLocale('TENANT_TENANTS_'+ele.code)}))}"}}}]}],bn=[{texts:{header:"CORE_COMMON_LOGIN",submitButtonLabel:"CORE_COMMON_CONTINUE"},inputs:[{label:"CORE_SIGNUP_EMAILID",type:"text",key:"email",isMandatory:!0,populators:{name:"email",validation:{required:!0,pattern:/^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$/},error:"ERR_EMAIL_REQUIRED"}},{isMandatory:!1,key:"check",type:"component",component:"PrivacyComponent",withoutLabel:!0,disable:!1,customProps:{module:"Sandbox"},populators:{name:"check"}}]}],Sn=e=>{var o,r,i,s,c,u,d,m,p,v,g,f,E;let{config:y,t:h,isDisabled:C,loginOTPBased:b}=e;const{isLoading:S}=Digit.Hooks.useTenants(),{isLoading:O}=Digit.Hooks.useStore.getInitData(),[N,I]=n.useState(null),[w,_]=n.useState(null),[D,T]=n.useState(!1),L=a.useHistory();n.useEffect(()=>{var e,t,n,l,o,r,i,a,s,c,u,d,m,p,v,g,f,E;if(!N)return;Digit.SessionStorage.set("citizen.userRequestObject",N);const y=null==N||null===(e=N.info)||void 0===e||null===(t=e.roles)||void 0===t?void 0:t.filter(e=>e.tenantId===Digit.SessionStorage.get("Employee.tenantId"));(null==N||null===(n=N.info)||void 0===n||null===(l=n.roles)||void 0===l?void 0:l.length)>0&&(N.info.roles=y),Digit.UserService.setUser(N),((e,t)=>{var n;let l=(null===(n=JSON.parse(sessionStorage.getItem("Digit.locale")))||void 0===n?void 0:n.value)||Digit.Utils.getDefaultLanguage();localStorage.setItem("Employee.tenant-id",null==e?void 0:e.tenantId),localStorage.setItem("tenant-id",null==e?void 0:e.tenantId),localStorage.setItem("citizen.userRequestObject",JSON.stringify(e)),localStorage.setItem("locale",l),localStorage.setItem("Employee.locale",l),localStorage.setItem("token",t),localStorage.setItem("Employee.token",t),localStorage.setItem("user-info",JSON.stringify(e)),localStorage.setItem("Employee.user-info",JSON.stringify(e))})(null==N?void 0:N.info,null==N?void 0:N.access_token);let h=`/${null===(o=window)||void 0===o?void 0:o.contextPath}/employee`;var C,b,S,O,I,w,_;null!==(r=window)&&void 0!==r&&null!==(i=r.location)&&void 0!==i&&null!==(a=i.href)&&void 0!==a&&a.includes("from=")&&(h=decodeURIComponent(null===(C=window)||void 0===C||null===(b=C.location)||void 0===b||null===(S=b.href)||void 0===S||null===(O=S.split("from="))||void 0===O?void 0:O[1])||`/${null===(I=window)||void 0===I?void 0:I.contextPath}/employee`),null!=N&&null!==(s=N.info)&&void 0!==s&&s.roles&&(null==N||null===(c=N.info)||void 0===c||null===(u=c.roles)||void 0===u?void 0:u.length)>0&&null!=N&&null!==(d=N.info)&&void 0!==d&&null!==(m=d.roles)&&void 0!==m&&m.every(e=>"NATADMIN"===e.code)&&(h=`/${null===(w=window)||void 0===w?void 0:w.contextPath}/employee/dss/landing/NURT_DASHBOARD`),null!=N&&null!==(p=N.info)&&void 0!==p&&p.roles&&(null==N||null===(v=N.info)||void 0===v||null===(g=v.roles)||void 0===g?void 0:g.length)>0&&null!=N&&null!==(f=N.info)&&void 0!==f&&null!==(E=f.roles)&&void 0!==E&&E.every(e=>"STADMIN"===e.code)&&(h=`/${null===(_=window)||void 0===_?void 0:_.contextPath}/employee/dss/landing/home`),L.replace(h)},[N]);const R={url:"/user-otp/v1/_send",params:{tenantId:Digit.ULBService.getStateId()},body:{},config:{enable:!1}},P=Digit.Hooks.useCustomAPIMutationHook(R),A=()=>{_(null)},x={code:Digit.ULBService.getStateId(),name:Digit.Utils.locale.getTransformedLocale("TENANT_TENANTS_"+Digit.ULBService.getStateId())};let M=[{body:null==y?void 0:y.inputs}];const{mode:k}=Digit.Hooks.useQueryParams();return"admin"===k&&0==(null==M||null===(o=M[0])||void 0===o||null===(r=o.body)||void 0===r||null===(i=r[2])||void 0===i?void 0:i.disable)&&null==(null==M||null===(s=M[0])||void 0===s||null===(c=s.body)||void 0===c||null===(u=c[2])||void 0===u||null===(d=u.populators)||void 0===d?void 0:d.defaultValue)&&(M[0].body[2].disable=!0,M[0].body[2].isMandatory=!1,M[0].body[2].populators.defaultValue=x),S||O?l.createElement(t.Loader,null):l.createElement(sn,null,l.createElement("div",{className:"employeeBackbuttonAlign"},l.createElement(t.BackLink,null)),l.createElement(t.FormComposerV2,{onSubmit:b?function(e){try{const t=e.email;return Promise.resolve(P.mutate({body:{otp:{userName:e.email,type:"login",tenantId:Digit.ULBService.getStateId(),userType:"EMPLOYEE"}},config:{enable:!0}},{onError:(e,t)=>{var n,l,o,r,i,a,s;_({key:"error",label:null!=e&&null!==(n=e.response)&&void 0!==n&&null!==(l=n.data)&&void 0!==l&&null!==(o=l.Errors)&&void 0!==o&&o[0].code?"SANDBOX_RESEND_OTP"+(null==e||null===(r=e.response)||void 0===r||null===(i=r.data)||void 0===i||null===(a=i.Errors)||void 0===a||null===(s=a[0])||void 0===s?void 0:s.code):"SANDBOX_RESEND_OTP_ERROR"}),setTimeout(A,5e3)},onSuccess:function(e){try{var n;return L.push({pathname:`/${null===(n=window)||void 0===n?void 0:n.contextPath}/employee/user/login/otp`,state:{email:t,tenant:Digit.ULBService.getStateId()}}),Promise.resolve()}catch(e){return Promise.reject(e)}}})).then(function(){})}catch(e){return Promise.reject(e)}}:function(e){try{var t;function n(){T(!1)}T(!0);const l={...e,userType:"EMPLOYEE"};l.tenantId=(null==e||null===(t=e.city)||void 0===t?void 0:t.code)||Digit.ULBService.getStateId(),delete l.city;const o=G(function(){return Promise.resolve(Digit.UserService.authenticate(l)).then(function(e){let{UserRequest:t,...n}=e;Digit.SessionStorage.set("Employee.tenantId",null==t?void 0:t.tenantId),I({info:t,...n})})},function(e){var t,n;_((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)&&h("ES_ERROR_USER_NOT_PERMITTED")||h("INVALID_LOGIN_CREDENTIALS")),setTimeout(A,5e3)});return Promise.resolve(o&&o.then?o.then(n):n())}catch(e){return Promise.reject(e)}},isDisabled:C||D,noBoxShadow:!0,inline:!0,submitInForm:!0,config:M,label:null==y||null===(m=y.texts)||void 0===m?void 0:m.submitButtonLabel,secondaryActionLabel:null==y||null===(p=y.texts)||void 0===p?void 0:p.secondaryButtonLabel,onSecondayActionClick:()=>{var e;L.push(`/${null===(e=window)||void 0===e?void 0:e.contextPath}/employee/user/forgot-password`)},onFormValueChange:(e,t,n)=>{const l=M[0].body.map(e=>e.key).some(e=>{const n=t[e];return null==n||""===n||"check"===e&&!1===n||"captcha"===e&&!1===n});T(l)},heading:null==y||null===(v=y.texts)||void 0===v?void 0:v.header,className:"loginFormStyleEmployee "+(b?"sandbox-onboarding-wrapper":""),cardSubHeaderClassName:"loginCardSubHeaderClassName",cardClassName:"loginCardClassName",buttonClassName:"buttonClassName"},l.createElement(cn,null)),w&&l.createElement(t.Toast,{type:"error",label:h(w),onClose:A}),l.createElement("div",{className:"employee-login-home-footer",style:{backgroundColor:"unset"}},l.createElement("img",{alt:"Powered by DIGIT",src:null===(g=window)||void 0===g||null===(f=g.globalConfigs)||void 0===f||null===(E=f.getConfig)||void 0===E?void 0:E.call(f,"DIGIT_FOOTER_BW"),style:{cursor:"pointer"},onClick:()=>{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()}})," "))};Sn.propTypes={loginParams:an.any},Sn.defaultProps={loginParams:null};const On=e=>{var t,r;let{stateCode:i}=e;const{t:s}=o.useTranslation(),{path:c}=a.useRouteMatch(),[u,d]=n.useState(Cn),[m,p]=n.useState(bn),v=Digit.StoreData.getCurrentLanguage(),g=(null===(t=window)||void 0===t||null===(r=t.globalConfigs)||void 0===r?void 0:r.getConfig("OTP_BASED_LOGIN"))||!1,{data:f,isLoading:E}=(Digit.Services.useStore({stateCode:i,moduleCode:["privacy-policy"],language:v,modulePrefix:"digit"}),Digit.Hooks.useCommonMDMS(i,"commonUiConfig",["LoginConfig"],{select:e=>{var t;return{config:null==e||null===(t=e.commonUiConfig)||void 0===t?void 0:t.LoginConfig}},retry:!1}));n.useEffect(()=>{d(0==E&&null!=f&&f.config?null==f?void 0:f.config:Cn)},[f,E]);const y=n.useMemo(()=>u.map(e=>{const t={};for(const n in e.texts)t[n]=s(e.texts[n]);return{...e,texts:t}},[u])),h=n.useMemo(()=>m.map(e=>{const t={};for(const n in e.texts)t[n]=s(e.texts[n]);return{...e,texts:t}},[m]));return l.createElement(a.Switch,null,l.createElement(a.Route,{path:""+c,exact:!0},l.createElement(Sn,g?{config:h[0],t:s,loginOTPBased:g}:{config:y[0],t:s})))},Nn=[{texts:{header:"CORE_COMMON_SIGN_UP",submitButtonLabel:"CORE_COMMON_SIGN_UP_BUTTON"},inputs:[{label:"CORE_SIGNUP_EMAILID",type:"text",key:"email",isMandatory:!0,populators:{name:"email",validation:{required:!0,pattern:/^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$/},error:"ERR_EMAIL_REQUIRED"}},{label:"CORE_SIGNUP_ACCOUNT_NAME",type:"text",key:"accountName",isMandatory:!0,populators:{name:"accountName",validation:{required:!0,patter:/^[A-Za-z][A-Za-z-' ]*[A-Za-z]$/},error:"ERR_ACCOUNT_NAME_REQUIRED"}},{isMandatory:!1,key:"check",type:"component",component:"PrivacyComponent",withoutLabel:!0,disable:!1,customProps:{module:"SandboxSignUp"},populators:{name:"check"}}]}],In=e=>{var o,r,i,s,c,u,d,m,p,v,g,f,E;let{config:y,t:h,isDisabled:C}=e;const{isLoading:b}=Digit.Hooks.useTenants(),{isLoading:S}=Digit.Hooks.useStore.getInitData(),[O,N]=n.useState(null),[I,w]=n.useState(!1),_=a.useHistory(),D=Digit.Hooks.useCustomAPIMutationHook({url:"/tenant-management/tenant/_create",params:{},body:{},config:{enable:!1}});let T=[{body:null==y?void 0:y.inputs}];const{mode:L}=Digit.Hooks.useQueryParams();return"admin"===L&&0==(null==T||null===(o=T[0])||void 0===o||null===(r=o.body)||void 0===r||null===(i=r[2])||void 0===i?void 0:i.disable)&&null==(null==T||null===(s=T[0])||void 0===s||null===(c=s.body)||void 0===c||null===(u=c[2])||void 0===u||null===(d=u.populators)||void 0===d?void 0:d.defaultValue)&&(T[0].body[2].disable=!0,T[0].body[2].isMandatory=!1,T[0].body[2].populators.defaultValue=defaultValue),b||S?l.createElement(t.Loader,null):l.createElement(sn,null,l.createElement("div",{className:"employeeBackbuttonAlign"},l.createElement(t.BackLink,null)),l.createElement(t.FormComposerV2,{onSubmit:function(e){try{return Promise.resolve(D.mutate({body:{tenant:{name:e.accountName,email:e.email}},config:{enable:!0}},{onError:(e,t)=>{var n,l,o,r,i,a,s,c;N({key:"error",label:null!=e&&null!==(n=e.response)&&void 0!==n&&null!==(l=n.data)&&void 0!==l&&null!==(o=l.Errors)&&void 0!==o&&null!==(r=o[0])&&void 0!==r&&r.code?"SANDBOX_SIGNUP_"+(null==e||null===(i=e.response)||void 0===i||null===(a=i.data)||void 0===a||null===(s=a.Errors)||void 0===s||null===(c=s[0])||void 0===c?void 0:c.code):"SANDBOX_SIGNUP_ERROR"})},onSuccess:function(e){try{var t,n,l;return _.push({pathname:`/${null===(t=window)||void 0===t?void 0:t.globalPath}/user/otp`,state:{email:null==e||null===(n=e.Tenants[0])||void 0===n?void 0:n.email,tenant:null==e||null===(l=e.Tenants[0])||void 0===l?void 0:l.code}}),Promise.resolve()}catch(e){return Promise.reject(e)}}})).then(function(){})}catch(e){return Promise.reject(e)}},isDisabled:C||I,noBoxShadow:!0,inline:!0,submitInForm:!0,config:T,label:null==y||null===(m=y.texts)||void 0===m?void 0:m.submitButtonLabel,secondaryActionLabel:null==y||null===(p=y.texts)||void 0===p?void 0:p.secondaryButtonLabel,onFormValueChange:(e,t,n)=>{const l=T[0].body.map(e=>e.key).some(e=>{const n=t[e];return null==n||""===n||"check"===e&&!1===n||"captcha"===e&&!1===n});w(l)},heading:null==y||null===(v=y.texts)||void 0===v?void 0:v.header,className:"sandbox-signup-form",cardSubHeaderClassName:"signupCardSubHeaderClassName",cardClassName:"signupCardClassName sandbox-onboarding-wrapper",buttonClassName:"buttonClassName"},l.createElement(cn,{showTenant:!1})),O&&l.createElement(t.Toast,{type:"error",label:h(null==O?void 0:O.label),onClose:()=>{N(null)}}),l.createElement("div",{className:"employee-login-home-footer",style:{backgroundColor:"unset"}},l.createElement("img",{alt:"Powered by DIGIT",src:null===(g=window)||void 0===g||null===(f=g.globalConfigs)||void 0===f||null===(E=f.getConfig)||void 0===E?void 0:E.call(f,"DIGIT_FOOTER_BW"),style:{cursor:"pointer"},onClick:()=>{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()}})))};In.propTypes={loginParams:an.any},In.defaultProps={loginParams:null};const wn=e=>{let{stateCode:t}=e;const{t:r}=o.useTranslation(),{path:i}=a.useRouteMatch(),[s,c]=n.useState(Nn),u=Digit.StoreData.getCurrentLanguage(),{data:d,isLoading:m}=(Digit.Services.useStore({stateCode:t,moduleCode:["privacy-policy"],language:u,modulePrefix:"digit"}),Digit.Hooks.useCommonMDMS(t,"commonUiConfig",["SignUpConfig"],{select:e=>{var t;return{config:null==e||null===(t=e.commonUiConfig)||void 0===t?void 0:t.SignUpConfig}},retry:!1}));n.useEffect(()=>{c(0==m&&null!=d&&d.config?null==d?void 0:d.config:Nn)},[d,m]);const p=n.useMemo(()=>s.map(e=>{const t={};for(const n in e.texts)t[n]=r(e.texts[n]);return{...e,texts:t}},[s]));return l.createElement(a.Switch,null,l.createElement(a.Route,{path:""+i,exact:!0},l.createElement(In,{config:p[0],t:r})))},_n=e=>{var r,i,c,u;let{isLogin:d=!1}=e;const{t:m}=o.useTranslation(),p=(a.useRouteMatch(),a.useHistory()),v=a.useLocation(),[g,f]=n.useState(null),[E,y]=n.useState(!1),[h,C]=n.useState(null),[b,S]=n.useState((null==v||null===(r=v.state)||void 0===r?void 0:r.data)||{}),{email:O,tenant:N}=v.state||{},I=[{body:[{type:"component",component:"OtpComponent",key:"OtpComponent",withoutLabel:!0,isMandatory:!1,customProps:{email:O,tenant:N},populators:{required:!0}}]}],w=[{texts:{header:m("SANDBOX_OTP_VERIFICATION"),submitButtonLabel:"CORE_COMMON_SUBMIT"}}],_=()=>{f(null)};return n.useEffect(()=>{var e,t,n,l,o,r;if(!h)return;Digit.SessionStorage.set("citizen.userRequestObject",h);const i=null==h||null===(e=h.info)||void 0===e||null===(t=e.roles)||void 0===t?void 0:t.filter(e=>e.tenantId===Digit.SessionStorage.get("Employee.tenantId"));(null==h||null===(n=h.info)||void 0===n||null===(l=n.roles)||void 0===l?void 0:l.length)>0&&(h.info.roles=i),Digit.UserService.setUser(h),((e,t)=>{var n;let l=(null===(n=JSON.parse(sessionStorage.getItem("Digit.locale")))||void 0===n?void 0:n.value)||Digit.Utils.getDefaultLanguage();localStorage.setItem("Employee.tenant-id",null==e?void 0:e.tenantId),localStorage.setItem("tenant-id",null==e?void 0:e.tenantId),localStorage.setItem("citizen.userRequestObject",JSON.stringify(e)),localStorage.setItem("locale",l),localStorage.setItem("Employee.locale",l),localStorage.setItem("token",t),localStorage.setItem("Employee.token",t),localStorage.setItem("user-info",JSON.stringify(e)),localStorage.setItem("Employee.user-info",JSON.stringify(e))})(null==h?void 0:h.info,null==h?void 0:h.access_token);let a=`/${null===(o=window)||void 0===o?void 0:o.globalPath}/user/url`,s=`/${null===(r=window)||void 0===r?void 0:r.contextPath}/employee`;return d?void p.push(s):void p.push({pathname:a,state:{tenant:N}})},[h]),l.createElement(sn,null,l.createElement("div",{className:"employeeBackbuttonAlign"},l.createElement(t.BackLink,null)),l.createElement(s.FormComposerV2,{onSubmit:function(e){try{var t;const n={username:O,password:null==e||null===(t=e.OtpComponent)||void 0===t?void 0:t.otp,tenantId:N,userType:"EMPLOYEE"},l=G(function(){return Promise.resolve(Digit.UserService.authenticate(n)).then(function(e){let{UserRequest:t,...n}=e;Digit.SessionStorage.set("Employee.tenantId",null==t?void 0:t.tenantId),C({info:t,...n})})},function(e){var t,n;f((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)&&m("ES_ERROR_USER_NOT_PERMITTED")||m("INVALID_LOGIN_CREDENTIALS")),setTimeout(_,5e3)});return Promise.resolve(l&&l.then?l.then(function(){}):void 0)}catch(e){return Promise.reject(e)}},noBoxShadow:!0,inline:!0,submitInForm:!0,onFormValueChange:(e,t)=>{var n;const l=t.OtpComponent;6===(null==l||null===(n=l.otp)||void 0===n?void 0:n.length)?y(!0):y(!1)},isDisabled:!E,config:I,label:w[0].texts.submitButtonLabel,heading:w[0].texts.header,headingStyle:{textAlign:"center"},cardStyle:{maxWidth:"408px",margin:"auto"},className:"sandbox-onboarding-wrapper"},l.createElement(cn,{showTenant:!1})),g&&l.createElement(t.Toast,{type:"error",label:m(g),onClose:_}),l.createElement("div",{className:"EmployeeLoginFooter"},l.createElement("img",{alt:"Powered by DIGIT",src:null===(i=window)||void 0===i||null===(c=i.globalConfigs)||void 0===c||null===(u=c.getConfig)||void 0===u?void 0:u.call(c,"DIGIT_FOOTER_BW"),style:{cursor:"pointer"},onClick:()=>{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=()=>{var e,n,r,i;const{t:s}=o.useTranslation(),c=a.useLocation(),{tenant:u}=c.state||{};return a.useHistory(),l.createElement(sn,null,l.createElement("div",{className:"employeeBackbuttonAlign"},l.createElement(t.BackLink,null)),l.createElement(t.Card,{className:"card-sandbox"},l.createElement(cn,{showTenant:!1}),l.createElement("div",{className:"sandbox-success-signup"},l.createElement(t.SVG.TickMark,{fill:"#fff",height:40,width:60})),l.createElement(t.CardHeader,{className:"cardHeader-sandbox",styles:{color:"#00703c"}},s("SANDBOX_HEADER")),l.createElement(t.CardText,{className:"cardText-sandbox"},s("SAMDBOX_URL_SUB")),l.createElement(t.FieldV1,{className:"field-sandbox",withoutLabel:!1,label:s("SANDBOX_URL"),type:"text",nonEditable:!1,value:`${window.location.host}/${null===(e=window)||void 0===e?void 0:e.globalPath}/${u}`,placeholder:s("SANDBOX_URL_PLACEHOLDER"),populators:{}}),l.createElement("div",{className:"sandbox-url-footer"},s("SANDBOX_URL_FOOT")),l.createElement(t.Button,{onClick:()=>{var e;window.location.href=`/${null===(e=window)||void 0===e?void 0:e.globalPath}/${u}/employee`},label:s("SIGN_IN")})),l.createElement("div",{className:"EmployeeLoginFooter"},l.createElement("img",{alt:"Powered by DIGIT",src:null===(n=window)||void 0===n||null===(r=n.globalConfigs)||void 0===r||null===(i=r.getConfig)||void 0===i?void 0:i.call(r,"DIGIT_FOOTER_BW"),style:{cursor:"pointer"},onClick:()=>{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()}})))},Tn=["user/profile","user/error"],Ln=e=>{var r,i,s,c,u,d;let{stateInfo:p,userDetails:g,CITIZEN:f,cityDetails:E,mobileView:y,handleUserDropdownSelection:h,logoUrl:C,DSO:b,stateCode:S,modules:O,appTenants:N,initData:I}=e;const w=a.useHistory(),{t:_}=o.useTranslation(),{path:D}=a.useRouteMatch(),T=a.useLocation(),L=null==T||null===(r=T.pathname)||void 0===r?void 0:r.includes("language-selection"),R=Tn.some(e=>{var t;return null==T||null===(t=T.pathname)||void 0===t?void 0:t.includes(e)});n.useEffect(()=>{Digit.UserService.setType("employee")},[]);const P=null==I||null===(i=I.modules)||void 0===i||null===(s=i.filter(e=>null==e?void 0:e.additionalComponent))||void 0===s?void 0:s.map(e=>null==e?void 0:e.additionalComponent);return l.createElement("div",{className:"employee"},l.createElement(a.Switch,null,l.createElement(a.Route,{path:D+"/user"},R&&l.createElement(A,{t:_,stateInfo:p,userDetails:g,CITIZEN:f,cityDetails:E,mobileView:y,handleUserDropdownSelection:h,logoUrl:C,showSidebar:!!R,showLanguageChange:!L}),l.createElement("div",{className:R?"grounded-container":"loginContainer",style:R?{padding:0,paddingTop:"80px",marginLeft:y?"":"64px"}:{"--banner-url":`url(${null==p?void 0:p.bannerUrl})`,padding:"0px"}},l.createElement(a.Switch,null,l.createElement(a.Route,{exact:!0,path:D+"/user/login"},l.createElement(On,{stateCode:S})),l.createElement(a.Route,{exact:!0,path:D+"/user/login/otp"},l.createElement(_n,{isLogin:!0})),l.createElement(a.Route,{path:D+"/user/forgot-password"},l.createElement(gn,null)),l.createElement(a.Route,{path:D+"/user/change-password"},l.createElement(mn,null)),l.createElement(t.PrivateRoute,{path:D+"/user/profile"},l.createElement(W,{stateCode:S,userType:"employee",cityDetails:E})),l.createElement(a.Route,{path:D+"/user/error"},l.createElement(m,{initData:I,goToHome:()=>{var e,t,n,l;w.push(`/${null===(e=window)||void 0===e?void 0:e.contextPath}/${null===(t=Digit)||void 0===t||null===(n=t.UserService)||void 0===n||null===(l=n.getType)||void 0===l?void 0:l.call(n)}`)}})),l.createElement(a.Route,{path:D+"/user/language-selection"},l.createElement(hn,null)),l.createElement(a.Route,null,l.createElement(a.Redirect,{to:D+"/user/language-selection"}))))),l.createElement(a.Route,null,l.createElement(A,{t:_,stateInfo:p,userDetails:g,CITIZEN:f,cityDetails:E,mobileView:y,handleUserDropdownSelection:h,logoUrl:C,modules:O}),l.createElement("div",{className:`main ${b?"m-auto":""} digit-home-main`},l.createElement("div",{className:"employee-app-wrapper digit-home-app-wrapper"},l.createElement(v,{initData:I},l.createElement(En,{stateCode:S,userType:"employee",modules:O,appTenants:N,additionalComponent:P}))),l.createElement("div",{className:"employee-home-footer"},l.createElement("img",{alt:"Powered by DIGIT",src:null===(c=window)||void 0===c||null===(u=c.globalConfigs)||void 0===u||null===(d=u.getConfig)||void 0===d?void 0:d.call(u,"DIGIT_FOOTER"),style:{height:"1.1em",cursor:"pointer"},onClick:()=>{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()}})))),l.createElement(a.Route,null,l.createElement(a.Redirect,{to:D+"/user/language-selection"}))))},Rn=e=>{var t,o,r,i;let{stateCode:s,modules:c,appTenants:u,logoUrl:d,initData:m,defaultLanding:p="citizen"}=e;const v=a.useHistory(),{pathname:g}=a.useLocation(),f=window.innerWidth,E=Digit.ULBService.getCurrentUlb(),y=Digit.UserService.getUser(),{data:h}=Digit.Hooks.useStore.getInitData(),{stateInfo:C}=h||{},b=Digit.UserService.hasAccess(["FSM_DSO"]);let S="CITIZEN"===(null==y||null===(t=y.info)||void 0===t?void 0:t.type)||!window.location.pathname.split("/").includes("employee");window.location.pathname.split("/").includes("employee")&&(S=!1),n.useEffect(()=>{var e,t,n;null!=g&&g.includes("application-details")||(null!=g&&g.includes("inbox")||Digit.SessionStorage.del("fsm/inbox/searchParams"),null!=g&&g.includes("search")&&Digit.SessionStorage.del("fsm/search/searchParams")),null!=g&&g.includes("dss")||Digit.SessionStorage.del("DSS_FILTERS"),(null==g?void 0:g.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==g?void 0:g.toString())!==`/${null===(t=window)||void 0===t?void 0:t.contextPath}/citizen`&&(null==g?void 0:g.toString())!==`/${null===(n=window)||void 0===n?void 0:n.contextPath}/employee`||Digit.SessionStorage.del("WS_DISCONNECTION")},[g]),v.listen(()=>{var e;null===(e=window)||void 0===e||e.scrollTo({top:0,left:0,behavior:"smooth"})});const O={stateInfo:C,userDetails:y,CITIZEN:S,cityDetails:E,mobileView:f<=640,handleUserDropdownSelection:e=>{e.func()},logoUrl:d,DSO:b,stateCode:s,modules:c,appTenants:u,sourceUrl:window.location.origin+"/citizen",pathname:g,initData:m};return l.createElement(a.Switch,null,l.createElement(a.Route,{path:`/${null===(o=window)||void 0===o?void 0:o.contextPath}/employee`},l.createElement(Ln,O)),l.createElement(a.Route,{path:`/${null===(r=window)||void 0===r?void 0:r.contextPath}/citizen`},l.createElement(Et,O)),l.createElement(a.Route,null,l.createElement(a.Redirect,{to:`/${null===(i=window)||void 0===i?void 0:i.contextPath}/${p}`})))},Pn=e=>{var t,n,o,r,i,s,c;let{stateCode:u,modules:d,appTenants:m,logoUrl:p,initData:v,defaultLanding:g="citizen"}=e;const{data:f}=Digit.Hooks.useStore.getInitData(),{stateInfo:E}=f||{},y=["user/profile","user/error"].some(e=>{var t,n;return null===(t=location)||void 0===t||null===(n=t.pathname)||void 0===n?void 0:n.includes(e)});return l.createElement("div",{className:y?"grounded-container":"loginContainer",style:y?{padding:0,paddingTop:"80px",marginLeft:"64px"}:{"--banner-url":`url(${null==E?void 0:E.bannerUrl})`,padding:"0px"}},l.createElement(a.Switch,null,l.createElement(a.Route,{exact:!0,path:`/${null===(t=window)||void 0===t?void 0:t.globalPath}/user/sign-up`},l.createElement(wn,{stateCode:u})),l.createElement(a.Route,{exact:!0,path:`/${null===(n=window)||void 0===n?void 0:n.globalPath}/user/otp`},l.createElement(_n,null)),l.createElement(a.Route,{exact:!0,path:`/${null===(o=window)||void 0===o?void 0:o.globalPath}/user/url`},l.createElement(Dn,null)),(null===(r=window)||void 0===r?void 0:r.globalPath)!==(null===(i=window)||void 0===i?void 0:i.contextPath)&&l.createElement(a.Route,{path:"/"+(null===(s=window)||void 0===s?void 0:s.contextPath)},l.createElement(Rn,{stateCode:u,modules:d,appTenants:m,logoUrl:p,initData:v,defaultLanding:g})),l.createElement(a.Route,null,l.createElement(a.Redirect,{to:`/${null===(c=window)||void 0===c?void 0:c.globalPath}/user/sign-up`}))))},An=[u],xn=("object"==typeof window&&window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__?window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__({}):c.compose)(c.applyMiddleware(...An)),Mn=e=>{let{onSelect:r,...i}=e;const{t:a}=o.useTranslation(),s=Digit.ULBService.getCurrentTenantId(),[c,u]=n.useState(!1),[d,m]=n.useState(!1),{data:p}=Digit.Hooks.useCustomMDMS(s,"commonUiConfig",[{name:"PrivacyPolicy"}],{select:e=>{var t;return null==e||null===(t=e.commonUiConfig)||void 0===t?void 0:t.PrivacyPolicy.find(e=>{var t;return e.module===(null==i||null===(t=i.props)||void 0===t?void 0:t.module)})}});return n.useEffect(()=>{r("check",c)},[c]),l.createElement(l.Fragment,null,l.createElement("div",{className:"digit-privacy-checkbox"},l.createElement(t.CheckBox,{label:a("ES_BY_CLICKING"),checked:c,onChange:e=>{u(e.target.checked)}}),l.createElement(t.Button,{label:a("ES_PRIVACY_POLICY"),variation:"link",size:"medium",onClick:()=>{m(!0)},style:{marginBottom:"1.18rem",paddingLeft:"0.2rem"}})),d&&l.createElement(t.PopUp,{type:"default",className:"privacy-popUpClass",footerclassName:"popUpFooter",heading:a(null==p?void 0:p.header),onOverlayClick:()=>{m(!1)},footerChildren:[l.createElement(t.Button,{type:"button",size:"large",variation:"secondary",label:a("DIGIT_I_DO_NOT_ACCEPT"),onClick:()=>{u(!1),m(!1)}}),l.createElement(t.Button,{type:"button",size:"large",variation:"primary",label:a("DIGIT_I_ACCEPT"),className:"accept-class",onClick:()=>{u(!0),m(!1)}})],sortFooterChildren:!0,onClose:()=>{m(!1)}},l.createElement("div",null,l.createElement("div",{className:"privacy-table"},a("DIGIT_TABLE_OF_CONTENTS")),l.createElement("ul",null,null==p?void 0:p.contents.map((e,n)=>l.createElement("li",{key:n,style:{display:"flex",alignItems:"center"}},l.createElement("span",{style:{marginRight:"0.5rem"}},n+1,". "),l.createElement(t.Button,{label:a(e.header),variation:"link",size:"medium",onClick:t=>{t.preventDefault(),(e=>{const t=document.getElementById(e);t&&t.scrollIntoView({behavior:"smooth"})})(null==e?void 0:e.header)}}))))),null==p?void 0:p.contents.map((e,t)=>l.createElement("div",{key:t,id:null==e?void 0:e.header},l.createElement("div",{style:{fontWeight:"bold",paddingLeft:null!=e&&e.isSpaceRequired?"1rem":"0"}},a(e.header)),e.descriptions.map((e,t)=>l.createElement("div",{key:t,style:{paddingLeft:e.isSpaceRequired?"1rem":"0",marginBottom:"0.5rem"}},l.createElement("div",{style:{fontWeight:null!=e&&e.isBold?700:400,display:"flex",alignItems:"center"}},"points"===e.type&&l.createElement("span",{style:{marginRight:"0.5rem",listStyleType:"disc"}},"•"),"step"===e.type&&l.createElement("span",{style:{marginRight:"0.5rem",listStyleType:"decimal"}},t+1,". "),a(e.text)),(null==e?void 0:e.subDescriptions)&&(null==e?void 0:e.subDescriptions.length)>0&&l.createElement("div",{className:"policy-subdescription"},e.subDescriptions.map((e,t)=>l.createElement("div",{key:t,className:"policy-subdescription-points"},"points"===e.type&&l.createElement("span",{style:{marginRight:"0.5rem",listStyleType:"disc",paddingLeft:"1rem"}},"•"),"step"===e.type&&l.createElement("span",{style:{marginRight:"0.5rem",listStyleType:"decimal",paddingLeft:"1rem"}},t+1,". "),null===e.type&&l.createElement("span",{style:{marginRight:"0.5rem",paddingLeft:"1rem"}}," "),a(e.text))))))))))},kn=e=>{var n;let{stateCode:r,enabledModules:s,moduleReducers:u,defaultLanding:d}=e;const{isLoading:m,data:p={}}=Digit.Hooks.useInitStore(r,s);if(m)return l.createElement(t.Loader,{page:!0});const v=function(e,t){return void 0===t&&(t={}),c.createStore(((e,t)=>{return c.combineReducers({common:(n=e,function(e,t){switch(void 0===e&&(e=n),t.type){case"LANGUAGE_SELECT":return{...e,selectedLanguage:t.payload};default:return e}}),...t});var n})(e,t),xn)}(p,u(p))||{};return o.getI18n(),Digit.ComponentRegistryService.getComponent("PrivacyComponent")||Digit.ComponentRegistryService.setComponent("PrivacyComponent",Mn),l.createElement(i.Provider,{store:v},l.createElement(a.BrowserRouter,null,l.createElement(t.BodyContainer,null,l.createElement(Pn,{initData:p,stateCode:r,modules:null==p?void 0:p.modules,appTenants:p.tenants,logoUrl:null==p||null===(n=p.stateInfo)||void 0===n?void 0:n.logoUrl,defaultLanding:d}))))},Un={SelectOtp:K,ChangeCity:C,ChangeLanguage:b,PrivacyComponent:Mn,OtpComponent:e=>{var r,i;let{onSelect:c,...u}=e;const{t:d}=o.useTranslation(),[m,p]=(a.useLocation(),n.useState(null)),[v,g]=n.useState({}),[f,E]=n.useState(!0),[y,h]=n.useState(30),C=()=>{p(null)};J(()=>{h(y-1)},y>0?1e3:null),n.useEffect(()=>{c("OtpComponent",v)},[v]);const b={url:"/user-otp/v1/_send",params:{tenantId:null==u||null===(r=u.props)||void 0===r?void 0:r.code},body:{},config:{enable:!1}},S=Digit.Hooks.useCustomAPIMutationHook(b);return l.createElement(n.Fragment,null,l.createElement(t.CardLabel,{className:"sandbox-custom-otp-header"},d("CS_OTP_EMAIL")),l.createElement(t.CardLabel,{className:"sandbox-custom-otp-email"},null==u||null===(i=u.props)||void 0===i?void 0:i.email),l.createElement(t.CardLabel,{className:"sandbox-custom-otp-subheader"},d("SANDBOX_ENTER_OTP")),l.createElement(s.OTPInput,{className:"sandbox-otp-input",length:6,onChange:e=>{g({...v,otp:e})},value:null==v?void 0:v.otp}),y>0?l.createElement(t.CardText,{className:"sandbox-resend-otp"},`${d("CS_RESEND_ANOTHER_OTP")} ${y} ${d("CS_RESEND_SECONDS")}`):l.createElement("p",{className:"card-text-button sandbox-otp-input",onClick:function(){try{var e,t;return h(30),Promise.resolve(S.mutate({body:{otp:{userName:null==u||null===(e=u.props)||void 0===e?void 0:e.email,type:"login",tenantId:null==u||null===(t=u.props)||void 0===t?void 0:t.tenant,userType:"EMPLOYEE"}},config:{enable:!0}},{onError:(e,t)=>{var n,l,o,r,i,a,s;p({key:"error",label:null!=e&&null!==(n=e.response)&&void 0!==n&&null!==(l=n.data)&&void 0!==l&&null!==(o=l.Errors)&&void 0!==o&&o[0].code?"SANDBOX_RESEND_OTP"+(null==e||null===(r=e.response)||void 0===r||null===(i=r.data)||void 0===i||null===(a=i.Errors)||void 0===a||null===(s=a[0])||void 0===s?void 0:s.code):"SANDBOX_RESEND_OTP_ERROR"}),setTimeout(C,5e3)},onSuccess:function(e){try{return p({key:"info",label:d("OTP_RESNED_SUCCESFULL")}),setTimeout(C,5e3),Promise.resolve()}catch(e){return Promise.reject(e)}}})).then(function(){})}catch(e){return Promise.reject(e)}}},d("CS_RESEND_OTP")),!f&&l.createElement(t.CardLabelError,null,d("CS_INVALID_OTP")),m&&l.createElement(t.Toast,{type:null==m?void 0:m.key,label:d(null==m?void 0:m.label),onClose:C}))}};exports.DigitUI=e=>{let{stateCode:t,registry:o,enabledModules:i,moduleReducers:a,defaultLanding:s}=e;const[c,u]=n.useState(Digit.Utils.getPrivacyObject()||{}),d=(Digit.UserService.getType(),new r.QueryClient({defaultOptions:{queries:{staleTime:9e5,cacheTime:3e6,retry:!1,retryDelay:e=>Infinity}}})),m=Digit.Contexts.ComponentProvider,p=Digit.Contexts.PrivacyProvider;return Digit.UserService.hasAccess(["FSM_DSO"]),l.createElement("div",null,l.createElement(v,null,l.createElement(r.QueryClientProvider,{client:d},l.createElement(m.Provider,{value:o},l.createElement(p.Provider,{value:{privacy:null==c?void 0:c[window.location.pathname],resetPrivacy:e=>{Digit.Utils.setPrivacyObject({}),u({})},getPrivacy:()=>{const e=Digit.Utils.getPrivacyObject();return u(e),e},updatePrivacyDescoped:e=>{const t=Digit.Utils.getAllPrivacyObject(),n={...t,[window.location.pathname]:e};Digit.Utils.setPrivacyObject({...n}),u((null==t?void 0:t[window.location.pathname])||{})},updatePrivacy:(e,t)=>{u(Digit.Utils.updatePrivacy(e,t)||{})}}},l.createElement(kn,{stateCode:t,enabledModules:i,moduleReducers:a,defaultLanding:s}))))))},exports.initCoreComponents=()=>{Object.entries(Un).forEach(e=>{let[t,n]=e;Digit.ComponentRegistryService.setComponent(t,n)})};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@egovernments/digit-ui-module-core",
3
- "version": "1.8.2-beta.17",
3
+ "version": "1.8.2-beta.18",
4
4
  "license": "MIT",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.modern.js",