@zeniai/web-app-ui 5.0.63-qa → 5.0.64-dev

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (133) hide show
  1. package/dist/assets/AddressRoutes-B4nJrkCM.js +1 -0
  2. package/dist/assets/AddressScreen-Drzqbyi9.js +9 -0
  3. package/dist/assets/AiCfoScreen-pKh05Oy_.js +11 -0
  4. package/dist/assets/BillPayApprovalRoutes-CcxoD_gw.js +1 -0
  5. package/dist/assets/{BillPayRoutes-D-I6yBtH.js → BillPayRoutes-Caanpzej.js} +33 -33
  6. package/dist/assets/BusinessVerificationPageScreen-IxDWoa9r.js +9 -0
  7. package/dist/assets/{ChargeCardRoutes-DNNVmQba.js → ChargeCardRoutes-CC4LtpXw.js} +8 -8
  8. package/dist/assets/{CompanyPassportScreen-D2jISk-U.js → CompanyPassportScreen-BRpfcja0.js} +1 -1
  9. package/dist/assets/ConnectionAuthScreen-CbWJOJ-M.js +11 -0
  10. package/dist/assets/CustomerOnboardingAuthScreen-C2D_uxb7.js +1 -0
  11. package/dist/assets/{CustomerOnboardingRoutes-D-Ufd69Z.js → CustomerOnboardingRoutes-BFVwjpL9.js} +7 -7
  12. package/dist/assets/{DashboardRoutes-D1kbvPs7.js → DashboardRoutes-C5yY3FLO.js} +3 -3
  13. package/dist/assets/DefaultTenantHome-D7Iff23J.js +1 -0
  14. package/dist/assets/DomesticWireDetailScreen-D71-7eur.js +18 -0
  15. package/dist/assets/DrawerScreen-DP5_KQop.js +1 -0
  16. package/dist/assets/EntityDetailRoutes-D1DTJcOs.js +1 -0
  17. package/dist/assets/{ExpenseAutomationRoutes-DYuR5p-K.js → ExpenseAutomationRoutes-BQUQUcI4.js} +4 -4
  18. package/dist/assets/FeaturePreviewScreen-Bw8UbYar.js +1 -0
  19. package/dist/assets/MagicLinkRoutes-B147q1ga.js +72 -0
  20. package/dist/assets/MagicLinkSignInScreen-Cef0RCKo.js +12 -0
  21. package/dist/assets/MobileAppDrawer-IlLzhWb_.js +1 -0
  22. package/dist/assets/NotFoundScreen-ChgqfaBO.js +1 -0
  23. package/dist/assets/{NotificationRoutes-DKuetMHQ.js → NotificationRoutes-ByebQvOv.js} +1 -1
  24. package/dist/assets/PandLWithForecastRoutes-D-6oCGvF.js +1 -0
  25. package/dist/assets/PeopleRoutes-c87B9F7C.js +22 -0
  26. package/dist/assets/PerformanceRoutes-CWpcvA2S.js +1 -0
  27. package/dist/assets/{Preview-DdSrf9_j.js → Preview-DfCkk6kV.js} +1 -1
  28. package/dist/assets/{QBOConnectionScreen-B1II2TpX.js → QBOConnectionScreen-CGHUwNJt.js} +1 -1
  29. package/dist/assets/ReferralListScreen-BzSWxhkn.js +5 -0
  30. package/dist/assets/ReimbursementApprovalRoutes-BUZTc-gr.js +1 -0
  31. package/dist/assets/{ReimbursementApprovalRuleDetailScreen-5oJldpZm.js → ReimbursementApprovalRuleDetailScreen-BzLt4PF4.js} +1 -1
  32. package/dist/assets/{ReimbursementRoutes-BH3HNrZk.js → ReimbursementRoutes-BF_-0J0Y.js} +10 -10
  33. package/dist/assets/ReportsRoutes-BZp_WUzM.js +1 -0
  34. package/dist/assets/RewardsRoutes-B079p47v.js +1 -0
  35. package/dist/assets/ScreenRoutes-R0qHW3Ux.js +2 -0
  36. package/dist/assets/{SettingsRoutes-BJyRTm4m.js → SettingsRoutes-Bxr1shKz.js} +7 -7
  37. package/dist/assets/{SetupPagesScreen-BWmxAg5_.js → SetupPagesScreen-DVq0kj90.js} +5 -5
  38. package/dist/assets/SignInScreen-DgqBGTdZ.js +1 -0
  39. package/dist/assets/SignOutScreen-DBWP2kF4.js +9 -0
  40. package/dist/assets/TaskListScreen-C443LZLC.js +9 -0
  41. package/dist/assets/TaskRoutes-t-Lt6Tkq.js +9 -0
  42. package/dist/assets/TransactionDetailRoutes-D_iUUaaA.js +1 -0
  43. package/dist/assets/{TransactionDetailScreen-ByHgtPQ5.js → TransactionDetailScreen-D6Bb0BOx.js} +2 -2
  44. package/dist/assets/{TransactionListRoutes-Bo3hqgom.js → TransactionListRoutes-DTsda68U.js} +1 -1
  45. package/dist/assets/{TreasuryRoutes-VJBsZB_Q.js → TreasuryRoutes-CcLyI1eP.js} +6 -6
  46. package/dist/assets/{VendorsRoutes-DafxPLzK.js → VendorsRoutes-BqbSz_pv.js} +15 -15
  47. package/dist/assets/WiseConfirmationScreen-MDWr4jHL.js +12 -0
  48. package/dist/assets/{ZeniAccountRoutes-COMo322y.js → ZeniAccountRoutes-BWDOx1G8.js} +12 -12
  49. package/dist/assets/ZeniAccountStatementScreen-Cvgr-g8N.js +9 -0
  50. package/dist/assets/{accountMappingHelper-D6w4MCc5.js → accountMappingHelper-DRBA0kts.js} +1 -1
  51. package/dist/assets/{analytics-CQOsvcBG.js → analytics-BJQfczQS.js} +1 -1
  52. package/dist/assets/{analyticsHelper-CwPfLmD8.js → analyticsHelper-EC13frAK.js} +1 -1
  53. package/dist/assets/{core-CGhI3jCZ.js → core-BBidI7qX.js} +1 -1
  54. package/dist/assets/{decodeURIComponentSafe-CZEzMrgK.js → decodeURIComponentSafe-B_3qleD-.js} +1 -1
  55. package/dist/assets/{dnd-DKCsG5d8.js → dnd-CkhjCkb3.js} +1 -1
  56. package/dist/assets/{empty-CzOjtD5w.js → empty-948x8Pe9.js} +1 -1
  57. package/dist/assets/{empty-BAfFi45J.js → empty-BPOFy292.js} +1 -1
  58. package/dist/assets/{emptyVideoElement-qqeUs6C2.js → emptyVideoElement--p_fkcvF.js} +1 -1
  59. package/dist/assets/epic-D2z_umEt.js +2 -0
  60. package/dist/assets/getLocaleForTenant-CDVNWQi2.js +1 -0
  61. package/dist/assets/{index-DH8cVwcc.js → index-BZpFURkG.js} +1 -1
  62. package/dist/assets/{index-DHmfzpvJ.js → index-CDWPyJDF.js} +1 -1
  63. package/dist/assets/{index-Bio3vcCU.js → index-CU483D9p.js} +2 -2
  64. package/dist/assets/{index-BDBqjJWE.js → index-D_YUt3IC.js} +1 -1
  65. package/dist/assets/{index-D7leYkuC.js → index-Da7wx085.js} +15659 -16745
  66. package/dist/assets/{index-BRtx8cu_.js → index-Do4uSC5Y.js} +1 -1
  67. package/dist/assets/{index-2FSYOFek.js → index-WL0fop-T.js} +1 -1
  68. package/dist/assets/{lexical-DT64qE89.js → lexical-ElGQdEM-.js} +1 -1
  69. package/dist/assets/{liveblocks-CzlYoB8q.js → liveblocks-Dp8Rpfa6.js} +1 -1
  70. package/dist/assets/{lottie-CLMz6y3A.js → lottie-BWQSrnVe.js} +1 -1
  71. package/dist/assets/{mui-ILn-Gd-L.js → mui-B7MJOmvc.js} +1 -1
  72. package/dist/assets/{pathToGoBack-B-0xWAao.js → pathToGoBack-DGUHQ37J.js} +1 -1
  73. package/dist/assets/{pdf-CUf9xopY.js → pdf--vBxpUYp.js} +3 -3
  74. package/dist/assets/{pdf-lib-CWTnCbuI.js → pdf-lib-55B9sG08.js} +1 -1
  75. package/dist/assets/{plaid-D8caW90M.js → plaid-C04pF6iT.js} +1 -1
  76. package/dist/assets/{pusher-ChRriP4_.js → pusher-DKy6zRtD.js} +1 -1
  77. package/dist/assets/{react-DJjQrdjO.js → react-9Uj-b_uo.js} +1 -1
  78. package/dist/assets/{react-BAtU9tgF.js → react-BGL5acbj.js} +1 -1
  79. package/dist/assets/{react-DoaQNmh0.js → react-ByuJYjMk.js} +1 -1
  80. package/dist/assets/{react-Dncm-YTr.js → react-C97QJx6o.js} +1 -1
  81. package/dist/assets/{react-DyH9BXY-.js → react-DKvTmFiF.js} +1 -1
  82. package/dist/assets/{react-DSJG23We.js → react-DcqUjxux.js} +1 -1
  83. package/dist/assets/{recharts-D6qS-pdV.js → recharts-BoxqkqlO.js} +1 -1
  84. package/dist/assets/{routePaths-DhV05MHP.js → routePaths-BmuUFrf4.js} +1 -1
  85. package/dist/assets/{sentry-CNCwYM02.js → sentry-CjhVLHR5.js} +1 -1
  86. package/dist/assets/{url-CTEP03uL.js → url-Bg25A9KK.js} +1 -1
  87. package/dist/assets/{url-CWzi7k2i.js → url-Bia2Y2hX.js} +1 -1
  88. package/dist/assets/useAskAiCfoHostNavButtonProps-CVRBuwu7.js +1 -0
  89. package/dist/assets/{useDeviceId-D_8GbJBB.js → useDeviceId-B_FexNcs.js} +1 -1
  90. package/dist/assets/useFetchSuggestedQuestionsWhenReady-Bk64M-bJ.js +1 -0
  91. package/dist/assets/useInitialThreadRequest-BoJZmQZj.js +1 -0
  92. package/dist/assets/{utils-zvjLmBW4.js → utils-DVwIdRkq.js} +1 -1
  93. package/dist/assets/{withTransactionSidePanel-caCfdZEh.js → withTransactionSidePanel-BAd7sYKu.js} +2 -2
  94. package/dist/assets/zeni-epic-state-DqbxPrIr.js +14 -0
  95. package/dist/index.html +1 -1
  96. package/package.json +4 -4
  97. package/dist/assets/AddressRoutes-BGixhU4F.js +0 -1
  98. package/dist/assets/AddressScreen-BCfbWbk_.js +0 -9
  99. package/dist/assets/AiCfoScreen-NDN5qE_4.js +0 -11
  100. package/dist/assets/BillPayApprovalRoutes-Cvl_sQRW.js +0 -1
  101. package/dist/assets/BusinessVerificationPageScreen-C57FErKR.js +0 -9
  102. package/dist/assets/ConnectionAuthScreen-BUE9aXs1.js +0 -11
  103. package/dist/assets/CustomerOnboardingAuthScreen-BVuWNptI.js +0 -1
  104. package/dist/assets/DefaultTenantHome-JkQ2goKW.js +0 -1
  105. package/dist/assets/DomesticWireDetailScreen-DTmfTwYq.js +0 -18
  106. package/dist/assets/DrawerScreen-DNHIo9Ek.js +0 -1
  107. package/dist/assets/EntityDetailRoutes-8YxmqISQ.js +0 -1
  108. package/dist/assets/FeaturePreviewScreen-Xv2JpkA8.js +0 -1
  109. package/dist/assets/MagicLinkRoutes-D_-f5EfR.js +0 -72
  110. package/dist/assets/MagicLinkSignInScreen-D8SWcZwO.js +0 -12
  111. package/dist/assets/MobileAppDrawer-CMz8hWRn.js +0 -1
  112. package/dist/assets/NotFoundScreen-CojoL2wq.js +0 -1
  113. package/dist/assets/PandLWithForecastRoutes-D4EEGjw5.js +0 -1
  114. package/dist/assets/PeopleRoutes-CR2pc_sW.js +0 -22
  115. package/dist/assets/PerformanceRoutes-cynXsyNj.js +0 -1
  116. package/dist/assets/ReferralListScreen-8R81rrOx.js +0 -5
  117. package/dist/assets/ReimbursementApprovalRoutes-BGrrVRS6.js +0 -1
  118. package/dist/assets/ReportsRoutes-Dh0vOSd5.js +0 -1
  119. package/dist/assets/RewardsRoutes-RRnzfk9s.js +0 -1
  120. package/dist/assets/ScreenRoutes-DOHIbDe4.js +0 -2
  121. package/dist/assets/SignInScreen-B2_szOVQ.js +0 -1
  122. package/dist/assets/SignOutScreen-BKysr8-j.js +0 -9
  123. package/dist/assets/TaskListScreen-DYCQWF7u.js +0 -9
  124. package/dist/assets/TaskRoutes-GImULClZ.js +0 -9
  125. package/dist/assets/TransactionDetailRoutes-Dv6VDhjQ.js +0 -1
  126. package/dist/assets/WiseConfirmationScreen-CsrsS8Xt.js +0 -12
  127. package/dist/assets/ZeniAccountStatementScreen-B1lnm1eV.js +0 -9
  128. package/dist/assets/epic-CY0OxDpl.js +0 -2
  129. package/dist/assets/getLocaleForTenant-D8dvZJzp.js +0 -1
  130. package/dist/assets/useAskAiCfoHostNavButtonProps-BYwM8iQc.js +0 -1
  131. package/dist/assets/useFetchSuggestedQuestionsWhenReady-CLFroGaE.js +0 -1
  132. package/dist/assets/useInitialThreadRequest-XOr6mP2N.js +0 -1
  133. package/dist/assets/zeni-epic-state-lenVK-tm.js +0 -14
@@ -1,11 +1,11 @@
1
- import{j as C}from"./liveblocks-CzlYoB8q.js";import wn from"./NotFoundScreen-CojoL2wq.js";import{a as o,b as Tt}from"./sentry-CNCwYM02.js";import{n as De,S as xn}from"./mui-ILn-Gd-L.js";import{h as se,j as wt,u as qe,g as F,k as Rn,l as rt,n as Dn,o as je}from"./core-CGhI3jCZ.js";import{eO as we,OZ as Un,mw as Ce,fe as Fn,q7 as Bn,mO as xt,n7 as Rt,O_ as Dt,nh as _n,O$ as Ut,mH as On,pF as Mn,eZ as he,P0 as xe,s6 as Ft,Bh as Bt,P1 as _t,P2 as Vn,pk as Ge,KH as dt,KJ as jn,ju as zn,KK as Ln,jB as $n,cV as qn,t9 as Je,jr as Gn,mU as Ot,nm as Re,P3 as Jn,JA as ut,Jz as Pe,P4 as mt,jS as Nn,P5 as Kn,P6 as Yn,P7 as Hn,P8 as Zn,m$ as Wn,mM as ce,np as Ae,P9 as Qn,Pa as Xn,Pb as ea,nw as ta,jF as na,jw as aa,Pc as oa,jE as ht,KR as sa,Pd as ca,Pe as ia,pg as la,oX as ra,nn as pe,oW as ze,Pf as da,Pg as ua,l9 as ma,bq as ha,l4 as pt,kS as pa,Ph as ga,gD as gt,fQ as Ca,l1 as Sa,v2 as Ia,Pi as fa,nX as ka,nS as Ea,nW as va,nH as ya,Pj as ba,f0 as Mt,na as Pa,mX as Aa,ff as Ct,nr as Ta,Pk as wa,no as Vt,Pl as xa,Pm as Ra,Pn as Da,Po as Ua,Pp as St,ps as Fa,oN as Ba,Jy as _a,jD as Oa,Pq as Ma,FP as Va,jC as ja,e$ as za,om as jt,oF as La,nl as It,nq as $a,bD as qa,k_ as Ga,kX as Ja,Pr as Na,nG as ft,oD as kt,oB as Ka,or as Ya,o6 as Ha,oE as Za,Ps as Wa,Pt as Qa,oa as Xa,Pu as eo,o0 as to,o9 as no,o7 as ao,oI as oo}from"./zeni-epic-state-lenVK-tm.js";import{x as zt,c as ge,d as z,s as W,N as Lt,cu as so,z as Ue,cv as co,ap as Te,cw as io,aP as Et,B as $t,cx as lo,am as Le,D as ro,cy as uo,T as mo,cz as ho,M as po,cA as go,cB as Co,v as So,I as Io,aJ as fo,b1 as ko,E as Eo,cC as vo}from"./index-D7leYkuC.js";import{u as qt}from"./useAskAiCfoHostNavButtonProps-BYwM8iQc.js";import{c as Gt}from"./useFetchSuggestedQuestionsWhenReady-CLFroGaE.js";import{c as vt,C as yo}from"./TransactionDetailScreen-ByHgtPQ5.js";import{w as bo}from"./withTransactionSidePanel-caCfdZEh.js";import{h as Po,v as Ao}from"./routePaths-DhV05MHP.js";import{g as $e}from"./accountMappingHelper-D6w4MCc5.js";import{D as To}from"./DrawerScreen-DNHIo9Ek.js";import"./recharts-D6qS-pdV.js";import"./analytics-CQOsvcBG.js";import"./plaid-D8caW90M.js";import"./dnd-DKCsG5d8.js";import"./stripe-DMRn4zHo.js";import"./lottie-CLMz6y3A.js";import"./lexical-DT64qE89.js";import"./pdf-CUf9xopY.js";import"./utils-zvjLmBW4.js";import"./decodeURIComponentSafe-CZEzMrgK.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]="c678bf00-c625-4038-b45e-8b92a02c9401",t._sentryDebugIdIdentifier="sentry-dbid-c678bf00-c625-4038-b45e-8b92a02c9401")}catch{}})();const wo=()=>{const t=se(),l=wt(),A=qe(),f=F(d=>we(d)),{useFeatureGate:b}=zt(),{isFeatureEnabled:S}=b(ge.isRealtimeInsightsFeatureEnabled),s=F(d=>d.expenseAutomationViewState.selectedPeriodByTenantId),i=F(d=>Un(d,f.tenantId)),{isAiCfoAccessEnabled:p,onAskAiCfoClick:m}=qt({mobileExploreReferrer:"Month-End Close Overview"}),E=o.useCallback((d,w,Z=!1)=>{t(Ce({tenantId:w,period:{month:d.month,year:d.year},refreshViewInBackground:Z}))},[]),v=o.useCallback(d=>{const w=A.state?.referrer;i.monthEndCloseChecks?.auditSummary!=null&&z.trackMonthCloseAuditPage(d.month,d.year,i.monthEndCloseChecks.reportEmailSentDate!=null?"closed":"in-review",i.monthEndCloseChecks.auditSummary.auditScorePercentage,!1,w??null),t(Fn(f.tenantId,d))},[f.tenantId,i.monthEndCloseChecks?.auditSummary,i.monthEndCloseChecks?.reportEmailSentDate]),h=s[f.tenantId],B=o.useCallback(()=>{const d=A.state?.referrer;i.monthEndCloseChecks?.auditSummary!=null&&z.trackMonthCloseAuditPage(h.month,h.year,i.monthEndCloseChecks.reportEmailSentDate!=null?"closed":"in-review",i.monthEndCloseChecks.auditSummary.auditScorePercentage,!0,d??null),E(h,f.tenantId,!0)},[E,h,f.tenantId,i.monthEndCloseChecks?.auditSummary,i.monthEndCloseChecks?.reportEmailSentDate]),u=W(A.state?.pathnameStackToGoBack,A.pathname),g=o.useCallback(()=>{if(i.monthEndCloseChecks!=null&&h!=null){const d=i.monthEndCloseChecks.monthEndCloseCheckList.find(w=>w.progress<100);if(d!=null)return void l(`./${d.id}/${h.month}-${h.year}`,{state:{pathnameStackToGoBack:u,message:"comingFromOverview"}});l(`./month_end_insights/${h.month}-${h.year}`,{state:{pathnameStackToGoBack:u,message:"comingFromOverview"}})}},[i.monthEndCloseChecks,h]),{areTenantIdsInSync:T}=Lt();return Gt({isDataReady:i.fetchState==="Completed"}),o.useEffect(()=>{h!=null&&i.fetchState!=="In-Progress"&&i.fetchState!=="Completed"&&T&&E(h,f.tenantId)},[E,h,i.fetchState,f.tenantId,T]),o.useEffect(()=>{h!=null&&i.monthClosePerformanceTrendFetchStatus.fetchState!=="In-Progress"&&i.monthClosePerformanceTrendFetchStatus.fetchState!=="Completed"&&T&&t(Bn(h))},[h,i.monthClosePerformanceTrendFetchStatus.fetchState,T]),o.useEffect(()=>{const d=setInterval(()=>{i.fetchState!=="In-Progress"&&i.fetchState==="Completed"&&B()},3e5);return()=>clearInterval(d)},[i.fetchState]),o.useEffect(()=>{if(i.fetchState==="Completed"&&i.monthEndCloseChecks?.auditSummary!=null){const d=A.state?.referrer;z.trackMonthCloseAuditPage(i.selectedPeriod.month,i.selectedPeriod.year,i.monthEndCloseChecks.reportEmailSentDate!=null?"closed":"in-review",i.monthEndCloseChecks.auditSummary.auditScorePercentage,!1,d??null)}},[i.fetchState,i.selectedPeriod,i.monthEndCloseChecks?.auditSummary,i.monthEndCloseChecks?.reportEmailSentDate]),C.jsx(xo,{children:C.jsx(so,{monthEndCloseChecksView:i,isRealtimeInsightsFeatureEnabled:S,onMonthEndCheckClick:d=>{l(`./${d}/${h.month}-${h.year}`,{state:{pathnameStackToGoBack:u,message:"comingFromOverview",referrer:"Expense Automation - Overview"}})},onPeriodChange:v,handleReviewButtonClick:g,onBackClick:()=>{l("../../dashboard")},onReload:B,isAiCfoAccessEnabled:p,onAskAiCfoClick:m})})},xo=De.div`
1
+ import{j as C}from"./liveblocks-Dp8Rpfa6.js";import wn from"./NotFoundScreen-ChgqfaBO.js";import{a as o,b as Tt}from"./sentry-CjhVLHR5.js";import{n as De,S as xn}from"./mui-B7MJOmvc.js";import{h as se,j as wt,u as qe,g as F,k as Rn,l as rt,n as Dn,o as je}from"./core-BBidI7qX.js";import{eN as we,OK as Un,mv as Ce,fd as Fn,q6 as On,mN as xt,n6 as Rt,OL as Dt,ng as Bn,OM as Ut,mG as _n,pE as Vn,eY as he,ON as xe,s5 as Ft,Bg as Ot,OO as Bt,OP as Mn,pj as Ge,Ks as dt,Ku as jn,jt as zn,Kv as Ln,jA as $n,cU as qn,t8 as Je,jq as Gn,mT as _t,nl as Re,OQ as Jn,Jl as ut,Jk as Ae,OR as mt,jR as Nn,OS as Yn,OT as Kn,OU as Wn,OV as Zn,m_ as Hn,mL as ce,no as Pe,OW as Qn,OX as Xn,OY as ea,nv as ta,jE as na,jv as aa,OZ as oa,jD as ht,KC as sa,O_ as ca,O$ as ia,pf as la,oW as ra,nm as pe,oV as ze,P0 as da,P1 as ua,l8 as ma,bq as ha,l3 as pt,kR as pa,P2 as ga,gC as gt,fP as Ca,l0 as Sa,v1 as Ia,P3 as fa,nW as ka,nR as Ea,nV as va,nG as ya,P4 as ba,e$ as Vt,n9 as Aa,mW as Pa,fe as Ct,nq as Ta,P5 as wa,nn as Mt,P6 as xa,P7 as Ra,P8 as Da,P9 as Ua,Pa as St,pr as Fa,oM as Oa,Jj as Ba,jC as _a,Pb as Va,FA as Ma,jB as ja,e_ as za,ol as jt,oE as La,nk as It,np as $a,bC as qa,kZ as Ga,kW as Ja,Pc as Na,nF as ft,oC as kt,oA as Ya,oq as Ka,o5 as Wa,oD as Za,Pd as Ha,Pe as Qa,o9 as Xa,Pf as eo,n$ as to,o8 as no,o6 as ao,oH as oo}from"./zeni-epic-state-DqbxPrIr.js";import{p as zt,m as ge,c as z,y as H,N as Lt,cu as so,z as Ue,cv as co,ap as Te,cw as io,aP as Et,B as $t,cx as lo,am as Le,D as ro,cy as uo,U as mo,cz as ho,M as po,cA as go,cB as Co,A as So,j as Io,aJ as fo,b1 as ko,F as Eo,cC as vo}from"./index-Da7wx085.js";import{u as qt}from"./useAskAiCfoHostNavButtonProps-CVRBuwu7.js";import{c as Gt}from"./useFetchSuggestedQuestionsWhenReady-Bk64M-bJ.js";import{c as vt,C as yo}from"./TransactionDetailScreen-D6Bb0BOx.js";import{w as bo}from"./withTransactionSidePanel-BAd7sYKu.js";import{h as Ao,v as Po}from"./routePaths-BmuUFrf4.js";import{g as $e}from"./accountMappingHelper-DRBA0kts.js";import{D as To}from"./DrawerScreen-DP5_KQop.js";import"./recharts-BoxqkqlO.js";import"./analytics-BJQfczQS.js";import"./plaid-C04pF6iT.js";import"./dnd-CkhjCkb3.js";import"./stripe-DMRn4zHo.js";import"./lottie-BWQSrnVe.js";import"./lexical-ElGQdEM-.js";import"./pdf--vBxpUYp.js";import"./utils-DVwIdRkq.js";import"./decodeURIComponentSafe-B_3qleD-.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]="06ee52e3-3732-483c-84d6-51d9f90d7770",t._sentryDebugIdIdentifier="sentry-dbid-06ee52e3-3732-483c-84d6-51d9f90d7770")}catch{}})();const wo=()=>{const t=se(),l=wt(),P=qe(),f=F(d=>we(d)),{useFeatureGate:b}=zt(),{isFeatureEnabled:S}=b(ge.isRealtimeInsightsFeatureEnabled),s=F(d=>d.expenseAutomationViewState.selectedPeriodByTenantId),i=F(d=>Un(d,f.tenantId)),{isAiCfoAccessEnabled:p,onAskAiCfoClick:m}=qt({mobileExploreReferrer:"Month-End Close Overview"}),E=o.useCallback((d,w,Z=!1)=>{t(Ce({tenantId:w,period:{month:d.month,year:d.year},refreshViewInBackground:Z}))},[]),v=o.useCallback(d=>{const w=P.state?.referrer;i.monthEndCloseChecks?.auditSummary!=null&&z.trackMonthCloseAuditPage(d.month,d.year,i.monthEndCloseChecks.reportEmailSentDate!=null?"closed":"in-review",i.monthEndCloseChecks.auditSummary.auditScorePercentage,!1,w??null),t(Fn(f.tenantId,d))},[f.tenantId,i.monthEndCloseChecks?.auditSummary,i.monthEndCloseChecks?.reportEmailSentDate]),h=s[f.tenantId],O=o.useCallback(()=>{const d=P.state?.referrer;i.monthEndCloseChecks?.auditSummary!=null&&z.trackMonthCloseAuditPage(h.month,h.year,i.monthEndCloseChecks.reportEmailSentDate!=null?"closed":"in-review",i.monthEndCloseChecks.auditSummary.auditScorePercentage,!0,d??null),E(h,f.tenantId,!0)},[E,h,f.tenantId,i.monthEndCloseChecks?.auditSummary,i.monthEndCloseChecks?.reportEmailSentDate]),u=H(P.state?.pathnameStackToGoBack,P.pathname),g=o.useCallback(()=>{if(i.monthEndCloseChecks!=null&&h!=null){const d=i.monthEndCloseChecks.monthEndCloseCheckList.find(w=>w.progress<100);if(d!=null)return void l(`./${d.id}/${h.month}-${h.year}`,{state:{pathnameStackToGoBack:u,message:"comingFromOverview"}});l(`./month_end_insights/${h.month}-${h.year}`,{state:{pathnameStackToGoBack:u,message:"comingFromOverview"}})}},[i.monthEndCloseChecks,h]),{areTenantIdsInSync:T}=Lt();return Gt({isDataReady:i.fetchState==="Completed"}),o.useEffect(()=>{h!=null&&i.fetchState!=="In-Progress"&&i.fetchState!=="Completed"&&T&&E(h,f.tenantId)},[E,h,i.fetchState,f.tenantId,T]),o.useEffect(()=>{h!=null&&i.monthClosePerformanceTrendFetchStatus.fetchState!=="In-Progress"&&i.monthClosePerformanceTrendFetchStatus.fetchState!=="Completed"&&T&&t(On(h))},[h,i.monthClosePerformanceTrendFetchStatus.fetchState,T]),o.useEffect(()=>{const d=setInterval(()=>{i.fetchState!=="In-Progress"&&i.fetchState==="Completed"&&O()},3e5);return()=>clearInterval(d)},[i.fetchState]),o.useEffect(()=>{if(i.fetchState==="Completed"&&i.monthEndCloseChecks?.auditSummary!=null){const d=P.state?.referrer;z.trackMonthCloseAuditPage(i.selectedPeriod.month,i.selectedPeriod.year,i.monthEndCloseChecks.reportEmailSentDate!=null?"closed":"in-review",i.monthEndCloseChecks.auditSummary.auditScorePercentage,!1,d??null)}},[i.fetchState,i.selectedPeriod,i.monthEndCloseChecks?.auditSummary,i.monthEndCloseChecks?.reportEmailSentDate]),C.jsx(xo,{children:C.jsx(so,{monthEndCloseChecksView:i,isRealtimeInsightsFeatureEnabled:S,onMonthEndCheckClick:d=>{l(`./${d}/${h.month}-${h.year}`,{state:{pathnameStackToGoBack:u,message:"comingFromOverview",referrer:"Expense Automation - Overview"}})},onPeriodChange:v,handleReviewButtonClick:g,onBackClick:()=>{l("../../dashboard")},onReload:O,isAiCfoAccessEnabled:p,onAskAiCfoClick:m})})},xo=De.div`
2
2
  display: flex;
