@zeniai/web-app-ui 5.1.52-qa → 5.1.53-qa

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (121) hide show
  1. package/dist/assets/AddressRoutes-BA_Za0FR.js +1 -0
  2. package/dist/assets/AddressScreen-BrXKW3BZ.js +9 -0
  3. package/dist/assets/{AiCfoScreen-CRoxnDRU.js → AiCfoScreen-C3s-4Li8.js} +5 -5
  4. package/dist/assets/{BillPayApprovalRoutes-BWlPp4gg.js → BillPayApprovalRoutes-C0HhO8Zq.js} +1 -1
  5. package/dist/assets/{BillPayRoutes-BcERL4gz.js → BillPayRoutes-DL446uHm.js} +1 -1
  6. package/dist/assets/{BusinessVerificationPageScreen-DWX7ySZI.js → BusinessVerificationPageScreen-BxP_dHBq.js} +2 -2
  7. package/dist/assets/{CardsAiCfoScreen-DEKa5Xew.js → CardsAiCfoScreen-DCEvVdt-.js} +1 -1
  8. package/dist/assets/{ChargeCardRoutes-FSWFOO49.js → ChargeCardRoutes-BLCb8cIx.js} +10 -10
  9. package/dist/assets/CompanyPassportScreen-CkDV3dle.js +1 -0
  10. package/dist/assets/{ConnectionAuthScreen-DDK9ow_u.js → ConnectionAuthScreen-BlDRBSBs.js} +1 -1
  11. package/dist/assets/CustomerOnboardingAuthScreen-ClDUuER9.js +1 -0
  12. package/dist/assets/{CustomerOnboardingRoutes-BdqZkh_s.js → CustomerOnboardingRoutes-BySm8MfB.js} +5 -5
  13. package/dist/assets/{DashboardRoutes-BGmqy8sI.js → DashboardRoutes-CEgHKVmd.js} +3 -3
  14. package/dist/assets/{DefaultTenantHome-dUxiOroS.js → DefaultTenantHome-9fk_ObXB.js} +1 -1
  15. package/dist/assets/DomesticWireDetailScreen-DCT2WFO9.js +18 -0
  16. package/dist/assets/DrawerScreen-DAhJy05e.js +1 -0
  17. package/dist/assets/{EntityDetailRoutes-VUYCsTyx.js → EntityDetailRoutes-DOcGH-23.js} +1 -1
  18. package/dist/assets/{ExpenseAutomationRoutes-Baf_deUk.js → ExpenseAutomationRoutes-CJpBRsLy.js} +3 -3
  19. package/dist/assets/FeaturePreviewScreen-h089v0nG.js +1 -0
  20. package/dist/assets/{HubSpotOAuthCallbackScreen-DLXvcbO1.js → HubSpotOAuthCallbackScreen-Bx79fA6b.js} +1 -1
  21. package/dist/assets/MagicLinkRoutes-DvqPr1uQ.js +72 -0
  22. package/dist/assets/MagicLinkSignInScreen-YSubZawb.js +12 -0
  23. package/dist/assets/{MobileAppDrawer-BzOopfIc.js → MobileAppDrawer-B8b7sXqB.js} +1 -1
  24. package/dist/assets/NotFoundScreen-C5grvltN.js +1 -0
  25. package/dist/assets/{NotificationRoutes-BfWTxi_L.js → NotificationRoutes-kB86UiyF.js} +1 -1
  26. package/dist/assets/OAuthConsentScreen-DNPWtBCU.js +1 -0
  27. package/dist/assets/PandLWithForecastRoutes-E2IJx1NW.js +1 -0
  28. package/dist/assets/{PeopleRoutes-Cd2xa-tF.js → PeopleRoutes-DtPRAphk.js} +4 -4
  29. package/dist/assets/PerformanceRoutes-DR3r_m80.js +1 -0
  30. package/dist/assets/{Preview-BBgrn4cd.js → Preview-L8h-Ibqx.js} +1 -1
  31. package/dist/assets/{QBOConnectionScreen-DiXbUmxS.js → QBOConnectionScreen-l87oL02a.js} +1 -1
  32. package/dist/assets/{ReferralListScreen-BFHfgY0C.js → ReferralListScreen-XtU4H9R4.js} +2 -2
  33. package/dist/assets/{ReimbursementApprovalRoutes-BYBFJrYx.js → ReimbursementApprovalRoutes-BZBu7fQ8.js} +1 -1
  34. package/dist/assets/{ReimbursementApprovalRuleDetailScreen-DiIBy_Kn.js → ReimbursementApprovalRuleDetailScreen-ByIZjgyO.js} +1 -1
  35. package/dist/assets/{ReimbursementRoutes-Byj4p7dn.js → ReimbursementRoutes-B0Rnpw8O.js} +4 -4
  36. package/dist/assets/{ReportsRoutes-urJtOHDo.js → ReportsRoutes-CnhRcEBw.js} +1 -1
  37. package/dist/assets/RewardsRoutes-kojWdGBy.js +1 -0
  38. package/dist/assets/{ScreenRoutes-DgHGyuTa.js → ScreenRoutes-dCkGsbaX.js} +2 -2
  39. package/dist/assets/{SettingsRoutes-B9XEOz3c.js → SettingsRoutes-B_DWLARM.js} +1 -1
  40. package/dist/assets/{SetupPagesScreen-DiqU6iZv.js → SetupPagesScreen-CoEYpzVD.js} +4 -4
  41. package/dist/assets/SignInScreen-D-GiwcO7.js +1 -0
  42. package/dist/assets/{SignOutScreen-BcKxVgCr.js → SignOutScreen-KgU4ADq9.js} +1 -1
  43. package/dist/assets/{TaskListScreen-CIIrTWF0.js → TaskListScreen-DR1N5MLz.js} +2 -2
  44. package/dist/assets/{TaskRoutes-C3BwKdkV.js → TaskRoutes-DzW21iLL.js} +2 -2
  45. package/dist/assets/{TransactionDetailRoutes-L60jmvh4.js → TransactionDetailRoutes-wUBvx13S.js} +1 -1
  46. package/dist/assets/{TransactionDetailScreen-BHKf3UvG.js → TransactionDetailScreen-SbXBU7LB.js} +2 -2
  47. package/dist/assets/{TransactionListRoutes-B8V8eaVr.js → TransactionListRoutes-BmJWlLYy.js} +1 -1
  48. package/dist/assets/{TreasuryRoutes-BIv9NJIQ.js → TreasuryRoutes-CiX59e1b.js} +5 -5
  49. package/dist/assets/{VendorsRoutes-CInyDoSC.js → VendorsRoutes-BTJDHiaX.js} +1 -1
  50. package/dist/assets/WiseConfirmationScreen-B8PpSiXI.js +12 -0
  51. package/dist/assets/{ZeniAccountRoutes-CbhJXy_a.js → ZeniAccountRoutes-Bye-oBEL.js} +13 -13
  52. package/dist/assets/ZeniAccountStatementScreen-DwjBXO74.js +9 -0
  53. package/dist/assets/{accountMappingHelper-DoYWzqd9.js → accountMappingHelper-BwC4ZXQT.js} +1 -1
  54. package/dist/assets/{analytics-DVTbnjlr.js → analytics-BpWjaxbv.js} +1 -1
  55. package/dist/assets/{analyticsHelper-CfMFPPIh.js → analyticsHelper-VUlrCZ3f.js} +1 -1
  56. package/dist/assets/{core-k_c8SCBE.js → core-Cj3sxYL7.js} +1 -1
  57. package/dist/assets/{decodeURIComponentSafe-ClSfwHJC.js → decodeURIComponentSafe-CyYkfiHv.js} +1 -1
  58. package/dist/assets/{dnd-CKEs-Nbe.js → dnd-WLAr-qfO.js} +1 -1
  59. package/dist/assets/{empty-rBU__xZH.js → empty-DFc-bsca.js} +1 -1
  60. package/dist/assets/{empty-CaaFsHZq.js → empty-rEpgHEWF.js} +1 -1
  61. package/dist/assets/{emptyVideoElement-BiPjnR5F.js → emptyVideoElement-ClAxGPrQ.js} +1 -1
  62. package/dist/assets/{epic-BY3t4hzo.js → epic-B2EfNSKx.js} +1 -1
  63. package/dist/assets/getLocaleForTenant-ChWLNTj3.js +1 -0
  64. package/dist/assets/{index-C9JBC9EP.js → index-2KyAy7Zy.js} +1 -1
  65. package/dist/assets/{index-B0M_M2si.js → index-B5wYRZoC.js} +1 -1
  66. package/dist/assets/{index-D7n4W-6R.js → index-BW1XqAyr.js} +1 -1
  67. package/dist/assets/{index-CrxfuqRy.js → index-BftEKN_-.js} +2 -2
  68. package/dist/assets/{index-CBl-jehm.js → index-BhXRaXnd.js} +1 -1
  69. package/dist/assets/{index-B4wUHn-k.js → index-C_Y0yMPY.js} +1752 -1762
  70. package/dist/assets/{index-_Ds-L3qG.js → index-DUBqop-_.js} +1 -1
  71. package/dist/assets/{index-CAPOi0Fj.js → index-e7I5m4bW.js} +1 -1
  72. package/dist/assets/{lexical-k-PQZXkn.js → lexical--OluaPRa.js} +1 -1
  73. package/dist/assets/{liveblocks-D3ESVZyk.js → liveblocks-DmbDY3sa.js} +1 -1
  74. package/dist/assets/{lottie-BYni7Ovk.js → lottie-W8sR2m8i.js} +1 -1
  75. package/dist/assets/{mui-UJrLjp1k.js → mui-1V4hRqCa.js} +1 -1
  76. package/dist/assets/{pathToGoBack-D0Z5Ycmy.js → pathToGoBack-PTW4YbNu.js} +1 -1
  77. package/dist/assets/{pdf-CaeTpLUv.js → pdf-aJCOHARS.js} +3 -3
  78. package/dist/assets/{pdf-lib-Cgly_u4z.js → pdf-lib-ovfXHDuI.js} +1 -1
  79. package/dist/assets/{plaid-B1j5PXHV.js → plaid-JtkXopjw.js} +1 -1
  80. package/dist/assets/{pusher-IzmLENf0.js → pusher-CHPQmkEo.js} +1 -1
  81. package/dist/assets/{react-RV2byy3l.js → react-6mQxD1Me.js} +1 -1
  82. package/dist/assets/{react-BPazXlgj.js → react-BdMLdzsp.js} +1 -1
  83. package/dist/assets/{react-BhDdWL-M.js → react-CA6ko42q.js} +1 -1
  84. package/dist/assets/{react-Cbn9UGi3.js → react-CU-y_lik.js} +1 -1
  85. package/dist/assets/{react-iNsCZPRe.js → react-Ch-GNhUs.js} +1 -1
  86. package/dist/assets/{react-D9CNJCXY.js → react-GL1Pyhji.js} +1 -1
  87. package/dist/assets/{recharts-Q-kkTNuO.js → recharts-mFhBBFnU.js} +1 -1
  88. package/dist/assets/{routePaths-ooqctjvV.js → routePaths-D0rLO8yN.js} +1 -1
  89. package/dist/assets/{sentry-B_92GPgU.js → sentry--Yi43Gx7.js} +1 -1
  90. package/dist/assets/{url-CGw_V4gG.js → url-10vNaoth.js} +1 -1
  91. package/dist/assets/{url-DLQKrj-e.js → url-C6HCkI0M.js} +1 -1
  92. package/dist/assets/{useAiCfoDashboardSuggestedQuestionsChips-Cx3WWldL.js → useAiCfoDashboardSuggestedQuestionsChips-CSjDWCVT.js} +1 -1
  93. package/dist/assets/useAskAiCfoHostNavButtonProps-OU79nJF1.js +1 -0
  94. package/dist/assets/useCashManagementBanner-D7ux4QIE.js +1 -0
  95. package/dist/assets/{useDeviceId-BE1s-3Wf.js → useDeviceId-n-Ow0WdN.js} +1 -1
  96. package/dist/assets/{useInitialThreadRequest-C_cJhQDA.js → useInitialThreadRequest-C_e7mvD1.js} +1 -1
  97. package/dist/assets/{utils-Mjhh9T8E.js → utils-Bt5dYICv.js} +1 -1
  98. package/dist/assets/{withTransactionSidePanel-3cc8um6s.js → withTransactionSidePanel-8QHjmr16.js} +2 -2
  99. package/dist/assets/{zeni-epic-state-C3zBO1No.js → zeni-epic-state-BG_x9wwl.js} +5 -5
  100. package/dist/index.html +1 -1
  101. package/package.json +3 -3
  102. package/dist/assets/AddressRoutes-odXkPzQ0.js +0 -1
  103. package/dist/assets/AddressScreen-BJ-IOcKb.js +0 -9
  104. package/dist/assets/CompanyPassportScreen-CrpUoXvt.js +0 -1
  105. package/dist/assets/CustomerOnboardingAuthScreen-CDJwl_XS.js +0 -1
  106. package/dist/assets/DomesticWireDetailScreen-BA2EKhEI.js +0 -18
  107. package/dist/assets/DrawerScreen-BSfM66hM.js +0 -1
  108. package/dist/assets/FeaturePreviewScreen-DoKDdD4M.js +0 -1
  109. package/dist/assets/MagicLinkRoutes-NK00hAHs.js +0 -72
  110. package/dist/assets/MagicLinkSignInScreen-DnxlEFNW.js +0 -12
  111. package/dist/assets/NotFoundScreen-6vyCFr5S.js +0 -1
  112. package/dist/assets/OAuthConsentScreen-DKtWI-tp.js +0 -1
  113. package/dist/assets/PandLWithForecastRoutes-DgT8jx_6.js +0 -1
  114. package/dist/assets/PerformanceRoutes-xYB_POFo.js +0 -1
  115. package/dist/assets/RewardsRoutes-CHiDiriW.js +0 -1
  116. package/dist/assets/SignInScreen-DqVi8QMM.js +0 -1
  117. package/dist/assets/WiseConfirmationScreen-DmiV73IN.js +0 -12
  118. package/dist/assets/ZeniAccountStatementScreen-BuDvio8F.js +0 -9
  119. package/dist/assets/getLocaleForTenant-CTwYyvWj.js +0 -1
  120. package/dist/assets/useAskAiCfoHostNavButtonProps-BJGg886y.js +0 -1
  121. package/dist/assets/useCashManagementBanner-Cjm3Ayi5.js +0 -1
@@ -1,11 +1,11 @@
1
- import{j as h}from"./liveblocks-D3ESVZyk.js";import oa from"./NotFoundScreen-6vyCFr5S.js";import{a as o,b as Yt}from"./sentry-B_92GPgU.js";import{n as Ue,S as sa}from"./mui-UJrLjp1k.js";import{u as pe,h as Jt,g as Ke,j as x,n as ca,i as xt,o as ia,p as Ge}from"./core-k_c8SCBE.js";import{eW as Re,Sz as la,of as Ee,fz as ra,s0 as da,ox as Kt,oS as Qt,SA as Zt,p0 as ua,SB as Ht,oq as ma,ry as pa,fj as Ie,SC as De,t_ as Wt,E7 as Xt,SD as en,SE as ha,r6 as Qe,NO as Pt,NQ as Sa,kv as ga,NR as Ca,kC as fa,c_ as Ia,va as Ze,oD as tn,p5 as Fe,ov as de,SF as Ea,MG as Rt,MF as we,SG as Dt,kT as ka,SH as ya,SI as ba,SJ as Ta,SK as va,oK as Aa,p8 as xe,SL as wa,SM as xa,SN as Pa,pf as Ra,kG as Da,kx as Fa,SO as Ua,kF as Ft,NY as Ba,SP as Va,SQ as _a,r2 as Oa,qG as za,p6 as me,qF as Ne,SR as Ma,SS as ja,ST as La,ma as $a,bq as qa,m5 as Ut,lT as Ga,SU as Na,f9 as Bt,gw as Ya,m2 as Ja,x3 as Ka,SV as Qa,pG as Za,pB as Ha,pF as Wa,pq as Xa,SW as eo,fm as nn,oV as to,oG as no,fA as Vt,pa as ao,SX as oo,SY as so,p7 as an,SZ as co,S_ as io,S$ as lo,T0 as ro,T1 as _t,re as uo,qx as mo,ME as po,T2 as ho,T3 as So,kE as go,T4 as Co,IP as fo,kD as Io,ks as Eo,fl as ko,q3 as on,qp as yo,p4 as Ot,p9 as bo,bE as To,l$ as vo,lY as Ao,T5 as wo,pp as zt,ql as Mt,qj as xo,T6 as Po,q8 as Ro,pQ as Do,qm as Fo,T7 as Uo,T8 as Bo,pU as Vo,T9 as _o,pL as Oo,pT as zo,pR as Mo,qs as jo}from"./zeni-epic-state-C3zBO1No.js";import{N as sn,x as X,c as q,n as ae,X as cn,_ as ln,cX as Lo,z as Be,cY as $o,at as Pe,cZ as qo,aU as jt,B as rn,c_ as Go,aq as Ye,D as No,a7 as Yo,c$ as Jo,a2 as Ko,d0 as Qo,V as Zo,d1 as Ho,d2 as Wo,Y as Xo,j as es,aN as ts,d3 as ns,d4 as as,b9 as os,w as ss,aQ as cs}from"./index-B4wUHn-k.js";import{u as dn}from"./useAskAiCfoHostNavButtonProps-BJGg886y.js";import{f as Lt,a as is,b as ls,g as rs,C as ds}from"./TransactionDetailScreen-BHKf3UvG.js";import{w as us}from"./withTransactionSidePanel-3cc8um6s.js";import{h as ms,v as ps}from"./routePaths-ooqctjvV.js";import{g as Je}from"./accountMappingHelper-DoYWzqd9.js";import{D as hs}from"./DrawerScreen-BSfM66hM.js";import"./recharts-Q-kkTNuO.js";import"./analytics-DVTbnjlr.js";import"./plaid-B1j5PXHV.js";import"./dnd-CKEs-Nbe.js";import"./stripe-DMRn4zHo.js";import"./lottie-BYni7Ovk.js";import"./lexical-k-PQZXkn.js";import"./pdf-CaeTpLUv.js";import"./utils-Mjhh9T8E.js";import"./decodeURIComponentSafe-ClSfwHJC.js";(function(){try{var t=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},l=new t.Error().stack;l&&(t._sentryDebugIds=t._sentryDebugIds||{},t._sentryDebugIds[l]="8fd8d6df-7366-41b8-a941-13c25c4b76e0",t._sentryDebugIdIdentifier="sentry-dbid-8fd8d6df-7366-41b8-a941-13c25c4b76e0")}catch{}})();const Ss=()=>{const t=pe(),l=Jt(),B=Ke(),f=x(d=>Re(d)),{useFeatureGate:T}=sn(),{isFeatureEnabled:C}=T(X.isRealtimeInsightsFeatureEnabled),{isFeatureEnabled:r}=T(X.aiAuditScorePercentage),I=x(d=>d.expenseAutomationViewState.selectedPeriodByTenantId),s=x(d=>la(d,f.tenantId)),{isAiCfoAccessEnabled:p,onAskAiCfoClick:u}=dn({mobileExploreReferrer:"Month-End Close Overview"}),k=o.useCallback((d,G,ee=!1)=>{t(Ee({tenantId:G,period:{month:d.month,year:d.year},refreshViewInBackground:ee}))},[]),v=o.useCallback(d=>{const G=B.state?.referrer;s.monthEndCloseChecks?.auditSummary!=null&&q.trackMonthCloseAuditPage(d.month,d.year,s.monthEndCloseChecks.reportEmailSentDate!=null?"closed":"in-review",s.monthEndCloseChecks.auditSummary.auditScorePercentage,!1,G??null),t(ra(f.tenantId,d))},[f.tenantId,s.monthEndCloseChecks?.auditSummary,s.monthEndCloseChecks?.reportEmailSentDate]),S=I[f.tenantId],m=o.useCallback(()=>{const d=B.state?.referrer;s.monthEndCloseChecks?.auditSummary!=null&&q.trackMonthCloseAuditPage(S.month,S.year,s.monthEndCloseChecks.reportEmailSentDate!=null?"closed":"in-review",s.monthEndCloseChecks.auditSummary.auditScorePercentage,!0,d??null),k(S,f.tenantId,!0)},[k,S,f.tenantId,s.monthEndCloseChecks?.auditSummary,s.monthEndCloseChecks?.reportEmailSentDate]),P=ae(B.state?.pathnameStackToGoBack,B.pathname),E=o.useCallback(()=>{if(s.monthEndCloseChecks!=null&&S!=null){const d=s.monthEndCloseChecks.monthEndCloseCheckList.find(G=>G.progress<100);if(d!=null)return void l(`./${d.id}/${S.month}-${S.year}`,{state:{pathnameStackToGoBack:P,message:"comingFromOverview"}});l(`./month_end_insights/${S.month}-${S.year}`,{state:{pathnameStackToGoBack:P,message:"comingFromOverview"}})}},[s.monthEndCloseChecks,S]),{areTenantIdsInSync:y}=cn();return ln({isDataReady:s.fetchState==="Completed"}),o.useEffect(()=>{S!=null&&s.fetchState!=="In-Progress"&&s.fetchState!=="Completed"&&y&&k(S,f.tenantId)},[k,S,s.fetchState,f.tenantId,y]),o.useEffect(()=>{S!=null&&s.monthClosePerformanceTrendFetchStatus.fetchState!=="In-Progress"&&s.monthClosePerformanceTrendFetchStatus.fetchState!=="Completed"&&y&&t(da(S))},[S,s.monthClosePerformanceTrendFetchStatus.fetchState,y]),o.useEffect(()=>{const d=setInterval(()=>{s.fetchState!=="In-Progress"&&s.fetchState==="Completed"&&m()},3e5);return()=>clearInterval(d)},[s.fetchState]),o.useEffect(()=>{if(s.fetchState==="Completed"&&s.monthEndCloseChecks?.auditSummary!=null){const d=B.state?.referrer;q.trackMonthCloseAuditPage(s.selectedPeriod.month,s.selectedPeriod.year,s.monthEndCloseChecks.reportEmailSentDate!=null?"closed":"in-review",s.monthEndCloseChecks.auditSummary.auditScorePercentage,!1,d??null)}},[s.fetchState,s.selectedPeriod,s.monthEndCloseChecks?.auditSummary,s.monthEndCloseChecks?.reportEmailSentDate]),h.jsx(gs,{children:h.jsx(Lo,{monthEndCloseChecksView:s,isRealtimeInsightsFeatureEnabled:C,onMonthEndCheckClick:d=>{l(`./${d}/${S.month}-${S.year}`,{state:{pathnameStackToGoBack:P,message:"comingFromOverview",referrer:"Expense Automation - Overview"}})},onPeriodChange:v,handleReviewButtonClick:E,onBackClick:()=>{l("../../dashboard")},onReload:m,isAiCfoAccessEnabled:p,onAskAiCfoClick:u,aiAuditScorePercentageEnabled:r})})},gs=Ue.div`
1
+ import{j as h}from"./liveblocks-DmbDY3sa.js";import oa from"./NotFoundScreen-C5grvltN.js";import{a as o,b as Jt}from"./sentry--Yi43Gx7.js";import{n as Ue,S as sa}from"./mui-1V4hRqCa.js";import{u as pe,h as Yt,g as Ke,j as x,n as ca,i as xt,o as ia,p as Ge}from"./core-Cj3sxYL7.js";import{eW as Re,Sz as la,of as Ee,fz as ra,s0 as da,ox as Kt,oS as Qt,SA as Wt,p0 as ua,SB as Zt,oq as ma,ry as pa,fj as Ie,SC as De,t_ as Ht,E7 as Xt,SD as en,SE as ha,r6 as Qe,NO as Pt,NQ as Sa,kv as ga,NR as Ca,kC as fa,c_ as Ia,va as We,oD as tn,p5 as Fe,ov as de,SF as Ea,MG as Rt,MF as we,SG as Dt,kT as ka,SH as ya,SI as ba,SJ as Ta,SK as va,oK as Aa,p8 as xe,SL as wa,SM as xa,SN as Pa,pf as Ra,kG as Da,kx as Fa,SO as Ua,kF as Ft,NY as Ba,SP as _a,SQ as Va,r2 as Oa,qG as za,p6 as me,qF as Ne,SR as Ma,SS as ja,ST as La,ma as $a,bq as qa,m5 as Ut,lT as Ga,SU as Na,f9 as Bt,gw as Ja,m2 as Ya,x3 as Ka,SV as Qa,pG as Wa,pB as Za,pF as Ha,pq as Xa,SW as eo,fm as nn,oV as to,oG as no,fA as _t,pa as ao,SX as oo,SY as so,p7 as an,SZ as co,S_ as io,S$ as lo,T0 as ro,T1 as Vt,re as uo,qx as mo,ME as po,T2 as ho,T3 as So,kE as go,T4 as Co,IP as fo,kD as Io,ks as Eo,fl as ko,q3 as on,qp as yo,p4 as Ot,p9 as bo,bE as To,l$ as vo,lY as Ao,T5 as wo,pp as zt,ql as Mt,qj as xo,T6 as Po,q8 as Ro,pQ as Do,qm as Fo,T7 as Uo,T8 as Bo,pU as _o,T9 as Vo,pL as Oo,pT as zo,pR as Mo,qs as jo}from"./zeni-epic-state-BG_x9wwl.js";import{F as sn,x as X,c as q,r as ae,X as cn,_ as ln,cX as Lo,z as Be,cY as $o,at as Pe,cZ as qo,aU as jt,B as rn,c_ as Go,aq as Je,D as No,a7 as Jo,c$ as Yo,a2 as Ko,d0 as Qo,W as Wo,d1 as Zo,d2 as Ho,w as Xo,j as es,aN as ts,d3 as ns,d4 as as,b9 as os,E as ss,aQ as cs}from"./index-C_Y0yMPY.js";import{u as dn}from"./useAskAiCfoHostNavButtonProps-OU79nJF1.js";import{f as Lt,a as is,b as ls,g as rs,C as ds}from"./TransactionDetailScreen-SbXBU7LB.js";import{w as us}from"./withTransactionSidePanel-8QHjmr16.js";import{h as ms,v as ps}from"./routePaths-D0rLO8yN.js";import{g as Ye}from"./accountMappingHelper-BwC4ZXQT.js";import{D as hs}from"./DrawerScreen-DAhJy05e.js";import"./recharts-mFhBBFnU.js";import"./analytics-BpWjaxbv.js";import"./plaid-JtkXopjw.js";import"./dnd-WLAr-qfO.js";import"./stripe-DMRn4zHo.js";import"./lottie-W8sR2m8i.js";import"./lexical--OluaPRa.js";import"./pdf-aJCOHARS.js";import"./utils-Bt5dYICv.js";import"./decodeURIComponentSafe-CyYkfiHv.js";(function(){try{var t=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},l=new t.Error().stack;l&&(t._sentryDebugIds=t._sentryDebugIds||{},t._sentryDebugIds[l]="dd815045-0c72-40b4-b07c-d0f82761f6d2",t._sentryDebugIdIdentifier="sentry-dbid-dd815045-0c72-40b4-b07c-d0f82761f6d2")}catch{}})();const Ss=()=>{const t=pe(),l=Yt(),B=Ke(),f=x(d=>Re(d)),{useFeatureGate:T}=sn(),{isFeatureEnabled:C}=T(X.isRealtimeInsightsFeatureEnabled),{isFeatureEnabled:r}=T(X.aiAuditScorePercentage),I=x(d=>d.expenseAutomationViewState.selectedPeriodByTenantId),s=x(d=>la(d,f.tenantId)),{isAiCfoAccessEnabled:p,onAskAiCfoClick:u}=dn({mobileExploreReferrer:"Month-End Close Overview"}),k=o.useCallback((d,G,ee=!1)=>{t(Ee({tenantId:G,period:{month:d.month,year:d.year},refreshViewInBackground:ee}))},[]),v=o.useCallback(d=>{const G=B.state?.referrer;s.monthEndCloseChecks?.auditSummary!=null&&q.trackMonthCloseAuditPage(d.month,d.year,s.monthEndCloseChecks.reportEmailSentDate!=null?"closed":"in-review",s.monthEndCloseChecks.auditSummary.auditScorePercentage,!1,G??null),t(ra(f.tenantId,d))},[f.tenantId,s.monthEndCloseChecks?.auditSummary,s.monthEndCloseChecks?.reportEmailSentDate]),S=I[f.tenantId],m=o.useCallback(()=>{const d=B.state?.referrer;s.monthEndCloseChecks?.auditSummary!=null&&q.trackMonthCloseAuditPage(S.month,S.year,s.monthEndCloseChecks.reportEmailSentDate!=null?"closed":"in-review",s.monthEndCloseChecks.auditSummary.auditScorePercentage,!0,d??null),k(S,f.tenantId,!0)},[k,S,f.tenantId,s.monthEndCloseChecks?.auditSummary,s.monthEndCloseChecks?.reportEmailSentDate]),P=ae(B.state?.pathnameStackToGoBack,B.pathname),E=o.useCallback(()=>{if(s.monthEndCloseChecks!=null&&S!=null){const d=s.monthEndCloseChecks.monthEndCloseCheckList.find(G=>G.progress<100);if(d!=null)return void l(`./${d.id}/${S.month}-${S.year}`,{state:{pathnameStackToGoBack:P,message:"comingFromOverview"}});l(`./month_end_insights/${S.month}-${S.year}`,{state:{pathnameStackToGoBack:P,message:"comingFromOverview"}})}},[s.monthEndCloseChecks,S]),{areTenantIdsInSync:y}=cn();return ln({isDataReady:s.fetchState==="Completed"}),o.useEffect(()=>{S!=null&&s.fetchState!=="In-Progress"&&s.fetchState!=="Completed"&&y&&k(S,f.tenantId)},[k,S,s.fetchState,f.tenantId,y]),o.useEffect(()=>{S!=null&&s.monthClosePerformanceTrendFetchStatus.fetchState!=="In-Progress"&&s.monthClosePerformanceTrendFetchStatus.fetchState!=="Completed"&&y&&t(da(S))},[S,s.monthClosePerformanceTrendFetchStatus.fetchState,y]),o.useEffect(()=>{const d=setInterval(()=>{s.fetchState!=="In-Progress"&&s.fetchState==="Completed"&&m()},3e5);return()=>clearInterval(d)},[s.fetchState]),o.useEffect(()=>{if(s.fetchState==="Completed"&&s.monthEndCloseChecks?.auditSummary!=null){const d=B.state?.referrer;q.trackMonthCloseAuditPage(s.selectedPeriod.month,s.selectedPeriod.year,s.monthEndCloseChecks.reportEmailSentDate!=null?"closed":"in-review",s.monthEndCloseChecks.auditSummary.auditScorePercentage,!1,d??null)}},[s.fetchState,s.selectedPeriod,s.monthEndCloseChecks?.auditSummary,s.monthEndCloseChecks?.reportEmailSentDate]),h.jsx(gs,{children:h.jsx(Lo,{monthEndCloseChecksView:s,isRealtimeInsightsFeatureEnabled:C,onMonthEndCheckClick:d=>{l(`./${d}/${S.month}-${S.year}`,{state:{pathnameStackToGoBack:P,message:"comingFromOverview",referrer:"Expense Automation - Overview"}})},onPeriodChange:v,handleReviewButtonClick:E,onBackClick:()=>{l("../../dashboard")},onReload:m,isAiCfoAccessEnabled:p,onAskAiCfoClick:u,aiAuditScorePercentageEnabled:r})})},gs=Ue.div`
2
2
  display: flex;
