@zeniai/web-app-ui 5.0.0-dev → 5.0.0-qa

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (58) hide show
  1. package/dist/assets/{AddressRoutes-CsjRlbPP.js → AddressRoutes-D2Yn8dXr.js} +1 -1
  2. package/dist/assets/{AddressScreen-Cud2BdS6.js → AddressScreen-B-90Ns9M.js} +1 -1
  3. package/dist/assets/{AiCfoScreen-BlJgIDQk.js → AiCfoScreen-BR8PoUmU.js} +1 -1
  4. package/dist/assets/{BillPayApprovalRoutes-a0Eum5ly.js → BillPayApprovalRoutes-BeaWY9ga.js} +1 -1
  5. package/dist/assets/{BillPayRoutes-4WQm4Az3.js → BillPayRoutes-CWbI-3lu.js} +1 -1
  6. package/dist/assets/{BusinessVerificationPageScreen-ByeCoum9.js → BusinessVerificationPageScreen-B8mXcNLy.js} +1 -1
  7. package/dist/assets/{ChargeCardRoutes-BaWxIhbQ.js → ChargeCardRoutes-Bgdfn44a.js} +1 -1
  8. package/dist/assets/{CompanyPassportScreen-Gd7wTdjI.js → CompanyPassportScreen-BCPm2c8T.js} +1 -1
  9. package/dist/assets/{ConnectionAuthScreen-DRIbdRCr.js → ConnectionAuthScreen-BYziEpOR.js} +1 -1
  10. package/dist/assets/{CustomerOnboardingAuthScreen-Bo5uU8cG.js → CustomerOnboardingAuthScreen-Dduw6GDH.js} +1 -1
  11. package/dist/assets/{CustomerOnboardingRoutes-CA_SL4If.js → CustomerOnboardingRoutes-D-_60rGa.js} +1 -1
  12. package/dist/assets/{DashboardRoutes-BukE-3A1.js → DashboardRoutes-B9_-_tPb.js} +1 -1
  13. package/dist/assets/{DefaultTenantHome-CJs1Iehr.js → DefaultTenantHome-Cl8vcsiM.js} +1 -1
  14. package/dist/assets/{DomesticWireDetailScreen-C-F8590D.js → DomesticWireDetailScreen-DCV6HQRp.js} +1 -1
  15. package/dist/assets/{DrawerScreen-D8_xICtn.js → DrawerScreen-dt2KgJzx.js} +1 -1
  16. package/dist/assets/{EntityDetailRoutes-DUxU9PLN.js → EntityDetailRoutes-CINCnbfR.js} +1 -1
  17. package/dist/assets/{ExpenseAutomationRoutes-CFti2QGS.js → ExpenseAutomationRoutes-D8G_zp8f.js} +1 -1
  18. package/dist/assets/{FeaturePreviewScreen-BdQUVLIb.js → FeaturePreviewScreen-C2dbroTQ.js} +1 -1
  19. package/dist/assets/{MagicLinkRoutes-BA19woWo.js → MagicLinkRoutes-CytIPPYS.js} +1 -1
  20. package/dist/assets/{MagicLinkSignInScreen-B3D7rk1w.js → MagicLinkSignInScreen-BxPvHLB5.js} +1 -1
  21. package/dist/assets/{MobileAppDrawer-DVJrG_df.js → MobileAppDrawer-eCdBXSxf.js} +1 -1
  22. package/dist/assets/{NotFoundScreen-Dw_4aXSt.js → NotFoundScreen-jPpbDlQd.js} +1 -1
  23. package/dist/assets/{NotificationRoutes-CCiEyTtK.js → NotificationRoutes-CxWKZNsp.js} +1 -1
  24. package/dist/assets/{PandLWithForecastRoutes-BCE_H3uV.js → PandLWithForecastRoutes-BeER1eMP.js} +1 -1
  25. package/dist/assets/{PeopleRoutes-DdGI7aN1.js → PeopleRoutes-5oajZHVV.js} +1 -1
  26. package/dist/assets/{PerformanceRoutes-D1lBptE4.js → PerformanceRoutes-D2L3CFvV.js} +1 -1
  27. package/dist/assets/{QBOConnectionScreen-D4gTLUDW.js → QBOConnectionScreen-B4Rcl2XA.js} +1 -1
  28. package/dist/assets/{ReferralListScreen-BnWOANU0.js → ReferralListScreen-DHtLnulq.js} +1 -1
  29. package/dist/assets/{ReimbursementApprovalRoutes-C0f3WPnl.js → ReimbursementApprovalRoutes-DdJz0p5l.js} +1 -1
  30. package/dist/assets/{ReimbursementApprovalRuleDetailScreen-DWpP5dnv.js → ReimbursementApprovalRuleDetailScreen-BVKZCEAO.js} +1 -1
  31. package/dist/assets/{ReimbursementRoutes-Bacb4uYZ.js → ReimbursementRoutes--zV8t9-V.js} +1 -1
  32. package/dist/assets/{ReportsRoutes-u2KAi2M5.js → ReportsRoutes-CRufLdv_.js} +1 -1
  33. package/dist/assets/{RewardsRoutes-CSkXXFxN.js → RewardsRoutes-CJ6LAavD.js} +1 -1
  34. package/dist/assets/{ScreenRoutes-_VyWuy4j.js → ScreenRoutes-C36ZBPGp.js} +2 -2
  35. package/dist/assets/{SettingsRoutes-CvdvJ0Av.js → SettingsRoutes-BZwjpejF.js} +1 -1
  36. package/dist/assets/{SetupPagesScreen-B82yEDYc.js → SetupPagesScreen-BJy2d6s1.js} +1 -1
  37. package/dist/assets/{SignInScreen-h4mmFX0V.js → SignInScreen-Cr0sIFcm.js} +1 -1
  38. package/dist/assets/{SignOutScreen-CTpdoBTV.js → SignOutScreen-sgTWJDGb.js} +1 -1
  39. package/dist/assets/{TaskListScreen-DhR04r2N.js → TaskListScreen-BpK-8QnW.js} +1 -1
  40. package/dist/assets/{TaskRoutes-CmYYanF8.js → TaskRoutes-DfQABQLR.js} +1 -1
  41. package/dist/assets/{TransactionDetailRoutes-D1GbcIi5.js → TransactionDetailRoutes-CM3RR8SH.js} +1 -1
  42. package/dist/assets/{TransactionDetailScreen-DvpEF447.js → TransactionDetailScreen-BCiX38jP.js} +1 -1
  43. package/dist/assets/{TransactionListRoutes-DZAOtZ-c.js → TransactionListRoutes-yuwwha-7.js} +1 -1
  44. package/dist/assets/{TreasuryRoutes-BOzO02zC.js → TreasuryRoutes-CY_-R9A0.js} +1 -1
  45. package/dist/assets/{VendorsRoutes-D5PYGwb7.js → VendorsRoutes-k37ZPcgY.js} +1 -1
  46. package/dist/assets/{WiseConfirmationScreen-DnV0a0Cv.js → WiseConfirmationScreen-D_U8eXIb.js} +1 -1
  47. package/dist/assets/{ZeniAccountRoutes-DSs5E5rA.js → ZeniAccountRoutes-BYcGG-cX.js} +1 -1
  48. package/dist/assets/{ZeniAccountStatementScreen-CBFFWoV4.js → ZeniAccountStatementScreen-DOb1513X.js} +1 -1
  49. package/dist/assets/{analyticsHelper-ZM4U1wiv.js → analyticsHelper-B-IDLpaZ.js} +1 -1
  50. package/dist/assets/{getLocaleForTenant-7ntdeZSs.js → getLocaleForTenant-C50EFRQ8.js} +1 -1
  51. package/dist/assets/{index-DmE4wSNC.js → index-DgzG0i4n.js} +5 -5
  52. package/dist/assets/{routePaths-BbBoI9fr.js → routePaths-WhbiYSxu.js} +1 -1
  53. package/dist/assets/{useAskAiCfoHostNavButtonProps-Djdv5hKX.js → useAskAiCfoHostNavButtonProps-DQFYXydp.js} +1 -1
  54. package/dist/assets/{useFetchSuggestedQuestionsWhenReady-Cfhk-A1n.js → useFetchSuggestedQuestionsWhenReady-BMFUNkte.js} +1 -1
  55. package/dist/assets/{useInitialThreadRequest-CxCt8-bu.js → useInitialThreadRequest-C88MW4km.js} +1 -1
  56. package/dist/assets/{withTransactionSidePanel-DMUIu-an.js → withTransactionSidePanel-D3gZnvfm.js} +1 -1
  57. package/dist/index.html +1 -1
  58. package/package.json +1 -1
@@ -1 +1 @@
1
- import{j as e}from"./liveblocks-CVGPqYnR.js";import{A as i}from"./AddressScreen-Cud2BdS6.js";import s from"./NotFoundScreen-Dw_4aXSt.js";import"./sentry-vrLJXbkU.js";import{n as d,o as r}from"./core-B4ZvHvvY.js";import"./zeni-epic-state-Da4VO2lv.js";import"./recharts-DNFnaP_v.js";import"./index-DmE4wSNC.js";import"./mui-DoY7WfR_.js";import"./lottie-B5aSI3Li.js";import"./analytics-BL0geQNn.js";import"./plaid-C1RHGEem.js";import"./dnd-B2_m6pRT.js";import"./stripe-DMRn4zHo.js";import"./lexical-DA5yMmPj.js";import"./pdf-ChIJqwGf.js";import"./utils-QMlevttK.js";(function(){try{var t=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},o=new t.Error().stack;o&&(t._sentryDebugIds=t._sentryDebugIds||{},t._sentryDebugIds[o]="339d6624-b51b-426b-a0cc-e8e8bd837ae0",t._sentryDebugIdIdentifier="sentry-dbid-339d6624-b51b-426b-a0cc-e8e8bd837ae0")}catch{}})();function _(){return e.jsxs(d,{children:[e.jsx(r,{path:"/edit/:addressType/:addressId",element:e.jsx(i,{})}),e.jsx(r,{path:"/new/:addressType",element:e.jsx(i,{})}),e.jsx(r,{path:"*",element:e.jsx(s,{})})]})}export{_ as default};
1
+ import{j as e}from"./liveblocks-CVGPqYnR.js";import{A as i}from"./AddressScreen-B-90Ns9M.js";import s from"./NotFoundScreen-jPpbDlQd.js";import"./sentry-vrLJXbkU.js";import{n as d,o as r}from"./core-B4ZvHvvY.js";import"./zeni-epic-state-Da4VO2lv.js";import"./recharts-DNFnaP_v.js";import"./index-DgzG0i4n.js";import"./mui-DoY7WfR_.js";import"./lottie-B5aSI3Li.js";import"./analytics-BL0geQNn.js";import"./plaid-C1RHGEem.js";import"./dnd-B2_m6pRT.js";import"./stripe-DMRn4zHo.js";import"./lexical-DA5yMmPj.js";import"./pdf-ChIJqwGf.js";import"./utils-QMlevttK.js";(function(){try{var t=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},o=new t.Error().stack;o&&(t._sentryDebugIds=t._sentryDebugIds||{},t._sentryDebugIds[o]="339d6624-b51b-426b-a0cc-e8e8bd837ae0",t._sentryDebugIdIdentifier="sentry-dbid-339d6624-b51b-426b-a0cc-e8e8bd837ae0")}catch{}})();function _(){return e.jsxs(d,{children:[e.jsx(r,{path:"/edit/:addressType/:addressId",element:e.jsx(i,{})}),e.jsx(r,{path:"/new/:addressType",element:e.jsx(i,{})}),e.jsx(r,{path:"*",element:e.jsx(s,{})})]})}export{_ as default};
@@ -1,4 +1,4 @@
1
- import{j as d}from"./liveblocks-CVGPqYnR.js";import{a as h}from"./sentry-vrLJXbkU.js";import{j as P,h as _,u as j,l as B,g as E,k as $}from"./core-B4ZvHvvY.js";import{K as L,m as M,z as D,S as K,B as G,s as z,c as I,e as m,I as F,h as b,p as N}from"./index-DmE4wSNC.js";import{IA as C,gG as O,eL as R,IB as U,b$ as V,IC as q,jO as H}from"./zeni-epic-state-Da4VO2lv.js";import{n as J}from"./mui-DoY7WfR_.js";import Q from"./NotFoundScreen-Dw_4aXSt.js";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="75a6f00f-fb19-49fd-9c2b-663680296369",e._sentryDebugIdIdentifier="sentry-dbid-75a6f00f-fb19-49fd-9c2b-663680296369")}catch{}})();const W=J.div`
1
+ import{j as d}from"./liveblocks-CVGPqYnR.js";import{a as h}from"./sentry-vrLJXbkU.js";import{j as P,h as _,u as j,l as B,g as E,k as $}from"./core-B4ZvHvvY.js";import{K as L,m as M,z as D,S as K,B as G,s as z,c as I,e as m,I as F,h as b,p as N}from"./index-DgzG0i4n.js";import{IA as C,gG as O,eL as R,IB as U,b$ as V,IC as q,jO as H}from"./zeni-epic-state-Da4VO2lv.js";import{n as J}from"./mui-DoY7WfR_.js";import Q from"./NotFoundScreen-jPpbDlQd.js";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="75a6f00f-fb19-49fd-9c2b-663680296369",e._sentryDebugIdIdentifier="sentry-dbid-75a6f00f-fb19-49fd-9c2b-663680296369")}catch{}})();const W=J.div`
2
2
  display: flex;
3
3
  height: 100vh;
4
4
  width: 100%;
@@ -1,4 +1,4 @@
1
- import{j as S}from"./liveblocks-CVGPqYnR.js";import{a as i}from"./sentry-vrLJXbkU.js";import{h as ee,j as te,u as se,g as U,l as ae,k as ne}from"./core-B4ZvHvvY.js";import{J as oe,cB as ie,z as re,K as le,cC as ce,cD as ue,cE as $,s as de,c as _,Q as B,cF as me,cG as fe,e as pe,a1 as he,cH as Se,R as ge,q as Ce,p as be,cI as we,cJ as Ie}from"./index-DmE4wSNC.js";import{fD as ke,f2 as q,eL as Ee,h6 as ye,P6 as Pe,eK as Te,hg as _e,hc as xe,ft as ve,fn as Qe,fg as Ae,fk as j,fo as Oe,fp as De,fq as Fe,fr as Le,fs as Me}from"./zeni-epic-state-Da4VO2lv.js";import{D as Re,n as x,P as Ue,S as Be}from"./mui-DoY7WfR_.js";import{p as je}from"./pathToGoBack-BDUkHX_e.js";import"./recharts-DNFnaP_v.js";import"./lottie-B5aSI3Li.js";import"./analytics-BL0geQNn.js";import"./plaid-C1RHGEem.js";import"./dnd-B2_m6pRT.js";import"./stripe-DMRn4zHo.js";import"./lexical-DA5yMmPj.js";import"./pdf-ChIJqwGf.js";import"./utils-QMlevttK.js";(function(){try{var a=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},r=new a.Error().stack;r&&(a._sentryDebugIds=a._sentryDebugIds||{},a._sentryDebugIds[r]="17c3d4d5-d710-476b-a694-9abfc0bbcf97",a._sentryDebugIdIdentifier="sentry-dbid-17c3d4d5-d710-476b-a694-9abfc0bbcf97")}catch{}})();const N="chat-response-generated",$e=ne(function(a,r){const n=q(a),d=r.isSubmitting;return{showSampleQuestions:r.sessionFromUrl==="explore"&&n.uiState.currentChatSessionId==null,aiCfoView:n,isSubmitting:d,isNewChatSession:r.sessionFromUrl==="new_chat"||r.sessionFromUrl==="explore",isFullView:!0,tableDownloadEndPoint:`${ge}/tableDownload`,emailLinkQuestion:r.emailLinkQuestion,autoSubmitEmailLinkQuestion:r.autoSubmitEmailLinkQuestion,onEmailLinkQuestionProcessed:r.onEmailLinkQuestionProcessed,isFileUploadEnabled:r.isFileUploadEnabled}},function(a,r){const{location:n,currentTenant:d,userId:c,navigate:f,currentChatSessionId:p,allSessionsWithOrderedQuestionAnswers:g}=r;return{onEventReceived:(e,o)=>{if(e===N&&typeof o.text=="string"&&typeof o.metadata=="object"){const t=o,m=De(t.type),u=t.metadata.chat_session_id??null,{currentChatSession:s,currentQuestionAnswer:C,currentQuestionAnswerSummary:h}=$(g,u);m!=="answer"?_.trackAICFOChatResponseGenerated(m,C?.question.questionText??"",t.text,u,Ie(h,s),t.metadata.message_id??null):_.trackAICFOChatAnswerGenerated(t.text,C?.question.questionText??"",(t.follow_up_questions?.length??0)>0,!!t.assumptions,!!t.insights,t.visualization!=null,Fe(t.visualization?.type??"")??null,u,t.summarized_title,t.metadata.message_id??null),a(Le({chatSessionId:t.metadata.chat_session_id,responseType:m,fetchState:{fetchState:"Completed",error:void 0}})),a(Me({chatSessionId:t.metadata.chat_session_id,answerPayload:t,userId:c}))}},onSubmit:(e,o,t,m)=>{e&&we(a,e,o,p,g,c,m,t)},updateCurrentInput:e=>{a(j(e))},onStopSubmit:()=>{},onUpdateScrollYOffset:e=>{a(Oe(e))},onSelectSampleQuestion:()=>{},onBackClick:()=>{f(-1)},onCloseClick:()=>{const e=be(n.state?.pathnameStackToGoBack),o=e.poppedPathname??je(1);f(o,{state:{...n.state,pathnameStackToGoBack:e.newStack}}),a(j(""))},togglePageView:()=>{f(`/${d.tenantEmailDomain}/dashboard`,{state:{...n.state,message:"open_ai_cfo_drawer"}})},onCopy:()=>{},onThumbsUp:()=>{},onThumbsDown:()=>{},onTogglePageView:()=>{f(-1)},onNewChatClick:()=>{p!=null&&a(Ae());const e=Ce(n.state?.pathnameStackToGoBack,n.pathname);f(`/${d.tenantEmailDomain}/ai-cfo/new_chat`,{state:{pathnameStackToGoBack:e.slice(0,-1),referrer:"Sidebar"}})},onToggleCotCollapsed:(e,o)=>{a(Qe({questionAnswerId:e,isCollapsed:o}))},onMenuClick:r.onMenuClick}})(he(Se)),rt=({isFileUploadEnabled:a})=>{const{setIsAiCfoOpen:r}=oe(),n=ee(),d=te(),c=se(),[f,p]=i.useState(!1);i.useEffect(()=>{n(ke())},[n]);const{customPageTitle:g}=ie(),e=U(l=>q(l)),o=re.getSignedInUser(),{session_id:t}=ae(),m=le(),u=U(l=>Ee(l)),s=e.uiState.currentChatSessionId,C=ce({currentTenant:u,currentChatSessionId:s,aiCfoView:e}),h=c.state,b=h?.aiCfoInitialQuestion,v=!!h?.aiCfoShouldSubmit,[G,k]=i.useState(null),[V,E]=i.useState(!1),Q=i.useRef(!1);i.useEffect(()=>{Q.current||b==null||b===""||(k(b),E(v),Q.current=!0)},[b,v]);const H=i.useCallback(()=>{k(null),E(!1)},[]),A=i.useMemo(()=>new URLSearchParams(c.search),[c.search]),O=A.get("ref")??h?.aiCfoRef,y=A.get("emailRefId")??h?.aiCfoEmailRefId,D=i.useRef(!1);i.useEffect(()=>{D.current||O!=="month-end-email"||y==null||s!=null||o==null||(n(ye("controller",o.userId,y,"MONTH_END_EMAIL")),D.current=!0)},[O,y,s,n,o]);const w=e.uiState.lastContextMessage;i.useEffect(()=>{w!=null&&w!==""&&s!=null&&(k(w),E(!0),n(Pe()))},[w,s,n]);const W=u.masterTOSInfo,I=W?.isMasterTOSAccepted??!1,{visitedSessions:F}=ue(s),P=e.fetchState,T=e.uiState.chatSessionsNextPageToken.hasMore||!e.uiState.chatSessionsFirstPageFetched,L=s!=null?e.fetchChatSessionHistoryByChatSessionId?.[s]?.fetchState??"Not-Started":"Not-Started",M=s==null||(e.uiState.chatHistoryNextPageToken[s]?.hasMore??!0),R=e.allSessionsWithOrderedQuestionAnswers,{currentSessionQuestionAnswers:z}=$(R,s),J=z.length===0;i.useEffect(()=>{I||d("../dashboard",{state:{...c.state,message:"open_ai_cfo_drawer"}})},[I]),i.useEffect(()=>{s!=null&&t!==s&&d(`../ai-cfo/${s}`,{state:{...c.state}})},[s,t]),i.useEffect(()=>{t!=null&&s==null&&t!=="new_chat"&&t!=="explore"&&n(Te({sessionId:t,agentId:"controller"}))},[]);const K=i.useMemo(()=>({events:F.map(l=>`private-chat-${l}.${N}`),eventCallback:(l,Y,Z)=>Z.onEventReceived(l,Y)}),[F]);if(i.useEffect(()=>{P!=="In-Progress"&&T&&n(_e())},[P,T,n]),i.useEffect(()=>{s!=null&&L!=="In-Progress"&&M&&o!=null&&P==="Completed"&&!T&&n(xe(s,o.userId))},[L,M,s,o,n]),o==null||t==null)throw Error("Can't access AI Controller page without signing in...");const X=s!=null&&e.responseStateByChatSessionId?.[s]?.answer?.fetchState==="In-Progress";return S.jsxs(Ne,{children:[S.jsx(de,{analytics:_,onLoad:l=>l.trackPageLoaded(pe.Event.aiCFOPage)}),B(m)&&C.drawerElement,S.jsx($e,{...K,currentChatSessionId:s,allSessionsWithOrderedQuestionAnswers:R,openOnboardingPage:()=>p(!0),userId:o.userId,setIsAiCfoOpen:r,navigate:d,sessionFromUrl:t,location:c,isSubmitting:X,isEmptyChatWithSession:J,customPageTitle:g,currentTenant:u,emailLinkQuestion:G??void 0,autoSubmitEmailLinkQuestion:V,onEmailLinkQuestionProcessed:H,onMenuClick:B(m)?C.open:void 0,isFileUploadEnabled:a}),S.jsx(Re,{anchor:"right",open:f,transitionDuration:250,PaperProps:{component:Ge,style:{width:`${me}vw`}},slotProps:{backdrop:{style:{backgroundColor:"transparent",cursor:"pointer"}}},onClose:()=>p(!1),children:S.jsx(qe,{onClick:l=>l.stopPropagation(),children:S.jsx(fe,{isTOSAccepted:I,acceptMasterTOSState:e.masterTOSAcceptanceState,customPageTitle:g,onCloseClick:()=>p(!1),onCompleteClick:()=>{I||u.userRoleId==null||n(ve(u.userRoleId)),p(!1)}})})})]})},qe=x(Be)`
1
+ import{j as S}from"./liveblocks-CVGPqYnR.js";import{a as i}from"./sentry-vrLJXbkU.js";import{h as ee,j as te,u as se,g as U,l as ae,k as ne}from"./core-B4ZvHvvY.js";import{J as oe,cB as ie,z as re,K as le,cC as ce,cD as ue,cE as $,s as de,c as _,Q as B,cF as me,cG as fe,e as pe,a1 as he,cH as Se,R as ge,q as Ce,p as be,cI as we,cJ as Ie}from"./index-DgzG0i4n.js";import{fD as ke,f2 as q,eL as Ee,h6 as ye,P6 as Pe,eK as Te,hg as _e,hc as xe,ft as ve,fn as Qe,fg as Ae,fk as j,fo as Oe,fp as De,fq as Fe,fr as Le,fs as Me}from"./zeni-epic-state-Da4VO2lv.js";import{D as Re,n as x,P as Ue,S as Be}from"./mui-DoY7WfR_.js";import{p as je}from"./pathToGoBack-BDUkHX_e.js";import"./recharts-DNFnaP_v.js";import"./lottie-B5aSI3Li.js";import"./analytics-BL0geQNn.js";import"./plaid-C1RHGEem.js";import"./dnd-B2_m6pRT.js";import"./stripe-DMRn4zHo.js";import"./lexical-DA5yMmPj.js";import"./pdf-ChIJqwGf.js";import"./utils-QMlevttK.js";(function(){try{var a=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},r=new a.Error().stack;r&&(a._sentryDebugIds=a._sentryDebugIds||{},a._sentryDebugIds[r]="17c3d4d5-d710-476b-a694-9abfc0bbcf97",a._sentryDebugIdIdentifier="sentry-dbid-17c3d4d5-d710-476b-a694-9abfc0bbcf97")}catch{}})();const N="chat-response-generated",$e=ne(function(a,r){const n=q(a),d=r.isSubmitting;return{showSampleQuestions:r.sessionFromUrl==="explore"&&n.uiState.currentChatSessionId==null,aiCfoView:n,isSubmitting:d,isNewChatSession:r.sessionFromUrl==="new_chat"||r.sessionFromUrl==="explore",isFullView:!0,tableDownloadEndPoint:`${ge}/tableDownload`,emailLinkQuestion:r.emailLinkQuestion,autoSubmitEmailLinkQuestion:r.autoSubmitEmailLinkQuestion,onEmailLinkQuestionProcessed:r.onEmailLinkQuestionProcessed,isFileUploadEnabled:r.isFileUploadEnabled}},function(a,r){const{location:n,currentTenant:d,userId:c,navigate:f,currentChatSessionId:p,allSessionsWithOrderedQuestionAnswers:g}=r;return{onEventReceived:(e,o)=>{if(e===N&&typeof o.text=="string"&&typeof o.metadata=="object"){const t=o,m=De(t.type),u=t.metadata.chat_session_id??null,{currentChatSession:s,currentQuestionAnswer:C,currentQuestionAnswerSummary:h}=$(g,u);m!=="answer"?_.trackAICFOChatResponseGenerated(m,C?.question.questionText??"",t.text,u,Ie(h,s),t.metadata.message_id??null):_.trackAICFOChatAnswerGenerated(t.text,C?.question.questionText??"",(t.follow_up_questions?.length??0)>0,!!t.assumptions,!!t.insights,t.visualization!=null,Fe(t.visualization?.type??"")??null,u,t.summarized_title,t.metadata.message_id??null),a(Le({chatSessionId:t.metadata.chat_session_id,responseType:m,fetchState:{fetchState:"Completed",error:void 0}})),a(Me({chatSessionId:t.metadata.chat_session_id,answerPayload:t,userId:c}))}},onSubmit:(e,o,t,m)=>{e&&we(a,e,o,p,g,c,m,t)},updateCurrentInput:e=>{a(j(e))},onStopSubmit:()=>{},onUpdateScrollYOffset:e=>{a(Oe(e))},onSelectSampleQuestion:()=>{},onBackClick:()=>{f(-1)},onCloseClick:()=>{const e=be(n.state?.pathnameStackToGoBack),o=e.poppedPathname??je(1);f(o,{state:{...n.state,pathnameStackToGoBack:e.newStack}}),a(j(""))},togglePageView:()=>{f(`/${d.tenantEmailDomain}/dashboard`,{state:{...n.state,message:"open_ai_cfo_drawer"}})},onCopy:()=>{},onThumbsUp:()=>{},onThumbsDown:()=>{},onTogglePageView:()=>{f(-1)},onNewChatClick:()=>{p!=null&&a(Ae());const e=Ce(n.state?.pathnameStackToGoBack,n.pathname);f(`/${d.tenantEmailDomain}/ai-cfo/new_chat`,{state:{pathnameStackToGoBack:e.slice(0,-1),referrer:"Sidebar"}})},onToggleCotCollapsed:(e,o)=>{a(Qe({questionAnswerId:e,isCollapsed:o}))},onMenuClick:r.onMenuClick}})(he(Se)),rt=({isFileUploadEnabled:a})=>{const{setIsAiCfoOpen:r}=oe(),n=ee(),d=te(),c=se(),[f,p]=i.useState(!1);i.useEffect(()=>{n(ke())},[n]);const{customPageTitle:g}=ie(),e=U(l=>q(l)),o=re.getSignedInUser(),{session_id:t}=ae(),m=le(),u=U(l=>Ee(l)),s=e.uiState.currentChatSessionId,C=ce({currentTenant:u,currentChatSessionId:s,aiCfoView:e}),h=c.state,b=h?.aiCfoInitialQuestion,v=!!h?.aiCfoShouldSubmit,[G,k]=i.useState(null),[V,E]=i.useState(!1),Q=i.useRef(!1);i.useEffect(()=>{Q.current||b==null||b===""||(k(b),E(v),Q.current=!0)},[b,v]);const H=i.useCallback(()=>{k(null),E(!1)},[]),A=i.useMemo(()=>new URLSearchParams(c.search),[c.search]),O=A.get("ref")??h?.aiCfoRef,y=A.get("emailRefId")??h?.aiCfoEmailRefId,D=i.useRef(!1);i.useEffect(()=>{D.current||O!=="month-end-email"||y==null||s!=null||o==null||(n(ye("controller",o.userId,y,"MONTH_END_EMAIL")),D.current=!0)},[O,y,s,n,o]);const w=e.uiState.lastContextMessage;i.useEffect(()=>{w!=null&&w!==""&&s!=null&&(k(w),E(!0),n(Pe()))},[w,s,n]);const W=u.masterTOSInfo,I=W?.isMasterTOSAccepted??!1,{visitedSessions:F}=ue(s),P=e.fetchState,T=e.uiState.chatSessionsNextPageToken.hasMore||!e.uiState.chatSessionsFirstPageFetched,L=s!=null?e.fetchChatSessionHistoryByChatSessionId?.[s]?.fetchState??"Not-Started":"Not-Started",M=s==null||(e.uiState.chatHistoryNextPageToken[s]?.hasMore??!0),R=e.allSessionsWithOrderedQuestionAnswers,{currentSessionQuestionAnswers:z}=$(R,s),J=z.length===0;i.useEffect(()=>{I||d("../dashboard",{state:{...c.state,message:"open_ai_cfo_drawer"}})},[I]),i.useEffect(()=>{s!=null&&t!==s&&d(`../ai-cfo/${s}`,{state:{...c.state}})},[s,t]),i.useEffect(()=>{t!=null&&s==null&&t!=="new_chat"&&t!=="explore"&&n(Te({sessionId:t,agentId:"controller"}))},[]);const K=i.useMemo(()=>({events:F.map(l=>`private-chat-${l}.${N}`),eventCallback:(l,Y,Z)=>Z.onEventReceived(l,Y)}),[F]);if(i.useEffect(()=>{P!=="In-Progress"&&T&&n(_e())},[P,T,n]),i.useEffect(()=>{s!=null&&L!=="In-Progress"&&M&&o!=null&&P==="Completed"&&!T&&n(xe(s,o.userId))},[L,M,s,o,n]),o==null||t==null)throw Error("Can't access AI Controller page without signing in...");const X=s!=null&&e.responseStateByChatSessionId?.[s]?.answer?.fetchState==="In-Progress";return S.jsxs(Ne,{children:[S.jsx(de,{analytics:_,onLoad:l=>l.trackPageLoaded(pe.Event.aiCFOPage)}),B(m)&&C.drawerElement,S.jsx($e,{...K,currentChatSessionId:s,allSessionsWithOrderedQuestionAnswers:R,openOnboardingPage:()=>p(!0),userId:o.userId,setIsAiCfoOpen:r,navigate:d,sessionFromUrl:t,location:c,isSubmitting:X,isEmptyChatWithSession:J,customPageTitle:g,currentTenant:u,emailLinkQuestion:G??void 0,autoSubmitEmailLinkQuestion:V,onEmailLinkQuestionProcessed:H,onMenuClick:B(m)?C.open:void 0,isFileUploadEnabled:a}),S.jsx(Re,{anchor:"right",open:f,transitionDuration:250,PaperProps:{component:Ge,style:{width:`${me}vw`}},slotProps:{backdrop:{style:{backgroundColor:"transparent",cursor:"pointer"}}},onClose:()=>p(!1),children:S.jsx(qe,{onClick:l=>l.stopPropagation(),children:S.jsx(fe,{isTOSAccepted:I,acceptMasterTOSState:e.masterTOSAcceptanceState,customPageTitle:g,onCloseClick:()=>p(!1),onCompleteClick:()=>{I||u.userRoleId==null||n(ve(u.userRoleId)),p(!1)}})})})]})},qe=x(Be)`
2
2
  display: flex;
