@zeniai/web-app-ui 5.0.1-qa → 5.0.2-dev

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (133) hide show
  1. package/dist/assets/AddressRoutes-D4ZwWdW3.js +1 -0
  2. package/dist/assets/AddressScreen-DG2igJ3e.js +9 -0
  3. package/dist/assets/AiCfoScreen-zU1Nx73v.js +11 -0
  4. package/dist/assets/BillPayApprovalRoutes-5SmQw6w5.js +1 -0
  5. package/dist/assets/{BillPayRoutes-B7eECbMR.js → BillPayRoutes-be_i6u1i.js} +7 -7
  6. package/dist/assets/{BusinessVerificationPageScreen-D_IL11BU.js → BusinessVerificationPageScreen-D-2VpDbP.js} +2 -2
  7. package/dist/assets/{ChargeCardRoutes-MbQ6GwxR.js → ChargeCardRoutes-B9FmCIkx.js} +9 -9
  8. package/dist/assets/CompanyPassportScreen-BIqiLLcA.js +1 -0
  9. package/dist/assets/ConnectionAuthScreen-Dah9BIfx.js +11 -0
  10. package/dist/assets/CustomerOnboardingAuthScreen-BCDiCbBG.js +1 -0
  11. package/dist/assets/{CustomerOnboardingRoutes-DEmyPEG9.js → CustomerOnboardingRoutes-hpECeIAZ.js} +3 -3
  12. package/dist/assets/{DashboardRoutes-LUXfYRYr.js → DashboardRoutes-9GSNK76c.js} +3 -3
  13. package/dist/assets/{DefaultTenantHome-CsgBmyY-.js → DefaultTenantHome-D1vXY83X.js} +1 -1
  14. package/dist/assets/{DomesticWireDetailScreen-Byk3gNE9.js → DomesticWireDetailScreen-CBvkPR3e.js} +3 -3
  15. package/dist/assets/DrawerScreen-B_llN9HS.js +1 -0
  16. package/dist/assets/EntityDetailRoutes-BQvHfHXF.js +1 -0
  17. package/dist/assets/{ExpenseAutomationRoutes-DzZ2kzOA.js → ExpenseAutomationRoutes-DkcdbkvF.js} +4 -4
  18. package/dist/assets/FeaturePreviewScreen-BZdfwZgd.js +1 -0
  19. package/dist/assets/MagicLinkRoutes-B3KZdLtz.js +72 -0
  20. package/dist/assets/MagicLinkSignInScreen-BKi_zF71.js +12 -0
  21. package/dist/assets/MobileAppDrawer-Q6-14poV.js +1 -0
  22. package/dist/assets/NotFoundScreen-Cz9quvZz.js +1 -0
  23. package/dist/assets/{NotificationRoutes-DzMqKa9n.js → NotificationRoutes-eISVis3N.js} +1 -1
  24. package/dist/assets/PandLWithForecastRoutes-CJ17X8Du.js +1 -0
  25. package/dist/assets/{PeopleRoutes-BswRWZQg.js → PeopleRoutes-D7cCmX3b.js} +5 -5
  26. package/dist/assets/PerformanceRoutes-BfV7NXh6.js +1 -0
  27. package/dist/assets/{Preview--bb5p9Hr.js → Preview-hp5oXBDl.js} +1 -1
  28. package/dist/assets/{QBOConnectionScreen-C_qIc23z.js → QBOConnectionScreen-DQ1AuSJF.js} +34 -34
  29. package/dist/assets/ReferralListScreen-eM-LRvxR.js +5 -0
  30. package/dist/assets/ReimbursementApprovalRoutes-CFORcsiU.js +1 -0
  31. package/dist/assets/{ReimbursementApprovalRuleDetailScreen-Cg7X5Fv7.js → ReimbursementApprovalRuleDetailScreen-DAGX2Bpj.js} +1 -1
  32. package/dist/assets/ReimbursementRoutes-B_ZwbgUK.js +68 -0
  33. package/dist/assets/ReportsRoutes-Cjg471Jx.js +1 -0
  34. package/dist/assets/RewardsRoutes-akBEyetT.js +1 -0
  35. package/dist/assets/ScreenRoutes-DNdR3Wy8.js +2 -0
  36. package/dist/assets/SettingsRoutes-BZEUVpEo.js +57 -0
  37. package/dist/assets/{SetupPagesScreen-vY1ujDKJ.js → SetupPagesScreen-hvGS92ve.js} +5 -5
  38. package/dist/assets/{SignInScreen-ClbKNS4x.js → SignInScreen-BJuZCyu8.js} +1 -1
  39. package/dist/assets/SignOutScreen-CGW09UIk.js +9 -0
  40. package/dist/assets/TaskListScreen-tJJhpcmp.js +9 -0
  41. package/dist/assets/TaskRoutes-DCNhNgxM.js +9 -0
  42. package/dist/assets/TransactionDetailRoutes-RIZOkAYz.js +1 -0
  43. package/dist/assets/TransactionDetailScreen-BeTw-X5z.js +5 -0
  44. package/dist/assets/TransactionListRoutes-ZRAuVXeU.js +1 -0
  45. package/dist/assets/{TreasuryRoutes-CtBzkTMx.js → TreasuryRoutes-BaR7b6eY.js} +6 -6
  46. package/dist/assets/{VendorsRoutes-aBYOoTKe.js → VendorsRoutes-B4vpI764.js} +20 -20
  47. package/dist/assets/{WiseConfirmationScreen-s0eoug7u.js → WiseConfirmationScreen-v0Wu2mUB.js} +1 -1
  48. package/dist/assets/ZeniAccountRoutes-CjxtzBYh.js +66 -0
  49. package/dist/assets/ZeniAccountStatementScreen-C-RdVVLR.js +9 -0
  50. package/dist/assets/{accountMappingHelper-CEUIWp7O.js → accountMappingHelper-B_vdVXJd.js} +1 -1
  51. package/dist/assets/{analytics-BkhHPaQ4.js → analytics-B_kykzhy.js} +1 -1
  52. package/dist/assets/{analyticsHelper-CSpNHX-t.js → analyticsHelper-RuE4CbDL.js} +1 -1
  53. package/dist/assets/{core-C_NeXleM.js → core-C7cnuUop.js} +1 -1
  54. package/dist/assets/{decodeURIComponentSafe-Drd7YS9D.js → decodeURIComponentSafe-rDkCEJpn.js} +1 -1
  55. package/dist/assets/{dnd-C0SdDgY2.js → dnd-TzLeX35A.js} +1 -1
  56. package/dist/assets/{empty-5JhUjXJf.js → empty-7vbmHAL6.js} +1 -1
  57. package/dist/assets/{empty-CDZc49VR.js → empty-B375B_HA.js} +1 -1
  58. package/dist/assets/{emptyVideoElement-SE9UwlDX.js → emptyVideoElement-BGxjtXTu.js} +1 -1
  59. package/dist/assets/epic-DefpUSD4.js +2 -0
  60. package/dist/assets/getLocaleForTenant-BRT6_AeC.js +1 -0
  61. package/dist/assets/{index-3wKQcxVk.js → index-BAxpczYf.js} +2 -2
  62. package/dist/assets/{index-DEiuB93P.js → index-CcLDrNJO.js} +1 -1
  63. package/dist/assets/{index-BaZ8-9eR.js → index-DGKR7P5A.js} +13079 -12937
  64. package/dist/assets/{index-Y_8J-EV-.js → index-DrxEgkQ-.js} +1 -1
  65. package/dist/assets/{index-COcEChnY.js → index-Qmma5Ck1.js} +1 -1
  66. package/dist/assets/{index-DYUyEm6J.js → index-_vh22_qX.js} +1 -1
  67. package/dist/assets/{index-Dmixh63m.js → index-m-Adf2ll.js} +1 -1
  68. package/dist/assets/{lexical-B1vtLf4F.js → lexical-Dp9Fvoo6.js} +1 -1
  69. package/dist/assets/{liveblocks-BCZSgQbG.js → liveblocks-jLbycGCP.js} +1 -1
  70. package/dist/assets/{lottie-BdeQlKTG.js → lottie-SbVYeXJk.js} +1 -1
  71. package/dist/assets/{mui-CgjVMn8C.js → mui-BkznVaFh.js} +1 -1
  72. package/dist/assets/{pathToGoBack-BDpRzqvH.js → pathToGoBack-DXgc_G9d.js} +1 -1
  73. package/dist/assets/{pdf-CQPNphc4.js → pdf-DQg4OfsP.js} +4 -4
  74. package/dist/assets/{pdf-lib-DznUmqID.js → pdf-lib-CDsnDRGG.js} +1 -1
  75. package/dist/assets/{plaid-B3UNGbGB.js → plaid-DfnoQTVm.js} +1 -1
  76. package/dist/assets/{pusher-SrZYiYid.js → pusher-CQHA__kt.js} +1 -1
  77. package/dist/assets/{react-B1LuGLWv.js → react-BfsHsZ2B.js} +1 -1
  78. package/dist/assets/{react-CkJUroZo.js → react-CCO8orgk.js} +1 -1
  79. package/dist/assets/{react-CUvZ-QKI.js → react-CJwzWgLi.js} +1 -1
  80. package/dist/assets/{react-BLym8SqS.js → react-DPNnFJXW.js} +1 -1
  81. package/dist/assets/{react-BR-uiB3M.js → react-pHyk9OpQ.js} +1 -1
  82. package/dist/assets/{react-BUr4gNxK.js → react-tE35hRos.js} +1 -1
  83. package/dist/assets/{recharts-NCr2Pwd1.js → recharts-Dt8COHEP.js} +1 -1
  84. package/dist/assets/{routePaths-CXa3WNDm.js → routePaths-BjxXYb1e.js} +1 -1
  85. package/dist/assets/{sentry-CGkVgbup.js → sentry-CflaePyQ.js} +1 -1
  86. package/dist/assets/{url-D7JZ1pkZ.js → url-CMgR7Whs.js} +1 -1
  87. package/dist/assets/{url-ax2xfQkc.js → url-DZF6CZ5y.js} +1 -1
  88. package/dist/assets/useAskAiCfoHostNavButtonProps-BhmP_lnc.js +1 -0
  89. package/dist/assets/{useDeviceId-DxDe1m2N.js → useDeviceId-aTbWtPu7.js} +1 -1
  90. package/dist/assets/useFetchSuggestedQuestionsWhenReady-Ex4_WTph.js +1 -0
  91. package/dist/assets/{useInitialThreadRequest-B7p2SBgg.js → useInitialThreadRequest-DoYKoe1O.js} +1 -1
  92. package/dist/assets/{utils-CTLGOmjC.js → utils-t3ltqqZ0.js} +1 -1
  93. package/dist/assets/withTransactionSidePanel-BBmA3NZ6.js +8 -0
  94. package/dist/assets/zeni-epic-state-DPGmsT0c.js +14 -0
  95. package/dist/index.html +1 -1
  96. package/package.json +4 -4
  97. package/dist/assets/AddressRoutes-Ccdt31hR.js +0 -1
  98. package/dist/assets/AddressScreen-DG9DlRXT.js +0 -9
  99. package/dist/assets/AiCfoScreen-BySJdfdn.js +0 -11
  100. package/dist/assets/BillPayApprovalRoutes-7ZgXY6Qr.js +0 -1
  101. package/dist/assets/CompanyPassportScreen-0tGZqhHr.js +0 -1
  102. package/dist/assets/ConnectionAuthScreen-Ng7EqaWr.js +0 -11
  103. package/dist/assets/CustomerOnboardingAuthScreen-DHzsN76N.js +0 -1
  104. package/dist/assets/DrawerScreen-CN6TBpYY.js +0 -1
  105. package/dist/assets/EntityDetailRoutes-BVmRwPcm.js +0 -1
  106. package/dist/assets/FeaturePreviewScreen-ArEP4se9.js +0 -1
  107. package/dist/assets/MagicLinkRoutes-C8RQWz8N.js +0 -72
  108. package/dist/assets/MagicLinkSignInScreen-raeb9t11.js +0 -12
  109. package/dist/assets/MobileAppDrawer-CowqUthz.js +0 -1
  110. package/dist/assets/NotFoundScreen-0ajohMSv.js +0 -1
  111. package/dist/assets/PandLWithForecastRoutes-DdGQfKKW.js +0 -1
  112. package/dist/assets/PerformanceRoutes-ChMRcywH.js +0 -1
  113. package/dist/assets/ReferralListScreen-BAK4p9-3.js +0 -5
  114. package/dist/assets/ReimbursementApprovalRoutes-ogcfMEcC.js +0 -1
  115. package/dist/assets/ReimbursementRoutes-0m6W0X2g.js +0 -68
  116. package/dist/assets/ReportsRoutes-1TXSN037.js +0 -1
  117. package/dist/assets/RewardsRoutes-B8FReE5j.js +0 -1
  118. package/dist/assets/ScreenRoutes-DRzB_14n.js +0 -2
  119. package/dist/assets/SettingsRoutes-BGCZcWYL.js +0 -57
  120. package/dist/assets/SignOutScreen-Dvb2Qc0l.js +0 -9
  121. package/dist/assets/TaskListScreen-CaGy-z1x.js +0 -9
  122. package/dist/assets/TaskRoutes-9joFCtVs.js +0 -9
  123. package/dist/assets/TransactionDetailRoutes-CWNaQpCz.js +0 -1
  124. package/dist/assets/TransactionDetailScreen-DXlYmq7Y.js +0 -5
  125. package/dist/assets/TransactionListRoutes-FH_uc507.js +0 -1
  126. package/dist/assets/ZeniAccountRoutes-BcBOPI_A.js +0 -66
  127. package/dist/assets/ZeniAccountStatementScreen-BOfH7mnf.js +0 -9
  128. package/dist/assets/epic-CBKcA32L.js +0 -2
  129. package/dist/assets/getLocaleForTenant-Ab1B3PjW.js +0 -1
  130. package/dist/assets/useAskAiCfoHostNavButtonProps-Crpk73sU.js +0 -1
  131. package/dist/assets/useFetchSuggestedQuestionsWhenReady-sxquM27W.js +0 -1
  132. package/dist/assets/withTransactionSidePanel-CB8Jp1hw.js +0 -8
  133. package/dist/assets/zeni-epic-state-Dp14ovRw.js +0 -14