3
3
  height: 100vh;
4
4
  width: 100%;
5
5
  flex: 1 1 auto;
6
6
  flex-direction: column;
7
7
  background-color: ${t=>t.theme.colors.grey4};
8
- `,Cs=Yt.memo(({reconciliation:t,selectedDrawerAccountId:l,onClose:B,onFetchLinkTokenClick:f,onEstablishConnectionClick:T})=>{const C=pe(),r=Be.getSignedInUser(),I=x(e=>Re(e)),s=t.excludedAccountIDs,p=o.useMemo(()=>({userId:r?.userId??"",sessionId:r?.zeniSessionId??"",tenantId:I?.tenantId??""}),[r?.userId,r?.zeniSessionId,I?.tenantId]),{accountReconciliationsByAccountID:u,monthYearPeriod:k,statementUploadChosen:v}=t,S=u[l],m=S?.accountReconEntity.statementMetaData?.statementUploadId,P=(e,n)=>{C(pa(e,n.split(".")[0]))},E=e=>{m!=null&&C(ma({accountId:l,selectedPeriod:k,fileId:e,statementUploadId:m}))},y=()=>{C(Zt({statementUploadChosen:!1}))},d=e=>{C(ua({accountId:l,selectedPeriod:k,payload:e}))},G=e=>{C(Ht({accountId:l,selectedPeriod:k,localData:{accountSource:e}}))},ee=o.useCallback(()=>{C(Kt({accountId:l}))},[C,l]),z=o.useCallback(()=>{C(Qt({accountId:l}))},[C,l]),_=s.includes(l)?t.excludedAccountReconciliationByAccountID[l]:void 0;return S!=null?h.jsx($t,{children:h.jsx(qt,{children:h.jsx($o,{excludeAccountFetch:t.excludeAccountFetchState,accountReconciliation:S,monthYearPeriod:k,onDismissClick:B,plaidConnectionDetails:t.plaidConnectionDetails,onFetchLinkTokenClick:f,onEstablishConnectionClick:T,onEditFileName:P,onDeleteFile:E,onSelectSourceType:G,filesEndPoint:Pe.fileMicroServiceBaseUrl,authParams:p,openFilePicker:v,onStatementUploadSuccess:d,onUploadWindowOpenedOnce:y,onExcludeFromReconciliation:ee})})}):_!=null?h.jsx($t,{children:h.jsx(qt,{children:h.jsx(qo,{excludedAccountReconciliation:_,includeAccountFetch:t.includeAccountFetchState,onIncludeIntoReconciliation:z})})}):null}),$t=Ue.div`
8
+ `,Cs=Jt.memo(({reconciliation:t,selectedDrawerAccountId:l,onClose:B,onFetchLinkTokenClick:f,onEstablishConnectionClick:T})=>{const C=pe(),r=Be.getSignedInUser(),I=x(e=>Re(e)),s=t.excludedAccountIDs,p=o.useMemo(()=>({userId:r?.userId??"",sessionId:r?.zeniSessionId??"",tenantId:I?.tenantId??""}),[r?.userId,r?.zeniSessionId,I?.tenantId]),{accountReconciliationsByAccountID:u,monthYearPeriod:k,statementUploadChosen:v}=t,S=u[l],m=S?.accountReconEntity.statementMetaData?.statementUploadId,P=(e,n)=>{C(pa(e,n.split(".")[0]))},E=e=>{m!=null&&C(ma({accountId:l,selectedPeriod:k,fileId:e,statementUploadId:m}))},y=()=>{C(Wt({statementUploadChosen:!1}))},d=e=>{C(ua({accountId:l,selectedPeriod:k,payload:e}))},G=e=>{C(Zt({accountId:l,selectedPeriod:k,localData:{accountSource:e}}))},ee=o.useCallback(()=>{C(Kt({accountId:l}))},[C,l]),z=o.useCallback(()=>{C(Qt({accountId:l}))},[C,l]),V=s.includes(l)?t.excludedAccountReconciliationByAccountID[l]:void 0;return S!=null?h.jsx($t,{children:h.jsx(qt,{children:h.jsx($o,{excludeAccountFetch:t.excludeAccountFetchState,accountReconciliation:S,monthYearPeriod:k,onDismissClick:B,plaidConnectionDetails:t.plaidConnectionDetails,onFetchLinkTokenClick:f,onEstablishConnectionClick:T,onEditFileName:P,onDeleteFile:E,onSelectSourceType:G,filesEndPoint:Pe.fileMicroServiceBaseUrl,authParams:p,openFilePicker:v,onStatementUploadSuccess:d,onUploadWindowOpenedOnce:y,onExcludeFromReconciliation:ee})})}):V!=null?h.jsx($t,{children:h.jsx(qt,{children:h.jsx(qo,{excludedAccountReconciliation:V,includeAccountFetch:t.includeAccountFetchState,onIncludeIntoReconciliation:z})})}):null}),$t=Ue.div`
9
9
  display: flex;
10
10
  flex-direction: column;
11
11
  height: 100%;
@@ -18,7 +18,7 @@ import{j as h}from"./liveblocks-D3ESVZyk.js";import oa from"./NotFoundScreen-6vy
18
18
  min-width: 0;
19
19
  overflow-x: hidden;
20
20
  overflow-y: auto;
