@zeniai/web-app-ui 5.0.3-dev → 5.0.4-dev

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 (100) hide show
  1. package/dist/assets/AddressRoutes-BfOuxooD.js +1 -0
  2. package/dist/assets/{AddressScreen-BqbCkW9F.js → AddressScreen-tCLozkzY.js} +1 -1
  3. package/dist/assets/{AiCfoScreen-Cn0zhkC5.js → AiCfoScreen-BHQknTzK.js} +1 -1
  4. package/dist/assets/{BillPayApprovalRoutes-Bolmrdjm.js → BillPayApprovalRoutes-BjYSk6ti.js} +1 -1
  5. package/dist/assets/{BillPayRoutes-BSgAGGub.js → BillPayRoutes-CHzCnxpe.js} +1 -1
  6. package/dist/assets/{BusinessVerificationPageScreen-S9e9j7rw.js → BusinessVerificationPageScreen-j2FAzNjV.js} +1 -1
  7. package/dist/assets/{ChargeCardRoutes-BEYtqvNa.js → ChargeCardRoutes-C761-FAb.js} +1 -1
  8. package/dist/assets/{CompanyPassportScreen-dMXV1qo-.js → CompanyPassportScreen-BVtucNEF.js} +1 -1
  9. package/dist/assets/{ConnectionAuthScreen-D7LbK8he.js → ConnectionAuthScreen-Ei8QSx21.js} +1 -1
  10. package/dist/assets/CustomerOnboardingAuthScreen-CYRzq56g.js +1 -0
  11. package/dist/assets/{CustomerOnboardingRoutes-CErJ4D5a.js → CustomerOnboardingRoutes-CK9QfpeW.js} +1 -1
  12. package/dist/assets/{DashboardRoutes-Byj-cT7T.js → DashboardRoutes-C2kxyP02.js} +1 -1
  13. package/dist/assets/{DefaultTenantHome-DlY-4PIS.js → DefaultTenantHome-DduNDlJB.js} +1 -1
  14. package/dist/assets/{DomesticWireDetailScreen-BwBgY_jC.js → DomesticWireDetailScreen-Cj8iAPXf.js} +1 -1
  15. package/dist/assets/{DrawerScreen-7RB3pd-L.js → DrawerScreen-Dv_UzQOo.js} +1 -1
  16. package/dist/assets/{EntityDetailRoutes-2Lvrz1et.js → EntityDetailRoutes-CCSZXrNV.js} +1 -1
  17. package/dist/assets/{ExpenseAutomationRoutes-Rd1hQhl9.js → ExpenseAutomationRoutes-D95clzaF.js} +1 -1
  18. package/dist/assets/{FeaturePreviewScreen-CHkVgg1G.js → FeaturePreviewScreen-3Cs41rNa.js} +1 -1
  19. package/dist/assets/{MagicLinkRoutes-BZOFHOk2.js → MagicLinkRoutes-DqbOY0pO.js} +1 -1
  20. package/dist/assets/{MagicLinkSignInScreen-DHTOpNlI.js → MagicLinkSignInScreen-cJxTn6Z5.js} +1 -1
  21. package/dist/assets/{MobileAppDrawer-Cq6umKbp.js → MobileAppDrawer-D0-D1IIa.js} +1 -1
  22. package/dist/assets/NotFoundScreen-BM3DcBu4.js +1 -0
  23. package/dist/assets/{NotificationRoutes-UDRP-d_i.js → NotificationRoutes-fnITeGvC.js} +1 -1
  24. package/dist/assets/{PandLWithForecastRoutes-DovBC5qm.js → PandLWithForecastRoutes-DXeM7QQi.js} +1 -1
  25. package/dist/assets/{PeopleRoutes-BpIaCleR.js → PeopleRoutes-DWNHtx0-.js} +1 -1
  26. package/dist/assets/{PerformanceRoutes-DD5yUPPu.js → PerformanceRoutes-B2---Xlh.js} +1 -1
  27. package/dist/assets/{Preview-B_pB49hk.js → Preview-RTK9mHhj.js} +1 -1
  28. package/dist/assets/{QBOConnectionScreen-mxlQ58sF.js → QBOConnectionScreen-CMvaIZxf.js} +1 -1
  29. package/dist/assets/{ReferralListScreen-DDAnd9kQ.js → ReferralListScreen-CU0cqYp3.js} +1 -1
  30. package/dist/assets/{ReimbursementApprovalRoutes-DtjTNMyW.js → ReimbursementApprovalRoutes-DghBrXt3.js} +1 -1
  31. package/dist/assets/{ReimbursementApprovalRuleDetailScreen-mjO0EFcS.js → ReimbursementApprovalRuleDetailScreen-CnM97Nh_.js} +1 -1
  32. package/dist/assets/{ReimbursementRoutes-DM6_XIzS.js → ReimbursementRoutes-BlPwJb9-.js} +1 -1
  33. package/dist/assets/{ReportsRoutes-CSv8fmaw.js → ReportsRoutes-OsfHQ-oH.js} +1 -1
  34. package/dist/assets/{RewardsRoutes-CQy-a7uv.js → RewardsRoutes-DCXhofuE.js} +1 -1
  35. package/dist/assets/{ScreenRoutes-BQrRNAQd.js → ScreenRoutes-DsynOrE_.js} +2 -2
  36. package/dist/assets/{SettingsRoutes-CwWBls5-.js → SettingsRoutes-DZ_F2Kb6.js} +1 -1
  37. package/dist/assets/{SetupPagesScreen-C7kgTCyu.js → SetupPagesScreen-B8Rno5B2.js} +1 -1
  38. package/dist/assets/{SignInScreen-CJiqdtfL.js → SignInScreen-rwU-QvmY.js} +1 -1
  39. package/dist/assets/{SignOutScreen-xBwa5MBZ.js → SignOutScreen-C7mRBzAo.js} +1 -1
  40. package/dist/assets/{TaskListScreen-vJcR4Bnk.js → TaskListScreen-xi0Q2QtO.js} +1 -1
  41. package/dist/assets/{TaskRoutes-CHbekD_1.js → TaskRoutes-B_fERi8e.js} +1 -1
  42. package/dist/assets/TransactionDetailRoutes-Bid-ev7j.js +1 -0
  43. package/dist/assets/{TransactionDetailScreen-lfCtA1jG.js → TransactionDetailScreen-Bgfn35GF.js} +1 -1
  44. package/dist/assets/{TransactionListRoutes-C2Nh8rHE.js → TransactionListRoutes-B3VXniAo.js} +1 -1
  45. package/dist/assets/{TreasuryRoutes-BTPTKFd8.js → TreasuryRoutes-CLsu4EBs.js} +1 -1
  46. package/dist/assets/{VendorsRoutes-B0tRBNsh.js → VendorsRoutes-DTiBYFq_.js} +1 -1
  47. package/dist/assets/{WiseConfirmationScreen-DW-WFPj-.js → WiseConfirmationScreen-DCTQj8ux.js} +1 -1
  48. package/dist/assets/{ZeniAccountRoutes-wiCc-pYp.js → ZeniAccountRoutes-D7fsKNF6.js} +1 -1
  49. package/dist/assets/{ZeniAccountStatementScreen-BjUITEnt.js → ZeniAccountStatementScreen-CD8WdGq8.js} +1 -1
  50. package/dist/assets/{accountMappingHelper-DVEV1WRI.js → accountMappingHelper-BvCdqdBq.js} +1 -1
  51. package/dist/assets/{analytics-BAQwJULS.js → analytics-Cp5F-UjF.js} +1 -1
  52. package/dist/assets/{analyticsHelper-D9biWtDJ.js → analyticsHelper-BTOyHFla.js} +1 -1
  53. package/dist/assets/{core-D85lL_9t.js → core-DZE88rLA.js} +1 -1
  54. package/dist/assets/{decodeURIComponentSafe-ByB9WhLS.js → decodeURIComponentSafe--utjO_hD.js} +1 -1
  55. package/dist/assets/{dnd-P1ekKsf6.js → dnd-B4DEM2bW.js} +1 -1
  56. package/dist/assets/{empty-CYNEYtaG.js → empty-CRf4YhY4.js} +1 -1
  57. package/dist/assets/{empty-vrCkOfCr.js → empty-DTOnM0RR.js} +1 -1
  58. package/dist/assets/{emptyVideoElement-dzCxtvYW.js → emptyVideoElement-BgQif9Ia.js} +1 -1
  59. package/dist/assets/{epic-DD3uTQrs.js → epic-BzOmBklW.js} +1 -1
  60. package/dist/assets/{getLocaleForTenant-ClrmJsWr.js → getLocaleForTenant-CPndpwIp.js} +1 -1
  61. package/dist/assets/{index-eyGUyZ3T.js → index-BET54Nt-.js} +5 -5
  62. package/dist/assets/{index-BPbXNCzw.js → index-BWIeQAsg.js} +1 -1
  63. package/dist/assets/{index-Dmo9xgqA.js → index-CTObQYXg.js} +1 -1
  64. package/dist/assets/{index-BEEelBYS.js → index-ChZJ__M2.js} +1 -1
  65. package/dist/assets/{index-Cn65SF8r.js → index-CofKdFHU.js} +2 -2
  66. package/dist/assets/{index-lPBYjZLr.js → index-DpHHAj1V.js} +1 -1
  67. package/dist/assets/{index-BUCtSz30.js → index-j9ZiGcsv.js} +1 -1
  68. package/dist/assets/{lexical-C7vBKQl2.js → lexical-Bp_BNV6r.js} +1 -1
  69. package/dist/assets/{liveblocks-dlvb-ucF.js → liveblocks-Cqbf2YvG.js} +1 -1
  70. package/dist/assets/{lottie-DGXsyyYr.js → lottie-BMcMDJUW.js} +1 -1
  71. package/dist/assets/{mui-C9WBrZQt.js → mui-B4xUUoCx.js} +1 -1
  72. package/dist/assets/{pathToGoBack-Bl_9p4QB.js → pathToGoBack-H4XoSP95.js} +1 -1
  73. package/dist/assets/{pdf-DebxFbW1.js → pdf-DYKlsr3c.js} +3 -3
  74. package/dist/assets/{pdf-lib-VVDJ8cIK.js → pdf-lib-vymaIDnW.js} +1 -1
  75. package/dist/assets/{plaid-BveLUCs7.js → plaid-G98kqTnM.js} +1 -1
  76. package/dist/assets/{pusher-DUCiEwkw.js → pusher-D7P3EdsP.js} +1 -1
  77. package/dist/assets/{react-D5d1k6ry.js → react-4qgRGAdN.js} +1 -1
  78. package/dist/assets/{react-5tQG_cKG.js → react-BEWrpOF5.js} +1 -1
  79. package/dist/assets/{react-1c4ID8s0.js → react-Bhe_slJS.js} +1 -1
  80. package/dist/assets/{react-BdgNO3-u.js → react-BmZ57NU9.js} +1 -1
  81. package/dist/assets/{react-BKO9NKrm.js → react-CLdnK8kQ.js} +1 -1
  82. package/dist/assets/{react-Cj6aZ7ln.js → react-CuhJdsIn.js} +1 -1
  83. package/dist/assets/{recharts-BYSqK3LX.js → recharts-3_XOsuaw.js} +1 -1
  84. package/dist/assets/{routePaths-Ckqdpqo6.js → routePaths-BNouI24c.js} +1 -1
  85. package/dist/assets/{sentry-DGJ961LO.js → sentry-gLPXz4Yq.js} +1 -1
  86. package/dist/assets/{url-DoymNVR-.js → url-DMg8GQjt.js} +1 -1
  87. package/dist/assets/{url-CLAf8TQN.js → url-DpALAoIG.js} +1 -1
  88. package/dist/assets/{useAskAiCfoHostNavButtonProps-D7VmZhkv.js → useAskAiCfoHostNavButtonProps-CIwJkrUG.js} +1 -1
  89. package/dist/assets/{useDeviceId-cXBRwcUd.js → useDeviceId-CMDzs7Gm.js} +1 -1
  90. package/dist/assets/{useFetchSuggestedQuestionsWhenReady-vh4emZ7O.js → useFetchSuggestedQuestionsWhenReady-CZP4Iues.js} +1 -1
  91. package/dist/assets/{useInitialThreadRequest-CdZgxQMw.js → useInitialThreadRequest-DFJpueCY.js} +1 -1
  92. package/dist/assets/{utils-4E0JE-n2.js → utils-oW6HiHsc.js} +1 -1
  93. package/dist/assets/{withTransactionSidePanel-BjZspg1h.js → withTransactionSidePanel-DiiilNMM.js} +1 -1
  94. package/dist/assets/{zeni-epic-state-De57_V18.js → zeni-epic-state-Cc2P4FPR.js} +3 -3
  95. package/dist/index.html +1 -1
  96. package/package.json +1 -1
  97. package/dist/assets/AddressRoutes-DILxRnu9.js +0 -1
  98. package/dist/assets/CustomerOnboardingAuthScreen-BI1X8NcD.js +0 -1
  99. package/dist/assets/NotFoundScreen-CNrR5P_G.js +0 -1
  100. package/dist/assets/TransactionDetailRoutes-a-PE8_JU.js +0 -1
@@ -0,0 +1 @@
1
+ import{j as e}from"./liveblocks-Cqbf2YvG.js";import{A as i}from"./AddressScreen-tCLozkzY.js";import s from"./NotFoundScreen-BM3DcBu4.js";import"./sentry-gLPXz4Yq.js";import{n as d,o as r}from"./core-DZE88rLA.js";import"./zeni-epic-state-Cc2P4FPR.js";import"./recharts-3_XOsuaw.js";import"./index-BET54Nt-.js";import"./mui-B4xUUoCx.js";import"./lottie-BMcMDJUW.js";import"./analytics-Cp5F-UjF.js";import"./plaid-G98kqTnM.js";import"./dnd-B4DEM2bW.js";import"./stripe-DMRn4zHo.js";import"./lexical-Bp_BNV6r.js";import"./pdf-DYKlsr3c.js";import"./utils-oW6HiHsc.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-dlvb-ucF.js";import{a as b}from"./sentry-DGJ961LO.js";import{j as P,h as _,u as j,l as E,g as M,k as B}from"./core-D85lL_9t.js";import{Z as $,m as L,z as D,j as K,B as N,w as R,d as I,f as S,n as z,h,p as F}from"./index-eyGUyZ3T.js";import{IL as C,gI as U,eM as G,IM as O,b$ as V,IN as q,jQ as H}from"./zeni-epic-state-De57_V18.js";import{n as Q}from"./mui-C9WBrZQt.js";import Z from"./NotFoundScreen-CNrR5P_G.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]="0b3e6fd4-98ba-4104-a219-aacbf92f3799",e._sentryDebugIdIdentifier="sentry-dbid-0b3e6fd4-98ba-4104-a219-aacbf92f3799")}catch{}})();const J=Q.div`
1
+ import{j as d}from"./liveblocks-Cqbf2YvG.js";import{a as b}from"./sentry-gLPXz4Yq.js";import{j as P,h as _,u as j,l as E,g as M,k as B}from"./core-DZE88rLA.js";import{Z as $,m as L,z as D,j as K,B as N,w as R,d as I,f as S,n as z,h,p as F}from"./index-BET54Nt-.js";import{IL as C,gI as U,eM as G,IM as O,b$ as V,IN as q,jQ as H}from"./zeni-epic-state-Cc2P4FPR.js";import{n as Q}from"./mui-B4xUUoCx.js";import Z from"./NotFoundScreen-BM3DcBu4.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]="0b3e6fd4-98ba-4104-a219-aacbf92f3799",e._sentryDebugIdIdentifier="sentry-dbid-0b3e6fd4-98ba-4104-a219-aacbf92f3799")}catch{}})();const J=Q.div`
2
2
  display: flex;
3
3
  height: 100vh;
4
4
  width: 100%;
