@zeniai/web-app-ui 5.0.55-dev → 5.0.56-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 (113) hide show
  1. package/dist/assets/AddressRoutes-T4qftw_1.js +1 -0
  2. package/dist/assets/AddressScreen-BklJKutc.js +9 -0
  3. package/dist/assets/{AiCfoScreen-bBUSfHWB.js → AiCfoScreen-B4xK4s4e.js} +3 -3
  4. package/dist/assets/{BillPayApprovalRoutes-2hXuGhl9.js → BillPayApprovalRoutes-SfFy4Q3x.js} +1 -1
  5. package/dist/assets/{BillPayRoutes-zS41FDXZ.js → BillPayRoutes-C_kzPWNw.js} +4 -4
  6. package/dist/assets/{BusinessVerificationPageScreen-Ct3skeMe.js → BusinessVerificationPageScreen-DgymQkoP.js} +2 -2
  7. package/dist/assets/{ChargeCardRoutes-CuAdoqYf.js → ChargeCardRoutes-DKy3Qza2.js} +8 -8
  8. package/dist/assets/CompanyPassportScreen-Q42ItsTK.js +1 -0
  9. package/dist/assets/{ConnectionAuthScreen-p0yF5-7Y.js → ConnectionAuthScreen-DWjSQZql.js} +1 -1
  10. package/dist/assets/CustomerOnboardingAuthScreen-CTfinB3p.js +1 -0
  11. package/dist/assets/{CustomerOnboardingRoutes-CpFbCHUf.js → CustomerOnboardingRoutes-BeIEf537.js} +4 -4
  12. package/dist/assets/{DashboardRoutes-DDAZzkgF.js → DashboardRoutes-DmT1zvbt.js} +3 -3
  13. package/dist/assets/{DefaultTenantHome-ChgUq64m.js → DefaultTenantHome-CkOir1h_.js} +1 -1
  14. package/dist/assets/{DomesticWireDetailScreen-ByrLTF-k.js → DomesticWireDetailScreen-Ba2RcbCG.js} +3 -3
  15. package/dist/assets/DrawerScreen-GbmWLeG7.js +1 -0
  16. package/dist/assets/{EntityDetailRoutes-QqB5pqCq.js → EntityDetailRoutes-EYGmcLTc.js} +1 -1
  17. package/dist/assets/{ExpenseAutomationRoutes-CL2KITKF.js → ExpenseAutomationRoutes-CO8PFCnO.js} +4 -4
  18. package/dist/assets/FeaturePreviewScreen-BbZ1xf4z.js +1 -0
  19. package/dist/assets/{MagicLinkRoutes-CBolYQjL.js → MagicLinkRoutes-CohCNxyX.js} +18 -18
  20. package/dist/assets/MagicLinkSignInScreen-B2CB3dkp.js +12 -0
  21. package/dist/assets/{MobileAppDrawer-BeJ-If8M.js → MobileAppDrawer-n8t03yaO.js} +1 -1
  22. package/dist/assets/NotFoundScreen-DpPEAqIa.js +1 -0
  23. package/dist/assets/{NotificationRoutes-B1POEpf-.js → NotificationRoutes-TwQiwNf3.js} +1 -1
  24. package/dist/assets/{PandLWithForecastRoutes-mNWJpjrX.js → PandLWithForecastRoutes-Wtfusoui.js} +1 -1
  25. package/dist/assets/{PeopleRoutes-Du_86K0g.js → PeopleRoutes-7E-ffjBJ.js} +5 -5
  26. package/dist/assets/PerformanceRoutes-CHrolr76.js +1 -0
  27. package/dist/assets/{Preview-CPDm5N-k.js → Preview-CktKjgWY.js} +1 -1
  28. package/dist/assets/{QBOConnectionScreen-BhcOl23Z.js → QBOConnectionScreen-DyznN-F2.js} +1 -1
  29. package/dist/assets/{ReferralListScreen-DEbwuGTl.js → ReferralListScreen-Dy8iQFPt.js} +2 -2
  30. package/dist/assets/{ReimbursementApprovalRoutes-BkkSOVv_.js → ReimbursementApprovalRoutes-BbOdeAtw.js} +1 -1
  31. package/dist/assets/{ReimbursementApprovalRuleDetailScreen-BcGzbUnN.js → ReimbursementApprovalRuleDetailScreen-DuDkeiAm.js} +1 -1
  32. package/dist/assets/{ReimbursementRoutes-CEjpsr8X.js → ReimbursementRoutes-BOMyJgrz.js} +4 -4
  33. package/dist/assets/{ReportsRoutes-UBnZ8bDz.js → ReportsRoutes-BSTB7uRz.js} +1 -1
  34. package/dist/assets/RewardsRoutes-vMUR4VOs.js +1 -0
  35. package/dist/assets/{ScreenRoutes-DtZbWTGl.js → ScreenRoutes-D4dqaFnm.js} +2 -2
  36. package/dist/assets/{SettingsRoutes-DCgs4OLl.js → SettingsRoutes-r9Ej5ZGq.js} +4 -4
  37. package/dist/assets/{SetupPagesScreen-BsOpxM3t.js → SetupPagesScreen-BaBZaUCN.js} +1 -1
  38. package/dist/assets/{SignInScreen-CY67jsy0.js → SignInScreen-Nl88Hc6C.js} +1 -1
  39. package/dist/assets/{SignOutScreen-5lq_Evk4.js → SignOutScreen-D4lUsOmx.js} +1 -1
  40. package/dist/assets/{TaskListScreen-DFdZjWgl.js → TaskListScreen-Bvnm9IXP.js} +2 -2
  41. package/dist/assets/{TaskRoutes-D1q4DIf6.js → TaskRoutes-BAXcXFEg.js} +2 -2
  42. package/dist/assets/TransactionDetailRoutes-DLz2n5Pp.js +1 -0
  43. package/dist/assets/{TransactionDetailScreen-uOgH9UNp.js → TransactionDetailScreen-BARgRHWT.js} +2 -2
  44. package/dist/assets/{TransactionListRoutes-BQchWm8T.js → TransactionListRoutes-FB1Nag0X.js} +1 -1
  45. package/dist/assets/{TreasuryRoutes-BtpbVTG-.js → TreasuryRoutes-D09j5H5F.js} +5 -5
  46. package/dist/assets/{VendorsRoutes-DZy6VVP0.js → VendorsRoutes-CMOWuwxW.js} +1 -1
  47. package/dist/assets/WiseConfirmationScreen-BburOEIH.js +12 -0
  48. package/dist/assets/{ZeniAccountRoutes-CQIW5-uh.js → ZeniAccountRoutes-CvMBgZsl.js} +10 -10
  49. package/dist/assets/ZeniAccountStatementScreen-CqjHqKdC.js +9 -0
  50. package/dist/assets/{accountMappingHelper-CQSFsM6N.js → accountMappingHelper-BOSY12FJ.js} +1 -1
  51. package/dist/assets/{analytics-ByrfXPqG.js → analytics-CcGmsyc8.js} +1 -1
  52. package/dist/assets/{analyticsHelper-BZYQYc1O.js → analyticsHelper-DJMvFBQ1.js} +1 -1
  53. package/dist/assets/{core-DcM32IW_.js → core-DkPdadc6.js} +1 -1
  54. package/dist/assets/{decodeURIComponentSafe-mAxyJdJ8.js → decodeURIComponentSafe-h3wJzOm1.js} +1 -1
  55. package/dist/assets/{dnd-36WXho_9.js → dnd-D-YvLFfj.js} +1 -1
  56. package/dist/assets/{empty-GSTAUqhH.js → empty-C7PzWdR6.js} +1 -1
  57. package/dist/assets/{empty-lHXrwReA.js → empty-ohi5JxHm.js} +1 -1
  58. package/dist/assets/{emptyVideoElement-Bsa6If51.js → emptyVideoElement-B09QwhYv.js} +1 -1
  59. package/dist/assets/epic-DC-PDk7m.js +2 -0
  60. package/dist/assets/getLocaleForTenant-FjCgXmXO.js +1 -0
  61. package/dist/assets/{index-Bw9qJkeB.js → index-8VSOxL6k.js} +1 -1
  62. package/dist/assets/{index-CR2DVZE0.js → index-BIUa1dNl.js} +2 -2
  63. package/dist/assets/{index-Dq0r4E9j.js → index-BVoPsTXN.js} +1 -1
  64. package/dist/assets/{index-DSBNuTzQ.js → index-CpD5ML2i.js} +12483 -12422
  65. package/dist/assets/{index-p7Us2Fcf.js → index-CxVN3Ojx.js} +1 -1
  66. package/dist/assets/{index-DTGcnfLC.js → index-DHz0Faq_.js} +1 -1
  67. package/dist/assets/{index-CjaQ8-D2.js → index-ufE2I9Jb.js} +1 -1
  68. package/dist/assets/{lexical-CYAYrhLa.js → lexical-Sc7rk4Y7.js} +1 -1
  69. package/dist/assets/{liveblocks-BeS4QmMp.js → liveblocks-tcXs1fes.js} +1 -1
  70. package/dist/assets/{lottie-Bdncx-qB.js → lottie-CwApzZxI.js} +1 -1
  71. package/dist/assets/{mui--qrGbwFJ.js → mui-DbdGpDJj.js} +1 -1
  72. package/dist/assets/{pathToGoBack-Cn4t6MOa.js → pathToGoBack-D9y2NyzP.js} +1 -1
  73. package/dist/assets/{pdf-6nmWWkz8.js → pdf-DG2fyOfp.js} +4 -4
  74. package/dist/assets/{pdf-lib-rQgtUIvp.js → pdf-lib-fmjHY_Su.js} +1 -1
  75. package/dist/assets/{plaid-BZ0BFqP0.js → plaid-UeHpA8su.js} +1 -1
  76. package/dist/assets/{pusher-4QLniNXV.js → pusher-CH-5kFcN.js} +1 -1
  77. package/dist/assets/{react-DKUlDjBa.js → react-BTMxDr8F.js} +1 -1
  78. package/dist/assets/{react-DCTwOcr5.js → react-CAp_bFar.js} +1 -1
  79. package/dist/assets/{react-BszWSDWQ.js → react-CFEMacjg.js} +1 -1
  80. package/dist/assets/{react-BOWjwOm8.js → react-CjW2GUTT.js} +1 -1
  81. package/dist/assets/{react-C3zOniDH.js → react-D3qpynvt.js} +1 -1
  82. package/dist/assets/{react-BFaux__7.js → react-P8ikJhK3.js} +1 -1
  83. package/dist/assets/{recharts-DoWl4vaN.js → recharts-D0a4NFa9.js} +1 -1
  84. package/dist/assets/{routePaths-Dr0mF--c.js → routePaths-D7wc65Bl.js} +1 -1
  85. package/dist/assets/{sentry-BlmJH5WH.js → sentry-DNuKG-9f.js} +1 -1
  86. package/dist/assets/{url-BG92tf7R.js → url-Bxb4Dr7g.js} +1 -1
  87. package/dist/assets/{url-AJ2wpRsW.js → url-EFuL_PC5.js} +1 -1
  88. package/dist/assets/useAskAiCfoHostNavButtonProps-BtZXhZ4f.js +1 -0
  89. package/dist/assets/{useDeviceId-DaD3aMiS.js → useDeviceId-DoEHbao8.js} +1 -1
  90. package/dist/assets/useFetchSuggestedQuestionsWhenReady-Bhmav9DR.js +1 -0
  91. package/dist/assets/{useInitialThreadRequest-82Lo2xWZ.js → useInitialThreadRequest-DId3URPK.js} +1 -1
  92. package/dist/assets/{utils-RmRP6xA4.js → utils-BmJyX3cx.js} +1 -1
  93. package/dist/assets/{withTransactionSidePanel-ClKqbF5a.js → withTransactionSidePanel-CzkV98Uv.js} +1 -1
  94. package/dist/assets/{zeni-epic-state-ChnjRetZ.js → zeni-epic-state-CSoWjbAn.js} +3 -3
  95. package/dist/index.html +1 -1
  96. package/package.json +3 -3
  97. package/dist/assets/AddressRoutes-DNt7Duo0.js +0 -1
  98. package/dist/assets/AddressScreen-he1e1kGg.js +0 -9
  99. package/dist/assets/CompanyPassportScreen-DOP3-8BK.js +0 -1
  100. package/dist/assets/CustomerOnboardingAuthScreen-VyI92nJg.js +0 -1
  101. package/dist/assets/DrawerScreen-CRCi_azE.js +0 -1
  102. package/dist/assets/FeaturePreviewScreen-PkNswvQo.js +0 -1
  103. package/dist/assets/MagicLinkSignInScreen-D6iPjuvI.js +0 -12
  104. package/dist/assets/NotFoundScreen-BQueQzhs.js +0 -1
  105. package/dist/assets/PerformanceRoutes-CX1dBnw2.js +0 -1
  106. package/dist/assets/RewardsRoutes-q5pGdj79.js +0 -1
  107. package/dist/assets/TransactionDetailRoutes-D9aq9a6c.js +0 -1
  108. package/dist/assets/WiseConfirmationScreen-DvTv7iw3.js +0 -12
  109. package/dist/assets/ZeniAccountStatementScreen-DfMsxUlV.js +0 -9
  110. package/dist/assets/epic-DhZTt5cl.js +0 -2
  111. package/dist/assets/getLocaleForTenant-h7G676lL.js +0 -1
  112. package/dist/assets/useAskAiCfoHostNavButtonProps-DDxvherx.js +0 -1
  113. package/dist/assets/useFetchSuggestedQuestionsWhenReady-SU-quGCv.js +0 -1
@@ -1,8 +1,8 @@
1
- import{j as a}from"./liveblocks-BeS4QmMp.js";import{t as $e,A as Ce}from"./AddressScreen-he1e1kGg.js";import ze from"./NotFoundScreen-BQueQzhs.js";import{a as g}from"./sentry-BlmJH5WH.js";import{j as oe,u as se,h as ie,l as re,g as D,N as x,k as ce,i as Me,n as qe,o as M}from"./core-DcM32IW_.js";import{y as de,k as le,z as B,a as ue,h as Je,p as _,v as V,C as H,d as N,B as we,f as X,al as Ke,q as Qe,am as Ie,j as te,an as Ze,ao as ke,o as He,ap as We,aq as xe,ar as Xe}from"./index-DSBNuTzQ.js";import{bn as Ye,eN as ee,fa as et,eT as pe,eR as me,bv as tt,mj as at,f6 as nt,bM as ot,j2 as ae,j5 as ve,I_ as st,bR as it,c0 as ge,rK as he,rv as rt,Ja as Y,rL as _e,GH as ct,k6 as Ue,Jb as Ve,Jc as dt,Jd as lt,Je as ut,j0 as pt,j3 as mt,rx as Be,rJ as gt,bC as Ee,ct as ht,rX as Te,pE as ft,ps as yt,j_ as bt,fz as St,fy as Ct,fx as It,Jf as kt,rp as xt,rY as Et,r$ as Tt,s2 as Ot,s8 as Pt,cS as At}from"./zeni-epic-state-ChnjRetZ.js";import{n as fe}from"./mui--qrGbwFJ.js";import{g as Dt,h as Ft,q as ne}from"./QBOConnectionScreen-BhcOl23Z.js";import"./recharts-DoWl4vaN.js";import"./analytics-ByrfXPqG.js";import"./plaid-BZ0BFqP0.js";import"./dnd-36WXho_9.js";import"./stripe-DMRn4zHo.js";import"./lottie-Bdncx-qB.js";import"./lexical-CYAYrhLa.js";import"./pdf-6nmWWkz8.js";import"./utils-RmRP6xA4.js";import"./empty-GSTAUqhH.js";import"./pdf-lib-rQgtUIvp.js";import"./index-Dq0r4E9j.js";import"./url-BG92tf7R.js";import"./index-CjaQ8-D2.js";import"./decodeURIComponentSafe-mAxyJdJ8.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]="556b49d6-27c6-4ce1-a29b-8aeb64d6eab3",t._sentryDebugIdIdentifier="sentry-dbid-556b49d6-27c6-4ce1-a29b-8aeb64d6eab3")}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"}})}}})(Ke),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(),k=Je(),{isFeatureEnabled:E}=m(_.isApAgingFeatureEnabled),{isFeatureEnabled:T}=m(_.isArAgingFeatureEnabled),{isFeatureEnabled:I}=m(_.isDepositAccountsFeatureEnabled),{isFeatureEnabled:f}=m(_.isReferralFeatureEnabled),{isFeatureEnabled:U}=m(_.isExpenseAutomationEnabled),{isFeatureEnabled:C}=m(_.isExpenseAutomationEnabledV2),{isFeatureEnabled:F}=m(_.isDebitCardFeatureEnabled),$=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=[],K=S?.resources?.find(l=>l.resource==="/reports/top_expenses")==null,z=S?.resources?.find(l=>l.resource==="/reports/task_card")==null,q=c?.userRole!=null&&tt(c?.userRole),v=S?.resources?.find(l=>l.resource==="/bills")==null&&!q,J=S?.resources?.find(l=>l.resource==="/reimbursements")==null;if(K===!1&&A.push("top_expenses"),z===!1&&A.push("task_card"),v===!1&&A.push("bill_pay_card","bill_pay_promo_card"),J===!1&&A.push("reimbursement_card","reimbursement_promo_card"),I===!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(x,{to:"../"});if(O==="Completed"&&p){const l=V(o.state?.pathnameStackToGoBack,o.pathname);if(w)return a.jsx(x,{to:"../../checking",state:{...o.state,pathnameStackToGoBack:l,message:"activation"}});if(P)return a.jsx(x,{to:"../../cards",state:{...o.state,pathnameStackToGoBack:l,message:"activation"}})}return n?.loggedInUserRoleMap!=null?a.jsxs(a.Fragment,{children:[a.jsx(H,{analytics:N,onLoad:l=>(Q=>Q.trackPageLoaded(X.Event.onboardingDashboardActivation))(l)}),a.jsx(jt,{navigate:t,location:o,themeState:u,signedInUser:i,isApAgingFeatureEnabled:E,isArAgingFeatureEnabled:T,shouldFetchZeniAccountsPromoCard:I,shouldFetchRewardsPlanCard:f,isExpenseAutomationEnabledForUser:$,isExpenseAutomationFeatureEnabledV2:C,isTreasuryEnabled:R,loggedInUserRoleMap:n?.loggedInUserRoleMap})]}):a.jsx(we,{fetchState:"In-Progress",style:{backgroundColor:k.colors.grey5}})},Oe=fe.div`
1
+ import{j as a}from"./liveblocks-tcXs1fes.js";import{t as $e,A as Ce}from"./AddressScreen-BklJKutc.js";import ze from"./NotFoundScreen-DpPEAqIa.js";import{a as g}from"./sentry-DNuKG-9f.js";import{j as oe,u as se,h as ie,l as re,g as D,N as x,k as ce,i as Me,n as qe,o as M}from"./core-DkPdadc6.js";import{$ as de,j as le,z as B,a as ue,h as Je,p as _,r as V,x as H,d as N,B as we,f as X,al as Ke,q as Qe,am as Ie,i as te,an as Ze,ao as ke,o as He,ap as We,aq as xe,ar as Xe}from"./index-CpD5ML2i.js";import{bn as Ye,eN as ee,fa as et,eT as pe,eR as me,bv as tt,mj as at,f6 as nt,bM as ot,j2 as ae,j5 as ve,I_ as st,bR as it,c0 as ge,rK as fe,rv as rt,Ja as Y,rL as _e,GH as ct,k6 as Ue,Jb as Ve,Jc as dt,Jd as lt,Je as ut,j0 as pt,j3 as mt,rx as Be,rJ as gt,bC as Ee,ct as ft,rX as Te,pE as ht,ps as yt,j_ as St,fz as bt,fy as Ct,fx as It,Jf as kt,rp as xt,rY as Et,r$ as Tt,s2 as Ot,s8 as Pt,cS as At}from"./zeni-epic-state-CSoWjbAn.js";import{n as he}from"./mui-DbdGpDJj.js";import{g as Dt,h as Ft,q as ne}from"./QBOConnectionScreen-DyznN-F2.js";import"./recharts-D0a4NFa9.js";import"./analytics-CcGmsyc8.js";import"./plaid-UeHpA8su.js";import"./dnd-D-YvLFfj.js";import"./stripe-DMRn4zHo.js";import"./lottie-CwApzZxI.js";import"./lexical-Sc7rk4Y7.js";import"./pdf-DG2fyOfp.js";import"./utils-BmJyX3cx.js";import"./empty-C7PzWdR6.js";import"./pdf-lib-fmjHY_Su.js";import"./index-BVoPsTXN.js";import"./url-Bxb4Dr7g.js";import"./index-ufE2I9Jb.js";import"./decodeURIComponentSafe-h3wJzOm1.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]="fd13e774-6a4e-4abb-8ee4-0dd54310fcc7",t._sentryDebugIdIdentifier="sentry-dbid-fd13e774-6a4e-4abb-8ee4-0dd54310fcc7")}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"}})}}})(Ke),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(),f=Ye(i),{useFeatureGate:m}=ue(),k=Je(),{isFeatureEnabled:E}=m(_.isApAgingFeatureEnabled),{isFeatureEnabled:T}=m(_.isArAgingFeatureEnabled),{isFeatureEnabled:I}=m(_.isDepositAccountsFeatureEnabled),{isFeatureEnabled:h}=m(_.isReferralFeatureEnabled),{isFeatureEnabled:U}=m(_.isExpenseAutomationEnabled),{isFeatureEnabled:C}=m(_.isExpenseAutomationEnabledV2),{isFeatureEnabled:F}=m(_.isDebitCardFeatureEnabled),$=C||U&&f,c=D(l=>ee(l)),{isFeatureEnabled:L}=m(_.isTreasuryEnabled),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=[],K=b?.resources?.find(l=>l.resource==="/reports/top_expenses")==null,z=b?.resources?.find(l=>l.resource==="/reports/task_card")==null,q=c?.userRole!=null&&tt(c?.userRole),v=b?.resources?.find(l=>l.resource==="/bills")==null&&!q,J=b?.resources?.find(l=>l.resource==="/reimbursements")==null;if(K===!1&&A.push("top_expenses"),z===!1&&A.push("task_card"),v===!1&&A.push("bill_pay_card","bill_pay_promo_card"),J===!1&&A.push("reimbursement_card","reimbursement_promo_card"),I===!1&&A.push("zeni_accounts_promo_card"),h===!1&&A.push("rewards_card"),g.useEffect(()=>{O!=="Completed"||d||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(x,{to:"../"});if(O==="Completed"&&p){const l=V(o.state?.pathnameStackToGoBack,o.pathname);if(w)return a.jsx(x,{to:"../../checking",state:{...o.state,pathnameStackToGoBack:l,message:"activation"}});if(P)return a.jsx(x,{to:"../../cards",state:{...o.state,pathnameStackToGoBack:l,message:"activation"}})}return n?.loggedInUserRoleMap!=null?a.jsxs(a.Fragment,{children:[a.jsx(H,{analytics:N,onLoad:l=>(Q=>Q.trackPageLoaded(X.Event.onboardingDashboardActivation))(l)}),a.jsx(jt,{navigate:t,location:o,themeState:u,signedInUser:i,isApAgingFeatureEnabled:E,isArAgingFeatureEnabled:T,shouldFetchZeniAccountsPromoCard:I,shouldFetchRewardsPlanCard:h,isExpenseAutomationEnabledForUser:$,isExpenseAutomationFeatureEnabledV2:C,isTreasuryEnabled:R,loggedInUserRoleMap:n?.loggedInUserRoleMap})]}):a.jsx(we,{fetchState:"In-Progress",style:{backgroundColor:k.colors.grey5}})},Oe=he.div`
2
2
  display: flex;
3
3
  height: 100vh;
4
4
  background-color: ${t=>t.theme.colors.grey4};
5
- `,Pe=fe.div`
5
+ `,Pe=he.div`
6
6
  display: flex;
7
7
  flex-direction: column;
8
8
  align-items: center;