3
3
  height: 100vh;
4
4
  width: 100%;
5
5
  flex: 1 1 auto;
6
6
  flex-direction: column;
7
7
  background-color: ${t=>t.theme.colors.grey4};
8
- `,Ro=Tt.memo(({reconciliation:t,selectedDrawerAccountId:l,onClose:A,onFetchLinkTokenClick:f,onEstablishConnectionClick:b})=>{const S=se(),s=Ue.getSignedInUser(),i=F(n=>we(n)),p=t.excludedAccountIDs,m=o.useMemo(()=>({userId:s?.userId??"",sessionId:s?.zeniSessionId??"",tenantId:i?.tenantId??""}),[s?.userId,s?.zeniSessionId,i?.tenantId]),{accountReconciliationsByAccountID:E,monthYearPeriod:v,statementUploadChosen:h}=t,B=E[l],u=B?.accountReconEntity.statementMetaData?.statementUploadId,g=(n,a)=>{S(Mn(n,a.split(".")[0]))},T=n=>{u!=null&&S(On({accountId:l,selectedPeriod:v,fileId:n,statementUploadId:u}))},d=()=>{S(Dt({statementUploadChosen:!1}))},w=n=>{S(_n({accountId:l,selectedPeriod:v,payload:n}))},Z=n=>{S(Ut({accountId:l,selectedPeriod:v,localData:{accountSource:n}}))},M=o.useCallback(()=>{S(xt({accountId:l}))},[S,l]),O=o.useCallback(()=>{S(Rt({accountId:l}))},[S,l]),e=p.includes(l)?t.excludedAccountReconciliationByAccountID[l]:void 0;return B!=null?C.jsx(yt,{children:C.jsx(bt,{children:C.jsx(co,{excludeAccountFetch:t.excludeAccountFetchState,accountReconciliation:B,monthYearPeriod:v,onDismissClick:A,plaidConnectionDetails:t.plaidConnectionDetails,onFetchLinkTokenClick:f,onEstablishConnectionClick:b,onEditFileName:g,onDeleteFile:T,onSelectSourceType:Z,filesEndPoint:Te.fileMicroServiceBaseUrl,authParams:m,openFilePicker:h,onStatementUploadSuccess:w,onUploadWindowOpenedOnce:d,onExcludeFromReconciliation:M})})}):e!=null?C.jsx(yt,{children:C.jsx(bt,{children:C.jsx(io,{excludedAccountReconciliation:e,includeAccountFetch:t.includeAccountFetchState,onIncludeIntoReconciliation:O})})}):null}),yt=De.div`
8
+ `,Ro=Tt.memo(({reconciliation:t,selectedDrawerAccountId:l,onClose:P,onFetchLinkTokenClick:f,onEstablishConnectionClick:b})=>{const S=se(),s=Ue.getSignedInUser(),i=F(n=>we(n)),p=t.excludedAccountIDs,m=o.useMemo(()=>({userId:s?.userId??"",sessionId:s?.zeniSessionId??"",tenantId:i?.tenantId??""}),[s?.userId,s?.zeniSessionId,i?.tenantId]),{accountReconciliationsByAccountID:E,monthYearPeriod:v,statementUploadChosen:h}=t,O=E[l],u=O?.accountReconEntity.statementMetaData?.statementUploadId,g=(n,a)=>{S(Vn(n,a.split(".")[0]))},T=n=>{u!=null&&S(_n({accountId:l,selectedPeriod:v,fileId:n,statementUploadId:u}))},d=()=>{S(Dt({statementUploadChosen:!1}))},w=n=>{S(Bn({accountId:l,selectedPeriod:v,payload:n}))},Z=n=>{S(Ut({accountId:l,selectedPeriod:v,localData:{accountSource:n}}))},V=o.useCallback(()=>{S(xt({accountId:l}))},[S,l]),_=o.useCallback(()=>{S(Rt({accountId:l}))},[S,l]),e=p.includes(l)?t.excludedAccountReconciliationByAccountID[l]:void 0;return O!=null?C.jsx(yt,{children:C.jsx(bt,{children:C.jsx(co,{excludeAccountFetch:t.excludeAccountFetchState,accountReconciliation:O,monthYearPeriod:v,onDismissClick:P,plaidConnectionDetails:t.plaidConnectionDetails,onFetchLinkTokenClick:f,onEstablishConnectionClick:b,onEditFileName:g,onDeleteFile:T,onSelectSourceType:Z,filesEndPoint:Te.fileMicroServiceBaseUrl,authParams:m,openFilePicker:h,onStatementUploadSuccess:w,onUploadWindowOpenedOnce:d,onExcludeFromReconciliation:V})})}):e!=null?C.jsx(yt,{children:C.jsx(bt,{children:C.jsx(io,{excludedAccountReconciliation:e,includeAccountFetch:t.includeAccountFetchState,onIncludeIntoReconciliation:_})})}):null}),yt=De.div`
9
9
  display: flex;
10
10
  flex-direction: column;
11
11
  height: 100%;
@@ -18,8 +18,8 @@ import{j as C}from"./liveblocks-CzlYoB8q.js";import wn from"./NotFoundScreen-Coj
18
18
  min-width: 0;
19
19
  overflow-x: hidden;
20
20
  overflow-y: auto;