@@ -1,19 +1,19 @@
1
- import{j as u}from"./liveblocks-BCZSgQbG.js";import un from"./NotFoundScreen-0ajohMSv.js";import{a as l}from"./sentry-CGkVgbup.js";import{n as Ae,D as St,S as ze}from"./mui-CgjVMn8C.js";import{h as he,j as It,u as Ve,g as V,l as nt,k as mn,n as hn,o as Ue}from"./core-C_NeXleM.js";import{eL as $e,Oj as pn,e$ as me,fd as gn,pP as Cn,Ok as je,ms as ft,my as kt,Ol as Et,mX as Sn,Om as yt,ml as In,pl as fn,On as kn,ji as En,Oo as yn,Fc as vn,eX as Me,p0 as vt,K1 as at,K3 as bn,j9 as An,K4 as Tn,jg as wn,cT as xn,sM as Le,IU as Pn,jh as Rn,eZ as Dn,mz as bt,n0 as be,nX as At,ou as On,e_ as Tt,m$ as ot,mq as ae,n2 as wt,n4 as Un,bB as Fn,kF as Bn,kC as _n,n3 as Ee,n1 as ue,Op as Vn,nk as st,AU as xt,Oq as Pt,rO as Rt,oq as jn,j6 as Mn,Or as Ln,IW as ct,IV as ke,Os as it,jx as zn,Ot as $n,Ou as Gn,Ov as qn,Ow as Jn,mI as Kn,Ox as Yn,Oy as Nn,Oz as Zn,na as Qn,jk as Hn,jb as Wn,OA as Xn,jj as lt,Kb as ea,OB as ta,OC as na,oY as aa,oD as oa,oC as Fe,OD as sa,OE as ca,kQ as ia,bp as la,kL as rt,kx as ra,OF as da,gw as dt,fK as ua,kI as ma,uF as ha,OG as pa,nB as ga,nw as Ca,nA as Sa,nl as Ia,OH as fa,mQ as ka,mF as Ea,fe as ut,n5 as ya,OI as va,OJ as ba,OK as Aa,OL as Ta,OM as wa,ON as mt,p8 as xa,ol as Pa,o4 as ht,od as Ra,o0 as Da,or as Oa,o5 as Ua,OO as Fa,OP as Ba,nK as _a,OQ as Va,nI as ja,nJ as Ma,nG as La,of as za}from"./zeni-epic-state-Dp14ovRw.js";import{D as Dt,Z as Ot,i as ye,c as M,k as Q,E as Ut,cq as $a,m as Ft,z as Te,cr as Ga,ao as ve,cs as qa,B as Bt,ct as Ja,cu as Ka,al as Be,n as Ya,S as Na,aI as Za,cv as Qa,aZ as Ha,w as Wa,O as Xa,cw as eo,M as to,cx as no}from"./index-BaZ8-9eR.js";import{u as _t}from"./useAskAiCfoHostNavButtonProps-Crpk73sU.js";import{c as Vt}from"./useFetchSuggestedQuestionsWhenReady-sxquM27W.js";import{c as pt,C as ao}from"./TransactionDetailScreen-DXlYmq7Y.js";import{w as oo}from"./withTransactionSidePanel-CB8Jp1hw.js";import{h as so,v as co}from"./routePaths-CXa3WNDm.js";import{g as _e}from"./accountMappingHelper-CEUIWp7O.js";import{D as io}from"./DrawerScreen-CN6TBpYY.js";import"./recharts-NCr2Pwd1.js";import"./lottie-BdeQlKTG.js";import"./analytics-BkhHPaQ4.js";import"./plaid-B3UNGbGB.js";import"./dnd-C0SdDgY2.js";import"./stripe-DMRn4zHo.js";import"./lexical-B1vtLf4F.js";import"./pdf-CQPNphc4.js";import"./utils-CTLGOmjC.js";import"./decodeURIComponentSafe-Drd7YS9D.js";(function(){try{var t=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},c=new t.Error().stack;c&&(t._sentryDebugIds=t._sentryDebugIds||{},t._sentryDebugIds[c]="1eab068d-7262-47c6-9650-5ef60ed440de",t._sentryDebugIdIdentifier="sentry-dbid-1eab068d-7262-47c6-9650-5ef60ed440de")}catch{}})();const lo=()=>{const{isAiCfoOpen:t,setIsAiCfoOpen:c}=Dt(),x=he(),T=It(),y=Ve(),r=V(p=>$e(p)),{useFeatureGate:m}=Ot(),{isFeatureEnabled:P}=m(ye.isRealtimeInsightsFeatureEnabled),g=V(p=>p.expenseAutomationViewState.selectedPeriodByTenantId),a=V(p=>pn(p,r.tenantId)),{isAiCfoAccessEnabled:j,onAskAiCfoClick:v}=_t({isAiCfoOpen:t,setIsAiCfoOpen:c,mobileExploreReferrer:"Month-End Close Overview"}),I=l.useCallback((p,E,O=!1)=>{x(me({tenantId:E,period:{month:p.month,year:p.year},refreshViewInBackground:O}))},[]),$=l.useCallback(p=>{const E=y.state?.referrer;a.monthEndCloseChecks?.auditSummary!=null&&M.trackMonthCloseAuditPage(p.month,p.year,a.monthEndCloseChecks.reportEmailSentDate!=null?"closed":"in-review",a.monthEndCloseChecks.auditSummary.auditScorePercentage,!1,E??null),x(gn(r.tenantId,p))},[r.tenantId,a.monthEndCloseChecks?.auditSummary,a.monthEndCloseChecks?.reportEmailSentDate]),S=g[r.tenantId],k=l.useCallback(()=>{const p=y.state?.referrer;a.monthEndCloseChecks?.auditSummary!=null&&M.trackMonthCloseAuditPage(S.month,S.year,a.monthEndCloseChecks.reportEmailSentDate!=null?"closed":"in-review",a.monthEndCloseChecks.auditSummary.auditScorePercentage,!0,p??null),I(S,r.tenantId,!0)},[I,S,r.tenantId,a.monthEndCloseChecks?.auditSummary,a.monthEndCloseChecks?.reportEmailSentDate]),L=Q(y.state?.pathnameStackToGoBack,y.pathname),Y=l.useCallback(()=>{if(a.monthEndCloseChecks!=null&&S!=null){const p=a.monthEndCloseChecks.monthEndCloseCheckList.find(E=>E.progress<100);if(p!=null)return void T(`./${p.id}/${S.month}-${S.year}`,{state:{pathnameStackToGoBack:L,message:"comingFromOverview"}});T(`./month_end_insights/${S.month}-${S.year}`,{state:{pathnameStackToGoBack:L,message:"comingFromOverview"}})}},[a.monthEndCloseChecks,S]),{areTenantIdsInSync:d}=Ut();return Vt({isDataReady:a.fetchState==="Completed"}),l.useEffect(()=>{S!=null&&a.fetchState!=="In-Progress"&&a.fetchState!=="Completed"&&d&&I(S,r.tenantId)},[I,S,a.fetchState,r.tenantId,d]),l.useEffect(()=>{S!=null&&a.monthClosePerformanceTrendFetchStatus.fetchState!=="In-Progress"&&a.monthClosePerformanceTrendFetchStatus.fetchState!=="Completed"&&d&&x(Cn(S))},[S,a.monthClosePerformanceTrendFetchStatus.fetchState,d]),l.useEffect(()=>{const p=setInterval(()=>{a.fetchState!=="In-Progress"&&a.fetchState==="Completed"&&k()},3e5);return()=>clearInterval(p)},[a.fetchState]),l.useEffect(()=>{if(a.fetchState==="Completed"&&a.monthEndCloseChecks?.auditSummary!=null){const p=y.state?.referrer;M.trackMonthCloseAuditPage(a.selectedPeriod.month,a.selectedPeriod.year,a.monthEndCloseChecks.reportEmailSentDate!=null?"closed":"in-review",a.monthEndCloseChecks.auditSummary.auditScorePercentage,!1,p??null)}},[a.fetchState,a.selectedPeriod,a.monthEndCloseChecks?.auditSummary,a.monthEndCloseChecks?.reportEmailSentDate]),u.jsx(ro,{children:u.jsx($a,{monthEndCloseChecksView:a,isRealtimeInsightsFeatureEnabled:P,onMonthEndCheckClick:p=>{T(`./${p}/${S.month}-${S.year}`,{state:{pathnameStackToGoBack:L,message:"comingFromOverview",referrer:"Expense Automation - Overview"}})},onPeriodChange:$,handleReviewButtonClick:Y,onBackClick:()=>{T("../../dashboard")},onReload:k,isAiCfoAccessEnabled:j,onAskAiCfoClick:v})})},ro=Ae.div`
1
+ import{j as u}from"./liveblocks-jLbycGCP.js";import un from"./NotFoundScreen-Cz9quvZz.js";import{a as l}from"./sentry-CflaePyQ.js";import{n as Te,D as St,S as ze}from"./mui-BkznVaFh.js";import{h as he,j as It,u as Ve,g as V,l as nt,k as mn,n as hn,o as Ue}from"./core-C7cnuUop.js";import{eM as $e,Ou as pn,f0 as me,fe as gn,pR as Cn,Ov as Me,mu as ft,mA as kt,Ow as Et,mZ as Sn,Ox as yt,mn as In,pn as fn,Oy as kn,jk as En,Oz as yn,Fj as vn,eY as je,p2 as vt,Kc as at,Ke as bn,jb as Tn,Kf as An,ji as wn,cT as xn,sT as Le,J3 as Rn,jj as Pn,e_ as Dn,mB as bt,n2 as be,nZ as Tt,ow as On,e$ as At,n1 as ot,ms as ae,n4 as wt,n6 as Un,bB as Fn,kH as Bn,kE as _n,n5 as Ee,n3 as ue,OA as Vn,nm as st,A$ as xt,OB as Rt,rQ as Pt,os as Mn,j8 as jn,OC as Ln,J5 as ct,J4 as ke,OD as it,jz as zn,OE as $n,OF as Gn,OG as qn,OH as Jn,mK as Kn,OI as Yn,OJ as Nn,OK as Zn,nc as Hn,jm as Qn,jd as Wn,OL as Xn,jl as lt,Km as ea,OM as ta,ON as na,o_ as aa,oF as oa,oE as Fe,OO as sa,OP as ca,kS as ia,bp as la,kN as rt,kz as ra,OQ as da,gy as dt,fL as ua,kK as ma,uM as ha,OR as pa,nD as ga,ny as Ca,nC as Sa,nn as Ia,OS as fa,mS as ka,mH as Ea,ff as ut,n7 as ya,OT as va,OU as ba,OV as Ta,OW as Aa,OX as wa,OY as mt,pa as xa,on as Ra,o6 as ht,of as Pa,o2 as Da,ot as Oa,o7 as Ua,OZ as Fa,O_ as Ba,nM as _a,O$ as Va,nK as Ma,nL as ja,nI as La,oh as za}from"./zeni-epic-state-DPGmsT0c.js";import{K as Dt,a as Ot,r as ye,d as j,w as H,M as Ut,cq as $a,m as Ft,z as Ae,cr as Ga,ao as ve,cs as qa,B as Bt,ct as Ja,cu as Ka,al as Be,y as Ya,j as Na,aI as Za,cv as Ha,aZ as Qa,C as Wa,D as Xa,cw as eo,Q as to,cx as no}from"./index-DGKR7P5A.js";import{u as _t}from"./useAskAiCfoHostNavButtonProps-BhmP_lnc.js";import{c as Vt}from"./useFetchSuggestedQuestionsWhenReady-Ex4_WTph.js";import{c as pt,C as ao}from"./TransactionDetailScreen-BeTw-X5z.js";import{w as oo}from"./withTransactionSidePanel-BBmA3NZ6.js";import{h as so,v as co}from"./routePaths-BjxXYb1e.js";import{g as _e}from"./accountMappingHelper-B_vdVXJd.js";import{D as io}from"./DrawerScreen-B_llN9HS.js";import"./recharts-Dt8COHEP.js";import"./lottie-SbVYeXJk.js";import"./analytics-B_kykzhy.js";import"./plaid-DfnoQTVm.js";import"./dnd-TzLeX35A.js";import"./stripe-DMRn4zHo.js";import"./lexical-Dp9Fvoo6.js";import"./pdf-DQg4OfsP.js";import"./utils-t3ltqqZ0.js";import"./decodeURIComponentSafe-rDkCEJpn.js";(function(){try{var t=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},c=new t.Error().stack;c&&(t._sentryDebugIds=t._sentryDebugIds||{},t._sentryDebugIds[c]="1ad116ad-5ef8-4561-bfd6-67eefc64075d",t._sentryDebugIdIdentifier="sentry-dbid-1ad116ad-5ef8-4561-bfd6-67eefc64075d")}catch{}})();const lo=()=>{const{isAiCfoOpen:t,setIsAiCfoOpen:c}=Dt(),x=he(),A=It(),y=Ve(),r=V(p=>$e(p)),{useFeatureGate:m}=Ot(),{isFeatureEnabled:R}=m(ye.isRealtimeInsightsFeatureEnabled),g=V(p=>p.expenseAutomationViewState.selectedPeriodByTenantId),a=V(p=>pn(p,r.tenantId)),{isAiCfoAccessEnabled:M,onAskAiCfoClick:v}=_t({isAiCfoOpen:t,setIsAiCfoOpen:c,mobileExploreReferrer:"Month-End Close Overview"}),I=l.useCallback((p,E,O=!1)=>{x(me({tenantId:E,period:{month:p.month,year:p.year},refreshViewInBackground:O}))},[]),$=l.useCallback(p=>{const E=y.state?.referrer;a.monthEndCloseChecks?.auditSummary!=null&&j.trackMonthCloseAuditPage(p.month,p.year,a.monthEndCloseChecks.reportEmailSentDate!=null?"closed":"in-review",a.monthEndCloseChecks.auditSummary.auditScorePercentage,!1,E??null),x(gn(r.tenantId,p))},[r.tenantId,a.monthEndCloseChecks?.auditSummary,a.monthEndCloseChecks?.reportEmailSentDate]),S=g[r.tenantId],k=l.useCallback(()=>{const p=y.state?.referrer;a.monthEndCloseChecks?.auditSummary!=null&&j.trackMonthCloseAuditPage(S.month,S.year,a.monthEndCloseChecks.reportEmailSentDate!=null?"closed":"in-review",a.monthEndCloseChecks.auditSummary.auditScorePercentage,!0,p??null),I(S,r.tenantId,!0)},[I,S,r.tenantId,a.monthEndCloseChecks?.auditSummary,a.monthEndCloseChecks?.reportEmailSentDate]),L=H(y.state?.pathnameStackToGoBack,y.pathname),Y=l.useCallback(()=>{if(a.monthEndCloseChecks!=null&&S!=null){const p=a.monthEndCloseChecks.monthEndCloseCheckList.find(E=>E.progress<100);if(p!=null)return void A(`./${p.id}/${S.month}-${S.year}`,{state:{pathnameStackToGoBack:L,message:"comingFromOverview"}});A(`./month_end_insights/${S.month}-${S.year}`,{state:{pathnameStackToGoBack:L,message:"comingFromOverview"}})}},[a.monthEndCloseChecks,S]),{areTenantIdsInSync:d}=Ut();return Vt({isDataReady:a.fetchState==="Completed"}),l.useEffect(()=>{S!=null&&a.fetchState!=="In-Progress"&&a.fetchState!=="Completed"&&d&&I(S,r.tenantId)},[I,S,a.fetchState,r.tenantId,d]),l.useEffect(()=>{S!=null&&a.monthClosePerformanceTrendFetchStatus.fetchState!=="In-Progress"&&a.monthClosePerformanceTrendFetchStatus.fetchState!=="Completed"&&d&&x(Cn(S))},[S,a.monthClosePerformanceTrendFetchStatus.fetchState,d]),l.useEffect(()=>{const p=setInterval(()=>{a.fetchState!=="In-Progress"&&a.fetchState==="Completed"&&k()},3e5);return()=>clearInterval(p)},[a.fetchState]),l.useEffect(()=>{if(a.fetchState==="Completed"&&a.monthEndCloseChecks?.auditSummary!=null){const p=y.state?.referrer;j.trackMonthCloseAuditPage(a.selectedPeriod.month,a.selectedPeriod.year,a.monthEndCloseChecks.reportEmailSentDate!=null?"closed":"in-review",a.monthEndCloseChecks.auditSummary.auditScorePercentage,!1,p??null)}},[a.fetchState,a.selectedPeriod,a.monthEndCloseChecks?.auditSummary,a.monthEndCloseChecks?.reportEmailSentDate]),u.jsx(ro,{children:u.jsx($a,{monthEndCloseChecksView:a,isRealtimeInsightsFeatureEnabled:R,onMonthEndCheckClick:p=>{A(`./${p}/${S.month}-${S.year}`,{state:{pathnameStackToGoBack:L,message:"comingFromOverview",referrer:"Expense Automation - Overview"}})},onPeriodChange:$,handleReviewButtonClick:Y,onBackClick:()=>{A("../../dashboard")},onReload:k,isAiCfoAccessEnabled:M,onAskAiCfoClick:v})})},ro=Te.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
- `,uo="512px",mo=({reconciliation:t,selectedDrawerAccountId:c,onFetchLinkTokenClick:x,onEstablishConnectionClick:T})=>{const y=Ft(),r=he(),m=Te.getSignedInUser(),P=V(s=>$e(s)),g=t.excludedAccountIDs,a={userId:m?.userId??"",sessionId:m?.zeniSessionId??"",tenantId:P.tenantId??""},{accountReconciliationsByAccountID:j,monthYearPeriod:v,statementUploadChosen:I}=t,$=c!=null?j[c]:void 0,S=$?.accountReconEntity.statementMetaData?.statementUploadId,k=l.useCallback(()=>{c!=null&&r(je({selectedDrawerAccountId:void 0}))},[r,c]),L=(s,C)=>{r(fn(s,C.split(".")[0]))},Y=s=>{S!=null&&r(In({accountId:c??"",selectedPeriod:v,fileId:s,statementUploadId:S}))},d=()=>{r(Et({statementUploadChosen:!1}))},p=s=>{c!=null&&r(Sn({accountId:c,selectedPeriod:v,payload:s}))},E=s=>{c!=null&&r(yt({accountId:c,selectedPeriod:v,localData:{accountSource:s}}))},O=l.useCallback(()=>{c!=null&&r(ft({accountId:c}))},[r,c]),e=l.useCallback(()=>{c!=null&&r(kt({accountId:c}))},[r,c]),n=g.includes(c??"")?t.excludedAccountReconciliationByAccountID[c??""]:void 0,o=$!=null?u.jsx(Ga,{excludeAccountFetch:t.excludeAccountFetchState,accountReconciliation:$,monthYearPeriod:v,onDismissClick:k,plaidConnectionDetails:t.plaidConnectionDetails,onFetchLinkTokenClick:x,onEstablishConnectionClick:T,onEditFileName:L,onDeleteFile:Y,onSelectSourceType:E,filesEndPoint:`${ve.fileMicroServiceBaseUrl}`,authParams:a,openFilePicker:I,onStatementUploadSuccess:p,onUploadWindowOpenedOnce:d,onExcludeFromReconciliation:O}):n!=null?u.jsx(qa,{excludedAccountReconciliation:n,includeAccountFetch:t.includeAccountFetchState,onIncludeIntoReconciliation:e}):null;return o==null?null:u.jsx(St,{anchor:"right",open:c!=null,PaperProps:{style:{width:uo,color:y.colors.grey4}},slotProps:{backdrop:{style:{backgroundColor:"transparent",cursor:"pointer"}}},onClose:()=>k(),children:u.jsx(ho,{onClick:s=>s.stopPropagation(),children:o})})},ho=Ae(ze)`
8
+ `,uo="512px",mo=({reconciliation:t,selectedDrawerAccountId:c,onFetchLinkTokenClick:x,onEstablishConnectionClick:A})=>{const y=Ft(),r=he(),m=Ae.getSignedInUser(),R=V(s=>$e(s)),g=t.excludedAccountIDs,a={userId:m?.userId??"",sessionId:m?.zeniSessionId??"",tenantId:R.tenantId??""},{accountReconciliationsByAccountID:M,monthYearPeriod:v,statementUploadChosen:I}=t,$=c!=null?M[c]:void 0,S=$?.accountReconEntity.statementMetaData?.statementUploadId,k=l.useCallback(()=>{c!=null&&r(Me({selectedDrawerAccountId:void 0}))},[r,c]),L=(s,C)=>{r(fn(s,C.split(".")[0]))},Y=s=>{S!=null&&r(In({accountId:c??"",selectedPeriod:v,fileId:s,statementUploadId:S}))},d=()=>{r(Et({statementUploadChosen:!1}))},p=s=>{c!=null&&r(Sn({accountId:c,selectedPeriod:v,payload:s}))},E=s=>{c!=null&&r(yt({accountId:c,selectedPeriod:v,localData:{accountSource:s}}))},O=l.useCallback(()=>{c!=null&&r(ft({accountId:c}))},[r,c]),e=l.useCallback(()=>{c!=null&&r(kt({accountId:c}))},[r,c]),n=g.includes(c??"")?t.excludedAccountReconciliationByAccountID[c??""]:void 0,o=$!=null?u.jsx(Ga,{excludeAccountFetch:t.excludeAccountFetchState,accountReconciliation:$,monthYearPeriod:v,onDismissClick:k,plaidConnectionDetails:t.plaidConnectionDetails,onFetchLinkTokenClick:x,onEstablishConnectionClick:A,onEditFileName:L,onDeleteFile:Y,onSelectSourceType:E,filesEndPoint:`${ve.fileMicroServiceBaseUrl}`,authParams:a,openFilePicker:I,onStatementUploadSuccess:p,onUploadWindowOpenedOnce:d,onExcludeFromReconciliation:O}):n!=null?u.jsx(qa,{excludedAccountReconciliation:n,includeAccountFetch:t.includeAccountFetchState,onIncludeIntoReconciliation:e}):null;return o==null?null:u.jsx(St,{anchor:"right",open:c!=null,PaperProps:{style:{width:uo,color:y.colors.grey4}},slotProps:{backdrop:{style:{backgroundColor:"transparent",cursor:"pointer"}}},onClose:()=>k(),children:u.jsx(ho,{onClick:s=>s.stopPropagation(),children:o})})},ho=Te(ze)`
9
9
  display: flex;
10
10
  min-height: 100%;
11
11
  flex-direction: column;
12
- `;function po({companyId:t,closeCustomerRequestDrawer:c,addCustomerRequest:x,resetCustomerRequest:T}){const y=Te.getSignedInUser();if(y==null)throw Error("Can't access Customer Request page without signing in...");const r=V(m=>kn(m,t,y));return l.useEffect(()=>{T()},[]),u.jsx(u.Fragment,{children:r.fetchState==="In-Progress"||r.companyMonthEndReportTemplatesData.fetchState==="In-Progress"?u.jsx(Bt,{fetchState:"In-Progress"}):u.jsx(Ja,{onCloseClick:c,addCustomerRequest:x,snippets:r.companyMonthEndReportTemplatesData,bulletPoints:r.zeniRequestsData??[]})})}const go=t=>u.jsx(Ka,{...t}),Co="512px",So=({selectedTransactionId:t,onClose:c})=>{const x=Ft(),T=he(),y=V(g=>t==null?void 0:En(g.transactionState,t)),r=y?.qboId,m=V(g=>r==null?void 0:yn(g,r));l.useEffect(()=>{r!=null&&T(vn(r))},[T,t,r]);const P=l.useCallback(()=>{c()},[c]);return t==null||m==null?null:u.jsx(St,{anchor:"right",open:t!=null,PaperProps:{style:{width:Co,color:x.colors.grey4}},slotProps:{backdrop:{style:{backgroundColor:"transparent",cursor:"pointer"}}},onClose:P,children:u.jsx(Io,{onClick:g=>g.stopPropagation(),children:u.jsx(go,{transactionActivityLogSelectorView:m,onClose:P})})})},Io=Ae(ze)`
12
+ `;function po({companyId:t,closeCustomerRequestDrawer:c,addCustomerRequest:x,resetCustomerRequest:A}){const y=Ae.getSignedInUser();if(y==null)throw Error("Can't access Customer Request page without signing in...");const r=V(m=>kn(m,t,y));return l.useEffect(()=>{A()},[]),u.jsx(u.Fragment,{children:r.fetchState==="In-Progress"||r.companyMonthEndReportTemplatesData.fetchState==="In-Progress"?u.jsx(Bt,{fetchState:"In-Progress"}):u.jsx(Ja,{onCloseClick:c,addCustomerRequest:x,snippets:r.companyMonthEndReportTemplatesData,bulletPoints:r.zeniRequestsData??[]})})}const go=t=>u.jsx(Ka,{...t}),Co="512px",So=({selectedTransactionId:t,onClose:c})=>{const x=Ft(),A=he(),y=V(g=>t==null?void 0:En(g.transactionState,t)),r=y?.qboId,m=V(g=>r==null?void 0:yn(g,r));l.useEffect(()=>{r!=null&&A(vn(r))},[A,t,r]);const R=l.useCallback(()=>{c()},[c]);return t==null||m==null?null:u.jsx(St,{anchor:"right",open:t!=null,PaperProps:{style:{width:Co,color:x.colors.grey4}},slotProps:{backdrop:{style:{backgroundColor:"transparent",cursor:"pointer"}}},onClose:R,children:u.jsx(Io,{onClick:g=>g.stopPropagation(),children:u.jsx(go,{transactionActivityLogSelectorView:m,onClose:R})})})},Io=Te(ze)`
13
13
  display: flex;
14
14
  min-height: 100%;
15
15
  flex-direction: column;
16
- `,fo=t=>t.sections.generalExpense.vendors.length+t.sections.reimbursement.vendors.length,{common:{strings:{hyphen:ko,comma:gt,space:Eo}},dateFormat:jt}=Xa.getLocalizedStrings(),Ct=za,yo=mn(function(t,c){const{uncategorizedAccounts:x,vendorSearchAutoCompleteData:T,monthEndInsightsCustomerRequestData:y,monthEndInsightsPreviewMode:r,companyId:m,isMissingReceiptsBulkUploadEnabled:P,isTransactionActivityEnabled:g}=c,a=Te.getSignedInUser(),j=t.tenantState.currentTenantId,v={userId:a?.userId??"",sessionId:a?.zeniSessionId??"",tenantId:j??""},I=Me(t),{selectedTransactionCategorizationTab:$}=I;return{expenseAutomationViewSelector:I,bulkUploadSelector:I.missingReceipts.bulkUpload,vendorSearchAutoCompleteData:T,authParams:v,receiptUploadEndpoint:`${ve.accountMicroServiceBaseUrl}`,transactionAttachmentsEndpoint:`${to}/transaction_attachments`,bulkUploadEndpoint:P===!0?`${ve.communicationAgentMicroServiceBaseUrl}/1.0/receipts/bulk-upload`:void 0,isDisabled:!1,currentTab:$,monthEndInsightsCustomerRequestData:y,monthEndInsightsPreviewMode:r,allThreadsSectionOpen:!1,enableMonthEndInsightsZeniGPTFeature:!1,loggedInUser:a,uncategorizedAccounts:x,companyId:m,isTransactionActivityEnabled:g,isAccountingClassesEnabled:Mn(t)}},function(t,c){const{themeState:x,isCOTEnabled:T,isUncategorizedExpenseCategoryEnabled:y,isMissingReceiptsBulkUploadEnabled:r,location:m,vendorSearchAutoCompleteData:P,expenseAutomationViewSelector:g,currentTenant:a,uncategorizedAccounts:j,navigate:v,onClickCustomerRequest:I,handleEditClick:$,setActivityLogTransactionId:S}=c,{selectedPeriod:k,currentSelectedView:L,reconciliation:{selectedAccountId:Y}}=g,{accountSettingsView:d}=g.jeSchedules,p=bt(k),E=be(p.start),O=be(p.end);return{onZeniLogoClick:()=>{x.toggle()},onUploadReceiptAttachment:e=>{M.trackMissingReceiptAttached(k.month,k.year),t(Pa(e))},onUploadTransactionReceipt:(e,n,o,s,C,h)=>{t(mt(e,n,{fetchState:"In-Progress"}));const f=()=>t(mt(e,n,{fetchState:"Error"}));no(`${ve.accountMicroServiceBaseUrl}/1.0/transactions/${n}/attachments`,h,n,o,s,C).then(b=>{b!=null?t(xa(e,b)):f()}).catch(f)},onMissingReceiptsRowClick:(e,n)=>{if(c.openTransactionPanel)return void c.openTransactionPanel(e,n);const o=Q(m.state?.pathnameStackToGoBack,m.pathname);v(`../../transaction/${n}/${e}`,{state:{pathnameStackToGoBack:o,message:"expenseAutomation",origin:"missing_receipts"}})},onUploadReceiptComplete:(e,n)=>{t(wa(e,n)),a!=null&&t(me({tenantId:a.tenantId,period:n,refreshViewInBackground:!0}))},onUploadReceiptFetchStatus:(e,n,o,s)=>{t(Ta(e,{fetchState:n,error:o})),o!=null&&t(dt({messageSection:"missing_receipts_attachment",messageText:"failed",type:"error",showStatusIcon:!0,variables:[{variableName:"__message__",variableValue:s!=null?Eo+ko+s+gt:gt}]}))},onUpdateJESchedulesUIState:e=>{t(Aa(e))},onUpdateMissingReceiptsUIState:e=>{t(ba(e))},onFetchMissingReceiptsList:()=>{O!=null&&E!=null&&t(wt({start:E,end:O},{amount:75,currencyCode:"USD",currencySymbol:"$"},!0,!1))},...r===!0?{onBulkUploadFiles:e=>{t(La(e))},onBulkUploadProgress:e=>{t(Ma(e))},onBulkUploadSuccess:e=>{t(ja({batchId:e}))},onBulkUploadUploadedFileCount:e=>{t(Va(e))},onConfirmBulkUploadMatch:(e,n,o,s,C)=>{t(_a(e,n,o,s,C))},onBulkUploadConfirmMatchAcknowledged:()=>{t(Ba())},onSetBulkUploadResultsTab:e=>{t(Fa(e))},onSetBulkUploadCompletedSubTab:e=>{t(Ua(e))},onSetBulkUploadSortConfig:(e,n)=>{t(ht({sortKey:e,sortOrder:n}))},onClearBulkUpload:()=>{t(Oa())},onSearchTransactionsForManualMatch:(e,n)=>{t(Ct(e,n??void 0))},onLoadMoreManualSearch:()=>{const{manualSearch:e}=g.missingReceipts.bulkUpload;e.nextPageToken!=null&&e.searchQuery!==""&&t(Ct(e.searchQuery,e.nextPageToken))},onFetchCompletedTransactions:(e,n)=>{t(Da(e,n))},onFetchBulkUploadBatches:e=>{t(At(e))},onFetchMoreBatchDetails:()=>{t(Ra())},onResetBulkUploadSort:()=>{t(ht({sortKey:"date",sortOrder:"descending"}))}}:{},onClearMissingReceiptsTabNavigation:()=>{t(va())},onSearchTextChanged:e=>{const n=g.currentSelectedView,o=g.selectedTransactionCategorizationTab;n==="transaction_categorization"&&(t(Fe({selectedTab:o,uiState:{searchString:e}})),O!=null&&E!=null&&t(ue(o,{start:E,end:O},!0,!1,e,void 0,!0)))},onRefresh:()=>{c.trackExpenseAutomationTabAnalytics(!0),t(ya(y))},onClose:()=>{L==="reconciliation"&&Y!=null&&t(ut({selectedAccountId:void 0})),v("../")},onBack:()=>{L==="reconciliation"&&Y!=null&&t(ut({selectedAccountId:void 0}))},onSaveReconciliation:e=>{t(Ea(e))},onSaveReconciliationReview:e=>{t(ka(e))},onUpdateStep:e=>{const{selectedPeriod:n}=g,o=Q(m.state?.pathnameStackToGoBack,m.pathname);v(`../${e}/${n.month}-${n.year}`,{state:{pathnameStackToGoBack:o,referrer:g.currentSelectedView}}),t(Tt(e))},handleLogOutClick:()=>{const e=Q(m.state?.pathnameStackToGoBack,m.pathname);v("/signout",{replace:!0,state:{pathnameStackToGoBack:e,message:"logout"}})},onJeAccountSettingsChange:e=>{const{vendorsAccountSection:n}=e,{prepaidExpensesAccount:o,fixedAssetsAccount:s,accruedExpensesAccount:C}=n,h=_e(d.prepaidExpensesAccountList,o.selectedOptions),f=_e(d.fixedAssetsAccountList,s.selectedOptions),b=_e(d.accruedExpensesAccountList,C.selectedOptions),z={selectedPrepaidExpensesAccountIds:h.map(U=>U.accountId),selectedFixedAssetsAccountIds:f.map(U=>U.accountId),selectedAccruedExpensesAccountIds:b.map(U=>U.accountId)};t(fa({data:z}))},onSaveJeAccountSettingsClick:()=>{t(Ia())},onJESchedulesFormDataChange(e,n){const{jeScheduleID:o,accumulatedDepreciationCategory:s,scheduleClass:C,scheduleExpenseCategory:h,vendor:f}=n,{allAccountList:b,allClassList:z,allDepreciationAccountList:U}=g.jeSchedules,N=P.entityAutoCompleteView.vendor.length>0?P.entityAutoCompleteView.vendor.find(G=>G.id===f?.selectedOption):void 0,oe={id:N?.zeniId??f?.selectedOption??"",name:N?.name??f?.defaultOptions.find(G=>G.value===f?.selectedOption)?.label??"",logo:N?.logo},pe=h?.selectedOption!=null?b.find(G=>G.qboId===h.selectedOption):void 0,we=C?.selectedOption!=null?z.find(G=>G.classId===C.selectedOption):void 0,te=s?.selectedOption!=null?U.find(G=>G.qboId===s.selectedOption):void 0;t(Sa({scheduledJournalEntryID:e,localData:{jeScheduleID:o,scheduledJournalEntryID:e,updatedCategoryId:pe?.accountId,updatedClassId:we?.classId,updatedAccumulatedDepreciationCategoryID:te?.accountId,updatedVendor:{id:oe.id,name:oe.name}}}))},ignoreRecommendedJeSchedule(e,n){t(Ca(e,n))},vendorSearchAutoCompleteActions:{onAutoCompleteInputChange:(e,n)=>{e.trim().length>=2?t(ct({searchString:e,entityType:n,searchOrigin:"common"})):e.trim().length===0&&t(ke("common"))},onCancelAutoComplete:()=>{t(ke("common"))}},onPostJESchedule(e,n){t(ga({scheduledJournalEntryID:e,jeScheduleTransactionKey:n}))},clearJeScheduleLocalData(){t(pa())},handleJeScheduleClick:(e,n,o)=>{t(ha({selectedJEScheduleKey:n}));const s=Q(m.state?.pathnameStackToGoBack,m.pathname);v(`../../vendors/schedules/${o}/details/${e}`,{state:{pathnameStackToGoBack:s,message:"expenseAutomation",origin:"je_schedules"}})},improveMonthEndInsightsUsingZeniGPTClick:e=>{a!=null&&t(ma(e,a.companyId,a.tenantId))},onClickCustomerRequest:I,setActivityLogTransactionId:S,onCloseAllThreadsSection:()=>{},onCloseFileAttachmentSnackBar:()=>{t(ua())},onOpenFileAttachmentSnackBar:()=>{t(dt({messageSection:"cockpit_month_end_email_attachment_upload",messageText:"failed",type:"error",showStatusIcon:!0}))},onRemoveFileAttachment:e=>{t(da(e))},onUpdateFileAttachment:e=>{t(ra({files:e}))},previewMonthEndReport:(e,n,o,s)=>{a!=null&&t(rt(e,a.companyId,n,!0,o,s,a.tenantId))},saveMonthEndReport:(e,n,o,s)=>{a!=null&&t(rt(e,a.companyId,n,!1,o,s,a.tenantId))},onEditMonthEndInsightsClick:$,sendMonthEndReport:e=>{const n=m.state?.referrer,{selectedPeriod:o,auditSummary:s}=g;a!=null&&s?.auditScorePercentage!=null&&(t(ia(a.companyId,e,a.tenantId)),M.trackInsightsEmailPage(o.month,o.year,!1,"draft",s.auditScorePercentage,la().format(jt.analytics.MMMDDCommaYYYYformat),n??null))},onTransactionCategorizationRowClick:(e,n)=>{if(c.openTransactionPanel)return void c.openTransactionPanel(e,n);const o=Q(m.state?.pathnameStackToGoBack,m.pathname);v(`../../transaction/${n}/${e}`,{state:{pathnameStackToGoBack:o,message:"expenseAutomation",origin:"transaction_categorization"}})},setLocalDataForCategoryAndClass:(e,n,o,s,C,h,f,b,z,U,N)=>{t(ca(e,n,o,s,j,C,h,f,b,z,U,N))},onCancelAutoComplete:()=>{t(ke("common"))},updateExpenseAutomationReconListScrollPosition:e=>{t(it({scrollPosition:e}))},onUpdateTab:e=>{c.closeSidePanel?.(),O!=null&&E!=null&&(t(ue(e,{start:E,end:O},!1,!1)),t(sa(e)))},onUpdateTransactionCategorizationUIState:(e,n)=>{t(Fe({selectedTab:e,uiState:n})),O!=null&&E!=null&&t(ue(e,{start:E,end:O},!1,!1,n.searchString,null,!0))},onUpdateScrollYOffSetTransactionCategorizationUIState:(e,n)=>{t(Fe({selectedTab:e,uiState:n}))},onFetchTransactionCategorizationList:(e,n,o,s,C,h,f)=>{O!=null&&E!=null&&t(ue(e,{start:E,end:O},!0,o,n,s,C,h,f))},resetTransactionCategorizationLocalData:(e,n,o,s,C,h,f,b)=>{t(oa(e,n,o,s,b??null,C,h,!1,f))},updateSelectedVendorForTransaction:(e,n,o,s,C)=>{t(lt({selectedTab:e,transactionId:n,lineId:o,selectedTransaction:s,uncategorizedAccounts:j,updatedVendor:C}))},onSaveUpdateTransactionCategorization:(e,n,o)=>{const s=m.state?.referrer;e==="autoCategorized"?M.trackTransactionsAutoCategorisedPage(k.month,k.year,g.transactionView.totalCountByTab.autoCategorized,n.length,!1,s??null):M.trackTransactionsReviewPage(k.month,k.year,g.transactionView.totalCountByTab.review,n.length,!1,s??null),t(aa(e,n,o,y))},onUpdateSelectedCheckboxTransactionIds:(e,n)=>{t(na({selectedTab:e,transactionIds:n}))},onFetchRecommendationsForEntityCategorizationWithCustomer:(e,n,o,s,C,h,f)=>{const{transactionId:b,transaction:z,lineIds:U}=n;h!=null&&t(ea({transactionId:b,customerUpdates:h})),t(ta({selectedTab:s,transactionId:b.id,lineId:U[0],selectedTransaction:z,uncategorizedAccounts:j,updatedCustomer:h,selectedEntity:C,isUncategorizedExpenseCategoryEnabled:f})),C!=null&&t(Le(C,e,n,o,!0,T,f))},onFetchRecommendationsForEntityCategorization:(e,n,o,s,C,h,f)=>{const{transactionId:b,transaction:z,lineIds:U}=n;h!=null&&(t(Hn({transactionId:b,vendorUpdates:{name:h.name,id:h.id?h.id:void 0}})),t(Wn({vendorId:h.id?h.id:void 0,localData:{vendorName:h.name,vendorId:h.id?h.id:void 0}}))),h?.id?(t(lt({selectedTab:s,transactionId:b.id,lineId:U[0],selectedTransaction:z,uncategorizedAccounts:j,updatedVendor:h,selectedEntity:C,isUncategorizedExpenseCategoryEnabled:f})),C!=null&&t(Le(C,e,n,o,!0,T,f))):t(Xn({selectedTab:s,transactionId:b.id,lineId:U[0]}))},fetchFluxViewOnScroll:(e,n)=>{t(Ee(e,!0,!1,n,!1,!0))},onFetchFluxViewList:()=>{t(Ee(k,!0,!1,null,!1,!1))},markAsReview:(e,n,o,s)=>{M.trackFluxAnalysisReviewed(o.month,o.year,s??!1,e),t(Qn(n,e,o,s??!1))},onUpdateFluxAnalysisUIState:e=>{t(Zn(e))},updateOperatingExpensesIdsForReview:e=>{t(Nn({operatingExpenseIds:e,selectedPeriod:k}))},redirectToVendorDetailPage:e=>{if(c.tenantEmailDomain!=null){const n=co(e.id,e.qboId,c.tenantEmailDomain),o=Q(c.location.state?.pathnameStackToGoBack,c.location.pathname);c.navigate(n,{state:{pathnameStackToGoBack:o,message:"expenseAutomation",referrer:"Vendor List",origin:"flux_analysis"}})}},updateSectionIdsForReview:e=>{t(Yn({sectionId:e,selectedPeriod:k}))},onFetchReimbursementView:(e,n,o)=>{t(Ee(e,!0,!1,n,!0,o))},onReviewClicked:e=>{t(ae(k,e))},setOpenDrawerClicked:e=>{t(je({selectedDrawerAccountId:e}))},onFetchLinkTokenClick:(e,n)=>{t(Rt("expense_automation_reconcile",e,n))},onEstablishConnectionClick:(e,n)=>{const o=a?.companyId;o!=null&&(t(xt(e,o,"expense_automation_reconcile",void 0,"link_account_no_microdeposit",n)),t(Pt({accountId:n,connectionInProgress:!0})))},onAddStatementClick:e=>{t(je({selectedDrawerAccountId:e})),t(yt({accountId:e,selectedPeriod:k,localData:{accountSource:"bank_statement"}})),t(Et({statementUploadChosen:!0}))},onReloadReconciliationListPage:()=>{t(ae(k,void 0,!0,!1))},onUpdateReconcileTabLocalData:e=>{t(Kn({selectedTransactionIds:e}))},onReconTabColumnSortConfigChanged:(e,n)=>{t(Jn({sortKey:e,sortOrder:n}))},onReconReviewTabColumnSortConfigChanged:(e,n)=>{t(qn({sortKey:e,sortOrder:n}))},onReconTabUpdate:e=>{c.closeSidePanel?.(),t(Gn({selectedTab:e}))},updateReconReviewTabLocalData:(e,n,o)=>{const s=e.vendor?.id;o&&s!=null&&t(zn(s)),t($n({data:e,transactionId:n}))},onReconMatchedTransactionClick:e=>{if(c.openTransactionPanel)return void c.openTransactionPanel(e,vt("bill"));const n=Q(m.state?.pathnameStackToGoBack,m.pathname);v(`../../transaction/bill/${e}`,{state:{pathnameStackToGoBack:n,message:"expenseAutomation",origin:"reconciliation"}})},onReloadPage:()=>{window.location.reload()},onBackClick:()=>{v(-1)},onReconListPageScroll:e=>{t(it({scrollPosition:e}))},onVendorAutoCompleteInputChange:e=>{e.trim().length>=2?t(ct({searchString:e,searchOrigin:"common"})):e.trim().length===0&&t(ke("common"))},onReconNodeCollapseToggled:(e,n)=>{t(Ln({nodeId:e,collapsed:n}))},updateSectionCollapseStatus:()=>{},onExcludeAccountFromReconciliation:e=>{t(ft({accountId:e}))},onIncludeAccountIntoReconciliation:e=>{t(kt({accountId:e}))}}},(t,c,x)=>{const{isMissingReceiptsBulkUploadEnabled:T,...y}=x;return function(r,m,P){return{...r,...m,...P,onUploadTransactionReceipt:(g,a,j,v,I)=>{m.onUploadTransactionReceipt(g,a,j,v,I,r.authParams)}}}(t,c,y)})(eo),vo=oo(({closeSidePanel:t,openTransactionPanel:c,panelContent:x,sidePanelIsFullView:T,sidePanelIsOpen:y})=>{const{isAiCfoOpen:r,setIsAiCfoOpen:m}=Dt(),P=It(),g=Ve(),a=he(),{isAiCfoAccessEnabled:j,onAskAiCfoClick:v}=_t({isAiCfoOpen:r,setIsAiCfoOpen:m,mobileExploreReferrer:"Transaction categorization"}),{areTenantIdsInSync:I}=Ut(),$=(()=>{const i=V(q=>Me(q)),A=Ve(),{currentSelectedViewFetchState:D,currentSelectedView:B,selectedPeriod:R}=i,de=Be(B),X=Be(D.fetchState),Se=l.useCallback(q=>{const Z=A.state?.referrer;B==="transaction_categorization"&&(i.selectedTransactionCategorizationTab==="review"?M.trackTransactionsReviewPage(R.month,R.year,i.transactionView.totalCountByTab.review,0,q,Z??null):M.trackTransactionsAutoCategorisedPage(R.month,R.year,i.transactionView.totalCountByTab.autoCategorized,0,q,Z??null)),B==="missing_receipts"&&M.trackMissingReceiptsPage(R.month,R.year,q,i.missingReceipts.transactions.length,Z??null),B==="je_schedules"&&M.trackMonthCloseScheduleListPage(R.month,R.year,q,i.jeSchedules.draftSchedules.length,i.jeSchedules.resolveSchedules.length,Z??null),B==="flux_analysis"&&M.trackFluxAnalysisPage(R.month,R.year,q,fo(i.fluxAnalysis),Z??null),B==="month_end_insights"&&i.auditSummary?.auditScorePercentage!=null&&M.trackInsightsEmailPage(R.month,R.year,q,"draft",i.auditSummary.auditScorePercentage,null,Z??null)},[R,i]);return l.useEffect(()=>{X===D.fetchState&&B===de||D.fetchState!=="Completed"||Se(!1)},[B,D.fetchState,de]),Se})(),S=Ya(),[k,L]=l.useState(!1),Y=V(i=>at(i)),d=V(i=>$e(i)),[p,E]=l.useState(!1),[O,e]=l.useState(!1),[n,o]=l.useState([]),[s,C]=l.useState(void 0),[h,f]=l.useState(!1),b=l.useRef(!1),{selectedTab:z}=nt(),{tenantEmailDomain:U}=nt(),[N,oe]=l.useState(g.state?.message==="comingFromTransactionDetail"),pe=g.state?.message==="comingFromOverview",we=Na(),te=Te.getSignedInUser(),{useDynamicConfig:G,useFeatureGate:xe}=Ot(),{configValue:Mt}=G(Za.enableUncategorizedExpenseCategory),H=Mt?.uncategorized_expense_category_enabled===!0,{isFeatureEnabled:Ge}=xe(ye.isRealtimeInsightsFeatureEnabled),{isFeatureEnabled:se}=xe(ye.isMissingReceiptsBulkUploadEnabled),{isFeatureEnabled:qe}=xe(ye.isTransactionActivityEnabled),Lt=V(i=>Pn(i,"common")),_=V(i=>Me(i)),{monthEndCloseChecksView:K,currentSelectedView:F,selectedPeriod:w,selectedTransactionCategorizationTab:Je,currentSelectedViewBackgroundRefreshFetchState:zt,currentSelectedViewFetchState:W,jeSchedules:Pe,reconciliation:$t}=_,{selectedAccountId:ce}=$t,Ke=Be(Pe.accountSettingsView.saveState.fetchState),Gt=V(i=>Rn(i.accountState,i.accountListState,"accountList")),ie=z!=null?Dn(z):F,qt=V(i=>i.entityAutoCompleteState.autoCompleteText.common);if(Vt({isDataReady:W.fetchState==="Completed"}),te==null)throw Error("Can't access expense automation screen without signing in...");const Ye=bt(w),le=be(Ye.start),re=be(Ye.end);if(le==null||re==null)throw Error(`Invalid start - ${le} and end - ${re} period from given ${w}`);const Jt=l.useCallback(()=>{E(!1)},[]),Kt=l.useCallback(()=>{e(!0)},[]),Yt=l.useCallback(i=>{o(i),e(!1)},[]),Nt=l.useCallback(()=>{o([])},[]),Re=`private-${te.userId}`,Ne="missing-receipts-batch-completed",ge=Qa();l.useEffect(()=>{if(ge==null||F!=="missing_receipts"||se===!1)return;const i=ge.channel(Re)??ge.subscribe(Re),A=D=>{a(jn({batchId:D.batch_id,progress:D.progress,status:D.status.toLowerCase()}))};return i.bind(Ne,A),()=>{i.unbind(Ne,A)}},[ge,F,Re,a,se]);const Ce=_.missingReceipts.bulkUpload.phase,Ze=_.missingReceipts.bulkUpload.currentBatchId;l.useEffect(()=>{F==="missing_receipts"&&Ce==="matching"&&Ze!=null&&a(At({cacheOverride:!0}))},[F,Ce,Ze,a]);const Qe=te?.userId,Zt=w.month,Qt=w.year,He=d?.tenantId;l.useEffect(()=>{F==="missing_receipts"&&se!==!1&&Ce==="idle"&&Qe!=null&&He!=null&&a(On())},[F,se,Ce,Qe,He,Zt,Qt,a]),l.useEffect(()=>{Y.newVendorState?.vendorDetailLocalData?.vendorName!=null?L(!0):L(!1)},[Y.newVendorState?.vendorDetailLocalData?.vendorName]),l.useEffect(()=>{ie!=null&&F!==ie&&a(Tt(ie))},[ie]),l.useEffect(()=>{h!==!1||W.fetchState!=="Completed"&&W.fetchState!=="Error"||!I||(f(!0),a(ot(!1,!1,H)))},[h,W,I,H]),l.useEffect(()=>{!pe&&I&&(a(ot(!1,!1,H)),a(ae(w,ce,!1,!1)))},[w.month,w.year,I,H]);const We=l.useCallback((i=!1,A=!1)=>{const D={start:le,end:re};switch(F){case"transaction_categorization":a(ue(Je,D,i,!N,void 0,void 0,A,void 0,H)),oe(!1);break;case"flux_analysis":a(Ee(w,i,A,null));break;case"month_end_insights":if(A===!1){const B=new Date(w.year,w.month,0),R=Fn(B.toDateString()).format(jt.analytics.YYYYDashMMDashDDFormat);a(Bn(!0,d.companyId,d.tenantId,R)),a(_n(d.companyId,d.tenantId))}break;case"je_schedules":a(Un(D,A));break;case"missing_receipts":a(wt(D,{amount:75,currencyCode:"USD",currencySymbol:"$"},i,A));break;default:a(ae(w,ce,i,A))}},[F,le,re,d.companyId,d.tenantId,Je,w,ce,N,oe,H]);l.useEffect(()=>{F===ie&&W.fetchState==="Not-Started"&&I&&We(!0)},[W,le,re,d.companyId,d.tenantId,I]),l.useEffect(()=>{pe||N||b.current||zt.fetchState==="In-Progress"||W.fetchState!=="Completed"||(b.current=!0,We(!0,!0))},[]),l.useEffect(()=>{K.fetchState!=="In-Progress"&&K.fetchState!=="Completed"&&a(me({tenantId:d.tenantId,period:w,refreshViewInBackground:!1}))},[K.fetchState,d.tenantId]),l.useEffect(()=>{_.monthEndInsights?.previewMonthEndReportStatus?.fetchState==="Completed"?E(!0):E(!1)},[_.monthEndInsights?.previewMonthEndReportStatus?.fetchState]),l.useEffect(()=>{_.monthEndInsights?.sendMonthEndReportStatus?.fetchState==="Completed"&&I&&(a(me({tenantId:d.tenantId,period:w,refreshViewInBackground:!0})),a(Vn({companyId:d.companyId})),P("../"))},[_.monthEndInsights?.sendMonthEndReportStatus?.fetchState,d.tenantId,w,d.companyId,I]),l.useEffect(()=>{const i=setInterval(()=>{K.fetchState!=="In-Progress"&&K.fetchState==="Completed"&&a(me({tenantId:d.tenantId,period:w,refreshViewInBackground:!0}))},3e5);return()=>clearInterval(i)},[K.fetchState,d.tenantId,w,a]),l.useEffect(()=>{const i=setInterval(()=>{F==="reconciliation"&&ce==null&&_.reconciliation.fetchStatus.fetchState==="Completed"&&_.reconciliation.refreshStatus.fetchState!=="In-Progress"&&a(ae(w,void 0,!0,!0))},3e5);return()=>clearInterval(i)},[F,a,_.reconciliation.fetchStatus.fetchState,_.reconciliation.refreshStatus.fetchState,ae,ce,w]);const Ht=pt();l.useEffect(()=>{const i=(K.monthEndCloseChecks?.monthEndCloseCheckList.find(A=>A.id==="month_end_insights")?.isDisabled??!1)&&!Ge;F!=="month_end_insights"||!i&&K.monthEndCloseChecks?.reportEmailSentDate==null||P("../")},[F,K.monthEndCloseChecks]);const Wt=_.reconciliation.selectedDrawerAccountId;l.useEffect(()=>{Ke==="In-Progress"&&Pe.accountSettingsView.saveState.fetchState==="Completed"&&a(st())},[Ke,Pe.accountSettingsView.saveState.fetchState,st]);const{transactionId:Xe,onSaveVendor:Xt,onSaveSuccess:en,onCancel:tn,vendorViewDetails:nn}=(({expenseAutomationViewSelector:i,closeDrawerHandler:A,currentSelectedView:D})=>{const B=he();let R,de,X;const Se=pt(),q=i.transactionView;let Z=()=>{};const{transactions:an,selectedTransactionId:ne,selectedTransactionLineId:Ie,transactionLocalData:on}=q;if(D==="transaction_categorization"){const De=on.find(ee=>ee.transactionId===ne),J=an.find(ee=>ee.id===ne),et=Ie!=null?De?.transactionReviewLocalData?.lineItemById[Ie]:void 0,tt=et?.account;de=et?.class?.classId,R=["Uncategorized Income","Uncategorized Expense"].includes(tt?.accountName??"")?void 0:tt?.accountId;const cn=so(ne,J?.typeOfTransaction);J!=null&&cn&&(X={id:ne,type:vt(J.typeOfTransaction)}),Z=()=>{if(ne!=null&&Ie!=null&&J!=null){const ee=q.transactionLocalData.find(fe=>fe.transactionId===ne)?.transactionReviewLocalData;if(ee!=null&&J.lines!=null&&J.lines.length>0){const fe=ee.lineItemById[Ie];let Oe=ee.selectedEntity;if(xn(J)||(Oe=fe.selectedEntityLine),Oe!=null){const ln=Oe,rn={transactionId:{id:J.id,type:J.type},transaction:J,lineIds:J.lines.map(dn=>dn.id)??[]};B(Le(ln,fe.amount.amount,rn,!1,!0,Se))}}}}}const sn=V(De=>at(De,void 0,R,de));return{transactionId:X,onSaveVendor:()=>{B(wn(X,void 0,!1,!0))},onSaveSuccess:Z,onCancel:()=>{X!=null&&B(bn({transactionId:X})),B(An()),B(Tn()),A()},vendorViewDetails:sn}})({expenseAutomationViewSelector:_,closeDrawerHandler:()=>{L(!1)},currentSelectedView:F});return we?.loggedInUserRoleMap==null?K.fetchState==="Error"?u.jsx(Ha,{onGoHome:()=>P("../",{replace:!0}),onReload:()=>window.location.reload()}):u.jsx(Bt,{fetchState:"In-Progress"}):u.jsxs(u.Fragment,{children:[u.jsx(io,{isOpen:O,drawerLeftMargin:new Wa(0,0,300,650),onClose:()=>{e(!1)},children:u.jsx(bo,{onClick:i=>i.stopPropagation(),children:u.jsx(po,{companyId:d.companyId,closeCustomerRequestDrawer:()=>e(!1),addCustomerRequest:Yt,resetCustomerRequest:Nt})})}),Xe!=null&&k&&u.jsx(ao,{isOpen:k,transactionId:Xe,onSaveVendor:Xt,onSaveSuccess:en,onCancel:tn,vendorViewDetails:nn}),u.jsx(mo,{selectedDrawerAccountId:Wt,reconciliation:_.reconciliation,onFetchLinkTokenClick:(i,A)=>{a(Rt("expense_automation_reconcile",i,A))},onEstablishConnectionClick:(i,A)=>{const D=d?.companyId;D!=null&&(a(xt(i,D,"expense_automation_reconcile",void 0,"link_account_no_microdeposit",A)),a(Pt({accountId:A,connectionInProgress:!0})))}}),qe&&u.jsx(So,{selectedTransactionId:s,onClose:()=>C(void 0)}),u.jsx(yo,{navigate:P,location:g,themeState:S,vendorSearchAutoCompleteData:{autoCompleteText:qt,entityAutoCompleteView:Lt},expenseAutomationViewSelector:_,isMissingReceiptsBulkUploadEnabled:se,monthEndInsightsPreviewMode:p,monthEndInsightsCustomerRequestData:n,isRealtimeInsightsFeatureEnabled:Ge,isUncategorizedExpenseCategoryEnabled:H,isCOTEnabled:Ht,currentTenant:d,companyId:d.companyId,signedInUser:te,isTransactionActivityEnabled:qe,uncategorizedAccounts:Gt,onClickCustomerRequest:Kt,handleEditClick:Jt,tenantEmailDomain:U,trackExpenseAutomationTabAnalytics:$,setActivityLogTransactionId:C,closeSidePanel:t,openTransactionPanel:c,sidePanelIsOpen:y,sidePanelIsFullView:T,panelContent:x,isAiCfoAccessEnabled:j,onAskAiCfoClick:v})]})}),bo=Ae(ze)`
16
+ `,fo=t=>t.sections.generalExpense.vendors.length+t.sections.reimbursement.vendors.length,{common:{strings:{hyphen:ko,comma:gt,space:Eo}},dateFormat:Mt}=Xa.getLocalizedStrings(),Ct=za,yo=mn(function(t,c){const{uncategorizedAccounts:x,vendorSearchAutoCompleteData:A,monthEndInsightsCustomerRequestData:y,monthEndInsightsPreviewMode:r,companyId:m,isMissingReceiptsBulkUploadEnabled:R,isTransactionActivityEnabled:g}=c,a=Ae.getSignedInUser(),M=t.tenantState.currentTenantId,v={userId:a?.userId??"",sessionId:a?.zeniSessionId??"",tenantId:M??""},I=je(t),{selectedTransactionCategorizationTab:$}=I;return{expenseAutomationViewSelector:I,bulkUploadSelector:I.missingReceipts.bulkUpload,vendorSearchAutoCompleteData:A,authParams:v,receiptUploadEndpoint:`${ve.accountMicroServiceBaseUrl}`,transactionAttachmentsEndpoint:`${to}/transaction_attachments`,bulkUploadEndpoint:R===!0?`${ve.communicationAgentMicroServiceBaseUrl}/1.0/receipts/bulk-upload`:void 0,isDisabled:!1,currentTab:$,monthEndInsightsCustomerRequestData:y,monthEndInsightsPreviewMode:r,allThreadsSectionOpen:!1,enableMonthEndInsightsZeniGPTFeature:!1,loggedInUser:a,uncategorizedAccounts:x,companyId:m,isTransactionActivityEnabled:g,isAccountingClassesEnabled:jn(t)}},function(t,c){const{themeState:x,isCOTEnabled:A,isUncategorizedExpenseCategoryEnabled:y,isMissingReceiptsBulkUploadEnabled:r,location:m,vendorSearchAutoCompleteData:R,expenseAutomationViewSelector:g,currentTenant:a,uncategorizedAccounts:M,navigate:v,onClickCustomerRequest:I,handleEditClick:$,setActivityLogTransactionId:S}=c,{selectedPeriod:k,currentSelectedView:L,reconciliation:{selectedAccountId:Y}}=g,{accountSettingsView:d}=g.jeSchedules,p=bt(k),E=be(p.start),O=be(p.end);return{onZeniLogoClick:()=>{x.toggle()},onUploadReceiptAttachment:e=>{j.trackMissingReceiptAttached(k.month,k.year),t(Ra(e))},onUploadTransactionReceipt:(e,n,o,s,C,h)=>{t(mt(e,n,{fetchState:"In-Progress"}));const f=()=>t(mt(e,n,{fetchState:"Error"}));no(`${ve.accountMicroServiceBaseUrl}/1.0/transactions/${n}/attachments`,h,n,o,s,C).then(b=>{b!=null?t(xa(e,b)):f()}).catch(f)},onMissingReceiptsRowClick:(e,n)=>{if(c.openTransactionPanel)return void c.openTransactionPanel(e,n);const o=H(m.state?.pathnameStackToGoBack,m.pathname);v(`../../transaction/${n}/${e}`,{state:{pathnameStackToGoBack:o,message:"expenseAutomation",origin:"missing_receipts"}})},onUploadReceiptComplete:(e,n)=>{t(wa(e,n)),a!=null&&t(me({tenantId:a.tenantId,period:n,refreshViewInBackground:!0}))},onUploadReceiptFetchStatus:(e,n,o,s)=>{t(Aa(e,{fetchState:n,error:o})),o!=null&&t(dt({messageSection:"missing_receipts_attachment",messageText:"failed",type:"error",showStatusIcon:!0,variables:[{variableName:"__message__",variableValue:s!=null?Eo+ko+s+gt:gt}]}))},onUpdateJESchedulesUIState:e=>{t(Ta(e))},onUpdateMissingReceiptsUIState:e=>{t(ba(e))},onFetchMissingReceiptsList:()=>{O!=null&&E!=null&&t(wt({start:E,end:O},{amount:75,currencyCode:"USD",currencySymbol:"$"},!0,!1))},...r===!0?{onBulkUploadFiles:e=>{t(La(e))},onBulkUploadProgress:e=>{t(ja(e))},onBulkUploadSuccess:e=>{t(Ma({batchId:e}))},onBulkUploadUploadedFileCount:e=>{t(Va(e))},onConfirmBulkUploadMatch:(e,n,o,s,C)=>{t(_a(e,n,o,s,C))},onBulkUploadConfirmMatchAcknowledged:()=>{t(Ba())},onSetBulkUploadResultsTab:e=>{t(Fa(e))},onSetBulkUploadCompletedSubTab:e=>{t(Ua(e))},onSetBulkUploadSortConfig:(e,n)=>{t(ht({sortKey:e,sortOrder:n}))},onClearBulkUpload:()=>{t(Oa())},onSearchTransactionsForManualMatch:(e,n)=>{t(Ct(e,n??void 0))},onLoadMoreManualSearch:()=>{const{manualSearch:e}=g.missingReceipts.bulkUpload;e.nextPageToken!=null&&e.searchQuery!==""&&t(Ct(e.searchQuery,e.nextPageToken))},onFetchCompletedTransactions:(e,n)=>{t(Da(e,n))},onFetchBulkUploadBatches:e=>{t(Tt(e))},onFetchMoreBatchDetails:()=>{t(Pa())},onResetBulkUploadSort:()=>{t(ht({sortKey:"date",sortOrder:"descending"}))}}:{},onClearMissingReceiptsTabNavigation:()=>{t(va())},onSearchTextChanged:e=>{const n=g.currentSelectedView,o=g.selectedTransactionCategorizationTab;n==="transaction_categorization"&&(t(Fe({selectedTab:o,uiState:{searchString:e}})),O!=null&&E!=null&&t(ue(o,{start:E,end:O},!0,!1,e,void 0,!0)))},onRefresh:()=>{c.trackExpenseAutomationTabAnalytics(!0),t(ya(y))},onClose:()=>{L==="reconciliation"&&Y!=null&&t(ut({selectedAccountId:void 0})),v("../")},onBack:()=>{L==="reconciliation"&&Y!=null&&t(ut({selectedAccountId:void 0}))},onSaveReconciliation:e=>{t(Ea(e))},onSaveReconciliationReview:e=>{t(ka(e))},onUpdateStep:e=>{const{selectedPeriod:n}=g,o=H(m.state?.pathnameStackToGoBack,m.pathname);v(`../${e}/${n.month}-${n.year}`,{state:{pathnameStackToGoBack:o,referrer:g.currentSelectedView}}),t(At(e))},handleLogOutClick:()=>{const e=H(m.state?.pathnameStackToGoBack,m.pathname);v("/signout",{replace:!0,state:{pathnameStackToGoBack:e,message:"logout"}})},onJeAccountSettingsChange:e=>{const{vendorsAccountSection:n}=e,{prepaidExpensesAccount:o,fixedAssetsAccount:s,accruedExpensesAccount:C}=n,h=_e(d.prepaidExpensesAccountList,o.selectedOptions),f=_e(d.fixedAssetsAccountList,s.selectedOptions),b=_e(d.accruedExpensesAccountList,C.selectedOptions),z={selectedPrepaidExpensesAccountIds:h.map(U=>U.accountId),selectedFixedAssetsAccountIds:f.map(U=>U.accountId),selectedAccruedExpensesAccountIds:b.map(U=>U.accountId)};t(fa({data:z}))},onSaveJeAccountSettingsClick:()=>{t(Ia())},onJESchedulesFormDataChange(e,n){const{jeScheduleID:o,accumulatedDepreciationCategory:s,scheduleClass:C,scheduleExpenseCategory:h,vendor:f}=n,{allAccountList:b,allClassList:z,allDepreciationAccountList:U}=g.jeSchedules,N=R.entityAutoCompleteView.vendor.length>0?R.entityAutoCompleteView.vendor.find(G=>G.id===f?.selectedOption):void 0,oe={id:N?.zeniId??f?.selectedOption??"",name:N?.name??f?.defaultOptions.find(G=>G.value===f?.selectedOption)?.label??"",logo:N?.logo},pe=h?.selectedOption!=null?b.find(G=>G.qboId===h.selectedOption):void 0,we=C?.selectedOption!=null?z.find(G=>G.classId===C.selectedOption):void 0,te=s?.selectedOption!=null?U.find(G=>G.qboId===s.selectedOption):void 0;t(Sa({scheduledJournalEntryID:e,localData:{jeScheduleID:o,scheduledJournalEntryID:e,updatedCategoryId:pe?.accountId,updatedClassId:we?.classId,updatedAccumulatedDepreciationCategoryID:te?.accountId,updatedVendor:{id:oe.id,name:oe.name}}}))},ignoreRecommendedJeSchedule(e,n){t(Ca(e,n))},vendorSearchAutoCompleteActions:{onAutoCompleteInputChange:(e,n)=>{e.trim().length>=2?t(ct({searchString:e,entityType:n,searchOrigin:"common"})):e.trim().length===0&&t(ke("common"))},onCancelAutoComplete:()=>{t(ke("common"))}},onPostJESchedule(e,n){t(ga({scheduledJournalEntryID:e,jeScheduleTransactionKey:n}))},clearJeScheduleLocalData(){t(pa())},handleJeScheduleClick:(e,n,o)=>{t(ha({selectedJEScheduleKey:n}));const s=H(m.state?.pathnameStackToGoBack,m.pathname);v(`../../vendors/schedules/${o}/details/${e}`,{state:{pathnameStackToGoBack:s,message:"expenseAutomation",origin:"je_schedules"}})},improveMonthEndInsightsUsingZeniGPTClick:e=>{a!=null&&t(ma(e,a.companyId,a.tenantId))},onClickCustomerRequest:I,setActivityLogTransactionId:S,onCloseAllThreadsSection:()=>{},onCloseFileAttachmentSnackBar:()=>{t(ua())},onOpenFileAttachmentSnackBar:()=>{t(dt({messageSection:"cockpit_month_end_email_attachment_upload",messageText:"failed",type:"error",showStatusIcon:!0}))},onRemoveFileAttachment:e=>{t(da(e))},onUpdateFileAttachment:e=>{t(ra({files:e}))},previewMonthEndReport:(e,n,o,s)=>{a!=null&&t(rt(e,a.companyId,n,!0,o,s,a.tenantId))},saveMonthEndReport:(e,n,o,s)=>{a!=null&&t(rt(e,a.companyId,n,!1,o,s,a.tenantId))},onEditMonthEndInsightsClick:$,sendMonthEndReport:e=>{const n=m.state?.referrer,{selectedPeriod:o,auditSummary:s}=g;a!=null&&s?.auditScorePercentage!=null&&(t(ia(a.companyId,e,a.tenantId)),j.trackInsightsEmailPage(o.month,o.year,!1,"draft",s.auditScorePercentage,la().format(Mt.analytics.MMMDDCommaYYYYformat),n??null))},onTransactionCategorizationRowClick:(e,n)=>{if(c.openTransactionPanel)return void c.openTransactionPanel(e,n);const o=H(m.state?.pathnameStackToGoBack,m.pathname);v(`../../transaction/${n}/${e}`,{state:{pathnameStackToGoBack:o,message:"expenseAutomation",origin:"transaction_categorization"}})},setLocalDataForCategoryAndClass:(e,n,o,s,C,h,f,b,z,U,N)=>{t(ca(e,n,o,s,M,C,h,f,b,z,U,N))},onCancelAutoComplete:()=>{t(ke("common"))},updateExpenseAutomationReconListScrollPosition:e=>{t(it({scrollPosition:e}))},onUpdateTab:e=>{c.closeSidePanel?.(),O!=null&&E!=null&&(t(ue(e,{start:E,end:O},!1,!1)),t(sa(e)))},onUpdateTransactionCategorizationUIState:(e,n)=>{t(Fe({selectedTab:e,uiState:n})),O!=null&&E!=null&&t(ue(e,{start:E,end:O},!1,!1,n.searchString,null,!0))},onUpdateScrollYOffSetTransactionCategorizationUIState:(e,n)=>{t(Fe({selectedTab:e,uiState:n}))},onFetchTransactionCategorizationList:(e,n,o,s,C,h,f)=>{O!=null&&E!=null&&t(ue(e,{start:E,end:O},!0,o,n,s,C,h,f))},resetTransactionCategorizationLocalData:(e,n,o,s,C,h,f,b)=>{t(oa(e,n,o,s,b??null,C,h,!1,f))},updateSelectedVendorForTransaction:(e,n,o,s,C)=>{t(lt({selectedTab:e,transactionId:n,lineId:o,selectedTransaction:s,uncategorizedAccounts:M,updatedVendor:C}))},onSaveUpdateTransactionCategorization:(e,n,o)=>{const s=m.state?.referrer;e==="autoCategorized"?j.trackTransactionsAutoCategorisedPage(k.month,k.year,g.transactionView.totalCountByTab.autoCategorized,n.length,!1,s??null):j.trackTransactionsReviewPage(k.month,k.year,g.transactionView.totalCountByTab.review,n.length,!1,s??null),t(aa(e,n,o,y))},onUpdateSelectedCheckboxTransactionIds:(e,n)=>{t(na({selectedTab:e,transactionIds:n}))},onFetchRecommendationsForEntityCategorizationWithCustomer:(e,n,o,s,C,h,f)=>{const{transactionId:b,transaction:z,lineIds:U}=n;h!=null&&t(ea({transactionId:b,customerUpdates:h})),t(ta({selectedTab:s,transactionId:b.id,lineId:U[0],selectedTransaction:z,uncategorizedAccounts:M,updatedCustomer:h,selectedEntity:C,isUncategorizedExpenseCategoryEnabled:f})),C!=null&&t(Le(C,e,n,o,!0,A,f))},onFetchRecommendationsForEntityCategorization:(e,n,o,s,C,h,f)=>{const{transactionId:b,transaction:z,lineIds:U}=n;h!=null&&(t(Qn({transactionId:b,vendorUpdates:{name:h.name,id:h.id?h.id:void 0}})),t(Wn({vendorId:h.id?h.id:void 0,localData:{vendorName:h.name,vendorId:h.id?h.id:void 0}}))),h?.id?(t(lt({selectedTab:s,transactionId:b.id,lineId:U[0],selectedTransaction:z,uncategorizedAccounts:M,updatedVendor:h,selectedEntity:C,isUncategorizedExpenseCategoryEnabled:f})),C!=null&&t(Le(C,e,n,o,!0,A,f))):t(Xn({selectedTab:s,transactionId:b.id,lineId:U[0]}))},fetchFluxViewOnScroll:(e,n)=>{t(Ee(e,!0,!1,n,!1,!0))},onFetchFluxViewList:()=>{t(Ee(k,!0,!1,null,!1,!1))},markAsReview:(e,n,o,s)=>{j.trackFluxAnalysisReviewed(o.month,o.year,s??!1,e),t(Hn(n,e,o,s??!1))},onUpdateFluxAnalysisUIState:e=>{t(Zn(e))},updateOperatingExpensesIdsForReview:e=>{t(Nn({operatingExpenseIds:e,selectedPeriod:k}))},redirectToVendorDetailPage:e=>{if(c.tenantEmailDomain!=null){const n=co(e.id,e.qboId,c.tenantEmailDomain),o=H(c.location.state?.pathnameStackToGoBack,c.location.pathname);c.navigate(n,{state:{pathnameStackToGoBack:o,message:"expenseAutomation",referrer:"Vendor List",origin:"flux_analysis"}})}},updateSectionIdsForReview:e=>{t(Yn({sectionId:e,selectedPeriod:k}))},onFetchReimbursementView:(e,n,o)=>{t(Ee(e,!0,!1,n,!0,o))},onReviewClicked:e=>{t(ae(k,e))},setOpenDrawerClicked:e=>{t(Me({selectedDrawerAccountId:e}))},onFetchLinkTokenClick:(e,n)=>{t(Pt("expense_automation_reconcile",e,n))},onEstablishConnectionClick:(e,n)=>{const o=a?.companyId;o!=null&&(t(xt(e,o,"expense_automation_reconcile",void 0,"link_account_no_microdeposit",n)),t(Rt({accountId:n,connectionInProgress:!0})))},onAddStatementClick:e=>{t(Me({selectedDrawerAccountId:e})),t(yt({accountId:e,selectedPeriod:k,localData:{accountSource:"bank_statement"}})),t(Et({statementUploadChosen:!0}))},onReloadReconciliationListPage:()=>{t(ae(k,void 0,!0,!1))},onUpdateReconcileTabLocalData:e=>{t(Kn({selectedTransactionIds:e}))},onReconTabColumnSortConfigChanged:(e,n)=>{t(Jn({sortKey:e,sortOrder:n}))},onReconReviewTabColumnSortConfigChanged:(e,n)=>{t(qn({sortKey:e,sortOrder:n}))},onReconTabUpdate:e=>{c.closeSidePanel?.(),t(Gn({selectedTab:e}))},updateReconReviewTabLocalData:(e,n,o)=>{const s=e.vendor?.id;o&&s!=null&&t(zn(s)),t($n({data:e,transactionId:n}))},onReconMatchedTransactionClick:e=>{if(c.openTransactionPanel)return void c.openTransactionPanel(e,vt("bill"));const n=H(m.state?.pathnameStackToGoBack,m.pathname);v(`../../transaction/bill/${e}`,{state:{pathnameStackToGoBack:n,message:"expenseAutomation",origin:"reconciliation"}})},onReloadPage:()=>{window.location.reload()},onBackClick:()=>{v(-1)},onReconListPageScroll:e=>{t(it({scrollPosition:e}))},onVendorAutoCompleteInputChange:e=>{e.trim().length>=2?t(ct({searchString:e,searchOrigin:"common"})):e.trim().length===0&&t(ke("common"))},onReconNodeCollapseToggled:(e,n)=>{t(Ln({nodeId:e,collapsed:n}))},updateSectionCollapseStatus:()=>{},onExcludeAccountFromReconciliation:e=>{t(ft({accountId:e}))},onIncludeAccountIntoReconciliation:e=>{t(kt({accountId:e}))}}},(t,c,x)=>{const{isMissingReceiptsBulkUploadEnabled:A,...y}=x;return function(r,m,R){return{...r,...m,...R,onUploadTransactionReceipt:(g,a,M,v,I)=>{m.onUploadTransactionReceipt(g,a,M,v,I,r.authParams)}}}(t,c,y)})(eo),vo=oo(({closeSidePanel:t,openTransactionPanel:c,panelContent:x,sidePanelIsFullView:A,sidePanelIsOpen:y})=>{const{isAiCfoOpen:r,setIsAiCfoOpen:m}=Dt(),R=It(),g=Ve(),a=he(),{isAiCfoAccessEnabled:M,onAskAiCfoClick:v}=_t({isAiCfoOpen:r,setIsAiCfoOpen:m,mobileExploreReferrer:"Transaction categorization"}),{areTenantIdsInSync:I}=Ut(),$=(()=>{const i=V(q=>je(q)),T=Ve(),{currentSelectedViewFetchState:D,currentSelectedView:B,selectedPeriod:P}=i,de=Be(B),X=Be(D.fetchState),Se=l.useCallback(q=>{const Z=T.state?.referrer;B==="transaction_categorization"&&(i.selectedTransactionCategorizationTab==="review"?j.trackTransactionsReviewPage(P.month,P.year,i.transactionView.totalCountByTab.review,0,q,Z??null):j.trackTransactionsAutoCategorisedPage(P.month,P.year,i.transactionView.totalCountByTab.autoCategorized,0,q,Z??null)),B==="missing_receipts"&&j.trackMissingReceiptsPage(P.month,P.year,q,i.missingReceipts.transactions.length,Z??null),B==="je_schedules"&&j.trackMonthCloseScheduleListPage(P.month,P.year,q,i.jeSchedules.draftSchedules.length,i.jeSchedules.resolveSchedules.length,Z??null),B==="flux_analysis"&&j.trackFluxAnalysisPage(P.month,P.year,q,fo(i.fluxAnalysis),Z??null),B==="month_end_insights"&&i.auditSummary?.auditScorePercentage!=null&&j.trackInsightsEmailPage(P.month,P.year,q,"draft",i.auditSummary.auditScorePercentage,null,Z??null)},[P,i]);return l.useEffect(()=>{X===D.fetchState&&B===de||D.fetchState!=="Completed"||Se(!1)},[B,D.fetchState,de]),Se})(),S=Ya(),[k,L]=l.useState(!1),Y=V(i=>at(i)),d=V(i=>$e(i)),[p,E]=l.useState(!1),[O,e]=l.useState(!1),[n,o]=l.useState([]),[s,C]=l.useState(void 0),[h,f]=l.useState(!1),b=l.useRef(!1),{selectedTab:z}=nt(),{tenantEmailDomain:U}=nt(),[N,oe]=l.useState(g.state?.message==="comingFromTransactionDetail"),pe=g.state?.message==="comingFromOverview",we=Na(),te=Ae.getSignedInUser(),{useDynamicConfig:G,useFeatureGate:xe}=Ot(),{configValue:jt}=G(Za.enableUncategorizedExpenseCategory),Q=jt?.uncategorized_expense_category_enabled===!0,{isFeatureEnabled:Ge}=xe(ye.isRealtimeInsightsFeatureEnabled),{isFeatureEnabled:se}=xe(ye.isMissingReceiptsBulkUploadEnabled),{isFeatureEnabled:qe}=xe(ye.isTransactionActivityEnabled),Lt=V(i=>Rn(i,"common")),_=V(i=>je(i)),{monthEndCloseChecksView:K,currentSelectedView:F,selectedPeriod:w,selectedTransactionCategorizationTab:Je,currentSelectedViewBackgroundRefreshFetchState:zt,currentSelectedViewFetchState:W,jeSchedules:Re,reconciliation:$t}=_,{selectedAccountId:ce}=$t,Ke=Be(Re.accountSettingsView.saveState.fetchState),Gt=V(i=>Pn(i.accountState,i.accountListState,"accountList")),ie=z!=null?Dn(z):F,qt=V(i=>i.entityAutoCompleteState.autoCompleteText.common);if(Vt({isDataReady:W.fetchState==="Completed"}),te==null)throw Error("Can't access expense automation screen without signing in...");const Ye=bt(w),le=be(Ye.start),re=be(Ye.end);if(le==null||re==null)throw Error(`Invalid start - ${le} and end - ${re} period from given ${w}`);const Jt=l.useCallback(()=>{E(!1)},[]),Kt=l.useCallback(()=>{e(!0)},[]),Yt=l.useCallback(i=>{o(i),e(!1)},[]),Nt=l.useCallback(()=>{o([])},[]),Pe=`private-${te.userId}`,Ne="missing-receipts-batch-completed",ge=Ha();l.useEffect(()=>{if(ge==null||F!=="missing_receipts"||se===!1)return;const i=ge.channel(Pe)??ge.subscribe(Pe),T=D=>{a(Mn({batchId:D.batch_id,progress:D.progress,status:D.status.toLowerCase()}))};return i.bind(Ne,T),()=>{i.unbind(Ne,T)}},[ge,F,Pe,a,se]);const Ce=_.missingReceipts.bulkUpload.phase,Ze=_.missingReceipts.bulkUpload.currentBatchId;l.useEffect(()=>{F==="missing_receipts"&&Ce==="matching"&&Ze!=null&&a(Tt({cacheOverride:!0}))},[F,Ce,Ze,a]);const He=te?.userId,Zt=w.month,Ht=w.year,Qe=d?.tenantId;l.useEffect(()=>{F==="missing_receipts"&&se!==!1&&Ce==="idle"&&He!=null&&Qe!=null&&a(On())},[F,se,Ce,He,Qe,Zt,Ht,a]),l.useEffect(()=>{Y.newVendorState?.vendorDetailLocalData?.vendorName!=null?L(!0):L(!1)},[Y.newVendorState?.vendorDetailLocalData?.vendorName]),l.useEffect(()=>{ie!=null&&F!==ie&&a(At(ie))},[ie]),l.useEffect(()=>{h!==!1||W.fetchState!=="Completed"&&W.fetchState!=="Error"||!I||(f(!0),a(ot(!1,!1,Q)))},[h,W,I,Q]),l.useEffect(()=>{!pe&&I&&(a(ot(!1,!1,Q)),a(ae(w,ce,!1,!1)))},[w.month,w.year,I,Q]);const We=l.useCallback((i=!1,T=!1)=>{const D={start:le,end:re};switch(F){case"transaction_categorization":a(ue(Je,D,i,!N,void 0,void 0,T,void 0,Q)),oe(!1);break;case"flux_analysis":a(Ee(w,i,T,null));break;case"month_end_insights":if(T===!1){const B=new Date(w.year,w.month,0),P=Fn(B.toDateString()).format(Mt.analytics.YYYYDashMMDashDDFormat);a(Bn(!0,d.companyId,d.tenantId,P)),a(_n(d.companyId,d.tenantId))}break;case"je_schedules":a(Un(D,T));break;case"missing_receipts":a(wt(D,{amount:75,currencyCode:"USD",currencySymbol:"$"},i,T));break;default:a(ae(w,ce,i,T))}},[F,le,re,d.companyId,d.tenantId,Je,w,ce,N,oe,Q]);l.useEffect(()=>{F===ie&&W.fetchState==="Not-Started"&&I&&We(!0)},[W,le,re,d.companyId,d.tenantId,I]),l.useEffect(()=>{pe||N||b.current||zt.fetchState==="In-Progress"||W.fetchState!=="Completed"||(b.current=!0,We(!0,!0))},[]),l.useEffect(()=>{K.fetchState!=="In-Progress"&&K.fetchState!=="Completed"&&a(me({tenantId:d.tenantId,period:w,refreshViewInBackground:!1}))},[K.fetchState,d.tenantId]),l.useEffect(()=>{_.monthEndInsights?.previewMonthEndReportStatus?.fetchState==="Completed"?E(!0):E(!1)},[_.monthEndInsights?.previewMonthEndReportStatus?.fetchState]),l.useEffect(()=>{_.monthEndInsights?.sendMonthEndReportStatus?.fetchState==="Completed"&&I&&(a(me({tenantId:d.tenantId,period:w,refreshViewInBackground:!0})),a(Vn({companyId:d.companyId})),R("../"))},[_.monthEndInsights?.sendMonthEndReportStatus?.fetchState,d.tenantId,w,d.companyId,I]),l.useEffect(()=>{const i=setInterval(()=>{K.fetchState!=="In-Progress"&&K.fetchState==="Completed"&&a(me({tenantId:d.tenantId,period:w,refreshViewInBackground:!0}))},3e5);return()=>clearInterval(i)},[K.fetchState,d.tenantId,w,a]),l.useEffect(()=>{const i=setInterval(()=>{F==="reconciliation"&&ce==null&&_.reconciliation.fetchStatus.fetchState==="Completed"&&_.reconciliation.refreshStatus.fetchState!=="In-Progress"&&a(ae(w,void 0,!0,!0))},3e5);return()=>clearInterval(i)},[F,a,_.reconciliation.fetchStatus.fetchState,_.reconciliation.refreshStatus.fetchState,ae,ce,w]);const Qt=pt();l.useEffect(()=>{const i=(K.monthEndCloseChecks?.monthEndCloseCheckList.find(T=>T.id==="month_end_insights")?.isDisabled??!1)&&!Ge;F!=="month_end_insights"||!i&&K.monthEndCloseChecks?.reportEmailSentDate==null||R("../")},[F,K.monthEndCloseChecks]);const Wt=_.reconciliation.selectedDrawerAccountId;l.useEffect(()=>{Ke==="In-Progress"&&Re.accountSettingsView.saveState.fetchState==="Completed"&&a(st())},[Ke,Re.accountSettingsView.saveState.fetchState,st]);const{transactionId:Xe,onSaveVendor:Xt,onSaveSuccess:en,onCancel:tn,vendorViewDetails:nn}=(({expenseAutomationViewSelector:i,closeDrawerHandler:T,currentSelectedView:D})=>{const B=he();let P,de,X;const Se=pt(),q=i.transactionView;let Z=()=>{};const{transactions:an,selectedTransactionId:ne,selectedTransactionLineId:Ie,transactionLocalData:on}=q;if(D==="transaction_categorization"){const De=on.find(ee=>ee.transactionId===ne),J=an.find(ee=>ee.id===ne),et=Ie!=null?De?.transactionReviewLocalData?.lineItemById[Ie]:void 0,tt=et?.account;de=et?.class?.classId,P=["Uncategorized Income","Uncategorized Expense"].includes(tt?.accountName??"")?void 0:tt?.accountId;const cn=so(ne,J?.typeOfTransaction);J!=null&&cn&&(X={id:ne,type:vt(J.typeOfTransaction)}),Z=()=>{if(ne!=null&&Ie!=null&&J!=null){const ee=q.transactionLocalData.find(fe=>fe.transactionId===ne)?.transactionReviewLocalData;if(ee!=null&&J.lines!=null&&J.lines.length>0){const fe=ee.lineItemById[Ie];let Oe=ee.selectedEntity;if(xn(J)||(Oe=fe.selectedEntityLine),Oe!=null){const ln=Oe,rn={transactionId:{id:J.id,type:J.type},transaction:J,lineIds:J.lines.map(dn=>dn.id)??[]};B(Le(ln,fe.amount.amount,rn,!1,!0,Se))}}}}}const sn=V(De=>at(De,void 0,P,de));return{transactionId:X,onSaveVendor:()=>{B(wn(X,void 0,!1,!0))},onSaveSuccess:Z,onCancel:()=>{X!=null&&B(bn({transactionId:X})),B(Tn()),B(An()),T()},vendorViewDetails:sn}})({expenseAutomationViewSelector:_,closeDrawerHandler:()=>{L(!1)},currentSelectedView:F});return we?.loggedInUserRoleMap==null?K.fetchState==="Error"?u.jsx(Qa,{onGoHome:()=>R("../",{replace:!0}),onReload:()=>window.location.reload()}):u.jsx(Bt,{fetchState:"In-Progress"}):u.jsxs(u.Fragment,{children:[u.jsx(io,{isOpen:O,drawerLeftMargin:new Wa(0,0,300,650),onClose:()=>{e(!1)},children:u.jsx(bo,{onClick:i=>i.stopPropagation(),children:u.jsx(po,{companyId:d.companyId,closeCustomerRequestDrawer:()=>e(!1),addCustomerRequest:Yt,resetCustomerRequest:Nt})})}),Xe!=null&&k&&u.jsx(ao,{isOpen:k,transactionId:Xe,onSaveVendor:Xt,onSaveSuccess:en,onCancel:tn,vendorViewDetails:nn}),u.jsx(mo,{selectedDrawerAccountId:Wt,reconciliation:_.reconciliation,onFetchLinkTokenClick:(i,T)=>{a(Pt("expense_automation_reconcile",i,T))},onEstablishConnectionClick:(i,T)=>{const D=d?.companyId;D!=null&&(a(xt(i,D,"expense_automation_reconcile",void 0,"link_account_no_microdeposit",T)),a(Rt({accountId:T,connectionInProgress:!0})))}}),qe&&u.jsx(So,{selectedTransactionId:s,onClose:()=>C(void 0)}),u.jsx(yo,{navigate:R,location:g,themeState:S,vendorSearchAutoCompleteData:{autoCompleteText:qt,entityAutoCompleteView:Lt},expenseAutomationViewSelector:_,isMissingReceiptsBulkUploadEnabled:se,monthEndInsightsPreviewMode:p,monthEndInsightsCustomerRequestData:n,isRealtimeInsightsFeatureEnabled:Ge,isUncategorizedExpenseCategoryEnabled:Q,isCOTEnabled:Qt,currentTenant:d,companyId:d.companyId,signedInUser:te,isTransactionActivityEnabled:qe,uncategorizedAccounts:Gt,onClickCustomerRequest:Kt,handleEditClick:Jt,tenantEmailDomain:U,trackExpenseAutomationTabAnalytics:$,setActivityLogTransactionId:C,closeSidePanel:t,openTransactionPanel:c,sidePanelIsOpen:y,sidePanelIsFullView:A,panelContent:x,isAiCfoAccessEnabled:M,onAskAiCfoClick:v})]})}),bo=Te(ze)`
17
17
  display: flex;
18
18
  min-height: 100%;
19
19
  flex-direction: column;
@@ -0,0 +1 @@
1
+ import{j as s}from"./liveblocks-jLbycGCP.js";import{a as r}from"./sentry-CflaePyQ.js";import{W as l,X as p,Y as f,s as m}from"./index-DGKR7P5A.js";import"./mui-BkznVaFh.js";import c from"./NotFoundScreen-Cz9quvZz.js";import{j as u,u as b}from"./core-C7cnuUop.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]="24353dce-174e-460b-b07a-514e85f03ded",e._sentryDebugIdIdentifier="sentry-dbid-24353dce-174e-460b-b07a-514e85f03ded")}catch{}})();const D=()=>{const e=u(),t=b(),a=r.useCallback(()=>{window.open("https://www.zeni.ai/demo/request","_blank")},[]),d=r.useCallback(()=>{(()=>{const n=m(t.state?.pathnameStackToGoBack),i=n.poppedPathname??k();e(i,{state:{pathnameStackToGoBack:n.newStack}})})()},[]),o=l(t.pathname);return o!=null?s.jsx(p,{menuItem:f(o),onDemoClick:a,onGoBack:d}):s.jsx(c,{})},k=(e=2)=>{let t="../";for(let a=0;a<e;a++)t=`${t}../`;return t};export{D as F};
@@ -0,0 +1,72 @@
1
+ import{j as t}from"./liveblocks-jLbycGCP.js";import{l as w,k as g,j as I,u as y,h as Y,q as ee,g as A,N as te,n as ae,o as p}from"./core-C7cnuUop.js";import{Ig as S,Ih as k,Ii as N,yC as $,yo as L,Ij as C,Ik as ne,Il as oe,ys as ie,eN as j,yz as se,yw as le}from"./zeni-epic-state-DPGmsT0c.js";import{Z as x,o as r,p as re,d as v,i as E,q as de,s as ce,v as me,w as F,a as pe,r as ue,x as he,y as ge,m as xe,B as be,R as fe,$ as we,S as ye,A as Se,C as ke,E as ve}from"./index-DGKR7P5A.js";import{n as c}from"./mui-BkznVaFh.js";import b from"./NotFoundScreen-Cz9quvZz.js";import{a as P}from"./sentry-CflaePyQ.js";import"./recharts-Dt8COHEP.js";import"./lottie-SbVYeXJk.js";import"./analytics-B_kykzhy.js";import"./plaid-DfnoQTVm.js";import"./dnd-TzLeX35A.js";import"./stripe-DMRn4zHo.js";import"./lexical-Dp9Fvoo6.js";import"./pdf-DQg4OfsP.js";import"./utils-t3ltqqZ0.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]="5b2c0816-6b9d-436c-b03b-8b9cfecdb320",e._sentryDebugIdIdentifier="sentry-dbid-5b2c0816-6b9d-436c-b03b-8b9cfecdb320")}catch{}})();const je=c.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
+ `,Ie=g(function(e){const a=S(e),n=k(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(L(i))},onSaveHandler:i=>{v.trackBillPayMagicLinkSubmitBankAccountDetails(o),e($(i,"standard",n,o))},onACHDetailsUpdated:i=>{const{bankAccountSection:l}=i;e(N({data:l}))}}})(re);function z(){const e=x(),{vendorId:a,billId:n}=w();return a==null||n==null?t.jsx(b,{}):t.jsx(t.Fragment,{children:t.jsx(je,{windowSize:e,children:t.jsx(Ie,{vendorId:a,billId:n})})})}const $e=c.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
+ `,Ce=g(function(e,a){const{isSubPage:n}=a;return{addressToEdit:C(e),googleAPIKey:E.googleMapsAPIKey,isSubPage:n}},function(e,a){const{navigate:n,location:o}=a,i=()=>{const l=ce(o.state?.pathnameStackToGoBack),s=l.poppedPathname??De();n(s,{state:{pathnameStackToGoBack:l.newStack}})};return{onSubmitHandler:l=>{const s=Ae(l);e(ne({addressToCreate:s})),i()},onCancel:()=>{i()}}})(de);function Be({isSubPage:e}){const a=I(),n=y(),o=x();return t.jsx(t.Fragment,{children:t.jsx($e,{windowSize:o,children:t.jsx(Ce,{location:n,navigate:a,isSubPage:e===!0,googleAPIKey:E.googleMapsAPIKey})})})}const De=(e=2)=>{let a="../";for(let n=0;n<e;n++)a=`${a}../`;return a},Ae=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}),Pe=c.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
+ `,ze=g(function(e){const a=S(e),n=k(e),o=C(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(L(s))},onSaveHandler:s=>{v.trackBillPayMagicLinkSubmitBankAccountDetails(l),e($(s,"us-domestic",i,l))},onWireDetailsUpdated:s=>{const{bankAccountSection:d}=s;e(N({data:d}))},onAddressClick:()=>{const s=o.pathname.replace("us-domestic","address"),d=F(o.state?.pathnameStackToGoBack,o.pathname);n(s,{state:{pathnameStackToGoBack:d}})}}})(me);function Ne(){const e=I(),a=y(),n=x(),{vendorId:o,billId:i}=w();return o==null||i==null?t.jsx(b,{}):t.jsx(t.Fragment,{children:t.jsx(Pe,{windowSize:n,children:t.jsx(ze,{location:a,navigate:e,vendorId:o,billId:i})})})}const Le=c.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
+ `,Ee=g(function(e){const a=S(e),n=k(e),o=C(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(ie(s))},onSaveHandler:s=>{v.trackBillPayMagicLinkSubmitBankAccountDetails(l),e($(s,"international",i,l,a.isLocalCurrencyEnabled))},onBankDetailsUpdated:s=>{const{internationalWireSwiftAccountSection:d}=s;e(oe({data:d}))},onAddressClick:()=>{const s=o.pathname.replace("international","address"),d=F(o.state?.pathnameStackToGoBack,o.pathname);n(s,{state:{pathnameStackToGoBack:d}})}}})(he);function Fe(){const e=I(),a=y(),n=x(),{vendorId:o,billId:i}=w(),{useFeatureGate:l}=pe(),{isFeatureEnabled:s}=l(ue.isBillPayLocalCurrencyFeatureEnabled);return o==null||i==null?t.jsx(b,{}):t.jsx(Le,{windowSize:n,children:t.jsx(Ee,{location:a,navigate:e,vendorId:o,billId:i,isLocalCurrencyEnabled:s})})}const Te={containerWidth:new ke(100,58)},Ge=c(ye)`
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
+ `,He=c.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
+ `,Me=c.div`
54
+ display: flex;
55
+ flex-direction: ${e=>e.windowSize==="small"?"column":"row"};
56
+ flex-direction: column;
57
+ width: ${e=>`${Te.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
+ `,Ve=c.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
+ `,Ke=g(function(e,a){return{file:a.file,type:a.type}})(Se);function h({appContent:e}){const a=Y(),n=y(),{tenantEmailDomain:o,vendorId:i,billId:l}=w(),[s]=ee(),d=s.get("token"),T=n.pathname.includes("address"),f=x(),G=ge(),B=xe(),H=()=>{G.toggle()},M=A(u=>S(u)),V=A(u=>k(u)),{authParams:K,fetchState:m,billAttachment:W,billFetchState:D,companyName:_,currencySymbol:U,amount:q}=M,{tenantId:O,userId:R,sessionId:J}=K,{fetchState:Z,internationalBankAccountCreateStatus:Q}=V;return P.useEffect(()=>{j(),m==="Not-Started"&&i!=null&&o!=null&&d!=null&&a(se(i,o,d))},[]),P.useEffect(()=>{m==="Completed"&&(j(R,J,O),l!=null&&a(le(l)))},[m]),m==="Error"?t.jsx(b,{}):Z==="Completed"||Q.fetchState==="Completed"?(j(),t.jsx(te,{to:"../../../../../../../bank/account/save/success",replace:!0,relative:"path"})):m==="In-Progress"?t.jsx(be,{fetchState:m,style:{height:"100vh",backgroundColor:B.colors.grey5,boxShadow:`0px 2px ${r.sp1} ${B.colors.dropShadowNormal}`}}):t.jsxs(t.Fragment,{children:[m==="Completed"&&D==="Completed"&&t.jsx(fe,{analytics:v,onLoad:u=>(X=>X.trackBillPayMagicLinkPageLoad(o??"",i??"",_,l??"",We(n.pathname),U,q))(u)}),t.jsxs(He,{windowSize:f,children:[f!=="small"?t.jsx(Ge,{onClick:H}):null,t.jsx(Ve,{windowSize:f,isAddressPage:T,children:D==="In-Progress"?t.jsx(we,{size:"ExtraLarge",start:!0}):t.jsx(Ke,{file:W,type:"bill"})}),t.jsx(Me,{windowSize:f,children:e})]})]})}const We=e=>`${e.split("/").at(-2)}_${e.split("/").at(-1)}`;function _e(){return t.jsx(ve,{})}function lt(){return t.jsxs(ae,{children:[t.jsx(p,{path:"bank/account/save/success",element:t.jsx(_e,{})}),t.jsx(p,{path:":tenantEmailDomain/vendor/:vendorId/bill/:billId/ach/standard",element:t.jsx(h,{appContent:t.jsx(z,{})})}),t.jsx(p,{path:":tenantEmailDomain/vendor/:vendorId/bill/:billId/ach/same-day",element:t.jsx(h,{appContent:t.jsx(z,{})})}),t.jsx(p,{path:":tenantEmailDomain/vendor/:vendorId/bill/:billId/wire/address",element:t.jsx(h,{appContent:t.jsx(Be,{isSubPage:!0})})}),t.jsx(p,{path:":tenantEmailDomain/vendor/:vendorId/bill/:billId/wire/us-domestic",element:t.jsx(h,{appContent:t.jsx(Ne,{})})}),t.jsx(p,{path:":tenantEmailDomain/vendor/:vendorId/bill/:billId/wire/international",element:t.jsx(h,{appContent:t.jsx(Fe,{})})}),t.jsx(p,{path:"*",element:t.jsx(b,{})})]})}export{lt as default};
@@ -0,0 +1,12 @@
1
+ import{j as u}from"./liveblocks-jLbycGCP.js";import{a as f}from"./sentry-CflaePyQ.js";import{h as U,u as _,j as w,q as M,g as l,N as T}from"./core-C7cnuUop.js";import{z as r,m as P,D as V,f as A,d as N,g as R,k as $,$ as q,h as W}from"./index-DGKR7P5A.js";import{eM as B,I0 as G,Ib as H,I1 as J,eN as K,fi as Q,I7 as X,fF as Y,cR as Z,Ic as ee,Id as te}from"./zeni-epic-state-DPGmsT0c.js";import{n as ne}from"./mui-BkznVaFh.js";import{u as ae}from"./useDeviceId-aTbWtPu7.js";import{f as se}from"./analyticsHelper-RuE4CbDL.js";import{t as ie}from"./getLocaleForTenant-BRT6_AeC.js";import"./recharts-Dt8COHEP.js";import"./lottie-SbVYeXJk.js";import"./analytics-B_kykzhy.js";import"./plaid-DfnoQTVm.js";import"./dnd-TzLeX35A.js";import"./stripe-DMRn4zHo.js";import"./lexical-Dp9Fvoo6.js";import"./pdf-DQg4OfsP.js";import"./utils-t3ltqqZ0.js";(function(){try{var t=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},s=new t.Error().stack;s&&(t._sentryDebugIds=t._sentryDebugIds||{},t._sentryDebugIds[s]="fba61cea-9eda-4fb7-be33-b001a86a5850",t._sentryDebugIdIdentifier="sentry-dbid-fba61cea-9eda-4fb7-be33-b001a86a5850")}catch{}})();const D=(t,s)=>t!=null&&t.length>0&&s==="magic_links";function De(){const t=U(),s=_(),m=w(),[k]=M(),n=k.get("token"),p=k.get("stytch_token_type"),g=r.getMagicLinkCodeVerifier(),i=ae(),{otpChallenge:d,twoFAPhoneNumber:x,magicLinkEmail:c,verifyDeviceFetchState:z,resendVerifyDeviceOTPFetchState:C}=l(e=>e.tenantState),I=l(e=>e.tenantState.fetchState),y=l(e=>e.tenantState.activeTenantFetchState.fetchState),S=l(e=>e.tenantState.signInState),h=l(e=>e.tenantState.magicLinkSignInFetchState.fetchState),a=l(e=>e.tenantState.loggedInUser),o=l(e=>B(e)),b=l(e=>G(e)),E=r.getSignedInUser(),v=P().mode;f.useEffect(()=>{a?.zeniSessionId==null&&n!=null&&D(n,p)&&i!=null&&g!=null&&(r.saveMagicLinkTriggered(n),t(H(n,i,g)))},[n,p,t,i,g,a?.zeniSessionId]),f.useEffect(()=>{S!=="In-Progress"||I!=="Completed"&&y!=="Completed"||a?.zeniSessionId==null||o==null||(n!=null&&r.saveLastUsedMagicLinkToken(n),r.saveSignedInUserWithSession(a,a.zeniSessionId),r.saveSignedInUserTenants(J(b.tenantsInOrder),a.zeniSessionId),K(a.userId,a.zeniSessionId,o.tenantId),t(Q(o.tenantId)),r.saveActiveTenantDomainForUser(o.tenantEmailDomain),t(X("Completed")),V.updateAppLocaleID(ie(o)),se(a,o,v,void 0,b.tenantsInOrder),Y().then(()=>{const e=W();e!=null&&A(e)}),setTimeout(()=>{N.trackLogin(R.Event.loginSuccess,"email",Z(o.productSettings))},2e3))},[S,I,y,a,o,b,v,s.state,t]);const F=f.useCallback(()=>{m("/signin/auth")},[m]),j=f.useCallback(()=>{i!=null&&d!=null&&c!=null&&t(ee(i,c,d))},[i,d,t,c]),O=f.useCallback(e=>{i!=null&&n!=null&&c!=null&&d!=null&&t(te(e,i,c,d))},[i,n,t,c,d]);if(h==="Completed"&&d!=null)return u.jsx($,{phoneNumber:x,verifyOtpFetchState:z.fetchState,resendVerifyDeviceOTPFetchState:C,onResendOtp:j,onVerifyOtp:O,onCancelVerifyDevice:F});if(S==="In-Progress"&&I==="Completed"&&a?.zeniSessionId!=null&&o!=null||E!=null){const e=s.state?.origin??"/";return u.jsx(T,{to:e,state:{...s.state,origin:""}})}if(!D(n,p)||g==null||h==="Error"){const e=s.state?.origin??"/",L=n!=null&&r.getLastUsedMagicLinkToken()===n;return u.jsx(T,{to:e,state:{...s.state,origin:"",magicLinkAlreadyUsed:L,magicLinkExpired:!L&&(r.isMagicLinkTriggered(n??"")||h==="Error"&&a?.zeniSessionId==null)}})}return u.jsx(oe,{"data-testid":"smooth-loader",children:u.jsx(q,{size:"ExtraLarge",start:!0})})}const oe=ne.div`
2
+ 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{De as default};
@@ -0,0 +1 @@
1
+ import{j as U}from"./liveblocks-jLbycGCP.js";import{a as c}from"./sentry-CflaePyQ.js";import{h as pe,g as a,l as He,u as Xe,j as qe,i as R}from"./core-C7cnuUop.js";import{eM as he,eU as Je,eV as Se,eO as Ke,bm as Qe,f3 as ea,eW as aa,eX as ta,eZ as na,f1 as sa,fb as oa,f2 as g,f5 as ia,f6 as ue,f9 as ra,f7 as da,f8 as la,fa as ca,cF as ua,fd as fa,cL as ma,bu as ba,eL as pa,fi as ha,fj as Sa,fh as ga}from"./zeni-epic-state-DPGmsT0c.js";import{a1 as Ea,a2 as ka,y as Ca,a as ya,z as k,a3 as Ia,u as Ta,r,a4 as wa,a5 as Fa,j as Aa,c as _a,a6 as Da,W as va,a7 as $a,a8 as Ba,a9 as fe,aa as me,L as Ma,ab as Pa,ac as be,d as x,w as F,ad as N,ae as Ra}from"./index-DGKR7P5A.js";import{D as xa}from"./mui-BkznVaFh.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]="9a007cdf-0f4f-4fc3-82c4-d05279103352",f._sentryDebugIdIdentifier="sentry-dbid-9a007cdf-0f4f-4fc3-82c4-d05279103352")}catch{}})();const Na=Ea(({isAppContentDrawerOpen:f,handleDrawerToggle:d})=>{const{tenantEmailDomain:t}=He(),n=Xe(),C=Ca(),o=qe(),V=Ke(),m=pe(),{useFeatureGate:i}=ya(),G=k.getSignedInUser(),A=Qe(G),s=a(e=>he(e)),L=a(e=>ea(e)),j=L.uiState.currentChatSessionId,y=Ia(),{setLoading:ge}=Ta(),[_,O]=c.useState(void 0),D=R("/:tenantEmailDomain/dashboard")!==null,z=R("/:tenantEmailDomain/reports")!==null,I=R("/:tenantEmailDomain/onboarding/*")!==null,{isFeatureEnabled:W}=i(r.isDepositAccountsFeatureEnabled),{isFeatureEnabled:Ee}=i(r.isChargeCardFeatureEnabled),{isFeatureEnabled:Y}=i(r.isDebitCardFeatureEnabled),ke=wa(s,Ee,Y),{isFeatureEnabled:Ce}=i(r.isSettingsFeatureEnabled),Z=a(e=>aa(e)),{isFeatureEnabled:T}=i(r.isReferralFeatureEnabled),v=a(e=>ta(e));c.useEffect(()=>{y&&T&&!I&&v.fetchState==="Not-Started"&&m(na(!0))},[y,T,v.fetchState,I]);const h=k.getSignedInUser(),$=a(e=>e.tenantState),ye=a(e=>$.fetchState==="Completed"?sa(e):[]),E=a(e=>e.expenseAutomationViewState.selectedPeriodByTenantId),{isFeatureEnabled:Ie}=i(r.isApAgingFeatureEnabled),{isFeatureEnabled:Te}=i(r.isArAgingFeatureEnabled),{isFeatureEnabled:H}=i(r.isExpenseAutomationEnabled),{isFeatureEnabled:X}=i(r.isExpenseAutomationEnabledV2),q=X||H&&A,{isFeatureEnabled:we}=i(r.isDashboardSidebarHalloweenAnimationEnabled),{isFeatureEnabled:Fe}=i(r.isDashboardSidebarThanksGivingAnimationEnabled),{isFeatureEnabled:Ae}=i(r.isDashboardSidebarChristmasAnimationEnabled),{isFeatureEnabled:_e}=i(r.isDashboardSidebarNewYearAnimationEnabled),{isFeatureEnabled:De}=i(r.isTreasuryEnabled),{isFeatureEnabled:ve}=i(r.isTaskManagerCustomerUserAccessEnabled),$e=A||!A&&ve,Be=s.company!=null&&oa(s.company),w=De&&Be,Me=a(e=>g(e).totalUnreadCount),Pe=a(e=>g(e).reducedFetchCountState),J=a(e=>g(e).notificationDetailsByTab.tasks.uiState.unreadCount),K=a(e=>g(e).notificationDetailsByTab.comments.uiState.unreadCount),Re=a(e=>g(e).notificationDetailsByTab.tasks.fetchCountState),B=a(e=>g(e).notificationDetailsByTab.comments.fetchCountState),{inboxNotifications:Q,isLoading:ee,isFetchingMore:ae,hasFetchedAll:te,fetchMore:xe}=Fa();c.useEffect(()=>{const e=setTimeout(()=>xe?.(),0);return()=>clearTimeout(e)}),c.useEffect(()=>{if(ee===!1&&ae===!1&&te===!0)if(s?.companyId!=null&&Q!=null){const e=`dashboard_${s.companyId}`;O(Q.filter(u=>u.roomId===e&&u.readAt==null).length)}else O(0)},[ee,ae,te]),c.useEffect(()=>{y&&!I&&Re.fetchState==="Not-Started"&&V.tenantId!=null&&m(ia("task_manager","dashboard"))},[y,V.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 Ne={fetchStatus:Pe,count:Me},ne=t!=null?k.getSignedInUserTenant(t):null,se=a(e=>ne?.tenantId!=null?ra(e,ne.tenantId):void 0),S=[];Ie===!1&&S.push("accounts_payable_aging"),Te===!1&&S.push("accounts_receivable_aging"),W===!1&&S.push("zeni_accounts_promo_card"),T===!1&&S.push("rewards_card"),q===!1&&S.push("expense_automation_card");const Ue=Aa(),oe=a(e=>da(e,S,h,X,H,w).fetchState),ie=a(e=>la(e).fetchState),Ve=D&&(oe==="Completed"||oe==="Error")||z&&(ie==="Completed"||ie==="Error")||!D&&!z?void 0:"disabled",Ge=c.useMemo(()=>ca(s.userRole),[s.userRole]),Le=ua(Ge),je=s?.rewardsLastViewedTime==null,Oe=h?.userEmail!=null&&Z.fetchState==="Completed"&&fa(Z.notificationSettings,h.userEmail,Y,s),re=_a(),ze=re&&Da(n),de=ma(Ue?.loggedInUserRoleMap),le=s.companyTreasuryInfo?.info?.isTreasuryTOSAccepted,M=c.useCallback(()=>w&&de&&!k.getTreasuryPopupSeen(t??"")&&le===!1&&va(n.pathname)!=="treasury",[w,de,le,n.pathname,t]),[We,ce]=c.useState(M);c.useEffect(()=>{ce(M())},[M]);const Ye=a(e=>e.treasurySetupViewState.treasuryFundsDetails).fundsDetails,Ze=$a(Ye);return U.jsx(xa,{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:U.jsx(Ba,{signedInUser:G,currentTenantId:$.currentTenantId??"",tenants:$.fetchState==="Completed"?ye:se!=null?[se]:[],currentTenant:s,isTenantDropdownDisabled:Ve,isSettings:me(n),isSettingsFeatureEnabled:Ce,isVendorsTabVisible:Le,isZeniAccountEnabled:W,isChargeCardEnabled:ke,isTreasuryEnabled:w,treasuryYieldPercentage:Ze,isTreasuryPopupVisible:We,isNotificationsTabVisible:Oe,notificationCountDetails:Ne,isExpenseAutomationEnabledForUser:q&&ba(s.userRole)===!1,selectedMenu:fe(n),rewardsConfiguration:{isRewardsTabVisible:T,isRewardsAnimated:je,rewardsPlan:v.rewardsPlan},isAiCfoAccessEnabled:re,onNotificationIconClick:()=>{d(!1);let e=J===0&&K>0?"notifications/comments":"notifications/tasks";me(n)&&(e=J===0&&K>0?"../../notifications/comments":"../../notifications/tasks");const u=F(n.state?.pathnameStackToGoBack,n.pathname);o(e,{state:{pathnameStackToGoBack:u}})},handleCockpitClick:()=>{window.open("/cockpit")},handleLogOutClick:()=>{d(!1);const e=F(n.state?.pathnameStackToGoBack,n.pathname);o("/signout",{replace:!0,state:{pathnameStackToGoBack:e,message:"logout"}})},handleMenuChange:e=>{if(d(!1),e.type==="ai_cfo"){const p=F(n.state?.pathnameStackToGoBack,n.pathname);return x.trackAICFOChatScreenStateChanged("viewed","left_menu",j??null,null),void o(`/${t}/ai-cfo/explore`,{state:{pathnameStackToGoBack:p,referrer:"Sidebar"}})}const u=F(n.state?.pathnameStackToGoBack,n.pathname),l=e.type,b=N(l)&&l!=="command_center";if(N(e.type)&&E[s.tenantId]!=null&&x.trackMonthEndCloseClicked(E[s.tenantId].month,E[s.tenantId].year,"Sidebar"),b&&E[s.tenantId]!=null){const p=E[s.tenantId];return void o(`/${t}/month_end_close_checks/review/${e.type}/${p.month}-${p.year}`,{state:{pathnameStackToGoBack:u,referrer:"Sidebar"}})}const P=Ra(e.type);be(e.type)?(j!=null&&m(ga()),o(`/${t}/ai-cfo/${e.type}`,{state:{pathnameStackToGoBack:u.slice(0,-1),referrer:"Sidebar"}})):o(`/${t}/${P}`,{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=>{ge(Ma.TENANT_SWITCHING),d(!1);const u=e.tenantEmailDomain,l=fe(n);let b=`/${encodeURIComponent(u)}/`;const P=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":P?"month_end_close_checks/review":encodeURIComponent(l),o(b,{replace:!0}),h!=null&&(m(ha(e.tenantId)),m(Sa(h.userId,e.tenantId,h.zeniSessionId)));const p=e;x.trackCompanySwitch(p.companyId,p.companyName,p.userRole)},handlePopupClose:()=>{k.saveTreasuryPopupSeen(t??"",!0),ce(!1)},onZeniLogoClick:()=>{C.toggle()},isAiCfo:ze,aiCfoView:L,isOnDashboard:D,updateCurrentChatSessionId:e=>{m(pa({sessionId:e,agentId:"controller"})),o(`/${t}/ai-cfo/${e}`)},halloweenAnimationEnabled:we,isTaskManagerAccessEnabled:$e,thanksGivingAnimationEnabled:Fe,christmasAnimationEnabled:Ae,newYearAnimationEnabled:_e})})}),za=f=>{const d=pe(),t=a(C=>he(C)),n={events:t.userRoleId!=null?[`private-${t.userRoleId}.dashboard-user-notification`]:[],eventCallback:(C,o)=>{ka(o)&&Je(o.mode)==="dashboard"&&d(Se({unreadCount:o.data.unread},"tasks"))}};return U.jsx(Na,{...f,...n})};export{za as M};
@@ -0,0 +1 @@
1
+ import{j as r}from"./liveblocks-jLbycGCP.js";import{j as e,k as i}from"./core-C7cnuUop.js";import{V as n}from"./index-DGKR7P5A.js";import"./mui-BkznVaFh.js";import"./sentry-CflaePyQ.js";import"./zeni-epic-state-DPGmsT0c.js";import"./recharts-Dt8COHEP.js";import"./lottie-SbVYeXJk.js";import"./analytics-B_kykzhy.js";import"./plaid-DfnoQTVm.js";import"./dnd-TzLeX35A.js";import"./stripe-DMRn4zHo.js";import"./lexical-Dp9Fvoo6.js";import"./pdf-DQg4OfsP.js";import"./utils-t3ltqqZ0.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]="ed306081-38cd-4ad5-93c8-51b7102c2a4f",o._sentryDebugIdIdentifier="sentry-dbid-ed306081-38cd-4ad5-93c8-51b7102c2a4f")}catch{}})();const a=i(null,function(o,t){return{onGoBack:()=>{t.navigate(-1)},onGoHome:()=>{t.navigate("/")}}})(n);function h(){const o=e();return r.jsx(a,{navigate:o})}export{h as default};
@@ -1 +1 @@
1
- import{l as dt,a as lt,m as ft,j as _}from"./liveblocks-BCZSgQbG.js";import ut from"./NotFoundScreen-0ajohMSv.js";import{a as k}from"./sentry-CGkVgbup.js";import{j as ht,u as pt,l as kt,h as gt,g as S,k as St,n as bt,o as J}from"./core-C_NeXleM.js";import{cn as It,eV as Q,eL as Z,f9 as Ct,f1 as b,Oe as H,f5 as d,eU as A,q7 as M,vg as Tt,Of as At,eT as yt,fc as Et,qc as _t,Og as $,bp as F,gw as x,qg as K,Oh as Nt,cy as Bt,cs as wt}from"./zeni-epic-state-Dp14ovRw.js";import{E as xt,z as Dt,Z as Rt,i as Ut,D as vt,cn as Gt,k as N,a1 as Pt,co as $t,a2 as Ft,p as Mt}from"./index-BaZ8-9eR.js";import"./mui-CgjVMn8C.js";import{u as jt}from"./useAskAiCfoHostNavButtonProps-Crpk73sU.js";import{c as Ot}from"./useFetchSuggestedQuestionsWhenReady-sxquM27W.js";import"./recharts-NCr2Pwd1.js";import"./lottie-BdeQlKTG.js";import"./analytics-BkhHPaQ4.js";import"./plaid-B3UNGbGB.js";import"./dnd-C0SdDgY2.js";import"./stripe-DMRn4zHo.js";import"./lexical-B1vtLf4F.js";import"./pdf-CQPNphc4.js";import"./utils-CTLGOmjC.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]="cf75796d-a457-4ed4-a2f2-055f888146d4",t._sentryDebugIdIdentifier="sentry-dbid-cf75796d-a457-4ed4-a2f2-055f888146d4")}catch{}})();const Vt=(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)})}),qt=St(function(t,l){const n=Q(t),{signedInUser:u,isDebitCardFeatureEnabled:g}=l,i=b(t),s=Z(t),{currentTab:h}=i;return{notificationView:i,isNotificationSettingsVisible:u.userEmail!=null&&Et(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:B,fetchMoreCommentsNotifications:D}=l;return{onNotificationClick:(a,o,m,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"}})}m==="unread"&&t(K("task_manager","read",[a],!1))},onCommentNotificationClick:(a,o,m)=>{const c=o.toString().split(`/${u}/`);if(c[1]!=null){m==="unread"&&(B(a),t($([a],F())));let r=`/${u}/${c[1]}`;const I=N(n.state?.pathnameStackToGoBack,n.pathname);c[1].startsWith("reimbursement")&&!Bt(g)&&(r="not-found"),c[1].startsWith("bill")&&!wt(g)&&(r="not-found"),h(r,{state:{pathnameStackToGoBack:I,message:"triggerBackClick"}})}},onUpdateNotificationViewUIState:(a,o)=>{t(A(a,o))},onUpdateNotificationTabState:(a,o)=>{t(d(a,o))},onUpdateNotificationViewCurrentTabAndSubTab:(a,o)=>{t(H(a,o));const m=`../${a}`,c=N(n.state?.pathnameStackToGoBack,n.pathname);h(m,{state:{pathnameStackToGoBack:c}})},onUpdateNotificationViewSubTab:a=>{t(Nt(a))},onFetchMoreNotifications:(a,o)=>{if(a==="tasks"){const m=[];o==="all"?m.push("read","unread"):o!=="mentions"&&m.push(o),t(M("task_manager","dashboard",m))}else D?.()},onUpdateNotificationStatus:(a,o,m,c)=>{a==="tasks"?t(K("task_manager",m,c)):(t(d({markAsReadState:{fetchState:"In-Progress",error:void 0}},"comments")),Promise.all(c.map(r=>{m==="read"&&(B(r),t($([r],F())))})).then(()=>{t(d({markAsReadState:{fetchState:"Completed",error:void 0},selectedNotificationIds:[]},"comments")),t(A({unreadCount:i-c.length>0?i-c.length:0},"comments")),t(x({messageSection:"notification_mark_as_read",messageText:"success",type:"success",showStatusIcon:!0}))},r=>{t(d({markAsReadState:{fetchState:"Error",error:r}},"comments")),t(x({messageSection:"notification_mark_as_read",messageText:"failed",type:"error",showStatusIcon:!0}))}).catch(r=>{t(d({markAsReadState:{fetchState:"Error",error:r}},"comments")),t(x({messageSection:"notification_mark_as_read",messageText:"failed",type:"error",showStatusIcon:!0}))}))},onMarkAllNotificationsAsRead:a=>{a==="tasks"?t(_t("task_manager","read")):(t(d({markAsAllReadState:{fetchState:"In-Progress",error:void 0}},"comments")),Vt(s,B).then(()=>{t($(s,F())),t(d({markAsAllReadState:{fetchState:"Completed",error:void 0}},"comments")),t(A({unreadCount:0},"comments")),t(x({messageSection:"notification_mark_as_read",messageText:"success",type:"success",showStatusIcon:!0}))}).catch(o=>{t(d({markAsAllReadState:{fetchState:"Error",error:o}},"comments")),t(x({messageSection:"notification_mark_as_read",messageText:"failed",type:"error",showStatusIcon:!0}))}))},onBackClick:()=>{const a=Mt(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}})}}})(Pt($t)),Lt=()=>{const t=ht(),l=pt(),{tenantEmailDomain:n,selectedTab:u}=kt(),{areTenantIdsInSync:g}=xt(),i=It(u??""),s=gt(),h=Dt.getSignedInUser(),[B,D]=k.useState(!1),a=S(e=>Q(e)),o=S(e=>Z(e)),{useFeatureGate:m}=Rt(),{isFeatureEnabled:c}=m(Ut.isDebitCardFeatureEnabled),{isAiCfoOpen:r,setIsAiCfoOpen:I}=vt(),{isAiCfoAccessEnabled:X,onAskAiCfoClick:Y}=jt({isAiCfoOpen:r,setIsAiCfoOpen:I,mobileExploreReferrer:"Notifications"});Ot({isDataReady:!0});const tt=Ct(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),O=S(e=>b(e).currentTab),R=S(e=>b(e).currentSubTab),et=S(e=>b(e).notificationDetailsByTab.comments.fetchCountState),U=S(e=>b(e).notificationDetailsByTab.comments.fetchState),at=S(e=>b(e).notificationDetailsByTab.comments.uiState.unreadCount),ot=S(e=>b(e).allExternalNotifications).filter(e=>e.inboxNotification.readAt==null).map(e=>e.inboxNotification.id),st=Gt().allUsers,{inboxNotifications:w,isLoading:y,hasFetchedAll:C,isFetchingMore:v,fetchMore:nt}=dt(),{threads:V,isLoading:q,fetchMore:L,isFetchingMore:W,hasFetchedAll:z}=lt({query:{metadata:{companyId:o.companyId,application:"dashboard"}}});k.useEffect(()=>{if(O!==i&&i!=null&&s(H(i)),i==null){const e=`../${O}`,p=N(l.state?.pathnameStackToGoBack,l.pathname);t(e,{state:{pathnameStackToGoBack:p}})}},[i]),k.useEffect(()=>{et.fetchState==="Not-Started"&&s(d({fetchCountState:{fetchState:"In-Progress",error:void 0}},"comments"))},[]),k.useEffect(()=>{if(y===!1&&C===!0&&o?.companyId!=null&&w!=null){const e=`dashboard_${o.companyId}`,p=w.filter(T=>T.roomId===e&&T.readAt==null).length;s(d({fetchCountState:{fetchState:"Completed",error:void 0}},"comments")),s(A({unreadCount:p},"comments"))}},[y,C]),k.useEffect(()=>{j!=="In-Progress"&&g&&s(M("task_manager","dashboard",["read","unread"]))},[g]),k.useEffect(()=>{const e=setTimeout(()=>nt?.(),0);return()=>clearTimeout(e)});const G=y||v===!0||C!==!0||y||v===!0||C!==!0;k.useEffect(()=>{G&&U!=="In-Progress"?s(d({fetchState:"In-Progress",error:void 0},"comments")):G||U!=="In-Progress"||s(d({fetchState:"Completed",error:void 0},"comments"))},[G,U]),k.useEffect(()=>{s(A({hasMore:C!==!0},"comments"))},[C]),k.useEffect(()=>{a.fetchState!=="In-Progress"&&a.fetchState!=="Completed"&&B===!1&&(D(!0),s(Tt()))},[a.fetchState]),k.useEffect(()=>{if(y===!1&&q===!1&&w!=null&&V!=null){const e=`dashboard_${o.companyId}`,p=w.filter(f=>f.roomId===e).filter(f=>f.kind==="thread"),T=p.filter(f=>f.readAt==null),E=p.map(f=>f.id),ct=p.map(f=>{const P=V.find(mt=>mt.id===f.threadId);return P!=null?{inboxNotification:{...f,threadId:P.id},thread:P}:(W||z===!0||L==null||L(),null)}).filter(f=>f!=null);s(d({allNotificationsIds:E},"comments")),s(A({totalCount:E.length,unreadCount:T.length},"comments")),s(At(ct))}},[y,v,W,C,z,q,w?.length]);const it={events:o.userRoleId!=null?[`private-${o.userRoleId}.dashboard-user-notification`]:[],eventCallback:(e,p)=>{if(Ft(p)){const T=yt(p.mode);if(T==="dashboard"&&s(A({unreadCount:p.data.unread},"tasks")),j!=="In-Progress"){const E=[];R==="all"?E.push("read","unread"):R!=="mentions"&&E.push(R),s(M("task_manager",T,E,!0))}}}},rt=ft();return _.jsx(qt,{tenantEmailDomain:n,loggedInUserRoleMap:tt,signedInUser:h,externalNotificationsUnreadCount:at,location:l,navigate:t,isDebitCardFeatureEnabled:c,users:st,markInboxNotificationAsRead:rt,allUnreadCommentsNotificationIds:ot,isAiCfoAccessEnabled:X,onAskAiCfoClick:Y,...it})};function me(){return _.jsxs(bt,{children:[_.jsx(J,{path:"/:selectedTab",element:_.jsx(Lt,{})}),_.jsx(J,{path:"*",element:_.jsx(ut,{})})]})}export{me as default};
1
+ import{l as dt,a as lt,m as ft,j as _}from"./liveblocks-jLbycGCP.js";import ut from"./NotFoundScreen-Cz9quvZz.js";import{a as k}from"./sentry-CflaePyQ.js";import{j as ht,u as pt,l as kt,h as gt,g as S,k as St,n as bt,o as L}from"./core-C7cnuUop.js";import{cn as It,eW as X,eM as H,fa as Ct,f2 as b,Op as Q,f6 as d,eV as y,q9 as F,vn as Tt,Oq as yt,eU as At,fd as Et,qe as _t,Or as M,bp as $,gy as x,qi as J,Os as Nt,cy as Bt,cs as wt}from"./zeni-epic-state-DPGmsT0c.js";import{M as xt,z as Rt,a as Ut,r as vt,K as Dt,cn as Gt,w as N,a1 as Pt,co as Mt,a2 as $t,s as Ft}from"./index-DGKR7P5A.js";import"./mui-BkznVaFh.js";import{u as jt}from"./useAskAiCfoHostNavButtonProps-BhmP_lnc.js";import{c as Ot}from"./useFetchSuggestedQuestionsWhenReady-Ex4_WTph.js";import"./recharts-Dt8COHEP.js";import"./lottie-SbVYeXJk.js";import"./analytics-B_kykzhy.js";import"./plaid-DfnoQTVm.js";import"./dnd-TzLeX35A.js";import"./stripe-DMRn4zHo.js";import"./lexical-Dp9Fvoo6.js";import"./pdf-DQg4OfsP.js";import"./utils-t3ltqqZ0.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]="8186fb96-cb75-4450-ab5a-b0d6f5269c76",t._sentryDebugIdIdentifier="sentry-dbid-8186fb96-cb75-4450-ab5a-b0d6f5269c76")}catch{}})();const Vt=(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)})}),qt=St(function(t,l){const n=X(t),{signedInUser:u,isDebitCardFeatureEnabled:g}=l,i=b(t),s=H(t),{currentTab:h}=i;return{notificationView:i,isNotificationSettingsVisible:u.userEmail!=null&&Et(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:B,fetchMoreCommentsNotifications:R}=l;return{onNotificationClick:(a,o,m,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"}})}m==="unread"&&t(J("task_manager","read",[a],!1))},onCommentNotificationClick:(a,o,m)=>{const c=o.toString().split(`/${u}/`);if(c[1]!=null){m==="unread"&&(B(a),t(M([a],$())));let r=`/${u}/${c[1]}`;const I=N(n.state?.pathnameStackToGoBack,n.pathname);c[1].startsWith("reimbursement")&&!Bt(g)&&(r="not-found"),c[1].startsWith("bill")&&!wt(g)&&(r="not-found"),h(r,{state:{pathnameStackToGoBack:I,message:"triggerBackClick"}})}},onUpdateNotificationViewUIState:(a,o)=>{t(y(a,o))},onUpdateNotificationTabState:(a,o)=>{t(d(a,o))},onUpdateNotificationViewCurrentTabAndSubTab:(a,o)=>{t(Q(a,o));const m=`../${a}`,c=N(n.state?.pathnameStackToGoBack,n.pathname);h(m,{state:{pathnameStackToGoBack:c}})},onUpdateNotificationViewSubTab:a=>{t(Nt(a))},onFetchMoreNotifications:(a,o)=>{if(a==="tasks"){const m=[];o==="all"?m.push("read","unread"):o!=="mentions"&&m.push(o),t(F("task_manager","dashboard",m))}else R?.()},onUpdateNotificationStatus:(a,o,m,c)=>{a==="tasks"?t(J("task_manager",m,c)):(t(d({markAsReadState:{fetchState:"In-Progress",error:void 0}},"comments")),Promise.all(c.map(r=>{m==="read"&&(B(r),t(M([r],$())))})).then(()=>{t(d({markAsReadState:{fetchState:"Completed",error:void 0},selectedNotificationIds:[]},"comments")),t(y({unreadCount:i-c.length>0?i-c.length:0},"comments")),t(x({messageSection:"notification_mark_as_read",messageText:"success",type:"success",showStatusIcon:!0}))},r=>{t(d({markAsReadState:{fetchState:"Error",error:r}},"comments")),t(x({messageSection:"notification_mark_as_read",messageText:"failed",type:"error",showStatusIcon:!0}))}).catch(r=>{t(d({markAsReadState:{fetchState:"Error",error:r}},"comments")),t(x({messageSection:"notification_mark_as_read",messageText:"failed",type:"error",showStatusIcon:!0}))}))},onMarkAllNotificationsAsRead:a=>{a==="tasks"?t(_t("task_manager","read")):(t(d({markAsAllReadState:{fetchState:"In-Progress",error:void 0}},"comments")),Vt(s,B).then(()=>{t(M(s,$())),t(d({markAsAllReadState:{fetchState:"Completed",error:void 0}},"comments")),t(y({unreadCount:0},"comments")),t(x({messageSection:"notification_mark_as_read",messageText:"success",type:"success",showStatusIcon:!0}))}).catch(o=>{t(d({markAsAllReadState:{fetchState:"Error",error:o}},"comments")),t(x({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}})}}})(Pt(Mt)),Wt=()=>{const t=ht(),l=pt(),{tenantEmailDomain:n,selectedTab:u}=kt(),{areTenantIdsInSync:g}=xt(),i=It(u??""),s=gt(),h=Rt.getSignedInUser(),[B,R]=k.useState(!1),a=S(e=>X(e)),o=S(e=>H(e)),{useFeatureGate:m}=Ut(),{isFeatureEnabled:c}=m(vt.isDebitCardFeatureEnabled),{isAiCfoOpen:r,setIsAiCfoOpen:I}=Dt(),{isAiCfoAccessEnabled:Y,onAskAiCfoClick:Z}=jt({isAiCfoOpen:r,setIsAiCfoOpen:I,mobileExploreReferrer:"Notifications"});Ot({isDataReady:!0});const tt=Ct(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),O=S(e=>b(e).currentTab),U=S(e=>b(e).currentSubTab),et=S(e=>b(e).notificationDetailsByTab.comments.fetchCountState),v=S(e=>b(e).notificationDetailsByTab.comments.fetchState),at=S(e=>b(e).notificationDetailsByTab.comments.uiState.unreadCount),ot=S(e=>b(e).allExternalNotifications).filter(e=>e.inboxNotification.readAt==null).map(e=>e.inboxNotification.id),st=Gt().allUsers,{inboxNotifications:w,isLoading:A,hasFetchedAll:C,isFetchingMore:D,fetchMore:nt}=dt(),{threads:V,isLoading:q,fetchMore:W,isFetchingMore:z,hasFetchedAll:K}=lt({query:{metadata:{companyId:o.companyId,application:"dashboard"}}});k.useEffect(()=>{if(O!==i&&i!=null&&s(Q(i)),i==null){const e=`../${O}`,p=N(l.state?.pathnameStackToGoBack,l.pathname);t(e,{state:{pathnameStackToGoBack:p}})}},[i]),k.useEffect(()=>{et.fetchState==="Not-Started"&&s(d({fetchCountState:{fetchState:"In-Progress",error:void 0}},"comments"))},[]),k.useEffect(()=>{if(A===!1&&C===!0&&o?.companyId!=null&&w!=null){const e=`dashboard_${o.companyId}`,p=w.filter(T=>T.roomId===e&&T.readAt==null).length;s(d({fetchCountState:{fetchState:"Completed",error:void 0}},"comments")),s(y({unreadCount:p},"comments"))}},[A,C]),k.useEffect(()=>{j!=="In-Progress"&&g&&s(F("task_manager","dashboard",["read","unread"]))},[g]),k.useEffect(()=>{const e=setTimeout(()=>nt?.(),0);return()=>clearTimeout(e)});const G=A||D===!0||C!==!0||A||D===!0||C!==!0;k.useEffect(()=>{G&&v!=="In-Progress"?s(d({fetchState:"In-Progress",error:void 0},"comments")):G||v!=="In-Progress"||s(d({fetchState:"Completed",error:void 0},"comments"))},[G,v]),k.useEffect(()=>{s(y({hasMore:C!==!0},"comments"))},[C]),k.useEffect(()=>{a.fetchState!=="In-Progress"&&a.fetchState!=="Completed"&&B===!1&&(R(!0),s(Tt()))},[a.fetchState]),k.useEffect(()=>{if(A===!1&&q===!1&&w!=null&&V!=null){const e=`dashboard_${o.companyId}`,p=w.filter(f=>f.roomId===e).filter(f=>f.kind==="thread"),T=p.filter(f=>f.readAt==null),E=p.map(f=>f.id),ct=p.map(f=>{const P=V.find(mt=>mt.id===f.threadId);return P!=null?{inboxNotification:{...f,threadId:P.id},thread:P}:(z||K===!0||W==null||W(),null)}).filter(f=>f!=null);s(d({allNotificationsIds:E},"comments")),s(y({totalCount:E.length,unreadCount:T.length},"comments")),s(yt(ct))}},[A,D,z,C,K,q,w?.length]);const it={events:o.userRoleId!=null?[`private-${o.userRoleId}.dashboard-user-notification`]:[],eventCallback:(e,p)=>{if($t(p)){const T=At(p.mode);if(T==="dashboard"&&s(y({unreadCount:p.data.unread},"tasks")),j!=="In-Progress"){const E=[];U==="all"?E.push("read","unread"):U!=="mentions"&&E.push(U),s(F("task_manager",T,E,!0))}}}},rt=ft();return _.jsx(qt,{tenantEmailDomain:n,loggedInUserRoleMap:tt,signedInUser:h,externalNotificationsUnreadCount:at,location:l,navigate:t,isDebitCardFeatureEnabled:c,users:st,markInboxNotificationAsRead:rt,allUnreadCommentsNotificationIds:ot,isAiCfoAccessEnabled:Y,onAskAiCfoClick:Z,...it})};function me(){return _.jsxs(bt,{children:[_.jsx(L,{path:"/:selectedTab",element:_.jsx(Wt,{})}),_.jsx(L,{path:"*",element:_.jsx(ut,{})})]})}export{me as default};
@@ -0,0 +1 @@
1
+ import{j as n}from"./liveblocks-jLbycGCP.js";import{j as Z,h as K,u as Q,l as J,g as d,k as X,n as ee,o as C}from"./core-C7cnuUop.js";import{eM as M,pZ as U,px as ae,IT as $,ps as S,bu as te,bm as se,bQ as oe,pt as re,IU as ne,IE as T,dF as ie,tk as ce,IV as le,tH as de,eT as me,eR as fe}from"./zeni-epic-state-DPGmsT0c.js";import{K as pe,z as ue,M as he,j as Fe,a as w,r as B,R as ge,d as G,aj as Ie,w as be}from"./index-DGKR7P5A.js";import"./mui-BkznVaFh.js";import Ce from"./NotFoundScreen-Cz9quvZz.js";import{F as Te}from"./FeaturePreviewScreen-BZdfwZgd.js";import{a as h}from"./sentry-CflaePyQ.js";import{u as Se}from"./useAskAiCfoHostNavButtonProps-BhmP_lnc.js";import{c as ye}from"./useFetchSuggestedQuestionsWhenReady-Ex4_WTph.js";import{u as Ae}from"./useInitialThreadRequest-DoYKoe1O.js";import{t as ke}from"./routePaths-BjxXYb1e.js";import{M as xe}from"./MobileAppDrawer-Q6-14poV.js";import"./recharts-Dt8COHEP.js";import"./lottie-SbVYeXJk.js";import"./analytics-B_kykzhy.js";import"./plaid-DfnoQTVm.js";import"./dnd-TzLeX35A.js";import"./stripe-DMRn4zHo.js";import"./lexical-Dp9Fvoo6.js";import"./pdf-DQg4OfsP.js";import"./utils-t3ltqqZ0.js";(function(){try{var s=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},a=new s.Error().stack;a&&(s._sentryDebugIds=s._sentryDebugIds||{},s._sentryDebugIds[a]="8dfdf5e1-ed3b-465f-a897-ed751e0e2983",s._sentryDebugIdIdentifier="sentry-dbid-8dfdf5e1-ed3b-465f-a897-ed751e0e2983")}catch{}})();const y=(s,a,e,o)=>{if(s!=a){const r=o||"";s!=null&&s.length>0?e(`../${a}${r}`,{replace:!0}):e(`${a}${r}`,{replace:!0})}},je=X(function(s){const a=ne(s),e={},o=a.pandLReportWithForecast.uiState.nodeCollapseState;return Object.keys(o).forEach(r=>{e[r]=o[r]===!1}),{selectedTimeframe:a.selectedTimeframe,isForecastVsActualOn:a.isForecastVsActualOn,compareMode:a.compareMode,forecastList:a.forecastList,selectedForecast:a.selectedForecast,pandLreport:a.pandLReportWithForecast,scrollPosition:a.pandLReportWithForecast.uiState.scrollPosition,nodeOpenStatus:e,type:"name+balances_forecast",analytics:G}},function(s,a){return{onForecastSelectionChanged:(e,o)=>{s($(e,o)),a.isPandLReportFetched(e)||s(S(e)),y(a.forecastIdFromUrlPath,e,a.navigate)},onTimeframeChanged:e=>{s(de(e))},onForecastVsActualsCompareToggle:e=>{s(le(e)),s(T({forecastId:a.forecastIdFromUrlPath,scrollPosition:{scrollLeft:0,scrollTop:0}}))},onCompareModeChanged:e=>{s(ce(a.firstMonthOfFY,e,0,[]))},onAccountBalanceClick:a.hasTransactionAccess!==!0?void 0:(e,o)=>{let r,i;const F=e.accountName===""?e.accountDescription:e.accountName;if(o.balanceTimeFrame==="month"||o.balanceTimeFrame==="quarter"?(r=o.balanceTimeFrame,i=ie(o)):o.balanceTimeFrame==="year"?(r="quarter",i={startDate:o.endDate.startOf("quarter"),endDate:o.endDate}):console.error(`timeframe ${o.balanceTimeFrame} is not supported`),i!=null&&r!=null){const f=ke(a.tenantEmailDomain,e.accountId,e.accountType,F,r,i),p=be(a.location.state?.pathnameStackToGoBack,a.location.pathname);a.navigate(f,{state:{pathnameStackToGoBack:p,referrer:"Forecast"}})}},onNodeCollapseToggled:(e,o)=>{s(T({forecastId:a.forecastIdFromUrlPath,nodeCollapseState:{nodeId:e,isCollapsed:o===!1}}))},onTableScroll:e=>{s(T({forecastId:a.forecastIdFromUrlPath,scrollPosition:e}))},onBackClick:()=>{a.navigate("../../")}}})(Ie);function v(){const{isAiCfoOpen:s,setIsAiCfoOpen:a}=pe(),e=Z(),o=K(),r=Q(),{forecastId:i,tenantEmailDomain:F}=J(),[f,p]=h.useState(!1),[g,A]=h.useState(!1),u=ue.getSignedInUser(),k=d(t=>M(t)),N=k.company?.companyInfo.firstMonthOfFY??1,c=d(t=>U(t.forecastState,t.forecastListState)),l=d(t=>t.forecastListState.fetchState==="Completed"),x=d(t=>t.profitAndLossState),j=d(t=>t.reportUIOptionsState.selectedForecast),D=t=>x.pandLByForecastID[t]!=null&&re(t,x).reducedAllFetchState.fetchState==="Completed",{areTenantIdsInSync:I}=he();ye({isDataReady:l});const{isAiCfoAccessEnabled:_,onAskAiCfoClick:q}=Se({isAiCfoOpen:s,setIsAiCfoOpen:a,mobileExploreReferrer:"Forecast"});h.useEffect(()=>{if(!f&&I)p(!0),l||o(ae());else if(l&&!g){A(!0);const t=((m,R,P)=>R!=null?m.forecasts.findIndex(b=>b.id===R):P!=null?m.forecasts.findIndex(b=>b.id===P):m.forecasts.length>0?0:-1)(c,i,j?.id);t===-1&&i!=null?e("page-not-found",{replace:!0}):t!==-1&&t!=j?.index?(o($(c.forecasts[t].id,t)),y(i,c.forecasts[t].id,e,r.search)):i==null&&t!==-1&&y(void 0,c.forecasts[t].id,e,r.search),t!==-1&&!D(c.forecasts[t].id)&&I&&o(S(c.forecasts[t].id))}},[f,p,o,l,c,g,A,U,S,I]);const E=Fe(),V=E?.loggedInUserRole!=null&&te(E.loggedInUserRole),{useFeatureGate:W}=w(),{isFeatureEnabled:L}=W(B.isReportsCommentingEnabled),Y=Ae(L?k?.companyId:void 0,{clearParams:l&&g}),[z,H]=h.useState(!1),O=t=>{H(t)};return n.jsxs(n.Fragment,{children:[l?n.jsx(ge,{analytics:G,onLoad:t=>(m=>m.trackForecast())(t)}):null,n.jsx(xe,{isAppContentDrawerOpen:z,handleDrawerToggle:O}),n.jsx(je,{firstMonthOfFY:N,tenantEmailDomain:F,forecastIdFromUrlPath:i,navigate:e,location:r,isPandLReportFetched:D,meetingUrl:oe(`https://meetings.hubspot.com/svitlana-grankovska?firstname=${u?.firstName}&lastname=${u?.lastName}&email=${u?.userEmail}`),hasTransactionAccess:V,isAiCfoAccessEnabled:_,onAskAiCfoClick:q,isReportsCommentingEnabled:L,isZeniUser:se(u),initialOpenThreadRequest:Y,onClickMenuIcon:()=>{O(!0)}})]})}function Ke(){const s=d(i=>M(i)),{useFeatureGate:a}=w(),{isFeatureEnabled:e}=a(B.isDebitCardFeatureEnabled),o=me(e,s),r=fe(s);return o===!0||r===!0?n.jsx(Te,{}):n.jsxs(ee,{children:[n.jsx(C,{path:"/",element:n.jsx(v,{})}),n.jsx(C,{path:"/:forecastId",element:n.jsx(v,{})}),n.jsx(C,{path:"/:forecastId/*",element:n.jsx(Ce,{})})]})}export{Ke as PandLWithForecastRoutes,Ke as default};
@@ -1,22 +1,22 @@
1
- import{j as s}from"./liveblocks-BCZSgQbG.js";import{ID as oe,eL as X,j6 as W,eS as J,eQ as ie,Gf as Y,Ij as re,sq as ke,IE as N,se as Pe,sz as je,st as le,si as de,sx as Te,su as Le,IF as ce,t$ as ve,IG as Fe,fw as Ae,IH as G,sn as pe,sl as ue,sC as Oe,b$ as Re}from"./zeni-epic-state-Dp14ovRw.js";import{K as me,Z as ee,i as E,z as _,a4 as ge,y as fe,af as he,ag as Ve,w as Ce,o as A,A as be,O as ye,ah as Ue,E as Ze,D as $e,q as Be,c as we,e as ze,k as Ge,ai as He,S as Ke}from"./index-BaZ8-9eR.js";import{D as Se,n as q,S as De}from"./mui-CgjVMn8C.js";import te from"./NotFoundScreen-0ajohMSv.js";import{a as l}from"./sentry-CGkVgbup.js";import{h as se,l as We,g,j as _e,u as qe,k as Me,n as ne,o as z}from"./core-C_NeXleM.js";import{u as Qe}from"./useAskAiCfoHostNavButtonProps-Crpk73sU.js";import{c as Ne}from"./useFetchSuggestedQuestionsWhenReady-sxquM27W.js";import{M as Xe}from"./MobileAppDrawer-CowqUthz.js";import"./recharts-NCr2Pwd1.js";import"./lottie-BdeQlKTG.js";import"./analytics-BkhHPaQ4.js";import"./plaid-B3UNGbGB.js";import"./dnd-C0SdDgY2.js";import"./stripe-DMRn4zHo.js";import"./lexical-B1vtLf4F.js";import"./pdf-CQPNphc4.js";import"./utils-CTLGOmjC.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]="95b24273-c6bc-4ea8-b446-7c319f2f1aa9",e._sentryDebugIdIdentifier="sentry-dbid-95b24273-c6bc-4ea8-b446-7c319f2f1aa9")}catch{}})();const Je={overlayWidth:new Ce(100,100,48)},H=ye.getLocalizedStrings().peoplePage.invitePage,Ye=({companyId:e,managersListView:n,companyPassportView:d,classListView:o,mode:f,isEditPeopleDrawerOpen:i,closeDrawerHandler:y})=>{const h=me(),u=se(),[O,R]=l.useState(!1),[k,w]=l.useState(!1),{userId:S}=We(),c=g(t=>oe(t)),m=g(t=>X(t)),D=g(t=>W(t)),{useFeatureGate:C}=ee(),{isFeatureEnabled:I}=C(E.isDebitCardFeatureEnabled),P=J(I,m),L=ie(m),v=Y(m),V=re(m),U=!!m.company?.featuresActivationInfo?.isReimbursementFeatureEnabled,x=!P&&D&&o.fetchState!=="Completed"||n.fetchState!=="Completed"||d.fetchState!=="Completed"||e==null;if(_.getSignedInUser()==null)throw Error("Can't access invite people page without signing in...");const b=()=>{u(N()),y()},F=()=>{O===!0?w(!0):b()},Z=d.companyView?.controllers?.map(t=>t.user),{isFeatureEnabled:$}=C(E.isDepositAccountsFeatureEnabled),{isFeatureEnabled:B}=C(E.isChargeCardFeatureEnabled),p=ge(m,B,I),{isFeatureEnabled:j}=C(E.isTreasuryEnabled),T={peopleDetails:c,classList:o.classes,managersList:n.users,controllersList:Z,mode:f,isZeniTenant:v,isAccountingClassesEnabled:D,isReimbursementDisabled:U===!1,isZeniAccountsDisabled:$===!1,isChargeCardDisabled:p===!1,isTreasuryDisabled:j===!1,isLiteRoleDisabled:V===!1,isBankingOnlyTenant:P,isCardsOnlyTenant:L,onResetClick:b,onDeleteUser:t=>{u(de(t.userId,t.userRole.userRoleId))},onPeopleLocalDataUpdated:t=>{u(le({peopleLocalData:t})),R(!0)},onSaveClick:()=>{u(f==="zeni_only"?Pe(e):je(v))},onCloseClick:F,isLoading:x||c.person==null},r={onOkClick:()=>{w(!1),b()},onCancelClick:()=>{w(!1)}};return l.useEffect(()=>{x===!1&&S!=null&&u(ke(S))},[x,S]),l.useEffect(()=>{c.updatePersonState.fetchState==="Completed"&&b()},[c.updatePersonState.fetchState]),s.jsx(Se,{anchor:"right",open:i,PaperProps:{style:{width:Je.overlayWidth.valuePercentage(h),boxShadow:"none"}},slotProps:{backdrop:{style:{backgroundColor:fe.overlayDark,cursor:"pointer"}}},onClose:F,children:s.jsxs(es,{onClick:t=>t.stopPropagation(),children:[k===!0?s.jsx(he,{titleComponent:s.jsx(xe,{children:H.discardTitle}),descriptionComponent:s.jsx(Ee,{children:H.discardDescription}),primaryButtonText:H.discard,secondaryButtonText:H.no,action:r,isEditPopup:!0}):null,s.jsx(Ve,{...T})]})})},es=q(De)`
1
+ import{j as s}from"./liveblocks-jLbycGCP.js";import{IO as oe,eM as q,j8 as K,eT as J,eR as ie,Gm as Y,Iq as re,ss as ke,IP as X,sg as Pe,sB as je,sv as le,sk as de,sz as Te,sw as Le,IQ as ce,u6 as ve,IR as Fe,fx as Ae,IS as G,sp as pe,sn as ue,sE as Oe,b$ as Re}from"./zeni-epic-state-DPGmsT0c.js";import{Z as me,a as ee,r as E,z as M,a4 as ge,G as fe,af as he,ag as Ve,C as Ce,o as A,H as be,D as ye,ah as Ue,M as Be,K as Ze,R as $e,d as we,g as ze,w as Ge,ai as _e,j as He}from"./index-DGKR7P5A.js";import{D as Se,n as W,S as De}from"./mui-BkznVaFh.js";import te from"./NotFoundScreen-Cz9quvZz.js";import{a as l}from"./sentry-CflaePyQ.js";import{h as se,l as Ke,g,j as Me,u as We,k as Qe,n as ne,o as z}from"./core-C7cnuUop.js";import{u as Ne}from"./useAskAiCfoHostNavButtonProps-BhmP_lnc.js";import{c as Xe}from"./useFetchSuggestedQuestionsWhenReady-Ex4_WTph.js";import{M as qe}from"./MobileAppDrawer-Q6-14poV.js";import"./recharts-Dt8COHEP.js";import"./lottie-SbVYeXJk.js";import"./analytics-B_kykzhy.js";import"./plaid-DfnoQTVm.js";import"./dnd-TzLeX35A.js";import"./stripe-DMRn4zHo.js";import"./lexical-Dp9Fvoo6.js";import"./pdf-DQg4OfsP.js";import"./utils-t3ltqqZ0.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]="1d68be1f-ad19-48f4-9570-6f03973e1687",e._sentryDebugIdIdentifier="sentry-dbid-1d68be1f-ad19-48f4-9570-6f03973e1687")}catch{}})();const Je={overlayWidth:new Ce(100,100,48)},_=ye.getLocalizedStrings().peoplePage.invitePage,Ye=({companyId:e,managersListView:n,companyPassportView:d,classListView:o,mode:f,isEditPeopleDrawerOpen:i,closeDrawerHandler:y})=>{const h=me(),u=se(),[O,R]=l.useState(!1),[k,w]=l.useState(!1),{userId:S}=Ke(),c=g(t=>oe(t)),m=g(t=>q(t)),D=g(t=>K(t)),{useFeatureGate:C}=ee(),{isFeatureEnabled:I}=C(E.isDebitCardFeatureEnabled),P=J(I,m),L=ie(m),v=Y(m),V=re(m),U=!!m.company?.featuresActivationInfo?.isReimbursementFeatureEnabled,x=!P&&D&&o.fetchState!=="Completed"||n.fetchState!=="Completed"||d.fetchState!=="Completed"||e==null;if(M.getSignedInUser()==null)throw Error("Can't access invite people page without signing in...");const b=()=>{u(X()),y()},F=()=>{O===!0?w(!0):b()},B=d.companyView?.controllers?.map(t=>t.user),{isFeatureEnabled:Z}=C(E.isDepositAccountsFeatureEnabled),{isFeatureEnabled:$}=C(E.isChargeCardFeatureEnabled),p=ge(m,$,I),{isFeatureEnabled:j}=C(E.isTreasuryEnabled),T={peopleDetails:c,classList:o.classes,managersList:n.users,controllersList:B,mode:f,isZeniTenant:v,isAccountingClassesEnabled:D,isReimbursementDisabled:U===!1,isZeniAccountsDisabled:Z===!1,isChargeCardDisabled:p===!1,isTreasuryDisabled:j===!1,isLiteRoleDisabled:V===!1,isBankingOnlyTenant:P,isCardsOnlyTenant:L,onResetClick:b,onDeleteUser:t=>{u(de(t.userId,t.userRole.userRoleId))},onPeopleLocalDataUpdated:t=>{u(le({peopleLocalData:t})),R(!0)},onSaveClick:()=>{u(f==="zeni_only"?Pe(e):je(v))},onCloseClick:F,isLoading:x||c.person==null},r={onOkClick:()=>{w(!1),b()},onCancelClick:()=>{w(!1)}};return l.useEffect(()=>{x===!1&&S!=null&&u(ke(S))},[x,S]),l.useEffect(()=>{c.updatePersonState.fetchState==="Completed"&&b()},[c.updatePersonState.fetchState]),s.jsx(Se,{anchor:"right",open:i,PaperProps:{style:{width:Je.overlayWidth.valuePercentage(h),boxShadow:"none"}},slotProps:{backdrop:{style:{backgroundColor:fe.overlayDark,cursor:"pointer"}}},onClose:F,children:s.jsxs(es,{onClick:t=>t.stopPropagation(),children:[k===!0?s.jsx(he,{titleComponent:s.jsx(xe,{children:_.discardTitle}),descriptionComponent:s.jsx(Ee,{children:_.discardDescription}),primaryButtonText:_.discard,secondaryButtonText:_.no,action:r,isEditPopup:!0}):null,s.jsx(Ve,{...T})]})})},es=W(De)`
2
2
  display: flex;
