@zeniai/web-app-ui 5.0.4-qa → 5.0.5-qa

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (115) hide show
  1. package/dist/assets/AddressRoutes-Dg5wTso4.js +1 -0
  2. package/dist/assets/AddressScreen-BmUTIXDQ.js +9 -0
  3. package/dist/assets/{AiCfoScreen-Kvtx3Xyr.js → AiCfoScreen-DOESDB_y.js} +3 -3
  4. package/dist/assets/{BillPayApprovalRoutes-Bce2PKiZ.js → BillPayApprovalRoutes-Devc75aa.js} +1 -1
  5. package/dist/assets/{BillPayRoutes-D4Wpltfc.js → BillPayRoutes-CVZSwrXO.js} +1 -1
  6. package/dist/assets/{BusinessVerificationPageScreen-BzT0Br17.js → BusinessVerificationPageScreen-rlQFJbcN.js} +2 -2
  7. package/dist/assets/{ChargeCardRoutes-B-HBeT1t.js → ChargeCardRoutes-DhwHiThG.js} +7 -7
  8. package/dist/assets/CompanyPassportScreen-OV_RlgTD.js +1 -0
  9. package/dist/assets/{ConnectionAuthScreen-QHwbF_Uw.js → ConnectionAuthScreen-CXSm9A3K.js} +1 -1
  10. package/dist/assets/CustomerOnboardingAuthScreen-kIRiytnK.js +1 -0
  11. package/dist/assets/{CustomerOnboardingRoutes-DRg-_iI1.js → CustomerOnboardingRoutes-VbVi0pO3.js} +4 -4
  12. package/dist/assets/{DashboardRoutes-C5DuqZ6R.js → DashboardRoutes-Djz9fKJS.js} +3 -3
  13. package/dist/assets/{DefaultTenantHome-ClGqvTjF.js → DefaultTenantHome-xquI5mdg.js} +1 -1
  14. package/dist/assets/{DomesticWireDetailScreen-q-hFgbFk.js → DomesticWireDetailScreen-BPKqOjuc.js} +3 -3
  15. package/dist/assets/DrawerScreen-BAinUAiT.js +1 -0
  16. package/dist/assets/{EntityDetailRoutes-CpNcXosz.js → EntityDetailRoutes-C426Mprw.js} +1 -1
  17. package/dist/assets/{ExpenseAutomationRoutes-CtdDByWK.js → ExpenseAutomationRoutes-BLZeM7AE.js} +3 -3
  18. package/dist/assets/FeaturePreviewScreen-BOGEp7mZ.js +1 -0
  19. package/dist/assets/MagicLinkRoutes-CFl_3geL.js +72 -0
  20. package/dist/assets/MagicLinkSignInScreen-BDCry5qq.js +12 -0
  21. package/dist/assets/{MobileAppDrawer-CsdMhFJr.js → MobileAppDrawer-DkCKi5Fn.js} +1 -1
  22. package/dist/assets/NotFoundScreen-DPOmbROX.js +1 -0
  23. package/dist/assets/{NotificationRoutes-CNUla0jE.js → NotificationRoutes-DZhNQVLE.js} +1 -1
  24. package/dist/assets/{PandLWithForecastRoutes-DSNi4CwZ.js → PandLWithForecastRoutes-DSOuY0Sq.js} +1 -1
  25. package/dist/assets/PeopleRoutes-DJ5vAQLD.js +22 -0
  26. package/dist/assets/PerformanceRoutes-B6wY-7PG.js +1 -0
  27. package/dist/assets/{Preview-RTK9mHhj.js → Preview-MGBTnTFX.js} +1 -1
  28. package/dist/assets/{QBOConnectionScreen-DnaZNR9B.js → QBOConnectionScreen-CaGgw5Mo.js} +1 -1
  29. package/dist/assets/{ReferralListScreen-COJ8CJ4s.js → ReferralListScreen-mDnpbI4k.js} +2 -2
  30. package/dist/assets/{ReimbursementApprovalRoutes-Ce8RPOLr.js → ReimbursementApprovalRoutes-CiEDO6E-.js} +1 -1
  31. package/dist/assets/{ReimbursementApprovalRuleDetailScreen-17tczsj8.js → ReimbursementApprovalRuleDetailScreen-B4m_Prkq.js} +1 -1
  32. package/dist/assets/{ReimbursementRoutes-8orYdLJd.js → ReimbursementRoutes-DvqIKhWH.js} +8 -8
  33. package/dist/assets/{ReportsRoutes-rC2lgByJ.js → ReportsRoutes-B55Mm_bZ.js} +1 -1
  34. package/dist/assets/RewardsRoutes-D3siXOf6.js +1 -0
  35. package/dist/assets/ScreenRoutes-CR4LbxNH.js +2 -0
  36. package/dist/assets/{SettingsRoutes-BsPgWJjI.js → SettingsRoutes-BAZtLZO7.js} +7 -7
  37. package/dist/assets/{SetupPagesScreen-ShvnD8Ca.js → SetupPagesScreen-Ck1fJ-gD.js} +1 -1
  38. package/dist/assets/SignInScreen-BGmMngZm.js +1 -0
  39. package/dist/assets/{SignOutScreen-BZ0olTAR.js → SignOutScreen-B7Ls3yjH.js} +1 -1
  40. package/dist/assets/{TaskListScreen-BsYZ1ihe.js → TaskListScreen-C_FkV4uq.js} +2 -2
  41. package/dist/assets/{TaskRoutes-DZfLeG7y.js → TaskRoutes-DubqoBe-.js} +2 -2
  42. package/dist/assets/TransactionDetailRoutes-BLrzFmca.js +1 -0
  43. package/dist/assets/{TransactionDetailScreen-BNLko4LJ.js → TransactionDetailScreen-Dq4Bv7Yw.js} +2 -2
  44. package/dist/assets/{TransactionListRoutes-DegsYX8P.js → TransactionListRoutes-C4fPXh7s.js} +1 -1
  45. package/dist/assets/{TreasuryRoutes-hCvdyDtP.js → TreasuryRoutes-CMZcHv3V.js} +6 -6
  46. package/dist/assets/{VendorsRoutes-D641MF3C.js → VendorsRoutes-BlU_E8-4.js} +19 -19
  47. package/dist/assets/WiseConfirmationScreen-DcnsS_39.js +12 -0
  48. package/dist/assets/{ZeniAccountRoutes-BCE80xK9.js → ZeniAccountRoutes-C1H652qU.js} +11 -11
  49. package/dist/assets/{ZeniAccountStatementScreen-BaA6R46a.js → ZeniAccountStatementScreen-BUk4IFgX.js} +1 -1
  50. package/dist/assets/{accountMappingHelper-BvCdqdBq.js → accountMappingHelper-QKMWvJHt.js} +1 -1
  51. package/dist/assets/{analytics-Cp5F-UjF.js → analytics-vyykHm3I.js} +1 -1
  52. package/dist/assets/{analyticsHelper-C2tOKorI.js → analyticsHelper-UdYvDCQO.js} +1 -1
  53. package/dist/assets/{core-DZE88rLA.js → core-a8i-_0Kh.js} +1 -1
  54. package/dist/assets/{decodeURIComponentSafe--utjO_hD.js → decodeURIComponentSafe-B_IVipCF.js} +1 -1
  55. package/dist/assets/{dnd-B4DEM2bW.js → dnd-CDdU3ON0.js} +1 -1
  56. package/dist/assets/{empty-DTOnM0RR.js → empty-9qzWTKUd.js} +1 -1
  57. package/dist/assets/{empty-CRf4YhY4.js → empty-wLiJa_AW.js} +1 -1
  58. package/dist/assets/{emptyVideoElement-BgQif9Ia.js → emptyVideoElement-CLFouTmB.js} +1 -1
  59. package/dist/assets/{epic-BzOmBklW.js → epic-CvkQWhDA.js} +1 -1
  60. package/dist/assets/getLocaleForTenant-B5XIMdPl.js +1 -0
  61. package/dist/assets/{index-DpHHAj1V.js → index-BgPY0rlK.js} +1 -1
  62. package/dist/assets/{index-DqxsObld.js → index-CtIv1cPm.js} +10412 -10401
  63. package/dist/assets/{index-j9ZiGcsv.js → index-DTPu_Uy6.js} +1 -1
  64. package/dist/assets/{index-CofKdFHU.js → index-DYi-byqV.js} +2 -2
  65. package/dist/assets/{index-ChZJ__M2.js → index-DfNhtpOm.js} +1 -1
  66. package/dist/assets/{index-BWIeQAsg.js → index-DvmHdckU.js} +1 -1
  67. package/dist/assets/{index-CTObQYXg.js → index-HUopGLCJ.js} +1 -1
  68. package/dist/assets/{lexical-Bp_BNV6r.js → lexical-BzneVI9m.js} +1 -1
  69. package/dist/assets/{liveblocks-Cqbf2YvG.js → liveblocks-ZAKgWoPK.js} +1 -1
  70. package/dist/assets/{lottie-BMcMDJUW.js → lottie-DN0gYkdx.js} +1 -1
  71. package/dist/assets/{mui-B4xUUoCx.js → mui-B8yatdty.js} +1 -1
  72. package/dist/assets/{pathToGoBack-H4XoSP95.js → pathToGoBack-EHg1lj9D.js} +1 -1
  73. package/dist/assets/{pdf-DYKlsr3c.js → pdf-C4rebPwh.js} +3 -3
  74. package/dist/assets/{pdf-lib-vymaIDnW.js → pdf-lib-OiZx9iEf.js} +1 -1
  75. package/dist/assets/{plaid-G98kqTnM.js → plaid-CP3hLhCR.js} +1 -1
  76. package/dist/assets/{pusher-D7P3EdsP.js → pusher-BCOUDezq.js} +1 -1
  77. package/dist/assets/{react-CLdnK8kQ.js → react-B7vOmlcy.js} +1 -1
  78. package/dist/assets/{react-CuhJdsIn.js → react-BEOXxta6.js} +1 -1
  79. package/dist/assets/{react-BmZ57NU9.js → react-C3aQn_52.js} +1 -1
  80. package/dist/assets/{react-BEWrpOF5.js → react-DHgntsyD.js} +1 -1
  81. package/dist/assets/{react-4qgRGAdN.js → react-DWmQOvam.js} +1 -1
  82. package/dist/assets/{react-Bhe_slJS.js → react-DqZkiZdy.js} +1 -1
  83. package/dist/assets/{recharts-3_XOsuaw.js → recharts-BhJEeZEG.js} +1 -1
  84. package/dist/assets/{routePaths-DJEpoMwA.js → routePaths-CAPvhOau.js} +1 -1
  85. package/dist/assets/{sentry-gLPXz4Yq.js → sentry-Bp45iw9z.js} +1 -1
  86. package/dist/assets/{url-DpALAoIG.js → url-DV9yGLNd.js} +1 -1
  87. package/dist/assets/{url-DMg8GQjt.js → url-asQ2Q_hT.js} +1 -1
  88. package/dist/assets/useAskAiCfoHostNavButtonProps-D6kPXOEr.js +1 -0
  89. package/dist/assets/{useDeviceId-CMDzs7Gm.js → useDeviceId-AHvFaHki.js} +1 -1
  90. package/dist/assets/useFetchSuggestedQuestionsWhenReady-D_w411d6.js +1 -0
  91. package/dist/assets/{useInitialThreadRequest-ygpkiG-5.js → useInitialThreadRequest-BTSPvXZ7.js} +1 -1
  92. package/dist/assets/{utils-oW6HiHsc.js → utils-ikosPjSL.js} +1 -1
  93. package/dist/assets/{withTransactionSidePanel-CLLk25cZ.js → withTransactionSidePanel-BRNXRpXy.js} +2 -2
  94. package/dist/assets/{zeni-epic-state-Cc2P4FPR.js → zeni-epic-state-ZCc1K30S.js} +3 -3
  95. package/dist/index.html +1 -1
  96. package/package.json +2 -2
  97. package/dist/assets/AddressRoutes-C6duofPI.js +0 -1
  98. package/dist/assets/AddressScreen-RGWhb-cU.js +0 -9
  99. package/dist/assets/CompanyPassportScreen-jPMAeL-J.js +0 -1
  100. package/dist/assets/CustomerOnboardingAuthScreen-BE_wanQk.js +0 -1
  101. package/dist/assets/DrawerScreen-i-nqt9Ur.js +0 -1
  102. package/dist/assets/FeaturePreviewScreen-CyaqKlwB.js +0 -1
  103. package/dist/assets/MagicLinkRoutes-CqDltyuO.js +0 -72
  104. package/dist/assets/MagicLinkSignInScreen-CSAghaTT.js +0 -12
  105. package/dist/assets/NotFoundScreen-D77qAkFD.js +0 -1
  106. package/dist/assets/PeopleRoutes-BPUcJmHG.js +0 -22
  107. package/dist/assets/PerformanceRoutes-BuWUENRk.js +0 -1
  108. package/dist/assets/RewardsRoutes-Hm7xyFon.js +0 -1
  109. package/dist/assets/ScreenRoutes-BYzbuVxS.js +0 -2
  110. package/dist/assets/SignInScreen-C4-mnusc.js +0 -1
  111. package/dist/assets/TransactionDetailRoutes-5j8MS9Ix.js +0 -1
  112. package/dist/assets/WiseConfirmationScreen-IbbfMyLa.js +0 -12
  113. package/dist/assets/getLocaleForTenant-BvypS8xJ.js +0 -1
  114. package/dist/assets/useAskAiCfoHostNavButtonProps-BZUsoX5k.js +0 -1
  115. package/dist/assets/useFetchSuggestedQuestionsWhenReady-Dg4k8UUU.js +0 -1