21
- `;function fs({companyId:t,closeCustomerRequestDrawer:l,addCustomerRequest:B,resetCustomerRequest:f}){const T=Be.getSignedInUser();if(T==null)throw Error("Can't access Customer Request page without signing in...");const C=x(r=>ha(r,t,T));return o.useEffect(()=>{f()},[]),h.jsx(h.Fragment,{children:C.fetchState==="In-Progress"||C.companyMonthEndReportTemplatesData.fetchState==="In-Progress"?h.jsx(rn,{fetchState:"In-Progress"}):h.jsx(Go,{onCloseClick:l,addCustomerRequest:B,snippets:C.companyMonthEndReportTemplatesData,bulletPoints:C.zeniRequestsData??[]})})}const Is=t=>t.sections.generalExpense.vendors.length+t.sections.reimbursement.vendors.length,un="reconciliation-status-updated",mn="statement-status-updated",{common:{strings:{hyphen:Es,comma:Gt,space:ks}},dateFormat:pn}=No.getLocalizedStrings(),Nt=jo,ys=ca(function(t,l){const{uncategorizedAccounts:B,vendorSearchAutoCompleteData:f,monthEndInsightsCustomerRequestData:T,monthEndInsightsPreviewMode:C,companyId:r,isMissingReceiptsBulkUploadEnabled:I,isTransactionActivityEnabled:s}=l,p=Be.getSignedInUser(),u=t.tenantState.currentTenantId,k={userId:p?.userId??"",sessionId:p?.zeniSessionId??"",tenantId:u??""},v=Ie(t),{selectedTransactionCategorizationTab:S}=v;return{expenseAutomationViewSelector:v,bulkUploadSelector:I===!0?v.missingReceipts.bulkUpload:void 0,vendorSearchAutoCompleteData:f,authParams:k,receiptUploadEndpoint:`${Pe.accountMicroServiceBaseUrl}`,transactionAttachmentsEndpoint:`${Ko}/transaction_attachments`,bulkUploadEndpoint:I===!0?`${Pe.communicationAgentMicroServiceBaseUrl}/1.0/receipts/bulk-upload`:void 0,isDisabled:!1,currentTab:S,monthEndInsightsCustomerRequestData:T,monthEndInsightsPreviewMode:C,allThreadsSectionOpen:!1,enableMonthEndInsightsZeniGPTFeature:!1,loggedInUser:p,uncategorizedAccounts:B,companyId:r,isTransactionActivityEnabled:s}},function(t,l){const{themeState:B,isAccountingClassesEnabled:f,isCOTEnabled:T,isUncategorizedExpenseCategoryEnabled:C,isMissingReceiptsBulkUploadEnabled:r,location:I,vendorSearchAutoCompleteData:s,expenseAutomationViewSelector:p,currentTenant:u,uncategorizedAccounts:k,navigate:v,onClickCustomerRequest:S,handleEditClick:m,setActivityLogTransactionId:P}=l,{selectedPeriod:E,currentSelectedView:y,reconciliation:{selectedAccountId:d}}=p,{accountSettingsView:G}=p.jeSchedules,ee=tn(E),z=Fe(ee.start),_=Fe(ee.end);return{onZeniLogoClick:()=>{B.toggle()},onUploadReceiptAttachment:e=>{q.trackMissingReceiptAttached(E.month,E.year),t(mo(e))},onUploadTransactionReceipt:(e,n,c,i,b,g)=>{t(_t(e,n,{fetchState:"In-Progress"}));const A=()=>t(_t(e,n,{fetchState:"Error"}));Qo(`${Pe.accountMicroServiceBaseUrl}/1.0/transactions/${n}/attachments`,g,n,c,i,b).then(V=>{V!=null?t(uo(e,V)):A()}).catch(A)},onMissingReceiptsRowClick:(e,n)=>{if(l.openTransactionPanel)return void l.openTransactionPanel(e,n);const c=ae(I.state?.pathnameStackToGoBack,I.pathname);v(`../../transaction/${n}/${e}`,{state:{pathnameStackToGoBack:c,message:"expenseAutomation",origin:"missing_receipts"}})},onUploadReceiptComplete:(e,n)=>{t(ro(e,n)),u!=null&&t(Ee({tenantId:u.tenantId,period:n,refreshViewInBackground:!0}))},onUploadReceiptFetchStatus:(e,n,c,i)=>{t(lo(e,{fetchState:n,error:c})),c!=null&&t(Bt({messageSection:"missing_receipts_attachment",messageText:"failed",type:"error",showStatusIcon:!0,variables:[{variableName:"__message__",variableValue:i!=null?ks+Es+i+Gt:Gt}]}))},onUpdateJESchedulesUIState:e=>{t(io(e))},onUpdateMissingReceiptsUIState:e=>{t(co(e))},onFetchMissingReceiptsList:()=>{_!=null&&z!=null&&t(an({start:z,end:_},{amount:75,currencyCode:"USD",currencySymbol:"$"},!0,!1))},...r===!0?{onBulkUploadFiles:e=>{t(Mo(e))},onBulkUploadProgress:e=>{t(zo(e))},onBulkUploadSuccess:e=>{t(Oo({batchId:e}))},onBulkUploadUploadedFileCount:e=>{t(_o(e))},onConfirmBulkUploadMatch:(e,n,c,i,b)=>{t(Vo(e,n,c,i,b))},onBulkUploadConfirmMatchAcknowledged:()=>{t(Bo())},onSetBulkUploadResultsTab:e=>{t(Uo(e))},onSetBulkUploadCompletedSubTab:e=>{t(Fo(e))},onSetBulkUploadSortConfig:(e,n)=>{t(Mt({sortKey:e,sortOrder:n}))},onClearBulkUpload:()=>{t(Do())},onSearchTransactionsForManualMatch:(e,n)=>{t(Nt(e,n??void 0))},onLoadMoreManualSearch:()=>{const{manualSearch:e}=p.missingReceipts.bulkUpload;e.nextPageToken!=null&&e.searchQuery!==""&&t(Nt(e.searchQuery,e.nextPageToken))},onFetchCompletedTransactions:(e,n)=>{t(Ro(e,n))},onClearBulkUploadBatchDetailsForScopeChange:()=>{t(Po())},onFetchBulkUploadBatches:e=>{t(on(e))},onFetchMoreBatchDetails:()=>{t(xo())},onResetBulkUploadSort:()=>{t(Mt({sortKey:void 0,sortOrder:void 0}))}}:{},onClearMissingReceiptsTabNavigation:()=>{t(so())},onSearchTextChanged:e=>{const n=p.currentSelectedView,c=p.selectedTransactionCategorizationTab;n==="transaction_categorization"&&(t(Ne({selectedTab:c,uiState:{searchString:e}})),_!=null&&z!=null&&t(me(c,{start:z,end:_},!0,!1,e,void 0,!1,!0)))},onFiltersChange:e=>{const n=p.selectedTransactionCategorizationTab;t(oo({filters:e,selectedTab:n}))},onRefresh:()=>{l.trackExpenseAutomationTabAnalytics(!0),t(ao(C))},onClose:()=>{y==="reconciliation"&&d!=null&&t(Vt({selectedAccountId:void 0})),v("../")},onBack:()=>{y==="reconciliation"&&d!=null&&t(Vt({selectedAccountId:void 0}))},onSaveReconciliation:e=>{t(no(e))},onSaveReconciliationReview:e=>{t(to(e))},onUpdateStep:e=>{const{selectedPeriod:n}=p,c=ae(I.state?.pathnameStackToGoBack,I.pathname);v(`../${e}/${n.month}-${n.year}`,{state:{pathnameStackToGoBack:c,referrer:p.currentSelectedView}}),t(nn(e))},handleLogOutClick:()=>{const e=ae(I.state?.pathnameStackToGoBack,I.pathname);v("/signout",{replace:!0,state:{pathnameStackToGoBack:e,message:"logout"}})},onJeAccountSettingsChange:e=>{const{vendorsAccountSection:n}=e,{prepaidExpensesAccount:c,fixedAssetsAccount:i,accruedExpensesAccount:b}=n,g=Je(G.prepaidExpensesAccountList,c.selectedOptions),A=Je(G.fixedAssetsAccountList,i.selectedOptions),V=Je(G.accruedExpensesAccountList,b.selectedOptions),R={selectedPrepaidExpensesAccountIds:g.map(D=>D.accountId),selectedFixedAssetsAccountIds:A.map(D=>D.accountId),selectedAccruedExpensesAccountIds:V.map(D=>D.accountId)};t(eo({data:R}))},onSaveJeAccountSettingsClick:()=>{t(Xa())},onJESchedulesFormDataChange(e,n){const{jeScheduleID:c,accumulatedDepreciationCategory:i,scheduleClass:b,scheduleExpenseCategory:g,vendor:A}=n,{allAccountList:V,allClassList:R,allDepreciationAccountList:D}=p.jeSchedules,j=s.entityAutoCompleteView.vendor.length>0?s.entityAutoCompleteView.vendor.find(Y=>Y.id===A?.selectedOption):void 0,oe={id:j?.zeniId??A?.selectedOption??"",name:j?.name??A?.defaultOptions.find(Y=>Y.value===A?.selectedOption)?.label??"",logo:j?.logo},se=g?.selectedOption!=null?V.find(Y=>Y.qboId===g.selectedOption):void 0,Ve=b?.selectedOption!=null?R.find(Y=>Y.classId===b.selectedOption):void 0,_e=i?.selectedOption!=null?D.find(Y=>Y.qboId===i.selectedOption):void 0;t(Wa({scheduledJournalEntryID:e,localData:{jeScheduleID:c,scheduledJournalEntryID:e,updatedCategoryId:se?.accountId,updatedClassId:Ve?.classId,updatedAccumulatedDepreciationCategoryID:_e?.accountId,updatedVendor:{id:oe.id,name:oe.name}}}))},ignoreRecommendedJeSchedule(e,n){t(Ha(e,n))},vendorSearchAutoCompleteActions:{onAutoCompleteInputChange:(e,n)=>{e.trim().length>=2?t(Rt({searchString:e,entityType:n,searchOrigin:"common"})):e.trim().length===0&&t(we("common"))},onCancelAutoComplete:()=>{t(we("common"))}},onPostJESchedule(e,n){t(Za({scheduledJournalEntryID:e,jeScheduleTransactionKey:n}))},clearJeScheduleLocalData(){t(Qa())},handleJeScheduleClick:(e,n,c)=>{t(Ka({selectedJEScheduleKey:n}));const i=ae(I.state?.pathnameStackToGoBack,I.pathname);v(`../../vendors/schedules/${c}/details/${e}`,{state:{pathnameStackToGoBack:i,message:"expenseAutomation",origin:"je_schedules"}})},improveMonthEndInsightsUsingZeniGPTClick:e=>{u!=null&&t(Ja(e,u.companyId,u.tenantId))},onClickCustomerRequest:S,setActivityLogTransactionId:P,onCloseAllThreadsSection:()=>{},onCloseFileAttachmentSnackBar:()=>{t(Ya())},onOpenFileAttachmentSnackBar:()=>{t(Bt({messageSection:"cockpit_month_end_email_attachment_upload",messageText:"failed",type:"error",showStatusIcon:!0}))},onRemoveFileAttachment:e=>{t(Na(e))},onUpdateFileAttachment:e=>{t(Ga({files:e}))},previewMonthEndReport:(e,n,c,i)=>{u!=null&&t(Ut(e,u.companyId,n,!0,c,i,u.tenantId))},saveMonthEndReport:(e,n,c,i)=>{u!=null&&t(Ut(e,u.companyId,n,!1,c,i,u.tenantId))},onEditMonthEndInsightsClick:m,sendMonthEndReport:e=>{const n=I.state?.referrer,{selectedPeriod:c,auditSummary:i}=p;u!=null&&i?.auditScorePercentage!=null&&(t($a(u.companyId,e,u.tenantId)),q.trackInsightsEmailPage(c.month,c.year,!1,"draft",i.auditScorePercentage,qa().format(pn.analytics.MMMDDCommaYYYYformat),n??null))},onTransactionCategorizationRowClick:(e,n)=>{if(l.openTransactionPanel)return void l.openTransactionPanel(e,n);const c=ae(I.state?.pathnameStackToGoBack,I.pathname);v(`../../transaction/${n}/${e}`,{state:{pathnameStackToGoBack:c,message:"expenseAutomation",origin:"transaction_categorization"}})},setLocalDataForCategoryAndClass:(e,n,c,i,b,g,A,V,R,D,j,oe,se)=>{t(La(e,n,c,i,k,b,g,A,V,R,D,j,oe,se))},onCancelAutoComplete:()=>{t(we("common"))},updateExpenseAutomationReconListScrollPosition:e=>{t(Dt({scrollPosition:e}))},onUpdateTab:e=>{l.closeSidePanel?.(),_!=null&&z!=null&&(t(me(e,{start:z,end:_},!1,!1)),t(ja(e)))},onUpdateTransactionCategorizationCompletedSubTab:e=>{l.closeSidePanel?.(),_!=null&&z!=null&&(t(Ma(e)),t(me("autoCategorized",{start:z,end:_},!1,!1)))},onUpdateTransactionCategorizationUIState:(e,n)=>{t(Ne({selectedTab:e,uiState:n})),_!=null&&z!=null&&t(me(e,{start:z,end:_},!1,!1,n.searchString,null,!0))},onUpdateScrollYOffSetTransactionCategorizationUIState:(e,n)=>{t(Ne({selectedTab:e,uiState:n}))},onFetchTransactionCategorizationList:(e,n,c,i,b,g,A)=>{_!=null&&z!=null&&t(me(e,{start:z,end:_},!0,c,n,i,b,g,A))},resetTransactionCategorizationLocalData:(e,n,c,i,b,g,A,V)=>{t(za(e,n,c,i,V??null,b,g,!1,A))},updateSelectedVendorForTransaction:(e,n,c,i,b)=>{t(Ft({selectedTab:e,transactionId:n,lineId:c,selectedTransaction:i,uncategorizedAccounts:k,updatedVendor:b,isAccountingClassesEnabled:f}))},onSaveUpdateTransactionCategorization:(e,n,c)=>{const i=I.state?.referrer;e==="autoCategorized"?q.trackTransactionsAutoCategorisedPage(E.month,E.year,p.transactionView.totalCountByTab.autoCategorized,n.length,!1,i??null):q.trackTransactionsReviewPage(E.month,E.year,p.transactionView.totalCountByTab.review,n.length,!1,i??null),t(Oa(e,n,c,C))},onUpdateSelectedCheckboxTransactionIds:(e,n)=>{t(_a({selectedTab:e,transactionIds:n}))},onFetchRecommendationsForEntityCategorizationWithCustomer:(e,n,c,i,b,g,A)=>{const{transactionId:V,transaction:R,lineIds:D}=n;g!=null&&t(Ba({transactionId:V,customerUpdates:g})),t(Va({selectedTab:i,transactionId:V.id,lineId:D[0],selectedTransaction:R,uncategorizedAccounts:k,updatedCustomer:g,selectedEntity:b,isAccountingClassesEnabled:f,isUncategorizedExpenseCategoryEnabled:A})),b!=null&&t(Ze({entity:b,amount:e,transactionDetails:n,flowType:"categorization",selectedTab:i,isFetchCOT:T,isUncategorizedExpenseCategoryEnabled:A}))},onFetchRecommendationsForEntityCategorization:(e,n,c,i,b,g,A)=>{const{transactionId:V,transaction:R,lineIds:D}=n;g!=null&&(t(Da({transactionId:V,vendorUpdates:{name:g.name,id:g.id?g.id:void 0}})),t(Fa({vendorId:g.id?g.id:void 0,localData:{vendorName:g.name,vendorId:g.id?g.id:void 0}}))),g?.id?(t(Ft({selectedTab:i,transactionId:V.id,lineId:D[0],selectedTransaction:R,uncategorizedAccounts:k,updatedVendor:g,selectedEntity:b,isAccountingClassesEnabled:f,isUncategorizedExpenseCategoryEnabled:A})),b!=null&&t(Ze({entity:b,amount:e,transactionDetails:n,flowType:"categorization",selectedTab:i,isFetchCOT:T,isUncategorizedExpenseCategoryEnabled:A}))):t(Ua({selectedTab:i,transactionId:V.id,lineId:D[0]}))},fetchFluxViewOnScroll:(e,n)=>{t(xe(e,!0,!1,n,!1,!0))},onFetchFluxViewList:()=>{t(xe(E,!0,!1,null,!1,!1))},markAsReview:(e,n,c,i)=>{q.trackFluxAnalysisReviewed(c.month,c.year,i??!1,e),t(Ra(n,e,c,i??!1))},onUpdateFluxAnalysisUIState:e=>{t(Pa(e))},updateOperatingExpensesIdsForReview:e=>{t(xa({operatingExpenseIds:e,selectedPeriod:E}))},redirectToVendorDetailPage:e=>{if(l.tenantEmailDomain!=null){const n=ps(e.id,e.qboId,l.tenantEmailDomain),c=ae(l.location.state?.pathnameStackToGoBack,l.location.pathname);l.navigate(n,{state:{pathnameStackToGoBack:c,message:"expenseAutomation",referrer:"Vendor List",origin:"flux_analysis"}})}},updateSectionIdsForReview:e=>{t(wa({sectionId:e,selectedPeriod:E}))},onFetchReimbursementView:(e,n,c)=>{t(xe(e,!0,!1,n,!0,c))},onReviewClicked:e=>{t(de(E,e))},setOpenDrawerClicked:e=>{t(De({selectedDrawerAccountId:e}))},onFetchLinkTokenClick:(e,n)=>{t(Wt("expense_automation_reconcile",e,n))},onEstablishConnectionClick:(e,n)=>{const c=u?.companyId;c!=null&&(t(Xt(e,c,"expense_automation_reconcile",void 0,"link_account_no_microdeposit",n)),t(en({accountId:n,connectionInProgress:!0})))},onAddStatementClick:e=>{t(De({selectedDrawerAccountId:e})),t(Ht({accountId:e,selectedPeriod:E,localData:{accountSource:"bank_statement"}})),t(Zt({statementUploadChosen:!0}))},onReloadReconciliationListPage:()=>{t(de(E,void 0,!0,!1))},onUpdateReconcileTabLocalData:e=>{t(Aa({selectedTransactionIds:e}))},onReconTabColumnSortConfigChanged:(e,n)=>{t(va({sortKey:e,sortOrder:n}))},onReconReviewTabColumnSortConfigChanged:(e,n)=>{t(Ta({sortKey:e,sortOrder:n}))},onReconTabUpdate:e=>{l.closeSidePanel?.(),t(ba({selectedTab:e}))},updateReconReviewTabLocalData:(e,n,c)=>{const i=e.vendor?.id;c&&i!=null&&t(ka(i)),t(ya({data:e,transactionId:n}))},onReconMatchedTransactionClick:e=>{if(l.openTransactionPanel)return void l.openTransactionPanel(e,Qe("bill"));const n=ae(I.state?.pathnameStackToGoBack,I.pathname);v(`../../transaction/bill/${e}`,{state:{pathnameStackToGoBack:n,message:"expenseAutomation",origin:"reconciliation"}})},onReloadPage:()=>{window.location.reload()},onBackClick:()=>{v(-1)},onReconListPageScroll:e=>{t(Dt({scrollPosition:e}))},onVendorAutoCompleteInputChange:e=>{e.trim().length>=2?t(Rt({searchString:e,searchOrigin:"common"})):e.trim().length===0&&t(we("common"))},onReconNodeCollapseToggled:(e,n)=>{t(Ea({nodeId:e,collapsed:n}))},updateSectionCollapseStatus:()=>{},onExcludeAccountFromReconciliation:e=>{t(Kt({accountId:e}))},onIncludeAccountIntoReconciliation:e=>{t(Qt({accountId:e}))},onReconciliationPusherEventReceived:e=>{e!==un&&e!==mn||y!=="reconciliation"||t(de(E,d,!0,!0))}}},(t,l,B)=>{const{isMissingReceiptsBulkUploadEnabled:f,...T}=B;return function(C,r,I){return{...C,...r,...I,onUploadTransactionReceipt:(s,p,u,k,v)=>{r.onUploadTransactionReceipt(s,p,u,k,v,C.authParams)}}}(t,l,T)})(Yo(Jo)),bs=us(function(t){const l=t.displayName??t.name??"Component",B=Yt.memo(t),f=T=>{const C=pe(),r=function(){const P=pe(),E=x(y=>Ie(y).reconciliation.selectedDrawerAccountId);return{isOpen:E!=null,selectedAccountId:E,openPanel:o.useCallback(y=>{P(De({selectedDrawerAccountId:y}))},[P]),closePanel:o.useCallback(()=>{P(De({selectedDrawerAccountId:void 0}))},[P])}}(),I=x(P=>Ie(P).reconciliation),s=x(P=>Re(P)),p=o.useCallback((P,E)=>{C(Wt("expense_automation_reconcile",P,E))},[C]),u=o.useCallback((P,E)=>{const y=s?.companyId;y!=null&&(C(Xt(P,y,"expense_automation_reconcile",void 0,"link_account_no_microdeposit",E)),C(en({accountId:E,connectionInProgress:!0})))},[C,s?.companyId]),k=o.useMemo(()=>{if(r.isOpen&&r.selectedAccountId!=null)return h.jsx(Cs,{reconciliation:I,selectedDrawerAccountId:r.selectedAccountId,onClose:r.closePanel,onFetchLinkTokenClick:p,onEstablishConnectionClick:u})},[r.isOpen,r.selectedAccountId,r.closePanel,I,p,u]),v=o.useMemo(()=>({reconPanelContent:k,reconSidePanelIsOpen:r.isOpen,closeReconSidePanel:r.closePanel}),[k,r.isOpen,r.closePanel]),S=o.useContext(jt),m=o.useMemo(()=>r.isOpen?{closePanel:r.closePanel,selectedItemId:r.selectedAccountId}:S,[r.isOpen,r.closePanel,r.selectedAccountId,S]);return h.jsx(jt.Provider,{value:m,children:h.jsx(B,{...T,...v})})};return f.displayName=`withReconSidePanel(${l})`,f}(({closeSidePanel:t,openTransactionPanel:l,panelContent:B,sidePanelIsFullView:f,sidePanelIsOpen:T,reconPanelContent:C,reconSidePanelIsOpen:r,closeReconSidePanel:I})=>{const{isAiCfoOpen:s,setIsAiCfoOpen:p}=Zo(),u=Ho(),{isOpen:k}=Wo(),v=Jt(),S=Ke(),m=pe(),{isAiCfoAccessEnabled:P,onAskAiCfoClick:E}=dn({mobileExploreReferrer:"Transaction categorization"}),y=o.useCallback(()=>{T===!0&&f!==!0&&t?.()},[t,T,f]),{areTenantIdsInSync:d}=cn(),G=(()=>{const a=x(N=>Ie(N)),U=Ke(),{currentSelectedViewFetchState:L,currentSelectedView:$,selectedPeriod:w}=a,H=Ye($),J=Ye(L.fetchState),Z=o.useCallback(N=>{const W=U.state?.referrer;$==="transaction_categorization"&&(a.selectedTransactionCategorizationTab==="review"?q.trackTransactionsReviewPage(w.month,w.year,a.transactionView.totalCountByTab.review,0,N,W??null):q.trackTransactionsAutoCategorisedPage(w.month,w.year,a.transactionView.totalCountByTab.autoCategorized,0,N,W??null)),$==="missing_receipts"&&q.trackMissingReceiptsPage(w.month,w.year,N,a.missingReceipts.transactions.length,W??null),$==="je_schedules"&&q.trackMonthCloseScheduleListPage(w.month,w.year,N,a.jeSchedules.draftSchedules.length,a.jeSchedules.resolveSchedules.length,W??null),$==="flux_analysis"&&q.trackFluxAnalysisPage(w.month,w.year,N,Is(a.fluxAnalysis),W??null),$==="month_end_insights"&&a.auditSummary?.auditScorePercentage!=null&&q.trackInsightsEmailPage(w.month,w.year,N,"draft",a.auditSummary.auditScorePercentage,null,W??null)},[w,a]);return o.useEffect(()=>{J===L.fetchState&&$===H||L.fetchState!=="Completed"||Z(!1)},[$,L.fetchState,H]),Z})(),ee=Xo(),[z,_]=o.useState(!1),e=x(a=>Pt(a)),n=x(a=>Re(a)),[c,i]=o.useState(!1),[b,g]=o.useState(!1),[A,V]=o.useState([]),[R,D]=o.useState(null),j=o.useCallback(()=>{D(null)},[]),oe=R?.contentType==="activity"?R.detail.transactionId:void 0,se=o.useCallback(a=>{a!=null?(s&&p(!1),u(),y(),D({contentType:"activity",detail:{transactionId:a}})):D(U=>U?.contentType==="activity"?null:U)},[y,s,u,p]),Ve=o.useCallback(a=>{s&&p(!1),u(),y(),D({contentType:"transfer",detail:a})},[y,s,u,p]),_e=o.useCallback(()=>{u(),j(),y(),E()},[y,j,E,u]),Y=o.useRef(s);o.useEffect(()=>{s===!0&&Y.current===!1&&(u(),j(),y()),Y.current=s},[y,j,s,u]);const He=o.useRef(k);o.useEffect(()=>{k===!0&&He.current===!1&&(s&&p(!1),j(),T===!0&&f!==!0&&t?.()),He.current=k},[j,t,k,s,p,f,T]);const ke=T===!0&&f!==!0,We=o.useRef(ke);o.useEffect(()=>{ke&&!We.current&&(s&&p(!1),u(),j()),We.current=ke},[j,s,ke,u,p]);const[Xe,hn]=o.useState(!1),et=o.useRef(!1),{selectedTab:tt}=xt(),{tenantEmailDomain:Sn}=xt(),[Oe,nt]=o.useState(S.state?.message==="comingFromTransactionDetail"),at=S.state?.message==="comingFromOverview",gn=es(),ze=Be.getSignedInUser(),{useDynamicConfig:Cn,useFeatureGate:ce}=sn(),{configValue:fn}=Cn(ts.enableUncategorizedExpenseCategory),te=fn?.uncategorized_expense_category_enabled===!0,{isFeatureEnabled:ot}=ce(X.isRealtimeInsightsFeatureEnabled),{isFeatureEnabled:he}=ce(X.isMissingReceiptsBulkUploadEnabled),{isFeatureEnabled:Me}=ce(X.isTransactionActivityEnabled),{isFeatureEnabled:st}=ce(X.isCreateTransferEntryFromExpenseEnabled),{isFeatureEnabled:In}=ce(X.isExpenseAutomationCommentingEnabled),{isFeatureEnabled:En}=ce(X.isProjectsTransactionsEnabled),{isFeatureEnabled:kn}=ce(X.isJEScheduleCOTEnabled),yn=o.useCallback(a=>{const U=Qe(a.view==="reconciliation"?"bill":"expense");l?.(a.entityId,U)},[l]),bn=x(a=>po(a,"common")),M=x(a=>Ie(a)),{categoryOptions:Tn,paymentAccountNames:vn}=x(a=>ho(a.accountState)),An=x(a=>So(a.classState)),{monthEndCloseChecksView:Q,currentSelectedView:F,selectedPeriod:O,selectedTransactionCategorizationTab:je,currentSelectedViewBackgroundRefreshFetchState:wn,currentSelectedViewFetchState:ie,jeSchedules:Le,reconciliation:xn}=M;is(F==="transaction_categorization");const Pn=M.transactionView.saveStatus.fetchState,ct=M.transactionView.transactions,it=o.useRef(ct);it.current=ct;const lt=x(a=>a.expenseAutomationTransactionsViewState?.transactionCategorizationView),rt=x(a=>a.expenseAutomationTransactionsViewState?.selectedTransactionCategorizationTab),dt=o.useRef(lt);dt.current=lt;const ut=o.useRef(rt);ut.current=rt;const ne=ls(Pn,()=>{const a=[],U=ut.current,L=dt.current,$=L!=null&&U!=null?L[U]:void 0;if($?.transactionReviewLocalDataById!=null)for(const H of Object.values($.transactionReviewLocalDataById)){const J=H?.transactionReviewLocalData?.lineItemById;if(J!=null)for(const Z of Object.values(J)){const N=Z?.account;N?.accountId!=null&&a.push(N.accountId)}}const w=it.current;for(const H of w)for(const J of H.lines??[])"account"in J&&J.account?.accountId!=null&&a.push(J.account.accountId);return a});o.useEffect(()=>{F==="transaction_categorization"&&T!==!0||se(void 0)},[F,se,T]);const Rn=M.transactionView.selectedTransactionCategorizationCompletedSubTab,ye=`${je}|${Rn}`,be=o.useRef(null);o.useEffect(()=>{be.current!==null?be.current!==ye&&(be.current=ye,F==="transaction_categorization"&&j()):be.current=ye},[j,F,ye]);const Dn=x(a=>oe==null?void 0:go(a.transactionState,oe)),le=Dn?.qboId,mt=x(a=>le==null?void 0:Co(a,le));o.useEffect(()=>{le!=null&&m(fo(le))},[m,le]);const{createTransferEntryStatus:pt,creditCardTransferAccountsList:ht,transferAccounts:St}=M.transactionView,gt=o.useCallback(a=>rs(m,a),[m]),Ct=o.useMemo(()=>F!=="transaction_categorization"||R==null?null:R.contentType==="activity"?Me===!0?h.jsx(ns,{activityLogView:mt,qboId:le,onClose:()=>D(null),selectedTransactionId:R.detail.transactionId,isQuickViewCardStyle:!0},String(R.detail.transactionId)):null:R.contentType==="transfer"?h.jsx(as,{createTransferEntryStatus:pt,transaction:R.detail,transferAccounts:R.detail.transactionType==="credit_card_payment"?ht:St,onClose:()=>D(null),onCreateTransfer:gt,isQuickViewCardStyle:!0},String(R.detail.transactionId)):null,[F,R,Me,mt,le,pt,ht,St,gt]),Fn=Ct!=null,{selectedAccountId:Se}=xn,ft=Ye(Le.accountSettingsView.saveState.fetchState),Un=x(a=>Io(a.accountState,a.accountListState,"accountList")),Bn=x(a=>Eo(a)),ge=tt!=null?ko(tt):F,Vn=x(a=>a.entityAutoCompleteState.autoCompleteText.common);if(ln({isDataReady:ie.fetchState==="Completed"}),ze==null)throw Error("Can't access expense automation screen without signing in...");const It=tn(O),Ce=Fe(It.start),fe=Fe(It.end);if(Ce==null||fe==null)throw Error(`Invalid start - ${Ce} and end - ${fe} period from given ${O}`);const _n=o.useCallback(()=>{i(!1)},[]),On=o.useCallback(()=>{g(!0)},[]),zn=o.useCallback(a=>{V(a),g(!1)},[]),Mn=o.useCallback(()=>{V([])},[]),Te=M.missingReceipts.bulkUpload.phase,Et=M.missingReceipts.bulkUpload.currentBatchId;o.useEffect(()=>{he===!0&&F==="missing_receipts"&&Te==="matching"&&Et!=null&&m(on({cacheOverride:!0}))},[he,F,Te,Et,m]);const kt=ze?.userId,jn=O.month,Ln=O.year,yt=n?.tenantId;o.useEffect(()=>{F==="missing_receipts"&&he!==!1&&Te==="idle"&&kt!=null&&yt!=null&&m(yo())},[F,he,Te,kt,yt,jn,Ln,m]),o.useEffect(()=>{e.newVendorState?.vendorDetailLocalData?.vendorName!=null?_(!0):_(!1)},[e.newVendorState?.vendorDetailLocalData?.vendorName]),o.useEffect(()=>{ge!=null&&F!==ge&&m(nn(ge))},[ge]),o.useEffect(()=>{Xe!==!1||ie.fetchState!=="Completed"&&ie.fetchState!=="Error"||!d||(hn(!0),m(Ot(!1,!1,te)))},[Xe,ie,d,te]),o.useEffect(()=>{!at&&d&&(m(Ot(!1,!1,te)),m(de(O,Se,!1,!1)))},[O.month,O.year,d,te]);const bt=o.useCallback((a=!1,U=!1)=>{const L={start:Ce,end:fe};switch(F){case"transaction_categorization":m(me(je,L,a,!Oe,void 0,void 0,U,void 0,te)),nt(!1);break;case"flux_analysis":m(xe(O,a,U,null));break;case"month_end_insights":if(U===!1){const $=new Date(O.year,O.month,0),w=To($.toDateString()).format(pn.analytics.YYYYDashMMDashDDFormat);m(vo(!0,n.companyId,n.tenantId,w)),m(Ao(n.companyId,n.tenantId))}break;case"je_schedules":m(bo(L,U));break;case"missing_receipts":m(an(L,{amount:75,currencyCode:"USD",currencySymbol:"$"},a,U));break;default:m(de(O,Se,a,U))}},[F,Ce,fe,n.companyId,n.tenantId,je,O,Se,Oe,nt,te]);o.useEffect(()=>{F===ge&&ie.fetchState==="Not-Started"&&d&&bt(!0)},[ie,Ce,fe,n.companyId,n.tenantId,d]),o.useEffect(()=>{at||Oe||et.current||wn.fetchState==="In-Progress"||ie.fetchState!=="Completed"||(et.current=!0,bt(!0,!0))},[]),o.useEffect(()=>{Q.fetchState!=="In-Progress"&&Q.fetchState!=="Completed"&&m(Ee({tenantId:n.tenantId,period:O,refreshViewInBackground:!1}))},[Q.fetchState,n.tenantId]),o.useEffect(()=>{M.monthEndInsights?.previewMonthEndReportStatus?.fetchState==="Completed"?i(!0):i(!1)},[M.monthEndInsights?.previewMonthEndReportStatus?.fetchState]),o.useEffect(()=>{M.monthEndInsights?.sendMonthEndReportStatus?.fetchState==="Completed"&&d&&(m(Ee({tenantId:n.tenantId,period:O,refreshViewInBackground:!0})),m(wo({companyId:n.companyId})),v("../"))},[M.monthEndInsights?.sendMonthEndReportStatus?.fetchState,n.tenantId,O,n.companyId,d]),o.useEffect(()=>{const a=setInterval(()=>{Q.fetchState!=="In-Progress"&&Q.fetchState==="Completed"&&m(Ee({tenantId:n.tenantId,period:O,refreshViewInBackground:!0}))},3e5);return()=>clearInterval(a)},[Q.fetchState,n.tenantId,O,m]),o.useEffect(()=>{const a=setInterval(()=>{F==="reconciliation"&&Se==null&&M.reconciliation.fetchStatus.fetchState==="Completed"&&M.reconciliation.refreshStatus.fetchState!=="In-Progress"&&m(de(O,void 0,!0,!0))},3e5);return()=>clearInterval(a)},[F,m,M.reconciliation.fetchStatus.fetchState,M.reconciliation.refreshStatus.fetchState,de,Se,O]);const $n=Lt();o.useEffect(()=>{const a=(Q.monthEndCloseChecks?.monthEndCloseCheckList.find(U=>U.id==="month_end_insights")?.isDisabled??!1)&&!ot;F!=="month_end_insights"||!a&&Q.monthEndCloseChecks?.reportEmailSentDate==null||v("../")},[F,Q.monthEndCloseChecks]);const qn=r===!0?C:B,Gn=r===!0||T===!0,Nn=r===!0?I:t;o.useEffect(()=>{ft==="In-Progress"&&Le.accountSettingsView.saveState.fetchState==="Completed"&&m(zt())},[ft,Le.accountSettingsView.saveState.fetchState,zt]);const{transactionId:Tt,onSaveVendor:Yn,onSaveSuccess:Jn,onCancel:Kn,vendorViewDetails:Qn}=(({expenseAutomationViewSelector:a,closeDrawerHandler:U,currentSelectedView:L,isUncategorizedExpenseCategoryEnabled:$})=>{const w=pe();let H,J,Z;const N=Lt(),W=a.transactionView;let vt=()=>{};const{transactions:Hn,selectedTransactionId:ue,selectedTransactionLineId:ve,transactionLocalData:Wn}=W;if(L==="transaction_categorization"){const $e=Wn.find(re=>re.transactionId===ue),K=Hn.find(re=>re.id===ue),At=ve!=null?$e?.transactionReviewLocalData?.lineItemById[ve]:void 0,wt=At?.account;J=At?.class?.classId,H=["Uncategorized Income","Uncategorized Expense"].includes(wt?.accountName??"")?void 0:wt?.accountId;const ea=ms(ue,K?.typeOfTransaction);K!=null&&ea&&(Z={id:ue,type:Qe(K.typeOfTransaction)}),vt=()=>{if(ue!=null&&ve!=null&&K!=null){const re=W.transactionLocalData.find(Ae=>Ae.transactionId===ue)?.transactionReviewLocalData;if(re!=null&&K.lines!=null&&K.lines.length>0){const Ae=re.lineItemById[ve];let qe=re.selectedEntity;if(Ia(K)||(qe=Ae.selectedEntityLine),qe!=null){const ta=qe,na={transactionId:{id:K.id,type:K.type},transaction:K,lineIds:K.lines.map(aa=>aa.id)??[]};w(Ze({entity:ta,amount:Ae.amount.amount,transactionDetails:na,flowType:"categorization",selectedTab:a.selectedTransactionCategorizationTab,isFetchCOT:N,isUncategorizedExpenseCategoryEnabled:$}))}}}}}const Xn=x($e=>Pt($e,void 0,H,J));return{transactionId:Z,onSaveVendor:()=>{w(fa(Z,void 0,!1,!0))},onSaveSuccess:vt,onCancel:()=>{Z!=null&&w(Sa({transactionId:Z})),w(ga()),w(Ca()),U()},vendorViewDetails:Xn}})({expenseAutomationViewSelector:M,closeDrawerHandler:()=>{_(!1)},currentSelectedView:F,isUncategorizedExpenseCategoryEnabled:te}),Zn={events:n.companyId!=null?[`private-encrypted-${n.companyId}.${un}`,`private-encrypted-${n.companyId}.${mn}`]:[],eventCallback:(a,U,L)=>{L.onReconciliationPusherEventReceived(a)}};return gn?.loggedInUserRoleMap==null?Q.fetchState==="Error"?h.jsx(os,{onGoHome:()=>v("../",{replace:!0}),onReload:()=>window.location.reload()}):h.jsx(rn,{fetchState:"In-Progress"}):h.jsxs(h.Fragment,{children:[h.jsx(hs,{isOpen:b,drawerLeftMargin:new ss(0,0,300,650),onClose:()=>{g(!1)},children:h.jsx(Ts,{onClick:a=>a.stopPropagation(),children:h.jsx(fs,{companyId:n.companyId,closeCustomerRequestDrawer:()=>g(!1),addCustomerRequest:zn,resetCustomerRequest:Mn})})}),Tt!=null&&z&&h.jsx(ds,{isOpen:z,transactionId:Tt,onSaveVendor:Yn,onSaveSuccess:Jn,onCancel:Kn,vendorViewDetails:Qn}),h.jsx(ys,{...Zn,navigate:v,location:S,themeState:ee,categoryOptions:Tn,classesForFilters:An,accountsForFilters:vn,vendorSearchAutoCompleteData:{autoCompleteText:Vn,entityAutoCompleteView:bn},expenseAutomationViewSelector:M,isMissingReceiptsBulkUploadEnabled:he,monthEndInsightsPreviewMode:c,monthEndInsightsCustomerRequestData:A,isRealtimeInsightsFeatureEnabled:ot,isCreateTransferEntryFromExpenseEnabled:st,isUncategorizedExpenseCategoryEnabled:te,isAccountingClassesEnabled:Bn,isProjectsTransactionsEnabled:En,isCOTEnabled:$n,isJEScheduleCOTEnabled:kn,currentTenant:n,companyId:n.companyId,signedInUser:ze,isTransactionActivityEnabled:Me,isRightPanelOpen:Fn,rightSidePanel:Ct,onOpenTransferRightPanel:st===!0?Ve:void 0,uncategorizedAccounts:Un,onClickCustomerRequest:On,handleEditClick:_n,tenantEmailDomain:Sn,trackExpenseAutomationTabAnalytics:G,setActivityLogTransactionId:se,closeSidePanel:Nn,openTransactionPanel:l,sidePanelIsOpen:Gn,sidePanelIsFullView:r!==!0&&f,panelContent:qn,isAiCfoAccessEnabled:P,onAskAiCfoClick:_e,isExpenseAutomationCommentingEnabled:In,onExpenseAutomationCommentingThreadClick:yn,sidePanelListPercent:r===!0?66:void 0}),ne.showPopup&&ne.popupType!=null&&h.jsx(cs,{popupType:ne.popupType,currencySymbol:ne.currencySymbol,accountId:ne.popupAccountId??"",accountName:ne.popupAccountName??"",onSubmit:ne.handleSubmit,onDismiss:ne.handleDismiss})]})})),Ts=Ue(sa)`
21
+ `;function fs({companyId:t,closeCustomerRequestDrawer:l,addCustomerRequest:B,resetCustomerRequest:f}){const T=Be.getSignedInUser();if(T==null)throw Error("Can't access Customer Request page without signing in...");const C=x(r=>ha(r,t,T));return o.useEffect(()=>{f()},[]),h.jsx(h.Fragment,{children:C.fetchState==="In-Progress"||C.companyMonthEndReportTemplatesData.fetchState==="In-Progress"?h.jsx(rn,{fetchState:"In-Progress"}):h.jsx(Go,{onCloseClick:l,addCustomerRequest:B,snippets:C.companyMonthEndReportTemplatesData,bulletPoints:C.zeniRequestsData??[]})})}const Is=t=>t.sections.generalExpense.vendors.length+t.sections.reimbursement.vendors.length,un="reconciliation-status-updated",mn="statement-status-updated",{common:{strings:{hyphen:Es,comma:Gt,space:ks}},dateFormat:pn}=No.getLocalizedStrings(),Nt=jo,ys=ca(function(t,l){const{uncategorizedAccounts:B,vendorSearchAutoCompleteData:f,monthEndInsightsCustomerRequestData:T,monthEndInsightsPreviewMode:C,companyId:r,isMissingReceiptsBulkUploadEnabled:I,isTransactionActivityEnabled:s}=l,p=Be.getSignedInUser(),u=t.tenantState.currentTenantId,k={userId:p?.userId??"",sessionId:p?.zeniSessionId??"",tenantId:u??""},v=Ie(t),{selectedTransactionCategorizationTab:S}=v;return{expenseAutomationViewSelector:v,bulkUploadSelector:I===!0?v.missingReceipts.bulkUpload:void 0,vendorSearchAutoCompleteData:f,authParams:k,receiptUploadEndpoint:`${Pe.accountMicroServiceBaseUrl}`,transactionAttachmentsEndpoint:`${Ko}/transaction_attachments`,bulkUploadEndpoint:I===!0?`${Pe.communicationAgentMicroServiceBaseUrl}/1.0/receipts/bulk-upload`:void 0,isDisabled:!1,currentTab:S,monthEndInsightsCustomerRequestData:T,monthEndInsightsPreviewMode:C,allThreadsSectionOpen:!1,enableMonthEndInsightsZeniGPTFeature:!1,loggedInUser:p,uncategorizedAccounts:B,companyId:r,isTransactionActivityEnabled:s}},function(t,l){const{themeState:B,isAccountingClassesEnabled:f,isCOTEnabled:T,isUncategorizedExpenseCategoryEnabled:C,isMissingReceiptsBulkUploadEnabled:r,location:I,vendorSearchAutoCompleteData:s,expenseAutomationViewSelector:p,currentTenant:u,uncategorizedAccounts:k,navigate:v,onClickCustomerRequest:S,handleEditClick:m,setActivityLogTransactionId:P}=l,{selectedPeriod:E,currentSelectedView:y,reconciliation:{selectedAccountId:d}}=p,{accountSettingsView:G}=p.jeSchedules,ee=tn(E),z=Fe(ee.start),V=Fe(ee.end);return{onZeniLogoClick:()=>{B.toggle()},onUploadReceiptAttachment:e=>{q.trackMissingReceiptAttached(E.month,E.year),t(mo(e))},onUploadTransactionReceipt:(e,n,c,i,b,g)=>{t(Vt(e,n,{fetchState:"In-Progress"}));const A=()=>t(Vt(e,n,{fetchState:"Error"}));Qo(`${Pe.accountMicroServiceBaseUrl}/1.0/transactions/${n}/attachments`,g,n,c,i,b).then(_=>{_!=null?t(uo(e,_)):A()}).catch(A)},onMissingReceiptsRowClick:(e,n)=>{if(l.openTransactionPanel)return void l.openTransactionPanel(e,n);const c=ae(I.state?.pathnameStackToGoBack,I.pathname);v(`../../transaction/${n}/${e}`,{state:{pathnameStackToGoBack:c,message:"expenseAutomation",origin:"missing_receipts"}})},onUploadReceiptComplete:(e,n)=>{t(ro(e,n)),u!=null&&t(Ee({tenantId:u.tenantId,period:n,refreshViewInBackground:!0}))},onUploadReceiptFetchStatus:(e,n,c,i)=>{t(lo(e,{fetchState:n,error:c})),c!=null&&t(Bt({messageSection:"missing_receipts_attachment",messageText:"failed",type:"error",showStatusIcon:!0,variables:[{variableName:"__message__",variableValue:i!=null?ks+Es+i+Gt:Gt}]}))},onUpdateJESchedulesUIState:e=>{t(io(e))},onUpdateMissingReceiptsUIState:e=>{t(co(e))},onFetchMissingReceiptsList:()=>{V!=null&&z!=null&&t(an({start:z,end:V},{amount:75,currencyCode:"USD",currencySymbol:"$"},!0,!1))},...r===!0?{onBulkUploadFiles:e=>{t(Mo(e))},onBulkUploadProgress:e=>{t(zo(e))},onBulkUploadSuccess:e=>{t(Oo({batchId:e}))},onBulkUploadUploadedFileCount:e=>{t(Vo(e))},onConfirmBulkUploadMatch:(e,n,c,i,b)=>{t(_o(e,n,c,i,b))},onBulkUploadConfirmMatchAcknowledged:()=>{t(Bo())},onSetBulkUploadResultsTab:e=>{t(Uo(e))},onSetBulkUploadCompletedSubTab:e=>{t(Fo(e))},onSetBulkUploadSortConfig:(e,n)=>{t(Mt({sortKey:e,sortOrder:n}))},onClearBulkUpload:()=>{t(Do())},onSearchTransactionsForManualMatch:(e,n)=>{t(Nt(e,n??void 0))},onLoadMoreManualSearch:()=>{const{manualSearch:e}=p.missingReceipts.bulkUpload;e.nextPageToken!=null&&e.searchQuery!==""&&t(Nt(e.searchQuery,e.nextPageToken))},onFetchCompletedTransactions:(e,n)=>{t(Ro(e,n))},onClearBulkUploadBatchDetailsForScopeChange:()=>{t(Po())},onFetchBulkUploadBatches:e=>{t(on(e))},onFetchMoreBatchDetails:()=>{t(xo())},onResetBulkUploadSort:()=>{t(Mt({sortKey:void 0,sortOrder:void 0}))}}:{},onClearMissingReceiptsTabNavigation:()=>{t(so())},onSearchTextChanged:e=>{const n=p.currentSelectedView,c=p.selectedTransactionCategorizationTab;n==="transaction_categorization"&&(t(Ne({selectedTab:c,uiState:{searchString:e}})),V!=null&&z!=null&&t(me(c,{start:z,end:V},!0,!1,e,void 0,!1,!0)))},onFiltersChange:e=>{const n=p.selectedTransactionCategorizationTab;t(oo({filters:e,selectedTab:n}))},onRefresh:()=>{l.trackExpenseAutomationTabAnalytics(!0),t(ao(C))},onClose:()=>{y==="reconciliation"&&d!=null&&t(_t({selectedAccountId:void 0})),v("../")},onBack:()=>{y==="reconciliation"&&d!=null&&t(_t({selectedAccountId:void 0}))},onSaveReconciliation:e=>{t(no(e))},onSaveReconciliationReview:e=>{t(to(e))},onUpdateStep:e=>{const{selectedPeriod:n}=p,c=ae(I.state?.pathnameStackToGoBack,I.pathname);v(`../${e}/${n.month}-${n.year}`,{state:{pathnameStackToGoBack:c,referrer:p.currentSelectedView}}),t(nn(e))},handleLogOutClick:()=>{const e=ae(I.state?.pathnameStackToGoBack,I.pathname);v("/signout",{replace:!0,state:{pathnameStackToGoBack:e,message:"logout"}})},onJeAccountSettingsChange:e=>{const{vendorsAccountSection:n}=e,{prepaidExpensesAccount:c,fixedAssetsAccount:i,accruedExpensesAccount:b}=n,g=Ye(G.prepaidExpensesAccountList,c.selectedOptions),A=Ye(G.fixedAssetsAccountList,i.selectedOptions),_=Ye(G.accruedExpensesAccountList,b.selectedOptions),R={selectedPrepaidExpensesAccountIds:g.map(D=>D.accountId),selectedFixedAssetsAccountIds:A.map(D=>D.accountId),selectedAccruedExpensesAccountIds:_.map(D=>D.accountId)};t(eo({data:R}))},onSaveJeAccountSettingsClick:()=>{t(Xa())},onJESchedulesFormDataChange(e,n){const{jeScheduleID:c,accumulatedDepreciationCategory:i,scheduleClass:b,scheduleExpenseCategory:g,vendor:A}=n,{allAccountList:_,allClassList:R,allDepreciationAccountList:D}=p.jeSchedules,j=s.entityAutoCompleteView.vendor.length>0?s.entityAutoCompleteView.vendor.find(J=>J.id===A?.selectedOption):void 0,oe={id:j?.zeniId??A?.selectedOption??"",name:j?.name??A?.defaultOptions.find(J=>J.value===A?.selectedOption)?.label??"",logo:j?.logo},se=g?.selectedOption!=null?_.find(J=>J.qboId===g.selectedOption):void 0,_e=b?.selectedOption!=null?R.find(J=>J.classId===b.selectedOption):void 0,Ve=i?.selectedOption!=null?D.find(J=>J.qboId===i.selectedOption):void 0;t(Ha({scheduledJournalEntryID:e,localData:{jeScheduleID:c,scheduledJournalEntryID:e,updatedCategoryId:se?.accountId,updatedClassId:_e?.classId,updatedAccumulatedDepreciationCategoryID:Ve?.accountId,updatedVendor:{id:oe.id,name:oe.name}}}))},ignoreRecommendedJeSchedule(e,n){t(Za(e,n))},vendorSearchAutoCompleteActions:{onAutoCompleteInputChange:(e,n)=>{e.trim().length>=2?t(Rt({searchString:e,entityType:n,searchOrigin:"common"})):e.trim().length===0&&t(we("common"))},onCancelAutoComplete:()=>{t(we("common"))}},onPostJESchedule(e,n){t(Wa({scheduledJournalEntryID:e,jeScheduleTransactionKey:n}))},clearJeScheduleLocalData(){t(Qa())},handleJeScheduleClick:(e,n,c)=>{t(Ka({selectedJEScheduleKey:n}));const i=ae(I.state?.pathnameStackToGoBack,I.pathname);v(`../../vendors/schedules/${c}/details/${e}`,{state:{pathnameStackToGoBack:i,message:"expenseAutomation",origin:"je_schedules"}})},improveMonthEndInsightsUsingZeniGPTClick:e=>{u!=null&&t(Ya(e,u.companyId,u.tenantId))},onClickCustomerRequest:S,setActivityLogTransactionId:P,onCloseAllThreadsSection:()=>{},onCloseFileAttachmentSnackBar:()=>{t(Ja())},onOpenFileAttachmentSnackBar:()=>{t(Bt({messageSection:"cockpit_month_end_email_attachment_upload",messageText:"failed",type:"error",showStatusIcon:!0}))},onRemoveFileAttachment:e=>{t(Na(e))},onUpdateFileAttachment:e=>{t(Ga({files:e}))},previewMonthEndReport:(e,n,c,i)=>{u!=null&&t(Ut(e,u.companyId,n,!0,c,i,u.tenantId))},saveMonthEndReport:(e,n,c,i)=>{u!=null&&t(Ut(e,u.companyId,n,!1,c,i,u.tenantId))},onEditMonthEndInsightsClick:m,sendMonthEndReport:e=>{const n=I.state?.referrer,{selectedPeriod:c,auditSummary:i}=p;u!=null&&i?.auditScorePercentage!=null&&(t($a(u.companyId,e,u.tenantId)),q.trackInsightsEmailPage(c.month,c.year,!1,"draft",i.auditScorePercentage,qa().format(pn.analytics.MMMDDCommaYYYYformat),n??null))},onTransactionCategorizationRowClick:(e,n)=>{if(l.openTransactionPanel)return void l.openTransactionPanel(e,n);const c=ae(I.state?.pathnameStackToGoBack,I.pathname);v(`../../transaction/${n}/${e}`,{state:{pathnameStackToGoBack:c,message:"expenseAutomation",origin:"transaction_categorization"}})},setLocalDataForCategoryAndClass:(e,n,c,i,b,g,A,_,R,D,j,oe,se)=>{t(La(e,n,c,i,k,b,g,A,_,R,D,j,oe,se))},onCancelAutoComplete:()=>{t(we("common"))},updateExpenseAutomationReconListScrollPosition:e=>{t(Dt({scrollPosition:e}))},onUpdateTab:e=>{l.closeSidePanel?.(),V!=null&&z!=null&&(t(me(e,{start:z,end:V},!1,!1)),t(ja(e)))},onUpdateTransactionCategorizationCompletedSubTab:e=>{l.closeSidePanel?.(),V!=null&&z!=null&&(t(Ma(e)),t(me("autoCategorized",{start:z,end:V},!1,!1)))},onUpdateTransactionCategorizationUIState:(e,n)=>{t(Ne({selectedTab:e,uiState:n})),V!=null&&z!=null&&t(me(e,{start:z,end:V},!1,!1,n.searchString,null,!0))},onUpdateScrollYOffSetTransactionCategorizationUIState:(e,n)=>{t(Ne({selectedTab:e,uiState:n}))},onFetchTransactionCategorizationList:(e,n,c,i,b,g,A)=>{V!=null&&z!=null&&t(me(e,{start:z,end:V},!0,c,n,i,b,g,A))},resetTransactionCategorizationLocalData:(e,n,c,i,b,g,A,_)=>{t(za(e,n,c,i,_??null,b,g,!1,A))},updateSelectedVendorForTransaction:(e,n,c,i,b)=>{t(Ft({selectedTab:e,transactionId:n,lineId:c,selectedTransaction:i,uncategorizedAccounts:k,updatedVendor:b,isAccountingClassesEnabled:f}))},onSaveUpdateTransactionCategorization:(e,n,c)=>{const i=I.state?.referrer;e==="autoCategorized"?q.trackTransactionsAutoCategorisedPage(E.month,E.year,p.transactionView.totalCountByTab.autoCategorized,n.length,!1,i??null):q.trackTransactionsReviewPage(E.month,E.year,p.transactionView.totalCountByTab.review,n.length,!1,i??null),t(Oa(e,n,c,C))},onUpdateSelectedCheckboxTransactionIds:(e,n)=>{t(Va({selectedTab:e,transactionIds:n}))},onFetchRecommendationsForEntityCategorizationWithCustomer:(e,n,c,i,b,g,A)=>{const{transactionId:_,transaction:R,lineIds:D}=n;g!=null&&t(Ba({transactionId:_,customerUpdates:g})),t(_a({selectedTab:i,transactionId:_.id,lineId:D[0],selectedTransaction:R,uncategorizedAccounts:k,updatedCustomer:g,selectedEntity:b,isAccountingClassesEnabled:f,isUncategorizedExpenseCategoryEnabled:A})),b!=null&&t(We({entity:b,amount:e,transactionDetails:n,flowType:"categorization",selectedTab:i,isFetchCOT:T,isUncategorizedExpenseCategoryEnabled:A}))},onFetchRecommendationsForEntityCategorization:(e,n,c,i,b,g,A)=>{const{transactionId:_,transaction:R,lineIds:D}=n;g!=null&&(t(Da({transactionId:_,vendorUpdates:{name:g.name,id:g.id?g.id:void 0}})),t(Fa({vendorId:g.id?g.id:void 0,localData:{vendorName:g.name,vendorId:g.id?g.id:void 0}}))),g?.id?(t(Ft({selectedTab:i,transactionId:_.id,lineId:D[0],selectedTransaction:R,uncategorizedAccounts:k,updatedVendor:g,selectedEntity:b,isAccountingClassesEnabled:f,isUncategorizedExpenseCategoryEnabled:A})),b!=null&&t(We({entity:b,amount:e,transactionDetails:n,flowType:"categorization",selectedTab:i,isFetchCOT:T,isUncategorizedExpenseCategoryEnabled:A}))):t(Ua({selectedTab:i,transactionId:_.id,lineId:D[0]}))},fetchFluxViewOnScroll:(e,n)=>{t(xe(e,!0,!1,n,!1,!0))},onFetchFluxViewList:()=>{t(xe(E,!0,!1,null,!1,!1))},markAsReview:(e,n,c,i)=>{q.trackFluxAnalysisReviewed(c.month,c.year,i??!1,e),t(Ra(n,e,c,i??!1))},onUpdateFluxAnalysisUIState:e=>{t(Pa(e))},updateOperatingExpensesIdsForReview:e=>{t(xa({operatingExpenseIds:e,selectedPeriod:E}))},redirectToVendorDetailPage:e=>{if(l.tenantEmailDomain!=null){const n=ps(e.id,e.qboId,l.tenantEmailDomain),c=ae(l.location.state?.pathnameStackToGoBack,l.location.pathname);l.navigate(n,{state:{pathnameStackToGoBack:c,message:"expenseAutomation",referrer:"Vendor List",origin:"flux_analysis"}})}},updateSectionIdsForReview:e=>{t(wa({sectionId:e,selectedPeriod:E}))},onFetchReimbursementView:(e,n,c)=>{t(xe(e,!0,!1,n,!0,c))},onReviewClicked:e=>{t(de(E,e))},setOpenDrawerClicked:e=>{t(De({selectedDrawerAccountId:e}))},onFetchLinkTokenClick:(e,n)=>{t(Ht("expense_automation_reconcile",e,n))},onEstablishConnectionClick:(e,n)=>{const c=u?.companyId;c!=null&&(t(Xt(e,c,"expense_automation_reconcile",void 0,"link_account_no_microdeposit",n)),t(en({accountId:n,connectionInProgress:!0})))},onAddStatementClick:e=>{t(De({selectedDrawerAccountId:e})),t(Zt({accountId:e,selectedPeriod:E,localData:{accountSource:"bank_statement"}})),t(Wt({statementUploadChosen:!0}))},onReloadReconciliationListPage:()=>{t(de(E,void 0,!0,!1))},onUpdateReconcileTabLocalData:e=>{t(Aa({selectedTransactionIds:e}))},onReconTabColumnSortConfigChanged:(e,n)=>{t(va({sortKey:e,sortOrder:n}))},onReconReviewTabColumnSortConfigChanged:(e,n)=>{t(Ta({sortKey:e,sortOrder:n}))},onReconTabUpdate:e=>{l.closeSidePanel?.(),t(ba({selectedTab:e}))},updateReconReviewTabLocalData:(e,n,c)=>{const i=e.vendor?.id;c&&i!=null&&t(ka(i)),t(ya({data:e,transactionId:n}))},onReconMatchedTransactionClick:e=>{if(l.openTransactionPanel)return void l.openTransactionPanel(e,Qe("bill"));const n=ae(I.state?.pathnameStackToGoBack,I.pathname);v(`../../transaction/bill/${e}`,{state:{pathnameStackToGoBack:n,message:"expenseAutomation",origin:"reconciliation"}})},onReloadPage:()=>{window.location.reload()},onBackClick:()=>{v(-1)},onReconListPageScroll:e=>{t(Dt({scrollPosition:e}))},onVendorAutoCompleteInputChange:e=>{e.trim().length>=2?t(Rt({searchString:e,searchOrigin:"common"})):e.trim().length===0&&t(we("common"))},onReconNodeCollapseToggled:(e,n)=>{t(Ea({nodeId:e,collapsed:n}))},updateSectionCollapseStatus:()=>{},onExcludeAccountFromReconciliation:e=>{t(Kt({accountId:e}))},onIncludeAccountIntoReconciliation:e=>{t(Qt({accountId:e}))},onReconciliationPusherEventReceived:e=>{e!==un&&e!==mn||y!=="reconciliation"||t(de(E,d,!0,!0))}}},(t,l,B)=>{const{isMissingReceiptsBulkUploadEnabled:f,...T}=B;return function(C,r,I){return{...C,...r,...I,onUploadTransactionReceipt:(s,p,u,k,v)=>{r.onUploadTransactionReceipt(s,p,u,k,v,C.authParams)}}}(t,l,T)})(Jo(Yo)),bs=us(function(t){const l=t.displayName??t.name??"Component",B=Jt.memo(t),f=T=>{const C=pe(),r=function(){const P=pe(),E=x(y=>Ie(y).reconciliation.selectedDrawerAccountId);return{isOpen:E!=null,selectedAccountId:E,openPanel:o.useCallback(y=>{P(De({selectedDrawerAccountId:y}))},[P]),closePanel:o.useCallback(()=>{P(De({selectedDrawerAccountId:void 0}))},[P])}}(),I=x(P=>Ie(P).reconciliation),s=x(P=>Re(P)),p=o.useCallback((P,E)=>{C(Ht("expense_automation_reconcile",P,E))},[C]),u=o.useCallback((P,E)=>{const y=s?.companyId;y!=null&&(C(Xt(P,y,"expense_automation_reconcile",void 0,"link_account_no_microdeposit",E)),C(en({accountId:E,connectionInProgress:!0})))},[C,s?.companyId]),k=o.useMemo(()=>{if(r.isOpen&&r.selectedAccountId!=null)return h.jsx(Cs,{reconciliation:I,selectedDrawerAccountId:r.selectedAccountId,onClose:r.closePanel,onFetchLinkTokenClick:p,onEstablishConnectionClick:u})},[r.isOpen,r.selectedAccountId,r.closePanel,I,p,u]),v=o.useMemo(()=>({reconPanelContent:k,reconSidePanelIsOpen:r.isOpen,closeReconSidePanel:r.closePanel}),[k,r.isOpen,r.closePanel]),S=o.useContext(jt),m=o.useMemo(()=>r.isOpen?{closePanel:r.closePanel,selectedItemId:r.selectedAccountId}:S,[r.isOpen,r.closePanel,r.selectedAccountId,S]);return h.jsx(jt.Provider,{value:m,children:h.jsx(B,{...T,...v})})};return f.displayName=`withReconSidePanel(${l})`,f}(({closeSidePanel:t,openTransactionPanel:l,panelContent:B,sidePanelIsFullView:f,sidePanelIsOpen:T,reconPanelContent:C,reconSidePanelIsOpen:r,closeReconSidePanel:I})=>{const{isAiCfoOpen:s,setIsAiCfoOpen:p}=Wo(),u=Zo(),{isOpen:k}=Ho(),v=Yt(),S=Ke(),m=pe(),{isAiCfoAccessEnabled:P,onAskAiCfoClick:E}=dn({mobileExploreReferrer:"Transaction categorization"}),y=o.useCallback(()=>{T===!0&&f!==!0&&t?.()},[t,T,f]),{areTenantIdsInSync:d}=cn(),G=(()=>{const a=x(N=>Ie(N)),U=Ke(),{currentSelectedViewFetchState:L,currentSelectedView:$,selectedPeriod:w}=a,Z=Je($),Y=Je(L.fetchState),W=o.useCallback(N=>{const H=U.state?.referrer;$==="transaction_categorization"&&(a.selectedTransactionCategorizationTab==="review"?q.trackTransactionsReviewPage(w.month,w.year,a.transactionView.totalCountByTab.review,0,N,H??null):q.trackTransactionsAutoCategorisedPage(w.month,w.year,a.transactionView.totalCountByTab.autoCategorized,0,N,H??null)),$==="missing_receipts"&&q.trackMissingReceiptsPage(w.month,w.year,N,a.missingReceipts.transactions.length,H??null),$==="je_schedules"&&q.trackMonthCloseScheduleListPage(w.month,w.year,N,a.jeSchedules.draftSchedules.length,a.jeSchedules.resolveSchedules.length,H??null),$==="flux_analysis"&&q.trackFluxAnalysisPage(w.month,w.year,N,Is(a.fluxAnalysis),H??null),$==="month_end_insights"&&a.auditSummary?.auditScorePercentage!=null&&q.trackInsightsEmailPage(w.month,w.year,N,"draft",a.auditSummary.auditScorePercentage,null,H??null)},[w,a]);return o.useEffect(()=>{Y===L.fetchState&&$===Z||L.fetchState!=="Completed"||W(!1)},[$,L.fetchState,Z]),W})(),ee=Xo(),[z,V]=o.useState(!1),e=x(a=>Pt(a)),n=x(a=>Re(a)),[c,i]=o.useState(!1),[b,g]=o.useState(!1),[A,_]=o.useState([]),[R,D]=o.useState(null),j=o.useCallback(()=>{D(null)},[]),oe=R?.contentType==="activity"?R.detail.transactionId:void 0,se=o.useCallback(a=>{a!=null?(s&&p(!1),u(),y(),D({contentType:"activity",detail:{transactionId:a}})):D(U=>U?.contentType==="activity"?null:U)},[y,s,u,p]),_e=o.useCallback(a=>{s&&p(!1),u(),y(),D({contentType:"transfer",detail:a})},[y,s,u,p]),Ve=o.useCallback(()=>{u(),j(),y(),E()},[y,j,E,u]),J=o.useRef(s);o.useEffect(()=>{s===!0&&J.current===!1&&(u(),j(),y()),J.current=s},[y,j,s,u]);const Ze=o.useRef(k);o.useEffect(()=>{k===!0&&Ze.current===!1&&(s&&p(!1),j(),T===!0&&f!==!0&&t?.()),Ze.current=k},[j,t,k,s,p,f,T]);const ke=T===!0&&f!==!0,He=o.useRef(ke);o.useEffect(()=>{ke&&!He.current&&(s&&p(!1),u(),j()),He.current=ke},[j,s,ke,u,p]);const[Xe,hn]=o.useState(!1),et=o.useRef(!1),{selectedTab:tt}=xt(),{tenantEmailDomain:Sn}=xt(),[Oe,nt]=o.useState(S.state?.message==="comingFromTransactionDetail"),at=S.state?.message==="comingFromOverview",gn=es(),ze=Be.getSignedInUser(),{useDynamicConfig:Cn,useFeatureGate:ce}=sn(),{configValue:fn}=Cn(ts.enableUncategorizedExpenseCategory),te=fn?.uncategorized_expense_category_enabled===!0,{isFeatureEnabled:ot}=ce(X.isRealtimeInsightsFeatureEnabled),{isFeatureEnabled:he}=ce(X.isMissingReceiptsBulkUploadEnabled),{isFeatureEnabled:Me}=ce(X.isTransactionActivityEnabled),{isFeatureEnabled:st}=ce(X.isCreateTransferEntryFromExpenseEnabled),{isFeatureEnabled:In}=ce(X.isExpenseAutomationCommentingEnabled),{isFeatureEnabled:En}=ce(X.isProjectsTransactionsEnabled),{isFeatureEnabled:kn}=ce(X.isJEScheduleCOTEnabled),yn=o.useCallback(a=>{const U=Qe(a.view==="reconciliation"?"bill":"expense");l?.(a.entityId,U)},[l]),bn=x(a=>po(a,"common")),M=x(a=>Ie(a)),{categoryOptions:Tn,paymentAccountNames:vn}=x(a=>ho(a.accountState)),An=x(a=>So(a.classState)),{monthEndCloseChecksView:Q,currentSelectedView:F,selectedPeriod:O,selectedTransactionCategorizationTab:je,currentSelectedViewBackgroundRefreshFetchState:wn,currentSelectedViewFetchState:ie,jeSchedules:Le,reconciliation:xn}=M;is(F==="transaction_categorization");const Pn=M.transactionView.saveStatus.fetchState,ct=M.transactionView.transactions,it=o.useRef(ct);it.current=ct;const lt=x(a=>a.expenseAutomationTransactionsViewState?.transactionCategorizationView),rt=x(a=>a.expenseAutomationTransactionsViewState?.selectedTransactionCategorizationTab),dt=o.useRef(lt);dt.current=lt;const ut=o.useRef(rt);ut.current=rt;const ne=ls(Pn,()=>{const a=[],U=ut.current,L=dt.current,$=L!=null&&U!=null?L[U]:void 0;if($?.transactionReviewLocalDataById!=null)for(const Z of Object.values($.transactionReviewLocalDataById)){const Y=Z?.transactionReviewLocalData?.lineItemById;if(Y!=null)for(const W of Object.values(Y)){const N=W?.account;N?.accountId!=null&&a.push(N.accountId)}}const w=it.current;for(const Z of w)for(const Y of Z.lines??[])"account"in Y&&Y.account?.accountId!=null&&a.push(Y.account.accountId);return a});o.useEffect(()=>{F==="transaction_categorization"&&T!==!0||se(void 0)},[F,se,T]);const Rn=M.transactionView.selectedTransactionCategorizationCompletedSubTab,ye=`${je}|${Rn}`,be=o.useRef(null);o.useEffect(()=>{be.current!==null?be.current!==ye&&(be.current=ye,F==="transaction_categorization"&&j()):be.current=ye},[j,F,ye]);const Dn=x(a=>oe==null?void 0:go(a.transactionState,oe)),le=Dn?.qboId,mt=x(a=>le==null?void 0:Co(a,le));o.useEffect(()=>{le!=null&&m(fo(le))},[m,le]);const{createTransferEntryStatus:pt,creditCardTransferAccountsList:ht,transferAccounts:St}=M.transactionView,gt=o.useCallback(a=>rs(m,a),[m]),Ct=o.useMemo(()=>F!=="transaction_categorization"||R==null?null:R.contentType==="activity"?Me===!0?h.jsx(ns,{activityLogView:mt,qboId:le,onClose:()=>D(null),selectedTransactionId:R.detail.transactionId,isQuickViewCardStyle:!0},String(R.detail.transactionId)):null:R.contentType==="transfer"?h.jsx(as,{createTransferEntryStatus:pt,transaction:R.detail,transferAccounts:R.detail.transactionType==="credit_card_payment"?ht:St,onClose:()=>D(null),onCreateTransfer:gt,isQuickViewCardStyle:!0},String(R.detail.transactionId)):null,[F,R,Me,mt,le,pt,ht,St,gt]),Fn=Ct!=null,{selectedAccountId:Se}=xn,ft=Je(Le.accountSettingsView.saveState.fetchState),Un=x(a=>Io(a.accountState,a.accountListState,"accountList")),Bn=x(a=>Eo(a)),ge=tt!=null?ko(tt):F,_n=x(a=>a.entityAutoCompleteState.autoCompleteText.common);if(ln({isDataReady:ie.fetchState==="Completed"}),ze==null)throw Error("Can't access expense automation screen without signing in...");const It=tn(O),Ce=Fe(It.start),fe=Fe(It.end);if(Ce==null||fe==null)throw Error(`Invalid start - ${Ce} and end - ${fe} period from given ${O}`);const Vn=o.useCallback(()=>{i(!1)},[]),On=o.useCallback(()=>{g(!0)},[]),zn=o.useCallback(a=>{_(a),g(!1)},[]),Mn=o.useCallback(()=>{_([])},[]),Te=M.missingReceipts.bulkUpload.phase,Et=M.missingReceipts.bulkUpload.currentBatchId;o.useEffect(()=>{he===!0&&F==="missing_receipts"&&Te==="matching"&&Et!=null&&m(on({cacheOverride:!0}))},[he,F,Te,Et,m]);const kt=ze?.userId,jn=O.month,Ln=O.year,yt=n?.tenantId;o.useEffect(()=>{F==="missing_receipts"&&he!==!1&&Te==="idle"&&kt!=null&&yt!=null&&m(yo())},[F,he,Te,kt,yt,jn,Ln,m]),o.useEffect(()=>{e.newVendorState?.vendorDetailLocalData?.vendorName!=null?V(!0):V(!1)},[e.newVendorState?.vendorDetailLocalData?.vendorName]),o.useEffect(()=>{ge!=null&&F!==ge&&m(nn(ge))},[ge]),o.useEffect(()=>{Xe!==!1||ie.fetchState!=="Completed"&&ie.fetchState!=="Error"||!d||(hn(!0),m(Ot(!1,!1,te)))},[Xe,ie,d,te]),o.useEffect(()=>{!at&&d&&(m(Ot(!1,!1,te)),m(de(O,Se,!1,!1)))},[O.month,O.year,d,te]);const bt=o.useCallback((a=!1,U=!1)=>{const L={start:Ce,end:fe};switch(F){case"transaction_categorization":m(me(je,L,a,!Oe,void 0,void 0,U,void 0,te)),nt(!1);break;case"flux_analysis":m(xe(O,a,U,null));break;case"month_end_insights":if(U===!1){const $=new Date(O.year,O.month,0),w=To($.toDateString()).format(pn.analytics.YYYYDashMMDashDDFormat);m(vo(!0,n.companyId,n.tenantId,w)),m(Ao(n.companyId,n.tenantId))}break;case"je_schedules":m(bo(L,U));break;case"missing_receipts":m(an(L,{amount:75,currencyCode:"USD",currencySymbol:"$"},a,U));break;default:m(de(O,Se,a,U))}},[F,Ce,fe,n.companyId,n.tenantId,je,O,Se,Oe,nt,te]);o.useEffect(()=>{F===ge&&ie.fetchState==="Not-Started"&&d&&bt(!0)},[ie,Ce,fe,n.companyId,n.tenantId,d]),o.useEffect(()=>{at||Oe||et.current||wn.fetchState==="In-Progress"||ie.fetchState!=="Completed"||(et.current=!0,bt(!0,!0))},[]),o.useEffect(()=>{Q.fetchState!=="In-Progress"&&Q.fetchState!=="Completed"&&m(Ee({tenantId:n.tenantId,period:O,refreshViewInBackground:!1}))},[Q.fetchState,n.tenantId]),o.useEffect(()=>{M.monthEndInsights?.previewMonthEndReportStatus?.fetchState==="Completed"?i(!0):i(!1)},[M.monthEndInsights?.previewMonthEndReportStatus?.fetchState]),o.useEffect(()=>{M.monthEndInsights?.sendMonthEndReportStatus?.fetchState==="Completed"&&d&&(m(Ee({tenantId:n.tenantId,period:O,refreshViewInBackground:!0})),m(wo({companyId:n.companyId})),v("../"))},[M.monthEndInsights?.sendMonthEndReportStatus?.fetchState,n.tenantId,O,n.companyId,d]),o.useEffect(()=>{const a=setInterval(()=>{Q.fetchState!=="In-Progress"&&Q.fetchState==="Completed"&&m(Ee({tenantId:n.tenantId,period:O,refreshViewInBackground:!0}))},3e5);return()=>clearInterval(a)},[Q.fetchState,n.tenantId,O,m]),o.useEffect(()=>{const a=setInterval(()=>{F==="reconciliation"&&Se==null&&M.reconciliation.fetchStatus.fetchState==="Completed"&&M.reconciliation.refreshStatus.fetchState!=="In-Progress"&&m(de(O,void 0,!0,!0))},3e5);return()=>clearInterval(a)},[F,m,M.reconciliation.fetchStatus.fetchState,M.reconciliation.refreshStatus.fetchState,de,Se,O]);const $n=Lt();o.useEffect(()=>{const a=(Q.monthEndCloseChecks?.monthEndCloseCheckList.find(U=>U.id==="month_end_insights")?.isDisabled??!1)&&!ot;F!=="month_end_insights"||!a&&Q.monthEndCloseChecks?.reportEmailSentDate==null||v("../")},[F,Q.monthEndCloseChecks]);const qn=r===!0?C:B,Gn=r===!0||T===!0,Nn=r===!0?I:t;o.useEffect(()=>{ft==="In-Progress"&&Le.accountSettingsView.saveState.fetchState==="Completed"&&m(zt())},[ft,Le.accountSettingsView.saveState.fetchState,zt]);const{transactionId:Tt,onSaveVendor:Jn,onSaveSuccess:Yn,onCancel:Kn,vendorViewDetails:Qn}=(({expenseAutomationViewSelector:a,closeDrawerHandler:U,currentSelectedView:L,isUncategorizedExpenseCategoryEnabled:$})=>{const w=pe();let Z,Y,W;const N=Lt(),H=a.transactionView;let vt=()=>{};const{transactions:Zn,selectedTransactionId:ue,selectedTransactionLineId:ve,transactionLocalData:Hn}=H;if(L==="transaction_categorization"){const $e=Hn.find(re=>re.transactionId===ue),K=Zn.find(re=>re.id===ue),At=ve!=null?$e?.transactionReviewLocalData?.lineItemById[ve]:void 0,wt=At?.account;Y=At?.class?.classId,Z=["Uncategorized Income","Uncategorized Expense"].includes(wt?.accountName??"")?void 0:wt?.accountId;const ea=ms(ue,K?.typeOfTransaction);K!=null&&ea&&(W={id:ue,type:Qe(K.typeOfTransaction)}),vt=()=>{if(ue!=null&&ve!=null&&K!=null){const re=H.transactionLocalData.find(Ae=>Ae.transactionId===ue)?.transactionReviewLocalData;if(re!=null&&K.lines!=null&&K.lines.length>0){const Ae=re.lineItemById[ve];let qe=re.selectedEntity;if(Ia(K)||(qe=Ae.selectedEntityLine),qe!=null){const ta=qe,na={transactionId:{id:K.id,type:K.type},transaction:K,lineIds:K.lines.map(aa=>aa.id)??[]};w(We({entity:ta,amount:Ae.amount.amount,transactionDetails:na,flowType:"categorization",selectedTab:a.selectedTransactionCategorizationTab,isFetchCOT:N,isUncategorizedExpenseCategoryEnabled:$}))}}}}}const Xn=x($e=>Pt($e,void 0,Z,Y));return{transactionId:W,onSaveVendor:()=>{w(fa(W,void 0,!1,!0))},onSaveSuccess:vt,onCancel:()=>{W!=null&&w(Sa({transactionId:W})),w(ga()),w(Ca()),U()},vendorViewDetails:Xn}})({expenseAutomationViewSelector:M,closeDrawerHandler:()=>{V(!1)},currentSelectedView:F,isUncategorizedExpenseCategoryEnabled:te}),Wn={events:n.companyId!=null?[`private-encrypted-${n.companyId}.${un}`,`private-encrypted-${n.companyId}.${mn}`]:[],eventCallback:(a,U,L)=>{L.onReconciliationPusherEventReceived(a)}};return gn?.loggedInUserRoleMap==null?Q.fetchState==="Error"?h.jsx(os,{onGoHome:()=>v("../",{replace:!0}),onReload:()=>window.location.reload()}):h.jsx(rn,{fetchState:"In-Progress"}):h.jsxs(h.Fragment,{children:[h.jsx(hs,{isOpen:b,drawerLeftMargin:new ss(0,0,300,650),onClose:()=>{g(!1)},children:h.jsx(Ts,{onClick:a=>a.stopPropagation(),children:h.jsx(fs,{companyId:n.companyId,closeCustomerRequestDrawer:()=>g(!1),addCustomerRequest:zn,resetCustomerRequest:Mn})})}),Tt!=null&&z&&h.jsx(ds,{isOpen:z,transactionId:Tt,onSaveVendor:Jn,onSaveSuccess:Yn,onCancel:Kn,vendorViewDetails:Qn}),h.jsx(ys,{...Wn,navigate:v,location:S,themeState:ee,categoryOptions:Tn,classesForFilters:An,accountsForFilters:vn,vendorSearchAutoCompleteData:{autoCompleteText:_n,entityAutoCompleteView:bn},expenseAutomationViewSelector:M,isMissingReceiptsBulkUploadEnabled:he,monthEndInsightsPreviewMode:c,monthEndInsightsCustomerRequestData:A,isRealtimeInsightsFeatureEnabled:ot,isCreateTransferEntryFromExpenseEnabled:st,isUncategorizedExpenseCategoryEnabled:te,isAccountingClassesEnabled:Bn,isProjectsTransactionsEnabled:En,isCOTEnabled:$n,isJEScheduleCOTEnabled:kn,currentTenant:n,companyId:n.companyId,signedInUser:ze,isTransactionActivityEnabled:Me,isRightPanelOpen:Fn,rightSidePanel:Ct,onOpenTransferRightPanel:st===!0?_e:void 0,uncategorizedAccounts:Un,onClickCustomerRequest:On,handleEditClick:Vn,tenantEmailDomain:Sn,trackExpenseAutomationTabAnalytics:G,setActivityLogTransactionId:se,closeSidePanel:Nn,openTransactionPanel:l,sidePanelIsOpen:Gn,sidePanelIsFullView:r!==!0&&f,panelContent:qn,isAiCfoAccessEnabled:P,onAskAiCfoClick:Ve,isExpenseAutomationCommentingEnabled:In,onExpenseAutomationCommentingThreadClick:yn,sidePanelListPercent:r===!0?66:void 0}),ne.showPopup&&ne.popupType!=null&&h.jsx(cs,{popupType:ne.popupType,currencySymbol:ne.currencySymbol,accountId:ne.popupAccountId??"",accountName:ne.popupAccountName??"",onSubmit:ne.handleSubmit,onDismiss:ne.handleDismiss})]})})),Ts=Ue(sa)`
22
22
  display: flex;
