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

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 +3 -3
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"),r=e(n),o=require("react-i18next"),l=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={sandbox:{imgUrl:"https://s3.ap-south-1.amazonaws.com/egov-qa-assets/error-image.png",infoMessage:"WRONG_TENANT_SIGN_UP",buttonInfo:"CREATE_TENANT_ERROR_BUTTON"}},p=e=>{var t;const{type:n="error"}=Digit.Hooks.useQueryParams(),l=null==e||null===(t=e.errorData)||void 0===t?void 0:t.module,{t:a}=o.useTranslation(),i=l?m[l]:d[n];return r.createElement("div",{className:"error-boundary"},r.createElement("div",{className:"error-container"},r.createElement("img",{src:i.imgUrl,alt:"error"}),r.createElement("h1",null,a(i.infoMessage)),r.createElement("button",{onClick:()=>{var t;l?null==e||null===(t=e.errorData)||void 0===t||t.action():e.goToHome()}},a(i.buttonInfo))))},v=()=>{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),r.createElement("span",null)};class f extends r.Component{constructor(e){super(e),this.state={error:null,errorStack:null,hasError:!1,module:null,action:null,info:null}}static getDerivedStateFromError(e){return{error:null==e?void 0:e.message,hasError:!0,errorStack:null==e?void 0:e.stack,module:null==e?void 0:e.module,action:null==e?void 0:e.action,info:null==e?void 0:e.info}}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?r.createElement("div",{className:"error-boundary"},r.createElement(v,null),r.createElement(p,{initData:this.props.initData,errorData:this.state})):this.props.children}}function g(){return(g=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(null,arguments)}const E=["digit-ui","works-ui","workbench-ui","health-ui","sanitation-ui","core-ui","mgramseva-web","sandbox-ui"],y=e=>{var l;const{isLoading:a,data:s}=Digit.Hooks.useAccessControl(),c=Digit.Utils.getMultiRootTenant(),{t:u}=o.useTranslation(),d=(i.useHistory(),Digit.ULBService.getStateId());let m=null;const[p,v]=n.useState([{}]),{data:f}=Digit.Hooks.useCustomMDMS(d,"HomeScreenOrder",[{name:"CardsAndLinksOrder"}],{select:e=>{var t;return null==e||null===(t=e.HomeScreenOrder)||void 0===t?void 0:t.CardsAndLinksOrder}});n.useEffect(()=>{v(f)},[f]);const y=null==s?void 0:s.actions.filter(e=>"card"===e.url&&e.parentModule).reduce((e,t)=>{const n=t.parentModule;e[n]||(e[n]={module:n,kpis:[],icon:t.leftIcon?Digit.Utils.iconRender(t.leftIcon,"white"):"",label:Digit.Utils.locale.getTransformedLocale(n+"_CARD_HEADER"),links:[]});const r=function(e){var t,n;if(void 0===e&&(e=""),"/"!=e){if(-1===(null===(t=e)||void 0===t?void 0:t.indexOf("/"+(null===(n=window)||void 0===n?void 0:n.contextPath)))){let t=null;return t=c?e=e.replace("/sandbox-ui/employee",`/sandbox-ui/${d}/employee`):null!=E&&E.every(t=>{var n;return-1===(null===(n=e)||void 0===n?void 0:n.indexOf("/"+t))})?"/employee/"+e:e,t}return e}}(t.navigationURL),o=r.indexOf("?");return e[n].links.push({link:r,icon:r.includes("create")?"Person":r.includes("inbox")?"AllInbox":r.includes("search")?"Search":r.includes("edit")?"Edit":"PhonelinkSetup",queryParams:-1===o?null:r.substring(o),label:u(Digit.Utils.locale.getTransformedLocale(`${n}_LINK_${t.displayName}`)),displayName:t.displayName}),e},{});if(a)return r.createElement(t.Loader,null);if(!y)return"";m=c?(e=>Object.keys(e).sort((e,t)=>{var n,r;return((null==p||null===(n=p.find(t=>"card"===t.moduleType&&t.name===e))||void 0===n?void 0:n.order)||null)-((null==p||null===(r=p.find(e=>"card"===e.moduleType&&e.name===t))||void 0===r?void 0:r.order)||null)}).reduce((t,n)=>{var r,o;const l=null==e||null===(r=e[n])||void 0===r||null===(o=r.links)||void 0===o?void 0:o.sort((e,t)=>{var r,o;const l=null==e?void 0:e.displayName,a=null==t?void 0:t.displayName;return((null==p||null===(r=p.find(e=>"link"===e.moduleType&&e.name===`${n}.${l.replace(/\s+/g,"_")}`))||void 0===r?void 0:r.order)||null)-((null==p||null===(o=p.find(e=>"link"===e.moduleType&&e.name===`${n}.${a.replace(/\s+/g,"_")}`))||void 0===o?void 0:o.order)||null)});return t[n]={...e[n],links:l},t},{}))(y):y;const h=null===(l=Object.keys(m))||void 0===l?void 0:l.map((e,n)=>{var o;const l=null===(o=m)||void 0===o?void 0:o[e],a={icon:"SupervisorAccount",moduleName:u(null==l?void 0:l.label),metrics:[],links:l.links};return r.createElement(t.LandingPageCard,g({buttonSize:"medium"},a))});return r.createElement(n.Fragment,null,r.createElement("div",{className:"employee-app-container digit-home-employee-app"},r.createElement("div",{className:"ground-container moduleCardWrapper gridModuleWrapper digit-home-moduleCardWrapper"},r.Children.map(h,e=>r.cloneElement(e)))))},h=e=>{let{config:n}=e;const{t:l}=o.useTranslation();return r.createElement(t.Card,null,n.map((e,n)=>r.createElement(r.Fragment,{key:n},r.createElement(t.CardHeader,null,l(e.sectionHeader)),e.sections&&e.sections.map((e,n)=>r.createElement(t.CardText,{key:n},l(e.label))),e.links&&Object.values(e.links).map((e,n)=>r.createElement("div",{key:n},r.createElement(t.CardText,null,l(e.description)),e.links.map((e,n)=>r.createElement("div",{key:n},r.createElement(i.Link,{to:{pathname:e.link,search:e.queryParams},className:"quickLink"},l(e.label)),r.createElement(t.CardText,null,l(e.description)))))))))},b=e=>{const{t:t}=o.useTranslation(),{data:n}=Digit.Hooks.useAccessControl(),l=(Digit.Utils.getMultiRootTenant(),Digit.ULBService.getStateId()),a=null==n?void 0:n.actions.filter(e=>"card"===e.url&&e.parentModule).reduce((e,n)=>{const r=n.parentModule;e[r]||(e[r]={module:r,label:Digit.Utils.locale.getTransformedLocale(r+"_CARD_HEADER"),links:[]});const o=Digit.Utils.transformURL(n.navigationURL,l),a=o.indexOf("?");return e[r].links.push({link:-1===a?o:o.substring(0,a),label:t(Digit.Utils.locale.getTransformedLocale(`${r}_LINK_${n.displayName}`)),queryParams:-1===a?null:o.substring(a),description:t(Digit.Utils.locale.getTransformedLocale(`${r}_LINK_${n.displayName}_DESCRIPTION`))}),e},{});return a?r.createElement(h,{config:[{sectionHeader:"WELCOME_TO_SANDBOX",sections:[{label:"SANDBOX_DESCRIPTION_1"},{label:"SANDBOX_DESCRIPTION_2"},{label:"SANDBOX_DESCRIPTION_3"}]},{sectionHeader:"QUICK_SETUP",links:a}]}):""},S=(e,t,n)=>{const r=null==e?void 0:e[""+t];r&&r.map(e=>{Digit.Utils.getMultiRootTenant()&&(e.navigationURL=e.navigationURL.replace("/sandbox-ui/citizen",`/sandbox-ui/${Digit.ULBService.getStateId()}/citizen`)),e.link=e.navigationURL,e.i18nKey=n(e.name)});const o={links:null==r?void 0:r.reverse(),header:Digit.Utils.locale.getTransformedLocale("ACTION_TEST_"+t),iconName:`CITIZEN_${t}_ICON`};var l;return"FSM"===t&&[{role:"FSM_DSO",from:`/${null===(l=window)||void 0===l?void 0:l.contextPath}/citizen/fsm/dso-dashboard`,dashoardLink:"CS_LINK_DSO_DASHBOARD",loginLink:"CS_LINK_LOGIN_DSO"}].map(e=>{var t,r,l;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===(r=o.links)||void 0===r||r.push({link:`/${null===(l=window)||void 0===l?void 0:l.contextPath}/citizen/login`,state:{role:"FSM_DSO",from:i},i18nKey:n(s)})}),o},C=e=>{let{modules:n,getCitizenMenu:l,fetchedCitizen:a,isLoading:i}=e;const c=[n.filter(e=>{let{code:t}=e;return"Payment"===t})[0],...n.filter(e=>{let{code:t}=e;return"Payment"!==t})],{t:u}=o.useTranslation();return i?r.createElement(s.Loader,null):r.createElement(r.Fragment,null,r.createElement("div",{className:"citizen-all-services-wrapper"},location.pathname.includes("sanitation-ui/citizen/all-services")||location.pathname.includes("sandbox-ui")&&location.pathname.includes("all-services")?null:r.createElement(t.BackLink,{onClick:()=>window.history.back()}),r.createElement("div",{className:"citizenAllServiceGrid"},c.filter(e=>e).map((e,n)=>{var o,i;let c,{code:d}=e;var m,p,v,f;return a&&(c=a?S(l,d,u):void 0),(null===(o=c)||void 0===o||null===(i=o.links)||void 0===i?void 0:i.length)>0?r.createElement(s.CitizenHomeCard,{header:u(null===(m=c)||void 0===m?void 0:m.header),links:null===(p=c)||void 0===p||null===(v=p.links)||void 0===v||null===(f=v.filter(e=>null==e?void 0:e.link))||void 0===f?void 0:f.sort((e,t)=>(null==e?void 0:e.orderNumber)-(null==t?void 0:t.orderNumber)),Icon:()=>(e=>{switch(e){case"PT":return r.createElement(t.CustomSVG.PTIcon,{className:"fill-path-primary-main"});case"WS":return r.createElement(t.CustomSVG.WSICon,{className:"fill-path-primary-main"});case"FSM":return r.createElement(t.CustomSVG.FSMIcon,{className:"fill-path-primary-main"});case"MCollect":return r.createElement(t.CustomSVG.MCollectIcon,{className:"fill-path-primary-main"});case"PGR":return r.createElement(t.CustomSVG.PGRIcon,{className:"fill-path-primary-main"});case"TL":return r.createElement(t.CustomSVG.TLIcon,{className:"fill-path-primary-main"});case"OBPS":return r.createElement(t.CustomSVG.OBPSIcon,{className:"fill-path-primary-main"});case"Bills":return r.createElement(t.CustomSVG.BillsIcon,{className:"fill-path-primary-main"});default:return r.createElement(t.CustomSVG.PTIcon,{className:"fill-path-primary-main"})}})(d),Info:"OBPS"===d?()=>r.createElement(s.CitizenInfoLabel,{style:{margin:"0px",padding:"10px"},info:u("CS_FILE_APPLICATION_INFO_LABEL"),text:u("BPA_CITIZEN_HOME_STAKEHOLDER_INCLUDES_INFO_LABEL")}):null,isInfo:"OBPS"===d}):r.createElement(r.Fragment,null)}))))},O=e=>{let{modules:t,additionalComponent:o}=e;return r.createElement(n.Fragment,null,r.createElement("div",{className:"employee-app-container digit-home-employee-app"},r.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")||(()=>r.createElement(r.Fragment,null));return r.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?r.createElement("div",{className:"additional-component-wrapper"},r.createElement(t,null)):null}))},N=e=>{let{userType:t,modules:n,getCitizenMenu:o,fetchedCitizen:l,isLoading:a,additionalComponent:i}=e;if("citizen"===t)return r.createElement(C,{modules:n,getCitizenMenu:o,fetchedCitizen:l,isLoading:a});const s=Digit.UserService.hasAccess("SUPERUSER")&&Digit.Utils.getMultiRootTenant();return Digit.Utils.getRoleBasedHomeCard()?r.createElement("div",{className:s?"homeWrapper":""},r.createElement(y,{modules:n,additionalComponent:i}),s&&!window.Digit.Utils.browser.isMobile()&&r.createElement(b,null)):r.createElement(O,{modules:n,additionalComponent:i})},w=function(e,t,n){if(void 0===e&&(e=""),void 0===t&&(t=""),void 0===n&&(n=""),""==t)return e;for(;null!==(r=e)&&void 0!==r&&r.includes(t);){var r,o;e=null===(o=e)||void 0===o?void 0:o.replace(t,n)}return e},_=e=>{var o;const[l,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 r=[],o=[];null==n||null===(e=n.info)||void 0===e||null===(t=e.roles)||void 0===t||t.forEach(e=>r.push(e.tenantId));let l=r.filter((e,t,n)=>n.indexOf(e)===t);null==l||l.forEach(e=>{var t;o.push({label:"TENANT_TENANTS_"+(null===(t=w(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)},[l]),r.createElement("div",{style:null!=e&&e.mobileView?{color:"#767676"}:{}},r.createElement(t.Dropdown,{t:null==e?void 0:e.t,option:s,selected:s.find(e=>e.value===(null==l?void 0:l.value)),optionKey:"label",select:e=>{var t,n,r,o;const l=Digit.SessionStorage.get("citizen.userRequestObject"),i=null===(t=Digit.SessionStorage.get("citizen.userRequestObject"))||void 0===t||null===(n=t.info)||void 0===n||null===(r=n.roles)||void 0===r?void 0:r.filter(t=>t.tenantId===e.value);if((null==i?void 0:i.length)>0&&(l.info.roles=i,l.info.tenantId=null==e?void 0:e.value),Digit.SessionStorage.set("Employee.tenantId",null==e?void 0:e.value),Digit.UserService.setUser(l),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:r.createElement("label",{className:"cp"},null==e?void 0:e.t("TENANT_TENANTS_"+(null===(o=w(Digit.SessionStorage.get("Employee.tenantId"),".","_"))||void 0===o?void 0:o.toUpperCase())))}))},I=e=>{const o=e.dropdown||!1,{data:l,isLoading:a}=Digit.Hooks.useStore.getInitData(),{languages:i,stateInfo:s}=l||{},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?r.createElement("div",null,r.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:r.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)})):r.createElement(r.Fragment,null,r.createElement("div",{style:{marginBottom:"5px"}},"Language"),r.createElement("div",{className:"language-selector"},i.map((e,n)=>r.createElement("div",{className:"language-button-container",key:n},r.createElement(t.Button,{label:e.label,onClick:()=>m(e),variation:e.value===u?"primary":""})))));var p},D=e=>{var o,l,a,c,u,d,m,p;let{t:v,stateInfo:f,toggleSidebar:g,isSidebarOpen:E,handleLogout:y,userDetails:h,CITIZEN:b,cityDetails:S,mobileView:C,userOptions:O,handleUserDropdownSelection:N,logoUrl:w,showLanguageChange:D=!0}=e;const[T,R]=r.useState(null);r.useEffect(function(){try{var e;const t=Digit.Utils.getMultiRootTenant()?Digit.ULBService.getStateId():Digit.ULBService.getCurrentTenantId(),n=null==h||null===(e=h.info)||void 0===e?void 0:e.uuid,r=function(){if(n)return Promise.resolve(Digit.UserService.userSearch(t,{uuid:[n]},{})).then(function(e){if(e&&e.user&&e.user.length){var t;const n=e.user[0],r=null==n||null===(t=n.photo)||void 0===t?void 0:t.split(",");R(null==r?void 0:r.at(0))}})}();return Promise.resolve(r&&r.then?r.then(function(){}):void 0)}catch(e){return Promise.reject(e)}},[null!==T,null==h||null===(o=h.info)||void 0===o?void 0:o.uuid]);const P=Digit.ULBService.getCitizenCurrentTenant(!0);let L=i.useHistory();const{pathname:x}=i.useLocation(),{data:{unreadCount:A}={},isSuccess:M}=Digit.Hooks.useNotificationCount({tenantId:P,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===(j=Digit.UserService)||void 0===j||null===(F=j.getUser())||void 0===F||null===(V=F.info)||void 0===V?void 0:V.type)&&!!P}});var k,U,B,j,F,V;if(b)return r.createElement("div",null,r.createElement(s.TopBar,{img:null==f?void 0:f.logoUrlWhite,isMobile:!0,toggleSidebar:()=>{Digit.clikOusideFired?Digit.clikOusideFired=!1:g(!0)},logoUrl:null==f?void 0:f.logoUrlWhite,onLogout:y,userDetails:h,notificationCount:A<99?A:99,notificationCountLoaded:M,cityOfCitizenShownBesideLogo:v(P),onNotificationIconClick:function(){var e;L.push(`/${null===(e=window)||void 0===e?void 0:e.contextPath}/citizen/engagement/notifications`)},hideNotificationIconOnSomeUrlsWhenNotLoggedIn:(e=>{var t,n,r,o;return(null===(t=Digit.UserService)||void 0===t||null===(n=t.getUser())||void 0===n||!n.access_token)&&[`/${null===(r=window)||void 0===r?void 0:r.contextPath}/citizen/select-language`,`/${null===(o=window)||void 0===o?void 0:o.contextPath}/citizen/select-location`].includes(e)})(x),changeLanguage:C?null:r.createElement(I,{dropdown:!0})}));const H=!(null==h||!h.access_token),$=null===(l=Digit.ComponentRegistryService)||void 0===l?void 0:l.getComponent("CustomEmployeeTopBar");return $?r.createElement($,{t:v,stateInfo:f,toggleSidebar:g,isSidebarOpen:E,handleLogout:y,userDetails:h,CITIZEN:b,cityDetails:S,mobileView:C,userOptions:O,handleUserDropdownSelection:N,logoUrl:w,showLanguageChange:D,loggedin:H}):r.createElement(t.TopBar,{actionFields:[r.createElement(_,{dropdown:!0,t:v}),D&&r.createElement(I,{dropdown:!0}),(null==h?void 0:h.access_token)&&r.createElement(t.Dropdown,{option:O,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:N,showArrow:!0,menuStyles:{marginTop:"1rem"},theme:"light"})],onHamburgerClick:()=>{g()},className:"",img:w,logoWidth:"48px",logoHeight:"48px",logo:H?null==S?void 0:S.logoId:null==f?void 0:f.statelogo,onImageClick:()=>{},onLogoClick:()=>{},props:{},showDeafultImg:!0,style:{},theme:"light",ulb:H?null!=S&&null!==(d=S.city)&&void 0!==d&&d.ulbGrade?r.createElement(n.Fragment,null,v(null==S?void 0:S.i18nKey).toUpperCase()," ",v("ULBGRADE_"+(null==S||null===(m=S.city)||void 0===m?void 0:m.ulbGrade.toUpperCase().replace(" ","_").replace(".","_"))).toUpperCase()):r.createElement("img",{className:"state",src:w,alt:"State Logo"}):r.createElement(n.Fragment,null,v(`MYCITY_${null==f||null===(p=f.code)||void 0===p?void 0:p.toUpperCase()}_LABEL`)," ",v("MYCITY_STATECODE_LABEL"))})},T=(e,t,n,o)=>{var l,a;return[{type:"link",element:"HOME",text:e("COMMON_BOTTOM_NAVIGATION_HOME"),link:o?`/${null===(l=window)||void 0===l?void 0:l.contextPath}/employee`:`/${null===(a=window)||void 0===a?void 0:a.contextPath}/citizen`,icon:"HomeIcon",populators:{onClick:t}},{type:"component",element:"LANGUAGE",action:r.createElement(I,null),icon:"LanguageIcon"},{id:"login-btn",element:"LOGIN",text:e("CORE_COMMON_LOGIN"),icon:r.createElement(s.LogoutIcon,{className:"icon"}),populators:{onClick:n}}]},R=e=>{let{onSelect:n,onCancel:l,onDismiss:a,PopupStyles:i,isDisabled:s,hideSubmit:c}=e;const{t:u}=o.useTranslation(),d=[r.createElement("div",null,r.createElement(t.CardText,null,u("CORE_LOGOUT_WEB_CONFIRMATION_MESSAGE")+" ",r.createElement("strong",null,u("CORE_LOGOUT_MESSAGE"))))],m=[r.createElement(t.Button,{type:"button",size:"large",variation:"secondary",label:u("CORE_LOGOUT_CANCEL"),className:"logout-cancel-button",onClick:l}),r.createElement(t.Button,{type:"button",size:"large",variation:"primary",label:u("CORE_LOGOUT_WEB_YES"),formId:"modal-action",onClick:n,isDisabled:s})],p=[r.createElement(t.Button,{type:"button",size:"large",variation:"digit-action-cancel",label:u("CORE_LOGOUT_CANCEL"),className:"logout-cancel-button",onClick:l})];return r.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})},P=e=>{let{info:t,t:n}=e;return r.createElement("div",{className:"profile-section"},r.createElement("div",{className:"imageloader imageloader-loaded"},r.createElement("img",{className:"img-responsive img-circle img-Profile",src:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAO4AAADUCAMAAACs0e/bAAAAM1BMVEXK0eL////Dy97GzuD4+fvL0uPg5O7T2efb4OvR1+Xr7vTk5/Df4+37/P3v8fbO1eTt8PUsnq5FAAAGqElEQVR4nO2d25ajIBBFCajgvf//a0eMyZgEjcI5xgt7Hmatme507UaxuJXidiDqjmSgeVIMlB1ZR1WZAf2gbdu0QwixSYzjOJPmHurfEGEfY9XzjNGG9whQCeVAuv5xQEySLtR9hPuIcwj0EeroN5m3D1IbsbgHK0esiQ9MKsqXVr8Hm/a/Pulk6wihpCIXBw3dh7bTvRBt9+dC5NfS1VH3xETdM3MxXRN1T0zUPTNR98xcS1dlV9NNfx3DhkTdM6PKqHteVBF1z0vU5f0sKdpc2zWLKutXrjJjdLvpesRmukqYonauPhXpdsLb6CppmpnltsYIuY2yavi6Mi2/rzAWm1zUfF0limVLqkZyA+mDYevKBS37aGC+L1lX5e7uyU1Cv565uiua9k5LFqbqqrnu2I3m+jJ11ZoLeRtfmdB0Uw/ZDsP0VTxdn7a1VERfmq7XlXyn5D2QWLoq8bZlPoBJumphJjVBw/Ll6CoTZGsTDs4NrGqKbqBth8ZHJUi6cn168QmleSm6GmB7Kxm+6obXlf7PoDHosCwM3QpiS2legi6ocSl3L0G3BdneDDgwQdENfeY+SfDJBkF37ZB+GvwzA6/rMaafAn8143VhPZWdjMWG1oHXhdnemgPoAvLlB/iZyRTfVeF06wPoQhJmlm4bdcOAZRlRN5gcPc5SoPEQR1fDdbOo6wn+uYvXxY0QCLom6gYROKH+Aj5nvphuFXWDiLpRdxl/19LFT95k6CHCrnW7pCDqBn1i1PUFvii2c11oZOJ6usWeH0RRNzC4Zs+6FTi2nevCVwCjbugnXklX5fkfTldL8PEilUB1kfNyN1u9MME2sATr4lbuB7AjfLAuvsRm1A0g6gYRdcPAjvBlje2Z8brI8OC68AcRdlCkwLohx2mcZMjw9q+LzarQurjtnwPYAydX08WecECO/u6Ad0GBdYG7jO5gB4Ap+PwKcA9ZT43dn4/W9TyiPAn4OAJaF7h3uwe8StSCddFdM3jqFa2LvnnB5zzhuuBBAjY4gi50cg694gnXhTYvfMdrjtcFZhrwE9r41gUem8IXWMC3LrBzxh+a0gRd1N1LOK7M0IUUGuggvEmHoStA2/MJh7MpupiDU4TzjhxdzLAoO4ouZvqVURbFMHQlZD6SUeWHoguZsSLUGegrehA+FZFowPdUWTi6iMoZlIpGGUUXkDbjj/9ZOLqAQS/+GIKl5BQOCn/ycqpzkXSDm5dU7ZWkG7wUyGlcmm7g5Ux56AqirgoaJ7BeokPTDbp9CbVunjFxPrl7+HqnkrSq1Da7JX20f3dV8yJi6voO81mX8vV0mx3qUsZCPRfTlVRdz2EvdufYGDvNQvvwqHtmXd+a1ITinwNcXc+lT6JuzdT1XDyBn/x7wtX1HCQQdW9MXc8xArGrirowfLeUEbMqqq6f7TF1lfRdOuGNiGi6SpT+WxY06xUfNN2wBfyE9I4tlm7w5hvOPDNJN3yNiLMipji6gE3chKhouoCtN5x3QlF0EZt8OW/8ougitqJQlk1aii7iFC9l0MvRReyao7xNjKML2Z/PuHlzhi5mFxljiZeiC9rPTEisNEMX9KYAwo5Xhi7qaA3hamboYm7dG+NVrXhdaYDv5zFaQZsYrCtbbAGnjkQDX2+J1FXCwOsqWOpKoIQNTFdqYBWydxqNqUoG0pVpCS+H8kaJaGKErlIaXj7CRRE+gRWuKwW9YZ80oVOUgbpdT0zpnSZJTIiwCtJVelvXntr4P5j6BWfPb5Wcx84C4cq3hb11lco2u2Mdwp6XdJ/Ne3wb8DWdfiRenZaXrhLwOj4e+GQeHroy3YOspS7TlU28Wle2m2QUS0mqdcbrdNW+ZHsSsyK7tBfm0q/dWcv+Z3mytVx3t7KWulqUe6ilunu8jF8pFwgv1FXp3mUt35OtRbr7eM4u4Gs6vUBXgeuHc5kfE/cbvWZtkROLm1DMtLCy80tzsu2PRj0hTI8fvrQuvsjlJkyutszq+m423wHaLTyniy/XuiGZ84LuT+m5ZfNfRxyGs7LXZOvia7VujatUwVTrIt+Q/Csc7Tuhe+BOakT10b4TuoiiJjvgU9emTO42PwEfBa+cuodKkuf42DXr1D3JpXz73Hnn0j10evHKe+nufgfUm+7B84sX9FfdEzXux2DBpWuKokkCqN/5pa/8pmvnL+RGKCddCGmatiPyPB/+ekO/M/q/7uvbt22kTt3zEnXPzCV13T3Gel4/6NduDu66xRvlPNkM1RjjxUdv+4WhGx6TftD19Q/dfzpwcHO+rE3fAAAAAElFTkSuQmCC"})),r.createElement("div",{id:"profile-name",className:"label-container name-Profile"},r.createElement("div",{className:"label-text"}," ",null==t?void 0:t.name," ")),r.createElement("div",{id:"profile-location",className:"label-container loc-Profile"},r.createElement("div",{className:"label-text"}," ",null==t?void 0:t.mobileNumber," ")),(null==t?void 0:t.emailId)&&r.createElement("div",{id:"profile-emailid",className:"label-container loc-Profile"},r.createElement("div",{className:"label-text"}," ",t.emailId," ")),r.createElement("div",{className:"profile-divider"}),window.location.href.includes("/employee")&&!window.location.href.includes("/employee/user/login")&&!window.location.href.includes("employee/user/language-selection")&&r.createElement(_,{t:n,mobileView:!0}))},L={CommonPTIcon:r.createElement(s.PTIcon,{className:"icon"}),OBPSIcon:r.createElement(s.OBPSIcon,{className:"icon"}),propertyIcon:r.createElement(s.PropertyHouse,{className:"icon"}),TLIcon:r.createElement(s.CaseIcon,{className:"icon"}),PGRIcon:r.createElement(s.PGRIcon,{className:"icon"}),FSMIcon:r.createElement(s.FSMIcon,{className:"icon"}),WSIcon:r.createElement(s.WSICon,{className:"icon"}),MCollectIcon:r.createElement(s.MCollectIcon,{className:"icon"}),BillsIcon:r.createElement(s.CollectionIcon,{className:"icon"}),BirthIcon:r.createElement(s.BirthIcon,{className:"icon"}),DeathIcon:r.createElement(s.DeathIcon,{className:"icon"}),FirenocIcon:r.createElement(s.FirenocIcon,{className:"icon"}),HomeIcon:r.createElement(s.HomeIcon,{className:"icon"}),EditPencilIcon:r.createElement(s.EditPencilIcon,{className:"icon"}),LogoutIcon:r.createElement(s.LogoutIcon,{className:"icon"}),Phone:r.createElement(s.Phone,{className:"icon"})},x=e=>{var t,l,a;let{linkData:c,islinkDataLoading:u}=e;const{t:d}=o.useTranslation(),m=i.useHistory(),p=i.useLocation(),{pathname:v}=p,{data:f,isFetched:E}=Digit.Hooks.useStore.getInitData(),{stateInfo:y}=f||{},h=Digit.UserService.getUser();let b=window.Digit.Utils.browser.isMobile();const[S,C]=n.useState(!1),[O,N]=n.useState(!1),[w,_]=n.useState(!1),I=()=>{_(!1)};if(u)return r.createElement(s.Loader,null);const D=()=>{var e;m.push(`/${null===(e=window)||void 0===e?void 0:e.contextPath}/citizen/user/profile`)};let x=[...T(d,D,()=>{var e;m.push(`/${null===(e=window)||void 0===e?void 0:e.contextPath}/citizen/login`)},S)];x=x.filter(e=>"LANGUAGE"!==e.element),Digit.ULBService.getCurrentTenantId();const A=e=>{var t,n;let{item:o}=e;const l=(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=l?L[l]:L.BillsIcon;let s;s="component"===o.type?o.action:o.text;const c=()=>r.createElement("span",g({className:"menu-item"},o.populators),a,r.createElement("div",{className:"menu-label"},s));return"external-link"===o.type?r.createElement("a",{href:o.link},r.createElement(c,null)):"link"===o.type?r.createElement(i.Link,{to:null==o?void 0:o.link},r.createElement(c,null)):r.createElement(c,null)};let M;var k,U,B;return E&&h&&h.access_token&&(M=r.createElement(P,{info:null==h?void 0:h.info,stateName:null==y?void 0:y.name,t:d}),x=x.filter(e=>"login-btn"!==(null==e?void 0:e.id)),x=[...x,{text:d("EDIT_PROFILE"),element:"PROFILE",icon:"EditPencilIcon",populators:{onClick:D}},{text:d("CORE_COMMON_LOGOUT"),element:"LOGOUT",icon:"LogoutIcon",populators:{onClick:()=>{N(!1),_(!0)}}},{text:r.createElement(r.Fragment,null,d("CS_COMMON_HELPLINE"),r.createElement("div",{className:"telephone",style:{marginTop:"-10%"}},null==f||null===(k=f.tenants)||void 0===k?void 0:k.map(e=>{}),r.createElement("div",{className:"link"},r.createElement("a",{href:"tel:"+(null==f||null===(U=f.tenants)||void 0===U?void 0:U[0].contactNumber)},null==f||null===(B=f.tenants)||void 0===B?void 0:B[0].contactNumber)))),element:"Helpline",icon:"Phone"}]),null===(t=Object.keys(c))||void 0===t||null===(l=t.sort((e,t)=>t.localeCompare(e)))||void 0===l||l.map(e=>{var t,n,r,o,l,a;(null===(t=c[e][0])||void 0===t?void 0:t.sidebar)===window.contextPath+"-links"&&x.splice(1,0,{type:null!==(n=c[e][0])&&void 0!==n&&null!==(r=n.sidebarURL)&&void 0!==r&&r.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===(l=c[e][0])||void 0===l?void 0:l.leftIcon,link:null===(a=c[e][0])||void 0===a?void 0:a.sidebarURL})}),r.createElement(r.Fragment,null,r.createElement("div",null,r.createElement("div",{style:{height:"100%",width:"100%",top:"0px",backgroundColor:"rgba(0, 0, 0, 0.54)",pointerzevents:"auto"}}),r.createElement("div",{style:{display:"flex",flexDirection:"column",height:b?"calc(100vh - 56px)":"auto",zIndex:"99"}},M,r.createElement("div",{className:"drawer-desktop"},null===(a=x)||void 0===a?void 0:a.map((e,t)=>r.createElement("div",{className:"sidebar-list "+(v===(null==e?void 0:e.link)||v===(null==e?void 0:e.sidebarURL)?"active":""),key:t},r.createElement(A,{item:e}))))),r.createElement("div",null,w&&r.createElement(R,{onSelect:()=>{Digit.UserService.logout(),_(!1)},onCancel:I,onDismiss:I}))))},A=e=>{var l,a,s,c,u;let{isMobile:d=!1,toggleSidebar:m,onLogout:p,isEmployee:v=!1,linkData:f,islinkDataLoading:g,userProfile:E}=e;const{data:y,isFetched:h}=Digit.Hooks.useStore.getInitData(),b=Digit.StoreData.getCurrentLanguage(),[S,C]=n.useState(null),{languages:O,stateInfo:N}=y||{},w=Digit.UserService.getUser(),[_,I]=n.useState(""),[D,R]=n.useState(null),[P,L]=n.useState([]),[A,M]=n.useState([]),[k,U]=n.useState(b);let B=[];const{isLoading:j,data:F}=Digit.Hooks.useAccessControl(),{t:V}=(Digit.ULBService.getCurrentTenantId(),o.useTranslation()),H=i.useHistory(),$=function(e,t,n){if(void 0===e&&(e=""),void 0===t&&(t=""),void 0===n&&(n=""),""==t)return e;for(;null!==(r=e)&&void 0!==r&&r.includes(t);){var r,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 r=[],o=[];null==n||null===(e=n.info)||void 0===e||null===(t=e.roles)||void 0===t||t.forEach(e=>r.push(e.tenantId));let l=r.filter((e,t,n)=>n.indexOf(e)===t);null==l||l.forEach(e=>{var t;o.push({label:"TENANT_TENANTS_"+(null===(t=$(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")),L(o)},[D]);const z=()=>{Digit.clikOusideFired=!0,m(!1)};n.useEffect(()=>{S||function(){try{var e;const t=Digit.ULBService.getCurrentTenantId(),n=null==w||null===(e=w.info)||void 0===e?void 0:e.uuid,r=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],r=null==t||null===(n=t.photo)||void 0===n?void 0:n.split(",");C(null==r?void 0:r.at(0))}})}();Promise.resolve(r&&r.then?r.then(function(){}):void 0)}catch(e){return Promise.reject(e)}}()},[S]);const G=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(g||j)return r.createElement(t.Loader,null);let W=[...T(V,z,()=>{var e;H.push(`/${null===(e=window)||void 0===e?void 0:e.contextPath}/citizen/login`),z()},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==F||F.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,Q,J,K;const n=null===(Z=q[e[t]][0])||void 0===Z||null===(Y=Z.displayName)||void 0===Y||null===(Q=Y.toUpperCase())||void 0===Q?void 0:Q.replace(/[ -]/g,"_"),r=null===(J=e[t])||void 0===J||null===(K=J.toUpperCase())||void 0===K?void 0:K.replace(/[ -]/g,"_");var ee,te,ne,re;-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),z()}}}):W.splice(1,0,{type:"dynamic",moduleName:V("ACTION_TEST_"+r),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===(re=q[e[t]][1])||void 0===re?void 0:re.leftIcon})}const t=W.findIndex(e=>"HOME"===e.element),n=W.splice(t,1),r=W.findIndex(e=>"LANGUAGE"===e.element),o=W.splice(r,(null===(X=W)||void 0===X?void 0:X.length)-r);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,le;null===(oe=Object.keys(f))||void 0===oe||null===(le=oe.sort((e,t)=>t.localeCompare(e)))||void 0===le||le.map(e=>{var t,n,r,o,l,a;"digit-ui-links"===(null===(t=f[e][0])||void 0===t?void 0:t.sidebar)&&W.splice(1,0,{type:null!==(n=f[e][0])&&void 0!==n&&null!==(r=n.sidebarURL)&&void 0!==r&&r.includes(null===(o=window)||void 0===o?void 0:o.contextPath)?"link":"external-link",text:V("ACTION_TEST_"+Digit.Utils.locale.getTransformedLocale(e)),links:f[e],icon:null===(l=f[e][0])||void 0===l?void 0:l.leftIcon,link:null===(a=f[e][0])||void 0===a?void 0:a.sidebarURL})})}H.location.pathname.includes("/openlink")&&(W=W.filter(e=>"LANGUAGE"===e.element)),W=null===(l=W)||void 0===l?void 0:l.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 ae=V("TENANT_TENANTS_"+(null===(a=$(Digit.SessionStorage.get("Employee.tenantId"),".","_"))||void 0===a?void 0:a.toUpperCase())),ie=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==O?void 0:O.map(e=>({...e,type:"custom",key:"language"})),ue=[{label:"HOME",value:"HOME",icon:"Home",type:"custom",key:"home"},{label:ae,value:ae,children:(null==se?void 0:se.length)>0?se:void 0,type:"custom",icon:"LocationCity",key:"city"},{label:V("Language"),children:(null==ce?void 0:ce.length)>0?ce:void 0,type:"custom",icon:"Language",key:"language"},{label:V("EDIT_PROFILE"),type:"custom",icon:"Edit",key:"editProfile"},{label:V("Modules"),icon:"DriveFileMove",children:ie}];return d?r.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:S||void 0,isSearchable:!0,onSelect:e=>{let{item:t,index:n,parentIndex:r}=e;return(e=>{let{item:t}=e;if(null!=t&&t.navigationURL)G(null==t?void 0:t.navigationURL);else if(null!=t&&t.link)G(null==t?void 0:t.link);else{if("custom"!==(null==t?void 0:t.type))return;switch(null==t?void 0:t.key){case"home":H.push(v?`/${null===(r=window)||void 0===r?void 0:r.contextPath}/employee`:`/${null===(o=window)||void 0===o?void 0:o.contextPath}/citizen`),m();break;case"editProfile":E(),m();break;case"language":U((n=t).value),Digit.LocalizationService.changeLanguage(n.value,N.code),m();break;case"city":(e=>{var t,n,r,o;const l=Digit.SessionStorage.get("citizen.userRequestObject"),a=null===(t=Digit.SessionStorage.get("citizen.userRequestObject"))||void 0===t||null===(n=t.info)||void 0===n||null===(r=n.roles)||void 0===r?void 0:r.filter(t=>t.tenantId===e.value);if((null==a?void 0:a.length)>0&&(l.info.roles=a,l.info.tenantId=null==e?void 0:e.value),Digit.SessionStorage.set("Employee.tenantId",null==e?void 0:e.value),Digit.UserService.setUser(l),R(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`;H.replace(e)}window.location.reload()})(t),m()}}var n,r,o})({item:t,index:n,parentIndex:r})}}):r.createElement(x,{logout:p})};function M(e,t){return e(t={exports:{}},t.exports),t.exports}"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self&&self;var k=function(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}(M(function(e,t){var n;n=e=>(()=>{var t={"./node_modules/css-mediaquery/index.js":(e,t)=>{t.match=function(e,t){return i(e).some(function(e){var n=e.inverse,r="all"===e.type||t.type===e.type;if(r&&n||!r&&!n)return!1;var o=e.expressions.every(function(e){var n=e.feature,r=e.modifier,o=e.value,l=t[n];if(!l)return!1;switch(n){case"orientation":case"scan":return l.toLowerCase()===o.toLowerCase();case"width":case"height":case"device-width":case"device-height":o=u(o),l=u(l);break;case"resolution":o=c(o),l=c(l);break;case"aspect-ratio":case"device-aspect-ratio":case"device-pixel-ratio":o=s(o),l=s(l);break;case"grid":case"color":case"color-index":case"monochrome":o=parseInt(o,10)||1,l=parseInt(l,10)||0}switch(r){case"min":return l>=o;case"max":return l<=o;default:return l===o}});return o&&!n||!o&&n})},t.parse=i;var n=/(?:(only|not)?\s*([^\s\(\)]+)(?:\s*and)?\s*)?(.+)?/i,r=/\(\s*([^\s\:\)]+)\s*(?:\:\s*([^\s\)]+))?\s*\)/,o=/^(?:(min|max)-)?(.+)/,l=/(em|rem|px|cm|mm|in|pt|pc)?$/,a=/(dpi|dpcm|dppx)?$/;function i(e){return e.split(",").map(function(e){var t=(e=e.trim()).match(n),l=t[1],a=t[2],i=t[3]||"",s={};return s.inverse=!!l&&"not"===l.toLowerCase(),s.type=a?a.toLowerCase():"all",i=i.match(/\([^\)]+\)/g)||[],s.expressions=i.map(function(e){var t=e.match(r),n=t[1].toLowerCase().match(o);return{modifier:n[1],feature:n[2],value:t[2]}}),s})}function s(e){var t,n=Number(e);return n||(n=(t=e.match(/^(\d+)\s*\/\s*(\d+)$/))[1]/t[2]),n}function c(e){var t=parseFloat(e);switch(String(e).match(a)[1]){case"dpcm":return t/2.54;case"dppx":return 96*t;default:return t}}function u(e){var t=parseFloat(e);switch(String(e).match(l)[1]){case"em":case"rem":return 16*t;case"cm":return 96*t/2.54;case"mm":return 96*t/2.54/10;case"in":return 96*t;case"pt":return 72*t;case"pc":return 72*t/12;default:return t}}},"./node_modules/hyphenate-style-name/index.js":(e,t,n)=>{n.r(t),n.d(t,{default:()=>i});var r=/[A-Z]/g,o=/^ms-/,l={};function a(e){return"-"+e.toLowerCase()}const i=function(e){if(l.hasOwnProperty(e))return l[e];var t=e.replace(r,a);return l[e]=o.test(t)?"-"+t:t}},"./node_modules/matchmediaquery/index.js":(e,t,n)=>{var r=n("./node_modules/css-mediaquery/index.js").match,o="undefined"!=typeof window?window.matchMedia:null;function l(e,t,n){var l=this;if(o&&!n){var a=o.call(window,e);this.matches=a.matches,this.media=a.media,a.addListener(i)}else this.matches=r(e,t),this.media=e;function i(e){l.matches=e.matches,l.media=e.media}this.addListener=function(e){a&&a.addListener(e)},this.removeListener=function(e){a&&a.removeListener(e)},this.dispose=function(){a&&a.removeListener(i)}}e.exports=function(e,t,n){return new l(e,t,n)}},"./node_modules/object-assign/index.js":e=>{var t=Object.getOwnPropertySymbols,n=Object.prototype.hasOwnProperty,r=Object.prototype.propertyIsEnumerable;function o(e){if(null==e)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(e)}e.exports=function(){try{if(!Object.assign)return!1;var e=new String("abc");if(e[5]="de","5"===Object.getOwnPropertyNames(e)[0])return!1;for(var t={},n=0;n<10;n++)t["_"+String.fromCharCode(n)]=n;if("0123456789"!==Object.getOwnPropertyNames(t).map(function(e){return t[e]}).join(""))return!1;var r={};return"abcdefghijklmnopqrst".split("").forEach(function(e){r[e]=e}),"abcdefghijklmnopqrst"===Object.keys(Object.assign({},r)).join("")}catch(e){return!1}}()?Object.assign:function(e,l){for(var a,i,s=o(e),c=1;c<arguments.length;c++){for(var u in a=Object(arguments[c]))n.call(a,u)&&(s[u]=a[u]);if(t){i=t(a);for(var d=0;d<i.length;d++)r.call(a,i[d])&&(s[i[d]]=a[i[d]])}}return s}},"./node_modules/prop-types/checkPropTypes.js":(e,t,n)=>{var r,o=n("./node_modules/prop-types/lib/ReactPropTypesSecret.js"),l={},a=n("./node_modules/prop-types/lib/has.js");function i(e,t,n,i,s){for(var c in e)if(a(e,c)){var u;try{if("function"!=typeof e[c]){var d=Error((i||"React class")+": "+n+" type `"+c+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof e[c]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw d.name="Invariant Violation",d}u=e[c](t,c,i,n,null,o)}catch(e){u=e}if(!u||u instanceof Error||r((i||"React class")+": type specification of "+n+" `"+c+"` is invalid; the type checker function must return `null` or an `Error` but returned a "+typeof u+". You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument)."),u instanceof Error&&!(u.message in l)){l[u.message]=!0;var m=s?s():"";r("Failed "+n+" type: "+u.message+(null!=m?m:""))}}}r=function(e){var t="Warning: "+e;"undefined"!=typeof console&&console.error(t);try{throw new Error(t)}catch(e){}},i.resetWarningCache=function(){l={}},e.exports=i},"./node_modules/prop-types/factoryWithTypeCheckers.js":(e,t,n)=>{var r,o=n("./node_modules/react-is/index.js"),l=n("./node_modules/object-assign/index.js"),a=n("./node_modules/prop-types/lib/ReactPropTypesSecret.js"),i=n("./node_modules/prop-types/lib/has.js"),s=n("./node_modules/prop-types/checkPropTypes.js");function c(){return null}r=function(e){var t="Warning: "+e;"undefined"!=typeof console&&console.error(t);try{throw new Error(t)}catch(e){}},e.exports=function(e,t){var n="function"==typeof Symbol&&Symbol.iterator,u={array:v("array"),bigint:v("bigint"),bool:v("boolean"),func:v("function"),number:v("number"),object:v("object"),string:v("string"),symbol:v("symbol"),any:p(c),arrayOf:function(e){return p(function(t,n,r,o,l){if("function"!=typeof e)return new m("Property `"+l+"` of component `"+r+"` has invalid PropType notation inside arrayOf.");var i=t[n];if(!Array.isArray(i))return new m("Invalid "+o+" `"+l+"` of type `"+E(i)+"` supplied to `"+r+"`, expected an array.");for(var s=0;s<i.length;s++){var c=e(i,s,r,o,l+"["+s+"]",a);if(c instanceof Error)return c}return null})},element:p(function(t,n,r,o,l){var a=t[n];return e(a)?null:new m("Invalid "+o+" `"+l+"` of type `"+E(a)+"` supplied to `"+r+"`, expected a single ReactElement.")}),elementType:p(function(e,t,n,r,l){var a=e[t];return o.isValidElementType(a)?null:new m("Invalid "+r+" `"+l+"` of type `"+E(a)+"` supplied to `"+n+"`, expected a single ReactElement type.")}),instanceOf:function(e){return p(function(t,n,r,o,l){var a;return t[n]instanceof e?null:new m("Invalid "+o+" `"+l+"` of type `"+((a=t[n]).constructor&&a.constructor.name?a.constructor.name:"<<anonymous>>")+"` supplied to `"+r+"`, expected instance of `"+(e.name||"<<anonymous>>")+"`.")})},node:p(function(e,t,n,r,o){return g(e[t])?null:new m("Invalid "+r+" `"+o+"` supplied to `"+n+"`, expected a ReactNode.")}),objectOf:function(e){return p(function(t,n,r,o,l){if("function"!=typeof e)return new m("Property `"+l+"` of component `"+r+"` has invalid PropType notation inside objectOf.");var s=t[n],c=E(s);if("object"!==c)return new m("Invalid "+o+" `"+l+"` of type `"+c+"` supplied to `"+r+"`, expected an object.");for(var u in s)if(i(s,u)){var d=e(s,u,r,o,l+"."+u,a);if(d instanceof Error)return d}return null})},oneOf:function(e){if(!Array.isArray(e))return r(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."),c;function t(t,n,r,o,l){for(var a=t[n],i=0;i<e.length;i++)if(d(a,e[i]))return null;var s=JSON.stringify(e,function(e,t){return"symbol"===y(t)?String(t):t});return new m("Invalid "+o+" `"+l+"` of value `"+String(a)+"` supplied to `"+r+"`, expected one of "+s+".")}return p(t)},oneOfType:function(e){if(!Array.isArray(e))return r("Invalid argument supplied to oneOfType, expected an instance of array."),c;for(var t=0;t<e.length;t++){var n=e[t];if("function"!=typeof n)return r("Invalid argument supplied to oneOfType. Expected an array of check functions, but received "+h(n)+" at index "+t+"."),c}return p(function(t,n,r,o,l){for(var s=[],c=0;c<e.length;c++){var u=(0,e[c])(t,n,r,o,l,a);if(null==u)return null;u.data&&i(u.data,"expectedType")&&s.push(u.data.expectedType)}return new m("Invalid "+o+" `"+l+"` supplied to `"+r+"`"+(s.length>0?", expected one of type ["+s.join(", ")+"]":"")+".")})},shape:function(e){return p(function(t,n,r,o,l){var i=t[n],s=E(i);if("object"!==s)return new m("Invalid "+o+" `"+l+"` of type `"+s+"` supplied to `"+r+"`, expected `object`.");for(var c in e){var u=e[c];if("function"!=typeof u)return f(r,o,l,c,y(u));var d=u(i,c,r,o,l+"."+c,a);if(d)return d}return null})},exact:function(e){return p(function(t,n,r,o,s){var c=t[n],u=E(c);if("object"!==u)return new m("Invalid "+o+" `"+s+"` of type `"+u+"` supplied to `"+r+"`, expected `object`.");var d=l({},t[n],e);for(var p in d){var v=e[p];if(i(e,p)&&"function"!=typeof v)return f(r,o,s,p,y(v));if(!v)return new m("Invalid "+o+" `"+s+"` key `"+p+"` supplied to `"+r+"`.\nBad object: "+JSON.stringify(t[n],null," ")+"\nValid keys: "+JSON.stringify(Object.keys(e),null," "));var g=v(c,p,r,o,s+"."+p,a);if(g)return g}return null})}};function d(e,t){return e===t?0!==e||1/e==1/t:e!=e&&t!=t}function m(e,t){this.message=e,this.data=t&&"object"==typeof t?t:{},this.stack=""}function p(e){var n={},o=0;function l(l,i,s,c,u,d,p){if(c=c||"<<anonymous>>",d=d||s,p!==a){if(t){var v=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 v.name="Invariant Violation",v}if("undefined"!=typeof console){var f=c+":"+s;!n[f]&&o<3&&(r("You are manually calling a React.PropTypes validation function for the `"+d+"` prop on `"+c+"`. This is deprecated and will throw in the standalone `prop-types` package. You may be seeing this warning due to a third-party PropTypes library. See https://fb.me/react-warning-dont-call-proptypes for details."),n[f]=!0,o++)}}return null==i[s]?l?new m(null===i[s]?"The "+u+" `"+d+"` is marked as required in `"+c+"`, but its value is `null`.":"The "+u+" `"+d+"` is marked as required in `"+c+"`, but its value is `undefined`."):null:e(i,s,c,u,d)}var i=l.bind(null,!1);return i.isRequired=l.bind(null,!0),i}function v(e){return p(function(t,n,r,o,l,a){var i=t[n];return E(i)!==e?new m("Invalid "+o+" `"+l+"` of type `"+y(i)+"` supplied to `"+r+"`, expected `"+e+"`.",{expectedType:e}):null})}function f(e,t,n,r,o){return new m((e||"React class")+": "+t+" type `"+n+"."+r+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+o+"`.")}function g(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(g);if(null===t||e(t))return!0;var r=function(e){var t=e&&(n&&e[n]||e["@@iterator"]);if("function"==typeof t)return t}(t);if(!r)return!1;var o,l=r.call(t);if(r!==t.entries){for(;!(o=l.next()).done;)if(!g(o.value))return!1}else for(;!(o=l.next()).done;){var a=o.value;if(a&&!g(a[1]))return!1}return!0;default:return!1}}function E(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 y(e){if(null==e)return""+e;var t=E(e);if("object"===t){if(e instanceof Date)return"date";if(e instanceof RegExp)return"regexp"}return t}function h(e){var t=y(e);switch(t){case"array":case"object":return"an "+t;case"boolean":case"date":case"regexp":return"a "+t;default:return t}}return m.prototype=Error.prototype,u.checkPropTypes=s,u.resetWarningCache=s.resetWarningCache,u.PropTypes=u,u}},"./node_modules/prop-types/index.js":(e,t,n)=>{var r=n("./node_modules/react-is/index.js");e.exports=n("./node_modules/prop-types/factoryWithTypeCheckers.js")(r.isElement,!0)},"./node_modules/prop-types/lib/ReactPropTypesSecret.js":e=>{e.exports="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"},"./node_modules/prop-types/lib/has.js":e=>{e.exports=Function.call.bind(Object.prototype.hasOwnProperty)},"./node_modules/react-is/cjs/react-is.development.js":(e,t)=>{!function(){var e="function"==typeof Symbol&&Symbol.for,n=e?Symbol.for("react.element"):60103,r=e?Symbol.for("react.portal"):60106,o=e?Symbol.for("react.fragment"):60107,l=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,f=e?Symbol.for("react.lazy"):60116,g=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 b(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 l:case m:return p;default:var g=p&&p.$$typeof;switch(g){case s:case d:case f:case v:case i:return g;default:return t}}case r:return t}}}var S=u,C=s,O=i,N=n,w=d,_=o,I=f,D=v,T=r,R=a,P=l,L=m,x=!1;function A(e){return b(e)===u}t.AsyncMode=c,t.ConcurrentMode=S,t.ContextConsumer=C,t.ContextProvider=O,t.Element=N,t.ForwardRef=w,t.Fragment=_,t.Lazy=I,t.Memo=D,t.Portal=T,t.Profiler=R,t.StrictMode=P,t.Suspense=L,t.isAsyncMode=function(e){return x||(x=!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.")),A(e)||b(e)===c},t.isConcurrentMode=A,t.isContextConsumer=function(e){return b(e)===s},t.isContextProvider=function(e){return b(e)===i},t.isElement=function(e){return"object"==typeof e&&null!==e&&e.$$typeof===n},t.isForwardRef=function(e){return b(e)===d},t.isFragment=function(e){return b(e)===o},t.isLazy=function(e){return b(e)===f},t.isMemo=function(e){return b(e)===v},t.isPortal=function(e){return b(e)===r},t.isProfiler=function(e){return b(e)===a},t.isStrictMode=function(e){return b(e)===l},t.isSuspense=function(e){return b(e)===m},t.isValidElementType=function(e){return"string"==typeof e||"function"==typeof e||e===o||e===u||e===a||e===l||e===m||e===p||"object"==typeof e&&null!==e&&(e.$$typeof===f||e.$$typeof===v||e.$$typeof===i||e.$$typeof===s||e.$$typeof===d||e.$$typeof===E||e.$$typeof===y||e.$$typeof===h||e.$$typeof===g)},t.typeOf=b}()},"./node_modules/react-is/index.js":(e,t,n)=>{e.exports=n("./node_modules/react-is/cjs/react-is.development.js")},"./node_modules/shallow-equal/dist/index.esm.js":(e,t,n)=>{function r(e,t){if(e===t)return!0;if(!e||!t)return!1;var n=Object.keys(e),r=Object.keys(t),o=n.length;if(r.length!==o)return!1;for(var l=0;l<o;l++){var a=n[l];if(e[a]!==t[a]||!Object.prototype.hasOwnProperty.call(t,a))return!1}return!0}function o(e,t){if(e===t)return!0;if(!e||!t)return!1;var n=e.length;if(t.length!==n)return!1;for(var r=0;r<n;r++)if(e[r]!==t[r])return!1;return!0}n.r(t),n.d(t,{shallowEqualArrays:()=>o,shallowEqualObjects:()=>r})},"./src/Component.ts":function(e,t,n){var r=this&&this.__rest||function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]])}return n},o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});var l=o(n("./src/useMediaQuery.ts"));t.default=function(e){var t=e.children,n=e.device,o=e.onChange,a=r(e,["children","device","onChange"]),i=(0,l.default)(a,n,o);return"function"==typeof t?t(i):i?t:null}},"./src/Context.ts":(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0});var r=(0,n("react").createContext)(void 0);t.default=r},"./src/index.ts":function(e,t,n){var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.Context=t.toQuery=t.useMediaQuery=t.default=void 0;var o=r(n("./src/useMediaQuery.ts"));t.useMediaQuery=o.default;var l=r(n("./src/Component.ts"));t.default=l.default;var a=r(n("./src/toQuery.ts"));t.toQuery=a.default;var i=r(n("./src/Context.ts"));t.Context=i.default},"./src/mediaQuery.ts":function(e,t,n){var r=this&&this.__assign||function(){return(r=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e}).apply(this,arguments)},o=this&&this.__rest||function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]])}return n},l=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});var a=l(n("./node_modules/prop-types/index.js")),i=a.default.oneOfType([a.default.string,a.default.number]),s={all:a.default.bool,grid:a.default.bool,aural:a.default.bool,braille:a.default.bool,handheld:a.default.bool,print:a.default.bool,projection:a.default.bool,screen:a.default.bool,tty:a.default.bool,tv:a.default.bool,embossed:a.default.bool},c={orientation:a.default.oneOf(["portrait","landscape"]),scan:a.default.oneOf(["progressive","interlace"]),aspectRatio:a.default.string,deviceAspectRatio:a.default.string,height:i,deviceHeight:i,width:i,deviceWidth:i,color:a.default.bool,colorIndex:a.default.bool,monochrome:a.default.bool,resolution:i,type:Object.keys(s)},u=o(c,["type"]),d=r({minAspectRatio:a.default.string,maxAspectRatio:a.default.string,minDeviceAspectRatio:a.default.string,maxDeviceAspectRatio:a.default.string,minHeight:i,maxHeight:i,minDeviceHeight:i,maxDeviceHeight:i,minWidth:i,maxWidth:i,minDeviceWidth:i,maxDeviceWidth:i,minColor:a.default.number,maxColor:a.default.number,minColorIndex:a.default.number,maxColorIndex:a.default.number,minMonochrome:a.default.number,maxMonochrome:a.default.number,minResolution:i,maxResolution:i},u),m=r(r({},s),d);t.default={all:m,types:s,matchers:c,features:d}},"./src/toQuery.ts":function(e,t,n){var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});var o=r(n("./node_modules/hyphenate-style-name/index.js")),l=r(n("./src/mediaQuery.ts"));t.default=function(e){var t=[];return Object.keys(l.default.all).forEach(function(n){var r=e[n];null!=r&&t.push(function(e,t){var n=(0,o.default)(e);return"number"==typeof t&&(t="".concat(t,"px")),!0===t?n:!1===t?"not ".concat(n):"(".concat(n,": ").concat(t,")")}(n,r))}),t.join(" and ")}},"./src/useMediaQuery.ts":function(e,t,n){var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});var o=n("react"),l=r(n("./node_modules/matchmediaquery/index.js")),a=r(n("./node_modules/hyphenate-style-name/index.js")),i=n("./node_modules/shallow-equal/dist/index.esm.js"),s=r(n("./src/toQuery.ts")),c=r(n("./src/Context.ts")),u=function(e){if(e)return Object.keys(e).reduce(function(t,n){return t[(0,a.default)(n)]=e[n],t},{})},d=function(){var e=(0,o.useRef)(!1);return(0,o.useEffect)(function(){e.current=!0},[]),e.current};t.default=function(e,t,n){var r=function(e){var t=(0,o.useContext)(c.default),n=function(){return u(e)||u(t)},r=(0,o.useState)(n),l=r[0],a=r[1];return(0,o.useEffect)(function(){var e=n();(0,i.shallowEqualObjects)(l,e)||a(e)},[e,t]),l}(t),a=function(e){var t=function(){return function(e){return e.query||(0,s.default)(e)}(e)},n=(0,o.useState)(t),r=n[0],l=n[1];return(0,o.useEffect)(function(){var e=t();r!==e&&l(e)},[e]),r}(e);if(!a)throw new Error("Invalid or missing MediaQuery!");var m=function(e,t){var n=function(){return(0,l.default)(e,t||{},!!t)},r=(0,o.useState)(n),a=r[0],i=r[1],s=d();return(0,o.useEffect)(function(){if(s){var e=n();return i(e),function(){e&&e.dispose()}}},[e,t]),a}(a,r),p=function(e){var t=(0,o.useState)(e.matches),n=t[0],r=t[1];return(0,o.useEffect)(function(){var t=function(e){r(e.matches)};return e.addListener(t),r(e.matches),function(){e.removeListener(t)}},[e]),n}(m),v=d();return(0,o.useEffect)(function(){v&&n&&n(p)},[p]),(0,o.useEffect)(function(){return function(){m&&m.dispose()}},[]),p}},react:t=>{t.exports=e}},n={};function r(e){var o=n[e];if(void 0!==o)return o.exports;var l=n[e]={exports:{}};return t[e].call(l.exports,l,l.exports,r),l.exports}return r.d=(e,t)=>{for(var n in t)r.o(t,n)&&!r.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},r.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),r.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r("./src/index.ts")})(),e.exports=n(r)}));const U=["digit-ui","works-ui","workbench-ui","health-ui","sanitation-ui","core-ui","mgramseva-web","sandbox-ui","kibana-v8"],B=()=>{const{isLoading:e,data:n}=Digit.Hooks.useAccessControl(),l=Digit.Utils.getMultiRootTenant(),a=(o.useTranslation(),i.useHistory()),s=Digit.ULBService.getStateId(),c={};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 r={};t.reduce((n,r,o)=>{if(o!==t.length-1)return n[r]={},n[r];n[r]={item:e}},r),function e(t,n){for(const r in n)n.hasOwnProperty(r)&&("object"!=typeof n[r]||Array.isArray(n[r])?t[r]||(t[r]=n[r]):(t[r]||(t[r]={}),e(t[r],n[r])))}(c,r)}});const u=e=>(e.sort((e,t)=>e.orderNumber-t.orderNumber),e.forEach(e=>{e.children&&e.children.length>0&&u(e.children)}),e),d=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,orderNumber:n.item.orderNumber};const r=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 r=t[n];if("item"===n&&""!==(null==r?void 0:r.leftIcon))return null==r?void 0:r.leftIcon;if("object"==typeof t[n]&&!Array.isArray(t[n])){const r=e(t[n]);if(r)return r}}return null}(n),width:"1.5rem",height:"1.5rem"},children:r}};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)})(c)),m=u(d);return e?r.createElement(t.Loader,null):c?r.createElement(k,{minWidth:768},r.createElement(t.Sidebar,{items:m,hideAccessbilityTools:!0,onSelect:e=>{let{item:t,index:n,parentIndex:r}=e;return(e=>{let{item:t}=e;null!=t&&t.navigationUrl&&function(e,t){var n,r;if(void 0===e&&(e={}),void 0===t&&(t=""),"/"!=t)if(-1===(null===(n=t)||void 0===n?void 0:n.indexOf("/"+(null===(r=window)||void 0===r?void 0:r.contextPath)))){const n=window.location.origin;let r=null;r=l?t=t.replace("/sandbox-ui/employee",`/sandbox-ui/${s}/employee`):null!=U&&U.every(e=>{var n;return-1===(null===(n=t)||void 0===n?void 0:n.indexOf("/"+e))})?n+"/employee/"+t:n+t,e.push(r)}else e.push(t)}(a,null==t?void 0:t.navigationUrl)})({item:t,index:n,parentIndex:r})},theme:"dark",variant:"primary",transitionDuration:"",className:"",styles:{},expandedWidth:"",collapsedWidth:"",onBottomItemClick:()=>{}})):""},j=e=>{let{CITIZEN:t,isSidebarOpen:n,toggleSidebar:o,handleLogout:l,mobileView:a,userDetails:i,modules:s,linkData:c,islinkDataLoading:u,userProfile:d}=e;return t?r.createElement(A,{isOpen:n,isMobile:!0,toggleSidebar:o,onLogout:l,linkData:c,islinkDataLoading:u,userProfile:d,isEmployee:!1}):!n&&null!=i&&i.access_token?r.createElement("div",{className:"digit-employeeSidebar"},r.createElement(B,{mobileView:a,userDetails:i,modules:s})):r.createElement("div",{className:"digit-citizenSidebar"},r.createElement(A,{isOpen:n,isMobile:!0,toggleSidebar:o,onLogout:l,isEmployee:!0,userProfile:d}))},F=e=>{let{t:t,stateInfo:o,userDetails:l,CITIZEN:a,cityDetails:s,mobileView:c,handleUserDropdownSelection:u,logoUrl:d,showSidebar:m=!0,showLanguageChange:p,linkData:v,islinkDataLoading:f}=e;const[g,E]=n.useState(!1),y=i.useHistory(),[h,b]=n.useState(!1),S=()=>{E(!1),b(!0)},C=()=>{b(!1)},O=()=>{E(!g)},N=()=>{var e,t;y.push(a?`/${null===(e=window)||void 0===e?void 0:e.contextPath}/citizen/user/profile`:`/${null===(t=window)||void 0===t?void 0:t.contextPath}/employee/user/profile`)},w=[{name:t("EDIT_PROFILE"),icon:"Edit",func:N},{name:t("CORE_COMMON_LOGOUT"),icon:"Logout",func:S}];return r.createElement(r.Fragment,null,r.createElement(D,{t:t,stateInfo:o,toggleSidebar:O,isSidebarOpen:g,handleLogout:S,userDetails:l,CITIZEN:a,cityDetails:s,mobileView:c,userOptions:w,handleUserDropdownSelection:u,logoUrl:d,showLanguageChange:p}),h&&r.createElement(R,{onSelect:()=>{Digit.UserService.logout(),b(!1)},onCancel:C,onDismiss:C}),a?a?m&&g&&r.createElement(j,{t:t,CITIZEN:a,isSidebarOpen:g,toggleSidebar:O,handleLogout:S,mobileView:c,userDetails:l,linkData:v,userProfile:N,islinkDataLoading:f}):null:m&&r.createElement(j,{t:t,CITIZEN:a,isSidebarOpen:g,toggleSidebar:O,handleLogout:S,mobileView:c,userDetails:l,linkData:v,userProfile:N,islinkDataLoading:f}))},V=e=>{const{question:l,answer:a,lastIndex:i}=e,[s,c]=n.useState(!1),{t:u}=o.useTranslation();return r.createElement("div",{className:"faqs border-none",onClick:()=>c(!s)},r.createElement("div",{className:"faq-question",style:{justifyContent:"space-between",display:"flex"}},r.createElement("span",null,u(l)),r.createElement("span",{className:s?"faqicon rotate":"faqicon",style:{float:"right"}},r.createElement(t.ArrowForward,null))),r.createElement("div",{className:"faq-answer",style:s?{display:"block"}:{display:"none"}},r.createElement("span",null,u(a))),i?null:r.createElement("div",{className:"cs-box-border"}))},H=e=>{var l,a,i;let{module:s}=e;const c=Digit.UserService.getUser(),{t:u}=((null==c||null===(l=c.info)||void 0===l?void 0:l.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?r.createElement(t.Loader,null):r.createElement(n.Fragment,null,r.createElement("div",{className:"faq-page"},r.createElement(t.BackButton,{style:{marginLeft:"unset"}}),r.createElement("div",{style:{marginBottom:"15px"}},r.createElement(t.Header,{styles:{marginLeft:"0px",paddingTop:"10px",fontSize:"32px"}},u("FAQ_S"))),r.createElement("div",{className:"faq-list"},p.map((e,t)=>r.createElement(V,{key:"faq_"+t,question:e.question,answer:e.answer,lastIndex:t===(null==p?void 0:p.length)-1})))))},$=()=>{var e,t,n,l,a,c,u,d,m,p,v,f,E,y,h,b,S,C,O,N,w,_,I,D,T,R,P;const{t:L}=o.useTranslation(),x=i.useHistory(),A=Digit.ULBService.getCitizenCurrentTenant(!0),{data:{uiHomePage:M}={},isLoading:k}=Digit.Hooks.useStore.getInitData();let U=window.Digit.Utils.browser.isMobile();const B=()=>{var e,t,n,r,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===(r=Digit.UserService)||void 0===r||null===(o=r.getUser())||void 0===o||!o.access_token)},{data:j,isLoading:F}=Digit.Hooks.useEvents({tenantId:A,variant:"whats-new",config:{enabled:B()}});var V;A||x.push(`/${null===(V=window)||void 0===V?void 0:V.contextPath}/citizen/select-language`);const H=null==M?void 0:M.appBannerDesktop,$=null==M?void 0:M.appBannerMobile,z=null==M?void 0:M.citizenServicesCard,G=null==M?void 0:M.informationAndUpdatesCard,W=null==M?void 0:M.whatsAppBannerDesktop,q=null==M?void 0:M.whatsAppBannerMobile,X=null==M?void 0:M.whatsNewSection,Z=null==M?void 0:M.redirectURL;var Y,Q;Z&&x.push(`/${null===(Y=window)||void 0===Y?void 0:Y.contextPath}/citizen/${Z}`),(null!==(e=window)&&void 0!==e&&null!==(t=e.location)&&void 0!==t&&null!==(n=t.href)&&void 0!==n&&null!==(l=n.includes)&&void 0!==l&&l.call(n,"sanitation-ui")||null!==(a=window)&&void 0!==a&&null!==(c=a.location)&&void 0!==c&&null!==(u=c.href)&&void 0!==u&&null!==(d=u.includes)&&void 0!==d&&d.call(u,"sandbox-ui"))&&x.push(`/${null===(Q=window)||void 0===Q?void 0:Q.contextPath}/citizen/all-services`);const J=e=>{window.open(null==e?void 0:e.navigationUrl)},K={header:L(null==z?void 0:z.headerLabel),sideOption:{name:L(null==z||null===(m=z.sideOption)||void 0===m?void 0:m.name),onClick:()=>{var e;return x.push(null==z||null===(e=z.sideOption)||void 0===e?void 0:e.navigationUrl)}},options:[{name:L(null==z||null===(p=z.props)||void 0===p||null===(v=p[0])||void 0===v?void 0:v.label),Icon:r.createElement(s.ComplaintIcon,null),onClick:()=>{var e,t;return x.push(null==z||null===(e=z.props)||void 0===e||null===(t=e[0])||void 0===t?void 0:t.navigationUrl)}},{name:L(null==z||null===(f=z.props)||void 0===f||null===(E=f[1])||void 0===E?void 0:E.label),Icon:r.createElement(s.PTIcon,{className:"fill-path-primary-main"}),onClick:()=>{var e,t;return x.push(null==z||null===(e=z.props)||void 0===e||null===(t=e[1])||void 0===t?void 0:t.navigationUrl)}},{name:L(null==z||null===(y=z.props)||void 0===y||null===(h=y[2])||void 0===h?void 0:h.label),Icon:r.createElement(s.CaseIcon,{className:"fill-path-primary-main"}),onClick:()=>{var e,t;return x.push(null==z||null===(e=z.props)||void 0===e||null===(t=e[2])||void 0===t?void 0:t.navigationUrl)}},{name:L(null==z||null===(b=z.props)||void 0===b||null===(S=b[3])||void 0===S?void 0:S.label),Icon:r.createElement(s.OBPSIcon,null),onClick:()=>{var e,t;return x.push(null==z||null===(e=z.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%"}},ee={header:L(null==G?void 0:G.headerLabel),sideOption:{name:L(null==G||null===(C=G.sideOption)||void 0===C?void 0:C.name),onClick:()=>{var e;return x.push(null==G||null===(e=G.sideOption)||void 0===e?void 0:e.navigationUrl)}},options:[{name:L(null==G||null===(O=G.props)||void 0===O||null===(N=O[0])||void 0===N?void 0:N.label),Icon:r.createElement(s.HomeIcon,null),onClick:()=>{var e,t;return x.push(null==G||null===(e=G.props)||void 0===e||null===(t=e[0])||void 0===t?void 0:t.navigationUrl)}},{name:L(null==G||null===(w=G.props)||void 0===w||null===(_=w[1])||void 0===_?void 0:_.label),Icon:r.createElement(s.Calender,null),onClick:()=>{var e,t;return x.push(null==G||null===(e=G.props)||void 0===e||null===(t=e[1])||void 0===t?void 0:t.navigationUrl)}},{name:L(null==G||null===(I=G.props)||void 0===I||null===(D=I[2])||void 0===D?void 0:D.label),Icon:r.createElement(s.DocumentIcon,null),onClick:()=>{var e,t;return x.push(null==G||null===(e=G.props)||void 0===e||null===(t=e[2])||void 0===t?void 0:t.navigationUrl)}},{name:L(null==G||null===(T=G.props)||void 0===T||null===(R=T[3])||void 0===R?void 0:R.label),Icon:r.createElement(s.DocumentIcon,null),onClick:()=>{var e,t;return x.push(null==G||null===(e=G.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 k?r.createElement(s.Loader,null):r.createElement("div",{className:"HomePageContainer"},r.createElement("div",{className:"HomePageWrapper"},r.createElement("div",{className:"BannerWithSearch"},r.createElement("img",U?{src:null==$?void 0:$.bannerUrl}:{src:null==H?void 0:H.bannerUrl}),r.createElement("div",{className:"ServicesSection"},r.createElement(s.CardBasedOptions,g({style:{marginTop:"-30px"}},K)),r.createElement(s.CardBasedOptions,g({style:U?{}:{marginTop:"-30px"}},ee)))),(q||W)&&r.createElement("div",{className:"WhatsAppBanner"},r.createElement("img",U?{src:null==q?void 0:q.bannerUrl,onClick:()=>J(q)}:{src:null==W?void 0:W.bannerUrl,onClick:()=>J(W)})),B()?F?r.createElement(s.Loader,null):r.createElement("div",{className:"WhatsNewSection"},r.createElement("div",{className:"headSection"},r.createElement("h2",null,L(null==X?void 0:X.headerLabel)),r.createElement("p",{onClick:()=>{var e;return x.push(null==X||null===(e=X.sideOption)||void 0===e?void 0:e.navigationUrl)}},L(null==X||null===(P=X.sideOption)||void 0===P?void 0:P.name))),r.createElement(s.WhatsNewCard,null==j?void 0:j[0])):null))},z=()=>{const{t:e}=o.useTranslation(),l=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?r.createElement(t.Loader,null):r.createElement("div",{className:"selection-card-wrapper"},r.createElement(t.PageBasedInput,{texts:d,onSubmit:function(){var e;l.push(`/${null===(e=window)||void 0===e?void 0:e.contextPath}/citizen/select-location`)}},r.createElement(t.CardHeader,null,e("CS_COMMON_CHOOSE_LANGUAGE")),r.createElement(t.RadioButtons,m)))},G=()=>{const{t:e}=o.useTranslation(),l=i.useHistory(),a=i.useLocation(),{data:{uiHomePage:c}={}}=Digit.Hooks.useStore.getInitData(),u=null==c?void 0:c.redirectURL,{data:d,isLoading:m}=Digit.Hooks.useTenants(),{data:p}=Digit.Hooks.useTenantManagementSearch({stateId:Digit.ULBService.getStateId(),includeSubTenants:!0,config:{enabled:Digit.Utils.getMultiRootTenant()}}),[v,f]=n.useState(()=>({code:Digit.ULBService.getCitizenCurrentTenant(!0)})),[E,y]=n.useState(!1),h=n.useMemo(()=>({header:e("CS_COMMON_CHOOSE_LOCATION"),submitBarLabel:e("CORE_COMMON_CONTINUE")}),[e]);function b(e){f(e),y(!1)}const S=n.useMemo(()=>({options:Digit.Utils.getMultiRootTenant()?p:d,optionsKey:"i18nKey",additionalWrapperClass:"digit-reverse-radio-selection-wrapper",onSelect:b,selectedOption:v}),[p,d,e,v]);return m?r.createElement("loader",null):r.createElement("div",{className:"selection-card-wrapper"},r.createElement(t.BackLink,{onClick:()=>window.history.back()}),r.createElement(s.PageBasedInput,{texts:h,onSubmit:function(){if(v){var e;Digit.SessionStorage.set("CITIZEN.COMMON.HOME.CITY",v);const r=null===(e=a.state)||void 0===e?void 0:e.redirectBackTo;var t,n;u?l.push(`/${null===(t=window)||void 0===t?void 0:t.contextPath}/citizen/${u}`):r?l.replace(r):l.push(`/${null===(n=window)||void 0===n?void 0:n.contextPath}/citizen`)}else y(!0)},className:"location-selection-container"},r.createElement(s.CardHeader,null,e("CS_COMMON_CHOOSE_LOCATION")),r.createElement(s.SearchOnRadioButtons,g({},S,{placeholder:e("COMMON_TABLE_SEARCH")})),E?r.createElement(s.CardLabelError,null,e("CS_COMMON_LOCATION_SELECTION_ERROR")):null))},W=function(){function e(){}return e.prototype.then=function(t,n){const r=new e,o=this.s;if(o){const e=1&o?t:n;if(e){try{q(r,1,e(this.v))}catch(e){q(r,2,e)}return r}return this}return this.o=function(e){try{const o=e.v;1&e.s?q(r,1,t?t(o):o):n?q(r,1,n(o)):q(r,2,o)}catch(e){q(r,2,e)}},r},e}();function q(e,t,n){if(!e.s){if(n instanceof W){if(!n.s)return void(n.o=q.bind(null,e,t));1&t&&(t=n.s),n=n.v}if(n&&n.then)return void n.then(q.bind(null,e,t),q.bind(null,e,2));e.s=t,e.v=n;const r=e.o;r&&r(e)}}function X(e){return e instanceof W&&1&e.s}const Z="undefined"!=typeof Symbol?Symbol.iterator||(Symbol.iterator=Symbol("Symbol.iterator")):"@@iterator";function Y(e,t,n){if("function"==typeof e[Z]){var r,o,l,a=e[Z]();if(function e(i){try{for(;!((r=a.next()).done||n&&n());)if((i=t(r.value))&&i.then){if(!X(i))return void i.then(e,l||(l=q.bind(null,o=new W,2)));i=i.v}o?q(o,1,i):o=i}catch(e){q(o||(o=new W),2,e)}}(),a.return){var i=function(e){try{r.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 r,o,l=-1;return function a(i){try{for(;++l<e.length&&(!n||!n());)if((i=t(l))&&i.then){if(!X(i))return void i.then(a,o||(o=q.bind(null,r=new W,2)));i=i.v}r?q(r,1,i):r=i}catch(e){q(r||(r=new W),2,e)}}(),r}(s,function(e){return t(s[e])},n)}function Q(e,t){try{var n=e()}catch(e){return t(e)}return n&&n.then?n.then(void 0,t):n}function J(e){let{setProfilePic:t,closeDrawer:l,userType:a,removeProfilePic:i,showToast:c}=e;const[u,d]=n.useState(null),[m,p]=n.useState(""),[v,f]=n.useState(null),{t:g}=o.useTranslation();return n.useEffect(()=>{!function(){try{f(null);const e=function(){if(m){const e=function(){if(m.size>=1e6)c("error",g("CORE_COMMON_PROFILE_MAXIMUM_UPLOAD_SIZE_EXCEEDED")),f(g("CORE_COMMON_PROFILE_MAXIMUM_UPLOAD_SIZE_EXCEEDED"));else{const e=Q(function(){return Promise.resolve(Digit.UploadServices.Filestorage(a+"-profile",m,Digit.ULBService.getStateId())).then(function(e){var n,r;if((null==e||null===(n=e.data)||void 0===n||null===(r=n.files)||void 0===r?void 0:r.length)>0){var o,l;const n=null==e||null===(o=e.data)||void 0===o||null===(l=o.files[0])||void 0===l?void 0:l.fileStoreId;d(n),t(n)}else c("error",g("CORE_COMMON_PROFILE_FILE_UPLOAD_ERROR")),f(g("CORE_COMMON_PROFILE_FILE_UPLOAD_ERROR"))})},function(){c("error",g("CORE_COMMON_PROFILE_INVALID_FILE_INPUT"))});if(e&&e.then)return e.then(function(){})}}();if(e&&e.then)return e.then(function(){})}}();e&&e.then&&e.then(function(){})}catch(e){Promise.reject(e)}}()},[m]),r.createElement(r.Fragment,null,r.createElement("div",{style:{position:"fixed",top:"0",left:"0",right:"0",bottom:"0",width:"100%",height:"100vh",backgroundColor:"rgba(0,0,0,.5)"},onClick:()=>l()}),r.createElement("div",{style:{width:"100%",justifyContent:"space-between",display:"flex",backgroundColor:"white",alignItems:"center",position:"fixed",left:"0",right:"0",height:"20%",bottom:"citizen"===a?"2.5rem":"0",zIndex:"1000"}},r.createElement("div",{style:{display:"flex",flex:"1",flexDirection:"column",width:"100%",justifyContent:"center",alignItems:"center",gap:"8px 0"}},r.createElement("label",{for:"file",style:{cursor:"pointer"}}," ",r.createElement(s.GalleryIcon,null)),r.createElement("label",{style:{cursor:"pointer"}}," Gallery"),r.createElement("input",{type:"file",id:"file",accept:"image/*, .png, .jpeg, .jpg",onChange:e=>p(e.target.files[0]),style:{display:"none"}})),r.createElement("div",{style:{display:"flex",flex:"1",width:"100%",justifyContent:"center",alignItems:"center",flexDirection:"column",gap:"8px 0"}},r.createElement("button",{onClick:()=>{i(),l()}},r.createElement(s.RemoveIcon,null)),r.createElement("label",{style:{cursor:"pointer"}},"Remove"))))}"undefined"!=typeof Symbol&&(Symbol.asyncIterator||(Symbol.asyncIterator=Symbol("Symbol.asyncIterator")));const K=e=>{var l,a,c,u,d,m,p,v,f,E,y;let{stateCode:h,userType:b,cityDetails:S}=e;i.useHistory();const{t:C}=o.useTranslation(),O=window.location.href,N=Digit.ULBService.getStateId(),w=Digit.ULBService.getCurrentTenantId(),_=(null===(l=Digit.UserService.getUser())||void 0===l?void 0:l.info)||{},[I,D]=n.useState(null),[T,R]=n.useState(null!=_&&_.name?_.name:""),[P,L]=n.useState(null!=_&&_.emailId?_.emailId:""),[x,A]=n.useState(null==I?void 0:I.gender),[M,k]=n.useState(null!=_&&_.permanentCity?_.permanentCity:S.name),[U,B]=n.useState(null!=_&&_.mobileNumber?_.mobileNumber:""),[j,F]=n.useState(null),[V,H]=n.useState(""),[$,z]=n.useState(!1),[G,W]=n.useState(!1),[q,X]=n.useState(""),[Z,Y]=n.useState(""),[K,ee]=n.useState(""),[te,ne]=n.useState(null),[re,oe]=n.useState(!1),[le,ae]=r.useState(window.innerWidth),[ie,se]=r.useState({}),ce=window.Digit.Utils.browser.isMobile();r.useEffect(()=>(window.addEventListener("resize",()=>ae(window.innerWidth)),()=>{window.removeEventListener("resize",()=>ae(window.innerWidth))})),n.useEffect(()=>{var e;oe(!0),function(){try{const e=null==_?void 0:_.uuid,t=function(){if(e)return Promise.resolve(Digit.UserService.userSearch(w,{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)}}(),A({i18nKey:void 0,code:null==I?void 0:I.gender,value:null==I?void 0:I.gender});const t=null==I||null===(e=I.photo)||void 0===e?void 0:e.split(",");H(null==t?void 0:t.at(0)),oe(!1)},[null!==I]);let ue={};const de=e=>A(e),me=()=>z(!1),pe=e=>{R(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==_?void 0:_.userName)!==e?(L(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})},fe=function(e,t,n){void 0===n&&(n=5e3),ne({key:e,action:t}),setTimeout(()=>{ne(null)},n)},ge=function(){try{let t=!1;function e(e){if(t)return e;oe(!1)}oe(!0);const n=Q(function(){const e={..._,name:T,gender:null==x?void 0:x.value,emailId:P,photo:j};if(!new RegExp(/^([a-zA-Z ])*$/).test(T)||""===T||T.length>50||T.length<1)throw JSON.stringify({type:"error",message:C("CORE_COMMON_PROFILE_NAME_INVALID")});if("employee"===b&&!new RegExp(/^[6-9]{1}[0-9]{9}$/).test(U))throw JSON.stringify({type:"error",message:C("CORE_COMMON_PROFILE_MOBILE_NUMBER_INVALID")});if(P.length&&(!P.includes("@")||!P.includes(".")))throw JSON.stringify({type:"error",message:C("CORE_COMMON_PROFILE_EMAIL_INVALID")});if(G&&(q.length||Z.length||K.length)){if(Z!==K)throw JSON.stringify({type:"error",message:C("CORE_COMMON_PROFILE_PASSWORD_MISMATCH")});if(!(q.length&&Z.length&&K.length))throw JSON.stringify({type:"error",message:C("CORE_COMMON_PROFILE_PASSWORD_INVALID")});if(!new RegExp(/^([a-zA-Z0-9@#$%]{8,15})$/i).test(Z)&&!new RegExp(/^([a-zA-Z0-9@#$%]{8,15})$/i).test(K))throw JSON.stringify({type:"error",message:C("CORE_COMMON_PROFILE_PASSWORD_INVALID")})}return Promise.resolve(Digit.UserService.updateUser(e,h)).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:P,permanentCity:M}})}return function(){if(q.length&&Z.length&&K.length){const e={existingPassword:q,newPassword:Z,tenantId:w,type:"EMPLOYEE",username:null==_?void 0:_.userName,confirmPassword:K};return function(){if(Z===K)return Q(function(){return Promise.resolve(Digit.UserService.changePassword(e,w)).then(function(e){const{responseInfo:t}=e;if(null==t||!t.status||"200"!==t.status)throw"";fe("success",C("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&&fe("success",C("CORE_COMMON_PROFILE_UPDATE_SUCCESS"),5e3)}()})},function(e){const t=JSON.parse(e);fe(t.type,C(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(N,"common-masters","GenderType");return ye&&ye.map(e=>{Ee.push({i18nKey:"PT_COMMON_GENDER_"+e.code,code:""+e.code,value:""+e.code})}),re?r.createElement(t.Loader,null):r.createElement("div",{className:"user-profile"},r.createElement("section",{style:{margin:"citizen"===b||ce?"8px":"24px"}},"citizen"===b||ce?r.createElement(t.BackLink,{onClick:()=>window.history.back()}):r.createElement(t.BreadCrumb,{crumbs:[{path:`/${null===(a=window)||void 0===a?void 0:a.contextPath}/employee`,content:C("ES_COMMON_HOME"),show:!0},{path:`/${null===(c=window)||void 0===c?void 0:c.contextPath}/employee/user/profile`,content:C("ES_COMMON_PAGE_1"),show:O.includes("/user/profile")}]})),r.createElement("div",{style:{display:"flex",flex:1,flexDirection:le<768||"citizen"===b?"column":"row",margin:"citizen"===b?"8px":"16px",gap:"citizen"===b?"":"0 24px",boxShadow:"citizen"===b?"1px 1px 4px 0px rgba(0,0,0,0.2)":"",background:"citizen"===b?"white":"",borderRadius:"citizen"===b?"4px":"",maxWidth:"citizen"===b?"960px":""}},r.createElement("section",{style:{position:"relative",display:"flex",flex:"citizen"===b?1:2.5,justifyContent:"center",alignItems:"center",maxWidth:"100%",borderRadius:"4px",boxShadow:"citizen"===b?"":"1px 1px 4px 0px rgba(0,0,0,0.2)",border:("citizen"===b?"8px":"24px")+" solid #fff",background:"#EEEEEE",padding:"citizen"===b?"8px":"16px"}},r.createElement("div",{style:{position:"relative",height:"citizen"===b?"114px":"150px",width:"citizen"===b?"114px":"150px",margin:"16px"}},r.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"}),r.createElement("button",{style:{position:"absolute",left:"50%",bottom:"-24px",transform:"translateX(-50%)"},onClick:()=>z(!$)},r.createElement(s.CameraIcon,null)))),r.createElement("section",{style:{display:"flex",flexDirection:"column",flex:"citizen"===b?1:7.5,width:"100%",borderRadius:"4px",height:"fit-content",boxShadow:"citizen"===b?"":"1px 1px 4px 0px rgba(0,0,0,0.2)",background:"white",padding:"citizen"===b?"8px":"24px",paddingBottom:"20px"}},"citizen"===b?r.createElement(r.Fragment,null,r.createElement(t.LabelFieldPair,null,r.createElement(t.CardLabel,{className:"user-profile",style:{}},""+C("CORE_COMMON_PROFILE_NAME"),"*"),r.createElement("div",{style:{width:"40rem",maxWidth:"960px"}},r.createElement(t.TextInput,g({t:C,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:C("CORE_COMMON_PROFILE_NAME_ERROR_MESSAGE")},{disable:!1})),(null==ie?void 0:ie.userName)&&r.createElement(t.ErrorMessage,{message:C(null==ie||null===(u=ie.userName)||void 0===u?void 0:u.message),truncateMessage:!0,maxLength:256,className:"",wrapperClassName:"",showIcon:!0}))),r.createElement(t.LabelFieldPair,null,r.createElement(t.CardLabel,{className:"user-profile",style:{}},""+C("CORE_COMMON_PROFILE_GENDER")),r.createElement(t.Dropdown,{style:{width:"40rem"},className:"form-field",selected:1===(null==x?void 0:x.length)?x[0]:x,disable:1===(null==x?void 0:x.length)||!1,option:Ee,select:de,value:x,optionKey:"code",t:C,name:"gender"})),r.createElement(t.LabelFieldPair,null,r.createElement(t.CardLabel,{className:"user-profile",style:{}},""+C("CORE_COMMON_PROFILE_EMAIL")),r.createElement("div",{style:{width:"40rem"}},r.createElement(t.TextInput,{t:C,style:{width:"100%"},type:"email",isMandatory:!1,optionKey:"i18nKey",name:"email",value:P,onChange:e=>ve(e.target.value),disabled:!1}),(null==ie?void 0:ie.emailAddress)&&r.createElement(t.ErrorMessage,{message:C(null==ie||null===(d=ie.emailAddress)||void 0===d?void 0:d.message),truncateMessage:!0,maxLength:256,className:"",wrapperClassName:"",showIcon:!0}))),r.createElement("button",{onClick:ge,style:{marginTop:"24px",backgroundColor:"#F47738",width:"100%",height:"40px",color:"white",maxWidth:ce?"100%":"240px",borderBottom:"1px solid black"}},C("CORE_COMMON_SAVE"))):r.createElement(r.Fragment,null,r.createElement(t.LabelFieldPair,{style:{display:"flex"}},r.createElement(t.CardLabel,{className:"profile-label-margin",style:{width:"300px"}},""+C("CORE_COMMON_PROFILE_NAME"),"*"),r.createElement("div",{style:{width:"100%"}},r.createElement(t.TextInput,g({t:C,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:C("CORE_COMMON_PROFILE_NAME_ERROR_MESSAGE")},{disabled:!1})),(null==ie?void 0:ie.userName)&&r.createElement(t.ErrorMessage,{message:C(null==ie||null===(m=ie.userName)||void 0===m?void 0:m.message),truncateMessage:!0,maxLength:256,className:"",wrapperClassName:"",showIcon:!0}))),r.createElement(t.LabelFieldPair,{style:{display:"flex"}},r.createElement(t.CardLabel,{className:"profile-label-margin",style:{width:"300px"}},""+C("CORE_COMMON_PROFILE_GENDER")),r.createElement("div",{style:{width:"100%"}},r.createElement(t.Dropdown,{selected:1===(null==x?void 0:x.length)?x[0]:x,disable:1===(null==x?void 0:x.length)||!1,option:Ee,select:de,value:x,optionKey:"code",t:C,name:"gender"}))),r.createElement(t.LabelFieldPair,{style:{display:"flex"}},r.createElement(t.CardLabel,{className:"profile-label-margin",style:{width:"300px"}},""+C("CORE_COMMON_PROFILE_CITY")),r.createElement("div",{style:{width:"100%"}},r.createElement(t.TextInput,g({t:C,type:"text",isMandatory:!1,name:"city",value:C(Digit.Utils.locale.getTransformedLocale("TENANT_TENANTS_"+w)),onChange:e=>k(e.target.value),placeholder:"Enter Your City Name"},ue={isRequired:!0,type:"text",title:C("CORE_COMMON_PROFILE_CITY_ERROR_MESSAGE")},{disabled:!0})),r.createElement(t.ErrorMessage,null))),r.createElement(t.LabelFieldPair,{style:{display:"flex"}},r.createElement(t.CardLabel,{className:"profile-label-margin",style:{width:"300px"}},C("CORE_COMMON_PROFILE_MOBILE_NUMBER")+"*"),r.createElement("div",{style:{width:"100%"}},r.createElement(t.MobileNumber,{value:U,style:{width:"100%"},name:"mobileNumber",placeholder:"Enter a valid Mobile No.",onChange:e=>(e=>{B(e),"employee"!==b||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:!Digit.Utils.getMultiRootTenant(),required:!0,pattern:"[6-9]{1}[0-9]{9}",type:"tel",title:C("CORE_COMMON_PROFILE_MOBILE_NUMBER_INVALID")}),(null==ie?void 0:ie.mobileNumber)&&r.createElement(t.ErrorMessage,{message:C(null==ie||null===(p=ie.mobileNumber)||void 0===p?void 0:p.message),truncateMessage:!0,maxLength:256,className:"",wrapperClassName:"",showIcon:!0}))),r.createElement(t.LabelFieldPair,{style:{display:"flex"}},r.createElement(t.CardLabel,{className:"profile-label-margin",style:{width:"300px"}},""+C("CORE_COMMON_PROFILE_EMAIL")),r.createElement("div",{style:{width:"100%"}},r.createElement(t.TextInput,{t:C,type:"email",isMandatory:!1,placeholder:C("EMAIL_VALIDATION"),optionKey:"i18nKey",name:"email",value:P,onChange:e=>ve(e.target.value),disabled:!!Digit.Utils.getMultiRootTenant()}),(null==ie?void 0:ie.emailAddress)&&r.createElement(t.ErrorMessage,{message:C(null==ie||null===(v=ie.emailAddress)||void 0===v?void 0:v.message),truncateMessage:!0,maxLength:256,className:"",wrapperClassName:"",showIcon:!0}))),r.createElement(t.LabelFieldPair,null,r.createElement("div",{style:{width:"100%"}},0!=G||Digit.Utils.getOTPBasedLogin()?null:r.createElement(t.Button,{label:C("CORE_COMMON_CHANGE_PASSWORD"),variation:"teritiary",onClick:()=>W(!G),style:{paddingLeft:"0rem"}}),G?r.createElement("div",{style:{marginTop:"10px"}},r.createElement(t.LabelFieldPair,{style:{display:"flex"}},r.createElement(t.CardLabel,{className:"profile-label-margin",style:{width:"300px"}},""+C("CORE_COMMON_PROFILE_CURRENT_PASSWORD")),r.createElement("div",{style:{width:"100%"}},r.createElement(t.TextInput,{t:C,type:"password",isMandatory:!1,name:"name",pattern:"^([a-zA-Z0-9@#$%])+$",onChange:e=>{return X(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)&&r.createElement(t.ErrorMessage,{message:C(null==ie||null===(f=ie.currentPassword)||void 0===f?void 0:f.message),truncateMessage:!0,maxLength:256,className:"",wrapperClassName:"",showIcon:!0}))),r.createElement(t.LabelFieldPair,{style:{display:"flex"}},r.createElement(t.CardLabel,{className:"profile-label-margin",style:{width:"300px"}},""+C("CORE_COMMON_PROFILE_NEW_PASSWORD")),r.createElement("div",{style:{width:"100%"}},r.createElement(t.TextInput,{t:C,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,newPassword:null}):se({...ie,newPassword:{type:"pattern",message:"CORE_COMMON_PROFILE_PASSWORD_INVALID"}}));var t},disabled:!1}),(null==ie?void 0:ie.newPassword)&&r.createElement(t.ErrorMessage,{message:C(null==ie||null===(E=ie.newPassword)||void 0===E?void 0:E.message),truncateMessage:!0,maxLength:256,className:"",wrapperClassName:"",showIcon:!0}))),r.createElement(t.LabelFieldPair,{style:{display:"flex"}},r.createElement(t.CardLabel,{className:"profile-label-margin",style:{width:"300px"}},""+C("CORE_COMMON_PROFILE_CONFIRM_PASSWORD")),r.createElement("div",{style:{width:"100%"}},r.createElement(t.TextInput,{t:C,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)&&r.createElement(t.ErrorMessage,{message:C(null==ie||null===(y=ie.confirmPassword)||void 0===y?void 0:y.message),truncateMessage:!0,maxLength:256,className:"",wrapperClassName:"",showIcon:!0})))):"")),"employee"===b&&ce?r.createElement("button",{onClick:ge,style:{marginTop:"24px",backgroundColor:"#F47738",width:"100%",height:"40px",color:"white",maxWidth:ce?"100%":"240px",borderBottom:"1px solid black",fontWeight:"700",fontSize:"17px"}},C("CORE_COMMON_SAVE")):null))),"employee"!==b||ce?null:r.createElement(t.ActionBar,{actionFields:[r.createElement(t.SubmitBar,{t:C,label:C("CORE_COMMON_SAVE"),onSubmit:ge})],className:"",setactionFieldsToRight:!0}),te&&r.createElement(t.Toast,{type:te.key,label:C("success"===te.key?"CORE_COMMON_PROFILE_UPDATE_SUCCESS":te.action),onClose:()=>ne(null),style:{maxWidth:"670px"}}),1==$?r.createElement(J,{setProfilePic:function(e){try{function t(e){H(null==e?void 0:e.thumbs[0]),me()}return F(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],N)).then(t):t(null))}catch(e){return Promise.reject(e)}},closeDrawer:me,userType:b,removeProfilePic:()=>{F(null),H(null)},showToast:fe}):"")},ee=e=>{var l,a,i;let{module:c}=e;const u=Digit.UserService.getUser(),{t:d}=((null==u||null===(l=u.info)||void 0===l?void 0:l.tenantId)||Digit.ULBService.getCurrentTenantId(),o.useTranslation()),m=Digit.SessionStorage.get("initData").stateInfo,p=Digit.StoreData.getCurrentLanguage(),[v,f]=n.useState(p),[g,E]=n.useState(!1),[y,h]=n.useState(""),b=()=>r.createElement("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},r.createElement("path",{d:"M12 24C5.38053 24 0 18.6143 0 12C0 5.38054 5.38053 1.90735e-06 12 1.90735e-06C18.6143 1.90735e-06 24 5.38054 24 12C24 18.6143 18.6143 24 12 24ZM16.3488 10.7852L11.3855 7.25251C11.1263 7.0701 10.8238 6.97889 10.5214 6.97889C10.291 6.97889 10.0557 7.03172 9.83976 7.14202C9.34054 7.40118 9.02857 7.91006 9.02857 8.46694L9.02877 15.5323C9.02877 16.0892 9.34076 16.5979 9.83996 16.8572C10.3344 17.1116 10.9296 17.0732 11.3857 16.7467L16.349 13.214C16.7426 12.9356 16.9778 12.4795 16.9778 11.9996C16.9776 11.5197 16.7426 11.0636 16.3489 10.7852L16.3488 10.7852Z",fill:"white"})),{isLoading:S,data:C}=Digit.Hooks.useGetHowItWorksJSON(Digit.ULBService.getStateId()),O=null==C||null===(a=C.MdmsRes["common-masters"])||void 0===a||null===(i=a.howItWorks[0])||void 0===i?void 0:i[""+c];return S?r.createElement(t.Loader,null):r.createElement(n.Fragment,null,r.createElement("div",{className:"how-it-works-page"},r.createElement(t.BackButton,null),r.createElement("div",{className:"how-it-works-page-header"},r.createElement(t.Header,null,d(O.screenHeader?O.screenHeader:"HOW_IT_WORKS"))),r.createElement("div",{className:"language-selector",style:{margin:"10px"}},[{label:"ENGLISH",value:"en_IN"},{label:"हिंदी",value:"hi_IN"}].map((e,t)=>r.createElement("div",{className:"language-button-container",key:t},r.createElement(s.CustomButton,{selected:e.value===v,text:e.label,onClick:()=>(e=>{f(e.value),Digit.LocalizationService.changeLanguage(e.value,m.code)})(e)})))),O.videosJson.map((e,t)=>r.createElement("div",null,r.createElement("div",{className:"WhatsNewCard",style:{float:"left",position:"relative",width:"100%",marginBottom:10}},r.createElement("div",{className:"video-icon",onClick:()=>{return t=e,h("hi_IN"===v?t.hi_IN:t.en_IN),void E(!0);var t}},r.createElement("div",{className:"vid-svg"},r.createElement(b,null))),r.createElement("div",{className:"how-it-works-header-description"},r.createElement("h2",null,d(e.headerLabel)),r.createElement("p",null,d(e.description)))))),O.pdfHeader&&O.pdfDesc&&r.createElement("div",{className:"WhatsNewCard",style:{position:"relative",width:"100%",marginBottom:10,display:"inline-block"}},r.createElement("div",{className:"how-it-works-pdf-section"},r.createElement("div",{className:"pdf-icon-header-desc"},r.createElement("div",{className:"pdf-icon"},r.createElement(t.PDFSvg,null)),r.createElement("div",{className:"pdf-header-desc"},r.createElement("h2",null,d(O.pdfHeader)),r.createElement("p",null,d(O.pdfDesc)))),r.createElement("div",{className:"download-icon"},r.createElement(t.DownloadImgIcon,null)))),g&&r.createElement("div",{className:"how-it-works-video-play"},r.createElement("div",{className:"close-button"},r.createElement(t.CloseSvg,{onClick:()=>{E(!1)}})),r.createElement("video",{width:500,height:500,controls:!0,autoPlay:!0},r.createElement("source",{src:y,type:"video/mp4"})))))},te=[{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,maxlength:50,pattern:"^[A-Za-z]+( [A-Za-z]+)*$"}}]}],ne=e=>{let{t:n,onSelect:o,mobileNumber:l,onMobileChange:a,config:i,canSubmit:s}=e;return r.createElement(t.FormStep,{isDisabled:!(10===l.length&&s),onSelect:o,config:i,t:n,componentInFront:"+91",onChange:a,value:l})},re=e=>{let{config:n,onSelect:o,t:l,isDisabled:a}=e;return r.createElement(t.FormStep,{config:n,onSelect:o,t:l,isDisabled:a})};function oe(e,t){const r=n.useRef();n.useEffect(()=>{r.current=e},[e]),n.useEffect(()=>{if(null!==t){const e=setInterval(function(){r.current()},t);return()=>clearInterval(e)}},[t])}const le=e=>{let{config:o,otp:l,onOtpChange:a,onResend:i,onSelect:c,t:u,error:d,userType:m="citizen",canSubmit:p}=e;const[v,f]=n.useState(30);oe(()=>{f(v-1)},v>0?1e3:null);const g=()=>{i(),f(2)};return"employee"===m?r.createElement(n.Fragment,null,r.createElement(s.OTPInput,{length:6,onChange:a,value:l}),v>0?r.createElement(t.CardText,null,`${u("CS_RESEND_ANOTHER_OTP")} ${v} ${u("CS_RESEND_SECONDS")}`):r.createElement("p",{className:"card-text-button resend-otp",onClick:g},u("CS_RESEND_OTP")),!d&&r.createElement(t.CardLabelError,null,u("CS_INVALID_OTP"))):r.createElement(t.FormStep,{onSelect:c,config:o,t:u,isDisabled:!(6===(null==l?void 0:l.length)&&p)},r.createElement(s.OTPInput,{length:6,onChange:a,value:l}),v>0?r.createElement(t.CardText,null,`${u("CS_RESEND_ANOTHER_OTP")} ${v} ${u("CS_RESEND_SECONDS")}`):r.createElement("p",{className:"card-text-button",onClick:g},u("CS_RESEND_OTP")),!d&&r.createElement(t.CardLabelError,null,u("CS_INVALID_OTP")))};var ae;const ie={type:"register"},se={type:"login"},ce=`/${null===(ae=window)||void 0===ae?void 0:ae.contextPath}/citizen`,ue=(e,t)=>(null==e?void 0:e.from)||(null==t?void 0:t.from)||ce,de=e=>{var l,a;let{stateCode:s,isUserRegistered:c=!0}=e;const{t:u}=o.useTranslation(),d=i.useLocation(),{path:m}=i.useRouteMatch(),p=i.useHistory(),[v,f]=n.useState(null),[g,E]=n.useState(null),[y,h]=n.useState(!0),[b,S]=n.useState(null),[C,O]=n.useState(c?{}:null==d||null===(l=d.state)||void 0===l?void 0:l.data),[N,w]=n.useState(null),_=Digit.Hooks.useQueryParams(),[I,D]=n.useState(!1),[T,R]=n.useState(!0),[P,L]=n.useState(!0);n.useEffect(()=>{let e;return g&&(N&&(clearTimeout(N),w(null)),e=setTimeout(()=>{E("")},5e3),w(e)),()=>{e&&clearTimeout(e)}},[g]),n.useEffect(()=>{var e;if(!v)return;Digit.SessionStorage.set("citizen.userRequestObject",v),Digit.UserService.setUser(v),((e,t,n)=>{var r,o;let l=null===(r=JSON.parse(sessionStorage.getItem("Digit.initData")))||void 0===r||null===(o=r.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",l),localStorage.setItem("Citizen.locale",l),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)||ce;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 x=n.useMemo(()=>te.map(e=>{const t={};for(const n in e.texts)t[n]=u(e.texts[n]);return{...e,texts:t}},[te])),A=()=>Digit.UserService.getType(),M=function(e){return Promise.resolve(Q(function(){return Promise.resolve(Digit.UserService.sendOtp(e,s)).then(function(e){return[e,null]})},function(e){return[null,e]}))};return r.createElement("div",{className:"citizen-form-wrapper"},r.createElement(i.Switch,null,r.createElement(t.AppContainer,null,d.pathname.includes("login")?null:r.createElement(t.BackLink,{onClick:()=>window.history.back()}),r.createElement(i.Route,{path:""+m,exact:!0},r.createElement(ne,{onSelect:function(e){try{L(!1),O({...C,...e});const t={...e,tenantId:s,userType:A()};return Promise.resolve(c?Promise.resolve(M({otp:{...t,...se}})).then(function(e){var n;let[r,o]=e;var l,a,i;if(!o)return L(!0),void p.replace(m+"/otp",{from:ue(d.state,_),role:null===(l=d.state)||void 0===l?void 0:l.role});L(!0),d.state&&"FSM_DSO"===d.state.role||p.push(`/${null===(a=window)||void 0===a?void 0:a.contextPath}/citizen/register/name`,{from:ue(d.state,_),data:t}),null!==(n=d.state)&&void 0!==n&&n.role&&(L(!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,...ie}})).then(function(e){let[t,n]=e;if(!n)return L(!0),void p.replace(m+"/otp",{from:ue(d.state,_)});L(!0)}))}catch(e){return Promise.reject(e)}},config:x[0],mobileNumber:C.mobileNumber||"",onMobileChange:e=>{const{value:t}=e.target;O({...C,mobileNumber:t})},canSubmit:P,showRegisterLink:c&&!(null!==(a=d.state)&&void 0!==a&&a.role),t:u})),r.createElement(i.Route,{path:m+"/otp"},r.createElement(le,{config:{...x[1],texts:{...x[1].texts,cardText:`${x[1].texts.cardText} ${C.mobileNumber||""}`}},onOtpChange:e=>{O({...C,otp:e})},onResend:function(){try{const{mobileNumber:e}=C,t={mobileNumber:e,tenantId:s,userType:A()},n=function(){if(!c)return Promise.resolve(M({otp:{...t,...ie}})).then(function(){});{const e=function(){if(c)return Promise.resolve(M({otp:{...t,...se}})).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(Q(function(){h(!0),R(!1);const{mobileNumber:e,otp:t,name:n}=C;return function(){if(c){const n={username:e,password:t,tenantId:s,userType:A()};return Promise.resolve(Digit.UserService.authenticate(n)).then(function(e){var t,n,r;let{UserRequest:o,...l}=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(ce),5e3)}null!==(n=window)&&void 0!==n&&null!==(r=n.globalConfigs)&&void 0!==r&&r.getConfig("ENABLE_SINGLEINSTANCE")&&(o.tenantId=Digit.ULBService.getStateId()),f({info:o,...l})})}{const r=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:r,...o}=e;null!==(t=window)&&void 0!==t&&null!==(n=t.globalConfigs)&&void 0!==n&&n.getConfig("ENABLE_SINGLEINSTANCE")&&(r.tenantId=Digit.ULBService.getStateId()),f({info:r,...o})})}();if(r&&r.then)return r.then(function(){})}}()},function(){R(!0),h(!1)}))}catch(e){return Promise.reject(e)}},otp:C.otp,error:y,canSubmit:T,t:u})),r.createElement(i.Route,{path:m+"/name"},r.createElement(re,{config:x[2],onSelect:function(e){try{const t={...C,tenantId:s,userType:A(),...e};return O({...C,...e}),D(!0),Promise.resolve(M({otp:{...t,...ie}})).then(function(e){let[t,n]=e;t?(D(!1),p.replace(m+"/otp",{from:ue(d.state,_)})):D(!1)})}catch(e){return Promise.reject(e)}},t:u,isDisabled:I})),g&&r.createElement(t.Toast,{type:"error",label:g,onClose:()=>E(null)}))))};var me=e=>e instanceof HTMLElement;const pe={onBlur:"onBlur",onChange:"onChange",onSubmit:"onSubmit",onTouched:"onTouched",all:"all"};var ve=e=>null==e;const fe=e=>"object"==typeof e;var ge=e=>!ve(e)&&!Array.isArray(e)&&fe(e)&&!(e instanceof Date),Ee=e=>/^\w*$/.test(e),ye=e=>e.filter(Boolean),he=e=>ye(e.replace(/["|']/g,"").replace(/\[/g,".").replace(/\]/g,"").split("."));function be(e,t,n){let r=-1;const o=Ee(t)?[t]:he(t),l=o.length,a=l-1;for(;++r<l;){const t=o[r];let l=n;if(r!==a){const n=e[t];l=ge(n)||Array.isArray(n)?n:isNaN(+o[r+1])?{}:[]}e[t]=l,e=e[t]}return e}var Se=function(e,t){void 0===t&&(t={});for(const n in e)Ee(n)?t[n]=e[n]:be(t,n,e[n]);return t},Ce=e=>void 0===e,Oe=function(e,t,n){void 0===e&&(e={});const r=ye(t.split(/[,[\].]+?/)).reduce((e,t)=>ve(e)?e:e[t],e);return Ce(r)||r===e?Ce(e[t])?n:e[t]:r},Ne=(e,t)=>{me(e)&&e.removeEventListener&&(e.removeEventListener("input",t),e.removeEventListener("change",t),e.removeEventListener("blur",t))};const we={isValid:!1,value:null};var _e=e=>Array.isArray(e)?e.reduce((e,t)=>t&&t.ref.checked?{isValid:!0,value:t.ref.value}:e,we):we,Ie=e=>"radio"===e.type,De=e=>"file"===e.type,Te=e=>"checkbox"===e.type,Re=e=>"select-multiple"===e.type;const Pe={value:!1,isValid:!1},Le={value:!0,isValid:!0};var xe=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:r}=e[0].ref;return t?r&&!Ce(r.value)?Ce(n)||""===n?Le:{value:n,isValid:!0}:Le:Pe}return Pe};function Ae(e,t,n,r,o){const l=e.current[t];if(l){const{ref:{value:e,disabled:t},ref:n,valueAsNumber:i,valueAsDate:s,setValueAs:c}=l;if(t&&r)return;return De(n)?n.files:Ie(n)?_e(l.options).value:Re(n)?(a=n.options,[...a].filter(e=>{let{selected:t}=e;return t}).map(e=>{let{value:t}=e;return t})):Te(n)?xe(l.options).value:o?e:i?""===e?NaN:+e:s?n.valueAsDate:c?c(e):e}var a;if(n)return Oe(n.current,t)}function Me(e){return!e||e instanceof HTMLElement&&e.nodeType!==Node.DOCUMENT_NODE&&Me(e.parentNode)}var ke=e=>ge(e)&&!Object.keys(e).length,Ue=e=>"boolean"==typeof e;function Be(e,t){const n=Ee(t)?[t]:he(t),r=1==n.length?e:function(e,t){const n=t.slice(0,-1).length;let r=0;for(;r<n;)e=Ce(e)?r++:e[t[r++]];return e}(e,n);let o;r&&delete r[n[n.length-1]];for(let t=0;t<n.slice(0,-1).length;t++){let r,l=-1;const a=n.slice(0,-(t+1)),i=a.length-1;for(t>0&&(o=e);++l<a.length;){const t=a[l];r=r?r[t]:e[t],i===l&&(ge(r)&&ke(r)||Array.isArray(r)&&!r.filter(e=>ge(e)&&!ke(e)||Ue(e)).length)&&(o?delete o[t]:delete e[t]),o=r}}return e}const je=(e,t)=>e&&e.ref===t;var Fe=e=>ve(e)||!fe(e);function Ve(e,t){if(Fe(e)||Fe(t))return t;for(const n in t){const r=e[n],o=t[n];try{e[n]=ge(r)&&ge(o)||Array.isArray(r)&&Array.isArray(o)?Ve(r,o):o}catch(e){}}return e}function He(e,t,r){if(Fe(e)||Fe(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(!r||"ref"!==o){const e=t[o];if((ge(n)||Array.isArray(n))&&(ge(e)||Array.isArray(e))?!He(n,e,r):n!==e)return!1}}}return!0}function $e(e,t,n,r,o){let l=-1;for(;++l<e.length;){for(const r in e[l])Array.isArray(e[l][r])?(!n[l]&&(n[l]={}),n[l][r]=[],$e(e[l][r],Oe(t[l]||{},r,[]),n[l][r],n[l],r)):He(Oe(t[l]||{},r),e[l][r])?be(n[l]||{},r):n[l]=Object.assign(Object.assign({},n[l]),{[r]:!0});r&&!n.length&&delete r[o]}return n}var ze=e=>"string"==typeof e,Ge=(e,t,n,r,o)=>{const l={};for(const t in e.current)(Ce(o)||(ze(o)?t.startsWith(o):Array.isArray(o)&&o.find(e=>t.startsWith(e))))&&(l[t]=Ae(e,t,void 0,r));return n?Se(l):Ve(t,Se(l))},We=e=>e instanceof RegExp,qe=e=>ge(e)&&!We(e)?e:{value:e,message:""},Xe=e=>"function"==typeof e,Ze=e=>ze(e)||n.isValidElement(e);function Ye(e,t,n){if(void 0===n&&(n="validate"),Ze(e)||Ue(e)&&!e)return{type:n,message:Ze(e)?e:"",ref:t}}var Qe=(e,t,n,r,o)=>t?Object.assign(Object.assign({},n[e]),{types:Object.assign(Object.assign({},n[e]&&n[e].types?n[e].types:{}),{[r]:o||!0})}):{},Je=function(e,t,n,r){let{ref:o,ref:{value:l},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,f={},g=Ie(o),E=Te(o),y=g||E,h=""===l,b=Qe.bind(null,v,t,f),S=function(e,t,n,r,l){void 0===r&&(r="maxLength"),void 0===l&&(l="minLength");const a=e?t:n;f[v]=Object.assign({type:e?r:l,message:a,ref:o},b(e?r:l,a))};if(i&&(!g&&!E&&(h||ve(l))||Ue(l)&&!l||E&&!xe(a).isValid||g&&!_e(a).isValid)){const{value:n,message:r}=Ze(i)?{value:!!i,message:i}:qe(i);if(n&&(f[v]=Object.assign({type:"required",message:r,ref:y?((e.current[v].options||[])[0]||{}).ref:o},b("required",r)),!t))return Promise.resolve(f)}if(!(ve(u)&&ve(d)||""===l)){let e,n;const r=qe(d),a=qe(u);if(isNaN(l)){const t=o.valueAsDate||new Date(l);ze(r.value)&&(e=t>new Date(r.value)),ze(a.value)&&(n=t<new Date(a.value))}else{const t=o.valueAsNumber||parseFloat(l);ve(r.value)||(e=t>r.value),ve(a.value)||(n=t<a.value)}if((e||n)&&(S(!!e,r.message,a.message,"max","min"),!t))return Promise.resolve(f)}if(ze(l)&&!h&&(s||c)){const e=qe(s),n=qe(c),r=!ve(e.value)&&l.length>e.value,o=!ve(n.value)&&l.length<n.value;if((r||o)&&(S(r,e.message,n.message),!t))return Promise.resolve(f)}if(ze(l)&&m&&!h){const{value:e,message:n}=qe(m);if(We(e)&&!e.test(l)&&(f[v]=Object.assign({type:"pattern",message:n,ref:o},b("pattern",n)),!t))return Promise.resolve(f)}const C=function(){if(p){const l=Ae(e,v,r,!1,!0),i=y&&a?a[0].ref:o;return Xe(p)?Promise.resolve(p(l)).then(function(e){const r=Ye(e,i);if(r&&(f[v]=Object.assign(Object.assign({},r),b("validate",r.message)),!t))return n=!0,f}):function(){if(ge(p)){let r=!1;function e(){if(!ke(o)&&(f[v]=Object.assign({ref:i},o),!t))return n=!0,f}let o={};const a=Y(Object.entries(p),function(e){let[n,a]=e;if(ke(o)||t)return Promise.resolve(a(l)).then(function(e){const r=Ye(e,i,n);r&&(o=Object.assign(Object.assign({},r),b(n,r.message)),t&&(f[v]=o))});r=!0},function(){return r});return a&&a.then?a.then(e):e()}}()}}();return Promise.resolve(C&&C.then?C.then(function(e){return n?e:f}):n?C:f)}catch(e){return Promise.reject(e)}};const Ke=function(e,t,n){void 0===n&&(n=[]);for(const r in t){const o=e+(ge(t)?"."+r:`[${r}]`);Fe(t[r])?n.push(o):Ke(o,t[r],n)}return n};var et=(e,t,n,r,o)=>{let l=void 0;return n.add(t),ke(e)||(l=Oe(e,t),(ge(l)||Array.isArray(l))&&Ke(t,l).forEach(e=>n.add(e))),Ce(l)?o?r:Oe(r,t):l},tt=e=>{let{isOnBlur:t,isOnChange:n,isOnTouch:r,isTouched:o,isReValidateOnBlur:l,isReValidateOnChange:a,isBlurEvent:i,isSubmitted:s,isOnAll:c}=e;return!c&&(!s&&r?!(o||i):(s?l:t)?!i:!(s?a:n)||i)},nt=e=>e.substring(0,e.indexOf("[")),rt=(e,t)=>[...e].some(e=>((e,t)=>RegExp(`^${t}([|.)\\d+`.replace(/\[/g,"\\[").replace(/\]/g,"\\]")).test(e))(t,e)),ot="undefined"!=typeof window&&"undefined"!=typeof document;function lt(e){var t;let n;if(Fe(e)||ot&&(e instanceof File||me(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,lt(e.get(t)));return n}n=Array.isArray(e)?[]:{};for(const t in e)n[t]=lt(e[t]);return n}var at=e=>({isOnSubmit:!e||e===pe.onSubmit,isOnBlur:e===pe.onBlur,isOnChange:e===pe.onChange,isOnAll:e===pe.all,isOnTouch:e===pe.onTouched}),it=e=>Ie(e)||Te(e);const st="undefined"==typeof window,ct=ot?"Proxy"in window:"undefined"!=typeof Proxy,ut=n.createContext(null);ut.displayName="RHFContext";const dt=e=>{const{as:t,render:r}=e,o=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]])}return n}(e,["rules","as","render","defaultValue","control","onFocus"]),{field:l,meta:a}=function(e){let{name:t,rules:r,defaultValue:o,control:l,onFocus:a}=e;const i=n.useContext(ut);if("production"!==process.env.NODE_ENV&&!l&&!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:f},formState:g,formStateRef:{current:{isSubmitted:E,touched:y,errors:h}},updateFormState:b,readFormStateRef:S,fieldsRef:C,fieldArrayNamesRef:O,shallowFieldsStateRef:N}=l||i.control,w=!rt(O.current,t),_=()=>!Ce(Oe(N.current,t))&&w?Oe(N.current,t):Ce(o)?Oe(s.current,t):o,[I,D]=n.useState(_()),T=n.useRef(I),R=n.useRef({focus:()=>null}),P=n.useRef(a||(()=>{Xe(R.current.focus)&&R.current.focus(),"production"!==process.env.NODE_ENV&&(Xe(R.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"))})),L=n.useCallback(e=>!tt(Object.assign({isBlurEvent:e,isReValidateOnBlur:v,isReValidateOnChange:f,isSubmitted:E,isTouched:!!Oe(y,t)},p)),[v,f,E,y,t,p]),x=n.useCallback(e=>{let[t]=e;const n=(e=>Fe(e)||!ge(e.target)||ge(e.target)&&!e.type?e:Ce(e.target.value)?e.target.checked:e.target.value)(t);return D(n),T.current=n,n},[]),A=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");C.current[t]?C.current[t]=Object.assign({ref:C.current[t].ref},r):(u(Object.defineProperties({name:t,focus:P.current},{value:{set(e){D(e),T.current=e},get:()=>T.current}}),r),e=Ce(Oe(s.current,t))),e&&w&&D(_())},[r,t,u]);n.useEffect(()=>()=>d(t),[t]),n.useEffect(()=>{"production"!==process.env.NODE_ENV&&(Ce(I)&&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)`),!w&&Ce(o)&&console.warn("📋 Controller is missing `defaultValue` prop when using `useFieldArray`. https://react-hook-form.com/api#Controller")),A()},[A]),n.useEffect(()=>{!C.current[t]&&A(!0)});const M=n.useCallback(()=>{S.current.touched&&!Oe(y,t)&&(be(y,t,!0),b({touched:y})),L(!0)&&m(t)},[t,b,L,m,S]);return{field:{onChange:n.useCallback(function(){for(var e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];return c(t,x(n),{shouldValidate:L(),shouldDirty:!0})},[c,t,L]),onBlur:M,name:t,value:I,ref:R},meta:Object.defineProperties({invalid:!!Oe(h,t)},{isDirty:{get:()=>!!Oe(g.dirtyFields,t)},isTouched:{get:()=>!!Oe(g.touched,t)}})}}(e),i=Object.assign(Object.assign({},o),l);return t?n.isValidElement(t)?n.cloneElement(t,i):n.createElement(t,i):r?r(l,a):null},mt=e=>{let{control:n,t:o}=e;const l=window.Digit.Utils.browser.isMobile();return r.createElement(Fragment,null,r.createElement(t.SearchField,{className:"pt-form-field"},r.createElement("label",null,o("AUDIT_FROM_DATE_LABEL")),r.createElement(dt,{render:e=>r.createElement(t.DatePicker,{date:e.value,onChange:e.onChange}),name:"fromDate",control:n})),r.createElement(t.SearchField,{className:"pt-form-field"},r.createElement("label",null,o("AUDIT_TO_DATE_LABEL")),r.createElement(dt,{render:e=>r.createElement(t.DatePicker,{date:e.value,onChange:e.onChange}),name:"toDate",control:n})),r.createElement(t.SearchField,{className:"pt-search-action-submit"},r.createElement(t.Button,{style:{marginTop:l?"510px":"25px",marginLeft:l?"0":"-30px",maxWidth:l?"100%":"240px"},label:o("ES_COMMON_APPLY"),submit:!0})))},pt=e=>{var o;let{Controller:l,register:a,control:i,t:s,reset:c,previousPage:u,handleSubmit:d,tenantId:m,data:p,onSubmit:v,isLoading:f}=e;const[E,y]=n.useState([]),h=e=>r.createElement("div",{onClick:e.onClick},r.createElement(t.DownloadBtnCommon,null));n.useEffect(()=>{(null==p?void 0:p.length)>0&&y([null==p?void 0:p.map(e=>{let t={};return t[s("AUDIT_DATE_LABEL")]=b(null==e?void 0:e.timestamp),t[s("AUDIT_TIME_LABEL")]=S(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 b=e=>{if(null==e||null==e||""==e)return"NA";const t=new Date(e);let n=t.getMonth()+1,r=t.getDate();return n=(n>9?"":"0")+n,r=(r>9?"":"0")+r,`${r}/${n}/${t.getFullYear()}`},S=e=>{if(null==e||null==e||""==e)return"NA";const t=new Date(e);let n=t.getHours(),r=t.getMinutes(),o=n>12?"PM":"AM";return n=n>12?n-12:n,n=(n>9?"":"0")+n,r=(r>9?"":"0")+r,`${n}:${r} ${o}`},[C,O]=n.useReducer(function(e,t){switch(t.type){case"set":return t.payload;case"remove":return!1}},!1),N=()=>{O({type:"remove"})},w=()=>r.createElement("div",{className:"InboxMobilePopupCloseButtonWrapper",onClick:N},r.createElement(t.CloseSvg,null)),_={Controller:l,register:a,control:i,t:s,reset:c,previousPage:u},I=n.useCallback(e=>{let{currentlyActiveMobileModal:n,searchFormFieldsComponentProps:o,tenantId:l,...a}=e;return(e=>{let{currentlyActiveMobileModal:n,searchFormFieldsComponentProps:o,tenantId:l,...a}=e;const{closeMobilePopupModal:i}=a;switch(n){case"SearchFormComponent":return r.createElement(t.SearchForm,a,r.createElement(w,null),r.createElement("div",{className:"MobilePopupHeadingWrapper"},r.createElement("h2",null,s("PRIVACY_AUDIT_REPORT"),":")),r.createElement(mt,g({},o,{closeMobilePopupModal:i,tenantId:l,t:s})));default:return r.createElement("span",null)}})({currentlyActiveMobileModal:n,searchFormFieldsComponentProps:o,tenantId:l,...a})},[C]);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")]:b(e.timestamp),[s("AUDIT_TIME_LABEL")]:S(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 r.createElement(r.Fragment,null,r.createElement(t.BackButton,null),r.createElement("div",{className:"sideContent",style:{marginLeft:"70%",marginTop:"-12%"}},r.createElement(h,{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")})(E)})),r.createElement(t.Header,null,s("PRIVACY_AUDIT_REPORT"),":"),r.createElement("div",{className:"digit-search-box"},r.createElement(t.SearchAction,{text:s("ES_COMMON_SEARCH"),handleActionClick:()=>O({type:"set",payload:"SearchFormComponent"}),tenantId:m,t:s})),C?r.createElement(t.PopUp,null,r.createElement(I,{onSubmit:e=>{O({type:"remove"}),v(e)},handleSubmit:d,id:"search-form",className:"rm-mb form-field-flex-one inboxPopupMobileWrapper",searchFormFieldsComponentProps:_,currentlyActiveMobileModal:C,closeMobilePopupModal:N,tenantId:m})):null,f&&r.createElement(t.Loader,null),r.createElement(t.DetailsCard,{data:D}))},vt=e=>{let{tenantId:o,t:l,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:f,reset:g}=function(e){let{mode:t=pe.onSubmit,reValidateMode:r=pe.onChange,resolver:o,context:l,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({}),f=n.useRef({}),g=n.useRef({}),E=n.useRef({}),y=n.useRef(a),h=n.useRef(!1),b=n.useRef(!1),S=n.useRef(),C=n.useRef({}),O=n.useRef({}),N=n.useRef(l),w=n.useRef(o),_=n.useRef(new Set),I=n.useRef(at(t)),{isOnSubmit:D,isOnTouch:T}=I.current,R=c===pe.all,[P,L]=n.useState({isDirty:!1,isValidating:!1,dirtyFields:{},isSubmitted:!1,submitCount:0,touched:{},isSubmitting:!1,isSubmitSuccessful:!1,isValid:!D,errors:{}}),x=n.useRef({isDirty:!ct,dirtyFields:!ct,touched:!ct||T,isValidating:!ct,isSubmitting:!ct,isValid:!ct}),A=n.useRef(P),M=n.useRef(),{isOnBlur:k,isOnChange:U}=n.useRef(at(r)).current;N.current=l,w.current=o,A.current=P,C.current=s?{}:ke(C.current)?lt(a):C.current;const B=n.useCallback(function(e){void 0===e&&(e={}),h.current||(A.current=Object.assign(Object.assign({},A.current),e),L(A.current))},[]),j=()=>x.current.isValidating&&B({isValidating:!0}),F=n.useCallback(function(e,t,n,r,o){void 0===n&&(n=!1),void 0===r&&(r={});let l=n||(e=>{let{errors:t,name:n,error:r,validFields:o,fieldsWithValidation:l}=e;const a=Ce(r),i=Oe(t,n);return a&&!!i||!a&&!He(i,r,!0)||a&&Oe(l,n)&&!Oe(o,n)})({errors:A.current.errors,error:t,name:e,validFields:E.current,fieldsWithValidation:g.current});const a=Oe(A.current.errors,e);t?(Be(E.current,e),l=l||!a||!He(a,t,!0),be(A.current.errors,e,t)):((Oe(g.current,e)||w.current)&&(be(E.current,e,!0),l=l||a),Be(A.current.errors,e)),(l&&!ve(n)||!ke(r)||x.current.isValidating)&&B(Object.assign(Object.assign(Object.assign({},r),w.current?{isValid:!!o}:{}),{isValidating:!1}))},[]),V=n.useCallback((e,t)=>{const{ref:n,options:r}=u.current[e],o=ot&&me(n)&&ve(t)?"":t;Ie(n)?(r||[]).forEach(e=>{let{ref:t}=e;return t.checked=t.value===o}):De(n)&&!ze(o)?n.files=o:Re(n)?[...n.options].forEach(e=>e.selected=o.includes(e.value)):Te(n)&&r?r.length>1?r.forEach(e=>{let{ref:t}=e;return t.checked=Array.isArray(o)?!!o.find(e=>e===t.value):o===t.value}):r[0].ref.checked=!!o:n.value=o},[]),H=n.useCallback((e,t)=>{if(x.current.isDirty){const n=K();return e&&t&&be(n,e,t),!He(n,y.current)}return!1},[]),$=n.useCallback(function(e,t){if(void 0===t&&(t=!0),x.current.isDirty||x.current.dirtyFields){const n=!He(Oe(y.current,e),Ae(u,e,C)),r=Oe(A.current.dirtyFields,e),o=A.current.isDirty;n?be(A.current.dirtyFields,e,!0):Be(A.current.dirtyFields,e);const l={isDirty:H(),dirtyFields:A.current.dirtyFields},a=x.current.isDirty&&o!==l.isDirty||x.current.dirtyFields&&r!==Oe(A.current.dirtyFields,e);return a&&t&&B(l),a?l:{}}return{}},[]),z=n.useCallback(function(e,t){try{return"production"===process.env.NODE_ENV||u.current[e]?Promise.resolve(Je(u,R,u.current[e],C)).then(function(n){const r=n[e];return F(e,r,t),Ce(r)}):(console.warn("📋 Field is missing with `name` attribute: ",e),Promise.resolve(!1))}catch(e){return Promise.reject(e)}},[F,R]),G=n.useCallback(function(e){try{return Promise.resolve(w.current(K(),N.current,R)).then(function(t){let{errors:n}=t;const r=A.current.isValid;if(Array.isArray(e)){const t=e.map(e=>{const t=Oe(n,e);return t?be(A.current.errors,e,t):Be(A.current.errors,e),!t}).every(Boolean);return B({isValid:ke(n),isValidating:!1}),t}{const t=Oe(n,e);return F(e,t,r!==ke(n),{},ke(n)),!t}})}catch(e){return Promise.reject(e)}},[F,R]),W=n.useCallback(function(e){try{let n=!1;function t(e){return n?e:Promise.resolve(z(r))}const r=e||Object.keys(u.current);if(j(),w.current)return Promise.resolve(G(r));const o=function(){if(Array.isArray(r))return!e&&(A.current.errors={}),Promise.resolve(Promise.all(r.map(function(e){try{return Promise.resolve(z(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)}},[G,z]),q=n.useCallback((e,t,n)=>{let{shouldDirty:r,shouldValidate:o}=n;const l={};be(l,e,t);for(const n of Ke(e,t))u.current[n]&&(V(n,Oe(l,n)),r&&$(n),o&&W(n))},[W,V,$]),X=n.useCallback((e,t,n)=>{if(!s&&!Fe(t)&&be(C.current,e,Array.isArray(t)?[...t]:Object.assign({},t)),u.current[e])V(e,t),n.shouldDirty&&$(e),n.shouldValidate&&W(e);else if(!Fe(t)&&(q(e,t,n),_.current.has(e))){const r=nt(e)||e;be(d.current,e,t),O.current[r]({[r]:Oe(d.current,r)}),(x.current.isDirty||x.current.dirtyFields)&&n.shouldDirty&&(be(A.current.dirtyFields,e,((e,t,n)=>Ve($e(e,t,n.slice(0,e.length)),$e(t,e,n.slice(0,e.length))))(t,Oe(y.current,e,[]),Oe(A.current.dirtyFields,e,[]))),B({isDirty:!He(Object.assign(Object.assign({},K()),{[e]:t}),y.current)}))}!s&&be(C.current,e,t)},[$,V,q]),Z=e=>b.current||p.current.has(e)||p.current.has((e.match(/\w+/)||[])[0]),Q=e=>{let t=!0;if(!ke(v.current))for(const n in v.current)e&&v.current[n].size&&!v.current[n].has(e)&&!v.current[n].has(nt(e))||(f.current[n](),t=!1);return t};function J(e){if(!s){let t=lt(e);for(const e of _.current)Ee(e)&&!t[e]&&(t=Object.assign(Object.assign({},t),{[e]:[]}));return t}return e}function K(e){if(ze(e))return Ae(u,e,C);if(Array.isArray(e)){const t={};for(const n of e)be(t,n,Ae(u,n,C));return t}return J(Ge(u,lt(C.current),s))}S.current=S.current?S.current:function(e){let{type:t,target:n}=e;try{let e=n.name;const r=u.current[e];let o,l;return Promise.resolve(function(){if(r){function a(){!i&&Q(e),F(e,o,m,d,l)}const i="blur"===t,c=tt(Object.assign({isBlurEvent:i,isReValidateOnChange:U,isReValidateOnBlur:k,isTouched:!!Oe(A.current.touched,e),isSubmitted:A.current.isSubmitted},I.current));let d=$(e,!1),m=!ke(d)||!i&&Z(e);if(i&&!Oe(A.current.touched,e)&&x.current.touched&&(be(A.current.touched,e,!0),d=Object.assign(Object.assign({},d),{touched:A.current.touched})),!s&&Te(n)&&be(C.current,e,Ae(u,e)),c)return!i&&Q(e),(!ke(d)||m&&ke(d))&&B(d);j();const p=w.current?Promise.resolve(w.current(K(),N.current,R)).then(function(t){let{errors:r}=t;const a=A.current.isValid;if(o=Oe(r,e),Te(n)&&!o&&w.current){const t=nt(e),n=Oe(r,t,{});n.type&&n.message&&(o=n),t&&(n||Oe(A.current.errors,t))&&(e=t)}l=ke(r),a!==l&&(m=!0)}):Promise.resolve(Je(u,R,r,C)).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=ke(u.current)?y.current:{};return Promise.resolve(w.current(Object.assign(Object.assign(Object.assign({},t),K()),e),N.current,R)).then(function(e){let{errors:t}=e;const n=ke(t);A.current.isValid!==n&&B({isValid:n})})}catch(e){return Promise.reject(e)}},[R]),te=n.useCallback((e,t)=>{!function(e,t,n,r,o,l){const{ref:a,ref:{name:i}}=n,s=e.current[i];if(!o){const t=Ae(e,i,r);!Ce(t)&&be(r.current,i,t)}a.type&&s?Ie(a)||Te(a)?Array.isArray(s.options)&&s.options.length?(ye(s.options).forEach(function(e,n){void 0===e&&(e={}),(Me(e.ref)&&je(e,e.ref)||l)&&(Ne(e.ref,t),Be(s.options,`[${n}]`))}),s.options&&!ye(s.options).length&&delete e.current[i]):delete e.current[i]:(Me(a)&&je(s,a)||l)&&(Ne(a,t),delete e.current[i]):delete e.current[i]}(u,S.current,e,C,s,t),s&&(Be(E.current,e.ref.name),Be(g.current,e.ref.name))},[s]),ne=n.useCallback(e=>{if(b.current)B();else{for(const t of p.current)if(t.startsWith(e)){B();break}Q(e)}},[]),re=n.useCallback((e,t)=>{e&&(te(e,t),s&&!ye(e.options||[]).length&&(Be(A.current.errors,e.ref.name),be(A.current.dirtyFields,e.ref.name,!0),B({isDirty:H()}),x.current.isValid&&w.current&&ee(),ne(e.ref.name)))},[ee,te]),oe=n.useCallback((e,t,n)=>{const r=n?v.current[n]:p.current;let o=Ge(u,lt(C.current),s,!1,e);if(ze(e)){const n=nt(e)||e;return _.current.has(n)&&(o=Object.assign(Object.assign({},m.current),o)),et(o,e,r,Ce(Oe(y.current,e))?t:Oe(y.current,e),!0)}const l=Ce(t)?y.current:t;return Array.isArray(e)?e.reduce((e,t)=>Object.assign(Object.assign({},e),{[t]:et(o,t,r,l)}),{}):(b.current=Ce(n),Se(!ke(o)&&o||l))},[]);function le(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(_.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:r,value:o}=e,l=Object.assign({ref:e},t),a=u.current,i=it(e),c=rt(_.current,n),d=t=>ot&&(!me(e)||t===e);let m,p=a[n],v=!0;if(p&&(i?Array.isArray(p.options)&&ye(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=r?i?Object.assign({options:[...ye(p&&p.options||[]),{ref:e}],ref:{type:r,name:n}},t):Object.assign({},l):l,a[n]=p;const f=Ce(Oe(C.current,n));ke(y.current)&&f||(m=Oe(f?y.current:C.current,n),v=Ce(m),v||c||V(n,m)),ke(t)||(be(g.current,n,!0),!D&&x.current.isValid&&Je(u,R,p,C).then(e=>{const t=A.current.isValid;ke(e)?be(E.current,n,!0):Be(E.current,n),t!==ke(e)&&B()})),!s||c&&v||!c&&Be(A.current.dirtyFields,n),r&&function(e,t,n){let{ref:r}=e;me(r)&&n&&(r.addEventListener(t?"change":"input",n),r.addEventListener("blur",n))}(i&&p.options?p.options[p.options.length-1]:p,i||"select-one"===e.type,S.current)}const ae=n.useCallback((e,t)=>function(n){try{n&&n.preventDefault&&(n.preventDefault(),n.persist());let r={},o=J(Ge(u,lt(C.current),s,!0));return x.current.isSubmitting&&B({isSubmitting:!0}),Promise.resolve(function(l,a){try{var s=function(){function l(){const l=function(){if(ke(r)&&Object.keys(A.current.errors).every(e=>e in u.current))return B({errors:{},isSubmitting:!0}),Promise.resolve(e(o,n)).then(function(){});{function l(e){i&&((e,t)=>{for(const n in e)if(Oe(t,n)){const t=e[n];if(t){if(t.ref.focus&&Ce(t.ref.focus()))break;if(t.options){t.options[0].ref.focus();break}}}})(u.current,A.current.errors)}return A.current.errors=Object.assign(Object.assign({},A.current.errors),r),t?Promise.resolve(t(A.current.errors,n)).then(l):l()}}();if(l&&l.then)return l.then(function(){})}const a=w.current?Promise.resolve(w.current(o,N.current,R)).then(function(e){let{errors:t,values:n}=e;A.current.errors=r=t,o=n}):Y(Object.values(u.current),function(e){const t=function(){if(e){const{name:t}=e.ref;return Promise.resolve(Je(u,R,e,C)).then(function(e){e[t]?(be(r,t,e[t]),Be(E.current,t)):Oe(g.current,t)&&(Be(A.current.errors,t),be(E.current,t,!0))})}}();if(t&&t.then)return t.then(function(){})});return a&&a.then?a.then(l):l()}()}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(A.current.isSubmitting=!1,B({isSubmitted:!0,isSubmitting:!1,isSubmitSuccessful:ke(A.current.errors),submitCount:A.current.submitCount+1}),e)throw t;return t}))}catch(n){return Promise.reject(n)}},[i,R]);n.useEffect(()=>{o&&x.current.isValid&&ee(),M.current=M.current||!ot?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&&Me(e.ref)&&t(n);else n&&Me(n.ref)&&t(n)});return n.observe(window.document,{childList:!0,subtree:!0}),n}(u,re)},[re,y.current]),n.useEffect(()=>()=>{M.current&&M.current.disconnect(),h.current=!0,"production"===process.env.NODE_ENV&&Object.values(u.current).forEach(e=>re(e,!0))},[]),!o&&x.current.isValid&&(P.isValid=He(E.current,g.current)&&ke(A.current.errors));const ie={trigger:W,setValue:n.useCallback(function(e,t,n){X(e,t,n||{}),Z(e)&&B(),Q(e)},[X,W]),getValues:n.useCallback(K,[]),register:n.useCallback(function(e,t){if(!st)if(ze(e))le({name:e},t);else{if(!ge(e)||!("name"in e))return t=>t&&le(t,e);le(e,t)}},[y.current]),unregister:n.useCallback(function(e){for(const t of Array.isArray(e)?e:[e])re(u.current[t],!0)},[]),formState:ct?new Proxy(P,{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 x.current[t]=!0,e[t]}}):P},se=n.useMemo(()=>Object.assign({isFormDirty:H,updateWatchedValue:ne,shouldUnregister:s,updateFormState:B,removeFieldEventListener:te,watchInternal:oe,mode:I.current,reValidateMode:{isReValidateOnBlur:k,isReValidateOnChange:U},validateResolver:o?ee:void 0,fieldsRef:u,resetFieldArrayFunctionRef:O,useWatchFieldsRef:v,useWatchRenderFunctionsRef:f,fieldArrayDefaultValuesRef:d,validFieldsRef:E,fieldsWithValidationRef:g,fieldArrayNamesRef:_,readFormStateRef:x,formStateRef:A,defaultValuesRef:y,shallowFieldsStateRef:C,fieldArrayValuesRef:m},ie),[y.current,ne,s,te,oe]);return Object.assign({watch:function(e,t){return oe(e,t)},control:se,handleSubmit:ae,reset:n.useCallback(function(e,t){if(void 0===t&&(t={}),ot)for(const e of Object.values(u.current))if(e){const{ref:t,options:n}=e,r=it(t)&&Array.isArray(n)?n[0].ref:t;if(me(r))try{r.closest("form").reset();break}catch(e){}}u.current={},y.current=Object.assign({},e||y.current),e&&Q(""),Object.values(O.current).forEach(e=>Xe(e)&&e()),C.current=s?{}:lt(e||y.current),(e=>{let{errors:t,isDirty:n,isSubmitted:r,touched:o,isValid:l,submitCount:a,dirtyFields:i}=e;l||(E.current={},g.current={}),d.current={},p.current=new Set,b.current=!1,B({submitCount:a?A.current.submitCount:0,isDirty:!!n&&A.current.isDirty,isSubmitted:!!r&&A.current.isSubmitted,isValid:!!l&&A.current.isValid,dirtyFields:i?A.current.dirtyFields:{},touched:o?A.current.touched:{},errors:t?A.current.errors:{},isSubmitting:!1,isSubmitSuccessful:!1})})(t)},[]),clearErrors:n.useCallback(function(e){e&&(Array.isArray(e)?e:[e]).forEach(e=>u.current[e]&&Ee(e)?delete A.current.errors[e]:Be(A.current.errors,e)),B({errors:e?A.current.errors:{}})},[]),setError:n.useCallback(function(e,t){const n=(u.current[e]||{}).ref;be(A.current.errors,e,Object.assign(Object.assign({},t),{ref:n})),B({isValid:!1}),t.shouldFocus&&n&&n.focus&&n.focus()},[]),errors:P.errors},ie)}({defaultValues:u}),E=e=>{if(null==e||null==e||""==e)return"NA";const t=new Date(e);let n=t.getMonth()+1,r=t.getDate();return n=(n>9?"":"0")+n,r=(r>9?"":"0")+r,`${r}/${n}/${t.getFullYear()}`},y=e=>{if(null==e||null==e||""==e)return"NA";const t=new Date(e);let n=t.getHours(),r=t.getMinutes(),o=n>12?"PM":"AM";return n=n>12?n-12:n,n=(n>9?"":"0")+n,r=(r>9?"":"0")+r,`${n}:${r} ${o}`},[h,b]=n.useState([]),S=e=>r.createElement("div",{onClick:e.onClick},r.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&&b([null==i?void 0:i.map(e=>{let t={};return t[l("AUDIT_DATE_LABEL")]=E(null==e?void 0:e.timestamp),t[l("AUDIT_TIME_LABEL")]=y(null==e?void 0:e.timestamp),t[l("AUDIT_DATAVIEWED_LABEL")]=(null==e?void 0:e.dataView[0])+","+(null==e?void 0:e.dataView[1]),t[l("AUDIT_DATAVIEWED_BY_LABEL")]=null==e?void 0:e.dataViewedBy,t[l("AUDIT_ROLE_LABEL")]=null==e?void 0:e.roles.map(e=>e.name).join(","),{...t}})])},[i]);const C=n.useCallback(e=>{0!==e.length&&(v("sortBy",e.id),v("sortOrder",e.desc?"DESC":"ASC"))},[]);function O(){v("offset",f("offset")-f("limit")),p(a)()}const N=window.Digit.Utils.browser.isMobile();if(N)return r.createElement(pt,{Controller:dt,register:d,control:m,t:l,reset:g,previousPage:O,handleSubmit:p,tenantId:o,data:i,onSubmit:a});const w=e=>r.createElement("span",{className:"cell-text"},e),_=n.useMemo(()=>[{Header:l("AUDIT_DATE_LABEL"),disableSortBy:!0,accessor:e=>{const t="NA"===e.timestamp?l("WS_NA"):E(e.timestamp);return w(""+t)}},{Header:l("AUDIT_TIME_LABEL"),disableSortBy:!0,accessor:e=>{const t="NA"===e.timestamp?l("WS_NA"):y(e.timestamp);return w(""+t)}},{Header:l(N?"AUDIT_DATAVIEWED_LABEL":"AUDIT_DATAVIEWED_PRIVACY"),disableSortBy:!0,accessor:e=>w(""+(null==e?void 0:e.dataView))},{Header:l(N?"AUDIT_DATAVIEWED_BY_LABEL":"AUDIT_DATAVIEWED_BY_PRIVACY"),disableSortBy:!0,accessor:e=>w(""+(null==e?void 0:e.dataViewedBy))},{Header:l("AUDIT_ROLE_LABEL"),disableSortBy:!0,accessor:e=>{var t;return w(""+(null==e||null===(t=e.roles.slice(0,3))||void 0===t?void 0:t.map(e=>e.name)))}}],[]);return r.createElement(r.Fragment,null,r.createElement("div",{style:{marginRight:"-70px"}}," ",r.createElement(t.BackButton,null)," "),r.createElement("div",{style:{marginTop:"30px",marginLeft:"30px"}}," ",r.createElement(t.Header,null,l("PRIVACY_AUDIT_REPORT"))," "),r.createElement(t.SearchForm,{className:"audit-card",onSubmit:a,handleSubmit:p},r.createElement(mt,{register:d,control:m,reset:g,tenantId:o,t:l,previousPage:O})),r.createElement("div",{style:{marginTop:"240px",marginLeft:"-55%",maxWidth:"80%",marginRight:"52px"}},null!=i&&i.display?r.createElement("div",{style:{marginTop:"20x",width:"1025px",marginLeft:"25px",backgroundColor:"white",height:"60px"}},l(i.display).split("\\n").map((e,t)=>r.createElement("p",{key:t,style:{textAlign:"center"}},e))):""!==i?r.createElement("div",{style:{backgroundColor:"white",marginRight:"-30px",marginLeft:"30px"}},r.createElement("div",{className:"sideContent",style:{float:"right",padding:"10px 30px"}},r.createElement(S,{className:"mrlg cursorPointer",onClick:()=>(e=>{if(void 0!==(null==e?void 0:e[0]))return Digit.Download.Excel(null==e?void 0:e[0],"AuditReport")})(h)})),r.createElement(s.Table,{t:l,data:i,totalRecords:c,columns:_,getCellProps:e=>({style:{minWidth:e.column.Header===l("ES_INBOX_APPLICATION_NO")?"240px":"",padding:"20px 18px",fontSize:"16px"}}),onPageSizeChange:function(e){v("limit",Number(e.target.value)),p(a)()},currentPage:f("offset")/f("limit"),onNextPage:function(){v("offset",f("offset")+f("limit")),p(a)()},onPrevPage:O,manualPagination:!1,pageSizeLimit:f("limit"),onSort:C,disableSort:!1,sortParams:[{id:f("sortBy"),desc:"DESC"===f("sortOrder")}]})):r.createElement(t.Loader,null)))},ft=e=>{var t,l;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})/),r=new Date(Date.UTC(n[1],n[2]-1,n[3]));return r.setMinutes(r.getMinutes()+r.getTimezoneOffset()),"dayend"===t&&(r.setHours(r.getHours()+24),r.setSeconds(r.getSeconds()-1)),r.getTime()}catch(t){return e}};n.useEffect(()=>{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 r.createElement(vt,{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===(l=v.ElasticSearchData)||void 0===l?void 0:l.length})},gt=e=>{var n,l,a,i,s,c,u,d,m,p,v,f,g,E,y,h;let{moduleCode:b}=e;const{t:S}=o.useTranslation(),C=Digit.ULBService.getCitizenCurrentTenant(),{isLoading:O,data:N}=Digit.Hooks.useStaticData(Digit.ULBService.getStateId()),{isLoading:w,error:_,data:I}=Digit.Hooks.useDynamicData({moduleCode:b,tenantId:C,filters:{},t:S}),D=e=>{let{module:n,styles:o}=e;switch(n){case"TL":return r.createElement(t.CaseIcon,{className:"fill-path-primary-main",styles:o});case"PT":return r.createElement(t.PTIcon,{className:"fill-path-primary-main",styles:o});case"MCOLLECT":return r.createElement(t.MCollectIcon,{className:"fill-path-primary-main",styles:o});case"PGR":return r.createElement(t.ComplaintIcon,{className:"fill-path-primary-main",styles:o});default:return r.createElement(t.CaseIcon,{className:"fill-path-primary-main",styles:o})}},T=null==N||null===(n=N.MdmsRes["common-masters"])||void 0===n||null===(l=n.StaticData[0])||void 0===l?void 0:l[""+b],R=e=>{let{module:n}=e;switch(n){case"PT":case"WS":return r.createElement("span",{className:"timerIcon"},r.createElement(t.TimerIcon,null));default:return null}},P=e=>{let{module:n}=e;switch(n){case"PT":return r.createElement("span",{className:"rupeeSymbol"},r.createElement(t.RupeeSymbol,null));case"WS":return r.createElement("span",{className:"timerIcon"},r.createElement(t.TimerIcon,null));default:return null}},L=e=>{switch(e){case"TL":case"PT":case"MCOLLECT":return{staticCommonContent:S("COMMON_VALIDITY"),validity:(null==T?void 0:T.validity)+S("1"===(null==T?void 0:T.validity)?"COMMON_DAY":"COMMON_DAYS")};case"PGR":return{staticCommonContent:S("ACTION_TEST_COMPLAINT_TYPES")};case"OBPS":return{staticCommonContent:S("BUILDING_PLAN_PERMIT_VALIDITY"),validity:(null==T?void 0:T.validity)+" "+S("1"===(null==T?void 0:T.validity)?"COMMON_DAY":"COMMON_DAYS")};default:return{staticCommonContent:""}}},x=e=>{switch(e){case"PT":return{staticDataOne:(null==T?void 0:T.staticDataOne)+" "+S("COMMON_DAYS"),staticDataOneHeader:S("APPLICATION_PROCESSING_TIME"),staticDataTwo:null==T?void 0:T.staticDataTwo,staticDataTwoHeader:S("APPLICATION_PROCESSING_FEE")};case"WS":return{staticDataOne:"",staticDataOneHeader:S("PAY_WATER_CHARGES_BY")+" "+(null==T?void 0:T.staticDataOne)+" "+S("COMMON_DAYS")+" "+S("OF_BILL_GEN_TO_AVOID_LATE_FEE"),staticDataTwo:(null==T?void 0:T.staticDataTwo)+" "+S("COMMON_DAYS"),staticDataTwoHeader:S("APPLICATION_PROCESSING_TIME")};default:return{}}};return O||w?r.createElement(t.Loader,null):T?r.createElement(r.Fragment,null,T&&null!=T&&T.payViaWhatsApp?r.createElement(t.Card,{style:{margin:"16px",padding:"16px",maxWidth:"unset"}},r.createElement("div",{className:"pay-whatsapp-card",onClick:()=>{window.open(null==T?void 0:T.payViaWhatsApp)}},r.createElement("div",{className:"pay-whatsapp-text"},S("PAY_VIA_WHATSAPP")),r.createElement("div",{className:"whatsAppIconG"},r.createElement(t.WhatsappIconGreen,null)))):null,T&&null!=T&&T.helpline?r.createElement(t.Card,{style:{margin:"16px",padding:"16px",maxWidth:"unset"}},r.createElement("div",{className:"static-home-Card"},r.createElement("div",{className:"static-home-Card-header"},S("CALL_CENTER_HELPLINE")),r.createElement("div",{className:"helplineIcon"},r.createElement(t.HelpLineIcon,null))),r.createElement("div",{className:"call-center-card-text"},null!=T&&null!==(a=T.helpline)&&void 0!==a&&a.contactOne?r.createElement("div",{className:"call-center-card-content"},r.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?r.createElement("div",{className:"call-center-card-content"},r.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?r.createElement(t.Card,{style:{margin:"16px",padding:"16px",maxWidth:"unset"}},r.createElement("div",{className:"static-home-Card"},r.createElement("div",{className:"static-home-Card-header"},S("CITIZEN_SERVICE_CENTER")),r.createElement("div",{className:"serviceCentrIcon"},r.createElement(t.ServiceCenterIcon,null))),r.createElement("div",{className:"service-center-details-card"},r.createElement("div",{className:"service-center-details-text"},null==T?void 0:T.serviceCenter)),null!=T&&T.viewMapLocation?r.createElement("div",{className:"link"},r.createElement("a",{href:null==T?void 0:T.viewMapLocation},S("VIEW_ON_MAP"))):null):r.createElement("div",null),r.createElement(t.Card,{style:{margin:"16px",padding:"16px",maxWidth:"unset"}},_||null==I||null===(null==I?void 0:I.dynamicDataOne)?r.createElement("div",null):r.createElement("div",{className:"dynamicDataCard"},r.createElement("div",{className:"dynamicData"},r.createElement(D,{module:b,styles:{width:"24px",height:"24px"}}),r.createElement("span",{className:"dynamicData-content"},null==I?void 0:I.dynamicDataOne))),_||null==I||null===(null==I?void 0:I.dynamicDataTwo)?r.createElement("div",null):r.createElement("div",{className:"dynamicDataCard"},r.createElement("div",{className:"dynamicData"},r.createElement(D,{module:b,styles:{width:"24px",height:"24px"}}),r.createElement("span",{className:"dynamicData-content"},null==I?void 0:I.dynamicDataTwo))),T&&null!=T&&T.staticDataOne?r.createElement("div",{className:"staticDataCard"},r.createElement("div",{className:"staticData"},r.createElement(R,{module:b}),r.createElement("span",{className:"static-data-content"},r.createElement("span",{className:"static-data-content-first",style:{marginTop:""===(null===(m=x(b))||void 0===m?void 0:m.staticDataOne)?"8px":"unset"}},null===(p=x(b))||void 0===p?void 0:p.staticDataOneHeader),r.createElement("span",{className:"static-data-content-second"},""+(null===(v=x(b))||void 0===v?void 0:v.staticDataOne))))):r.createElement("div",null),T&&null!=T&&T.staticDataTwo?r.createElement("div",{className:"staticDataCard"},r.createElement("div",{className:"staticData"},r.createElement(P,{module:b}),r.createElement("span",{className:"static-data-content"},r.createElement("span",{className:"static-data-content-first"},null===(f=x(b))||void 0===f?void 0:f.staticDataTwoHeader),r.createElement("span",{className:"static-data-content-second"},null===(g=x(b))||void 0===g?void 0:g.staticDataTwo)))):r.createElement("div",null),T&&null!=T&&T.validity?r.createElement("div",{className:"staticDataCard"},r.createElement("div",{className:"staticData"},r.createElement("span",{className:"validityIcon"},r.createElement(t.ValidityTimeIcon,null)),r.createElement("span",{className:"static-data-content"},r.createElement("span",{className:"static-data-content-first"},null===(E=L(b))||void 0===E?void 0:E.staticCommonContent),r.createElement("span",{className:"static-data-content-second"},null===(y=L(b))||void 0===y?void 0:y.validity)))):r.createElement("div",null),_||null==I||null==I||!I.staticData||null===(null==I?void 0:I.staticData)?r.createElement("div",null):r.createElement("div",{className:"staticDataCard"},r.createElement("div",{className:"staticData"},"PGR"===b?r.createElement(D,{module:b,styles:{width:"24px",height:"24px",marginLeft:"13px",marginTop:"12px"}}):r.createElement("span",{className:"validityIcon"},r.createElement(t.ValidityTimeIcon,null)),r.createElement("span",{className:"static-data-content"},r.createElement("span",{className:"static-data-content-first"},null===(h=L(b))||void 0===h?void 0:h.staticCommonContent),r.createElement("span",{className:"static-data-content-second"},null==I?void 0:I.staticData)))))):r.createElement(r.Fragment,null)};var Et,yt,ht,bt,St;const Ct=[(null===(Et=window)||void 0===Et?void 0:Et.contextPath)+"/citizen/register/name",`/${null===(yt=window)||void 0===yt?void 0:yt.contextPath}/citizen/select-language`,`/${null===(ht=window)||void 0===ht?void 0:ht.contextPath}/citizen/select-location`,`/${null===(bt=window)||void 0===bt?void 0:bt.contextPath}/citizen/login`,`/${null===(St=window)||void 0===St?void 0:St.contextPath}/citizen/register/otp`],Ot=(e,t)=>t.filter(t=>e.map(e=>e.code).includes(t.code)),Nt=e=>{var n,l,a;let{stateInfo:s,userDetails:c,CITIZEN:u,cityDetails:d,mobileView:m,handleUserDropdownSelection:v,logoUrl:g,stateCode:E,modules:y,appTenants:h,pathname:b,initData:C}=e;const{isLoading:O,data:w,isFetched:_}=Digit.Hooks.useCustomMDMS(Digit.ULBService.getStateId(),"ACCESSCONTROL-ACTIONS-TEST",[{name:"actions-test",filter:`[?(@.url == '${Digit.Utils.getMultiRootTenant()?window.globalPath: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},{})}}),I=Digit.Hooks.useRouteSubscription(b),{t:D}=o.useTranslation(),{path:T}=i.useRouteMatch(),R=i.useHistory(),P=Ct.some(e=>window.location.href.includes(e)),L=y.map((e,t)=>{let{code:n,tenants:o}=e;const l=Digit.ComponentRegistryService.getComponent(n+"Module");return l?r.createElement(i.Route,{key:t,path:`${T}/${n.toLowerCase()}`},r.createElement(l,{stateCode:E,moduleCode:n,userType:"citizen",tenants:Ot(o,h)})):null}),A=y.map((e,n)=>{let{code:o,bannerImage:l}=e,a=(Digit.ComponentRegistryService.getComponent(o+"Links"),_?S(w,o,D):void 0);return"ACTION_TEST_WS"===(null==a?void 0:a.header)&&(null==a||a.links.sort((e,t)=>t.orderNumber-e.orderNumber)),r.createElement(r.Fragment,null,r.createElement(i.Route,{key:n,path:`${T}/${o.toLowerCase()}-home`},r.createElement("div",{className:"moduleLinkHomePage"},r.createElement("img",{src:l||(null==s?void 0:s.bannerUrl),alt:"noimagefound"}),r.createElement(t.BackLink,{className:"moduleLinkHomePageBackButton",onClick:()=>window.history.back()}),r.createElement("h1",null,D("MODULE_"+o.toUpperCase())),r.createElement("div",{className:"moduleLinkHomePageModuleLinks"},a&&r.createElement(t.CitizenHomeCard,{header:D(null==a?void 0:a.header),links:null==a?void 0:a.links,Icon:()=>r.createElement("span",null),Info:"OBPS"===o?()=>r.createElement(t.CitizenInfoLabel,{style:{margin:"0px",padding:"10px"},info:D("CS_FILE_APPLICATION_INFO_LABEL"),text:D("BPA_CITIZEN_HOME_STAKEHOLDER_INCLUDES_INFO_LABEL")}):null,isInfo:"OBPS"===o})),r.createElement(gt,{moduleCode:null==o?void 0:o.toUpperCase()}))),r.createElement(i.Route,{key:"faq"+n,path:`${T}/${o.toLowerCase()}-faq`},r.createElement(H,{module:null==o?void 0:o.toUpperCase()})),r.createElement(i.Route,{key:"hiw"+n,path:`${T}/${o.toLowerCase()}-how-it-works`},r.createElement(ee,{module:null==o?void 0:o.toUpperCase()})))});return r.createElement("div",{className:I},r.createElement(F,{t:D,stateInfo:s,userDetails:c,CITIZEN:u,cityDetails:d,mobileView:m,handleUserDropdownSelection:v,logoUrl:g,showSidebar:!!u,linkData:w,islinkDataLoading:O}),r.createElement("div",{className:"main center-container citizen-home-container mb-25"},P?null:r.createElement("div",{className:"SideBarStatic"},r.createElement(x,{linkData:w,islinkDataLoading:O})),r.createElement(i.Switch,null,r.createElement(i.Route,{exact:!0,path:T},r.createElement($,null)),r.createElement(i.Route,{exact:!0,path:T+"/select-language"},r.createElement(z,null)),r.createElement(i.Route,{exact:!0,path:T+"/select-location"},r.createElement(G,null)),r.createElement(i.Route,{path:T+"/error"},r.createElement(p,{initData:C,goToHome:()=>{var e,t,n,r;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===(r=n.getType)||void 0===r?void 0:r.call(n)}`)}})),r.createElement(i.Route,{path:T+"/all-services"},r.createElement(N,{userType:"citizen",modules:y,getCitizenMenu:w,fetchedCitizen:_,isLoading:O})),r.createElement(i.Route,{path:T+"/login"},r.createElement(de,{stateCode:E})),r.createElement(i.Route,{path:T+"/register"},r.createElement(de,{stateCode:E,isUserRegistered:!1})),r.createElement(i.Route,{path:T+"/user/profile"},r.createElement(K,{stateCode:E,userType:"citizen",cityDetails:d})),r.createElement(i.Route,{path:T+"/Audit"},r.createElement(ft,null)),r.createElement(f,{initData:C},L,A))),r.createElement("div",{className:"citizen-home-footer",style:window.location.href.includes("citizen/obps")?{zIndex:"-1"}:{}},r.createElement("img",{alt:"Powered by DIGIT",src:null===(n=window)||void 0===n||null===(l=n.globalConfigs)||void 0===l||null===(a=l.getConfig)||void 0===a?void 0:a.call(l,"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()}})))};var wt="function"==typeof Symbol&&Symbol.for,_t=wt?Symbol.for("react.element"):60103,It=wt?Symbol.for("react.portal"):60106,Dt=wt?Symbol.for("react.fragment"):60107,Tt=wt?Symbol.for("react.strict_mode"):60108,Rt=wt?Symbol.for("react.profiler"):60114,Pt=wt?Symbol.for("react.provider"):60109,Lt=wt?Symbol.for("react.context"):60110,xt=wt?Symbol.for("react.async_mode"):60111,At=wt?Symbol.for("react.concurrent_mode"):60111,Mt=wt?Symbol.for("react.forward_ref"):60112,kt=wt?Symbol.for("react.suspense"):60113,Ut=wt?Symbol.for("react.suspense_list"):60120,Bt=wt?Symbol.for("react.memo"):60115,jt=wt?Symbol.for("react.lazy"):60116,Ft=wt?Symbol.for("react.block"):60121,Vt=wt?Symbol.for("react.fundamental"):60117,Ht=wt?Symbol.for("react.responder"):60118,$t=wt?Symbol.for("react.scope"):60119;function zt(e){if("object"==typeof e&&null!==e){var t=e.$$typeof;switch(t){case _t:switch(e=e.type){case xt:case At:case Dt:case Rt:case Tt:case kt:return e;default:switch(e=e&&e.$$typeof){case Lt:case Mt:case jt:case Bt:case Pt:return e;default:return t}}case It:return t}}}function Gt(e){return zt(e)===At}var Wt={AsyncMode:xt,ConcurrentMode:At,ContextConsumer:Lt,ContextProvider:Pt,Element:_t,ForwardRef:Mt,Fragment:Dt,Lazy:jt,Memo:Bt,Portal:It,Profiler:Rt,StrictMode:Tt,Suspense:kt,isAsyncMode:function(e){return Gt(e)||zt(e)===xt},isConcurrentMode:Gt,isContextConsumer:function(e){return zt(e)===Lt},isContextProvider:function(e){return zt(e)===Pt},isElement:function(e){return"object"==typeof e&&null!==e&&e.$$typeof===_t},isForwardRef:function(e){return zt(e)===Mt},isFragment:function(e){return zt(e)===Dt},isLazy:function(e){return zt(e)===jt},isMemo:function(e){return zt(e)===Bt},isPortal:function(e){return zt(e)===It},isProfiler:function(e){return zt(e)===Rt},isStrictMode:function(e){return zt(e)===Tt},isSuspense:function(e){return zt(e)===kt},isValidElementType:function(e){return"string"==typeof e||"function"==typeof e||e===Dt||e===At||e===Rt||e===Tt||e===kt||e===Ut||"object"==typeof e&&null!==e&&(e.$$typeof===jt||e.$$typeof===Bt||e.$$typeof===Pt||e.$$typeof===Lt||e.$$typeof===Mt||e.$$typeof===Vt||e.$$typeof===Ht||e.$$typeof===$t||e.$$typeof===Ft)},typeOf:zt},qt=M(function(e,t){"production"!==process.env.NODE_ENV&&function(){var e="function"==typeof Symbol&&Symbol.for,n=e?Symbol.for("react.element"):60103,r=e?Symbol.for("react.portal"):60106,o=e?Symbol.for("react.fragment"):60107,l=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,f=e?Symbol.for("react.lazy"):60116,g=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 b(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 l:case m:return p;default:var g=p&&p.$$typeof;switch(g){case s:case d:case f:case v:case i:return g;default:return t}}case r:return t}}}var S=u,C=s,O=i,N=n,w=d,_=o,I=f,D=v,T=r,R=a,P=l,L=m,x=!1;function A(e){return b(e)===u}t.AsyncMode=c,t.ConcurrentMode=S,t.ContextConsumer=C,t.ContextProvider=O,t.Element=N,t.ForwardRef=w,t.Fragment=_,t.Lazy=I,t.Memo=D,t.Portal=T,t.Profiler=R,t.StrictMode=P,t.Suspense=L,t.isAsyncMode=function(e){return x||(x=!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.")),A(e)||b(e)===c},t.isConcurrentMode=A,t.isContextConsumer=function(e){return b(e)===s},t.isContextProvider=function(e){return b(e)===i},t.isElement=function(e){return"object"==typeof e&&null!==e&&e.$$typeof===n},t.isForwardRef=function(e){return b(e)===d},t.isFragment=function(e){return b(e)===o},t.isLazy=function(e){return b(e)===f},t.isMemo=function(e){return b(e)===v},t.isPortal=function(e){return b(e)===r},t.isProfiler=function(e){return b(e)===a},t.isStrictMode=function(e){return b(e)===l},t.isSuspense=function(e){return b(e)===m},t.isValidElementType=function(e){return"string"==typeof e||"function"==typeof e||e===o||e===u||e===a||e===l||e===m||e===p||"object"==typeof e&&null!==e&&(e.$$typeof===f||e.$$typeof===v||e.$$typeof===i||e.$$typeof===s||e.$$typeof===d||e.$$typeof===E||e.$$typeof===y||e.$$typeof===h||e.$$typeof===g)},t.typeOf=b}()}),Xt=M(function(e){e.exports="production"===process.env.NODE_ENV?Wt:qt}),Zt=Object.getOwnPropertySymbols,Yt=Object.prototype.hasOwnProperty,Qt=Object.prototype.propertyIsEnumerable;function Jt(e){if(null==e)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(e)}var Kt=function(){try{if(!Object.assign)return!1;var e=new String("abc");if(e[5]="de","5"===Object.getOwnPropertyNames(e)[0])return!1;for(var t={},n=0;n<10;n++)t["_"+String.fromCharCode(n)]=n;if("0123456789"!==Object.getOwnPropertyNames(t).map(function(e){return t[e]}).join(""))return!1;var r={};return"abcdefghijklmnopqrst".split("").forEach(function(e){r[e]=e}),"abcdefghijklmnopqrst"===Object.keys(Object.assign({},r)).join("")}catch(e){return!1}}()?Object.assign:function(e,t){for(var n,r,o=Jt(e),l=1;l<arguments.length;l++){for(var a in n=Object(arguments[l]))Yt.call(n,a)&&(o[a]=n[a]);if(Zt){r=Zt(n);for(var i=0;i<r.length;i++)Qt.call(n,r[i])&&(o[r[i]]=n[r[i]])}}return o},en="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED",tn=Function.call.bind(Object.prototype.hasOwnProperty),nn=function(){};if("production"!==process.env.NODE_ENV){var rn=en,on={},ln=tn;nn=function(e){var t="Warning: "+e;"undefined"!=typeof console&&console.error(t);try{throw new Error(t)}catch(e){}}}function an(e,t,n,r,o){if("production"!==process.env.NODE_ENV)for(var l in e)if(ln(e,l)){var a;try{if("function"!=typeof e[l]){var i=Error((r||"React class")+": "+n+" type `"+l+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof e[l]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw i.name="Invariant Violation",i}a=e[l](t,l,r,n,null,rn)}catch(e){a=e}if(!a||a instanceof Error||nn((r||"React class")+": type specification of "+n+" `"+l+"` 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 on)){on[a.message]=!0;var s=o?o():"";nn("Failed "+n+" type: "+a.message+(null!=s?s:""))}}}an.resetWarningCache=function(){"production"!==process.env.NODE_ENV&&(on={})};var sn=an,cn=function(){};function un(){return null}function dn(){}function mn(){}"production"!==process.env.NODE_ENV&&(cn=function(e){var t="Warning: "+e;"undefined"!=typeof console&&console.error(t);try{throw new Error(t)}catch(e){}}),mn.resetWarningCache=dn;var pn=M(function(e){e.exports="production"!==process.env.NODE_ENV?function(e,t){var n="function"==typeof Symbol&&Symbol.iterator,r={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(un),arrayOf:function(e){return a(function(t,n,r,o,a){if("function"!=typeof e)return new l("Property `"+a+"` of component `"+r+"` has invalid PropType notation inside arrayOf.");var i=t[n];if(!Array.isArray(i))return new l("Invalid "+o+" `"+a+"` of type `"+u(i)+"` supplied to `"+r+"`, expected an array.");for(var s=0;s<i.length;s++){var c=e(i,s,r,o,a+"["+s+"]",en);if(c instanceof Error)return c}return null})},element:a(function(t,n,r,o,a){var i=t[n];return e(i)?null:new l("Invalid "+o+" `"+a+"` of type `"+u(i)+"` supplied to `"+r+"`, expected a single ReactElement.")}),elementType:a(function(e,t,n,r,o){var a=e[t];return Xt.isValidElementType(a)?null:new l("Invalid "+r+" `"+o+"` of type `"+u(a)+"` supplied to `"+n+"`, expected a single ReactElement type.")}),instanceOf:function(e){return a(function(t,n,r,o,a){var i;return t[n]instanceof e?null:new l("Invalid "+o+" `"+a+"` of type `"+((i=t[n]).constructor&&i.constructor.name?i.constructor.name:"<<anonymous>>")+"` supplied to `"+r+"`, expected instance of `"+(e.name||"<<anonymous>>")+"`.")})},node:a(function(e,t,n,r,o){return c(e[t])?null:new l("Invalid "+r+" `"+o+"` supplied to `"+n+"`, expected a ReactNode.")}),objectOf:function(e){return a(function(t,n,r,o,a){if("function"!=typeof e)return new l("Property `"+a+"` of component `"+r+"` has invalid PropType notation inside objectOf.");var i=t[n],s=u(i);if("object"!==s)return new l("Invalid "+o+" `"+a+"` of type `"+s+"` supplied to `"+r+"`, expected an object.");for(var c in i)if(tn(i,c)){var d=e(i,c,r,o,a+"."+c,en);if(d instanceof Error)return d}return null})},oneOf:function(e){if(!Array.isArray(e))return"production"!==process.env.NODE_ENV&&cn(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."),un;function t(t,n,r,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 l("Invalid "+a+" `"+i+"` of value `"+String(s)+"` supplied to `"+r+"`, expected one of "+u+".")}return a(t)},oneOfType:function(e){if(!Array.isArray(e))return"production"!==process.env.NODE_ENV&&cn("Invalid argument supplied to oneOfType, expected an instance of array."),un;for(var t=0;t<e.length;t++){var n=e[t];if("function"!=typeof n)return cn("Invalid argument supplied to oneOfType. Expected an array of check functions, but received "+m(n)+" at index "+t+"."),un}return a(function(t,n,r,o,a){for(var i=[],s=0;s<e.length;s++){var c=(0,e[s])(t,n,r,o,a,en);if(null==c)return null;c.data&&tn(c.data,"expectedType")&&i.push(c.data.expectedType)}return new l("Invalid "+o+" `"+a+"` supplied to `"+r+"`"+(i.length>0?", expected one of type ["+i.join(", ")+"]":"")+".")})},shape:function(e){return a(function(t,n,r,o,a){var i=t[n],c=u(i);if("object"!==c)return new l("Invalid "+o+" `"+a+"` of type `"+c+"` supplied to `"+r+"`, expected `object`.");for(var m in e){var p=e[m];if("function"!=typeof p)return s(r,o,a,m,d(p));var v=p(i,m,r,o,a+"."+m,en);if(v)return v}return null})},exact:function(e){return a(function(t,n,r,o,a){var i=t[n],c=u(i);if("object"!==c)return new l("Invalid "+o+" `"+a+"` of type `"+c+"` supplied to `"+r+"`, expected `object`.");var m=Kt({},t[n],e);for(var p in m){var v=e[p];if(tn(e,p)&&"function"!=typeof v)return s(r,o,a,p,d(v));if(!v)return new l("Invalid "+o+" `"+a+"` key `"+p+"` supplied to `"+r+"`.\nBad object: "+JSON.stringify(t[n],null," ")+"\nValid keys: "+JSON.stringify(Object.keys(e),null," "));var f=v(i,p,r,o,a+"."+p,en);if(f)return f}return null})}};function o(e,t){return e===t?0!==e||1/e==1/t:e!=e&&t!=t}function l(e,t){this.message=e,this.data=t&&"object"==typeof t?t:{},this.stack=""}function a(e){function t(t,n,r,o,a,i,s){if(o=o||"<<anonymous>>",i=i||r,s!==en){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[r]?t?new l(null===n[r]?"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,r,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,r,o,a,i){var s=t[n];return u(s)!==e?new l("Invalid "+o+" `"+a+"` of type `"+d(s)+"` supplied to `"+r+"`, expected `"+e+"`.",{expectedType:e}):null})}function s(e,t,n,r,o){return new l((e||"React class")+": "+t+" type `"+n+"."+r+"` 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 r=function(e){var t=e&&(n&&e[n]||e["@@iterator"]);if("function"==typeof t)return t}(t);if(!r)return!1;var o,l=r.call(t);if(r!==t.entries){for(;!(o=l.next()).done;)if(!c(o.value))return!1}else for(;!(o=l.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 l.prototype=Error.prototype,r.checkPropTypes=sn,r.resetWarningCache=sn.resetWarningCache,r.PropTypes=r,r}(Xt.isElement):function(){function e(e,t,n,r,o,l){if(l!==en){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:mn,resetWarningCache:dn};return n.PropTypes=n,n}()});const vn=e=>{let{children:t}=e;return r.createElement("div",{className:"banner banner-container"},t)},fn=e=>{var n;let{showTenant:l=!0}=e;const{data:a,isLoading:i}=Digit.Hooks.useStore.getInitData(),{stateInfo:s}=a||{},{t:c}=o.useTranslation();return i?r.createElement(t.Loader,null):r.createElement("div",{className:"bannerHeader"},r.createElement("img",{className:"bannerLogo",src:null==s?void 0:s.logoUrl,style:l?{}:{borderRight:"unset"}}),l&&(null==s?void 0:s.code)&&r.createElement("p",null,c("TENANT_TENANTS_"+(null==s||null===(n=s.code)||void 0===n?void 0:n.toUpperCase()))))},gn=e=>{var o,l,a;let{config:c,t:u}=e;const[d,m]=n.useState(null),{mobile_number:p,tenantId:v}=Digit.Hooks.useQueryParams(),f=i.useHistory(),[g,E]=n.useState(""),[y,h]=n.useState(!0),[b,S]=n.useState(null),C=()=>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`;f.replace(n)},[d]);const O=()=>{S(null)},[N,w,_]=c.inputs,I=[{body:[{label:u(N.label),type:N.type,populators:{name:N.name},isMandatory:!0},{label:u(w.label),type:w.type,populators:{name:w.name},isMandatory:!0},{label:u(_.label),type:_.type,populators:{name:_.name},isMandatory:!0}]}];return r.createElement(vn,null,r.createElement("div",{className:"employeeBackbuttonAlign"},r.createElement(t.BackButton,{variant:"white",style:{borderBottom:"none"}})),r.createElement(s.FormComposer,{onSubmit:function(e){try{return Promise.resolve(Q(function(){if(e.newPassword!==e.confirmPassword)return S(u("ERR_PASSWORD_DO_NOT_MATCH"));const t={...e,otpReference:g,tenantId:v,type:C().toUpperCase()};return Promise.resolve(Digit.UserService.changePassword(t,v)).then(function(e){(()=>{var e;f.replace(`/${null===(e=window)||void 0===e?void 0:e.contextPath}/employee/user/login`)})()})},function(e){var t,n,r,o,l;S((null==e||null===(t=e.response)||void 0===t||null===(n=t.data)||void 0===n||null===(r=n.error)||void 0===r||null===(o=r.fields)||void 0===o||null===(l=o[0])||void 0===l?void 0:l.message)||u("ES_SOMETHING_WRONG")),setTimeout(O,5e3)}))}catch(e){return Promise.reject(e)}},noBoxShadow:!0,inline:!0,submitInForm:!0,config:I,label:c.texts.submitButtonLabel,cardStyle:{maxWidth:"408px",margin:"auto"},className:"employeeChangePassword"},r.createElement(fn,null),r.createElement(s.CardSubHeader,{style:{textAlign:"center"}}," ",c.texts.header," "),r.createElement(t.CardText,null,u("CS_LOGIN_OTP_TEXT")+" ",r.createElement("b",null," ",""+u("+ 91 - ")," ",p)),r.createElement(le,{t:u,userType:"employee",otp:g,onOtpChange:E,error:y,onResend:function(){try{function e(){setTimeout(O,5e3)}const t={otp:{mobileNumber:p,userType:C().toUpperCase(),type:"passwordreset",tenantId:v}},n=Q(function(){return Promise.resolve(Digit.UserService.sendOtp(t,v)).then(function(){S(u("ES_OTP_RESEND"))})},function(e){var t,n;S((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)}}})),b&&r.createElement(t.Toast,{type:"error",label:u(b),onClose:O}),r.createElement("div",{className:"EmployeeLoginFooter"},r.createElement("img",{alt:"Powered by DIGIT",src:null===(o=window)||void 0===o||null===(l=o.globalConfigs)||void 0===l||null===(a=l.getConfig)||void 0===a?void 0:a.call(l,"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()}})," "))};gn.propTypes={loginParams:pn.any},gn.defaultProps={loginParams:null};const En=[{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"}]}],yn=()=>{const{t:e}=o.useTranslation(),{path:t}=i.useRouteMatch(),l=n.useMemo(()=>En.map(t=>{const n={};for(const r in t.texts)n[r]=e(t.texts[r]);return{...t,texts:n}},[En]));return r.createElement(i.Switch,null,r.createElement(i.Route,{path:""+t,exact:!0},r.createElement(gn,{config:l[0],t:e})))},hn=[{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"}]}],bn=e=>{var o,l,a;let{config:c,t:u}=e;const{data:d,isLoading:m}=Digit.Hooks.useTenants(),[p,v]=n.useState(null),f=i.useHistory(),[E,y]=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`;f.replace(n)},[p]);const h=()=>{y(null)},[b,S]=c.inputs,C=[{body:[{label:u(b.label),type:b.type,populators:{name:b.name,componentInFront:"+91"},isMandatory:!0},{label:u(S.label),type:S.type,populators:{name:S.name,customProps:{},component:(e,n)=>r.createElement(t.Dropdown,g({option:d,optionKey:"name",id:S.name,className:"login-city-dd",select:t=>{e.onChange(t)}},n))},isMandatory:!0}]}];return m?r.createElement(t.Loader,null):r.createElement(vn,null,r.createElement("div",{className:"employeeBackbuttonAlign"},r.createElement(t.BackLink,{onClick:()=>window.history.back()})),r.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=Q(function(){return Promise.resolve(Digit.UserService.sendOtp(t,e.city.code)).then(function(){var t;f.push(`/${null===(t=window)||void 0===t?void 0:t.contextPath}/employee/user/change-password?mobile_number=${e.mobileNumber}&tenantId=${e.city.code}`)})},function(e){var t,n,r,o,l;y((null==e||null===(t=e.response)||void 0===t||null===(n=t.data)||void 0===n||null===(r=n.error)||void 0===r||null===(o=r.fields)||void 0===o||null===(l=o[0])||void 0===l?void 0:l.message)||"Invalid login credentials!"),setTimeout(h,5e3)});return Promise.resolve(n&&n.then?n.then(function(){}):void 0)}catch(e){return Promise.reject(e)}},noBoxShadow:!0,inline:!0,submitInForm:!0,config:C,label:c.texts.submitButtonLabel,secondaryActionLabel:c.texts.secondaryButtonLabel,onSecondayActionClick:()=>{var e;f.replace(`/${null===(e=window)||void 0===e?void 0:e.contextPath}/employee/login`)},heading:c.texts.header,description:c.texts.description,headingStyle:{textAlign:"center"},cardStyle:{maxWidth:"408px",margin:"auto"},className:"employeeForgotPassword"},r.createElement(fn,null)),E&&r.createElement(t.Toast,{type:"error",label:u(E),onClose:h}),r.createElement("div",{className:"EmployeeLoginFooter"},r.createElement("img",{alt:"Powered by DIGIT",src:null===(o=window)||void 0===o||null===(l=o.globalConfigs)||void 0===l||null===(a=l.getConfig)||void 0===a?void 0:a.call(l,"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()}})," "))};bn.propTypes={loginParams:pn.any},bn.defaultProps={loginParams:null};const Sn=()=>{const{t:e}=o.useTranslation(),{path:t}=i.useRouteMatch(),l=n.useMemo(()=>hn.map(t=>{const n={};for(const r in t.texts)n[r]=e(t.texts[r]);return{...t,texts:n}},[hn]));return r.createElement(i.Switch,null,r.createElement(i.Route,{path:""+t,exact:!0},r.createElement(bn,{config:l[0],t:e})))},Cn=(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)}),On=e=>{var t;let{stateCode:n,userType:o,modules:l,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 r.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==l?void 0:l.map((e,t)=>{var l;let{code:s,tenants:u}=e;const d=Digit.ComponentRegistryService.getComponent(s+"Module");return r.createElement(i.Route,{key:t,path:`${c}/${s.toLowerCase()}`},d?r.createElement(d,{stateCode:n,moduleCode:s,userType:o,tenants:Cn(u,a)}):r.createElement(i.Redirect,{to:`/${null===(l=window)||void 0===l?void 0:l.contextPath}/employee/user/error?type=notfound&module=${s}`}))});return r.createElement("div",{className:"ground-container digit-home-ground"},r.createElement(i.Switch,null,p,r.createElement(i.Route,{path:c+"/login"},r.createElement(i.Redirect,{to:{pathname:`/${null===(t=window)||void 0===t?void 0:t.contextPath}/employee/user/login`,state:{from:u.pathname+u.search}}})),r.createElement(i.Route,{path:c+"/forgot-password"},r.createElement(Sn,null)),r.createElement(i.Route,{path:c+"/change-password"},r.createElement(yn,null)),r.createElement(i.Route,null,r.createElement(N,{userType:o,modules:l,additionalComponent:s}))))},Nn={label:"English",value:Digit.Utils.getDefaultLanguage()},wn=()=>{var e,l,a,c,u;const{data:d,isLoading:m}=Digit.Hooks.useStore.getInitData(),{t:p}=o.useTranslation(),v=i.useHistory(),{languages:f,stateInfo:g}=d||{};let E=f;E&&0!=(null===(e=E)||void 0===e?void 0:e.length)||(E=[Nn]);const y=Digit.StoreData.getCurrentLanguage(),[h,b]=n.useState(y);return m?r.createElement(t.Loader,null):r.createElement(vn,null,r.createElement(t.Card,{className:"bannerCard removeBottomMargin languageSelection"},r.createElement("div",{className:"bannerHeader"},r.createElement("img",{className:"bannerLogo",src:null==g?void 0:g.logoUrl,alt:"Digit"}),r.createElement("p",null,p("TENANT_TENANTS_"+(null==g||null===(l=g.code)||void 0===l?void 0:l.toUpperCase())))),r.createElement("div",{className:"language-selector",style:{justifyContent:"space-around",marginBottom:"24px",padding:"0 5%"}},E.map((e,t)=>r.createElement("div",{className:"language-button-container",key:t},r.createElement(s.CustomButton,{selected:e.value===h,text:e.label,onClick:()=>(e=>{b(e.value),Digit.LocalizationService.changeLanguage(e.value,g.code)})(e)})))),r.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`)}})),r.createElement("div",{className:"EmployeeLoginFooter"},r.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()}})," "))},_n=[{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)}))}"}}}]}],In=[{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"}}]}],Dn=e=>{var o,l,a,s,c,u,d,m,p,v,f,g,E;let{config:y,t:h,isDisabled:b,loginOTPBased:S}=e;const{isLoading:C}=Digit.Hooks.useTenants(),{data:O,isLoading:N}=Digit.Hooks.useStore.getInitData(),{stateInfo:w}=O||{},[_,I]=n.useState(null),[D,T]=n.useState(null),[R,P]=n.useState(!1),L=i.useHistory();n.useEffect(()=>{var e,t,n,r,o,l,a,i,s,c,u,d,m,p,v,f,g,E;if(!_)return;Digit.SessionStorage.set("citizen.userRequestObject",_);const y=null==_||null===(e=_.info)||void 0===e||null===(t=e.roles)||void 0===t?void 0:t.filter(e=>e.tenantId===Digit.SessionStorage.get("Employee.tenantId"));(null==_||null===(n=_.info)||void 0===n||null===(r=n.roles)||void 0===r?void 0:r.length)>0&&(_.info.roles=y),Digit.UserService.setUser(_),((e,t)=>{var n;let r=(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",r),localStorage.setItem("Employee.locale",r),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==_?void 0:_.info,null==_?void 0:_.access_token);let h=`/${null===(o=window)||void 0===o?void 0:o.contextPath}/employee`;var b,S,C,O,N,w,I;null!==(l=window)&&void 0!==l&&null!==(a=l.location)&&void 0!==a&&null!==(i=a.href)&&void 0!==i&&i.includes("from=")&&(h=decodeURIComponent(null===(b=window)||void 0===b||null===(S=b.location)||void 0===S||null===(C=S.href)||void 0===C||null===(O=C.split("from="))||void 0===O?void 0:O[1])||`/${null===(N=window)||void 0===N?void 0:N.contextPath}/employee`),null!=_&&null!==(s=_.info)&&void 0!==s&&s.roles&&(null==_||null===(c=_.info)||void 0===c||null===(u=c.roles)||void 0===u?void 0:u.length)>0&&null!=_&&null!==(d=_.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!=_&&null!==(p=_.info)&&void 0!==p&&p.roles&&(null==_||null===(v=_.info)||void 0===v||null===(f=v.roles)||void 0===f?void 0:f.length)>0&&null!=_&&null!==(g=_.info)&&void 0!==g&&null!==(E=g.roles)&&void 0!==E&&E.every(e=>"STADMIN"===e.code)&&(h=`/${null===(I=window)||void 0===I?void 0:I.contextPath}/employee/dss/landing/home`),L.replace(h)},[_]);const x={url:"/user-otp/v1/_send",params:{tenantId:Digit.ULBService.getStateId()},body:{},config:{enable:!1}},A=Digit.Hooks.useCustomAPIMutationHook(x),M=()=>{T(null)},k={code:Digit.ULBService.getStateId(),name:Digit.Utils.locale.getTransformedLocale("TENANT_TENANTS_"+Digit.ULBService.getStateId())};let U=[{body:null==y?void 0:y.inputs}];const{mode:B}=Digit.Hooks.useQueryParams();return"admin"===B&&0==(null==U||null===(o=U[0])||void 0===o||null===(l=o.body)||void 0===l||null===(a=l[2])||void 0===a?void 0:a.disable)&&null==(null==U||null===(s=U[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)&&(U[0].body[2].disable=!0,U[0].body[2].isMandatory=!1,U[0].body[2].populators.defaultValue=k),C||N?r.createElement(t.Loader,null):r.createElement(vn,null,r.createElement("div",{className:"employeeBackbuttonAlign"},r.createElement(t.BackLink,{onClick:()=>window.history.back()})),r.createElement(t.FormComposerV2,{onSubmit:S?function(e){try{const t=e.email;return Promise.resolve(A.mutate({body:{otp:{userName:e.email,type:"login",tenantId:Digit.ULBService.getStateId(),userType:"EMPLOYEE"}},config:{enable:!0}},{onError:(e,t)=>{var n,r,o,l,a,i,s;T(null!=e&&null!==(n=e.response)&&void 0!==n&&null!==(r=n.data)&&void 0!==r&&null!==(o=r.Errors)&&void 0!==o&&o[0].code?"SANDBOX_RESEND_OTP"+(null==e||null===(l=e.response)||void 0===l||null===(a=l.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(M,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(){P(!1)}P(!0);const r={...e,userType:"EMPLOYEE"};r.tenantId=(null==e||null===(t=e.city)||void 0===t?void 0:t.code)||Digit.ULBService.getStateId(),delete r.city;const o=Q(function(){return Promise.resolve(Digit.UserService.authenticate(r)).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;T((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(M,5e3)});return Promise.resolve(o&&o.then?o.then(n):n())}catch(e){return Promise.reject(e)}},isDisabled:b||R,noBoxShadow:!0,inline:!0,submitInForm:!0,config:U,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 r=U[0].body.map(e=>e.key).some(e=>{const n=t[e];return null==n||""===n||"check"===e&&!1===n||"captcha"===e&&!1===n});P(r)},heading:null==y||null===(v=y.texts)||void 0===v?void 0:v.header,className:"loginFormStyleEmployee "+(S?"sandbox-onboarding-wrapper":""),cardSubHeaderClassName:"loginCardSubHeaderClassName",cardClassName:"loginCardClassName",buttonClassName:"buttonClassName"},r.createElement(fn,null!=w&&w.code?null:{showTenant:!1})),D&&r.createElement(t.Toast,{type:"error",label:h(D),onClose:M}),r.createElement("div",{className:"employee-login-home-footer",style:{backgroundColor:"unset"}},r.createElement("img",{alt:"Powered by DIGIT",src:null===(f=window)||void 0===f||null===(g=f.globalConfigs)||void 0===g||null===(E=g.getConfig)||void 0===E?void 0:E.call(g,"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.propTypes={loginParams:pn.any},Dn.defaultProps={loginParams:null};const Tn=e=>{var t,l;let{stateCode:a}=e;const{t:s}=o.useTranslation(),{path:c}=i.useRouteMatch(),[u,d]=n.useState(_n),[m,p]=n.useState(In),v=Digit.StoreData.getCurrentLanguage(),f=(null===(t=window)||void 0===t||null===(l=t.globalConfigs)||void 0===l?void 0:l.getConfig("OTP_BASED_LOGIN"))||!1,{data:g,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!=g&&g.config?null==g?void 0:g.config:_n)},[g,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 r.createElement(i.Switch,null,r.createElement(i.Route,{path:""+c,exact:!0},r.createElement(Dn,f?{config:h[0],t:s,loginOTPBased:f}:{config:y[0],t:s})))},Rn=e=>{let{embedId:t}=e;return r.createElement("iframe",{className:"player-iframe",width:"480",height:"270",src:"https://www.youtube.com/embed/"+t,allow:"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture",allowFullScreen:!0,title:"Embedded youtube"})},Pn=e=>{const[t,o]=n.useState(""),[l,a]=n.useState(!1);return n.useEffect(()=>{let t=e.link;t.startsWith("https://www.youtube.com/watch?v=")&&(t=t.split("https://www.youtube.com/watch?v=")[1]),o(t)},[e.link]),r.createElement("div",null,l&&r.createElement("div",{className:"overlay",onClick:()=>a(!1)},r.createElement("div",{onClick:e=>e.stopPropagation()},r.createElement(Rn,{embedId:t}))),e.overlay?r.createElement("div",{className:"player-wrapper"},r.createElement("div",{className:"player-click-area",onClick:()=>{e.overlay&&a(!0)}}),r.createElement(Rn,{embedId:t})):r.createElement(Rn,{embedId:t}))},Ln=e=>{var n;let{config:l}=e;const{t:a}=o.useTranslation(),{heading:s,subsections:c,url:u}=l;let d=`/${null===(n=window)||void 0===n?void 0:n.contextPath}/employee`;const m=i.useHistory();return r.createElement(t.Card,null,r.createElement(t.Header,{className:"headerFlex",styles:{fontWeight:"700",fontSize:"32px",marginBottom:"20px"}},a(s)),r.createElement(Pn,{link:u,overlay:!0}),c.map((e,n)=>r.createElement("div",{key:n},r.createElement(t.CardHeader,{styles:{marginBottom:"10px",fontSize:"24px",fontWeight:"bold"}},a(e.title)),"paragraph"===e.type&&e.content.map((e,n)=>r.createElement(t.CardText,{key:n},r.createElement("p",{style:{lineHeight:"1.6"}},a(e.text)))),"steps"===e.type&&r.createElement("ul",{style:{paddingLeft:"0px"}},e.content.map((e,n)=>r.createElement(t.CardText,{key:e.id},r.createElement("li",{style:{listStyleType:"none"}},e.id,". ",a(e.text))))))),r.createElement("div",{className:"setupMasterSetupActionBar",style:{textAlign:"right",marginTop:"2rem"}},r.createElement(t.Button,{className:"actionButton",label:a("CONTINUE_LANDING"),variation:"primary",icon:"ArrowForward",isSuffix:!0,onClick:e=>{e.preventDefault(),m.push(d)}})))},xn={heading:"SANDBOX_HEADING",url:"https://www.youtube.com/watch?v=1ZLdetJwfeY",subsections:[{title:"SANDBOX_INTRODUCTION_TITLE",type:"paragraph",content:[{text:"SANDBOX_INTRODUCTION_TEXT"}]},{title:"SANDBOX_PRODUCTS_TITLE",type:"paragraph",content:[{text:"SANDBOX_PRODUCTS_TEXT"},{text:"SANDBOX_COMPLAINTS_DESCRIPTION"},{text:"SANDBOX_CAMPAIGNS_DESCRIPTION"}]},{title:"SANDBOX_USER_CAPABILITIES_TITLE",type:"steps",content:[{id:1,text:"USER_CAPABILITIES_STEP_1"},{id:2,text:"USER_CAPABILITIES_STEP_2"},{id:3,text:"USER_CAPABILITIES_STEP_3"},{id:4,text:"USER_CAPABILITIES_STEP_4"},{id:5,text:"USER_CAPABILITIES_STEP_5"}]}]},An=()=>r.createElement(Ln,{config:xn}),Mn=[{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,pattern:/^[A-Za-z]+( [A-Za-z]+)*$/},error:"ERR_ACCOUNT_NAME_REQUIRED"},infoMessage:"SANDBOX_SIGNUP_ACCOUNT_NAME_TOOLTIP"},{isMandatory:!1,key:"check",type:"component",component:"PrivacyComponent",withoutLabel:!0,disable:!1,customProps:{module:"SandboxSignUp"},populators:{name:"check"}}]}],kn=e=>{var o,l,a,s,c,u,d,m,p,v,f,g,E;let{config:y,t:h,isDisabled:b}=e;const{isLoading:S}=Digit.Hooks.useTenants(),{isLoading:C}=Digit.Hooks.useStore.getInitData(),[O,N]=n.useState(null),[w,_]=n.useState(!1),I=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:R}=Digit.Hooks.useQueryParams();return"admin"===R&&0==(null==T||null===(o=T[0])||void 0===o||null===(l=o.body)||void 0===l||null===(a=l[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),S||C?r.createElement(t.Loader,null):r.createElement(vn,null,r.createElement("div",{className:"employeeBackbuttonAlign"},r.createElement(t.BackLink,{onClick:()=>window.history.back()})),r.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,r,o,l,a,i,s,c;N({key:"error",label:null!=e&&null!==(n=e.response)&&void 0!==n&&null!==(r=n.data)&&void 0!==r&&null!==(o=r.Errors)&&void 0!==o&&null!==(l=o[0])&&void 0!==l&&l.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,r;return I.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===(r=e.Tenants[0])||void 0===r?void 0:r.code}}),Promise.resolve()}catch(e){return Promise.reject(e)}}})).then(function(){})}catch(e){return Promise.reject(e)}},isDisabled:b||w,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 r=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});_(r)},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"},r.createElement(fn,{showTenant:!1})),O&&r.createElement(t.Toast,{type:"error",label:h(null==O?void 0:O.label),onClose:()=>{N(null)}}),r.createElement("div",{className:"employee-login-home-footer",style:{backgroundColor:"unset"}},r.createElement("img",{alt:"Powered by DIGIT",src:null===(f=window)||void 0===f||null===(g=f.globalConfigs)||void 0===g||null===(E=g.getConfig)||void 0===E?void 0:E.call(g,"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()}})))};kn.propTypes={loginParams:pn.any},kn.defaultProps={loginParams:null};const Un=e=>{let{stateCode:t}=e;const{t:l}=o.useTranslation(),{path:a}=i.useRouteMatch(),[s,c]=n.useState(Mn),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:Mn)},[d,m]);const p=n.useMemo(()=>s.map(e=>{const t={};for(const n in e.texts)t[n]=l(e.texts[n]);return{...e,texts:t}},[s]));return r.createElement(i.Switch,null,r.createElement(i.Route,{path:""+a,exact:!0},r.createElement(kn,{config:p[0],t:l})))},Bn=e=>{var l,a,c,u;let{isLogin:d=!1}=e;const{t:m}=o.useTranslation(),p=(i.useRouteMatch(),i.useHistory()),v=i.useLocation(),[f,g]=n.useState(null),[E,y]=n.useState(!1),[h,b]=n.useState(null),[S,C]=n.useState((null==v||null===(l=v.state)||void 0===l?void 0:l.data)||{}),{email:O,tenant:N}=v.state||{},w=[{body:[{type:"component",component:"OtpComponent",key:"OtpComponent",withoutLabel:!0,isMandatory:!1,customProps:{email:O,tenant:N},populators:{required:!0}}]}],_=[{texts:{header:m("SANDBOX_OTP_VERIFICATION"),submitButtonLabel:"CORE_COMMON_SUBMIT"}}],I=()=>{g(null)};return n.useEffect(()=>{var e,t,n,r,o,l;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===(r=n.roles)||void 0===r?void 0:r.length)>0&&(h.info.roles=a),Digit.UserService.setUser(h),((e,t)=>{var n;let r=(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",r),localStorage.setItem("Employee.locale",r),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===(l=window)||void 0===l?void 0:l.contextPath}/employee/user/landing`;return d?void p.push(s):void p.push({pathname:i,state:{tenant:N}})},[h]),r.createElement(vn,null,r.createElement("div",{className:"employeeBackbuttonAlign"},r.createElement(t.BackLink,{onClick:()=>window.history.back()})),r.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"},r=Q(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),b({info:t,...n})})},function(e){var t,n;g((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(I,5e3)});return Promise.resolve(r&&r.then?r.then(function(){}):void 0)}catch(e){return Promise.reject(e)}},noBoxShadow:!0,inline:!0,submitInForm:!0,onFormValueChange:(e,t)=>{var n;const r=t.OtpComponent;6===(null==r||null===(n=r.otp)||void 0===n?void 0:n.length)?y(!0):y(!1)},isDisabled:!E,config:w,label:_[0].texts.submitButtonLabel,heading:_[0].texts.header,headingStyle:{textAlign:"center"},cardStyle:{maxWidth:"408px",margin:"auto"},className:"sandbox-onboarding-wrapper"},r.createElement(fn,{showTenant:!1})),f&&r.createElement(t.Toast,{type:"error",label:m(f),onClose:I}),r.createElement("div",{className:"EmployeeLoginFooter"},r.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()}})," "))},jn=()=>{var e,l,a,s;const{t:c}=o.useTranslation(),u=i.useLocation(),{tenant:d}=u.state||{},m=(i.useHistory(),n.useRef(null));return r.createElement(vn,null,r.createElement("div",{className:"employeeBackbuttonAlign"},r.createElement(t.BackLink,{onClick:()=>window.history.back()})),r.createElement(t.Card,{className:"card-sandbox"},r.createElement(fn,{showTenant:!1}),r.createElement("div",{className:"sandbox-success-signup"},r.createElement(t.SVG.TickMark,{fill:"#fff",height:40,width:60})),r.createElement(t.CardHeader,{className:"cardHeader-sandbox",styles:{color:"#00703c"}},c("SANDBOX_HEADER")),r.createElement(t.CardText,{className:"cardText-sandbox"},c("SAMDBOX_URL_SUB")),r.createElement(t.CardLabel,null," ",c("SANDBOX_URL")," "),r.createElement("div",{className:"sandbox-url-wrapper"},r.createElement(t.TextInput,{inputRef:m,className:"urlInputText",onChange:()=>{},nonEditable:!0,value:`${window.location.host}/${null===(e=window)||void 0===e?void 0:e.globalPath}/${d}/employee`}),r.createElement(t.Button,{className:"copyButton",variation:"secondary",onClick:()=>{navigator.clipboard.writeText(m.current.value)},label:c("COPY_URL")})),r.createElement("div",{className:"sandbox-url-footer"},c("SANDBOX_URL_FOOT")),r.createElement(t.Button,{onClick:()=>{var e;window.location.href=`/${null===(e=window)||void 0===e?void 0:e.globalPath}/${d}/employee/user/landing`},label:c("SIGN_IN")})),r.createElement("div",{className:"EmployeeLoginFooter"},r.createElement("img",{alt:"Powered by DIGIT",src:null===(l=window)||void 0===l||null===(a=l.globalConfigs)||void 0===a||null===(s=a.getConfig)||void 0===s?void 0:s.call(a,"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()}})))},Fn=["user/landing","user/profile","user/error"],Vn=e=>{var l,a,s,c,u,d;let{stateInfo:m,userDetails:v,CITIZEN:g,cityDetails:E,mobileView:y,handleUserDropdownSelection:h,logoUrl:b,DSO:S,stateCode:C,modules:O,appTenants:N,initData:w}=e;const _=i.useHistory(),{t:I}=o.useTranslation(),{path:D}=i.useRouteMatch(),T=i.useLocation(),R=null==T||null===(l=T.pathname)||void 0===l?void 0:l.includes("language-selection"),P=Fn.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 L=null==w||null===(a=w.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 r.createElement("div",{className:"employee"},r.createElement(i.Switch,null,r.createElement(i.Route,{path:D+"/user"},P&&r.createElement(F,{t:I,stateInfo:m,userDetails:v,CITIZEN:g,cityDetails:E,mobileView:y,handleUserDropdownSelection:h,logoUrl:b,showSidebar:!!P,showLanguageChange:!R}),r.createElement("div",{className:P?"grounded-container":"loginContainer",style:P?{padding:0,paddingTop:"0",marginLeft:"0"}:{"--banner-url":`url(${null==m?void 0:m.bannerUrl})`,padding:"0px"}},r.createElement(i.Switch,null,r.createElement(i.Route,{exact:!0,path:D+"/user/login"},r.createElement(Tn,{stateCode:C})),r.createElement(i.Route,{exact:!0,path:D+"/user/login/otp"},r.createElement(Bn,{isLogin:!0})),r.createElement(i.Route,{path:D+"/user/forgot-password"},r.createElement(Sn,null)),r.createElement(i.Route,{path:D+"/user/change-password"},r.createElement(yn,null)),r.createElement(t.PrivateRoute,{path:D+"/user/profile"},r.createElement(K,{stateCode:C,userType:"employee",cityDetails:E})),r.createElement(t.PrivateRoute,{path:D+"/user/landing"},r.createElement("div",{className:"employee-app-wrapper sandbox-landing-wrapper"},r.createElement(An,null))),r.createElement(i.Route,{path:D+"/user/error"},r.createElement(p,{initData:w,goToHome:()=>{var e,t,n,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===(r=n.getType)||void 0===r?void 0:r.call(n)}`)}})),r.createElement(i.Route,{path:D+"/user/language-selection"},r.createElement(wn,null)),r.createElement(i.Route,null,r.createElement(i.Redirect,{to:D+"/user/language-selection"}))))),r.createElement(i.Route,null,r.createElement(F,{t:I,stateInfo:m,userDetails:v,CITIZEN:g,cityDetails:E,mobileView:y,handleUserDropdownSelection:h,logoUrl:b,modules:O}),r.createElement("div",{className:`main ${S?"m-auto":""} digit-home-main`},r.createElement("div",{className:"employee-app-wrapper digit-home-app-wrapper"},r.createElement(f,{initData:w},r.createElement(On,{stateCode:C,userType:"employee",modules:O,appTenants:N,additionalComponent:L}))),r.createElement("div",{className:"employee-home-footer"},r.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()}})))),r.createElement(i.Route,null,r.createElement(i.Redirect,{to:D+"/user/language-selection"}))))},Hn=e=>{const{state:n={}}=i.useLocation(),{t:l}=o.useTranslation(),a=i.useHistory(),s={imgUrl:"https://s3.ap-south-1.amazonaws.com/egov-qa-assets/error-image.png",infoHeader:"WRONG_TENANT_SIGN_UP",infoMessage:"WRONG_TENANT_SIGN_UP_MESSAGE",buttonInfo:"WRONG_TENANT_SIGN_UP_BUTTON",action:()=>{a.push(`/${window.globalPath}/`)}};return r.createElement(vn,null,r.createElement(t.Card,{className:"digit-employee-card customError"},r.createElement(fn,{showTenant:!1}),r.createElement(t.CardHeader,{className:"center"},l(s.infoHeader)),r.createElement(t.CardText,{className:"center"},l(s.infoMessage)),r.createElement(t.Button,{className:"customErrorButton",label:l(null==s?void 0:s.buttonInfo),variation:"primary",isSuffix:!0,onClick:e=>{e.preventDefault(),null==s||s.action()}})))},$n=e=>{var t,o,l,a;let{stateCode:s,modules:c,appTenants:u,logoUrl:d,initData:m,defaultLanding:p="citizen"}=e;const v=i.useHistory(),{pathname:f}=i.useLocation(),g=window.innerWidth,E=Digit.ULBService.getCurrentUlb(),y=Digit.UserService.getUser(),{data:h}=Digit.Hooks.useStore.getInitData(),{stateInfo:b}=h||{},S=Digit.UserService.hasAccess(["FSM_DSO"]);let C="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")&&(C=!1),n.useEffect(()=>{var e,t,n;null!=f&&f.includes("application-details")||(null!=f&&f.includes("inbox")||Digit.SessionStorage.del("fsm/inbox/searchParams"),null!=f&&f.includes("search")&&Digit.SessionStorage.del("fsm/search/searchParams")),null!=f&&f.includes("dss")||Digit.SessionStorage.del("DSS_FILTERS"),(null==f?void 0:f.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==f?void 0:f.toString())!==`/${null===(t=window)||void 0===t?void 0:t.contextPath}/citizen`&&(null==f?void 0:f.toString())!==`/${null===(n=window)||void 0===n?void 0:n.contextPath}/employee`||Digit.SessionStorage.del("WS_DISCONNECTION")},[f]),v.listen(()=>{var e;null===(e=window)||void 0===e||e.scrollTo({top:0,left:0,behavior:"smooth"})});const O={stateInfo:b,userDetails:y,CITIZEN:C,cityDetails:E,mobileView:g<=640,handleUserDropdownSelection:e=>{e.func()},logoUrl:d,DSO:S,stateCode:s,modules:c,appTenants:u,sourceUrl:window.location.origin+"/citizen",pathname:f,initData:m};return r.createElement(i.Switch,null,r.createElement(i.Route,{path:`/${null===(o=window)||void 0===o?void 0:o.contextPath}/employee`},r.createElement(Vn,O)),r.createElement(i.Route,{path:`/${null===(l=window)||void 0===l?void 0:l.contextPath}/citizen`},r.createElement(Nt,O)),r.createElement(i.Route,null,r.createElement(i.Redirect,{to:`/${null===(a=window)||void 0===a?void 0:a.contextPath}/${p}`})))},zn=e=>{var t,n,o,l,a,s,c,u,d;let{stateCode:m,modules:p,appTenants:v,logoUrl:f,initData:g,defaultLanding:E="citizen"}=e;const{data:y}=Digit.Hooks.useStore.getInitData(),{stateInfo:h}=y||{},b=["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)}),S=Digit.UserService.getUser();let C="CITIZEN"===(null==S||null===(t=S.info)||void 0===t?void 0:t.type)||!window.location.pathname.split("/").includes("employee");const O=window.innerWidth<=640;return r.createElement("div",{className:b?"grounded-container":"loginContainer",style:b?{padding:0,paddingTop:C?"0":O&&!C?"3rem":"80px",marginLeft:C||O?"0":"40px"}:{"--banner-url":`url(${null==h?void 0:h.bannerUrl})`,padding:"0px"}},r.createElement(i.Switch,null,r.createElement(i.Route,{exact:!0,path:`/${null===(n=window)||void 0===n?void 0:n.globalPath}/user/invalid-url`},r.createElement(Hn,null)),r.createElement(i.Route,{exact:!0,path:`/${null===(o=window)||void 0===o?void 0:o.globalPath}/user/sign-up`},r.createElement(Un,{stateCode:m})),r.createElement(i.Route,{exact:!0,path:`/${null===(l=window)||void 0===l?void 0:l.globalPath}/user/otp`},r.createElement(Bn,null)),r.createElement(i.Route,{exact:!0,path:`/${null===(a=window)||void 0===a?void 0:a.globalPath}/user/url`},r.createElement(jn,null)),(null===(s=window)||void 0===s?void 0:s.globalPath)!==(null===(c=window)||void 0===c?void 0:c.contextPath)&&r.createElement(i.Route,{path:"/"+(null===(u=window)||void 0===u?void 0:u.contextPath)},r.createElement($n,{stateCode:m,modules:p,appTenants:v,logoUrl:f,initData:g,defaultLanding:E})),r.createElement(i.Route,null,r.createElement(i.Redirect,{to:`/${null===(d=window)||void 0===d?void 0:d.globalPath}/user/sign-up`}))))},Gn=[u],Wn=("object"==typeof window&&window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__?window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__({}):c.compose)(c.applyMiddleware(...Gn)),qn=e=>{let{onSelect:l,...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(()=>{l("check",c)},[c]),r.createElement(r.Fragment,null,r.createElement("div",{className:"digit-privacy-checkbox"},r.createElement(t.CheckBox,{label:i("ES_BY_CLICKING"),checked:c,onChange:e=>{u(e.target.checked)}}),r.createElement(t.Button,{label:i("ES_PRIVACY_POLICY"),variation:"link",size:"medium",onClick:()=>{m(!0)},style:{marginBottom:"1.18rem",paddingLeft:"0.2rem"}})),d&&r.createElement(t.PopUp,{type:"default",className:"privacy-popUpClass",footerclassName:"popUpFooter",heading:i(null==p?void 0:p.header),onOverlayClick:()=>{m(!1)},footerChildren:[r.createElement(t.Button,{type:"button",size:"large",variation:"secondary",label:i("DIGIT_I_DO_NOT_ACCEPT"),onClick:()=>{u(!1),m(!1)}}),r.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)}},r.createElement("div",null,r.createElement("div",{className:"privacy-table"},i("DIGIT_TABLE_OF_CONTENTS")),r.createElement("ul",null,null==p?void 0:p.contents.map((e,n)=>r.createElement("li",{key:n,style:{display:"flex",alignItems:"center"}},r.createElement("span",{style:{marginRight:"0.5rem"}},n+1,". "),r.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)=>r.createElement("div",{key:t,id:null==e?void 0:e.header},r.createElement("div",{style:{fontWeight:"bold",paddingLeft:null!=e&&e.isSpaceRequired?"1rem":"0"}},i(e.header)),e.descriptions.map((e,t)=>r.createElement("div",{key:t,style:{paddingLeft:e.isSpaceRequired?"1rem":"0",marginBottom:"0.5rem"}},r.createElement("div",{style:{fontWeight:null!=e&&e.isBold?700:400,display:"flex",alignItems:"center"}},"points"===e.type&&r.createElement("span",{style:{marginRight:"0.5rem",listStyleType:"disc"}},"•"),"step"===e.type&&r.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&&r.createElement("div",{className:"policy-subdescription"},e.subDescriptions.map((e,t)=>r.createElement("div",{key:t,className:"policy-subdescription-points"},"points"===e.type&&r.createElement("span",{style:{marginRight:"0.5rem",listStyleType:"disc",paddingLeft:"1rem"}},"•"),"step"===e.type&&r.createElement("span",{style:{marginRight:"0.5rem",listStyleType:"decimal",paddingLeft:"1rem"}},t+1,". "),null===e.type&&r.createElement("span",{style:{marginRight:"0.5rem",paddingLeft:"1rem"}}," "),i(e.text))))))))))},Xn=e=>{var n,l;let{stateCode:s,enabledModules:u,moduleReducers:d,defaultLanding:m}=e;const{isLoading:p,data:v={}}=Digit.Hooks.useInitStore(s,u);if(p)return r.createElement(t.Loader,{page:!0});const f=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),Wn)}(v,d(v))||{};return o.getI18n(),Digit.ComponentRegistryService.getComponent("PrivacyComponent")||Digit.ComponentRegistryService.setComponent("PrivacyComponent",qn),r.createElement(a.Provider,{store:f},r.createElement(i.BrowserRouter,null,r.createElement(t.BodyContainer,null,Digit.Utils.getMultiRootTenant()?r.createElement(zn,{initData:v,stateCode:s,modules:null==v?void 0:v.modules,appTenants:v.tenants,logoUrl:null==v||null===(n=v.stateInfo)||void 0===n?void 0:n.logoUrl,defaultLanding:m}):r.createElement($n,{initData:v,stateCode:s,modules:null==v?void 0:v.modules,appTenants:v.tenants,logoUrl:null==v||null===(l=v.stateInfo)||void 0===l?void 0:l.logoUrl,defaultLanding:m}))))},Zn={SelectOtp:le,ChangeCity:_,ChangeLanguage:I,PrivacyComponent:qn,OtpComponent:e=>{var l,a;let{onSelect:c,...u}=e;const{t:d}=o.useTranslation(),[m,p]=(i.useLocation(),n.useState(null)),[v,f]=n.useState({}),[g,E]=n.useState(!0),[y,h]=n.useState(30),b=()=>{p(null)};oe(()=>{h(y-1)},y>0?1e3:null),n.useEffect(()=>{c("OtpComponent",v)},[v]);const S={url:"/user-otp/v1/_send",params:{tenantId:null==u||null===(l=u.props)||void 0===l?void 0:l.code},body:{},config:{enable:!1}},C=Digit.Hooks.useCustomAPIMutationHook(S);return r.createElement(n.Fragment,null,r.createElement(t.CardLabel,{className:"sandbox-custom-otp-header"},d("CS_OTP_EMAIL")),r.createElement(t.CardLabel,{className:"sandbox-custom-otp-email"},null==u||null===(a=u.props)||void 0===a?void 0:a.email),r.createElement(t.CardLabel,{className:"sandbox-custom-otp-subheader"},d("SANDBOX_ENTER_OTP")),r.createElement(s.OTPInput,{className:"sandbox-otp-input",length:6,onChange:e=>{f({...v,otp:e})},value:null==v?void 0:v.otp}),y>0?r.createElement(t.CardText,{className:"sandbox-resend-otp"},`${d("CS_RESEND_ANOTHER_OTP")} ${y} ${d("CS_RESEND_SECONDS")}`):r.createElement("p",{className:"card-text-button sandbox-otp-input",onClick:function(){try{var e,t;return h(30),Promise.resolve(C.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,r,o,l,a,i,s;p({key:"error",label:null!=e&&null!==(n=e.response)&&void 0!==n&&null!==(r=n.data)&&void 0!==r&&null!==(o=r.Errors)&&void 0!==o&&o[0].code?"SANDBOX_RESEND_OTP"+(null==e||null===(l=e.response)||void 0===l||null===(a=l.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(b,5e3)},onSuccess:function(e){try{return p({key:"info",label:d("OTP_RESNED_SUCCESFULL")}),setTimeout(b,5e3),Promise.resolve()}catch(e){return Promise.reject(e)}}})).then(function(){})}catch(e){return Promise.reject(e)}}},d("CS_RESEND_OTP")),!g&&r.createElement(t.CardLabelError,null,d("CS_INVALID_OTP")),m&&r.createElement(t.Toast,{type:null==m?void 0:m.key,label:d(null==m?void 0:m.label),onClose:b}))}};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 l.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"]),r.createElement("div",null,r.createElement(f,null,r.createElement(l.QueryClientProvider,{client:d},r.createElement(m.Provider,{value:o},r.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)||{})}}},r.createElement(Xn,{stateCode:t,enabledModules:a,moduleReducers:i,defaultLanding:s}))))))},exports.initCoreComponents=()=>{Object.entries(Zn).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.19",
4
4
  "license": "MIT",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.modern.js",
@@ -14,8 +14,8 @@
14
14
  "prepublish": "yarn build"
15
15
  },
16
16
  "dependencies": {
17
- "@egovernments/digit-ui-components": "0.0.2-beta.31",
18
- "@egovernments/digit-ui-react-components": "1.8.2-beta.12",
17
+ "@egovernments/digit-ui-components": "0.0.2-beta.43",
18
+ "@egovernments/digit-ui-react-components": "1.8.2-beta.13",
19
19
  "react": "17.0.2",
20
20
  "react-dom": "17.0.2",
21
21
  "react-i18next": "11.16.2",