@zeniai/web-app-ui 5.0.88-qa → 5.0.89-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 (118) hide show
  1. package/dist/assets/AddressRoutes-SY-dhjP_.js +1 -0
  2. package/dist/assets/{AddressScreen-h6F8nVYN.js → AddressScreen-Ctnukryb.js} +2 -2
  3. package/dist/assets/{AiCfoScreen-OLwbmiYD.js → AiCfoScreen-Dwnx3Zrg.js} +3 -3
  4. package/dist/assets/{BillPayApprovalRoutes-DsjRockq.js → BillPayApprovalRoutes-DWpeCKQ1.js} +1 -1
  5. package/dist/assets/{BillPayRoutes-YTAReJ2c.js → BillPayRoutes-CEWNKd4a.js} +10 -10
  6. package/dist/assets/{BusinessVerificationPageScreen-Cjm5MRXi.js → BusinessVerificationPageScreen-BFP865c-.js} +2 -2
  7. package/dist/assets/{ChargeCardRoutes-DBNrni6V.js → ChargeCardRoutes-DmmGBEVb.js} +8 -8
  8. package/dist/assets/{CompanyPassportScreen-Wc9Neaz1.js → CompanyPassportScreen-CUrTGAPx.js} +1 -1
  9. package/dist/assets/{ConnectionAuthScreen-gAh9UaQG.js → ConnectionAuthScreen-BAkm3SD5.js} +1 -1
  10. package/dist/assets/CustomerOnboardingAuthScreen-BmBMaCZh.js +1 -0
  11. package/dist/assets/{CustomerOnboardingRoutes-CbCcHxCy.js → CustomerOnboardingRoutes-DQC5OT_-.js} +3 -3
  12. package/dist/assets/{DashboardRoutes-DFf2imko.js → DashboardRoutes-DjR4FttM.js} +1 -1
  13. package/dist/assets/{DefaultTenantHome-Bx6WQ-Mz.js → DefaultTenantHome-BXapS7K_.js} +1 -1
  14. package/dist/assets/{DomesticWireDetailScreen-w4AIyMqf.js → DomesticWireDetailScreen-CluJV1hP.js} +3 -3
  15. package/dist/assets/DrawerScreen-DTfCd2en.js +1 -0
  16. package/dist/assets/EntityDetailRoutes-CjmHAAQ4.js +1 -0
  17. package/dist/assets/{ExpenseAutomationRoutes-D3kquSUU.js → ExpenseAutomationRoutes-CNlHRTO1.js} +3 -3
  18. package/dist/assets/FeaturePreviewScreen-BWUt3LEA.js +1 -0
  19. package/dist/assets/{HubSpotOAuthCallbackScreen-O6i8xkbo.js → HubSpotOAuthCallbackScreen-CgvAaP1t.js} +1 -1
  20. package/dist/assets/{MagicLinkRoutes-CS6bQmQL.js → MagicLinkRoutes-DTgPyHRi.js} +5 -5
  21. package/dist/assets/MagicLinkSignInScreen-BxKlzsH1.js +12 -0
  22. package/dist/assets/{MobileAppDrawer-CXLCRreY.js → MobileAppDrawer-BLGo796K.js} +1 -1
  23. package/dist/assets/NotFoundScreen-B1k_jOem.js +1 -0
  24. package/dist/assets/{NotificationRoutes-DvQQ7oaR.js → NotificationRoutes-yUtgb6NE.js} +1 -1
  25. package/dist/assets/OAuthConsentScreen-DSPFHGna.js +1 -0
  26. package/dist/assets/{PandLWithForecastRoutes-BO50q4p1.js → PandLWithForecastRoutes-C5G3jn5O.js} +1 -1
  27. package/dist/assets/PeopleRoutes-DG9PRPQo.js +22 -0
  28. package/dist/assets/PerformanceRoutes-CdqCJZzN.js +1 -0
  29. package/dist/assets/{Preview-D9U0nUr-.js → Preview-BT6vM7mS.js} +1 -1
  30. package/dist/assets/{QBOConnectionScreen-CvW4YyLY.js → QBOConnectionScreen-jmt8kh8_.js} +1 -1
  31. package/dist/assets/{ReferralListScreen-B6ywI0R7.js → ReferralListScreen-BKwWhmDP.js} +2 -2
  32. package/dist/assets/{ReimbursementApprovalRoutes-BJfS22O6.js → ReimbursementApprovalRoutes-DXxXV9_W.js} +1 -1
  33. package/dist/assets/{ReimbursementApprovalRuleDetailScreen-BRDzYwiP.js → ReimbursementApprovalRuleDetailScreen-DtFME-kz.js} +1 -1
  34. package/dist/assets/{ReimbursementRoutes-DprHryRK.js → ReimbursementRoutes-q-LM-3Mz.js} +7 -7
  35. package/dist/assets/{ReportsRoutes-DtUGaRZb.js → ReportsRoutes-DZjJw2so.js} +1 -1
  36. package/dist/assets/RewardsRoutes-D41cXIrP.js +1 -0
  37. package/dist/assets/{ScreenRoutes-Bm0blHDU.js → ScreenRoutes-DrDg9CqO.js} +2 -2
  38. package/dist/assets/{SettingsRoutes-BPx3mV39.js → SettingsRoutes-D7DVrB_r.js} +1 -1
  39. package/dist/assets/{SetupPagesScreen-DAXpkujH.js → SetupPagesScreen-1j44PFay.js} +5 -5
  40. package/dist/assets/SignInScreen-CNbjT65A.js +1 -0
  41. package/dist/assets/SignOutScreen-CkVX4P52.js +9 -0
  42. package/dist/assets/{TaskListScreen-CD0yo2G_.js → TaskListScreen-BMzXb3Gv.js} +2 -2
  43. package/dist/assets/{TaskRoutes-Eq8lUPTt.js → TaskRoutes-D5ysh0Fw.js} +2 -2
  44. package/dist/assets/TransactionDetailRoutes-BLkvSFsR.js +1 -0
  45. package/dist/assets/TransactionDetailScreen-AbBGaDF8.js +5 -0
  46. package/dist/assets/{TransactionListRoutes-Dhb4M-FX.js → TransactionListRoutes-CWiHUsRg.js} +1 -1
  47. package/dist/assets/{TreasuryRoutes-DzA3TiDm.js → TreasuryRoutes-CocKL-Oj.js} +6 -6
  48. package/dist/assets/{VendorsRoutes-B3NL3qG7.js → VendorsRoutes-a2NCvCPG.js} +1 -1
  49. package/dist/assets/WiseConfirmationScreen-DZiJs9hh.js +12 -0
  50. package/dist/assets/{ZeniAccountRoutes-CaEKevKl.js → ZeniAccountRoutes-CEygLs18.js} +11 -11
  51. package/dist/assets/ZeniAccountStatementScreen-DLVOSwmC.js +9 -0
  52. package/dist/assets/{accountMappingHelper-9C6A5WnC.js → accountMappingHelper-BEJScFAE.js} +1 -1
  53. package/dist/assets/{analytics-B6udoEJT.js → analytics-CQQ1PG0J.js} +1 -1
  54. package/dist/assets/{analyticsHelper-DjIWqwJH.js → analyticsHelper-COFNU8CP.js} +1 -1
  55. package/dist/assets/{core-Bv8kdUko.js → core-DSsu1iyO.js} +1 -1
  56. package/dist/assets/{decodeURIComponentSafe-DeA-_wid.js → decodeURIComponentSafe-CRFR6Y3w.js} +1 -1
  57. package/dist/assets/{dnd-BIjMGuxw.js → dnd-Dok8dils.js} +1 -1
  58. package/dist/assets/{empty-B0o7u5U9.js → empty-CXjJmklp.js} +1 -1
  59. package/dist/assets/{empty-C0aR76s7.js → empty-UNMNFw7c.js} +1 -1
  60. package/dist/assets/{emptyVideoElement-CqIIeTnM.js → emptyVideoElement-tnzUOnbb.js} +1 -1
  61. package/dist/assets/{epic-CrvsC-s7.js → epic-D1i_boOy.js} +1 -1
  62. package/dist/assets/getLocaleForTenant-OYWr98Zl.js +1 -0
  63. package/dist/assets/{index-CQwJaifa.js → index-487NRPOP.js} +1 -1
  64. package/dist/assets/{index-BrmBaZjz.js → index-C20sBDka.js} +1 -1
  65. package/dist/assets/{index-DMNy_OK4.js → index-CCRUu3yu.js} +1 -1
  66. package/dist/assets/{index-BIwQAhFv.js → index-CPG6ITBm.js} +12068 -12060
  67. package/dist/assets/{index-D40kV0u0.js → index-CZgOkU7x.js} +1 -1
  68. package/dist/assets/{index-BUMFvFkQ.js → index-D3BIveAC.js} +2 -2
  69. package/dist/assets/{index-DdfWbiyW.js → index-XYg74ieW.js} +1 -1
  70. package/dist/assets/{index-CR9MozHS.js → index-mSdseThw.js} +1 -1
  71. package/dist/assets/{lexical-DOh49tNP.js → lexical-DO7p5ZXM.js} +1 -1
  72. package/dist/assets/{liveblocks-CCyJOwfy.js → liveblocks-D0ylGz77.js} +1 -1
  73. package/dist/assets/{lottie-DL8N42Il.js → lottie-Cu765PFn.js} +1 -1
  74. package/dist/assets/{mui-DtV_yZlj.js → mui-D9TDAUAO.js} +1 -1
  75. package/dist/assets/{pathToGoBack-CiuHSsDX.js → pathToGoBack-Ce7z8Bpw.js} +1 -1
  76. package/dist/assets/{pdf-BcmiSEKK.js → pdf-BzjCkfw3.js} +4 -4
  77. package/dist/assets/{pdf-lib-BnpCaznF.js → pdf-lib-DbsQH8ti.js} +1 -1
  78. package/dist/assets/{plaid--kCGp3zU.js → plaid-mYHRXlz3.js} +1 -1
  79. package/dist/assets/{pusher-BZDRaBu6.js → pusher-CY3dj9Ss.js} +1 -1
  80. package/dist/assets/{react-NMjvDQu7.js → react-BojljME6.js} +1 -1
  81. package/dist/assets/{react-CWO8W_RV.js → react-CjbzpIkI.js} +1 -1
  82. package/dist/assets/{react-tOJ0kYjj.js → react-D0Ns4Dzp.js} +1 -1
  83. package/dist/assets/{react-qXC97Fzp.js → react-DMOHZggG.js} +1 -1
  84. package/dist/assets/{react-7pVctLTA.js → react-D_kzyj8R.js} +1 -1
  85. package/dist/assets/{react-C-ieYYjZ.js → react-Doh3QE1A.js} +1 -1
  86. package/dist/assets/{recharts-DdIjbBfI.js → recharts-C7IODwRw.js} +1 -1
  87. package/dist/assets/{routePaths-BjY4Hbs8.js → routePaths-1uJ5ric0.js} +1 -1
  88. package/dist/assets/{sentry-Wnm-N8eT.js → sentry-C5UCCkb_.js} +1 -1
  89. package/dist/assets/{url-BIDr3jsK.js → url-BVj9PytH.js} +1 -1
  90. package/dist/assets/{url-BmD3S9u5.js → url-Bow-X1Kk.js} +1 -1
  91. package/dist/assets/useAskAiCfoHostNavButtonProps-DaoVDdk6.js +1 -0
  92. package/dist/assets/{useDeviceId-Bi73VT1N.js → useDeviceId-CD8u4vjr.js} +1 -1
  93. package/dist/assets/{useFetchSuggestedQuestionsWhenReady-BWzQNqoL.js → useFetchSuggestedQuestionsWhenReady-IH_yzaTd.js} +1 -1
  94. package/dist/assets/{useInitialThreadRequest-D1wLkM4c.js → useInitialThreadRequest-C_MqgvcA.js} +1 -1
  95. package/dist/assets/{utils-CRtSAyQU.js → utils-Cd1icpH6.js} +1 -1
  96. package/dist/assets/{withTransactionSidePanel-NOFN_NLa.js → withTransactionSidePanel-xau0uwsY.js} +1 -1
  97. package/dist/assets/{zeni-epic-state-CIBk9-EN.js → zeni-epic-state-CFQMpWBE.js} +3 -3
  98. package/dist/index.html +1 -1
  99. package/package.json +2 -2
  100. package/dist/assets/AddressRoutes-Djzm4hjd.js +0 -1
  101. package/dist/assets/CustomerOnboardingAuthScreen-Btu05i4h.js +0 -1
  102. package/dist/assets/DrawerScreen-CtmWzT0D.js +0 -1
  103. package/dist/assets/EntityDetailRoutes-BQF2uQ7X.js +0 -1
  104. package/dist/assets/FeaturePreviewScreen-dlYgctun.js +0 -1
  105. package/dist/assets/MagicLinkSignInScreen-aL0UHXqm.js +0 -12
  106. package/dist/assets/NotFoundScreen-D1-E1kBF.js +0 -1
  107. package/dist/assets/OAuthConsentScreen-BX4BwxWb.js +0 -1
  108. package/dist/assets/PeopleRoutes-CAjCGUS6.js +0 -22
  109. package/dist/assets/PerformanceRoutes-DuMTUSdQ.js +0 -1
  110. package/dist/assets/RewardsRoutes-Du6Z6CYq.js +0 -1
  111. package/dist/assets/SignInScreen-D_ZIzo4l.js +0 -1
  112. package/dist/assets/SignOutScreen-CyHjoyPO.js +0 -9
  113. package/dist/assets/TransactionDetailRoutes-B0zPxUO6.js +0 -1
  114. package/dist/assets/TransactionDetailScreen-Cffx3kdg.js +0 -5
  115. package/dist/assets/WiseConfirmationScreen-CcQUprGd.js +0 -12
  116. package/dist/assets/ZeniAccountStatementScreen-CsjbaEOP.js +0 -9
  117. package/dist/assets/getLocaleForTenant-lJA2tHmd.js +0 -1
  118. package/dist/assets/useAskAiCfoHostNavButtonProps-DHofygYw.js +0 -1
