@egovernments/digit-ui-module-core 1.8.2-beta.16 → 1.8.2-beta.18
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +3 -0
- package/dist/index.js +1 -1
- package/package.json +2 -2
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"),r=e(n),o=require("react-i18next"),i=require("react-query"),l=require("react-redux"),a=require("react-router-dom"),u=require("@egovernments/digit-ui-react-components"),s=e(require("react-tooltip")),c=require("redux"),d=e(require("redux-thunk"));const f={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=f[t],{t:i}=o.useTranslation();return r.createElement("div",{className:"error-boundary"},r.createElement("div",{className:"error-container"},r.createElement("img",{src:n.imgUrl,alt:"error"}),r.createElement("h1",null,i(n.infoMessage)),r.createElement("button",{onClick:()=>{e.goToHome()}},i(n.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 p extends r.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?r.createElement("div",{className:"error-boundary"},r.createElement(v,null),r.createElement(m,{initData:this.props.initData})):this.props.children}}const g=(e,t,n)=>{const r=null==e?void 0:e[""+t];r&&r.map(e=>{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 i;return"FSM"===t&&[{role:"FSM_DSO",from:`/${null===(i=window)||void 0===i?void 0:i.contextPath}/citizen/fsm/dso-dashboard`,dashoardLink:"CS_LINK_DSO_DASHBOARD",loginLink:"CS_LINK_LOGIN_DSO"}].map(e=>{var t,r,i;let{role:l,from:a,loginLink:u,dashoardLink:s}=e;Digit.UserService.hasAccess(l)?null==o||null===(t=o.links)||void 0===t||t.push({link:a,i18nKey:n(s)}):null==o||null===(r=o.links)||void 0===r||r.push({link:`/${null===(i=window)||void 0===i?void 0:i.contextPath}/citizen/login`,state:{role:"FSM_DSO",from:a},i18nKey:n(u)})}),o},h=e=>{let{modules:n,getCitizenMenu:i,fetchedCitizen:l,isLoading:a}=e;const u=[n.filter(e=>{let{code:t}=e;return"Payment"===t})[0],...n.filter(e=>{let{code:t}=e;return"Payment"!==t})],{t:s}=o.useTranslation();return a?r.createElement(t.Loader,null):r.createElement(r.Fragment,null,r.createElement("div",{className:"citizen-all-services-wrapper"},location.pathname.includes("sanitation-ui/citizen/all-services")?null:r.createElement(t.BackButton,null),r.createElement("div",{className:"citizenAllServiceGrid"},u.filter(e=>e).map((e,n)=>{var o,a;let u,{code:c}=e;var d,f,m,v;return l&&(u=l?g(i,c,s):void 0),(null===(o=u)||void 0===o||null===(a=o.links)||void 0===a?void 0:a.length)>0?r.createElement(t.CitizenHomeCard,{header:s(null===(d=u)||void 0===d?void 0:d.header),links:null===(f=u)||void 0===f||null===(m=f.links)||void 0===m||null===(v=m.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 r.createElement(PTIcon,{className:"fill-path-primary-main"});case"WS":return r.createElement(WSICon,{className:"fill-path-primary-main"});case"FSM":return r.createElement(t.FSMIcon,{className:"fill-path-primary-main"});case"MCollect":return r.createElement(t.MCollectIcon,{className:"fill-path-primary-main"});case"PGR":return r.createElement(PGRIcon,{className:"fill-path-primary-main"});case"TL":return r.createElement(TLIcon,{className:"fill-path-primary-main"});case"OBPS":return r.createElement(OBPSIcon,{className:"fill-path-primary-main"});case"Bills":return r.createElement(t.BillsIcon,{className:"fill-path-primary-main"});default:return r.createElement(PTIcon,{className:"fill-path-primary-main"})}})(c),Info:"OBPS"===c?()=>r.createElement(t.CitizenInfoLabel,{style:{margin:"0px",padding:"10px"},info:s("CS_FILE_APPLICATION_INFO_LABEL"),text:s("BPA_CITIZEN_HOME_STAKEHOLDER_INCLUDES_INFO_LABEL")}):null,isInfo:"OBPS"===c}):r.createElement(r.Fragment,null)}))))},E=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"},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}))},y=e=>{let{userType:t,modules:n,getCitizenMenu:o,fetchedCitizen:i,isLoading:l,additionalComponent:a}=e;return"citizen"===t?r.createElement(h,{modules:n,getCitizenMenu:o,fetchedCitizen:i,isLoading:l}):r.createElement(E,{modules:n,additionalComponent:a})},_=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},b=e=>{var o;const[i,l]=n.useState(null),[u,s]=n.useState([]),[c,d]=n.useState([]),f=a.useHistory();let m=[];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 i=r.filter((e,t,n)=>n.indexOf(e)===t);null==i||i.forEach(e=>{var t;o.push({label:"TENANT_TENANTS_"+(null===(t=_(e,".","_"))||void 0===t?void 0:t.toUpperCase()),value:e})}),m=null==o?void 0:o.filter(e=>e.value==Digit.SessionStorage.get("Employee.tenantId")),s(o)},[i]),r.createElement("div",{style:null!=e&&e.mobileView?{color:"#767676"}:{}},r.createElement(t.Dropdown,{t:null==e?void 0:e.t,option:u,selected:u.find(e=>e.value===(null==i?void 0:i.value)),optionKey:"label",select:e=>{var t,n,r,o;const i=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&&(i.info.roles=a,i.info.tenantId=null==e?void 0:e.value),Digit.SessionStorage.set("Employee.tenantId",null==e?void 0:e.value),Digit.UserService.setUser(i),l(e),window.location.href.includes(`/${null===(o=window)||void 0===o?void 0:o.contextPath}/employee/`)){var u,s;const e=(null===(u=location.state)||void 0===u?void 0:u.from)||`/${null===(s=window)||void 0===s?void 0:s.contextPath}/employee`;f.replace(e)}window.location.reload()},freeze:!0,customSelector:r.createElement("label",{className:"cp"},null==e?void 0:e.t("TENANT_TENANTS_"+(null===(o=_(Digit.SessionStorage.get("Employee.tenantId"),".","_"))||void 0===o?void 0:o.toUpperCase())))}))},C=e=>{const o=e.dropdown||!1,{data:i,isLoading:l}=Digit.Hooks.useStore.getInitData(),{languages:a,stateInfo:u}=i||{},s=Digit.StoreData.getCurrentLanguage(),[c,d]=n.useState(s),f=e=>{d(e.value),Digit.LocalizationService.changeLanguage(e.value,u.code)};return l?null:o?r.createElement("div",null,r.createElement(t.Dropdown,{className:"language-dropdown",option:a,selected:null==a?void 0:a.find(e=>(null==e?void 0:e.value)===s),optionKey:"label",select:f,freeze:!0,customSelector:r.createElement("label",{className:"cp"},null==a||null===(m=a.find(e=>(null==e?void 0:e.value)===c))||void 0===m?void 0:m.label)})):r.createElement(r.Fragment,null,r.createElement("div",{style:{marginBottom:"5px"}},"Language"),r.createElement("div",{className:"language-selector"},a.map((e,n)=>r.createElement("div",{className:"language-button-container",key:n},r.createElement(t.Button,{label:e.label,onClick:()=>f(e),variation:e.value===c?"primary":""})))));var m},O=e=>{var t,n;return r.createElement("span",{className:"user-img-txt",onClick:e.toggleMenu,title:e.name},null==e||null===(t=e.name)||void 0===t||null===(n=t[0])||void 0===n?void 0:n.toUpperCase())},S=e=>{var n,o,i,l,s,c,d,f;let{t:m,stateInfo:v,toggleSidebar:p,isSidebarOpen:g,handleLogout:h,userDetails:E,CITIZEN:y,cityDetails:_,mobileView:S,userOptions:w,handleUserDropdownSelection:N,logoUrl:I,showLanguageChange:D=!0}=e;const[T,R]=r.useState(null);r.useEffect(function(){try{var e;const t=Digit.ULBService.getCurrentTenantId(),n=null==E||null===(e=E.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==E||null===(n=E.info)||void 0===n?void 0:n.uuid]);const L=Digit.ULBService.getCitizenCurrentTenant(!0);let A=a.useHistory();const{pathname:x}=a.useLocation(),{data:{unreadCount:P}={},isSuccess:M}=Digit.Hooks.useNotificationCount({tenantId:L,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)&&!!L}});var k,U,B,j,F,V;if(y)return r.createElement("div",null,r.createElement(u.TopBar,{img:null==v?void 0:v.logoUrlWhite,isMobile:!0,toggleSidebar:()=>{Digit.clikOusideFired?Digit.clikOusideFired=!1:p(!0)},logoUrl:null==v?void 0:v.logoUrlWhite,onLogout:h,userDetails:E,notificationCount:P<99?P:99,notificationCountLoaded:M,cityOfCitizenShownBesideLogo:m(L),onNotificationIconClick:function(){var e;A.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:S?null:r.createElement(C,{dropdown:!0})}));const z=!(null==E||!E.access_token),H=null===(o=Digit.ComponentRegistryService)||void 0===o?void 0:o.getComponent("CustomEmployeeTopBar");return H?r.createElement(H,{t:m,stateInfo:v,toggleSidebar:p,isSidebarOpen:g,handleLogout:h,userDetails:E,CITIZEN:y,cityDetails:_,mobileView:S,userOptions:w,handleUserDropdownSelection:N,logoUrl:I,showLanguageChange:D,loggedin:z}):r.createElement("div",{className:"topbar"},r.createElement("div",{className:"digit-hamburger-class"},r.createElement(u.Hamburger,{handleClick:p,color:"#9E9E9E"})),r.createElement("img",{className:"city",src:z?null==_?void 0:_.logoId:null==v?void 0:v.statelogo}),r.createElement("span",{className:"digit-topbar-container"},z&&(null!=_&&null!==(i=_.city)&&void 0!==i&&i.ulbGrade?r.createElement("p",{className:"ulb"},m(null==_?void 0:_.i18nKey).toUpperCase()," ",m("ULBGRADE_"+(null==_||null===(l=_.city)||void 0===l?void 0:l.ulbGrade.toUpperCase().replace(" ","_").replace(".","_"))).toUpperCase()):r.createElement("img",{className:"state",src:I})),!z&&r.createElement("p",{className:"ulb"},m(`MYCITY_${null==v||null===(s=v.code)||void 0===s?void 0:s.toUpperCase()}_LABEL`)," ",m("MYCITY_STATECODE_LABEL")),r.createElement("div",{className:S?"right":"flex-right right w-80 column-gap-15",style:z?{}:{width:"80%"}},r.createElement("div",{className:"left"},!window.location.href.includes("employee/user/login")&&!window.location.href.includes("employee/user/language-selection")&&r.createElement(b,{dropdown:!0,t:m})),r.createElement("div",{className:"left"},D&&r.createElement(C,{dropdown:!0})),(null==E?void 0:E.access_token)&&r.createElement("div",{className:"left"},r.createElement(t.Dropdown,{option:w,optionKey:"name",select:N,showArrow:!0,freeze:!0,style:{},optionCardStyles:{overflow:"revert",display:"table"},topbarOptionsClassName:"topbarOptionsClassName",customSelector:null==T?r.createElement(O,{name:(null==E||null===(c=E.info)||void 0===c?void 0:c.name)||(null==E||null===(d=E.info)||void 0===d||null===(f=d.userInfo)||void 0===f?void 0:f.name)||"Employee"}):r.createElement("img",{src:T,style:{height:"48px",width:"48px",borderRadius:"50%"}}),showIcon:!0})),r.createElement("img",{className:"state",src:I}))))},w=(e,n,o,i)=>{var l,a;return[{type:"link",element:"HOME",text:e("COMMON_BOTTOM_NAVIGATION_HOME"),link:i?`/${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:n}},{type:"component",element:"LANGUAGE",action:r.createElement(C,null),icon:"LanguageIcon"},{id:"login-btn",element:"LOGIN",text:e("CORE_COMMON_LOGIN"),icon:r.createElement(t.LogoutIcon,{className:"icon"}),populators:{onClick:o}}]},N="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";function I(){return(I=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 D=e=>{let{onSelect:n,onCancel:i,onDismiss:l,PopupStyles:a,isDisabled:u,hideSubmit:s}=e;const{t:c}=o.useTranslation(),d=[r.createElement("div",null,r.createElement(t.CardText,null,c("CORE_LOGOUT_WEB_CONFIRMATION_MESSAGE")+" ",r.createElement("strong",null,c("CORE_LOGOUT_MESSAGE"))))],f=[r.createElement(t.Button,{type:"button",size:"large",variation:"digit-action-cancel",label:c("CORE_LOGOUT_CANCEL"),className:"logout-cancel-button",onClick:i}),r.createElement(t.Button,{type:"button",size:"large",variation:"primary",label:c("CORE_LOGOUT_WEB_YES"),formId:"modal-action",onClick:n,isDisabled:u})],m=[r.createElement(t.Button,{type:"button",size:"large",variation:"digit-action-cancel",label:c("CORE_LOGOUT_CANCEL"),className:"logout-cancel-button",onClick:i})];return r.createElement(t.PopUp,{type:"default",children:d,heading:c("CORE_LOGOUT_WEB_HEADER"),footerChildren:s?m:f,sortFooterButtons:!0,onClose:l,className:"digit-logout-popup-wrapper",onOverlayClick:l,style:a})},T=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:N})),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(b,{t:n,mobileView:!0}))},R={CommonPTIcon:r.createElement(t.PTIcon,{className:"icon"}),OBPSIcon:r.createElement(t.OBPSIcon,{className:"icon"}),propertyIcon:r.createElement(t.PropertyHouse,{className:"icon"}),TLIcon:r.createElement(t.CaseIcon,{className:"icon"}),PGRIcon:r.createElement(t.PGRIcon,{className:"icon"}),FSMIcon:r.createElement(t.FSMIcon,{className:"icon"}),WSIcon:r.createElement(t.WSICon,{className:"icon"}),MCollectIcon:r.createElement(t.MCollectIcon,{className:"icon"}),BillsIcon:r.createElement(t.CollectionIcon,{className:"icon"}),BirthIcon:r.createElement(t.BirthIcon,{className:"icon"}),DeathIcon:r.createElement(t.DeathIcon,{className:"icon"}),FirenocIcon:r.createElement(t.FirenocIcon,{className:"icon"}),HomeIcon:r.createElement(t.HomeIcon,{className:"icon"}),EditPencilIcon:r.createElement(t.EditPencilIcon,{className:"icon"}),LogoutIcon:r.createElement(t.LogoutIcon,{className:"icon"}),Phone:r.createElement(t.Phone,{className:"icon"})},L=e=>{var i,l,u;let{linkData:s,islinkDataLoading:c}=e;const{t:d}=o.useTranslation(),f=a.useHistory(),m=a.useLocation(),{pathname:v}=m,{data:p,isFetched:g}=Digit.Hooks.useStore.getInitData(),{stateInfo:h}=p||{},E=Digit.UserService.getUser();let y=window.Digit.Utils.browser.isMobile();const[_,b]=n.useState(!1),[C,O]=n.useState(!1),[S,N]=n.useState(!1),L=()=>{N(!1)};if(c)return r.createElement(t.Loader,null);const A=()=>{var e;f.push(`/${null===(e=window)||void 0===e?void 0:e.contextPath}/citizen/user/profile`)};let x=[...w(d,A,()=>{var e;f.push(`/${null===(e=window)||void 0===e?void 0:e.contextPath}/citizen/login`)},_)];x=x.filter(e=>"LANGUAGE"!==e.element),Digit.ULBService.getCurrentTenantId();const P=e=>{var t,n;let{item:o}=e;const i=(null==o?void 0:o.icon)||(null===(t=o.icon)||void 0===t||null===(n=t.type)||void 0===n?void 0:n.name),l=i?R[i]:R.BillsIcon;let u;u="component"===o.type?o.action:o.text;const s=()=>r.createElement("span",I({className:"menu-item"},o.populators),l,r.createElement("div",{className:"menu-label"},u));return"external-link"===o.type?r.createElement("a",{href:o.link},r.createElement(s,null)):"link"===o.type?r.createElement(a.Link,{to:null==o?void 0:o.link},r.createElement(s,null)):r.createElement(s,null)};let M;return g&&E&&E.access_token&&(M=r.createElement(T,{info:null==E?void 0:E.info,stateName:null==h?void 0:h.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:A}},{text:d("CORE_COMMON_LOGOUT"),element:"LOGOUT",icon:"LogoutIcon",populators:{onClick:()=>{O(!1),N(!0)}}},{text:r.createElement(r.Fragment,null,d("CS_COMMON_HELPLINE"),r.createElement("div",{className:"telephone",style:{marginTop:"-10%"}},null==p?void 0:p.tenants.map(e=>{}),r.createElement("div",{className:"link"},r.createElement("a",{href:"tel:"+(null==p?void 0:p.tenants[0].contactNumber)},null==p?void 0:p.tenants[0].contactNumber)))),element:"Helpline",icon:"Phone"}]),null===(i=Object.keys(s))||void 0===i||null===(l=i.sort((e,t)=>t.localeCompare(e)))||void 0===l||l.map(e=>{var t,n,r,o,i,l;(null===(t=s[e][0])||void 0===t?void 0:t.sidebar)===window.contextPath+"-links"&&x.splice(1,0,{type:null!==(n=s[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:s[e],icon:null===(i=s[e][0])||void 0===i?void 0:i.leftIcon,link:null===(l=s[e][0])||void 0===l?void 0:l.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:y?"calc(100vh - 56px)":"auto",zIndex:"99"}},M,r.createElement("div",{className:"drawer-desktop"},null===(u=x)||void 0===u?void 0:u.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(P,{item:e}))))),r.createElement("div",null,S&&r.createElement(D,{onSelect:()=>{Digit.UserService.logout(),N(!1)},onCancel:L,onDismiss:L}))))},A=e=>{var t;let{info:n,t:o}=e;const[i,l]=r.useState(null);r.useEffect(function(){try{const e=Digit.ULBService.getCurrentTenantId(),t=null==n?void 0:n.uuid,r=function(){if(t)return Promise.resolve(Digit.UserService.userSearch(e,{uuid:[t]},{})).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(",");l(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!==i]);const a=null===(t=Digit.ComponentRegistryService)||void 0===t?void 0:t.getComponent("CustomEmployeeTopBar");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:i||N,style:{objectFit:"cover",objectPosition:"center"}})),r.createElement("div",{id:"profile-name",className:"label-container name-Profile"},r.createElement("div",{className:"label-text"}," ",null==n?void 0:n.name," ")),r.createElement("div",{id:"profile-location",className:"label-container loc-Profile"},r.createElement("div",{className:"label-text"}," ",null==n?void 0:n.mobileNumber," ")),(null==n?void 0:n.emailId)&&r.createElement("div",{id:"profile-emailid",className:"label-container loc-Profile"},r.createElement("div",{className:"label-text"}," ",n.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")&&!a&&r.createElement(b,{t:o,mobileView:!0}))},x=()=>{var e,t,n;return r.createElement("div",{className:"digit-footer",style:{marginBottom:0}},r.createElement("img",{alt:"Powered by DIGIT",src:null===(e=window)||void 0===e||null===(t=e.globalConfigs)||void 0===t||null===(n=t.getConfig)||void 0===n?void 0:n.call(t,"DIGIT_FOOTER"),style:{cursor:"pointer"},onClick:()=>{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()}})," ")},P=e=>{let{isOpen:i,isMobile:l=!1,toggleSidebar:s,onLogout:c,isEmployee:d=!1,linkData:f,islinkDataLoading:m}=e;const{data:v,isFetched:p}=Digit.Hooks.useStore.getInitData(),{stateInfo:g}=v||{},h=Digit.UserService.getUser(),[E,y]=n.useState(""),{t:_}=o.useTranslation(),b=a.useHistory(),C=()=>{Digit.clikOusideFired=!0,s(!1)},{isLoading:O,data:S}=Digit.Hooks.useAccessControl(),N=(Digit.ULBService.getCurrentTenantId(),()=>{var e,t;const n=d?`/${null===(e=window)||void 0===e?void 0:e.contextPath}/employee/user/profile`:`/${null===(t=window)||void 0===t?void 0:t.contextPath}/citizen/user/profile`;b.push(n),C()});if(m||O)return r.createElement(t.Loader,null);let I,D=[...w(_,C,()=>{var e;b.push(`/${null===(e=window)||void 0===e?void 0:e.contextPath}/citizen/login`),C()},d)];p&&h&&h.access_token&&(I=r.createElement(A,{info:null==h?void 0:h.info,stateName:null==g?void 0:g.name,t:_}),D=D.filter(e=>"login-btn"!==(null==e?void 0:e.id)),D=[...D,{text:_("EDIT_PROFILE"),element:"PROFILE",icon:"EditPencilIcon",populators:{onClick:N}},{text:_("CORE_COMMON_LOGOUT"),element:"LOGOUT",icon:"LogoutIcon",populators:{onClick:c}},{text:r.createElement(r.Fragment,null,_("CS_COMMON_HELPLINE"),r.createElement("div",{className:"telephone",style:{marginTop:"-10%"}},null==v?void 0:v.tenants.map(e=>{}),r.createElement("div",{className:"link"},r.createElement("a",{href:"tel:"+(null==v?void 0:v.tenants[0].contactNumber)},null==v?void 0:v.tenants[0].contactNumber)))),element:"Helpline",icon:"Phone"}]);let T={};if(d){var R;null==S||S.actions.filter(e=>"url"===e.url&&"Home"!==e.displayName).forEach(e=>{var t;if(""==E&&""!==e.path){let t=e.path.split(".")[0];"TradeLicense"===t&&(t="Trade License"),T[t]?T[t].push(e):T[t]=[e]}else if(""!==e.path&&null!=e&&null!==(t=e.displayName)&&void 0!==t&&t.toLowerCase().includes(E.toLowerCase())){let t=e.path.split(".")[0];"TradeLicense"===t&&(t="Trade License"),T[t]?T[t].push(e):T[t]=[e]}});const e=Object.keys(T);for(let t=0;t<e.length;t++){var P,M,k,U,B;const n=null===(P=T[e[t]][0])||void 0===P||null===(M=P.displayName)||void 0===M||null===(k=M.toUpperCase())||void 0===k?void 0:k.replace(/[ -]/g,"_"),r=null===(U=e[t])||void 0===U||null===(B=U.toUpperCase())||void 0===B?void 0:B.replace(/[ -]/g,"_");var j,F,V,z,H,W,$;-1===T[e[t]][0].path.indexOf(".")?D.splice(1,0,{type:"link",text:_("ACTION_TEST_"+n),link:null===(j=T[e[t]][0])||void 0===j?void 0:j.navigationURL,icon:null===(F=T[e[t]][0])||void 0===F||null===(V=F.leftIcon)||void 0===V||null===(z=(H=V).split)||void 0===z?void 0:z.call(H,":")[1],populators:{onClick:()=>{var n;b.push(null===(n=T[e[t]][0])||void 0===n?void 0:n.navigationURL),C()}}}):D.splice(1,0,{type:"dynamic",moduleName:_("ACTION_TEST_"+r),links:null===(W=T[e[t]])||void 0===W?void 0:W.map(e=>{var t,n;return{...e,displayName:_("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===($=T[e[t]][1])||void 0===$?void 0:$.leftIcon})}const t=D.findIndex(e=>"HOME"===e.element),n=D.splice(t,1),r=D.findIndex(e=>"LANGUAGE"===e.element),o=D.splice(r,(null===(R=D)||void 0===R?void 0:R.length)-r);D.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])&&D.splice(0,0,n[0]),D=(null==o?void 0:o.length)>0?D.concat(o):D}else{var G,q;null===(G=Object.keys(f))||void 0===G||null===(q=G.sort((e,t)=>t.localeCompare(e)))||void 0===q||q.map(e=>{var t,n,r,o,i,l;"digit-ui-links"===(null===(t=f[e][0])||void 0===t?void 0:t.sidebar)&&D.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:_("ACTION_TEST_"+Digit.Utils.locale.getTransformedLocale(e)),links:f[e],icon:null===(i=f[e][0])||void 0===i?void 0:i.leftIcon,link:null===(l=f[e][0])||void 0===l?void 0:l.sidebarURL})})}return b.location.pathname.includes("/openlink")&&(I=r.createElement("span",null),D=D.filter(e=>"LANGUAGE"===e.element)),l?r.createElement(u.NavBar,{open:i,toggleSidebar:s,profileItem:I,onClose:C,menuItems:D,Footer:r.createElement(x,null),isEmployee:d,search:E,setSearch:y}):r.createElement(L,{logout:c})};var M="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function k(e,t){return e(t={exports:{}},t.exports),t.exports}k(function(e,t){(function(){var n="Expected a function",r="__lodash_placeholder__",o=[["ary",128],["bind",1],["bindKey",2],["curry",8],["curryRight",16],["flip",512],["partial",32],["partialRight",64],["rearg",256]],i="[object Arguments]",l="[object Array]",a="[object Boolean]",u="[object Date]",s="[object Error]",c="[object Function]",d="[object GeneratorFunction]",f="[object Map]",m="[object Number]",v="[object Object]",p="[object RegExp]",g="[object Set]",h="[object String]",E="[object Symbol]",y="[object WeakMap]",_="[object ArrayBuffer]",b="[object DataView]",C="[object Float32Array]",O="[object Float64Array]",S="[object Int8Array]",w="[object Int16Array]",N="[object Int32Array]",I="[object Uint8Array]",D="[object Uint16Array]",T="[object Uint32Array]",R=/\b__p \+= '';/g,L=/\b(__p \+=) '' \+/g,A=/(__e\(.*?\)|\b__t\)) \+\n'';/g,x=/&(?:amp|lt|gt|quot|#39);/g,P=/[&<>"']/g,k=RegExp(x.source),U=RegExp(P.source),B=/<%-([\s\S]+?)%>/g,j=/<%([\s\S]+?)%>/g,F=/<%=([\s\S]+?)%>/g,V=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,z=/^\w*$/,H=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,W=/[\\^$.*+?()[\]{}|]/g,$=RegExp(W.source),G=/^\s+/,q=/\s/,Z=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,X=/\{\n\/\* \[wrapped with (.+)\] \*/,Y=/,? & /,K=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,J=/[()=,{}\[\]\/\s]/,Q=/\\(\\)?/g,ee=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,te=/\w*$/,ne=/^[-+]0x[0-9a-f]+$/i,re=/^0b[01]+$/i,oe=/^\[object .+?Constructor\]$/,ie=/^0o[0-7]+$/i,le=/^(?:0|[1-9]\d*)$/,ae=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,ue=/($^)/,se=/['\n\r\u2028\u2029\\]/g,ce="\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff",de="\\xac\\xb1\\xd7\\xf7\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf\\u2000-\\u206f \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",fe="["+de+"]",me="["+ce+"]",ve="\\d+",pe="[a-z\\xdf-\\xf6\\xf8-\\xff]",ge="[^\\ud800-\\udfff"+de+ve+"\\u2700-\\u27bfa-z\\xdf-\\xf6\\xf8-\\xffA-Z\\xc0-\\xd6\\xd8-\\xde]",he="\\ud83c[\\udffb-\\udfff]",Ee="[^\\ud800-\\udfff]",ye="(?:\\ud83c[\\udde6-\\uddff]){2}",_e="[\\ud800-\\udbff][\\udc00-\\udfff]",be="[A-Z\\xc0-\\xd6\\xd8-\\xde]",Ce="(?:"+pe+"|"+ge+")",Oe="(?:"+be+"|"+ge+")",Se="(?:"+me+"|"+he+")?",we="[\\ufe0e\\ufe0f]?"+Se+"(?:\\u200d(?:"+[Ee,ye,_e].join("|")+")[\\ufe0e\\ufe0f]?"+Se+")*",Ne="(?:"+["[\\u2700-\\u27bf]",ye,_e].join("|")+")"+we,Ie="(?:"+[Ee+me+"?",me,ye,_e,"[\\ud800-\\udfff]"].join("|")+")",De=RegExp("['’]","g"),Te=RegExp(me,"g"),Re=RegExp(he+"(?="+he+")|"+Ie+we,"g"),Le=RegExp([be+"?"+pe+"+(?:['’](?:d|ll|m|re|s|t|ve))?(?="+[fe,be,"$"].join("|")+")",Oe+"+(?:['’](?:D|LL|M|RE|S|T|VE))?(?="+[fe,be+Ce,"$"].join("|")+")",be+"?"+Ce+"+(?:['’](?:d|ll|m|re|s|t|ve))?",be+"+(?:['’](?:D|LL|M|RE|S|T|VE))?","\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])","\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",ve,Ne].join("|"),"g"),Ae=RegExp("[\\u200d\\ud800-\\udfff"+ce+"\\ufe0e\\ufe0f]"),xe=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,Pe=["Array","Buffer","DataView","Date","Error","Float32Array","Float64Array","Function","Int8Array","Int16Array","Int32Array","Map","Math","Object","Promise","RegExp","Set","String","Symbol","TypeError","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","WeakMap","_","clearTimeout","isFinite","parseInt","setTimeout"],Me=-1,ke={};ke[C]=ke[O]=ke[S]=ke[w]=ke[N]=ke[I]=ke["[object Uint8ClampedArray]"]=ke[D]=ke[T]=!0,ke[i]=ke[l]=ke[_]=ke[a]=ke[b]=ke[u]=ke[s]=ke[c]=ke[f]=ke[m]=ke[v]=ke[p]=ke[g]=ke[h]=ke[y]=!1;var Ue={};Ue[i]=Ue[l]=Ue[_]=Ue[b]=Ue[a]=Ue[u]=Ue[C]=Ue[O]=Ue[S]=Ue[w]=Ue[N]=Ue[f]=Ue[m]=Ue[v]=Ue[p]=Ue[g]=Ue[h]=Ue[E]=Ue[I]=Ue["[object Uint8ClampedArray]"]=Ue[D]=Ue[T]=!0,Ue[s]=Ue[c]=Ue[y]=!1;var Be={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},je=parseFloat,Fe=parseInt,Ve="object"==typeof M&&M&&M.Object===Object&&M,ze="object"==typeof self&&self&&self.Object===Object&&self,He=Ve||ze||Function("return this")(),We=t&&!t.nodeType&&t,$e=We&&e&&!e.nodeType&&e,Ge=$e&&$e.exports===We,qe=Ge&&Ve.process,Ze=function(){try{return $e&&$e.require&&$e.require("util").types||qe&&qe.binding&&qe.binding("util")}catch(e){}}(),Xe=Ze&&Ze.isArrayBuffer,Ye=Ze&&Ze.isDate,Ke=Ze&&Ze.isMap,Je=Ze&&Ze.isRegExp,Qe=Ze&&Ze.isSet,et=Ze&&Ze.isTypedArray;function tt(e,t,n){switch(n.length){case 0:return e.call(t);case 1:return e.call(t,n[0]);case 2:return e.call(t,n[0],n[1]);case 3:return e.call(t,n[0],n[1],n[2])}return e.apply(t,n)}function nt(e,t,n,r){for(var o=-1,i=null==e?0:e.length;++o<i;){var l=e[o];t(r,l,n(l),e)}return r}function rt(e,t){for(var n=-1,r=null==e?0:e.length;++n<r&&!1!==t(e[n],n,e););return e}function ot(e,t){for(var n=null==e?0:e.length;n--&&!1!==t(e[n],n,e););return e}function it(e,t){for(var n=-1,r=null==e?0:e.length;++n<r;)if(!t(e[n],n,e))return!1;return!0}function lt(e,t){for(var n=-1,r=null==e?0:e.length,o=0,i=[];++n<r;){var l=e[n];t(l,n,e)&&(i[o++]=l)}return i}function at(e,t){return!(null==e||!e.length)&&ht(e,t,0)>-1}function ut(e,t,n){for(var r=-1,o=null==e?0:e.length;++r<o;)if(n(t,e[r]))return!0;return!1}function st(e,t){for(var n=-1,r=null==e?0:e.length,o=Array(r);++n<r;)o[n]=t(e[n],n,e);return o}function ct(e,t){for(var n=-1,r=t.length,o=e.length;++n<r;)e[o+n]=t[n];return e}function dt(e,t,n,r){var o=-1,i=null==e?0:e.length;for(r&&i&&(n=e[++o]);++o<i;)n=t(n,e[o],o,e);return n}function ft(e,t,n,r){var o=null==e?0:e.length;for(r&&o&&(n=e[--o]);o--;)n=t(n,e[o],o,e);return n}function mt(e,t){for(var n=-1,r=null==e?0:e.length;++n<r;)if(t(e[n],n,e))return!0;return!1}var vt=bt("length");function pt(e,t,n){var r;return n(e,function(e,n,o){if(t(e,n,o))return r=n,!1}),r}function gt(e,t,n,r){for(var o=e.length,i=n+(r?1:-1);r?i--:++i<o;)if(t(e[i],i,e))return i;return-1}function ht(e,t,n){return t==t?function(e,t,n){for(var r=n-1,o=e.length;++r<o;)if(e[r]===t)return r;return-1}(e,t,n):gt(e,yt,n)}function Et(e,t,n,r){for(var o=n-1,i=e.length;++o<i;)if(r(e[o],t))return o;return-1}function yt(e){return e!=e}function _t(e,t){var n=null==e?0:e.length;return n?St(e,t)/n:NaN}function bt(e){return function(t){return null==t?void 0:t[e]}}function Ct(e){return function(t){return null==e?void 0:e[t]}}function Ot(e,t,n,r,o){return o(e,function(e,o,i){n=r?(r=!1,e):t(n,e,o,i)}),n}function St(e,t){for(var n,r=-1,o=e.length;++r<o;){var i=t(e[r]);void 0!==i&&(n=void 0===n?i:n+i)}return n}function wt(e,t){for(var n=-1,r=Array(e);++n<e;)r[n]=t(n);return r}function Nt(e){return e?e.slice(0,Wt(e)+1).replace(G,""):e}function It(e){return function(t){return e(t)}}function Dt(e,t){return st(t,function(t){return e[t]})}function Tt(e,t){return e.has(t)}function Rt(e,t){for(var n=-1,r=e.length;++n<r&&ht(t,e[n],0)>-1;);return n}function Lt(e,t){for(var n=e.length;n--&&ht(t,e[n],0)>-1;);return n}function At(e,t){for(var n=e.length,r=0;n--;)e[n]===t&&++r;return r}var xt=Ct({"À":"A","Á":"A","Â":"A","Ã":"A","Ä":"A","Å":"A","à":"a","á":"a","â":"a","ã":"a","ä":"a","å":"a","Ç":"C","ç":"c","Ð":"D","ð":"d","È":"E","É":"E","Ê":"E","Ë":"E","è":"e","é":"e","ê":"e","ë":"e","Ì":"I","Í":"I","Î":"I","Ï":"I","ì":"i","í":"i","î":"i","ï":"i","Ñ":"N","ñ":"n","Ò":"O","Ó":"O","Ô":"O","Õ":"O","Ö":"O","Ø":"O","ò":"o","ó":"o","ô":"o","õ":"o","ö":"o","ø":"o","Ù":"U","Ú":"U","Û":"U","Ü":"U","ù":"u","ú":"u","û":"u","ü":"u","Ý":"Y","ý":"y","ÿ":"y","Æ":"Ae","æ":"ae","Þ":"Th","þ":"th","ß":"ss","Ā":"A","Ă":"A","Ą":"A","ā":"a","ă":"a","ą":"a","Ć":"C","Ĉ":"C","Ċ":"C","Č":"C","ć":"c","ĉ":"c","ċ":"c","č":"c","Ď":"D","Đ":"D","ď":"d","đ":"d","Ē":"E","Ĕ":"E","Ė":"E","Ę":"E","Ě":"E","ē":"e","ĕ":"e","ė":"e","ę":"e","ě":"e","Ĝ":"G","Ğ":"G","Ġ":"G","Ģ":"G","ĝ":"g","ğ":"g","ġ":"g","ģ":"g","Ĥ":"H","Ħ":"H","ĥ":"h","ħ":"h","Ĩ":"I","Ī":"I","Ĭ":"I","Į":"I","İ":"I","ĩ":"i","ī":"i","ĭ":"i","į":"i","ı":"i","Ĵ":"J","ĵ":"j","Ķ":"K","ķ":"k","ĸ":"k","Ĺ":"L","Ļ":"L","Ľ":"L","Ŀ":"L","Ł":"L","ĺ":"l","ļ":"l","ľ":"l","ŀ":"l","ł":"l","Ń":"N","Ņ":"N","Ň":"N","Ŋ":"N","ń":"n","ņ":"n","ň":"n","ŋ":"n","Ō":"O","Ŏ":"O","Ő":"O","ō":"o","ŏ":"o","ő":"o","Ŕ":"R","Ŗ":"R","Ř":"R","ŕ":"r","ŗ":"r","ř":"r","Ś":"S","Ŝ":"S","Ş":"S","Š":"S","ś":"s","ŝ":"s","ş":"s","š":"s","Ţ":"T","Ť":"T","Ŧ":"T","ţ":"t","ť":"t","ŧ":"t","Ũ":"U","Ū":"U","Ŭ":"U","Ů":"U","Ű":"U","Ų":"U","ũ":"u","ū":"u","ŭ":"u","ů":"u","ű":"u","ų":"u","Ŵ":"W","ŵ":"w","Ŷ":"Y","ŷ":"y","Ÿ":"Y","Ź":"Z","Ż":"Z","Ž":"Z","ź":"z","ż":"z","ž":"z","IJ":"IJ","ij":"ij","Œ":"Oe","œ":"oe","ʼn":"'n","ſ":"s"}),Pt=Ct({"&":"&","<":"<",">":">",'"':""","'":"'"});function Mt(e){return"\\"+Be[e]}function kt(e){return Ae.test(e)}function Ut(e){var t=-1,n=Array(e.size);return e.forEach(function(e,r){n[++t]=[r,e]}),n}function Bt(e,t){return function(n){return e(t(n))}}function jt(e,t){for(var n=-1,o=e.length,i=0,l=[];++n<o;){var a=e[n];a!==t&&a!==r||(e[n]=r,l[i++]=n)}return l}function Ft(e){var t=-1,n=Array(e.size);return e.forEach(function(e){n[++t]=e}),n}function Vt(e){var t=-1,n=Array(e.size);return e.forEach(function(e){n[++t]=[e,e]}),n}function zt(e){return kt(e)?function(e){for(var t=Re.lastIndex=0;Re.test(e);)++t;return t}(e):vt(e)}function Ht(e){return kt(e)?function(e){return e.match(Re)||[]}(e):function(e){return e.split("")}(e)}function Wt(e){for(var t=e.length;t--&&q.test(e.charAt(t)););return t}var $t=Ct({"&":"&","<":"<",">":">",""":'"',"'":"'"}),Gt=function e(t){var M,q=(t=null==t?He:Gt.defaults(He.Object(),t,Gt.pick(He,Pe))).Array,ce=t.Date,de=t.Error,fe=t.Function,me=t.Math,ve=t.Object,pe=t.RegExp,ge=t.String,he=t.TypeError,Ee=q.prototype,ye=ve.prototype,_e=t["__core-js_shared__"],be=fe.prototype.toString,Ce=ye.hasOwnProperty,Oe=0,Se=(M=/[^.]+$/.exec(_e&&_e.keys&&_e.keys.IE_PROTO||""))?"Symbol(src)_1."+M:"",we=ye.toString,Ne=be.call(ve),Ie=He._,Re=pe("^"+be.call(Ce).replace(W,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Ae=Ge?t.Buffer:void 0,Be=t.Symbol,Ve=t.Uint8Array,ze=Ae?Ae.allocUnsafe:void 0,We=Bt(ve.getPrototypeOf,ve),$e=ve.create,qe=ye.propertyIsEnumerable,Ze=Ee.splice,vt=Be?Be.isConcatSpreadable:void 0,Ct=Be?Be.iterator:void 0,qt=Be?Be.toStringTag:void 0,Zt=function(){try{var e=Qo(ve,"defineProperty");return e({},"",{}),e}catch(e){}}(),Xt=t.clearTimeout!==He.clearTimeout&&t.clearTimeout,Yt=ce&&ce.now!==He.Date.now&&ce.now,Kt=t.setTimeout!==He.setTimeout&&t.setTimeout,Jt=me.ceil,Qt=me.floor,en=ve.getOwnPropertySymbols,tn=Ae?Ae.isBuffer:void 0,nn=t.isFinite,rn=Ee.join,on=Bt(ve.keys,ve),ln=me.max,an=me.min,un=ce.now,sn=t.parseInt,cn=me.random,dn=Ee.reverse,fn=Qo(t,"DataView"),mn=Qo(t,"Map"),vn=Qo(t,"Promise"),pn=Qo(t,"Set"),gn=Qo(t,"WeakMap"),hn=Qo(ve,"create"),En=gn&&new gn,yn={},_n=Di(fn),bn=Di(mn),Cn=Di(vn),On=Di(pn),Sn=Di(gn),wn=Be?Be.prototype:void 0,Nn=wn?wn.valueOf:void 0,In=wn?wn.toString:void 0;function Dn(e){if($l(e)&&!Pl(e)&&!(e instanceof An)){if(e instanceof Ln)return e;if(Ce.call(e,"__wrapped__"))return Ti(e)}return new Ln(e)}var Tn=function(){function e(){}return function(t){if(!Wl(t))return{};if($e)return $e(t);e.prototype=t;var n=new e;return e.prototype=void 0,n}}();function Rn(){}function Ln(e,t){this.__wrapped__=e,this.__actions__=[],this.__chain__=!!t,this.__index__=0,this.__values__=void 0}function An(e){this.__wrapped__=e,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=4294967295,this.__views__=[]}function xn(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}function Pn(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}function Mn(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}function kn(e){var t=-1,n=null==e?0:e.length;for(this.__data__=new Mn;++t<n;)this.add(e[t])}function Un(e){var t=this.__data__=new Pn(e);this.size=t.size}function Bn(e,t){var n=Pl(e),r=!n&&xl(e),o=!n&&!r&&Bl(e),i=!n&&!r&&!o&&Ql(e),l=n||r||o||i,a=l?wt(e.length,ge):[],u=a.length;for(var s in e)!t&&!Ce.call(e,s)||l&&("length"==s||o&&("offset"==s||"parent"==s)||i&&("buffer"==s||"byteLength"==s||"byteOffset"==s)||li(s,u))||a.push(s);return a}function jn(e){var t=e.length;return t?e[Mr(0,t-1)]:void 0}function Fn(e,t){return Oi(ho(e),Xn(t,0,e.length))}function Vn(e){return Oi(ho(e))}function zn(e,t,n){(void 0!==n&&!Rl(e[t],n)||void 0===n&&!(t in e))&&qn(e,t,n)}function Hn(e,t,n){var r=e[t];Ce.call(e,t)&&Rl(r,n)&&(void 0!==n||t in e)||qn(e,t,n)}function Wn(e,t){for(var n=e.length;n--;)if(Rl(e[n][0],t))return n;return-1}function $n(e,t,n,r){return er(e,function(e,o,i){t(r,e,n(e),i)}),r}function Gn(e,t){return e&&Eo(t,ba(t),e)}function qn(e,t,n){"__proto__"==t&&Zt?Zt(e,t,{configurable:!0,enumerable:!0,value:n,writable:!0}):e[t]=n}function Zn(e,t){for(var n=-1,r=t.length,o=q(r),i=null==e;++n<r;)o[n]=i?void 0:ga(e,t[n]);return o}function Xn(e,t,n){return e==e&&(void 0!==n&&(e=e<=n?e:n),void 0!==t&&(e=e>=t?e:t)),e}function Yn(e,t,n,r,o,l){var s,y=1&t,R=2&t,L=4&t;if(n&&(s=o?n(e,r,o,l):n(e)),void 0!==s)return s;if(!Wl(e))return e;var A=Pl(e);if(A){if(s=function(e){var t=e.length,n=new e.constructor(t);return t&&"string"==typeof e[0]&&Ce.call(e,"index")&&(n.index=e.index,n.input=e.input),n}(e),!y)return ho(e,s)}else{var x=ni(e),P=x==c||x==d;if(Bl(e))return co(e,y);if(x==v||x==i||P&&!o){if(s=R||P?{}:oi(e),!y)return R?function(e,t){return Eo(e,ti(e),t)}(e,function(e,t){return e&&Eo(t,Ca(t),e)}(s,e)):function(e,t){return Eo(e,ei(e),t)}(e,Gn(s,e))}else{if(!Ue[x])return o?e:{};s=function(e,t,n){var r=e.constructor;switch(t){case _:return fo(e);case a:case u:return new r(+e);case b:return function(e,t){var n=t?fo(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.byteLength)}(e,n);case C:case O:case S:case w:case N:case I:case"[object Uint8ClampedArray]":case D:case T:return mo(e,n);case f:return new r;case m:case h:return new r(e);case p:return function(e){var t=new e.constructor(e.source,te.exec(e));return t.lastIndex=e.lastIndex,t}(e);case g:return new r;case E:return Nn?ve(Nn.call(e)):{}}}(e,x,y)}}l||(l=new Un);var M=l.get(e);if(M)return M;l.set(e,s),Yl(e)?e.forEach(function(r){s.add(Yn(r,t,n,r,e,l))}):Gl(e)&&e.forEach(function(r,o){s.set(o,Yn(r,t,n,o,e,l))});var k=A?void 0:(L?R?Go:$o:R?Ca:ba)(e);return rt(k||e,function(r,o){k&&(r=e[o=r]),Hn(s,o,Yn(r,t,n,o,e,l))}),s}function Kn(e,t,n){var r=n.length;if(null==e)return!r;for(e=ve(e);r--;){var o=n[r],i=e[o];if(void 0===i&&!(o in e)||!(0,t[o])(i))return!1}return!0}function Jn(e,t,r){if("function"!=typeof e)throw new he(n);return yi(function(){e.apply(void 0,r)},t)}function Qn(e,t,n,r){var o=-1,i=at,l=!0,a=e.length,u=[],s=t.length;if(!a)return u;n&&(t=st(t,It(n))),r?(i=ut,l=!1):t.length>=200&&(i=Tt,l=!1,t=new kn(t));e:for(;++o<a;){var c=e[o],d=null==n?c:n(c);if(c=r||0!==c?c:0,l&&d==d){for(var f=s;f--;)if(t[f]===d)continue e;u.push(c)}else i(t,d,r)||u.push(c)}return u}Dn.templateSettings={escape:B,evaluate:j,interpolate:F,variable:"",imports:{_:Dn}},(Dn.prototype=Rn.prototype).constructor=Dn,(Ln.prototype=Tn(Rn.prototype)).constructor=Ln,(An.prototype=Tn(Rn.prototype)).constructor=An,xn.prototype.clear=function(){this.__data__=hn?hn(null):{},this.size=0},xn.prototype.delete=function(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t},xn.prototype.get=function(e){var t=this.__data__;if(hn){var n=t[e];return"__lodash_hash_undefined__"===n?void 0:n}return Ce.call(t,e)?t[e]:void 0},xn.prototype.has=function(e){var t=this.__data__;return hn?void 0!==t[e]:Ce.call(t,e)},xn.prototype.set=function(e,t){var n=this.__data__;return this.size+=this.has(e)?0:1,n[e]=hn&&void 0===t?"__lodash_hash_undefined__":t,this},Pn.prototype.clear=function(){this.__data__=[],this.size=0},Pn.prototype.delete=function(e){var t=this.__data__,n=Wn(t,e);return!(n<0||(n==t.length-1?t.pop():Ze.call(t,n,1),--this.size,0))},Pn.prototype.get=function(e){var t=this.__data__,n=Wn(t,e);return n<0?void 0:t[n][1]},Pn.prototype.has=function(e){return Wn(this.__data__,e)>-1},Pn.prototype.set=function(e,t){var n=this.__data__,r=Wn(n,e);return r<0?(++this.size,n.push([e,t])):n[r][1]=t,this},Mn.prototype.clear=function(){this.size=0,this.__data__={hash:new xn,map:new(mn||Pn),string:new xn}},Mn.prototype.delete=function(e){var t=Ko(this,e).delete(e);return this.size-=t?1:0,t},Mn.prototype.get=function(e){return Ko(this,e).get(e)},Mn.prototype.has=function(e){return Ko(this,e).has(e)},Mn.prototype.set=function(e,t){var n=Ko(this,e),r=n.size;return n.set(e,t),this.size+=n.size==r?0:1,this},kn.prototype.add=kn.prototype.push=function(e){return this.__data__.set(e,"__lodash_hash_undefined__"),this},kn.prototype.has=function(e){return this.__data__.has(e)},Un.prototype.clear=function(){this.__data__=new Pn,this.size=0},Un.prototype.delete=function(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n},Un.prototype.get=function(e){return this.__data__.get(e)},Un.prototype.has=function(e){return this.__data__.has(e)},Un.prototype.set=function(e,t){var n=this.__data__;if(n instanceof Pn){var r=n.__data__;if(!mn||r.length<199)return r.push([e,t]),this.size=++n.size,this;n=this.__data__=new Mn(r)}return n.set(e,t),this.size=n.size,this};var er=bo(ur),tr=bo(sr,!0);function nr(e,t){var n=!0;return er(e,function(e,r,o){return n=!!t(e,r,o)}),n}function rr(e,t,n){for(var r=-1,o=e.length;++r<o;){var i=e[r],l=t(i);if(null!=l&&(void 0===a?l==l&&!Jl(l):n(l,a)))var a=l,u=i}return u}function or(e,t){var n=[];return er(e,function(e,r,o){t(e,r,o)&&n.push(e)}),n}function ir(e,t,n,r,o){var i=-1,l=e.length;for(n||(n=ii),o||(o=[]);++i<l;){var a=e[i];t>0&&n(a)?t>1?ir(a,t-1,n,r,o):ct(o,a):r||(o[o.length]=a)}return o}var lr=Co(),ar=Co(!0);function ur(e,t){return e&&lr(e,t,ba)}function sr(e,t){return e&&ar(e,t,ba)}function cr(e,t){return lt(t,function(t){return Vl(e[t])})}function dr(e,t){for(var n=0,r=(t=lo(t,e)).length;null!=e&&n<r;)e=e[Ii(t[n++])];return n&&n==r?e:void 0}function fr(e,t,n){var r=t(e);return Pl(e)?r:ct(r,n(e))}function mr(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":qt&&qt in ve(e)?function(e){var t=Ce.call(e,qt),n=e[qt];try{e[qt]=void 0;var r=!0}catch(e){}var o=we.call(e);return r&&(t?e[qt]=n:delete e[qt]),o}(e):function(e){return we.call(e)}(e)}function vr(e,t){return e>t}function pr(e,t){return null!=e&&Ce.call(e,t)}function gr(e,t){return null!=e&&t in ve(e)}function hr(e,t,n){for(var r=n?ut:at,o=e[0].length,i=e.length,l=i,a=q(i),u=Infinity,s=[];l--;){var c=e[l];l&&t&&(c=st(c,It(t))),u=an(c.length,u),a[l]=!n&&(t||o>=120&&c.length>=120)?new kn(l&&c):void 0}c=e[0];var d=-1,f=a[0];e:for(;++d<o&&s.length<u;){var m=c[d],v=t?t(m):m;if(m=n||0!==m?m:0,!(f?Tt(f,v):r(s,v,n))){for(l=i;--l;){var p=a[l];if(!(p?Tt(p,v):r(e[l],v,n)))continue e}f&&f.push(v),s.push(m)}}return s}function Er(e,t,n){var r=null==(e=pi(e,t=lo(t,e)))?e:e[Ii(Fi(t))];return null==r?void 0:tt(r,e,n)}function yr(e){return $l(e)&&mr(e)==i}function _r(e,t,n,r,o){return e===t||(null==e||null==t||!$l(e)&&!$l(t)?e!=e&&t!=t:function(e,t,n,r,o,c){var d=Pl(e),y=Pl(t),C=d?l:ni(e),O=y?l:ni(t),S=(C=C==i?v:C)==v,w=(O=O==i?v:O)==v,N=C==O;if(N&&Bl(e)){if(!Bl(t))return!1;d=!0,S=!1}if(N&&!S)return c||(c=new Un),d||Ql(e)?Ho(e,t,n,r,o,c):function(e,t,n,r,o,i,l){switch(n){case b:if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case _:return!(e.byteLength!=t.byteLength||!i(new Ve(e),new Ve(t)));case a:case u:case m:return Rl(+e,+t);case s:return e.name==t.name&&e.message==t.message;case p:case h:return e==t+"";case f:var c=Ut;case g:if(c||(c=Ft),e.size!=t.size&&!(1&r))return!1;var d=l.get(e);if(d)return d==t;r|=2,l.set(e,t);var v=Ho(c(e),c(t),r,o,i,l);return l.delete(e),v;case E:if(Nn)return Nn.call(e)==Nn.call(t)}return!1}(e,t,C,n,r,o,c);if(!(1&n)){var I=S&&Ce.call(e,"__wrapped__"),D=w&&Ce.call(t,"__wrapped__");if(I||D){var T=I?e.value():e,R=D?t.value():t;return c||(c=new Un),o(T,R,n,r,c)}}return!!N&&(c||(c=new Un),function(e,t,n,r,o,i){var l=1&n,a=$o(e),u=a.length;if(u!=$o(t).length&&!l)return!1;for(var s=u;s--;){var c=a[s];if(!(l?c in t:Ce.call(t,c)))return!1}var d=i.get(e),f=i.get(t);if(d&&f)return d==t&&f==e;var m=!0;i.set(e,t),i.set(t,e);for(var v=l;++s<u;){var p=e[c=a[s]],g=t[c];if(r)var h=l?r(g,p,c,t,e,i):r(p,g,c,e,t,i);if(!(void 0===h?p===g||o(p,g,n,r,i):h)){m=!1;break}v||(v="constructor"==c)}if(m&&!v){var E=e.constructor,y=t.constructor;E==y||!("constructor"in e)||!("constructor"in t)||"function"==typeof E&&E instanceof E&&"function"==typeof y&&y instanceof y||(m=!1)}return i.delete(e),i.delete(t),m}(e,t,n,r,o,c))}(e,t,n,r,_r,o))}function br(e,t,n,r){var o=n.length,i=o,l=!r;if(null==e)return!i;for(e=ve(e);o--;){var a=n[o];if(l&&a[2]?a[1]!==e[a[0]]:!(a[0]in e))return!1}for(;++o<i;){var u=(a=n[o])[0],s=e[u],c=a[1];if(l&&a[2]){if(void 0===s&&!(u in e))return!1}else{var d=new Un;if(r)var f=r(s,c,u,e,t,d);if(!(void 0===f?_r(c,s,3,r,d):f))return!1}}return!0}function Cr(e){return!(!Wl(e)||(t=e,Se&&Se in t))&&(Vl(e)?Re:oe).test(Di(e));var t}function Or(e){return"function"==typeof e?e:null==e?qa:"object"==typeof e?Pl(e)?Dr(e[0],e[1]):Ir(e):nu(e)}function Sr(e){if(!di(e))return on(e);var t=[];for(var n in ve(e))Ce.call(e,n)&&"constructor"!=n&&t.push(n);return t}function wr(e,t){return e<t}function Nr(e,t){var n=-1,r=kl(e)?q(e.length):[];return er(e,function(e,o,i){r[++n]=t(e,o,i)}),r}function Ir(e){var t=Jo(e);return 1==t.length&&t[0][2]?mi(t[0][0],t[0][1]):function(n){return n===e||br(n,e,t)}}function Dr(e,t){return ui(e)&&fi(t)?mi(Ii(e),t):function(n){var r=ga(n,e);return void 0===r&&r===t?ha(n,e):_r(t,r,3)}}function Tr(e,t,n,r,o){e!==t&&lr(t,function(i,l){if(o||(o=new Un),Wl(i))!function(e,t,n,r,o,i,l){var a=hi(e,n),u=hi(t,n),s=l.get(u);if(s)zn(e,n,s);else{var c=i?i(a,u,n+"",e,t,l):void 0,d=void 0===c;if(d){var f=Pl(u),m=!f&&Bl(u),v=!f&&!m&&Ql(u);c=u,f||m||v?Pl(a)?c=a:Ul(a)?c=ho(a):m?(d=!1,c=co(u,!0)):v?(d=!1,c=mo(u,!0)):c=[]:Zl(u)||xl(u)?(c=a,xl(a)?c=aa(a):Wl(a)&&!Vl(a)||(c=oi(u))):d=!1}d&&(l.set(u,c),o(c,u,r,i,l),l.delete(u)),zn(e,n,c)}}(e,t,l,n,Tr,r,o);else{var a=r?r(hi(e,l),i,l+"",e,t,o):void 0;void 0===a&&(a=i),zn(e,l,a)}},Ca)}function Rr(e,t){var n=e.length;if(n)return li(t+=t<0?n:0,n)?e[t]:void 0}function Lr(e,t,n){t=t.length?st(t,function(e){return Pl(e)?function(t){return dr(t,1===e.length?e[0]:e)}:e}):[qa];var r=-1;return t=st(t,It(Yo())),function(e,t){var r=e.length;for(e.sort(function(e,t){return function(e,t,n){for(var r=-1,o=e.criteria,i=t.criteria,l=o.length,a=n.length;++r<l;){var u=vo(o[r],i[r]);if(u)return r>=a?u:u*("desc"==n[r]?-1:1)}return e.index-t.index}(e,t,n)});r--;)e[r]=e[r].value;return e}(Nr(e,function(e,n,o){return{criteria:st(t,function(t){return t(e)}),index:++r,value:e}}))}function Ar(e,t,n){for(var r=-1,o=t.length,i={};++r<o;){var l=t[r],a=dr(e,l);n(a,l)&&Fr(i,lo(l,e),a)}return i}function xr(e,t,n,r){var o=r?Et:ht,i=-1,l=t.length,a=e;for(e===t&&(t=ho(t)),n&&(a=st(e,It(n)));++i<l;)for(var u=0,s=t[i],c=n?n(s):s;(u=o(a,c,u,r))>-1;)a!==e&&Ze.call(a,u,1),Ze.call(e,u,1);return e}function Pr(e,t){for(var n=e?t.length:0,r=n-1;n--;){var o=t[n];if(n==r||o!==i){var i=o;li(o)?Ze.call(e,o,1):Jr(e,o)}}return e}function Mr(e,t){return e+Qt(cn()*(t-e+1))}function kr(e,t){var n="";if(!e||t<1||t>9007199254740991)return n;do{t%2&&(n+=e),(t=Qt(t/2))&&(e+=e)}while(t);return n}function Ur(e,t){return _i(vi(e,t,qa),e+"")}function Br(e){return jn(Ra(e))}function jr(e,t){var n=Ra(e);return Oi(n,Xn(t,0,n.length))}function Fr(e,t,n,r){if(!Wl(e))return e;for(var o=-1,i=(t=lo(t,e)).length,l=i-1,a=e;null!=a&&++o<i;){var u=Ii(t[o]),s=n;if("__proto__"===u||"constructor"===u||"prototype"===u)return e;if(o!=l){var c=a[u];void 0===(s=r?r(c,u,a):void 0)&&(s=Wl(c)?c:li(t[o+1])?[]:{})}Hn(a,u,s),a=a[u]}return e}var Vr=En?function(e,t){return En.set(e,t),e}:qa,zr=Zt?function(e,t){return Zt(e,"toString",{configurable:!0,enumerable:!1,value:Wa(t),writable:!0})}:qa;function Hr(e){return Oi(Ra(e))}function Wr(e,t,n){var r=-1,o=e.length;t<0&&(t=-t>o?0:o+t),(n=n>o?o:n)<0&&(n+=o),o=t>n?0:n-t>>>0,t>>>=0;for(var i=q(o);++r<o;)i[r]=e[r+t];return i}function $r(e,t){var n;return er(e,function(e,r,o){return!(n=t(e,r,o))}),!!n}function Gr(e,t,n){var r=0,o=null==e?r:e.length;if("number"==typeof t&&t==t&&o<=2147483647){for(;r<o;){var i=r+o>>>1,l=e[i];null!==l&&!Jl(l)&&(n?l<=t:l<t)?r=i+1:o=i}return o}return qr(e,t,qa,n)}function qr(e,t,n,r){var o=0,i=null==e?0:e.length;if(0===i)return 0;for(var l=(t=n(t))!=t,a=null===t,u=Jl(t),s=void 0===t;o<i;){var c=Qt((o+i)/2),d=n(e[c]),f=void 0!==d,m=null===d,v=d==d,p=Jl(d);if(l)var g=r||v;else g=s?v&&(r||f):a?v&&f&&(r||!m):u?v&&f&&!m&&(r||!p):!m&&!p&&(r?d<=t:d<t);g?o=c+1:i=c}return an(i,4294967294)}function Zr(e,t){for(var n=-1,r=e.length,o=0,i=[];++n<r;){var l=e[n],a=t?t(l):l;if(!n||!Rl(a,u)){var u=a;i[o++]=0===l?0:l}}return i}function Xr(e){return"number"==typeof e?e:Jl(e)?NaN:+e}function Yr(e){if("string"==typeof e)return e;if(Pl(e))return st(e,Yr)+"";if(Jl(e))return In?In.call(e):"";var t=e+"";return"0"==t&&1/e==-1/0?"-0":t}function Kr(e,t,n){var r=-1,o=at,i=e.length,l=!0,a=[],u=a;if(n)l=!1,o=ut;else if(i>=200){var s=t?null:Uo(e);if(s)return Ft(s);l=!1,o=Tt,u=new kn}else u=t?[]:a;e:for(;++r<i;){var c=e[r],d=t?t(c):c;if(c=n||0!==c?c:0,l&&d==d){for(var f=u.length;f--;)if(u[f]===d)continue e;t&&u.push(d),a.push(c)}else o(u,d,n)||(u!==a&&u.push(d),a.push(c))}return a}function Jr(e,t){return null==(e=pi(e,t=lo(t,e)))||delete e[Ii(Fi(t))]}function Qr(e,t,n,r){return Fr(e,t,n(dr(e,t)),r)}function eo(e,t,n,r){for(var o=e.length,i=r?o:-1;(r?i--:++i<o)&&t(e[i],i,e););return n?Wr(e,r?0:i,r?i+1:o):Wr(e,r?i+1:0,r?o:i)}function to(e,t){var n=e;return n instanceof An&&(n=n.value()),dt(t,function(e,t){return t.func.apply(t.thisArg,ct([e],t.args))},n)}function no(e,t,n){var r=e.length;if(r<2)return r?Kr(e[0]):[];for(var o=-1,i=q(r);++o<r;)for(var l=e[o],a=-1;++a<r;)a!=o&&(i[o]=Qn(i[o]||l,e[a],t,n));return Kr(ir(i,1),t,n)}function ro(e,t,n){for(var r=-1,o=e.length,i=t.length,l={};++r<o;)n(l,e[r],r<i?t[r]:void 0);return l}function oo(e){return Ul(e)?e:[]}function io(e){return"function"==typeof e?e:qa}function lo(e,t){return Pl(e)?e:ui(e,t)?[e]:Ni(ua(e))}var ao=Ur;function uo(e,t,n){var r=e.length;return n=void 0===n?r:n,!t&&n>=r?e:Wr(e,t,n)}var so=Xt||function(e){return He.clearTimeout(e)};function co(e,t){if(t)return e.slice();var n=e.length,r=ze?ze(n):new e.constructor(n);return e.copy(r),r}function fo(e){var t=new e.constructor(e.byteLength);return new Ve(t).set(new Ve(e)),t}function mo(e,t){var n=t?fo(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.length)}function vo(e,t){if(e!==t){var n=void 0!==e,r=null===e,o=e==e,i=Jl(e),l=void 0!==t,a=null===t,u=t==t,s=Jl(t);if(!a&&!s&&!i&&e>t||i&&l&&u&&!a&&!s||r&&l&&u||!n&&u||!o)return 1;if(!r&&!i&&!s&&e<t||s&&n&&o&&!r&&!i||a&&n&&o||!l&&o||!u)return-1}return 0}function po(e,t,n,r){for(var o=-1,i=e.length,l=n.length,a=-1,u=t.length,s=ln(i-l,0),c=q(u+s),d=!r;++a<u;)c[a]=t[a];for(;++o<l;)(d||o<i)&&(c[n[o]]=e[o]);for(;s--;)c[a++]=e[o++];return c}function go(e,t,n,r){for(var o=-1,i=e.length,l=-1,a=n.length,u=-1,s=t.length,c=ln(i-a,0),d=q(c+s),f=!r;++o<c;)d[o]=e[o];for(var m=o;++u<s;)d[m+u]=t[u];for(;++l<a;)(f||o<i)&&(d[m+n[l]]=e[o++]);return d}function ho(e,t){var n=-1,r=e.length;for(t||(t=q(r));++n<r;)t[n]=e[n];return t}function Eo(e,t,n,r){var o=!n;n||(n={});for(var i=-1,l=t.length;++i<l;){var a=t[i],u=r?r(n[a],e[a],a,n,e):void 0;void 0===u&&(u=e[a]),o?qn(n,a,u):Hn(n,a,u)}return n}function yo(e,t){return function(n,r){var o=Pl(n)?nt:$n,i=t?t():{};return o(n,e,Yo(r,2),i)}}function _o(e){return Ur(function(t,n){var r=-1,o=n.length,i=o>1?n[o-1]:void 0,l=o>2?n[2]:void 0;for(i=e.length>3&&"function"==typeof i?(o--,i):void 0,l&&ai(n[0],n[1],l)&&(i=o<3?void 0:i,o=1),t=ve(t);++r<o;){var a=n[r];a&&e(t,a,r,i)}return t})}function bo(e,t){return function(n,r){if(null==n)return n;if(!kl(n))return e(n,r);for(var o=n.length,i=t?o:-1,l=ve(n);(t?i--:++i<o)&&!1!==r(l[i],i,l););return n}}function Co(e){return function(t,n,r){for(var o=-1,i=ve(t),l=r(t),a=l.length;a--;){var u=l[e?a:++o];if(!1===n(i[u],u,i))break}return t}}function Oo(e){return function(t){var n=kt(t=ua(t))?Ht(t):void 0,r=n?n[0]:t.charAt(0),o=n?uo(n,1).join(""):t.slice(1);return r[e]()+o}}function So(e){return function(t){return dt(Va(xa(t).replace(De,"")),e,"")}}function wo(e){return function(){var t=arguments;switch(t.length){case 0:return new e;case 1:return new e(t[0]);case 2:return new e(t[0],t[1]);case 3:return new e(t[0],t[1],t[2]);case 4:return new e(t[0],t[1],t[2],t[3]);case 5:return new e(t[0],t[1],t[2],t[3],t[4]);case 6:return new e(t[0],t[1],t[2],t[3],t[4],t[5]);case 7:return new e(t[0],t[1],t[2],t[3],t[4],t[5],t[6])}var n=Tn(e.prototype),r=e.apply(n,t);return Wl(r)?r:n}}function No(e){return function(t,n,r){var o=ve(t);if(!kl(t)){var i=Yo(n,3);t=ba(t),n=function(e){return i(o[e],e,o)}}var l=e(t,n,r);return l>-1?o[i?t[l]:l]:void 0}}function Io(e){return Wo(function(t){var r=t.length,o=r,i=Ln.prototype.thru;for(e&&t.reverse();o--;){var l=t[o];if("function"!=typeof l)throw new he(n);if(i&&!a&&"wrapper"==Zo(l))var a=new Ln([],!0)}for(o=a?o:r;++o<r;){var u=Zo(l=t[o]),s="wrapper"==u?qo(l):void 0;a=s&&si(s[0])&&424==s[1]&&!s[4].length&&1==s[9]?a[Zo(s[0])].apply(a,s[3]):1==l.length&&si(l)?a[u]():a.thru(l)}return function(){var e=arguments,n=e[0];if(a&&1==e.length&&Pl(n))return a.plant(n).value();for(var o=0,i=r?t[o].apply(this,e):n;++o<r;)i=t[o].call(this,i);return i}})}function Do(e,t,n,r,o,i,l,a,u,s){var c=128&t,d=1&t,f=2&t,m=24&t,v=512&t,p=f?void 0:wo(e);return function g(){for(var h=arguments.length,E=q(h),y=h;y--;)E[y]=arguments[y];if(m)var _=Xo(g),b=At(E,_);if(r&&(E=po(E,r,o,m)),i&&(E=go(E,i,l,m)),h-=b,m&&h<s){var C=jt(E,_);return Mo(e,t,Do,g.placeholder,n,E,C,a,u,s-h)}var O=d?n:this,S=f?O[e]:e;return h=E.length,a?E=gi(E,a):v&&h>1&&E.reverse(),c&&u<h&&(E.length=u),this&&this!==He&&this instanceof g&&(S=p||wo(S)),S.apply(O,E)}}function To(e,t){return function(n,r){return function(e,t,n,r){return ur(e,function(e,o,i){t(r,n(e),o,i)}),r}(n,e,t(r),{})}}function Ro(e,t){return function(n,r){var o;if(void 0===n&&void 0===r)return t;if(void 0!==n&&(o=n),void 0!==r){if(void 0===o)return r;"string"==typeof n||"string"==typeof r?(n=Yr(n),r=Yr(r)):(n=Xr(n),r=Xr(r)),o=e(n,r)}return o}}function Lo(e){return Wo(function(t){return t=st(t,It(Yo())),Ur(function(n){var r=this;return e(t,function(e){return tt(e,r,n)})})})}function Ao(e,t){var n=(t=void 0===t?" ":Yr(t)).length;if(n<2)return n?kr(t,e):t;var r=kr(t,Jt(e/zt(t)));return kt(t)?uo(Ht(r),0,e).join(""):r.slice(0,e)}function xo(e){return function(t,n,r){return r&&"number"!=typeof r&&ai(t,n,r)&&(n=r=void 0),t=ra(t),void 0===n?(n=t,t=0):n=ra(n),function(e,t,n,r){for(var o=-1,i=ln(Jt((t-e)/(n||1)),0),l=q(i);i--;)l[r?i:++o]=e,e+=n;return l}(t,n,r=void 0===r?t<n?1:-1:ra(r),e)}}function Po(e){return function(t,n){return"string"==typeof t&&"string"==typeof n||(t=la(t),n=la(n)),e(t,n)}}function Mo(e,t,n,r,o,i,l,a,u,s){var c=8&t;t|=c?32:64,4&(t&=~(c?64:32))||(t&=-4);var d=[e,t,o,c?i:void 0,c?l:void 0,c?void 0:i,c?void 0:l,a,u,s],f=n.apply(void 0,d);return si(e)&&Ei(f,d),f.placeholder=r,bi(f,e,t)}function ko(e){var t=me[e];return function(e,n){if(e=la(e),(n=null==n?0:an(oa(n),292))&&nn(e)){var r=(ua(e)+"e").split("e");return+((r=(ua(t(r[0]+"e"+(+r[1]+n)))+"e").split("e"))[0]+"e"+(+r[1]-n))}return t(e)}}var Uo=pn&&1/Ft(new pn([,-0]))[1]==1/0?function(e){return new pn(e)}:Ja;function Bo(e){return function(t){var n=ni(t);return n==f?Ut(t):n==g?Vt(t):function(e,t){return st(t,function(t){return[t,e[t]]})}(t,e(t))}}function jo(e,t,o,i,l,a,u,s){var c=2&t;if(!c&&"function"!=typeof e)throw new he(n);var d=i?i.length:0;if(d||(t&=-97,i=l=void 0),u=void 0===u?u:ln(oa(u),0),s=void 0===s?s:oa(s),d-=l?l.length:0,64&t){var f=i,m=l;i=l=void 0}var v=c?void 0:qo(e),p=[e,t,o,i,l,f,m,a,u,s];if(v&&function(e,t){var n=e[1],o=t[1],i=n|o;if(!(i<131||128==o&&8==n||128==o&&256==n&&e[7].length<=t[8]||384==o&&t[7].length<=t[8]&&8==n))return e;1&o&&(e[2]=t[2],i|=1&n?0:4);var l=t[3];if(l){var a=e[3];e[3]=a?po(a,l,t[4]):l,e[4]=a?jt(e[3],r):t[4]}(l=t[5])&&(e[5]=(a=e[5])?go(a,l,t[6]):l,e[6]=a?jt(e[5],r):t[6]),(l=t[7])&&(e[7]=l),128&o&&(e[8]=null==e[8]?t[8]:an(e[8],t[8])),null==e[9]&&(e[9]=t[9]),e[0]=t[0],e[1]=i}(p,v),e=p[0],t=p[1],o=p[2],i=p[3],l=p[4],!(s=p[9]=void 0===p[9]?c?0:e.length:ln(p[9]-d,0))&&24&t&&(t&=-25),t&&1!=t)g=8==t||16==t?function(e,t,n){var r=wo(e);return function o(){for(var i=arguments.length,l=q(i),a=i,u=Xo(o);a--;)l[a]=arguments[a];var s=i<3&&l[0]!==u&&l[i-1]!==u?[]:jt(l,u);if((i-=s.length)<n)return Mo(e,t,Do,o.placeholder,void 0,l,s,void 0,void 0,n-i);var c=this&&this!==He&&this instanceof o?r:e;return tt(c,this,l)}}(e,t,s):32!=t&&33!=t||l.length?Do.apply(void 0,p):function(e,t,n,r){var o=1&t,i=wo(e);return function t(){for(var l=-1,a=arguments.length,u=-1,s=r.length,c=q(s+a),d=this&&this!==He&&this instanceof t?i:e;++u<s;)c[u]=r[u];for(;a--;)c[u++]=arguments[++l];return tt(d,o?n:this,c)}}(e,t,o,i);else var g=function(e,t,n){var r=1&t,o=wo(e);return function t(){var i=this&&this!==He&&this instanceof t?o:e;return i.apply(r?n:this,arguments)}}(e,t,o);return bi((v?Vr:Ei)(g,p),e,t)}function Fo(e,t,n,r){return void 0===e||Rl(e,ye[n])&&!Ce.call(r,n)?t:e}function Vo(e,t,n,r,o,i){return Wl(e)&&Wl(t)&&(i.set(t,e),Tr(e,t,void 0,Vo,i),i.delete(t)),e}function zo(e){return Zl(e)?void 0:e}function Ho(e,t,n,r,o,i){var l=1&n,a=e.length,u=t.length;if(a!=u&&!(l&&u>a))return!1;var s=i.get(e),c=i.get(t);if(s&&c)return s==t&&c==e;var d=-1,f=!0,m=2&n?new kn:void 0;for(i.set(e,t),i.set(t,e);++d<a;){var v=e[d],p=t[d];if(r)var g=l?r(p,v,d,t,e,i):r(v,p,d,e,t,i);if(void 0!==g){if(g)continue;f=!1;break}if(m){if(!mt(t,function(e,t){if(!Tt(m,t)&&(v===e||o(v,e,n,r,i)))return m.push(t)})){f=!1;break}}else if(v!==p&&!o(v,p,n,r,i)){f=!1;break}}return i.delete(e),i.delete(t),f}function Wo(e){return _i(vi(e,void 0,Mi),e+"")}function $o(e){return fr(e,ba,ei)}function Go(e){return fr(e,Ca,ti)}var qo=En?function(e){return En.get(e)}:Ja;function Zo(e){for(var t=e.name+"",n=yn[t],r=Ce.call(yn,t)?n.length:0;r--;){var o=n[r],i=o.func;if(null==i||i==e)return o.name}return t}function Xo(e){return(Ce.call(Dn,"placeholder")?Dn:e).placeholder}function Yo(){var e=Dn.iteratee||Za;return e=e===Za?Or:e,arguments.length?e(arguments[0],arguments[1]):e}function Ko(e,t){var n,r,o=e.__data__;return("string"==(r=typeof(n=t))||"number"==r||"symbol"==r||"boolean"==r?"__proto__"!==n:null===n)?o["string"==typeof t?"string":"hash"]:o.map}function Jo(e){for(var t=ba(e),n=t.length;n--;){var r=t[n],o=e[r];t[n]=[r,o,fi(o)]}return t}function Qo(e,t){var n=function(e,t){return null==e?void 0:e[t]}(e,t);return Cr(n)?n:void 0}var ei=en?function(e){return null==e?[]:(e=ve(e),lt(en(e),function(t){return qe.call(e,t)}))}:iu,ti=en?function(e){for(var t=[];e;)ct(t,ei(e)),e=We(e);return t}:iu,ni=mr;function ri(e,t,n){for(var r=-1,o=(t=lo(t,e)).length,i=!1;++r<o;){var l=Ii(t[r]);if(!(i=null!=e&&n(e,l)))break;e=e[l]}return i||++r!=o?i:!!(o=null==e?0:e.length)&&Hl(o)&&li(l,o)&&(Pl(e)||xl(e))}function oi(e){return"function"!=typeof e.constructor||di(e)?{}:Tn(We(e))}function ii(e){return Pl(e)||xl(e)||!!(vt&&e&&e[vt])}function li(e,t){var n=typeof e;return!!(t=null==t?9007199254740991:t)&&("number"==n||"symbol"!=n&&le.test(e))&&e>-1&&e%1==0&&e<t}function ai(e,t,n){if(!Wl(n))return!1;var r=typeof t;return!!("number"==r?kl(n)&&li(t,n.length):"string"==r&&t in n)&&Rl(n[t],e)}function ui(e,t){if(Pl(e))return!1;var n=typeof e;return!("number"!=n&&"symbol"!=n&&"boolean"!=n&&null!=e&&!Jl(e))||z.test(e)||!V.test(e)||null!=t&&e in ve(t)}function si(e){var t=Zo(e),n=Dn[t];if("function"!=typeof n||!(t in An.prototype))return!1;if(e===n)return!0;var r=qo(n);return!!r&&e===r[0]}(fn&&ni(new fn(new ArrayBuffer(1)))!=b||mn&&ni(new mn)!=f||vn&&"[object Promise]"!=ni(vn.resolve())||pn&&ni(new pn)!=g||gn&&ni(new gn)!=y)&&(ni=function(e){var t=mr(e),n=t==v?e.constructor:void 0,r=n?Di(n):"";if(r)switch(r){case _n:return b;case bn:return f;case Cn:return"[object Promise]";case On:return g;case Sn:return y}return t});var ci=_e?Vl:lu;function di(e){var t=e&&e.constructor;return e===("function"==typeof t&&t.prototype||ye)}function fi(e){return e==e&&!Wl(e)}function mi(e,t){return function(n){return null!=n&&n[e]===t&&(void 0!==t||e in ve(n))}}function vi(e,t,n){return t=ln(void 0===t?e.length-1:t,0),function(){for(var r=arguments,o=-1,i=ln(r.length-t,0),l=q(i);++o<i;)l[o]=r[t+o];o=-1;for(var a=q(t+1);++o<t;)a[o]=r[o];return a[t]=n(l),tt(e,this,a)}}function pi(e,t){return t.length<2?e:dr(e,Wr(t,0,-1))}function gi(e,t){for(var n=e.length,r=an(t.length,n),o=ho(e);r--;){var i=t[r];e[r]=li(i,n)?o[i]:void 0}return e}function hi(e,t){if(("constructor"!==t||"function"!=typeof e[t])&&"__proto__"!=t)return e[t]}var Ei=Ci(Vr),yi=Kt||function(e,t){return He.setTimeout(e,t)},_i=Ci(zr);function bi(e,t,n){var r=t+"";return _i(e,function(e,t){var n=t.length;if(!n)return e;var r=n-1;return t[r]=(n>1?"& ":"")+t[r],t=t.join(n>2?", ":" "),e.replace(Z,"{\n/* [wrapped with "+t+"] */\n")}(r,function(e,t){return rt(o,function(n){var r="_."+n[0];t&n[1]&&!at(e,r)&&e.push(r)}),e.sort()}(function(e){var t=e.match(X);return t?t[1].split(Y):[]}(r),n)))}function Ci(e){var t=0,n=0;return function(){var r=un(),o=16-(r-n);if(n=r,o>0){if(++t>=800)return arguments[0]}else t=0;return e.apply(void 0,arguments)}}function Oi(e,t){var n=-1,r=e.length,o=r-1;for(t=void 0===t?r:t;++n<t;){var i=Mr(n,o),l=e[i];e[i]=e[n],e[n]=l}return e.length=t,e}var Si,wi,Ni=(Si=Sl(function(e){var t=[];return 46===e.charCodeAt(0)&&t.push(""),e.replace(H,function(e,n,r,o){t.push(r?o.replace(Q,"$1"):n||e)}),t},function(e){return 500===wi.size&&wi.clear(),e}),wi=Si.cache,Si);function Ii(e){if("string"==typeof e||Jl(e))return e;var t=e+"";return"0"==t&&1/e==-1/0?"-0":t}function Di(e){if(null!=e){try{return be.call(e)}catch(e){}try{return e+""}catch(e){}}return""}function Ti(e){if(e instanceof An)return e.clone();var t=new Ln(e.__wrapped__,e.__chain__);return t.__actions__=ho(e.__actions__),t.__index__=e.__index__,t.__values__=e.__values__,t}var Ri=Ur(function(e,t){return Ul(e)?Qn(e,ir(t,1,Ul,!0)):[]}),Li=Ur(function(e,t){var n=Fi(t);return Ul(n)&&(n=void 0),Ul(e)?Qn(e,ir(t,1,Ul,!0),Yo(n,2)):[]}),Ai=Ur(function(e,t){var n=Fi(t);return Ul(n)&&(n=void 0),Ul(e)?Qn(e,ir(t,1,Ul,!0),void 0,n):[]});function xi(e,t,n){var r=null==e?0:e.length;if(!r)return-1;var o=null==n?0:oa(n);return o<0&&(o=ln(r+o,0)),gt(e,Yo(t,3),o)}function Pi(e,t,n){var r=null==e?0:e.length;if(!r)return-1;var o=r-1;return void 0!==n&&(o=oa(n),o=n<0?ln(r+o,0):an(o,r-1)),gt(e,Yo(t,3),o,!0)}function Mi(e){return null!=e&&e.length?ir(e,1):[]}function ki(e){return e&&e.length?e[0]:void 0}var Ui=Ur(function(e){var t=st(e,oo);return t.length&&t[0]===e[0]?hr(t):[]}),Bi=Ur(function(e){var t=Fi(e),n=st(e,oo);return t===Fi(n)?t=void 0:n.pop(),n.length&&n[0]===e[0]?hr(n,Yo(t,2)):[]}),ji=Ur(function(e){var t=Fi(e),n=st(e,oo);return(t="function"==typeof t?t:void 0)&&n.pop(),n.length&&n[0]===e[0]?hr(n,void 0,t):[]});function Fi(e){var t=null==e?0:e.length;return t?e[t-1]:void 0}var Vi=Ur(zi);function zi(e,t){return e&&e.length&&t&&t.length?xr(e,t):e}var Hi=Wo(function(e,t){var n=null==e?0:e.length,r=Zn(e,t);return Pr(e,st(t,function(e){return li(e,n)?+e:e}).sort(vo)),r});function Wi(e){return null==e?e:dn.call(e)}var $i=Ur(function(e){return Kr(ir(e,1,Ul,!0))}),Gi=Ur(function(e){var t=Fi(e);return Ul(t)&&(t=void 0),Kr(ir(e,1,Ul,!0),Yo(t,2))}),qi=Ur(function(e){var t=Fi(e);return t="function"==typeof t?t:void 0,Kr(ir(e,1,Ul,!0),void 0,t)});function Zi(e){if(!e||!e.length)return[];var t=0;return e=lt(e,function(e){if(Ul(e))return t=ln(e.length,t),!0}),wt(t,function(t){return st(e,bt(t))})}function Xi(e,t){if(!e||!e.length)return[];var n=Zi(e);return null==t?n:st(n,function(e){return tt(t,void 0,e)})}var Yi=Ur(function(e,t){return Ul(e)?Qn(e,t):[]}),Ki=Ur(function(e){return no(lt(e,Ul))}),Ji=Ur(function(e){var t=Fi(e);return Ul(t)&&(t=void 0),no(lt(e,Ul),Yo(t,2))}),Qi=Ur(function(e){var t=Fi(e);return t="function"==typeof t?t:void 0,no(lt(e,Ul),void 0,t)}),el=Ur(Zi),tl=Ur(function(e){var t=e.length,n=t>1?e[t-1]:void 0;return n="function"==typeof n?(e.pop(),n):void 0,Xi(e,n)});function nl(e){var t=Dn(e);return t.__chain__=!0,t}function rl(e,t){return t(e)}var ol=Wo(function(e){var t=e.length,n=t?e[0]:0,r=this.__wrapped__,o=function(t){return Zn(t,e)};return!(t>1||this.__actions__.length)&&r instanceof An&&li(n)?((r=r.slice(n,+n+(t?1:0))).__actions__.push({func:rl,args:[o],thisArg:void 0}),new Ln(r,this.__chain__).thru(function(e){return t&&!e.length&&e.push(void 0),e})):this.thru(o)}),il=yo(function(e,t,n){Ce.call(e,n)?++e[n]:qn(e,n,1)}),ll=No(xi),al=No(Pi);function ul(e,t){return(Pl(e)?rt:er)(e,Yo(t,3))}function sl(e,t){return(Pl(e)?ot:tr)(e,Yo(t,3))}var cl=yo(function(e,t,n){Ce.call(e,n)?e[n].push(t):qn(e,n,[t])}),dl=Ur(function(e,t,n){var r=-1,o="function"==typeof t,i=kl(e)?q(e.length):[];return er(e,function(e){i[++r]=o?tt(t,e,n):Er(e,t,n)}),i}),fl=yo(function(e,t,n){qn(e,n,t)});function ml(e,t){return(Pl(e)?st:Nr)(e,Yo(t,3))}var vl=yo(function(e,t,n){e[n?0:1].push(t)},function(){return[[],[]]}),pl=Ur(function(e,t){if(null==e)return[];var n=t.length;return n>1&&ai(e,t[0],t[1])?t=[]:n>2&&ai(t[0],t[1],t[2])&&(t=[t[0]]),Lr(e,ir(t,1),[])}),gl=Yt||function(){return He.Date.now()};function hl(e,t,n){return t=n?void 0:t,jo(e,128,void 0,void 0,void 0,void 0,t=e&&null==t?e.length:t)}function El(e,t){var r;if("function"!=typeof t)throw new he(n);return e=oa(e),function(){return--e>0&&(r=t.apply(this,arguments)),e<=1&&(t=void 0),r}}var yl=Ur(function(e,t,n){var r=1;if(n.length){var o=jt(n,Xo(yl));r|=32}return jo(e,r,t,n,o)}),_l=Ur(function(e,t,n){var r=3;if(n.length){var o=jt(n,Xo(_l));r|=32}return jo(t,r,e,n,o)});function bl(e,t,r){var o,i,l,a,u,s,c=0,d=!1,f=!1,m=!0;if("function"!=typeof e)throw new he(n);function v(t){var n=o,r=i;return o=i=void 0,c=t,a=e.apply(r,n)}function p(e){return c=e,u=yi(h,t),d?v(e):a}function g(e){var n=e-s;return void 0===s||n>=t||n<0||f&&e-c>=l}function h(){var e=gl();if(g(e))return E(e);u=yi(h,function(e){var n=t-(e-s);return f?an(n,l-(e-c)):n}(e))}function E(e){return u=void 0,m&&o?v(e):(o=i=void 0,a)}function y(){var e=gl(),n=g(e);if(o=arguments,i=this,s=e,n){if(void 0===u)return p(s);if(f)return so(u),u=yi(h,t),v(s)}return void 0===u&&(u=yi(h,t)),a}return t=la(t)||0,Wl(r)&&(d=!!r.leading,l=(f="maxWait"in r)?ln(la(r.maxWait)||0,t):l,m="trailing"in r?!!r.trailing:m),y.cancel=function(){void 0!==u&&so(u),c=0,o=s=i=u=void 0},y.flush=function(){return void 0===u?a:E(gl())},y}var Cl=Ur(function(e,t){return Jn(e,1,t)}),Ol=Ur(function(e,t,n){return Jn(e,la(t)||0,n)});function Sl(e,t){if("function"!=typeof e||null!=t&&"function"!=typeof t)throw new he(n);var r=function(){var n=arguments,o=t?t.apply(this,n):n[0],i=r.cache;if(i.has(o))return i.get(o);var l=e.apply(this,n);return r.cache=i.set(o,l)||i,l};return r.cache=new(Sl.Cache||Mn),r}function wl(e){if("function"!=typeof e)throw new he(n);return function(){var t=arguments;switch(t.length){case 0:return!e.call(this);case 1:return!e.call(this,t[0]);case 2:return!e.call(this,t[0],t[1]);case 3:return!e.call(this,t[0],t[1],t[2])}return!e.apply(this,t)}}Sl.Cache=Mn;var Nl=ao(function(e,t){var n=(t=1==t.length&&Pl(t[0])?st(t[0],It(Yo())):st(ir(t,1),It(Yo()))).length;return Ur(function(r){for(var o=-1,i=an(r.length,n);++o<i;)r[o]=t[o].call(this,r[o]);return tt(e,this,r)})}),Il=Ur(function(e,t){return jo(e,32,void 0,t,jt(t,Xo(Il)))}),Dl=Ur(function(e,t){return jo(e,64,void 0,t,jt(t,Xo(Dl)))}),Tl=Wo(function(e,t){return jo(e,256,void 0,void 0,void 0,t)});function Rl(e,t){return e===t||e!=e&&t!=t}var Ll=Po(vr),Al=Po(function(e,t){return e>=t}),xl=yr(function(){return arguments}())?yr:function(e){return $l(e)&&Ce.call(e,"callee")&&!qe.call(e,"callee")},Pl=q.isArray,Ml=Xe?It(Xe):function(e){return $l(e)&&mr(e)==_};function kl(e){return null!=e&&Hl(e.length)&&!Vl(e)}function Ul(e){return $l(e)&&kl(e)}var Bl=tn||lu,jl=Ye?It(Ye):function(e){return $l(e)&&mr(e)==u};function Fl(e){if(!$l(e))return!1;var t=mr(e);return t==s||"[object DOMException]"==t||"string"==typeof e.message&&"string"==typeof e.name&&!Zl(e)}function Vl(e){if(!Wl(e))return!1;var t=mr(e);return t==c||t==d||"[object AsyncFunction]"==t||"[object Proxy]"==t}function zl(e){return"number"==typeof e&&e==oa(e)}function Hl(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=9007199254740991}function Wl(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}function $l(e){return null!=e&&"object"==typeof e}var Gl=Ke?It(Ke):function(e){return $l(e)&&ni(e)==f};function ql(e){return"number"==typeof e||$l(e)&&mr(e)==m}function Zl(e){if(!$l(e)||mr(e)!=v)return!1;var t=We(e);if(null===t)return!0;var n=Ce.call(t,"constructor")&&t.constructor;return"function"==typeof n&&n instanceof n&&be.call(n)==Ne}var Xl=Je?It(Je):function(e){return $l(e)&&mr(e)==p},Yl=Qe?It(Qe):function(e){return $l(e)&&ni(e)==g};function Kl(e){return"string"==typeof e||!Pl(e)&&$l(e)&&mr(e)==h}function Jl(e){return"symbol"==typeof e||$l(e)&&mr(e)==E}var Ql=et?It(et):function(e){return $l(e)&&Hl(e.length)&&!!ke[mr(e)]},ea=Po(wr),ta=Po(function(e,t){return e<=t});function na(e){if(!e)return[];if(kl(e))return Kl(e)?Ht(e):ho(e);if(Ct&&e[Ct])return function(e){for(var t,n=[];!(t=e.next()).done;)n.push(t.value);return n}(e[Ct]());var t=ni(e);return(t==f?Ut:t==g?Ft:Ra)(e)}function ra(e){return e?(e=la(e))===1/0||e===-1/0?17976931348623157e292*(e<0?-1:1):e==e?e:0:0===e?e:0}function oa(e){var t=ra(e),n=t%1;return t==t?n?t-n:t:0}function ia(e){return e?Xn(oa(e),0,4294967295):0}function la(e){if("number"==typeof e)return e;if(Jl(e))return NaN;if(Wl(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=Wl(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=Nt(e);var n=re.test(e);return n||ie.test(e)?Fe(e.slice(2),n?2:8):ne.test(e)?NaN:+e}function aa(e){return Eo(e,Ca(e))}function ua(e){return null==e?"":Yr(e)}var sa=_o(function(e,t){if(di(t)||kl(t))Eo(t,ba(t),e);else for(var n in t)Ce.call(t,n)&&Hn(e,n,t[n])}),ca=_o(function(e,t){Eo(t,Ca(t),e)}),da=_o(function(e,t,n,r){Eo(t,Ca(t),e,r)}),fa=_o(function(e,t,n,r){Eo(t,ba(t),e,r)}),ma=Wo(Zn),va=Ur(function(e,t){e=ve(e);var n=-1,r=t.length,o=r>2?t[2]:void 0;for(o&&ai(t[0],t[1],o)&&(r=1);++n<r;)for(var i=t[n],l=Ca(i),a=-1,u=l.length;++a<u;){var s=l[a],c=e[s];(void 0===c||Rl(c,ye[s])&&!Ce.call(e,s))&&(e[s]=i[s])}return e}),pa=Ur(function(e){return e.push(void 0,Vo),tt(Sa,void 0,e)});function ga(e,t,n){var r=null==e?void 0:dr(e,t);return void 0===r?n:r}function ha(e,t){return null!=e&&ri(e,t,gr)}var Ea=To(function(e,t,n){null!=t&&"function"!=typeof t.toString&&(t=we.call(t)),e[t]=n},Wa(qa)),ya=To(function(e,t,n){null!=t&&"function"!=typeof t.toString&&(t=we.call(t)),Ce.call(e,t)?e[t].push(n):e[t]=[n]},Yo),_a=Ur(Er);function ba(e){return kl(e)?Bn(e):Sr(e)}function Ca(e){return kl(e)?Bn(e,!0):function(e){if(!Wl(e))return function(e){var t=[];if(null!=e)for(var n in ve(e))t.push(n);return t}(e);var t=di(e),n=[];for(var r in e)("constructor"!=r||!t&&Ce.call(e,r))&&n.push(r);return n}(e)}var Oa=_o(function(e,t,n){Tr(e,t,n)}),Sa=_o(function(e,t,n,r){Tr(e,t,n,r)}),wa=Wo(function(e,t){var n={};if(null==e)return n;var r=!1;t=st(t,function(t){return t=lo(t,e),r||(r=t.length>1),t}),Eo(e,Go(e),n),r&&(n=Yn(n,7,zo));for(var o=t.length;o--;)Jr(n,t[o]);return n}),Na=Wo(function(e,t){return null==e?{}:function(e,t){return Ar(e,t,function(t,n){return ha(e,n)})}(e,t)});function Ia(e,t){if(null==e)return{};var n=st(Go(e),function(e){return[e]});return t=Yo(t),Ar(e,n,function(e,n){return t(e,n[0])})}var Da=Bo(ba),Ta=Bo(Ca);function Ra(e){return null==e?[]:Dt(e,ba(e))}var La=So(function(e,t,n){return t=t.toLowerCase(),e+(n?Aa(t):t)});function Aa(e){return Fa(ua(e).toLowerCase())}function xa(e){return(e=ua(e))&&e.replace(ae,xt).replace(Te,"")}var Pa=So(function(e,t,n){return e+(n?"-":"")+t.toLowerCase()}),Ma=So(function(e,t,n){return e+(n?" ":"")+t.toLowerCase()}),ka=Oo("toLowerCase"),Ua=So(function(e,t,n){return e+(n?"_":"")+t.toLowerCase()}),Ba=So(function(e,t,n){return e+(n?" ":"")+Fa(t)}),ja=So(function(e,t,n){return e+(n?" ":"")+t.toUpperCase()}),Fa=Oo("toUpperCase");function Va(e,t,n){return e=ua(e),void 0===(t=n?void 0:t)?function(e){return xe.test(e)}(e)?function(e){return e.match(Le)||[]}(e):function(e){return e.match(K)||[]}(e):e.match(t)||[]}var za=Ur(function(e,t){try{return tt(e,void 0,t)}catch(e){return Fl(e)?e:new de(e)}}),Ha=Wo(function(e,t){return rt(t,function(t){t=Ii(t),qn(e,t,yl(e[t],e))}),e});function Wa(e){return function(){return e}}var $a=Io(),Ga=Io(!0);function qa(e){return e}function Za(e){return Or("function"==typeof e?e:Yn(e,1))}var Xa=Ur(function(e,t){return function(n){return Er(n,e,t)}}),Ya=Ur(function(e,t){return function(n){return Er(e,n,t)}});function Ka(e,t,n){var r=ba(t),o=cr(t,r);null!=n||Wl(t)&&(o.length||!r.length)||(n=t,t=e,e=this,o=cr(t,ba(t)));var i=!(Wl(n)&&"chain"in n&&!n.chain),l=Vl(e);return rt(o,function(n){var r=t[n];e[n]=r,l&&(e.prototype[n]=function(){var t=this.__chain__;if(i||t){var n=e(this.__wrapped__),o=n.__actions__=ho(this.__actions__);return o.push({func:r,args:arguments,thisArg:e}),n.__chain__=t,n}return r.apply(e,ct([this.value()],arguments))})}),e}function Ja(){}var Qa=Lo(st),eu=Lo(it),tu=Lo(mt);function nu(e){return ui(e)?bt(Ii(e)):function(e){return function(t){return dr(t,e)}}(e)}var ru=xo(),ou=xo(!0);function iu(){return[]}function lu(){return!1}var au,uu=Ro(function(e,t){return e+t},0),su=ko("ceil"),cu=Ro(function(e,t){return e/t},1),du=ko("floor"),fu=Ro(function(e,t){return e*t},1),mu=ko("round"),vu=Ro(function(e,t){return e-t},0);return Dn.after=function(e,t){if("function"!=typeof t)throw new he(n);return e=oa(e),function(){if(--e<1)return t.apply(this,arguments)}},Dn.ary=hl,Dn.assign=sa,Dn.assignIn=ca,Dn.assignInWith=da,Dn.assignWith=fa,Dn.at=ma,Dn.before=El,Dn.bind=yl,Dn.bindAll=Ha,Dn.bindKey=_l,Dn.castArray=function(){if(!arguments.length)return[];var e=arguments[0];return Pl(e)?e:[e]},Dn.chain=nl,Dn.chunk=function(e,t,n){t=(n?ai(e,t,n):void 0===t)?1:ln(oa(t),0);var r=null==e?0:e.length;if(!r||t<1)return[];for(var o=0,i=0,l=q(Jt(r/t));o<r;)l[i++]=Wr(e,o,o+=t);return l},Dn.compact=function(e){for(var t=-1,n=null==e?0:e.length,r=0,o=[];++t<n;){var i=e[t];i&&(o[r++]=i)}return o},Dn.concat=function(){var e=arguments.length;if(!e)return[];for(var t=q(e-1),n=arguments[0],r=e;r--;)t[r-1]=arguments[r];return ct(Pl(n)?ho(n):[n],ir(t,1))},Dn.cond=function(e){var t=null==e?0:e.length,r=Yo();return e=t?st(e,function(e){if("function"!=typeof e[1])throw new he(n);return[r(e[0]),e[1]]}):[],Ur(function(n){for(var r=-1;++r<t;){var o=e[r];if(tt(o[0],this,n))return tt(o[1],this,n)}})},Dn.conforms=function(e){return function(e){var t=ba(e);return function(n){return Kn(n,e,t)}}(Yn(e,1))},Dn.constant=Wa,Dn.countBy=il,Dn.create=function(e,t){var n=Tn(e);return null==t?n:Gn(n,t)},Dn.curry=function e(t,n,r){var o=jo(t,8,void 0,void 0,void 0,void 0,void 0,n=r?void 0:n);return o.placeholder=e.placeholder,o},Dn.curryRight=function e(t,n,r){var o=jo(t,16,void 0,void 0,void 0,void 0,void 0,n=r?void 0:n);return o.placeholder=e.placeholder,o},Dn.debounce=bl,Dn.defaults=va,Dn.defaultsDeep=pa,Dn.defer=Cl,Dn.delay=Ol,Dn.difference=Ri,Dn.differenceBy=Li,Dn.differenceWith=Ai,Dn.drop=function(e,t,n){var r=null==e?0:e.length;return r?Wr(e,(t=n||void 0===t?1:oa(t))<0?0:t,r):[]},Dn.dropRight=function(e,t,n){var r=null==e?0:e.length;return r?Wr(e,0,(t=r-(t=n||void 0===t?1:oa(t)))<0?0:t):[]},Dn.dropRightWhile=function(e,t){return e&&e.length?eo(e,Yo(t,3),!0,!0):[]},Dn.dropWhile=function(e,t){return e&&e.length?eo(e,Yo(t,3),!0):[]},Dn.fill=function(e,t,n,r){var o=null==e?0:e.length;return o?(n&&"number"!=typeof n&&ai(e,t,n)&&(n=0,r=o),function(e,t,n,r){var o=e.length;for((n=oa(n))<0&&(n=-n>o?0:o+n),(r=void 0===r||r>o?o:oa(r))<0&&(r+=o),r=n>r?0:ia(r);n<r;)e[n++]=t;return e}(e,t,n,r)):[]},Dn.filter=function(e,t){return(Pl(e)?lt:or)(e,Yo(t,3))},Dn.flatMap=function(e,t){return ir(ml(e,t),1)},Dn.flatMapDeep=function(e,t){return ir(ml(e,t),1/0)},Dn.flatMapDepth=function(e,t,n){return n=void 0===n?1:oa(n),ir(ml(e,t),n)},Dn.flatten=Mi,Dn.flattenDeep=function(e){return null!=e&&e.length?ir(e,1/0):[]},Dn.flattenDepth=function(e,t){return null!=e&&e.length?ir(e,t=void 0===t?1:oa(t)):[]},Dn.flip=function(e){return jo(e,512)},Dn.flow=$a,Dn.flowRight=Ga,Dn.fromPairs=function(e){for(var t=-1,n=null==e?0:e.length,r={};++t<n;){var o=e[t];r[o[0]]=o[1]}return r},Dn.functions=function(e){return null==e?[]:cr(e,ba(e))},Dn.functionsIn=function(e){return null==e?[]:cr(e,Ca(e))},Dn.groupBy=cl,Dn.initial=function(e){return null!=e&&e.length?Wr(e,0,-1):[]},Dn.intersection=Ui,Dn.intersectionBy=Bi,Dn.intersectionWith=ji,Dn.invert=Ea,Dn.invertBy=ya,Dn.invokeMap=dl,Dn.iteratee=Za,Dn.keyBy=fl,Dn.keys=ba,Dn.keysIn=Ca,Dn.map=ml,Dn.mapKeys=function(e,t){var n={};return t=Yo(t,3),ur(e,function(e,r,o){qn(n,t(e,r,o),e)}),n},Dn.mapValues=function(e,t){var n={};return t=Yo(t,3),ur(e,function(e,r,o){qn(n,r,t(e,r,o))}),n},Dn.matches=function(e){return Ir(Yn(e,1))},Dn.matchesProperty=function(e,t){return Dr(e,Yn(t,1))},Dn.memoize=Sl,Dn.merge=Oa,Dn.mergeWith=Sa,Dn.method=Xa,Dn.methodOf=Ya,Dn.mixin=Ka,Dn.negate=wl,Dn.nthArg=function(e){return e=oa(e),Ur(function(t){return Rr(t,e)})},Dn.omit=wa,Dn.omitBy=function(e,t){return Ia(e,wl(Yo(t)))},Dn.once=function(e){return El(2,e)},Dn.orderBy=function(e,t,n,r){return null==e?[]:(Pl(t)||(t=null==t?[]:[t]),Pl(n=r?void 0:n)||(n=null==n?[]:[n]),Lr(e,t,n))},Dn.over=Qa,Dn.overArgs=Nl,Dn.overEvery=eu,Dn.overSome=tu,Dn.partial=Il,Dn.partialRight=Dl,Dn.partition=vl,Dn.pick=Na,Dn.pickBy=Ia,Dn.property=nu,Dn.propertyOf=function(e){return function(t){return null==e?void 0:dr(e,t)}},Dn.pull=Vi,Dn.pullAll=zi,Dn.pullAllBy=function(e,t,n){return e&&e.length&&t&&t.length?xr(e,t,Yo(n,2)):e},Dn.pullAllWith=function(e,t,n){return e&&e.length&&t&&t.length?xr(e,t,void 0,n):e},Dn.pullAt=Hi,Dn.range=ru,Dn.rangeRight=ou,Dn.rearg=Tl,Dn.reject=function(e,t){return(Pl(e)?lt:or)(e,wl(Yo(t,3)))},Dn.remove=function(e,t){var n=[];if(!e||!e.length)return n;var r=-1,o=[],i=e.length;for(t=Yo(t,3);++r<i;){var l=e[r];t(l,r,e)&&(n.push(l),o.push(r))}return Pr(e,o),n},Dn.rest=function(e,t){if("function"!=typeof e)throw new he(n);return Ur(e,t=void 0===t?t:oa(t))},Dn.reverse=Wi,Dn.sampleSize=function(e,t,n){return t=(n?ai(e,t,n):void 0===t)?1:oa(t),(Pl(e)?Fn:jr)(e,t)},Dn.set=function(e,t,n){return null==e?e:Fr(e,t,n)},Dn.setWith=function(e,t,n,r){return r="function"==typeof r?r:void 0,null==e?e:Fr(e,t,n,r)},Dn.shuffle=function(e){return(Pl(e)?Vn:Hr)(e)},Dn.slice=function(e,t,n){var r=null==e?0:e.length;return r?(n&&"number"!=typeof n&&ai(e,t,n)?(t=0,n=r):(t=null==t?0:oa(t),n=void 0===n?r:oa(n)),Wr(e,t,n)):[]},Dn.sortBy=pl,Dn.sortedUniq=function(e){return e&&e.length?Zr(e):[]},Dn.sortedUniqBy=function(e,t){return e&&e.length?Zr(e,Yo(t,2)):[]},Dn.split=function(e,t,n){return n&&"number"!=typeof n&&ai(e,t,n)&&(t=n=void 0),(n=void 0===n?4294967295:n>>>0)?(e=ua(e))&&("string"==typeof t||null!=t&&!Xl(t))&&!(t=Yr(t))&&kt(e)?uo(Ht(e),0,n):e.split(t,n):[]},Dn.spread=function(e,t){if("function"!=typeof e)throw new he(n);return t=null==t?0:ln(oa(t),0),Ur(function(n){var r=n[t],o=uo(n,0,t);return r&&ct(o,r),tt(e,this,o)})},Dn.tail=function(e){var t=null==e?0:e.length;return t?Wr(e,1,t):[]},Dn.take=function(e,t,n){return e&&e.length?Wr(e,0,(t=n||void 0===t?1:oa(t))<0?0:t):[]},Dn.takeRight=function(e,t,n){var r=null==e?0:e.length;return r?Wr(e,(t=r-(t=n||void 0===t?1:oa(t)))<0?0:t,r):[]},Dn.takeRightWhile=function(e,t){return e&&e.length?eo(e,Yo(t,3),!1,!0):[]},Dn.takeWhile=function(e,t){return e&&e.length?eo(e,Yo(t,3)):[]},Dn.tap=function(e,t){return t(e),e},Dn.throttle=function(e,t,r){var o=!0,i=!0;if("function"!=typeof e)throw new he(n);return Wl(r)&&(o="leading"in r?!!r.leading:o,i="trailing"in r?!!r.trailing:i),bl(e,t,{leading:o,maxWait:t,trailing:i})},Dn.thru=rl,Dn.toArray=na,Dn.toPairs=Da,Dn.toPairsIn=Ta,Dn.toPath=function(e){return Pl(e)?st(e,Ii):Jl(e)?[e]:ho(Ni(ua(e)))},Dn.toPlainObject=aa,Dn.transform=function(e,t,n){var r=Pl(e),o=r||Bl(e)||Ql(e);if(t=Yo(t,4),null==n){var i=e&&e.constructor;n=o?r?new i:[]:Wl(e)&&Vl(i)?Tn(We(e)):{}}return(o?rt:ur)(e,function(e,r,o){return t(n,e,r,o)}),n},Dn.unary=function(e){return hl(e,1)},Dn.union=$i,Dn.unionBy=Gi,Dn.unionWith=qi,Dn.uniq=function(e){return e&&e.length?Kr(e):[]},Dn.uniqBy=function(e,t){return e&&e.length?Kr(e,Yo(t,2)):[]},Dn.uniqWith=function(e,t){return t="function"==typeof t?t:void 0,e&&e.length?Kr(e,void 0,t):[]},Dn.unset=function(e,t){return null==e||Jr(e,t)},Dn.unzip=Zi,Dn.unzipWith=Xi,Dn.update=function(e,t,n){return null==e?e:Qr(e,t,io(n))},Dn.updateWith=function(e,t,n,r){return r="function"==typeof r?r:void 0,null==e?e:Qr(e,t,io(n),r)},Dn.values=Ra,Dn.valuesIn=function(e){return null==e?[]:Dt(e,Ca(e))},Dn.without=Yi,Dn.words=Va,Dn.wrap=function(e,t){return Il(io(t),e)},Dn.xor=Ki,Dn.xorBy=Ji,Dn.xorWith=Qi,Dn.zip=el,Dn.zipObject=function(e,t){return ro(e||[],t||[],Hn)},Dn.zipObjectDeep=function(e,t){return ro(e||[],t||[],Fr)},Dn.zipWith=tl,Dn.entries=Da,Dn.entriesIn=Ta,Dn.extend=ca,Dn.extendWith=da,Ka(Dn,Dn),Dn.add=uu,Dn.attempt=za,Dn.camelCase=La,Dn.capitalize=Aa,Dn.ceil=su,Dn.clamp=function(e,t,n){return void 0===n&&(n=t,t=void 0),void 0!==n&&(n=(n=la(n))==n?n:0),void 0!==t&&(t=(t=la(t))==t?t:0),Xn(la(e),t,n)},Dn.clone=function(e){return Yn(e,4)},Dn.cloneDeep=function(e){return Yn(e,5)},Dn.cloneDeepWith=function(e,t){return Yn(e,5,t="function"==typeof t?t:void 0)},Dn.cloneWith=function(e,t){return Yn(e,4,t="function"==typeof t?t:void 0)},Dn.conformsTo=function(e,t){return null==t||Kn(e,t,ba(t))},Dn.deburr=xa,Dn.defaultTo=function(e,t){return null==e||e!=e?t:e},Dn.divide=cu,Dn.endsWith=function(e,t,n){e=ua(e),t=Yr(t);var r=e.length,o=n=void 0===n?r:Xn(oa(n),0,r);return(n-=t.length)>=0&&e.slice(n,o)==t},Dn.eq=Rl,Dn.escape=function(e){return(e=ua(e))&&U.test(e)?e.replace(P,Pt):e},Dn.escapeRegExp=function(e){return(e=ua(e))&&$.test(e)?e.replace(W,"\\$&"):e},Dn.every=function(e,t,n){var r=Pl(e)?it:nr;return n&&ai(e,t,n)&&(t=void 0),r(e,Yo(t,3))},Dn.find=ll,Dn.findIndex=xi,Dn.findKey=function(e,t){return pt(e,Yo(t,3),ur)},Dn.findLast=al,Dn.findLastIndex=Pi,Dn.findLastKey=function(e,t){return pt(e,Yo(t,3),sr)},Dn.floor=du,Dn.forEach=ul,Dn.forEachRight=sl,Dn.forIn=function(e,t){return null==e?e:lr(e,Yo(t,3),Ca)},Dn.forInRight=function(e,t){return null==e?e:ar(e,Yo(t,3),Ca)},Dn.forOwn=function(e,t){return e&&ur(e,Yo(t,3))},Dn.forOwnRight=function(e,t){return e&&sr(e,Yo(t,3))},Dn.get=ga,Dn.gt=Ll,Dn.gte=Al,Dn.has=function(e,t){return null!=e&&ri(e,t,pr)},Dn.hasIn=ha,Dn.head=ki,Dn.identity=qa,Dn.includes=function(e,t,n,r){e=kl(e)?e:Ra(e),n=n&&!r?oa(n):0;var o=e.length;return n<0&&(n=ln(o+n,0)),Kl(e)?n<=o&&e.indexOf(t,n)>-1:!!o&&ht(e,t,n)>-1},Dn.indexOf=function(e,t,n){var r=null==e?0:e.length;if(!r)return-1;var o=null==n?0:oa(n);return o<0&&(o=ln(r+o,0)),ht(e,t,o)},Dn.inRange=function(e,t,n){return t=ra(t),void 0===n?(n=t,t=0):n=ra(n),function(e,t,n){return e>=an(t,n)&&e<ln(t,n)}(e=la(e),t,n)},Dn.invoke=_a,Dn.isArguments=xl,Dn.isArray=Pl,Dn.isArrayBuffer=Ml,Dn.isArrayLike=kl,Dn.isArrayLikeObject=Ul,Dn.isBoolean=function(e){return!0===e||!1===e||$l(e)&&mr(e)==a},Dn.isBuffer=Bl,Dn.isDate=jl,Dn.isElement=function(e){return $l(e)&&1===e.nodeType&&!Zl(e)},Dn.isEmpty=function(e){if(null==e)return!0;if(kl(e)&&(Pl(e)||"string"==typeof e||"function"==typeof e.splice||Bl(e)||Ql(e)||xl(e)))return!e.length;var t=ni(e);if(t==f||t==g)return!e.size;if(di(e))return!Sr(e).length;for(var n in e)if(Ce.call(e,n))return!1;return!0},Dn.isEqual=function(e,t){return _r(e,t)},Dn.isEqualWith=function(e,t,n){var r=(n="function"==typeof n?n:void 0)?n(e,t):void 0;return void 0===r?_r(e,t,void 0,n):!!r},Dn.isError=Fl,Dn.isFinite=function(e){return"number"==typeof e&&nn(e)},Dn.isFunction=Vl,Dn.isInteger=zl,Dn.isLength=Hl,Dn.isMap=Gl,Dn.isMatch=function(e,t){return e===t||br(e,t,Jo(t))},Dn.isMatchWith=function(e,t,n){return n="function"==typeof n?n:void 0,br(e,t,Jo(t),n)},Dn.isNaN=function(e){return ql(e)&&e!=+e},Dn.isNative=function(e){if(ci(e))throw new de("Unsupported core-js use. Try https://npms.io/search?q=ponyfill.");return Cr(e)},Dn.isNil=function(e){return null==e},Dn.isNull=function(e){return null===e},Dn.isNumber=ql,Dn.isObject=Wl,Dn.isObjectLike=$l,Dn.isPlainObject=Zl,Dn.isRegExp=Xl,Dn.isSafeInteger=function(e){return zl(e)&&e>=-9007199254740991&&e<=9007199254740991},Dn.isSet=Yl,Dn.isString=Kl,Dn.isSymbol=Jl,Dn.isTypedArray=Ql,Dn.isUndefined=function(e){return void 0===e},Dn.isWeakMap=function(e){return $l(e)&&ni(e)==y},Dn.isWeakSet=function(e){return $l(e)&&"[object WeakSet]"==mr(e)},Dn.join=function(e,t){return null==e?"":rn.call(e,t)},Dn.kebabCase=Pa,Dn.last=Fi,Dn.lastIndexOf=function(e,t,n){var r=null==e?0:e.length;if(!r)return-1;var o=r;return void 0!==n&&(o=(o=oa(n))<0?ln(r+o,0):an(o,r-1)),t==t?function(e,t,n){for(var r=n+1;r--;)if(e[r]===t)return r;return r}(e,t,o):gt(e,yt,o,!0)},Dn.lowerCase=Ma,Dn.lowerFirst=ka,Dn.lt=ea,Dn.lte=ta,Dn.max=function(e){return e&&e.length?rr(e,qa,vr):void 0},Dn.maxBy=function(e,t){return e&&e.length?rr(e,Yo(t,2),vr):void 0},Dn.mean=function(e){return _t(e,qa)},Dn.meanBy=function(e,t){return _t(e,Yo(t,2))},Dn.min=function(e){return e&&e.length?rr(e,qa,wr):void 0},Dn.minBy=function(e,t){return e&&e.length?rr(e,Yo(t,2),wr):void 0},Dn.stubArray=iu,Dn.stubFalse=lu,Dn.stubObject=function(){return{}},Dn.stubString=function(){return""},Dn.stubTrue=function(){return!0},Dn.multiply=fu,Dn.nth=function(e,t){return e&&e.length?Rr(e,oa(t)):void 0},Dn.noConflict=function(){return He._===this&&(He._=Ie),this},Dn.noop=Ja,Dn.now=gl,Dn.pad=function(e,t,n){e=ua(e);var r=(t=oa(t))?zt(e):0;if(!t||r>=t)return e;var o=(t-r)/2;return Ao(Qt(o),n)+e+Ao(Jt(o),n)},Dn.padEnd=function(e,t,n){e=ua(e);var r=(t=oa(t))?zt(e):0;return t&&r<t?e+Ao(t-r,n):e},Dn.padStart=function(e,t,n){e=ua(e);var r=(t=oa(t))?zt(e):0;return t&&r<t?Ao(t-r,n)+e:e},Dn.parseInt=function(e,t,n){return n||null==t?t=0:t&&(t=+t),sn(ua(e).replace(G,""),t||0)},Dn.random=function(e,t,n){if(n&&"boolean"!=typeof n&&ai(e,t,n)&&(t=n=void 0),void 0===n&&("boolean"==typeof t?(n=t,t=void 0):"boolean"==typeof e&&(n=e,e=void 0)),void 0===e&&void 0===t?(e=0,t=1):(e=ra(e),void 0===t?(t=e,e=0):t=ra(t)),e>t){var r=e;e=t,t=r}if(n||e%1||t%1){var o=cn();return an(e+o*(t-e+je("1e-"+((o+"").length-1))),t)}return Mr(e,t)},Dn.reduce=function(e,t,n){var r=Pl(e)?dt:Ot,o=arguments.length<3;return r(e,Yo(t,4),n,o,er)},Dn.reduceRight=function(e,t,n){var r=Pl(e)?ft:Ot,o=arguments.length<3;return r(e,Yo(t,4),n,o,tr)},Dn.repeat=function(e,t,n){return t=(n?ai(e,t,n):void 0===t)?1:oa(t),kr(ua(e),t)},Dn.replace=function(){var e=arguments,t=ua(e[0]);return e.length<3?t:t.replace(e[1],e[2])},Dn.result=function(e,t,n){var r=-1,o=(t=lo(t,e)).length;for(o||(o=1,e=void 0);++r<o;){var i=null==e?void 0:e[Ii(t[r])];void 0===i&&(r=o,i=n),e=Vl(i)?i.call(e):i}return e},Dn.round=mu,Dn.runInContext=e,Dn.sample=function(e){return(Pl(e)?jn:Br)(e)},Dn.size=function(e){if(null==e)return 0;if(kl(e))return Kl(e)?zt(e):e.length;var t=ni(e);return t==f||t==g?e.size:Sr(e).length},Dn.snakeCase=Ua,Dn.some=function(e,t,n){var r=Pl(e)?mt:$r;return n&&ai(e,t,n)&&(t=void 0),r(e,Yo(t,3))},Dn.sortedIndex=function(e,t){return Gr(e,t)},Dn.sortedIndexBy=function(e,t,n){return qr(e,t,Yo(n,2))},Dn.sortedIndexOf=function(e,t){var n=null==e?0:e.length;if(n){var r=Gr(e,t);if(r<n&&Rl(e[r],t))return r}return-1},Dn.sortedLastIndex=function(e,t){return Gr(e,t,!0)},Dn.sortedLastIndexBy=function(e,t,n){return qr(e,t,Yo(n,2),!0)},Dn.sortedLastIndexOf=function(e,t){if(null!=e&&e.length){var n=Gr(e,t,!0)-1;if(Rl(e[n],t))return n}return-1},Dn.startCase=Ba,Dn.startsWith=function(e,t,n){return e=ua(e),n=null==n?0:Xn(oa(n),0,e.length),t=Yr(t),e.slice(n,n+t.length)==t},Dn.subtract=vu,Dn.sum=function(e){return e&&e.length?St(e,qa):0},Dn.sumBy=function(e,t){return e&&e.length?St(e,Yo(t,2)):0},Dn.template=function(e,t,n){var r=Dn.templateSettings;n&&ai(e,t,n)&&(t=void 0),e=ua(e),t=da({},t,r,Fo);var o,i,l=da({},t.imports,r.imports,Fo),a=ba(l),u=Dt(l,a),s=0,c=t.interpolate||ue,d="__p += '",f=pe((t.escape||ue).source+"|"+c.source+"|"+(c===F?ee:ue).source+"|"+(t.evaluate||ue).source+"|$","g"),m="//# sourceURL="+(Ce.call(t,"sourceURL")?(t.sourceURL+"").replace(/\s/g," "):"lodash.templateSources["+ ++Me+"]")+"\n";e.replace(f,function(t,n,r,l,a,u){return r||(r=l),d+=e.slice(s,u).replace(se,Mt),n&&(o=!0,d+="' +\n__e("+n+") +\n'"),a&&(i=!0,d+="';\n"+a+";\n__p += '"),r&&(d+="' +\n((__t = ("+r+")) == null ? '' : __t) +\n'"),s=u+t.length,t}),d+="';\n";var v=Ce.call(t,"variable")&&t.variable;if(v){if(J.test(v))throw new de("Invalid `variable` option passed into `_.template`")}else d="with (obj) {\n"+d+"\n}\n";d=(i?d.replace(R,""):d).replace(L,"$1").replace(A,"$1;"),d="function("+(v||"obj")+") {\n"+(v?"":"obj || (obj = {});\n")+"var __t, __p = ''"+(o?", __e = _.escape":"")+(i?", __j = Array.prototype.join;\nfunction print() { __p += __j.call(arguments, '') }\n":";\n")+d+"return __p\n}";var p=za(function(){return fe(a,m+"return "+d).apply(void 0,u)});if(p.source=d,Fl(p))throw p;return p},Dn.times=function(e,t){if((e=oa(e))<1||e>9007199254740991)return[];var n=4294967295,r=an(e,4294967295);e-=4294967295;for(var o=wt(r,t=Yo(t));++n<e;)t(n);return o},Dn.toFinite=ra,Dn.toInteger=oa,Dn.toLength=ia,Dn.toLower=function(e){return ua(e).toLowerCase()},Dn.toNumber=la,Dn.toSafeInteger=function(e){return e?Xn(oa(e),-9007199254740991,9007199254740991):0===e?e:0},Dn.toString=ua,Dn.toUpper=function(e){return ua(e).toUpperCase()},Dn.trim=function(e,t,n){if((e=ua(e))&&(n||void 0===t))return Nt(e);if(!e||!(t=Yr(t)))return e;var r=Ht(e),o=Ht(t);return uo(r,Rt(r,o),Lt(r,o)+1).join("")},Dn.trimEnd=function(e,t,n){if((e=ua(e))&&(n||void 0===t))return e.slice(0,Wt(e)+1);if(!e||!(t=Yr(t)))return e;var r=Ht(e);return uo(r,0,Lt(r,Ht(t))+1).join("")},Dn.trimStart=function(e,t,n){if((e=ua(e))&&(n||void 0===t))return e.replace(G,"");if(!e||!(t=Yr(t)))return e;var r=Ht(e);return uo(r,Rt(r,Ht(t))).join("")},Dn.truncate=function(e,t){var n=30,r="...";if(Wl(t)){var o="separator"in t?t.separator:o;n="length"in t?oa(t.length):n,r="omission"in t?Yr(t.omission):r}var i=(e=ua(e)).length;if(kt(e)){var l=Ht(e);i=l.length}if(n>=i)return e;var a=n-zt(r);if(a<1)return r;var u=l?uo(l,0,a).join(""):e.slice(0,a);if(void 0===o)return u+r;if(l&&(a+=u.length-a),Xl(o)){if(e.slice(a).search(o)){var s,c=u;for(o.global||(o=pe(o.source,ua(te.exec(o))+"g")),o.lastIndex=0;s=o.exec(c);)var d=s.index;u=u.slice(0,void 0===d?a:d)}}else if(e.indexOf(Yr(o),a)!=a){var f=u.lastIndexOf(o);f>-1&&(u=u.slice(0,f))}return u+r},Dn.unescape=function(e){return(e=ua(e))&&k.test(e)?e.replace(x,$t):e},Dn.uniqueId=function(e){var t=++Oe;return ua(e)+t},Dn.upperCase=ja,Dn.upperFirst=Fa,Dn.each=ul,Dn.eachRight=sl,Dn.first=ki,Ka(Dn,(au={},ur(Dn,function(e,t){Ce.call(Dn.prototype,t)||(au[t]=e)}),au),{chain:!1}),Dn.VERSION="4.17.21",rt(["bind","bindKey","curry","curryRight","partial","partialRight"],function(e){Dn[e].placeholder=Dn}),rt(["drop","take"],function(e,t){An.prototype[e]=function(n){n=void 0===n?1:ln(oa(n),0);var r=this.__filtered__&&!t?new An(this):this.clone();return r.__filtered__?r.__takeCount__=an(n,r.__takeCount__):r.__views__.push({size:an(n,4294967295),type:e+(r.__dir__<0?"Right":"")}),r},An.prototype[e+"Right"]=function(t){return this.reverse()[e](t).reverse()}}),rt(["filter","map","takeWhile"],function(e,t){var n=t+1,r=1==n||3==n;An.prototype[e]=function(e){var t=this.clone();return t.__iteratees__.push({iteratee:Yo(e,3),type:n}),t.__filtered__=t.__filtered__||r,t}}),rt(["head","last"],function(e,t){var n="take"+(t?"Right":"");An.prototype[e]=function(){return this[n](1).value()[0]}}),rt(["initial","tail"],function(e,t){var n="drop"+(t?"":"Right");An.prototype[e]=function(){return this.__filtered__?new An(this):this[n](1)}}),An.prototype.compact=function(){return this.filter(qa)},An.prototype.find=function(e){return this.filter(e).head()},An.prototype.findLast=function(e){return this.reverse().find(e)},An.prototype.invokeMap=Ur(function(e,t){return"function"==typeof e?new An(this):this.map(function(n){return Er(n,e,t)})}),An.prototype.reject=function(e){return this.filter(wl(Yo(e)))},An.prototype.slice=function(e,t){e=oa(e);var n=this;return n.__filtered__&&(e>0||t<0)?new An(n):(e<0?n=n.takeRight(-e):e&&(n=n.drop(e)),void 0!==t&&(n=(t=oa(t))<0?n.dropRight(-t):n.take(t-e)),n)},An.prototype.takeRightWhile=function(e){return this.reverse().takeWhile(e).reverse()},An.prototype.toArray=function(){return this.take(4294967295)},ur(An.prototype,function(e,t){var n=/^(?:filter|find|map|reject)|While$/.test(t),r=/^(?:head|last)$/.test(t),o=Dn[r?"take"+("last"==t?"Right":""):t],i=r||/^find/.test(t);o&&(Dn.prototype[t]=function(){var t=this.__wrapped__,l=r?[1]:arguments,a=t instanceof An,u=l[0],s=a||Pl(t),c=function(e){var t=o.apply(Dn,ct([e],l));return r&&d?t[0]:t};s&&n&&"function"==typeof u&&1!=u.length&&(a=s=!1);var d=this.__chain__,f=!!this.__actions__.length,m=i&&!d,v=a&&!f;if(!i&&s){t=v?t:new An(this);var p=e.apply(t,l);return p.__actions__.push({func:rl,args:[c],thisArg:void 0}),new Ln(p,d)}return m&&v?e.apply(this,l):(p=this.thru(c),m?r?p.value()[0]:p.value():p)})}),rt(["pop","push","shift","sort","splice","unshift"],function(e){var t=Ee[e],n=/^(?:push|sort|unshift)$/.test(e)?"tap":"thru",r=/^(?:pop|shift)$/.test(e);Dn.prototype[e]=function(){var e=arguments;if(r&&!this.__chain__){var o=this.value();return t.apply(Pl(o)?o:[],e)}return this[n](function(n){return t.apply(Pl(n)?n:[],e)})}}),ur(An.prototype,function(e,t){var n=Dn[t];if(n){var r=n.name+"";Ce.call(yn,r)||(yn[r]=[]),yn[r].push({name:t,func:n})}}),yn[Do(void 0,2).name]=[{name:"wrapper",func:void 0}],An.prototype.clone=function(){var e=new An(this.__wrapped__);return e.__actions__=ho(this.__actions__),e.__dir__=this.__dir__,e.__filtered__=this.__filtered__,e.__iteratees__=ho(this.__iteratees__),e.__takeCount__=this.__takeCount__,e.__views__=ho(this.__views__),e},An.prototype.reverse=function(){if(this.__filtered__){var e=new An(this);e.__dir__=-1,e.__filtered__=!0}else(e=this.clone()).__dir__*=-1;return e},An.prototype.value=function(){var e=this.__wrapped__.value(),t=this.__dir__,n=Pl(e),r=t<0,o=n?e.length:0,i=function(e,t,n){for(var r=-1,o=n.length;++r<o;){var i=n[r],l=i.size;switch(i.type){case"drop":e+=l;break;case"dropRight":t-=l;break;case"take":t=an(t,e+l);break;case"takeRight":e=ln(e,t-l)}}return{start:e,end:t}}(0,o,this.__views__),l=i.start,a=i.end,u=a-l,s=r?a:l-1,c=this.__iteratees__,d=c.length,f=0,m=an(u,this.__takeCount__);if(!n||!r&&o==u&&m==u)return to(e,this.__actions__);var v=[];e:for(;u--&&f<m;){for(var p=-1,g=e[s+=t];++p<d;){var h=c[p],E=h.type,y=(0,h.iteratee)(g);if(2==E)g=y;else if(!y){if(1==E)continue e;break e}}v[f++]=g}return v},Dn.prototype.at=ol,Dn.prototype.chain=function(){return nl(this)},Dn.prototype.commit=function(){return new Ln(this.value(),this.__chain__)},Dn.prototype.next=function(){void 0===this.__values__&&(this.__values__=na(this.value()));var e=this.__index__>=this.__values__.length;return{done:e,value:e?void 0:this.__values__[this.__index__++]}},Dn.prototype.plant=function(e){for(var t,n=this;n instanceof Rn;){var r=Ti(n);r.__index__=0,r.__values__=void 0,t?o.__wrapped__=r:t=r;var o=r;n=n.__wrapped__}return o.__wrapped__=e,t},Dn.prototype.reverse=function(){var e=this.__wrapped__;if(e instanceof An){var t=e;return this.__actions__.length&&(t=new An(this)),(t=t.reverse()).__actions__.push({func:rl,args:[Wi],thisArg:void 0}),new Ln(t,this.__chain__)}return this.thru(Wi)},Dn.prototype.toJSON=Dn.prototype.valueOf=Dn.prototype.value=function(){return to(this.__wrapped__,this.__actions__)},Dn.prototype.first=Dn.prototype.head,Ct&&(Dn.prototype[Ct]=function(){return this}),Dn}();$e?(($e.exports=Gt)._=Gt,We._=Gt):He._=Gt}).call(M)});const U=["digit-ui","works-ui","workbench-ui","health-ui","sanitation-ui","core-ui","mgramseva-web"],B=(e,t)=>{if("object"!=typeof e||null===e)return null;const n=Object.keys(e).map(n=>{var r,o,i,l,a;return"string"==typeof(null===(r=e[n])||void 0===r||null===(o=r.item)||void 0===o?void 0:o.path)?(null===(i=e[n])||void 0===i||null===(l=i.item)||void 0===l||null===(a=l.path)||void 0===a?void 0:a.split(t?`${t}.${n}`:"."+n))||B(e[n],n):null});return null==n?void 0:n[0]},j=function(e){var t,n,r;void 0===e&&(e="");const o=null===(t=e)||void 0===t?void 0:t.split(".");return null!==(n=e)&&void 0!==n&&null!==(r=n.endsWith)&&void 0!==r&&r.call(n,".")?o[0]:o[(null==o?void 0:o.length)-1]},F=e=>{let{data:i}=e;const{t:l}=o.useTranslation(),u=a.useHistory(),[c,d]=n.useState({}),[f,m]=n.useState(null),[v,p]=n.useState(null),[g,h]=n.useState(null),[E,y]=n.useState(!1),_={home:r.createElement(t.HomeIcon,null),announcement:r.createElement(t.ComplaintIcon,null),business:r.createElement(t.BPAHomeIcon,null),store:r.createElement(t.PropertyHouse,null),assignment:r.createElement(t.CaseIcon,null),receipt:r.createElement(t.ReceiptIcon,null),"business-center":r.createElement(t.PersonIcon,null),description:r.createElement(t.DocumentIconSolid,null),"water-tap":r.createElement(t.DropIcon,null),"collections-bookmark":r.createElement(t.CollectionsBookmarIcons,null),"insert-chart":r.createElement(t.FinanceChartIcon,null),edcr:r.createElement(t.CollectionIcon,null),collections:r.createElement(t.CollectionIcon,null)};function b(e){void 0===e&&(e={});for(const i in e){const l=e[i];var t,n,r,o;if("item"===i&&""!==(null==l?void 0:l.leftIcon))return{iconKey:null==l||null===(t=l.leftIcon)||void 0===t||null===(n=t.split(":"))||void 0===n?void 0:n[0],iconName:null==l||null===(r=l.leftIcon)||void 0===r||null===(o=r.split(":"))||void 0===o?void 0:o[1]};if("object"==typeof e[i]&&!Array.isArray(e[i])){const t=b(e[i]);if(t)return t}}return null}const C=function(e,n,o,i){void 0===n&&(n=null),void 0===o&&(o=!0),void 0===i&&(i=0);const a=Object.values(e).sort((e,t)=>{var n,r;return null!=e&&e.item&&null!=t&&t.item?(null==e||null===(n=e.item)||void 0===n?void 0:n.orderNumber)-(null==t||null===(r=t.item)||void 0===r?void 0:r.orderNumber):(null==e?void 0:e[0])<(null==t?void 0:t[0])?-1:(null==e?void 0:e[0])>(null==t?void 0:t[0])?1:0}).map(e=>{var t,n,r;return(null==e||null===(t=e.item)||void 0===t?void 0:t.path)&&j(null==e||null===(n=e.item)||void 0===n?void 0:n.path)||j(null===(r=B(e))||void 0===r?void 0:r[0])});return r.createElement("div",{className:"submenu-container level-"+i},a.map((a,y)=>{const O=e[a],S=O?"item"===Object.keys(O)[0]:null,w=c[a]||!1;var N=n?""+n:a;const I=null==a?void 0:a.replace(/[ -]/g,"_"),D=l(Digit.Utils.locale.getTransformedLocale("ACTION_TEST_"+I)),T=l((null==D?void 0:D.length)>20?D.substring(0,20)+"...":D);if(!S&&O&&Object.keys(O).length>0){const{iconKey:e,iconName:n}=b(O)||{};let u=_[n]||_.collections;var R,L,A;"dynamic"===e&&(u=(k=null===(R=require("@egovernments/digit-ui-react-components"))||void 0===R?void 0:R[n])?r.createElement(k,null):u),"svg"===e&&(u=(k=null===(L=require("@egovernments/digit-ui-react-components"))||void 0===L||null===(A=L.SVG)||void 0===A?void 0:A[n])?r.createElement(k,{fill:"white"}):u);const c=f===N,v=g===T;return r.createElement("div",{key:y,className:`sidebar-link level-${i} ${c?"select-level":""}`,style:{display:"flex",flexDirection:"column",alignItems:"flex-start"}},r.createElement("div",{className:"actions "+(v&&1===i?"selected-action-level-1":c?`default-${i} active`:"default-"+i),onClick:e=>{(e=>{d(t=>({...t,[e]:!t[e]}))})(a),m(e=>e===N?null:N);const t=e.target.innerText;h(e=>e===t||w?null:t),p(null)},style:{display:"flex",flexDirection:"row",width:"100%"}},o&&r.createElement("div",{className:"link-icon"},u),r.createElement("div",{"data-tip":"React-tooltip","data-for":"jk-side-"+a},r.createElement("span",null," ",T," "),(null==T?void 0:T.includes("..."))&&r.createElement(s,{textColor:"white",backgroundColor:"grey",place:"right",type:"info",effect:"solid",id:"jk-side-"+a},l(Digit.Utils.locale.getTransformedLocale("ACTION_TEST_"+a)))),r.createElement("div",{style:{position:"relative",marginLeft:"auto"},className:`arrow ${v&&1===i?"selected-arrow":""} `},w?r.createElement(t.ArrowVectorDown,{height:"28px",width:"28px"}):r.createElement(t.ArrowForward,null))),E&&r.createElement("div",{style:{width:"100%"}},w&&C(O,N,!1,i+1)))}if(S){const{iconName:e,iconKey:t}=b(O)||{};let c=_[e]||_.collections;var x,P,M,k;return"dynamic"===t&&(c=(k=null===(x=require("@egovernments/digit-ui-react-components"))||void 0===x?void 0:x[e])?r.createElement(k,null):c),"svg"===t&&(c=(k=null===(P=require("@egovernments/digit-ui-react-components"))||void 0===P||null===(M=P.SVG)||void 0===M?void 0:M[e])?r.createElement(k,{fill:"white"}):c),r.createElement("a",{key:y,className:`dropdown-link new-dropdown-link ${v===O.item.path?"active":""} level-${i}`,onClick:()=>{var e;const t=O.item.path;m(n),p(t),h(null),function(e,t){var n,r;if(void 0===e&&(e={}),void 0===t&&(t=""),-1===(null===(n=t)||void 0===n?void 0:n.indexOf("/"+(null===(r=window)||void 0===r?void 0:r.contextPath)))){const e=window.location.origin,n=null!=U&&U.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)}(u,""+(null==O||null===(e=O.item)||void 0===e?void 0:e.navigationURL))}},r.createElement("div",{className:`actions level-${i} ${"Home"===T?"custom":""}`,"data-tip":"React-tooltip","data-for":"jk-side-"+a},o&&r.createElement("div",{className:"link-icon"},c),r.createElement("span",null," ",T," "),(null==T?void 0:T.includes("..."))&&r.createElement(s,{textColor:"white",backgroundColor:"grey",place:"right",type:"info",effect:"solid",id:"jk-side-"+a},l(Digit.Utils.locale.getTransformedLocale("ACTION_TEST_"+a)))))}}))};return r.createElement("div",{className:"new-sidebar "+(c?"show":""),onMouseEnter:()=>{y(!0)},onMouseLeave:()=>{y(!1),d({}),m(null),p(null),h(null)}},C(i))},V=function(e,t){return void 0===e&&(e=""),void 0===t&&(t=""),e.toLowerCase().includes(t.toLowerCase())},z=()=>{const e=n.useRef(null),{isLoading:i,data:l}=Digit.Hooks.useAccessControl(),[a,u]=n.useState(""),{t:s}=o.useTranslation(),[c,d]=n.useState(!1);n.useEffect(()=>{if(i)return r.createElement(t.Loader,null);e.current.style.cursor="pointer",f()},[i]);const f=()=>{e.current.style.width="60px",e.current.style.overflow="hidden",d(!1)};function m(e,t){for(const n in t)t.hasOwnProperty(n)&&("object"!=typeof t[n]||Array.isArray(t[n])?e[n]||(e[n]=t[n]):(e[n]||(e[n]={}),m(e[n],t[n])))}const v={};return null==l||l.actions.filter(e=>"url"===e.url).forEach(e=>{var t,n,r;let o=(null==e||null===(t=e.path)||void 0===t||null===(n=t.split("."))||void 0===n?void 0:n[0])||"";if(""==a&&""!==e.path){const t=e.path.split(".");let n={};t.reduce((n,r,o)=>{if(o!==t.length-1)return n[r]={},n[r];n[r]={item:e}},n),m(v,n)}else if(V(s("ACTION_TEST_"+(null==o||null===(r=o.toUpperCase())||void 0===r?void 0:r.replace(/[ -]/g,"_"))),a)||V(s(Digit.Utils.locale.getTransformedLocale("ACTION_TEST_"+(null==e?void 0:e.displayName))),a)){const t=e.path.split(".");let n={};t.reduce((n,r,o)=>{if(o!==t.length-1)return n[r]={},n[r];n[r]={item:e}},n),m(v,n)}}),i?r.createElement(t.Loader,null):v?r.createElement("div",{className:"sidebar",ref:e,onMouseOver:()=>{e.current.style.width="260px",d(!0)},onMouseLeave:f},r.createElement("div",{className:""},r.createElement("div",{className:"sidebar-link"},c?r.createElement("div",{className:"actions search-icon-wrapper"},r.createElement("input",{className:"employee-search-input nav-bar",type:"text",placeholder:s("ACTION_TEST_SEARCH"),name:"search",value:a,onChange:e=>u(e.target.value)}),r.createElement(t.SearchIcon,{className:"search-icon"})):r.createElement("div",{className:"actions search-icon-wrapper-new"},r.createElement(t.SearchIcon,{className:"search-icon"})))),(e=>{const t=Object.entries(e);t.sort((e,t)=>e[0]<t[0]?-1:e[0]>t[0]?1:0);const n=Object.fromEntries(t);return r.createElement(F,{data:e=n})})(v)):""},H=e=>{let{CITIZEN:t,isSidebarOpen:n,toggleSidebar:o,handleLogout:i,mobileView:l,userDetails:a,modules:u,linkData:s,islinkDataLoading:c}=e;return t?r.createElement(P,{isOpen:n,isMobile:!0,toggleSidebar:o,onLogout:i,linkData:s,islinkDataLoading:c}):!n&&null!=a&&a.access_token?r.createElement("div",{className:"digit-employeeSidebar"},r.createElement(z,{mobileView:l,userDetails:a,modules:u})):r.createElement("div",{className:"digit-citizenSidebar"},r.createElement(P,{isOpen:n,isMobile:!0,toggleSidebar:o,onLogout:i,isEmployee:!0}))},W=e=>{let{t:t,stateInfo:o,userDetails:i,CITIZEN:l,cityDetails:u,mobileView:s,handleUserDropdownSelection:c,logoUrl:d,showSidebar:f=!0,showLanguageChange:m,linkData:v,islinkDataLoading:p}=e;const[g,h]=n.useState(!1),E=a.useHistory(),[y,_]=n.useState(!1),b=()=>{h(!1),_(!0)},C=()=>{_(!1)},O=()=>{h(!g)},w=[{name:t("EDIT_PROFILE"),icon:"Edit",func:()=>{var e;E.push(`/${null===(e=window)||void 0===e?void 0:e.contextPath}/employee/user/profile`)}},{name:t("CORE_COMMON_LOGOUT"),icon:"Logout",func:b}];return r.createElement(r.Fragment,null,r.createElement(S,{t:t,stateInfo:o,toggleSidebar:O,isSidebarOpen:g,handleLogout:b,userDetails:i,CITIZEN:l,cityDetails:u,mobileView:s,userOptions:w,handleUserDropdownSelection:c,logoUrl:d,showLanguageChange:m}),y&&r.createElement(D,{onSelect:()=>{Digit.UserService.logout(),_(!1)},onCancel:C,onDismiss:C}),f&&r.createElement(H,{t:t,CITIZEN:l,isSidebarOpen:g,toggleSidebar:O,handleLogout:b,mobileView:s,userDetails:i,linkData:v,islinkDataLoading:p}))},$=e=>{const{question:i,answer:l,lastIndex:a}=e,[u,s]=n.useState(!1),{t:c}=o.useTranslation();return r.createElement("div",{className:"faqs border-none",onClick:()=>s(!u)},r.createElement("div",{className:"faq-question",style:{justifyContent:"space-between",display:"flex"}},r.createElement("span",null,c(i)),r.createElement("span",{className:u?"faqicon rotate":"faqicon",style:{float:"right"}},r.createElement(t.ArrowForward,null))),r.createElement("div",{className:"faq-answer",style:u?{display:"block"}:{display:"none"}},r.createElement("span",null,c(l))),a?null:r.createElement("div",{className:"cs-box-border"}))},G=e=>{var i,l,a;let{module:u}=e;const s=Digit.UserService.getUser(),{t:c}=((null==s||null===(i=s.info)||void 0===i?void 0:i.tenantId)||Digit.ULBService.getCurrentTenantId(),o.useTranslation()),{isLoading:d,data:f}=Digit.Hooks.useGetFAQsJSON(Digit.ULBService.getStateId()),m=null==f||null===(l=f.MdmsRes["common-masters"])||void 0===l||null===(a=l.faqs[0])||void 0===a?void 0:a[""+u].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"}},c("FAQ_S"))),r.createElement("div",{className:"faq-list"},m.map((e,t)=>r.createElement($,{key:"faq_"+t,question:e.question,answer:e.answer,lastIndex:t===(null==m?void 0:m.length)-1})))))},q=()=>{var e,n,i,l,u,s,c,d,f,m,v,p,g,h,E,y,_,b,C,O,S,w,N;const{t:D}=o.useTranslation(),T=a.useHistory(),R=Digit.ULBService.getCitizenCurrentTenant(!0),{data:{uiHomePage:L}={},isLoading:A}=Digit.Hooks.useStore.getInitData();let x=window.Digit.Utils.browser.isMobile();const P=()=>{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:M,isLoading:k}=Digit.Hooks.useEvents({tenantId:R,variant:"whats-new",config:{enabled:P()}});var U;R||T.push(`/${null===(U=window)||void 0===U?void 0:U.contextPath}/citizen/select-language`);const B=null==L?void 0:L.appBannerDesktop,j=null==L?void 0:L.appBannerMobile,F=null==L?void 0:L.citizenServicesCard,V=null==L?void 0:L.informationAndUpdatesCard,z=null==L?void 0:L.whatsAppBannerDesktop,H=null==L?void 0:L.whatsAppBannerMobile,W=null==L?void 0:L.whatsNewSection,$=null==L?void 0:L.redirectURL;var G,q;$&&T.push(`/${null===(G=window)||void 0===G?void 0:G.contextPath}/citizen/${$}`),null!==(e=window)&&void 0!==e&&null!==(n=e.location)&&void 0!==n&&null!==(i=n.href)&&void 0!==i&&null!==(l=i.includes)&&void 0!==l&&l.call(i,"sanitation-ui")&&T.push(`/${null===(q=window)||void 0===q?void 0:q.contextPath}/citizen/all-services`);const Z=e=>{window.open(null==e?void 0:e.navigationUrl)},X={header:D(null==F?void 0:F.headerLabel),sideOption:{name:D(null==F||null===(u=F.sideOption)||void 0===u?void 0:u.name),onClick:()=>{var e;return T.push(null==F||null===(e=F.sideOption)||void 0===e?void 0:e.navigationUrl)}},options:[{name:D(null==F||null===(s=F.props)||void 0===s||null===(c=s[0])||void 0===c?void 0:c.label),Icon:r.createElement(t.ComplaintIcon,null),onClick:()=>{var e,t;return T.push(null==F||null===(e=F.props)||void 0===e||null===(t=e[0])||void 0===t?void 0:t.navigationUrl)}},{name:D(null==F||null===(d=F.props)||void 0===d||null===(f=d[1])||void 0===f?void 0:f.label),Icon:r.createElement(t.PTIcon,{className:"fill-path-primary-main"}),onClick:()=>{var e,t;return T.push(null==F||null===(e=F.props)||void 0===e||null===(t=e[1])||void 0===t?void 0:t.navigationUrl)}},{name:D(null==F||null===(m=F.props)||void 0===m||null===(v=m[2])||void 0===v?void 0:v.label),Icon:r.createElement(t.CaseIcon,{className:"fill-path-primary-main"}),onClick:()=>{var e,t;return T.push(null==F||null===(e=F.props)||void 0===e||null===(t=e[2])||void 0===t?void 0:t.navigationUrl)}},{name:D(null==F||null===(p=F.props)||void 0===p||null===(g=p[3])||void 0===g?void 0:g.label),Icon:r.createElement(t.OBPSIcon,null),onClick:()=>{var e,t;return T.push(null==F||null===(e=F.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===(h=V.sideOption)||void 0===h?void 0:h.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===(E=V.props)||void 0===E||null===(y=E[0])||void 0===y?void 0:y.label),Icon:r.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===(_=V.props)||void 0===_||null===(b=_[1])||void 0===b?void 0:b.label),Icon:r.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===(C=V.props)||void 0===C||null===(O=C[2])||void 0===O?void 0:O.label),Icon:r.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===(S=V.props)||void 0===S||null===(w=S[3])||void 0===w?void 0:w.label),Icon:r.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 A?r.createElement(t.Loader,null):r.createElement("div",{className:"HomePageContainer"},r.createElement("div",{className:"HomePageWrapper"},r.createElement("div",{className:"BannerWithSearch"},r.createElement("img",x?{src:null==j?void 0:j.bannerUrl}:{src:null==B?void 0:B.bannerUrl}),r.createElement("div",{className:"ServicesSection"},r.createElement(t.CardBasedOptions,I({style:{marginTop:"-30px"}},X)),r.createElement(t.CardBasedOptions,I({style:x?{}:{marginTop:"-30px"}},Y)))),(H||z)&&r.createElement("div",{className:"WhatsAppBanner"},r.createElement("img",x?{src:null==H?void 0:H.bannerUrl,onClick:()=>Z(H)}:{src:null==z?void 0:z.bannerUrl,onClick:()=>Z(z)})),P()?k?r.createElement(t.Loader,null):r.createElement("div",{className:"WhatsNewSection"},r.createElement("div",{className:"headSection"},r.createElement("h2",null,D(null==W?void 0:W.headerLabel)),r.createElement("p",{onClick:()=>{var e;return T.push(null==W||null===(e=W.sideOption)||void 0===e?void 0:e.navigationUrl)}},D(null==W||null===(N=W.sideOption)||void 0===N?void 0:N.name))),r.createElement(t.WhatsNewCard,null==M?void 0:M[0])):null))},Z=()=>{const{t:e}=o.useTranslation(),i=a.useHistory(),{data:{languages:l,stateInfo:u}={},isLoading:s}=Digit.Hooks.useStore.getInitData(),c=Digit.StoreData.getCurrentLanguage(),d=n.useMemo(()=>({header:e("CS_COMMON_CHOOSE_LANGUAGE"),submitBarLabel:e("CORE_COMMON_CONTINUE")}),[e]),f=n.useMemo(()=>({options:l,optionsKey:"label",additionalWrapperClass:"digit-reverse-radio-selection-wrapper",onSelect:e=>Digit.LocalizationService.changeLanguage(e.value,u.code),selectedOption:null==l?void 0:l.filter(e=>e.value===c)[0]}),[c,l]);return s?r.createElement(t.Loader,null):r.createElement("div",{className:"selection-card-wrapper"},r.createElement(t.PageBasedInput,{texts:d,onSubmit:function(){var e;i.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,f)))},X=()=>{const{t:e}=o.useTranslation(),i=a.useHistory(),l=a.useLocation(),{data:u,isLoading:s}=Digit.Hooks.useTenants(),[c,d]=n.useState(()=>({code:Digit.ULBService.getCitizenCurrentTenant(!0)})),[f,m]=n.useState(!1),v=n.useMemo(()=>({header:e("CS_COMMON_CHOOSE_LOCATION"),submitBarLabel:e("CORE_COMMON_CONTINUE")}),[e]);function p(e){d(e),m(!1)}const g=n.useMemo(()=>({options:u,optionsKey:"i18nKey",additionalWrapperClass:"digit-reverse-radio-selection-wrapper",onSelect:p,selectedOption:c}),[u,e,c]);return s?r.createElement("loader",null):r.createElement("div",{className:"selection-card-wrapper"},r.createElement(t.BackButton,null),r.createElement(t.PageBasedInput,{texts:v,onSubmit:function(){if(c){var e,t;Digit.SessionStorage.set("CITIZEN.COMMON.HOME.CITY",c);const n=null===(e=l.state)||void 0===e?void 0:e.redirectBackTo;n?i.replace(n):i.push(`/${null===(t=window)||void 0===t?void 0:t.contextPath}/citizen`)}else m(!0)},className:"location-selection-container"},r.createElement(t.CardHeader,null,e("CS_COMMON_CHOOSE_LOCATION")),r.createElement(t.SearchOnRadioButtons,I({},g,{placeholder:e("COMMON_TABLE_SEARCH")})),f?r.createElement(t.CardLabelError,null,e("CS_COMMON_LOCATION_SELECTION_ERROR")):null))},Y=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{K(r,1,e(this.v))}catch(e){K(r,2,e)}return r}return this}return this.o=function(e){try{const o=e.v;1&e.s?K(r,1,t?t(o):o):n?K(r,1,n(o)):K(r,2,o)}catch(e){K(r,2,e)}},r},e}();function K(e,t,n){if(!e.s){if(n instanceof Y){if(!n.s)return void(n.o=K.bind(null,e,t));1&t&&(t=n.s),n=n.v}if(n&&n.then)return void n.then(K.bind(null,e,t),K.bind(null,e,2));e.s=t,e.v=n;const r=e.o;r&&r(e)}}function J(e){return e instanceof Y&&1&e.s}const Q="undefined"!=typeof Symbol?Symbol.iterator||(Symbol.iterator=Symbol("Symbol.iterator")):"@@iterator";function ee(e,t,n){if("function"==typeof e[Q]){var r,o,i,l=e[Q]();if(function e(a){try{for(;!((r=l.next()).done||n&&n());)if((a=t(r.value))&&a.then){if(!J(a))return void a.then(e,i||(i=K.bind(null,o=new Y,2)));a=a.v}o?K(o,1,a):o=a}catch(e){K(o||(o=new Y),2,e)}}(),l.return){var a=function(e){try{r.done||l.return()}catch(e){}return e};if(o&&o.then)return o.then(a,function(e){throw a(e)});a()}return o}if(!("length"in e))throw new TypeError("Object is not iterable");for(var u=[],s=0;s<e.length;s++)u.push(e[s]);return function(e,t,n){var r,o,i=-1;return function l(a){try{for(;++i<e.length&&(!n||!n());)if((a=t(i))&&a.then){if(!J(a))return void a.then(l,o||(o=K.bind(null,r=new Y,2)));a=a.v}r?K(r,1,a):r=a}catch(e){K(r||(r=new Y),2,e)}}(),r}(u,function(e){return t(u[e])},n)}function te(e,t){try{var n=e()}catch(e){return t(e)}return n&&n.then?n.then(void 0,t):n}function ne(e){let{setProfilePic:i,closeDrawer:l,userType:a,removeProfilePic:u,showToast:s}=e;const[c,d]=n.useState(null),[f,m]=n.useState(""),[v,p]=n.useState(null),{t:g}=o.useTranslation();return n.useEffect(()=>{!function(){try{p(null);const e=function(){if(f){const e=function(){if(f.size>=1e6)s("error",g("CORE_COMMON_PROFILE_MAXIMUM_UPLOAD_SIZE_EXCEEDED")),p(g("CORE_COMMON_PROFILE_MAXIMUM_UPLOAD_SIZE_EXCEEDED"));else{const e=te(function(){return Promise.resolve(Digit.UploadServices.Filestorage(a+"-profile",f,Digit.ULBService.getStateId())).then(function(e){var t,n;if((null==e||null===(t=e.data)||void 0===t||null===(n=t.files)||void 0===n?void 0:n.length)>0){var r,o;const t=null==e||null===(r=e.data)||void 0===r||null===(o=r.files[0])||void 0===o?void 0:o.fileStoreId;d(t),i(t)}else s("error",g("CORE_COMMON_PROFILE_FILE_UPLOAD_ERROR")),p(g("CORE_COMMON_PROFILE_FILE_UPLOAD_ERROR"))})},function(){s("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)}}()},[f]),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(t.GalleryIcon,null)),r.createElement("label",{style:{cursor:"pointer"}}," Gallery"),r.createElement("input",{type:"file",id:"file",accept:"image/*, .png, .jpeg, .jpg",onChange:e=>m(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:()=>{u(),l()}},r.createElement(t.RemoveIcon,null)),r.createElement("label",{style:{cursor:"pointer"}},"Remove"))))}"undefined"!=typeof Symbol&&(Symbol.asyncIterator||(Symbol.asyncIterator=Symbol("Symbol.asyncIterator")));const re=e=>{var i,l,u,s,c,d,f,m,v,p,g;let{stateCode:h,userType:E,cityDetails:y}=e;a.useHistory();const{t:_}=o.useTranslation(),b=window.location.href,C=Digit.ULBService.getStateId(),O=Digit.ULBService.getCurrentTenantId(),S=(null===(i=Digit.UserService.getUser())||void 0===i?void 0:i.info)||{},[w,N]=n.useState(null),[D,T]=n.useState(null!=S&&S.name?S.name:""),[R,L]=n.useState(null!=S&&S.emailId?S.emailId:""),[A,x]=n.useState(null==w?void 0:w.gender),[P,M]=n.useState(null!=S&&S.permanentCity?S.permanentCity:y.name),[k,U]=n.useState(null!=S&&S.mobileNumber?S.mobileNumber:""),[B,j]=n.useState(null),[F,V]=n.useState(""),[z,H]=n.useState(!1),[W,$]=n.useState(!1),[G,q]=n.useState(""),[Z,X]=n.useState(""),[Y,K]=n.useState(""),[J,Q]=n.useState(null),[ee,re]=n.useState(!1),[oe,ie]=r.useState(window.innerWidth),[le,ae]=r.useState({}),ue=window.Digit.Utils.browser.isMobile();r.useEffect(()=>(window.addEventListener("resize",()=>ie(window.innerWidth)),()=>{window.removeEventListener("resize",()=>ie(window.innerWidth))})),n.useEffect(()=>{var e;re(!0),function(){try{const e=null==S?void 0:S.uuid,t=function(){if(e)return Promise.resolve(Digit.UserService.userSearch(O,{uuid:[e]},{})).then(function(e){e&&e.user&&e.user.length&&N(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==w?void 0:w.gender,value:null==w?void 0:w.gender});const t=null==w||null===(e=w.photo)||void 0===e?void 0:e.split(",");V(null==t?void 0:t.at(0)),re(!1)},[null!==w]);let se={};const ce=e=>x(e),de=()=>H(!1),fe=e=>{T(e),!new RegExp(/^[a-zA-Z ]+$/i).test(e)||0===e.length||e.length>50?ae({...le,userName:{type:"pattern",message:"CORE_COMMON_PROFILE_NAME_INVALID"}}):ae({...le,userName:null})},me=e=>{(null==S?void 0:S.userName)!==e?(L(e),!e.length||e.includes("@")&&e.includes(".")?ae({...le,emailAddress:null}):ae({...le,emailAddress:{type:"pattern",message:"CORE_COMMON_PROFILE_EMAIL_INVALID"}})):ae({...le,emailAddress:null})},ve=function(e,t,n){void 0===n&&(n=5e3),Q({key:e,action:t}),setTimeout(()=>{Q(null)},n)},pe=function(){try{let t=!1;function e(e){if(t)return e;re(!1)}re(!0);const n=te(function(){const e={...S,name:D,gender:null==A?void 0:A.value,emailId:R,photo:B};if(!new RegExp(/^([a-zA-Z ])*$/).test(D)||""===D||D.length>50||D.length<1)throw JSON.stringify({type:"error",message:_("CORE_COMMON_PROFILE_NAME_INVALID")});if("employee"===E&&!new RegExp(/^[6-9]{1}[0-9]{9}$/).test(k))throw JSON.stringify({type:"error",message:_("CORE_COMMON_PROFILE_MOBILE_NUMBER_INVALID")});if(R.length&&(!R.includes("@")||!R.includes(".")))throw JSON.stringify({type:"error",message:_("CORE_COMMON_PROFILE_EMAIL_INVALID")});if(W&&(G.length||Z.length||Y.length)){if(Z!==Y)throw JSON.stringify({type:"error",message:_("CORE_COMMON_PROFILE_PASSWORD_MISMATCH")});if(!(G.length&&Z.length&&Y.length))throw JSON.stringify({type:"error",message:_("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(Y))throw JSON.stringify({type:"error",message:_("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:D,mobileNumber:k,emailId:R,permanentCity:P}})}return function(){if(G.length&&Z.length&&Y.length){const e={existingPassword:G,newPassword:Z,tenantId:O,type:"EMPLOYEE",username:null==S?void 0:S.userName,confirmPassword:Y};return function(){if(Z===Y)return te(function(){return Promise.resolve(Digit.UserService.changePassword(e,O)).then(function(e){const{responseInfo:t}=e;if(null==t||!t.status||"200"!==t.status)throw"";ve("success",_("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&&ve("success",_("CORE_COMMON_PROFILE_UPDATE_SUCCESS"),5e3)}()})},function(e){const t=JSON.parse(e);ve(t.type,_(t.message),5e3)});return Promise.resolve(n&&n.then?n.then(e):e(n))}catch(e){return Promise.reject(e)}};let ge=[];const{data:he}=Digit.Hooks.useGenderMDMS(C,"common-masters","GenderType");return he&&he.map(e=>{ge.push({i18nKey:"PT_COMMON_GENDER_"+e.code,code:""+e.code,value:""+e.code})}),ee?r.createElement(t.Loader,null):r.createElement("div",{className:"user-profile"},r.createElement("section",{style:{margin:"citizen"===E||ue?"8px":"24px"}},"citizen"===E||ue?r.createElement(t.BackButton,null):r.createElement(t.BreadCrumb,{crumbs:[{path:`/${null===(l=window)||void 0===l?void 0:l.contextPath}/employee`,content:_("ES_COMMON_HOME"),show:!0},{path:`/${null===(u=window)||void 0===u?void 0:u.contextPath}/employee/user/profile`,content:_("ES_COMMON_PAGE_1"),show:b.includes("/user/profile")}]})),r.createElement("div",{style:{display:"flex",flex:1,flexDirection:oe<768||"citizen"===E?"column":"row",margin:"citizen"===E?"8px":"16px",gap:"citizen"===E?"":"0 24px",boxShadow:"citizen"===E?"1px 1px 4px 0px rgba(0,0,0,0.2)":"",background:"citizen"===E?"white":"",borderRadius:"citizen"===E?"4px":"",maxWidth:"citizen"===E?"960px":""}},r.createElement("section",{style:{position:"relative",display:"flex",flex:"citizen"===E?1:2.5,justifyContent:"center",alignItems:"center",maxWidth:"100%",height:"376px",borderRadius:"4px",boxShadow:"citizen"===E?"":"1px 1px 4px 0px rgba(0,0,0,0.2)",border:("citizen"===E?"8px":"24px")+" solid #fff",background:"#EEEEEE",padding:"citizen"===E?"8px":"16px"}},r.createElement("div",{style:{position:"relative",height:"citizen"===E?"114px":"150px",width:"citizen"===E?"114px":"150px",margin:"16px"}},r.createElement("img",{style:{margin:"auto",borderRadius:"300px",justifyContent:"center",height:"100%",width:"100%"},src:F&&""!==F?F:"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:()=>H(!z)},r.createElement(t.CameraIcon,null)))),r.createElement("section",{style:{display:"flex",flexDirection:"column",flex:"citizen"===E?1:7.5,width:"100%",borderRadius:"4px",height:"fit-content",boxShadow:"citizen"===E?"":"1px 1px 4px 0px rgba(0,0,0,0.2)",background:"white",padding:"citizen"===E?"8px":"24px",paddingBottom:"20px"}},"citizen"===E?r.createElement(r.Fragment,null,r.createElement(t.LabelFieldPair,null,r.createElement(t.CardLabel,{style:{}},""+_("CORE_COMMON_PROFILE_NAME"),"*"),r.createElement("div",{style:{width:"100%",maxWidth:"960px"}},r.createElement(t.TextInput,I({t:_,style:{width:"100%"},type:"text",isMandatory:!1,name:"name",value:D,onChange:e=>fe(e.target.value)},se={isRequired:!0,pattern:"^[a-zA-Z-.`' ]*$",type:"tel",title:_("CORE_COMMON_PROFILE_NAME_ERROR_MESSAGE")},{disable:!1})),(null==le?void 0:le.userName)&&r.createElement(t.CardLabelError,null," ",_(null==le||null===(s=le.userName)||void 0===s?void 0:s.message)," "))),r.createElement(t.LabelFieldPair,null,r.createElement(t.CardLabel,{style:{}},""+_("CORE_COMMON_PROFILE_GENDER")),r.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:ge,select:ce,value:A,optionKey:"code",t:_,name:"gender"})),r.createElement(t.LabelFieldPair,null,r.createElement(t.CardLabel,{style:{}},""+_("CORE_COMMON_PROFILE_EMAIL")),r.createElement("div",{style:{width:"100%"}},r.createElement(t.TextInput,{t:_,style:{width:"100%"},type:"email",isMandatory:!1,optionKey:"i18nKey",name:"email",value:R,onChange:e=>me(e.target.value),disabled:!1}),(null==le?void 0:le.emailAddress)&&r.createElement(t.CardLabelError,null," ",_(null==le||null===(c=le.emailAddress)||void 0===c?void 0:c.message)," "))),r.createElement("button",{onClick:pe,style:{marginTop:"24px",backgroundColor:"#F47738",width:"100%",height:"40px",color:"white",maxWidth:ue?"100%":"240px",borderBottom:"1px solid black"}},_("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"}},""+_("CORE_COMMON_PROFILE_NAME"),"*"),r.createElement("div",{style:{width:"100%"}},r.createElement(t.TextInput,I({t:_,type:"text",isMandatory:!1,name:"name",value:D,onChange:e=>fe(e.target.value),placeholder:"Enter Your Name"},se={isRequired:!0,pattern:"^[a-zA-Z-.`' ]*$",type:"text",title:_("CORE_COMMON_PROFILE_NAME_ERROR_MESSAGE")},{disabled:!1})),(null==le?void 0:le.userName)&&r.createElement(t.CardLabelError,{style:{margin:0,padding:0}}," ",_(null==le||null===(d=le.userName)||void 0===d?void 0:d.message)," "))),r.createElement(t.LabelFieldPair,{style:{display:"flex"}},r.createElement(t.CardLabel,{className:"profile-label-margin",style:{width:"300px"}},""+_("CORE_COMMON_PROFILE_GENDER")),r.createElement("div",{style:{width:"100%"}},r.createElement(t.Dropdown,{selected:1===(null==A?void 0:A.length)?A[0]:A,disable:1===(null==A?void 0:A.length)||!1,option:ge,select:ce,value:A,optionKey:"code",t:_,name:"gender"}))),r.createElement(t.LabelFieldPair,{style:{display:"flex"}},r.createElement(t.CardLabel,{className:"profile-label-margin",style:{width:"300px"}},""+_("CORE_COMMON_PROFILE_CITY")),r.createElement("div",{style:{width:"100%"}},r.createElement(t.TextInput,I({t:_,type:"text",isMandatory:!1,name:"city",value:_(Digit.Utils.locale.getTransformedLocale("TENANT_TENANTS_"+O)),onChange:e=>M(e.target.value),placeholder:"Enter Your City Name"},se={isRequired:!0,type:"text",title:_("CORE_COMMON_PROFILE_CITY_ERROR_MESSAGE")},{disabled:!0})),r.createElement(t.CardLabelError,null))),r.createElement(t.LabelFieldPair,{style:{display:"flex"}},r.createElement(t.CardLabel,{className:"profile-label-margin",style:{width:"300px"}},_("CORE_COMMON_PROFILE_MOBILE_NUMBER")+"*"),r.createElement("div",{style:{width:"100%"}},r.createElement(t.MobileNumber,{value:k,style:{width:"100%"},name:"mobileNumber",placeholder:"Enter a valid Mobile No.",onChange:e=>(e=>{U(e),"employee"!==E||new RegExp(/^[6-9]{1}[0-9]{9}$/).test(e)?ae({...le,mobileNumber:null}):ae({...le,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:_("CORE_COMMON_PROFILE_MOBILE_NUMBER_INVALID")}),(null==le?void 0:le.mobileNumber)&&r.createElement(t.CardLabelError,{style:{margin:0,padding:0}}," ",_(null==le||null===(f=le.mobileNumber)||void 0===f?void 0:f.message)," "))),r.createElement(t.LabelFieldPair,{style:{display:"flex"}},r.createElement(t.CardLabel,{className:"profile-label-margin",style:{width:"300px"}},""+_("CORE_COMMON_PROFILE_EMAIL")),r.createElement("div",{style:{width:"100%"}},r.createElement(t.TextInput,{t:_,type:"email",isMandatory:!1,placeholder:_("EMAIL_VALIDATION"),optionKey:"i18nKey",name:"email",value:R,onChange:e=>me(e.target.value),disabled:!1}),(null==le?void 0:le.emailAddress)&&r.createElement(t.CardLabelError,null," ",_(null==le||null===(m=le.emailAddress)||void 0===m?void 0:m.message)," "))),r.createElement(t.LabelFieldPair,null,r.createElement("div",{style:{width:"100%"}},0==W?r.createElement("a",{style:{color:"orange",cursor:"default",marginBottom:"5",cursor:"pointer"},onClick:()=>$(!W)},_("CORE_COMMON_CHANGE_PASSWORD")):null,W?r.createElement("div",{style:{marginTop:"10px"}},r.createElement(t.LabelFieldPair,{style:{display:"flex"}},r.createElement(t.CardLabel,{className:"profile-label-margin",style:{width:"300px"}},""+_("CORE_COMMON_PROFILE_CURRENT_PASSWORD")),r.createElement("div",{style:{width:"100%"}},r.createElement(t.TextInput,{t:_,type:"password",isMandatory:!1,name:"name",pattern:"^([a-zA-Z0-9@#$%])+$",onChange:e=>{return q(t=e.target.value),void(new RegExp(/^([a-zA-Z0-9@#$%]{8,15})$/i).test(t)?ae({...le,currentPassword:null}):ae({...le,currentPassword:{type:"pattern",message:"CORE_COMMON_PROFILE_PASSWORD_INVALID"}}));var t},disabled:!1}),(null==le?void 0:le.currentPassword)&&r.createElement(t.CardLabelError,null,_(null==le||null===(v=le.currentPassword)||void 0===v?void 0:v.message)))),r.createElement(t.LabelFieldPair,{style:{display:"flex"}},r.createElement(t.CardLabel,{className:"profile-label-margin",style:{width:"300px"}},""+_("CORE_COMMON_PROFILE_NEW_PASSWORD")),r.createElement("div",{style:{width:"100%"}},r.createElement(t.TextInput,{t:_,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)?ae({...le,newPassword:null}):ae({...le,newPassword:{type:"pattern",message:"CORE_COMMON_PROFILE_PASSWORD_INVALID"}}));var t},disabled:!1}),(null==le?void 0:le.newPassword)&&r.createElement(t.CardLabelError,null,_(null==le||null===(p=le.newPassword)||void 0===p?void 0:p.message)))),r.createElement(t.LabelFieldPair,{style:{display:"flex"}},r.createElement(t.CardLabel,{className:"profile-label-margin",style:{width:"300px"}},""+_("CORE_COMMON_PROFILE_CONFIRM_PASSWORD")),r.createElement("div",{style:{width:"100%"}},r.createElement(t.TextInput,{t:_,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)?ae({...le,confirmPassword:null}):ae({...le,confirmPassword:{type:"pattern",message:"CORE_COMMON_PROFILE_PASSWORD_INVALID"}}));var t},disabled:!1}),(null==le?void 0:le.confirmPassword)&&r.createElement(t.CardLabelError,null,_(null==le||null===(g=le.confirmPassword)||void 0===g?void 0:g.message))))):"")),"employee"===E&&ue?r.createElement("button",{onClick:pe,style:{marginTop:"24px",backgroundColor:"#F47738",width:"100%",height:"40px",color:"white",maxWidth:ue?"100%":"240px",borderBottom:"1px solid black",fontWeight:"700",fontSize:"17px"}},_("CORE_COMMON_SAVE")):null))),"employee"!==E||ue?null:r.createElement("div",{className:"action-bar-wrap"},r.createElement(t.SubmitBar,{t:_,label:_("CORE_COMMON_SAVE"),onSubmit:pe})),J&&r.createElement(t.Toast,{type:J.key,label:_("success"===J.key?"CORE_COMMON_PROFILE_UPDATE_SUCCESS":J.action),onClose:()=>Q(null),style:{maxWidth:"670px"}}),1==z?r.createElement(ne,{setProfilePic:function(e){try{function t(e){V(null==e?void 0:e.thumbs[0]),de()}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],C)).then(t):t(null))}catch(e){return Promise.reject(e)}},closeDrawer:de,userType:E,removeProfilePic:()=>{j(null),V(null)},showToast:ve}):"")},oe=e=>{var i,l,a;let{module:s}=e;const c=Digit.UserService.getUser(),{t:d}=((null==c||null===(i=c.info)||void 0===i?void 0:i.tenantId)||Digit.ULBService.getCurrentTenantId(),o.useTranslation()),f=Digit.SessionStorage.get("initData").stateInfo,m=Digit.StoreData.getCurrentLanguage(),[v,p]=n.useState(m),[g,h]=n.useState(!1),[E,y]=n.useState(""),_=()=>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:b,data:C}=Digit.Hooks.useGetHowItWorksJSON(Digit.ULBService.getStateId()),O=null==C||null===(l=C.MdmsRes["common-masters"])||void 0===l||null===(a=l.howItWorks[0])||void 0===a?void 0:a[""+s];return b?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(u.CustomButton,{selected:e.value===v,text:e.label,onClick:()=>(e=>{p(e.value),Digit.LocalizationService.changeLanguage(e.value,f.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,y("hi_IN"===v?t.hi_IN:t.en_IN),void h(!0);var t}},r.createElement("div",{className:"vid-svg"},r.createElement(_,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:()=>{h(!1)}})),r.createElement("video",{width:500,height:500,controls:!0,autoPlay:!0},r.createElement("source",{src:E,type:"video/mp4"})))))},ie=[{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}}]}],le=e=>{let{t:n,onSelect:o,mobileNumber:i,onMobileChange:l,config:a,canSubmit:u}=e;return r.createElement(t.FormStep,{isDisabled:!(10===i.length&&u),onSelect:o,config:a,t:n,componentInFront:"+91",onChange:l,value:i})},ae=e=>{let{config:n,onSelect:o,t:i,isDisabled:l}=e;return r.createElement(t.FormStep,{config:n,onSelect:o,t:i,isDisabled:l})};function ue(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 se=e=>{let{config:o,otp:i,onOtpChange:l,onResend:a,onSelect:u,t:s,error:c,userType:d="citizen",canSubmit:f}=e;const[m,v]=n.useState(30);ue(()=>{v(m-1)},m>0?1e3:null);const p=()=>{a(),v(2)};return"employee"===d?r.createElement(n.Fragment,null,r.createElement(t.OTPInput,{length:6,onChange:l,value:i}),m>0?r.createElement(t.CardText,null,`${s("CS_RESEND_ANOTHER_OTP")} ${m} ${s("CS_RESEND_SECONDS")}`):r.createElement("p",{className:"card-text-button resend-otp",onClick:p},s("CS_RESEND_OTP")),!c&&r.createElement(t.CardLabelError,null,s("CS_INVALID_OTP"))):r.createElement(t.FormStep,{onSelect:u,config:o,t:s,isDisabled:!(6===(null==i?void 0:i.length)&&f)},r.createElement(t.OTPInput,{length:6,onChange:l,value:i}),m>0?r.createElement(t.CardText,null,`${s("CS_RESEND_ANOTHER_OTP")} ${m} ${s("CS_RESEND_SECONDS")}`):r.createElement("p",{className:"card-text-button",onClick:p},s("CS_RESEND_OTP")),!c&&r.createElement(t.CardLabelError,null,s("CS_INVALID_OTP")))};var ce;const de={type:"register"},fe={type:"login"},me=`/${null===(ce=window)||void 0===ce?void 0:ce.contextPath}/citizen`,ve=(e,t)=>(null==e?void 0:e.from)||(null==t?void 0:t.from)||me,pe=e=>{var i,l;let{stateCode:u,isUserRegistered:s=!0}=e;const{t:c}=o.useTranslation(),d=a.useLocation(),{path:f}=a.useRouteMatch(),m=a.useHistory(),[v,p]=n.useState(null),[g,h]=n.useState(null),[E,y]=n.useState(!0),[_,b]=n.useState(null),[C,O]=n.useState(s?{}:null==d||null===(i=d.state)||void 0===i?void 0:i.data),[S,w]=n.useState(null),N=Digit.Hooks.useQueryParams(),[I,D]=n.useState(!1),[T,R]=n.useState(!0),[L,A]=n.useState(!0);n.useEffect(()=>{let e;return g&&(S&&(clearTimeout(S),w(null)),e=setTimeout(()=>{h("")},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 i=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",i),localStorage.setItem("Citizen.locale",i),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,u);const t=(null===(e=d.state)||void 0===e?void 0:e.from)||me;var n;Digit.ULBService.getCitizenCurrentTenant(!0)?m.replace(t):m.replace(`/${null===(n=window)||void 0===n?void 0:n.contextPath}/citizen/select-location`,{redirectBackTo:t})},[v]);const x=n.useMemo(()=>ie.map(e=>{const t={};for(const n in e.texts)t[n]=c(e.texts[n]);return{...e,texts:t}},[ie])),P=()=>Digit.UserService.getType(),M=function(e){return Promise.resolve(te(function(){return Promise.resolve(Digit.UserService.sendOtp(e,u)).then(function(e){return[e,null]})},function(e){return[null,e]}))};return r.createElement("div",{className:"citizen-form-wrapper"},r.createElement(a.Switch,null,r.createElement(t.AppContainer,null,r.createElement(t.BackButton,null),r.createElement(a.Route,{path:""+f,exact:!0},r.createElement(le,{onSelect:function(e){try{A(!1),O({...C,...e});const t={...e,tenantId:u,userType:P()};return Promise.resolve(s?Promise.resolve(M({otp:{...t,...fe}})).then(function(e){var n;let[r,o]=e;var i,l,a;if(!o)return A(!0),void m.replace(f+"/otp",{from:ve(d.state,N),role:null===(i=d.state)||void 0===i?void 0:i.role});A(!0),d.state&&"FSM_DSO"===d.state.role||m.push(`/${null===(l=window)||void 0===l?void 0:l.contextPath}/citizen/register/name`,{from:ve(d.state,N),data:t}),null!==(n=d.state)&&void 0!==n&&n.role&&(A(!0),h("FSM_DSO"===(null===(a=d.state)||void 0===a?void 0:a.role)?c("ES_ERROR_DSO_LOGIN"):"User not registered."))}):Promise.resolve(M({otp:{...t,...de}})).then(function(e){let[t,n]=e;if(!n)return A(!0),void m.replace(f+"/otp",{from:ve(d.state,N)});A(!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:L,showRegisterLink:s&&!(null!==(l=d.state)&&void 0!==l&&l.role),t:c})),r.createElement(a.Route,{path:f+"/otp"},r.createElement(se,{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:u,userType:P()},n=function(){if(!s)return Promise.resolve(M({otp:{...t,...de}})).then(function(){});{const e=function(){if(s)return Promise.resolve(M({otp:{...t,...fe}})).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(te(function(){y(!0),R(!1);const{mobileNumber:e,otp:t,name:n}=C;return function(){if(s){const n={username:e,password:t,tenantId:u,userType:P()};return Promise.resolve(Digit.UserService.authenticate(n)).then(function(e){var t,n,r;let{UserRequest:o,...i}=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 h(c("ES_ERROR_USER_NOT_PERMITTED")),void setTimeout(()=>m.replace(me),5e3)}null!==(n=window)&&void 0!==n&&null!==(r=n.globalConfigs)&&void 0!==r&&r.getConfig("ENABLE_SINGLEINSTANCE")&&(o.tenantId=Digit.ULBService.getStateId()),p({info:o,...i})})}{const r=function(){if(!s)return Promise.resolve(Digit.UserService.registerUser({name:n,username:e,otpReference:t,tenantId:u},u)).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()),p({info:r,...o})})}();if(r&&r.then)return r.then(function(){})}}()},function(){R(!0),y(!1)}))}catch(e){return Promise.reject(e)}},otp:C.otp,error:E,canSubmit:T,t:c})),r.createElement(a.Route,{path:f+"/name"},r.createElement(ae,{config:x[2],onSelect:function(e){try{const t={...C,tenantId:u,userType:P(),...e};return O({...C,...e}),D(!0),Promise.resolve(M({otp:{...t,...de}})).then(function(e){let[t,n]=e;t?(D(!1),m.replace(f+"/otp",{from:ve(d.state,N)})):D(!1)})}catch(e){return Promise.reject(e)}},t:c,isDisabled:I})),g&&r.createElement(t.Toast,{type:"error",label:g,onClose:()=>h(null)}))))};var ge=e=>e instanceof HTMLElement;const he={onBlur:"onBlur",onChange:"onChange",onSubmit:"onSubmit",onTouched:"onTouched",all:"all"};var Ee=e=>null==e;const ye=e=>"object"==typeof e;var _e=e=>!Ee(e)&&!Array.isArray(e)&&ye(e)&&!(e instanceof Date),be=e=>/^\w*$/.test(e),Ce=e=>e.filter(Boolean),Oe=e=>Ce(e.replace(/["|']/g,"").replace(/\[/g,".").replace(/\]/g,"").split("."));function Se(e,t,n){let r=-1;const o=be(t)?[t]:Oe(t),i=o.length,l=i-1;for(;++r<i;){const t=o[r];let i=n;if(r!==l){const n=e[t];i=_e(n)||Array.isArray(n)?n:isNaN(+o[r+1])?{}:[]}e[t]=i,e=e[t]}return e}var we=function(e,t){void 0===t&&(t={});for(const n in e)be(n)?t[n]=e[n]:Se(t,n,e[n]);return t},Ne=e=>void 0===e,Ie=function(e,t,n){void 0===e&&(e={});const r=Ce(t.split(/[,[\].]+?/)).reduce((e,t)=>Ee(e)?e:e[t],e);return Ne(r)||r===e?Ne(e[t])?n:e[t]:r},De=(e,t)=>{ge(e)&&e.removeEventListener&&(e.removeEventListener("input",t),e.removeEventListener("change",t),e.removeEventListener("blur",t))};const Te={isValid:!1,value:null};var Re=e=>Array.isArray(e)?e.reduce((e,t)=>t&&t.ref.checked?{isValid:!0,value:t.ref.value}:e,Te):Te,Le=e=>"radio"===e.type,Ae=e=>"file"===e.type,xe=e=>"checkbox"===e.type,Pe=e=>"select-multiple"===e.type;const Me={value:!1,isValid:!1},ke={value:!0,isValid:!0};var Ue=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&&!Ne(r.value)?Ne(n)||""===n?ke:{value:n,isValid:!0}:ke:Me}return Me};function Be(e,t,n,r,o){const i=e.current[t];if(i){const{ref:{value:e,disabled:t},ref:n,valueAsNumber:a,valueAsDate:u,setValueAs:s}=i;if(t&&r)return;return Ae(n)?n.files:Le(n)?Re(i.options).value:Pe(n)?(l=n.options,[...l].filter(e=>{let{selected:t}=e;return t}).map(e=>{let{value:t}=e;return t})):xe(n)?Ue(i.options).value:o?e:a?""===e?NaN:+e:u?n.valueAsDate:s?s(e):e}var l;if(n)return Ie(n.current,t)}function je(e){return!e||e instanceof HTMLElement&&e.nodeType!==Node.DOCUMENT_NODE&&je(e.parentNode)}var Fe=e=>_e(e)&&!Object.keys(e).length,Ve=e=>"boolean"==typeof e;function ze(e,t){const n=be(t)?[t]:Oe(t),r=1==n.length?e:function(e,t){const n=t.slice(0,-1).length;let r=0;for(;r<n;)e=Ne(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,i=-1;const l=n.slice(0,-(t+1)),a=l.length-1;for(t>0&&(o=e);++i<l.length;){const t=l[i];r=r?r[t]:e[t],a===i&&(_e(r)&&Fe(r)||Array.isArray(r)&&!r.filter(e=>_e(e)&&!Fe(e)||Ve(e)).length)&&(o?delete o[t]:delete e[t]),o=r}}return e}const He=(e,t)=>e&&e.ref===t;var We=e=>Ee(e)||!ye(e);function $e(e,t){if(We(e)||We(t))return t;for(const n in t){const r=e[n],o=t[n];try{e[n]=_e(r)&&_e(o)||Array.isArray(r)&&Array.isArray(o)?$e(r,o):o}catch(e){}}return e}function Ge(e,t,r){if(We(e)||We(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((_e(n)||Array.isArray(n))&&(_e(e)||Array.isArray(e))?!Ge(n,e,r):n!==e)return!1}}}return!0}function qe(e,t,n,r,o){let i=-1;for(;++i<e.length;){for(const r in e[i])Array.isArray(e[i][r])?(!n[i]&&(n[i]={}),n[i][r]=[],qe(e[i][r],Ie(t[i]||{},r,[]),n[i][r],n[i],r)):Ge(Ie(t[i]||{},r),e[i][r])?Se(n[i]||{},r):n[i]=Object.assign(Object.assign({},n[i]),{[r]:!0});r&&!n.length&&delete r[o]}return n}var Ze=e=>"string"==typeof e,Xe=(e,t,n,r,o)=>{const i={};for(const t in e.current)(Ne(o)||(Ze(o)?t.startsWith(o):Array.isArray(o)&&o.find(e=>t.startsWith(e))))&&(i[t]=Be(e,t,void 0,r));return n?we(i):$e(t,we(i))},Ye=e=>e instanceof RegExp,Ke=e=>_e(e)&&!Ye(e)?e:{value:e,message:""},Je=e=>"function"==typeof e,Qe=e=>Ze(e)||n.isValidElement(e);function et(e,t,n){if(void 0===n&&(n="validate"),Qe(e)||Ve(e)&&!e)return{type:n,message:Qe(e)?e:"",ref:t}}var tt=(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})}):{},nt=function(e,t,n,r){let{ref:o,ref:{value:i},options:l,required:a,maxLength:u,minLength:s,min:c,max:d,pattern:f,validate:m}=n;try{let n=!1;const v=o.name,p={},g=Le(o),h=xe(o),E=g||h,y=""===i,_=tt.bind(null,v,t,p),b=function(e,t,n,r,i){void 0===r&&(r="maxLength"),void 0===i&&(i="minLength");const l=e?t:n;p[v]=Object.assign({type:e?r:i,message:l,ref:o},_(e?r:i,l))};if(a&&(!g&&!h&&(y||Ee(i))||Ve(i)&&!i||h&&!Ue(l).isValid||g&&!Re(l).isValid)){const{value:n,message:r}=Qe(a)?{value:!!a,message:a}:Ke(a);if(n&&(p[v]=Object.assign({type:"required",message:r,ref:E?((e.current[v].options||[])[0]||{}).ref:o},_("required",r)),!t))return Promise.resolve(p)}if(!(Ee(c)&&Ee(d)||""===i)){let e,n;const r=Ke(d),l=Ke(c);if(isNaN(i)){const t=o.valueAsDate||new Date(i);Ze(r.value)&&(e=t>new Date(r.value)),Ze(l.value)&&(n=t<new Date(l.value))}else{const t=o.valueAsNumber||parseFloat(i);Ee(r.value)||(e=t>r.value),Ee(l.value)||(n=t<l.value)}if((e||n)&&(b(!!e,r.message,l.message,"max","min"),!t))return Promise.resolve(p)}if(Ze(i)&&!y&&(u||s)){const e=Ke(u),n=Ke(s),r=!Ee(e.value)&&i.length>e.value,o=!Ee(n.value)&&i.length<n.value;if((r||o)&&(b(r,e.message,n.message),!t))return Promise.resolve(p)}if(Ze(i)&&f&&!y){const{value:e,message:n}=Ke(f);if(Ye(e)&&!e.test(i)&&(p[v]=Object.assign({type:"pattern",message:n,ref:o},_("pattern",n)),!t))return Promise.resolve(p)}const C=function(){if(m){const i=Be(e,v,r,!1,!0),a=E&&l?l[0].ref:o;return Je(m)?Promise.resolve(m(i)).then(function(e){const r=et(e,a);if(r&&(p[v]=Object.assign(Object.assign({},r),_("validate",r.message)),!t))return n=!0,p}):function(){if(_e(m)){let r=!1;function e(){if(!Fe(o)&&(p[v]=Object.assign({ref:a},o),!t))return n=!0,p}let o={};const l=ee(Object.entries(m),function(e){let[n,l]=e;if(Fe(o)||t)return Promise.resolve(l(i)).then(function(e){const r=et(e,a,n);r&&(o=Object.assign(Object.assign({},r),_(n,r.message)),t&&(p[v]=o))});r=!0},function(){return r});return l&&l.then?l.then(e):e()}}()}}();return Promise.resolve(C&&C.then?C.then(function(e){return n?e:p}):n?C:p)}catch(e){return Promise.reject(e)}};const rt=function(e,t,n){void 0===n&&(n=[]);for(const r in t){const o=e+(_e(t)?"."+r:`[${r}]`);We(t[r])?n.push(o):rt(o,t[r],n)}return n};var ot=(e,t,n,r,o)=>{let i=void 0;return n.add(t),Fe(e)||(i=Ie(e,t),(_e(i)||Array.isArray(i))&&rt(t,i).forEach(e=>n.add(e))),Ne(i)?o?r:Ie(r,t):i},it=e=>{let{isOnBlur:t,isOnChange:n,isOnTouch:r,isTouched:o,isReValidateOnBlur:i,isReValidateOnChange:l,isBlurEvent:a,isSubmitted:u,isOnAll:s}=e;return!s&&(!u&&r?!(o||a):(u?i:t)?!a:!(u?l:n)||a)},lt=e=>e.substring(0,e.indexOf("[")),at=(e,t)=>[...e].some(e=>((e,t)=>RegExp(`^${t}([|.)\\d+`.replace(/\[/g,"\\[").replace(/\]/g,"\\]")).test(e))(t,e)),ut="undefined"!=typeof window&&"undefined"!=typeof document;function st(e){var t;let n;if(We(e)||ut&&(e instanceof File||ge(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,st(e.get(t)));return n}n=Array.isArray(e)?[]:{};for(const t in e)n[t]=st(e[t]);return n}var ct=e=>({isOnSubmit:!e||e===he.onSubmit,isOnBlur:e===he.onBlur,isOnChange:e===he.onChange,isOnAll:e===he.all,isOnTouch:e===he.onTouched}),dt=e=>Le(e)||xe(e);const ft="undefined"==typeof window,mt=ut?"Proxy"in window:"undefined"!=typeof Proxy,vt=n.createContext(null);vt.displayName="RHFContext";const pt=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:i,meta:l}=function(e){let{name:t,rules:r,defaultValue:o,control:i,onFocus:l}=e;const a=n.useContext(vt);if("production"!==process.env.NODE_ENV&&!i&&!a)throw new Error("📋 Controller is missing `control` prop. https://react-hook-form.com/api#Controller");const{defaultValuesRef:u,setValue:s,register:c,unregister:d,trigger:f,mode:m,reValidateMode:{isReValidateOnBlur:v,isReValidateOnChange:p},formState:g,formStateRef:{current:{isSubmitted:h,touched:E,errors:y}},updateFormState:_,readFormStateRef:b,fieldsRef:C,fieldArrayNamesRef:O,shallowFieldsStateRef:S}=i||a.control,w=!at(O.current,t),N=()=>!Ne(Ie(S.current,t))&&w?Ie(S.current,t):Ne(o)?Ie(u.current,t):o,[I,D]=n.useState(N()),T=n.useRef(I),R=n.useRef({focus:()=>null}),L=n.useRef(l||(()=>{Je(R.current.focus)&&R.current.focus(),"production"!==process.env.NODE_ENV&&(Je(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"))})),A=n.useCallback(e=>!it(Object.assign({isBlurEvent:e,isReValidateOnBlur:v,isReValidateOnChange:p,isSubmitted:h,isTouched:!!Ie(E,t)},m)),[v,p,h,E,t,m]),x=n.useCallback(e=>{let[t]=e;const n=(e=>We(e)||!_e(e.target)||_e(e.target)&&!e.type?e:Ne(e.target.value)?e.target.checked:e.target.value)(t);return D(n),T.current=n,n},[]),P=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):(c(Object.defineProperties({name:t,focus:L.current},{value:{set(e){D(e),T.current=e},get:()=>T.current}}),r),e=Ne(Ie(u.current,t))),e&&w&&D(N())},[r,t,c]);n.useEffect(()=>()=>d(t),[t]),n.useEffect(()=>{"production"!==process.env.NODE_ENV&&(Ne(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&&Ne(o)&&console.warn("📋 Controller is missing `defaultValue` prop when using `useFieldArray`. https://react-hook-form.com/api#Controller")),P()},[P]),n.useEffect(()=>{!C.current[t]&&P(!0)});const M=n.useCallback(()=>{b.current.touched&&!Ie(E,t)&&(Se(E,t,!0),_({touched:E})),A(!0)&&f(t)},[t,_,A,f,b]);return{field:{onChange:n.useCallback(function(){for(var e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];return s(t,x(n),{shouldValidate:A(),shouldDirty:!0})},[s,t,A]),onBlur:M,name:t,value:I,ref:R},meta:Object.defineProperties({invalid:!!Ie(y,t)},{isDirty:{get:()=>!!Ie(g.dirtyFields,t)},isTouched:{get:()=>!!Ie(g.touched,t)}})}}(e),a=Object.assign(Object.assign({},o),i);return t?n.isValidElement(t)?n.cloneElement(t,a):n.createElement(t,a):r?r(i,l):null},gt=e=>{let{control:n,t:o}=e;const i=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(pt,{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(pt,{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:i?"510px":"25px",marginLeft:i?"0":"-30px",maxWidth:i?"100%":"240px"},label:o("ES_COMMON_APPLY"),submit:!0})))},ht=e=>{var o;let{Controller:i,register:l,control:a,t:u,reset:s,previousPage:c,handleSubmit:d,tenantId:f,data:m,onSubmit:v,isLoading:p}=e;const[g,h]=n.useState([]),E=e=>r.createElement("div",{onClick:e.onClick},r.createElement(t.DownloadBtnCommon,null));n.useEffect(()=>{(null==m?void 0:m.length)>0&&h([null==m?void 0:m.map(e=>{let t={};return t[u("AUDIT_DATE_LABEL")]=y(null==e?void 0:e.timestamp),t[u("AUDIT_TIME_LABEL")]=_(null==e?void 0:e.timestamp),t[u("AUDIT_DATAVIEWED_LABEL")]=(null==e?void 0:e.dataView[0])+","+(null==e?void 0:e.dataView[1]),t[u("AUDIT_DATAVIEWED_BY_LABEL")]=null==e?void 0:e.dataViewedBy,t[u("AUDIT_ROLE_LABEL")]=null==e?void 0:e.roles.map(e=>e.name).join(","),{...t}})])},[m]);const y=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()}`},_=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}`},[b,C]=n.useReducer(function(e,t){switch(t.type){case"set":return t.payload;case"remove":return!1}},!1),O=()=>{C({type:"remove"})},S=()=>r.createElement("div",{className:"InboxMobilePopupCloseButtonWrapper",onClick:O},r.createElement(t.CloseSvg,null)),w={Controller:i,register:l,control:a,t:u,reset:s,previousPage:c},N=n.useCallback(e=>{let{currentlyActiveMobileModal:n,searchFormFieldsComponentProps:o,tenantId:i,...l}=e;return(e=>{let{currentlyActiveMobileModal:n,searchFormFieldsComponentProps:o,tenantId:i,...l}=e;const{closeMobilePopupModal:a}=l;switch(n){case"SearchFormComponent":return r.createElement(t.SearchForm,l,r.createElement(S,null),r.createElement("div",{className:"MobilePopupHeadingWrapper"},r.createElement("h2",null,u("PRIVACY_AUDIT_REPORT"),":")),r.createElement(gt,I({},o,{closeMobilePopupModal:a,tenantId:i,t:u})));default:return r.createElement("span",null)}})({currentlyActiveMobileModal:n,searchFormFieldsComponentProps:o,tenantId:i,...l})},[b]);null==m||null===(o=m.roles)||void 0===o||o.forEach(e=>{});const D=n.useMemo(()=>null!=m&&m.display||""===m?[]:null==m?void 0:m.map(e=>{var t;return{[u("AUDIT_DATE_LABEL")]:y(e.timestamp),[u("AUDIT_TIME_LABEL")]:_(e.timestamp),[u("AUDIT_DATAVIEWED_LABEL")]:e.dataView[0]+","+e.dataView[1],[u("AUDIT_DATAVIEWED_BY_LABEL")]:e.dataViewedBy,[u("AUDIT_ROLE_LABEL")]:null===(t=e.roles.slice(0,3))||void 0===t?void 0:t.map(e=>e.name).join(",")}}),[m]);return r.createElement(r.Fragment,null,r.createElement(t.BackButton,null),r.createElement("div",{className:"sideContent",style:{marginLeft:"70%",marginTop:"-12%"}},r.createElement(E,{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")})(g)})),r.createElement(t.Header,null,u("PRIVACY_AUDIT_REPORT"),":"),r.createElement("div",{className:"digit-search-box"},r.createElement(t.SearchAction,{text:u("ES_COMMON_SEARCH"),handleActionClick:()=>C({type:"set",payload:"SearchFormComponent"}),tenantId:f,t:u})),b?r.createElement(t.PopUp,null,r.createElement(N,{onSubmit:e=>{C({type:"remove"}),v(e)},handleSubmit:d,id:"search-form",className:"rm-mb form-field-flex-one inboxPopupMobileWrapper",searchFormFieldsComponentProps:w,currentlyActiveMobileModal:b,closeMobilePopupModal:O,tenantId:f})):null,p&&r.createElement(t.Loader,null),r.createElement(t.DetailsCard,{data:D}))},Et=e=>{let{tenantId:o,t:i,onSubmit:l,data:a,count:s}=e;const c=Digit.SessionStorage.get("AUDIT_APPLICATION_DETAIL")||{offset:0,limit:5,sortOrder:"DESC"},{register:d,control:f,handleSubmit:m,setValue:v,getValues:p,reset:g}=function(e){let{mode:t=he.onSubmit,reValidateMode:r=he.onChange,resolver:o,context:i,defaultValues:l={},shouldFocusError:a=!0,shouldUnregister:u=!0,criteriaMode:s}=void 0===e?{}:e;const c=n.useRef({}),d=n.useRef({}),f=n.useRef({}),m=n.useRef(new Set),v=n.useRef({}),p=n.useRef({}),g=n.useRef({}),h=n.useRef({}),E=n.useRef(l),y=n.useRef(!1),_=n.useRef(!1),b=n.useRef(),C=n.useRef({}),O=n.useRef({}),S=n.useRef(i),w=n.useRef(o),N=n.useRef(new Set),I=n.useRef(ct(t)),{isOnSubmit:D,isOnTouch:T}=I.current,R=s===he.all,[L,A]=n.useState({isDirty:!1,isValidating:!1,dirtyFields:{},isSubmitted:!1,submitCount:0,touched:{},isSubmitting:!1,isSubmitSuccessful:!1,isValid:!D,errors:{}}),x=n.useRef({isDirty:!mt,dirtyFields:!mt,touched:!mt||T,isValidating:!mt,isSubmitting:!mt,isValid:!mt}),P=n.useRef(L),M=n.useRef(),{isOnBlur:k,isOnChange:U}=n.useRef(ct(r)).current;S.current=i,w.current=o,P.current=L,C.current=u?{}:Fe(C.current)?st(l):C.current;const B=n.useCallback(function(e){void 0===e&&(e={}),y.current||(P.current=Object.assign(Object.assign({},P.current),e),A(P.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 i=n||(e=>{let{errors:t,name:n,error:r,validFields:o,fieldsWithValidation:i}=e;const l=Ne(r),a=Ie(t,n);return l&&!!a||!l&&!Ge(a,r,!0)||l&&Ie(i,n)&&!Ie(o,n)})({errors:P.current.errors,error:t,name:e,validFields:h.current,fieldsWithValidation:g.current});const l=Ie(P.current.errors,e);t?(ze(h.current,e),i=i||!l||!Ge(l,t,!0),Se(P.current.errors,e,t)):((Ie(g.current,e)||w.current)&&(Se(h.current,e,!0),i=i||l),ze(P.current.errors,e)),(i&&!Ee(n)||!Fe(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}=c.current[e],o=ut&&ge(n)&&Ee(t)?"":t;Le(n)?(r||[]).forEach(e=>{let{ref:t}=e;return t.checked=t.value===o}):Ae(n)&&!Ze(o)?n.files=o:Pe(n)?[...n.options].forEach(e=>e.selected=o.includes(e.value)):xe(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},[]),z=n.useCallback((e,t)=>{if(x.current.isDirty){const n=J();return e&&t&&Se(n,e,t),!Ge(n,E.current)}return!1},[]),H=n.useCallback(function(e,t){if(void 0===t&&(t=!0),x.current.isDirty||x.current.dirtyFields){const n=!Ge(Ie(E.current,e),Be(c,e,C)),r=Ie(P.current.dirtyFields,e),o=P.current.isDirty;n?Se(P.current.dirtyFields,e,!0):ze(P.current.dirtyFields,e);const i={isDirty:z(),dirtyFields:P.current.dirtyFields},l=x.current.isDirty&&o!==i.isDirty||x.current.dirtyFields&&r!==Ie(P.current.dirtyFields,e);return l&&t&&B(i),l?i:{}}return{}},[]),W=n.useCallback(function(e,t){try{return"production"===process.env.NODE_ENV||c.current[e]?Promise.resolve(nt(c,R,c.current[e],C)).then(function(n){const r=n[e];return F(e,r,t),Ne(r)}):(console.warn("📋 Field is missing with `name` attribute: ",e),Promise.resolve(!1))}catch(e){return Promise.reject(e)}},[F,R]),$=n.useCallback(function(e){try{return Promise.resolve(w.current(J(),S.current,R)).then(function(t){let{errors:n}=t;const r=P.current.isValid;if(Array.isArray(e)){const t=e.map(e=>{const t=Ie(n,e);return t?Se(P.current.errors,e,t):ze(P.current.errors,e),!t}).every(Boolean);return B({isValid:Fe(n),isValidating:!1}),t}{const t=Ie(n,e);return F(e,t,r!==Fe(n),{},Fe(n)),!t}})}catch(e){return Promise.reject(e)}},[F,R]),G=n.useCallback(function(e){try{let n=!1;function t(e){return n?e:Promise.resolve(W(r))}const r=e||Object.keys(c.current);if(j(),w.current)return Promise.resolve($(r));const o=function(){if(Array.isArray(r))return!e&&(P.current.errors={}),Promise.resolve(Promise.all(r.map(function(e){try{return Promise.resolve(W(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]),q=n.useCallback((e,t,n)=>{let{shouldDirty:r,shouldValidate:o}=n;const i={};Se(i,e,t);for(const n of rt(e,t))c.current[n]&&(V(n,Ie(i,n)),r&&H(n),o&&G(n))},[G,V,H]),Z=n.useCallback((e,t,n)=>{if(!u&&!We(t)&&Se(C.current,e,Array.isArray(t)?[...t]:Object.assign({},t)),c.current[e])V(e,t),n.shouldDirty&&H(e),n.shouldValidate&&G(e);else if(!We(t)&&(q(e,t,n),N.current.has(e))){const r=lt(e)||e;Se(d.current,e,t),O.current[r]({[r]:Ie(d.current,r)}),(x.current.isDirty||x.current.dirtyFields)&&n.shouldDirty&&(Se(P.current.dirtyFields,e,((e,t,n)=>$e(qe(e,t,n.slice(0,e.length)),qe(t,e,n.slice(0,e.length))))(t,Ie(E.current,e,[]),Ie(P.current.dirtyFields,e,[]))),B({isDirty:!Ge(Object.assign(Object.assign({},J()),{[e]:t}),E.current)}))}!u&&Se(C.current,e,t)},[H,V,q]),X=e=>_.current||m.current.has(e)||m.current.has((e.match(/\w+/)||[])[0]),Y=e=>{let t=!0;if(!Fe(v.current))for(const n in v.current)e&&v.current[n].size&&!v.current[n].has(e)&&!v.current[n].has(lt(e))||(p.current[n](),t=!1);return t};function K(e){if(!u){let t=st(e);for(const e of N.current)be(e)&&!t[e]&&(t=Object.assign(Object.assign({},t),{[e]:[]}));return t}return e}function J(e){if(Ze(e))return Be(c,e,C);if(Array.isArray(e)){const t={};for(const n of e)Se(t,n,Be(c,n,C));return t}return K(Xe(c,st(C.current),u))}b.current=b.current?b.current:function(e){let{type:t,target:n}=e;try{let e=n.name;const r=c.current[e];let o,i;return Promise.resolve(function(){if(r){function l(){!a&&Y(e),F(e,o,f,d,i)}const a="blur"===t,s=it(Object.assign({isBlurEvent:a,isReValidateOnChange:U,isReValidateOnBlur:k,isTouched:!!Ie(P.current.touched,e),isSubmitted:P.current.isSubmitted},I.current));let d=H(e,!1),f=!Fe(d)||!a&&X(e);if(a&&!Ie(P.current.touched,e)&&x.current.touched&&(Se(P.current.touched,e,!0),d=Object.assign(Object.assign({},d),{touched:P.current.touched})),!u&&xe(n)&&Se(C.current,e,Be(c,e)),s)return!a&&Y(e),(!Fe(d)||f&&Fe(d))&&B(d);j();const m=w.current?Promise.resolve(w.current(J(),S.current,R)).then(function(t){let{errors:r}=t;const l=P.current.isValid;if(o=Ie(r,e),xe(n)&&!o&&w.current){const t=lt(e),n=Ie(r,t,{});n.type&&n.message&&(o=n),t&&(n||Ie(P.current.errors,t))&&(e=t)}i=Fe(r),l!==i&&(f=!0)}):Promise.resolve(nt(c,R,r,C)).then(function(t){o=t[e]});return m&&m.then?m.then(l):l()}}())}catch(e){return Promise.reject(e)}};const Q=n.useCallback(function(e){void 0===e&&(e={});try{const t=Fe(c.current)?E.current:{};return Promise.resolve(w.current(Object.assign(Object.assign(Object.assign({},t),J()),e),S.current,R)).then(function(e){let{errors:t}=e;const n=Fe(t);P.current.isValid!==n&&B({isValid:n})})}catch(e){return Promise.reject(e)}},[R]),te=n.useCallback((e,t)=>{!function(e,t,n,r,o,i){const{ref:l,ref:{name:a}}=n,u=e.current[a];if(!o){const t=Be(e,a,r);!Ne(t)&&Se(r.current,a,t)}l.type&&u?Le(l)||xe(l)?Array.isArray(u.options)&&u.options.length?(Ce(u.options).forEach(function(e,n){void 0===e&&(e={}),(je(e.ref)&&He(e,e.ref)||i)&&(De(e.ref,t),ze(u.options,`[${n}]`))}),u.options&&!Ce(u.options).length&&delete e.current[a]):delete e.current[a]:(je(l)&&He(u,l)||i)&&(De(l,t),delete e.current[a]):delete e.current[a]}(c,b.current,e,C,u,t),u&&(ze(h.current,e.ref.name),ze(g.current,e.ref.name))},[u]),ne=n.useCallback(e=>{if(_.current)B();else{for(const t of m.current)if(t.startsWith(e)){B();break}Y(e)}},[]),re=n.useCallback((e,t)=>{e&&(te(e,t),u&&!Ce(e.options||[]).length&&(ze(P.current.errors,e.ref.name),Se(P.current.dirtyFields,e.ref.name,!0),B({isDirty:z()}),x.current.isValid&&w.current&&Q(),ne(e.ref.name)))},[Q,te]),oe=n.useCallback((e,t,n)=>{const r=n?v.current[n]:m.current;let o=Xe(c,st(C.current),u,!1,e);if(Ze(e)){const n=lt(e)||e;return N.current.has(n)&&(o=Object.assign(Object.assign({},f.current),o)),ot(o,e,r,Ne(Ie(E.current,e))?t:Ie(E.current,e),!0)}const i=Ne(t)?E.current:t;return Array.isArray(e)?e.reduce((e,t)=>Object.assign(Object.assign({},e),{[t]:ot(o,t,r,i)}),{}):(_.current=Ne(n),we(!Fe(o)&&o||i))},[]);function ie(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(N.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,i=Object.assign({ref:e},t),l=c.current,a=dt(e),s=at(N.current,n),d=t=>ut&&(!ge(e)||t===e);let f,m=l[n],v=!0;if(m&&(a?Array.isArray(m.options)&&Ce(m.options).find(e=>o===e.ref.value&&d(e.ref)):d(m.ref)))return void(l[n]=Object.assign(Object.assign({},m),t));m=r?a?Object.assign({options:[...Ce(m&&m.options||[]),{ref:e}],ref:{type:r,name:n}},t):Object.assign({},i):i,l[n]=m;const p=Ne(Ie(C.current,n));Fe(E.current)&&p||(f=Ie(p?E.current:C.current,n),v=Ne(f),v||s||V(n,f)),Fe(t)||(Se(g.current,n,!0),!D&&x.current.isValid&&nt(c,R,m,C).then(e=>{const t=P.current.isValid;Fe(e)?Se(h.current,n,!0):ze(h.current,n),t!==Fe(e)&&B()})),!u||s&&v||!s&&ze(P.current.dirtyFields,n),r&&function(e,t,n){let{ref:r}=e;ge(r)&&n&&(r.addEventListener(t?"change":"input",n),r.addEventListener("blur",n))}(a&&m.options?m.options[m.options.length-1]:m,a||"select-one"===e.type,b.current)}const le=n.useCallback((e,t)=>function(n){try{n&&n.preventDefault&&(n.preventDefault(),n.persist());let r={},o=K(Xe(c,st(C.current),u,!0));return x.current.isSubmitting&&B({isSubmitting:!0}),Promise.resolve(function(i,l){try{var u=function(){function i(){const i=function(){if(Fe(r)&&Object.keys(P.current.errors).every(e=>e in c.current))return B({errors:{},isSubmitting:!0}),Promise.resolve(e(o,n)).then(function(){});{function i(e){a&&((e,t)=>{for(const n in e)if(Ie(t,n)){const t=e[n];if(t){if(t.ref.focus&&Ne(t.ref.focus()))break;if(t.options){t.options[0].ref.focus();break}}}})(c.current,P.current.errors)}return P.current.errors=Object.assign(Object.assign({},P.current.errors),r),t?Promise.resolve(t(P.current.errors,n)).then(i):i()}}();if(i&&i.then)return i.then(function(){})}const l=w.current?Promise.resolve(w.current(o,S.current,R)).then(function(e){let{errors:t,values:n}=e;P.current.errors=r=t,o=n}):ee(Object.values(c.current),function(e){const t=function(){if(e){const{name:t}=e.ref;return Promise.resolve(nt(c,R,e,C)).then(function(e){e[t]?(Se(r,t,e[t]),ze(h.current,t)):Ie(g.current,t)&&(ze(P.current.errors,t),Se(h.current,t,!0))})}}();if(t&&t.then)return t.then(function(){})});return l&&l.then?l.then(i):i()}()}catch(e){return l(!0,e)}return u&&u.then?u.then(l.bind(null,!1),l.bind(null,!0)):l(!1,u)}(0,function(e,t){if(P.current.isSubmitting=!1,B({isSubmitted:!0,isSubmitting:!1,isSubmitSuccessful:Fe(P.current.errors),submitCount:P.current.submitCount+1}),e)throw t;return t}))}catch(n){return Promise.reject(n)}},[a,R]);n.useEffect(()=>{o&&x.current.isValid&&Q(),M.current=M.current||!ut?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&&je(e.ref)&&t(n);else n&&je(n.ref)&&t(n)});return n.observe(window.document,{childList:!0,subtree:!0}),n}(c,re)},[re,E.current]),n.useEffect(()=>()=>{M.current&&M.current.disconnect(),y.current=!0,"production"===process.env.NODE_ENV&&Object.values(c.current).forEach(e=>re(e,!0))},[]),!o&&x.current.isValid&&(L.isValid=Ge(h.current,g.current)&&Fe(P.current.errors));const ae={trigger:G,setValue:n.useCallback(function(e,t,n){Z(e,t,n||{}),X(e)&&B(),Y(e)},[Z,G]),getValues:n.useCallback(J,[]),register:n.useCallback(function(e,t){if(!ft)if(Ze(e))ie({name:e},t);else{if(!_e(e)||!("name"in e))return t=>t&&ie(t,e);ie(e,t)}},[E.current]),unregister:n.useCallback(function(e){for(const t of Array.isArray(e)?e:[e])re(c.current[t],!0)},[]),formState:mt?new Proxy(L,{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]}}):L},ue=n.useMemo(()=>Object.assign({isFormDirty:z,updateWatchedValue:ne,shouldUnregister:u,updateFormState:B,removeFieldEventListener:te,watchInternal:oe,mode:I.current,reValidateMode:{isReValidateOnBlur:k,isReValidateOnChange:U},validateResolver:o?Q:void 0,fieldsRef:c,resetFieldArrayFunctionRef:O,useWatchFieldsRef:v,useWatchRenderFunctionsRef:p,fieldArrayDefaultValuesRef:d,validFieldsRef:h,fieldsWithValidationRef:g,fieldArrayNamesRef:N,readFormStateRef:x,formStateRef:P,defaultValuesRef:E,shallowFieldsStateRef:C,fieldArrayValuesRef:f},ae),[E.current,ne,u,te,oe]);return Object.assign({watch:function(e,t){return oe(e,t)},control:ue,handleSubmit:le,reset:n.useCallback(function(e,t){if(void 0===t&&(t={}),ut)for(const e of Object.values(c.current))if(e){const{ref:t,options:n}=e,r=dt(t)&&Array.isArray(n)?n[0].ref:t;if(ge(r))try{r.closest("form").reset();break}catch(e){}}c.current={},E.current=Object.assign({},e||E.current),e&&Y(""),Object.values(O.current).forEach(e=>Je(e)&&e()),C.current=u?{}:st(e||E.current),(e=>{let{errors:t,isDirty:n,isSubmitted:r,touched:o,isValid:i,submitCount:l,dirtyFields:a}=e;i||(h.current={},g.current={}),d.current={},m.current=new Set,_.current=!1,B({submitCount:l?P.current.submitCount:0,isDirty:!!n&&P.current.isDirty,isSubmitted:!!r&&P.current.isSubmitted,isValid:!!i&&P.current.isValid,dirtyFields:a?P.current.dirtyFields:{},touched:o?P.current.touched:{},errors:t?P.current.errors:{},isSubmitting:!1,isSubmitSuccessful:!1})})(t)},[]),clearErrors:n.useCallback(function(e){e&&(Array.isArray(e)?e:[e]).forEach(e=>c.current[e]&&be(e)?delete P.current.errors[e]:ze(P.current.errors,e)),B({errors:e?P.current.errors:{}})},[]),setError:n.useCallback(function(e,t){const n=(c.current[e]||{}).ref;Se(P.current.errors,e,Object.assign(Object.assign({},t),{ref:n})),B({isValid:!1}),t.shouldFocus&&n&&n.focus&&n.focus()},[]),errors:L.errors},ae)}({defaultValues:c}),h=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()}`},E=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}`},[y,_]=n.useState([]),b=e=>r.createElement("div",{onClick:e.onClick},r.createElement(u.DownloadBtnCommon,null));n.useEffect(()=>{d("offset",0),d("limit",5),d("sortOrder","DESC")},[d]),n.useEffect(()=>{(null==a?void 0:a.length)>0&&_([null==a?void 0:a.map(e=>{let t={};return t[i("AUDIT_DATE_LABEL")]=h(null==e?void 0:e.timestamp),t[i("AUDIT_TIME_LABEL")]=E(null==e?void 0:e.timestamp),t[i("AUDIT_DATAVIEWED_LABEL")]=(null==e?void 0:e.dataView[0])+","+(null==e?void 0:e.dataView[1]),t[i("AUDIT_DATAVIEWED_BY_LABEL")]=null==e?void 0:e.dataViewedBy,t[i("AUDIT_ROLE_LABEL")]=null==e?void 0:e.roles.map(e=>e.name).join(","),{...t}})])},[a]);const C=n.useCallback(e=>{0!==e.length&&(v("sortBy",e.id),v("sortOrder",e.desc?"DESC":"ASC"))},[]);function O(){v("offset",p("offset")-p("limit")),m(l)()}const S=window.Digit.Utils.browser.isMobile();if(S)return r.createElement(ht,{Controller:pt,register:d,control:f,t:i,reset:g,previousPage:O,handleSubmit:m,tenantId:o,data:a,onSubmit:l});const w=e=>r.createElement("span",{className:"cell-text"},e),N=n.useMemo(()=>[{Header:i("AUDIT_DATE_LABEL"),disableSortBy:!0,accessor:e=>{const t="NA"===e.timestamp?i("WS_NA"):h(e.timestamp);return w(""+t)}},{Header:i("AUDIT_TIME_LABEL"),disableSortBy:!0,accessor:e=>{const t="NA"===e.timestamp?i("WS_NA"):E(e.timestamp);return w(""+t)}},{Header:i(S?"AUDIT_DATAVIEWED_LABEL":"AUDIT_DATAVIEWED_PRIVACY"),disableSortBy:!0,accessor:e=>w(""+(null==e?void 0:e.dataView))},{Header:i(S?"AUDIT_DATAVIEWED_BY_LABEL":"AUDIT_DATAVIEWED_BY_PRIVACY"),disableSortBy:!0,accessor:e=>w(""+(null==e?void 0:e.dataViewedBy))},{Header:i("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,i("PRIVACY_AUDIT_REPORT"))," "),r.createElement(t.SearchForm,{className:"audit-card",onSubmit:l,handleSubmit:m},r.createElement(gt,{register:d,control:f,reset:g,tenantId:o,t:i,previousPage:O})),r.createElement("div",{style:{marginTop:"240px",marginLeft:"-55%",maxWidth:"80%",marginRight:"52px"}},null!=a&&a.display?r.createElement("div",{style:{marginTop:"20x",width:"1025px",marginLeft:"25px",backgroundColor:"white",height:"60px"}},i(a.display).split("\\n").map((e,t)=>r.createElement("p",{key:t,style:{textAlign:"center"}},e))):""!==a?r.createElement("div",{style:{backgroundColor:"white",marginRight:"-30px",marginLeft:"30px"}},r.createElement("div",{className:"sideContent",style:{float:"right",padding:"10px 30px"}},r.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")})(y)})),r.createElement(u.Table,{t:i,data:a,totalRecords:s,columns:N,getCellProps:e=>({style:{minWidth:e.column.Header===i("ES_INBOX_APPLICATION_NO")?"240px":"",padding:"20px 18px",fontSize:"16px"}}),onPageSizeChange:function(e){v("limit",Number(e.target.value)),m(l)()},currentPage:p("offset")/p("limit"),onNextPage:function(){v("offset",p("offset")+p("limit")),m(l)()},onPrevPage:O,manualPagination:!1,pageSizeLimit:p("limit"),onSort:C,disableSort:!1,sortParams:[{id:p("sortBy"),desc:"DESC"===p("sortOrder")}]})):r.createElement(t.Loader,null)))},yt=e=>{var t,i;const{t:l}=o.useTranslation(),a=Digit.ULBService.getCitizenCurrentTenant(),[u,s]=n.useState({}),c=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};s(Object.keys(t).filter(e=>t[e]).reduce((e,n)=>({...e,[n]:"object"==typeof t[n]?t[n].code:t[n]}),{}))}},[]);const d={enabled:!!(u&&Object.keys(u).length>0)},f={...u},{isLoading:m,data:v}=Digit.Hooks.useAudit({tenantId:a,filters:{...f},config:d});return r.createElement(Et,{t:l,tenantId:a,onSubmit:function(e){Digit.SessionStorage.set("AUDIT_APPLICATION_DETAIL",{offset:0,limit:5,sortBy:"commencementDate",sortOrder:"DESC"});const t={...e,fromDate:c(null==e?void 0:e.fromDate),toDate:c(null==e?void 0:e.toDate)};s(Object.keys(t).filter(e=>t[e]).reduce((e,n)=>({...e,[n]:t[n]}),{}))},data:m?"":(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===(i=v.ElasticSearchData)||void 0===i?void 0:i.length})},_t=e=>{var n,i,l,a,u,s,c,d,f,m,v,p,g,h,E,y;let{moduleCode:_}=e;const{t:b}=o.useTranslation(),C=Digit.ULBService.getCitizenCurrentTenant(),{isLoading:O,data:S}=Digit.Hooks.useStaticData(Digit.ULBService.getStateId()),{isLoading:w,error:N,data:I}=Digit.Hooks.useDynamicData({moduleCode:_,tenantId:C,filters:{},t:b}),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==S||null===(n=S.MdmsRes["common-masters"])||void 0===n||null===(i=n.StaticData[0])||void 0===i?void 0:i[""+_],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}},L=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}},A=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:""}}},x=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||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"},b("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"},b("CALL_CENTER_HELPLINE")),r.createElement("div",{className:"helplineIcon"},r.createElement(t.HelpLineIcon,null))),r.createElement("div",{className:"call-center-card-text"},null!=T&&null!==(l=T.helpline)&&void 0!==l&&l.contactOne?r.createElement("div",{className:"call-center-card-content"},r.createElement("a",{href:"tel:"+(null==T||null===(a=T.helpline)||void 0===a?void 0:a.contactOne)},null==T||null===(u=T.helpline)||void 0===u?void 0:u.contactOne)):null,null!=T&&null!==(s=T.helpline)&&void 0!==s&&s.contactTwo?r.createElement("div",{className:"call-center-card-content"},r.createElement("a",{href:"tel:"+(null==T||null===(c=T.helpline)||void 0===c?void 0:c.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"},b("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},b("VIEW_ON_MAP"))):null):r.createElement("div",null),r.createElement(t.Card,{style:{margin:"16px",padding:"16px",maxWidth:"unset"}},N||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:_,styles:{width:"24px",height:"24px"}}),r.createElement("span",{className:"dynamicData-content"},null==I?void 0:I.dynamicDataOne))),N||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:_,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:_}),r.createElement("span",{className:"static-data-content"},r.createElement("span",{className:"static-data-content-first",style:{marginTop:""===(null===(f=x(_))||void 0===f?void 0:f.staticDataOne)?"8px":"unset"}},null===(m=x(_))||void 0===m?void 0:m.staticDataOneHeader),r.createElement("span",{className:"static-data-content-second"},""+(null===(v=x(_))||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(L,{module:_}),r.createElement("span",{className:"static-data-content"},r.createElement("span",{className:"static-data-content-first"},null===(p=x(_))||void 0===p?void 0:p.staticDataTwoHeader),r.createElement("span",{className:"static-data-content-second"},null===(g=x(_))||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===(h=A(_))||void 0===h?void 0:h.staticCommonContent),r.createElement("span",{className:"static-data-content-second"},null===(E=A(_))||void 0===E?void 0:E.validity)))):r.createElement("div",null),N||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"===_?r.createElement(D,{module:_,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===(y=A(_))||void 0===y?void 0:y.staticCommonContent),r.createElement("span",{className:"static-data-content-second"},null==I?void 0:I.staticData)))))):r.createElement(r.Fragment,null)};var bt,Ct,Ot,St,wt;const Nt=[(null===(bt=window)||void 0===bt?void 0:bt.contextPath)+"/citizen/register/name",`/${null===(Ct=window)||void 0===Ct?void 0:Ct.contextPath}/citizen/select-language`,`/${null===(Ot=window)||void 0===Ot?void 0:Ot.contextPath}/citizen/select-location`,`/${null===(St=window)||void 0===St?void 0:St.contextPath}/citizen/login`,`/${null===(wt=window)||void 0===wt?void 0:wt.contextPath}/citizen/register/otp`],It=(e,t)=>t.filter(t=>e.map(e=>e.code).includes(t.code)),Dt=e=>{var n,i,l;let{stateInfo:u,userDetails:s,CITIZEN:c,cityDetails:d,mobileView:f,handleUserDropdownSelection:v,logoUrl:h,stateCode:E,modules:_,appTenants:b,pathname:C,initData:O}=e;const{isLoading:S,data:w,isFetched:N}=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},{})}}),I=Digit.Hooks.useRouteSubscription(C),{t:D}=o.useTranslation(),{path:T}=a.useRouteMatch(),R=a.useHistory(),A=Nt.some(e=>window.location.href.includes(e)),x=_.map((e,t)=>{let{code:n,tenants:o}=e;const i=Digit.ComponentRegistryService.getComponent(n+"Module");return i?r.createElement(a.Route,{key:t,path:`${T}/${n.toLowerCase()}`},r.createElement(i,{stateCode:E,moduleCode:n,userType:"citizen",tenants:It(o,b)})):null}),P=_.map((e,n)=>{let{code:o,bannerImage:i}=e,l=(Digit.ComponentRegistryService.getComponent(o+"Links"),N?g(w,o,D):void 0);return"ACTION_TEST_WS"===(null==l?void 0:l.header)&&(null==l||l.links.sort((e,t)=>t.orderNumber-e.orderNumber)),r.createElement(r.Fragment,null,r.createElement(a.Route,{key:n,path:`${T}/${o.toLowerCase()}-home`},r.createElement("div",{className:"moduleLinkHomePage"},r.createElement("img",{src:i||(null==u?void 0:u.bannerUrl),alt:"noimagefound"}),r.createElement(t.BackButton,{className:"moduleLinkHomePageBackButton"}),r.createElement("h1",null,D("MODULE_"+o.toUpperCase())),r.createElement("div",{className:"moduleLinkHomePageModuleLinks"},l&&r.createElement(t.CitizenHomeCard,{header:D(null==l?void 0:l.header),links:null==l?void 0:l.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(_t,{moduleCode:null==o?void 0:o.toUpperCase()}))),r.createElement(a.Route,{key:"faq"+n,path:`${T}/${o.toLowerCase()}-faq`},r.createElement(G,{module:null==o?void 0:o.toUpperCase()})),r.createElement(a.Route,{key:"hiw"+n,path:`${T}/${o.toLowerCase()}-how-it-works`},r.createElement(oe,{module:null==o?void 0:o.toUpperCase()})))});return r.createElement("div",{className:I},r.createElement(W,{t:D,stateInfo:u,userDetails:s,CITIZEN:c,cityDetails:d,mobileView:f,handleUserDropdownSelection:v,logoUrl:h,showSidebar:!0,linkData:w,islinkDataLoading:S}),r.createElement("div",{className:"main center-container citizen-home-container mb-25"},A?null:r.createElement("div",{className:"SideBarStatic"},r.createElement(L,{linkData:w,islinkDataLoading:S})),r.createElement(a.Switch,null,r.createElement(a.Route,{exact:!0,path:T},r.createElement(q,null)),r.createElement(a.Route,{exact:!0,path:T+"/select-language"},r.createElement(Z,null)),r.createElement(a.Route,{exact:!0,path:T+"/select-location"},r.createElement(X,null)),r.createElement(a.Route,{path:T+"/error"},r.createElement(m,{initData:O,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(a.Route,{path:T+"/all-services"},r.createElement(y,{userType:"citizen",modules:_,getCitizenMenu:w,fetchedCitizen:N,isLoading:S})),r.createElement(a.Route,{path:T+"/login"},r.createElement(pe,{stateCode:E})),r.createElement(a.Route,{path:T+"/register"},r.createElement(pe,{stateCode:E,isUserRegistered:!1})),r.createElement(a.Route,{path:T+"/user/profile"},r.createElement(re,{stateCode:E,userType:"citizen",cityDetails:d})),r.createElement(a.Route,{path:T+"/Audit"},r.createElement(yt,null)),r.createElement(p,{initData:O},x,P))),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===(i=n.globalConfigs)||void 0===i||null===(l=i.getConfig)||void 0===l?void 0:l.call(i,"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 Tt="function"==typeof Symbol&&Symbol.for,Rt=Tt?Symbol.for("react.element"):60103,Lt=Tt?Symbol.for("react.portal"):60106,At=Tt?Symbol.for("react.fragment"):60107,xt=Tt?Symbol.for("react.strict_mode"):60108,Pt=Tt?Symbol.for("react.profiler"):60114,Mt=Tt?Symbol.for("react.provider"):60109,kt=Tt?Symbol.for("react.context"):60110,Ut=Tt?Symbol.for("react.async_mode"):60111,Bt=Tt?Symbol.for("react.concurrent_mode"):60111,jt=Tt?Symbol.for("react.forward_ref"):60112,Ft=Tt?Symbol.for("react.suspense"):60113,Vt=Tt?Symbol.for("react.suspense_list"):60120,zt=Tt?Symbol.for("react.memo"):60115,Ht=Tt?Symbol.for("react.lazy"):60116,Wt=Tt?Symbol.for("react.block"):60121,$t=Tt?Symbol.for("react.fundamental"):60117,Gt=Tt?Symbol.for("react.responder"):60118,qt=Tt?Symbol.for("react.scope"):60119;function Zt(e){if("object"==typeof e&&null!==e){var t=e.$$typeof;switch(t){case Rt:switch(e=e.type){case Ut:case Bt:case At:case Pt:case xt:case Ft:return e;default:switch(e=e&&e.$$typeof){case kt:case jt:case Ht:case zt:case Mt:return e;default:return t}}case Lt:return t}}}function Xt(e){return Zt(e)===Bt}var Yt={AsyncMode:Ut,ConcurrentMode:Bt,ContextConsumer:kt,ContextProvider:Mt,Element:Rt,ForwardRef:jt,Fragment:At,Lazy:Ht,Memo:zt,Portal:Lt,Profiler:Pt,StrictMode:xt,Suspense:Ft,isAsyncMode:function(e){return Xt(e)||Zt(e)===Ut},isConcurrentMode:Xt,isContextConsumer:function(e){return Zt(e)===kt},isContextProvider:function(e){return Zt(e)===Mt},isElement:function(e){return"object"==typeof e&&null!==e&&e.$$typeof===Rt},isForwardRef:function(e){return Zt(e)===jt},isFragment:function(e){return Zt(e)===At},isLazy:function(e){return Zt(e)===Ht},isMemo:function(e){return Zt(e)===zt},isPortal:function(e){return Zt(e)===Lt},isProfiler:function(e){return Zt(e)===Pt},isStrictMode:function(e){return Zt(e)===xt},isSuspense:function(e){return Zt(e)===Ft},isValidElementType:function(e){return"string"==typeof e||"function"==typeof e||e===At||e===Bt||e===Pt||e===xt||e===Ft||e===Vt||"object"==typeof e&&null!==e&&(e.$$typeof===Ht||e.$$typeof===zt||e.$$typeof===Mt||e.$$typeof===kt||e.$$typeof===jt||e.$$typeof===$t||e.$$typeof===Gt||e.$$typeof===qt||e.$$typeof===Wt)},typeOf:Zt},Kt=k(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,i=e?Symbol.for("react.strict_mode"):60108,l=e?Symbol.for("react.profiler"):60114,a=e?Symbol.for("react.provider"):60109,u=e?Symbol.for("react.context"):60110,s=e?Symbol.for("react.async_mode"):60111,c=e?Symbol.for("react.concurrent_mode"):60111,d=e?Symbol.for("react.forward_ref"):60112,f=e?Symbol.for("react.suspense"):60113,m=e?Symbol.for("react.suspense_list"):60120,v=e?Symbol.for("react.memo"):60115,p=e?Symbol.for("react.lazy"):60116,g=e?Symbol.for("react.block"):60121,h=e?Symbol.for("react.fundamental"):60117,E=e?Symbol.for("react.responder"):60118,y=e?Symbol.for("react.scope"):60119;function _(e){if("object"==typeof e&&null!==e){var t=e.$$typeof;switch(t){case n:var m=e.type;switch(m){case s:case c:case o:case l:case i:case f:return m;default:var g=m&&m.$$typeof;switch(g){case u:case d:case p:case v:case a:return g;default:return t}}case r:return t}}}var b=c,C=u,O=a,S=n,w=d,N=o,I=p,D=v,T=r,R=l,L=i,A=f,x=!1;function P(e){return _(e)===c}t.AsyncMode=s,t.ConcurrentMode=b,t.ContextConsumer=C,t.ContextProvider=O,t.Element=S,t.ForwardRef=w,t.Fragment=N,t.Lazy=I,t.Memo=D,t.Portal=T,t.Profiler=R,t.StrictMode=L,t.Suspense=A,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.")),P(e)||_(e)===s},t.isConcurrentMode=P,t.isContextConsumer=function(e){return _(e)===u},t.isContextProvider=function(e){return _(e)===a},t.isElement=function(e){return"object"==typeof e&&null!==e&&e.$$typeof===n},t.isForwardRef=function(e){return _(e)===d},t.isFragment=function(e){return _(e)===o},t.isLazy=function(e){return _(e)===p},t.isMemo=function(e){return _(e)===v},t.isPortal=function(e){return _(e)===r},t.isProfiler=function(e){return _(e)===l},t.isStrictMode=function(e){return _(e)===i},t.isSuspense=function(e){return _(e)===f},t.isValidElementType=function(e){return"string"==typeof e||"function"==typeof e||e===o||e===c||e===l||e===i||e===f||e===m||"object"==typeof e&&null!==e&&(e.$$typeof===p||e.$$typeof===v||e.$$typeof===a||e.$$typeof===u||e.$$typeof===d||e.$$typeof===h||e.$$typeof===E||e.$$typeof===y||e.$$typeof===g)},t.typeOf=_}()}),Jt=k(function(e){e.exports="production"===process.env.NODE_ENV?Yt:Kt}),Qt=Object.getOwnPropertySymbols,en=Object.prototype.hasOwnProperty,tn=Object.prototype.propertyIsEnumerable;function nn(e){if(null==e)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(e)}var rn=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=nn(e),i=1;i<arguments.length;i++){for(var l in n=Object(arguments[i]))en.call(n,l)&&(o[l]=n[l]);if(Qt){r=Qt(n);for(var a=0;a<r.length;a++)tn.call(n,r[a])&&(o[r[a]]=n[r[a]])}}return o},on="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED",ln=Function.call.bind(Object.prototype.hasOwnProperty),an=function(){};if("production"!==process.env.NODE_ENV){var un=on,sn={},cn=ln;an=function(e){var t="Warning: "+e;"undefined"!=typeof console&&console.error(t);try{throw new Error(t)}catch(e){}}}function dn(e,t,n,r,o){if("production"!==process.env.NODE_ENV)for(var i in e)if(cn(e,i)){var l;try{if("function"!=typeof e[i]){var a=Error((r||"React class")+": "+n+" type `"+i+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof e[i]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw a.name="Invariant Violation",a}l=e[i](t,i,r,n,null,un)}catch(e){l=e}if(!l||l instanceof Error||an((r||"React class")+": type specification of "+n+" `"+i+"` is invalid; the type checker function must return `null` or an `Error` but returned a "+typeof l+". You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument)."),l instanceof Error&&!(l.message in sn)){sn[l.message]=!0;var u=o?o():"";an("Failed "+n+" type: "+l.message+(null!=u?u:""))}}}dn.resetWarningCache=function(){"production"!==process.env.NODE_ENV&&(sn={})};var fn=dn,mn=function(){};function vn(){return null}function pn(){}function gn(){}"production"!==process.env.NODE_ENV&&(mn=function(e){var t="Warning: "+e;"undefined"!=typeof console&&console.error(t);try{throw new Error(t)}catch(e){}}),gn.resetWarningCache=pn;var hn=k(function(e){e.exports="production"!==process.env.NODE_ENV?function(e,t){var n="function"==typeof Symbol&&Symbol.iterator,r={array:a("array"),bigint:a("bigint"),bool:a("boolean"),func:a("function"),number:a("number"),object:a("object"),string:a("string"),symbol:a("symbol"),any:l(vn),arrayOf:function(e){return l(function(t,n,r,o,l){if("function"!=typeof e)return new i("Property `"+l+"` of component `"+r+"` has invalid PropType notation inside arrayOf.");var a=t[n];if(!Array.isArray(a))return new i("Invalid "+o+" `"+l+"` of type `"+c(a)+"` supplied to `"+r+"`, expected an array.");for(var u=0;u<a.length;u++){var s=e(a,u,r,o,l+"["+u+"]",on);if(s instanceof Error)return s}return null})},element:l(function(t,n,r,o,l){var a=t[n];return e(a)?null:new i("Invalid "+o+" `"+l+"` of type `"+c(a)+"` supplied to `"+r+"`, expected a single ReactElement.")}),elementType:l(function(e,t,n,r,o){var l=e[t];return Jt.isValidElementType(l)?null:new i("Invalid "+r+" `"+o+"` of type `"+c(l)+"` supplied to `"+n+"`, expected a single ReactElement type.")}),instanceOf:function(e){return l(function(t,n,r,o,l){var a;return t[n]instanceof e?null:new i("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:l(function(e,t,n,r,o){return s(e[t])?null:new i("Invalid "+r+" `"+o+"` supplied to `"+n+"`, expected a ReactNode.")}),objectOf:function(e){return l(function(t,n,r,o,l){if("function"!=typeof e)return new i("Property `"+l+"` of component `"+r+"` has invalid PropType notation inside objectOf.");var a=t[n],u=c(a);if("object"!==u)return new i("Invalid "+o+" `"+l+"` of type `"+u+"` supplied to `"+r+"`, expected an object.");for(var s in a)if(ln(a,s)){var d=e(a,s,r,o,l+"."+s,on);if(d instanceof Error)return d}return null})},oneOf:function(e){if(!Array.isArray(e))return"production"!==process.env.NODE_ENV&&mn(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."),vn;function t(t,n,r,l,a){for(var u=t[n],s=0;s<e.length;s++)if(o(u,e[s]))return null;var c=JSON.stringify(e,function(e,t){return"symbol"===d(t)?String(t):t});return new i("Invalid "+l+" `"+a+"` of value `"+String(u)+"` supplied to `"+r+"`, expected one of "+c+".")}return l(t)},oneOfType:function(e){if(!Array.isArray(e))return"production"!==process.env.NODE_ENV&&mn("Invalid argument supplied to oneOfType, expected an instance of array."),vn;for(var t=0;t<e.length;t++){var n=e[t];if("function"!=typeof n)return mn("Invalid argument supplied to oneOfType. Expected an array of check functions, but received "+f(n)+" at index "+t+"."),vn}return l(function(t,n,r,o,l){for(var a=[],u=0;u<e.length;u++){var s=(0,e[u])(t,n,r,o,l,on);if(null==s)return null;s.data&&ln(s.data,"expectedType")&&a.push(s.data.expectedType)}return new i("Invalid "+o+" `"+l+"` supplied to `"+r+"`"+(a.length>0?", expected one of type ["+a.join(", ")+"]":"")+".")})},shape:function(e){return l(function(t,n,r,o,l){var a=t[n],s=c(a);if("object"!==s)return new i("Invalid "+o+" `"+l+"` of type `"+s+"` supplied to `"+r+"`, expected `object`.");for(var f in e){var m=e[f];if("function"!=typeof m)return u(r,o,l,f,d(m));var v=m(a,f,r,o,l+"."+f,on);if(v)return v}return null})},exact:function(e){return l(function(t,n,r,o,l){var a=t[n],s=c(a);if("object"!==s)return new i("Invalid "+o+" `"+l+"` of type `"+s+"` supplied to `"+r+"`, expected `object`.");var f=rn({},t[n],e);for(var m in f){var v=e[m];if(ln(e,m)&&"function"!=typeof v)return u(r,o,l,m,d(v));if(!v)return new i("Invalid "+o+" `"+l+"` key `"+m+"` supplied to `"+r+"`.\nBad object: "+JSON.stringify(t[n],null," ")+"\nValid keys: "+JSON.stringify(Object.keys(e),null," "));var p=v(a,m,r,o,l+"."+m,on);if(p)return p}return null})}};function o(e,t){return e===t?0!==e||1/e==1/t:e!=e&&t!=t}function i(e,t){this.message=e,this.data=t&&"object"==typeof t?t:{},this.stack=""}function l(e){function t(t,n,r,o,l,a,u){if(o=o||"<<anonymous>>",a=a||r,u!==on){var s=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 s.name="Invariant Violation",s}return null==n[r]?t?new i(null===n[r]?"The "+l+" `"+a+"` is marked as required in `"+o+"`, but its value is `null`.":"The "+l+" `"+a+"` is marked as required in `"+o+"`, but its value is `undefined`."):null:e(n,r,o,l,a)}process;var n=t.bind(null,!1);return n.isRequired=t.bind(null,!0),n}function a(e){return l(function(t,n,r,o,l,a){var u=t[n];return c(u)!==e?new i("Invalid "+o+" `"+l+"` of type `"+d(u)+"` supplied to `"+r+"`, expected `"+e+"`.",{expectedType:e}):null})}function u(e,t,n,r,o){return new i((e||"React class")+": "+t+" type `"+n+"."+r+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+o+"`.")}function s(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(s);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,i=r.call(t);if(r!==t.entries){for(;!(o=i.next()).done;)if(!s(o.value))return!1}else for(;!(o=i.next()).done;){var l=o.value;if(l&&!s(l[1]))return!1}return!0;default:return!1}}function c(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=c(e);if("object"===t){if(e instanceof Date)return"date";if(e instanceof RegExp)return"regexp"}return t}function f(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 i.prototype=Error.prototype,r.checkPropTypes=fn,r.resetWarningCache=fn.resetWarningCache,r.PropTypes=r,r}(Jt.isElement):function(){function e(e,t,n,r,o,i){if(i!==on){var l=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 l.name="Invariant Violation",l}}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:gn,resetWarningCache:pn};return n.PropTypes=n,n}()});const En=e=>{let{children:t}=e;return r.createElement("div",{className:"banner banner-container"},t)},yn=e=>{var n;let{showTenant:i=!0}=e;const{data:l,isLoading:a}=Digit.Hooks.useStore.getInitData(),{stateInfo:u}=l||{},{t:s}=o.useTranslation();return a?r.createElement(t.Loader,null):r.createElement("div",{className:"bannerHeader"},r.createElement("img",{className:"bannerLogo",src:null==u?void 0:u.logoUrl,style:i?{}:{borderRight:"unset"}}),i&&r.createElement("p",null,s("TENANT_TENANTS_"+(null==u||null===(n=u.code)||void 0===n?void 0:n.toUpperCase()))))},_n=e=>{var o,i,l;let{config:s,t:c}=e;const[d,f]=n.useState(null),{mobile_number:m,tenantId:v}=Digit.Hooks.useQueryParams(),p=a.useHistory(),[g,h]=n.useState(""),[E,y]=n.useState(!0),[_,b]=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`;p.replace(n)},[d]);const O=()=>{b(null)},[S,w,N]=s.inputs,I=[{body:[{label:c(S.label),type:S.type,populators:{name:S.name},isMandatory:!0},{label:c(w.label),type:w.type,populators:{name:w.name},isMandatory:!0},{label:c(N.label),type:N.type,populators:{name:N.name},isMandatory:!0}]}];return r.createElement(En,null,r.createElement("div",{className:"employeeBackbuttonAlign"},r.createElement(t.BackButton,{variant:"white",style:{borderBottom:"none"}})),r.createElement(u.FormComposer,{onSubmit:function(e){try{return Promise.resolve(te(function(){if(e.newPassword!==e.confirmPassword)return b(c("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;p.replace(`/${null===(e=window)||void 0===e?void 0:e.contextPath}/employee/user/login`)})()})},function(e){var t,n,r,o,i;b((null==e||null===(t=e.response)||void 0===t||null===(n=t.data)||void 0===n||null===(r=n.error)||void 0===r||null===(o=r.fields)||void 0===o||null===(i=o[0])||void 0===i?void 0:i.message)||c("ES_SOMETHING_WRONG")),setTimeout(O,5e3)}))}catch(e){return Promise.reject(e)}},noBoxShadow:!0,inline:!0,submitInForm:!0,config:I,label:s.texts.submitButtonLabel,cardStyle:{maxWidth:"408px",margin:"auto"},className:"employeeChangePassword"},r.createElement(yn,null),r.createElement(u.CardSubHeader,{style:{textAlign:"center"}}," ",s.texts.header," "),r.createElement(t.CardText,null,c("CS_LOGIN_OTP_TEXT")+" ",r.createElement("b",null," ",""+c("+ 91 - ")," ",m)),r.createElement(se,{t:c,userType:"employee",otp:g,onOtpChange:h,error:E,onResend:function(){try{function e(){setTimeout(O,5e3)}const t={otp:{mobileNumber:m,userType:C().toUpperCase(),type:"passwordreset",tenantId:v}},n=te(function(){return Promise.resolve(Digit.UserService.sendOtp(t,v)).then(function(){b(c("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)||c("ES_INVALID_LOGIN_CREDENTIALS"))});return Promise.resolve(n&&n.then?n.then(e):e())}catch(e){return Promise.reject(e)}}})),_&&r.createElement(t.Toast,{type:"error",label:c(_),onClose:O}),r.createElement("div",{className:"EmployeeLoginFooter"},r.createElement("img",{alt:"Powered by DIGIT",src:null===(o=window)||void 0===o||null===(i=o.globalConfigs)||void 0===i||null===(l=i.getConfig)||void 0===l?void 0:l.call(i,"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.propTypes={loginParams:hn.any},_n.defaultProps={loginParams:null};const bn=[{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"}]}],Cn=()=>{const{t:e}=o.useTranslation(),{path:t}=a.useRouteMatch(),i=n.useMemo(()=>bn.map(t=>{const n={};for(const r in t.texts)n[r]=e(t.texts[r]);return{...t,texts:n}},[bn]));return r.createElement(a.Switch,null,r.createElement(a.Route,{path:""+t,exact:!0},r.createElement(_n,{config:i[0],t:e})))},On=[{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"}]}],Sn=e=>{var o,i,l;let{config:s,t:c}=e;const{data:d,isLoading:f}=Digit.Hooks.useTenants(),[m,v]=n.useState(null),p=a.useHistory(),[g,h]=n.useState(null);n.useEffect(()=>{var e,t;if(!m)return void Digit.UserService.setType("employee");Digit.UserService.setUser(m);const n=(null===(e=location.state)||void 0===e?void 0:e.from)||`/${null===(t=window)||void 0===t?void 0:t.contextPath}/employee`;p.replace(n)},[m]);const E=()=>{h(null)},[y,_]=s.inputs,b=[{body:[{label:c(y.label),type:y.type,populators:{name:y.name,componentInFront:"+91"},isMandatory:!0},{label:c(_.label),type:_.type,populators:{name:_.name,customProps:{},component:(e,n)=>r.createElement(t.Dropdown,I({option:d,optionKey:"name",id:_.name,className:"login-city-dd",select:t=>{e.onChange(t)}},n))},isMandatory:!0}]}];return f?r.createElement(t.Loader,null):r.createElement(En,null,r.createElement("div",{className:"employeeBackbuttonAlign"},r.createElement(t.BackLink,null)),r.createElement(u.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=te(function(){return Promise.resolve(Digit.UserService.sendOtp(t,e.city.code)).then(function(){var t;p.push(`/${null===(t=window)||void 0===t?void 0:t.contextPath}/employee/user/change-password?mobile_number=${e.mobileNumber}&tenantId=${e.city.code}`)})},function(e){var t,n,r,o,i;h((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===(i=o[0])||void 0===i?void 0:i.message)||"Invalid login credentials!"),setTimeout(E,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:s.texts.submitButtonLabel,secondaryActionLabel:s.texts.secondaryButtonLabel,onSecondayActionClick:()=>{var e;p.replace(`/${null===(e=window)||void 0===e?void 0:e.contextPath}/employee/login`)},heading:s.texts.header,description:s.texts.description,headingStyle:{textAlign:"center"},cardStyle:{maxWidth:"408px",margin:"auto"},className:"employeeForgotPassword"},r.createElement(yn,null)),g&&r.createElement(t.Toast,{type:"error",label:c(g),onClose:E}),r.createElement("div",{className:"EmployeeLoginFooter"},r.createElement("img",{alt:"Powered by DIGIT",src:null===(o=window)||void 0===o||null===(i=o.globalConfigs)||void 0===i||null===(l=i.getConfig)||void 0===l?void 0:l.call(i,"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:hn.any},Sn.defaultProps={loginParams:null};const wn=()=>{const{t:e}=o.useTranslation(),{path:t}=a.useRouteMatch(),i=n.useMemo(()=>On.map(t=>{const n={};for(const r in t.texts)n[r]=e(t.texts[r]);return{...t,texts:n}},[On]));return r.createElement(a.Switch,null,r.createElement(a.Route,{path:""+t,exact:!0},r.createElement(Sn,{config:i[0],t:e})))},Nn=(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)}),In=e=>{var t;let{stateCode:n,userType:o,modules:i,appTenants:l,additionalComponent:u}=e;Digit;const{path:s}=a.useRouteMatch(),c=a.useLocation(),d=Digit.UserService.getUser();var f;if(!d||null==d||!d.access_token||null==d||!d.info)return r.createElement(a.Redirect,{to:{pathname:`/${null===(f=window)||void 0===f?void 0:f.contextPath}/employee/user/login`,state:{from:c.pathname+c.search}}});const m=i.map((e,t)=>{var i;let{code:u,tenants:c}=e;const d=Digit.ComponentRegistryService.getComponent(u+"Module");return r.createElement(a.Route,{key:t,path:`${s}/${u.toLowerCase()}`},d?r.createElement(d,{stateCode:n,moduleCode:u,userType:o,tenants:Nn(c,l)}):r.createElement(a.Redirect,{to:`/${null===(i=window)||void 0===i?void 0:i.contextPath}/employee/user/error?type=notfound&module=${u}`}))});return r.createElement("div",{className:"ground-container digit-home-ground"},r.createElement(a.Switch,null,m,r.createElement(a.Route,{path:s+"/login"},r.createElement(a.Redirect,{to:{pathname:`/${null===(t=window)||void 0===t?void 0:t.contextPath}/employee/user/login`,state:{from:c.pathname+c.search}}})),r.createElement(a.Route,{path:s+"/forgot-password"},r.createElement(wn,null)),r.createElement(a.Route,{path:s+"/change-password"},r.createElement(Cn,null)),r.createElement(a.Route,null,r.createElement(y,{userType:o,modules:i,additionalComponent:u}))))},Dn={label:"English",value:Digit.Utils.getDefaultLanguage()},Tn=()=>{var e,i,l,s,c;const{data:d,isLoading:f}=Digit.Hooks.useStore.getInitData(),{t:m}=o.useTranslation(),v=a.useHistory(),{languages:p,stateInfo:g}=d||{};let h=p;h&&0!=(null===(e=h)||void 0===e?void 0:e.length)||(h=[Dn]);const E=Digit.StoreData.getCurrentLanguage(),[y,_]=n.useState(E);return f?r.createElement(t.Loader,null):r.createElement(En,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,m("TENANT_TENANTS_"+(null==g||null===(i=g.code)||void 0===i?void 0:i.toUpperCase())))),r.createElement("div",{className:"language-selector",style:{justifyContent:"space-around",marginBottom:"24px",padding:"0 5%"}},h.map((e,t)=>r.createElement("div",{className:"language-button-container",key:t},r.createElement(u.CustomButton,{selected:e.value===y,text:e.label,onClick:()=>(e=>{_(e.value),Digit.LocalizationService.changeLanguage(e.value,g.code)})(e)})))),r.createElement(t.SubmitBar,{style:{width:"100%"},label:m("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===(l=window)||void 0===l||null===(s=l.globalConfigs)||void 0===s||null===(c=s.getConfig)||void 0===c?void 0:c.call(s,"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()}})," "))},Rn=[{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)}))}"}}}]}],Ln=[{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"}}]}],An=e=>{var o,i,l,u,s,c,d,f,m,v,p,g,h;let{config:E,t:y,isDisabled:_,loginOTPBased:b}=e;const{isLoading:C}=Digit.Hooks.useTenants(),{isLoading:O}=Digit.Hooks.useStore.getInitData(),[S,w]=n.useState(null),[N,I]=n.useState(null),[D,T]=n.useState(!1),R=a.useHistory();n.useEffect(()=>{var e,t,n,r,o,i,l,a,u,s,c,d,f,m,v,p,g,h;if(!S)return;Digit.SessionStorage.set("citizen.userRequestObject",S);const E=null==S||null===(e=S.info)||void 0===e||null===(t=e.roles)||void 0===t?void 0:t.filter(e=>e.tenantId===Digit.SessionStorage.get("Employee.tenantId"));(null==S||null===(n=S.info)||void 0===n||null===(r=n.roles)||void 0===r?void 0:r.length)>0&&(S.info.roles=E),Digit.UserService.setUser(S),((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==S?void 0:S.info,null==S?void 0:S.access_token);let y=`/${null===(o=window)||void 0===o?void 0:o.contextPath}/employee`;var _,b,C,O,w,N,I;null!==(i=window)&&void 0!==i&&null!==(l=i.location)&&void 0!==l&&null!==(a=l.href)&&void 0!==a&&a.includes("from=")&&(y=decodeURIComponent(null===(_=window)||void 0===_||null===(b=_.location)||void 0===b||null===(C=b.href)||void 0===C||null===(O=C.split("from="))||void 0===O?void 0:O[1])||`/${null===(w=window)||void 0===w?void 0:w.contextPath}/employee`),null!=S&&null!==(u=S.info)&&void 0!==u&&u.roles&&(null==S||null===(s=S.info)||void 0===s||null===(c=s.roles)||void 0===c?void 0:c.length)>0&&null!=S&&null!==(d=S.info)&&void 0!==d&&null!==(f=d.roles)&&void 0!==f&&f.every(e=>"NATADMIN"===e.code)&&(y=`/${null===(N=window)||void 0===N?void 0:N.contextPath}/employee/dss/landing/NURT_DASHBOARD`),null!=S&&null!==(m=S.info)&&void 0!==m&&m.roles&&(null==S||null===(v=S.info)||void 0===v||null===(p=v.roles)||void 0===p?void 0:p.length)>0&&null!=S&&null!==(g=S.info)&&void 0!==g&&null!==(h=g.roles)&&void 0!==h&&h.every(e=>"STADMIN"===e.code)&&(y=`/${null===(I=window)||void 0===I?void 0:I.contextPath}/employee/dss/landing/home`),R.replace(y)},[S]);const L={url:"/user-otp/v1/_send",params:{tenantId:Digit.ULBService.getStateId()},body:{},config:{enable:!1}},A=Digit.Hooks.useCustomAPIMutationHook(L),x=()=>{I(null)},P={code:Digit.ULBService.getStateId(),name:Digit.Utils.locale.getTransformedLocale("TENANT_TENANTS_"+Digit.ULBService.getStateId())};let M=[{body:null==E?void 0:E.inputs}];const{mode:k}=Digit.Hooks.useQueryParams();return"admin"===k&&0==(null==M||null===(o=M[0])||void 0===o||null===(i=o.body)||void 0===i||null===(l=i[2])||void 0===l?void 0:l.disable)&&null==(null==M||null===(u=M[0])||void 0===u||null===(s=u.body)||void 0===s||null===(c=s[2])||void 0===c||null===(d=c.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=P),C||O?r.createElement(t.Loader,null):r.createElement(En,null,r.createElement("div",{className:"employeeBackbuttonAlign"},r.createElement(t.BackLink,null)),r.createElement(t.FormComposerV2,{onSubmit:b?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,i,l,a,u;I({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===(i=e.response)||void 0===i||null===(l=i.data)||void 0===l||null===(a=l.Errors)||void 0===a||null===(u=a[0])||void 0===u?void 0:u.code):"SANDBOX_RESEND_OTP_ERROR"}),setTimeout(x,5e3)},onSuccess:function(e){try{var n;return R.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 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=te(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),w({info:t,...n})})},function(e){var t,n;I((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)&&y("ES_ERROR_USER_NOT_PERMITTED")||y("INVALID_LOGIN_CREDENTIALS")),setTimeout(x,5e3)});return Promise.resolve(o&&o.then?o.then(n):n())}catch(e){return Promise.reject(e)}},isDisabled:_||D,noBoxShadow:!0,inline:!0,submitInForm:!0,config:M,label:null==E||null===(f=E.texts)||void 0===f?void 0:f.submitButtonLabel,secondaryActionLabel:null==E||null===(m=E.texts)||void 0===m?void 0:m.secondaryButtonLabel,onSecondayActionClick:()=>{var e;R.push(`/${null===(e=window)||void 0===e?void 0:e.contextPath}/employee/user/forgot-password`)},onFormValueChange:(e,t,n)=>{const r=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(r)},heading:null==E||null===(v=E.texts)||void 0===v?void 0:v.header,className:"loginFormStyleEmployee "+(b?"sandbox-onboarding-wrapper":""),cardSubHeaderClassName:"loginCardSubHeaderClassName",cardClassName:"loginCardClassName",buttonClassName:"buttonClassName"},r.createElement(yn,null)),N&&r.createElement(t.Toast,{type:"error",label:y(N),onClose:x}),r.createElement("div",{className:"employee-login-home-footer",style:{backgroundColor:"unset"}},r.createElement("img",{alt:"Powered by DIGIT",src:null===(p=window)||void 0===p||null===(g=p.globalConfigs)||void 0===g||null===(h=g.getConfig)||void 0===h?void 0:h.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()}})," "))};An.propTypes={loginParams:hn.any},An.defaultProps={loginParams:null};const xn=e=>{var t,i;let{stateCode:l}=e;const{t:u}=o.useTranslation(),{path:s}=a.useRouteMatch(),[c,d]=n.useState(Rn),[f,m]=n.useState(Ln),v=Digit.StoreData.getCurrentLanguage(),p=(null===(t=window)||void 0===t||null===(i=t.globalConfigs)||void 0===i?void 0:i.getConfig("OTP_BASED_LOGIN"))||!1,{data:g,isLoading:h}=(Digit.Services.useStore({stateCode:l,moduleCode:["privacy-policy"],language:v,modulePrefix:"digit"}),Digit.Hooks.useCommonMDMS(l,"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==h&&null!=g&&g.config?null==g?void 0:g.config:Rn)},[g,h]);const E=n.useMemo(()=>c.map(e=>{const t={};for(const n in e.texts)t[n]=u(e.texts[n]);return{...e,texts:t}},[c])),y=n.useMemo(()=>f.map(e=>{const t={};for(const n in e.texts)t[n]=u(e.texts[n]);return{...e,texts:t}},[f]));return r.createElement(a.Switch,null,r.createElement(a.Route,{path:""+s,exact:!0},r.createElement(An,p?{config:y[0],t:u,loginOTPBased:p}:{config:E[0],t:u})))},Pn=[{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"}}]}],Mn=e=>{var o,i,l,u,s,c,d,f,m,v,p,g,h;let{config:E,t:y,isDisabled:_}=e;const{isLoading:b}=Digit.Hooks.useTenants(),{isLoading:C}=Digit.Hooks.useStore.getInitData(),[O,S]=n.useState(null),[w,N]=n.useState(!1),I=a.useHistory(),D=Digit.Hooks.useCustomAPIMutationHook({url:"/tenant-management/tenant/_create",params:{},body:{},config:{enable:!1}});let T=[{body:null==E?void 0:E.inputs}];const{mode:R}=Digit.Hooks.useQueryParams();return"admin"===R&&0==(null==T||null===(o=T[0])||void 0===o||null===(i=o.body)||void 0===i||null===(l=i[2])||void 0===l?void 0:l.disable)&&null==(null==T||null===(u=T[0])||void 0===u||null===(s=u.body)||void 0===s||null===(c=s[2])||void 0===c||null===(d=c.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||C?r.createElement(t.Loader,null):r.createElement(En,null,r.createElement("div",{className:"employeeBackbuttonAlign"},r.createElement(t.BackLink,null)),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,i,l,a,u,s;S({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!==(i=o[0])&&void 0!==i&&i.code?"SANDBOX_SIGNUP_"+(null==e||null===(l=e.response)||void 0===l||null===(a=l.data)||void 0===a||null===(u=a.Errors)||void 0===u||null===(s=u[0])||void 0===s?void 0:s.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:_||w,noBoxShadow:!0,inline:!0,submitInForm:!0,config:T,label:null==E||null===(f=E.texts)||void 0===f?void 0:f.submitButtonLabel,secondaryActionLabel:null==E||null===(m=E.texts)||void 0===m?void 0:m.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});N(r)},heading:null==E||null===(v=E.texts)||void 0===v?void 0:v.header,className:"sandbox-signup-form",cardSubHeaderClassName:"signupCardSubHeaderClassName",cardClassName:"signupCardClassName sandbox-onboarding-wrapper",buttonClassName:"buttonClassName"},r.createElement(yn,{showTenant:!1})),O&&r.createElement(t.Toast,{type:"error",label:y(null==O?void 0:O.label),onClose:()=>{S(null)}}),r.createElement("div",{className:"employee-login-home-footer",style:{backgroundColor:"unset"}},r.createElement("img",{alt:"Powered by DIGIT",src:null===(p=window)||void 0===p||null===(g=p.globalConfigs)||void 0===g||null===(h=g.getConfig)||void 0===h?void 0:h.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()}})))};Mn.propTypes={loginParams:hn.any},Mn.defaultProps={loginParams:null};const kn=e=>{let{stateCode:t}=e;const{t:i}=o.useTranslation(),{path:l}=a.useRouteMatch(),[u,s]=n.useState(Pn),c=Digit.StoreData.getCurrentLanguage(),{data:d,isLoading:f}=(Digit.Services.useStore({stateCode:t,moduleCode:["privacy-policy"],language:c,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(()=>{s(0==f&&null!=d&&d.config?null==d?void 0:d.config:Pn)},[d,f]);const m=n.useMemo(()=>u.map(e=>{const t={};for(const n in e.texts)t[n]=i(e.texts[n]);return{...e,texts:t}},[u]));return r.createElement(a.Switch,null,r.createElement(a.Route,{path:""+l,exact:!0},r.createElement(Mn,{config:m[0],t:i})))},Un=e=>{var i,l,s,c;let{isLogin:d=!1}=e;const{t:f}=o.useTranslation(),m=(a.useRouteMatch(),a.useHistory()),v=a.useLocation(),[p,g]=n.useState(null),[h,E]=n.useState(!1),[y,_]=n.useState(null),[b,C]=n.useState((null==v||null===(i=v.state)||void 0===i?void 0:i.data)||{}),{email:O,tenant:S}=v.state||{},w=[{body:[{type:"component",component:"OtpComponent",key:"OtpComponent",withoutLabel:!0,isMandatory:!1,customProps:{email:O,tenant:S},populators:{required:!0}}]}],N=[{texts:{header:f("SANDBOX_OTP_VERIFICATION"),submitButtonLabel:"CORE_COMMON_SUBMIT"}}],I=()=>{g(null)};return n.useEffect(()=>{var e,t,n,r,o,i;if(!y)return;Digit.SessionStorage.set("citizen.userRequestObject",y);const l=null==y||null===(e=y.info)||void 0===e||null===(t=e.roles)||void 0===t?void 0:t.filter(e=>e.tenantId===Digit.SessionStorage.get("Employee.tenantId"));(null==y||null===(n=y.info)||void 0===n||null===(r=n.roles)||void 0===r?void 0:r.length)>0&&(y.info.roles=l),Digit.UserService.setUser(y),((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==y?void 0:y.info,null==y?void 0:y.access_token);let a=`/${null===(o=window)||void 0===o?void 0:o.globalPath}/user/url`,u=`/${null===(i=window)||void 0===i?void 0:i.contextPath}/employee`;return d?void m.push(u):void m.push({pathname:a,state:{tenant:S}})},[y]),r.createElement(En,null,r.createElement("div",{className:"employeeBackbuttonAlign"},r.createElement(t.BackLink,null)),r.createElement(u.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:S,userType:"EMPLOYEE"},r=te(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),_({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)&&f("ES_ERROR_USER_NOT_PERMITTED")||f("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)?E(!0):E(!1)},isDisabled:!h,config:w,label:N[0].texts.submitButtonLabel,heading:N[0].texts.header,headingStyle:{textAlign:"center"},cardStyle:{maxWidth:"408px",margin:"auto"},className:"sandbox-onboarding-wrapper"},r.createElement(yn,{showTenant:!1})),p&&r.createElement(t.Toast,{type:"error",label:f(p),onClose:I}),r.createElement("div",{className:"EmployeeLoginFooter"},r.createElement("img",{alt:"Powered by DIGIT",src:null===(l=window)||void 0===l||null===(s=l.globalConfigs)||void 0===s||null===(c=s.getConfig)||void 0===c?void 0:c.call(s,"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=()=>{var e,n,i,l;const{t:u}=o.useTranslation(),s=a.useLocation(),{tenant:c}=s.state||{};return a.useHistory(),r.createElement(En,null,r.createElement("div",{className:"employeeBackbuttonAlign"},r.createElement(t.BackLink,null)),r.createElement(t.Card,{className:"card-sandbox"},r.createElement(yn,{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"}},u("SANDBOX_HEADER")),r.createElement(t.CardText,{className:"cardText-sandbox"},u("SAMDBOX_URL_SUB")),r.createElement(t.FieldV1,{className:"field-sandbox",withoutLabel:!1,label:u("SANDBOX_URL"),type:"text",nonEditable:!1,value:`${window.location.host}/${null===(e=window)||void 0===e?void 0:e.globalPath}/${c}`,placeholder:u("SANDBOX_URL_PLACEHOLDER"),populators:{}}),r.createElement("div",{className:"sandbox-url-footer"},u("SANDBOX_URL_FOOT")),r.createElement(t.Button,{onClick:()=>{var e;window.location.href=`/${null===(e=window)||void 0===e?void 0:e.globalPath}/${c}/employee`},label:u("SIGN_IN")})),r.createElement("div",{className:"EmployeeLoginFooter"},r.createElement("img",{alt:"Powered by DIGIT",src:null===(n=window)||void 0===n||null===(i=n.globalConfigs)||void 0===i||null===(l=i.getConfig)||void 0===l?void 0:l.call(i,"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=["user/profile","user/error"],Fn=e=>{var i,l,u,s,c,d;let{stateInfo:f,userDetails:v,CITIZEN:g,cityDetails:h,mobileView:E,handleUserDropdownSelection:y,logoUrl:_,DSO:b,stateCode:C,modules:O,appTenants:S,initData:w}=e;const N=a.useHistory(),{t:I}=o.useTranslation(),{path:D}=a.useRouteMatch(),T=a.useLocation(),R=null==T||null===(i=T.pathname)||void 0===i?void 0:i.includes("language-selection"),L=jn.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 A=null==w||null===(l=w.modules)||void 0===l||null===(u=l.filter(e=>null==e?void 0:e.additionalComponent))||void 0===u?void 0:u.map(e=>null==e?void 0:e.additionalComponent);return r.createElement("div",{className:"employee"},r.createElement(a.Switch,null,r.createElement(a.Route,{path:D+"/user"},L&&r.createElement(W,{t:I,stateInfo:f,userDetails:v,CITIZEN:g,cityDetails:h,mobileView:E,handleUserDropdownSelection:y,logoUrl:_,showSidebar:!!L,showLanguageChange:!R}),r.createElement("div",{className:L?"grounded-container":"loginContainer",style:L?{padding:0,paddingTop:"80px",marginLeft:E?"":"64px"}:{"--banner-url":`url(${null==f?void 0:f.bannerUrl})`,padding:"0px"}},r.createElement(a.Switch,null,r.createElement(a.Route,{exact:!0,path:D+"/user/login"},r.createElement(xn,{stateCode:C})),r.createElement(a.Route,{exact:!0,path:D+"/user/login/otp"},r.createElement(Un,{isLogin:!0})),r.createElement(a.Route,{path:D+"/user/forgot-password"},r.createElement(wn,null)),r.createElement(a.Route,{path:D+"/user/change-password"},r.createElement(Cn,null)),r.createElement(t.PrivateRoute,{path:D+"/user/profile"},r.createElement(re,{stateCode:C,userType:"employee",cityDetails:h})),r.createElement(a.Route,{path:D+"/user/error"},r.createElement(m,{initData:w,goToHome:()=>{var e,t,n,r;N.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(a.Route,{path:D+"/user/language-selection"},r.createElement(Tn,null)),r.createElement(a.Route,null,r.createElement(a.Redirect,{to:D+"/user/language-selection"}))))),r.createElement(a.Route,null,r.createElement(W,{t:I,stateInfo:f,userDetails:v,CITIZEN:g,cityDetails:h,mobileView:E,handleUserDropdownSelection:y,logoUrl:_,modules:O}),r.createElement("div",{className:`main ${b?"m-auto":""} digit-home-main`},r.createElement("div",{className:"employee-app-wrapper digit-home-app-wrapper"},r.createElement(p,{initData:w},r.createElement(In,{stateCode:C,userType:"employee",modules:O,appTenants:S,additionalComponent:A}))),r.createElement("div",{className:"employee-home-footer"},r.createElement("img",{alt:"Powered by DIGIT",src:null===(s=window)||void 0===s||null===(c=s.globalConfigs)||void 0===c||null===(d=c.getConfig)||void 0===d?void 0:d.call(c,"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(a.Route,null,r.createElement(a.Redirect,{to:D+"/user/language-selection"}))))},Vn=e=>{var t,o,i,l;let{stateCode:u,modules:s,appTenants:c,logoUrl:d,initData:f,defaultLanding:m="citizen"}=e;const v=a.useHistory(),{pathname:p}=a.useLocation(),g=window.innerWidth,h=Digit.ULBService.getCurrentUlb(),E=Digit.UserService.getUser(),{data:y}=Digit.Hooks.useStore.getInitData(),{stateInfo:_}=y||{},b=Digit.UserService.hasAccess(["FSM_DSO"]);let C="CITIZEN"===(null==E||null===(t=E.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!=p&&p.includes("application-details")||(null!=p&&p.includes("inbox")||Digit.SessionStorage.del("fsm/inbox/searchParams"),null!=p&&p.includes("search")&&Digit.SessionStorage.del("fsm/search/searchParams")),null!=p&&p.includes("dss")||Digit.SessionStorage.del("DSS_FILTERS"),(null==p?void 0:p.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==p?void 0:p.toString())!==`/${null===(t=window)||void 0===t?void 0:t.contextPath}/citizen`&&(null==p?void 0:p.toString())!==`/${null===(n=window)||void 0===n?void 0:n.contextPath}/employee`||Digit.SessionStorage.del("WS_DISCONNECTION")},[p]),v.listen(()=>{var e;null===(e=window)||void 0===e||e.scrollTo({top:0,left:0,behavior:"smooth"})});const O={stateInfo:_,userDetails:E,CITIZEN:C,cityDetails:h,mobileView:g<=640,handleUserDropdownSelection:e=>{e.func()},logoUrl:d,DSO:b,stateCode:u,modules:s,appTenants:c,sourceUrl:window.location.origin+"/citizen",pathname:p,initData:f};return r.createElement(a.Switch,null,r.createElement(a.Route,{path:`/${null===(o=window)||void 0===o?void 0:o.contextPath}/employee`},r.createElement(Fn,O)),r.createElement(a.Route,{path:`/${null===(i=window)||void 0===i?void 0:i.contextPath}/citizen`},r.createElement(Dt,O)),r.createElement(a.Route,null,r.createElement(a.Redirect,{to:`/${null===(l=window)||void 0===l?void 0:l.contextPath}/${m}`})))},zn=e=>{var t,n,o,i,l,u,s;let{stateCode:c,modules:d,appTenants:f,logoUrl:m,initData:v,defaultLanding:p="citizen"}=e;const{data:g}=Digit.Hooks.useStore.getInitData(),{stateInfo:h}=g||{},E=["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 r.createElement("div",{className:E?"grounded-container":"loginContainer",style:E?{padding:0,paddingTop:"80px",marginLeft:"64px"}:{"--banner-url":`url(${null==h?void 0:h.bannerUrl})`,padding:"0px"}},r.createElement(a.Switch,null,r.createElement(a.Route,{exact:!0,path:`/${null===(t=window)||void 0===t?void 0:t.globalPath}/user/sign-up`},r.createElement(kn,{stateCode:c})),r.createElement(a.Route,{exact:!0,path:`/${null===(n=window)||void 0===n?void 0:n.globalPath}/user/otp`},r.createElement(Un,null)),r.createElement(a.Route,{exact:!0,path:`/${null===(o=window)||void 0===o?void 0:o.globalPath}/user/url`},r.createElement(Bn,null)),(null===(i=window)||void 0===i?void 0:i.globalPath)!==(null===(l=window)||void 0===l?void 0:l.contextPath)&&r.createElement(a.Route,{path:"/"+(null===(u=window)||void 0===u?void 0:u.contextPath)},r.createElement(Vn,{stateCode:c,modules:d,appTenants:f,logoUrl:m,initData:v,defaultLanding:p})),r.createElement(a.Route,null,r.createElement(a.Redirect,{to:`/${null===(s=window)||void 0===s?void 0:s.globalPath}/user/sign-up`}))))},Hn=[d],Wn=("object"==typeof window&&window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__?window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__({}):c.compose)(c.applyMiddleware(...Hn)),$n=e=>{let{onSelect:i,...l}=e;const{t:a}=o.useTranslation(),u=Digit.ULBService.getCurrentTenantId(),[s,c]=n.useState(!1),[d,f]=n.useState(!1),{data:m}=Digit.Hooks.useCustomMDMS(u,"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==l||null===(t=l.props)||void 0===t?void 0:t.module)})}});return n.useEffect(()=>{i("check",s)},[s]),r.createElement(r.Fragment,null,r.createElement("div",{className:"digit-privacy-checkbox"},r.createElement(t.CheckBox,{label:a("ES_BY_CLICKING"),checked:s,onChange:e=>{c(e.target.checked)}}),r.createElement(t.Button,{label:a("ES_PRIVACY_POLICY"),variation:"link",size:"medium",onClick:()=>{f(!0)},style:{marginBottom:"1.18rem",paddingLeft:"0.2rem"}})),d&&r.createElement(t.PopUp,{type:"default",className:"privacy-popUpClass",footerclassName:"popUpFooter",heading:a(null==m?void 0:m.header),onOverlayClick:()=>{f(!1)},footerChildren:[r.createElement(t.Button,{type:"button",size:"large",variation:"secondary",label:a("DIGIT_I_DO_NOT_ACCEPT"),onClick:()=>{c(!1),f(!1)}}),r.createElement(t.Button,{type:"button",size:"large",variation:"primary",label:a("DIGIT_I_ACCEPT"),className:"accept-class",onClick:()=>{c(!0),f(!1)}})],sortFooterChildren:!0,onClose:()=>{f(!1)}},r.createElement("div",null,r.createElement("div",{className:"privacy-table"},a("DIGIT_TABLE_OF_CONTENTS")),r.createElement("ul",null,null==m?void 0:m.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:a(e.header),variation:"link",size:"medium",onClick:t=>{t.preventDefault(),(e=>{const t=document.getElementById(e);t&&t.scrollIntoView({behavior:"smooth"})})(null==e?void 0:e.header)}}))))),null==m?void 0:m.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"}},a(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,". "),a(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"}}," "),a(e.text))))))))))},Gn=e=>{var n;let{stateCode:i,enabledModules:u,moduleReducers:s,defaultLanding:d}=e;const{isLoading:f,data:m={}}=Digit.Hooks.useInitStore(i,u);if(f)return r.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),Wn)}(m,s(m))||{};return o.getI18n(),Digit.ComponentRegistryService.getComponent("PrivacyComponent")||Digit.ComponentRegistryService.setComponent("PrivacyComponent",$n),r.createElement(l.Provider,{store:v},r.createElement(a.BrowserRouter,null,r.createElement(t.BodyContainer,null,r.createElement(zn,{initData:m,stateCode:i,modules:null==m?void 0:m.modules,appTenants:m.tenants,logoUrl:null==m||null===(n=m.stateInfo)||void 0===n?void 0:n.logoUrl,defaultLanding:d}))))},qn={SelectOtp:se,ChangeCity:b,ChangeLanguage:C,PrivacyComponent:$n,OtpComponent:e=>{var i,l;let{onSelect:s,...c}=e;const{t:d}=o.useTranslation(),[f,m]=(a.useLocation(),n.useState(null)),[v,p]=n.useState({}),[g,h]=n.useState(!0),[E,y]=n.useState(30),_=()=>{m(null)};ue(()=>{y(E-1)},E>0?1e3:null),n.useEffect(()=>{s("OtpComponent",v)},[v]);const b={url:"/user-otp/v1/_send",params:{tenantId:null==c||null===(i=c.props)||void 0===i?void 0:i.code},body:{},config:{enable:!1}},C=Digit.Hooks.useCustomAPIMutationHook(b);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==c||null===(l=c.props)||void 0===l?void 0:l.email),r.createElement(t.CardLabel,{className:"sandbox-custom-otp-subheader"},d("SANDBOX_ENTER_OTP")),r.createElement(u.OTPInput,{className:"sandbox-otp-input",length:6,onChange:e=>{p({...v,otp:e})},value:null==v?void 0:v.otp}),E>0?r.createElement(t.CardText,{className:"sandbox-resend-otp"},`${d("CS_RESEND_ANOTHER_OTP")} ${E} ${d("CS_RESEND_SECONDS")}`):r.createElement("p",{className:"card-text-button sandbox-otp-input",onClick:function(){try{var e,t;return y(30),Promise.resolve(C.mutate({body:{otp:{userName:null==c||null===(e=c.props)||void 0===e?void 0:e.email,type:"login",tenantId:null==c||null===(t=c.props)||void 0===t?void 0:t.tenant,userType:"EMPLOYEE"}},config:{enable:!0}},{onError:(e,t)=>{var n,r,o,i,l,a,u;m({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===(i=e.response)||void 0===i||null===(l=i.data)||void 0===l||null===(a=l.Errors)||void 0===a||null===(u=a[0])||void 0===u?void 0:u.code):"SANDBOX_RESEND_OTP_ERROR"}),setTimeout(_,5e3)},onSuccess:function(e){try{return m({key:"info",label:d("OTP_RESNED_SUCCESFULL")}),setTimeout(_,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")),f&&r.createElement(t.Toast,{type:null==f?void 0:f.key,label:d(null==f?void 0:f.label),onClose:_}))}};exports.DigitUI=e=>{let{stateCode:t,registry:o,enabledModules:l,moduleReducers:a,defaultLanding:u}=e;const[s,c]=n.useState(Digit.Utils.getPrivacyObject()||{}),d=(Digit.UserService.getType(),new i.QueryClient({defaultOptions:{queries:{staleTime:9e5,cacheTime:3e6,retry:!1,retryDelay:e=>Infinity}}})),f=Digit.Contexts.ComponentProvider,m=Digit.Contexts.PrivacyProvider;return Digit.UserService.hasAccess(["FSM_DSO"]),r.createElement("div",null,r.createElement(p,null,r.createElement(i.QueryClientProvider,{client:d},r.createElement(f.Provider,{value:o},r.createElement(m.Provider,{value:{privacy:null==s?void 0:s[window.location.pathname],resetPrivacy:e=>{Digit.Utils.setPrivacyObject({}),c({})},getPrivacy:()=>{const e=Digit.Utils.getPrivacyObject();return c(e),e},updatePrivacyDescoped:e=>{const t=Digit.Utils.getAllPrivacyObject(),n={...t,[window.location.pathname]:e};Digit.Utils.setPrivacyObject({...n}),c((null==t?void 0:t[window.location.pathname])||{})},updatePrivacy:(e,t)=>{c(Digit.Utils.updatePrivacy(e,t)||{})}}},r.createElement(Gn,{stateCode:t,enabledModules:l,moduleReducers:a,defaultLanding:u}))))))},exports.initCoreComponents=()=>{Object.entries(qn).forEach(e=>{let[t,n]=e;Digit.ComponentRegistryService.setComponent(t,n)})};
|
|
1
|
+
function e(e){return e&&"object"==typeof e&&"default"in e?e.default:e}var t=require("@egovernments/digit-ui-components"),n=require("react"),l=e(n),o=require("react-i18next"),r=require("react-query"),i=require("react-redux"),a=require("react-router-dom"),s=require("@egovernments/digit-ui-react-components"),c=require("redux"),u=e(require("redux-thunk"));const d={error:{imgUrl:"https://s3.ap-south-1.amazonaws.com/egov-qa-assets/error-image.png",infoMessage:"CORE_SOMETHING_WENT_WRONG",buttonInfo:"ACTION_TEST_HOME"},maintenance:{imgUrl:"https://s3.ap-south-1.amazonaws.com/egov-qa-assets/maintainence-image.png",infoMessage:"CORE_UNDER_MAINTENANCE",buttonInfo:"ACTION_TEST_HOME"},notfound:{imgUrl:"https://s3.ap-south-1.amazonaws.com/egov-qa-assets/PageNotFound.png",infoMessage:"MODULE_NOT_FOUND",buttonInfo:"ACTION_TEST_HOME"}},m=e=>{const{type:t="error"}=Digit.Hooks.useQueryParams(),n=d[t],{t:r}=o.useTranslation();return l.createElement("div",{className:"error-boundary"},l.createElement("div",{className:"error-container"},l.createElement("img",{src:n.imgUrl,alt:"error"}),l.createElement("h1",null,r(n.infoMessage)),l.createElement("button",{onClick:()=>{e.goToHome()}},r(n.buttonInfo))))},p=()=>{var e,t;const n="employee"===Digit.UserService.getType()?`/${null===(e=window)||void 0===e?void 0:e.contextPath}/employee/user/error`:`/${null===(t=window)||void 0===t?void 0:t.contextPath}/citizen/error`;return window.location.href.includes("employee/user/error")||window.location.href.includes("citizen/error")||"development"===process.env.NODE_ENV||(window.location.href=n),l.createElement("span",null)};class v extends l.Component{constructor(e){super(e),this.state={error:null,errorStack:null,hasError:!1}}static getDerivedStateFromError(e){return{error:null==e?void 0:e.message,hasError:!0,errorStack:null==e?void 0:e.stack}}componentDidCatch(e,t){this.setState({error:null==e?void 0:e.message,hasError:!0,errorStack:null==e?void 0:e.stack})}render(){return this.state.hasError?l.createElement("div",{className:"error-boundary"},l.createElement(p,null),l.createElement(m,{initData:this.props.initData})):this.props.children}}const g=(e,t,n)=>{const l=null==e?void 0:e[""+t];l&&l.map(e=>{e.link=e.navigationURL,e.i18nKey=n(e.name)});const o={links:null==l?void 0:l.reverse(),header:Digit.Utils.locale.getTransformedLocale("ACTION_TEST_"+t),iconName:`CITIZEN_${t}_ICON`};var r;return"FSM"===t&&[{role:"FSM_DSO",from:`/${null===(r=window)||void 0===r?void 0:r.contextPath}/citizen/fsm/dso-dashboard`,dashoardLink:"CS_LINK_DSO_DASHBOARD",loginLink:"CS_LINK_LOGIN_DSO"}].map(e=>{var t,l,r;let{role:i,from:a,loginLink:s,dashoardLink:c}=e;Digit.UserService.hasAccess(i)?null==o||null===(t=o.links)||void 0===t||t.push({link:a,i18nKey:n(c)}):null==o||null===(l=o.links)||void 0===l||l.push({link:`/${null===(r=window)||void 0===r?void 0:r.contextPath}/citizen/login`,state:{role:"FSM_DSO",from:a},i18nKey:n(s)})}),o},f=e=>{let{modules:n,getCitizenMenu:r,fetchedCitizen:i,isLoading:a}=e;const s=[n.filter(e=>{let{code:t}=e;return"Payment"===t})[0],...n.filter(e=>{let{code:t}=e;return"Payment"!==t})],{t:c}=o.useTranslation();return a?l.createElement(t.Loader,null):l.createElement(l.Fragment,null,l.createElement("div",{className:"citizen-all-services-wrapper"},location.pathname.includes("sanitation-ui/citizen/all-services")?null:l.createElement(t.BackButton,null),l.createElement("div",{className:"citizenAllServiceGrid"},s.filter(e=>e).map((e,n)=>{var o,a;let s,{code:u}=e;var d,m,p,v;return i&&(s=i?g(r,u,c):void 0),(null===(o=s)||void 0===o||null===(a=o.links)||void 0===a?void 0:a.length)>0?l.createElement(t.CitizenHomeCard,{header:c(null===(d=s)||void 0===d?void 0:d.header),links:null===(m=s)||void 0===m||null===(p=m.links)||void 0===p||null===(v=p.filter(e=>null==e?void 0:e.link))||void 0===v?void 0:v.sort((e,t)=>(null==e?void 0:e.orderNumber)-(null==t?void 0:t.orderNumber)),Icon:()=>(e=>{switch(e){case"PT":return l.createElement(PTIcon,{className:"fill-path-primary-main"});case"WS":return l.createElement(WSICon,{className:"fill-path-primary-main"});case"FSM":return l.createElement(t.FSMIcon,{className:"fill-path-primary-main"});case"MCollect":return l.createElement(t.MCollectIcon,{className:"fill-path-primary-main"});case"PGR":return l.createElement(PGRIcon,{className:"fill-path-primary-main"});case"TL":return l.createElement(TLIcon,{className:"fill-path-primary-main"});case"OBPS":return l.createElement(OBPSIcon,{className:"fill-path-primary-main"});case"Bills":return l.createElement(t.BillsIcon,{className:"fill-path-primary-main"});default:return l.createElement(PTIcon,{className:"fill-path-primary-main"})}})(u),Info:"OBPS"===u?()=>l.createElement(t.CitizenInfoLabel,{style:{margin:"0px",padding:"10px"},info:c("CS_FILE_APPLICATION_INFO_LABEL"),text:c("BPA_CITIZEN_HOME_STAKEHOLDER_INCLUDES_INFO_LABEL")}):null,isInfo:"OBPS"===u}):l.createElement(l.Fragment,null)}))))},E=e=>{let{modules:t,additionalComponent:o}=e;return l.createElement(n.Fragment,null,l.createElement("div",{className:"employee-app-container digit-home-employee-app"},l.createElement("div",{className:"ground-container moduleCardWrapper gridModuleWrapper digit-home-moduleCardWrapper"},null==t?void 0:t.map((e,t)=>{let{code:n}=e;const o=Digit.ComponentRegistryService.getComponent(n+"Card")||(()=>l.createElement(l.Fragment,null));return l.createElement(o,{key:t})}))),o&&(null==o?void 0:o.length)>0&&o.map(e=>{const t="string"==typeof e?Digit.ComponentRegistryService.getComponent(e):null;return t?l.createElement("div",{className:"additional-component-wrapper"},l.createElement(t,null)):null}))},y=e=>{let{userType:t,modules:n,getCitizenMenu:o,fetchedCitizen:r,isLoading:i,additionalComponent:a}=e;return"citizen"===t?l.createElement(f,{modules:n,getCitizenMenu:o,fetchedCitizen:r,isLoading:i}):l.createElement(E,{modules:n,additionalComponent:a})},h=function(e,t,n){if(void 0===e&&(e=""),void 0===t&&(t=""),void 0===n&&(n=""),""==t)return e;for(;null!==(l=e)&&void 0!==l&&l.includes(t);){var l,o;e=null===(o=e)||void 0===o?void 0:o.replace(t,n)}return e},C=e=>{var o;const[r,i]=n.useState(null),[s,c]=n.useState([]),[u,d]=n.useState([]),m=a.useHistory();let p=[];return n.useEffect(()=>{var e,t;const n=Digit.SessionStorage.get("citizen.userRequestObject");let l=[],o=[];null==n||null===(e=n.info)||void 0===e||null===(t=e.roles)||void 0===t||t.forEach(e=>l.push(e.tenantId));let r=l.filter((e,t,n)=>n.indexOf(e)===t);null==r||r.forEach(e=>{var t;o.push({label:"TENANT_TENANTS_"+(null===(t=h(e,".","_"))||void 0===t?void 0:t.toUpperCase()),value:e})}),p=null==o?void 0:o.filter(e=>e.value==Digit.SessionStorage.get("Employee.tenantId")),c(o)},[r]),l.createElement("div",{style:null!=e&&e.mobileView?{color:"#767676"}:{}},l.createElement(t.Dropdown,{t:null==e?void 0:e.t,option:s,selected:s.find(e=>e.value===(null==r?void 0:r.value)),optionKey:"label",select:e=>{var t,n,l,o;const r=Digit.SessionStorage.get("citizen.userRequestObject"),a=null===(t=Digit.SessionStorage.get("citizen.userRequestObject"))||void 0===t||null===(n=t.info)||void 0===n||null===(l=n.roles)||void 0===l?void 0:l.filter(t=>t.tenantId===e.value);if((null==a?void 0:a.length)>0&&(r.info.roles=a,r.info.tenantId=null==e?void 0:e.value),Digit.SessionStorage.set("Employee.tenantId",null==e?void 0:e.value),Digit.UserService.setUser(r),i(e),window.location.href.includes(`/${null===(o=window)||void 0===o?void 0:o.contextPath}/employee/`)){var s,c;const e=(null===(s=location.state)||void 0===s?void 0:s.from)||`/${null===(c=window)||void 0===c?void 0:c.contextPath}/employee`;m.replace(e)}window.location.reload()},freeze:!0,customSelector:l.createElement("label",{className:"cp"},null==e?void 0:e.t("TENANT_TENANTS_"+(null===(o=h(Digit.SessionStorage.get("Employee.tenantId"),".","_"))||void 0===o?void 0:o.toUpperCase())))}))},b=e=>{const o=e.dropdown||!1,{data:r,isLoading:i}=Digit.Hooks.useStore.getInitData(),{languages:a,stateInfo:s}=r||{},c=Digit.StoreData.getCurrentLanguage(),[u,d]=n.useState(c),m=e=>{d(e.value),Digit.LocalizationService.changeLanguage(e.value,s.code)};return i?null:o?l.createElement("div",null,l.createElement(t.Dropdown,{className:"language-dropdown",option:a,selected:null==a?void 0:a.find(e=>(null==e?void 0:e.value)===c),optionKey:"label",select:m,freeze:!0,customSelector:l.createElement("label",{className:"cp"},null==a||null===(p=a.find(e=>(null==e?void 0:e.value)===u))||void 0===p?void 0:p.label)})):l.createElement(l.Fragment,null,l.createElement("div",{style:{marginBottom:"5px"}},"Language"),l.createElement("div",{className:"language-selector"},a.map((e,n)=>l.createElement("div",{className:"language-button-container",key:n},l.createElement(t.Button,{label:e.label,onClick:()=>m(e),variation:e.value===u?"primary":""})))));var p},S=e=>{var o,r,i,c,u,d,m,p;let{t:v,stateInfo:g,toggleSidebar:f,isSidebarOpen:E,handleLogout:y,userDetails:h,CITIZEN:S,cityDetails:O,mobileView:N,userOptions:I,handleUserDropdownSelection:w,logoUrl:_,showLanguageChange:D=!0}=e;const[T,L]=l.useState(null);l.useEffect(function(){try{var e;const t=Digit.ULBService.getCurrentTenantId(),n=null==h||null===(e=h.info)||void 0===e?void 0:e.uuid,l=function(){if(n)return Promise.resolve(Digit.UserService.userSearch(t,{uuid:[n]},{})).then(function(e){if(e&&e.user&&e.user.length){var t;const n=e.user[0],l=null==n||null===(t=n.photo)||void 0===t?void 0:t.split(",");L(null==l?void 0:l.at(0))}})}();return Promise.resolve(l&&l.then?l.then(function(){}):void 0)}catch(e){return Promise.reject(e)}},[null!==T,null==h||null===(o=h.info)||void 0===o?void 0:o.uuid]);const R=Digit.ULBService.getCitizenCurrentTenant(!0);let P=a.useHistory();const{pathname:A}=a.useLocation(),{data:{unreadCount:x}={},isSuccess:M}=Digit.Hooks.useNotificationCount({tenantId:R,config:{enabled:"EMPLOYEE"!==(null===(k=Digit.UserService)||void 0===k||null===(U=k.getUser())||void 0===U||null===(B=U.info)||void 0===B?void 0:B.type)&&"CITIZEN"===(null===(F=Digit.UserService)||void 0===F||null===(j=F.getUser())||void 0===j||null===(V=j.info)||void 0===V?void 0:V.type)&&!!R}});var k,U,B,F,j,V;if(S)return l.createElement("div",null,l.createElement(s.TopBar,{img:null==g?void 0:g.logoUrlWhite,isMobile:!0,toggleSidebar:()=>{Digit.clikOusideFired?Digit.clikOusideFired=!1:f(!0)},logoUrl:null==g?void 0:g.logoUrlWhite,onLogout:y,userDetails:h,notificationCount:x<99?x:99,notificationCountLoaded:M,cityOfCitizenShownBesideLogo:v(R),onNotificationIconClick:function(){var e;P.push(`/${null===(e=window)||void 0===e?void 0:e.contextPath}/citizen/engagement/notifications`)},hideNotificationIconOnSomeUrlsWhenNotLoggedIn:(e=>{var t,n,l,o;return(null===(t=Digit.UserService)||void 0===t||null===(n=t.getUser())||void 0===n||!n.access_token)&&[`/${null===(l=window)||void 0===l?void 0:l.contextPath}/citizen/select-language`,`/${null===(o=window)||void 0===o?void 0:o.contextPath}/citizen/select-location`].includes(e)})(A),changeLanguage:N?null:l.createElement(b,{dropdown:!0})}));const H=!(null==h||!h.access_token),z=null===(r=Digit.ComponentRegistryService)||void 0===r?void 0:r.getComponent("CustomEmployeeTopBar");return z?l.createElement(z,{t:v,stateInfo:g,toggleSidebar:f,isSidebarOpen:E,handleLogout:y,userDetails:h,CITIZEN:S,cityDetails:O,mobileView:N,userOptions:I,handleUserDropdownSelection:w,logoUrl:_,showLanguageChange:D,loggedin:H}):l.createElement(t.TopBar,{actionFields:[l.createElement(C,{dropdown:!0,t:v}),D&&l.createElement(b,{dropdown:!0}),(null==h?void 0:h.access_token)&&l.createElement(t.Dropdown,{option:I,optionKey:"name",profilePic:T||(null==h||null===(i=h.info)||void 0===i?void 0:i.name)||(null==h||null===(c=h.info)||void 0===c||null===(u=c.userInfo)||void 0===u?void 0:u.name)||"Employee",select:w,showArrow:!0,menuStyles:{marginTop:"1rem"},theme:"light"})],onHamburgerClick:()=>{f()},className:"",img:_,logoWidth:"48px",logoHeight:"48px",logo:H?null==O?void 0:O.logoId:null==g?void 0:g.statelogo,onImageClick:()=>{},onLogoClick:()=>{},props:{},showDeafultImg:!0,style:{},theme:"light",ulb:H?null!=O&&null!==(d=O.city)&&void 0!==d&&d.ulbGrade?l.createElement(n.Fragment,null,v(null==O?void 0:O.i18nKey).toUpperCase()," ",v("ULBGRADE_"+(null==O||null===(m=O.city)||void 0===m?void 0:m.ulbGrade.toUpperCase().replace(" ","_").replace(".","_"))).toUpperCase()):l.createElement("img",{className:"state",src:_,alt:"State Logo"}):l.createElement(n.Fragment,null,v(`MYCITY_${null==g||null===(p=g.code)||void 0===p?void 0:p.toUpperCase()}_LABEL`)," ",v("MYCITY_STATECODE_LABEL"))})},O=(e,t,n,o)=>{var r,i;return[{type:"link",element:"HOME",text:e("COMMON_BOTTOM_NAVIGATION_HOME"),link:o?`/${null===(r=window)||void 0===r?void 0:r.contextPath}/employee`:`/${null===(i=window)||void 0===i?void 0:i.contextPath}/citizen`,icon:"Home",populators:{onClick:t}},{type:"component",element:"LANGUAGE",action:l.createElement(b,null),icon:"LanguageIcon"},{id:"login-btn",element:"LOGIN",text:e("CORE_COMMON_LOGIN"),icon:l.createElement(s.LogoutIcon,{className:"icon"}),populators:{onClick:n}}]};function N(){return(N=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var l in n)({}).hasOwnProperty.call(n,l)&&(e[l]=n[l])}return e}).apply(null,arguments)}const I=e=>{let{onSelect:n,onCancel:r,onDismiss:i,PopupStyles:a,isDisabled:s,hideSubmit:c}=e;const{t:u}=o.useTranslation(),d=[l.createElement("div",null,l.createElement(t.CardText,null,u("CORE_LOGOUT_WEB_CONFIRMATION_MESSAGE")+" ",l.createElement("strong",null,u("CORE_LOGOUT_MESSAGE"))))],m=[l.createElement(t.Button,{type:"button",size:"large",variation:"secondary",label:u("CORE_LOGOUT_CANCEL"),className:"logout-cancel-button",onClick:r}),l.createElement(t.Button,{type:"button",size:"large",variation:"primary",label:u("CORE_LOGOUT_WEB_YES"),formId:"modal-action",onClick:n,isDisabled:s})],p=[l.createElement(t.Button,{type:"button",size:"large",variation:"digit-action-cancel",label:u("CORE_LOGOUT_CANCEL"),className:"logout-cancel-button",onClick:r})];return l.createElement(t.PopUp,{type:"default",children:d,heading:u("CORE_LOGOUT_WEB_HEADER"),footerChildren:c?p:m,sortFooterButtons:!0,onClose:i,className:"digit-logout-popup-wrapper",onOverlayClick:i,equalWidthButtons:!0,style:a})},w=e=>{let{info:t,t:n}=e;return l.createElement("div",{className:"profile-section"},l.createElement("div",{className:"imageloader imageloader-loaded"},l.createElement("img",{className:"img-responsive img-circle img-Profile",src:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAO4AAADUCAMAAACs0e/bAAAAM1BMVEXK0eL////Dy97GzuD4+fvL0uPg5O7T2efb4OvR1+Xr7vTk5/Df4+37/P3v8fbO1eTt8PUsnq5FAAAGqElEQVR4nO2d25ajIBBFCajgvf//a0eMyZgEjcI5xgt7Hmatme507UaxuJXidiDqjmSgeVIMlB1ZR1WZAf2gbdu0QwixSYzjOJPmHurfEGEfY9XzjNGG9whQCeVAuv5xQEySLtR9hPuIcwj0EeroN5m3D1IbsbgHK0esiQ9MKsqXVr8Hm/a/Pulk6wihpCIXBw3dh7bTvRBt9+dC5NfS1VH3xETdM3MxXRN1T0zUPTNR98xcS1dlV9NNfx3DhkTdM6PKqHteVBF1z0vU5f0sKdpc2zWLKutXrjJjdLvpesRmukqYonauPhXpdsLb6CppmpnltsYIuY2yavi6Mi2/rzAWm1zUfF0limVLqkZyA+mDYevKBS37aGC+L1lX5e7uyU1Cv565uiua9k5LFqbqqrnu2I3m+jJ11ZoLeRtfmdB0Uw/ZDsP0VTxdn7a1VERfmq7XlXyn5D2QWLoq8bZlPoBJumphJjVBw/Ll6CoTZGsTDs4NrGqKbqBth8ZHJUi6cn168QmleSm6GmB7Kxm+6obXlf7PoDHosCwM3QpiS2legi6ocSl3L0G3BdneDDgwQdENfeY+SfDJBkF37ZB+GvwzA6/rMaafAn8143VhPZWdjMWG1oHXhdnemgPoAvLlB/iZyRTfVeF06wPoQhJmlm4bdcOAZRlRN5gcPc5SoPEQR1fDdbOo6wn+uYvXxY0QCLom6gYROKH+Aj5nvphuFXWDiLpRdxl/19LFT95k6CHCrnW7pCDqBn1i1PUFvii2c11oZOJ6usWeH0RRNzC4Zs+6FTi2nevCVwCjbugnXklX5fkfTldL8PEilUB1kfNyN1u9MME2sATr4lbuB7AjfLAuvsRm1A0g6gYRdcPAjvBlje2Z8brI8OC68AcRdlCkwLohx2mcZMjw9q+LzarQurjtnwPYAydX08WecECO/u6Ad0GBdYG7jO5gB4Ap+PwKcA9ZT43dn4/W9TyiPAn4OAJaF7h3uwe8StSCddFdM3jqFa2LvnnB5zzhuuBBAjY4gi50cg694gnXhTYvfMdrjtcFZhrwE9r41gUem8IXWMC3LrBzxh+a0gRd1N1LOK7M0IUUGuggvEmHoStA2/MJh7MpupiDU4TzjhxdzLAoO4ouZvqVURbFMHQlZD6SUeWHoguZsSLUGegrehA+FZFowPdUWTi6iMoZlIpGGUUXkDbjj/9ZOLqAQS/+GIKl5BQOCn/ycqpzkXSDm5dU7ZWkG7wUyGlcmm7g5Ux56AqirgoaJ7BeokPTDbp9CbVunjFxPrl7+HqnkrSq1Da7JX20f3dV8yJi6voO81mX8vV0mx3qUsZCPRfTlVRdz2EvdufYGDvNQvvwqHtmXd+a1ITinwNcXc+lT6JuzdT1XDyBn/x7wtX1HCQQdW9MXc8xArGrirowfLeUEbMqqq6f7TF1lfRdOuGNiGi6SpT+WxY06xUfNN2wBfyE9I4tlm7w5hvOPDNJN3yNiLMipji6gE3chKhouoCtN5x3QlF0EZt8OW/8ougitqJQlk1aii7iFC9l0MvRReyao7xNjKML2Z/PuHlzhi5mFxljiZeiC9rPTEisNEMX9KYAwo5Xhi7qaA3hamboYm7dG+NVrXhdaYDv5zFaQZsYrCtbbAGnjkQDX2+J1FXCwOsqWOpKoIQNTFdqYBWydxqNqUoG0pVpCS+H8kaJaGKErlIaXj7CRRE+gRWuKwW9YZ80oVOUgbpdT0zpnSZJTIiwCtJVelvXntr4P5j6BWfPb5Wcx84C4cq3hb11lco2u2Mdwp6XdJ/Ne3wb8DWdfiRenZaXrhLwOj4e+GQeHroy3YOspS7TlU28Wle2m2QUS0mqdcbrdNW+ZHsSsyK7tBfm0q/dWcv+Z3mytVx3t7KWulqUe6ilunu8jF8pFwgv1FXp3mUt35OtRbr7eM4u4Gs6vUBXgeuHc5kfE/cbvWZtkROLm1DMtLCy80tzsu2PRj0hTI8fvrQuvsjlJkyutszq+m423wHaLTyniy/XuiGZ84LuT+m5ZfNfRxyGs7LXZOvia7VujatUwVTrIt+Q/Csc7Tuhe+BOakT10b4TuoiiJjvgU9emTO42PwEfBa+cuodKkuf42DXr1D3JpXz73Hnn0j10evHKe+nufgfUm+7B84sX9FfdEzXux2DBpWuKokkCqN/5pa/8pmvnL+RGKCddCGmatiPyPB/+ekO/M/q/7uvbt22kTt3zEnXPzCV13T3Gel4/6NduDu66xRvlPNkM1RjjxUdv+4WhGx6TftD19Q/dfzpwcHO+rE3fAAAAAElFTkSuQmCC"})),l.createElement("div",{id:"profile-name",className:"label-container name-Profile"},l.createElement("div",{className:"label-text"}," ",null==t?void 0:t.name," ")),l.createElement("div",{id:"profile-location",className:"label-container loc-Profile"},l.createElement("div",{className:"label-text"}," ",null==t?void 0:t.mobileNumber," ")),(null==t?void 0:t.emailId)&&l.createElement("div",{id:"profile-emailid",className:"label-container loc-Profile"},l.createElement("div",{className:"label-text"}," ",t.emailId," ")),l.createElement("div",{className:"profile-divider"}),window.location.href.includes("/employee")&&!window.location.href.includes("/employee/user/login")&&!window.location.href.includes("employee/user/language-selection")&&l.createElement(C,{t:n,mobileView:!0}))},_={CommonPTIcon:l.createElement(t.PTIcon,{className:"icon"}),OBPSIcon:l.createElement(t.OBPSIcon,{className:"icon"}),propertyIcon:l.createElement(t.PropertyHouse,{className:"icon"}),TLIcon:l.createElement(t.CaseIcon,{className:"icon"}),PGRIcon:l.createElement(t.PGRIcon,{className:"icon"}),FSMIcon:l.createElement(t.FSMIcon,{className:"icon"}),WSIcon:l.createElement(t.WSICon,{className:"icon"}),MCollectIcon:l.createElement(t.MCollectIcon,{className:"icon"}),BillsIcon:l.createElement(t.CollectionIcon,{className:"icon"}),BirthIcon:l.createElement(t.BirthIcon,{className:"icon"}),DeathIcon:l.createElement(t.DeathIcon,{className:"icon"}),FirenocIcon:l.createElement(t.FirenocIcon,{className:"icon"}),HomeIcon:l.createElement(t.HomeIcon,{className:"icon"}),EditPencilIcon:l.createElement(t.EditPencilIcon,{className:"icon"}),LogoutIcon:l.createElement(t.LogoutIcon,{className:"icon"}),Phone:l.createElement(t.Phone,{className:"icon"})},D=e=>{var r,i,s;let{linkData:c,islinkDataLoading:u}=e;const{t:d}=o.useTranslation(),m=a.useHistory(),p=a.useLocation(),{pathname:v}=p,{data:g,isFetched:f}=Digit.Hooks.useStore.getInitData(),{stateInfo:E}=g||{},y=Digit.UserService.getUser();let h=window.Digit.Utils.browser.isMobile();const[C,b]=n.useState(!1),[S,D]=n.useState(!1),[T,L]=n.useState(!1),R=()=>{L(!1)};if(u)return l.createElement(t.Loader,null);const P=()=>{var e;m.push(`/${null===(e=window)||void 0===e?void 0:e.contextPath}/citizen/user/profile`)};let A=[...O(d,P,()=>{var e;m.push(`/${null===(e=window)||void 0===e?void 0:e.contextPath}/citizen/login`)},C)];A=A.filter(e=>"LANGUAGE"!==e.element),Digit.ULBService.getCurrentTenantId();const x=e=>{var t,n;let{item:o}=e;const r=(null==o?void 0:o.icon)||(null===(t=o.icon)||void 0===t||null===(n=t.type)||void 0===n?void 0:n.name),i=r?_[r]:_.BillsIcon;let s;s="component"===o.type?o.action:o.text;const c=()=>l.createElement("span",N({className:"menu-item"},o.populators),i,l.createElement("div",{className:"menu-label"},s));return"external-link"===o.type?l.createElement("a",{href:o.link},l.createElement(c,null)):"link"===o.type?l.createElement(a.Link,{to:null==o?void 0:o.link},l.createElement(c,null)):l.createElement(c,null)};let M;return f&&y&&y.access_token&&(M=l.createElement(w,{info:null==y?void 0:y.info,stateName:null==E?void 0:E.name,t:d}),A=A.filter(e=>"login-btn"!==(null==e?void 0:e.id)),A=[...A,{text:d("EDIT_PROFILE"),element:"PROFILE",icon:"EditPencilIcon",populators:{onClick:P}},{text:d("CORE_COMMON_LOGOUT"),element:"LOGOUT",icon:"LogoutIcon",populators:{onClick:()=>{D(!1),L(!0)}}},{text:l.createElement(l.Fragment,null,d("CS_COMMON_HELPLINE"),l.createElement("div",{className:"telephone",style:{marginTop:"-10%"}},null==g?void 0:g.tenants.map(e=>{}),l.createElement("div",{className:"link"},l.createElement("a",{href:"tel:"+(null==g?void 0:g.tenants[0].contactNumber)},null==g?void 0:g.tenants[0].contactNumber)))),element:"Helpline",icon:"Phone"}]),null===(r=Object.keys(c))||void 0===r||null===(i=r.sort((e,t)=>t.localeCompare(e)))||void 0===i||i.map(e=>{var t,n,l,o,r,i;(null===(t=c[e][0])||void 0===t?void 0:t.sidebar)===window.contextPath+"-links"&&A.splice(1,0,{type:null!==(n=c[e][0])&&void 0!==n&&null!==(l=n.sidebarURL)&&void 0!==l&&l.includes(null===(o=window)||void 0===o?void 0:o.contextPath)?"link":"external-link",text:d("ACTION_TEST_"+Digit.Utils.locale.getTransformedLocale(e)),links:c[e],icon:null===(r=c[e][0])||void 0===r?void 0:r.leftIcon,link:null===(i=c[e][0])||void 0===i?void 0:i.sidebarURL})}),l.createElement(l.Fragment,null,l.createElement("div",null,l.createElement("div",{style:{height:"100%",width:"100%",top:"0px",backgroundColor:"rgba(0, 0, 0, 0.54)",pointerzevents:"auto"}}),l.createElement("div",{style:{display:"flex",flexDirection:"column",height:h?"calc(100vh - 56px)":"auto",zIndex:"99"}},M,l.createElement("div",{className:"drawer-desktop"},null===(s=A)||void 0===s?void 0:s.map((e,t)=>l.createElement("div",{className:"sidebar-list "+(v===(null==e?void 0:e.link)||v===(null==e?void 0:e.sidebarURL)?"active":""),key:t},l.createElement(x,{item:e}))))),l.createElement("div",null,T&&l.createElement(I,{onSelect:()=>{Digit.UserService.logout(),L(!1)},onCancel:R,onDismiss:R}))))},T=e=>{var r,i,s,c,u;let{isMobile:d=!1,toggleSidebar:m,onLogout:p,isEmployee:v=!1,linkData:g,islinkDataLoading:f,userProfile:E}=e;const{data:y,isFetched:h}=Digit.Hooks.useStore.getInitData(),C=Digit.StoreData.getCurrentLanguage(),[b,S]=n.useState(null),{languages:N,stateInfo:I}=y||{},w=Digit.UserService.getUser(),[_,T]=n.useState(""),[L,R]=n.useState(null),[P,A]=n.useState([]),[x,M]=n.useState([]),[k,U]=n.useState(C);let B=[];const{isLoading:F,data:j}=Digit.Hooks.useAccessControl(),{t:V}=(Digit.ULBService.getCurrentTenantId(),o.useTranslation()),H=a.useHistory(),z=function(e,t,n){if(void 0===e&&(e=""),void 0===t&&(t=""),void 0===n&&(n=""),""==t)return e;for(;null!==(l=e)&&void 0!==l&&l.includes(t);){var l,o;e=null===(o=e)||void 0===o?void 0:o.replace(t,n)}return e};n.useEffect(()=>{var e,t;const n=Digit.SessionStorage.get("citizen.userRequestObject");let l=[],o=[];null==n||null===(e=n.info)||void 0===e||null===(t=e.roles)||void 0===t||t.forEach(e=>l.push(e.tenantId));let r=l.filter((e,t,n)=>n.indexOf(e)===t);null==r||r.forEach(e=>{var t;o.push({label:"TENANT_TENANTS_"+(null===(t=z(e,".","_"))||void 0===t?void 0:t.toUpperCase()),value:e})}),B=null==o?void 0:o.filter(e=>e.value==Digit.SessionStorage.get("Employee.tenantId")),A(o)},[L]);const G=()=>{Digit.clikOusideFired=!0,m(!1)};n.useEffect(()=>{b||function(){try{var e;const t=Digit.ULBService.getCurrentTenantId(),n=null==w||null===(e=w.info)||void 0===e?void 0:e.uuid,l=function(){if(n)return Promise.resolve(Digit.UserService.userSearch(t,{uuid:[n]},{})).then(function(e){var t;if(e&&e.user&&null!=e&&null!==(t=e.user)&&void 0!==t&&t.length){var n;const t=e.user[0],l=null==t||null===(n=t.photo)||void 0===n?void 0:n.split(",");S(null==l?void 0:l.at(0))}})}();Promise.resolve(l&&l.then?l.then(function(){}):void 0)}catch(e){return Promise.reject(e)}}()},[b]);const $=e=>{var t,n;H.push("/"===e[0]?`/${null===(t=window)||void 0===t?void 0:t.contextPath}/${v?"employee":"citizen"}${e}`:`/${null===(n=window)||void 0===n?void 0:n.contextPath}/${v?"employee":"citizen"}/${e}`),m()};if(f||F)return l.createElement(t.Loader,null);let W=[...O(V,G,()=>{var e;H.push(`/${null===(e=window)||void 0===e?void 0:e.contextPath}/citizen/login`),G()},v)];h&&w&&w.access_token&&(W=W.filter(e=>"login-btn"!==(null==e?void 0:e.id)));let q={};if(v){var X;null==j||j.actions.filter(e=>"url"===e.url&&"Home"!==e.displayName).forEach(e=>{var t;if(""==_&&""!==e.path){let t=e.path.split(".")[0];"TradeLicense"===t&&(t="Trade License"),q[t]?q[t].push(e):q[t]=[e]}else if(""!==e.path&&null!=e&&null!==(t=e.displayName)&&void 0!==t&&t.toLowerCase().includes(_.toLowerCase())){let t=e.path.split(".")[0];"TradeLicense"===t&&(t="Trade License"),q[t]?q[t].push(e):q[t]=[e]}});const e=Object.keys(q);for(let t=0;t<(null==e?void 0:e.length);t++){var Z,Y,J,K,Q;const n=null===(Z=q[e[t]][0])||void 0===Z||null===(Y=Z.displayName)||void 0===Y||null===(J=Y.toUpperCase())||void 0===J?void 0:J.replace(/[ -]/g,"_"),l=null===(K=e[t])||void 0===K||null===(Q=K.toUpperCase())||void 0===Q?void 0:Q.replace(/[ -]/g,"_");var ee,te,ne,le;-1===q[e[t]][0].path.indexOf(".")?W.splice(1,0,{type:"link",text:V("ACTION_TEST_"+n),link:null===(ee=q[e[t]][0])||void 0===ee?void 0:ee.navigationURL,icon:null===(te=q[e[t]][0])||void 0===te?void 0:te.leftIcon,populators:{onClick:()=>{var n;H.push(null===(n=q[e[t]][0])||void 0===n?void 0:n.navigationURL),G()}}}):W.splice(1,0,{type:"dynamic",moduleName:V("ACTION_TEST_"+l),links:null===(ne=q[e[t]])||void 0===ne?void 0:ne.map(e=>{var t,n;return{...e,displayName:V("ACTION_TEST_"+(null==e||null===(t=e.displayName)||void 0===t||null===(n=t.toUpperCase())||void 0===n?void 0:n.replace(/[ -]/g,"_")))}}),icon:null===(le=q[e[t]][1])||void 0===le?void 0:le.leftIcon})}const t=W.findIndex(e=>"HOME"===e.element),n=W.splice(t,1),l=W.findIndex(e=>"LANGUAGE"===e.element),o=W.splice(l,(null===(X=W)||void 0===X?void 0:X.length)-l);W.sort((e,t)=>("dynamic"===(null==e?void 0:e.type)?null==e?void 0:e.moduleName:null==e?void 0:e.text).localeCompare("dynamic"===(null==t?void 0:t.type)?null==t?void 0:t.moduleName:null==t?void 0:t.text)),(null==n?void 0:n[0])&&W.splice(0,0,n[0]),W=(null==o?void 0:o.length)>0?W.concat(o):W}else{var oe,re;null===(oe=Object.keys(g))||void 0===oe||null===(re=oe.sort((e,t)=>t.localeCompare(e)))||void 0===re||re.map(e=>{var t,n,l,o,r,i;"digit-ui-links"===(null===(t=g[e][0])||void 0===t?void 0:t.sidebar)&&W.splice(1,0,{type:null!==(n=g[e][0])&&void 0!==n&&null!==(l=n.sidebarURL)&&void 0!==l&&l.includes(null===(o=window)||void 0===o?void 0:o.contextPath)?"link":"external-link",text:V("ACTION_TEST_"+Digit.Utils.locale.getTransformedLocale(e)),links:g[e],icon:null===(r=g[e][0])||void 0===r?void 0:r.leftIcon,link:null===(i=g[e][0])||void 0===i?void 0:i.sidebarURL})})}H.location.pathname.includes("/openlink")&&(W=W.filter(e=>"LANGUAGE"===e.element)),W=null===(r=W)||void 0===r?void 0:r.map(e=>({...e,label:(null==e?void 0:e.text)||(null==e?void 0:e.moduleName)||"",icon:null!=e&&e.icon?null==e?void 0:e.icon:void 0}));const ie=V("TENANT_TENANTS_"+(null===(i=z(Digit.SessionStorage.get("Employee.tenantId"),".","_"))||void 0===i?void 0:i.toUpperCase())),ae=null===(s=W)||void 0===s?void 0:s.map(e=>{var t;return"dynamic"===(null==e?void 0:e.type)?{...e,children:null==e||null===(t=e.links)||void 0===t?void 0:t.map(e=>({...e,label:null==e?void 0:e.displayName,icon:null==e?void 0:e.leftIcon}))}:e}),se=null==P?void 0:P.map(e=>({...e,type:"custom",key:"city"})),ce=null==N?void 0:N.map(e=>({...e,type:"custom",key:"language"})),ue=[{label:ie,value:ie,children:(null==se?void 0:se.length)>0?se:void 0,type:"custom",key:"city"},{label:V("Language"),children:(null==ce?void 0:ce.length)>0?ce:void 0,type:"custom",key:"language"},{label:V("EDIT_PROFILE"),type:"custom",key:"editProfile"},{label:V("Modules"),children:ae}];return d?l.createElement(t.MobileSidebar,{items:ue,profileName:null==w||null===(c=w.info)||void 0===c?void 0:c.name,profileNumber:null==w||null===(u=w.info)||void 0===u?void 0:u.mobileNumber,theme:"dark",transitionDuration:.3,styles:{marginTop:"64px",height:"93%"},onLogout:p,hideUserManuals:!0,profile:b||void 0,isSearchable:!0,onSelect:e=>{let{item:t,index:n,parentIndex:l}=e;return(e=>{let{item:t}=e;if(null!=t&&t.navigationURL)$(null==t?void 0:t.navigationURL);else if(null!=t&&t.link)$(null==t?void 0:t.link);else{if("custom"!==(null==t?void 0:t.type))return;switch(null==t?void 0:t.key){case"editProfile":E(),m();break;case"language":U((n=t).value),Digit.LocalizationService.changeLanguage(n.value,I.code),m();break;case"city":(e=>{var t,n,l,o;const r=Digit.SessionStorage.get("citizen.userRequestObject"),i=null===(t=Digit.SessionStorage.get("citizen.userRequestObject"))||void 0===t||null===(n=t.info)||void 0===n||null===(l=n.roles)||void 0===l?void 0:l.filter(t=>t.tenantId===e.value);if((null==i?void 0:i.length)>0&&(r.info.roles=i,r.info.tenantId=null==e?void 0:e.value),Digit.SessionStorage.set("Employee.tenantId",null==e?void 0:e.value),Digit.UserService.setUser(r),R(e),window.location.href.includes(`/${null===(o=window)||void 0===o?void 0:o.contextPath}/employee/`)){var a,s;const e=(null===(a=location.state)||void 0===a?void 0:a.from)||`/${null===(s=window)||void 0===s?void 0:s.contextPath}/employee`;H.replace(e)}window.location.reload()})(t),m()}}var n})({item:t,index:n,parentIndex:l})}}):l.createElement(D,{logout:p})},L=["digit-ui","works-ui","workbench-ui","health-ui","sanitation-ui","core-ui","mgramseva-web"],R=()=>{const{isLoading:e,data:n}=Digit.Hooks.useAccessControl(),r=(o.useTranslation(),a.useHistory()),i={};null==n||n.actions.filter(e=>"url"===e.url).forEach(e=>{var t;if(null==e||null===(t=e.path)||void 0===t||t.split("."),""!==(null==e?void 0:e.path)){var n;const t=null==e||null===(n=e.path)||void 0===n?void 0:n.split(".");let l={};t.reduce((n,l,o)=>{if(o!==t.length-1)return n[l]={},n[l];n[l]={item:e}},l),function e(t,n){for(const l in n)n.hasOwnProperty(l)&&("object"!=typeof n[l]||Array.isArray(n[l])?t[l]||(t[l]=n[l]):(t[l]||(t[l]={}),e(t[l],n[l])))}(i,l)}});const s=function(e){const t=(e,n)=>{if(n.item)return{label:n.item.displayName,icon:{icon:n.item.leftIcon,width:"1.5rem",height:"1.5rem"},navigationUrl:n.item.navigationURL};const l=Object.keys(n).map(e=>t(e,n[e]));return{label:e,icon:{icon:function e(t){void 0===t&&(t={});for(const n in t){const l=t[n];if("item"===n&&""!==(null==l?void 0:l.leftIcon))return null==l?void 0:l.leftIcon;if("object"==typeof t[n]&&!Array.isArray(t[n])){const l=e(t[n]);if(l)return l}}return null}(n),width:"1.5rem",height:"1.5rem"},children:l}};return Object.keys(e).map(n=>t(n,e[n]))}((e=>{const t=Object.entries(e);return t.sort((e,t)=>e[0]<t[0]?-1:e[0]>t[0]?1:0),Object.fromEntries(t)})(i));return e?l.createElement(t.Loader,null):i?l.createElement(t.Sidebar,{items:s,hideAccessbilityTools:!0,onSelect:e=>{let{item:t,index:n,parentIndex:l}=e;return(e=>{let{item:t}=e;null!=t&&t.navigationUrl&&function(e,t){var n,l;if(void 0===e&&(e={}),void 0===t&&(t=""),"/"!=t)if(-1===(null===(n=t)||void 0===n?void 0:n.indexOf("/"+(null===(l=window)||void 0===l?void 0:l.contextPath)))){const e=window.location.origin,n=null!=L&&L.every(e=>{var n;return-1===(null===(n=t)||void 0===n?void 0:n.indexOf("/"+e))})?e+"/employee/"+t:e+t;window.location.href=n}else e.push(t)}(r,null==t?void 0:t.navigationUrl)})({item:t,index:n,parentIndex:l})},theme:"dark",variant:"primary",transitionDuration:"",className:"",styles:{},expandedWidth:"",collapsedWidth:"",onBottomItemClick:()=>{}}):""},P=e=>{let{CITIZEN:t,isSidebarOpen:n,toggleSidebar:o,handleLogout:r,mobileView:i,userDetails:a,modules:s,linkData:c,islinkDataLoading:u,userProfile:d}=e;return t?l.createElement(T,{isOpen:n,isMobile:!0,toggleSidebar:o,onLogout:r,linkData:c,islinkDataLoading:u,userProfile:d}):!n&&null!=a&&a.access_token?l.createElement("div",{className:"digit-employeeSidebar"},l.createElement(R,{mobileView:i,userDetails:a,modules:s})):l.createElement("div",{className:"digit-citizenSidebar"},l.createElement(T,{isOpen:n,isMobile:!0,toggleSidebar:o,onLogout:r,isEmployee:!0,userProfile:d}))},A=e=>{let{t:t,stateInfo:o,userDetails:r,CITIZEN:i,cityDetails:s,mobileView:c,handleUserDropdownSelection:u,logoUrl:d,showSidebar:m=!0,showLanguageChange:p,linkData:v,islinkDataLoading:g}=e;const[f,E]=n.useState(!1),y=a.useHistory(),[h,C]=n.useState(!1),b=()=>{E(!1),C(!0)},O=()=>{C(!1)},N=()=>{E(!f)},w=()=>{var e;y.push(`/${null===(e=window)||void 0===e?void 0:e.contextPath}/employee/user/profile`)},_=[{name:t("EDIT_PROFILE"),icon:"Edit",func:w},{name:t("CORE_COMMON_LOGOUT"),icon:"Logout",func:b}];return l.createElement(l.Fragment,null,l.createElement(S,{t:t,stateInfo:o,toggleSidebar:N,isSidebarOpen:f,handleLogout:b,userDetails:r,CITIZEN:i,cityDetails:s,mobileView:c,userOptions:_,handleUserDropdownSelection:u,logoUrl:d,showLanguageChange:p}),h&&l.createElement(I,{onSelect:()=>{Digit.UserService.logout(),C(!1)},onCancel:O,onDismiss:O}),m&&l.createElement(P,{t:t,CITIZEN:i,isSidebarOpen:f,toggleSidebar:N,handleLogout:b,mobileView:c,userDetails:r,linkData:v,userProfile:w,islinkDataLoading:g}))},x=e=>{const{question:r,answer:i,lastIndex:a}=e,[s,c]=n.useState(!1),{t:u}=o.useTranslation();return l.createElement("div",{className:"faqs border-none",onClick:()=>c(!s)},l.createElement("div",{className:"faq-question",style:{justifyContent:"space-between",display:"flex"}},l.createElement("span",null,u(r)),l.createElement("span",{className:s?"faqicon rotate":"faqicon",style:{float:"right"}},l.createElement(t.ArrowForward,null))),l.createElement("div",{className:"faq-answer",style:s?{display:"block"}:{display:"none"}},l.createElement("span",null,u(i))),a?null:l.createElement("div",{className:"cs-box-border"}))},M=e=>{var r,i,a;let{module:s}=e;const c=Digit.UserService.getUser(),{t:u}=((null==c||null===(r=c.info)||void 0===r?void 0:r.tenantId)||Digit.ULBService.getCurrentTenantId(),o.useTranslation()),{isLoading:d,data:m}=Digit.Hooks.useGetFAQsJSON(Digit.ULBService.getStateId()),p=null==m||null===(i=m.MdmsRes["common-masters"])||void 0===i||null===(a=i.faqs[0])||void 0===a?void 0:a[""+s].faqs;return d?l.createElement(t.Loader,null):l.createElement(n.Fragment,null,l.createElement("div",{className:"faq-page"},l.createElement(t.BackButton,{style:{marginLeft:"unset"}}),l.createElement("div",{style:{marginBottom:"15px"}},l.createElement(t.Header,{styles:{marginLeft:"0px",paddingTop:"10px",fontSize:"32px"}},u("FAQ_S"))),l.createElement("div",{className:"faq-list"},p.map((e,t)=>l.createElement(x,{key:"faq_"+t,question:e.question,answer:e.answer,lastIndex:t===(null==p?void 0:p.length)-1})))))},k=()=>{var e,n,r,i,s,c,u,d,m,p,v,g,f,E,y,h,C,b,S,O,I,w,_;const{t:D}=o.useTranslation(),T=a.useHistory(),L=Digit.ULBService.getCitizenCurrentTenant(!0),{data:{uiHomePage:R}={},isLoading:P}=Digit.Hooks.useStore.getInitData();let A=window.Digit.Utils.browser.isMobile();const x=()=>{var e,t,n,l,o;return"EMPLOYEE"!==(null===(e=Digit.UserService)||void 0===e||null===(t=e.getUser())||void 0===t||null===(n=t.info)||void 0===n?void 0:n.type)&&!(null===(l=Digit.UserService)||void 0===l||null===(o=l.getUser())||void 0===o||!o.access_token)},{data:M,isLoading:k}=Digit.Hooks.useEvents({tenantId:L,variant:"whats-new",config:{enabled:x()}});var U;L||T.push(`/${null===(U=window)||void 0===U?void 0:U.contextPath}/citizen/select-language`);const B=null==R?void 0:R.appBannerDesktop,F=null==R?void 0:R.appBannerMobile,j=null==R?void 0:R.citizenServicesCard,V=null==R?void 0:R.informationAndUpdatesCard,H=null==R?void 0:R.whatsAppBannerDesktop,z=null==R?void 0:R.whatsAppBannerMobile,G=null==R?void 0:R.whatsNewSection,$=null==R?void 0:R.redirectURL;var W,q;$&&T.push(`/${null===(W=window)||void 0===W?void 0:W.contextPath}/citizen/${$}`),null!==(e=window)&&void 0!==e&&null!==(n=e.location)&&void 0!==n&&null!==(r=n.href)&&void 0!==r&&null!==(i=r.includes)&&void 0!==i&&i.call(r,"sanitation-ui")&&T.push(`/${null===(q=window)||void 0===q?void 0:q.contextPath}/citizen/all-services`);const X=e=>{window.open(null==e?void 0:e.navigationUrl)},Z={header:D(null==j?void 0:j.headerLabel),sideOption:{name:D(null==j||null===(s=j.sideOption)||void 0===s?void 0:s.name),onClick:()=>{var e;return T.push(null==j||null===(e=j.sideOption)||void 0===e?void 0:e.navigationUrl)}},options:[{name:D(null==j||null===(c=j.props)||void 0===c||null===(u=c[0])||void 0===u?void 0:u.label),Icon:l.createElement(t.ComplaintIcon,null),onClick:()=>{var e,t;return T.push(null==j||null===(e=j.props)||void 0===e||null===(t=e[0])||void 0===t?void 0:t.navigationUrl)}},{name:D(null==j||null===(d=j.props)||void 0===d||null===(m=d[1])||void 0===m?void 0:m.label),Icon:l.createElement(t.PTIcon,{className:"fill-path-primary-main"}),onClick:()=>{var e,t;return T.push(null==j||null===(e=j.props)||void 0===e||null===(t=e[1])||void 0===t?void 0:t.navigationUrl)}},{name:D(null==j||null===(p=j.props)||void 0===p||null===(v=p[2])||void 0===v?void 0:v.label),Icon:l.createElement(t.CaseIcon,{className:"fill-path-primary-main"}),onClick:()=>{var e,t;return T.push(null==j||null===(e=j.props)||void 0===e||null===(t=e[2])||void 0===t?void 0:t.navigationUrl)}},{name:D(null==j||null===(g=j.props)||void 0===g||null===(f=g[3])||void 0===f?void 0:f.label),Icon:l.createElement(t.OBPSIcon,null),onClick:()=>{var e,t;return T.push(null==j||null===(e=j.props)||void 0===e||null===(t=e[3])||void 0===t?void 0:t.navigationUrl)}}],styles:{display:"flex",flexWrap:"wrap",justifyContent:"flex-start",width:"100%"}},Y={header:D(null==V?void 0:V.headerLabel),sideOption:{name:D(null==V||null===(E=V.sideOption)||void 0===E?void 0:E.name),onClick:()=>{var e;return T.push(null==V||null===(e=V.sideOption)||void 0===e?void 0:e.navigationUrl)}},options:[{name:D(null==V||null===(y=V.props)||void 0===y||null===(h=y[0])||void 0===h?void 0:h.label),Icon:l.createElement(t.HomeIcon,null),onClick:()=>{var e,t;return T.push(null==V||null===(e=V.props)||void 0===e||null===(t=e[0])||void 0===t?void 0:t.navigationUrl)}},{name:D(null==V||null===(C=V.props)||void 0===C||null===(b=C[1])||void 0===b?void 0:b.label),Icon:l.createElement(t.Calender,null),onClick:()=>{var e,t;return T.push(null==V||null===(e=V.props)||void 0===e||null===(t=e[1])||void 0===t?void 0:t.navigationUrl)}},{name:D(null==V||null===(S=V.props)||void 0===S||null===(O=S[2])||void 0===O?void 0:O.label),Icon:l.createElement(t.DocumentIcon,null),onClick:()=>{var e,t;return T.push(null==V||null===(e=V.props)||void 0===e||null===(t=e[2])||void 0===t?void 0:t.navigationUrl)}},{name:D(null==V||null===(I=V.props)||void 0===I||null===(w=I[3])||void 0===w?void 0:w.label),Icon:l.createElement(t.DocumentIcon,null),onClick:()=>{var e,t;return T.push(null==V||null===(e=V.props)||void 0===e||null===(t=e[3])||void 0===t?void 0:t.navigationUrl)}}],styles:{display:"flex",flexWrap:"wrap",justifyContent:"flex-start",width:"100%"}};return P?l.createElement(t.Loader,null):l.createElement("div",{className:"HomePageContainer"},l.createElement("div",{className:"HomePageWrapper"},l.createElement("div",{className:"BannerWithSearch"},l.createElement("img",A?{src:null==F?void 0:F.bannerUrl}:{src:null==B?void 0:B.bannerUrl}),l.createElement("div",{className:"ServicesSection"},l.createElement(t.CardBasedOptions,N({style:{marginTop:"-30px"}},Z)),l.createElement(t.CardBasedOptions,N({style:A?{}:{marginTop:"-30px"}},Y)))),(z||H)&&l.createElement("div",{className:"WhatsAppBanner"},l.createElement("img",A?{src:null==z?void 0:z.bannerUrl,onClick:()=>X(z)}:{src:null==H?void 0:H.bannerUrl,onClick:()=>X(H)})),x()?k?l.createElement(t.Loader,null):l.createElement("div",{className:"WhatsNewSection"},l.createElement("div",{className:"headSection"},l.createElement("h2",null,D(null==G?void 0:G.headerLabel)),l.createElement("p",{onClick:()=>{var e;return T.push(null==G||null===(e=G.sideOption)||void 0===e?void 0:e.navigationUrl)}},D(null==G||null===(_=G.sideOption)||void 0===_?void 0:_.name))),l.createElement(t.WhatsNewCard,null==M?void 0:M[0])):null))},U=()=>{const{t:e}=o.useTranslation(),r=a.useHistory(),{data:{languages:i,stateInfo:s}={},isLoading:c}=Digit.Hooks.useStore.getInitData(),u=Digit.StoreData.getCurrentLanguage(),d=n.useMemo(()=>({header:e("CS_COMMON_CHOOSE_LANGUAGE"),submitBarLabel:e("CORE_COMMON_CONTINUE")}),[e]),m=n.useMemo(()=>({options:i,optionsKey:"label",additionalWrapperClass:"digit-reverse-radio-selection-wrapper",onSelect:e=>Digit.LocalizationService.changeLanguage(e.value,s.code),selectedOption:null==i?void 0:i.filter(e=>e.value===u)[0]}),[u,i]);return c?l.createElement(t.Loader,null):l.createElement("div",{className:"selection-card-wrapper"},l.createElement(t.PageBasedInput,{texts:d,onSubmit:function(){var e;r.push(`/${null===(e=window)||void 0===e?void 0:e.contextPath}/citizen/select-location`)}},l.createElement(t.CardHeader,null,e("CS_COMMON_CHOOSE_LANGUAGE")),l.createElement(t.RadioButtons,m)))},B=()=>{const{t:e}=o.useTranslation(),r=a.useHistory(),i=a.useLocation(),{data:s,isLoading:c}=Digit.Hooks.useTenants(),[u,d]=n.useState(()=>({code:Digit.ULBService.getCitizenCurrentTenant(!0)})),[m,p]=n.useState(!1),v=n.useMemo(()=>({header:e("CS_COMMON_CHOOSE_LOCATION"),submitBarLabel:e("CORE_COMMON_CONTINUE")}),[e]);function g(e){d(e),p(!1)}const f=n.useMemo(()=>({options:s,optionsKey:"i18nKey",additionalWrapperClass:"digit-reverse-radio-selection-wrapper",onSelect:g,selectedOption:u}),[s,e,u]);return c?l.createElement("loader",null):l.createElement("div",{className:"selection-card-wrapper"},l.createElement(t.BackButton,null),l.createElement(t.PageBasedInput,{texts:v,onSubmit:function(){if(u){var e,t;Digit.SessionStorage.set("CITIZEN.COMMON.HOME.CITY",u);const n=null===(e=i.state)||void 0===e?void 0:e.redirectBackTo;n?r.replace(n):r.push(`/${null===(t=window)||void 0===t?void 0:t.contextPath}/citizen`)}else p(!0)},className:"location-selection-container"},l.createElement(t.CardHeader,null,e("CS_COMMON_CHOOSE_LOCATION")),l.createElement(t.SearchOnRadioButtons,N({},f,{placeholder:e("COMMON_TABLE_SEARCH")})),m?l.createElement(t.CardLabelError,null,e("CS_COMMON_LOCATION_SELECTION_ERROR")):null))},F=function(){function e(){}return e.prototype.then=function(t,n){const l=new e,o=this.s;if(o){const e=1&o?t:n;if(e){try{j(l,1,e(this.v))}catch(e){j(l,2,e)}return l}return this}return this.o=function(e){try{const o=e.v;1&e.s?j(l,1,t?t(o):o):n?j(l,1,n(o)):j(l,2,o)}catch(e){j(l,2,e)}},l},e}();function j(e,t,n){if(!e.s){if(n instanceof F){if(!n.s)return void(n.o=j.bind(null,e,t));1&t&&(t=n.s),n=n.v}if(n&&n.then)return void n.then(j.bind(null,e,t),j.bind(null,e,2));e.s=t,e.v=n;const l=e.o;l&&l(e)}}function V(e){return e instanceof F&&1&e.s}const H="undefined"!=typeof Symbol?Symbol.iterator||(Symbol.iterator=Symbol("Symbol.iterator")):"@@iterator";function z(e,t,n){if("function"==typeof e[H]){var l,o,r,i=e[H]();if(function e(a){try{for(;!((l=i.next()).done||n&&n());)if((a=t(l.value))&&a.then){if(!V(a))return void a.then(e,r||(r=j.bind(null,o=new F,2)));a=a.v}o?j(o,1,a):o=a}catch(e){j(o||(o=new F),2,e)}}(),i.return){var a=function(e){try{l.done||i.return()}catch(e){}return e};if(o&&o.then)return o.then(a,function(e){throw a(e)});a()}return o}if(!("length"in e))throw new TypeError("Object is not iterable");for(var s=[],c=0;c<e.length;c++)s.push(e[c]);return function(e,t,n){var l,o,r=-1;return function i(a){try{for(;++r<e.length&&(!n||!n());)if((a=t(r))&&a.then){if(!V(a))return void a.then(i,o||(o=j.bind(null,l=new F,2)));a=a.v}l?j(l,1,a):l=a}catch(e){j(l||(l=new F),2,e)}}(),l}(s,function(e){return t(s[e])},n)}function G(e,t){try{var n=e()}catch(e){return t(e)}return n&&n.then?n.then(void 0,t):n}function $(e){let{setProfilePic:t,closeDrawer:r,userType:i,removeProfilePic:a,showToast:c}=e;const[u,d]=n.useState(null),[m,p]=n.useState(""),[v,g]=n.useState(null),{t:f}=o.useTranslation();return n.useEffect(()=>{!function(){try{g(null);const e=function(){if(m){const e=function(){if(m.size>=1e6)c("error",f("CORE_COMMON_PROFILE_MAXIMUM_UPLOAD_SIZE_EXCEEDED")),g(f("CORE_COMMON_PROFILE_MAXIMUM_UPLOAD_SIZE_EXCEEDED"));else{const e=G(function(){return Promise.resolve(Digit.UploadServices.Filestorage(i+"-profile",m,Digit.ULBService.getStateId())).then(function(e){var n,l;if((null==e||null===(n=e.data)||void 0===n||null===(l=n.files)||void 0===l?void 0:l.length)>0){var o,r;const n=null==e||null===(o=e.data)||void 0===o||null===(r=o.files[0])||void 0===r?void 0:r.fileStoreId;d(n),t(n)}else c("error",f("CORE_COMMON_PROFILE_FILE_UPLOAD_ERROR")),g(f("CORE_COMMON_PROFILE_FILE_UPLOAD_ERROR"))})},function(){c("error",f("CORE_COMMON_PROFILE_INVALID_FILE_INPUT"))});if(e&&e.then)return e.then(function(){})}}();if(e&&e.then)return e.then(function(){})}}();e&&e.then&&e.then(function(){})}catch(e){Promise.reject(e)}}()},[m]),l.createElement(l.Fragment,null,l.createElement("div",{style:{position:"fixed",top:"0",left:"0",right:"0",bottom:"0",width:"100%",height:"100vh",backgroundColor:"rgba(0,0,0,.5)"},onClick:()=>r()}),l.createElement("div",{style:{width:"100%",justifyContent:"space-between",display:"flex",backgroundColor:"white",alignItems:"center",position:"fixed",left:"0",right:"0",height:"20%",bottom:"citizen"===i?"2.5rem":"0",zIndex:"1000"}},l.createElement("div",{style:{display:"flex",flex:"1",flexDirection:"column",width:"100%",justifyContent:"center",alignItems:"center",gap:"8px 0"}},l.createElement("label",{for:"file",style:{cursor:"pointer"}}," ",l.createElement(s.GalleryIcon,null)),l.createElement("label",{style:{cursor:"pointer"}}," Gallery"),l.createElement("input",{type:"file",id:"file",accept:"image/*, .png, .jpeg, .jpg",onChange:e=>p(e.target.files[0]),style:{display:"none"}})),l.createElement("div",{style:{display:"flex",flex:"1",width:"100%",justifyContent:"center",alignItems:"center",flexDirection:"column",gap:"8px 0"}},l.createElement("button",{onClick:()=>{a(),r()}},l.createElement(s.RemoveIcon,null)),l.createElement("label",{style:{cursor:"pointer"}},"Remove"))))}"undefined"!=typeof Symbol&&(Symbol.asyncIterator||(Symbol.asyncIterator=Symbol("Symbol.asyncIterator")));const W=e=>{var r,i,c,u,d,m,p,v,g,f,E;let{stateCode:y,userType:h,cityDetails:C}=e;a.useHistory();const{t:b}=o.useTranslation(),S=window.location.href,O=Digit.ULBService.getStateId(),I=Digit.ULBService.getCurrentTenantId(),w=(null===(r=Digit.UserService.getUser())||void 0===r?void 0:r.info)||{},[_,D]=n.useState(null),[T,L]=n.useState(null!=w&&w.name?w.name:""),[R,P]=n.useState(null!=w&&w.emailId?w.emailId:""),[A,x]=n.useState(null==_?void 0:_.gender),[M,k]=n.useState(null!=w&&w.permanentCity?w.permanentCity:C.name),[U,B]=n.useState(null!=w&&w.mobileNumber?w.mobileNumber:""),[F,j]=n.useState(null),[V,H]=n.useState(""),[z,W]=n.useState(!1),[q,X]=n.useState(!1),[Z,Y]=n.useState(""),[J,K]=n.useState(""),[Q,ee]=n.useState(""),[te,ne]=n.useState(null),[le,oe]=n.useState(!1),[re,ie]=l.useState(window.innerWidth),[ae,se]=l.useState({}),ce=window.Digit.Utils.browser.isMobile();l.useEffect(()=>(window.addEventListener("resize",()=>ie(window.innerWidth)),()=>{window.removeEventListener("resize",()=>ie(window.innerWidth))})),n.useEffect(()=>{var e;oe(!0),function(){try{const e=null==w?void 0:w.uuid,t=function(){if(e)return Promise.resolve(Digit.UserService.userSearch(I,{uuid:[e]},{})).then(function(e){e&&e.user&&e.user.length&&D(e.user[0])})}();Promise.resolve(t&&t.then?t.then(function(){}):void 0)}catch(e){return Promise.reject(e)}}(),x({i18nKey:void 0,code:null==_?void 0:_.gender,value:null==_?void 0:_.gender});const t=null==_||null===(e=_.photo)||void 0===e?void 0:e.split(",");H(null==t?void 0:t.at(0)),oe(!1)},[null!==_]);let ue={};const de=e=>x(e),me=()=>W(!1),pe=e=>{L(e),!new RegExp(/^[a-zA-Z ]+$/i).test(e)||0===e.length||e.length>50?se({...ae,userName:{type:"pattern",message:"CORE_COMMON_PROFILE_NAME_INVALID"}}):se({...ae,userName:null})},ve=e=>{(null==w?void 0:w.userName)!==e?(P(e),!e.length||e.includes("@")&&e.includes(".")?se({...ae,emailAddress:null}):se({...ae,emailAddress:{type:"pattern",message:"CORE_COMMON_PROFILE_EMAIL_INVALID"}})):se({...ae,emailAddress:null})},ge=function(e,t,n){void 0===n&&(n=5e3),ne({key:e,action:t}),setTimeout(()=>{ne(null)},n)},fe=function(){try{let t=!1;function e(e){if(t)return e;oe(!1)}oe(!0);const n=G(function(){const e={...w,name:T,gender:null==A?void 0:A.value,emailId:R,photo:F};if(!new RegExp(/^([a-zA-Z ])*$/).test(T)||""===T||T.length>50||T.length<1)throw JSON.stringify({type:"error",message:b("CORE_COMMON_PROFILE_NAME_INVALID")});if("employee"===h&&!new RegExp(/^[6-9]{1}[0-9]{9}$/).test(U))throw JSON.stringify({type:"error",message:b("CORE_COMMON_PROFILE_MOBILE_NUMBER_INVALID")});if(R.length&&(!R.includes("@")||!R.includes(".")))throw JSON.stringify({type:"error",message:b("CORE_COMMON_PROFILE_EMAIL_INVALID")});if(q&&(Z.length||J.length||Q.length)){if(J!==Q)throw JSON.stringify({type:"error",message:b("CORE_COMMON_PROFILE_PASSWORD_MISMATCH")});if(!(Z.length&&J.length&&Q.length))throw JSON.stringify({type:"error",message:b("CORE_COMMON_PROFILE_PASSWORD_INVALID")});if(!new RegExp(/^([a-zA-Z0-9@#$%]{8,15})$/i).test(J)&&!new RegExp(/^([a-zA-Z0-9@#$%]{8,15})$/i).test(Q))throw JSON.stringify({type:"error",message:b("CORE_COMMON_PROFILE_PASSWORD_INVALID")})}return Promise.resolve(Digit.UserService.updateUser(e,y)).then(function(e){let{responseInfo:t}=e;if(t&&"200"===t.status){const e=Digit.UserService.getUser();e&&Digit.UserService.setUser({...e,info:{...e.info,name:T,mobileNumber:U,emailId:R,permanentCity:M}})}return function(){if(Z.length&&J.length&&Q.length){const e={existingPassword:Z,newPassword:J,tenantId:I,type:"EMPLOYEE",username:null==w?void 0:w.userName,confirmPassword:Q};return function(){if(J===Q)return G(function(){return Promise.resolve(Digit.UserService.changePassword(e,I)).then(function(e){const{responseInfo:t}=e;if(null==t||!t.status||"200"!==t.status)throw"";ge("success",b("CORE_COMMON_PROFILE_UPDATE_SUCCESS_WITH_PASSWORD"),5e3),setTimeout(()=>Digit.UserService.logout(),2e3)})},function(e){var t,n;throw JSON.stringify({type:"error",message:null!==(t=e.Errors)&&void 0!==t&&null!==(n=t.at(0))&&void 0!==n&&n.description?e.Errors.at(0).description:"CORE_COMMON_PROFILE_UPDATE_ERROR_WITH_PASSWORD"})});throw JSON.stringify({type:"error",message:"CORE_COMMON_PROFILE_ERROR_PASSWORD_NOT_MATCH"})}()}null!=t&&t.status&&"200"===t.status&&ge("success",b("CORE_COMMON_PROFILE_UPDATE_SUCCESS"),5e3)}()})},function(e){const t=JSON.parse(e);ge(t.type,b(t.message),5e3)});return Promise.resolve(n&&n.then?n.then(e):e(n))}catch(e){return Promise.reject(e)}};let Ee=[];const{data:ye}=Digit.Hooks.useGenderMDMS(O,"common-masters","GenderType");return ye&&ye.map(e=>{Ee.push({i18nKey:"PT_COMMON_GENDER_"+e.code,code:""+e.code,value:""+e.code})}),le?l.createElement(t.Loader,null):l.createElement("div",{className:"user-profile"},l.createElement("section",{style:{margin:"citizen"===h||ce?"8px":"24px"}},"citizen"===h||ce?l.createElement(t.BackLink,null):l.createElement(t.BreadCrumb,{crumbs:[{path:`/${null===(i=window)||void 0===i?void 0:i.contextPath}/employee`,content:b("ES_COMMON_HOME"),show:!0},{path:`/${null===(c=window)||void 0===c?void 0:c.contextPath}/employee/user/profile`,content:b("ES_COMMON_PAGE_1"),show:S.includes("/user/profile")}]})),l.createElement("div",{style:{display:"flex",flex:1,flexDirection:re<768||"citizen"===h?"column":"row",margin:"citizen"===h?"8px":"16px",gap:"citizen"===h?"":"0 24px",boxShadow:"citizen"===h?"1px 1px 4px 0px rgba(0,0,0,0.2)":"",background:"citizen"===h?"white":"",borderRadius:"citizen"===h?"4px":"",maxWidth:"citizen"===h?"960px":""}},l.createElement("section",{style:{position:"relative",display:"flex",flex:"citizen"===h?1:2.5,justifyContent:"center",alignItems:"center",maxWidth:"100%",borderRadius:"4px",boxShadow:"citizen"===h?"":"1px 1px 4px 0px rgba(0,0,0,0.2)",border:("citizen"===h?"8px":"24px")+" solid #fff",background:"#EEEEEE",padding:"citizen"===h?"8px":"16px"}},l.createElement("div",{style:{position:"relative",height:"citizen"===h?"114px":"150px",width:"citizen"===h?"114px":"150px",margin:"16px"}},l.createElement("img",{style:{margin:"auto",borderRadius:"300px",justifyContent:"center",height:"100%",width:"100%"},src:V&&""!==V?V:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAO4AAADUCAMAAACs0e/bAAAAM1BMVEXK0eL////Dy97GzuD4+fvL0uPg5O7T2efb4OvR1+Xr7vTk5/Df4+37/P3v8fbO1eTt8PUsnq5FAAAGqElEQVR4nO2d25ajIBBFCajgvf//a0eMyZgEjcI5xgt7Hmatme507UaxuJXidiDqjmSgeVIMlB1ZR1WZAf2gbdu0QwixSYzjOJPmHurfEGEfY9XzjNGG9whQCeVAuv5xQEySLtR9hPuIcwj0EeroN5m3D1IbsbgHK0esiQ9MKsqXVr8Hm/a/Pulk6wihpCIXBw3dh7bTvRBt9+dC5NfS1VH3xETdM3MxXRN1T0zUPTNR98xcS1dlV9NNfx3DhkTdM6PKqHteVBF1z0vU5f0sKdpc2zWLKutXrjJjdLvpesRmukqYonauPhXpdsLb6CppmpnltsYIuY2yavi6Mi2/rzAWm1zUfF0limVLqkZyA+mDYevKBS37aGC+L1lX5e7uyU1Cv565uiua9k5LFqbqqrnu2I3m+jJ11ZoLeRtfmdB0Uw/ZDsP0VTxdn7a1VERfmq7XlXyn5D2QWLoq8bZlPoBJumphJjVBw/Ll6CoTZGsTDs4NrGqKbqBth8ZHJUi6cn168QmleSm6GmB7Kxm+6obXlf7PoDHosCwM3QpiS2legi6ocSl3L0G3BdneDDgwQdENfeY+SfDJBkF37ZB+GvwzA6/rMaafAn8143VhPZWdjMWG1oHXhdnemgPoAvLlB/iZyRTfVeF06wPoQhJmlm4bdcOAZRlRN5gcPc5SoPEQR1fDdbOo6wn+uYvXxY0QCLom6gYROKH+Aj5nvphuFXWDiLpRdxl/19LFT95k6CHCrnW7pCDqBn1i1PUFvii2c11oZOJ6usWeH0RRNzC4Zs+6FTi2nevCVwCjbugnXklX5fkfTldL8PEilUB1kfNyN1u9MME2sATr4lbuB7AjfLAuvsRm1A0g6gYRdcPAjvBlje2Z8brI8OC68AcRdlCkwLohx2mcZMjw9q+LzarQurjtnwPYAydX08WecECO/u6Ad0GBdYG7jO5gB4Ap+PwKcA9ZT43dn4/W9TyiPAn4OAJaF7h3uwe8StSCddFdM3jqFa2LvnnB5zzhuuBBAjY4gi50cg694gnXhTYvfMdrjtcFZhrwE9r41gUem8IXWMC3LrBzxh+a0gRd1N1LOK7M0IUUGuggvEmHoStA2/MJh7MpupiDU4TzjhxdzLAoO4ouZvqVURbFMHQlZD6SUeWHoguZsSLUGegrehA+FZFowPdUWTi6iMoZlIpGGUUXkDbjj/9ZOLqAQS/+GIKl5BQOCn/ycqpzkXSDm5dU7ZWkG7wUyGlcmm7g5Ux56AqirgoaJ7BeokPTDbp9CbVunjFxPrl7+HqnkrSq1Da7JX20f3dV8yJi6voO81mX8vV0mx3qUsZCPRfTlVRdz2EvdufYGDvNQvvwqHtmXd+a1ITinwNcXc+lT6JuzdT1XDyBn/x7wtX1HCQQdW9MXc8xArGrirowfLeUEbMqqq6f7TF1lfRdOuGNiGi6SpT+WxY06xUfNN2wBfyE9I4tlm7w5hvOPDNJN3yNiLMipji6gE3chKhouoCtN5x3QlF0EZt8OW/8ougitqJQlk1aii7iFC9l0MvRReyao7xNjKML2Z/PuHlzhi5mFxljiZeiC9rPTEisNEMX9KYAwo5Xhi7qaA3hamboYm7dG+NVrXhdaYDv5zFaQZsYrCtbbAGnjkQDX2+J1FXCwOsqWOpKoIQNTFdqYBWydxqNqUoG0pVpCS+H8kaJaGKErlIaXj7CRRE+gRWuKwW9YZ80oVOUgbpdT0zpnSZJTIiwCtJVelvXntr4P5j6BWfPb5Wcx84C4cq3hb11lco2u2Mdwp6XdJ/Ne3wb8DWdfiRenZaXrhLwOj4e+GQeHroy3YOspS7TlU28Wle2m2QUS0mqdcbrdNW+ZHsSsyK7tBfm0q/dWcv+Z3mytVx3t7KWulqUe6ilunu8jF8pFwgv1FXp3mUt35OtRbr7eM4u4Gs6vUBXgeuHc5kfE/cbvWZtkROLm1DMtLCy80tzsu2PRj0hTI8fvrQuvsjlJkyutszq+m423wHaLTyniy/XuiGZ84LuT+m5ZfNfRxyGs7LXZOvia7VujatUwVTrIt+Q/Csc7Tuhe+BOakT10b4TuoiiJjvgU9emTO42PwEfBa+cuodKkuf42DXr1D3JpXz73Hnn0j10evHKe+nufgfUm+7B84sX9FfdEzXux2DBpWuKokkCqN/5pa/8pmvnL+RGKCddCGmatiPyPB/+ekO/M/q/7uvbt22kTt3zEnXPzCV13T3Gel4/6NduDu66xRvlPNkM1RjjxUdv+4WhGx6TftD19Q/dfzpwcHO+rE3fAAAAAElFTkSuQmCC"}),l.createElement("button",{style:{position:"absolute",left:"50%",bottom:"-24px",transform:"translateX(-50%)"},onClick:()=>W(!z)},l.createElement(s.CameraIcon,null)))),l.createElement("section",{style:{display:"flex",flexDirection:"column",flex:"citizen"===h?1:7.5,width:"100%",borderRadius:"4px",height:"fit-content",boxShadow:"citizen"===h?"":"1px 1px 4px 0px rgba(0,0,0,0.2)",background:"white",padding:"citizen"===h?"8px":"24px",paddingBottom:"20px"}},"citizen"===h?l.createElement(l.Fragment,null,l.createElement(t.LabelFieldPair,null,l.createElement(t.CardLabel,{style:{}},""+b("CORE_COMMON_PROFILE_NAME"),"*"),l.createElement("div",{style:{width:"100%",maxWidth:"960px"}},l.createElement(t.TextInput,N({t:b,style:{width:"100%"},type:"text",isMandatory:!1,name:"name",value:T,onChange:e=>pe(e.target.value)},ue={isRequired:!0,pattern:"^[a-zA-Z-.`' ]*$",type:"tel",title:b("CORE_COMMON_PROFILE_NAME_ERROR_MESSAGE")},{disable:!1})),(null==ae?void 0:ae.userName)&&l.createElement(t.ErrorMessage,{message:b(null==ae||null===(u=ae.userName)||void 0===u?void 0:u.message),truncateMessage:!0,maxLength:256,className:"",wrapperClassName:"",showIcon:!0}))),l.createElement(t.LabelFieldPair,null,l.createElement(t.CardLabel,{style:{}},""+b("CORE_COMMON_PROFILE_GENDER")),l.createElement(t.Dropdown,{style:{width:"100%"},className:"form-field",selected:1===(null==A?void 0:A.length)?A[0]:A,disable:1===(null==A?void 0:A.length)||!1,option:Ee,select:de,value:A,optionKey:"code",t:b,name:"gender"})),l.createElement(t.LabelFieldPair,null,l.createElement(t.CardLabel,{style:{}},""+b("CORE_COMMON_PROFILE_EMAIL")),l.createElement("div",{style:{width:"100%"}},l.createElement(t.TextInput,{t:b,style:{width:"100%"},type:"email",isMandatory:!1,optionKey:"i18nKey",name:"email",value:R,onChange:e=>ve(e.target.value),disabled:!1}),(null==ae?void 0:ae.emailAddress)&&l.createElement(t.ErrorMessage,{message:b(null==ae||null===(d=ae.emailAddress)||void 0===d?void 0:d.message),truncateMessage:!0,maxLength:256,className:"",wrapperClassName:"",showIcon:!0}))),l.createElement("button",{onClick:fe,style:{marginTop:"24px",backgroundColor:"#F47738",width:"100%",height:"40px",color:"white",maxWidth:ce?"100%":"240px",borderBottom:"1px solid black"}},b("CORE_COMMON_SAVE"))):l.createElement(l.Fragment,null,l.createElement(t.LabelFieldPair,{style:{display:"flex"}},l.createElement(t.CardLabel,{className:"profile-label-margin",style:{width:"300px"}},""+b("CORE_COMMON_PROFILE_NAME"),"*"),l.createElement("div",{style:{width:"100%"}},l.createElement(t.TextInput,N({t:b,type:"text",isMandatory:!1,name:"name",value:T,onChange:e=>pe(e.target.value),placeholder:"Enter Your Name"},ue={isRequired:!0,pattern:"^[a-zA-Z-.`' ]*$",type:"text",title:b("CORE_COMMON_PROFILE_NAME_ERROR_MESSAGE")},{disabled:!1})),(null==ae?void 0:ae.userName)&&l.createElement(t.ErrorMessage,{message:b(null==ae||null===(m=ae.userName)||void 0===m?void 0:m.message),truncateMessage:!0,maxLength:256,className:"",wrapperClassName:"",showIcon:!0}))),l.createElement(t.LabelFieldPair,{style:{display:"flex"}},l.createElement(t.CardLabel,{className:"profile-label-margin",style:{width:"300px"}},""+b("CORE_COMMON_PROFILE_GENDER")),l.createElement("div",{style:{width:"100%"}},l.createElement(t.Dropdown,{selected:1===(null==A?void 0:A.length)?A[0]:A,disable:1===(null==A?void 0:A.length)||!1,option:Ee,select:de,value:A,optionKey:"code",t:b,name:"gender"}))),l.createElement(t.LabelFieldPair,{style:{display:"flex"}},l.createElement(t.CardLabel,{className:"profile-label-margin",style:{width:"300px"}},""+b("CORE_COMMON_PROFILE_CITY")),l.createElement("div",{style:{width:"100%"}},l.createElement(t.TextInput,N({t:b,type:"text",isMandatory:!1,name:"city",value:b(Digit.Utils.locale.getTransformedLocale("TENANT_TENANTS_"+I)),onChange:e=>k(e.target.value),placeholder:"Enter Your City Name"},ue={isRequired:!0,type:"text",title:b("CORE_COMMON_PROFILE_CITY_ERROR_MESSAGE")},{disabled:!0})),l.createElement(t.ErrorMessage,null))),l.createElement(t.LabelFieldPair,{style:{display:"flex"}},l.createElement(t.CardLabel,{className:"profile-label-margin",style:{width:"300px"}},b("CORE_COMMON_PROFILE_MOBILE_NUMBER")+"*"),l.createElement("div",{style:{width:"100%"}},l.createElement(t.MobileNumber,{value:U,style:{width:"100%"},name:"mobileNumber",placeholder:"Enter a valid Mobile No.",onChange:e=>(e=>{B(e),"employee"!==h||new RegExp(/^[6-9]{1}[0-9]{9}$/).test(e)?se({...ae,mobileNumber:null}):se({...ae,mobileNumber:{type:"pattern",message:"CORE_COMMON_PROFILE_MOBILE_NUMBER_INVALID"}})})(e),disable:!0,required:!0,pattern:"[6-9]{1}[0-9]{9}",type:"tel",title:b("CORE_COMMON_PROFILE_MOBILE_NUMBER_INVALID")}),(null==ae?void 0:ae.mobileNumber)&&l.createElement(t.ErrorMessage,{message:b(null==ae||null===(p=ae.mobileNumber)||void 0===p?void 0:p.message),truncateMessage:!0,maxLength:256,className:"",wrapperClassName:"",showIcon:!0}))),l.createElement(t.LabelFieldPair,{style:{display:"flex"}},l.createElement(t.CardLabel,{className:"profile-label-margin",style:{width:"300px"}},""+b("CORE_COMMON_PROFILE_EMAIL")),l.createElement("div",{style:{width:"100%"}},l.createElement(t.TextInput,{t:b,type:"email",isMandatory:!1,placeholder:b("EMAIL_VALIDATION"),optionKey:"i18nKey",name:"email",value:R,onChange:e=>ve(e.target.value),disabled:!1}),(null==ae?void 0:ae.emailAddress)&&l.createElement(t.ErrorMessage,{message:b(null==ae||null===(v=ae.emailAddress)||void 0===v?void 0:v.message),truncateMessage:!0,maxLength:256,className:"",wrapperClassName:"",showIcon:!0}))),l.createElement(t.LabelFieldPair,null,l.createElement("div",{style:{width:"100%"}},0==q?l.createElement(t.Button,{label:b("CORE_COMMON_CHANGE_PASSWORD"),variation:"teritiary",onClick:()=>X(!q),style:{paddingLeft:"0rem"}}):null,q?l.createElement("div",{style:{marginTop:"10px"}},l.createElement(t.LabelFieldPair,{style:{display:"flex"}},l.createElement(t.CardLabel,{className:"profile-label-margin",style:{width:"300px"}},""+b("CORE_COMMON_PROFILE_CURRENT_PASSWORD")),l.createElement("div",{style:{width:"100%"}},l.createElement(t.TextInput,{t:b,type:"password",isMandatory:!1,name:"name",pattern:"^([a-zA-Z0-9@#$%])+$",onChange:e=>{return Y(t=e.target.value),void(new RegExp(/^([a-zA-Z0-9@#$%]{8,15})$/i).test(t)?se({...ae,currentPassword:null}):se({...ae,currentPassword:{type:"pattern",message:"CORE_COMMON_PROFILE_PASSWORD_INVALID"}}));var t},disabled:!1}),(null==ae?void 0:ae.currentPassword)&&l.createElement(t.ErrorMessage,{message:b(null==ae||null===(g=ae.currentPassword)||void 0===g?void 0:g.message),truncateMessage:!0,maxLength:256,className:"",wrapperClassName:"",showIcon:!0}))),l.createElement(t.LabelFieldPair,{style:{display:"flex"}},l.createElement(t.CardLabel,{className:"profile-label-margin",style:{width:"300px"}},""+b("CORE_COMMON_PROFILE_NEW_PASSWORD")),l.createElement("div",{style:{width:"100%"}},l.createElement(t.TextInput,{t:b,type:"password",isMandatory:!1,name:"name",pattern:"^([a-zA-Z0-9@#$%])+$",onChange:e=>{return K(t=e.target.value),void(new RegExp(/^([a-zA-Z0-9@#$%]{8,15})$/i).test(t)?se({...ae,newPassword:null}):se({...ae,newPassword:{type:"pattern",message:"CORE_COMMON_PROFILE_PASSWORD_INVALID"}}));var t},disabled:!1}),(null==ae?void 0:ae.newPassword)&&l.createElement(t.ErrorMessage,{message:b(null==ae||null===(f=ae.newPassword)||void 0===f?void 0:f.message),truncateMessage:!0,maxLength:256,className:"",wrapperClassName:"",showIcon:!0}))),l.createElement(t.LabelFieldPair,{style:{display:"flex"}},l.createElement(t.CardLabel,{className:"profile-label-margin",style:{width:"300px"}},""+b("CORE_COMMON_PROFILE_CONFIRM_PASSWORD")),l.createElement("div",{style:{width:"100%"}},l.createElement(t.TextInput,{t:b,type:"password",isMandatory:!1,name:"name",pattern:"^([a-zA-Z0-9@#$%])+$",onChange:e=>{return ee(t=e.target.value),void(new RegExp(/^([a-zA-Z0-9@#$%]{8,15})$/i).test(t)?se({...ae,confirmPassword:null}):se({...ae,confirmPassword:{type:"pattern",message:"CORE_COMMON_PROFILE_PASSWORD_INVALID"}}));var t},disabled:!1}),(null==ae?void 0:ae.confirmPassword)&&l.createElement(t.ErrorMessage,{message:b(null==ae||null===(E=ae.confirmPassword)||void 0===E?void 0:E.message),truncateMessage:!0,maxLength:256,className:"",wrapperClassName:"",showIcon:!0})))):"")),"employee"===h&&ce?l.createElement("button",{onClick:fe,style:{marginTop:"24px",backgroundColor:"#F47738",width:"100%",height:"40px",color:"white",maxWidth:ce?"100%":"240px",borderBottom:"1px solid black",fontWeight:"700",fontSize:"17px"}},b("CORE_COMMON_SAVE")):null))),"employee"!==h||ce?null:l.createElement(t.ActionBar,{actionFields:[l.createElement(t.SubmitBar,{t:b,label:b("CORE_COMMON_SAVE"),onSubmit:fe})],className:"",setactionFieldsToRight:!0}),te&&l.createElement(t.Toast,{type:te.key,label:b("success"===te.key?"CORE_COMMON_PROFILE_UPDATE_SUCCESS":te.action),onClose:()=>ne(null),style:{maxWidth:"670px"}}),1==z?l.createElement($,{setProfilePic:function(e){try{function t(e){H(null==e?void 0:e.thumbs[0]),me()}return j(e),Promise.resolve(e?Promise.resolve(function(e,t){try{return Promise.resolve(Digit.UploadServices.Filefetch(e,t)).then(function(e){return e.data.fileStoreIds&&0!==e.data.fileStoreIds.length?{thumbs:e.data.fileStoreIds.map(e=>e.url.split(",")[3]),images:e.data.fileStoreIds.map(e=>Digit.Utils.getFileUrl(e.url))}:null})}catch(e){return Promise.reject(e)}}([e],O)).then(t):t(null))}catch(e){return Promise.reject(e)}},closeDrawer:me,userType:h,removeProfilePic:()=>{j(null),H(null)},showToast:ge}):"")},q=e=>{var r,i,a;let{module:c}=e;const u=Digit.UserService.getUser(),{t:d}=((null==u||null===(r=u.info)||void 0===r?void 0:r.tenantId)||Digit.ULBService.getCurrentTenantId(),o.useTranslation()),m=Digit.SessionStorage.get("initData").stateInfo,p=Digit.StoreData.getCurrentLanguage(),[v,g]=n.useState(p),[f,E]=n.useState(!1),[y,h]=n.useState(""),C=()=>l.createElement("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},l.createElement("path",{d:"M12 24C5.38053 24 0 18.6143 0 12C0 5.38054 5.38053 1.90735e-06 12 1.90735e-06C18.6143 1.90735e-06 24 5.38054 24 12C24 18.6143 18.6143 24 12 24ZM16.3488 10.7852L11.3855 7.25251C11.1263 7.0701 10.8238 6.97889 10.5214 6.97889C10.291 6.97889 10.0557 7.03172 9.83976 7.14202C9.34054 7.40118 9.02857 7.91006 9.02857 8.46694L9.02877 15.5323C9.02877 16.0892 9.34076 16.5979 9.83996 16.8572C10.3344 17.1116 10.9296 17.0732 11.3857 16.7467L16.349 13.214C16.7426 12.9356 16.9778 12.4795 16.9778 11.9996C16.9776 11.5197 16.7426 11.0636 16.3489 10.7852L16.3488 10.7852Z",fill:"white"})),{isLoading:b,data:S}=Digit.Hooks.useGetHowItWorksJSON(Digit.ULBService.getStateId()),O=null==S||null===(i=S.MdmsRes["common-masters"])||void 0===i||null===(a=i.howItWorks[0])||void 0===a?void 0:a[""+c];return b?l.createElement(t.Loader,null):l.createElement(n.Fragment,null,l.createElement("div",{className:"how-it-works-page"},l.createElement(t.BackButton,null),l.createElement("div",{className:"how-it-works-page-header"},l.createElement(t.Header,null,d(O.screenHeader?O.screenHeader:"HOW_IT_WORKS"))),l.createElement("div",{className:"language-selector",style:{margin:"10px"}},[{label:"ENGLISH",value:"en_IN"},{label:"हिंदी",value:"hi_IN"}].map((e,t)=>l.createElement("div",{className:"language-button-container",key:t},l.createElement(s.CustomButton,{selected:e.value===v,text:e.label,onClick:()=>(e=>{g(e.value),Digit.LocalizationService.changeLanguage(e.value,m.code)})(e)})))),O.videosJson.map((e,t)=>l.createElement("div",null,l.createElement("div",{className:"WhatsNewCard",style:{float:"left",position:"relative",width:"100%",marginBottom:10}},l.createElement("div",{className:"video-icon",onClick:()=>{return t=e,h("hi_IN"===v?t.hi_IN:t.en_IN),void E(!0);var t}},l.createElement("div",{className:"vid-svg"},l.createElement(C,null))),l.createElement("div",{className:"how-it-works-header-description"},l.createElement("h2",null,d(e.headerLabel)),l.createElement("p",null,d(e.description)))))),O.pdfHeader&&O.pdfDesc&&l.createElement("div",{className:"WhatsNewCard",style:{position:"relative",width:"100%",marginBottom:10,display:"inline-block"}},l.createElement("div",{className:"how-it-works-pdf-section"},l.createElement("div",{className:"pdf-icon-header-desc"},l.createElement("div",{className:"pdf-icon"},l.createElement(t.PDFSvg,null)),l.createElement("div",{className:"pdf-header-desc"},l.createElement("h2",null,d(O.pdfHeader)),l.createElement("p",null,d(O.pdfDesc)))),l.createElement("div",{className:"download-icon"},l.createElement(t.DownloadImgIcon,null)))),f&&l.createElement("div",{className:"how-it-works-video-play"},l.createElement("div",{className:"close-button"},l.createElement(t.CloseSvg,{onClick:()=>{E(!1)}})),l.createElement("video",{width:500,height:500,controls:!0,autoPlay:!0},l.createElement("source",{src:y,type:"video/mp4"})))))},X=[{texts:{header:"CS_LOGIN_PROVIDE_MOBILE_NUMBER",cardText:"CS_LOGIN_TEXT",nextText:"CS_COMMONS_NEXT",submitBarLabel:"CS_COMMONS_NEXT"},inputs:[{label:"CORE_COMMON_MOBILE_NUMBER",type:"text",name:"mobileNumber",error:"ERR_HRMS_INVALID_MOB_NO",validation:{required:!0,minLength:10,maxLength:10}}]},{texts:{header:"CS_LOGIN_OTP",cardText:"CS_LOGIN_OTP_TEXT",nextText:"CS_COMMONS_NEXT",submitBarLabel:"CS_COMMONS_NEXT"}},{texts:{header:"CS_LOGIN_PROVIDE_NAME",cardText:"CS_LOGIN_NAME_TEXT",nextText:"CS_COMMONS_NEXT",submitBarLabel:"CS_COMMONS_NEXT"},inputs:[{label:"CORE_COMMON_NAME",type:"text",name:"name",error:"CORE_COMMON_NAME_VALIDMSG",validation:{required:!0,minLength:1,pattern:/^[^{0-9}^\$\"<>?\\\\~!@#$%^()+={}\[\]*,/_:;“”‘’]{1,50}$/i}}]}],Z=e=>{let{t:n,onSelect:o,mobileNumber:r,onMobileChange:i,config:a,canSubmit:s}=e;return l.createElement(t.FormStep,{isDisabled:!(10===r.length&&s),onSelect:o,config:a,t:n,componentInFront:"+91",onChange:i,value:r})},Y=e=>{let{config:n,onSelect:o,t:r,isDisabled:i}=e;return l.createElement(t.FormStep,{config:n,onSelect:o,t:r,isDisabled:i})};function J(e,t){const l=n.useRef();n.useEffect(()=>{l.current=e},[e]),n.useEffect(()=>{if(null!==t){const e=setInterval(function(){l.current()},t);return()=>clearInterval(e)}},[t])}const K=e=>{let{config:o,otp:r,onOtpChange:i,onResend:a,onSelect:s,t:c,error:u,userType:d="citizen",canSubmit:m}=e;const[p,v]=n.useState(30);J(()=>{v(p-1)},p>0?1e3:null);const g=()=>{a(),v(2)};return"employee"===d?l.createElement(n.Fragment,null,l.createElement(t.OTPInput,{length:6,onChange:i,value:r}),p>0?l.createElement(t.CardText,null,`${c("CS_RESEND_ANOTHER_OTP")} ${p} ${c("CS_RESEND_SECONDS")}`):l.createElement("p",{className:"card-text-button resend-otp",onClick:g},c("CS_RESEND_OTP")),!u&&l.createElement(t.CardLabelError,null,c("CS_INVALID_OTP"))):l.createElement(t.FormStep,{onSelect:s,config:o,t:c,isDisabled:!(6===(null==r?void 0:r.length)&&m)},l.createElement(t.OTPInput,{length:6,onChange:i,value:r}),p>0?l.createElement(t.CardText,null,`${c("CS_RESEND_ANOTHER_OTP")} ${p} ${c("CS_RESEND_SECONDS")}`):l.createElement("p",{className:"card-text-button",onClick:g},c("CS_RESEND_OTP")),!u&&l.createElement(t.CardLabelError,null,c("CS_INVALID_OTP")))};var Q;const ee={type:"register"},te={type:"login"},ne=`/${null===(Q=window)||void 0===Q?void 0:Q.contextPath}/citizen`,le=(e,t)=>(null==e?void 0:e.from)||(null==t?void 0:t.from)||ne,oe=e=>{var r,i;let{stateCode:s,isUserRegistered:c=!0}=e;const{t:u}=o.useTranslation(),d=a.useLocation(),{path:m}=a.useRouteMatch(),p=a.useHistory(),[v,g]=n.useState(null),[f,E]=n.useState(null),[y,h]=n.useState(!0),[C,b]=n.useState(null),[S,O]=n.useState(c?{}:null==d||null===(r=d.state)||void 0===r?void 0:r.data),[N,I]=n.useState(null),w=Digit.Hooks.useQueryParams(),[_,D]=n.useState(!1),[T,L]=n.useState(!0),[R,P]=n.useState(!0);n.useEffect(()=>{let e;return f&&(N&&(clearTimeout(N),I(null)),e=setTimeout(()=>{E("")},5e3),I(e)),()=>{e&&clearTimeout(e)}},[f]),n.useEffect(()=>{var e;if(!v)return;Digit.SessionStorage.set("citizen.userRequestObject",v),Digit.UserService.setUser(v),((e,t,n)=>{var l,o;let r=null===(l=JSON.parse(sessionStorage.getItem("Digit.initData")))||void 0===l||null===(o=l.value)||void 0===o?void 0:o.selectedLanguage;localStorage.setItem("Citizen.tenant-id",n),localStorage.setItem("tenant-id",n),localStorage.setItem("citizen.userRequestObject",JSON.stringify(e)),localStorage.setItem("locale",r),localStorage.setItem("Citizen.locale",r),localStorage.setItem("token",t),localStorage.setItem("Citizen.token",t),localStorage.setItem("user-info",JSON.stringify(e)),localStorage.setItem("Citizen.user-info",JSON.stringify(e))})(null==v?void 0:v.info,null==v?void 0:v.access_token,s);const t=(null===(e=d.state)||void 0===e?void 0:e.from)||ne;var n;Digit.ULBService.getCitizenCurrentTenant(!0)?p.replace(t):p.replace(`/${null===(n=window)||void 0===n?void 0:n.contextPath}/citizen/select-location`,{redirectBackTo:t})},[v]);const A=n.useMemo(()=>X.map(e=>{const t={};for(const n in e.texts)t[n]=u(e.texts[n]);return{...e,texts:t}},[X])),x=()=>Digit.UserService.getType(),M=function(e){return Promise.resolve(G(function(){return Promise.resolve(Digit.UserService.sendOtp(e,s)).then(function(e){return[e,null]})},function(e){return[null,e]}))};return l.createElement("div",{className:"citizen-form-wrapper"},l.createElement(a.Switch,null,l.createElement(t.AppContainer,null,l.createElement(t.BackButton,null),l.createElement(a.Route,{path:""+m,exact:!0},l.createElement(Z,{onSelect:function(e){try{P(!1),O({...S,...e});const t={...e,tenantId:s,userType:x()};return Promise.resolve(c?Promise.resolve(M({otp:{...t,...te}})).then(function(e){var n;let[l,o]=e;var r,i,a;if(!o)return P(!0),void p.replace(m+"/otp",{from:le(d.state,w),role:null===(r=d.state)||void 0===r?void 0:r.role});P(!0),d.state&&"FSM_DSO"===d.state.role||p.push(`/${null===(i=window)||void 0===i?void 0:i.contextPath}/citizen/register/name`,{from:le(d.state,w),data:t}),null!==(n=d.state)&&void 0!==n&&n.role&&(P(!0),E("FSM_DSO"===(null===(a=d.state)||void 0===a?void 0:a.role)?u("ES_ERROR_DSO_LOGIN"):"User not registered."))}):Promise.resolve(M({otp:{...t,...ee}})).then(function(e){let[t,n]=e;if(!n)return P(!0),void p.replace(m+"/otp",{from:le(d.state,w)});P(!0)}))}catch(e){return Promise.reject(e)}},config:A[0],mobileNumber:S.mobileNumber||"",onMobileChange:e=>{const{value:t}=e.target;O({...S,mobileNumber:t})},canSubmit:R,showRegisterLink:c&&!(null!==(i=d.state)&&void 0!==i&&i.role),t:u})),l.createElement(a.Route,{path:m+"/otp"},l.createElement(K,{config:{...A[1],texts:{...A[1].texts,cardText:`${A[1].texts.cardText} ${S.mobileNumber||""}`}},onOtpChange:e=>{O({...S,otp:e})},onResend:function(){try{const{mobileNumber:e}=S,t={mobileNumber:e,tenantId:s,userType:x()},n=function(){if(!c)return Promise.resolve(M({otp:{...t,...ee}})).then(function(){});{const e=function(){if(c)return Promise.resolve(M({otp:{...t,...te}})).then(function(){})}();if(e&&e.then)return e.then(function(){})}}();return Promise.resolve(n&&n.then?n.then(function(){}):void 0)}catch(e){return Promise.reject(e)}},onSelect:function(){try{return Promise.resolve(G(function(){h(!0),L(!1);const{mobileNumber:e,otp:t,name:n}=S;return function(){if(c){const n={username:e,password:t,tenantId:s,userType:x()};return Promise.resolve(Digit.UserService.authenticate(n)).then(function(e){var t,n,l;let{UserRequest:o,...r}=e;if(null!==(t=d.state)&&void 0!==t&&t.role){const e=o.roles.find(e=>e.code===d.state.role);if(!e||!e.code)return E(u("ES_ERROR_USER_NOT_PERMITTED")),void setTimeout(()=>p.replace(ne),5e3)}null!==(n=window)&&void 0!==n&&null!==(l=n.globalConfigs)&&void 0!==l&&l.getConfig("ENABLE_SINGLEINSTANCE")&&(o.tenantId=Digit.ULBService.getStateId()),g({info:o,...r})})}{const l=function(){if(!c)return Promise.resolve(Digit.UserService.registerUser({name:n,username:e,otpReference:t,tenantId:s},s)).then(function(e){var t,n;let{UserRequest:l,...o}=e;null!==(t=window)&&void 0!==t&&null!==(n=t.globalConfigs)&&void 0!==n&&n.getConfig("ENABLE_SINGLEINSTANCE")&&(l.tenantId=Digit.ULBService.getStateId()),g({info:l,...o})})}();if(l&&l.then)return l.then(function(){})}}()},function(){L(!0),h(!1)}))}catch(e){return Promise.reject(e)}},otp:S.otp,error:y,canSubmit:T,t:u})),l.createElement(a.Route,{path:m+"/name"},l.createElement(Y,{config:A[2],onSelect:function(e){try{const t={...S,tenantId:s,userType:x(),...e};return O({...S,...e}),D(!0),Promise.resolve(M({otp:{...t,...ee}})).then(function(e){let[t,n]=e;t?(D(!1),p.replace(m+"/otp",{from:le(d.state,w)})):D(!1)})}catch(e){return Promise.reject(e)}},t:u,isDisabled:_})),f&&l.createElement(t.Toast,{type:"error",label:f,onClose:()=>E(null)}))))};var re=e=>e instanceof HTMLElement;const ie={onBlur:"onBlur",onChange:"onChange",onSubmit:"onSubmit",onTouched:"onTouched",all:"all"};var ae=e=>null==e;const se=e=>"object"==typeof e;var ce=e=>!ae(e)&&!Array.isArray(e)&&se(e)&&!(e instanceof Date),ue=e=>/^\w*$/.test(e),de=e=>e.filter(Boolean),me=e=>de(e.replace(/["|']/g,"").replace(/\[/g,".").replace(/\]/g,"").split("."));function pe(e,t,n){let l=-1;const o=ue(t)?[t]:me(t),r=o.length,i=r-1;for(;++l<r;){const t=o[l];let r=n;if(l!==i){const n=e[t];r=ce(n)||Array.isArray(n)?n:isNaN(+o[l+1])?{}:[]}e[t]=r,e=e[t]}return e}var ve=function(e,t){void 0===t&&(t={});for(const n in e)ue(n)?t[n]=e[n]:pe(t,n,e[n]);return t},ge=e=>void 0===e,fe=function(e,t,n){void 0===e&&(e={});const l=de(t.split(/[,[\].]+?/)).reduce((e,t)=>ae(e)?e:e[t],e);return ge(l)||l===e?ge(e[t])?n:e[t]:l},Ee=(e,t)=>{re(e)&&e.removeEventListener&&(e.removeEventListener("input",t),e.removeEventListener("change",t),e.removeEventListener("blur",t))};const ye={isValid:!1,value:null};var he=e=>Array.isArray(e)?e.reduce((e,t)=>t&&t.ref.checked?{isValid:!0,value:t.ref.value}:e,ye):ye,Ce=e=>"radio"===e.type,be=e=>"file"===e.type,Se=e=>"checkbox"===e.type,Oe=e=>"select-multiple"===e.type;const Ne={value:!1,isValid:!1},Ie={value:!0,isValid:!0};var we=e=>{if(Array.isArray(e)){if(e.length>1){const t=e.filter(e=>e&&e.ref.checked).map(e=>{let{ref:{value:t}}=e;return t});return{value:t,isValid:!!t.length}}const{checked:t,value:n,attributes:l}=e[0].ref;return t?l&&!ge(l.value)?ge(n)||""===n?Ie:{value:n,isValid:!0}:Ie:Ne}return Ne};function _e(e,t,n,l,o){const r=e.current[t];if(r){const{ref:{value:e,disabled:t},ref:n,valueAsNumber:a,valueAsDate:s,setValueAs:c}=r;if(t&&l)return;return be(n)?n.files:Ce(n)?he(r.options).value:Oe(n)?(i=n.options,[...i].filter(e=>{let{selected:t}=e;return t}).map(e=>{let{value:t}=e;return t})):Se(n)?we(r.options).value:o?e:a?""===e?NaN:+e:s?n.valueAsDate:c?c(e):e}var i;if(n)return fe(n.current,t)}function De(e){return!e||e instanceof HTMLElement&&e.nodeType!==Node.DOCUMENT_NODE&&De(e.parentNode)}var Te=e=>ce(e)&&!Object.keys(e).length,Le=e=>"boolean"==typeof e;function Re(e,t){const n=ue(t)?[t]:me(t),l=1==n.length?e:function(e,t){const n=t.slice(0,-1).length;let l=0;for(;l<n;)e=ge(e)?l++:e[t[l++]];return e}(e,n);let o;l&&delete l[n[n.length-1]];for(let t=0;t<n.slice(0,-1).length;t++){let l,r=-1;const i=n.slice(0,-(t+1)),a=i.length-1;for(t>0&&(o=e);++r<i.length;){const t=i[r];l=l?l[t]:e[t],a===r&&(ce(l)&&Te(l)||Array.isArray(l)&&!l.filter(e=>ce(e)&&!Te(e)||Le(e)).length)&&(o?delete o[t]:delete e[t]),o=l}}return e}const Pe=(e,t)=>e&&e.ref===t;var Ae=e=>ae(e)||!se(e);function xe(e,t){if(Ae(e)||Ae(t))return t;for(const n in t){const l=e[n],o=t[n];try{e[n]=ce(l)&&ce(o)||Array.isArray(l)&&Array.isArray(o)?xe(l,o):o}catch(e){}}return e}function Me(e,t,l){if(Ae(e)||Ae(t)||e instanceof Date||t instanceof Date)return e===t;if(!n.isValidElement(e)){const n=Object.keys(e),o=Object.keys(t);if(n.length!==o.length)return!1;for(const o of n){const n=e[o];if(!l||"ref"!==o){const e=t[o];if((ce(n)||Array.isArray(n))&&(ce(e)||Array.isArray(e))?!Me(n,e,l):n!==e)return!1}}}return!0}function ke(e,t,n,l,o){let r=-1;for(;++r<e.length;){for(const l in e[r])Array.isArray(e[r][l])?(!n[r]&&(n[r]={}),n[r][l]=[],ke(e[r][l],fe(t[r]||{},l,[]),n[r][l],n[r],l)):Me(fe(t[r]||{},l),e[r][l])?pe(n[r]||{},l):n[r]=Object.assign(Object.assign({},n[r]),{[l]:!0});l&&!n.length&&delete l[o]}return n}var Ue=e=>"string"==typeof e,Be=(e,t,n,l,o)=>{const r={};for(const t in e.current)(ge(o)||(Ue(o)?t.startsWith(o):Array.isArray(o)&&o.find(e=>t.startsWith(e))))&&(r[t]=_e(e,t,void 0,l));return n?ve(r):xe(t,ve(r))},Fe=e=>e instanceof RegExp,je=e=>ce(e)&&!Fe(e)?e:{value:e,message:""},Ve=e=>"function"==typeof e,He=e=>Ue(e)||n.isValidElement(e);function ze(e,t,n){if(void 0===n&&(n="validate"),He(e)||Le(e)&&!e)return{type:n,message:He(e)?e:"",ref:t}}var Ge=(e,t,n,l,o)=>t?Object.assign(Object.assign({},n[e]),{types:Object.assign(Object.assign({},n[e]&&n[e].types?n[e].types:{}),{[l]:o||!0})}):{},$e=function(e,t,n,l){let{ref:o,ref:{value:r},options:i,required:a,maxLength:s,minLength:c,min:u,max:d,pattern:m,validate:p}=n;try{let n=!1;const v=o.name,g={},f=Ce(o),E=Se(o),y=f||E,h=""===r,C=Ge.bind(null,v,t,g),b=function(e,t,n,l,r){void 0===l&&(l="maxLength"),void 0===r&&(r="minLength");const i=e?t:n;g[v]=Object.assign({type:e?l:r,message:i,ref:o},C(e?l:r,i))};if(a&&(!f&&!E&&(h||ae(r))||Le(r)&&!r||E&&!we(i).isValid||f&&!he(i).isValid)){const{value:n,message:l}=He(a)?{value:!!a,message:a}:je(a);if(n&&(g[v]=Object.assign({type:"required",message:l,ref:y?((e.current[v].options||[])[0]||{}).ref:o},C("required",l)),!t))return Promise.resolve(g)}if(!(ae(u)&&ae(d)||""===r)){let e,n;const l=je(d),i=je(u);if(isNaN(r)){const t=o.valueAsDate||new Date(r);Ue(l.value)&&(e=t>new Date(l.value)),Ue(i.value)&&(n=t<new Date(i.value))}else{const t=o.valueAsNumber||parseFloat(r);ae(l.value)||(e=t>l.value),ae(i.value)||(n=t<i.value)}if((e||n)&&(b(!!e,l.message,i.message,"max","min"),!t))return Promise.resolve(g)}if(Ue(r)&&!h&&(s||c)){const e=je(s),n=je(c),l=!ae(e.value)&&r.length>e.value,o=!ae(n.value)&&r.length<n.value;if((l||o)&&(b(l,e.message,n.message),!t))return Promise.resolve(g)}if(Ue(r)&&m&&!h){const{value:e,message:n}=je(m);if(Fe(e)&&!e.test(r)&&(g[v]=Object.assign({type:"pattern",message:n,ref:o},C("pattern",n)),!t))return Promise.resolve(g)}const S=function(){if(p){const r=_e(e,v,l,!1,!0),a=y&&i?i[0].ref:o;return Ve(p)?Promise.resolve(p(r)).then(function(e){const l=ze(e,a);if(l&&(g[v]=Object.assign(Object.assign({},l),C("validate",l.message)),!t))return n=!0,g}):function(){if(ce(p)){let l=!1;function e(){if(!Te(o)&&(g[v]=Object.assign({ref:a},o),!t))return n=!0,g}let o={};const i=z(Object.entries(p),function(e){let[n,i]=e;if(Te(o)||t)return Promise.resolve(i(r)).then(function(e){const l=ze(e,a,n);l&&(o=Object.assign(Object.assign({},l),C(n,l.message)),t&&(g[v]=o))});l=!0},function(){return l});return i&&i.then?i.then(e):e()}}()}}();return Promise.resolve(S&&S.then?S.then(function(e){return n?e:g}):n?S:g)}catch(e){return Promise.reject(e)}};const We=function(e,t,n){void 0===n&&(n=[]);for(const l in t){const o=e+(ce(t)?"."+l:`[${l}]`);Ae(t[l])?n.push(o):We(o,t[l],n)}return n};var qe=(e,t,n,l,o)=>{let r=void 0;return n.add(t),Te(e)||(r=fe(e,t),(ce(r)||Array.isArray(r))&&We(t,r).forEach(e=>n.add(e))),ge(r)?o?l:fe(l,t):r},Xe=e=>{let{isOnBlur:t,isOnChange:n,isOnTouch:l,isTouched:o,isReValidateOnBlur:r,isReValidateOnChange:i,isBlurEvent:a,isSubmitted:s,isOnAll:c}=e;return!c&&(!s&&l?!(o||a):(s?r:t)?!a:!(s?i:n)||a)},Ze=e=>e.substring(0,e.indexOf("[")),Ye=(e,t)=>[...e].some(e=>((e,t)=>RegExp(`^${t}([|.)\\d+`.replace(/\[/g,"\\[").replace(/\]/g,"\\]")).test(e))(t,e)),Je="undefined"!=typeof window&&"undefined"!=typeof document;function Ke(e){var t;let n;if(Ae(e)||Je&&(e instanceof File||re(e)))return e;if(!["Set","Map","Object","Date","Array"].includes(null===(t=e.constructor)||void 0===t?void 0:t.name))return e;if(e instanceof Date)return n=new Date(e.getTime()),n;if(e instanceof Set){n=new Set;for(const t of e)n.add(t);return n}if(e instanceof Map){n=new Map;for(const t of e.keys())n.set(t,Ke(e.get(t)));return n}n=Array.isArray(e)?[]:{};for(const t in e)n[t]=Ke(e[t]);return n}var Qe=e=>({isOnSubmit:!e||e===ie.onSubmit,isOnBlur:e===ie.onBlur,isOnChange:e===ie.onChange,isOnAll:e===ie.all,isOnTouch:e===ie.onTouched}),et=e=>Ce(e)||Se(e);const tt="undefined"==typeof window,nt=Je?"Proxy"in window:"undefined"!=typeof Proxy,lt=n.createContext(null);lt.displayName="RHFContext";const ot=e=>{const{as:t,render:l}=e,o=function(e,t){var n={};for(var l in e)Object.prototype.hasOwnProperty.call(e,l)&&t.indexOf(l)<0&&(n[l]=e[l]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(l=Object.getOwnPropertySymbols(e);o<l.length;o++)t.indexOf(l[o])<0&&Object.prototype.propertyIsEnumerable.call(e,l[o])&&(n[l[o]]=e[l[o]])}return n}(e,["rules","as","render","defaultValue","control","onFocus"]),{field:r,meta:i}=function(e){let{name:t,rules:l,defaultValue:o,control:r,onFocus:i}=e;const a=n.useContext(lt);if("production"!==process.env.NODE_ENV&&!r&&!a)throw new Error("📋 Controller is missing `control` prop. https://react-hook-form.com/api#Controller");const{defaultValuesRef:s,setValue:c,register:u,unregister:d,trigger:m,mode:p,reValidateMode:{isReValidateOnBlur:v,isReValidateOnChange:g},formState:f,formStateRef:{current:{isSubmitted:E,touched:y,errors:h}},updateFormState:C,readFormStateRef:b,fieldsRef:S,fieldArrayNamesRef:O,shallowFieldsStateRef:N}=r||a.control,I=!Ye(O.current,t),w=()=>!ge(fe(N.current,t))&&I?fe(N.current,t):ge(o)?fe(s.current,t):o,[_,D]=n.useState(w()),T=n.useRef(_),L=n.useRef({focus:()=>null}),R=n.useRef(i||(()=>{Ve(L.current.focus)&&L.current.focus(),"production"!==process.env.NODE_ENV&&(Ve(L.current.focus)||console.warn("📋 'ref' from Controller render prop must be attached to a React component or a DOM Element whose ref provides a 'focus()' method"))})),P=n.useCallback(e=>!Xe(Object.assign({isBlurEvent:e,isReValidateOnBlur:v,isReValidateOnChange:g,isSubmitted:E,isTouched:!!fe(y,t)},p)),[v,g,E,y,t,p]),A=n.useCallback(e=>{let[t]=e;const n=(e=>Ae(e)||!ce(e.target)||ce(e.target)&&!e.type?e:ge(e.target.value)?e.target.checked:e.target.value)(t);return D(n),T.current=n,n},[]),x=n.useCallback(e=>{if("production"!==process.env.NODE_ENV&&!t)return console.warn("📋 Field is missing `name` prop. https://react-hook-form.com/api#Controller");S.current[t]?S.current[t]=Object.assign({ref:S.current[t].ref},l):(u(Object.defineProperties({name:t,focus:R.current},{value:{set(e){D(e),T.current=e},get:()=>T.current}}),l),e=ge(fe(s.current,t))),e&&I&&D(w())},[l,t,u]);n.useEffect(()=>()=>d(t),[t]),n.useEffect(()=>{"production"!==process.env.NODE_ENV&&(ge(_)&&console.warn(`📋 ${t} is missing in the 'defaultValue' prop of either its Controller (https://react-hook-form.com/api#Controller) or useForm (https://react-hook-form.com/api#useForm)`),!I&&ge(o)&&console.warn("📋 Controller is missing `defaultValue` prop when using `useFieldArray`. https://react-hook-form.com/api#Controller")),x()},[x]),n.useEffect(()=>{!S.current[t]&&x(!0)});const M=n.useCallback(()=>{b.current.touched&&!fe(y,t)&&(pe(y,t,!0),C({touched:y})),P(!0)&&m(t)},[t,C,P,m,b]);return{field:{onChange:n.useCallback(function(){for(var e=arguments.length,n=new Array(e),l=0;l<e;l++)n[l]=arguments[l];return c(t,A(n),{shouldValidate:P(),shouldDirty:!0})},[c,t,P]),onBlur:M,name:t,value:_,ref:L},meta:Object.defineProperties({invalid:!!fe(h,t)},{isDirty:{get:()=>!!fe(f.dirtyFields,t)},isTouched:{get:()=>!!fe(f.touched,t)}})}}(e),a=Object.assign(Object.assign({},o),r);return t?n.isValidElement(t)?n.cloneElement(t,a):n.createElement(t,a):l?l(r,i):null},rt=e=>{let{control:n,t:o}=e;const r=window.Digit.Utils.browser.isMobile();return l.createElement(Fragment,null,l.createElement(t.SearchField,{className:"pt-form-field"},l.createElement("label",null,o("AUDIT_FROM_DATE_LABEL")),l.createElement(ot,{render:e=>l.createElement(t.DatePicker,{date:e.value,onChange:e.onChange}),name:"fromDate",control:n})),l.createElement(t.SearchField,{className:"pt-form-field"},l.createElement("label",null,o("AUDIT_TO_DATE_LABEL")),l.createElement(ot,{render:e=>l.createElement(t.DatePicker,{date:e.value,onChange:e.onChange}),name:"toDate",control:n})),l.createElement(t.SearchField,{className:"pt-search-action-submit"},l.createElement(t.Button,{style:{marginTop:r?"510px":"25px",marginLeft:r?"0":"-30px",maxWidth:r?"100%":"240px"},label:o("ES_COMMON_APPLY"),submit:!0})))},it=e=>{var o;let{Controller:r,register:i,control:a,t:s,reset:c,previousPage:u,handleSubmit:d,tenantId:m,data:p,onSubmit:v,isLoading:g}=e;const[f,E]=n.useState([]),y=e=>l.createElement("div",{onClick:e.onClick},l.createElement(t.DownloadBtnCommon,null));n.useEffect(()=>{(null==p?void 0:p.length)>0&&E([null==p?void 0:p.map(e=>{let t={};return t[s("AUDIT_DATE_LABEL")]=h(null==e?void 0:e.timestamp),t[s("AUDIT_TIME_LABEL")]=C(null==e?void 0:e.timestamp),t[s("AUDIT_DATAVIEWED_LABEL")]=(null==e?void 0:e.dataView[0])+","+(null==e?void 0:e.dataView[1]),t[s("AUDIT_DATAVIEWED_BY_LABEL")]=null==e?void 0:e.dataViewedBy,t[s("AUDIT_ROLE_LABEL")]=null==e?void 0:e.roles.map(e=>e.name).join(","),{...t}})])},[p]);const h=e=>{if(null==e||null==e||""==e)return"NA";const t=new Date(e);let n=t.getMonth()+1,l=t.getDate();return n=(n>9?"":"0")+n,l=(l>9?"":"0")+l,`${l}/${n}/${t.getFullYear()}`},C=e=>{if(null==e||null==e||""==e)return"NA";const t=new Date(e);let n=t.getHours(),l=t.getMinutes(),o=n>12?"PM":"AM";return n=n>12?n-12:n,n=(n>9?"":"0")+n,l=(l>9?"":"0")+l,`${n}:${l} ${o}`},[b,S]=n.useReducer(function(e,t){switch(t.type){case"set":return t.payload;case"remove":return!1}},!1),O=()=>{S({type:"remove"})},I=()=>l.createElement("div",{className:"InboxMobilePopupCloseButtonWrapper",onClick:O},l.createElement(t.CloseSvg,null)),w={Controller:r,register:i,control:a,t:s,reset:c,previousPage:u},_=n.useCallback(e=>{let{currentlyActiveMobileModal:n,searchFormFieldsComponentProps:o,tenantId:r,...i}=e;return(e=>{let{currentlyActiveMobileModal:n,searchFormFieldsComponentProps:o,tenantId:r,...i}=e;const{closeMobilePopupModal:a}=i;switch(n){case"SearchFormComponent":return l.createElement(t.SearchForm,i,l.createElement(I,null),l.createElement("div",{className:"MobilePopupHeadingWrapper"},l.createElement("h2",null,s("PRIVACY_AUDIT_REPORT"),":")),l.createElement(rt,N({},o,{closeMobilePopupModal:a,tenantId:r,t:s})));default:return l.createElement("span",null)}})({currentlyActiveMobileModal:n,searchFormFieldsComponentProps:o,tenantId:r,...i})},[b]);null==p||null===(o=p.roles)||void 0===o||o.forEach(e=>{});const D=n.useMemo(()=>null!=p&&p.display||""===p?[]:null==p?void 0:p.map(e=>{var t;return{[s("AUDIT_DATE_LABEL")]:h(e.timestamp),[s("AUDIT_TIME_LABEL")]:C(e.timestamp),[s("AUDIT_DATAVIEWED_LABEL")]:e.dataView[0]+","+e.dataView[1],[s("AUDIT_DATAVIEWED_BY_LABEL")]:e.dataViewedBy,[s("AUDIT_ROLE_LABEL")]:null===(t=e.roles.slice(0,3))||void 0===t?void 0:t.map(e=>e.name).join(",")}}),[p]);return l.createElement(l.Fragment,null,l.createElement(t.BackButton,null),l.createElement("div",{className:"sideContent",style:{marginLeft:"70%",marginTop:"-12%"}},l.createElement(y,{className:"mrlg cursorPointer",onClick:()=>(e=>{if(void 0!==(null==e?void 0:e[0]))return Digit.Download.Excel(null==e?void 0:e[0],"AuditReport")})(f)})),l.createElement(t.Header,null,s("PRIVACY_AUDIT_REPORT"),":"),l.createElement("div",{className:"digit-search-box"},l.createElement(t.SearchAction,{text:s("ES_COMMON_SEARCH"),handleActionClick:()=>S({type:"set",payload:"SearchFormComponent"}),tenantId:m,t:s})),b?l.createElement(t.PopUp,null,l.createElement(_,{onSubmit:e=>{S({type:"remove"}),v(e)},handleSubmit:d,id:"search-form",className:"rm-mb form-field-flex-one inboxPopupMobileWrapper",searchFormFieldsComponentProps:w,currentlyActiveMobileModal:b,closeMobilePopupModal:O,tenantId:m})):null,g&&l.createElement(t.Loader,null),l.createElement(t.DetailsCard,{data:D}))},at=e=>{let{tenantId:o,t:r,onSubmit:i,data:a,count:c}=e;const u=Digit.SessionStorage.get("AUDIT_APPLICATION_DETAIL")||{offset:0,limit:5,sortOrder:"DESC"},{register:d,control:m,handleSubmit:p,setValue:v,getValues:g,reset:f}=function(e){let{mode:t=ie.onSubmit,reValidateMode:l=ie.onChange,resolver:o,context:r,defaultValues:i={},shouldFocusError:a=!0,shouldUnregister:s=!0,criteriaMode:c}=void 0===e?{}:e;const u=n.useRef({}),d=n.useRef({}),m=n.useRef({}),p=n.useRef(new Set),v=n.useRef({}),g=n.useRef({}),f=n.useRef({}),E=n.useRef({}),y=n.useRef(i),h=n.useRef(!1),C=n.useRef(!1),b=n.useRef(),S=n.useRef({}),O=n.useRef({}),N=n.useRef(r),I=n.useRef(o),w=n.useRef(new Set),_=n.useRef(Qe(t)),{isOnSubmit:D,isOnTouch:T}=_.current,L=c===ie.all,[R,P]=n.useState({isDirty:!1,isValidating:!1,dirtyFields:{},isSubmitted:!1,submitCount:0,touched:{},isSubmitting:!1,isSubmitSuccessful:!1,isValid:!D,errors:{}}),A=n.useRef({isDirty:!nt,dirtyFields:!nt,touched:!nt||T,isValidating:!nt,isSubmitting:!nt,isValid:!nt}),x=n.useRef(R),M=n.useRef(),{isOnBlur:k,isOnChange:U}=n.useRef(Qe(l)).current;N.current=r,I.current=o,x.current=R,S.current=s?{}:Te(S.current)?Ke(i):S.current;const B=n.useCallback(function(e){void 0===e&&(e={}),h.current||(x.current=Object.assign(Object.assign({},x.current),e),P(x.current))},[]),F=()=>A.current.isValidating&&B({isValidating:!0}),j=n.useCallback(function(e,t,n,l,o){void 0===n&&(n=!1),void 0===l&&(l={});let r=n||(e=>{let{errors:t,name:n,error:l,validFields:o,fieldsWithValidation:r}=e;const i=ge(l),a=fe(t,n);return i&&!!a||!i&&!Me(a,l,!0)||i&&fe(r,n)&&!fe(o,n)})({errors:x.current.errors,error:t,name:e,validFields:E.current,fieldsWithValidation:f.current});const i=fe(x.current.errors,e);t?(Re(E.current,e),r=r||!i||!Me(i,t,!0),pe(x.current.errors,e,t)):((fe(f.current,e)||I.current)&&(pe(E.current,e,!0),r=r||i),Re(x.current.errors,e)),(r&&!ae(n)||!Te(l)||A.current.isValidating)&&B(Object.assign(Object.assign(Object.assign({},l),I.current?{isValid:!!o}:{}),{isValidating:!1}))},[]),V=n.useCallback((e,t)=>{const{ref:n,options:l}=u.current[e],o=Je&&re(n)&&ae(t)?"":t;Ce(n)?(l||[]).forEach(e=>{let{ref:t}=e;return t.checked=t.value===o}):be(n)&&!Ue(o)?n.files=o:Oe(n)?[...n.options].forEach(e=>e.selected=o.includes(e.value)):Se(n)&&l?l.length>1?l.forEach(e=>{let{ref:t}=e;return t.checked=Array.isArray(o)?!!o.find(e=>e===t.value):o===t.value}):l[0].ref.checked=!!o:n.value=o},[]),H=n.useCallback((e,t)=>{if(A.current.isDirty){const n=Q();return e&&t&&pe(n,e,t),!Me(n,y.current)}return!1},[]),G=n.useCallback(function(e,t){if(void 0===t&&(t=!0),A.current.isDirty||A.current.dirtyFields){const n=!Me(fe(y.current,e),_e(u,e,S)),l=fe(x.current.dirtyFields,e),o=x.current.isDirty;n?pe(x.current.dirtyFields,e,!0):Re(x.current.dirtyFields,e);const r={isDirty:H(),dirtyFields:x.current.dirtyFields},i=A.current.isDirty&&o!==r.isDirty||A.current.dirtyFields&&l!==fe(x.current.dirtyFields,e);return i&&t&&B(r),i?r:{}}return{}},[]),$=n.useCallback(function(e,t){try{return"production"===process.env.NODE_ENV||u.current[e]?Promise.resolve($e(u,L,u.current[e],S)).then(function(n){const l=n[e];return j(e,l,t),ge(l)}):(console.warn("📋 Field is missing with `name` attribute: ",e),Promise.resolve(!1))}catch(e){return Promise.reject(e)}},[j,L]),W=n.useCallback(function(e){try{return Promise.resolve(I.current(Q(),N.current,L)).then(function(t){let{errors:n}=t;const l=x.current.isValid;if(Array.isArray(e)){const t=e.map(e=>{const t=fe(n,e);return t?pe(x.current.errors,e,t):Re(x.current.errors,e),!t}).every(Boolean);return B({isValid:Te(n),isValidating:!1}),t}{const t=fe(n,e);return j(e,t,l!==Te(n),{},Te(n)),!t}})}catch(e){return Promise.reject(e)}},[j,L]),q=n.useCallback(function(e){try{let n=!1;function t(e){return n?e:Promise.resolve($(l))}const l=e||Object.keys(u.current);if(F(),I.current)return Promise.resolve(W(l));const o=function(){if(Array.isArray(l))return!e&&(x.current.errors={}),Promise.resolve(Promise.all(l.map(function(e){try{return Promise.resolve($(e,null))}catch(e){return Promise.reject(e)}}))).then(function(e){B({isValidating:!1});const t=e.every(Boolean);return n=!0,t})}();return Promise.resolve(o&&o.then?o.then(t):t(o))}catch(e){return Promise.reject(e)}},[W,$]),X=n.useCallback((e,t,n)=>{let{shouldDirty:l,shouldValidate:o}=n;const r={};pe(r,e,t);for(const n of We(e,t))u.current[n]&&(V(n,fe(r,n)),l&&G(n),o&&q(n))},[q,V,G]),Z=n.useCallback((e,t,n)=>{if(!s&&!Ae(t)&&pe(S.current,e,Array.isArray(t)?[...t]:Object.assign({},t)),u.current[e])V(e,t),n.shouldDirty&&G(e),n.shouldValidate&&q(e);else if(!Ae(t)&&(X(e,t,n),w.current.has(e))){const l=Ze(e)||e;pe(d.current,e,t),O.current[l]({[l]:fe(d.current,l)}),(A.current.isDirty||A.current.dirtyFields)&&n.shouldDirty&&(pe(x.current.dirtyFields,e,((e,t,n)=>xe(ke(e,t,n.slice(0,e.length)),ke(t,e,n.slice(0,e.length))))(t,fe(y.current,e,[]),fe(x.current.dirtyFields,e,[]))),B({isDirty:!Me(Object.assign(Object.assign({},Q()),{[e]:t}),y.current)}))}!s&&pe(S.current,e,t)},[G,V,X]),Y=e=>C.current||p.current.has(e)||p.current.has((e.match(/\w+/)||[])[0]),J=e=>{let t=!0;if(!Te(v.current))for(const n in v.current)e&&v.current[n].size&&!v.current[n].has(e)&&!v.current[n].has(Ze(e))||(g.current[n](),t=!1);return t};function K(e){if(!s){let t=Ke(e);for(const e of w.current)ue(e)&&!t[e]&&(t=Object.assign(Object.assign({},t),{[e]:[]}));return t}return e}function Q(e){if(Ue(e))return _e(u,e,S);if(Array.isArray(e)){const t={};for(const n of e)pe(t,n,_e(u,n,S));return t}return K(Be(u,Ke(S.current),s))}b.current=b.current?b.current:function(e){let{type:t,target:n}=e;try{let e=n.name;const l=u.current[e];let o,r;return Promise.resolve(function(){if(l){function i(){!a&&J(e),j(e,o,m,d,r)}const a="blur"===t,c=Xe(Object.assign({isBlurEvent:a,isReValidateOnChange:U,isReValidateOnBlur:k,isTouched:!!fe(x.current.touched,e),isSubmitted:x.current.isSubmitted},_.current));let d=G(e,!1),m=!Te(d)||!a&&Y(e);if(a&&!fe(x.current.touched,e)&&A.current.touched&&(pe(x.current.touched,e,!0),d=Object.assign(Object.assign({},d),{touched:x.current.touched})),!s&&Se(n)&&pe(S.current,e,_e(u,e)),c)return!a&&J(e),(!Te(d)||m&&Te(d))&&B(d);F();const p=I.current?Promise.resolve(I.current(Q(),N.current,L)).then(function(t){let{errors:l}=t;const i=x.current.isValid;if(o=fe(l,e),Se(n)&&!o&&I.current){const t=Ze(e),n=fe(l,t,{});n.type&&n.message&&(o=n),t&&(n||fe(x.current.errors,t))&&(e=t)}r=Te(l),i!==r&&(m=!0)}):Promise.resolve($e(u,L,l,S)).then(function(t){o=t[e]});return p&&p.then?p.then(i):i()}}())}catch(e){return Promise.reject(e)}};const ee=n.useCallback(function(e){void 0===e&&(e={});try{const t=Te(u.current)?y.current:{};return Promise.resolve(I.current(Object.assign(Object.assign(Object.assign({},t),Q()),e),N.current,L)).then(function(e){let{errors:t}=e;const n=Te(t);x.current.isValid!==n&&B({isValid:n})})}catch(e){return Promise.reject(e)}},[L]),te=n.useCallback((e,t)=>{!function(e,t,n,l,o,r){const{ref:i,ref:{name:a}}=n,s=e.current[a];if(!o){const t=_e(e,a,l);!ge(t)&&pe(l.current,a,t)}i.type&&s?Ce(i)||Se(i)?Array.isArray(s.options)&&s.options.length?(de(s.options).forEach(function(e,n){void 0===e&&(e={}),(De(e.ref)&&Pe(e,e.ref)||r)&&(Ee(e.ref,t),Re(s.options,`[${n}]`))}),s.options&&!de(s.options).length&&delete e.current[a]):delete e.current[a]:(De(i)&&Pe(s,i)||r)&&(Ee(i,t),delete e.current[a]):delete e.current[a]}(u,b.current,e,S,s,t),s&&(Re(E.current,e.ref.name),Re(f.current,e.ref.name))},[s]),ne=n.useCallback(e=>{if(C.current)B();else{for(const t of p.current)if(t.startsWith(e)){B();break}J(e)}},[]),le=n.useCallback((e,t)=>{e&&(te(e,t),s&&!de(e.options||[]).length&&(Re(x.current.errors,e.ref.name),pe(x.current.dirtyFields,e.ref.name,!0),B({isDirty:H()}),A.current.isValid&&I.current&&ee(),ne(e.ref.name)))},[ee,te]),oe=n.useCallback((e,t,n)=>{const l=n?v.current[n]:p.current;let o=Be(u,Ke(S.current),s,!1,e);if(Ue(e)){const n=Ze(e)||e;return w.current.has(n)&&(o=Object.assign(Object.assign({},m.current),o)),qe(o,e,l,ge(fe(y.current,e))?t:fe(y.current,e),!0)}const r=ge(t)?y.current:t;return Array.isArray(e)?e.reduce((e,t)=>Object.assign(Object.assign({},e),{[t]:qe(o,t,l,r)}),{}):(C.current=ge(n),ve(!Te(o)&&o||r))},[]);function se(e,t){if(void 0===t&&(t={}),"production"!==process.env.NODE_ENV){if(!e.name)return console.warn("📋 Field is missing `name` attribute",e,"https://react-hook-form.com/api#useForm");if(w.current.has(e.name.split(/\[\d+\]$/)[0])&&!RegExp(`^${e.name.split(/\[\d+\]$/)[0]}[\\d+].\\w+`.replace(/\[/g,"\\[").replace(/\]/g,"\\]")).test(e.name))return console.warn('📋 `name` prop should be in object shape: name="test[index].name"',e,"https://react-hook-form.com/api#useFieldArray")}const{name:n,type:l,value:o}=e,r=Object.assign({ref:e},t),i=u.current,a=et(e),c=Ye(w.current,n),d=t=>Je&&(!re(e)||t===e);let m,p=i[n],v=!0;if(p&&(a?Array.isArray(p.options)&&de(p.options).find(e=>o===e.ref.value&&d(e.ref)):d(p.ref)))return void(i[n]=Object.assign(Object.assign({},p),t));p=l?a?Object.assign({options:[...de(p&&p.options||[]),{ref:e}],ref:{type:l,name:n}},t):Object.assign({},r):r,i[n]=p;const g=ge(fe(S.current,n));Te(y.current)&&g||(m=fe(g?y.current:S.current,n),v=ge(m),v||c||V(n,m)),Te(t)||(pe(f.current,n,!0),!D&&A.current.isValid&&$e(u,L,p,S).then(e=>{const t=x.current.isValid;Te(e)?pe(E.current,n,!0):Re(E.current,n),t!==Te(e)&&B()})),!s||c&&v||!c&&Re(x.current.dirtyFields,n),l&&function(e,t,n){let{ref:l}=e;re(l)&&n&&(l.addEventListener(t?"change":"input",n),l.addEventListener("blur",n))}(a&&p.options?p.options[p.options.length-1]:p,a||"select-one"===e.type,b.current)}const me=n.useCallback((e,t)=>function(n){try{n&&n.preventDefault&&(n.preventDefault(),n.persist());let l={},o=K(Be(u,Ke(S.current),s,!0));return A.current.isSubmitting&&B({isSubmitting:!0}),Promise.resolve(function(r,i){try{var s=function(){function r(){const r=function(){if(Te(l)&&Object.keys(x.current.errors).every(e=>e in u.current))return B({errors:{},isSubmitting:!0}),Promise.resolve(e(o,n)).then(function(){});{function r(e){a&&((e,t)=>{for(const n in e)if(fe(t,n)){const t=e[n];if(t){if(t.ref.focus&&ge(t.ref.focus()))break;if(t.options){t.options[0].ref.focus();break}}}})(u.current,x.current.errors)}return x.current.errors=Object.assign(Object.assign({},x.current.errors),l),t?Promise.resolve(t(x.current.errors,n)).then(r):r()}}();if(r&&r.then)return r.then(function(){})}const i=I.current?Promise.resolve(I.current(o,N.current,L)).then(function(e){let{errors:t,values:n}=e;x.current.errors=l=t,o=n}):z(Object.values(u.current),function(e){const t=function(){if(e){const{name:t}=e.ref;return Promise.resolve($e(u,L,e,S)).then(function(e){e[t]?(pe(l,t,e[t]),Re(E.current,t)):fe(f.current,t)&&(Re(x.current.errors,t),pe(E.current,t,!0))})}}();if(t&&t.then)return t.then(function(){})});return i&&i.then?i.then(r):r()}()}catch(e){return i(!0,e)}return s&&s.then?s.then(i.bind(null,!1),i.bind(null,!0)):i(!1,s)}(0,function(e,t){if(x.current.isSubmitting=!1,B({isSubmitted:!0,isSubmitting:!1,isSubmitSuccessful:Te(x.current.errors),submitCount:x.current.submitCount+1}),e)throw t;return t}))}catch(n){return Promise.reject(n)}},[a,L]);n.useEffect(()=>{o&&A.current.isValid&&ee(),M.current=M.current||!Je?M.current:function(e,t){const n=new MutationObserver(()=>{for(const n of Object.values(e.current))if(n&&n.options)for(const e of n.options)e&&e.ref&&De(e.ref)&&t(n);else n&&De(n.ref)&&t(n)});return n.observe(window.document,{childList:!0,subtree:!0}),n}(u,le)},[le,y.current]),n.useEffect(()=>()=>{M.current&&M.current.disconnect(),h.current=!0,"production"===process.env.NODE_ENV&&Object.values(u.current).forEach(e=>le(e,!0))},[]),!o&&A.current.isValid&&(R.isValid=Me(E.current,f.current)&&Te(x.current.errors));const ye={trigger:q,setValue:n.useCallback(function(e,t,n){Z(e,t,n||{}),Y(e)&&B(),J(e)},[Z,q]),getValues:n.useCallback(Q,[]),register:n.useCallback(function(e,t){if(!tt)if(Ue(e))se({name:e},t);else{if(!ce(e)||!("name"in e))return t=>t&&se(t,e);se(e,t)}},[y.current]),unregister:n.useCallback(function(e){for(const t of Array.isArray(e)?e:[e])le(u.current[t],!0)},[]),formState:nt?new Proxy(R,{get:(e,t)=>{if("production"!==process.env.NODE_ENV&&"isValid"===t&&D&&console.warn("📋 `formState.isValid` is applicable with `onTouched`, `onChange` or `onBlur` mode. https://react-hook-form.com/api#formState"),t in e)return A.current[t]=!0,e[t]}}):R},he=n.useMemo(()=>Object.assign({isFormDirty:H,updateWatchedValue:ne,shouldUnregister:s,updateFormState:B,removeFieldEventListener:te,watchInternal:oe,mode:_.current,reValidateMode:{isReValidateOnBlur:k,isReValidateOnChange:U},validateResolver:o?ee:void 0,fieldsRef:u,resetFieldArrayFunctionRef:O,useWatchFieldsRef:v,useWatchRenderFunctionsRef:g,fieldArrayDefaultValuesRef:d,validFieldsRef:E,fieldsWithValidationRef:f,fieldArrayNamesRef:w,readFormStateRef:A,formStateRef:x,defaultValuesRef:y,shallowFieldsStateRef:S,fieldArrayValuesRef:m},ye),[y.current,ne,s,te,oe]);return Object.assign({watch:function(e,t){return oe(e,t)},control:he,handleSubmit:me,reset:n.useCallback(function(e,t){if(void 0===t&&(t={}),Je)for(const e of Object.values(u.current))if(e){const{ref:t,options:n}=e,l=et(t)&&Array.isArray(n)?n[0].ref:t;if(re(l))try{l.closest("form").reset();break}catch(e){}}u.current={},y.current=Object.assign({},e||y.current),e&&J(""),Object.values(O.current).forEach(e=>Ve(e)&&e()),S.current=s?{}:Ke(e||y.current),(e=>{let{errors:t,isDirty:n,isSubmitted:l,touched:o,isValid:r,submitCount:i,dirtyFields:a}=e;r||(E.current={},f.current={}),d.current={},p.current=new Set,C.current=!1,B({submitCount:i?x.current.submitCount:0,isDirty:!!n&&x.current.isDirty,isSubmitted:!!l&&x.current.isSubmitted,isValid:!!r&&x.current.isValid,dirtyFields:a?x.current.dirtyFields:{},touched:o?x.current.touched:{},errors:t?x.current.errors:{},isSubmitting:!1,isSubmitSuccessful:!1})})(t)},[]),clearErrors:n.useCallback(function(e){e&&(Array.isArray(e)?e:[e]).forEach(e=>u.current[e]&&ue(e)?delete x.current.errors[e]:Re(x.current.errors,e)),B({errors:e?x.current.errors:{}})},[]),setError:n.useCallback(function(e,t){const n=(u.current[e]||{}).ref;pe(x.current.errors,e,Object.assign(Object.assign({},t),{ref:n})),B({isValid:!1}),t.shouldFocus&&n&&n.focus&&n.focus()},[]),errors:R.errors},ye)}({defaultValues:u}),E=e=>{if(null==e||null==e||""==e)return"NA";const t=new Date(e);let n=t.getMonth()+1,l=t.getDate();return n=(n>9?"":"0")+n,l=(l>9?"":"0")+l,`${l}/${n}/${t.getFullYear()}`},y=e=>{if(null==e||null==e||""==e)return"NA";const t=new Date(e);let n=t.getHours(),l=t.getMinutes(),o=n>12?"PM":"AM";return n=n>12?n-12:n,n=(n>9?"":"0")+n,l=(l>9?"":"0")+l,`${n}:${l} ${o}`},[h,C]=n.useState([]),b=e=>l.createElement("div",{onClick:e.onClick},l.createElement(s.DownloadBtnCommon,null));n.useEffect(()=>{d("offset",0),d("limit",5),d("sortOrder","DESC")},[d]),n.useEffect(()=>{(null==a?void 0:a.length)>0&&C([null==a?void 0:a.map(e=>{let t={};return t[r("AUDIT_DATE_LABEL")]=E(null==e?void 0:e.timestamp),t[r("AUDIT_TIME_LABEL")]=y(null==e?void 0:e.timestamp),t[r("AUDIT_DATAVIEWED_LABEL")]=(null==e?void 0:e.dataView[0])+","+(null==e?void 0:e.dataView[1]),t[r("AUDIT_DATAVIEWED_BY_LABEL")]=null==e?void 0:e.dataViewedBy,t[r("AUDIT_ROLE_LABEL")]=null==e?void 0:e.roles.map(e=>e.name).join(","),{...t}})])},[a]);const S=n.useCallback(e=>{0!==e.length&&(v("sortBy",e.id),v("sortOrder",e.desc?"DESC":"ASC"))},[]);function O(){v("offset",g("offset")-g("limit")),p(i)()}const N=window.Digit.Utils.browser.isMobile();if(N)return l.createElement(it,{Controller:ot,register:d,control:m,t:r,reset:f,previousPage:O,handleSubmit:p,tenantId:o,data:a,onSubmit:i});const I=e=>l.createElement("span",{className:"cell-text"},e),w=n.useMemo(()=>[{Header:r("AUDIT_DATE_LABEL"),disableSortBy:!0,accessor:e=>{const t="NA"===e.timestamp?r("WS_NA"):E(e.timestamp);return I(""+t)}},{Header:r("AUDIT_TIME_LABEL"),disableSortBy:!0,accessor:e=>{const t="NA"===e.timestamp?r("WS_NA"):y(e.timestamp);return I(""+t)}},{Header:r(N?"AUDIT_DATAVIEWED_LABEL":"AUDIT_DATAVIEWED_PRIVACY"),disableSortBy:!0,accessor:e=>I(""+(null==e?void 0:e.dataView))},{Header:r(N?"AUDIT_DATAVIEWED_BY_LABEL":"AUDIT_DATAVIEWED_BY_PRIVACY"),disableSortBy:!0,accessor:e=>I(""+(null==e?void 0:e.dataViewedBy))},{Header:r("AUDIT_ROLE_LABEL"),disableSortBy:!0,accessor:e=>{var t;return I(""+(null==e||null===(t=e.roles.slice(0,3))||void 0===t?void 0:t.map(e=>e.name)))}}],[]);return l.createElement(l.Fragment,null,l.createElement("div",{style:{marginRight:"-70px"}}," ",l.createElement(t.BackButton,null)," "),l.createElement("div",{style:{marginTop:"30px",marginLeft:"30px"}}," ",l.createElement(t.Header,null,r("PRIVACY_AUDIT_REPORT"))," "),l.createElement(t.SearchForm,{className:"audit-card",onSubmit:i,handleSubmit:p},l.createElement(rt,{register:d,control:m,reset:f,tenantId:o,t:r,previousPage:O})),l.createElement("div",{style:{marginTop:"240px",marginLeft:"-55%",maxWidth:"80%",marginRight:"52px"}},null!=a&&a.display?l.createElement("div",{style:{marginTop:"20x",width:"1025px",marginLeft:"25px",backgroundColor:"white",height:"60px"}},r(a.display).split("\\n").map((e,t)=>l.createElement("p",{key:t,style:{textAlign:"center"}},e))):""!==a?l.createElement("div",{style:{backgroundColor:"white",marginRight:"-30px",marginLeft:"30px"}},l.createElement("div",{className:"sideContent",style:{float:"right",padding:"10px 30px"}},l.createElement(b,{className:"mrlg cursorPointer",onClick:()=>(e=>{if(void 0!==(null==e?void 0:e[0]))return Digit.Download.Excel(null==e?void 0:e[0],"AuditReport")})(h)})),l.createElement(s.Table,{t:r,data:a,totalRecords:c,columns:w,getCellProps:e=>({style:{minWidth:e.column.Header===r("ES_INBOX_APPLICATION_NO")?"240px":"",padding:"20px 18px",fontSize:"16px"}}),onPageSizeChange:function(e){v("limit",Number(e.target.value)),p(i)()},currentPage:g("offset")/g("limit"),onNextPage:function(){v("offset",g("offset")+g("limit")),p(i)()},onPrevPage:O,manualPagination:!1,pageSizeLimit:g("limit"),onSort:S,disableSort:!1,sortParams:[{id:g("sortBy"),desc:"DESC"===g("sortOrder")}]})):l.createElement(t.Loader,null)))},st=e=>{var t,r;const{t:i}=o.useTranslation(),a=Digit.ULBService.getCitizenCurrentTenant(),[s,c]=n.useState({}),u=function(e,t){void 0===t&&(t="dayend");try{const n=e.match(/(\d{4})-(\d{1,2})-(\d{1,2})/),l=new Date(Date.UTC(n[1],n[2]-1,n[3]));return l.setMinutes(l.getMinutes()+l.getTimezoneOffset()),"dayend"===t&&(l.setHours(l.getHours()+24),l.setSeconds(l.getSeconds()-1)),l.getTime()}catch(t){return e}};n.useEffect(()=>{const e=Digit.SessionStorage.get("AUDIT_APPLICATION_DETAIL")||{};if(e){const t={...e};c(Object.keys(t).filter(e=>t[e]).reduce((e,n)=>({...e,[n]:"object"==typeof t[n]?t[n].code:t[n]}),{}))}},[]);const d={enabled:!!(s&&Object.keys(s).length>0)},m={...s},{isLoading:p,data:v}=Digit.Hooks.useAudit({tenantId:a,filters:{...m},config:d});return l.createElement(at,{t:i,tenantId:a,onSubmit:function(e){Digit.SessionStorage.set("AUDIT_APPLICATION_DETAIL",{offset:0,limit:5,sortBy:"commencementDate",sortOrder:"DESC"});const t={...e,fromDate:u(null==e?void 0:e.fromDate),toDate:u(null==e?void 0:e.toDate)};c(Object.keys(t).filter(e=>t[e]).reduce((e,n)=>({...e,[n]:t[n]}),{}))},data:p?"":(null==v||null===(t=v.ElasticSearchData)||void 0===t?void 0:t.length)>0?null==v?void 0:v.ElasticSearchData:{display:"ES_COMMON_NO_DATA"},count:null==v||null===(r=v.ElasticSearchData)||void 0===r?void 0:r.length})},ct=e=>{var n,r,i,a,s,c,u,d,m,p,v,g,f,E,y,h;let{moduleCode:C}=e;const{t:b}=o.useTranslation(),S=Digit.ULBService.getCitizenCurrentTenant(),{isLoading:O,data:N}=Digit.Hooks.useStaticData(Digit.ULBService.getStateId()),{isLoading:I,error:w,data:_}=Digit.Hooks.useDynamicData({moduleCode:C,tenantId:S,filters:{},t:b}),D=e=>{let{module:n,styles:o}=e;switch(n){case"TL":return l.createElement(t.CaseIcon,{className:"fill-path-primary-main",styles:o});case"PT":return l.createElement(t.PTIcon,{className:"fill-path-primary-main",styles:o});case"MCOLLECT":return l.createElement(t.MCollectIcon,{className:"fill-path-primary-main",styles:o});case"PGR":return l.createElement(t.ComplaintIcon,{className:"fill-path-primary-main",styles:o});default:return l.createElement(t.CaseIcon,{className:"fill-path-primary-main",styles:o})}},T=null==N||null===(n=N.MdmsRes["common-masters"])||void 0===n||null===(r=n.StaticData[0])||void 0===r?void 0:r[""+C],L=e=>{let{module:n}=e;switch(n){case"PT":case"WS":return l.createElement("span",{className:"timerIcon"},l.createElement(t.TimerIcon,null));default:return null}},R=e=>{let{module:n}=e;switch(n){case"PT":return l.createElement("span",{className:"rupeeSymbol"},l.createElement(t.RupeeSymbol,null));case"WS":return l.createElement("span",{className:"timerIcon"},l.createElement(t.TimerIcon,null));default:return null}},P=e=>{switch(e){case"TL":case"PT":case"MCOLLECT":return{staticCommonContent:b("COMMON_VALIDITY"),validity:(null==T?void 0:T.validity)+b("1"===(null==T?void 0:T.validity)?"COMMON_DAY":"COMMON_DAYS")};case"PGR":return{staticCommonContent:b("ACTION_TEST_COMPLAINT_TYPES")};case"OBPS":return{staticCommonContent:b("BUILDING_PLAN_PERMIT_VALIDITY"),validity:(null==T?void 0:T.validity)+" "+b("1"===(null==T?void 0:T.validity)?"COMMON_DAY":"COMMON_DAYS")};default:return{staticCommonContent:""}}},A=e=>{switch(e){case"PT":return{staticDataOne:(null==T?void 0:T.staticDataOne)+" "+b("COMMON_DAYS"),staticDataOneHeader:b("APPLICATION_PROCESSING_TIME"),staticDataTwo:null==T?void 0:T.staticDataTwo,staticDataTwoHeader:b("APPLICATION_PROCESSING_FEE")};case"WS":return{staticDataOne:"",staticDataOneHeader:b("PAY_WATER_CHARGES_BY")+" "+(null==T?void 0:T.staticDataOne)+" "+b("COMMON_DAYS")+" "+b("OF_BILL_GEN_TO_AVOID_LATE_FEE"),staticDataTwo:(null==T?void 0:T.staticDataTwo)+" "+b("COMMON_DAYS"),staticDataTwoHeader:b("APPLICATION_PROCESSING_TIME")};default:return{}}};return O||I?l.createElement(t.Loader,null):T?l.createElement(l.Fragment,null,T&&null!=T&&T.payViaWhatsApp?l.createElement(t.Card,{style:{margin:"16px",padding:"16px",maxWidth:"unset"}},l.createElement("div",{className:"pay-whatsapp-card",onClick:()=>{window.open(null==T?void 0:T.payViaWhatsApp)}},l.createElement("div",{className:"pay-whatsapp-text"},b("PAY_VIA_WHATSAPP")),l.createElement("div",{className:"whatsAppIconG"},l.createElement(t.WhatsappIconGreen,null)))):null,T&&null!=T&&T.helpline?l.createElement(t.Card,{style:{margin:"16px",padding:"16px",maxWidth:"unset"}},l.createElement("div",{className:"static-home-Card"},l.createElement("div",{className:"static-home-Card-header"},b("CALL_CENTER_HELPLINE")),l.createElement("div",{className:"helplineIcon"},l.createElement(t.HelpLineIcon,null))),l.createElement("div",{className:"call-center-card-text"},null!=T&&null!==(i=T.helpline)&&void 0!==i&&i.contactOne?l.createElement("div",{className:"call-center-card-content"},l.createElement("a",{href:"tel:"+(null==T||null===(a=T.helpline)||void 0===a?void 0:a.contactOne)},null==T||null===(s=T.helpline)||void 0===s?void 0:s.contactOne)):null,null!=T&&null!==(c=T.helpline)&&void 0!==c&&c.contactTwo?l.createElement("div",{className:"call-center-card-content"},l.createElement("a",{href:"tel:"+(null==T||null===(u=T.helpline)||void 0===u?void 0:u.contactTwo)},null==T||null===(d=T.helpline)||void 0===d?void 0:d.contactTwo)):null)):null,T&&null!=T&&T.serviceCenter?l.createElement(t.Card,{style:{margin:"16px",padding:"16px",maxWidth:"unset"}},l.createElement("div",{className:"static-home-Card"},l.createElement("div",{className:"static-home-Card-header"},b("CITIZEN_SERVICE_CENTER")),l.createElement("div",{className:"serviceCentrIcon"},l.createElement(t.ServiceCenterIcon,null))),l.createElement("div",{className:"service-center-details-card"},l.createElement("div",{className:"service-center-details-text"},null==T?void 0:T.serviceCenter)),null!=T&&T.viewMapLocation?l.createElement("div",{className:"link"},l.createElement("a",{href:null==T?void 0:T.viewMapLocation},b("VIEW_ON_MAP"))):null):l.createElement("div",null),l.createElement(t.Card,{style:{margin:"16px",padding:"16px",maxWidth:"unset"}},w||null==_||null===(null==_?void 0:_.dynamicDataOne)?l.createElement("div",null):l.createElement("div",{className:"dynamicDataCard"},l.createElement("div",{className:"dynamicData"},l.createElement(D,{module:C,styles:{width:"24px",height:"24px"}}),l.createElement("span",{className:"dynamicData-content"},null==_?void 0:_.dynamicDataOne))),w||null==_||null===(null==_?void 0:_.dynamicDataTwo)?l.createElement("div",null):l.createElement("div",{className:"dynamicDataCard"},l.createElement("div",{className:"dynamicData"},l.createElement(D,{module:C,styles:{width:"24px",height:"24px"}}),l.createElement("span",{className:"dynamicData-content"},null==_?void 0:_.dynamicDataTwo))),T&&null!=T&&T.staticDataOne?l.createElement("div",{className:"staticDataCard"},l.createElement("div",{className:"staticData"},l.createElement(L,{module:C}),l.createElement("span",{className:"static-data-content"},l.createElement("span",{className:"static-data-content-first",style:{marginTop:""===(null===(m=A(C))||void 0===m?void 0:m.staticDataOne)?"8px":"unset"}},null===(p=A(C))||void 0===p?void 0:p.staticDataOneHeader),l.createElement("span",{className:"static-data-content-second"},""+(null===(v=A(C))||void 0===v?void 0:v.staticDataOne))))):l.createElement("div",null),T&&null!=T&&T.staticDataTwo?l.createElement("div",{className:"staticDataCard"},l.createElement("div",{className:"staticData"},l.createElement(R,{module:C}),l.createElement("span",{className:"static-data-content"},l.createElement("span",{className:"static-data-content-first"},null===(g=A(C))||void 0===g?void 0:g.staticDataTwoHeader),l.createElement("span",{className:"static-data-content-second"},null===(f=A(C))||void 0===f?void 0:f.staticDataTwo)))):l.createElement("div",null),T&&null!=T&&T.validity?l.createElement("div",{className:"staticDataCard"},l.createElement("div",{className:"staticData"},l.createElement("span",{className:"validityIcon"},l.createElement(t.ValidityTimeIcon,null)),l.createElement("span",{className:"static-data-content"},l.createElement("span",{className:"static-data-content-first"},null===(E=P(C))||void 0===E?void 0:E.staticCommonContent),l.createElement("span",{className:"static-data-content-second"},null===(y=P(C))||void 0===y?void 0:y.validity)))):l.createElement("div",null),w||null==_||null==_||!_.staticData||null===(null==_?void 0:_.staticData)?l.createElement("div",null):l.createElement("div",{className:"staticDataCard"},l.createElement("div",{className:"staticData"},"PGR"===C?l.createElement(D,{module:C,styles:{width:"24px",height:"24px",marginLeft:"13px",marginTop:"12px"}}):l.createElement("span",{className:"validityIcon"},l.createElement(t.ValidityTimeIcon,null)),l.createElement("span",{className:"static-data-content"},l.createElement("span",{className:"static-data-content-first"},null===(h=P(C))||void 0===h?void 0:h.staticCommonContent),l.createElement("span",{className:"static-data-content-second"},null==_?void 0:_.staticData)))))):l.createElement(l.Fragment,null)};var ut,dt,mt,pt,vt;const gt=[(null===(ut=window)||void 0===ut?void 0:ut.contextPath)+"/citizen/register/name",`/${null===(dt=window)||void 0===dt?void 0:dt.contextPath}/citizen/select-language`,`/${null===(mt=window)||void 0===mt?void 0:mt.contextPath}/citizen/select-location`,`/${null===(pt=window)||void 0===pt?void 0:pt.contextPath}/citizen/login`,`/${null===(vt=window)||void 0===vt?void 0:vt.contextPath}/citizen/register/otp`],ft=(e,t)=>t.filter(t=>e.map(e=>e.code).includes(t.code)),Et=e=>{var n,r,i;let{stateInfo:s,userDetails:c,CITIZEN:u,cityDetails:d,mobileView:p,handleUserDropdownSelection:f,logoUrl:E,stateCode:h,modules:C,appTenants:b,pathname:S,initData:O}=e;const{isLoading:N,data:I,isFetched:w}=Digit.Hooks.useCustomMDMS(Digit.ULBService.getStateId(),"ACCESSCONTROL-ACTIONS-TEST",[{name:"actions-test",filter:`[?(@.url == '${window.contextPath}-card')]`}],{select:e=>{var t,n;return null==e||null===(t=e["ACCESSCONTROL-ACTIONS-TEST"])||void 0===t||null===(n=t["actions-test"])||void 0===n?void 0:n.filter(e=>!0===e.enabled).reduce((e,t)=>{var n;return e[t.parentModule]=(null===(n=e[t.parentModule])||void 0===n?void 0:n.length)>0?[t,...e[t.parentModule]]:[t],e},{})}}),_=Digit.Hooks.useRouteSubscription(S),{t:T}=o.useTranslation(),{path:L}=a.useRouteMatch(),R=a.useHistory(),P=gt.some(e=>window.location.href.includes(e)),x=C.map((e,t)=>{let{code:n,tenants:o}=e;const r=Digit.ComponentRegistryService.getComponent(n+"Module");return r?l.createElement(a.Route,{key:t,path:`${L}/${n.toLowerCase()}`},l.createElement(r,{stateCode:h,moduleCode:n,userType:"citizen",tenants:ft(o,b)})):null}),F=C.map((e,n)=>{let{code:o,bannerImage:r}=e,i=(Digit.ComponentRegistryService.getComponent(o+"Links"),w?g(I,o,T):void 0);return"ACTION_TEST_WS"===(null==i?void 0:i.header)&&(null==i||i.links.sort((e,t)=>t.orderNumber-e.orderNumber)),l.createElement(l.Fragment,null,l.createElement(a.Route,{key:n,path:`${L}/${o.toLowerCase()}-home`},l.createElement("div",{className:"moduleLinkHomePage"},l.createElement("img",{src:r||(null==s?void 0:s.bannerUrl),alt:"noimagefound"}),l.createElement(t.BackButton,{className:"moduleLinkHomePageBackButton"}),l.createElement("h1",null,T("MODULE_"+o.toUpperCase())),l.createElement("div",{className:"moduleLinkHomePageModuleLinks"},i&&l.createElement(t.CitizenHomeCard,{header:T(null==i?void 0:i.header),links:null==i?void 0:i.links,Icon:()=>l.createElement("span",null),Info:"OBPS"===o?()=>l.createElement(t.CitizenInfoLabel,{style:{margin:"0px",padding:"10px"},info:T("CS_FILE_APPLICATION_INFO_LABEL"),text:T("BPA_CITIZEN_HOME_STAKEHOLDER_INCLUDES_INFO_LABEL")}):null,isInfo:"OBPS"===o})),l.createElement(ct,{moduleCode:null==o?void 0:o.toUpperCase()}))),l.createElement(a.Route,{key:"faq"+n,path:`${L}/${o.toLowerCase()}-faq`},l.createElement(M,{module:null==o?void 0:o.toUpperCase()})),l.createElement(a.Route,{key:"hiw"+n,path:`${L}/${o.toLowerCase()}-how-it-works`},l.createElement(q,{module:null==o?void 0:o.toUpperCase()})))});return l.createElement("div",{className:_},l.createElement(A,{t:T,stateInfo:s,userDetails:c,CITIZEN:u,cityDetails:d,mobileView:p,handleUserDropdownSelection:f,logoUrl:E,showSidebar:!0,linkData:I,islinkDataLoading:N}),l.createElement("div",{className:"main center-container citizen-home-container mb-25"},P?null:l.createElement("div",{className:"SideBarStatic"},l.createElement(D,{linkData:I,islinkDataLoading:N})),l.createElement(a.Switch,null,l.createElement(a.Route,{exact:!0,path:L},l.createElement(k,null)),l.createElement(a.Route,{exact:!0,path:L+"/select-language"},l.createElement(U,null)),l.createElement(a.Route,{exact:!0,path:L+"/select-location"},l.createElement(B,null)),l.createElement(a.Route,{path:L+"/error"},l.createElement(m,{initData:O,goToHome:()=>{var e,t,n,l;R.push(`/${null===(e=window)||void 0===e?void 0:e.contextPath}/${null===(t=Digit)||void 0===t||null===(n=t.UserService)||void 0===n||null===(l=n.getType)||void 0===l?void 0:l.call(n)}`)}})),l.createElement(a.Route,{path:L+"/all-services"},l.createElement(y,{userType:"citizen",modules:C,getCitizenMenu:I,fetchedCitizen:w,isLoading:N})),l.createElement(a.Route,{path:L+"/login"},l.createElement(oe,{stateCode:h})),l.createElement(a.Route,{path:L+"/register"},l.createElement(oe,{stateCode:h,isUserRegistered:!1})),l.createElement(a.Route,{path:L+"/user/profile"},l.createElement(W,{stateCode:h,userType:"citizen",cityDetails:d})),l.createElement(a.Route,{path:L+"/Audit"},l.createElement(st,null)),l.createElement(v,{initData:O},x,F))),l.createElement("div",{className:"citizen-home-footer",style:window.location.href.includes("citizen/obps")?{zIndex:"-1"}:{}},l.createElement("img",{alt:"Powered by DIGIT",src:null===(n=window)||void 0===n||null===(r=n.globalConfigs)||void 0===r||null===(i=r.getConfig)||void 0===i?void 0:i.call(r,"DIGIT_FOOTER"),style:{height:"1.2em",cursor:"pointer"},onClick:()=>{var e,t,n;window.open(null===(e=window)||void 0===e||null===(t=e.globalConfigs)||void 0===t||null===(n=t.getConfig)||void 0===n?void 0:n.call(t,"DIGIT_HOME_URL"),"_blank").focus()}})))};function yt(e,t){return e(t={exports:{}},t.exports),t.exports}var ht="function"==typeof Symbol&&Symbol.for,Ct=ht?Symbol.for("react.element"):60103,bt=ht?Symbol.for("react.portal"):60106,St=ht?Symbol.for("react.fragment"):60107,Ot=ht?Symbol.for("react.strict_mode"):60108,Nt=ht?Symbol.for("react.profiler"):60114,It=ht?Symbol.for("react.provider"):60109,wt=ht?Symbol.for("react.context"):60110,_t=ht?Symbol.for("react.async_mode"):60111,Dt=ht?Symbol.for("react.concurrent_mode"):60111,Tt=ht?Symbol.for("react.forward_ref"):60112,Lt=ht?Symbol.for("react.suspense"):60113,Rt=ht?Symbol.for("react.suspense_list"):60120,Pt=ht?Symbol.for("react.memo"):60115,At=ht?Symbol.for("react.lazy"):60116,xt=ht?Symbol.for("react.block"):60121,Mt=ht?Symbol.for("react.fundamental"):60117,kt=ht?Symbol.for("react.responder"):60118,Ut=ht?Symbol.for("react.scope"):60119;function Bt(e){if("object"==typeof e&&null!==e){var t=e.$$typeof;switch(t){case Ct:switch(e=e.type){case _t:case Dt:case St:case Nt:case Ot:case Lt:return e;default:switch(e=e&&e.$$typeof){case wt:case Tt:case At:case Pt:case It:return e;default:return t}}case bt:return t}}}function Ft(e){return Bt(e)===Dt}var jt={AsyncMode:_t,ConcurrentMode:Dt,ContextConsumer:wt,ContextProvider:It,Element:Ct,ForwardRef:Tt,Fragment:St,Lazy:At,Memo:Pt,Portal:bt,Profiler:Nt,StrictMode:Ot,Suspense:Lt,isAsyncMode:function(e){return Ft(e)||Bt(e)===_t},isConcurrentMode:Ft,isContextConsumer:function(e){return Bt(e)===wt},isContextProvider:function(e){return Bt(e)===It},isElement:function(e){return"object"==typeof e&&null!==e&&e.$$typeof===Ct},isForwardRef:function(e){return Bt(e)===Tt},isFragment:function(e){return Bt(e)===St},isLazy:function(e){return Bt(e)===At},isMemo:function(e){return Bt(e)===Pt},isPortal:function(e){return Bt(e)===bt},isProfiler:function(e){return Bt(e)===Nt},isStrictMode:function(e){return Bt(e)===Ot},isSuspense:function(e){return Bt(e)===Lt},isValidElementType:function(e){return"string"==typeof e||"function"==typeof e||e===St||e===Dt||e===Nt||e===Ot||e===Lt||e===Rt||"object"==typeof e&&null!==e&&(e.$$typeof===At||e.$$typeof===Pt||e.$$typeof===It||e.$$typeof===wt||e.$$typeof===Tt||e.$$typeof===Mt||e.$$typeof===kt||e.$$typeof===Ut||e.$$typeof===xt)},typeOf:Bt},Vt=yt(function(e,t){"production"!==process.env.NODE_ENV&&function(){var e="function"==typeof Symbol&&Symbol.for,n=e?Symbol.for("react.element"):60103,l=e?Symbol.for("react.portal"):60106,o=e?Symbol.for("react.fragment"):60107,r=e?Symbol.for("react.strict_mode"):60108,i=e?Symbol.for("react.profiler"):60114,a=e?Symbol.for("react.provider"):60109,s=e?Symbol.for("react.context"):60110,c=e?Symbol.for("react.async_mode"):60111,u=e?Symbol.for("react.concurrent_mode"):60111,d=e?Symbol.for("react.forward_ref"):60112,m=e?Symbol.for("react.suspense"):60113,p=e?Symbol.for("react.suspense_list"):60120,v=e?Symbol.for("react.memo"):60115,g=e?Symbol.for("react.lazy"):60116,f=e?Symbol.for("react.block"):60121,E=e?Symbol.for("react.fundamental"):60117,y=e?Symbol.for("react.responder"):60118,h=e?Symbol.for("react.scope"):60119;function C(e){if("object"==typeof e&&null!==e){var t=e.$$typeof;switch(t){case n:var p=e.type;switch(p){case c:case u:case o:case i:case r:case m:return p;default:var f=p&&p.$$typeof;switch(f){case s:case d:case g:case v:case a:return f;default:return t}}case l:return t}}}var b=u,S=s,O=a,N=n,I=d,w=o,_=g,D=v,T=l,L=i,R=r,P=m,A=!1;function x(e){return C(e)===u}t.AsyncMode=c,t.ConcurrentMode=b,t.ContextConsumer=S,t.ContextProvider=O,t.Element=N,t.ForwardRef=I,t.Fragment=w,t.Lazy=_,t.Memo=D,t.Portal=T,t.Profiler=L,t.StrictMode=R,t.Suspense=P,t.isAsyncMode=function(e){return A||(A=!0,console.warn("The ReactIs.isAsyncMode() alias has been deprecated, and will be removed in React 17+. Update your code to use ReactIs.isConcurrentMode() instead. It has the exact same API.")),x(e)||C(e)===c},t.isConcurrentMode=x,t.isContextConsumer=function(e){return C(e)===s},t.isContextProvider=function(e){return C(e)===a},t.isElement=function(e){return"object"==typeof e&&null!==e&&e.$$typeof===n},t.isForwardRef=function(e){return C(e)===d},t.isFragment=function(e){return C(e)===o},t.isLazy=function(e){return C(e)===g},t.isMemo=function(e){return C(e)===v},t.isPortal=function(e){return C(e)===l},t.isProfiler=function(e){return C(e)===i},t.isStrictMode=function(e){return C(e)===r},t.isSuspense=function(e){return C(e)===m},t.isValidElementType=function(e){return"string"==typeof e||"function"==typeof e||e===o||e===u||e===i||e===r||e===m||e===p||"object"==typeof e&&null!==e&&(e.$$typeof===g||e.$$typeof===v||e.$$typeof===a||e.$$typeof===s||e.$$typeof===d||e.$$typeof===E||e.$$typeof===y||e.$$typeof===h||e.$$typeof===f)},t.typeOf=C}()}),Ht=yt(function(e){e.exports="production"===process.env.NODE_ENV?jt:Vt}),zt=Object.getOwnPropertySymbols,Gt=Object.prototype.hasOwnProperty,$t=Object.prototype.propertyIsEnumerable;function Wt(e){if(null==e)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(e)}var qt=function(){try{if(!Object.assign)return!1;var e=new String("abc");if(e[5]="de","5"===Object.getOwnPropertyNames(e)[0])return!1;for(var t={},n=0;n<10;n++)t["_"+String.fromCharCode(n)]=n;if("0123456789"!==Object.getOwnPropertyNames(t).map(function(e){return t[e]}).join(""))return!1;var l={};return"abcdefghijklmnopqrst".split("").forEach(function(e){l[e]=e}),"abcdefghijklmnopqrst"===Object.keys(Object.assign({},l)).join("")}catch(e){return!1}}()?Object.assign:function(e,t){for(var n,l,o=Wt(e),r=1;r<arguments.length;r++){for(var i in n=Object(arguments[r]))Gt.call(n,i)&&(o[i]=n[i]);if(zt){l=zt(n);for(var a=0;a<l.length;a++)$t.call(n,l[a])&&(o[l[a]]=n[l[a]])}}return o},Xt="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED",Zt=Function.call.bind(Object.prototype.hasOwnProperty),Yt=function(){};if("production"!==process.env.NODE_ENV){var Jt=Xt,Kt={},Qt=Zt;Yt=function(e){var t="Warning: "+e;"undefined"!=typeof console&&console.error(t);try{throw new Error(t)}catch(e){}}}function en(e,t,n,l,o){if("production"!==process.env.NODE_ENV)for(var r in e)if(Qt(e,r)){var i;try{if("function"!=typeof e[r]){var a=Error((l||"React class")+": "+n+" type `"+r+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof e[r]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw a.name="Invariant Violation",a}i=e[r](t,r,l,n,null,Jt)}catch(e){i=e}if(!i||i instanceof Error||Yt((l||"React class")+": type specification of "+n+" `"+r+"` is invalid; the type checker function must return `null` or an `Error` but returned a "+typeof i+". You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument)."),i instanceof Error&&!(i.message in Kt)){Kt[i.message]=!0;var s=o?o():"";Yt("Failed "+n+" type: "+i.message+(null!=s?s:""))}}}en.resetWarningCache=function(){"production"!==process.env.NODE_ENV&&(Kt={})};var tn=en,nn=function(){};function ln(){return null}function on(){}function rn(){}"production"!==process.env.NODE_ENV&&(nn=function(e){var t="Warning: "+e;"undefined"!=typeof console&&console.error(t);try{throw new Error(t)}catch(e){}}),rn.resetWarningCache=on;var an=yt(function(e){e.exports="production"!==process.env.NODE_ENV?function(e,t){var n="function"==typeof Symbol&&Symbol.iterator,l={array:a("array"),bigint:a("bigint"),bool:a("boolean"),func:a("function"),number:a("number"),object:a("object"),string:a("string"),symbol:a("symbol"),any:i(ln),arrayOf:function(e){return i(function(t,n,l,o,i){if("function"!=typeof e)return new r("Property `"+i+"` of component `"+l+"` has invalid PropType notation inside arrayOf.");var a=t[n];if(!Array.isArray(a))return new r("Invalid "+o+" `"+i+"` of type `"+u(a)+"` supplied to `"+l+"`, expected an array.");for(var s=0;s<a.length;s++){var c=e(a,s,l,o,i+"["+s+"]",Xt);if(c instanceof Error)return c}return null})},element:i(function(t,n,l,o,i){var a=t[n];return e(a)?null:new r("Invalid "+o+" `"+i+"` of type `"+u(a)+"` supplied to `"+l+"`, expected a single ReactElement.")}),elementType:i(function(e,t,n,l,o){var i=e[t];return Ht.isValidElementType(i)?null:new r("Invalid "+l+" `"+o+"` of type `"+u(i)+"` supplied to `"+n+"`, expected a single ReactElement type.")}),instanceOf:function(e){return i(function(t,n,l,o,i){var a;return t[n]instanceof e?null:new r("Invalid "+o+" `"+i+"` of type `"+((a=t[n]).constructor&&a.constructor.name?a.constructor.name:"<<anonymous>>")+"` supplied to `"+l+"`, expected instance of `"+(e.name||"<<anonymous>>")+"`.")})},node:i(function(e,t,n,l,o){return c(e[t])?null:new r("Invalid "+l+" `"+o+"` supplied to `"+n+"`, expected a ReactNode.")}),objectOf:function(e){return i(function(t,n,l,o,i){if("function"!=typeof e)return new r("Property `"+i+"` of component `"+l+"` has invalid PropType notation inside objectOf.");var a=t[n],s=u(a);if("object"!==s)return new r("Invalid "+o+" `"+i+"` of type `"+s+"` supplied to `"+l+"`, expected an object.");for(var c in a)if(Zt(a,c)){var d=e(a,c,l,o,i+"."+c,Xt);if(d instanceof Error)return d}return null})},oneOf:function(e){if(!Array.isArray(e))return"production"!==process.env.NODE_ENV&&nn(arguments.length>1?"Invalid arguments supplied to oneOf, expected an array, got "+arguments.length+" arguments. A common mistake is to write oneOf(x, y, z) instead of oneOf([x, y, z]).":"Invalid argument supplied to oneOf, expected an array."),ln;function t(t,n,l,i,a){for(var s=t[n],c=0;c<e.length;c++)if(o(s,e[c]))return null;var u=JSON.stringify(e,function(e,t){return"symbol"===d(t)?String(t):t});return new r("Invalid "+i+" `"+a+"` of value `"+String(s)+"` supplied to `"+l+"`, expected one of "+u+".")}return i(t)},oneOfType:function(e){if(!Array.isArray(e))return"production"!==process.env.NODE_ENV&&nn("Invalid argument supplied to oneOfType, expected an instance of array."),ln;for(var t=0;t<e.length;t++){var n=e[t];if("function"!=typeof n)return nn("Invalid argument supplied to oneOfType. Expected an array of check functions, but received "+m(n)+" at index "+t+"."),ln}return i(function(t,n,l,o,i){for(var a=[],s=0;s<e.length;s++){var c=(0,e[s])(t,n,l,o,i,Xt);if(null==c)return null;c.data&&Zt(c.data,"expectedType")&&a.push(c.data.expectedType)}return new r("Invalid "+o+" `"+i+"` supplied to `"+l+"`"+(a.length>0?", expected one of type ["+a.join(", ")+"]":"")+".")})},shape:function(e){return i(function(t,n,l,o,i){var a=t[n],c=u(a);if("object"!==c)return new r("Invalid "+o+" `"+i+"` of type `"+c+"` supplied to `"+l+"`, expected `object`.");for(var m in e){var p=e[m];if("function"!=typeof p)return s(l,o,i,m,d(p));var v=p(a,m,l,o,i+"."+m,Xt);if(v)return v}return null})},exact:function(e){return i(function(t,n,l,o,i){var a=t[n],c=u(a);if("object"!==c)return new r("Invalid "+o+" `"+i+"` of type `"+c+"` supplied to `"+l+"`, expected `object`.");var m=qt({},t[n],e);for(var p in m){var v=e[p];if(Zt(e,p)&&"function"!=typeof v)return s(l,o,i,p,d(v));if(!v)return new r("Invalid "+o+" `"+i+"` key `"+p+"` supplied to `"+l+"`.\nBad object: "+JSON.stringify(t[n],null," ")+"\nValid keys: "+JSON.stringify(Object.keys(e),null," "));var g=v(a,p,l,o,i+"."+p,Xt);if(g)return g}return null})}};function o(e,t){return e===t?0!==e||1/e==1/t:e!=e&&t!=t}function r(e,t){this.message=e,this.data=t&&"object"==typeof t?t:{},this.stack=""}function i(e){function t(t,n,l,o,i,a,s){if(o=o||"<<anonymous>>",a=a||l,s!==Xt){var c=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use `PropTypes.checkPropTypes()` to call them. Read more at http://fb.me/use-check-prop-types");throw c.name="Invariant Violation",c}return null==n[l]?t?new r(null===n[l]?"The "+i+" `"+a+"` is marked as required in `"+o+"`, but its value is `null`.":"The "+i+" `"+a+"` is marked as required in `"+o+"`, but its value is `undefined`."):null:e(n,l,o,i,a)}process;var n=t.bind(null,!1);return n.isRequired=t.bind(null,!0),n}function a(e){return i(function(t,n,l,o,i,a){var s=t[n];return u(s)!==e?new r("Invalid "+o+" `"+i+"` of type `"+d(s)+"` supplied to `"+l+"`, expected `"+e+"`.",{expectedType:e}):null})}function s(e,t,n,l,o){return new r((e||"React class")+": "+t+" type `"+n+"."+l+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+o+"`.")}function c(t){switch(typeof t){case"number":case"string":case"undefined":return!0;case"boolean":return!t;case"object":if(Array.isArray(t))return t.every(c);if(null===t||e(t))return!0;var l=function(e){var t=e&&(n&&e[n]||e["@@iterator"]);if("function"==typeof t)return t}(t);if(!l)return!1;var o,r=l.call(t);if(l!==t.entries){for(;!(o=r.next()).done;)if(!c(o.value))return!1}else for(;!(o=r.next()).done;){var i=o.value;if(i&&!c(i[1]))return!1}return!0;default:return!1}}function u(e){var t=typeof e;return Array.isArray(e)?"array":e instanceof RegExp?"object":function(e,t){return"symbol"===e||!!t&&("Symbol"===t["@@toStringTag"]||"function"==typeof Symbol&&t instanceof Symbol)}(t,e)?"symbol":t}function d(e){if(null==e)return""+e;var t=u(e);if("object"===t){if(e instanceof Date)return"date";if(e instanceof RegExp)return"regexp"}return t}function m(e){var t=d(e);switch(t){case"array":case"object":return"an "+t;case"boolean":case"date":case"regexp":return"a "+t;default:return t}}return r.prototype=Error.prototype,l.checkPropTypes=tn,l.resetWarningCache=tn.resetWarningCache,l.PropTypes=l,l}(Ht.isElement):function(){function e(e,t,n,l,o,r){if(r!==Xt){var i=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw i.name="Invariant Violation",i}}function t(){return e}e.isRequired=e;var n={array:e,bigint:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:t,element:e,elementType:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t,exact:t,checkPropTypes:rn,resetWarningCache:on};return n.PropTypes=n,n}()});const sn=e=>{let{children:t}=e;return l.createElement("div",{className:"banner banner-container"},t)},cn=e=>{var n;let{showTenant:r=!0}=e;const{data:i,isLoading:a}=Digit.Hooks.useStore.getInitData(),{stateInfo:s}=i||{},{t:c}=o.useTranslation();return a?l.createElement(t.Loader,null):l.createElement("div",{className:"bannerHeader"},l.createElement("img",{className:"bannerLogo",src:null==s?void 0:s.logoUrl,style:r?{}:{borderRight:"unset"}}),r&&l.createElement("p",null,c("TENANT_TENANTS_"+(null==s||null===(n=s.code)||void 0===n?void 0:n.toUpperCase()))))},un=e=>{var o,r,i;let{config:c,t:u}=e;const[d,m]=n.useState(null),{mobile_number:p,tenantId:v}=Digit.Hooks.useQueryParams(),g=a.useHistory(),[f,E]=n.useState(""),[y,h]=n.useState(!0),[C,b]=n.useState(null),S=()=>Digit.UserService.getType();n.useEffect(()=>{var e,t;if(!d)return void Digit.UserService.setType("employee");Digit.UserService.setUser(d);const n=(null===(e=location.state)||void 0===e?void 0:e.from)||`/${null===(t=window)||void 0===t?void 0:t.contextPath}/employee`;g.replace(n)},[d]);const O=()=>{b(null)},[N,I,w]=c.inputs,_=[{body:[{label:u(N.label),type:N.type,populators:{name:N.name},isMandatory:!0},{label:u(I.label),type:I.type,populators:{name:I.name},isMandatory:!0},{label:u(w.label),type:w.type,populators:{name:w.name},isMandatory:!0}]}];return l.createElement(sn,null,l.createElement("div",{className:"employeeBackbuttonAlign"},l.createElement(t.BackButton,{variant:"white",style:{borderBottom:"none"}})),l.createElement(s.FormComposer,{onSubmit:function(e){try{return Promise.resolve(G(function(){if(e.newPassword!==e.confirmPassword)return b(u("ERR_PASSWORD_DO_NOT_MATCH"));const t={...e,otpReference:f,tenantId:v,type:S().toUpperCase()};return Promise.resolve(Digit.UserService.changePassword(t,v)).then(function(e){(()=>{var e;g.replace(`/${null===(e=window)||void 0===e?void 0:e.contextPath}/employee/user/login`)})()})},function(e){var t,n,l,o,r;b((null==e||null===(t=e.response)||void 0===t||null===(n=t.data)||void 0===n||null===(l=n.error)||void 0===l||null===(o=l.fields)||void 0===o||null===(r=o[0])||void 0===r?void 0:r.message)||u("ES_SOMETHING_WRONG")),setTimeout(O,5e3)}))}catch(e){return Promise.reject(e)}},noBoxShadow:!0,inline:!0,submitInForm:!0,config:_,label:c.texts.submitButtonLabel,cardStyle:{maxWidth:"408px",margin:"auto"},className:"employeeChangePassword"},l.createElement(cn,null),l.createElement(s.CardSubHeader,{style:{textAlign:"center"}}," ",c.texts.header," "),l.createElement(t.CardText,null,u("CS_LOGIN_OTP_TEXT")+" ",l.createElement("b",null," ",""+u("+ 91 - ")," ",p)),l.createElement(K,{t:u,userType:"employee",otp:f,onOtpChange:E,error:y,onResend:function(){try{function e(){setTimeout(O,5e3)}const t={otp:{mobileNumber:p,userType:S().toUpperCase(),type:"passwordreset",tenantId:v}},n=G(function(){return Promise.resolve(Digit.UserService.sendOtp(t,v)).then(function(){b(u("ES_OTP_RESEND"))})},function(e){var t,n;b((null==e||null===(t=e.response)||void 0===t||null===(n=t.data)||void 0===n?void 0:n.error_description)||u("ES_INVALID_LOGIN_CREDENTIALS"))});return Promise.resolve(n&&n.then?n.then(e):e())}catch(e){return Promise.reject(e)}}})),C&&l.createElement(t.Toast,{type:"error",label:u(C),onClose:O}),l.createElement("div",{className:"EmployeeLoginFooter"},l.createElement("img",{alt:"Powered by DIGIT",src:null===(o=window)||void 0===o||null===(r=o.globalConfigs)||void 0===r||null===(i=r.getConfig)||void 0===i?void 0:i.call(r,"DIGIT_FOOTER_BW"),style:{cursor:"pointer"},onClick:()=>{var e,t,n;window.open(null===(e=window)||void 0===e||null===(t=e.globalConfigs)||void 0===t||null===(n=t.getConfig)||void 0===n?void 0:n.call(t,"DIGIT_HOME_URL"),"_blank").focus()}})," "))};un.propTypes={loginParams:an.any},un.defaultProps={loginParams:null};const dn=[{texts:{header:"CORE_COMMON_RESET_PASSWORD_LABEL",submitButtonLabel:"CORE_COMMON_CHANGE_PASSWORD"},inputs:[{label:"CORE_LOGIN_USERNAME",type:"text",name:"userName",error:"ERR_HRMS_INVALID_USERNAME"},{label:"CORE_LOGIN_NEW_PASSWORD",type:"password",name:"newPassword",error:"CORE_COMMON_REQUIRED_ERRMSG"},{label:"CORE_LOGIN_CONFIRM_NEW_PASSWORD",type:"password",name:"confirmPassword",error:"CORE_COMMON_REQUIRED_ERRMSG"}]}],mn=()=>{const{t:e}=o.useTranslation(),{path:t}=a.useRouteMatch(),r=n.useMemo(()=>dn.map(t=>{const n={};for(const l in t.texts)n[l]=e(t.texts[l]);return{...t,texts:n}},[dn]));return l.createElement(a.Switch,null,l.createElement(a.Route,{path:""+t,exact:!0},l.createElement(un,{config:r[0],t:e})))},pn=[{texts:{header:"CORE_COMMON_FORGOT_PASSWORD_LABEL",description:"ES_FORGOT_PASSWORD_DESC",submitButtonLabel:"CORE_COMMON_CONTINUE"},inputs:[{label:"CORE_COMMON_MOBILE_NUMBER",type:"text",name:"mobileNumber",error:"ERR_HRMS_INVALID_MOBILE_NUMBER"},{label:"CORE_COMMON_CITY",type:"custom",name:"city",error:"ERR_HRMS_INVALID_CITY"}]}],vn=e=>{var o,r,i;let{config:c,t:u}=e;const{data:d,isLoading:m}=Digit.Hooks.useTenants(),[p,v]=n.useState(null),g=a.useHistory(),[f,E]=n.useState(null);n.useEffect(()=>{var e,t;if(!p)return void Digit.UserService.setType("employee");Digit.UserService.setUser(p);const n=(null===(e=location.state)||void 0===e?void 0:e.from)||`/${null===(t=window)||void 0===t?void 0:t.contextPath}/employee`;g.replace(n)},[p]);const y=()=>{E(null)},[h,C]=c.inputs,b=[{body:[{label:u(h.label),type:h.type,populators:{name:h.name,componentInFront:"+91"},isMandatory:!0},{label:u(C.label),type:C.type,populators:{name:C.name,customProps:{},component:(e,n)=>l.createElement(t.Dropdown,N({option:d,optionKey:"name",id:C.name,className:"login-city-dd",select:t=>{e.onChange(t)}},n))},isMandatory:!0}]}];return m?l.createElement(t.Loader,null):l.createElement(sn,null,l.createElement("div",{className:"employeeBackbuttonAlign"},l.createElement(t.BackLink,null)),l.createElement(s.FormComposer,{onSubmit:function(e){try{if(!e.city)return alert("Please Select City!"),Promise.resolve();const t={otp:{mobileNumber:e.mobileNumber,userType:Digit.UserService.getType().toUpperCase(),type:"passwordreset",tenantId:e.city.code}},n=G(function(){return Promise.resolve(Digit.UserService.sendOtp(t,e.city.code)).then(function(){var t;g.push(`/${null===(t=window)||void 0===t?void 0:t.contextPath}/employee/user/change-password?mobile_number=${e.mobileNumber}&tenantId=${e.city.code}`)})},function(e){var t,n,l,o,r;E((null==e||null===(t=e.response)||void 0===t||null===(n=t.data)||void 0===n||null===(l=n.error)||void 0===l||null===(o=l.fields)||void 0===o||null===(r=o[0])||void 0===r?void 0:r.message)||"Invalid login credentials!"),setTimeout(y,5e3)});return Promise.resolve(n&&n.then?n.then(function(){}):void 0)}catch(e){return Promise.reject(e)}},noBoxShadow:!0,inline:!0,submitInForm:!0,config:b,label:c.texts.submitButtonLabel,secondaryActionLabel:c.texts.secondaryButtonLabel,onSecondayActionClick:()=>{var e;g.replace(`/${null===(e=window)||void 0===e?void 0:e.contextPath}/employee/login`)},heading:c.texts.header,description:c.texts.description,headingStyle:{textAlign:"center"},cardStyle:{maxWidth:"408px",margin:"auto"},className:"employeeForgotPassword"},l.createElement(cn,null)),f&&l.createElement(t.Toast,{type:"error",label:u(f),onClose:y}),l.createElement("div",{className:"EmployeeLoginFooter"},l.createElement("img",{alt:"Powered by DIGIT",src:null===(o=window)||void 0===o||null===(r=o.globalConfigs)||void 0===r||null===(i=r.getConfig)||void 0===i?void 0:i.call(r,"DIGIT_FOOTER_BW"),style:{cursor:"pointer"},onClick:()=>{var e,t,n;window.open(null===(e=window)||void 0===e||null===(t=e.globalConfigs)||void 0===t||null===(n=t.getConfig)||void 0===n?void 0:n.call(t,"DIGIT_HOME_URL"),"_blank").focus()}})," "))};vn.propTypes={loginParams:an.any},vn.defaultProps={loginParams:null};const gn=()=>{const{t:e}=o.useTranslation(),{path:t}=a.useRouteMatch(),r=n.useMemo(()=>pn.map(t=>{const n={};for(const l in t.texts)n[l]=e(t.texts[l]);return{...t,texts:n}},[pn]));return l.createElement(a.Switch,null,l.createElement(a.Route,{path:""+t,exact:!0},l.createElement(vn,{config:r[0],t:e})))},fn=(e,t)=>t.filter(t=>{var n;return null==e||null===(n=e.map)||void 0===n?void 0:n.call(e,e=>e.code).includes(t.code)}),En=e=>{var t;let{stateCode:n,userType:o,modules:r,appTenants:i,additionalComponent:s}=e;Digit;const{path:c}=a.useRouteMatch(),u=a.useLocation(),d=Digit.UserService.getUser();var m;if(!d||null==d||!d.access_token||null==d||!d.info)return l.createElement(a.Redirect,{to:{pathname:`/${null===(m=window)||void 0===m?void 0:m.contextPath}/employee/user/login`,state:{from:u.pathname+u.search}}});const p=null==r?void 0:r.map((e,t)=>{var r;let{code:s,tenants:u}=e;const d=Digit.ComponentRegistryService.getComponent(s+"Module");return l.createElement(a.Route,{key:t,path:`${c}/${s.toLowerCase()}`},d?l.createElement(d,{stateCode:n,moduleCode:s,userType:o,tenants:fn(u,i)}):l.createElement(a.Redirect,{to:`/${null===(r=window)||void 0===r?void 0:r.contextPath}/employee/user/error?type=notfound&module=${s}`}))});return l.createElement("div",{className:"ground-container digit-home-ground"},l.createElement(a.Switch,null,p,l.createElement(a.Route,{path:c+"/login"},l.createElement(a.Redirect,{to:{pathname:`/${null===(t=window)||void 0===t?void 0:t.contextPath}/employee/user/login`,state:{from:u.pathname+u.search}}})),l.createElement(a.Route,{path:c+"/forgot-password"},l.createElement(gn,null)),l.createElement(a.Route,{path:c+"/change-password"},l.createElement(mn,null)),l.createElement(a.Route,null,l.createElement(y,{userType:o,modules:r,additionalComponent:s}))))},yn={label:"English",value:Digit.Utils.getDefaultLanguage()},hn=()=>{var e,r,i,c,u;const{data:d,isLoading:m}=Digit.Hooks.useStore.getInitData(),{t:p}=o.useTranslation(),v=a.useHistory(),{languages:g,stateInfo:f}=d||{};let E=g;E&&0!=(null===(e=E)||void 0===e?void 0:e.length)||(E=[yn]);const y=Digit.StoreData.getCurrentLanguage(),[h,C]=n.useState(y);return m?l.createElement(t.Loader,null):l.createElement(sn,null,l.createElement(t.Card,{className:"bannerCard removeBottomMargin languageSelection"},l.createElement("div",{className:"bannerHeader"},l.createElement("img",{className:"bannerLogo",src:null==f?void 0:f.logoUrl,alt:"Digit"}),l.createElement("p",null,p("TENANT_TENANTS_"+(null==f||null===(r=f.code)||void 0===r?void 0:r.toUpperCase())))),l.createElement("div",{className:"language-selector",style:{justifyContent:"space-around",marginBottom:"24px",padding:"0 5%"}},E.map((e,t)=>l.createElement("div",{className:"language-button-container",key:t},l.createElement(s.CustomButton,{selected:e.value===h,text:e.label,onClick:()=>(e=>{C(e.value),Digit.LocalizationService.changeLanguage(e.value,f.code)})(e)})))),l.createElement(t.SubmitBar,{style:{width:"100%"},label:p("CORE_COMMON_CONTINUE"),onSubmit:e=>{var t;v.push(`/${null===(t=window)||void 0===t?void 0:t.contextPath}/employee/user/login`)}})),l.createElement("div",{className:"EmployeeLoginFooter"},l.createElement("img",{alt:"Powered by DIGIT",src:null===(i=window)||void 0===i||null===(c=i.globalConfigs)||void 0===c||null===(u=c.getConfig)||void 0===u?void 0:u.call(c,"DIGIT_FOOTER_BW"),style:{cursor:"pointer"},onClick:()=>{var e,t,n;window.open(null===(e=window)||void 0===e||null===(t=e.globalConfigs)||void 0===t||null===(n=t.getConfig)||void 0===n?void 0:n.call(t,"DIGIT_HOME_URL"),"_blank").focus()}})," "))},Cn=[{texts:{header:"CORE_COMMON_LOGIN",submitButtonLabel:"CORE_COMMON_CONTINUE",secondaryButtonLabel:"CORE_COMMON_FORGOT_PASSWORD"},inputs:[{label:"CORE_LOGIN_USERNAME",type:"text",key:"username",isMandatory:!0,populators:{name:"username",validation:{required:!0},error:"ERR_USERNAME_REQUIRED"}},{label:"CORE_LOGIN_PASSWORD",type:"password",key:"password",isMandatory:!0,populators:{name:"password",validation:{required:!0},error:"ERR_PASSWORD_REQUIRED"}},{isMandatory:!0,type:"dropdown",key:"city",label:"CORE_COMMON_CITY",disable:!1,populators:{name:"city",optionsKey:"name",error:"ERR_HRMS_INVALID_CITY",mdmsConfig:{masterName:"tenants",moduleName:"tenant",localePrefix:"TENANT_TENANTS",select:"(data)=>{ return Array.isArray(data['tenant'].tenants) && Digit.Utils.getUnique(data['tenant'].tenants).map(ele=>({code:ele.code,name:Digit.Utils.locale.getTransformedLocale('TENANT_TENANTS_'+ele.code)}))}"}}}]}],bn=[{texts:{header:"CORE_COMMON_LOGIN",submitButtonLabel:"CORE_COMMON_CONTINUE"},inputs:[{label:"CORE_SIGNUP_EMAILID",type:"text",key:"email",isMandatory:!0,populators:{name:"email",validation:{required:!0,pattern:/^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$/},error:"ERR_EMAIL_REQUIRED"}},{isMandatory:!1,key:"check",type:"component",component:"PrivacyComponent",withoutLabel:!0,disable:!1,customProps:{module:"Sandbox"},populators:{name:"check"}}]}],Sn=e=>{var o,r,i,s,c,u,d,m,p,v,g,f,E;let{config:y,t:h,isDisabled:C,loginOTPBased:b}=e;const{isLoading:S}=Digit.Hooks.useTenants(),{isLoading:O}=Digit.Hooks.useStore.getInitData(),[N,I]=n.useState(null),[w,_]=n.useState(null),[D,T]=n.useState(!1),L=a.useHistory();n.useEffect(()=>{var e,t,n,l,o,r,i,a,s,c,u,d,m,p,v,g,f,E;if(!N)return;Digit.SessionStorage.set("citizen.userRequestObject",N);const y=null==N||null===(e=N.info)||void 0===e||null===(t=e.roles)||void 0===t?void 0:t.filter(e=>e.tenantId===Digit.SessionStorage.get("Employee.tenantId"));(null==N||null===(n=N.info)||void 0===n||null===(l=n.roles)||void 0===l?void 0:l.length)>0&&(N.info.roles=y),Digit.UserService.setUser(N),((e,t)=>{var n;let l=(null===(n=JSON.parse(sessionStorage.getItem("Digit.locale")))||void 0===n?void 0:n.value)||Digit.Utils.getDefaultLanguage();localStorage.setItem("Employee.tenant-id",null==e?void 0:e.tenantId),localStorage.setItem("tenant-id",null==e?void 0:e.tenantId),localStorage.setItem("citizen.userRequestObject",JSON.stringify(e)),localStorage.setItem("locale",l),localStorage.setItem("Employee.locale",l),localStorage.setItem("token",t),localStorage.setItem("Employee.token",t),localStorage.setItem("user-info",JSON.stringify(e)),localStorage.setItem("Employee.user-info",JSON.stringify(e))})(null==N?void 0:N.info,null==N?void 0:N.access_token);let h=`/${null===(o=window)||void 0===o?void 0:o.contextPath}/employee`;var C,b,S,O,I,w,_;null!==(r=window)&&void 0!==r&&null!==(i=r.location)&&void 0!==i&&null!==(a=i.href)&&void 0!==a&&a.includes("from=")&&(h=decodeURIComponent(null===(C=window)||void 0===C||null===(b=C.location)||void 0===b||null===(S=b.href)||void 0===S||null===(O=S.split("from="))||void 0===O?void 0:O[1])||`/${null===(I=window)||void 0===I?void 0:I.contextPath}/employee`),null!=N&&null!==(s=N.info)&&void 0!==s&&s.roles&&(null==N||null===(c=N.info)||void 0===c||null===(u=c.roles)||void 0===u?void 0:u.length)>0&&null!=N&&null!==(d=N.info)&&void 0!==d&&null!==(m=d.roles)&&void 0!==m&&m.every(e=>"NATADMIN"===e.code)&&(h=`/${null===(w=window)||void 0===w?void 0:w.contextPath}/employee/dss/landing/NURT_DASHBOARD`),null!=N&&null!==(p=N.info)&&void 0!==p&&p.roles&&(null==N||null===(v=N.info)||void 0===v||null===(g=v.roles)||void 0===g?void 0:g.length)>0&&null!=N&&null!==(f=N.info)&&void 0!==f&&null!==(E=f.roles)&&void 0!==E&&E.every(e=>"STADMIN"===e.code)&&(h=`/${null===(_=window)||void 0===_?void 0:_.contextPath}/employee/dss/landing/home`),L.replace(h)},[N]);const R={url:"/user-otp/v1/_send",params:{tenantId:Digit.ULBService.getStateId()},body:{},config:{enable:!1}},P=Digit.Hooks.useCustomAPIMutationHook(R),A=()=>{_(null)},x={code:Digit.ULBService.getStateId(),name:Digit.Utils.locale.getTransformedLocale("TENANT_TENANTS_"+Digit.ULBService.getStateId())};let M=[{body:null==y?void 0:y.inputs}];const{mode:k}=Digit.Hooks.useQueryParams();return"admin"===k&&0==(null==M||null===(o=M[0])||void 0===o||null===(r=o.body)||void 0===r||null===(i=r[2])||void 0===i?void 0:i.disable)&&null==(null==M||null===(s=M[0])||void 0===s||null===(c=s.body)||void 0===c||null===(u=c[2])||void 0===u||null===(d=u.populators)||void 0===d?void 0:d.defaultValue)&&(M[0].body[2].disable=!0,M[0].body[2].isMandatory=!1,M[0].body[2].populators.defaultValue=x),S||O?l.createElement(t.Loader,null):l.createElement(sn,null,l.createElement("div",{className:"employeeBackbuttonAlign"},l.createElement(t.BackLink,null)),l.createElement(t.FormComposerV2,{onSubmit:b?function(e){try{const t=e.email;return Promise.resolve(P.mutate({body:{otp:{userName:e.email,type:"login",tenantId:Digit.ULBService.getStateId(),userType:"EMPLOYEE"}},config:{enable:!0}},{onError:(e,t)=>{var n,l,o,r,i,a,s;_({key:"error",label:null!=e&&null!==(n=e.response)&&void 0!==n&&null!==(l=n.data)&&void 0!==l&&null!==(o=l.Errors)&&void 0!==o&&o[0].code?"SANDBOX_RESEND_OTP"+(null==e||null===(r=e.response)||void 0===r||null===(i=r.data)||void 0===i||null===(a=i.Errors)||void 0===a||null===(s=a[0])||void 0===s?void 0:s.code):"SANDBOX_RESEND_OTP_ERROR"}),setTimeout(A,5e3)},onSuccess:function(e){try{var n;return L.push({pathname:`/${null===(n=window)||void 0===n?void 0:n.contextPath}/employee/user/login/otp`,state:{email:t,tenant:Digit.ULBService.getStateId()}}),Promise.resolve()}catch(e){return Promise.reject(e)}}})).then(function(){})}catch(e){return Promise.reject(e)}}:function(e){try{var t;function n(){T(!1)}T(!0);const l={...e,userType:"EMPLOYEE"};l.tenantId=(null==e||null===(t=e.city)||void 0===t?void 0:t.code)||Digit.ULBService.getStateId(),delete l.city;const o=G(function(){return Promise.resolve(Digit.UserService.authenticate(l)).then(function(e){let{UserRequest:t,...n}=e;Digit.SessionStorage.set("Employee.tenantId",null==t?void 0:t.tenantId),I({info:t,...n})})},function(e){var t,n;_((null==e||null===(t=e.response)||void 0===t||null===(n=t.data)||void 0===n?void 0:n.error_description)||"ES_ERROR_USER_NOT_PERMITTED"==(null==e?void 0:e.message)&&h("ES_ERROR_USER_NOT_PERMITTED")||h("INVALID_LOGIN_CREDENTIALS")),setTimeout(A,5e3)});return Promise.resolve(o&&o.then?o.then(n):n())}catch(e){return Promise.reject(e)}},isDisabled:C||D,noBoxShadow:!0,inline:!0,submitInForm:!0,config:M,label:null==y||null===(m=y.texts)||void 0===m?void 0:m.submitButtonLabel,secondaryActionLabel:null==y||null===(p=y.texts)||void 0===p?void 0:p.secondaryButtonLabel,onSecondayActionClick:()=>{var e;L.push(`/${null===(e=window)||void 0===e?void 0:e.contextPath}/employee/user/forgot-password`)},onFormValueChange:(e,t,n)=>{const l=M[0].body.map(e=>e.key).some(e=>{const n=t[e];return null==n||""===n||"check"===e&&!1===n||"captcha"===e&&!1===n});T(l)},heading:null==y||null===(v=y.texts)||void 0===v?void 0:v.header,className:"loginFormStyleEmployee "+(b?"sandbox-onboarding-wrapper":""),cardSubHeaderClassName:"loginCardSubHeaderClassName",cardClassName:"loginCardClassName",buttonClassName:"buttonClassName"},l.createElement(cn,null)),w&&l.createElement(t.Toast,{type:"error",label:h(w),onClose:A}),l.createElement("div",{className:"employee-login-home-footer",style:{backgroundColor:"unset"}},l.createElement("img",{alt:"Powered by DIGIT",src:null===(g=window)||void 0===g||null===(f=g.globalConfigs)||void 0===f||null===(E=f.getConfig)||void 0===E?void 0:E.call(f,"DIGIT_FOOTER_BW"),style:{cursor:"pointer"},onClick:()=>{var e,t,n;window.open(null===(e=window)||void 0===e||null===(t=e.globalConfigs)||void 0===t||null===(n=t.getConfig)||void 0===n?void 0:n.call(t,"DIGIT_HOME_URL"),"_blank").focus()}})," "))};Sn.propTypes={loginParams:an.any},Sn.defaultProps={loginParams:null};const On=e=>{var t,r;let{stateCode:i}=e;const{t:s}=o.useTranslation(),{path:c}=a.useRouteMatch(),[u,d]=n.useState(Cn),[m,p]=n.useState(bn),v=Digit.StoreData.getCurrentLanguage(),g=(null===(t=window)||void 0===t||null===(r=t.globalConfigs)||void 0===r?void 0:r.getConfig("OTP_BASED_LOGIN"))||!1,{data:f,isLoading:E}=(Digit.Services.useStore({stateCode:i,moduleCode:["privacy-policy"],language:v,modulePrefix:"digit"}),Digit.Hooks.useCommonMDMS(i,"commonUiConfig",["LoginConfig"],{select:e=>{var t;return{config:null==e||null===(t=e.commonUiConfig)||void 0===t?void 0:t.LoginConfig}},retry:!1}));n.useEffect(()=>{d(0==E&&null!=f&&f.config?null==f?void 0:f.config:Cn)},[f,E]);const y=n.useMemo(()=>u.map(e=>{const t={};for(const n in e.texts)t[n]=s(e.texts[n]);return{...e,texts:t}},[u])),h=n.useMemo(()=>m.map(e=>{const t={};for(const n in e.texts)t[n]=s(e.texts[n]);return{...e,texts:t}},[m]));return l.createElement(a.Switch,null,l.createElement(a.Route,{path:""+c,exact:!0},l.createElement(Sn,g?{config:h[0],t:s,loginOTPBased:g}:{config:y[0],t:s})))},Nn=[{texts:{header:"CORE_COMMON_SIGN_UP",submitButtonLabel:"CORE_COMMON_SIGN_UP_BUTTON"},inputs:[{label:"CORE_SIGNUP_EMAILID",type:"text",key:"email",isMandatory:!0,populators:{name:"email",validation:{required:!0,pattern:/^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$/},error:"ERR_EMAIL_REQUIRED"}},{label:"CORE_SIGNUP_ACCOUNT_NAME",type:"text",key:"accountName",isMandatory:!0,populators:{name:"accountName",validation:{required:!0,patter:/^[A-Za-z][A-Za-z-' ]*[A-Za-z]$/},error:"ERR_ACCOUNT_NAME_REQUIRED"}},{isMandatory:!1,key:"check",type:"component",component:"PrivacyComponent",withoutLabel:!0,disable:!1,customProps:{module:"SandboxSignUp"},populators:{name:"check"}}]}],In=e=>{var o,r,i,s,c,u,d,m,p,v,g,f,E;let{config:y,t:h,isDisabled:C}=e;const{isLoading:b}=Digit.Hooks.useTenants(),{isLoading:S}=Digit.Hooks.useStore.getInitData(),[O,N]=n.useState(null),[I,w]=n.useState(!1),_=a.useHistory(),D=Digit.Hooks.useCustomAPIMutationHook({url:"/tenant-management/tenant/_create",params:{},body:{},config:{enable:!1}});let T=[{body:null==y?void 0:y.inputs}];const{mode:L}=Digit.Hooks.useQueryParams();return"admin"===L&&0==(null==T||null===(o=T[0])||void 0===o||null===(r=o.body)||void 0===r||null===(i=r[2])||void 0===i?void 0:i.disable)&&null==(null==T||null===(s=T[0])||void 0===s||null===(c=s.body)||void 0===c||null===(u=c[2])||void 0===u||null===(d=u.populators)||void 0===d?void 0:d.defaultValue)&&(T[0].body[2].disable=!0,T[0].body[2].isMandatory=!1,T[0].body[2].populators.defaultValue=defaultValue),b||S?l.createElement(t.Loader,null):l.createElement(sn,null,l.createElement("div",{className:"employeeBackbuttonAlign"},l.createElement(t.BackLink,null)),l.createElement(t.FormComposerV2,{onSubmit:function(e){try{return Promise.resolve(D.mutate({body:{tenant:{name:e.accountName,email:e.email}},config:{enable:!0}},{onError:(e,t)=>{var n,l,o,r,i,a,s,c;N({key:"error",label:null!=e&&null!==(n=e.response)&&void 0!==n&&null!==(l=n.data)&&void 0!==l&&null!==(o=l.Errors)&&void 0!==o&&null!==(r=o[0])&&void 0!==r&&r.code?"SANDBOX_SIGNUP_"+(null==e||null===(i=e.response)||void 0===i||null===(a=i.data)||void 0===a||null===(s=a.Errors)||void 0===s||null===(c=s[0])||void 0===c?void 0:c.code):"SANDBOX_SIGNUP_ERROR"})},onSuccess:function(e){try{var t,n,l;return _.push({pathname:`/${null===(t=window)||void 0===t?void 0:t.globalPath}/user/otp`,state:{email:null==e||null===(n=e.Tenants[0])||void 0===n?void 0:n.email,tenant:null==e||null===(l=e.Tenants[0])||void 0===l?void 0:l.code}}),Promise.resolve()}catch(e){return Promise.reject(e)}}})).then(function(){})}catch(e){return Promise.reject(e)}},isDisabled:C||I,noBoxShadow:!0,inline:!0,submitInForm:!0,config:T,label:null==y||null===(m=y.texts)||void 0===m?void 0:m.submitButtonLabel,secondaryActionLabel:null==y||null===(p=y.texts)||void 0===p?void 0:p.secondaryButtonLabel,onFormValueChange:(e,t,n)=>{const l=T[0].body.map(e=>e.key).some(e=>{const n=t[e];return null==n||""===n||"check"===e&&!1===n||"captcha"===e&&!1===n});w(l)},heading:null==y||null===(v=y.texts)||void 0===v?void 0:v.header,className:"sandbox-signup-form",cardSubHeaderClassName:"signupCardSubHeaderClassName",cardClassName:"signupCardClassName sandbox-onboarding-wrapper",buttonClassName:"buttonClassName"},l.createElement(cn,{showTenant:!1})),O&&l.createElement(t.Toast,{type:"error",label:h(null==O?void 0:O.label),onClose:()=>{N(null)}}),l.createElement("div",{className:"employee-login-home-footer",style:{backgroundColor:"unset"}},l.createElement("img",{alt:"Powered by DIGIT",src:null===(g=window)||void 0===g||null===(f=g.globalConfigs)||void 0===f||null===(E=f.getConfig)||void 0===E?void 0:E.call(f,"DIGIT_FOOTER_BW"),style:{cursor:"pointer"},onClick:()=>{var e,t,n;window.open(null===(e=window)||void 0===e||null===(t=e.globalConfigs)||void 0===t||null===(n=t.getConfig)||void 0===n?void 0:n.call(t,"DIGIT_HOME_URL"),"_blank").focus()}})))};In.propTypes={loginParams:an.any},In.defaultProps={loginParams:null};const wn=e=>{let{stateCode:t}=e;const{t:r}=o.useTranslation(),{path:i}=a.useRouteMatch(),[s,c]=n.useState(Nn),u=Digit.StoreData.getCurrentLanguage(),{data:d,isLoading:m}=(Digit.Services.useStore({stateCode:t,moduleCode:["privacy-policy"],language:u,modulePrefix:"digit"}),Digit.Hooks.useCommonMDMS(t,"commonUiConfig",["SignUpConfig"],{select:e=>{var t;return{config:null==e||null===(t=e.commonUiConfig)||void 0===t?void 0:t.SignUpConfig}},retry:!1}));n.useEffect(()=>{c(0==m&&null!=d&&d.config?null==d?void 0:d.config:Nn)},[d,m]);const p=n.useMemo(()=>s.map(e=>{const t={};for(const n in e.texts)t[n]=r(e.texts[n]);return{...e,texts:t}},[s]));return l.createElement(a.Switch,null,l.createElement(a.Route,{path:""+i,exact:!0},l.createElement(In,{config:p[0],t:r})))},_n=e=>{var r,i,c,u;let{isLogin:d=!1}=e;const{t:m}=o.useTranslation(),p=(a.useRouteMatch(),a.useHistory()),v=a.useLocation(),[g,f]=n.useState(null),[E,y]=n.useState(!1),[h,C]=n.useState(null),[b,S]=n.useState((null==v||null===(r=v.state)||void 0===r?void 0:r.data)||{}),{email:O,tenant:N}=v.state||{},I=[{body:[{type:"component",component:"OtpComponent",key:"OtpComponent",withoutLabel:!0,isMandatory:!1,customProps:{email:O,tenant:N},populators:{required:!0}}]}],w=[{texts:{header:m("SANDBOX_OTP_VERIFICATION"),submitButtonLabel:"CORE_COMMON_SUBMIT"}}],_=()=>{f(null)};return n.useEffect(()=>{var e,t,n,l,o,r;if(!h)return;Digit.SessionStorage.set("citizen.userRequestObject",h);const i=null==h||null===(e=h.info)||void 0===e||null===(t=e.roles)||void 0===t?void 0:t.filter(e=>e.tenantId===Digit.SessionStorage.get("Employee.tenantId"));(null==h||null===(n=h.info)||void 0===n||null===(l=n.roles)||void 0===l?void 0:l.length)>0&&(h.info.roles=i),Digit.UserService.setUser(h),((e,t)=>{var n;let l=(null===(n=JSON.parse(sessionStorage.getItem("Digit.locale")))||void 0===n?void 0:n.value)||Digit.Utils.getDefaultLanguage();localStorage.setItem("Employee.tenant-id",null==e?void 0:e.tenantId),localStorage.setItem("tenant-id",null==e?void 0:e.tenantId),localStorage.setItem("citizen.userRequestObject",JSON.stringify(e)),localStorage.setItem("locale",l),localStorage.setItem("Employee.locale",l),localStorage.setItem("token",t),localStorage.setItem("Employee.token",t),localStorage.setItem("user-info",JSON.stringify(e)),localStorage.setItem("Employee.user-info",JSON.stringify(e))})(null==h?void 0:h.info,null==h?void 0:h.access_token);let a=`/${null===(o=window)||void 0===o?void 0:o.globalPath}/user/url`,s=`/${null===(r=window)||void 0===r?void 0:r.contextPath}/employee`;return d?void p.push(s):void p.push({pathname:a,state:{tenant:N}})},[h]),l.createElement(sn,null,l.createElement("div",{className:"employeeBackbuttonAlign"},l.createElement(t.BackLink,null)),l.createElement(s.FormComposerV2,{onSubmit:function(e){try{var t;const n={username:O,password:null==e||null===(t=e.OtpComponent)||void 0===t?void 0:t.otp,tenantId:N,userType:"EMPLOYEE"},l=G(function(){return Promise.resolve(Digit.UserService.authenticate(n)).then(function(e){let{UserRequest:t,...n}=e;Digit.SessionStorage.set("Employee.tenantId",null==t?void 0:t.tenantId),C({info:t,...n})})},function(e){var t,n;f((null==e||null===(t=e.response)||void 0===t||null===(n=t.data)||void 0===n?void 0:n.error_description)||"ES_ERROR_USER_NOT_PERMITTED"==(null==e?void 0:e.message)&&m("ES_ERROR_USER_NOT_PERMITTED")||m("INVALID_LOGIN_CREDENTIALS")),setTimeout(_,5e3)});return Promise.resolve(l&&l.then?l.then(function(){}):void 0)}catch(e){return Promise.reject(e)}},noBoxShadow:!0,inline:!0,submitInForm:!0,onFormValueChange:(e,t)=>{var n;const l=t.OtpComponent;6===(null==l||null===(n=l.otp)||void 0===n?void 0:n.length)?y(!0):y(!1)},isDisabled:!E,config:I,label:w[0].texts.submitButtonLabel,heading:w[0].texts.header,headingStyle:{textAlign:"center"},cardStyle:{maxWidth:"408px",margin:"auto"},className:"sandbox-onboarding-wrapper"},l.createElement(cn,{showTenant:!1})),g&&l.createElement(t.Toast,{type:"error",label:m(g),onClose:_}),l.createElement("div",{className:"EmployeeLoginFooter"},l.createElement("img",{alt:"Powered by DIGIT",src:null===(i=window)||void 0===i||null===(c=i.globalConfigs)||void 0===c||null===(u=c.getConfig)||void 0===u?void 0:u.call(c,"DIGIT_FOOTER_BW"),style:{cursor:"pointer"},onClick:()=>{var e,t,n;window.open(null===(e=window)||void 0===e||null===(t=e.globalConfigs)||void 0===t||null===(n=t.getConfig)||void 0===n?void 0:n.call(t,"DIGIT_HOME_URL"),"_blank").focus()}})," "))},Dn=()=>{var e,n,r,i;const{t:s}=o.useTranslation(),c=a.useLocation(),{tenant:u}=c.state||{};return a.useHistory(),l.createElement(sn,null,l.createElement("div",{className:"employeeBackbuttonAlign"},l.createElement(t.BackLink,null)),l.createElement(t.Card,{className:"card-sandbox"},l.createElement(cn,{showTenant:!1}),l.createElement("div",{className:"sandbox-success-signup"},l.createElement(t.SVG.TickMark,{fill:"#fff",height:40,width:60})),l.createElement(t.CardHeader,{className:"cardHeader-sandbox",styles:{color:"#00703c"}},s("SANDBOX_HEADER")),l.createElement(t.CardText,{className:"cardText-sandbox"},s("SAMDBOX_URL_SUB")),l.createElement(t.FieldV1,{className:"field-sandbox",withoutLabel:!1,label:s("SANDBOX_URL"),type:"text",nonEditable:!1,value:`${window.location.host}/${null===(e=window)||void 0===e?void 0:e.globalPath}/${u}`,placeholder:s("SANDBOX_URL_PLACEHOLDER"),populators:{}}),l.createElement("div",{className:"sandbox-url-footer"},s("SANDBOX_URL_FOOT")),l.createElement(t.Button,{onClick:()=>{var e;window.location.href=`/${null===(e=window)||void 0===e?void 0:e.globalPath}/${u}/employee`},label:s("SIGN_IN")})),l.createElement("div",{className:"EmployeeLoginFooter"},l.createElement("img",{alt:"Powered by DIGIT",src:null===(n=window)||void 0===n||null===(r=n.globalConfigs)||void 0===r||null===(i=r.getConfig)||void 0===i?void 0:i.call(r,"DIGIT_FOOTER_BW"),style:{cursor:"pointer"},onClick:()=>{var e,t,n;window.open(null===(e=window)||void 0===e||null===(t=e.globalConfigs)||void 0===t||null===(n=t.getConfig)||void 0===n?void 0:n.call(t,"DIGIT_HOME_URL"),"_blank").focus()}})))},Tn=["user/profile","user/error"],Ln=e=>{var r,i,s,c,u,d;let{stateInfo:p,userDetails:g,CITIZEN:f,cityDetails:E,mobileView:y,handleUserDropdownSelection:h,logoUrl:C,DSO:b,stateCode:S,modules:O,appTenants:N,initData:I}=e;const w=a.useHistory(),{t:_}=o.useTranslation(),{path:D}=a.useRouteMatch(),T=a.useLocation(),L=null==T||null===(r=T.pathname)||void 0===r?void 0:r.includes("language-selection"),R=Tn.some(e=>{var t;return null==T||null===(t=T.pathname)||void 0===t?void 0:t.includes(e)});n.useEffect(()=>{Digit.UserService.setType("employee")},[]);const P=null==I||null===(i=I.modules)||void 0===i||null===(s=i.filter(e=>null==e?void 0:e.additionalComponent))||void 0===s?void 0:s.map(e=>null==e?void 0:e.additionalComponent);return l.createElement("div",{className:"employee"},l.createElement(a.Switch,null,l.createElement(a.Route,{path:D+"/user"},R&&l.createElement(A,{t:_,stateInfo:p,userDetails:g,CITIZEN:f,cityDetails:E,mobileView:y,handleUserDropdownSelection:h,logoUrl:C,showSidebar:!!R,showLanguageChange:!L}),l.createElement("div",{className:R?"grounded-container":"loginContainer",style:R?{padding:0,paddingTop:"80px",marginLeft:y?"":"64px"}:{"--banner-url":`url(${null==p?void 0:p.bannerUrl})`,padding:"0px"}},l.createElement(a.Switch,null,l.createElement(a.Route,{exact:!0,path:D+"/user/login"},l.createElement(On,{stateCode:S})),l.createElement(a.Route,{exact:!0,path:D+"/user/login/otp"},l.createElement(_n,{isLogin:!0})),l.createElement(a.Route,{path:D+"/user/forgot-password"},l.createElement(gn,null)),l.createElement(a.Route,{path:D+"/user/change-password"},l.createElement(mn,null)),l.createElement(t.PrivateRoute,{path:D+"/user/profile"},l.createElement(W,{stateCode:S,userType:"employee",cityDetails:E})),l.createElement(a.Route,{path:D+"/user/error"},l.createElement(m,{initData:I,goToHome:()=>{var e,t,n,l;w.push(`/${null===(e=window)||void 0===e?void 0:e.contextPath}/${null===(t=Digit)||void 0===t||null===(n=t.UserService)||void 0===n||null===(l=n.getType)||void 0===l?void 0:l.call(n)}`)}})),l.createElement(a.Route,{path:D+"/user/language-selection"},l.createElement(hn,null)),l.createElement(a.Route,null,l.createElement(a.Redirect,{to:D+"/user/language-selection"}))))),l.createElement(a.Route,null,l.createElement(A,{t:_,stateInfo:p,userDetails:g,CITIZEN:f,cityDetails:E,mobileView:y,handleUserDropdownSelection:h,logoUrl:C,modules:O}),l.createElement("div",{className:`main ${b?"m-auto":""} digit-home-main`},l.createElement("div",{className:"employee-app-wrapper digit-home-app-wrapper"},l.createElement(v,{initData:I},l.createElement(En,{stateCode:S,userType:"employee",modules:O,appTenants:N,additionalComponent:P}))),l.createElement("div",{className:"employee-home-footer"},l.createElement("img",{alt:"Powered by DIGIT",src:null===(c=window)||void 0===c||null===(u=c.globalConfigs)||void 0===u||null===(d=u.getConfig)||void 0===d?void 0:d.call(u,"DIGIT_FOOTER"),style:{height:"1.1em",cursor:"pointer"},onClick:()=>{var e,t,n;window.open(null===(e=window)||void 0===e||null===(t=e.globalConfigs)||void 0===t||null===(n=t.getConfig)||void 0===n?void 0:n.call(t,"DIGIT_HOME_URL"),"_blank").focus()}})))),l.createElement(a.Route,null,l.createElement(a.Redirect,{to:D+"/user/language-selection"}))))},Rn=e=>{var t,o,r,i;let{stateCode:s,modules:c,appTenants:u,logoUrl:d,initData:m,defaultLanding:p="citizen"}=e;const v=a.useHistory(),{pathname:g}=a.useLocation(),f=window.innerWidth,E=Digit.ULBService.getCurrentUlb(),y=Digit.UserService.getUser(),{data:h}=Digit.Hooks.useStore.getInitData(),{stateInfo:C}=h||{},b=Digit.UserService.hasAccess(["FSM_DSO"]);let S="CITIZEN"===(null==y||null===(t=y.info)||void 0===t?void 0:t.type)||!window.location.pathname.split("/").includes("employee");window.location.pathname.split("/").includes("employee")&&(S=!1),n.useEffect(()=>{var e,t,n;null!=g&&g.includes("application-details")||(null!=g&&g.includes("inbox")||Digit.SessionStorage.del("fsm/inbox/searchParams"),null!=g&&g.includes("search")&&Digit.SessionStorage.del("fsm/search/searchParams")),null!=g&&g.includes("dss")||Digit.SessionStorage.del("DSS_FILTERS"),(null==g?void 0:g.toString())===`/${null===(e=window)||void 0===e?void 0:e.contextPath}/employee`&&(Digit.SessionStorage.del("SEARCH_APPLICATION_DETAIL"),Digit.SessionStorage.del("WS_EDIT_APPLICATION_DETAILS")),(null==g?void 0:g.toString())!==`/${null===(t=window)||void 0===t?void 0:t.contextPath}/citizen`&&(null==g?void 0:g.toString())!==`/${null===(n=window)||void 0===n?void 0:n.contextPath}/employee`||Digit.SessionStorage.del("WS_DISCONNECTION")},[g]),v.listen(()=>{var e;null===(e=window)||void 0===e||e.scrollTo({top:0,left:0,behavior:"smooth"})});const O={stateInfo:C,userDetails:y,CITIZEN:S,cityDetails:E,mobileView:f<=640,handleUserDropdownSelection:e=>{e.func()},logoUrl:d,DSO:b,stateCode:s,modules:c,appTenants:u,sourceUrl:window.location.origin+"/citizen",pathname:g,initData:m};return l.createElement(a.Switch,null,l.createElement(a.Route,{path:`/${null===(o=window)||void 0===o?void 0:o.contextPath}/employee`},l.createElement(Ln,O)),l.createElement(a.Route,{path:`/${null===(r=window)||void 0===r?void 0:r.contextPath}/citizen`},l.createElement(Et,O)),l.createElement(a.Route,null,l.createElement(a.Redirect,{to:`/${null===(i=window)||void 0===i?void 0:i.contextPath}/${p}`})))},Pn=e=>{var t,n,o,r,i,s,c;let{stateCode:u,modules:d,appTenants:m,logoUrl:p,initData:v,defaultLanding:g="citizen"}=e;const{data:f}=Digit.Hooks.useStore.getInitData(),{stateInfo:E}=f||{},y=["user/profile","user/error"].some(e=>{var t,n;return null===(t=location)||void 0===t||null===(n=t.pathname)||void 0===n?void 0:n.includes(e)});return l.createElement("div",{className:y?"grounded-container":"loginContainer",style:y?{padding:0,paddingTop:"80px",marginLeft:"64px"}:{"--banner-url":`url(${null==E?void 0:E.bannerUrl})`,padding:"0px"}},l.createElement(a.Switch,null,l.createElement(a.Route,{exact:!0,path:`/${null===(t=window)||void 0===t?void 0:t.globalPath}/user/sign-up`},l.createElement(wn,{stateCode:u})),l.createElement(a.Route,{exact:!0,path:`/${null===(n=window)||void 0===n?void 0:n.globalPath}/user/otp`},l.createElement(_n,null)),l.createElement(a.Route,{exact:!0,path:`/${null===(o=window)||void 0===o?void 0:o.globalPath}/user/url`},l.createElement(Dn,null)),(null===(r=window)||void 0===r?void 0:r.globalPath)!==(null===(i=window)||void 0===i?void 0:i.contextPath)&&l.createElement(a.Route,{path:"/"+(null===(s=window)||void 0===s?void 0:s.contextPath)},l.createElement(Rn,{stateCode:u,modules:d,appTenants:m,logoUrl:p,initData:v,defaultLanding:g})),l.createElement(a.Route,null,l.createElement(a.Redirect,{to:`/${null===(c=window)||void 0===c?void 0:c.globalPath}/user/sign-up`}))))},An=[u],xn=("object"==typeof window&&window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__?window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__({}):c.compose)(c.applyMiddleware(...An)),Mn=e=>{let{onSelect:r,...i}=e;const{t:a}=o.useTranslation(),s=Digit.ULBService.getCurrentTenantId(),[c,u]=n.useState(!1),[d,m]=n.useState(!1),{data:p}=Digit.Hooks.useCustomMDMS(s,"commonUiConfig",[{name:"PrivacyPolicy"}],{select:e=>{var t;return null==e||null===(t=e.commonUiConfig)||void 0===t?void 0:t.PrivacyPolicy.find(e=>{var t;return e.module===(null==i||null===(t=i.props)||void 0===t?void 0:t.module)})}});return n.useEffect(()=>{r("check",c)},[c]),l.createElement(l.Fragment,null,l.createElement("div",{className:"digit-privacy-checkbox"},l.createElement(t.CheckBox,{label:a("ES_BY_CLICKING"),checked:c,onChange:e=>{u(e.target.checked)}}),l.createElement(t.Button,{label:a("ES_PRIVACY_POLICY"),variation:"link",size:"medium",onClick:()=>{m(!0)},style:{marginBottom:"1.18rem",paddingLeft:"0.2rem"}})),d&&l.createElement(t.PopUp,{type:"default",className:"privacy-popUpClass",footerclassName:"popUpFooter",heading:a(null==p?void 0:p.header),onOverlayClick:()=>{m(!1)},footerChildren:[l.createElement(t.Button,{type:"button",size:"large",variation:"secondary",label:a("DIGIT_I_DO_NOT_ACCEPT"),onClick:()=>{u(!1),m(!1)}}),l.createElement(t.Button,{type:"button",size:"large",variation:"primary",label:a("DIGIT_I_ACCEPT"),className:"accept-class",onClick:()=>{u(!0),m(!1)}})],sortFooterChildren:!0,onClose:()=>{m(!1)}},l.createElement("div",null,l.createElement("div",{className:"privacy-table"},a("DIGIT_TABLE_OF_CONTENTS")),l.createElement("ul",null,null==p?void 0:p.contents.map((e,n)=>l.createElement("li",{key:n,style:{display:"flex",alignItems:"center"}},l.createElement("span",{style:{marginRight:"0.5rem"}},n+1,". "),l.createElement(t.Button,{label:a(e.header),variation:"link",size:"medium",onClick:t=>{t.preventDefault(),(e=>{const t=document.getElementById(e);t&&t.scrollIntoView({behavior:"smooth"})})(null==e?void 0:e.header)}}))))),null==p?void 0:p.contents.map((e,t)=>l.createElement("div",{key:t,id:null==e?void 0:e.header},l.createElement("div",{style:{fontWeight:"bold",paddingLeft:null!=e&&e.isSpaceRequired?"1rem":"0"}},a(e.header)),e.descriptions.map((e,t)=>l.createElement("div",{key:t,style:{paddingLeft:e.isSpaceRequired?"1rem":"0",marginBottom:"0.5rem"}},l.createElement("div",{style:{fontWeight:null!=e&&e.isBold?700:400,display:"flex",alignItems:"center"}},"points"===e.type&&l.createElement("span",{style:{marginRight:"0.5rem",listStyleType:"disc"}},"•"),"step"===e.type&&l.createElement("span",{style:{marginRight:"0.5rem",listStyleType:"decimal"}},t+1,". "),a(e.text)),(null==e?void 0:e.subDescriptions)&&(null==e?void 0:e.subDescriptions.length)>0&&l.createElement("div",{className:"policy-subdescription"},e.subDescriptions.map((e,t)=>l.createElement("div",{key:t,className:"policy-subdescription-points"},"points"===e.type&&l.createElement("span",{style:{marginRight:"0.5rem",listStyleType:"disc",paddingLeft:"1rem"}},"•"),"step"===e.type&&l.createElement("span",{style:{marginRight:"0.5rem",listStyleType:"decimal",paddingLeft:"1rem"}},t+1,". "),null===e.type&&l.createElement("span",{style:{marginRight:"0.5rem",paddingLeft:"1rem"}}," "),a(e.text))))))))))},kn=e=>{var n;let{stateCode:r,enabledModules:s,moduleReducers:u,defaultLanding:d}=e;const{isLoading:m,data:p={}}=Digit.Hooks.useInitStore(r,s);if(m)return l.createElement(t.Loader,{page:!0});const v=function(e,t){return void 0===t&&(t={}),c.createStore(((e,t)=>{return c.combineReducers({common:(n=e,function(e,t){switch(void 0===e&&(e=n),t.type){case"LANGUAGE_SELECT":return{...e,selectedLanguage:t.payload};default:return e}}),...t});var n})(e,t),xn)}(p,u(p))||{};return o.getI18n(),Digit.ComponentRegistryService.getComponent("PrivacyComponent")||Digit.ComponentRegistryService.setComponent("PrivacyComponent",Mn),l.createElement(i.Provider,{store:v},l.createElement(a.BrowserRouter,null,l.createElement(t.BodyContainer,null,l.createElement(Pn,{initData:p,stateCode:r,modules:null==p?void 0:p.modules,appTenants:p.tenants,logoUrl:null==p||null===(n=p.stateInfo)||void 0===n?void 0:n.logoUrl,defaultLanding:d}))))},Un={SelectOtp:K,ChangeCity:C,ChangeLanguage:b,PrivacyComponent:Mn,OtpComponent:e=>{var r,i;let{onSelect:c,...u}=e;const{t:d}=o.useTranslation(),[m,p]=(a.useLocation(),n.useState(null)),[v,g]=n.useState({}),[f,E]=n.useState(!0),[y,h]=n.useState(30),C=()=>{p(null)};J(()=>{h(y-1)},y>0?1e3:null),n.useEffect(()=>{c("OtpComponent",v)},[v]);const b={url:"/user-otp/v1/_send",params:{tenantId:null==u||null===(r=u.props)||void 0===r?void 0:r.code},body:{},config:{enable:!1}},S=Digit.Hooks.useCustomAPIMutationHook(b);return l.createElement(n.Fragment,null,l.createElement(t.CardLabel,{className:"sandbox-custom-otp-header"},d("CS_OTP_EMAIL")),l.createElement(t.CardLabel,{className:"sandbox-custom-otp-email"},null==u||null===(i=u.props)||void 0===i?void 0:i.email),l.createElement(t.CardLabel,{className:"sandbox-custom-otp-subheader"},d("SANDBOX_ENTER_OTP")),l.createElement(s.OTPInput,{className:"sandbox-otp-input",length:6,onChange:e=>{g({...v,otp:e})},value:null==v?void 0:v.otp}),y>0?l.createElement(t.CardText,{className:"sandbox-resend-otp"},`${d("CS_RESEND_ANOTHER_OTP")} ${y} ${d("CS_RESEND_SECONDS")}`):l.createElement("p",{className:"card-text-button sandbox-otp-input",onClick:function(){try{var e,t;return h(30),Promise.resolve(S.mutate({body:{otp:{userName:null==u||null===(e=u.props)||void 0===e?void 0:e.email,type:"login",tenantId:null==u||null===(t=u.props)||void 0===t?void 0:t.tenant,userType:"EMPLOYEE"}},config:{enable:!0}},{onError:(e,t)=>{var n,l,o,r,i,a,s;p({key:"error",label:null!=e&&null!==(n=e.response)&&void 0!==n&&null!==(l=n.data)&&void 0!==l&&null!==(o=l.Errors)&&void 0!==o&&o[0].code?"SANDBOX_RESEND_OTP"+(null==e||null===(r=e.response)||void 0===r||null===(i=r.data)||void 0===i||null===(a=i.Errors)||void 0===a||null===(s=a[0])||void 0===s?void 0:s.code):"SANDBOX_RESEND_OTP_ERROR"}),setTimeout(C,5e3)},onSuccess:function(e){try{return p({key:"info",label:d("OTP_RESNED_SUCCESFULL")}),setTimeout(C,5e3),Promise.resolve()}catch(e){return Promise.reject(e)}}})).then(function(){})}catch(e){return Promise.reject(e)}}},d("CS_RESEND_OTP")),!f&&l.createElement(t.CardLabelError,null,d("CS_INVALID_OTP")),m&&l.createElement(t.Toast,{type:null==m?void 0:m.key,label:d(null==m?void 0:m.label),onClose:C}))}};exports.DigitUI=e=>{let{stateCode:t,registry:o,enabledModules:i,moduleReducers:a,defaultLanding:s}=e;const[c,u]=n.useState(Digit.Utils.getPrivacyObject()||{}),d=(Digit.UserService.getType(),new r.QueryClient({defaultOptions:{queries:{staleTime:9e5,cacheTime:3e6,retry:!1,retryDelay:e=>Infinity}}})),m=Digit.Contexts.ComponentProvider,p=Digit.Contexts.PrivacyProvider;return Digit.UserService.hasAccess(["FSM_DSO"]),l.createElement("div",null,l.createElement(v,null,l.createElement(r.QueryClientProvider,{client:d},l.createElement(m.Provider,{value:o},l.createElement(p.Provider,{value:{privacy:null==c?void 0:c[window.location.pathname],resetPrivacy:e=>{Digit.Utils.setPrivacyObject({}),u({})},getPrivacy:()=>{const e=Digit.Utils.getPrivacyObject();return u(e),e},updatePrivacyDescoped:e=>{const t=Digit.Utils.getAllPrivacyObject(),n={...t,[window.location.pathname]:e};Digit.Utils.setPrivacyObject({...n}),u((null==t?void 0:t[window.location.pathname])||{})},updatePrivacy:(e,t)=>{u(Digit.Utils.updatePrivacy(e,t)||{})}}},l.createElement(kn,{stateCode:t,enabledModules:i,moduleReducers:a,defaultLanding:s}))))))},exports.initCoreComponents=()=>{Object.entries(Un).forEach(e=>{let[t,n]=e;Digit.ComponentRegistryService.setComponent(t,n)})};
|