3
3
  min-height: 100%;
4
4
  flex-direction: column;
@@ -1 +1 @@
1
- import{j as l}from"./liveblocks-CVGPqYnR.js";import{a as f}from"./sentry-vrLJXbkU.js";import{j as B,u as U,h as T,g as v,N as L,k as j,l as O,n as $,o as h}from"./core-B4ZvHvvY.js";import{eL as N,LT as A,Lz as b,wM as w,wG as F,wK as I,wz as z,LB as W,wC as q,wO as G,wN as E}from"./zeni-epic-state-Da4VO2lv.js";import{m as P,z as k,B as V,a1 as K,bu as M,aa as _,bv as H}from"./index-DmE4wSNC.js";import"./mui-DoY7WfR_.js";import{i as J}from"./ReimbursementApprovalRuleDetailScreen-DWpP5dnv.js";import Q from"./NotFoundScreen-Dw_4aXSt.js";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},o=new e.Error().stack;o&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[o]="b2ac5595-dd75-41ef-92ad-9be7d3fe5495",e._sentryDebugIdIdentifier="sentry-dbid-b2ac5595-dd75-41ef-92ad-9be7d3fe5495")}catch{}})();const R="bill-approval-rule-update",X=j(function(e){return{approvalView:A(e),billPaySetupApproverViewUpdateData:b(e).billPaySetupApproverViewUpdateData}},function(e,o){const{navigate:t,location:p}=o;return{onApprovalRulesEventReceived:a=>{a.endsWith(R)&&e(W(!1))},onBackClick:()=>{_(p)?t("../../"):t("../../../bills/setup")},onDeleteRuleClick:a=>{e(z(a))},onEditRuleClick:a=>{a!=null?(e(I(a)),t(`./${a}/edit`)):(e(I()),t("./new"))}}})(K(M)),Y=()=>{const e=B(),o=U(),t=T(),[p,a]=f.useState(!1),[u,s]=f.useState(!1),d=P(),n=v(i=>i.billPaySetupApproverViewState.fetchState),c=v(i=>N(i)),r=v(i=>A(i)),g=v(i=>b(i).billPaySetupApproverViewUpdateData);if(f.useEffect(()=>{g?.updateStatus.fetchState==="Completed"&&t(w())},[g]),f.useEffect(()=>{p||n!=="Not-Started"||(a(!0),t(F(!0)))},[p,n,t]),k.getSignedInUser()==null)throw Error("Can't access billpay approval without signing in...");f.useEffect(()=>{r.allApprovalRules.length===0&&r.fetchState==="Completed"&&(u||(s(!0),t(I())),e("./new"))},[u,r,t]);const y={events:c.companyId!=null?[`private-${c.companyId}.${R}`]:[],eventCallback:(i,x,m)=>{i.endsWith(R)&&m.onApprovalRulesEventReceived(i)}};return c.companyBillPayInfo?.info?.isBillPayTOSAccepted===!1?l.jsx(L,{to:"../../promo"}):c.companyBillPayInfo?.info?.isBillPayTOSAccepted!==!0||r.fetchState!=="Completed"&&r.fetchState!=="Error"?l.jsx(V,{fetchState:"In-Progress",style:{backgroundColor:d.colors.grey5}}):l.jsx(X,{currentTenant:c,location:o,navigate:e,...y})},Z=j(function(e,o){const t=b(e),p=t.billPaySetupApproverViewUpdateData?.type??"approval_create",a=p==="approval_create"&&t.allApprovalRules.length!==0;let u=t.allApprovalRules.length===0;return o.approvalRuleId&&(u=t.allApprovalRules.findIndex(s=>s.approvalRuleId===o.approvalRuleId)===0),{localData:t,hideUpperBoundField:a,isLowerBoundDisabled:u,approvalUpdateActionType:p}},function(e,o){const{navigate:t,approvalUpdateDataView:p,approverViewData:a,approvalRuleId:u}=o,s=p.billPaySetupApproverViewUpdateData?.type,d=_(o.location);return{onApprovalRuleDataUpdated:n=>{const c=r=>{const g=[];return r.forEach(y=>{const i=y.actors.selectedUsers.map(S=>({type:"user",userId:S.userId,isImplicitActor:!1})),x=y.actors.selectedNonUsers.map(S=>{const C=!!J(S.value);return{type:C?"attribute":"role",subType:S.value,userId:void 0,idType:void 0,isImplicitActor:!C}}),m=i.concat(x);g.push({action:y.stepType.selectedOption,actors:m,operator:m.length>1?y.stepType.selectedOption==="require_approval"?"or":"and":"is"})}),g};if(s==="approval_create"){const r={criteria:{rangeType:"range",rangeEntity:"currency",range:{min:{amount:n.lowerBound,currencyCode:"USD",currencySymbol:"$"},max:{amount:n.upperBound,currencyCode:"USD",currencySymbol:"$"}}},steps:c(n.steps),isApplicableOnPendingApprovalEntity:n.applyToExistingBills.includes("applyToExistingBills")};e(E(r))}else{const r={approvalRuleId:u,criteria:{rangeType:"range",rangeEntity:"currency",range:{min:{amount:n.lowerBound,currencyCode:"USD",currencySymbol:"$"},max:{amount:n.upperBound,currencyCode:"USD",currencySymbol:"$"}}},steps:c(n.steps),isApplicableOnPendingApprovalEntity:n.applyToExistingBills.includes("applyToExistingBills")};e(E(r))}},onResetClick:()=>{e(w()),s==="approval_update"||d?t("../"):a.allApprovalRules.length===0&&a.fetchState==="Completed"?t("../../setup"):t("../")},onBackClick:()=>{e(w()),s==="approval_update"||d?t("../"):a.allApprovalRules.length===0&&a.fetchState==="Completed"?t("../../setup"):t("../")},onSaveRuleClick:()=>{e(G())},onSaveRuleSuccess:()=>{t("../")}}})(H);function D(){const e=B(),o=T(),t=U(),{approvalRuleId:p}=O(),a=k.getSignedInUser(),u=P(),s=v(r=>b(r)),d=v(r=>A(r)),[n,c]=f.useState(!1);if(f.useEffect(()=>{n||(c(!0),o(q(!0)))}),f.useEffect(()=>{d.fetchState==="Not-Started"&&e(p!=null?"../../":"../")},[d,p]),a==null)throw Error("Can't access address page without signing in...");return s.approverListFetchStatus.fetchState=="Not-Started"||s.approverListFetchStatus.fetchState==="In-Progress"?l.jsx(V,{fetchState:s.approverListFetchStatus.fetchState,style:{backgroundColor:u.colors.grey5}}):l.jsx(Z,{navigate:e,approvalUpdateDataView:s,approvalRuleId:p,approverViewData:d,location:t})}function se(){return l.jsxs($,{children:[l.jsx(h,{path:"/",element:l.jsx(Y,{})}),l.jsx(h,{path:"/new",element:l.jsx(D,{})}),l.jsx(h,{path:"/:approvalRuleId/edit",element:l.jsx(D,{})}),l.jsx(h,{path:"*",element:l.jsx(Q,{})})]})}export{se as B};
1
+ import{j as l}from"./liveblocks-CVGPqYnR.js";import{a as f}from"./sentry-vrLJXbkU.js";import{j as B,u as U,h as T,g as v,N as L,k as j,l as O,n as $,o as h}from"./core-B4ZvHvvY.js";import{eL as N,LT as A,Lz as b,wM as w,wG as F,wK as I,wz as z,LB as W,wC as q,wO as G,wN as E}from"./zeni-epic-state-Da4VO2lv.js";import{m as P,z as k,B as V,a1 as K,bu as M,aa as _,bv as H}from"./index-DgzG0i4n.js";import"./mui-DoY7WfR_.js";import{i as J}from"./ReimbursementApprovalRuleDetailScreen-BVKZCEAO.js";import Q from"./NotFoundScreen-jPpbDlQd.js";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},o=new e.Error().stack;o&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[o]="b2ac5595-dd75-41ef-92ad-9be7d3fe5495",e._sentryDebugIdIdentifier="sentry-dbid-b2ac5595-dd75-41ef-92ad-9be7d3fe5495")}catch{}})();const R="bill-approval-rule-update",X=j(function(e){return{approvalView:A(e),billPaySetupApproverViewUpdateData:b(e).billPaySetupApproverViewUpdateData}},function(e,o){const{navigate:t,location:p}=o;return{onApprovalRulesEventReceived:a=>{a.endsWith(R)&&e(W(!1))},onBackClick:()=>{_(p)?t("../../"):t("../../../bills/setup")},onDeleteRuleClick:a=>{e(z(a))},onEditRuleClick:a=>{a!=null?(e(I(a)),t(`./${a}/edit`)):(e(I()),t("./new"))}}})(K(M)),Y=()=>{const e=B(),o=U(),t=T(),[p,a]=f.useState(!1),[u,s]=f.useState(!1),d=P(),n=v(i=>i.billPaySetupApproverViewState.fetchState),c=v(i=>N(i)),r=v(i=>A(i)),g=v(i=>b(i).billPaySetupApproverViewUpdateData);if(f.useEffect(()=>{g?.updateStatus.fetchState==="Completed"&&t(w())},[g]),f.useEffect(()=>{p||n!=="Not-Started"||(a(!0),t(F(!0)))},[p,n,t]),k.getSignedInUser()==null)throw Error("Can't access billpay approval without signing in...");f.useEffect(()=>{r.allApprovalRules.length===0&&r.fetchState==="Completed"&&(u||(s(!0),t(I())),e("./new"))},[u,r,t]);const y={events:c.companyId!=null?[`private-${c.companyId}.${R}`]:[],eventCallback:(i,x,m)=>{i.endsWith(R)&&m.onApprovalRulesEventReceived(i)}};return c.companyBillPayInfo?.info?.isBillPayTOSAccepted===!1?l.jsx(L,{to:"../../promo"}):c.companyBillPayInfo?.info?.isBillPayTOSAccepted!==!0||r.fetchState!=="Completed"&&r.fetchState!=="Error"?l.jsx(V,{fetchState:"In-Progress",style:{backgroundColor:d.colors.grey5}}):l.jsx(X,{currentTenant:c,location:o,navigate:e,...y})},Z=j(function(e,o){const t=b(e),p=t.billPaySetupApproverViewUpdateData?.type??"approval_create",a=p==="approval_create"&&t.allApprovalRules.length!==0;let u=t.allApprovalRules.length===0;return o.approvalRuleId&&(u=t.allApprovalRules.findIndex(s=>s.approvalRuleId===o.approvalRuleId)===0),{localData:t,hideUpperBoundField:a,isLowerBoundDisabled:u,approvalUpdateActionType:p}},function(e,o){const{navigate:t,approvalUpdateDataView:p,approverViewData:a,approvalRuleId:u}=o,s=p.billPaySetupApproverViewUpdateData?.type,d=_(o.location);return{onApprovalRuleDataUpdated:n=>{const c=r=>{const g=[];return r.forEach(y=>{const i=y.actors.selectedUsers.map(S=>({type:"user",userId:S.userId,isImplicitActor:!1})),x=y.actors.selectedNonUsers.map(S=>{const C=!!J(S.value);return{type:C?"attribute":"role",subType:S.value,userId:void 0,idType:void 0,isImplicitActor:!C}}),m=i.concat(x);g.push({action:y.stepType.selectedOption,actors:m,operator:m.length>1?y.stepType.selectedOption==="require_approval"?"or":"and":"is"})}),g};if(s==="approval_create"){const r={criteria:{rangeType:"range",rangeEntity:"currency",range:{min:{amount:n.lowerBound,currencyCode:"USD",currencySymbol:"$"},max:{amount:n.upperBound,currencyCode:"USD",currencySymbol:"$"}}},steps:c(n.steps),isApplicableOnPendingApprovalEntity:n.applyToExistingBills.includes("applyToExistingBills")};e(E(r))}else{const r={approvalRuleId:u,criteria:{rangeType:"range",rangeEntity:"currency",range:{min:{amount:n.lowerBound,currencyCode:"USD",currencySymbol:"$"},max:{amount:n.upperBound,currencyCode:"USD",currencySymbol:"$"}}},steps:c(n.steps),isApplicableOnPendingApprovalEntity:n.applyToExistingBills.includes("applyToExistingBills")};e(E(r))}},onResetClick:()=>{e(w()),s==="approval_update"||d?t("../"):a.allApprovalRules.length===0&&a.fetchState==="Completed"?t("../../setup"):t("../")},onBackClick:()=>{e(w()),s==="approval_update"||d?t("../"):a.allApprovalRules.length===0&&a.fetchState==="Completed"?t("../../setup"):t("../")},onSaveRuleClick:()=>{e(G())},onSaveRuleSuccess:()=>{t("../")}}})(H);function D(){const e=B(),o=T(),t=U(),{approvalRuleId:p}=O(),a=k.getSignedInUser(),u=P(),s=v(r=>b(r)),d=v(r=>A(r)),[n,c]=f.useState(!1);if(f.useEffect(()=>{n||(c(!0),o(q(!0)))}),f.useEffect(()=>{d.fetchState==="Not-Started"&&e(p!=null?"../../":"../")},[d,p]),a==null)throw Error("Can't access address page without signing in...");return s.approverListFetchStatus.fetchState=="Not-Started"||s.approverListFetchStatus.fetchState==="In-Progress"?l.jsx(V,{fetchState:s.approverListFetchStatus.fetchState,style:{backgroundColor:u.colors.grey5}}):l.jsx(Z,{navigate:e,approvalUpdateDataView:s,approvalRuleId:p,approverViewData:d,location:t})}function se(){return l.jsxs($,{children:[l.jsx(h,{path:"/",element:l.jsx(Y,{})}),l.jsx(h,{path:"/new",element:l.jsx(D,{})}),l.jsx(h,{path:"/:approvalRuleId/edit",element:l.jsx(D,{})}),l.jsx(h,{path:"*",element:l.jsx(Q,{})})]})}export{se as B};
@@ -1,4 +1,4 @@
1
- import{j as a}from"./liveblocks-CVGPqYnR.js";import{j as K,h as re,u as Q,l as te,g as v,N as ee,k as Y,i as la,n as sa,o as y}from"./core-B4ZvHvvY.js";import{eL as Z,L9 as Oe,bu as At,Gf as ra,bn as xt,bC as pe,La as Bt,w4 as Et,xe as Ue,wD as ca,bm as je,Lb as da,Lc as ua,b$ as pa,Ld as ma,j6 as Dt,Le as jt,Lf as Tt,xP as Me,wj as Be,Lg as ba,vU as it,Lh as ha,A$ as ga,vY as Sa,w2 as Pt,Li as Ie,Lj as Ne,xf as ze,Lk as ya,Ll as fa,xi as Ze,Lm as Ia,xv as va,Ln as Ft,w$ as ot,x4 as ka,Lo as wa,Lp as ue,Lq as Lt,Lr as Rt,Ls as Vt,fF as Ca,wo as _e,ct as $t,Lt as Aa,gw as xa,Lu as Ba,Lv as Ea,eS as Ut,eQ as _t,Lw as He,Lx as Da,Ly as ja,IU as We,Lz as Ta,IV as ie,IW as qe,LA as Pa,LB as Fa,LC as La,x6 as lt,x3 as Ra,LD as Va,LE as $a,LF as Ua,wR as _a,LG as Ga,LH as Oa,LI as Ma,cN as Gt,cJ as Ot,jh as Na,bI as za,bp as Mt,bJ as Nt,va as Za,LJ as Ha,AO as Wa,AU as qa,rO as Ja,xg as Ka,xW as Qa,ju as fe,LK as Ya,LL as zt,jY as Xa,jo as Zt,jJ as Ht,jI as st,bB as be,bH as en,LM as tn,LN as ve,h$ as an,LO as rt,LP as nn,i3 as on,iq as ln,y8 as sn,LQ as rn,jR as cn,x_ as dn,LR as ct,y2 as un,y7 as pn,y4 as mn,xY as bn,LS as Wt,wd as hn,LT as gn,LU as Sn,fz as yn,fy as fn,fx as In,jx as vn,jP as dt,j_ as kn,pl as wn,jG as Cn,y0 as An,i9 as xn,k3 as Bn,LV as En,i1 as Dn,pc as jn,LW as Tn,wX as Pn,bD as Fn,br as Ln,HX as Rn,cL as Vn,cK as $n,cs as Un,cy as _n}from"./zeni-epic-state-Da4VO2lv.js";import{m as me,z as R,S as ke,J as Je,Z as oe,i as S,aI as Ee,B as ce,o as E,s as Te,c as j,b1 as Gn,p as z,R as Ke,q as D,K as we,b2 as ut,b3 as pt,b4 as On,af as Mn,C as Nn,aC as zn,x as qt,D as Qe,E as Ye,b5 as Zn,ao as Jt,b6 as Hn,M as Wn,e as Kt,a1 as qn,b7 as Jn,b8 as Kn,b9 as Qn,ba as Yn,bb as Xn,bc as ei,bd as ti,be as ai,bf as ni,F as ii,bg as oi,aZ as li,bh as si,bi as ri,a4 as ci}from"./index-DmE4wSNC.js";import{n as V,S as di}from"./mui-DoY7WfR_.js";import{A as mt}from"./AddressScreen-Cud2BdS6.js";import{g as ne,a as Pe,i as Qt,V as Xe,b as et,c as ui,v as pi,d as mi,A as he,D as ge}from"./DomesticWireDetailScreen-C-F8590D.js";import{a as f}from"./sentry-vrLJXbkU.js";import{u as tt}from"./useAskAiCfoHostNavButtonProps-Djdv5hKX.js";import{c as at}from"./useFetchSuggestedQuestionsWhenReady-Cfhk-A1n.js";import{u as Yt}from"./useInitialThreadRequest-CxCt8-bu.js";import De from"./NotFoundScreen-Dw_4aXSt.js";import{D as bi}from"./DrawerScreen-D8_xICtn.js";import{M as Xt}from"./MobileAppDrawer-DVJrG_df.js";import{F as ea}from"./FeaturePreviewScreen-BdQUVLIb.js";import{S as Le}from"./SetupPagesScreen-B82yEDYc.js";import{B as hi}from"./BillPayApprovalRoutes-a0Eum5ly.js";import{FallBackRoute as gi}from"./ScreenRoutes-_VyWuy4j.js";import"./recharts-DNFnaP_v.js";import"./lottie-B5aSI3Li.js";import"./analytics-BL0geQNn.js";import"./plaid-C1RHGEem.js";import"./dnd-B2_m6pRT.js";import"./stripe-DMRn4zHo.js";import"./lexical-DA5yMmPj.js";import"./pdf-ChIJqwGf.js";import"./utils-QMlevttK.js";import"./analyticsHelper-ZM4U1wiv.js";import"./routePaths-BbBoI9fr.js";import"./BusinessVerificationPageScreen-ByeCoum9.js";import"./ReimbursementApprovalRuleDetailScreen-DWpP5dnv.js";import"./getLocaleForTenant-7ntdeZSs.js";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="744a57ef-8785-4ce0-b336-4126c2e60fa9",e._sentryDebugIdIdentifier="sentry-dbid-744a57ef-8785-4ce0-b336-4126c2e60fa9")}catch{}})();const Si=Y(function(e,t){const l=Oe(e,t.billId),n=R.getSignedInUser(),c=e.tenantState.currentTenantId,r={userId:n?.userId??"",sessionId:n?.zeniSessionId??"",tenantId:c??""},u=z(t.location.state?.pathnameStackToGoBack);let o=!0;u.poppedPathname?.includes("bills")===!0&&(o=!1);let s=`${l.createdBy?.firstName??"Zeni"} ${l.createdBy?.lastName??""}`;const i=je(n);i||!l.createdBy?.email?.includes("zeni.ai")||(s="Zeni");let d=!1,p=!1;if(l?.billActivities.length>0){const{isApprovalorRejectBtnVisible:m,isMarkAsPaidBtnVisible:b}=da(l.billActivities,ua(t.currentTenant),n);d=m,p=b}const h=pa(t.currentTenant?.userRole??[]),g=l.transactionDetails!=null&&ma(l.transactionDetails,h,n);return{billDetails:l,isAccountingClassesEnabled:Dt(e),createdBy:s,authParams:r,transactionAttachmentEndpoint:`${Ke}/transaction_attachment`,signedInUser:n,showBackButton:o,isAdmin:h,isRealTimeApprovalEnabled:t.isRealTimeApprovalEnabled,showApproveRejectBtns:d,showMarkAsPaidButtonToApprover:p,hasZeniAssistAccess:t.hasZeniAssistAccess,analytics:j,showMarkAsPaidButtonToCreator:g,isZeniUser:i}},function(e,t){const{billId:l,currentTenant:n,location:c,navigate:r}=t,{tenantEmailDomain:u}=n;return{redirectToBillsScreen:()=>{const o=ne(u),s=D(c.state?.pathnameStackToGoBack,c.pathname);r(o,{state:{pathnameStackToGoBack:s}})},redirectToEditableBillScreen:()=>{const o=D(c.state?.pathnameStackToGoBack,c.pathname);r("./edit",{state:{pathnameStackToGoBack:o}})},discardBillDetailsFromLocalStore:()=>{e(Ie({}))},deleteBill:o=>{j.trackBillPayDeleteBill(l,o),e(Pt(l))},cancelAndDeleteBill:(o,s)=>{s===!0?j.trackBillPayCancelAndDeleteBill(l,o):j.trackBillPayCancelBill(l),e(Sa(l,s))},onSaveRealTimeApprovals:o=>{e(ga(l,"bill_pay",o))},updateEditRealTimeApproverClicked:o=>{e(ha({isEdit:o,entityId:l,entityType:"bill_pay"}))},approveOrRejectBill:o=>{o.type==="approved"?e(it(l,o.type,"")):e(it(l,o.type,o.description??""))},retryOrRefundBill:o=>{o.type==="retry"?e(Be(l,"retry")):e(Be(l,"refund"))},onAddNewRule:()=>{r("../../bills/approval-rules")},onAttachmentClick:(o,s)=>{const i=Pe(u,o,s),d=D(c.state?.pathnameStackToGoBack,c.pathname);r(i,{state:{pathnameStackToGoBack:d}})},onBackClick:()=>{const o=z(t.location.state?.pathnameStackToGoBack),s=o.poppedPathname??ne(u);r(s,{state:{pathnameStackToGoBack:o.newStack}})},onRetryPaymentClick:()=>{const o=D(c.state?.pathnameStackToGoBack,c.pathname);r("./edit",{state:{pathnameStackToGoBack:o}}),e(ba({billId:t.billId}))},onRefundPaymentClick:()=>{e(Be(t.billId,"refund"))},saveBillDetails:(o,s,i)=>{o&&e(Tt({data:i,billId:l})),e(Me(o?"paid":"pending_approval",o,s,l))},discardOutsideZeniPaymentData:()=>{e(jt({billId:l}))}}})(Gn);function yi(){const e=K(),t=re(),l=Q(),{billId:n}=te(),c=me(),r=R.getSignedInUser(),u=ke(),o=v(w=>Z(w)),s=v(w=>Oe(w,n??"")),i=s.transactionDetails?.billPayInfo.stage.code==="draft"&&s.transactionDetails.isDeleted===!1,d=Yt(o?.companyId,{clearParams:s.fetchState==="Completed"&&!i}),{isAiCfoOpen:p,setIsAiCfoOpen:h}=Je(),{isAiCfoAccessEnabled:g,onAskAiCfoClick:m}=tt({isAiCfoOpen:p,setIsAiCfoOpen:h,mobileExploreReferrer:"Bill Details"});at({isDataReady:s.fetchState==="Completed"});const b=o?.userRole!=null&&At(o?.userRole),A=o?.company==null||o.company.featuresActivationInfo?.isBillPayFeatureEnabled&&!b,[T,I]=f.useState(!1),[k,H]=f.useState(!1),[_,G]=f.useState(!1),{useFeatureGate:F,useDynamicConfig:x}=oe(),{isFeatureEnabled:$}=F(S.isShowDeletedBillsFeatureEnabled),{isFeatureEnabled:U}=F(S.isBillPayCommentingEnabled),{isFeatureEnabled:B}=F(S.isBillPayDetectInsufficientFundsEnabled),{configValue:M}=x(Ee.zeniAssistConfig),W=ra(o),q=xt(o.userRole),J=A&&pe(u?.loggedInUserRoleMap),O=M.user_ids!=null&&r?.userId!=null&&M.user_ids.includes(r?.userId),{isFeatureEnabled:le}=F(S.isInternationalPaymentShaVsOurFeatureEnabled),{isFeatureEnabled:X}=F(S.billPaySetupShowInternationalPaymentByWise);if(f.useEffect(()=>{$&&s.transactionDetails?.isDeleted===!0||o.isZeni===!0&&r?.userEmailDomain==="zeni.ai"&&W===!1?G(!1):G(s.billActivities[0]?.isRealTimeApprovalEnabled&&(q||J||s.allApprovers.find(w=>w.user.userId===r?.userId)!=null||s.transactionDetails?.lastUpdatedByUserId===r?.userId))},[s.billActivities[0]?.isRealTimeApprovalEnabled,s.allApprovers,s.transactionDetails?.lastUpdatedByUserId,q,J,o.isZeni,W,r]),f.useEffect(()=>{n!=null&&t(Bt(n))},[n]),f.useEffect(()=>{T||s.fetchState=="Completed"||s.fetchState=="In-Progress"||(I(!0),t(Et(n??"",$,O,!1)))},[T,s,n,t]),f.useEffect(()=>{k||s.fetchState!="Completed"||s.transactionDetails?.billPayInfo.stage.code=="paid"||(H(!0),t(Ue(!1,$,O,X,n)),s.billActivities[0]?.isRealTimeApprovalEnabled===!0&&t(ca()))},[k,s,n,t]),r==null)throw Error("Can't access address page without signing in...");return s.transactionDetails?.billPayInfo.stage.code==="draft"&&s.transactionDetails.isDeleted===!1?a.jsx(ee,{to:`./edit${l.search}`}):s.deleteStatus.fetchState==="In-Progress"||s.cancelAndDeleteStatus.fetchState==="In-Progress"||s.cancelStatus.fetchState==="In-Progress"?a.jsx(ce,{fetchState:s.deleteStatus.fetchState,style:{boxShadow:`0px 2px ${E.sp1} ${c.colors.dropShadowNormal}`}}):a.jsxs(a.Fragment,{children:[a.jsx(Te,{analytics:j,onLoad:w=>(se=>{n!=null&&se.trackBillPayBillDetails(n,s.isRecurring)})(w)}),a.jsx(Si,{initialOpenThreadRequest:d??void 0,isShowDeletedBillsEnabled:$,location:l,navigate:e,isBillPayCommentingEnabled:U,isRealTimeApprovalEnabled:_,currentTenant:o,billId:n??"",isInternationalPaymentShaVsOurEnabled:le,hasZeniAssistAccess:O,isDetectInsufficientFundsEnabled:B,isAiCfoAccessEnabled:g,onAskAiCfoClick:m})]})}const Se=Qe.getLocalizedStrings().spendManagement.billPay.billDetails,fi={containerWidth:new qt(100,58)},bt=Y(function(e,t){const l=R.getSignedInUser(),n=e.tenantState.currentTenantId,c={userId:l?.userId??"",sessionId:l?.zeniSessionId??"",tenantId:n??""},r=t.showActionButtons,u=r&&t.file==null;return{uploadInvoiceEndPoint:`${Jt.communicationAgentMicroServiceBaseUrl}`,authParams:c,billId:t.billId,file:t.file,showAutofill:t.showAutofill,analytics:j,entityId:t.billId,showTitlebarIcon:r,showTitlebar:r&&t?.file!=null,uploadStatus:t.uploadStatus,shouldNotShowAttachment:u,style:{paddingTop:E.sp10,paddingRight:E.sp3,paddingBottom:"15px",paddingLeft:E.sp5,...t.showAutofill?{}:{backgroundColor:t.backgroundColor,paddingBottom:"128px"}}}},function(e,t){const l=R.getSignedInUser();return{onInvoiceUpload:n=>{n!=null&&(t.file!=null||t.billId!=null||t.isInitialEdit?(t.setPayload(n),t.setShowConfirmationPopup(!0)):e(Ze(n,t.isVendorRecommendationEnabled,t.billId)))},updateInvoiceUploadFetchState:n=>{e(va({fetchState:{fetchState:n,error:void 0},billId:t.billId}))},onSkipAutofill:n=>{j?.trackBillPaySkipAutofill(),e(ze(n))},onDeleteClick:()=>{e(Ia({billId:t.billId})),j?.trackInvoiceActionClick(t.billStage??"","delete",l?.userEmail??"",null)}}})(zn);function C({appContent:e}){const t=re(),l=K(),{billId:n}=te(),c=Q(),r=c.pathname,u=r.includes("bill/new")||r.includes("/edit"),o=we(),s=me(),i=R.getSignedInUser(),{useFeatureGate:d,useDynamicConfig:p}=oe(),{isFeatureEnabled:h}=d(S.isVendorRecommendationFeatureEnabled),{isFeatureEnabled:g}=d(S.isShowDeletedBillsFeatureEnabled),{isFeatureEnabled:m}=d(S.isDepositAccountsFeatureEnabled),{isFeatureEnabled:b}=d(S.billPaySetupShowInternationalPaymentByWise),{configValue:A}=p(Ee.zeniAssistConfig),T=A.user_ids!=null&&i?.userId!=null&&A.user_ids.includes(i?.userId),I=v(w=>Z(w)),[k,H]=f.useState(!1),[_,G]=f.useState(!1),[F,x]=f.useState(!1),[$,U]=f.useState(),B=v(w=>Ne(w,h,m,n));let M=B.fetchState,W=B.file,q=B.showAutofill;const J=v(w=>Oe(w,n??""));u===!1&&(M=J.fetchState,W=J.transactionDetails?.attachments?.[0],q=!1);const O=B.billPayInfo!=null&&B.billPayInfo.stage.code==="pending_approval"?B.billPayInfo.billStatus.code:B.billStage;f.useEffect(()=>{n==null&&t(ze(!0))},[n,t]),f.useEffect(()=>{M==="Not-Started"&&(u&&_?G(!1):!u&&k&&H(!1))},[n]),f.useEffect(()=>{k||n==null||u||(H(!0),t(Et(n,g,T,!1)),_||(G(!0),t(Ue(!1,g,T,b,n)))),u&&!_&&(G(!0),t(Ue(!1,g,T,b,n)))},[k,_,u,n,t]);const le={onOkClick:()=>{if(x(!1),!$)return;const w=W!=null?"replace":"upload";j?.trackInvoiceActionClick(O??"",w,i?.userEmail??"","yes"),t(fa({replaceBillData:!0,billId:n})),t(Ze($,h,n))},onCancelClick:()=>{if(x(!1),!$)return;const w=W!=null?"replace":"upload";j?.trackInvoiceActionClick(O??"",w,i?.userEmail??"","no"),t(ya({file:$,billId:n}))}},X=f.useCallback(()=>{const w=z(c.state?.pathnameStackToGoBack),se=w.poppedPathname??ne(I.tenantEmailDomain);t(Ie({billId:n})),l(se,{state:{pathnameStackToGoBack:w.newStack}})},[c.state,I.tenantEmailDomain,n,t,l]);if(i==null)throw Error("Can't access address page without signing in...");if(M==="Error"||J.fetchState==="Error")return a.jsx(De,{});if(M!="Completed")return n==null&&o!=="small"?a.jsx(ut,{fallback:X,children:a.jsxs(Re,{windowSize:o,children:[a.jsx(gt,{}),a.jsx(Ve,{}),a.jsx(bt,{backgroundColor:s.colors.grey4,billId:n,file:W,showAutofill:!0,uploadStatus:B.uploadStatus,isVendorRecommendationEnabled:h,attachmentTitle:void 0,setShowConfirmationPopup:x,setPayload:U,showActionButtons:!1,isInitialEdit:!!B.isInitialEdit,billStage:O}),a.jsx($e,{windowSize:o,children:a.jsx(pt,{})})]})}):a.jsxs(Re,{windowSize:o,children:[o==="small"||q?null:a.jsx(ht,{children:a.jsx(ta,{onClick:X})}),o!=="small"?a.jsx(Ve,{}):null,a.jsx(On,{}),a.jsx($e,{windowSize:o,children:a.jsx(pt,{})})]});{const w=B.billPayInfo!=null&&B.billPayInfo.stage.code==="pending_approval"?B.billPayInfo.billStatus.code:B.billStage;return a.jsx(ut,{fallback:X,children:a.jsxs(Re,{windowSize:o,children:[q&&o!=="small"?a.jsx(gt,{}):null,F?a.jsx(Mn,{titleComponent:a.jsx(xi,{children:Se.overwriteTitle}),descriptionComponent:a.jsx(Bi,{children:Se.overwriteDescription}),primaryButtonText:Se.buttons.yes,secondaryButtonText:Se.buttons.no,action:le,isEditPopup:!0}):null,o==="small"||q?null:a.jsx(ht,{children:a.jsx(Ii,{})}),o!=="small"?a.jsx(Ve,{}):null,a.jsx(bt,{backgroundColor:s.colors.grey4,billId:n,file:W,showAutofill:q,uploadStatus:B.uploadStatus,isVendorRecommendationEnabled:h,attachmentTitle:vi(u,J,B),setShowConfirmationPopup:x,setPayload:U,showActionButtons:ki(u,B),isInitialEdit:!!B.isInitialEdit,billStage:w}),a.jsx($e,{windowSize:o,children:e})]})})}}function Ii(){const{triggerBack:e}=Zn();return a.jsx(ta,{onClick:e})}function vi(e,t,l){let n,c;return e?(n=l.recurringConfig?.currentInstance,c=l.recurringConfig?.totalPaymentCycles):(n=t.transactionDetails?.recurringBillInstance,c=t.recurringBillConfigDetail?.totalPaymentCycles),t?.isRecurring===!0?a.jsxs(wi,{children:[a.jsx(Ci,{children:`${Se.recurringBill.recurringCycle}
1
+ import{j as a}from"./liveblocks-CVGPqYnR.js";import{j as K,h as re,u as Q,l as te,g as v,N as ee,k as Y,i as la,n as sa,o as y}from"./core-B4ZvHvvY.js";import{eL as Z,L9 as Oe,bu as At,Gf as ra,bn as xt,bC as pe,La as Bt,w4 as Et,xe as Ue,wD as ca,bm as je,Lb as da,Lc as ua,b$ as pa,Ld as ma,j6 as Dt,Le as jt,Lf as Tt,xP as Me,wj as Be,Lg as ba,vU as it,Lh as ha,A$ as ga,vY as Sa,w2 as Pt,Li as Ie,Lj as Ne,xf as ze,Lk as ya,Ll as fa,xi as Ze,Lm as Ia,xv as va,Ln as Ft,w$ as ot,x4 as ka,Lo as wa,Lp as ue,Lq as Lt,Lr as Rt,Ls as Vt,fF as Ca,wo as _e,ct as $t,Lt as Aa,gw as xa,Lu as Ba,Lv as Ea,eS as Ut,eQ as _t,Lw as He,Lx as Da,Ly as ja,IU as We,Lz as Ta,IV as ie,IW as qe,LA as Pa,LB as Fa,LC as La,x6 as lt,x3 as Ra,LD as Va,LE as $a,LF as Ua,wR as _a,LG as Ga,LH as Oa,LI as Ma,cN as Gt,cJ as Ot,jh as Na,bI as za,bp as Mt,bJ as Nt,va as Za,LJ as Ha,AO as Wa,AU as qa,rO as Ja,xg as Ka,xW as Qa,ju as fe,LK as Ya,LL as zt,jY as Xa,jo as Zt,jJ as Ht,jI as st,bB as be,bH as en,LM as tn,LN as ve,h$ as an,LO as rt,LP as nn,i3 as on,iq as ln,y8 as sn,LQ as rn,jR as cn,x_ as dn,LR as ct,y2 as un,y7 as pn,y4 as mn,xY as bn,LS as Wt,wd as hn,LT as gn,LU as Sn,fz as yn,fy as fn,fx as In,jx as vn,jP as dt,j_ as kn,pl as wn,jG as Cn,y0 as An,i9 as xn,k3 as Bn,LV as En,i1 as Dn,pc as jn,LW as Tn,wX as Pn,bD as Fn,br as Ln,HX as Rn,cL as Vn,cK as $n,cs as Un,cy as _n}from"./zeni-epic-state-Da4VO2lv.js";import{m as me,z as R,S as ke,J as Je,Z as oe,i as S,aI as Ee,B as ce,o as E,s as Te,c as j,b1 as Gn,p as z,R as Ke,q as D,K as we,b2 as ut,b3 as pt,b4 as On,af as Mn,C as Nn,aC as zn,x as qt,D as Qe,E as Ye,b5 as Zn,ao as Jt,b6 as Hn,M as Wn,e as Kt,a1 as qn,b7 as Jn,b8 as Kn,b9 as Qn,ba as Yn,bb as Xn,bc as ei,bd as ti,be as ai,bf as ni,F as ii,bg as oi,aZ as li,bh as si,bi as ri,a4 as ci}from"./index-DgzG0i4n.js";import{n as V,S as di}from"./mui-DoY7WfR_.js";import{A as mt}from"./AddressScreen-B-90Ns9M.js";import{g as ne,a as Pe,i as Qt,V as Xe,b as et,c as ui,v as pi,d as mi,A as he,D as ge}from"./DomesticWireDetailScreen-DCV6HQRp.js";import{a as f}from"./sentry-vrLJXbkU.js";import{u as tt}from"./useAskAiCfoHostNavButtonProps-DQFYXydp.js";import{c as at}from"./useFetchSuggestedQuestionsWhenReady-BMFUNkte.js";import{u as Yt}from"./useInitialThreadRequest-C88MW4km.js";import De from"./NotFoundScreen-jPpbDlQd.js";import{D as bi}from"./DrawerScreen-dt2KgJzx.js";import{M as Xt}from"./MobileAppDrawer-eCdBXSxf.js";import{F as ea}from"./FeaturePreviewScreen-C2dbroTQ.js";import{S as Le}from"./SetupPagesScreen-BJy2d6s1.js";import{B as hi}from"./BillPayApprovalRoutes-BeaWY9ga.js";import{FallBackRoute as gi}from"./ScreenRoutes-C36ZBPGp.js";import"./recharts-DNFnaP_v.js";import"./lottie-B5aSI3Li.js";import"./analytics-BL0geQNn.js";import"./plaid-C1RHGEem.js";import"./dnd-B2_m6pRT.js";import"./stripe-DMRn4zHo.js";import"./lexical-DA5yMmPj.js";import"./pdf-ChIJqwGf.js";import"./utils-QMlevttK.js";import"./analyticsHelper-B-IDLpaZ.js";import"./routePaths-WhbiYSxu.js";import"./BusinessVerificationPageScreen-B8mXcNLy.js";import"./ReimbursementApprovalRuleDetailScreen-BVKZCEAO.js";import"./getLocaleForTenant-C50EFRQ8.js";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="744a57ef-8785-4ce0-b336-4126c2e60fa9",e._sentryDebugIdIdentifier="sentry-dbid-744a57ef-8785-4ce0-b336-4126c2e60fa9")}catch{}})();const Si=Y(function(e,t){const l=Oe(e,t.billId),n=R.getSignedInUser(),c=e.tenantState.currentTenantId,r={userId:n?.userId??"",sessionId:n?.zeniSessionId??"",tenantId:c??""},u=z(t.location.state?.pathnameStackToGoBack);let o=!0;u.poppedPathname?.includes("bills")===!0&&(o=!1);let s=`${l.createdBy?.firstName??"Zeni"} ${l.createdBy?.lastName??""}`;const i=je(n);i||!l.createdBy?.email?.includes("zeni.ai")||(s="Zeni");let d=!1,p=!1;if(l?.billActivities.length>0){const{isApprovalorRejectBtnVisible:m,isMarkAsPaidBtnVisible:b}=da(l.billActivities,ua(t.currentTenant),n);d=m,p=b}const h=pa(t.currentTenant?.userRole??[]),g=l.transactionDetails!=null&&ma(l.transactionDetails,h,n);return{billDetails:l,isAccountingClassesEnabled:Dt(e),createdBy:s,authParams:r,transactionAttachmentEndpoint:`${Ke}/transaction_attachment`,signedInUser:n,showBackButton:o,isAdmin:h,isRealTimeApprovalEnabled:t.isRealTimeApprovalEnabled,showApproveRejectBtns:d,showMarkAsPaidButtonToApprover:p,hasZeniAssistAccess:t.hasZeniAssistAccess,analytics:j,showMarkAsPaidButtonToCreator:g,isZeniUser:i}},function(e,t){const{billId:l,currentTenant:n,location:c,navigate:r}=t,{tenantEmailDomain:u}=n;return{redirectToBillsScreen:()=>{const o=ne(u),s=D(c.state?.pathnameStackToGoBack,c.pathname);r(o,{state:{pathnameStackToGoBack:s}})},redirectToEditableBillScreen:()=>{const o=D(c.state?.pathnameStackToGoBack,c.pathname);r("./edit",{state:{pathnameStackToGoBack:o}})},discardBillDetailsFromLocalStore:()=>{e(Ie({}))},deleteBill:o=>{j.trackBillPayDeleteBill(l,o),e(Pt(l))},cancelAndDeleteBill:(o,s)=>{s===!0?j.trackBillPayCancelAndDeleteBill(l,o):j.trackBillPayCancelBill(l),e(Sa(l,s))},onSaveRealTimeApprovals:o=>{e(ga(l,"bill_pay",o))},updateEditRealTimeApproverClicked:o=>{e(ha({isEdit:o,entityId:l,entityType:"bill_pay"}))},approveOrRejectBill:o=>{o.type==="approved"?e(it(l,o.type,"")):e(it(l,o.type,o.description??""))},retryOrRefundBill:o=>{o.type==="retry"?e(Be(l,"retry")):e(Be(l,"refund"))},onAddNewRule:()=>{r("../../bills/approval-rules")},onAttachmentClick:(o,s)=>{const i=Pe(u,o,s),d=D(c.state?.pathnameStackToGoBack,c.pathname);r(i,{state:{pathnameStackToGoBack:d}})},onBackClick:()=>{const o=z(t.location.state?.pathnameStackToGoBack),s=o.poppedPathname??ne(u);r(s,{state:{pathnameStackToGoBack:o.newStack}})},onRetryPaymentClick:()=>{const o=D(c.state?.pathnameStackToGoBack,c.pathname);r("./edit",{state:{pathnameStackToGoBack:o}}),e(ba({billId:t.billId}))},onRefundPaymentClick:()=>{e(Be(t.billId,"refund"))},saveBillDetails:(o,s,i)=>{o&&e(Tt({data:i,billId:l})),e(Me(o?"paid":"pending_approval",o,s,l))},discardOutsideZeniPaymentData:()=>{e(jt({billId:l}))}}})(Gn);function yi(){const e=K(),t=re(),l=Q(),{billId:n}=te(),c=me(),r=R.getSignedInUser(),u=ke(),o=v(w=>Z(w)),s=v(w=>Oe(w,n??"")),i=s.transactionDetails?.billPayInfo.stage.code==="draft"&&s.transactionDetails.isDeleted===!1,d=Yt(o?.companyId,{clearParams:s.fetchState==="Completed"&&!i}),{isAiCfoOpen:p,setIsAiCfoOpen:h}=Je(),{isAiCfoAccessEnabled:g,onAskAiCfoClick:m}=tt({isAiCfoOpen:p,setIsAiCfoOpen:h,mobileExploreReferrer:"Bill Details"});at({isDataReady:s.fetchState==="Completed"});const b=o?.userRole!=null&&At(o?.userRole),A=o?.company==null||o.company.featuresActivationInfo?.isBillPayFeatureEnabled&&!b,[T,I]=f.useState(!1),[k,H]=f.useState(!1),[_,G]=f.useState(!1),{useFeatureGate:F,useDynamicConfig:x}=oe(),{isFeatureEnabled:$}=F(S.isShowDeletedBillsFeatureEnabled),{isFeatureEnabled:U}=F(S.isBillPayCommentingEnabled),{isFeatureEnabled:B}=F(S.isBillPayDetectInsufficientFundsEnabled),{configValue:M}=x(Ee.zeniAssistConfig),W=ra(o),q=xt(o.userRole),J=A&&pe(u?.loggedInUserRoleMap),O=M.user_ids!=null&&r?.userId!=null&&M.user_ids.includes(r?.userId),{isFeatureEnabled:le}=F(S.isInternationalPaymentShaVsOurFeatureEnabled),{isFeatureEnabled:X}=F(S.billPaySetupShowInternationalPaymentByWise);if(f.useEffect(()=>{$&&s.transactionDetails?.isDeleted===!0||o.isZeni===!0&&r?.userEmailDomain==="zeni.ai"&&W===!1?G(!1):G(s.billActivities[0]?.isRealTimeApprovalEnabled&&(q||J||s.allApprovers.find(w=>w.user.userId===r?.userId)!=null||s.transactionDetails?.lastUpdatedByUserId===r?.userId))},[s.billActivities[0]?.isRealTimeApprovalEnabled,s.allApprovers,s.transactionDetails?.lastUpdatedByUserId,q,J,o.isZeni,W,r]),f.useEffect(()=>{n!=null&&t(Bt(n))},[n]),f.useEffect(()=>{T||s.fetchState=="Completed"||s.fetchState=="In-Progress"||(I(!0),t(Et(n??"",$,O,!1)))},[T,s,n,t]),f.useEffect(()=>{k||s.fetchState!="Completed"||s.transactionDetails?.billPayInfo.stage.code=="paid"||(H(!0),t(Ue(!1,$,O,X,n)),s.billActivities[0]?.isRealTimeApprovalEnabled===!0&&t(ca()))},[k,s,n,t]),r==null)throw Error("Can't access address page without signing in...");return s.transactionDetails?.billPayInfo.stage.code==="draft"&&s.transactionDetails.isDeleted===!1?a.jsx(ee,{to:`./edit${l.search}`}):s.deleteStatus.fetchState==="In-Progress"||s.cancelAndDeleteStatus.fetchState==="In-Progress"||s.cancelStatus.fetchState==="In-Progress"?a.jsx(ce,{fetchState:s.deleteStatus.fetchState,style:{boxShadow:`0px 2px ${E.sp1} ${c.colors.dropShadowNormal}`}}):a.jsxs(a.Fragment,{children:[a.jsx(Te,{analytics:j,onLoad:w=>(se=>{n!=null&&se.trackBillPayBillDetails(n,s.isRecurring)})(w)}),a.jsx(Si,{initialOpenThreadRequest:d??void 0,isShowDeletedBillsEnabled:$,location:l,navigate:e,isBillPayCommentingEnabled:U,isRealTimeApprovalEnabled:_,currentTenant:o,billId:n??"",isInternationalPaymentShaVsOurEnabled:le,hasZeniAssistAccess:O,isDetectInsufficientFundsEnabled:B,isAiCfoAccessEnabled:g,onAskAiCfoClick:m})]})}const Se=Qe.getLocalizedStrings().spendManagement.billPay.billDetails,fi={containerWidth:new qt(100,58)},bt=Y(function(e,t){const l=R.getSignedInUser(),n=e.tenantState.currentTenantId,c={userId:l?.userId??"",sessionId:l?.zeniSessionId??"",tenantId:n??""},r=t.showActionButtons,u=r&&t.file==null;return{uploadInvoiceEndPoint:`${Jt.communicationAgentMicroServiceBaseUrl}`,authParams:c,billId:t.billId,file:t.file,showAutofill:t.showAutofill,analytics:j,entityId:t.billId,showTitlebarIcon:r,showTitlebar:r&&t?.file!=null,uploadStatus:t.uploadStatus,shouldNotShowAttachment:u,style:{paddingTop:E.sp10,paddingRight:E.sp3,paddingBottom:"15px",paddingLeft:E.sp5,...t.showAutofill?{}:{backgroundColor:t.backgroundColor,paddingBottom:"128px"}}}},function(e,t){const l=R.getSignedInUser();return{onInvoiceUpload:n=>{n!=null&&(t.file!=null||t.billId!=null||t.isInitialEdit?(t.setPayload(n),t.setShowConfirmationPopup(!0)):e(Ze(n,t.isVendorRecommendationEnabled,t.billId)))},updateInvoiceUploadFetchState:n=>{e(va({fetchState:{fetchState:n,error:void 0},billId:t.billId}))},onSkipAutofill:n=>{j?.trackBillPaySkipAutofill(),e(ze(n))},onDeleteClick:()=>{e(Ia({billId:t.billId})),j?.trackInvoiceActionClick(t.billStage??"","delete",l?.userEmail??"",null)}}})(zn);function C({appContent:e}){const t=re(),l=K(),{billId:n}=te(),c=Q(),r=c.pathname,u=r.includes("bill/new")||r.includes("/edit"),o=we(),s=me(),i=R.getSignedInUser(),{useFeatureGate:d,useDynamicConfig:p}=oe(),{isFeatureEnabled:h}=d(S.isVendorRecommendationFeatureEnabled),{isFeatureEnabled:g}=d(S.isShowDeletedBillsFeatureEnabled),{isFeatureEnabled:m}=d(S.isDepositAccountsFeatureEnabled),{isFeatureEnabled:b}=d(S.billPaySetupShowInternationalPaymentByWise),{configValue:A}=p(Ee.zeniAssistConfig),T=A.user_ids!=null&&i?.userId!=null&&A.user_ids.includes(i?.userId),I=v(w=>Z(w)),[k,H]=f.useState(!1),[_,G]=f.useState(!1),[F,x]=f.useState(!1),[$,U]=f.useState(),B=v(w=>Ne(w,h,m,n));let M=B.fetchState,W=B.file,q=B.showAutofill;const J=v(w=>Oe(w,n??""));u===!1&&(M=J.fetchState,W=J.transactionDetails?.attachments?.[0],q=!1);const O=B.billPayInfo!=null&&B.billPayInfo.stage.code==="pending_approval"?B.billPayInfo.billStatus.code:B.billStage;f.useEffect(()=>{n==null&&t(ze(!0))},[n,t]),f.useEffect(()=>{M==="Not-Started"&&(u&&_?G(!1):!u&&k&&H(!1))},[n]),f.useEffect(()=>{k||n==null||u||(H(!0),t(Et(n,g,T,!1)),_||(G(!0),t(Ue(!1,g,T,b,n)))),u&&!_&&(G(!0),t(Ue(!1,g,T,b,n)))},[k,_,u,n,t]);const le={onOkClick:()=>{if(x(!1),!$)return;const w=W!=null?"replace":"upload";j?.trackInvoiceActionClick(O??"",w,i?.userEmail??"","yes"),t(fa({replaceBillData:!0,billId:n})),t(Ze($,h,n))},onCancelClick:()=>{if(x(!1),!$)return;const w=W!=null?"replace":"upload";j?.trackInvoiceActionClick(O??"",w,i?.userEmail??"","no"),t(ya({file:$,billId:n}))}},X=f.useCallback(()=>{const w=z(c.state?.pathnameStackToGoBack),se=w.poppedPathname??ne(I.tenantEmailDomain);t(Ie({billId:n})),l(se,{state:{pathnameStackToGoBack:w.newStack}})},[c.state,I.tenantEmailDomain,n,t,l]);if(i==null)throw Error("Can't access address page without signing in...");if(M==="Error"||J.fetchState==="Error")return a.jsx(De,{});if(M!="Completed")return n==null&&o!=="small"?a.jsx(ut,{fallback:X,children:a.jsxs(Re,{windowSize:o,children:[a.jsx(gt,{}),a.jsx(Ve,{}),a.jsx(bt,{backgroundColor:s.colors.grey4,billId:n,file:W,showAutofill:!0,uploadStatus:B.uploadStatus,isVendorRecommendationEnabled:h,attachmentTitle:void 0,setShowConfirmationPopup:x,setPayload:U,showActionButtons:!1,isInitialEdit:!!B.isInitialEdit,billStage:O}),a.jsx($e,{windowSize:o,children:a.jsx(pt,{})})]})}):a.jsxs(Re,{windowSize:o,children:[o==="small"||q?null:a.jsx(ht,{children:a.jsx(ta,{onClick:X})}),o!=="small"?a.jsx(Ve,{}):null,a.jsx(On,{}),a.jsx($e,{windowSize:o,children:a.jsx(pt,{})})]});{const w=B.billPayInfo!=null&&B.billPayInfo.stage.code==="pending_approval"?B.billPayInfo.billStatus.code:B.billStage;return a.jsx(ut,{fallback:X,children:a.jsxs(Re,{windowSize:o,children:[q&&o!=="small"?a.jsx(gt,{}):null,F?a.jsx(Mn,{titleComponent:a.jsx(xi,{children:Se.overwriteTitle}),descriptionComponent:a.jsx(Bi,{children:Se.overwriteDescription}),primaryButtonText:Se.buttons.yes,secondaryButtonText:Se.buttons.no,action:le,isEditPopup:!0}):null,o==="small"||q?null:a.jsx(ht,{children:a.jsx(Ii,{})}),o!=="small"?a.jsx(Ve,{}):null,a.jsx(bt,{backgroundColor:s.colors.grey4,billId:n,file:W,showAutofill:q,uploadStatus:B.uploadStatus,isVendorRecommendationEnabled:h,attachmentTitle:vi(u,J,B),setShowConfirmationPopup:x,setPayload:U,showActionButtons:ki(u,B),isInitialEdit:!!B.isInitialEdit,billStage:w}),a.jsx($e,{windowSize:o,children:e})]})})}}function Ii(){const{triggerBack:e}=Zn();return a.jsx(ta,{onClick:e})}function vi(e,t,l){let n,c;return e?(n=l.recurringConfig?.currentInstance,c=l.recurringConfig?.totalPaymentCycles):(n=t.transactionDetails?.recurringBillInstance,c=t.recurringBillConfigDetail?.totalPaymentCycles),t?.isRecurring===!0?a.jsxs(wi,{children:[a.jsx(Ci,{children:`${Se.recurringBill.recurringCycle}
2
2
  ${n}/${c}`}),a.jsx(Ai,{})]}):void 0}function ki(e,t){const l=t.billActivities?.[0],n=t.billStage==="pending_approval"&&l?.areApprovalsSerialized===!0&&l?.currentPendingStepIndex===0;return e&&(t.billStage==="draft"||n)}const ht=V.div`
3
3
  margin-bottom: 20px;
4
4
  margin-top: 20px;
@@ -1,4 +1,4 @@
1
- import{j as k}from"./liveblocks-CVGPqYnR.js";import{a as V}from"./sentry-vrLJXbkU.js";import{j as ae,u as ne,h as se,l as ie,g as C,N as oe,k as re}from"./core-B4ZvHvvY.js";import{S as ce,Z as ue,aI as de,z as B,s as pe,c as E,aa as x,e as z,bq as le,ao as me,q as M,ap as L}from"./index-DmE4wSNC.js";import{LH as fe,eL as G,rd as ye,Gj as Se,wR as ge,zy as Ie,C5 as be,CK as he,DD as De,M2 as Oe,M3 as Te,M4 as ke,M5 as Ce,M6 as Ve,IB as we,L4 as Ne,IN as Ae,jO as _e,fz as Fe,fy as ve,fx as xe,pl as ze,pc as Be,p9 as Ee,jG as Me,rm as Le,rk as R,bB as P,ry as j,cr as Re}from"./zeni-epic-state-Da4VO2lv.js";import{n as Pe}from"./mui-DoY7WfR_.js";import{c as U}from"./routePaths-BbBoI9fr.js";import{M as je}from"./MobileAppDrawer-DVJrG_df.js";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},d=new e.Error().stack;d&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[d]="b8e17b85-b13e-4532-abd8-96861eb94dd3",e._sentryDebugIdIdentifier="sentry-dbid-b8e17b85-b13e-4532-abd8-96861eb94dd3")}catch{}})();const Ue=Pe.div`
1
+ import{j as k}from"./liveblocks-CVGPqYnR.js";import{a as V}from"./sentry-vrLJXbkU.js";import{j as ae,u as ne,h as se,l as ie,g as C,N as oe,k as re}from"./core-B4ZvHvvY.js";import{S as ce,Z as ue,aI as de,z as B,s as pe,c as E,aa as x,e as z,bq as le,ao as me,q as M,ap as L}from"./index-DgzG0i4n.js";import{LH as fe,eL as G,rd as ye,Gj as Se,wR as ge,zy as Ie,C5 as be,CK as he,DD as De,M2 as Oe,M3 as Te,M4 as ke,M5 as Ce,M6 as Ve,IB as we,L4 as Ne,IN as Ae,jO as _e,fz as Fe,fy as ve,fx as xe,pl as ze,pc as Be,p9 as Ee,jG as Me,rm as Le,rk as R,bB as P,ry as j,cr as Re}from"./zeni-epic-state-Da4VO2lv.js";import{n as Pe}from"./mui-DoY7WfR_.js";import{c as U}from"./routePaths-WhbiYSxu.js";import{M as je}from"./MobileAppDrawer-eCdBXSxf.js";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},d=new e.Error().stack;d&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[d]="b8e17b85-b13e-4532-abd8-96861eb94dd3",e._sentryDebugIdIdentifier="sentry-dbid-b8e17b85-b13e-4532-abd8-96861eb94dd3")}catch{}})();const Ue=Pe.div`
2
2
  display: flex;
3
3
  min-height: 100%;
4
4
  width: 100%;
@@ -1,4 +1,4 @@
1
- import{j as s}from"./liveblocks-CVGPqYnR.js";import{j as ue,l as la,h as me,g as S,u as ye,k as ge,N as ya,q as mt,n as Xt,o as te}from"./core-B4ZvHvvY.js";import{eL as ie,br as Be,Ny as _a,eQ as Se,eR as Ie,eS as Ae,fJ as Me,co as ze,Nz as $e,NA as $a,ss as Sa,je as Ia,NB as Aa,gw as ca,yR as aa,yT as Ga,yU as Za,j4 as Ct,NC as Ge,yF as pt,ND as Qt,NE as Jt,yI as wa,NF as en,L$ as Pa,qE as ht,yO as Ya,gH as an,NG as ft,NH as Ze,bp as tn,NI as nn,fz as Ta,fy as Fa,zm as rn,fx as va,LH as sn,NJ as gt,cN as bt,cJ as on,L_ as ua,zY as cn,NK as rt,zy as xa,NL as yt,zZ as dn,Mp as ln,z_ as un,AU as mn,rO as Cn,AO as pn,z7 as St,z0 as hn,NM as fn,fL as gn,zg as It,zk as At,fK as bn,NN as yn,zK as Et,NO as Sn,NP as In,NQ as An,zi as kt,z3 as Dt,yL as _t,zc as wt,za as Pt,ze as En,yS as st,NR as Tt,NS as La,zv as Ea,IG as Ft,cK as Ka,NT as kn,NU as Dn,NV as _n,NW as wn,zs as Ha,zR as Pn,zN as Tn,zo as Fn,zP as vn,zF as xn,zH as Ln,NX as vt,zX as xt,Gf as Bn,NY as On,NZ as Rn,N_ as Un,N$ as Lt,O0 as Nn,Ai as jn,zx as Bt,zr as da,zw as Vn,O1 as Hn,O2 as Mn,yC as zn,O3 as Ot,O4 as Rt,O5 as $n,yE as Gn,yD as ot,O6 as Zn,O7 as Yn,O8 as Kn,IC as Wn,O9 as Wa,Oa as qn,vd as Ut,jO as Xn,gx as Qn,An as Jn,Ob as Nt,Oc as er,Ao as ar,Od as tr,db as nr,sm as rr,Ad as sr,A7 as Le,bu as or,bC as ir,ct as cr,bD as dr,HX as lr}from"./zeni-epic-state-Da4VO2lv.js";import{z as J,S as Re,Z as oe,i as Y,B as Ye,bU as Ba,c3 as ur,p as ve,c4 as mr,c5 as Cr,K as ma,aI as Fe,q as be,bb as qa,c6 as pr,x as Ca,h as Oa,m as Xa,c as X,D as Qa,c7 as hr,J as jt,al as Ja,bn as Je,c8 as Ma,c9 as fr,s as et,a1 as gr,ca as br,ao as Vt,R as za,M as Ht,e as Mt,cb as yr,cc as Sr,cd as Ir,ce as Ar,cf as Er,o as ka,cg as kr,ch as Dr,ci as Na,F as _r,cj as wr,ck as Pr,cl as Tr,cm as Fr,a4 as vr}from"./index-DmE4wSNC.js";import{n as _e,D as zt,S as xr}from"./mui-DoY7WfR_.js";import{a as c}from"./sentry-vrLJXbkU.js";import{g as fe,a as pa,b as $t,c as Ee,d as ke,e as Oe,f as Ue,A as Lr,h as at,P as Br,i as tt,s as ea,j as Gt,k as He,l as Zt,m as Or,n as Yt,p as Rr,S as it}from"./SetupPagesScreen-B82yEDYc.js";import Ra from"./NotFoundScreen-Dw_4aXSt.js";import{M as ha}from"./MobileAppDrawer-DVJrG_df.js";import{u as Kt}from"./useAskAiCfoHostNavButtonProps-Djdv5hKX.js";import{c as Wt}from"./useFetchSuggestedQuestionsWhenReady-Cfhk-A1n.js";import{v as ct}from"./utils-QMlevttK.js";import{t as Ur}from"./AddressScreen-Cud2BdS6.js";import"./recharts-DNFnaP_v.js";import"./lottie-B5aSI3Li.js";import"./analytics-BL0geQNn.js";import"./plaid-C1RHGEem.js";import"./dnd-B2_m6pRT.js";import"./stripe-DMRn4zHo.js";import"./lexical-DA5yMmPj.js";import"./pdf-ChIJqwGf.js";import"./analyticsHelper-ZM4U1wiv.js";import"./routePaths-BbBoI9fr.js";import"./BusinessVerificationPageScreen-ByeCoum9.js";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="0d10b045-b70a-4567-a640-ea31fa5ef041",e._sentryDebugIdIdentifier="sentry-dbid-0d10b045-b70a-4567-a640-ea31fa5ef041")}catch{}})();function Nr(){const e=ue(),{cardId:t}=la(),a=me(),r=J.getSignedInUser(),n=S(G=>ie(G)),u=Re(),m=Be(u?.loggedInUserRoleMap),{useFeatureGate:C}=oe();if(r==null)throw Error("Can't access Add To Wallet Page without signing in...");const[I,o]=c.useState(!1),i=S(G=>_a(G).firstViewAfterActivation);if(t==null)throw Error("Empty card id is not valid...");const D=n.userRole.includes("charge_card_user"),{isFeatureEnabled:A}=C(Y.isChargeCardFeatureEnabled),f=!!n.companyChargeCardInfo?.info?.isChargeCardEnabled,{isFeatureEnabled:B}=C(Y.isDebitCardFeatureEnabled),v=Se(n),k=Ie(n),h=Ae(B,n),b=n.companyChargeCardInfo?.info?.chargeCardsCreditAccountLimit??0,g=Ee({isDebitCardFeatureEnabled:B,isBankingOnlyTenant:h}),l=ke({isCardsOnlyTenant:v,isChargeCardFeatureEnabled:A,isBookKeepingTenant:k,isDebitCardProductVisible:g,chargeCardsCreditAccountLimit:b}),w=!!n.companyDebitCardInfo?.info?.isDebitCardEnabled,O=S(G=>Me(G,n.companyId)),N=ze(O.controllers),{creditAccount:T,creditAccountRepayment:P}=S(G=>$e(G)),j=S(G=>G.classListState.fetchState),p=!D&&l&&f,d=S(G=>$a(G,t,p,l)),[_,F]=c.useState(!1),U=d.chargeCard,M=U?.cardCreatedByUser?.userId,W=S(G=>M!=null?Sa(G.userRoleState,M):void 0),y=W?.accountingClassIDs[0],x=S(G=>y!=null?Ia(G.classState,{classId:y,reportId:"class_list"}):void 0),$=U?.cardHolderUser?.userId,R=S(G=>$!=null?Sa(G.userRoleState,$):void 0),Z=R?.accountingClassIDs[0],E=S(G=>Z!=null?Ia(G.classState,{classId:Z,reportId:"class_list"}):void 0),q=U?.type.code==="business_physical_credit_card"||U?.type.code==="business_physical_debit_card",K=U?.type.code==="business_physical_debit_card";c.useEffect(()=>{i&&I===!1&&q&&(o(!0),setTimeout(()=>{a(Aa()),K&&a(ca({messageSection:"set_debit_card_pin",messageText:"success",type:"success",showStatusIcon:!0}))},5e3))},[i,I,q,K]),c.useEffect(()=>{_||d.fetchState==="Completed"||d.fetchState==="In-Progress"||t==null||(F(!0),a(aa(t,p,!1)))},[_,d,t,a]),c.useEffect(()=>{if(d.fetchState==="Completed"&&(q===!1||q&&U?.status?.code!=="active"||U?.cardHolderUserId!==r.userId||i===!1&&I===!1||U?.type.code==="business_physical_debit_card"||U?.type.code==="business_virtual_debit_card")){const G=fe(n.tenantEmailDomain,t,r,U,i);e(G)}},[d.fetchState,i,q]),c.useEffect(()=>{T.fetchState!=="Completed"&&T.fetchState!=="In-Progress"&&l&&f&&m&&a(Ga()),P.fetchState!=="Completed"&&P.fetchState!=="In-Progress"&&l&&f&&m&&a(Za()),j!=="Completed"&&j!=="In-Progress"&&a(Ct())},[T.fetchState,P.fetchState,a,l,f,m,j]);const z=()=>{if(r!=null&&t!=null){a(Aa());const G=fe(n.tenantEmailDomain,t,r);e(G)}},Ce=U?.type.code==="business_physical_debit_card"||U?.type.code==="business_virtual_debit_card",ae=Oe(l,g,w,f),L=pa(l,f,m,T,P),pe=$t(Ce,d);return d.fetchState!=="Completed"?s.jsx(Ye,{fetchState:"In-Progress"}):s.jsxs(s.Fragment,{children:[s.jsx(Ba,{showConfetti:i}),s.jsx(ur,{onGotItClick:z,isDebitCard:U?.type.code==="business_physical_debit_card",controllerEmails:N,isChargeCardFeatureEnabled:l,isDebitCardFeatureEnabled:g,isDebitCardSetupEnabled:w,isChargeCardSetupEnabled:f,productInformation:ae,creditAccountInformation:L,debitAccountInformation:pe,chargeCardDetailView:d,creditAccount:T,classListFetchState:j,creditAccountRepayment:P,cardIssuedByRoles:W?.userRoles,cardIssuedByDepartmentName:x?.className,cardHolderRoles:R?.userRoles,cardHolderDepartmentName:E?.className})]})}const jr=ge(function(e){const t=Ge(e);return{insightsData:t.insight,cashbackByPeriod:t.cashbackByPeriod,uiState:t.uiState,cashbackSummary:t.cashbackSummary}},function(e){return{onColumnSortConfigChanged:(t,a)=>{e(Qt({uiState:{sortKey:t,sortOrder:a}}))}}})(Cr);function Vr(){const e=ue(),t=me(),a=ye(),r=J.getSignedInUser(),n=S(o=>ie(o)),[u,m]=c.useState(!1),C=S(o=>Ge(o)),I=c.useCallback(()=>{const o=ve(a.state?.pathnameStackToGoBack),i=o.poppedPathname??Hr(n.tenantEmailDomain);e(i,{state:{pathnameStackToGoBack:o.newStack}})},[e,a,n.tenantEmailDomain]);if(c.useEffect(()=>{u||C.fetchState==="Completed"||C.fetchState==="In-Progress"||(m(!0),t(pt()))},[u,C,t]),r==null)throw Error("Can't access cashback detail page without signing in...");return C.fetchState==="In-Progress"?s.jsx(mr,{onBackClick:I}):C.cashbackSummary.cashbackEarned.amount===0&&C.fetchState==="Completed"?s.jsx(Ra,{}):s.jsx(jr,{onBackClick:I})}const Hr=e=>`/${e}/cards`,Mr={containerWidth:new Ca(100,58)},zr=({appContent:e})=>{const t=ma(),a=me(),r=ue(),{cardId:n}=la(),u=ye(),{useDynamicConfig:m}=oe(),[C,I]=c.useState(!1),[o,i]=c.useState(!1),[D,A]=c.useState(!1),[f,B]=c.useState(!1),v=J.getSignedInUser();if(v==null)throw Error("Can't access onboarding card page without signing in...");const k=S(E=>ie(E));if(n==null)throw Error("Empty card id is not valid...");const{configValue:h}=m(Fe.zeniCardsConfig),b=h.max_charge_card_activation_attempts_by_card_id,g=S(E=>Jt(E,n)),l=g.chargeCard,w=S(E=>E.chargeCardConfigState.fetchState),{useFeatureGate:O}=oe(),{isFeatureEnabled:N}=O(Y.isChargeCardFeatureEnabled),{isFeatureEnabled:T}=O(Y.isDebitCardFeatureEnabled),P=Ae(T,k),j=Ee({isDebitCardFeatureEnabled:T,isBankingOnlyTenant:P}),p=!!k.companyChargeCardInfo?.info?.isChargeCardEnabled,d=k.userRole.includes("charge_card_user"),_=Se(k),F=Ie(k),U=k.companyChargeCardInfo?.info?.chargeCardsCreditAccountLimit??0,M=ke({isCardsOnlyTenant:_,isChargeCardFeatureEnabled:N,isBookKeepingTenant:F,isDebitCardProductVisible:j,chargeCardsCreditAccountLimit:U}),W=!d&&M&&p;c.useEffect(()=>{C===!1&&w!=="In-Progress"&&w!=="Completed"&&(a(wa()),I(!0)),o===!1&&g.fetchState==="Not-Started"&&(i(!0),a(aa(n,W,M)))},[o,g.fetchState,C,w]);const y=l?.type.code==="business_physical_credit_card"||l?.type.code==="business_physical_debit_card";c.useEffect(()=>{if(g.fetchState==="Completed"){if(D===!1&&(y===!1||y&&l?.status?.code!=="inactive"||l?.cardHolderUserId!==v.userId)){const E=fe(k.tenantEmailDomain,n,v,l,!0),q=be(u.state?.pathnameStackToGoBack,u.pathname);r(E,{state:{pathnameStackToGoBack:q}})}else if(D&&g.isRefreshingViewInBackground===!1&&l?.status?.code==="active"){a(en({chargeCardId:n}));const E=fe(k.tenantEmailDomain,n,v,l,!0),q=be(u.state?.pathnameStackToGoBack,u.pathname);a(Pa()),r(E,{state:{pathnameStackToGoBack:q}})}}},[g.fetchState,l?.type.code,D,g.isRefreshingViewInBackground]);const x=J.getZeniOtpTokenForCardHolder(n),$=S(E=>ht(E.userState,v.userId)),R=()=>{l?.status?.code!=="active"&&a(Ya(n,!0))};c.useEffect(()=>{g.updatePhysicalChargeCardAttemptFetchState.fetchState==="Completed"&&l?.cardActivationAttemptHistory.some(E=>E.statusCode==="success")===!0&&D===!1&&(setTimeout(R,3e3),A(!0))},[g.updatePhysicalChargeCardAttemptFetchState.fetchState,l?.cardActivationAttemptHistory]);const Z=E=>{B(E)};if(w!=="Completed"||l==null)return s.jsx(Ye,{fetchState:"In-Progress"});if(l.shippingAddressId==null)throw Error("Can't access shippingAddressId.");if($?.phone==null)throw Error("Can't access user phone number.");return s.jsxs(Zr,{children:[s.jsx(ha,{isAppContentDrawerOpen:f,handleDrawerToggle:Z}),s.jsx($r,{cardId:n,card:l,shippingAddressId:l.shippingAddressId,phone:$.phone,signedInUser:v,isSandboxEnv:qa(),chargeCardDetailState:g,signedInUserToken:x,navigate:r,currentTenant:k,location:u,maxChargeCardActivationAttempts:b[n]!=null?b[n]:h.default_max_charge_card_activation_attempts!=null?h.default_max_charge_card_activation_attempts:3,chargeCardCashbackRatePerTransaction:h.charge_card_cashback_rate_per_transaction!=null?h.charge_card_cashback_rate_per_transaction:.0175,onClickMenuIcon:()=>{Z(!0)}}),e!=null?s.jsx(Gr,{windowSize:t,children:e}):null]})},$r=ge(function(e,{chargeCardDetailState:t,shippingAddressId:a,location:r,cardId:n}){const u=an(e.addressState,a);if(u==null)throw Error("Can't access shippingAddress.");const m=ft(e,n),C=t.updateStatus,I=Ze(e,!1,!1,!1);let o=!1;I.fetchState==="Completed"&&I.cards.length<=1&&(o=!0);const i=r.state?.message==="comingFromV2UrlPath";return{showActivatePage:t.chargeCard?.providerCardCreateTime!=null&&t.chargeCard.providerCardCreateTime.add(24,"h").isBefore(tn())||i,showMenuIcon:o,shippingAddress:u,vgsVaultId:Oa.cardVaultId,twoFAView:m,activationWaitStatus:C,isRefreshingViewInBackground:t.isRefreshingViewInBackground}},function(e,t){const{navigate:a,cardId:r,location:n,currentTenant:u,chargeCardDetailState:m}=t,C=m.chargeCard?.cardProviderID,{tenantEmailDomain:I}=u;return{onGetOtp:o=>{C!=null&&e(va(o,"ChargeCardHolder",r))},onUpdatePhysicalChargeCardAttempt:o=>{e(rn(r,o))},onResendOtp:o=>{C!=null&&e(Fa(o,"ChargeCardHolder",r))},onVerifyOtp:(o,i)=>{C!=null&&e(Ta(o,i,"ChargeCardHolder",r))},onVerifyOtpSuccess:o=>{o!=null&&J.saveZeniOtpTokenForCardHolder(o,r)},onCVVActivateSuccess:()=>{e(nn({chargeCardId:r}))},onBackClick:()=>{const o=ve(n.state?.pathnameStackToGoBack),i=o.poppedPathname==null||o.poppedPathname.includes("onboard")===!0?Ue(I):o.poppedPathname;a(i,{state:{pathnameStackToGoBack:o.newStack}})}}})(pr),Gr=_e.div`
1
+ import{j as s}from"./liveblocks-CVGPqYnR.js";import{j as ue,l as la,h as me,g as S,u as ye,k as ge,N as ya,q as mt,n as Xt,o as te}from"./core-B4ZvHvvY.js";import{eL as ie,br as Be,Ny as _a,eQ as Se,eR as Ie,eS as Ae,fJ as Me,co as ze,Nz as $e,NA as $a,ss as Sa,je as Ia,NB as Aa,gw as ca,yR as aa,yT as Ga,yU as Za,j4 as Ct,NC as Ge,yF as pt,ND as Qt,NE as Jt,yI as wa,NF as en,L$ as Pa,qE as ht,yO as Ya,gH as an,NG as ft,NH as Ze,bp as tn,NI as nn,fz as Ta,fy as Fa,zm as rn,fx as va,LH as sn,NJ as gt,cN as bt,cJ as on,L_ as ua,zY as cn,NK as rt,zy as xa,NL as yt,zZ as dn,Mp as ln,z_ as un,AU as mn,rO as Cn,AO as pn,z7 as St,z0 as hn,NM as fn,fL as gn,zg as It,zk as At,fK as bn,NN as yn,zK as Et,NO as Sn,NP as In,NQ as An,zi as kt,z3 as Dt,yL as _t,zc as wt,za as Pt,ze as En,yS as st,NR as Tt,NS as La,zv as Ea,IG as Ft,cK as Ka,NT as kn,NU as Dn,NV as _n,NW as wn,zs as Ha,zR as Pn,zN as Tn,zo as Fn,zP as vn,zF as xn,zH as Ln,NX as vt,zX as xt,Gf as Bn,NY as On,NZ as Rn,N_ as Un,N$ as Lt,O0 as Nn,Ai as jn,zx as Bt,zr as da,zw as Vn,O1 as Hn,O2 as Mn,yC as zn,O3 as Ot,O4 as Rt,O5 as $n,yE as Gn,yD as ot,O6 as Zn,O7 as Yn,O8 as Kn,IC as Wn,O9 as Wa,Oa as qn,vd as Ut,jO as Xn,gx as Qn,An as Jn,Ob as Nt,Oc as er,Ao as ar,Od as tr,db as nr,sm as rr,Ad as sr,A7 as Le,bu as or,bC as ir,ct as cr,bD as dr,HX as lr}from"./zeni-epic-state-Da4VO2lv.js";import{z as J,S as Re,Z as oe,i as Y,B as Ye,bU as Ba,c3 as ur,p as ve,c4 as mr,c5 as Cr,K as ma,aI as Fe,q as be,bb as qa,c6 as pr,x as Ca,h as Oa,m as Xa,c as X,D as Qa,c7 as hr,J as jt,al as Ja,bn as Je,c8 as Ma,c9 as fr,s as et,a1 as gr,ca as br,ao as Vt,R as za,M as Ht,e as Mt,cb as yr,cc as Sr,cd as Ir,ce as Ar,cf as Er,o as ka,cg as kr,ch as Dr,ci as Na,F as _r,cj as wr,ck as Pr,cl as Tr,cm as Fr,a4 as vr}from"./index-DgzG0i4n.js";import{n as _e,D as zt,S as xr}from"./mui-DoY7WfR_.js";import{a as c}from"./sentry-vrLJXbkU.js";import{g as fe,a as pa,b as $t,c as Ee,d as ke,e as Oe,f as Ue,A as Lr,h as at,P as Br,i as tt,s as ea,j as Gt,k as He,l as Zt,m as Or,n as Yt,p as Rr,S as it}from"./SetupPagesScreen-BJy2d6s1.js";import Ra from"./NotFoundScreen-jPpbDlQd.js";import{M as ha}from"./MobileAppDrawer-eCdBXSxf.js";import{u as Kt}from"./useAskAiCfoHostNavButtonProps-DQFYXydp.js";import{c as Wt}from"./useFetchSuggestedQuestionsWhenReady-BMFUNkte.js";import{v as ct}from"./utils-QMlevttK.js";import{t as Ur}from"./AddressScreen-B-90Ns9M.js";import"./recharts-DNFnaP_v.js";import"./lottie-B5aSI3Li.js";import"./analytics-BL0geQNn.js";import"./plaid-C1RHGEem.js";import"./dnd-B2_m6pRT.js";import"./stripe-DMRn4zHo.js";import"./lexical-DA5yMmPj.js";import"./pdf-ChIJqwGf.js";import"./analyticsHelper-B-IDLpaZ.js";import"./routePaths-WhbiYSxu.js";import"./BusinessVerificationPageScreen-B8mXcNLy.js";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="0d10b045-b70a-4567-a640-ea31fa5ef041",e._sentryDebugIdIdentifier="sentry-dbid-0d10b045-b70a-4567-a640-ea31fa5ef041")}catch{}})();function Nr(){const e=ue(),{cardId:t}=la(),a=me(),r=J.getSignedInUser(),n=S(G=>ie(G)),u=Re(),m=Be(u?.loggedInUserRoleMap),{useFeatureGate:C}=oe();if(r==null)throw Error("Can't access Add To Wallet Page without signing in...");const[I,o]=c.useState(!1),i=S(G=>_a(G).firstViewAfterActivation);if(t==null)throw Error("Empty card id is not valid...");const D=n.userRole.includes("charge_card_user"),{isFeatureEnabled:A}=C(Y.isChargeCardFeatureEnabled),f=!!n.companyChargeCardInfo?.info?.isChargeCardEnabled,{isFeatureEnabled:B}=C(Y.isDebitCardFeatureEnabled),v=Se(n),k=Ie(n),h=Ae(B,n),b=n.companyChargeCardInfo?.info?.chargeCardsCreditAccountLimit??0,g=Ee({isDebitCardFeatureEnabled:B,isBankingOnlyTenant:h}),l=ke({isCardsOnlyTenant:v,isChargeCardFeatureEnabled:A,isBookKeepingTenant:k,isDebitCardProductVisible:g,chargeCardsCreditAccountLimit:b}),w=!!n.companyDebitCardInfo?.info?.isDebitCardEnabled,O=S(G=>Me(G,n.companyId)),N=ze(O.controllers),{creditAccount:T,creditAccountRepayment:P}=S(G=>$e(G)),j=S(G=>G.classListState.fetchState),p=!D&&l&&f,d=S(G=>$a(G,t,p,l)),[_,F]=c.useState(!1),U=d.chargeCard,M=U?.cardCreatedByUser?.userId,W=S(G=>M!=null?Sa(G.userRoleState,M):void 0),y=W?.accountingClassIDs[0],x=S(G=>y!=null?Ia(G.classState,{classId:y,reportId:"class_list"}):void 0),$=U?.cardHolderUser?.userId,R=S(G=>$!=null?Sa(G.userRoleState,$):void 0),Z=R?.accountingClassIDs[0],E=S(G=>Z!=null?Ia(G.classState,{classId:Z,reportId:"class_list"}):void 0),q=U?.type.code==="business_physical_credit_card"||U?.type.code==="business_physical_debit_card",K=U?.type.code==="business_physical_debit_card";c.useEffect(()=>{i&&I===!1&&q&&(o(!0),setTimeout(()=>{a(Aa()),K&&a(ca({messageSection:"set_debit_card_pin",messageText:"success",type:"success",showStatusIcon:!0}))},5e3))},[i,I,q,K]),c.useEffect(()=>{_||d.fetchState==="Completed"||d.fetchState==="In-Progress"||t==null||(F(!0),a(aa(t,p,!1)))},[_,d,t,a]),c.useEffect(()=>{if(d.fetchState==="Completed"&&(q===!1||q&&U?.status?.code!=="active"||U?.cardHolderUserId!==r.userId||i===!1&&I===!1||U?.type.code==="business_physical_debit_card"||U?.type.code==="business_virtual_debit_card")){const G=fe(n.tenantEmailDomain,t,r,U,i);e(G)}},[d.fetchState,i,q]),c.useEffect(()=>{T.fetchState!=="Completed"&&T.fetchState!=="In-Progress"&&l&&f&&m&&a(Ga()),P.fetchState!=="Completed"&&P.fetchState!=="In-Progress"&&l&&f&&m&&a(Za()),j!=="Completed"&&j!=="In-Progress"&&a(Ct())},[T.fetchState,P.fetchState,a,l,f,m,j]);const z=()=>{if(r!=null&&t!=null){a(Aa());const G=fe(n.tenantEmailDomain,t,r);e(G)}},Ce=U?.type.code==="business_physical_debit_card"||U?.type.code==="business_virtual_debit_card",ae=Oe(l,g,w,f),L=pa(l,f,m,T,P),pe=$t(Ce,d);return d.fetchState!=="Completed"?s.jsx(Ye,{fetchState:"In-Progress"}):s.jsxs(s.Fragment,{children:[s.jsx(Ba,{showConfetti:i}),s.jsx(ur,{onGotItClick:z,isDebitCard:U?.type.code==="business_physical_debit_card",controllerEmails:N,isChargeCardFeatureEnabled:l,isDebitCardFeatureEnabled:g,isDebitCardSetupEnabled:w,isChargeCardSetupEnabled:f,productInformation:ae,creditAccountInformation:L,debitAccountInformation:pe,chargeCardDetailView:d,creditAccount:T,classListFetchState:j,creditAccountRepayment:P,cardIssuedByRoles:W?.userRoles,cardIssuedByDepartmentName:x?.className,cardHolderRoles:R?.userRoles,cardHolderDepartmentName:E?.className})]})}const jr=ge(function(e){const t=Ge(e);return{insightsData:t.insight,cashbackByPeriod:t.cashbackByPeriod,uiState:t.uiState,cashbackSummary:t.cashbackSummary}},function(e){return{onColumnSortConfigChanged:(t,a)=>{e(Qt({uiState:{sortKey:t,sortOrder:a}}))}}})(Cr);function Vr(){const e=ue(),t=me(),a=ye(),r=J.getSignedInUser(),n=S(o=>ie(o)),[u,m]=c.useState(!1),C=S(o=>Ge(o)),I=c.useCallback(()=>{const o=ve(a.state?.pathnameStackToGoBack),i=o.poppedPathname??Hr(n.tenantEmailDomain);e(i,{state:{pathnameStackToGoBack:o.newStack}})},[e,a,n.tenantEmailDomain]);if(c.useEffect(()=>{u||C.fetchState==="Completed"||C.fetchState==="In-Progress"||(m(!0),t(pt()))},[u,C,t]),r==null)throw Error("Can't access cashback detail page without signing in...");return C.fetchState==="In-Progress"?s.jsx(mr,{onBackClick:I}):C.cashbackSummary.cashbackEarned.amount===0&&C.fetchState==="Completed"?s.jsx(Ra,{}):s.jsx(jr,{onBackClick:I})}const Hr=e=>`/${e}/cards`,Mr={containerWidth:new Ca(100,58)},zr=({appContent:e})=>{const t=ma(),a=me(),r=ue(),{cardId:n}=la(),u=ye(),{useDynamicConfig:m}=oe(),[C,I]=c.useState(!1),[o,i]=c.useState(!1),[D,A]=c.useState(!1),[f,B]=c.useState(!1),v=J.getSignedInUser();if(v==null)throw Error("Can't access onboarding card page without signing in...");const k=S(E=>ie(E));if(n==null)throw Error("Empty card id is not valid...");const{configValue:h}=m(Fe.zeniCardsConfig),b=h.max_charge_card_activation_attempts_by_card_id,g=S(E=>Jt(E,n)),l=g.chargeCard,w=S(E=>E.chargeCardConfigState.fetchState),{useFeatureGate:O}=oe(),{isFeatureEnabled:N}=O(Y.isChargeCardFeatureEnabled),{isFeatureEnabled:T}=O(Y.isDebitCardFeatureEnabled),P=Ae(T,k),j=Ee({isDebitCardFeatureEnabled:T,isBankingOnlyTenant:P}),p=!!k.companyChargeCardInfo?.info?.isChargeCardEnabled,d=k.userRole.includes("charge_card_user"),_=Se(k),F=Ie(k),U=k.companyChargeCardInfo?.info?.chargeCardsCreditAccountLimit??0,M=ke({isCardsOnlyTenant:_,isChargeCardFeatureEnabled:N,isBookKeepingTenant:F,isDebitCardProductVisible:j,chargeCardsCreditAccountLimit:U}),W=!d&&M&&p;c.useEffect(()=>{C===!1&&w!=="In-Progress"&&w!=="Completed"&&(a(wa()),I(!0)),o===!1&&g.fetchState==="Not-Started"&&(i(!0),a(aa(n,W,M)))},[o,g.fetchState,C,w]);const y=l?.type.code==="business_physical_credit_card"||l?.type.code==="business_physical_debit_card";c.useEffect(()=>{if(g.fetchState==="Completed"){if(D===!1&&(y===!1||y&&l?.status?.code!=="inactive"||l?.cardHolderUserId!==v.userId)){const E=fe(k.tenantEmailDomain,n,v,l,!0),q=be(u.state?.pathnameStackToGoBack,u.pathname);r(E,{state:{pathnameStackToGoBack:q}})}else if(D&&g.isRefreshingViewInBackground===!1&&l?.status?.code==="active"){a(en({chargeCardId:n}));const E=fe(k.tenantEmailDomain,n,v,l,!0),q=be(u.state?.pathnameStackToGoBack,u.pathname);a(Pa()),r(E,{state:{pathnameStackToGoBack:q}})}}},[g.fetchState,l?.type.code,D,g.isRefreshingViewInBackground]);const x=J.getZeniOtpTokenForCardHolder(n),$=S(E=>ht(E.userState,v.userId)),R=()=>{l?.status?.code!=="active"&&a(Ya(n,!0))};c.useEffect(()=>{g.updatePhysicalChargeCardAttemptFetchState.fetchState==="Completed"&&l?.cardActivationAttemptHistory.some(E=>E.statusCode==="success")===!0&&D===!1&&(setTimeout(R,3e3),A(!0))},[g.updatePhysicalChargeCardAttemptFetchState.fetchState,l?.cardActivationAttemptHistory]);const Z=E=>{B(E)};if(w!=="Completed"||l==null)return s.jsx(Ye,{fetchState:"In-Progress"});if(l.shippingAddressId==null)throw Error("Can't access shippingAddressId.");if($?.phone==null)throw Error("Can't access user phone number.");return s.jsxs(Zr,{children:[s.jsx(ha,{isAppContentDrawerOpen:f,handleDrawerToggle:Z}),s.jsx($r,{cardId:n,card:l,shippingAddressId:l.shippingAddressId,phone:$.phone,signedInUser:v,isSandboxEnv:qa(),chargeCardDetailState:g,signedInUserToken:x,navigate:r,currentTenant:k,location:u,maxChargeCardActivationAttempts:b[n]!=null?b[n]:h.default_max_charge_card_activation_attempts!=null?h.default_max_charge_card_activation_attempts:3,chargeCardCashbackRatePerTransaction:h.charge_card_cashback_rate_per_transaction!=null?h.charge_card_cashback_rate_per_transaction:.0175,onClickMenuIcon:()=>{Z(!0)}}),e!=null?s.jsx(Gr,{windowSize:t,children:e}):null]})},$r=ge(function(e,{chargeCardDetailState:t,shippingAddressId:a,location:r,cardId:n}){const u=an(e.addressState,a);if(u==null)throw Error("Can't access shippingAddress.");const m=ft(e,n),C=t.updateStatus,I=Ze(e,!1,!1,!1);let o=!1;I.fetchState==="Completed"&&I.cards.length<=1&&(o=!0);const i=r.state?.message==="comingFromV2UrlPath";return{showActivatePage:t.chargeCard?.providerCardCreateTime!=null&&t.chargeCard.providerCardCreateTime.add(24,"h").isBefore(tn())||i,showMenuIcon:o,shippingAddress:u,vgsVaultId:Oa.cardVaultId,twoFAView:m,activationWaitStatus:C,isRefreshingViewInBackground:t.isRefreshingViewInBackground}},function(e,t){const{navigate:a,cardId:r,location:n,currentTenant:u,chargeCardDetailState:m}=t,C=m.chargeCard?.cardProviderID,{tenantEmailDomain:I}=u;return{onGetOtp:o=>{C!=null&&e(va(o,"ChargeCardHolder",r))},onUpdatePhysicalChargeCardAttempt:o=>{e(rn(r,o))},onResendOtp:o=>{C!=null&&e(Fa(o,"ChargeCardHolder",r))},onVerifyOtp:(o,i)=>{C!=null&&e(Ta(o,i,"ChargeCardHolder",r))},onVerifyOtpSuccess:o=>{o!=null&&J.saveZeniOtpTokenForCardHolder(o,r)},onCVVActivateSuccess:()=>{e(nn({chargeCardId:r}))},onBackClick:()=>{const o=ve(n.state?.pathnameStackToGoBack),i=o.poppedPathname==null||o.poppedPathname.includes("onboard")===!0?Ue(I):o.poppedPathname;a(i,{state:{pathnameStackToGoBack:o.newStack}})}}})(pr),Gr=_e.div`
2
2
  display: flex;
