1import{r as i,j as t,U as l,a2 as D,V as p,T as S,E as k}from"./vendor-mui-DqiaP0Nt.js";import{ad as R,J as W,d as j,G as L,i as a,ae as O,M as C,af as z,y as T,e as U,u as G}from"./index-BC-ITwzq.js";import{u as V}from"./useAccountDetails-DL8RN4f9.js";import"./MetricCard-DTCQxln-.js";import{L as F}from"./ModalWithForm-BTzZvCcS.js";import"./ScoreByTypeRow-CCfJ3dmX.js";import"./RolesTable-Buek8Csc.js";import"./index-DcFy5skH.js";import"./ListsTableContainer-gvq7iZ-o.js";import{S as P}from"./SomethingWentWrong-DAE76ed5.js";import"./reportsConfig-CKLmACDJ.js";import{b as H,O as I}from"./vendor-react-BI17mZnb.js";import"./vendor-mui-x-C5p0vAFs.js";import"./dateConverter-C0D5G1kI.js";import"./PageWrapper-9dDDywD5.js";import"./DateRangePicker-B1V5DSnD.js";import"./FormikContainer-CwB3Ys-J.js";import"./EmptyTableComponent-6f4-SrA9.js";import"./useCountries-D91ZQoMC.js";import"./regularExpressions-eAksyVfO.js";import"./PaginationContainer-Cqwskrnh.js";const M=()=>{const e=i.useContext(R);if(e===void 0)throw new Error("useGlobalContext must be used within a GlobalProvider");const{openOnboardingSteps:o,handleOpenOnboardingSteps:s,openOnboardingLastStepModal:r,handleOpenOnboardingLastStepModal:n}=e;return{openOnboardingSteps:o,handleOpenOnboardingSteps:s,openOnboardingLastStepModal:r,handleOpenOnboardingLastStepModal:n}},B=()=>{const{accountData:e,isLoading:o,error:s,refetch:r}=V(),{userData:n,isLoading:d,isError:h,error:c,refetch:x}=W(),g=i.useMemo(()=>e?.merchantStatus,[e?.merchantStatus]),m=i.useMemo(()=>e?.deactivationScheduledAt,[e?.deactivationScheduledAt]),u=i.useMemo(()=>n?.userStatus,[n?.userStatus]);return{userDetails:n,merchantStatus:g,userStatus:u,deactivationScheduledAt:m,loading:o||d,isError:!!s||h,error:s||c,refetchAccountData:r,refetchUserData:x}},A=({path:e})=>t.jsx(l,{sx:{width:"100%","& img":{borderTopLeftRadius:12,borderTopRightRadius:12,width:"100%"}},children:t.jsx("img",{src:e,alt:"#"})}),q=({step:e,stepsCount:o})=>t.jsx(j.Flex,{gap:2,width:"100%",justifyContent:"center",children:Array(o).fill(null).map((s,r)=>t.jsx(l,{sx:{width:7,height:7,borderRadius:2,backgroundColor:r===e?"primary.main":"secondary.dark"}},String(r)))}),J=({modalConfig:e,open:o,step:s=0,onNextButtonClick:r,onSkip:n,stepsCount:d})=>t.jsx(D,{open:o,children:t.jsx(l,{sx:{...L,p:0,width:608},children:t.jsxs(p,{height:"100%",children:[t.jsx(A,{path:e[s].path}),t.jsxs(p,{p:3,justifyContent:"space-between",height:"100%",sx:{minHeight:237},children:[t.jsxs(l,{children:[t.jsx(S,{variant:"h6",children:e[s].title}),t.jsx(S,{sx:{mt:2},variant:"body1",children:e[s].text})]}),t.jsxs(p,{gap:1,mt:4,children:[t.jsx(q,{step:s,stepsCount:d}),t.jsxs(l,{display:"flex",gap:2,width:"100%",children:[e[s].skip&&t.jsx(k,{fullWidth:!0,size:"large",variant:"outlined",onClick:n,children:"Skip"}),t.jsx(k,{fullWidth:!0,size:"large",variant:"contained",onClick:r,children:e[s].proceedButton})]})]})]})]})})}),f=[{path:a.onboarding.firstSlide,title:"Welcome to Voora.ai!",text:"Voora.ai provides customizable rules to help your business stay secure and thrive. Let's get started with a quick overview of the key features and pricing",skip:!0,proceedButton:"Next"},{path:a.onboarding.secondSlide,title:"Real-time fraud detection",text:"Instantly monitor and flag unusual event patterns to keep your business secure",skip:!0,proceedButton:"Next"},{path:a.onboarding.thirdSlide,title:"Customizable fraud rules",text:"Tailor rules to fit your operations and adapt as your needs evolve",skip:!0,proceedButton:"Next"},{path:a.onboarding.fourthSlide,title:"Denylist & Allowlist",text:"Use Denylist & Allowlist to reduce false positives and streamline fraud detection for your business.",skip:!0,proceedButton:"Next"},{path:a.onboarding.fifthSlide,title:"Reporting",text:"Get detailed insights into fraud trends and performance metrics",skip:!0,proceedButton:"Next"}],b=[{path:a.onboarding.firstSlide,title:"Welcome to Voora.ai!",text:"Voora.ai provides customizable rules to help your business stay secure and thrive. Let's get started with a quick overview of the key features and pricing",skip:!0,proceedButton:"Next"},{path:a.onboarding.secondSlide,title:"Real-time fraud detection",text:"Instantly monitor and flag unusual event patterns to keep your business secure",skip:!0,proceedButton:"Next"},{path:a.onboarding.thirdSlide,title:"Customizable fraud rules",text:"Tailor rules to fit your operations and adapt as your needs evolve",skip:!0,proceedButton:"Next"},{path:a.onboarding.fourthSlide,title:"Denylist & Allowlist",text:"Use Denylist & Allowlist to reduce false positives and streamline fraud detection for your business.",skip:!0,proceedButton:"Next"}
1,{path:a.onboarding.fifthSlide,title:"Reporting",text:"Get detailed insights into fraud trends and performance metrics",skip:!0,proceedButton:"Next"}],_=({merchantStatus:e,userStatus:o})=>{const{handleOpenOnboardingLastStepModal:s}=M(),{setCurrentStep:r,setLastStep:n,getLastStep:d,getCurrentStep:h}=O(),[c,x]=i.useState(h()?Number(h()):0),[g,m]=i.useState(!1),u=i.useMemo(()=>e===C.active&&o===z.confirmed,[o,e]),y=i.useMemo(()=>(e===C.onboarded||u)&&!d(),[e,u]),E=u?b.length:f.length;i.useEffect(()=>{m(y)},[y]);const v=w=>{r(w),x(w)},N=()=>{s(!0),n(),m(!1)};return g?t.jsx(J,{modalConfig:u?b:f,onSkip:()=>v(u?b.length-1:f.length-2),open:g,step:c,onNextButtonClick:()=>c===E-1?N():v(c+1),stepsCount:u?b.length:f.length}):null},K=()=>{const{resetSteps:e,resetLastStep:o}=O(),{openOnboardingLastStepModal:s,handleOpenOnboardingLastStepModal:r}=M(),{refetchAccountData:n,refetchUserData:d}=B(),{mutateAsync:h,isPending:c}=T({endpoint:U.userDetails,onSuccess:()=>{n(),d(),e(),o(),r(!1)}}),x=async()=>{await h({})};return s?t.jsx(D,{open:s,onClose:x,children:t.jsx(l,{sx:{...L,p:0,width:608},children:t.jsxs(p,{height:"100%",children:[t.jsx(A,{path:a.onboarding.welcomeToFraudJudge}),t.jsxs(p,{p:3,justifyContent:"space-between",height:"100%",sx:{minHeight:237},children:[t.jsxs(l,{children:[t.jsx(S,{variant:"h6",children:"Welcome to Voora.ai!"}),t.jsx(S,{sx:{mt:2},variant:"body1",children:"Voora.ai is now protecting your business. Monitor events in real time. Customize fraud rules based on your business needs."})]}),t.jsx(p,{gap:1,mt:4,children:t.jsx(l,{display:"flex",gap:2,width:"100%",children:t.jsx(F,{fullWidth:!0,size:"large",variant:"contained",onClick:x,loading:c,children:"Go to Dashboard"})})})]})]})})}):null},Q=({children:e})=>{const{t:o}=G(),{loading:s,isError:r,merchantStatus:n,userStatus:d}=B();return s?t.jsx(j.Flex,{height:"100vh",children:t.jsx(j.Spinner,{size:"5%"})}):r?t.jsx(P,{mainDescription:o("somethingWentWrong.dataLoadingError")}):t.jsxs(t.Fragment,{children:[t.jsx(p,{height:"100vh",children:e}),t.jsx(_,{merchantStatus:n,userStatus:d}),t.jsx(K,{})]})},ft=({children:e})=>{const{pathname:o}=H(),s=i.useRef(null);return i.useEffect(()=>{s.current&&(s.current.scrollTop=0)},[o]),t.jsx(Q,{children:t.jsxs(j.Flex,{alignItems:"stretch",height:"100%",overflow:"hidden",children:[e,t.jsx(l,{sx:{width:"100%",overflow:"auto"},ref:s,children:t.jsx(I,{})})]})})};export{ft as HomePage};
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.