21
- `;function Do({companyId:t,closeCustomerRequestDrawer:l,addCustomerRequest:A,resetCustomerRequest:f}){const b=Ue.getSignedInUser();if(b==null)throw Error("Can't access Customer Request page without signing in...");const S=F(s=>Vn(s,t,b));return o.useEffect(()=>{f()},[]),C.jsx(C.Fragment,{children:S.fetchState==="In-Progress"||S.companyMonthEndReportTemplatesData.fetchState==="In-Progress"?C.jsx($t,{fetchState:"In-Progress"}):C.jsx(lo,{onCloseClick:l,addCustomerRequest:A,snippets:S.companyMonthEndReportTemplatesData,bulletPoints:S.zeniRequestsData??[]})})}const Uo=t=>t.sections.generalExpense.vendors.length+t.sections.reimbursement.vendors.length,{common:{strings:{hyphen:Fo,comma:Pt,space:Bo}},dateFormat:Jt}=ro.getLocalizedStrings(),At=oo,_o=Rn(function(t,l){const{uncategorizedAccounts:A,vendorSearchAutoCompleteData:f,monthEndInsightsCustomerRequestData:b,monthEndInsightsPreviewMode:S,companyId:s,isMissingReceiptsBulkUploadEnabled:i,isTransactionActivityEnabled:p}=l,m=Ue.getSignedInUser(),E=t.tenantState.currentTenantId,v={userId:m?.userId??"",sessionId:m?.zeniSessionId??"",tenantId:E??""},h=he(t),{selectedTransactionCategorizationTab:B}=h;return{expenseAutomationViewSelector:h,bulkUploadSelector:i===!0?h.missingReceipts.bulkUpload:void 0,vendorSearchAutoCompleteData:f,authParams:v,receiptUploadEndpoint:`${Te.accountMicroServiceBaseUrl}`,transactionAttachmentsEndpoint:`${mo}/transaction_attachments`,bulkUploadEndpoint:i===!0?`${Te.communicationAgentMicroServiceBaseUrl}/1.0/receipts/bulk-upload`:void 0,isDisabled:!1,currentTab:B,monthEndInsightsCustomerRequestData:b,monthEndInsightsPreviewMode:S,allThreadsSectionOpen:!1,enableMonthEndInsightsZeniGPTFeature:!1,loggedInUser:m,uncategorizedAccounts:A,companyId:s,isTransactionActivityEnabled:p,isAccountingClassesEnabled:Gn(t)}},function(t,l){const{themeState:A,isCOTEnabled:f,isUncategorizedExpenseCategoryEnabled:b,isMissingReceiptsBulkUploadEnabled:S,location:s,vendorSearchAutoCompleteData:i,expenseAutomationViewSelector:p,currentTenant:m,uncategorizedAccounts:E,navigate:v,onClickCustomerRequest:h,handleEditClick:B,setActivityLogTransactionId:u}=l,{selectedPeriod:g,currentSelectedView:T,reconciliation:{selectedAccountId:d}}=p,{accountSettingsView:w}=p.jeSchedules,Z=Ot(g),M=Re(Z.start),O=Re(Z.end);return{onZeniLogoClick:()=>{A.toggle()},onUploadReceiptAttachment:e=>{z.trackMissingReceiptAttached(g.month,g.year),t(Ba(e))},onUploadTransactionReceipt:(e,n,a,r,k,I)=>{t(St(e,n,{fetchState:"In-Progress"}));const y=()=>t(St(e,n,{fetchState:"Error"}));ho(`${Te.accountMicroServiceBaseUrl}/1.0/transactions/${n}/attachments`,I,n,a,r,k).then(R=>{R!=null?t(Fa(e,R)):y()}).catch(y)},onMissingReceiptsRowClick:(e,n)=>{if(l.openTransactionPanel)return void l.openTransactionPanel(e,n);const a=W(s.state?.pathnameStackToGoBack,s.pathname);v(`../../transaction/${n}/${e}`,{state:{pathnameStackToGoBack:a,message:"expenseAutomation",origin:"missing_receipts"}})},onUploadReceiptComplete:(e,n)=>{t(Ua(e,n)),m!=null&&t(Ce({tenantId:m.tenantId,period:n,refreshViewInBackground:!0}))},onUploadReceiptFetchStatus:(e,n,a,r)=>{t(Da(e,{fetchState:n,error:a})),a!=null&&t(gt({messageSection:"missing_receipts_attachment",messageText:"failed",type:"error",showStatusIcon:!0,variables:[{variableName:"__message__",variableValue:r!=null?Bo+Fo+r+Pt:Pt}]}))},onUpdateJESchedulesUIState:e=>{t(Ra(e))},onUpdateMissingReceiptsUIState:e=>{t(xa(e))},onFetchMissingReceiptsList:()=>{O!=null&&M!=null&&t(Vt({start:M,end:O},{amount:75,currencyCode:"USD",currencySymbol:"$"},!0,!1))},...S===!0?{onBulkUploadFiles:e=>{t(ao(e))},onBulkUploadProgress:e=>{t(no(e))},onBulkUploadSuccess:e=>{t(to({batchId:e}))},onBulkUploadUploadedFileCount:e=>{t(eo(e))},onConfirmBulkUploadMatch:(e,n,a,r,k)=>{t(Xa(e,n,a,r,k))},onBulkUploadConfirmMatchAcknowledged:()=>{t(Qa())},onSetBulkUploadResultsTab:e=>{t(Wa(e))},onSetBulkUploadCompletedSubTab:e=>{t(Za(e))},onSetBulkUploadSortConfig:(e,n)=>{t(kt({sortKey:e,sortOrder:n}))},onClearBulkUpload:()=>{t(Ha())},onSearchTransactionsForManualMatch:(e,n)=>{t(At(e,n??void 0))},onLoadMoreManualSearch:()=>{const{manualSearch:e}=p.missingReceipts.bulkUpload;e.nextPageToken!=null&&e.searchQuery!==""&&t(At(e.searchQuery,e.nextPageToken))},onFetchCompletedTransactions:(e,n)=>{t(Ya(e,n))},onFetchBulkUploadBatches:e=>{t(jt(e))},onFetchMoreBatchDetails:()=>{t(Ka())},onResetBulkUploadSort:()=>{t(kt({sortKey:void 0,sortOrder:void 0}))}}:{},onClearMissingReceiptsTabNavigation:()=>{t(wa())},onSearchTextChanged:e=>{const n=p.currentSelectedView,a=p.selectedTransactionCategorizationTab;n==="transaction_categorization"&&(t(ze({selectedTab:a,uiState:{searchString:e}})),O!=null&&M!=null&&t(pe(a,{start:M,end:O},!0,!1,e,void 0,!0)))},onRefresh:()=>{l.trackExpenseAutomationTabAnalytics(!0),t(Ta(b))},onClose:()=>{T==="reconciliation"&&d!=null&&t(Ct({selectedAccountId:void 0})),v("../")},onBack:()=>{T==="reconciliation"&&d!=null&&t(Ct({selectedAccountId:void 0}))},onSaveReconciliation:e=>{t(Aa(e))},onSaveReconciliationReview:e=>{t(Pa(e))},onUpdateStep:e=>{const{selectedPeriod:n}=p,a=W(s.state?.pathnameStackToGoBack,s.pathname);v(`../${e}/${n.month}-${n.year}`,{state:{pathnameStackToGoBack:a,referrer:p.currentSelectedView}}),t(Mt(e))},handleLogOutClick:()=>{const e=W(s.state?.pathnameStackToGoBack,s.pathname);v("/signout",{replace:!0,state:{pathnameStackToGoBack:e,message:"logout"}})},onJeAccountSettingsChange:e=>{const{vendorsAccountSection:n}=e,{prepaidExpensesAccount:a,fixedAssetsAccount:r,accruedExpensesAccount:k}=n,I=$e(w.prepaidExpensesAccountList,a.selectedOptions),y=$e(w.fixedAssetsAccountList,r.selectedOptions),R=$e(w.accruedExpensesAccountList,k.selectedOptions),$={selectedPrepaidExpensesAccountIds:I.map(P=>P.accountId),selectedFixedAssetsAccountIds:y.map(P=>P.accountId),selectedAccruedExpensesAccountIds:R.map(P=>P.accountId)};t(ba({data:$}))},onSaveJeAccountSettingsClick:()=>{t(ya())},onJESchedulesFormDataChange(e,n){const{jeScheduleID:a,accumulatedDepreciationCategory:r,scheduleClass:k,scheduleExpenseCategory:I,vendor:y}=n,{allAccountList:R,allClassList:$,allDepreciationAccountList:P}=p.jeSchedules,q=i.entityAutoCompleteView.vendor.length>0?i.entityAutoCompleteView.vendor.find(V=>V.id===y?.selectedOption):void 0,Y={id:q?.zeniId??y?.selectedOption??"",name:q?.name??y?.defaultOptions.find(V=>V.value===y?.selectedOption)?.label??"",logo:q?.logo},Fe=I?.selectedOption!=null?R.find(V=>V.qboId===I.selectedOption):void 0,Se=k?.selectedOption!=null?$.find(V=>V.classId===k.selectedOption):void 0,Ie=r?.selectedOption!=null?P.find(V=>V.qboId===r.selectedOption):void 0;t(va({scheduledJournalEntryID:e,localData:{jeScheduleID:a,scheduledJournalEntryID:e,updatedCategoryId:Fe?.accountId,updatedClassId:Se?.classId,updatedAccumulatedDepreciationCategoryID:Ie?.accountId,updatedVendor:{id:Y.id,name:Y.name}}}))},ignoreRecommendedJeSchedule(e,n){t(Ea(e,n))},vendorSearchAutoCompleteActions:{onAutoCompleteInputChange:(e,n)=>{e.trim().length>=2?t(ut({searchString:e,entityType:n,searchOrigin:"common"})):e.trim().length===0&&t(Pe("common"))},onCancelAutoComplete:()=>{t(Pe("common"))}},onPostJESchedule(e,n){t(ka({scheduledJournalEntryID:e,jeScheduleTransactionKey:n}))},clearJeScheduleLocalData(){t(fa())},handleJeScheduleClick:(e,n,a)=>{t(Ia({selectedJEScheduleKey:n}));const r=W(s.state?.pathnameStackToGoBack,s.pathname);v(`../../vendors/schedules/${a}/details/${e}`,{state:{pathnameStackToGoBack:r,message:"expenseAutomation",origin:"je_schedules"}})},improveMonthEndInsightsUsingZeniGPTClick:e=>{m!=null&&t(Sa(e,m.companyId,m.tenantId))},onClickCustomerRequest:h,setActivityLogTransactionId:u,onCloseAllThreadsSection:()=>{},onCloseFileAttachmentSnackBar:()=>{t(Ca())},onOpenFileAttachmentSnackBar:()=>{t(gt({messageSection:"cockpit_month_end_email_attachment_upload",messageText:"failed",type:"error",showStatusIcon:!0}))},onRemoveFileAttachment:e=>{t(ga(e))},onUpdateFileAttachment:e=>{t(pa({files:e}))},previewMonthEndReport:(e,n,a,r)=>{m!=null&&t(pt(e,m.companyId,n,!0,a,r,m.tenantId))},saveMonthEndReport:(e,n,a,r)=>{m!=null&&t(pt(e,m.companyId,n,!1,a,r,m.tenantId))},onEditMonthEndInsightsClick:B,sendMonthEndReport:e=>{const n=s.state?.referrer,{selectedPeriod:a,auditSummary:r}=p;m!=null&&r?.auditScorePercentage!=null&&(t(ma(m.companyId,e,m.tenantId)),z.trackInsightsEmailPage(a.month,a.year,!1,"draft",r.auditScorePercentage,ha().format(Jt.analytics.MMMDDCommaYYYYformat),n??null))},onTransactionCategorizationRowClick:(e,n)=>{if(l.openTransactionPanel)return void l.openTransactionPanel(e,n);const a=W(s.state?.pathnameStackToGoBack,s.pathname);v(`../../transaction/${n}/${e}`,{state:{pathnameStackToGoBack:a,message:"expenseAutomation",origin:"transaction_categorization"}})},setLocalDataForCategoryAndClass:(e,n,a,r,k,I,y,R,$,P,q)=>{t(ua(e,n,a,r,E,k,I,y,R,$,P,q))},onCancelAutoComplete:()=>{t(Pe("common"))},updateExpenseAutomationReconListScrollPosition:e=>{t(mt({scrollPosition:e}))},onUpdateTab:e=>{l.closeSidePanel?.(),O!=null&&M!=null&&(t(pe(e,{start:M,end:O},!1,!1)),t(da(e)))},onUpdateTransactionCategorizationUIState:(e,n)=>{t(ze({selectedTab:e,uiState:n})),O!=null&&M!=null&&t(pe(e,{start:M,end:O},!1,!1,n.searchString,null,!0))},onUpdateScrollYOffSetTransactionCategorizationUIState:(e,n)=>{t(ze({selectedTab:e,uiState:n}))},onFetchTransactionCategorizationList:(e,n,a,r,k,I,y)=>{O!=null&&M!=null&&t(pe(e,{start:M,end:O},!0,a,n,r,k,I,y))},resetTransactionCategorizationLocalData:(e,n,a,r,k,I,y,R)=>{t(ra(e,n,a,r,R??null,k,I,!1,y))},updateSelectedVendorForTransaction:(e,n,a,r,k)=>{t(ht({selectedTab:e,transactionId:n,lineId:a,selectedTransaction:r,uncategorizedAccounts:E,updatedVendor:k}))},onSaveUpdateTransactionCategorization:(e,n,a)=>{const r=s.state?.referrer;e==="autoCategorized"?z.trackTransactionsAutoCategorisedPage(g.month,g.year,p.transactionView.totalCountByTab.autoCategorized,n.length,!1,r??null):z.trackTransactionsReviewPage(g.month,g.year,p.transactionView.totalCountByTab.review,n.length,!1,r??null),t(la(e,n,a,b))},onUpdateSelectedCheckboxTransactionIds:(e,n)=>{t(ia({selectedTab:e,transactionIds:n}))},onFetchRecommendationsForEntityCategorizationWithCustomer:(e,n,a,r,k,I,y)=>{const{transactionId:R,transaction:$,lineIds:P}=n;I!=null&&t(sa({transactionId:R,customerUpdates:I})),t(ca({selectedTab:r,transactionId:R.id,lineId:P[0],selectedTransaction:$,uncategorizedAccounts:E,updatedCustomer:I,selectedEntity:k,isUncategorizedExpenseCategoryEnabled:y})),k!=null&&t(Je(k,e,n,a,!0,f,y))},onFetchRecommendationsForEntityCategorization:(e,n,a,r,k,I,y)=>{const{transactionId:R,transaction:$,lineIds:P}=n;I!=null&&(t(na({transactionId:R,vendorUpdates:{name:I.name,id:I.id?I.id:void 0}})),t(aa({vendorId:I.id?I.id:void 0,localData:{vendorName:I.name,vendorId:I.id?I.id:void 0}}))),I?.id?(t(ht({selectedTab:r,transactionId:R.id,lineId:P[0],selectedTransaction:$,uncategorizedAccounts:E,updatedVendor:I,selectedEntity:k,isUncategorizedExpenseCategoryEnabled:y})),k!=null&&t(Je(k,e,n,a,!0,f,y))):t(oa({selectedTab:r,transactionId:R.id,lineId:P[0]}))},fetchFluxViewOnScroll:(e,n)=>{t(Ae(e,!0,!1,n,!1,!0))},onFetchFluxViewList:()=>{t(Ae(g,!0,!1,null,!1,!1))},markAsReview:(e,n,a,r)=>{z.trackFluxAnalysisReviewed(a.month,a.year,r??!1,e),t(ta(n,e,a,r??!1))},onUpdateFluxAnalysisUIState:e=>{t(ea(e))},updateOperatingExpensesIdsForReview:e=>{t(Xn({operatingExpenseIds:e,selectedPeriod:g}))},redirectToVendorDetailPage:e=>{if(l.tenantEmailDomain!=null){const n=Ao(e.id,e.qboId,l.tenantEmailDomain),a=W(l.location.state?.pathnameStackToGoBack,l.location.pathname);l.navigate(n,{state:{pathnameStackToGoBack:a,message:"expenseAutomation",referrer:"Vendor List",origin:"flux_analysis"}})}},updateSectionIdsForReview:e=>{t(Qn({sectionId:e,selectedPeriod:g}))},onFetchReimbursementView:(e,n,a)=>{t(Ae(e,!0,!1,n,!0,a))},onReviewClicked:e=>{t(ce(g,e))},setOpenDrawerClicked:e=>{t(xe({selectedDrawerAccountId:e}))},onFetchLinkTokenClick:(e,n)=>{t(Ft("expense_automation_reconcile",e,n))},onEstablishConnectionClick:(e,n)=>{const a=m?.companyId;a!=null&&(t(Bt(e,a,"expense_automation_reconcile",void 0,"link_account_no_microdeposit",n)),t(_t({accountId:n,connectionInProgress:!0})))},onAddStatementClick:e=>{t(xe({selectedDrawerAccountId:e})),t(Ut({accountId:e,selectedPeriod:g,localData:{accountSource:"bank_statement"}})),t(Dt({statementUploadChosen:!0}))},onReloadReconciliationListPage:()=>{t(ce(g,void 0,!0,!1))},onUpdateReconcileTabLocalData:e=>{t(Wn({selectedTransactionIds:e}))},onReconTabColumnSortConfigChanged:(e,n)=>{t(Zn({sortKey:e,sortOrder:n}))},onReconReviewTabColumnSortConfigChanged:(e,n)=>{t(Hn({sortKey:e,sortOrder:n}))},onReconTabUpdate:e=>{l.closeSidePanel?.(),t(Yn({selectedTab:e}))},updateReconReviewTabLocalData:(e,n,a)=>{const r=e.vendor?.id;a&&r!=null&&t(Nn(r)),t(Kn({data:e,transactionId:n}))},onReconMatchedTransactionClick:e=>{if(l.openTransactionPanel)return void l.openTransactionPanel(e,Ge("bill"));const n=W(s.state?.pathnameStackToGoBack,s.pathname);v(`../../transaction/bill/${e}`,{state:{pathnameStackToGoBack:n,message:"expenseAutomation",origin:"reconciliation"}})},onReloadPage:()=>{window.location.reload()},onBackClick:()=>{v(-1)},onReconListPageScroll:e=>{t(mt({scrollPosition:e}))},onVendorAutoCompleteInputChange:e=>{e.trim().length>=2?t(ut({searchString:e,searchOrigin:"common"})):e.trim().length===0&&t(Pe("common"))},onReconNodeCollapseToggled:(e,n)=>{t(Jn({nodeId:e,collapsed:n}))},updateSectionCollapseStatus:()=>{},onExcludeAccountFromReconciliation:e=>{t(xt({accountId:e}))},onIncludeAccountIntoReconciliation:e=>{t(Rt({accountId:e}))}}},(t,l,A)=>{const{isMissingReceiptsBulkUploadEnabled:f,...b}=A;return function(S,s,i){return{...S,...s,...i,onUploadTransactionReceipt:(p,m,E,v,h)=>{s.onUploadTransactionReceipt(p,m,E,v,h,S.authParams)}}}(t,l,b)})(uo),Oo=bo(function(t){const l=t.displayName??t.name??"Component",A=Tt.memo(t),f=b=>{const S=se(),s=function(){const g=se(),T=F(d=>he(d).reconciliation.selectedDrawerAccountId);return{isOpen:T!=null,selectedAccountId:T,openPanel:o.useCallback(d=>{g(xe({selectedDrawerAccountId:d}))},[g]),closePanel:o.useCallback(()=>{g(xe({selectedDrawerAccountId:void 0}))},[g])}}(),i=F(g=>he(g).reconciliation),p=F(g=>we(g)),m=o.useCallback((g,T)=>{S(Ft("expense_automation_reconcile",g,T))},[S]),E=o.useCallback((g,T)=>{const d=p?.companyId;d!=null&&(S(Bt(g,d,"expense_automation_reconcile",void 0,"link_account_no_microdeposit",T)),S(_t({accountId:T,connectionInProgress:!0})))},[S,p?.companyId]),v=o.useMemo(()=>{if(s.isOpen&&s.selectedAccountId!=null)return C.jsx(Ro,{reconciliation:i,selectedDrawerAccountId:s.selectedAccountId,onClose:s.closePanel,onFetchLinkTokenClick:m,onEstablishConnectionClick:E})},[s.isOpen,s.selectedAccountId,s.closePanel,i,m,E]),h=o.useMemo(()=>({reconPanelContent:v,reconSidePanelIsOpen:s.isOpen,closeReconSidePanel:s.closePanel}),[v,s.isOpen,s.closePanel]),B=o.useContext(Et),u=o.useMemo(()=>s.isOpen?{closePanel:s.closePanel,selectedItemId:s.selectedAccountId}:B,[s.isOpen,s.closePanel,s.selectedAccountId,B]);return C.jsx(Et.Provider,{value:u,children:C.jsx(A,{...b,...h})})};return f.displayName=`withReconSidePanel(${l})`,f}(({closeSidePanel:t,openTransactionPanel:l,panelContent:A,sidePanelIsFullView:f,sidePanelIsOpen:b,reconPanelContent:S,reconSidePanelIsOpen:s,closeReconSidePanel:i})=>{const{isAiCfoOpen:p,setIsAiCfoOpen:m}=po(),E=go(),{isOpen:v}=Co(),h=wt(),B=qe(),u=se(),{isAiCfoAccessEnabled:g,onAskAiCfoClick:T}=qt({mobileExploreReferrer:"Transaction categorization"}),d=o.useCallback(()=>{b===!0&&f!==!0&&t?.()},[t,b,f]),{areTenantIdsInSync:w}=Lt(),Z=(()=>{const c=F(G=>he(G)),j=qe(),{currentSelectedViewFetchState:K,currentSelectedView:_,selectedPeriod:U}=c,me=Le(_),ee=Le(K.fetchState),ve=o.useCallback(G=>{const H=j.state?.referrer;_==="transaction_categorization"&&(c.selectedTransactionCategorizationTab==="review"?z.trackTransactionsReviewPage(U.month,U.year,c.transactionView.totalCountByTab.review,0,G,H??null):z.trackTransactionsAutoCategorisedPage(U.month,U.year,c.transactionView.totalCountByTab.autoCategorized,0,G,H??null)),_==="missing_receipts"&&z.trackMissingReceiptsPage(U.month,U.year,G,c.missingReceipts.transactions.length,H??null),_==="je_schedules"&&z.trackMonthCloseScheduleListPage(U.month,U.year,G,c.jeSchedules.draftSchedules.length,c.jeSchedules.resolveSchedules.length,H??null),_==="flux_analysis"&&z.trackFluxAnalysisPage(U.month,U.year,G,Uo(c.fluxAnalysis),H??null),_==="month_end_insights"&&c.auditSummary?.auditScorePercentage!=null&&z.trackInsightsEmailPage(U.month,U.year,G,"draft",c.auditSummary.auditScorePercentage,null,H??null)},[U,c]);return o.useEffect(()=>{ee===K.fetchState&&_===me||K.fetchState!=="Completed"||ve(!1)},[_,K.fetchState,me]),ve})(),M=So(),[O,e]=o.useState(!1),n=F(c=>dt(c)),a=F(c=>we(c)),[r,k]=o.useState(!1),[I,y]=o.useState(!1),[R,$]=o.useState([]),[P,q]=o.useState(void 0),Y=o.useCallback(c=>{c!=null&&(p&&m(!1),E(),d()),q(c)},[d,p,E,m]),Fe=o.useCallback(()=>{E(),q(void 0),d(),T()},[d,T,E]),Se=o.useRef(p);o.useEffect(()=>{p===!0&&Se.current===!1&&(E(),q(void 0),d()),Se.current=p},[d,p,E]);const Ie=o.useRef(v);o.useEffect(()=>{v===!0&&Ie.current===!1&&(p&&m(!1),q(void 0),b===!0&&f!==!0&&t?.()),Ie.current=v},[t,v,p,m,f,b]);const V=b===!0&&f!==!0,Ne=o.useRef(V);o.useEffect(()=>{V&&!Ne.current&&(p&&m(!1),E(),q(void 0)),Ne.current=V},[p,V,E,m]);const[Ke,Nt]=o.useState(!1),Ye=o.useRef(!1),{selectedTab:He}=rt(),{tenantEmailDomain:Kt}=rt(),[Be,Ze]=o.useState(B.state?.message==="comingFromTransactionDetail"),We=B.state?.message==="comingFromOverview",Yt=Io(),_e=Ue.getSignedInUser(),{useDynamicConfig:Ht,useFeatureGate:fe}=zt(),{configValue:Zt}=Ht(fo.enableUncategorizedExpenseCategory),Q=Zt?.uncategorized_expense_category_enabled===!0,{isFeatureEnabled:Qe}=fe(ge.isRealtimeInsightsFeatureEnabled),{isFeatureEnabled:ie}=fe(ge.isMissingReceiptsBulkUploadEnabled),{isFeatureEnabled:Xe}=fe(ge.isTransactionActivityEnabled),{isFeatureEnabled:Wt}=fe(ge.isExpenseAutomationCommentingEnabled),Qt=o.useCallback(c=>{const j=Ge(c.view==="reconciliation"?"bill":"expense");l?.(c.entityId,j)},[l]),Xt=F(c=>_a(c,"common")),L=F(c=>he(c)),{monthEndCloseChecksView:N,currentSelectedView:x,selectedPeriod:D,selectedTransactionCategorizationTab:ne,currentSelectedViewBackgroundRefreshFetchState:en,currentSelectedViewFetchState:X,jeSchedules:Oe,reconciliation:tn}=L;o.useEffect(()=>{x==="transaction_categorization"&&b!==!0||Y(void 0)},[x,Y,b]);const ke=o.useRef(null);o.useEffect(()=>{ke.current!==null?ke.current!==ne&&(ke.current=ne,x==="transaction_categorization"&&Y(void 0)):ke.current=ne},[x,ne,Y]);const nn=F(c=>P==null?void 0:Oa(c.transactionState,P)),ae=nn?.qboId,an=F(c=>ae==null?void 0:Ma(c,ae));o.useEffect(()=>{ae!=null&&u(Va(ae))},[u,ae]);const{selectedAccountId:le}=tn,et=Le(Oe.accountSettingsView.saveState.fetchState),on=F(c=>ja(c.accountState,c.accountListState,"accountList")),re=He!=null?za(He):x,sn=F(c=>c.entityAutoCompleteState.autoCompleteText.common);if(Gt({isDataReady:X.fetchState==="Completed"}),_e==null)throw Error("Can't access expense automation screen without signing in...");const tt=Ot(D),de=Re(tt.start),ue=Re(tt.end);if(de==null||ue==null)throw Error(`Invalid start - ${de} and end - ${ue} period from given ${D}`);const cn=o.useCallback(()=>{k(!1)},[]),ln=o.useCallback(()=>{y(!0)},[]),rn=o.useCallback(c=>{$(c),y(!1)},[]),dn=o.useCallback(()=>{$([])},[]),Ee=L.missingReceipts.bulkUpload.phase,nt=L.missingReceipts.bulkUpload.currentBatchId;o.useEffect(()=>{ie===!0&&x==="missing_receipts"&&Ee==="matching"&&nt!=null&&u(jt({cacheOverride:!0}))},[ie,x,Ee,nt,u]);const at=_e?.userId,un=D.month,mn=D.year,ot=a?.tenantId;o.useEffect(()=>{x==="missing_receipts"&&ie!==!1&&Ee==="idle"&&at!=null&&ot!=null&&u(La())},[x,ie,Ee,at,ot,un,mn,u]),o.useEffect(()=>{n.newVendorState?.vendorDetailLocalData?.vendorName!=null?e(!0):e(!1)},[n.newVendorState?.vendorDetailLocalData?.vendorName]),o.useEffect(()=>{re!=null&&x!==re&&u(Mt(re))},[re]),o.useEffect(()=>{Ke!==!1||X.fetchState!=="Completed"&&X.fetchState!=="Error"||!w||(Nt(!0),u(It(!1,!1,Q)))},[Ke,X,w,Q]),o.useEffect(()=>{!We&&w&&(u(It(!1,!1,Q)),u(ce(D,le,!1,!1)))},[D.month,D.year,w,Q]);const st=o.useCallback((c=!1,j=!1)=>{const K={start:de,end:ue};switch(x){case"transaction_categorization":u(pe(ne,K,c,!Be,void 0,void 0,j,void 0,Q)),Ze(!1);break;case"flux_analysis":u(Ae(D,c,j,null));break;case"month_end_insights":if(j===!1){const _=new Date(D.year,D.month,0),U=qa(_.toDateString()).format(Jt.analytics.YYYYDashMMDashDDFormat);u(Ga(!0,a.companyId,a.tenantId,U)),u(Ja(a.companyId,a.tenantId))}break;case"je_schedules":u($a(K,j));break;case"missing_receipts":u(Vt(K,{amount:75,currencyCode:"USD",currencySymbol:"$"},c,j));break;default:u(ce(D,le,c,j))}},[x,de,ue,a.companyId,a.tenantId,ne,D,le,Be,Ze,Q]);o.useEffect(()=>{x===re&&X.fetchState==="Not-Started"&&w&&st(!0)},[X,de,ue,a.companyId,a.tenantId,w]),o.useEffect(()=>{We||Be||Ye.current||en.fetchState==="In-Progress"||X.fetchState!=="Completed"||(Ye.current=!0,st(!0,!0))},[]),o.useEffect(()=>{N.fetchState!=="In-Progress"&&N.fetchState!=="Completed"&&u(Ce({tenantId:a.tenantId,period:D,refreshViewInBackground:!1}))},[N.fetchState,a.tenantId]),o.useEffect(()=>{L.monthEndInsights?.previewMonthEndReportStatus?.fetchState==="Completed"?k(!0):k(!1)},[L.monthEndInsights?.previewMonthEndReportStatus?.fetchState]),o.useEffect(()=>{L.monthEndInsights?.sendMonthEndReportStatus?.fetchState==="Completed"&&w&&(u(Ce({tenantId:a.tenantId,period:D,refreshViewInBackground:!0})),u(Na({companyId:a.companyId})),h("../"))},[L.monthEndInsights?.sendMonthEndReportStatus?.fetchState,a.tenantId,D,a.companyId,w]),o.useEffect(()=>{const c=setInterval(()=>{N.fetchState!=="In-Progress"&&N.fetchState==="Completed"&&u(Ce({tenantId:a.tenantId,period:D,refreshViewInBackground:!0}))},3e5);return()=>clearInterval(c)},[N.fetchState,a.tenantId,D,u]),o.useEffect(()=>{const c=setInterval(()=>{x==="reconciliation"&&le==null&&L.reconciliation.fetchStatus.fetchState==="Completed"&&L.reconciliation.refreshStatus.fetchState!=="In-Progress"&&u(ce(D,void 0,!0,!0))},3e5);return()=>clearInterval(c)},[x,u,L.reconciliation.fetchStatus.fetchState,L.reconciliation.refreshStatus.fetchState,ce,le,D]);const hn=vt();o.useEffect(()=>{const c=(N.monthEndCloseChecks?.monthEndCloseCheckList.find(j=>j.id==="month_end_insights")?.isDisabled??!1)&&!Qe;x!=="month_end_insights"||!c&&N.monthEndCloseChecks?.reportEmailSentDate==null||h("../")},[x,N.monthEndCloseChecks]);const pn=s===!0?S:A,gn=s===!0||b===!0,Cn=s===!0?i:t;o.useEffect(()=>{et==="In-Progress"&&Oe.accountSettingsView.saveState.fetchState==="Completed"&&u(ft())},[et,Oe.accountSettingsView.saveState.fetchState,ft]);const{transactionId:ct,onSaveVendor:Sn,onSaveSuccess:In,onCancel:fn,vendorViewDetails:kn}=(({expenseAutomationViewSelector:c,closeDrawerHandler:j,currentSelectedView:K})=>{const _=se();let U,me,ee;const ve=vt(),G=c.transactionView;let H=()=>{};const{transactions:En,selectedTransactionId:oe,selectedTransactionLineId:ye,transactionLocalData:vn}=G;if(K==="transaction_categorization"){const Me=vn.find(te=>te.transactionId===oe),J=En.find(te=>te.id===oe),it=ye!=null?Me?.transactionReviewLocalData?.lineItemById[ye]:void 0,lt=it?.account;me=it?.class?.classId,U=["Uncategorized Income","Uncategorized Expense"].includes(lt?.accountName??"")?void 0:lt?.accountId;const bn=Po(oe,J?.typeOfTransaction);J!=null&&bn&&(ee={id:oe,type:Ge(J.typeOfTransaction)}),H=()=>{if(oe!=null&&ye!=null&&J!=null){const te=G.transactionLocalData.find(be=>be.transactionId===oe)?.transactionReviewLocalData;if(te!=null&&J.lines!=null&&J.lines.length>0){const be=te.lineItemById[ye];let Ve=te.selectedEntity;if(qn(J)||(Ve=be.selectedEntityLine),Ve!=null){const Pn=Ve,An={transactionId:{id:J.id,type:J.type},transaction:J,lineIds:J.lines.map(Tn=>Tn.id)??[]};_(Je(Pn,be.amount.amount,An,!1,!0,ve))}}}}}const yn=F(Me=>dt(Me,void 0,U,me));return{transactionId:ee,onSaveVendor:()=>{_($n(ee,void 0,!1,!0))},onSaveSuccess:H,onCancel:()=>{ee!=null&&_(jn({transactionId:ee})),_(zn()),_(Ln()),j()},vendorViewDetails:yn}})({expenseAutomationViewSelector:L,closeDrawerHandler:()=>{e(!1)},currentSelectedView:x});return Yt?.loggedInUserRoleMap==null?N.fetchState==="Error"?C.jsx(ko,{onGoHome:()=>h("../",{replace:!0}),onReload:()=>window.location.reload()}):C.jsx($t,{fetchState:"In-Progress"}):C.jsxs(C.Fragment,{children:[C.jsx(To,{isOpen:I,drawerLeftMargin:new Eo(0,0,300,650),onClose:()=>{y(!1)},children:C.jsx(Mo,{onClick:c=>c.stopPropagation(),children:C.jsx(Do,{companyId:a.companyId,closeCustomerRequestDrawer:()=>y(!1),addCustomerRequest:rn,resetCustomerRequest:dn})})}),ct!=null&&O&&C.jsx(yo,{isOpen:O,transactionId:ct,onSaveVendor:Sn,onSaveSuccess:In,onCancel:fn,vendorViewDetails:kn}),C.jsx(_o,{navigate:h,location:B,themeState:M,vendorSearchAutoCompleteData:{autoCompleteText:sn,entityAutoCompleteView:Xt},expenseAutomationViewSelector:L,isMissingReceiptsBulkUploadEnabled:ie,monthEndInsightsPreviewMode:r,monthEndInsightsCustomerRequestData:R,isRealtimeInsightsFeatureEnabled:Qe,isUncategorizedExpenseCategoryEnabled:Q,isCOTEnabled:hn,currentTenant:a,companyId:a.companyId,signedInUser:_e,isTransactionActivityEnabled:Xe,activityLogTransactionId:x==="transaction_categorization"?P:void 0,activityLogPanel:x==="transaction_categorization"&&Xe===!0&&P!=null?C.jsx(vo,{activityLogView:an,qboId:ae,onClose:()=>Y(void 0),selectedTransactionId:P},String(P)):null,uncategorizedAccounts:on,onClickCustomerRequest:ln,handleEditClick:cn,tenantEmailDomain:Kt,trackExpenseAutomationTabAnalytics:Z,setActivityLogTransactionId:Y,closeSidePanel:Cn,openTransactionPanel:l,sidePanelIsOpen:gn,sidePanelIsFullView:s!==!0&&f,panelContent:pn,isAiCfoAccessEnabled:g,onAskAiCfoClick:Fe,isExpenseAutomationCommentingEnabled:Wt,onExpenseAutomationCommentingThreadClick:Qt,sidePanelListPercent:s===!0?66:void 0})]})})),Mo=De(xn)`
21
+ `;function Do({companyId:t,closeCustomerRequestDrawer:l,addCustomerRequest:P,resetCustomerRequest:f}){const b=Ue.getSignedInUser();if(b==null)throw Error("Can't access Customer Request page without signing in...");const S=F(s=>Mn(s,t,b));return o.useEffect(()=>{f()},[]),C.jsx(C.Fragment,{children:S.fetchState==="In-Progress"||S.companyMonthEndReportTemplatesData.fetchState==="In-Progress"?C.jsx($t,{fetchState:"In-Progress"}):C.jsx(lo,{onCloseClick:l,addCustomerRequest:P,snippets:S.companyMonthEndReportTemplatesData,bulletPoints:S.zeniRequestsData??[]})})}const Uo=t=>t.sections.generalExpense.vendors.length+t.sections.reimbursement.vendors.length,{common:{strings:{hyphen:Fo,comma:At,space:Oo}},dateFormat:Jt}=ro.getLocalizedStrings(),Pt=oo,Bo=Rn(function(t,l){const{uncategorizedAccounts:P,vendorSearchAutoCompleteData:f,monthEndInsightsCustomerRequestData:b,monthEndInsightsPreviewMode:S,companyId:s,isMissingReceiptsBulkUploadEnabled:i,isTransactionActivityEnabled:p}=l,m=Ue.getSignedInUser(),E=t.tenantState.currentTenantId,v={userId:m?.userId??"",sessionId:m?.zeniSessionId??"",tenantId:E??""},h=he(t),{selectedTransactionCategorizationTab:O}=h;return{expenseAutomationViewSelector:h,bulkUploadSelector:i===!0?h.missingReceipts.bulkUpload:void 0,vendorSearchAutoCompleteData:f,authParams:v,receiptUploadEndpoint:`${Te.accountMicroServiceBaseUrl}`,transactionAttachmentsEndpoint:`${mo}/transaction_attachments`,bulkUploadEndpoint:i===!0?`${Te.communicationAgentMicroServiceBaseUrl}/1.0/receipts/bulk-upload`:void 0,isDisabled:!1,currentTab:O,monthEndInsightsCustomerRequestData:b,monthEndInsightsPreviewMode:S,allThreadsSectionOpen:!1,enableMonthEndInsightsZeniGPTFeature:!1,loggedInUser:m,uncategorizedAccounts:P,companyId:s,isTransactionActivityEnabled:p,isAccountingClassesEnabled:Gn(t)}},function(t,l){const{themeState:P,isCOTEnabled:f,isUncategorizedExpenseCategoryEnabled:b,isMissingReceiptsBulkUploadEnabled:S,location:s,vendorSearchAutoCompleteData:i,expenseAutomationViewSelector:p,currentTenant:m,uncategorizedAccounts:E,navigate:v,onClickCustomerRequest:h,handleEditClick:O,setActivityLogTransactionId:u}=l,{selectedPeriod:g,currentSelectedView:T,reconciliation:{selectedAccountId:d}}=p,{accountSettingsView:w}=p.jeSchedules,Z=_t(g),V=Re(Z.start),_=Re(Z.end);return{onZeniLogoClick:()=>{P.toggle()},onUploadReceiptAttachment:e=>{z.trackMissingReceiptAttached(g.month,g.year),t(Oa(e))},onUploadTransactionReceipt:(e,n,a,r,k,I)=>{t(St(e,n,{fetchState:"In-Progress"}));const y=()=>t(St(e,n,{fetchState:"Error"}));ho(`${Te.accountMicroServiceBaseUrl}/1.0/transactions/${n}/attachments`,I,n,a,r,k).then(R=>{R!=null?t(Fa(e,R)):y()}).catch(y)},onMissingReceiptsRowClick:(e,n)=>{if(l.openTransactionPanel)return void l.openTransactionPanel(e,n);const a=H(s.state?.pathnameStackToGoBack,s.pathname);v(`../../transaction/${n}/${e}`,{state:{pathnameStackToGoBack:a,message:"expenseAutomation",origin:"missing_receipts"}})},onUploadReceiptComplete:(e,n)=>{t(Ua(e,n)),m!=null&&t(Ce({tenantId:m.tenantId,period:n,refreshViewInBackground:!0}))},onUploadReceiptFetchStatus:(e,n,a,r)=>{t(Da(e,{fetchState:n,error:a})),a!=null&&t(gt({messageSection:"missing_receipts_attachment",messageText:"failed",type:"error",showStatusIcon:!0,variables:[{variableName:"__message__",variableValue:r!=null?Oo+Fo+r+At:At}]}))},onUpdateJESchedulesUIState:e=>{t(Ra(e))},onUpdateMissingReceiptsUIState:e=>{t(xa(e))},onFetchMissingReceiptsList:()=>{_!=null&&V!=null&&t(Mt({start:V,end:_},{amount:75,currencyCode:"USD",currencySymbol:"$"},!0,!1))},...S===!0?{onBulkUploadFiles:e=>{t(ao(e))},onBulkUploadProgress:e=>{t(no(e))},onBulkUploadSuccess:e=>{t(to({batchId:e}))},onBulkUploadUploadedFileCount:e=>{t(eo(e))},onConfirmBulkUploadMatch:(e,n,a,r,k)=>{t(Xa(e,n,a,r,k))},onBulkUploadConfirmMatchAcknowledged:()=>{t(Qa())},onSetBulkUploadResultsTab:e=>{t(Ha(e))},onSetBulkUploadCompletedSubTab:e=>{t(Za(e))},onSetBulkUploadSortConfig:(e,n)=>{t(kt({sortKey:e,sortOrder:n}))},onClearBulkUpload:()=>{t(Wa())},onSearchTransactionsForManualMatch:(e,n)=>{t(Pt(e,n??void 0))},onLoadMoreManualSearch:()=>{const{manualSearch:e}=p.missingReceipts.bulkUpload;e.nextPageToken!=null&&e.searchQuery!==""&&t(Pt(e.searchQuery,e.nextPageToken))},onFetchCompletedTransactions:(e,n)=>{t(Ka(e,n))},onFetchBulkUploadBatches:e=>{t(jt(e))},onFetchMoreBatchDetails:()=>{t(Ya())},onResetBulkUploadSort:()=>{t(kt({sortKey:void 0,sortOrder:void 0}))}}:{},onClearMissingReceiptsTabNavigation:()=>{t(wa())},onSearchTextChanged:e=>{const n=p.currentSelectedView,a=p.selectedTransactionCategorizationTab;n==="transaction_categorization"&&(t(ze({selectedTab:a,uiState:{searchString:e}})),_!=null&&V!=null&&t(pe(a,{start:V,end:_},!0,!1,e,void 0,!0)))},onRefresh:()=>{l.trackExpenseAutomationTabAnalytics(!0),t(Ta(b))},onClose:()=>{T==="reconciliation"&&d!=null&&t(Ct({selectedAccountId:void 0})),v("../")},onBack:()=>{T==="reconciliation"&&d!=null&&t(Ct({selectedAccountId:void 0}))},onSaveReconciliation:e=>{t(Pa(e))},onSaveReconciliationReview:e=>{t(Aa(e))},onUpdateStep:e=>{const{selectedPeriod:n}=p,a=H(s.state?.pathnameStackToGoBack,s.pathname);v(`../${e}/${n.month}-${n.year}`,{state:{pathnameStackToGoBack:a,referrer:p.currentSelectedView}}),t(Vt(e))},handleLogOutClick:()=>{const e=H(s.state?.pathnameStackToGoBack,s.pathname);v("/signout",{replace:!0,state:{pathnameStackToGoBack:e,message:"logout"}})},onJeAccountSettingsChange:e=>{const{vendorsAccountSection:n}=e,{prepaidExpensesAccount:a,fixedAssetsAccount:r,accruedExpensesAccount:k}=n,I=$e(w.prepaidExpensesAccountList,a.selectedOptions),y=$e(w.fixedAssetsAccountList,r.selectedOptions),R=$e(w.accruedExpensesAccountList,k.selectedOptions),$={selectedPrepaidExpensesAccountIds:I.map(A=>A.accountId),selectedFixedAssetsAccountIds:y.map(A=>A.accountId),selectedAccruedExpensesAccountIds:R.map(A=>A.accountId)};t(ba({data:$}))},onSaveJeAccountSettingsClick:()=>{t(ya())},onJESchedulesFormDataChange(e,n){const{jeScheduleID:a,accumulatedDepreciationCategory:r,scheduleClass:k,scheduleExpenseCategory:I,vendor:y}=n,{allAccountList:R,allClassList:$,allDepreciationAccountList:A}=p.jeSchedules,q=i.entityAutoCompleteView.vendor.length>0?i.entityAutoCompleteView.vendor.find(M=>M.id===y?.selectedOption):void 0,K={id:q?.zeniId??y?.selectedOption??"",name:q?.name??y?.defaultOptions.find(M=>M.value===y?.selectedOption)?.label??"",logo:q?.logo},Fe=I?.selectedOption!=null?R.find(M=>M.qboId===I.selectedOption):void 0,Se=k?.selectedOption!=null?$.find(M=>M.classId===k.selectedOption):void 0,Ie=r?.selectedOption!=null?A.find(M=>M.qboId===r.selectedOption):void 0;t(va({scheduledJournalEntryID:e,localData:{jeScheduleID:a,scheduledJournalEntryID:e,updatedCategoryId:Fe?.accountId,updatedClassId:Se?.classId,updatedAccumulatedDepreciationCategoryID:Ie?.accountId,updatedVendor:{id:K.id,name:K.name}}}))},ignoreRecommendedJeSchedule(e,n){t(Ea(e,n))},vendorSearchAutoCompleteActions:{onAutoCompleteInputChange:(e,n)=>{e.trim().length>=2?t(ut({searchString:e,entityType:n,searchOrigin:"common"})):e.trim().length===0&&t(Ae("common"))},onCancelAutoComplete:()=>{t(Ae("common"))}},onPostJESchedule(e,n){t(ka({scheduledJournalEntryID:e,jeScheduleTransactionKey:n}))},clearJeScheduleLocalData(){t(fa())},handleJeScheduleClick:(e,n,a)=>{t(Ia({selectedJEScheduleKey:n}));const r=H(s.state?.pathnameStackToGoBack,s.pathname);v(`../../vendors/schedules/${a}/details/${e}`,{state:{pathnameStackToGoBack:r,message:"expenseAutomation",origin:"je_schedules"}})},improveMonthEndInsightsUsingZeniGPTClick:e=>{m!=null&&t(Sa(e,m.companyId,m.tenantId))},onClickCustomerRequest:h,setActivityLogTransactionId:u,onCloseAllThreadsSection:()=>{},onCloseFileAttachmentSnackBar:()=>{t(Ca())},onOpenFileAttachmentSnackBar:()=>{t(gt({messageSection:"cockpit_month_end_email_attachment_upload",messageText:"failed",type:"error",showStatusIcon:!0}))},onRemoveFileAttachment:e=>{t(ga(e))},onUpdateFileAttachment:e=>{t(pa({files:e}))},previewMonthEndReport:(e,n,a,r)=>{m!=null&&t(pt(e,m.companyId,n,!0,a,r,m.tenantId))},saveMonthEndReport:(e,n,a,r)=>{m!=null&&t(pt(e,m.companyId,n,!1,a,r,m.tenantId))},onEditMonthEndInsightsClick:O,sendMonthEndReport:e=>{const n=s.state?.referrer,{selectedPeriod:a,auditSummary:r}=p;m!=null&&r?.auditScorePercentage!=null&&(t(ma(m.companyId,e,m.tenantId)),z.trackInsightsEmailPage(a.month,a.year,!1,"draft",r.auditScorePercentage,ha().format(Jt.analytics.MMMDDCommaYYYYformat),n??null))},onTransactionCategorizationRowClick:(e,n)=>{if(l.openTransactionPanel)return void l.openTransactionPanel(e,n);const a=H(s.state?.pathnameStackToGoBack,s.pathname);v(`../../transaction/${n}/${e}`,{state:{pathnameStackToGoBack:a,message:"expenseAutomation",origin:"transaction_categorization"}})},setLocalDataForCategoryAndClass:(e,n,a,r,k,I,y,R,$,A,q)=>{t(ua(e,n,a,r,E,k,I,y,R,$,A,q))},onCancelAutoComplete:()=>{t(Ae("common"))},updateExpenseAutomationReconListScrollPosition:e=>{t(mt({scrollPosition:e}))},onUpdateTab:e=>{l.closeSidePanel?.(),_!=null&&V!=null&&(t(pe(e,{start:V,end:_},!1,!1)),t(da(e)))},onUpdateTransactionCategorizationUIState:(e,n)=>{t(ze({selectedTab:e,uiState:n})),_!=null&&V!=null&&t(pe(e,{start:V,end:_},!1,!1,n.searchString,null,!0))},onUpdateScrollYOffSetTransactionCategorizationUIState:(e,n)=>{t(ze({selectedTab:e,uiState:n}))},onFetchTransactionCategorizationList:(e,n,a,r,k,I,y)=>{_!=null&&V!=null&&t(pe(e,{start:V,end:_},!0,a,n,r,k,I,y))},resetTransactionCategorizationLocalData:(e,n,a,r,k,I,y,R)=>{t(ra(e,n,a,r,R??null,k,I,!1,y))},updateSelectedVendorForTransaction:(e,n,a,r,k)=>{t(ht({selectedTab:e,transactionId:n,lineId:a,selectedTransaction:r,uncategorizedAccounts:E,updatedVendor:k}))},onSaveUpdateTransactionCategorization:(e,n,a)=>{const r=s.state?.referrer;e==="autoCategorized"?z.trackTransactionsAutoCategorisedPage(g.month,g.year,p.transactionView.totalCountByTab.autoCategorized,n.length,!1,r??null):z.trackTransactionsReviewPage(g.month,g.year,p.transactionView.totalCountByTab.review,n.length,!1,r??null),t(la(e,n,a,b))},onUpdateSelectedCheckboxTransactionIds:(e,n)=>{t(ia({selectedTab:e,transactionIds:n}))},onFetchRecommendationsForEntityCategorizationWithCustomer:(e,n,a,r,k,I,y)=>{const{transactionId:R,transaction:$,lineIds:A}=n;I!=null&&t(sa({transactionId:R,customerUpdates:I})),t(ca({selectedTab:r,transactionId:R.id,lineId:A[0],selectedTransaction:$,uncategorizedAccounts:E,updatedCustomer:I,selectedEntity:k,isUncategorizedExpenseCategoryEnabled:y})),k!=null&&t(Je(k,e,n,a,!0,f,y))},onFetchRecommendationsForEntityCategorization:(e,n,a,r,k,I,y)=>{const{transactionId:R,transaction:$,lineIds:A}=n;I!=null&&(t(na({transactionId:R,vendorUpdates:{name:I.name,id:I.id?I.id:void 0}})),t(aa({vendorId:I.id?I.id:void 0,localData:{vendorName:I.name,vendorId:I.id?I.id:void 0}}))),I?.id?(t(ht({selectedTab:r,transactionId:R.id,lineId:A[0],selectedTransaction:$,uncategorizedAccounts:E,updatedVendor:I,selectedEntity:k,isUncategorizedExpenseCategoryEnabled:y})),k!=null&&t(Je(k,e,n,a,!0,f,y))):t(oa({selectedTab:r,transactionId:R.id,lineId:A[0]}))},fetchFluxViewOnScroll:(e,n)=>{t(Pe(e,!0,!1,n,!1,!0))},onFetchFluxViewList:()=>{t(Pe(g,!0,!1,null,!1,!1))},markAsReview:(e,n,a,r)=>{z.trackFluxAnalysisReviewed(a.month,a.year,r??!1,e),t(ta(n,e,a,r??!1))},onUpdateFluxAnalysisUIState:e=>{t(ea(e))},updateOperatingExpensesIdsForReview:e=>{t(Xn({operatingExpenseIds:e,selectedPeriod:g}))},redirectToVendorDetailPage:e=>{if(l.tenantEmailDomain!=null){const n=Po(e.id,e.qboId,l.tenantEmailDomain),a=H(l.location.state?.pathnameStackToGoBack,l.location.pathname);l.navigate(n,{state:{pathnameStackToGoBack:a,message:"expenseAutomation",referrer:"Vendor List",origin:"flux_analysis"}})}},updateSectionIdsForReview:e=>{t(Qn({sectionId:e,selectedPeriod:g}))},onFetchReimbursementView:(e,n,a)=>{t(Pe(e,!0,!1,n,!0,a))},onReviewClicked:e=>{t(ce(g,e))},setOpenDrawerClicked:e=>{t(xe({selectedDrawerAccountId:e}))},onFetchLinkTokenClick:(e,n)=>{t(Ft("expense_automation_reconcile",e,n))},onEstablishConnectionClick:(e,n)=>{const a=m?.companyId;a!=null&&(t(Ot(e,a,"expense_automation_reconcile",void 0,"link_account_no_microdeposit",n)),t(Bt({accountId:n,connectionInProgress:!0})))},onAddStatementClick:e=>{t(xe({selectedDrawerAccountId:e})),t(Ut({accountId:e,selectedPeriod:g,localData:{accountSource:"bank_statement"}})),t(Dt({statementUploadChosen:!0}))},onReloadReconciliationListPage:()=>{t(ce(g,void 0,!0,!1))},onUpdateReconcileTabLocalData:e=>{t(Hn({selectedTransactionIds:e}))},onReconTabColumnSortConfigChanged:(e,n)=>{t(Zn({sortKey:e,sortOrder:n}))},onReconReviewTabColumnSortConfigChanged:(e,n)=>{t(Wn({sortKey:e,sortOrder:n}))},onReconTabUpdate:e=>{l.closeSidePanel?.(),t(Kn({selectedTab:e}))},updateReconReviewTabLocalData:(e,n,a)=>{const r=e.vendor?.id;a&&r!=null&&t(Nn(r)),t(Yn({data:e,transactionId:n}))},onReconMatchedTransactionClick:e=>{if(l.openTransactionPanel)return void l.openTransactionPanel(e,Ge("bill"));const n=H(s.state?.pathnameStackToGoBack,s.pathname);v(`../../transaction/bill/${e}`,{state:{pathnameStackToGoBack:n,message:"expenseAutomation",origin:"reconciliation"}})},onReloadPage:()=>{window.location.reload()},onBackClick:()=>{v(-1)},onReconListPageScroll:e=>{t(mt({scrollPosition:e}))},onVendorAutoCompleteInputChange:e=>{e.trim().length>=2?t(ut({searchString:e,searchOrigin:"common"})):e.trim().length===0&&t(Ae("common"))},onReconNodeCollapseToggled:(e,n)=>{t(Jn({nodeId:e,collapsed:n}))},updateSectionCollapseStatus:()=>{},onExcludeAccountFromReconciliation:e=>{t(xt({accountId:e}))},onIncludeAccountIntoReconciliation:e=>{t(Rt({accountId:e}))}}},(t,l,P)=>{const{isMissingReceiptsBulkUploadEnabled:f,...b}=P;return function(S,s,i){return{...S,...s,...i,onUploadTransactionReceipt:(p,m,E,v,h)=>{s.onUploadTransactionReceipt(p,m,E,v,h,S.authParams)}}}(t,l,b)})(uo),_o=bo(function(t){const l=t.displayName??t.name??"Component",P=Tt.memo(t),f=b=>{const S=se(),s=function(){const g=se(),T=F(d=>he(d).reconciliation.selectedDrawerAccountId);return{isOpen:T!=null,selectedAccountId:T,openPanel:o.useCallback(d=>{g(xe({selectedDrawerAccountId:d}))},[g]),closePanel:o.useCallback(()=>{g(xe({selectedDrawerAccountId:void 0}))},[g])}}(),i=F(g=>he(g).reconciliation),p=F(g=>we(g)),m=o.useCallback((g,T)=>{S(Ft("expense_automation_reconcile",g,T))},[S]),E=o.useCallback((g,T)=>{const d=p?.companyId;d!=null&&(S(Ot(g,d,"expense_automation_reconcile",void 0,"link_account_no_microdeposit",T)),S(Bt({accountId:T,connectionInProgress:!0})))},[S,p?.companyId]),v=o.useMemo(()=>{if(s.isOpen&&s.selectedAccountId!=null)return C.jsx(Ro,{reconciliation:i,selectedDrawerAccountId:s.selectedAccountId,onClose:s.closePanel,onFetchLinkTokenClick:m,onEstablishConnectionClick:E})},[s.isOpen,s.selectedAccountId,s.closePanel,i,m,E]),h=o.useMemo(()=>({reconPanelContent:v,reconSidePanelIsOpen:s.isOpen,closeReconSidePanel:s.closePanel}),[v,s.isOpen,s.closePanel]),O=o.useContext(Et),u=o.useMemo(()=>s.isOpen?{closePanel:s.closePanel,selectedItemId:s.selectedAccountId}:O,[s.isOpen,s.closePanel,s.selectedAccountId,O]);return C.jsx(Et.Provider,{value:u,children:C.jsx(P,{...b,...h})})};return f.displayName=`withReconSidePanel(${l})`,f}(({closeSidePanel:t,openTransactionPanel:l,panelContent:P,sidePanelIsFullView:f,sidePanelIsOpen:b,reconPanelContent:S,reconSidePanelIsOpen:s,closeReconSidePanel:i})=>{const{isAiCfoOpen:p,setIsAiCfoOpen:m}=po(),E=go(),{isOpen:v}=Co(),h=wt(),O=qe(),u=se(),{isAiCfoAccessEnabled:g,onAskAiCfoClick:T}=qt({mobileExploreReferrer:"Transaction categorization"}),d=o.useCallback(()=>{b===!0&&f!==!0&&t?.()},[t,b,f]),{areTenantIdsInSync:w}=Lt(),Z=(()=>{const c=F(G=>he(G)),j=qe(),{currentSelectedViewFetchState:Y,currentSelectedView:B,selectedPeriod:U}=c,me=Le(B),ee=Le(Y.fetchState),ve=o.useCallback(G=>{const W=j.state?.referrer;B==="transaction_categorization"&&(c.selectedTransactionCategorizationTab==="review"?z.trackTransactionsReviewPage(U.month,U.year,c.transactionView.totalCountByTab.review,0,G,W??null):z.trackTransactionsAutoCategorisedPage(U.month,U.year,c.transactionView.totalCountByTab.autoCategorized,0,G,W??null)),B==="missing_receipts"&&z.trackMissingReceiptsPage(U.month,U.year,G,c.missingReceipts.transactions.length,W??null),B==="je_schedules"&&z.trackMonthCloseScheduleListPage(U.month,U.year,G,c.jeSchedules.draftSchedules.length,c.jeSchedules.resolveSchedules.length,W??null),B==="flux_analysis"&&z.trackFluxAnalysisPage(U.month,U.year,G,Uo(c.fluxAnalysis),W??null),B==="month_end_insights"&&c.auditSummary?.auditScorePercentage!=null&&z.trackInsightsEmailPage(U.month,U.year,G,"draft",c.auditSummary.auditScorePercentage,null,W??null)},[U,c]);return o.useEffect(()=>{ee===Y.fetchState&&B===me||Y.fetchState!=="Completed"||ve(!1)},[B,Y.fetchState,me]),ve})(),V=So(),[_,e]=o.useState(!1),n=F(c=>dt(c)),a=F(c=>we(c)),[r,k]=o.useState(!1),[I,y]=o.useState(!1),[R,$]=o.useState([]),[A,q]=o.useState(void 0),K=o.useCallback(c=>{c!=null&&(p&&m(!1),E(),d()),q(c)},[d,p,E,m]),Fe=o.useCallback(()=>{E(),q(void 0),d(),T()},[d,T,E]),Se=o.useRef(p);o.useEffect(()=>{p===!0&&Se.current===!1&&(E(),q(void 0),d()),Se.current=p},[d,p,E]);const Ie=o.useRef(v);o.useEffect(()=>{v===!0&&Ie.current===!1&&(p&&m(!1),q(void 0),b===!0&&f!==!0&&t?.()),Ie.current=v},[t,v,p,m,f,b]);const M=b===!0&&f!==!0,Ne=o.useRef(M);o.useEffect(()=>{M&&!Ne.current&&(p&&m(!1),E(),q(void 0)),Ne.current=M},[p,M,E,m]);const[Ye,Nt]=o.useState(!1),Ke=o.useRef(!1),{selectedTab:We}=rt(),{tenantEmailDomain:Yt}=rt(),[Oe,Ze]=o.useState(O.state?.message==="comingFromTransactionDetail"),He=O.state?.message==="comingFromOverview",Kt=Io(),Be=Ue.getSignedInUser(),{useDynamicConfig:Wt,useFeatureGate:fe}=zt(),{configValue:Zt}=Wt(fo.enableUncategorizedExpenseCategory),Q=Zt?.uncategorized_expense_category_enabled===!0,{isFeatureEnabled:Qe}=fe(ge.isRealtimeInsightsFeatureEnabled),{isFeatureEnabled:ie}=fe(ge.isMissingReceiptsBulkUploadEnabled),{isFeatureEnabled:Xe}=fe(ge.isTransactionActivityEnabled),{isFeatureEnabled:Ht}=fe(ge.isExpenseAutomationCommentingEnabled),Qt=o.useCallback(c=>{const j=Ge(c.view==="reconciliation"?"bill":"expense");l?.(c.entityId,j)},[l]),Xt=F(c=>Ba(c,"common")),L=F(c=>he(c)),{monthEndCloseChecksView:N,currentSelectedView:x,selectedPeriod:D,selectedTransactionCategorizationTab:ne,currentSelectedViewBackgroundRefreshFetchState:en,currentSelectedViewFetchState:X,jeSchedules:_e,reconciliation:tn}=L;o.useEffect(()=>{x==="transaction_categorization"&&b!==!0||K(void 0)},[x,K,b]);const ke=o.useRef(null);o.useEffect(()=>{ke.current!==null?ke.current!==ne&&(ke.current=ne,x==="transaction_categorization"&&K(void 0)):ke.current=ne},[x,ne,K]);const nn=F(c=>A==null?void 0:_a(c.transactionState,A)),ae=nn?.qboId,an=F(c=>ae==null?void 0:Va(c,ae));o.useEffect(()=>{ae!=null&&u(Ma(ae))},[u,ae]);const{selectedAccountId:le}=tn,et=Le(_e.accountSettingsView.saveState.fetchState),on=F(c=>ja(c.accountState,c.accountListState,"accountList")),re=We!=null?za(We):x,sn=F(c=>c.entityAutoCompleteState.autoCompleteText.common);if(Gt({isDataReady:X.fetchState==="Completed"}),Be==null)throw Error("Can't access expense automation screen without signing in...");const tt=_t(D),de=Re(tt.start),ue=Re(tt.end);if(de==null||ue==null)throw Error(`Invalid start - ${de} and end - ${ue} period from given ${D}`);const cn=o.useCallback(()=>{k(!1)},[]),ln=o.useCallback(()=>{y(!0)},[]),rn=o.useCallback(c=>{$(c),y(!1)},[]),dn=o.useCallback(()=>{$([])},[]),Ee=L.missingReceipts.bulkUpload.phase,nt=L.missingReceipts.bulkUpload.currentBatchId;o.useEffect(()=>{ie===!0&&x==="missing_receipts"&&Ee==="matching"&&nt!=null&&u(jt({cacheOverride:!0}))},[ie,x,Ee,nt,u]);const at=Be?.userId,un=D.month,mn=D.year,ot=a?.tenantId;o.useEffect(()=>{x==="missing_receipts"&&ie!==!1&&Ee==="idle"&&at!=null&&ot!=null&&u(La())},[x,ie,Ee,at,ot,un,mn,u]),o.useEffect(()=>{n.newVendorState?.vendorDetailLocalData?.vendorName!=null?e(!0):e(!1)},[n.newVendorState?.vendorDetailLocalData?.vendorName]),o.useEffect(()=>{re!=null&&x!==re&&u(Vt(re))},[re]),o.useEffect(()=>{Ye!==!1||X.fetchState!=="Completed"&&X.fetchState!=="Error"||!w||(Nt(!0),u(It(!1,!1,Q)))},[Ye,X,w,Q]),o.useEffect(()=>{!He&&w&&(u(It(!1,!1,Q)),u(ce(D,le,!1,!1)))},[D.month,D.year,w,Q]);const st=o.useCallback((c=!1,j=!1)=>{const Y={start:de,end:ue};switch(x){case"transaction_categorization":u(pe(ne,Y,c,!Oe,void 0,void 0,j,void 0,Q)),Ze(!1);break;case"flux_analysis":u(Pe(D,c,j,null));break;case"month_end_insights":if(j===!1){const B=new Date(D.year,D.month,0),U=qa(B.toDateString()).format(Jt.analytics.YYYYDashMMDashDDFormat);u(Ga(!0,a.companyId,a.tenantId,U)),u(Ja(a.companyId,a.tenantId))}break;case"je_schedules":u($a(Y,j));break;case"missing_receipts":u(Mt(Y,{amount:75,currencyCode:"USD",currencySymbol:"$"},c,j));break;default:u(ce(D,le,c,j))}},[x,de,ue,a.companyId,a.tenantId,ne,D,le,Oe,Ze,Q]);o.useEffect(()=>{x===re&&X.fetchState==="Not-Started"&&w&&st(!0)},[X,de,ue,a.companyId,a.tenantId,w]),o.useEffect(()=>{He||Oe||Ke.current||en.fetchState==="In-Progress"||X.fetchState!=="Completed"||(Ke.current=!0,st(!0,!0))},[]),o.useEffect(()=>{N.fetchState!=="In-Progress"&&N.fetchState!=="Completed"&&u(Ce({tenantId:a.tenantId,period:D,refreshViewInBackground:!1}))},[N.fetchState,a.tenantId]),o.useEffect(()=>{L.monthEndInsights?.previewMonthEndReportStatus?.fetchState==="Completed"?k(!0):k(!1)},[L.monthEndInsights?.previewMonthEndReportStatus?.fetchState]),o.useEffect(()=>{L.monthEndInsights?.sendMonthEndReportStatus?.fetchState==="Completed"&&w&&(u(Ce({tenantId:a.tenantId,period:D,refreshViewInBackground:!0})),u(Na({companyId:a.companyId})),h("../"))},[L.monthEndInsights?.sendMonthEndReportStatus?.fetchState,a.tenantId,D,a.companyId,w]),o.useEffect(()=>{const c=setInterval(()=>{N.fetchState!=="In-Progress"&&N.fetchState==="Completed"&&u(Ce({tenantId:a.tenantId,period:D,refreshViewInBackground:!0}))},3e5);return()=>clearInterval(c)},[N.fetchState,a.tenantId,D,u]),o.useEffect(()=>{const c=setInterval(()=>{x==="reconciliation"&&le==null&&L.reconciliation.fetchStatus.fetchState==="Completed"&&L.reconciliation.refreshStatus.fetchState!=="In-Progress"&&u(ce(D,void 0,!0,!0))},3e5);return()=>clearInterval(c)},[x,u,L.reconciliation.fetchStatus.fetchState,L.reconciliation.refreshStatus.fetchState,ce,le,D]);const hn=vt();o.useEffect(()=>{const c=(N.monthEndCloseChecks?.monthEndCloseCheckList.find(j=>j.id==="month_end_insights")?.isDisabled??!1)&&!Qe;x!=="month_end_insights"||!c&&N.monthEndCloseChecks?.reportEmailSentDate==null||h("../")},[x,N.monthEndCloseChecks]);const pn=s===!0?S:P,gn=s===!0||b===!0,Cn=s===!0?i:t;o.useEffect(()=>{et==="In-Progress"&&_e.accountSettingsView.saveState.fetchState==="Completed"&&u(ft())},[et,_e.accountSettingsView.saveState.fetchState,ft]);const{transactionId:ct,onSaveVendor:Sn,onSaveSuccess:In,onCancel:fn,vendorViewDetails:kn}=(({expenseAutomationViewSelector:c,closeDrawerHandler:j,currentSelectedView:Y})=>{const B=se();let U,me,ee;const ve=vt(),G=c.transactionView;let W=()=>{};const{transactions:En,selectedTransactionId:oe,selectedTransactionLineId:ye,transactionLocalData:vn}=G;if(Y==="transaction_categorization"){const Ve=vn.find(te=>te.transactionId===oe),J=En.find(te=>te.id===oe),it=ye!=null?Ve?.transactionReviewLocalData?.lineItemById[ye]:void 0,lt=it?.account;me=it?.class?.classId,U=["Uncategorized Income","Uncategorized Expense"].includes(lt?.accountName??"")?void 0:lt?.accountId;const bn=Ao(oe,J?.typeOfTransaction);J!=null&&bn&&(ee={id:oe,type:Ge(J.typeOfTransaction)}),W=()=>{if(oe!=null&&ye!=null&&J!=null){const te=G.transactionLocalData.find(be=>be.transactionId===oe)?.transactionReviewLocalData;if(te!=null&&J.lines!=null&&J.lines.length>0){const be=te.lineItemById[ye];let Me=te.selectedEntity;if(qn(J)||(Me=be.selectedEntityLine),Me!=null){const An=Me,Pn={transactionId:{id:J.id,type:J.type},transaction:J,lineIds:J.lines.map(Tn=>Tn.id)??[]};B(Je(An,be.amount.amount,Pn,!1,!0,ve))}}}}}const yn=F(Ve=>dt(Ve,void 0,U,me));return{transactionId:ee,onSaveVendor:()=>{B($n(ee,void 0,!1,!0))},onSaveSuccess:W,onCancel:()=>{ee!=null&&B(jn({transactionId:ee})),B(zn()),B(Ln()),j()},vendorViewDetails:yn}})({expenseAutomationViewSelector:L,closeDrawerHandler:()=>{e(!1)},currentSelectedView:x});return Kt?.loggedInUserRoleMap==null?N.fetchState==="Error"?C.jsx(ko,{onGoHome:()=>h("../",{replace:!0}),onReload:()=>window.location.reload()}):C.jsx($t,{fetchState:"In-Progress"}):C.jsxs(C.Fragment,{children:[C.jsx(To,{isOpen:I,drawerLeftMargin:new Eo(0,0,300,650),onClose:()=>{y(!1)},children:C.jsx(Vo,{onClick:c=>c.stopPropagation(),children:C.jsx(Do,{companyId:a.companyId,closeCustomerRequestDrawer:()=>y(!1),addCustomerRequest:rn,resetCustomerRequest:dn})})}),ct!=null&&_&&C.jsx(yo,{isOpen:_,transactionId:ct,onSaveVendor:Sn,onSaveSuccess:In,onCancel:fn,vendorViewDetails:kn}),C.jsx(Bo,{navigate:h,location:O,themeState:V,vendorSearchAutoCompleteData:{autoCompleteText:sn,entityAutoCompleteView:Xt},expenseAutomationViewSelector:L,isMissingReceiptsBulkUploadEnabled:ie,monthEndInsightsPreviewMode:r,monthEndInsightsCustomerRequestData:R,isRealtimeInsightsFeatureEnabled:Qe,isUncategorizedExpenseCategoryEnabled:Q,isCOTEnabled:hn,currentTenant:a,companyId:a.companyId,signedInUser:Be,isTransactionActivityEnabled:Xe,activityLogTransactionId:x==="transaction_categorization"?A:void 0,activityLogPanel:x==="transaction_categorization"&&Xe===!0&&A!=null?C.jsx(vo,{activityLogView:an,qboId:ae,onClose:()=>K(void 0),selectedTransactionId:A},String(A)):null,uncategorizedAccounts:on,onClickCustomerRequest:ln,handleEditClick:cn,tenantEmailDomain:Yt,trackExpenseAutomationTabAnalytics:Z,setActivityLogTransactionId:K,closeSidePanel:Cn,openTransactionPanel:l,sidePanelIsOpen:gn,sidePanelIsFullView:s!==!0&&f,panelContent:pn,isAiCfoAccessEnabled:g,onAskAiCfoClick:Fe,isExpenseAutomationCommentingEnabled:Ht,onExpenseAutomationCommentingThreadClick:Qt,sidePanelListPercent:s===!0?66:void 0})]})})),Vo=De(xn)`
22
22
  display: flex;