3
3
  flex-direction: column;
4
4
  width: ${e=>`${Mr.containerWidth.value(e.windowSize)}%`};
@@ -1 +1 @@
1
- import{j as m}from"./liveblocks-CVGPqYnR.js";import{a as g}from"./sentry-vrLJXbkU.js";import{j as w,h as k,u as x,l as T,g as O,k as E}from"./core-B4ZvHvvY.js";import{z as C,aZ as F,s as L,c as P,e as V,aa as b,a_ as j,ao as A,ap as B,q as U}from"./index-DmE4wSNC.js";import{eL as D,fB as _,rd as M,fw as G,b$ as R,L4 as z,bm as Y,pl as Z,p9 as $,jG as q,la as S,L5 as H,bB as J,cr as N,li as K,ll as Q}from"./zeni-epic-state-Da4VO2lv.js";import"./mui-DoY7WfR_.js";import{c as W}from"./routePaths-BbBoI9fr.js";import{M as X}from"./MobileAppDrawer-DVJrG_df.js";(function(){try{var t=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},n=new t.Error().stack;n&&(t._sentryDebugIds=t._sentryDebugIds||{},t._sentryDebugIds[n]="1d07f4aa-b122-486f-b308-44fce8e75d72",t._sentryDebugIdIdentifier="sentry-dbid-1d07f4aa-b122-486f-b308-44fce8e75d72")}catch{}})();const ee=E(function(t){const n=G(t),i=C.getSignedInUser(),l=D(t),c=l.tenantId,p={userId:i?.userId??"",sessionId:i?.zeniSessionId??"",tenantId:c??""},f=R(l?.userRole??[])&&n.localData.updateStatus.fetchState!=="In-Progress"?void 0:"readonly",e=z(t.companyConfigState),a=t.countryListState?.byCountryListCode?.nationalityCountryList?.countries??[];return{isCompanyVerified:n.companyView?.company?.company?.companyBillPayInfo?.companyVerificationStatus?.code==="verified",companyPassportView:n,allIndustries:e.companyIndustries??[],allNationalityCountries:a,isDisabled:f,authParams:p,filesEndPoint:`${A.fileMicroServiceBaseUrl}`,isZeniUser:Y(i)}},function(t,n){const{companyId:i,currentTenant:l,navigate:c,location:p}=n,{tenantEmailDomain:f}=l;return{onScheduleClick:e=>{let a=e.href;a.includes("http")||(a="https://".concat(a)),window.open(a,"_blank")},onSaveAll:()=>{t(Q())},onAddressClick:e=>{const a=W(f,e),o=U(p.state?.pathnameStackToGoBack,p.pathname);c(a,{state:{pathnameStackToGoBack:o}})},onResetClick:()=>{t(K({companyId:i}))},onBackClick:()=>{c("../")},onCompanyDetailsChanged:e=>{const{companyInfo:a,incInfo:o,taxDetails:r,zeniFinanceTeam:d}=e,{website:u}=a,{meetingLink:y}=d,{incDate:s}=o,{taxesFiledYears:h}=r,v={companyInfo:{...a,website:u!=""&&u!=null?N(u):void 0,meetingLink:y!=""&&y!=null?N(y):void 0,industry:a.industry.selectedOption,companyIndustryType:a.companyIndustryType?.selectedOption??void 0,companySubIndustry:a.subIndustry?.selectedOption??void 0,businessModel:a.businessModel.selectedOption??"",companySourceOfFunds:a.companySourceOfFunds?.selectedOption,companySourceOfFundsDescription:a.companySourceOfFundsDescription??void 0,countriesOfOperations:a.countriesOfOperations?.selectedOptions?.map(I=>I.length===2?I:B(I))??[],transactionVolume:a.transactionVolume?.selectedOption??void 0,transactionVolumeDescription:a.transactionVolumeDescription??void 0,regulatedStatus:a.regulatedStatus??void 0,regulatedStatusDescription:a.regulatedStatusDescription??void 0,usNexus:a.usNexus??void 0,usNexusTypes:a.usNexusTypes?.selectedOptions??[],purposeOfAccount:a.purposeOfAccount?.selectedOption??void 0,purposeOfAccountDescription:a.purposeOfAccountDescription??void 0},incInfo:{typeOfInc:o.typeOfInc.selectedOption??"",stateOfInc:o.stateOfInc.selectedOption??"",incDate:s!=null?J(s?.toString()):s,fileId:o.fileIds[0]},taxDetails:{taxIdOrEIN:r.taxIdOrEIN,sicCode:r.sicCode,naicsCode:r.naicsCode,dunsNumber:r.dunsNumber,taxesFiledYears:h.selectedOptions.map(I=>parseInt(I)),fileId:r.fileIds[0]}};t(S({companyDetails:v}))},onPrimaryContactDetailsUpdated:e=>{t(S({primaryContact:{userId:e.userId,email:e.email.trim(),firstName:e.name.firstName,lastName:e.name.lastName}}))},onNewCompanyOfficerAdded:e=>{t(S({officers:[{officerType:e.officerType,email:e.email.trim(),phone:e.phone,firstName:e.name.firstName,lastName:e.name.lastName,userId:void 0}]}))},onNewCompanyOfficerRemoved:e=>{t(H(e))},onCompanyOfficerUpdated:e=>{t(S({officers:[{officerType:e.officerType,email:e.email.trim(),phone:e.phone,firstName:e.name.firstName,lastName:e.name.lastName,userId:e.userId}]}))},updateFilesEntity:e=>{t(q({files:e}))},onDeleteFile:e=>{t($(e))},onEditFileName:(e,a)=>{t(Z(e,a.split(".")[0]))}}})(j);function de(){const t=w(),n=k(),i=x(),{tenantEmailDomain:l}=T(),[c,p]=g.useState(!1),[f,e]=g.useState(!1),a=O(s=>s.companyViewState.passportView.fetchState),o=O(s=>s.companyConfigState.fetchState),r=O(s=>D(s)),d=r.companyId??C.getSignedInUserTenant(l)?.companyId;if(C.getSignedInUser()==null)throw Error("Can't access company details page without signing in...");g.useEffect(()=>{c||a!=="Not-Started"||d==null||(p(!0),n(_(d)))},[c,a,d,n]),g.useEffect(()=>{o==="Not-Started"&&n(M())},[o,n]);const u=s=>{e(s)},y=a==="Not-Started"||a==="In-Progress"||o==="Not-Started"||o==="In-Progress";return d!=null&&a==="Error"?m.jsx(F,{onGoHome:()=>t("../",{replace:!0}),onReload:()=>window.location.reload()}):m.jsxs(m.Fragment,{children:[m.jsx(L,{analytics:P,onLoad:s=>s.trackPageLoaded(V.Event.companyPassport,b(i)?"Settings":"Company Passport")}),b(i)?m.jsx(X,{isAppContentDrawerOpen:f,handleDrawerToggle:u}):null,m.jsx(ee,{companyId:d,navigate:t,location:i,isLoading:y,currentTenant:r,isSettings:b(i),onClickMenuIcon:()=>{u(!0)}})]})}export{de as C};
1
+ import{j as m}from"./liveblocks-CVGPqYnR.js";import{a as g}from"./sentry-vrLJXbkU.js";import{j as w,h as k,u as x,l as T,g as O,k as E}from"./core-B4ZvHvvY.js";import{z as C,aZ as F,s as L,c as P,e as V,aa as b,a_ as j,ao as A,ap as B,q as U}from"./index-DgzG0i4n.js";import{eL as D,fB as _,rd as M,fw as G,b$ as R,L4 as z,bm as Y,pl as Z,p9 as $,jG as q,la as S,L5 as H,bB as J,cr as N,li as K,ll as Q}from"./zeni-epic-state-Da4VO2lv.js";import"./mui-DoY7WfR_.js";import{c as W}from"./routePaths-WhbiYSxu.js";import{M as X}from"./MobileAppDrawer-eCdBXSxf.js";(function(){try{var t=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},n=new t.Error().stack;n&&(t._sentryDebugIds=t._sentryDebugIds||{},t._sentryDebugIds[n]="1d07f4aa-b122-486f-b308-44fce8e75d72",t._sentryDebugIdIdentifier="sentry-dbid-1d07f4aa-b122-486f-b308-44fce8e75d72")}catch{}})();const ee=E(function(t){const n=G(t),i=C.getSignedInUser(),l=D(t),c=l.tenantId,p={userId:i?.userId??"",sessionId:i?.zeniSessionId??"",tenantId:c??""},f=R(l?.userRole??[])&&n.localData.updateStatus.fetchState!=="In-Progress"?void 0:"readonly",e=z(t.companyConfigState),a=t.countryListState?.byCountryListCode?.nationalityCountryList?.countries??[];return{isCompanyVerified:n.companyView?.company?.company?.companyBillPayInfo?.companyVerificationStatus?.code==="verified",companyPassportView:n,allIndustries:e.companyIndustries??[],allNationalityCountries:a,isDisabled:f,authParams:p,filesEndPoint:`${A.fileMicroServiceBaseUrl}`,isZeniUser:Y(i)}},function(t,n){const{companyId:i,currentTenant:l,navigate:c,location:p}=n,{tenantEmailDomain:f}=l;return{onScheduleClick:e=>{let a=e.href;a.includes("http")||(a="https://".concat(a)),window.open(a,"_blank")},onSaveAll:()=>{t(Q())},onAddressClick:e=>{const a=W(f,e),o=U(p.state?.pathnameStackToGoBack,p.pathname);c(a,{state:{pathnameStackToGoBack:o}})},onResetClick:()=>{t(K({companyId:i}))},onBackClick:()=>{c("../")},onCompanyDetailsChanged:e=>{const{companyInfo:a,incInfo:o,taxDetails:r,zeniFinanceTeam:d}=e,{website:u}=a,{meetingLink:y}=d,{incDate:s}=o,{taxesFiledYears:h}=r,v={companyInfo:{...a,website:u!=""&&u!=null?N(u):void 0,meetingLink:y!=""&&y!=null?N(y):void 0,industry:a.industry.selectedOption,companyIndustryType:a.companyIndustryType?.selectedOption??void 0,companySubIndustry:a.subIndustry?.selectedOption??void 0,businessModel:a.businessModel.selectedOption??"",companySourceOfFunds:a.companySourceOfFunds?.selectedOption,companySourceOfFundsDescription:a.companySourceOfFundsDescription??void 0,countriesOfOperations:a.countriesOfOperations?.selectedOptions?.map(I=>I.length===2?I:B(I))??[],transactionVolume:a.transactionVolume?.selectedOption??void 0,transactionVolumeDescription:a.transactionVolumeDescription??void 0,regulatedStatus:a.regulatedStatus??void 0,regulatedStatusDescription:a.regulatedStatusDescription??void 0,usNexus:a.usNexus??void 0,usNexusTypes:a.usNexusTypes?.selectedOptions??[],purposeOfAccount:a.purposeOfAccount?.selectedOption??void 0,purposeOfAccountDescription:a.purposeOfAccountDescription??void 0},incInfo:{typeOfInc:o.typeOfInc.selectedOption??"",stateOfInc:o.stateOfInc.selectedOption??"",incDate:s!=null?J(s?.toString()):s,fileId:o.fileIds[0]},taxDetails:{taxIdOrEIN:r.taxIdOrEIN,sicCode:r.sicCode,naicsCode:r.naicsCode,dunsNumber:r.dunsNumber,taxesFiledYears:h.selectedOptions.map(I=>parseInt(I)),fileId:r.fileIds[0]}};t(S({companyDetails:v}))},onPrimaryContactDetailsUpdated:e=>{t(S({primaryContact:{userId:e.userId,email:e.email.trim(),firstName:e.name.firstName,lastName:e.name.lastName}}))},onNewCompanyOfficerAdded:e=>{t(S({officers:[{officerType:e.officerType,email:e.email.trim(),phone:e.phone,firstName:e.name.firstName,lastName:e.name.lastName,userId:void 0}]}))},onNewCompanyOfficerRemoved:e=>{t(H(e))},onCompanyOfficerUpdated:e=>{t(S({officers:[{officerType:e.officerType,email:e.email.trim(),phone:e.phone,firstName:e.name.firstName,lastName:e.name.lastName,userId:e.userId}]}))},updateFilesEntity:e=>{t(q({files:e}))},onDeleteFile:e=>{t($(e))},onEditFileName:(e,a)=>{t(Z(e,a.split(".")[0]))}}})(j);function de(){const t=w(),n=k(),i=x(),{tenantEmailDomain:l}=T(),[c,p]=g.useState(!1),[f,e]=g.useState(!1),a=O(s=>s.companyViewState.passportView.fetchState),o=O(s=>s.companyConfigState.fetchState),r=O(s=>D(s)),d=r.companyId??C.getSignedInUserTenant(l)?.companyId;if(C.getSignedInUser()==null)throw Error("Can't access company details page without signing in...");g.useEffect(()=>{c||a!=="Not-Started"||d==null||(p(!0),n(_(d)))},[c,a,d,n]),g.useEffect(()=>{o==="Not-Started"&&n(M())},[o,n]);const u=s=>{e(s)},y=a==="Not-Started"||a==="In-Progress"||o==="Not-Started"||o==="In-Progress";return d!=null&&a==="Error"?m.jsx(F,{onGoHome:()=>t("../",{replace:!0}),onReload:()=>window.location.reload()}):m.jsxs(m.Fragment,{children:[m.jsx(L,{analytics:P,onLoad:s=>s.trackPageLoaded(V.Event.companyPassport,b(i)?"Settings":"Company Passport")}),b(i)?m.jsx(X,{isAppContentDrawerOpen:f,handleDrawerToggle:u}):null,m.jsx(ee,{companyId:d,navigate:t,location:i,isLoading:y,currentTenant:r,isSettings:b(i),onClickMenuIcon:()=>{u(!0)}})]})}export{de as C};
@@ -1,4 +1,4 @@
1
- import{j as I}from"./liveblocks-CVGPqYnR.js";import{a}from"./sentry-vrLJXbkU.js";import{h as b,g as m,N as S}from"./core-B4ZvHvvY.js";import{HT as T,eL as y,fi as N,m1 as D,fI as E,fh as v,eM as w,H$ as A}from"./zeni-epic-state-Da4VO2lv.js";import{u as O,z as u,L as C,D as L,o as U}from"./index-DmE4wSNC.js";import{n as _}from"./mui-DoY7WfR_.js";import{t as j}from"./getLocaleForTenant-7ntdeZSs.js";import{Q as F}from"./QBOConnectionScreen-D4gTLUDW.js";import"./recharts-DNFnaP_v.js";import"./lottie-B5aSI3Li.js";import"./analytics-BL0geQNn.js";import"./plaid-C1RHGEem.js";import"./dnd-B2_m6pRT.js";import"./stripe-DMRn4zHo.js";import"./lexical-DA5yMmPj.js";import"./pdf-ChIJqwGf.js";import"./utils-QMlevttK.js";import"./empty-u93aQEuK.js";import"./pdf-lib-DK80DJM9.js";import"./index-CAShaDN8.js";import"./url-CcUoq1OV.js";import"./index-CWllm9J4.js";import"./decodeURIComponentSafe-CC7b77eX.js";(function(){try{var t=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},s=new t.Error().stack;s&&(t._sentryDebugIds=t._sentryDebugIds||{},t._sentryDebugIds[s]="dbc215c4-9a98-4d02-8332-7d2636fa91d4",t._sentryDebugIdIdentifier="sentry-dbid-dbc215c4-9a98-4d02-8332-7d2636fa91d4")}catch{}})();const H=_.div`
1
+ import{j as I}from"./liveblocks-CVGPqYnR.js";import{a}from"./sentry-vrLJXbkU.js";import{h as b,g as m,N as S}from"./core-B4ZvHvvY.js";import{HT as T,eL as y,fi as N,m1 as D,fI as E,fh as v,eM as w,H$ as A}from"./zeni-epic-state-Da4VO2lv.js";import{u as O,z as u,L as C,D as L,o as U}from"./index-DgzG0i4n.js";import{n as _}from"./mui-DoY7WfR_.js";import{t as j}from"./getLocaleForTenant-C50EFRQ8.js";import{Q as F}from"./QBOConnectionScreen-B4Rcl2XA.js";import"./recharts-DNFnaP_v.js";import"./lottie-B5aSI3Li.js";import"./analytics-BL0geQNn.js";import"./plaid-C1RHGEem.js";import"./dnd-B2_m6pRT.js";import"./stripe-DMRn4zHo.js";import"./lexical-DA5yMmPj.js";import"./pdf-ChIJqwGf.js";import"./utils-QMlevttK.js";import"./empty-u93aQEuK.js";import"./pdf-lib-DK80DJM9.js";import"./index-CAShaDN8.js";import"./url-CcUoq1OV.js";import"./index-CWllm9J4.js";import"./decodeURIComponentSafe-CC7b77eX.js";(function(){try{var t=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},s=new t.Error().stack;s&&(t._sentryDebugIds=t._sentryDebugIds||{},t._sentryDebugIds[s]="dbc215c4-9a98-4d02-8332-7d2636fa91d4",t._sentryDebugIdIdentifier="sentry-dbid-dbc215c4-9a98-4d02-8332-7d2636fa91d4")}catch{}})();const H=_.div`
2
2
  display: flex;
