@zeniai/web-app-ui 5.0.70-prod → 5.0.71-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 (141) hide show
  1. package/dist/assets/AddressRoutes-DkpE57wD.js +1 -0
  2. package/dist/assets/AddressScreen-IPMb-Lqg.js +9 -0
  3. package/dist/assets/AiCfoScreen-DxwryQBf.js +11 -0
  4. package/dist/assets/BillPayApprovalRoutes-B33P7K39.js +1 -0
  5. package/dist/assets/{BillPayRoutes-BtFNSiDK.js → BillPayRoutes-D2OQNHTr.js} +17 -17
  6. package/dist/assets/{BusinessVerificationPageScreen-BGdNNp1F.js → BusinessVerificationPageScreen-BI3GYpKu.js} +2 -2
  7. package/dist/assets/ChargeCardRoutes-DZTXpkWd.js +71 -0
  8. package/dist/assets/CompanyPassportScreen-kKTXGF13.js +1 -0
  9. package/dist/assets/ConnectionAuthScreen-CYS4bJsi.js +11 -0
  10. package/dist/assets/CustomerOnboardingAuthScreen-CFcE03ug.js +1 -0
  11. package/dist/assets/CustomerOnboardingRoutes-jk197VvK.js +23 -0
  12. package/dist/assets/{DashboardRoutes-BaEBgxmc.js → DashboardRoutes-Ckl1eEC2.js} +3 -3
  13. package/dist/assets/DefaultTenantHome-TLtEW787.js +1 -0
  14. package/dist/assets/DomesticWireDetailScreen-BkEDowN8.js +18 -0
  15. package/dist/assets/DrawerScreen-B_tMe04S.js +1 -0
  16. package/dist/assets/EntityDetailRoutes-DlKVqtyC.js +1 -0
  17. package/dist/assets/ExpenseAutomationRoutes-BqK3TSEk.js +25 -0
  18. package/dist/assets/FeaturePreviewScreen-aYYY9m7f.js +1 -0
  19. package/dist/assets/MagicLinkRoutes-BLaYeloO.js +72 -0
  20. package/dist/assets/{MagicLinkSignInScreen-CmXunfk5.js → MagicLinkSignInScreen-CUegQSoi.js} +1 -1
  21. package/dist/assets/MobileAppDrawer-BDT0TmvR.js +1 -0
  22. package/dist/assets/NotFoundScreen-C4aqnA8_.js +1 -0
  23. package/dist/assets/{NotificationRoutes-CFQ9T25M.js → NotificationRoutes-BblXuLTj.js} +1 -1
  24. package/dist/assets/OAuthConsentScreen-sykQomv8.js +1 -0
  25. package/dist/assets/PandLWithForecastRoutes-CBrTW5wX.js +1 -0
  26. package/dist/assets/{PeopleRoutes-QnA9W9te.js → PeopleRoutes-B9d9GdEF.js} +5 -5
  27. package/dist/assets/PerformanceRoutes-BFJ-jyRc.js +1 -0
  28. package/dist/assets/{Preview-C0AoVNkg.js → Preview-IJkS64Sk.js} +1 -1
  29. package/dist/assets/{QBOConnectionScreen-CyYMqomX.js → QBOConnectionScreen-DQkFbpJH.js} +1 -1
  30. package/dist/assets/ReferralListScreen-CyoB8VnU.js +5 -0
  31. package/dist/assets/ReimbursementApprovalRoutes-B00fD8b9.js +1 -0
  32. package/dist/assets/ReimbursementApprovalRuleDetailScreen-DMdpETrG.js +1 -0
  33. package/dist/assets/{ReimbursementRoutes-JoYsNcyp.js → ReimbursementRoutes-u-qnVfy0.js} +7 -7
  34. package/dist/assets/ReportsRoutes-CqNp_xpd.js +1 -0
  35. package/dist/assets/RewardsRoutes-R2VgDdnw.js +1 -0
  36. package/dist/assets/ScreenRoutes-9MMqpDv8.js +2 -0
  37. package/dist/assets/{SettingsRoutes-nEcXq9VR.js → SettingsRoutes-KHzSnNUm.js} +7 -7
  38. package/dist/assets/{SetupPagesScreen-CvciPhAb.js → SetupPagesScreen-Cdo59_U5.js} +5 -5
  39. package/dist/assets/SignInScreen-DX4DUgMU.js +1 -0
  40. package/dist/assets/SignOutScreen-DOTJzbce.js +9 -0
  41. package/dist/assets/TaskListScreen-C1G-Z2qb.js +9 -0
  42. package/dist/assets/TaskRoutes-DeZTJnM4.js +9 -0
  43. package/dist/assets/TransactionDetailRoutes-CxGTwTQr.js +1 -0
  44. package/dist/assets/TransactionDetailScreen-DbXqL9Dv.js +5 -0
  45. package/dist/assets/{TransactionListRoutes-CASYn9ig.js → TransactionListRoutes-r3XEp13P.js} +1 -1
  46. package/dist/assets/{TreasuryRoutes-S6m6I4Ob.js → TreasuryRoutes-Cp7F7y4J.js} +6 -6
  47. package/dist/assets/{VendorsRoutes-CcrRaFs8.js → VendorsRoutes-BBf47BBb.js} +15 -15
  48. package/dist/assets/WiseConfirmationScreen-BZsn9iwu.js +12 -0
  49. package/dist/assets/{ZeniAccountRoutes-By17jtiK.js → ZeniAccountRoutes--fSibHTb.js} +12 -12
  50. package/dist/assets/ZeniAccountStatementScreen-BKbkGQh4.js +9 -0
  51. package/dist/assets/{accountMappingHelper--Nd4AzD5.js → accountMappingHelper-COFGwnKa.js} +1 -1
  52. package/dist/assets/{analytics-CBVce51h.js → analytics-CgF6EPDF.js} +1 -1
  53. package/dist/assets/{analyticsHelper-CchhXxa7.js → analyticsHelper-DUlInMOD.js} +1 -1
  54. package/dist/assets/{core-BiO8az_8.js → core-C_ZreJAw.js} +1 -1
  55. package/dist/assets/{decodeURIComponentSafe-Drs0EkRs.js → decodeURIComponentSafe-BP018w8C.js} +1 -1
  56. package/dist/assets/{dnd-DEqqrbnG.js → dnd-C3uQO7Bn.js} +1 -1
  57. package/dist/assets/empty-D-N5n4Nc.js +1 -0
  58. package/dist/assets/{empty-DIbsZE_-.js → empty-wr1Sjolf.js} +1 -1
  59. package/dist/assets/{emptyVideoElement-B-nTkhqj.js → emptyVideoElement-DDjbVU1E.js} +1 -1
  60. package/dist/assets/epic-DKrR9LyJ.js +2 -0
  61. package/dist/assets/getLocaleForTenant-C-vhBCTM.js +1 -0
  62. package/dist/assets/index-BYIPlMHr.js +2 -0
  63. package/dist/assets/{index-DhM1NMcw.js → index-CGS6zWWp.js} +17206 -15688
  64. package/dist/assets/index-CUa_5F-3.js +1 -0
  65. package/dist/assets/{index-__PpJYcl.js → index-CWsQVRWF.js} +1 -1
  66. package/dist/assets/{index-dsZtT2Le.js → index-CnROQyBG.js} +2 -2
  67. package/dist/assets/index-DJtUADrm.js +1 -0
  68. package/dist/assets/{index-CWkdTmQL.js → index-DpCPl3KC.js} +1 -1
  69. package/dist/assets/{index-WTq_uesm.js → index-T4vVJHIk.js} +1 -1
  70. package/dist/assets/{lexical-BcUhE2s3.js → lexical-E_ubWL4u.js} +1 -1
  71. package/dist/assets/{liveblocks-iYXuwnNJ.js → liveblocks-BdePShct.js} +1 -1
  72. package/dist/assets/{lottie-crYXxJIl.js → lottie-CUKBWgbe.js} +1 -1
  73. package/dist/assets/{mui-Wsw1v_RJ.js → mui-BtnH6ELy.js} +1 -1
  74. package/dist/assets/{pathToGoBack-mF5zZGNy.js → pathToGoBack-Bg0yBLYd.js} +1 -1
  75. package/dist/assets/{pdf-BB9eCt-A.js → pdf-CH0jWS01.js} +4 -4
  76. package/dist/assets/{pdf-lib-FxBSZOu8.js → pdf-lib-th4agIPv.js} +1 -1
  77. package/dist/assets/{plaid-YevEbNem.js → plaid-CLHQ0yLv.js} +1 -1
  78. package/dist/assets/{pusher-DcEB1EIs.js → pusher-DTlPALAn.js} +1 -1
  79. package/dist/assets/{react-CEVNSt9Z.js → react-4Ap2VUmu.js} +1 -1
  80. package/dist/assets/{react-Dxc9sTnE.js → react-B1z9ZoMC.js} +1 -1
  81. package/dist/assets/{react-Cyny6kHD.js → react-BYz405pF.js} +1 -1
  82. package/dist/assets/{react-BHXMCFc8.js → react-Bxo6GPqK.js} +1 -1
  83. package/dist/assets/{react-BRhSxuPy.js → react-COj3_dzF.js} +1 -1
  84. package/dist/assets/{react-CGu-TC09.js → react-CcfFphdJ.js} +1 -1
  85. package/dist/assets/{recharts-_jQKodaN.js → recharts-CHr9O26_.js} +1 -1
  86. package/dist/assets/{routePaths-DZQ5pfqe.js → routePaths-DZkWYInw.js} +1 -1
  87. package/dist/assets/{sentry-C0ycLLNj.js → sentry-CX_3yQh7.js} +1 -1
  88. package/dist/assets/{url-BaUJdhZo.js → url-BBCQjahk.js} +1 -1
  89. package/dist/assets/{url-lQlWCduk.js → url-CcaHVDFu.js} +1 -1
  90. package/dist/assets/useAskAiCfoHostNavButtonProps-Nsv7MqoG.js +1 -0
  91. package/dist/assets/{useDeviceId-CNwwT5y9.js → useDeviceId-DtlEyHOn.js} +1 -1
  92. package/dist/assets/useFetchSuggestedQuestionsWhenReady-C86A67zi.js +1 -0
  93. package/dist/assets/useInitialThreadRequest-AyrSL871.js +1 -0
  94. package/dist/assets/{utils-84J_wB9-.js → utils-Dw8b4HCO.js} +1 -1
  95. package/dist/assets/{withTransactionSidePanel-BlWzkOQ0.js → withTransactionSidePanel-BmH5jBz_.js} +2 -2
  96. package/dist/assets/zeni-epic-state-H6DZSSlf.js +13 -0
  97. package/dist/index.html +1 -1
  98. package/package.json +4 -4
  99. package/dist/assets/AddressRoutes-CSwoj3Tc.js +0 -1
  100. package/dist/assets/AddressScreen-CT6TP3Z1.js +0 -9
  101. package/dist/assets/AiCfoScreen-BWS36jvF.js +0 -11
  102. package/dist/assets/BillPayApprovalRoutes-ss8zp9B4.js +0 -1
  103. package/dist/assets/ChargeCardRoutes-y2uX_nrx.js +0 -71
  104. package/dist/assets/CompanyPassportScreen-CxsYYjMZ.js +0 -1
  105. package/dist/assets/ConnectionAuthScreen-B2gLg7lc.js +0 -11
  106. package/dist/assets/CustomerOnboardingAuthScreen-Mkc8Qg4L.js +0 -1
  107. package/dist/assets/CustomerOnboardingRoutes-DyOkPrNA.js +0 -23
  108. package/dist/assets/DefaultTenantHome-ceU-YxNe.js +0 -1
  109. package/dist/assets/DomesticWireDetailScreen-C7eUBEYW.js +0 -18
  110. package/dist/assets/DrawerScreen-CFX9aNCU.js +0 -1
  111. package/dist/assets/EntityDetailRoutes-BnUqJDu6.js +0 -1
  112. package/dist/assets/ExpenseAutomationRoutes-zrWAZ6A-.js +0 -25
  113. package/dist/assets/FeaturePreviewScreen-Chy-C2bY.js +0 -1
  114. package/dist/assets/MagicLinkRoutes-D1guk6IX.js +0 -72
  115. package/dist/assets/MobileAppDrawer-DkH2rucX.js +0 -1
  116. package/dist/assets/NotFoundScreen-CoCyTXNP.js +0 -1
  117. package/dist/assets/PandLWithForecastRoutes-C6ob6CWy.js +0 -1
  118. package/dist/assets/PerformanceRoutes-CscGDV-a.js +0 -1
  119. package/dist/assets/ReferralListScreen-DOkwApTO.js +0 -5
  120. package/dist/assets/ReimbursementApprovalRoutes-B7OZneq9.js +0 -1
  121. package/dist/assets/ReimbursementApprovalRuleDetailScreen-C096muhL.js +0 -1
  122. package/dist/assets/ReportsRoutes-DoEMUl54.js +0 -1
  123. package/dist/assets/RewardsRoutes-3vkMk0d3.js +0 -1
  124. package/dist/assets/ScreenRoutes-CFYjn9UY.js +0 -2
  125. package/dist/assets/SignInScreen-D0vIN08v.js +0 -1
  126. package/dist/assets/SignOutScreen-Bxw8G7ep.js +0 -9
  127. package/dist/assets/TaskListScreen-Babx6Iz5.js +0 -9
  128. package/dist/assets/TaskRoutes-C8PZpDeD.js +0 -9
  129. package/dist/assets/TransactionDetailRoutes-BSH_Iaci.js +0 -1
  130. package/dist/assets/TransactionDetailScreen-B5S0aVL7.js +0 -5
  131. package/dist/assets/WiseConfirmationScreen-Dd0le7LT.js +0 -12
  132. package/dist/assets/ZeniAccountStatementScreen-D6WwbD40.js +0 -9
  133. package/dist/assets/empty-CjJ6NPQs.js +0 -1
  134. package/dist/assets/epic-BkjwplcH.js +0 -2
  135. package/dist/assets/getLocaleForTenant-DZ_PqUgv.js +0 -1
  136. package/dist/assets/index-BALn8uen.js +0 -1
  137. package/dist/assets/index-CPuEfxmi.js +0 -1
  138. package/dist/assets/useAskAiCfoHostNavButtonProps-DoU7lqQS.js +0 -1
  139. package/dist/assets/useFetchSuggestedQuestionsWhenReady-BWXD0kZI.js +0 -1
  140. package/dist/assets/useInitialThreadRequest-COC1d6YZ.js +0 -1
  141. package/dist/assets/zeni-epic-state-sw_lecJS.js +0 -14