@@ -1,4 +1,4 @@
1
- import{j as S}from"./liveblocks-dlvb-ucF.js";import{a as i}from"./sentry-DGJ961LO.js";import{h as ee,j as te,u as se,g as B,l as ae,k as ne}from"./core-D85lL_9t.js";import{F as oe,cB as ie,z as re,Z as le,cC as ue,cD as ce,cE as $,w as de,d as _,O as R,cF as me,cG as fe,f as pe,a1 as he,cH as Se,Q as ge,r as Ce,p as we,cI as be,cJ as Ie}from"./index-eyGUyZ3T.js";import{fE as ke,f3 as N,eM as Ee,h8 as ye,Ph as Pe,eL as Te,hi as _e,he as xe,fu as ve,fo as Qe,fh as Ae,fl as j,fp as Oe,fq as Fe,fr as De,fs as Le,ft as Me}from"./zeni-epic-state-De57_V18.js";import{D as Ue,n as x,P as Be,S as Re}from"./mui-C9WBrZQt.js";import{p as je}from"./pathToGoBack-Bl_9p4QB.js";import"./recharts-BYSqK3LX.js";import"./lottie-DGXsyyYr.js";import"./analytics-BAQwJULS.js";import"./plaid-BveLUCs7.js";import"./dnd-P1ekKsf6.js";import"./stripe-DMRn4zHo.js";import"./lexical-C7vBKQl2.js";import"./pdf-DebxFbW1.js";import"./utils-4E0JE-n2.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]="836582a3-c6b8-4799-9f52-98db0ba0e97f",a._sentryDebugIdIdentifier="sentry-dbid-836582a3-c6b8-4799-9f52-98db0ba0e97f")}catch{}})();const q="chat-response-generated",$e=ne(function(a,r){const n=N(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:u,navigate:f,currentChatSessionId:p,allSessionsWithOrderedQuestionAnswers:g}=r;return{onEventReceived:(e,o)=>{if(e===q&&typeof o.text=="string"&&typeof o.metadata=="object"){const t=o,m=Fe(t.type),c=t.metadata.chat_session_id??null,{currentChatSession:s,currentQuestionAnswer:C,currentQuestionAnswerSummary:h}=$(g,c);m!=="answer"?_.trackAICFOChatResponseGenerated(m,C?.question.questionText??"",t.text,c,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,De(t.visualization?.type??"")??null,c,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:u}))}},onSubmit:(e,o,t,m)=>{e&&be(a,e,o,p,g,u,m,t)},updateCurrentInput:e=>{a(j(e))},onStopSubmit:()=>{},onUpdateScrollYOffset:e=>{a(Oe(e))},onSelectSampleQuestion:()=>{},onBackClick:()=>{f(-1)},onCloseClick:()=>{const e=we(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(),u=se(),[f,p]=i.useState(!1);i.useEffect(()=>{n(ke())},[n]);const{customPageTitle:g}=ie(),e=B(l=>N(l)),o=re.getSignedInUser(),{session_id:t}=ae(),m=le(),c=B(l=>Ee(l)),s=e.uiState.currentChatSessionId,C=ue({currentTenant:c,currentChatSessionId:s,aiCfoView:e}),h=u.state,w=h?.aiCfoInitialQuestion,v=!!h?.aiCfoShouldSubmit,[G,k]=i.useState(null),[V,E]=i.useState(!1),Q=i.useRef(!1);i.useEffect(()=>{Q.current||w==null||w===""||(k(w),E(v),Q.current=!0)},[w,v]);const H=i.useCallback(()=>{k(null),E(!1)},[]),A=i.useMemo(()=>new URLSearchParams(u.search),[u.search]),O=A.get("ref")??h?.aiCfoRef,y=A.get("emailRefId")??h?.aiCfoEmailRefId,F=i.useRef(!1);i.useEffect(()=>{F.current||O!=="month-end-email"||y==null||s!=null||o==null||(n(ye("controller",o.userId,y,"MONTH_END_EMAIL")),F.current=!0)},[O,y,s,n,o]);const b=e.uiState.lastContextMessage;i.useEffect(()=>{b!=null&&b!==""&&s!=null&&(k(b),E(!0),n(Pe()))},[b,s,n]);const W=c.masterTOSInfo,I=W?.isMasterTOSAccepted??!1,{visitedSessions:D}=ce(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),U=e.allSessionsWithOrderedQuestionAnswers,{currentSessionQuestionAnswers:z}=$(U,s),J=z.length===0;i.useEffect(()=>{I||d("../dashboard",{state:{...u.state,message:"open_ai_cfo_drawer"}})},[I]),i.useEffect(()=>{s!=null&&t!==s&&d(`../ai-cfo/${s}`,{state:{...u.state}})},[s,t]),i.useEffect(()=>{t!=null&&s==null&&t!=="new_chat"&&t!=="explore"&&n(Te({sessionId:t,agentId:"controller"}))},[]);const X=i.useMemo(()=>({events:D.map(l=>`private-chat-${l}.${q}`),eventCallback:(l,Z,K)=>K.onEventReceived(l,Z)}),[D]);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 Y=s!=null&&e.responseStateByChatSessionId?.[s]?.answer?.fetchState==="In-Progress";return S.jsxs(qe,{children:[S.jsx(de,{analytics:_,onLoad:l=>l.trackPageLoaded(pe.Event.aiCFOPage)}),R(m)&&C.drawerElement,S.jsx($e,{...X,currentChatSessionId:s,allSessionsWithOrderedQuestionAnswers:U,openOnboardingPage:()=>p(!0),userId:o.userId,setIsAiCfoOpen:r,navigate:d,sessionFromUrl:t,location:u,isSubmitting:Y,isEmptyChatWithSession:J,customPageTitle:g,currentTenant:c,emailLinkQuestion:G??void 0,autoSubmitEmailLinkQuestion:V,onEmailLinkQuestionProcessed:H,onMenuClick:R(m)?C.open:void 0,isFileUploadEnabled:a}),S.jsx(Ue,{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(Ne,{onClick:l=>l.stopPropagation(),children:S.jsx(fe,{isTOSAccepted:I,acceptMasterTOSState:e.masterTOSAcceptanceState,customPageTitle:g,onCloseClick:()=>p(!1),onCompleteClick:()=>{I||c.userRoleId==null||n(ve(c.userRoleId)),p(!1)}})})})]})},Ne=x(Re)`
1
+ import{j as S}from"./liveblocks-Cqbf2YvG.js";import{a as i}from"./sentry-gLPXz4Yq.js";import{h as ee,j as te,u as se,g as B,l as ae,k as ne}from"./core-DZE88rLA.js";import{F as oe,cB as ie,z as re,Z as le,cC as ue,cD as ce,cE as $,w as de,d as _,O as R,cF as me,cG as fe,f as pe,a1 as he,cH as Se,Q as ge,r as Ce,p as we,cI as be,cJ as Ie}from"./index-BET54Nt-.js";import{fE as ke,f3 as N,eM as Ee,h8 as ye,Ph as Pe,eL as Te,hi as _e,he as xe,fu as ve,fo as Qe,fh as Ae,fl as j,fp as Oe,fq as Fe,fr as De,fs as Le,ft as Me}from"./zeni-epic-state-Cc2P4FPR.js";import{D as Ue,n as x,P as Be,S as Re}from"./mui-B4xUUoCx.js";import{p as je}from"./pathToGoBack-H4XoSP95.js";import"./recharts-3_XOsuaw.js";import"./lottie-BMcMDJUW.js";import"./analytics-Cp5F-UjF.js";import"./plaid-G98kqTnM.js";import"./dnd-B4DEM2bW.js";import"./stripe-DMRn4zHo.js";import"./lexical-Bp_BNV6r.js";import"./pdf-DYKlsr3c.js";import"./utils-oW6HiHsc.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]="836582a3-c6b8-4799-9f52-98db0ba0e97f",a._sentryDebugIdIdentifier="sentry-dbid-836582a3-c6b8-4799-9f52-98db0ba0e97f")}catch{}})();const q="chat-response-generated",$e=ne(function(a,r){const n=N(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:u,navigate:f,currentChatSessionId:p,allSessionsWithOrderedQuestionAnswers:g}=r;return{onEventReceived:(e,o)=>{if(e===q&&typeof o.text=="string"&&typeof o.metadata=="object"){const t=o,m=Fe(t.type),c=t.metadata.chat_session_id??null,{currentChatSession:s,currentQuestionAnswer:C,currentQuestionAnswerSummary:h}=$(g,c);m!=="answer"?_.trackAICFOChatResponseGenerated(m,C?.question.questionText??"",t.text,c,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,De(t.visualization?.type??"")??null,c,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:u}))}},onSubmit:(e,o,t,m)=>{e&&be(a,e,o,p,g,u,m,t)},updateCurrentInput:e=>{a(j(e))},onStopSubmit:()=>{},onUpdateScrollYOffset:e=>{a(Oe(e))},onSelectSampleQuestion:()=>{},onBackClick:()=>{f(-1)},onCloseClick:()=>{const e=we(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(),u=se(),[f,p]=i.useState(!1);i.useEffect(()=>{n(ke())},[n]);const{customPageTitle:g}=ie(),e=B(l=>N(l)),o=re.getSignedInUser(),{session_id:t}=ae(),m=le(),c=B(l=>Ee(l)),s=e.uiState.currentChatSessionId,C=ue({currentTenant:c,currentChatSessionId:s,aiCfoView:e}),h=u.state,w=h?.aiCfoInitialQuestion,v=!!h?.aiCfoShouldSubmit,[G,k]=i.useState(null),[V,E]=i.useState(!1),Q=i.useRef(!1);i.useEffect(()=>{Q.current||w==null||w===""||(k(w),E(v),Q.current=!0)},[w,v]);const H=i.useCallback(()=>{k(null),E(!1)},[]),A=i.useMemo(()=>new URLSearchParams(u.search),[u.search]),O=A.get("ref")??h?.aiCfoRef,y=A.get("emailRefId")??h?.aiCfoEmailRefId,F=i.useRef(!1);i.useEffect(()=>{F.current||O!=="month-end-email"||y==null||s!=null||o==null||(n(ye("controller",o.userId,y,"MONTH_END_EMAIL")),F.current=!0)},[O,y,s,n,o]);const b=e.uiState.lastContextMessage;i.useEffect(()=>{b!=null&&b!==""&&s!=null&&(k(b),E(!0),n(Pe()))},[b,s,n]);const W=c.masterTOSInfo,I=W?.isMasterTOSAccepted??!1,{visitedSessions:D}=ce(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),U=e.allSessionsWithOrderedQuestionAnswers,{currentSessionQuestionAnswers:z}=$(U,s),J=z.length===0;i.useEffect(()=>{I||d("../dashboard",{state:{...u.state,message:"open_ai_cfo_drawer"}})},[I]),i.useEffect(()=>{s!=null&&t!==s&&d(`../ai-cfo/${s}`,{state:{...u.state}})},[s,t]),i.useEffect(()=>{t!=null&&s==null&&t!=="new_chat"&&t!=="explore"&&n(Te({sessionId:t,agentId:"controller"}))},[]);const X=i.useMemo(()=>({events:D.map(l=>`private-chat-${l}.${q}`),eventCallback:(l,Z,K)=>K.onEventReceived(l,Z)}),[D]);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 Y=s!=null&&e.responseStateByChatSessionId?.[s]?.answer?.fetchState==="In-Progress";return S.jsxs(qe,{children:[S.jsx(de,{analytics:_,onLoad:l=>l.trackPageLoaded(pe.Event.aiCFOPage)}),R(m)&&C.drawerElement,S.jsx($e,{...X,currentChatSessionId:s,allSessionsWithOrderedQuestionAnswers:U,openOnboardingPage:()=>p(!0),userId:o.userId,setIsAiCfoOpen:r,navigate:d,sessionFromUrl:t,location:u,isSubmitting:Y,isEmptyChatWithSession:J,customPageTitle:g,currentTenant:c,emailLinkQuestion:G??void 0,autoSubmitEmailLinkQuestion:V,onEmailLinkQuestionProcessed:H,onMenuClick:R(m)?C.open:void 0,isFileUploadEnabled:a}),S.jsx(Ue,{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(Ne,{onClick:l=>l.stopPropagation(),children:S.jsx(fe,{isTOSAccepted:I,acceptMasterTOSState:e.masterTOSAcceptanceState,customPageTitle:g,onCloseClick:()=>p(!1),onCompleteClick:()=>{I||c.userRoleId==null||n(ve(c.userRoleId)),p(!1)}})})})]})},Ne=x(Re)`
2
2
  display: flex;
3
3
  min-height: 100%;
4
4
  flex-direction: column;