3
3
  flex: 1 1 auto;
4
4
  flex-direction: row;
@@ -1 +1 @@
1
- import{j as i}from"./liveblocks-CVGPqYnR.js";import{z as m}from"./index-DmE4wSNC.js";import{g as n}from"./QBOConnectionScreen-D4gTLUDW.js";import"./sentry-vrLJXbkU.js";import{u as p,N as a}from"./core-B4ZvHvvY.js";import"./zeni-epic-state-Da4VO2lv.js";import"./recharts-DNFnaP_v.js";import"./mui-DoY7WfR_.js";import"./lottie-B5aSI3Li.js";import"./analytics-BL0geQNn.js";import"./plaid-C1RHGEem.js";import"./dnd-B2_m6pRT.js";import"./stripe-DMRn4zHo.js";import"./lexical-DA5yMmPj.js";import"./pdf-ChIJqwGf.js";import"./utils-QMlevttK.js";import"./empty-u93aQEuK.js";import"./pdf-lib-DK80DJM9.js";import"./index-CAShaDN8.js";import"./url-CcUoq1OV.js";import"./index-CWllm9J4.js";import"./decodeURIComponentSafe-CC7b77eX.js";(function(){try{var t=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},o=new t.Error().stack;o&&(t._sentryDebugIds=t._sentryDebugIds||{},t._sentryDebugIds[o]="34360189-ad08-40f6-93e1-76035a2c6a6d",t._sentryDebugIdIdentifier="sentry-dbid-34360189-ad08-40f6-93e1-76035a2c6a6d")}catch{}})();const U=()=>{const t=p(),{code:o,realmId:r,state:e}=n(t.search),s=m.getSignedInUser()?.userId??"";if(f(o,r,e,s)===!0){const d=`../../${e}/onboarding?code=${o}&realmId=${r}&state=auth_flow`;return i.jsx(a,{to:d})}return i.jsx(a,{to:"../../"})},f=(t,o,r,e)=>t!=""&&o!=""&&r!=""&&e!=null&&e!="";export{U as default,f as hasValidParams};
1
+ import{j as i}from"./liveblocks-CVGPqYnR.js";import{z as m}from"./index-DgzG0i4n.js";import{g as n}from"./QBOConnectionScreen-B4Rcl2XA.js";import"./sentry-vrLJXbkU.js";import{u as p,N as a}from"./core-B4ZvHvvY.js";import"./zeni-epic-state-Da4VO2lv.js";import"./recharts-DNFnaP_v.js";import"./mui-DoY7WfR_.js";import"./lottie-B5aSI3Li.js";import"./analytics-BL0geQNn.js";import"./plaid-C1RHGEem.js";import"./dnd-B2_m6pRT.js";import"./stripe-DMRn4zHo.js";import"./lexical-DA5yMmPj.js";import"./pdf-ChIJqwGf.js";import"./utils-QMlevttK.js";import"./empty-u93aQEuK.js";import"./pdf-lib-DK80DJM9.js";import"./index-CAShaDN8.js";import"./url-CcUoq1OV.js";import"./index-CWllm9J4.js";import"./decodeURIComponentSafe-CC7b77eX.js";(function(){try{var t=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},o=new t.Error().stack;o&&(t._sentryDebugIds=t._sentryDebugIds||{},t._sentryDebugIds[o]="34360189-ad08-40f6-93e1-76035a2c6a6d",t._sentryDebugIdIdentifier="sentry-dbid-34360189-ad08-40f6-93e1-76035a2c6a6d")}catch{}})();const U=()=>{const t=p(),{code:o,realmId:r,state:e}=n(t.search),s=m.getSignedInUser()?.userId??"";if(f(o,r,e,s)===!0){const d=`../../${e}/onboarding?code=${o}&realmId=${r}&state=auth_flow`;return i.jsx(a,{to:d})}return i.jsx(a,{to:"../../"})},f=(t,o,r,e)=>t!=""&&o!=""&&r!=""&&e!=null&&e!="";export{U as default,f as hasValidParams};
@@ -1,4 +1,4 @@
1
- import{j as a}from"./liveblocks-CVGPqYnR.js";import{t as $e,A as Ie}from"./AddressScreen-Cud2BdS6.js";import ze from"./NotFoundScreen-Dw_4aXSt.js";import{a as g}from"./sentry-vrLJXbkU.js";import{j as oe,u as se,h as ie,l as re,g as D,N as E,k as ce,i as Me,n as Qe,o as M}from"./core-B4ZvHvvY.js";import{F as de,S as le,z as B,Z as ue,m as qe,i as _,q as V,s as W,c as N,B as je,e as X,ak as Ke,K as Ze,al as Ce,h as te,am as He,an as ke,o as We,ao as Je,ap as Ee,aq as Xe}from"./index-DmE4wSNC.js";import{bm as Ye,eL as ee,fa as et,eS as pe,eQ as me,bu as tt,l$ as at,f6 as nt,bL as ot,iK as ae,iN as ve,Iz as st,bQ as it,b$ as ge,rr as fe,rc as rt,IL as Y,rs as _e,Gj as ct,jO as Ue,IM as Ve,IN as dt,IO as lt,IP as ut,iI as pt,iL as mt,re as Be,rq as gt,bB as xe,cr as ft,rE as Te,pl as ht,p9 as yt,jG as St,fz as bt,fy as It,fx as Ct,IQ as kt,r6 as Et,rF as xt,rI as Tt,rL as Ot,rR as Pt,cR as At}from"./zeni-epic-state-Da4VO2lv.js";import{n as he}from"./mui-DoY7WfR_.js";import{g as Dt,h as Ft,q as ne}from"./QBOConnectionScreen-D4gTLUDW.js";import"./recharts-DNFnaP_v.js";import"./lottie-B5aSI3Li.js";import"./analytics-BL0geQNn.js";import"./plaid-C1RHGEem.js";import"./dnd-B2_m6pRT.js";import"./stripe-DMRn4zHo.js";import"./lexical-DA5yMmPj.js";import"./pdf-ChIJqwGf.js";import"./utils-QMlevttK.js";import"./empty-u93aQEuK.js";import"./pdf-lib-DK80DJM9.js";import"./index-CAShaDN8.js";import"./url-CcUoq1OV.js";import"./index-CWllm9J4.js";import"./decodeURIComponentSafe-CC7b77eX.js";(function(){try{var t=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},o=new t.Error().stack;o&&(t._sentryDebugIds=t._sentryDebugIds||{},t._sentryDebugIds[o]="065cef10-2514-478f-ba3f-ecff2fe4aab1",t._sentryDebugIdIdentifier="sentry-dbid-065cef10-2514-478f-ba3f-ecff2fe4aab1")}catch{}})();const wt=ce(function(t,o){const s=[];o.isApAgingFeatureEnabled===!1&&s.push("accounts_payable_aging"),o.isArAgingFeatureEnabled===!1&&s.push("accounts_receivable_aging"),o.shouldFetchZeniAccountsPromoCard===!1&&s.push("zeni_accounts_promo_card"),o.shouldFetchRewardsPlanCard===!1&&s.push("rewards_card"),o.isExpenseAutomationEnabledForUser===!1&&s.push("expense_automation_card");const u=nt(t,s,o.signedInUser,o.isExpenseAutomationFeatureEnabledV2,o.isExpenseAutomationEnabledForUser,o.isTreasuryEnabled);return{dashboardFetchState:ot(u.reportsInOrder.map(d=>({fetchState:d.fetchState,error:d.error}))).fetchState}},function(t,o){const{themeState:s,navigate:u,location:d}=o;return{onZeniLogoClick:()=>{s.toggle()},onDashboardFetchDone:()=>{const r=V(d.state?.pathnameStackToGoBack,d.pathname);u("../../dashboard",{state:{pathnameStackToGoBack:r,message:"activation"}})}}})(Ke),jt=()=>{const t=oe(),o=se(),s=ie(),u=de(),[d,r]=g.useState(!1),[p,S]=g.useState(!1),{tenantEmailDomain:e}=re(),n=le(),i=B.getSignedInUser(),f=Ye(i),{useFeatureGate:m}=ue(),k=qe(),{isFeatureEnabled:x}=m(_.isApAgingFeatureEnabled),{isFeatureEnabled:T}=m(_.isArAgingFeatureEnabled),{isFeatureEnabled:C}=m(_.isDepositAccountsFeatureEnabled),{isFeatureEnabled:h}=m(_.isReferralFeatureEnabled),{isFeatureEnabled:U}=m(_.isExpenseAutomationEnabled),{isFeatureEnabled:I}=m(_.isExpenseAutomationEnabledV2),{isFeatureEnabled:F}=m(_.isDebitCardFeatureEnabled),$=I||U&&f,c=D(l=>ee(l)),{isFeatureEnabled:L}=m(_.isTreasuryEnabled),w=c.company!=null&&et(c.company),R=L&&w,O=D(l=>l.onboardingCustomerViewState.fetchState),b=c.excludedResources,G=c.companyId??B.getSignedInUserTenant(e)?.companyId;if(i==null)throw Error("Can't access onboarding flow without signing in...");const j=pe(F,c),P=me(c),A=[],K=b?.resources?.find(l=>l.resource==="/reports/top_expenses")==null,z=b?.resources?.find(l=>l.resource==="/reports/task_card")==null,Q=c?.userRole!=null&&tt(c?.userRole),v=b?.resources?.find(l=>l.resource==="/bills")==null&&!Q,q=b?.resources?.find(l=>l.resource==="/reimbursements")==null;if(K===!1&&A.push("top_expenses"),z===!1&&A.push("task_card"),v===!1&&A.push("bill_pay_card","bill_pay_promo_card"),q===!1&&A.push("reimbursement_card","reimbursement_promo_card"),C===!1&&A.push("zeni_accounts_promo_card"),h===!1&&A.push("rewards_card"),g.useEffect(()=>{O!=="Completed"||d||j||P||(r(!0),s(at(i.userId,G,c.tenantId,!0,!1,A)))},[d,O,j,P,i,c.tenantId,s]),g.useEffect(()=>{(j||P)&&setTimeout(()=>{S(!0)},5e3)},[j,P]),O!=="Completed")return a.jsx(E,{to:"../"});if(O==="Completed"&&p){const l=V(o.state?.pathnameStackToGoBack,o.pathname);if(j)return a.jsx(E,{to:"../../checking",state:{...o.state,pathnameStackToGoBack:l,message:"activation"}});if(P)return a.jsx(E,{to:"../../cards",state:{...o.state,pathnameStackToGoBack:l,message:"activation"}})}return n?.loggedInUserRoleMap!=null?a.jsxs(a.Fragment,{children:[a.jsx(W,{analytics:N,onLoad:l=>(Z=>Z.trackPageLoaded(X.Event.onboardingDashboardActivation))(l)}),a.jsx(wt,{navigate:t,location:o,themeState:u,signedInUser:i,isApAgingFeatureEnabled:x,isArAgingFeatureEnabled:T,shouldFetchZeniAccountsPromoCard:C,shouldFetchRewardsPlanCard:h,isExpenseAutomationEnabledForUser:$,isExpenseAutomationFeatureEnabledV2:I,isTreasuryEnabled:R,loggedInUserRoleMap:n?.loggedInUserRoleMap})]}):a.jsx(je,{fetchState:"In-Progress",style:{backgroundColor:k.colors.grey5}})},Oe=he.div`
1
+ import{j as a}from"./liveblocks-CVGPqYnR.js";import{t as $e,A as Ie}from"./AddressScreen-B-90Ns9M.js";import ze from"./NotFoundScreen-jPpbDlQd.js";import{a as g}from"./sentry-vrLJXbkU.js";import{j as oe,u as se,h as ie,l as re,g as D,N as E,k as ce,i as Me,n as Qe,o as M}from"./core-B4ZvHvvY.js";import{F as de,S as le,z as B,Z as ue,m as qe,i as _,q as V,s as W,c as N,B as je,e as X,ak as Ke,K as Ze,al as Ce,h as te,am as He,an as ke,o as We,ao as Je,ap as Ee,aq as Xe}from"./index-DgzG0i4n.js";import{bm as Ye,eL as ee,fa as et,eS as pe,eQ as me,bu as tt,l$ as at,f6 as nt,bL as ot,iK as ae,iN as ve,Iz as st,bQ as it,b$ as ge,rr as fe,rc as rt,IL as Y,rs as _e,Gj as ct,jO as Ue,IM as Ve,IN as dt,IO as lt,IP as ut,iI as pt,iL as mt,re as Be,rq as gt,bB as xe,cr as ft,rE as Te,pl as ht,p9 as yt,jG as St,fz as bt,fy as It,fx as Ct,IQ as kt,r6 as Et,rF as xt,rI as Tt,rL as Ot,rR as Pt,cR as At}from"./zeni-epic-state-Da4VO2lv.js";import{n as he}from"./mui-DoY7WfR_.js";import{g as Dt,h as Ft,q as ne}from"./QBOConnectionScreen-B4Rcl2XA.js";import"./recharts-DNFnaP_v.js";import"./lottie-B5aSI3Li.js";import"./analytics-BL0geQNn.js";import"./plaid-C1RHGEem.js";import"./dnd-B2_m6pRT.js";import"./stripe-DMRn4zHo.js";import"./lexical-DA5yMmPj.js";import"./pdf-ChIJqwGf.js";import"./utils-QMlevttK.js";import"./empty-u93aQEuK.js";import"./pdf-lib-DK80DJM9.js";import"./index-CAShaDN8.js";import"./url-CcUoq1OV.js";import"./index-CWllm9J4.js";import"./decodeURIComponentSafe-CC7b77eX.js";(function(){try{var t=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},o=new t.Error().stack;o&&(t._sentryDebugIds=t._sentryDebugIds||{},t._sentryDebugIds[o]="065cef10-2514-478f-ba3f-ecff2fe4aab1",t._sentryDebugIdIdentifier="sentry-dbid-065cef10-2514-478f-ba3f-ecff2fe4aab1")}catch{}})();const wt=ce(function(t,o){const s=[];o.isApAgingFeatureEnabled===!1&&s.push("accounts_payable_aging"),o.isArAgingFeatureEnabled===!1&&s.push("accounts_receivable_aging"),o.shouldFetchZeniAccountsPromoCard===!1&&s.push("zeni_accounts_promo_card"),o.shouldFetchRewardsPlanCard===!1&&s.push("rewards_card"),o.isExpenseAutomationEnabledForUser===!1&&s.push("expense_automation_card");const u=nt(t,s,o.signedInUser,o.isExpenseAutomationFeatureEnabledV2,o.isExpenseAutomationEnabledForUser,o.isTreasuryEnabled);return{dashboardFetchState:ot(u.reportsInOrder.map(d=>({fetchState:d.fetchState,error:d.error}))).fetchState}},function(t,o){const{themeState:s,navigate:u,location:d}=o;return{onZeniLogoClick:()=>{s.toggle()},onDashboardFetchDone:()=>{const r=V(d.state?.pathnameStackToGoBack,d.pathname);u("../../dashboard",{state:{pathnameStackToGoBack:r,message:"activation"}})}}})(Ke),jt=()=>{const t=oe(),o=se(),s=ie(),u=de(),[d,r]=g.useState(!1),[p,S]=g.useState(!1),{tenantEmailDomain:e}=re(),n=le(),i=B.getSignedInUser(),f=Ye(i),{useFeatureGate:m}=ue(),k=qe(),{isFeatureEnabled:x}=m(_.isApAgingFeatureEnabled),{isFeatureEnabled:T}=m(_.isArAgingFeatureEnabled),{isFeatureEnabled:C}=m(_.isDepositAccountsFeatureEnabled),{isFeatureEnabled:h}=m(_.isReferralFeatureEnabled),{isFeatureEnabled:U}=m(_.isExpenseAutomationEnabled),{isFeatureEnabled:I}=m(_.isExpenseAutomationEnabledV2),{isFeatureEnabled:F}=m(_.isDebitCardFeatureEnabled),$=I||U&&f,c=D(l=>ee(l)),{isFeatureEnabled:L}=m(_.isTreasuryEnabled),w=c.company!=null&&et(c.company),R=L&&w,O=D(l=>l.onboardingCustomerViewState.fetchState),b=c.excludedResources,G=c.companyId??B.getSignedInUserTenant(e)?.companyId;if(i==null)throw Error("Can't access onboarding flow without signing in...");const j=pe(F,c),P=me(c),A=[],K=b?.resources?.find(l=>l.resource==="/reports/top_expenses")==null,z=b?.resources?.find(l=>l.resource==="/reports/task_card")==null,Q=c?.userRole!=null&&tt(c?.userRole),v=b?.resources?.find(l=>l.resource==="/bills")==null&&!Q,q=b?.resources?.find(l=>l.resource==="/reimbursements")==null;if(K===!1&&A.push("top_expenses"),z===!1&&A.push("task_card"),v===!1&&A.push("bill_pay_card","bill_pay_promo_card"),q===!1&&A.push("reimbursement_card","reimbursement_promo_card"),C===!1&&A.push("zeni_accounts_promo_card"),h===!1&&A.push("rewards_card"),g.useEffect(()=>{O!=="Completed"||d||j||P||(r(!0),s(at(i.userId,G,c.tenantId,!0,!1,A)))},[d,O,j,P,i,c.tenantId,s]),g.useEffect(()=>{(j||P)&&setTimeout(()=>{S(!0)},5e3)},[j,P]),O!=="Completed")return a.jsx(E,{to:"../"});if(O==="Completed"&&p){const l=V(o.state?.pathnameStackToGoBack,o.pathname);if(j)return a.jsx(E,{to:"../../checking",state:{...o.state,pathnameStackToGoBack:l,message:"activation"}});if(P)return a.jsx(E,{to:"../../cards",state:{...o.state,pathnameStackToGoBack:l,message:"activation"}})}return n?.loggedInUserRoleMap!=null?a.jsxs(a.Fragment,{children:[a.jsx(W,{analytics:N,onLoad:l=>(Z=>Z.trackPageLoaded(X.Event.onboardingDashboardActivation))(l)}),a.jsx(wt,{navigate:t,location:o,themeState:u,signedInUser:i,isApAgingFeatureEnabled:x,isArAgingFeatureEnabled:T,shouldFetchZeniAccountsPromoCard:C,shouldFetchRewardsPlanCard:h,isExpenseAutomationEnabledForUser:$,isExpenseAutomationFeatureEnabledV2:I,isTreasuryEnabled:R,loggedInUserRoleMap:n?.loggedInUserRoleMap})]}):a.jsx(je,{fetchState:"In-Progress",style:{backgroundColor:k.colors.grey5}})},Oe=he.div`
2
2
  display: flex;