23
23
  min-height: 100%;
24
24
  flex-direction: column;
25
- `;function ls(){return C.jsxs(Dn,{children:[C.jsx(je,{path:"*",element:C.jsx(wo,{})}),C.jsx(je,{path:"/:selectedTab/:selectedPeriod/*",element:C.jsx(Oo,{})}),C.jsx(je,{path:"*",element:C.jsx(wn,{})})]})}export{ls as default};
25
+ `;function ls(){return C.jsxs(Dn,{children:[C.jsx(je,{path:"*",element:C.jsx(wo,{})}),C.jsx(je,{path:"/:selectedTab/:selectedPeriod/*",element:C.jsx(_o,{})}),C.jsx(je,{path:"*",element:C.jsx(wn,{})})]})}export{ls as default};
@@ -0,0 +1 @@
1
+ import{j as s}from"./liveblocks-Dp8Rpfa6.js";import{a as r}from"./sentry-CjhVLHR5.js";import{Y as l,Z as p,_ as b,w as f}from"./index-Da7wx085.js";import"./mui-B7MJOmvc.js";import m from"./NotFoundScreen-ChgqfaBO.js";import{j as c,u}from"./core-BBidI7qX.js";(function(){try{var a=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},e=new a.Error().stack;e&&(a._sentryDebugIds=a._sentryDebugIds||{},a._sentryDebugIds[e]="b9a83aa7-b690-4828-8ae7-7b69f878cdb8",a._sentryDebugIdIdentifier="sentry-dbid-b9a83aa7-b690-4828-8ae7-7b69f878cdb8")}catch{}})();const j=()=>{const a=c(),e=u(),t=r.useCallback(()=>{window.open("https://www.zeni.ai/demo/request","_blank")},[]),i=r.useCallback(()=>{(()=>{const n=f(e.state?.pathnameStackToGoBack),d=n.poppedPathname??k();a(d,{state:{pathnameStackToGoBack:n.newStack}})})()},[]),o=l(e.pathname);return o!=null?s.jsx(p,{menuItem:b(o),onDemoClick:t,onGoBack:i}):s.jsx(m,{})},k=(a=2)=>{let e="../";for(let t=0;t<a;t++)e=`${e}../`;return e};export{j as F};
@@ -0,0 +1,72 @@
1
+ import{j as t}from"./liveblocks-Dp8Rpfa6.js";import{l as w,k as x,j,u as y,h as Z,q as ee,g as D,N as te,n as ae,o as p}from"./core-BBidI7qX.js";import{Ix as S,Iy as k,Iz as N,yT as $,yF as L,IA as C,IB as ne,IC as oe,yJ as ie,eO as v,yQ as se,yN as le}from"./zeni-epic-state-DqbxPrIr.js";import{r as g,o as r,s as re,c as I,i as E,v as de,w as ce,x as me,y as F,p as pe,m as ue,T as he,A as xe,h as ge,B as be,C as fe,I as we,S as ye,E as Se,F as ke,G as Ie}from"./index-Da7wx085.js";import{n as c}from"./mui-B7MJOmvc.js";import b from"./NotFoundScreen-ChgqfaBO.js";import{a as P}from"./sentry-CjhVLHR5.js";import"./recharts-BoxqkqlO.js";import"./analytics-BJQfczQS.js";import"./plaid-C04pF6iT.js";import"./dnd-CkhjCkb3.js";import"./stripe-DMRn4zHo.js";import"./lottie-BWQSrnVe.js";import"./lexical-ElGQdEM-.js";import"./pdf--vBxpUYp.js";import"./utils-DVwIdRkq.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]="0518dec6-1da0-4884-b43b-40d272abe14e",e._sentryDebugIdIdentifier="sentry-dbid-0518dec6-1da0-4884-b43b-40d272abe14e")}catch{}})();const ve=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
+ `,je=x(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=>{I.trackBillPayMagicLinkSubmitBankAccountDetails(o),e($(i,"standard",n,o))},onACHDetailsUpdated:i=>{const{bankAccountSection:l}=i;e(N({data:l}))}}})(re);function z(){const e=g(),{vendorId:a,billId:n}=w();return a==null||n==null?t.jsx(b,{}):t.jsx(t.Fragment,{children:t.jsx(ve,{windowSize:e,children:t.jsx(je,{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=x(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??Ae();n(s,{state:{pathnameStackToGoBack:l.newStack}})};return{onSubmitHandler:l=>{const s=De(l);e(ne({addressToCreate:s})),i()},onCancel:()=>{i()}}})(de);function Be({isSubPage:e}){const a=j(),n=y(),o=g();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 Ae=(e=2)=>{let a="../";for(let n=0;n<e;n++)a=`${a}../`;return a},De=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=x(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=>{I.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=j(),a=y(),n=g(),{vendorId:o,billId:i}=w();return o==null||i==null?t.jsx(b,{}):t.jsx(t.Fragment,{children:t.jsx(Pe,{windowSize:n,children:t.jsx(ze,{location:a,navigate:e,vendorId:o,billId:i})})})}const Le=c.div`
29
+ display: flex;
30
+ height: 100%;
31
+ width: 100%;
32
+ flex: 1 1 auto;
33
+ flex-direction: column;
34
+ align-items: center;
35
+ background-color: ${e=>e.theme.colors.grey4};
36
+ box-shadow: ${e=>`0px 2px ${r.sp1} ${e.theme.colors.dropShadowNormal}`};
37
+ `,Ee=x(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=>{I.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=j(),a=y(),n=g(),{vendorId:o,billId:i}=w(),{useFeatureGate:l}=pe(),{isFeatureEnabled:s}=l(ue.isBillPayLocalCurrencyFeatureEnabled);return o==null||i==null?t.jsx(b,{}):t.jsx(Le,{windowSize:n,children:t.jsx(Ee,{location:a,navigate:e,vendorId:o,billId:i,isLocalCurrencyEnabled:s})})}const Te={containerWidth:new ke(100,58)},Ge=c(ye)`
38
+ width: ${r.sp4};
39
+ height: ${r.sp4};
40
+ margin-bottom: ${r.sp3};
41
+ margin-top: ${r.sp3};
42
+ margin-left: ${r.sp8};
43
+ cursor: pointer;
44
+ position: absolute;
45
+ color: ${e=>e.theme.colors.brandColorJade};
46
+ `,He=c.div`
47
+ display: flex;
48
+ height: 100vh;
49
+ flex-direction: ${e=>e.windowSize==="small"?"column":"row"};
50
+ width: 100vw;
51
+ overflow-y: scroll;
52
+ background-color: ${e=>e.theme.colors.grey4};
53
+ `,Me=c.div`
54
+ display: flex;
55
+ flex-direction: ${e=>e.windowSize==="small"?"column":"row"};
56
+ flex-direction: column;
57
+ width: ${e=>`${Te.containerWidth.value(e.windowSize)}%`};
58
+ ${e=>e.windowSize!=="small"?"overflow: auto;":""}
59
+ box-shadow: ${e=>`0px 2px ${r.sp1} ${e.theme.colors.dropShadowNormal}`};
60
+ padding-top: ${e=>e.windowSize!=="small"?r.sp2:"0px"};
61
+ `,Ve=c.div`
62
+ display: flex;
63
+ flex-direction: column;
64
+ align-items: center;
65
+ justify-content: center;
66
+ padding: ${e=>e.windowSize==="small"?r.sp3:`62px ${r.sp6} ${r.sp9} ${r.sp8}`};
67
+ height: ${e=>e.windowSize==="small"?"490px":"auto"};
68
+ overflow: ${e=>e.windowSize==="small"?"unset":"hidden"};
69
+ width: ${e=>e.windowSize=="small"?"auto":"42%"};
70
+ background-color: ${e=>e.windowSize==="small"?e.theme.colors.grey4:e.theme.colors.background};
71
+ margin-top: ${e=>e.windowSize==="small"?e.isAddressPage?"0px":"186px":"unset"};
72
+ `,Ke=x(function(e,a){return{file:a.file,type:a.type}})(Se);function h({appContent:e}){const a=Z(),n=y(),{tenantEmailDomain:o,vendorId:i,billId:l}=w(),[s]=ee(),d=s.get("token"),T=n.pathname.includes("address"),f=g(),G=xe(),B=ge(),H=()=>{G.toggle()},M=D(u=>S(u)),V=D(u=>k(u)),{authParams:K,fetchState:m,billAttachment:W,billFetchState:A,companyName:_,currencySymbol:U,amount:q}=M,{tenantId:J,userId:O,sessionId:Q}=K,{fetchState:R,internationalBankAccountCreateStatus:X}=V;return P.useEffect(()=>{v(),m==="Not-Started"&&i!=null&&o!=null&&d!=null&&a(se(i,o,d))},[]),P.useEffect(()=>{m==="Completed"&&(v(O,Q,J),l!=null&&a(le(l)))},[m]),m==="Error"?t.jsx(b,{}):R==="Completed"||X.fetchState==="Completed"?(v(),t.jsx(te,{to:"../../../../../../../bank/account/save/success",replace:!0,relative:"path"})):m==="In-Progress"?t.jsx(be,{fetchState:m,style:{height:"100vh",backgroundColor:B.colors.grey5,boxShadow:`0px 2px ${r.sp1} ${B.colors.dropShadowNormal}`}}):t.jsxs(t.Fragment,{children:[m==="Completed"&&A==="Completed"&&t.jsx(fe,{analytics:I,onLoad:u=>(Y=>Y.trackBillPayMagicLinkPageLoad(o??"",i??"",_,l??"",We(n.pathname),U,q))(u)}),t.jsxs(He,{windowSize:f,children:[f!=="small"?t.jsx(Ge,{onClick:H}):null,t.jsx(Ve,{windowSize:f,isAddressPage:T,children:A==="In-Progress"?t.jsx(we,{size:"ExtraLarge",start:!0}):t.jsx(Ke,{file:W,type:"bill"})}),t.jsx(Me,{windowSize:f,children:e})]})]})}const We=e=>`${e.split("/").at(-2)}_${e.split("/").at(-1)}`;function _e(){return t.jsx(Ie,{})}function lt(){return t.jsxs(ae,{children:[t.jsx(p,{path:"bank/account/save/success",element:t.jsx(_e,{})}),t.jsx(p,{path:":tenantEmailDomain/vendor/:vendorId/bill/:billId/ach/standard",element:t.jsx(h,{appContent:t.jsx(z,{})})}),t.jsx(p,{path:":tenantEmailDomain/vendor/:vendorId/bill/:billId/ach/same-day",element:t.jsx(h,{appContent:t.jsx(z,{})})}),t.jsx(p,{path:":tenantEmailDomain/vendor/:vendorId/bill/:billId/wire/address",element:t.jsx(h,{appContent:t.jsx(Be,{isSubPage:!0})})}),t.jsx(p,{path:":tenantEmailDomain/vendor/:vendorId/bill/:billId/wire/us-domestic",element:t.jsx(h,{appContent:t.jsx(Ne,{})})}),t.jsx(p,{path:":tenantEmailDomain/vendor/:vendorId/bill/:billId/wire/international",element:t.jsx(h,{appContent:t.jsx(Fe,{})})}),t.jsx(p,{path:"*",element:t.jsx(b,{})})]})}export{lt as default};
@@ -0,0 +1,12 @@
1
+ import{j as u}from"./liveblocks-Dp8Rpfa6.js";import{a as g}from"./sentry-CjhVLHR5.js";import{h as O,u as _,j as w,q as M,g as l,N as T}from"./core-BBidI7qX.js";import{z as r,h as P,D as V,d as A,c as N,e as q,k as G,I as R,g as W}from"./index-Da7wx085.js";import{eN as $,Ii as B,Is as H,Ij as J,eO as K,fh as Q,Io as X,fG as Y,cS as Z,It as ee,Iu as te}from"./zeni-epic-state-DqbxPrIr.js";import{n as ne}from"./mui-B7MJOmvc.js";import{u as se}from"./useDeviceId-B_FexNcs.js";import{f as ae}from"./analyticsHelper-EC13frAK.js";import{t as ie}from"./getLocaleForTenant-CDVNWQi2.js";import"./recharts-BoxqkqlO.js";import"./analytics-BJQfczQS.js";import"./plaid-C04pF6iT.js";import"./dnd-CkhjCkb3.js";import"./stripe-DMRn4zHo.js";import"./lottie-BWQSrnVe.js";import"./lexical-ElGQdEM-.js";import"./pdf--vBxpUYp.js";import"./utils-DVwIdRkq.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]="bc4ea456-e862-49a1-bcdb-f043476450fb",t._sentryDebugIdIdentifier="sentry-dbid-bc4ea456-e862-49a1-bcdb-f043476450fb")}catch{}})();const D=(t,a)=>t!=null&&t.length>0&&a==="magic_links";function De(){const t=O(),a=_(),m=w(),[k]=M(),n=k.get("token"),p=k.get("stytch_token_type"),f=r.getMagicLinkCodeVerifier(),i=se(),{otpChallenge:d,twoFAPhoneNumber:x,magicLinkEmail:c,verifyDeviceFetchState:z,resendVerifyDeviceOTPFetchState:C}=l(e=>e.tenantState),I=l(e=>e.tenantState.fetchState),y=l(e=>e.tenantState.activeTenantFetchState.fetchState),S=l(e=>e.tenantState.signInState),h=l(e=>e.tenantState.magicLinkSignInFetchState.fetchState),s=l(e=>e.tenantState.loggedInUser),o=l(e=>$(e)),b=l(e=>B(e)),E=r.getSignedInUser(),v=P().mode;g.useEffect(()=>{s?.zeniSessionId==null&&n!=null&&D(n,p)&&i!=null&&f!=null&&(r.saveMagicLinkTriggered(n),t(H(n,i,f)))},[n,p,t,i,f,s?.zeniSessionId]),g.useEffect(()=>{S!=="In-Progress"||I!=="Completed"&&y!=="Completed"||s?.zeniSessionId==null||o==null||(n!=null&&r.saveLastUsedMagicLinkToken(n),r.saveSignedInUserWithSession(s,s.zeniSessionId),r.saveSignedInUserTenants(J(b.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,b.tenantsInOrder),Y().then(()=>{const e=W();e!=null&&A(e)}),setTimeout(()=>{N.trackLogin(q.Event.loginSuccess,"email",Z(o.productSettings))},2e3))},[S,I,y,s,o,b,v,a.state,t]);const j=g.useCallback(()=>{m("/signin/auth")},[m]),U=g.useCallback(()=>{i!=null&&d!=null&&c!=null&&t(ee(i,c,d))},[i,d,t,c]),F=g.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(G,{phoneNumber:x,verifyOtpFetchState:z.fetchState,resendVerifyDeviceOTPFetchState:C,onResendOtp:U,onVerifyOtp:F,onCancelVerifyDevice:j});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)||f==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(R,{size:"ExtraLarge",start:!0})})}const oe=ne.div`
2
+ position: fixed;
3
+ top: 0;
4
+ left: 0;
5
+ right: 0;
6
+ bottom: 0;
7
+ display: flex;
8
+ align-items: center;
9
+ justify-content: center;
10
+ z-index: 9999;
11
+ background-color: ${t=>t.theme.colors.background};
12
+ `;export{De as default};
@@ -0,0 +1 @@
1
+ import{j as U}from"./liveblocks-Dp8Rpfa6.js";import{a as c}from"./sentry-CjhVLHR5.js";import{h as pe,g as s,l as Je,u as Ke,j as Qe,i as R}from"./core-BBidI7qX.js";import{eN as he,eU as ea,eV as Se,eP as aa,bn as ta,f2 as na,eW as sa,eX as oa,eZ as ia,f0 as ra,fa as da,f1 as g,f4 as la,f5 as ue,f8 as ca,f6 as ua,f7 as fa,f9 as ma,cH as ba,fc as pa,cN as ha,bv as Sa,eM as ga,fh as Ea,fi as ka,fg as Ca}from"./zeni-epic-state-DqbxPrIr.js";import{a1 as ya,a2 as Ia,A as Ta,p as wa,z as k,a3 as _a,M as Aa,a4 as Fa,u as Da,m as r,a5 as va,a6 as $a,j as Ba,a as Ma,a7 as Pa,Y as Ra,a8 as xa,a9 as Na,aa as fe,ab as me,L as Ua,ac as Va,ad as be,c as x,y as _,ae as N,af as Ga}from"./index-Da7wx085.js";import{D as Oa}from"./mui-B7MJOmvc.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]="f8e318d7-9d1c-421b-aa77-1334701ab894",f._sentryDebugIdIdentifier="sentry-dbid-f8e318d7-9d1c-421b-aa77-1334701ab894")}catch{}})();const ja=ya(({isAppContentDrawerOpen:f,handleDrawerToggle:d})=>{const{tenantEmailDomain:a}=Je(),t=Ke(),C=Ta(),o=Qe(),V=aa(),m=pe(),{useFeatureGate:i}=wa(),G=k.getSignedInUser(),A=ta(G),n=s(e=>he(e)),ge=_a(),Ee=n.masterTOSInfo?.isMasterTOSAccepted??!1,{setIsAiCfoOpen:ke}=Aa(),O=s(e=>na(e)),j=O.uiState.currentChatSessionId,y=Fa(),{setLoading:Ce}=Da(),[F,L]=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:ye}=i(r.isChargeCardFeatureEnabled),{isFeatureEnabled:H}=i(r.isDebitCardFeatureEnabled),Ie=va(n,ye,H),{isFeatureEnabled:Te}=i(r.isSettingsFeatureEnabled),Z=s(e=>sa(e)),{isFeatureEnabled:T}=i(r.isReferralFeatureEnabled),v=s(e=>oa(e));c.useEffect(()=>{y&&T&&!I&&v.fetchState==="Not-Started"&&m(ia(!0))},[y,T,v.fetchState,I]);const h=k.getSignedInUser(),$=s(e=>e.tenantState),we=s(e=>$.fetchState==="Completed"?ra(e):[]),E=s(e=>e.expenseAutomationViewState.selectedPeriodByTenantId),{isFeatureEnabled:_e}=i(r.isApAgingFeatureEnabled),{isFeatureEnabled:Ae}=i(r.isArAgingFeatureEnabled),{isFeatureEnabled:W}=i(r.isExpenseAutomationEnabled),{isFeatureEnabled:X}=i(r.isExpenseAutomationEnabledV2),q=X||W&&A,{isFeatureEnabled:Fe}=i(r.isDashboardSidebarHalloweenAnimationEnabled),{isFeatureEnabled:De}=i(r.isDashboardSidebarThanksGivingAnimationEnabled),{isFeatureEnabled:ve}=i(r.isDashboardSidebarChristmasAnimationEnabled),{isFeatureEnabled:$e}=i(r.isDashboardSidebarNewYearAnimationEnabled),{isFeatureEnabled:Be}=i(r.isTreasuryEnabled),{isFeatureEnabled:Me}=i(r.isTaskManagerCustomerUserAccessEnabled),Pe=A||!A&&Me,Re=n.company!=null&&da(n.company),w=Be&&Re,xe=s(e=>g(e).totalUnreadCount),Ne=s(e=>g(e).reducedFetchCountState),J=s(e=>g(e).notificationDetailsByTab.tasks.uiState.unreadCount),K=s(e=>g(e).notificationDetailsByTab.comments.uiState.unreadCount),Ue=s(e=>g(e).notificationDetailsByTab.tasks.fetchCountState),B=s(e=>g(e).notificationDetailsByTab.comments.fetchCountState),{inboxNotifications:Q,isLoading:ee,isFetchingMore:ae,hasFetchedAll:te,fetchMore:Ve}=$a();c.useEffect(()=>{const e=setTimeout(()=>Ve?.(),0);return()=>clearTimeout(e)}),c.useEffect(()=>{if(ee===!1&&ae===!1&&te===!0)if(n?.companyId!=null&&Q!=null){const e=`dashboard_${n.companyId}`;L(Q.filter(u=>u.roomId===e&&u.readAt==null).length)}else L(0)},[ee,ae,te]),c.useEffect(()=>{y&&!I&&Ue.fetchState==="Not-Started"&&V.tenantId!=null&&m(la("task_manager","dashboard"))},[y,V.tenantId]),c.useEffect(()=>{I||B.fetchState!=="Not-Started"||m(ue({fetchCountState:{fetchState:"In-Progress",error:void 0}},"comments"))},[]),c.useEffect(()=>{F!=null&&B.fetchState==="In-Progress"&&(m(ue({fetchCountState:{fetchState:"Completed",error:void 0}},"comments")),m(Se({unreadCount:F},"comments")))},[F,B.fetchState]);const Ge={fetchStatus:Ne,count:xe},ne=a!=null?k.getSignedInUserTenant(a):null,se=s(e=>ne?.tenantId!=null?ca(e,ne.tenantId):void 0),S=[];_e===!1&&S.push("accounts_payable_aging"),Ae===!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 Oe=Ba(),oe=s(e=>ua(e,S,h,X,W,w).fetchState),ie=s(e=>fa(e).fetchState),je=D&&(oe==="Completed"||oe==="Error")||z&&(ie==="Completed"||ie==="Error")||!D&&!z?void 0:"disabled",Le=c.useMemo(()=>ma(n.userRole),[n.userRole]),ze=ba(Le),Ye=n?.rewardsLastViewedTime==null,He=h?.userEmail!=null&&Z.fetchState==="Completed"&&pa(Z.notificationSettings,h.userEmail,H,n),re=Ma(),Ze=re&&Pa(t),de=ha(Oe?.loggedInUserRoleMap),le=n.companyTreasuryInfo?.info?.isTreasuryTOSAccepted,M=c.useCallback(()=>w&&de&&!k.getTreasuryPopupSeen(a??"")&&le===!1&&Ra(t.pathname)!=="treasury",[w,de,le,t.pathname,a]),[We,ce]=c.useState(M);c.useEffect(()=>{ce(M())},[M]);const Xe=s(e=>e.treasurySetupViewState.treasuryFundsDetails).fundsDetails,qe=xa(Xe);return U.jsx(Oa,{container:window.document.body,variant:"temporary",open:f,onClose:()=>d(!1),PaperProps:{sx:{width:240,zIndex:8,borderRight:"none",backgroundImage:"none"}},ModalProps:{keepMounted:!0},children:U.jsx(Na,{signedInUser:G,currentTenantId:$.currentTenantId??"",tenants:$.fetchState==="Completed"?we:se!=null?[se]:[],currentTenant:n,isTenantDropdownDisabled:je,isSettings:me(t),isSettingsFeatureEnabled:Te,isVendorsTabVisible:ze,isZeniAccountEnabled:Y,isChargeCardEnabled:Ie,isTreasuryEnabled:w,treasuryYieldPercentage:qe,isTreasuryPopupVisible:We,isNotificationsTabVisible:He,notificationCountDetails:Ge,isExpenseAutomationEnabledForUser:q&&Sa(n.userRole)===!1,selectedMenu:fe(t),rewardsConfiguration:{isRewardsTabVisible:T,isRewardsAnimated:Ye,rewardsPlan:v.rewardsPlan},isAiCfoAccessEnabled:re,onNotificationIconClick:()=>{d(!1);let e=J===0&&K>0?"notifications/comments":"notifications/tasks";me(t)&&(e=J===0&&K>0?"../../notifications/comments":"../../notifications/tasks");const u=_(t.state?.pathnameStackToGoBack,t.pathname);o(e,{state:{pathnameStackToGoBack:u}})},handleCockpitClick:()=>{window.open("/cockpit")},handleLogOutClick:()=>{d(!1);const e=_(t.state?.pathnameStackToGoBack,t.pathname);o("/signout",{replace:!0,state:{pathnameStackToGoBack:e,message:"logout"}})},handleMenuChange:e=>{if(d(!1),a==null)return;if(e.type==="ai_cfo"){const b=_(t.state?.pathnameStackToGoBack,t.pathname);return x.trackAICFOChatScreenStateChanged("viewed","left_menu",j??null,null),Ee?void o(`/${a}/ai-cfo/explore`,{state:{pathnameStackToGoBack:b,referrer:"Sidebar"}}):void(ge?ke(!0):o(`/${a}/dashboard`,{state:{pathnameStackToGoBack:b,referrer:"Sidebar",message:"open_ai_cfo_drawer"}}))}const u=_(t.state?.pathnameStackToGoBack,t.pathname),l=e.type,p=N(l)&&l!=="command_center";if(N(e.type)&&E[n.tenantId]!=null&&x.trackMonthEndCloseClicked(E[n.tenantId].month,E[n.tenantId].year,"Sidebar"),p&&E[n.tenantId]!=null){const b=E[n.tenantId];return void o(`/${a}/month_end_close_checks/review/${e.type}/${b.month}-${b.year}`,{state:{pathnameStackToGoBack:u,referrer:"Sidebar"}})}const P=Ga(e.type);be(e.type)?(j!=null&&m(Ca()),o(`/${a}/ai-cfo/${e.type}`,{state:{pathnameStackToGoBack:u.slice(0,-1),referrer:"Sidebar"}})):o(`/${a}/${P}`,{state:{pathnameStackToGoBack:u,referrer:"Sidebar"}})},handleMyProfileClick:()=>{d(!1),o(`/${a}/settings/my_profile`)},handleReferralsClick:()=>{d(!1),o(`/${a}/rewards`)},handleBackClick:()=>{o(`/${a}/dashboard`)},handleTenantSelect:e=>{Ce(Ua.TENANT_SWITCHING),d(!1);const u=e.tenantEmailDomain,l=fe(t);let p=`/${encodeURIComponent(u)}/`;const P=N(l);l==="home"?p+="dashboard":l==="users_and_roles"?p+="people":Va(l)?p+="settings/my_profile":be(l)?p+=`ai-cfo/${l}`:p+=l==="task_checklist"?"tasks":P?"month_end_close_checks/review":encodeURIComponent(l),o(p,{replace:!0}),h!=null&&(m(Ea(e.tenantId)),m(ka(h.userId,e.tenantId,h.zeniSessionId)));const b=e;x.trackCompanySwitch(b.companyId,b.companyName,b.userRole)},handlePopupClose:()=>{k.saveTreasuryPopupSeen(a??"",!0),ce(!1)},onZeniLogoClick:()=>{C.toggle()},isAiCfo:Ze,aiCfoView:O,isOnDashboard:D,updateCurrentChatSessionId:e=>{m(ga({sessionId:e,agentId:"controller"})),o(`/${a}/ai-cfo/${e}`,{state:{...t.state}})},halloweenAnimationEnabled:Fe,isTaskManagerAccessEnabled:Pe,thanksGivingAnimationEnabled:De,christmasAnimationEnabled:ve,newYearAnimationEnabled:$e})})}),Xa=f=>{const d=pe(),a=s(C=>he(C)),t={events:a.userRoleId!=null?[`private-${a.userRoleId}.dashboard-user-notification`]:[],eventCallback:(C,o)=>{Ia(o)&&ea(o.mode)==="dashboard"&&d(Se({unreadCount:o.data.unread},"tasks"))}};return U.jsx(ja,{...f,...t})};export{Xa as M};
@@ -0,0 +1 @@
1
+ import{j as e}from"./liveblocks-Dp8Rpfa6.js";import{j as r,k as i}from"./core-BBidI7qX.js";import{X as n}from"./index-Da7wx085.js";import"./mui-B7MJOmvc.js";import"./sentry-CjhVLHR5.js";import"./zeni-epic-state-DqbxPrIr.js";import"./recharts-BoxqkqlO.js";import"./analytics-BJQfczQS.js";import"./plaid-C04pF6iT.js";import"./dnd-CkhjCkb3.js";import"./stripe-DMRn4zHo.js";import"./lottie-BWQSrnVe.js";import"./lexical-ElGQdEM-.js";import"./pdf--vBxpUYp.js";import"./utils-DVwIdRkq.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]="08a1fb90-c2ee-45d3-8148-a56dffb2c13c",o._sentryDebugIdIdentifier="sentry-dbid-08a1fb90-c2ee-45d3-8148-a56dffb2c13c")}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 ct,a as mt,m as dt,j as _}from"./liveblocks-CzlYoB8q.js";import lt from"./NotFoundScreen-CojoL2wq.js";import{a as k}from"./sentry-CNCwYM02.js";import{j as ft,u as ut,l as ht,h as pt,g as S,k as kt,n as gt,o as z}from"./core-CGhI3jCZ.js";import{cq as St,eX as Q,eO as H,fa as bt,f2 as b,OU as K,f6 as d,eW as y,qr as M,vF as It,OV as Ct,eV as Tt,fd as yt,qw as At,OW as F,bq as $,gD as w,qA as J,OX as Et,cB as _t,cv as Nt}from"./zeni-epic-state-lenVK-tm.js";import{N as Bt,z as xt,x as wt,c as vt,cr as Dt,s as N,a2 as Rt,cs as Ut,a3 as Gt,q as Pt}from"./index-D7leYkuC.js";import"./mui-ILn-Gd-L.js";import{u as Ft}from"./useAskAiCfoHostNavButtonProps-BYwM8iQc.js";import{c as $t}from"./useFetchSuggestedQuestionsWhenReady-CLFroGaE.js";import"./recharts-D6qS-pdV.js";import"./analytics-CQOsvcBG.js";import"./plaid-D8caW90M.js";import"./dnd-DKCsG5d8.js";import"./stripe-DMRn4zHo.js";import"./lottie-CLMz6y3A.js";import"./lexical-DT64qE89.js";import"./pdf-CUf9xopY.js";import"./utils-zvjLmBW4.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]="e6d6b6dd-249d-4b5e-8167-2f112a522024",t._sentryDebugIdIdentifier="sentry-dbid-e6d6b6dd-249d-4b5e-8167-2f112a522024")}catch{}})();const Mt=(t,l)=>new Promise((n,u)=>{const g=t.map(i=>new Promise(s=>{l(i),s()}));Promise.all(g).then(()=>{setTimeout(()=>{n()},2e3)}).catch(i=>{u(i)})}),jt=kt(function(t,l){const n=Q(t),{signedInUser:u,isDebitCardFeatureEnabled:g}=l,i=b(t),s=H(t),{currentTab:h}=i;return{notificationView:i,isNotificationSettingsVisible:u.userEmail!=null&&yt(n.notificationSettings,u.userEmail,g,s),isDisabled:i.notificationDetailsByTab[h].fetchState==="In-Progress"?"disabled":void 0}},function(t,l){const{location:n,tenantEmailDomain:u,loggedInUserRoleMap:g,externalNotificationsUnreadCount:i,allUnreadCommentsNotificationIds:s,navigate:h,markInboxNotificationAsRead:B,fetchMoreCommentsNotifications:v}=l;return{onNotificationClick:(a,o,m,c)=>{if(c==="task_deleted"){const r=`/${u}/tasks`,I=N(n.state?.pathnameStackToGoBack,n.pathname);h(r,{state:{pathnameStackToGoBack:I,message:"triggerBackClick"}})}else{const r=`/${u}/tasks/${o}`,I=N(n.state?.pathnameStackToGoBack,n.pathname);h(r,{state:{pathnameStackToGoBack:I,message:"triggerBackClick"}})}m==="unread"&&t(J("task_manager","read",[a],!1))},onCommentNotificationClick:(a,o,m)=>{const c=o.toString().split(`/${u}/`);if(c[1]!=null){m==="unread"&&(B(a),t(F([a],$())));let r=`/${u}/${c[1]}`;const I=N(n.state?.pathnameStackToGoBack,n.pathname);c[1].startsWith("reimbursement")&&!_t(g)&&(r="not-found"),c[1].startsWith("bill")&&!Nt(g)&&(r="not-found"),h(r,{state:{pathnameStackToGoBack:I,message:"triggerBackClick"}})}},onUpdateNotificationViewUIState:(a,o)=>{t(y(a,o))},onUpdateNotificationTabState:(a,o)=>{t(d(a,o))},onUpdateNotificationViewCurrentTabAndSubTab:(a,o)=>{t(K(a,o));const m=`../${a}`,c=N(n.state?.pathnameStackToGoBack,n.pathname);h(m,{state:{pathnameStackToGoBack:c}})},onUpdateNotificationViewSubTab:a=>{t(Et(a))},onFetchMoreNotifications:(a,o)=>{if(a==="tasks"){const m=[];o==="all"?m.push("read","unread"):o!=="mentions"&&m.push(o),t(M("task_manager","dashboard",m))}else v?.()},onUpdateNotificationStatus:(a,o,m,c)=>{a==="tasks"?t(J("task_manager",m,c)):(t(d({markAsReadState:{fetchState:"In-Progress",error:void 0}},"comments")),Promise.all(c.map(r=>{m==="read"&&(B(r),t(F([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(At("task_manager","read")):(t(d({markAsAllReadState:{fetchState:"In-Progress",error:void 0}},"comments")),Mt(s,B).then(()=>{t(F(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=Pt(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}})}}})(Rt(Ut)),qt=()=>{const t=ft(),l=ut(),{tenantEmailDomain:n,selectedTab:u}=ht(),{areTenantIdsInSync:g}=Bt(),i=St(u??""),s=pt(),h=xt.getSignedInUser(),[B,v]=k.useState(!1),a=S(e=>Q(e)),o=S(e=>H(e)),{useFeatureGate:m}=wt(),{isFeatureEnabled:c}=m(vt.isDebitCardFeatureEnabled),{isAiCfoAccessEnabled:r,onAskAiCfoClick:I}=Ft({mobileExploreReferrer:"Notifications"});$t({isDataReady:!0});const Y=bt(o.userRole);if(o==null||n==null||o.companyId==null)throw Error("Can't access notifications page without current tenant...");if(h==null)throw Error("Can't access notifications page without signed in...");const j=S(e=>b(e).notificationDetailsByTab.tasks.fetchState),q=S(e=>b(e).currentTab),D=S(e=>b(e).currentSubTab),Z=S(e=>b(e).notificationDetailsByTab.comments.fetchCountState),R=S(e=>b(e).notificationDetailsByTab.comments.fetchState),tt=S(e=>b(e).notificationDetailsByTab.comments.uiState.unreadCount),et=S(e=>b(e).allExternalNotifications).filter(e=>e.inboxNotification.readAt==null).map(e=>e.inboxNotification.id),at=Dt().allUsers,{inboxNotifications:x,isLoading:A,hasFetchedAll:C,isFetchingMore:U,fetchMore:ot}=ct(),{threads:V,isLoading:O,fetchMore:W,isFetchingMore:X,hasFetchedAll:L}=mt({query:{metadata:{companyId:o.companyId,application:"dashboard"}}});k.useEffect(()=>{if(q!==i&&i!=null&&s(K(i)),i==null){const e=`../${q}`,p=N(l.state?.pathnameStackToGoBack,l.pathname);t(e,{state:{pathnameStackToGoBack:p}})}},[i]),k.useEffect(()=>{Z.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(M("task_manager","dashboard",["read","unread"]))},[g]),k.useEffect(()=>{const e=setTimeout(()=>ot?.(),0);return()=>clearTimeout(e)});const G=A||U===!0||C!==!0||A||U===!0||C!==!0;k.useEffect(()=>{G&&R!=="In-Progress"?s(d({fetchState:"In-Progress",error:void 0},"comments")):G||R!=="In-Progress"||s(d({fetchState:"Completed",error:void 0},"comments"))},[G,R]),k.useEffect(()=>{s(y({hasMore:C!==!0},"comments"))},[C]),k.useEffect(()=>{a.fetchState!=="In-Progress"&&a.fetchState!=="Completed"&&B===!1&&(v(!0),s(It()))},[a.fetchState]),k.useEffect(()=>{if(A===!1&&O===!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),it=p.map(f=>{const P=V.find(rt=>rt.id===f.threadId);return P!=null?{inboxNotification:{...f,threadId:P.id},thread:P}:(X||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(Ct(it))}},[A,U,X,C,L,O,x?.length]);const st={events:o.userRoleId!=null?[`private-encrypted-${o.userRoleId}.dashboard-user-notification`]:[],eventCallback:(e,p)=>{if(Gt(p)){const T=Tt(p.mode);if(T==="dashboard"&&s(y({unreadCount:p.data.unread},"tasks")),j!=="In-Progress"){const E=[];D==="all"?E.push("read","unread"):D!=="mentions"&&E.push(D),s(M("task_manager",T,E,!0))}}}},nt=dt();return _.jsx(jt,{tenantEmailDomain:n,loggedInUserRoleMap:Y,signedInUser:h,externalNotificationsUnreadCount:tt,location:l,navigate:t,isDebitCardFeatureEnabled:c,users:at,markInboxNotificationAsRead:nt,allUnreadCommentsNotificationIds:et,isAiCfoAccessEnabled:r,onAskAiCfoClick:I,...st})};function ie(){return _.jsxs(gt,{children:[_.jsx(z,{path:"/:selectedTab",element:_.jsx(qt,{})}),_.jsx(z,{path:"*",element:_.jsx(lt,{})})]})}export{ie as default};
1
+ import{l as ct,a as mt,m as dt,j as _}from"./liveblocks-Dp8Rpfa6.js";import lt from"./NotFoundScreen-ChgqfaBO.js";import{a as k}from"./sentry-CjhVLHR5.js";import{j as ft,u as ut,l as ht,h as pt,g as S,k as kt,n as gt,o as H}from"./core-BBidI7qX.js";import{cp as St,eW as K,eN as Q,f9 as bt,f1 as b,OF as X,f5 as d,eV as y,qq as M,vE as It,OG as Ct,eU as Tt,fc as yt,qv as At,OH as F,bq as $,gC as x,qz as J,OI as Et,cA as _t,cu as Nt}from"./zeni-epic-state-DqbxPrIr.js";import{N as Bt,z as wt,p as xt,m as vt,cr as Rt,y as N,a1 as Ut,cs as Dt,a2 as Gt,w as Pt}from"./index-Da7wx085.js";import"./mui-B7MJOmvc.js";import{u as Ft}from"./useAskAiCfoHostNavButtonProps-CVRBuwu7.js";import{c as $t}from"./useFetchSuggestedQuestionsWhenReady-Bk64M-bJ.js";import"./recharts-BoxqkqlO.js";import"./analytics-BJQfczQS.js";import"./plaid-C04pF6iT.js";import"./dnd-CkhjCkb3.js";import"./stripe-DMRn4zHo.js";import"./lottie-BWQSrnVe.js";import"./lexical-ElGQdEM-.js";import"./pdf--vBxpUYp.js";import"./utils-DVwIdRkq.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]="0538f2ee-8846-4df8-910a-1fb43e7a6a25",t._sentryDebugIdIdentifier="sentry-dbid-0538f2ee-8846-4df8-910a-1fb43e7a6a25")}catch{}})();const Mt=(t,l)=>new Promise((n,u)=>{const g=t.map(i=>new Promise(s=>{l(i),s()}));Promise.all(g).then(()=>{setTimeout(()=>{n()},2e3)}).catch(i=>{u(i)})}),jt=kt(function(t,l){const n=K(t),{signedInUser:u,isDebitCardFeatureEnabled:g}=l,i=b(t),s=Q(t),{currentTab:h}=i;return{notificationView:i,isNotificationSettingsVisible:u.userEmail!=null&&yt(n.notificationSettings,u.userEmail,g,s),isDisabled:i.notificationDetailsByTab[h].fetchState==="In-Progress"?"disabled":void 0}},function(t,l){const{location:n,tenantEmailDomain:u,loggedInUserRoleMap:g,externalNotificationsUnreadCount:i,allUnreadCommentsNotificationIds:s,navigate:h,markInboxNotificationAsRead:B,fetchMoreCommentsNotifications:v}=l;return{onNotificationClick:(a,o,m,c)=>{if(c==="task_deleted"){const r=`/${u}/tasks`,I=N(n.state?.pathnameStackToGoBack,n.pathname);h(r,{state:{pathnameStackToGoBack:I,message:"triggerBackClick"}})}else{const r=`/${u}/tasks/${o}`,I=N(n.state?.pathnameStackToGoBack,n.pathname);h(r,{state:{pathnameStackToGoBack:I,message:"triggerBackClick"}})}m==="unread"&&t(J("task_manager","read",[a],!1))},onCommentNotificationClick:(a,o,m)=>{const c=o.toString().split(`/${u}/`);if(c[1]!=null){m==="unread"&&(B(a),t(F([a],$())));let r=`/${u}/${c[1]}`;const I=N(n.state?.pathnameStackToGoBack,n.pathname);c[1].startsWith("reimbursement")&&!_t(g)&&(r="not-found"),c[1].startsWith("bill")&&!Nt(g)&&(r="not-found"),h(r,{state:{pathnameStackToGoBack:I,message:"triggerBackClick"}})}},onUpdateNotificationViewUIState:(a,o)=>{t(y(a,o))},onUpdateNotificationTabState:(a,o)=>{t(d(a,o))},onUpdateNotificationViewCurrentTabAndSubTab:(a,o)=>{t(X(a,o));const m=`../${a}`,c=N(n.state?.pathnameStackToGoBack,n.pathname);h(m,{state:{pathnameStackToGoBack:c}})},onUpdateNotificationViewSubTab:a=>{t(Et(a))},onFetchMoreNotifications:(a,o)=>{if(a==="tasks"){const m=[];o==="all"?m.push("read","unread"):o!=="mentions"&&m.push(o),t(M("task_manager","dashboard",m))}else v?.()},onUpdateNotificationStatus:(a,o,m,c)=>{a==="tasks"?t(J("task_manager",m,c)):(t(d({markAsReadState:{fetchState:"In-Progress",error:void 0}},"comments")),Promise.all(c.map(r=>{m==="read"&&(B(r),t(F([r],$())))})).then(()=>{t(d({markAsReadState:{fetchState:"Completed",error:void 0},selectedNotificationIds:[]},"comments")),t(y({unreadCount:i-c.length>0?i-c.length:0},"comments")),t(x({messageSection:"notification_mark_as_read",messageText:"success",type:"success",showStatusIcon:!0}))},r=>{t(d({markAsReadState:{fetchState:"Error",error:r}},"comments")),t(x({messageSection:"notification_mark_as_read",messageText:"failed",type:"error",showStatusIcon:!0}))}).catch(r=>{t(d({markAsReadState:{fetchState:"Error",error:r}},"comments")),t(x({messageSection:"notification_mark_as_read",messageText:"failed",type:"error",showStatusIcon:!0}))}))},onMarkAllNotificationsAsRead:a=>{a==="tasks"?t(At("task_manager","read")):(t(d({markAsAllReadState:{fetchState:"In-Progress",error:void 0}},"comments")),Mt(s,B).then(()=>{t(F(s,$())),t(d({markAsAllReadState:{fetchState:"Completed",error:void 0}},"comments")),t(y({unreadCount:0},"comments")),t(x({messageSection:"notification_mark_as_read",messageText:"success",type:"success",showStatusIcon:!0}))}).catch(o=>{t(d({markAsAllReadState:{fetchState:"Error",error:o}},"comments")),t(x({messageSection:"notification_mark_as_read",messageText:"failed",type:"error",showStatusIcon:!0}))}))},onBackClick:()=>{const a=Pt(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}})}}})(Ut(Dt)),qt=()=>{const t=ft(),l=ut(),{tenantEmailDomain:n,selectedTab:u}=ht(),{areTenantIdsInSync:g}=Bt(),i=St(u??""),s=pt(),h=wt.getSignedInUser(),[B,v]=k.useState(!1),a=S(e=>K(e)),o=S(e=>Q(e)),{useFeatureGate:m}=xt(),{isFeatureEnabled:c}=m(vt.isDebitCardFeatureEnabled),{isAiCfoAccessEnabled:r,onAskAiCfoClick:I}=Ft({mobileExploreReferrer:"Notifications"});$t({isDataReady:!0});const Y=bt(o.userRole);if(o==null||n==null||o.companyId==null)throw Error("Can't access notifications page without current tenant...");if(h==null)throw Error("Can't access notifications page without signed in...");const j=S(e=>b(e).notificationDetailsByTab.tasks.fetchState),q=S(e=>b(e).currentTab),R=S(e=>b(e).currentSubTab),Z=S(e=>b(e).notificationDetailsByTab.comments.fetchCountState),U=S(e=>b(e).notificationDetailsByTab.comments.fetchState),tt=S(e=>b(e).notificationDetailsByTab.comments.uiState.unreadCount),et=S(e=>b(e).allExternalNotifications).filter(e=>e.inboxNotification.readAt==null).map(e=>e.inboxNotification.id),at=Rt().allUsers,{inboxNotifications:w,isLoading:A,hasFetchedAll:C,isFetchingMore:D,fetchMore:ot}=ct(),{threads:V,isLoading:O,fetchMore:W,isFetchingMore:L,hasFetchedAll:z}=mt({query:{metadata:{companyId:o.companyId,application:"dashboard"}}});k.useEffect(()=>{if(q!==i&&i!=null&&s(X(i)),i==null){const e=`../${q}`,p=N(l.state?.pathnameStackToGoBack,l.pathname);t(e,{state:{pathnameStackToGoBack:p}})}},[i]),k.useEffect(()=>{Z.fetchState==="Not-Started"&&s(d({fetchCountState:{fetchState:"In-Progress",error:void 0}},"comments"))},[]),k.useEffect(()=>{if(A===!1&&C===!0&&o?.companyId!=null&&w!=null){const e=`dashboard_${o.companyId}`,p=w.filter(T=>T.roomId===e&&T.readAt==null).length;s(d({fetchCountState:{fetchState:"Completed",error:void 0}},"comments")),s(y({unreadCount:p},"comments"))}},[A,C]),k.useEffect(()=>{j!=="In-Progress"&&g&&s(M("task_manager","dashboard",["read","unread"]))},[g]),k.useEffect(()=>{const e=setTimeout(()=>ot?.(),0);return()=>clearTimeout(e)});const G=A||D===!0||C!==!0||A||D===!0||C!==!0;k.useEffect(()=>{G&&U!=="In-Progress"?s(d({fetchState:"In-Progress",error:void 0},"comments")):G||U!=="In-Progress"||s(d({fetchState:"Completed",error:void 0},"comments"))},[G,U]),k.useEffect(()=>{s(y({hasMore:C!==!0},"comments"))},[C]),k.useEffect(()=>{a.fetchState!=="In-Progress"&&a.fetchState!=="Completed"&&B===!1&&(v(!0),s(It()))},[a.fetchState]),k.useEffect(()=>{if(A===!1&&O===!1&&w!=null&&V!=null){const e=`dashboard_${o.companyId}`,p=w.filter(f=>f.roomId===e).filter(f=>f.kind==="thread"),T=p.filter(f=>f.readAt==null),E=p.map(f=>f.id),it=p.map(f=>{const P=V.find(rt=>rt.id===f.threadId);return P!=null?{inboxNotification:{...f,threadId:P.id},thread:P}:(L||z===!0||W==null||W(),null)}).filter(f=>f!=null);s(d({allNotificationsIds:E},"comments")),s(y({totalCount:E.length,unreadCount:T.length},"comments")),s(Ct(it))}},[A,D,L,C,z,O,w?.length]);const st={events:o.userRoleId!=null?[`private-${o.userRoleId}.dashboard-user-notification`]:[],eventCallback:(e,p)=>{if(Gt(p)){const T=Tt(p.mode);if(T==="dashboard"&&s(y({unreadCount:p.data.unread},"tasks")),j!=="In-Progress"){const E=[];R==="all"?E.push("read","unread"):R!=="mentions"&&E.push(R),s(M("task_manager",T,E,!0))}}}},nt=dt();return _.jsx(jt,{tenantEmailDomain:n,loggedInUserRoleMap:Y,signedInUser:h,externalNotificationsUnreadCount:tt,location:l,navigate:t,isDebitCardFeatureEnabled:c,users:at,markInboxNotificationAsRead:nt,allUnreadCommentsNotificationIds:et,isAiCfoAccessEnabled:r,onAskAiCfoClick:I,...st})};function ie(){return _.jsxs(gt,{children:[_.jsx(H,{path:"/:selectedTab",element:_.jsx(qt,{})}),_.jsx(H,{path:"*",element:_.jsx(lt,{})})]})}export{ie as default};
@@ -0,0 +1 @@
1
+ import{j as n}from"./liveblocks-Dp8Rpfa6.js";import{j as W,h as z,u as K,l as Z,g as d,k as H,n as Q,o as I}from"./core-BBidI7qX.js";import{eN as U,qe as O,pO as X,J7 as v,pJ as T,bv as ee,bn as ae,bR as te,pK as se,J8 as oe,IU as C,dB as re,tB as ne,J9 as ie,tY as ce,eT as le,eR as de}from"./zeni-epic-state-DqbxPrIr.js";import{z as me,N as fe,j as pe,p as M,m as w,C as ue,c as $,ak as he,y as ge}from"./index-Da7wx085.js";import"./mui-B7MJOmvc.js";import Fe from"./NotFoundScreen-ChgqfaBO.js";import{F as be}from"./FeaturePreviewScreen-Bw8UbYar.js";import{a as g}from"./sentry-CjhVLHR5.js";import{u as Ie}from"./useAskAiCfoHostNavButtonProps-CVRBuwu7.js";import{c as Ce}from"./useFetchSuggestedQuestionsWhenReady-Bk64M-bJ.js";import{u as Te}from"./useInitialThreadRequest-BoJZmQZj.js";import{t as ye}from"./routePaths-BmuUFrf4.js";import{M as Se}from"./MobileAppDrawer-IlLzhWb_.js";import"./recharts-BoxqkqlO.js";import"./analytics-BJQfczQS.js";import"./plaid-C04pF6iT.js";import"./dnd-CkhjCkb3.js";import"./stripe-DMRn4zHo.js";import"./lottie-BWQSrnVe.js";import"./lexical-ElGQdEM-.js";import"./pdf--vBxpUYp.js";import"./utils-DVwIdRkq.js";(function(){try{var s=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},e=new s.Error().stack;e&&(s._sentryDebugIds=s._sentryDebugIds||{},s._sentryDebugIds[e]="8ed25f6c-32d1-4150-9815-f2399bfd671b",s._sentryDebugIdIdentifier="sentry-dbid-8ed25f6c-32d1-4150-9815-f2399bfd671b")}catch{}})();const y=(s,e,a,o)=>{if(s!=e){const r=o??"";s!=null&&s.length>0?a(`../${e}${r}`,{replace:!0}):a(`${e}${r}`,{replace:!0})}},ke=H(function(s){const e=oe(s),a={},o=e.pandLReportWithForecast.uiState.nodeCollapseState;return Object.keys(o).forEach(r=>{a[r]=o[r]===!1}),{selectedTimeframe:e.selectedTimeframe,isForecastVsActualOn:e.isForecastVsActualOn,compareMode:e.compareMode,forecastList:e.forecastList,selectedForecast:e.selectedForecast,pandLreport:e.pandLReportWithForecast,scrollPosition:e.pandLReportWithForecast.uiState.scrollPosition,nodeOpenStatus:a,type:"name+balances_forecast",analytics:$}},function(s,e){return{onForecastSelectionChanged:(a,o)=>{s(v(a,o)),e.isPandLReportFetched(a)||s(T(a)),y(e.forecastIdFromUrlPath,a,e.navigate)},onTimeframeChanged:a=>{s(ce(a))},onForecastVsActualsCompareToggle:a=>{s(ie(a)),s(C({forecastId:e.forecastIdFromUrlPath,scrollPosition:{scrollLeft:0,scrollTop:0}}))},onCompareModeChanged:a=>{s(ne(e.firstMonthOfFY,a,0,[]))},onAccountBalanceClick:e.hasTransactionAccess!==!0?void 0:(a,o)=>{let r,i;const p=a.accountName===""?a.accountDescription:a.accountName;if(o.balanceTimeFrame==="month"||o.balanceTimeFrame==="quarter"?(r=o.balanceTimeFrame,i=re(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 m=ye(e.tenantEmailDomain,a.accountId,a.accountType,p,r,i),u=ge(e.location.state?.pathnameStackToGoBack,e.location.pathname);e.navigate(m,{state:{pathnameStackToGoBack:u,referrer:"Forecast"}})}},onNodeCollapseToggled:(a,o)=>{s(C({forecastId:e.forecastIdFromUrlPath,nodeCollapseState:{nodeId:a,isCollapsed:o===!1}}))},onTableScroll:a=>{s(C({forecastId:e.forecastIdFromUrlPath,scrollPosition:a}))},onBackClick:()=>{e.navigate("../../")}}})(he);function P(){const s=W(),e=z(),a=K(),{forecastId:o,tenantEmailDomain:r}=Z(),[i,p]=g.useState(!1),[m,u]=g.useState(!1),h=me.getSignedInUser(),S=d(t=>U(t)),B=S.company?.companyInfo.firstMonthOfFY??1,c=d(t=>O(t.forecastState,t.forecastListState)),l=d(t=>t.forecastListState.fetchState==="Completed"),k=d(t=>t.profitAndLossState),A=d(t=>t.reportUIOptionsState.selectedForecast),x=t=>k.pandLByForecastID[t]!=null&&se(t,k).reducedAllFetchState.fetchState==="Completed",{areTenantIdsInSync:F}=fe();Ce({isDataReady:l});const{isAiCfoAccessEnabled:N,onAskAiCfoClick:q}=Ie({mobileExploreReferrer:"Forecast"});g.useEffect(()=>{if(!i&&F)p(!0),l||e(X());else if(l&&!m){u(!0);const t=((f,L,R)=>L!=null?f.forecasts.findIndex(b=>b.id===L):R!=null?f.forecasts.findIndex(b=>b.id===R):f.forecasts.length>0?0:-1)(c,o,A?.id);t===-1&&o!=null?s("page-not-found",{replace:!0}):t!==-1&&t!=A?.index?(e(v(c.forecasts[t].id,t)),y(o,c.forecasts[t].id,s,a.search)):o==null&&t!==-1&&y(void 0,c.forecasts[t].id,s,a.search),t!==-1&&!x(c.forecasts[t].id)&&F&&e(T(c.forecasts[t].id))}},[i,p,e,l,c,m,u,O,T,F]);const D=pe(),Y=D?.loggedInUserRole!=null&&ee(D.loggedInUserRole),{useFeatureGate:_}=M(),{isFeatureEnabled:j}=_(w.isReportsCommentingEnabled),G=Te(j?S?.companyId:void 0,{clearParams:l&&m}),[J,V]=g.useState(!1),E=t=>{V(t)};return n.jsxs(n.Fragment,{children:[l?n.jsx(ue,{analytics:$,onLoad:t=>(f=>f.trackForecast())(t)}):null,n.jsx(Se,{isAppContentDrawerOpen:J,handleDrawerToggle:E}),n.jsx(ke,{firstMonthOfFY:B,tenantEmailDomain:r,forecastIdFromUrlPath:o,navigate:s,location:a,isPandLReportFetched:x,meetingUrl:te(`https://meetings.hubspot.com/svitlana-grankovska?firstname=${h?.firstName}&lastname=${h?.lastName}&email=${h?.userEmail}`),hasTransactionAccess:Y,isAiCfoAccessEnabled:N,onAskAiCfoClick:q,isReportsCommentingEnabled:j,isZeniUser:ae(h),initialOpenThreadRequest:G,onClickMenuIcon:()=>{E(!0)}})]})}function We(){const s=d(i=>U(i)),{useFeatureGate:e}=M(),{isFeatureEnabled:a}=e(w.isDebitCardFeatureEnabled),o=le(a,s),r=de(s);return o===!0||r===!0?n.jsx(be,{}):n.jsxs(Q,{children:[n.jsx(I,{path:"/",element:n.jsx(P,{})}),n.jsx(I,{path:"/:forecastId",element:n.jsx(P,{})}),n.jsx(I,{path:"/:forecastId/*",element:n.jsx(Fe,{})})]})}export{We as PandLWithForecastRoutes,We as default};
@@ -0,0 +1,22 @@
1
+ import{j as a}from"./liveblocks-Dp8Rpfa6.js";import{J2 as te,eN as q,jq as z,eT as Y,eR as ne,GD as Q,IH as oe,sJ as Ee,J3 as M,sx as ke,sS as Ie,sM as ie,sB as re,sQ as Pe,sN as je,J4 as le,un as Te,J5 as Le,fw as ve,J6 as G,sG as de,sE as ce,sV as Fe,c0 as Re}from"./zeni-epic-state-DqbxPrIr.js";import{r as pe,p as X,m as E,z as K,a5 as ue,H as me,ag as ge,ah as Ae,F as he,o as A,J as fe,D as Ce,ai as Oe,N as Ve,C as Ue,c as be,e as Be,y as Ze,aj as $e,j as Ge}from"./index-Da7wx085.js";import{D as ye,n as W,S as we}from"./mui-B7MJOmvc.js";import se from"./NotFoundScreen-ChgqfaBO.js";import{a as r}from"./sentry-CjhVLHR5.js";import{h as ee,l as Je,g as m,j as He,u as ze,k as Ke,n as ae,o as $}from"./core-BBidI7qX.js";import{u as We}from"./useAskAiCfoHostNavButtonProps-CVRBuwu7.js";import{c as Ne}from"./useFetchSuggestedQuestionsWhenReady-Bk64M-bJ.js";import{M as _e}from"./MobileAppDrawer-IlLzhWb_.js";import"./recharts-BoxqkqlO.js";import"./analytics-BJQfczQS.js";import"./plaid-C04pF6iT.js";import"./dnd-CkhjCkb3.js";import"./stripe-DMRn4zHo.js";import"./lottie-BWQSrnVe.js";import"./lexical-ElGQdEM-.js";import"./pdf--vBxpUYp.js";import"./utils-DVwIdRkq.js";(function(){try{var s=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new s.Error().stack;t&&(s._sentryDebugIds=s._sentryDebugIds||{},s._sentryDebugIds[t]="db480121-dd2d-42d7-8413-a22f5660e17a",s._sentryDebugIdIdentifier="sentry-dbid-db480121-dd2d-42d7-8413-a22f5660e17a")}catch{}})();const Me={overlayWidth:new he(100,100,48)},J=Ce.getLocalizedStrings().peoplePage.invitePage,qe=({companyId:s,managersListView:t,companyPassportView:l,classListView:n,mode:g,isEditPeopleDrawerOpen:o,closeDrawerHandler:y})=>{const h=pe(),p=ee(),[O,V]=r.useState(!1),[I,w]=r.useState(!1),{userId:D}=Je(),d=m(e=>te(e)),u=m(e=>q(e)),S=m(e=>z(e)),{useFeatureGate:f}=X(),{isFeatureEnabled:k}=f(E.isDebitCardFeatureEnabled),P=Y(k,u),L=ne(u),v=Q(u),U=oe(u),B=!!u.company?.featuresActivationInfo?.isReimbursementFeatureEnabled,x=!P&&S&&n.fetchState!=="Completed"||t.fetchState!=="Completed"||l.fetchState!=="Completed"||s==null;if(K.getSignedInUser()==null)throw Error("Can't access invite people page without signing in...");const C=()=>{p(M()),y()},F=()=>{O===!0?w(!0):C()},Z=l.companyView?.controllers?.map(e=>e.user),{isFeatureEnabled:c}=f(E.isDepositAccountsFeatureEnabled),{isFeatureEnabled:j}=f(E.isChargeCardFeatureEnabled),T=ue(u,j,k),{isFeatureEnabled:R}=f(E.isTreasuryEnabled),b={peopleDetails:d,classList:n.classes,managersList:t.users,controllersList:Z,mode:g,isZeniTenant:v,isAccountingClassesEnabled:S,isReimbursementDisabled:B===!1,isZeniAccountsDisabled:c===!1,isChargeCardDisabled:T===!1,isTreasuryDisabled:R===!1,isLiteRoleDisabled:U===!1,isBankingOnlyTenant:P,isCardsOnlyTenant:L,onResetClick:C,onDeleteUser:e=>{p(re(e.userId,e.userRole.userRoleId))},onPeopleLocalDataUpdated:e=>{p(ie({peopleLocalData:e})),V(!0)},onSaveClick:()=>{p(g==="zeni_only"?ke(s):Ie(v))},onCloseClick:F,isLoading:x||d.person==null},i={onOkClick:()=>{w(!1),C()},onCancelClick:()=>{w(!1)}};return r.useEffect(()=>{x===!1&&D!=null&&p(Ee(D))},[x,D]),r.useEffect(()=>{d.updatePersonState.fetchState==="Completed"&&C()},[d.updatePersonState.fetchState]),a.jsx(ye,{anchor:"right",open:o,PaperProps:{style:{width:Me.overlayWidth.valuePercentage(h),boxShadow:"none"}},slotProps:{backdrop:{style:{backgroundColor:me.overlayDark,cursor:"pointer"}}},onClose:F,children:a.jsxs(Ye,{onClick:e=>e.stopPropagation(),children:[I===!0?a.jsx(ge,{titleComponent:a.jsx(De,{children:J.discardTitle}),descriptionComponent:a.jsx(Se,{children:J.discardDescription}),primaryButtonText:J.discard,secondaryButtonText:J.no,action:i,isEditPopup:!0}):null,a.jsx(Ae,{...b})]})})},Ye=W(we)`
2
+ display: flex;
3
+ min-height: 100%;
4
+ flex-direction: column;
5
+ `,De=W(fe.H6Regular)`
6
+ margin-top: ${A.sp7};
7
+ padding-left: ${A.sp8};
8
+ padding-right: ${A.sp8};
9
+ color: ${s=>s.theme.colors.primary};
10
+ word-break: break-word;
11
+ `,Se=W(fe.LargeRegularSp)`
12
+ color: ${s=>s.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
+ `,Qe={overlayWidth:new he(100,100,48)},H=Ce.getLocalizedStrings().peoplePage.invitePage,Xe=({companyId:s,managersListView:t,companyPassportView:l,classListView:n,mode:g,isInvitePeopleDrawerOpen:o,closeDrawerHandler:y})=>{const h=pe(),p=ee(),[O,V]=r.useState(!1),[I,w]=r.useState(!1),D=m(i=>te(i)),d=m(i=>q(i)),u=m(i=>z(i)),{useFeatureGate:S}=X(),{isFeatureEnabled:f}=S(E.isDebitCardFeatureEnabled),k=Y(f,d),P=ne(d),L=Q(d),v=oe(d),U=!!d.company?.featuresActivationInfo?.isReimbursementFeatureEnabled,B=!k&&u&&n.fetchState!=="Completed"||t.fetchState!=="Completed"||l.fetchState!=="Completed"||s==null;if(K.getSignedInUser()==null)throw Error("Can't access invite people page without signing in...");const x=()=>{y(),p(M())},C=()=>{O===!0?w(!0):x()},F={onOkClick:()=>{w(!1),x()},onCancelClick:()=>{w(!1)}},Z=l.companyView?.controllers.map(i=>i.user),{isFeatureEnabled:c}=S(E.isDepositAccountsFeatureEnabled),{isFeatureEnabled:j}=S(E.isChargeCardFeatureEnabled),T=ue(d,j,f),{isFeatureEnabled:R}=S(E.isTreasuryEnabled),b={classList:n.classes,managersList:t.users,controllersList:Z,mode:g,isZeniTenant:L,onPeopleLocalDataUpdated:i=>{p(ie({peopleLocalData:i})),V(!0)},onResetClick:x,onSaveClick:()=>{p(g==="zeni_only"?Pe(s):je())},onCloseClick:C,peopleDetails:D,isAccountingClassesEnabled:u,isReimbursementDisabled:U===!1,isLiteRoleDisabled:v===!1,isZeniAccountsDisabled:c===!1,isChargeCardDisabled:T===!1,isTreasuryDisabled:R===!1,isBankingOnlyTenant:k,isCardsOnlyTenant:P,isLoading:B};return r.useEffect(()=>{D.invitePersonState.fetchState==="Completed"&&(y(),p(M()))},[D.invitePersonState.fetchState]),a.jsx(ye,{anchor:"right",open:o,PaperProps:{style:{width:Qe.overlayWidth.valuePercentage(h),boxShadow:"none"}},slotProps:{backdrop:{style:{backgroundColor:me.overlayDark,cursor:"pointer"}}},onClose:C,children:a.jsxs(es,{onClick:i=>i.stopPropagation(),children:[I===!0?a.jsx(ge,{titleComponent:a.jsx(De,{children:H.discardTitle}),descriptionComponent:a.jsx(Se,{children:H.discardDescription}),primaryButtonText:H.discard,secondaryButtonText:H.no,action:F}):null,a.jsx(Oe,{...b})]})})},es=W(we)`
19
+ display: flex;
20
+ min-height: 100%;
21
+ flex-direction: column;
22
+ `,ss=Ke(function(s,t){const l=le(s),n=K.getSignedInUser();return{data:l,loggedinUserId:n?.userId??"",isZeniTenant:t.isZeniTenant===!0,shouldFetchClasses:t.shouldFetchClasses,isZeniAdminUser:n?.userEmailDomain==="zeni.ai"&&t.isZeni===!0,isAccountingClassesEnabled:z(s),analytics:be}},function(s,t){const{navigate:l,companyId:n,shouldFetchClasses:g}=t;return{personAction:{onPersonDelete:(o,y)=>{s(re(o,y))},onResendInvite:o=>{s(Fe(o))},onReloadPeople:()=>{s(de()),s(ce(n,g))},onBackClick:()=>{l("../../")},onModeChange:o=>{s(G({mode:o,searchText:"",sortKey:"name",sortOrder:"ascending"}))},onSearchTextChanged:o=>{s(G({searchText:o}))}}}})($e);function _({isInvitePeopleDrawerOpen:s,isEditPeopleDrawerOpen:t}){const l=He(),n=ee(),g=ze(),{areTenantIdsInSync:o}=Ve(),y=K.getSignedInUser(),h=m(e=>q(e)),{useFeatureGate:p}=X(),{isFeatureEnabled:O}=p(E.isDebitCardFeatureEnabled),V=m(e=>z(e)),I=!Y(O,h)&&V,w=Q(h),D=h?.tenantId,{tenantEmailDomain:d}=h,[u,S]=r.useState(!1),[f,k]=r.useState(!1),[P,L]=r.useState(!1),[v,U]=r.useState("off"),[B,x]=r.useState(!1),C=e=>{x(e)},{isAiCfoAccessEnabled:F,onAskAiCfoClick:Z}=We({mobileExploreReferrer:"People"}),c=m(e=>le(e));Ne({isDataReady:c.fetchState==="Completed"});const j=m(e=>Te(e.classState,e.classListState)),T=m(e=>Le(e.userState,e.userRoleState,e.userListViewState,"manager")),R=m(e=>ve(e)),b=h?.companyId;r.useEffect(()=>{u&&v===c.uiState.mode||!o||(n(G({searchText:"",sortKey:"name",sortOrder:"ascending"})),U(c.uiState.mode),S(!0),n(de()))},[u,y,D,n,c.uiState.mode,o]),r.useEffect(()=>{b!=null&&o&&n(ce(b,I))},[b,I,o]),r.useEffect(()=>{k(s!=null&&s===!0),L(t!=null&&t===!0&&t)},[s,t]),r.useEffect(()=>{n(G({searchText:"",sortKey:"name",sortOrder:"ascending"}))},[]);const i=()=>{k(!1),L(!1),l("../")};return a.jsxs(a.Fragment,{children:[c.fetchState==="Completed"?a.jsx(Ue,{analytics:be,onLoad:e=>e.trackPageLoaded(Be.Event.members)}):null,f===!0?a.jsx(Xe,{closeDrawerHandler:i,isInvitePeopleDrawerOpen:f,managersListView:T,companyPassportView:R,classListView:j,companyId:b,mode:c.uiState.mode}):null,P===!0?a.jsx(qe,{closeDrawerHandler:i,isEditPeopleDrawerOpen:P,managersListView:T,companyPassportView:R,classListView:j,companyId:b,mode:c.uiState.mode}):null,a.jsx(_e,{isAppContentDrawerOpen:B,handleDrawerToggle:C}),a.jsx(ss,{navigate:l,signedInUser:y,isZeni:h.isZeni,isZeniTenant:w,peopleUIState:c.uiState,companyId:b,shouldFetchClasses:I,classList:j,managersView:T,peopleView:c,onInvitePeopleClick:()=>{l("./new")},onColumnSortConfigChanged:(e,N)=>{n(G({sortKey:e,sortOrder:N}))},onRowClick:e=>{const N=`/${d}/people/${encodeURIComponent(e)}/edit`,xe=Ze(g.state?.pathnameStackToGoBack,g.pathname);l(N,{state:{pathnameStackToGoBack:xe}})},onClickMenuIcon:()=>{C(!0)},isAiCfoAccessEnabled:F,onAskAiCfoClick:Z})]})}function Ds(){const s=Ge();return Re(s?.loggedInUserRole??[])?a.jsxs(ae,{children:[a.jsx($,{path:"/",element:a.jsx(_,{})}),a.jsx($,{path:"new",element:a.jsx(_,{isInvitePeopleDrawerOpen:!0})}),a.jsx($,{path:":userId/edit",element:a.jsx(_,{isEditPeopleDrawerOpen:!0})}),a.jsx($,{path:"*",element:a.jsx(se,{})})]}):a.jsx(ae,{children:a.jsx($,{path:"*",element:a.jsx(se,{})})})}export{Ds as default};
@@ -0,0 +1 @@
1
+ import{j as s}from"./liveblocks-Dp8Rpfa6.js";import E from"./NotFoundScreen-ChgqfaBO.js";import{a as r}from"./sentry-CjhVLHR5.js";import{j as _,u as v,g as p,l as M,h as U,N as O,k as P,n as z,o as h}from"./core-BBidI7qX.js";import{eN as N,OJ as b,bo as B,bn as F,h6 as V,gC as J}from"./zeni-epic-state-DqbxPrIr.js";import{A as $,z as I,ct as q}from"./index-Da7wx085.js";import"./mui-B7MJOmvc.js";import{u as G}from"./useAskAiCfoHostNavButtonProps-CVRBuwu7.js";import{c as H}from"./useFetchSuggestedQuestionsWhenReady-Bk64M-bJ.js";import{M as K}from"./MobileAppDrawer-IlLzhWb_.js";import"./recharts-BoxqkqlO.js";import"./analytics-BJQfczQS.js";import"./plaid-C04pF6iT.js";import"./dnd-CkhjCkb3.js";import"./stripe-DMRn4zHo.js";import"./lottie-BWQSrnVe.js";import"./lexical-ElGQdEM-.js";import"./pdf--vBxpUYp.js";import"./utils-DVwIdRkq.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]="4803c174-80c6-4711-b8d0-f0950ab9ccd6",e._sentryDebugIdIdentifier="sentry-dbid-4803c174-80c6-4711-b8d0-f0950ab9ccd6")}catch{}})();const L=P(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)}}})(q),Q=()=>{const e=_(),t=v(),c=$(),o=p(a=>N(a)),{aggregatedReportViewState:n}=p(a=>b(a)),{tenantEmailDomain:f}=M(),u=U(),l=I.getSignedInUser();if(l==null)throw new Error("Can't access this page without signing in...");const m=r.useRef(!1),[w,C]=r.useState(!1),S=B(o?.userRole??[]),k=o?.userRole?.includes("bookkeeping_admin")??!1,x=F(l),y=S||k||x,d=r.useCallback((a,i,T)=>{u(V({fromMonth:a,toMonth:i,cacheOverride:T}))},[]);r.useEffect(()=>{n?.fetchState==="Completed"&&m.current&&(u(J({messageSection:"data_refresh_update",messageText:"success",type:"success",showStatusIcon:!0})),m.current=!1)},[n?.fetchState]);const D=r.useCallback((a,i)=>{n!=null&&n?.fetchState==="In-Progress"||d(a,i,!0),m.current=!0},[n?.fetchState,d]),j=r.useCallback((a,i)=>{d(a,i,!1)},[d]),g=a=>{C(a)},{isAiCfoAccessEnabled:R,onAskAiCfoClick:A}=G({mobileExploreReferrer:"Performance"});return H({isDataReady:n?.fetchState==="Completed"}),y?s.jsxs(s.Fragment,{children:[s.jsx(K,{isAppContentDrawerOpen:w,handleDrawerToggle:g}),s.jsx(L,{navigate:e,location:t,themeState:c,currentTenant:o,signedInUser:l,tenantEmailDomain:f,onReload:D,onTimeRangeSelect:j,handleDrawerToggle:g,isAiCfoAccessEnabled:R,onAskAiCfoClick:A})]}):s.jsx(O,{to:`/${f}/dashboard`,replace:!0})};function pe(){return s.jsxs(z,{children:[s.jsx(h,{path:"*",element:s.jsx(Q,{})}),s.jsx(h,{path:"*",element:s.jsx(E,{})})]})}export{pe as default};
@@ -1 +1 @@
1
- import{a as h,b as t}from"./sentry-CNCwYM02.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-CjhVLHR5.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-CzlYoB8q.js";import{p as Q,e as xc,d as kc,g as jl,a as xl}from"./sentry-CNCwYM02.js";import{L as dt,bS as Tc,eO as Ac,Ix as Rc,Jd as kl,c1 as Tl,fi as Al,fj as Rl}from"./zeni-epic-state-lenVK-tm.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-zvjLmBW4.js";import{r as un}from"./empty-CzOjtD5w.js";import{r as Fl,a as Bl,b as Ul,c as ql}from"./pdf-lib-CWTnCbuI.js";import{r as Gl}from"./index-BRtx8cu_.js";import{r as zl}from"./index-DH8cVwcc.js";import{j as Zl,u as Hl,h as Vl,g as En,k as Yl}from"./core-CGhI3jCZ.js";import{u as Kl,z as Pc,L as Wl,U as Jl,V as Xl,k as Ql,d as tf}from"./index-D7leYkuC.js";import"./mui-ILn-Gd-L.js";import{d as Pe}from"./decodeURIComponentSafe-CZEzMrgK.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]="bbebc76a-4846-4c37-87a7-2102a2a0b651",t._sentryDebugIdIdentifier="sentry-dbid-bbebc76a-4846-4c37-87a7-2102a2a0b651")}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-Dp8Rpfa6.js";import{p as Q,e as xc,d as kc,g as jl,a as xl}from"./sentry-CjhVLHR5.js";import{L as dt,bR as Tc,eN as Ac,Ii as Rc,I_ as kl,c0 as Tl,fh as Al,fi as Rl}from"./zeni-epic-state-DqbxPrIr.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-DVwIdRkq.js";import{r as un}from"./empty-948x8Pe9.js";import{r as Fl,a as Bl,b as Ul,c as ql}from"./pdf-lib-55B9sG08.js";import{r as Gl}from"./index-Do4uSC5Y.js";import{r as zl}from"./index-BZpFURkG.js";import{j as Zl,u as Hl,h as Vl,g as En,k as Yl}from"./core-BBidI7qX.js";import{u as Kl,z as Pc,L as Wl,V as Jl,W as Xl,i as Ql,c as tf}from"./index-Da7wx085.js";import"./mui-B7MJOmvc.js";import{d as Pe}from"./decodeURIComponentSafe-B_3qleD-.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]="b76d1050-3c93-4f98-8da8-ab087f0f4e70",t._sentryDebugIdIdentifier="sentry-dbid-b76d1050-3c93-4f98-8da8-ab087f0f4e70")}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
 