3
3
  min-height: 100%;
4
4
  flex-direction: column;
5
- `,xe=q(be.H6Regular)`
5
+ `,xe=W(be.H6Regular)`
6
6
  margin-top: ${A.sp7};
7
7
  padding-left: ${A.sp8};
8
8
  padding-right: ${A.sp8};
9
9
  color: ${e=>e.theme.colors.primary};
10
10
  word-break: break-word;
11
- `,Ee=q(be.LargeRegularSp)`
11
+ `,Ee=W(be.LargeRegularSp)`
12
12
  color: ${e=>e.theme.colors.hero};
13
13
  padding-left: ${A.sp8};
14
14
  padding-right: ${A.sp8};
15
15
  margin-bottom: 30px;
16
16
  margin-top: ${A.sp4};
17
17
  white-space: pre-line;
18
- `,ss={overlayWidth:new Ce(100,100,48)},K=ye.getLocalizedStrings().peoplePage.invitePage,as=({companyId:e,managersListView:n,companyPassportView:d,classListView:o,mode:f,isInvitePeopleDrawerOpen:i,closeDrawerHandler:y})=>{const h=me(),u=se(),[O,R]=l.useState(!1),[k,w]=l.useState(!1),S=g(r=>oe(r)),c=g(r=>X(r)),m=g(r=>W(r)),{useFeatureGate:D}=ee(),{isFeatureEnabled:C}=D(E.isDebitCardFeatureEnabled),I=J(C,c),P=ie(c),L=Y(c),v=re(c),V=!!c.company?.featuresActivationInfo?.isReimbursementFeatureEnabled,U=!I&&m&&o.fetchState!=="Completed"||n.fetchState!=="Completed"||d.fetchState!=="Completed"||e==null;if(_.getSignedInUser()==null)throw Error("Can't access invite people page without signing in...");const x=()=>{y(),u(N())},b=()=>{O===!0?w(!0):x()},F={onOkClick:()=>{w(!1),x()},onCancelClick:()=>{w(!1)}},Z=d.companyView?.controllers.map(r=>r.user),{isFeatureEnabled:$}=D(E.isDepositAccountsFeatureEnabled),{isFeatureEnabled:B}=D(E.isChargeCardFeatureEnabled),p=ge(c,B,C),{isFeatureEnabled:j}=D(E.isTreasuryEnabled),T={classList:o.classes,managersList:n.users,controllersList:Z,mode:f,isZeniTenant:L,onPeopleLocalDataUpdated:r=>{u(le({peopleLocalData:r})),R(!0)},onResetClick:x,onSaveClick:()=>{u(f==="zeni_only"?Te(e):Le())},onCloseClick:b,peopleDetails:S,isAccountingClassesEnabled:m,isReimbursementDisabled:V===!1,isLiteRoleDisabled:v===!1,isZeniAccountsDisabled:$===!1,isChargeCardDisabled:p===!1,isTreasuryDisabled:j===!1,isBankingOnlyTenant:I,isCardsOnlyTenant:P,isLoading:U};return l.useEffect(()=>{S.invitePersonState.fetchState==="Completed"&&(y(),u(N()))},[S.invitePersonState.fetchState]),s.jsx(Se,{anchor:"right",open:i,PaperProps:{style:{width:ss.overlayWidth.valuePercentage(h),boxShadow:"none"}},slotProps:{backdrop:{style:{backgroundColor:fe.overlayDark,cursor:"pointer"}}},onClose:b,children:s.jsxs(ts,{onClick:r=>r.stopPropagation(),children:[k===!0?s.jsx(he,{titleComponent:s.jsx(xe,{children:K.discardTitle}),descriptionComponent:s.jsx(Ee,{children:K.discardDescription}),primaryButtonText:K.discard,secondaryButtonText:K.no,action:F}):null,s.jsx(Ue,{...T})]})})},ts=q(De)`
18
+ `,ss={overlayWidth:new Ce(100,100,48)},H=ye.getLocalizedStrings().peoplePage.invitePage,as=({companyId:e,managersListView:n,companyPassportView:d,classListView:o,mode:f,isInvitePeopleDrawerOpen:i,closeDrawerHandler:y})=>{const h=me(),u=se(),[O,R]=l.useState(!1),[k,w]=l.useState(!1),S=g(r=>oe(r)),c=g(r=>q(r)),m=g(r=>K(r)),{useFeatureGate:D}=ee(),{isFeatureEnabled:C}=D(E.isDebitCardFeatureEnabled),I=J(C,c),P=ie(c),L=Y(c),v=re(c),V=!!c.company?.featuresActivationInfo?.isReimbursementFeatureEnabled,U=!I&&m&&o.fetchState!=="Completed"||n.fetchState!=="Completed"||d.fetchState!=="Completed"||e==null;if(M.getSignedInUser()==null)throw Error("Can't access invite people page without signing in...");const x=()=>{y(),u(X())},b=()=>{O===!0?w(!0):x()},F={onOkClick:()=>{w(!1),x()},onCancelClick:()=>{w(!1)}},B=d.companyView?.controllers.map(r=>r.user),{isFeatureEnabled:Z}=D(E.isDepositAccountsFeatureEnabled),{isFeatureEnabled:$}=D(E.isChargeCardFeatureEnabled),p=ge(c,$,C),{isFeatureEnabled:j}=D(E.isTreasuryEnabled),T={classList:o.classes,managersList:n.users,controllersList:B,mode:f,isZeniTenant:L,onPeopleLocalDataUpdated:r=>{u(le({peopleLocalData:r})),R(!0)},onResetClick:x,onSaveClick:()=>{u(f==="zeni_only"?Te(e):Le())},onCloseClick:b,peopleDetails:S,isAccountingClassesEnabled:m,isReimbursementDisabled:V===!1,isLiteRoleDisabled:v===!1,isZeniAccountsDisabled:Z===!1,isChargeCardDisabled:p===!1,isTreasuryDisabled:j===!1,isBankingOnlyTenant:I,isCardsOnlyTenant:P,isLoading:U};return l.useEffect(()=>{S.invitePersonState.fetchState==="Completed"&&(y(),u(X()))},[S.invitePersonState.fetchState]),s.jsx(Se,{anchor:"right",open:i,PaperProps:{style:{width:ss.overlayWidth.valuePercentage(h),boxShadow:"none"}},slotProps:{backdrop:{style:{backgroundColor:fe.overlayDark,cursor:"pointer"}}},onClose:b,children:s.jsxs(ts,{onClick:r=>r.stopPropagation(),children:[k===!0?s.jsx(he,{titleComponent:s.jsx(xe,{children:H.discardTitle}),descriptionComponent:s.jsx(Ee,{children:H.discardDescription}),primaryButtonText:H.discard,secondaryButtonText:H.no,action:F}):null,s.jsx(Ue,{...T})]})})},ts=W(De)`
19
19
  display: flex;