@@ -1,4 +1,4 @@
1
- import{j as u}from"./liveblocks-Cqbf2YvG.js";import un from"./NotFoundScreen-D77qAkFD.js";import{a as l}from"./sentry-gLPXz4Yq.js";import{n as Te,D as St,S as ze}from"./mui-B4xUUoCx.js";import{h as he,j as It,u as Ve,g as V,l as nt,k as mn,n as hn,o as Ue}from"./core-DZE88rLA.js";import{eM as $e,Ou as pn,f0 as me,fe as gn,pR as Cn,Ov as je,mu as ft,mA as kt,Ow as Et,mZ as Sn,Ox as yt,mn as In,pn as fn,Oy as kn,jk as En,Oz as yn,Fj as vn,eY as Me,p2 as vt,Kc as at,Ke as bn,jb as Tn,Kf as An,ji as wn,cT as xn,sT as Le,J3 as Rn,jj as Pn,e_ as Dn,mB as bt,n2 as be,nZ as Tt,ow as On,e$ as At,n1 as ot,ms as ae,n4 as wt,n6 as Un,bB as Fn,kH as Bn,kE as _n,n5 as Ee,n3 as ue,OA as Vn,nm as st,A$ as xt,OB as Rt,rQ as Pt,os as jn,j8 as Mn,OC as Ln,J5 as ct,J4 as ke,OD as it,jz as zn,OE as $n,OF as Gn,OG as qn,OH as Jn,mK as Kn,OI as Yn,OJ as Nn,OK as Hn,nc as Zn,jm as Qn,jd as Wn,OL as Xn,jl as lt,Km as ea,OM as ta,ON as na,o_ as aa,oF as oa,oE as Fe,OO as sa,OP as ca,kS as ia,bp as la,kN as rt,kz as ra,OQ as da,gy as dt,fL as ua,kK as ma,uM as ha,OR as pa,nD as ga,ny as Ca,nC as Sa,nn as Ia,OS as fa,mS as ka,mH as Ea,ff as ut,n7 as ya,OT as va,OU as ba,OV as Ta,OW as Aa,OX as wa,OY as mt,pa as xa,on as Ra,o6 as ht,of as Pa,o2 as Da,ot as Oa,o7 as Ua,OZ as Fa,O_ as Ba,nM as _a,O$ as Va,nK as ja,nL as Ma,nI as La,oh as za}from"./zeni-epic-state-Cc2P4FPR.js";import{F as Dt,a as Ot,i as ye,d as M,r as Z,H as Ut,cq as $a,m as Ft,z as Ae,cr as Ga,ao as ve,cs as qa,B as Bt,ct as Ja,cu as Ka,al as Be,v as Ya,j as Na,aI as Ha,cv as Za,aZ as Qa,x as Wa,D as Xa,cw as eo,Q as to,cx as no}from"./index-DqxsObld.js";import{u as _t}from"./useAskAiCfoHostNavButtonProps-BZUsoX5k.js";import{c as Vt}from"./useFetchSuggestedQuestionsWhenReady-Dg4k8UUU.js";import{c as pt,C as ao}from"./TransactionDetailScreen-BNLko4LJ.js";import{w as oo}from"./withTransactionSidePanel-CLLk25cZ.js";import{h as so,v as co}from"./routePaths-DJEpoMwA.js";import{g as _e}from"./accountMappingHelper-BvCdqdBq.js";import{D as io}from"./DrawerScreen-i-nqt9Ur.js";import"./recharts-3_XOsuaw.js";import"./lottie-BMcMDJUW.js";import"./analytics-Cp5F-UjF.js";import"./plaid-G98kqTnM.js";import"./dnd-B4DEM2bW.js";import"./stripe-DMRn4zHo.js";import"./lexical-Bp_BNV6r.js";import"./pdf-DYKlsr3c.js";import"./utils-oW6HiHsc.js";import"./decodeURIComponentSafe--utjO_hD.js";(function(){try{var t=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},c=new t.Error().stack;c&&(t._sentryDebugIds=t._sentryDebugIds||{},t._sentryDebugIds[c]="73d10d2c-ed30-459e-9661-7244217b655b",t._sentryDebugIdIdentifier="sentry-dbid-73d10d2c-ed30-459e-9661-7244217b655b")}catch{}})();const lo=()=>{const{isAiCfoOpen:t,setIsAiCfoOpen:c}=Dt(),x=he(),A=It(),y=Ve(),r=V(p=>$e(p)),{useFeatureGate:m}=Ot(),{isFeatureEnabled:R}=m(ye.isRealtimeInsightsFeatureEnabled),g=V(p=>p.expenseAutomationViewState.selectedPeriodByTenantId),a=V(p=>pn(p,r.tenantId)),{isAiCfoAccessEnabled:j,onAskAiCfoClick:v}=_t({isAiCfoOpen:t,setIsAiCfoOpen:c,mobileExploreReferrer:"Month-End Close Overview"}),I=l.useCallback((p,E,O=!1)=>{x(me({tenantId:E,period:{month:p.month,year:p.year},refreshViewInBackground:O}))},[]),$=l.useCallback(p=>{const E=y.state?.referrer;a.monthEndCloseChecks?.auditSummary!=null&&M.trackMonthCloseAuditPage(p.month,p.year,a.monthEndCloseChecks.reportEmailSentDate!=null?"closed":"in-review",a.monthEndCloseChecks.auditSummary.auditScorePercentage,!1,E??null),x(gn(r.tenantId,p))},[r.tenantId,a.monthEndCloseChecks?.auditSummary,a.monthEndCloseChecks?.reportEmailSentDate]),S=g[r.tenantId],k=l.useCallback(()=>{const p=y.state?.referrer;a.monthEndCloseChecks?.auditSummary!=null&&M.trackMonthCloseAuditPage(S.month,S.year,a.monthEndCloseChecks.reportEmailSentDate!=null?"closed":"in-review",a.monthEndCloseChecks.auditSummary.auditScorePercentage,!0,p??null),I(S,r.tenantId,!0)},[I,S,r.tenantId,a.monthEndCloseChecks?.auditSummary,a.monthEndCloseChecks?.reportEmailSentDate]),L=Z(y.state?.pathnameStackToGoBack,y.pathname),Y=l.useCallback(()=>{if(a.monthEndCloseChecks!=null&&S!=null){const p=a.monthEndCloseChecks.monthEndCloseCheckList.find(E=>E.progress<100);if(p!=null)return void A(`./${p.id}/${S.month}-${S.year}`,{state:{pathnameStackToGoBack:L,message:"comingFromOverview"}});A(`./month_end_insights/${S.month}-${S.year}`,{state:{pathnameStackToGoBack:L,message:"comingFromOverview"}})}},[a.monthEndCloseChecks,S]),{areTenantIdsInSync:d}=Ut();return Vt({isDataReady:a.fetchState==="Completed"}),l.useEffect(()=>{S!=null&&a.fetchState!=="In-Progress"&&a.fetchState!=="Completed"&&d&&I(S,r.tenantId)},[I,S,a.fetchState,r.tenantId,d]),l.useEffect(()=>{S!=null&&a.monthClosePerformanceTrendFetchStatus.fetchState!=="In-Progress"&&a.monthClosePerformanceTrendFetchStatus.fetchState!=="Completed"&&d&&x(Cn(S))},[S,a.monthClosePerformanceTrendFetchStatus.fetchState,d]),l.useEffect(()=>{const p=setInterval(()=>{a.fetchState!=="In-Progress"&&a.fetchState==="Completed"&&k()},3e5);return()=>clearInterval(p)},[a.fetchState]),l.useEffect(()=>{if(a.fetchState==="Completed"&&a.monthEndCloseChecks?.auditSummary!=null){const p=y.state?.referrer;M.trackMonthCloseAuditPage(a.selectedPeriod.month,a.selectedPeriod.year,a.monthEndCloseChecks.reportEmailSentDate!=null?"closed":"in-review",a.monthEndCloseChecks.auditSummary.auditScorePercentage,!1,p??null)}},[a.fetchState,a.selectedPeriod,a.monthEndCloseChecks?.auditSummary,a.monthEndCloseChecks?.reportEmailSentDate]),u.jsx(ro,{children:u.jsx($a,{monthEndCloseChecksView:a,isRealtimeInsightsFeatureEnabled:R,onMonthEndCheckClick:p=>{A(`./${p}/${S.month}-${S.year}`,{state:{pathnameStackToGoBack:L,message:"comingFromOverview",referrer:"Expense Automation - Overview"}})},onPeriodChange:$,handleReviewButtonClick:Y,onBackClick:()=>{A("../../dashboard")},onReload:k,isAiCfoAccessEnabled:j,onAskAiCfoClick:v})})},ro=Te.div`
1
+ import{j as u}from"./liveblocks-ZAKgWoPK.js";import un from"./NotFoundScreen-DPOmbROX.js";import{a as l}from"./sentry-Bp45iw9z.js";import{n as Te,D as St,S as ze}from"./mui-B8yatdty.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-a8i-_0Kh.js";import{eM as $e,Ou as pn,f0 as me,fe as gn,pR as Cn,Ov as je,mu as ft,mA as kt,Ow as Et,mZ as Sn,Ox as yt,mn as In,pn as fn,Oy as kn,jk as En,Oz as yn,Fj as vn,eY as Me,p2 as vt,Kc as at,Ke as bn,jb as Tn,Kf as An,ji as wn,cT as xn,sT as Le,J3 as Rn,jj as Pn,e_ as Dn,mB as bt,n2 as be,nZ as Tt,ow as On,e$ as At,n1 as ot,ms as ae,n4 as wt,n6 as Un,bB as Fn,kH as Bn,kE as _n,n5 as Ee,n3 as ue,OA as Vn,nm as st,A$ as xt,OB as Rt,rQ as Pt,os as jn,j8 as Mn,OC as Ln,J5 as ct,J4 as ke,OD as it,jz as zn,OE as $n,OF as Gn,OG as qn,OH as Jn,mK as Kn,OI as Yn,OJ as Nn,OK as 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 ja,nL as Ma,nI as La,oh as za}from"./zeni-epic-state-ZCc1K30S.js";import{I as Dt,a as Ot,i as ye,d as M,q as H,J 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,Q as Ya,j as Na,aI as Za,cv as Ha,aZ as Qa,w as Wa,D as Xa,cw as eo,O as to,cx as no}from"./index-CtIv1cPm.js";import{u as _t}from"./useAskAiCfoHostNavButtonProps-D6kPXOEr.js";import{c as Vt}from"./useFetchSuggestedQuestionsWhenReady-D_w411d6.js";import{c as pt,C as ao}from"./TransactionDetailScreen-Dq4Bv7Yw.js";import{w as oo}from"./withTransactionSidePanel-BRNXRpXy.js";import{h as so,v as co}from"./routePaths-CAPvhOau.js";import{g as _e}from"./accountMappingHelper-QKMWvJHt.js";import{D as io}from"./DrawerScreen-BAinUAiT.js";import"./recharts-BhJEeZEG.js";import"./lottie-DN0gYkdx.js";import"./analytics-vyykHm3I.js";import"./plaid-CP3hLhCR.js";import"./dnd-CDdU3ON0.js";import"./stripe-DMRn4zHo.js";import"./lexical-BzneVI9m.js";import"./pdf-C4rebPwh.js";import"./utils-ikosPjSL.js";import"./decodeURIComponentSafe-B_IVipCF.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]="02fbb218-cea8-4953-86b6-7563eb85452e",t._sentryDebugIdIdentifier="sentry-dbid-02fbb218-cea8-4953-86b6-7563eb85452e")}catch{}})();const lo=()=>{const{isAiCfoOpen:t,setIsAiCfoOpen:c}=Dt(),x=he(),A=It(),y=Ve(),r=V(p=>$e(p)),{useFeatureGate:m}=Ot(),{isFeatureEnabled:R}=m(ye.isRealtimeInsightsFeatureEnabled),g=V(p=>p.expenseAutomationViewState.selectedPeriodByTenantId),a=V(p=>pn(p,r.tenantId)),{isAiCfoAccessEnabled:j,onAskAiCfoClick:v}=_t({isAiCfoOpen:t,setIsAiCfoOpen:c,mobileExploreReferrer:"Month-End Close Overview"}),I=l.useCallback((p,E,O=!1)=>{x(me({tenantId:E,period:{month:p.month,year:p.year},refreshViewInBackground:O}))},[]),$=l.useCallback(p=>{const E=y.state?.referrer;a.monthEndCloseChecks?.auditSummary!=null&&M.trackMonthCloseAuditPage(p.month,p.year,a.monthEndCloseChecks.reportEmailSentDate!=null?"closed":"in-review",a.monthEndCloseChecks.auditSummary.auditScorePercentage,!1,E??null),x(gn(r.tenantId,p))},[r.tenantId,a.monthEndCloseChecks?.auditSummary,a.monthEndCloseChecks?.reportEmailSentDate]),S=g[r.tenantId],k=l.useCallback(()=>{const p=y.state?.referrer;a.monthEndCloseChecks?.auditSummary!=null&&M.trackMonthCloseAuditPage(S.month,S.year,a.monthEndCloseChecks.reportEmailSentDate!=null?"closed":"in-review",a.monthEndCloseChecks.auditSummary.auditScorePercentage,!0,p??null),I(S,r.tenantId,!0)},[I,S,r.tenantId,a.monthEndCloseChecks?.auditSummary,a.monthEndCloseChecks?.reportEmailSentDate]),L=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;M.trackMonthCloseAuditPage(a.selectedPeriod.month,a.selectedPeriod.year,a.monthEndCloseChecks.reportEmailSentDate!=null?"closed":"in-review",a.monthEndCloseChecks.auditSummary.auditScorePercentage,!1,p??null)}},[a.fetchState,a.selectedPeriod,a.monthEndCloseChecks?.auditSummary,a.monthEndCloseChecks?.reportEmailSentDate]),u.jsx(ro,{children:u.jsx($a,{monthEndCloseChecksView:a,isRealtimeInsightsFeatureEnabled:R,onMonthEndCheckClick:p=>{A(`./${p}/${S.month}-${S.year}`,{state:{pathnameStackToGoBack:L,message:"comingFromOverview",referrer:"Expense Automation - Overview"}})},onPeriodChange:$,handleReviewButtonClick:Y,onBackClick:()=>{A("../../dashboard")},onReload:k,isAiCfoAccessEnabled:j,onAskAiCfoClick:v})})},ro=Te.div`
2
2
  display: flex;