3
3
  height: 100vh;
4
4
  background-color: ${t=>t.theme.colors.grey4};
@@ -1,4 +1,4 @@
1
- import{j as i}from"./liveblocks-CVGPqYnR.js";import{l as N,g as k,u as $,h as V,j as Z,k as q,n as Je,o as D}from"./core-B4ZvHvvY.js";import{eL as j,J4 as Fe,bB as Ut,bp as de,Kh as Va,hy as Ga,Ki as Tt,Kj as Na,hB as We,Kk as we,Kl as za,hG as $a,Km as wt,Kn as Za,hK as et,Ko as xe,Kp as qa,cN as at,Kq as Ha,Kr as Xa,Jo as Qa,iE as Ja,Ks as Wa,bm as _e,Kt,IU as W,bc as Yt,iS as Vt,m9 as Gt,iB as Nt,IW as ee,IV as z,Ku as en,Kv as tn,Kw as zt,Kx as pe,tc as ke,td as ye,tA as ue,tu as te,th as Se,Ky as an,Kz as nn,KA as on,KB as $t,KC as he,KD as sn,dF as Oe,pV as Zt,KE as rn,KF as cn,KG as ln,KH as nt,Ij as ot,j6 as st,tI as rt,q1 as dn,KI as un,te as xt,pY as ie,pU as qt,KJ as oe,KK as mn,KL as ct,Ii as it,rV as Ht,KM as pn,KN as hn,KO as fn,KP as lt,s6 as gn,KQ as bn,tg as Dt,rU as Xt,KR as se,KS as Cn,bu as Qt,tM as Jt,KT as _n,KU as kn,KV as yn,KW as dt,tH as Sn,KX as vn,tf as Ft,tL as Wt,KY as re,KZ as In,K_ as An,K$ as ea,iX as ta,m6 as aa,j0 as na,m4 as oa,m3 as sa,m2 as ra,rh as En,fa as Tn,cK as wn,cL as xn,l$ as Dn,f6 as Fn,mf as On,L0 as Pn,CQ as Bn,L1 as Rn,L2 as jn,L3 as Mn,b5 as ut,eY as Ln,gu as Un,fB as Kn,ma as Yn,iu as Vn,m7 as Gn,m5 as Nn,eS as zn,eQ as $n}from"./zeni-epic-state-Da4VO2lv.js";import{z as B,R as H,q as F,c as S,D as G,aP as Zn,J as Pe,s as ve,aQ as ca,e as K,aR as qn,S as Ie,aS as ia,Z as mt,i as M,m as Hn,aT as Xn,aU as Qn,aV as Ae,aW as Jn,a as Wn,al as eo,aI as to,p as ao,M as no,aX as oo,aY as ge}from"./index-DmE4wSNC.js";import{n as pt}from"./mui-DoY7WfR_.js";import{a as _}from"./sentry-vrLJXbkU.js";import{w as la}from"./withTransactionSidePanel-DMUIu-an.js";import{b as da,t as me,e as ae,a as ht,v as so}from"./routePaths-BbBoI9fr.js";import{u as Be}from"./useAskAiCfoHostNavButtonProps-Djdv5hKX.js";import{c as Re}from"./useFetchSuggestedQuestionsWhenReady-Cfhk-A1n.js";import Ce from"./NotFoundScreen-Dw_4aXSt.js";import{t as ua}from"./analyticsHelper-ZM4U1wiv.js";import{C as ro}from"./CompanyPassportScreen-Gd7wTdjI.js";import{F as co}from"./FeaturePreviewScreen-BdQUVLIb.js";import{R as io}from"./ReferralListScreen-BnWOANU0.js";import"./recharts-DNFnaP_v.js";import"./lottie-B5aSI3Li.js";import"./analytics-BL0geQNn.js";import"./plaid-C1RHGEem.js";import"./dnd-B2_m6pRT.js";import"./stripe-DMRn4zHo.js";import"./lexical-DA5yMmPj.js";import"./pdf-ChIJqwGf.js";import"./utils-QMlevttK.js";import"./TransactionDetailScreen-DvpEF447.js";import"./decodeURIComponentSafe-CC7b77eX.js";import"./MobileAppDrawer-DVJrG_df.js";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},a=new e.Error().stack;a&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[a]="92ad60db-90ba-4c66-b45d-eccce278883d",e._sentryDebugIdIdentifier="sentry-dbid-92ad60db-90ba-4c66-b45d-eccce278883d")}catch{}})();const lo=la(function({openTransactionPanel:e,panelContent:a,sidePanelIsOpen:t,sidePanelIsFullView:n}){const{vendorId:o,reportDate:r}=N(),s=B.getSignedInUser(),c=k(T=>T.tenantState.currentTenantId),u=k(T=>j(T)),{tenantEmailDomain:m}=N(),C=$(),b=u?.companyName??"",h={userId:s?.userId??"",sessionId:s?.zeniSessionId??"",tenantId:c??""},l=_.useMemo(()=>({authParams:h,companyName:b,downloadEndPoint:`${H}/agingDetailedReport`,timezone:Fe()}),[]),d=_.useMemo(()=>r!=null?Ut(r):de(),[r]),p=V(),g=Z(),f=k(T=>Va(T,d,o)),v=_.useCallback(()=>{o!=null&&f.fetchState!=="In-Progress"&&f.fetchState!=="Completed"&&p(Ga(o,d))},[d]),E=_.useCallback(()=>{g("../../",{relative:"path"})},[]),R=_.useCallback((T,X)=>{p(Tt({sortKey:T,sortOrder:X}))},[]),A=_.useCallback(T=>{p(Tt({downloadState:T}))},[]),I=_.useCallback(T=>{if(e)e(T.transactionId,T.transactionType);else if(m!=null){const X=da({id:T.transactionId,type:T.transactionType},m);g(X);const Me=F(C.state?.pathnameStackToGoBack,C.pathname);g(X,{state:{pathnameStackToGoBack:Me}})}},[m,e]),x=_.useCallback(()=>{f.vendor!=null&&S.trackApAgingDetail("AP Aging",d.format(G.getLocalizedStrings().dateFormat.analytics.YYYYDashMMDashDDFormat),f.vendor.id,f.vendor.name)},[f.vendor,d]);return _.useEffect(()=>{v()},[]),_.useEffect(()=>{f.fetchState==="Completed"&&x()},[x,f.fetchState]),i.jsx(Zn,{apAgingDetail:f,downloadParams:l,reportDate:d,analytics:S,onTransactionClick:I,onReload:v,onBackClick:E,onColumnSortConfigChanged:R,updateDownloadStateHandler:A,panelContent:a,sidePanelIsOpen:t,sidePanelIsFullView:n})}),uo=()=>{const{isAiCfoOpen:e,setIsAiCfoOpen:a}=Pe(),t=V(),n=Z(),o=k(I=>Na(I)),{isAiCfoAccessEnabled:r,onAskAiCfoClick:s}=Be({isAiCfoOpen:e,setIsAiCfoOpen:a,mobileExploreReferrer:"AP Aging"});Re({isDataReady:o.fetchState==="Completed"});const c=B.getSignedInUser(),u=k(I=>I.tenantState.currentTenantId),m=k(I=>j(I)),C=m?.companyName??"",b={userId:c?.userId??"",sessionId:c?.zeniSessionId??"",tenantId:u??""},h=_.useMemo(()=>({authParams:b,companyName:C,downloadEndPoint:`${H}/agingReport`,timezone:Fe()}),[]),l=o.apAgingUIState.selectedDate??de(),d=_.useCallback(()=>{o.fetchState!=="In-Progress"&&o.fetchState!=="Completed"&&t(We(l))},[]);_.useEffect(()=>{d()},[]);const p=_.useCallback(()=>{n("../",{relative:"path"})},[]),g=_.useCallback(I=>{t(we({searchString:I}))},[]),f=_.useCallback((I,x)=>{t(we({sortKey:x,sortOrder:I}))},[]),v=_.useCallback(I=>{n(`./${I}/${l.format(G.getLocalizedStrings().dateFormat.analytics.YYYYDashMMDashDDFormat)}`)},[l]),E=_.useCallback(I=>{t(we({downloadState:I}))},[]),R=_.useCallback((I,x)=>{},[]),A=_.useCallback((I,x)=>{t(we({selectedDate:I,agingDateSelectionType:x})),t(We(I))},[]);return i.jsxs(i.Fragment,{children:[o.fetchState==="Completed"?i.jsx(ve,{analytics:S,onLoad:I=>I.trackPageLoaded(K.Event.agingReport,"AP Aging")}):null,i.jsx(ca,{uiState:o.apAgingUIState,report:o,downloadParams:h,analytics:S,onReloadReport:d,onBackClick:p,onSearchTextChange:g,onSortOrderChange:f,onEntityNameClick:v,updateDownloadStateHandler:E,onSelectedDateChanged:A,onNodeCollapseToggled:R,isAiCfoAccessEnabled:r,onAskAiCfoClick:s})]})},mo=la(function({openTransactionPanel:e,panelContent:a,sidePanelIsOpen:t,sidePanelIsFullView:n}){const{customerId:o,reportDate:r}=N(),s=B.getSignedInUser(),c=k(x=>j(x)),{tenantEmailDomain:u}=N(),m=$(),C=c.companyName,b={userId:s?.userId??"",sessionId:s?.zeniSessionId??"",tenantId:c.tenantId},h=_.useMemo(()=>({authParams:b,companyName:C,downloadEndPoint:`${H}/agingDetailedReport`,timezone:Fe()}),[]),l=_.useMemo(()=>r!=null?Ut(r):de(),[r]),d=V(),p=Z(),g=k(x=>za(x,l,o)),f=_.useCallback(()=>{o!=null&&g.fetchState!=="In-Progress"&&g.fetchState!=="Completed"&&d($a(o,l))},[l]),v=_.useCallback(()=>{p("../../",{relative:"path"})},[]),E=_.useCallback((x,T)=>{d(wt({sortKey:x,sortOrder:T}))},[]),R=_.useCallback(x=>{d(wt({downloadState:x}))},[]),A=_.useCallback(x=>{if(e)e(x.transactionId,x.transactionType);else if(u!=null){const T=da({id:x.transactionId,type:x.transactionType},u);p(T);const X=F(m.state?.pathnameStackToGoBack,m.pathname);p(T,{state:{pathnameStackToGoBack:X}})}},[u,e]),I=_.useCallback(()=>{g.customer!=null&&S.trackArAgingDetail("AR Aging",l.format(G.getLocalizedStrings().dateFormat.analytics.YYYYDashMMDashDDFormat),g.customer.id,g.customer.name)},[g.customer,l]);return _.useEffect(()=>{f()},[]),_.useEffect(()=>{g.fetchState==="Completed"&&I()},[g.fetchState,I]),i.jsx(qn,{arAgingDetail:g,downloadParams:h,reportDate:l,analytics:S,onTransactionClick:A,onReload:f,onBackClick:v,onColumnSortConfigChanged:E,updateDownloadStateHandler:R,panelContent:a,sidePanelIsOpen:t,sidePanelIsFullView:n})}),po=()=>{const{isAiCfoOpen:e,setIsAiCfoOpen:a}=Pe(),t=V(),n=Z(),o=k(A=>Za(A)),{isAiCfoAccessEnabled:r,onAskAiCfoClick:s}=Be({isAiCfoOpen:e,setIsAiCfoOpen:a,mobileExploreReferrer:"AR Aging"});Re({isDataReady:o.fetchState==="Completed"});const c=B.getSignedInUser(),u=k(A=>j(A)),m=u.companyName,C={userId:c?.userId??"",sessionId:c?.zeniSessionId??"",tenantId:u.tenantId},b=_.useMemo(()=>({authParams:C,companyName:m,downloadEndPoint:`${H}/agingReport`,timezone:Fe()}),[]),h=o.arAgingUIState.selectedDate??de(),l=_.useCallback(()=>{o.fetchState!=="In-Progress"&&o.fetchState!=="Completed"&&t(et(h))},[]);_.useEffect(()=>{l()},[]);const d=_.useCallback(()=>{n("../",{relative:"path"})},[]),p=_.useCallback(A=>{t(xe({searchString:A}))},[]),g=_.useCallback((A,I)=>{t(xe({sortKey:I,sortOrder:A}))},[]),f=_.useCallback(A=>{n(`./${A}/${h.format(G.getLocalizedStrings().dateFormat.analytics.YYYYDashMMDashDDFormat)}`)},[h]),v=_.useCallback(A=>{t(xe({downloadState:A}))},[]),E=_.useCallback((A,I)=>{t(xe({selectedDate:A,agingDateSelectionType:I})),t(et(A))},[]),R=_.useCallback((A,I)=>{t(qa({nodeId:A,isCollapsed:I}))},[]);return i.jsxs(i.Fragment,{children:[o.fetchState==="Completed"?i.jsx(ve,{analytics:S,onLoad:A=>A.trackPageLoaded(K.Event.agingReport,"AR Aging")}):null,i.jsx(ca,{uiState:o.arAgingUIState,report:o,downloadParams:b,analytics:S,onReloadReport:l,onBackClick:d,onSearchTextChange:p,onSortOrderChange:g,onEntityNameClick:f,updateDownloadStateHandler:v,onSelectedDateChanged:E,onNodeCollapseToggled:R,isAiCfoAccessEnabled:r,onAskAiCfoClick:s})]})},ma=(e,a)=>({key:a,title:e.accountName,amount:e.balance?.available,logoUri:e.logo?.toString(),source:e});function pa(e,a){const t=Qa(a.firstMonthOfFY);return{onItemClick:(n,o)=>{const r=o.accountName===""?o.accountDescription:o.accountName,s=me(a.tenantEmailDomain,o.accountId,o.accountType,r,"quarter",t,!1),c=F(a.location.state?.pathnameStackToGoBack,a.location.pathname);a.navigate(s,{state:{pathnameStackToGoBack:c,referrer:a.referrerType}})},onSetAccountsStatementDate:(n,o)=>{e(Ja(n,o))},onPromoCardBtnClick:n=>{if(a.isZeniAccountsAdmin){let o=`../../checking/${n}`;n?S.trackZeniAccountsCashBalancePromoClicked("Move Money"):(S.trackZeniAccountsCashBalancePromoClicked("Sign Up for Free"),o="../../checking/promo");const r=F(a.location.state?.pathnameStackToGoBack,a.location.pathname);a.navigate(o,{state:{pathnameStackToGoBack:r}})}else S.trackZeniAccountsCashBalancePromoClicked("Learn More"),window.open("https://www.zeni.ai/product/business-checking-accounts","_blank")}}}const ho=q(function(e){const a=Ha(e).accountsInOrder.map((n,o)=>ma(n,o)),t=Xa(e);return{sectionTitle:G.getLocalizedStrings().balanceCard.cashBalanceSectionTitle,transactionArray:a,zeniAccountsPromoCardReport:t,fetchState:e.cashBalanceState.fetchState,analytics:S}},pa)(ia),fo=q(function(e){const a=Wa(e).accountsInOrder.map((o,r)=>ma(o,r)),t=B.getSignedInUser(),n=_e(t);return{sectionTitle:G.getLocalizedStrings().balanceCard.cardBalanceSectionTitle,transactionArray:a,isZeniUser:n,fetchState:e.cardBalanceState.fetchState,analytics:S}},pa)(ia);function go(){const e=Z(),a=$(),{tenantEmailDomain:t}=N(),n=Ie(),o=k(s=>j(s).company?.companyInfo.firstMonthOfFY??1),r=at(n?.loggedInUserRoleMap);return k(s=>s.cashBalanceState.fetchState)==="Error"?i.jsx(Ce,{}):i.jsx(ho,{tenantEmailDomain:t,location:a,referrerType:"Cash Balance",navigate:e,isZeniAccountsAdmin:r,firstMonthOfFY:o})}function bo(){const e=Z(),a=$(),{tenantEmailDomain:t}=N(),n=Ie(),o=at(n?.loggedInUserRoleMap),r=k(s=>j(s).company?.companyInfo.firstMonthOfFY??1);return k(s=>s.cardBalanceState.fetchState)==="Error"?i.jsx(Ce,{}):i.jsx(fo,{tenantEmailDomain:t,location:a,referrerType:"Card Balance",navigate:e,isZeniAccountsAdmin:o,firstMonthOfFY:r})}const Co=pt.div`
1
+ import{j as i}from"./liveblocks-CVGPqYnR.js";import{l as N,g as k,u as $,h as V,j as Z,k as q,n as Je,o as D}from"./core-B4ZvHvvY.js";import{eL as j,J4 as Fe,bB as Ut,bp as de,Kh as Va,hy as Ga,Ki as Tt,Kj as Na,hB as We,Kk as we,Kl as za,hG as $a,Km as wt,Kn as Za,hK as et,Ko as xe,Kp as qa,cN as at,Kq as Ha,Kr as Xa,Jo as Qa,iE as Ja,Ks as Wa,bm as _e,Kt,IU as W,bc as Yt,iS as Vt,m9 as Gt,iB as Nt,IW as ee,IV as z,Ku as en,Kv as tn,Kw as zt,Kx as pe,tc as ke,td as ye,tA as ue,tu as te,th as Se,Ky as an,Kz as nn,KA as on,KB as $t,KC as he,KD as sn,dF as Oe,pV as Zt,KE as rn,KF as cn,KG as ln,KH as nt,Ij as ot,j6 as st,tI as rt,q1 as dn,KI as un,te as xt,pY as ie,pU as qt,KJ as oe,KK as mn,KL as ct,Ii as it,rV as Ht,KM as pn,KN as hn,KO as fn,KP as lt,s6 as gn,KQ as bn,tg as Dt,rU as Xt,KR as se,KS as Cn,bu as Qt,tM as Jt,KT as _n,KU as kn,KV as yn,KW as dt,tH as Sn,KX as vn,tf as Ft,tL as Wt,KY as re,KZ as In,K_ as An,K$ as ea,iX as ta,m6 as aa,j0 as na,m4 as oa,m3 as sa,m2 as ra,rh as En,fa as Tn,cK as wn,cL as xn,l$ as Dn,f6 as Fn,mf as On,L0 as Pn,CQ as Bn,L1 as Rn,L2 as jn,L3 as Mn,b5 as ut,eY as Ln,gu as Un,fB as Kn,ma as Yn,iu as Vn,m7 as Gn,m5 as Nn,eS as zn,eQ as $n}from"./zeni-epic-state-Da4VO2lv.js";import{z as B,R as H,q as F,c as S,D as G,aP as Zn,J as Pe,s as ve,aQ as ca,e as K,aR as qn,S as Ie,aS as ia,Z as mt,i as M,m as Hn,aT as Xn,aU as Qn,aV as Ae,aW as Jn,a as Wn,al as eo,aI as to,p as ao,M as no,aX as oo,aY as ge}from"./index-DgzG0i4n.js";import{n as pt}from"./mui-DoY7WfR_.js";import{a as _}from"./sentry-vrLJXbkU.js";import{w as la}from"./withTransactionSidePanel-D3gZnvfm.js";import{b as da,t as me,e as ae,a as ht,v as so}from"./routePaths-WhbiYSxu.js";import{u as Be}from"./useAskAiCfoHostNavButtonProps-DQFYXydp.js";import{c as Re}from"./useFetchSuggestedQuestionsWhenReady-BMFUNkte.js";import Ce from"./NotFoundScreen-jPpbDlQd.js";import{t as ua}from"./analyticsHelper-B-IDLpaZ.js";import{C as ro}from"./CompanyPassportScreen-BCPm2c8T.js";import{F as co}from"./FeaturePreviewScreen-C2dbroTQ.js";import{R as io}from"./ReferralListScreen-DHtLnulq.js";import"./recharts-DNFnaP_v.js";import"./lottie-B5aSI3Li.js";import"./analytics-BL0geQNn.js";import"./plaid-C1RHGEem.js";import"./dnd-B2_m6pRT.js";import"./stripe-DMRn4zHo.js";import"./lexical-DA5yMmPj.js";import"./pdf-ChIJqwGf.js";import"./utils-QMlevttK.js";import"./TransactionDetailScreen-BCiX38jP.js";import"./decodeURIComponentSafe-CC7b77eX.js";import"./MobileAppDrawer-eCdBXSxf.js";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},a=new e.Error().stack;a&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[a]="92ad60db-90ba-4c66-b45d-eccce278883d",e._sentryDebugIdIdentifier="sentry-dbid-92ad60db-90ba-4c66-b45d-eccce278883d")}catch{}})();const lo=la(function({openTransactionPanel:e,panelContent:a,sidePanelIsOpen:t,sidePanelIsFullView:n}){const{vendorId:o,reportDate:r}=N(),s=B.getSignedInUser(),c=k(T=>T.tenantState.currentTenantId),u=k(T=>j(T)),{tenantEmailDomain:m}=N(),C=$(),b=u?.companyName??"",h={userId:s?.userId??"",sessionId:s?.zeniSessionId??"",tenantId:c??""},l=_.useMemo(()=>({authParams:h,companyName:b,downloadEndPoint:`${H}/agingDetailedReport`,timezone:Fe()}),[]),d=_.useMemo(()=>r!=null?Ut(r):de(),[r]),p=V(),g=Z(),f=k(T=>Va(T,d,o)),v=_.useCallback(()=>{o!=null&&f.fetchState!=="In-Progress"&&f.fetchState!=="Completed"&&p(Ga(o,d))},[d]),E=_.useCallback(()=>{g("../../",{relative:"path"})},[]),R=_.useCallback((T,X)=>{p(Tt({sortKey:T,sortOrder:X}))},[]),A=_.useCallback(T=>{p(Tt({downloadState:T}))},[]),I=_.useCallback(T=>{if(e)e(T.transactionId,T.transactionType);else if(m!=null){const X=da({id:T.transactionId,type:T.transactionType},m);g(X);const Me=F(C.state?.pathnameStackToGoBack,C.pathname);g(X,{state:{pathnameStackToGoBack:Me}})}},[m,e]),x=_.useCallback(()=>{f.vendor!=null&&S.trackApAgingDetail("AP Aging",d.format(G.getLocalizedStrings().dateFormat.analytics.YYYYDashMMDashDDFormat),f.vendor.id,f.vendor.name)},[f.vendor,d]);return _.useEffect(()=>{v()},[]),_.useEffect(()=>{f.fetchState==="Completed"&&x()},[x,f.fetchState]),i.jsx(Zn,{apAgingDetail:f,downloadParams:l,reportDate:d,analytics:S,onTransactionClick:I,onReload:v,onBackClick:E,onColumnSortConfigChanged:R,updateDownloadStateHandler:A,panelContent:a,sidePanelIsOpen:t,sidePanelIsFullView:n})}),uo=()=>{const{isAiCfoOpen:e,setIsAiCfoOpen:a}=Pe(),t=V(),n=Z(),o=k(I=>Na(I)),{isAiCfoAccessEnabled:r,onAskAiCfoClick:s}=Be({isAiCfoOpen:e,setIsAiCfoOpen:a,mobileExploreReferrer:"AP Aging"});Re({isDataReady:o.fetchState==="Completed"});const c=B.getSignedInUser(),u=k(I=>I.tenantState.currentTenantId),m=k(I=>j(I)),C=m?.companyName??"",b={userId:c?.userId??"",sessionId:c?.zeniSessionId??"",tenantId:u??""},h=_.useMemo(()=>({authParams:b,companyName:C,downloadEndPoint:`${H}/agingReport`,timezone:Fe()}),[]),l=o.apAgingUIState.selectedDate??de(),d=_.useCallback(()=>{o.fetchState!=="In-Progress"&&o.fetchState!=="Completed"&&t(We(l))},[]);_.useEffect(()=>{d()},[]);const p=_.useCallback(()=>{n("../",{relative:"path"})},[]),g=_.useCallback(I=>{t(we({searchString:I}))},[]),f=_.useCallback((I,x)=>{t(we({sortKey:x,sortOrder:I}))},[]),v=_.useCallback(I=>{n(`./${I}/${l.format(G.getLocalizedStrings().dateFormat.analytics.YYYYDashMMDashDDFormat)}`)},[l]),E=_.useCallback(I=>{t(we({downloadState:I}))},[]),R=_.useCallback((I,x)=>{},[]),A=_.useCallback((I,x)=>{t(we({selectedDate:I,agingDateSelectionType:x})),t(We(I))},[]);return i.jsxs(i.Fragment,{children:[o.fetchState==="Completed"?i.jsx(ve,{analytics:S,onLoad:I=>I.trackPageLoaded(K.Event.agingReport,"AP Aging")}):null,i.jsx(ca,{uiState:o.apAgingUIState,report:o,downloadParams:h,analytics:S,onReloadReport:d,onBackClick:p,onSearchTextChange:g,onSortOrderChange:f,onEntityNameClick:v,updateDownloadStateHandler:E,onSelectedDateChanged:A,onNodeCollapseToggled:R,isAiCfoAccessEnabled:r,onAskAiCfoClick:s})]})},mo=la(function({openTransactionPanel:e,panelContent:a,sidePanelIsOpen:t,sidePanelIsFullView:n}){const{customerId:o,reportDate:r}=N(),s=B.getSignedInUser(),c=k(x=>j(x)),{tenantEmailDomain:u}=N(),m=$(),C=c.companyName,b={userId:s?.userId??"",sessionId:s?.zeniSessionId??"",tenantId:c.tenantId},h=_.useMemo(()=>({authParams:b,companyName:C,downloadEndPoint:`${H}/agingDetailedReport`,timezone:Fe()}),[]),l=_.useMemo(()=>r!=null?Ut(r):de(),[r]),d=V(),p=Z(),g=k(x=>za(x,l,o)),f=_.useCallback(()=>{o!=null&&g.fetchState!=="In-Progress"&&g.fetchState!=="Completed"&&d($a(o,l))},[l]),v=_.useCallback(()=>{p("../../",{relative:"path"})},[]),E=_.useCallback((x,T)=>{d(wt({sortKey:x,sortOrder:T}))},[]),R=_.useCallback(x=>{d(wt({downloadState:x}))},[]),A=_.useCallback(x=>{if(e)e(x.transactionId,x.transactionType);else if(u!=null){const T=da({id:x.transactionId,type:x.transactionType},u);p(T);const X=F(m.state?.pathnameStackToGoBack,m.pathname);p(T,{state:{pathnameStackToGoBack:X}})}},[u,e]),I=_.useCallback(()=>{g.customer!=null&&S.trackArAgingDetail("AR Aging",l.format(G.getLocalizedStrings().dateFormat.analytics.YYYYDashMMDashDDFormat),g.customer.id,g.customer.name)},[g.customer,l]);return _.useEffect(()=>{f()},[]),_.useEffect(()=>{g.fetchState==="Completed"&&I()},[g.fetchState,I]),i.jsx(qn,{arAgingDetail:g,downloadParams:h,reportDate:l,analytics:S,onTransactionClick:A,onReload:f,onBackClick:v,onColumnSortConfigChanged:E,updateDownloadStateHandler:R,panelContent:a,sidePanelIsOpen:t,sidePanelIsFullView:n})}),po=()=>{const{isAiCfoOpen:e,setIsAiCfoOpen:a}=Pe(),t=V(),n=Z(),o=k(A=>Za(A)),{isAiCfoAccessEnabled:r,onAskAiCfoClick:s}=Be({isAiCfoOpen:e,setIsAiCfoOpen:a,mobileExploreReferrer:"AR Aging"});Re({isDataReady:o.fetchState==="Completed"});const c=B.getSignedInUser(),u=k(A=>j(A)),m=u.companyName,C={userId:c?.userId??"",sessionId:c?.zeniSessionId??"",tenantId:u.tenantId},b=_.useMemo(()=>({authParams:C,companyName:m,downloadEndPoint:`${H}/agingReport`,timezone:Fe()}),[]),h=o.arAgingUIState.selectedDate??de(),l=_.useCallback(()=>{o.fetchState!=="In-Progress"&&o.fetchState!=="Completed"&&t(et(h))},[]);_.useEffect(()=>{l()},[]);const d=_.useCallback(()=>{n("../",{relative:"path"})},[]),p=_.useCallback(A=>{t(xe({searchString:A}))},[]),g=_.useCallback((A,I)=>{t(xe({sortKey:I,sortOrder:A}))},[]),f=_.useCallback(A=>{n(`./${A}/${h.format(G.getLocalizedStrings().dateFormat.analytics.YYYYDashMMDashDDFormat)}`)},[h]),v=_.useCallback(A=>{t(xe({downloadState:A}))},[]),E=_.useCallback((A,I)=>{t(xe({selectedDate:A,agingDateSelectionType:I})),t(et(A))},[]),R=_.useCallback((A,I)=>{t(qa({nodeId:A,isCollapsed:I}))},[]);return i.jsxs(i.Fragment,{children:[o.fetchState==="Completed"?i.jsx(ve,{analytics:S,onLoad:A=>A.trackPageLoaded(K.Event.agingReport,"AR Aging")}):null,i.jsx(ca,{uiState:o.arAgingUIState,report:o,downloadParams:b,analytics:S,onReloadReport:l,onBackClick:d,onSearchTextChange:p,onSortOrderChange:g,onEntityNameClick:f,updateDownloadStateHandler:v,onSelectedDateChanged:E,onNodeCollapseToggled:R,isAiCfoAccessEnabled:r,onAskAiCfoClick:s})]})},ma=(e,a)=>({key:a,title:e.accountName,amount:e.balance?.available,logoUri:e.logo?.toString(),source:e});function pa(e,a){const t=Qa(a.firstMonthOfFY);return{onItemClick:(n,o)=>{const r=o.accountName===""?o.accountDescription:o.accountName,s=me(a.tenantEmailDomain,o.accountId,o.accountType,r,"quarter",t,!1),c=F(a.location.state?.pathnameStackToGoBack,a.location.pathname);a.navigate(s,{state:{pathnameStackToGoBack:c,referrer:a.referrerType}})},onSetAccountsStatementDate:(n,o)=>{e(Ja(n,o))},onPromoCardBtnClick:n=>{if(a.isZeniAccountsAdmin){let o=`../../checking/${n}`;n?S.trackZeniAccountsCashBalancePromoClicked("Move Money"):(S.trackZeniAccountsCashBalancePromoClicked("Sign Up for Free"),o="../../checking/promo");const r=F(a.location.state?.pathnameStackToGoBack,a.location.pathname);a.navigate(o,{state:{pathnameStackToGoBack:r}})}else S.trackZeniAccountsCashBalancePromoClicked("Learn More"),window.open("https://www.zeni.ai/product/business-checking-accounts","_blank")}}}const ho=q(function(e){const a=Ha(e).accountsInOrder.map((n,o)=>ma(n,o)),t=Xa(e);return{sectionTitle:G.getLocalizedStrings().balanceCard.cashBalanceSectionTitle,transactionArray:a,zeniAccountsPromoCardReport:t,fetchState:e.cashBalanceState.fetchState,analytics:S}},pa)(ia),fo=q(function(e){const a=Wa(e).accountsInOrder.map((o,r)=>ma(o,r)),t=B.getSignedInUser(),n=_e(t);return{sectionTitle:G.getLocalizedStrings().balanceCard.cardBalanceSectionTitle,transactionArray:a,isZeniUser:n,fetchState:e.cardBalanceState.fetchState,analytics:S}},pa)(ia);function go(){const e=Z(),a=$(),{tenantEmailDomain:t}=N(),n=Ie(),o=k(s=>j(s).company?.companyInfo.firstMonthOfFY??1),r=at(n?.loggedInUserRoleMap);return k(s=>s.cashBalanceState.fetchState)==="Error"?i.jsx(Ce,{}):i.jsx(ho,{tenantEmailDomain:t,location:a,referrerType:"Cash Balance",navigate:e,isZeniAccountsAdmin:r,firstMonthOfFY:o})}function bo(){const e=Z(),a=$(),{tenantEmailDomain:t}=N(),n=Ie(),o=at(n?.loggedInUserRoleMap),r=k(s=>j(s).company?.companyInfo.firstMonthOfFY??1);return k(s=>s.cardBalanceState.fetchState)==="Error"?i.jsx(Ce,{}):i.jsx(fo,{tenantEmailDomain:t,location:a,referrerType:"Card Balance",navigate:e,isZeniAccountsAdmin:o,firstMonthOfFY:r})}const Co=pt.div`
2
2
  display: flex;