23
23
  min-height: 100%;
24
24
  flex-direction: column;
@@ -0,0 +1 @@
1
+ import{j as s}from"./liveblocks-DmbDY3sa.js";import{a as r}from"./sentry--Yi43Gx7.js";import{a3 as l,a4 as p,a5 as d,n as m}from"./index-C_Y0yMPY.js";import"./mui-1V4hRqCa.js";import c from"./NotFoundScreen-C5grvltN.js";import{h as u,g as b}from"./core-Cj3sxYL7.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]="e5992879-11fa-4121-8a97-eb0ecebef062",e._sentryDebugIdIdentifier="sentry-dbid-e5992879-11fa-4121-8a97-eb0ecebef062")}catch{}})();const _=()=>{const e=u(),a=b(),t=r.useCallback(()=>{window.open("https://www.zeni.ai/demo/request","_blank")},[]),i=r.useCallback(()=>{(()=>{const n=m(a.state?.pathnameStackToGoBack),f=n.poppedPathname??k();e(f,{state:{pathnameStackToGoBack:n.newStack}})})()},[]),o=l(a.pathname);return o!=null?s.jsx(p,{menuItem:d(o),onDemoClick:t,onGoBack:i}):s.jsx(c,{})},k=(e=2)=>{let a="../";for(let t=0;t<e;t++)a=`${a}../`;return a};export{_ as F};
@@ -1 +1 @@
1
- import{a as o}from"./sentry-B_92GPgU.js";import{u,h as l,g as m}from"./core-k_c8SCBE.js";import{ho as p,LU as g,LV as _}from"./zeni-epic-state-C3zBO1No.js";import{u as b,L as h,z as y}from"./index-B4wUHn-k.js";import"./liveblocks-D3ESVZyk.js";import"./recharts-Q-kkTNuO.js";import"./mui-UJrLjp1k.js";import"./analytics-DVTbnjlr.js";import"./plaid-B1j5PXHV.js";import"./dnd-CKEs-Nbe.js";import"./stripe-DMRn4zHo.js";import"./lottie-BYni7Ovk.js";import"./lexical-k-PQZXkn.js";import"./pdf-CaeTpLUv.js";import"./utils-Mjhh9T8E.js";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},n=new e.Error().stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="28929437-ef53-4c9d-aefa-6dcb5e18dfff",e._sentryDebugIdIdentifier="sentry-dbid-28929437-ef53-4c9d-aefa-6dcb5e18dfff")}catch{}})();function j(){const e=u(),n=l(),r=m(),{setLoading:i,clearAllLoading:c}=b(),s=o.useRef(!1);return o.useLayoutEffect(()=>{i(h.CONNECTION_AUTH)},[i]),o.useEffect(()=>{if(s.current)return;s.current=!0;const a=new URLSearchParams(r.search).get("code"),d=sessionStorage.getItem("hubspot_oauth_pending");if(sessionStorage.removeItem("hubspot_oauth_pending"),a!=null&&d!=null){const t=JSON.parse(d);e(p(t.tenant_id,t.connection_id,g("revenue"),_("hubspot"),{authorization_code:a,client_id:t.client_id,client_secret:t.client_secret,redirect_uri:t.redirect_uri}))}c();const f=y.getActiveTenantForUser();n(f?.tenantEmailDomain!=null?`/${f.tenantEmailDomain}/settings/integrations`:"/",{replace:!0})},[]),null}export{j as default};
1
+ import{a as o}from"./sentry--Yi43Gx7.js";import{u,h as l,g as m}from"./core-Cj3sxYL7.js";import{ho as p,LU as g,LV as _}from"./zeni-epic-state-BG_x9wwl.js";import{u as b,L as h,z as y}from"./index-C_Y0yMPY.js";import"./liveblocks-DmbDY3sa.js";import"./recharts-mFhBBFnU.js";import"./mui-1V4hRqCa.js";import"./analytics-BpWjaxbv.js";import"./plaid-JtkXopjw.js";import"./dnd-WLAr-qfO.js";import"./stripe-DMRn4zHo.js";import"./lottie-W8sR2m8i.js";import"./lexical--OluaPRa.js";import"./pdf-aJCOHARS.js";import"./utils-Bt5dYICv.js";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},n=new e.Error().stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="28929437-ef53-4c9d-aefa-6dcb5e18dfff",e._sentryDebugIdIdentifier="sentry-dbid-28929437-ef53-4c9d-aefa-6dcb5e18dfff")}catch{}})();function j(){const e=u(),n=l(),r=m(),{setLoading:i,clearAllLoading:c}=b(),s=o.useRef(!1);return o.useLayoutEffect(()=>{i(h.CONNECTION_AUTH)},[i]),o.useEffect(()=>{if(s.current)return;s.current=!0;const a=new URLSearchParams(r.search).get("code"),d=sessionStorage.getItem("hubspot_oauth_pending");if(sessionStorage.removeItem("hubspot_oauth_pending"),a!=null&&d!=null){const t=JSON.parse(d);e(p(t.tenant_id,t.connection_id,g("revenue"),_("hubspot"),{authorization_code:a,client_id:t.client_id,client_secret:t.client_secret,redirect_uri:t.redirect_uri}))}c();const f=y.getActiveTenantForUser();n(f?.tenantEmailDomain!=null?`/${f.tenantEmailDomain}/settings/integrations`:"/",{replace:!0})},[]),null}export{j as default};
@@ -0,0 +1,72 @@
1
+ import{j as t}from"./liveblocks-DmbDY3sa.js";import{i as S,n as x,h as C,g as y,u as ee,t as te,j as E,N as ae,o as ne,p}from"./core-Cj3sxYL7.js";import{LN as k,LO as v,LP as T,A_ as A,AM as M,LQ as B,LR as oe,LS as ie,AQ as se,fa as $,AX as le,AU as re}from"./zeni-epic-state-BG_x9wwl.js";import{K as g,o as r,p as de,c as j,h as G,k as ce,n as me,q as pe,r as H,F as ue,x as he,v as xe,w as ge,m as fe,y as we,B as be,A as Se,M as ye,S as ke,C as ve,E as je,H as $e}from"./index-C_Y0yMPY.js";import{n as m}from"./mui-1V4hRqCa.js";import f from"./NotFoundScreen-C5grvltN.js";import{a as I}from"./sentry--Yi43Gx7.js";import"./recharts-mFhBBFnU.js";import"./analytics-BpWjaxbv.js";import"./plaid-JtkXopjw.js";import"./dnd-WLAr-qfO.js";import"./stripe-DMRn4zHo.js";import"./lottie-W8sR2m8i.js";import"./lexical--OluaPRa.js";import"./pdf-aJCOHARS.js";import"./utils-Bt5dYICv.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]="f715d62a-b839-4670-a4e3-3617f4950e27",e._sentryDebugIdIdentifier="sentry-dbid-f715d62a-b839-4670-a4e3-3617f4950e27")}catch{}})();const Ie=m.div`
2
+ display: flex;
3
+ height: 100%;
4
+ width: 100%;
5
+ flex: 1 1 auto;
6
+ flex-direction: column;
7
+ align-items: center;
8
+ background-color: ${e=>e.theme.colors.grey4};
9
+ box-shadow: ${e=>`0px 2px ${r.sp1} ${e.theme.colors.dropShadowNormal}`};
10
+ `,Ce=x(function(e){const a=k(e),n=v(e),{companyName:o}=a;return{companyName:o,isDisabled:a.fetchState!=="Completed"?"disabled":void 0,magicLinkBankAccountDetails:n,magicLinkViewState:a}},function(e,a){const{vendorId:n,billId:o}=a;return{onFetchBankName:i=>{e(M(i))},onSaveHandler:i=>{j.trackBillPayMagicLinkSubmitBankAccountDetails(o),e(A(i,"standard",n,o))},onACHDetailsUpdated:i=>{const{bankAccountSection:l}=i;e(T({data:l}))}}})(de);function F(){const e=g(),{vendorId:a,billId:n}=S();return a==null||n==null?t.jsx(f,{}):t.jsx(t.Fragment,{children:t.jsx(Ie,{windowSize:e,children:t.jsx(Ce,{vendorId:a,billId:n})})})}const Ae=m.div`
11
+ display: flex;
12
+ height: 100vh;
13
+ width: 100%;
14
+ flex: 1 1 auto;
15
+ flex-direction: column;
16
+ align-items: center;
17
+ background-color: ${e=>e.theme.colors.grey4};
18
+ box-shadow: ${e=>`0px 2px ${r.sp1} ${e.theme.colors.dropShadowNormal}`};
19
+ `,Be=x(function(e,a){const{isSubPage:n}=a;return{addressToEdit:B(e),googleAPIKey:G.googleMapsAPIKey,isSubPage:n}},function(e,a){const{navigate:n,location:o}=a,i=()=>{const l=me(o.state?.pathnameStackToGoBack),s=l.poppedPathname??Le();n(s,{state:{pathnameStackToGoBack:l.newStack}})};return{onSubmitHandler:l=>{const s=Pe(l);e(oe({addressToCreate:s})),i()},onCancel:()=>{i()}}})(ce);function De({isSubPage:e}){const a=C(),n=y(),o=g();return t.jsx(t.Fragment,{children:t.jsx(Ae,{windowSize:o,children:t.jsx(Be,{location:n,navigate:a,isSubPage:e===!0,googleAPIKey:G.googleMapsAPIKey})})})}const Le=(e=2)=>{let a="../";for(let n=0;n<e;n++)a=`${a}../`;return a},Pe=e=>({street:[e.street.addressString,e.suite,e.secondaryInfo],city:e.city,state:e.state,country:e.country.selectedOption??"",countryCode:e.countryCode,postalCode:e.postalCode,latitude:e.street.addressValue?.locationLat,longitude:e.street.addressValue?.locationLng}),ze=m.div`
20
+ display: flex;
21
+ height: 100%;
22
+ width: 100%;
23
+ flex: 1 1 auto;
24
+ flex-direction: column;
25
+ align-items: center;
26
+ background-color: ${e=>e.theme.colors.grey4};
27
+ box-shadow: ${e=>`0px 2px ${r.sp1} ${e.theme.colors.dropShadowNormal}`};
28
+ `,Ne=x(function(e){const a=k(e),n=v(e),o=B(e),{companyName:i}=a;return{companyName:i,isDisabled:a.fetchState!=="Completed"?"disabled":void 0,magicLinkBankAccountDetails:n,mailingAddressDetails:o,magicLinkViewState:a}},function(e,a){const{navigate:n,location:o,vendorId:i,billId:l}=a;return{onFetchBankName:s=>{e(M(s))},onSaveHandler:s=>{j.trackBillPayMagicLinkSubmitBankAccountDetails(l),e(A(s,"us-domestic",i,l))},onWireDetailsUpdated:s=>{const{bankAccountSection:d}=s;e(T({data:d}))},onAddressClick:()=>{const s=o.pathname.replace("us-domestic","address"),d=H(o.state?.pathnameStackToGoBack,o.pathname);n(s,{state:{pathnameStackToGoBack:d}})}}})(pe);function Ee(){const e=C(),a=y(),n=g(),{vendorId:o,billId:i}=S();return o==null||i==null?t.jsx(f,{}):t.jsx(t.Fragment,{children:t.jsx(ze,{windowSize:n,children:t.jsx(Ne,{location:a,navigate:e,vendorId:o,billId:i})})})}const Fe=m.div`
29
+ display: flex;
30
+ height: 100%;
31
+ width: 100%;
32
+ flex: 1 1 auto;
33
+ flex-direction: column;
34
+ align-items: center;
35
+ background-color: ${e=>e.theme.colors.grey4};
36
+ box-shadow: ${e=>`0px 2px ${r.sp1} ${e.theme.colors.dropShadowNormal}`};
37
+ `,Te=x(function(e){const a=k(e),n=v(e),o=B(e),{companyName:i}=a;return{companyName:i,isDisabled:a.fetchState!=="Completed"?"disabled":void 0,magicLinkBankAccountDetails:n,mailingAddressDetails:o,magicLinkViewState:a}},function(e,a){const{navigate:n,location:o,vendorId:i,billId:l}=a;return{onFetchBankNameBySwift:s=>{e(se(s))},onSaveHandler:s=>{j.trackBillPayMagicLinkSubmitBankAccountDetails(l),e(A(s,"international",i,l,a.isLocalCurrencyEnabled))},onBankDetailsUpdated:s=>{const{internationalWireSwiftAccountSection:d}=s;e(ie({data:d}))},onAddressClick:()=>{const s=o.pathname.replace("international","address"),d=H(o.state?.pathnameStackToGoBack,o.pathname);n(s,{state:{pathnameStackToGoBack:d}})}}})(xe);function Me(){const e=C(),a=y(),n=g(),{vendorId:o,billId:i}=S(),{useFeatureGate:l}=ue(),{isFeatureEnabled:s}=l(he.isBillPayLocalCurrencyFeatureEnabled);return o==null||i==null?t.jsx(f,{}):t.jsx(Fe,{windowSize:n,children:t.jsx(Te,{location:a,navigate:e,vendorId:o,billId:i,isLocalCurrencyEnabled:s})})}const Ge={containerWidth:new je(100,58)},He=m(ke)`
38
+ width: ${r.sp4};
39
+ height: ${r.sp4};
40
+ margin-bottom: ${r.sp3};
41
+ margin-top: ${r.sp3};
42
+ margin-left: ${r.sp8};
43
+ cursor: pointer;
44
+ position: absolute;
45
+ color: ${e=>e.theme.colors.brandColorJade};
46
+ `,Ke=m.div`
47
+ display: flex;
48
+ height: 100vh;
49
+ flex-direction: ${e=>e.windowSize==="small"?"column":"row"};
50
+ width: 100vw;
51
+ overflow-y: scroll;
52
+ background-color: ${e=>e.theme.colors.grey4};
53
+ `,Ve=m.div`
54
+ display: flex;
55
+ flex-direction: ${e=>e.windowSize==="small"?"column":"row"};
56
+ flex-direction: column;
57
+ width: ${e=>`${Ge.containerWidth.value(e.windowSize)}%`};
58
+ ${e=>e.windowSize!=="small"?"overflow: auto;":""}
59
+ box-shadow: ${e=>`0px 2px ${r.sp1} ${e.theme.colors.dropShadowNormal}`};
60
+ padding-top: ${e=>e.windowSize!=="small"?r.sp2:"0px"};
61
+ `,_e=m.div`
62
+ display: flex;
63
+ flex-direction: column;
64
+ align-items: center;
65
+ justify-content: center;
66
+ padding: ${e=>e.windowSize==="small"?r.sp3:`62px ${r.sp6} ${r.sp9} ${r.sp8}`};
67
+ height: ${e=>e.windowSize==="small"?"490px":"auto"};
68
+ overflow: ${e=>e.windowSize==="small"?"unset":"hidden"};
69
+ width: ${e=>e.windowSize=="small"?"auto":"42%"};
70
+ background-color: ${e=>e.windowSize==="small"?e.theme.colors.grey4:e.theme.colors.background};
71
+ margin-top: ${e=>e.windowSize==="small"?e.isAddressPage?"0px":"186px":"unset"};
72
+ `,Ue=x(function(e,a){return{file:a.file,type:a.type}})(ve);function h({appContent:e}){const a=ee(),n=y(),{tenantEmailDomain:o,vendorId:i,billId:l}=S(),[s]=te(),d=s.get("token"),K=n.pathname.includes("address"),w=g(),V=ge(),D=fe(),b=we(),_=()=>{V.toggle()},U=E(u=>k(u)),W=E(u=>v(u)),{authParams:O,fetchState:c,billAttachment:q,billFetchState:L,companyName:J,currencySymbol:Q,amount:R}=U,{tenantId:P,userId:z,sessionId:N}=O,{fetchState:X,internationalBankAccountCreateStatus:Y}=W;return I.useEffect(()=>{$()},[]),I.useEffect(()=>{b&&c==="Not-Started"&&i!=null&&o!=null&&d!=null&&a(le(i,o,d))},[b,c,i,o,d,a]),I.useEffect(()=>{b&&c==="Completed"&&($(z,N,P),l!=null&&a(re(l)))},[c,b,z,N,P,l,a]),c==="Error"?t.jsx(f,{}):X==="Completed"||Y.fetchState==="Completed"?($(),t.jsx(ae,{to:"../../../../../../../bank/account/save/success",replace:!0,relative:"path"})):c==="In-Progress"?t.jsx(be,{fetchState:c,style:{height:"100vh",backgroundColor:D.colors.grey5,boxShadow:`0px 2px ${r.sp1} ${D.colors.dropShadowNormal}`}}):t.jsxs(t.Fragment,{children:[c==="Completed"&&L==="Completed"&&t.jsx(Se,{analytics:j,onLoad:u=>(Z=>Z.trackBillPayMagicLinkPageLoad(o??"",i??"",J,l??"",We(n.pathname),Q,R))(u)}),t.jsxs(Ke,{windowSize:w,children:[w!=="small"?t.jsx(He,{onClick:_}):null,t.jsx(_e,{windowSize:w,isAddressPage:K,children:L==="In-Progress"?t.jsx(ye,{size:"ExtraLarge",start:!0}):t.jsx(Ue,{file:q,type:"bill"})}),t.jsx(Ve,{windowSize:w,children:e})]})]})}const We=e=>`${e.split("/").at(-2)}_${e.split("/").at(-1)}`;function Oe(){return t.jsx($e,{})}function dt(){return t.jsxs(ne,{children:[t.jsx(p,{path:"bank/account/save/success",element:t.jsx(Oe,{})}),t.jsx(p,{path:":tenantEmailDomain/vendor/:vendorId/bill/:billId/ach/standard",element:t.jsx(h,{appContent:t.jsx(F,{})})}),t.jsx(p,{path:":tenantEmailDomain/vendor/:vendorId/bill/:billId/ach/same-day",element:t.jsx(h,{appContent:t.jsx(F,{})})}),t.jsx(p,{path:":tenantEmailDomain/vendor/:vendorId/bill/:billId/wire/address",element:t.jsx(h,{appContent:t.jsx(De,{isSubPage:!0})})}),t.jsx(p,{path:":tenantEmailDomain/vendor/:vendorId/bill/:billId/wire/us-domestic",element:t.jsx(h,{appContent:t.jsx(Ee,{})})}),t.jsx(p,{path:":tenantEmailDomain/vendor/:vendorId/bill/:billId/wire/international",element:t.jsx(h,{appContent:t.jsx(Me,{})})}),t.jsx(p,{path:"*",element:t.jsx(f,{})})]})}export{dt as default};
@@ -0,0 +1,12 @@
1
+ import{j as f}from"./liveblocks-DmbDY3sa.js";import{a as u}from"./sentry--Yi43Gx7.js";import{u as U,g as _,h as w,t as M,j as l,N as D}from"./core-Cj3sxYL7.js";import{z as r,m as P,D as V,d as A,c as N,e as W,Y,M as J,g as K}from"./index-C_Y0yMPY.js";import{eW as R,Ly as $,LI as q,Lz as B,fa as G,fD as H,LE as Q,gn as X,cY as Z,LJ as ee,LK as te}from"./zeni-epic-state-BG_x9wwl.js";import{n as ne}from"./mui-1V4hRqCa.js";import{u as se}from"./useDeviceId-n-Ow0WdN.js";import{f as ie}from"./analyticsHelper-VUlrCZ3f.js";import{t as ae}from"./getLocaleForTenant-ChWLNTj3.js";import"./recharts-mFhBBFnU.js";import"./analytics-BpWjaxbv.js";import"./plaid-JtkXopjw.js";import"./dnd-WLAr-qfO.js";import"./stripe-DMRn4zHo.js";import"./lottie-W8sR2m8i.js";import"./lexical--OluaPRa.js";import"./pdf-aJCOHARS.js";import"./utils-Bt5dYICv.js";(function(){try{var t=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},i=new t.Error().stack;i&&(t._sentryDebugIds=t._sentryDebugIds||{},t._sentryDebugIds[i]="44980ef0-71c0-42fe-8dff-08f0ee9692c2",t._sentryDebugIdIdentifier="sentry-dbid-44980ef0-71c0-42fe-8dff-08f0ee9692c2")}catch{}})();const z=(t,i)=>t!=null&&t.length>0&&i==="magic_links";function ze(){const t=U(),i=_(),m=w(),[k]=M(),n=k.get("token"),p=k.get("stytch_token_type"),g=r.getMagicLinkCodeVerifier(),a=se(),{otpChallenge:d,twoFAPhoneNumber:T,magicLinkEmail:c,verifyDeviceFetchState:x,resendVerifyDeviceOTPFetchState:C}=l(e=>e.tenantState),S=l(e=>e.tenantState.fetchState),L=l(e=>e.tenantState.activeTenantFetchState.fetchState),I=l(e=>e.tenantState.signInState),h=l(e=>e.tenantState.magicLinkSignInFetchState.fetchState),s=l(e=>e.tenantState.loggedInUser),o=l(e=>R(e)),y=l(e=>$(e)),E=r.getSignedInUser(),b=P().mode;u.useEffect(()=>{s?.zeniSessionId==null&&n!=null&&z(n,p)&&a!=null&&g!=null&&(r.saveMagicLinkTriggered(n),t(q(n,a,g)))},[n,p,t,a,g,s?.zeniSessionId]),u.useEffect(()=>{I!=="In-Progress"||S!=="Completed"&&L!=="Completed"||s?.zeniSessionId==null||o==null||(n!=null&&r.saveLastUsedMagicLinkToken(n),r.saveSignedInUserWithSession(s,s.zeniSessionId),r.saveSignedInUserTenants(B(y.tenantsInOrder),s.zeniSessionId),G(s.userId,s.zeniSessionId,o.tenantId),t(H(o.tenantId)),r.saveActiveTenantDomainForUser(o.tenantEmailDomain),t(Q("Completed")),V.updateAppLocaleID(ae(o)),ie(s,o,b,void 0,y.tenantsInOrder),X().then(()=>{const e=K();e!=null&&A(e)}),setTimeout(()=>{N.trackLogin(W.Event.loginSuccess,"email",Z(o.productSettings))},2e3))},[I,S,L,s,o,y,b,i.state,t]);const j=u.useCallback(()=>{m("/signin/auth")},[m]),F=u.useCallback(()=>{a!=null&&d!=null&&c!=null&&t(ee(a,c,d))},[a,d,t,c]),O=u.useCallback(e=>{a!=null&&n!=null&&c!=null&&d!=null&&t(te(e,a,c,d))},[a,n,t,c,d]);if(h==="Completed"&&d!=null)return f.jsx(Y,{phoneNumber:T,verifyOtpFetchState:x.fetchState,resendVerifyDeviceOTPFetchState:C,onResendOtp:F,onVerifyOtp:O,onCancelVerifyDevice:j});if(I==="In-Progress"&&S==="Completed"&&s?.zeniSessionId!=null&&o!=null||E!=null){const e=i.state?.origin??"/";return f.jsx(D,{to:e,state:{...i.state,origin:""}})}if(!z(n,p)||g==null||h==="Error"){const e=i.state?.origin??"/",v=n!=null&&r.getLastUsedMagicLinkToken()===n;return f.jsx(D,{to:e,state:{...i.state,origin:"",magicLinkAlreadyUsed:v,magicLinkExpired:!v&&(r.isMagicLinkTriggered(n??"")||h==="Error"&&s?.zeniSessionId==null)}})}return f.jsx(oe,{"data-testid":"smooth-loader",children:f.jsx(J,{size:"ExtraLarge",start:!0})})}const oe=ne.div`
2
+ position: fixed;
3
+ top: 0;
4
+ left: 0;
5
+ right: 0;
6
+ bottom: 0;
7
+ display: flex;
8
+ align-items: center;
9
+ justify-content: center;
10
+ z-index: 9999;
11
+ background-color: ${t=>t.theme.colors.background};
12
+ `;export{ze as default};
@@ -1 +1 @@
1
- import{j as V}from"./liveblocks-D3ESVZyk.js";import{a as c}from"./sentry-B_92GPgU.js";import{u as be,j as s,i as Ze,g as Je,h as Ke,l as P}from"./core-k_c8SCBE.js";import{eW as he,ff as Qe,fg as Se,f1 as Xe,bn as ea,eV as aa,fh as ta,fi as na,fk as sa,fn as oa,fw as ia,fo as g,fq as ra,fr as ue,fu as da,fs as la,ft as ca,fv as ua,cO as fa,fy as ma,cT as pa,bt as ba,f0 as ha,fD as Sa,fE as ga,fC as Ea}from"./zeni-epic-state-C3zBO1No.js";import{a7 as ka,a8 as Ca,Y as ya,N as Ia,z as k,q as Ta,u as wa,x as r,a9 as Aa,aa as _a,j as Fa,a as Da,ab as va,a3 as $a,ac as Ba,ad as Ma,ae as fe,af as me,L as xa,ag as Pa,ah as pe,c as R,$ as Ra,n as A,ai as N,aj as Na}from"./index-B4wUHn-k.js";import{D as Va}from"./mui-UJrLjp1k.js";(function(){try{var f=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},d=new f.Error().stack;d&&(f._sentryDebugIds=f._sentryDebugIds||{},f._sentryDebugIds[d]="53d767e2-5c89-4054-8186-761fa5729507",f._sentryDebugIdIdentifier="sentry-dbid-53d767e2-5c89-4054-8186-761fa5729507")}catch{}})();const Ua=ka(({isAppContentDrawerOpen:f,handleDrawerToggle:d})=>{const{tenantEmailDomain:t}=Ze(),a=Je(),C=ya(),o=Ke(),U=Xe(),m=be(),{useFeatureGate:i}=Ia(),G=k.getSignedInUser(),_=ea(G),n=s(e=>he(e)),ge=n.masterTOSInfo?.isMasterTOSAccepted??!1,O=s(e=>aa(e)),j=O.uiState.currentChatSessionId,y=Ta(),{setLoading:Ee}=wa(),[F,L]=c.useState(void 0),D=P("/:tenantEmailDomain/dashboard")!==null,z=P("/:tenantEmailDomain/reports")!==null,I=P("/:tenantEmailDomain/onboarding/*")!==null,{isFeatureEnabled:Y}=i(r.isDepositAccountsFeatureEnabled),{isFeatureEnabled:ke}=i(r.isChargeCardFeatureEnabled),{isFeatureEnabled:q}=i(r.isDebitCardFeatureEnabled),Ce=Aa(n,ke,q),{isFeatureEnabled:ye}=i(r.isSettingsFeatureEnabled),H=s(e=>ta(e)),{isFeatureEnabled:T}=i(r.isReferralFeatureEnabled),v=s(e=>na(e));c.useEffect(()=>{y&&T&&!I&&v.fetchState==="Not-Started"&&m(sa(!0))},[y,T,v.fetchState,I]);const h=k.getSignedInUser(),$=s(e=>e.tenantState),Ie=s(e=>$.fetchState==="Completed"?oa(e):[]),E=s(e=>e.expenseAutomationViewState.selectedPeriodByTenantId),{isFeatureEnabled:Te}=i(r.isApAgingFeatureEnabled),{isFeatureEnabled:we}=i(r.isArAgingFeatureEnabled),{isFeatureEnabled:W}=i(r.isExpenseAutomationEnabled),{isFeatureEnabled:Z}=i(r.isExpenseAutomationEnabledV2),J=Z||W&&_,{isFeatureEnabled:Ae}=i(r.isDashboardSidebarHalloweenAnimationEnabled),{isFeatureEnabled:_e}=i(r.isDashboardSidebarThanksGivingAnimationEnabled),{isFeatureEnabled:Fe}=i(r.isDashboardSidebarChristmasAnimationEnabled),{isFeatureEnabled:De}=i(r.isDashboardSidebarNewYearAnimationEnabled),{isFeatureEnabled:ve}=i(r.isTreasuryEnabled),{isFeatureEnabled:$e}=i(r.isTaskManagerCustomerUserAccessEnabled),Be=_||!_&&$e,Me=n.company!=null&&ia(n.company),w=ve&&Me,xe=s(e=>g(e).totalUnreadCount),Pe=s(e=>g(e).reducedFetchCountState),K=s(e=>g(e).notificationDetailsByTab.tasks.uiState.unreadCount),Q=s(e=>g(e).notificationDetailsByTab.comments.uiState.unreadCount),Re=s(e=>g(e).notificationDetailsByTab.tasks.fetchCountState),B=s(e=>g(e).notificationDetailsByTab.comments.fetchCountState),{inboxNotifications:X,isLoading:ee,isFetchingMore:ae,hasFetchedAll:te,fetchMore:Ne}=_a();c.useEffect(()=>{const e=setTimeout(()=>Ne?.(),0);return()=>clearTimeout(e)}),c.useEffect(()=>{if(ee===!1&&ae===!1&&te===!0)if(n?.companyId!=null&&X!=null){const e=`dashboard_${n.companyId}`;L(X.filter(u=>u.roomId===e&&u.readAt==null).length)}else L(0)},[ee,ae,te]),c.useEffect(()=>{y&&!I&&Re.fetchState==="Not-Started"&&U.tenantId!=null&&m(ra("task_manager","dashboard"))},[y,U.tenantId]),c.useEffect(()=>{I||B.fetchState!=="Not-Started"||m(ue({fetchCountState:{fetchState:"In-Progress",error:void 0}},"comments"))},[]),c.useEffect(()=>{F!=null&&B.fetchState==="In-Progress"&&(m(ue({fetchCountState:{fetchState:"Completed",error:void 0}},"comments")),m(Se({unreadCount:F},"comments")))},[F,B.fetchState]);const Ve={fetchStatus:Pe,count:xe},ne=t!=null?k.getSignedInUserTenant(t):null,se=s(e=>ne?.tenantId!=null?da(e,ne.tenantId):void 0),S=[];Te===!1&&S.push("accounts_payable_aging"),we===!1&&S.push("accounts_receivable_aging"),Y===!1&&S.push("zeni_accounts_promo_card"),T===!1&&S.push("rewards_card"),J===!1&&S.push("expense_automation_card");const Ue=Fa(),oe=s(e=>la(e,S,h,Z,W,w).fetchState),ie=s(e=>ca(e).fetchState),Ge=D&&(oe==="Completed"||oe==="Error")||z&&(ie==="Completed"||ie==="Error")||!D&&!z?void 0:"disabled",Oe=c.useMemo(()=>ua(n.userRole),[n.userRole]),je=fa(Oe),Le=n?.rewardsLastViewedTime==null,ze=h?.userEmail!=null&&H.fetchState==="Completed"&&ma(H.notificationSettings,h.userEmail,q,n),re=Da(),Ye=re&&va(a),de=pa(Ue?.loggedInUserRoleMap),le=n.companyTreasuryInfo?.info?.isTreasuryTOSAccepted,M=c.useCallback(()=>w&&de&&!k.getTreasuryPopupSeen(t??"")&&le===!1&&$a(a.pathname)!=="treasury",[w,de,le,a.pathname,t]),[qe,ce]=c.useState(M);c.useEffect(()=>{ce(M())},[M]);const He=s(e=>e.treasurySetupViewState.treasuryFundsDetails).fundsDetails,We=Ba(He);return V.jsx(Va,{container:window.document.body,variant:"temporary",open:f,onClose:()=>d(!1),PaperProps:{sx:{width:240,zIndex:8,borderRight:"none",backgroundImage:"none"}},ModalProps:{keepMounted:!0},children:V.jsx(Ma,{signedInUser:G,currentTenantId:$.currentTenantId??"",tenants:$.fetchState==="Completed"?Ie:se!=null?[se]:[],currentTenant:n,isTenantDropdownDisabled:Ge,isSettings:me(a),isSettingsFeatureEnabled:ye,isVendorsTabVisible:je,isZeniAccountEnabled:Y,isChargeCardEnabled:Ce,isTreasuryEnabled:w,treasuryYieldPercentage:We,isTreasuryPopupVisible:qe,isNotificationsTabVisible:ze,notificationCountDetails:Ve,isExpenseAutomationEnabledForUser:J&&ba(n.userRole)===!1,selectedMenu:fe(a),rewardsConfiguration:{isRewardsTabVisible:T,isRewardsAnimated:Le,rewardsPlan:v.rewardsPlan},isAiCfoAccessEnabled:re,onNotificationIconClick:()=>{d(!1);let e=K===0&&Q>0?"notifications/comments":"notifications/tasks";me(a)&&(e=K===0&&Q>0?"../../notifications/comments":"../../notifications/tasks");const u=A(a.state?.pathnameStackToGoBack,a.pathname);o(e,{state:{pathnameStackToGoBack:u}})},handleCockpitClick:()=>{window.open("/cockpit")},handleLogOutClick:()=>{d(!1);const e=A(a.state?.pathnameStackToGoBack,a.pathname);o("/signout",{replace:!0,state:{pathnameStackToGoBack:e,message:"logout"}})},handleMenuChange:e=>{if(d(!1),t==null)return;if(e.type==="ai_cfo"){if(R.trackAICFOChatScreenStateChanged("viewed","left_menu",j??null,null),!ge)return void Ra({location:a,navigate:o,mergeState:{referrer:"Sidebar"}});const b=A(a.state?.pathnameStackToGoBack,a.pathname);return void o(`/${t}/ai-cfo/explore`,{state:{pathnameStackToGoBack:b,referrer:"Sidebar"}})}const u=A(a.state?.pathnameStackToGoBack,a.pathname),l=e.type,p=N(l)&&l!=="command_center";if(N(e.type)&&E[n.tenantId]!=null&&R.trackMonthEndCloseClicked(E[n.tenantId].month,E[n.tenantId].year,"Sidebar"),p&&E[n.tenantId]!=null){const b=E[n.tenantId];return void o(`/${t}/month_end_close_checks/review/${e.type}/${b.month}-${b.year}`,{state:{pathnameStackToGoBack:u,referrer:"Sidebar"}})}const x=Na(e.type);pe(e.type)?(j!=null&&m(Ea()),o(`/${t}/ai-cfo/${e.type}`,{state:{pathnameStackToGoBack:u.slice(0,-1),referrer:"Sidebar"}})):o(`/${t}/${x}`,{state:{pathnameStackToGoBack:u,referrer:"Sidebar"}})},handleMyProfileClick:()=>{d(!1),o(`/${t}/settings/my_profile`)},handleReferralsClick:()=>{d(!1),o(`/${t}/rewards`)},handleBackClick:()=>{o(`/${t}/dashboard`)},handleTenantSelect:e=>{Ee(xa.TENANT_SWITCHING),d(!1);const u=e.tenantEmailDomain,l=fe(a);let p=`/${encodeURIComponent(u)}/`;const x=N(l);l==="home"?p+="dashboard":l==="users_and_roles"?p+="people":Pa(l)?p+="settings/my_profile":pe(l)?p+=`ai-cfo/${l}`:p+=l==="task_checklist"?"tasks":x?"month_end_close_checks/review":encodeURIComponent(l),o(p,{replace:!0}),h!=null&&(m(Sa(e.tenantId)),m(ga(h.userId,e.tenantId,h.zeniSessionId)));const b=e;R.trackCompanySwitch(b.companyId,b.companyName,b.userRole)},handlePopupClose:()=>{k.saveTreasuryPopupSeen(t??"",!0),ce(!1)},onZeniLogoClick:()=>{C.toggle()},isAiCfo:Ye,aiCfoView:O,isOnDashboard:D,updateCurrentChatSessionId:e=>{m(ha({sessionId:e,agentId:"controller"})),o(`/${t}/ai-cfo/${e}`,{state:{...a.state}})},halloweenAnimationEnabled:Ae,isTaskManagerAccessEnabled:Be,thanksGivingAnimationEnabled:_e,christmasAnimationEnabled:Fe,newYearAnimationEnabled:De})})}),qa=f=>{const d=be(),t=s(C=>he(C)),a={events:t.userRoleId!=null?[`private-encrypted-${t.userRoleId}.dashboard-user-notification`]:[],eventCallback:(C,o)=>{Ca(o)&&Qe(o.mode)==="dashboard"&&d(Se({unreadCount:o.data.unread},"tasks"))}};return V.jsx(Ua,{...f,...a})};export{qa as M};
1
+ import{j as V}from"./liveblocks-DmbDY3sa.js";import{a as c}from"./sentry--Yi43Gx7.js";import{u as pe,j as s,i as qe,g as Je,h as Ke,l as P}from"./core-Cj3sxYL7.js";import{eW as he,ff as Qe,fg as Se,f1 as Xe,bn as ea,eV as aa,fh as ta,fi as na,fk as sa,fn as oa,fw as ia,fo as g,fq as ra,fr as ue,fu as da,fs as la,ft as ca,fv as ua,cO as fa,fy as ma,cT as ba,bt as pa,f0 as ha,fD as Sa,fE as ga,fC as Ea}from"./zeni-epic-state-BG_x9wwl.js";import{a7 as ka,a8 as Ca,w as ya,F as Ia,z as k,y as Ta,u as wa,x as r,a9 as Aa,aa as Fa,j as _a,a as Da,ab as va,a3 as $a,ac as Ba,ad as Ma,ae as fe,af as me,L as xa,ag as Pa,ah as be,c as R,$ as Ra,r as A,ai as N,aj as Na}from"./index-C_Y0yMPY.js";import{D as Va}from"./mui-1V4hRqCa.js";(function(){try{var f=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},d=new f.Error().stack;d&&(f._sentryDebugIds=f._sentryDebugIds||{},f._sentryDebugIds[d]="b13e37fd-bc4b-4b50-b302-5ee7259da8ec",f._sentryDebugIdIdentifier="sentry-dbid-b13e37fd-bc4b-4b50-b302-5ee7259da8ec")}catch{}})();const Ua=ka(({isAppContentDrawerOpen:f,handleDrawerToggle:d})=>{const{tenantEmailDomain:t}=qe(),a=Je(),C=ya(),o=Ke(),U=Xe(),m=pe(),{useFeatureGate:i}=Ia(),G=k.getSignedInUser(),F=ea(G),n=s(e=>he(e)),ge=n.masterTOSInfo?.isMasterTOSAccepted??!1,O=s(e=>aa(e)),j=O.uiState.currentChatSessionId,y=Ta(),{setLoading:Ee}=wa(),[_,L]=c.useState(void 0),D=P("/:tenantEmailDomain/dashboard")!==null,z=P("/:tenantEmailDomain/reports")!==null,I=P("/:tenantEmailDomain/onboarding/*")!==null,{isFeatureEnabled:Y}=i(r.isDepositAccountsFeatureEnabled),{isFeatureEnabled:ke}=i(r.isChargeCardFeatureEnabled),{isFeatureEnabled:H}=i(r.isDebitCardFeatureEnabled),Ce=Aa(n,ke,H),{isFeatureEnabled:ye}=i(r.isSettingsFeatureEnabled),W=s(e=>ta(e)),{isFeatureEnabled:T}=i(r.isReferralFeatureEnabled),v=s(e=>na(e));c.useEffect(()=>{y&&T&&!I&&v.fetchState==="Not-Started"&&m(sa(!0))},[y,T,v.fetchState,I]);const h=k.getSignedInUser(),$=s(e=>e.tenantState),Ie=s(e=>$.fetchState==="Completed"?oa(e):[]),E=s(e=>e.expenseAutomationViewState.selectedPeriodByTenantId),{isFeatureEnabled:Te}=i(r.isApAgingFeatureEnabled),{isFeatureEnabled:we}=i(r.isArAgingFeatureEnabled),{isFeatureEnabled:Z}=i(r.isExpenseAutomationEnabled),{isFeatureEnabled:q}=i(r.isExpenseAutomationEnabledV2),J=q||Z&&F,{isFeatureEnabled:Ae}=i(r.isDashboardSidebarHalloweenAnimationEnabled),{isFeatureEnabled:Fe}=i(r.isDashboardSidebarThanksGivingAnimationEnabled),{isFeatureEnabled:_e}=i(r.isDashboardSidebarChristmasAnimationEnabled),{isFeatureEnabled:De}=i(r.isDashboardSidebarNewYearAnimationEnabled),{isFeatureEnabled:ve}=i(r.isTreasuryEnabled),{isFeatureEnabled:$e}=i(r.isTaskManagerCustomerUserAccessEnabled),Be=F||!F&&$e,Me=n.company!=null&&ia(n.company),w=ve&&Me,xe=s(e=>g(e).totalUnreadCount),Pe=s(e=>g(e).reducedFetchCountState),K=s(e=>g(e).notificationDetailsByTab.tasks.uiState.unreadCount),Q=s(e=>g(e).notificationDetailsByTab.comments.uiState.unreadCount),Re=s(e=>g(e).notificationDetailsByTab.tasks.fetchCountState),B=s(e=>g(e).notificationDetailsByTab.comments.fetchCountState),{inboxNotifications:X,isLoading:ee,isFetchingMore:ae,hasFetchedAll:te,fetchMore:Ne}=Fa();c.useEffect(()=>{const e=setTimeout(()=>Ne?.(),0);return()=>clearTimeout(e)}),c.useEffect(()=>{if(ee===!1&&ae===!1&&te===!0)if(n?.companyId!=null&&X!=null){const e=`dashboard_${n.companyId}`;L(X.filter(u=>u.roomId===e&&u.readAt==null).length)}else L(0)},[ee,ae,te]),c.useEffect(()=>{y&&!I&&Re.fetchState==="Not-Started"&&U.tenantId!=null&&m(ra("task_manager","dashboard"))},[y,U.tenantId]),c.useEffect(()=>{I||B.fetchState!=="Not-Started"||m(ue({fetchCountState:{fetchState:"In-Progress",error:void 0}},"comments"))},[]),c.useEffect(()=>{_!=null&&B.fetchState==="In-Progress"&&(m(ue({fetchCountState:{fetchState:"Completed",error:void 0}},"comments")),m(Se({unreadCount:_},"comments")))},[_,B.fetchState]);const Ve={fetchStatus:Pe,count:xe},ne=t!=null?k.getSignedInUserTenant(t):null,se=s(e=>ne?.tenantId!=null?da(e,ne.tenantId):void 0),S=[];Te===!1&&S.push("accounts_payable_aging"),we===!1&&S.push("accounts_receivable_aging"),Y===!1&&S.push("zeni_accounts_promo_card"),T===!1&&S.push("rewards_card"),J===!1&&S.push("expense_automation_card");const Ue=_a(),oe=s(e=>la(e,S,h,q,Z,w).fetchState),ie=s(e=>ca(e).fetchState),Ge=D&&(oe==="Completed"||oe==="Error")||z&&(ie==="Completed"||ie==="Error")||!D&&!z?void 0:"disabled",Oe=c.useMemo(()=>ua(n.userRole),[n.userRole]),je=fa(Oe),Le=n?.rewardsLastViewedTime==null,ze=h?.userEmail!=null&&W.fetchState==="Completed"&&ma(W.notificationSettings,h.userEmail,H,n),re=Da(),Ye=re&&va(a),de=ba(Ue?.loggedInUserRoleMap),le=n.companyTreasuryInfo?.info?.isTreasuryTOSAccepted,M=c.useCallback(()=>w&&de&&!k.getTreasuryPopupSeen(t??"")&&le===!1&&$a(a.pathname)!=="treasury",[w,de,le,a.pathname,t]),[He,ce]=c.useState(M);c.useEffect(()=>{ce(M())},[M]);const We=s(e=>e.treasurySetupViewState.treasuryFundsDetails).fundsDetails,Ze=Ba(We);return V.jsx(Va,{container:window.document.body,variant:"temporary",open:f,onClose:()=>d(!1),PaperProps:{sx:{width:240,zIndex:8,borderRight:"none",backgroundImage:"none"}},ModalProps:{keepMounted:!0},children:V.jsx(Ma,{signedInUser:G,currentTenantId:$.currentTenantId??"",tenants:$.fetchState==="Completed"?Ie:se!=null?[se]:[],currentTenant:n,isTenantDropdownDisabled:Ge,isSettings:me(a),isSettingsFeatureEnabled:ye,isVendorsTabVisible:je,isZeniAccountEnabled:Y,isChargeCardEnabled:Ce,isTreasuryEnabled:w,treasuryYieldPercentage:Ze,isTreasuryPopupVisible:He,isNotificationsTabVisible:ze,notificationCountDetails:Ve,isExpenseAutomationEnabledForUser:J&&pa(n.userRole)===!1,selectedMenu:fe(a),rewardsConfiguration:{isRewardsTabVisible:T,isRewardsAnimated:Le,rewardsPlan:v.rewardsPlan},isAiCfoAccessEnabled:re,onNotificationIconClick:()=>{d(!1);let e=K===0&&Q>0?"notifications/comments":"notifications/tasks";me(a)&&(e=K===0&&Q>0?"../../notifications/comments":"../../notifications/tasks");const u=A(a.state?.pathnameStackToGoBack,a.pathname);o(e,{state:{pathnameStackToGoBack:u}})},handleCockpitClick:()=>{window.open("/cockpit")},handleLogOutClick:()=>{d(!1);const e=A(a.state?.pathnameStackToGoBack,a.pathname);o("/signout",{replace:!0,state:{pathnameStackToGoBack:e,message:"logout"}})},handleMenuChange:e=>{if(d(!1),t==null)return;if(e.type==="ai_cfo"){if(R.trackAICFOChatScreenStateChanged("viewed","left_menu",j??null,null),!ge)return void Ra({location:a,navigate:o,mergeState:{referrer:"Sidebar"}});const p=A(a.state?.pathnameStackToGoBack,a.pathname);return void o(`/${t}/ai-cfo/explore`,{state:{pathnameStackToGoBack:p,referrer:"Sidebar"}})}const u=A(a.state?.pathnameStackToGoBack,a.pathname),l=e.type,b=N(l)&&l!=="command_center";if(N(e.type)&&E[n.tenantId]!=null&&R.trackMonthEndCloseClicked(E[n.tenantId].month,E[n.tenantId].year,"Sidebar"),b&&E[n.tenantId]!=null){const p=E[n.tenantId];return void o(`/${t}/month_end_close_checks/review/${e.type}/${p.month}-${p.year}`,{state:{pathnameStackToGoBack:u,referrer:"Sidebar"}})}const x=Na(e.type);be(e.type)?(j!=null&&m(Ea()),o(`/${t}/ai-cfo/${e.type}`,{state:{pathnameStackToGoBack:u.slice(0,-1),referrer:"Sidebar"}})):o(`/${t}/${x}`,{state:{pathnameStackToGoBack:u,referrer:"Sidebar"}})},handleMyProfileClick:()=>{d(!1),o(`/${t}/settings/my_profile`)},handleReferralsClick:()=>{d(!1),o(`/${t}/rewards`)},handleBackClick:()=>{o(`/${t}/dashboard`)},handleTenantSelect:e=>{Ee(xa.TENANT_SWITCHING),d(!1);const u=e.tenantEmailDomain,l=fe(a);let b=`/${encodeURIComponent(u)}/`;const x=N(l);l==="home"?b+="dashboard":l==="users_and_roles"?b+="people":Pa(l)?b+="settings/my_profile":be(l)?b+=`ai-cfo/${l}`:b+=l==="task_checklist"?"tasks":x?"month_end_close_checks/review":encodeURIComponent(l),o(b,{replace:!0}),h!=null&&(m(Sa(e.tenantId)),m(ga(h.userId,e.tenantId,h.zeniSessionId)));const p=e;R.trackCompanySwitch(p.companyId,p.companyName,p.userRole)},handlePopupClose:()=>{k.saveTreasuryPopupSeen(t??"",!0),ce(!1)},onZeniLogoClick:()=>{C.toggle()},isAiCfo:Ye,aiCfoView:O,isOnDashboard:D,updateCurrentChatSessionId:e=>{m(ha({sessionId:e,agentId:"controller"})),o(`/${t}/ai-cfo/${e}`,{state:{...a.state}})},halloweenAnimationEnabled:Ae,isTaskManagerAccessEnabled:Be,thanksGivingAnimationEnabled:Fe,christmasAnimationEnabled:_e,newYearAnimationEnabled:De})})}),Ha=f=>{const d=pe(),t=s(C=>he(C)),a={events:t.userRoleId!=null?[`private-encrypted-${t.userRoleId}.dashboard-user-notification`]:[],eventCallback:(C,o)=>{Ca(o)&&Qe(o.mode)==="dashboard"&&d(Se({unreadCount:o.data.unread},"tasks"))}};return V.jsx(Ua,{...f,...a})};export{Ha as M};
@@ -0,0 +1 @@
1
+ import{j as r}from"./liveblocks-DmbDY3sa.js";import{h as n,n as e}from"./core-Cj3sxYL7.js";import{R as i}from"./index-C_Y0yMPY.js";import"./mui-1V4hRqCa.js";import"./sentry--Yi43Gx7.js";import"./zeni-epic-state-BG_x9wwl.js";import"./recharts-mFhBBFnU.js";import"./analytics-BpWjaxbv.js";import"./plaid-JtkXopjw.js";import"./dnd-WLAr-qfO.js";import"./stripe-DMRn4zHo.js";import"./lottie-W8sR2m8i.js";import"./lexical--OluaPRa.js";import"./pdf-aJCOHARS.js";import"./utils-Bt5dYICv.js";(function(){try{var o=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new o.Error().stack;t&&(o._sentryDebugIds=o._sentryDebugIds||{},o._sentryDebugIds[t]="9ceba748-25d5-4d32-9a3c-da4194015415",o._sentryDebugIdIdentifier="sentry-dbid-9ceba748-25d5-4d32-9a3c-da4194015415")}catch{}})();const a=e(null,function(o,t){return{onGoBack:()=>{t.navigate(-1)},onGoHome:()=>{t.navigate("/")}}})(i);function _(){const o=n();return r.jsx(a,{navigate:o})}export{_ as default};
@@ -1 +1 @@
1
- import{l as ct,a as dt,m as mt,j as E}from"./liveblocks-D3ESVZyk.js";import lt from"./NotFoundScreen-6vyCFr5S.js";import{a as k}from"./sentry-B_92GPgU.js";import{h as ft,g as ut,i as ht,u as pt,j as S,n as kt,o as gt,p as z}from"./core-k_c8SCBE.js";import{cv as St,fh as O,eW as J,fv as bt,fo as b,Su as Q,fr as m,fg as y,sk as M,xG as It,Sv as Ct,ff as Tt,fy as yt,sp as _t,Sw as $,bq as F,f9 as w,st as K,Sx as At,cH as Et,cA as Nt}from"./zeni-epic-state-C3zBO1No.js";import{X as xt,z as Bt,N as wt,x as vt,_ as Rt,cU as Ut,n as N,a7 as Dt,cV as Gt,a8 as Pt,p as $t}from"./index-B4wUHn-k.js";import"./mui-UJrLjp1k.js";import{u as Ft}from"./useAskAiCfoHostNavButtonProps-BJGg886y.js";import"./recharts-Q-kkTNuO.js";import"./analytics-DVTbnjlr.js";import"./plaid-B1j5PXHV.js";import"./dnd-CKEs-Nbe.js";import"./stripe-DMRn4zHo.js";import"./lottie-BYni7Ovk.js";import"./lexical-k-PQZXkn.js";import"./pdf-CaeTpLUv.js";import"./utils-Mjhh9T8E.js";(function(){try{var t=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},l=new t.Error().stack;l&&(t._sentryDebugIds=t._sentryDebugIds||{},t._sentryDebugIds[l]="2d6ae703-c00a-4a2b-afb3-b67dadfc380d",t._sentryDebugIdIdentifier="sentry-dbid-2d6ae703-c00a-4a2b-afb3-b67dadfc380d")}catch{}})();const Mt=(t,l)=>new Promise((n,u)=>{const g=t.map(i=>new Promise(s=>{l(i),s()}));Promise.all(g).then(()=>{setTimeout(()=>{n()},2e3)}).catch(i=>{u(i)})}),jt=kt(function(t,l){const n=O(t),{signedInUser:u,isDebitCardFeatureEnabled:g}=l,i=b(t),s=J(t),{currentTab:h}=i;return{notificationView:i,isNotificationSettingsVisible:u.userEmail!=null&&yt(n.notificationSettings,u.userEmail,g,s),isDisabled:i.notificationDetailsByTab[h].fetchState==="In-Progress"?"disabled":void 0}},function(t,l){const{location:n,tenantEmailDomain:u,loggedInUserRoleMap:g,externalNotificationsUnreadCount:i,allUnreadCommentsNotificationIds:s,navigate:h,markInboxNotificationAsRead:x,fetchMoreCommentsNotifications:v}=l;return{onNotificationClick:(a,o,d,c)=>{if(c==="task_deleted"){const r=`/${u}/tasks`,I=N(n.state?.pathnameStackToGoBack,n.pathname);h(r,{state:{pathnameStackToGoBack:I,message:"triggerBackClick"}})}else{const r=`/${u}/tasks/${o}`,I=N(n.state?.pathnameStackToGoBack,n.pathname);h(r,{state:{pathnameStackToGoBack:I,message:"triggerBackClick"}})}d==="unread"&&t(K("task_manager","read",[a],!1))},onCommentNotificationClick:(a,o,d)=>{const c=o.toString().split(`/${u}/`);if(c[1]!=null){d==="unread"&&(x(a),t($([a],F())));let r=`/${u}/${c[1]}`;const I=N(n.state?.pathnameStackToGoBack,n.pathname);c[1].startsWith("reimbursement")&&!Et(g)&&(r="not-found"),c[1].startsWith("bill")&&!Nt(g)&&(r="not-found"),h(r,{state:{pathnameStackToGoBack:I,message:"triggerBackClick"}})}},onUpdateNotificationViewUIState:(a,o)=>{t(y(a,o))},onUpdateNotificationTabState:(a,o)=>{t(m(a,o))},onUpdateNotificationViewCurrentTabAndSubTab:(a,o)=>{t(Q(a,o));const d=`../${a}`,c=N(n.state?.pathnameStackToGoBack,n.pathname);h(d,{state:{pathnameStackToGoBack:c}})},onUpdateNotificationViewSubTab:a=>{t(At(a))},onFetchMoreNotifications:(a,o)=>{if(a==="tasks"){const d=[];o==="all"?d.push("read","unread"):o!=="mentions"&&d.push(o),t(M("task_manager","dashboard",d))}else v?.()},onUpdateNotificationStatus:(a,o,d,c)=>{a==="tasks"?t(K("task_manager",d,c)):(t(m({markAsReadState:{fetchState:"In-Progress",error:void 0}},"comments")),Promise.all(c.map(r=>{d==="read"&&(x(r),t($([r],F())))})).then(()=>{t(m({markAsReadState:{fetchState:"Completed",error:void 0},selectedNotificationIds:[]},"comments")),t(y({unreadCount:i-c.length>0?i-c.length:0},"comments")),t(w({messageSection:"notification_mark_as_read",messageText:"success",type:"success",showStatusIcon:!0}))},r=>{t(m({markAsReadState:{fetchState:"Error",error:r}},"comments")),t(w({messageSection:"notification_mark_as_read",messageText:"failed",type:"error",showStatusIcon:!0}))}).catch(r=>{t(m({markAsReadState:{fetchState:"Error",error:r}},"comments")),t(w({messageSection:"notification_mark_as_read",messageText:"failed",type:"error",showStatusIcon:!0}))}))},onMarkAllNotificationsAsRead:a=>{a==="tasks"?t(_t("task_manager","read")):(t(m({markAsAllReadState:{fetchState:"In-Progress",error:void 0}},"comments")),Mt(s,x).then(()=>{t($(s,F())),t(m({markAsAllReadState:{fetchState:"Completed",error:void 0}},"comments")),t(y({unreadCount:0},"comments")),t(w({messageSection:"notification_mark_as_read",messageText:"success",type:"success",showStatusIcon:!0}))}).catch(o=>{t(m({markAsAllReadState:{fetchState:"Error",error:o}},"comments")),t(w({messageSection:"notification_mark_as_read",messageText:"failed",type:"error",showStatusIcon:!0}))}))},onBackClick:()=>{const a=$t(n.state?.pathnameStackToGoBack),o=a.poppedPathname??"../../dashboard";h(o,{state:{pathnameStackToGoBack:a.newStack}})},onSettingsClick:()=>{const a=N(n.state?.pathnameStackToGoBack,n.pathname);h("../../settings/notifications",{state:{pathnameStackToGoBack:a}})}}})(Dt(Gt)),Vt=()=>{const t=ft(),l=ut(),{tenantEmailDomain:n,selectedTab:u}=ht(),{areTenantIdsInSync:g}=xt(),i=St(u??""),s=pt(),h=Bt.getSignedInUser(),[x,v]=k.useState(!1),a=S(e=>O(e)),o=S(e=>J(e)),{useFeatureGate:d}=wt(),{isFeatureEnabled:c}=d(vt.isDebitCardFeatureEnabled),{isAiCfoAccessEnabled:r,onAskAiCfoClick:I}=Ft({mobileExploreReferrer:"Notifications"});Rt({isDataReady:!0});const Y=bt(o.userRole);if(o==null||n==null||o.companyId==null)throw Error("Can't access notifications page without current tenant...");if(h==null)throw Error("Can't access notifications page without signed in...");const j=S(e=>b(e).notificationDetailsByTab.tasks.fetchState),V=S(e=>b(e).currentTab),R=S(e=>b(e).currentSubTab),Z=S(e=>b(e).notificationDetailsByTab.comments.fetchCountState),U=S(e=>b(e).notificationDetailsByTab.comments.fetchState),tt=S(e=>b(e).notificationDetailsByTab.comments.uiState.unreadCount),et=S(e=>b(e).allExternalNotifications).filter(e=>e.inboxNotification.readAt==null).map(e=>e.inboxNotification.id),at=Ut().allUsers,{inboxNotifications:B,isLoading:_,hasFetchedAll:C,isFetchingMore:D,fetchMore:ot}=ct(),{threads:W,isLoading:q,fetchMore:H,isFetchingMore:L,hasFetchedAll:X}=dt({query:{metadata:{companyId:o.companyId,application:"dashboard"}}});k.useEffect(()=>{if(V!==i&&i!=null&&s(Q(i)),i==null){const e=`../${V}`,p=N(l.state?.pathnameStackToGoBack,l.pathname);t(e,{state:{pathnameStackToGoBack:p}})}},[i]),k.useEffect(()=>{Z.fetchState==="Not-Started"&&s(m({fetchCountState:{fetchState:"In-Progress",error:void 0}},"comments"))},[]),k.useEffect(()=>{if(_===!1&&C===!0&&o?.companyId!=null&&B!=null){const e=`dashboard_${o.companyId}`,p=B.filter(T=>T.roomId===e&&T.readAt==null).length;s(m({fetchCountState:{fetchState:"Completed",error:void 0}},"comments")),s(y({unreadCount:p},"comments"))}},[_,C]),k.useEffect(()=>{j!=="In-Progress"&&g&&s(M("task_manager","dashboard",["read","unread"]))},[g]),k.useEffect(()=>{const e=setTimeout(()=>ot?.(),0);return()=>clearTimeout(e)});const G=_||D===!0||C!==!0||_||D===!0||C!==!0;k.useEffect(()=>{G&&U!=="In-Progress"?s(m({fetchState:"In-Progress",error:void 0},"comments")):G||U!=="In-Progress"||s(m({fetchState:"Completed",error:void 0},"comments"))},[G,U]),k.useEffect(()=>{s(y({hasMore:C!==!0},"comments"))},[C]),k.useEffect(()=>{a.fetchState!=="In-Progress"&&a.fetchState!=="Completed"&&x===!1&&(v(!0),s(It()))},[a.fetchState]),k.useEffect(()=>{if(_===!1&&q===!1&&B!=null&&W!=null){const e=`dashboard_${o.companyId}`,p=B.filter(f=>f.roomId===e).filter(f=>f.kind==="thread"),T=p.filter(f=>f.readAt==null),A=p.map(f=>f.id),it=p.map(f=>{const P=W.find(rt=>rt.id===f.threadId);return P!=null?{inboxNotification:{...f,threadId:P.id},thread:P}:(L||X===!0||H==null||H(),null)}).filter(f=>f!=null);s(m({allNotificationsIds:A},"comments")),s(y({totalCount:A.length,unreadCount:T.length},"comments")),s(Ct(it))}},[_,D,L,C,X,q,B?.length]);const st={events:o.userRoleId!=null?[`private-encrypted-${o.userRoleId}.dashboard-user-notification`]:[],eventCallback:(e,p)=>{if(Pt(p)){const T=Tt(p.mode);if(T==="dashboard"&&s(y({unreadCount:p.data.unread},"tasks")),j!=="In-Progress"){const A=[];R==="all"?A.push("read","unread"):R!=="mentions"&&A.push(R),s(M("task_manager",T,A,!0))}}}},nt=mt();return E.jsx(jt,{tenantEmailDomain:n,loggedInUserRoleMap:Y,signedInUser:h,externalNotificationsUnreadCount:tt,location:l,navigate:t,isDebitCardFeatureEnabled:c,users:at,markInboxNotificationAsRead:nt,allUnreadCommentsNotificationIds:et,isAiCfoAccessEnabled:r,onAskAiCfoClick:I,...st})};function ne(){return E.jsxs(gt,{children:[E.jsx(z,{path:"/:selectedTab",element:E.jsx(Vt,{})}),E.jsx(z,{path:"*",element:E.jsx(lt,{})})]})}export{ne as default};
1
+ import{l as ct,a as dt,m as mt,j as E}from"./liveblocks-DmbDY3sa.js";import lt from"./NotFoundScreen-C5grvltN.js";import{a as k}from"./sentry--Yi43Gx7.js";import{h as ft,g as ut,i as ht,u as pt,j as S,n as kt,o as gt,p as z}from"./core-Cj3sxYL7.js";import{cv as St,fh as O,eW as J,fv as bt,fo as b,Su as Q,fr as m,fg as y,sk as M,xG as It,Sv as Ct,ff as Tt,fy as yt,sp as _t,Sw as F,bq as $,f9 as w,st as K,Sx as At,cH as Et,cA as Nt}from"./zeni-epic-state-BG_x9wwl.js";import{X as xt,z as Bt,F as wt,x as vt,_ as Rt,cU as Ut,r as N,a7 as Dt,cV as Gt,a8 as Pt,n as Ft}from"./index-C_Y0yMPY.js";import"./mui-1V4hRqCa.js";import{u as $t}from"./useAskAiCfoHostNavButtonProps-OU79nJF1.js";import"./recharts-mFhBBFnU.js";import"./analytics-BpWjaxbv.js";import"./plaid-JtkXopjw.js";import"./dnd-WLAr-qfO.js";import"./stripe-DMRn4zHo.js";import"./lottie-W8sR2m8i.js";import"./lexical--OluaPRa.js";import"./pdf-aJCOHARS.js";import"./utils-Bt5dYICv.js";(function(){try{var t=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},l=new t.Error().stack;l&&(t._sentryDebugIds=t._sentryDebugIds||{},t._sentryDebugIds[l]="264bf8f8-7d21-4a73-adde-1dea295c9d78",t._sentryDebugIdIdentifier="sentry-dbid-264bf8f8-7d21-4a73-adde-1dea295c9d78")}catch{}})();const Mt=(t,l)=>new Promise((n,u)=>{const g=t.map(i=>new Promise(s=>{l(i),s()}));Promise.all(g).then(()=>{setTimeout(()=>{n()},2e3)}).catch(i=>{u(i)})}),jt=kt(function(t,l){const n=O(t),{signedInUser:u,isDebitCardFeatureEnabled:g}=l,i=b(t),s=J(t),{currentTab:h}=i;return{notificationView:i,isNotificationSettingsVisible:u.userEmail!=null&&yt(n.notificationSettings,u.userEmail,g,s),isDisabled:i.notificationDetailsByTab[h].fetchState==="In-Progress"?"disabled":void 0}},function(t,l){const{location:n,tenantEmailDomain:u,loggedInUserRoleMap:g,externalNotificationsUnreadCount:i,allUnreadCommentsNotificationIds:s,navigate:h,markInboxNotificationAsRead:x,fetchMoreCommentsNotifications:v}=l;return{onNotificationClick:(a,o,d,c)=>{if(c==="task_deleted"){const r=`/${u}/tasks`,I=N(n.state?.pathnameStackToGoBack,n.pathname);h(r,{state:{pathnameStackToGoBack:I,message:"triggerBackClick"}})}else{const r=`/${u}/tasks/${o}`,I=N(n.state?.pathnameStackToGoBack,n.pathname);h(r,{state:{pathnameStackToGoBack:I,message:"triggerBackClick"}})}d==="unread"&&t(K("task_manager","read",[a],!1))},onCommentNotificationClick:(a,o,d)=>{const c=o.toString().split(`/${u}/`);if(c[1]!=null){d==="unread"&&(x(a),t(F([a],$())));let r=`/${u}/${c[1]}`;const I=N(n.state?.pathnameStackToGoBack,n.pathname);c[1].startsWith("reimbursement")&&!Et(g)&&(r="not-found"),c[1].startsWith("bill")&&!Nt(g)&&(r="not-found"),h(r,{state:{pathnameStackToGoBack:I,message:"triggerBackClick"}})}},onUpdateNotificationViewUIState:(a,o)=>{t(y(a,o))},onUpdateNotificationTabState:(a,o)=>{t(m(a,o))},onUpdateNotificationViewCurrentTabAndSubTab:(a,o)=>{t(Q(a,o));const d=`../${a}`,c=N(n.state?.pathnameStackToGoBack,n.pathname);h(d,{state:{pathnameStackToGoBack:c}})},onUpdateNotificationViewSubTab:a=>{t(At(a))},onFetchMoreNotifications:(a,o)=>{if(a==="tasks"){const d=[];o==="all"?d.push("read","unread"):o!=="mentions"&&d.push(o),t(M("task_manager","dashboard",d))}else v?.()},onUpdateNotificationStatus:(a,o,d,c)=>{a==="tasks"?t(K("task_manager",d,c)):(t(m({markAsReadState:{fetchState:"In-Progress",error:void 0}},"comments")),Promise.all(c.map(r=>{d==="read"&&(x(r),t(F([r],$())))})).then(()=>{t(m({markAsReadState:{fetchState:"Completed",error:void 0},selectedNotificationIds:[]},"comments")),t(y({unreadCount:i-c.length>0?i-c.length:0},"comments")),t(w({messageSection:"notification_mark_as_read",messageText:"success",type:"success",showStatusIcon:!0}))},r=>{t(m({markAsReadState:{fetchState:"Error",error:r}},"comments")),t(w({messageSection:"notification_mark_as_read",messageText:"failed",type:"error",showStatusIcon:!0}))}).catch(r=>{t(m({markAsReadState:{fetchState:"Error",error:r}},"comments")),t(w({messageSection:"notification_mark_as_read",messageText:"failed",type:"error",showStatusIcon:!0}))}))},onMarkAllNotificationsAsRead:a=>{a==="tasks"?t(_t("task_manager","read")):(t(m({markAsAllReadState:{fetchState:"In-Progress",error:void 0}},"comments")),Mt(s,x).then(()=>{t(F(s,$())),t(m({markAsAllReadState:{fetchState:"Completed",error:void 0}},"comments")),t(y({unreadCount:0},"comments")),t(w({messageSection:"notification_mark_as_read",messageText:"success",type:"success",showStatusIcon:!0}))}).catch(o=>{t(m({markAsAllReadState:{fetchState:"Error",error:o}},"comments")),t(w({messageSection:"notification_mark_as_read",messageText:"failed",type:"error",showStatusIcon:!0}))}))},onBackClick:()=>{const a=Ft(n.state?.pathnameStackToGoBack),o=a.poppedPathname??"../../dashboard";h(o,{state:{pathnameStackToGoBack:a.newStack}})},onSettingsClick:()=>{const a=N(n.state?.pathnameStackToGoBack,n.pathname);h("../../settings/notifications",{state:{pathnameStackToGoBack:a}})}}})(Dt(Gt)),Vt=()=>{const t=ft(),l=ut(),{tenantEmailDomain:n,selectedTab:u}=ht(),{areTenantIdsInSync:g}=xt(),i=St(u??""),s=pt(),h=Bt.getSignedInUser(),[x,v]=k.useState(!1),a=S(e=>O(e)),o=S(e=>J(e)),{useFeatureGate:d}=wt(),{isFeatureEnabled:c}=d(vt.isDebitCardFeatureEnabled),{isAiCfoAccessEnabled:r,onAskAiCfoClick:I}=$t({mobileExploreReferrer:"Notifications"});Rt({isDataReady:!0});const Y=bt(o.userRole);if(o==null||n==null||o.companyId==null)throw Error("Can't access notifications page without current tenant...");if(h==null)throw Error("Can't access notifications page without signed in...");const j=S(e=>b(e).notificationDetailsByTab.tasks.fetchState),V=S(e=>b(e).currentTab),R=S(e=>b(e).currentSubTab),Z=S(e=>b(e).notificationDetailsByTab.comments.fetchCountState),U=S(e=>b(e).notificationDetailsByTab.comments.fetchState),tt=S(e=>b(e).notificationDetailsByTab.comments.uiState.unreadCount),et=S(e=>b(e).allExternalNotifications).filter(e=>e.inboxNotification.readAt==null).map(e=>e.inboxNotification.id),at=Ut().allUsers,{inboxNotifications:B,isLoading:_,hasFetchedAll:C,isFetchingMore:D,fetchMore:ot}=ct(),{threads:W,isLoading:q,fetchMore:H,isFetchingMore:L,hasFetchedAll:X}=dt({query:{metadata:{companyId:o.companyId,application:"dashboard"}}});k.useEffect(()=>{if(V!==i&&i!=null&&s(Q(i)),i==null){const e=`../${V}`,p=N(l.state?.pathnameStackToGoBack,l.pathname);t(e,{state:{pathnameStackToGoBack:p}})}},[i]),k.useEffect(()=>{Z.fetchState==="Not-Started"&&s(m({fetchCountState:{fetchState:"In-Progress",error:void 0}},"comments"))},[]),k.useEffect(()=>{if(_===!1&&C===!0&&o?.companyId!=null&&B!=null){const e=`dashboard_${o.companyId}`,p=B.filter(T=>T.roomId===e&&T.readAt==null).length;s(m({fetchCountState:{fetchState:"Completed",error:void 0}},"comments")),s(y({unreadCount:p},"comments"))}},[_,C]),k.useEffect(()=>{j!=="In-Progress"&&g&&s(M("task_manager","dashboard",["read","unread"]))},[g]),k.useEffect(()=>{const e=setTimeout(()=>ot?.(),0);return()=>clearTimeout(e)});const G=_||D===!0||C!==!0||_||D===!0||C!==!0;k.useEffect(()=>{G&&U!=="In-Progress"?s(m({fetchState:"In-Progress",error:void 0},"comments")):G||U!=="In-Progress"||s(m({fetchState:"Completed",error:void 0},"comments"))},[G,U]),k.useEffect(()=>{s(y({hasMore:C!==!0},"comments"))},[C]),k.useEffect(()=>{a.fetchState!=="In-Progress"&&a.fetchState!=="Completed"&&x===!1&&(v(!0),s(It()))},[a.fetchState]),k.useEffect(()=>{if(_===!1&&q===!1&&B!=null&&W!=null){const e=`dashboard_${o.companyId}`,p=B.filter(f=>f.roomId===e).filter(f=>f.kind==="thread"),T=p.filter(f=>f.readAt==null),A=p.map(f=>f.id),it=p.map(f=>{const P=W.find(rt=>rt.id===f.threadId);return P!=null?{inboxNotification:{...f,threadId:P.id},thread:P}:(L||X===!0||H==null||H(),null)}).filter(f=>f!=null);s(m({allNotificationsIds:A},"comments")),s(y({totalCount:A.length,unreadCount:T.length},"comments")),s(Ct(it))}},[_,D,L,C,X,q,B?.length]);const st={events:o.userRoleId!=null?[`private-encrypted-${o.userRoleId}.dashboard-user-notification`]:[],eventCallback:(e,p)=>{if(Pt(p)){const T=Tt(p.mode);if(T==="dashboard"&&s(y({unreadCount:p.data.unread},"tasks")),j!=="In-Progress"){const A=[];R==="all"?A.push("read","unread"):R!=="mentions"&&A.push(R),s(M("task_manager",T,A,!0))}}}},nt=mt();return E.jsx(jt,{tenantEmailDomain:n,loggedInUserRoleMap:Y,signedInUser:h,externalNotificationsUnreadCount:tt,location:l,navigate:t,isDebitCardFeatureEnabled:c,users:at,markInboxNotificationAsRead:nt,allUnreadCommentsNotificationIds:et,isAiCfoAccessEnabled:r,onAskAiCfoClick:I,...st})};function ne(){return E.jsxs(gt,{children:[E.jsx(z,{path:"/:selectedTab",element:E.jsx(Vt,{})}),E.jsx(z,{path:"*",element:E.jsx(lt,{})})]})}export{ne as default};
@@ -0,0 +1 @@
1
+ import{j as m}from"./liveblocks-DmbDY3sa.js";import{a as r}from"./sentry--Yi43Gx7.js";import{u as T,g as A,j as o,N as j}from"./core-Cj3sxYL7.js";import{LX as C,eW as P,fn as x,LY as z,LZ as D,L_ as M,L$ as R,o5 as k,KU as N}from"./zeni-epic-state-BG_x9wwl.js";import{z as h,J as I}from"./index-C_Y0yMPY.js";import"./mui-1V4hRqCa.js";import"./recharts-mFhBBFnU.js";import"./analytics-BpWjaxbv.js";import"./plaid-JtkXopjw.js";import"./dnd-WLAr-qfO.js";import"./stripe-DMRn4zHo.js";import"./lottie-W8sR2m8i.js";import"./lexical--OluaPRa.js";import"./pdf-aJCOHARS.js";import"./utils-Bt5dYICv.js";(function(){try{var n=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},s=new n.Error().stack;s&&(n._sentryDebugIds=n._sentryDebugIds||{},n._sentryDebugIds[s]="b0957be4-1f0c-4428-894c-ab15963a74b8",n._sentryDebugIdIdentifier="sentry-dbid-b0957be4-1f0c-4428-894c-ab15963a74b8")}catch{}})();function ee(){const n=T(),s=A(),{params:t,error:i}=r.useMemo(()=>C(s.search),[s.search]),b=r.useMemo(()=>new URLSearchParams(s.search).get("client_name")??t?.clientId??"Unknown Application",[s.search,t]),p=h.isSignedIn(),a=h.getSignedInUser(),f=o(e=>P(e)),l=o(e=>x(e)),d=o(e=>e.tenantState.fetchState),w=o(z),y=o(D),c=o(M),[v,S]=r.useState(null),[E,_]=r.useState(null);r.useEffect(()=>{document.querySelector("#app-shell-loader")?.remove()},[]),r.useEffect(()=>()=>{n(R())},[n,s.search]),r.useEffect(()=>{i!=null&&console.warn("[OAuthConsent] invalid params:",i)},[i]);const g=r.useRef(!1);r.useEffect(()=>{p&&a!=null&&!g.current&&(d!=="Not-Started"&&d!=="Error"||(g.current=!0,n(k(a.userId,a.zeniSessionId??void 0))))},[p,a,d,n]),r.useEffect(()=>{c!=null&&c!==""&&(window.location.href=c)},[c]);const U=r.useMemo(()=>{if(f?.tenantId!=null)return f.tenantId;const e=h.getActiveTenantForUser()?.tenantId;return e!=null&&l.some(L=>L.tenantId===e)?e:l.length===1?l[0].tenantId:null},[f?.tenantId,l]),u=v??U;return i!=null?m.jsx(I,{variant:"invalid_params",paramsError:i}):p?m.jsx(I,{variant:"signed_in",clientName:b,userEmail:a?.userEmail,isInitializing:d!=="Completed",tenants:l,selectedTenantId:u,onSelectTenant:S,approveError:E??y,isApproving:w==="In-Progress",showAllowButton:u!=null,onApprove:()=>{t!=null&&a!=null&&u!=null&&n(N(a.userId,a.zeniSessionId??void 0,u,t.clientId,t.redirectUri,t.codeChallenge,t.codeChallengeMethod,t.state,t.responseType))},onDeny:()=>{if(t!=null)try{const e=new URL(t.redirectUri);e.searchParams.set("error","access_denied"),e.searchParams.set("error_description","The user denied the request"),e.searchParams.set("state",t.state),window.location.href=e.toString()}catch{_("Unable to deny: redirect_uri is not a valid URL. Close this window or contact support.")}}}):m.jsx(j,{to:"/signin/auth",state:{origin:s.pathname+s.search},replace:!0})}export{ee as default};
@@ -0,0 +1 @@
1
+ import{j as n}from"./liveblocks-DmbDY3sa.js";import{h as z,u as J,g as X,i as Z,j as d,n as H,o as K,p as I}from"./core-Cj3sxYL7.js";import{eW as M,s8 as P,rI as Q,Ms as O,rD as S,bt as ee,bn as ae,bY as te,rE as se,Mt as oe,Mf as C,dJ as re,vD as ne,Mu as ce,v_ as ie,fe as le,fc as de}from"./zeni-epic-state-BG_x9wwl.js";import{z as fe,X as me,_ as pe,j as ue,F as U,x as $,A as he,c as w,ao as Fe,r as ge}from"./index-C_Y0yMPY.js";import"./mui-1V4hRqCa.js";import be from"./NotFoundScreen-C5grvltN.js";import{F as Ie}from"./FeaturePreviewScreen-h089v0nG.js";import{a as F}from"./sentry--Yi43Gx7.js";import{u as Ce}from"./useAskAiCfoHostNavButtonProps-OU79nJF1.js";import{u as Se}from"./useInitialThreadRequest-C_e7mvD1.js";import{t as Te}from"./routePaths-D0rLO8yN.js";import{M as ye}from"./MobileAppDrawer-B8b7sXqB.js";import"./recharts-mFhBBFnU.js";import"./analytics-BpWjaxbv.js";import"./plaid-JtkXopjw.js";import"./dnd-WLAr-qfO.js";import"./stripe-DMRn4zHo.js";import"./lottie-W8sR2m8i.js";import"./lexical--OluaPRa.js";import"./pdf-aJCOHARS.js";import"./utils-Bt5dYICv.js";(function(){try{var s=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},e=new s.Error().stack;e&&(s._sentryDebugIds=s._sentryDebugIds||{},s._sentryDebugIds[e]="6d0f417f-1c09-4e36-bf56-f94b4a936fc7",s._sentryDebugIdIdentifier="sentry-dbid-6d0f417f-1c09-4e36-bf56-f94b4a936fc7")}catch{}})();const T=(s,e,a,o)=>{if(s!=e){const r=o??"";s!=null&&s.length>0?a(`../${e}${r}`,{replace:!0}):a(`${e}${r}`,{replace:!0})}},xe=H(function(s){const e=oe(s),a={},o=e.pandLReportWithForecast.uiState.nodeCollapseState;return Object.keys(o).forEach(r=>{a[r]=o[r]===!1}),{selectedTimeframe:e.selectedTimeframe,isForecastVsActualOn:e.isForecastVsActualOn,compareMode:e.compareMode,forecastList:e.forecastList,selectedForecast:e.selectedForecast,pandLreport:e.pandLReportWithForecast,scrollPosition:e.pandLReportWithForecast.uiState.scrollPosition,nodeOpenStatus:a,type:"name+balances_forecast",analytics:w}},function(s,e){return{onForecastSelectionChanged:(a,o)=>{s(O(a,o)),e.isPandLReportFetched(a)||s(S(a)),T(e.forecastIdFromUrlPath,a,e.navigate)},onTimeframeChanged:a=>{s(ie(a))},onForecastVsActualsCompareToggle:a=>{s(ce(a)),s(C({forecastId:e.forecastIdFromUrlPath,scrollPosition:{scrollLeft:0,scrollTop:0}}))},onCompareModeChanged:a=>{s(ne(e.firstMonthOfFY,a,0,[]))},onAccountBalanceClick:e.hasTransactionAccess!==!0?void 0:(a,o)=>{let r,c;const p=a.accountName===""?a.accountDescription:a.accountName;if(o.balanceTimeFrame==="month"||o.balanceTimeFrame==="quarter"?(r=o.balanceTimeFrame,c=re(o)):o.balanceTimeFrame==="year"?(r="quarter",c={startDate:o.endDate.startOf("quarter"),endDate:o.endDate}):console.error(`timeframe ${o.balanceTimeFrame} is not supported`),c!=null&&r!=null){const f=Te(e.tenantEmailDomain,a.accountId,a.accountType,p,r,c),u=ge(e.location.state?.pathnameStackToGoBack,e.location.pathname);e.navigate(f,{state:{pathnameStackToGoBack:u,referrer:"Forecast"}})}},onNodeCollapseToggled:(a,o)=>{s(C({forecastId:e.forecastIdFromUrlPath,nodeCollapseState:{nodeId:a,isCollapsed:o===!1}}))},onTableScroll:a=>{s(C({forecastId:e.forecastIdFromUrlPath,scrollPosition:a}))},onBackClick:()=>{e.navigate("../../")}}})(Fe);function v(){const s=z(),e=J(),a=X(),{forecastId:o,tenantEmailDomain:r}=Z(),[c,p]=F.useState(!1),[f,u]=F.useState(!1),h=fe.getSignedInUser(),y=d(t=>M(t)),_=y.company?.companyInfo.firstMonthOfFY??1,i=d(t=>P(t.forecastState,t.forecastListState)),l=d(t=>t.forecastListState.fetchState==="Completed"),x=d(t=>t.profitAndLossState),A=d(t=>t.reportUIOptionsState.selectedForecast),D=t=>x.pandLByForecastID[t]!=null&&se(t,x).reducedAllFetchState.fetchState==="Completed",{areTenantIdsInSync:g}=me();pe({isDataReady:l});const{isAiCfoAccessEnabled:B,onAskAiCfoClick:N}=Ce({mobileExploreReferrer:"Forecast"});F.useEffect(()=>{if(!c&&g)p(!0),l||e(Q());else if(l&&!f){u(!0);const t=((m,L,R)=>L!=null?m.forecasts.findIndex(b=>b.id===L):R!=null?m.forecasts.findIndex(b=>b.id===R):m.forecasts.length>0?0:-1)(i,o,A?.id);t===-1&&o!=null?s("page-not-found",{replace:!0}):t!==-1&&t!=A?.index?(e(O(i.forecasts[t].id,t)),T(o,i.forecasts[t].id,s,a.search)):o==null&&t!==-1&&T(void 0,i.forecasts[t].id,s,a.search),t!==-1&&!D(i.forecasts[t].id)&&g&&e(S(i.forecasts[t].id))}},[c,p,e,l,i,f,u,P,S,g]);const k=ue(),W=k?.loggedInUserRole!=null&&ee(k.loggedInUserRole),{useFeatureGate:q}=U(),{isFeatureEnabled:j}=q($.isReportsCommentingEnabled),G=Se(j?y?.companyId:void 0,{clearParams:l&&f}),[V,Y]=F.useState(!1),E=t=>{Y(t)};return n.jsxs(n.Fragment,{children:[l?n.jsx(he,{analytics:w,onLoad:t=>(m=>m.trackForecast())(t)}):null,n.jsx(ye,{isAppContentDrawerOpen:V,handleDrawerToggle:E}),n.jsx(xe,{firstMonthOfFY:_,tenantEmailDomain:r,forecastIdFromUrlPath:o,navigate:s,location:a,isPandLReportFetched:D,meetingUrl:te(`https://meetings.hubspot.com/svitlana-grankovska?firstname=${h?.firstName}&lastname=${h?.lastName}&email=${h?.userEmail}`),hasTransactionAccess:W,isAiCfoAccessEnabled:B,onAskAiCfoClick:N,isReportsCommentingEnabled:j,isZeniUser:ae(h),initialOpenThreadRequest:G,onClickMenuIcon:()=>{E(!0)}})]})}function Ye(){const s=d(c=>M(c)),{useFeatureGate:e}=U(),{isFeatureEnabled:a}=e($.isDebitCardFeatureEnabled),o=le(a,s),r=de(s);return o===!0||r===!0?n.jsx(Ie,{}):n.jsxs(K,{children:[n.jsx(I,{path:"/",element:n.jsx(v,{})}),n.jsx(I,{path:"/:forecastId",element:n.jsx(v,{})}),n.jsx(I,{path:"/:forecastId/*",element:n.jsx(be,{})})]})}export{Ye as PandLWithForecastRoutes,Ye as default};
@@ -1,8 +1,8 @@
1
- import{j as s}from"./liveblocks-D3ESVZyk.js";import{Mo as te,eW as X,ks as G,fe as J,fc as ne,JS as Q,M2 as oe,uB as Ee,Mp as N,uq as ke,uK as Ie,uE as ie,uu as re,uI as Pe,uF as je,Mq as le,wp as Te,ga as Le,gd as ve,Mr as M,uy as de,ux as ce,uN as Fe,c7 as Ae}from"./zeni-epic-state-C3zBO1No.js";import{h as pe,N as Y,x as E,z as K,a9 as ue,E as me,ak as ge,al as Re,w as he,o as R,Q as fe,D as Ce,am as Oe,X as Ve,_ as Ue,r as Be,c as be,e as Ze,n as $e,an as Me,j as _e}from"./index-B4wUHn-k.js";import{D as ye,n as H,S as we}from"./mui-UJrLjp1k.js";import ae from"./NotFoundScreen-6vyCFr5S.js";import{a as r}from"./sentry-B_92GPgU.js";import{u as ee,i as ze,j as m,h as Ge,g as Ke,n as He,o as se,p as $}from"./core-k_c8SCBE.js";import{u as We}from"./useAskAiCfoHostNavButtonProps-BJGg886y.js";import{M as qe}from"./MobileAppDrawer-BzOopfIc.js";import"./recharts-Q-kkTNuO.js";import"./analytics-DVTbnjlr.js";import"./plaid-B1j5PXHV.js";import"./dnd-CKEs-Nbe.js";import"./stripe-DMRn4zHo.js";import"./lottie-BYni7Ovk.js";import"./lexical-k-PQZXkn.js";import"./pdf-CaeTpLUv.js";import"./utils-Mjhh9T8E.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]="320ea3c4-a987-4789-bd5c-b842b4807e81",a._sentryDebugIdIdentifier="sentry-dbid-320ea3c4-a987-4789-bd5c-b842b4807e81")}catch{}})();const Ne={overlayWidth:new he(100,100,48)},_=Ce.getLocalizedStrings().peoplePage.invitePage,Xe=({companyId:a,managersListView:t,companyPassportView:l,classListView:n,mode:g,isEditPeopleDrawerOpen:o,closeDrawerHandler:y})=>{const h=pe(),p=ee(),[O,V]=r.useState(!1),[I,w]=r.useState(!1),{userId:S}=ze(),d=m(e=>te(e)),u=m(e=>X(e)),D=m(e=>G(e)),{useFeatureGate:f}=Y(),{isFeatureEnabled:k}=f(E.isDebitCardFeatureEnabled),P=J(k,u),L=ne(u),v=Q(u),U=oe(u),B=!!u.company?.featuresActivationInfo?.isReimbursementFeatureEnabled,x=!P&&D&&n.fetchState!=="Completed"||t.fetchState!=="Completed"||l.fetchState!=="Completed"||a==null;if(K.getSignedInUser()==null)throw Error("Can't access invite people page without signing in...");const C=()=>{p(N()),y()},F=()=>{O===!0?w(!0):C()},Z=l.companyView?.controllers?.map(e=>e.user),{isFeatureEnabled:c}=f(E.isDepositAccountsFeatureEnabled),{isFeatureEnabled:j}=f(E.isChargeCardFeatureEnabled),T=ue(u,j,k),{isFeatureEnabled:A}=f(E.isTreasuryEnabled),b={peopleDetails:d,classList:n.classes,managersList:t.users,controllersList:Z,mode:g,isZeniTenant:v,isAccountingClassesEnabled:D,isReimbursementDisabled:B===!1,isZeniAccountsDisabled:c===!1,isChargeCardDisabled:T===!1,isTreasuryDisabled:A===!1,isLiteRoleDisabled:U===!1,isBankingOnlyTenant:P,isCardsOnlyTenant:L,onResetClick:C,onDeleteUser:e=>{p(re(e.userId,e.userRole.userRoleId))},onPeopleLocalDataUpdated:e=>{p(ie({peopleLocalData:e})),V(!0)},onSaveClick:()=>{p(g==="zeni_only"?ke(a):Ie(v))},onCloseClick:F,isLoading:x||d.person==null},i={onOkClick:()=>{w(!1),C()},onCancelClick:()=>{w(!1)}};return r.useEffect(()=>{x===!1&&S!=null&&p(Ee(S))},[x,S]),r.useEffect(()=>{d.updatePersonState.fetchState==="Completed"&&C()},[d.updatePersonState.fetchState]),s.jsx(ye,{anchor:"right",open:o,PaperProps:{style:{width:Ne.overlayWidth.valuePercentage(h),boxShadow:"none"}},slotProps:{backdrop:{style:{backgroundColor:me.overlayDark,cursor:"pointer"}}},onClose:F,children:s.jsxs(Je,{onClick:e=>e.stopPropagation(),children:[I===!0?s.jsx(ge,{titleComponent:s.jsx(Se,{children:_.discardTitle}),descriptionComponent:s.jsx(De,{children:_.discardDescription}),primaryButtonText:_.discard,secondaryButtonText:_.no,action:i,isEditPopup:!0}):null,s.jsx(Re,{...b})]})})},Je=H(we)`
1
+ import{j as s}from"./liveblocks-DmbDY3sa.js";import{Mo as te,eW as Q,ks as z,fe as J,fc as ne,JS as X,M2 as oe,uB as Ee,Mp as N,uq as ke,uK as Ie,uE as ie,uu as re,uI as Pe,uF as je,Mq as le,wp as Te,ga as Le,gd as ve,Mr as M,uy as de,ux as ce,uN as Fe,c7 as Ae}from"./zeni-epic-state-BG_x9wwl.js";import{K as pe,F as Y,x as E,z as G,a9 as ue,I as me,ak as ge,al as Re,E as he,o as R,N as fe,D as Ce,am as Oe,X as Ve,_ as Ue,A as Be,c as be,e as Ze,r as $e,an as Me,j as _e}from"./index-C_Y0yMPY.js";import{D as ye,n as H,S as Se}from"./mui-1V4hRqCa.js";import ae from"./NotFoundScreen-C5grvltN.js";import{a as r}from"./sentry--Yi43Gx7.js";import{u as ee,i as Ke,j as m,h as ze,g as Ge,n as He,o as se,p as $}from"./core-Cj3sxYL7.js";import{u as We}from"./useAskAiCfoHostNavButtonProps-OU79nJF1.js";import{M as qe}from"./MobileAppDrawer-B8b7sXqB.js";import"./recharts-mFhBBFnU.js";import"./analytics-BpWjaxbv.js";import"./plaid-JtkXopjw.js";import"./dnd-WLAr-qfO.js";import"./stripe-DMRn4zHo.js";import"./lottie-W8sR2m8i.js";import"./lexical--OluaPRa.js";import"./pdf-aJCOHARS.js";import"./utils-Bt5dYICv.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]="bd7ba780-d4de-4021-935c-5e5a775028d2",a._sentryDebugIdIdentifier="sentry-dbid-bd7ba780-d4de-4021-935c-5e5a775028d2")}catch{}})();const Ne={overlayWidth:new he(100,100,48)},_=Ce.getLocalizedStrings().peoplePage.invitePage,Qe=({companyId:a,managersListView:t,companyPassportView:l,classListView:n,mode:g,isEditPeopleDrawerOpen:o,closeDrawerHandler:y})=>{const h=pe(),p=ee(),[O,V]=r.useState(!1),[I,S]=r.useState(!1),{userId:w}=Ke(),d=m(e=>te(e)),u=m(e=>Q(e)),D=m(e=>z(e)),{useFeatureGate:f}=Y(),{isFeatureEnabled:k}=f(E.isDebitCardFeatureEnabled),P=J(k,u),L=ne(u),v=X(u),U=oe(u),B=!!u.company?.featuresActivationInfo?.isReimbursementFeatureEnabled,x=!P&&D&&n.fetchState!=="Completed"||t.fetchState!=="Completed"||l.fetchState!=="Completed"||a==null;if(G.getSignedInUser()==null)throw Error("Can't access invite people page without signing in...");const C=()=>{p(N()),y()},F=()=>{O===!0?S(!0):C()},Z=l.companyView?.controllers?.map(e=>e.user),{isFeatureEnabled:c}=f(E.isDepositAccountsFeatureEnabled),{isFeatureEnabled:j}=f(E.isChargeCardFeatureEnabled),T=ue(u,j,k),{isFeatureEnabled:A}=f(E.isTreasuryEnabled),b={peopleDetails:d,classList:n.classes,managersList:t.users,controllersList:Z,mode:g,isZeniTenant:v,isAccountingClassesEnabled:D,isReimbursementDisabled:B===!1,isZeniAccountsDisabled:c===!1,isChargeCardDisabled:T===!1,isTreasuryDisabled:A===!1,isLiteRoleDisabled:U===!1,isBankingOnlyTenant:P,isCardsOnlyTenant:L,onResetClick:C,onDeleteUser:e=>{p(re(e.userId,e.userRole.userRoleId))},onPeopleLocalDataUpdated:e=>{p(ie({peopleLocalData:e})),V(!0)},onSaveClick:()=>{p(g==="zeni_only"?ke(a):Ie(v))},onCloseClick:F,isLoading:x||d.person==null},i={onOkClick:()=>{S(!1),C()},onCancelClick:()=>{S(!1)}};return r.useEffect(()=>{x===!1&&w!=null&&p(Ee(w))},[x,w]),r.useEffect(()=>{d.updatePersonState.fetchState==="Completed"&&C()},[d.updatePersonState.fetchState]),s.jsx(ye,{anchor:"right",open:o,PaperProps:{style:{width:Ne.overlayWidth.valuePercentage(h),boxShadow:"none"}},slotProps:{backdrop:{style:{backgroundColor:me.overlayDark,cursor:"pointer"}}},onClose:F,children:s.jsxs(Je,{onClick:e=>e.stopPropagation(),children:[I===!0?s.jsx(ge,{titleComponent:s.jsx(we,{children:_.discardTitle}),descriptionComponent:s.jsx(De,{children:_.discardDescription}),primaryButtonText:_.discard,secondaryButtonText:_.no,action:i,isEditPopup:!0}):null,s.jsx(Re,{...b})]})})},Je=H(Se)`
2
2
  display: flex;
