@zeniai/web-app-ui 5.1.45-dev → 5.1.47-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 (145) hide show
  1. package/dist/assets/AddressRoutes-CZCF3Ed7.js +1 -0
  2. package/dist/assets/AddressScreen-DVPbua-7.js +9 -0
  3. package/dist/assets/AiCfoScreen-CquZXfRI.js +22 -0
  4. package/dist/assets/BillPayApprovalRoutes-Bsqa7UIt.js +1 -0
  5. package/dist/assets/{BillPayRoutes-DzxfBsX4.js → BillPayRoutes-DrhDRZTP.js} +33 -33
  6. package/dist/assets/BusinessVerificationPageScreen-BVkfBtGX.js +9 -0
  7. package/dist/assets/ChargeCardRoutes-DJ3TgdzU.js +71 -0
  8. package/dist/assets/{CompanyPassportScreen-DNxF2lkY.js → CompanyPassportScreen-Bd9dcAEb.js} +1 -1
  9. package/dist/assets/ConnectionAuthScreen-DtUVl4gJ.js +11 -0
  10. package/dist/assets/CustomerOnboardingAuthScreen-y2T_jVxs.js +1 -0
  11. package/dist/assets/{CustomerOnboardingRoutes-_VvrC-ga.js → CustomerOnboardingRoutes-D0TFB5es.js} +5 -5
  12. package/dist/assets/{DashboardRoutes-Dovp7HGT.js → DashboardRoutes-AglkqdZb.js} +4 -4
  13. package/dist/assets/DefaultTenantHome-D0gpxBnQ.js +1 -0
  14. package/dist/assets/DomesticWireDetailScreen-hVPTa7zl.js +18 -0
  15. package/dist/assets/DrawerScreen-Dcd16rrd.js +1 -0
  16. package/dist/assets/EntityDetailRoutes-Be1JmzWy.js +1 -0
  17. package/dist/assets/ExpenseAutomationRoutes-DQU2nPFS.js +25 -0
  18. package/dist/assets/FeaturePreviewScreen-nQP4PBuN.js +1 -0
  19. package/dist/assets/HubSpotOAuthCallbackScreen-CJZCnYYo.js +1 -0
  20. package/dist/assets/{MagicLinkRoutes-DmvvOL_Y.js → MagicLinkRoutes-C-x0DqRV.js} +10 -10
  21. package/dist/assets/MagicLinkSignInScreen-BJYa-6dE.js +12 -0
  22. package/dist/assets/MobileAppDrawer-MkL6Ri_E.js +1 -0
  23. package/dist/assets/NotFoundScreen-B1j26TaW.js +1 -0
  24. package/dist/assets/NotificationRoutes-CTsePQJL.js +1 -0
  25. package/dist/assets/OAuthConsentScreen-Bf7Rz5GL.js +1 -0
  26. package/dist/assets/PandLWithForecastRoutes-BYdB78V0.js +1 -0
  27. package/dist/assets/PeopleRoutes-D04-zoLL.js +22 -0
  28. package/dist/assets/PerformanceRoutes-qo5w7ss8.js +1 -0
  29. package/dist/assets/{Preview-B1kObDl3.js → Preview-evpWpYgT.js} +1 -1
  30. package/dist/assets/{QBOConnectionScreen-Bn0720kQ.js → QBOConnectionScreen-DjJePSxH.js} +1 -1
  31. package/dist/assets/ReferralListScreen-BVRl8Eqw.js +5 -0
  32. package/dist/assets/ReimbursementApprovalRoutes-C0W7Zcf-.js +1 -0
  33. package/dist/assets/{ReimbursementApprovalRuleDetailScreen-B-QO8l6D.js → ReimbursementApprovalRuleDetailScreen-D_U8RiI7.js} +1 -1
  34. package/dist/assets/{ReimbursementRoutes-C_8B-Cx9.js → ReimbursementRoutes-DkEf0a2t.js} +9 -9
  35. package/dist/assets/ReportsRoutes-DVYYxF0q.js +1 -0
  36. package/dist/assets/RewardsRoutes-D1Dw_YCi.js +1 -0
  37. package/dist/assets/ScreenRoutes-DL6N-VWP.js +2 -0
  38. package/dist/assets/{SettingsRoutes-D8sH0k-9.js → SettingsRoutes-BTd0zpvV.js} +8 -8
  39. package/dist/assets/{SetupPagesScreen-CyzzOWiJ.js → SetupPagesScreen-Bsr5a1pQ.js} +5 -5
  40. package/dist/assets/SignInScreen-D29YArRQ.js +1 -0
  41. package/dist/assets/SignOutScreen-CkM8N7kI.js +9 -0
  42. package/dist/assets/TaskListScreen-QBxj3x6l.js +9 -0
  43. package/dist/assets/TaskRoutes-CbCeuDZl.js +9 -0
  44. package/dist/assets/TransactionDetailRoutes-B8Gwc4cc.js +1 -0
  45. package/dist/assets/TransactionDetailScreen-BZ1U45_F.js +5 -0
  46. package/dist/assets/{TransactionListRoutes-BhOdNCNy.js → TransactionListRoutes-mnxKDjQ_.js} +1 -1
  47. package/dist/assets/{TreasuryRoutes-BQN9aD4y.js → TreasuryRoutes-Dk7L5dYO.js} +6 -6
  48. package/dist/assets/VendorsRoutes-Brv3hCD7.js +112 -0
  49. package/dist/assets/WiseConfirmationScreen-1oJ6ZH1s.js +12 -0
  50. package/dist/assets/ZeniAccountRoutes-CaJgy_QF.js +57 -0
  51. package/dist/assets/ZeniAccountStatementScreen-Coj3gUoh.js +9 -0
  52. package/dist/assets/{accountMappingHelper-Bg3QrS2B.js → accountMappingHelper-BrnyZK4h.js} +1 -1
  53. package/dist/assets/{analytics-CR-Ji6KN.js → analytics-BoOSk_FS.js} +1 -1
  54. package/dist/assets/{analyticsHelper-BkTwMm2V.js → analyticsHelper-BEsUC0Tf.js} +1 -1
  55. package/dist/assets/{core-B1V19BTM.js → core-4srnP2ry.js} +2 -2
  56. package/dist/assets/{decodeURIComponentSafe-62zSMNJP.js → decodeURIComponentSafe-CVdrGRir.js} +1 -1
  57. package/dist/assets/{dnd-DY5CyMCW.js → dnd-CUjyBBrM.js} +1 -1
  58. package/dist/assets/{empty-DJY9ZnQE.js → empty-BLi0L7W4.js} +1 -1
  59. package/dist/assets/empty-Djhp5I5N.js +1 -0
  60. package/dist/assets/{emptyVideoElement-DyEXr5u4.js → emptyVideoElement-CHvCCbcl.js} +1 -1
  61. package/dist/assets/epic-CAI4UhoR.js +2 -0
  62. package/dist/assets/getLocaleForTenant-BNybPRoM.js +1 -0
  63. package/dist/assets/index-65j4ugfY.js +1 -0
  64. package/dist/assets/{index-B32kgZ2L.js → index-B6rVBPLj.js} +1 -1
  65. package/dist/assets/{empty-BKpizSQk.js → index-BJV7t3Ln.js} +1 -1
  66. package/dist/assets/{index-B1BV6O_s.js → index-C7Pw0HtV.js} +15803 -18137
  67. package/dist/assets/{index-BWk0p_4u.js → index-CSlCNnzL.js} +1 -1
  68. package/dist/assets/{index-Rl-vwFod.js → index-Cd6KSZfb.js} +1 -1
  69. package/dist/assets/{index-CUT1Jf2m.js → index-D2Vz8Hnp.js} +2 -2
  70. package/dist/assets/{index-jGxvchTd.js → index-DF8zTrCI.js} +1 -1
  71. package/dist/assets/{index-BUmr5maU.css → index-R6GjjTB3.css} +1 -1
  72. package/dist/assets/{lexical-DtEMPKph.js → lexical-B1-kkGoh.js} +1 -1
  73. package/dist/assets/{liveblocks-DtJmjn-F.js → liveblocks-FvHIfhey.js} +1 -1
  74. package/dist/assets/{lottie-PNrYlsmY.js → lottie-jiJBGHVV.js} +1 -1
  75. package/dist/assets/{mui-D6ES9V4N.js → mui-BM0jIy5o.js} +1 -1
  76. package/dist/assets/{pathToGoBack-BkwIN_c3.js → pathToGoBack-De4TIG3J.js} +1 -1
  77. package/dist/assets/{pdf-lib-D3JDQVpu.js → pdf-lib-D9nBH3t7.js} +1 -1
  78. package/dist/assets/{pdf-C3786_Gz.js → pdf-whYpMQAC.js} +4 -4
  79. package/dist/assets/{plaid-Cvs9FZAe.js → plaid-mry1J-xa.js} +1 -1
  80. package/dist/assets/{pusher-DQiFD9Ci.js → pusher-DhA-kRSw.js} +1 -1
  81. package/dist/assets/{react-DkNWIPJu.js → react-6uxZfi85.js} +1 -1
  82. package/dist/assets/{react-ZHmjCTUq.js → react-BSvTOr35.js} +1 -1
  83. package/dist/assets/{react-BQWMbpQu.js → react-BmGLt_sB.js} +1 -1
  84. package/dist/assets/{react-nBgf2eOj.js → react-CGiQlkN0.js} +1 -1
  85. package/dist/assets/{react-nsy5XQiM.js → react-Dx6ccGzO.js} +1 -1
  86. package/dist/assets/{react-CTxsS9D9.js → react-ego9yzv1.js} +1 -1
  87. package/dist/assets/{recharts-C_sYuD8f.js → recharts-DVgLcWbN.js} +1 -1
  88. package/dist/assets/{routePaths-BaN0YLzj.js → routePaths-DTTWQHJ_.js} +1 -1
  89. package/dist/assets/{sentry-DJoVhts9.js → sentry-BGmWGtx4.js} +1 -1
  90. package/dist/assets/{url-CZfStJg6.js → url-BrqJU0tJ.js} +1 -1
  91. package/dist/assets/{url-Dh3D7a-t.js → url-BrtamPmb.js} +1 -1
  92. package/dist/assets/{useAiCfoDashboardSuggestedQuestionsChips-B-gQ2ZCu.js → useAiCfoDashboardSuggestedQuestionsChips-DQgVgxsR.js} +1 -1
  93. package/dist/assets/useAskAiCfoHostNavButtonProps-CHKiu4ka.js +1 -0
  94. package/dist/assets/{useDeviceId-zuDOu7ni.js → useDeviceId-BCg9_rD9.js} +1 -1
  95. package/dist/assets/useInitialThreadRequest-H-0PGnfZ.js +1 -0
  96. package/dist/assets/{utils-B1ItiyXC.js → utils-BQpFY40P.js} +2 -2
  97. package/dist/assets/{withTransactionSidePanel-CUAVvG-3.js → withTransactionSidePanel-Cg2hWd8r.js} +4 -4
  98. package/dist/assets/{zeni-epic-state-Ct7fOB-u.js → zeni-epic-state-Cicf7kze.js} +6 -6
  99. package/dist/index.html +1 -1
  100. package/package.json +4 -4
  101. package/dist/assets/AddressRoutes-CMaX3PoD.js +0 -1
  102. package/dist/assets/AddressScreen-C3jTD0QX.js +0 -9
  103. package/dist/assets/AiCfoScreen-BtMMWn6B.js +0 -22
  104. package/dist/assets/BillPayApprovalRoutes-DU855VPd.js +0 -1
  105. package/dist/assets/BusinessVerificationPageScreen-BiME3gzl.js +0 -9
  106. package/dist/assets/CardsAiCfoScreen-Dk4_VP17.js +0 -14
  107. package/dist/assets/ChargeCardRoutes-BozcfSlm.js +0 -71
  108. package/dist/assets/ConnectionAuthScreen-DXqmojb9.js +0 -11
  109. package/dist/assets/CustomerOnboardingAuthScreen-B-ksGe-B.js +0 -1
  110. package/dist/assets/DefaultTenantHome-D8-0czPn.js +0 -1
  111. package/dist/assets/DomesticWireDetailScreen-D62ComgW.js +0 -18
  112. package/dist/assets/DrawerScreen-Bzib8YfV.js +0 -1
  113. package/dist/assets/EntityDetailRoutes-BJQoxnJC.js +0 -1
  114. package/dist/assets/ExpenseAutomationRoutes-BEvk-l6F.js +0 -25
  115. package/dist/assets/FeaturePreviewScreen-KfiUQgFU.js +0 -1
  116. package/dist/assets/HubSpotOAuthCallbackScreen-Cn6vvoeb.js +0 -1
  117. package/dist/assets/MagicLinkSignInScreen-BTFCnths.js +0 -12
  118. package/dist/assets/MobileAppDrawer-DY_LJNf1.js +0 -1
  119. package/dist/assets/NotFoundScreen-98Ef_Sqs.js +0 -1
  120. package/dist/assets/NotificationRoutes-BkpJw4hc.js +0 -1
  121. package/dist/assets/OAuthConsentScreen-GPiaPY5A.js +0 -1
  122. package/dist/assets/PandLWithForecastRoutes-DE9xTiJG.js +0 -1
  123. package/dist/assets/PeopleRoutes--3fASQ5h.js +0 -22
  124. package/dist/assets/PerformanceRoutes-zr7-gR8p.js +0 -1
  125. package/dist/assets/ReferralListScreen-B9-Pm2jb.js +0 -5
  126. package/dist/assets/ReimbursementApprovalRoutes-DgN-DZyX.js +0 -1
  127. package/dist/assets/ReportsRoutes-3IlP_YGU.js +0 -1
  128. package/dist/assets/RewardsRoutes-Bn0Tad-r.js +0 -1
  129. package/dist/assets/ScreenRoutes-BZhSovog.js +0 -2
  130. package/dist/assets/SignInScreen-B7g5AeOc.js +0 -1
  131. package/dist/assets/SignOutScreen-Kk_O7nh6.js +0 -9
  132. package/dist/assets/TaskListScreen-VdSyXs6p.js +0 -9
  133. package/dist/assets/TaskRoutes-BEWp0wJa.js +0 -9
  134. package/dist/assets/TransactionDetailRoutes-DZjZQ9RI.js +0 -1
  135. package/dist/assets/TransactionDetailScreen-idWMKJZo.js +0 -5
  136. package/dist/assets/VendorsRoutes-CavsRr3z.js +0 -112
  137. package/dist/assets/WiseConfirmationScreen-Donx26qC.js +0 -12
  138. package/dist/assets/ZeniAccountRoutes-CYGjvO6a.js +0 -57
  139. package/dist/assets/ZeniAccountStatementScreen-BBbz4J4l.js +0 -9
  140. package/dist/assets/epic-BoLhMkLB.js +0 -2
  141. package/dist/assets/getLocaleForTenant-BaJta4jx.js +0 -1
  142. package/dist/assets/index-C1O76jd1.js +0 -1
  143. package/dist/assets/index-Cd64f4Pj.js +0 -1
  144. package/dist/assets/useAskAiCfoHostNavButtonProps-B1ysHqFw.js +0 -1
  145. package/dist/assets/useInitialThreadRequest-BrZkGF4L.js +0 -1
@@ -1,4 +1,4 @@
1
- import{j as e}from"./liveblocks-DtJmjn-F.js";import{h as L,g as B,u as U,i as V,j as f,N as P,n as O,o as Te,p as k}from"./core-B1V19BTM.js";import{cn as N,eT as D,Pu as R,FB as ae,ft as H,Fj as ne,Pw as we,FE as Ie,Ps as Ce,Pt as se,PM as ke,DL as je,tX as be,Py as Ae,FX as Ee,Pv as re,cP as Z,ya as oe,f8 as ve,fa as De,QG as Fe,QH as Pe,Fk as Le,QI as Be,Fl as Ue,Fu as Re,bt as Me,bF as Ve,cy as Oe,bG as Ne,cm as _e,fs as ze,bs as Ge,La as $e,cl as qe}from"./zeni-epic-state-Ct7fOB-u.js";import{A as _,aq as He,z as A,w as z,e as j,c7 as Ze,c8 as Xe,c9 as q,J as X,m as Je,X as Ke,_ as Qe,a as ie,d as v,D as We,B as Ye,ca as et,at as J,n as tt,cb as at,p as K,cc as nt,R as W,cd as st,a9 as rt}from"./index-B1BV6O_s.js";import{D as ot,n as M,S as it}from"./mui-D6ES9V4N.js";import ct from"./NotFoundScreen-98Ef_Sqs.js";import{S as Y}from"./SetupPagesScreen-CyzzOWiJ.js";import{a as d}from"./sentry-DJoVhts9.js";import{u as lt}from"./useAskAiCfoHostNavButtonProps-B1ysHqFw.js";import{u as ut}from"./useInitialThreadRequest-BrZkGF4L.js";import{M as ce}from"./MobileAppDrawer-DY_LJNf1.js";import{F as dt}from"./FeaturePreviewScreen-KfiUQgFU.js";import{a as ee}from"./analyticsHelper-BkTwMm2V.js";import"./recharts-C_sYuD8f.js";import"./analytics-CR-Ji6KN.js";import"./plaid-Cvs9FZAe.js";import"./dnd-DY5CyMCW.js";import"./stripe-DMRn4zHo.js";import"./lottie-PNrYlsmY.js";import"./lexical-DtEMPKph.js";import"./pdf-C3786_Gz.js";import"./utils-B1ItiyXC.js";import"./routePaths-BaN0YLzj.js";import"./BusinessVerificationPageScreen-BiME3gzl.js";(function(){try{var t=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},a=new t.Error().stack;a&&(t._sentryDebugIds=t._sentryDebugIds||{},t._sentryDebugIds[a]="34b02280-c98e-487a-8d8e-61bf1d2958a5",t._sentryDebugIdIdentifier="sentry-dbid-34b02280-c98e-487a-8d8e-61bf1d2958a5")}catch{}})();const pt=O(function(t,a){const{companyId:n}=a;return{treasurySetupView:R(t,n),analytics:j}},function(t,a){const{navigate:n,analytics:o,treasurySetupView:p}=a;return{onBackClick:()=>{n("../")},onNextClick:()=>{const r=p.fundAllocationLocalData;o.trackTreasuryPortfolioConfirm(r.riskScore,ee(r)),t(Ie(!0))},onUpdateFundAllocation:r=>{o.trackTreasuryAllocationAction("update",ee(r)),t(we(r))}}})(Ze);function mt(){const t=L(),a=B(),n=U(),{tenantEmailDomain:o}=V(),p=_(),r=f(C=>C.treasurySetupViewState.portfolioAllocationUpdateStatus?.fetchState),m=He(r),s=N(p?.loggedInUserRoleMap),[l,i]=d.useState(!1),[g,I]=d.useState(!1),[u,c]=d.useState(!1),h=f(C=>D(C)),y=A.getSignedInUserTenant(o)?.companyId??h.companyId,T=A.getSignedInUser(),S=f(C=>R(C,y)),w=f(C=>C.treasurySetupViewState.fetchState),x=f(C=>C.treasurySetupViewState.currentAllocation.fetchStatus?.fetchState),F=f(C=>C.treasurySetupViewState.treasuryFundsDetails?.fetchStatus?.fetchState);if(T==null)throw Error("Can't access treasury portfolio allocation page without signing in...");if(d.useEffect(()=>{l||w!=="Not-Started"||y==null||(i(!0),n(ae(y,!0,!1)))},[l,w,y,n]),d.useEffect(()=>{u||F!=="Not-Started"||y==null||(c(!0),n(H()))},[u,F,y,n]),d.useEffect(()=>{g||x!=="Not-Started"||y==null||(I(!0),n(ne()))},[g,x,y,n]),d.useEffect(()=>{m==="In-Progress"&&r==="Completed"&&t("../")},[m,r,t]),h.companyTreasuryInfo?.info?.isTreasuryTOSAccepted===!1)return e.jsx(P,{to:"../promo"});const E=h.companyTreasuryInfo?.info?.isTreasuryTOSAccepted!==!0||w!=="Completed";return e.jsxs(e.Fragment,{children:[!E&&e.jsx(z,{analytics:j,onLoad:()=>{}}),e.jsx(pt,{navigate:t,location:a,companyId:y,isEditMode:!0,isLoading:E,isReadOnly:!s,treasurySetupView:S,analytics:j})]})}const ft=O(function(t,a){const n=a.currentTenant?.companyId;return{plaidConnectionDetails:ke(t,n,"zeni_treasury","treasury_setup").plaidConnectionDetails,treasurySetupView:R(t,n)}},function(t,a){const{navigate:n,transferDetails:o,treasurySetupView:p}=a,r=o.treasuryTransferMoneyLocalData,m=p.fundAllocationLocalData;return{onCancelClick:()=>{q(a.analytics,"cancel",r,m,"Transfer"),t(se()),n("../")},onTransferClick:()=>{q(a.analytics,"confirm",r,m,"Transfer"),t(Ee())},onSaveChangesToLocalStore:s=>{t(Ae(s))},onFetchLinkTokenClick:s=>{t(be("treasury_setup",s))},onEstablishConnectionClick:s=>{t(je(s,a.currentTenant?.companyId,"treasury_setup","zeni_treasury"))}}})(Xe),yt=({isFirstTransfer:t})=>{const a=L(),{tenantEmailDomain:n}=V(),o=U(),[p,r]=d.useState(!1),[m,s]=d.useState(!1),[l,i]=d.useState(!1),[g,I]=d.useState(!1),u=f(x=>x.treasurySetupViewState.fetchState),c=f(x=>x.treasurySetupViewState.treasuryFundsDetails?.fetchStatus?.fetchState),h=f(x=>x.treasurySetupViewState.currentAllocation.fetchStatus?.fetchState),y=f(x=>D(x)),T=A.getSignedInUserTenant(n)?.companyId??y.companyId,S=f(x=>Ce(x)),w=f(x=>R(x,T));if(A.getSignedInUser()==null)throw Error("Can't access treasury transfer page without signing in...");return d.useEffect(()=>{m||u!=="Not-Started"||T==null||(s(!0),o(ae(T,!0,!1)))},[m,u,T,o]),d.useEffect(()=>{l||c!=="Not-Started"||T==null||(i(!0),o(H()))},[l,c,T,o]),d.useEffect(()=>{g||h!=="Not-Started"||T==null||(I(!0),o(ne()))},[g,h,T,o]),e.jsxs(e.Fragment,{children:[e.jsx(z,{analytics:j,onLoad:()=>{}}),e.jsx(ft,{analytics:j,navigate:a,transferDetails:S,onAnotherTransferClick:()=>{r(!1),o(se())},currentTenant:y,treasurySetupView:w,showReviewContent:p,maxInsuredAmount:5e5,onReviewClick:()=>{q(j,"review",S.treasuryTransferMoneyLocalData,w.fundAllocationLocalData,"Transfer"),r(!0)},isFirstTransfer:t,setShowReviewContent:r,onBackClick:()=>{}})]})},gt=M.div`
1
+ import{j as e}from"./liveblocks-FvHIfhey.js";import{h as B,g as P,u as U,i as V,j as f,N as L,n as M,o as Te,p as k}from"./core-4srnP2ry.js";import{cm as N,eR as D,Oj as O,En as ae,fj as H,E5 as ne,Ol as we,Eq as Ie,Oh as Ce,Oi as se,OB as ke,Cx as je,tc as be,On as Ee,EJ as Ae,Ok as re,cO as Z,xs as oe,e_ as ve,f0 as De,Pv as Fe,Pw as Le,E6 as Be,Px as Pe,E7 as Ue,Eg as Oe,bt as Re,bF as Ve,cx as Me,bG as Ne,cl as _e,fi as ze,bs as Ge,J_ as $e,ck as qe}from"./zeni-epic-state-Cicf7kze.js";import{k as _,aq as He,z as E,x as z,e as j,c7 as Ze,c8 as Je,c9 as q,J,m as Ke,V as We,Z as Qe,s as ie,d as v,A as Xe,B as Ye,ca as et,at as K,v as tt,cb as at,r as W,cc as nt,p as X,cd as st,a9 as rt}from"./index-C7Pw0HtV.js";import{D as ot,n as R,S as it}from"./mui-BM0jIy5o.js";import ct from"./NotFoundScreen-B1j26TaW.js";import{S as Y}from"./SetupPagesScreen-Bsr5a1pQ.js";import{a as d}from"./sentry-BGmWGtx4.js";import{u as lt}from"./useAskAiCfoHostNavButtonProps-CHKiu4ka.js";import{u as ut}from"./useInitialThreadRequest-H-0PGnfZ.js";import{M as ce}from"./MobileAppDrawer-MkL6Ri_E.js";import{F as dt}from"./FeaturePreviewScreen-nQP4PBuN.js";import{a as ee}from"./analyticsHelper-BEsUC0Tf.js";import"./recharts-DVgLcWbN.js";import"./analytics-BoOSk_FS.js";import"./plaid-mry1J-xa.js";import"./dnd-CUjyBBrM.js";import"./stripe-DMRn4zHo.js";import"./lottie-jiJBGHVV.js";import"./lexical-B1-kkGoh.js";import"./pdf-whYpMQAC.js";import"./utils-BQpFY40P.js";import"./routePaths-DTTWQHJ_.js";import"./BusinessVerificationPageScreen-BVkfBtGX.js";(function(){try{var t=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},a=new t.Error().stack;a&&(t._sentryDebugIds=t._sentryDebugIds||{},t._sentryDebugIds[a]="37d12f4f-47e9-4eb4-af1b-25a90d7e3076",t._sentryDebugIdIdentifier="sentry-dbid-37d12f4f-47e9-4eb4-af1b-25a90d7e3076")}catch{}})();const pt=M(function(t,a){const{companyId:n}=a;return{treasurySetupView:O(t,n),analytics:j}},function(t,a){const{navigate:n,analytics:o,treasurySetupView:p}=a;return{onBackClick:()=>{n("../")},onNextClick:()=>{const r=p.fundAllocationLocalData;o.trackTreasuryPortfolioConfirm(r.riskScore,ee(r)),t(Ie(!0))},onUpdateFundAllocation:r=>{o.trackTreasuryAllocationAction("update",ee(r)),t(we(r))}}})(Ze);function mt(){const t=B(),a=P(),n=U(),{tenantEmailDomain:o}=V(),p=_(),r=f(C=>C.treasurySetupViewState.portfolioAllocationUpdateStatus?.fetchState),m=He(r),s=N(p?.loggedInUserRoleMap),[l,i]=d.useState(!1),[g,I]=d.useState(!1),[u,c]=d.useState(!1),h=f(C=>D(C)),y=E.getSignedInUserTenant(o)?.companyId??h.companyId,T=E.getSignedInUser(),S=f(C=>O(C,y)),w=f(C=>C.treasurySetupViewState.fetchState),x=f(C=>C.treasurySetupViewState.currentAllocation.fetchStatus?.fetchState),F=f(C=>C.treasurySetupViewState.treasuryFundsDetails?.fetchStatus?.fetchState);if(T==null)throw Error("Can't access treasury portfolio allocation page without signing in...");if(d.useEffect(()=>{l||w!=="Not-Started"||y==null||(i(!0),n(ae(y,!0,!1)))},[l,w,y,n]),d.useEffect(()=>{u||F!=="Not-Started"||y==null||(c(!0),n(H()))},[u,F,y,n]),d.useEffect(()=>{g||x!=="Not-Started"||y==null||(I(!0),n(ne()))},[g,x,y,n]),d.useEffect(()=>{m==="In-Progress"&&r==="Completed"&&t("../")},[m,r,t]),h.companyTreasuryInfo?.info?.isTreasuryTOSAccepted===!1)return e.jsx(L,{to:"../promo"});const A=h.companyTreasuryInfo?.info?.isTreasuryTOSAccepted!==!0||w!=="Completed";return e.jsxs(e.Fragment,{children:[!A&&e.jsx(z,{analytics:j,onLoad:()=>{}}),e.jsx(pt,{navigate:t,location:a,companyId:y,isEditMode:!0,isLoading:A,isReadOnly:!s,treasurySetupView:S,analytics:j})]})}const ft=M(function(t,a){const n=a.currentTenant?.companyId;return{plaidConnectionDetails:ke(t,n,"zeni_treasury","treasury_setup").plaidConnectionDetails,treasurySetupView:O(t,n)}},function(t,a){const{navigate:n,transferDetails:o,treasurySetupView:p}=a,r=o.treasuryTransferMoneyLocalData,m=p.fundAllocationLocalData;return{onCancelClick:()=>{q(a.analytics,"cancel",r,m,"Transfer"),t(se()),n("../")},onTransferClick:()=>{q(a.analytics,"confirm",r,m,"Transfer"),t(Ae())},onSaveChangesToLocalStore:s=>{t(Ee(s))},onFetchLinkTokenClick:s=>{t(be("treasury_setup",s))},onEstablishConnectionClick:s=>{t(je(s,a.currentTenant?.companyId,"treasury_setup","zeni_treasury"))}}})(Je),yt=({isFirstTransfer:t})=>{const a=B(),{tenantEmailDomain:n}=V(),o=U(),[p,r]=d.useState(!1),[m,s]=d.useState(!1),[l,i]=d.useState(!1),[g,I]=d.useState(!1),u=f(x=>x.treasurySetupViewState.fetchState),c=f(x=>x.treasurySetupViewState.treasuryFundsDetails?.fetchStatus?.fetchState),h=f(x=>x.treasurySetupViewState.currentAllocation.fetchStatus?.fetchState),y=f(x=>D(x)),T=E.getSignedInUserTenant(n)?.companyId??y.companyId,S=f(x=>Ce(x)),w=f(x=>O(x,T));if(E.getSignedInUser()==null)throw Error("Can't access treasury transfer page without signing in...");return d.useEffect(()=>{m||u!=="Not-Started"||T==null||(s(!0),o(ae(T,!0,!1)))},[m,u,T,o]),d.useEffect(()=>{l||c!=="Not-Started"||T==null||(i(!0),o(H()))},[l,c,T,o]),d.useEffect(()=>{g||h!=="Not-Started"||T==null||(I(!0),o(ne()))},[g,h,T,o]),e.jsxs(e.Fragment,{children:[e.jsx(z,{analytics:j,onLoad:()=>{}}),e.jsx(ft,{analytics:j,navigate:a,transferDetails:S,onAnotherTransferClick:()=>{r(!1),o(se())},currentTenant:y,treasurySetupView:w,showReviewContent:p,maxInsuredAmount:5e5,onReviewClick:()=>{q(j,"review",S.treasuryTransferMoneyLocalData,w.fundAllocationLocalData,"Transfer"),r(!0)},isFirstTransfer:t,setShowReviewContent:r,onBackClick:()=>{}})]})},gt=R.div`
2
2
  display: flex;