@@ -1,4 +1,4 @@
1
- import{j as a}from"./liveblocks-CCyJOwfy.js";import{t as Ke,A as Ce}from"./AddressScreen-h6F8nVYN.js";import $e from"./NotFoundScreen-D1-E1kBF.js";import{a as g}from"./sentry-Wnm-N8eT.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 Me,o as z}from"./core-Bv8kdUko.js";import{w as de,T as le,z as B,C as ue,m as qe,A as _,v as V,S as J,c as N,B as we,e as X,am as Qe,K as Ze,an as ke,h as te,ao as He,ap as Ie,o as Je,aq as We,ar as Ee,as as Xe}from"./index-BIwQAhFv.js";import{bn as Ye,eR as ee,fe as et,eX as pe,eV as me,bv as tt,mR as at,fa as nt,bO as ot,jf as ae,ji as ve,JP as st,bT as it,c2 as ge,sn as he,s8 as rt,Kj as Y,so as _e,HH as ct,kj as Ue,Kk as Ve,Kl as dt,Km as lt,Kn as ut,jd as pt,jg as mt,sa as Be,sm as gt,bE as Te,cv as ht,sA as xe,qa as ft,p_ as yt,kb as St,fD as bt,fC as Ct,fB as kt,Ko as It,s2 as Et,sB as Tt,sE as xt,sH as Ot,sN as Pt,cU as At}from"./zeni-epic-state-CIBk9-EN.js";import{n as fe}from"./mui-DtV_yZlj.js";import{g as Dt,h as Ft,q as ne}from"./QBOConnectionScreen-CvW4YyLY.js";import"./recharts-DdIjbBfI.js";import"./analytics-B6udoEJT.js";import"./plaid--kCGp3zU.js";import"./dnd-BIjMGuxw.js";import"./stripe-DMRn4zHo.js";import"./lottie-DL8N42Il.js";import"./lexical-DOh49tNP.js";import"./pdf-BcmiSEKK.js";import"./utils-CRtSAyQU.js";import"./empty-B0o7u5U9.js";import"./pdf-lib-BnpCaznF.js";import"./index-DdfWbiyW.js";import"./url-BmD3S9u5.js";import"./index-D40kV0u0.js";import"./decodeURIComponentSafe-DeA-_wid.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]="39c914c0-d2f5-4b30-9992-8214833bd404",t._sentryDebugIdIdentifier="sentry-dbid-39c914c0-d2f5-4b30-9992-8214833bd404")}catch{}})();const jt=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),wt=()=>{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(),h=Ye(i),{useFeatureGate:m}=ue(),I=qe(),{isFeatureEnabled:T}=m(_.isApAgingFeatureEnabled),{isFeatureEnabled:x}=m(_.isArAgingFeatureEnabled),{isFeatureEnabled:k}=m(_.isDepositAccountsFeatureEnabled),{isFeatureEnabled:f}=m(_.isReferralFeatureEnabled),{isFeatureEnabled:U}=m(_.isExpenseAutomationEnabled),{isFeatureEnabled:C}=m(_.isExpenseAutomationEnabledV2),{isFeatureEnabled:F}=m(_.isDebitCardFeatureEnabled),K=C||U&&h,c=D(l=>ee(l)),{isFeatureEnabled:L}=m(_.isTreasuryEnabled),j=c.company!=null&&et(c.company),R=L&&j,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 w=pe(F,c),P=me(c),A=[],Q=b?.resources?.find(l=>l.resource==="/reports/top_expenses")==null,$=b?.resources?.find(l=>l.resource==="/reports/task_card")==null,M=c?.userRole!=null&&tt(c?.userRole),v=b?.resources?.find(l=>l.resource==="/bills")==null&&!M,q=b?.resources?.find(l=>l.resource==="/reimbursements")==null;if(Q===!1&&A.push("top_expenses"),$===!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"),k===!1&&A.push("zeni_accounts_promo_card"),f===!1&&A.push("rewards_card"),g.useEffect(()=>{O!=="Completed"||d||w||P||(r(!0),s(at(i.userId,G,c.tenantId,!0,!1,A)))},[d,O,w,P,i,c.tenantId,s]),g.useEffect(()=>{(w||P)&&setTimeout(()=>{S(!0)},5e3)},[w,P]),O!=="Completed")return a.jsx(E,{to:"../"});if(O==="Completed"&&p){const l=V(o.state?.pathnameStackToGoBack,o.pathname);if(w)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(J,{analytics:N,onLoad:l=>(Z=>Z.trackPageLoaded(X.Event.onboardingDashboardActivation))(l)}),a.jsx(jt,{navigate:t,location:o,themeState:u,signedInUser:i,isApAgingFeatureEnabled:T,isArAgingFeatureEnabled:x,shouldFetchZeniAccountsPromoCard:k,shouldFetchRewardsPlanCard:f,isExpenseAutomationEnabledForUser:K,isExpenseAutomationFeatureEnabledV2:C,isTreasuryEnabled:R,loggedInUserRoleMap:n?.loggedInUserRoleMap})]}):a.jsx(we,{fetchState:"In-Progress",style:{backgroundColor:I.colors.grey5}})},Oe=fe.div`
1
+ import{j as a}from"./liveblocks-D0ylGz77.js";import{t as Ke,A as Ce}from"./AddressScreen-Ctnukryb.js";import $e from"./NotFoundScreen-B1k_jOem.js";import{a as g}from"./sentry-C5UCCkb_.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 Me,o as z}from"./core-DSsu1iyO.js";import{I as de,c as le,z as B,C as ue,m as qe,A as _,s as V,x as J,d as N,B as we,f as X,am as Qe,K as Ze,an as ke,j as te,ao as He,ap as Ie,o as Je,aq as We,ar as Ee,as as Xe}from"./index-CPG6ITBm.js";import{bn as Ye,eR as ee,fe as et,eX as pe,eV as me,bv as tt,mR as at,fa as nt,bO as ot,jf as ae,ji as ve,JP as st,bT as it,c2 as ge,sn as he,s8 as rt,Kj as Y,so as _e,HH as ct,kj as Ue,Kk as Ve,Kl as dt,Km as lt,Kn as ut,jd as pt,jg as mt,sa as Be,sm as gt,bE as Te,cv as ht,sA as xe,qa as ft,p_ as yt,kb as bt,fD as St,fC as Ct,fB as kt,Ko as It,s2 as Et,sB as Tt,sE as xt,sH as Ot,sN as Pt,cU as At}from"./zeni-epic-state-CFQMpWBE.js";import{n as fe}from"./mui-D9TDAUAO.js";import{g as Dt,h as Ft,q as ne}from"./QBOConnectionScreen-jmt8kh8_.js";import"./recharts-C7IODwRw.js";import"./analytics-CQQ1PG0J.js";import"./plaid-mYHRXlz3.js";import"./dnd-Dok8dils.js";import"./stripe-DMRn4zHo.js";import"./lottie-Cu765PFn.js";import"./lexical-DO7p5ZXM.js";import"./pdf-BzjCkfw3.js";import"./utils-Cd1icpH6.js";import"./empty-CXjJmklp.js";import"./pdf-lib-DbsQH8ti.js";import"./index-XYg74ieW.js";import"./url-Bow-X1Kk.js";import"./index-CZgOkU7x.js";import"./decodeURIComponentSafe-CRFR6Y3w.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]="497c161b-9636-439b-826a-92fe54535a50",t._sentryDebugIdIdentifier="sentry-dbid-497c161b-9636-439b-826a-92fe54535a50")}catch{}})();const jt=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),wt=()=>{const t=oe(),o=se(),s=ie(),u=de(),[d,r]=g.useState(!1),[p,b]=g.useState(!1),{tenantEmailDomain:e}=re(),n=le(),i=B.getSignedInUser(),h=Ye(i),{useFeatureGate:m}=ue(),I=qe(),{isFeatureEnabled:T}=m(_.isApAgingFeatureEnabled),{isFeatureEnabled:x}=m(_.isArAgingFeatureEnabled),{isFeatureEnabled:k}=m(_.isDepositAccountsFeatureEnabled),{isFeatureEnabled:f}=m(_.isReferralFeatureEnabled),{isFeatureEnabled:U}=m(_.isExpenseAutomationEnabled),{isFeatureEnabled:C}=m(_.isExpenseAutomationEnabledV2),{isFeatureEnabled:F}=m(_.isDebitCardFeatureEnabled),K=C||U&&h,c=D(l=>ee(l)),{isFeatureEnabled:L}=m(_.isTreasuryEnabled),j=c.company!=null&&et(c.company),R=L&&j,O=D(l=>l.onboardingCustomerViewState.fetchState),S=c.excludedResources,G=c.companyId??B.getSignedInUserTenant(e)?.companyId;if(i==null)throw Error("Can't access onboarding flow without signing in...");const w=pe(F,c),P=me(c),A=[],Q=S?.resources?.find(l=>l.resource==="/reports/top_expenses")==null,$=S?.resources?.find(l=>l.resource==="/reports/task_card")==null,M=c?.userRole!=null&&tt(c?.userRole),v=S?.resources?.find(l=>l.resource==="/bills")==null&&!M,q=S?.resources?.find(l=>l.resource==="/reimbursements")==null;if(Q===!1&&A.push("top_expenses"),$===!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"),k===!1&&A.push("zeni_accounts_promo_card"),f===!1&&A.push("rewards_card"),g.useEffect(()=>{O!=="Completed"||d||w||P||(r(!0),s(at(i.userId,G,c.tenantId,!0,!1,A)))},[d,O,w,P,i,c.tenantId,s]),g.useEffect(()=>{(w||P)&&setTimeout(()=>{b(!0)},5e3)},[w,P]),O!=="Completed")return a.jsx(E,{to:"../"});if(O==="Completed"&&p){const l=V(o.state?.pathnameStackToGoBack,o.pathname);if(w)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(J,{analytics:N,onLoad:l=>(Z=>Z.trackPageLoaded(X.Event.onboardingDashboardActivation))(l)}),a.jsx(jt,{navigate:t,location:o,themeState:u,signedInUser:i,isApAgingFeatureEnabled:T,isArAgingFeatureEnabled:x,shouldFetchZeniAccountsPromoCard:k,shouldFetchRewardsPlanCard:f,isExpenseAutomationEnabledForUser:K,isExpenseAutomationFeatureEnabledV2:C,isTreasuryEnabled:R,loggedInUserRoleMap:n?.loggedInUserRoleMap})]}):a.jsx(we,{fetchState:"In-Progress",style:{backgroundColor:I.colors.grey5}})},Oe=fe.div`
2
2
  display: flex;
3
3
  height: 100vh;
4
4
  background-color: ${t=>t.theme.colors.grey4};
@@ -16,8 +16,8 @@ import{j as a}from"./liveblocks-CCyJOwfy.js";import{t as Ke,A as Ce}from"./Addre
16
16
  }
17
17
 
18
18
  ${t=>t.windowSize!=="small"?"overflow: auto;":""}
19
- `,Ae=ce(function(t,o){const{companyId:s,isAdmin:u,currentTenant:d,isOnAddressPage:r}=o,p=B.getSignedInUser(),S=d.tenantId,e={userId:p?.userId??"",sessionId:p?.zeniSessionId??"",tenantId:S??""},n=ee(t),i=he(t,s),h=Ve(t),m=ge(d?.userRole??[])&&i.updateStatus.fetchState!=="In-Progress"?void 0:"readonly",I=dt(t.userRoleConfigState);return{onboardingCustomerView:i,analytics:N,isRefreshingViewInBackground:!1,isDisabled:m,companyTitles:I.companyTitles,connectedAccountProvider:n.company?.featuresActivationInfo.connectedAccountProvider??"",fileProps:{filesEndPoint:We.fileMicroServiceBaseUrl,authParams:e},signedInUser:B.getSignedInUser(),currentTenant:d,isAdmin:u,isOnAddressPage:r,meetingUrl:"https://meetings.hubspot.com/niharn/zeni-onboarding-overview?embed=true",cardPaymentView:h,isCardPaymentPopupOpen:!1,stripeKey:te.stripeKey}},function(t,o){const{companyId:s,currentTenant:u,themeState:d,navigate:r,location:p}=o,{tenantEmailDomain:S}=u;return{onFetchLinkTokenClick:(e,n)=>{t(Pt(e,n))},onEstablishConnectionClick:(e,n)=>{t(Ot(e,n))},onUpdatePaymentAccountStatus:(e,n,i)=>{t(xt(e,n,i))},onUpdatePaymentAccountLoginStatus:(e,n)=>{t(Tt(!1,e,n))},onEstablishConnectionSuccess:()=>{t(Et(s,!0,!1))},handleOnConnectClick:()=>{N.trackOnboardingConnectQBO(),ne.handleClick()},updateQBOPopupState:e=>{t(Y({isQBOPopupOpen:e}))},onCompanyOfficerUpdated:e=>{const n=e.map(i=>{const{officerType:h,userId:m,name:I,email:T,ssn:x,nationalityCountryCode:k,dob:f,phone:U,syncToken:C,selectDocument:F,role:K,ownership:c,isSelectedForVerification:L,userVerificationStatus:j,fileIds:R,isPhoneVerified:O}=i;let b;return F.selectDocumentType==="driverLicense"?b="driving_license":F.selectDocumentType==="passport"?b="passport":F.selectDocumentType==="stateId"?b="id_document":F.selectDocumentType==="ssnCard"&&(b="social_security_card"),{officerType:h,userId:m,firstName:I.firstName,lastName:I.lastName,email:T,ssn:x,nationalityCountryCode:k?.selectedOption!=null?Ee(k.selectedOption):void 0,phone:U,birthday:f!=null?Te(f?.toString()):f,syncToken:C,titleAtCompany:K.selectedOption,ownershipInCompany:c,documentTypeSelectedForVerification:b,isSelectedForVerification:L,userVerificationStatus:j,fileIds:R,additionalDocumentTypesRequestedForVerification:[],additionalSubmittedDocumentsForVerificationFileIds:[],areAdditionalDocumentsRequestedForVerification:!1,areAdditionalDocumentsSubmittedForVerification:!1,isPhoneVerified:O}});t(xe({officers:n}))},onGetOtp:(e,n)=>{t(kt(e,"CustomerOnboarding")),n!=null&&t(It({officerType:n,phone:e}))},onResendOtp:e=>{t(Ct(e,"CustomerOnboarding"))},onVerifyOtp:(e,n)=>{t(bt(e,n,"CustomerOnboarding"))},updateFilesEntity:e=>{t(St({files:e}))},onDeleteFile:e=>{t(yt(e))},onEditFileName:(e,n)=>{t(ft(e,n.split(".")[0]))},onCompanyDetailsChanged:e=>{const{companyDescription:n,companyIndustry:i,companyIndustryType:h,companyLegalName:m,companyTaxId:I,companyWebsite:T,companyPhone:x,primaryContactEmail:k,primaryContactName:f,primaryContactUserId:U,primaryContactSyncToken:C,syncToken:F,fileIds:K,typeOfIncorporation:c,stateOfIncorporation:L,incDate:j,companySourceOfFunds:R,companySourceOfFundsDescription:O,companySubIndustry:b,countriesOfOperations:G,purposeOfAccount:w,purposeOfAccountDescription:P,regulatedStatus:A,regulatedStatusDescription:Q,transactionVolume:$,transactionVolumeDescription:M,usNexus:v,usNexusTypes:q}=e,l={companyId:s,companyDescription:n,companyIndustry:i.selectedOption,companyIndustryType:h?.selectedOption??"",companyLegalName:m,taxIdOrEIN:I,website:T!=""&&T!=null?ht(T):void 0,phone:x,syncToken:F,fileIds:K,incDate:j!=null?Te(j?.toString()):j,typeOfIncorporation:c?.selectedOption??"",stateOfIncorporation:L?.selectedOption??"",companySourceOfFunds:R?.selectedOption??"",companySourceOfFundsDescription:O,companySubIndustry:b?.selectedOption??"",countriesOfOperations:G?.selectedOptions.map(H=>H.length===2?H:Ee(H))??[],purposeOfAccount:w?.selectedOption??"",purposeOfAccountDescription:P,regulatedStatus:A??"",regulatedStatusDescription:Q,transactionVolume:$?.selectedOption??"",transactionVolumeDescription:M,usNexus:v,usNexusTypes:q?.selectedOptions??[]},Z={userId:U,firstName:f.firstName,lastName:f.lastName,email:k,syncToken:C};t(xe({companyDetails:l,primaryContactDetails:Z}))},onAddressClick:(e,n)=>{const i=De(S,e,n),h=V(p.state?.pathnameStackToGoBack,p.pathname);r(i,{state:{pathnameStackToGoBack:h}})},onRegisteredAddressClick:(e,n)=>{const i=De(S,e,n),h=V(p.state?.pathnameStackToGoBack,p.pathname);r(i,{state:{pathnameStackToGoBack:h}})},onUpdateCustomerView:(e,n,i)=>{t(gt(s,!1,n,i,e))},onAddressEditHandler:e=>{if(e!=null){const n=Ke(e);t(Ue({addressType:"subscription_billing_address",addressToCreate:n}))}},onSkipSetupClick:()=>{const e=V(p.state?.pathnameStackToGoBack,p.pathname);t(Be(s,!1,!1)),r("./activation",{state:{pathnameStackToGoBack:e}})},onUpdateStep:e=>{t(_e({step:e}))},onZeniLogoClick:()=>{d.toggle()},handleLogOutClick:()=>{const e=V(p.state?.pathnameStackToGoBack,p.pathname);r("/signout",{replace:!0,state:{pathnameStackToGoBack:e,message:"logout"}})},handleCockpitClick:()=>{window.open("/cockpit")},handleCreateCardSetupIntent:e=>{t(ve(e))},handleConfirmCardSetupIntent:e=>{t(mt(e))},updateCardPaymentModalState:e=>{t(Y({isCardPaymentPopupOpen:e}))},handleAddCardPaymentSource:(e,n,i)=>{t(pt(e,n,i))},handleFetchPaymentSources:()=>{t(ae())},resetCardPaymentViewState:()=>{t(ut())},handleResetCardPaymentErrorStatuses:()=>{t(lt())},redirectToProductSuitePage:()=>{const e=V(p.state?.pathnameStackToGoBack,p.pathname);r(`/${S}/onboarding/thankyou`,{state:{pathnameStackToGoBack:e,message:"OnboardingThankyou"},replace:!0})}}})(He),W=({taxCFOCustomer:t=!1,isOnAddressPage:o=!1,appContent:s})=>{const u=oe(),d=se(),r=ie(),p=Ze(),S=de(),[e,n]=g.useState(!1),[i,h]=g.useState(!1),[m,I]=g.useState(!1),{tenantEmailDomain:T}=re(),x=le(),{useFeatureGate:k}=ue(),{isFeatureEnabled:f}=k(_.isDebitCardFeatureEnabled),U=ze("/:tenantEmailDomain/onboarding")!==null&&d.search?.includes("code"),C=D(y=>y.onboardingCustomerViewState.fetchState),F=D(y=>y.onboardingCustomerViewState.currentStep),K=D(y=>y.onboardingCustomerViewState.uiState),c=D(y=>ee(y)),L=D(y=>y.userRoleConfigState.fetchState),j=D(y=>y.cardPaymentViewState),R=ke(j.addCardPaymentSourceStatus.fetchState),O=j.addCardPaymentSourceStatus.fetchState,{code:b,realmId:G,state:w}=Dt(d.search),P=c.externalConnections?.accounting[0],A=P?.connectionType,Q=P?.connectionName,$=P?.connectionId??"",M=B.getSignedInUser()?.userId??"";g.useEffect(()=>{i||(h(!0),r(ae()))},[i,r]),g.useEffect(()=>{m||(ve(["card"]),I(!0))},[m]),g.useEffect(()=>{R==="In-Progress"&&O==="Completed"&&r(ae())},[R,O]),g.useEffect(()=>{Ft(b,G,w,$,M)===!0&&c.externalConnections?.saveConnectionState!=="In-Progress"&&C==="Completed"&&(r(st(c.tenantId,{connection_type:A??"accounting",connection_name:Q??"quickbooks_online",authorization_code:b,realm_id:G,connection_id:$,user_id:M},it(window.location.origin+"/onboarding/auth"))),N.trackOnboardingSaveQBOConnection(G,$),u(d.pathname))},[b,G,w,d.pathname,C]),g.useEffect(()=>{ne.isInitiated===!1&&C==="Completed"&&ne.init("/onboarding/auth",c.tenantEmailDomain)},[C]);const v=c.companyId??B.getSignedInUserTenant(T)?.companyId,q=ge(c?.userRole??[]),l=D(y=>he(y,v));g.useEffect(()=>{e||C!=="Not-Started"||v==null||(n(!0),r(rt(v,!0,!U)))},[e,C,v]),g.useEffect(()=>{c.externalConnections?.saveConnectionState!=="Completed"&&c.externalConnections?.saveConnectionState!=="Error"||!K.isQBOPopupOpen||F!=="qbo_connection"||r(Y({isQBOPopupOpen:!1}))},[c.externalConnections?.saveConnectionState]),g.useEffect(()=>{C==="Completed"&&U&&(r(_e({step:"qbo_connection"})),r(Y({isQBOPopupOpen:!0})))},[U,C]),g.useEffect(()=>{L==="Not-Started"&&r(ct(!0))},[L,r]);const Z=ke(l.companyDetailsLocalData?.addressStatus);g.useEffect(()=>{l.companyDetailsLocalData?.registeredAddressStatus?.addressToCreate==null&&l.companyDetailsLocalData?.addressStatus?.addressToCreate!=null&&Z==null&&r(Ue({addressType:"company_registered_address",addressToCreate:l.companyDetailsLocalData?.addressStatus?.addressToCreate}))},[l.companyDetailsLocalData?.addressStatus?.addressToCreate,l.companyDetailsLocalData?.registeredAddressStatus?.addressToCreate]);const H=l.isInterimEmailSent;if(B.getSignedInUser()==null)throw Error("Can't access onboarding flow without signing in...");const Le=pe(f,c),Re=me(c),ye=c.company?.companyOnboardingInfo.isOnboardingCompleted,Se=y=>y.trackPageLoaded(X.Event.onboardingPage),be=c.productSettings.isOtherProductsEnabled,Ge=c.productSettings.isTreasuryEnabled;if(ye===!0){if(!be)return Ge?a.jsx(E,{to:"../../treasury"}):Le?a.jsx(E,{to:"../../checking"}):Re?a.jsx(E,{to:"../../cards"}):a.jsx(E,{to:"../../dashboard"});const y=l.updateStatus.fetchState==="In-Progress";if(be&&!y)return t?a.jsxs(Oe,{children:[a.jsx(J,{analytics:N,onLoad:Ne=>Se(Ne)}),a.jsx(Ae,{navigate:u,location:d,companyId:v,currentTenant:c,isAdmin:q,isOnAddressPage:o,themeState:S,googleAPIKey:te.googleMapsAPIKey}),s!=null?a.jsx(Pe,{windowSize:p,children:s}):null]}):a.jsx(E,{to:"../../onboarding/thankyou"})}else if(ye===!1&&x?.loggedInUserRoleMap!=null)return H===!0?a.jsx(E,{to:"../../onboarding/thankyou"}):a.jsxs(Oe,{children:[a.jsx(J,{analytics:N,onLoad:y=>Se(y)}),a.jsx(Ae,{navigate:u,location:d,companyId:v,currentTenant:c,isAdmin:q,isOnAddressPage:o,themeState:S,googleAPIKey:te.googleMapsAPIKey}),s!=null?a.jsx(Pe,{windowSize:p,children:s}):null]});return null};function De(t,o,s){let u=`/${t}/onboarding/address`;return u=s!=null?u.concat(`/edit/${o}/${encodeURIComponent(s)}`):u.concat(`/new/${o}`),u}const Fe=fe.div`
19
+ `,Ae=ce(function(t,o){const{companyId:s,isAdmin:u,currentTenant:d,isOnAddressPage:r}=o,p=B.getSignedInUser(),b=d.tenantId,e={userId:p?.userId??"",sessionId:p?.zeniSessionId??"",tenantId:b??""},n=ee(t),i=he(t,s),h=Ve(t),m=ge(d?.userRole??[])&&i.updateStatus.fetchState!=="In-Progress"?void 0:"readonly",I=dt(t.userRoleConfigState);return{onboardingCustomerView:i,analytics:N,isRefreshingViewInBackground:!1,isDisabled:m,companyTitles:I.companyTitles,connectedAccountProvider:n.company?.featuresActivationInfo.connectedAccountProvider??"",fileProps:{filesEndPoint:We.fileMicroServiceBaseUrl,authParams:e},signedInUser:B.getSignedInUser(),currentTenant:d,isAdmin:u,isOnAddressPage:r,meetingUrl:"https://meetings.hubspot.com/niharn/zeni-onboarding-overview?embed=true",cardPaymentView:h,isCardPaymentPopupOpen:!1,stripeKey:te.stripeKey}},function(t,o){const{companyId:s,currentTenant:u,themeState:d,navigate:r,location:p}=o,{tenantEmailDomain:b}=u;return{onFetchLinkTokenClick:(e,n)=>{t(Pt(e,n))},onEstablishConnectionClick:(e,n)=>{t(Ot(e,n))},onUpdatePaymentAccountStatus:(e,n,i)=>{t(xt(e,n,i))},onUpdatePaymentAccountLoginStatus:(e,n)=>{t(Tt(!1,e,n))},onEstablishConnectionSuccess:()=>{t(Et(s,!0,!1))},handleOnConnectClick:()=>{N.trackOnboardingConnectQBO(),ne.handleClick()},updateQBOPopupState:e=>{t(Y({isQBOPopupOpen:e}))},onCompanyOfficerUpdated:e=>{const n=e.map(i=>{const{officerType:h,userId:m,name:I,email:T,ssn:x,nationalityCountryCode:k,dob:f,phone:U,syncToken:C,selectDocument:F,role:K,ownership:c,isSelectedForVerification:L,userVerificationStatus:j,fileIds:R,isPhoneVerified:O}=i;let S;return F.selectDocumentType==="driverLicense"?S="driving_license":F.selectDocumentType==="passport"?S="passport":F.selectDocumentType==="stateId"?S="id_document":F.selectDocumentType==="ssnCard"&&(S="social_security_card"),{officerType:h,userId:m,firstName:I.firstName,lastName:I.lastName,email:T,ssn:x,nationalityCountryCode:k?.selectedOption!=null?Ee(k.selectedOption):void 0,phone:U,birthday:f!=null?Te(f?.toString()):f,syncToken:C,titleAtCompany:K.selectedOption,ownershipInCompany:c,documentTypeSelectedForVerification:S,isSelectedForVerification:L,userVerificationStatus:j,fileIds:R,additionalDocumentTypesRequestedForVerification:[],additionalSubmittedDocumentsForVerificationFileIds:[],areAdditionalDocumentsRequestedForVerification:!1,areAdditionalDocumentsSubmittedForVerification:!1,isPhoneVerified:O}});t(xe({officers:n}))},onGetOtp:(e,n)=>{t(kt(e,"CustomerOnboarding")),n!=null&&t(It({officerType:n,phone:e}))},onResendOtp:e=>{t(Ct(e,"CustomerOnboarding"))},onVerifyOtp:(e,n)=>{t(St(e,n,"CustomerOnboarding"))},updateFilesEntity:e=>{t(bt({files:e}))},onDeleteFile:e=>{t(yt(e))},onEditFileName:(e,n)=>{t(ft(e,n.split(".")[0]))},onCompanyDetailsChanged:e=>{const{companyDescription:n,companyIndustry:i,companyIndustryType:h,companyLegalName:m,companyTaxId:I,companyWebsite:T,companyPhone:x,primaryContactEmail:k,primaryContactName:f,primaryContactUserId:U,primaryContactSyncToken:C,syncToken:F,fileIds:K,typeOfIncorporation:c,stateOfIncorporation:L,incDate:j,companySourceOfFunds:R,companySourceOfFundsDescription:O,companySubIndustry:S,countriesOfOperations:G,purposeOfAccount:w,purposeOfAccountDescription:P,regulatedStatus:A,regulatedStatusDescription:Q,transactionVolume:$,transactionVolumeDescription:M,usNexus:v,usNexusTypes:q}=e,l={companyId:s,companyDescription:n,companyIndustry:i.selectedOption,companyIndustryType:h?.selectedOption??"",companyLegalName:m,taxIdOrEIN:I,website:T!=""&&T!=null?ht(T):void 0,phone:x,syncToken:F,fileIds:K,incDate:j!=null?Te(j?.toString()):j,typeOfIncorporation:c?.selectedOption??"",stateOfIncorporation:L?.selectedOption??"",companySourceOfFunds:R?.selectedOption??"",companySourceOfFundsDescription:O,companySubIndustry:S?.selectedOption??"",countriesOfOperations:G?.selectedOptions.map(H=>H.length===2?H:Ee(H))??[],purposeOfAccount:w?.selectedOption??"",purposeOfAccountDescription:P,regulatedStatus:A??"",regulatedStatusDescription:Q,transactionVolume:$?.selectedOption??"",transactionVolumeDescription:M,usNexus:v,usNexusTypes:q?.selectedOptions??[]},Z={userId:U,firstName:f.firstName,lastName:f.lastName,email:k,syncToken:C};t(xe({companyDetails:l,primaryContactDetails:Z}))},onAddressClick:(e,n)=>{const i=De(b,e,n),h=V(p.state?.pathnameStackToGoBack,p.pathname);r(i,{state:{pathnameStackToGoBack:h}})},onRegisteredAddressClick:(e,n)=>{const i=De(b,e,n),h=V(p.state?.pathnameStackToGoBack,p.pathname);r(i,{state:{pathnameStackToGoBack:h}})},onUpdateCustomerView:(e,n,i)=>{t(gt(s,!1,n,i,e))},onAddressEditHandler:e=>{if(e!=null){const n=Ke(e);t(Ue({addressType:"subscription_billing_address",addressToCreate:n}))}},onSkipSetupClick:()=>{const e=V(p.state?.pathnameStackToGoBack,p.pathname);t(Be(s,!1,!1)),r("./activation",{state:{pathnameStackToGoBack:e}})},onUpdateStep:e=>{t(_e({step:e}))},onZeniLogoClick:()=>{d.toggle()},handleLogOutClick:()=>{const e=V(p.state?.pathnameStackToGoBack,p.pathname);r("/signout",{replace:!0,state:{pathnameStackToGoBack:e,message:"logout"}})},handleCockpitClick:()=>{window.open("/cockpit")},handleCreateCardSetupIntent:e=>{t(ve(e))},handleConfirmCardSetupIntent:e=>{t(mt(e))},updateCardPaymentModalState:e=>{t(Y({isCardPaymentPopupOpen:e}))},handleAddCardPaymentSource:(e,n,i)=>{t(pt(e,n,i))},handleFetchPaymentSources:()=>{t(ae())},resetCardPaymentViewState:()=>{t(ut())},handleResetCardPaymentErrorStatuses:()=>{t(lt())},redirectToProductSuitePage:()=>{const e=V(p.state?.pathnameStackToGoBack,p.pathname);r(`/${b}/onboarding/thankyou`,{state:{pathnameStackToGoBack:e,message:"OnboardingThankyou"},replace:!0})}}})(He),W=({taxCFOCustomer:t=!1,isOnAddressPage:o=!1,appContent:s})=>{const u=oe(),d=se(),r=ie(),p=Ze(),b=de(),[e,n]=g.useState(!1),[i,h]=g.useState(!1),[m,I]=g.useState(!1),{tenantEmailDomain:T}=re(),x=le(),{useFeatureGate:k}=ue(),{isFeatureEnabled:f}=k(_.isDebitCardFeatureEnabled),U=ze("/:tenantEmailDomain/onboarding")!==null&&d.search?.includes("code"),C=D(y=>y.onboardingCustomerViewState.fetchState),F=D(y=>y.onboardingCustomerViewState.currentStep),K=D(y=>y.onboardingCustomerViewState.uiState),c=D(y=>ee(y)),L=D(y=>y.userRoleConfigState.fetchState),j=D(y=>y.cardPaymentViewState),R=ke(j.addCardPaymentSourceStatus.fetchState),O=j.addCardPaymentSourceStatus.fetchState,{code:S,realmId:G,state:w}=Dt(d.search),P=c.externalConnections?.accounting[0],A=P?.connectionType,Q=P?.connectionName,$=P?.connectionId??"",M=B.getSignedInUser()?.userId??"";g.useEffect(()=>{i||(h(!0),r(ae()))},[i,r]),g.useEffect(()=>{m||(ve(["card"]),I(!0))},[m]),g.useEffect(()=>{R==="In-Progress"&&O==="Completed"&&r(ae())},[R,O]),g.useEffect(()=>{Ft(S,G,w,$,M)===!0&&c.externalConnections?.saveConnectionState!=="In-Progress"&&C==="Completed"&&(r(st(c.tenantId,{connection_type:A??"accounting",connection_name:Q??"quickbooks_online",authorization_code:S,realm_id:G,connection_id:$,user_id:M},it(window.location.origin+"/onboarding/auth"))),N.trackOnboardingSaveQBOConnection(G,$),u(d.pathname))},[S,G,w,d.pathname,C]),g.useEffect(()=>{ne.isInitiated===!1&&C==="Completed"&&ne.init("/onboarding/auth",c.tenantEmailDomain)},[C]);const v=c.companyId??B.getSignedInUserTenant(T)?.companyId,q=ge(c?.userRole??[]),l=D(y=>he(y,v));g.useEffect(()=>{e||C!=="Not-Started"||v==null||(n(!0),r(rt(v,!0,!U)))},[e,C,v]),g.useEffect(()=>{c.externalConnections?.saveConnectionState!=="Completed"&&c.externalConnections?.saveConnectionState!=="Error"||!K.isQBOPopupOpen||F!=="qbo_connection"||r(Y({isQBOPopupOpen:!1}))},[c.externalConnections?.saveConnectionState]),g.useEffect(()=>{C==="Completed"&&U&&(r(_e({step:"qbo_connection"})),r(Y({isQBOPopupOpen:!0})))},[U,C]),g.useEffect(()=>{L==="Not-Started"&&r(ct(!0))},[L,r]);const Z=ke(l.companyDetailsLocalData?.addressStatus);g.useEffect(()=>{l.companyDetailsLocalData?.registeredAddressStatus?.addressToCreate==null&&l.companyDetailsLocalData?.addressStatus?.addressToCreate!=null&&Z==null&&r(Ue({addressType:"company_registered_address",addressToCreate:l.companyDetailsLocalData?.addressStatus?.addressToCreate}))},[l.companyDetailsLocalData?.addressStatus?.addressToCreate,l.companyDetailsLocalData?.registeredAddressStatus?.addressToCreate]);const H=l.isInterimEmailSent;if(B.getSignedInUser()==null)throw Error("Can't access onboarding flow without signing in...");const Le=pe(f,c),Re=me(c),ye=c.company?.companyOnboardingInfo.isOnboardingCompleted,be=y=>y.trackPageLoaded(X.Event.onboardingPage),Se=c.productSettings.isOtherProductsEnabled,Ge=c.productSettings.isTreasuryEnabled;if(ye===!0){if(!Se)return Ge?a.jsx(E,{to:"../../treasury"}):Le?a.jsx(E,{to:"../../checking"}):Re?a.jsx(E,{to:"../../cards"}):a.jsx(E,{to:"../../dashboard"});const y=l.updateStatus.fetchState==="In-Progress";if(Se&&!y)return t?a.jsxs(Oe,{children:[a.jsx(J,{analytics:N,onLoad:Ne=>be(Ne)}),a.jsx(Ae,{navigate:u,location:d,companyId:v,currentTenant:c,isAdmin:q,isOnAddressPage:o,themeState:b,googleAPIKey:te.googleMapsAPIKey}),s!=null?a.jsx(Pe,{windowSize:p,children:s}):null]}):a.jsx(E,{to:"../../onboarding/thankyou"})}else if(ye===!1&&x?.loggedInUserRoleMap!=null)return H===!0?a.jsx(E,{to:"../../onboarding/thankyou"}):a.jsxs(Oe,{children:[a.jsx(J,{analytics:N,onLoad:y=>be(y)}),a.jsx(Ae,{navigate:u,location:d,companyId:v,currentTenant:c,isAdmin:q,isOnAddressPage:o,themeState:b,googleAPIKey:te.googleMapsAPIKey}),s!=null?a.jsx(Pe,{windowSize:p,children:s}):null]});return null};function De(t,o,s){let u=`/${t}/onboarding/address`;return u=s!=null?u.concat(`/edit/${o}/${encodeURIComponent(s)}`):u.concat(`/new/${o}`),u}const Fe=fe.div`
20
20
  display: flex;
21
21
  height: 100vh;
22
22
  background-color: ${t=>t.theme.colors.grey4};
23
- `,je=ce(function(t,o){const{companyId:s,currentTenant:u}=o,d=he(t,s),r=Ve(t);return{hasVerifiedBankAccount:(d.paymentAccount?.providerVerificationStatus?.code?.includes("verified")??!1)||(r.bankAccountsList[0]?.providerVerificationStatus?.code?.includes("verified")??!1),isDisabled:ge(u?.userRole??[])&&d.updateStatus.fetchState!=="In-Progress"?void 0:"readonly",signedInUser:B.getSignedInUser(),currentTenant:u,meetingUrl:"https://meetings.hubspot.com/niharn/zeni-onboarding-overview?embed=true"}},function(t,o){const{currentTenant:s,themeState:u,navigate:d,location:r}=o,{tenantEmailDomain:p}=s;return{onZeniLogoClick:()=>{u.toggle()},handleLogOutClick:()=>{const S=V(r.state?.pathnameStackToGoBack,r.pathname);d("/signout",{replace:!0,state:{pathnameStackToGoBack:S,message:"logout"}})},handleCockpitClick:()=>{window.open("/cockpit")},handleUpdatePaymentAddressDetailClick:()=>{const S=V(r.state?.pathnameStackToGoBack,r.pathname);d(`/${p}/onboarding/billing/edit`,{state:{pathnameStackToGoBack:S,message:"UpdatePaymentAddressDetail"}})}}})(Xe),vt=()=>{const t=oe(),o=ie(),s=se(),u=de(),{useFeatureGate:d}=ue(),{isFeatureEnabled:r}=d(_.isDebitCardFeatureEnabled),{tenantEmailDomain:p}=re(),S=le(),[e,n]=g.useState(!1);g.useEffect(()=>{e===!1&&s.state?.message==="OnboardingThankyou"&&n(!0)},[s.state]);const i=D(f=>ee(f)),h=i.productSettings.isOtherProductsEnabled;g.useEffect(()=>{o(Be(m,!1,!h))},[]);const m=i.companyId??B.getSignedInUserTenant(p)?.companyId;if(S.loggedInUser==null)throw Error("Can't access onboarding flow without signing in...");const I=pe(r,i),T=me(i),x=D(f=>f.onboardingCustomerViewState.updateStatus.fetchState),k=i.company?.companyOnboardingInfo.isOnboardingCompleted;return k!==!0||h?x==="Completed"&&k===!0&&h&&S?.loggedInUserRoleMap!=null?a.jsxs(Fe,{children:[a.jsx(J,{analytics:N,onLoad:f=>{f.trackPageLoaded(X.Event.onboardingLandingPage,"Onboarding",At(i.productSettings))}}),a.jsx(je,{navigate:t,showUpdatePaymentDetailButton:h,location:s,companyId:m,currentTenant:i,themeState:u,isVisitingFirstTime:e})]}):x==="Completed"&&k===!1&&S?.loggedInUserRoleMap!=null?a.jsxs(Fe,{children:[a.jsx(J,{analytics:N,onLoad:f=>{f.trackPageLoaded(X.Event.onboardingInterimPage)}}),a.jsx(je,{navigate:t,showUpdatePaymentDetailButton:h,location:s,companyId:m,currentTenant:i,themeState:u,isVisitingFirstTime:e})]}):a.jsx(we,{fetchState:x}):I?a.jsx(E,{to:"../../checking"}):T?a.jsx(E,{to:"../../cards"}):a.jsx(E,{to:"../../dashboard"})};function oa(){return a.jsxs(Me,{children:[a.jsx(z,{path:"/",element:a.jsx(W,{})}),a.jsx(z,{path:"/billing/edit",element:a.jsx(W,{taxCFOCustomer:!0})}),a.jsx(z,{path:"/thankyou",element:a.jsx(vt,{})}),a.jsx(z,{path:"/activation",element:a.jsx(wt,{})}),a.jsx(z,{path:"/address/edit/:addressType/:addressId",element:a.jsx(W,{isOnAddressPage:!0,appContent:a.jsx(Ce,{})})}),a.jsx(z,{path:"/address/new/:addressType",element:a.jsx(W,{isOnAddressPage:!0,appContent:a.jsx(Ce,{})})}),a.jsx(z,{path:"*",element:a.jsx($e,{})})]})}export{oa as default};
23
+ `,je=ce(function(t,o){const{companyId:s,currentTenant:u}=o,d=he(t,s),r=Ve(t);return{hasVerifiedBankAccount:(d.paymentAccount?.providerVerificationStatus?.code?.includes("verified")??!1)||(r.bankAccountsList[0]?.providerVerificationStatus?.code?.includes("verified")??!1),isDisabled:ge(u?.userRole??[])&&d.updateStatus.fetchState!=="In-Progress"?void 0:"readonly",signedInUser:B.getSignedInUser(),currentTenant:u,meetingUrl:"https://meetings.hubspot.com/niharn/zeni-onboarding-overview?embed=true"}},function(t,o){const{currentTenant:s,themeState:u,navigate:d,location:r}=o,{tenantEmailDomain:p}=s;return{onZeniLogoClick:()=>{u.toggle()},handleLogOutClick:()=>{const b=V(r.state?.pathnameStackToGoBack,r.pathname);d("/signout",{replace:!0,state:{pathnameStackToGoBack:b,message:"logout"}})},handleCockpitClick:()=>{window.open("/cockpit")},handleUpdatePaymentAddressDetailClick:()=>{const b=V(r.state?.pathnameStackToGoBack,r.pathname);d(`/${p}/onboarding/billing/edit`,{state:{pathnameStackToGoBack:b,message:"UpdatePaymentAddressDetail"}})}}})(Xe),vt=()=>{const t=oe(),o=ie(),s=se(),u=de(),{useFeatureGate:d}=ue(),{isFeatureEnabled:r}=d(_.isDebitCardFeatureEnabled),{tenantEmailDomain:p}=re(),b=le(),[e,n]=g.useState(!1);g.useEffect(()=>{e===!1&&s.state?.message==="OnboardingThankyou"&&n(!0)},[s.state]);const i=D(f=>ee(f)),h=i.productSettings.isOtherProductsEnabled;g.useEffect(()=>{o(Be(m,!1,!h))},[]);const m=i.companyId??B.getSignedInUserTenant(p)?.companyId;if(b.loggedInUser==null)throw Error("Can't access onboarding flow without signing in...");const I=pe(r,i),T=me(i),x=D(f=>f.onboardingCustomerViewState.updateStatus.fetchState),k=i.company?.companyOnboardingInfo.isOnboardingCompleted;return k!==!0||h?x==="Completed"&&k===!0&&h&&b?.loggedInUserRoleMap!=null?a.jsxs(Fe,{children:[a.jsx(J,{analytics:N,onLoad:f=>{f.trackPageLoaded(X.Event.onboardingLandingPage,"Onboarding",At(i.productSettings))}}),a.jsx(je,{navigate:t,showUpdatePaymentDetailButton:h,location:s,companyId:m,currentTenant:i,themeState:u,isVisitingFirstTime:e})]}):x==="Completed"&&k===!1&&b?.loggedInUserRoleMap!=null?a.jsxs(Fe,{children:[a.jsx(J,{analytics:N,onLoad:f=>{f.trackPageLoaded(X.Event.onboardingInterimPage)}}),a.jsx(je,{navigate:t,showUpdatePaymentDetailButton:h,location:s,companyId:m,currentTenant:i,themeState:u,isVisitingFirstTime:e})]}):a.jsx(we,{fetchState:x}):I?a.jsx(E,{to:"../../checking"}):T?a.jsx(E,{to:"../../cards"}):a.jsx(E,{to:"../../dashboard"})};function oa(){return a.jsxs(Me,{children:[a.jsx(z,{path:"/",element:a.jsx(W,{})}),a.jsx(z,{path:"/billing/edit",element:a.jsx(W,{taxCFOCustomer:!0})}),a.jsx(z,{path:"/thankyou",element:a.jsx(vt,{})}),a.jsx(z,{path:"/activation",element:a.jsx(wt,{})}),a.jsx(z,{path:"/address/edit/:addressType/:addressId",element:a.jsx(W,{isOnAddressPage:!0,appContent:a.jsx(Ce,{})})}),a.jsx(z,{path:"/address/new/:addressType",element:a.jsx(W,{isOnAddressPage:!0,appContent:a.jsx(Ce,{})})}),a.jsx(z,{path:"*",element:a.jsx($e,{})})]})}export{oa as default};
@@ -1,4 +1,4 @@
1
- import{j as l}from"./liveblocks-CCyJOwfy.js";import{l as z,g as S,u as q,h as $,j as Z,k as Q,s as qa,n as st,o as w}from"./core-Bv8kdUko.js";import{eR as L,KE as Ve,bE as Gt,bq as he,LR as Za,i3 as Ha,LS as wt,LT as Qa,i6 as rt,LU as Le,LV as Xa,ib as Wa,LW as Dt,LX as Ja,ig as it,LY as Ue,LZ as en,cl as lt,L_ as tn,L$ as an,KY as nn,j9 as on,M0 as sn,bn as Te,M1 as Nt,Ks as ae,bc as $t,jn as zt,m$ as Kt,j6 as qt,Ku as ne,Kt as H,f6 as rn,eO as cn,fo as ln,M2 as dn,M3 as un,M4 as Zt,M5 as Se,uh as xe,ui as we,uF as fe,uz as oe,um as De,M6 as mn,M7 as pn,M8 as hn,M9 as Ht,Ma as ye,Mb as fn,dE as Ge,qK as Qt,Mc as gn,Md as bn,Me as Cn,Mf as dt,JR as ut,jD as ge,uN as mt,qS as _n,Mg as kn,uj as Ft,qN as me,qJ as Xt,Mh as ie,Mi as Sn,Mj as pt,JQ as ht,sR as Wt,Mk as yn,Ml as An,Mm as vn,Mn as ft,t2 as En,Mo as In,ul as Ot,sQ as Jt,Mp as ce,Mq as Tn,bv as ea,uR as ta,Mr as xn,Ms as wn,Mt as Dn,Mu as gt,uM as Fn,Mv as On,uk as Pt,uQ as aa,Mw as le,Mx as Pn,My as Mn,Mz as na,js as oa,mY as sa,jx as ra,mW as ia,mV as ca,mU as la,sd as Rn,fe as Bn,cO as jn,cP as Ln,mR as Un,fa as Yn,n6 as Vn,DV as Mt,MA as Gn,MB as Nn,MC as $n,MD as zn,b5 as bt,f1 as Kn,gN as qn,fF as Zn,n0 as Hn,i$ as Qn,mZ as Xn,mX as Wn,eX as Jn,eV as eo}from"./zeni-epic-state-CIBk9-EN.js";import{z as R,Z as X,v as D,c as I,D as K,aR as to,S as Fe,aS as da,e as G,aT as ao,T as be,aU as ua,C as Ce,A as B,m as no,aV as oo,aW as so,V as ma,K as ro,a as pa,a1 as io,aK as ha,aX as co,aY as lo,Y as uo,aZ as mo,a_ as po,an as ho,p as fo,W as go,a$ as bo,b0 as ve}from"./index-BIwQAhFv.js";import{n as Ct}from"./mui-DtV_yZlj.js";import{a as C}from"./sentry-Wnm-N8eT.js";import{w as fa}from"./withTransactionSidePanel-NOFN_NLa.js";import{c as ga,t as _e,f as se,a as _t,v as Co}from"./routePaths-BjY4Hbs8.js";import{u as W}from"./useAskAiCfoHostNavButtonProps-DHofygYw.js";import{c as Oe,b as _o,u as ko}from"./useFetchSuggestedQuestionsWhenReady-BWzQNqoL.js";import Ie from"./NotFoundScreen-D1-E1kBF.js";import{u as ba}from"./useInitialThreadRequest-D1wLkM4c.js";import{t as Ca}from"./analyticsHelper-DjIWqwJH.js";import{C as So}from"./CompanyPassportScreen-Wc9Neaz1.js";import{F as yo}from"./FeaturePreviewScreen-dlYgctun.js";import{R as Ao}from"./ReferralListScreen-B6ywI0R7.js";import"./recharts-DdIjbBfI.js";import"./analytics-B6udoEJT.js";import"./plaid--kCGp3zU.js";import"./dnd-BIjMGuxw.js";import"./stripe-DMRn4zHo.js";import"./lottie-DL8N42Il.js";import"./lexical-DOh49tNP.js";import"./pdf-BcmiSEKK.js";import"./utils-CRtSAyQU.js";import"./TransactionDetailScreen-Cffx3kdg.js";import"./decodeURIComponentSafe-DeA-_wid.js";import"./MobileAppDrawer-CXLCRreY.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]="53e1cf5b-e725-4966-83fd-028b69f8c3e7",e._sentryDebugIdIdentifier="sentry-dbid-53e1cf5b-e725-4966-83fd-028b69f8c3e7")}catch{}})();const vo=fa(function({openTransactionPanel:e,panelContent:a,sidePanelIsOpen:t,sidePanelIsFullView:n}){const{vendorId:o,reportDate:r}=z(),s=R.getSignedInUser(),i=S(A=>A.tenantState.currentTenantId),d=S(A=>L(A)),{tenantEmailDomain:h}=z(),_=q(),g=d?.companyName??"",u={userId:s?.userId??"",sessionId:s?.zeniSessionId??"",tenantId:i??""},c=C.useMemo(()=>({authParams:u,companyName:g,downloadEndPoint:`${X}/agingDetailedReport`,timezone:Ve()}),[]),m=C.useMemo(()=>r!=null?Gt(r):he(),[r]),p=$(),f=Z(),k=S(A=>Za(A,m,o)),T=C.useCallback(()=>{o!=null&&k.fetchState!=="In-Progress"&&k.fetchState!=="Completed"&&p(Ha(o,m))},[m]),b=C.useCallback(()=>{f("../../",{relative:"path"})},[]),y=C.useCallback((A,U)=>{p(wt({sortKey:A,sortOrder:U}))},[]),F=C.useCallback(A=>{p(wt({downloadState:A}))},[]),j=C.useCallback(A=>{if(e)e(A.transactionId,A.transactionType);else if(h!=null){const U=ga({id:A.transactionId,type:A.transactionType},h);f(U);const de=D(_.state?.pathnameStackToGoBack,_.pathname);f(U,{state:{pathnameStackToGoBack:de}})}},[h,e]),v=C.useCallback(()=>{k.vendor!=null&&I.trackApAgingDetail("AP Aging",m.format(K.getLocalizedStrings().dateFormat.analytics.YYYYDashMMDashDDFormat),k.vendor.id,k.vendor.name)},[k.vendor,m]);return C.useEffect(()=>{T()},[]),C.useEffect(()=>{k.fetchState==="Completed"&&v()},[v,k.fetchState]),l.jsx(to,{apAgingDetail:k,downloadParams:c,reportDate:m,analytics:I,onTransactionClick:j,onReload:T,onBackClick:b,onColumnSortConfigChanged:y,updateDownloadStateHandler:F,panelContent:a,sidePanelIsOpen:t,sidePanelIsFullView:n})}),Eo=()=>{const e=$(),a=Z(),t=S(y=>Qa(y)),{isAiCfoAccessEnabled:n,onAskAiCfoClick:o}=W({mobileExploreReferrer:"AP Aging"});Oe({isDataReady:t.fetchState==="Completed"});const r=R.getSignedInUser(),s=S(y=>y.tenantState.currentTenantId),i=S(y=>L(y)),d=i?.companyName??"",h={userId:r?.userId??"",sessionId:r?.zeniSessionId??"",tenantId:s??""},_=C.useMemo(()=>({authParams:h,companyName:d,downloadEndPoint:`${X}/agingReport`,timezone:Ve()}),[]),g=t.apAgingUIState.selectedDate??he(),u=C.useCallback(()=>{t.fetchState!=="In-Progress"&&t.fetchState!=="Completed"&&e(rt(g))},[]);C.useEffect(()=>{u()},[]);const c=C.useCallback(()=>{a("../",{relative:"path"})},[]),m=C.useCallback(y=>{e(Le({searchString:y}))},[]),p=C.useCallback((y,F)=>{e(Le({sortKey:F,sortOrder:y}))},[]),f=C.useCallback(y=>{a(`./${y}/${g.format(K.getLocalizedStrings().dateFormat.analytics.YYYYDashMMDashDDFormat)}`)},[g]),k=C.useCallback(y=>{e(Le({downloadState:y}))},[]),T=C.useCallback((y,F)=>{},[]),b=C.useCallback((y,F)=>{e(Le({selectedDate:y,agingDateSelectionType:F})),e(rt(y))},[]);return l.jsxs(l.Fragment,{children:[t.fetchState==="Completed"?l.jsx(Fe,{analytics:I,onLoad:y=>y.trackPageLoaded(G.Event.agingReport,"AP Aging")}):null,l.jsx(da,{uiState:t.apAgingUIState,report:t,downloadParams:_,analytics:I,onReloadReport:u,onBackClick:c,onSearchTextChange:m,onSortOrderChange:p,onEntityNameClick:f,updateDownloadStateHandler:k,onSelectedDateChanged:b,onNodeCollapseToggled:T,isAiCfoAccessEnabled:n,onAskAiCfoClick:o})]})},Io=fa(function({openTransactionPanel:e,panelContent:a,sidePanelIsOpen:t,sidePanelIsFullView:n}){const{customerId:o,reportDate:r}=z(),s=R.getSignedInUser(),i=S(v=>L(v)),{tenantEmailDomain:d}=z(),h=q(),_=i.companyName,g={userId:s?.userId??"",sessionId:s?.zeniSessionId??"",tenantId:i.tenantId},u=C.useMemo(()=>({authParams:g,companyName:_,downloadEndPoint:`${X}/agingDetailedReport`,timezone:Ve()}),[]),c=C.useMemo(()=>r!=null?Gt(r):he(),[r]),m=$(),p=Z(),f=S(v=>Xa(v,c,o)),k=C.useCallback(()=>{o!=null&&f.fetchState!=="In-Progress"&&f.fetchState!=="Completed"&&m(Wa(o,c))},[c]),T=C.useCallback(()=>{p("../../",{relative:"path"})},[]),b=C.useCallback((v,A)=>{m(Dt({sortKey:v,sortOrder:A}))},[]),y=C.useCallback(v=>{m(Dt({downloadState:v}))},[]),F=C.useCallback(v=>{if(e)e(v.transactionId,v.transactionType);else if(d!=null){const A=ga({id:v.transactionId,type:v.transactionType},d);p(A);const U=D(h.state?.pathnameStackToGoBack,h.pathname);p(A,{state:{pathnameStackToGoBack:U}})}},[d,e]),j=C.useCallback(()=>{f.customer!=null&&I.trackArAgingDetail("AR Aging",c.format(K.getLocalizedStrings().dateFormat.analytics.YYYYDashMMDashDDFormat),f.customer.id,f.customer.name)},[f.customer,c]);return C.useEffect(()=>{k()},[]),C.useEffect(()=>{f.fetchState==="Completed"&&j()},[f.fetchState,j]),l.jsx(ao,{arAgingDetail:f,downloadParams:u,reportDate:c,analytics:I,onTransactionClick:F,onReload:k,onBackClick:T,onColumnSortConfigChanged:b,updateDownloadStateHandler:y,panelContent:a,sidePanelIsOpen:t,sidePanelIsFullView:n})}),To=()=>{const e=$(),a=Z(),t=S(b=>Ja(b)),{isAiCfoAccessEnabled:n,onAskAiCfoClick:o}=W({mobileExploreReferrer:"AR Aging"});Oe({isDataReady:t.fetchState==="Completed"});const r=R.getSignedInUser(),s=S(b=>L(b)),i=s.companyName,d={userId:r?.userId??"",sessionId:r?.zeniSessionId??"",tenantId:s.tenantId},h=C.useMemo(()=>({authParams:d,companyName:i,downloadEndPoint:`${X}/agingReport`,timezone:Ve()}),[]),_=t.arAgingUIState.selectedDate??he(),g=C.useCallback(()=>{t.fetchState!=="In-Progress"&&t.fetchState!=="Completed"&&e(it(_))},[]);C.useEffect(()=>{g()},[]);const u=C.useCallback(()=>{a("../",{relative:"path"})},[]),c=C.useCallback(b=>{e(Ue({searchString:b}))},[]),m=C.useCallback((b,y)=>{e(Ue({sortKey:y,sortOrder:b}))},[]),p=C.useCallback(b=>{a(`./${b}/${_.format(K.getLocalizedStrings().dateFormat.analytics.YYYYDashMMDashDDFormat)}`)},[_]),f=C.useCallback(b=>{e(Ue({downloadState:b}))},[]),k=C.useCallback((b,y)=>{e(Ue({selectedDate:b,agingDateSelectionType:y})),e(it(b))},[]),T=C.useCallback((b,y)=>{e(en({nodeId:b,isCollapsed:y}))},[]);return l.jsxs(l.Fragment,{children:[t.fetchState==="Completed"?l.jsx(Fe,{analytics:I,onLoad:b=>b.trackPageLoaded(G.Event.agingReport,"AR Aging")}):null,l.jsx(da,{uiState:t.arAgingUIState,report:t,downloadParams:h,analytics:I,onReloadReport:g,onBackClick:u,onSearchTextChange:c,onSortOrderChange:m,onEntityNameClick:p,updateDownloadStateHandler:f,onSelectedDateChanged:k,onNodeCollapseToggled:T,isAiCfoAccessEnabled:n,onAskAiCfoClick:o})]})},_a=(e,a)=>({key:a,title:e.accountName,amount:e.balance?.available,logoUri:e.logo?.toString(),source:e});function ka(e,a){const t=nn(a.firstMonthOfFY);return{onItemClick:(n,o)=>{const r=o.accountName===""?o.accountDescription:o.accountName,s=_e(a.tenantEmailDomain,o.accountId,o.accountType,r,"quarter",t,!1),i=D(a.location.state?.pathnameStackToGoBack,a.location.pathname);a.navigate(s,{state:{pathnameStackToGoBack:i,referrer:a.referrerType}})},onSetAccountsStatementDate:(n,o)=>{e(on(n,o))},onPromoCardBtnClick:n=>{if(a.isZeniAccountsAdmin){let o=`../../checking/${n}`;n?I.trackZeniAccountsCashBalancePromoClicked("Move Money"):(I.trackZeniAccountsCashBalancePromoClicked("Sign Up for Free"),o="../../checking/promo");const r=D(a.location.state?.pathnameStackToGoBack,a.location.pathname);a.navigate(o,{state:{pathnameStackToGoBack:r}})}else I.trackZeniAccountsCashBalancePromoClicked("Learn More"),window.open("https://www.zeni.ai/product/business-checking-accounts","_blank")}}}const xo=Q(function(e){const a=tn(e).accountsInOrder.map((n,o)=>_a(n,o)),t=an(e);return{sectionTitle:K.getLocalizedStrings().balanceCard.cashBalanceSectionTitle,transactionArray:a,zeniAccountsPromoCardReport:t,fetchState:e.cashBalanceState.fetchState,analytics:I}},ka)(ua),wo=Q(function(e){const a=sn(e).accountsInOrder.map((o,r)=>_a(o,r)),t=R.getSignedInUser(),n=Te(t);return{sectionTitle:K.getLocalizedStrings().balanceCard.cardBalanceSectionTitle,transactionArray:a,isZeniUser:n,fetchState:e.cardBalanceState.fetchState,analytics:I}},ka)(ua);function Do(){const e=Z(),a=q(),{tenantEmailDomain:t}=z(),n=be(),o=S(s=>L(s).company?.companyInfo.firstMonthOfFY??1),r=lt(n?.loggedInUserRoleMap);return S(s=>s.cashBalanceState.fetchState)==="Error"?l.jsx(Ie,{}):l.jsx(xo,{tenantEmailDomain:t,location:a,referrerType:"Cash Balance",navigate:e,isZeniAccountsAdmin:r,firstMonthOfFY:o})}function Fo(){const e=Z(),a=q(),{tenantEmailDomain:t}=z(),n=be(),o=lt(n?.loggedInUserRoleMap),r=S(s=>L(s).company?.companyInfo.firstMonthOfFY??1);return S(s=>s.cardBalanceState.fetchState)==="Error"?l.jsx(Ie,{}):l.jsx(wo,{tenantEmailDomain:t,location:a,referrerType:"Card Balance",navigate:e,isZeniAccountsAdmin:o,firstMonthOfFY:r})}const Oo=Ct.div`
1
+ import{j as l}from"./liveblocks-D0ylGz77.js";import{l as z,g as S,u as q,h as $,j as Z,k as Q,s as qa,n as st,o as w}from"./core-DSsu1iyO.js";import{eR as L,KE as Ve,bE as Gt,bq as he,LR as Za,i3 as Ha,LS as wt,LT as Qa,i6 as rt,LU as Le,LV as Xa,ib as Wa,LW as Dt,LX as Ja,ig as it,LY as Ue,LZ as en,cl as lt,L_ as tn,L$ as an,KY as nn,j9 as on,M0 as sn,bn as Te,M1 as Nt,Ks as ae,bc as $t,jn as zt,m$ as Kt,j6 as qt,Ku as ne,Kt as H,f6 as rn,eO as cn,fo as ln,M2 as dn,M3 as un,M4 as Zt,M5 as Se,uh as xe,ui as we,uF as fe,uz as oe,um as De,M6 as mn,M7 as pn,M8 as hn,M9 as Ht,Ma as ye,Mb as fn,dE as Ge,qK as Qt,Mc as gn,Md as bn,Me as Cn,Mf as dt,JR as ut,jD as ge,uN as mt,qS as _n,Mg as kn,uj as Ft,qN as me,qJ as Xt,Mh as ie,Mi as Sn,Mj as pt,JQ as ht,sR as Wt,Mk as yn,Ml as An,Mm as vn,Mn as ft,t2 as En,Mo as In,ul as Ot,sQ as Jt,Mp as ce,Mq as Tn,bv as ea,uR as ta,Mr as xn,Ms as wn,Mt as Dn,Mu as gt,uM as Fn,Mv as On,uk as Pt,uQ as aa,Mw as le,Mx as Pn,My as Mn,Mz as na,js as oa,mY as sa,jx as ra,mW as ia,mV as ca,mU as la,sd as Rn,fe as Bn,cO as jn,cP as Ln,mR as Un,fa as Yn,n6 as Vn,DV as Mt,MA as Gn,MB as Nn,MC as $n,MD as zn,b5 as bt,f1 as Kn,gN as qn,fF as Zn,n0 as Hn,i$ as Qn,mZ as Xn,mX as Wn,eX as Jn,eV as eo}from"./zeni-epic-state-CFQMpWBE.js";import{z as R,Y as X,s as D,d as I,D as K,aR as to,x as Fe,aS as da,f as G,aT as ao,c as be,aU as ua,C as Ce,A as B,m as no,aV as oo,aW as so,U as ma,K as ro,a as pa,a1 as io,aK as ha,aX as co,aY as lo,X as uo,aZ as mo,a_ as po,an as ho,q as fo,V as go,a$ as bo,b0 as ve}from"./index-CPG6ITBm.js";import{n as Ct}from"./mui-D9TDAUAO.js";import{a as C}from"./sentry-C5UCCkb_.js";import{w as fa}from"./withTransactionSidePanel-xau0uwsY.js";import{c as ga,t as _e,f as se,a as _t,v as Co}from"./routePaths-1uJ5ric0.js";import{u as W}from"./useAskAiCfoHostNavButtonProps-DaoVDdk6.js";import{c as Oe,b as _o,u as ko}from"./useFetchSuggestedQuestionsWhenReady-IH_yzaTd.js";import Ie from"./NotFoundScreen-B1k_jOem.js";import{u as ba}from"./useInitialThreadRequest-C_MqgvcA.js";import{t as Ca}from"./analyticsHelper-COFNU8CP.js";import{C as So}from"./CompanyPassportScreen-CUrTGAPx.js";import{F as yo}from"./FeaturePreviewScreen-BWUt3LEA.js";import{R as Ao}from"./ReferralListScreen-BKwWhmDP.js";import"./recharts-C7IODwRw.js";import"./analytics-CQQ1PG0J.js";import"./plaid-mYHRXlz3.js";import"./dnd-Dok8dils.js";import"./stripe-DMRn4zHo.js";import"./lottie-Cu765PFn.js";import"./lexical-DO7p5ZXM.js";import"./pdf-BzjCkfw3.js";import"./utils-Cd1icpH6.js";import"./TransactionDetailScreen-AbBGaDF8.js";import"./decodeURIComponentSafe-CRFR6Y3w.js";import"./MobileAppDrawer-BLGo796K.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]="b5955c14-8dda-491b-ae5b-12fd053344e8",e._sentryDebugIdIdentifier="sentry-dbid-b5955c14-8dda-491b-ae5b-12fd053344e8")}catch{}})();const vo=fa(function({openTransactionPanel:e,panelContent:a,sidePanelIsOpen:t,sidePanelIsFullView:n}){const{vendorId:o,reportDate:r}=z(),s=R.getSignedInUser(),i=S(A=>A.tenantState.currentTenantId),d=S(A=>L(A)),{tenantEmailDomain:h}=z(),_=q(),g=d?.companyName??"",u={userId:s?.userId??"",sessionId:s?.zeniSessionId??"",tenantId:i??""},c=C.useMemo(()=>({authParams:u,companyName:g,downloadEndPoint:`${X}/agingDetailedReport`,timezone:Ve()}),[]),m=C.useMemo(()=>r!=null?Gt(r):he(),[r]),p=$(),f=Z(),k=S(A=>Za(A,m,o)),T=C.useCallback(()=>{o!=null&&k.fetchState!=="In-Progress"&&k.fetchState!=="Completed"&&p(Ha(o,m))},[m]),b=C.useCallback(()=>{f("../../",{relative:"path"})},[]),y=C.useCallback((A,U)=>{p(wt({sortKey:A,sortOrder:U}))},[]),F=C.useCallback(A=>{p(wt({downloadState:A}))},[]),j=C.useCallback(A=>{if(e)e(A.transactionId,A.transactionType);else if(h!=null){const U=ga({id:A.transactionId,type:A.transactionType},h);f(U);const de=D(_.state?.pathnameStackToGoBack,_.pathname);f(U,{state:{pathnameStackToGoBack:de}})}},[h,e]),v=C.useCallback(()=>{k.vendor!=null&&I.trackApAgingDetail("AP Aging",m.format(K.getLocalizedStrings().dateFormat.analytics.YYYYDashMMDashDDFormat),k.vendor.id,k.vendor.name)},[k.vendor,m]);return C.useEffect(()=>{T()},[]),C.useEffect(()=>{k.fetchState==="Completed"&&v()},[v,k.fetchState]),l.jsx(to,{apAgingDetail:k,downloadParams:c,reportDate:m,analytics:I,onTransactionClick:j,onReload:T,onBackClick:b,onColumnSortConfigChanged:y,updateDownloadStateHandler:F,panelContent:a,sidePanelIsOpen:t,sidePanelIsFullView:n})}),Eo=()=>{const e=$(),a=Z(),t=S(y=>Qa(y)),{isAiCfoAccessEnabled:n,onAskAiCfoClick:o}=W({mobileExploreReferrer:"AP Aging"});Oe({isDataReady:t.fetchState==="Completed"});const r=R.getSignedInUser(),s=S(y=>y.tenantState.currentTenantId),i=S(y=>L(y)),d=i?.companyName??"",h={userId:r?.userId??"",sessionId:r?.zeniSessionId??"",tenantId:s??""},_=C.useMemo(()=>({authParams:h,companyName:d,downloadEndPoint:`${X}/agingReport`,timezone:Ve()}),[]),g=t.apAgingUIState.selectedDate??he(),u=C.useCallback(()=>{t.fetchState!=="In-Progress"&&t.fetchState!=="Completed"&&e(rt(g))},[]);C.useEffect(()=>{u()},[]);const c=C.useCallback(()=>{a("../",{relative:"path"})},[]),m=C.useCallback(y=>{e(Le({searchString:y}))},[]),p=C.useCallback((y,F)=>{e(Le({sortKey:F,sortOrder:y}))},[]),f=C.useCallback(y=>{a(`./${y}/${g.format(K.getLocalizedStrings().dateFormat.analytics.YYYYDashMMDashDDFormat)}`)},[g]),k=C.useCallback(y=>{e(Le({downloadState:y}))},[]),T=C.useCallback((y,F)=>{},[]),b=C.useCallback((y,F)=>{e(Le({selectedDate:y,agingDateSelectionType:F})),e(rt(y))},[]);return l.jsxs(l.Fragment,{children:[t.fetchState==="Completed"?l.jsx(Fe,{analytics:I,onLoad:y=>y.trackPageLoaded(G.Event.agingReport,"AP Aging")}):null,l.jsx(da,{uiState:t.apAgingUIState,report:t,downloadParams:_,analytics:I,onReloadReport:u,onBackClick:c,onSearchTextChange:m,onSortOrderChange:p,onEntityNameClick:f,updateDownloadStateHandler:k,onSelectedDateChanged:b,onNodeCollapseToggled:T,isAiCfoAccessEnabled:n,onAskAiCfoClick:o})]})},Io=fa(function({openTransactionPanel:e,panelContent:a,sidePanelIsOpen:t,sidePanelIsFullView:n}){const{customerId:o,reportDate:r}=z(),s=R.getSignedInUser(),i=S(v=>L(v)),{tenantEmailDomain:d}=z(),h=q(),_=i.companyName,g={userId:s?.userId??"",sessionId:s?.zeniSessionId??"",tenantId:i.tenantId},u=C.useMemo(()=>({authParams:g,companyName:_,downloadEndPoint:`${X}/agingDetailedReport`,timezone:Ve()}),[]),c=C.useMemo(()=>r!=null?Gt(r):he(),[r]),m=$(),p=Z(),f=S(v=>Xa(v,c,o)),k=C.useCallback(()=>{o!=null&&f.fetchState!=="In-Progress"&&f.fetchState!=="Completed"&&m(Wa(o,c))},[c]),T=C.useCallback(()=>{p("../../",{relative:"path"})},[]),b=C.useCallback((v,A)=>{m(Dt({sortKey:v,sortOrder:A}))},[]),y=C.useCallback(v=>{m(Dt({downloadState:v}))},[]),F=C.useCallback(v=>{if(e)e(v.transactionId,v.transactionType);else if(d!=null){const A=ga({id:v.transactionId,type:v.transactionType},d);p(A);const U=D(h.state?.pathnameStackToGoBack,h.pathname);p(A,{state:{pathnameStackToGoBack:U}})}},[d,e]),j=C.useCallback(()=>{f.customer!=null&&I.trackArAgingDetail("AR Aging",c.format(K.getLocalizedStrings().dateFormat.analytics.YYYYDashMMDashDDFormat),f.customer.id,f.customer.name)},[f.customer,c]);return C.useEffect(()=>{k()},[]),C.useEffect(()=>{f.fetchState==="Completed"&&j()},[f.fetchState,j]),l.jsx(ao,{arAgingDetail:f,downloadParams:u,reportDate:c,analytics:I,onTransactionClick:F,onReload:k,onBackClick:T,onColumnSortConfigChanged:b,updateDownloadStateHandler:y,panelContent:a,sidePanelIsOpen:t,sidePanelIsFullView:n})}),To=()=>{const e=$(),a=Z(),t=S(b=>Ja(b)),{isAiCfoAccessEnabled:n,onAskAiCfoClick:o}=W({mobileExploreReferrer:"AR Aging"});Oe({isDataReady:t.fetchState==="Completed"});const r=R.getSignedInUser(),s=S(b=>L(b)),i=s.companyName,d={userId:r?.userId??"",sessionId:r?.zeniSessionId??"",tenantId:s.tenantId},h=C.useMemo(()=>({authParams:d,companyName:i,downloadEndPoint:`${X}/agingReport`,timezone:Ve()}),[]),_=t.arAgingUIState.selectedDate??he(),g=C.useCallback(()=>{t.fetchState!=="In-Progress"&&t.fetchState!=="Completed"&&e(it(_))},[]);C.useEffect(()=>{g()},[]);const u=C.useCallback(()=>{a("../",{relative:"path"})},[]),c=C.useCallback(b=>{e(Ue({searchString:b}))},[]),m=C.useCallback((b,y)=>{e(Ue({sortKey:y,sortOrder:b}))},[]),p=C.useCallback(b=>{a(`./${b}/${_.format(K.getLocalizedStrings().dateFormat.analytics.YYYYDashMMDashDDFormat)}`)},[_]),f=C.useCallback(b=>{e(Ue({downloadState:b}))},[]),k=C.useCallback((b,y)=>{e(Ue({selectedDate:b,agingDateSelectionType:y})),e(it(b))},[]),T=C.useCallback((b,y)=>{e(en({nodeId:b,isCollapsed:y}))},[]);return l.jsxs(l.Fragment,{children:[t.fetchState==="Completed"?l.jsx(Fe,{analytics:I,onLoad:b=>b.trackPageLoaded(G.Event.agingReport,"AR Aging")}):null,l.jsx(da,{uiState:t.arAgingUIState,report:t,downloadParams:h,analytics:I,onReloadReport:g,onBackClick:u,onSearchTextChange:c,onSortOrderChange:m,onEntityNameClick:p,updateDownloadStateHandler:f,onSelectedDateChanged:k,onNodeCollapseToggled:T,isAiCfoAccessEnabled:n,onAskAiCfoClick:o})]})},_a=(e,a)=>({key:a,title:e.accountName,amount:e.balance?.available,logoUri:e.logo?.toString(),source:e});function ka(e,a){const t=nn(a.firstMonthOfFY);return{onItemClick:(n,o)=>{const r=o.accountName===""?o.accountDescription:o.accountName,s=_e(a.tenantEmailDomain,o.accountId,o.accountType,r,"quarter",t,!1),i=D(a.location.state?.pathnameStackToGoBack,a.location.pathname);a.navigate(s,{state:{pathnameStackToGoBack:i,referrer:a.referrerType}})},onSetAccountsStatementDate:(n,o)=>{e(on(n,o))},onPromoCardBtnClick:n=>{if(a.isZeniAccountsAdmin){let o=`../../checking/${n}`;n?I.trackZeniAccountsCashBalancePromoClicked("Move Money"):(I.trackZeniAccountsCashBalancePromoClicked("Sign Up for Free"),o="../../checking/promo");const r=D(a.location.state?.pathnameStackToGoBack,a.location.pathname);a.navigate(o,{state:{pathnameStackToGoBack:r}})}else I.trackZeniAccountsCashBalancePromoClicked("Learn More"),window.open("https://www.zeni.ai/product/business-checking-accounts","_blank")}}}const xo=Q(function(e){const a=tn(e).accountsInOrder.map((n,o)=>_a(n,o)),t=an(e);return{sectionTitle:K.getLocalizedStrings().balanceCard.cashBalanceSectionTitle,transactionArray:a,zeniAccountsPromoCardReport:t,fetchState:e.cashBalanceState.fetchState,analytics:I}},ka)(ua),wo=Q(function(e){const a=sn(e).accountsInOrder.map((o,r)=>_a(o,r)),t=R.getSignedInUser(),n=Te(t);return{sectionTitle:K.getLocalizedStrings().balanceCard.cardBalanceSectionTitle,transactionArray:a,isZeniUser:n,fetchState:e.cardBalanceState.fetchState,analytics:I}},ka)(ua);function Do(){const e=Z(),a=q(),{tenantEmailDomain:t}=z(),n=be(),o=S(s=>L(s).company?.companyInfo.firstMonthOfFY??1),r=lt(n?.loggedInUserRoleMap);return S(s=>s.cashBalanceState.fetchState)==="Error"?l.jsx(Ie,{}):l.jsx(xo,{tenantEmailDomain:t,location:a,referrerType:"Cash Balance",navigate:e,isZeniAccountsAdmin:r,firstMonthOfFY:o})}function Fo(){const e=Z(),a=q(),{tenantEmailDomain:t}=z(),n=be(),o=lt(n?.loggedInUserRoleMap),r=S(s=>L(s).company?.companyInfo.firstMonthOfFY??1);return S(s=>s.cardBalanceState.fetchState)==="Error"?l.jsx(Ie,{}):l.jsx(wo,{tenantEmailDomain:t,location:a,referrerType:"Card Balance",navigate:e,isZeniAccountsAdmin:o,firstMonthOfFY:r})}const Oo=Ct.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-CCyJOwfy.js";import{a as u}from"./sentry-Wnm-N8eT.js";import{h as y,g as b,k as w,u as A,N as k}from"./core-Bv8kdUko.js";import{Jj as N,eR as _,fm as R,Jk as U,mT as L,Jl as z}from"./zeni-epic-state-CIBk9-EN.js";import{u as j,z as f,L as T,t as I,D as O,b as $}from"./index-BIwQAhFv.js";import"./mui-DtV_yZlj.js";import{t as P}from"./getLocaleForTenant-lJA2tHmd.js";import"./recharts-DdIjbBfI.js";import"./analytics-B6udoEJT.js";import"./plaid--kCGp3zU.js";import"./dnd-BIjMGuxw.js";import"./stripe-DMRn4zHo.js";import"./lottie-DL8N42Il.js";import"./lexical-DOh49tNP.js";import"./pdf-BcmiSEKK.js";import"./utils-CRtSAyQU.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]="ff9c1764-494a-44e1-80ae-33634ddcd3fb",t._sentryDebugIdIdentifier="sentry-dbid-ff9c1764-494a-44e1-80ae-33634ddcd3fb")}catch{}})();const J=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=$(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}=j(),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(R(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"&&!U(i))&&t(L(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||(O.updateAppLocaleID(P(c)),o())},[n,a,c]),v.jsx(J,{})}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-D0ylGz77.js";import{a as u}from"./sentry-C5UCCkb_.js";import{h as y,g as b,k as w,u as A,N as k}from"./core-DSsu1iyO.js";import{Jj as N,eR as _,fm as R,Jk as U,mT as L,Jl as z}from"./zeni-epic-state-CFQMpWBE.js";import{u as j,z as f,L as T,t as I,D as O,b as $}from"./index-CPG6ITBm.js";import"./mui-D9TDAUAO.js";import{t as P}from"./getLocaleForTenant-OYWr98Zl.js";import"./recharts-C7IODwRw.js";import"./analytics-CQQ1PG0J.js";import"./plaid-mYHRXlz3.js";import"./dnd-Dok8dils.js";import"./stripe-DMRn4zHo.js";import"./lottie-Cu765PFn.js";import"./lexical-DO7p5ZXM.js";import"./pdf-BzjCkfw3.js";import"./utils-Cd1icpH6.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]="ff9c1764-494a-44e1-80ae-33634ddcd3fb",t._sentryDebugIdIdentifier="sentry-dbid-ff9c1764-494a-44e1-80ae-33634ddcd3fb")}catch{}})();const J=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=$(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}=j(),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(R(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"&&!U(i))&&t(L(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||(O.updateAppLocaleID(P(c)),o())},[n,a,c]),v.jsx(J,{})}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-CCyJOwfy.js";import{j as w,u as C,g as h,k as A,l as P}from"./core-Bv8kdUko.js";import{Nl as k,Ns as K,fD as q,fC as M,fB as W,iA as J,Kt as L,q1 as Q,eR as V,MT as D,iy as T,Nm as v,Nv as F,iw as G,iT as N}from"./zeni-epic-state-CIBk9-EN.js";import{bn as X,K as j,C as R,z as U,m as O,p,A as S,B as Z,bo as Y,o as z,bp as ee,v as te}from"./index-BIwQAhFv.js";import{n as H}from"./mui-DtV_yZlj.js";import"./sentry-Wnm-N8eT.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]="932da25d-6272-4f90-ad60-b01f439e9b55",e._sentryDebugIdIdentifier="sentry-dbid-932da25d-6272-4f90-ad60-b01f439e9b55")}catch{}})();const ne=A(null,function(e,t){return{onSaveVendor:n=>{e(J(t.vendorId!==void 0?t.vendorId:void 0,t.billId,void 0,t.isExpressPayPage)),e(L("common")),n!=null&&e(Q(n))},onGetOtp:n=>{e(W(n,"BillPayVendor"))},onResendOtp:n=>{e(M(n,"BillPayVendor"))},onVerifyOtp:(n,a)=>{e(q(n,a,"BillPayVendor"))},onVerifyOtpSuccess:(n,a,o)=>{e(K(n,a,o))}}})(X);function _({vendorId:e,billId:t,isExpressPayPage:n}){const a=w(),o=C(),s=h(d=>k(d,e));return l.jsx(ne,{location:o,navigate:a,vendorId:e,billId:t,vendorViewDetails:s,isExpressPayPage:n??!1})}const ae=H.div`
1
+ import{j as l}from"./liveblocks-D0ylGz77.js";import{j as w,u as C,g as h,k as A,l as P}from"./core-DSsu1iyO.js";import{Nl as k,Ns as q,fD as K,fC as M,fB as W,iA as J,Kt as L,q1 as Q,eR as V,MT as D,iy as T,Nm as v,Nv as F,iw as G,iT as N}from"./zeni-epic-state-CFQMpWBE.js";import{bn as X,K as j,C as R,z as U,m as O,q as p,A as S,B as Z,bo as Y,o as z,bp as ee,s as te}from"./index-CPG6ITBm.js";import{n as H}from"./mui-D9TDAUAO.js";import"./sentry-C5UCCkb_.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]="fea3c876-5c19-4a89-9e41-6b4459828b64",e._sentryDebugIdIdentifier="sentry-dbid-fea3c876-5c19-4a89-9e41-6b4459828b64")}catch{}})();const ne=A(null,function(e,t){return{onSaveVendor:n=>{e(J(t.vendorId!==void 0?t.vendorId:void 0,t.billId,void 0,t.isExpressPayPage)),e(L("common")),n!=null&&e(Q(n))},onGetOtp:n=>{e(W(n,"BillPayVendor"))},onResendOtp:n=>{e(M(n,"BillPayVendor"))},onVerifyOtp:(n,a)=>{e(K(n,a,"BillPayVendor"))},onVerifyOtpSuccess:(n,a,o)=>{e(q(n,a,o))}}})(X);function _({vendorId:e,billId:t,isExpressPayPage:n}){const a=w(),o=C(),s=h(c=>k(c,e));return l.jsx(ne,{location:o,navigate:a,vendorId:e,billId:t,vendorViewDetails:s,isExpressPayPage:n??!1})}const ae=H.div`
2
2
  display: flex;
3
3
  height: 100vh;
4
4
  width: 100%;
@@ -6,7 +6,7 @@ import{j as l}from"./liveblocks-CCyJOwfy.js";import{j as w,u as C,g as h,k as A,
6
6
  flex-direction: column;
7
7
  align-items: center;
8
8
  background-color: ${e=>e.theme.colors.grey4};
9
- `,oe=A(function(e,t){const{vendorId:n,billId:a}=t,o=k(e,n),s=D(e,t.isVendorRecommendationEnabled,t.isZeniAccountsFeatureEnabled,a);return{billId:a,isDisabled:o.bankAccountCreationState.fetchState==="In-Progress"?"readonly":void 0,vendorViewDetails:o,file:s.file,bankAccountContext:t.bankAccountContext}},function(e,t){const{navigate:n,location:a,vendorId:o}=t;return{onFetchBankName:s=>{e(N(s))},onSaveHandler:s=>{e(G(t.bankAccountContext,s,"standard",o))},onCancel:()=>{(()=>{const s=p(a.state?.pathnameStackToGoBack),d=s.poppedPathname??E();n(d,{state:{pathnameStackToGoBack:s.newStack}})})(),e(v())},onACHDetailsUpdated:s=>{const{bankAccountSection:d}=s;e(F({data:d}))},onBackClick:()=>{if(e(T({fetchState:"Not-Started"})),t.bankAccountContext==="express-pay")n("../",{relative:"path"});else{const s=p(t.location.state?.pathnameStackToGoBack),d=s.poppedPathname??E(0);t.navigate(d,{state:{pathnameStackToGoBack:s.newStack}})}e(v())}}})(Y);function fe({vendorIdParam:e,accountContext:t}){const n=w(),a=C(),o=j(),{vendorId:s,billId:d}=P(),c=e??s,{useFeatureGate:r}=R(),i=U.getSignedInUser(),b=h(u=>V(u)),g=O(),x=p(a.state?.pathnameStackToGoBack),f=t??(x.poppedPathname?.includes("vendor")===!0?"vendor":"billDetail"),m=h(u=>k(u,c)),{isFeatureEnabled:I}=r(S.isVendorRecommendationFeatureEnabled),{isFeatureEnabled:y}=r(S.isDepositAccountsFeatureEnabled);if(i==null)throw Error("Can't access address page without signing in...");return f==="billDetail"&&m.editVendorState?.saveStatus.fetchState==="In-Progress"?l.jsx(Z,{fetchState:m.editVendorState?.saveStatus.fetchState??"Not-Started",style:{backgroundColor:g.colors.grey5}}):l.jsxs(ae,{windowSize:o,children:[l.jsx(_,{vendorId:c,billId:d}),l.jsx(oe,{location:a,navigate:n,billId:d,vendorId:c,currentTenant:b,bankAccountContext:f,isVendorRecommendationEnabled:I,isZeniAccountsFeatureEnabled:y})]})}const E=(e=2)=>{let t="../";for(let n=0;n<e;n++)t=`${t}../`;return t},me=(e,t,n)=>{let a=`/${e}/bill/${encodeURIComponent(t)}`;return n=="draft"&&(a+="/edit"),a},he=e=>`/${e}/bills`,ke=(e,t)=>{let n=`/${e}/bill`;return n=t!=null?n.concat(`/${t}/edit`):n.concat("/new"),n},B=(e,t,n,a)=>{let o=`/${e}/bill`;return o+=n!=null?`/${n}/edit/vendor`:"/new/vendor",o+=a!=null?`/${a}/edit/${t}`:`/create/${t}`,o};function ve(e,t,n){return B(e,"ach",t,n)}function Se(e,t,n){return B(e,"domestic",t,n)}function ge(e,t,n){return B(e,"international",t,n)}const se=(e,t,n)=>{let a=`/${e}/bill/`;return a=n!=null?a.concat(`${encodeURIComponent(n)}/${t}/`):a.concat(`new/${t}/`),a},re=H.div`
9
+ `,oe=A(function(e,t){const{vendorId:n,billId:a}=t,o=k(e,n),s=D(e,t.isVendorRecommendationEnabled,t.isZeniAccountsFeatureEnabled,a);return{billId:a,isDisabled:o.bankAccountCreationState.fetchState==="In-Progress"?"readonly":void 0,vendorViewDetails:o,file:s.file,bankAccountContext:t.bankAccountContext}},function(e,t){const{navigate:n,location:a,vendorId:o}=t;return{onFetchBankName:s=>{e(N(s))},onSaveHandler:s=>{e(G(t.bankAccountContext,s,"standard",o))},onCancel:()=>{(()=>{const s=p(a.state?.pathnameStackToGoBack),c=s.poppedPathname??E();n(c,{state:{pathnameStackToGoBack:s.newStack}})})(),e(v())},onACHDetailsUpdated:s=>{const{bankAccountSection:c}=s;e(F({data:c}))},onBackClick:()=>{if(e(T({fetchState:"Not-Started"})),t.bankAccountContext==="express-pay")n("../",{relative:"path"});else{const s=p(t.location.state?.pathnameStackToGoBack),c=s.poppedPathname??E(0);t.navigate(c,{state:{pathnameStackToGoBack:s.newStack}})}e(v())}}})(Y);function fe({vendorIdParam:e,accountContext:t}){const n=w(),a=C(),o=j(),{vendorId:s,billId:c}=P(),d=e??s,{useFeatureGate:r}=R(),i=U.getSignedInUser(),b=h(u=>V(u)),g=O(),x=p(a.state?.pathnameStackToGoBack),f=t??(x.poppedPathname?.includes("vendor")===!0?"vendor":"billDetail"),m=h(u=>k(u,d)),{isFeatureEnabled:I}=r(S.isVendorRecommendationFeatureEnabled),{isFeatureEnabled:y}=r(S.isDepositAccountsFeatureEnabled);if(i==null)throw Error("Can't access address page without signing in...");return f==="billDetail"&&m.editVendorState?.saveStatus.fetchState==="In-Progress"?l.jsx(Z,{fetchState:m.editVendorState?.saveStatus.fetchState??"Not-Started",style:{backgroundColor:g.colors.grey5}}):l.jsxs(ae,{windowSize:o,children:[l.jsx(_,{vendorId:d,billId:c}),l.jsx(oe,{location:a,navigate:n,billId:c,vendorId:d,currentTenant:b,bankAccountContext:f,isVendorRecommendationEnabled:I,isZeniAccountsFeatureEnabled:y})]})}const E=(e=2)=>{let t="../";for(let n=0;n<e;n++)t=`${t}../`;return t},me=(e,t,n)=>{let a=`/${e}/bill/${encodeURIComponent(t)}`;return n=="draft"&&(a+="/edit"),a},he=e=>`/${e}/bills`,ke=(e,t)=>{let n=`/${e}/bill`;return n=t!=null?n.concat(`/${t}/edit`):n.concat("/new"),n},B=(e,t,n,a)=>{let o=`/${e}/bill`;return o+=n!=null?`/${n}/edit/vendor`:"/new/vendor",o+=a!=null?`/${a}/edit/${t}`:`/create/${t}`,o};function ve(e,t,n){return B(e,"ach",t,n)}function Se(e,t,n){return B(e,"domestic",t,n)}function ge(e,t,n){return B(e,"international",t,n)}const se=(e,t,n)=>{let a=`/${e}/bill/`;return a=n!=null?a.concat(`${encodeURIComponent(n)}/${t}/`):a.concat(`new/${t}/`),a},re=H.div`
10
10
  display: flex;
11
11
  height: 100vh;
12
12
  width: 100%;
@@ -15,4 +15,4 @@ import{j as l}from"./liveblocks-CCyJOwfy.js";import{j as w,u as C,g as h,k as A,
15
15
  align-items: center;
16
16
  background-color: ${e=>e.theme.colors.grey4};
17
17
  box-shadow: ${e=>`0px 2px ${z.sp1} ${e.theme.colors.dropShadowNormal}`};
18
- `,de=A(function(e,t){const{vendorId:n,billId:a}=t,o=k(e,n),s=D(e,t.isVendorRecommendationEnabled,t.isZeniAccountsFeatureEnabled,a);return{billId:a,isDisabled:o.bankAccountCreationState.fetchState==="In-Progress"?"readonly":void 0,vendorViewDetails:o,file:s.file,bankAccountContext:t.bankAccountContext}},function(e,t){const{billId:n,navigate:a,location:o,vendorId:s,currentTenant:d}=t,{tenantEmailDomain:c}=d;return{onFetchBankName:r=>{e(N(r))},onSaveHandler:r=>{e(G(t.bankAccountContext,r,"us-domestic",s))},onWireDetailsUpdated:r=>{const{bankAccountSection:i}=r;e(F({data:i}))},onCancel:()=>{(()=>{const r=p(o.state?.pathnameStackToGoBack),i=r.poppedPathname??$();a(i,{state:{pathnameStackToGoBack:r.newStack}})})(),e(v())},onAddressClick:r=>{if(t.bankAccountContext==="express-pay")a("./add-address");else{const i=se(c,r,n),b=te(o.state?.pathnameStackToGoBack,o.pathname);a(i,{state:{pathnameStackToGoBack:b}})}},onBackClick:()=>{if(e(T({fetchState:"Not-Started"})),t.bankAccountContext==="express-pay")a("../",{relative:"path"});else{const r=p(t.location.state?.pathnameStackToGoBack),i=r.poppedPathname??$(0);t.navigate(i,{state:{pathnameStackToGoBack:r.newStack}})}e(v())}}})(ee);function xe({vendorIdParam:e,accountContext:t}){const n=w(),a=C(),o=j(),{vendorId:s,billId:d}=P(),c=e??s,r=U.getSignedInUser(),{useFeatureGate:i}=R(),b=O(),g=h(u=>V(u)),x=p(a.state?.pathnameStackToGoBack),f=t??(x.poppedPathname?.includes("vendor")===!0?"vendor":"billDetail"),m=h(u=>k(u,c)),{isFeatureEnabled:I}=i(S.isVendorRecommendationFeatureEnabled),{isFeatureEnabled:y}=i(S.isDepositAccountsFeatureEnabled);if(r==null)throw Error("Can't access address page without signing in...");return f==="billDetail"&&m.editVendorState?.saveStatus.fetchState==="In-Progress"?l.jsx(Z,{fetchState:m.editVendorState?.saveStatus.fetchState??"Not-Started",style:{backgroundColor:b.colors.grey5,boxShadow:`0px 2px ${z.sp1} ${b.colors.dropShadowNormal}`}}):l.jsxs(re,{windowSize:o,children:[l.jsx(_,{vendorId:c,billId:d}),l.jsx(de,{location:a,navigate:n,billId:d,vendorId:c,currentTenant:g,bankAccountContext:f,isVendorRecommendationEnabled:I,isZeniAccountsFeatureEnabled:y})]})}const $=(e=2)=>{let t="../";for(let n=0;n<e;n++)t=`${t}../`;return t};export{fe as A,xe as D,_ as V,me as a,se as b,ke as c,Se as d,he as g,ge as i,ve as v};
18
+ `,ce=A(function(e,t){const{vendorId:n,billId:a}=t,o=k(e,n),s=D(e,t.isVendorRecommendationEnabled,t.isZeniAccountsFeatureEnabled,a);return{billId:a,isDisabled:o.bankAccountCreationState.fetchState==="In-Progress"?"readonly":void 0,vendorViewDetails:o,file:s.file,bankAccountContext:t.bankAccountContext}},function(e,t){const{billId:n,navigate:a,location:o,vendorId:s,currentTenant:c}=t,{tenantEmailDomain:d}=c;return{onFetchBankName:r=>{e(N(r))},onSaveHandler:r=>{e(G(t.bankAccountContext,r,"us-domestic",s))},onWireDetailsUpdated:r=>{const{bankAccountSection:i}=r;e(F({data:i}))},onCancel:()=>{(()=>{const r=p(o.state?.pathnameStackToGoBack),i=r.poppedPathname??$();a(i,{state:{pathnameStackToGoBack:r.newStack}})})(),e(v())},onAddressClick:r=>{if(t.bankAccountContext==="express-pay")a("./add-address");else{const i=se(d,r,n),b=te(o.state?.pathnameStackToGoBack,o.pathname);a(i,{state:{pathnameStackToGoBack:b}})}},onBackClick:()=>{if(e(T({fetchState:"Not-Started"})),t.bankAccountContext==="express-pay")a("../",{relative:"path"});else{const r=p(t.location.state?.pathnameStackToGoBack),i=r.poppedPathname??$(0);t.navigate(i,{state:{pathnameStackToGoBack:r.newStack}})}e(v())}}})(ee);function xe({vendorIdParam:e,accountContext:t}){const n=w(),a=C(),o=j(),{vendorId:s,billId:c}=P(),d=e??s,r=U.getSignedInUser(),{useFeatureGate:i}=R(),b=O(),g=h(u=>V(u)),x=p(a.state?.pathnameStackToGoBack),f=t??(x.poppedPathname?.includes("vendor")===!0?"vendor":"billDetail"),m=h(u=>k(u,d)),{isFeatureEnabled:I}=i(S.isVendorRecommendationFeatureEnabled),{isFeatureEnabled:y}=i(S.isDepositAccountsFeatureEnabled);if(r==null)throw Error("Can't access address page without signing in...");return f==="billDetail"&&m.editVendorState?.saveStatus.fetchState==="In-Progress"?l.jsx(Z,{fetchState:m.editVendorState?.saveStatus.fetchState??"Not-Started",style:{backgroundColor:b.colors.grey5,boxShadow:`0px 2px ${z.sp1} ${b.colors.dropShadowNormal}`}}):l.jsxs(re,{windowSize:o,children:[l.jsx(_,{vendorId:d,billId:c}),l.jsx(ce,{location:a,navigate:n,billId:c,vendorId:d,currentTenant:g,bankAccountContext:f,isVendorRecommendationEnabled:I,isZeniAccountsFeatureEnabled:y})]})}const $=(e=2)=>{let t="../";for(let n=0;n<e;n++)t=`${t}../`;return t};export{fe as A,xe as D,_ as V,me as a,se as b,ke as c,Se as d,he as g,ge as i,ve as v};
@@ -0,0 +1 @@
1
+ import{j as i}from"./liveblocks-D0ylGz77.js";import{K as c,E as l,m as f}from"./index-CPG6ITBm.js";import{D as b}from"./mui-D9TDAUAO.js";import"./sentry-C5UCCkb_.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]="b4f83c93-6b8c-4125-b836-c9db747f101c",e._sentryDebugIdIdentifier="sentry-dbid-b4f83c93-6b8c-4125-b836-c9db747f101c")}catch{}})();const p={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)??p.drawerLeftMargin.valuePx(n),d=f();return i.jsx(b,{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};
@@ -0,0 +1 @@
1
+ import{j as s}from"./liveblocks-D0ylGz77.js";import{a as d}from"./sentry-C5UCCkb_.js";import{j as B,h as G,u as q,l as F,g as l,N as K,k as L,n as O,o as N}from"./core-DSsu1iyO.js";import{LA as _,eR as R,KZ as z,kD as H,Hz as b,LF as M,Ks as W,jD as Y,HA as S,L2 as $,L3 as V,Ku as Z,Kt as J}from"./zeni-epic-state-CFQMpWBE.js";import{aO as Q,d as U,q as X,s as tt}from"./index-CPG6ITBm.js";import"./mui-D9TDAUAO.js";import{d as k}from"./decodeURIComponentSafe-CRFR6Y3w.js";import{w as et}from"./withTransactionSidePanel-xau0uwsY.js";import{f as at,c as nt}from"./routePaths-1uJ5ric0.js";import"./recharts-C7IODwRw.js";import"./analytics-CQQ1PG0J.js";import"./plaid-mYHRXlz3.js";import"./dnd-Dok8dils.js";import"./stripe-DMRn4zHo.js";import"./lottie-Cu765PFn.js";import"./lexical-DO7p5ZXM.js";import"./pdf-BzjCkfw3.js";import"./utils-Cd1icpH6.js";import"./useAskAiCfoHostNavButtonProps-DaoVDdk6.js";import"./useFetchSuggestedQuestionsWhenReady-IH_yzaTd.js";import"./TransactionDetailScreen-AbBGaDF8.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]="7f0463ac-9e99-4f70-bd2b-3328a0037b59",a._sentryDebugIdIdentifier="sentry-dbid-7f0463ac-9e99-4f70-bd2b-3328a0037b59")}catch{}})();const ot=L(function(a,t){const e=t.entity,o=M(a,t.entity,"EntityDetail");return{selectedEntity:e,autoCompleteData:{autoCompleteText:e.name,entityAutoCompleteView:W(a,"common")},trendWithTransactionsReport:o,analytics:U,isAccountingClassesEnabled:Y(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(Z({searchString:e,searchOrigin:"common"})):e.trim().length===0&&a(J("common"))},onAutoCompleteEntity:e=>{const o=at(e,t.tenantEmailDomain);a($()),a(V()),t.resetTrendIsFetchedStates(),t.navigate(o,{replace:!0,state:{pathnameStackToGoBack:t.location.state?.pathnameStackToGoBack}})},onCancelAutoComplete:()=>{const e=X(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(S(t.entity,"EntityDetail",{timeframe:"quarter",timePeriod:t.defaultTransactionTimePeriod}));else{const o=e.currentTimePeriod==null?e.addTimePeriod:{startDate:e.addTimePeriod.startDate,endDate:e.currentTimePeriod.endDate};a(b(t.entity,"EntityDetail",{timeframe:e.timeframe,timePeriod:e.addTimePeriod})),a(S(t.entity,"EntityDetail",{timeframe:e.timeframe,timePeriod:o}))}}}})(Q),it=et(function({entityType:a,...t}){const e=B(),o=G(),c=q(),[m,T]=d.useState(!1),[h,D]=d.useState(!1),{tenantEmailDomain:C,entityIdEncoded:j,entityNameEncoded:x}=F(),r=k(j??""),p=k(x??""),u=rt(r,p),v=[r,p].filter(n=>n!=null),i={name:p,id:r,type:a,zeniId:r,qboId:r},g=l(n=>_(n.customerIncomeState,n.vendorExpenseState,n.trendState,i,"quarter")),w=l(n=>R(n).company?.companyInfo.firstMonthOfFY??1),f=l(n=>z(n.trendWithTransactionsState,i,"EntityDetail"));d.useEffect(()=>{m===!1&&u===!0&&(T(!0),o(H(i)))},[m,u,i]);const E=l(n=>n.trendState.fetchState),P=f?.selectedPeriod?.timePeriod??g,A=function(n,y){return n!=null&&y!=null?{startDate:n.startDate,endDate:y?.endDate}:y}(f?.selectedPeriod?.timePeriod,g);return d.useEffect(()=>{m===!0&&h===!1&&E==="Completed"&&(D(!0),P!=null&&o(b(i,"EntityDetail",{timeframe:f?.selectedPeriod?.timeframe??"quarter",timePeriod:P})))},[m,h,E]),u?s.jsx(ot,{firstMonthOfFY:w,tenantEmailDomain:C,location:c,navigate:e,entity:i,defaultTransactionTimePeriod:A,resetTrendIsFetchedStates:()=>{T(!1),D(!1)},...t}):s.jsx(K,{to:I(v.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 xt({entityType:a}){return s.jsx(O,{children:s.jsx(N,{path:"/:entityIdEncoded/:entityNameEncoded/*",element:s.jsx(it,{entityType:a})})})}export{xt as EntityDetailRoutes,xt as default};
@@ -1,11 +1,11 @@
1
- import{j as C}from"./liveblocks-CCyJOwfy.js";import xn from"./NotFoundScreen-D1-E1kBF.js";import{a,b as wt}from"./sentry-Wnm-N8eT.js";import{n as Fe,S as Rn}from"./mui-DtV_yZlj.js";import{h as ce,j as Pt,u as Ge,g as U,k as Dn,l as rt,n as Un,o as Le}from"./core-Bv8kdUko.js";import{eR as Re,PX as Fn,n1 as Se,fh as Bn,qE as _n,nj as xt,nE as Rt,PY as Dt,nO as Vn,PZ as Ut,nc as On,qa as Mn,f0 as pe,P_ as De,sK as Ft,BZ as Bt,P$ as _t,Q0 as jn,pR as qe,LB as dt,LD as Ln,jG as zn,LE as Qn,jN as $n,cW as Gn,tR as Ye,np as Vt,nT as Ue,Q1 as qn,Ku as ut,Kt as we,Q2 as mt,k2 as Yn,Q3 as Nn,Q4 as Jn,Q5 as Kn,Q6 as Zn,nw as Hn,nh as ie,nW as Pe,Q7 as Wn,Q8 as Xn,Q9 as ea,o1 as ta,jR as na,jI as aa,Qa as oa,jQ as ht,LL as sa,Qb as ca,Qc as ia,pN as la,ps as ra,nU as ge,pr as ze,Qd as da,Qe as ua,ll as ma,bq as ha,lg as pt,l2 as pa,Qf as ga,gP as gt,fT as Ca,ld as Sa,vK as Ia,Qg as fa,os as ka,on as Ea,or as va,oc as ya,Qh as ba,f3 as Ot,nH as Aa,ns as Ta,fi as Ct,nY as wa,Qi as Pa,nV as Mt,Qj as xa,Qk as Ra,Ql as Da,Qm as Ua,Qn as St,pZ as Fa,pi as Ba,Ks as _a,jP as Va,Qo as Oa,Gv as Ma,jO as ja,jD as La,f2 as za,oT as jt,pa as Qa,nS as It,nX as $a,bE as Ga,la as qa,l7 as Ya,Qp as Na,ob as ft,p8 as kt,p6 as Ja,oY as Ka,oD as Za,p9 as Ha,Qq as Wa,Qr as Xa,oH as eo,Qs as to,ox as no,oG as ao,oE as oo,pd as so}from"./zeni-epic-state-CIBk9-EN.js";import{C as Lt,A as Ce,c as L,v as Z,W as zt,cw as co,z as Be,cx as io,aq as xe,cy as lo,aQ as Et,B as Qt,cz as ro,an as Qe,D as uo,cA as mo,Z as ho,cB as po,V as go,cC as Co,cD as So,w as Io,T as fo,aK as ko,b1 as Eo,F as vo,cE as yo}from"./index-BIwQAhFv.js";import{u as $t}from"./useAskAiCfoHostNavButtonProps-DHofygYw.js";import{c as Gt}from"./useFetchSuggestedQuestionsWhenReady-BWzQNqoL.js";import{c as vt,C as bo}from"./TransactionDetailScreen-Cffx3kdg.js";import{w as Ao}from"./withTransactionSidePanel-NOFN_NLa.js";import{h as To,v as wo}from"./routePaths-BjY4Hbs8.js";import{g as $e}from"./accountMappingHelper-9C6A5WnC.js";import{D as Po}from"./DrawerScreen-CtmWzT0D.js";import"./recharts-DdIjbBfI.js";import"./analytics-B6udoEJT.js";import"./plaid--kCGp3zU.js";import"./dnd-BIjMGuxw.js";import"./stripe-DMRn4zHo.js";import"./lottie-DL8N42Il.js";import"./lexical-DOh49tNP.js";import"./pdf-BcmiSEKK.js";import"./utils-CRtSAyQU.js";import"./decodeURIComponentSafe-DeA-_wid.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]="df943c4c-8c21-416e-925e-f03629ad4786",t._sentryDebugIdIdentifier="sentry-dbid-df943c4c-8c21-416e-925e-f03629ad4786")}catch{}})();const xo=()=>{const t=ce(),i=Pt(),A=Ge(),f=U(d=>Re(d)),{useFeatureGate:E}=Lt(),{isFeatureEnabled:g}=E(Ce.isRealtimeInsightsFeatureEnabled),u=U(d=>d.expenseAutomationViewState.selectedPeriodByTenantId),o=U(d=>Fn(d,f.tenantId)),{isAiCfoAccessEnabled:v,onAskAiCfoClick:S}=$t({mobileExploreReferrer:"Month-End Close Overview"}),m=a.useCallback((d,R,J=!1)=>{t(Se({tenantId:R,period:{month:d.month,year:d.year},refreshViewInBackground:J}))},[]),y=a.useCallback(d=>{const R=A.state?.referrer;o.monthEndCloseChecks?.auditSummary!=null&&L.trackMonthCloseAuditPage(d.month,d.year,o.monthEndCloseChecks.reportEmailSentDate!=null?"closed":"in-review",o.monthEndCloseChecks.auditSummary.auditScorePercentage,!1,R??null),t(Bn(f.tenantId,d))},[f.tenantId,o.monthEndCloseChecks?.auditSummary,o.monthEndCloseChecks?.reportEmailSentDate]),r=u[f.tenantId],B=a.useCallback(()=>{const d=A.state?.referrer;o.monthEndCloseChecks?.auditSummary!=null&&L.trackMonthCloseAuditPage(r.month,r.year,o.monthEndCloseChecks.reportEmailSentDate!=null?"closed":"in-review",o.monthEndCloseChecks.auditSummary.auditScorePercentage,!0,d??null),m(r,f.tenantId,!0)},[m,r,f.tenantId,o.monthEndCloseChecks?.auditSummary,o.monthEndCloseChecks?.reportEmailSentDate]),h=Z(A.state?.pathnameStackToGoBack,A.pathname),T=a.useCallback(()=>{if(o.monthEndCloseChecks!=null&&r!=null){const d=o.monthEndCloseChecks.monthEndCloseCheckList.find(R=>R.progress<100);if(d!=null)return void i(`./${d.id}/${r.month}-${r.year}`,{state:{pathnameStackToGoBack:h,message:"comingFromOverview"}});i(`./month_end_insights/${r.month}-${r.year}`,{state:{pathnameStackToGoBack:h,message:"comingFromOverview"}})}},[o.monthEndCloseChecks,r]),{areTenantIdsInSync:I}=zt();return Gt({isDataReady:o.fetchState==="Completed"}),a.useEffect(()=>{r!=null&&o.fetchState!=="In-Progress"&&o.fetchState!=="Completed"&&I&&m(r,f.tenantId)},[m,r,o.fetchState,f.tenantId,I]),a.useEffect(()=>{r!=null&&o.monthClosePerformanceTrendFetchStatus.fetchState!=="In-Progress"&&o.monthClosePerformanceTrendFetchStatus.fetchState!=="Completed"&&I&&t(_n(r))},[r,o.monthClosePerformanceTrendFetchStatus.fetchState,I]),a.useEffect(()=>{const d=setInterval(()=>{o.fetchState!=="In-Progress"&&o.fetchState==="Completed"&&B()},3e5);return()=>clearInterval(d)},[o.fetchState]),a.useEffect(()=>{if(o.fetchState==="Completed"&&o.monthEndCloseChecks?.auditSummary!=null){const d=A.state?.referrer;L.trackMonthCloseAuditPage(o.selectedPeriod.month,o.selectedPeriod.year,o.monthEndCloseChecks.reportEmailSentDate!=null?"closed":"in-review",o.monthEndCloseChecks.auditSummary.auditScorePercentage,!1,d??null)}},[o.fetchState,o.selectedPeriod,o.monthEndCloseChecks?.auditSummary,o.monthEndCloseChecks?.reportEmailSentDate]),C.jsx(Ro,{children:C.jsx(co,{monthEndCloseChecksView:o,isRealtimeInsightsFeatureEnabled:g,onMonthEndCheckClick:d=>{i(`./${d}/${r.month}-${r.year}`,{state:{pathnameStackToGoBack:h,message:"comingFromOverview",referrer:"Expense Automation - Overview"}})},onPeriodChange:y,handleReviewButtonClick:T,onBackClick:()=>{i("../../dashboard")},onReload:B,isAiCfoAccessEnabled:v,onAskAiCfoClick:S})})},Ro=Fe.div`
1
+ import{j as C}from"./liveblocks-D0ylGz77.js";import xn from"./NotFoundScreen-B1k_jOem.js";import{a,b as Pt}from"./sentry-C5UCCkb_.js";import{n as Fe,S as Rn}from"./mui-D9TDAUAO.js";import{h as ce,j as wt,u as Ge,g as U,k as Dn,l as rt,n as Un,o as Le}from"./core-DSsu1iyO.js";import{eR as Re,PX as Fn,n1 as Se,fh as Bn,qE as _n,nj as xt,nE as Rt,PY as Dt,nO as Vn,PZ as Ut,nc as On,qa as Mn,f0 as pe,P_ as De,sK as Ft,BZ as Bt,P$ as _t,Q0 as jn,pR as qe,LB as dt,LD as Ln,jG as zn,LE as Qn,jN as $n,cW as Gn,tR as Ye,np as Vt,nT as Ue,Q1 as qn,Ku as ut,Kt as Pe,Q2 as mt,k2 as Yn,Q3 as Nn,Q4 as Jn,Q5 as Kn,Q6 as Zn,nw as Hn,nh as ie,nW as we,Q7 as Wn,Q8 as Xn,Q9 as ea,o1 as ta,jR as na,jI as aa,Qa as oa,jQ as ht,LL as sa,Qb as ca,Qc as ia,pN as la,ps as ra,nU as ge,pr as ze,Qd as da,Qe as ua,ll as ma,bq as ha,lg as pt,l2 as pa,Qf as ga,gP as gt,fT as Ca,ld as Sa,vK as Ia,Qg as fa,os as ka,on as Ea,or as va,oc as ya,Qh as ba,f3 as Ot,nH as Aa,ns as Ta,fi as Ct,nY as Pa,Qi as wa,nV as Mt,Qj as xa,Qk as Ra,Ql as Da,Qm as Ua,Qn as St,pZ as Fa,pi as Ba,Ks as _a,jP as Va,Qo as Oa,Gv as Ma,jO as ja,jD as La,f2 as za,oT as jt,pa as Qa,nS as It,nX as $a,bE as Ga,la as qa,l7 as Ya,Qp as Na,ob as ft,p8 as kt,p6 as Ja,oY as Ka,oD as Za,p9 as Ha,Qq as Wa,Qr as Xa,oH as eo,Qs as to,ox as no,oG as ao,oE as oo,pd as so}from"./zeni-epic-state-CFQMpWBE.js";import{C as Lt,A as Ce,d as L,s as Z,V as zt,cw as co,z as Be,cx as io,aq as xe,cy as lo,aQ as Et,B as Qt,cz as ro,an as Qe,D as uo,cA as mo,Y as ho,cB as po,U as go,cC as Co,cD as So,I as Io,c as fo,aK as ko,b1 as Eo,E as vo,cE as yo}from"./index-CPG6ITBm.js";import{u as $t}from"./useAskAiCfoHostNavButtonProps-DaoVDdk6.js";import{c as Gt}from"./useFetchSuggestedQuestionsWhenReady-IH_yzaTd.js";import{c as vt,C as bo}from"./TransactionDetailScreen-AbBGaDF8.js";import{w as Ao}from"./withTransactionSidePanel-xau0uwsY.js";import{h as To,v as Po}from"./routePaths-1uJ5ric0.js";import{g as $e}from"./accountMappingHelper-BEJScFAE.js";import{D as wo}from"./DrawerScreen-DTfCd2en.js";import"./recharts-C7IODwRw.js";import"./analytics-CQQ1PG0J.js";import"./plaid-mYHRXlz3.js";import"./dnd-Dok8dils.js";import"./stripe-DMRn4zHo.js";import"./lottie-Cu765PFn.js";import"./lexical-DO7p5ZXM.js";import"./pdf-BzjCkfw3.js";import"./utils-Cd1icpH6.js";import"./decodeURIComponentSafe-CRFR6Y3w.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]="6d1442eb-fc7d-491e-853e-5c6e63dc13a3",t._sentryDebugIdIdentifier="sentry-dbid-6d1442eb-fc7d-491e-853e-5c6e63dc13a3")}catch{}})();const xo=()=>{const t=ce(),i=wt(),A=Ge(),f=U(d=>Re(d)),{useFeatureGate:E}=Lt(),{isFeatureEnabled:g}=E(Ce.isRealtimeInsightsFeatureEnabled),u=U(d=>d.expenseAutomationViewState.selectedPeriodByTenantId),o=U(d=>Fn(d,f.tenantId)),{isAiCfoAccessEnabled:v,onAskAiCfoClick:S}=$t({mobileExploreReferrer:"Month-End Close Overview"}),m=a.useCallback((d,R,J=!1)=>{t(Se({tenantId:R,period:{month:d.month,year:d.year},refreshViewInBackground:J}))},[]),y=a.useCallback(d=>{const R=A.state?.referrer;o.monthEndCloseChecks?.auditSummary!=null&&L.trackMonthCloseAuditPage(d.month,d.year,o.monthEndCloseChecks.reportEmailSentDate!=null?"closed":"in-review",o.monthEndCloseChecks.auditSummary.auditScorePercentage,!1,R??null),t(Bn(f.tenantId,d))},[f.tenantId,o.monthEndCloseChecks?.auditSummary,o.monthEndCloseChecks?.reportEmailSentDate]),r=u[f.tenantId],B=a.useCallback(()=>{const d=A.state?.referrer;o.monthEndCloseChecks?.auditSummary!=null&&L.trackMonthCloseAuditPage(r.month,r.year,o.monthEndCloseChecks.reportEmailSentDate!=null?"closed":"in-review",o.monthEndCloseChecks.auditSummary.auditScorePercentage,!0,d??null),m(r,f.tenantId,!0)},[m,r,f.tenantId,o.monthEndCloseChecks?.auditSummary,o.monthEndCloseChecks?.reportEmailSentDate]),h=Z(A.state?.pathnameStackToGoBack,A.pathname),T=a.useCallback(()=>{if(o.monthEndCloseChecks!=null&&r!=null){const d=o.monthEndCloseChecks.monthEndCloseCheckList.find(R=>R.progress<100);if(d!=null)return void i(`./${d.id}/${r.month}-${r.year}`,{state:{pathnameStackToGoBack:h,message:"comingFromOverview"}});i(`./month_end_insights/${r.month}-${r.year}`,{state:{pathnameStackToGoBack:h,message:"comingFromOverview"}})}},[o.monthEndCloseChecks,r]),{areTenantIdsInSync:I}=zt();return Gt({isDataReady:o.fetchState==="Completed"}),a.useEffect(()=>{r!=null&&o.fetchState!=="In-Progress"&&o.fetchState!=="Completed"&&I&&m(r,f.tenantId)},[m,r,o.fetchState,f.tenantId,I]),a.useEffect(()=>{r!=null&&o.monthClosePerformanceTrendFetchStatus.fetchState!=="In-Progress"&&o.monthClosePerformanceTrendFetchStatus.fetchState!=="Completed"&&I&&t(_n(r))},[r,o.monthClosePerformanceTrendFetchStatus.fetchState,I]),a.useEffect(()=>{const d=setInterval(()=>{o.fetchState!=="In-Progress"&&o.fetchState==="Completed"&&B()},3e5);return()=>clearInterval(d)},[o.fetchState]),a.useEffect(()=>{if(o.fetchState==="Completed"&&o.monthEndCloseChecks?.auditSummary!=null){const d=A.state?.referrer;L.trackMonthCloseAuditPage(o.selectedPeriod.month,o.selectedPeriod.year,o.monthEndCloseChecks.reportEmailSentDate!=null?"closed":"in-review",o.monthEndCloseChecks.auditSummary.auditScorePercentage,!1,d??null)}},[o.fetchState,o.selectedPeriod,o.monthEndCloseChecks?.auditSummary,o.monthEndCloseChecks?.reportEmailSentDate]),C.jsx(Ro,{children:C.jsx(co,{monthEndCloseChecksView:o,isRealtimeInsightsFeatureEnabled:g,onMonthEndCheckClick:d=>{i(`./${d}/${r.month}-${r.year}`,{state:{pathnameStackToGoBack:h,message:"comingFromOverview",referrer:"Expense Automation - Overview"}})},onPeriodChange:y,handleReviewButtonClick:T,onBackClick:()=>{i("../../dashboard")},onReload:B,isAiCfoAccessEnabled:v,onAskAiCfoClick:S})})},Ro=Fe.div`
2
2
  display: flex;
3
3
  height: 100vh;
4
4
  width: 100%;
5
5
  flex: 1 1 auto;
6
6
  flex-direction: column;
7
7
  background-color: ${t=>t.theme.colors.grey4};
8
- `,Do=wt.memo(({reconciliation:t,selectedDrawerAccountId:i,onClose:A,onFetchLinkTokenClick:f,onEstablishConnectionClick:E})=>{const g=ce(),u=Be.getSignedInUser(),o=U(e=>Re(e)),v=t.excludedAccountIDs,S=a.useMemo(()=>({userId:u?.userId??"",sessionId:u?.zeniSessionId??"",tenantId:o?.tenantId??""}),[u?.userId,u?.zeniSessionId,o?.tenantId]),{accountReconciliationsByAccountID:m,monthYearPeriod:y,statementUploadChosen:r}=t,B=m[i],h=B?.accountReconEntity.statementMetaData?.statementUploadId,T=(e,n)=>{g(Mn(e,n.split(".")[0]))},I=e=>{h!=null&&g(On({accountId:i,selectedPeriod:y,fileId:e,statementUploadId:h}))},d=()=>{g(Dt({statementUploadChosen:!1}))},R=e=>{g(Vn({accountId:i,selectedPeriod:y,payload:e}))},J=e=>{g(Ut({accountId:i,selectedPeriod:y,localData:{accountSource:e}}))},te=a.useCallback(()=>{g(xt({accountId:i}))},[g,i]),M=a.useCallback(()=>{g(Rt({accountId:i}))},[g,i]),_=v.includes(i)?t.excludedAccountReconciliationByAccountID[i]:void 0;return B!=null?C.jsx(yt,{children:C.jsx(bt,{children:C.jsx(io,{excludeAccountFetch:t.excludeAccountFetchState,accountReconciliation:B,monthYearPeriod:y,onDismissClick:A,plaidConnectionDetails:t.plaidConnectionDetails,onFetchLinkTokenClick:f,onEstablishConnectionClick:E,onEditFileName:T,onDeleteFile:I,onSelectSourceType:J,filesEndPoint:xe.fileMicroServiceBaseUrl,authParams:S,openFilePicker:r,onStatementUploadSuccess:R,onUploadWindowOpenedOnce:d,onExcludeFromReconciliation:te})})}):_!=null?C.jsx(yt,{children:C.jsx(bt,{children:C.jsx(lo,{excludedAccountReconciliation:_,includeAccountFetch:t.includeAccountFetchState,onIncludeIntoReconciliation:M})})}):null}),yt=Fe.div`
8
+ `,Do=Pt.memo(({reconciliation:t,selectedDrawerAccountId:i,onClose:A,onFetchLinkTokenClick:f,onEstablishConnectionClick:E})=>{const g=ce(),u=Be.getSignedInUser(),o=U(e=>Re(e)),v=t.excludedAccountIDs,S=a.useMemo(()=>({userId:u?.userId??"",sessionId:u?.zeniSessionId??"",tenantId:o?.tenantId??""}),[u?.userId,u?.zeniSessionId,o?.tenantId]),{accountReconciliationsByAccountID:m,monthYearPeriod:y,statementUploadChosen:r}=t,B=m[i],h=B?.accountReconEntity.statementMetaData?.statementUploadId,T=(e,n)=>{g(Mn(e,n.split(".")[0]))},I=e=>{h!=null&&g(On({accountId:i,selectedPeriod:y,fileId:e,statementUploadId:h}))},d=()=>{g(Dt({statementUploadChosen:!1}))},R=e=>{g(Vn({accountId:i,selectedPeriod:y,payload:e}))},J=e=>{g(Ut({accountId:i,selectedPeriod:y,localData:{accountSource:e}}))},te=a.useCallback(()=>{g(xt({accountId:i}))},[g,i]),M=a.useCallback(()=>{g(Rt({accountId:i}))},[g,i]),_=v.includes(i)?t.excludedAccountReconciliationByAccountID[i]:void 0;return B!=null?C.jsx(yt,{children:C.jsx(bt,{children:C.jsx(io,{excludeAccountFetch:t.excludeAccountFetchState,accountReconciliation:B,monthYearPeriod:y,onDismissClick:A,plaidConnectionDetails:t.plaidConnectionDetails,onFetchLinkTokenClick:f,onEstablishConnectionClick:E,onEditFileName:T,onDeleteFile:I,onSelectSourceType:J,filesEndPoint:xe.fileMicroServiceBaseUrl,authParams:S,openFilePicker:r,onStatementUploadSuccess:R,onUploadWindowOpenedOnce:d,onExcludeFromReconciliation:te})})}):_!=null?C.jsx(yt,{children:C.jsx(bt,{children:C.jsx(lo,{excludedAccountReconciliation:_,includeAccountFetch:t.includeAccountFetchState,onIncludeIntoReconciliation:M})})}):null}),yt=Fe.div`
9
9
  display: flex;
10
10
  flex-direction: column;
11
11
  height: 100%;
@@ -18,7 +18,7 @@ import{j as C}from"./liveblocks-CCyJOwfy.js";import xn from"./NotFoundScreen-D1-
18
18
  min-width: 0;
19
19
  overflow-x: hidden;
20
20
  overflow-y: auto;
21
- `;function Uo({companyId:t,closeCustomerRequestDrawer:i,addCustomerRequest:A,resetCustomerRequest:f}){const E=Be.getSignedInUser();if(E==null)throw Error("Can't access Customer Request page without signing in...");const g=U(u=>jn(u,t,E));return a.useEffect(()=>{f()},[]),C.jsx(C.Fragment,{children:g.fetchState==="In-Progress"||g.companyMonthEndReportTemplatesData.fetchState==="In-Progress"?C.jsx(Qt,{fetchState:"In-Progress"}):C.jsx(ro,{onCloseClick:i,addCustomerRequest:A,snippets:g.companyMonthEndReportTemplatesData,bulletPoints:g.zeniRequestsData??[]})})}const Fo=t=>t.sections.generalExpense.vendors.length+t.sections.reimbursement.vendors.length,{common:{strings:{hyphen:Bo,comma:At,space:_o}},dateFormat:qt}=uo.getLocalizedStrings(),Tt=so,Vo=Dn(function(t,i){const{uncategorizedAccounts:A,vendorSearchAutoCompleteData:f,monthEndInsightsCustomerRequestData:E,monthEndInsightsPreviewMode:g,companyId:u,isMissingReceiptsBulkUploadEnabled:o,isTransactionActivityEnabled:v}=i,S=Be.getSignedInUser(),m=t.tenantState.currentTenantId,y={userId:S?.userId??"",sessionId:S?.zeniSessionId??"",tenantId:m??""},r=pe(t),{selectedTransactionCategorizationTab:B}=r;return{expenseAutomationViewSelector:r,bulkUploadSelector:o===!0?r.missingReceipts.bulkUpload:void 0,vendorSearchAutoCompleteData:f,authParams:y,receiptUploadEndpoint:`${xe.accountMicroServiceBaseUrl}`,transactionAttachmentsEndpoint:`${ho}/transaction_attachments`,bulkUploadEndpoint:o===!0?`${xe.communicationAgentMicroServiceBaseUrl}/1.0/receipts/bulk-upload`:void 0,isDisabled:!1,currentTab:B,monthEndInsightsCustomerRequestData:E,monthEndInsightsPreviewMode:g,allThreadsSectionOpen:!1,enableMonthEndInsightsZeniGPTFeature:!1,loggedInUser:S,uncategorizedAccounts:A,companyId:u,isTransactionActivityEnabled:v}},function(t,i){const{themeState:A,isAccountingClassesEnabled:f,isCOTEnabled:E,isUncategorizedExpenseCategoryEnabled:g,isMissingReceiptsBulkUploadEnabled:u,location:o,vendorSearchAutoCompleteData:v,expenseAutomationViewSelector:S,currentTenant:m,uncategorizedAccounts:y,navigate:r,onClickCustomerRequest:B,handleEditClick:h,setActivityLogTransactionId:T}=i,{selectedPeriod:I,currentSelectedView:d,reconciliation:{selectedAccountId:R}}=S,{accountSettingsView:J}=S.jeSchedules,te=Vt(I),M=Ue(te.start),_=Ue(te.end);return{onZeniLogoClick:()=>{A.toggle()},onUploadReceiptAttachment:e=>{L.trackMissingReceiptAttached(I.month,I.year),t(Ba(e))},onUploadTransactionReceipt:(e,n,s,l,k,p)=>{t(St(e,n,{fetchState:"In-Progress"}));const b=()=>t(St(e,n,{fetchState:"Error"}));po(`${xe.accountMicroServiceBaseUrl}/1.0/transactions/${n}/attachments`,p,n,s,l,k).then(w=>{w!=null?t(Fa(e,w)):b()}).catch(b)},onMissingReceiptsRowClick:(e,n)=>{if(i.openTransactionPanel)return void i.openTransactionPanel(e,n);const s=Z(o.state?.pathnameStackToGoBack,o.pathname);r(`../../transaction/${n}/${e}`,{state:{pathnameStackToGoBack:s,message:"expenseAutomation",origin:"missing_receipts"}})},onUploadReceiptComplete:(e,n)=>{t(Ua(e,n)),m!=null&&t(Se({tenantId:m.tenantId,period:n,refreshViewInBackground:!0}))},onUploadReceiptFetchStatus:(e,n,s,l)=>{t(Da(e,{fetchState:n,error:s})),s!=null&&t(gt({messageSection:"missing_receipts_attachment",messageText:"failed",type:"error",showStatusIcon:!0,variables:[{variableName:"__message__",variableValue:l!=null?_o+Bo+l+At:At}]}))},onUpdateJESchedulesUIState:e=>{t(Ra(e))},onUpdateMissingReceiptsUIState:e=>{t(xa(e))},onFetchMissingReceiptsList:()=>{_!=null&&M!=null&&t(Mt({start:M,end:_},{amount:75,currencyCode:"USD",currencySymbol:"$"},!0,!1))},...u===!0?{onBulkUploadFiles:e=>{t(oo(e))},onBulkUploadProgress:e=>{t(ao(e))},onBulkUploadSuccess:e=>{t(no({batchId:e}))},onBulkUploadUploadedFileCount:e=>{t(to(e))},onConfirmBulkUploadMatch:(e,n,s,l,k)=>{t(eo(e,n,s,l,k))},onBulkUploadConfirmMatchAcknowledged:()=>{t(Xa())},onSetBulkUploadResultsTab:e=>{t(Wa(e))},onSetBulkUploadCompletedSubTab:e=>{t(Ha(e))},onSetBulkUploadSortConfig:(e,n)=>{t(kt({sortKey:e,sortOrder:n}))},onClearBulkUpload:()=>{t(Za())},onSearchTransactionsForManualMatch:(e,n)=>{t(Tt(e,n??void 0))},onLoadMoreManualSearch:()=>{const{manualSearch:e}=S.missingReceipts.bulkUpload;e.nextPageToken!=null&&e.searchQuery!==""&&t(Tt(e.searchQuery,e.nextPageToken))},onFetchCompletedTransactions:(e,n)=>{t(Ka(e,n))},onFetchBulkUploadBatches:e=>{t(jt(e))},onFetchMoreBatchDetails:()=>{t(Ja())},onResetBulkUploadSort:()=>{t(kt({sortKey:void 0,sortOrder:void 0}))}}:{},onClearMissingReceiptsTabNavigation:()=>{t(Pa())},onSearchTextChanged:e=>{const n=S.currentSelectedView,s=S.selectedTransactionCategorizationTab;n==="transaction_categorization"&&(t(ze({selectedTab:s,uiState:{searchString:e}})),_!=null&&M!=null&&t(ge(s,{start:M,end:_},!0,!1,e,void 0,!0)))},onRefresh:()=>{i.trackExpenseAutomationTabAnalytics(!0),t(wa(g))},onClose:()=>{d==="reconciliation"&&R!=null&&t(Ct({selectedAccountId:void 0})),r("../")},onBack:()=>{d==="reconciliation"&&R!=null&&t(Ct({selectedAccountId:void 0}))},onSaveReconciliation:e=>{t(Ta(e))},onSaveReconciliationReview:e=>{t(Aa(e))},onUpdateStep:e=>{const{selectedPeriod:n}=S,s=Z(o.state?.pathnameStackToGoBack,o.pathname);r(`../${e}/${n.month}-${n.year}`,{state:{pathnameStackToGoBack:s,referrer:S.currentSelectedView}}),t(Ot(e))},handleLogOutClick:()=>{const e=Z(o.state?.pathnameStackToGoBack,o.pathname);r("/signout",{replace:!0,state:{pathnameStackToGoBack:e,message:"logout"}})},onJeAccountSettingsChange:e=>{const{vendorsAccountSection:n}=e,{prepaidExpensesAccount:s,fixedAssetsAccount:l,accruedExpensesAccount:k}=n,p=$e(J.prepaidExpensesAccountList,s.selectedOptions),b=$e(J.fixedAssetsAccountList,l.selectedOptions),w=$e(J.accruedExpensesAccountList,k.selectedOptions),V={selectedPrepaidExpensesAccountIds:p.map(P=>P.accountId),selectedFixedAssetsAccountIds:b.map(P=>P.accountId),selectedAccruedExpensesAccountIds:w.map(P=>P.accountId)};t(ba({data:V}))},onSaveJeAccountSettingsClick:()=>{t(ya())},onJESchedulesFormDataChange(e,n){const{jeScheduleID:s,accumulatedDepreciationCategory:l,scheduleClass:k,scheduleExpenseCategory:p,vendor:b}=n,{allAccountList:w,allClassList:V,allDepreciationAccountList:P}=S.jeSchedules,Q=v.entityAutoCompleteView.vendor.length>0?v.entityAutoCompleteView.vendor.find($=>$.id===b?.selectedOption):void 0,Ie={id:Q?.zeniId??b?.selectedOption??"",name:Q?.name??b?.defaultOptions.find($=>$.value===b?.selectedOption)?.label??"",logo:Q?.logo},fe=p?.selectedOption!=null?w.find($=>$.qboId===p.selectedOption):void 0,ke=k?.selectedOption!=null?V.find($=>$.classId===k.selectedOption):void 0,ne=l?.selectedOption!=null?P.find($=>$.qboId===l.selectedOption):void 0;t(va({scheduledJournalEntryID:e,localData:{jeScheduleID:s,scheduledJournalEntryID:e,updatedCategoryId:fe?.accountId,updatedClassId:ke?.classId,updatedAccumulatedDepreciationCategoryID:ne?.accountId,updatedVendor:{id:Ie.id,name:Ie.name}}}))},ignoreRecommendedJeSchedule(e,n){t(Ea(e,n))},vendorSearchAutoCompleteActions:{onAutoCompleteInputChange:(e,n)=>{e.trim().length>=2?t(ut({searchString:e,entityType:n,searchOrigin:"common"})):e.trim().length===0&&t(we("common"))},onCancelAutoComplete:()=>{t(we("common"))}},onPostJESchedule(e,n){t(ka({scheduledJournalEntryID:e,jeScheduleTransactionKey:n}))},clearJeScheduleLocalData(){t(fa())},handleJeScheduleClick:(e,n,s)=>{t(Ia({selectedJEScheduleKey:n}));const l=Z(o.state?.pathnameStackToGoBack,o.pathname);r(`../../vendors/schedules/${s}/details/${e}`,{state:{pathnameStackToGoBack:l,message:"expenseAutomation",origin:"je_schedules"}})},improveMonthEndInsightsUsingZeniGPTClick:e=>{m!=null&&t(Sa(e,m.companyId,m.tenantId))},onClickCustomerRequest:B,setActivityLogTransactionId:T,onCloseAllThreadsSection:()=>{},onCloseFileAttachmentSnackBar:()=>{t(Ca())},onOpenFileAttachmentSnackBar:()=>{t(gt({messageSection:"cockpit_month_end_email_attachment_upload",messageText:"failed",type:"error",showStatusIcon:!0}))},onRemoveFileAttachment:e=>{t(ga(e))},onUpdateFileAttachment:e=>{t(pa({files:e}))},previewMonthEndReport:(e,n,s,l)=>{m!=null&&t(pt(e,m.companyId,n,!0,s,l,m.tenantId))},saveMonthEndReport:(e,n,s,l)=>{m!=null&&t(pt(e,m.companyId,n,!1,s,l,m.tenantId))},onEditMonthEndInsightsClick:h,sendMonthEndReport:e=>{const n=o.state?.referrer,{selectedPeriod:s,auditSummary:l}=S;m!=null&&l?.auditScorePercentage!=null&&(t(ma(m.companyId,e,m.tenantId)),L.trackInsightsEmailPage(s.month,s.year,!1,"draft",l.auditScorePercentage,ha().format(qt.analytics.MMMDDCommaYYYYformat),n??null))},onTransactionCategorizationRowClick:(e,n)=>{if(i.openTransactionPanel)return void i.openTransactionPanel(e,n);const s=Z(o.state?.pathnameStackToGoBack,o.pathname);r(`../../transaction/${n}/${e}`,{state:{pathnameStackToGoBack:s,message:"expenseAutomation",origin:"transaction_categorization"}})},setLocalDataForCategoryAndClass:(e,n,s,l,k,p,b,w,V,P,Q)=>{t(ua(e,n,s,l,y,k,p,b,w,V,P,Q,f))},onCancelAutoComplete:()=>{t(we("common"))},updateExpenseAutomationReconListScrollPosition:e=>{t(mt({scrollPosition:e}))},onUpdateTab:e=>{i.closeSidePanel?.(),_!=null&&M!=null&&(t(ge(e,{start:M,end:_},!1,!1)),t(da(e)))},onUpdateTransactionCategorizationUIState:(e,n)=>{t(ze({selectedTab:e,uiState:n})),_!=null&&M!=null&&t(ge(e,{start:M,end:_},!1,!1,n.searchString,null,!0))},onUpdateScrollYOffSetTransactionCategorizationUIState:(e,n)=>{t(ze({selectedTab:e,uiState:n}))},onFetchTransactionCategorizationList:(e,n,s,l,k,p,b)=>{_!=null&&M!=null&&t(ge(e,{start:M,end:_},!0,s,n,l,k,p,b))},resetTransactionCategorizationLocalData:(e,n,s,l,k,p,b,w)=>{t(ra(e,n,s,l,w??null,k,p,!1,b))},updateSelectedVendorForTransaction:(e,n,s,l,k)=>{t(ht({selectedTab:e,transactionId:n,lineId:s,selectedTransaction:l,uncategorizedAccounts:y,updatedVendor:k,isAccountingClassesEnabled:f}))},onSaveUpdateTransactionCategorization:(e,n,s)=>{const l=o.state?.referrer;e==="autoCategorized"?L.trackTransactionsAutoCategorisedPage(I.month,I.year,S.transactionView.totalCountByTab.autoCategorized,n.length,!1,l??null):L.trackTransactionsReviewPage(I.month,I.year,S.transactionView.totalCountByTab.review,n.length,!1,l??null),t(la(e,n,s,g))},onUpdateSelectedCheckboxTransactionIds:(e,n)=>{t(ia({selectedTab:e,transactionIds:n}))},onFetchRecommendationsForEntityCategorizationWithCustomer:(e,n,s,l,k,p,b)=>{const{transactionId:w,transaction:V,lineIds:P}=n;p!=null&&t(sa({transactionId:w,customerUpdates:p})),t(ca({selectedTab:l,transactionId:w.id,lineId:P[0],selectedTransaction:V,uncategorizedAccounts:y,updatedCustomer:p,selectedEntity:k,isAccountingClassesEnabled:f,isUncategorizedExpenseCategoryEnabled:b})),k!=null&&t(Ye(k,e,n,s,!0,E,b))},onFetchRecommendationsForEntityCategorization:(e,n,s,l,k,p,b)=>{const{transactionId:w,transaction:V,lineIds:P}=n;p!=null&&(t(na({transactionId:w,vendorUpdates:{name:p.name,id:p.id?p.id:void 0}})),t(aa({vendorId:p.id?p.id:void 0,localData:{vendorName:p.name,vendorId:p.id?p.id:void 0}}))),p?.id?(t(ht({selectedTab:l,transactionId:w.id,lineId:P[0],selectedTransaction:V,uncategorizedAccounts:y,updatedVendor:p,selectedEntity:k,isAccountingClassesEnabled:f,isUncategorizedExpenseCategoryEnabled:b})),k!=null&&t(Ye(k,e,n,s,!0,E,b))):t(oa({selectedTab:l,transactionId:w.id,lineId:P[0]}))},fetchFluxViewOnScroll:(e,n)=>{t(Pe(e,!0,!1,n,!1,!0))},onFetchFluxViewList:()=>{t(Pe(I,!0,!1,null,!1,!1))},markAsReview:(e,n,s,l)=>{L.trackFluxAnalysisReviewed(s.month,s.year,l??!1,e),t(ta(n,e,s,l??!1))},onUpdateFluxAnalysisUIState:e=>{t(ea(e))},updateOperatingExpensesIdsForReview:e=>{t(Xn({operatingExpenseIds:e,selectedPeriod:I}))},redirectToVendorDetailPage:e=>{if(i.tenantEmailDomain!=null){const n=wo(e.id,e.qboId,i.tenantEmailDomain),s=Z(i.location.state?.pathnameStackToGoBack,i.location.pathname);i.navigate(n,{state:{pathnameStackToGoBack:s,message:"expenseAutomation",referrer:"Vendor List",origin:"flux_analysis"}})}},updateSectionIdsForReview:e=>{t(Wn({sectionId:e,selectedPeriod:I}))},onFetchReimbursementView:(e,n,s)=>{t(Pe(e,!0,!1,n,!0,s))},onReviewClicked:e=>{t(ie(I,e))},setOpenDrawerClicked:e=>{t(De({selectedDrawerAccountId:e}))},onFetchLinkTokenClick:(e,n)=>{t(Ft("expense_automation_reconcile",e,n))},onEstablishConnectionClick:(e,n)=>{const s=m?.companyId;s!=null&&(t(Bt(e,s,"expense_automation_reconcile",void 0,"link_account_no_microdeposit",n)),t(_t({accountId:n,connectionInProgress:!0})))},onAddStatementClick:e=>{t(De({selectedDrawerAccountId:e})),t(Ut({accountId:e,selectedPeriod:I,localData:{accountSource:"bank_statement"}})),t(Dt({statementUploadChosen:!0}))},onReloadReconciliationListPage:()=>{t(ie(I,void 0,!0,!1))},onUpdateReconcileTabLocalData:e=>{t(Hn({selectedTransactionIds:e}))},onReconTabColumnSortConfigChanged:(e,n)=>{t(Zn({sortKey:e,sortOrder:n}))},onReconReviewTabColumnSortConfigChanged:(e,n)=>{t(Kn({sortKey:e,sortOrder:n}))},onReconTabUpdate:e=>{i.closeSidePanel?.(),t(Jn({selectedTab:e}))},updateReconReviewTabLocalData:(e,n,s)=>{const l=e.vendor?.id;s&&l!=null&&t(Yn(l)),t(Nn({data:e,transactionId:n}))},onReconMatchedTransactionClick:e=>{if(i.openTransactionPanel)return void i.openTransactionPanel(e,qe("bill"));const n=Z(o.state?.pathnameStackToGoBack,o.pathname);r(`../../transaction/bill/${e}`,{state:{pathnameStackToGoBack:n,message:"expenseAutomation",origin:"reconciliation"}})},onReloadPage:()=>{window.location.reload()},onBackClick:()=>{r(-1)},onReconListPageScroll:e=>{t(mt({scrollPosition:e}))},onVendorAutoCompleteInputChange:e=>{e.trim().length>=2?t(ut({searchString:e,searchOrigin:"common"})):e.trim().length===0&&t(we("common"))},onReconNodeCollapseToggled:(e,n)=>{t(qn({nodeId:e,collapsed:n}))},updateSectionCollapseStatus:()=>{},onExcludeAccountFromReconciliation:e=>{t(xt({accountId:e}))},onIncludeAccountIntoReconciliation:e=>{t(Rt({accountId:e}))}}},(t,i,A)=>{const{isMissingReceiptsBulkUploadEnabled:f,...E}=A;return function(g,u,o){return{...g,...u,...o,onUploadTransactionReceipt:(v,S,m,y,r)=>{u.onUploadTransactionReceipt(v,S,m,y,r,g.authParams)}}}(t,i,E)})(mo),Oo=Ao(function(t){const i=t.displayName??t.name??"Component",A=wt.memo(t),f=E=>{const g=ce(),u=function(){const T=ce(),I=U(d=>pe(d).reconciliation.selectedDrawerAccountId);return{isOpen:I!=null,selectedAccountId:I,openPanel:a.useCallback(d=>{T(De({selectedDrawerAccountId:d}))},[T]),closePanel:a.useCallback(()=>{T(De({selectedDrawerAccountId:void 0}))},[T])}}(),o=U(T=>pe(T).reconciliation),v=U(T=>Re(T)),S=a.useCallback((T,I)=>{g(Ft("expense_automation_reconcile",T,I))},[g]),m=a.useCallback((T,I)=>{const d=v?.companyId;d!=null&&(g(Bt(T,d,"expense_automation_reconcile",void 0,"link_account_no_microdeposit",I)),g(_t({accountId:I,connectionInProgress:!0})))},[g,v?.companyId]),y=a.useMemo(()=>{if(u.isOpen&&u.selectedAccountId!=null)return C.jsx(Do,{reconciliation:o,selectedDrawerAccountId:u.selectedAccountId,onClose:u.closePanel,onFetchLinkTokenClick:S,onEstablishConnectionClick:m})},[u.isOpen,u.selectedAccountId,u.closePanel,o,S,m]),r=a.useMemo(()=>({reconPanelContent:y,reconSidePanelIsOpen:u.isOpen,closeReconSidePanel:u.closePanel}),[y,u.isOpen,u.closePanel]),B=a.useContext(Et),h=a.useMemo(()=>u.isOpen?{closePanel:u.closePanel,selectedItemId:u.selectedAccountId}:B,[u.isOpen,u.closePanel,u.selectedAccountId,B]);return C.jsx(Et.Provider,{value:h,children:C.jsx(A,{...E,...r})})};return f.displayName=`withReconSidePanel(${i})`,f}(({closeSidePanel:t,openTransactionPanel:i,panelContent:A,sidePanelIsFullView:f,sidePanelIsOpen:E,reconPanelContent:g,reconSidePanelIsOpen:u,closeReconSidePanel:o})=>{const{isAiCfoOpen:v,setIsAiCfoOpen:S}=go(),m=Co(),{isOpen:y}=So(),r=Pt(),B=Ge(),h=ce(),{isAiCfoAccessEnabled:T,onAskAiCfoClick:I}=$t({mobileExploreReferrer:"Transaction categorization"}),d=a.useCallback(()=>{E===!0&&f!==!0&&t?.()},[t,E,f]),{areTenantIdsInSync:R}=zt(),J=(()=>{const c=U(G=>pe(G)),j=Ge(),{currentSelectedViewFetchState:N,currentSelectedView:O,selectedPeriod:F}=c,he=Qe(O),X=Qe(N.fetchState),be=a.useCallback(G=>{const K=j.state?.referrer;O==="transaction_categorization"&&(c.selectedTransactionCategorizationTab==="review"?L.trackTransactionsReviewPage(F.month,F.year,c.transactionView.totalCountByTab.review,0,G,K??null):L.trackTransactionsAutoCategorisedPage(F.month,F.year,c.transactionView.totalCountByTab.autoCategorized,0,G,K??null)),O==="missing_receipts"&&L.trackMissingReceiptsPage(F.month,F.year,G,c.missingReceipts.transactions.length,K??null),O==="je_schedules"&&L.trackMonthCloseScheduleListPage(F.month,F.year,G,c.jeSchedules.draftSchedules.length,c.jeSchedules.resolveSchedules.length,K??null),O==="flux_analysis"&&L.trackFluxAnalysisPage(F.month,F.year,G,Fo(c.fluxAnalysis),K??null),O==="month_end_insights"&&c.auditSummary?.auditScorePercentage!=null&&L.trackInsightsEmailPage(F.month,F.year,G,"draft",c.auditSummary.auditScorePercentage,null,K??null)},[F,c]);return a.useEffect(()=>{X===N.fetchState&&O===he||N.fetchState!=="Completed"||be(!1)},[O,N.fetchState,he]),be})(),te=Io(),[M,_]=a.useState(!1),e=U(c=>dt(c)),n=U(c=>Re(c)),[s,l]=a.useState(!1),[k,p]=a.useState(!1),[b,w]=a.useState([]),[V,P]=a.useState(void 0),Q=a.useCallback(c=>{c!=null&&(v&&S(!1),m(),d()),P(c)},[d,v,m,S]),Ie=a.useCallback(()=>{m(),P(void 0),d(),I()},[d,I,m]),fe=a.useRef(v);a.useEffect(()=>{v===!0&&fe.current===!1&&(m(),P(void 0),d()),fe.current=v},[d,v,m]);const ke=a.useRef(y);a.useEffect(()=>{y===!0&&ke.current===!1&&(v&&S(!1),P(void 0),E===!0&&f!==!0&&t?.()),ke.current=y},[t,y,v,S,f,E]);const ne=E===!0&&f!==!0,$=a.useRef(ne);a.useEffect(()=>{ne&&!$.current&&(v&&S(!1),m(),P(void 0)),$.current=ne},[v,ne,m,S]);const[Ne,Yt]=a.useState(!1),Je=a.useRef(!1),{selectedTab:Ke}=rt(),{tenantEmailDomain:Nt}=rt(),[_e,Ze]=a.useState(B.state?.message==="comingFromTransactionDetail"),He=B.state?.message==="comingFromOverview",Jt=fo(),Ve=Be.getSignedInUser(),{useDynamicConfig:Kt,useFeatureGate:Ee}=Lt(),{configValue:Zt}=Kt(ko.enableUncategorizedExpenseCategory),H=Zt?.uncategorized_expense_category_enabled===!0,{isFeatureEnabled:We}=Ee(Ce.isRealtimeInsightsFeatureEnabled),{isFeatureEnabled:le}=Ee(Ce.isMissingReceiptsBulkUploadEnabled),{isFeatureEnabled:Xe}=Ee(Ce.isTransactionActivityEnabled),{isFeatureEnabled:Ht}=Ee(Ce.isExpenseAutomationCommentingEnabled),Wt=a.useCallback(c=>{const j=qe(c.view==="reconciliation"?"bill":"expense");i?.(c.entityId,j)},[i]),Xt=U(c=>_a(c,"common")),z=U(c=>pe(c)),{monthEndCloseChecksView:Y,currentSelectedView:x,selectedPeriod:D,selectedTransactionCategorizationTab:ae,currentSelectedViewBackgroundRefreshFetchState:en,currentSelectedViewFetchState:W,jeSchedules:Oe,reconciliation:tn}=z;a.useEffect(()=>{x==="transaction_categorization"&&E!==!0||Q(void 0)},[x,Q,E]);const ve=a.useRef(null);a.useEffect(()=>{ve.current!==null?ve.current!==ae&&(ve.current=ae,x==="transaction_categorization"&&Q(void 0)):ve.current=ae},[x,ae,Q]);const nn=U(c=>V==null?void 0:Va(c.transactionState,V)),oe=nn?.qboId,an=U(c=>oe==null?void 0:Oa(c,oe));a.useEffect(()=>{oe!=null&&h(Ma(oe))},[h,oe]);const{selectedAccountId:re}=tn,et=Qe(Oe.accountSettingsView.saveState.fetchState),on=U(c=>ja(c.accountState,c.accountListState,"accountList")),sn=U(c=>La(c)),de=Ke!=null?za(Ke):x,cn=U(c=>c.entityAutoCompleteState.autoCompleteText.common);if(Gt({isDataReady:W.fetchState==="Completed"}),Ve==null)throw Error("Can't access expense automation screen without signing in...");const tt=Vt(D),ue=Ue(tt.start),me=Ue(tt.end);if(ue==null||me==null)throw Error(`Invalid start - ${ue} and end - ${me} period from given ${D}`);const ln=a.useCallback(()=>{l(!1)},[]),rn=a.useCallback(()=>{p(!0)},[]),dn=a.useCallback(c=>{w(c),p(!1)},[]),un=a.useCallback(()=>{w([])},[]),ye=z.missingReceipts.bulkUpload.phase,nt=z.missingReceipts.bulkUpload.currentBatchId;a.useEffect(()=>{le===!0&&x==="missing_receipts"&&ye==="matching"&&nt!=null&&h(jt({cacheOverride:!0}))},[le,x,ye,nt,h]);const at=Ve?.userId,mn=D.month,hn=D.year,ot=n?.tenantId;a.useEffect(()=>{x==="missing_receipts"&&le!==!1&&ye==="idle"&&at!=null&&ot!=null&&h(Qa())},[x,le,ye,at,ot,mn,hn,h]),a.useEffect(()=>{e.newVendorState?.vendorDetailLocalData?.vendorName!=null?_(!0):_(!1)},[e.newVendorState?.vendorDetailLocalData?.vendorName]),a.useEffect(()=>{de!=null&&x!==de&&h(Ot(de))},[de]),a.useEffect(()=>{Ne!==!1||W.fetchState!=="Completed"&&W.fetchState!=="Error"||!R||(Yt(!0),h(It(!1,!1,H)))},[Ne,W,R,H]),a.useEffect(()=>{!He&&R&&(h(It(!1,!1,H)),h(ie(D,re,!1,!1)))},[D.month,D.year,R,H]);const st=a.useCallback((c=!1,j=!1)=>{const N={start:ue,end:me};switch(x){case"transaction_categorization":h(ge(ae,N,c,!_e,void 0,void 0,j,void 0,H)),Ze(!1);break;case"flux_analysis":h(Pe(D,c,j,null));break;case"month_end_insights":if(j===!1){const O=new Date(D.year,D.month,0),F=Ga(O.toDateString()).format(qt.analytics.YYYYDashMMDashDDFormat);h(qa(!0,n.companyId,n.tenantId,F)),h(Ya(n.companyId,n.tenantId))}break;case"je_schedules":h($a(N,j));break;case"missing_receipts":h(Mt(N,{amount:75,currencyCode:"USD",currencySymbol:"$"},c,j));break;default:h(ie(D,re,c,j))}},[x,ue,me,n.companyId,n.tenantId,ae,D,re,_e,Ze,H]);a.useEffect(()=>{x===de&&W.fetchState==="Not-Started"&&R&&st(!0)},[W,ue,me,n.companyId,n.tenantId,R]),a.useEffect(()=>{He||_e||Je.current||en.fetchState==="In-Progress"||W.fetchState!=="Completed"||(Je.current=!0,st(!0,!0))},[]),a.useEffect(()=>{Y.fetchState!=="In-Progress"&&Y.fetchState!=="Completed"&&h(Se({tenantId:n.tenantId,period:D,refreshViewInBackground:!1}))},[Y.fetchState,n.tenantId]),a.useEffect(()=>{z.monthEndInsights?.previewMonthEndReportStatus?.fetchState==="Completed"?l(!0):l(!1)},[z.monthEndInsights?.previewMonthEndReportStatus?.fetchState]),a.useEffect(()=>{z.monthEndInsights?.sendMonthEndReportStatus?.fetchState==="Completed"&&R&&(h(Se({tenantId:n.tenantId,period:D,refreshViewInBackground:!0})),h(Na({companyId:n.companyId})),r("../"))},[z.monthEndInsights?.sendMonthEndReportStatus?.fetchState,n.tenantId,D,n.companyId,R]),a.useEffect(()=>{const c=setInterval(()=>{Y.fetchState!=="In-Progress"&&Y.fetchState==="Completed"&&h(Se({tenantId:n.tenantId,period:D,refreshViewInBackground:!0}))},3e5);return()=>clearInterval(c)},[Y.fetchState,n.tenantId,D,h]),a.useEffect(()=>{const c=setInterval(()=>{x==="reconciliation"&&re==null&&z.reconciliation.fetchStatus.fetchState==="Completed"&&z.reconciliation.refreshStatus.fetchState!=="In-Progress"&&h(ie(D,void 0,!0,!0))},3e5);return()=>clearInterval(c)},[x,h,z.reconciliation.fetchStatus.fetchState,z.reconciliation.refreshStatus.fetchState,ie,re,D]);const pn=vt();a.useEffect(()=>{const c=(Y.monthEndCloseChecks?.monthEndCloseCheckList.find(j=>j.id==="month_end_insights")?.isDisabled??!1)&&!We;x!=="month_end_insights"||!c&&Y.monthEndCloseChecks?.reportEmailSentDate==null||r("../")},[x,Y.monthEndCloseChecks]);const gn=u===!0?g:A,Cn=u===!0||E===!0,Sn=u===!0?o:t;a.useEffect(()=>{et==="In-Progress"&&Oe.accountSettingsView.saveState.fetchState==="Completed"&&h(ft())},[et,Oe.accountSettingsView.saveState.fetchState,ft]);const{transactionId:ct,onSaveVendor:In,onSaveSuccess:fn,onCancel:kn,vendorViewDetails:En}=(({expenseAutomationViewSelector:c,closeDrawerHandler:j,currentSelectedView:N})=>{const O=ce();let F,he,X;const be=vt(),G=c.transactionView;let K=()=>{};const{transactions:vn,selectedTransactionId:se,selectedTransactionLineId:Ae,transactionLocalData:yn}=G;if(N==="transaction_categorization"){const Me=yn.find(ee=>ee.transactionId===se),q=vn.find(ee=>ee.id===se),it=Ae!=null?Me?.transactionReviewLocalData?.lineItemById[Ae]:void 0,lt=it?.account;he=it?.class?.classId,F=["Uncategorized Income","Uncategorized Expense"].includes(lt?.accountName??"")?void 0:lt?.accountId;const An=To(se,q?.typeOfTransaction);q!=null&&An&&(X={id:se,type:qe(q.typeOfTransaction)}),K=()=>{if(se!=null&&Ae!=null&&q!=null){const ee=G.transactionLocalData.find(Te=>Te.transactionId===se)?.transactionReviewLocalData;if(ee!=null&&q.lines!=null&&q.lines.length>0){const Te=ee.lineItemById[Ae];let je=ee.selectedEntity;if(Gn(q)||(je=Te.selectedEntityLine),je!=null){const Tn=je,wn={transactionId:{id:q.id,type:q.type},transaction:q,lineIds:q.lines.map(Pn=>Pn.id)??[]};O(Ye(Tn,Te.amount.amount,wn,!1,!0,be))}}}}}const bn=U(Me=>dt(Me,void 0,F,he));return{transactionId:X,onSaveVendor:()=>{O($n(X,void 0,!1,!0))},onSaveSuccess:K,onCancel:()=>{X!=null&&O(Ln({transactionId:X})),O(zn()),O(Qn()),j()},vendorViewDetails:bn}})({expenseAutomationViewSelector:z,closeDrawerHandler:()=>{_(!1)},currentSelectedView:x});return Jt?.loggedInUserRoleMap==null?Y.fetchState==="Error"?C.jsx(Eo,{onGoHome:()=>r("../",{replace:!0}),onReload:()=>window.location.reload()}):C.jsx(Qt,{fetchState:"In-Progress"}):C.jsxs(C.Fragment,{children:[C.jsx(Po,{isOpen:k,drawerLeftMargin:new vo(0,0,300,650),onClose:()=>{p(!1)},children:C.jsx(Mo,{onClick:c=>c.stopPropagation(),children:C.jsx(Uo,{companyId:n.companyId,closeCustomerRequestDrawer:()=>p(!1),addCustomerRequest:dn,resetCustomerRequest:un})})}),ct!=null&&M&&C.jsx(bo,{isOpen:M,transactionId:ct,onSaveVendor:In,onSaveSuccess:fn,onCancel:kn,vendorViewDetails:En}),C.jsx(Vo,{navigate:r,location:B,themeState:te,vendorSearchAutoCompleteData:{autoCompleteText:cn,entityAutoCompleteView:Xt},expenseAutomationViewSelector:z,isMissingReceiptsBulkUploadEnabled:le,monthEndInsightsPreviewMode:s,monthEndInsightsCustomerRequestData:b,isRealtimeInsightsFeatureEnabled:We,isUncategorizedExpenseCategoryEnabled:H,isAccountingClassesEnabled:sn,isCOTEnabled:pn,currentTenant:n,companyId:n.companyId,signedInUser:Ve,isTransactionActivityEnabled:Xe,activityLogTransactionId:x==="transaction_categorization"?V:void 0,activityLogPanel:x==="transaction_categorization"&&Xe===!0&&V!=null?C.jsx(yo,{activityLogView:an,qboId:oe,onClose:()=>Q(void 0),selectedTransactionId:V},String(V)):null,uncategorizedAccounts:on,onClickCustomerRequest:rn,handleEditClick:ln,tenantEmailDomain:Nt,trackExpenseAutomationTabAnalytics:J,setActivityLogTransactionId:Q,closeSidePanel:Sn,openTransactionPanel:i,sidePanelIsOpen:Cn,sidePanelIsFullView:u!==!0&&f,panelContent:gn,isAiCfoAccessEnabled:T,onAskAiCfoClick:Ie,isExpenseAutomationCommentingEnabled:Ht,onExpenseAutomationCommentingThreadClick:Wt,sidePanelListPercent:u===!0?66:void 0})]})})),Mo=Fe(Rn)`
21
+ `;function Uo({companyId:t,closeCustomerRequestDrawer:i,addCustomerRequest:A,resetCustomerRequest:f}){const E=Be.getSignedInUser();if(E==null)throw Error("Can't access Customer Request page without signing in...");const g=U(u=>jn(u,t,E));return a.useEffect(()=>{f()},[]),C.jsx(C.Fragment,{children:g.fetchState==="In-Progress"||g.companyMonthEndReportTemplatesData.fetchState==="In-Progress"?C.jsx(Qt,{fetchState:"In-Progress"}):C.jsx(ro,{onCloseClick:i,addCustomerRequest:A,snippets:g.companyMonthEndReportTemplatesData,bulletPoints:g.zeniRequestsData??[]})})}const Fo=t=>t.sections.generalExpense.vendors.length+t.sections.reimbursement.vendors.length,{common:{strings:{hyphen:Bo,comma:At,space:_o}},dateFormat:qt}=uo.getLocalizedStrings(),Tt=so,Vo=Dn(function(t,i){const{uncategorizedAccounts:A,vendorSearchAutoCompleteData:f,monthEndInsightsCustomerRequestData:E,monthEndInsightsPreviewMode:g,companyId:u,isMissingReceiptsBulkUploadEnabled:o,isTransactionActivityEnabled:v}=i,S=Be.getSignedInUser(),m=t.tenantState.currentTenantId,y={userId:S?.userId??"",sessionId:S?.zeniSessionId??"",tenantId:m??""},r=pe(t),{selectedTransactionCategorizationTab:B}=r;return{expenseAutomationViewSelector:r,bulkUploadSelector:o===!0?r.missingReceipts.bulkUpload:void 0,vendorSearchAutoCompleteData:f,authParams:y,receiptUploadEndpoint:`${xe.accountMicroServiceBaseUrl}`,transactionAttachmentsEndpoint:`${ho}/transaction_attachments`,bulkUploadEndpoint:o===!0?`${xe.communicationAgentMicroServiceBaseUrl}/1.0/receipts/bulk-upload`:void 0,isDisabled:!1,currentTab:B,monthEndInsightsCustomerRequestData:E,monthEndInsightsPreviewMode:g,allThreadsSectionOpen:!1,enableMonthEndInsightsZeniGPTFeature:!1,loggedInUser:S,uncategorizedAccounts:A,companyId:u,isTransactionActivityEnabled:v}},function(t,i){const{themeState:A,isAccountingClassesEnabled:f,isCOTEnabled:E,isUncategorizedExpenseCategoryEnabled:g,isMissingReceiptsBulkUploadEnabled:u,location:o,vendorSearchAutoCompleteData:v,expenseAutomationViewSelector:S,currentTenant:m,uncategorizedAccounts:y,navigate:r,onClickCustomerRequest:B,handleEditClick:h,setActivityLogTransactionId:T}=i,{selectedPeriod:I,currentSelectedView:d,reconciliation:{selectedAccountId:R}}=S,{accountSettingsView:J}=S.jeSchedules,te=Vt(I),M=Ue(te.start),_=Ue(te.end);return{onZeniLogoClick:()=>{A.toggle()},onUploadReceiptAttachment:e=>{L.trackMissingReceiptAttached(I.month,I.year),t(Ba(e))},onUploadTransactionReceipt:(e,n,s,l,k,p)=>{t(St(e,n,{fetchState:"In-Progress"}));const b=()=>t(St(e,n,{fetchState:"Error"}));po(`${xe.accountMicroServiceBaseUrl}/1.0/transactions/${n}/attachments`,p,n,s,l,k).then(P=>{P!=null?t(Fa(e,P)):b()}).catch(b)},onMissingReceiptsRowClick:(e,n)=>{if(i.openTransactionPanel)return void i.openTransactionPanel(e,n);const s=Z(o.state?.pathnameStackToGoBack,o.pathname);r(`../../transaction/${n}/${e}`,{state:{pathnameStackToGoBack:s,message:"expenseAutomation",origin:"missing_receipts"}})},onUploadReceiptComplete:(e,n)=>{t(Ua(e,n)),m!=null&&t(Se({tenantId:m.tenantId,period:n,refreshViewInBackground:!0}))},onUploadReceiptFetchStatus:(e,n,s,l)=>{t(Da(e,{fetchState:n,error:s})),s!=null&&t(gt({messageSection:"missing_receipts_attachment",messageText:"failed",type:"error",showStatusIcon:!0,variables:[{variableName:"__message__",variableValue:l!=null?_o+Bo+l+At:At}]}))},onUpdateJESchedulesUIState:e=>{t(Ra(e))},onUpdateMissingReceiptsUIState:e=>{t(xa(e))},onFetchMissingReceiptsList:()=>{_!=null&&M!=null&&t(Mt({start:M,end:_},{amount:75,currencyCode:"USD",currencySymbol:"$"},!0,!1))},...u===!0?{onBulkUploadFiles:e=>{t(oo(e))},onBulkUploadProgress:e=>{t(ao(e))},onBulkUploadSuccess:e=>{t(no({batchId:e}))},onBulkUploadUploadedFileCount:e=>{t(to(e))},onConfirmBulkUploadMatch:(e,n,s,l,k)=>{t(eo(e,n,s,l,k))},onBulkUploadConfirmMatchAcknowledged:()=>{t(Xa())},onSetBulkUploadResultsTab:e=>{t(Wa(e))},onSetBulkUploadCompletedSubTab:e=>{t(Ha(e))},onSetBulkUploadSortConfig:(e,n)=>{t(kt({sortKey:e,sortOrder:n}))},onClearBulkUpload:()=>{t(Za())},onSearchTransactionsForManualMatch:(e,n)=>{t(Tt(e,n??void 0))},onLoadMoreManualSearch:()=>{const{manualSearch:e}=S.missingReceipts.bulkUpload;e.nextPageToken!=null&&e.searchQuery!==""&&t(Tt(e.searchQuery,e.nextPageToken))},onFetchCompletedTransactions:(e,n)=>{t(Ka(e,n))},onFetchBulkUploadBatches:e=>{t(jt(e))},onFetchMoreBatchDetails:()=>{t(Ja())},onResetBulkUploadSort:()=>{t(kt({sortKey:void 0,sortOrder:void 0}))}}:{},onClearMissingReceiptsTabNavigation:()=>{t(wa())},onSearchTextChanged:e=>{const n=S.currentSelectedView,s=S.selectedTransactionCategorizationTab;n==="transaction_categorization"&&(t(ze({selectedTab:s,uiState:{searchString:e}})),_!=null&&M!=null&&t(ge(s,{start:M,end:_},!0,!1,e,void 0,!0)))},onRefresh:()=>{i.trackExpenseAutomationTabAnalytics(!0),t(Pa(g))},onClose:()=>{d==="reconciliation"&&R!=null&&t(Ct({selectedAccountId:void 0})),r("../")},onBack:()=>{d==="reconciliation"&&R!=null&&t(Ct({selectedAccountId:void 0}))},onSaveReconciliation:e=>{t(Ta(e))},onSaveReconciliationReview:e=>{t(Aa(e))},onUpdateStep:e=>{const{selectedPeriod:n}=S,s=Z(o.state?.pathnameStackToGoBack,o.pathname);r(`../${e}/${n.month}-${n.year}`,{state:{pathnameStackToGoBack:s,referrer:S.currentSelectedView}}),t(Ot(e))},handleLogOutClick:()=>{const e=Z(o.state?.pathnameStackToGoBack,o.pathname);r("/signout",{replace:!0,state:{pathnameStackToGoBack:e,message:"logout"}})},onJeAccountSettingsChange:e=>{const{vendorsAccountSection:n}=e,{prepaidExpensesAccount:s,fixedAssetsAccount:l,accruedExpensesAccount:k}=n,p=$e(J.prepaidExpensesAccountList,s.selectedOptions),b=$e(J.fixedAssetsAccountList,l.selectedOptions),P=$e(J.accruedExpensesAccountList,k.selectedOptions),V={selectedPrepaidExpensesAccountIds:p.map(w=>w.accountId),selectedFixedAssetsAccountIds:b.map(w=>w.accountId),selectedAccruedExpensesAccountIds:P.map(w=>w.accountId)};t(ba({data:V}))},onSaveJeAccountSettingsClick:()=>{t(ya())},onJESchedulesFormDataChange(e,n){const{jeScheduleID:s,accumulatedDepreciationCategory:l,scheduleClass:k,scheduleExpenseCategory:p,vendor:b}=n,{allAccountList:P,allClassList:V,allDepreciationAccountList:w}=S.jeSchedules,Q=v.entityAutoCompleteView.vendor.length>0?v.entityAutoCompleteView.vendor.find($=>$.id===b?.selectedOption):void 0,Ie={id:Q?.zeniId??b?.selectedOption??"",name:Q?.name??b?.defaultOptions.find($=>$.value===b?.selectedOption)?.label??"",logo:Q?.logo},fe=p?.selectedOption!=null?P.find($=>$.qboId===p.selectedOption):void 0,ke=k?.selectedOption!=null?V.find($=>$.classId===k.selectedOption):void 0,ne=l?.selectedOption!=null?w.find($=>$.qboId===l.selectedOption):void 0;t(va({scheduledJournalEntryID:e,localData:{jeScheduleID:s,scheduledJournalEntryID:e,updatedCategoryId:fe?.accountId,updatedClassId:ke?.classId,updatedAccumulatedDepreciationCategoryID:ne?.accountId,updatedVendor:{id:Ie.id,name:Ie.name}}}))},ignoreRecommendedJeSchedule(e,n){t(Ea(e,n))},vendorSearchAutoCompleteActions:{onAutoCompleteInputChange:(e,n)=>{e.trim().length>=2?t(ut({searchString:e,entityType:n,searchOrigin:"common"})):e.trim().length===0&&t(Pe("common"))},onCancelAutoComplete:()=>{t(Pe("common"))}},onPostJESchedule(e,n){t(ka({scheduledJournalEntryID:e,jeScheduleTransactionKey:n}))},clearJeScheduleLocalData(){t(fa())},handleJeScheduleClick:(e,n,s)=>{t(Ia({selectedJEScheduleKey:n}));const l=Z(o.state?.pathnameStackToGoBack,o.pathname);r(`../../vendors/schedules/${s}/details/${e}`,{state:{pathnameStackToGoBack:l,message:"expenseAutomation",origin:"je_schedules"}})},improveMonthEndInsightsUsingZeniGPTClick:e=>{m!=null&&t(Sa(e,m.companyId,m.tenantId))},onClickCustomerRequest:B,setActivityLogTransactionId:T,onCloseAllThreadsSection:()=>{},onCloseFileAttachmentSnackBar:()=>{t(Ca())},onOpenFileAttachmentSnackBar:()=>{t(gt({messageSection:"cockpit_month_end_email_attachment_upload",messageText:"failed",type:"error",showStatusIcon:!0}))},onRemoveFileAttachment:e=>{t(ga(e))},onUpdateFileAttachment:e=>{t(pa({files:e}))},previewMonthEndReport:(e,n,s,l)=>{m!=null&&t(pt(e,m.companyId,n,!0,s,l,m.tenantId))},saveMonthEndReport:(e,n,s,l)=>{m!=null&&t(pt(e,m.companyId,n,!1,s,l,m.tenantId))},onEditMonthEndInsightsClick:h,sendMonthEndReport:e=>{const n=o.state?.referrer,{selectedPeriod:s,auditSummary:l}=S;m!=null&&l?.auditScorePercentage!=null&&(t(ma(m.companyId,e,m.tenantId)),L.trackInsightsEmailPage(s.month,s.year,!1,"draft",l.auditScorePercentage,ha().format(qt.analytics.MMMDDCommaYYYYformat),n??null))},onTransactionCategorizationRowClick:(e,n)=>{if(i.openTransactionPanel)return void i.openTransactionPanel(e,n);const s=Z(o.state?.pathnameStackToGoBack,o.pathname);r(`../../transaction/${n}/${e}`,{state:{pathnameStackToGoBack:s,message:"expenseAutomation",origin:"transaction_categorization"}})},setLocalDataForCategoryAndClass:(e,n,s,l,k,p,b,P,V,w,Q)=>{t(ua(e,n,s,l,y,k,p,b,P,V,w,Q,f))},onCancelAutoComplete:()=>{t(Pe("common"))},updateExpenseAutomationReconListScrollPosition:e=>{t(mt({scrollPosition:e}))},onUpdateTab:e=>{i.closeSidePanel?.(),_!=null&&M!=null&&(t(ge(e,{start:M,end:_},!1,!1)),t(da(e)))},onUpdateTransactionCategorizationUIState:(e,n)=>{t(ze({selectedTab:e,uiState:n})),_!=null&&M!=null&&t(ge(e,{start:M,end:_},!1,!1,n.searchString,null,!0))},onUpdateScrollYOffSetTransactionCategorizationUIState:(e,n)=>{t(ze({selectedTab:e,uiState:n}))},onFetchTransactionCategorizationList:(e,n,s,l,k,p,b)=>{_!=null&&M!=null&&t(ge(e,{start:M,end:_},!0,s,n,l,k,p,b))},resetTransactionCategorizationLocalData:(e,n,s,l,k,p,b,P)=>{t(ra(e,n,s,l,P??null,k,p,!1,b))},updateSelectedVendorForTransaction:(e,n,s,l,k)=>{t(ht({selectedTab:e,transactionId:n,lineId:s,selectedTransaction:l,uncategorizedAccounts:y,updatedVendor:k,isAccountingClassesEnabled:f}))},onSaveUpdateTransactionCategorization:(e,n,s)=>{const l=o.state?.referrer;e==="autoCategorized"?L.trackTransactionsAutoCategorisedPage(I.month,I.year,S.transactionView.totalCountByTab.autoCategorized,n.length,!1,l??null):L.trackTransactionsReviewPage(I.month,I.year,S.transactionView.totalCountByTab.review,n.length,!1,l??null),t(la(e,n,s,g))},onUpdateSelectedCheckboxTransactionIds:(e,n)=>{t(ia({selectedTab:e,transactionIds:n}))},onFetchRecommendationsForEntityCategorizationWithCustomer:(e,n,s,l,k,p,b)=>{const{transactionId:P,transaction:V,lineIds:w}=n;p!=null&&t(sa({transactionId:P,customerUpdates:p})),t(ca({selectedTab:l,transactionId:P.id,lineId:w[0],selectedTransaction:V,uncategorizedAccounts:y,updatedCustomer:p,selectedEntity:k,isAccountingClassesEnabled:f,isUncategorizedExpenseCategoryEnabled:b})),k!=null&&t(Ye(k,e,n,s,!0,E,b))},onFetchRecommendationsForEntityCategorization:(e,n,s,l,k,p,b)=>{const{transactionId:P,transaction:V,lineIds:w}=n;p!=null&&(t(na({transactionId:P,vendorUpdates:{name:p.name,id:p.id?p.id:void 0}})),t(aa({vendorId:p.id?p.id:void 0,localData:{vendorName:p.name,vendorId:p.id?p.id:void 0}}))),p?.id?(t(ht({selectedTab:l,transactionId:P.id,lineId:w[0],selectedTransaction:V,uncategorizedAccounts:y,updatedVendor:p,selectedEntity:k,isAccountingClassesEnabled:f,isUncategorizedExpenseCategoryEnabled:b})),k!=null&&t(Ye(k,e,n,s,!0,E,b))):t(oa({selectedTab:l,transactionId:P.id,lineId:w[0]}))},fetchFluxViewOnScroll:(e,n)=>{t(we(e,!0,!1,n,!1,!0))},onFetchFluxViewList:()=>{t(we(I,!0,!1,null,!1,!1))},markAsReview:(e,n,s,l)=>{L.trackFluxAnalysisReviewed(s.month,s.year,l??!1,e),t(ta(n,e,s,l??!1))},onUpdateFluxAnalysisUIState:e=>{t(ea(e))},updateOperatingExpensesIdsForReview:e=>{t(Xn({operatingExpenseIds:e,selectedPeriod:I}))},redirectToVendorDetailPage:e=>{if(i.tenantEmailDomain!=null){const n=Po(e.id,e.qboId,i.tenantEmailDomain),s=Z(i.location.state?.pathnameStackToGoBack,i.location.pathname);i.navigate(n,{state:{pathnameStackToGoBack:s,message:"expenseAutomation",referrer:"Vendor List",origin:"flux_analysis"}})}},updateSectionIdsForReview:e=>{t(Wn({sectionId:e,selectedPeriod:I}))},onFetchReimbursementView:(e,n,s)=>{t(we(e,!0,!1,n,!0,s))},onReviewClicked:e=>{t(ie(I,e))},setOpenDrawerClicked:e=>{t(De({selectedDrawerAccountId:e}))},onFetchLinkTokenClick:(e,n)=>{t(Ft("expense_automation_reconcile",e,n))},onEstablishConnectionClick:(e,n)=>{const s=m?.companyId;s!=null&&(t(Bt(e,s,"expense_automation_reconcile",void 0,"link_account_no_microdeposit",n)),t(_t({accountId:n,connectionInProgress:!0})))},onAddStatementClick:e=>{t(De({selectedDrawerAccountId:e})),t(Ut({accountId:e,selectedPeriod:I,localData:{accountSource:"bank_statement"}})),t(Dt({statementUploadChosen:!0}))},onReloadReconciliationListPage:()=>{t(ie(I,void 0,!0,!1))},onUpdateReconcileTabLocalData:e=>{t(Hn({selectedTransactionIds:e}))},onReconTabColumnSortConfigChanged:(e,n)=>{t(Zn({sortKey:e,sortOrder:n}))},onReconReviewTabColumnSortConfigChanged:(e,n)=>{t(Kn({sortKey:e,sortOrder:n}))},onReconTabUpdate:e=>{i.closeSidePanel?.(),t(Jn({selectedTab:e}))},updateReconReviewTabLocalData:(e,n,s)=>{const l=e.vendor?.id;s&&l!=null&&t(Yn(l)),t(Nn({data:e,transactionId:n}))},onReconMatchedTransactionClick:e=>{if(i.openTransactionPanel)return void i.openTransactionPanel(e,qe("bill"));const n=Z(o.state?.pathnameStackToGoBack,o.pathname);r(`../../transaction/bill/${e}`,{state:{pathnameStackToGoBack:n,message:"expenseAutomation",origin:"reconciliation"}})},onReloadPage:()=>{window.location.reload()},onBackClick:()=>{r(-1)},onReconListPageScroll:e=>{t(mt({scrollPosition:e}))},onVendorAutoCompleteInputChange:e=>{e.trim().length>=2?t(ut({searchString:e,searchOrigin:"common"})):e.trim().length===0&&t(Pe("common"))},onReconNodeCollapseToggled:(e,n)=>{t(qn({nodeId:e,collapsed:n}))},updateSectionCollapseStatus:()=>{},onExcludeAccountFromReconciliation:e=>{t(xt({accountId:e}))},onIncludeAccountIntoReconciliation:e=>{t(Rt({accountId:e}))}}},(t,i,A)=>{const{isMissingReceiptsBulkUploadEnabled:f,...E}=A;return function(g,u,o){return{...g,...u,...o,onUploadTransactionReceipt:(v,S,m,y,r)=>{u.onUploadTransactionReceipt(v,S,m,y,r,g.authParams)}}}(t,i,E)})(mo),Oo=Ao(function(t){const i=t.displayName??t.name??"Component",A=Pt.memo(t),f=E=>{const g=ce(),u=function(){const T=ce(),I=U(d=>pe(d).reconciliation.selectedDrawerAccountId);return{isOpen:I!=null,selectedAccountId:I,openPanel:a.useCallback(d=>{T(De({selectedDrawerAccountId:d}))},[T]),closePanel:a.useCallback(()=>{T(De({selectedDrawerAccountId:void 0}))},[T])}}(),o=U(T=>pe(T).reconciliation),v=U(T=>Re(T)),S=a.useCallback((T,I)=>{g(Ft("expense_automation_reconcile",T,I))},[g]),m=a.useCallback((T,I)=>{const d=v?.companyId;d!=null&&(g(Bt(T,d,"expense_automation_reconcile",void 0,"link_account_no_microdeposit",I)),g(_t({accountId:I,connectionInProgress:!0})))},[g,v?.companyId]),y=a.useMemo(()=>{if(u.isOpen&&u.selectedAccountId!=null)return C.jsx(Do,{reconciliation:o,selectedDrawerAccountId:u.selectedAccountId,onClose:u.closePanel,onFetchLinkTokenClick:S,onEstablishConnectionClick:m})},[u.isOpen,u.selectedAccountId,u.closePanel,o,S,m]),r=a.useMemo(()=>({reconPanelContent:y,reconSidePanelIsOpen:u.isOpen,closeReconSidePanel:u.closePanel}),[y,u.isOpen,u.closePanel]),B=a.useContext(Et),h=a.useMemo(()=>u.isOpen?{closePanel:u.closePanel,selectedItemId:u.selectedAccountId}:B,[u.isOpen,u.closePanel,u.selectedAccountId,B]);return C.jsx(Et.Provider,{value:h,children:C.jsx(A,{...E,...r})})};return f.displayName=`withReconSidePanel(${i})`,f}(({closeSidePanel:t,openTransactionPanel:i,panelContent:A,sidePanelIsFullView:f,sidePanelIsOpen:E,reconPanelContent:g,reconSidePanelIsOpen:u,closeReconSidePanel:o})=>{const{isAiCfoOpen:v,setIsAiCfoOpen:S}=go(),m=Co(),{isOpen:y}=So(),r=wt(),B=Ge(),h=ce(),{isAiCfoAccessEnabled:T,onAskAiCfoClick:I}=$t({mobileExploreReferrer:"Transaction categorization"}),d=a.useCallback(()=>{E===!0&&f!==!0&&t?.()},[t,E,f]),{areTenantIdsInSync:R}=zt(),J=(()=>{const c=U(G=>pe(G)),j=Ge(),{currentSelectedViewFetchState:N,currentSelectedView:O,selectedPeriod:F}=c,he=Qe(O),X=Qe(N.fetchState),be=a.useCallback(G=>{const K=j.state?.referrer;O==="transaction_categorization"&&(c.selectedTransactionCategorizationTab==="review"?L.trackTransactionsReviewPage(F.month,F.year,c.transactionView.totalCountByTab.review,0,G,K??null):L.trackTransactionsAutoCategorisedPage(F.month,F.year,c.transactionView.totalCountByTab.autoCategorized,0,G,K??null)),O==="missing_receipts"&&L.trackMissingReceiptsPage(F.month,F.year,G,c.missingReceipts.transactions.length,K??null),O==="je_schedules"&&L.trackMonthCloseScheduleListPage(F.month,F.year,G,c.jeSchedules.draftSchedules.length,c.jeSchedules.resolveSchedules.length,K??null),O==="flux_analysis"&&L.trackFluxAnalysisPage(F.month,F.year,G,Fo(c.fluxAnalysis),K??null),O==="month_end_insights"&&c.auditSummary?.auditScorePercentage!=null&&L.trackInsightsEmailPage(F.month,F.year,G,"draft",c.auditSummary.auditScorePercentage,null,K??null)},[F,c]);return a.useEffect(()=>{X===N.fetchState&&O===he||N.fetchState!=="Completed"||be(!1)},[O,N.fetchState,he]),be})(),te=Io(),[M,_]=a.useState(!1),e=U(c=>dt(c)),n=U(c=>Re(c)),[s,l]=a.useState(!1),[k,p]=a.useState(!1),[b,P]=a.useState([]),[V,w]=a.useState(void 0),Q=a.useCallback(c=>{c!=null&&(v&&S(!1),m(),d()),w(c)},[d,v,m,S]),Ie=a.useCallback(()=>{m(),w(void 0),d(),I()},[d,I,m]),fe=a.useRef(v);a.useEffect(()=>{v===!0&&fe.current===!1&&(m(),w(void 0),d()),fe.current=v},[d,v,m]);const ke=a.useRef(y);a.useEffect(()=>{y===!0&&ke.current===!1&&(v&&S(!1),w(void 0),E===!0&&f!==!0&&t?.()),ke.current=y},[t,y,v,S,f,E]);const ne=E===!0&&f!==!0,$=a.useRef(ne);a.useEffect(()=>{ne&&!$.current&&(v&&S(!1),m(),w(void 0)),$.current=ne},[v,ne,m,S]);const[Ne,Yt]=a.useState(!1),Je=a.useRef(!1),{selectedTab:Ke}=rt(),{tenantEmailDomain:Nt}=rt(),[_e,Ze]=a.useState(B.state?.message==="comingFromTransactionDetail"),He=B.state?.message==="comingFromOverview",Jt=fo(),Ve=Be.getSignedInUser(),{useDynamicConfig:Kt,useFeatureGate:Ee}=Lt(),{configValue:Zt}=Kt(ko.enableUncategorizedExpenseCategory),H=Zt?.uncategorized_expense_category_enabled===!0,{isFeatureEnabled:We}=Ee(Ce.isRealtimeInsightsFeatureEnabled),{isFeatureEnabled:le}=Ee(Ce.isMissingReceiptsBulkUploadEnabled),{isFeatureEnabled:Xe}=Ee(Ce.isTransactionActivityEnabled),{isFeatureEnabled:Ht}=Ee(Ce.isExpenseAutomationCommentingEnabled),Wt=a.useCallback(c=>{const j=qe(c.view==="reconciliation"?"bill":"expense");i?.(c.entityId,j)},[i]),Xt=U(c=>_a(c,"common")),z=U(c=>pe(c)),{monthEndCloseChecksView:Y,currentSelectedView:x,selectedPeriod:D,selectedTransactionCategorizationTab:ae,currentSelectedViewBackgroundRefreshFetchState:en,currentSelectedViewFetchState:W,jeSchedules:Oe,reconciliation:tn}=z;a.useEffect(()=>{x==="transaction_categorization"&&E!==!0||Q(void 0)},[x,Q,E]);const ve=a.useRef(null);a.useEffect(()=>{ve.current!==null?ve.current!==ae&&(ve.current=ae,x==="transaction_categorization"&&Q(void 0)):ve.current=ae},[x,ae,Q]);const nn=U(c=>V==null?void 0:Va(c.transactionState,V)),oe=nn?.qboId,an=U(c=>oe==null?void 0:Oa(c,oe));a.useEffect(()=>{oe!=null&&h(Ma(oe))},[h,oe]);const{selectedAccountId:re}=tn,et=Qe(Oe.accountSettingsView.saveState.fetchState),on=U(c=>ja(c.accountState,c.accountListState,"accountList")),sn=U(c=>La(c)),de=Ke!=null?za(Ke):x,cn=U(c=>c.entityAutoCompleteState.autoCompleteText.common);if(Gt({isDataReady:W.fetchState==="Completed"}),Ve==null)throw Error("Can't access expense automation screen without signing in...");const tt=Vt(D),ue=Ue(tt.start),me=Ue(tt.end);if(ue==null||me==null)throw Error(`Invalid start - ${ue} and end - ${me} period from given ${D}`);const ln=a.useCallback(()=>{l(!1)},[]),rn=a.useCallback(()=>{p(!0)},[]),dn=a.useCallback(c=>{P(c),p(!1)},[]),un=a.useCallback(()=>{P([])},[]),ye=z.missingReceipts.bulkUpload.phase,nt=z.missingReceipts.bulkUpload.currentBatchId;a.useEffect(()=>{le===!0&&x==="missing_receipts"&&ye==="matching"&&nt!=null&&h(jt({cacheOverride:!0}))},[le,x,ye,nt,h]);const at=Ve?.userId,mn=D.month,hn=D.year,ot=n?.tenantId;a.useEffect(()=>{x==="missing_receipts"&&le!==!1&&ye==="idle"&&at!=null&&ot!=null&&h(Qa())},[x,le,ye,at,ot,mn,hn,h]),a.useEffect(()=>{e.newVendorState?.vendorDetailLocalData?.vendorName!=null?_(!0):_(!1)},[e.newVendorState?.vendorDetailLocalData?.vendorName]),a.useEffect(()=>{de!=null&&x!==de&&h(Ot(de))},[de]),a.useEffect(()=>{Ne!==!1||W.fetchState!=="Completed"&&W.fetchState!=="Error"||!R||(Yt(!0),h(It(!1,!1,H)))},[Ne,W,R,H]),a.useEffect(()=>{!He&&R&&(h(It(!1,!1,H)),h(ie(D,re,!1,!1)))},[D.month,D.year,R,H]);const st=a.useCallback((c=!1,j=!1)=>{const N={start:ue,end:me};switch(x){case"transaction_categorization":h(ge(ae,N,c,!_e,void 0,void 0,j,void 0,H)),Ze(!1);break;case"flux_analysis":h(we(D,c,j,null));break;case"month_end_insights":if(j===!1){const O=new Date(D.year,D.month,0),F=Ga(O.toDateString()).format(qt.analytics.YYYYDashMMDashDDFormat);h(qa(!0,n.companyId,n.tenantId,F)),h(Ya(n.companyId,n.tenantId))}break;case"je_schedules":h($a(N,j));break;case"missing_receipts":h(Mt(N,{amount:75,currencyCode:"USD",currencySymbol:"$"},c,j));break;default:h(ie(D,re,c,j))}},[x,ue,me,n.companyId,n.tenantId,ae,D,re,_e,Ze,H]);a.useEffect(()=>{x===de&&W.fetchState==="Not-Started"&&R&&st(!0)},[W,ue,me,n.companyId,n.tenantId,R]),a.useEffect(()=>{He||_e||Je.current||en.fetchState==="In-Progress"||W.fetchState!=="Completed"||(Je.current=!0,st(!0,!0))},[]),a.useEffect(()=>{Y.fetchState!=="In-Progress"&&Y.fetchState!=="Completed"&&h(Se({tenantId:n.tenantId,period:D,refreshViewInBackground:!1}))},[Y.fetchState,n.tenantId]),a.useEffect(()=>{z.monthEndInsights?.previewMonthEndReportStatus?.fetchState==="Completed"?l(!0):l(!1)},[z.monthEndInsights?.previewMonthEndReportStatus?.fetchState]),a.useEffect(()=>{z.monthEndInsights?.sendMonthEndReportStatus?.fetchState==="Completed"&&R&&(h(Se({tenantId:n.tenantId,period:D,refreshViewInBackground:!0})),h(Na({companyId:n.companyId})),r("../"))},[z.monthEndInsights?.sendMonthEndReportStatus?.fetchState,n.tenantId,D,n.companyId,R]),a.useEffect(()=>{const c=setInterval(()=>{Y.fetchState!=="In-Progress"&&Y.fetchState==="Completed"&&h(Se({tenantId:n.tenantId,period:D,refreshViewInBackground:!0}))},3e5);return()=>clearInterval(c)},[Y.fetchState,n.tenantId,D,h]),a.useEffect(()=>{const c=setInterval(()=>{x==="reconciliation"&&re==null&&z.reconciliation.fetchStatus.fetchState==="Completed"&&z.reconciliation.refreshStatus.fetchState!=="In-Progress"&&h(ie(D,void 0,!0,!0))},3e5);return()=>clearInterval(c)},[x,h,z.reconciliation.fetchStatus.fetchState,z.reconciliation.refreshStatus.fetchState,ie,re,D]);const pn=vt();a.useEffect(()=>{const c=(Y.monthEndCloseChecks?.monthEndCloseCheckList.find(j=>j.id==="month_end_insights")?.isDisabled??!1)&&!We;x!=="month_end_insights"||!c&&Y.monthEndCloseChecks?.reportEmailSentDate==null||r("../")},[x,Y.monthEndCloseChecks]);const gn=u===!0?g:A,Cn=u===!0||E===!0,Sn=u===!0?o:t;a.useEffect(()=>{et==="In-Progress"&&Oe.accountSettingsView.saveState.fetchState==="Completed"&&h(ft())},[et,Oe.accountSettingsView.saveState.fetchState,ft]);const{transactionId:ct,onSaveVendor:In,onSaveSuccess:fn,onCancel:kn,vendorViewDetails:En}=(({expenseAutomationViewSelector:c,closeDrawerHandler:j,currentSelectedView:N})=>{const O=ce();let F,he,X;const be=vt(),G=c.transactionView;let K=()=>{};const{transactions:vn,selectedTransactionId:se,selectedTransactionLineId:Ae,transactionLocalData:yn}=G;if(N==="transaction_categorization"){const Me=yn.find(ee=>ee.transactionId===se),q=vn.find(ee=>ee.id===se),it=Ae!=null?Me?.transactionReviewLocalData?.lineItemById[Ae]:void 0,lt=it?.account;he=it?.class?.classId,F=["Uncategorized Income","Uncategorized Expense"].includes(lt?.accountName??"")?void 0:lt?.accountId;const An=To(se,q?.typeOfTransaction);q!=null&&An&&(X={id:se,type:qe(q.typeOfTransaction)}),K=()=>{if(se!=null&&Ae!=null&&q!=null){const ee=G.transactionLocalData.find(Te=>Te.transactionId===se)?.transactionReviewLocalData;if(ee!=null&&q.lines!=null&&q.lines.length>0){const Te=ee.lineItemById[Ae];let je=ee.selectedEntity;if(Gn(q)||(je=Te.selectedEntityLine),je!=null){const Tn=je,Pn={transactionId:{id:q.id,type:q.type},transaction:q,lineIds:q.lines.map(wn=>wn.id)??[]};O(Ye(Tn,Te.amount.amount,Pn,!1,!0,be))}}}}}const bn=U(Me=>dt(Me,void 0,F,he));return{transactionId:X,onSaveVendor:()=>{O($n(X,void 0,!1,!0))},onSaveSuccess:K,onCancel:()=>{X!=null&&O(Ln({transactionId:X})),O(zn()),O(Qn()),j()},vendorViewDetails:bn}})({expenseAutomationViewSelector:z,closeDrawerHandler:()=>{_(!1)},currentSelectedView:x});return Jt?.loggedInUserRoleMap==null?Y.fetchState==="Error"?C.jsx(Eo,{onGoHome:()=>r("../",{replace:!0}),onReload:()=>window.location.reload()}):C.jsx(Qt,{fetchState:"In-Progress"}):C.jsxs(C.Fragment,{children:[C.jsx(wo,{isOpen:k,drawerLeftMargin:new vo(0,0,300,650),onClose:()=>{p(!1)},children:C.jsx(Mo,{onClick:c=>c.stopPropagation(),children:C.jsx(Uo,{companyId:n.companyId,closeCustomerRequestDrawer:()=>p(!1),addCustomerRequest:dn,resetCustomerRequest:un})})}),ct!=null&&M&&C.jsx(bo,{isOpen:M,transactionId:ct,onSaveVendor:In,onSaveSuccess:fn,onCancel:kn,vendorViewDetails:En}),C.jsx(Vo,{navigate:r,location:B,themeState:te,vendorSearchAutoCompleteData:{autoCompleteText:cn,entityAutoCompleteView:Xt},expenseAutomationViewSelector:z,isMissingReceiptsBulkUploadEnabled:le,monthEndInsightsPreviewMode:s,monthEndInsightsCustomerRequestData:b,isRealtimeInsightsFeatureEnabled:We,isUncategorizedExpenseCategoryEnabled:H,isAccountingClassesEnabled:sn,isCOTEnabled:pn,currentTenant:n,companyId:n.companyId,signedInUser:Ve,isTransactionActivityEnabled:Xe,activityLogTransactionId:x==="transaction_categorization"?V:void 0,activityLogPanel:x==="transaction_categorization"&&Xe===!0&&V!=null?C.jsx(yo,{activityLogView:an,qboId:oe,onClose:()=>Q(void 0),selectedTransactionId:V},String(V)):null,uncategorizedAccounts:on,onClickCustomerRequest:rn,handleEditClick:ln,tenantEmailDomain:Nt,trackExpenseAutomationTabAnalytics:J,setActivityLogTransactionId:Q,closeSidePanel:Sn,openTransactionPanel:i,sidePanelIsOpen:Cn,sidePanelIsFullView:u!==!0&&f,panelContent:gn,isAiCfoAccessEnabled:T,onAskAiCfoClick:Ie,isExpenseAutomationCommentingEnabled:Ht,onExpenseAutomationCommentingThreadClick:Wt,sidePanelListPercent:u===!0?66:void 0})]})})),Mo=Fe(Rn)`
22
22
  display: flex;
23
23
  min-height: 100%;
24
24
  flex-direction: column;
@@ -0,0 +1 @@
1
+ import{j as s}from"./liveblocks-D0ylGz77.js";import{a as r}from"./sentry-C5UCCkb_.js";import{Z as c,$ as l,a0 as p,q as b}from"./index-CPG6ITBm.js";import"./mui-D9TDAUAO.js";import f from"./NotFoundScreen-B1k_jOem.js";import{j as m,u}from"./core-DSsu1iyO.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]="7e802648-940a-45b8-8f6b-505bcbcd2ea6",e._sentryDebugIdIdentifier="sentry-dbid-7e802648-940a-45b8-8f6b-505bcbcd2ea6")}catch{}})();const D=()=>{const e=m(),a=u(),t=r.useCallback(()=>{window.open("https://www.zeni.ai/demo/request","_blank")},[]),i=r.useCallback(()=>{(()=>{const n=b(a.state?.pathnameStackToGoBack),d=n.poppedPathname??k();e(d,{state:{pathnameStackToGoBack:n.newStack}})})()},[]),o=c(a.pathname);return o!=null?s.jsx(l,{menuItem:p(o),onDemoClick:t,onGoBack:i}):s.jsx(f,{})},k=(e=2)=>{let a="../";for(let t=0;t<e;t++)a=`${a}../`;return a};export{D as F};
@@ -1 +1 @@
1
- import{a as r}from"./sentry-Wnm-N8eT.js";import{h as l,j as f,u as m}from"./core-Bv8kdUko.js";import{gw as p,JH as g,JI as _}from"./zeni-epic-state-CIBk9-EN.js";import{u as b,L as h,z as y}from"./index-BIwQAhFv.js";import"./liveblocks-CCyJOwfy.js";import"./recharts-DdIjbBfI.js";import"./mui-DtV_yZlj.js";import"./analytics-B6udoEJT.js";import"./plaid--kCGp3zU.js";import"./dnd-BIjMGuxw.js";import"./stripe-DMRn4zHo.js";import"./lottie-DL8N42Il.js";import"./lexical-DOh49tNP.js";import"./pdf-BcmiSEKK.js";import"./utils-CRtSAyQU.js";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},n=new e.Error().stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="dc5cd6e0-2e55-46ef-997c-66a8c16895f0",e._sentryDebugIdIdentifier="sentry-dbid-dc5cd6e0-2e55-46ef-997c-66a8c16895f0")}catch{}})();function C(){const e=l(),n=f(),o=m(),{setLoading:i,clearAllLoading:u}=b(),s=r.useRef(!1);return r.useLayoutEffect(()=>{i(h.CONNECTION_AUTH)},[i]),r.useEffect(()=>{if(s.current)return;s.current=!0;const a=new URLSearchParams(o.search).get("code"),c=sessionStorage.getItem("hubspot_oauth_pending");if(sessionStorage.removeItem("hubspot_oauth_pending"),a!=null&&c!=null){const t=JSON.parse(c);e(p(t.tenant_id,t.connection_id,g("revenue"),_("hubspot"),{authorization_code:a,client_id:t.client_id,client_secret:t.client_secret,redirect_uri:t.redirect_uri}))}u();const d=y.getActiveTenantForUser();n(d?.tenantEmailDomain!=null?`/${d.tenantEmailDomain}/settings/integrations`:"/",{replace:!0})},[]),null}export{C as default};
1
+ import{a as r}from"./sentry-C5UCCkb_.js";import{h as l,j as f,u as m}from"./core-DSsu1iyO.js";import{gw as p,JH as g,JI as _}from"./zeni-epic-state-CFQMpWBE.js";import{u as b,L as h,z as y}from"./index-CPG6ITBm.js";import"./liveblocks-D0ylGz77.js";import"./recharts-C7IODwRw.js";import"./mui-D9TDAUAO.js";import"./analytics-CQQ1PG0J.js";import"./plaid-mYHRXlz3.js";import"./dnd-Dok8dils.js";import"./stripe-DMRn4zHo.js";import"./lottie-Cu765PFn.js";import"./lexical-DO7p5ZXM.js";import"./pdf-BzjCkfw3.js";import"./utils-Cd1icpH6.js";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},n=new e.Error().stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="dc5cd6e0-2e55-46ef-997c-66a8c16895f0",e._sentryDebugIdIdentifier="sentry-dbid-dc5cd6e0-2e55-46ef-997c-66a8c16895f0")}catch{}})();function C(){const e=l(),n=f(),o=m(),{setLoading:i,clearAllLoading:u}=b(),s=r.useRef(!1);return r.useLayoutEffect(()=>{i(h.CONNECTION_AUTH)},[i]),r.useEffect(()=>{if(s.current)return;s.current=!0;const a=new URLSearchParams(o.search).get("code"),c=sessionStorage.getItem("hubspot_oauth_pending");if(sessionStorage.removeItem("hubspot_oauth_pending"),a!=null&&c!=null){const t=JSON.parse(c);e(p(t.tenant_id,t.connection_id,g("revenue"),_("hubspot"),{authorization_code:a,client_id:t.client_id,client_secret:t.client_secret,redirect_uri:t.redirect_uri}))}u();const d=y.getActiveTenantForUser();n(d?.tenantEmailDomain!=null?`/${d.tenantEmailDomain}/settings/integrations`:"/",{replace:!0})},[]),null}export{C as default};
@@ -1,4 +1,4 @@
1
- import{j as t}from"./liveblocks-CCyJOwfy.js";import{l as S,k as x,j as C,u as y,h as ee,q as te,g as L,N as ae,n as ne,o as p}from"./core-Bv8kdUko.js";import{JA as k,JB as v,JC as T,zA as A,zm as G,JD as B,JE as oe,JF as se,zq as ie,eS as $,zx as le,zu as re}from"./zeni-epic-state-CIBk9-EN.js";import{K as g,o as r,k as de,c as j,h as J,n as ce,p as me,s as pe,v as M,C as ue,A as he,I as xe,w as ge,m as fe,x as we,B as be,S as Se,j as ye,y as ke,E as ve,F as je,H as $e}from"./index-BIwQAhFv.js";import{n as m}from"./mui-DtV_yZlj.js";import f from"./NotFoundScreen-D1-E1kBF.js";import{a as I}from"./sentry-Wnm-N8eT.js";import"./recharts-DdIjbBfI.js";import"./analytics-B6udoEJT.js";import"./plaid--kCGp3zU.js";import"./dnd-BIjMGuxw.js";import"./stripe-DMRn4zHo.js";import"./lottie-DL8N42Il.js";import"./lexical-DOh49tNP.js";import"./pdf-BcmiSEKK.js";import"./utils-CRtSAyQU.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]="9f353495-00c2-41e9-a4f7-db6cb99e18ca",e._sentryDebugIdIdentifier="sentry-dbid-9f353495-00c2-41e9-a4f7-db6cb99e18ca")}catch{}})();const Ie=m.div`
1
+ import{j as t}from"./liveblocks-D0ylGz77.js";import{l as S,k as x,j as C,u as y,h as ee,q as te,g as L,N as ae,n as ne,o as p}from"./core-DSsu1iyO.js";import{JA as k,JB as v,JC as T,zA as A,zm as G,JD as B,JE as oe,JF as se,zq as ie,eS as $,zx as le,zu as re}from"./zeni-epic-state-CFQMpWBE.js";import{K as g,o as r,_ as de,d as j,j as J,p as ce,q as me,r as pe,s as _,C as ue,A as he,O as xe,I as ge,m as fe,v as we,B as be,x as Se,T as ye,S as ke,y as ve,E as je,F as $e}from"./index-CPG6ITBm.js";import{n as m}from"./mui-D9TDAUAO.js";import f from"./NotFoundScreen-B1k_jOem.js";import{a as I}from"./sentry-C5UCCkb_.js";import"./recharts-C7IODwRw.js";import"./analytics-CQQ1PG0J.js";import"./plaid-mYHRXlz3.js";import"./dnd-Dok8dils.js";import"./stripe-DMRn4zHo.js";import"./lottie-Cu765PFn.js";import"./lexical-DO7p5ZXM.js";import"./pdf-BzjCkfw3.js";import"./utils-Cd1icpH6.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]="e9c27f89-f970-44c4-acbd-c27ff13f3078",e._sentryDebugIdIdentifier="sentry-dbid-e9c27f89-f970-44c4-acbd-c27ff13f3078")}catch{}})();const Ie=m.div`
2
2
  display: flex;
3
3
  height: 100%;
4
4
  width: 100%;
@@ -25,7 +25,7 @@ import{j as t}from"./liveblocks-CCyJOwfy.js";import{l as S,k as x,j as C,u as y,
25
25
  align-items: center;
26
26
  background-color: ${e=>e.theme.colors.grey4};
27
27
  box-shadow: ${e=>`0px 2px ${r.sp1} ${e.theme.colors.dropShadowNormal}`};
28
- `,Ne=x(function(e){const a=k(e),n=v(e),o=B(e),{companyName:s}=a;return{companyName:s,isDisabled:a.fetchState!=="Completed"?"disabled":void 0,magicLinkBankAccountDetails:n,mailingAddressDetails:o,magicLinkViewState:a}},function(e,a){const{navigate:n,location:o,vendorId:s,billId:l}=a;return{onFetchBankName:i=>{e(G(i))},onSaveHandler:i=>{j.trackBillPayMagicLinkSubmitBankAccountDetails(l),e(A(i,"us-domestic",s,l))},onWireDetailsUpdated:i=>{const{bankAccountSection:d}=i;e(T({data:d}))},onAddressClick:()=>{const i=o.pathname.replace("us-domestic","address"),d=M(o.state?.pathnameStackToGoBack,o.pathname);n(i,{state:{pathnameStackToGoBack:d}})}}})(pe);function Le(){const e=C(),a=y(),n=g(),{vendorId:o,billId:s}=S();return o==null||s==null?t.jsx(f,{}):t.jsx(t.Fragment,{children:t.jsx(Ee,{windowSize:n,children:t.jsx(Ne,{location:a,navigate:e,vendorId:o,billId:s})})})}const Fe=m.div`
28
+ `,Ne=x(function(e){const a=k(e),n=v(e),o=B(e),{companyName:s}=a;return{companyName:s,isDisabled:a.fetchState!=="Completed"?"disabled":void 0,magicLinkBankAccountDetails:n,mailingAddressDetails:o,magicLinkViewState:a}},function(e,a){const{navigate:n,location:o,vendorId:s,billId:l}=a;return{onFetchBankName:i=>{e(G(i))},onSaveHandler:i=>{j.trackBillPayMagicLinkSubmitBankAccountDetails(l),e(A(i,"us-domestic",s,l))},onWireDetailsUpdated:i=>{const{bankAccountSection:d}=i;e(T({data:d}))},onAddressClick:()=>{const i=o.pathname.replace("us-domestic","address"),d=_(o.state?.pathnameStackToGoBack,o.pathname);n(i,{state:{pathnameStackToGoBack:d}})}}})(pe);function Le(){const e=C(),a=y(),n=g(),{vendorId:o,billId:s}=S();return o==null||s==null?t.jsx(f,{}):t.jsx(t.Fragment,{children:t.jsx(Ee,{windowSize:n,children:t.jsx(Ne,{location:a,navigate:e,vendorId:o,billId:s})})})}const Fe=m.div`
29
29
  display: flex;
30
30
  height: 100%;
31
31
  width: 100%;
@@ -34,7 +34,7 @@ import{j as t}from"./liveblocks-CCyJOwfy.js";import{l as S,k as x,j as C,u as y,
34
34
  align-items: center;
35
35
  background-color: ${e=>e.theme.colors.grey4};
36
36
  box-shadow: ${e=>`0px 2px ${r.sp1} ${e.theme.colors.dropShadowNormal}`};
37
- `,Te=x(function(e){const a=k(e),n=v(e),o=B(e),{companyName:s}=a;return{companyName:s,isDisabled:a.fetchState!=="Completed"?"disabled":void 0,magicLinkBankAccountDetails:n,mailingAddressDetails:o,magicLinkViewState:a}},function(e,a){const{navigate:n,location:o,vendorId:s,billId:l}=a;return{onFetchBankNameBySwift:i=>{e(ie(i))},onSaveHandler:i=>{j.trackBillPayMagicLinkSubmitBankAccountDetails(l),e(A(i,"international",s,l,a.isLocalCurrencyEnabled))},onBankDetailsUpdated:i=>{const{internationalWireSwiftAccountSection:d}=i;e(se({data:d}))},onAddressClick:()=>{const i=o.pathname.replace("international","address"),d=M(o.state?.pathnameStackToGoBack,o.pathname);n(i,{state:{pathnameStackToGoBack:d}})}}})(xe);function Ge(){const e=C(),a=y(),n=g(),{vendorId:o,billId:s}=S(),{useFeatureGate:l}=ue(),{isFeatureEnabled:i}=l(he.isBillPayLocalCurrencyFeatureEnabled);return o==null||s==null?t.jsx(f,{}):t.jsx(Fe,{windowSize:n,children:t.jsx(Te,{location:a,navigate:e,vendorId:o,billId:s,isLocalCurrencyEnabled:i})})}const Je={containerWidth:new je(100,58)},Me=m(ke)`
37
+ `,Te=x(function(e){const a=k(e),n=v(e),o=B(e),{companyName:s}=a;return{companyName:s,isDisabled:a.fetchState!=="Completed"?"disabled":void 0,magicLinkBankAccountDetails:n,mailingAddressDetails:o,magicLinkViewState:a}},function(e,a){const{navigate:n,location:o,vendorId:s,billId:l}=a;return{onFetchBankNameBySwift:i=>{e(ie(i))},onSaveHandler:i=>{j.trackBillPayMagicLinkSubmitBankAccountDetails(l),e(A(i,"international",s,l,a.isLocalCurrencyEnabled))},onBankDetailsUpdated:i=>{const{internationalWireSwiftAccountSection:d}=i;e(se({data:d}))},onAddressClick:()=>{const i=o.pathname.replace("international","address"),d=_(o.state?.pathnameStackToGoBack,o.pathname);n(i,{state:{pathnameStackToGoBack:d}})}}})(xe);function Ge(){const e=C(),a=y(),n=g(),{vendorId:o,billId:s}=S(),{useFeatureGate:l}=ue(),{isFeatureEnabled:i}=l(he.isBillPayLocalCurrencyFeatureEnabled);return o==null||s==null?t.jsx(f,{}):t.jsx(Fe,{windowSize:n,children:t.jsx(Te,{location:a,navigate:e,vendorId:o,billId:s,isLocalCurrencyEnabled:i})})}const Je={containerWidth:new je(100,58)},_e=m(ke)`
38
38
  width: ${r.sp4};
39
39
  height: ${r.sp4};
40
40
  margin-bottom: ${r.sp3};
@@ -58,7 +58,7 @@ import{j as t}from"./liveblocks-CCyJOwfy.js";import{l as S,k as x,j as C,u as y,
58
58
  ${e=>e.windowSize!=="small"?"overflow: auto;":""}
59
59
  box-shadow: ${e=>`0px 2px ${r.sp1} ${e.theme.colors.dropShadowNormal}`};
60
60
  padding-top: ${e=>e.windowSize!=="small"?r.sp2:"0px"};
61
- `,Ve=m.div`
61
+ `,Me=m.div`
62
62
  display: flex;
63
63
  flex-direction: column;
64
64
  align-items: center;
@@ -69,4 +69,4 @@ import{j as t}from"./liveblocks-CCyJOwfy.js";import{l as S,k as x,j as C,u as y,
69
69
  width: ${e=>e.windowSize=="small"?"auto":"42%"};
70
70
  background-color: ${e=>e.windowSize==="small"?e.theme.colors.grey4:e.theme.colors.background};
71
71
  margin-top: ${e=>e.windowSize==="small"?e.isAddressPage?"0px":"186px":"unset"};
72
- `,_e=x(function(e,a){return{file:a.file,type:a.type}})(ve);function h({appContent:e}){const a=ee(),n=y(),{tenantEmailDomain:o,vendorId:s,billId:l}=S(),[i]=te(),d=i.get("token"),H=n.pathname.includes("address"),w=g(),K=ge(),D=fe(),b=we(),V=()=>{K.toggle()},_=L(u=>k(u)),W=L(u=>v(u)),{authParams:U,fetchState:c,billAttachment:q,billFetchState:z,companyName:O,currencySymbol:Q,amount:R}=_,{tenantId:P,userId:E,sessionId:N}=U,{fetchState:X,internationalBankAccountCreateStatus:Y}=W;return I.useEffect(()=>{$()},[]),I.useEffect(()=>{b&&c==="Not-Started"&&s!=null&&o!=null&&d!=null&&a(le(s,o,d))},[b,c,s,o,d,a]),I.useEffect(()=>{b&&c==="Completed"&&($(E,N,P),l!=null&&a(re(l)))},[c,b,E,N,P,l,a]),c==="Error"?t.jsx(f,{}):X==="Completed"||Y.fetchState==="Completed"?($(),t.jsx(ae,{to:"../../../../../../../bank/account/save/success",replace:!0,relative:"path"})):c==="In-Progress"?t.jsx(be,{fetchState:c,style:{height:"100vh",backgroundColor:D.colors.grey5,boxShadow:`0px 2px ${r.sp1} ${D.colors.dropShadowNormal}`}}):t.jsxs(t.Fragment,{children:[c==="Completed"&&z==="Completed"&&t.jsx(Se,{analytics:j,onLoad:u=>(Z=>Z.trackBillPayMagicLinkPageLoad(o??"",s??"",O,l??"",We(n.pathname),Q,R))(u)}),t.jsxs(He,{windowSize:w,children:[w!=="small"?t.jsx(Me,{onClick:V}):null,t.jsx(Ve,{windowSize:w,isAddressPage:H,children:z==="In-Progress"?t.jsx(ye,{size:"ExtraLarge",start:!0}):t.jsx(_e,{file:q,type:"bill"})}),t.jsx(Ke,{windowSize:w,children:e})]})]})}const We=e=>`${e.split("/").at(-2)}_${e.split("/").at(-1)}`;function Ue(){return t.jsx($e,{})}function dt(){return t.jsxs(ne,{children:[t.jsx(p,{path:"bank/account/save/success",element:t.jsx(Ue,{})}),t.jsx(p,{path:":tenantEmailDomain/vendor/:vendorId/bill/:billId/ach/standard",element:t.jsx(h,{appContent:t.jsx(F,{})})}),t.jsx(p,{path:":tenantEmailDomain/vendor/:vendorId/bill/:billId/ach/same-day",element:t.jsx(h,{appContent:t.jsx(F,{})})}),t.jsx(p,{path:":tenantEmailDomain/vendor/:vendorId/bill/:billId/wire/address",element:t.jsx(h,{appContent:t.jsx(De,{isSubPage:!0})})}),t.jsx(p,{path:":tenantEmailDomain/vendor/:vendorId/bill/:billId/wire/us-domestic",element:t.jsx(h,{appContent:t.jsx(Le,{})})}),t.jsx(p,{path:":tenantEmailDomain/vendor/:vendorId/bill/:billId/wire/international",element:t.jsx(h,{appContent:t.jsx(Ge,{})})}),t.jsx(p,{path:"*",element:t.jsx(f,{})})]})}export{dt as default};
72
+ `,Ve=x(function(e,a){return{file:a.file,type:a.type}})(ve);function h({appContent:e}){const a=ee(),n=y(),{tenantEmailDomain:o,vendorId:s,billId:l}=S(),[i]=te(),d=i.get("token"),H=n.pathname.includes("address"),w=g(),K=ge(),D=fe(),b=we(),M=()=>{K.toggle()},V=L(u=>k(u)),W=L(u=>v(u)),{authParams:q,fetchState:c,billAttachment:U,billFetchState:z,companyName:O,currencySymbol:Q,amount:R}=V,{tenantId:P,userId:E,sessionId:N}=q,{fetchState:X,internationalBankAccountCreateStatus:Y}=W;return I.useEffect(()=>{$()},[]),I.useEffect(()=>{b&&c==="Not-Started"&&s!=null&&o!=null&&d!=null&&a(le(s,o,d))},[b,c,s,o,d,a]),I.useEffect(()=>{b&&c==="Completed"&&($(E,N,P),l!=null&&a(re(l)))},[c,b,E,N,P,l,a]),c==="Error"?t.jsx(f,{}):X==="Completed"||Y.fetchState==="Completed"?($(),t.jsx(ae,{to:"../../../../../../../bank/account/save/success",replace:!0,relative:"path"})):c==="In-Progress"?t.jsx(be,{fetchState:c,style:{height:"100vh",backgroundColor:D.colors.grey5,boxShadow:`0px 2px ${r.sp1} ${D.colors.dropShadowNormal}`}}):t.jsxs(t.Fragment,{children:[c==="Completed"&&z==="Completed"&&t.jsx(Se,{analytics:j,onLoad:u=>(Z=>Z.trackBillPayMagicLinkPageLoad(o??"",s??"",O,l??"",We(n.pathname),Q,R))(u)}),t.jsxs(He,{windowSize:w,children:[w!=="small"?t.jsx(_e,{onClick:M}):null,t.jsx(Me,{windowSize:w,isAddressPage:H,children:z==="In-Progress"?t.jsx(ye,{size:"ExtraLarge",start:!0}):t.jsx(Ve,{file:U,type:"bill"})}),t.jsx(Ke,{windowSize:w,children:e})]})]})}const We=e=>`${e.split("/").at(-2)}_${e.split("/").at(-1)}`;function qe(){return t.jsx($e,{})}function dt(){return t.jsxs(ne,{children:[t.jsx(p,{path:"bank/account/save/success",element:t.jsx(qe,{})}),t.jsx(p,{path:":tenantEmailDomain/vendor/:vendorId/bill/:billId/ach/standard",element:t.jsx(h,{appContent:t.jsx(F,{})})}),t.jsx(p,{path:":tenantEmailDomain/vendor/:vendorId/bill/:billId/ach/same-day",element:t.jsx(h,{appContent:t.jsx(F,{})})}),t.jsx(p,{path:":tenantEmailDomain/vendor/:vendorId/bill/:billId/wire/address",element:t.jsx(h,{appContent:t.jsx(De,{isSubPage:!0})})}),t.jsx(p,{path:":tenantEmailDomain/vendor/:vendorId/bill/:billId/wire/us-domestic",element:t.jsx(h,{appContent:t.jsx(Le,{})})}),t.jsx(p,{path:":tenantEmailDomain/vendor/:vendorId/bill/:billId/wire/international",element:t.jsx(h,{appContent:t.jsx(Ge,{})})}),t.jsx(p,{path:"*",element:t.jsx(f,{})})]})}export{dt as default};
@@ -0,0 +1,12 @@
1
+ import{j as u}from"./liveblocks-D0ylGz77.js";import{a as f}from"./sentry-C5UCCkb_.js";import{h as F,u as O,j as _,q as J,g as l,N as T}from"./core-DSsu1iyO.js";import{z as r,m as M,D as P,e as V,d as A,f as N,w as R,T as q,h as K}from"./index-CPG6ITBm.js";import{eR as W,Jl as $,Jv as B,Jm as G,eS as H,fl as Q,Jr as X,fK as Y,cU as Z,Jw as ee,Jx as te}from"./zeni-epic-state-CFQMpWBE.js";import{n as ne}from"./mui-D9TDAUAO.js";import{u as se}from"./useDeviceId-CD8u4vjr.js";import{f as ae}from"./analyticsHelper-COFNU8CP.js";import{t as ie}from"./getLocaleForTenant-OYWr98Zl.js";import"./recharts-C7IODwRw.js";import"./analytics-CQQ1PG0J.js";import"./plaid-mYHRXlz3.js";import"./dnd-Dok8dils.js";import"./stripe-DMRn4zHo.js";import"./lottie-Cu765PFn.js";import"./lexical-DO7p5ZXM.js";import"./pdf-BzjCkfw3.js";import"./utils-Cd1icpH6.js";(function(){try{var t=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},a=new t.Error().stack;a&&(t._sentryDebugIds=t._sentryDebugIds||{},t._sentryDebugIds[a]="74f8a6a0-73e6-4fdb-b314-fcd5c6e02d2a",t._sentryDebugIdIdentifier="sentry-dbid-74f8a6a0-73e6-4fdb-b314-fcd5c6e02d2a")}catch{}})();const x=(t,a)=>t!=null&&t.length>0&&a==="magic_links";function xe(){const t=F(),a=O(),m=_(),[k]=J(),n=k.get("token"),p=k.get("stytch_token_type"),g=r.getMagicLinkCodeVerifier(),i=se(),{otpChallenge:d,twoFAPhoneNumber:D,magicLinkEmail:c,verifyDeviceFetchState:z,resendVerifyDeviceOTPFetchState:C}=l(e=>e.tenantState),S=l(e=>e.tenantState.fetchState),y=l(e=>e.tenantState.activeTenantFetchState.fetchState),h=l(e=>e.tenantState.signInState),I=l(e=>e.tenantState.magicLinkSignInFetchState.fetchState),s=l(e=>e.tenantState.loggedInUser),o=l(e=>W(e)),b=l(e=>$(e)),E=r.getSignedInUser(),v=M().mode;f.useEffect(()=>{s?.zeniSessionId==null&&n!=null&&x(n,p)&&i!=null&&g!=null&&(r.saveMagicLinkTriggered(n),t(B(n,i,g)))},[n,p,t,i,g,s?.zeniSessionId]),f.useEffect(()=>{h!=="In-Progress"||S!=="Completed"&&y!=="Completed"||s?.zeniSessionId==null||o==null||(n!=null&&r.saveLastUsedMagicLinkToken(n),r.saveSignedInUserWithSession(s,s.zeniSessionId),r.saveSignedInUserTenants(G(b.tenantsInOrder),s.zeniSessionId),H(s.userId,s.zeniSessionId,o.tenantId),t(Q(o.tenantId)),r.saveActiveTenantDomainForUser(o.tenantEmailDomain),t(X("Completed")),P.updateAppLocaleID(ie(o)),ae(s,o,v,void 0,b.tenantsInOrder),Y().then(()=>{const e=K();e!=null&&V(e)}),setTimeout(()=>{A.trackLogin(N.Event.loginSuccess,"email",Z(o.productSettings))},2e3))},[h,S,y,s,o,b,v,a.state,t]);const U=f.useCallback(()=>{m("/signin/auth")},[m]),j=f.useCallback(()=>{i!=null&&d!=null&&c!=null&&t(ee(i,c,d))},[i,d,t,c]),w=f.useCallback(e=>{i!=null&&n!=null&&c!=null&&d!=null&&t(te(e,i,c,d))},[i,n,t,c,d]);if(I==="Completed"&&d!=null)return u.jsx(R,{phoneNumber:D,verifyOtpFetchState:z.fetchState,resendVerifyDeviceOTPFetchState:C,onResendOtp:j,onVerifyOtp:w,onCancelVerifyDevice:U});if(h==="In-Progress"&&S==="Completed"&&s?.zeniSessionId!=null&&o!=null||E!=null){const e=a.state?.origin??"/";return u.jsx(T,{to:e,state:{...a.state,origin:""}})}if(!x(n,p)||g==null||I==="Error"){const e=a.state?.origin??"/",L=n!=null&&r.getLastUsedMagicLinkToken()===n;return u.jsx(T,{to:e,state:{...a.state,origin:"",magicLinkAlreadyUsed:L,magicLinkExpired:!L&&(r.isMagicLinkTriggered(n??"")||I==="Error"&&s?.zeniSessionId==null)}})}return u.jsx(oe,{"data-testid":"smooth-loader",children:u.jsx(q,{size:"ExtraLarge",start:!0})})}const oe=ne.div`
2
+ position: fixed;
3
+ top: 0;
4
+ left: 0;
5
+ right: 0;
6
+ bottom: 0;
7
+ display: flex;
8
+ align-items: center;
9
+ justify-content: center;
10
+ z-index: 9999;
11
+ background-color: ${t=>t.theme.colors.background};
12
+ `;export{xe as default};