3
3
  min-height: 100%;
4
4
  flex-direction: column;
5
- `,Se=H(fe.H6Regular)`
5
+ `,we=H(fe.H6Regular)`
6
6
  margin-top: ${R.sp7};
7
7
  padding-left: ${R.sp8};
8
8
  padding-right: ${R.sp8};
@@ -15,8 +15,8 @@ import{j as s}from"./liveblocks-D3ESVZyk.js";import{Mo as te,eW as X,ks as G,fe
15
15
  margin-bottom: 30px;
16
16
  margin-top: ${R.sp4};
17
17
  white-space: pre-line;
18
- `,Qe={overlayWidth:new he(100,100,48)},z=Ce.getLocalizedStrings().peoplePage.invitePage,Ye=({companyId:a,managersListView:t,companyPassportView:l,classListView:n,mode:g,isInvitePeopleDrawerOpen:o,closeDrawerHandler:y})=>{const h=pe(),p=ee(),[O,V]=r.useState(!1),[I,w]=r.useState(!1),S=m(i=>te(i)),d=m(i=>X(i)),u=m(i=>G(i)),{useFeatureGate:D}=Y(),{isFeatureEnabled:f}=D(E.isDebitCardFeatureEnabled),k=J(f,d),P=ne(d),L=Q(d),v=oe(d),U=!!d.company?.featuresActivationInfo?.isReimbursementFeatureEnabled,B=!k&&u&&n.fetchState!=="Completed"||t.fetchState!=="Completed"||l.fetchState!=="Completed"||a==null;if(K.getSignedInUser()==null)throw Error("Can't access invite people page without signing in...");const x=()=>{y(),p(N())},C=()=>{O===!0?w(!0):x()},F={onOkClick:()=>{w(!1),x()},onCancelClick:()=>{w(!1)}},Z=l.companyView?.controllers.map(i=>i.user),{isFeatureEnabled:c}=D(E.isDepositAccountsFeatureEnabled),{isFeatureEnabled:j}=D(E.isChargeCardFeatureEnabled),T=ue(d,j,f),{isFeatureEnabled:A}=D(E.isTreasuryEnabled),b={classList:n.classes,managersList:t.users,controllersList:Z,mode:g,isZeniTenant:L,onPeopleLocalDataUpdated:i=>{p(ie({peopleLocalData:i})),V(!0)},onResetClick:x,onSaveClick:()=>{p(g==="zeni_only"?Pe(a):je())},onCloseClick:C,peopleDetails:S,isAccountingClassesEnabled:u,isReimbursementDisabled:U===!1,isLiteRoleDisabled:v===!1,isZeniAccountsDisabled:c===!1,isChargeCardDisabled:T===!1,isTreasuryDisabled:A===!1,isBankingOnlyTenant:k,isCardsOnlyTenant:P,isLoading:B};return r.useEffect(()=>{S.invitePersonState.fetchState==="Completed"&&(y(),p(N()))},[S.invitePersonState.fetchState]),s.jsx(ye,{anchor:"right",open:o,PaperProps:{style:{width:Qe.overlayWidth.valuePercentage(h),boxShadow:"none"}},slotProps:{backdrop:{style:{backgroundColor:me.overlayDark,cursor:"pointer"}}},onClose:C,children:s.jsxs(ea,{onClick:i=>i.stopPropagation(),children:[I===!0?s.jsx(ge,{titleComponent:s.jsx(Se,{children:z.discardTitle}),descriptionComponent:s.jsx(De,{children:z.discardDescription}),primaryButtonText:z.discard,secondaryButtonText:z.no,action:F}):null,s.jsx(Oe,{...b})]})})},ea=H(we)`
18
+ `,Xe={overlayWidth:new he(100,100,48)},K=Ce.getLocalizedStrings().peoplePage.invitePage,Ye=({companyId:a,managersListView:t,companyPassportView:l,classListView:n,mode:g,isInvitePeopleDrawerOpen:o,closeDrawerHandler:y})=>{const h=pe(),p=ee(),[O,V]=r.useState(!1),[I,S]=r.useState(!1),w=m(i=>te(i)),d=m(i=>Q(i)),u=m(i=>z(i)),{useFeatureGate:D}=Y(),{isFeatureEnabled:f}=D(E.isDebitCardFeatureEnabled),k=J(f,d),P=ne(d),L=X(d),v=oe(d),U=!!d.company?.featuresActivationInfo?.isReimbursementFeatureEnabled,B=!k&&u&&n.fetchState!=="Completed"||t.fetchState!=="Completed"||l.fetchState!=="Completed"||a==null;if(G.getSignedInUser()==null)throw Error("Can't access invite people page without signing in...");const x=()=>{y(),p(N())},C=()=>{O===!0?S(!0):x()},F={onOkClick:()=>{S(!1),x()},onCancelClick:()=>{S(!1)}},Z=l.companyView?.controllers.map(i=>i.user),{isFeatureEnabled:c}=D(E.isDepositAccountsFeatureEnabled),{isFeatureEnabled:j}=D(E.isChargeCardFeatureEnabled),T=ue(d,j,f),{isFeatureEnabled:A}=D(E.isTreasuryEnabled),b={classList:n.classes,managersList:t.users,controllersList:Z,mode:g,isZeniTenant:L,onPeopleLocalDataUpdated:i=>{p(ie({peopleLocalData:i})),V(!0)},onResetClick:x,onSaveClick:()=>{p(g==="zeni_only"?Pe(a):je())},onCloseClick:C,peopleDetails:w,isAccountingClassesEnabled:u,isReimbursementDisabled:U===!1,isLiteRoleDisabled:v===!1,isZeniAccountsDisabled:c===!1,isChargeCardDisabled:T===!1,isTreasuryDisabled:A===!1,isBankingOnlyTenant:k,isCardsOnlyTenant:P,isLoading:B};return r.useEffect(()=>{w.invitePersonState.fetchState==="Completed"&&(y(),p(N()))},[w.invitePersonState.fetchState]),s.jsx(ye,{anchor:"right",open:o,PaperProps:{style:{width:Xe.overlayWidth.valuePercentage(h),boxShadow:"none"}},slotProps:{backdrop:{style:{backgroundColor:me.overlayDark,cursor:"pointer"}}},onClose:C,children:s.jsxs(ea,{onClick:i=>i.stopPropagation(),children:[I===!0?s.jsx(ge,{titleComponent:s.jsx(we,{children:K.discardTitle}),descriptionComponent:s.jsx(De,{children:K.discardDescription}),primaryButtonText:K.discard,secondaryButtonText:K.no,action:F}):null,s.jsx(Oe,{...b})]})})},ea=H(Se)`
19
19
  display: flex;
20
20
  min-height: 100%;
21
21
  flex-direction: column;
22
- `,aa=He(function(a,t){const l=le(a),n=K.getSignedInUser();return{data:l,loggedinUserId:n?.userId??"",isZeniTenant:t.isZeniTenant===!0,shouldFetchClasses:t.shouldFetchClasses,isZeniAdminUser:n?.userEmailDomain==="zeni.ai"&&t.isZeni===!0,isAccountingClassesEnabled:G(a),analytics:be}},function(a,t){const{navigate:l,companyId:n,shouldFetchClasses:g}=t;return{personAction:{onPersonDelete:(o,y)=>{a(re(o,y))},onResendInvite:o=>{a(Fe(o))},onReloadPeople:()=>{a(de()),a(ce(n,g))},onBackClick:()=>{l("../../")},onModeChange:o=>{a(M({mode:o,searchText:"",sortKey:"name",sortOrder:"ascending"}))},onSearchTextChanged:o=>{a(M({searchText:o}))}}}})(Me);function q({isInvitePeopleDrawerOpen:a,isEditPeopleDrawerOpen:t}){const l=Ge(),n=ee(),g=Ke(),{areTenantIdsInSync:o}=Ve(),y=K.getSignedInUser(),h=m(e=>X(e)),{useFeatureGate:p}=Y(),{isFeatureEnabled:O}=p(E.isDebitCardFeatureEnabled),V=m(e=>G(e)),I=!J(O,h)&&V,w=Q(h),S=h?.tenantId,{tenantEmailDomain:d}=h,[u,D]=r.useState(!1),[f,k]=r.useState(!1),[P,L]=r.useState(!1),[v,U]=r.useState("off"),[B,x]=r.useState(!1),C=e=>{x(e)},{isAiCfoAccessEnabled:F,onAskAiCfoClick:Z}=We({mobileExploreReferrer:"People"}),c=m(e=>le(e));Ue({isDataReady:c.fetchState==="Completed"});const j=m(e=>Te(e.classState,e.classListState)),T=m(e=>Le(e.userState,e.userRoleState,e.userListViewState,"manager")),A=m(e=>ve(e)),b=h?.companyId;r.useEffect(()=>{u&&v===c.uiState.mode||!o||(n(M({searchText:"",sortKey:"name",sortOrder:"ascending"})),U(c.uiState.mode),D(!0),n(de()))},[u,y,S,n,c.uiState.mode,o]),r.useEffect(()=>{b!=null&&o&&n(ce(b,I))},[b,I,o]),r.useEffect(()=>{k(a!=null&&a===!0),L(t!=null&&t===!0&&t)},[a,t]),r.useEffect(()=>{n(M({searchText:"",sortKey:"name",sortOrder:"ascending"}))},[]);const i=()=>{k(!1),L(!1),l("../")};return s.jsxs(s.Fragment,{children:[c.fetchState==="Completed"?s.jsx(Be,{analytics:be,onLoad:e=>e.trackPageLoaded(Ze.Event.members)}):null,f===!0?s.jsx(Ye,{closeDrawerHandler:i,isInvitePeopleDrawerOpen:f,managersListView:T,companyPassportView:A,classListView:j,companyId:b,mode:c.uiState.mode}):null,P===!0?s.jsx(Xe,{closeDrawerHandler:i,isEditPeopleDrawerOpen:P,managersListView:T,companyPassportView:A,classListView:j,companyId:b,mode:c.uiState.mode}):null,s.jsx(qe,{isAppContentDrawerOpen:B,handleDrawerToggle:C}),s.jsx(aa,{navigate:l,signedInUser:y,isZeni:h.isZeni,isZeniTenant:w,peopleUIState:c.uiState,companyId:b,shouldFetchClasses:I,classList:j,managersView:T,peopleView:c,onInvitePeopleClick:()=>{l("./new")},onColumnSortConfigChanged:(e,W)=>{n(M({sortKey:e,sortOrder:W}))},onRowClick:e=>{const W=`/${d}/people/${encodeURIComponent(e)}/edit`,xe=$e(g.state?.pathnameStackToGoBack,g.pathname);l(W,{state:{pathnameStackToGoBack:xe}})},onClickMenuIcon:()=>{C(!0)},isAiCfoAccessEnabled:F,onAskAiCfoClick:Z})]})}function wa(){const a=_e();return Ae(a?.loggedInUserRole??[])?s.jsxs(se,{children:[s.jsx($,{path:"/",element:s.jsx(q,{})}),s.jsx($,{path:"new",element:s.jsx(q,{isInvitePeopleDrawerOpen:!0})}),s.jsx($,{path:":userId/edit",element:s.jsx(q,{isEditPeopleDrawerOpen:!0})}),s.jsx($,{path:"*",element:s.jsx(ae,{})})]}):s.jsx(se,{children:s.jsx($,{path:"*",element:s.jsx(ae,{})})})}export{wa as default};
22
+ `,aa=He(function(a,t){const l=le(a),n=G.getSignedInUser();return{data:l,loggedinUserId:n?.userId??"",isZeniTenant:t.isZeniTenant===!0,shouldFetchClasses:t.shouldFetchClasses,isZeniAdminUser:n?.userEmailDomain==="zeni.ai"&&t.isZeni===!0,isAccountingClassesEnabled:z(a),analytics:be}},function(a,t){const{navigate:l,companyId:n,shouldFetchClasses:g}=t;return{personAction:{onPersonDelete:(o,y)=>{a(re(o,y))},onResendInvite:o=>{a(Fe(o))},onReloadPeople:()=>{a(de()),a(ce(n,g))},onBackClick:()=>{l("../../")},onModeChange:o=>{a(M({mode:o,searchText:"",sortKey:"name",sortOrder:"ascending"}))},onSearchTextChanged:o=>{a(M({searchText:o}))}}}})(Me);function q({isInvitePeopleDrawerOpen:a,isEditPeopleDrawerOpen:t}){const l=ze(),n=ee(),g=Ge(),{areTenantIdsInSync:o}=Ve(),y=G.getSignedInUser(),h=m(e=>Q(e)),{useFeatureGate:p}=Y(),{isFeatureEnabled:O}=p(E.isDebitCardFeatureEnabled),V=m(e=>z(e)),I=!J(O,h)&&V,S=X(h),w=h?.tenantId,{tenantEmailDomain:d}=h,[u,D]=r.useState(!1),[f,k]=r.useState(!1),[P,L]=r.useState(!1),[v,U]=r.useState("off"),[B,x]=r.useState(!1),C=e=>{x(e)},{isAiCfoAccessEnabled:F,onAskAiCfoClick:Z}=We({mobileExploreReferrer:"People"}),c=m(e=>le(e));Ue({isDataReady:c.fetchState==="Completed"});const j=m(e=>Te(e.classState,e.classListState)),T=m(e=>Le(e.userState,e.userRoleState,e.userListViewState,"manager")),A=m(e=>ve(e)),b=h?.companyId;r.useEffect(()=>{u&&v===c.uiState.mode||!o||(n(M({searchText:"",sortKey:"name",sortOrder:"ascending"})),U(c.uiState.mode),D(!0),n(de()))},[u,y,w,n,c.uiState.mode,o]),r.useEffect(()=>{b!=null&&o&&n(ce(b,I))},[b,I,o]),r.useEffect(()=>{k(a!=null&&a===!0),L(t!=null&&t===!0&&t)},[a,t]),r.useEffect(()=>{n(M({searchText:"",sortKey:"name",sortOrder:"ascending"}))},[]);const i=()=>{k(!1),L(!1),l("../")};return s.jsxs(s.Fragment,{children:[c.fetchState==="Completed"?s.jsx(Be,{analytics:be,onLoad:e=>e.trackPageLoaded(Ze.Event.members)}):null,f===!0?s.jsx(Ye,{closeDrawerHandler:i,isInvitePeopleDrawerOpen:f,managersListView:T,companyPassportView:A,classListView:j,companyId:b,mode:c.uiState.mode}):null,P===!0?s.jsx(Qe,{closeDrawerHandler:i,isEditPeopleDrawerOpen:P,managersListView:T,companyPassportView:A,classListView:j,companyId:b,mode:c.uiState.mode}):null,s.jsx(qe,{isAppContentDrawerOpen:B,handleDrawerToggle:C}),s.jsx(aa,{navigate:l,signedInUser:y,isZeni:h.isZeni,isZeniTenant:S,peopleUIState:c.uiState,companyId:b,shouldFetchClasses:I,classList:j,managersView:T,peopleView:c,onInvitePeopleClick:()=>{l("./new")},onColumnSortConfigChanged:(e,W)=>{n(M({sortKey:e,sortOrder:W}))},onRowClick:e=>{const W=`/${d}/people/${encodeURIComponent(e)}/edit`,xe=$e(g.state?.pathnameStackToGoBack,g.pathname);l(W,{state:{pathnameStackToGoBack:xe}})},onClickMenuIcon:()=>{C(!0)},isAiCfoAccessEnabled:F,onAskAiCfoClick:Z})]})}function Sa(){const a=_e();return Ae(a?.loggedInUserRole??[])?s.jsxs(se,{children:[s.jsx($,{path:"/",element:s.jsx(q,{})}),s.jsx($,{path:"new",element:s.jsx(q,{isInvitePeopleDrawerOpen:!0})}),s.jsx($,{path:":userId/edit",element:s.jsx(q,{isEditPeopleDrawerOpen:!0})}),s.jsx($,{path:"*",element:s.jsx(ae,{})})]}):s.jsx(se,{children:s.jsx($,{path:"*",element:s.jsx(ae,{})})})}export{Sa as default};
@@ -0,0 +1 @@
1
+ import{j as s}from"./liveblocks-DmbDY3sa.js";import E from"./NotFoundScreen-C5grvltN.js";import{a as r}from"./sentry--Yi43Gx7.js";import{h as _,g as v,j as p,i as M,u as U,N as P,n as z,o as O,p as h}from"./core-Cj3sxYL7.js";import{eW as B,Sy as b,bo as F,bn as N,i9 as V,f9 as W}from"./zeni-epic-state-BG_x9wwl.js";import{w as $,z as I,_ as q,cW as G}from"./index-C_Y0yMPY.js";import"./mui-1V4hRqCa.js";import{u as H}from"./useAskAiCfoHostNavButtonProps-OU79nJF1.js";import{M as J}from"./MobileAppDrawer-B8b7sXqB.js";import"./recharts-mFhBBFnU.js";import"./analytics-BpWjaxbv.js";import"./plaid-JtkXopjw.js";import"./dnd-WLAr-qfO.js";import"./stripe-DMRn4zHo.js";import"./lottie-W8sR2m8i.js";import"./lexical--OluaPRa.js";import"./pdf-aJCOHARS.js";import"./utils-Bt5dYICv.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]="f5f2f643-9a4a-48c5-a1d7-3cf914f261a8",e._sentryDebugIdIdentifier="sentry-dbid-f5f2f643-9a4a-48c5-a1d7-3cf914f261a8")}catch{}})();const K=z(function(e){const t=I.getSignedInUser(),c=e.tenantState.currentTenantId,o={userId:t?.userId??"",sessionId:t?.zeniSessionId??"",tenantId:c??""},{aggregatedReportViewState:n}=b(e);return{authParams:o,isDisabled:!1,loggedInUser:t,aggregatedReport:n}},function(e,t){return{onBackClick:()=>{t.navigate("../../")},onClickMenuIcon:()=>{t.handleDrawerToggle(!0)}}})(G),L=()=>{const e=_(),t=v(),c=$(),o=p(a=>B(a)),{aggregatedReportViewState:n}=p(a=>b(a)),{tenantEmailDomain:m}=M(),u=U(),d=I.getSignedInUser();if(d==null)throw new Error("Can't access this page without signing in...");const f=r.useRef(!1),[S,w]=r.useState(!1),C=F(o?.userRole??[]),k=o?.userRole?.includes("bookkeeping_admin")??!1,y=N(d),x=C||k||y,l=r.useCallback((a,i,T)=>{u(V({fromMonth:a,toMonth:i,cacheOverride:T}))},[]);r.useEffect(()=>{n?.fetchState==="Completed"&&f.current&&(u(W({messageSection:"data_refresh_update",messageText:"success",type:"success",showStatusIcon:!0})),f.current=!1)},[n?.fetchState]);const D=r.useCallback((a,i)=>{n!=null&&n?.fetchState==="In-Progress"||l(a,i,!0),f.current=!0},[n?.fetchState,l]),j=r.useCallback((a,i)=>{l(a,i,!1)},[l]),g=a=>{w(a)},{isAiCfoAccessEnabled:R,onAskAiCfoClick:A}=H({mobileExploreReferrer:"Performance"});return q({isDataReady:n?.fetchState==="Completed"}),x?s.jsxs(s.Fragment,{children:[s.jsx(J,{isAppContentDrawerOpen:S,handleDrawerToggle:g}),s.jsx(K,{navigate:e,location:t,themeState:c,currentTenant:o,signedInUser:d,tenantEmailDomain:m,onReload:D,onTimeRangeSelect:j,handleDrawerToggle:g,isAiCfoAccessEnabled:R,onAskAiCfoClick:A})]}):s.jsx(P,{to:`/${m}/dashboard`,replace:!0})};function ge(){return s.jsxs(O,{children:[s.jsx(h,{path:"*",element:s.jsx(L,{})}),s.jsx(h,{path:"*",element:s.jsx(E,{})})]})}export{ge as default};
@@ -1 +1 @@
1
- import{a as h,b as t}from"./sentry-B_92GPgU.js";(function(){try{var r=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},a=new r.Error().stack;a&&(r._sentryDebugIds=r._sentryDebugIds||{},r._sentryDebugIds[a]="a301a95b-8420-43bd-aa56-5738077199ba",r._sentryDebugIdIdentifier="sentry-dbid-a301a95b-8420-43bd-aa56-5738077199ba")}catch{}})();const c="64px",b={};var k=({src:r,light:a,oEmbedUrl:n,onClickPreview:l,playIcon:w,previewTabIndex:m,previewAriaLabel:u})=>{const[p,i]=h.useState(null);h.useEffect(()=>{r&&a&&n&&v({src:r,light:a,oEmbedUrl:n})},[r,a,n]);const v=async({src:e,light:d,oEmbedUrl:I})=>{if(t.isValidElement(d))return;if(typeof d=="string")return void i(d);if(b[e])return void i(b[e]);i(null);const E=await fetch(I.replace("{url}",e)),g=await E.json();if(g.thumbnail_url){const f=g.thumbnail_url.replace("height=100","height=480").replace("-d_295x166","-d_640");i(f),b[e]=f}},o=t.isValidElement(a),y={display:"flex",alignItems:"center",justifyContent:"center"},s={preview:{width:"100%",height:"100%",backgroundImage:p&&!o?`url(${p})`:void 0,backgroundSize:"cover",backgroundPosition:"center",cursor:"pointer",...y},shadow:{background:"radial-gradient(rgb(0, 0, 0, 0.3), rgba(0, 0, 0, 0) 60%)",borderRadius:c,width:c,height:c,position:o?"absolute":void 0,...y},playIcon:{borderStyle:"solid",borderWidth:"16px 0 16px 26px",borderColor:"transparent transparent transparent white",marginLeft:"7px"}},_=t.createElement("div",{style:s.shadow,className:"react-player__shadow"},t.createElement("div",{style:s.playIcon,className:"react-player__play-icon"}));return t.createElement("div",{style:s.preview,className:"react-player__preview",tabIndex:m,onClick:e=>{l?.(e)},onKeyDown:e=>{e.key!=="Enter"&&e.key!==" "||l==null||l(e)},...u?{"aria-label":u}:{}},o?a:null,w||_)};export{k as default};
1
+ import{a as h,b as t}from"./sentry--Yi43Gx7.js";(function(){try{var r=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},a=new r.Error().stack;a&&(r._sentryDebugIds=r._sentryDebugIds||{},r._sentryDebugIds[a]="a301a95b-8420-43bd-aa56-5738077199ba",r._sentryDebugIdIdentifier="sentry-dbid-a301a95b-8420-43bd-aa56-5738077199ba")}catch{}})();const c="64px",b={};var k=({src:r,light:a,oEmbedUrl:n,onClickPreview:l,playIcon:w,previewTabIndex:m,previewAriaLabel:u})=>{const[p,i]=h.useState(null);h.useEffect(()=>{r&&a&&n&&v({src:r,light:a,oEmbedUrl:n})},[r,a,n]);const v=async({src:e,light:d,oEmbedUrl:I})=>{if(t.isValidElement(d))return;if(typeof d=="string")return void i(d);if(b[e])return void i(b[e]);i(null);const E=await fetch(I.replace("{url}",e)),g=await E.json();if(g.thumbnail_url){const f=g.thumbnail_url.replace("height=100","height=480").replace("-d_295x166","-d_640");i(f),b[e]=f}},o=t.isValidElement(a),y={display:"flex",alignItems:"center",justifyContent:"center"},s={preview:{width:"100%",height:"100%",backgroundImage:p&&!o?`url(${p})`:void 0,backgroundSize:"cover",backgroundPosition:"center",cursor:"pointer",...y},shadow:{background:"radial-gradient(rgb(0, 0, 0, 0.3), rgba(0, 0, 0, 0) 60%)",borderRadius:c,width:c,height:c,position:o?"absolute":void 0,...y},playIcon:{borderStyle:"solid",borderWidth:"16px 0 16px 26px",borderColor:"transparent transparent transparent white",marginLeft:"7px"}},_=t.createElement("div",{style:s.shadow,className:"react-player__shadow"},t.createElement("div",{style:s.playIcon,className:"react-player__play-icon"}));return t.createElement("div",{style:s.preview,className:"react-player__preview",tabIndex:m,onClick:e=>{l?.(e)},onKeyDown:e=>{e.key!=="Enter"&&e.key!==" "||l==null||l(e)},...u?{"aria-label":u}:{}},o?a:null,w||_)};export{k as default};