@@ -1 +1 @@
1
- import{j as l}from"./liveblocks-dlvb-ucF.js";import{a as f}from"./sentry-DGJ961LO.js";import{j as U,u as B,h as T,g as v,N,k as j,l as $,n as L,o as h}from"./core-D85lL_9t.js";import{eM as O,M2 as A,LK as b,wT as w,wN as F,wR as I,wG as M,LM as W,wJ as q,wV as z,wU as C}from"./zeni-epic-state-De57_V18.js";import{m as P,z as k,B as V,a1 as G,bu as J,aa as _,bv as K}from"./index-eyGUyZ3T.js";import"./mui-C9WBrZQt.js";import{i as H}from"./ReimbursementApprovalRuleDetailScreen-mjO0EFcS.js";import Q from"./NotFoundScreen-CNrR5P_G.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]="92c86552-2b18-4ae4-97bb-c2f2cfdc1d67",e._sentryDebugIdIdentifier="sentry-dbid-92c86552-2b18-4ae4-97bb-c2f2cfdc1d67")}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(M(a))},onEditRuleClick:a=>{a!=null?(e(I(a)),t(`./${a}/edit`)):(e(I()),t("./new"))}}})(G(J)),Y=()=>{const e=U(),o=B(),t=T(),[p,a]=f.useState(!1),[u,s]=f.useState(!1),d=P(),n=v(i=>i.billPaySetupApproverViewState.fetchState),c=v(i=>O(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(N,{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 E=!!H(S.value);return{type:E?"attribute":"role",subType:S.value,userId:void 0,idType:void 0,isImplicitActor:!E}}),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(C(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(C(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(z())},onSaveRuleSuccess:()=>{t("../")}}})(K);function D(){const e=U(),o=T(),t=B(),{approvalRuleId:p}=$(),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(L,{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-Cqbf2YvG.js";import{a as f}from"./sentry-gLPXz4Yq.js";import{j as U,u as B,h as T,g as v,N,k as j,l as $,n as L,o as h}from"./core-DZE88rLA.js";import{eM as O,M2 as A,LK as b,wT as w,wN as F,wR as I,wG as M,LM as W,wJ as q,wV as z,wU as C}from"./zeni-epic-state-Cc2P4FPR.js";import{m as P,z as k,B as V,a1 as G,bu as J,aa as _,bv as K}from"./index-BET54Nt-.js";import"./mui-B4xUUoCx.js";import{i as H}from"./ReimbursementApprovalRuleDetailScreen-CnM97Nh_.js";import Q from"./NotFoundScreen-BM3DcBu4.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]="92c86552-2b18-4ae4-97bb-c2f2cfdc1d67",e._sentryDebugIdIdentifier="sentry-dbid-92c86552-2b18-4ae4-97bb-c2f2cfdc1d67")}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(M(a))},onEditRuleClick:a=>{a!=null?(e(I(a)),t(`./${a}/edit`)):(e(I()),t("./new"))}}})(G(J)),Y=()=>{const e=U(),o=B(),t=T(),[p,a]=f.useState(!1),[u,s]=f.useState(!1),d=P(),n=v(i=>i.billPaySetupApproverViewState.fetchState),c=v(i=>O(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(N,{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 E=!!H(S.value);return{type:E?"attribute":"role",subType:S.value,userId:void 0,idType:void 0,isImplicitActor:!E}}),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(C(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(C(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(z())},onSaveRuleSuccess:()=>{t("../")}}})(K);function D(){const e=U(),o=T(),t=B(),{approvalRuleId:p}=$(),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(L,{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-dlvb-ucF.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 S}from"./core-D85lL_9t.js";import{eM as Z,Lk as Me,bu as At,Gm as ra,bn as xt,bC as ue,Ll as Bt,wb as Et,xl as Ue,wK as ca,bm as je,Lm as da,Ln as pa,b$ as ua,Lo as ma,j8 as Dt,Lp as jt,Lq as Tt,xW as Oe,wq as Be,Lr as ba,v$ as it,Ls as ha,B6 as ga,w3 as ya,w9 as Pt,Lt as Ie,Lu as Ne,xm as ze,Lv as Sa,Lw as fa,xp as Ze,Lx as Ia,xC as va,Ly as Ft,x6 as ot,xb as ka,Lz as wa,LA as pe,LB as Lt,LC as Rt,LD as Vt,fG as Ca,wv as _e,ct as $t,LE as Aa,gy as xa,LF as Ba,LG as Ea,eT as Ut,eR as _t,LH as He,LI as Da,LJ as ja,J3 as We,LK as Ta,J4 as ie,J5 as qe,LL as Pa,LM as Fa,LN as La,xd as lt,xa as Ra,LO as Va,LP as $a,LQ as Ua,wY as _a,LR as Ga,LS as Ma,LT as Oa,cN as Gt,cJ as Mt,jj as Na,bI as za,bp as Ot,bJ as Nt,vh as Za,LU as Ha,AV as Wa,A$ as qa,rQ as Ja,xn as Ka,y1 as Qa,jw as fe,LV as Ya,LW as zt,j_ as Xa,jq as Zt,jL as Ht,jK as st,bB as be,bH as en,LX as tn,LY as ve,i1 as an,LZ as rt,L_ as nn,i5 as on,is as ln,yf as sn,L$ as rn,jT as cn,y5 as dn,M0 as ct,y9 as pn,ye as un,yb as mn,y3 as bn,M1 as Wt,wk as hn,M2 as gn,M3 as yn,fA as Sn,fz as fn,fy as In,jz as vn,jR as dt,k0 as kn,pn as wn,jI as Cn,y7 as An,ib as xn,k5 as Bn,M4 as En,i3 as Dn,pe as jn,M5 as Tn,x2 as Pn,bD as Fn,br as Ln,I2 as Rn,cL as Vn,cK as $n,cs as Un,cy as _n}from"./zeni-epic-state-De57_V18.js";import{m as me,z as R,j as ke,F as Je,a as oe,i as y,aI as Ee,B as ce,o as E,w as Te,d as j,b1 as Gn,p as z,Q as Ke,r as D,Z as we,b2 as pt,b3 as ut,b4 as Mn,af as On,A as Nn,aC as zn,x as qt,D as Qe,C as Ye,b5 as Zn,ao as Jt,b6 as Hn,H as Wn,f 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,v as ii,bg as oi,aZ as li,bh as si,bi as ri,a4 as ci}from"./index-eyGUyZ3T.js";import{n as V,S as di}from"./mui-C9WBrZQt.js";import{A as mt}from"./AddressScreen-BqbCkW9F.js";import{g as ne,a as Pe,i as Qt,V as Xe,b as et,c as pi,v as ui,d as mi,A as he,D as ge}from"./DomesticWireDetailScreen-BwBgY_jC.js";import{a as f}from"./sentry-DGJ961LO.js";import{u as tt}from"./useAskAiCfoHostNavButtonProps-D7VmZhkv.js";import{c as at}from"./useFetchSuggestedQuestionsWhenReady-vh4emZ7O.js";import{u as Yt}from"./useInitialThreadRequest-CdZgxQMw.js";import De from"./NotFoundScreen-CNrR5P_G.js";import{D as bi}from"./DrawerScreen-7RB3pd-L.js";import{M as Xt}from"./MobileAppDrawer-Cq6umKbp.js";import{F as ea}from"./FeaturePreviewScreen-CHkVgg1G.js";import{S as Le}from"./SetupPagesScreen-C7kgTCyu.js";import{B as hi}from"./BillPayApprovalRoutes-Bolmrdjm.js";import{FallBackRoute as gi}from"./ScreenRoutes-BQrRNAQd.js";import"./recharts-BYSqK3LX.js";import"./lottie-DGXsyyYr.js";import"./analytics-BAQwJULS.js";import"./plaid-BveLUCs7.js";import"./dnd-P1ekKsf6.js";import"./stripe-DMRn4zHo.js";import"./lexical-C7vBKQl2.js";import"./pdf-DebxFbW1.js";import"./utils-4E0JE-n2.js";import"./analyticsHelper-D9biWtDJ.js";import"./routePaths-Ckqdpqo6.js";import"./BusinessVerificationPageScreen-S9e9j7rw.js";import"./ReimbursementApprovalRuleDetailScreen-mjO0EFcS.js";import"./getLocaleForTenant-ClrmJsWr.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]="9c55a84f-b8d5-4059-81e4-207b66e32b5f",e._sentryDebugIdIdentifier="sentry-dbid-9c55a84f-b8d5-4059-81e4-207b66e32b5f")}catch{}})();const yi=Y(function(e,t){const l=Me(e,t.billId),n=R.getSignedInUser(),c=e.tenantState.currentTenantId,r={userId:n?.userId??"",sessionId:n?.zeniSessionId??"",tenantId:c??""},p=z(t.location.state?.pathnameStackToGoBack);let o=!0;p.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,u=!1;if(l?.billActivities.length>0){const{isApprovalorRejectBtnVisible:m,isMarkAsPaidBtnVisible:b}=da(l.billActivities,pa(t.currentTenant),n);d=m,u=b}const h=ua(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:u,hasZeniAssistAccess:t.hasZeniAssistAccess,analytics:j,showMarkAsPaidButtonToCreator:g,isZeniUser:i}},function(e,t){const{billId:l,currentTenant:n,location:c,navigate:r}=t,{tenantEmailDomain:p}=n;return{redirectToBillsScreen:()=>{const o=ne(p),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(ya(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(p,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(p);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(Oe(o?"paid":"pending_approval",o,s,l))},discardOutsideZeniPaymentData:()=>{e(jt({billId:l}))}}})(Gn);function Si(){const e=K(),t=re(),l=Q(),{billId:n}=te(),c=me(),r=R.getSignedInUser(),p=ke(),o=v(w=>Z(w)),s=v(w=>Me(w,n??"")),i=s.transactionDetails?.billPayInfo.stage.code==="draft"&&s.transactionDetails.isDeleted===!1,d=Yt(o?.companyId,{clearParams:s.fetchState==="Completed"&&!i}),{isAiCfoOpen:u,setIsAiCfoOpen:h}=Je(),{isAiCfoAccessEnabled:g,onAskAiCfoClick:m}=tt({isAiCfoOpen:u,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(y.isShowDeletedBillsFeatureEnabled),{isFeatureEnabled:U}=F(y.isBillPayCommentingEnabled),{isFeatureEnabled:B}=F(y.isBillPayDetectInsufficientFundsEnabled),{configValue:O}=x(Ee.zeniAssistConfig),W=ra(o),q=xt(o.userRole),J=A&&ue(p?.loggedInUserRoleMap),M=O.user_ids!=null&&r?.userId!=null&&O.user_ids.includes(r?.userId),{isFeatureEnabled:le}=F(y.isInternationalPaymentShaVsOurFeatureEnabled),{isFeatureEnabled:X}=F(y.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??"",$,M,!1)))},[T,s,n,t]),f.useEffect(()=>{k||s.fetchState!="Completed"||s.transactionDetails?.billPayInfo.stage.code=="paid"||(H(!0),t(Ue(!1,$,M,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(yi,{initialOpenThreadRequest:d??void 0,isShowDeletedBillsEnabled:$,location:l,navigate:e,isBillPayCommentingEnabled:U,isRealTimeApprovalEnabled:_,currentTenant:o,billId:n??"",isInternationalPaymentShaVsOurEnabled:le,hasZeniAssistAccess:M,isDetectInsufficientFundsEnabled:B,isAiCfoAccessEnabled:g,onAskAiCfoClick:m})]})}const ye=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,p=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:p,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,p=r.includes("bill/new")||r.includes("/edit"),o=we(),s=me(),i=R.getSignedInUser(),{useFeatureGate:d,useDynamicConfig:u}=oe(),{isFeatureEnabled:h}=d(y.isVendorRecommendationFeatureEnabled),{isFeatureEnabled:g}=d(y.isShowDeletedBillsFeatureEnabled),{isFeatureEnabled:m}=d(y.isDepositAccountsFeatureEnabled),{isFeatureEnabled:b}=d(y.billPaySetupShowInternationalPaymentByWise),{configValue:A}=u(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 O=B.fetchState,W=B.file,q=B.showAutofill;const J=v(w=>Me(w,n??""));p===!1&&(O=J.fetchState,W=J.transactionDetails?.attachments?.[0],q=!1);const M=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(()=>{O==="Not-Started"&&(p&&_?G(!1):!p&&k&&H(!1))},[n]),f.useEffect(()=>{k||n==null||p||(H(!0),t(Et(n,g,T,!1)),_||(G(!0),t(Ue(!1,g,T,b,n)))),p&&!_&&(G(!0),t(Ue(!1,g,T,b,n)))},[k,_,p,n,t]);const le={onOkClick:()=>{if(x(!1),!$)return;const w=W!=null?"replace":"upload";j?.trackInvoiceActionClick(M??"",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(M??"",w,i?.userEmail??"","no"),t(Sa({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(O==="Error"||J.fetchState==="Error")return a.jsx(De,{});if(O!="Completed")return n==null&&o!=="small"?a.jsx(pt,{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:M}),a.jsx($e,{windowSize:o,children:a.jsx(ut,{})})]})}):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(Mn,{}),a.jsx($e,{windowSize:o,children:a.jsx(ut,{})})]});{const w=B.billPayInfo!=null&&B.billPayInfo.stage.code==="pending_approval"?B.billPayInfo.billStatus.code:B.billStage;return a.jsx(pt,{fallback:X,children:a.jsxs(Re,{windowSize:o,children:[q&&o!=="small"?a.jsx(gt,{}):null,F?a.jsx(On,{titleComponent:a.jsx(xi,{children:ye.overwriteTitle}),descriptionComponent:a.jsx(Bi,{children:ye.overwriteDescription}),primaryButtonText:ye.buttons.yes,secondaryButtonText:ye.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(p,J,B),setShowConfirmationPopup:x,setPayload:U,showActionButtons:ki(p,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:`${ye.recurringBill.recurringCycle}
1
+ import{j as a}from"./liveblocks-Cqbf2YvG.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 S}from"./core-DZE88rLA.js";import{eM as Z,Lk as Me,bu as At,Gm as ra,bn as xt,bC as ue,Ll as Bt,wb as Et,xl as Ue,wK as ca,bm as je,Lm as da,Ln as pa,b$ as ua,Lo as ma,j8 as Dt,Lp as jt,Lq as Tt,xW as Oe,wq as Be,Lr as ba,v$ as it,Ls as ha,B6 as ga,w3 as ya,w9 as Pt,Lt as Ie,Lu as Ne,xm as ze,Lv as Sa,Lw as fa,xp as Ze,Lx as Ia,xC as va,Ly as Ft,x6 as ot,xb as ka,Lz as wa,LA as pe,LB as Lt,LC as Rt,LD as Vt,fG as Ca,wv as _e,ct as $t,LE as Aa,gy as xa,LF as Ba,LG as Ea,eT as Ut,eR as _t,LH as He,LI as Da,LJ as ja,J3 as We,LK as Ta,J4 as ie,J5 as qe,LL as Pa,LM as Fa,LN as La,xd as lt,xa as Ra,LO as Va,LP as $a,LQ as Ua,wY as _a,LR as Ga,LS as Ma,LT as Oa,cN as Gt,cJ as Mt,jj as Na,bI as za,bp as Ot,bJ as Nt,vh as Za,LU as Ha,AV as Wa,A$ as qa,rQ as Ja,xn as Ka,y1 as Qa,jw as fe,LV as Ya,LW as zt,j_ as Xa,jq as Zt,jL as Ht,jK as st,bB as be,bH as en,LX as tn,LY as ve,i1 as an,LZ as rt,L_ as nn,i5 as on,is as ln,yf as sn,L$ as rn,jT as cn,y5 as dn,M0 as ct,y9 as pn,ye as un,yb as mn,y3 as bn,M1 as Wt,wk as hn,M2 as gn,M3 as yn,fA as Sn,fz as fn,fy as In,jz as vn,jR as dt,k0 as kn,pn as wn,jI as Cn,y7 as An,ib as xn,k5 as Bn,M4 as En,i3 as Dn,pe as jn,M5 as Tn,x2 as Pn,bD as Fn,br as Ln,I2 as Rn,cL as Vn,cK as $n,cs as Un,cy as _n}from"./zeni-epic-state-Cc2P4FPR.js";import{m as me,z as R,j as ke,F as Je,a as oe,i as y,aI as Ee,B as ce,o as E,w as Te,d as j,b1 as Gn,p as z,Q as Ke,r as D,Z as we,b2 as pt,b3 as ut,b4 as Mn,af as On,A as Nn,aC as zn,x as qt,D as Qe,C as Ye,b5 as Zn,ao as Jt,b6 as Hn,H as Wn,f 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,v as ii,bg as oi,aZ as li,bh as si,bi as ri,a4 as ci}from"./index-BET54Nt-.js";import{n as V,S as di}from"./mui-B4xUUoCx.js";import{A as mt}from"./AddressScreen-tCLozkzY.js";import{g as ne,a as Pe,i as Qt,V as Xe,b as et,c as pi,v as ui,d as mi,A as he,D as ge}from"./DomesticWireDetailScreen-Cj8iAPXf.js";import{a as f}from"./sentry-gLPXz4Yq.js";import{u as tt}from"./useAskAiCfoHostNavButtonProps-CIwJkrUG.js";import{c as at}from"./useFetchSuggestedQuestionsWhenReady-CZP4Iues.js";import{u as Yt}from"./useInitialThreadRequest-DFJpueCY.js";import De from"./NotFoundScreen-BM3DcBu4.js";import{D as bi}from"./DrawerScreen-Dv_UzQOo.js";import{M as Xt}from"./MobileAppDrawer-D0-D1IIa.js";import{F as ea}from"./FeaturePreviewScreen-3Cs41rNa.js";import{S as Le}from"./SetupPagesScreen-B8Rno5B2.js";import{B as hi}from"./BillPayApprovalRoutes-BjYSk6ti.js";import{FallBackRoute as gi}from"./ScreenRoutes-DsynOrE_.js";import"./recharts-3_XOsuaw.js";import"./lottie-BMcMDJUW.js";import"./analytics-Cp5F-UjF.js";import"./plaid-G98kqTnM.js";import"./dnd-B4DEM2bW.js";import"./stripe-DMRn4zHo.js";import"./lexical-Bp_BNV6r.js";import"./pdf-DYKlsr3c.js";import"./utils-oW6HiHsc.js";import"./analyticsHelper-BTOyHFla.js";import"./routePaths-BNouI24c.js";import"./BusinessVerificationPageScreen-j2FAzNjV.js";import"./ReimbursementApprovalRuleDetailScreen-CnM97Nh_.js";import"./getLocaleForTenant-CPndpwIp.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]="9c55a84f-b8d5-4059-81e4-207b66e32b5f",e._sentryDebugIdIdentifier="sentry-dbid-9c55a84f-b8d5-4059-81e4-207b66e32b5f")}catch{}})();const yi=Y(function(e,t){const l=Me(e,t.billId),n=R.getSignedInUser(),c=e.tenantState.currentTenantId,r={userId:n?.userId??"",sessionId:n?.zeniSessionId??"",tenantId:c??""},p=z(t.location.state?.pathnameStackToGoBack);let o=!0;p.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,u=!1;if(l?.billActivities.length>0){const{isApprovalorRejectBtnVisible:m,isMarkAsPaidBtnVisible:b}=da(l.billActivities,pa(t.currentTenant),n);d=m,u=b}const h=ua(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:u,hasZeniAssistAccess:t.hasZeniAssistAccess,analytics:j,showMarkAsPaidButtonToCreator:g,isZeniUser:i}},function(e,t){const{billId:l,currentTenant:n,location:c,navigate:r}=t,{tenantEmailDomain:p}=n;return{redirectToBillsScreen:()=>{const o=ne(p),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(ya(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(p,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(p);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(Oe(o?"paid":"pending_approval",o,s,l))},discardOutsideZeniPaymentData:()=>{e(jt({billId:l}))}}})(Gn);function Si(){const e=K(),t=re(),l=Q(),{billId:n}=te(),c=me(),r=R.getSignedInUser(),p=ke(),o=v(w=>Z(w)),s=v(w=>Me(w,n??"")),i=s.transactionDetails?.billPayInfo.stage.code==="draft"&&s.transactionDetails.isDeleted===!1,d=Yt(o?.companyId,{clearParams:s.fetchState==="Completed"&&!i}),{isAiCfoOpen:u,setIsAiCfoOpen:h}=Je(),{isAiCfoAccessEnabled:g,onAskAiCfoClick:m}=tt({isAiCfoOpen:u,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(y.isShowDeletedBillsFeatureEnabled),{isFeatureEnabled:U}=F(y.isBillPayCommentingEnabled),{isFeatureEnabled:B}=F(y.isBillPayDetectInsufficientFundsEnabled),{configValue:O}=x(Ee.zeniAssistConfig),W=ra(o),q=xt(o.userRole),J=A&&ue(p?.loggedInUserRoleMap),M=O.user_ids!=null&&r?.userId!=null&&O.user_ids.includes(r?.userId),{isFeatureEnabled:le}=F(y.isInternationalPaymentShaVsOurFeatureEnabled),{isFeatureEnabled:X}=F(y.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??"",$,M,!1)))},[T,s,n,t]),f.useEffect(()=>{k||s.fetchState!="Completed"||s.transactionDetails?.billPayInfo.stage.code=="paid"||(H(!0),t(Ue(!1,$,M,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(yi,{initialOpenThreadRequest:d??void 0,isShowDeletedBillsEnabled:$,location:l,navigate:e,isBillPayCommentingEnabled:U,isRealTimeApprovalEnabled:_,currentTenant:o,billId:n??"",isInternationalPaymentShaVsOurEnabled:le,hasZeniAssistAccess:M,isDetectInsufficientFundsEnabled:B,isAiCfoAccessEnabled:g,onAskAiCfoClick:m})]})}const ye=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,p=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:p,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,p=r.includes("bill/new")||r.includes("/edit"),o=we(),s=me(),i=R.getSignedInUser(),{useFeatureGate:d,useDynamicConfig:u}=oe(),{isFeatureEnabled:h}=d(y.isVendorRecommendationFeatureEnabled),{isFeatureEnabled:g}=d(y.isShowDeletedBillsFeatureEnabled),{isFeatureEnabled:m}=d(y.isDepositAccountsFeatureEnabled),{isFeatureEnabled:b}=d(y.billPaySetupShowInternationalPaymentByWise),{configValue:A}=u(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 O=B.fetchState,W=B.file,q=B.showAutofill;const J=v(w=>Me(w,n??""));p===!1&&(O=J.fetchState,W=J.transactionDetails?.attachments?.[0],q=!1);const M=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(()=>{O==="Not-Started"&&(p&&_?G(!1):!p&&k&&H(!1))},[n]),f.useEffect(()=>{k||n==null||p||(H(!0),t(Et(n,g,T,!1)),_||(G(!0),t(Ue(!1,g,T,b,n)))),p&&!_&&(G(!0),t(Ue(!1,g,T,b,n)))},[k,_,p,n,t]);const le={onOkClick:()=>{if(x(!1),!$)return;const w=W!=null?"replace":"upload";j?.trackInvoiceActionClick(M??"",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(M??"",w,i?.userEmail??"","no"),t(Sa({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(O==="Error"||J.fetchState==="Error")return a.jsx(De,{});if(O!="Completed")return n==null&&o!=="small"?a.jsx(pt,{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:M}),a.jsx($e,{windowSize:o,children:a.jsx(ut,{})})]})}):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(Mn,{}),a.jsx($e,{windowSize:o,children:a.jsx(ut,{})})]});{const w=B.billPayInfo!=null&&B.billPayInfo.stage.code==="pending_approval"?B.billPayInfo.billStatus.code:B.billStage;return a.jsx(pt,{fallback:X,children:a.jsxs(Re,{windowSize:o,children:[q&&o!=="small"?a.jsx(gt,{}):null,F?a.jsx(On,{titleComponent:a.jsx(xi,{children:ye.overwriteTitle}),descriptionComponent:a.jsx(Bi,{children:ye.overwriteDescription}),primaryButtonText:ye.buttons.yes,secondaryButtonText:ye.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(p,J,B),setShowConfirmationPopup:x,setPayload:U,showActionButtons:ki(p,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:`${ye.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-dlvb-ucF.js";import{a as V}from"./sentry-DGJ961LO.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-D85lL_9t.js";import{j as ce,a as ue,aI as de,z as M,w as pe,d as B,aa as x,f as z,bq as le,ao as me,r as E,ap as R}from"./index-eyGUyZ3T.js";import{LS as fe,eM as G,rf as ye,Gq as Se,wY as ge,zF as Ie,Cc as be,CR as he,DK as De,Md as Oe,Me as Te,Mf as ke,Mg as Ce,Mh as Ve,IM as we,Lf as Ae,IY as Ne,jQ as _e,fA as Fe,fz as ve,fy as xe,pn as ze,pe as Me,pb as Be,jI as Ee,ro as Re,rm as L,bB as P,rA as j,cr as Le}from"./zeni-epic-state-De57_V18.js";import{n as Pe}from"./mui-C9WBrZQt.js";import{c as U}from"./routePaths-Ckqdpqo6.js";import{M as je}from"./MobileAppDrawer-Cq6umKbp.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]="e9cb93e5-b5e0-43ad-b222-ae0b7b073672",e._sentryDebugIdIdentifier="sentry-dbid-e9cb93e5-b5e0-43ad-b222-ae0b7b073672")}catch{}})();const Ue=Pe.div`
1
+ import{j as k}from"./liveblocks-Cqbf2YvG.js";import{a as V}from"./sentry-gLPXz4Yq.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-DZE88rLA.js";import{j as ce,a as ue,aI as de,z as M,w as pe,d as B,aa as x,f as z,bq as le,ao as me,r as E,ap as R}from"./index-BET54Nt-.js";import{LS as fe,eM as G,rf as ye,Gq as Se,wY as ge,zF as Ie,Cc as be,CR as he,DK as De,Md as Oe,Me as Te,Mf as ke,Mg as Ce,Mh as Ve,IM as we,Lf as Ae,IY as Ne,jQ as _e,fA as Fe,fz as ve,fy as xe,pn as ze,pe as Me,pb as Be,jI as Ee,ro as Re,rm as L,bB as P,rA as j,cr as Le}from"./zeni-epic-state-Cc2P4FPR.js";import{n as Pe}from"./mui-B4xUUoCx.js";import{c as U}from"./routePaths-BNouI24c.js";import{M as je}from"./MobileAppDrawer-D0-D1IIa.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]="e9cb93e5-b5e0-43ad-b222-ae0b7b073672",e._sentryDebugIdIdentifier="sentry-dbid-e9cb93e5-b5e0-43ad-b222-ae0b7b073672")}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-dlvb-ucF.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 Jt,o as te}from"./core-D85lL_9t.js";import{eM as ie,br as Be,NJ as _a,eR as Se,eS as Ie,eT as Ae,fK as Me,co as ze,NK as $e,NL as $a,su as Sa,jg as Ia,NM as Aa,gy as ca,yY as aa,y_ as Ga,y$ as Ya,j6 as Ct,NN as Ge,yM as pt,NO as Qt,NP as Xt,yP as wa,NQ as en,Ma as Pa,qG as ht,yV as Za,gJ as an,NR as ft,NS as Ye,bp as tn,NT as nn,fA as Ta,fz as Fa,zt as rn,fy as va,LS as sn,NU as gt,cN as bt,cJ as on,M9 as ua,A3 as cn,NV as rt,zF as xa,NW as yt,A4 as dn,MA as ln,A5 as un,A$ as mn,rQ as Cn,AV as pn,ze as St,z7 as hn,NX as fn,fM as gn,zn as It,zr as At,fL as bn,NY as yn,zR as Et,NZ as Sn,N_ as In,N$ as An,zp as kt,za as Dt,yS as _t,zj as wt,zh as Pt,zl as En,yZ as st,O0 as Tt,O1 as La,zC as Ea,IR as Ft,cK as Ka,O2 as kn,O3 as Dn,O4 as _n,O5 as wn,zz as Ha,zY as Pn,zU as Tn,zv as Fn,zW as vn,zM as xn,zO as Ln,O6 as vt,A2 as xt,Gm as Bn,O7 as On,O8 as Rn,O9 as Un,Oa as Lt,Ob as Nn,Ap as jn,zE as Bt,zy as da,zD as Vn,Oc as Hn,Od as Mn,yJ as zn,Oe as Ot,Of as Rt,Og as $n,yL as Gn,yK as ot,Oh as Yn,Oi as Zn,Oj as Kn,IN as Wn,Ok as Wa,Ol as qn,vk as Ut,jQ as Jn,gz as Qn,Au as Xn,Om as Nt,On as er,Av as ar,Oo as tr,db as nr,so as rr,Ak as sr,Ae as Le,bu as or,bC as ir,ct as cr,bD as dr,I2 as lr}from"./zeni-epic-state-De57_V18.js";import{z as X,j as Re,a as oe,i as Z,B as Ze,bU as Ba,c3 as ur,p as ve,c4 as mr,c5 as Cr,Z as ma,aI as Fe,r as be,bb as qa,c6 as pr,x as Ca,h as Oa,m as Ja,d as J,D as Qa,c7 as hr,F as jt,al as Xa,bn as Xe,c8 as Ma,c9 as fr,w as et,a1 as gr,ca as br,ao as Vt,Q as za,H as Ht,f 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,v as _r,cj as wr,ck as Pr,cl as Tr,cm as Fr,a4 as vr}from"./index-eyGUyZ3T.js";import{n as _e,D as zt,S as xr}from"./mui-C9WBrZQt.js";import{a as c}from"./sentry-DGJ961LO.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 Yt,m as Or,n as Zt,p as Rr,S as it}from"./SetupPagesScreen-C7kgTCyu.js";import Ra from"./NotFoundScreen-CNrR5P_G.js";import{M as ha}from"./MobileAppDrawer-Cq6umKbp.js";import{u as Kt}from"./useAskAiCfoHostNavButtonProps-D7VmZhkv.js";import{c as Wt}from"./useFetchSuggestedQuestionsWhenReady-vh4emZ7O.js";import{v as ct}from"./utils-4E0JE-n2.js";import{t as Ur}from"./AddressScreen-BqbCkW9F.js";import"./recharts-BYSqK3LX.js";import"./lottie-DGXsyyYr.js";import"./analytics-BAQwJULS.js";import"./plaid-BveLUCs7.js";import"./dnd-P1ekKsf6.js";import"./stripe-DMRn4zHo.js";import"./lexical-C7vBKQl2.js";import"./pdf-DebxFbW1.js";import"./analyticsHelper-D9biWtDJ.js";import"./routePaths-Ckqdpqo6.js";import"./BusinessVerificationPageScreen-S9e9j7rw.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]="307a5ef7-480f-4804-8dac-be84621aca39",e._sentryDebugIdIdentifier="sentry-dbid-307a5ef7-480f-4804-8dac-be84621aca39")}catch{}})();function Nr(){const e=ue(),{cardId:t}=la(),a=me(),r=X.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(Z.isChargeCardFeatureEnabled),f=!!n.companyChargeCardInfo?.info?.isChargeCardEnabled,{isFeatureEnabled:B}=C(Z.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),Y=R?.accountingClassIDs[0],E=S(G=>Y!=null?Ia(G.classState,{classId:Y,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(Ya()),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(Ze,{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=X.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=X.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=>Xt(E,n)),l=g.chargeCard,w=S(E=>E.chargeCardConfigState.fetchState),{useFeatureGate:O}=oe(),{isFeatureEnabled:N}=O(Z.isChargeCardFeatureEnabled),{isFeatureEnabled:T}=O(Z.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=X.getZeniOtpTokenForCardHolder(n),$=S(E=>ht(E.userState,v.userId)),R=()=>{l?.status?.code!=="active"&&a(Za(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 Y=E=>{B(E)};if(w!=="Completed"||l==null)return s.jsx(Ze,{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(Yr,{children:[s.jsx(ha,{isAppContentDrawerOpen:f,handleDrawerToggle:Y}),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:()=>{Y(!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=Ye(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&&X.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-Cqbf2YvG.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 Jt,o as te}from"./core-DZE88rLA.js";import{eM as ie,br as Be,NJ as _a,eR as Se,eS as Ie,eT as Ae,fK as Me,co as ze,NK as $e,NL as $a,su as Sa,jg as Ia,NM as Aa,gy as ca,yY as aa,y_ as Ga,y$ as Ya,j6 as Ct,NN as Ge,yM as pt,NO as Qt,NP as Xt,yP as wa,NQ as en,Ma as Pa,qG as ht,yV as Za,gJ as an,NR as ft,NS as Ye,bp as tn,NT as nn,fA as Ta,fz as Fa,zt as rn,fy as va,LS as sn,NU as gt,cN as bt,cJ as on,M9 as ua,A3 as cn,NV as rt,zF as xa,NW as yt,A4 as dn,MA as ln,A5 as un,A$ as mn,rQ as Cn,AV as pn,ze as St,z7 as hn,NX as fn,fM as gn,zn as It,zr as At,fL as bn,NY as yn,zR as Et,NZ as Sn,N_ as In,N$ as An,zp as kt,za as Dt,yS as _t,zj as wt,zh as Pt,zl as En,yZ as st,O0 as Tt,O1 as La,zC as Ea,IR as Ft,cK as Ka,O2 as kn,O3 as Dn,O4 as _n,O5 as wn,zz as Ha,zY as Pn,zU as Tn,zv as Fn,zW as vn,zM as xn,zO as Ln,O6 as vt,A2 as xt,Gm as Bn,O7 as On,O8 as Rn,O9 as Un,Oa as Lt,Ob as Nn,Ap as jn,zE as Bt,zy as da,zD as Vn,Oc as Hn,Od as Mn,yJ as zn,Oe as Ot,Of as Rt,Og as $n,yL as Gn,yK as ot,Oh as Yn,Oi as Zn,Oj as Kn,IN as Wn,Ok as Wa,Ol as qn,vk as Ut,jQ as Jn,gz as Qn,Au as Xn,Om as Nt,On as er,Av as ar,Oo as tr,db as nr,so as rr,Ak as sr,Ae as Le,bu as or,bC as ir,ct as cr,bD as dr,I2 as lr}from"./zeni-epic-state-Cc2P4FPR.js";import{z as X,j as Re,a as oe,i as Z,B as Ze,bU as Ba,c3 as ur,p as ve,c4 as mr,c5 as Cr,Z as ma,aI as Fe,r as be,bb as qa,c6 as pr,x as Ca,h as Oa,m as Ja,d as J,D as Qa,c7 as hr,F as jt,al as Xa,bn as Xe,c8 as Ma,c9 as fr,w as et,a1 as gr,ca as br,ao as Vt,Q as za,H as Ht,f 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,v as _r,cj as wr,ck as Pr,cl as Tr,cm as Fr,a4 as vr}from"./index-BET54Nt-.js";import{n as _e,D as zt,S as xr}from"./mui-B4xUUoCx.js";import{a as c}from"./sentry-gLPXz4Yq.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 Yt,m as Or,n as Zt,p as Rr,S as it}from"./SetupPagesScreen-B8Rno5B2.js";import Ra from"./NotFoundScreen-BM3DcBu4.js";import{M as ha}from"./MobileAppDrawer-D0-D1IIa.js";import{u as Kt}from"./useAskAiCfoHostNavButtonProps-CIwJkrUG.js";import{c as Wt}from"./useFetchSuggestedQuestionsWhenReady-CZP4Iues.js";import{v as ct}from"./utils-oW6HiHsc.js";import{t as Ur}from"./AddressScreen-tCLozkzY.js";import"./recharts-3_XOsuaw.js";import"./lottie-BMcMDJUW.js";import"./analytics-Cp5F-UjF.js";import"./plaid-G98kqTnM.js";import"./dnd-B4DEM2bW.js";import"./stripe-DMRn4zHo.js";import"./lexical-Bp_BNV6r.js";import"./pdf-DYKlsr3c.js";import"./analyticsHelper-BTOyHFla.js";import"./routePaths-BNouI24c.js";import"./BusinessVerificationPageScreen-j2FAzNjV.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]="307a5ef7-480f-4804-8dac-be84621aca39",e._sentryDebugIdIdentifier="sentry-dbid-307a5ef7-480f-4804-8dac-be84621aca39")}catch{}})();function Nr(){const e=ue(),{cardId:t}=la(),a=me(),r=X.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(Z.isChargeCardFeatureEnabled),f=!!n.companyChargeCardInfo?.info?.isChargeCardEnabled,{isFeatureEnabled:B}=C(Z.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),Y=R?.accountingClassIDs[0],E=S(G=>Y!=null?Ia(G.classState,{classId:Y,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(Ya()),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(Ze,{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=X.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=X.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=>Xt(E,n)),l=g.chargeCard,w=S(E=>E.chargeCardConfigState.fetchState),{useFeatureGate:O}=oe(),{isFeatureEnabled:N}=O(Z.isChargeCardFeatureEnabled),{isFeatureEnabled:T}=O(Z.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=X.getZeniOtpTokenForCardHolder(n),$=S(E=>ht(E.userState,v.userId)),R=()=>{l?.status?.code!=="active"&&a(Za(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 Y=E=>{B(E)};if(w!=="Completed"||l==null)return s.jsx(Ze,{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(Yr,{children:[s.jsx(ha,{isAppContentDrawerOpen:f,handleDrawerToggle:Y}),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:()=>{Y(!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=Ye(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&&X.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-dlvb-ucF.js";import{a as g}from"./sentry-DGJ961LO.js";import{j as w,h as k,u as x,l as T,g as O,k as E}from"./core-D85lL_9t.js";import{z as N,aZ as F,w as P,d as L,f as V,aa as b,a_ as j,ao as A,ap as M,r as U}from"./index-eyGUyZ3T.js";import{eM as D,fC as B,rf as _,fx as R,b$ as z,Lf as G,bm as Y,pn as Z,pb as $,jI as H,lc as S,Lg as q,bB as J,cr as C,lk as K,ln as Q}from"./zeni-epic-state-De57_V18.js";import"./mui-C9WBrZQt.js";import{c as W}from"./routePaths-Ckqdpqo6.js";import{M as X}from"./MobileAppDrawer-Cq6umKbp.js";(function(){try{var n=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new n.Error().stack;t&&(n._sentryDebugIds=n._sentryDebugIds||{},n._sentryDebugIds[t]="f4151a35-7fc0-4b31-8b41-efd11a691b9b",n._sentryDebugIdIdentifier="sentry-dbid-f4151a35-7fc0-4b31-8b41-efd11a691b9b")}catch{}})();const ee=E(function(n){const t=R(n),i=N.getSignedInUser(),l=D(n),c=l.tenantId,p={userId:i?.userId??"",sessionId:i?.zeniSessionId??"",tenantId:c??""},f=z(l?.userRole??[])&&t.localData.updateStatus.fetchState!=="In-Progress"?void 0:"readonly",e=G(n.companyConfigState),a=n.countryListState?.byCountryListCode?.nationalityCountryList?.countries??[];return{isCompanyVerified:t.companyView?.company?.company?.companyBillPayInfo?.companyVerificationStatus?.code==="verified",companyPassportView:t,allIndustries:e.companyIndustries??[],allNationalityCountries:a,isDisabled:f,authParams:p,filesEndPoint:`${A.fileMicroServiceBaseUrl}`,isZeniUser:Y(i)}},function(n,t){const{companyId:i,currentTenant:l,navigate:c,location:p}=t,{tenantEmailDomain:f}=l;return{onScheduleClick:e=>{let a=e.href;a.includes("http")||(a="https://".concat(a)),window.open(a,"_blank")},onSaveAll:()=>{n(Q())},onAddressClick:e=>{const a=W(f,e),o=U(p.state?.pathnameStackToGoBack,p.pathname);c(a,{state:{pathnameStackToGoBack:o}})},onResetClick:()=>{n(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?C(u):void 0,meetingLink:y!=""&&y!=null?C(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:M(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]}};n(S({companyDetails:v}))},onPrimaryContactDetailsUpdated:e=>{n(S({primaryContact:{userId:e.userId,email:e.email.trim(),firstName:e.name.firstName,lastName:e.name.lastName}}))},onNewCompanyOfficerAdded:e=>{n(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=>{n(q(e))},onCompanyOfficerUpdated:e=>{n(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=>{n(H({files:e}))},onDeleteFile:e=>{n($(e))},onEditFileName:(e,a)=>{n(Z(e,a.split(".")[0]))}}})(j);function de(){const n=w(),t=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??N.getSignedInUserTenant(l)?.companyId;if(N.getSignedInUser()==null)throw Error("Can't access company details page without signing in...");g.useEffect(()=>{c||a!=="Not-Started"||d==null||(p(!0),t(B(d)))},[c,a,d,t]),g.useEffect(()=>{o==="Not-Started"&&t(_())},[o,t]);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:()=>n("../",{replace:!0}),onReload:()=>window.location.reload()}):m.jsxs(m.Fragment,{children:[m.jsx(P,{analytics:L,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:n,location:i,isLoading:y,currentTenant:r,isSettings:b(i),onClickMenuIcon:()=>{u(!0)}})]})}export{de as C};
1
+ import{j as m}from"./liveblocks-Cqbf2YvG.js";import{a as g}from"./sentry-gLPXz4Yq.js";import{j as w,h as k,u as x,l as T,g as O,k as E}from"./core-DZE88rLA.js";import{z as N,aZ as F,w as P,d as L,f as V,aa as b,a_ as j,ao as A,ap as M,r as U}from"./index-BET54Nt-.js";import{eM as D,fC as B,rf as _,fx as R,b$ as z,Lf as G,bm as Y,pn as Z,pb as $,jI as H,lc as S,Lg as q,bB as J,cr as C,lk as K,ln as Q}from"./zeni-epic-state-Cc2P4FPR.js";import"./mui-B4xUUoCx.js";import{c as W}from"./routePaths-BNouI24c.js";import{M as X}from"./MobileAppDrawer-D0-D1IIa.js";(function(){try{var n=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new n.Error().stack;t&&(n._sentryDebugIds=n._sentryDebugIds||{},n._sentryDebugIds[t]="f4151a35-7fc0-4b31-8b41-efd11a691b9b",n._sentryDebugIdIdentifier="sentry-dbid-f4151a35-7fc0-4b31-8b41-efd11a691b9b")}catch{}})();const ee=E(function(n){const t=R(n),i=N.getSignedInUser(),l=D(n),c=l.tenantId,p={userId:i?.userId??"",sessionId:i?.zeniSessionId??"",tenantId:c??""},f=z(l?.userRole??[])&&t.localData.updateStatus.fetchState!=="In-Progress"?void 0:"readonly",e=G(n.companyConfigState),a=n.countryListState?.byCountryListCode?.nationalityCountryList?.countries??[];return{isCompanyVerified:t.companyView?.company?.company?.companyBillPayInfo?.companyVerificationStatus?.code==="verified",companyPassportView:t,allIndustries:e.companyIndustries??[],allNationalityCountries:a,isDisabled:f,authParams:p,filesEndPoint:`${A.fileMicroServiceBaseUrl}`,isZeniUser:Y(i)}},function(n,t){const{companyId:i,currentTenant:l,navigate:c,location:p}=t,{tenantEmailDomain:f}=l;return{onScheduleClick:e=>{let a=e.href;a.includes("http")||(a="https://".concat(a)),window.open(a,"_blank")},onSaveAll:()=>{n(Q())},onAddressClick:e=>{const a=W(f,e),o=U(p.state?.pathnameStackToGoBack,p.pathname);c(a,{state:{pathnameStackToGoBack:o}})},onResetClick:()=>{n(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?C(u):void 0,meetingLink:y!=""&&y!=null?C(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:M(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]}};n(S({companyDetails:v}))},onPrimaryContactDetailsUpdated:e=>{n(S({primaryContact:{userId:e.userId,email:e.email.trim(),firstName:e.name.firstName,lastName:e.name.lastName}}))},onNewCompanyOfficerAdded:e=>{n(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=>{n(q(e))},onCompanyOfficerUpdated:e=>{n(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=>{n(H({files:e}))},onDeleteFile:e=>{n($(e))},onEditFileName:(e,a)=>{n(Z(e,a.split(".")[0]))}}})(j);function de(){const n=w(),t=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??N.getSignedInUserTenant(l)?.companyId;if(N.getSignedInUser()==null)throw Error("Can't access company details page without signing in...");g.useEffect(()=>{c||a!=="Not-Started"||d==null||(p(!0),t(B(d)))},[c,a,d,t]),g.useEffect(()=>{o==="Not-Started"&&t(_())},[o,t]);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:()=>n("../",{replace:!0}),onReload:()=>window.location.reload()}):m.jsxs(m.Fragment,{children:[m.jsx(P,{analytics:L,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:n,location:i,isLoading:y,currentTenant:r,isSettings:b(i),onClickMenuIcon:()=>{u(!0)}})]})}export{de as C};
@@ -1,4 +1,4 @@
1
- import{j as C}from"./liveblocks-dlvb-ucF.js";import{a}from"./sentry-DGJ961LO.js";import{h as D,u as v,g as u,N as w}from"./core-D85lL_9t.js";import{H_ as _,eM as A,fj as O,m3 as j,fJ as h,fi as U,eN as L,I6 as F}from"./zeni-epic-state-De57_V18.js";import{u as H,z as p,L as g,D as $,o as k}from"./index-eyGUyZ3T.js";import{n as z}from"./mui-C9WBrZQt.js";import{t as R}from"./getLocaleForTenant-ClrmJsWr.js";import{g as P,Q as G}from"./QBOConnectionScreen-mxlQ58sF.js";import"./recharts-BYSqK3LX.js";import"./lottie-DGXsyyYr.js";import"./analytics-BAQwJULS.js";import"./plaid-BveLUCs7.js";import"./dnd-P1ekKsf6.js";import"./stripe-DMRn4zHo.js";import"./lexical-C7vBKQl2.js";import"./pdf-DebxFbW1.js";import"./utils-4E0JE-n2.js";import"./empty-vrCkOfCr.js";import"./pdf-lib-VVDJ8cIK.js";import"./index-BUCtSz30.js";import"./url-DoymNVR-.js";import"./index-BPbXNCzw.js";import"./decodeURIComponentSafe-ByB9WhLS.js";(function(){try{var t=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},i=new t.Error().stack;i&&(t._sentryDebugIds=t._sentryDebugIds||{},t._sentryDebugIds[i]="90c8535a-7421-4913-8938-db06dfde49a0",t._sentryDebugIdIdentifier="sentry-dbid-90c8535a-7421-4913-8938-db06dfde49a0")}catch{}})();const J=z.div`
1
+ import{j as C}from"./liveblocks-Cqbf2YvG.js";import{a}from"./sentry-gLPXz4Yq.js";import{h as D,u as v,g as u,N as w}from"./core-DZE88rLA.js";import{H_ as _,eM as A,fj as O,m3 as j,fJ as h,fi as U,eN as L,I6 as F}from"./zeni-epic-state-Cc2P4FPR.js";import{u as H,z as p,L as g,D as $,o as k}from"./index-BET54Nt-.js";import{n as z}from"./mui-B4xUUoCx.js";import{t as R}from"./getLocaleForTenant-CPndpwIp.js";import{g as P,Q as G}from"./QBOConnectionScreen-CMvaIZxf.js";import"./recharts-3_XOsuaw.js";import"./lottie-BMcMDJUW.js";import"./analytics-Cp5F-UjF.js";import"./plaid-G98kqTnM.js";import"./dnd-B4DEM2bW.js";import"./stripe-DMRn4zHo.js";import"./lexical-Bp_BNV6r.js";import"./pdf-DYKlsr3c.js";import"./utils-oW6HiHsc.js";import"./empty-DTOnM0RR.js";import"./pdf-lib-vymaIDnW.js";import"./index-j9ZiGcsv.js";import"./url-DMg8GQjt.js";import"./index-BWIeQAsg.js";import"./decodeURIComponentSafe--utjO_hD.js";(function(){try{var t=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},i=new t.Error().stack;i&&(t._sentryDebugIds=t._sentryDebugIds||{},t._sentryDebugIds[i]="90c8535a-7421-4913-8938-db06dfde49a0",t._sentryDebugIdIdentifier="sentry-dbid-90c8535a-7421-4913-8938-db06dfde49a0")}catch{}})();const J=z.div`
2
2
  display: flex;
3
3
  flex: 1 1 auto;
4
4
  flex-direction: row;
@@ -0,0 +1 @@
1
+ import{j as i}from"./liveblocks-Cqbf2YvG.js";import{z as m}from"./index-BET54Nt-.js";import{g as n}from"./QBOConnectionScreen-CMvaIZxf.js";import"./sentry-gLPXz4Yq.js";import{u as p,N as a}from"./core-DZE88rLA.js";import"./zeni-epic-state-Cc2P4FPR.js";import"./recharts-3_XOsuaw.js";import"./mui-B4xUUoCx.js";import"./lottie-BMcMDJUW.js";import"./analytics-Cp5F-UjF.js";import"./plaid-G98kqTnM.js";import"./dnd-B4DEM2bW.js";import"./stripe-DMRn4zHo.js";import"./lexical-Bp_BNV6r.js";import"./pdf-DYKlsr3c.js";import"./utils-oW6HiHsc.js";import"./empty-DTOnM0RR.js";import"./pdf-lib-vymaIDnW.js";import"./index-j9ZiGcsv.js";import"./url-DMg8GQjt.js";import"./index-BWIeQAsg.js";import"./decodeURIComponentSafe--utjO_hD.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-dlvb-ucF.js";import{t as $e,A as Ce}from"./AddressScreen-BqbCkW9F.js";import Me from"./NotFoundScreen-CNrR5P_G.js";import{a as g}from"./sentry-DGJ961LO.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 ze,n as Ke,o as z}from"./core-D85lL_9t.js";import{v as de,j as le,z as B,a as ue,m as Qe,i as _,r as V,w as W,d as N,B as je,f as Y,ak as qe,Z as Ze,al as Ie,h as te,am as He,an as ke,o as We,ao as Xe,ap as Ee,aq as Ye}from"./index-eyGUyZ3T.js";import{bm as Je,eM as ee,fb as et,eT as pe,eR as me,bu as tt,m1 as at,f7 as nt,bL as ot,iM as ae,iP as ve,IK as st,bQ as it,b$ as ge,rt as fe,re as rt,IW as J,ru as _e,Gq as ct,jQ as Ue,IX as Ve,IY as dt,IZ as lt,I_ as ut,iK as pt,iN as mt,rg as Be,rs as gt,bB as Te,cr as ft,rG as xe,pn as ht,pb as yt,jI as St,fA as bt,fz as Ct,fy as It,I$ as kt,r8 as Et,rH as Tt,rK as xt,rN as Ot,rT as Pt,cR as At}from"./zeni-epic-state-De57_V18.js";import{n as he}from"./mui-C9WBrZQt.js";import{g as Dt,h as Ft,q as ne}from"./QBOConnectionScreen-mxlQ58sF.js";import"./recharts-BYSqK3LX.js";import"./lottie-DGXsyyYr.js";import"./analytics-BAQwJULS.js";import"./plaid-BveLUCs7.js";import"./dnd-P1ekKsf6.js";import"./stripe-DMRn4zHo.js";import"./lexical-C7vBKQl2.js";import"./pdf-DebxFbW1.js";import"./utils-4E0JE-n2.js";import"./empty-vrCkOfCr.js";import"./pdf-lib-VVDJ8cIK.js";import"./index-BUCtSz30.js";import"./url-DoymNVR-.js";import"./index-BPbXNCzw.js";import"./decodeURIComponentSafe-ByB9WhLS.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]="18425397-fc50-4e96-9ef5-a69f049877cd",t._sentryDebugIdIdentifier="sentry-dbid-18425397-fc50-4e96-9ef5-a69f049877cd")}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"}})}}})(qe),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=Je(i),{useFeatureGate:m}=ue(),k=Qe(),{isFeatureEnabled:T}=m(_.isApAgingFeatureEnabled),{isFeatureEnabled:x}=m(_.isArAgingFeatureEnabled),{isFeatureEnabled:I}=m(_.isDepositAccountsFeatureEnabled),{isFeatureEnabled:h}=m(_.isReferralFeatureEnabled),{isFeatureEnabled:U}=m(_.isExpenseAutomationEnabled),{isFeatureEnabled:C}=m(_.isExpenseAutomationEnabledV2),{isFeatureEnabled:F}=m(_.isDebitCardFeatureEnabled),$=C||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=[],q=b?.resources?.find(l=>l.resource==="/reports/top_expenses")==null,M=b?.resources?.find(l=>l.resource==="/reports/task_card")==null,K=c?.userRole!=null&&tt(c?.userRole),v=b?.resources?.find(l=>l.resource==="/bills")==null&&!K,Q=b?.resources?.find(l=>l.resource==="/reimbursements")==null;if(q===!1&&A.push("top_expenses"),M===!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"),I===!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(Y.Event.onboardingDashboardActivation))(l)}),a.jsx(wt,{navigate:t,location:o,themeState:u,signedInUser:i,isApAgingFeatureEnabled:T,isArAgingFeatureEnabled:x,shouldFetchZeniAccountsPromoCard:I,shouldFetchRewardsPlanCard:h,isExpenseAutomationEnabledForUser:$,isExpenseAutomationFeatureEnabledV2:C,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-Cqbf2YvG.js";import{t as $e,A as Ce}from"./AddressScreen-tCLozkzY.js";import Me from"./NotFoundScreen-BM3DcBu4.js";import{a as g}from"./sentry-gLPXz4Yq.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 ze,n as Ke,o as z}from"./core-DZE88rLA.js";import{v as de,j as le,z as B,a as ue,m as Qe,i as _,r as V,w as W,d as N,B as je,f as Y,ak as qe,Z as Ze,al as Ie,h as te,am as He,an as ke,o as We,ao as Xe,ap as Ee,aq as Ye}from"./index-BET54Nt-.js";import{bm as Je,eM as ee,fb as et,eT as pe,eR as me,bu as tt,m1 as at,f7 as nt,bL as ot,iM as ae,iP as ve,IK as st,bQ as it,b$ as ge,rt as fe,re as rt,IW as J,ru as _e,Gq as ct,jQ as Ue,IX as Ve,IY as dt,IZ as lt,I_ as ut,iK as pt,iN as mt,rg as Be,rs as gt,bB as Te,cr as ft,rG as xe,pn as ht,pb as yt,jI as St,fA as bt,fz as Ct,fy as It,I$ as kt,r8 as Et,rH as Tt,rK as xt,rN as Ot,rT as Pt,cR as At}from"./zeni-epic-state-Cc2P4FPR.js";import{n as he}from"./mui-B4xUUoCx.js";import{g as Dt,h as Ft,q as ne}from"./QBOConnectionScreen-CMvaIZxf.js";import"./recharts-3_XOsuaw.js";import"./lottie-BMcMDJUW.js";import"./analytics-Cp5F-UjF.js";import"./plaid-G98kqTnM.js";import"./dnd-B4DEM2bW.js";import"./stripe-DMRn4zHo.js";import"./lexical-Bp_BNV6r.js";import"./pdf-DYKlsr3c.js";import"./utils-oW6HiHsc.js";import"./empty-DTOnM0RR.js";import"./pdf-lib-vymaIDnW.js";import"./index-j9ZiGcsv.js";import"./url-DMg8GQjt.js";import"./index-BWIeQAsg.js";import"./decodeURIComponentSafe--utjO_hD.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]="18425397-fc50-4e96-9ef5-a69f049877cd",t._sentryDebugIdIdentifier="sentry-dbid-18425397-fc50-4e96-9ef5-a69f049877cd")}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"}})}}})(qe),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=Je(i),{useFeatureGate:m}=ue(),k=Qe(),{isFeatureEnabled:T}=m(_.isApAgingFeatureEnabled),{isFeatureEnabled:x}=m(_.isArAgingFeatureEnabled),{isFeatureEnabled:I}=m(_.isDepositAccountsFeatureEnabled),{isFeatureEnabled:h}=m(_.isReferralFeatureEnabled),{isFeatureEnabled:U}=m(_.isExpenseAutomationEnabled),{isFeatureEnabled:C}=m(_.isExpenseAutomationEnabledV2),{isFeatureEnabled:F}=m(_.isDebitCardFeatureEnabled),$=C||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=[],q=b?.resources?.find(l=>l.resource==="/reports/top_expenses")==null,M=b?.resources?.find(l=>l.resource==="/reports/task_card")==null,K=c?.userRole!=null&&tt(c?.userRole),v=b?.resources?.find(l=>l.resource==="/bills")==null&&!K,Q=b?.resources?.find(l=>l.resource==="/reimbursements")==null;if(q===!1&&A.push("top_expenses"),M===!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"),I===!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(Y.Event.onboardingDashboardActivation))(l)}),a.jsx(wt,{navigate:t,location:o,themeState:u,signedInUser:i,isApAgingFeatureEnabled:T,isArAgingFeatureEnabled:x,shouldFetchZeniAccountsPromoCard:I,shouldFetchRewardsPlanCard:h,isExpenseAutomationEnabledForUser:$,isExpenseAutomationFeatureEnabledV2:C,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-dlvb-ucF.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-D85lL_9t.js";import{eM as j,Jf as Fe,bB as Ut,bp as de,Ks as Va,hA as Ga,Kt as Et,Ku as Na,hD as Qe,Kv as Te,Kw as za,hI as $a,Kx as Tt,Ky as Za,hM as et,Kz as xe,KA as qa,cN as at,KB as Ha,KC as Xa,Jz as Wa,iG as Ja,KD as Qa,bm as _e,KE as Kt,J3 as Q,bc as Yt,iU as Vt,mb as Gt,iD as Nt,J5 as ee,J4 as z,KF as en,KG as tn,KH as zt,KI as pe,tj as ke,tk as ye,tH as ue,tB as te,to as Se,KJ as an,KK as nn,KL as on,KM as $t,KN as he,KO as sn,dF as Oe,pX as Zt,KP as rn,KQ as cn,KR as ln,KS as nt,Iq as ot,j8 as st,tP as rt,q3 as dn,KT as un,tl as xt,p_ as ie,pW as qt,KU as oe,KV as mn,KW as ct,Ip as it,rX as Ht,KX as pn,KY as hn,KZ as fn,K_ as lt,s8 as gn,K$ as bn,tn as Dt,rW as Xt,L0 as se,L1 as Cn,bu as Wt,tT as Jt,L2 as _n,L3 as kn,L4 as yn,L5 as dt,tO as Sn,L6 as vn,tm as Ft,tS as Qt,L7 as re,L8 as In,L9 as An,La as ea,iZ as ta,m8 as aa,j2 as na,m6 as oa,m5 as sa,m4 as ra,rj as wn,fb as En,cK as Tn,cL as xn,m1 as Dn,f7 as Fn,mh as On,Lb as Pn,CX as Bn,Lc as Rn,Ld as jn,Le as Mn,b5 as ut,eZ as Ln,gw as Un,fC as Kn,mc as Yn,iw as Vn,m9 as Gn,m7 as Nn,eT as zn,eR as $n}from"./zeni-epic-state-De57_V18.js";import{z as B,Q as H,r as F,d as S,D as G,aP as Zn,F as Pe,w as ve,aQ as ca,f as K,aR as qn,j as Ie,aS as ia,a as mt,i as M,m as Hn,aT as Xn,aU as Wn,aV as Ae,aW as Jn,c as Qn,al as eo,aI as to,p as ao,H as no,aX as oo,aY as ge}from"./index-eyGUyZ3T.js";import{n as pt}from"./mui-C9WBrZQt.js";import{a as _}from"./sentry-DGJ961LO.js";import{w as la}from"./withTransactionSidePanel-BjZspg1h.js";import{b as da,t as me,e as ae,a as ht,v as so}from"./routePaths-Ckqdpqo6.js";import{u as Be}from"./useAskAiCfoHostNavButtonProps-D7VmZhkv.js";import{c as Re}from"./useFetchSuggestedQuestionsWhenReady-vh4emZ7O.js";import Ce from"./NotFoundScreen-CNrR5P_G.js";import{t as ua}from"./analyticsHelper-D9biWtDJ.js";import{C as ro}from"./CompanyPassportScreen-dMXV1qo-.js";import{F as co}from"./FeaturePreviewScreen-CHkVgg1G.js";import{R as io}from"./ReferralListScreen-DDAnd9kQ.js";import"./recharts-BYSqK3LX.js";import"./lottie-DGXsyyYr.js";import"./analytics-BAQwJULS.js";import"./plaid-BveLUCs7.js";import"./dnd-P1ekKsf6.js";import"./stripe-DMRn4zHo.js";import"./lexical-C7vBKQl2.js";import"./pdf-DebxFbW1.js";import"./utils-4E0JE-n2.js";import"./TransactionDetailScreen-lfCtA1jG.js";import"./decodeURIComponentSafe-ByB9WhLS.js";import"./MobileAppDrawer-Cq6umKbp.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]="578d36b0-d557-4a10-93b6-ad7bdde7d8e7",e._sentryDebugIdIdentifier="sentry-dbid-578d36b0-d557-4a10-93b6-ad7bdde7d8e7")}catch{}})();const lo=la(function({openTransactionPanel:e,panelContent:a,sidePanelIsOpen:t,sidePanelIsFullView:n}){const{vendorId:o,reportDate:r}=N(),s=B.getSignedInUser(),c=k(E=>E.tenantState.currentTenantId),u=k(E=>j(E)),{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(E=>Va(E,d,o)),v=_.useCallback(()=>{o!=null&&f.fetchState!=="In-Progress"&&f.fetchState!=="Completed"&&p(Ga(o,d))},[d]),w=_.useCallback(()=>{g("../../",{relative:"path"})},[]),R=_.useCallback((E,X)=>{p(Et({sortKey:E,sortOrder:X}))},[]),A=_.useCallback(E=>{p(Et({downloadState:E}))},[]),I=_.useCallback(E=>{if(e)e(E.transactionId,E.transactionType);else if(m!=null){const X=da({id:E.transactionId,type:E.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:w,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(Qe(l))},[]);_.useEffect(()=>{d()},[]);const p=_.useCallback(()=>{n("../",{relative:"path"})},[]),g=_.useCallback(I=>{t(Te({searchString:I}))},[]),f=_.useCallback((I,x)=>{t(Te({sortKey:x,sortOrder:I}))},[]),v=_.useCallback(I=>{n(`./${I}/${l.format(G.getLocalizedStrings().dateFormat.analytics.YYYYDashMMDashDDFormat)}`)},[l]),w=_.useCallback(I=>{t(Te({downloadState:I}))},[]),R=_.useCallback((I,x)=>{},[]),A=_.useCallback((I,x)=>{t(Te({selectedDate:I,agingDateSelectionType:x})),t(Qe(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:w,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"})},[]),w=_.useCallback((x,E)=>{d(Tt({sortKey:x,sortOrder:E}))},[]),R=_.useCallback(x=>{d(Tt({downloadState:x}))},[]),A=_.useCallback(x=>{if(e)e(x.transactionId,x.transactionType);else if(u!=null){const E=da({id:x.transactionId,type:x.transactionType},u);p(E);const X=F(m.state?.pathnameStackToGoBack,m.pathname);p(E,{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:w,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}))},[]),w=_.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:w,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=Wa(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=Qa(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-Cqbf2YvG.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-DZE88rLA.js";import{eM as j,Jf as Fe,bB as Ut,bp as de,Ks as Va,hA as Ga,Kt as Et,Ku as Na,hD as Qe,Kv as Te,Kw as za,hI as $a,Kx as Tt,Ky as Za,hM as et,Kz as xe,KA as qa,cN as at,KB as Ha,KC as Xa,Jz as Wa,iG as Ja,KD as Qa,bm as _e,KE as Kt,J3 as Q,bc as Yt,iU as Vt,mb as Gt,iD as Nt,J5 as ee,J4 as z,KF as en,KG as tn,KH as zt,KI as pe,tj as ke,tk as ye,tH as ue,tB as te,to as Se,KJ as an,KK as nn,KL as on,KM as $t,KN as he,KO as sn,dF as Oe,pX as Zt,KP as rn,KQ as cn,KR as ln,KS as nt,Iq as ot,j8 as st,tP as rt,q3 as dn,KT as un,tl as xt,p_ as ie,pW as qt,KU as oe,KV as mn,KW as ct,Ip as it,rX as Ht,KX as pn,KY as hn,KZ as fn,K_ as lt,s8 as gn,K$ as bn,tn as Dt,rW as Xt,L0 as se,L1 as Cn,bu as Wt,tT as Jt,L2 as _n,L3 as kn,L4 as yn,L5 as dt,tO as Sn,L6 as vn,tm as Ft,tS as Qt,L7 as re,L8 as In,L9 as An,La as ea,iZ as ta,m8 as aa,j2 as na,m6 as oa,m5 as sa,m4 as ra,rj as wn,fb as En,cK as Tn,cL as xn,m1 as Dn,f7 as Fn,mh as On,Lb as Pn,CX as Bn,Lc as Rn,Ld as jn,Le as Mn,b5 as ut,eZ as Ln,gw as Un,fC as Kn,mc as Yn,iw as Vn,m9 as Gn,m7 as Nn,eT as zn,eR as $n}from"./zeni-epic-state-Cc2P4FPR.js";import{z as B,Q as H,r as F,d as S,D as G,aP as Zn,F as Pe,w as ve,aQ as ca,f as K,aR as qn,j as Ie,aS as ia,a as mt,i as M,m as Hn,aT as Xn,aU as Wn,aV as Ae,aW as Jn,c as Qn,al as eo,aI as to,p as ao,H as no,aX as oo,aY as ge}from"./index-BET54Nt-.js";import{n as pt}from"./mui-B4xUUoCx.js";import{a as _}from"./sentry-gLPXz4Yq.js";import{w as la}from"./withTransactionSidePanel-DiiilNMM.js";import{b as da,t as me,e as ae,a as ht,v as so}from"./routePaths-BNouI24c.js";import{u as Be}from"./useAskAiCfoHostNavButtonProps-CIwJkrUG.js";import{c as Re}from"./useFetchSuggestedQuestionsWhenReady-CZP4Iues.js";import Ce from"./NotFoundScreen-BM3DcBu4.js";import{t as ua}from"./analyticsHelper-BTOyHFla.js";import{C as ro}from"./CompanyPassportScreen-BVtucNEF.js";import{F as co}from"./FeaturePreviewScreen-3Cs41rNa.js";import{R as io}from"./ReferralListScreen-CU0cqYp3.js";import"./recharts-3_XOsuaw.js";import"./lottie-BMcMDJUW.js";import"./analytics-Cp5F-UjF.js";import"./plaid-G98kqTnM.js";import"./dnd-B4DEM2bW.js";import"./stripe-DMRn4zHo.js";import"./lexical-Bp_BNV6r.js";import"./pdf-DYKlsr3c.js";import"./utils-oW6HiHsc.js";import"./TransactionDetailScreen-Bgfn35GF.js";import"./decodeURIComponentSafe--utjO_hD.js";import"./MobileAppDrawer-D0-D1IIa.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]="578d36b0-d557-4a10-93b6-ad7bdde7d8e7",e._sentryDebugIdIdentifier="sentry-dbid-578d36b0-d557-4a10-93b6-ad7bdde7d8e7")}catch{}})();const lo=la(function({openTransactionPanel:e,panelContent:a,sidePanelIsOpen:t,sidePanelIsFullView:n}){const{vendorId:o,reportDate:r}=N(),s=B.getSignedInUser(),c=k(E=>E.tenantState.currentTenantId),u=k(E=>j(E)),{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(E=>Va(E,d,o)),v=_.useCallback(()=>{o!=null&&f.fetchState!=="In-Progress"&&f.fetchState!=="Completed"&&p(Ga(o,d))},[d]),w=_.useCallback(()=>{g("../../",{relative:"path"})},[]),R=_.useCallback((E,X)=>{p(Et({sortKey:E,sortOrder:X}))},[]),A=_.useCallback(E=>{p(Et({downloadState:E}))},[]),I=_.useCallback(E=>{if(e)e(E.transactionId,E.transactionType);else if(m!=null){const X=da({id:E.transactionId,type:E.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:w,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(Qe(l))},[]);_.useEffect(()=>{d()},[]);const p=_.useCallback(()=>{n("../",{relative:"path"})},[]),g=_.useCallback(I=>{t(Te({searchString:I}))},[]),f=_.useCallback((I,x)=>{t(Te({sortKey:x,sortOrder:I}))},[]),v=_.useCallback(I=>{n(`./${I}/${l.format(G.getLocalizedStrings().dateFormat.analytics.YYYYDashMMDashDDFormat)}`)},[l]),w=_.useCallback(I=>{t(Te({downloadState:I}))},[]),R=_.useCallback((I,x)=>{},[]),A=_.useCallback((I,x)=>{t(Te({selectedDate:I,agingDateSelectionType:x})),t(Qe(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:w,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"})},[]),w=_.useCallback((x,E)=>{d(Tt({sortKey:x,sortOrder:E}))},[]),R=_.useCallback(x=>{d(Tt({downloadState:x}))},[]),A=_.useCallback(x=>{if(e)e(x.transactionId,x.transactionType);else if(u!=null){const E=da({id:x.transactionId,type:x.transactionType},u);p(E);const X=F(m.state?.pathnameStackToGoBack,m.pathname);p(E,{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:w,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}))},[]),w=_.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:w,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=Wa(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=Qa(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-dlvb-ucF.js";import{a as u}from"./sentry-DGJ961LO.js";import{h as y,g as b,k as w,u as A,N as k}from"./core-D85lL_9t.js";import{H_ as N,eM as _,fj as U,H$ as L,m3 as R,I0 as z}from"./zeni-epic-state-De57_V18.js";import{u as $,z as f,L as T,t as I,D as j,b as O}from"./index-eyGUyZ3T.js";import"./mui-C9WBrZQt.js";import{t as H}from"./getLocaleForTenant-ClrmJsWr.js";import"./recharts-BYSqK3LX.js";import"./lottie-DGXsyyYr.js";import"./analytics-BAQwJULS.js";import"./plaid-BveLUCs7.js";import"./dnd-P1ekKsf6.js";import"./stripe-DMRn4zHo.js";import"./lexical-C7vBKQl2.js";import"./pdf-DebxFbW1.js";import"./utils-4E0JE-n2.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]="1e44250a-223f-4355-961d-2d4b3bbff7b1",t._sentryDebugIdIdentifier="sentry-dbid-1e44250a-223f-4355-961d-2d4b3bbff7b1")}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=O(c,p);return v.jsx(k,{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}=$(),h=u.useRef(!1),r=u.useRef(!1),p=u.useRef(null),m=b(e=>N(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(U(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"&&!L(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||(j.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"],q={"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 q[s]}export{oe as default};
1
+ import{j as v}from"./liveblocks-Cqbf2YvG.js";import{a as u}from"./sentry-gLPXz4Yq.js";import{h as y,g as b,k as w,u as A,N as k}from"./core-DZE88rLA.js";import{H_ as N,eM as _,fj as U,H$ as L,m3 as R,I0 as z}from"./zeni-epic-state-Cc2P4FPR.js";import{u as $,z as f,L as T,t as I,D as j,b as O}from"./index-BET54Nt-.js";import"./mui-B4xUUoCx.js";import{t as H}from"./getLocaleForTenant-CPndpwIp.js";import"./recharts-3_XOsuaw.js";import"./lottie-BMcMDJUW.js";import"./analytics-Cp5F-UjF.js";import"./plaid-G98kqTnM.js";import"./dnd-B4DEM2bW.js";import"./stripe-DMRn4zHo.js";import"./lexical-Bp_BNV6r.js";import"./pdf-DYKlsr3c.js";import"./utils-oW6HiHsc.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]="1e44250a-223f-4355-961d-2d4b3bbff7b1",t._sentryDebugIdIdentifier="sentry-dbid-1e44250a-223f-4355-961d-2d4b3bbff7b1")}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=O(c,p);return v.jsx(k,{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}=$(),h=u.useRef(!1),r=u.useRef(!1),p=u.useRef(null),m=b(e=>N(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(U(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"&&!L(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||(j.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"],q={"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 q[s]}export{oe as default};
@@ -1,4 +1,4 @@
1
- import{j as l}from"./liveblocks-dlvb-ucF.js";import{j as w,u as C,g as h,k as A,l as B}from"./core-D85lL_9t.js";import{LY as k,M3 as M,fA as _,fz as J,fy as W,i3 as Y,J4 as q,pe as K,eM as V,Lu as D,i1 as T,LZ as S,M6 as F,h$ as G,io as j}from"./zeni-epic-state-De57_V18.js";import{bj as Q,Z as R,a as N,z as U,m as Z,p,i as v,B as z,bk as X,o as O,bl as ee,r as te}from"./index-eyGUyZ3T.js";import{n as H}from"./mui-C9WBrZQt.js";import"./sentry-DGJ961LO.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]="023fbfa8-c4e3-4b7f-ab5d-d6a2b895d04f",e._sentryDebugIdIdentifier="sentry-dbid-023fbfa8-c4e3-4b7f-ab5d-d6a2b895d04f")}catch{}})();const ae=A(null,function(e,t){return{onSaveVendor:a=>{e(Y(t.vendorId!==void 0?t.vendorId:void 0,t.billId,void 0,t.isExpressPayPage)),e(q("common")),a!=null&&e(K(a))},onGetOtp:a=>{e(W(a,"BillPayVendor"))},onResendOtp:a=>{e(J(a,"BillPayVendor"))},onVerifyOtp:(a,n)=>{e(_(a,n,"BillPayVendor"))},onVerifyOtpSuccess:(a,n,o)=>{e(M(a,n,o))}}})(Q);function L({vendorId:e,billId:t,isExpressPayPage:a}){const n=w(),o=C(),s=h(d=>k(d,e));return l.jsx(ae,{location:o,navigate:n,vendorId:e,billId:t,vendorViewDetails:s,isExpressPayPage:a??!1})}const ne=H.div`
1
+ import{j as l}from"./liveblocks-Cqbf2YvG.js";import{j as w,u as C,g as h,k as A,l as B}from"./core-DZE88rLA.js";import{LY as k,M3 as M,fA as _,fz as J,fy as W,i3 as Y,J4 as q,pe as K,eM as V,Lu as D,i1 as T,LZ as S,M6 as F,h$ as G,io as j}from"./zeni-epic-state-Cc2P4FPR.js";import{bj as Q,Z as R,a as N,z as U,m as Z,p,i as v,B as z,bk as X,o as O,bl as ee,r as te}from"./index-BET54Nt-.js";import{n as H}from"./mui-B4xUUoCx.js";import"./sentry-gLPXz4Yq.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]="023fbfa8-c4e3-4b7f-ab5d-d6a2b895d04f",e._sentryDebugIdIdentifier="sentry-dbid-023fbfa8-c4e3-4b7f-ab5d-d6a2b895d04f")}catch{}})();const ae=A(null,function(e,t){return{onSaveVendor:a=>{e(Y(t.vendorId!==void 0?t.vendorId:void 0,t.billId,void 0,t.isExpressPayPage)),e(q("common")),a!=null&&e(K(a))},onGetOtp:a=>{e(W(a,"BillPayVendor"))},onResendOtp:a=>{e(J(a,"BillPayVendor"))},onVerifyOtp:(a,n)=>{e(_(a,n,"BillPayVendor"))},onVerifyOtpSuccess:(a,n,o)=>{e(M(a,n,o))}}})(Q);function L({vendorId:e,billId:t,isExpressPayPage:a}){const n=w(),o=C(),s=h(d=>k(d,e));return l.jsx(ae,{location:o,navigate:n,vendorId:e,billId:t,vendorViewDetails:s,isExpressPayPage:a??!1})}const ne=H.div`
2
2
  display: flex;
3
3
  height: 100vh;
4
4
  width: 100%;
@@ -1 +1 @@
1
- import{j as i}from"./liveblocks-dlvb-ucF.js";import{Z as c,x as l,m as f}from"./index-eyGUyZ3T.js";import{D as p}from"./mui-C9WBrZQt.js";import"./sentry-DGJ961LO.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]="91c57933-cc49-463e-9b31-d6ee0de2baf5",e._sentryDebugIdIdentifier="sentry-dbid-91c57933-cc49-463e-9b31-d6ee0de2baf5")}catch{}})();const b={drawerLeftMargin:new l(0,0,240)};function m(e){const{isOpen:r,drawerLeftMargin:o,children:t,onClose:s}=e,n=c(),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-Cqbf2YvG.js";import{Z as c,x as l,m as f}from"./index-BET54Nt-.js";import{D as p}from"./mui-B4xUUoCx.js";import"./sentry-gLPXz4Yq.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]="91c57933-cc49-463e-9b31-d6ee0de2baf5",e._sentryDebugIdIdentifier="sentry-dbid-91c57933-cc49-463e-9b31-d6ee0de2baf5")}catch{}})();const b={drawerLeftMargin:new l(0,0,240)};function m(e){const{isOpen:r,drawerLeftMargin:o,children:t,onClose:s}=e,n=c(),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-dlvb-ucF.js";import{a as d}from"./sentry-DGJ961LO.js";import{j as A,h as B,u as F,l as J,g as l,N as q,k as M,n as N,o as O}from"./core-D85lL_9t.js";import{Kb as _,eM as K,JA as R,k8 as W,Gi as k,Kg as Y,J3 as $,j8 as z,Gj as b,JF as V,JG as H,J5 as L,J4 as Q}from"./zeni-epic-state-De57_V18.js";import{aM as U,d as X,p as Z,r as tt}from"./index-eyGUyZ3T.js";import"./mui-C9WBrZQt.js";import{d as S}from"./decodeURIComponentSafe-ByB9WhLS.js";import{w as et}from"./withTransactionSidePanel-BjZspg1h.js";import{e as at,b as nt}from"./routePaths-Ckqdpqo6.js";import"./recharts-BYSqK3LX.js";import"./lottie-DGXsyyYr.js";import"./analytics-BAQwJULS.js";import"./plaid-BveLUCs7.js";import"./dnd-P1ekKsf6.js";import"./stripe-DMRn4zHo.js";import"./lexical-C7vBKQl2.js";import"./pdf-DebxFbW1.js";import"./utils-4E0JE-n2.js";import"./useAskAiCfoHostNavButtonProps-D7VmZhkv.js";import"./useFetchSuggestedQuestionsWhenReady-vh4emZ7O.js";import"./TransactionDetailScreen-lfCtA1jG.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]="52ac69b1-ad8e-4f0d-b727-a7c2ba26213b",a._sentryDebugIdIdentifier="sentry-dbid-52ac69b1-ad8e-4f0d-b727-a7c2ba26213b")}catch{}})();const ot=M(function(a,t){const e=t.entity,o=Y(a,t.entity,"EntityDetail");return{selectedEntity:e,autoCompleteData:{autoCompleteText:e.name,entityAutoCompleteView:$(a,"common")},trendWithTransactionsReport:o,analytics:X,isAccountingClassesEnabled:z(a)}},function(a,t){return{onTransactionItemClick:e=>{if(t.openTransactionPanel)return void t.openTransactionPanel(e.id,e.type);const o=`${nt(e,t.tenantEmailDomain)}`,c=tt(t.location.state?.pathnameStackToGoBack,t.location.pathname);t.navigate(o,{state:{pathnameStackToGoBack:c}})},autoCompleteActions:{onAutoCompleteInputChange:e=>{e.trim().length>=2?a(L({searchString:e,searchOrigin:"common"})):e.trim().length===0&&a(Q("common"))},onAutoCompleteEntity:e=>{const o=at(e,t.tenantEmailDomain);a(V()),a(H()),t.resetTrendIsFetchedStates(),t.navigate(o,{replace:!0,state:{pathnameStackToGoBack:t.location.state?.pathnameStackToGoBack}})},onCancelAutoComplete:()=>{const e=Z(t.location.state?.pathnameStackToGoBack),o=e.poppedPathname??I();t.navigate(o,{state:{pathnameStackToGoBack:e.newStack}})}},onTrendSelectedPeriodChange:e=>{if(t.closeSidePanel?.(),e==null)t.defaultTransactionTimePeriod!=null&&a(b(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(b(t.entity,"EntityDetail",{timeframe:e.timeframe,timePeriod:o}))}}}})(U),it=et(function({entityType:a,...t}){const e=A(),o=B(),c=F(),[m,T]=d.useState(!1),[h,g]=d.useState(!1),{tenantEmailDomain:C,entityIdEncoded:j,entityNameEncoded:G}=J(),r=S(j??""),p=S(G??""),u=rt(r,p),w=[r,p].filter(n=>n!=null),i={name:p,id:r,type:a,zeniId:r,qboId:r},D=l(n=>_(n.customerIncomeState,n.vendorExpenseState,n.trendState,i,"quarter")),x=l(n=>K(n).company?.companyInfo.firstMonthOfFY??1),f=l(n=>R(n.trendWithTransactionsState,i,"EntityDetail"));d.useEffect(()=>{m===!1&&u===!0&&(T(!0),o(W(i)))},[m,u,i]);const E=l(n=>n.trendState.fetchState),P=f?.selectedPeriod?.timePeriod??D,v=function(n,y){return n!=null&&y!=null?{startDate:n.startDate,endDate:y?.endDate}:y}(f?.selectedPeriod?.timePeriod,D);return d.useEffect(()=>{m===!0&&h===!1&&E==="Completed"&&(g(!0),P!=null&&o(k(i,"EntityDetail",{timeframe:f?.selectedPeriod?.timeframe??"quarter",timePeriod:P})))},[m,h,E]),u?s.jsx(ot,{firstMonthOfFY:x,tenantEmailDomain:C,location:c,navigate:e,entity:i,defaultTransactionTimePeriod:v,resetTrendIsFetchedStates:()=>{T(!1),g(!1)},...t}):s.jsx(q,{to:I(w.length)})}),rt=(a,t)=>t!=null&&t.length>0&&a!=null&&a.length>0,I=(a=2)=>{let t="../";for(let e=0;e<a;e++)t=`${t}../`;return t};function Gt({entityType:a}){return s.jsx(N,{children:s.jsx(O,{path:"/:entityIdEncoded/:entityNameEncoded/*",element:s.jsx(it,{entityType:a})})})}export{Gt as EntityDetailRoutes,Gt as default};
1
+ import{j as s}from"./liveblocks-Cqbf2YvG.js";import{a as d}from"./sentry-gLPXz4Yq.js";import{j as A,h as B,u as F,l as J,g as l,N as q,k as M,n as N,o as O}from"./core-DZE88rLA.js";import{Kb as _,eM as K,JA as R,k8 as W,Gi as k,Kg as Y,J3 as $,j8 as z,Gj as b,JF as V,JG as H,J5 as L,J4 as Q}from"./zeni-epic-state-Cc2P4FPR.js";import{aM as U,d as X,p as Z,r as tt}from"./index-BET54Nt-.js";import"./mui-B4xUUoCx.js";import{d as S}from"./decodeURIComponentSafe--utjO_hD.js";import{w as et}from"./withTransactionSidePanel-DiiilNMM.js";import{e as at,b as nt}from"./routePaths-BNouI24c.js";import"./recharts-3_XOsuaw.js";import"./lottie-BMcMDJUW.js";import"./analytics-Cp5F-UjF.js";import"./plaid-G98kqTnM.js";import"./dnd-B4DEM2bW.js";import"./stripe-DMRn4zHo.js";import"./lexical-Bp_BNV6r.js";import"./pdf-DYKlsr3c.js";import"./utils-oW6HiHsc.js";import"./useAskAiCfoHostNavButtonProps-CIwJkrUG.js";import"./useFetchSuggestedQuestionsWhenReady-CZP4Iues.js";import"./TransactionDetailScreen-Bgfn35GF.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]="52ac69b1-ad8e-4f0d-b727-a7c2ba26213b",a._sentryDebugIdIdentifier="sentry-dbid-52ac69b1-ad8e-4f0d-b727-a7c2ba26213b")}catch{}})();const ot=M(function(a,t){const e=t.entity,o=Y(a,t.entity,"EntityDetail");return{selectedEntity:e,autoCompleteData:{autoCompleteText:e.name,entityAutoCompleteView:$(a,"common")},trendWithTransactionsReport:o,analytics:X,isAccountingClassesEnabled:z(a)}},function(a,t){return{onTransactionItemClick:e=>{if(t.openTransactionPanel)return void t.openTransactionPanel(e.id,e.type);const o=`${nt(e,t.tenantEmailDomain)}`,c=tt(t.location.state?.pathnameStackToGoBack,t.location.pathname);t.navigate(o,{state:{pathnameStackToGoBack:c}})},autoCompleteActions:{onAutoCompleteInputChange:e=>{e.trim().length>=2?a(L({searchString:e,searchOrigin:"common"})):e.trim().length===0&&a(Q("common"))},onAutoCompleteEntity:e=>{const o=at(e,t.tenantEmailDomain);a(V()),a(H()),t.resetTrendIsFetchedStates(),t.navigate(o,{replace:!0,state:{pathnameStackToGoBack:t.location.state?.pathnameStackToGoBack}})},onCancelAutoComplete:()=>{const e=Z(t.location.state?.pathnameStackToGoBack),o=e.poppedPathname??I();t.navigate(o,{state:{pathnameStackToGoBack:e.newStack}})}},onTrendSelectedPeriodChange:e=>{if(t.closeSidePanel?.(),e==null)t.defaultTransactionTimePeriod!=null&&a(b(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(b(t.entity,"EntityDetail",{timeframe:e.timeframe,timePeriod:o}))}}}})(U),it=et(function({entityType:a,...t}){const e=A(),o=B(),c=F(),[m,T]=d.useState(!1),[h,g]=d.useState(!1),{tenantEmailDomain:C,entityIdEncoded:j,entityNameEncoded:G}=J(),r=S(j??""),p=S(G??""),u=rt(r,p),w=[r,p].filter(n=>n!=null),i={name:p,id:r,type:a,zeniId:r,qboId:r},D=l(n=>_(n.customerIncomeState,n.vendorExpenseState,n.trendState,i,"quarter")),x=l(n=>K(n).company?.companyInfo.firstMonthOfFY??1),f=l(n=>R(n.trendWithTransactionsState,i,"EntityDetail"));d.useEffect(()=>{m===!1&&u===!0&&(T(!0),o(W(i)))},[m,u,i]);const E=l(n=>n.trendState.fetchState),P=f?.selectedPeriod?.timePeriod??D,v=function(n,y){return n!=null&&y!=null?{startDate:n.startDate,endDate:y?.endDate}:y}(f?.selectedPeriod?.timePeriod,D);return d.useEffect(()=>{m===!0&&h===!1&&E==="Completed"&&(g(!0),P!=null&&o(k(i,"EntityDetail",{timeframe:f?.selectedPeriod?.timeframe??"quarter",timePeriod:P})))},[m,h,E]),u?s.jsx(ot,{firstMonthOfFY:x,tenantEmailDomain:C,location:c,navigate:e,entity:i,defaultTransactionTimePeriod:v,resetTrendIsFetchedStates:()=>{T(!1),g(!1)},...t}):s.jsx(q,{to:I(w.length)})}),rt=(a,t)=>t!=null&&t.length>0&&a!=null&&a.length>0,I=(a=2)=>{let t="../";for(let e=0;e<a;e++)t=`${t}../`;return t};function Gt({entityType:a}){return s.jsx(N,{children:s.jsx(O,{path:"/:entityIdEncoded/:entityNameEncoded/*",element:s.jsx(it,{entityType:a})})})}export{Gt as EntityDetailRoutes,Gt as default};
@@ -1,4 +1,4 @@
1
- import{j as u}from"./liveblocks-dlvb-ucF.js";import un from"./NotFoundScreen-CNrR5P_G.js";import{a as l}from"./sentry-DGJ961LO.js";import{n as Te,D as St,S as ze}from"./mui-C9WBrZQt.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-D85lL_9t.js";import{eM as $e,Ou as pn,f0 as me,fe as gn,pR as Cn,Ov as je,mu as ft,mA as kt,Ow as Et,mZ as Sn,Ox as yt,mn as In,pn as fn,Oy as kn,jk as En,Oz as yn,Fj as vn,eY as Me,p2 as vt,Kc as at,Ke as bn,jb as Tn,Kf as An,ji as wn,cT as xn,sT as Le,J3 as Rn,jj as Pn,e_ as Dn,mB as bt,n2 as be,nZ as Tt,ow as On,e$ as At,n1 as ot,ms as ae,n4 as wt,n6 as Un,bB as Fn,kH as Bn,kE as _n,n5 as Ee,n3 as ue,OA as Vn,nm as st,A$ as xt,OB as Rt,rQ as Pt,os as jn,j8 as Mn,OC as Ln,J5 as ct,J4 as ke,OD as it,jz as zn,OE as $n,OF as Gn,OG as qn,OH as Jn,mK as Kn,OI as Yn,OJ as Nn,OK as Hn,nc as Zn,jm as Qn,jd as Wn,OL as Xn,jl as lt,Km as ea,OM as ta,ON as na,o_ as aa,oF as oa,oE as Fe,OO as sa,OP as ca,kS as ia,bp as la,kN as rt,kz as ra,OQ as da,gy as dt,fL as ua,kK as ma,uM as ha,OR as pa,nD as ga,ny as Ca,nC as Sa,nn as Ia,OS as fa,mS as ka,mH as Ea,ff as ut,n7 as ya,OT as va,OU as ba,OV as Ta,OW as Aa,OX as wa,OY as mt,pa as xa,on as Ra,o6 as ht,of as Pa,o2 as Da,ot as Oa,o7 as Ua,OZ as Fa,O_ as Ba,nM as _a,O$ as Va,nK as ja,nL as Ma,nI as La,oh as za}from"./zeni-epic-state-De57_V18.js";import{F as Dt,a as Ot,i as ye,d as M,r as Z,H as Ut,cq as $a,m as Ft,z as Ae,cr as Ga,ao as ve,cs as qa,B as Bt,ct as Ja,cu as Ka,al as Be,v as Ya,j as Na,aI as Ha,cv as Za,aZ as Qa,x as Wa,D as Xa,cw as eo,Q as to,cx as no}from"./index-eyGUyZ3T.js";import{u as _t}from"./useAskAiCfoHostNavButtonProps-D7VmZhkv.js";import{c as Vt}from"./useFetchSuggestedQuestionsWhenReady-vh4emZ7O.js";import{c as pt,C as ao}from"./TransactionDetailScreen-lfCtA1jG.js";import{w as oo}from"./withTransactionSidePanel-BjZspg1h.js";import{h as so,v as co}from"./routePaths-Ckqdpqo6.js";import{g as _e}from"./accountMappingHelper-DVEV1WRI.js";import{D as io}from"./DrawerScreen-7RB3pd-L.js";import"./recharts-BYSqK3LX.js";import"./lottie-DGXsyyYr.js";import"./analytics-BAQwJULS.js";import"./plaid-BveLUCs7.js";import"./dnd-P1ekKsf6.js";import"./stripe-DMRn4zHo.js";import"./lexical-C7vBKQl2.js";import"./pdf-DebxFbW1.js";import"./utils-4E0JE-n2.js";import"./decodeURIComponentSafe-ByB9WhLS.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]="73d10d2c-ed30-459e-9661-7244217b655b",t._sentryDebugIdIdentifier="sentry-dbid-73d10d2c-ed30-459e-9661-7244217b655b")}catch{}})();const lo=()=>{const{isAiCfoOpen:t,setIsAiCfoOpen:c}=Dt(),x=he(),A=It(),y=Ve(),r=V(p=>$e(p)),{useFeatureGate:m}=Ot(),{isFeatureEnabled:R}=m(ye.isRealtimeInsightsFeatureEnabled),g=V(p=>p.expenseAutomationViewState.selectedPeriodByTenantId),a=V(p=>pn(p,r.tenantId)),{isAiCfoAccessEnabled:j,onAskAiCfoClick:v}=_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=Z(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 A(`./${p.id}/${S.month}-${S.year}`,{state:{pathnameStackToGoBack:L,message:"comingFromOverview"}});A(`./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:R,onMonthEndCheckClick:p=>{A(`./${p}/${S.month}-${S.year}`,{state:{pathnameStackToGoBack:L,message:"comingFromOverview",referrer:"Expense Automation - Overview"}})},onPeriodChange:$,handleReviewButtonClick:Y,onBackClick:()=>{A("../../dashboard")},onReload:k,isAiCfoAccessEnabled:j,onAskAiCfoClick:v})})},ro=Te.div`
1
+ import{j as u}from"./liveblocks-Cqbf2YvG.js";import un from"./NotFoundScreen-BM3DcBu4.js";import{a as l}from"./sentry-gLPXz4Yq.js";import{n as Te,D as St,S as ze}from"./mui-B4xUUoCx.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-DZE88rLA.js";import{eM as $e,Ou as pn,f0 as me,fe as gn,pR as Cn,Ov as je,mu as ft,mA as kt,Ow as Et,mZ as Sn,Ox as yt,mn as In,pn as fn,Oy as kn,jk as En,Oz as yn,Fj as vn,eY as Me,p2 as vt,Kc as at,Ke as bn,jb as Tn,Kf as An,ji as wn,cT as xn,sT as Le,J3 as Rn,jj as Pn,e_ as Dn,mB as bt,n2 as be,nZ as Tt,ow as On,e$ as At,n1 as ot,ms as ae,n4 as wt,n6 as Un,bB as Fn,kH as Bn,kE as _n,n5 as Ee,n3 as ue,OA as Vn,nm as st,A$ as xt,OB as Rt,rQ as Pt,os as jn,j8 as Mn,OC as Ln,J5 as ct,J4 as ke,OD as it,jz as zn,OE as $n,OF as Gn,OG as qn,OH as Jn,mK as Kn,OI as Yn,OJ as Nn,OK as Hn,nc as Zn,jm as Qn,jd as Wn,OL as Xn,jl as lt,Km as ea,OM as ta,ON as na,o_ as aa,oF as oa,oE as Fe,OO as sa,OP as ca,kS as ia,bp as la,kN as rt,kz as ra,OQ as da,gy as dt,fL as ua,kK as ma,uM as ha,OR as pa,nD as ga,ny as Ca,nC as Sa,nn as Ia,OS as fa,mS as ka,mH as Ea,ff as ut,n7 as ya,OT as va,OU as ba,OV as Ta,OW as Aa,OX as wa,OY as mt,pa as xa,on as Ra,o6 as ht,of as Pa,o2 as Da,ot as Oa,o7 as Ua,OZ as Fa,O_ as Ba,nM as _a,O$ as Va,nK as ja,nL as Ma,nI as La,oh as za}from"./zeni-epic-state-Cc2P4FPR.js";import{F as Dt,a as Ot,i as ye,d as M,r as Z,H as Ut,cq as $a,m as Ft,z as Ae,cr as Ga,ao as ve,cs as qa,B as Bt,ct as Ja,cu as Ka,al as Be,v as Ya,j as Na,aI as Ha,cv as Za,aZ as Qa,x as Wa,D as Xa,cw as eo,Q as to,cx as no}from"./index-BET54Nt-.js";import{u as _t}from"./useAskAiCfoHostNavButtonProps-CIwJkrUG.js";import{c as Vt}from"./useFetchSuggestedQuestionsWhenReady-CZP4Iues.js";import{c as pt,C as ao}from"./TransactionDetailScreen-Bgfn35GF.js";import{w as oo}from"./withTransactionSidePanel-DiiilNMM.js";import{h as so,v as co}from"./routePaths-BNouI24c.js";import{g as _e}from"./accountMappingHelper-BvCdqdBq.js";import{D as io}from"./DrawerScreen-Dv_UzQOo.js";import"./recharts-3_XOsuaw.js";import"./lottie-BMcMDJUW.js";import"./analytics-Cp5F-UjF.js";import"./plaid-G98kqTnM.js";import"./dnd-B4DEM2bW.js";import"./stripe-DMRn4zHo.js";import"./lexical-Bp_BNV6r.js";import"./pdf-DYKlsr3c.js";import"./utils-oW6HiHsc.js";import"./decodeURIComponentSafe--utjO_hD.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]="73d10d2c-ed30-459e-9661-7244217b655b",t._sentryDebugIdIdentifier="sentry-dbid-73d10d2c-ed30-459e-9661-7244217b655b")}catch{}})();const lo=()=>{const{isAiCfoOpen:t,setIsAiCfoOpen:c}=Dt(),x=he(),A=It(),y=Ve(),r=V(p=>$e(p)),{useFeatureGate:m}=Ot(),{isFeatureEnabled:R}=m(ye.isRealtimeInsightsFeatureEnabled),g=V(p=>p.expenseAutomationViewState.selectedPeriodByTenantId),a=V(p=>pn(p,r.tenantId)),{isAiCfoAccessEnabled:j,onAskAiCfoClick:v}=_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=Z(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 A(`./${p.id}/${S.month}-${S.year}`,{state:{pathnameStackToGoBack:L,message:"comingFromOverview"}});A(`./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:R,onMonthEndCheckClick:p=>{A(`./${p}/${S.month}-${S.year}`,{state:{pathnameStackToGoBack:L,message:"comingFromOverview",referrer:"Expense Automation - Overview"}})},onPeriodChange:$,handleReviewButtonClick:Y,onBackClick:()=>{A("../../dashboard")},onReload:k,isAiCfoAccessEnabled:j,onAskAiCfoClick:v})})},ro=Te.div`
2
2
  display: flex;
3
3
  height: 100vh;
4
4
  width: 100%;
@@ -1 +1 @@
1
- import{j as s}from"./liveblocks-dlvb-ucF.js";import{a as r}from"./sentry-DGJ961LO.js";import{V as i,W as l,Y as p,p as c}from"./index-eyGUyZ3T.js";import"./mui-C9WBrZQt.js";import m from"./NotFoundScreen-CNrR5P_G.js";import{j as b,u}from"./core-D85lL_9t.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]="b9cfd7ff-730d-4f29-9902-85a761b5201b",e._sentryDebugIdIdentifier="sentry-dbid-b9cfd7ff-730d-4f29-9902-85a761b5201b")}catch{}})();const D=()=>{const e=b(),t=u(),a=r.useCallback(()=>{window.open("https://www.zeni.ai/demo/request","_blank")},[]),f=r.useCallback(()=>{(()=>{const n=c(t.state?.pathnameStackToGoBack),d=n.poppedPathname??k();e(d,{state:{pathnameStackToGoBack:n.newStack}})})()},[]),o=i(t.pathname);return o!=null?s.jsx(l,{menuItem:p(o),onDemoClick:a,onGoBack:f}):s.jsx(m,{})},k=(e=2)=>{let t="../";for(let a=0;a<e;a++)t=`${t}../`;return t};export{D as F};
1
+ import{j as s}from"./liveblocks-Cqbf2YvG.js";import{a as r}from"./sentry-gLPXz4Yq.js";import{V as i,W as l,Y as p,p as c}from"./index-BET54Nt-.js";import"./mui-B4xUUoCx.js";import m from"./NotFoundScreen-BM3DcBu4.js";import{j as b,u}from"./core-DZE88rLA.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]="b9cfd7ff-730d-4f29-9902-85a761b5201b",e._sentryDebugIdIdentifier="sentry-dbid-b9cfd7ff-730d-4f29-9902-85a761b5201b")}catch{}})();const D=()=>{const e=b(),t=u(),a=r.useCallback(()=>{window.open("https://www.zeni.ai/demo/request","_blank")},[]),f=r.useCallback(()=>{(()=>{const n=c(t.state?.pathnameStackToGoBack),d=n.poppedPathname??k();e(d,{state:{pathnameStackToGoBack:n.newStack}})})()},[]),o=i(t.pathname);return o!=null?s.jsx(l,{menuItem:p(o),onDemoClick:a,onGoBack:f}):s.jsx(m,{})},k=(e=2)=>{let t="../";for(let a=0;a<e;a++)t=`${t}../`;return t};export{D as F};
@@ -1,4 +1,4 @@
1
- import{j as a}from"./liveblocks-dlvb-ucF.js";import{l as b,k as g,j,u as y,h as Y,q as ee,g as A,N as ae,n as te,o as p}from"./core-D85lL_9t.js";import{Ig as S,Ih as k,Ii as N,yC as $,yo as L,Ij as C,Ik as ne,Il as oe,ys as ie,eN as v,yz as se,yw as le}from"./zeni-epic-state-De57_V18.js";import{Z as x,o as r,k as re,d as I,h as E,n as de,p as ce,q as me,r as F,a as pe,i as ue,s as he,v as ge,m as xe,B as fe,w as we,$ as be,S as ye,I as Se,x as ke,y as Ie}from"./index-eyGUyZ3T.js";import{n as c}from"./mui-C9WBrZQt.js";import f from"./NotFoundScreen-CNrR5P_G.js";import{a as P}from"./sentry-DGJ961LO.js";import"./recharts-BYSqK3LX.js";import"./lottie-DGXsyyYr.js";import"./analytics-BAQwJULS.js";import"./plaid-BveLUCs7.js";import"./dnd-P1ekKsf6.js";import"./stripe-DMRn4zHo.js";import"./lexical-C7vBKQl2.js";import"./pdf-DebxFbW1.js";import"./utils-4E0JE-n2.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]="e8d77a3a-1805-4aa8-a49c-ef56531302dc",e._sentryDebugIdIdentifier="sentry-dbid-e8d77a3a-1805-4aa8-a49c-ef56531302dc")}catch{}})();const ve=c.div`
1
+ import{j as a}from"./liveblocks-Cqbf2YvG.js";import{l as b,k as g,j,u as y,h as Y,q as ee,g as A,N as ae,n as te,o as p}from"./core-DZE88rLA.js";import{Ig as S,Ih as k,Ii as N,yC as $,yo as L,Ij as C,Ik as ne,Il as oe,ys as ie,eN as v,yz as se,yw as le}from"./zeni-epic-state-Cc2P4FPR.js";import{Z as x,o as r,k as re,d as I,h as E,n as de,p as ce,q as me,r as F,a as pe,i as ue,s as he,v as ge,m as xe,B as fe,w as we,$ as be,S as ye,I as Se,x as ke,y as Ie}from"./index-BET54Nt-.js";import{n as c}from"./mui-B4xUUoCx.js";import f from"./NotFoundScreen-BM3DcBu4.js";import{a as P}from"./sentry-gLPXz4Yq.js";import"./recharts-3_XOsuaw.js";import"./lottie-BMcMDJUW.js";import"./analytics-Cp5F-UjF.js";import"./plaid-G98kqTnM.js";import"./dnd-B4DEM2bW.js";import"./stripe-DMRn4zHo.js";import"./lexical-Bp_BNV6r.js";import"./pdf-DYKlsr3c.js";import"./utils-oW6HiHsc.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]="e8d77a3a-1805-4aa8-a49c-ef56531302dc",e._sentryDebugIdIdentifier="sentry-dbid-e8d77a3a-1805-4aa8-a49c-ef56531302dc")}catch{}})();const ve=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-dlvb-ucF.js";import{a as f}from"./sentry-DGJ961LO.js";import{h as U,u as _,j as w,q as M,g as l,N as T}from"./core-D85lL_9t.js";import{z as r,m as P,D as V,e as A,d as N,f as R,X as $,$ as q,g as W}from"./index-eyGUyZ3T.js";import{eM as X,I0 as B,Ib as G,I1 as H,eN as J,fi as K,I7 as Q,fF as Y,cR as Z,Ic as ee,Id as te}from"./zeni-epic-state-De57_V18.js";import{n as ne}from"./mui-C9WBrZQt.js";import{u as ae}from"./useDeviceId-cXBRwcUd.js";import{f as se}from"./analyticsHelper-D9biWtDJ.js";import{t as ie}from"./getLocaleForTenant-ClrmJsWr.js";import"./recharts-BYSqK3LX.js";import"./lottie-DGXsyyYr.js";import"./analytics-BAQwJULS.js";import"./plaid-BveLUCs7.js";import"./dnd-P1ekKsf6.js";import"./stripe-DMRn4zHo.js";import"./lexical-C7vBKQl2.js";import"./pdf-DebxFbW1.js";import"./utils-4E0JE-n2.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]="a2ce110d-adaf-44fc-a748-8a642d44a263",t._sentryDebugIdIdentifier="sentry-dbid-a2ce110d-adaf-44fc-a748-8a642d44a263")}catch{}})();const D=(t,s)=>t!=null&&t.length>0&&s==="magic_links";function De(){const t=U(),s=_(),m=w(),[y]=M(),n=y.get("token"),p=y.get("stytch_token_type"),g=r.getMagicLinkCodeVerifier(),i=ae(),{otpChallenge:d,twoFAPhoneNumber:x,magicLinkEmail:c,verifyDeviceFetchState:z,resendVerifyDeviceOTPFetchState:C}=l(e=>e.tenantState),I=l(e=>e.tenantState.fetchState),b=l(e=>e.tenantState.activeTenantFetchState.fetchState),S=l(e=>e.tenantState.signInState),h=l(e=>e.tenantState.magicLinkSignInFetchState.fetchState),a=l(e=>e.tenantState.loggedInUser),o=l(e=>X(e)),k=l(e=>B(e)),E=r.getSignedInUser(),v=P().mode;f.useEffect(()=>{a?.zeniSessionId==null&&n!=null&&D(n,p)&&i!=null&&g!=null&&(r.saveMagicLinkTriggered(n),t(G(n,i,g)))},[n,p,t,i,g,a?.zeniSessionId]),f.useEffect(()=>{S!=="In-Progress"||I!=="Completed"&&b!=="Completed"||a?.zeniSessionId==null||o==null||(n!=null&&r.saveLastUsedMagicLinkToken(n),r.saveSignedInUserWithSession(a,a.zeniSessionId),r.saveSignedInUserTenants(H(k.tenantsInOrder),a.zeniSessionId),J(a.userId,a.zeniSessionId,o.tenantId),t(K(o.tenantId)),r.saveActiveTenantDomainForUser(o.tenantEmailDomain),t(Q("Completed")),V.updateAppLocaleID(ie(o)),se(a,o,v,void 0,k.tenantsInOrder),Y().then(()=>{const e=W();e!=null&&A(e)}),setTimeout(()=>{N.trackLogin(R.Event.loginSuccess,"email",Z(o.productSettings))},2e3))},[S,I,b,a,o,k,v,s.state,t]);const F=f.useCallback(()=>{m("/signin/auth")},[m]),j=f.useCallback(()=>{i!=null&&d!=null&&c!=null&&t(ee(i,c,d))},[i,d,t,c]),O=f.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($,{phoneNumber:x,verifyOtpFetchState:z.fetchState,resendVerifyDeviceOTPFetchState:C,onResendOtp:j,onVerifyOtp:O,onCancelVerifyDevice:F});if(S==="In-Progress"&&I==="Completed"&&a?.zeniSessionId!=null&&o!=null||E!=null){const e=s.state?.origin??"/";return u.jsx(T,{to:e,state:{...s.state,origin:""}})}if(!D(n,p)||g==null||h==="Error"){const e=s.state?.origin??"/",L=n!=null&&r.getLastUsedMagicLinkToken()===n;return u.jsx(T,{to:e,state:{...s.state,origin:"",magicLinkAlreadyUsed:L,magicLinkExpired:!L&&(r.isMagicLinkTriggered(n??"")||h==="Error"&&a?.zeniSessionId==null)}})}return u.jsx(oe,{"data-testid":"smooth-loader",children:u.jsx(q,{size:"ExtraLarge",start:!0})})}const oe=ne.div`
1
+ import{j as u}from"./liveblocks-Cqbf2YvG.js";import{a as f}from"./sentry-gLPXz4Yq.js";import{h as U,u as _,j as w,q as M,g as l,N as T}from"./core-DZE88rLA.js";import{z as r,m as P,D as V,e as A,d as N,f as R,X as $,$ as q,g as W}from"./index-BET54Nt-.js";import{eM as X,I0 as B,Ib as G,I1 as H,eN as J,fi as K,I7 as Q,fF as Y,cR as Z,Ic as ee,Id as te}from"./zeni-epic-state-Cc2P4FPR.js";import{n as ne}from"./mui-B4xUUoCx.js";import{u as ae}from"./useDeviceId-CMDzs7Gm.js";import{f as se}from"./analyticsHelper-BTOyHFla.js";import{t as ie}from"./getLocaleForTenant-CPndpwIp.js";import"./recharts-3_XOsuaw.js";import"./lottie-BMcMDJUW.js";import"./analytics-Cp5F-UjF.js";import"./plaid-G98kqTnM.js";import"./dnd-B4DEM2bW.js";import"./stripe-DMRn4zHo.js";import"./lexical-Bp_BNV6r.js";import"./pdf-DYKlsr3c.js";import"./utils-oW6HiHsc.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]="a2ce110d-adaf-44fc-a748-8a642d44a263",t._sentryDebugIdIdentifier="sentry-dbid-a2ce110d-adaf-44fc-a748-8a642d44a263")}catch{}})();const D=(t,s)=>t!=null&&t.length>0&&s==="magic_links";function De(){const t=U(),s=_(),m=w(),[y]=M(),n=y.get("token"),p=y.get("stytch_token_type"),g=r.getMagicLinkCodeVerifier(),i=ae(),{otpChallenge:d,twoFAPhoneNumber:x,magicLinkEmail:c,verifyDeviceFetchState:z,resendVerifyDeviceOTPFetchState:C}=l(e=>e.tenantState),I=l(e=>e.tenantState.fetchState),b=l(e=>e.tenantState.activeTenantFetchState.fetchState),S=l(e=>e.tenantState.signInState),h=l(e=>e.tenantState.magicLinkSignInFetchState.fetchState),a=l(e=>e.tenantState.loggedInUser),o=l(e=>X(e)),k=l(e=>B(e)),E=r.getSignedInUser(),v=P().mode;f.useEffect(()=>{a?.zeniSessionId==null&&n!=null&&D(n,p)&&i!=null&&g!=null&&(r.saveMagicLinkTriggered(n),t(G(n,i,g)))},[n,p,t,i,g,a?.zeniSessionId]),f.useEffect(()=>{S!=="In-Progress"||I!=="Completed"&&b!=="Completed"||a?.zeniSessionId==null||o==null||(n!=null&&r.saveLastUsedMagicLinkToken(n),r.saveSignedInUserWithSession(a,a.zeniSessionId),r.saveSignedInUserTenants(H(k.tenantsInOrder),a.zeniSessionId),J(a.userId,a.zeniSessionId,o.tenantId),t(K(o.tenantId)),r.saveActiveTenantDomainForUser(o.tenantEmailDomain),t(Q("Completed")),V.updateAppLocaleID(ie(o)),se(a,o,v,void 0,k.tenantsInOrder),Y().then(()=>{const e=W();e!=null&&A(e)}),setTimeout(()=>{N.trackLogin(R.Event.loginSuccess,"email",Z(o.productSettings))},2e3))},[S,I,b,a,o,k,v,s.state,t]);const F=f.useCallback(()=>{m("/signin/auth")},[m]),j=f.useCallback(()=>{i!=null&&d!=null&&c!=null&&t(ee(i,c,d))},[i,d,t,c]),O=f.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($,{phoneNumber:x,verifyOtpFetchState:z.fetchState,resendVerifyDeviceOTPFetchState:C,onResendOtp:j,onVerifyOtp:O,onCancelVerifyDevice:F});if(S==="In-Progress"&&I==="Completed"&&a?.zeniSessionId!=null&&o!=null||E!=null){const e=s.state?.origin??"/";return u.jsx(T,{to:e,state:{...s.state,origin:""}})}if(!D(n,p)||g==null||h==="Error"){const e=s.state?.origin??"/",L=n!=null&&r.getLastUsedMagicLinkToken()===n;return u.jsx(T,{to:e,state:{...s.state,origin:"",magicLinkAlreadyUsed:L,magicLinkExpired:!L&&(r.isMagicLinkTriggered(n??"")||h==="Error"&&a?.zeniSessionId==null)}})}return u.jsx(oe,{"data-testid":"smooth-loader",children:u.jsx(q,{size:"ExtraLarge",start:!0})})}const oe=ne.div`
2
2
  position: fixed;
3
3
  top: 0;
4
4
  left: 0;