3
3
  flex: 1 1 auto;
4
4
  min-height: 100%;
@@ -1 +1 @@
1
- import{j as v}from"./liveblocks-CVGPqYnR.js";import{a as u}from"./sentry-vrLJXbkU.js";import{h as y,g as b,k as w,u as A,N as U}from"./core-B4ZvHvvY.js";import{HT as k,eL as _,fi as L,HU as N,m1 as R,HV as z}from"./zeni-epic-state-Da4VO2lv.js";import{u as O,z as f,L as T,t as I,D as $,b as j}from"./index-DmE4wSNC.js";import"./mui-DoY7WfR_.js";import{t as H}from"./getLocaleForTenant-7ntdeZSs.js";import"./recharts-DNFnaP_v.js";import"./lottie-B5aSI3Li.js";import"./analytics-BL0geQNn.js";import"./plaid-C1RHGEem.js";import"./dnd-B2_m6pRT.js";import"./stripe-DMRn4zHo.js";import"./lexical-DA5yMmPj.js";import"./pdf-ChIJqwGf.js";import"./utils-QMlevttK.js";(function(){try{var t=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},s=new t.Error().stack;s&&(t._sentryDebugIds=t._sentryDebugIds||{},t._sentryDebugIds[s]="7d8c78fb-4177-4ee7-909f-51485117b48f",t._sentryDebugIdIdentifier="sentry-dbid-7d8c78fb-4177-4ee7-909f-51485117b48f")}catch{}})();const P=w(function(t){return{fetchState:t.tenantState.fetchState,activeTenantFetchState:t.tenantState.activeTenantFetchState.fetchState,currentTenant:_(t),tenantsInOrder:z(t).tenantsInOrder}})(function({fetchState:t,activeTenantFetchState:s,currentTenant:o,tenantsInOrder:h}){const r=A(),p=new URLSearchParams(r.search);if(o==null||t!=="Completed"&&s!=="Completed")return null;{let m="";const n=h.map(l=>l.tenantEmailDomain),i=r.state?.origin,a=r.state?.queryParams;let c=`../${o.tenantEmailDomain}`,d=null,e=!1,g=null,S=null;const C=E(r.pathname);if(C!=null)c=`../${o.tenantEmailDomain}/${C}`,m="comingFromV2UrlPath",C==="ai-cfo/explore"&&(d=p.get("question")?.replace(/^["']|["']$/g,"")??null,e=p.get("should_submit")==="true");else if(i!=null)if(n.reduce((l,F)=>l||i.split("/").find(D=>D===F)!=null,!1))c=i,i.includes("ai-cfo")&&a!=null&&(g=a.aiCfoRef??null,S=a.aiCfoEmailRefId??null);else{const l=E(i);l!=null?(c=`../${o.tenantEmailDomain}/${l}`,m="comingFromV2UrlPath",l==="ai-cfo/explore"&&a!=null&&(a.aiCfoQuestion!=null&&(d=a.aiCfoQuestion),a.aiCfoShouldSubmit==="true"&&(e=!0))):console.warn("Don't have access to previous path tenant!")}const x=j(c,p);return v.jsx(U,{to:x,replace:!0,state:{...r.state,origin:"",message:m,aiCfoInitialQuestion:d,aiCfoShouldSubmit:e,aiCfoRef:g,aiCfoEmailRefId:S}})}});function oe(){const t=y(),{setLoading:s,clearAllLoading:o}=O(),h=u.useRef(!1),r=u.useRef(!1),p=u.useRef(null),m=b(e=>k(e)),n=b(e=>e.tenantState.fetchState),i=b(e=>e.tenantState.error),a=b(e=>e.tenantState.activeTenantFetchState.fetchState),c=b(e=>_(e)),d=f.getSignedInUser();return u.useLayoutEffect(()=>{const e=f.getActiveTenantForUser()?.tenantId??null;p.current!==e&&(p.current=e,h.current=!1,r.current=!1,s(T.TENANT_FETCHING)),!h.current||a!=="Completed"&&a!=="Error"||(h.current=!1),!r.current||n!=="Completed"&&n!=="Error"||(r.current=!1)},[a,n]),u.useEffect(()=>{const e=f.getActiveTenantForUser()?.tenantId;h.current===!1&&d!=null&&e!=null&&I.shouldFetchActiveTenant(e)&&(h.current=!0,I.markActiveTenantFetchStarted(e),n==="Completed"||a!=="Not-Started"&&a!=="Error"||(s(T.TENANT_FETCHING),t(L(d.userId,e))))},[n,a,d,t]),u.useEffect(()=>{const e=f.getSignedInUser(),g=f.getActiveTenantForUser()?.tenantId,S=g==null||a==="Completed"||a==="Error";r.current===!1&&e!=null&&S&&I.shouldFetchAllTenants()&&(r.current=!0,I.markAllTenantsFetchStarted(),(n==="Not-Started"||n==="Error"&&!N(i))&&t(R(e.userId)))},[n,a,i,d,t]),u.useEffect(()=>{f.isSignedIn()&&n==="Completed"&&m.tenantsCoreDetailsInOrder.length>0&&(f.saveSignedInUserTenants(m.tenantsCoreDetailsInOrder),o())},[m.tenantsCoreDetailsInOrder,n]),u.useEffect(()=>{!f.isSignedIn()||n!=="Completed"&&a!=="Completed"||c==null||($.updateAppLocaleID(H(c)),o())},[n,a,c]),v.jsx(P,{})}const Q=["dashboard/cash-balance","dashboard/card-balance","dashboard/operating-expenses","dashboard/revenue","dashboard/burn-rate","dashboard/cash-position","dashboard/top-expenses","dashboard/cash-in-cash-out","dashboard","reports","forecast","uncategorized-expense","uncategorized-income","missing-receipts","bills","cards/activate","cards","reimbursements","wise","checking","aicfo"],V={"dashboard/cash-balance":"dashboard/cash_balance","dashboard/card-balance":"dashboard/card_balance","dashboard/operating-expenses":"dashboard/operating_expenses","dashboard/revenue":"dashboard/revenue","dashboard/burn-rate":"dashboard/net_burn_or_income","dashboard/cash-position":"dashboard/cash_position","dashboard/top-expenses":"dashboard/top_expenses","dashboard/cash-in-cash-out":"dashboard/cash_in_cash_out",dashboard:"dashboard",reports:"reports",forecast:"forecast","uncategorized-expense":"transactions/uncategorized-expense","uncategorized-income":"transactions/uncategorized-income","missing-receipts":"transactions/missing-receipts",bills:"bills",reimbursements:"reimbursements","cards/activate":"cards/activate",cards:"cards",wise:"bills/wise/callback/link-account",checking:"checking",aicfo:"ai-cfo/explore"};function E(t){for(const s of Q)if(t.toLocaleLowerCase().includes(s))return V[s]}export{oe as default};
1
+ import{j as v}from"./liveblocks-CVGPqYnR.js";import{a as u}from"./sentry-vrLJXbkU.js";import{h as y,g as b,k as w,u as A,N as U}from"./core-B4ZvHvvY.js";import{HT as k,eL as _,fi as L,HU as N,m1 as R,HV as z}from"./zeni-epic-state-Da4VO2lv.js";import{u as O,z as f,L as T,t as I,D as $,b as j}from"./index-DgzG0i4n.js";import"./mui-DoY7WfR_.js";import{t as H}from"./getLocaleForTenant-C50EFRQ8.js";import"./recharts-DNFnaP_v.js";import"./lottie-B5aSI3Li.js";import"./analytics-BL0geQNn.js";import"./plaid-C1RHGEem.js";import"./dnd-B2_m6pRT.js";import"./stripe-DMRn4zHo.js";import"./lexical-DA5yMmPj.js";import"./pdf-ChIJqwGf.js";import"./utils-QMlevttK.js";(function(){try{var t=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},s=new t.Error().stack;s&&(t._sentryDebugIds=t._sentryDebugIds||{},t._sentryDebugIds[s]="7d8c78fb-4177-4ee7-909f-51485117b48f",t._sentryDebugIdIdentifier="sentry-dbid-7d8c78fb-4177-4ee7-909f-51485117b48f")}catch{}})();const P=w(function(t){return{fetchState:t.tenantState.fetchState,activeTenantFetchState:t.tenantState.activeTenantFetchState.fetchState,currentTenant:_(t),tenantsInOrder:z(t).tenantsInOrder}})(function({fetchState:t,activeTenantFetchState:s,currentTenant:o,tenantsInOrder:h}){const r=A(),p=new URLSearchParams(r.search);if(o==null||t!=="Completed"&&s!=="Completed")return null;{let m="";const n=h.map(l=>l.tenantEmailDomain),i=r.state?.origin,a=r.state?.queryParams;let c=`../${o.tenantEmailDomain}`,d=null,e=!1,g=null,S=null;const C=E(r.pathname);if(C!=null)c=`../${o.tenantEmailDomain}/${C}`,m="comingFromV2UrlPath",C==="ai-cfo/explore"&&(d=p.get("question")?.replace(/^["']|["']$/g,"")??null,e=p.get("should_submit")==="true");else if(i!=null)if(n.reduce((l,F)=>l||i.split("/").find(D=>D===F)!=null,!1))c=i,i.includes("ai-cfo")&&a!=null&&(g=a.aiCfoRef??null,S=a.aiCfoEmailRefId??null);else{const l=E(i);l!=null?(c=`../${o.tenantEmailDomain}/${l}`,m="comingFromV2UrlPath",l==="ai-cfo/explore"&&a!=null&&(a.aiCfoQuestion!=null&&(d=a.aiCfoQuestion),a.aiCfoShouldSubmit==="true"&&(e=!0))):console.warn("Don't have access to previous path tenant!")}const x=j(c,p);return v.jsx(U,{to:x,replace:!0,state:{...r.state,origin:"",message:m,aiCfoInitialQuestion:d,aiCfoShouldSubmit:e,aiCfoRef:g,aiCfoEmailRefId:S}})}});function oe(){const t=y(),{setLoading:s,clearAllLoading:o}=O(),h=u.useRef(!1),r=u.useRef(!1),p=u.useRef(null),m=b(e=>k(e)),n=b(e=>e.tenantState.fetchState),i=b(e=>e.tenantState.error),a=b(e=>e.tenantState.activeTenantFetchState.fetchState),c=b(e=>_(e)),d=f.getSignedInUser();return u.useLayoutEffect(()=>{const e=f.getActiveTenantForUser()?.tenantId??null;p.current!==e&&(p.current=e,h.current=!1,r.current=!1,s(T.TENANT_FETCHING)),!h.current||a!=="Completed"&&a!=="Error"||(h.current=!1),!r.current||n!=="Completed"&&n!=="Error"||(r.current=!1)},[a,n]),u.useEffect(()=>{const e=f.getActiveTenantForUser()?.tenantId;h.current===!1&&d!=null&&e!=null&&I.shouldFetchActiveTenant(e)&&(h.current=!0,I.markActiveTenantFetchStarted(e),n==="Completed"||a!=="Not-Started"&&a!=="Error"||(s(T.TENANT_FETCHING),t(L(d.userId,e))))},[n,a,d,t]),u.useEffect(()=>{const e=f.getSignedInUser(),g=f.getActiveTenantForUser()?.tenantId,S=g==null||a==="Completed"||a==="Error";r.current===!1&&e!=null&&S&&I.shouldFetchAllTenants()&&(r.current=!0,I.markAllTenantsFetchStarted(),(n==="Not-Started"||n==="Error"&&!N(i))&&t(R(e.userId)))},[n,a,i,d,t]),u.useEffect(()=>{f.isSignedIn()&&n==="Completed"&&m.tenantsCoreDetailsInOrder.length>0&&(f.saveSignedInUserTenants(m.tenantsCoreDetailsInOrder),o())},[m.tenantsCoreDetailsInOrder,n]),u.useEffect(()=>{!f.isSignedIn()||n!=="Completed"&&a!=="Completed"||c==null||($.updateAppLocaleID(H(c)),o())},[n,a,c]),v.jsx(P,{})}const Q=["dashboard/cash-balance","dashboard/card-balance","dashboard/operating-expenses","dashboard/revenue","dashboard/burn-rate","dashboard/cash-position","dashboard/top-expenses","dashboard/cash-in-cash-out","dashboard","reports","forecast","uncategorized-expense","uncategorized-income","missing-receipts","bills","cards/activate","cards","reimbursements","wise","checking","aicfo"],V={"dashboard/cash-balance":"dashboard/cash_balance","dashboard/card-balance":"dashboard/card_balance","dashboard/operating-expenses":"dashboard/operating_expenses","dashboard/revenue":"dashboard/revenue","dashboard/burn-rate":"dashboard/net_burn_or_income","dashboard/cash-position":"dashboard/cash_position","dashboard/top-expenses":"dashboard/top_expenses","dashboard/cash-in-cash-out":"dashboard/cash_in_cash_out",dashboard:"dashboard",reports:"reports",forecast:"forecast","uncategorized-expense":"transactions/uncategorized-expense","uncategorized-income":"transactions/uncategorized-income","missing-receipts":"transactions/missing-receipts",bills:"bills",reimbursements:"reimbursements","cards/activate":"cards/activate",cards:"cards",wise:"bills/wise/callback/link-account",checking:"checking",aicfo:"ai-cfo/explore"};function E(t){for(const s of Q)if(t.toLocaleLowerCase().includes(s))return V[s]}export{oe as default};
@@ -1,4 +1,4 @@
1
- import{j as l}from"./liveblocks-CVGPqYnR.js";import{j as w,u as C,g as h,k as A,l as V}from"./core-B4ZvHvvY.js";import{LN as k,LU as _,fz as q,fy as K,fx as W,i1 as X,IV as J,pc as M,eL as B,Lj as D,h$ as T,LO as S,LX as F,hZ as G,il as j}from"./zeni-epic-state-Da4VO2lv.js";import{bj as Q,K as N,Z as R,z as U,m as L,p,i as v,B as Z,bk as Y,o as O,bl as ee,q as te}from"./index-DmE4wSNC.js";import{n as z}from"./mui-DoY7WfR_.js";import"./sentry-vrLJXbkU.js";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="9773cc74-56fc-481c-b33f-44b54b88478c",e._sentryDebugIdIdentifier="sentry-dbid-9773cc74-56fc-481c-b33f-44b54b88478c")}catch{}})();const ne=A(null,function(e,t){return{onSaveVendor:n=>{e(X(t.vendorId!==void 0?t.vendorId:void 0,t.billId,void 0,t.isExpressPayPage)),e(J("common")),n!=null&&e(M(n))},onGetOtp:n=>{e(W(n,"BillPayVendor"))},onResendOtp:n=>{e(K(n,"BillPayVendor"))},onVerifyOtp:(n,a)=>{e(q(n,a,"BillPayVendor"))},onVerifyOtpSuccess:(n,a,o)=>{e(_(n,a,o))}}})(Q);function H({vendorId:e,billId:t,isExpressPayPage:n}){const a=w(),o=C(),s=h(r=>k(r,e));return l.jsx(ne,{location:o,navigate:a,vendorId:e,billId:t,vendorViewDetails:s,isExpressPayPage:n??!1})}const ae=z.div`
1
+ import{j as l}from"./liveblocks-CVGPqYnR.js";import{j as w,u as C,g as h,k as A,l as V}from"./core-B4ZvHvvY.js";import{LN as k,LU as _,fz as q,fy as K,fx as W,i1 as X,IV as J,pc as M,eL as B,Lj as D,h$ as T,LO as S,LX as F,hZ as G,il as j}from"./zeni-epic-state-Da4VO2lv.js";import{bj as Q,K as N,Z as R,z as U,m as L,p,i as v,B as Z,bk as Y,o as O,bl as ee,q as te}from"./index-DgzG0i4n.js";import{n as z}from"./mui-DoY7WfR_.js";import"./sentry-vrLJXbkU.js";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="9773cc74-56fc-481c-b33f-44b54b88478c",e._sentryDebugIdIdentifier="sentry-dbid-9773cc74-56fc-481c-b33f-44b54b88478c")}catch{}})();const ne=A(null,function(e,t){return{onSaveVendor:n=>{e(X(t.vendorId!==void 0?t.vendorId:void 0,t.billId,void 0,t.isExpressPayPage)),e(J("common")),n!=null&&e(M(n))},onGetOtp:n=>{e(W(n,"BillPayVendor"))},onResendOtp:n=>{e(K(n,"BillPayVendor"))},onVerifyOtp:(n,a)=>{e(q(n,a,"BillPayVendor"))},onVerifyOtpSuccess:(n,a,o)=>{e(_(n,a,o))}}})(Q);function H({vendorId:e,billId:t,isExpressPayPage:n}){const a=w(),o=C(),s=h(r=>k(r,e));return l.jsx(ne,{location:o,navigate:a,vendorId:e,billId:t,vendorViewDetails:s,isExpressPayPage:n??!1})}const ae=z.div`
2
2
  display: flex;
3
3
  height: 100vh;
4
4
  width: 100%;
@@ -1 +1 @@
1
- import{j as i}from"./liveblocks-CVGPqYnR.js";import{K as l,x as c,m as f}from"./index-DmE4wSNC.js";import{D as p}from"./mui-DoY7WfR_.js";import"./sentry-vrLJXbkU.js";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},r=new e.Error().stack;r&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[r]="be254b02-e5c0-4dd6-8413-4fa419959976",e._sentryDebugIdIdentifier="sentry-dbid-be254b02-e5c0-4dd6-8413-4fa419959976")}catch{}})();const b={drawerLeftMargin:new c(0,0,240)};function m(e){const{isOpen:r,drawerLeftMargin:o,children:t,onClose:s}=e,n=l(),a=o?.valuePx(n)??b.drawerLeftMargin.valuePx(n),d=f();return i.jsx(p,{anchor:"right",open:r,PaperProps:{style:{width:`calc(100% - ${a})`}},slotProps:{backdrop:{style:{backgroundColor:d.colors.black,opacity:.8,cursor:"pointer"}}},onClose:s,children:t})}export{m as D};
1
+ import{j as i}from"./liveblocks-CVGPqYnR.js";import{K as l,x as c,m as f}from"./index-DgzG0i4n.js";import{D as p}from"./mui-DoY7WfR_.js";import"./sentry-vrLJXbkU.js";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},r=new e.Error().stack;r&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[r]="be254b02-e5c0-4dd6-8413-4fa419959976",e._sentryDebugIdIdentifier="sentry-dbid-be254b02-e5c0-4dd6-8413-4fa419959976")}catch{}})();const b={drawerLeftMargin:new c(0,0,240)};function m(e){const{isOpen:r,drawerLeftMargin:o,children:t,onClose:s}=e,n=l(),a=o?.valuePx(n)??b.drawerLeftMargin.valuePx(n),d=f();return i.jsx(p,{anchor:"right",open:r,PaperProps:{style:{width:`calc(100% - ${a})`}},slotProps:{backdrop:{style:{backgroundColor:d.colors.black,opacity:.8,cursor:"pointer"}}},onClose:s,children:t})}export{m as D};
@@ -1 +1 @@
1
- import{j as s}from"./liveblocks-CVGPqYnR.js";import{a as c}from"./sentry-vrLJXbkU.js";import{j as A,h as B,u as q,l as F,g as d,N,k as J,n as M,o as W}from"./core-B4ZvHvvY.js";import{K0 as _,eL as O,Jp as K,k6 as R,Gb as k,K5 as V,IU as Y,j6 as $,Gc as S,Ju as z,Jv as L,IW as U,IV as H}from"./zeni-epic-state-Da4VO2lv.js";import{aM as Q,c as X,p as Z,q as tt}from"./index-DmE4wSNC.js";import"./mui-DoY7WfR_.js";import{d as I}from"./decodeURIComponentSafe-CC7b77eX.js";import{w as et}from"./withTransactionSidePanel-DMUIu-an.js";import{e as at,b as nt}from"./routePaths-BbBoI9fr.js";import"./recharts-DNFnaP_v.js";import"./lottie-B5aSI3Li.js";import"./analytics-BL0geQNn.js";import"./plaid-C1RHGEem.js";import"./dnd-B2_m6pRT.js";import"./stripe-DMRn4zHo.js";import"./lexical-DA5yMmPj.js";import"./pdf-ChIJqwGf.js";import"./utils-QMlevttK.js";import"./useAskAiCfoHostNavButtonProps-Djdv5hKX.js";import"./useFetchSuggestedQuestionsWhenReady-Cfhk-A1n.js";import"./TransactionDetailScreen-DvpEF447.js";(function(){try{var a=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new a.Error().stack;t&&(a._sentryDebugIds=a._sentryDebugIds||{},a._sentryDebugIds[t]="7efb3004-8371-4162-bc5e-3aa9af30c4ec",a._sentryDebugIdIdentifier="sentry-dbid-7efb3004-8371-4162-bc5e-3aa9af30c4ec")}catch{}})();const ot=J(function(a,t){const e=t.entity,o=V(a,t.entity,"EntityDetail");return{selectedEntity:e,autoCompleteData:{autoCompleteText:e.name,entityAutoCompleteView:Y(a,"common")},trendWithTransactionsReport:o,analytics:X,isAccountingClassesEnabled:$(a)}},function(a,t){return{onTransactionItemClick:e=>{if(t.openTransactionPanel)return void t.openTransactionPanel(e.id,e.type);const o=`${nt(e,t.tenantEmailDomain)}`,l=tt(t.location.state?.pathnameStackToGoBack,t.location.pathname);t.navigate(o,{state:{pathnameStackToGoBack:l}})},autoCompleteActions:{onAutoCompleteInputChange:e=>{e.trim().length>=2?a(U({searchString:e,searchOrigin:"common"})):e.trim().length===0&&a(H("common"))},onAutoCompleteEntity:e=>{const o=at(e,t.tenantEmailDomain);a(z()),a(L()),t.resetTrendIsFetchedStates(),t.navigate(o,{replace:!0,state:{pathnameStackToGoBack:t.location.state?.pathnameStackToGoBack}})},onCancelAutoComplete:()=>{const e=Z(t.location.state?.pathnameStackToGoBack),o=e.poppedPathname??b();t.navigate(o,{state:{pathnameStackToGoBack:e.newStack}})}},onTrendSelectedPeriodChange:e=>{if(t.closeSidePanel?.(),e==null)t.defaultTransactionTimePeriod!=null&&a(S(t.entity,"EntityDetail",{timeframe:"quarter",timePeriod:t.defaultTransactionTimePeriod}));else{const o=e.currentTimePeriod==null?e.addTimePeriod:{startDate:e.addTimePeriod.startDate,endDate:e.currentTimePeriod.endDate};a(k(t.entity,"EntityDetail",{timeframe:e.timeframe,timePeriod:e.addTimePeriod})),a(S(t.entity,"EntityDetail",{timeframe:e.timeframe,timePeriod:o}))}}}})(Q),it=et(function({entityType:a,...t}){const e=A(),o=B(),l=q(),[m,T]=c.useState(!1),[h,D]=c.useState(!1),{tenantEmailDomain:C,entityIdEncoded:j,entityNameEncoded:x}=F(),r=I(j??""),p=I(x??""),u=rt(r,p),G=[r,p].filter(n=>n!=null),i={name:p,id:r,type:a,zeniId:r,qboId:r},g=d(n=>_(n.customerIncomeState,n.vendorExpenseState,n.trendState,i,"quarter")),v=d(n=>O(n).company?.companyInfo.firstMonthOfFY??1),f=d(n=>K(n.trendWithTransactionsState,i,"EntityDetail"));c.useEffect(()=>{m===!1&&u===!0&&(T(!0),o(R(i)))},[m,u,i]);const E=d(n=>n.trendState.fetchState),P=f?.selectedPeriod?.timePeriod??g,w=function(n,y){return n!=null&&y!=null?{startDate:n.startDate,endDate:y?.endDate}:y}(f?.selectedPeriod?.timePeriod,g);return c.useEffect(()=>{m===!0&&h===!1&&E==="Completed"&&(D(!0),P!=null&&o(k(i,"EntityDetail",{timeframe:f?.selectedPeriod?.timeframe??"quarter",timePeriod:P})))},[m,h,E]),u?s.jsx(ot,{firstMonthOfFY:v,tenantEmailDomain:C,location:l,navigate:e,entity:i,defaultTransactionTimePeriod:w,resetTrendIsFetchedStates:()=>{T(!1),D(!1)},...t}):s.jsx(N,{to:b(G.length)})}),rt=(a,t)=>t!=null&&t.length>0&&a!=null&&a.length>0,b=(a=2)=>{let t="../";for(let e=0;e<a;e++)t=`${t}../`;return t};function xt({entityType:a}){return s.jsx(M,{children:s.jsx(W,{path:"/:entityIdEncoded/:entityNameEncoded/*",element:s.jsx(it,{entityType:a})})})}export{xt as EntityDetailRoutes,xt as default};
1
+ import{j as s}from"./liveblocks-CVGPqYnR.js";import{a as c}from"./sentry-vrLJXbkU.js";import{j as A,h as B,u as q,l as F,g as d,N,k as J,n as M,o as W}from"./core-B4ZvHvvY.js";import{K0 as _,eL as O,Jp as K,k6 as R,Gb as k,K5 as V,IU as Y,j6 as $,Gc as S,Ju as z,Jv as L,IW as U,IV as H}from"./zeni-epic-state-Da4VO2lv.js";import{aM as Q,c as X,p as Z,q as tt}from"./index-DgzG0i4n.js";import"./mui-DoY7WfR_.js";import{d as I}from"./decodeURIComponentSafe-CC7b77eX.js";import{w as et}from"./withTransactionSidePanel-D3gZnvfm.js";import{e as at,b as nt}from"./routePaths-WhbiYSxu.js";import"./recharts-DNFnaP_v.js";import"./lottie-B5aSI3Li.js";import"./analytics-BL0geQNn.js";import"./plaid-C1RHGEem.js";import"./dnd-B2_m6pRT.js";import"./stripe-DMRn4zHo.js";import"./lexical-DA5yMmPj.js";import"./pdf-ChIJqwGf.js";import"./utils-QMlevttK.js";import"./useAskAiCfoHostNavButtonProps-DQFYXydp.js";import"./useFetchSuggestedQuestionsWhenReady-BMFUNkte.js";import"./TransactionDetailScreen-BCiX38jP.js";(function(){try{var a=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new a.Error().stack;t&&(a._sentryDebugIds=a._sentryDebugIds||{},a._sentryDebugIds[t]="7efb3004-8371-4162-bc5e-3aa9af30c4ec",a._sentryDebugIdIdentifier="sentry-dbid-7efb3004-8371-4162-bc5e-3aa9af30c4ec")}catch{}})();const ot=J(function(a,t){const e=t.entity,o=V(a,t.entity,"EntityDetail");return{selectedEntity:e,autoCompleteData:{autoCompleteText:e.name,entityAutoCompleteView:Y(a,"common")},trendWithTransactionsReport:o,analytics:X,isAccountingClassesEnabled:$(a)}},function(a,t){return{onTransactionItemClick:e=>{if(t.openTransactionPanel)return void t.openTransactionPanel(e.id,e.type);const o=`${nt(e,t.tenantEmailDomain)}`,l=tt(t.location.state?.pathnameStackToGoBack,t.location.pathname);t.navigate(o,{state:{pathnameStackToGoBack:l}})},autoCompleteActions:{onAutoCompleteInputChange:e=>{e.trim().length>=2?a(U({searchString:e,searchOrigin:"common"})):e.trim().length===0&&a(H("common"))},onAutoCompleteEntity:e=>{const o=at(e,t.tenantEmailDomain);a(z()),a(L()),t.resetTrendIsFetchedStates(),t.navigate(o,{replace:!0,state:{pathnameStackToGoBack:t.location.state?.pathnameStackToGoBack}})},onCancelAutoComplete:()=>{const e=Z(t.location.state?.pathnameStackToGoBack),o=e.poppedPathname??b();t.navigate(o,{state:{pathnameStackToGoBack:e.newStack}})}},onTrendSelectedPeriodChange:e=>{if(t.closeSidePanel?.(),e==null)t.defaultTransactionTimePeriod!=null&&a(S(t.entity,"EntityDetail",{timeframe:"quarter",timePeriod:t.defaultTransactionTimePeriod}));else{const o=e.currentTimePeriod==null?e.addTimePeriod:{startDate:e.addTimePeriod.startDate,endDate:e.currentTimePeriod.endDate};a(k(t.entity,"EntityDetail",{timeframe:e.timeframe,timePeriod:e.addTimePeriod})),a(S(t.entity,"EntityDetail",{timeframe:e.timeframe,timePeriod:o}))}}}})(Q),it=et(function({entityType:a,...t}){const e=A(),o=B(),l=q(),[m,T]=c.useState(!1),[h,D]=c.useState(!1),{tenantEmailDomain:C,entityIdEncoded:j,entityNameEncoded:x}=F(),r=I(j??""),p=I(x??""),u=rt(r,p),G=[r,p].filter(n=>n!=null),i={name:p,id:r,type:a,zeniId:r,qboId:r},g=d(n=>_(n.customerIncomeState,n.vendorExpenseState,n.trendState,i,"quarter")),v=d(n=>O(n).company?.companyInfo.firstMonthOfFY??1),f=d(n=>K(n.trendWithTransactionsState,i,"EntityDetail"));c.useEffect(()=>{m===!1&&u===!0&&(T(!0),o(R(i)))},[m,u,i]);const E=d(n=>n.trendState.fetchState),P=f?.selectedPeriod?.timePeriod??g,w=function(n,y){return n!=null&&y!=null?{startDate:n.startDate,endDate:y?.endDate}:y}(f?.selectedPeriod?.timePeriod,g);return c.useEffect(()=>{m===!0&&h===!1&&E==="Completed"&&(D(!0),P!=null&&o(k(i,"EntityDetail",{timeframe:f?.selectedPeriod?.timeframe??"quarter",timePeriod:P})))},[m,h,E]),u?s.jsx(ot,{firstMonthOfFY:v,tenantEmailDomain:C,location:l,navigate:e,entity:i,defaultTransactionTimePeriod:w,resetTrendIsFetchedStates:()=>{T(!1),D(!1)},...t}):s.jsx(N,{to:b(G.length)})}),rt=(a,t)=>t!=null&&t.length>0&&a!=null&&a.length>0,b=(a=2)=>{let t="../";for(let e=0;e<a;e++)t=`${t}../`;return t};function xt({entityType:a}){return s.jsx(M,{children:s.jsx(W,{path:"/:entityIdEncoded/:entityNameEncoded/*",element:s.jsx(it,{entityType:a})})})}export{xt as EntityDetailRoutes,xt as default};
@@ -1,4 +1,4 @@
1
- import{j as u}from"./liveblocks-CVGPqYnR.js";import un from"./NotFoundScreen-Dw_4aXSt.js";import{a as l}from"./sentry-vrLJXbkU.js";import{n as Ae,D as St,S as ze}from"./mui-DoY7WfR_.js";import{h as he,j as It,u as Ve,g as V,l as nt,k as mn,n as hn,o as Ue}from"./core-B4ZvHvvY.js";import{eL as $e,Oj as pn,e$ as me,fd as gn,pP as Cn,Ok as je,ms as ft,my as kt,Ol as Et,mX as Sn,Om as yt,ml as In,pl as fn,On as kn,ji as En,Oo as yn,Fc as bn,eX as Me,p0 as bt,K1 as at,K3 as vn,j9 as An,K4 as Tn,jg as wn,cT as xn,sM as Le,IU as Pn,jh as Rn,eZ as Dn,mz as vt,n0 as ve,nX as At,ou as On,e_ as Tt,m$ as ot,mq as ae,n2 as wt,n4 as Un,bB as Fn,kF as Bn,kC as _n,n3 as Ee,n1 as ue,Op as Vn,nk as st,AU as xt,Oq as Pt,rO as Rt,oq as jn,j6 as Mn,Or as Ln,IW as ct,IV as ke,Os as it,jx as zn,Ot as $n,Ou as Gn,Ov as qn,Ow as Jn,mI as Kn,Ox as Yn,Oy as Nn,Oz as Zn,na as Qn,jk as Hn,jb as Wn,OA as Xn,jj as lt,Kb as ea,OB as ta,OC as na,oY as aa,oD as oa,oC as Fe,OD as sa,OE as ca,kQ as ia,bp as la,kL as rt,kx as ra,OF as da,gw as dt,fK as ua,kI as ma,uF as ha,OG as pa,nB as ga,nw as Ca,nA as Sa,nl as Ia,OH as fa,mQ as ka,mF as Ea,fe as ut,n5 as ya,OI as ba,OJ as va,OK as Aa,OL as Ta,OM as wa,ON as mt,p8 as xa,ol as Pa,o4 as ht,od as Ra,o0 as Da,or as Oa,o5 as Ua,OO as Fa,OP as Ba,nK as _a,OQ as Va,nI as ja,nJ as Ma,nG as La,of as za}from"./zeni-epic-state-Da4VO2lv.js";import{J as Dt,Z as Ot,i as ye,c as M,q as Q,M as Ut,cq as $a,m as Ft,z as Te,cr as Ga,ao as be,cs as qa,B as Bt,ct as Ja,cu as Ka,al as Be,F as Ya,S as Na,aI as Za,cv as Qa,aZ as Ha,x as Wa,D as Xa,cw as eo,R as to,cx as no}from"./index-DmE4wSNC.js";import{u as _t}from"./useAskAiCfoHostNavButtonProps-Djdv5hKX.js";import{c as Vt}from"./useFetchSuggestedQuestionsWhenReady-Cfhk-A1n.js";import{c as pt,C as ao}from"./TransactionDetailScreen-DvpEF447.js";import{w as oo}from"./withTransactionSidePanel-DMUIu-an.js";import{h as so,v as co}from"./routePaths-BbBoI9fr.js";import{g as _e}from"./accountMappingHelper-GgTLtZGv.js";import{D as io}from"./DrawerScreen-D8_xICtn.js";import"./recharts-DNFnaP_v.js";import"./lottie-B5aSI3Li.js";import"./analytics-BL0geQNn.js";import"./plaid-C1RHGEem.js";import"./dnd-B2_m6pRT.js";import"./stripe-DMRn4zHo.js";import"./lexical-DA5yMmPj.js";import"./pdf-ChIJqwGf.js";import"./utils-QMlevttK.js";import"./decodeURIComponentSafe-CC7b77eX.js";(function(){try{var t=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},c=new t.Error().stack;c&&(t._sentryDebugIds=t._sentryDebugIds||{},t._sentryDebugIds[c]="c6b1b7e9-1994-43e7-a6b5-bfdb6f94920a",t._sentryDebugIdIdentifier="sentry-dbid-c6b1b7e9-1994-43e7-a6b5-bfdb6f94920a")}catch{}})();const lo=()=>{const{isAiCfoOpen:t,setIsAiCfoOpen:c}=Dt(),x=he(),T=It(),y=Ve(),r=V(p=>$e(p)),{useFeatureGate:m}=Ot(),{isFeatureEnabled:P}=m(ye.isRealtimeInsightsFeatureEnabled),g=V(p=>p.expenseAutomationViewState.selectedPeriodByTenantId),a=V(p=>pn(p,r.tenantId)),{isAiCfoAccessEnabled:j,onAskAiCfoClick:b}=_t({isAiCfoOpen:t,setIsAiCfoOpen:c,mobileExploreReferrer:"Month-End Close Overview"}),I=l.useCallback((p,E,O=!1)=>{x(me({tenantId:E,period:{month:p.month,year:p.year},refreshViewInBackground:O}))},[]),$=l.useCallback(p=>{const E=y.state?.referrer;a.monthEndCloseChecks?.auditSummary!=null&&M.trackMonthCloseAuditPage(p.month,p.year,a.monthEndCloseChecks.reportEmailSentDate!=null?"closed":"in-review",a.monthEndCloseChecks.auditSummary.auditScorePercentage,!1,E??null),x(gn(r.tenantId,p))},[r.tenantId,a.monthEndCloseChecks?.auditSummary,a.monthEndCloseChecks?.reportEmailSentDate]),S=g[r.tenantId],k=l.useCallback(()=>{const p=y.state?.referrer;a.monthEndCloseChecks?.auditSummary!=null&&M.trackMonthCloseAuditPage(S.month,S.year,a.monthEndCloseChecks.reportEmailSentDate!=null?"closed":"in-review",a.monthEndCloseChecks.auditSummary.auditScorePercentage,!0,p??null),I(S,r.tenantId,!0)},[I,S,r.tenantId,a.monthEndCloseChecks?.auditSummary,a.monthEndCloseChecks?.reportEmailSentDate]),L=Q(y.state?.pathnameStackToGoBack,y.pathname),Y=l.useCallback(()=>{if(a.monthEndCloseChecks!=null&&S!=null){const p=a.monthEndCloseChecks.monthEndCloseCheckList.find(E=>E.progress<100);if(p!=null)return void T(`./${p.id}/${S.month}-${S.year}`,{state:{pathnameStackToGoBack:L,message:"comingFromOverview"}});T(`./month_end_insights/${S.month}-${S.year}`,{state:{pathnameStackToGoBack:L,message:"comingFromOverview"}})}},[a.monthEndCloseChecks,S]),{areTenantIdsInSync:d}=Ut();return Vt({isDataReady:a.fetchState==="Completed"}),l.useEffect(()=>{S!=null&&a.fetchState!=="In-Progress"&&a.fetchState!=="Completed"&&d&&I(S,r.tenantId)},[I,S,a.fetchState,r.tenantId,d]),l.useEffect(()=>{S!=null&&a.monthClosePerformanceTrendFetchStatus.fetchState!=="In-Progress"&&a.monthClosePerformanceTrendFetchStatus.fetchState!=="Completed"&&d&&x(Cn(S))},[S,a.monthClosePerformanceTrendFetchStatus.fetchState,d]),l.useEffect(()=>{const p=setInterval(()=>{a.fetchState!=="In-Progress"&&a.fetchState==="Completed"&&k()},3e5);return()=>clearInterval(p)},[a.fetchState]),l.useEffect(()=>{if(a.fetchState==="Completed"&&a.monthEndCloseChecks?.auditSummary!=null){const p=y.state?.referrer;M.trackMonthCloseAuditPage(a.selectedPeriod.month,a.selectedPeriod.year,a.monthEndCloseChecks.reportEmailSentDate!=null?"closed":"in-review",a.monthEndCloseChecks.auditSummary.auditScorePercentage,!1,p??null)}},[a.fetchState,a.selectedPeriod,a.monthEndCloseChecks?.auditSummary,a.monthEndCloseChecks?.reportEmailSentDate]),u.jsx(ro,{children:u.jsx($a,{monthEndCloseChecksView:a,isRealtimeInsightsFeatureEnabled:P,onMonthEndCheckClick:p=>{T(`./${p}/${S.month}-${S.year}`,{state:{pathnameStackToGoBack:L,message:"comingFromOverview",referrer:"Expense Automation - Overview"}})},onPeriodChange:$,handleReviewButtonClick:Y,onBackClick:()=>{T("../../dashboard")},onReload:k,isAiCfoAccessEnabled:j,onAskAiCfoClick:b})})},ro=Ae.div`
1
+ import{j as u}from"./liveblocks-CVGPqYnR.js";import un from"./NotFoundScreen-jPpbDlQd.js";import{a as l}from"./sentry-vrLJXbkU.js";import{n as Ae,D as St,S as ze}from"./mui-DoY7WfR_.js";import{h as he,j as It,u as Ve,g as V,l as nt,k as mn,n as hn,o as Ue}from"./core-B4ZvHvvY.js";import{eL as $e,Oj as pn,e$ as me,fd as gn,pP as Cn,Ok as je,ms as ft,my as kt,Ol as Et,mX as Sn,Om as yt,ml as In,pl as fn,On as kn,ji as En,Oo as yn,Fc as bn,eX as Me,p0 as bt,K1 as at,K3 as vn,j9 as An,K4 as Tn,jg as wn,cT as xn,sM as Le,IU as Pn,jh as Rn,eZ as Dn,mz as vt,n0 as ve,nX as At,ou as On,e_ as Tt,m$ as ot,mq as ae,n2 as wt,n4 as Un,bB as Fn,kF as Bn,kC as _n,n3 as Ee,n1 as ue,Op as Vn,nk as st,AU as xt,Oq as Pt,rO as Rt,oq as jn,j6 as Mn,Or as Ln,IW as ct,IV as ke,Os as it,jx as zn,Ot as $n,Ou as Gn,Ov as qn,Ow as Jn,mI as Kn,Ox as Yn,Oy as Nn,Oz as Zn,na as Qn,jk as Hn,jb as Wn,OA as Xn,jj as lt,Kb as ea,OB as ta,OC as na,oY as aa,oD as oa,oC as Fe,OD as sa,OE as ca,kQ as ia,bp as la,kL as rt,kx as ra,OF as da,gw as dt,fK as ua,kI as ma,uF as ha,OG as pa,nB as ga,nw as Ca,nA as Sa,nl as Ia,OH as fa,mQ as ka,mF as Ea,fe as ut,n5 as ya,OI as ba,OJ as va,OK as Aa,OL as Ta,OM as wa,ON as mt,p8 as xa,ol as Pa,o4 as ht,od as Ra,o0 as Da,or as Oa,o5 as Ua,OO as Fa,OP as Ba,nK as _a,OQ as Va,nI as ja,nJ as Ma,nG as La,of as za}from"./zeni-epic-state-Da4VO2lv.js";import{J as Dt,Z as Ot,i as ye,c as M,q as Q,M as Ut,cq as $a,m as Ft,z as Te,cr as Ga,ao as be,cs as qa,B as Bt,ct as Ja,cu as Ka,al as Be,F as Ya,S as Na,aI as Za,cv as Qa,aZ as Ha,x as Wa,D as Xa,cw as eo,R as to,cx as no}from"./index-DgzG0i4n.js";import{u as _t}from"./useAskAiCfoHostNavButtonProps-DQFYXydp.js";import{c as Vt}from"./useFetchSuggestedQuestionsWhenReady-BMFUNkte.js";import{c as pt,C as ao}from"./TransactionDetailScreen-BCiX38jP.js";import{w as oo}from"./withTransactionSidePanel-D3gZnvfm.js";import{h as so,v as co}from"./routePaths-WhbiYSxu.js";import{g as _e}from"./accountMappingHelper-GgTLtZGv.js";import{D as io}from"./DrawerScreen-dt2KgJzx.js";import"./recharts-DNFnaP_v.js";import"./lottie-B5aSI3Li.js";import"./analytics-BL0geQNn.js";import"./plaid-C1RHGEem.js";import"./dnd-B2_m6pRT.js";import"./stripe-DMRn4zHo.js";import"./lexical-DA5yMmPj.js";import"./pdf-ChIJqwGf.js";import"./utils-QMlevttK.js";import"./decodeURIComponentSafe-CC7b77eX.js";(function(){try{var t=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},c=new t.Error().stack;c&&(t._sentryDebugIds=t._sentryDebugIds||{},t._sentryDebugIds[c]="c6b1b7e9-1994-43e7-a6b5-bfdb6f94920a",t._sentryDebugIdIdentifier="sentry-dbid-c6b1b7e9-1994-43e7-a6b5-bfdb6f94920a")}catch{}})();const lo=()=>{const{isAiCfoOpen:t,setIsAiCfoOpen:c}=Dt(),x=he(),T=It(),y=Ve(),r=V(p=>$e(p)),{useFeatureGate:m}=Ot(),{isFeatureEnabled:P}=m(ye.isRealtimeInsightsFeatureEnabled),g=V(p=>p.expenseAutomationViewState.selectedPeriodByTenantId),a=V(p=>pn(p,r.tenantId)),{isAiCfoAccessEnabled:j,onAskAiCfoClick:b}=_t({isAiCfoOpen:t,setIsAiCfoOpen:c,mobileExploreReferrer:"Month-End Close Overview"}),I=l.useCallback((p,E,O=!1)=>{x(me({tenantId:E,period:{month:p.month,year:p.year},refreshViewInBackground:O}))},[]),$=l.useCallback(p=>{const E=y.state?.referrer;a.monthEndCloseChecks?.auditSummary!=null&&M.trackMonthCloseAuditPage(p.month,p.year,a.monthEndCloseChecks.reportEmailSentDate!=null?"closed":"in-review",a.monthEndCloseChecks.auditSummary.auditScorePercentage,!1,E??null),x(gn(r.tenantId,p))},[r.tenantId,a.monthEndCloseChecks?.auditSummary,a.monthEndCloseChecks?.reportEmailSentDate]),S=g[r.tenantId],k=l.useCallback(()=>{const p=y.state?.referrer;a.monthEndCloseChecks?.auditSummary!=null&&M.trackMonthCloseAuditPage(S.month,S.year,a.monthEndCloseChecks.reportEmailSentDate!=null?"closed":"in-review",a.monthEndCloseChecks.auditSummary.auditScorePercentage,!0,p??null),I(S,r.tenantId,!0)},[I,S,r.tenantId,a.monthEndCloseChecks?.auditSummary,a.monthEndCloseChecks?.reportEmailSentDate]),L=Q(y.state?.pathnameStackToGoBack,y.pathname),Y=l.useCallback(()=>{if(a.monthEndCloseChecks!=null&&S!=null){const p=a.monthEndCloseChecks.monthEndCloseCheckList.find(E=>E.progress<100);if(p!=null)return void T(`./${p.id}/${S.month}-${S.year}`,{state:{pathnameStackToGoBack:L,message:"comingFromOverview"}});T(`./month_end_insights/${S.month}-${S.year}`,{state:{pathnameStackToGoBack:L,message:"comingFromOverview"}})}},[a.monthEndCloseChecks,S]),{areTenantIdsInSync:d}=Ut();return Vt({isDataReady:a.fetchState==="Completed"}),l.useEffect(()=>{S!=null&&a.fetchState!=="In-Progress"&&a.fetchState!=="Completed"&&d&&I(S,r.tenantId)},[I,S,a.fetchState,r.tenantId,d]),l.useEffect(()=>{S!=null&&a.monthClosePerformanceTrendFetchStatus.fetchState!=="In-Progress"&&a.monthClosePerformanceTrendFetchStatus.fetchState!=="Completed"&&d&&x(Cn(S))},[S,a.monthClosePerformanceTrendFetchStatus.fetchState,d]),l.useEffect(()=>{const p=setInterval(()=>{a.fetchState!=="In-Progress"&&a.fetchState==="Completed"&&k()},3e5);return()=>clearInterval(p)},[a.fetchState]),l.useEffect(()=>{if(a.fetchState==="Completed"&&a.monthEndCloseChecks?.auditSummary!=null){const p=y.state?.referrer;M.trackMonthCloseAuditPage(a.selectedPeriod.month,a.selectedPeriod.year,a.monthEndCloseChecks.reportEmailSentDate!=null?"closed":"in-review",a.monthEndCloseChecks.auditSummary.auditScorePercentage,!1,p??null)}},[a.fetchState,a.selectedPeriod,a.monthEndCloseChecks?.auditSummary,a.monthEndCloseChecks?.reportEmailSentDate]),u.jsx(ro,{children:u.jsx($a,{monthEndCloseChecksView:a,isRealtimeInsightsFeatureEnabled:P,onMonthEndCheckClick:p=>{T(`./${p}/${S.month}-${S.year}`,{state:{pathnameStackToGoBack:L,message:"comingFromOverview",referrer:"Expense Automation - Overview"}})},onPeriodChange:$,handleReviewButtonClick:Y,onBackClick:()=>{T("../../dashboard")},onReload:k,isAiCfoAccessEnabled:j,onAskAiCfoClick:b})})},ro=Ae.div`
2
2
  display: flex;