@@ -1,25 +0,0 @@
1
- import{j as C}from"./liveblocks-iYXuwnNJ.js";import wn from"./NotFoundScreen-CoCyTXNP.js";import{a as o,b as Tt}from"./sentry-C0ycLLNj.js";import{n as De,S as xn}from"./mui-Wsw1v_RJ.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-BiO8az_8.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-sw_lecJS.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-DhM1NMcw.js";import{u as qt}from"./useAskAiCfoHostNavButtonProps-DoU7lqQS.js";import{c as Gt}from"./useFetchSuggestedQuestionsWhenReady-BWXD0kZI.js";import{c as vt,C as yo}from"./TransactionDetailScreen-B5S0aVL7.js";import{w as bo}from"./withTransactionSidePanel-BlWzkOQ0.js";import{h as Ao,v as Po}from"./routePaths-DZQ5pfqe.js";import{g as $e}from"./accountMappingHelper--Nd4AzD5.js";import{D as To}from"./DrawerScreen-CFX9aNCU.js";import"./recharts-_jQKodaN.js";import"./analytics-CBVce51h.js";import"./plaid-YevEbNem.js";import"./dnd-DEqqrbnG.js";import"./stripe-DMRn4zHo.js";import"./lottie-crYXxJIl.js";import"./lexical-BcUhE2s3.js";import"./pdf-BB9eCt-A.js";import"./utils-84J_wB9-.js";import"./decodeURIComponentSafe-Drs0EkRs.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
- display: flex;
3
- height: 100vh;
4
- width: 100%;
5
- flex: 1 1 auto;
6
- flex-direction: column;
7
- background-color: ${t=>t.theme.colors.grey4};
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
- display: flex;
10
- flex-direction: column;
11
- height: 100%;
12
- `,bt=De.div`
13
- flex: 1;
14
- min-height: 0;
15
- display: flex;
16
- flex-direction: column;
17
- box-sizing: border-box;
18
- min-width: 0;
19
- overflow-x: hidden;
20
- overflow-y: auto;
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
- display: flex;
23
- min-height: 100%;
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(_o,{})}),C.jsx(je,{path:"*",element:C.jsx(wn,{})})]})}export{ls as default};
@@ -1 +0,0 @@
1
- import{j as s}from"./liveblocks-iYXuwnNJ.js";import{a as r}from"./sentry-C0ycLLNj.js";import{Y as l,Z as p,_ as b,w as f}from"./index-DhM1NMcw.js";import"./mui-Wsw1v_RJ.js";import m from"./NotFoundScreen-CoCyTXNP.js";import{j as c,u}from"./core-BiO8az_8.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};
@@ -1,72 +0,0 @@
1
- import{j as t}from"./liveblocks-iYXuwnNJ.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-BiO8az_8.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-sw_lecJS.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-DhM1NMcw.js";import{n as c}from"./mui-Wsw1v_RJ.js";import b from"./NotFoundScreen-CoCyTXNP.js";import{a as P}from"./sentry-C0ycLLNj.js";import"./recharts-_jQKodaN.js";import"./analytics-CBVce51h.js";import"./plaid-YevEbNem.js";import"./dnd-DEqqrbnG.js";import"./stripe-DMRn4zHo.js";import"./lottie-crYXxJIl.js";import"./lexical-BcUhE2s3.js";import"./pdf-BB9eCt-A.js";import"./utils-84J_wB9-.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};
@@ -1 +0,0 @@
1
- import{j as U}from"./liveblocks-iYXuwnNJ.js";import{a as c}from"./sentry-C0ycLLNj.js";import{h as pe,g as s,l as Je,u as Ke,j as Qe,i as R}from"./core-BiO8az_8.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-sw_lecJS.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-DhM1NMcw.js";import{D as Oa}from"./mui-Wsw1v_RJ.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};
@@ -1 +0,0 @@
1
- import{j as e}from"./liveblocks-iYXuwnNJ.js";import{j as r,k as i}from"./core-BiO8az_8.js";import{X as n}from"./index-DhM1NMcw.js";import"./mui-Wsw1v_RJ.js";import"./sentry-C0ycLLNj.js";import"./zeni-epic-state-sw_lecJS.js";import"./recharts-_jQKodaN.js";import"./analytics-CBVce51h.js";import"./plaid-YevEbNem.js";import"./dnd-DEqqrbnG.js";import"./stripe-DMRn4zHo.js";import"./lottie-crYXxJIl.js";import"./lexical-BcUhE2s3.js";import"./pdf-BB9eCt-A.js";import"./utils-84J_wB9-.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 +0,0 @@
1
- import{j as n}from"./liveblocks-iYXuwnNJ.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-BiO8az_8.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-sw_lecJS.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-DhM1NMcw.js";import"./mui-Wsw1v_RJ.js";import Fe from"./NotFoundScreen-CoCyTXNP.js";import{F as be}from"./FeaturePreviewScreen-Chy-C2bY.js";import{a as g}from"./sentry-C0ycLLNj.js";import{u as Ie}from"./useAskAiCfoHostNavButtonProps-DoU7lqQS.js";import{c as Ce}from"./useFetchSuggestedQuestionsWhenReady-BWXD0kZI.js";import{u as Te}from"./useInitialThreadRequest-COC1d6YZ.js";import{t as ye}from"./routePaths-DZQ5pfqe.js";import{M as Se}from"./MobileAppDrawer-DkH2rucX.js";import"./recharts-_jQKodaN.js";import"./analytics-CBVce51h.js";import"./plaid-YevEbNem.js";import"./dnd-DEqqrbnG.js";import"./stripe-DMRn4zHo.js";import"./lottie-crYXxJIl.js";import"./lexical-BcUhE2s3.js";import"./pdf-BB9eCt-A.js";import"./utils-84J_wB9-.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};
@@ -1 +0,0 @@
1
- import{j as s}from"./liveblocks-iYXuwnNJ.js";import E from"./NotFoundScreen-CoCyTXNP.js";import{a as r}from"./sentry-C0ycLLNj.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-BiO8az_8.js";import{eN as N,OJ as b,bo as B,bn as F,h6 as V,gC as J}from"./zeni-epic-state-sw_lecJS.js";import{A as $,z as I,ct as q}from"./index-DhM1NMcw.js";import"./mui-Wsw1v_RJ.js";import{u as G}from"./useAskAiCfoHostNavButtonProps-DoU7lqQS.js";import{c as H}from"./useFetchSuggestedQuestionsWhenReady-BWXD0kZI.js";import{M as K}from"./MobileAppDrawer-DkH2rucX.js";import"./recharts-_jQKodaN.js";import"./analytics-CBVce51h.js";import"./plaid-YevEbNem.js";import"./dnd-DEqqrbnG.js";import"./stripe-DMRn4zHo.js";import"./lottie-crYXxJIl.js";import"./lexical-BcUhE2s3.js";import"./pdf-BB9eCt-A.js";import"./utils-84J_wB9-.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,5 +0,0 @@
1
- import{j as s}from"./liveblocks-iYXuwnNJ.js";import{a as o}from"./sentry-C0ycLLNj.js";import{g as f,j as H,h as V,u as F,k as N}from"./core-BiO8az_8.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-DhM1NMcw.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-sw_lecJS.js";import{D as ne,e as te,n as se,S as oe}from"./mui-Wsw1v_RJ.js";import{u as ie}from"./useAskAiCfoHostNavButtonProps-DoU7lqQS.js";import{c as le}from"./useFetchSuggestedQuestionsWhenReady-BWXD0kZI.js";import{M as de}from"./MobileAppDrawer-DkH2rucX.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};
@@ -1 +0,0 @@
1
- import{j as t}from"./liveblocks-iYXuwnNJ.js";import R from"./NotFoundScreen-CoCyTXNP.js";import{a as p}from"./sentry-C0ycLLNj.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-BiO8az_8.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-sw_lecJS.js";import{h as M,z as N,B as W,a1 as $,bJ as O,ab as z}from"./index-DhM1NMcw.js";import"./mui-Wsw1v_RJ.js";import{R as v}from"./ReimbursementApprovalRuleDetailScreen-C096muhL.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};
@@ -1 +0,0 @@
1
- import{j as g}from"./liveblocks-iYXuwnNJ.js";import{a as y}from"./sentry-C0ycLLNj.js";import{j as A,h as w,u as C,l as T,g as b,k as U}from"./core-BiO8az_8.js";import{MH as R,Mr as E,Ch as x,Cq as _,Co as h,Cp as S,MI as B}from"./zeni-epic-state-sw_lecJS.js";import{z as k,h as V,B as j,bA as F,ab as O}from"./index-DhM1NMcw.js";import"./mui-Wsw1v_RJ.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]="45689b19-8831-4b3e-a594-55a3d94fe9fb",e._sentryDebugIdIdentifier="sentry-dbid-45689b19-8831-4b3e-a594-55a3d94fe9fb")}catch{}})();function $(e){return B(e)==null}const M=U(function(e,a){const t=R(e),s=t.remiSetupApproverViewUpdateData?.type??"approval_create",n=s==="approval_create"&&t.allApprovalRules.length!==0;let l=t.allApprovalRules.length===0;return a.approvalRuleId&&(l=t.allApprovalRules.findIndex(r=>r.approvalRuleId===a.approvalRuleId)===0),{localData:t,hideUpperBoundField:n,isLowerBoundDisabled:l,approvalUpdateActionType:s}},function(e,a){const{navigate:t,approvalUpdateDataView:s,approverViewData:n,approvalRuleId:l}=a,r=s.remiSetupApproverViewUpdateData?.type,i=O(a.location);return{onApprovalRuleDataUpdated:o=>{const u=p=>{const v=[];return p.forEach(c=>{const D=c.actors.selectedUsers.map(d=>({type:"user",subType:void 0,userId:d.userId,idType:"user",isImplicitActor:!1})),I=c.actors.selectedNonUsers.map(d=>{const m=!!$(d.value);return{type:m?"attribute":"role",subType:d.value,userId:void 0,idType:void 0,isImplicitActor:!m}}),f=D.concat(I);v.push({action:c.stepType.selectedOption,actors:f,operator:f.length>1?c.stepType.selectedOption==="require_approval"?"or":"and":"is"})}),v};if(r==="approval_create"){const p={criteria:{rangeType:"range",rangeEntity:"currency",range:{min:{amount:o.lowerBound,currencyCode:"USD",currencySymbol:"$"},max:{amount:o.upperBound,currencyCode:"USD",currencySymbol:"$"}}},steps:u(o.steps),isApplicableOnPendingApprovalEntity:o.applyToExistingReimbursements.includes("applyToExistingReimbursements")};e(S(p))}else{const p={approvalRuleId:l,criteria:{rangeType:"range",rangeEntity:"currency",range:{min:{amount:o.lowerBound,currencyCode:"USD",currencySymbol:"$"},max:{amount:o.upperBound,currencyCode:"USD",currencySymbol:"$"}}},steps:u(o.steps),isApplicableOnPendingApprovalEntity:o.applyToExistingReimbursements.includes("applyToExistingReimbursements")};e(S(p))}},onResetClick:()=>{e(h()),r==="approval_update"||i?t("../"):n.allApprovalRules.length===0&&n.fetchState==="Completed"?t("../../setup"):t("../")},onBackClick:()=>{e(h()),r==="approval_update"||i?t("../"):n.allApprovalRules.length===0&&n.fetchState==="Completed"?t("../../setup"):t("../")},onSaveRuleClick:()=>{e(_())},onSaveRuleSuccess:()=>{t("../")}}})(F);function G(){const e=A(),a=w(),t=C(),{approvalRuleId:s}=T(),n=k.getSignedInUser(),l=V(),r=b(p=>R(p)),i=b(p=>E(p)),[o,u]=y.useState(!1);if(y.useEffect(()=>{o||(u(!0),a(x(!0)))}),y.useEffect(()=>{i.fetchState==="Not-Started"&&e(s!=null?"../../":"../")},[i,s]),n==null)throw Error("Can't access address page without signing in...");return r.approversDetailsFetchStatus.fetchState=="Not-Started"||r.approversDetailsFetchStatus.fetchState==="In-Progress"?g.jsx(j,{fetchState:r.approversDetailsFetchStatus.fetchState,style:{backgroundColor:l.colors.grey5}}):g.jsx(M,{navigate:e,approvalUpdateDataView:r,approvalRuleId:s,approverViewData:i,location:t})}export{G as R,$ as i};
@@ -1 +0,0 @@
1
- import{j as p}from"./liveblocks-iYXuwnNJ.js";import{u as G,j as Ie,h as ye,l as Ce,g as d,k as ge,n as Se,o as N}from"./core-BiO8az_8.js";import{eN as M,f7 as g,IF as we,jq as J,IG as W,pI as O,je as Re,ih as Te,t5 as X,pN as Fe,bv as Oe,IH as Ae,bn as ke,u4 as De,II as je,IJ as Ee,sZ as Pe,IK as Y,IL as Me,IM as Le,IN as Be,IO as ve,IP as S,IQ as A,IR as k,IS as H,IT as D,IU as j,dB as Ue,tM as Ve,tA as q,tB as $,tS as xe,tF as Z,tY as ze,IV as Ge,IW as Ne,IX as Ye,IY as He,IZ as qe,eT as $e,eR as Ze}from"./zeni-epic-state-sw_lecJS.js";import{K as Qe,M as Ke,r as Je,p as ee,m as E,z as ae,N as We,j as Xe,a as ea,C as aa,c as P,e as sa,y as se,Q as ta,R as oa,U as na}from"./index-DhM1NMcw.js";import"./mui-Wsw1v_RJ.js";import ra from"./NotFoundScreen-CoCyTXNP.js";import{F as ia}from"./FeaturePreviewScreen-Chy-C2bY.js";import{a as _}from"./sentry-C0ycLLNj.js";import{u as la,a as ca,b as da,c as pa}from"./useFetchSuggestedQuestionsWhenReady-BWXD0kZI.js";import{u as fa}from"./useInitialThreadRequest-COC1d6YZ.js";import{t as Q,a as K}from"./routePaths-DZQ5pfqe.js";import{M as ma}from"./MobileAppDrawer-DkH2rucX.js";import"./recharts-_jQKodaN.js";import"./analytics-CBVce51h.js";import"./plaid-YevEbNem.js";import"./dnd-DEqqrbnG.js";import"./stripe-DMRn4zHo.js";import"./lottie-crYXxJIl.js";import"./lexical-BcUhE2s3.js";import"./pdf-BB9eCt-A.js";import"./utils-84J_wB9-.js";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},o=new e.Error().stack;o&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[o]="9963dcf0-9354-47a7-850f-b28ee727fcea",e._sentryDebugIdIdentifier="sentry-dbid-9963dcf0-9354-47a7-850f-b28ee727fcea")}catch{}})();const ua=["profit_loss","balance_sheet","cash_flow"],I=e=>{e(j({resetLeftScroll:!0})),e(D({resetLeftScroll:!0})),e(k({resetLeftScroll:!0})),e(A({resetLeftScroll:!0}))},_a=e=>{e(Ne()),e(Ye()),e(He()),e(qe())},ha=ge(function(e){const o=ae.getSignedInUser(),f=e.tenantState.currentTenantId,u=M(e),a=u?.companyName??"",s={userId:o?.userId??"",sessionId:o?.zeniSessionId??"",tenantId:f??""},t=g(e),r=Ae(u);return{fetchState:t.fetchState,selectedTimeframe:t.filter.timeframe,selectedReport:t.selectedReportId,displayOrder:t.displayOrder,reportFormat:t.reportFormat,dataAvailable:t.dataAvailable,balancesInTimeframe:t.balancesInTimeframe,allTimeframeTicks:t.allTimeframeTicks,selectedCOABalancesRange:t.filter.balancesRange,isCompareMode:t.isCompareModeOn,profitAndLossReport:t.profitAndLossReport,profitAndLossClassesViewReport:t.profitAndLossByClassReport,profitAndLossProjectViewReport:t.profitAndLossByProjectReport,profitAndLossByClassHorizontalReport:t.profitAndLossByClassHorizontalReport,balanceSheetReport:t.balanceSheetReport,cashFlowReport:t.cashFlowReport,downloadState:t.downloadState,analytics:P,isZeniUser:ke(o),showAccountGroups:r===!0,isAccountingClassesEnabled:J(e),isAccountingProjectsEnabled:W(e),currentTenantCompanyName:a,statementEndPoint:`${na}/statement`,authParams:s,isZeniCOAUsed:r}},function(e,o){const{navigate:f,handleDrawerToggle:u}=o;return{onReloadReport:()=>{o.signedInUser!=null&&e(O(o.signedInUser.userId,!0,!1))},updateDownloadStateHandler:a=>{e(Ge(a))},onTimeframeSelectionChanged:(a,s,t)=>{if(e(ze(a)),s){const{isCompareModeOn:r,filter:c}=o,{additionalBalances:m,balancesRange:l}=c;let i=[...m];a==="year"&&(i=i.filter(y=>y!=="this_period_vs_same_period_last_year"&&y!=="this_period_vs_same_period_last_year_percent"&&y!=="same_period_last_year")),e(q(o.firstMonthOfFY,r,l.numberOfPeriods<1?1:l.numberOfPeriods,i)),m.length>0&&e($(o.firstMonthOfFY,i.includes("this_period_vs_last_period")?"compare_mode_amount":"compare_mode_percent",l.numberOfPeriods<1?1:l.numberOfPeriods,i))}t!==!0&&setTimeout(()=>I(e),50)},onReportSelectionChanged:a=>{const s=o.selectedReportID;if(a===s)return;const t=o.classViewLayout;e(S(a)),(a==="balance_sheet"||a==="cash_flow")&&s==="profit_and_loss_by_classes"&&t==="horizontal"&&e(Z({numberOfPeriods:1,orderBy:"ascending_date"})),a!=="profit_and_loss"&&a!=="profit_and_loss_by_classes"&&s==="profit_and_loss_by_classes"&&t==="horizontal"&&e(Y({classViewLayout:"vertical"})),I(e)},onCOABalancesRangeChanged:(a,s)=>{e(Z(a,s)),I(e)},onThisPeriodChanged:(a,s,t)=>{e(xe(o.firstMonthOfFY,a,s<1?1:s)),t!==!0&&I(e)},onAdditionalBalanceSelectionChanged:(a,s,t,r)=>{e(q(o.firstMonthOfFY,a,t<1?1:t,s)),s.length>0&&e($(o.firstMonthOfFY,s.includes("this_period_vs_last_period")?"compare_mode_amount":"compare_mode_percent",t<1?1:t,s)),r!==!0&&o.isCompareModeOn===a||setTimeout(()=>I(e),50)},onUpdateHighlightedNumberOfPeriods:(a,s,t,r)=>{e(Ve({firstMonthOfFY:o.firstMonthOfFY,isCompareModeOn:s,additionalBalances:a,maxNumOfPeriodsToHighlight:t<1?1:t,coaBalances:r}))},onAccountBalanceClick:o.hasTransactionAccess!==!0?void 0:(a,s,t)=>{let r,c;if(s.balanceTimeFrame==="month"||s.balanceTimeFrame==="quarter"?(r=s.balanceTimeFrame,c=Ue(s)):s.balanceTimeFrame==="year"?(r="quarter",c={startDate:s.endDate.startOf("quarter"),endDate:s.endDate}):console.error(`timeframe ${s.balanceTimeFrame} is not supported`),c!=null&&r!=null){const m=a.accountName===""?a.accountDescription:a.accountName,l=(()=>{if(o.selectedReportID==="profit_and_loss_by_classes"&&o.classViewLayout==="horizontal"&&a.accountType!=null){if(t?.isHorizontalClassTotalColumn===!0)return Q(o.tenantEmailDomain,a.accountId,a.accountType,m,r,c);if(t?.isHorizontalClassColumn===!0&&s.id!=null)return K(o.tenantEmailDomain,a.accountId,a.accountType,s.id,m,r,c)}return a.classesViewParentId!=null&&a.classesViewParentId.parentClassId!=null&&a.accountType!=null?K(o.tenantEmailDomain,a.accountId,a.accountType,a.classesViewParentId.parentClassId[0],m,r,c):a.accountType!=null?Q(o.tenantEmailDomain,a.accountId,a.accountType,m,r,c):void 0})();if(l!=null){const i=se(o.location.state?.pathnameStackToGoBack,o.location.pathname);f(l,{state:{pathnameStackToGoBack:i,referrer:w(o.selectedReportID)}})}}},onTableScroll:(a,s)=>{switch(a){case"profit_and_loss":e(j({scrollPosition:s}));break;case"profit_and_loss_by_classes":e(D({scrollPosition:s}));break;case"profit_and_loss_by_projects":e(H({scrollPosition:s}));break;case"balance_sheet":e(k({scrollPosition:s}));break;case"cash_flow":e(A({scrollPosition:s}));break;default:console.log(`Table Scroll state for ${a} is not handled`)}},onElementCollapseStateChanged:(a,s,t)=>{switch(a){case"profit_and_loss":e(j({nodeCollapseState:{nodeId:s,isCollapsed:t}}));break;case"profit_and_loss_by_classes":e(D({nodeCollapseState:{nodeId:s,isCollapsed:t}}));break;case"profit_and_loss_by_projects":e(H({nodeCollapseState:{nodeId:s,isCollapsed:t}}));break;case"balance_sheet":e(k({nodeCollapseState:{nodeId:s,isCollapsed:t}}));break;case"cash_flow":e(A({nodeCollapseState:{nodeId:s,isCollapsed:t}}));break;default:console.log(`Collapse state toggle for ${a} is not handled`)}},onBackClick:()=>{f("../../")},onUpdateAccountViewMode:a=>{e(Be({viewMode:a})),e(ve({viewMode:a})),a==="classes"?(o.analytics?.trackGroupBySwitch("Classes",w(o.selectedReportID)),e(S("profit_and_loss_by_classes"))):a==="project"?(o.analytics?.trackGroupBySwitch("Projects",w(o.selectedReportID)),e(S("profit_and_loss_by_projects"))):(o.analytics?.trackGroupBySwitch("Accounts",w(o.selectedReportID)),e(S("profit_and_loss"))),I(e)},onUpdateClassesToFilterOut:a=>{e(Le({classesToFilterOut:a}))},onUpdateProjectsToFilterOut:a=>{e(Me({projectsToFilterOut:a}))},onUpdateClassViewLayout:a=>{e(Y({classViewLayout:a}))},onOpenAccountViewMode:()=>{o.isAccountingClassesEnabled&&e(Pe()),o.isAccountingProjectsEnabled&&e(X())},onUpdateDisplayOrder:a=>{e(Ee(a))},onUpdateReportFormat:a=>{_a(e),e(je(a))},onClickMenuIcon:()=>{u(!0)},onResyncReports:()=>{e(De("profit_and_loss_by_classes"))}}})(ta);function ba(){const{isAiCfoOpen:e,setIsAiCfoOpen:o}=Ke(),f=Je(),u=oa(f),a=Ie(),s=ye(),t=G(),{tenantEmailDomain:r}=Ce(),{useFeatureGate:c}=ee(),{isFeatureEnabled:m}=c(E.isReportsHorizontalClassLayoutSwitchEnabled),l=ae.getSignedInUser(),[i,y]=_.useState(!1),[L,te]=_.useState(!1),{isFeatureEnabled:B}=c(E.isReportsCommentingEnabled);if(l==null)throw Error("Can't access reports page without signing in...");const v=d(n=>M(n)),oe=v.company?.companyInfo.firstMonthOfFY??1,ne=fa(B?v?.companyId:void 0),C=d(n=>g(n).fetchState),re=d(n=>we(n)),{areTenantIdsInSync:h}=We(),R=d(n=>n.financeStatementState.selectedReportId),U=d(n=>J(n)),T=d(n=>W(n)),ie=d(n=>g(n).isCompareModeOn),b=d(n=>g(n).filter),F=d(n=>g(n).selectedReportAndTimeframeFetchState),le=d(n=>n.profitAndLossClassesViewState.uiState.classViewLayout);_.useEffect(()=>{!i&&h&&(y(!0),s(O(l.userId,!0,!0,!1)))},[i,l,s,h]),_.useEffect(()=>{i&&!L&&C==="Completed"&&h&&(s(O(l.userId,!1,!0,!1)),te(!0))},[i,L,C,h]),_.useEffect(()=>{if(i&&F.fetchState==="Not-Started"&&b.timeframe!=="free_range"&&b.timeframe!=="week"&&h)switch(R){case"profit_and_loss":case"profit_and_loss_by_classes":s(Fe(b.timeframe));break;case"profit_and_loss_by_projects":T&&s(X());break;case"balance_sheet":s(Te(b.timeframe));break;case"cash_flow":s(Re(b.timeframe))}},[i,R,F,h,U,T]);const V=Xe(),ce=V?.loggedInUserRole!=null&&Oe(V?.loggedInUserRole)!==!0,[de,pe]=_.useState(!1),x=n=>{pe(n)},fe=ea(),me=da();return function(n){const{isDataReady:ue}=n,{pathname:_e}=G(),z=Qe(_e??"")==="reports",he=la(ue),be=_.useMemo(()=>z?ua:void 0,[z]);ca({canFetchSuggestedQuestions:he,pageContexts:be})}({isDataReady:C==="Completed"}),pa({isDataReady:C==="Completed"}),p.jsxs(p.Fragment,{children:[C==="Completed"?p.jsx(aa,{analytics:P,onLoad:n=>n.trackPageLoaded(sa.Event.reports)}):null,p.jsx(ma,{isAppContentDrawerOpen:de,handleDrawerToggle:x}),p.jsx(ha,{firstMonthOfFY:oe,tenantEmailDomain:r,location:t,navigate:a,windowSize:f,classViewLayout:le,selectedReportID:R,analytics:P,filter:b,isAccountingClassesEnabled:U,isAccountingProjectsEnabled:T,isCompareModeOn:ie,hasTransactionAccess:ce,signedInUser:l,selectedReportAndTimeframeFetchState:F,handleDrawerToggle:x,reportsResyncFetchState:re.reportsResyncFetchState,isAiCfoAccessEnabled:me&&fe&&!e,onAskAiCfoClick:()=>{if(u){const n=se(t.state?.pathnameStackToGoBack,t.pathname);a(`/${r}/ai-cfo/explore`,{state:{pathnameStackToGoBack:n,referrer:"Reports"}})}else o(!0)},isHorizontalClassReportSwitchEnabled:m,isReportsCommentingEnabled:B,initialOpenThreadRequest:ne})]})}const w=e=>{switch(e){case"profit_and_loss":return"Profit & Loss";case"balance_sheet":return"Balance Sheet";case"cash_flow":return"Cash Flow";default:return"Reports"}};function Va(){const e=d(s=>M(s)),{useFeatureGate:o}=ee(),{isFeatureEnabled:f}=o(E.isDebitCardFeatureEnabled),u=$e(f,e),a=Ze(e);return u===!0||a===!0?p.jsx(ia,{}):p.jsxs(Se,{children:[p.jsx(N,{path:"/",element:p.jsx(ba,{})}),p.jsx(N,{path:"*",element:p.jsx(ra,{})})]})}export{Va as default};
@@ -1 +0,0 @@
1
- import{j as a}from"./liveblocks-iYXuwnNJ.js";import{p as j,z as w,aJ as b,C as I,c as p,e as F,cD as P,m as L}from"./index-DhM1NMcw.js";import"./mui-Wsw1v_RJ.js";import l from"./NotFoundScreen-CoCyTXNP.js";import{a as f}from"./sentry-C0ycLLNj.js";import{h as T,g as y,j as V,u as A,k as R,n as U,o as u}from"./core-BiO8az_8.js";import{eN as z,Pg as C,M6 as Y,Ph as D,tr as G,eZ as J,Pi as M,tp as O}from"./zeni-epic-state-sw_lecJS.js";import{R as x}from"./ReferralListScreen-DOkwApTO.js";import"./recharts-_jQKodaN.js";import"./analytics-CBVce51h.js";import"./plaid-YevEbNem.js";import"./dnd-DEqqrbnG.js";import"./stripe-DMRn4zHo.js";import"./lottie-crYXxJIl.js";import"./lexical-BcUhE2s3.js";import"./pdf-BB9eCt-A.js";import"./utils-84J_wB9-.js";import"./useAskAiCfoHostNavButtonProps-DoU7lqQS.js";import"./useFetchSuggestedQuestionsWhenReady-BWXD0kZI.js";import"./MobileAppDrawer-DkH2rucX.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]="b36aef46-8b00-4295-a87d-6efb47f0dbaf",e._sentryDebugIdIdentifier="sentry-dbid-b36aef46-8b00-4295-a87d-6efb47f0dbaf")}catch{}})();const Z=R(function(e,t){const n=C(e);return{inviteFormView:n.localData,submitStatus:n.saveStatus,userName:t.userName,rewardsPlan:n.rewardsPlan,companyLegalName:t.companyName}},function(e,t){const{navigate:n}=t,o=w.getSignedInUser();return{onDismissClick:()=>{e(D()),n("..")},onSendClick:()=>{if(o!=null){const s=[],r=[];t.inviteFormCompayData.forEach(c=>{s.push(c.companyName),r.push(c.emailIds[0])}),p.trackInviteEmailClicked("send",s,r,s.length)}e(O())},onUpdateInviteFormLocalData:s=>{e(M({localData:s}))},onSubmitSuccess:()=>{n("../../")},onCancelClick:()=>{o!=null&&p.trackInviteEmailClicked("cancel")}}})(P),q=()=>{const e=T(),[t,n]=f.useState(!1),[o,s]=f.useState(!1),r=y(i=>z(i)),c=V(),k=A(),{useDynamicConfig:g}=j(),d=w.getSignedInUser();if(d==null)throw Error("Can't access invite referral screen without signing in...");const m=y(i=>C(i)),v=d?.firstName!=null?d.firstName:"User",{configValue:h}=g(b.zeniCardsConfig),{configValue:_}=g(b.zeniAccountsConfig),N=Y(_);f.useEffect(()=>{e(D()),r?.rewardsLastViewedTime==null&&o===!1&&(e(G()),s(!0))},[]),f.useEffect(()=>{t||m.fetchState!=="Not-Started"||(n(!0),e(J(!0)))},[m.fetchState,e]);const S=r.company?.companyInfo.companyLegalName??r.companyName;return a.jsxs(a.Fragment,{children:[m.fetchState==="Completed"?a.jsx(I,{analytics:p,onLoad:i=>(E=>E.trackPageLoaded(F.Event.inviteEmailViewed))(i)}):null,a.jsx(Z,{navigate:c,location:k,currentTenant:r,companyName:S,userName:v,inviteFormCompayData:m.localData,chargeCardCashbackRatePerTransaction:h.charge_card_cashback_rate_per_transaction!=null?h.charge_card_cashback_rate_per_transaction:.0175,maxAnnualPercentageYield:N.maxAnnualPercentageYield})]})};function de(){const{useFeatureGate:e}=j(),{isFeatureEnabled:t}=e(L.isReferralFeatureEnabled);return a.jsxs(U,{children:[a.jsx(u,{path:"/",element:t?a.jsx(x,{}):a.jsx(l,{})}),a.jsx(u,{path:"how-it-works",element:t?a.jsx(x,{isReferralDrawerOpen:!0}):a.jsx(l,{})}),a.jsx(u,{path:"refer/*",element:t?a.jsx(q,{}):a.jsx(l,{})}),a.jsx(u,{path:"*",element:a.jsx(l,{})})]})}export{de as default};
@@ -1,2 +0,0 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/DashboardRoutes-BaEBgxmc.js","assets/sentry-C0ycLLNj.js","assets/core-BiO8az_8.js","assets/zeni-epic-state-sw_lecJS.js","assets/index-DhM1NMcw.js","assets/mui-Wsw1v_RJ.js","assets/analytics-CBVce51h.js","assets/utils-84J_wB9-.js","assets/withTransactionSidePanel-BlWzkOQ0.js","assets/useAskAiCfoHostNavButtonProps-DoU7lqQS.js","assets/useFetchSuggestedQuestionsWhenReady-BWXD0kZI.js","assets/TransactionDetailScreen-B5S0aVL7.js","assets/decodeURIComponentSafe-Drs0EkRs.js","assets/routePaths-DZQ5pfqe.js","assets/NotFoundScreen-CoCyTXNP.js","assets/analyticsHelper-CchhXxa7.js","assets/CompanyPassportScreen-CxsYYjMZ.js","assets/MobileAppDrawer-DkH2rucX.js","assets/FeaturePreviewScreen-Chy-C2bY.js","assets/ReferralListScreen-DOkwApTO.js","assets/index-Bc34frN_.css","assets/BillPayRoutes-BtFNSiDK.js","assets/AddressScreen-CT6TP3Z1.js","assets/DomesticWireDetailScreen-C7eUBEYW.js","assets/useInitialThreadRequest-COC1d6YZ.js","assets/DrawerScreen-CFX9aNCU.js","assets/SetupPagesScreen-CvciPhAb.js","assets/BusinessVerificationPageScreen-BGdNNp1F.js","assets/BillPayApprovalRoutes-ss8zp9B4.js","assets/ReimbursementApprovalRuleDetailScreen-C096muhL.js","assets/getLocaleForTenant-DZ_PqUgv.js","assets/ReimbursementRoutes-JoYsNcyp.js","assets/ReimbursementApprovalRoutes-B7OZneq9.js","assets/TransactionListRoutes-CASYn9ig.js","assets/ZeniAccountStatementScreen-D6WwbD40.js","assets/SettingsRoutes-nEcXq9VR.js","assets/accountMappingHelper--Nd4AzD5.js","assets/QBOConnectionScreen-CyYMqomX.js","assets/empty-DIbsZE_-.js","assets/index-WTq_uesm.js","assets/url-lQlWCduk.js","assets/index-BALn8uen.js","assets/ReportsRoutes-DoEMUl54.js","assets/ChargeCardRoutes-y2uX_nrx.js","assets/PeopleRoutes-QnA9W9te.js","assets/ExpenseAutomationRoutes-zrWAZ6A-.js","assets/TreasuryRoutes-S6m6I4Ob.js","assets/VendorsRoutes-CcrRaFs8.js","assets/pathToGoBack-mF5zZGNy.js","assets/ZeniAccountRoutes-By17jtiK.js","assets/AddressRoutes-CSwoj3Tc.js","assets/PandLWithForecastRoutes-C6ob6CWy.js","assets/CustomerOnboardingRoutes-DyOkPrNA.js","assets/TransactionDetailRoutes-BSH_Iaci.js","assets/EntityDetailRoutes-BnUqJDu6.js","assets/NotificationRoutes-CFQ9T25M.js","assets/PerformanceRoutes-CscGDV-a.js","assets/RewardsRoutes-3vkMk0d3.js","assets/TaskRoutes-C8PZpDeD.js","assets/TaskListScreen-Babx6Iz5.js","assets/AiCfoScreen-BWS36jvF.js"])))=>i.map(i=>d[i]);
2
- import{_ as n,bn as os,eN as ls,eT as cs,eR as ds,eS as ms,fC as us,eP as _s,cO as Ae,cv as As,f8 as Es,cn as ps,bC as Is,bq as gs,fd as xs,v as Ts,Ij as hs,bv as js,Ik as Us,bE as Hs,fa as Rs,bD as Ds,bs,cj as fs,Il as ys,Im as Cs,cL as vs,cN as Os,cM as Ps,cu as Fs,cA as Ls,ml as Ee,eO as pe,fM as Bs,fh as Ie,fJ as ge,fK as xe,fi as ks}from"./zeni-epic-state-sw_lecJS.js";import{j as e}from"./liveblocks-iYXuwnNJ.js";import{a as v}from"./sentry-C0ycLLNj.js";import{h as Vs,j as Ss,l as Ns,u as Ms,g as z,i as Te,N as c,n as Zs,o as t}from"./core-BiO8az_8.js";import{h as ws,u as zs,z as R,p as Gs,a as $s,O as Ys,m as L,j as qs,L as B,D as he,t as _,P as Ws,c as X,l}from"./index-DhM1NMcw.js";import"./mui-Wsw1v_RJ.js";import{f as je}from"./analyticsHelper-CchhXxa7.js";import{t as Js}from"./getLocaleForTenant-DZ_PqUgv.js";import"./recharts-_jQKodaN.js";import"./analytics-CBVce51h.js";import"./plaid-YevEbNem.js";import"./dnd-DEqqrbnG.js";import"./stripe-DMRn4zHo.js";import"./lottie-crYXxJIl.js";import"./lexical-BcUhE2s3.js";import"./pdf-BB9eCt-A.js";import"./utils-84J_wB9-.js";(function(){try{var i=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},U=new i.Error().stack;U&&(i._sentryDebugIds=i._sentryDebugIds||{},i._sentryDebugIds[U]="c04f543e-1f90-4d94-95bf-ad1642f68357",i._sentryDebugIdIdentifier="sentry-dbid-c04f543e-1f90-4d94-95bf-ad1642f68357")}catch{}})();const Ks={dashboard:()=>n(()=>import("./DashboardRoutes-BaEBgxmc.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20])),bills:()=>n(()=>import("./BillPayRoutes-BtFNSiDK.js"),__vite__mapDeps([21,1,2,3,4,5,6,7,22,14,23,9,10,24,25,17,18,26,15,13,27,28,29,30,20])),reimbursement:()=>n(()=>import("./ReimbursementRoutes-JoYsNcyp.js"),__vite__mapDeps([31,1,2,3,4,5,6,7,14,26,17,15,13,27,18,9,10,24,25,32,29,30,20])),transactions:()=>n(()=>import("./TransactionListRoutes-CASYn9ig.js"),__vite__mapDeps([33,1,2,3,4,5,6,7,8,9,10,11,12,13,34,20])),settings:()=>n(()=>import("./SettingsRoutes-nEcXq9VR.js"),__vite__mapDeps([35,1,2,3,4,5,6,7,17,36,22,14,15,27,13,16,37,38,39,40,41,12,28,29,32,20])),reports:()=>n(()=>import("./ReportsRoutes-DoEMUl54.js"),__vite__mapDeps([42,1,2,3,4,5,6,7,14,18,10,24,13,17,20])),chargeCards:()=>n(()=>import("./ChargeCardRoutes-y2uX_nrx.js"),__vite__mapDeps([43,1,2,3,4,5,6,7,26,17,14,15,13,27,9,10,22,20])),people:()=>n(()=>import("./PeopleRoutes-QnA9W9te.js"),__vite__mapDeps([44,1,2,3,4,5,6,7,14,9,10,17,20])),expenseAutomation:()=>n(()=>import("./ExpenseAutomationRoutes-zrWAZ6A-.js"),__vite__mapDeps([45,1,2,3,14,4,5,6,7,9,10,11,12,13,8,36,25,20])),treasury:()=>n(()=>import("./TreasuryRoutes-S6m6I4Ob.js"),__vite__mapDeps([46,1,2,3,4,5,6,7,14,26,17,15,13,27,9,10,18,20])),vendors:()=>n(()=>import("./VendorsRoutes-CcrRaFs8.js"),__vite__mapDeps([47,1,2,3,4,5,6,7,22,14,18,13,48,9,10,17,25,36,20])),zeniAccounts:()=>n(()=>import("./ZeniAccountRoutes-By17jtiK.js"),__vite__mapDeps([49,1,2,3,4,5,6,7,14,26,17,15,13,27,18,23,22,9,10,34,20]))},Qs=["bills","transactions","settings","reimbursement","reports","chargeCards","people"],ee=i=>{"requestIdleCallback"in window?requestIdleCallback(i):setTimeout(i,100)},Xs=l(()=>n(()=>import("./ReportsRoutes-DoEMUl54.js"),__vite__mapDeps([42,1,2,3,4,5,6,7,14,18,10,24,13,17,20]))),en=l(()=>n(()=>import("./AddressRoutes-CSwoj3Tc.js"),__vite__mapDeps([50,1,2,3,22,4,5,6,7,14,20]))),sn=l(()=>n(()=>import("./PeopleRoutes-QnA9W9te.js"),__vite__mapDeps([44,1,2,3,4,5,6,7,14,9,10,17,20]))),nn=l(()=>n(()=>import("./PandLWithForecastRoutes-C6ob6CWy.js"),__vite__mapDeps([51,1,2,3,4,5,6,7,14,18,9,10,24,13,17,20]))),an=l(()=>n(()=>import("./CustomerOnboardingRoutes-DyOkPrNA.js"),__vite__mapDeps([52,1,2,3,22,4,5,6,7,14,37,38,39,40,41,12,20]))),tn=l(()=>n(()=>import("./VendorsRoutes-CcrRaFs8.js"),__vite__mapDeps([47,1,2,3,4,5,6,7,22,14,18,13,48,9,10,17,25,36,20]))),rn=l(()=>n(()=>import("./TransactionDetailRoutes-BSH_Iaci.js"),__vite__mapDeps([53,1,2,3,14,4,5,6,7,11,9,10,12,13,20]))),Ue=l(()=>n(()=>import("./EntityDetailRoutes-BnUqJDu6.js"),__vite__mapDeps([54,1,2,3,4,5,6,7,12,8,9,10,11,13,20]))),on=l(()=>n(()=>import("./DashboardRoutes-BaEBgxmc.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20]))),He=l(()=>n(()=>import("./BillPayRoutes-BtFNSiDK.js"),__vite__mapDeps([21,1,2,3,4,5,6,7,22,14,23,9,10,24,25,17,18,26,15,13,27,28,29,30,20]))),ln=l(()=>n(()=>import("./SettingsRoutes-nEcXq9VR.js"),__vite__mapDeps([35,1,2,3,4,5,6,7,17,36,22,14,15,27,13,16,37,38,39,40,41,12,28,29,32,20]))),Re=l(()=>n(()=>import("./ReimbursementRoutes-JoYsNcyp.js"),__vite__mapDeps([31,1,2,3,4,5,6,7,14,26,17,15,13,27,18,9,10,24,25,32,29,30,20]))),cn=l(()=>n(()=>import("./ZeniAccountRoutes-By17jtiK.js"),__vite__mapDeps([49,1,2,3,4,5,6,7,14,26,17,15,13,27,18,23,22,9,10,34,20]))),dn=l(()=>n(()=>import("./TreasuryRoutes-S6m6I4Ob.js"),__vite__mapDeps([46,1,2,3,4,5,6,7,14,26,17,15,13,27,9,10,18,20]))),mn=l(()=>n(()=>import("./TransactionListRoutes-CASYn9ig.js"),__vite__mapDeps([33,1,2,3,4,5,6,7,8,9,10,11,12,13,34,20]))),un=l(()=>n(()=>import("./ChargeCardRoutes-y2uX_nrx.js"),__vite__mapDeps([43,1,2,3,4,5,6,7,26,17,14,15,13,27,9,10,22,20]))),_n=l(()=>n(()=>import("./NotificationRoutes-CFQ9T25M.js"),__vite__mapDeps([55,1,2,3,14,4,5,6,7,9,10,20]))),An=l(()=>n(()=>import("./PerformanceRoutes-CscGDV-a.js"),__vite__mapDeps([56,1,2,3,14,4,5,6,7,9,10,17,20]))),En=l(()=>n(()=>import("./ExpenseAutomationRoutes-zrWAZ6A-.js"),__vite__mapDeps([45,1,2,3,14,4,5,6,7,9,10,11,12,13,8,36,25,20]))),pn=l(()=>n(()=>import("./RewardsRoutes-3vkMk0d3.js"),__vite__mapDeps([57,1,2,3,4,5,6,7,14,19,9,10,17,20]))),In=l(()=>n(()=>import("./TaskRoutes-C8PZpDeD.js"),__vite__mapDeps([58,1,2,3,14,4,5,6,7,24,17,59,9,10,20]))),gn=l(()=>n(()=>import("./AiCfoScreen-BWS36jvF.js"),__vite__mapDeps([60,1,2,3,4,5,6,7,48,20]))),f=l(()=>n(()=>import("./NotFoundScreen-CoCyTXNP.js"),__vite__mapDeps([14,1,2,3,4,5,6,7,20]))),xn=l(()=>n(()=>import("./TaskListScreen-Babx6Iz5.js"),__vite__mapDeps([59,1,2,3,4,5,6,7,9,10,17,20])));function wn({setTenantEmailDomain:i}){const U=Vs(),V=Ss(),{tenantEmailDomain:o}=Ns(),S=ws().mode,{setLoading:y,clearAllLoading:O,clearLoading:Z}=zs(),b=R.getSignedInUserTenant(o)?.tenantId,h=R.getSignedInUser(),J=os(h),G=Ms(),[N,be]=v.useState(!1),r=z(a=>ls(a)),{useFeatureGate:P}=Gs(),K=$s(),fe=Ys(),{isFeatureEnabled:ye}=P(L.isExpenseAutomationEnabled),{isFeatureEnabled:Ce}=P(L.isExpenseAutomationEnabledV2),ve=Ce||ye&&J,{isFeatureEnabled:Oe}=P(L.isDepositAccountsFeatureEnabled),{isFeatureEnabled:Pe}=P(L.isTreasuryEnabled),{isFeatureEnabled:Fe}=P(L.isChargeCardFeatureEnabled),{isFeatureEnabled:se}=P(L.isDebitCardFeatureEnabled),j=z(a=>a.tenantState.fetchState),E=z(a=>a.tenantState.activeTenantFetchState.fetchState),u=E==="Completed"||j==="Completed"?cs(se,r):void 0,$=E==="Completed"||j==="Completed"?ds(r):void 0,Le=E==="Completed"||j==="Completed"?ms(r):void 0,Be=Fe||se||!!Le||!!$||!!u,{isFeatureEnabled:ke}=P(L.isSettingsFeatureEnabled),{isFeatureEnabled:Ve}=P(L.isAiCfoFileUploadEnabled),Y=z(a=>us(a));if(o!=null){const a=R.getSignedInUserTenant(o);h!=null&&a!=null&&je(h,r,S)}const w={tenantId:b,userId:h?.userId,sessionId:h?.zeniSessionId},ne=_s(),A=qs(),Se=r.company==null||A?.loggedInUserRoleMap!=null&&Ae(A.loggedInUserRole),Ne=As(A?.loggedInUserRoleMap),ae=v.useRef(!0),te=Te("/:tenantEmailDomain/onboarding/*")!==null,Q=Te("/:tenantEmailDomain/month_end_close_checks/review/:selectedTab/:selectedPeriod/*"),Me=z(a=>w.tenantId!=null?Es(a,w.tenantId):void 0);v.useEffect(()=>{y(B.TENANT_FETCHING),i(o)},[o]),v.useEffect(()=>{if(Q!=null&&b!=null){const a=Q.params.selectedPeriod;if(a!=null){const H=a.split("-");if(H.length===2){const d=ps(Number(H[0])),s=Number(H[1]),m=Is(`01-${d<10?`0${d}`:d}-${s}`,he.getLocalizedStrings().dateFormat.analytics.DDDashMMDashYYYY),M=gs();m.isAfter(M,"month")===!1?U(xs(b,{month:d,year:s})):V("./month_end_close_checks/review")}}}},[Q,b]),v.useEffect(()=>{N||(be(!0),y(B.TENANT_FETCHING)),ae.current?ae.current=!1:!Ts(ne,w)&&R.isSignedIn()&&(y(B.TENANT_FETCHING),function(a,H,d,s){if(pe(H?.userId,H?.zeniSessionId,a.tenantId),d(Bs(!0)),d(Ie(a.tenantId)),a.tenantId!=null&&_.clearTenant(a.tenantId),a.tenantId!=null){const m=R.getSignedInUserTenantWithId(a.tenantId);s&&he.updateAppLocaleID(Js(s)),m?.tenantEmailDomain!=null&&R.saveActiveTenantDomainForUser(m?.tenantEmailDomain)}a.userId!=null?X.identify(a.userId,{tenant_id:a.tenantId}):X.resetUserIdentity()}(w,h,U,Me))},[w,ne,h,U,R]),v.useEffect(()=>{R.isSignedIn()&&(y(B.TENANT_FETCHING),function(a,H,d,s,m,M,k){if(d==null&&s==null)return void console.warn("There is no current tenant selected!!");const q=s!=null&&m?.zeniSessionId!=null,ts=d==null||d.tenantId!==s,is=d!=null&&d.excludedResources==null,rs=d!=null&&d.externalConnections==null;if(q&&ts){k(Ie(s));const W=R.getSignedInUserTenantWithId(s);W?.tenantEmailDomain!=null&&R.saveActiveTenantDomainForUser(W?.tenantEmailDomain),pe(m?.userId,m?.zeniSessionId,s),_.shouldFetchExcludedResources(s)&&(_.markExcludedResourcesFetchStarted(s),k(ge(m.userId,s))),_.shouldFetchConnections(s)&&(_.markConnectionsFetchStarted(s),k(xe(m.userId,s)))}else q&&is&&_.shouldFetchExcludedResources(s)&&(_.markExcludedResourcesFetchStarted(s),k(ge(m.userId,s))),q&&rs&&_.shouldFetchConnections(s)&&(_.markConnectionsFetchStarted(s),k(xe(m.userId,s)));if(q){X.identify(m.userId,{tenant_id:s});const W=s==null||s!=null&&(H==="Completed"||H==="Error");a==="Completed"||H!=="Not-Started"&&H!=="Error"||s==null||!_.shouldFetchActiveTenant(s)||(_.markActiveTenantFetchStarted(s),M(B.TENANT_FETCHING),k(ks(m.userId,s,m.zeniSessionId))),W&&(a==="Not-Started"||a==="Error")&&_.shouldFetchAllTenants()&&(_.markAllTenantsFetchStarted(),k(Ee(m.userId,m.zeniSessionId)))}}(j,E,r,b,h,y,U))},[b,E]),v.useEffect(()=>{R.isSignedIn()&&j==="Completed"&&Y.tenantsBaseInOrder.length>0&&(Z(B.TENANT_FETCHING),R.saveSignedInUserTenants(hs(Y.tenantsBaseInOrder)),h!=null&&je(h,r,S,void 0,Y.tenantsBaseInOrder))},[Y,j,r,h]),v.useEffect(()=>{E==="In-Progress"&&y(B.TENANT_FETCHING),E!=="Completed"&&E!=="Error"||(E==="Completed"&&b!=null?(O(),_.markActiveTenantFetchCompleted(b)):E==="Error"&&b!=null&&(_.markActiveTenantFetchFailed(b),Z(B.TENANT_FETCHING),Z(B.TENANT_SWITCHING))),j!=="Completed"&&j!=="Error"||(j==="Completed"?_.markAllTenantsFetchCompleted():j==="Error"&&_.markAllTenantsFetchFailed())},[E,j,b,N]);const ie=v.useRef(!1);v.useEffect(()=>{!ie.current&&E==="Completed"&&N&&(ie.current=!0,function(a=Qs,H=3e3){setTimeout(()=>{const d=s=>{if(s>=a.length)return;const m=a[s],M=Ks[m];M!=null?M().then(()=>ee(()=>d(s+1))).catch(()=>ee(()=>d(s+1))):d(s+1)};ee(()=>d(0))},H)}())},[E,N]);const C=r?.userRole!=null&&js(r?.userRole),{isFeatureEnabled:Ze}=P(L.isReferralFeatureEnabled),we=r?.userRole!=null&&r.userRole.includes("charge_card_user"),ze=r?.userRole!=null&&r.userRole.includes("charge_card_admin"),F=r?.userRole!=null&&Ae(r.userRole),re=r?.company==null||r.company.featuresActivationInfo?.isBillPayFeatureEnabled&&!C,oe=Be&&!C,Ge=Us(A?.loggedInUserRoleMap),$e=r.externalConnections?.accounting[0]?.isValid,le=r.company?.companyOnboardingInfo.isOnboardingCompleted,ce=r?.company==null||r.company.featuresActivationInfo?.isReimbursementFeatureEnabled&&!C,de=ce&&Hs(A?.loggedInUserRoleMap),me=Oe&&!C,Ye=r.company!=null&&Rs(r.company),qe=Pe&&Ye===!0&&!C,We=re&&Ds(A?.loggedInUserRoleMap),Je=oe&&bs(A?.loggedInUserRoleMap),Ke=me&&fs(A?.loggedInUserRoleMap),Qe=ys(A?.loggedInUserRoleMap),Xe=Cs(A?.loggedInUserRoleMap),p=vs(A?.loggedInUserRoleMap),I=Os(A?.loggedInUserRoleMap),g=Ps(A?.loggedInUserRoleMap),x=Fs(A?.loggedInUserRoleMap),T=Ls(A?.loggedInUserRoleMap),ue=re&&x,_e=ce&&T,es=me&&p,ss=qe&&I,ns=oe&&g,as=r.excludedResources?.resources?.find(a=>a.resource==="/invites")!=null||Ne===!0||Ge===!0||Qe===!0||Xe===!0;return R.isSignedIn()?b==null?j==="Completed"?e.jsx(c,{to:"/",replace:!0,state:{...G.state,message:"...",origin:G.pathname}}):(h!=null&&j!=="In-Progress"&&U(Ee(h.userId,h.zeniSessionId)),null):E!=="In-Progress"&&E!=="Not-Started"||j==="Completed"?(le===!0||J&&!te)&&$e===!1&&u===!1&&$===!1?(i(void 0),e.jsx(c,{to:"/connection/auth",replace:!0})):!N||le!==!1||te||J?N&&r?.userRole&&u!=null&&$!=null&&o!=null&&Object.keys(A.loggedInUserRoleMap).length>0?e.jsx(Zs,{children:e.jsxs(t,{element:e.jsx(Ws,{}),children:[e.jsx(t,{path:"/",element:e.jsx(Tn,{isDashboardAccess:F,isUserHasZeniAccountsAccess:p,isUserHasChargeCardAccess:g,isUserHasBillPayAccess:x,isUserHasReimbursementAccess:T,isUserHasTreasuryAccess:I,isTenantBankingOnly:u,isTenantCardsOnly:$})}),e.jsx(t,{path:"dashboard/*",element:F?e.jsx(on,{}):e.jsx(D,{isUserHasZeniAccountsAccess:p,isUserHasChargeCardAccess:g,isUserHasBillPayAccess:x,isUserHasReimbursementAccess:T,isUserHasTreasuryAccess:I,isTenantBankingOnly:u,tenantEmailDomain:o})}),e.jsx(t,{path:"reports/*",element:F?e.jsx(Xs,{}):e.jsx(D,{isUserHasZeniAccountsAccess:p,isUserHasChargeCardAccess:g,isUserHasBillPayAccess:x,isUserHasReimbursementAccess:T,isUserHasTreasuryAccess:I,isTenantBankingOnly:u,tenantEmailDomain:o})}),e.jsx(t,{path:"people/*",element:as||F?e.jsx(sn,{}):e.jsx(D,{isUserHasZeniAccountsAccess:p,isUserHasChargeCardAccess:g,isUserHasBillPayAccess:x,isUserHasReimbursementAccess:T,isUserHasTreasuryAccess:I,isTenantBankingOnly:u,tenantEmailDomain:o})}),e.jsx(t,{path:"forecast/*",element:F?e.jsx(nn,{}):e.jsx(D,{isUserHasZeniAccountsAccess:p,isUserHasChargeCardAccess:g,isUserHasBillPayAccess:x,isUserHasReimbursementAccess:T,isUserHasTreasuryAccess:I,isTenantBankingOnly:u,tenantEmailDomain:o})}),e.jsx(t,{path:"onboarding/*",element:e.jsx(an,{})}),e.jsx(t,{path:"transaction/*",element:F&&C===!1||we||ze?e.jsx(rn,{}):e.jsx(D,{isUserHasZeniAccountsAccess:p,isUserHasChargeCardAccess:g,isUserHasBillPayAccess:x,isUserHasReimbursementAccess:T,isUserHasTreasuryAccess:I,isTenantBankingOnly:u,tenantEmailDomain:o})}),e.jsx(t,{path:"transactions/*",element:F&&C===!1?e.jsx(mn,{}):e.jsx(D,{isUserHasZeniAccountsAccess:p,isUserHasChargeCardAccess:g,isUserHasBillPayAccess:x,isUserHasReimbursementAccess:T,isUserHasTreasuryAccess:I,isTenantBankingOnly:u,tenantEmailDomain:o})}),e.jsx(t,{path:"customer/*",element:F&&C===!1?e.jsx(Ue,{entityType:"customer"}):e.jsx(D,{isUserHasZeniAccountsAccess:p,isUserHasChargeCardAccess:g,isUserHasBillPayAccess:x,isUserHasReimbursementAccess:T,isTenantBankingOnly:u,isUserHasTreasuryAccess:I,tenantEmailDomain:o})}),e.jsx(t,{path:"vendor/*",element:F&&C===!1?e.jsx(Ue,{entityType:"vendor"}):e.jsx(D,{isUserHasZeniAccountsAccess:p,isUserHasChargeCardAccess:g,isUserHasBillPayAccess:x,isUserHasReimbursementAccess:T,isUserHasTreasuryAccess:I,isTenantBankingOnly:u,tenantEmailDomain:o})}),e.jsx(t,{path:"tasks",element:e.jsx(xn,{})}),e.jsx(t,{path:"tasks/*",element:e.jsx(In,{})}),e.jsx(t,{path:"address/*",element:We||de||Ke||Je?e.jsx(en,{}):e.jsx(D,{isUserHasZeniAccountsAccess:p,isUserHasChargeCardAccess:g,isUserHasBillPayAccess:x,isUserHasReimbursementAccess:T,isUserHasTreasuryAccess:I,isTenantBankingOnly:u,tenantEmailDomain:o})}),e.jsx(t,{path:"checking/*",element:es?e.jsx(cn,{}):e.jsx(f,{})}),e.jsx(t,{path:"treasury/*",element:ss?e.jsx(dn,{}):e.jsx(f,{})}),e.jsx(t,{path:"performance",element:fe?e.jsx(An,{}):e.jsx(De,{tenantEmailDomain:o})}),e.jsx(t,{path:"month_end_close_checks/review/*",element:ve&&C===!1?e.jsx(En,{}):e.jsx(De,{tenantEmailDomain:o})}),e.jsx(t,{path:"notifications/*",element:e.jsx(_n,{})}),e.jsx(t,{path:"vendors/*",element:Se?e.jsx(tn,{}):e.jsx(f,{})}),e.jsx(t,{path:"bill/*",element:ue?e.jsx(He,{}):e.jsx(D,{isUserHasZeniAccountsAccess:p,isUserHasChargeCardAccess:g,isUserHasBillPayAccess:x,isUserHasReimbursementAccess:T,isUserHasTreasuryAccess:I,isTenantBankingOnly:u,tenantEmailDomain:o})}),e.jsx(t,{path:"bills/*",element:ue?e.jsx(He,{}):e.jsx(D,{isUserHasZeniAccountsAccess:p,isUserHasChargeCardAccess:g,isUserHasBillPayAccess:x,isUserHasReimbursementAccess:T,isUserHasTreasuryAccess:I,isTenantBankingOnly:u,tenantEmailDomain:o})}),e.jsx(t,{path:"reimbursement/*",element:_e?e.jsx(Re,{}):e.jsx(D,{isUserHasZeniAccountsAccess:p,isUserHasChargeCardAccess:g,isUserHasBillPayAccess:x,isUserHasReimbursementAccess:T,isUserHasTreasuryAccess:I,isTenantBankingOnly:u,tenantEmailDomain:o})}),e.jsx(t,{path:"reimbursements/*",element:_e?e.jsx(Re,{}):e.jsx(D,{isUserHasZeniAccountsAccess:p,isUserHasChargeCardAccess:g,isUserHasBillPayAccess:x,isUserHasReimbursementAccess:T,isUserHasTreasuryAccess:I,isTenantBankingOnly:u,tenantEmailDomain:o})}),e.jsx(t,{path:"settings/*",element:ke?e.jsx(ln,{hasAdminLevelAccess:de}):e.jsx(f,{})}),e.jsx(t,{path:"cards/*",element:ns?e.jsx(un,{}):e.jsx(f,{})}),e.jsx(t,{path:"rewards/*",element:Ze?e.jsx(pn,{}):e.jsx(f,{})}),e.jsx(t,{path:"/ai-cfo",element:K?e.jsx(c,{to:"explore"}):e.jsx(f,{})}),e.jsx(t,{path:"/ai-cfo/",element:K?e.jsx(c,{to:"explore"}):e.jsx(f,{})}),e.jsx(t,{path:"/ai-cfo/:session_id",element:K?e.jsx(gn,{isFileUploadEnabled:Ve}):e.jsx(f,{})}),e.jsx(t,{path:"*",element:e.jsx(f,{})})]})}):null:(i(void 0),e.jsx(c,{to:"onboarding",replace:!0})):null:(console.warn("User logged out!!"),i(void 0),e.jsx(c,{to:"/signin/auth",replace:!0,state:{...G.state,message:"...",origin:G.pathname}}))}const Tn=({isDashboardAccess:i,isUserHasZeniAccountsAccess:U,isUserHasChargeCardAccess:V,isUserHasBillPayAccess:o,isUserHasReimbursementAccess:S,isUserHasTreasuryAccess:y,isTenantBankingOnly:O,isTenantCardsOnly:Z})=>O===!0&&U?e.jsx(c,{to:"checking"}):Z===!0?e.jsx(c,{to:"cards"}):i?e.jsx(c,{to:"dashboard"}):U?e.jsx(c,{to:"checking"}):y?e.jsx(c,{to:"treasury"}):V?e.jsx(c,{to:"cards"}):o?e.jsx(c,{to:"bills"}):S?e.jsx(c,{to:"reimbursements"}):e.jsx(c,{to:"dashboard"}),D=({isUserHasZeniAccountsAccess:i,isUserHasChargeCardAccess:U,isUserHasBillPayAccess:V,isUserHasReimbursementAccess:o,isUserHasTreasuryAccess:S,isTenantBankingOnly:y,tenantEmailDomain:O})=>y===!0||i?e.jsx(Hn,{tenantEmailDomain:O}):S?e.jsx(Un,{tenantEmailDomain:O}):U?e.jsx(Rn,{tenantEmailDomain:O}):V?e.jsx(jn,{tenantEmailDomain:O}):o?e.jsx(hn,{tenantEmailDomain:O}):e.jsx(f,{}),hn=({tenantEmailDomain:i})=>e.jsx(c,{to:`/${i}/reimbursements`}),jn=({tenantEmailDomain:i})=>e.jsx(c,{to:`/${i}/bills`}),Un=({tenantEmailDomain:i})=>e.jsx(c,{to:`/${i}/treasury`}),Hn=({tenantEmailDomain:i})=>e.jsx(c,{to:`/${i}/checking`}),Rn=({tenantEmailDomain:i})=>e.jsx(c,{to:`/${i}/cards`}),De=({tenantEmailDomain:i})=>e.jsx(c,{to:`/${i}/dashboard`});export{D as FallBackRoute,wn as default};
@@ -1 +0,0 @@
1
- import{j as f}from"./liveblocks-iYXuwnNJ.js";import{a as u,b as T,q as A}from"./sentry-C0ycLLNj.js";import{h as D,j as z,g as c,u as j,N as M,k as O}from"./core-BiO8az_8.js";import{u as F,z as s,h as P,c as E,D as N,d as _,e as q,f as B,g as V,q as $,i as v}from"./index-DhM1NMcw.js";import{eN as G,Ii as J,Ij as R,eO as W,fh as H,Io as K,fG as Q,cS as X,Ip as b,Iq as Y,Ir as Z,bR as y}from"./zeni-epic-state-sw_lecJS.js";import"./mui-Wsw1v_RJ.js";import{u as ee}from"./useDeviceId-CNwwT5y9.js";import{f as te}from"./analyticsHelper-CchhXxa7.js";import{t as ne}from"./getLocaleForTenant-DZ_PqUgv.js";import"./recharts-_jQKodaN.js";import"./analytics-CBVce51h.js";import"./plaid-YevEbNem.js";import"./dnd-DEqqrbnG.js";import"./stripe-DMRn4zHo.js";import"./lottie-crYXxJIl.js";import"./lexical-BcUhE2s3.js";import"./pdf-BB9eCt-A.js";import"./utils-84J_wB9-.js";(function(){try{var t=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},i=new t.Error().stack;i&&(t._sentryDebugIds=t._sentryDebugIds||{},t._sentryDebugIds[i]="abf853f6-dac6-4303-8787-f0785e8c4317",t._sentryDebugIdIdentifier="sentry-dbid-abf853f6-dac6-4303-8787-f0785e8c4317")}catch{}})();const ie=O(function(t,i){const d=t.tenantState.fetchState,g=t.tenantState.sendEmailMagicLinkFetchState,{magicLinkExpired:n,magicLinkAlreadyUsed:a,magicLinkExpiredEmail:l}=i;return{googleClientId:v.googleClientId,microsoftClientId:v.microsoftClientId,signInError:t.tenantState.error?.error,fetchState:d,sendMagicLinkStatus:g,magicLinkExpired:n,magicLinkAlreadyUsed:a,magicLinkExpiredEmail:l}},function(t,i){const{location:d,navigate:g}=i;return console.warn(JSON.stringify(window.location)),{onOAuthError:(n,a)=>{A({message:`OAuth error from provider ${a} with error ${n}`,level:"error",tags:{authProvider:a,errorType:"zeni.login.error"},extra:{error:n,windowLocation:window.location.href}})},onOAuthSuccess:(n,a)=>{const l=a==="google"?window.location.origin:window.location.origin+window.location.pathname;t(Z({authCode:n,oauthProvider:a,appType:"web",redirectUri:y(l),sourceUri:y(d.state!=null?d.state.origin:"")}))},getSignedInUser:()=>s.getSignedInUser(),onSignedInCallback:()=>{const n=d.state?.origin;n&&n!=="/"?g(n,{replace:!0}):window.open(window.location.origin,"_self")},sendMagicLink:n=>{const{deviceId:a}=i;a!=null&&(s.saveMagicLinkEmail(n),t(Y(n,a)))},clearSignInError:()=>{t(b())}}})($),ae=T.memo(ie);function ve({setTenantEmailDomain:t}){const i=D(),d=z(),{clearAllLoading:g}=F(),n=s.getSignedInUser();u.useLayoutEffect(()=>{g()},[g]);const a=ee(),l=c(e=>e.tenantState.magicLinkCodeVerifier),{sendEmailMagicLinkFetchState:h,accountLocked:C,accountUnlockTime:k}=c(e=>e.tenantState),p=c(e=>e.tenantState.fetchState),L=c(e=>e.tenantState.activeTenantFetchState.fetchState),I=c(e=>e.tenantState.signInState),o=c(e=>e.tenantState.loggedInUser),r=c(e=>G(e)),S=c(e=>J(e)),m=j(),w=P().mode,U=m.state?.magicLinkExpired,x=m.state?.magicLinkAlreadyUsed;if(u.useEffect(()=>{h.fetchState==="Completed"&&l!=null&&(E.trackSignInLinkSent(),s.saveMagicLinkCodeVerifier(l))},[h.fetchState,l]),u.useEffect(()=>{t(void 0)},[]),u.useEffect(()=>{I!=="In-Progress"||p!=="Completed"&&L!=="Completed"||o?.zeniSessionId==null||r==null||(s.savePayNowInfoTooltip(!0,o.zeniSessionId),s.saveSignedInUserWithSession(o,o.zeniSessionId),s.saveSignedInUserTenants(R(S.tenantsInOrder),o.zeniSessionId),W(o.userId,o.zeniSessionId,r.tenantId),i(H(r.tenantId)),s.saveActiveTenantDomainForUser(r.tenantEmailDomain),i(K("Completed")),N.updateAppLocaleID(ne(r)),te(o,r,w,void 0,S.tenantsInOrder),Q().then(()=>{const e=V();e!=null&&_(e)}),setTimeout(()=>{E.trackLogin(q.Event.loginSuccess,o.authProvider??"google",X(r.productSettings))},2e3))},[I,p,L,o,r,S,w,m.state,i]),I==="In-Progress"&&p==="Completed"&&o?.zeniSessionId!=null&&r!=null||n!=null){const e=m.state?.origin??"/";return f.jsx(M,{to:e,state:{...m.state,origin:""}})}return f.jsxs(f.Fragment,{children:[f.jsx(ae,{magicLinkExpired:!!U,magicLinkAlreadyUsed:!!x,magicLinkExpiredEmail:s.getMagicLinkEmail()??void 0,location:m,navigate:d,deviceId:a??void 0,showEmailLogin:!0}),C===!0&&k!=null?f.jsx(B,{onClose:()=>i(b()),unlockDate:k}):null]})}export{ve as default};
@@ -1,9 +0,0 @@
1
- import{j as s}from"./liveblocks-iYXuwnNJ.js";import{a}from"./sentry-C0ycLLNj.js";import{h as u,u as m,j as p,N as g}from"./core-BiO8az_8.js";import{z as f,B as y,t as h,c,e as b}from"./index-DhM1NMcw.js";import{fL as I,fM as x,IE as j}from"./zeni-epic-state-sw_lecJS.js";import{n as w}from"./mui-Wsw1v_RJ.js";import"./recharts-_jQKodaN.js";import"./analytics-CBVce51h.js";import"./plaid-YevEbNem.js";import"./dnd-DEqqrbnG.js";import"./stripe-DMRn4zHo.js";import"./lottie-crYXxJIl.js";import"./lexical-BcUhE2s3.js";import"./pdf-BB9eCt-A.js";import"./utils-84J_wB9-.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]="38c009b5-9ee0-4300-8561-865e5a3f8303",e._sentryDebugIdIdentifier="sentry-dbid-38c009b5-9ee0-4300-8561-865e5a3f8303")}catch{}})();function $(){const e=u(),t=m(),i=p(),n=a.useRef(!1),l=f.isSignedIn(),r=t.state?.message==="logout",o=r||l;return a.useEffect(()=>{o&&!n.current&&(n.current=!0,setTimeout(()=>{try{f.clearAll(),e(I()),e(x(!1)),j(),h.reset(),c.trackLogout(b.Event.logoutSuccess),c.resetUserIdentity()}catch(d){console.error("Error during sign out:",d)}finally{r||i("/signin/auth",{replace:!0})}},0))},[o,r]),o?s.jsx(E,{children:s.jsx(y,{fetchState:"In-Progress"})}):s.jsx(g,{to:"../",replace:!0})}const E=w.div`
2
- display: flex;
3
- height: 100vh;
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
- `;export{$ as default};
@@ -1,9 +0,0 @@
1
- import{j as p}from"./liveblocks-iYXuwnNJ.js";import{a as T}from"./sentry-C0ycLLNj.js";import{j as x,h as A,u as j,g as G,l as N,k as R}from"./core-BiO8az_8.js";import{z as $,p as v,m as K,C as U,c as _,e as z,cF as M,y as f,w as O}from"./index-DhM1NMcw.js";import{eN as V,Pn as B,Fs as C,Po as L,Pj as W,ET as S,Pp as q,EX as I,Ew as X,Ft as w,Pq as b,gC as H,Fi as J,Fn as Q,Fa as Y,F8 as Z,Fo as aa,F5 as ta,Pr as ea,Ps as sa,Pt as oa,Pu as u,e9 as na,Pv as la,Pw as ra}from"./zeni-epic-state-sw_lecJS.js";import{n as ia}from"./mui-Wsw1v_RJ.js";import{u as ca}from"./useAskAiCfoHostNavButtonProps-DoU7lqQS.js";import{c as ka}from"./useFetchSuggestedQuestionsWhenReady-BWXD0kZI.js";import{M as pa}from"./MobileAppDrawer-DkH2rucX.js";import"./recharts-_jQKodaN.js";import"./analytics-CBVce51h.js";import"./plaid-YevEbNem.js";import"./dnd-DEqqrbnG.js";import"./stripe-DMRn4zHo.js";import"./lottie-crYXxJIl.js";import"./lexical-BcUhE2s3.js";import"./pdf-BB9eCt-A.js";import"./utils-84J_wB9-.js";(function(){try{var t=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},e=new t.Error().stack;e&&(t._sentryDebugIds=t._sentryDebugIds||{},t._sentryDebugIds[e]="246952e8-1104-4429-80fc-8ef9b560707f",t._sentryDebugIdIdentifier="sentry-dbid-246952e8-1104-4429-80fc-8ef9b560707f")}catch{}})();const ua=ia.div`
2
- display: flex;
3
- min-height: 100%;
4
- width: 100%;
5
- flex: 1 1 auto;
6
- flex-direction: column;
7
- align-items: center;
8
- background-color: ${t=>t.theme.colors.grey4};
9
- `,da=R(function(t,e){const o=B(t,e.isTaskTemplatesEnabled),{taskGroupId:c}=e,n=c!=null&&c!==""?{...o,taskGroupsWithTasksList:o.taskGroupsWithTasksList.map(l=>({...l,tasks:l.tasks.filter(r=>r.taskGroupIds.includes(c))})).filter(l=>l.tasks.length>0)}:o;return{taskListView:n,tagListView:W(t),localData:n.localData,isTaskTemplatesEnabled:e.isTaskTemplatesEnabled}},function(t,e){const{navigate:o,currentTenant:c,location:n,isTaskTemplatesEnabled:l}=e,{tenantEmailDomain:r}=c,{groupByKey:d}=e.uiState;return{onTaskManagementRowClick:a=>{const s=ma(r,a),k=f(n.state?.pathnameStackToGoBack,n.pathname);o(s,{state:{pathnameStackToGoBack:k}})},onReloadTasks:()=>{t(C(!0,l))},onNewTaskClick:()=>{if(e.localData.defaultTaskGroupId!=null){const a=y(r,e.localData.defaultTaskGroupId),s=f(n.state?.pathnameStackToGoBack,n.pathname);o(a,{state:{pathnameStackToGoBack:s,message:"comingFromTaskListPage"}})}},onColumnSortConfigChanged:(a,s)=>{t(b({uiState:{sortKey:a,sortOrder:s}}))},onFiltersChange:a=>{t(oa({filters:a}))},onSearchTextChanged:a=>{t(sa({searchText:a}))},onReloadCards:()=>{t(C(!0,l))},onBackClick:()=>{if(n.state?.message==="triggerBackClick"){const a=O(n.state?.pathnameStackToGoBack),s=a.poppedPathname??"../";o(s,{state:{pathnameStackToGoBack:a.newStack}})}else o("../")},updateLocalData:a=>{t(ea({localData:a}))},resetLocalData:()=>{t(L({taskGroupById:e.taskGroupState.taskGroupById}))},handleCreateGroup:a=>{t(ta(e.localData.newTaskGroupName,a))},assignGroupToTasks:a=>{t(Z(e.localData.selectedTaskIds,a,aa(e.uiState.groupByKey,a)))},onDeleteTaskGroup:a=>{t(Y(a))},onAddNewTaskToTaskGroup:a=>{if(e.localData.defaultTaskGroupId!=null){const s=Ta(d,a);t(S({taskDetailLocalData:s}));const k=y(r,e.uiState.groupByKey==="groupName"?a:e.localData.defaultTaskGroupId),g=f(n.state?.pathnameStackToGoBack,n.pathname);o(k,{state:{pathnameStackToGoBack:g,message:"comingFromTaskListPage"}})}},onDragNDrop:(a,s)=>{t(Q(e.localData.selectedTaskIds.length>0?e.localData.selectedTaskIds:[a],s))},onTaskGroupRename:(a,s)=>{t(J(a,s))},onTimeSpentUpdate:(a,s)=>{t(w({task:a,updates:s}))},onShowToast:a=>{t(H(a))},onGroupByFilterChange:a=>{t(b({uiState:{groupByKey:a}}))},updateTask:(a,s)=>{t(w({task:a,updates:s}))},onCreateTagClick:(a,s)=>{t(X(a,s))},handleGroupTemplateClick:a=>{t(I(a,[]))},handleGroupTemplateTaskClick:(a,s)=>{t(I(a,[s]))},handleNewTaskInitialization:a=>{if(t(S({taskDetailLocalData:{...q,name:a}})),e.localData.defaultTaskGroupId!=null){const s=y(r,e.localData.defaultTaskGroupId),k=f(n.state?.pathnameStackToGoBack,n.pathname);o(s,{state:{pathnameStackToGoBack:k,message:"comingFromTaskListPage"}})}},onTaskGroupNameClick:a=>{o(`/${r}/tasks/group/${a}`)}}})(M);function ja(){const t=x(),e=A(),o=j(),c=$.getSignedInUser(),n=G(i=>V(i)),{taskGroupId:l}=N(),{useFeatureGate:r}=v(),{isFeatureEnabled:d}=r(K.isTaskTemplatesEnabled),[a,s]=T.useState(!1),[k,g]=T.useState(!1),h=G(i=>B(i,d)),D=G(i=>i.taskGroupState),m=h.fetchState,{isAiCfoAccessEnabled:E,onAskAiCfoClick:F}=ca({mobileExploreReferrer:"Task Checklist"});if(ka({isDataReady:m==="Completed"}),T.useEffect(()=>{a||(s(!0),e(C(!1,d)))},[a,e]),T.useEffect(()=>{m==="Completed"&&e(L({taskGroupById:D.taskGroupById}))},[m,D.taskGroupById]),c==null)throw Error("Can't access task list page without signing in...");return p.jsxs(p.Fragment,{children:[m==="Completed"?p.jsx(U,{analytics:_,onLoad:i=>(P=>P.trackPageLoaded(z.Event.taskListPage))(i)}):null,p.jsxs(ua,{children:[p.jsx(pa,{isAppContentDrawerOpen:k,handleDrawerToggle:i=>{g(i)}}),p.jsx(da,{location:o,navigate:t,currentTenant:n,taskGroupId:l,taskGroupState:D,localData:h.localData,uiState:h.uiState,isTaskTemplatesEnabled:d,taskListFetchState:m,isAiCfoAccessEnabled:E,onAskAiCfoClick:F})]})]})}const ma=(t,e)=>`/${t}/tasks/${encodeURIComponent(e)}`,y=(t,e)=>`/${t}/tasks/new/${e}`,Ta=(t,e)=>{if(t==="assignee"){const o=e.split(",");return{...u.taskDetailLocalData,assignee:o}}if(t==="priority"){const o=na(e);return{...u.taskDetailLocalData,priority:o}}if(t==="status"){const o=la(e);return{...u.taskDetailLocalData,status:o}}if(t==="tag"){const o=e.split(",");return{...u.taskDetailLocalData,tagIds:o}}if(t==="dueDate"){const o=ra(e);return{...u.taskDetailLocalData,dueDate:o}}return{...u.taskDetailLocalData}};export{ja as default};
@@ -1,9 +0,0 @@
1
- import{j as s}from"./liveblocks-iYXuwnNJ.js";import z from"./NotFoundScreen-CoCyTXNP.js";import{a as d}from"./sentry-C0ycLLNj.js";import{j as A,h as V,u as _,l as $,g as k,N as R,k as O,n as q,o as u}from"./core-BiO8az_8.js";import{A as J,z as w,y as C,C as M,c as D,e as H,cE as Q,i as Z,ap as K,w as W}from"./index-DhM1NMcw.js";import{eN as b,Pj as G,EP as P,ED as X,Ff as Y,Pk as v,Pl as ee,Ez as ae,Ew as te,pE as se,ps as ne,j_ as oe,EJ as ie,Pm as re,EG as le,EU as ce,ET as me}from"./zeni-epic-state-sw_lecJS.js";import{n as de}from"./mui-Wsw1v_RJ.js";import{u as pe}from"./useInitialThreadRequest-COC1d6YZ.js";import{M as ue}from"./MobileAppDrawer-DkH2rucX.js";import fe from"./TaskListScreen-Babx6Iz5.js";import"./recharts-_jQKodaN.js";import"./analytics-CBVce51h.js";import"./plaid-YevEbNem.js";import"./dnd-DEqqrbnG.js";import"./stripe-DMRn4zHo.js";import"./lottie-crYXxJIl.js";import"./lexical-BcUhE2s3.js";import"./pdf-BB9eCt-A.js";import"./utils-84J_wB9-.js";import"./useAskAiCfoHostNavButtonProps-DoU7lqQS.js";import"./useFetchSuggestedQuestionsWhenReady-BWXD0kZI.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]="b32032b0-dc34-4c0f-93e0-eef8463fa78f",e._sentryDebugIdIdentifier="sentry-dbid-b32032b0-dc34-4c0f-93e0-eef8463fa78f")}catch{}})();const ke=O(function(e,t){const{location:n,taskGroupId:l}=t,m=v(e,t.taskId),c=b(e),i=l!=null?ee(e.taskGroupState,l):void 0,p=w.getSignedInUser(),a=c.tenantId,r={userId:p?.userId??"",sessionId:p?.zeniSessionId??"",tenantId:a??""},f=G(e);return{taskDetailSelectorView:m,authParams:r,isNewClicked:n.state?.message==="comingFromTaskListPage",filesEndPoint:K.fileMicroServiceBaseUrl,companyName:t.currentTenant.companyName,companyId:t.currentTenant.companyId,currentUrl:`${Z.appUrl}${t.location.pathname}`,tagListView:f,taskGroupName:l!=null&&i!=null&&i.isDefault===!1?i.name:void 0}},function(e,t){const{taskId:n,navigate:l,currentTenant:m,location:c,taskGroupId:i}=t,{tenantEmailDomain:p}=m;return{onSaveChangesToLocalStore:a=>{e(me({taskDetailLocalData:a,taskId:n}))},onSaveDetailClick:()=>{e(ce(n,i))},onArchiveTaskClick:()=>{t.taskId!=null&&e(le(t.taskId))},onDismissClick:()=>{if(c.state?.message==="triggerBackClick"){const a=W(c.state?.pathnameStackToGoBack),r=a.poppedPathname??"../../dashboard";l(r,{state:{pathnameStackToGoBack:a.newStack}})}else{const a=B(p),r=C(c.state?.pathnameStackToGoBack,c.pathname);l(a,{state:{pathnameStackToGoBack:r}})}e(re({taskId:n}))},onDeleteTaskClick:()=>{e(ie(n))},updateFilesEntity:a=>{e(oe({files:a}))},onDeleteFile:a=>{e(ne(a))},onEditFileName:(a,r)=>{e(se(a,r.split(".")[0]))},onReloadTaskDetailPage:()=>{e(P(!1,n))},onCreateTagClick:a=>{e(te(a,n))},onDeleteTagClick:a=>{e(ae(a,n))}}})(Q);function I(){const e=A(),t=V(),n=_(),l=J(),{taskId:m,taskGroupId:c}=$(),i=k(o=>b(o)),p=pe(i?.companyId),[a,r]=d.useState(!1),[f,F]=d.useState(!1),[S,L]=d.useState(!1),[x,N]=d.useState(!1),y=k(o=>G(o)),E=k(o=>o.taskGroupViewState.fetchState);d.useEffect(()=>{f||(F(!0),t(P(!1,m)))},[f,t]),d.useEffect(()=>{S||y.fetchState==="Completed"||(L(!0),t(X()))},[S,t,y.fetchState]),d.useEffect(()=>{x||E==="Completed"||(N(!0),t(Y()))},[x,t,E]);const T=k(o=>v(o,m)),g=T.fetchState,j=w.getSignedInUser();if(j==null)throw Error("Can't access task detail page without signing in...");if(g==="Error"&&T.error?.code===400){const{tenantEmailDomain:o}=i,h=B(o),U=C(n.state?.pathnameStackToGoBack,n.pathname);return s.jsx(R,{to:h,state:{pathnameStackToGoBack:U}})}return s.jsxs(s.Fragment,{children:[g==="Completed"?s.jsx(M,{analytics:D,onLoad:o=>(h=>h.trackPageLoaded(H.Event.taskDetailPage))(o)}):null,s.jsxs(ge,{children:[s.jsx(ue,{isAppContentDrawerOpen:a,handleDrawerToggle:o=>{r(o)}}),s.jsx(ke,{analytics:D,currentTenant:i,handleZeniLogoClick:()=>{l.toggle()},initialOpenThreadRequest:p,location:n,loggedInUser:j,navigate:e,taskGroupId:c,taskId:m,taskDetailFetchState:g})]})]})}const ge=de.div`
2
- display: flex;
3
- min-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
- `,B=e=>`/${e}/tasks`;function Ae(){return s.jsxs(q,{children:[s.jsx(u,{path:"/new",element:s.jsx(I,{})}),s.jsx(u,{path:"/new/:taskGroupId",element:s.jsx(I,{})}),s.jsx(u,{path:"/group/:taskGroupId",element:s.jsx(fe,{})}),s.jsx(u,{path:"/:taskId",element:s.jsx(I,{})}),s.jsx(u,{path:"*",element:s.jsx(z,{})})]})}export{Ae as default};
@@ -1 +0,0 @@
1
- import{j as t}from"./liveblocks-iYXuwnNJ.js";import i from"./NotFoundScreen-CoCyTXNP.js";import{T as r}from"./TransactionDetailScreen-B5S0aVL7.js";import"./sentry-C0ycLLNj.js";import{n as d,o as e}from"./core-BiO8az_8.js";import"./zeni-epic-state-sw_lecJS.js";import"./recharts-_jQKodaN.js";import"./index-DhM1NMcw.js";import"./mui-Wsw1v_RJ.js";import"./analytics-CBVce51h.js";import"./plaid-YevEbNem.js";import"./dnd-DEqqrbnG.js";import"./stripe-DMRn4zHo.js";import"./lottie-crYXxJIl.js";import"./lexical-BcUhE2s3.js";import"./pdf-BB9eCt-A.js";import"./utils-84J_wB9-.js";import"./useAskAiCfoHostNavButtonProps-DoU7lqQS.js";import"./useFetchSuggestedQuestionsWhenReady-BWXD0kZI.js";import"./decodeURIComponentSafe-Drs0EkRs.js";import"./routePaths-DZQ5pfqe.js";(function(){try{var o=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},n=new o.Error().stack;n&&(o._sentryDebugIds=o._sentryDebugIds||{},o._sentryDebugIds[n]="256f287b-7a3d-4d6d-890e-a8cb9db8b86d",o._sentryDebugIdIdentifier="sentry-dbid-256f287b-7a3d-4d6d-890e-a8cb9db8b86d")}catch{}})();function q(){return t.jsxs(d,{children:[t.jsx(e,{path:"/:transactionTypeEncoded/:transactionId",element:t.jsx(r,{})}),t.jsx(e,{path:"/:transactionTypeEncoded/:transactionId/page-not-found",element:t.jsx(i,{})}),t.jsx(e,{path:"/:transactionTypeEncoded/:transactionId/vendor/create",element:t.jsx(r,{})}),t.jsx(e,{path:"/*",element:t.jsx(r,{})})]})}export{q as default};
@@ -1,5 +0,0 @@
1
- import{j as I}from"./liveblocks-iYXuwnNJ.js";import{a as d}from"./sentry-C0ycLLNj.js";import{h as j,g as S,u as re,j as le,l as de,N as Re,k as Ge}from"./core-BiO8az_8.js";import{bn as je,eN as J,cO as ue,bv as me,pj as H,Jq as w,Kr as pe,Ks as Y,JQ as he,jB as fe,Kt as ge,JV as Q,JW as X,kq as Se,Gz as Z,Jk as _,jv as ye,jt as Te,jF as Ke,Ku as $e,Kv as Me,t8 as G,jA as ve,FW as Ee,cT as We,cU as qe,Kw as Je,Jj as He,Kx as Ye,tc as Qe,Ky as Xe,Kz as Ze,KA as ea,KB as aa,KC as ta,jE as na,KD as oa,KE as sa,Jl as ia,KF as ca,KG as ra,KH as la,FQ as da,FE as ua,G6 as ma,jG as pa,GA as ie,FN as ha}from"./zeni-epic-state-sw_lecJS.js";import{z as De,p as ee,m as V,aJ as Ce,h as fa,r as ga,aK as Sa,F as ya,w as W,j as Ta,aL as va,y as q,c as be,aM as Ea,ap as Da,U as M}from"./index-DhM1NMcw.js";import{n as Ca,S as ba,D as Ia}from"./mui-Wsw1v_RJ.js";import{u as ka}from"./useAskAiCfoHostNavButtonProps-DoU7lqQS.js";import{c as Aa}from"./useFetchSuggestedQuestionsWhenReady-BWXD0kZI.js";import{d as Ie}from"./decodeURIComponentSafe-Drs0EkRs.js";import{h as ke,g as Ua,d as xa,b as _a}from"./routePaths-DZQ5pfqe.js";import{t as Va}from"./utils-84J_wB9-.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]="373b588d-5f6e-4e8d-ad44-e0c60d1712fa",a._sentryDebugIdIdentifier="sentry-dbid-373b588d-5f6e-4e8d-ad44-e0c60d1712fa")}catch{}})();const ae=()=>{const a=De.getSignedInUser(),{useFeatureGate:e}=ee(),{isFeatureEnabled:s}=e(V.isChainOfThoughtEnabled);return d.useMemo(()=>je(a)&&s,[a,s])};function Ae(a){if(a!=null){if("customer"in a&&a.customer!=null){const{customer:e}=a;return{id:e.id,name:e.name,logo:e.logo,type:"customer",zeniId:e.id,qboId:e.id}}if("vendor"in a&&a.vendor!=null){const{vendor:e}=a;return{id:e.id,name:e.name,logo:e.logo,type:"vendor",zeniId:e.id,qboId:e.id}}}}function Ya(a,e){const s=j(),{useFeatureGate:t,useDynamicConfig:n}=ee(),o=S(u=>J(u)),i=o.userRole.includes("charge_card_user")||o.userRole.includes("charge_card_admin"),l=o.userRole!=null&&ue(o.userRole),g=o.userRole!=null&&me(o.userRole),{isFeatureEnabled:y}=t(V.isVendorBulkUpdateOnTransactionEnabled),{isFeatureEnabled:b}=t(V.isExpenseAutomationEnabled),{configValue:h}=n(Ce.enableUncategorizedExpenseCategory),f=h?.uncategorized_expense_category_enabled===!0,k=ae(),T=d.useMemo(()=>({id:a,type:H(e)}),[a,e]),m=S(u=>w(u,T)),C=S(u=>{const N=w(u,T)?.transactionDetailLocalData.vendorUpdates?.id;return N==null?"Not-Started":u.transactionVendorViewState.editVendorStateById[N]?.saveStatus.fetchState??"Not-Started"}),p=d.useMemo(()=>m?.fetchState==="Completed"?Ae(m?.transaction):void 0,[m?.fetchState,m?.transaction]),E=S(u=>{if(p!=null)return pe(u.customerIncomeState,u.vendorExpenseState,u.trendState,p,"month")}),A=S(u=>Y(u)),F=S(u=>{if(p!=null)return he(u.trendWithTransactionsState,p,"TransactionDetail")}),K=o.company?.companyInfo.firstMonthOfFY??1,$=S(u=>fe(u.accountState,u.accountListState,"accountList")),[P,B]=d.useState(!1),[L,v]=d.useState(!1),[c,z]=d.useState(!1);d.useEffect(()=>{B(!1),v(!1),z(!1)},[a,e]);const D=d.useCallback(()=>{B(!1),v(!1)},[]),[U,x]=d.useState(!1),O=F?.selectedPeriod?.timePeriod;return d.useEffect(()=>{c||m==null||m.transaction==null||(s(ge({id:m.transaction.id,type:m.transaction.type})),z(!0)),p!=null&&(!i||l&&g===!1)&&(P?L||E==null||(v(!0),s(Z(p,"TransactionDetail",{timeframe:"month",timePeriod:O??E}))):(s(Q()),s(X()),B(!0),s(Se(p))))},[s,c,m?.fetchState,m?.transaction,p,i,l,g,P,L,E,O]),d.useEffect(()=>{A.newVendorState?.vendorDetailLocalData?.vendorName!=null?x(!0):x(!1)},[A.newVendorState?.vendorDetailLocalData?.vendorName]),d.useEffect(()=>()=>{s(_("common"))},[s]),{currentTenant:o,loggedInUserHasCardUserOrAdminRole:i,isUserHasDashboardAccess:l,isUserHasInvestorOrBankerAccess:g,isVendorBulkUpdateOnTransactionEnabled:y,isExpenseAutomationEnabled:b,isUncategorizedExpenseCategoryEnabled:f,isChainOfThoughtEnabled:k,selectedTransaction:T,transactionDetail:m,vendorSaveStatus:C,tranEntity:p,defaultTrendTransactionTimePeriod:E,vendorViewDetails:A,uiState:F,firstMonthOfFY:K,uncategorizedAccounts:$,resetTrendIsFetchedStates:D,isCreateVendorDrawerOpen:U,setIsCreateVendorDrawerOpen:x}}const Fa={overlayWidth:new ya(100,100,58)},Ba=({isOpen:a,onSaveVendor:e,onSaveSuccess:s,onCancel:t,vendorViewDetails:n})=>{const o=fa(),i=ga(),l=j(),g=S(h=>Y(h)),y=()=>{t()},b={vendorDetailView:n??g,onSaveSuccess:()=>{l(Te()),l(Ke("Not-Started")),s()},onSaveVendor:e,onCancelClick:y,saveVendorDetailLocalData:h=>{l(ye({vendorId:void 0,localData:h}))}};return I.jsx(Ia,{anchor:"right",open:a,PaperProps:{style:{width:Fa.overlayWidth.valuePercentage(i),boxShadow:"none"}},slotProps:{backdrop:{style:{backgroundColor:o.colors.black,opacity:.4,cursor:"pointer"}}},onClose:y,children:I.jsx(wa,{onClick:h=>h.stopPropagation(),children:I.jsx(Sa,{...b})})})},wa=Ca(ba)`
2
- display: flex;
3
- min-height: 100%;
4
- flex-direction: column;
5
- `,Pa=({closeDrawerHandler:a,overrideTransactionId:e,overrideTransactionType:s})=>{const t=re(),n=le(),o=j(),i=ae(),{transactionTypeEncoded:l,transactionId:g}=de(),y=e??g,b=s??Ie(l??"");let h;ke(y,b)&&(h={id:y,type:H(b)});const f=h!=null?S(T=>w(T,h)):void 0,k=()=>{const T=W(t.state?.pathnameStackToGoBack),m=T.poppedPathname??((C=2)=>{let p="../";for(let E=0;E<C;E++)p=`${p}../`;return p})(1);n(m,{state:{pathnameStackToGoBack:T.newStack}})};return{transactionId:h,onSaveVendor:()=>{o(ve(h,void 0))},onSaveSuccess:()=>{if(f!=null&&f?.transaction&&f?.transactionDetailLocalData.vendorUpdates?.qboId!=null&&f?.transactionDetailLocalData.vendorUpdates?.id!=null){const T=f?.transactionDetailLocalData.vendorUpdates,m={id:f?.transactionDetailLocalData.vendorUpdates?.qboId,zeniId:f?.transactionDetailLocalData.vendorUpdates?.id,type:"vendor",name:T?.name,qboId:f?.transactionDetailLocalData.vendorUpdates?.qboId??""},C={transactionId:{id:f?.transaction?.id,type:f?.transaction?.type},transaction:f?.transaction,lineIds:f?.transaction?.lines?.map(p=>p.id)??[]};o(G(m,f?.transaction?.amount.amount,C,!1,!1,i))}k()},onCancel:()=>{h!=null&&o($e({transactionId:h})),o(Te()),o(Me()),a(!0),k()}}},La=Ge(function(a,e){const s=w(a,e.selectedTransaction);let t;s==null&&console.warn("Check if the you've selected the transaction before getting the details");const n=De.getSignedInUser(),o=a.tenantState.currentTenantId,i={userId:n?.userId??"",sessionId:n?.zeniSessionId??"",tenantId:o??""};s!=null&&s.fetchState==="Completed"&&s.transaction!=null&&e.entity!=null&&(t=Je(a,e.entity,"TransactionDetail"));const l=a.entityAutoCompleteState.autoCompleteText.common,g=He(a,"common"),y=J(a);return{transactionDetail:s,transactionAttachmentEndpointToDownload:`${M}/transaction_attachment`,transactionAttachmentsEndpointToFetch:y.externalConnections?.accounting[0]?.connectionName==="netsuite"?`${M}/transaction_attachments_accounting_provider`:`${M}/transaction_attachments`,attachmentUploadEndpoint:`${Da.accountMicroServiceBaseUrl}`,isCOTEnabled:e.isCOTEnabled,authParams:i,trendReport:t,analytics:be,uncategorizedAccounts:e.uncategorizedAccounts,autoCompleteData:{autoCompleteText:l,entityAutoCompleteView:g},isVendorBulkUpdateOnTransactionEnabled:e.isVendorBulkUpdateOnTransactionEnabled,isExpenseAutomationEnabled:e.isExpenseAutomationEnabled,isUncategorizedExpenseCategoryEnabled:e.isUncategorizedExpenseCategoryEnabled,enableBackClickOnSave:e.location.state?.message?.startsWith("comingFromScheduleDetails")}},function(a,e){const{isCOTEnabled:s}=e;return{onBackClick:()=>{if(a(_("common")),e.onBackClick!=null)return void e.onBackClick();const t=W(e.location.state?.pathnameStackToGoBack),n=t.poppedPathname??Ue(2);e.navigate(n,{state:{pathnameStackToGoBack:t.newStack,message:"comingFromTransactionDetail"}})},discardTransactionDetailLocalData:(t,n)=>{e.transaction!=null&&a(ha({transactionId:{id:e.transaction.id,type:e.transaction.type},vendorId:t,customerId:n}))},onTransactionClick:t=>{e.resetTrendIsFetchedStates(),a(Q()),a(X());const n=q(e.location.state?.pathnameStackToGoBack,e.location.pathname);e.navigate(_a(t,e.tenantEmailDomain),{state:{pathnameStackToGoBack:n}})},onTrendSelectedPeriodChange:t=>{if(t==null)e.defaultTrendTransactionTimePeriod!=null&&a(ie(e.entity,"TransactionDetail",{timeframe:"month",timePeriod:e.defaultTrendTransactionTimePeriod}));else{const n=t.currentTimePeriod==null?t.addTimePeriod:{startDate:t.addTimePeriod.startDate,endDate:t.currentTimePeriod.endDate};a(Z(e.entity,"TransactionDetail",{timeframe:t.timeframe,timePeriod:t.addTimePeriod})),a(ie(e.entity,"TransactionDetail",{timeframe:t.timeframe,timePeriod:n}))}},onSaveUpdates:(t,n,o,i)=>{a(i===!0&&o!=null?ve(t,o,!0,e.isExpenseAutomationEnabled,e.isUncategorizedExpenseCategoryEnabled):pa({transactionId:t,isExpenseAutomationEnabled:e.isExpenseAutomationEnabled,cotTransactionTracking:n,isUncategorizedExpenseCategoryEnabled:e.isUncategorizedExpenseCategoryEnabled})),a(_("common"))},onUploadAttachmentAttachment:t=>{a(ma(t))},onDeleteAttachment:t=>{e.transaction!=null&&a(ua(t,{id:e.transaction.id,type:e.transaction.type}))},onSaveTransactionDetailLocalData:(t,n)=>{a(da({transactionId:t,transactionLocalData:n}))},onUpdateAllChecked:(t,n,o,i)=>{e.transaction!=null&&a(la(e.selectedTransaction,e.transaction,t,n,o,i))},onResetLineItemsCategoryClassInLocalData:(t,n,o,i,l,g)=>{a(ra(t,n,o,i,l,g))},onChangeCategoryClassWhenUpdateAllIsChecked:(t,n)=>{e.transaction!=null&&a(ca({id:e.transaction.id,type:e.transaction.type},e.transaction,t,n))},onSaveSuccess:()=>{const t=W(e.location.state?.pathnameStackToGoBack);if(t.poppedPathname!=null){const n=Va(t.poppedPathname,"/").split("/"),o=n[n.length-1];if(["uncategorized-income","uncategorized-expense","missing-receipts"].includes(o)&&e.navigate(t.poppedPathname,{state:{pathnameStackToGoBack:t.newStack}}),e.location.state?.message==="comingFromScheduleDetails"){const i=`${Ua(e.tenantEmailDomain)}`;e.navigate(i)}else if(e.location.state?.message==="comingFromScheduleDetailsFixedAssets"){const i=`${xa(e.tenantEmailDomain)}`;e.navigate(i)}}},onPageRefresh:()=>{a(Ee(e.selectedTransaction,!0))},autoCompleteActions:{onAutoCompleteInputChange:(t,n)=>{t.trim().length>=2?a(ia({searchString:t,entityType:n,searchOrigin:"common"})):t.trim().length===0&&a(_("common"))},onCancelAutoComplete:()=>{a(_("common"))}},onFetchRecommendationsForEntity:(t,n,o,i)=>{a(G(t,n,o,i,!1,s))},clearRecommendationForLineId:t=>{const{transactionId:n,transaction:o,lineId:i}=t;a(sa(n,o,i))},resetUpdateErrorState:()=>{const t={id:e.selectedTransaction.id,type:e.selectedTransaction.type};a(oa(t))},onSaveVendorInLocalData:(t,n,o,i,l)=>{if(a(na({transactionId:t,vendorUpdates:n,entity:o})),n.id!=null&&o!=null&&i!=null&&l!=null&&a(G(o,i,l,!1,!1,s)),a(ye({vendorId:n.id?n.id:void 0,localData:{vendorName:n.name,vendorId:n.id?n.id:void 0}})),!n.id&&e.transaction!=null){const g=e.transaction,y=q(e.location.state?.pathnameStackToGoBack,e.location.pathname);e.navigate(`/${e.tenantEmailDomain}/transaction/${encodeURIComponent(g.type??"")}/${g.id}/vendor/create`,{state:{pathnameStackToGoBack:y}})}},onSaveCustomerInLocalData:(t,n,o,i,l)=>{a(ta({transactionId:t,customerUpdates:n,entity:o})),n.id!=null&&o!=null&&i!=null&&l!=null&&a(G(o,i,l,!1,!1,s))},onUpdateAllTranactionsWithCurrentVendorChecked:t=>{a(aa({transactionId:{id:e.selectedTransaction.id,type:e.selectedTransaction.type},isUpdateEnabled:t}))},onClickUpdateVendorToAllLineItems:(t,n,o)=>{a(ea(t,n,o))},onResetVendorToAllLineItems:(t,n,o)=>{a(Ze(t,n,o))},saveLatestSelectedEntity:(t,n,o)=>{a(Xe({transactionId:t,lineId:n,entity:o}))},updateVendorBulkRecommendationsFetchStatus:(t,n)=>{a(Qe(t,n))},setIsVendorUpdateAllChecked:(t,n,o)=>{a(Ye(t,n,o))}}})(Ea);function Qa(){const a=le(),e=j(),s=re(),{useFeatureGate:t,useDynamicConfig:n}=ee(),o=Ta(),i=S(r=>J(r)),l=i.userRole.includes("charge_card_user")||i.userRole.includes("charge_card_admin"),g=i.userRole!=null&&ue(i.userRole),y=i.userRole!=null&&me(i.userRole),{isFeatureEnabled:b}=t(V.isVendorBulkUpdateOnTransactionEnabled),{isFeatureEnabled:h}=t(V.isExpenseAutomationEnabled),{configValue:f}=n(Ce.enableUncategorizedExpenseCategory),k=f?.uncategorized_expense_category_enabled===!0,{tenantEmailDomain:T,transactionTypeEncoded:m,transactionId:C}=de(),[p,E]=d.useState(!1),A=Ie(m??""),F=ke(C,A),K=S(r=>r.transactionVendorViewState),$=ae(),{isFeatureEnabled:P}=t(V.isTransactionCommentingEnabled),B=o?.currentTenant?.companyId,L=o?.currentTenant?.companyName;let v;F&&(v={id:C,type:H(A)});const c=v!=null?S(r=>w(r,v)):void 0,z=c?.transactionDetailLocalData.vendorUpdates?.id!=null?K.editVendorStateById[c?.transactionDetailLocalData.vendorUpdates.id]?.saveStatus.fetchState:"Not-Started",D=c?.fetchState==="Completed"?Ae(c?.transaction):void 0,U=S(r=>D!=null?pe(r.customerIncomeState,r.vendorExpenseState,r.trendState,D,"month"):void 0),x=S(r=>Y(r)),O=S(r=>D!=null?he(r.trendWithTransactionsState,D,"TransactionDetail"):void 0),u=i.company?.companyInfo.firstMonthOfFY??1,N=S(r=>fe(r.accountState,r.accountListState,"accountList")),[xe,te]=d.useState(!1),[_e,ne]=d.useState(!1),[Ve,Fe]=d.useState(!1),oe=()=>{te(!1),ne(!1)},Be=va();d.useEffect(()=>{if(v!=null&&c!=null&&c.fetchState==="Not-Started")e(Ee(v)),oe();else if(v!=null&&c!=null&&c.fetchState==="Error"){const r=q(s.state?.pathnameStackToGoBack,s.pathname),R={pathnameStackToGoBack:r,message:"pageNotFound",origin:"transaction_detail"};Be&&(R.message="expenseAutomation",R.origin="transaction_categorization",R.pathnameStackToGoBack=r),a("page-not-found",{replace:!0,state:R})}},[v]),d.useEffect(()=>{Ve||c==null||c.transaction==null||(e(ge({id:c.transaction.id,type:c.transaction.type})),Fe(!0)),D==null&&c?.fetchState==="Completed"&&ce(c?.transaction),D!=null&&(!l||g&&y===!1)&&(xe?_e||U==null||(ne(!0),e(Z(D,"TransactionDetail",{timeframe:"month",timePeriod:O?.selectedPeriod?.timePeriod??U}))):(e(Q()),e(X()),ce(c?.transaction),te(!0),e(Se(D))))},[c?.fetchState,c?.transaction,U,l]),d.useEffect(()=>{x.newVendorState?.vendorDetailLocalData?.vendorName!=null?E(!0):E(!1)},[x.newVendorState?.vendorDetailLocalData?.vendorName]),d.useEffect(()=>()=>{e(_("common"))},[]);const we=[m,C].filter(r=>r!=null),{transactionId:se,onSaveVendor:Pe,onSaveSuccess:Le,onCancel:ze}=Pa({closeDrawerHandler:r=>{E(!1),a(r?"../":"../..")}}),{isAiCfoAccessEnabled:Oe,onAskAiCfoClick:Ne}=ka({mobileExploreReferrer:"Transaction Details"});return Aa({isDataReady:c?.fetchState==="Completed"}),F?I.jsxs(I.Fragment,{children:[se!=null&&p&&I.jsx(Ba,{isOpen:p,transactionId:se,onSaveVendor:Pe,onSaveSuccess:Le,onCancel:ze}),I.jsx(La,{hideDeleteAttachment:!0,firstMonthOfFY:u,isDisabled:c?.transaction?.type==="transfer"&&o?.connectionName==="netsuite"?"readonly":void 0,tenantEmailDomain:T,location:s,navigate:a,selectedTransaction:v,entity:D,isCOTEnabled:$,defaultTrendTransactionTimePeriod:U,resetTrendIsFetchedStates:oe,transaction:c?.transaction,uncategorizedAccounts:N,vendorSaveStatus:z,isVendorBulkUpdateOnTransactionEnabled:b,isExpenseAutomationEnabled:h,isUncategorizedExpenseCategoryEnabled:k,isAiCfoAccessEnabled:Oe,onAskAiCfoClick:Ne,isTransactionCommentingEnabled:P,companyId:B,companyName:L})]}):I.jsx(Re,{to:Ue(we.length)})}const Ue=(a=2)=>{let e="../";for(let s=0;s<a;s++)e=`${e}../`;return e},ce=a=>{if(a!=null){const{transactionCategory:e,transactionClass:s}=za(a),t=Oa(a);be.trackTransactionDetails(a.account?.accountId,a.account?.accountName,a.id,t,e.length>0?e:void 0,s.length>0?s:void 0,a.type,a.amount,a.memo,a.lines?.length??0,a.attachments?.map(n=>n.fileName))}},za=a=>{const e=[],s=[];return a.lines?.forEach(t=>{switch(t.type){case"transaction_with_account_and_class_line":case"transaction_with_product_or_service_line":case"journal_entry_transaction_line":case"linked_transaction_line":{const n=t;n!=null&&n.account!=null&&n.account.accountName?.length>0&&e.push(n.account.accountName),n.class!=null&&n.class.className?.length>0&&s.push(n.class.className);break}}}),{transactionCategory:e,transactionClass:s}},Oa=a=>We(a)===!0?a.customer?.name??"":qe(a)===!0?a.vendor?.name??"":a.memo!=null?a.memo:a.type;export{Ba as C,Qa as T,Pa as a,La as b,ae as c,Ya as u};
@@ -1,12 +0,0 @@
1
- import{j as o}from"./liveblocks-iYXuwnNJ.js";import{a as l}from"./sentry-C0ycLLNj.js";import{q as u,h,g as y,N as I}from"./core-BiO8az_8.js";import{ID as w,eO as b,yY as x}from"./zeni-epic-state-sw_lecJS.js";import{z as f,B as j,H as S,J as D}from"./index-DhM1NMcw.js";import{n as g}from"./mui-Wsw1v_RJ.js";import"./recharts-_jQKodaN.js";import"./analytics-CBVce51h.js";import"./plaid-YevEbNem.js";import"./dnd-DEqqrbnG.js";import"./stripe-DMRn4zHo.js";import"./lottie-crYXxJIl.js";import"./lexical-BcUhE2s3.js";import"./pdf-BB9eCt-A.js";import"./utils-84J_wB9-.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]="216a2de9-eda4-4721-8652-c4a3e58414d8",e._sentryDebugIdIdentifier="sentry-dbid-216a2de9-eda4-4721-8652-c4a3e58414d8")}catch{}})();const R=()=>{const[e]=u(),t=e.get("code")??"",s=e.get("state")??"",p=e.get("profileId")??"",[n,c]=l.useState(!1),a=h(),i=y(m=>w(m)),r=f.getSignedInUser(),d=f.getSignedInUserTenantWithId(s);if(r==null||d==null)return o.jsx(I,{to:"/signin/auth",replace:!0});if(r==null)throw Error("Can't access this page without signing in...");return b(r.userId,r.zeniSessionId,d?.tenantId),l.useEffect(()=>{n||(c(!0),a(x(t,p,s)))},[n,a]),i.fetchState==="Error"?o.jsx(E,{children:o.jsx(_,{children:i.error?.message??""})}):(i.fetchState==="Completed"&&window.close(),o.jsx(j,{fetchState:"In-Progress"}))},E=g.div`
2
- display: flex;
3
- width: 100%;
4
- height: 100vh;
5
- flex-direction: row;
6
- justify-content: center;
7
- align-items: center;
8
- background-color: ${e=>e.theme.colors.grey5};
9
- `,_=g(D.LargeRegular)`
10
- display: flex;
11
- color: ${S.important};
12
- `;export{R as default};
@@ -1,9 +0,0 @@
1
- import{j as i}from"./liveblocks-iYXuwnNJ.js";import{a as f}from"./sentry-C0ycLLNj.js";import{j as x,h as B,u as C,l as N,g as p}from"./core-BiO8az_8.js";import{HD as s,HC as $,NJ as j,eN as v,NK as D}from"./zeni-epic-state-sw_lecJS.js";import{r as T,ap as g,h as z,z as E,B as L,b_ as P,w as _}from"./index-DhM1NMcw.js";import{n as U}from"./mui-Wsw1v_RJ.js";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},n=new e.Error().stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="be63a18a-829c-4b0c-93aa-15c5d8d5ab47",e._sentryDebugIdIdentifier="sentry-dbid-be63a18a-829c-4b0c-93aa-15c5d8d5ab47")}catch{}})();const G=U.div`
2
- display: flex;
3
- height: 100vh;
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
- `;function Z(){const e=x(),n=B(),d=T(),l=C();let{accountId:a}=N(),m=`${g.bankingMicroServiceBaseUrl}/1.0/deposit-accounts/${a}`;a==null&&l.pathname.includes(`${s}/statements`)&&(a=s,m=`${g.bankingMicroServiceBaseUrl}/1.0/${s}`);const[u,b]=f.useState(!1),h=z();f.useEffect(()=>{u||(b(!0),n($(a??"",!1)))},[u,n]);const o=p(t=>j(t,a??"")),y=()=>{const t=_(l.state?.pathnameStackToGoBack),S=t.poppedPathname??"..";e(S,{state:{pathnameStackToGoBack:t.newStack}})},c=E.getSignedInUser(),r=p(t=>v(t)),I={userId:c?.userId??"",sessionId:c?.zeniSessionId??"",tenantId:r.tenantId??""},w=D(a??"")===!0?s:o.zeniAccountDetail?.accountLast4??"",k=r.company?.companyInfo.companyLegalName??r.companyName;if(c==null)throw Error("Can't access address page without signing in...");return o.fetchState!=="Completed"?i.jsx(L,{fetchState:"In-Progress",style:{backgroundColor:h.colors.grey5}}):i.jsx(G,{windowSize:d,children:i.jsx(P,{currentTenantCompanyName:k,statementListView:o,accountLast4:w,onBackClick:y,authParams:I,downloadEndPoint:m})})}export{Z};
@@ -1 +0,0 @@
1
- import{g as i}from"./sentry-C0ycLLNj.js";import{r as a}from"./empty-DIbsZE_-.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]="48da1753-b6d9-4542-88c8-c24b4de62ac0",e._sentryDebugIdIdentifier="sentry-dbid-48da1753-b6d9-4542-88c8-c24b4de62ac0")}catch{}})();function s(e,t){for(var o=0;o<t.length;o++){const r=t[o];if(typeof r!="string"&&!Array.isArray(r)){for(const n in r)if(n!=="default"&&!(n in e)){const d=Object.getOwnPropertyDescriptor(r,n);d&&Object.defineProperty(e,n,d.get?d:{enumerable:!0,get:()=>r[n]})}}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}var f=a();const l=s({__proto__:null,default:i(f)},[f]);export{l as e};