3
3
  height: 100vh;
4
4
  width: 100%;
@@ -13,8 +13,8 @@ import{j as u}from"./liveblocks-Cqbf2YvG.js";import un from"./NotFoundScreen-D77
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:A,monthEndInsightsCustomerRequestData:y,monthEndInsightsPreviewMode:r,companyId:m,isMissingReceiptsBulkUploadEnabled:R,isTransactionActivityEnabled:g}=c,a=Ae.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: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:Mn(t)}},function(t,c){const{themeState:x,isCOTEnabled:A,isUncategorizedExpenseCategoryEnabled:y,isMissingReceiptsBulkUploadEnabled:r,location:m,vendorSearchAutoCompleteData:R,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(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=Z(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(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(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=Z(m.state?.pathnameStackToGoBack,m.pathname);v(`../${e}/${n.month}-${n.year}`,{state:{pathnameStackToGoBack:o,referrer:g.currentSelectedView}}),t(At(e))},handleLogOutClick:()=>{const e=Z(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=Z(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=Z(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,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:j,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)=>{M.trackFluxAnalysisReviewed(o.month,o.year,s??!1,e),t(Zn(n,e,o,s??!1))},onUpdateFluxAnalysisUIState:e=>{t(Hn(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=Z(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(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(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=Z(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,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:A,sidePanelIsOpen:y})=>{const{isAiCfoOpen:r,setIsAiCfoOpen:m}=Dt(),R=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)),T=Ve(),{currentSelectedViewFetchState:D,currentSelectedView:B,selectedPeriod:P}=i,de=Be(B),X=Be(D.fetchState),Se=l.useCallback(q=>{const H=T.state?.referrer;B==="transaction_categorization"&&(i.selectedTransactionCategorizationTab==="review"?M.trackTransactionsReviewPage(P.month,P.year,i.transactionView.totalCountByTab.review,0,q,H??null):M.trackTransactionsAutoCategorisedPage(P.month,P.year,i.transactionView.totalCountByTab.autoCategorized,0,q,H??null)),B==="missing_receipts"&&M.trackMissingReceiptsPage(P.month,P.year,q,i.missingReceipts.transactions.length,H??null),B==="je_schedules"&&M.trackMonthCloseScheduleListPage(P.month,P.year,q,i.jeSchedules.draftSchedules.length,i.jeSchedules.resolveSchedules.length,H??null),B==="flux_analysis"&&M.trackFluxAnalysisPage(P.month,P.year,q,fo(i.fluxAnalysis),H??null),B==="month_end_insights"&&i.auditSummary?.auditScorePercentage!=null&&M.trackInsightsEmailPage(P.month,P.year,q,"draft",i.auditSummary.auditScorePercentage,null,H??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:Mt}=G(Ha.enableUncategorizedExpenseCategory),Q=Mt?.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=>Me(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=Za();l.useEffect(()=>{if(ge==null||F!=="missing_receipts"||se===!1)return;const i=ge.channel(Pe)??ge.subscribe(Pe),T=D=>{a(jn({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,He=_.missingReceipts.bulkUpload.currentBatchId;l.useEffect(()=>{F==="missing_receipts"&&Ce==="matching"&&He!=null&&a(Tt({cacheOverride:!0}))},[F,Ce,He,a]);const Ze=te?.userId,Ht=w.month,Zt=w.year,Qe=d?.tenantId;l.useEffect(()=>{F==="missing_receipts"&&se!==!1&&Ce==="idle"&&Ze!=null&&Qe!=null&&a(On())},[F,se,Ce,Ze,Qe,Ht,Zt,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(jt.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 H=()=>{};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)}),H=()=>{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:H,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:j,onAskAiCfoClick:v})]})}),bo=Te(ze)`
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:A,monthEndInsightsCustomerRequestData:y,monthEndInsightsPreviewMode:r,companyId:m,isMissingReceiptsBulkUploadEnabled:R,isTransactionActivityEnabled:g}=c,a=Ae.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: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:Mn(t)}},function(t,c){const{themeState:x,isCOTEnabled:A,isUncategorizedExpenseCategoryEnabled:y,isMissingReceiptsBulkUploadEnabled:r,location:m,vendorSearchAutoCompleteData:R,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(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(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(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)),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=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,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,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:j,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)=>{M.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(je({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(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=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,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:A,sidePanelIsOpen:y})=>{const{isAiCfoOpen:r,setIsAiCfoOpen:m}=Dt(),R=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)),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"?M.trackTransactionsReviewPage(P.month,P.year,i.transactionView.totalCountByTab.review,0,q,Z??null):M.trackTransactionsAutoCategorisedPage(P.month,P.year,i.transactionView.totalCountByTab.autoCategorized,0,q,Z??null)),B==="missing_receipts"&&M.trackMissingReceiptsPage(P.month,P.year,q,i.missingReceipts.transactions.length,Z??null),B==="je_schedules"&&M.trackMonthCloseScheduleListPage(P.month,P.year,q,i.jeSchedules.draftSchedules.length,i.jeSchedules.resolveSchedules.length,Z??null),B==="flux_analysis"&&M.trackFluxAnalysisPage(P.month,P.year,q,fo(i.fluxAnalysis),Z??null),B==="month_end_insights"&&i.auditSummary?.auditScorePercentage!=null&&M.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:Mt}=G(Za.enableUncategorizedExpenseCategory),Q=Mt?.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=>Me(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(jn({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(jt.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:j,onAskAiCfoClick:v})]})}),bo=Te(ze)`
17
17
  display: flex;
18
18
  min-height: 100%;
19
19
  flex-direction: column;
20
- `;function Ho(){return u.jsxs(hn,{children:[u.jsx(Ue,{path:"*",element:u.jsx(lo,{})}),u.jsx(Ue,{path:"/:selectedTab/:selectedPeriod/*",element:u.jsx(vo,{})}),u.jsx(Ue,{path:"*",element:u.jsx(un,{})})]})}export{Ho as default};
20
+ `;function Zo(){return u.jsxs(hn,{children:[u.jsx(Ue,{path:"*",element:u.jsx(lo,{})}),u.jsx(Ue,{path:"/:selectedTab/:selectedPeriod/*",element:u.jsx(vo,{})}),u.jsx(Ue,{path:"*",element:u.jsx(un,{})})]})}export{Zo as default};
@@ -0,0 +1 @@
1
+ import{j as s}from"./liveblocks-ZAKgWoPK.js";import{a as r}from"./sentry-Bp45iw9z.js";import{V as c,X as d,Y as l,p}from"./index-CtIv1cPm.js";import"./mui-B8yatdty.js";import m from"./NotFoundScreen-DPOmbROX.js";import{j as u,u as b}from"./core-a8i-_0Kh.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]="eaf11e13-591f-4afe-82bb-7c7fc7a5da21",e._sentryDebugIdIdentifier="sentry-dbid-eaf11e13-591f-4afe-82bb-7c7fc7a5da21")}catch{}})();const D=()=>{const e=u(),a=b(),t=r.useCallback(()=>{window.open("https://www.zeni.ai/demo/request","_blank")},[]),f=r.useCallback(()=>{(()=>{const n=p(a.state?.pathnameStackToGoBack),i=n.poppedPathname??k();e(i,{state:{pathnameStackToGoBack:n.newStack}})})()},[]),o=c(a.pathname);return o!=null?s.jsx(d,{menuItem:l(o),onDemoClick:t,onGoBack:f}):s.jsx(m,{})},k=(e=2)=>{let a="../";for(let t=0;t<e;t++)a=`${a}../`;return a};export{D as F};
@@ -0,0 +1,72 @@
1
+ import{j as t}from"./liveblocks-ZAKgWoPK.js";import{l as b,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-a8i-_0Kh.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-ZCc1K30S.js";import{Z as x,o as r,x as re,d as v,h as E,W as de,p as ce,y as me,q as F,a as pe,i as ue,C as he,Q as ge,m as xe,B as fe,v as we,$ as be,S as ye,M as Se,w as ke,A as ve}from"./index-CtIv1cPm.js";import{n as c}from"./mui-B8yatdty.js";import f from"./NotFoundScreen-DPOmbROX.js";import{a as P}from"./sentry-Bp45iw9z.js";import"./recharts-BhJEeZEG.js";import"./lottie-DN0gYkdx.js";import"./analytics-vyykHm3I.js";import"./plaid-CP3hLhCR.js";import"./dnd-CDdU3ON0.js";import"./stripe-DMRn4zHo.js";import"./lexical-BzneVI9m.js";import"./pdf-C4rebPwh.js";import"./utils-ikosPjSL.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]="b05961b4-e56b-4edf-9566-28f47ce155af",e._sentryDebugIdIdentifier="sentry-dbid-b05961b4-e56b-4edf-9566-28f47ce155af")}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}=b();return a==null||n==null?t.jsx(f,{}):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}=b();return o==null||i==null?t.jsx(f,{}):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}=b(),{useFeatureGate:l}=pe(),{isFeatureEnabled:s}=l(ue.isBillPayLocalCurrencyFeatureEnabled);return o==null||i==null?t.jsx(f,{}):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
+ `,Me=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
+ `,He=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
+ `,We=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}=b(),[s]=ee(),d=s.get("token"),T=n.pathname.includes("address"),w=x(),G=ge(),B=xe(),M=()=>{G.toggle()},H=A(u=>S(u)),V=A(u=>k(u)),{authParams:W,fetchState:m,billAttachment:K,billFetchState:D,companyName:_,currencySymbol:U,amount:q}=H,{tenantId:O,userId:Q,sessionId:J}=W,{fetchState:Z,internationalBankAccountCreateStatus:R}=V;return P.useEffect(()=>{j(),m==="Not-Started"&&i!=null&&o!=null&&d!=null&&a(se(i,o,d))},[]),P.useEffect(()=>{m==="Completed"&&(j(Q,J,O),l!=null&&a(le(l)))},[m]),m==="Error"?t.jsx(f,{}):Z==="Completed"||R.fetchState==="Completed"?(j(),t.jsx(te,{to:"../../../../../../../bank/account/save/success",replace:!0,relative:"path"})):m==="In-Progress"?t.jsx(fe,{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(we,{analytics:v,onLoad:u=>(X=>X.trackBillPayMagicLinkPageLoad(o??"",i??"",_,l??"",Ke(n.pathname),U,q))(u)}),t.jsxs(Me,{windowSize:w,children:[w!=="small"?t.jsx(Ge,{onClick:M}):null,t.jsx(Ve,{windowSize:w,isAddressPage:T,children:D==="In-Progress"?t.jsx(be,{size:"ExtraLarge",start:!0}):t.jsx(We,{file:K,type:"bill"})}),t.jsx(He,{windowSize:w,children:e})]})]})}const Ke=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(f,{})})]})}export{lt as default};
@@ -0,0 +1,12 @@
1
+ import{j as u}from"./liveblocks-ZAKgWoPK.js";import{a as f}from"./sentry-Bp45iw9z.js";import{h as U,u as _,j as w,q as M,g as l,N as T}from"./core-a8i-_0Kh.js";import{z as r,m as P,D as V,e as A,d as N,f as R,s as $,$ as q,g as W}from"./index-CtIv1cPm.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-ZCc1K30S.js";import{n as ne}from"./mui-B8yatdty.js";import{u as se}from"./useDeviceId-AHvFaHki.js";import{f as ae}from"./analyticsHelper-UdYvDCQO.js";import{t as ie}from"./getLocaleForTenant-B5XIMdPl.js";import"./recharts-BhJEeZEG.js";import"./lottie-DN0gYkdx.js";import"./analytics-vyykHm3I.js";import"./plaid-CP3hLhCR.js";import"./dnd-CDdU3ON0.js";import"./stripe-DMRn4zHo.js";import"./lexical-BzneVI9m.js";import"./pdf-C4rebPwh.js";import"./utils-ikosPjSL.js";(function(){try{var t=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},a=new t.Error().stack;a&&(t._sentryDebugIds=t._sentryDebugIds||{},t._sentryDebugIds[a]="a56af1ff-d798-4cd2-9533-c65c1665dc5d",t._sentryDebugIdIdentifier="sentry-dbid-a56af1ff-d798-4cd2-9533-c65c1665dc5d")}catch{}})();const D=(t,a)=>t!=null&&t.length>0&&a==="magic_links";function De(){const t=U(),a=_(),m=w(),[y]=M(),n=y.get("token"),p=y.get("stytch_token_type"),g=r.getMagicLinkCodeVerifier(),i=se(),{otpChallenge:d,twoFAPhoneNumber:x,magicLinkEmail:c,verifyDeviceFetchState:z,resendVerifyDeviceOTPFetchState:C}=l(e=>e.tenantState),I=l(e=>e.tenantState.fetchState),b=l(e=>e.tenantState.activeTenantFetchState.fetchState),S=l(e=>e.tenantState.signInState),h=l(e=>e.tenantState.magicLinkSignInFetchState.fetchState),s=l(e=>e.tenantState.loggedInUser),o=l(e=>B(e)),k=l(e=>G(e)),E=r.getSignedInUser(),v=P().mode;f.useEffect(()=>{s?.zeniSessionId==null&&n!=null&&D(n,p)&&i!=null&&g!=null&&(r.saveMagicLinkTriggered(n),t(H(n,i,g)))},[n,p,t,i,g,s?.zeniSessionId]),f.useEffect(()=>{S!=="In-Progress"||I!=="Completed"&&b!=="Completed"||s?.zeniSessionId==null||o==null||(n!=null&&r.saveLastUsedMagicLinkToken(n),r.saveSignedInUserWithSession(s,s.zeniSessionId),r.saveSignedInUserTenants(J(k.tenantsInOrder),s.zeniSessionId),K(s.userId,s.zeniSessionId,o.tenantId),t(Q(o.tenantId)),r.saveActiveTenantDomainForUser(o.tenantEmailDomain),t(X("Completed")),V.updateAppLocaleID(ie(o)),ae(s,o,v,void 0,k.tenantsInOrder),Y().then(()=>{const e=W();e!=null&&A(e)}),setTimeout(()=>{N.trackLogin(R.Event.loginSuccess,"email",Z(o.productSettings))},2e3))},[S,I,b,s,o,k,v,a.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"&&s?.zeniSessionId!=null&&o!=null||E!=null){const e=a.state?.origin??"/";return u.jsx(T,{to:e,state:{...a.state,origin:""}})}if(!D(n,p)||g==null||h==="Error"){const e=a.state?.origin??"/",L=n!=null&&r.getLastUsedMagicLinkToken()===n;return u.jsx(T,{to:e,state:{...a.state,origin:"",magicLinkAlreadyUsed:L,magicLinkExpired:!L&&(r.isMagicLinkTriggered(n??"")||h==="Error"&&s?.zeniSessionId==null)}})}return u.jsx(oe,{"data-testid":"smooth-loader",children:u.jsx(q,{size:"ExtraLarge",start:!0})})}const oe=ne.div`
2
+ position: fixed;
3
+ top: 0;
4
+ left: 0;
5
+ right: 0;
6
+ bottom: 0;
7
+ display: flex;
8
+ align-items: center;
9
+ justify-content: center;
10
+ z-index: 9999;
11
+ background-color: ${t=>t.theme.colors.background};
12
+ `;export{De as default};
@@ -1 +1 @@
1
- import{j as N}from"./liveblocks-Cqbf2YvG.js";import{a as c}from"./sentry-gLPXz4Yq.js";import{h as pe,g as a,l as We,u as Xe,j as qe,i as R}from"./core-DZE88rLA.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-Cc2P4FPR.js";import{a1 as Ea,a2 as ka,v as Ca,a as ya,z as k,a3 as Ia,u as Ta,i as r,a4 as wa,a5 as Fa,j as Aa,c as _a,a6 as Da,V 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,r as F,ad as V,ae as Ra}from"./index-DqxsObld.js";import{D as xa}from"./mui-B4xUUoCx.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]="58f4fb52-cba1-489e-960c-6deab30974c3",f._sentryDebugIdIdentifier="sentry-dbid-58f4fb52-cba1-489e-960c-6deab30974c3")}catch{}})();const Va=Ea(({isAppContentDrawerOpen:f,handleDrawerToggle:d})=>{const{tenantEmailDomain:t}=We(),n=Xe(),C=Ca(),o=qe(),U=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:Y}=i(r.isDepositAccountsFeatureEnabled),{isFeatureEnabled:Ee}=i(r.isChargeCardFeatureEnabled),{isFeatureEnabled:Z}=i(r.isDebitCardFeatureEnabled),ke=wa(s,Ee,Z),{isFeatureEnabled:Ce}=i(r.isSettingsFeatureEnabled),H=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:W}=i(r.isExpenseAutomationEnabled),{isFeatureEnabled:X}=i(r.isExpenseAutomationEnabledV2),q=X||W&&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"&&U.tenantId!=null&&m(ia("task_manager","dashboard"))},[y,U.tenantId]),c.useEffect(()=>{I||B.fetchState!=="Not-Started"||m(ue({fetchCountState:{fetchState:"In-Progress",error:void 0}},"comments"))},[]),c.useEffect(()=>{_!=null&&B.fetchState==="In-Progress"&&(m(ue({fetchCountState:{fetchState:"Completed",error:void 0}},"comments")),m(Se({unreadCount:_},"comments")))},[_,B.fetchState]);const Ve={fetchStatus:Pe,count: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"),Y===!1&&S.push("zeni_accounts_promo_card"),T===!1&&S.push("rewards_card"),q===!1&&S.push("expense_automation_card");const Ne=Aa(),oe=a(e=>da(e,S,h,X,W,w).fetchState),ie=a(e=>la(e).fetchState),Ue=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&&H.fetchState==="Completed"&&fa(H.notificationSettings,h.userEmail,Z,s),re=_a(),ze=re&&Da(n),de=ma(Ne?.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]),[Ye,ce]=c.useState(M);c.useEffect(()=>{ce(M())},[M]);const Ze=a(e=>e.treasurySetupViewState.treasuryFundsDetails).fundsDetails,He=$a(Ze);return N.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:N.jsx(Ba,{signedInUser:G,currentTenantId:$.currentTenantId??"",tenants:$.fetchState==="Completed"?ye:se!=null?[se]:[],currentTenant:s,isTenantDropdownDisabled:Ue,isSettings:me(n),isSettingsFeatureEnabled:Ce,isVendorsTabVisible:Le,isZeniAccountEnabled:Y,isChargeCardEnabled:ke,isTreasuryEnabled:w,treasuryYieldPercentage:He,isTreasuryPopupVisible:Ye,isNotificationsTabVisible:Oe,notificationCountDetails:Ve,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=V(l)&&l!=="command_center";if(V(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=V(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 N.jsx(Va,{...f,...n})};export{za as M};
1
+ import{j as N}from"./liveblocks-ZAKgWoPK.js";import{a as c}from"./sentry-Bp45iw9z.js";import{h as pe,g as a,l as We,u as qe,j as Qe,i as R}from"./core-a8i-_0Kh.js";import{eM as he,eU as Xe,eV as Se,eO as Je,bm as Ke,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-ZCc1K30S.js";import{a1 as Ea,a2 as ka,Q as Ca,a as ya,z as k,a3 as Ia,u as Ta,i as r,a4 as wa,a5 as Fa,j as Aa,c as _a,a6 as Da,V 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,q as F,ad as V,ae as Ra}from"./index-CtIv1cPm.js";import{D as xa}from"./mui-B8yatdty.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]="531c45eb-88f9-4b18-a595-dc51e5f9ae61",f._sentryDebugIdIdentifier="sentry-dbid-531c45eb-88f9-4b18-a595-dc51e5f9ae61")}catch{}})();const Va=Ea(({isAppContentDrawerOpen:f,handleDrawerToggle:d})=>{const{tenantEmailDomain:t}=We(),n=qe(),C=Ca(),o=Qe(),U=Je(),m=pe(),{useFeatureGate:i}=ya(),G=k.getSignedInUser(),A=Ke(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:Y}=i(r.isDepositAccountsFeatureEnabled),{isFeatureEnabled:Ee}=i(r.isChargeCardFeatureEnabled),{isFeatureEnabled:Z}=i(r.isDebitCardFeatureEnabled),ke=wa(s,Ee,Z),{isFeatureEnabled:Ce}=i(r.isSettingsFeatureEnabled),H=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:W}=i(r.isExpenseAutomationEnabled),{isFeatureEnabled:q}=i(r.isExpenseAutomationEnabledV2),Q=q||W&&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),X=a(e=>g(e).notificationDetailsByTab.tasks.uiState.unreadCount),J=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:K,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&&K!=null){const e=`dashboard_${s.companyId}`;O(K.filter(u=>u.roomId===e&&u.readAt==null).length)}else O(0)},[ee,ae,te]),c.useEffect(()=>{y&&!I&&Re.fetchState==="Not-Started"&&U.tenantId!=null&&m(ia("task_manager","dashboard"))},[y,U.tenantId]),c.useEffect(()=>{I||B.fetchState!=="Not-Started"||m(ue({fetchCountState:{fetchState:"In-Progress",error:void 0}},"comments"))},[]),c.useEffect(()=>{_!=null&&B.fetchState==="In-Progress"&&(m(ue({fetchCountState:{fetchState:"Completed",error:void 0}},"comments")),m(Se({unreadCount:_},"comments")))},[_,B.fetchState]);const Ve={fetchStatus:Pe,count: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"),Y===!1&&S.push("zeni_accounts_promo_card"),T===!1&&S.push("rewards_card"),Q===!1&&S.push("expense_automation_card");const Ne=Aa(),oe=a(e=>da(e,S,h,q,W,w).fetchState),ie=a(e=>la(e).fetchState),Ue=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&&H.fetchState==="Completed"&&fa(H.notificationSettings,h.userEmail,Z,s),re=_a(),ze=re&&Da(n),de=ma(Ne?.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]),[Ye,ce]=c.useState(M);c.useEffect(()=>{ce(M())},[M]);const Ze=a(e=>e.treasurySetupViewState.treasuryFundsDetails).fundsDetails,He=$a(Ze);return N.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:N.jsx(Ba,{signedInUser:G,currentTenantId:$.currentTenantId??"",tenants:$.fetchState==="Completed"?ye:se!=null?[se]:[],currentTenant:s,isTenantDropdownDisabled:Ue,isSettings:me(n),isSettingsFeatureEnabled:Ce,isVendorsTabVisible:Le,isZeniAccountEnabled:Y,isChargeCardEnabled:ke,isTreasuryEnabled:w,treasuryYieldPercentage:He,isTreasuryPopupVisible:Ye,isNotificationsTabVisible:Oe,notificationCountDetails:Ve,isExpenseAutomationEnabledForUser:Q&&ba(s.userRole)===!1,selectedMenu:fe(n),rewardsConfiguration:{isRewardsTabVisible:T,isRewardsAnimated:je,rewardsPlan:v.rewardsPlan},isAiCfoAccessEnabled:re,onNotificationIconClick:()=>{d(!1);let e=X===0&&J>0?"notifications/comments":"notifications/tasks";me(n)&&(e=X===0&&J>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=V(l)&&l!=="command_center";if(V(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=V(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)&&Xe(o.mode)==="dashboard"&&d(Se({unreadCount:o.data.unread},"tasks"))}};return N.jsx(Va,{...f,...n})};export{za as M};
@@ -0,0 +1 @@
1
+ import{j as e}from"./liveblocks-ZAKgWoPK.js";import{j as r,k as i}from"./core-a8i-_0Kh.js";import{U as n}from"./index-CtIv1cPm.js";import"./mui-B8yatdty.js";import"./sentry-Bp45iw9z.js";import"./zeni-epic-state-ZCc1K30S.js";import"./recharts-BhJEeZEG.js";import"./lottie-DN0gYkdx.js";import"./analytics-vyykHm3I.js";import"./plaid-CP3hLhCR.js";import"./dnd-CDdU3ON0.js";import"./stripe-DMRn4zHo.js";import"./lexical-BzneVI9m.js";import"./pdf-C4rebPwh.js";import"./utils-ikosPjSL.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]="8569e781-4cca-432a-a9cb-bfb8f16b11e6",o._sentryDebugIdIdentifier="sentry-dbid-8569e781-4cca-432a-a9cb-bfb8f16b11e6")}catch{}})();const a=i(null,function(o,t){return{onGoBack:()=>{t.navigate(-1)},onGoHome:()=>{t.navigate("/")}}})(n);function h(){const o=r();return e.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-Cqbf2YvG.js";import ut from"./NotFoundScreen-D77qAkFD.js";import{a as k}from"./sentry-gLPXz4Yq.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 H}from"./core-DZE88rLA.js";import{cn as It,eW as Q,eM as X,fa as Ct,f2 as b,Op as J,f6 as d,eV as y,q9 as $,vn as Tt,Oq as yt,eU as At,fd as Et,qe as _t,Or as F,bp as M,gy as w,qi as K,Os as Nt,cy as Bt,cs as xt}from"./zeni-epic-state-Cc2P4FPR.js";import{H as wt,z as Rt,a as Ut,i as vt,F as Dt,cn as Gt,r as N,a1 as Pt,co as Ft,a2 as Mt,p as $t}from"./index-DqxsObld.js";import"./mui-B4xUUoCx.js";import{u as jt}from"./useAskAiCfoHostNavButtonProps-BZUsoX5k.js";import{c as Ot}from"./useFetchSuggestedQuestionsWhenReady-Dg4k8UUU.js";import"./recharts-3_XOsuaw.js";import"./lottie-BMcMDJUW.js";import"./analytics-Cp5F-UjF.js";import"./plaid-G98kqTnM.js";import"./dnd-B4DEM2bW.js";import"./stripe-DMRn4zHo.js";import"./lexical-Bp_BNV6r.js";import"./pdf-DYKlsr3c.js";import"./utils-oW6HiHsc.js";(function(){try{var t=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},l=new t.Error().stack;l&&(t._sentryDebugIds=t._sentryDebugIds||{},t._sentryDebugIds[l]="8e0b5e5d-c586-4535-b2ce-660a6358c9da",t._sentryDebugIdIdentifier="sentry-dbid-8e0b5e5d-c586-4535-b2ce-660a6358c9da")}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=X(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(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(F([a],M())));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")&&!xt(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(J(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($("task_manager","dashboard",m))}else R?.()},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(F([r],M())))})).then(()=>{t(d({markAsReadState:{fetchState:"Completed",error:void 0},selectedNotificationIds:[]},"comments")),t(y({unreadCount:i-c.length>0?i-c.length:0},"comments")),t(w({messageSection:"notification_mark_as_read",messageText:"success",type:"success",showStatusIcon:!0}))},r=>{t(d({markAsReadState:{fetchState:"Error",error:r}},"comments")),t(w({messageSection:"notification_mark_as_read",messageText:"failed",type:"error",showStatusIcon:!0}))}).catch(r=>{t(d({markAsReadState:{fetchState:"Error",error:r}},"comments")),t(w({messageSection:"notification_mark_as_read",messageText:"failed",type:"error",showStatusIcon:!0}))}))},onMarkAllNotificationsAsRead:a=>{a==="tasks"?t(_t("task_manager","read")):(t(d({markAsAllReadState:{fetchState:"In-Progress",error:void 0}},"comments")),Vt(s,B).then(()=>{t(F(s,M())),t(d({markAsAllReadState:{fetchState:"Completed",error:void 0}},"comments")),t(y({unreadCount:0},"comments")),t(w({messageSection:"notification_mark_as_read",messageText:"success",type:"success",showStatusIcon:!0}))}).catch(o=>{t(d({markAsAllReadState:{fetchState:"Error",error:o}},"comments")),t(w({messageSection:"notification_mark_as_read",messageText:"failed",type:"error",showStatusIcon:!0}))}))},onBackClick:()=>{const a=$t(n.state?.pathnameStackToGoBack),o=a.poppedPathname??"../../dashboard";h(o,{state:{pathnameStackToGoBack:a.newStack}})},onSettingsClick:()=>{const a=N(n.state?.pathnameStackToGoBack,n.pathname);h("../../settings/notifications",{state:{pathnameStackToGoBack:a}})}}})(Pt(Ft)),Wt=()=>{const t=ht(),l=pt(),{tenantEmailDomain:n,selectedTab:u}=kt(),{areTenantIdsInSync:g}=wt(),i=It(u??""),s=gt(),h=Rt.getSignedInUser(),[B,R]=k.useState(!1),a=S(e=>Q(e)),o=S(e=>X(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:x,isLoading:A,hasFetchedAll:C,isFetchingMore:D,fetchMore:nt}=dt(),{threads:V,isLoading:q,fetchMore:W,isFetchingMore:z,hasFetchedAll:L}=lt({query:{metadata:{companyId:o.companyId,application:"dashboard"}}});k.useEffect(()=>{if(O!==i&&i!=null&&s(J(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&&x!=null){const e=`dashboard_${o.companyId}`,p=x.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($("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&&x!=null&&V!=null){const e=`dashboard_${o.companyId}`,p=x.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||L===!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,L,q,x?.length]);const it={events:o.userRoleId!=null?[`private-${o.userRoleId}.dashboard-user-notification`]:[],eventCallback:(e,p)=>{if(Mt(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($("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(H,{path:"/:selectedTab",element:_.jsx(Wt,{})}),_.jsx(H,{path:"*",element:_.jsx(ut,{})})]})}export{me as default};
1
+ import{l as dt,a as lt,m as ft,j as _}from"./liveblocks-ZAKgWoPK.js";import ut from"./NotFoundScreen-DPOmbROX.js";import{a as k}from"./sentry-Bp45iw9z.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-a8i-_0Kh.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 w,qi as K,Os as Nt,cy as Bt,cs as xt}from"./zeni-epic-state-ZCc1K30S.js";import{J as wt,z as Rt,a as Ut,i as vt,I as Dt,cn as Gt,q as N,a1 as Pt,co as Mt,a2 as $t,p as Ft}from"./index-CtIv1cPm.js";import"./mui-B8yatdty.js";import{u as jt}from"./useAskAiCfoHostNavButtonProps-D6kPXOEr.js";import{c as Ot}from"./useFetchSuggestedQuestionsWhenReady-D_w411d6.js";import"./recharts-BhJEeZEG.js";import"./lottie-DN0gYkdx.js";import"./analytics-vyykHm3I.js";import"./plaid-CP3hLhCR.js";import"./dnd-CDdU3ON0.js";import"./stripe-DMRn4zHo.js";import"./lexical-BzneVI9m.js";import"./pdf-C4rebPwh.js";import"./utils-ikosPjSL.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]="cb72c6f9-32e3-4d7a-8009-51719658999e",t._sentryDebugIdIdentifier="sentry-dbid-cb72c6f9-32e3-4d7a-8009-51719658999e")}catch{}})();const qt=(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)})}),Vt=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(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(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")&&!xt(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(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(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(w({messageSection:"notification_mark_as_read",messageText:"success",type:"success",showStatusIcon:!0}))},r=>{t(d({markAsReadState:{fetchState:"Error",error:r}},"comments")),t(w({messageSection:"notification_mark_as_read",messageText:"failed",type:"error",showStatusIcon:!0}))}).catch(r=>{t(d({markAsReadState:{fetchState:"Error",error:r}},"comments")),t(w({messageSection:"notification_mark_as_read",messageText:"failed",type:"error",showStatusIcon:!0}))}))},onMarkAllNotificationsAsRead:a=>{a==="tasks"?t(_t("task_manager","read")):(t(d({markAsAllReadState:{fetchState:"In-Progress",error:void 0}},"comments")),qt(s,B).then(()=>{t(M(s,$())),t(d({markAsAllReadState:{fetchState:"Completed",error:void 0}},"comments")),t(y({unreadCount:0},"comments")),t(w({messageSection:"notification_mark_as_read",messageText:"success",type:"success",showStatusIcon:!0}))}).catch(o=>{t(d({markAsAllReadState:{fetchState:"Error",error:o}},"comments")),t(w({messageSection:"notification_mark_as_read",messageText:"failed",type:"error",showStatusIcon:!0}))}))},onBackClick:()=>{const a=Ft(n.state?.pathnameStackToGoBack),o=a.poppedPathname??"../../dashboard";h(o,{state:{pathnameStackToGoBack:a.newStack}})},onSettingsClick:()=>{const a=N(n.state?.pathnameStackToGoBack,n.pathname);h("../../settings/notifications",{state:{pathnameStackToGoBack:a}})}}})(Pt(Mt)),Wt=()=>{const t=ht(),l=pt(),{tenantEmailDomain:n,selectedTab:u}=kt(),{areTenantIdsInSync:g}=wt(),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:x,isLoading:A,hasFetchedAll:C,isFetchingMore:D,fetchMore:nt}=dt(),{threads:q,isLoading:V,fetchMore:W,isFetchingMore:z,hasFetchedAll:J}=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&&x!=null){const e=`dashboard_${o.companyId}`,p=x.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&&V===!1&&x!=null&&q!=null){const e=`dashboard_${o.companyId}`,p=x.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=q.find(mt=>mt.id===f.threadId);return P!=null?{inboxNotification:{...f,threadId:P.id},thread:P}:(z||J===!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,J,V,x?.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(Vt,{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};
@@ -1 +1 @@
1
- import{j as n}from"./liveblocks-Cqbf2YvG.js";import{j as Z,h as Q,u as J,l as K,g as d,k as X,n as ee,o as C}from"./core-DZE88rLA.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-Cc2P4FPR.js";import{F as pe,z as ue,H as he,j as Fe,a as w,i as B,w as ge,d as G,aj as Ie,r as be}from"./index-DqxsObld.js";import"./mui-B4xUUoCx.js";import Ce from"./NotFoundScreen-D77qAkFD.js";import{F as Te}from"./FeaturePreviewScreen-CyaqKlwB.js";import{a as h}from"./sentry-gLPXz4Yq.js";import{u as Se}from"./useAskAiCfoHostNavButtonProps-BZUsoX5k.js";import{c as ye}from"./useFetchSuggestedQuestionsWhenReady-Dg4k8UUU.js";import{u as Ae}from"./useInitialThreadRequest-ygpkiG-5.js";import{t as ke}from"./routePaths-DJEpoMwA.js";import{M as xe}from"./MobileAppDrawer-CsdMhFJr.js";import"./recharts-3_XOsuaw.js";import"./lottie-BMcMDJUW.js";import"./analytics-Cp5F-UjF.js";import"./plaid-G98kqTnM.js";import"./dnd-B4DEM2bW.js";import"./stripe-DMRn4zHo.js";import"./lexical-Bp_BNV6r.js";import"./pdf-DYKlsr3c.js";import"./utils-oW6HiHsc.js";(function(){try{var 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]="40192153-75cb-465b-9dec-64f334568604",s._sentryDebugIdIdentifier="sentry-dbid-40192153-75cb-465b-9dec-64f334568604")}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=Q(),r=J(),{forecastId:i,tenantEmailDomain:F}=K(),[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 Qe(){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{Qe as PandLWithForecastRoutes,Qe as default};
1
+ import{j as n}from"./liveblocks-ZAKgWoPK.js";import{j as Z,h as J,u as Q,l as K,g as d,k as X,n as ee,o as C}from"./core-a8i-_0Kh.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-ZCc1K30S.js";import{I as pe,z as ue,J as he,j as be,a as w,i as q,v as Fe,d as B,aj as ge,q as Ie}from"./index-CtIv1cPm.js";import"./mui-B8yatdty.js";import Ce from"./NotFoundScreen-DPOmbROX.js";import{F as Te}from"./FeaturePreviewScreen-BOGEp7mZ.js";import{a as h}from"./sentry-Bp45iw9z.js";import{u as Se}from"./useAskAiCfoHostNavButtonProps-D6kPXOEr.js";import{c as ye}from"./useFetchSuggestedQuestionsWhenReady-D_w411d6.js";import{u as Ae}from"./useInitialThreadRequest-BTSPvXZ7.js";import{t as ke}from"./routePaths-CAPvhOau.js";import{M as xe}from"./MobileAppDrawer-DkCKi5Fn.js";import"./recharts-BhJEeZEG.js";import"./lottie-DN0gYkdx.js";import"./analytics-vyykHm3I.js";import"./plaid-CP3hLhCR.js";import"./dnd-CDdU3ON0.js";import"./stripe-DMRn4zHo.js";import"./lexical-BzneVI9m.js";import"./pdf-C4rebPwh.js";import"./utils-ikosPjSL.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]="97c5cf89-c6b1-469d-880d-b9b43bed600f",s._sentryDebugIdIdentifier="sentry-dbid-97c5cf89-c6b1-469d-880d-b9b43bed600f")}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:B}},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 b=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,b,r,i),p=Ie(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("../../")}}})(ge);function v(){const{isAiCfoOpen:s,setIsAiCfoOpen:a}=pe(),e=Z(),o=J(),r=Q(),{forecastId:i,tenantEmailDomain:b}=K(),[f,p]=h.useState(!1),[F,A]=h.useState(!1),u=ue.getSignedInUser(),k=d(t=>M(t)),G=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:g}=he();ye({isDataReady:l});const{isAiCfoAccessEnabled:N,onAskAiCfoClick:_}=Se({isAiCfoOpen:s,setIsAiCfoOpen:a,mobileExploreReferrer:"Forecast"});h.useEffect(()=>{if(!f&&g)p(!0),l||o(ae());else if(l&&!F){A(!0);const t=((m,R,P)=>R!=null?m.forecasts.findIndex(I=>I.id===R):P!=null?m.forecasts.findIndex(I=>I.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)&&g&&o(S(c.forecasts[t].id))}},[f,p,o,l,c,F,A,U,S,g]);const E=be(),V=E?.loggedInUserRole!=null&&te(E.loggedInUserRole),{useFeatureGate:W}=w(),{isFeatureEnabled:L}=W(q.isReportsCommentingEnabled),Y=Ae(L?k?.companyId:void 0,{clearParams:l&&F}),[z,H]=h.useState(!1),O=t=>{H(t)};return n.jsxs(n.Fragment,{children:[l?n.jsx(Fe,{analytics:B,onLoad:t=>(m=>m.trackForecast())(t)}):null,n.jsx(xe,{isAppContentDrawerOpen:z,handleDrawerToggle:O}),n.jsx(je,{firstMonthOfFY:G,tenantEmailDomain:b,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:N,onAskAiCfoClick:_,isReportsCommentingEnabled:L,isZeniUser:se(u),initialOpenThreadRequest:Y,onClickMenuIcon:()=>{O(!0)}})]})}function Je(){const s=d(i=>M(i)),{useFeatureGate:a}=w(),{isFeatureEnabled:e}=a(q.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{Je as PandLWithForecastRoutes,Je as default};
@@ -0,0 +1,22 @@
1
+ import{j as s}from"./liveblocks-ZAKgWoPK.js";import{IO as oe,eM as X,j8 as W,eT as J,eR as ie,Gm as Y,Iq as re,ss as ke,IP as N,sg as Pe,sB as je,sv as le,sk as de,sz as Te,sw as ve,IQ as ce,u6 as Le,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-ZCc1K30S.js";import{Z as me,a as ee,i as E,z as _,a4 as ge,E as he,af as fe,ag as Ve,w as Ce,o as A,F as be,D as ye,ah as Ue,J as Be,I as Ze,v as $e,d as we,f as ze,q as Ge,ai as He,j as Me}from"./index-CtIv1cPm.js";import{D as Se,n as q,S as De}from"./mui-B8yatdty.js";import te from"./NotFoundScreen-DPOmbROX.js";import{a as l}from"./sentry-Bp45iw9z.js";import{h as se,l as We,g,j as _e,u as qe,k as Ke,n as ne,o as z}from"./core-a8i-_0Kh.js";import{u as Qe}from"./useAskAiCfoHostNavButtonProps-D6kPXOEr.js";import{c as Ne}from"./useFetchSuggestedQuestionsWhenReady-D_w411d6.js";import{M as Xe}from"./MobileAppDrawer-DkCKi5Fn.js";import"./recharts-BhJEeZEG.js";import"./lottie-DN0gYkdx.js";import"./analytics-vyykHm3I.js";import"./plaid-CP3hLhCR.js";import"./dnd-CDdU3ON0.js";import"./stripe-DMRn4zHo.js";import"./lexical-BzneVI9m.js";import"./pdf-C4rebPwh.js";import"./utils-ikosPjSL.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]="7638860e-e3ee-4aec-a7d0-4b78c5ddf524",e._sentryDebugIdIdentifier="sentry-dbid-7638860e-e3ee-4aec-a7d0-4b78c5ddf524")}catch{}})();const Je={overlayWidth:new Ce(100,100,48)},H=ye.getLocalizedStrings().peoplePage.invitePage,Ye=({companyId:e,managersListView:n,companyPassportView:d,classListView:o,mode:h,isEditPeopleDrawerOpen:i,closeDrawerHandler:y})=>{const f=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),v=ie(m),L=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()},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:h,isZeniTenant:L,isAccountingClassesEnabled:D,isReimbursementDisabled:U===!1,isZeniAccountsDisabled:Z===!1,isChargeCardDisabled:p===!1,isTreasuryDisabled:j===!1,isLiteRoleDisabled:V===!1,isBankingOnlyTenant:P,isCardsOnlyTenant:v,onResetClick:b,onDeleteUser:t=>{u(de(t.userId,t.userRole.userRoleId))},onPeopleLocalDataUpdated:t=>{u(le({peopleLocalData:t})),R(!0)},onSaveClick:()=>{u(h==="zeni_only"?Pe(e):je(L))},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(f),boxShadow:"none"}},slotProps:{backdrop:{style:{backgroundColor:he.overlayDark,cursor:"pointer"}}},onClose:F,children:s.jsxs(es,{onClick:t=>t.stopPropagation(),children:[k===!0?s.jsx(fe,{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)`
2
+ display: flex;
3
+ min-height: 100%;
4
+ flex-direction: column;
5
+ `,xe=q(be.H6Regular)`
6
+ margin-top: ${A.sp7};
7
+ padding-left: ${A.sp8};
8
+ padding-right: ${A.sp8};
9
+ color: ${e=>e.theme.colors.primary};
10
+ word-break: break-word;
11
+ `,Ee=q(be.LargeRegularSp)`
12
+ color: ${e=>e.theme.colors.hero};
13
+ padding-left: ${A.sp8};
14
+ padding-right: ${A.sp8};
15
+ margin-bottom: 30px;
16
+ margin-top: ${A.sp4};
17
+ white-space: pre-line;
18
+ `,ss={overlayWidth:new Ce(100,100,48)},M=ye.getLocalizedStrings().peoplePage.invitePage,as=({companyId:e,managersListView:n,companyPassportView:d,classListView:o,mode:h,isInvitePeopleDrawerOpen:i,closeDrawerHandler:y})=>{const f=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),v=Y(c),L=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)}},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:h,isZeniTenant:v,onPeopleLocalDataUpdated:r=>{u(le({peopleLocalData:r})),R(!0)},onResetClick:x,onSaveClick:()=>{u(h==="zeni_only"?Te(e):ve())},onCloseClick:b,peopleDetails:S,isAccountingClassesEnabled:m,isReimbursementDisabled:V===!1,isLiteRoleDisabled:L===!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(N()))},[S.invitePersonState.fetchState]),s.jsx(Se,{anchor:"right",open:i,PaperProps:{style:{width:ss.overlayWidth.valuePercentage(f),boxShadow:"none"}},slotProps:{backdrop:{style:{backgroundColor:he.overlayDark,cursor:"pointer"}}},onClose:b,children:s.jsxs(ts,{onClick:r=>r.stopPropagation(),children:[k===!0?s.jsx(fe,{titleComponent:s.jsx(xe,{children:M.discardTitle}),descriptionComponent:s.jsx(Ee,{children:M.discardDescription}),primaryButtonText:M.discard,secondaryButtonText:M.no,action:F}):null,s.jsx(Ue,{...T})]})})},ts=q(De)`
19
+ display: flex;
20
+ min-height: 100%;
21
+ flex-direction: column;
22
+ `,ns=Ke(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:h}=n;return{personAction:{onPersonDelete:(i,y)=>{e(de(i,y))},onResendInvite:i=>{e(Oe(i))},onReloadPeople:()=>{e(pe()),e(ue(o,h))},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(),h=qe(),{areTenantIdsInSync:i}=Be(),y=_.getSignedInUser(),f=g(a=>X(a)),{useFeatureGate:u}=ee(),{isFeatureEnabled:O}=u(E.isDebitCardFeatureEnabled),R=g(a=>W(a)),k=!J(O,f)&&R,w=Y(f),S=f?.tenantId,{tenantEmailDomain:c}=f,[m,D]=l.useState(!1),[C,I]=l.useState(!1),[P,v]=l.useState(!1),[L,V]=l.useState("off"),[U,x]=l.useState(!1),b=a=>{x(a)},{isAiCfoOpen:F,setIsAiCfoOpen:B}=Ze(),{isAiCfoAccessEnabled:Z,onAskAiCfoClick:$}=Qe({isAiCfoOpen:F,setIsAiCfoOpen:B,mobileExploreReferrer:"People"}),p=g(a=>ce(a));Ne({isDataReady:p.fetchState==="Completed"});const j=g(a=>Le(a.classState,a.classListState)),T=g(a=>Fe(a.userState,a.userRoleState,a.userListViewState,"manager")),r=g(a=>Ae(a)),t=f?.companyId;l.useEffect(()=>{m&&L===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),v(n!=null&&n===!0&&n)},[e,n]),l.useEffect(()=>{o(G({searchText:"",sortKey:"name",sortOrder:"ascending"}))},[]);const ae=()=>{I(!1),v(!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(Xe,{isAppContentDrawerOpen:U,handleDrawerToggle:b}),s.jsx(ns,{navigate:d,signedInUser:y,isZeni:f.isZeni,isZeniTenant:w,peopleUIState:p.uiState,companyId:t,shouldFetchClasses:k,classList:j,managersView:T,peopleView:p,onInvitePeopleClick:()=>{d("./new")},onColumnSortConfigChanged:(a,K)=>{o(G({sortKey:a,sortOrder:K}))},onRowClick:a=>{const K=`/${c}/people/${encodeURIComponent(a)}/edit`,Ie=Ge(h.state?.pathnameStackToGoBack,h.pathname);d(K,{state:{pathnameStackToGoBack:Ie}})},onClickMenuIcon:()=>{b(!0)},isAiCfoAccessEnabled:Z,onAskAiCfoClick:$})]})}function Es(){const e=Me();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};
@@ -0,0 +1 @@
1
+ import{j as s}from"./liveblocks-ZAKgWoPK.js";import _ from"./NotFoundScreen-DPOmbROX.js";import{a as r}from"./sentry-Bp45iw9z.js";import{j as M,u as v,g as u,l as U,h as P,N as z,k as Q,n as V,o as h}from"./core-a8i-_0Kh.js";import{eM as B,Ot as b,bn as F,bm as N,gQ as H,gy as $}from"./zeni-epic-state-ZCc1K30S.js";import{Q as q,z as I,I as G,cp as J}from"./index-CtIv1cPm.js";import"./mui-B8yatdty.js";import{u as K}from"./useAskAiCfoHostNavButtonProps-D6kPXOEr.js";import{c as L}from"./useFetchSuggestedQuestionsWhenReady-D_w411d6.js";import{M as W}from"./MobileAppDrawer-DkCKi5Fn.js";import"./recharts-BhJEeZEG.js";import"./lottie-DN0gYkdx.js";import"./analytics-vyykHm3I.js";import"./plaid-CP3hLhCR.js";import"./dnd-CDdU3ON0.js";import"./stripe-DMRn4zHo.js";import"./lexical-BzneVI9m.js";import"./pdf-C4rebPwh.js";import"./utils-ikosPjSL.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]="e1b9eb94-03e9-4cef-99cd-4461a56614aa",e._sentryDebugIdIdentifier="sentry-dbid-e1b9eb94-03e9-4cef-99cd-4461a56614aa")}catch{}})();const X=Q(function(e){const t=I.getSignedInUser(),c=e.tenantState.currentTenantId,o={userId:t?.userId??"",sessionId:t?.zeniSessionId??"",tenantId:c??""},{aggregatedReportViewState:n}=b(e);return{authParams:o,isDisabled:!1,loggedInUser:t,aggregatedReport:n}},function(e,t){return{onBackClick:()=>{t.navigate("../../")},onClickMenuIcon:()=>{t.handleDrawerToggle(!0)}}})(J),Y=()=>{const e=M(),t=v(),c=q(),o=u(a=>B(a)),{aggregatedReportViewState:n}=u(a=>b(a)),{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),w=F(o?.userRole??[]),k=o?.userRole?.includes("bookkeeping_admin")??!1,y=N(d),A=w||k||y,l=r.useCallback((a,i,O)=>{p(H({fromMonth:a,toMonth:i,cacheOverride:O}))},[]);r.useEffect(()=>{n?.fetchState==="Completed"&&f.current&&(p($({messageSection:"data_refresh_update",messageText:"success",type:"success",showStatusIcon:!0})),f.current=!1)},[n?.fetchState]);const D=r.useCallback((a,i)=>{n!=null&&n?.fetchState==="In-Progress"||l(a,i,!0),f.current=!0},[n?.fetchState,l]),x=r.useCallback((a,i)=>{l(a,i,!1)},[l]),g=a=>{S(a)},{isAiCfoOpen:j,setIsAiCfoOpen:R}=G(),{isAiCfoAccessEnabled:T,onAskAiCfoClick:E}=K({isAiCfoOpen:j,setIsAiCfoOpen:R,mobileExploreReferrer:"Performance"});return L({isDataReady:n?.fetchState==="Completed"}),A?s.jsxs(s.Fragment,{children:[s.jsx(W,{isAppContentDrawerOpen:C,handleDrawerToggle:g}),s.jsx(X,{navigate:e,location:t,themeState:c,currentTenant:o,signedInUser:d,tenantEmailDomain:m,onReload:D,onTimeRangeSelect:x,handleDrawerToggle:g,isAiCfoAccessEnabled:T,onAskAiCfoClick:E})]}):s.jsx(z,{to:`/${m}/dashboard`,replace:!0})};function Ie(){return s.jsxs(V,{children:[s.jsx(h,{path:"*",element:s.jsx(Y,{})}),s.jsx(h,{path:"*",element:s.jsx(_,{})})]})}export{Ie as default};
@@ -1 +1 @@
1
- import{a as h,b as t}from"./sentry-gLPXz4Yq.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-Bp45iw9z.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,4 +1,4 @@
1
- import{j as Ol}from"./liveblocks-Cqbf2YvG.js";import{p as Q,e as xc,d as kc,g as jl,a as xl}from"./sentry-gLPXz4Yq.js";import{B as dt,bQ as Tc,eM as Ac,I0 as Rc,IK as kl,b$ as Tl,fi as Al,fj as Rl}from"./zeni-epic-state-Cc2P4FPR.js";import{a as lt,b as Il,c as Pl,d as Nl,e as an,f as Ll,g as $l,h as Ml,i as Vt,j as Ic,k as oe,l as je,m as Cl,n as Yt,o as ue,p as Dl}from"./utils-oW6HiHsc.js";import{r as un}from"./empty-DTOnM0RR.js";import{r as Fl,a as Bl,b as Ul,c as ql}from"./pdf-lib-vymaIDnW.js";import{r as Gl}from"./index-j9ZiGcsv.js";import{r as zl}from"./index-BWIeQAsg.js";import{j as Zl,u as Hl,h as Vl,g as En,k as Yl}from"./core-DZE88rLA.js";import{u as Kl,z as Pc,L as Wl,R as Jl,T as Xl,h as Ql,d as tf}from"./index-DqxsObld.js";import"./mui-B4xUUoCx.js";import{d as Pe}from"./decodeURIComponentSafe--utjO_hD.js";(function(){try{var t=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},f=new t.Error().stack;f&&(t._sentryDebugIds=t._sentryDebugIds||{},t._sentryDebugIds[f]="05da8a96-2d4e-4aa6-8d6e-bfb6d429096f",t._sentryDebugIdIdentifier="sentry-dbid-05da8a96-2d4e-4aa6-8d6e-bfb6d429096f")}catch{}})();var _n,Sn={exports:{}},On,jn,xn,kn,Tn,An,Rn,In,Pn,Ne,Nn,Ln,$n,Mn,Cn,Dn,Fn,Bn,Un,qn,Gn,Le,zn,Zn,Hn,Vn,Yn,Kn,Wn,$e,Jn,Xn,Qn,to,eo,ro,no,Me={exports:{}},Ce={exports:{}},De={};function Nc(){if(On)return De;function t(r){return t=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},t(r)}function f(r,e){return f=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(a,p){return a.__proto__=p,a},f(r,e)}function m(r){var e=function(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}();return function(){var a,p=s(r);if(e){var h=s(this).constructor;a=Reflect.construct(p,arguments,h)}else a=p.apply(this,arguments);return function(d,b){if(b&&(t(b)==="object"||typeof b=="function"))return b;if(b!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return function(g){if(g===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return g}(d)}(this,a)}}function s(r){return s=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},s(r)}On=1;var l,o,n={};function i(r,e,a){a||(a=Error);var p=function(h){(function(c,y){if(typeof y!="function"&&y!==null)throw new TypeError("Super expression must either be null or a function");c.prototype=Object.create(y&&y.prototype,{constructor:{value:c,writable:!0,configurable:!0}}),Object.defineProperty(c,"prototype",{writable:!1}),y&&f(c,y)})(g,h);var d,b=m(g);function g(c,y,v){var S;return function(w,_){if(!(w instanceof _))throw new TypeError("Cannot call a class as a function")}(this,g),S=b.call(this,function(w,_,M){return typeof e=="string"?e:e(w,_,M)}(c,y,v)),S.code=r,S}return d=g,Object.defineProperty(d,"prototype",{writable:!1}),d}(a);n[r]=p}function u(r,e){if(Array.isArray(r)){var a=r.length;return r=r.map(function(p){return String(p)}),a>2?"one of ".concat(e," ").concat(r.slice(0,a-1).join(", "),", or ")+r[a-1]:a===2?"one of ".concat(e," ").concat(r[0]," or ").concat(r[1]):"of ".concat(e," ").concat(r[0])}return"of ".concat(e," ").concat(String(r))}return i("ERR_AMBIGUOUS_ARGUMENT",'The "%s" argument is ambiguous. %s',TypeError),i("ERR_INVALID_ARG_TYPE",function(r,e,a){var p,h,d;if(l===void 0&&(l=ie()),l(typeof r=="string","'name' must be a string"),typeof e=="string"&&(h="not ",e.substr(0,h.length)===h)?(p="must not be",e=e.replace(/^not /,"")):p="must be",function(g,c,y){return(y===void 0||y>g.length)&&(y=g.length),g.substring(y-c.length,y)===c}(r," argument"))d="The ".concat(r," ").concat(p," ").concat(u(e,"type"));else{var b=function(g,c,y){return typeof y!="number"&&(y=0),!(y+c.length>g.length)&&g.indexOf(c,y)!==-1}(r,".")?"property":"argument";d='The "'.concat(r,'" ').concat(b," ").concat(p," ").concat(u(e,"type"))}return d+=". Received type ".concat(t(a))},TypeError),i("ERR_INVALID_ARG_VALUE",function(r,e){var a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:"is invalid";o===void 0&&(o=lt());var p=o.inspect(e);return p.length>128&&(p="".concat(p.slice(0,128),"...")),"The argument '".concat(r,"' ").concat(a,". Received ").concat(p)},TypeError),i("ERR_INVALID_RETURN_VALUE",function(r,e,a){var p;return p=a&&a.constructor&&a.constructor.name?"instance of ".concat(a.constructor.name):"type ".concat(t(a)),"Expected ".concat(r,' to be returned from the "').concat(e,'"')+" function but got ".concat(p,".")},TypeError),i("ERR_MISSING_ARGS",function(){for(var r=arguments.length,e=new Array(r),a=0;a<r;a++)e[a]=arguments[a];l===void 0&&(l=ie()),l(e.length>0,"At least one arg needs to be specified");var p="The ",h=e.length;switch(e=e.map(function(d){return'"'.concat(d,'"')}),h){case 1:p+="".concat(e[0]," argument");break;case 2:p+="".concat(e[0]," and ").concat(e[1]," arguments");break;default:p+=e.slice(0,h-1).join(", "),p+=", and ".concat(e[h-1]," arguments")}return"".concat(p," must be specified")},TypeError),De.codes=n,De}function ef(){if(xn)return jn;function t(k,E){var j=Object.keys(k);if(Object.getOwnPropertySymbols){var x=Object.getOwnPropertySymbols(k);E&&(x=x.filter(function(O){return Object.getOwnPropertyDescriptor(k,O).enumerable})),j.push.apply(j,x)}return j}function f(k){for(var E=1;E<arguments.length;E++){var j=arguments[E]!=null?arguments[E]:{};E%2?t(Object(j),!0).forEach(function(x){m(k,x,j[x])}):Object.getOwnPropertyDescriptors?Object.defineProperties(k,Object.getOwnPropertyDescriptors(j)):t(Object(j)).forEach(function(x){Object.defineProperty(k,x,Object.getOwnPropertyDescriptor(j,x))})}return k}function m(k,E,j){return(E=l(E))in k?Object.defineProperty(k,E,{value:j,enumerable:!0,configurable:!0,writable:!0}):k[E]=j,k}function s(k,E,j){return E&&function(x,O){for(var $=0;$<O.length;$++){var N=O[$];N.enumerable=N.enumerable||!1,N.configurable=!0,"value"in N&&(N.writable=!0),Object.defineProperty(x,l(N.key),N)}}(k.prototype,E),Object.defineProperty(k,"prototype",{writable:!1}),k}function l(k){var E=function(j,x){if(p(j)!=="object"||j===null)return j;var O=j[Symbol.toPrimitive];if(O!==void 0){var $=O.call(j,x);if(p($)!=="object")return $;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(j)}(k,"string");return p(E)==="symbol"?E:String(E)}function o(k,E){if(E&&(p(E)==="object"||typeof E=="function"))return E;if(E!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return n(k)}function n(k){if(k===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return k}function i(k){var E=typeof Map=="function"?new Map:void 0;return i=function(j){if(j===null||(x=j,Function.toString.call(x).indexOf("[native code]")===-1))return j;var x;if(typeof j!="function")throw new TypeError("Super expression must either be null or a function");if(E!==void 0){if(E.has(j))return E.get(j);E.set(j,O)}function O(){return u(j,arguments,a(this).constructor)}return O.prototype=Object.create(j.prototype,{constructor:{value:O,enumerable:!1,writable:!0,configurable:!0}}),e(O,j)},i(k)}function u(k,E,j){return u=r()?Reflect.construct.bind():function(x,O,$){var N=[null];N.push.apply(N,O);var P=new(Function.bind.apply(x,N));return $&&e(P,$.prototype),P},u.apply(null,arguments)}function r(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function e(k,E){return e=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(j,x){return j.__proto__=x,j},e(k,E)}function a(k){return a=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(E){return E.__proto__||Object.getPrototypeOf(E)},a(k)}function p(k){return p=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(E){return typeof E}:function(E){return E&&typeof Symbol=="function"&&E.constructor===Symbol&&E!==Symbol.prototype?"symbol":typeof E},p(k)}xn=1;var h=lt().inspect,d=Nc().codes.ERR_INVALID_ARG_TYPE;function b(k,E,j){return(j===void 0||j>k.length)&&(j=k.length),k.substring(j-E.length,j)===E}var g="",c="",y="",v="",S={deepStrictEqual:"Expected values to be strictly deep-equal:",strictEqual:"Expected values to be strictly equal:",strictEqualObject:'Expected "actual" to be reference-equal to "expected":',deepEqual:"Expected values to be loosely deep-equal:",equal:"Expected values to be loosely equal:",notDeepStrictEqual:'Expected "actual" not to be strictly deep-equal to:',notStrictEqual:'Expected "actual" to be strictly unequal to:',notStrictEqualObject:'Expected "actual" not to be reference-equal to "expected":',notDeepEqual:'Expected "actual" not to be loosely deep-equal to:',notEqual:'Expected "actual" to be loosely unequal to:',notIdentical:"Values identical but not reference-equal:"};function w(k){var E=Object.keys(k),j=Object.create(Object.getPrototypeOf(k));return E.forEach(function(x){j[x]=k[x]}),Object.defineProperty(j,"message",{value:k.message}),j}function _(k){return h(k,{compact:!1,customInspect:!1,depth:1e3,maxArrayLength:1/0,showHidden:!1,breakLength:1/0,showProxy:!1,sorted:!0,getters:!0})}function M(k,E,j){var x="",O="",$=0,N="",P=!1,G=_(k),A=G.split(`
1
+ import{j as Ol}from"./liveblocks-ZAKgWoPK.js";import{p as Q,e as xc,d as kc,g as jl,a as xl}from"./sentry-Bp45iw9z.js";import{B as dt,bQ as Tc,eM as Ac,I0 as Rc,IK as kl,b$ as Tl,fi as Al,fj as Rl}from"./zeni-epic-state-ZCc1K30S.js";import{a as lt,b as Il,c as Pl,d as Nl,e as an,f as Ll,g as $l,h as Ml,i as Vt,j as Ic,k as oe,l as je,m as Cl,n as Yt,o as ue,p as Dl}from"./utils-ikosPjSL.js";import{r as un}from"./empty-9qzWTKUd.js";import{r as Fl,a as Bl,b as Ul,c as ql}from"./pdf-lib-OiZx9iEf.js";import{r as Gl}from"./index-DTPu_Uy6.js";import{r as zl}from"./index-DvmHdckU.js";import{j as Zl,u as Hl,h as Vl,g as En,k as Yl}from"./core-a8i-_0Kh.js";import{u as Kl,z as Pc,L as Wl,R as Jl,T as Xl,h as Ql,d as tf}from"./index-CtIv1cPm.js";import"./mui-B8yatdty.js";import{d as Pe}from"./decodeURIComponentSafe-B_IVipCF.js";(function(){try{var t=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},f=new t.Error().stack;f&&(t._sentryDebugIds=t._sentryDebugIds||{},t._sentryDebugIds[f]="05da8a96-2d4e-4aa6-8d6e-bfb6d429096f",t._sentryDebugIdIdentifier="sentry-dbid-05da8a96-2d4e-4aa6-8d6e-bfb6d429096f")}catch{}})();var _n,Sn={exports:{}},On,jn,xn,kn,Tn,An,Rn,In,Pn,Ne,Nn,Ln,$n,Mn,Cn,Dn,Fn,Bn,Un,qn,Gn,Le,zn,Zn,Hn,Vn,Yn,Kn,Wn,$e,Jn,Xn,Qn,to,eo,ro,no,Me={exports:{}},Ce={exports:{}},De={};function Nc(){if(On)return De;function t(r){return t=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},t(r)}function f(r,e){return f=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(a,p){return a.__proto__=p,a},f(r,e)}function m(r){var e=function(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}();return function(){var a,p=s(r);if(e){var h=s(this).constructor;a=Reflect.construct(p,arguments,h)}else a=p.apply(this,arguments);return function(d,b){if(b&&(t(b)==="object"||typeof b=="function"))return b;if(b!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return function(g){if(g===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return g}(d)}(this,a)}}function s(r){return s=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},s(r)}On=1;var l,o,n={};function i(r,e,a){a||(a=Error);var p=function(h){(function(c,y){if(typeof y!="function"&&y!==null)throw new TypeError("Super expression must either be null or a function");c.prototype=Object.create(y&&y.prototype,{constructor:{value:c,writable:!0,configurable:!0}}),Object.defineProperty(c,"prototype",{writable:!1}),y&&f(c,y)})(g,h);var d,b=m(g);function g(c,y,v){var S;return function(w,_){if(!(w instanceof _))throw new TypeError("Cannot call a class as a function")}(this,g),S=b.call(this,function(w,_,M){return typeof e=="string"?e:e(w,_,M)}(c,y,v)),S.code=r,S}return d=g,Object.defineProperty(d,"prototype",{writable:!1}),d}(a);n[r]=p}function u(r,e){if(Array.isArray(r)){var a=r.length;return r=r.map(function(p){return String(p)}),a>2?"one of ".concat(e," ").concat(r.slice(0,a-1).join(", "),", or ")+r[a-1]:a===2?"one of ".concat(e," ").concat(r[0]," or ").concat(r[1]):"of ".concat(e," ").concat(r[0])}return"of ".concat(e," ").concat(String(r))}return i("ERR_AMBIGUOUS_ARGUMENT",'The "%s" argument is ambiguous. %s',TypeError),i("ERR_INVALID_ARG_TYPE",function(r,e,a){var p,h,d;if(l===void 0&&(l=ie()),l(typeof r=="string","'name' must be a string"),typeof e=="string"&&(h="not ",e.substr(0,h.length)===h)?(p="must not be",e=e.replace(/^not /,"")):p="must be",function(g,c,y){return(y===void 0||y>g.length)&&(y=g.length),g.substring(y-c.length,y)===c}(r," argument"))d="The ".concat(r," ").concat(p," ").concat(u(e,"type"));else{var b=function(g,c,y){return typeof y!="number"&&(y=0),!(y+c.length>g.length)&&g.indexOf(c,y)!==-1}(r,".")?"property":"argument";d='The "'.concat(r,'" ').concat(b," ").concat(p," ").concat(u(e,"type"))}return d+=". Received type ".concat(t(a))},TypeError),i("ERR_INVALID_ARG_VALUE",function(r,e){var a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:"is invalid";o===void 0&&(o=lt());var p=o.inspect(e);return p.length>128&&(p="".concat(p.slice(0,128),"...")),"The argument '".concat(r,"' ").concat(a,". Received ").concat(p)},TypeError),i("ERR_INVALID_RETURN_VALUE",function(r,e,a){var p;return p=a&&a.constructor&&a.constructor.name?"instance of ".concat(a.constructor.name):"type ".concat(t(a)),"Expected ".concat(r,' to be returned from the "').concat(e,'"')+" function but got ".concat(p,".")},TypeError),i("ERR_MISSING_ARGS",function(){for(var r=arguments.length,e=new Array(r),a=0;a<r;a++)e[a]=arguments[a];l===void 0&&(l=ie()),l(e.length>0,"At least one arg needs to be specified");var p="The ",h=e.length;switch(e=e.map(function(d){return'"'.concat(d,'"')}),h){case 1:p+="".concat(e[0]," argument");break;case 2:p+="".concat(e[0]," and ").concat(e[1]," arguments");break;default:p+=e.slice(0,h-1).join(", "),p+=", and ".concat(e[h-1]," arguments")}return"".concat(p," must be specified")},TypeError),De.codes=n,De}function ef(){if(xn)return jn;function t(k,E){var j=Object.keys(k);if(Object.getOwnPropertySymbols){var x=Object.getOwnPropertySymbols(k);E&&(x=x.filter(function(O){return Object.getOwnPropertyDescriptor(k,O).enumerable})),j.push.apply(j,x)}return j}function f(k){for(var E=1;E<arguments.length;E++){var j=arguments[E]!=null?arguments[E]:{};E%2?t(Object(j),!0).forEach(function(x){m(k,x,j[x])}):Object.getOwnPropertyDescriptors?Object.defineProperties(k,Object.getOwnPropertyDescriptors(j)):t(Object(j)).forEach(function(x){Object.defineProperty(k,x,Object.getOwnPropertyDescriptor(j,x))})}return k}function m(k,E,j){return(E=l(E))in k?Object.defineProperty(k,E,{value:j,enumerable:!0,configurable:!0,writable:!0}):k[E]=j,k}function s(k,E,j){return E&&function(x,O){for(var $=0;$<O.length;$++){var N=O[$];N.enumerable=N.enumerable||!1,N.configurable=!0,"value"in N&&(N.writable=!0),Object.defineProperty(x,l(N.key),N)}}(k.prototype,E),Object.defineProperty(k,"prototype",{writable:!1}),k}function l(k){var E=function(j,x){if(p(j)!=="object"||j===null)return j;var O=j[Symbol.toPrimitive];if(O!==void 0){var $=O.call(j,x);if(p($)!=="object")return $;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(j)}(k,"string");return p(E)==="symbol"?E:String(E)}function o(k,E){if(E&&(p(E)==="object"||typeof E=="function"))return E;if(E!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return n(k)}function n(k){if(k===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return k}function i(k){var E=typeof Map=="function"?new Map:void 0;return i=function(j){if(j===null||(x=j,Function.toString.call(x).indexOf("[native code]")===-1))return j;var x;if(typeof j!="function")throw new TypeError("Super expression must either be null or a function");if(E!==void 0){if(E.has(j))return E.get(j);E.set(j,O)}function O(){return u(j,arguments,a(this).constructor)}return O.prototype=Object.create(j.prototype,{constructor:{value:O,enumerable:!1,writable:!0,configurable:!0}}),e(O,j)},i(k)}function u(k,E,j){return u=r()?Reflect.construct.bind():function(x,O,$){var N=[null];N.push.apply(N,O);var P=new(Function.bind.apply(x,N));return $&&e(P,$.prototype),P},u.apply(null,arguments)}function r(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function e(k,E){return e=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(j,x){return j.__proto__=x,j},e(k,E)}function a(k){return a=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(E){return E.__proto__||Object.getPrototypeOf(E)},a(k)}function p(k){return p=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(E){return typeof E}:function(E){return E&&typeof Symbol=="function"&&E.constructor===Symbol&&E!==Symbol.prototype?"symbol":typeof E},p(k)}xn=1;var h=lt().inspect,d=Nc().codes.ERR_INVALID_ARG_TYPE;function b(k,E,j){return(j===void 0||j>k.length)&&(j=k.length),k.substring(j-E.length,j)===E}var g="",c="",y="",v="",S={deepStrictEqual:"Expected values to be strictly deep-equal:",strictEqual:"Expected values to be strictly equal:",strictEqualObject:'Expected "actual" to be reference-equal to "expected":',deepEqual:"Expected values to be loosely deep-equal:",equal:"Expected values to be loosely equal:",notDeepStrictEqual:'Expected "actual" not to be strictly deep-equal to:',notStrictEqual:'Expected "actual" to be strictly unequal to:',notStrictEqualObject:'Expected "actual" not to be reference-equal to "expected":',notDeepEqual:'Expected "actual" not to be loosely deep-equal to:',notEqual:'Expected "actual" to be loosely unequal to:',notIdentical:"Values identical but not reference-equal:"};function w(k){var E=Object.keys(k),j=Object.create(Object.getPrototypeOf(k));return E.forEach(function(x){j[x]=k[x]}),Object.defineProperty(j,"message",{value:k.message}),j}function _(k){return h(k,{compact:!1,customInspect:!1,depth:1e3,maxArrayLength:1/0,showHidden:!1,breakLength:1/0,showProxy:!1,sorted:!0,getters:!0})}function M(k,E,j){var x="",O="",$=0,N="",P=!1,G=_(k),A=G.split(`
2
2
  `),I=_(E).split(`
3
3
  `),R=0,B="";if(j==="strictEqual"&&p(k)==="object"&&p(E)==="object"&&k!==null&&E!==null&&(j="strictEqualObject"),A.length===1&&I.length===1&&A[0]!==I[0]){var V=A[0].length+I[0].length;if(V<=10){if(!(p(k)==="object"&&k!==null||p(E)==="object"&&E!==null||k===0&&E===0))return"".concat(S[j],`
4
4
 
@@ -1,5 +1,5 @@
1
- import{j as s}from"./liveblocks-Cqbf2YvG.js";import{a as o}from"./sentry-gLPXz4Yq.js";import{g as f,j as V,h as M,u as N,k as W}from"./core-DZE88rLA.js";import{m as _,Z as $,z as R,a$ as U,x as Z,H as z,F as X,w as q,d as l,f as G,a1 as J,b0 as Q}from"./index-DqxsObld.js";import{eX as K,eM as Y,Lh as I,Li as ee,ta as ae,t0 as g,eZ as re,bL as ne,t5 as te,Lj as se}from"./zeni-epic-state-Cc2P4FPR.js";import{D as oe,e as ie,n as le,S as de}from"./mui-B4xUUoCx.js";import{u as ce}from"./useAskAiCfoHostNavButtonProps-BZUsoX5k.js";import{c as fe}from"./useFetchSuggestedQuestionsWhenReady-Dg4k8UUU.js";import{M as ue}from"./MobileAppDrawer-CsdMhFJr.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]="ee3d777b-1bba-4083-95b8-d56989b8ad9a",e._sentryDebugIdIdentifier="sentry-dbid-ee3d777b-1bba-4083-95b8-d56989b8ad9a")}catch{}})();const pe={overlayWidth:new Z(100,100,30)},we=({isReferralDrawerOpen:e,closeDrawerHandler:a})=>{const r=_(),n=$();if(R.getSignedInUser()==null)throw Error("Can't access How Referral works without signing in...");const i=()=>{a(!0)},u=f(d=>K(d));return s.jsx(oe,{anchor:"right",open:e,PaperProps:{style:{width:pe.overlayWidth.valuePercentage(n),boxShadow:"none"}},slotProps:{backdrop:{style:{opacity:.75,backgroundColor:r.colors.black,cursor:"pointer"}}},onClose:()=>i(),children:s.jsx(ie,{in:e,direction:"left",children:s.jsx(ge,{onClick:d=>d.stopPropagation(),children:s.jsx(U,{onDismissClick:i,rewardsPlan:u.rewardsPlan})})})})},ge=le(de)`
1
+ import{j as s}from"./liveblocks-ZAKgWoPK.js";import{a as o}from"./sentry-Bp45iw9z.js";import{g as f,j as V,h as M,u as N,k as W}from"./core-a8i-_0Kh.js";import{m as _,Z as $,z as R,a$ as U,w as Z,J as z,I as J,v as X,d as l,f as q,a1 as G,b0 as Q}from"./index-CtIv1cPm.js";import{eX as K,eM as Y,Lh as I,Li as ee,ta as ae,t0 as g,eZ as re,bL as ne,t5 as te,Lj as se}from"./zeni-epic-state-ZCc1K30S.js";import{D as oe,e as ie,n as le,S as ce}from"./mui-B8yatdty.js";import{u as de}from"./useAskAiCfoHostNavButtonProps-D6kPXOEr.js";import{c as fe}from"./useFetchSuggestedQuestionsWhenReady-D_w411d6.js";import{M as ue}from"./MobileAppDrawer-DkCKi5Fn.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]="9667f9b4-1cb8-4879-aa7c-48f85f3ad1c9",e._sentryDebugIdIdentifier="sentry-dbid-9667f9b4-1cb8-4879-aa7c-48f85f3ad1c9")}catch{}})();const pe={overlayWidth:new Z(100,100,30)},we=({isReferralDrawerOpen:e,closeDrawerHandler:a})=>{const r=_(),n=$();if(R.getSignedInUser()==null)throw Error("Can't access How Referral works without signing in...");const i=()=>{a(!0)},u=f(c=>K(c));return s.jsx(oe,{anchor:"right",open:e,PaperProps:{style:{width:pe.overlayWidth.valuePercentage(n),boxShadow:"none"}},slotProps:{backdrop:{style:{opacity:.75,backgroundColor:r.colors.black,cursor:"pointer"}}},onClose:()=>i(),children:s.jsx(ie,{in:e,direction:"left",children:s.jsx(ge,{onClick:c=>c.stopPropagation(),children:s.jsx(U,{onDismissClick:i,rewardsPlan:u.rewardsPlan})})})})},ge=le(ce)`
2
2
  display: flex;
3
3
  min-height: 100%;
4
4
  flex-direction: column;
5
- `,P="refer-and-earn-status-update",ke=W(function(e){const a=I(e),r=e.referralViewState.rewardsPlanFetchState,n=ne([a,r]);return{inviteList:a.invitations,uiState:a.uiState,pendingBonus:a.pendingBonus,earnedBonus:a.earnedBonus,pendingReferrals:a.pendingReferrals,fetchState:n.fetchState,rewardsPlan:a.rewardsPlan}},function(e,a){const{navigate:r}=a;return{onColumnSortConfigChanged:(n,i)=>{e(se({sortOrder:i,sortkey:n}))},onInviteClick:()=>{l.trackRewardsPageClicked("invite via email"),r("../refer")},onHowItWorksClick:()=>{l.trackRewardsPageClicked("know more"),r("../how-it-works")},onResendInviteClick:n=>{l.trackRewardsPageClicked("resend invite"),e(te(n))},onBackClick:()=>{r("../",{relative:"path"})},onReloadInvitees:()=>{e(g(!0))},onCopyReferralLink:()=>{l.trackRewardsPageClicked("copy referral link")},onClickRefer:()=>{l.trackRewardsPageClicked("refer")},onEventReceived:n=>{n===P&&e(g(!0,!0))}}})(J(Q));function Pe({isReferralDrawerOpen:e}){const a=V(),r=M(),n=N(),[i,u]=o.useState(!1),[d,x]=o.useState(!1),[D,A]=o.useState(!1),[k,C]=o.useState(!1),p=R.getSignedInUser(),b=f(t=>Y(t)),h=f(t=>I(t)),m=h.fetchState,w=f(t=>t.referralViewState.rewardsPlanFetchState),v=ee([h,w]),{areTenantIdsInSync:c}=z();o.useEffect(()=>{b?.rewardsLastViewedTime==null&&D===!1&&(r(ae()),A(!0))},[]),o.useEffect(()=>{!i&&m==="Not-Started"&&c&&(u(!0),r(g(!0)))},[m,r,c]),o.useEffect(()=>{!d&&w.fetchState==="Not-Started"&&c&&(x(!0),r(re(!0)))},[w,r,c]),o.useEffect(()=>{C(e!=null&&e===!0)},[e]);const[E,j]=o.useState(!1),y=t=>{j(t)},{isAiCfoOpen:L,setIsAiCfoOpen:O}=X(),{isAiCfoAccessEnabled:T,onAskAiCfoClick:B}=ce({isAiCfoOpen:L,setIsAiCfoOpen:O,mobileExploreReferrer:"Rewards"});fe({isDataReady:v===!0});const F={events:p?.userId!=null?[`private-${p.userId}.${P}`]:[],eventCallback:(t,S,H)=>{H.onEventReceived(t)}};return s.jsxs(s.Fragment,{children:[v===!0?s.jsx(q,{analytics:l,onLoad:t=>(S=>{p!=null&&S.trackPageLoaded(G.Event.rewardsPageViewed)})(t)}):null,s.jsx(ue,{isAppContentDrawerOpen:E,handleDrawerToggle:y}),k===!0?s.jsx(we,{closeDrawerHandler:()=>{C(!1),a("..")},isReferralDrawerOpen:k}):null,s.jsx(ke,{location:n,navigate:a,currentTenant:b,onClickMenuIcon:()=>{y(!0)},isAiCfoAccessEnabled:T,onAskAiCfoClick:B,...F})]})}export{Pe as R};
5
+ `,P="refer-and-earn-status-update",ke=W(function(e){const a=I(e),r=e.referralViewState.rewardsPlanFetchState,n=ne([a,r]);return{inviteList:a.invitations,uiState:a.uiState,pendingBonus:a.pendingBonus,earnedBonus:a.earnedBonus,pendingReferrals:a.pendingReferrals,fetchState:n.fetchState,rewardsPlan:a.rewardsPlan}},function(e,a){const{navigate:r}=a;return{onColumnSortConfigChanged:(n,i)=>{e(se({sortOrder:i,sortkey:n}))},onInviteClick:()=>{l.trackRewardsPageClicked("invite via email"),r("../refer")},onHowItWorksClick:()=>{l.trackRewardsPageClicked("know more"),r("../how-it-works")},onResendInviteClick:n=>{l.trackRewardsPageClicked("resend invite"),e(te(n))},onBackClick:()=>{r("../",{relative:"path"})},onReloadInvitees:()=>{e(g(!0))},onCopyReferralLink:()=>{l.trackRewardsPageClicked("copy referral link")},onClickRefer:()=>{l.trackRewardsPageClicked("refer")},onEventReceived:n=>{n===P&&e(g(!0,!0))}}})(G(Q));function Pe({isReferralDrawerOpen:e}){const a=V(),r=M(),n=N(),[i,u]=o.useState(!1),[c,x]=o.useState(!1),[D,A]=o.useState(!1),[k,C]=o.useState(!1),p=R.getSignedInUser(),h=f(t=>Y(t)),m=f(t=>I(t)),b=m.fetchState,w=f(t=>t.referralViewState.rewardsPlanFetchState),v=ee([m,w]),{areTenantIdsInSync:d}=z();o.useEffect(()=>{h?.rewardsLastViewedTime==null&&D===!1&&(r(ae()),A(!0))},[]),o.useEffect(()=>{!i&&b==="Not-Started"&&d&&(u(!0),r(g(!0)))},[b,r,d]),o.useEffect(()=>{!c&&w.fetchState==="Not-Started"&&d&&(x(!0),r(re(!0)))},[w,r,d]),o.useEffect(()=>{C(e!=null&&e===!0)},[e]);const[E,j]=o.useState(!1),y=t=>{j(t)},{isAiCfoOpen:L,setIsAiCfoOpen:O}=J(),{isAiCfoAccessEnabled:T,onAskAiCfoClick:B}=de({isAiCfoOpen:L,setIsAiCfoOpen:O,mobileExploreReferrer:"Rewards"});fe({isDataReady:v===!0});const F={events:p?.userId!=null?[`private-${p.userId}.${P}`]:[],eventCallback:(t,S,H)=>{H.onEventReceived(t)}};return s.jsxs(s.Fragment,{children:[v===!0?s.jsx(X,{analytics:l,onLoad:t=>(S=>{p!=null&&S.trackPageLoaded(q.Event.rewardsPageViewed)})(t)}):null,s.jsx(ue,{isAppContentDrawerOpen:E,handleDrawerToggle:y}),k===!0?s.jsx(we,{closeDrawerHandler:()=>{C(!1),a("..")},isReferralDrawerOpen:k}):null,s.jsx(ke,{location:n,navigate:a,currentTenant:h,onClickMenuIcon:()=>{y(!0)},isAiCfoAccessEnabled:T,onAskAiCfoClick:B,...F})]})}export{Pe as R};