3
3
  height: 100vh;
4
4
  width: 100%;
@@ -1 +1 @@
1
- import{j as s}from"./liveblocks-CVGPqYnR.js";import{a as r}from"./sentry-vrLJXbkU.js";import{V as c,X as d,Y as l,p}from"./index-DmE4wSNC.js";import"./mui-DoY7WfR_.js";import m from"./NotFoundScreen-Dw_4aXSt.js";import{j as u,u as b}from"./core-B4ZvHvvY.js";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},a=new e.Error().stack;a&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[a]="eaf11e13-591f-4afe-82bb-7c7fc7a5da21",e._sentryDebugIdIdentifier="sentry-dbid-eaf11e13-591f-4afe-82bb-7c7fc7a5da21")}catch{}})();const D=()=>{const e=u(),a=b(),t=r.useCallback(()=>{window.open("https://www.zeni.ai/demo/request","_blank")},[]),f=r.useCallback(()=>{(()=>{const n=p(a.state?.pathnameStackToGoBack),i=n.poppedPathname??k();e(i,{state:{pathnameStackToGoBack:n.newStack}})})()},[]),o=c(a.pathname);return o!=null?s.jsx(d,{menuItem:l(o),onDemoClick:t,onGoBack:f}):s.jsx(m,{})},k=(e=2)=>{let a="../";for(let t=0;t<e;t++)a=`${a}../`;return a};export{D as F};
1
+ import{j as s}from"./liveblocks-CVGPqYnR.js";import{a as r}from"./sentry-vrLJXbkU.js";import{V as c,X as d,Y as l,p}from"./index-DgzG0i4n.js";import"./mui-DoY7WfR_.js";import m from"./NotFoundScreen-jPpbDlQd.js";import{j as u,u as b}from"./core-B4ZvHvvY.js";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},a=new e.Error().stack;a&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[a]="eaf11e13-591f-4afe-82bb-7c7fc7a5da21",e._sentryDebugIdIdentifier="sentry-dbid-eaf11e13-591f-4afe-82bb-7c7fc7a5da21")}catch{}})();const D=()=>{const e=u(),a=b(),t=r.useCallback(()=>{window.open("https://www.zeni.ai/demo/request","_blank")},[]),f=r.useCallback(()=>{(()=>{const n=p(a.state?.pathnameStackToGoBack),i=n.poppedPathname??k();e(i,{state:{pathnameStackToGoBack:n.newStack}})})()},[]),o=c(a.pathname);return o!=null?s.jsx(d,{menuItem:l(o),onDemoClick:t,onGoBack:f}):s.jsx(m,{})},k=(e=2)=>{let a="../";for(let t=0;t<e;t++)a=`${a}../`;return a};export{D as F};
@@ -1,4 +1,4 @@
1
- import{j as t}from"./liveblocks-CVGPqYnR.js";import{l as w,k as x,j,u as y,h as Y,q as ee,g as A,N as te,n as ae,o as p}from"./core-B4ZvHvvY.js";import{I9 as S,Ia as k,Ib as L,yv as $,yh as N,Ic as C,Id as ne,Ie as oe,yl as ie,eM as I,ys as se,yp as le}from"./zeni-epic-state-Da4VO2lv.js";import{K as g,o as d,n as de,c as v,h as E,I as re,p as ce,O as me,q as F,Z as pe,i as ue,r as he,F as xe,m as ge,B as be,s as fe,$ as we,v as ye,w as Se,x as ke,y as ve}from"./index-DmE4wSNC.js";import{n as c}from"./mui-DoY7WfR_.js";import b from"./NotFoundScreen-Dw_4aXSt.js";import{a as P}from"./sentry-vrLJXbkU.js";import"./recharts-DNFnaP_v.js";import"./lottie-B5aSI3Li.js";import"./analytics-BL0geQNn.js";import"./plaid-C1RHGEem.js";import"./dnd-B2_m6pRT.js";import"./stripe-DMRn4zHo.js";import"./lexical-DA5yMmPj.js";import"./pdf-ChIJqwGf.js";import"./utils-QMlevttK.js";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},a=new e.Error().stack;a&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[a]="81cbcc3b-779b-4b41-ae81-ddf05f93db51",e._sentryDebugIdIdentifier="sentry-dbid-81cbcc3b-779b-4b41-ae81-ddf05f93db51")}catch{}})();const Ie=c.div`
1
+ import{j as t}from"./liveblocks-CVGPqYnR.js";import{l as w,k as x,j,u as y,h as Y,q as ee,g as A,N as te,n as ae,o as p}from"./core-B4ZvHvvY.js";import{I9 as S,Ia as k,Ib as L,yv as $,yh as N,Ic as C,Id as ne,Ie as oe,yl as ie,eM as I,ys as se,yp as le}from"./zeni-epic-state-Da4VO2lv.js";import{K as g,o as d,n as de,c as v,h as E,I as re,p as ce,O as me,q as F,Z as pe,i as ue,r as he,F as xe,m as ge,B as be,s as fe,$ as we,v as ye,w as Se,x as ke,y as ve}from"./index-DgzG0i4n.js";import{n as c}from"./mui-DoY7WfR_.js";import b from"./NotFoundScreen-jPpbDlQd.js";import{a as P}from"./sentry-vrLJXbkU.js";import"./recharts-DNFnaP_v.js";import"./lottie-B5aSI3Li.js";import"./analytics-BL0geQNn.js";import"./plaid-C1RHGEem.js";import"./dnd-B2_m6pRT.js";import"./stripe-DMRn4zHo.js";import"./lexical-DA5yMmPj.js";import"./pdf-ChIJqwGf.js";import"./utils-QMlevttK.js";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},a=new e.Error().stack;a&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[a]="81cbcc3b-779b-4b41-ae81-ddf05f93db51",e._sentryDebugIdIdentifier="sentry-dbid-81cbcc3b-779b-4b41-ae81-ddf05f93db51")}catch{}})();const Ie=c.div`
2
2
  display: flex;