20
20
  min-height: 100%;
21
21
  flex-direction: column;
22
- `,ns=Me(function(e,n){const d=ce(e),o=_.getSignedInUser();return{data:d,loggedinUserId:o?.userId??"",isZeniTenant:n.isZeniTenant===!0,shouldFetchClasses:n.shouldFetchClasses,isZeniAdminUser:o?.userEmailDomain==="zeni.ai"&&n.isZeni===!0,isAccountingClassesEnabled:W(e),analytics:we}},function(e,n){const{navigate:d,companyId:o,shouldFetchClasses:f}=n;return{personAction:{onPersonDelete:(i,y)=>{e(de(i,y))},onResendInvite:i=>{e(Oe(i))},onReloadPeople:()=>{e(pe()),e(ue(o,f))},onBackClick:()=>{d("../../")},onModeChange:i=>{e(G({mode:i,searchText:"",sortKey:"name",sortOrder:"ascending"}))},onSearchTextChanged:i=>{e(G({searchText:i}))}}}})(He);function Q({isInvitePeopleDrawerOpen:e,isEditPeopleDrawerOpen:n}){const d=_e(),o=se(),f=qe(),{areTenantIdsInSync:i}=Ze(),y=_.getSignedInUser(),h=g(a=>X(a)),{useFeatureGate:u}=ee(),{isFeatureEnabled:O}=u(E.isDebitCardFeatureEnabled),R=g(a=>W(a)),k=!J(O,h)&&R,w=Y(h),S=h?.tenantId,{tenantEmailDomain:c}=h,[m,D]=l.useState(!1),[C,I]=l.useState(!1),[P,L]=l.useState(!1),[v,V]=l.useState("off"),[U,x]=l.useState(!1),b=a=>{x(a)},{isAiCfoOpen:F,setIsAiCfoOpen:Z}=$e(),{isAiCfoAccessEnabled:$,onAskAiCfoClick:B}=Qe({isAiCfoOpen:F,setIsAiCfoOpen:Z,mobileExploreReferrer:"People"}),p=g(a=>ce(a));Ne({isDataReady:p.fetchState==="Completed"});const j=g(a=>ve(a.classState,a.classListState)),T=g(a=>Fe(a.userState,a.userRoleState,a.userListViewState,"manager")),r=g(a=>Ae(a)),t=h?.companyId;l.useEffect(()=>{m&&v===p.uiState.mode||!i||(o(G({searchText:"",sortKey:"name",sortOrder:"ascending"})),V(p.uiState.mode),D(!0),o(pe()))},[m,y,S,o,p.uiState.mode,i]),l.useEffect(()=>{t!=null&&i&&o(ue(t,k))},[t,k,i]),l.useEffect(()=>{I(e!=null&&e===!0),L(n!=null&&n===!0&&n)},[e,n]),l.useEffect(()=>{o(G({searchText:"",sortKey:"name",sortOrder:"ascending"}))},[]);const ae=()=>{I(!1),L(!1),d("../")};return s.jsxs(s.Fragment,{children:[p.fetchState==="Completed"?s.jsx(Be,{analytics:we,onLoad:a=>a.trackPageLoaded(ze.Event.members)}):null,C===!0?s.jsx(as,{closeDrawerHandler:ae,isInvitePeopleDrawerOpen:C,managersListView:T,companyPassportView:r,classListView:j,companyId:t,mode:p.uiState.mode}):null,P===!0?s.jsx(Ye,{closeDrawerHandler:ae,isEditPeopleDrawerOpen:P,managersListView:T,companyPassportView:r,classListView:j,companyId:t,mode:p.uiState.mode}):null,s.jsx(Xe,{isAppContentDrawerOpen:U,handleDrawerToggle:b}),s.jsx(ns,{navigate:d,signedInUser:y,isZeni:h.isZeni,isZeniTenant:w,peopleUIState:p.uiState,companyId:t,shouldFetchClasses:k,classList:j,managersView:T,peopleView:p,onInvitePeopleClick:()=>{d("./new")},onColumnSortConfigChanged:(a,M)=>{o(G({sortKey:a,sortOrder:M}))},onRowClick:a=>{const M=`/${c}/people/${encodeURIComponent(a)}/edit`,Ie=Ge(f.state?.pathnameStackToGoBack,f.pathname);d(M,{state:{pathnameStackToGoBack:Ie}})},onClickMenuIcon:()=>{b(!0)},isAiCfoAccessEnabled:$,onAskAiCfoClick:B})]})}function Es(){const e=Ke();return Re(e?.loggedInUserRole??[])?s.jsxs(ne,{children:[s.jsx(z,{path:"/",element:s.jsx(Q,{})}),s.jsx(z,{path:"new",element:s.jsx(Q,{isInvitePeopleDrawerOpen:!0})}),s.jsx(z,{path:":userId/edit",element:s.jsx(Q,{isEditPeopleDrawerOpen:!0})}),s.jsx(z,{path:"*",element:s.jsx(te,{})})]}):s.jsx(ne,{children:s.jsx(z,{path:"*",element:s.jsx(te,{})})})}export{Es as default};
22
+ `,ns=Qe(function(e,n){const d=ce(e),o=M.getSignedInUser();return{data:d,loggedinUserId:o?.userId??"",isZeniTenant:n.isZeniTenant===!0,shouldFetchClasses:n.shouldFetchClasses,isZeniAdminUser:o?.userEmailDomain==="zeni.ai"&&n.isZeni===!0,isAccountingClassesEnabled:K(e),analytics:we}},function(e,n){const{navigate:d,companyId:o,shouldFetchClasses:f}=n;return{personAction:{onPersonDelete:(i,y)=>{e(de(i,y))},onResendInvite:i=>{e(Oe(i))},onReloadPeople:()=>{e(pe()),e(ue(o,f))},onBackClick:()=>{d("../../")},onModeChange:i=>{e(G({mode:i,searchText:"",sortKey:"name",sortOrder:"ascending"}))},onSearchTextChanged:i=>{e(G({searchText:i}))}}}})(_e);function N({isInvitePeopleDrawerOpen:e,isEditPeopleDrawerOpen:n}){const d=Me(),o=se(),f=We(),{areTenantIdsInSync:i}=Be(),y=M.getSignedInUser(),h=g(a=>q(a)),{useFeatureGate:u}=ee(),{isFeatureEnabled:O}=u(E.isDebitCardFeatureEnabled),R=g(a=>K(a)),k=!J(O,h)&&R,w=Y(h),S=h?.tenantId,{tenantEmailDomain:c}=h,[m,D]=l.useState(!1),[C,I]=l.useState(!1),[P,L]=l.useState(!1),[v,V]=l.useState("off"),[U,x]=l.useState(!1),b=a=>{x(a)},{isAiCfoOpen:F,setIsAiCfoOpen:B}=Ze(),{isAiCfoAccessEnabled:Z,onAskAiCfoClick:$}=Ne({isAiCfoOpen:F,setIsAiCfoOpen:B,mobileExploreReferrer:"People"}),p=g(a=>ce(a));Xe({isDataReady:p.fetchState==="Completed"});const j=g(a=>ve(a.classState,a.classListState)),T=g(a=>Fe(a.userState,a.userRoleState,a.userListViewState,"manager")),r=g(a=>Ae(a)),t=h?.companyId;l.useEffect(()=>{m&&v===p.uiState.mode||!i||(o(G({searchText:"",sortKey:"name",sortOrder:"ascending"})),V(p.uiState.mode),D(!0),o(pe()))},[m,y,S,o,p.uiState.mode,i]),l.useEffect(()=>{t!=null&&i&&o(ue(t,k))},[t,k,i]),l.useEffect(()=>{I(e!=null&&e===!0),L(n!=null&&n===!0&&n)},[e,n]),l.useEffect(()=>{o(G({searchText:"",sortKey:"name",sortOrder:"ascending"}))},[]);const ae=()=>{I(!1),L(!1),d("../")};return s.jsxs(s.Fragment,{children:[p.fetchState==="Completed"?s.jsx($e,{analytics:we,onLoad:a=>a.trackPageLoaded(ze.Event.members)}):null,C===!0?s.jsx(as,{closeDrawerHandler:ae,isInvitePeopleDrawerOpen:C,managersListView:T,companyPassportView:r,classListView:j,companyId:t,mode:p.uiState.mode}):null,P===!0?s.jsx(Ye,{closeDrawerHandler:ae,isEditPeopleDrawerOpen:P,managersListView:T,companyPassportView:r,classListView:j,companyId:t,mode:p.uiState.mode}):null,s.jsx(qe,{isAppContentDrawerOpen:U,handleDrawerToggle:b}),s.jsx(ns,{navigate:d,signedInUser:y,isZeni:h.isZeni,isZeniTenant:w,peopleUIState:p.uiState,companyId:t,shouldFetchClasses:k,classList:j,managersView:T,peopleView:p,onInvitePeopleClick:()=>{d("./new")},onColumnSortConfigChanged:(a,Q)=>{o(G({sortKey:a,sortOrder:Q}))},onRowClick:a=>{const Q=`/${c}/people/${encodeURIComponent(a)}/edit`,Ie=Ge(f.state?.pathnameStackToGoBack,f.pathname);d(Q,{state:{pathnameStackToGoBack:Ie}})},onClickMenuIcon:()=>{b(!0)},isAiCfoAccessEnabled:Z,onAskAiCfoClick:$})]})}function Es(){const e=He();return Re(e?.loggedInUserRole??[])?s.jsxs(ne,{children:[s.jsx(z,{path:"/",element:s.jsx(N,{})}),s.jsx(z,{path:"new",element:s.jsx(N,{isInvitePeopleDrawerOpen:!0})}),s.jsx(z,{path:":userId/edit",element:s.jsx(N,{isEditPeopleDrawerOpen:!0})}),s.jsx(z,{path:"*",element:s.jsx(te,{})})]}):s.jsx(ne,{children:s.jsx(z,{path:"*",element:s.jsx(te,{})})})}export{Es as default};
@@ -0,0 +1 @@
1
+ import{j as n}from"./liveblocks-jLbycGCP.js";import _ from"./NotFoundScreen-Cz9quvZz.js";import{a as r}from"./sentry-CflaePyQ.js";import{j as M,u as v,g as u,l as U,h as P,N as z,k as V,n as B,o as h}from"./core-C7cnuUop.js";import{eM as F,Ot as b,bn as N,bm as Q,gQ as H,gy as K}from"./zeni-epic-state-DPGmsT0c.js";import{y as $,z as I,K as q,cp as G}from"./index-DGKR7P5A.js";import"./mui-BkznVaFh.js";import{u as J}from"./useAskAiCfoHostNavButtonProps-BhmP_lnc.js";import{c as L}from"./useFetchSuggestedQuestionsWhenReady-Ex4_WTph.js";import{M as W}from"./MobileAppDrawer-Q6-14poV.js";import"./recharts-Dt8COHEP.js";import"./lottie-SbVYeXJk.js";import"./analytics-B_kykzhy.js";import"./plaid-DfnoQTVm.js";import"./dnd-TzLeX35A.js";import"./stripe-DMRn4zHo.js";import"./lexical-Dp9Fvoo6.js";import"./pdf-DQg4OfsP.js";import"./utils-t3ltqqZ0.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]="97673fc3-8c52-4c62-beed-18535b9ef2f4",e._sentryDebugIdIdentifier="sentry-dbid-97673fc3-8c52-4c62-beed-18535b9ef2f4")}catch{}})();const X=V(function(e){const t=I.getSignedInUser(),c=e.tenantState.currentTenantId,o={userId:t?.userId??"",sessionId:t?.zeniSessionId??"",tenantId:c??""},{aggregatedReportViewState:a}=b(e);return{authParams:o,isDisabled:!1,loggedInUser:t,aggregatedReport:a}},function(e,t){return{onBackClick:()=>{t.navigate("../../")},onClickMenuIcon:()=>{t.handleDrawerToggle(!0)}}})(G),Y=()=>{const e=M(),t=v(),c=$(),o=u(s=>F(s)),{aggregatedReportViewState:a}=u(s=>b(s)),{tenantEmailDomain:m}=U(),p=P(),d=I.getSignedInUser();if(d==null)throw new Error("Can't access this page without signing in...");const f=r.useRef(!1),[C,S]=r.useState(!1),k=N(o?.userRole??[]),w=o?.userRole?.includes("bookkeeping_admin")??!1,y=Q(d),A=k||w||y,l=r.useCallback((s,i,O)=>{p(H({fromMonth:s,toMonth:i,cacheOverride:O}))},[]);r.useEffect(()=>{a?.fetchState==="Completed"&&f.current&&(p(K({messageSection:"data_refresh_update",messageText:"success",type:"success",showStatusIcon:!0})),f.current=!1)},[a?.fetchState]);const D=r.useCallback((s,i)=>{a!=null&&a?.fetchState==="In-Progress"||l(s,i,!0),f.current=!0},[a?.fetchState,l]),x=r.useCallback((s,i)=>{l(s,i,!1)},[l]),g=s=>{S(s)},{isAiCfoOpen:j,setIsAiCfoOpen:R}=q(),{isAiCfoAccessEnabled:T,onAskAiCfoClick:E}=J({isAiCfoOpen:j,setIsAiCfoOpen:R,mobileExploreReferrer:"Performance"});return L({isDataReady:a?.fetchState==="Completed"}),A?n.jsxs(n.Fragment,{children:[n.jsx(W,{isAppContentDrawerOpen:C,handleDrawerToggle:g}),n.jsx(X,{navigate:e,location:t,themeState:c,currentTenant:o,signedInUser:d,tenantEmailDomain:m,onReload:D,onTimeRangeSelect:x,handleDrawerToggle:g,isAiCfoAccessEnabled:T,onAskAiCfoClick:E})]}):n.jsx(z,{to:`/${m}/dashboard`,replace:!0})};function Ie(){return n.jsxs(B,{children:[n.jsx(h,{path:"*",element:n.jsx(Y,{})}),n.jsx(h,{path:"*",element:n.jsx(_,{})})]})}export{Ie as default};
@@ -1 +1 @@
1
- import{a as h,b as t}from"./sentry-CGkVgbup.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-CflaePyQ.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};