3
3
  min-height: 100%;
4
4
  width: 100%;
@@ -6,11 +6,11 @@ import{j as e}from"./liveblocks-DtJmjn-F.js";import{h as L,g as B,u as U,i as V,
6
6
  flex-direction: column;
7
7
  align-items: center;
8
8
  background-color: ${t=>t.theme.colors.grey4};
9
- `,ht={overlayWidth:new We(100,100,48)},St=O(function(t,a){const n=re(t),{companyId:o}=a;return{treasuryDetail:n,treasurySetupView:R(t,o),downloadEndPoint:`${J.bankingMicroServiceBaseUrl}/1.0/treasury-account/statements?query={"statement_type":"tax_statement"}`}},function(t,a){const{navigate:n,currentTenant:o,location:p,handleDrawerToggle:r,analytics:m}=a,{tenantEmailDomain:s}=o;return{onSettingsClick:()=>{m.trackAccountsListPageClicked("Settings Icon"),n("setup")},onReloadTransactions:()=>{t(oe(!0))},handleTreasuryOptionSelection:l=>{let i="page-not-found";l==="editPortfolio"?i=xt(s):l==="statements"?i=Tt(s):l==="taxLetter"?i=wt(s):l==="settings"&&(i=It(s));const g=tt(p.state?.pathnameStackToGoBack,p.pathname);n(i,{state:{pathnameStackToGoBack:g}})},onColumnSortConfigChanged:(l,i)=>{t(Fe({uiState:{sortKey:l,sortOrder:i}}))},onTransferClick:()=>{n("./transfer")},onBackClick:()=>{n("../../")},onClickMenuIcon:()=>{r(!0)},onAutoTransferClick:()=>{n("../../checking/auto-transfer")}}})(et);function $({isTransferDrawerOpen:t,isEditPortfolioDrawerOpen:a}){const n=B(),o=L(),p=U(),r=X(),m=Je(),s=f(b=>D(b)),{tenantEmailDomain:l}=V(),i=s.companyId??A.getSignedInUserTenant(l)?.companyId,[g,I]=d.useState(!1),u=f(b=>re(b)),c=u.fetchState,h=u.accountSummary?.totalBalance?.amount,y=f(b=>b.treasurySetupViewState.treasuryFundsDetails?.fetchStatus),T=s.companyTreasuryInfo?.info?.businessVerificationStatus?.code==="verified",S=_(),w=!!s.companyTreasuryInfo?.info?.isTreasuryTOSAccepted,x=N(S?.loggedInUserRoleMap),F=Z(S?.loggedInUserRoleMap),{areTenantIdsInSync:E}=Ke();d.useEffect(()=>{c==="Not-Started"&&!g&&E&&(I(!0),p(oe(!0)))},[g,p,c,E]),d.useEffect(()=>{u.transactionsFetchState.fetchState==="Completed"&&u.transactions.length===0&&!n.pathname.includes("transfer")&&x&&o("./transfer")},[u.transactionsFetchState.fetchState,u.transactions.length]);const C=()=>{o("..")},[le,ue]=d.useState(!1),Q=b=>{ue(b)},{isAiCfoAccessEnabled:de,onAskAiCfoClick:pe}=lt({mobileExploreReferrer:"Treasury"});Qe({isDataReady:c==="Completed"});const{useFeatureGate:G}=ie(),{isFeatureEnabled:me}=G(v.isDebitCardFeatureEnabled),{isFeatureEnabled:fe}=G(v.isAutoTransferRuleEnabled),{isFeatureEnabled:ye}=G(v.isTreasuryCommentingEnabled),ge=ut(i,{clearParams:c==="Completed"&&y?.fetchState==="Completed"}),he=ve(s),Se=De(me,s);if(he===!0&&Se!==!0)return e.jsx(dt,{});if(T){const b=y?.fetchState!=="Completed"||u.accountSummaryFetchState.fetchState!=="Completed";return e.jsxs(e.Fragment,{children:[u.accountSummaryFetchState.fetchState==="Completed"&&y?.fetchState==="Completed"&&t===!1&&a===!1?e.jsx(z,{analytics:j,onLoad:()=>{}}):null,e.jsx(ot,{onClose:C,anchor:"right",open:a||t,transitionDuration:250,PaperProps:{style:{width:ht.overlayWidth.valuePercentage(r),boxShadow:"none"}},slotProps:{backdrop:{style:{backgroundColor:m.colors.black,opacity:.75,cursor:"pointer"}}},children:e.jsxs(Ct,{onClick:xe=>xe.stopPropagation(),children:[t===!0?e.jsx(yt,{isFirstTransfer:u.transactions.length===0||h===0}):null,a===!0?e.jsx(mt,{}):null]})}),e.jsxs(gt,{windowSize:r,children:[e.jsx(ce,{isAppContentDrawerOpen:le,handleDrawerToggle:Q}),e.jsx(St,{treasuryDetailsView:u,isAutoTransferRuleEnabled:fe,navigate:o,currentTenant:s,location:n,companyId:i,analytics:j,isTreasuryCommentingEnabled:ye,handleDrawerToggle:Q,initialOpenThreadRequest:ge,isLoading:b,isAiCfoAccessEnabled:de,onAskAiCfoClick:pe})]})]})}return w&&x?e.jsx(P,{to:"../setup"}):s.companyTreasuryInfo?.info&&!w&&F?e.jsx(P,{to:"../promo",state:n.state}):e.jsx(Ye,{fetchState:"In-Progress",style:{backgroundColor:m.colors.grey5}})}const xt=t=>`/${t}/treasury/edit-portfolio`,Tt=t=>`/${t}/treasury/statements`,wt=t=>`/${t}/treasury/tax-letter`,It=t=>`/${t}/treasury/setup`,Ct=M(it)`
9
+ `,ht={overlayWidth:new Xe(100,100,48)},St=M(function(t,a){const n=re(t),{companyId:o}=a;return{treasuryDetail:n,treasurySetupView:O(t,o),downloadEndPoint:`${K.bankingMicroServiceBaseUrl}/1.0/treasury-account/statements?query={"statement_type":"tax_statement"}`}},function(t,a){const{navigate:n,currentTenant:o,location:p,handleDrawerToggle:r,analytics:m}=a,{tenantEmailDomain:s}=o;return{onSettingsClick:()=>{m.trackAccountsListPageClicked("Settings Icon"),n("setup")},onReloadTransactions:()=>{t(oe(!0))},handleTreasuryOptionSelection:l=>{let i="page-not-found";l==="editPortfolio"?i=xt(s):l==="statements"?i=Tt(s):l==="taxLetter"?i=wt(s):l==="settings"&&(i=It(s));const g=tt(p.state?.pathnameStackToGoBack,p.pathname);n(i,{state:{pathnameStackToGoBack:g}})},onColumnSortConfigChanged:(l,i)=>{t(Fe({uiState:{sortKey:l,sortOrder:i}}))},onTransferClick:()=>{n("./transfer")},onBackClick:()=>{n("../../")},onClickMenuIcon:()=>{r(!0)},onAutoTransferClick:()=>{n("../../checking/auto-transfer")}}})(et);function $({isTransferDrawerOpen:t,isEditPortfolioDrawerOpen:a}){const n=P(),o=B(),p=U(),r=J(),m=Ke(),s=f(b=>D(b)),{tenantEmailDomain:l}=V(),i=s.companyId??E.getSignedInUserTenant(l)?.companyId,[g,I]=d.useState(!1),u=f(b=>re(b)),c=u.fetchState,h=u.accountSummary?.totalBalance?.amount,y=f(b=>b.treasurySetupViewState.treasuryFundsDetails?.fetchStatus),T=s.companyTreasuryInfo?.info?.businessVerificationStatus?.code==="verified",S=_(),w=!!s.companyTreasuryInfo?.info?.isTreasuryTOSAccepted,x=N(S?.loggedInUserRoleMap),F=Z(S?.loggedInUserRoleMap),{areTenantIdsInSync:A}=We();d.useEffect(()=>{c==="Not-Started"&&!g&&A&&(I(!0),p(oe(!0)))},[g,p,c,A]),d.useEffect(()=>{u.transactionsFetchState.fetchState==="Completed"&&u.transactions.length===0&&!n.pathname.includes("transfer")&&x&&o("./transfer")},[u.transactionsFetchState.fetchState,u.transactions.length]);const C=()=>{o("..")},[le,ue]=d.useState(!1),Q=b=>{ue(b)},{isAiCfoAccessEnabled:de,onAskAiCfoClick:pe}=lt({mobileExploreReferrer:"Treasury"});Qe({isDataReady:c==="Completed"});const{useFeatureGate:G}=ie(),{isFeatureEnabled:me}=G(v.isDebitCardFeatureEnabled),{isFeatureEnabled:fe}=G(v.isAutoTransferRuleEnabled),{isFeatureEnabled:ye}=G(v.isTreasuryCommentingEnabled),ge=ut(i,{clearParams:c==="Completed"&&y?.fetchState==="Completed"}),he=ve(s),Se=De(me,s);if(he===!0&&Se!==!0)return e.jsx(dt,{});if(T){const b=y?.fetchState!=="Completed"||u.accountSummaryFetchState.fetchState!=="Completed";return e.jsxs(e.Fragment,{children:[u.accountSummaryFetchState.fetchState==="Completed"&&y?.fetchState==="Completed"&&t===!1&&a===!1?e.jsx(z,{analytics:j,onLoad:()=>{}}):null,e.jsx(ot,{onClose:C,anchor:"right",open:a||t,transitionDuration:250,PaperProps:{style:{width:ht.overlayWidth.valuePercentage(r),boxShadow:"none"}},slotProps:{backdrop:{style:{backgroundColor:m.colors.black,opacity:.75,cursor:"pointer"}}},children:e.jsxs(Ct,{onClick:xe=>xe.stopPropagation(),children:[t===!0?e.jsx(yt,{isFirstTransfer:u.transactions.length===0||h===0}):null,a===!0?e.jsx(mt,{}):null]})}),e.jsxs(gt,{windowSize:r,children:[e.jsx(ce,{isAppContentDrawerOpen:le,handleDrawerToggle:Q}),e.jsx(St,{treasuryDetailsView:u,isAutoTransferRuleEnabled:fe,navigate:o,currentTenant:s,location:n,companyId:i,analytics:j,isTreasuryCommentingEnabled:ye,handleDrawerToggle:Q,initialOpenThreadRequest:ge,isLoading:b,isAiCfoAccessEnabled:de,onAskAiCfoClick:pe})]})]})}return w&&x?e.jsx(L,{to:"../setup"}):s.companyTreasuryInfo?.info&&!w&&F?e.jsx(L,{to:"../promo",state:n.state}):e.jsx(Ye,{fetchState:"In-Progress",style:{backgroundColor:m.colors.grey5}})}const xt=t=>`/${t}/treasury/edit-portfolio`,Tt=t=>`/${t}/treasury/statements`,wt=t=>`/${t}/treasury/tax-letter`,It=t=>`/${t}/treasury/setup`,Ct=R(it)`
10
10
  display: flex;
11
11
  min-height: 100%;
12
12
  flex-direction: column;
13
- `,kt=M.div`
13
+ `,kt=R.div`
14
14
  display: flex;
15
15
  height: 100vh;
16
16
  width: 100%;
@@ -18,7 +18,7 @@ import{j as e}from"./liveblocks-DtJmjn-F.js";import{h as L,g as B,u as U,i as V,
18
18
  flex-direction: column;
19
19
  align-items: center;
20
20
  background-color: ${t=>t.theme.colors.grey4};
21
- `;function jt(){const t=L(),a=U(),n=X(),o=B(),p=`${J.bankingMicroServiceBaseUrl}/1.0/treasury-account`,[r,m]=d.useState(!1),s=f(c=>Pe(c));d.useEffect(()=>{r||s.fetchState!=="Not-Started"||(m(!0),a(Le(!1)))},[r,s.fetchState,a]);const l=A.getSignedInUser(),i=f(c=>D(c)),g={userId:l?.userId??"",sessionId:l?.zeniSessionId??"",tenantId:i.tenantId??""},I=i.company?.companyInfo.companyLegalName??i.companyName;if(l==null)throw Error("Can't access statements page without signing in...");const u=s.fetchState!=="Completed";return e.jsx(kt,{windowSize:n,children:e.jsx(at,{currentTenantCompanyName:I,statementListView:s,isLoading:u,onBackClick:()=>{const c=K(o.state?.pathnameStackToGoBack),h=c.poppedPathname??"..";t(h,{state:{pathnameStackToGoBack:c.newStack}})},authParams:g,downloadEndPoint:p})})}const bt=M.div`
21
+ `;function jt(){const t=B(),a=U(),n=J(),o=P(),p=`${K.bankingMicroServiceBaseUrl}/1.0/treasury-account`,[r,m]=d.useState(!1),s=f(c=>Le(c));d.useEffect(()=>{r||s.fetchState!=="Not-Started"||(m(!0),a(Be(!1)))},[r,s.fetchState,a]);const l=E.getSignedInUser(),i=f(c=>D(c)),g={userId:l?.userId??"",sessionId:l?.zeniSessionId??"",tenantId:i.tenantId??""},I=i.company?.companyInfo.companyLegalName??i.companyName;if(l==null)throw Error("Can't access statements page without signing in...");const u=s.fetchState!=="Completed";return e.jsx(kt,{windowSize:n,children:e.jsx(at,{currentTenantCompanyName:I,statementListView:s,isLoading:u,onBackClick:()=>{const c=W(o.state?.pathnameStackToGoBack),h=c.poppedPathname??"..";t(h,{state:{pathnameStackToGoBack:c.newStack}})},authParams:g,downloadEndPoint:p})})}const bt=R.div`
22
22
  display: flex;
23
23
  height: 100vh;
24
24
  width: 100%;
@@ -26,7 +26,7 @@ import{j as e}from"./liveblocks-DtJmjn-F.js";import{h as L,g as B,u as U,i as V,
26
26
  flex-direction: column;
27
27
  align-items: center;
28
28
  background-color: ${t=>t.theme.colors.grey4};
29
- `;function At(){const t=L(),a=X(),n=B(),o=U(),p=`${J.bankingMicroServiceBaseUrl}/1.0/treasury-account`,[r,m]=d.useState(!1),s=f(c=>Be(c));d.useEffect(()=>{r||s.fetchState!=="Not-Started"||(m(!0),o(Ue(!1)))},[r,s.fetchState,o]);const l=A.getSignedInUser(),i=f(c=>D(c)),g={userId:l?.userId??"",sessionId:l?.zeniSessionId??"",tenantId:i.tenantId??""},I=i.company?.companyInfo.companyLegalName??i.companyName;if(l==null)throw Error("Can't access tax letter page without signing in...");const u=s.fetchState!=="Completed";return e.jsx(bt,{windowSize:a,children:e.jsx(nt,{currentTenantCompanyName:I,taxLetterListView:s,isLoading:u,onBackClick:()=>{const c=K(n.state?.pathnameStackToGoBack),h=c.poppedPathname??"..";t(h,{state:{pathnameStackToGoBack:c.newStack}})},authParams:g,downloadEndPoint:p})})}const Et=O(function(t,a){const{companyId:n}=a,o=R(t,n);return{treasurySetupView:o,isSetupComplete:o.companyTreasuryInfo?.businessVerificationStatus?.code==="verified",videoUrl:"https://www.youtube.com/watch?v=sqvJWKCMZgk",meetingUrl:"https://meetings.hubspot.com/yoshi-araki/treasury-product-schedule-demo-link?embed=true"}},function(t,a){const{navigate:n,companyId:o}=a;return{onSetupButtonClick:()=>{t(Re(o))},onBackClick:()=>{n("../..",{relative:"path"})},onTreasurySetupSuccess:p=>{n(p?"..":"../setup",{relative:"path"})}}})(st),vt=()=>{const t=L(),a=B(),n=U(),{tenantEmailDomain:o}=V(),[p,r]=d.useState(!1),m=f(S=>D(S)),[s,l]=d.useState(!1),i=f(S=>S.treasurySetupViewState.treasuryFundsDetails?.fetchStatus);d.useEffect(()=>{s||i?.fetchState!=="Not-Started"||g==null||(l(!0),n(H()))},[i,n]);const g=A.getSignedInUserTenant(o)?.companyId??m.companyId,I=A.getSignedInUser(),u=!!m.companyTreasuryInfo?.info?.isTreasuryTOSAccepted,c=S=>{r(S)};if(I==null)throw Error("Can't access treasury promo page without signing in...");const h=_(),y=N(h?.loggedInUserRoleMap),T=Z(h?.loggedInUserRoleMap);if(u&&y)return e.jsx(P,{to:"../../treasury/setup"});if(m.company?.companyTreasuryInfo&&(!u&&y||T)){if(a.state?.message==="activation"){const S=K(a.state?.pathnameStackToGoBack);t(a.pathname,{state:{...a.state,message:void 0,pathnameStackToGoBack:S.newStack}})}return i?.fetchState!=="Completed"?e.jsx(te,{children:e.jsx(W,{size:"ExtraLarge",start:!0})}):e.jsxs(e.Fragment,{children:[e.jsx(z,{analytics:j,onLoad:S=>(w=>w.trackTreasuryPromoView("Treasury Promo Page"))(S)}),e.jsx(ce,{isAppContentDrawerOpen:p,handleDrawerToggle:c}),e.jsx(Et,{analytics:j,navigate:t,companyId:g,onClickMenuIcon:()=>{c(!0)}})]})}return e.jsx(te,{children:e.jsx(W,{size:"ExtraLarge",start:!0})})},te=M.div`
29
+ `;function Et(){const t=B(),a=J(),n=P(),o=U(),p=`${K.bankingMicroServiceBaseUrl}/1.0/treasury-account`,[r,m]=d.useState(!1),s=f(c=>Pe(c));d.useEffect(()=>{r||s.fetchState!=="Not-Started"||(m(!0),o(Ue(!1)))},[r,s.fetchState,o]);const l=E.getSignedInUser(),i=f(c=>D(c)),g={userId:l?.userId??"",sessionId:l?.zeniSessionId??"",tenantId:i.tenantId??""},I=i.company?.companyInfo.companyLegalName??i.companyName;if(l==null)throw Error("Can't access tax letter page without signing in...");const u=s.fetchState!=="Completed";return e.jsx(bt,{windowSize:a,children:e.jsx(nt,{currentTenantCompanyName:I,taxLetterListView:s,isLoading:u,onBackClick:()=>{const c=W(n.state?.pathnameStackToGoBack),h=c.poppedPathname??"..";t(h,{state:{pathnameStackToGoBack:c.newStack}})},authParams:g,downloadEndPoint:p})})}const At=M(function(t,a){const{companyId:n}=a,o=O(t,n);return{treasurySetupView:o,isSetupComplete:o.companyTreasuryInfo?.businessVerificationStatus?.code==="verified",videoUrl:"https://www.youtube.com/watch?v=sqvJWKCMZgk",meetingUrl:"https://meetings.hubspot.com/yoshi-araki/treasury-product-schedule-demo-link?embed=true"}},function(t,a){const{navigate:n,companyId:o}=a;return{onSetupButtonClick:()=>{t(Oe(o))},onBackClick:()=>{n("../..",{relative:"path"})},onTreasurySetupSuccess:p=>{n(p?"..":"../setup",{relative:"path"})}}})(st),vt=()=>{const t=B(),a=P(),n=U(),{tenantEmailDomain:o}=V(),[p,r]=d.useState(!1),m=f(S=>D(S)),[s,l]=d.useState(!1),i=f(S=>S.treasurySetupViewState.treasuryFundsDetails?.fetchStatus);d.useEffect(()=>{s||i?.fetchState!=="Not-Started"||g==null||(l(!0),n(H()))},[i,n]);const g=E.getSignedInUserTenant(o)?.companyId??m.companyId,I=E.getSignedInUser(),u=!!m.companyTreasuryInfo?.info?.isTreasuryTOSAccepted,c=S=>{r(S)};if(I==null)throw Error("Can't access treasury promo page without signing in...");const h=_(),y=N(h?.loggedInUserRoleMap),T=Z(h?.loggedInUserRoleMap);if(u&&y)return e.jsx(L,{to:"../../treasury/setup"});if(m.company?.companyTreasuryInfo&&(!u&&y||T)){if(a.state?.message==="activation"){const S=W(a.state?.pathnameStackToGoBack);t(a.pathname,{state:{...a.state,message:void 0,pathnameStackToGoBack:S.newStack}})}return i?.fetchState!=="Completed"?e.jsx(te,{children:e.jsx(X,{size:"ExtraLarge",start:!0})}):e.jsxs(e.Fragment,{children:[e.jsx(z,{analytics:j,onLoad:S=>(w=>w.trackTreasuryPromoView("Treasury Promo Page"))(S)}),e.jsx(ce,{isAppContentDrawerOpen:p,handleDrawerToggle:c}),e.jsx(At,{analytics:j,navigate:t,companyId:g,onClickMenuIcon:()=>{c(!0)}})]})}return e.jsx(te,{children:e.jsx(X,{size:"ExtraLarge",start:!0})})},te=R.div`
30
30
  display: flex;
31
31
  width: 100%;
32
32
  height: 100%;
@@ -34,4 +34,4 @@ import{j as e}from"./liveblocks-DtJmjn-F.js";import{h as L,g as B,u as U,i as V,
34
34
  justify-content: center;
35
35
  align-items: center;
36
36
  background-color: ${t=>t.theme.colors.grey5};
37
- `;function ea(){const t=B(),a=f(E=>D(E)),{useFeatureGate:n}=ie(),{isFeatureEnabled:o}=n(v.isTreasuryEnabled),p=!!a.company?.companyTreasuryInfo?.isTreasuryTOSAccepted,r=_(),m=Z(r?.loggedInUserRoleMap),s=a?.userRole!=null&&Me(a?.userRole),l=(a?.company==null||a.company.featuresActivationInfo?.isBillPayFeatureEnabled&&!s)&&Ve(r?.loggedInUserRoleMap),i=Oe(r?.loggedInUserRoleMap),g=(a?.company==null||a.company.featuresActivationInfo?.isReimbursementFeatureEnabled&&!s)&&Ne(r?.loggedInUserRoleMap),{isFeatureEnabled:I}=n(v.isDepositAccountsFeatureEnabled),u=I&&!s&&_e(r?.loggedInUserRoleMap),c=a.company!=null&&ze(a.company),h=o&&c===!0&&!s&&N(r?.loggedInUserRoleMap),{isFeatureEnabled:y}=n(v.isChargeCardFeatureEnabled),{isFeatureEnabled:T}=n(v.isDebitCardFeatureEnabled),S=rt(a,y,T)&&!s&&Ge(r?.loggedInUserRoleMap),w=$e(r?.loggedInUserRoleMap),x=qe(r?.loggedInUserRoleMap),F=a.companyTreasuryInfo?.info?.businessVerificationStatus?.code==="verified";return e.jsxs(Te,{children:[x?null:e.jsx(k,{path:"setup",element:e.jsx(Y,{isBillPayAdminLevelAccess:l,isReimbursementAdminLevelAccess:g,isZeniAccountAdminLevelAccess:u,isChargeCardAdminLevelAccess:S,isTreasuryAdminLevelAccess:h,isUserHasOnlyCardAccess:w,isUserHasOnlyBillPayAccess:i,productType:"zeni_treasury",type:"setup"})}),x?null:e.jsx(k,{path:"verification",element:e.jsx(Y,{isBillPayAdminLevelAccess:l,isUserHasOnlyBillPayAccess:i,isReimbursementAdminLevelAccess:g,isZeniAccountAdminLevelAccess:u,isChargeCardAdminLevelAccess:S,isTreasuryAdminLevelAccess:h,isUserHasOnlyCardAccess:w,productType:"zeni_treasury",type:"verification"})}),e.jsx(k,{path:"promo",element:e.jsx(vt,{})}),e.jsx(k,{path:"statements",element:e.jsx(jt,{})}),e.jsx(k,{path:"tax-letter",element:e.jsx(At,{})}),F?e.jsxs(e.Fragment,{children:[e.jsx(k,{path:"/",element:e.jsx($,{isTransferDrawerOpen:!1,isEditPortfolioDrawerOpen:!1})}),h?e.jsxs(e.Fragment,{children:[e.jsx(k,{path:"edit-portfolio",element:e.jsx($,{isEditPortfolioDrawerOpen:!0,isTransferDrawerOpen:!1})}),e.jsx(k,{path:"transfer",element:e.jsx($,{isTransferDrawerOpen:!0,isEditPortfolioDrawerOpen:!1})})]}):null,e.jsx(k,{path:"*",element:e.jsx(ct,{})})]}):p&&h?e.jsx(k,{path:"*",element:e.jsx(P,{to:"../setup"})}):a.company?.companyZeniAccountInfo&&m?e.jsx(k,{path:"*",element:e.jsx(P,{to:"../promo",state:t.state})}):e.jsx(k,{path:"*",element:null})]})}export{ea as default};
37
+ `;function ea(){const t=P(),a=f(A=>D(A)),{useFeatureGate:n}=ie(),{isFeatureEnabled:o}=n(v.isTreasuryEnabled),p=!!a.company?.companyTreasuryInfo?.isTreasuryTOSAccepted,r=_(),m=Z(r?.loggedInUserRoleMap),s=a?.userRole!=null&&Re(a?.userRole),l=(a?.company==null||a.company.featuresActivationInfo?.isBillPayFeatureEnabled&&!s)&&Ve(r?.loggedInUserRoleMap),i=Me(r?.loggedInUserRoleMap),g=(a?.company==null||a.company.featuresActivationInfo?.isReimbursementFeatureEnabled&&!s)&&Ne(r?.loggedInUserRoleMap),{isFeatureEnabled:I}=n(v.isDepositAccountsFeatureEnabled),u=I&&!s&&_e(r?.loggedInUserRoleMap),c=a.company!=null&&ze(a.company),h=o&&c===!0&&!s&&N(r?.loggedInUserRoleMap),{isFeatureEnabled:y}=n(v.isChargeCardFeatureEnabled),{isFeatureEnabled:T}=n(v.isDebitCardFeatureEnabled),S=rt(a,y,T)&&!s&&Ge(r?.loggedInUserRoleMap),w=$e(r?.loggedInUserRoleMap),x=qe(r?.loggedInUserRoleMap),F=a.companyTreasuryInfo?.info?.businessVerificationStatus?.code==="verified";return e.jsxs(Te,{children:[x?null:e.jsx(k,{path:"setup",element:e.jsx(Y,{isBillPayAdminLevelAccess:l,isReimbursementAdminLevelAccess:g,isZeniAccountAdminLevelAccess:u,isChargeCardAdminLevelAccess:S,isTreasuryAdminLevelAccess:h,isUserHasOnlyCardAccess:w,isUserHasOnlyBillPayAccess:i,productType:"zeni_treasury",type:"setup"})}),x?null:e.jsx(k,{path:"verification",element:e.jsx(Y,{isBillPayAdminLevelAccess:l,isUserHasOnlyBillPayAccess:i,isReimbursementAdminLevelAccess:g,isZeniAccountAdminLevelAccess:u,isChargeCardAdminLevelAccess:S,isTreasuryAdminLevelAccess:h,isUserHasOnlyCardAccess:w,productType:"zeni_treasury",type:"verification"})}),e.jsx(k,{path:"promo",element:e.jsx(vt,{})}),e.jsx(k,{path:"statements",element:e.jsx(jt,{})}),e.jsx(k,{path:"tax-letter",element:e.jsx(Et,{})}),F?e.jsxs(e.Fragment,{children:[e.jsx(k,{path:"/",element:e.jsx($,{isTransferDrawerOpen:!1,isEditPortfolioDrawerOpen:!1})}),h?e.jsxs(e.Fragment,{children:[e.jsx(k,{path:"edit-portfolio",element:e.jsx($,{isEditPortfolioDrawerOpen:!0,isTransferDrawerOpen:!1})}),e.jsx(k,{path:"transfer",element:e.jsx($,{isTransferDrawerOpen:!0,isEditPortfolioDrawerOpen:!1})})]}):null,e.jsx(k,{path:"*",element:e.jsx(ct,{})})]}):p&&h?e.jsx(k,{path:"*",element:e.jsx(L,{to:"../setup"})}):a.company?.companyZeniAccountInfo&&m?e.jsx(k,{path:"*",element:e.jsx(L,{to:"../promo",state:t.state})}):e.jsx(k,{path:"*",element:null})]})}export{ea as default};
@@ -0,0 +1,112 @@
1
+ import{j as l}from"./liveblocks-FvHIfhey.js";import{a as g}from"./sentry-BGmWGtx4.js";import{h as J,g as K,i as R,j as S,n as G,u as z,o as at,p as B,N as $}from"./core-4srnP2ry.js";import{eR as V,L0 as be,L1 as Me,fV as X,cs as Ee,ct as Ie,w1 as St,L2 as nt,w5 as zt,J5 as ee,jI as te,v$ as Kt,vV as qt,L3 as Ue,vN as Ht,vM as Qt,vG as Wt,vS as Zt,w6 as Xt,L4 as he,L5 as Ne,vO as ea,L6 as pe,f5 as ft,wl as gt,we as vt,L7 as xt,oO as Tt,w9 as yt,w7 as Dt,L8 as Ct,ws as bt,wp as Et,wa as It,wr as Je,Hv as wt,L9 as ta,La as aa,cv as na,Lb as sa,Lc as oa,Ld as me,Le as ie,Lf as we,J6 as Ge,wH as ye,J4 as De,wu as kt,w2 as $e,Lg as la,J7 as H,Lh as Ye,vY as ia,Li as ca,Lj as da,Lk as ze,Ll as Ke,Lm as qe,Ln as He,wB as ke,Lo as At,wi as Lt,Lp as ra,Lq as ua,Lr as ha,Ls as pa,Lt as ma,Lu as Sa,Lv as fa,Lw as ga,to as va,tp as xa,Ib as Le,Lx as Ta,Ly as ya,j5 as je,bq as Da,Lz as Ca,LA as ba,kG as Ea,kP as Ia,Ia as Fe,bE as st,LB as jt,HN as Ft,LC as wa,LD as ka,LE as Aa,kR as La,LF as ot,LG as lt,LH as it,LI as ct,LJ as ja,kN as Fa,LK as Pa,kQ as _a,LL as Va,LM as Pt,Ix as _t,k4 as Ba,LN as Oa,LO as Pe,LP as Vt,Iv as Bt,yU as Ra,LQ as Ma,LR as Ua,ko as Ot,LS as Na,LT as Ja,IJ as Ga,r4 as $a,LU as Rt,LV as dt,IG as _e,LW as rt,LX as Ya,IL as za,LY as Ka,LZ as qa,L_ as Ha,L$ as Qa,M0 as Wa,r7 as Za,M1 as Xa,J8 as en,M2 as tn,Io as Ve,gR as an,M3 as nn,M4 as sn,gP as on,M5 as ln,M6 as cn,yY as dn,M7 as rn,M8 as un,M9 as hn,Ma as pn,k8 as mn,bn as Sn,f0 as fn,e_ as gn}from"./zeni-epic-state-Cicf7kze.js";import{z as M,aq as Be,B as Mt,x as W,e as L,a2 as Z,aw as vn,v as N,D as Ce,H as ce,ax as Qe,ay as xn,az as Tn,r as We,aA as yn,m as Dn,J as de,A as Ze,s as ae,d as Y,aB as Cn,j as Xe,Z as Se,aC as bn,aD as Ut,V as En,aE as In,k as wn,aF as kn,at as Nt,aG as An,o as Q,S as Ln,C as Jt,E as jn,aH as Fn,aI as Pn,g as et,aJ as _n,aK as Vn,q as Bn,aL as On,aM as Rn}from"./index-C7Pw0HtV.js";import{n as U,D as Mn,S as Gt}from"./mui-BM0jIy5o.js";import{t as Un,A as Nn}from"./AddressScreen-DVPbua-7.js";import le from"./NotFoundScreen-B1j26TaW.js";import{F as Jn}from"./FeaturePreviewScreen-nQP4PBuN.js";import{c as q,v as tt,d as Gn}from"./routePaths-DTTWQHJ_.js";import{p as $t}from"./pathToGoBack-De4TIG3J.js";import{u as fe}from"./useAskAiCfoHostNavButtonProps-CHKiu4ka.js";import{M as ge}from"./MobileAppDrawer-MkL6Ri_E.js";import{D as $n}from"./DrawerScreen-Dcd16rrd.js";import{g as Yn,m as zn}from"./accountMappingHelper-BrnyZK4h.js";import"./recharts-DVgLcWbN.js";import"./analytics-BoOSk_FS.js";import"./plaid-mry1J-xa.js";import"./dnd-CUjyBBrM.js";import"./stripe-DMRn4zHo.js";import"./lottie-jiJBGHVV.js";import"./lexical-B1-kkGoh.js";import"./pdf-whYpMQAC.js";import"./utils-BQpFY40P.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]="1668bbb2-1d0a-4c75-9651-85b30be38e5b",e._sentryDebugIdIdentifier="sentry-dbid-1668bbb2-1d0a-4c75-9651-85b30be38e5b")}catch{}})();const Kn=Ce.getLocalizedStrings(),qn=G(function(e,a){const s=Me(e,a.scheduleTab),t=e.tenantState.currentTenantId;return{authParams:{userId:a.signedInUser.userId??"",sessionId:a.signedInUser.zeniSessionId??"",tenantId:t??""},linkBillExpenseView:s.linkBillExpenseView,transactions:s.linkBillExpenseView.transactions}},function(e,a){const{navigate:s,location:t}=a;return{onTransactionSelect(n){e(nt({selectedTransaction:n}))},onBackClick:()=>{s("..",{relative:"path"})},onCancel(){e(nt({selectedTransaction:void 0})),e(zt()),s("..",{relative:"path"})},onTransactionClick:n=>{const o=`${q(n,a.tenantEmailDomain)}`,c=N(t.state?.pathnameStackToGoBack,t.pathname);s(o,{state:{pathnameStackToGoBack:c}})},onLinkSave(){a.setShouldNavigateBack(!1),e(St(a.scheduleTab,a.scheduleAccruedDetailsView.selectedJEAccruedSchedule?.jeScheduleId))}}})(vn),Hn=({setShouldNavigateBack:e})=>{const a=J(),s=K(),{scheduleDetailId:t,tenantEmailDomain:n}=R(),{scheduleType:o}=R();if(n==null)throw Error("Can't access Link Bill Expense page without tenant Email Domain");const c=S(f=>V(f)),r=be(o)??"accrued_expenses",h=M.getSignedInUser();if(h==null)throw Error("Can't access Link Bill Expensedetail page without signing in...");if(t==null)throw Error("Invalid Schedule Detail Id");const i=S(f=>Me(f,r)),m=i.selectedJELinkRowIndex,d=S(f=>X(f,c.companyId)),u=Be(i.updateStatus.fetchState);g.useEffect(()=>{u==="In-Progress"&&i.updateStatus.fetchState==="Completed"&&a("..",{relative:"path"})},[u,i.updateStatus.fetchState]),g.useEffect(()=>{i.fetchState==="Not-Started"&&a("..",{relative:"path"})},[]),g.useEffect(()=>{i.selectedJEAccruedSchedule!=null&&i.selectedJELinkRowIndex!=null||a("..",{relative:"path"})},[i.selectedJEAccruedSchedule,i.selectedJELinkRowIndex]);const p=i.linkBillExpenseView.fetchState==="Completed";return l.jsx(l.Fragment,{children:i.linkBillExpenseView.fetchState==="In-Progress"?l.jsx(Mt,{fetchState:i.linkBillExpenseView.fetchState}):i.selectedJEAccruedSchedule!=null&&m!=null?l.jsxs(l.Fragment,{children:[p===!0?l.jsx(W,{analytics:L,onLoad:()=>{Qn(i,r,d)}}):null,l.jsx(qn,{signedInUser:h,attachmentEndPoint:`${Z}/vendor_attachments`,setShouldNavigateBack:e,scheduleVendorId:i.selectedJEAccruedSchedule.vendor.id??"",location:s,tenantEmailDomain:n,scheduleAccruedDetailsView:i,saveFetchState:i.updateStatus.fetchState,scheduleTab:r,navigate:a,analytics:L,controllerUserDetails:d,saveStatus:i.updateStatus.fetchState,jeAccruedSchedule:i.selectedJEAccruedSchedule,localData:i.scheduleAccruedDetailsLocalData.jeScheduleDetails[m]})]}):null})},Yt=e=>{const a=Kn.dateFormat.analytics.YYYYDashMMDashDDFormat;return{scheduleCreateDate:e.createTime.format(a)??null,scheduleMonthlyAmount:e.recurringAmount??null,startingBalance:e.otherAttributes.startingBalance??null,scheduleAccountCategory:e.jeCredit.account?.accountName??null,description:e.memo,runningBalance:e.balanceAsOfToday??null,currentBalance:e.balanceAsOfToday??null,currentStatus:e.status.label,period:e.period??null,startMonth:e.startDate?.format(a)??null,endMonth:e.endDate?.format(a)??null}},Qn=(e,a,s)=>{const t=e.selectedJEAccruedSchedule,n=e.selectedJELinkRowIndex;let o;n!=null&&t!=null&&(o=t.scheduledJournalEntry[n]);const{transactions:c}=e.linkBillExpenseView,r=c.some(m=>m.isRecommendedTransaction===!0),h=Ee(s.controllers),i=Ie(s.controllerUserIds);t!=null&&L.trackScheduleAccruedDetailsJournalEntryLinkedLoaded({scheduleType:a,schedule:{...Yt(t)},scheduleExpenseCategoryAndClass:{expenseCategory:t.jeDebit.account?.accountName??null,expenseClass:t.jeDebit.accountingClass?.className??null},journalEntryDetails:{wasRecommendationAvailable:r,journalEntryPostingStatus:o?.status.label??""},vendorName:t.vendor.name??null,controllerEmails:h,controllerUserIds:i})},Wn=U.div`
2
+ display: flex;
3
+ min-height: 100%;
4
+ width: 100%;
5
+ flex: 1 0 auto;
6
+ flex-direction: column;
7
+ align-items: center;
8
+ background-color: ${e=>e.theme.colors.grey4};
9
+ `,Zn=G(function(e){const a=V(e),s=e.entityAutoCompleteState.autoCompleteText.common,t=Ue(e,"common");return{tenantName:a.companyName,vendorSearchAutoCompleteData:{autoCompleteText:s,entityAutoCompleteView:t}}},function(e,a){const{navigate:s,location:t}=a,n="accrued_expenses";return{onNavigateBack:()=>{s("../schedules/accrued_expenses")},onZeniLogoClick:()=>{a.themeState.toggle()},onSave:o=>{a.setShouldNavigateBack(!0),e(St(n,o))},onDelete:o=>{e(ea(n,o))},vendorSearchAutoCompleteActions:{onAutoCompleteInputChange:(o,c)=>{o.trim().length>=2?e(Ne({searchString:o,entityType:c,searchOrigin:"common"})):o.trim().length===0&&e(he("common"))},onCancelAutoComplete:()=>{e(he("common"))}},onEditAmount:(o,c)=>{e(Xt(n,o,c))},onJELinkClick:o=>{e(Zt({selectedJELinkRowIndex:o})),s("./edit_link")},onCancelAccrual:(o,c,r)=>{e(Wt(o,c,r))},onTransactionClick:o=>{const c=`${q(o,a.tenantEmailDomain)}`,r=N(t.state?.pathnameStackToGoBack,t.pathname);s(c,{state:{pathnameStackToGoBack:r}})},onViewPostedJE:o=>{const c=`${q(o,a.tenantEmailDomain)}`,r=N(t.state?.pathnameStackToGoBack,t.pathname);s(c,{state:{pathnameStackToGoBack:r}})},onViewRecordedJE:o=>{const c=`${q(o,a.tenantEmailDomain)}`,r=N(t.state?.pathnameStackToGoBack,t.pathname);s(c,{state:{pathnameStackToGoBack:r}})},onViewBillExpense:o=>{const c=`${q(o,a.tenantEmailDomain)}`,r=N(t.state?.pathnameStackToGoBack,t.pathname);s(c,{state:{pathnameStackToGoBack:r}})},onDetailPageChange:(o,c,r)=>{const{scheduleDetailsAccruedExpensesSection:h}=o,{amount:i,memo:m,months:d,scheduleAccruedExpenseCategory:u,scheduleClass:p,scheduleExpenseCategory:f,startDate:D,vendor:x}=h,E=p.selectedOption!=null?a.classList.find(I=>I.classId===p.selectedOption):void 0,C=f.selectedOption!=null?a.accountList.find(I=>I.qboId===f.selectedOption):void 0,b=u.selectedOption!=null?a.accruedAccountList.find(I=>I.qboId===u.selectedOption):void 0,k=d?.selectedOption;e(Ht({scheduleType:n,localData:c,selectedJeScheduleDetailId:a.scheduleDetailId})),r!==!1||a.scheduleDetailId!=null||C?.accountId==null||a.isAccountingClassesEnabled!==!1&&E?.classId==null||b==null||x.selectedOption==null||m==null||i==null&&i==0||D==null||k==null||e(Qt({scheduleType:n}))}}})(xn),Xn=({shouldNavigateBack:e,setShouldNavigateBack:a})=>{const s=J(),t=K(),n=z(),o=ce(),{tenantEmailDomain:c}=R(),[r,h]=g.useState(!1);if(c==null)throw new Error("Can't access this page without a tenantEmailDomain");const{scheduleDetailId:i}=R();let m;i!=="new"&&(m=i);const d=es(i),u=S(y=>y.scheduleAccruedDetailState.selectedJEAccruedScheduleKey),p="accrued_expenses",f=S(y=>Me(y,"accrued_expenses")),D=S(y=>ee(y)),x=S(y=>y.classListState.fetchState),E=S(y=>te(y)),C=D!=="Completed"||x!=="Completed";g.useEffect(()=>{r===!1&&C?(n(Kt(p,m)),h(!0)):C===!1&&r===!1&&i!=="new"&&(n(qt(p,i)),h(!0))},[r]);const b=S(y=>V(y)),k=S(y=>X(y,b.companyId)),I=f.fetchState,w=f.allAccountList,P=f.allClassList,j=f.allAccruedAccountList,_=f.scheduleAccruedDetailsLocalData;if(d!==!0||f.fetchState==="Error")return l.jsx(le,{});const A=I==="Completed"&&r===!0;return I!=="Completed"&&I!=="Not-Started"?l.jsx(Qe,{}):l.jsxs(Wn,{children:[A===!0?l.jsx(W,{analytics:L,onLoad:()=>{ts(f,p,k)}}):null,l.jsx(Zn,{setShouldNavigateBack:a,scheduleAccruedDetailsView:f,location:t,navigate:s,classList:P,accountList:w,shouldNavigateBack:e,accruedAccountList:j,scheduleLocalData:_,selectedJEScheduleKey:u,scheduleDetailId:m,selectedScheduledJournalEntries:f.selectedJEAccruedSchedule?.scheduledJournalEntry??[],themeState:o,tenantEmailDomain:c,analytics:L,controllerUserDetails:k,isAccountingClassesEnabled:E,status:f.selectedJEAccruedSchedule?.status.code})]})},es=e=>e!=null,ts=(e,a,s)=>{const t=e.selectedJEAccruedSchedule,n=Ee(s.controllers),o=Ie(s.controllerUserIds);t!=null&&L.trackScheduleAccruedDetailsLoaded({scheduleType:a,scheduleExpenseCategoryAndClass:{expenseCategory:t.jeDebit.account?.accountName??null,expenseClass:t.jeDebit.accountingClass?.className??null},schedule:{...Yt(t)},vendorName:t.vendor.name??null,controllerEmails:n,controllerUserIds:o})},as=U.div`
10
+ display: flex;
11
+ min-height: 100%;
12
+ width: 100%;
13
+ flex: 1 0 auto;
14
+ flex-direction: column;
15
+ align-items: center;
16
+ background-color: ${e=>e.theme.colors.grey4};
17
+ `,Oe=Ce.getLocalizedStrings().dateFormat.analytics.YYYYDashMMDashDDFormat,ns=G(function(e){const a=V(e),s=pe(e,"fixed_assets");return{tenantName:a.companyName,scheduleDetailsView:s}},function(e,a){const{navigate:s,location:t,vendorSearchAutoCompleteData:n,selectedScheduledJournalEntries:o}=a,c="fixed_assets",r=t.state?.message==="expenseAutomation",h=o.flatMap(i=>i.error).filter(i=>!!i)??[];return{onNavigateBack:()=>{if(r===!0){const i=We(a.location.state?.pathnameStackToGoBack),m=i.poppedPathname??$t(2);a.navigate(m,{state:{pathnameStackToGoBack:i.newStack}})}else s("../schedules/fixed_assets")},onZeniLogoClick:()=>{a.themeState.toggle()},onSave:i=>{e(Je(c,i,h.length>0))},onDelete:i=>{e(It(c,i))},onMarkAsComplete:()=>{a.selectedJEScheduleKey!=null&&e(Et(c,a.selectedJEScheduleKey))},onEditAmount:(i,m)=>{e(bt(c,i,m))},onJELinkClick:i=>{e(Ct({selectedJELinkRowIndex:i})),s("./edit_link")},onTransactionClick:i=>{const m=`${q(i,a.tenantEmailDomain)}`,d=N(t.state?.pathnameStackToGoBack,t.pathname);s(m,{state:{pathnameStackToGoBack:d,message:"comingFromScheduleDetailsFixedAssets"}})},onViewLinkedJE:i=>{const m=`${q(i,a.tenantEmailDomain)}`,d=N(t.state?.pathnameStackToGoBack,t.pathname);s(m,{state:{pathnameStackToGoBack:d}})},vendorSearchAutoCompleteActions:{onAutoCompleteInputChange:(i,m)=>{i.trim().length>=2?e(Ne({searchString:i,entityType:m,searchOrigin:"common"})):i.trim().length===0&&e(he("common"))},onCancelAutoComplete:()=>{e(he("common"))}},onDetailPageChange:(i,m)=>{const{scheduleDetailsFixedAssetsSection:d,scheduleDetailsListSection:u}=i,{scheduleClass:p,scheduleExpenseCategory:f,accumulatedDepreciationCategory:D,assetId:x,months:E,startDate:C,postingDate:b,vendor:k}=d,I=n.entityAutoCompleteView.vendor.length>0?n.entityAutoCompleteView.vendor.find(v=>v.id===k?.selectedOption):void 0,w={id:I?.zeniId??k?.selectedOption??"",name:I?.name??k?.defaultOptions.find(v=>v.value===k?.selectedOption)?.label??"",logo:I?.logo},P=p.selectedOption!=null?a.classList.find(v=>v.classId===p.selectedOption):void 0,j=f.selectedOption!=null?a.accountList.find(v=>v.qboId===f.selectedOption):void 0,_=D.selectedOption!=null?a.depAccountList.find(v=>v.qboId===D.selectedOption):void 0,A=E?.selectedOption,y=u.map((v,re)=>({...a.scheduleLocalData.jeScheduleDetails[re],amount:{...a.scheduleLocalData.jeScheduleDetails[re].amount,amount:v.amount}})),F=b.type==="day"?b.dayOfMonth?b.dayOfMonth:1:void 0,T=b.type==="lastDayOfMonth"||void 0;e(yt({scheduleType:c,localData:{selectedAccount:j?.accountId,selectedClass:P?.classId,selectedAccumulatedDepreciationCategory:_?.accountId,selectedDate:C,selectedMonths:A,assetId:x,jeScheduleDetails:y,lastDayOfMonth:T,selectedDayOfMonth:F,selectedVendor:w},selectedJeScheduleDetailId:a.scheduleDetailId})),m!==!1||_?.accountId==null||a.scheduleDetailId!=null&&a.status!=="draft"&&a.status!=="marked_as_completed"||j?.accountId==null||a.isAccountingClassesEnabled!==!1&&P?.classId==null||C==null||A==null||T!==!0&&F==null||e(Dt({scheduleType:c}))}}})(Tn),ss=()=>{const e=J(),a=K(),s=z(),t=ce(),{tenantEmailDomain:n}=R(),[o,c]=g.useState(!1),{scheduleDetailId:r}=R(),h=a.state?.message==="expenseAutomation",i=os(r),m=S(T=>T.scheduleDetailState.selectedJEScheduleKey);g.useEffect(()=>{m!=null&&m.length!==0||r!=="new"||e("../schedules/fixed_assets")},[m,r]);const d="fixed_assets",u=S(T=>pe(T,d)),p=S(T=>T.entityAutoCompleteState.autoCompleteText.common),f=S(T=>Ue(T,"common")),D=S(T=>ee(T)),x=S(T=>T.classListState.fetchState),E=S(T=>te(T)),C=S(T=>ft(T).selectedPeriod),b=D!=="Completed"||x!=="Completed";g.useEffect(()=>{o===!1&&b?(s(gt(d,y,!0)),c(!0)):b===!1&&o===!1&&(s(vt(d,r==="new"?void 0:r,!0)),c(!0))},[o]),g.useEffect(()=>{if(u.markAsCompleteStatus.fetchState==="Completed")if(s(xt()),h===!0){const{month:T,year:v}=C;e(`../../month_end_close_checks/review/je_schedules/${T}-${v}`)}else e("../schedules/fixed_assets")},[u.markAsCompleteStatus.fetchState]);const k=S(T=>V(T)),I=S(T=>X(T,k.companyId)),w=u.fetchState,P=u.allAccountList,j=u.allClassList,_=u.allDepreciationAccountList,A=u.scheduleDetailsLocalData.fixed_assets;let y;if(r!=="new"&&(y=r),i!==!0||u.fetchState==="Error")return l.jsx(le,{});const F=w==="Completed"&&o===!0;return w!=="Completed"?l.jsx(Qe,{}):l.jsxs(as,{children:[F===!0?l.jsx(W,{analytics:L,onLoad:()=>{is(u,d,I)}}):null,l.jsx(ns,{location:a,navigate:e,classList:j,vendorSearchEntityAutoCompleteView:f,vendorSearchAutoCompleteData:{autoCompleteText:p,entityAutoCompleteView:f},expenseAutomationSelectedPeriod:C,usedInExpenseAutomation:h,removeJeScheduleTransactionKey:(T,v)=>{s(Tt(T,v))},accountList:P,depAccountList:_,scheduleLocalData:A,selectedJEScheduleKey:m,scheduleDetailId:y,selectedScheduledJournalEntries:u.selectedJEScheduleTransaction?.scheduledJournalEntry??[],themeState:t,tenantEmailDomain:n,analytics:L,controllerUserDetails:I,isAccountingClassesEnabled:E,status:u.selectedJEScheduleTransaction?.status.code})]})},os=e=>e!=null,ls=e=>({transactionDate:e.date.format(Oe),transactionAmount:e.amount,scheduleCategory:e.account.accountName,scheduleClass:e.classBase?.className??null,description:e.memo}),is=(e,a,s)=>{const t=e.selectedJEScheduleTransaction?.baseTransaction,n=e.selectedJEScheduleTransaction,o=Ee(s.controllers),c=Ie(s.controllerUserIds);var r;t!=null&&n!=null&&L.trackScheduleDetailsLoaded({scheduleType:a,transaction:{...ls(t)},scheduleExpenseCategoryAndClass:{expenseCategory:n.jeDebit.account?.accountName??null,expenseClass:n.jeDebit.accountingClass?.className??null},scheduledTransaction:{...(r=n,{currentBalance:r.balanceAsOfToday??null,currentStatus:r.status.label,period:r.period??null,startMonth:r.startDate?.format(Oe)??null,endMonth:r.endDate?.format(Oe)??null})},vendorName:n.vendor.name??null,fixedAssetsDetails:{accumulatedDepreciationCategory:n.jeCredit.account?.accountName??null,assetId:n.otherAttributes.assetId??null},controllerEmails:o,controllerUserIds:c})},cs=U.div`
18
+ display: flex;
19
+ min-height: 100%;
20
+ width: 100%;
21
+ flex: 1 0 auto;
22
+ flex-direction: column;
23
+ align-items: center;
24
+ background-color: ${e=>e.theme.colors.grey4};
25
+ `,Re=Ce.getLocalizedStrings().dateFormat.analytics.YYYYDashMMDashDDFormat,ds=G(function(e,a){const s=V(e),t=pe(e,a.scheduleTab);return{tenantName:s.companyName,scheduleDetailsView:t}},function(e,a){const{navigate:s,location:t,usedInExpenseAutomation:n,vendorSearchAutoCompleteData:o,selectedScheduledJournalEntries:c}=a,r=c.flatMap(h=>h.error).filter(h=>!!h)??[];return{onNavigateBack:()=>{if(n===!0){const h=We(a.location.state?.pathnameStackToGoBack),i=h.poppedPathname??$t(2);a.navigate(i,{state:{pathnameStackToGoBack:h.newStack}})}else s("../schedules/prepaid_expenses")},onZeniLogoClick:()=>{a.themeState.toggle()},onSave:h=>{e(Je(a.scheduleTab,h,r.length>0))},onDelete:h=>{e(It(a.scheduleTab,h))},onMarkAsComplete:()=>{a.selectedJEScheduleKey!=null&&e(Et(a.scheduleTab,a.selectedJEScheduleKey))},onEditAmount:(h,i)=>{e(bt(a.scheduleTab,h,i))},onJELinkClick:h=>{e(Ct({selectedJELinkRowIndex:h})),s("./edit_link")},onTransactionClick:h=>{const i=`${q(h,a.tenantEmailDomain)}`,m=N(t.state?.pathnameStackToGoBack,t.pathname);s(i,{state:{pathnameStackToGoBack:m,message:"comingFromScheduleDetails"}})},onViewLinkedJE:h=>{const i=`${q(h,a.tenantEmailDomain)}`,m=N(t.state?.pathnameStackToGoBack,t.pathname);s(i,{state:{pathnameStackToGoBack:m}})},vendorSearchAutoCompleteActions:{onAutoCompleteInputChange:(h,i)=>{h.trim().length>=2?e(Ne({searchString:h,entityType:i,searchOrigin:"common"})):h.trim().length===0&&e(he("common"))},onCancelAutoComplete:()=>{e(he("common"))}},onDetailPageChange:(h,i)=>{const{scheduleDetailsSection:m,scheduleDetailsListSection:d}=h,{scheduleClass:u,scheduleExpenseCategory:p,months:f,startDate:D,postingDate:x,vendor:E}=m,C=o.entityAutoCompleteView.vendor.length>0?o.entityAutoCompleteView.vendor.find(y=>y.id===E?.selectedOption):void 0,b={id:C?.zeniId??E?.selectedOption??"",name:C?.name??E?.defaultOptions.find(y=>y.value===E?.selectedOption)?.label??"",logo:C?.logo},k=u.selectedOption!=null?a.classList.find(y=>y.classId===u.selectedOption):void 0,I=p.selectedOption!=null?a.accountList.find(y=>y.qboId===p.selectedOption):void 0,w=f?.selectedOption,P=d.map((y,F)=>({...a.scheduleLocalData.jeScheduleDetails[F],amount:{...a.scheduleLocalData.jeScheduleDetails[F].amount,amount:y.amount}})),j=x.type==="day"?x.dayOfMonth?x.dayOfMonth:1:void 0,_=x.type==="lastDayOfMonth"||void 0,A={selectedAccount:I?.accountId,selectedClass:k?.classId,selectedDate:D,selectedMonths:w,jeScheduleDetails:P,lastDayOfMonth:_,selectedVendor:b,selectedDayOfMonth:j};e(yt({scheduleType:a.scheduleTab,localData:A,selectedJeScheduleDetailId:a.scheduleDetailId})),i!==!1||a.scheduleDetailId!=null&&a.status!=="draft"&&a.status!=="marked_as_completed"||I?.accountId==null||a.isAccountingClassesEnabled!==!1&&k?.classId==null||D==null||w==null||_!==!0&&j==null||e(Dt({scheduleType:a.scheduleTab}))}}})(yn),rs=()=>{const e=J(),a=K(),s=z(),t=ce(),{tenantEmailDomain:n}=R(),[o,c]=g.useState(!1),r=a.state?.message==="expenseAutomation",{scheduleType:h,scheduleDetailId:i}=R(),m=us(h,i),d=S(T=>T.scheduleDetailState.selectedJEScheduleKey);g.useEffect(()=>{d!=null&&d.length!==0||i!=="new"||e("../schedules/prepaid_expenses")},[d,i]);const u=be(h)??"prepaid_expenses",p=S(T=>pe(T,u)),f=S(T=>T.entityAutoCompleteState.autoCompleteText.common),D=S(T=>Ue(T,"common")),x=S(T=>ee(T)),E=S(T=>T.classListState.fetchState),C=S(T=>te(T)),b=S(T=>ft(T).selectedPeriod),k=x!=="Completed"||E!=="Completed";g.useEffect(()=>{o===!1&&k?(s(gt(u,y,!0)),c(!0)):k===!1&&o===!1&&(s(vt(u,i==="new"?void 0:i,!0)),c(!0))},[o]),g.useEffect(()=>{if(p.markAsCompleteStatus.fetchState==="Completed")if(s(xt()),r===!0){const{month:T,year:v}=b;e(`../../month_end_close_checks/review/je_schedules/${T}-${v}`)}else e("../schedules/prepaid_expenses")},[p.markAsCompleteStatus.fetchState]);const I=S(T=>V(T)),w=S(T=>X(T,I.companyId)),P=p.fetchState,j=p.allAccountList,_=p.allClassList,A=p.scheduleDetailsLocalData;let y;if(i!=="new"&&(y=i),m!==!0||p.fetchState==="Error")return l.jsx(le,{});const F=P==="Completed"&&o===!0;return P!=="Completed"?l.jsx(Qe,{}):l.jsxs(cs,{children:[F===!0?l.jsx(W,{analytics:L,onLoad:()=>{ps(p,u,w)}}):null,l.jsx(ds,{location:a,vendorSearchEntityAutoCompleteView:D,vendorSearchAutoCompleteData:{autoCompleteText:f,entityAutoCompleteView:D},usedInExpenseAutomation:r,removeJeScheduleTransactionKey:(T,v)=>{s(Tt(T,v))},expenseAutomationSelectedPeriod:b,navigate:e,classList:_,accountList:j,scheduleLocalData:A[u],selectedJEScheduleKey:d,scheduleDetailId:y,selectedScheduledJournalEntries:p.selectedJEScheduleTransaction?.scheduledJournalEntry??[],themeState:t,tenantEmailDomain:n,scheduleTab:u,analytics:L,controllerUserDetails:w,isAccountingClassesEnabled:C,status:p.selectedJEScheduleTransaction?.status.code})]})},us=(e,a)=>be(e)!=null&&a!=null,hs=e=>({transactionDate:e.date.format(Re),transactionAmount:e.amount,scheduleCategory:e.account.accountName,scheduleClass:e.classBase?.className??null,description:e.memo}),ps=(e,a,s)=>{const t=e.selectedJEScheduleTransaction?.baseTransaction,n=e.selectedJEScheduleTransaction,o=Ee(s.controllers),c=Ie(s.controllerUserIds);var r;t!=null&&n!=null&&L.trackScheduleDetailsLoaded({scheduleType:a,transaction:{...hs(t)},scheduleExpenseCategoryAndClass:{expenseCategory:n.jeDebit.account?.accountName??null,expenseClass:n.jeDebit.accountingClass?.className??null},scheduledTransaction:{...(r=n,{currentBalance:r.balanceAsOfToday??null,currentStatus:r.status.label,period:r.period??null,startMonth:r.startDate?.format(Re)??null,endMonth:r.endDate?.format(Re)??null})},vendorName:n.vendor.name??null,controllerEmails:o,controllerUserIds:c})},ms={drawerLeftMargin:new Ze(0,0,100,200)},Ss=G(function(e,a){const{jeScheduledTransaction:s,selectedJERow:t,scheduleType:n,isVendorBulkUpdateOnTransactionEnabled:o}=a,{scheduleDetailsLocalData:c,updateStatus:r}=pe(e,a.scheduleType),h=V(e),i=c[n].jeScheduleDetails[t].jeLink,m=i.type==="recommended"?i.recommendedTransactionID:i.transactionDetailID,d=m!=null?aa(e,m):void 0,u=M.getSignedInUser(),p=e.tenantState.currentTenantId,f={userId:u?.userId??"",sessionId:u?.zeniSessionId??"",tenantId:h.tenantId??p},D=h?.company?.companyInfo?.firstMonthOfFY??1;return{jeScheduledTransaction:s,transactionDetail:d,localData:c[n].jeScheduleDetails[t],saveStatus:r.fetchState,authParams:f,isVendorBulkUpdateOnTransactionEnabled:o,firstMonthOfFY:D,isDisabled:r.fetchState==="In-Progress"?"readonly":void 0,analytics:L,qboAppUrl:na(Xe.qboRedirectionUrl)}},function(e,a){const{selectedJERow:s,jeScheduleDetailId:t,navigate:n}=a;return{onUpdateLocalData:o=>{const c=o.linkJETransaction.qboURL;c!=null&&e(oa({scheduleType:a.scheduleType,jeScheduleDetailId:t,rowId:s,jeLink:c}))},onFetchTransactionClick:o=>{e(wt(o))},onSaveClick:()=>{e(Je(a.scheduleType,t))},onBackClick:()=>{n("..",{relative:"path"})},onCancelClick:()=>{const o=a.jeScheduledTransaction.scheduledJournalEntry[s];e(sa({scheduleType:a.scheduleType,jeScheduleDetailId:t,rowId:s,originalScheduledJE:o})),n("..",{relative:"path"})}}})(Cn),fs=()=>{const e=Dn(),a=J(),s=z(),{scheduleDetailId:t}=R(),n=de(),o=ms.drawerLeftMargin.valuePx(n),{scheduleType:c}=R(),{useFeatureGate:r}=ae(),{isFeatureEnabled:h}=r(Y.isVendorBulkUpdateOnTransactionEnabled),i=be(c)??"prepaid_expenses",[m,d]=g.useState(!1);if(M.getSignedInUser()==null)throw Error("Can't access Account detail page without signing in...");if(t==null)throw Error("Invalid Schedule Detail Id");const u=S(C=>pe(C,i));g.useEffect(()=>{u.fetchState==="Not-Started"&&a("..",{relative:"path"})},[]);const p=u.selectedJELinkRowIndex,f=p!=null?u.scheduleDetailsLocalData[i].jeScheduleDetails[p]?.jeLink:null,D=f?.type==="recommended"?f.recommendedTransactionID:f?.transactionDetailID;g.useEffect(()=>{D!=null&&s(wt(D))},[]),g.useEffect(()=>{f?.type==="recommended"&&m===!1&&p!=null&&(d(!0),s(ta({scheduleType:i,jeScheduleDetailId:t,rowId:p})))});const x=S(C=>V(C)),E=S(C=>X(C,x.companyId));return l.jsx(Mn,{anchor:"right",open:!0,PaperProps:{style:{width:`calc(100% - ${o})`,boxShadow:"none"}},slotProps:{backdrop:{style:{backgroundColor:e.colors.black,opacity:.75,cursor:"pointer"}}},onClose:()=>a("..",{relative:"path"}),children:l.jsx(gs,{onClick:C=>C.stopPropagation(),children:u.fetchState!=="Completed"||u.selectedJEScheduleTransaction==null||p==null?l.jsx(Mt,{fetchState:u.fetchState}):l.jsx(Ss,{scheduleType:i,jeScheduleDetailId:t,selectedJERow:p,jeScheduledTransaction:u.selectedJEScheduleTransaction,isCOTEnabled:!1,navigate:a,scheduleTab:i,controllerUserDetails:E,isVendorBulkUpdateOnTransactionEnabled:h})})})},gs=U(Gt)`
26
+ display: flex;
27
+ min-height: 100%;
28
+ flex-direction: column;
29
+ `,ve=e=>{switch(e){case"vendors_tab":return"../summary";case"filing_1099":return"../filing_1099";case"prepaid_expenses":return"../schedules/prepaid_expenses";case"fixed_assets":return"../schedules/fixed_assets";case"accrued_expenses":return"../schedules/accrued_expenses";default:return"../opex"}},xe=e=>{switch(e){case"prepaid_expenses":return"prepaid_expenses";case"fixed_assets":return"fixed_assets";case"accrued_expenses":return"accrued_expenses";case"operating_expenses_by_vendor":return"operating_expenses";default:return"vendors_list"}},Te=()=>{const e=K(),a=z(),s=S(t=>me(t));return g.useEffect(()=>{const t=e.pathname.split("/").pop();if(t!=null){const n=(o=>{switch(o){case"prepaid_expenses":return"prepaid_expenses";case"fixed_assets":return"fixed_assets";case"accrued_expenses":return"accrued_expenses";case"opex":return"operating_expenses";case"filing_1099":return"filing_1099";default:return"vendors_list"}})(t);n!==s.currentTab&&a(ie(n))}},[e.pathname,s.currentTab,a]),s},ne="accrued_expenses",vs=G(function(e,a){const s=V(e),t=me(e);return{tenantName:s.companyName,vendorTabsToShow:a.vendorTabsToShow,report:a.scheduleListReport,downloadParams:a.downloadParams,companyIncorporationDate:a.companyIncDate,vendorTabView:t,isAccountingClassesEnabled:te(e)}},function(e,a){const{navigate:s}=a;return{onBackClick:()=>{s("../../..")},onVendorTabSelectionChanged:t=>{const n=ve(t);s(n),e(ie(xe(t)))},onSortOrderChanged:(t,n)=>{e(He({scheduleType:ne,sortKey:t,sortOrder:n}))},onChangeSubTab:t=>{e(qe({scheduleType:ne,subTab:t}))},onSearchTextChanged:t=>{e(Ke({scheduleType:ne,searchText:t}))},onReloadReport:()=>{e(kt(ne))},onScroll:t=>{e(ze({scheduleType:ne,scrollYOffset:t}))},onClickNewButton:()=>{e(ca()),e(da()),L.trackScheduleAccruedDetailsNewRequested({scheduleType:"accrued_expenses"}),s("details/new")},onClickSchedule:t=>{e(ia({selectedJEScheduleKey:t}));const n=a.scheduleListReport.jeAccruedSchedules.find(o=>o.jeAccruedScheduleKey===t);s(`details/${n?.jeScheduleId}`)},updateDownloadStateHandler:t=>{e(Ye({scheduleType:ne,fetchState:t}))}}})(bn),xs=({vendorTabsToShow:e,previousTabPosition:a,setPreviousTabPosition:s})=>{const[t,n]=g.useState(!1),[o,c]=g.useState(!1),r=J(),h=z(),{useFeatureGate:i}=ae(),m=ce();Te();const{isFeatureEnabled:d,isFeatureGateLoading:u}=i(Y.isOpexByVendorFeatureEnabled),p=M.getSignedInUser(),f=S(v=>V(v)),D={userId:p?.userId??"",sessionId:p?.zeniSessionId??"",tenantId:f.tenantId},x=g.useMemo(()=>({authParams:D,jeScheduleEndPoint:`${Z}/jeScheduleReports`,timezone:we(),companyName:f.companyName}),[]),[E,C]=g.useState(!1),b=S(v=>ee(v)),k=S(v=>Ge(v,"accrued_expenses")),I=e.includes("prepaid_expenses"),w=e.includes("fixed_assets"),P=e.includes("accrued_expenses");g.useEffect(()=>{(I||w||P)&&E===!1&&b!=="Completed"&&(h(ye()),C(!0))},[E]),g.useEffect(()=>{u===!1&&(h(De({shouldFetchAccruedExpenses:P,shouldFetchFixedAssets:!0,shouldFetchPrepaidExpenses:I,shouldFetchOpexByVendor:d,shouldFetchVendorsList:!1,shouldFetchFiling1099Vendor:!1})),n(!0))},[b,w,u,d]),g.useEffect(()=>{t===!1&&k==="Completed"&&h(kt("accrued_expenses",{selectedTimeframe:$e("accrued_expenses"),selectedCategoryId:"all"},!0))},[t,k]);const j=S(v=>la(v,ne)),{isAiCfoAccessEnabled:_,onAskAiCfoClick:A}=fe({mobileExploreReferrer:"Vendors — Accrued Expenses"});Se({isDataReady:j.fetchState==="Completed"});const y=S(v=>H(v).isReportGenerated);S(v=>H(v).fetchState)!=="Completed"||y!==!0||d!==!0||e.includes("operating_expenses_by_vendor")||e.splice(1,0,"operating_expenses_by_vendor"),P||r("../opex");const F=S(v=>X(v,f.companyId)),T=v=>{c(v)};return l.jsxs(l.Fragment,{children:[l.jsx(ge,{isAppContentDrawerOpen:o,handleDrawerToggle:T}),l.jsx(vs,{navigate:r,previousTabPosition:a,setPreviousTabPosition:s,scheduleListReport:j,downloadParams:x,themeState:m,vendorTabsToShow:e,analytics:L,controllerUserDetails:F,isAiCfoAccessEnabled:_,onAskAiCfoClick:A,onClickMenuIcon:()=>T(!0)})]})},se="fixed_assets",Ts=G(function(e,a){const s=V(e),t=me(e);return{tenantName:s.companyName,vendorTabsToShow:a.vendorTabsToShow,report:a.scheduleListReport,downloadParams:a.downloadParams,companyIncorporationDate:a.companyIncDate,controllerUserDetails:a.controllerUserDetails,vendorTabView:t,isAccountingClassesEnabled:te(e)}},function(e,a){const{navigate:s}=a;return{onBackClick:()=>{s("../../..")},onVendorTabSelectionChanged:t=>{const n=ve(t);s(n),e(ie(xe(t)))},onSortOrderChanged:(t,n)=>{e(He({scheduleType:se,sortKey:t,sortOrder:n}))},onChangeSubTab:t=>{e(qe({scheduleType:se,subTab:t}))},onSearchTextChanged:t=>{e(Ke({scheduleType:se,searchText:t}))},onReloadReport:()=>{e(ke(se))},onScroll:t=>{e(ze({scheduleType:se,scrollYOffset:t}))},onClickSchedule:t=>{e(Lt({selectedJEScheduleKey:t}));const n=a.scheduleListReport.jeScheduledTransactions.find(o=>o.jeScheduleTransactionKey===t);s(n?.jeScheduleId==null?"details/new":`details/${n.jeScheduleId}`)},updateDownloadStateHandler:t=>{e(Ye({scheduleType:se,fetchState:t}))}}})(Ut),ys=({vendorTabsToShow:e,previousTabPosition:a,setPreviousTabPosition:s})=>{const[t,n]=g.useState(!1),o=J(),c=z();Te();const{useFeatureGate:r}=ae(),h=ce(),{isFeatureEnabled:i,isFeatureGateLoading:m}=r(Y.isOpexByVendorFeatureEnabled),d=M.getSignedInUser(),u=S(v=>V(v)),p={userId:d?.userId??"",sessionId:d?.zeniSessionId??"",tenantId:u.tenantId},f=g.useMemo(()=>({authParams:p,jeScheduleEndPoint:`${Z}/jeScheduleReports`,timezone:we(),companyName:u.companyName}),[]),[D,x]=g.useState(!1),E=S(v=>ee(v)),C=S(v=>Ge(v,"fixed_assets")),b=e.includes("prepaid_expenses"),k=e.includes("fixed_assets"),I=e.includes("accrued_expenses");g.useEffect(()=>{(b||k||I)&&D===!1&&E!=="Completed"&&(c(ye()),x(!0))},[D]),g.useEffect(()=>{m===!1&&(c(De({shouldFetchAccruedExpenses:I,shouldFetchFixedAssets:!0,shouldFetchPrepaidExpenses:b,shouldFetchOpexByVendor:i,shouldFetchVendorsList:!1,shouldFetchFiling1099Vendor:!1})),n(!0))},[E,k,m,i]),g.useEffect(()=>{t===!1&&C==="Completed"&&c(ke("fixed_assets",{selectedTimeframe:$e("fixed_assets"),selectedCategoryId:"all"},!0))},[t,C]);const w=S(v=>At(v,se)),{isAiCfoAccessEnabled:P,onAskAiCfoClick:j}=fe({mobileExploreReferrer:"Vendors — Fixed Assets"});Se({isDataReady:w.fetchState==="Completed"});const _=S(v=>H(v).isReportGenerated);S(v=>H(v).fetchState)!=="Completed"||_!==!0||i!==!0||e.includes("operating_expenses_by_vendor")||e.splice(1,0,"operating_expenses_by_vendor"),k||o("../opex");const A=S(v=>X(v,u.companyId)),[y,F]=g.useState(!1),T=v=>{F(v)};return l.jsxs(l.Fragment,{children:[l.jsx(ge,{isAppContentDrawerOpen:y,handleDrawerToggle:T}),l.jsx(Ts,{navigate:o,scheduleListReport:w,downloadParams:f,previousTabPosition:a,setPreviousTabPosition:s,themeState:h,vendorTabsToShow:e,analytics:L,controllerUserDetails:A,isAiCfoAccessEnabled:P,onAskAiCfoClick:j,onClickMenuIcon:()=>{T(!0)}})]})},Ds=U.div`
30
+ display: flex;
31
+ min-height: 100%;
32
+ width: 100%;
33
+ flex: 1 1 auto;
34
+ flex-direction: column;
35
+ align-items: center;
36
+ background-color: ${e=>e.theme.colors.grey4};
37
+ `,Cs=G(function(e,a){const s=M.getSignedInUser(),t=e.tenantState.currentTenantId,n=V(e),o=n?.companyName??"",c={userId:s?.userId??"",sessionId:s?.zeniSessionId??"",tenantId:t??""},r=H(e),h=ra(e);return{report:r,uiState:h,isAccountingClassesEnabled:te(e),analytics:L,vendorTabsToShow:a.vendorTabsToShow,downloadParams:{downloadState:h.downloadState,currentTenantCompanyName:o,statementEndPoint:`${Z}/opexByVendor`,authParams:c,timezone:we()}}},function(e,a){const{navigate:s}=a;return{onFetchOpExByVendors:(t,n,o)=>{e(xa(t,n,o))},onVendorNameAndBalanceClicked:(t,n)=>{if(a.tenantEmailDomain!=null){const o=tt(t.id,t.qboId,a.tenantEmailDomain,n),c=N(a.location.state?.pathnameStackToGoBack,a.location.pathname);a.navigate(o,{state:{pathnameStackToGoBack:c,referrer:"Operating Expenses By Vendor"}})}},onReloadReport:()=>{e(va(!0))},onBackClick:()=>{s("../../dashboard")},onTimeframeSelectionChanged:t=>{e(ga(t))},onAdditionalBalanceSelectionChanged:(t,n)=>{e(fa({isCompareModeOn:t,additionalBalances:n}))},onSortOrderChanged:(t,n,o)=>{e(Sa({sortkey:n,sortOrder:t,timeframe:o}))},onVendorTabSelectionChanged:t=>{const n=ve(t);s(n),e(ie(xe(t)))},onSortOrSearchStarted:t=>{e(ma(t))},onPageFetchStarted:()=>{e(pa(!0))},updateDownloadStateHandler:t=>{e(ha(t))},onClearSearch:t=>{e(ua({timeframe:t}))}}})(In);function bs({vendorTabsToShow:e,previousTabPosition:a,setPreviousTabPosition:s}){const t=J(),n=z(),o=K(),{tenantEmailDomain:c}=R(),r=de(),h=M.getSignedInUser(),{useFeatureGate:i}=ae(),{isFeatureEnabled:m,isFeatureGateLoading:d}=i(Y.isOpexByVendorFeatureEnabled),u=S(A=>H(A));if(h==null)throw Error("Can't access opex by vendor page without signing in...");Te();const[p,f]=g.useState(!1),D=S(A=>ee(A)),x=e.includes("prepaid_expenses"),E=e.includes("fixed_assets"),C=e.includes("accrued_expenses"),b=S(A=>me(A)),{isAiCfoAccessEnabled:k,onAskAiCfoClick:I}=fe({mobileExploreReferrer:"Vendors — Operating Expenses by Vendor"});Se({isDataReady:u.fetchState==="Completed"&&u.isReportGenerated===!0});const{areTenantIdsInSync:w}=En();g.useEffect(()=>{(x||E||C)&&p===!1&&D!=="Completed"&&w&&(n(ye()),f(!0))},[p,w]),g.useEffect(()=>{w&&n(De({shouldFetchAccruedExpenses:C,shouldFetchFixedAssets:E,shouldFetchPrepaidExpenses:x,shouldFetchOpexByVendor:m===!0&&d===!1,shouldFetchVendorsList:!1,shouldFetchFiling1099Vendor:!1}))},[D,E,d,m,w]),u.fetchState!=="Completed"||u.isReportGenerated!==!0||m!==!0||e.includes("operating_expenses_by_vendor")||e.splice(1,0,"operating_expenses_by_vendor"),(u.isReportGenerated===!1&&u.fetchState==="Completed"||m===!1&&d===!1)&&t("../summary");const[P,j]=g.useState(!1),_=A=>{j(A)};return l.jsxs(Ds,{windowSize:r,children:[u.fetchState==="Completed"?l.jsx(W,{analytics:L,onLoad:A=>{b.previousTab==null?A.trackVendorOperatingExpensesPageLoaded("Side Panel"):A.trackVendorOperatingExpenses(b.currentTab,b.previousTab??null)}}):null,l.jsx(ge,{isAppContentDrawerOpen:P,handleDrawerToggle:_}),l.jsx(Cs,{location:o,navigate:t,previousTabPosition:a,setPreviousTabPosition:s,tenantEmailDomain:c,vendorTabsToShow:e,isAiCfoAccessEnabled:k,onAskAiCfoClick:I,onClickMenuIcon:()=>{_(!0)}})]})}const oe="prepaid_expenses",Es=G(function(e,a){const s=V(e),t=me(e);return{tenantName:s.companyName,vendorTabsToShow:a.vendorTabsToShow,report:a.scheduleListReport,downloadParams:a.downloadParams,companyIncorporationDate:a.companyIncDate,controllerUserDetails:a.controllerUserDetails,vendorTabView:t,isAccountingClassesEnabled:te(e)}},function(e,a){const{navigate:s}=a;return{onBackClick:()=>{s("../../..")},onVendorTabSelectionChanged:t=>{const n=ve(t);s(n),e(ie(xe(t)))},onSortOrderChanged:(t,n)=>{e(He({scheduleType:oe,sortKey:t,sortOrder:n}))},onChangeSubTab:t=>{e(qe({scheduleType:oe,subTab:t}))},onSearchTextChanged:t=>{e(Ke({scheduleType:oe,searchText:t}))},onReloadReport:()=>{e(ke(oe))},onScroll:t=>{e(ze({scheduleType:oe,scrollYOffset:t}))},onClickSchedule:t=>{e(Lt({selectedJEScheduleKey:t}));const n=a.scheduleListReport.jeScheduledTransactions.find(o=>o.jeScheduleTransactionKey===t);s(n?.jeScheduleId==null?"details/new":`details/${n.jeScheduleId}`)},updateDownloadStateHandler:t=>{e(Ye({scheduleType:oe,fetchState:t}))}}})(Ut),Is=({vendorTabsToShow:e,previousTabPosition:a,setPreviousTabPosition:s})=>{const[t,n]=g.useState(!1),o=J(),c=z(),{useFeatureGate:r}=ae(),h=ce();Te();const i=M.getSignedInUser(),{isFeatureEnabled:m,isFeatureGateLoading:d}=r(Y.isOpexByVendorFeatureEnabled),u=S(v=>V(v)),p=S(v=>Ge(v,"prepaid_expenses")),f={userId:i?.userId??"",sessionId:i?.zeniSessionId??"",tenantId:u.tenantId},D=g.useMemo(()=>({authParams:f,jeScheduleEndPoint:`${Z}/jeScheduleReports`,timezone:we(),companyName:u.companyName}),[]),[x,E]=g.useState(!1),C=S(v=>ee(v)),b=e.includes("prepaid_expenses"),k=e.includes("fixed_assets"),I=e.includes("accrued_expenses");g.useEffect(()=>{(b||k||I)&&x===!1&&C!=="Completed"&&(c(ye()),E(!0))},[x]),g.useEffect(()=>{t===!1&&p==="Completed"&&c(ke("prepaid_expenses",{selectedTimeframe:$e("prepaid_expenses"),selectedCategoryId:"all"},!0))},[t,p]),g.useEffect(()=>{d===!1&&(c(De({shouldFetchAccruedExpenses:I,shouldFetchFixedAssets:k,shouldFetchPrepaidExpenses:!0,shouldFetchOpexByVendor:m,shouldFetchVendorsList:!1,shouldFetchFiling1099Vendor:!1})),n(!0))},[C,k,d,m]);const w=S(v=>At(v,oe)),{isAiCfoAccessEnabled:P,onAskAiCfoClick:j}=fe({mobileExploreReferrer:"Vendors — Prepaid Expenses"});Se({isDataReady:w.fetchState==="Completed"});const _=S(v=>H(v).isReportGenerated);S(v=>H(v).fetchState)!=="Completed"||_!==!0||m!==!0||e.includes("operating_expenses_by_vendor")||e.splice(1,0,"operating_expenses_by_vendor"),b||o("../opex");const A=S(v=>X(v,u.companyId)),[y,F]=g.useState(!1),T=v=>{F(v)};return l.jsxs(l.Fragment,{children:[l.jsx(ge,{isAppContentDrawerOpen:y,handleDrawerToggle:T}),l.jsx(Es,{navigate:o,previousTabPosition:a,setPreviousTabPosition:s,scheduleListReport:w,downloadParams:D,themeState:h,vendorTabsToShow:e,analytics:L,controllerUserDetails:A,isAiCfoAccessEnabled:P,onAskAiCfoClick:j,onClickMenuIcon:()=>{T(!0)}})]})},ws=U.div`
38
+ display: flex;
39
+ min-height: 100%;
40
+ width: 100%;
41
+ flex: 1 1 auto;
42
+ flex-direction: column;
43
+ align-items: center;
44
+ background-color: ${e=>e.theme.colors.grey4};
45
+ `,ks=G(function(e,a){const{isFiling1099FeatureEnabled:s,vendorDetailView:t,selectedVendor:n,firstMonthOfFY:o,currentTenant:c,currentUserRoleMap:r}=a,h=M.getSignedInUser(),i={userId:h?.userId??"",sessionId:h?.zeniSessionId??"",tenantId:c.tenantId??""};return{firstMonthOfFY:o,isFiling1099FeatureEnabled:s,vendorDetailView:t,allTransactions:t?.allVendorTransactionsView,allTransactionsTabData:t?.allTransactionsTabData!=null?{timePeriod:wa(t?.allTransactionsTabData.timePeriod),numberOfQuartersFetched:t?.allTransactionsTabData.numberOfQuartersFetched}:void 0,vendorLogo:n?.logo,readOnlyMode:r?.bookkeeping_user===!0,filesEndPoint:Nt.fileMicroServiceBaseUrl,authParams:i,scrollToTrend:a.isTrendPeriodSelected}},function(e,a){const{navigate:s,vendorDetailView:t,vendorId:n,defaultTransactionTimePeriod:o,vendorEntity:c,tenantEmailDomain:r,location:h,firstMonthOfFY:i}=a,m=()=>{const d=We(h.state?.pathnameStackToGoBack),u=d.poppedPathname??((p=2)=>{let f=p;a.isTrendPeriodSelected===!0&&(f=5);let D="../";for(let x=0;x<f;x++)D=`${D}../`;return D})(1);s(u,{state:{pathnameStackToGoBack:d.newStack}})};return{onSaveVendor:()=>{t!=null&&((d,u)=>{const{vendorId:p,vendorName:f,existingCategory:D,existingClass:x,existingOwner:E,selectedCategory:C,selectedClass:b,selectedOwner:k,isRecommendedCategorySelected:I,isRecommendedClassSelected:w,categoryRecommendationTypeSelected:P,classRecommendationTypeSelected:j}=Va(d,u);p!=null&&L.trackVendorDetailsSave(p,f??"",D,x,E,C,b,k,I,w,P,j)})(t?.vendorViewDetails,t?.vendorViewDetails.ownerList),n!=null&&e(_a(n,void 0))},onVendorSpendTrendFilterTabClick:d=>{e(Pa(d))},saveVendorDetailLocalData:d=>{n!=null&&e(Fa({vendorId:n,localData:d}))},saveContactsInVendorTabDetailLocalData:(d,u)=>{e(ja({vendorId:d,localData:{contacts:u}}))},onCancelClick:()=>{var d;t?.vendorViewDetails.vendorView?.vendorBasic!=null&&(d=t.vendorViewDetails.vendorView.vendorBasic).id!=null&&L.trackVendorDetailsCancel(d.id??"",d.name,d.account?.accountName,d.class?.className,d.owner?.email),e(ot()),e(lt()),e(it()),e(ct()),m()},handleSpendTrendPercentChangeClick:()=>{var d;t?.vendorViewDetails.vendorView?.vendorBasic!=null&&(d=t.vendorViewDetails.vendorView?.vendorBasic,d.id!=null&&L.trackVendorDetailsSpendTrendHotlinkClicked(d.id??"",d.name,d.account?.accountName,d.class?.className,d.owner?.email))},onSaveSuccess:()=>{n!=null&&e(La("Not-Started",n)),e(ot()),e(lt()),e(it()),e(ct()),m()},onTrendSelectedPeriodChange:d=>{if(d==null)o!=null&&e(Le(c,"EntityDetail",{timeframe:"quarter",timePeriod:o}));else{const u=d.currentTimePeriod==null?d.addTimePeriod:{startDate:d.addTimePeriod.startDate,endDate:d.currentTimePeriod.endDate};e(Fe(c,"EntityDetail",{timeframe:d.timeframe,timePeriod:d.addTimePeriod},i)),e(Le(c,"EntityDetail",{timeframe:d.timeframe,timePeriod:u}))}},onVendorTabSelectionChanged:d=>{e(Aa(d))},onAddressClick:(d,u)=>{if(r==null)return;const p=Gn(r,d,u),f=N(h.state?.pathnameStackToGoBack,h.pathname);s(p,{state:{pathnameStackToGoBack:f}})},onVendorDetailUIChange:d=>{e(ka({collapsableStatus:d}))},onTransactionItemClick:d=>{const u=`${q(d,r)}`,p=N(h.state?.pathnameStackToGoBack,h.pathname);s(u,{state:{pathnameStackToGoBack:p}})},onLoadPreviousTransactionsClick:(d,u)=>{e(jt({timePeriod:je(d),numberOfQuartersFetched:u})),e(Ft(c,je(d),!0,!0))}}})(kn);function ut({referrerType:e,isFiling1099FeatureEnabled:a}){const s=z(),t=K(),n=J(),o=wn(),[c,r]=g.useState(!1),[h,i]=g.useState(!1),[m,d]=g.useState(!1),u=R(),p=u.vendorId,f=u.qboId,{tenantEmailDomain:D,timeframe:x,startDate:E,endDate:C}=u,b={id:f??"",name:"",type:"vendor",zeniId:p??"",qboId:f??""};g.useEffect(()=>{x!=null&&E!=null&&C!=null?r(!0):(r(!1),m===!1&&(d(!0),s(Le(b,"EntityDetail"))))},[x,E,C]);const k=de(),I=S(O=>V(O)),w=S(O=>p!=null?Ta(O,p,b):void 0),P=S(O=>O.vendorState.vendorByID[p??""]),j=S(O=>V(O).company?.companyInfo.firstMonthOfFY??1),_=S(()=>ya(j,2)),A=je({startDate:_.startDate,endDate:Da()}),y=Ca(j),F=S(O=>ba(O.trendWithTransactionsState,b,"EntityDetail")),[T,v]=g.useState(!1),re=c===!1&&m===!1?void 0:F?.selectedPeriod?.timePeriod??y;return g.useEffect(()=>(e==null&&w?.fetchState!=="Not-Started"||p==null||s(Ea(p,b)),()=>{e!=null&&p!=null&&s(Ia(p))}),[p,t.state,s]),g.useEffect(()=>{w?.fetchState==="Completed"&&w?.vendorViewDetails.vendorView?.vendorBasic!=null&&((O,ue,Ae)=>{O.id!=null&&L.trackVendorDetails(O.id,O.name,Ae,O.account?.accountName,O.class?.className,O.owner?.email,ue.percentChange,ue.last30DaysSpend,ue.last90DaysSpend,ue.yearToDateSpend)})(w?.vendorViewDetails.vendorView?.vendorBasic,w?.vendorSpend,e),v(!1)},[w?.fetchState]),g.useEffect(()=>{if(w?.fetchState==="Completed"&&T===!1){re!=null&&c===!1&&(s(Fe(b,"EntityDetail",{timeframe:F?.selectedPeriod?.timeframe??"quarter",timePeriod:re},j)),v(!0));const O=Ce.getLocalizedStrings().dateFormat.analytics;if(c===!0&&x!=null&&E!=null&&C!=null){v(!0);const ue=x,Ae={startDate:st(E,O.YYYYDashMMDashDDFormat),endDate:st(C,O.YYYYDashMMDashDDFormat)};s(Fe(b,"EntityDetail",{timeframe:ue,timePeriod:Ae}))}}},[w?.fetchState,re,F?.selectedPeriod?.timeframe,c,j]),g.useEffect(()=>{w?.fetchState==="Completed"&&h===!1&&(s(jt({timePeriod:A,numberOfQuartersFetched:3})),s(Ft(b,w.allTransactionsTabData?.timePeriod??A,!1,!0)),i(!0))},[w?.fetchState,h]),p==null?l.jsx(le,{}):l.jsx(ws,{windowSize:k,children:l.jsx(ks,{location:t,navigate:n,isFiling1099FeatureEnabled:a,vendorDetailView:w,vendorId:p,currentTenant:I,selectedVendor:P,firstMonthOfFY:j,isTrendPeriodSelected:c,selectedPeriodTimePeriod:F?.selectedPeriod?.timePeriod,defaultTransactionTimePeriod:y,vendorEntity:b,currentUserRoleMap:o?.loggedInUserRoleMap,tenantEmailDomain:D})})}const As=Ce.getLocalizedStrings().spendManagement.billPay.vendorCreation.vendorDetails,Ls={containerWidth:new Ze(100,58)},js=U(Ln)`
46
+ width: ${Q.sp4};
47
+ height: ${Q.sp4};
48
+ cursor: pointer;
49
+ color: ${e=>e.theme.colors.brandColorJade};
50
+ `,Fs=U.div`
51
+ display: flex;
52
+ height: 100vh;
53
+ flex-direction: ${e=>e.windowSize==="small"?"column":"row"};
54
+ width: 100%;
55
+ overflow-y: scroll;
56
+ background-color: ${e=>e.theme.colors.grey4};
57
+ `,Ps=U.div`
58
+ display: flex;
59
+ flex-direction: column;
60
+ width: ${e=>`${Ls.containerWidth.value(e.windowSize)}%`};
61
+ ${e=>e.windowSize!=="small"?"overflow: auto;":""}
62
+ `,_s=G(function(e,a){const s=M.getSignedInUser(),t=e.tenantState.currentTenantId,n={userId:s?.userId??"",sessionId:s?.zeniSessionId??"",tenantId:t??""},o=e.vendorFiling1099UploadDetailsState,c=e.vendorFiling1099UploadDetailsState;let r={fetchState:"Not-Started",error:void 0};return a.vendorId!=null&&(r=e.vendorViewState.editVendorStateById[a.vendorId]?.fetchStatus),{uploadInvoiceEndPoint:`${Nt.documentAIMicroServiceBaseUrl}`,vendorFiling1099UploadDetailsState:o,vendorFiling1099UploadDetailsViewState:c,uploadStaus:c.w9FormUploadStatus,authParams:n,billId:a.billId,vendorId:a.vendorId,file:a.file,showAutofill:a.showAutofill,type:a.type,analytics:L,entityId:a.billId,fetchVendorFetchStatus:r,vendorLegalName:a.vendorLegalName}},function(e,a){const s=a.vendorId;return{onInvoiceUpload:t=>{if(function(n){return n!=null&&"w9_form"in n}(t)&&(e(Ma({w9FormFile:t.files[0]})),t.w9_form[0]!=null)){e(Ua({ocrData:t.w9_form[0],vendorId:s}));const n=(o=>({street:[o.street.join(" ")],city:o.city,state:o.state,postalCode:o.postal_code,countryCode:o.country_code??void 0,country:o.country??""}))(t.w9_form[0].address);e(Ot({addressType:"vendor_address",addressToCreate:n}))}},updateInvoiceUploadFetchState:t=>{e(Pe({fetchState:t,error:void 0}))},onSkipAutofill:t=>{e(Ra(t))},onVendorFiling1099UploadDetailsSave:t=>{e(Bt(t))},onDeleteClick:()=>{e(Pe({fetchState:"Not-Started",error:void 0})),e(Vt({vendorId:s,w9Documents:[]}))}}})(Fn);function ht({appContent:e,showFullScreenSkeletonWhileLoading:a}){const s=z(),t=J(),{vendorId:n}=R(),o=de(),c=ce(),r=M.getSignedInUser(),[h,i]=g.useState(!1),{useFeatureGate:m}=ae(),{isFeatureEnabled:d}=m(Y.isVendorRecommendationFeatureEnabled),u=S(y=>V(y)).companyName,p=new AbortController,f=p.signal;let D,x,E,C,b;if(n==null)throw new Error("Vendor ID not found for Vendor Filing 1099 Details Screen");D=S(y=>Pt(y,n)),x=S(y=>y.vendorFiling1099UploadDetailsState.vendor1099DetailsSaveStatus),E=S(y=>y.vendorViewState.editVendorStateById[n]?.fetchStatus),b=S(y=>y.vendorFiling1099UploadDetailsState.vendor1099DetailsLocalData.w9Documents?.[0]),C=S(y=>y.vendorFiling1099UploadDetailsState);const k=E?.fetchState==="In-Progress"||C?.w9FormUploadStatus?.fetchState==="In-Progress",I=()=>{c.toggle()};g.useEffect(()=>()=>{p.abort(),s(_t(n))},[]),g.useEffect(()=>{h||n!=null&&(i(!0),s(Ba(!1,n,f)))},[n]);const w=Be(E?.fetchState),P=Be(x?.fetchState),j=D.vendor?.contactIds,_=j?.[j.length-1],A=S(y=>y.contactState.contactById[_]);if(g.useEffect(()=>{n!=null&&w==="In-Progress"&&E?.fetchState==="Completed"&&D?.vendor!=null&&(s(Oa(n,D.vendor,A)),D?.vendor.filing1099W9Files?.[0]!=null&&s(Pe({fetchState:"Completed",error:void 0})))},[n,D?.vendor]),g.useEffect(()=>{P==="In-Progress"&&x?.fetchState==="Completed"&&t("../../vendors/filing_1099")},[x?.fetchState]),a===!0&&E?.fetchState!=="Completed"&&E?.fetchState!=="Error")return l.jsx(Ms,{children:l.jsx(An,{})});if(r==null)throw Error("Can't access VendorFiling1099UploadScreen without signing in...");return l.jsxs(Fs,{windowSize:o,children:[o!=="small"?l.jsxs(Bs,{children:[l.jsx(js,{onClick:I}),l.jsxs(Vs,{showContent:r.userEmailDomain==="zeni.ai",children:[l.jsx(Os,{showAutofill:!1}),l.jsx(Rs,{showAutofill:!1,children:u})]})]}):null,l.jsx(_s,{vendorId:n,file:b,showAutofill:!1,type:"w9",isVendorRecommendationEnabled:d,pdfTitle:b?As.w9FormTitle:void 0,showTitlebar:!0,showTitlebarIcon:!0,vendorLegalName:D?.vendor?.legalName,isLoading:k}),l.jsx(Ps,{windowSize:o,children:e})]})}const Vs=U.div`
63
+ display: ${e=>e.showContent?"flex":"none"};
64
+ align-items: center;
65
+ `,Bs=U.div`
66
+ margin-bottom: ${Q.sp3};
67
+ margin-top: ${Q.sp3};
68
+ margin-left: ${Q.sp8};
69
+ position: absolute;
70
+ display: flex;
71
+ align-items: center;
72
+ `,Os=U.div`
73
+ width: 1px;
74
+ height: ${Q.sp3};
75
+ margin: ${Q.sp0} ${Q.sp3};
76
+ background-color: ${e=>e.showAutofill?Jt.neutralGrey1Light:e.theme.colors.hero};
77
+ `,Rs=U(jn.StandardMedium)`
78
+ color: ${e=>e.showAutofill?Jt.neutralGrey5Light:e.theme.colors.primary};
79
+ `,Ms=U.div`
80
+ width: 100%;
81
+ height: 100vh;
82
+ overflow: hidden;
83
+ background-color: ${e=>e.theme.colors.grey4};
84
+ `,Us=G(function(e){const a=Na(e);return{vendorDetailView:Ja(e),globalMerchantView:a}},function(e,a){const{navigate:s}=a;return{updateVendorDetailLocalData:t=>{e(Rt({vendorDetails:t}))},fetchRecommendation:t=>{e($a("tenant",t))},onSaveClick:()=>{e(Ga())},onBackClick:()=>{s("../review")}}})(Pn);function Ns(){const e=J();return l.jsx(Us,{navigate:e})}const Js=U.div`
85
+ display: flex;
86
+ min-height: 100%;
87
+ width: 100%;
88
+ flex: 1 1 auto;
89
+ flex-direction: column;
90
+ align-items: center;
91
+ background-color: ${e=>e.theme.colors.grey4};
92
+ `,Gs=G(function(e,a){const{vendorFirstReviewDetails:s}=a,t=e.globalMerchantAutoCompleteState.autoCompleteText,n=M.getSignedInUser(),o=e.tenantState.currentTenantId,c={userId:n?.userId??"",sessionId:n?.zeniSessionId??"",tenantId:o??""},r=V(e);return{vendorFirstReviewView:s,globalMerchantAutoCompleteData:{globalMerchantAutoCompleteView:s.globalMerchantAutoCompleteView,autoCompleteText:t},analytics:L,authParams:c,attachmentEndpoint:r.externalConnections?.accounting[0]?.connectionName==="netsuite"?`${Z}/vendor_attachments_accounting_provider`:`${Z}/vendor_attachments`}},function(e,a){const{navigate:s}=a;return{onFetchVendorReviewView:(t,n,o)=>{e(_e(t,n,o))},onGlobalMerchantAutoCompleteInputChange:(t,n)=>{t.trim().length>=2?e(Za({searchString:t,globalMerchantType:n??"vendor"})):t.trim().length===0&&e(rt())},onUpdateLocalData:(t,n,o,c)=>{if(n!=null){const r=$s(n);e(Wa({vendorId:t,currentSelection:r,selectedGlobalMerchantId:o,vendorRenamedText:c}))}},onResetVendorLocalData:t=>{e(Qa({vendorId:t}))},onVendorNameClick:(t,n)=>{if(a.tenantEmailDomain!=null){const o=tt(t,n,a.tenantEmailDomain),c=N(a.location.state?.pathnameStackToGoBack,a.location.pathname);a.navigate(o,{state:{pathnameStackToGoBack:c}})}},onUpdatePageToken:t=>{e(Ha({pageToken:t}))},onUpdateSortUiState:(t,n)=>{e(qa({sortOrder:t,sortKey:n}))},onUpdateScrollYOffset:t=>{e(Ka({scrollYOffset:t}))},onClickSave:(t,n,o)=>{e(za(t,n,o))},onClickCancelPopup:()=>{e(Ya())},onClearGlobalMerchantAutoCompleteResults:()=>{e(rt())},onClickRedirectToQBO:()=>{window.open(`${Xe.qboRedirectionUrl}/vendors`,"_blank")},updateVendorDetailLocalData:t=>{e(Rt({vendorDetails:t})),s(`./vendor/${t.id}`)},onBackClick:()=>{s("../..")},onReloadList:()=>{e(_e(null))}}})(_n);function pt(){const e=J(),a=z(),s=K(),{tenantEmailDomain:t}=R(),n=de(),o=M.getSignedInUser(),{vendorId:c}=R(),r=S(u=>dt(u)),[h,i]=g.useState(!1),m=S(u=>dt(u).fetchState);if(g.useEffect(()=>{m==="Not-Started"&&h===!1&&(a(_e(null)),i(!0))},[]),o==null)throw Error("Can't access first review page without signing in...");const d=u=>u.trackPageLoaded(et.Event.vendorTenantReviewListPage);return l.jsxs(l.Fragment,{children:[m==="Completed"?l.jsx(W,{analytics:L,onLoad:d}):null,l.jsx(W,{analytics:L,onLoad:d}),l.jsx($n,{isOpen:c!=null,drawerLeftMargin:new Ze(0,0,300,600),onClose:()=>{e("../review")},children:l.jsx(Ys,{onClick:u=>u.stopPropagation(),children:l.jsx(Ns,{})})}),l.jsx(Js,{windowSize:n,children:l.jsx(Gs,{location:s,navigate:e,vendorFirstReviewDetails:r,tenantEmailDomain:t})})]})}const $s=e=>e.recommendedFirst===!0?"recommendedFirst":e.recommendedSecond===!0?"recommendedSecond":e.retain===!0?"retain":e.rename===!0?"rename":e.customMerchant===!0?"customMerchant":null,Ys=U(Gt)`
93
+ display: flex;
94
+ min-height: 100%;
95
+ flex-direction: column;
96
+ `,zs=G(function(e,a){const s=M.getSignedInUser(),t=e.tenantState.currentTenantId,n=e.vendorFiling1099UploadDetailsState,o={userId:s?.userId??"",sessionId:s?.zeniSessionId??"",tenantId:t??""};let c={fetchState:"Not-Started",error:void 0};return a.vendorId!=null&&(c=e.vendorViewState.editVendorStateById[a.vendorId]?.fetchStatus),{analytics:L,vendorFiling1099UploadDetailsViewState:n,authParams:o,googleAPIKey:Xe.googleMapsAPIKey,vendorId:a.vendorId,fetchVendorFetchStatus:c,vendor:a.vendorFiling1099UploadDetails?.vendor}},function(e,a){const{currentTenant:s,navigate:t,location:n,vendorId:o,vendorFiling1099UploadDetails:c}=a,{tenantEmailDomain:r}=s;return{onVendorFiling1099UploadDetailsSave:h=>{e(Bt(h)),L.trackVendor1099DetailSave(c.vendor.legalName??"")},onSaveChangesToLocalStore:h=>{e(Vt(h))},onResetVendorFiling1099FormStatus:()=>{e(Xa())},onAddressEditHandler:h=>{const i=Un((m=>({street:m.vendor1099FilingSectionId.street,suite:m.vendor1099FilingSectionId.suite,city:m.vendor1099FilingSectionId.city,state:m.vendor1099FilingSectionId.state,country:m.vendor1099FilingSectionId.country,countryCode:m.vendor1099FilingSectionId.countryCode,postalCode:m.vendor1099FilingSectionId.postalCode,secondaryInfo:m.vendor1099FilingSectionId.secondaryInfo}))(h));e(Ot({addressType:"vendor_address",addressToCreate:i}))},goBackToListPage:()=>{e(_t(o));const h=`/${r}/vendors/filing_1099/`,i=N(n.state?.pathnameStackToGoBack,n.pathname);t(h,{state:{pathnameStackToGoBack:i}})},onAddressClick:h=>{const i=function(d,u,p){let f=`/${d}/vendors/filing_1099/upload/${p}/edit`;return f=f.concat(`/new/${u}`),f}(r,h,o),m=N(n.state?.pathnameStackToGoBack,n.pathname);t(i,{state:{pathnameStackToGoBack:m}})},AddressFormPage:Bn}})(Vn);function Ks(){const e=J(),a=K(),{vendorId:s}=R(),t=S(r=>V(r));let n;if(s==null)throw new Error("Vendor ID not found for Vendor Filing 1099 Details Screen");n=S(r=>Pt(r,s));const{tenantEmailDomain:o}=t,c=t.companyId??M.getSignedInUserTenant(o)?.companyId;if(c==null)throw new Error("Company ID not found for Vendor Filing 1099 Details Screen");return l.jsx(zs,{location:a,navigate:e,currentTenant:t,vendorId:s,vendorFiling1099UploadDetails:n,companyId:c})}const qs=U.div`
97
+ display: flex;
98
+ min-height: 100%;
99
+ width: 100%;
100
+ flex: 1 1 auto;
101
+ flex-direction: column;
102
+ align-items: center;
103
+ background-color: ${e=>e.theme.colors.grey4};
104
+ `,Hs=G(function(e,a){const{vendorsFiling1099ListDetails:s,accountMappingView:t,analytics:n}=a;return{analytics:n,vendorsFiling1099List:s.vendors,isVendor1099Populated:s.isVendor1099Populated,accountMappingView:t,fetchState:s.fetchState,uiState:s.uiState,lastRefreshSuccessTime:s.lastRefreshSuccessTime,vendorTabsToShow:a.vendorTabsToShow}},function(e,a){const{navigate:s,analytics:t}=a;return{onUpdateSortUiState:(n,o)=>{e(cn({sortOrder:n,sortKey:o}))},onUpdateSearchUiState:n=>{e(ln({searchString:n}))},onVendorRowClick:n=>{if(a.tenantEmailDomain!=null){const o=`/${a.tenantEmailDomain}/vendors/filing_1099/upload/${encodeURIComponent(n)}/edit`,c=N(a.location.state?.pathnameStackToGoBack,a.location.pathname);a.navigate(o,{state:{pathnameStackToGoBack:c}})}},onReloadVendors:()=>{e(Ve(!0))},onBackClick:()=>{e(sn()),e(on())},onVendorTabSelectionChanged:n=>{const o=ve(n);s(o),e(ie(xe(n)))},onAccountMappingChange:n=>{const{filing1099:o}=n,{bankAccount:c,expenseCategory1099:r}=o,h=Yn(a.accountMappingView.bankAccounts1099FilingAccountList,c.selectedOptions),i=zn(a.accountMappingView.expenseAccounts1099FilingAccountList,r),m={selectedBankAccounts1099FilingAccountIds:h.map(d=>d.accountId),selectedExpenseAccounts1099FilingAccountIds:i};e(nn({data:m}))},onSaveClick:()=>{e(an()),t.track(et.Event.vendor1099TabSettingsSave)}}})(On);function mt({vendorTabsToShow:e,previousTabPosition:a,setPreviousTabPosition:s}){const t=J(),n=z(),o=K(),{tenantEmailDomain:c}=R(),r=de(),h=M.getSignedInUser(),[i,m]=g.useState(!1),[d,u]=g.useState(!1);if(h==null)throw Error("Can't access vendor filing 1099 page without signing in...");Te();const p=S(I=>en(I)),f=S(I=>tn(I)),{isAiCfoAccessEnabled:D,onAskAiCfoClick:x}=fe({mobileExploreReferrer:"Vendors — 1099"});Se({isDataReady:p.fetchState==="Completed"}),g.useEffect(()=>{d||(u(!0),n(Ve(!1)))},[d,u]),g.useEffect(()=>{f.saveState.fetchState==="Completed"&&n(Ve(!1))},[f.saveState.fetchState]);const E=I=>{m(I)},C=S(I=>V(I)),b={userId:h?.userId??"",sessionId:h?.zeniSessionId??"",tenantId:C.tenantId},k=g.useMemo(()=>({authParams:b,tenantName:C.companyName,filing1099ReportEndPoint:`${Z}/filing1099Reports`}),[]);return l.jsxs(l.Fragment,{children:[p.fetchState==="Completed"?l.jsx(l.Fragment,{children:l.jsx(W,{analytics:L,onLoad:()=>L.trackPageLoaded(et.Event.vendor1099ListPage)})}):null,l.jsxs(qs,{windowSize:r,children:[l.jsx(ge,{isAppContentDrawerOpen:i,handleDrawerToggle:E}),l.jsx(Hs,{location:o,navigate:t,previousTabPosition:a,setPreviousTabPosition:s,analytics:L,vendorsFiling1099ListDetails:p,vendorTypeList:p.vendorTypeList,accountMappingView:f,downloadParams:k,tenantEmailDomain:c,vendorTabsToShow:e,isAiCfoAccessEnabled:D,onAskAiCfoClick:x,onClickMenuIcon:()=>{E(!0)}})]})]})}const Qs=U.div`
105
+ display: flex;
106
+ min-height: 100%;
107
+ width: 100%;
108
+ flex: 1 1 auto;
109
+ flex-direction: column;
110
+ align-items: center;
111
+ background-color: ${e=>e.theme.colors.grey4};
112
+ `,Ws=G(function(e,a){const{vendorsListDetails:s}=a;return{vendorsList:s.vendors,totalVendorCount:s.totalVendorCount,fetchState:s.fetchState,uiState:s.uiState,searchText:s.searchString,lastRefreshSuccessTime:s.lastRefreshSuccessTime,vendorTabsToShow:a.vendorTabsToShow,isAccountingClassesEnabled:te(e),analytics:L}},function(e,a){const{navigate:s}=a;return{onFetchVendorsList:(t="",n,o)=>{e(mn({searchString:t,keepExistingListItems:n,view:"vendorsTab",pageToken:o}))},onUpdatePageToken:t=>{e(pn({pageToken:t}))},onUpdateSortUiState:(t,n)=>{e(hn({sortOrder:t,sortkey:n}))},onUpdateCurrentYTDSelection:t=>{e(un({ytdSpendSelection:t}))},onVendorRowClick:(t,n)=>{if(a.tenantEmailDomain!=null){const o=tt(t,n,a.tenantEmailDomain),c=N(a.location.state?.pathnameStackToGoBack,a.location.pathname);a.navigate(o,{state:{pathnameStackToGoBack:c,referrer:"Vendor List"}})}},onReloadVendors:()=>{console.log("Reload vendors")},onUpdateScrollYOffset:t=>{e(rn({scrollYOffset:t}))},onBackClick:()=>{s("../..")},onVendorTabSelectionChanged:t=>{const n=ve(t);s(n),e(ie(xe(t)))}}})(Rn);function Zs({vendorTabsToShow:e,previousTabPosition:a,setPreviousTabPosition:s}){const t=J(),n=z(),o=K(),{tenantEmailDomain:c}=R(),r=de(),h=M.getSignedInUser(),{useFeatureGate:i}=ae(),{isFeatureEnabled:m,isFeatureGateLoading:d}=i(Y.isOpexByVendorFeatureEnabled);Te();const u=e.includes("prepaid_expenses"),p=e.includes("fixed_assets"),f=e.includes("accrued_expenses"),D=S(F=>me(F));let x={};x=S(F=>dn(F,"vendorsTab"));const[E,C]=g.useState(!1),{isAiCfoAccessEnabled:b,onAskAiCfoClick:k}=fe({mobileExploreReferrer:"Vendors Summary"});Se({isDataReady:x.fetchState==="Completed"});const I=S(F=>ee(F)),w=S(F=>H(F).isReportGenerated);S(F=>H(F).fetchState)==="Completed"&&w&&m&&!e.includes("operating_expenses_by_vendor")&&e.splice(1,0,"operating_expenses_by_vendor");const[P,j]=g.useState(!1);if(g.useEffect(()=>{(u||p)&&P===!1&&I!=="Completed"&&(n(ye()),j(!0))},[P]),g.useEffect(()=>{n(De({shouldFetchAccruedExpenses:f,shouldFetchFixedAssets:p,shouldFetchPrepaidExpenses:u,shouldFetchOpexByVendor:m&&d===!1,shouldFetchVendorsList:!0,shouldFetchFiling1099Vendor:!1}))},[I,p,d,m]),g.useEffect(()=>{E||x.fetchState!=="Completed"||(C(!0),L.trackVendorList(D.currentTab,D.previousTab??null,x.totalVendorCount,x.uiState.sortKey,x.uiState.ytdSpendSelection))},[x.fetchState]),h==null)throw Error("Can't access address page without signing in...");const[_,A]=g.useState(!1),y=F=>{A(F)};return l.jsxs(Qs,{windowSize:r,children:[l.jsx(ge,{isAppContentDrawerOpen:_,handleDrawerToggle:y}),l.jsx(Ws,{location:o,navigate:t,vendorsListDetails:x,tenantEmailDomain:c,vendorTabsToShow:e,onClickMenuIcon:()=>{y(!0)},previousTabPosition:a,setPreviousTabPosition:s,isAiCfoAccessEnabled:b,onAskAiCfoClick:k})]})}function bo(){const{useFeatureGate:e}=ae(),a=K().state?.referrer,[s,t]=g.useState(!1),[n,o]=g.useState(0),c=M.getSignedInUser(),r=Sn(c),{isFeatureEnabled:h}=e(Y.isOpexByVendorFeatureEnabled),{isFeatureEnabled:i}=e(Y.isVendorReviewFeatureEnabled),{isFeatureEnabled:m}=e(Y.isScheduledJEPrepaidExpensesFeatureEnabled),{isFeatureEnabled:d}=e(Y.isScheduledJEFixedAssetsFeatureEnabled),{isFeatureEnabled:u}=e(Y.isScheduledJEAccruedExpensesFeatureEnabled),{isFeatureEnabled:p}=e(Y.isFiling1099FeatureEnabled),f=S(k=>V(k)),D=f?.externalConnections?.accounting[0]?.connectionName,x=["vendors_tab"];D!=="netsuite"&&m===!0&&x.push("prepaid_expenses"),D!=="netsuite"&&d===!0&&x.push("fixed_assets"),D!=="netsuite"&&u===!0&&x.push("accrued_expenses"),D!=="netsuite"&&p&&r&&(x.push("filing_1099"),h&&x.splice(1,0,"operating_expenses_by_vendor"));const{isFeatureEnabled:E}=e(Y.isDebitCardFeatureEnabled),C=fn(E,f),b=gn(f);return C===!0||b===!0?l.jsx(at,{children:l.jsx(B,{path:"/*",element:l.jsx(Jn,{})})}):l.jsxs(at,{children:[l.jsx(B,{path:"/opex",element:h===!0?l.jsx(bs,{previousTabPosition:n,setPreviousTabPosition:o,vendorTabsToShow:x}):l.jsx($,{to:"../summary"})}),l.jsx(B,{path:"/summary",element:l.jsx(Zs,{previousTabPosition:n,setPreviousTabPosition:o,vendorTabsToShow:x})}),l.jsx(B,{path:"schedules/fixed_assets/details/:scheduleDetailId",element:d===!0?l.jsx(ss,{}):l.jsx($,{to:"../../vendors/opex"})}),l.jsx(B,{path:"schedules/accrued_expenses/details/:scheduleDetailId",element:d===!0?l.jsx(Xn,{shouldNavigateBack:s,setShouldNavigateBack:t}):l.jsx($,{to:"../../vendors/opex"})}),l.jsx(B,{path:"schedules/:scheduleType/details/:scheduleDetailId",element:m===!0?l.jsx(rs,{}):l.jsx($,{to:"../../vendors/opex"})}),l.jsx(B,{path:"schedules/:scheduleType/details/:scheduleDetailId/edit_link",element:m===!0||d===!0?l.jsx(fs,{}):l.jsx($,{to:"../../vendors/opex"})}),l.jsx(B,{path:"schedules/accrued_expenses/details/:scheduleDetailId/edit_link",element:u===!0?l.jsx(Hn,{setShouldNavigateBack:t}):l.jsx($,{to:"../../vendors/opex"})}),l.jsx(B,{path:"schedules/prepaid_expenses",element:m===!0?l.jsx(Is,{previousTabPosition:n,setPreviousTabPosition:o,vendorTabsToShow:x}):l.jsx($,{to:"../opex"})}),l.jsx(B,{path:"schedules/fixed_assets",element:d===!0?l.jsx(ys,{previousTabPosition:n,setPreviousTabPosition:o,vendorTabsToShow:x}):l.jsx($,{to:"../opex"})}),l.jsx(B,{path:"schedules/accrued_expenses",element:u===!0?l.jsx(xs,{previousTabPosition:n,setPreviousTabPosition:o,vendorTabsToShow:x}):l.jsx($,{to:"../opex"})}),l.jsx(B,{path:"/filing_1099",element:p&&r?l.jsx(mt,{previousTabPosition:n,setPreviousTabPosition:o,vendorTabsToShow:x}):l.jsx($,{to:"../opex"})}),l.jsx(B,{path:"/filing_1099/:vendorId",element:p&&r?l.jsx(mt,{vendorTabsToShow:x,previousTabPosition:n,setPreviousTabPosition:o}):l.jsx($,{to:"../opex"})}),l.jsx(B,{path:"/filing_1099/upload/:vendorId/edit",element:p&&r?l.jsx(ht,{appContent:l.jsx(Ks,{}),showFullScreenSkeletonWhileLoading:!0}):l.jsx($,{to:"../opex"})}),l.jsx(B,{path:"/filing_1099/upload/:vendorId/edit/new/:addressType",element:p&&r?l.jsx(ht,{appContent:l.jsx(Nn,{isSubPage:!0,hideAddressBackButton:!0,hideAddressSubTitle:!0})}):l.jsx($,{to:"../opex"})}),l.jsx(B,{path:"/summary/:vendorId/:qboId",element:l.jsx(ut,{referrerType:a,isFiling1099FeatureEnabled:p&&r})}),l.jsx(B,{path:"/summary/:vendorId/:qboId/:timeframe/:startDate/:endDate",element:l.jsx(ut,{referrerType:a,isFiling1099FeatureEnabled:p&&r})}),l.jsx(B,{path:"/review",element:i===!0?l.jsx(pt,{}):l.jsx(le,{})}),l.jsx(B,{path:"/review/vendor/:vendorId",element:i?l.jsx(pt,{}):l.jsx(le,{})}),l.jsx(B,{path:"/",element:l.jsx($,{to:"summary"})}),l.jsx(B,{path:"*",element:l.jsx(le,{})})]})}export{bo as default};
@@ -0,0 +1,12 @@
1
+ import{j as o}from"./liveblocks-FvHIfhey.js";import{a as f}from"./sentry-BGmWGtx4.js";import{s as u,u as h,j as y,N as I}from"./core-4srnP2ry.js";import{Kh as b,eY as w,Ad as j}from"./zeni-epic-state-Cicf7kze.js";import{z as l,B as x,C as S,E}from"./index-C7Pw0HtV.js";import{n as p}from"./mui-BM0jIy5o.js";import"./recharts-DVgLcWbN.js";import"./analytics-BoOSk_FS.js";import"./plaid-mry1J-xa.js";import"./dnd-CUjyBBrM.js";import"./stripe-DMRn4zHo.js";import"./lottie-jiJBGHVV.js";import"./lexical-B1-kkGoh.js";import"./pdf-whYpMQAC.js";import"./utils-BQpFY40P.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]="bd814a5f-7dea-4a25-a1c1-f91af136f0a9",e._sentryDebugIdIdentifier="sentry-dbid-bd814a5f-7dea-4a25-a1c1-f91af136f0a9")}catch{}})();const Y=()=>{const[e]=u(),t=e.get("code")??"",i=e.get("state")??"",c=e.get("profileId")??"",[a,g]=f.useState(!1),n=h(),s=y(m=>b(m)),r=l.getSignedInUser(),d=l.getSignedInUserTenantWithId(i);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 w(r.userId,r.zeniSessionId,d?.tenantId),f.useEffect(()=>{a||(g(!0),n(j(t,c,i)))},[a,n]),s.fetchState==="Error"?o.jsx(D,{children:o.jsx(_,{children:s.error?.message??""})}):(s.fetchState==="Completed"&&window.close(),o.jsx(x,{fetchState:"In-Progress"}))},D=p.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
+ `,_=p(E.LargeRegular)`
10
+ display: flex;
11
+ color: ${S.important};
12
+ `;export{Y as default};
@@ -0,0 +1,57 @@
1
+ import{j as n}from"./liveblocks-FvHIfhey.js";import{h as ne,g as W,u as M,i as Y,j as A,n as q,N as X,o as Ve,p as k}from"./core-4srnP2ry.js";import{eR as U,Pb as Ce,Pc as $e,cl as ee,cm as Ze,fi as Ne,xq as ke,BD as He,xk as Tn,Pd as Fn,Pe as Bn,xn as On,xu as fe,xh as Ln,xe as Rn,NY as le,Pf as Un,F3 as _n,L3 as zn,F5 as Mn,kp as Fe,Pg as Vn,qL as Ge,qz as We,kg as Ye,kj as Be,L4 as Oe,L5 as $n,Ph as Zn,ki as Nn,kF as Hn,k7 as Gn,iG as Wn,iF as Yn,Pi as qn,Pj as ye,EM as Jn,Pk as Kn,Pl as Qn,NR as Ae,Pm as Le,Pn as Xn,Fg as et,OB as nt,Cx as qe,tc as Je,Po as tt,Fd as at,Pp as Ke,cM as we,Fk as Qe,fj as ot,e_ as Xe,f0 as De,Fi as st,Cr as rt,Fa as it,Pq as en,Pr as nn,EO as tn,EY as Re,Ps as ct,Oo as lt,Fl as dt,bt as ut,bF as pt,cx as mt,bG as gt,bs as ht,J_ as ft}from"./zeni-epic-state-Cicf7kze.js";import{k as te,s as Z,z as S,d as O,m as _,B as de,bY as yt,a2 as Ie,J as V,A as J,r as an,aq as xt,af as Ue,e as L,bZ as Ct,at as Se,b_ as kt,x as ue,b$ as At,g as be,aN as G,c0 as wt,V as Dt,Z as on,ac as It,c1 as _e,c2 as St,v as ce,c3 as bt,c4 as Pt,c5 as vt,a9 as Et,o as jt}from"./index-C7Pw0HtV.js";import{n as z,D as K,S as Q}from"./mui-BM0jIy5o.js";import ie from"./NotFoundScreen-B1j26TaW.js";import{S as ze}from"./SetupPagesScreen-Bsr5a1pQ.js";import{F as sn}from"./FeaturePreviewScreen-nQP4PBuN.js";import{a as d}from"./sentry-BGmWGtx4.js";import{M as pe}from"./MobileAppDrawer-MkL6Ri_E.js";import{A as Tt,D as Ft,V as Bt}from"./DomesticWireDetailScreen-hVPTa7zl.js";import{A as Ot}from"./AddressScreen-DVPbua-7.js";import{u as rn}from"./useAskAiCfoHostNavButtonProps-CHKiu4ka.js";import{Z as Lt}from"./ZeniAccountStatementScreen-Coj3gUoh.js";import"./recharts-DVgLcWbN.js";import"./analytics-BoOSk_FS.js";import"./plaid-mry1J-xa.js";import"./dnd-CUjyBBrM.js";import"./stripe-DMRn4zHo.js";import"./lottie-jiJBGHVV.js";import"./lexical-B1-kkGoh.js";import"./pdf-whYpMQAC.js";import"./utils-BQpFY40P.js";import"./analyticsHelper-BEsUC0Tf.js";import"./routePaths-DTTWQHJ_.js";import"./BusinessVerificationPageScreen-BVkfBtGX.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]="068e669f-ebe9-4c5e-9e5e-f3e9b457a6f0",e._sentryDebugIdIdentifier="sentry-dbid-068e669f-ebe9-4c5e-9e5e-f3e9b457a6f0")}catch{}})();const Rt=z.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
+ `,Ut=q(function(e){return{autoTransferRuleView:Ce(e),downloadAccountDetailEndPoint:`${Ie}/account_details`,transferLimit:5e5,depositAccountListView:He(e.depositAccountState,e.depositAccountListState)}},function(e,t){const{navigate:s,handleDrawerToggle:o}=t;return{onBackClick:()=>{s("..")},onClickMenuIcon:()=>{o(!0)},onFetchAutoTransferRules:a=>{e(ke(a))},onCreateRule:()=>{e(Rn())},onUpdateRule:a=>{e(fe(a))},onDeleteClick:a=>{e(Ln(a))},onPauseClick:a=>{e(fe(a,!0,!1))},onResumeClick:a=>{e(fe(a,!1,!0))},onActivityClick:(a,r)=>{e(On(a,r))},onUpdateRuleLocalData:a=>{e(Bn(a))},clearRuleLocalData:()=>{e(Fn())},onEditClick:a=>{s(`./${a}/edit`)},onEditDrawerClose:()=>{s("../../",{relative:"path"})},onReviewClick:()=>{e(Tn())}}})(yt);function Me({isEditDrawerOpen:e}){const t=ne(),s=W(),o=M(),a=te(),{ruleId:r,tenantEmailDomain:u}=Y(),{useFeatureGate:l}=Z(),[p,g]=d.useState(!1),[x,i]=d.useState(!1),c=A(y=>U(y)),m=A(y=>Ce(y)),C=m?.fetchState??"Not-Started",b=A(y=>$e(y)),h=c?.companyId??S.getSignedInUserTenant(u)?.companyId,w=ee(a?.loggedInUserRoleMap)||Ze(a?.loggedInUserRoleMap),{isFeatureEnabled:D}=l(O.isTreasuryEnabled),f=c?.company!=null&&Ne(c.company),I=D&&f,F=S.getSignedInUser(),R=c.tenantId,j={userId:F?.userId??"",sessionId:F?.zeniSessionId??"",tenantId:R??""},v=c.companyName;d.useEffect(()=>{!x&&C==="Not-Started"&&h&&(i(!0),o(ke(!0)))},[x,C,h,o]);const P=y=>{g(y)},T=_(),E=!!s.state?.scrollToAddRule;return m?.fetchState!=="Completed"?n.jsx(de,{fetchState:"In-Progress",style:{backgroundColor:T.colors.grey5}}):n.jsxs(Rt,{children:[n.jsx(pe,{isAppContentDrawerOpen:p,handleDrawerToggle:P}),n.jsx(Ut,{navigate:t,location:s,currentTenant:c,companyName:v,handleDrawerToggle:P,isEditDrawerOpen:e,editingRuleId:r,authParams:j,includeTreasuryOption:I,hasAdminLevelAccess:w,zeniAccountsConfigDetail:b,scrollToAddRule:E})]})}const _t={overlayWidth:new J(100,100,58)},zt=({vendorId:e,isDrawerOpen:t,closeDrawerHandler:s})=>{const o=M(),a=_(),r=V();if(S.getSignedInUser()==null)throw Error("Can't access ach account page without signing in...");return n.jsx(K,{onClose:()=>{s(!0),o(le())},anchor:"right",open:t,PaperProps:{style:{width:_t.overlayWidth.valuePercentage(r),boxShadow:"none"}},slotProps:{backdrop:{style:{backgroundColor:a.colors.black,opacity:.75,cursor:"pointer"}}},children:n.jsx(Mt,{onClick:u=>u.stopPropagation(),children:n.jsx(Tt,{vendorIdParam:e,accountContext:"express-pay"})})})},Mt=z(Q)`
10
+ display: flex;
11
+ min-height: 100%;
12
+ flex-direction: column;
13
+ `,Vt={overlayWidth:new J(100,100,58)},$t=({isDrawerOpen:e,closeDrawerHandler:t})=>{const s=M(),o=_(),a=V();if(S.getSignedInUser()==null)throw Error("Can't access address page without signing in...");return n.jsx(K,{onClose:()=>{t(!0),s(le())},anchor:"right",open:e,PaperProps:{style:{width:Vt.overlayWidth.valuePercentage(a),boxShadow:"none"}},slotProps:{backdrop:{style:{backgroundColor:o.colors.black,opacity:.75,cursor:"pointer"}}},children:n.jsx(Zt,{onClick:r=>r.stopPropagation(),children:n.jsx(Ot,{accountContext:"express-pay",addressTypeParam:"vendor_address"})})})},Zt=z(Q)`
14
+ display: flex;
15
+ min-height: 100%;
16
+ flex-direction: column;
17
+ `,Nt={overlayWidth:new J(100,100,58)},Ht=({vendorId:e,isDrawerOpen:t,closeDrawerHandler:s})=>{const o=M(),a=_(),r=V();if(S.getSignedInUser()==null)throw Error("Can't access ach account page without signing in...");return n.jsx(K,{onClose:()=>{s(!0),o(le())},anchor:"right",open:t,PaperProps:{style:{width:Nt.overlayWidth.valuePercentage(r),boxShadow:"none"}},slotProps:{backdrop:{style:{backgroundColor:a.colors.black,opacity:.75,cursor:"pointer"}}},children:n.jsx(Gt,{onClick:u=>u.stopPropagation(),children:n.jsx(Ft,{vendorIdParam:e,accountContext:"express-pay"})})})},Gt=z(Q)`
18
+ display: flex;
19
+ min-height: 100%;
20
+ flex-direction: column;
21
+ `,Wt=z.div`
22
+ display: flex;
23
+ height: 100vh;
24
+ width: 100%;
25
+ flex: 1 1 auto;
26
+ flex-direction: column;
27
+ align-items: center;
28
+ background-color: ${e=>e.theme.colors.grey4};
29
+ `,Yt=q(function(e,t){const s=U(e),o=S.getSignedInUser(),a=s.tenantId,r={userId:o?.userId??"",sessionId:o?.zeniSessionId??"",tenantId:a??""},u=t.expressPayDetails,l=e.entityAutoCompleteState.autoCompleteText.common,p=zn(e,"common");return{expressPayDetails:u,fileProps:{authParams:r,filesEndPoint:`${Se.fileMicroServiceBaseUrl}`},vendorSearchAutoCompleteData:{autoCompleteText:l,entityAutoCompleteView:p},analytics:t.analytics}},function(e,t){const{navigate:s}=t;return{onSaveVendor:o=>{e(Yn(o,void 0,void 0,!0))},saveVendorDetailLocalData:(o,a)=>{e(Be({vendorId:a,localData:o}))},saveExpressPayLocalData:o=>{e(Wn({localData:o}))},onVendorSelected:o=>{o!=null&&e(Gn(o,!1))},updateSelectedVendorForCreate:o=>{e(Hn(o))},initializeVendorAddress:()=>{e(Nn())},resetVendorSaveStatus:o=>{e(Zn({vendorId:o}))},vendorSearchAutoCompleteActions:{onAutoCompleteInputChange:(o,a)=>{o.trim().length>=2?e($n({searchString:o,entityType:a,searchOrigin:"common"})):o.trim().length===0&&e(Oe("common"))},onCancelAutoComplete:()=>{e(Oe("common"))}},chooseNewVendor:o=>{e(Be({localData:{vendorName:o}}))},onClickAddAccount:o=>{o.method.toLowerCase().indexOf("ach")!==-1?s("./add-ach",{relative:"path"}):o.method.toLowerCase().indexOf("wire")!==-1&&o.method.toLowerCase().indexOf("domestic")!==-1&&s("./add-wire",{relative:"path"})},updateFilesEntity:o=>{e(Ye({files:o}))},onDeleteFile:o=>{e(We(o))},onEditFileName:(o,a)=>{e(Ge(o,a.split(".")[0]))},onBackClick:o=>{o!=null&&e(Fe(o)),e(Fe()),e(Vn()),e(le()),s("../",{relative:"path"})},onSchedulePayment:()=>{e(Mn())}}})(Ct);function se({isAddACHDrawerOpen:e,isAddWireDrawerOpen:t,isAddAddressDrawerOpen:s}){const o=ne(),a=W(),r=M(),[u,l]=d.useState(!1),{tenantEmailDomain:p}=Y(),g=te(),x=A(y=>y.expressPayState.fetchState),i=A(y=>U(y)),c=A(y=>Un(y)),m=c.expressPayLocalData?.vendorId,C=i.companyId??S.getSignedInUserTenant(p)?.companyId,[b,h]=d.useState(!1),[w,D]=d.useState(!1),[f,I]=d.useState(!1),F=an(a.state?.pathnameStackToGoBack),{poppedPathname:R}=F,j=R?.split("/"),v=j?.[j.length-1];d.useEffect(()=>{e===!0?h(!0):(h(!1),document.body.style.overflow="auto")},[e]),d.useEffect(()=>{t===!0?D(!0):(D(!1),document.body.style.overflow="auto")},[t]),d.useEffect(()=>{s===!0?I(!0):(I(!1),document.body.style.overflow="auto")},[s]),d.useEffect(()=>{x==="Not-Started"&&r(_n(!0,!0))},[x,r]);const P=xt(c.vendorViewDetails.bankAccountCreationState?.fetchState);if(d.useEffect(()=>{P==="In-Progress"&&c.vendorViewDetails.bankAccountCreationState?.fetchState==="Completed"&&E()},[P,c.vendorViewDetails.bankAccountCreationState?.fetchState]),S.getSignedInUser()==null)throw Error("Can't access express pay page without signing in...");const T=y=>{l(y)},E=()=>{h(!1),D(!1),o("../",{relative:"path"})};return n.jsxs(Wt,{children:[Ue(a)?n.jsx(pe,{isAppContentDrawerOpen:u,handleDrawerToggle:T}):null,b===!0?n.jsx(zt,{vendorId:m,closeDrawerHandler:E,isDrawerOpen:b}):null,w===!0?n.jsx(Ht,{vendorId:m,closeDrawerHandler:E,isDrawerOpen:w}):null,f===!0?n.jsx($t,{closeDrawerHandler:E,isDrawerOpen:f}):null,n.jsx(Bt,{vendorId:m,isExpressPayPage:!0}),n.jsx(Yt,{navigate:o,location:a,companyId:C,accountId:v,analytics:L,currentTenant:i,vendorId:m,roleMap:g?.loggedInUserRoleMap,isSettings:Ue(a),expressPayDetails:c,onClickMenuIcon:()=>{T(!0)}})]})}const qt={overlayWidth:new J(100,100,58)},Jt=({authParams:e,downloadAccountDetailEndPoint:t,isAccountInfoDrawerOpen:s,zeniBankAccountDetail:o,closeDrawerHandler:a})=>{const r=_(),u=V(),l=A(i=>$e(i)),p=A(i=>U(i));if(S.getSignedInUser()==null)throw Error("Can't access Account detail page without signing in...");const g=()=>{a(!0)},x={depositAccount:o,onDismissClick:g,zeniAccountsConfigDetail:l,authParams:e,downloadAccountDetailEndPoint:t,currentTenant:p};return n.jsx(K,{anchor:"right",open:s,PaperProps:{style:{width:qt.overlayWidth.valuePercentage(u),boxShadow:"none"}},slotProps:{backdrop:{style:{backgroundColor:r.colors.black,opacity:.75,cursor:"pointer"}}},onClose:()=>g(),children:n.jsx(Kt,{onClick:i=>i.stopPropagation(),children:n.jsx(kt,{...x})})})},Kt=z(Q)`
30
+ display: flex;
31
+ min-height: 100%;
32
+ flex-direction: column;
33
+ `,Qt={overlayWidth:new J(100,100,58)},cn=({isCheckDepositDrawerOpen:e,closeDrawerHandler:t})=>{const s=_(),o=V(),a=M(),r=A(i=>U(i)),u=S.getSignedInUser(),l=r.tenantId,p={userId:u?.userId??"",sessionId:u?.zeniSessionId??"",tenantId:l??""};if(u==null)throw Error("Can't access check deposit page without signing in...");const g=A(i=>qn(i)),x={analytics:L,checkDeposit:g,filesEndPoint:`${Se.fileMicroServiceBaseUrl}`,authParams:p,onSaveChangesToLocalStore:i=>{a(Kn(i))},updateFilesEntity:i=>{a(Ye({files:i}))},onAnotherTransferClick:()=>{a(ye())},onDeleteFile:i=>{a(We(i))},onEditFileName:(i,c)=>{a(Ge(i,c.split(".")[0]))},onCheckDpositClick:()=>{a(Jn())},onDismissClick:()=>{t(!0),a(ye())}};return n.jsxs(n.Fragment,{children:[n.jsx(ue,{analytics:L,onLoad:i=>(c=>c.trackPageLoaded(be.Event.accountsDepositCheckFormViewed))(i)}),n.jsx(K,{anchor:"right",open:e,PaperProps:{style:{width:Qt.overlayWidth.valuePercentage(o),boxShadow:"none",zIndex:8}},slotProps:{backdrop:{style:{backgroundColor:s.colors.black,opacity:.75,cursor:"pointer"}}},onClose:(i,c)=>(c==="backdropClick"||c==="escapeKeyDown")&&(t(!0),void a(ye())),children:n.jsx(Xt,{onClick:i=>i.stopPropagation(),children:n.jsx(At,{...x})})})]})},Xt=z(Q)`
34
+ display: flex;
35
+ min-height: 100%;
36
+ flex-direction: column;
37
+ `,ea={overlayWidth:new J(100,100,58)},na=q(function(e,t){const s=t.currentTenant?.companyId;return{plaidConnectionDetails:nt(e,s,"zeni_accounts","external_account").plaidConnectionDetails,depositAccountListView:He(e.depositAccountState,e.depositAccountListState)}},function(e,t){return{onReviewClick:()=>e(at()),clearReviewTransferDetail:()=>e(tt()),onFetchLinkTokenClick:s=>{e(Je("external_account",s))},onEstablishConnectionClick:s=>{e(qe(s,t.currentTenant?.companyId,"external_account",void 0,"link_external_account"))}}})(wt),ln=({isTransferDrawerOpen:e,authParams:t,downloadAccountDetailEndPoint:s,closeDrawerHandler:o,zeniAccountsConfig:a})=>{const r=A(f=>Qn(f)),u=A(f=>U(f)),l=_(),p=V(),g=M(),{accountId:x}=Y(),[i,c]=d.useState("achTransfer"),[m,C]=d.useState(!1);if(S.getSignedInUser()==null)throw Error("Can't access invite people page without signing in...");const{useDynamicConfig:b}=Z(),{configValue:h}=b(G.zeniAccountsConfig),w=Ae(h),D=()=>{o(!0),g(Le())};return d.useEffect(()=>{r.reviewTransferDetail.fetchState==="Completed"&&C(!0)},[C,r.reviewTransferDetail.fetchState]),n.jsxs(n.Fragment,{children:[n.jsx(ue,{analytics:L,onLoad:f=>(I=>I.trackPageLoaded(be.Event.zeniAccountsTransferFormViewed))(f)}),n.jsx(K,{onClose:()=>{(i==="achTransfer"&&m===!1||i==="achTransfer"&&m&&r.fetchState==="Completed")&&D()},anchor:"right",open:e,PaperProps:{style:{width:ea.overlayWidth.valuePercentage(p),boxShadow:"none"}},slotProps:{backdrop:{style:{backgroundColor:l.colors.black,opacity:.75,cursor:"pointer"}}},children:n.jsx(ta,{onClick:f=>f.stopPropagation(),children:n.jsx(na,{analytics:L,transferDetails:r,authParams:t,downloadAccountDetailEndPoint:s,onTransferClick:()=>{L.trackTransferBetweenAccountsFormClicked("Transfer",r.reviewTransferDetail.reviewTransferMoney.isShowDailyAchLimitWarning?"Review Split Transfer":"Review Transfer",r.transferDetailLocalData.transferFrom?.label,r.transferDetailLocalData.transferTo?.label,r.transferDetailLocalData.amount.amount,r.reviewTransferDetail.reviewTransferMoney.isShowDailyAchLimitWarning,r.reviewTransferDetail.reviewTransferMoney.transferSchedules.length,r.transferDetailLocalData.transferFrom?.accType==="paymentAccount"&&r.transferDetailLocalData.transferTo?.accType==="depositAccount"&&a.zeniAccountsConfigDetail.depositProductConfig.depositProducts?.[0].range?.[1]!=null&&r.transferDetailLocalData.amount.amount>a.zeniAccountsConfigDetail.depositProductConfig.depositProducts[0].range[1]),g(et(x))},onDismissClick:D,onSaveChangesToLocalStore:f=>{g(Xn(f))},onAnotherTransferClick:()=>{C(!1),g(Le())},currentTenant:u,zeniAccountsConfigDetail:a,currentDrawerContent:i,setCurrentDrawerContent:c,showReviewContent:m,setShowReviewContent:C,onBackClick:()=>{},maxInsuredAmount:w.maxInsuredAmount})})})]})},ta=z(Q)`
38
+ display: flex;
39
+ min-height: 100%;
40
+ flex-direction: column;
41
+ `,aa=z.div`
42
+ display: flex;
43
+ min-height: 100%;
44
+ width: 100%;
45
+ flex: 1 1 auto;
46
+ flex-direction: column;
47
+ align-items: center;
48
+ background-color: ${e=>e.theme.colors.grey4};
49
+ `,oa=q(function(e,t){return{zeniAccountListView:Ke(e),isExpressPayEnabled:t.isExpressPayEnabled,analytics:t.analytics}},function(e,t){const{navigate:s,currentTenant:o,location:a,companyId:r,handleDrawerToggle:u,analytics:l,isBillPayEnabled:p,isDebitCardFeatureEnabled:g}=t,{tenantEmailDomain:x}=o;return{onZeniAccountClick:(i,c)=>{l.trackAccountsListPageClicked("Accounts Row Item Click",c,"active");const m=sa(x,i),C=ce(a.state?.pathnameStackToGoBack,a.pathname);s(m,{state:{pathnameStackToGoBack:C}})},onSettingsClick:()=>{l.trackAccountsListPageClicked("Settings Icon"),s("setup")},onReloadTransactions:()=>{e(Qe(!1))},handleMoveMoneyOptionSelection:(i,c)=>{let m="page-not-found";i==="sendMoney"&&(m=mn(x)),i==="payBill"?m=dn(o,p,g):i==="transfer"?(m=un(x),c!=null&&e(en(c))):i==="checkDeposit"&&(m=pn(x));const C=ce(a.state?.pathnameStackToGoBack,a.pathname);s(m,{state:{pathnameStackToGoBack:C}})},unlinkPaymentAccount:(i,c)=>{l.trackAccountsListPageClicked("Unlink Account",c),e(it(i))},onFetchLinkTokenClick:(i,c)=>{e(Je("external_account",i,c))},onUpdatePaymentAccountStatus:(i,c,m)=>{e(rt(i,c,"zeni_accounts","external_account",m))},onEstablishConnectionClick:i=>{e(qe(i,r,"external_account",void 0,"link_external_account"))},onCreateCheckingClick:i=>{e(st(i))},onClickMenuIcon:()=>{u(!0)},onTreasuryGetStartedClick:()=>{s("../../treasury/promo")},onAutoTransferClick:i=>{i?s("./auto-transfer",{state:{...a.state,scrollToAddRule:!0}}):s("./auto-transfer")}}})(St);function xe({isTransferDrawerOpen:e,isCheckDepositDrawerOpen:t}){const s=W(),o=ne(),a=M(),r=V(),{tenantEmailDomain:u}=Y(),{useDynamicConfig:l,useFeatureGate:p}=Z(),g=_(),{configValue:x}=l(G.zeniAccountsConfig),{isFeatureEnabled:i}=p(O.isTreasuryEnabled),{isFeatureEnabled:c}=p(O.isDebitCardFeatureEnabled),{isFeatureEnabled:m}=p(O.isAutoTransferRuleEnabled),{isFeatureEnabled:C}=p(O.isCheckingCommentingEnabled),b=Ae(x),h=A(B=>U(B)),w=h.companyId??S.getSignedInUserTenant(u)?.companyId,{configValue:D}=l(G.expressPayConfig),f=D.is_enable_all_tenants===!0||D.tenant_ids!=null&&D.tenant_ids.includes(h.tenantId),[I,F]=d.useState(!1),[R,j]=d.useState(!1),[v,P]=d.useState(!1),[T,E]=d.useState(!1),y=A(B=>Ke(B)),$=y.fetchState,ae=A(B=>Ce(B)),oe=ae?.fetchState??"Not-Started",me=!!h.companyZeniAccountInfo?.info?.isZeniAccountEnabled,N=te(),H=!!h.companyZeniAccountInfo?.info?.isZeniAccountTOSAccepted,gn=!!h.companyTreasuryInfo?.info?.isTreasuryTOSAccepted,hn=ee(N?.loggedInUserRoleMap),fn=we(N?.loggedInUserRoleMap),yn=!!h.companyBillPayInfo?.info?.isBillPayEnabled,Pe=S.getSignedInUser(),xn={userId:Pe?.userId??"",sessionId:Pe?.zeniSessionId??"",tenantId:h.tenantId??""},Cn=`${Ie}/account_details`,{areTenantIdsInSync:ve}=Dt();d.useEffect(()=>{!I&&ve&&(F(!0),a(Qe(!1)))},[I,a,$,ve]),d.useEffect(()=>{!R&&oe==="Not-Started"&&w&&(j(!0),a(ke(!0)))},[R,oe,w,a]),d.useEffect(()=>{e!=null&&e===!0?P(!0):(P(!1),document.body.style.overflow="auto")},[e]),d.useEffect(()=>{E(t!=null&&t===!0)},[t]);const Ee=()=>{P(!1),o("..")},[kn,An]=d.useState(!1),je=B=>{An(B)},{isAiCfoAccessEnabled:wn,onAskAiCfoClick:Dn}=rn({mobileExploreReferrer:"Checking Accounts"});on({isDataReady:$==="Completed"});const In=h.company!=null&&Ne(h.company),ge=(i&&In)===!0&&!gn,[Sn,bn]=d.useState(!1),he=A(B=>B.treasurySetupViewState.treasuryFundsDetails),Pn=he.fundsDetails,vn=It(Pn);d.useEffect(()=>{ge!==!0||Sn||he?.fetchStatus.fetchState!=="Not-Started"||(bn(!0),a(ot()))},[he.fetchStatus,a]);const En=Xe(h),jn=De(c,h);return En===!0&&jn!==!0?n.jsx(sn,{}):me?n.jsxs(n.Fragment,{children:[y.fetchState==="Completed"&&v===!1&&T===!1?n.jsx(ue,{analytics:L,onLoad:B=>(Te=>{Te.trackAccountsListPageViewed(y.depositAccountsSelectorView.depositAccounts.length,y.externalAccountsSelectorView.paymentAccounts.length,_e(y.summary?.totalBalance.available.amount??0),_e(y.summary?.totalInterest.available.amount??0),y.zeniAccountsConfig.zeniAccountsConfigDetail.annualPercentageYield),ge&&Te.trackTreasuryPromoView("Checking Promo Banner")})(B)}):null,v===!0?n.jsx(ln,{closeDrawerHandler:Ee,isTransferDrawerOpen:v,zeniAccountsConfig:y.zeniAccountsConfig,authParams:xn,downloadAccountDetailEndPoint:Cn}):null,T===!0?n.jsx(cn,{closeDrawerHandler:Ee,isCheckDepositDrawerOpen:T}):null,n.jsxs(aa,{windowSize:r,children:[n.jsx(pe,{isAppContentDrawerOpen:kn,handleDrawerToggle:je}),n.jsx(oa,{zeniBankListView:y,navigate:o,currentTenant:h,location:s,companyId:w,analytics:L,maxInsuredAmount:b.maxInsuredAmount,isExpressPayEnabled:f,isBillPayEnabled:yn,isCheckingCommentingEnabled:C,isDebitCardFeatureEnabled:c,isAutoTransferRuleEnabled:m,handleDrawerToggle:je,showTreasuryPromo:ge,treasuryYieldPercentage:vn,treasuryInsuredAmount:5e5,isAiCfoAccessEnabled:wn,onAskAiCfoClick:Dn})]})]}):H&&hn?n.jsx(X,{to:"../setup"}):h.companyZeniAccountInfo?.info&&!H&&fn?n.jsx(X,{to:"../promo",state:s.state}):n.jsx(de,{fetchState:"In-Progress",style:{backgroundColor:g.colors.grey5}})}const dn=(e,t,s)=>{const o=De(s,e),{tenantEmailDomain:a}=e;return o===!0||t===!1?`/${a}/bills`:`/${a}/bill/new`},sa=(e,t)=>`/${e}/checking/${t}`,un=(e,t)=>t==null?`/${e}/checking/transfer`:`/${e}/checking/${t}/transfer`,pn=(e,t)=>t==null?`/${e}/checking/check-deposit`:`/${e}/checking/${t}/check-deposit`,mn=e=>`/${e}/checking/express-pay`,ra=z.div`
50
+ display: flex;
51
+ width: 100%;
52
+ flex: 1 1 auto;
53
+ flex-direction: column;
54
+ align-items: center;
55
+ min-height: 100vh;
56
+ background-color: ${e=>e.theme.colors.grey4};
57
+ `,ia=q(function(e,t){const{currentTenant:s}=t,o=nn(e,t.accountId),a=S.getSignedInUser(),r=e.tenantState.currentTenantId,u={userId:a?.userId??"",sessionId:a?.zeniSessionId??"",tenantId:r??""},l=o.accountDetail?.id??"";return{currentTenantCompanyName:s.companyName??"",authParams:u,downloadEndPoint:`${Se.bankingMicroServiceBaseUrl}/1.0/deposit-accounts/${l}`,zeniAccountDetail:o,isExpressPayEnabled:t.isExpressPayEnabled,fetchState:o.fetchState}},function(e,t){const{navigate:s,currentTenant:o,location:a,accountId:r}=t,{tenantEmailDomain:u}=o;return{handleMoveMoneyOptionSelection:(l,p)=>{let g="page-not-found";l==="sendMoney"?g=mn(u):l==="payBill"?g=dn(o,t.isBillPayEnabled,t.isDebitCardFeatureEnabled):l==="transfer"?(g=un(u,r),p!=null&&e(en(p))):l==="checkDeposit"?(g=pn(u,r),p!=null&&e(ct(p))):l==="accountStatement"&&(g=la(u,r));const x=ce(a.state?.pathnameStackToGoBack,a.pathname);s(g,{state:{pathnameStackToGoBack:x}})},onAccountDetailClick:()=>{const l=ca(u,r),p=ce(a.state?.pathnameStackToGoBack,a.pathname);s(l,{state:{pathnameStackToGoBack:p}})},onEditNameClick:l=>{e(Re(r,"editName",l))},onReloadZeniAccountDetailPage:()=>{e(tn(r,!1))},onCloseAccountClick:()=>{e(Re(r,"closeAccount",""))},onBackClick:()=>{s("../",{relative:"path"})}}})(bt);function re({isTransferDrawerOpen:e,isCheckDepositDrawerOpen:t,isAccountInfoDrawerOpen:s}){const o=W(),a=ne(),r=M(),u=V(),{tenantEmailDomain:l,accountId:p}=Y(),{useDynamicConfig:g}=Z(),{useFeatureGate:x}=Z(),{isFeatureEnabled:i}=x(O.isDebitCardFeatureEnabled),{isFeatureEnabled:c}=x(O.isCheckingCommentingEnabled),m=A(H=>U(H)),{configValue:C}=g(G.expressPayConfig),b=C.is_enable_all_tenants===!0||C.tenant_ids!=null&&C.tenant_ids.includes(m.tenantId),h=!!m.companyBillPayInfo?.info?.isBillPayEnabled,w=S.getSignedInUser(),D=m.companyId??S.getSignedInUserTenant(l)?.companyId,f={userId:w?.userId??"",sessionId:w?.zeniSessionId??"",tenantId:m.tenantId??""},I=`${Ie}/account_details`,[F,R]=d.useState(!1),[j,v]=d.useState(!1),[P,T]=d.useState(!1),[E,y]=d.useState(!1),$=A(H=>nn(H,p??"")),ae=$.fetchState,{isAiCfoAccessEnabled:oe,onAskAiCfoClick:me}=rn({mobileExploreReferrer:"Checking Account Detail"});on({isDataReady:ae==="Completed"}),d.useEffect(()=>{F||(r(tn(p??"",!1)),R(!0))},[F,r,ae]),d.useEffect(()=>{y(s!=null&&s===!0)},[s]),d.useEffect(()=>{e!=null&&e===!0?v(!0):(v(!1),document.body.style.overflow="auto")},[e]),d.useEffect(()=>{T(t!=null&&t===!0)},[t]);const N=()=>{y(!1),a("..")};return n.jsxs(n.Fragment,{children:[E===!0&&$.accountDetail!=null?n.jsx(Jt,{authParams:f,downloadAccountDetailEndPoint:I,closeDrawerHandler:N,isAccountInfoDrawerOpen:E,zeniBankAccountDetail:$.accountDetail}):null,j===!0?n.jsx(ln,{closeDrawerHandler:N,isTransferDrawerOpen:j,zeniAccountsConfig:$.zeniAccountsConfig,authParams:f,downloadAccountDetailEndPoint:I}):null,P===!0?n.jsx(cn,{closeDrawerHandler:N,isCheckDepositDrawerOpen:P}):null,n.jsx(ra,{windowSize:u,children:n.jsx(ia,{navigate:a,currentTenant:m,location:o,companyId:D,isDebitCardFeatureEnabled:i,accountId:p??"",isBillPayEnabled:h,isCheckingCommentingEnabled:c,isExpressPayEnabled:b,isAiCfoAccessEnabled:oe,onAskAiCfoClick:me})})]})}const ca=(e,t)=>`/${e}/checking/${t}/account-info`,la=(e,t)=>`/${e}/checking/${t}/statements`,da=q(function(e,t){const{companyId:s}=t;return{zeniAccountSetupView:lt(e,s),meetingUrl:"https://meetings.hubspot.com/niharn/demo-accounts?embed=true"}},function(e,t){const{navigate:s,companyId:o}=t;return{onSetupButtonClick:()=>{L.trackAccountsPromoPageClicked("Setup Accounts"),e(dt(o))},onBackClick:()=>{s("../..",{relative:"path"})},onSetupZeniAccountSuccess:()=>{s("../setup",{relative:"path"})}}})(vt),ua=()=>{const e=ne(),t=W(),{tenantEmailDomain:s}=Y(),{useDynamicConfig:o}=Z(),a=_(),[r,u]=d.useState(!1),[l,p]=d.useState(!1),g=A(f=>U(f)),{configValue:x}=o(G.zeniAccountsConfig),i=Ae(x);d.useEffect(()=>{l===!1&&t.state?.message==="activation"&&p(!0)},[t.state]);const c=S.getSignedInUserTenant(s)?.companyId??g.companyId,m=S.getSignedInUser(),C=!!g.companyZeniAccountInfo?.info?.isZeniAccountTOSAccepted,b=f=>{u(f)};if(m==null)throw Error("Can't access Zeni account promo page without signing in...");const h=te(),w=ee(h?.loggedInUserRoleMap),D=we(h?.loggedInUserRoleMap);if(C&&w)return n.jsx(X,{to:"../../checking/setup"});if(g.company?.companyZeniAccountInfo&&(!C&&w||D)){if(t.state?.message==="activation"){const f=an(t.state?.pathnameStackToGoBack);e(t.pathname,{state:{...t.state,message:void 0,pathnameStackToGoBack:f.newStack}})}return n.jsxs(n.Fragment,{children:[n.jsx(Pt,{showConfetti:l}),n.jsx(ue,{analytics:L,onLoad:f=>(I=>I.trackPageLoaded(be.Event.accountsPromoPageViewed))(f)}),n.jsx(pe,{isAppContentDrawerOpen:r,handleDrawerToggle:b}),n.jsx(da,{analytics:L,navigate:e,companyId:c,onClickMenuIcon:()=>{b(!0)},maxAnnualPercentageYield:i.maxAnnualPercentageYield,maxInsuredAmount:i.maxInsuredAmount,exampleBankBalance:3e6})]})}return n.jsx(de,{fetchState:"In-Progress",style:{backgroundColor:a.colors.grey5}})};function za(){const e=W(),t=A(E=>U(E)),s=_(),{useFeatureGate:o,useDynamicConfig:a}=Z(),r=te(),u=ee(r?.loggedInUserRoleMap),l=we(r?.loggedInUserRoleMap),p=!!t.company?.companyZeniAccountInfo.isZeniAccountEnabled,g=!!t.company?.companyZeniAccountInfo.isZeniAccountTOSAccepted,{isFeatureEnabled:x}=o(O.isChargeCardFeatureEnabled),{isFeatureEnabled:i}=o(O.isDebitCardFeatureEnabled),c=Xe(t),m=De(i,t),C=t?.userRole!=null&&ut(t?.userRole),b=(t?.company==null||t.company.featuresActivationInfo?.isBillPayFeatureEnabled&&!C)&&pt(r?.loggedInUserRoleMap),h=mt(r?.loggedInUserRoleMap),w=(t?.company==null||t.company.featuresActivationInfo?.isReimbursementFeatureEnabled&&!C)&&gt(r?.loggedInUserRoleMap),{isFeatureEnabled:D}=o(O.isDepositAccountsFeatureEnabled),f=D&&!C,{configValue:I}=a(G.expressPayConfig),F=I.is_enable_all_tenants===!0||I.tenant_ids!=null&&I.tenant_ids.includes(t.tenantId),{isFeatureEnabled:R}=o(O.isAutoTransferRuleEnabled),j=Et(t,x,i)&&!C&&ht(r?.loggedInUserRoleMap),v=ft(r?.loggedInUserRoleMap),P=f&&ee(r?.loggedInUserRoleMap),T=P||Ze(r?.loggedInUserRoleMap);return n.jsxs(Ve,{children:[n.jsx(k,{path:"setup",element:n.jsx(ze,{isBillPayAdminLevelAccess:b,isUserHasOnlyBillPayAccess:h,isReimbursementAdminLevelAccess:w,isZeniAccountAdminLevelAccess:P,isChargeCardAdminLevelAccess:j,isUserHasOnlyCardAccess:v,productType:"zeni_accounts",type:"setup"})}),n.jsx(k,{path:"verification",element:n.jsx(ze,{isBillPayAdminLevelAccess:b,isUserHasOnlyBillPayAccess:h,isReimbursementAdminLevelAccess:w,isZeniAccountAdminLevelAccess:P,isChargeCardAdminLevelAccess:j,isUserHasOnlyCardAccess:v,productType:"zeni_accounts",type:"verification"})}),R?n.jsxs(n.Fragment,{children:[n.jsx(k,{path:"auto-transfer",element:n.jsx(Me,{})}),T?n.jsx(k,{path:"auto-transfer/:ruleId/edit",element:n.jsx(Me,{isEditDrawerOpen:!0})}):null]}):n.jsx(k,{path:"auto-transfer",element:n.jsx(ie,{})}),F&&u?n.jsxs(n.Fragment,{children:[n.jsx(k,{path:"express-pay",element:n.jsx(se,{})}),n.jsx(k,{path:"express-pay/add-ach",element:n.jsx(se,{isAddACHDrawerOpen:!0})}),n.jsx(k,{path:"express-pay/add-wire/add-address",element:n.jsx(se,{isAddAddressDrawerOpen:!0})}),n.jsx(k,{path:"express-pay/add-wire",element:n.jsx(se,{isAddWireDrawerOpen:!0})})]}):n.jsx(k,{path:"express-pay",element:n.jsx(ie,{})}),n.jsx(k,{path:"promo",element:n.jsx(ua,{})}),c&&!m?n.jsx(k,{path:"/*",element:n.jsx(sn,{})}):p?n.jsxs(n.Fragment,{children:[n.jsx(k,{path:"/",element:n.jsx(xe,{})}),n.jsx(k,{path:"transfer",element:n.jsx(xe,{isTransferDrawerOpen:!0})}),n.jsx(k,{path:"check-deposit",element:n.jsx(xe,{isCheckDepositDrawerOpen:!0})}),n.jsx(k,{path:":accountId/*",element:n.jsx(pa,{})}),n.jsx(k,{path:"*",element:n.jsx(ie,{})})]}):g&&u?n.jsx(k,{path:"*",element:n.jsx(X,{to:"../setup"})}):t.company?.companyZeniAccountInfo&&l?n.jsx(k,{path:"*",element:n.jsx(X,{to:"../promo",state:e.state})}):n.jsx(k,{path:"*",element:n.jsx(de,{fetchState:"In-Progress",style:{backgroundColor:s.colors.grey5,boxShadow:`0px 2px ${jt.sp1} ${s.colors.dropShadowNormal}`}})})]})}function pa(){return n.jsxs(Ve,{children:[n.jsx(k,{path:"/",element:n.jsx(re,{})}),n.jsx(k,{path:"account-info",element:n.jsx(re,{isAccountInfoDrawerOpen:!0})}),n.jsx(k,{path:"transfer",element:n.jsx(re,{isTransferDrawerOpen:!0})}),n.jsx(k,{path:"check-deposit",element:n.jsx(re,{isCheckDepositDrawerOpen:!0})}),n.jsx(k,{path:"statements",element:n.jsx(Lt,{})}),n.jsx(k,{path:"*",element:n.jsx(ie,{})})]})}export{za as default};
@@ -0,0 +1,9 @@
1
+ import{j as i}from"./liveblocks-FvHIfhey.js";import{a as u}from"./sentry-BGmWGtx4.js";import{h as x,u as B,g as P,i as $,j as p}from"./core-4srnP2ry.js";import{Je as s,Jd as j,Pt as v,eR as C,Pu as T}from"./zeni-epic-state-Cicf7kze.js";import{J as z,at as g,m as D,z as E,B as L,c6 as N,r as U}from"./index-C7Pw0HtV.js";import{n as _}from"./mui-BM0jIy5o.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]="1f627d18-2f82-44a2-b661-b31949ce5bb7",e._sentryDebugIdIdentifier="sentry-dbid-1f627d18-2f82-44a2-b661-b31949ce5bb7")}catch{}})();const J=_.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 q(){const e=x(),n=B(),d=z(),l=P();let{accountId:a}=$(),f=`${g.bankingMicroServiceBaseUrl}/1.0/deposit-accounts/${a}`;a==null&&l.pathname.includes(`${s}/statements`)&&(a=s,f=`${g.bankingMicroServiceBaseUrl}/1.0/${s}`);const[m,b]=u.useState(!1),h=D();u.useEffect(()=>{m||(b(!0),n(j(a??"",!1)))},[m,n]);const o=p(t=>v(t,a??"")),y=()=>{const t=U(l.state?.pathnameStackToGoBack),S=t.poppedPathname??"..";e(S,{state:{pathnameStackToGoBack:t.newStack}})},r=E.getSignedInUser(),c=p(t=>C(t)),I={userId:r?.userId??"",sessionId:r?.zeniSessionId??"",tenantId:c.tenantId??""},w=T(a??"")===!0?s:o.zeniAccountDetail?.accountLast4??"",k=c.company?.companyInfo.companyLegalName??c.companyName;if(r==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(J,{windowSize:d,children:i.jsx(N,{currentTenantCompanyName:k,statementListView:o,accountLast4:w,onBackClick:y,authParams:I,downloadEndPoint:f})})}export{q as Z};
@@ -1 +1 @@
1
- import"./sentry-DJoVhts9.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]="aeade864-8999-4b65-a5fe-284d93c9cae4",e._sentryDebugIdIdentifier="sentry-dbid-aeade864-8999-4b65-a5fe-284d93c9cae4")}catch{}})();function d(e,t){if(t!=null)return e.find(n=>n.qboId===t)}function i(e,t){return e.filter(n=>n.qboId!=null&&t.includes(n.qboId))}function a(e,t){return t.map(n=>({accountId:d(e,n.accountId.selectedOption)?.accountId??"",expenseType:n.expenseType.selectedOption??"",type1099:n.type1099.selectedOption??"",boxType:n.boxType.selectedOption??""}))}export{d as a,i as g,a as m};
1
+ import"./sentry-BGmWGtx4.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]="aeade864-8999-4b65-a5fe-284d93c9cae4",e._sentryDebugIdIdentifier="sentry-dbid-aeade864-8999-4b65-a5fe-284d93c9cae4")}catch{}})();function d(e,t){if(t!=null)return e.find(n=>n.qboId===t)}function i(e,t){return e.filter(n=>n.qboId!=null&&t.includes(n.qboId))}function a(e,t){return t.map(n=>({accountId:d(e,n.accountId.selectedOption)?.accountId??"",expenseType:n.expenseType.selectedOption??"",type1099:n.type1099.selectedOption??"",boxType:n.boxType.selectedOption??""}))}export{d as a,i as g,a as m};