3
3
  height: 100%;
4
4
  width: 100%;
@@ -1,4 +1,4 @@
1
- import{j as u}from"./liveblocks-CVGPqYnR.js";import{a as g}from"./sentry-vrLJXbkU.js";import{h as U,u as _,j as w,q as M,g as l,N as T}from"./core-B4ZvHvvY.js";import{z as r,m as V,D as P,d as A,c as N,e as H,j as R,$ as W,g as $}from"./index-DmE4wSNC.js";import{eL as q,HV as B,I4 as G,HW as J,eM as K,fh as Q,I0 as X,fE as Y,cR as Z,I5 as ee,I6 as te}from"./zeni-epic-state-Da4VO2lv.js";import{n as ne}from"./mui-DoY7WfR_.js";import{u as se}from"./useDeviceId-BMtoTIZs.js";import{f as ae}from"./analyticsHelper-ZM4U1wiv.js";import{t as ie}from"./getLocaleForTenant-7ntdeZSs.js";import"./recharts-DNFnaP_v.js";import"./lottie-B5aSI3Li.js";import"./analytics-BL0geQNn.js";import"./plaid-C1RHGEem.js";import"./dnd-B2_m6pRT.js";import"./stripe-DMRn4zHo.js";import"./lexical-DA5yMmPj.js";import"./pdf-ChIJqwGf.js";import"./utils-QMlevttK.js";(function(){try{var t=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},a=new t.Error().stack;a&&(t._sentryDebugIds=t._sentryDebugIds||{},t._sentryDebugIds[a]="a3027238-f248-4078-ba81-e121f6a37d1b",t._sentryDebugIdIdentifier="sentry-dbid-a3027238-f248-4078-ba81-e121f6a37d1b")}catch{}})();const D=(t,a)=>t!=null&&t.length>0&&a==="magic_links";function De(){const t=U(),a=_(),m=w(),[k]=M(),n=k.get("token"),p=k.get("stytch_token_type"),f=r.getMagicLinkCodeVerifier(),i=se(),{otpChallenge:d,twoFAPhoneNumber:x,magicLinkEmail:c,verifyDeviceFetchState:z,resendVerifyDeviceOTPFetchState:C}=l(e=>e.tenantState),S=l(e=>e.tenantState.fetchState),y=l(e=>e.tenantState.activeTenantFetchState.fetchState),I=l(e=>e.tenantState.signInState),h=l(e=>e.tenantState.magicLinkSignInFetchState.fetchState),s=l(e=>e.tenantState.loggedInUser),o=l(e=>q(e)),b=l(e=>B(e)),E=r.getSignedInUser(),v=V().mode;g.useEffect(()=>{s?.zeniSessionId==null&&n!=null&&D(n,p)&&i!=null&&f!=null&&(r.saveMagicLinkTriggered(n),t(G(n,i,f)))},[n,p,t,i,f,s?.zeniSessionId]),g.useEffect(()=>{I!=="In-Progress"||S!=="Completed"&&y!=="Completed"||s?.zeniSessionId==null||o==null||(n!=null&&r.saveLastUsedMagicLinkToken(n),r.saveSignedInUserWithSession(s,s.zeniSessionId),r.saveSignedInUserTenants(J(b.tenantsInOrder),s.zeniSessionId),K(s.userId,s.zeniSessionId,o.tenantId),t(Q(o.tenantId)),r.saveActiveTenantDomainForUser(o.tenantEmailDomain),t(X("Completed")),P.updateAppLocaleID(ie(o)),ae(s,o,v,void 0,b.tenantsInOrder),Y().then(()=>{const e=$();e!=null&&A(e)}),setTimeout(()=>{N.trackLogin(H.Event.loginSuccess,"email",Z(o.productSettings))},2e3))},[I,S,y,s,o,b,v,a.state,t]);const j=g.useCallback(()=>{m("/signin/auth")},[m]),F=g.useCallback(()=>{i!=null&&d!=null&&c!=null&&t(ee(i,c,d))},[i,d,t,c]),O=g.useCallback(e=>{i!=null&&n!=null&&c!=null&&d!=null&&t(te(e,i,c,d))},[i,n,t,c,d]);if(h==="Completed"&&d!=null)return u.jsx(R,{phoneNumber:x,verifyOtpFetchState:z.fetchState,resendVerifyDeviceOTPFetchState:C,onResendOtp:F,onVerifyOtp:O,onCancelVerifyDevice:j});if(I==="In-Progress"&&S==="Completed"&&s?.zeniSessionId!=null&&o!=null||E!=null){const e=a.state?.origin??"/";return u.jsx(T,{to:e,state:{...a.state,origin:""}})}if(!D(n,p)||f==null||h==="Error"){const e=a.state?.origin??"/",L=n!=null&&r.getLastUsedMagicLinkToken()===n;return u.jsx(T,{to:e,state:{...a.state,origin:"",magicLinkAlreadyUsed:L,magicLinkExpired:!L&&(r.isMagicLinkTriggered(n??"")||h==="Error"&&s?.zeniSessionId==null)}})}return u.jsx(oe,{"data-testid":"smooth-loader",children:u.jsx(W,{size:"ExtraLarge",start:!0})})}const oe=ne.div`
1
+ import{j as u}from"./liveblocks-CVGPqYnR.js";import{a as g}from"./sentry-vrLJXbkU.js";import{h as U,u as _,j as w,q as M,g as l,N as T}from"./core-B4ZvHvvY.js";import{z as r,m as V,D as P,d as A,c as N,e as H,j as R,$ as W,g as $}from"./index-DgzG0i4n.js";import{eL as q,HV as B,I4 as G,HW as J,eM as K,fh as Q,I0 as X,fE as Y,cR as Z,I5 as ee,I6 as te}from"./zeni-epic-state-Da4VO2lv.js";import{n as ne}from"./mui-DoY7WfR_.js";import{u as se}from"./useDeviceId-BMtoTIZs.js";import{f as ae}from"./analyticsHelper-B-IDLpaZ.js";import{t as ie}from"./getLocaleForTenant-C50EFRQ8.js";import"./recharts-DNFnaP_v.js";import"./lottie-B5aSI3Li.js";import"./analytics-BL0geQNn.js";import"./plaid-C1RHGEem.js";import"./dnd-B2_m6pRT.js";import"./stripe-DMRn4zHo.js";import"./lexical-DA5yMmPj.js";import"./pdf-ChIJqwGf.js";import"./utils-QMlevttK.js";(function(){try{var t=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},a=new t.Error().stack;a&&(t._sentryDebugIds=t._sentryDebugIds||{},t._sentryDebugIds[a]="a3027238-f248-4078-ba81-e121f6a37d1b",t._sentryDebugIdIdentifier="sentry-dbid-a3027238-f248-4078-ba81-e121f6a37d1b")}catch{}})();const D=(t,a)=>t!=null&&t.length>0&&a==="magic_links";function De(){const t=U(),a=_(),m=w(),[k]=M(),n=k.get("token"),p=k.get("stytch_token_type"),f=r.getMagicLinkCodeVerifier(),i=se(),{otpChallenge:d,twoFAPhoneNumber:x,magicLinkEmail:c,verifyDeviceFetchState:z,resendVerifyDeviceOTPFetchState:C}=l(e=>e.tenantState),S=l(e=>e.tenantState.fetchState),y=l(e=>e.tenantState.activeTenantFetchState.fetchState),I=l(e=>e.tenantState.signInState),h=l(e=>e.tenantState.magicLinkSignInFetchState.fetchState),s=l(e=>e.tenantState.loggedInUser),o=l(e=>q(e)),b=l(e=>B(e)),E=r.getSignedInUser(),v=V().mode;g.useEffect(()=>{s?.zeniSessionId==null&&n!=null&&D(n,p)&&i!=null&&f!=null&&(r.saveMagicLinkTriggered(n),t(G(n,i,f)))},[n,p,t,i,f,s?.zeniSessionId]),g.useEffect(()=>{I!=="In-Progress"||S!=="Completed"&&y!=="Completed"||s?.zeniSessionId==null||o==null||(n!=null&&r.saveLastUsedMagicLinkToken(n),r.saveSignedInUserWithSession(s,s.zeniSessionId),r.saveSignedInUserTenants(J(b.tenantsInOrder),s.zeniSessionId),K(s.userId,s.zeniSessionId,o.tenantId),t(Q(o.tenantId)),r.saveActiveTenantDomainForUser(o.tenantEmailDomain),t(X("Completed")),P.updateAppLocaleID(ie(o)),ae(s,o,v,void 0,b.tenantsInOrder),Y().then(()=>{const e=$();e!=null&&A(e)}),setTimeout(()=>{N.trackLogin(H.Event.loginSuccess,"email",Z(o.productSettings))},2e3))},[I,S,y,s,o,b,v,a.state,t]);const j=g.useCallback(()=>{m("/signin/auth")},[m]),F=g.useCallback(()=>{i!=null&&d!=null&&c!=null&&t(ee(i,c,d))},[i,d,t,c]),O=g.useCallback(e=>{i!=null&&n!=null&&c!=null&&d!=null&&t(te(e,i,c,d))},[i,n,t,c,d]);if(h==="Completed"&&d!=null)return u.jsx(R,{phoneNumber:x,verifyOtpFetchState:z.fetchState,resendVerifyDeviceOTPFetchState:C,onResendOtp:F,onVerifyOtp:O,onCancelVerifyDevice:j});if(I==="In-Progress"&&S==="Completed"&&s?.zeniSessionId!=null&&o!=null||E!=null){const e=a.state?.origin??"/";return u.jsx(T,{to:e,state:{...a.state,origin:""}})}if(!D(n,p)||f==null||h==="Error"){const e=a.state?.origin??"/",L=n!=null&&r.getLastUsedMagicLinkToken()===n;return u.jsx(T,{to:e,state:{...a.state,origin:"",magicLinkAlreadyUsed:L,magicLinkExpired:!L&&(r.isMagicLinkTriggered(n??"")||h==="Error"&&s?.zeniSessionId==null)}})}return u.jsx(oe,{"data-testid":"smooth-loader",children:u.jsx(W,{size:"ExtraLarge",start:!0})})}const oe=ne.div`
2
2
  position: fixed;
3
3
  top: 0;
4
4
  left: 0;