@@ -0,0 +1,5 @@
1
+ import{j as s}from"./liveblocks-Dp8Rpfa6.js";import{a as o}from"./sentry-CjhVLHR5.js";import{g as f,j as H,h as V,u as F,k as N}from"./core-BBidI7qX.js";import{h as M,r as W,z as R,b3 as _,F as z,N as U,C as $,c as l,e as X,a1 as Z,b4 as Q}from"./index-Da7wx085.js";import{eX as q,eN as G,Lx as P,Ly as J,tr as K,th as g,eZ as Y,bM as ee,tm as ae,Lz as re}from"./zeni-epic-state-DqbxPrIr.js";import{D as ne,e as te,n as se,S as oe}from"./mui-B7MJOmvc.js";import{u as ie}from"./useAskAiCfoHostNavButtonProps-CVRBuwu7.js";import{c as le}from"./useFetchSuggestedQuestionsWhenReady-Bk64M-bJ.js";import{M as de}from"./MobileAppDrawer-IlLzhWb_.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]="25ad5403-b525-42a8-bec6-3a401b18bb98",e._sentryDebugIdIdentifier="sentry-dbid-25ad5403-b525-42a8-bec6-3a401b18bb98")}catch{}})();const ce={overlayWidth:new z(100,100,30)},fe=({isReferralDrawerOpen:e,closeDrawerHandler:a})=>{const r=M(),n=W();if(R.getSignedInUser()==null)throw Error("Can't access How Referral works without signing in...");const i=()=>{a(!0)},u=f(d=>q(d));return s.jsx(ne,{anchor:"right",open:e,PaperProps:{style:{width:ce.overlayWidth.valuePercentage(n),boxShadow:"none"}},slotProps:{backdrop:{style:{opacity:.75,backgroundColor:r.colors.black,cursor:"pointer"}}},onClose:()=>i(),children:s.jsx(te,{in:e,direction:"left",children:s.jsx(ue,{onClick:d=>d.stopPropagation(),children:s.jsx(_,{onDismissClick:i,rewardsPlan:u.rewardsPlan})})})})},ue=se(oe)`
2
+ display: flex;
3
+ min-height: 100%;
4
+ flex-direction: column;
5
+ `,I="refer-and-earn-status-update",we=N(function(e){const a=P(e),r=e.referralViewState.rewardsPlanFetchState,n=ee([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(re({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(ae(n))},onBackClick:()=>{r("../",{relative:"path"})},onReloadInvitees:()=>{e(g(!0))},onCopyReferralLink:()=>{l.trackRewardsPageClicked("copy referral link")},onClickRefer:()=>{l.trackRewardsPageClicked("refer")},onEventReceived:n=>{n===I&&e(g(!0,!0))}}})(Z(Q));function Se({isReferralDrawerOpen:e}){const a=H(),r=V(),n=F(),[i,u]=o.useState(!1),[d,x]=o.useState(!1),[D,E]=o.useState(!1),[k,b]=o.useState(!1),w=R.getSignedInUser(),h=f(t=>G(t)),C=f(t=>P(t)),m=C.fetchState,p=f(t=>t.referralViewState.rewardsPlanFetchState),y=J([C,p]),{areTenantIdsInSync:c}=U();o.useEffect(()=>{h?.rewardsLastViewedTime==null&&D===!1&&(r(K()),E(!0))},[]),o.useEffect(()=>{!i&&m==="Not-Started"&&c&&(u(!0),r(g(!0)))},[m,r,c]),o.useEffect(()=>{!d&&p.fetchState==="Not-Started"&&c&&(x(!0),r(Y(!0)))},[p,r,c]),o.useEffect(()=>{b(e!=null&&e===!0)},[e]);const[j,A]=o.useState(!1),v=t=>{A(t)},{isAiCfoAccessEnabled:L,onAskAiCfoClick:O}=ie({mobileExploreReferrer:"Rewards"});le({isDataReady:y===!0});const T={events:w?.userId!=null?[`private-${w.userId}.${I}`]:[],eventCallback:(t,S,B)=>{B.onEventReceived(t)}};return s.jsxs(s.Fragment,{children:[y===!0?s.jsx($,{analytics:l,onLoad:t=>(S=>{w!=null&&S.trackPageLoaded(X.Event.rewardsPageViewed)})(t)}):null,s.jsx(de,{isAppContentDrawerOpen:j,handleDrawerToggle:v}),k===!0?s.jsx(fe,{closeDrawerHandler:()=>{b(!1),a("..")},isReferralDrawerOpen:k}):null,s.jsx(we,{location:n,navigate:a,currentTenant:h,onClickMenuIcon:()=>{v(!0)},isAiCfoAccessEnabled:L,onAskAiCfoClick:O,...T})]})}export{Se as R};
@@ -0,0 +1 @@
1
+ import{j as t}from"./liveblocks-Dp8Rpfa6.js";import R from"./NotFoundScreen-ChgqfaBO.js";import{a as p}from"./sentry-CjhVLHR5.js";import{j as C,u as I,h as A,g as u,N as E,k,n as D,o as m}from"./core-BBidI7qX.js";import{eN as T,Mr as g,MH as S,Co as V,Bx as U,Cn as c,Ce as _,MW as B}from"./zeni-epic-state-DqbxPrIr.js";import{h as M,z as N,B as W,a1 as $,bJ as O,ab as z}from"./index-Da7wx085.js";import"./mui-B7MJOmvc.js";import{R as v}from"./ReimbursementApprovalRuleDetailScreen-BzLt4PF4.js";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},r=new e.Error().stack;r&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[r]="1f9eb911-6547-46a8-a97e-ee26388f2160",e._sentryDebugIdIdentifier="sentry-dbid-1f9eb911-6547-46a8-a97e-ee26388f2160")}catch{}})();const f="reimbursement-approval-rule-update",H=k(function(e){return{approvalView:g(e),remiSetupApproverViewUpdateData:S(e).remiSetupApproverViewUpdateData}},function(e,r){const{navigate:a,location:l}=r;return{onApprovalRulesEventReceived:s=>{s.endsWith(f)&&e(B(!1))},onBackClick:()=>{z(l)?a("../../"):a("../../../reimbursements/setup")},onDeleteRuleClick:s=>{e(_(s))},onEditRuleClick:s=>{s!=null?(e(c(s)),a(`./${s}/edit`)):(e(c()),a("./new"))}}})($(O)),J=()=>{const e=C(),r=I(),a=A(),[l,s]=p.useState(!1),[d,y]=p.useState(!1),b=u(n=>n.remiSetupApproverViewState.fetchState),o=u(n=>T(n)),w=M(),i=u(n=>g(n)),h=u(n=>S(n).remiSetupApproverViewUpdateData);if(p.useEffect(()=>{h?.updateStatus.fetchState==="Completed"&&a(V())},[h]),p.useEffect(()=>{l||b!=="Not-Started"||(s(!0),a(U(!0)))},[l,b,a]),N.getSignedInUser()==null)throw Error("Can't access reimbursement approval without signing in...");p.useEffect(()=>{i.allApprovalRules.length===0&&i.fetchState==="Completed"&&(d||(y(!0),a(c())),e("./new"))},[d,i,a]);const j={events:o.companyId!=null?[`private-${o.companyId}.${f}`]:[],eventCallback:(n,P,x)=>{n.endsWith(f)&&x.onApprovalRulesEventReceived(n)}};return o.companyReimbursementInfo?.info?.isReimbursementTOSAccepted===!1?t.jsx(E,{to:"../../promo"}):o.companyReimbursementInfo?.info?.isReimbursementTOSAccepted!==!0||i.fetchState!=="Completed"&&i.fetchState!=="Error"?t.jsx(W,{fetchState:"In-Progress",style:{backgroundColor:w.colors.grey5}}):t.jsx(H,{currentTenant:o,location:r,navigate:e,...j})};function Z(){return t.jsxs(D,{children:[t.jsx(m,{path:"/",element:t.jsx(J,{})}),t.jsx(m,{path:"/new",element:t.jsx(v,{})}),t.jsx(m,{path:"/:approvalRuleId/edit",element:t.jsx(v,{})}),t.jsx(m,{path:"*",element:t.jsx(R,{})})]})}export{Z as R};