@@ -16,8 +16,8 @@ import{j as a}from"./liveblocks-BeS4QmMp.js";import{t as $e,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(),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",k=dt(t.userRoleConfigState);return{onboardingCustomerView:i,analytics:N,isRefreshingViewInBackground:!1,isDisabled:m,companyTitles:k.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(Tt(e,n,i))},onUpdatePaymentAccountLoginStatus:(e,n)=>{t(Et(!1,e,n))},onEstablishConnectionSuccess:()=>{t(xt(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:k,email:E,ssn:T,nationalityCountryCode:I,dob:f,phone:U,syncToken:C,selectDocument:F,role:$,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:k.firstName,lastName:k.lastName,email:E,ssn:T,nationalityCountryCode:I?.selectedOption!=null?xe(I.selectedOption):void 0,phone:U,birthday:f!=null?Ee(f?.toString()):f,syncToken:C,titleAtCompany:$.selectedOption,ownershipInCompany:c,documentTypeSelectedForVerification:S,isSelectedForVerification:L,userVerificationStatus:j,fileIds:R,additionalDocumentTypesRequestedForVerification:[],additionalSubmittedDocumentsForVerificationFileIds:[],areAdditionalDocumentsRequestedForVerification:!1,areAdditionalDocumentsSubmittedForVerification:!1,isPhoneVerified:O}});t(Te({officers:n}))},onGetOtp:(e,n)=>{t(It(e,"CustomerOnboarding")),n!=null&&t(kt({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:k,companyWebsite:E,companyPhone:T,primaryContactEmail:I,primaryContactName:f,primaryContactUserId:U,primaryContactSyncToken:C,syncToken:F,fileIds:$,typeOfIncorporation:c,stateOfIncorporation:L,incDate:j,companySourceOfFunds:R,companySourceOfFundsDescription:O,companySubIndustry:S,countriesOfOperations:G,purposeOfAccount:w,purposeOfAccountDescription:P,regulatedStatus:A,regulatedStatusDescription:K,transactionVolume:z,transactionVolumeDescription:q,usNexus:v,usNexusTypes:J}=e,l={companyId:s,companyDescription:n,companyIndustry:i.selectedOption,companyIndustryType:h?.selectedOption??"",companyLegalName:m,taxIdOrEIN:k,website:E!=""&&E!=null?ht(E):void 0,phone:T,syncToken:F,fileIds:$,incDate:j!=null?Ee(j?.toString()):j,typeOfIncorporation:c?.selectedOption??"",stateOfIncorporation:L?.selectedOption??"",companySourceOfFunds:R?.selectedOption??"",companySourceOfFundsDescription:O,companySubIndustry:S?.selectedOption??"",countriesOfOperations:G?.selectedOptions.map(Z=>Z.length===2?Z:xe(Z))??[],purposeOfAccount:w?.selectedOption??"",purposeOfAccountDescription:P,regulatedStatus:A??"",regulatedStatusDescription:K,transactionVolume:z?.selectedOption??"",transactionVolumeDescription:q,usNexus:v,usNexusTypes:J?.selectedOptions??[]},Q={userId:U,firstName:f.firstName,lastName:f.lastName,email:I,syncToken:C};t(Te({companyDetails:l,primaryContactDetails:Q}))},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=$e(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})}}})(Ze),W=({taxCFOCustomer:t=!1,isOnAddressPage:o=!1,appContent:s})=>{const u=oe(),d=se(),r=ie(),p=Qe(),b=de(),[e,n]=g.useState(!1),[i,h]=g.useState(!1),[m,k]=g.useState(!1),{tenantEmailDomain:E}=re(),T=le(),{useFeatureGate:I}=ue(),{isFeatureEnabled:f}=I(_.isDebitCardFeatureEnabled),U=Me("/:tenantEmailDomain/onboarding")!==null&&d.search?.includes("code"),C=D(y=>y.onboardingCustomerViewState.fetchState),F=D(y=>y.onboardingCustomerViewState.currentStep),$=D(y=>y.onboardingCustomerViewState.uiState),c=D(y=>ee(y)),L=D(y=>y.userRoleConfigState.fetchState),j=D(y=>y.cardPaymentViewState),R=Ie(j.addCardPaymentSourceStatus.fetchState),O=j.addCardPaymentSourceStatus.fetchState,{code:S,realmId:G,state:w}=Dt(d.search),P=c.externalConnections?.accounting[0],A=P?.connectionType,K=P?.connectionName,z=P?.connectionId??"",q=B.getSignedInUser()?.userId??"";g.useEffect(()=>{i||(h(!0),r(ae()))},[i,r]),g.useEffect(()=>{m||(ve(["card"]),k(!0))},[m]),g.useEffect(()=>{R==="In-Progress"&&O==="Completed"&&r(ae())},[R,O]),g.useEffect(()=>{Ft(S,G,w,z,q)===!0&&c.externalConnections?.saveConnectionState!=="In-Progress"&&C==="Completed"&&(r(st(c.tenantId,{connection_type:A??"accounting",connection_name:K??"quickbooks_online",authorization_code:S,realm_id:G,connection_id:z,user_id:q},it(window.location.origin+"/onboarding/auth"))),N.trackOnboardingSaveQBOConnection(G,z),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(E)?.companyId,J=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"||!$.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 Q=Ie(l.companyDetailsLocalData?.addressStatus);g.useEffect(()=>{l.companyDetailsLocalData?.registeredAddressStatus?.addressToCreate==null&&l.companyDetailsLocalData?.addressStatus?.addressToCreate!=null&&Q==null&&r(Ue({addressType:"company_registered_address",addressToCreate:l.companyDetailsLocalData?.addressStatus?.addressToCreate}))},[l.companyDetailsLocalData?.addressStatus?.addressToCreate,l.companyDetailsLocalData?.registeredAddressStatus?.addressToCreate]);const Z=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(x,{to:"../../treasury"}):Le?a.jsx(x,{to:"../../checking"}):Re?a.jsx(x,{to:"../../cards"}):a.jsx(x,{to:"../../dashboard"});const y=l.updateStatus.fetchState==="In-Progress";if(Se&&!y)return t?a.jsxs(Oe,{children:[a.jsx(H,{analytics:N,onLoad:Ne=>be(Ne)}),a.jsx(Ae,{navigate:u,location:d,companyId:v,currentTenant:c,isAdmin:J,isOnAddressPage:o,themeState:b,googleAPIKey:te.googleMapsAPIKey}),s!=null?a.jsx(Pe,{windowSize:p,children:s}):null]}):a.jsx(x,{to:"../../onboarding/thankyou"})}else if(ye===!1&&T?.loggedInUserRoleMap!=null)return Z===!0?a.jsx(x,{to:"../../onboarding/thankyou"}):a.jsxs(Oe,{children:[a.jsx(H,{analytics:N,onLoad:y=>be(y)}),a.jsx(Ae,{navigate:u,location:d,companyId:v,currentTenant:c,isAdmin:J,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`
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=fe(t,s),f=Ve(t),m=ge(d?.userRole??[])&&i.updateStatus.fetchState!=="In-Progress"?void 0:"readonly",k=dt(t.userRoleConfigState);return{onboardingCustomerView:i,analytics:N,isRefreshingViewInBackground:!1,isDisabled:m,companyTitles:k.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:f,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(Tt(e,n,i))},onUpdatePaymentAccountLoginStatus:(e,n)=>{t(Et(!1,e,n))},onEstablishConnectionSuccess:()=>{t(xt(s,!0,!1))},handleOnConnectClick:()=>{N.trackOnboardingConnectQBO(),ne.handleClick()},updateQBOPopupState:e=>{t(Y({isQBOPopupOpen:e}))},onCompanyOfficerUpdated:e=>{const n=e.map(i=>{const{officerType:f,userId:m,name:k,email:E,ssn:T,nationalityCountryCode:I,dob:h,phone:U,syncToken:C,selectDocument:F,role:$,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:f,userId:m,firstName:k.firstName,lastName:k.lastName,email:E,ssn:T,nationalityCountryCode:I?.selectedOption!=null?xe(I.selectedOption):void 0,phone:U,birthday:h!=null?Ee(h?.toString()):h,syncToken:C,titleAtCompany:$.selectedOption,ownershipInCompany:c,documentTypeSelectedForVerification:b,isSelectedForVerification:L,userVerificationStatus:j,fileIds:R,additionalDocumentTypesRequestedForVerification:[],additionalSubmittedDocumentsForVerificationFileIds:[],areAdditionalDocumentsRequestedForVerification:!1,areAdditionalDocumentsSubmittedForVerification:!1,isPhoneVerified:O}});t(Te({officers:n}))},onGetOtp:(e,n)=>{t(It(e,"CustomerOnboarding")),n!=null&&t(kt({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(ht(e,n.split(".")[0]))},onCompanyDetailsChanged:e=>{const{companyDescription:n,companyIndustry:i,companyIndustryType:f,companyLegalName:m,companyTaxId:k,companyWebsite:E,companyPhone:T,primaryContactEmail:I,primaryContactName:h,primaryContactUserId:U,primaryContactSyncToken:C,syncToken:F,fileIds:$,typeOfIncorporation:c,stateOfIncorporation:L,incDate:j,companySourceOfFunds:R,companySourceOfFundsDescription:O,companySubIndustry:b,countriesOfOperations:G,purposeOfAccount:w,purposeOfAccountDescription:P,regulatedStatus:A,regulatedStatusDescription:K,transactionVolume:z,transactionVolumeDescription:q,usNexus:v,usNexusTypes:J}=e,l={companyId:s,companyDescription:n,companyIndustry:i.selectedOption,companyIndustryType:f?.selectedOption??"",companyLegalName:m,taxIdOrEIN:k,website:E!=""&&E!=null?ft(E):void 0,phone:T,syncToken:F,fileIds:$,incDate:j!=null?Ee(j?.toString()):j,typeOfIncorporation:c?.selectedOption??"",stateOfIncorporation:L?.selectedOption??"",companySourceOfFunds:R?.selectedOption??"",companySourceOfFundsDescription:O,companySubIndustry:b?.selectedOption??"",countriesOfOperations:G?.selectedOptions.map(Z=>Z.length===2?Z:xe(Z))??[],purposeOfAccount:w?.selectedOption??"",purposeOfAccountDescription:P,regulatedStatus:A??"",regulatedStatusDescription:K,transactionVolume:z?.selectedOption??"",transactionVolumeDescription:q,usNexus:v,usNexusTypes:J?.selectedOptions??[]},Q={userId:U,firstName:h.firstName,lastName:h.lastName,email:I,syncToken:C};t(Te({companyDetails:l,primaryContactDetails:Q}))},onAddressClick:(e,n)=>{const i=De(S,e,n),f=V(p.state?.pathnameStackToGoBack,p.pathname);r(i,{state:{pathnameStackToGoBack:f}})},onRegisteredAddressClick:(e,n)=>{const i=De(S,e,n),f=V(p.state?.pathnameStackToGoBack,p.pathname);r(i,{state:{pathnameStackToGoBack:f}})},onUpdateCustomerView:(e,n,i)=>{t(gt(s,!1,n,i,e))},onAddressEditHandler:e=>{if(e!=null){const n=$e(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})}}})(Ze),W=({taxCFOCustomer:t=!1,isOnAddressPage:o=!1,appContent:s})=>{const u=oe(),d=se(),r=ie(),p=Qe(),S=de(),[e,n]=g.useState(!1),[i,f]=g.useState(!1),[m,k]=g.useState(!1),{tenantEmailDomain:E}=re(),T=le(),{useFeatureGate:I}=ue(),{isFeatureEnabled:h}=I(_.isDebitCardFeatureEnabled),U=Me("/:tenantEmailDomain/onboarding")!==null&&d.search?.includes("code"),C=D(y=>y.onboardingCustomerViewState.fetchState),F=D(y=>y.onboardingCustomerViewState.currentStep),$=D(y=>y.onboardingCustomerViewState.uiState),c=D(y=>ee(y)),L=D(y=>y.userRoleConfigState.fetchState),j=D(y=>y.cardPaymentViewState),R=Ie(j.addCardPaymentSourceStatus.fetchState),O=j.addCardPaymentSourceStatus.fetchState,{code:b,realmId:G,state:w}=Dt(d.search),P=c.externalConnections?.accounting[0],A=P?.connectionType,K=P?.connectionName,z=P?.connectionId??"",q=B.getSignedInUser()?.userId??"";g.useEffect(()=>{i||(f(!0),r(ae()))},[i,r]),g.useEffect(()=>{m||(ve(["card"]),k(!0))},[m]),g.useEffect(()=>{R==="In-Progress"&&O==="Completed"&&r(ae())},[R,O]),g.useEffect(()=>{Ft(b,G,w,z,q)===!0&&c.externalConnections?.saveConnectionState!=="In-Progress"&&C==="Completed"&&(r(st(c.tenantId,{connection_type:A??"accounting",connection_name:K??"quickbooks_online",authorization_code:b,realm_id:G,connection_id:z,user_id:q},it(window.location.origin+"/onboarding/auth"))),N.trackOnboardingSaveQBOConnection(G,z),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(E)?.companyId,J=ge(c?.userRole??[]),l=D(y=>fe(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"||!$.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 Q=Ie(l.companyDetailsLocalData?.addressStatus);g.useEffect(()=>{l.companyDetailsLocalData?.registeredAddressStatus?.addressToCreate==null&&l.companyDetailsLocalData?.addressStatus?.addressToCreate!=null&&Q==null&&r(Ue({addressType:"company_registered_address",addressToCreate:l.companyDetailsLocalData?.addressStatus?.addressToCreate}))},[l.companyDetailsLocalData?.addressStatus?.addressToCreate,l.companyDetailsLocalData?.registeredAddressStatus?.addressToCreate]);const Z=l.isInterimEmailSent;if(B.getSignedInUser()==null)throw Error("Can't access onboarding flow without signing in...");const Le=pe(h,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(x,{to:"../../treasury"}):Le?a.jsx(x,{to:"../../checking"}):Re?a.jsx(x,{to:"../../cards"}):a.jsx(x,{to:"../../dashboard"});const y=l.updateStatus.fetchState==="In-Progress";if(be&&!y)return t?a.jsxs(Oe,{children:[a.jsx(H,{analytics:N,onLoad:Ne=>Se(Ne)}),a.jsx(Ae,{navigate:u,location:d,companyId:v,currentTenant:c,isAdmin:J,isOnAddressPage:o,themeState:S,googleAPIKey:te.googleMapsAPIKey}),s!=null?a.jsx(Pe,{windowSize:p,children:s}):null]}):a.jsx(x,{to:"../../onboarding/thankyou"})}else if(ye===!1&&T?.loggedInUserRoleMap!=null)return Z===!0?a.jsx(x,{to:"../../onboarding/thankyou"}):a.jsxs(Oe,{children:[a.jsx(H,{analytics:N,onLoad:y=>Se(y)}),a.jsx(Ae,{navigate:u,location:d,companyId:v,currentTenant:c,isAdmin:J,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=he.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 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 k=pe(r,i),E=me(i),T=D(f=>f.onboardingCustomerViewState.updateStatus.fetchState),I=i.company?.companyOnboardingInfo.isOnboardingCompleted;return I!==!0||h?T==="Completed"&&I===!0&&h&&b?.loggedInUserRoleMap!=null?a.jsxs(Fe,{children:[a.jsx(H,{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})]}):T==="Completed"&&I===!1&&b?.loggedInUserRoleMap!=null?a.jsxs(Fe,{children:[a.jsx(H,{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:T}):k?a.jsx(x,{to:"../../checking"}):E?a.jsx(x,{to:"../../cards"}):a.jsx(x,{to:"../../dashboard"})};function oa(){return a.jsxs(qe,{children:[a.jsx(M,{path:"/",element:a.jsx(W,{})}),a.jsx(M,{path:"/billing/edit",element:a.jsx(W,{taxCFOCustomer:!0})}),a.jsx(M,{path:"/thankyou",element:a.jsx(vt,{})}),a.jsx(M,{path:"/activation",element:a.jsx(wt,{})}),a.jsx(M,{path:"/address/edit/:addressType/:addressId",element:a.jsx(W,{isOnAddressPage:!0,appContent:a.jsx(Ce,{})})}),a.jsx(M,{path:"/address/new/:addressType",element:a.jsx(W,{isOnAddressPage:!0,appContent:a.jsx(Ce,{})})}),a.jsx(M,{path:"*",element:a.jsx(ze,{})})]})}export{oa as default};
23
+ `,je=ce(function(t,o){const{companyId:s,currentTenant:u}=o,d=fe(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(h=>ee(h)),f=i.productSettings.isOtherProductsEnabled;g.useEffect(()=>{o(Be(m,!1,!f))},[]);const m=i.companyId??B.getSignedInUserTenant(p)?.companyId;if(S.loggedInUser==null)throw Error("Can't access onboarding flow without signing in...");const k=pe(r,i),E=me(i),T=D(h=>h.onboardingCustomerViewState.updateStatus.fetchState),I=i.company?.companyOnboardingInfo.isOnboardingCompleted;return I!==!0||f?T==="Completed"&&I===!0&&f&&S?.loggedInUserRoleMap!=null?a.jsxs(Fe,{children:[a.jsx(H,{analytics:N,onLoad:h=>{h.trackPageLoaded(X.Event.onboardingLandingPage,"Onboarding",At(i.productSettings))}}),a.jsx(je,{navigate:t,showUpdatePaymentDetailButton:f,location:s,companyId:m,currentTenant:i,themeState:u,isVisitingFirstTime:e})]}):T==="Completed"&&I===!1&&S?.loggedInUserRoleMap!=null?a.jsxs(Fe,{children:[a.jsx(H,{analytics:N,onLoad:h=>{h.trackPageLoaded(X.Event.onboardingInterimPage)}}),a.jsx(je,{navigate:t,showUpdatePaymentDetailButton:f,location:s,companyId:m,currentTenant:i,themeState:u,isVisitingFirstTime:e})]}):a.jsx(we,{fetchState:T}):k?a.jsx(x,{to:"../../checking"}):E?a.jsx(x,{to:"../../cards"}):a.jsx(x,{to:"../../dashboard"})};function oa(){return a.jsxs(qe,{children:[a.jsx(M,{path:"/",element:a.jsx(W,{})}),a.jsx(M,{path:"/billing/edit",element:a.jsx(W,{taxCFOCustomer:!0})}),a.jsx(M,{path:"/thankyou",element:a.jsx(vt,{})}),a.jsx(M,{path:"/activation",element:a.jsx(wt,{})}),a.jsx(M,{path:"/address/edit/:addressType/:addressId",element:a.jsx(W,{isOnAddressPage:!0,appContent:a.jsx(Ce,{})})}),a.jsx(M,{path:"/address/new/:addressType",element:a.jsx(W,{isOnAddressPage:!0,appContent:a.jsx(Ce,{})})}),a.jsx(M,{path:"*",element:a.jsx(ze,{})})]})}export{oa as default};
@@ -1,4 +1,4 @@
1
- import{j as l}from"./liveblocks-BeS4QmMp.js";import{l as K,g as k,u as z,h as G,j as q,k as H,s as $a,n as nt,o as D}from"./core-DcM32IW_.js";import{eN as L,Jv as Me,bC as Yt,bq as de,KI as za,hS as qa,KJ as wt,KK as Za,hV as ot,KL as Re,KM as Ha,h_ as Ja,KN as xt,KO as Qa,i2 as st,KP as je,KQ as Xa,cj as it,KR as Wa,KS as en,JP as tn,iY as an,KT as nn,bn as ye,KU as Vt,Jj as W,bc as Nt,ja as Gt,mt as Kt,iV as $t,Jl as ee,Jk as Z,f2 as on,fk as sn,KV as rn,KW as cn,KX as zt,KY as ge,tA as ve,tB as Ie,tY as ue,tS as te,tF as Ae,KZ as ln,K_ as dn,K$ as un,L0 as qt,L1 as be,L2 as mn,dB as Ue,qc as Zt,L3 as pn,L4 as hn,L5 as fn,L6 as ct,IH as lt,jq as me,u4 as dt,qk as gn,L7 as bn,tC as Dt,qf as ce,qb as Ht,L8 as oe,L9 as Cn,La as ut,IF as mt,sc as Jt,Lb as _n,Lc as kn,Ld as Sn,Le as pt,sp as yn,Lf as vn,tE as Ot,sb as Qt,Lg as se,Lh as In,bv as Xt,u8 as Wt,Li as An,Lj as En,Lk as Tn,Ll as ht,u3 as wn,Lm as xn,tD as Ft,u7 as ea,Ln as re,Lo as Dn,Lp as On,Lq as ta,jf as aa,mq as na,jk as oa,mo as sa,mn as ra,mm as ia,rA as Fn,fa as Pn,cM as Bn,cN as Rn,mj as jn,f6 as Ln,mA as Mn,Lr as Un,Dc as Yn,Ls as Vn,Lt as Nn,Lu as Gn,b5 as ft,eZ as Kn,gA as $n,fB as zn,mu as qn,iO as Zn,mr as Hn,mp as Jn,eT as Qn,eR as Xn}from"./zeni-epic-state-ChnjRetZ.js";import{z as j,R as J,v as O,d as A,D as $,aQ as Wn,M as Ee,C as Te,aR as ca,f as V,aS as eo,k as we,aT as la,a as Ye,p as M,h as to,aU as ao,aV as no,q as oo,c as da,a0 as so,aW as ro,aJ as ua,aX as io,aY as co,Q as lo,aZ as xe,a_ as uo,am as mo,r as po,N as ho,a$ as fo,b0 as _e}from"./index-DSBNuTzQ.js";import{n as gt}from"./mui--qrGbwFJ.js";import{a as _}from"./sentry-BlmJH5WH.js";import{w as ma}from"./withTransactionSidePanel-ClKqbF5a.js";import{b as pa,t as pe,e as ae,a as bt,v as go}from"./routePaths-Dr0mF--c.js";import{u as Ve}from"./useAskAiCfoHostNavButtonProps-DDxvherx.js";import{c as De,b as bo}from"./useFetchSuggestedQuestionsWhenReady-SU-quGCv.js";import Se from"./NotFoundScreen-BQueQzhs.js";import{t as ha}from"./analyticsHelper-BZYQYc1O.js";import{C as Co}from"./CompanyPassportScreen-DOP3-8BK.js";import{F as _o}from"./FeaturePreviewScreen-PkNswvQo.js";import{R as ko}from"./ReferralListScreen-DEbwuGTl.js";import"./recharts-DoWl4vaN.js";import"./analytics-ByrfXPqG.js";import"./plaid-BZ0BFqP0.js";import"./dnd-36WXho_9.js";import"./stripe-DMRn4zHo.js";import"./lottie-Bdncx-qB.js";import"./lexical-CYAYrhLa.js";import"./pdf-6nmWWkz8.js";import"./utils-RmRP6xA4.js";import"./TransactionDetailScreen-uOgH9UNp.js";import"./decodeURIComponentSafe-mAxyJdJ8.js";import"./MobileAppDrawer-BeJ-If8M.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]="063bf22f-a330-4653-a821-a4984d079f59",e._sentryDebugIdIdentifier="sentry-dbid-063bf22f-a330-4653-a821-a4984d079f59")}catch{}})();const So=ma(function({openTransactionPanel:e,panelContent:a,sidePanelIsOpen:t,sidePanelIsFullView:n}){const{vendorId:o,reportDate:r}=K(),s=j.getSignedInUser(),i=k(T=>T.tenantState.currentTenantId),u=k(T=>L(T)),{tenantEmailDomain:f}=K(),g=z(),b=u?.companyName??"",p={userId:s?.userId??"",sessionId:s?.zeniSessionId??"",tenantId:i??""},c=_.useMemo(()=>({authParams:p,companyName:b,downloadEndPoint:`${J}/agingDetailedReport`,timezone:Me()}),[]),m=_.useMemo(()=>r!=null?Yt(r):de(),[r]),C=G(),d=q(),h=k(T=>za(T,m,o)),S=_.useCallback(()=>{o!=null&&h.fetchState!=="In-Progress"&&h.fetchState!=="Completed"&&C(qa(o,m))},[m]),y=_.useCallback(()=>{d("../../",{relative:"path"})},[]),F=_.useCallback((T,B)=>{C(wt({sortKey:T,sortOrder:B}))},[]),E=_.useCallback(T=>{C(wt({downloadState:T}))},[]),v=_.useCallback(T=>{if(e)e(T.transactionId,T.transactionType);else if(f!=null){const B=pa({id:T.transactionId,type:T.transactionType},f);d(B);const he=O(g.state?.pathnameStackToGoBack,g.pathname);d(B,{state:{pathnameStackToGoBack:he}})}},[f,e]),w=_.useCallback(()=>{h.vendor!=null&&A.trackApAgingDetail("AP Aging",m.format($.getLocalizedStrings().dateFormat.analytics.YYYYDashMMDashDDFormat),h.vendor.id,h.vendor.name)},[h.vendor,m]);return _.useEffect(()=>{S()},[]),_.useEffect(()=>{h.fetchState==="Completed"&&w()},[w,h.fetchState]),l.jsx(Wn,{apAgingDetail:h,downloadParams:c,reportDate:m,analytics:A,onTransactionClick:v,onReload:S,onBackClick:y,onColumnSortConfigChanged:F,updateDownloadStateHandler:E,panelContent:a,sidePanelIsOpen:t,sidePanelIsFullView:n})}),yo=()=>{const{isAiCfoOpen:e,setIsAiCfoOpen:a}=Ee(),t=G(),n=q(),o=k(v=>Za(v)),{isAiCfoAccessEnabled:r,onAskAiCfoClick:s}=Ve({isAiCfoOpen:e,setIsAiCfoOpen:a,mobileExploreReferrer:"AP Aging"});De({isDataReady:o.fetchState==="Completed"});const i=j.getSignedInUser(),u=k(v=>v.tenantState.currentTenantId),f=k(v=>L(v)),g=f?.companyName??"",b={userId:i?.userId??"",sessionId:i?.zeniSessionId??"",tenantId:u??""},p=_.useMemo(()=>({authParams:b,companyName:g,downloadEndPoint:`${J}/agingReport`,timezone:Me()}),[]),c=o.apAgingUIState.selectedDate??de(),m=_.useCallback(()=>{o.fetchState!=="In-Progress"&&o.fetchState!=="Completed"&&t(ot(c))},[]);_.useEffect(()=>{m()},[]);const C=_.useCallback(()=>{n("../",{relative:"path"})},[]),d=_.useCallback(v=>{t(Re({searchString:v}))},[]),h=_.useCallback((v,w)=>{t(Re({sortKey:w,sortOrder:v}))},[]),S=_.useCallback(v=>{n(`./${v}/${c.format($.getLocalizedStrings().dateFormat.analytics.YYYYDashMMDashDDFormat)}`)},[c]),y=_.useCallback(v=>{t(Re({downloadState:v}))},[]),F=_.useCallback((v,w)=>{},[]),E=_.useCallback((v,w)=>{t(Re({selectedDate:v,agingDateSelectionType:w})),t(ot(v))},[]);return l.jsxs(l.Fragment,{children:[o.fetchState==="Completed"?l.jsx(Te,{analytics:A,onLoad:v=>v.trackPageLoaded(V.Event.agingReport,"AP Aging")}):null,l.jsx(ca,{uiState:o.apAgingUIState,report:o,downloadParams:p,analytics:A,onReloadReport:m,onBackClick:C,onSearchTextChange:d,onSortOrderChange:h,onEntityNameClick:S,updateDownloadStateHandler:y,onSelectedDateChanged:E,onNodeCollapseToggled:F,isAiCfoAccessEnabled:r,onAskAiCfoClick:s})]})},vo=ma(function({openTransactionPanel:e,panelContent:a,sidePanelIsOpen:t,sidePanelIsFullView:n}){const{customerId:o,reportDate:r}=K(),s=j.getSignedInUser(),i=k(w=>L(w)),{tenantEmailDomain:u}=K(),f=z(),g=i.companyName,b={userId:s?.userId??"",sessionId:s?.zeniSessionId??"",tenantId:i.tenantId},p=_.useMemo(()=>({authParams:b,companyName:g,downloadEndPoint:`${J}/agingDetailedReport`,timezone:Me()}),[]),c=_.useMemo(()=>r!=null?Yt(r):de(),[r]),m=G(),C=q(),d=k(w=>Ha(w,c,o)),h=_.useCallback(()=>{o!=null&&d.fetchState!=="In-Progress"&&d.fetchState!=="Completed"&&m(Ja(o,c))},[c]),S=_.useCallback(()=>{C("../../",{relative:"path"})},[]),y=_.useCallback((w,T)=>{m(xt({sortKey:w,sortOrder:T}))},[]),F=_.useCallback(w=>{m(xt({downloadState:w}))},[]),E=_.useCallback(w=>{if(e)e(w.transactionId,w.transactionType);else if(u!=null){const T=pa({id:w.transactionId,type:w.transactionType},u);C(T);const B=O(f.state?.pathnameStackToGoBack,f.pathname);C(T,{state:{pathnameStackToGoBack:B}})}},[u,e]),v=_.useCallback(()=>{d.customer!=null&&A.trackArAgingDetail("AR Aging",c.format($.getLocalizedStrings().dateFormat.analytics.YYYYDashMMDashDDFormat),d.customer.id,d.customer.name)},[d.customer,c]);return _.useEffect(()=>{h()},[]),_.useEffect(()=>{d.fetchState==="Completed"&&v()},[d.fetchState,v]),l.jsx(eo,{arAgingDetail:d,downloadParams:p,reportDate:c,analytics:A,onTransactionClick:E,onReload:h,onBackClick:S,onColumnSortConfigChanged:y,updateDownloadStateHandler:F,panelContent:a,sidePanelIsOpen:t,sidePanelIsFullView:n})}),Io=()=>{const{isAiCfoOpen:e,setIsAiCfoOpen:a}=Ee(),t=G(),n=q(),o=k(E=>Qa(E)),{isAiCfoAccessEnabled:r,onAskAiCfoClick:s}=Ve({isAiCfoOpen:e,setIsAiCfoOpen:a,mobileExploreReferrer:"AR Aging"});De({isDataReady:o.fetchState==="Completed"});const i=j.getSignedInUser(),u=k(E=>L(E)),f=u.companyName,g={userId:i?.userId??"",sessionId:i?.zeniSessionId??"",tenantId:u.tenantId},b=_.useMemo(()=>({authParams:g,companyName:f,downloadEndPoint:`${J}/agingReport`,timezone:Me()}),[]),p=o.arAgingUIState.selectedDate??de(),c=_.useCallback(()=>{o.fetchState!=="In-Progress"&&o.fetchState!=="Completed"&&t(st(p))},[]);_.useEffect(()=>{c()},[]);const m=_.useCallback(()=>{n("../",{relative:"path"})},[]),C=_.useCallback(E=>{t(je({searchString:E}))},[]),d=_.useCallback((E,v)=>{t(je({sortKey:v,sortOrder:E}))},[]),h=_.useCallback(E=>{n(`./${E}/${p.format($.getLocalizedStrings().dateFormat.analytics.YYYYDashMMDashDDFormat)}`)},[p]),S=_.useCallback(E=>{t(je({downloadState:E}))},[]),y=_.useCallback((E,v)=>{t(je({selectedDate:E,agingDateSelectionType:v})),t(st(E))},[]),F=_.useCallback((E,v)=>{t(Xa({nodeId:E,isCollapsed:v}))},[]);return l.jsxs(l.Fragment,{children:[o.fetchState==="Completed"?l.jsx(Te,{analytics:A,onLoad:E=>E.trackPageLoaded(V.Event.agingReport,"AR Aging")}):null,l.jsx(ca,{uiState:o.arAgingUIState,report:o,downloadParams:b,analytics:A,onReloadReport:c,onBackClick:m,onSearchTextChange:C,onSortOrderChange:d,onEntityNameClick:h,updateDownloadStateHandler:S,onSelectedDateChanged:y,onNodeCollapseToggled:F,isAiCfoAccessEnabled:r,onAskAiCfoClick:s})]})},fa=(e,a)=>({key:a,title:e.accountName,amount:e.balance?.available,logoUri:e.logo?.toString(),source:e});function ga(e,a){const t=tn(a.firstMonthOfFY);return{onItemClick:(n,o)=>{const r=o.accountName===""?o.accountDescription:o.accountName,s=pe(a.tenantEmailDomain,o.accountId,o.accountType,r,"quarter",t,!1),i=O(a.location.state?.pathnameStackToGoBack,a.location.pathname);a.navigate(s,{state:{pathnameStackToGoBack:i,referrer:a.referrerType}})},onSetAccountsStatementDate:(n,o)=>{e(an(n,o))},onPromoCardBtnClick:n=>{if(a.isZeniAccountsAdmin){let o=`../../checking/${n}`;n?A.trackZeniAccountsCashBalancePromoClicked("Move Money"):(A.trackZeniAccountsCashBalancePromoClicked("Sign Up for Free"),o="../../checking/promo");const r=O(a.location.state?.pathnameStackToGoBack,a.location.pathname);a.navigate(o,{state:{pathnameStackToGoBack:r}})}else A.trackZeniAccountsCashBalancePromoClicked("Learn More"),window.open("https://www.zeni.ai/product/business-checking-accounts","_blank")}}}const Ao=H(function(e){const a=Wa(e).accountsInOrder.map((n,o)=>fa(n,o)),t=en(e);return{sectionTitle:$.getLocalizedStrings().balanceCard.cashBalanceSectionTitle,transactionArray:a,zeniAccountsPromoCardReport:t,fetchState:e.cashBalanceState.fetchState,analytics:A}},ga)(la),Eo=H(function(e){const a=nn(e).accountsInOrder.map((o,r)=>fa(o,r)),t=j.getSignedInUser(),n=ye(t);return{sectionTitle:$.getLocalizedStrings().balanceCard.cardBalanceSectionTitle,transactionArray:a,isZeniUser:n,fetchState:e.cardBalanceState.fetchState,analytics:A}},ga)(la);function To(){const e=q(),a=z(),{tenantEmailDomain:t}=K(),n=we(),o=k(s=>L(s).company?.companyInfo.firstMonthOfFY??1),r=it(n?.loggedInUserRoleMap);return k(s=>s.cashBalanceState.fetchState)==="Error"?l.jsx(Se,{}):l.jsx(Ao,{tenantEmailDomain:t,location:a,referrerType:"Cash Balance",navigate:e,isZeniAccountsAdmin:r,firstMonthOfFY:o})}function wo(){const e=q(),a=z(),{tenantEmailDomain:t}=K(),n=we(),o=it(n?.loggedInUserRoleMap),r=k(s=>L(s).company?.companyInfo.firstMonthOfFY??1);return k(s=>s.cardBalanceState.fetchState)==="Error"?l.jsx(Se,{}):l.jsx(Eo,{tenantEmailDomain:t,location:a,referrerType:"Card Balance",navigate:e,isZeniAccountsAdmin:o,firstMonthOfFY:r})}const xo=gt.div`
1
+ import{j as l}from"./liveblocks-tcXs1fes.js";import{l as K,g as k,u as z,h as N,j as q,k as H,s as $a,n as nt,o as D}from"./core-DkPdadc6.js";import{eN as L,Jv as Me,bC as Yt,bq as de,KI as za,hS as qa,KJ as wt,KK as Za,hV as ot,KL as Re,KM as Ha,h_ as Ja,KN as xt,KO as Qa,i2 as st,KP as je,KQ as Xa,cj as it,KR as Wa,KS as en,JP as tn,iY as an,KT as nn,bn as ye,KU as Vt,Jj as W,bc as Gt,ja as Nt,mt as Kt,iV as $t,Jl as ee,Jk as Z,f2 as on,fk as sn,KV as rn,KW as cn,KX as zt,KY as ge,tA as ve,tB as Ie,tY as ue,tS as te,tF as Ae,KZ as ln,K_ as dn,K$ as un,L0 as qt,L1 as be,L2 as mn,dB as Ue,qc as Zt,L3 as pn,L4 as hn,L5 as fn,L6 as ct,IH as lt,jq as me,u4 as dt,qk as gn,L7 as bn,tC as Dt,qf as ce,qb as Ht,L8 as oe,L9 as Cn,La as ut,IF as mt,sc as Jt,Lb as _n,Lc as kn,Ld as Sn,Le as pt,sp as yn,Lf as vn,tE as Ot,sb as Qt,Lg as se,Lh as In,bv as Xt,u8 as Wt,Li as An,Lj as En,Lk as Tn,Ll as ht,u3 as wn,Lm as xn,tD as Ft,u7 as ea,Ln as re,Lo as Dn,Lp as On,Lq as ta,jf as aa,mq as na,jk as oa,mo as sa,mn as ra,mm as ia,rA as Fn,fa as Pn,cM as Bn,cN as Rn,mj as jn,f6 as Ln,mA as Mn,Lr as Un,Dc as Yn,Ls as Vn,Lt as Gn,Lu as Nn,b5 as ft,eZ as Kn,gA as $n,fB as zn,mu as qn,iO as Zn,mr as Hn,mp as Jn,eT as Qn,eR as Xn}from"./zeni-epic-state-CSoWjbAn.js";import{z as j,U as J,r as O,d as A,D as $,aQ as Wn,M as Ee,x as Te,aR as ca,f as V,aS as eo,j as we,aT as la,a as Ye,p as M,h as to,aU as ao,aV as no,q as oo,c as da,a0 as so,aW as ro,aJ as ua,aX as io,aY as co,T as lo,aZ as xe,a_ as uo,am as mo,m as po,Q as ho,a$ as fo,b0 as _e}from"./index-CpD5ML2i.js";import{n as gt}from"./mui-DbdGpDJj.js";import{a as _}from"./sentry-DNuKG-9f.js";import{w as ma}from"./withTransactionSidePanel-CzkV98Uv.js";import{b as pa,t as pe,e as ae,a as bt,v as go}from"./routePaths-D7wc65Bl.js";import{u as Ve}from"./useAskAiCfoHostNavButtonProps-BtZXhZ4f.js";import{c as De,b as bo}from"./useFetchSuggestedQuestionsWhenReady-Bhmav9DR.js";import Se from"./NotFoundScreen-DpPEAqIa.js";import{t as ha}from"./analyticsHelper-DJMvFBQ1.js";import{C as Co}from"./CompanyPassportScreen-Q42ItsTK.js";import{F as _o}from"./FeaturePreviewScreen-BbZ1xf4z.js";import{R as ko}from"./ReferralListScreen-Dy8iQFPt.js";import"./recharts-D0a4NFa9.js";import"./analytics-CcGmsyc8.js";import"./plaid-UeHpA8su.js";import"./dnd-D-YvLFfj.js";import"./stripe-DMRn4zHo.js";import"./lottie-CwApzZxI.js";import"./lexical-Sc7rk4Y7.js";import"./pdf-DG2fyOfp.js";import"./utils-BmJyX3cx.js";import"./TransactionDetailScreen-BARgRHWT.js";import"./decodeURIComponentSafe-h3wJzOm1.js";import"./MobileAppDrawer-n8t03yaO.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]="5ae22baa-9201-41b4-82cd-1e2003088de4",e._sentryDebugIdIdentifier="sentry-dbid-5ae22baa-9201-41b4-82cd-1e2003088de4")}catch{}})();const So=ma(function({openTransactionPanel:e,panelContent:a,sidePanelIsOpen:t,sidePanelIsFullView:n}){const{vendorId:o,reportDate:r}=K(),s=j.getSignedInUser(),i=k(T=>T.tenantState.currentTenantId),u=k(T=>L(T)),{tenantEmailDomain:f}=K(),g=z(),b=u?.companyName??"",p={userId:s?.userId??"",sessionId:s?.zeniSessionId??"",tenantId:i??""},c=_.useMemo(()=>({authParams:p,companyName:b,downloadEndPoint:`${J}/agingDetailedReport`,timezone:Me()}),[]),m=_.useMemo(()=>r!=null?Yt(r):de(),[r]),C=N(),d=q(),h=k(T=>za(T,m,o)),S=_.useCallback(()=>{o!=null&&h.fetchState!=="In-Progress"&&h.fetchState!=="Completed"&&C(qa(o,m))},[m]),y=_.useCallback(()=>{d("../../",{relative:"path"})},[]),F=_.useCallback((T,B)=>{C(wt({sortKey:T,sortOrder:B}))},[]),E=_.useCallback(T=>{C(wt({downloadState:T}))},[]),v=_.useCallback(T=>{if(e)e(T.transactionId,T.transactionType);else if(f!=null){const B=pa({id:T.transactionId,type:T.transactionType},f);d(B);const he=O(g.state?.pathnameStackToGoBack,g.pathname);d(B,{state:{pathnameStackToGoBack:he}})}},[f,e]),w=_.useCallback(()=>{h.vendor!=null&&A.trackApAgingDetail("AP Aging",m.format($.getLocalizedStrings().dateFormat.analytics.YYYYDashMMDashDDFormat),h.vendor.id,h.vendor.name)},[h.vendor,m]);return _.useEffect(()=>{S()},[]),_.useEffect(()=>{h.fetchState==="Completed"&&w()},[w,h.fetchState]),l.jsx(Wn,{apAgingDetail:h,downloadParams:c,reportDate:m,analytics:A,onTransactionClick:v,onReload:S,onBackClick:y,onColumnSortConfigChanged:F,updateDownloadStateHandler:E,panelContent:a,sidePanelIsOpen:t,sidePanelIsFullView:n})}),yo=()=>{const{isAiCfoOpen:e,setIsAiCfoOpen:a}=Ee(),t=N(),n=q(),o=k(v=>Za(v)),{isAiCfoAccessEnabled:r,onAskAiCfoClick:s}=Ve({isAiCfoOpen:e,setIsAiCfoOpen:a,mobileExploreReferrer:"AP Aging"});De({isDataReady:o.fetchState==="Completed"});const i=j.getSignedInUser(),u=k(v=>v.tenantState.currentTenantId),f=k(v=>L(v)),g=f?.companyName??"",b={userId:i?.userId??"",sessionId:i?.zeniSessionId??"",tenantId:u??""},p=_.useMemo(()=>({authParams:b,companyName:g,downloadEndPoint:`${J}/agingReport`,timezone:Me()}),[]),c=o.apAgingUIState.selectedDate??de(),m=_.useCallback(()=>{o.fetchState!=="In-Progress"&&o.fetchState!=="Completed"&&t(ot(c))},[]);_.useEffect(()=>{m()},[]);const C=_.useCallback(()=>{n("../",{relative:"path"})},[]),d=_.useCallback(v=>{t(Re({searchString:v}))},[]),h=_.useCallback((v,w)=>{t(Re({sortKey:w,sortOrder:v}))},[]),S=_.useCallback(v=>{n(`./${v}/${c.format($.getLocalizedStrings().dateFormat.analytics.YYYYDashMMDashDDFormat)}`)},[c]),y=_.useCallback(v=>{t(Re({downloadState:v}))},[]),F=_.useCallback((v,w)=>{},[]),E=_.useCallback((v,w)=>{t(Re({selectedDate:v,agingDateSelectionType:w})),t(ot(v))},[]);return l.jsxs(l.Fragment,{children:[o.fetchState==="Completed"?l.jsx(Te,{analytics:A,onLoad:v=>v.trackPageLoaded(V.Event.agingReport,"AP Aging")}):null,l.jsx(ca,{uiState:o.apAgingUIState,report:o,downloadParams:p,analytics:A,onReloadReport:m,onBackClick:C,onSearchTextChange:d,onSortOrderChange:h,onEntityNameClick:S,updateDownloadStateHandler:y,onSelectedDateChanged:E,onNodeCollapseToggled:F,isAiCfoAccessEnabled:r,onAskAiCfoClick:s})]})},vo=ma(function({openTransactionPanel:e,panelContent:a,sidePanelIsOpen:t,sidePanelIsFullView:n}){const{customerId:o,reportDate:r}=K(),s=j.getSignedInUser(),i=k(w=>L(w)),{tenantEmailDomain:u}=K(),f=z(),g=i.companyName,b={userId:s?.userId??"",sessionId:s?.zeniSessionId??"",tenantId:i.tenantId},p=_.useMemo(()=>({authParams:b,companyName:g,downloadEndPoint:`${J}/agingDetailedReport`,timezone:Me()}),[]),c=_.useMemo(()=>r!=null?Yt(r):de(),[r]),m=N(),C=q(),d=k(w=>Ha(w,c,o)),h=_.useCallback(()=>{o!=null&&d.fetchState!=="In-Progress"&&d.fetchState!=="Completed"&&m(Ja(o,c))},[c]),S=_.useCallback(()=>{C("../../",{relative:"path"})},[]),y=_.useCallback((w,T)=>{m(xt({sortKey:w,sortOrder:T}))},[]),F=_.useCallback(w=>{m(xt({downloadState:w}))},[]),E=_.useCallback(w=>{if(e)e(w.transactionId,w.transactionType);else if(u!=null){const T=pa({id:w.transactionId,type:w.transactionType},u);C(T);const B=O(f.state?.pathnameStackToGoBack,f.pathname);C(T,{state:{pathnameStackToGoBack:B}})}},[u,e]),v=_.useCallback(()=>{d.customer!=null&&A.trackArAgingDetail("AR Aging",c.format($.getLocalizedStrings().dateFormat.analytics.YYYYDashMMDashDDFormat),d.customer.id,d.customer.name)},[d.customer,c]);return _.useEffect(()=>{h()},[]),_.useEffect(()=>{d.fetchState==="Completed"&&v()},[d.fetchState,v]),l.jsx(eo,{arAgingDetail:d,downloadParams:p,reportDate:c,analytics:A,onTransactionClick:E,onReload:h,onBackClick:S,onColumnSortConfigChanged:y,updateDownloadStateHandler:F,panelContent:a,sidePanelIsOpen:t,sidePanelIsFullView:n})}),Io=()=>{const{isAiCfoOpen:e,setIsAiCfoOpen:a}=Ee(),t=N(),n=q(),o=k(E=>Qa(E)),{isAiCfoAccessEnabled:r,onAskAiCfoClick:s}=Ve({isAiCfoOpen:e,setIsAiCfoOpen:a,mobileExploreReferrer:"AR Aging"});De({isDataReady:o.fetchState==="Completed"});const i=j.getSignedInUser(),u=k(E=>L(E)),f=u.companyName,g={userId:i?.userId??"",sessionId:i?.zeniSessionId??"",tenantId:u.tenantId},b=_.useMemo(()=>({authParams:g,companyName:f,downloadEndPoint:`${J}/agingReport`,timezone:Me()}),[]),p=o.arAgingUIState.selectedDate??de(),c=_.useCallback(()=>{o.fetchState!=="In-Progress"&&o.fetchState!=="Completed"&&t(st(p))},[]);_.useEffect(()=>{c()},[]);const m=_.useCallback(()=>{n("../",{relative:"path"})},[]),C=_.useCallback(E=>{t(je({searchString:E}))},[]),d=_.useCallback((E,v)=>{t(je({sortKey:v,sortOrder:E}))},[]),h=_.useCallback(E=>{n(`./${E}/${p.format($.getLocalizedStrings().dateFormat.analytics.YYYYDashMMDashDDFormat)}`)},[p]),S=_.useCallback(E=>{t(je({downloadState:E}))},[]),y=_.useCallback((E,v)=>{t(je({selectedDate:E,agingDateSelectionType:v})),t(st(E))},[]),F=_.useCallback((E,v)=>{t(Xa({nodeId:E,isCollapsed:v}))},[]);return l.jsxs(l.Fragment,{children:[o.fetchState==="Completed"?l.jsx(Te,{analytics:A,onLoad:E=>E.trackPageLoaded(V.Event.agingReport,"AR Aging")}):null,l.jsx(ca,{uiState:o.arAgingUIState,report:o,downloadParams:b,analytics:A,onReloadReport:c,onBackClick:m,onSearchTextChange:C,onSortOrderChange:d,onEntityNameClick:h,updateDownloadStateHandler:S,onSelectedDateChanged:y,onNodeCollapseToggled:F,isAiCfoAccessEnabled:r,onAskAiCfoClick:s})]})},fa=(e,a)=>({key:a,title:e.accountName,amount:e.balance?.available,logoUri:e.logo?.toString(),source:e});function ga(e,a){const t=tn(a.firstMonthOfFY);return{onItemClick:(n,o)=>{const r=o.accountName===""?o.accountDescription:o.accountName,s=pe(a.tenantEmailDomain,o.accountId,o.accountType,r,"quarter",t,!1),i=O(a.location.state?.pathnameStackToGoBack,a.location.pathname);a.navigate(s,{state:{pathnameStackToGoBack:i,referrer:a.referrerType}})},onSetAccountsStatementDate:(n,o)=>{e(an(n,o))},onPromoCardBtnClick:n=>{if(a.isZeniAccountsAdmin){let o=`../../checking/${n}`;n?A.trackZeniAccountsCashBalancePromoClicked("Move Money"):(A.trackZeniAccountsCashBalancePromoClicked("Sign Up for Free"),o="../../checking/promo");const r=O(a.location.state?.pathnameStackToGoBack,a.location.pathname);a.navigate(o,{state:{pathnameStackToGoBack:r}})}else A.trackZeniAccountsCashBalancePromoClicked("Learn More"),window.open("https://www.zeni.ai/product/business-checking-accounts","_blank")}}}const Ao=H(function(e){const a=Wa(e).accountsInOrder.map((n,o)=>fa(n,o)),t=en(e);return{sectionTitle:$.getLocalizedStrings().balanceCard.cashBalanceSectionTitle,transactionArray:a,zeniAccountsPromoCardReport:t,fetchState:e.cashBalanceState.fetchState,analytics:A}},ga)(la),Eo=H(function(e){const a=nn(e).accountsInOrder.map((o,r)=>fa(o,r)),t=j.getSignedInUser(),n=ye(t);return{sectionTitle:$.getLocalizedStrings().balanceCard.cardBalanceSectionTitle,transactionArray:a,isZeniUser:n,fetchState:e.cardBalanceState.fetchState,analytics:A}},ga)(la);function To(){const e=q(),a=z(),{tenantEmailDomain:t}=K(),n=we(),o=k(s=>L(s).company?.companyInfo.firstMonthOfFY??1),r=it(n?.loggedInUserRoleMap);return k(s=>s.cashBalanceState.fetchState)==="Error"?l.jsx(Se,{}):l.jsx(Ao,{tenantEmailDomain:t,location:a,referrerType:"Cash Balance",navigate:e,isZeniAccountsAdmin:r,firstMonthOfFY:o})}function wo(){const e=q(),a=z(),{tenantEmailDomain:t}=K(),n=we(),o=it(n?.loggedInUserRoleMap),r=k(s=>L(s).company?.companyInfo.firstMonthOfFY??1);return k(s=>s.cardBalanceState.fetchState)==="Error"?l.jsx(Se,{}):l.jsx(Eo,{tenantEmailDomain:t,location:a,referrerType:"Card Balance",navigate:e,isZeniAccountsAdmin:o,firstMonthOfFY:r})}const xo=gt.div`
2
2
  display: flex;
3
3
  flex: 1 1 auto;
4
4
  min-height: 100%;
@@ -10,11 +10,11 @@ import{j as l}from"./liveblocks-BeS4QmMp.js";import{l as K,g as k,u as z,h as G,
10
10
  flex-direction: column;
11
11
  align-items: center;
12
12
  background-color: ${e=>e.theme.colors.grey4};
13
- `;function Oo({title:e,reportId:a,entityAutoCompleteView:t,autoCompleteText:n,isAiCfoAccessEnabled:o,onAskAiCfoClick:r}){const s=q(),i=G(),u=z(),{tenantEmailDomain:f}=K(),g=to();return l.jsxs(xo,{children:[l.jsx(ao,{source:a==="cash_balance"?"CashBalanceDetailScreen":"CardBalanceDetailScreen",title:e,onBackClick:()=>{s("../")},hideSearchBtn:!0,backgroundColor:g.colors.grey4,searchAutoComplete:{autoCompleteData:{entityAutoCompleteView:t,autoCompleteText:n},autoCompleteActions:{onAutoCompleteInputChange:b=>{b.trim().length>=2?i(ee({searchString:b,searchOrigin:"navbar"})):b.trim().length===0&&i(Z("navbar"))},onAutoCompleteEntity:b=>{n!=null&&A?.trackSearch(V.Event.search,Fo(a),b.type,b.name,n);const p=ae(b,f),c=O(u.state?.pathnameStackToGoBack,u.pathname);s(p,{state:{pathnameStackToGoBack:c}})}}},rightSideComponent:o===!0&&r!=null?l.jsx(no,{onClick:r}):null}),l.jsx(Do,{children:a==="cash_balance"?l.jsx(To,{}):l.jsx(wo,{})})]})}function Pt(){const{isAiCfoOpen:e,setIsAiCfoOpen:a}=Ee(),t=z(),n=G(),{useFeatureGate:o}=Ye(),{isFeatureEnabled:r}=o(M.isDepositAccountsFeatureEnabled),s=k(h=>h.cashBalanceState.fetchState),i=k(h=>h.cardBalanceState.fetchState),u=j.getSignedInUser();if(u==null)throw Error("Can't access dashboard detail without signing in...");const f=Vt((h=>{const S=Nt(h,"/").split("/");return S[S.length-1]})(t.pathname));let g="Not-Started",b="";const p=$.getLocalizedStrings();switch(f){case"cash_balance":g=s,b=p.reportTitleById.cash_balance;break;case"card_balance":g=i,b=p.reportTitleById.card_balance;break;default:console.error(`${f} is not supported!`)}const{isAiCfoAccessEnabled:c,onAskAiCfoClick:m}=Ve({isAiCfoOpen:e,setIsAiCfoOpen:a,mobileExploreReferrer:f==="card_balance"?"Card Balance":"Cash Balance"});De({isDataReady:g==="Completed"});const C=k(h=>h.entityAutoCompleteState.autoCompleteText.navbar),d=k(h=>W(h,"navbar"));return _.useEffect(()=>{g==="Not-Started"&&function(h,S,y){switch(S){case"card_balance":h($t());break;case"cash_balance":h(Gt()),y===!0&&h(Kt());break;default:throw new Error(`balance report type ${S} is not yet supported`)}}(n,f,r)},[u,n,g]),l.jsxs(l.Fragment,{children:[g==="Completed"?l.jsx(Te,{analytics:A,onLoad:h=>((S,y)=>{switch(y){case"card_balance":S.trackPageLoaded(V.Event.cardBalance);break;case"cash_balance":S.trackPageLoaded(V.Event.cashBalance);break;default:console.error(`Analytics: Not tracking Page Loaded for ${y}!`)}})(h,f)}):null,l.jsx(Oo,{title:b,reportId:f,autoCompleteText:C,entityAutoCompleteView:d,isAiCfoAccessEnabled:c,onAskAiCfoClick:m})]})}const Fo=e=>{switch(e){case"cash_balance":return"Cash Balance";case"card_balance":return"Card Balance";default:return"Dashboard"}},Po=[];function Oe(e){const{mobileExploreReferrer:a}=e,t=G(),n=q(),o=z(),{tenantEmailDomain:r}=K(),{setIsAiCfoOpen:s,setAiCfoSidePanelQuestionToSubmit:i}=Ee(),u=oo(),f=lo(u),g=$a(),b=k(B=>on(B)),p=b.uiState?.currentChatSessionId,c=b.allSessionsWithOrderedQuestionAnswers??Po,m=j.getSignedInUser()?.userId,C=da(),d=bo()&&C&&r!=null,h=so(),S=ro(h),{useDynamicConfig:y}=Ye(),{configValue:F}=y(ua.aiCfoMessageDynamicConfig),E=_.useMemo(()=>Array.isArray(F.default_message_list)?F.default_message_list:[],[F.default_message_list]),v=_.useMemo(()=>(S!=null&&S.length>0?S:E).slice(0,2),[E,S]),w=_.useCallback((B,he)=>{if(m==null||B.trim()==="")return;const fe=io(g.getState());if(f){const Fe=O(o.state?.pathnameStackToGoBack,o.pathname);n(`/${r}/ai-cfo/explore`,{state:{message:"",origin:"",pathnameStackToGoBack:Fe,referrer:a,aiCfoInitialQuestion:B,aiCfoShouldSubmit:!fe}})}else{if(fe)return t(sn(B)),void s(!0);i(B),s(!0),co(t,B,"insights_section",p,c,m,he,void 0)}},[c,p,t,f,o.pathname,o.state,a,n,s,i,g,r,m]),T=_.useCallback(()=>{if(f){const B=O(o.state?.pathnameStackToGoBack,o.pathname);n(`/${r}/ai-cfo/explore`,{state:{message:"",origin:"",pathnameStackToGoBack:B,referrer:a}})}else s(!0)},[f,o.pathname,o.state,a,n,s,r]);return _.useMemo(()=>{if(d)return{onAskSomethingElseClick:T,onSuggestedQuestionClick:w,suggestedQuestions:v}},[d,T,w,v])}const Bo=H(function(e){const a=rn(e),t=cn(e),n=zt(e),{scrollPosition:o,...r}=n,s=$.getLocalizedStrings().reportTitleById.cash_in_cash_out,i=j.getSignedInUser(),u=e.tenantState.currentTenantId,f=L(e),g=f?.companyName??"",b={userId:i?.userId??"",sessionId:i?.zeniSessionId??"",tenantId:u??""},p=e.entityAutoCompleteState.autoCompleteText.navbar,c=W(e,"navbar");return{selectedRangeReport:a,reportLabels:{reportTitle:s},highlightedRangeReport:t,uiState:r,scrollPosition:o,downloadParams:{downloadState:a.downloadState,currentTenantCompanyName:g,statementEndPoint:`${J}/statement`,authParams:b},analytics:A,autoCompleteData:{autoCompleteText:p,entityAutoCompleteView:c}}},function(e,a){return{updateDownloadStateHandler:t=>{e(ln(t))},onTimeframeSelectionChanged:()=>{},onCOABalancesRangeChanged:(t,n)=>{e(Ae(t,n)),e(ge({resetLeftScroll:!0}))},onThisPeriodChanged:t=>{e(ue("month")),e(te(a.firstMonthOfFY,t)),e(ge({resetLeftScroll:!0}))},onAdditionalBalanceSelectionChanged:(t,n,o)=>{e(ve(a.firstMonthOfFY,t,o,n)),n.length>0&&e(Ie(a.firstMonthOfFY,n.includes("this_period_vs_last_period")?"compare_mode_amount":"compare_mode_percent",o,n)),a.isCompareModeOn!==t&&setTimeout(()=>e(ge({resetLeftScroll:!0})),50)},onElementCollapseStateChanged:(t,n)=>{e(ge({nodeCollapseState:{nodeId:t,isCollapsed:n}}))},onTableScroll:t=>{e(ge({scrollPosition:t}))},autoCompleteActions:{onAutoCompleteInputChange:t=>{t.trim().length>=2?e(ee({searchString:t,searchOrigin:"navbar"})):t.trim().length===0&&e(Z("navbar"))},onAutoCompleteEntity:t=>{const n=ae(t,a.tenantEmailDomain),o=O(a.location.state?.pathnameStackToGoBack,a.location.pathname);a.navigate(n,{state:{pathnameStackToGoBack:o}})}},onBackClick:()=>{a.navigate("../")}}})(xe),Ro=e=>{const{tenantEmailDomain:a,location:t,navigate:n}=e,o=Oe({mobileExploreReferrer:"DashboardCashInCashOut"}),r=k(s=>zt(s)).mode==="compare_mode";return l.jsx(Bo,{firstMonthOfFY:e.firstMonthOfFY,tenantEmailDomain:a,location:t,isCompareModeOn:r,navigate:n,insightsSectionAiCfoInfo:o})},jo=e=>{let a,t;switch(e.balanceTimeFrame){case"month":case"quarter":a=e.balanceTimeFrame,t=Ue(e);break;case"year":a="quarter",t={startDate:e.endDate.startOf("quarter"),endDate:e.endDate};break;case"free_range":console.error("free_range timeframe is not supported!")}return{timeframe:a,timePeriod:t}},Lo=H(function(e){const a=dn(e),t=un(e),n=qt(e),{scrollPosition:o,...r}=n,s=$.getLocalizedStrings().reportTitleById.cash_position,i=j.getSignedInUser(),u=e.tenantState.currentTenantId,f=L(e),g=f?.companyName??"",b={userId:i?.userId??"",sessionId:i?.zeniSessionId??"",tenantId:u??""},p=e.entityAutoCompleteState.autoCompleteText.navbar,c=W(e,"navbar");return{selectedRangeReport:a,reportLabels:{reportTitle:s},highlightedRangeReport:t,uiState:r,scrollPosition:o,downloadParams:{downloadState:a.downloadState,currentTenantCompanyName:g,statementEndPoint:`${J}/statement`,authParams:b},analytics:A,autoCompleteData:{autoCompleteText:p,entityAutoCompleteView:c}}},function(e,a){return{updateDownloadStateHandler:t=>{e(mn(t))},onTimeframeSelectionChanged:t=>{e(ue(t)),setTimeout(()=>e(be({resetLeftScroll:!0})),50)},onCOABalancesRangeChanged:(t,n)=>{e(Ae(t,n)),e(be({resetLeftScroll:!0}))},onThisPeriodChanged:t=>{e(te(a.firstMonthOfFY,t)),e(be({resetLeftScroll:!0}))},onAdditionalBalanceSelectionChanged:(t,n,o)=>{e(ve(a.firstMonthOfFY,t,o,n)),n.length>0&&e(Ie(a.firstMonthOfFY,n.includes("this_period_vs_last_period")?"compare_mode_amount":"compare_mode_percent",o,n)),a.isCompareModeOn!==t&&setTimeout(()=>e(be({resetLeftScroll:!0})),50)},onAccountBalanceClick:(t,n)=>{const{timePeriod:o,timeframe:r}=jo(n),s=t.accountName===""?t.accountDescription:t.accountName;if(o!=null&&r!=null){const i=pe(a.tenantEmailDomain,t.accountId,t.accountType,s,r,o),u=O(a.location.state?.pathnameStackToGoBack,a.location.pathname);a.navigate(i,{state:{pathnameStackToGoBack:u,referrer:"Cash Position"}})}},autoCompleteActions:{onAutoCompleteInputChange:t=>{t.trim().length>=2?e(ee({searchString:t,searchOrigin:"navbar"})):t.trim().length===0&&e(Z("navbar"))},onAutoCompleteEntity:t=>{const n=ae(t,a.tenantEmailDomain),o=O(a.location.state?.pathnameStackToGoBack,a.location.pathname);a.navigate(n,{state:{pathnameStackToGoBack:o}})}},onTableScroll:t=>{e(be({scrollPosition:t}))},onBackClick:()=>{a.navigate("../")}}})(xe),Mo=e=>{const{tenantEmailDomain:a,location:t,navigate:n}=e,o=Oe({mobileExploreReferrer:"DashboardCashPosition"}),r=k(s=>qt(s)).mode==="compare_mode";return l.jsx(Lo,{firstMonthOfFY:e.firstMonthOfFY,tenantEmailDomain:a,location:t,isCompareModeOn:r,navigate:n,insightsSectionAiCfoInfo:o})},N=(e,a,t,n)=>{e===!1?a!=null&&n("../../",{relative:"path"}):a!=t&&(a!=null&&a.length>0?n(`../${t}`,{replace:!0}):n(`./forecast/${t}`,{replace:!0}))};function Qe(){return l.jsxs(nt,{children:[l.jsx(D,{path:"/",element:l.jsx(Q,{})}),l.jsx(D,{path:"/:forecastId",element:l.jsx(Q,{})}),l.jsx(D,{path:"/:forecastId/*",element:l.jsx(Se,{})})]})}const Uo=e=>{let a,t;switch(e.balanceTimeFrame){case"month":case"quarter":a=e.balanceTimeFrame,t=Ue(e);break;case"year":a="quarter",t={startDate:e.endDate.startOf("quarter"),endDate:e.endDate};break;case"free_range":console.error("free_range timeframe is not supported!")}return{timeframe:a,timePeriod:t}},Yo=H(function(e){const a=Zt(e),t=pn(e),n=hn(e),o=fn(e),r=ct(e),{scrollPosition:s,...i}=r,u=t.reportTitle,f=j.getSignedInUser(),g=e.tenantState.currentTenantId,b=L(e),p=b?.companyName??"",c={userId:f?.userId??"",sessionId:f?.zeniSessionId??"",tenantId:g??""},m=e.entityAutoCompleteState.autoCompleteText.navbar,C=W(e,"navbar"),d=lt(b);return{selectedRangeReport:a,selectedClassesViewRangeReport:n,reportLabels:{reportTitle:u},highlightedRangeReport:t,highlightedClassesViewRangeReport:o,uiState:i,scrollPosition:s,downloadParams:{downloadState:a.downloadState,currentTenantCompanyName:p,statementEndPoint:`${J}/statement`,authParams:c},analytics:A,isZeniUser:ye(f),autoCompleteData:{autoCompleteText:m,entityAutoCompleteView:C},isZeniCOAUsed:d,isAccountingClassesEnabled:me(e)}},function(e,a){return{updateDownloadStateHandler:t=>{e(Cn(t))},onTimeframeSelectionChanged:t=>{e(ue(t)),setTimeout(()=>e(oe({resetLeftScroll:!0})),50)},onCOABalancesRangeChanged:(t,n)=>{e(Ae(t,n)),e(oe({resetLeftScroll:!0}))},onThisPeriodChanged:t=>{e(te(a.firstMonthOfFY,t)),e(oe({resetLeftScroll:!0}))},onAdditionalBalanceSelectionChanged:(t,n,o)=>{e(ve(a.firstMonthOfFY,t,o,n)),n.length>0&&(e(Ie(a.firstMonthOfFY,n.includes("this_period_vs_last_period")?"compare_mode_amount":"compare_mode_percent",o,n)),a.forecastIdFromUrlPath!=null&&t==1&&N(!1,a.forecastIdFromUrlPath,"",a.navigate)),a.isCompareModeOn!==t&&setTimeout(()=>e(oe({resetLeftScroll:!0})),50)},onAccountBalanceClick:(t,n)=>{const{timePeriod:o,timeframe:r}=Uo(n);if(o!=null&&r!=null){const s=t.accountName===""?t.accountDescription:t.accountName,i=t.classesViewParentId!=null&&t.classesViewParentId.parentClassId!=null?bt(a.tenantEmailDomain,t.accountId,t.accountType,t.classesViewParentId.parentClassId?.[0],s,r,o):pe(a.tenantEmailDomain,t.accountId,t.accountType,s,r,o),u=O(a.location.state?.pathnameStackToGoBack,a.location.pathname);a.navigate(i,{state:{pathnameStackToGoBack:u,referrer:"Burn Rate"}})}},onElementCollapseStateChanged:(t,n)=>{e(oe({nodeCollapseState:{nodeId:t,isCollapsed:n}}))},onTableScroll:t=>{e(oe({scrollPosition:t}))},autoCompleteActions:{onAutoCompleteInputChange:t=>{t.trim().length>=2?e(ee({searchString:t,searchOrigin:"navbar"})):t.trim().length===0&&e(Z("navbar"))},onAutoCompleteEntity:t=>{const n=ae(t,a.tenantEmailDomain),o=O(a.location.state?.pathnameStackToGoBack,a.location.pathname);a.navigate(n,{state:{pathnameStackToGoBack:o}})}},onBackClick:()=>{a.selectedForecastId!=null?a.navigate("../../../"):a.navigate("../")},onForecastToggle:(t,n)=>{e(ce(a.firstMonthOfFY,t==="forecast_mode",t==="forecast_mode"?le:Ct,n)),t==="forecast_mode"?(e(Dt({viewMode:"account_group"})),e(Ht(!1,n?.id)),n!=null&&N(!0,a.forecastIdFromUrlPath,n?.id??"",a.navigate)):N(!1,a.forecastIdFromUrlPath,n?.id??"",a.navigate),e(oe({resetLeftScroll:!0}))},onUpdateAccountViewMode:t=>{a.analytics?.trackGroupBySwitch(t==="classes"?"Classes":"Accounts","Burn Rate"),e(Dt({viewMode:t}))},onUpdateClassesToFilterOut:t=>{e(bn({classesToFilterOut:t}))},onOpenAccountViewMode:()=>{a.isAccountingClassesEnabled&&e(gn())},onResyncReports:()=>{e(dt("net_burn_or_income_by_classes"))}}})(xe),Vo=e=>{const a=G(),{tenantEmailDomain:t,location:n,navigate:o,forecastIdFromUrlPath:r}=e,s=Oe({mobileExploreReferrer:"DashboardNetBurnOrIncome"}),i=k(h=>ct(h)),u=i.isForecastModeOn,f=i.timeframe,g=i.selectedForecast?.id,b=k(h=>ut(h.forecastState,g??"")),p=k(h=>Zt(h)),c=k(h=>mt(h)),m=k(h=>me(h)),C=i.mode==="compare_mode",d=p.dataAvailable;return _.useEffect(()=>{if(g!=null&&u===!0&&(N(u,r,g,o),b!=null)){const h=b?.forecastPeriod,S=d!=null&&h.endDate.isAfter(d?.endDate)===!0?d:h;a(te(e.firstMonthOfFY,{startDate:S.endDate.startOf(f),endDate:S?.endDate}))}},[g]),l.jsx(Yo,{firstMonthOfFY:e.firstMonthOfFY,tenantEmailDomain:t,selectedForecastId:r,forecastIdFromUrlPath:r,location:n,isAccountingClassesEnabled:m,isCompareModeOn:C,navigate:o,analytics:A,reportsResyncFetchState:c.reportsResyncFetchState,insightsSectionAiCfoInfo:s})},No=e=>{let a,t;switch(e.balanceTimeFrame){case"month":case"quarter":a=e.balanceTimeFrame,t=Ue(e);break;case"year":a="quarter",t={startDate:e.endDate.startOf("quarter"),endDate:e.endDate};break;case"free_range":console.error("free_range timeframe is not supported!")}return{timeframe:a,timePeriod:t}},Go=H(function(e){const a=Jt(e),t=_n(e),n=kn(e),o=Sn(e),r=pt(e),{scrollPosition:s,...i}=r,u=$.getLocalizedStrings().reportTitleById.operating_expenses,f=j.getSignedInUser(),g=e.tenantState.currentTenantId,b=L(e),p=b?.companyName??"",c={userId:f?.userId??"",sessionId:f?.zeniSessionId??"",tenantId:g??""},m=e.entityAutoCompleteState.autoCompleteText.navbar,C=W(e,"navbar"),d=lt(b);return{selectedRangeReport:a,selectedClassesViewRangeReport:n,reportLabels:{reportTitle:u},highlightedRangeReport:t,highlightedClassesViewRangeReport:o,uiState:i,scrollPosition:s,downloadParams:{downloadState:a.downloadState,currentTenantCompanyName:p,statementEndPoint:`${J}/statement`,authParams:c},analytics:A,isZeniUser:ye(f),autoCompleteData:{autoCompleteText:m,entityAutoCompleteView:C},isZeniCOAUsed:d,isAccountingClassesEnabled:me(e)}},function(e,a){return{updateDownloadStateHandler:t=>{e(In(t))},onTimeframeSelectionChanged:t=>{e(ue(t)),setTimeout(()=>e(se({resetLeftScroll:!0})),50)},onCOABalancesRangeChanged:(t,n)=>{e(Ae(t,n)),e(se({resetLeftScroll:!0}))},onThisPeriodChanged:t=>{e(te(a.firstMonthOfFY,t)),e(se({resetLeftScroll:!0}))},onAdditionalBalanceSelectionChanged:(t,n,o)=>{e(ve(a.firstMonthOfFY,t,o,n)),n.length>0&&(e(Ie(a.firstMonthOfFY,n.includes("this_period_vs_last_period")?"compare_mode_amount":"compare_mode_percent",o,n)),a.forecastIdFromUrlPath!=null&&t==1&&N(!1,a.forecastIdFromUrlPath,"",a.navigate)),a.isCompareModeOn!==t&&setTimeout(()=>e(se({resetLeftScroll:!0})),50)},onAccountBalanceClick:a.hasTransactionAccess!==!0?void 0:(t,n)=>{const{timePeriod:o,timeframe:r}=No(n);if(o!=null&&r!=null){const s=t.accountName===""?t.accountDescription:t.accountName,i=t.classesViewParentId!=null&&t.classesViewParentId.parentClassId!=null?bt(a.tenantEmailDomain,t.accountId,t.accountType,t.classesViewParentId.parentClassId?.[0],s,r,o):pe(a.tenantEmailDomain,t.accountId,t.accountType,s,r,o),u=O(a.location.state?.pathnameStackToGoBack,a.location.pathname);a.navigate(i,{state:{pathnameStackToGoBack:u,referrer:"Operating Expenses"}})}},onElementCollapseStateChanged:(t,n)=>{e(se({nodeCollapseState:{nodeId:t,isCollapsed:n}}))},onTableScroll:t=>{e(se({scrollPosition:t}))},autoCompleteActions:{onAutoCompleteInputChange:t=>{t.trim().length>=2?e(ee({searchString:t,searchOrigin:"navbar"})):t.trim().length===0&&e(Z("navbar"))},onAutoCompleteEntity:t=>{const n=ae(t,a.tenantEmailDomain),o=O(a.location.state?.pathnameStackToGoBack,a.location.pathname);a.navigate(n,{state:{pathnameStackToGoBack:o}})}},onBackClick:()=>{a.selectedForecastId!=null?a.navigate("../../../"):a.navigate("../")},onForecastToggle:(t,n)=>{e(ce(a.firstMonthOfFY,t==="forecast_mode",t==="forecast_mode"?le:Ct,n)),t=="forecast_mode"?(e(Ot({viewMode:"account_group"})),e(Qt(!1,n?.id)),n!=null&&N(!0,a.forecastIdFromUrlPath,n?.id??"",a.navigate)):N(!1,a.forecastIdFromUrlPath,n?.id??"",a.navigate),e(se({resetLeftScroll:!0}))},onUpdateAccountViewMode:t=>{a.analytics?.trackGroupBySwitch(t==="classes"?"Classes":"Accounts","Operating Expenses"),e(Ot({viewMode:t}))},onUpdateClassesToFilterOut:t=>{e(vn({classesToFilterOut:t}))},onOpenAccountViewMode:()=>{a.isAccountingClassesEnabled&&e(yn())},onResyncReports:()=>{e(dt("operating_expenses_by_classes"))}}})(xe),Ko=e=>{const a=G(),{tenantEmailDomain:t,location:n,navigate:o,forecastIdFromUrlPath:r}=e,s=Oe({mobileExploreReferrer:"DashboardOpEx"}),i=k(y=>pt(y)),u=i.isForecastModeOn,f=i.timeframe,g=i.selectedForecast?.id,b=k(y=>ut(y.forecastState,g??"")),p=k(y=>Jt(y)),c=k(y=>mt(y)),m=k(y=>me(y)),C=i.mode==="compare_mode",d=p.dataAvailable;_.useEffect(()=>{if(g!=null&&u===!0&&(N(u,r,g,o),b!=null)){const y=b?.forecastPeriod,F=d!=null&&y.endDate.isAfter(d?.endDate)===!0?d:y;a(te(e.firstMonthOfFY,{startDate:F.endDate.startOf(f),endDate:F?.endDate}))}},[g]);const h=we(),S=h?.loggedInUserRole!=null&&Xt(h?.loggedInUserRole)!==!0;return l.jsx(Go,{firstMonthOfFY:e.firstMonthOfFY,tenantEmailDomain:t,selectedForecastId:r,location:n,isAccountingClassesEnabled:m,isCompareModeOn:C,navigate:o,forecastIdFromUrlPath:r,analytics:A,hasTransactionAccess:S,reportsResyncFetchState:c.reportsResyncFetchState,insightsSectionAiCfoInfo:s})},$o=e=>{let a,t;switch(e.balanceTimeFrame){case"month":case"quarter":a=e.balanceTimeFrame,t=Ue(e);break;case"year":a="quarter",t={startDate:e.endDate.startOf("quarter"),endDate:e.endDate};break;case"free_range":console.error("free_range timeframe is not supported!")}return{timeframe:a,timePeriod:t}},zo=H(function(e){const a=Wt(e),t=An(e),n=En(e),o=Tn(e),r=ht(e),{scrollPosition:s,...i}=r,u=$.getLocalizedStrings().reportTitleById.revenue,f=j.getSignedInUser(),g=e.tenantState.currentTenantId,b=L(e),p=b?.companyName??"",c={userId:f?.userId??"",sessionId:f?.zeniSessionId??"",tenantId:g??""},m=e.entityAutoCompleteState.autoCompleteText.navbar,C=W(e,"navbar"),d=lt(b);return{selectedRangeReport:a,selectedClassesViewRangeReport:n,reportLabels:{reportTitle:u},highlightedRangeReport:t,highlightedClassesViewRangeReport:o,uiState:i,scrollPosition:s,downloadParams:{downloadState:a.downloadState,currentTenantCompanyName:p,statementEndPoint:`${J}/statement`,authParams:c},analytics:A,isZeniUser:ye(f),autoCompleteData:{autoCompleteText:m,entityAutoCompleteView:C},isZeniCOAUsed:d,isAccountingClassesEnabled:me(e)}},function(e,a){return{updateDownloadStateHandler:t=>{e(Dn(t))},onTimeframeSelectionChanged:t=>{e(ue(t)),setTimeout(()=>e(re({resetLeftScroll:!0})),50)},onCOABalancesRangeChanged:(t,n)=>{e(Ae(t,n)),e(re({resetLeftScroll:!0}))},onThisPeriodChanged:t=>{e(te(a.firstMonthOfFY,t)),e(re({resetLeftScroll:!0}))},onAdditionalBalanceSelectionChanged:(t,n,o)=>{e(ve(a.firstMonthOfFY,t,o,n)),n.length>0&&(e(Ie(a.firstMonthOfFY,n.includes("this_period_vs_last_period")?"compare_mode_amount":"compare_mode_percent",o,n)),a.forecastIdFromUrlPath!=null&&t==1&&N(!1,a.forecastIdFromUrlPath,"",a.navigate)),a.isCompareModeOn!==t&&setTimeout(()=>e(re({resetLeftScroll:!0})),50)},onAccountBalanceClick:(t,n)=>{const{timePeriod:o,timeframe:r}=$o(n);if(o!=null&&r!=null){const s=t.accountName===""?t.accountDescription:t.accountName,i=t.classesViewParentId!=null&&t.classesViewParentId.parentClassId!=null?bt(a.tenantEmailDomain,t.accountId,t.accountType,t.classesViewParentId.parentClassId?.[0],s,r,o):pe(a.tenantEmailDomain,t.accountId,t.accountType,s,r,o),u=O(a.location.state?.pathnameStackToGoBack,a.location.pathname);a.navigate(i,{state:{pathnameStackToGoBack:u,referrer:"Revenues"}})}},onElementCollapseStateChanged:(t,n)=>{e(re({nodeCollapseState:{nodeId:t,isCollapsed:n}}))},onTableScroll:t=>{e(re({scrollPosition:t}))},autoCompleteActions:{onAutoCompleteInputChange:t=>{t.trim().length>=2?e(ee({searchString:t,searchOrigin:"navbar"})):t.trim().length===0&&e(Z("navbar"))},onAutoCompleteEntity:t=>{const n=ae(t,a.tenantEmailDomain),o=O(a.location.state?.pathnameStackToGoBack,a.location.pathname);a.navigate(n,{state:{pathnameStackToGoBack:o}})}},onBackClick:()=>{a.selectedForecastId!=null?a.navigate("../../../"):a.navigate("../")},onForecastToggle:(t,n)=>{e(ce(a.firstMonthOfFY,t==="forecast_mode",t==="forecast_mode"?le:Ct,n)),t==="forecast_mode"?(e(Ft({viewMode:"account_group"})),e(ea(!1,n?.id)),n!=null&&N(!0,a.forecastIdFromUrlPath,n?.id??"",a.navigate)):N(!1,a.forecastIdFromUrlPath,n?.id??"",a.navigate),e(re({resetLeftScroll:!0}))},onUpdateAccountViewMode:t=>{a.analytics?.trackGroupBySwitch(t==="classes"?"Classes":"Accounts","Revenues"),e(Ft({viewMode:t}))},onUpdateClassesToFilterOut:t=>{e(xn({classesToFilterOut:t}))},onOpenAccountViewMode:()=>{a.isAccountingClassesEnabled&&e(wn())},onResyncReports:()=>{e(dt("revenue_by_classes"))}}})(xe),qo=e=>{const a=G(),{tenantEmailDomain:t,location:n,navigate:o,forecastIdFromUrlPath:r}=e,s=Oe({mobileExploreReferrer:"DashboardRevenue"}),i=k(d=>ht(d)),u=i.isForecastModeOn,f=i.timeframe,g=i.selectedForecast?.id,b=k(d=>ut(d.forecastState,g??"")),p=k(d=>Wt(d)).dataAvailable,c=i.mode==="compare_mode",m=k(d=>me(d)),C=k(d=>mt(d));return _.useEffect(()=>{if(g!=null&&u===!0&&(N(u,r,g,o),b!=null)){const d=b?.forecastPeriod,h=p!=null&&d.endDate.isAfter(p?.endDate)===!0?p:d;a(te(e.firstMonthOfFY,{startDate:h.endDate.startOf(f),endDate:h?.endDate}))}},[g]),l.jsx(zo,{firstMonthOfFY:e.firstMonthOfFY,tenantEmailDomain:t,selectedForecastId:r,isAccountingClassesEnabled:m,isCompareModeOn:c,location:n,navigate:o,forecastIdFromUrlPath:r,analytics:A,reportsResyncFetchState:C.reportsResyncFetchState,insightsSectionAiCfoInfo:s})},Zo=e=>{let a,t;if(e.endDate!=null)switch(e.timePeriod){case"this_month_to_date":case"last_month":case"this_week_to_date":case"last_week":a="month",t={startDate:e.endDate.startOf("month"),endDate:e.endDate};break;case"last_3_months":case"last_6_months":case"last_12_months":case"this_year_to_date":case"last_year":a="quarter",t={startDate:e.endDate.startOf("quarter"),endDate:e.endDate};break;default:console.error(`this timeperiod ${e.timePeriod} is not supported!`)}return{timeframe:a,timePeriod:t}},Ho=H(function(e){const a=On(e),t=e.entityAutoCompleteState.autoCompleteText.navbar,n=W(e,"navbar");return{report:a,analytics:A,autoCompleteData:{autoCompleteText:t,entityAutoCompleteView:n}}},function(e,a){return{onTimeframeSelectionChanged:t=>{A.trackTimeframeSwitch(ha(t),"Top Expenses"),e(ta(t))},onAccountBalanceClick:(t,n)=>{const{timePeriod:o,timeframe:r}=Zo(n),s=t.accountName===""?t.accountDescription:t.accountName;if(o!=null&&r!=null){const i=pe(a.tenantEmailDomain,t.accountId,t.accountType,s,r,o),u=O(a.location.state?.pathnameStackToGoBack,a.location.pathname);a.navigate(i,{state:{pathnameStackToGoBack:u,referrer:"Top Expenses"}})}},autoCompleteActions:{onAutoCompleteInputChange:t=>{t.trim().length>=2?e(ee({searchString:t,searchOrigin:"navbar"})):t.trim().length===0&&e(Z("navbar"))},onAutoCompleteEntity:t=>{const n=ae(t,a.tenantEmailDomain),o=O(a.location.state?.pathnameStackToGoBack,a.location.pathname);a.navigate(n,{state:{pathnameStackToGoBack:o}})}},onBackClick:()=>{a.navigate("../")}}})(uo),Jo=e=>{const{tenantEmailDomain:a,location:t,navigate:n}=e;return l.jsx(Ho,{tenantEmailDomain:a,location:t,navigate:n})},Qo=gt.div`
13
+ `;function Oo({title:e,reportId:a,entityAutoCompleteView:t,autoCompleteText:n,isAiCfoAccessEnabled:o,onAskAiCfoClick:r}){const s=q(),i=N(),u=z(),{tenantEmailDomain:f}=K(),g=to();return l.jsxs(xo,{children:[l.jsx(ao,{source:a==="cash_balance"?"CashBalanceDetailScreen":"CardBalanceDetailScreen",title:e,onBackClick:()=>{s("../")},hideSearchBtn:!0,backgroundColor:g.colors.grey4,searchAutoComplete:{autoCompleteData:{entityAutoCompleteView:t,autoCompleteText:n},autoCompleteActions:{onAutoCompleteInputChange:b=>{b.trim().length>=2?i(ee({searchString:b,searchOrigin:"navbar"})):b.trim().length===0&&i(Z("navbar"))},onAutoCompleteEntity:b=>{n!=null&&A?.trackSearch(V.Event.search,Fo(a),b.type,b.name,n);const p=ae(b,f),c=O(u.state?.pathnameStackToGoBack,u.pathname);s(p,{state:{pathnameStackToGoBack:c}})}}},rightSideComponent:o===!0&&r!=null?l.jsx(no,{onClick:r}):null}),l.jsx(Do,{children:a==="cash_balance"?l.jsx(To,{}):l.jsx(wo,{})})]})}function Pt(){const{isAiCfoOpen:e,setIsAiCfoOpen:a}=Ee(),t=z(),n=N(),{useFeatureGate:o}=Ye(),{isFeatureEnabled:r}=o(M.isDepositAccountsFeatureEnabled),s=k(h=>h.cashBalanceState.fetchState),i=k(h=>h.cardBalanceState.fetchState),u=j.getSignedInUser();if(u==null)throw Error("Can't access dashboard detail without signing in...");const f=Vt((h=>{const S=Gt(h,"/").split("/");return S[S.length-1]})(t.pathname));let g="Not-Started",b="";const p=$.getLocalizedStrings();switch(f){case"cash_balance":g=s,b=p.reportTitleById.cash_balance;break;case"card_balance":g=i,b=p.reportTitleById.card_balance;break;default:console.error(`${f} is not supported!`)}const{isAiCfoAccessEnabled:c,onAskAiCfoClick:m}=Ve({isAiCfoOpen:e,setIsAiCfoOpen:a,mobileExploreReferrer:f==="card_balance"?"Card Balance":"Cash Balance"});De({isDataReady:g==="Completed"});const C=k(h=>h.entityAutoCompleteState.autoCompleteText.navbar),d=k(h=>W(h,"navbar"));return _.useEffect(()=>{g==="Not-Started"&&function(h,S,y){switch(S){case"card_balance":h($t());break;case"cash_balance":h(Nt()),y===!0&&h(Kt());break;default:throw new Error(`balance report type ${S} is not yet supported`)}}(n,f,r)},[u,n,g]),l.jsxs(l.Fragment,{children:[g==="Completed"?l.jsx(Te,{analytics:A,onLoad:h=>((S,y)=>{switch(y){case"card_balance":S.trackPageLoaded(V.Event.cardBalance);break;case"cash_balance":S.trackPageLoaded(V.Event.cashBalance);break;default:console.error(`Analytics: Not tracking Page Loaded for ${y}!`)}})(h,f)}):null,l.jsx(Oo,{title:b,reportId:f,autoCompleteText:C,entityAutoCompleteView:d,isAiCfoAccessEnabled:c,onAskAiCfoClick:m})]})}const Fo=e=>{switch(e){case"cash_balance":return"Cash Balance";case"card_balance":return"Card Balance";default:return"Dashboard"}},Po=[];function Oe(e){const{mobileExploreReferrer:a}=e,t=N(),n=q(),o=z(),{tenantEmailDomain:r}=K(),{setIsAiCfoOpen:s,setAiCfoSidePanelQuestionToSubmit:i}=Ee(),u=oo(),f=lo(u),g=$a(),b=k(B=>on(B)),p=b.uiState?.currentChatSessionId,c=b.allSessionsWithOrderedQuestionAnswers??Po,m=j.getSignedInUser()?.userId,C=da(),d=bo()&&C&&r!=null,h=so(),S=ro(h),{useDynamicConfig:y}=Ye(),{configValue:F}=y(ua.aiCfoMessageDynamicConfig),E=_.useMemo(()=>Array.isArray(F.default_message_list)?F.default_message_list:[],[F.default_message_list]),v=_.useMemo(()=>(S!=null&&S.length>0?S:E).slice(0,2),[E,S]),w=_.useCallback((B,he)=>{if(m==null||B.trim()==="")return;const fe=io(g.getState());if(f){const Fe=O(o.state?.pathnameStackToGoBack,o.pathname);n(`/${r}/ai-cfo/explore`,{state:{message:"",origin:"",pathnameStackToGoBack:Fe,referrer:a,aiCfoInitialQuestion:B,aiCfoShouldSubmit:!fe}})}else{if(fe)return t(sn(B)),void s(!0);i(B),s(!0),co(t,B,"insights_section",p,c,m,he,void 0)}},[c,p,t,f,o.pathname,o.state,a,n,s,i,g,r,m]),T=_.useCallback(()=>{if(f){const B=O(o.state?.pathnameStackToGoBack,o.pathname);n(`/${r}/ai-cfo/explore`,{state:{message:"",origin:"",pathnameStackToGoBack:B,referrer:a}})}else s(!0)},[f,o.pathname,o.state,a,n,s,r]);return _.useMemo(()=>{if(d)return{onAskSomethingElseClick:T,onSuggestedQuestionClick:w,suggestedQuestions:v}},[d,T,w,v])}const Bo=H(function(e){const a=rn(e),t=cn(e),n=zt(e),{scrollPosition:o,...r}=n,s=$.getLocalizedStrings().reportTitleById.cash_in_cash_out,i=j.getSignedInUser(),u=e.tenantState.currentTenantId,f=L(e),g=f?.companyName??"",b={userId:i?.userId??"",sessionId:i?.zeniSessionId??"",tenantId:u??""},p=e.entityAutoCompleteState.autoCompleteText.navbar,c=W(e,"navbar");return{selectedRangeReport:a,reportLabels:{reportTitle:s},highlightedRangeReport:t,uiState:r,scrollPosition:o,downloadParams:{downloadState:a.downloadState,currentTenantCompanyName:g,statementEndPoint:`${J}/statement`,authParams:b},analytics:A,autoCompleteData:{autoCompleteText:p,entityAutoCompleteView:c}}},function(e,a){return{updateDownloadStateHandler:t=>{e(ln(t))},onTimeframeSelectionChanged:()=>{},onCOABalancesRangeChanged:(t,n)=>{e(Ae(t,n)),e(ge({resetLeftScroll:!0}))},onThisPeriodChanged:t=>{e(ue("month")),e(te(a.firstMonthOfFY,t)),e(ge({resetLeftScroll:!0}))},onAdditionalBalanceSelectionChanged:(t,n,o)=>{e(ve(a.firstMonthOfFY,t,o,n)),n.length>0&&e(Ie(a.firstMonthOfFY,n.includes("this_period_vs_last_period")?"compare_mode_amount":"compare_mode_percent",o,n)),a.isCompareModeOn!==t&&setTimeout(()=>e(ge({resetLeftScroll:!0})),50)},onElementCollapseStateChanged:(t,n)=>{e(ge({nodeCollapseState:{nodeId:t,isCollapsed:n}}))},onTableScroll:t=>{e(ge({scrollPosition:t}))},autoCompleteActions:{onAutoCompleteInputChange:t=>{t.trim().length>=2?e(ee({searchString:t,searchOrigin:"navbar"})):t.trim().length===0&&e(Z("navbar"))},onAutoCompleteEntity:t=>{const n=ae(t,a.tenantEmailDomain),o=O(a.location.state?.pathnameStackToGoBack,a.location.pathname);a.navigate(n,{state:{pathnameStackToGoBack:o}})}},onBackClick:()=>{a.navigate("../")}}})(xe),Ro=e=>{const{tenantEmailDomain:a,location:t,navigate:n}=e,o=Oe({mobileExploreReferrer:"DashboardCashInCashOut"}),r=k(s=>zt(s)).mode==="compare_mode";return l.jsx(Bo,{firstMonthOfFY:e.firstMonthOfFY,tenantEmailDomain:a,location:t,isCompareModeOn:r,navigate:n,insightsSectionAiCfoInfo:o})},jo=e=>{let a,t;switch(e.balanceTimeFrame){case"month":case"quarter":a=e.balanceTimeFrame,t=Ue(e);break;case"year":a="quarter",t={startDate:e.endDate.startOf("quarter"),endDate:e.endDate};break;case"free_range":console.error("free_range timeframe is not supported!")}return{timeframe:a,timePeriod:t}},Lo=H(function(e){const a=dn(e),t=un(e),n=qt(e),{scrollPosition:o,...r}=n,s=$.getLocalizedStrings().reportTitleById.cash_position,i=j.getSignedInUser(),u=e.tenantState.currentTenantId,f=L(e),g=f?.companyName??"",b={userId:i?.userId??"",sessionId:i?.zeniSessionId??"",tenantId:u??""},p=e.entityAutoCompleteState.autoCompleteText.navbar,c=W(e,"navbar");return{selectedRangeReport:a,reportLabels:{reportTitle:s},highlightedRangeReport:t,uiState:r,scrollPosition:o,downloadParams:{downloadState:a.downloadState,currentTenantCompanyName:g,statementEndPoint:`${J}/statement`,authParams:b},analytics:A,autoCompleteData:{autoCompleteText:p,entityAutoCompleteView:c}}},function(e,a){return{updateDownloadStateHandler:t=>{e(mn(t))},onTimeframeSelectionChanged:t=>{e(ue(t)),setTimeout(()=>e(be({resetLeftScroll:!0})),50)},onCOABalancesRangeChanged:(t,n)=>{e(Ae(t,n)),e(be({resetLeftScroll:!0}))},onThisPeriodChanged:t=>{e(te(a.firstMonthOfFY,t)),e(be({resetLeftScroll:!0}))},onAdditionalBalanceSelectionChanged:(t,n,o)=>{e(ve(a.firstMonthOfFY,t,o,n)),n.length>0&&e(Ie(a.firstMonthOfFY,n.includes("this_period_vs_last_period")?"compare_mode_amount":"compare_mode_percent",o,n)),a.isCompareModeOn!==t&&setTimeout(()=>e(be({resetLeftScroll:!0})),50)},onAccountBalanceClick:(t,n)=>{const{timePeriod:o,timeframe:r}=jo(n),s=t.accountName===""?t.accountDescription:t.accountName;if(o!=null&&r!=null){const i=pe(a.tenantEmailDomain,t.accountId,t.accountType,s,r,o),u=O(a.location.state?.pathnameStackToGoBack,a.location.pathname);a.navigate(i,{state:{pathnameStackToGoBack:u,referrer:"Cash Position"}})}},autoCompleteActions:{onAutoCompleteInputChange:t=>{t.trim().length>=2?e(ee({searchString:t,searchOrigin:"navbar"})):t.trim().length===0&&e(Z("navbar"))},onAutoCompleteEntity:t=>{const n=ae(t,a.tenantEmailDomain),o=O(a.location.state?.pathnameStackToGoBack,a.location.pathname);a.navigate(n,{state:{pathnameStackToGoBack:o}})}},onTableScroll:t=>{e(be({scrollPosition:t}))},onBackClick:()=>{a.navigate("../")}}})(xe),Mo=e=>{const{tenantEmailDomain:a,location:t,navigate:n}=e,o=Oe({mobileExploreReferrer:"DashboardCashPosition"}),r=k(s=>qt(s)).mode==="compare_mode";return l.jsx(Lo,{firstMonthOfFY:e.firstMonthOfFY,tenantEmailDomain:a,location:t,isCompareModeOn:r,navigate:n,insightsSectionAiCfoInfo:o})},G=(e,a,t,n)=>{e===!1?a!=null&&n("../../",{relative:"path"}):a!=t&&(a!=null&&a.length>0?n(`../${t}`,{replace:!0}):n(`./forecast/${t}`,{replace:!0}))};function Qe(){return l.jsxs(nt,{children:[l.jsx(D,{path:"/",element:l.jsx(Q,{})}),l.jsx(D,{path:"/:forecastId",element:l.jsx(Q,{})}),l.jsx(D,{path:"/:forecastId/*",element:l.jsx(Se,{})})]})}const Uo=e=>{let a,t;switch(e.balanceTimeFrame){case"month":case"quarter":a=e.balanceTimeFrame,t=Ue(e);break;case"year":a="quarter",t={startDate:e.endDate.startOf("quarter"),endDate:e.endDate};break;case"free_range":console.error("free_range timeframe is not supported!")}return{timeframe:a,timePeriod:t}},Yo=H(function(e){const a=Zt(e),t=pn(e),n=hn(e),o=fn(e),r=ct(e),{scrollPosition:s,...i}=r,u=t.reportTitle,f=j.getSignedInUser(),g=e.tenantState.currentTenantId,b=L(e),p=b?.companyName??"",c={userId:f?.userId??"",sessionId:f?.zeniSessionId??"",tenantId:g??""},m=e.entityAutoCompleteState.autoCompleteText.navbar,C=W(e,"navbar"),d=lt(b);return{selectedRangeReport:a,selectedClassesViewRangeReport:n,reportLabels:{reportTitle:u},highlightedRangeReport:t,highlightedClassesViewRangeReport:o,uiState:i,scrollPosition:s,downloadParams:{downloadState:a.downloadState,currentTenantCompanyName:p,statementEndPoint:`${J}/statement`,authParams:c},analytics:A,isZeniUser:ye(f),autoCompleteData:{autoCompleteText:m,entityAutoCompleteView:C},isZeniCOAUsed:d,isAccountingClassesEnabled:me(e)}},function(e,a){return{updateDownloadStateHandler:t=>{e(Cn(t))},onTimeframeSelectionChanged:t=>{e(ue(t)),setTimeout(()=>e(oe({resetLeftScroll:!0})),50)},onCOABalancesRangeChanged:(t,n)=>{e(Ae(t,n)),e(oe({resetLeftScroll:!0}))},onThisPeriodChanged:t=>{e(te(a.firstMonthOfFY,t)),e(oe({resetLeftScroll:!0}))},onAdditionalBalanceSelectionChanged:(t,n,o)=>{e(ve(a.firstMonthOfFY,t,o,n)),n.length>0&&(e(Ie(a.firstMonthOfFY,n.includes("this_period_vs_last_period")?"compare_mode_amount":"compare_mode_percent",o,n)),a.forecastIdFromUrlPath!=null&&t==1&&G(!1,a.forecastIdFromUrlPath,"",a.navigate)),a.isCompareModeOn!==t&&setTimeout(()=>e(oe({resetLeftScroll:!0})),50)},onAccountBalanceClick:(t,n)=>{const{timePeriod:o,timeframe:r}=Uo(n);if(o!=null&&r!=null){const s=t.accountName===""?t.accountDescription:t.accountName,i=t.classesViewParentId!=null&&t.classesViewParentId.parentClassId!=null?bt(a.tenantEmailDomain,t.accountId,t.accountType,t.classesViewParentId.parentClassId?.[0],s,r,o):pe(a.tenantEmailDomain,t.accountId,t.accountType,s,r,o),u=O(a.location.state?.pathnameStackToGoBack,a.location.pathname);a.navigate(i,{state:{pathnameStackToGoBack:u,referrer:"Burn Rate"}})}},onElementCollapseStateChanged:(t,n)=>{e(oe({nodeCollapseState:{nodeId:t,isCollapsed:n}}))},onTableScroll:t=>{e(oe({scrollPosition:t}))},autoCompleteActions:{onAutoCompleteInputChange:t=>{t.trim().length>=2?e(ee({searchString:t,searchOrigin:"navbar"})):t.trim().length===0&&e(Z("navbar"))},onAutoCompleteEntity:t=>{const n=ae(t,a.tenantEmailDomain),o=O(a.location.state?.pathnameStackToGoBack,a.location.pathname);a.navigate(n,{state:{pathnameStackToGoBack:o}})}},onBackClick:()=>{a.selectedForecastId!=null?a.navigate("../../../"):a.navigate("../")},onForecastToggle:(t,n)=>{e(ce(a.firstMonthOfFY,t==="forecast_mode",t==="forecast_mode"?le:Ct,n)),t==="forecast_mode"?(e(Dt({viewMode:"account_group"})),e(Ht(!1,n?.id)),n!=null&&G(!0,a.forecastIdFromUrlPath,n?.id??"",a.navigate)):G(!1,a.forecastIdFromUrlPath,n?.id??"",a.navigate),e(oe({resetLeftScroll:!0}))},onUpdateAccountViewMode:t=>{a.analytics?.trackGroupBySwitch(t==="classes"?"Classes":"Accounts","Burn Rate"),e(Dt({viewMode:t}))},onUpdateClassesToFilterOut:t=>{e(bn({classesToFilterOut:t}))},onOpenAccountViewMode:()=>{a.isAccountingClassesEnabled&&e(gn())},onResyncReports:()=>{e(dt("net_burn_or_income_by_classes"))}}})(xe),Vo=e=>{const a=N(),{tenantEmailDomain:t,location:n,navigate:o,forecastIdFromUrlPath:r}=e,s=Oe({mobileExploreReferrer:"DashboardNetBurnOrIncome"}),i=k(h=>ct(h)),u=i.isForecastModeOn,f=i.timeframe,g=i.selectedForecast?.id,b=k(h=>ut(h.forecastState,g??"")),p=k(h=>Zt(h)),c=k(h=>mt(h)),m=k(h=>me(h)),C=i.mode==="compare_mode",d=p.dataAvailable;return _.useEffect(()=>{if(g!=null&&u===!0&&(G(u,r,g,o),b!=null)){const h=b?.forecastPeriod,S=d!=null&&h.endDate.isAfter(d?.endDate)===!0?d:h;a(te(e.firstMonthOfFY,{startDate:S.endDate.startOf(f),endDate:S?.endDate}))}},[g]),l.jsx(Yo,{firstMonthOfFY:e.firstMonthOfFY,tenantEmailDomain:t,selectedForecastId:r,forecastIdFromUrlPath:r,location:n,isAccountingClassesEnabled:m,isCompareModeOn:C,navigate:o,analytics:A,reportsResyncFetchState:c.reportsResyncFetchState,insightsSectionAiCfoInfo:s})},Go=e=>{let a,t;switch(e.balanceTimeFrame){case"month":case"quarter":a=e.balanceTimeFrame,t=Ue(e);break;case"year":a="quarter",t={startDate:e.endDate.startOf("quarter"),endDate:e.endDate};break;case"free_range":console.error("free_range timeframe is not supported!")}return{timeframe:a,timePeriod:t}},No=H(function(e){const a=Jt(e),t=_n(e),n=kn(e),o=Sn(e),r=pt(e),{scrollPosition:s,...i}=r,u=$.getLocalizedStrings().reportTitleById.operating_expenses,f=j.getSignedInUser(),g=e.tenantState.currentTenantId,b=L(e),p=b?.companyName??"",c={userId:f?.userId??"",sessionId:f?.zeniSessionId??"",tenantId:g??""},m=e.entityAutoCompleteState.autoCompleteText.navbar,C=W(e,"navbar"),d=lt(b);return{selectedRangeReport:a,selectedClassesViewRangeReport:n,reportLabels:{reportTitle:u},highlightedRangeReport:t,highlightedClassesViewRangeReport:o,uiState:i,scrollPosition:s,downloadParams:{downloadState:a.downloadState,currentTenantCompanyName:p,statementEndPoint:`${J}/statement`,authParams:c},analytics:A,isZeniUser:ye(f),autoCompleteData:{autoCompleteText:m,entityAutoCompleteView:C},isZeniCOAUsed:d,isAccountingClassesEnabled:me(e)}},function(e,a){return{updateDownloadStateHandler:t=>{e(In(t))},onTimeframeSelectionChanged:t=>{e(ue(t)),setTimeout(()=>e(se({resetLeftScroll:!0})),50)},onCOABalancesRangeChanged:(t,n)=>{e(Ae(t,n)),e(se({resetLeftScroll:!0}))},onThisPeriodChanged:t=>{e(te(a.firstMonthOfFY,t)),e(se({resetLeftScroll:!0}))},onAdditionalBalanceSelectionChanged:(t,n,o)=>{e(ve(a.firstMonthOfFY,t,o,n)),n.length>0&&(e(Ie(a.firstMonthOfFY,n.includes("this_period_vs_last_period")?"compare_mode_amount":"compare_mode_percent",o,n)),a.forecastIdFromUrlPath!=null&&t==1&&G(!1,a.forecastIdFromUrlPath,"",a.navigate)),a.isCompareModeOn!==t&&setTimeout(()=>e(se({resetLeftScroll:!0})),50)},onAccountBalanceClick:a.hasTransactionAccess!==!0?void 0:(t,n)=>{const{timePeriod:o,timeframe:r}=Go(n);if(o!=null&&r!=null){const s=t.accountName===""?t.accountDescription:t.accountName,i=t.classesViewParentId!=null&&t.classesViewParentId.parentClassId!=null?bt(a.tenantEmailDomain,t.accountId,t.accountType,t.classesViewParentId.parentClassId?.[0],s,r,o):pe(a.tenantEmailDomain,t.accountId,t.accountType,s,r,o),u=O(a.location.state?.pathnameStackToGoBack,a.location.pathname);a.navigate(i,{state:{pathnameStackToGoBack:u,referrer:"Operating Expenses"}})}},onElementCollapseStateChanged:(t,n)=>{e(se({nodeCollapseState:{nodeId:t,isCollapsed:n}}))},onTableScroll:t=>{e(se({scrollPosition:t}))},autoCompleteActions:{onAutoCompleteInputChange:t=>{t.trim().length>=2?e(ee({searchString:t,searchOrigin:"navbar"})):t.trim().length===0&&e(Z("navbar"))},onAutoCompleteEntity:t=>{const n=ae(t,a.tenantEmailDomain),o=O(a.location.state?.pathnameStackToGoBack,a.location.pathname);a.navigate(n,{state:{pathnameStackToGoBack:o}})}},onBackClick:()=>{a.selectedForecastId!=null?a.navigate("../../../"):a.navigate("../")},onForecastToggle:(t,n)=>{e(ce(a.firstMonthOfFY,t==="forecast_mode",t==="forecast_mode"?le:Ct,n)),t=="forecast_mode"?(e(Ot({viewMode:"account_group"})),e(Qt(!1,n?.id)),n!=null&&G(!0,a.forecastIdFromUrlPath,n?.id??"",a.navigate)):G(!1,a.forecastIdFromUrlPath,n?.id??"",a.navigate),e(se({resetLeftScroll:!0}))},onUpdateAccountViewMode:t=>{a.analytics?.trackGroupBySwitch(t==="classes"?"Classes":"Accounts","Operating Expenses"),e(Ot({viewMode:t}))},onUpdateClassesToFilterOut:t=>{e(vn({classesToFilterOut:t}))},onOpenAccountViewMode:()=>{a.isAccountingClassesEnabled&&e(yn())},onResyncReports:()=>{e(dt("operating_expenses_by_classes"))}}})(xe),Ko=e=>{const a=N(),{tenantEmailDomain:t,location:n,navigate:o,forecastIdFromUrlPath:r}=e,s=Oe({mobileExploreReferrer:"DashboardOpEx"}),i=k(y=>pt(y)),u=i.isForecastModeOn,f=i.timeframe,g=i.selectedForecast?.id,b=k(y=>ut(y.forecastState,g??"")),p=k(y=>Jt(y)),c=k(y=>mt(y)),m=k(y=>me(y)),C=i.mode==="compare_mode",d=p.dataAvailable;_.useEffect(()=>{if(g!=null&&u===!0&&(G(u,r,g,o),b!=null)){const y=b?.forecastPeriod,F=d!=null&&y.endDate.isAfter(d?.endDate)===!0?d:y;a(te(e.firstMonthOfFY,{startDate:F.endDate.startOf(f),endDate:F?.endDate}))}},[g]);const h=we(),S=h?.loggedInUserRole!=null&&Xt(h?.loggedInUserRole)!==!0;return l.jsx(No,{firstMonthOfFY:e.firstMonthOfFY,tenantEmailDomain:t,selectedForecastId:r,location:n,isAccountingClassesEnabled:m,isCompareModeOn:C,navigate:o,forecastIdFromUrlPath:r,analytics:A,hasTransactionAccess:S,reportsResyncFetchState:c.reportsResyncFetchState,insightsSectionAiCfoInfo:s})},$o=e=>{let a,t;switch(e.balanceTimeFrame){case"month":case"quarter":a=e.balanceTimeFrame,t=Ue(e);break;case"year":a="quarter",t={startDate:e.endDate.startOf("quarter"),endDate:e.endDate};break;case"free_range":console.error("free_range timeframe is not supported!")}return{timeframe:a,timePeriod:t}},zo=H(function(e){const a=Wt(e),t=An(e),n=En(e),o=Tn(e),r=ht(e),{scrollPosition:s,...i}=r,u=$.getLocalizedStrings().reportTitleById.revenue,f=j.getSignedInUser(),g=e.tenantState.currentTenantId,b=L(e),p=b?.companyName??"",c={userId:f?.userId??"",sessionId:f?.zeniSessionId??"",tenantId:g??""},m=e.entityAutoCompleteState.autoCompleteText.navbar,C=W(e,"navbar"),d=lt(b);return{selectedRangeReport:a,selectedClassesViewRangeReport:n,reportLabels:{reportTitle:u},highlightedRangeReport:t,highlightedClassesViewRangeReport:o,uiState:i,scrollPosition:s,downloadParams:{downloadState:a.downloadState,currentTenantCompanyName:p,statementEndPoint:`${J}/statement`,authParams:c},analytics:A,isZeniUser:ye(f),autoCompleteData:{autoCompleteText:m,entityAutoCompleteView:C},isZeniCOAUsed:d,isAccountingClassesEnabled:me(e)}},function(e,a){return{updateDownloadStateHandler:t=>{e(Dn(t))},onTimeframeSelectionChanged:t=>{e(ue(t)),setTimeout(()=>e(re({resetLeftScroll:!0})),50)},onCOABalancesRangeChanged:(t,n)=>{e(Ae(t,n)),e(re({resetLeftScroll:!0}))},onThisPeriodChanged:t=>{e(te(a.firstMonthOfFY,t)),e(re({resetLeftScroll:!0}))},onAdditionalBalanceSelectionChanged:(t,n,o)=>{e(ve(a.firstMonthOfFY,t,o,n)),n.length>0&&(e(Ie(a.firstMonthOfFY,n.includes("this_period_vs_last_period")?"compare_mode_amount":"compare_mode_percent",o,n)),a.forecastIdFromUrlPath!=null&&t==1&&G(!1,a.forecastIdFromUrlPath,"",a.navigate)),a.isCompareModeOn!==t&&setTimeout(()=>e(re({resetLeftScroll:!0})),50)},onAccountBalanceClick:(t,n)=>{const{timePeriod:o,timeframe:r}=$o(n);if(o!=null&&r!=null){const s=t.accountName===""?t.accountDescription:t.accountName,i=t.classesViewParentId!=null&&t.classesViewParentId.parentClassId!=null?bt(a.tenantEmailDomain,t.accountId,t.accountType,t.classesViewParentId.parentClassId?.[0],s,r,o):pe(a.tenantEmailDomain,t.accountId,t.accountType,s,r,o),u=O(a.location.state?.pathnameStackToGoBack,a.location.pathname);a.navigate(i,{state:{pathnameStackToGoBack:u,referrer:"Revenues"}})}},onElementCollapseStateChanged:(t,n)=>{e(re({nodeCollapseState:{nodeId:t,isCollapsed:n}}))},onTableScroll:t=>{e(re({scrollPosition:t}))},autoCompleteActions:{onAutoCompleteInputChange:t=>{t.trim().length>=2?e(ee({searchString:t,searchOrigin:"navbar"})):t.trim().length===0&&e(Z("navbar"))},onAutoCompleteEntity:t=>{const n=ae(t,a.tenantEmailDomain),o=O(a.location.state?.pathnameStackToGoBack,a.location.pathname);a.navigate(n,{state:{pathnameStackToGoBack:o}})}},onBackClick:()=>{a.selectedForecastId!=null?a.navigate("../../../"):a.navigate("../")},onForecastToggle:(t,n)=>{e(ce(a.firstMonthOfFY,t==="forecast_mode",t==="forecast_mode"?le:Ct,n)),t==="forecast_mode"?(e(Ft({viewMode:"account_group"})),e(ea(!1,n?.id)),n!=null&&G(!0,a.forecastIdFromUrlPath,n?.id??"",a.navigate)):G(!1,a.forecastIdFromUrlPath,n?.id??"",a.navigate),e(re({resetLeftScroll:!0}))},onUpdateAccountViewMode:t=>{a.analytics?.trackGroupBySwitch(t==="classes"?"Classes":"Accounts","Revenues"),e(Ft({viewMode:t}))},onUpdateClassesToFilterOut:t=>{e(xn({classesToFilterOut:t}))},onOpenAccountViewMode:()=>{a.isAccountingClassesEnabled&&e(wn())},onResyncReports:()=>{e(dt("revenue_by_classes"))}}})(xe),qo=e=>{const a=N(),{tenantEmailDomain:t,location:n,navigate:o,forecastIdFromUrlPath:r}=e,s=Oe({mobileExploreReferrer:"DashboardRevenue"}),i=k(d=>ht(d)),u=i.isForecastModeOn,f=i.timeframe,g=i.selectedForecast?.id,b=k(d=>ut(d.forecastState,g??"")),p=k(d=>Wt(d)).dataAvailable,c=i.mode==="compare_mode",m=k(d=>me(d)),C=k(d=>mt(d));return _.useEffect(()=>{if(g!=null&&u===!0&&(G(u,r,g,o),b!=null)){const d=b?.forecastPeriod,h=p!=null&&d.endDate.isAfter(p?.endDate)===!0?p:d;a(te(e.firstMonthOfFY,{startDate:h.endDate.startOf(f),endDate:h?.endDate}))}},[g]),l.jsx(zo,{firstMonthOfFY:e.firstMonthOfFY,tenantEmailDomain:t,selectedForecastId:r,isAccountingClassesEnabled:m,isCompareModeOn:c,location:n,navigate:o,forecastIdFromUrlPath:r,analytics:A,reportsResyncFetchState:C.reportsResyncFetchState,insightsSectionAiCfoInfo:s})},Zo=e=>{let a,t;if(e.endDate!=null)switch(e.timePeriod){case"this_month_to_date":case"last_month":case"this_week_to_date":case"last_week":a="month",t={startDate:e.endDate.startOf("month"),endDate:e.endDate};break;case"last_3_months":case"last_6_months":case"last_12_months":case"this_year_to_date":case"last_year":a="quarter",t={startDate:e.endDate.startOf("quarter"),endDate:e.endDate};break;default:console.error(`this timeperiod ${e.timePeriod} is not supported!`)}return{timeframe:a,timePeriod:t}},Ho=H(function(e){const a=On(e),t=e.entityAutoCompleteState.autoCompleteText.navbar,n=W(e,"navbar");return{report:a,analytics:A,autoCompleteData:{autoCompleteText:t,entityAutoCompleteView:n}}},function(e,a){return{onTimeframeSelectionChanged:t=>{A.trackTimeframeSwitch(ha(t),"Top Expenses"),e(ta(t))},onAccountBalanceClick:(t,n)=>{const{timePeriod:o,timeframe:r}=Zo(n),s=t.accountName===""?t.accountDescription:t.accountName;if(o!=null&&r!=null){const i=pe(a.tenantEmailDomain,t.accountId,t.accountType,s,r,o),u=O(a.location.state?.pathnameStackToGoBack,a.location.pathname);a.navigate(i,{state:{pathnameStackToGoBack:u,referrer:"Top Expenses"}})}},autoCompleteActions:{onAutoCompleteInputChange:t=>{t.trim().length>=2?e(ee({searchString:t,searchOrigin:"navbar"})):t.trim().length===0&&e(Z("navbar"))},onAutoCompleteEntity:t=>{const n=ae(t,a.tenantEmailDomain),o=O(a.location.state?.pathnameStackToGoBack,a.location.pathname);a.navigate(n,{state:{pathnameStackToGoBack:o}})}},onBackClick:()=>{a.navigate("../")}}})(uo),Jo=e=>{const{tenantEmailDomain:a,location:t,navigate:n}=e;return l.jsx(Ho,{tenantEmailDomain:a,location:t,navigate:n})},Qo=gt.div`
14
14
  display: flex;
15
15
  flex: 1 1 auto;
16
16
  min-height: 100%;
17
17
  flex-direction: column;
18
18
  background-color: ${e=>e.theme.colors.grey5};
19
19
  align-items: center;
20
- `,le=3,Ct=1;function Xo({fetchState:e,firstMonthOfFY:a,reportId:t,forecastId:n}){const o=q(),r=z(),{tenantEmailDomain:s}=K();let i;De({isDataReady:!0});const u={firstMonthOfFY:a,tenantEmailDomain:s,location:r,navigate:o,forecastIdFromUrlPath:n,fetchState:e};switch(t){case"operating_expenses":i=l.jsx(Ko,{...u});break;case"revenue":i=l.jsx(qo,{...u});break;case"net_burn_or_income":i=l.jsx(Vo,{...u});break;case"cash_position":i=l.jsx(Mo,{...u});break;case"top_expenses":i=l.jsx(Jo,{...u});break;case"cash_in_cash_out":i=l.jsx(Ro,{...u});break;default:console.error(`${t} is not supported!`),i=null}return i!=null?l.jsx(Qo,{children:i}):null}function Q(){const e=z(),a=G(),{forecastId:t}=K();let n="Not-Started";const o=k(c=>pt(c).fetchState),r=k(c=>ht(c).fetchState),s=k(c=>ct(c).fetchState),i=k(c=>c.cashPositionState.fetchState),u=k(c=>c.topExState.fetchState),f=k(c=>c.cashInCashOutState.fetchState);if(j.getSignedInUser()==null)throw Error("Can't access dashboard detail without signing in...");const g=k(c=>L(c)),b=g?.company?.companyInfo?.firstMonthOfFY??1,p=Vt((c=>{const m=Nt(c,"/").split("/");return t!=null?m[m.length-3]:m[m.length-1]})(e.pathname));switch(p){case"operating_expenses":n=o;break;case"revenue":n=r;break;case"net_burn_or_income":n=s;break;case"cash_position":n=i;break;case"top_expenses":n=u;break;case"cash_in_cash_out":n=f;break;default:console.error(`${p} is not supported!`)}return _.useEffect(()=>{n==="Not-Started"&&function(c,m,C,d){switch(m){case"operating_expenses":c(ia(!0)),d!=null&&(c(ce(C,!0,le,{id:d,index:0})),c(Qt(!1,d)));break;case"revenue":c(ra(!0)),d!=null&&(c(ce(C,!0,le,{id:d,index:0})),c(ea(!1,d)));break;case"net_burn_or_income":c(sa(!0)),d!=null&&(c(ce(C,!0,le,{id:d,index:0})),c(Ht(!1,d)));break;case"cash_position":c(oa(!0));break;case"top_expenses":c(na());break;case"cash_in_cash_out":c(aa());break;default:throw new Error(`report type ${m} is not yet supported`)}}(a,p,b,t)},[t]),l.jsxs(l.Fragment,{children:[n==="Completed"?l.jsx(Te,{analytics:A,onLoad:c=>((m,C)=>{const d=e.state?.referrer;switch(C){case"operating_expenses":m.trackPageLoaded(V.Event.operatingExpenses,d);break;case"revenue":m.trackPageLoaded(V.Event.revenues,d);break;case"net_burn_or_income":m.trackPageLoaded(V.Event.burnRate,d);break;case"cash_position":m.trackPageLoaded(V.Event.cashPosition,d);break;case"top_expenses":m.trackPageLoaded(V.Event.topExpenses,d);break;case"cash_in_cash_out":m.trackPageLoaded(V.Event.cashInCashOut,d);break;default:console.error(`Analytics: Not tracking Page Loaded for ${C}!`)}})(c,p)}):null,l.jsx(Xo,{firstMonthOfFY:b,fetchState:n,reportId:p,forecastId:t})]})}var Xe=typeof navigator<"u"&&navigator.userAgent.toLowerCase().indexOf("firefox")>0;function We(e,a,t,n){e.addEventListener?e.addEventListener(a,t,n):e.attachEvent&&e.attachEvent("on".concat(a),function(){t(window.event)})}function ba(e,a){for(var t=a.slice(0,a.length-1),n=0;n<t.length;n++)t[n]=e[t[n].toLowerCase()];return t}function Ca(e){typeof e!="string"&&(e="");for(var a=(e=e.replace(/\s/g,"")).split(","),t=a.lastIndexOf("");t>=0;)a[t-1]+=",",a.splice(t,1),t=a.lastIndexOf("");return a}for(var _t={backspace:8,tab:9,clear:12,enter:13,return:13,esc:27,escape:27,space:32,left:37,up:38,right:39,down:40,del:46,delete:46,ins:45,insert:45,home:36,end:35,pageup:33,pagedown:34,capslock:20,num_0:96,num_1:97,num_2:98,num_3:99,num_4:100,num_5:101,num_6:102,num_7:103,num_8:104,num_9:105,num_multiply:106,num_add:107,num_enter:108,num_subtract:109,num_decimal:110,num_divide:111,"⇪":20,",":188,".":190,"/":191,"`":192,"-":Xe?173:189,"=":Xe?61:187,";":Xe?59:186,"'":222,"[":219,"]":221,"\\":220},X={"⇧":16,shift:16,"⌥":18,alt:18,option:18,"⌃":17,ctrl:17,control:17,"⌘":91,cmd:91,command:91},rt={16:"shiftKey",18:"altKey",17:"ctrlKey",91:"metaKey",shiftKey:16,ctrlKey:17,altKey:18,metaKey:91},R={16:!1,18:!1,17:!1,91:!1},P={},Le=1;Le<20;Le++)_t["f".concat(Le)]=111+Le;var x=[],Bt=!1,_a="all",Rt=[],Ne=function(e){return _t[e.toLowerCase()]||X[e.toLowerCase()]||e.toUpperCase().charCodeAt(0)};function jt(e){_a=e||"all"}function ke(){return _a||"all"}var et=function(e){var a=e.key,t=e.scope,n=e.method,o=e.splitKey,r=o===void 0?"+":o;Ca(a).forEach(function(s){var i=s.split(r),u=i.length,f=i[u-1],g=f==="*"?"*":Ne(f);if(P[g]){t||(t=ke());var b=u>1?ba(X,i):[];P[g]=P[g].filter(function(p){return!((!n||p.method===n)&&p.scope===t&&function(c,m){for(var C=c.length>=m.length?c:m,d=c.length>=m.length?m:c,h=!0,S=0;S<C.length;S++)d.indexOf(C[S])===-1&&(h=!1);return h}(p.mods,b))})}})};function Lt(e,a,t,n){var o;if(a.element===n&&(a.scope===t||a.scope==="all")){for(var r in o=a.mods.length>0,R)Object.prototype.hasOwnProperty.call(R,r)&&(!R[r]&&a.mods.indexOf(+r)>-1||R[r]&&a.mods.indexOf(+r)===-1)&&(o=!1);(a.mods.length!==0||R[16]||R[18]||R[17]||R[91])&&!o&&a.shortcut!=="*"||a.method(e,a)===!1&&(e.preventDefault?e.preventDefault():e.returnValue=!1,e.stopPropagation&&e.stopPropagation(),e.cancelBubble&&(e.cancelBubble=!0))}}function Mt(e,a){var t=P["*"],n=e.keyCode||e.which||e.charCode;if(U.filter.call(this,e)){if(n!==93&&n!==224||(n=91),x.indexOf(n)===-1&&n!==229&&x.push(n),["ctrlKey","altKey","shiftKey","metaKey"].forEach(function(m){var C=rt[m];e[m]&&x.indexOf(C)===-1?x.push(C):!e[m]&&x.indexOf(C)>-1?x.splice(x.indexOf(C),1):m==="metaKey"&&e[m]&&x.length===3&&(e.ctrlKey||e.shiftKey||e.altKey||(x=x.slice(x.indexOf(C))))}),n in R){for(var o in R[n]=!0,X)X[o]===n&&(U[o]=!0);if(!t)return}for(var r in R)Object.prototype.hasOwnProperty.call(R,r)&&(R[r]=e[rt[r]]);e.getModifierState&&(!e.altKey||e.ctrlKey)&&e.getModifierState("AltGraph")&&(x.indexOf(17)===-1&&x.push(17),x.indexOf(18)===-1&&x.push(18),R[17]=!0,R[18]=!0);var s=ke();if(t)for(var i=0;i<t.length;i++)t[i].scope===s&&(e.type==="keydown"&&t[i].keydown||e.type==="keyup"&&t[i].keyup)&&Lt(e,t[i],s,a);if(n in P){for(var u=0;u<P[n].length;u++)if((e.type==="keydown"&&P[n][u].keydown||e.type==="keyup"&&P[n][u].keyup)&&P[n][u].key){for(var f=P[n][u],g=f.splitKey,b=f.key.split(g),p=[],c=0;c<b.length;c++)p.push(Ne(b[c]));p.sort().join("")===x.sort().join("")&&Lt(e,f,s,a)}}}}function U(e,a,t){x=[];var n=Ca(e),o=[],r="all",s=document,i=0,u=!1,f=!0,g="+",b=!1;for(t===void 0&&typeof a=="function"&&(t=a),Object.prototype.toString.call(a)==="[object Object]"&&(a.scope&&(r=a.scope),a.element&&(s=a.element),a.keyup&&(u=a.keyup),a.keydown!==void 0&&(f=a.keydown),a.capture!==void 0&&(b=a.capture),typeof a.splitKey=="string"&&(g=a.splitKey)),typeof a=="string"&&(r=a);i<n.length;i++)o=[],(e=n[i].split(g)).length>1&&(o=ba(X,e)),(e=(e=e[e.length-1])==="*"?"*":Ne(e))in P||(P[e]=[]),P[e].push({keyup:u,keydown:f,scope:r,mods:o,shortcut:n[i],method:t,key:n[i],splitKey:g,element:s});s!==void 0&&!function(p){return Rt.indexOf(p)>-1}(s)&&window&&(Rt.push(s),We(s,"keydown",function(p){Mt(p,s)},b),Bt||(Bt=!0,We(window,"focus",function(){x=[]},b)),We(s,"keyup",function(p){Mt(p,s),function(c){var m=c.keyCode||c.which||c.charCode,C=x.indexOf(m);if(C>=0&&x.splice(C,1),c.key&&c.key.toLowerCase()==="meta"&&x.splice(0,x.length),m!==93&&m!==224||(m=91),m in R)for(var d in R[m]=!1,X)X[d]===m&&(U[d]=!1)}(p)},b))}var tt={setScope:jt,getScope:ke,deleteScope:function(e,a){var t,n;for(var o in e||(e=ke()),P)if(Object.prototype.hasOwnProperty.call(P,o))for(t=P[o],n=0;n<t.length;)t[n].scope===e?t.splice(n,1):n++;ke()===e&&jt(a||"all")},getPressedKeyCodes:function(){return x.slice(0)},isPressed:function(e){return typeof e=="string"&&(e=Ne(e)),x.indexOf(e)!==-1},filter:function(e){var a=e.target||e.srcElement,t=a.tagName,n=!0;return!a.isContentEditable&&(t!=="INPUT"&&t!=="TEXTAREA"&&t!=="SELECT"||a.readOnly)||(n=!1),n},trigger:function(e){var a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"all";Object.keys(P).forEach(function(t){var n=P[t].find(function(o){return o.scope===a&&o.shortcut===e});n&&n.method&&n.method()})},unbind:function(e){if(e===void 0)Object.keys(P).forEach(function(s){return delete P[s]});else if(Array.isArray(e))e.forEach(function(s){s.key&&et(s)});else if(typeof e=="object")e.key&&et(e);else if(typeof e=="string"){for(var a=arguments.length,t=new Array(a>1?a-1:0),n=1;n<a;n++)t[n-1]=arguments[n];var o=t[0],r=t[1];typeof o=="function"&&(r=o,o=""),et({key:e,scope:o,method:r,splitKey:"+"})}},keyMap:_t,modifier:X,modifierMap:rt};for(var at in tt)Object.prototype.hasOwnProperty.call(tt,at)&&(U[at]=tt[at]);if(typeof window<"u"){var Wo=window.hotkeys;U.noConflict=function(e){return e&&window.hotkeys===U&&(window.hotkeys=Wo),U},window.hotkeys=U}U.filter=function(){return!0};var Ut=function(e,a){var t=e.target,n=t&&t.tagName;return!!(n&&a&&a.includes(n))};function es(e,a,t,n){t instanceof Array&&(n=t,t=void 0);var o=t||{},r=o.enableOnTags,s=o.filter,i=o.keyup,u=o.keydown,f=o.filterPreventDefault,g=f===void 0||f,b=o.enabled,p=b===void 0||b,c=o.enableOnContentEditable,m=c!==void 0&&c,C=_.useRef(null),d=_.useCallback(function(h,S){var y,F;return s&&!s(h)?!g:!!(Ut(h,["INPUT","TEXTAREA","SELECT"])&&!Ut(h,r)||(y=h.target)!=null&&y.isContentEditable&&!m)||!!(C.current===null||document.activeElement===C.current||(F=C.current)!=null&&F.contains(document.activeElement))&&(a(h,S),!0)},n?[C,r,s].concat(n):[C,r,s]);return _.useEffect(function(){if(p)return i&&u!==!0&&(t.keydown=!1),U(e,t||{},d),function(){return U.unbind(e,d)};U.unbind(e,d)},[d,e,p]),C}U.isPressed;const ts=["net_burn_or_income_story_card","cash_balance","task_card","card_balance","zeni_promo_card","insights_dashboard","information_card","company_details","bill_pay_promo_card","bill_pay_card","reimbursement_card","reimbursement_promo_card","zeni_accounts_promo_card","rewards_card","treasury_promo_card"],as=(e,a,t,n,o)=>({card:{dimension:ft(t),cardType:n,cardIndex:o,fetchState:a,disableAnimations:!1},data:e.status!=null?{balanceAmount:e.balance?.available,lastUpdatedTime:e.status.lastRefreshSuccessTime,changePercent:e.balance?.change?.percent,changeComparedToDate:e.balance?.change?.since}:void 0}),Ce=(e,a,t,n,o)=>({card:{dimension:ft(t),cardType:n,cardIndex:o,fetchState:a,disableAnimations:!1},data:e}),ns=(e,a,t,n)=>Ce(void 0,e,_e,a,t),os=(e,a,t,n,o)=>({card:{dimension:ft(_e),cardType:a,cardIndex:t,fetchState:e,disableAnimations:!1},data:{funds:n,hasUserSeenVideo:o,videoUrl:"https://www.youtube.com/watch?v=sqvJWKCMZgk"}}),ss=H(function(e,a){const t=cs(a.dashboardReport),n=a.passedCardsOrdered,o=a.dashboardReport.reportsInOrder,{isInterestedInChargeCard:r,cardsCreditLimit:s,cashbackRate:i,treasuryFundDetails:u,hasUserSeenTreasuryVideo:f,treasuryFetchState:g}=a;let b=n.map((p,c)=>{if(p==="reimbursement_promo_card"||p==="bill_pay_promo_card")return ns(t,p,c);if(p==="zeni_promo_card")return Ce({isExpressedInterest:r,creditLimit:s,cashbackRate:i,fetchState:"Completed"},a.cardBalanceFetchState,_e,p,c);if(p==="treasury_promo_card")return os(g,p,c,u,f);if(p==="information_card")return Ce(void 0,"Completed",_e,p,c);{const m=o.find(C=>C?.reportId===p);return m?function(C,d,h,S){const y=C.reportId;switch(y){case"card_balance":case"cash_balance":return[as(C,d,h,y,S)];case"expense_automation_card":case"operating_expenses":case"revenue":case"top_expenses":case"cash_position":case"cash_in_cash_out":case"insights_dashboard":case"company_details":case"task_card":case"bill_pay_card":case"reimbursement_card":case"net_burn_or_income":case"accounts_payable_aging":case"accounts_receivable_aging":case"zeni_accounts_promo_card":case"rewards_card":return[Ce(C,d,h,y,S)];case"net_burn_or_income_story_card":return[Ce(C,d,h,"net_burn_or_income_story_card",S)];default:return console.error(`card type ${y} not yet supported!`),[]}}(m,m.fetchState,_e,c):[]}}).flat();return a.isSummaryCardsFiltered===!0&&(b=b.filter(p=>ts.includes(p.card.cardType)==0).filter(p=>{const c=p.data?.availableNumberOfPeriods;return c!=null?c>0:p.card.cardType!="top_expenses"||p.data==null||function(m){if(m==null||m.length===0)return!0;let C=!0;for(const d of m)if(d.balance.available.amount!==0){C=!1;break}return C}(p.data.topExpenses.accountsOrdered)===!1})),{cardDataArray:b,autoCompleteData:{autoCompleteText:e.entityAutoCompleteState.autoCompleteText.navbar,entityAutoCompleteView:W(e,"navbar")},analytics:A,isReimbursementEnabled:a.isReimbursementEnabled,isBillPayEnabled:a.isBillPayEnabled}},function(e,a){const t=a.tenantId,n=j.getSignedInUser();return{cardActions:{onCardClick:(o,r,s,i)=>{if(console.warn(`onCardClick at ${o} for the type ${r}`),r==="zeni_promo_card"&&i!=null)A.trackDashboardCardClicked("cards promo",2),A.trackZeniCardsPromoCardClicked(a.isChargeCardFeatureEnabled,i,2,`${n?.firstName??""} ${n?.lastName??""}`,a.isChargeCardFeatureEnabled?a.cardsCreditLimit:void 0),i==="Learn More"?window.open("https://www.zeni.ai/product/business-credit-card","_blank"):a.navigate("../cards/promo",{relative:"path"});else if(a.isForecastOn)switch(r){case"net_burn_or_income":case"operating_expenses":case"revenue":a.navigate(`${r}/forecast/${a.selectedForecastOnDashboard}`,{state:{referrer:s}});break;default:a.navigate(`${r}`,{state:{referrer:s}})}else r==="rewards_card"?(n!=null&&A.trackDashboardCardClicked("rewards promo",o+1),a.navigate("../../rewards/refer",{state:{referrer:s}})):r==="expense_automation_card"?(A.trackMonthEndCloseClicked(a.selectedPeriod.month,a.selectedPeriod.year,"Dashboard"),a.navigate("../../month_end_close_checks/review",{state:{referrer:"Dashboard"}})):a.navigate(`${r}`,{state:{referrer:s}})},onReloadData:(o,r)=>{const s=[];a.isApAgingFeatureEnabled===!1&&s.push("accounts_payable_aging"),a.isArAgingFeatureEnabled===!1&&s.push("accounts_receivable_aging"),a.isZeniAccountEnabled===!1&&s.push("zeni_accounts_promo_card"),a.isRewardsFeatureEnabled===!1&&s.push("rewards_card"),function(i,u,f,g){switch(u){case"card_balance":i($t());break;case"cash_balance":i(Gt());break;case"operating_expenses":i(ia(!0));break;case"revenue":i(ra(!0));break;case"net_burn_or_income":i(sa(!0));break;case"net_burn_or_income_story_card":i(Jn(!0));break;case"cash_position":i(oa(!0));break;case"top_expenses":i(na());break;case"cash_in_cash_out":i(aa());break;case"insights_dashboard":i(Hn());break;case"bill_pay_card":i(Zn());break;case"reimbursement_card":i(qn());break;case"company_details":i(zn(f));break;case"task_card":i($n());break;case"accounts_payable_aging":g.includes("accounts_payable_aging")===!1&&i(ot(de()));break;case"accounts_receivable_aging":i(st(de()));break;case"zeni_accounts_promo_card":g.includes("zeni_accounts_promo_card")===!1&&i(Kt());break;case"rewards_card":g.includes("rewards_card")===!1&&i(Kn(!0));break;default:throw new Error(`report type ${u} is not yet supported`)}}(e,r,a.companyId,s)},onTimeframeChange:(o,r)=>{A.trackTimeframeSwitch(ha(r),is(o),"Dashboard"),function(s,i,u){switch(i){case"operating_expenses":case"revenue":case"net_burn_or_income":case"cash_position":s(ue(u));break;case"top_expenses":s(ta(u));break;default:throw new Error(`report type ${i} doesn't support changeTimeframe`)}}(e,o,r)},onUpdateSelectedInsightIndex:o=>{e(Gn(o))},onCategoryClick:(o,r,s)=>{o==="bill-pay"?a.navigate("../bills",{state:{tab:r,subTab:s},relative:"path"}):o==="reimbursement"?a.navigate("../reimbursements",{state:{tab:r,subTab:s},relative:"path"}):o==="uncategorized-account-mapping"?a.navigate("../settings/accounting",{relative:"path"}):o==="show-all-tasks"?a.navigate("../tasks",{relative:"path"}):a.navigate(`../../transactions/${o}`)},onCardBtnClick:(o,r)=>{if(o==="bill_pay_promo_card"){const s="../bills",i=O(a.location.state?.pathnameStackToGoBack,a.location.pathname);a.navigate(s,{state:{pathnameStackToGoBack:i},relative:"path"})}else if(o==="reimbursement_promo_card"){const s="../reimbursements",i=O(a.location.state?.pathnameStackToGoBack,a.location.pathname);a.navigate(s,{state:{pathnameStackToGoBack:i},relative:"path"})}else if(o==="zeni_accounts_promo_card")if(a.hasZeniAccountsAdminAccess){let s="../checking/promo";r!=null&&(s=`../checking/${r}`);const i=O(a.location.state?.pathnameStackToGoBack,a.location.pathname);a.navigate(s,{state:{pathnameStackToGoBack:i},relative:"path"})}else window.open("https://www.zeni.ai/product/business-checking-accounts","_blank");else if(o==="treasury_promo_card")if(a.isUserHasTreasuryAccess){j.saveTreasuryPopupSeen(a.tenantEmailDomain,!0);const s="../treasury",i=O(a.location.state?.pathnameStackToGoBack,a.location.pathname);a.navigate(s,{state:{pathnameStackToGoBack:i},relative:"path"})}else window.open("https://www.zeni.ai/product/treasury","_blank")},onSaveClick:(o,r,s)=>{o==="net_burn_or_income_story_card"&&(A.trackUpdateBurnRateCalculatorSettings(r,s,Vn(s)),e(Nn(t,r,s)))},onVideoPlay:()=>{e(Yn())},onVideoClose:()=>{e(Un())}},autoCompleteActions:{onAutoCompleteInputChange:o=>{o.trim().length>=2?e(ee({searchString:o,searchOrigin:"navbar"})):o.trim().length===0&&e(Z("navbar"))},onCancelAutoComplete:()=>{e(Z("navbar"))},onAutoCompleteEntity:o=>{let r="";r=o.type!=="vendor"||o.detailType!=="bank_merchant"&&o.detailType!=="card_merchant"?ae(o,a.tenantEmailDomain):go(o.zeniId,o.qboId,a.tenantEmailDomain);const s=O(a.location.state?.pathnameStackToGoBack,a.location.pathname);a.navigate(r,{state:{pathnameStackToGoBack:s,referrer:"Search"}})}}}})(fo);function rs(){const{isAiCfoOpen:e,setIsAiCfoOpen:a}=Ee(),t=q(),n=G(),o=z(),r=j.getSignedInUser(),{useFeatureGate:s,useDynamicConfig:i}=Ye(),u=ye(r),[f,g]=_.useState(!1),[b,p]=_.useState(!1),c=da(),{tenantEmailDomain:m}=K(),{isAiCfoAccessEnabled:C,onAskAiCfoClick:d}=Ve({isAiCfoOpen:e,setIsAiCfoOpen:a,mobileExploreReferrer:"Dashboard"}),h=k(I=>I.tenantState.fetchState==="Completed"||I.tenantState.activeTenantFetchState.fetchState==="Completed"?L(I):void 0),S=h??j.getSignedInUserTenant(m),y=S.tenantId,F=S.companyId;_.useEffect(()=>{f===!1&&o.state?.message==="activation"&&(n(Fn(F)),g(!0))},[o.state,f,F,n]),_.useEffect(()=>{c&&!b&&o.state?.message==="open_ai_cfo_drawer"&&(a(!0),p(!0),t(o.pathname,{replace:!0,state:{...o.state,message:void 0}}))},[o.state,b,c,a,t,o.pathname]);const{isFeatureEnabled:E}=s(M.isApAgingFeatureEnabled),{isFeatureEnabled:v}=s(M.isExpenseAutomationEnabled),{isFeatureEnabled:w}=s(M.isExpenseAutomationEnabledV2),T=w||v&&u,{isFeatureEnabled:B}=s(M.isTreasuryEnabled),he=mo(T),{isFeatureEnabled:fe}=s(M.isArAgingFeatureEnabled),{isFeatureEnabled:Fe}=s(M.isDepositAccountsFeatureEnabled),{isFeatureEnabled:kt}=s(M.isReferralFeatureEnabled),{isFeatureEnabled:ka}=s(M.isChargeCardFeatureEnabled),{isFeatureEnabled:Sa}=s(M.isDashboardSidebarChristmasAnimationEnabled),{isFeatureEnabled:ya}=s(M.isDashboardSidebarNewYearAnimationEnabled),{configValue:St}=i(ua.zeniCardsConfig),va=St.charge_card_cashback_rate_per_transaction==null?.0175:St.charge_card_cashback_rate_per_transaction;if(o.state?.message==="activation"){const I=po(o.state?.pathnameStackToGoBack);t(o.pathname,{state:{...o.state,message:void 0,pathnameStackToGoBack:I.newStack}})}const[yt,Ia]=_.useState(!1),[Ge,Aa]=_.useState(!1);es("command+p, Control+p",I=>{Aa(!Ge),I.preventDefault()},{enableOnContentEditable:!0,enableOnTags:["INPUT","SELECT","TEXTAREA"]},[Ge]);const vt=h?.externalConnections?.accounting[0]?.isValid;if(r==null)throw Error("Can't access dashboard without signing in...");const ne=k(I=>L(I)?.excludedResources),Ea=k(I=>I.expenseAutomationViewState.selectedPeriodByTenantId),Ta=!!h?.companyReimbursementInfo?.info?.isReimbursementEnabled,wa=!!h?.companyBillPayInfo?.info?.isBillPayEnabled,xa=k(I=>I.treasurySetupViewState.treasuryFundsDetails).fetchStatus.fetchState,Da=h?.company!=null&&Pn(h.company),Ke=B&&Da,$e=we(),Oa=it($e?.loggedInUserRoleMap),Y=[],It=ne?.resources?.find(I=>I.resource==="/reports/top_expenses")==null,Fa=ne?.resources?.find(I=>I.resource==="/reports/task_card")==null,ze=h?.userRole!=null&&Xt(h?.userRole),Pa=ne?.resources?.find(I=>I.resource==="/bills")==null&&!ze,Ba=ne?.resources?.find(I=>I.resource==="/reimbursements")==null,Ra=Bn($e?.loggedInUserRoleMap),ja=Rn($e?.loggedInUserRoleMap),La=h?.company?.companyChargeCardInfo?.chargeCardsCreditAccountLimit??0,Ma=h?.companyChargeCardInfo?.info?.isCompanyInterestedInChargeCard??!1,Ua=k(I=>I.treasurySetupViewState.treasuryFundsDetails).fundsDetails;It===!1&&Y.push("top_expenses"),Fa===!1&&Y.push("task_card"),Pa===!1&&Y.push("bill_pay_card","bill_pay_promo_card"),E===!1&&Y.push("accounts_payable_aging"),fe===!1&&Y.push("accounts_receivable_aging"),(T===!1||ze)&&Y.push("expense_automation_card"),Ba===!1&&Y.push("reimbursement_card","reimbursement_promo_card"),Fe===!1&&Y.push("zeni_accounts_promo_card"),kt===!1&&Y.push("rewards_card"),Ke===!1&&Y.push("treasury_promo_card");const{areTenantIdsInSync:At}=ho();_.useLayoutEffect(()=>{yt&&he===T||vt!==!0||!At||ne?.fetchState!=="Completed"&&ne?.fetchState!=="Error"||(Ia(!0),n(jn(r.userId,F,y,!0,!1,Y)))},[yt,r,y,n,It,vt,ne?.fetchState,At]);const Ya=k(I=>I.reportUIOptionsState.forecastOnDashboard.isForecastModeOn),Va=k(I=>I.revenueState.uiState.selectedForecast?.id),Na=k(I=>I.cardBalanceState.fetchState),ie=k(I=>Ln(I,Y,r,w,v,Ke)),Ga=ie.fetchState;De({isDataReady:!0});const Et=h?.isTreasuryVideoViewed===!0||ie.isTreasuryVideoClosed===!0;return l.jsxs(l.Fragment,{children:[Ga==="Completed"?l.jsx(Te,{analytics:A,onLoad:I=>{I.trackPageLoaded(V.Event.dashboard),Ke&&!Et&&I.trackTreasuryPromoView("Dashboard Promo Video")}}):null,l.jsx(ss,{maxColumns:e?2:void 0,isAiCfoAccessEnabled:C,onAskAiCfoClick:d,onDragAndDropCard:(I,Ka)=>{const Tt=function(Pe,qe,Be){const Ze=Be.indexOf(Pe),He=Be.indexOf(qe);if(Ze===-1||He===-1||Ze===He)return Be;const Je=[...Be];return Je.splice(Ze,1),Je.splice(He,0,Pe),Je}(I,Ka,ie.cardsOrdered);Tt.some((Pe,qe)=>Pe!==ie.cardsOrdered[qe])&&n(Mn(Tt))},dashboardReport:ie,passedCardsOrdered:ie.cardsForDashboardUI,tenantId:y,companyId:F,tenantEmailDomain:m,location:o,navigate:t,isApAgingFeatureEnabled:E,isArAgingFeatureEnabled:fe,isBillPayEnabled:wa,isReimbursementEnabled:Ta,isSummaryCardsFiltered:Ge,isForecastOn:Ya,selectedForecastOnDashboard:Va,isVisitingFirstTime:f,isZeniAccountEnabled:Fe,isRewardsFeatureEnabled:kt,hasZeniAccountsAdminAccess:Oa,isExpenseAutomationEnabledForUser:T&&ze===!1,selectedPeriod:Ea[y],isChargeCardFeatureEnabled:ka,isUserHasCardsAccess:Ra,isUserHasTreasuryAccess:ja,cardsCreditLimit:La,cashbackRate:va,isInterestedInChargeCard:Ma,cardBalanceFetchState:Na,christmasAnimationEnabled:Sa,newYearAnimationEnabled:ya,treasuryFundDetails:Ua,hasUserSeenTreasuryVideo:Et,treasuryFetchState:xa})]})}const is=e=>{switch(e){case"operating_expenses":return"Operating Expenses";case"revenue":return"Revenues";case"top_expenses":return"Top Expenses";case"net_burn_or_income":return"Burn Rate";case"cash_in_cash_out":return"Cash In, Cash Out";case"cash_position":return"Cash Position"}return"Dashboard"},cs=e=>e.fetchState!=="Error"?e.fetchState:e.reportsInOrder.map(a=>a.fetchState).reduce((a,t)=>a==="In-Progress"||a==="Not-Started"?a:t);function js(){const e=we(),a=e?.excludedResources?.find(f=>f.resource==="/reports/top_expenses")==null,{useFeatureGate:t}=Ye(),{isFeatureEnabled:n}=t(M.isApAgingFeatureEnabled),{isFeatureEnabled:o}=t(M.isArAgingFeatureEnabled),r=k(f=>L(f)),{isFeatureEnabled:s}=t(M.isDebitCardFeatureEnabled),i=Qn(s,r),u=Xn(r);return i===!0||u===!0?l.jsx(nt,{children:l.jsx(D,{path:"/*",element:l.jsx(_o,{})})}):l.jsxs(nt,{children:[l.jsx(D,{path:"/",element:l.jsx(rs,{})}),l.jsx(D,{path:"cash_balance/*",element:l.jsx(Pt,{})}),l.jsx(D,{path:"card_balance/*",element:l.jsx(Pt,{})}),l.jsx(D,{path:"operating_expenses/*",element:l.jsx(Q,{})}),l.jsx(D,{path:"operating_expenses/forecast/*",element:l.jsx(Qe,{})}),l.jsx(D,{path:"revenue/forecast/*",element:l.jsx(Qe,{})}),l.jsx(D,{path:"revenue/*",element:l.jsx(Q,{})}),l.jsx(D,{path:"net_burn_or_income/forecast/*",element:l.jsx(Qe,{})}),l.jsx(D,{path:"net_burn_or_income/*",element:l.jsx(Q,{})}),n===!0&&l.jsxs(l.Fragment,{children:[l.jsx(D,{path:"accounts_payable_aging/*",element:l.jsx(yo,{})}),l.jsx(D,{path:"accounts_payable_aging/:vendorId/:reportDate/*",element:l.jsx(So,{})})]}),o&&l.jsxs(l.Fragment,{children:[l.jsx(D,{path:"accounts_receivable_aging/:customerId/:reportDate/*",element:l.jsx(vo,{})}),l.jsx(D,{path:"accounts_receivable_aging/*",element:l.jsx(Io,{})})]}),l.jsx(D,{path:"cash_position/*",element:l.jsx(Q,{})}),l.jsx(D,{path:"top_expenses/*",element:a===!0?l.jsx(Q,{}):l.jsx(Se,{})}),l.jsx(D,{path:"cash_in_cash_out/*",element:l.jsx(Q,{})}),l.jsx(D,{path:"company_details",element:l.jsx(Co,{})}),l.jsx(D,{path:"referrals/*",element:l.jsx(ko,{})}),l.jsx(D,{path:"*",element:l.jsx(Se,{})})]})}export{js as default};
20
+ `,le=3,Ct=1;function Xo({fetchState:e,firstMonthOfFY:a,reportId:t,forecastId:n}){const o=q(),r=z(),{tenantEmailDomain:s}=K();let i;De({isDataReady:!0});const u={firstMonthOfFY:a,tenantEmailDomain:s,location:r,navigate:o,forecastIdFromUrlPath:n,fetchState:e};switch(t){case"operating_expenses":i=l.jsx(Ko,{...u});break;case"revenue":i=l.jsx(qo,{...u});break;case"net_burn_or_income":i=l.jsx(Vo,{...u});break;case"cash_position":i=l.jsx(Mo,{...u});break;case"top_expenses":i=l.jsx(Jo,{...u});break;case"cash_in_cash_out":i=l.jsx(Ro,{...u});break;default:console.error(`${t} is not supported!`),i=null}return i!=null?l.jsx(Qo,{children:i}):null}function Q(){const e=z(),a=N(),{forecastId:t}=K();let n="Not-Started";const o=k(c=>pt(c).fetchState),r=k(c=>ht(c).fetchState),s=k(c=>ct(c).fetchState),i=k(c=>c.cashPositionState.fetchState),u=k(c=>c.topExState.fetchState),f=k(c=>c.cashInCashOutState.fetchState);if(j.getSignedInUser()==null)throw Error("Can't access dashboard detail without signing in...");const g=k(c=>L(c)),b=g?.company?.companyInfo?.firstMonthOfFY??1,p=Vt((c=>{const m=Gt(c,"/").split("/");return t!=null?m[m.length-3]:m[m.length-1]})(e.pathname));switch(p){case"operating_expenses":n=o;break;case"revenue":n=r;break;case"net_burn_or_income":n=s;break;case"cash_position":n=i;break;case"top_expenses":n=u;break;case"cash_in_cash_out":n=f;break;default:console.error(`${p} is not supported!`)}return _.useEffect(()=>{n==="Not-Started"&&function(c,m,C,d){switch(m){case"operating_expenses":c(ia(!0)),d!=null&&(c(ce(C,!0,le,{id:d,index:0})),c(Qt(!1,d)));break;case"revenue":c(ra(!0)),d!=null&&(c(ce(C,!0,le,{id:d,index:0})),c(ea(!1,d)));break;case"net_burn_or_income":c(sa(!0)),d!=null&&(c(ce(C,!0,le,{id:d,index:0})),c(Ht(!1,d)));break;case"cash_position":c(oa(!0));break;case"top_expenses":c(na());break;case"cash_in_cash_out":c(aa());break;default:throw new Error(`report type ${m} is not yet supported`)}}(a,p,b,t)},[t]),l.jsxs(l.Fragment,{children:[n==="Completed"?l.jsx(Te,{analytics:A,onLoad:c=>((m,C)=>{const d=e.state?.referrer;switch(C){case"operating_expenses":m.trackPageLoaded(V.Event.operatingExpenses,d);break;case"revenue":m.trackPageLoaded(V.Event.revenues,d);break;case"net_burn_or_income":m.trackPageLoaded(V.Event.burnRate,d);break;case"cash_position":m.trackPageLoaded(V.Event.cashPosition,d);break;case"top_expenses":m.trackPageLoaded(V.Event.topExpenses,d);break;case"cash_in_cash_out":m.trackPageLoaded(V.Event.cashInCashOut,d);break;default:console.error(`Analytics: Not tracking Page Loaded for ${C}!`)}})(c,p)}):null,l.jsx(Xo,{firstMonthOfFY:b,fetchState:n,reportId:p,forecastId:t})]})}var Xe=typeof navigator<"u"&&navigator.userAgent.toLowerCase().indexOf("firefox")>0;function We(e,a,t,n){e.addEventListener?e.addEventListener(a,t,n):e.attachEvent&&e.attachEvent("on".concat(a),function(){t(window.event)})}function ba(e,a){for(var t=a.slice(0,a.length-1),n=0;n<t.length;n++)t[n]=e[t[n].toLowerCase()];return t}function Ca(e){typeof e!="string"&&(e="");for(var a=(e=e.replace(/\s/g,"")).split(","),t=a.lastIndexOf("");t>=0;)a[t-1]+=",",a.splice(t,1),t=a.lastIndexOf("");return a}for(var _t={backspace:8,tab:9,clear:12,enter:13,return:13,esc:27,escape:27,space:32,left:37,up:38,right:39,down:40,del:46,delete:46,ins:45,insert:45,home:36,end:35,pageup:33,pagedown:34,capslock:20,num_0:96,num_1:97,num_2:98,num_3:99,num_4:100,num_5:101,num_6:102,num_7:103,num_8:104,num_9:105,num_multiply:106,num_add:107,num_enter:108,num_subtract:109,num_decimal:110,num_divide:111,"⇪":20,",":188,".":190,"/":191,"`":192,"-":Xe?173:189,"=":Xe?61:187,";":Xe?59:186,"'":222,"[":219,"]":221,"\\":220},X={"⇧":16,shift:16,"⌥":18,alt:18,option:18,"⌃":17,ctrl:17,control:17,"⌘":91,cmd:91,command:91},rt={16:"shiftKey",18:"altKey",17:"ctrlKey",91:"metaKey",shiftKey:16,ctrlKey:17,altKey:18,metaKey:91},R={16:!1,18:!1,17:!1,91:!1},P={},Le=1;Le<20;Le++)_t["f".concat(Le)]=111+Le;var x=[],Bt=!1,_a="all",Rt=[],Ge=function(e){return _t[e.toLowerCase()]||X[e.toLowerCase()]||e.toUpperCase().charCodeAt(0)};function jt(e){_a=e||"all"}function ke(){return _a||"all"}var et=function(e){var a=e.key,t=e.scope,n=e.method,o=e.splitKey,r=o===void 0?"+":o;Ca(a).forEach(function(s){var i=s.split(r),u=i.length,f=i[u-1],g=f==="*"?"*":Ge(f);if(P[g]){t||(t=ke());var b=u>1?ba(X,i):[];P[g]=P[g].filter(function(p){return!((!n||p.method===n)&&p.scope===t&&function(c,m){for(var C=c.length>=m.length?c:m,d=c.length>=m.length?m:c,h=!0,S=0;S<C.length;S++)d.indexOf(C[S])===-1&&(h=!1);return h}(p.mods,b))})}})};function Lt(e,a,t,n){var o;if(a.element===n&&(a.scope===t||a.scope==="all")){for(var r in o=a.mods.length>0,R)Object.prototype.hasOwnProperty.call(R,r)&&(!R[r]&&a.mods.indexOf(+r)>-1||R[r]&&a.mods.indexOf(+r)===-1)&&(o=!1);(a.mods.length!==0||R[16]||R[18]||R[17]||R[91])&&!o&&a.shortcut!=="*"||a.method(e,a)===!1&&(e.preventDefault?e.preventDefault():e.returnValue=!1,e.stopPropagation&&e.stopPropagation(),e.cancelBubble&&(e.cancelBubble=!0))}}function Mt(e,a){var t=P["*"],n=e.keyCode||e.which||e.charCode;if(U.filter.call(this,e)){if(n!==93&&n!==224||(n=91),x.indexOf(n)===-1&&n!==229&&x.push(n),["ctrlKey","altKey","shiftKey","metaKey"].forEach(function(m){var C=rt[m];e[m]&&x.indexOf(C)===-1?x.push(C):!e[m]&&x.indexOf(C)>-1?x.splice(x.indexOf(C),1):m==="metaKey"&&e[m]&&x.length===3&&(e.ctrlKey||e.shiftKey||e.altKey||(x=x.slice(x.indexOf(C))))}),n in R){for(var o in R[n]=!0,X)X[o]===n&&(U[o]=!0);if(!t)return}for(var r in R)Object.prototype.hasOwnProperty.call(R,r)&&(R[r]=e[rt[r]]);e.getModifierState&&(!e.altKey||e.ctrlKey)&&e.getModifierState("AltGraph")&&(x.indexOf(17)===-1&&x.push(17),x.indexOf(18)===-1&&x.push(18),R[17]=!0,R[18]=!0);var s=ke();if(t)for(var i=0;i<t.length;i++)t[i].scope===s&&(e.type==="keydown"&&t[i].keydown||e.type==="keyup"&&t[i].keyup)&&Lt(e,t[i],s,a);if(n in P){for(var u=0;u<P[n].length;u++)if((e.type==="keydown"&&P[n][u].keydown||e.type==="keyup"&&P[n][u].keyup)&&P[n][u].key){for(var f=P[n][u],g=f.splitKey,b=f.key.split(g),p=[],c=0;c<b.length;c++)p.push(Ge(b[c]));p.sort().join("")===x.sort().join("")&&Lt(e,f,s,a)}}}}function U(e,a,t){x=[];var n=Ca(e),o=[],r="all",s=document,i=0,u=!1,f=!0,g="+",b=!1;for(t===void 0&&typeof a=="function"&&(t=a),Object.prototype.toString.call(a)==="[object Object]"&&(a.scope&&(r=a.scope),a.element&&(s=a.element),a.keyup&&(u=a.keyup),a.keydown!==void 0&&(f=a.keydown),a.capture!==void 0&&(b=a.capture),typeof a.splitKey=="string"&&(g=a.splitKey)),typeof a=="string"&&(r=a);i<n.length;i++)o=[],(e=n[i].split(g)).length>1&&(o=ba(X,e)),(e=(e=e[e.length-1])==="*"?"*":Ge(e))in P||(P[e]=[]),P[e].push({keyup:u,keydown:f,scope:r,mods:o,shortcut:n[i],method:t,key:n[i],splitKey:g,element:s});s!==void 0&&!function(p){return Rt.indexOf(p)>-1}(s)&&window&&(Rt.push(s),We(s,"keydown",function(p){Mt(p,s)},b),Bt||(Bt=!0,We(window,"focus",function(){x=[]},b)),We(s,"keyup",function(p){Mt(p,s),function(c){var m=c.keyCode||c.which||c.charCode,C=x.indexOf(m);if(C>=0&&x.splice(C,1),c.key&&c.key.toLowerCase()==="meta"&&x.splice(0,x.length),m!==93&&m!==224||(m=91),m in R)for(var d in R[m]=!1,X)X[d]===m&&(U[d]=!1)}(p)},b))}var tt={setScope:jt,getScope:ke,deleteScope:function(e,a){var t,n;for(var o in e||(e=ke()),P)if(Object.prototype.hasOwnProperty.call(P,o))for(t=P[o],n=0;n<t.length;)t[n].scope===e?t.splice(n,1):n++;ke()===e&&jt(a||"all")},getPressedKeyCodes:function(){return x.slice(0)},isPressed:function(e){return typeof e=="string"&&(e=Ge(e)),x.indexOf(e)!==-1},filter:function(e){var a=e.target||e.srcElement,t=a.tagName,n=!0;return!a.isContentEditable&&(t!=="INPUT"&&t!=="TEXTAREA"&&t!=="SELECT"||a.readOnly)||(n=!1),n},trigger:function(e){var a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"all";Object.keys(P).forEach(function(t){var n=P[t].find(function(o){return o.scope===a&&o.shortcut===e});n&&n.method&&n.method()})},unbind:function(e){if(e===void 0)Object.keys(P).forEach(function(s){return delete P[s]});else if(Array.isArray(e))e.forEach(function(s){s.key&&et(s)});else if(typeof e=="object")e.key&&et(e);else if(typeof e=="string"){for(var a=arguments.length,t=new Array(a>1?a-1:0),n=1;n<a;n++)t[n-1]=arguments[n];var o=t[0],r=t[1];typeof o=="function"&&(r=o,o=""),et({key:e,scope:o,method:r,splitKey:"+"})}},keyMap:_t,modifier:X,modifierMap:rt};for(var at in tt)Object.prototype.hasOwnProperty.call(tt,at)&&(U[at]=tt[at]);if(typeof window<"u"){var Wo=window.hotkeys;U.noConflict=function(e){return e&&window.hotkeys===U&&(window.hotkeys=Wo),U},window.hotkeys=U}U.filter=function(){return!0};var Ut=function(e,a){var t=e.target,n=t&&t.tagName;return!!(n&&a&&a.includes(n))};function es(e,a,t,n){t instanceof Array&&(n=t,t=void 0);var o=t||{},r=o.enableOnTags,s=o.filter,i=o.keyup,u=o.keydown,f=o.filterPreventDefault,g=f===void 0||f,b=o.enabled,p=b===void 0||b,c=o.enableOnContentEditable,m=c!==void 0&&c,C=_.useRef(null),d=_.useCallback(function(h,S){var y,F;return s&&!s(h)?!g:!!(Ut(h,["INPUT","TEXTAREA","SELECT"])&&!Ut(h,r)||(y=h.target)!=null&&y.isContentEditable&&!m)||!!(C.current===null||document.activeElement===C.current||(F=C.current)!=null&&F.contains(document.activeElement))&&(a(h,S),!0)},n?[C,r,s].concat(n):[C,r,s]);return _.useEffect(function(){if(p)return i&&u!==!0&&(t.keydown=!1),U(e,t||{},d),function(){return U.unbind(e,d)};U.unbind(e,d)},[d,e,p]),C}U.isPressed;const ts=["net_burn_or_income_story_card","cash_balance","task_card","card_balance","zeni_promo_card","insights_dashboard","information_card","company_details","bill_pay_promo_card","bill_pay_card","reimbursement_card","reimbursement_promo_card","zeni_accounts_promo_card","rewards_card","treasury_promo_card"],as=(e,a,t,n,o)=>({card:{dimension:ft(t),cardType:n,cardIndex:o,fetchState:a,disableAnimations:!1},data:e.status!=null?{balanceAmount:e.balance?.available,lastUpdatedTime:e.status.lastRefreshSuccessTime,changePercent:e.balance?.change?.percent,changeComparedToDate:e.balance?.change?.since}:void 0}),Ce=(e,a,t,n,o)=>({card:{dimension:ft(t),cardType:n,cardIndex:o,fetchState:a,disableAnimations:!1},data:e}),ns=(e,a,t,n)=>Ce(void 0,e,_e,a,t),os=(e,a,t,n,o)=>({card:{dimension:ft(_e),cardType:a,cardIndex:t,fetchState:e,disableAnimations:!1},data:{funds:n,hasUserSeenVideo:o,videoUrl:"https://www.youtube.com/watch?v=sqvJWKCMZgk"}}),ss=H(function(e,a){const t=cs(a.dashboardReport),n=a.passedCardsOrdered,o=a.dashboardReport.reportsInOrder,{isInterestedInChargeCard:r,cardsCreditLimit:s,cashbackRate:i,treasuryFundDetails:u,hasUserSeenTreasuryVideo:f,treasuryFetchState:g}=a;let b=n.map((p,c)=>{if(p==="reimbursement_promo_card"||p==="bill_pay_promo_card")return ns(t,p,c);if(p==="zeni_promo_card")return Ce({isExpressedInterest:r,creditLimit:s,cashbackRate:i,fetchState:"Completed"},a.cardBalanceFetchState,_e,p,c);if(p==="treasury_promo_card")return os(g,p,c,u,f);if(p==="information_card")return Ce(void 0,"Completed",_e,p,c);{const m=o.find(C=>C?.reportId===p);return m?function(C,d,h,S){const y=C.reportId;switch(y){case"card_balance":case"cash_balance":return[as(C,d,h,y,S)];case"expense_automation_card":case"operating_expenses":case"revenue":case"top_expenses":case"cash_position":case"cash_in_cash_out":case"insights_dashboard":case"company_details":case"task_card":case"bill_pay_card":case"reimbursement_card":case"net_burn_or_income":case"accounts_payable_aging":case"accounts_receivable_aging":case"zeni_accounts_promo_card":case"rewards_card":return[Ce(C,d,h,y,S)];case"net_burn_or_income_story_card":return[Ce(C,d,h,"net_burn_or_income_story_card",S)];default:return console.error(`card type ${y} not yet supported!`),[]}}(m,m.fetchState,_e,c):[]}}).flat();return a.isSummaryCardsFiltered===!0&&(b=b.filter(p=>ts.includes(p.card.cardType)==0).filter(p=>{const c=p.data?.availableNumberOfPeriods;return c!=null?c>0:p.card.cardType!="top_expenses"||p.data==null||function(m){if(m==null||m.length===0)return!0;let C=!0;for(const d of m)if(d.balance.available.amount!==0){C=!1;break}return C}(p.data.topExpenses.accountsOrdered)===!1})),{cardDataArray:b,autoCompleteData:{autoCompleteText:e.entityAutoCompleteState.autoCompleteText.navbar,entityAutoCompleteView:W(e,"navbar")},analytics:A,isReimbursementEnabled:a.isReimbursementEnabled,isBillPayEnabled:a.isBillPayEnabled}},function(e,a){const t=a.tenantId,n=j.getSignedInUser();return{cardActions:{onCardClick:(o,r,s,i)=>{if(console.warn(`onCardClick at ${o} for the type ${r}`),r==="zeni_promo_card"&&i!=null)A.trackDashboardCardClicked("cards promo",2),A.trackZeniCardsPromoCardClicked(a.isChargeCardFeatureEnabled,i,2,`${n?.firstName??""} ${n?.lastName??""}`,a.isChargeCardFeatureEnabled?a.cardsCreditLimit:void 0),i==="Learn More"?window.open("https://www.zeni.ai/product/business-credit-card","_blank"):a.navigate("../cards/promo",{relative:"path"});else if(a.isForecastOn)switch(r){case"net_burn_or_income":case"operating_expenses":case"revenue":a.navigate(`${r}/forecast/${a.selectedForecastOnDashboard}`,{state:{referrer:s}});break;default:a.navigate(`${r}`,{state:{referrer:s}})}else r==="rewards_card"?(n!=null&&A.trackDashboardCardClicked("rewards promo",o+1),a.navigate("../../rewards/refer",{state:{referrer:s}})):r==="expense_automation_card"?(A.trackMonthEndCloseClicked(a.selectedPeriod.month,a.selectedPeriod.year,"Dashboard"),a.navigate("../../month_end_close_checks/review",{state:{referrer:"Dashboard"}})):a.navigate(`${r}`,{state:{referrer:s}})},onReloadData:(o,r)=>{const s=[];a.isApAgingFeatureEnabled===!1&&s.push("accounts_payable_aging"),a.isArAgingFeatureEnabled===!1&&s.push("accounts_receivable_aging"),a.isZeniAccountEnabled===!1&&s.push("zeni_accounts_promo_card"),a.isRewardsFeatureEnabled===!1&&s.push("rewards_card"),function(i,u,f,g){switch(u){case"card_balance":i($t());break;case"cash_balance":i(Nt());break;case"operating_expenses":i(ia(!0));break;case"revenue":i(ra(!0));break;case"net_burn_or_income":i(sa(!0));break;case"net_burn_or_income_story_card":i(Jn(!0));break;case"cash_position":i(oa(!0));break;case"top_expenses":i(na());break;case"cash_in_cash_out":i(aa());break;case"insights_dashboard":i(Hn());break;case"bill_pay_card":i(Zn());break;case"reimbursement_card":i(qn());break;case"company_details":i(zn(f));break;case"task_card":i($n());break;case"accounts_payable_aging":g.includes("accounts_payable_aging")===!1&&i(ot(de()));break;case"accounts_receivable_aging":i(st(de()));break;case"zeni_accounts_promo_card":g.includes("zeni_accounts_promo_card")===!1&&i(Kt());break;case"rewards_card":g.includes("rewards_card")===!1&&i(Kn(!0));break;default:throw new Error(`report type ${u} is not yet supported`)}}(e,r,a.companyId,s)},onTimeframeChange:(o,r)=>{A.trackTimeframeSwitch(ha(r),is(o),"Dashboard"),function(s,i,u){switch(i){case"operating_expenses":case"revenue":case"net_burn_or_income":case"cash_position":s(ue(u));break;case"top_expenses":s(ta(u));break;default:throw new Error(`report type ${i} doesn't support changeTimeframe`)}}(e,o,r)},onUpdateSelectedInsightIndex:o=>{e(Nn(o))},onCategoryClick:(o,r,s)=>{o==="bill-pay"?a.navigate("../bills",{state:{tab:r,subTab:s},relative:"path"}):o==="reimbursement"?a.navigate("../reimbursements",{state:{tab:r,subTab:s},relative:"path"}):o==="uncategorized-account-mapping"?a.navigate("../settings/accounting",{relative:"path"}):o==="show-all-tasks"?a.navigate("../tasks",{relative:"path"}):a.navigate(`../../transactions/${o}`)},onCardBtnClick:(o,r)=>{if(o==="bill_pay_promo_card"){const s="../bills",i=O(a.location.state?.pathnameStackToGoBack,a.location.pathname);a.navigate(s,{state:{pathnameStackToGoBack:i},relative:"path"})}else if(o==="reimbursement_promo_card"){const s="../reimbursements",i=O(a.location.state?.pathnameStackToGoBack,a.location.pathname);a.navigate(s,{state:{pathnameStackToGoBack:i},relative:"path"})}else if(o==="zeni_accounts_promo_card")if(a.hasZeniAccountsAdminAccess){let s="../checking/promo";r!=null&&(s=`../checking/${r}`);const i=O(a.location.state?.pathnameStackToGoBack,a.location.pathname);a.navigate(s,{state:{pathnameStackToGoBack:i},relative:"path"})}else window.open("https://www.zeni.ai/product/business-checking-accounts","_blank");else if(o==="treasury_promo_card")if(a.isUserHasTreasuryAccess){j.saveTreasuryPopupSeen(a.tenantEmailDomain,!0);const s="../treasury",i=O(a.location.state?.pathnameStackToGoBack,a.location.pathname);a.navigate(s,{state:{pathnameStackToGoBack:i},relative:"path"})}else window.open("https://www.zeni.ai/product/treasury","_blank")},onSaveClick:(o,r,s)=>{o==="net_burn_or_income_story_card"&&(A.trackUpdateBurnRateCalculatorSettings(r,s,Vn(s)),e(Gn(t,r,s)))},onVideoPlay:()=>{e(Yn())},onVideoClose:()=>{e(Un())}},autoCompleteActions:{onAutoCompleteInputChange:o=>{o.trim().length>=2?e(ee({searchString:o,searchOrigin:"navbar"})):o.trim().length===0&&e(Z("navbar"))},onCancelAutoComplete:()=>{e(Z("navbar"))},onAutoCompleteEntity:o=>{let r="";r=o.type!=="vendor"||o.detailType!=="bank_merchant"&&o.detailType!=="card_merchant"?ae(o,a.tenantEmailDomain):go(o.zeniId,o.qboId,a.tenantEmailDomain);const s=O(a.location.state?.pathnameStackToGoBack,a.location.pathname);a.navigate(r,{state:{pathnameStackToGoBack:s,referrer:"Search"}})}}}})(fo);function rs(){const{isAiCfoOpen:e,setIsAiCfoOpen:a}=Ee(),t=q(),n=N(),o=z(),r=j.getSignedInUser(),{useFeatureGate:s,useDynamicConfig:i}=Ye(),u=ye(r),[f,g]=_.useState(!1),[b,p]=_.useState(!1),c=da(),{tenantEmailDomain:m}=K(),{isAiCfoAccessEnabled:C,onAskAiCfoClick:d}=Ve({isAiCfoOpen:e,setIsAiCfoOpen:a,mobileExploreReferrer:"Dashboard"}),h=k(I=>I.tenantState.fetchState==="Completed"||I.tenantState.activeTenantFetchState.fetchState==="Completed"?L(I):void 0),S=h??j.getSignedInUserTenant(m),y=S.tenantId,F=S.companyId;_.useEffect(()=>{f===!1&&o.state?.message==="activation"&&(n(Fn(F)),g(!0))},[o.state,f,F,n]),_.useEffect(()=>{c&&!b&&o.state?.message==="open_ai_cfo_drawer"&&(a(!0),p(!0),t(o.pathname,{replace:!0,state:{...o.state,message:void 0}}))},[o.state,b,c,a,t,o.pathname]);const{isFeatureEnabled:E}=s(M.isApAgingFeatureEnabled),{isFeatureEnabled:v}=s(M.isExpenseAutomationEnabled),{isFeatureEnabled:w}=s(M.isExpenseAutomationEnabledV2),T=w||v&&u,{isFeatureEnabled:B}=s(M.isTreasuryEnabled),he=mo(T),{isFeatureEnabled:fe}=s(M.isArAgingFeatureEnabled),{isFeatureEnabled:Fe}=s(M.isDepositAccountsFeatureEnabled),{isFeatureEnabled:kt}=s(M.isReferralFeatureEnabled),{isFeatureEnabled:ka}=s(M.isChargeCardFeatureEnabled),{isFeatureEnabled:Sa}=s(M.isDashboardSidebarChristmasAnimationEnabled),{isFeatureEnabled:ya}=s(M.isDashboardSidebarNewYearAnimationEnabled),{configValue:St}=i(ua.zeniCardsConfig),va=St.charge_card_cashback_rate_per_transaction==null?.0175:St.charge_card_cashback_rate_per_transaction;if(o.state?.message==="activation"){const I=po(o.state?.pathnameStackToGoBack);t(o.pathname,{state:{...o.state,message:void 0,pathnameStackToGoBack:I.newStack}})}const[yt,Ia]=_.useState(!1),[Ne,Aa]=_.useState(!1);es("command+p, Control+p",I=>{Aa(!Ne),I.preventDefault()},{enableOnContentEditable:!0,enableOnTags:["INPUT","SELECT","TEXTAREA"]},[Ne]);const vt=h?.externalConnections?.accounting[0]?.isValid;if(r==null)throw Error("Can't access dashboard without signing in...");const ne=k(I=>L(I)?.excludedResources),Ea=k(I=>I.expenseAutomationViewState.selectedPeriodByTenantId),Ta=!!h?.companyReimbursementInfo?.info?.isReimbursementEnabled,wa=!!h?.companyBillPayInfo?.info?.isBillPayEnabled,xa=k(I=>I.treasurySetupViewState.treasuryFundsDetails).fetchStatus.fetchState,Da=h?.company!=null&&Pn(h.company),Ke=B&&Da,$e=we(),Oa=it($e?.loggedInUserRoleMap),Y=[],It=ne?.resources?.find(I=>I.resource==="/reports/top_expenses")==null,Fa=ne?.resources?.find(I=>I.resource==="/reports/task_card")==null,ze=h?.userRole!=null&&Xt(h?.userRole),Pa=ne?.resources?.find(I=>I.resource==="/bills")==null&&!ze,Ba=ne?.resources?.find(I=>I.resource==="/reimbursements")==null,Ra=Bn($e?.loggedInUserRoleMap),ja=Rn($e?.loggedInUserRoleMap),La=h?.company?.companyChargeCardInfo?.chargeCardsCreditAccountLimit??0,Ma=h?.companyChargeCardInfo?.info?.isCompanyInterestedInChargeCard??!1,Ua=k(I=>I.treasurySetupViewState.treasuryFundsDetails).fundsDetails;It===!1&&Y.push("top_expenses"),Fa===!1&&Y.push("task_card"),Pa===!1&&Y.push("bill_pay_card","bill_pay_promo_card"),E===!1&&Y.push("accounts_payable_aging"),fe===!1&&Y.push("accounts_receivable_aging"),(T===!1||ze)&&Y.push("expense_automation_card"),Ba===!1&&Y.push("reimbursement_card","reimbursement_promo_card"),Fe===!1&&Y.push("zeni_accounts_promo_card"),kt===!1&&Y.push("rewards_card"),Ke===!1&&Y.push("treasury_promo_card");const{areTenantIdsInSync:At}=ho();_.useLayoutEffect(()=>{yt&&he===T||vt!==!0||!At||ne?.fetchState!=="Completed"&&ne?.fetchState!=="Error"||(Ia(!0),n(jn(r.userId,F,y,!0,!1,Y)))},[yt,r,y,n,It,vt,ne?.fetchState,At]);const Ya=k(I=>I.reportUIOptionsState.forecastOnDashboard.isForecastModeOn),Va=k(I=>I.revenueState.uiState.selectedForecast?.id),Ga=k(I=>I.cardBalanceState.fetchState),ie=k(I=>Ln(I,Y,r,w,v,Ke)),Na=ie.fetchState;De({isDataReady:!0});const Et=h?.isTreasuryVideoViewed===!0||ie.isTreasuryVideoClosed===!0;return l.jsxs(l.Fragment,{children:[Na==="Completed"?l.jsx(Te,{analytics:A,onLoad:I=>{I.trackPageLoaded(V.Event.dashboard),Ke&&!Et&&I.trackTreasuryPromoView("Dashboard Promo Video")}}):null,l.jsx(ss,{maxColumns:e?2:void 0,isAiCfoAccessEnabled:C,onAskAiCfoClick:d,onDragAndDropCard:(I,Ka)=>{const Tt=function(Pe,qe,Be){const Ze=Be.indexOf(Pe),He=Be.indexOf(qe);if(Ze===-1||He===-1||Ze===He)return Be;const Je=[...Be];return Je.splice(Ze,1),Je.splice(He,0,Pe),Je}(I,Ka,ie.cardsOrdered);Tt.some((Pe,qe)=>Pe!==ie.cardsOrdered[qe])&&n(Mn(Tt))},dashboardReport:ie,passedCardsOrdered:ie.cardsForDashboardUI,tenantId:y,companyId:F,tenantEmailDomain:m,location:o,navigate:t,isApAgingFeatureEnabled:E,isArAgingFeatureEnabled:fe,isBillPayEnabled:wa,isReimbursementEnabled:Ta,isSummaryCardsFiltered:Ne,isForecastOn:Ya,selectedForecastOnDashboard:Va,isVisitingFirstTime:f,isZeniAccountEnabled:Fe,isRewardsFeatureEnabled:kt,hasZeniAccountsAdminAccess:Oa,isExpenseAutomationEnabledForUser:T&&ze===!1,selectedPeriod:Ea[y],isChargeCardFeatureEnabled:ka,isUserHasCardsAccess:Ra,isUserHasTreasuryAccess:ja,cardsCreditLimit:La,cashbackRate:va,isInterestedInChargeCard:Ma,cardBalanceFetchState:Ga,christmasAnimationEnabled:Sa,newYearAnimationEnabled:ya,treasuryFundDetails:Ua,hasUserSeenTreasuryVideo:Et,treasuryFetchState:xa})]})}const is=e=>{switch(e){case"operating_expenses":return"Operating Expenses";case"revenue":return"Revenues";case"top_expenses":return"Top Expenses";case"net_burn_or_income":return"Burn Rate";case"cash_in_cash_out":return"Cash In, Cash Out";case"cash_position":return"Cash Position"}return"Dashboard"},cs=e=>e.fetchState!=="Error"?e.fetchState:e.reportsInOrder.map(a=>a.fetchState).reduce((a,t)=>a==="In-Progress"||a==="Not-Started"?a:t);function js(){const e=we(),a=e?.excludedResources?.find(f=>f.resource==="/reports/top_expenses")==null,{useFeatureGate:t}=Ye(),{isFeatureEnabled:n}=t(M.isApAgingFeatureEnabled),{isFeatureEnabled:o}=t(M.isArAgingFeatureEnabled),r=k(f=>L(f)),{isFeatureEnabled:s}=t(M.isDebitCardFeatureEnabled),i=Qn(s,r),u=Xn(r);return i===!0||u===!0?l.jsx(nt,{children:l.jsx(D,{path:"/*",element:l.jsx(_o,{})})}):l.jsxs(nt,{children:[l.jsx(D,{path:"/",element:l.jsx(rs,{})}),l.jsx(D,{path:"cash_balance/*",element:l.jsx(Pt,{})}),l.jsx(D,{path:"card_balance/*",element:l.jsx(Pt,{})}),l.jsx(D,{path:"operating_expenses/*",element:l.jsx(Q,{})}),l.jsx(D,{path:"operating_expenses/forecast/*",element:l.jsx(Qe,{})}),l.jsx(D,{path:"revenue/forecast/*",element:l.jsx(Qe,{})}),l.jsx(D,{path:"revenue/*",element:l.jsx(Q,{})}),l.jsx(D,{path:"net_burn_or_income/forecast/*",element:l.jsx(Qe,{})}),l.jsx(D,{path:"net_burn_or_income/*",element:l.jsx(Q,{})}),n===!0&&l.jsxs(l.Fragment,{children:[l.jsx(D,{path:"accounts_payable_aging/*",element:l.jsx(yo,{})}),l.jsx(D,{path:"accounts_payable_aging/:vendorId/:reportDate/*",element:l.jsx(So,{})})]}),o&&l.jsxs(l.Fragment,{children:[l.jsx(D,{path:"accounts_receivable_aging/:customerId/:reportDate/*",element:l.jsx(vo,{})}),l.jsx(D,{path:"accounts_receivable_aging/*",element:l.jsx(Io,{})})]}),l.jsx(D,{path:"cash_position/*",element:l.jsx(Q,{})}),l.jsx(D,{path:"top_expenses/*",element:a===!0?l.jsx(Q,{}):l.jsx(Se,{})}),l.jsx(D,{path:"cash_in_cash_out/*",element:l.jsx(Q,{})}),l.jsx(D,{path:"company_details",element:l.jsx(Co,{})}),l.jsx(D,{path:"referrals/*",element:l.jsx(ko,{})}),l.jsx(D,{path:"*",element:l.jsx(Se,{})})]})}export{js as default};
@@ -1 +1 @@
1
- import{j as v}from"./liveblocks-BeS4QmMp.js";import{a as u}from"./sentry-BlmJH5WH.js";import{h as y,g as b,k as w,u as A,N}from"./core-DcM32IW_.js";import{Ig as k,eN as _,fi as U,Ih as L,ml as R,Ii as z}from"./zeni-epic-state-ChnjRetZ.js";import{u as O,z as f,L as T,t as S,D as $,b as j}from"./index-DSBNuTzQ.js";import"./mui--qrGbwFJ.js";import{t as P}from"./getLocaleForTenant-h7G676lL.js";import"./recharts-DoWl4vaN.js";import"./analytics-ByrfXPqG.js";import"./plaid-BZ0BFqP0.js";import"./dnd-36WXho_9.js";import"./stripe-DMRn4zHo.js";import"./lottie-Bdncx-qB.js";import"./lexical-CYAYrhLa.js";import"./pdf-6nmWWkz8.js";import"./utils-RmRP6xA4.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]="25aa12d1-2af3-4507-9532-9acbfc7286e2",t._sentryDebugIdIdentifier="sentry-dbid-25aa12d1-2af3-4507-9532-9acbfc7286e2")}catch{}})();const Q=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,I=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,I=a.aiCfoEmailRefId??null);else{const l=E(i);l!=null?(c=`../${o.tenantEmailDomain}/${l}`,m="comingFromV2UrlPath",l==="ai-cfo/explore"&&a!=null&&(a.aiCfoQuestion!=null&&(d=a.aiCfoQuestion),a.aiCfoShouldSubmit==="true"&&(e=!0))):console.warn("Don't have access to previous path tenant!")}const x=j(c,p);return v.jsx(N,{to:x,replace:!0,state:{...r.state,origin:"",message:m,aiCfoInitialQuestion:d,aiCfoShouldSubmit:e,aiCfoRef:g,aiCfoEmailRefId:I}})}});function oe(){const t=y(),{setLoading:s,clearAllLoading:o}=O(),h=u.useRef(!1),r=u.useRef(!1),p=u.useRef(null),m=b(e=>k(e)),n=b(e=>e.tenantState.fetchState),i=b(e=>e.tenantState.error),a=b(e=>e.tenantState.activeTenantFetchState.fetchState),c=b(e=>_(e)),d=f.getSignedInUser();return u.useLayoutEffect(()=>{const e=f.getActiveTenantForUser()?.tenantId??null;p.current!==e&&(p.current=e,h.current=!1,r.current=!1,s(T.TENANT_FETCHING)),!h.current||a!=="Completed"&&a!=="Error"||(h.current=!1),!r.current||n!=="Completed"&&n!=="Error"||(r.current=!1)},[a,n]),u.useEffect(()=>{const e=f.getActiveTenantForUser()?.tenantId;h.current===!1&&d!=null&&e!=null&&S.shouldFetchActiveTenant(e)&&(h.current=!0,S.markActiveTenantFetchStarted(e),n==="Completed"||a!=="Not-Started"&&a!=="Error"||(s(T.TENANT_FETCHING),t(U(d.userId,e))))},[n,a,d,t]),u.useEffect(()=>{const e=f.getSignedInUser(),g=f.getActiveTenantForUser()?.tenantId,I=g==null||a==="Completed"||a==="Error";r.current===!1&&e!=null&&I&&S.shouldFetchAllTenants()&&(r.current=!0,S.markAllTenantsFetchStarted(),(n==="Not-Started"||n==="Error"&&!L(i))&&t(R(e.userId)))},[n,a,i,d,t]),u.useEffect(()=>{f.isSignedIn()&&n==="Completed"&&m.tenantsCoreDetailsInOrder.length>0&&(f.saveSignedInUserTenants(m.tenantsCoreDetailsInOrder),o())},[m.tenantsCoreDetailsInOrder,n]),u.useEffect(()=>{!f.isSignedIn()||n!=="Completed"&&a!=="Completed"||c==null||($.updateAppLocaleID(P(c)),o())},[n,a,c]),v.jsx(Q,{})}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"],G={"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 G[s]}export{oe as default};
1
+ import{j as v}from"./liveblocks-tcXs1fes.js";import{a as u}from"./sentry-DNuKG-9f.js";import{h as y,g as b,k as w,u as A,N}from"./core-DkPdadc6.js";import{Ig as k,eN as _,fi as U,Ih as L,ml as R,Ii as z}from"./zeni-epic-state-CSoWjbAn.js";import{u as O,z as f,L as T,t as S,D as $,b as j}from"./index-CpD5ML2i.js";import"./mui-DbdGpDJj.js";import{t as P}from"./getLocaleForTenant-FjCgXmXO.js";import"./recharts-D0a4NFa9.js";import"./analytics-CcGmsyc8.js";import"./plaid-UeHpA8su.js";import"./dnd-D-YvLFfj.js";import"./stripe-DMRn4zHo.js";import"./lottie-CwApzZxI.js";import"./lexical-Sc7rk4Y7.js";import"./pdf-DG2fyOfp.js";import"./utils-BmJyX3cx.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]="25aa12d1-2af3-4507-9532-9acbfc7286e2",t._sentryDebugIdIdentifier="sentry-dbid-25aa12d1-2af3-4507-9532-9acbfc7286e2")}catch{}})();const Q=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,I=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,I=a.aiCfoEmailRefId??null);else{const l=E(i);l!=null?(c=`../${o.tenantEmailDomain}/${l}`,m="comingFromV2UrlPath",l==="ai-cfo/explore"&&a!=null&&(a.aiCfoQuestion!=null&&(d=a.aiCfoQuestion),a.aiCfoShouldSubmit==="true"&&(e=!0))):console.warn("Don't have access to previous path tenant!")}const x=j(c,p);return v.jsx(N,{to:x,replace:!0,state:{...r.state,origin:"",message:m,aiCfoInitialQuestion:d,aiCfoShouldSubmit:e,aiCfoRef:g,aiCfoEmailRefId:I}})}});function oe(){const t=y(),{setLoading:s,clearAllLoading:o}=O(),h=u.useRef(!1),r=u.useRef(!1),p=u.useRef(null),m=b(e=>k(e)),n=b(e=>e.tenantState.fetchState),i=b(e=>e.tenantState.error),a=b(e=>e.tenantState.activeTenantFetchState.fetchState),c=b(e=>_(e)),d=f.getSignedInUser();return u.useLayoutEffect(()=>{const e=f.getActiveTenantForUser()?.tenantId??null;p.current!==e&&(p.current=e,h.current=!1,r.current=!1,s(T.TENANT_FETCHING)),!h.current||a!=="Completed"&&a!=="Error"||(h.current=!1),!r.current||n!=="Completed"&&n!=="Error"||(r.current=!1)},[a,n]),u.useEffect(()=>{const e=f.getActiveTenantForUser()?.tenantId;h.current===!1&&d!=null&&e!=null&&S.shouldFetchActiveTenant(e)&&(h.current=!0,S.markActiveTenantFetchStarted(e),n==="Completed"||a!=="Not-Started"&&a!=="Error"||(s(T.TENANT_FETCHING),t(U(d.userId,e))))},[n,a,d,t]),u.useEffect(()=>{const e=f.getSignedInUser(),g=f.getActiveTenantForUser()?.tenantId,I=g==null||a==="Completed"||a==="Error";r.current===!1&&e!=null&&I&&S.shouldFetchAllTenants()&&(r.current=!0,S.markAllTenantsFetchStarted(),(n==="Not-Started"||n==="Error"&&!L(i))&&t(R(e.userId)))},[n,a,i,d,t]),u.useEffect(()=>{f.isSignedIn()&&n==="Completed"&&m.tenantsCoreDetailsInOrder.length>0&&(f.saveSignedInUserTenants(m.tenantsCoreDetailsInOrder),o())},[m.tenantsCoreDetailsInOrder,n]),u.useEffect(()=>{!f.isSignedIn()||n!=="Completed"&&a!=="Completed"||c==null||($.updateAppLocaleID(P(c)),o())},[n,a,c]),v.jsx(Q,{})}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"],G={"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 G[s]}export{oe as default};
@@ -1,4 +1,4 @@
1
- import{j as l}from"./liveblocks-BeS4QmMp.js";import{j as w,u as C,g as h,k as A,l as B}from"./core-DcM32IW_.js";import{Mc as k,Mj as _,fz as q,fy as J,fx as K,im as L,Jk as W,pv as Q,eN as V,LK as D,ik as T,Md as v,Mm as F,ii as G,iG as j}from"./zeni-epic-state-ChnjRetZ.js";import{bn as X,q as N,a as R,z as U,h as z,r as p,p as S,B as M,bo as Y,o as O,bp as ee,v as te}from"./index-DSBNuTzQ.js";import{n as Z}from"./mui--qrGbwFJ.js";import"./sentry-BlmJH5WH.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]="9058f4cd-2751-4ab8-9563-f272230b3de8",e._sentryDebugIdIdentifier="sentry-dbid-9058f4cd-2751-4ab8-9563-f272230b3de8")}catch{}})();const ne=A(null,function(e,t){return{onSaveVendor:n=>{e(L(t.vendorId!==void 0?t.vendorId:void 0,t.billId,void 0,t.isExpressPayPage)),e(W("common")),n!=null&&e(Q(n))},onGetOtp:n=>{e(K(n,"BillPayVendor"))},onResendOtp:n=>{e(J(n,"BillPayVendor"))},onVerifyOtp:(n,a)=>{e(q(n,a,"BillPayVendor"))},onVerifyOtpSuccess:(n,a,o)=>{e(_(n,a,o))}}})(X);function H({vendorId:e,billId:t,isExpressPayPage:n}){const a=w(),o=C(),s=h(i=>k(i,e));return l.jsx(ne,{location:o,navigate:a,vendorId:e,billId:t,vendorViewDetails:s,isExpressPayPage:n??!1})}const ae=Z.div`
1
+ import{j as l}from"./liveblocks-tcXs1fes.js";import{j as w,u as C,g as h,k as A,l as B}from"./core-DkPdadc6.js";import{Mc as k,Mj as _,fz as q,fy as J,fx as K,im as L,Jk as W,pv as Q,eN as V,LK as D,ik as T,Md as v,Mm as F,ii as G,iG as j}from"./zeni-epic-state-CSoWjbAn.js";import{bn as X,q as N,a as R,z as U,h as z,m as p,p as S,B as M,bo as Y,o as O,bp as ee,r as te}from"./index-CpD5ML2i.js";import{n as Z}from"./mui-DbdGpDJj.js";import"./sentry-DNuKG-9f.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]="af3de8e5-59cb-4615-8233-8f6be336ea0b",e._sentryDebugIdIdentifier="sentry-dbid-af3de8e5-59cb-4615-8233-8f6be336ea0b")}catch{}})();const ne=A(null,function(e,t){return{onSaveVendor:n=>{e(L(t.vendorId!==void 0?t.vendorId:void 0,t.billId,void 0,t.isExpressPayPage)),e(W("common")),n!=null&&e(Q(n))},onGetOtp:n=>{e(K(n,"BillPayVendor"))},onResendOtp:n=>{e(J(n,"BillPayVendor"))},onVerifyOtp:(n,a)=>{e(q(n,a,"BillPayVendor"))},onVerifyOtpSuccess:(n,a,o)=>{e(_(n,a,o))}}})(X);function H({vendorId:e,billId:t,isExpressPayPage:n}){const a=w(),o=C(),s=h(i=>k(i,e));return l.jsx(ne,{location:o,navigate:a,vendorId:e,billId:t,vendorViewDetails:s,isExpressPayPage:n??!1})}const ae=Z.div`
2
2
  display: flex;
3
3
  height: 100vh;
4
4
  width: 100%;
@@ -6,7 +6,7 @@ import{j as l}from"./liveblocks-BeS4QmMp.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(j(s))},onSaveHandler:s=>{e(G(t.bankAccountContext,s,"standard",o))},onCancel:()=>{(()=>{const s=p(a.state?.pathnameStackToGoBack),i=s.poppedPathname??P();n(i,{state:{pathnameStackToGoBack:s.newStack}})})(),e(v())},onACHDetailsUpdated:s=>{const{bankAccountSection:i}=s;e(F({data:i}))},onBackClick:()=>{if(e(T({fetchState:"Not-Started"})),t.bankAccountContext==="express-pay")n("../",{relative:"path"});else{const s=p(t.location.state?.pathnameStackToGoBack),i=s.poppedPathname??P(0);t.navigate(i,{state:{pathnameStackToGoBack:s.newStack}})}e(v())}}})(Y);function fe({vendorIdParam:e,accountContext:t}){const n=w(),a=C(),o=N(),{vendorId:s,billId:i}=B(),c=e??s,{useFeatureGate:r}=R(),d=U.getSignedInUser(),b=h(u=>V(u)),g=z(),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(d==null)throw Error("Can't access address page without signing in...");return f==="billDetail"&&m.editVendorState?.saveStatus.fetchState==="In-Progress"?l.jsx(M,{fetchState:m.editVendorState?.saveStatus.fetchState??"Not-Started",style:{backgroundColor:g.colors.grey5}}):l.jsxs(ae,{windowSize:o,children:[l.jsx(H,{vendorId:c,billId:i}),l.jsx(oe,{location:a,navigate:n,billId:i,vendorId:c,currentTenant:b,bankAccountContext:f,isVendorRecommendationEnabled:I,isZeniAccountsFeatureEnabled:y})]})}const P=(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},E=(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 E(e,"ach",t,n)}function Se(e,t,n){return E(e,"domestic",t,n)}function ge(e,t,n){return E(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=Z.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(j(s))},onSaveHandler:s=>{e(G(t.bankAccountContext,s,"standard",o))},onCancel:()=>{(()=>{const s=p(a.state?.pathnameStackToGoBack),i=s.poppedPathname??P();n(i,{state:{pathnameStackToGoBack:s.newStack}})})(),e(v())},onACHDetailsUpdated:s=>{const{bankAccountSection:i}=s;e(F({data:i}))},onBackClick:()=>{if(e(T({fetchState:"Not-Started"})),t.bankAccountContext==="express-pay")n("../",{relative:"path"});else{const s=p(t.location.state?.pathnameStackToGoBack),i=s.poppedPathname??P(0);t.navigate(i,{state:{pathnameStackToGoBack:s.newStack}})}e(v())}}})(Y);function fe({vendorIdParam:e,accountContext:t}){const n=w(),a=C(),o=N(),{vendorId:s,billId:i}=B(),d=e??s,{useFeatureGate:r}=R(),c=U.getSignedInUser(),b=h(u=>V(u)),g=z(),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(c==null)throw Error("Can't access address page without signing in...");return f==="billDetail"&&m.editVendorState?.saveStatus.fetchState==="In-Progress"?l.jsx(M,{fetchState:m.editVendorState?.saveStatus.fetchState??"Not-Started",style:{backgroundColor:g.colors.grey5}}):l.jsxs(ae,{windowSize:o,children:[l.jsx(H,{vendorId:d,billId:i}),l.jsx(oe,{location:a,navigate:n,billId:i,vendorId:d,currentTenant:b,bankAccountContext:f,isVendorRecommendationEnabled:I,isZeniAccountsFeatureEnabled:y})]})}const P=(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},E=(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 E(e,"ach",t,n)}function Se(e,t,n){return E(e,"domestic",t,n)}function ge(e,t,n){return E(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=Z.div`
10
10
  display: flex;
11
11
  height: 100vh;
12
12
  width: 100%;
@@ -15,4 +15,4 @@ import{j as l}from"./liveblocks-BeS4QmMp.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 ${O.sp1} ${e.theme.colors.dropShadowNormal}`};
18
- `,ie=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:i}=t,{tenantEmailDomain:c}=i;return{onFetchBankName:r=>{e(j(r))},onSaveHandler:r=>{e(G(t.bankAccountContext,r,"us-domestic",s))},onWireDetailsUpdated:r=>{const{bankAccountSection:d}=r;e(F({data:d}))},onCancel:()=>{(()=>{const r=p(o.state?.pathnameStackToGoBack),d=r.poppedPathname??$();a(d,{state:{pathnameStackToGoBack:r.newStack}})})(),e(v())},onAddressClick:r=>{if(t.bankAccountContext==="express-pay")a("./add-address");else{const d=se(c,r,n),b=te(o.state?.pathnameStackToGoBack,o.pathname);a(d,{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),d=r.poppedPathname??$(0);t.navigate(d,{state:{pathnameStackToGoBack:r.newStack}})}e(v())}}})(ee);function xe({vendorIdParam:e,accountContext:t}){const n=w(),a=C(),o=N(),{vendorId:s,billId:i}=B(),c=e??s,r=U.getSignedInUser(),{useFeatureGate:d}=R(),b=z(),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}=d(S.isVendorRecommendationFeatureEnabled),{isFeatureEnabled:y}=d(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(M,{fetchState:m.editVendorState?.saveStatus.fetchState??"Not-Started",style:{backgroundColor:b.colors.grey5,boxShadow:`0px 2px ${O.sp1} ${b.colors.dropShadowNormal}`}}):l.jsxs(re,{windowSize:o,children:[l.jsx(H,{vendorId:c,billId:i}),l.jsx(ie,{location:a,navigate:n,billId:i,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,H as V,me as a,se as b,ke as c,Se as d,he as g,ge as i,ve as v};
18
+ `,ie=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:i}=t,{tenantEmailDomain:d}=i;return{onFetchBankName:r=>{e(j(r))},onSaveHandler:r=>{e(G(t.bankAccountContext,r,"us-domestic",s))},onWireDetailsUpdated:r=>{const{bankAccountSection:c}=r;e(F({data:c}))},onCancel:()=>{(()=>{const r=p(o.state?.pathnameStackToGoBack),c=r.poppedPathname??$();a(c,{state:{pathnameStackToGoBack:r.newStack}})})(),e(v())},onAddressClick:r=>{if(t.bankAccountContext==="express-pay")a("./add-address");else{const c=se(d,r,n),b=te(o.state?.pathnameStackToGoBack,o.pathname);a(c,{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),c=r.poppedPathname??$(0);t.navigate(c,{state:{pathnameStackToGoBack:r.newStack}})}e(v())}}})(ee);function xe({vendorIdParam:e,accountContext:t}){const n=w(),a=C(),o=N(),{vendorId:s,billId:i}=B(),d=e??s,r=U.getSignedInUser(),{useFeatureGate:c}=R(),b=z(),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}=c(S.isVendorRecommendationFeatureEnabled),{isFeatureEnabled:y}=c(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(M,{fetchState:m.editVendorState?.saveStatus.fetchState??"Not-Started",style:{backgroundColor:b.colors.grey5,boxShadow:`0px 2px ${O.sp1} ${b.colors.dropShadowNormal}`}}):l.jsxs(re,{windowSize:o,children:[l.jsx(H,{vendorId:d,billId:i}),l.jsx(ie,{location:a,navigate:n,billId:i,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,H 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 c}from"./liveblocks-tcXs1fes.js";import{q as d,E as l,h as f}from"./index-CpD5ML2i.js";import{D as p}from"./mui-DbdGpDJj.js";import"./sentry-DNuKG-9f.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]="ec2bc9ec-0ace-462e-8f78-09350484a4a5",e._sentryDebugIdIdentifier="sentry-dbid-ec2bc9ec-0ace-462e-8f78-09350484a4a5")}catch{}})();const u={drawerLeftMargin:new l(0,0,240)};function h(e){const{isOpen:r,drawerLeftMargin:o,children:a,onClose:t}=e,n=d(),s=o?.valuePx(n)??u.drawerLeftMargin.valuePx(n),i=f();return c.jsx(p,{anchor:"right",open:r,PaperProps:{style:{width:`calc(100% - ${s})`}},slotProps:{backdrop:{style:{backgroundColor:i.colors.black,opacity:.8,cursor:"pointer"}}},onClose:t,children:a})}export{h as D};
@@ -1 +1 @@
1
- import{j as s}from"./liveblocks-BeS4QmMp.js";import{a as d}from"./sentry-BlmJH5WH.js";import{j as A,h as B,u as J,l as q,g as l,N,k as F,n as W,o as _}from"./core-DcM32IW_.js";import{Kr as z,eN as O,JQ as K,kq as M,Gz as I,Kw as R,Jj as V,jq as Y,GA as S,JV as $,JW as Q,Jl as H,Jk as L}from"./zeni-epic-state-ChnjRetZ.js";import{aN as U,d as X,r as Z,v as tt}from"./index-DSBNuTzQ.js";import"./mui--qrGbwFJ.js";import{d as k}from"./decodeURIComponentSafe-mAxyJdJ8.js";import{w as et}from"./withTransactionSidePanel-ClKqbF5a.js";import{e as at,b as nt}from"./routePaths-Dr0mF--c.js";import"./recharts-DoWl4vaN.js";import"./analytics-ByrfXPqG.js";import"./plaid-BZ0BFqP0.js";import"./dnd-36WXho_9.js";import"./stripe-DMRn4zHo.js";import"./lottie-Bdncx-qB.js";import"./lexical-CYAYrhLa.js";import"./pdf-6nmWWkz8.js";import"./utils-RmRP6xA4.js";import"./useAskAiCfoHostNavButtonProps-DDxvherx.js";import"./useFetchSuggestedQuestionsWhenReady-SU-quGCv.js";import"./TransactionDetailScreen-uOgH9UNp.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]="6c9f5809-a154-48d0-a5b7-7858560d0c4c",a._sentryDebugIdIdentifier="sentry-dbid-6c9f5809-a154-48d0-a5b7-7858560d0c4c")}catch{}})();const ot=F(function(a,t){const e=t.entity,o=R(a,t.entity,"EntityDetail");return{selectedEntity:e,autoCompleteData:{autoCompleteText:e.name,entityAutoCompleteView:V(a,"common")},trendWithTransactionsReport:o,analytics:X,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(H({searchString:e,searchOrigin:"common"})):e.trim().length===0&&a(L("common"))},onAutoCompleteEntity:e=>{const o=at(e,t.tenantEmailDomain);a($()),a(Q()),t.resetTrendIsFetchedStates(),t.navigate(o,{replace:!0,state:{pathnameStackToGoBack:t.location.state?.pathnameStackToGoBack}})},onCancelAutoComplete:()=>{const e=Z(t.location.state?.pathnameStackToGoBack),o=e.poppedPathname??b();t.navigate(o,{state:{pathnameStackToGoBack:e.newStack}})}},onTrendSelectedPeriodChange:e=>{if(t.closeSidePanel?.(),e==null)t.defaultTransactionTimePeriod!=null&&a(S(t.entity,"EntityDetail",{timeframe:"quarter",timePeriod:t.defaultTransactionTimePeriod}));else{const o=e.currentTimePeriod==null?e.addTimePeriod:{startDate:e.addTimePeriod.startDate,endDate:e.currentTimePeriod.endDate};a(I(t.entity,"EntityDetail",{timeframe:e.timeframe,timePeriod:e.addTimePeriod})),a(S(t.entity,"EntityDetail",{timeframe:e.timeframe,timePeriod:o}))}}}})(U),it=et(function({entityType:a,...t}){const e=A(),o=B(),c=J(),[m,T]=d.useState(!1),[h,D]=d.useState(!1),{tenantEmailDomain:C,entityIdEncoded:j,entityNameEncoded:w}=q(),r=k(j??""),p=k(w??""),u=rt(r,p),x=[r,p].filter(n=>n!=null),i={name:p,id:r,type:a,zeniId:r,qboId:r},g=l(n=>z(n.customerIncomeState,n.vendorExpenseState,n.trendState,i,"quarter")),G=l(n=>O(n).company?.companyInfo.firstMonthOfFY??1),f=l(n=>K(n.trendWithTransactionsState,i,"EntityDetail"));d.useEffect(()=>{m===!1&&u===!0&&(T(!0),o(M(i)))},[m,u,i]);const E=l(n=>n.trendState.fetchState),P=f?.selectedPeriod?.timePeriod??g,v=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(I(i,"EntityDetail",{timeframe:f?.selectedPeriod?.timeframe??"quarter",timePeriod:P})))},[m,h,E]),u?s.jsx(ot,{firstMonthOfFY:G,tenantEmailDomain:C,location:c,navigate:e,entity:i,defaultTransactionTimePeriod:v,resetTrendIsFetchedStates:()=>{T(!1),D(!1)},...t}):s.jsx(N,{to:b(x.length)})}),rt=(a,t)=>t!=null&&t.length>0&&a!=null&&a.length>0,b=(a=2)=>{let t="../";for(let e=0;e<a;e++)t=`${t}../`;return t};function wt({entityType:a}){return s.jsx(W,{children:s.jsx(_,{path:"/:entityIdEncoded/:entityNameEncoded/*",element:s.jsx(it,{entityType:a})})})}export{wt as EntityDetailRoutes,wt as default};
1
+ import{j as s}from"./liveblocks-tcXs1fes.js";import{a as d}from"./sentry-DNuKG-9f.js";import{j as A,h as B,u as J,l as q,g as l,N,k as F,n as W,o as _}from"./core-DkPdadc6.js";import{Kr as z,eN as O,JQ as K,kq as M,Gz as k,Kw as R,Jj as V,jq as Y,GA as S,JV as $,JW as Q,Jl as H,Jk as L}from"./zeni-epic-state-CSoWjbAn.js";import{aN as U,d as X,m as Z,r as tt}from"./index-CpD5ML2i.js";import"./mui-DbdGpDJj.js";import{d as b}from"./decodeURIComponentSafe-h3wJzOm1.js";import{w as et}from"./withTransactionSidePanel-CzkV98Uv.js";import{e as at,b as nt}from"./routePaths-D7wc65Bl.js";import"./recharts-D0a4NFa9.js";import"./analytics-CcGmsyc8.js";import"./plaid-UeHpA8su.js";import"./dnd-D-YvLFfj.js";import"./stripe-DMRn4zHo.js";import"./lottie-CwApzZxI.js";import"./lexical-Sc7rk4Y7.js";import"./pdf-DG2fyOfp.js";import"./utils-BmJyX3cx.js";import"./useAskAiCfoHostNavButtonProps-BtZXhZ4f.js";import"./useFetchSuggestedQuestionsWhenReady-Bhmav9DR.js";import"./TransactionDetailScreen-BARgRHWT.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]="d4d39ae9-5260-49a0-bbbc-f57aabd4327d",a._sentryDebugIdIdentifier="sentry-dbid-d4d39ae9-5260-49a0-bbbc-f57aabd4327d")}catch{}})();const ot=F(function(a,t){const e=t.entity,o=R(a,t.entity,"EntityDetail");return{selectedEntity:e,autoCompleteData:{autoCompleteText:e.name,entityAutoCompleteView:V(a,"common")},trendWithTransactionsReport:o,analytics:X,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(H({searchString:e,searchOrigin:"common"})):e.trim().length===0&&a(L("common"))},onAutoCompleteEntity:e=>{const o=at(e,t.tenantEmailDomain);a($()),a(Q()),t.resetTrendIsFetchedStates(),t.navigate(o,{replace:!0,state:{pathnameStackToGoBack:t.location.state?.pathnameStackToGoBack}})},onCancelAutoComplete:()=>{const e=Z(t.location.state?.pathnameStackToGoBack),o=e.poppedPathname??I();t.navigate(o,{state:{pathnameStackToGoBack:e.newStack}})}},onTrendSelectedPeriodChange:e=>{if(t.closeSidePanel?.(),e==null)t.defaultTransactionTimePeriod!=null&&a(S(t.entity,"EntityDetail",{timeframe:"quarter",timePeriod:t.defaultTransactionTimePeriod}));else{const o=e.currentTimePeriod==null?e.addTimePeriod:{startDate:e.addTimePeriod.startDate,endDate:e.currentTimePeriod.endDate};a(k(t.entity,"EntityDetail",{timeframe:e.timeframe,timePeriod:e.addTimePeriod})),a(S(t.entity,"EntityDetail",{timeframe:e.timeframe,timePeriod:o}))}}}})(U),it=et(function({entityType:a,...t}){const e=A(),o=B(),c=J(),[m,T]=d.useState(!1),[h,D]=d.useState(!1),{tenantEmailDomain:C,entityIdEncoded:j,entityNameEncoded:w}=q(),r=b(j??""),p=b(w??""),u=rt(r,p),x=[r,p].filter(n=>n!=null),i={name:p,id:r,type:a,zeniId:r,qboId:r},g=l(n=>z(n.customerIncomeState,n.vendorExpenseState,n.trendState,i,"quarter")),G=l(n=>O(n).company?.companyInfo.firstMonthOfFY??1),f=l(n=>K(n.trendWithTransactionsState,i,"EntityDetail"));d.useEffect(()=>{m===!1&&u===!0&&(T(!0),o(M(i)))},[m,u,i]);const E=l(n=>n.trendState.fetchState),P=f?.selectedPeriod?.timePeriod??g,v=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(k(i,"EntityDetail",{timeframe:f?.selectedPeriod?.timeframe??"quarter",timePeriod:P})))},[m,h,E]),u?s.jsx(ot,{firstMonthOfFY:G,tenantEmailDomain:C,location:c,navigate:e,entity:i,defaultTransactionTimePeriod:v,resetTrendIsFetchedStates:()=>{T(!1),D(!1)},...t}):s.jsx(N,{to:I(x.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 wt({entityType:a}){return s.jsx(W,{children:s.jsx(_,{path:"/:entityIdEncoded/:entityNameEncoded/*",element:s.jsx(it,{entityType:a})})})}export{wt as EntityDetailRoutes,wt as default};