@zeniai/web-app-ui 5.3.44-qa → 5.3.45-qa

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (144) hide show
  1. package/dist/assets/{AccountMappingScreen-B400AyQJ.js → AccountMappingScreen-EqyOLk0W.js} +2 -2
  2. package/dist/assets/{ActualMatchingMatchDetailScreen-at2idxY8.js → ActualMatchingMatchDetailScreen-B_Hxuz1x.js} +1 -1
  3. package/dist/assets/AddressRoutes-ByQnL6Ep.js +1 -0
  4. package/dist/assets/AddressScreen-C2qj6tYr.js +9 -0
  5. package/dist/assets/{AiCfoScreen-C2YvBVu2.js → AiCfoScreen-DgiomMQs.js} +3 -3
  6. package/dist/assets/{AppDrawer-D0KfLMaT.js → AppDrawer-C9JSspSl.js} +3 -3
  7. package/dist/assets/{BillPayApprovalRoutes-LmedJ5XD.js → BillPayApprovalRoutes-CtPNwVvl.js} +1 -1
  8. package/dist/assets/{BillPayRoutes-CDWH4S4C.js → BillPayRoutes-Duz6Vx7D.js} +10 -10
  9. package/dist/assets/{BusinessVerificationPageScreen-BVXryUGP.js → BusinessVerificationPageScreen-BAWcvg1q.js} +2 -2
  10. package/dist/assets/{CardsAiCfoScreen-CyRzyeQR.js → CardsAiCfoScreen-BdTJBLec.js} +3 -3
  11. package/dist/assets/{ChargeCardRoutes-00uaD3zR.js → ChargeCardRoutes-B08xwpTq.js} +9 -9
  12. package/dist/assets/{CompanyPassportScreen-DSUfEnP2.js → CompanyPassportScreen-CbwVCSdf.js} +1 -1
  13. package/dist/assets/ConnectionAuthScreen-BcoTZa8L.js +11 -0
  14. package/dist/assets/CustomerOnboardingAuthScreen-BpGFH1t5.js +1 -0
  15. package/dist/assets/CustomerOnboardingRoutes-BP006ys9.js +30 -0
  16. package/dist/assets/{DashboardRoutes-CsjwE5Mt.js → DashboardRoutes-DKsy8kjy.js} +3 -3
  17. package/dist/assets/{DefaultTenantHome-BmcgKJw_.js → DefaultTenantHome-h9sstg-6.js} +1 -1
  18. package/dist/assets/{DomesticWireDetailScreen-BHofWD_4.js → DomesticWireDetailScreen-DdrkO-LG.js} +4 -4
  19. package/dist/assets/{DrawerScreen-eoSileBw.js → DrawerScreen-KSeYe6Xi.js} +1 -1
  20. package/dist/assets/EntityDetailRoutes-TJfEMlzp.js +1 -0
  21. package/dist/assets/{ExpenseAutomationRoutes-C41VbCrR.js → ExpenseAutomationRoutes-FRK8lYq7.js} +4 -4
  22. package/dist/assets/{FeaturePreviewScreen-BAENITNo.js → FeaturePreviewScreen-R_rh5xYj.js} +1 -1
  23. package/dist/assets/HubSpotOAuthCallbackScreen-Bf48Zrcv.js +1 -0
  24. package/dist/assets/InboxNotificationsProvider-CMirleoY.js +1 -0
  25. package/dist/assets/{InvoicingRoutes-C6flJIVP.js → InvoicingRoutes-D9DMbY6F.js} +2 -2
  26. package/dist/assets/MagicLinkRoutes-DVS2kuyq.js +72 -0
  27. package/dist/assets/MagicLinkSignInScreen-CmaiVv9M.js +12 -0
  28. package/dist/assets/MobileAppDrawer-DEm85bH8.js +1 -0
  29. package/dist/assets/NotFoundScreen-CS6UgwGr.js +1 -0
  30. package/dist/assets/NotificationRoutes-DlVY8cS0.js +1 -0
  31. package/dist/assets/OAuthConsentScreen-0eyA85wD.js +1 -0
  32. package/dist/assets/PandLWithForecastRoutes-Ciu8QGi3.js +1 -0
  33. package/dist/assets/{PaymentLinkScreen-DiueSn16.js → PaymentLinkScreen-DSvOcNW8.js} +4 -4
  34. package/dist/assets/PeopleRoutes-B29gnv2-.js +22 -0
  35. package/dist/assets/PerformanceRoutes-C-oSemZm.js +1 -0
  36. package/dist/assets/{Preview-DEgobwYA.js → Preview-DPyEVqHc.js} +1 -1
  37. package/dist/assets/{QBOConnectionScreen-Dcslm4FM.js → QBOConnectionScreen-CUhLSYvc.js} +1 -1
  38. package/dist/assets/ReimbursementApprovalRoutes-CS9p1qcB.js +1 -0
  39. package/dist/assets/{ReimbursementApprovalRuleDetailScreen-C95Tlh44.js → ReimbursementApprovalRuleDetailScreen-CJnxkFoz.js} +1 -1
  40. package/dist/assets/{ReimbursementRoutes-Sdsth_9q.js → ReimbursementRoutes-DaGg2TTR.js} +4 -4
  41. package/dist/assets/{ReportsRoutes-DA2ZKfqn.js → ReportsRoutes-BsvYUCIx.js} +1 -1
  42. package/dist/assets/RewardsRoutes-BeNSEmB_.js +1 -0
  43. package/dist/assets/{ScheduleDetailsPrepaidExpensesScreen-BinEqncH.js → ScheduleDetailsPrepaidExpensesScreen-CJ28c5Wc.js} +5 -5
  44. package/dist/assets/ScreenRoutes-Lei7nnrR.js +2 -0
  45. package/dist/assets/{SettingsRoutes-Cwcsb2Ys.js → SettingsRoutes-DJiPiJIZ.js} +6 -6
  46. package/dist/assets/{SetupPagesScreen-C64hdzmo.js → SetupPagesScreen-BzPNt5Xb.js} +5 -5
  47. package/dist/assets/SignInScreen-OFMK0Fhv.js +1 -0
  48. package/dist/assets/SignOutScreen-Duww-LZM.js +9 -0
  49. package/dist/assets/TaskListScreen-Dy6L1Gr_.js +9 -0
  50. package/dist/assets/TaskRoutes-BAifN0A-.js +9 -0
  51. package/dist/assets/TransactionDetailRoutes-KEbThb3n.js +1 -0
  52. package/dist/assets/{TransactionDetailScreen-DcuSfVKO.js → TransactionDetailScreen-C32uKUIF.js} +2 -2
  53. package/dist/assets/{TransactionListRoutes-B_voFmAT.js → TransactionListRoutes-Ebou9bMl.js} +1 -1
  54. package/dist/assets/{TreasuryRoutes-CXgACPbz.js → TreasuryRoutes-Bq4RVae3.js} +5 -5
  55. package/dist/assets/{VendorsRoutes-DdY9Fw_b.js → VendorsRoutes-dtzf2p8G.js} +12 -12
  56. package/dist/assets/WiseConfirmationScreen-Dzz50WS2.js +12 -0
  57. package/dist/assets/{ZeniAccountRoutes-OVjm5L3x.js → ZeniAccountRoutes-C2FWt_0o.js} +11 -11
  58. package/dist/assets/ZeniAccountStatementScreen-CJtdjYJW.js +9 -0
  59. package/dist/assets/{accountMappingHelper-Djr6f8Xt.js → accountMappingHelper-B5wpHG39.js} +1 -1
  60. package/dist/assets/{analytics-B06OpwA-.js → analytics-5LJ4BXQX.js} +1 -1
  61. package/dist/assets/analyticsHelper-k_Sp-PwA.js +1 -0
  62. package/dist/assets/{core-Bl4MLhFi.js → core-BI5oX4mx.js} +1 -1
  63. package/dist/assets/{decodeURIComponentSafe-Buybgpqw.js → decodeURIComponentSafe-B7oIXSPO.js} +1 -1
  64. package/dist/assets/{dnd-CimhpTrK.js → dnd-D6wtGmk9.js} +1 -1
  65. package/dist/assets/{empty-B4WpR10s.js → empty-D1y42ZwI.js} +1 -1
  66. package/dist/assets/{empty-BTbLiTP7.js → empty-PW7BYANj.js} +1 -1
  67. package/dist/assets/{emptyVideoElement-Do1ktOmR.js → emptyVideoElement-DRIlZkGm.js} +1 -1
  68. package/dist/assets/{epic-Ck-sEMUn.js → epic-BgEnH7Qf.js} +1 -1
  69. package/dist/assets/expenseAutomationHelper-CqPrLTRM.js +1 -0
  70. package/dist/assets/{getLocaleForTenant-NAFAfy2t.js → getLocaleForTenant-Cv6I-eSM.js} +1 -1
  71. package/dist/assets/{index-Bmwrrrme.js → index-BT5wSX8Z.js} +1 -1
  72. package/dist/assets/{index-BXYzwgW0.js → index-BgSgl7o0.js} +1 -1
  73. package/dist/assets/{index-D_qRPRIi.js → index-C2L5Bzwa.js} +9582 -9582
  74. package/dist/assets/{index-DFR56SYR.js → index-C8KisrNI.js} +2 -2
  75. package/dist/assets/{index-jyJQzleF.js → index-COJM8F4x.js} +1 -1
  76. package/dist/assets/{index-H-kll8aI.js → index-Cf-PV9pR.js} +1 -1
  77. package/dist/assets/{index-CivWMXxp.js → index-ChUBWLsO.js} +1 -1
  78. package/dist/assets/{index-BKWyG8Iu.js → index-Cnd56s5E.js} +1 -1
  79. package/dist/assets/{lexical-BbBoQdpc.js → lexical-BLu7UAko.js} +1 -1
  80. package/dist/assets/{liveblocks-BXyXenK7.js → liveblocks-CW9yScMF.js} +1 -1
  81. package/dist/assets/{lottie-2qUppQdg.js → lottie-lQbJqTc2.js} +1 -1
  82. package/dist/assets/{mui-CyP-P4av.js → mui-KP5Ep0NX.js} +1 -1
  83. package/dist/assets/{pathToGoBack-sGBxvK0B.js → pathToGoBack-Ddmf68xx.js} +1 -1
  84. package/dist/assets/{pdf-BENieWk6.js → pdf-DflcYtDk.js} +4 -4
  85. package/dist/assets/{pdf-lib-CLkFJB86.js → pdf-lib-iL5hUpKl.js} +1 -1
  86. package/dist/assets/{plaid-C0aCR9wu.js → plaid-BrgJMdej.js} +1 -1
  87. package/dist/assets/{pusher-B9dsvvYE.js → pusher-CN7UYIVv.js} +1 -1
  88. package/dist/assets/{react-DIwVQX4M.js → react-BvzziK5i.js} +1 -1
  89. package/dist/assets/{react-BqELFJJh.js → react-C3_gvmu5.js} +1 -1
  90. package/dist/assets/{react-DEsZRrdi.js → react-C3b5GjIN.js} +1 -1
  91. package/dist/assets/{react-Do3Z3oDl.js → react-D7C_-SWb.js} +1 -1
  92. package/dist/assets/{react-BvpkKAe3.js → react-Ow08-_5J.js} +1 -1
  93. package/dist/assets/{react-C4fns4CR.js → react-XJ6XyB9N.js} +1 -1
  94. package/dist/assets/{recharts-CZKBTuPa.js → recharts-DRl2ZsSW.js} +1 -1
  95. package/dist/assets/{routePaths-D20OKXnM.js → routePaths-BrIEdo8u.js} +1 -1
  96. package/dist/assets/{sentry-D4svnzxK.js → sentry-C_uJQK1a.js} +1 -1
  97. package/dist/assets/{stripSplatSuffix-G7yC23v6.js → stripSplatSuffix-CSXpdRK5.js} +1 -1
  98. package/dist/assets/{url-SRUWz_6t.js → url-0wqXxJRo.js} +1 -1
  99. package/dist/assets/{url-m7LStd7o.js → url-Csr3E4Sb.js} +1 -1
  100. package/dist/assets/useActualMatchingMatchDetail-C-OzIN8B.js +1 -0
  101. package/dist/assets/{useAiCfoDashboardSuggestedQuestionsChips-BfYubNz7.js → useAiCfoDashboardSuggestedQuestionsChips-CZodBcrZ.js} +1 -1
  102. package/dist/assets/useAskAiCfoHostNavButtonProps-4TGjNsPg.js +1 -0
  103. package/dist/assets/{useChargeCardPusherEvents-CLgbV2wJ.js → useChargeCardPusherEvents-B3svLsmE.js} +1 -1
  104. package/dist/assets/{useDeviceId-4WJY9vuN.js → useDeviceId-CAlK1w38.js} +1 -1
  105. package/dist/assets/useEmailConnectResultRefresh-CIZ_wxDt.js +1 -0
  106. package/dist/assets/{useInitialThreadRequest-R2hAErYY.js → useInitialThreadRequest-BNsRpSRE.js} +1 -1
  107. package/dist/assets/{useTaskManagerAccess-Rxke8A9H.js → useTaskManagerAccess-Bhr2JI_X.js} +1 -1
  108. package/dist/assets/{utils-Bycom664.js → utils-BzQpFQvw.js} +1 -1
  109. package/dist/assets/{withTransactionSidePanel-rDK0lUVX.js → withTransactionSidePanel-mkP2Wc9X.js} +2 -2
  110. package/dist/assets/{zeni-epic-state-UM7IPCLf.js → zeni-epic-state-CIizsNeB.js} +4 -4
  111. package/dist/index.html +1 -1
  112. package/package.json +3 -3
  113. package/dist/assets/AddressRoutes-Bf2-WRel.js +0 -1
  114. package/dist/assets/AddressScreen-Cbo3iSD8.js +0 -9
  115. package/dist/assets/ConnectionAuthScreen-DlFUg2cH.js +0 -11
  116. package/dist/assets/CustomerOnboardingAuthScreen-DGrAYURi.js +0 -1
  117. package/dist/assets/CustomerOnboardingRoutes-CfsElRde.js +0 -30
  118. package/dist/assets/EntityDetailRoutes-BTuykNTu.js +0 -1
  119. package/dist/assets/HubSpotOAuthCallbackScreen-B57X4QKD.js +0 -1
  120. package/dist/assets/InboxNotificationsProvider-CMdsyY0A.js +0 -1
  121. package/dist/assets/MagicLinkRoutes-Bo0FAVj9.js +0 -72
  122. package/dist/assets/MagicLinkSignInScreen-Dusac1BV.js +0 -12
  123. package/dist/assets/MobileAppDrawer-Bm1u6Ken.js +0 -1
  124. package/dist/assets/NotFoundScreen-BHAnIkPW.js +0 -1
  125. package/dist/assets/NotificationRoutes-DxiudUgY.js +0 -1
  126. package/dist/assets/OAuthConsentScreen-yUIZ6DV2.js +0 -1
  127. package/dist/assets/PandLWithForecastRoutes-eu7U2LpI.js +0 -1
  128. package/dist/assets/PeopleRoutes-D0lDTK4i.js +0 -22
  129. package/dist/assets/PerformanceRoutes-UIwOxwXM.js +0 -1
  130. package/dist/assets/ReimbursementApprovalRoutes-C0yLDyE9.js +0 -1
  131. package/dist/assets/RewardsRoutes-MCkqCd4q.js +0 -1
  132. package/dist/assets/ScreenRoutes-CoBHM0a5.js +0 -2
  133. package/dist/assets/SignInScreen-D-UWxMUC.js +0 -1
  134. package/dist/assets/SignOutScreen-CLMaxTgY.js +0 -9
  135. package/dist/assets/TaskListScreen-BBXffRbT.js +0 -9
  136. package/dist/assets/TaskRoutes-DvNx4Qap.js +0 -9
  137. package/dist/assets/TransactionDetailRoutes-Bz8OXpUB.js +0 -1
  138. package/dist/assets/WiseConfirmationScreen-BLw9xWiw.js +0 -12
  139. package/dist/assets/ZeniAccountStatementScreen-CJ2iauJ5.js +0 -9
  140. package/dist/assets/analyticsHelper-xKlm2_zz.js +0 -1
  141. package/dist/assets/expenseAutomationHelper-CkBJgYs_.js +0 -1
  142. package/dist/assets/useActualMatchingMatchDetail-DjU1UsXK.js +0 -1
  143. package/dist/assets/useAskAiCfoHostNavButtonProps-DYVVwney.js +0 -1
  144. package/dist/assets/useEmailConnectResultRefresh-fWgBKuNg.js +0 -1
@@ -1,4 +1,4 @@
1
- import{j as e}from"./liveblocks-BXyXenK7.js";import{h as L,g as U,u as F,i as M,j as y,N as D,l as V,n as Te,o as k}from"./core-Bl4MLhFi.js";import{cv as N,fE as v,Z3 as P,Oh as ae,N_ as q,N$ as ne,Z5 as Ie,Ok as we,Z1 as Ce,Z2 as se,Zh as ke,Ml as je,C4 as be,Z7 as Ae,Or as Ee,Z4 as re,dc as H,GA as oe,dY as ve,dZ as De,$s as Le,$t as Ue,O0 as Fe,$u as Pe,O1 as Be,Oa as Oe,bq as Re,bJ as Me,cG as Ve,bK as Ne,cu as $e,bt as _e,U3 as Ze,ct as ze}from"./zeni-epic-state-UM7IPCLf.js";import{U as $,j as Ge,z as E,a8 as _,k as b,d7 as qe,d8 as He,d9 as G,a1 as W,c as We,aq as Je,as as Ke,N as ie,d as O,ab as Ye,a7 as Qe,da as Xe,ae as J,p as et,db as tt,a4 as K,dc as at,ai as nt,$ as Q,dd as st,h as rt}from"./index-D_qRPRIi.js";import{D as ot,n as R,S as it}from"./mui-CyP-P4av.js";import ct from"./NotFoundScreen-BHAnIkPW.js";import{S as X}from"./SetupPagesScreen-C64hdzmo.js";import{a as p}from"./sentry-D4svnzxK.js";import{u as lt}from"./useAskAiCfoHostNavButtonProps-DYVVwney.js";import{u as ut}from"./useInitialThreadRequest-R2hAErYY.js";import{M as ce}from"./MobileAppDrawer-Bm1u6Ken.js";import{F as dt}from"./FeaturePreviewScreen-BAENITNo.js";import{a as ee}from"./analyticsHelper-xKlm2_zz.js";import"./recharts-CZKBTuPa.js";import"./analytics-B06OpwA-.js";import"./plaid-C0aCR9wu.js";import"./dnd-CimhpTrK.js";import"./stripe-cKAAJElX.js";import"./lottie-2qUppQdg.js";import"./lexical-BbBoQdpc.js";import"./pdf-BENieWk6.js";import"./utils-Bycom664.js";import"./BusinessVerificationPageScreen-BVXryUGP.js";import"./routePaths-D20OKXnM.js";import"./InboxNotificationsProvider-CMdsyY0A.js";import"./useTaskManagerAccess-Rxke8A9H.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]="e512802f-fb73-40bc-8bda-debaefd0e855",t._sentryDebugIdIdentifier="sentry-dbid-e512802f-fb73-40bc-8bda-debaefd0e855")}catch{}})();const pt=V((function(t,a){const{companyId:n}=a;return{treasurySetupView:P(t,n),analytics:b}}),(function(t,a){const{navigate:n,analytics:o,treasurySetupView:i}=a;return{onBackClick:()=>{n("../")},onNextClick:()=>{const r=i.fundAllocationLocalData;o.trackTreasuryPortfolioConfirm(r.riskScore,ee(r)),t(we(!0))},onUpdateFundAllocation:r=>{o.trackTreasuryAllocationAction("update",ee(r)),t(Ie(r))}}}))(qe);function mt(){const t=L(),a=U(),n=F(),{tenantEmailDomain:o}=M(),i=$(),r=y((w=>w.treasurySetupViewState.portfolioAllocationUpdateStatus?.fetchState)),m=Ge(r),s=N(i?.loggedInUserRoleMap),[d,c]=p.useState(!1),[h,T]=p.useState(!1),[l,u]=p.useState(!1),x=y((w=>v(w))),f=E.getSignedInUserTenant(o)?.companyId??x.companyId,C=E.getSignedInUser(),S=y((w=>P(w,f))),g=y((w=>w.treasurySetupViewState.fetchState)),j=y((w=>w.treasurySetupViewState.currentAllocation.fetchStatus?.fetchState)),I=y((w=>w.treasurySetupViewState.treasuryFundsDetails?.fetchStatus?.fetchState));if(C==null)throw Error("Can't access treasury portfolio allocation page without signing in...");if(p.useEffect((()=>{d||g!=="Not-Started"||f==null||(c(!0),n(ae(f,!0,!1)))}),[d,g,f,n]),p.useEffect((()=>{l||I!=="Not-Started"||f==null||(u(!0),n(q()))}),[l,I,f,n]),p.useEffect((()=>{h||j!=="Not-Started"||f==null||(T(!0),n(ne()))}),[h,j,f,n]),p.useEffect((()=>{m==="In-Progress"&&r==="Completed"&&t("../")}),[m,r,t]),x.companyTreasuryInfo?.info?.isTreasuryTOSAccepted===!1)return e.jsx(D,{to:"../promo"});const B=x.companyTreasuryInfo?.info?.isTreasuryTOSAccepted!==!0||g!=="Completed";return e.jsxs(e.Fragment,{children:[!B&&e.jsx(_,{analytics:b,onLoad:()=>{}}),e.jsx(pt,{navigate:t,location:a,companyId:f,isEditMode:!0,isLoading:B,isReadOnly:!s,treasurySetupView:S,analytics:b})]})}const ft=V((function(t,a){const n=a.currentTenant?.companyId;return{plaidConnectionDetails:ke(t,n,"zeni_treasury","treasury_setup").plaidConnectionDetails,treasurySetupView:P(t,n)}}),(function(t,a){const{navigate:n,transferDetails:o,treasurySetupView:i}=a,r=o.treasuryTransferMoneyLocalData,m=i.fundAllocationLocalData;return{onCancelClick:()=>{G(a.analytics,"cancel",r,m,"Transfer"),t(se()),n("../")},onTransferClick:()=>{G(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"))}}}))(He),yt=({isFirstTransfer:t,isTransactionsLoaded:a})=>{const n=L(),{tenantEmailDomain:o}=M(),i=F(),[r,m]=p.useState(!1),[s,d]=p.useState(!1),[c,h]=p.useState(!1),[T,l]=p.useState(!1),u=y((I=>I.treasurySetupViewState.fetchState)),x=y((I=>I.treasurySetupViewState.treasuryFundsDetails?.fetchStatus?.fetchState)),f=y((I=>I.treasurySetupViewState.currentAllocation.fetchStatus?.fetchState)),C=y((I=>v(I))),S=E.getSignedInUserTenant(o)?.companyId??C.companyId,g=y((I=>Ce(I))),j=y((I=>P(I,S)));if(E.getSignedInUser()==null)throw Error("Can't access treasury transfer page without signing in...");return p.useEffect((()=>{s||u!=="Not-Started"||S==null||(d(!0),i(ae(S,!0,!1)))}),[s,u,S,i]),p.useEffect((()=>{c||x!=="Not-Started"||S==null||(h(!0),i(q()))}),[c,x,S,i]),p.useEffect((()=>{T||f!=="Not-Started"||S==null||(l(!0),i(ne()))}),[T,f,S,i]),e.jsxs(e.Fragment,{children:[e.jsx(_,{analytics:b,onLoad:()=>{}}),e.jsx(ft,{analytics:b,navigate:n,transferDetails:g,onAnotherTransferClick:()=>{m(!1),i(se())},currentTenant:C,treasurySetupView:j,showReviewContent:r,maxInsuredAmount:5e5,onReviewClick:()=>{G(b,"review",g.treasuryTransferMoneyLocalData,j.fundAllocationLocalData,"Transfer"),m(!0)},isFirstTransfer:t,isTransactionsLoaded:a,setShowReviewContent:m,onBackClick:()=>{}})]})},gt=R.div`
1
+ import{j as e}from"./liveblocks-CW9yScMF.js";import{h as L,g as U,u as F,i as M,j as y,N as D,l as V,n as Te,o as k}from"./core-BI5oX4mx.js";import{cv as N,fF as E,Z4 as B,Oi as ae,N$ as q,O0 as ne,Z6 as Ie,Ol as we,Z2 as Ce,Z3 as se,Zi as ke,Mm as je,C5 as be,Z8 as Ae,Os as ve,Z5 as re,dd as H,GB as oe,dZ as Ee,d_ as De,$t as Le,$u as Ue,O1 as Fe,$v as Be,O2 as Pe,Ob as Oe,bq as Re,bJ as Me,cG as Ve,bK as Ne,cu as $e,bt as _e,U4 as Ze,ct as ze}from"./zeni-epic-state-CIizsNeB.js";import{U as $,j as Ge,z as v,a8 as _,k as b,d7 as qe,d8 as He,d9 as G,a1 as W,c as We,aq as Je,as as Ke,N as ie,d as O,ab as Qe,a7 as Xe,da as Ye,ae as J,p as et,db as tt,a4 as K,dc as at,ai as nt,$ as X,dd as st,h as rt}from"./index-C2L5Bzwa.js";import{D as ot,n as R,S as it}from"./mui-KP5Ep0NX.js";import ct from"./NotFoundScreen-CS6UgwGr.js";import{S as Y}from"./SetupPagesScreen-BzPNt5Xb.js";import{a as p}from"./sentry-C_uJQK1a.js";import{u as lt}from"./useAskAiCfoHostNavButtonProps-4TGjNsPg.js";import{u as ut}from"./useInitialThreadRequest-BNsRpSRE.js";import{M as ce}from"./MobileAppDrawer-DEm85bH8.js";import{F as dt}from"./FeaturePreviewScreen-R_rh5xYj.js";import{a as ee}from"./analyticsHelper-k_Sp-PwA.js";import"./recharts-DRl2ZsSW.js";import"./analytics-5LJ4BXQX.js";import"./plaid-BrgJMdej.js";import"./dnd-D6wtGmk9.js";import"./stripe-cKAAJElX.js";import"./lottie-lQbJqTc2.js";import"./lexical-BLu7UAko.js";import"./pdf-DflcYtDk.js";import"./utils-BzQpFQvw.js";import"./BusinessVerificationPageScreen-BAWcvg1q.js";import"./routePaths-BrIEdo8u.js";import"./InboxNotificationsProvider-CMirleoY.js";import"./useTaskManagerAccess-Bhr2JI_X.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]="0cb73542-385f-4dab-8a07-d05da6466ea2",t._sentryDebugIdIdentifier="sentry-dbid-0cb73542-385f-4dab-8a07-d05da6466ea2")}catch{}})();const pt=V((function(t,a){const{companyId:n}=a;return{treasurySetupView:B(t,n),analytics:b}}),(function(t,a){const{navigate:n,analytics:o,treasurySetupView:i}=a;return{onBackClick:()=>{n("../")},onNextClick:()=>{const r=i.fundAllocationLocalData;o.trackTreasuryPortfolioConfirm(r.riskScore,ee(r)),t(we(!0))},onUpdateFundAllocation:r=>{o.trackTreasuryAllocationAction("update",ee(r)),t(Ie(r))}}}))(qe);function mt(){const t=L(),a=U(),n=F(),{tenantEmailDomain:o}=M(),i=$(),r=y((w=>w.treasurySetupViewState.portfolioAllocationUpdateStatus?.fetchState)),m=Ge(r),s=N(i?.loggedInUserRoleMap),[d,c]=p.useState(!1),[S,T]=p.useState(!1),[l,u]=p.useState(!1),x=y((w=>E(w))),f=v.getSignedInUserTenant(o)?.companyId??x.companyId,C=v.getSignedInUser(),h=y((w=>B(w,f))),g=y((w=>w.treasurySetupViewState.fetchState)),j=y((w=>w.treasurySetupViewState.currentAllocation.fetchStatus?.fetchState)),I=y((w=>w.treasurySetupViewState.treasuryFundsDetails?.fetchStatus?.fetchState));if(C==null)throw Error("Can't access treasury portfolio allocation page without signing in...");if(p.useEffect((()=>{d||g!=="Not-Started"||f==null||(c(!0),n(ae(f,!0,!1)))}),[d,g,f,n]),p.useEffect((()=>{l||I!=="Not-Started"||f==null||(u(!0),n(q()))}),[l,I,f,n]),p.useEffect((()=>{S||j!=="Not-Started"||f==null||(T(!0),n(ne()))}),[S,j,f,n]),p.useEffect((()=>{m==="In-Progress"&&r==="Completed"&&t("../")}),[m,r,t]),x.companyTreasuryInfo?.info?.isTreasuryTOSAccepted===!1)return e.jsx(D,{to:"../promo"});const P=x.companyTreasuryInfo?.info?.isTreasuryTOSAccepted!==!0||g!=="Completed";return e.jsxs(e.Fragment,{children:[!P&&e.jsx(_,{analytics:b,onLoad:()=>{}}),e.jsx(pt,{navigate:t,location:a,companyId:f,isEditMode:!0,isLoading:P,isReadOnly:!s,treasurySetupView:h,analytics:b})]})}const ft=V((function(t,a){const n=a.currentTenant?.companyId;return{plaidConnectionDetails:ke(t,n,"zeni_treasury","treasury_setup").plaidConnectionDetails,treasurySetupView:B(t,n)}}),(function(t,a){const{navigate:n,transferDetails:o,treasurySetupView:i}=a,r=o.treasuryTransferMoneyLocalData,m=i.fundAllocationLocalData;return{onCancelClick:()=>{G(a.analytics,"cancel",r,m,"Transfer"),t(se()),n("../")},onTransferClick:()=>{G(a.analytics,"confirm",r,m,"Transfer"),t(ve())},onSaveChangesToLocalStore:s=>{t(Ae(s))},onFetchLinkTokenClick:s=>{t(be("treasury_setup",s))},onEstablishConnectionClick:s=>{t(je(s,a.currentTenant?.companyId,"treasury_setup","zeni_treasury"))}}}))(He),yt=({isFirstTransfer:t,isTransactionsLoaded:a})=>{const n=L(),{tenantEmailDomain:o}=M(),i=F(),[r,m]=p.useState(!1),[s,d]=p.useState(!1),[c,S]=p.useState(!1),[T,l]=p.useState(!1),u=y((I=>I.treasurySetupViewState.fetchState)),x=y((I=>I.treasurySetupViewState.treasuryFundsDetails?.fetchStatus?.fetchState)),f=y((I=>I.treasurySetupViewState.currentAllocation.fetchStatus?.fetchState)),C=y((I=>E(I))),h=v.getSignedInUserTenant(o)?.companyId??C.companyId,g=y((I=>Ce(I))),j=y((I=>B(I,h)));if(v.getSignedInUser()==null)throw Error("Can't access treasury transfer page without signing in...");return p.useEffect((()=>{s||u!=="Not-Started"||h==null||(d(!0),i(ae(h,!0,!1)))}),[s,u,h,i]),p.useEffect((()=>{c||x!=="Not-Started"||h==null||(S(!0),i(q()))}),[c,x,h,i]),p.useEffect((()=>{T||f!=="Not-Started"||h==null||(l(!0),i(ne()))}),[T,f,h,i]),e.jsxs(e.Fragment,{children:[e.jsx(_,{analytics:b,onLoad:()=>{}}),e.jsx(ft,{analytics:b,navigate:n,transferDetails:g,onAnotherTransferClick:()=>{m(!1),i(se())},currentTenant:C,treasurySetupView:j,showReviewContent:r,maxInsuredAmount:5e5,onReviewClick:()=>{G(b,"review",g.treasuryTransferMoneyLocalData,j.fundAllocationLocalData,"Transfer"),m(!0)},isFirstTransfer:t,isTransactionsLoaded:a,setShowReviewContent:m,onBackClick:()=>{}})]})},gt=R.div`
2
2
  display: flex;
3
3
  min-height: 100%;
4
4
  width: 100%;
@@ -6,7 +6,7 @@ import{j as e}from"./liveblocks-BXyXenK7.js";import{h as L,g as U,u as F,i as M,
6
6
  flex-direction: column;
7
7
  align-items: center;
8
8
  background-color: ${t=>t.theme.colors.grey4};
9
- `,ht={overlayWidth:new Ye(100,100,48)},St=V((function(t,a){const n=re(t),{companyId:o}=a;return{treasuryDetail:n,treasurySetupView:P(t,o),downloadEndPoint:`${J.bankingMicroServiceBaseUrl}/1.0/treasury-account/statements?query={"statement_type":"tax_statement"}`}}),(function(t,a){const{navigate:n,currentTenant:o,location:i,handleDrawerToggle:r,analytics:m}=a,{tenantEmailDomain:s}=o;return{onSettingsClick:()=>{m.trackAccountsListPageClicked("Settings Icon"),n("setup")},onReloadTransactions:()=>{t(oe(!0))},handleTreasuryOptionSelection:d=>{let c="page-not-found";d==="editPortfolio"?c=xt(s):d==="statements"?c=Tt(s):d==="taxLetter"?c=It(s):d==="settings"&&(c=wt(s));const h=et(i.state?.pathnameStackToGoBack,i.pathname);n(c,{state:{pathnameStackToGoBack:h}})},onColumnSortConfigChanged:(d,c)=>{t(Le({uiState:{sortKey:d,sortOrder:c}}))},onTransferClick:()=>{n("./transfer")},onBackClick:()=>{n("../../")},onClickMenuIcon:()=>{r(!0)},onAutoTransferClick:()=>{n("../../checking/auto-transfer")}}}))(Xe);function z({isTransferDrawerOpen:t,isEditPortfolioDrawerOpen:a}){const n=U(),o=L(),i=F(),r=W(),m=We(),s=y((A=>v(A))),{tenantEmailDomain:d}=M(),c=s.companyId??E.getSignedInUserTenant(d)?.companyId,[h,T]=p.useState(!1),l=y((A=>re(A))),u=l.fetchState,x=l.accountSummary?.totalBalance?.amount,f=y((A=>A.treasurySetupViewState.treasuryFundsDetails?.fetchStatus)),C=s.companyTreasuryInfo?.info?.businessVerificationStatus?.code==="verified",S=$(),g=!!s.companyTreasuryInfo?.info?.isTreasuryTOSAccepted,j=N(S?.loggedInUserRoleMap),I=H(S?.loggedInUserRoleMap),{areTenantIdsInSync:B}=Je();p.useEffect((()=>{u==="Not-Started"&&!h&&B&&(T(!0),i(oe(!0)))}),[h,i,u,B]),p.useEffect((()=>{l.transactionsFetchState.fetchState==="Completed"&&l.transactions.length===0&&!n.pathname.includes("transfer")&&j&&o("./transfer")}),[l.transactionsFetchState.fetchState,l.transactions.length,n.pathname,j,o]);const w=()=>{o("..")},[le,ue]=p.useState(!1),Y=A=>{ue(A)},{isAiCfoAccessEnabled:de,onAskAiCfoClick:pe}=lt({mobileExploreReferrer:"Treasury"});Ke({isDataReady:u==="Completed"});const{useFeatureGate:Z}=ie(),{isFeatureEnabled:me}=Z(O.isDebitCardFeatureEnabled),{isFeatureEnabled:fe}=Z(O.isAutoTransferRuleEnabled),{isFeatureEnabled:ye}=Z(O.isTreasuryCommentingEnabled),ge=ut(c,{clearParams:u==="Completed"&&f?.fetchState==="Completed"}),he=ve(s),Se=De(me,s);if(he===!0&&Se!==!0)return e.jsx(dt,{});if(C){const A=f?.fetchState!=="Completed"||l.accountSummaryFetchState.fetchState!=="Completed";return e.jsxs(e.Fragment,{children:[l.accountSummaryFetchState.fetchState==="Completed"&&f?.fetchState==="Completed"&&t===!1&&a===!1?e.jsx(_,{analytics:b,onLoad:()=>{}}):null,e.jsx(ot,{onClose:w,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:l.transactions.length===0||x===0,isTransactionsLoaded:l.transactionsFetchState.fetchState!=="In-Progress"&&l.transactionsFetchState.fetchState!=="Not-Started"}):null,a===!0?e.jsx(mt,{}):null]})}),e.jsxs(gt,{windowSize:r,children:[e.jsx(ce,{isAppContentDrawerOpen:le,handleDrawerToggle:Y}),e.jsx(St,{treasuryDetailsView:l,isAutoTransferRuleEnabled:fe,navigate:o,currentTenant:s,location:n,companyId:c,analytics:b,isTreasuryCommentingEnabled:ye,handleDrawerToggle:Y,initialOpenThreadRequest:ge,isLoading:A,isAiCfoAccessEnabled:de,onAskAiCfoClick:pe})]})]})}return g&&j?e.jsx(D,{to:"../setup"}):s.companyTreasuryInfo?.info&&!g&&I?e.jsx(D,{to:"../promo",state:n.state}):e.jsx(Qe,{fetchState:"In-Progress",style:{backgroundColor:m.colors.grey5}})}const xt=t=>`/${t}/treasury/edit-portfolio`,Tt=t=>`/${t}/treasury/statements`,It=t=>`/${t}/treasury/tax-letter`,wt=t=>`/${t}/treasury/setup`,Ct=R(it)`
9
+ `,St={overlayWidth:new Qe(100,100,48)},ht=V((function(t,a){const n=re(t),{companyId:o}=a;return{treasuryDetail:n,treasurySetupView:B(t,o),downloadEndPoint:`${J.bankingMicroServiceBaseUrl}/1.0/treasury-account/statements?query={"statement_type":"tax_statement"}`}}),(function(t,a){const{navigate:n,currentTenant:o,location:i,handleDrawerToggle:r,analytics:m}=a,{tenantEmailDomain:s}=o;return{onSettingsClick:()=>{m.trackAccountsListPageClicked("Settings Icon"),n("setup")},onReloadTransactions:()=>{t(oe(!0))},handleTreasuryOptionSelection:d=>{let c="page-not-found";d==="editPortfolio"?c=xt(s):d==="statements"?c=Tt(s):d==="taxLetter"?c=It(s):d==="settings"&&(c=wt(s));const S=et(i.state?.pathnameStackToGoBack,i.pathname);n(c,{state:{pathnameStackToGoBack:S}})},onColumnSortConfigChanged:(d,c)=>{t(Le({uiState:{sortKey:d,sortOrder:c}}))},onTransferClick:()=>{n("./transfer")},onBackClick:()=>{n("../../")},onClickMenuIcon:()=>{r(!0)},onAutoTransferClick:()=>{n("../../checking/auto-transfer")}}}))(Ye);function z({isTransferDrawerOpen:t,isEditPortfolioDrawerOpen:a}){const n=U(),o=L(),i=F(),r=W(),m=We(),s=y((A=>E(A))),{tenantEmailDomain:d}=M(),c=s.companyId??v.getSignedInUserTenant(d)?.companyId,[S,T]=p.useState(!1),l=y((A=>re(A))),u=l.fetchState,x=l.accountSummary?.totalBalance?.amount,f=y((A=>A.treasurySetupViewState.treasuryFundsDetails?.fetchStatus)),C=s.companyTreasuryInfo?.info?.businessVerificationStatus?.code==="verified",h=$(),g=!!s.companyTreasuryInfo?.info?.isTreasuryTOSAccepted,j=N(h?.loggedInUserRoleMap),I=H(h?.loggedInUserRoleMap),{areTenantIdsInSync:P}=Je();p.useEffect((()=>{u==="Not-Started"&&!S&&P&&(T(!0),i(oe(!0)))}),[S,i,u,P]),p.useEffect((()=>{l.transactionsFetchState.fetchState==="Completed"&&l.transactions.length===0&&!n.pathname.includes("transfer")&&j&&o("./transfer")}),[l.transactionsFetchState.fetchState,l.transactions.length,n.pathname,j,o]);const w=()=>{o("..")},[le,ue]=p.useState(!1),Q=A=>{ue(A)},{isAiCfoAccessEnabled:de,onAskAiCfoClick:pe}=lt({mobileExploreReferrer:"Treasury"});Ke({isDataReady:u==="Completed"});const{useFeatureGate:Z}=ie(),{isFeatureEnabled:me}=Z(O.isDebitCardFeatureEnabled),{isFeatureEnabled:fe}=Z(O.isAutoTransferRuleEnabled),{isFeatureEnabled:ye}=Z(O.isTreasuryCommentingEnabled),ge=ut(c,{clearParams:u==="Completed"&&f?.fetchState==="Completed"}),Se=Ee(s),he=De(me,s);if(Se===!0&&he!==!0)return e.jsx(dt,{});if(C){const A=f?.fetchState!=="Completed"||l.accountSummaryFetchState.fetchState!=="Completed";return e.jsxs(e.Fragment,{children:[l.accountSummaryFetchState.fetchState==="Completed"&&f?.fetchState==="Completed"&&t===!1&&a===!1?e.jsx(_,{analytics:b,onLoad:()=>{}}):null,e.jsx(ot,{onClose:w,anchor:"right",open:a||t,transitionDuration:250,PaperProps:{style:{width:St.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:l.transactions.length===0||x===0,isTransactionsLoaded:l.transactionsFetchState.fetchState!=="In-Progress"&&l.transactionsFetchState.fetchState!=="Not-Started"}):null,a===!0?e.jsx(mt,{}):null]})}),e.jsxs(gt,{windowSize:r,children:[e.jsx(ce,{isAppContentDrawerOpen:le,handleDrawerToggle:Q}),e.jsx(ht,{treasuryDetailsView:l,isAutoTransferRuleEnabled:fe,navigate:o,currentTenant:s,location:n,companyId:c,analytics:b,isTreasuryCommentingEnabled:ye,handleDrawerToggle:Q,initialOpenThreadRequest:ge,isLoading:A,isAiCfoAccessEnabled:de,onAskAiCfoClick:pe})]})]})}return g&&j?e.jsx(D,{to:"../setup"}):s.companyTreasuryInfo?.info&&!g&&I?e.jsx(D,{to:"../promo",state:n.state}):e.jsx(Xe,{fetchState:"In-Progress",style:{backgroundColor:m.colors.grey5}})}const xt=t=>`/${t}/treasury/edit-portfolio`,Tt=t=>`/${t}/treasury/statements`,It=t=>`/${t}/treasury/tax-letter`,wt=t=>`/${t}/treasury/setup`,Ct=R(it)`
10
10
  display: flex;
11
11
  min-height: 100%;
12
12
  flex-direction: column;
@@ -18,7 +18,7 @@ import{j as e}from"./liveblocks-BXyXenK7.js";import{h as L,g as U,u as F,i as M,
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=F(),n=W(),o=U(),i=`${J.bankingMicroServiceBaseUrl}/1.0/treasury-account`,[r,m]=p.useState(!1),s=y((u=>Ue(u)));p.useEffect((()=>{r||s.fetchState!=="Not-Started"||(m(!0),a(Fe(!1)))}),[r,s.fetchState,a]);const d=E.getSignedInUser(),c=y((u=>v(u))),h={userId:d?.userId??"",sessionId:d?.zeniSessionId??"",tenantId:c.tenantId??""},T=c.company?.companyInfo.companyLegalName??c.companyName;if(d==null)throw Error("Can't access statements page without signing in...");const l=s.fetchState!=="Completed";return e.jsx(kt,{windowSize:n,children:e.jsx(tt,{currentTenantCompanyName:T,statementListView:s,isLoading:l,onBackClick:()=>{const u=K(o.state?.pathnameStackToGoBack),x=u.poppedPathname??"..";t(x,{state:{pathnameStackToGoBack:u.newStack}})},authParams:h,downloadEndPoint:i})})}const bt=R.div`
21
+ `;function jt(){const t=L(),a=F(),n=W(),o=U(),i=`${J.bankingMicroServiceBaseUrl}/1.0/treasury-account`,[r,m]=p.useState(!1),s=y((u=>Ue(u)));p.useEffect((()=>{r||s.fetchState!=="Not-Started"||(m(!0),a(Fe(!1)))}),[r,s.fetchState,a]);const d=v.getSignedInUser(),c=y((u=>E(u))),S={userId:d?.userId??"",sessionId:d?.zeniSessionId??"",tenantId:c.tenantId??""},T=c.company?.companyInfo.companyLegalName??c.companyName;if(d==null)throw Error("Can't access statements page without signing in...");const l=s.fetchState!=="Completed";return e.jsx(kt,{windowSize:n,children:e.jsx(tt,{currentTenantCompanyName:T,statementListView:s,isLoading:l,onBackClick:()=>{const u=K(o.state?.pathnameStackToGoBack),x=u.poppedPathname??"..";t(x,{state:{pathnameStackToGoBack:u.newStack}})},authParams:S,downloadEndPoint:i})})}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-BXyXenK7.js";import{h as L,g as U,u as F,i as M,
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=W(),n=U(),o=F(),i=`${J.bankingMicroServiceBaseUrl}/1.0/treasury-account`,[r,m]=p.useState(!1),s=y((u=>Pe(u)));p.useEffect((()=>{r||s.fetchState!=="Not-Started"||(m(!0),o(Be(!1)))}),[r,s.fetchState,o]);const d=E.getSignedInUser(),c=y((u=>v(u))),h={userId:d?.userId??"",sessionId:d?.zeniSessionId??"",tenantId:c.tenantId??""},T=c.company?.companyInfo.companyLegalName??c.companyName;if(d==null)throw Error("Can't access tax letter page without signing in...");const l=s.fetchState!=="Completed";return e.jsx(bt,{windowSize:a,children:e.jsx(at,{currentTenantCompanyName:T,taxLetterListView:s,isLoading:l,onBackClick:()=>{const u=K(n.state?.pathnameStackToGoBack),x=u.poppedPathname??"..";t(x,{state:{pathnameStackToGoBack:u.newStack}})},authParams:h,downloadEndPoint:i})})}const Et=V((function(t,a){const{companyId:n}=a,o=P(t,n);return{treasurySetupView:o,isSetupComplete:o.companyTreasuryInfo?.businessVerificationStatus?.code==="verified",videoUrl:"https://www.youtube.com/watch?v=sqvJWKCMZgk"}}),(function(t,a){const{navigate:n,companyId:o}=a;return{onSetupButtonClick:()=>{t(Oe(o))},onBackClick:()=>{n("../..",{relative:"path"})},onTreasurySetupSuccess:i=>{n(i?"..":"../setup",{relative:"path"})}}}))(st),vt=()=>{const t=nt(),a=L(),n=U(),o=F(),{tenantEmailDomain:i}=M(),[r,m]=p.useState(!1),s=y((g=>v(g))),[d,c]=p.useState(!1),h=y((g=>g.treasurySetupViewState.treasuryFundsDetails?.fetchStatus));p.useEffect((()=>{d||h?.fetchState!=="Not-Started"||T==null||(c(!0),o(q()))}),[h,o]);const T=E.getSignedInUserTenant(i)?.companyId??s.companyId,l=E.getSignedInUser(),u=!!s.companyTreasuryInfo?.info?.isTreasuryTOSAccepted,x=g=>{m(g)};if(l==null)throw Error("Can't access treasury promo page without signing in...");const f=$(),C=N(f?.loggedInUserRoleMap),S=H(f?.loggedInUserRoleMap);if(u&&C)return e.jsx(D,{to:"../../treasury/setup"});if(s.company?.companyTreasuryInfo&&(!u&&C||S)){if(n.state?.message==="activation"){const g=K(n.state?.pathnameStackToGoBack);a(n.pathname,{state:{...n.state,message:void 0,pathnameStackToGoBack:g.newStack}})}return h?.fetchState!=="Completed"?e.jsx(te,{children:e.jsx(Q,{size:"ExtraLarge",start:!0})}):e.jsxs(e.Fragment,{children:[e.jsx(_,{analytics:b,onLoad:g=>(j=>j.trackTreasuryPromoView("Treasury Promo Page"))(g)}),e.jsx(ce,{isAppContentDrawerOpen:r,handleDrawerToggle:x}),e.jsx(Et,{analytics:b,navigate:a,companyId:T,meetingUrl:t("treasury_promo"),onClickMenuIcon:()=>{x(!0)}})]})}return e.jsx(te,{children:e.jsx(Q,{size:"ExtraLarge",start:!0})})},te=R.div`
29
+ `;function At(){const t=L(),a=W(),n=U(),o=F(),i=`${J.bankingMicroServiceBaseUrl}/1.0/treasury-account`,[r,m]=p.useState(!1),s=y((u=>Be(u)));p.useEffect((()=>{r||s.fetchState!=="Not-Started"||(m(!0),o(Pe(!1)))}),[r,s.fetchState,o]);const d=v.getSignedInUser(),c=y((u=>E(u))),S={userId:d?.userId??"",sessionId:d?.zeniSessionId??"",tenantId:c.tenantId??""},T=c.company?.companyInfo.companyLegalName??c.companyName;if(d==null)throw Error("Can't access tax letter page without signing in...");const l=s.fetchState!=="Completed";return e.jsx(bt,{windowSize:a,children:e.jsx(at,{currentTenantCompanyName:T,taxLetterListView:s,isLoading:l,onBackClick:()=>{const u=K(n.state?.pathnameStackToGoBack),x=u.poppedPathname??"..";t(x,{state:{pathnameStackToGoBack:u.newStack}})},authParams:S,downloadEndPoint:i})})}const vt=V((function(t,a){const{companyId:n}=a,o=B(t,n);return{treasurySetupView:o,isSetupComplete:o.companyTreasuryInfo?.businessVerificationStatus?.code==="verified",videoUrl:"https://www.youtube.com/watch?v=sqvJWKCMZgk"}}),(function(t,a){const{navigate:n,companyId:o}=a;return{onSetupButtonClick:()=>{t(Oe(o))},onBackClick:()=>{n("../..",{relative:"path"})},onTreasurySetupSuccess:i=>{n(i?"..":"../setup",{relative:"path"})}}}))(st),Et=()=>{const t=nt(),a=L(),n=U(),o=F(),{tenantEmailDomain:i}=M(),[r,m]=p.useState(!1),s=y((g=>E(g))),[d,c]=p.useState(!1),S=y((g=>g.treasurySetupViewState.treasuryFundsDetails?.fetchStatus));p.useEffect((()=>{d||S?.fetchState!=="Not-Started"||T==null||(c(!0),o(q()))}),[S,o]);const T=v.getSignedInUserTenant(i)?.companyId??s.companyId,l=v.getSignedInUser(),u=!!s.companyTreasuryInfo?.info?.isTreasuryTOSAccepted,x=g=>{m(g)};if(l==null)throw Error("Can't access treasury promo page without signing in...");const f=$(),C=N(f?.loggedInUserRoleMap),h=H(f?.loggedInUserRoleMap);if(u&&C)return e.jsx(D,{to:"../../treasury/setup"});if(s.company?.companyTreasuryInfo&&(!u&&C||h)){if(n.state?.message==="activation"){const g=K(n.state?.pathnameStackToGoBack);a(n.pathname,{state:{...n.state,message:void 0,pathnameStackToGoBack:g.newStack}})}return S?.fetchState!=="Completed"?e.jsx(te,{children:e.jsx(X,{size:"ExtraLarge",start:!0})}):e.jsxs(e.Fragment,{children:[e.jsx(_,{analytics:b,onLoad:g=>(j=>j.trackTreasuryPromoView("Treasury Promo Page"))(g)}),e.jsx(ce,{isAppContentDrawerOpen:r,handleDrawerToggle:x}),e.jsx(vt,{analytics:b,navigate:a,companyId:T,meetingUrl:t("treasury_promo"),onClickMenuIcon:()=>{x(!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-BXyXenK7.js";import{h as L,g as U,u as F,i as M,
34
34
  justify-content: center;
35
35
  align-items: center;
36
36
  background-color: ${t=>t.theme.colors.grey5};
37
- `;function aa(){const t=U(),a=y((g=>v(g))),{useFeatureGate:n}=ie(),o=a.companyTreasuryInfo?.info?.businessVerificationStatus?.code==="verified",i=!!a.company?.companyTreasuryInfo?.isTreasuryTOSAccepted,r=$(),m=H(r?.loggedInUserRoleMap),s=a?.userRole!=null&&Re(a?.userRole),d=(a?.company==null||a.company.featuresActivationInfo?.isBillPayFeatureEnabled&&!s)&&Me(r?.loggedInUserRoleMap),c=Ve(r?.loggedInUserRoleMap),h=(a?.company==null||a.company.featuresActivationInfo?.isReimbursementFeatureEnabled&&!s)&&Ne(r?.loggedInUserRoleMap),T=!!a.company?.companyZeniAccountInfo?.isZeniAccountEnabled&&!s&&$e(r?.loggedInUserRoleMap),l=o&&!s&&N(r?.loggedInUserRoleMap),{isFeatureEnabled:u}=n(O.isChargeCardFeatureEnabled),{isFeatureEnabled:x}=n(O.isDebitCardFeatureEnabled),f=rt(a,u,x)&&!s&&_e(r?.loggedInUserRoleMap),C=Ze(r?.loggedInUserRoleMap),S=ze(r?.loggedInUserRoleMap);return e.jsxs(Te,{children:[S?null:e.jsx(k,{path:"setup",element:e.jsx(X,{isBillPayAdminLevelAccess:d,isReimbursementAdminLevelAccess:h,isZeniAccountAdminLevelAccess:T,isChargeCardAdminLevelAccess:f,isTreasuryAdminLevelAccess:l,isUserHasOnlyCardAccess:C,isUserHasOnlyBillPayAccess:c,productType:"zeni_treasury",type:"setup"})}),S?null:e.jsx(k,{path:"verification",element:e.jsx(X,{isBillPayAdminLevelAccess:d,isUserHasOnlyBillPayAccess:c,isReimbursementAdminLevelAccess:h,isZeniAccountAdminLevelAccess:T,isChargeCardAdminLevelAccess:f,isTreasuryAdminLevelAccess:l,isUserHasOnlyCardAccess:C,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,{})}),o?e.jsxs(e.Fragment,{children:[e.jsx(k,{path:"/",element:e.jsx(z,{isTransferDrawerOpen:!1,isEditPortfolioDrawerOpen:!1})}),l?e.jsxs(e.Fragment,{children:[e.jsx(k,{path:"edit-portfolio",element:e.jsx(z,{isEditPortfolioDrawerOpen:!0,isTransferDrawerOpen:!1})}),e.jsx(k,{path:"transfer",element:e.jsx(z,{isTransferDrawerOpen:!0,isEditPortfolioDrawerOpen:!1})})]}):null,e.jsx(k,{path:"*",element:e.jsx(ct,{})})]}):i&&l?e.jsx(k,{path:"*",element:e.jsx(D,{to:"../setup"})}):a.company?.companyZeniAccountInfo&&m?e.jsx(k,{path:"*",element:e.jsx(D,{to:"../promo",state:t.state})}):e.jsx(k,{path:"*",element:null})]})}export{aa as default};
37
+ `;function aa(){const t=U(),a=y((g=>E(g))),{useFeatureGate:n}=ie(),o=a.companyTreasuryInfo?.info?.businessVerificationStatus?.code==="verified",i=!!a.company?.companyTreasuryInfo?.isTreasuryTOSAccepted,r=$(),m=H(r?.loggedInUserRoleMap),s=a?.userRole!=null&&Re(a?.userRole),d=(a?.company==null||a.company.featuresActivationInfo?.isBillPayFeatureEnabled&&!s)&&Me(r?.loggedInUserRoleMap),c=Ve(r?.loggedInUserRoleMap),S=(a?.company==null||a.company.featuresActivationInfo?.isReimbursementFeatureEnabled&&!s)&&Ne(r?.loggedInUserRoleMap),T=!!a.company?.companyZeniAccountInfo?.isZeniAccountEnabled&&!s&&$e(r?.loggedInUserRoleMap),l=o&&!s&&N(r?.loggedInUserRoleMap),{isFeatureEnabled:u}=n(O.isChargeCardFeatureEnabled),{isFeatureEnabled:x}=n(O.isDebitCardFeatureEnabled),f=rt(a,u,x)&&!s&&_e(r?.loggedInUserRoleMap),C=Ze(r?.loggedInUserRoleMap),h=ze(r?.loggedInUserRoleMap);return e.jsxs(Te,{children:[h?null:e.jsx(k,{path:"setup",element:e.jsx(Y,{isBillPayAdminLevelAccess:d,isReimbursementAdminLevelAccess:S,isZeniAccountAdminLevelAccess:T,isChargeCardAdminLevelAccess:f,isTreasuryAdminLevelAccess:l,isUserHasOnlyCardAccess:C,isUserHasOnlyBillPayAccess:c,productType:"zeni_treasury",type:"setup"})}),h?null:e.jsx(k,{path:"verification",element:e.jsx(Y,{isBillPayAdminLevelAccess:d,isUserHasOnlyBillPayAccess:c,isReimbursementAdminLevelAccess:S,isZeniAccountAdminLevelAccess:T,isChargeCardAdminLevelAccess:f,isTreasuryAdminLevelAccess:l,isUserHasOnlyCardAccess:C,productType:"zeni_treasury",type:"verification"})}),e.jsx(k,{path:"promo",element:e.jsx(Et,{})}),e.jsx(k,{path:"statements",element:e.jsx(jt,{})}),e.jsx(k,{path:"tax-letter",element:e.jsx(At,{})}),o?e.jsxs(e.Fragment,{children:[e.jsx(k,{path:"/",element:e.jsx(z,{isTransferDrawerOpen:!1,isEditPortfolioDrawerOpen:!1})}),l?e.jsxs(e.Fragment,{children:[e.jsx(k,{path:"edit-portfolio",element:e.jsx(z,{isEditPortfolioDrawerOpen:!0,isTransferDrawerOpen:!1})}),e.jsx(k,{path:"transfer",element:e.jsx(z,{isTransferDrawerOpen:!0,isEditPortfolioDrawerOpen:!1})})]}):null,e.jsx(k,{path:"*",element:e.jsx(ct,{})})]}):i&&l?e.jsx(k,{path:"*",element:e.jsx(D,{to:"../setup"})}):a.company?.companyZeniAccountInfo&&m?e.jsx(k,{path:"*",element:e.jsx(D,{to:"../promo",state:t.state})}):e.jsx(k,{path:"*",element:null})]})}export{aa as default};
@@ -1,8 +1,8 @@
1
- import{j as o}from"./liveblocks-BXyXenK7.js";import{a as u}from"./sentry-D4svnzxK.js";import{h as N,u as W,i as z,j as f,l as G,g as K,n as Me,o as V,N as L}from"./core-Bl4MLhFi.js";import{Vy as gt,Vz as Xe,Rl as et,VA as vt,fE as U,gZ as ge,VB as xt,cE as Tt,VC as bt,Fw as yt,VD as wt,VE as oe,VF as te,VG as ve,SW as ue,SX as ke,FM as pe,SV as he,Fz as tt,F6 as Ve,VH as It,SY as Y,l_ as me,VI as je,F0 as Ct,VJ as Dt,VK as Et,VL as Pe,VM as _e,VN as Ae,VO as Re,FG as xe,VP as nt,Fn as at,VQ as Ft,VR as kt,VS as Vt,VT as jt,VU as Pt,VV as _t,VW as At,VX as Rt,Cg as Ut,Co as Lt,Ch as Bt,S1 as we,VY as Ot,VZ as Mt,le as Ie,br as Nt,V_ as Gt,V$ as Wt,mY as $t,n5 as zt,S0 as Ce,bE as Ne,W0 as ot,RD as st,W1 as Yt,W2 as Jt,W3 as qt,n7 as Kt,W4 as Ge,W5 as We,W6 as $e,W7 as ze,W8 as Ht,n3 as Qt,W9 as Zt,n6 as Xt,Wa as en,Wb as it,Sm as rt,mm as tn,Wc as nn,Wd as De,We as dt,Sk as lt,I3 as an,Wf as on,Wg as sn,mG as ct,Wh as rn,Wi as dn,Sy as ln,vb as cn,Wj as ut,Wk as Ye,Sv as Ee,Wl as Je,Wm as un,SA as pn,Wn as hn,Wo as mn,Wp as fn,Wq as Sn,Wr as gn,ve as vn,Ws as xn,SZ as Tn,Ux as bn,Sd as Fe,i9 as yn,Uz as wn,Uy as In,i7 as Cn,Wt as Dn,Wu as En,I8 as Fn,Wv as kn,Ww as Vn,Wx as jn,Wy as Pn,mq as _n,bn as An,dZ as Rn,dY as Un}from"./zeni-epic-state-UM7IPCLf.js";import{c as Ln,a1 as ne,ab as Ue,N as H,d as M,z as R,a7 as Bn,aM as On,k as j,Z as Le,E as Te,av as ee,as as se,aN as Mn,aO as pt,aq as Nn,a8 as Se,aP as Gn,p as q,U as Wn,G as ht,aQ as $n,ae as mt,a4 as zn,j as qe,aR as Yn,H as J,a9 as Jn,af as ft,ag as qn,aS as Kn,aT as Hn,S as Be,aU as Qn,aV as Zn,a3 as Xn,aW as ea,aX as ta}from"./index-D_qRPRIi.js";import{D as na,n as B,S as St}from"./mui-CyP-P4av.js";import{t as aa,A as oa}from"./AddressScreen-Cbo3iSD8.js";import fe from"./NotFoundScreen-BHAnIkPW.js";import{F as sa}from"./FeaturePreviewScreen-BAENITNo.js";import{S as ia,a as ra,J as da,b as la,c as ca}from"./ScheduleDetailsPrepaidExpensesScreen-BinEqncH.js";import{u as ie}from"./useAskAiCfoHostNavButtonProps-DYVVwney.js";import{M as re}from"./MobileAppDrawer-Bm1u6Ken.js";import{v as Oe,c as ua,d as pa}from"./routePaths-D20OKXnM.js";import{D as ha}from"./DrawerScreen-eoSileBw.js";import{a as ma,m as fa}from"./accountMappingHelper-Djr6f8Xt.js";import"./recharts-CZKBTuPa.js";import"./analytics-B06OpwA-.js";import"./plaid-C0aCR9wu.js";import"./dnd-CimhpTrK.js";import"./stripe-cKAAJElX.js";import"./lottie-2qUppQdg.js";import"./lexical-BbBoQdpc.js";import"./pdf-BENieWk6.js";import"./utils-Bycom664.js";import"./pathToGoBack-sGBxvK0B.js";import"./InboxNotificationsProvider-CMdsyY0A.js";import"./useTaskManagerAccess-Rxke8A9H.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]="a902f77f-6c15-4bb0-85a7-285247e16239",e._sentryDebugIdIdentifier="sentry-dbid-a902f77f-6c15-4bb0-85a7-285247e16239")}catch{}})();const Sa={drawerLeftMargin:new Ue(0,0,100,200)},ga=G((function(e,a){const{jeScheduledTransaction:s,selectedJERow:t,scheduleType:n,isVendorBulkUpdateOnTransactionEnabled:i}=a,{scheduleDetailsLocalData:l,updateStatus:p}=Xe(e,a.scheduleType),h=U(e),v=l[n].jeScheduleDetails[t].jeLink,m=v.type==="recommended"?v.recommendedTransactionID:v.transactionDetailID,r=m!=null?xt(e,m):void 0,d=R.getSignedInUser(),c=e.tenantState.currentTenantId,x={userId:d?.userId??"",sessionId:d?.zeniSessionId??"",tenantId:h.tenantId??c},T=h?.company?.companyInfo?.firstMonthOfFY??1;return{jeScheduledTransaction:s,transactionDetail:r,localData:l[n].jeScheduleDetails[t],saveStatus:p.fetchState,authParams:x,isVendorBulkUpdateOnTransactionEnabled:i,firstMonthOfFY:T,isDisabled:p.fetchState==="In-Progress"?"readonly":void 0,analytics:j,qboAppUrl:Tt(Le.qboRedirectionUrl)}}),(function(e,a){const{selectedJERow:s,jeScheduleDetailId:t,navigate:n}=a;return{onUpdateLocalData:i=>{const l=i.linkJETransaction.qboURL;l!=null&&e(wt({scheduleType:a.scheduleType,jeScheduleDetailId:t,rowId:s,jeLink:l}))},onFetchTransactionClick:i=>{e(et(i))},onSaveClick:()=>{e(yt(a.scheduleType,t))},onBackClick:()=>{n("..",{relative:"path"})},onCancelClick:()=>{const i=a.jeScheduledTransaction.scheduledJournalEntry[s];e(bt({scheduleType:a.scheduleType,jeScheduleDetailId:t,rowId:s,originalScheduledJE:i})),n("..",{relative:"path"})}}}))(On),va=()=>{const e=Ln(),a=N(),s=W(),{scheduleDetailId:t}=z(),n=ne(),i=Sa.drawerLeftMargin.valuePx(n),{scheduleType:l}=z(),{useFeatureGate:p}=H(),{isFeatureEnabled:h}=p(M.isVendorBulkUpdateOnTransactionEnabled),v=gt(l)??"prepaid_expenses",[m,r]=u.useState(!1);if(R.getSignedInUser()==null)throw Error("Can't access Account detail page without signing in...");if(t==null)throw Error("Invalid Schedule Detail Id");const d=f((b=>Xe(b,v)));u.useEffect((()=>{d.fetchState==="Not-Started"&&a("..",{relative:"path"})}),[]);const c=d.selectedJELinkRowIndex,x=c!=null?d.scheduleDetailsLocalData[v].jeScheduleDetails[c]?.jeLink:null,T=x?.type==="recommended"?x.recommendedTransactionID:x?.transactionDetailID;u.useEffect((()=>{T!=null&&s(et(T))}),[]),u.useEffect((()=>{x?.type==="recommended"&&m===!1&&c!=null&&(r(!0),s(vt({scheduleType:v,jeScheduleDetailId:t,rowId:c})))}));const g=f((b=>U(b))),y=f((b=>ge(b,g.companyId)));return o.jsx(na,{anchor:"right",open:!0,PaperProps:{style:{width:`calc(100% - ${i})`,boxShadow:"none"}},slotProps:{backdrop:{style:{backgroundColor:e.colors.black,opacity:.75,cursor:"pointer"}}},onClose:()=>a("..",{relative:"path"}),children:o.jsx(xa,{onClick:b=>b.stopPropagation(),children:d.fetchState!=="Completed"||d.selectedJEScheduleTransaction==null||c==null?o.jsx(Bn,{fetchState:d.fetchState}):o.jsx(ga,{scheduleType:v,jeScheduleDetailId:t,selectedJERow:c,jeScheduledTransaction:d.selectedJEScheduleTransaction,isCOTEnabled:!1,navigate:a,scheduleTab:v,controllerUserDetails:y,isVendorBulkUpdateOnTransactionEnabled:h})})})},xa=B(St)`
1
+ import{j as o}from"./liveblocks-CW9yScMF.js";import{a as u}from"./sentry-C_uJQK1a.js";import{h as N,u as $,i as z,j as f,l as W,g as q,n as Me,o as V,N as L}from"./core-BI5oX4mx.js";import{Vz as gt,VA as Xe,Rm as et,VB as vt,fF as U,g_ as ge,VC as xt,cE as Tt,VD as bt,Fx as yt,VE as wt,VF as oe,VG as te,VH as ve,SX as ue,SY as ke,FN as pe,SW as he,FA as tt,F7 as Ve,VI as It,SZ as Y,l$ as me,VJ as Pe,F1 as Ct,VK as Dt,VL as Et,VM as je,VN as _e,VO as Ae,VP as Re,FH as xe,VQ as nt,Fo as at,VR as Ft,VS as kt,VT as Vt,VU as Pt,VV as jt,VW as _t,VX as At,VY as Rt,Ch as Ut,Cp as Lt,Ci as Bt,S2 as we,VZ as Ot,V_ as Mt,lf as Ie,br as Nt,V$ as Wt,W0 as $t,mZ as Gt,n6 as zt,S1 as Ce,bE as Ne,W1 as ot,RE as st,W2 as Yt,W3 as Jt,W4 as Kt,n8 as qt,W5 as We,W6 as $e,W7 as Ge,W8 as ze,W9 as Ht,n4 as Qt,Wa as Zt,n7 as Xt,Wb as en,Wc as it,Sn as rt,mn as tn,Wd as nn,We as De,Wf as dt,Sl as lt,I4 as an,Wg as on,Wh as sn,mH as ct,Wi as rn,Wj as dn,Sz as ln,vc as cn,Wk as ut,Wl as Ye,Sw as Ee,Wm as Je,Wn as un,SB as pn,Wo as hn,Wp as mn,Wq as fn,Wr as Sn,Ws as gn,vf as vn,Wt as xn,S_ as Tn,Uy as bn,Se as Fe,ia as yn,UA as wn,Uz as In,i8 as Cn,Wu as Dn,Wv as En,I9 as Fn,Ww as kn,Wx as Vn,Wy as Pn,Wz as jn,mr as _n,bn as An,d_ as Rn,dZ as Un}from"./zeni-epic-state-CIizsNeB.js";import{c as Ln,a1 as ne,ab as Ue,N as H,d as M,z as R,a7 as Bn,aM as On,k as P,Z as Le,E as Te,av as ee,as as se,aN as Mn,aO as pt,aq as Nn,a8 as Se,aP as Wn,p as K,U as $n,G as ht,aQ as Gn,ae as mt,a4 as zn,j as Ke,aR as Yn,I as J,a9 as Jn,af as ft,ag as Kn,aS as qn,aT as Hn,S as Be,aU as Qn,aV as Zn,a3 as Xn,aW as ea,aX as ta}from"./index-C2L5Bzwa.js";import{D as na,n as B,S as St}from"./mui-KP5Ep0NX.js";import{t as aa,A as oa}from"./AddressScreen-C2qj6tYr.js";import fe from"./NotFoundScreen-CS6UgwGr.js";import{F as sa}from"./FeaturePreviewScreen-R_rh5xYj.js";import{S as ia,a as ra,J as da,b as la,c as ca}from"./ScheduleDetailsPrepaidExpensesScreen-CJ28c5Wc.js";import{u as ie}from"./useAskAiCfoHostNavButtonProps-4TGjNsPg.js";import{M as re}from"./MobileAppDrawer-DEm85bH8.js";import{v as Oe,c as ua,d as pa}from"./routePaths-BrIEdo8u.js";import{D as ha}from"./DrawerScreen-KSeYe6Xi.js";import{a as ma,m as fa}from"./accountMappingHelper-B5wpHG39.js";import"./recharts-DRl2ZsSW.js";import"./analytics-5LJ4BXQX.js";import"./plaid-BrgJMdej.js";import"./dnd-D6wtGmk9.js";import"./stripe-cKAAJElX.js";import"./lottie-lQbJqTc2.js";import"./lexical-BLu7UAko.js";import"./pdf-DflcYtDk.js";import"./utils-BzQpFQvw.js";import"./pathToGoBack-Ddmf68xx.js";import"./InboxNotificationsProvider-CMirleoY.js";import"./useTaskManagerAccess-Bhr2JI_X.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]="53be9478-93c8-49a9-8c7a-516ea56e82bc",e._sentryDebugIdIdentifier="sentry-dbid-53be9478-93c8-49a9-8c7a-516ea56e82bc")}catch{}})();const Sa={drawerLeftMargin:new Ue(0,0,100,200)},ga=W((function(e,a){const{jeScheduledTransaction:s,selectedJERow:t,scheduleType:n,isVendorBulkUpdateOnTransactionEnabled:i}=a,{scheduleDetailsLocalData:l,updateStatus:p}=Xe(e,a.scheduleType),h=U(e),v=l[n].jeScheduleDetails[t].jeLink,m=v.type==="recommended"?v.recommendedTransactionID:v.transactionDetailID,r=m!=null?xt(e,m):void 0,d=R.getSignedInUser(),c=e.tenantState.currentTenantId,x={userId:d?.userId??"",sessionId:d?.zeniSessionId??"",tenantId:h.tenantId??c},T=h?.company?.companyInfo?.firstMonthOfFY??1;return{jeScheduledTransaction:s,transactionDetail:r,localData:l[n].jeScheduleDetails[t],saveStatus:p.fetchState,authParams:x,isVendorBulkUpdateOnTransactionEnabled:i,firstMonthOfFY:T,isDisabled:p.fetchState==="In-Progress"?"readonly":void 0,analytics:P,qboAppUrl:Tt(Le.qboRedirectionUrl)}}),(function(e,a){const{selectedJERow:s,jeScheduleDetailId:t,navigate:n}=a;return{onUpdateLocalData:i=>{const l=i.linkJETransaction.qboURL;l!=null&&e(wt({scheduleType:a.scheduleType,jeScheduleDetailId:t,rowId:s,jeLink:l}))},onFetchTransactionClick:i=>{e(et(i))},onSaveClick:()=>{e(yt(a.scheduleType,t))},onBackClick:()=>{n("..",{relative:"path"})},onCancelClick:()=>{const i=a.jeScheduledTransaction.scheduledJournalEntry[s];e(bt({scheduleType:a.scheduleType,jeScheduleDetailId:t,rowId:s,originalScheduledJE:i})),n("..",{relative:"path"})}}}))(On),va=()=>{const e=Ln(),a=N(),s=$(),{scheduleDetailId:t}=z(),n=ne(),i=Sa.drawerLeftMargin.valuePx(n),{scheduleType:l}=z(),{useFeatureGate:p}=H(),{isFeatureEnabled:h}=p(M.isVendorBulkUpdateOnTransactionEnabled),v=gt(l)??"prepaid_expenses",[m,r]=u.useState(!1);if(R.getSignedInUser()==null)throw Error("Can't access Account detail page without signing in...");if(t==null)throw Error("Invalid Schedule Detail Id");const d=f((b=>Xe(b,v)));u.useEffect((()=>{d.fetchState==="Not-Started"&&a("..",{relative:"path"})}),[]);const c=d.selectedJELinkRowIndex,x=c!=null?d.scheduleDetailsLocalData[v].jeScheduleDetails[c]?.jeLink:null,T=x?.type==="recommended"?x.recommendedTransactionID:x?.transactionDetailID;u.useEffect((()=>{T!=null&&s(et(T))}),[]),u.useEffect((()=>{x?.type==="recommended"&&m===!1&&c!=null&&(r(!0),s(vt({scheduleType:v,jeScheduleDetailId:t,rowId:c})))}));const g=f((b=>U(b))),y=f((b=>ge(b,g.companyId)));return o.jsx(na,{anchor:"right",open:!0,PaperProps:{style:{width:`calc(100% - ${i})`,boxShadow:"none"}},slotProps:{backdrop:{style:{backgroundColor:e.colors.black,opacity:.75,cursor:"pointer"}}},onClose:()=>a("..",{relative:"path"}),children:o.jsx(xa,{onClick:b=>b.stopPropagation(),children:d.fetchState!=="Completed"||d.selectedJEScheduleTransaction==null||c==null?o.jsx(Bn,{fetchState:d.fetchState}):o.jsx(ga,{scheduleType:v,jeScheduleDetailId:t,selectedJERow:c,jeScheduledTransaction:d.selectedJEScheduleTransaction,isCOTEnabled:!1,navigate:a,scheduleTab:v,controllerUserDetails:y,isVendorBulkUpdateOnTransactionEnabled:h})})})},xa=B(St)`
2
2
  display: flex;
3
3
  min-height: 100%;
4
4
  flex-direction: column;
5
- `,de=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"}},le=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"}},ce=()=>{const e=K(),a=W(),s=f((t=>oe(t)));return u.useEffect((()=>{const t=e.pathname.split("/").pop();if(t!=null){const n=(i=>{switch(i){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(te(n))}}),[e.pathname,s.currentTab,a]),s},Q="accrued_expenses",Ta=G((function(e,a){const s=U(e),t=oe(e);return{tenantName:s.companyName,vendorTabsToShow:a.vendorTabsToShow,report:a.scheduleListReport,downloadParams:a.downloadParams,companyIncorporationDate:a.companyIncDate,vendorTabView:t,isAccountingClassesEnabled:me(e)}}),(function(e,a){const{navigate:s}=a;return{onBackClick:()=>{s("../../..")},onVendorTabSelectionChanged:t=>{const n=de(t);s(n),e(te(le(t)))},onSortOrderChanged:(t,n)=>{e(Re({scheduleType:Q,sortKey:t,sortOrder:n}))},onChangeSubTab:t=>{e(Ae({scheduleType:Q,subTab:t}))},onSearchTextChanged:t=>{e(_e({scheduleType:Q,searchText:t}))},onReloadReport:()=>{e(tt(Q))},onScroll:t=>{e(Pe({scheduleType:Q,scrollYOffset:t}))},onClickNewButton:()=>{e(Dt()),e(Et()),j.trackScheduleAccruedDetailsNewRequested({scheduleType:"accrued_expenses"}),s("details/new")},onClickSchedule:t=>{e(Ct({selectedJEScheduleKey:t}));const n=a.scheduleListReport.jeAccruedSchedules.find((i=>i.jeAccruedScheduleKey===t));s(`details/${n?.jeScheduleId}`)},updateDownloadStateHandler:t=>{e(je({scheduleType:Q,fetchState:t}))}}}))(Mn),ba=({vendorTabsToShow:e,previousTabPosition:a,setPreviousTabPosition:s})=>{const[t,n]=u.useState(!1),[i,l]=u.useState(!1),p=N(),h=W(),{useFeatureGate:v}=H(),m=Te();ce();const{isFeatureEnabled:r,isFeatureGateLoading:d}=v(M.isOpexByVendorFeatureEnabled),c=R.getSignedInUser(),x=f((S=>U(S))),T={userId:c?.userId??"",sessionId:c?.zeniSessionId??"",tenantId:x.tenantId},g=u.useMemo((()=>({authParams:T,jeScheduleEndPoint:`${ee}/jeScheduleReports`,timezone:ve(),companyName:x.companyName})),[]),[y,b]=u.useState(!1),I=f((S=>ue(S))),E=f((S=>ke(S,"accrued_expenses"))),C=e.includes("prepaid_expenses"),w=e.includes("fixed_assets"),A=e.includes("accrued_expenses");u.useEffect((()=>{(C||w||A)&&y===!1&&I!=="Completed"&&(h(pe()),b(!0))}),[y]),u.useEffect((()=>{d===!1&&(h(he({shouldFetchAccruedExpenses:A,shouldFetchFixedAssets:!0,shouldFetchPrepaidExpenses:C,shouldFetchOpexByVendor:r,shouldFetchVendorsList:!1,shouldFetchFiling1099Vendor:!1})),n(!0))}),[I,w,d,r]),u.useEffect((()=>{t===!1&&E==="Completed"&&h(tt("accrued_expenses",{selectedTimeframe:Ve("accrued_expenses"),selectedCategoryId:"all"},!0))}),[t,E]);const P=f((S=>It(S,Q))),{isAiCfoAccessEnabled:O,onAskAiCfoClick:F}=ie({mobileExploreReferrer:"Vendors — Accrued Expenses"});se({isDataReady:P.fetchState==="Completed"});const D=f((S=>Y(S).isReportGenerated));f((S=>Y(S).fetchState))!=="Completed"||D!==!0||r!==!0||e.includes("operating_expenses_by_vendor")||e.splice(1,0,"operating_expenses_by_vendor"),A||p("../opex");const k=f((S=>ge(S,x.companyId))),$=S=>{l(S)};return o.jsxs(o.Fragment,{children:[o.jsx(re,{isAppContentDrawerOpen:i,handleDrawerToggle:$}),o.jsx(Ta,{navigate:p,previousTabPosition:a,setPreviousTabPosition:s,scheduleListReport:P,downloadParams:g,themeState:m,vendorTabsToShow:e,analytics:j,controllerUserDetails:k,isAiCfoAccessEnabled:O,onAskAiCfoClick:F,onClickMenuIcon:()=>$(!0)})]})},Z="fixed_assets",ya=G((function(e,a){const s=U(e),t=oe(e);return{tenantName:s.companyName,vendorTabsToShow:a.vendorTabsToShow,report:a.scheduleListReport,downloadParams:a.downloadParams,companyIncorporationDate:a.companyIncDate,controllerUserDetails:a.controllerUserDetails,vendorTabView:t,isAccountingClassesEnabled:me(e)}}),(function(e,a){const{navigate:s}=a;return{onBackClick:()=>{s("../../..")},onVendorTabSelectionChanged:t=>{const n=de(t);s(n),e(te(le(t)))},onSortOrderChanged:(t,n)=>{e(Re({scheduleType:Z,sortKey:t,sortOrder:n}))},onChangeSubTab:t=>{e(Ae({scheduleType:Z,subTab:t}))},onSearchTextChanged:t=>{e(_e({scheduleType:Z,searchText:t}))},onReloadReport:()=>{e(xe(Z))},onScroll:t=>{e(Pe({scheduleType:Z,scrollYOffset:t}))},onClickSchedule:t=>{e(at({selectedJEScheduleKey:t}));const n=a.scheduleListReport.jeScheduledTransactions.find((i=>i.jeScheduleTransactionKey===t));s(n?.jeScheduleId==null?"details/new":`details/${n.jeScheduleId}`)},updateDownloadStateHandler:t=>{e(je({scheduleType:Z,fetchState:t}))}}}))(pt),wa=({vendorTabsToShow:e,previousTabPosition:a,setPreviousTabPosition:s})=>{const[t,n]=u.useState(!1),i=N(),l=W();ce();const{useFeatureGate:p}=H(),h=Te(),{isFeatureEnabled:v,isFeatureGateLoading:m}=p(M.isOpexByVendorFeatureEnabled),r=R.getSignedInUser(),d=f((S=>U(S))),c={userId:r?.userId??"",sessionId:r?.zeniSessionId??"",tenantId:d.tenantId},x=u.useMemo((()=>({authParams:c,jeScheduleEndPoint:`${ee}/jeScheduleReports`,timezone:ve(),companyName:d.companyName})),[]),[T,g]=u.useState(!1),y=f((S=>ue(S))),b=f((S=>ke(S,"fixed_assets"))),I=e.includes("prepaid_expenses"),E=e.includes("fixed_assets"),C=e.includes("accrued_expenses");u.useEffect((()=>{(I||E||C)&&T===!1&&y!=="Completed"&&(l(pe()),g(!0))}),[T]),u.useEffect((()=>{m===!1&&(l(he({shouldFetchAccruedExpenses:C,shouldFetchFixedAssets:!0,shouldFetchPrepaidExpenses:I,shouldFetchOpexByVendor:v,shouldFetchVendorsList:!1,shouldFetchFiling1099Vendor:!1})),n(!0))}),[y,E,m,v]),u.useEffect((()=>{t===!1&&b==="Completed"&&l(xe("fixed_assets",{selectedTimeframe:Ve("fixed_assets"),selectedCategoryId:"all"},!0))}),[t,b]);const w=f((S=>nt(S,Z))),{isAiCfoAccessEnabled:A,onAskAiCfoClick:P}=ie({mobileExploreReferrer:"Vendors — Fixed Assets"});se({isDataReady:w.fetchState==="Completed"});const O=f((S=>Y(S).isReportGenerated));f((S=>Y(S).fetchState))!=="Completed"||O!==!0||v!==!0||e.includes("operating_expenses_by_vendor")||e.splice(1,0,"operating_expenses_by_vendor"),E||i("../opex");const F=f((S=>ge(S,d.companyId))),[D,k]=u.useState(!1),$=S=>{k(S)};return o.jsxs(o.Fragment,{children:[o.jsx(re,{isAppContentDrawerOpen:D,handleDrawerToggle:$}),o.jsx(ya,{navigate:i,scheduleListReport:w,downloadParams:x,previousTabPosition:a,setPreviousTabPosition:s,themeState:h,vendorTabsToShow:e,analytics:j,controllerUserDetails:F,isAiCfoAccessEnabled:A,onAskAiCfoClick:P,onClickMenuIcon:()=>{$(!0)}})]})},Ia=B.div`
5
+ `,de=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"}},le=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"}},ce=()=>{const e=q(),a=$(),s=f((t=>oe(t)));return u.useEffect((()=>{const t=e.pathname.split("/").pop();if(t!=null){const n=(i=>{switch(i){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(te(n))}}),[e.pathname,s.currentTab,a]),s},Q="accrued_expenses",Ta=W((function(e,a){const s=U(e),t=oe(e);return{tenantName:s.companyName,vendorTabsToShow:a.vendorTabsToShow,report:a.scheduleListReport,downloadParams:a.downloadParams,companyIncorporationDate:a.companyIncDate,vendorTabView:t,isAccountingClassesEnabled:me(e)}}),(function(e,a){const{navigate:s}=a;return{onBackClick:()=>{s("../../..")},onVendorTabSelectionChanged:t=>{const n=de(t);s(n),e(te(le(t)))},onSortOrderChanged:(t,n)=>{e(Re({scheduleType:Q,sortKey:t,sortOrder:n}))},onChangeSubTab:t=>{e(Ae({scheduleType:Q,subTab:t}))},onSearchTextChanged:t=>{e(_e({scheduleType:Q,searchText:t}))},onReloadReport:()=>{e(tt(Q))},onScroll:t=>{e(je({scheduleType:Q,scrollYOffset:t}))},onClickNewButton:()=>{e(Dt()),e(Et()),P.trackScheduleAccruedDetailsNewRequested({scheduleType:"accrued_expenses"}),s("details/new")},onClickSchedule:t=>{e(Ct({selectedJEScheduleKey:t}));const n=a.scheduleListReport.jeAccruedSchedules.find((i=>i.jeAccruedScheduleKey===t));s(`details/${n?.jeScheduleId}`)},updateDownloadStateHandler:t=>{e(Pe({scheduleType:Q,fetchState:t}))}}}))(Mn),ba=({vendorTabsToShow:e,previousTabPosition:a,setPreviousTabPosition:s})=>{const[t,n]=u.useState(!1),[i,l]=u.useState(!1),p=N(),h=$(),{useFeatureGate:v}=H(),m=Te();ce();const{isFeatureEnabled:r,isFeatureGateLoading:d}=v(M.isOpexByVendorFeatureEnabled),c=R.getSignedInUser(),x=f((S=>U(S))),T={userId:c?.userId??"",sessionId:c?.zeniSessionId??"",tenantId:x.tenantId},g=u.useMemo((()=>({authParams:T,jeScheduleEndPoint:`${ee}/jeScheduleReports`,timezone:ve(),companyName:x.companyName})),[]),[y,b]=u.useState(!1),I=f((S=>ue(S))),E=f((S=>ke(S,"accrued_expenses"))),C=e.includes("prepaid_expenses"),w=e.includes("fixed_assets"),A=e.includes("accrued_expenses");u.useEffect((()=>{(C||w||A)&&y===!1&&I!=="Completed"&&(h(pe()),b(!0))}),[y]),u.useEffect((()=>{d===!1&&(h(he({shouldFetchAccruedExpenses:A,shouldFetchFixedAssets:!0,shouldFetchPrepaidExpenses:C,shouldFetchOpexByVendor:r,shouldFetchVendorsList:!1,shouldFetchFiling1099Vendor:!1})),n(!0))}),[I,w,d,r]),u.useEffect((()=>{t===!1&&E==="Completed"&&h(tt("accrued_expenses",{selectedTimeframe:Ve("accrued_expenses"),selectedCategoryId:"all"},!0))}),[t,E]);const j=f((S=>It(S,Q))),{isAiCfoAccessEnabled:O,onAskAiCfoClick:F}=ie({mobileExploreReferrer:"Vendors — Accrued Expenses"});se({isDataReady:j.fetchState==="Completed"});const D=f((S=>Y(S).isReportGenerated));f((S=>Y(S).fetchState))!=="Completed"||D!==!0||r!==!0||e.includes("operating_expenses_by_vendor")||e.splice(1,0,"operating_expenses_by_vendor"),A||p("../opex");const k=f((S=>ge(S,x.companyId))),G=S=>{l(S)};return o.jsxs(o.Fragment,{children:[o.jsx(re,{isAppContentDrawerOpen:i,handleDrawerToggle:G}),o.jsx(Ta,{navigate:p,previousTabPosition:a,setPreviousTabPosition:s,scheduleListReport:j,downloadParams:g,themeState:m,vendorTabsToShow:e,analytics:P,controllerUserDetails:k,isAiCfoAccessEnabled:O,onAskAiCfoClick:F,onClickMenuIcon:()=>G(!0)})]})},Z="fixed_assets",ya=W((function(e,a){const s=U(e),t=oe(e);return{tenantName:s.companyName,vendorTabsToShow:a.vendorTabsToShow,report:a.scheduleListReport,downloadParams:a.downloadParams,companyIncorporationDate:a.companyIncDate,controllerUserDetails:a.controllerUserDetails,vendorTabView:t,isAccountingClassesEnabled:me(e)}}),(function(e,a){const{navigate:s}=a;return{onBackClick:()=>{s("../../..")},onVendorTabSelectionChanged:t=>{const n=de(t);s(n),e(te(le(t)))},onSortOrderChanged:(t,n)=>{e(Re({scheduleType:Z,sortKey:t,sortOrder:n}))},onChangeSubTab:t=>{e(Ae({scheduleType:Z,subTab:t}))},onSearchTextChanged:t=>{e(_e({scheduleType:Z,searchText:t}))},onReloadReport:()=>{e(xe(Z))},onScroll:t=>{e(je({scheduleType:Z,scrollYOffset:t}))},onClickSchedule:t=>{e(at({selectedJEScheduleKey:t}));const n=a.scheduleListReport.jeScheduledTransactions.find((i=>i.jeScheduleTransactionKey===t));s(n?.jeScheduleId==null?"details/new":`details/${n.jeScheduleId}`)},updateDownloadStateHandler:t=>{e(Pe({scheduleType:Z,fetchState:t}))}}}))(pt),wa=({vendorTabsToShow:e,previousTabPosition:a,setPreviousTabPosition:s})=>{const[t,n]=u.useState(!1),i=N(),l=$();ce();const{useFeatureGate:p}=H(),h=Te(),{isFeatureEnabled:v,isFeatureGateLoading:m}=p(M.isOpexByVendorFeatureEnabled),r=R.getSignedInUser(),d=f((S=>U(S))),c={userId:r?.userId??"",sessionId:r?.zeniSessionId??"",tenantId:d.tenantId},x=u.useMemo((()=>({authParams:c,jeScheduleEndPoint:`${ee}/jeScheduleReports`,timezone:ve(),companyName:d.companyName})),[]),[T,g]=u.useState(!1),y=f((S=>ue(S))),b=f((S=>ke(S,"fixed_assets"))),I=e.includes("prepaid_expenses"),E=e.includes("fixed_assets"),C=e.includes("accrued_expenses");u.useEffect((()=>{(I||E||C)&&T===!1&&y!=="Completed"&&(l(pe()),g(!0))}),[T]),u.useEffect((()=>{m===!1&&(l(he({shouldFetchAccruedExpenses:C,shouldFetchFixedAssets:!0,shouldFetchPrepaidExpenses:I,shouldFetchOpexByVendor:v,shouldFetchVendorsList:!1,shouldFetchFiling1099Vendor:!1})),n(!0))}),[y,E,m,v]),u.useEffect((()=>{t===!1&&b==="Completed"&&l(xe("fixed_assets",{selectedTimeframe:Ve("fixed_assets"),selectedCategoryId:"all"},!0))}),[t,b]);const w=f((S=>nt(S,Z))),{isAiCfoAccessEnabled:A,onAskAiCfoClick:j}=ie({mobileExploreReferrer:"Vendors — Fixed Assets"});se({isDataReady:w.fetchState==="Completed"});const O=f((S=>Y(S).isReportGenerated));f((S=>Y(S).fetchState))!=="Completed"||O!==!0||v!==!0||e.includes("operating_expenses_by_vendor")||e.splice(1,0,"operating_expenses_by_vendor"),E||i("../opex");const F=f((S=>ge(S,d.companyId))),[D,k]=u.useState(!1),G=S=>{k(S)};return o.jsxs(o.Fragment,{children:[o.jsx(re,{isAppContentDrawerOpen:D,handleDrawerToggle:G}),o.jsx(ya,{navigate:i,scheduleListReport:w,downloadParams:x,previousTabPosition:a,setPreviousTabPosition:s,themeState:h,vendorTabsToShow:e,analytics:P,controllerUserDetails:F,isAiCfoAccessEnabled:A,onAskAiCfoClick:j,onClickMenuIcon:()=>{G(!0)}})]})},Ia=B.div`
6
6
  display: flex;
7
7
  min-height: 100%;
8
8
  width: 100%;
@@ -10,7 +10,7 @@ import{j as o}from"./liveblocks-BXyXenK7.js";import{a as u}from"./sentry-D4svnzx
10
10
  flex-direction: column;
11
11
  align-items: center;
12
12
  background-color: ${e=>e.theme.colors.grey4};
13
- `,Ca=G((function(e,a){const s=R.getSignedInUser(),t=e.tenantState.currentTenantId,n=U(e),i=n?.companyName??"",l={userId:s?.userId??"",sessionId:s?.zeniSessionId??"",tenantId:t??""},p=Y(e),h=Ft(e);return{report:p,uiState:h,isAccountingClassesEnabled:me(e),analytics:j,vendorTabsToShow:a.vendorTabsToShow,downloadParams:{downloadState:h.downloadState,currentTenantCompanyName:i,statementEndPoint:`${ee}/opexByVendor`,authParams:l,timezone:ve()}}}),(function(e,a){const{navigate:s}=a;return{onFetchOpExByVendors:(t,n,i)=>{e(Bt(t,n,i))},onVendorNameAndBalanceClicked:(t,n)=>{if(a.tenantEmailDomain!=null){const i=Oe(t.id,t.qboId,a.tenantEmailDomain,n),l=q(a.location.state?.pathnameStackToGoBack,a.location.pathname);a.navigate(i,{state:{pathnameStackToGoBack:l,referrer:"Operating Expenses By Vendor"}})}},onRefresh:()=>{e(Lt())},onReloadReport:()=>{e(Ut(!0))},onBackClick:()=>{s("../../dashboard")},onTimeframeSelectionChanged:t=>{e(Rt(t))},onAdditionalBalanceSelectionChanged:(t,n)=>{e(At({isCompareModeOn:t,additionalBalances:n}))},onSortOrderChanged:(t,n,i)=>{e(_t({sortkey:n,sortOrder:t,timeframe:i}))},onVendorTabSelectionChanged:t=>{const n=de(t);s(n),e(te(le(t)))},onSortOrSearchStarted:t=>{e(Pt(t))},onPageFetchStarted:()=>{e(jt(!0))},updateDownloadStateHandler:t=>{e(Vt(t))},onClearSearch:t=>{e(kt({timeframe:t}))}}}))(Gn);function Da({vendorTabsToShow:e,previousTabPosition:a,setPreviousTabPosition:s}){const t=N(),n=W(),i=K(),{tenantEmailDomain:l}=z(),p=ne(),h=R.getSignedInUser(),{useFeatureGate:v}=H(),{isFeatureEnabled:m,isFeatureGateLoading:r}=v(M.isOpexByVendorFeatureEnabled),d=f((F=>Y(F)));if(h==null)throw Error("Can't access opex by vendor page without signing in...");ce();const[c,x]=u.useState(!1),T=f((F=>ue(F))),g=e.includes("prepaid_expenses"),y=e.includes("fixed_assets"),b=e.includes("accrued_expenses"),I=f((F=>oe(F))),{isAiCfoAccessEnabled:E,onAskAiCfoClick:C}=ie({mobileExploreReferrer:"Vendors — Operating Expenses by Vendor"});se({isDataReady:d.fetchState==="Completed"&&d.isReportGenerated===!0});const{areTenantIdsInSync:w}=Nn();u.useEffect((()=>{(g||y||b)&&c===!1&&T!=="Completed"&&w&&(n(pe()),x(!0))}),[c,w]),u.useEffect((()=>{w&&n(he({shouldFetchAccruedExpenses:b,shouldFetchFixedAssets:y,shouldFetchPrepaidExpenses:g,shouldFetchOpexByVendor:m===!0&&r===!1,shouldFetchVendorsList:!1,shouldFetchFiling1099Vendor:!1}))}),[T,y,r,m,w]),d.fetchState!=="Completed"||d.isReportGenerated!==!0||m!==!0||e.includes("operating_expenses_by_vendor")||e.splice(1,0,"operating_expenses_by_vendor"),u.useEffect((()=>{w&&(d.isReportGenerated===!1&&d.fetchState==="Completed"||m===!1&&r===!1)&&t("../summary")}),[w,d.isReportGenerated,d.fetchState,m,r,t]);const[A,P]=u.useState(!1),O=F=>{P(F)};return o.jsxs(Ia,{windowSize:p,children:[d.fetchState==="Completed"?o.jsx(Se,{analytics:j,onLoad:F=>{I.previousTab==null?F.trackVendorOperatingExpensesPageLoaded("Side Panel"):F.trackVendorOperatingExpenses(I.currentTab,I.previousTab??null)}}):null,o.jsx(re,{isAppContentDrawerOpen:A,handleDrawerToggle:O}),o.jsx(Ca,{location:i,navigate:t,previousTabPosition:a,setPreviousTabPosition:s,tenantEmailDomain:l,vendorTabsToShow:e,isAiCfoAccessEnabled:E,onAskAiCfoClick:C,onClickMenuIcon:()=>{O(!0)}})]})}const X="prepaid_expenses",Ea=G((function(e,a){const s=U(e),t=oe(e);return{tenantName:s.companyName,vendorTabsToShow:a.vendorTabsToShow,report:a.scheduleListReport,downloadParams:a.downloadParams,companyIncorporationDate:a.companyIncDate,controllerUserDetails:a.controllerUserDetails,vendorTabView:t,isAccountingClassesEnabled:me(e)}}),(function(e,a){const{navigate:s}=a;return{onBackClick:()=>{s("../../..")},onVendorTabSelectionChanged:t=>{const n=de(t);s(n),e(te(le(t)))},onSortOrderChanged:(t,n)=>{e(Re({scheduleType:X,sortKey:t,sortOrder:n}))},onChangeSubTab:t=>{e(Ae({scheduleType:X,subTab:t}))},onSearchTextChanged:t=>{e(_e({scheduleType:X,searchText:t}))},onReloadReport:()=>{e(xe(X))},onScroll:t=>{e(Pe({scheduleType:X,scrollYOffset:t}))},onClickSchedule:t=>{e(at({selectedJEScheduleKey:t}));const n=a.scheduleListReport.jeScheduledTransactions.find((i=>i.jeScheduleTransactionKey===t));s(n?.jeScheduleId==null?"details/new":`details/${n.jeScheduleId}`)},updateDownloadStateHandler:t=>{e(je({scheduleType:X,fetchState:t}))}}}))(pt),Fa=({vendorTabsToShow:e,previousTabPosition:a,setPreviousTabPosition:s})=>{const[t,n]=u.useState(!1),i=N(),l=W(),{useFeatureGate:p}=H(),h=Te();ce();const v=R.getSignedInUser(),{isFeatureEnabled:m,isFeatureGateLoading:r}=p(M.isOpexByVendorFeatureEnabled),d=f((S=>U(S))),c=f((S=>ke(S,"prepaid_expenses"))),x={userId:v?.userId??"",sessionId:v?.zeniSessionId??"",tenantId:d.tenantId},T=u.useMemo((()=>({authParams:x,jeScheduleEndPoint:`${ee}/jeScheduleReports`,timezone:ve(),companyName:d.companyName})),[]),[g,y]=u.useState(!1),b=f((S=>ue(S))),I=e.includes("prepaid_expenses"),E=e.includes("fixed_assets"),C=e.includes("accrued_expenses");u.useEffect((()=>{(I||E||C)&&g===!1&&b!=="Completed"&&(l(pe()),y(!0))}),[g]),u.useEffect((()=>{t===!1&&c==="Completed"&&l(xe("prepaid_expenses",{selectedTimeframe:Ve("prepaid_expenses"),selectedCategoryId:"all"},!0))}),[t,c]),u.useEffect((()=>{r===!1&&(l(he({shouldFetchAccruedExpenses:C,shouldFetchFixedAssets:E,shouldFetchPrepaidExpenses:!0,shouldFetchOpexByVendor:m,shouldFetchVendorsList:!1,shouldFetchFiling1099Vendor:!1})),n(!0))}),[b,E,r,m]);const w=f((S=>nt(S,X))),{isAiCfoAccessEnabled:A,onAskAiCfoClick:P}=ie({mobileExploreReferrer:"Vendors — Prepaid Expenses"});se({isDataReady:w.fetchState==="Completed"});const O=f((S=>Y(S).isReportGenerated));f((S=>Y(S).fetchState))!=="Completed"||O!==!0||m!==!0||e.includes("operating_expenses_by_vendor")||e.splice(1,0,"operating_expenses_by_vendor"),I||i("../opex");const F=f((S=>ge(S,d.companyId))),[D,k]=u.useState(!1),$=S=>{k(S)};return o.jsxs(o.Fragment,{children:[o.jsx(re,{isAppContentDrawerOpen:D,handleDrawerToggle:$}),o.jsx(Ea,{navigate:i,previousTabPosition:a,setPreviousTabPosition:s,scheduleListReport:w,downloadParams:T,themeState:h,vendorTabsToShow:e,analytics:j,controllerUserDetails:F,isAiCfoAccessEnabled:A,onAskAiCfoClick:P,onClickMenuIcon:()=>{$(!0)}})]})},ka=B.div`
13
+ `,Ca=W((function(e,a){const s=R.getSignedInUser(),t=e.tenantState.currentTenantId,n=U(e),i=n?.companyName??"",l={userId:s?.userId??"",sessionId:s?.zeniSessionId??"",tenantId:t??""},p=Y(e),h=Ft(e);return{report:p,uiState:h,isAccountingClassesEnabled:me(e),analytics:P,vendorTabsToShow:a.vendorTabsToShow,downloadParams:{downloadState:h.downloadState,currentTenantCompanyName:i,statementEndPoint:`${ee}/opexByVendor`,authParams:l,timezone:ve()}}}),(function(e,a){const{navigate:s}=a;return{onFetchOpExByVendors:(t,n,i)=>{e(Bt(t,n,i))},onVendorNameAndBalanceClicked:(t,n)=>{if(a.tenantEmailDomain!=null){const i=Oe(t.id,t.qboId,a.tenantEmailDomain,n),l=K(a.location.state?.pathnameStackToGoBack,a.location.pathname);a.navigate(i,{state:{pathnameStackToGoBack:l,referrer:"Operating Expenses By Vendor"}})}},onRefresh:()=>{e(Lt())},onReloadReport:()=>{e(Ut(!0))},onBackClick:()=>{s("../../dashboard")},onTimeframeSelectionChanged:t=>{e(Rt(t))},onAdditionalBalanceSelectionChanged:(t,n)=>{e(At({isCompareModeOn:t,additionalBalances:n}))},onSortOrderChanged:(t,n,i)=>{e(_t({sortkey:n,sortOrder:t,timeframe:i}))},onVendorTabSelectionChanged:t=>{const n=de(t);s(n),e(te(le(t)))},onSortOrSearchStarted:t=>{e(jt(t))},onPageFetchStarted:()=>{e(Pt(!0))},updateDownloadStateHandler:t=>{e(Vt(t))},onClearSearch:t=>{e(kt({timeframe:t}))}}}))(Wn);function Da({vendorTabsToShow:e,previousTabPosition:a,setPreviousTabPosition:s}){const t=N(),n=$(),i=q(),{tenantEmailDomain:l}=z(),p=ne(),h=R.getSignedInUser(),{useFeatureGate:v}=H(),{isFeatureEnabled:m,isFeatureGateLoading:r}=v(M.isOpexByVendorFeatureEnabled),d=f((F=>Y(F)));if(h==null)throw Error("Can't access opex by vendor page without signing in...");ce();const[c,x]=u.useState(!1),T=f((F=>ue(F))),g=e.includes("prepaid_expenses"),y=e.includes("fixed_assets"),b=e.includes("accrued_expenses"),I=f((F=>oe(F))),{isAiCfoAccessEnabled:E,onAskAiCfoClick:C}=ie({mobileExploreReferrer:"Vendors — Operating Expenses by Vendor"});se({isDataReady:d.fetchState==="Completed"&&d.isReportGenerated===!0});const{areTenantIdsInSync:w}=Nn();u.useEffect((()=>{(g||y||b)&&c===!1&&T!=="Completed"&&w&&(n(pe()),x(!0))}),[c,w]),u.useEffect((()=>{w&&n(he({shouldFetchAccruedExpenses:b,shouldFetchFixedAssets:y,shouldFetchPrepaidExpenses:g,shouldFetchOpexByVendor:m===!0&&r===!1,shouldFetchVendorsList:!1,shouldFetchFiling1099Vendor:!1}))}),[T,y,r,m,w]),d.fetchState!=="Completed"||d.isReportGenerated!==!0||m!==!0||e.includes("operating_expenses_by_vendor")||e.splice(1,0,"operating_expenses_by_vendor"),u.useEffect((()=>{w&&(d.isReportGenerated===!1&&d.fetchState==="Completed"||m===!1&&r===!1)&&t("../summary")}),[w,d.isReportGenerated,d.fetchState,m,r,t]);const[A,j]=u.useState(!1),O=F=>{j(F)};return o.jsxs(Ia,{windowSize:p,children:[d.fetchState==="Completed"?o.jsx(Se,{analytics:P,onLoad:F=>{I.previousTab==null?F.trackVendorOperatingExpensesPageLoaded("Side Panel"):F.trackVendorOperatingExpenses(I.currentTab,I.previousTab??null)}}):null,o.jsx(re,{isAppContentDrawerOpen:A,handleDrawerToggle:O}),o.jsx(Ca,{location:i,navigate:t,previousTabPosition:a,setPreviousTabPosition:s,tenantEmailDomain:l,vendorTabsToShow:e,isAiCfoAccessEnabled:E,onAskAiCfoClick:C,onClickMenuIcon:()=>{O(!0)}})]})}const X="prepaid_expenses",Ea=W((function(e,a){const s=U(e),t=oe(e);return{tenantName:s.companyName,vendorTabsToShow:a.vendorTabsToShow,report:a.scheduleListReport,downloadParams:a.downloadParams,companyIncorporationDate:a.companyIncDate,controllerUserDetails:a.controllerUserDetails,vendorTabView:t,isAccountingClassesEnabled:me(e)}}),(function(e,a){const{navigate:s}=a;return{onBackClick:()=>{s("../../..")},onVendorTabSelectionChanged:t=>{const n=de(t);s(n),e(te(le(t)))},onSortOrderChanged:(t,n)=>{e(Re({scheduleType:X,sortKey:t,sortOrder:n}))},onChangeSubTab:t=>{e(Ae({scheduleType:X,subTab:t}))},onSearchTextChanged:t=>{e(_e({scheduleType:X,searchText:t}))},onReloadReport:()=>{e(xe(X))},onScroll:t=>{e(je({scheduleType:X,scrollYOffset:t}))},onClickSchedule:t=>{e(at({selectedJEScheduleKey:t}));const n=a.scheduleListReport.jeScheduledTransactions.find((i=>i.jeScheduleTransactionKey===t));s(n?.jeScheduleId==null?"details/new":`details/${n.jeScheduleId}`)},updateDownloadStateHandler:t=>{e(Pe({scheduleType:X,fetchState:t}))}}}))(pt),Fa=({vendorTabsToShow:e,previousTabPosition:a,setPreviousTabPosition:s})=>{const[t,n]=u.useState(!1),i=N(),l=$(),{useFeatureGate:p}=H(),h=Te();ce();const v=R.getSignedInUser(),{isFeatureEnabled:m,isFeatureGateLoading:r}=p(M.isOpexByVendorFeatureEnabled),d=f((S=>U(S))),c=f((S=>ke(S,"prepaid_expenses"))),x={userId:v?.userId??"",sessionId:v?.zeniSessionId??"",tenantId:d.tenantId},T=u.useMemo((()=>({authParams:x,jeScheduleEndPoint:`${ee}/jeScheduleReports`,timezone:ve(),companyName:d.companyName})),[]),[g,y]=u.useState(!1),b=f((S=>ue(S))),I=e.includes("prepaid_expenses"),E=e.includes("fixed_assets"),C=e.includes("accrued_expenses");u.useEffect((()=>{(I||E||C)&&g===!1&&b!=="Completed"&&(l(pe()),y(!0))}),[g]),u.useEffect((()=>{t===!1&&c==="Completed"&&l(xe("prepaid_expenses",{selectedTimeframe:Ve("prepaid_expenses"),selectedCategoryId:"all"},!0))}),[t,c]),u.useEffect((()=>{r===!1&&(l(he({shouldFetchAccruedExpenses:C,shouldFetchFixedAssets:E,shouldFetchPrepaidExpenses:!0,shouldFetchOpexByVendor:m,shouldFetchVendorsList:!1,shouldFetchFiling1099Vendor:!1})),n(!0))}),[b,E,r,m]);const w=f((S=>nt(S,X))),{isAiCfoAccessEnabled:A,onAskAiCfoClick:j}=ie({mobileExploreReferrer:"Vendors — Prepaid Expenses"});se({isDataReady:w.fetchState==="Completed"});const O=f((S=>Y(S).isReportGenerated));f((S=>Y(S).fetchState))!=="Completed"||O!==!0||m!==!0||e.includes("operating_expenses_by_vendor")||e.splice(1,0,"operating_expenses_by_vendor"),I||i("../opex");const F=f((S=>ge(S,d.companyId))),[D,k]=u.useState(!1),G=S=>{k(S)};return o.jsxs(o.Fragment,{children:[o.jsx(re,{isAppContentDrawerOpen:D,handleDrawerToggle:G}),o.jsx(Ea,{navigate:i,previousTabPosition:a,setPreviousTabPosition:s,scheduleListReport:w,downloadParams:T,themeState:h,vendorTabsToShow:e,analytics:P,controllerUserDetails:F,isAiCfoAccessEnabled:A,onAskAiCfoClick:j,onClickMenuIcon:()=>{G(!0)}})]})},ka=B.div`
14
14
  display: flex;
15
15
  min-height: 100%;
16
16
  width: 100%;
@@ -18,7 +18,7 @@ import{j as o}from"./liveblocks-BXyXenK7.js";import{a as u}from"./sentry-D4svnzx
18
18
  flex-direction: column;
19
19
  align-items: center;
20
20
  background-color: ${e=>e.theme.colors.grey4};
21
- `,Va=G((function(e,a){const{isFiling1099FeatureEnabled:s,vendorDetailView:t,selectedVendor:n,firstMonthOfFY:i,currentTenant:l,currentUserRoleMap:p}=a,h=R.getSignedInUser(),v={userId:h?.userId??"",sessionId:h?.zeniSessionId??"",tenantId:l.tenantId??""};return{firstMonthOfFY:i,isFiling1099FeatureEnabled:s,vendorDetailView:t,allTransactions:t?.allVendorTransactionsView,allTransactionsTabData:t?.allTransactionsTabData!=null?{timePeriod:Yt(t?.allTransactionsTabData.timePeriod),numberOfQuartersFetched:t?.allTransactionsTabData.numberOfQuartersFetched}:void 0,vendorLogo:n?.logo,readOnlyMode:p?.bookkeeping_user===!0,filesEndPoint:mt.fileMicroServiceBaseUrl,authParams:v,scrollToTrend:a.isTrendPeriodSelected}}),(function(e,a){const{navigate:s,vendorDetailView:t,vendorId:n,defaultTransactionTimePeriod:i,vendorEntity:l,tenantEmailDomain:p,location:h,firstMonthOfFY:v}=a,m=()=>{const r=zn(h.state?.pathnameStackToGoBack),d=r.poppedPathname??((c=2)=>{let x=c;a.isTrendPeriodSelected===!0&&(x=5);let T="../";for(let g=0;g<x;g++)T=`${T}../`;return T})(1);s(d,{state:{pathnameStackToGoBack:r.newStack}})};return{onSaveVendor:()=>{t!=null&&((r,d)=>{const{vendorId:c,vendorName:x,existingCategory:T,existingClass:g,existingOwner:y,selectedCategory:b,selectedClass:I,selectedOwner:E,isRecommendedCategorySelected:C,isRecommendedClassSelected:w,categoryRecommendationTypeSelected:A,classRecommendationTypeSelected:P}=en(r,d);c!=null&&j.trackVendorDetailsSave(c,x??"",T,g,y,b,I,E,C,w,A,P)})(t?.vendorViewDetails,t?.vendorViewDetails.ownerList),n!=null&&e(Xt(n,void 0))},onVendorSpendTrendFilterTabClick:r=>{e(Zt(r))},saveVendorDetailLocalData:r=>{n!=null&&e(Qt({vendorId:n,localData:r}))},saveContactsInVendorTabDetailLocalData:(r,d)=>{e(Ht({vendorId:r,localData:{contacts:d}}))},onCancelClick:()=>{var r;t?.vendorViewDetails.vendorView?.vendorBasic!=null&&(r=t.vendorViewDetails.vendorView.vendorBasic).id!=null&&j.trackVendorDetailsCancel(r.id??"",r.name,r.account?.accountName,r.class?.className,r.owner?.email),e(Ge()),e(We()),e($e()),e(ze()),m()},handleSpendTrendPercentChangeClick:()=>{var r;t?.vendorViewDetails.vendorView?.vendorBasic!=null&&(r=t.vendorViewDetails.vendorView?.vendorBasic,r.id!=null&&j.trackVendorDetailsSpendTrendHotlinkClicked(r.id??"",r.name,r.account?.accountName,r.class?.className,r.owner?.email))},onSaveSuccess:()=>{n!=null&&e(Kt("Not-Started",n)),e(Ge()),e(We()),e($e()),e(ze()),m()},onTrendSelectedPeriodChange:r=>{if(r==null)i!=null&&e(we(l,"EntityDetail",{timeframe:"quarter",timePeriod:i}));else{const d=r.currentTimePeriod==null?r.addTimePeriod:{startDate:r.addTimePeriod.startDate,endDate:r.currentTimePeriod.endDate};e(Ce(l,"EntityDetail",{timeframe:r.timeframe,timePeriod:r.addTimePeriod},v)),e(we(l,"EntityDetail",{timeframe:r.timeframe,timePeriod:d}))}},onVendorTabSelectionChanged:r=>{e(qt(r))},onAddressClick:(r,d)=>{if(p==null)return;const c=pa(p,r,d),x=q(h.state?.pathnameStackToGoBack,h.pathname);s(c,{state:{pathnameStackToGoBack:x}})},onVendorDetailUIChange:r=>{e(Jt({collapsableStatus:r}))},onTransactionItemClick:r=>{const d=`${ua(r,p)}`,c=q(h.state?.pathnameStackToGoBack,h.pathname);s(d,{state:{pathnameStackToGoBack:c}})},onLoadPreviousTransactionsClick:(r,d)=>{e(ot({timePeriod:Ie(r),numberOfQuartersFetched:d})),e(st(l,Ie(r),!0,!0))}}}))($n);function Ke({referrerType:e,isFiling1099FeatureEnabled:a}){const s=W(),t=K(),n=N(),i=Wn(),[l,p]=u.useState(!1),[h,v]=u.useState(!1),[m,r]=u.useState(!1),d=z(),c=d.vendorId,x=d.qboId,{tenantEmailDomain:T,timeframe:g,startDate:y,endDate:b}=d,I={id:x??"",name:"",type:"vendor",zeniId:c??"",qboId:x??""};u.useEffect((()=>{g!=null&&y!=null&&b!=null?p(!0):(p(!1),m===!1&&(r(!0),s(we(I,"EntityDetail"))))}),[g,y,b]);const E=ne(),C=f((_=>U(_))),w=f((_=>c!=null?Ot(_,c,I):void 0)),A=f((_=>_.vendorState.vendorByID[c??""])),P=f((_=>U(_).company?.companyInfo.firstMonthOfFY??1)),O=f((()=>Mt(P,2))),F=Ie({startDate:O.startDate,endDate:Nt()}),D=Gt(P),k=f((_=>Wt(_.trendWithTransactionsState,I,"EntityDetail"))),[$,S]=u.useState(!1),be=l===!1&&m===!1?void 0:k?.selectedPeriod?.timePeriod??D;return u.useEffect((()=>(e==null&&w?.fetchState!=="Not-Started"||c==null||s($t(c,I)),()=>{e!=null&&c!=null&&s(zt(c))})),[c,t.state,s]),u.useEffect((()=>{w?.fetchState==="Completed"&&w?.vendorViewDetails.vendorView?.vendorBasic!=null&&((_,ae,ye)=>{_.id!=null&&j.trackVendorDetails(_.id,_.name,ye,_.account?.accountName,_.class?.className,_.owner?.email,ae.percentChange,ae.last30DaysSpend,ae.last90DaysSpend,ae.yearToDateSpend)})(w?.vendorViewDetails.vendorView?.vendorBasic,w?.vendorSpend,e),S(!1)}),[w?.fetchState]),u.useEffect((()=>{if(w?.fetchState==="Completed"&&$===!1){be!=null&&l===!1&&(s(Ce(I,"EntityDetail",{timeframe:k?.selectedPeriod?.timeframe??"quarter",timePeriod:be},P)),S(!0));const _=ht.getLocalizedStrings().dateFormat.analytics;if(l===!0&&g!=null&&y!=null&&b!=null){S(!0);const ae=g,ye={startDate:Ne(y,_.YYYYDashMMDashDDFormat),endDate:Ne(b,_.YYYYDashMMDashDDFormat)};s(Ce(I,"EntityDetail",{timeframe:ae,timePeriod:ye}))}}}),[w?.fetchState,be,k?.selectedPeriod?.timeframe,l,P]),u.useEffect((()=>{w?.fetchState==="Completed"&&h===!1&&(s(ot({timePeriod:F,numberOfQuartersFetched:3})),s(st(I,w.allTransactionsTabData?.timePeriod??F,!1,!0)),v(!0))}),[w?.fetchState,h]),c==null?o.jsx(fe,{}):o.jsx(ka,{windowSize:E,children:o.jsx(Va,{location:t,navigate:n,isFiling1099FeatureEnabled:a,vendorDetailView:w,vendorId:c,currentTenant:C,selectedVendor:A,firstMonthOfFY:P,isTrendPeriodSelected:l,selectedPeriodTimePeriod:k?.selectedPeriod?.timePeriod,defaultTransactionTimePeriod:D,vendorEntity:I,currentUserRoleMap:i?.loggedInUserRoleMap,tenantEmailDomain:T})})}const ja=ht.getLocalizedStrings().spendManagement.billPay.vendorCreation.vendorDetails,Pa={containerWidth:new Ue(100,58)},_a=B(Jn)`
21
+ `,Va=W((function(e,a){const{isFiling1099FeatureEnabled:s,vendorDetailView:t,selectedVendor:n,firstMonthOfFY:i,currentTenant:l,currentUserRoleMap:p}=a,h=R.getSignedInUser(),v={userId:h?.userId??"",sessionId:h?.zeniSessionId??"",tenantId:l.tenantId??""};return{firstMonthOfFY:i,isFiling1099FeatureEnabled:s,vendorDetailView:t,allTransactions:t?.allVendorTransactionsView,allTransactionsTabData:t?.allTransactionsTabData!=null?{timePeriod:Yt(t?.allTransactionsTabData.timePeriod),numberOfQuartersFetched:t?.allTransactionsTabData.numberOfQuartersFetched}:void 0,vendorLogo:n?.logo,readOnlyMode:p?.bookkeeping_user===!0,filesEndPoint:mt.fileMicroServiceBaseUrl,authParams:v,scrollToTrend:a.isTrendPeriodSelected}}),(function(e,a){const{navigate:s,vendorDetailView:t,vendorId:n,defaultTransactionTimePeriod:i,vendorEntity:l,tenantEmailDomain:p,location:h,firstMonthOfFY:v}=a,m=()=>{const r=zn(h.state?.pathnameStackToGoBack),d=r.poppedPathname??((c=2)=>{let x=c;a.isTrendPeriodSelected===!0&&(x=5);let T="../";for(let g=0;g<x;g++)T=`${T}../`;return T})(1);s(d,{state:{pathnameStackToGoBack:r.newStack}})};return{onSaveVendor:()=>{t!=null&&((r,d)=>{const{vendorId:c,vendorName:x,existingCategory:T,existingClass:g,existingOwner:y,selectedCategory:b,selectedClass:I,selectedOwner:E,isRecommendedCategorySelected:C,isRecommendedClassSelected:w,categoryRecommendationTypeSelected:A,classRecommendationTypeSelected:j}=en(r,d);c!=null&&P.trackVendorDetailsSave(c,x??"",T,g,y,b,I,E,C,w,A,j)})(t?.vendorViewDetails,t?.vendorViewDetails.ownerList),n!=null&&e(Xt(n,void 0))},onVendorSpendTrendFilterTabClick:r=>{e(Zt(r))},saveVendorDetailLocalData:r=>{n!=null&&e(Qt({vendorId:n,localData:r}))},saveContactsInVendorTabDetailLocalData:(r,d)=>{e(Ht({vendorId:r,localData:{contacts:d}}))},onCancelClick:()=>{var r;t?.vendorViewDetails.vendorView?.vendorBasic!=null&&(r=t.vendorViewDetails.vendorView.vendorBasic).id!=null&&P.trackVendorDetailsCancel(r.id??"",r.name,r.account?.accountName,r.class?.className,r.owner?.email),e(We()),e($e()),e(Ge()),e(ze()),m()},handleSpendTrendPercentChangeClick:()=>{var r;t?.vendorViewDetails.vendorView?.vendorBasic!=null&&(r=t.vendorViewDetails.vendorView?.vendorBasic,r.id!=null&&P.trackVendorDetailsSpendTrendHotlinkClicked(r.id??"",r.name,r.account?.accountName,r.class?.className,r.owner?.email))},onSaveSuccess:()=>{n!=null&&e(qt("Not-Started",n)),e(We()),e($e()),e(Ge()),e(ze()),m()},onTrendSelectedPeriodChange:r=>{if(r==null)i!=null&&e(we(l,"EntityDetail",{timeframe:"quarter",timePeriod:i}));else{const d=r.currentTimePeriod==null?r.addTimePeriod:{startDate:r.addTimePeriod.startDate,endDate:r.currentTimePeriod.endDate};e(Ce(l,"EntityDetail",{timeframe:r.timeframe,timePeriod:r.addTimePeriod},v)),e(we(l,"EntityDetail",{timeframe:r.timeframe,timePeriod:d}))}},onVendorTabSelectionChanged:r=>{e(Kt(r))},onAddressClick:(r,d)=>{if(p==null)return;const c=pa(p,r,d),x=K(h.state?.pathnameStackToGoBack,h.pathname);s(c,{state:{pathnameStackToGoBack:x}})},onVendorDetailUIChange:r=>{e(Jt({collapsableStatus:r}))},onTransactionItemClick:r=>{const d=`${ua(r,p)}`,c=K(h.state?.pathnameStackToGoBack,h.pathname);s(d,{state:{pathnameStackToGoBack:c}})},onLoadPreviousTransactionsClick:(r,d)=>{e(ot({timePeriod:Ie(r),numberOfQuartersFetched:d})),e(st(l,Ie(r),!0,!0))}}}))(Gn);function qe({referrerType:e,isFiling1099FeatureEnabled:a}){const s=$(),t=q(),n=N(),i=$n(),[l,p]=u.useState(!1),[h,v]=u.useState(!1),[m,r]=u.useState(!1),d=z(),c=d.vendorId,x=d.qboId,{tenantEmailDomain:T,timeframe:g,startDate:y,endDate:b}=d,I={id:x??"",name:"",type:"vendor",zeniId:c??"",qboId:x??""};u.useEffect((()=>{g!=null&&y!=null&&b!=null?p(!0):(p(!1),m===!1&&(r(!0),s(we(I,"EntityDetail"))))}),[g,y,b]);const E=ne(),C=f((_=>U(_))),w=f((_=>c!=null?Ot(_,c,I):void 0)),A=f((_=>_.vendorState.vendorByID[c??""])),j=f((_=>U(_).company?.companyInfo.firstMonthOfFY??1)),O=f((()=>Mt(j,2))),F=Ie({startDate:O.startDate,endDate:Nt()}),D=Wt(j),k=f((_=>$t(_.trendWithTransactionsState,I,"EntityDetail"))),[G,S]=u.useState(!1),be=l===!1&&m===!1?void 0:k?.selectedPeriod?.timePeriod??D;return u.useEffect((()=>(e==null&&w?.fetchState!=="Not-Started"||c==null||s(Gt(c,I)),()=>{e!=null&&c!=null&&s(zt(c))})),[c,t.state,s]),u.useEffect((()=>{w?.fetchState==="Completed"&&w?.vendorViewDetails.vendorView?.vendorBasic!=null&&((_,ae,ye)=>{_.id!=null&&P.trackVendorDetails(_.id,_.name,ye,_.account?.accountName,_.class?.className,_.owner?.email,ae.percentChange,ae.last30DaysSpend,ae.last90DaysSpend,ae.yearToDateSpend)})(w?.vendorViewDetails.vendorView?.vendorBasic,w?.vendorSpend,e),S(!1)}),[w?.fetchState]),u.useEffect((()=>{if(w?.fetchState==="Completed"&&G===!1){be!=null&&l===!1&&(s(Ce(I,"EntityDetail",{timeframe:k?.selectedPeriod?.timeframe??"quarter",timePeriod:be},j)),S(!0));const _=ht.getLocalizedStrings().dateFormat.analytics;if(l===!0&&g!=null&&y!=null&&b!=null){S(!0);const ae=g,ye={startDate:Ne(y,_.YYYYDashMMDashDDFormat),endDate:Ne(b,_.YYYYDashMMDashDDFormat)};s(Ce(I,"EntityDetail",{timeframe:ae,timePeriod:ye}))}}}),[w?.fetchState,be,k?.selectedPeriod?.timeframe,l,j]),u.useEffect((()=>{w?.fetchState==="Completed"&&h===!1&&(s(ot({timePeriod:F,numberOfQuartersFetched:3})),s(st(I,w.allTransactionsTabData?.timePeriod??F,!1,!0)),v(!0))}),[w?.fetchState,h]),c==null?o.jsx(fe,{}):o.jsx(ka,{windowSize:E,children:o.jsx(Va,{location:t,navigate:n,isFiling1099FeatureEnabled:a,vendorDetailView:w,vendorId:c,currentTenant:C,selectedVendor:A,firstMonthOfFY:j,isTrendPeriodSelected:l,selectedPeriodTimePeriod:k?.selectedPeriod?.timePeriod,defaultTransactionTimePeriod:D,vendorEntity:I,currentUserRoleMap:i?.loggedInUserRoleMap,tenantEmailDomain:T})})}const Pa=ht.getLocalizedStrings().spendManagement.billPay.vendorCreation.vendorDetails,ja={containerWidth:new Ue(100,58)},_a=B(Jn)`
22
22
  width: ${J.sp4};
23
23
  height: ${J.sp4};
24
24
  cursor: pointer;
@@ -33,9 +33,9 @@ import{j as o}from"./liveblocks-BXyXenK7.js";import{a as u}from"./sentry-D4svnzx
33
33
  `,Ra=B.div`
34
34
  display: flex;
35
35
  flex-direction: column;
36
- width: ${e=>`${Pa.containerWidth.value(e.windowSize)}%`};
36
+ width: ${e=>`${ja.containerWidth.value(e.windowSize)}%`};
37
37
  ${e=>e.windowSize!=="small"?"overflow: auto;":""}
38
- `,Ua=G((function(e,a){const s=R.getSignedInUser(),t=e.tenantState.currentTenantId,n={userId:s?.userId??"",sessionId:s?.zeniSessionId??"",tenantId:t??""},i=e.vendorFiling1099UploadDetailsState,l=e.vendorFiling1099UploadDetailsState;let p={fetchState:"Not-Started",error:void 0};return a.vendorId!=null&&(p=e.vendorViewState.editVendorStateById[a.vendorId]?.fetchStatus),{uploadInvoiceEndPoint:`${mt.documentAIMicroServiceBaseUrl}`,vendorFiling1099UploadDetailsState:i,vendorFiling1099UploadDetailsViewState:l,uploadStaus:l.w9FormUploadStatus,authParams:n,billId:a.billId,vendorId:a.vendorId,file:a.file,showAutofill:a.showAutofill,type:a.type,analytics:j,entityId:a.billId,fetchVendorFetchStatus:p,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(on({w9FormFile:t.files[0]})),t.w9_form[0]!=null)){e(sn({ocrData:t.w9_form[0],vendorId:s}));const n=(i=>({street:[i.street.join(" ")],city:i.city,state:i.state,postalCode:i.postal_code,countryCode:i.country_code??void 0,country:i.country??""}))(t.w9_form[0].address);e(ct({addressType:"vendor_address",addressToCreate:n}))}},updateInvoiceUploadFetchState:t=>{e(De({fetchState:t,error:void 0}))},onSkipAutofill:t=>{e(an(t))},onVendorFiling1099UploadDetailsSave:t=>{e(lt(t))},onDeleteClick:()=>{e(De({fetchState:"Not-Started",error:void 0})),e(dt({vendorId:s,w9Documents:[]}))}}}))(Kn);function He({appContent:e,showFullScreenSkeletonWhileLoading:a}){const s=W(),t=N(),{vendorId:n}=z(),i=ne(),l=Te(),p=R.getSignedInUser(),[h,v]=u.useState(!1),{useFeatureGate:m}=H(),{isFeatureEnabled:r}=m(M.isVendorRecommendationFeatureEnabled),d=f((D=>U(D))).companyName,c=new AbortController,x=c.signal;let T,g,y,b,I;if(n==null)throw new Error("Vendor ID not found for Vendor Filing 1099 Details Screen");T=f((D=>it(D,n))),g=f((D=>D.vendorFiling1099UploadDetailsState.vendor1099DetailsSaveStatus)),y=f((D=>D.vendorViewState.editVendorStateById[n]?.fetchStatus)),I=f((D=>D.vendorFiling1099UploadDetailsState.vendor1099DetailsLocalData.w9Documents?.[0])),b=f((D=>D.vendorFiling1099UploadDetailsState));const E=y?.fetchState==="In-Progress"||b?.w9FormUploadStatus?.fetchState==="In-Progress",C=()=>{l.toggle()};u.useEffect((()=>()=>{c.abort(),s(rt(n))}),[]),u.useEffect((()=>{h||n!=null&&(v(!0),s(tn(!1,n,x)))}),[n]);const w=qe(y?.fetchState),A=qe(g?.fetchState),P=T.vendor?.contactIds,O=P?.[P.length-1],F=f((D=>D.contactState.contactById[O]));if(u.useEffect((()=>{n!=null&&w==="In-Progress"&&y?.fetchState==="Completed"&&T?.vendor!=null&&(s(nn(n,T.vendor,F)),T?.vendor.filing1099W9Files?.[0]!=null&&s(De({fetchState:"Completed",error:void 0})))}),[n,T?.vendor]),u.useEffect((()=>{A==="In-Progress"&&g?.fetchState==="Completed"&&t("../../vendors/filing_1099")}),[g?.fetchState]),a===!0&&y?.fetchState!=="Completed"&&y?.fetchState!=="Error")return o.jsx(Na,{children:o.jsx(Yn,{})});if(p==null)throw Error("Can't access VendorFiling1099UploadScreen without signing in...");return o.jsxs(Aa,{windowSize:i,children:[i!=="small"?o.jsxs(Ba,{children:[o.jsx(_a,{onClick:C}),o.jsxs(La,{showContent:p.userEmailDomain==="zeni.ai",children:[o.jsx(Oa,{showAutofill:!1}),o.jsx(Ma,{showAutofill:!1,children:d})]})]}):null,o.jsx(Ua,{vendorId:n,file:I,showAutofill:!1,type:"w9",isVendorRecommendationEnabled:r,pdfTitle:I?ja.w9FormTitle:void 0,showTitlebar:!0,showTitlebarIcon:!0,vendorLegalName:T?.vendor?.legalName,isLoading:E}),o.jsx(Ra,{windowSize:i,children:e})]})}const La=B.div`
38
+ `,Ua=W((function(e,a){const s=R.getSignedInUser(),t=e.tenantState.currentTenantId,n={userId:s?.userId??"",sessionId:s?.zeniSessionId??"",tenantId:t??""},i=e.vendorFiling1099UploadDetailsState,l=e.vendorFiling1099UploadDetailsState;let p={fetchState:"Not-Started",error:void 0};return a.vendorId!=null&&(p=e.vendorViewState.editVendorStateById[a.vendorId]?.fetchStatus),{uploadInvoiceEndPoint:`${mt.documentAIMicroServiceBaseUrl}`,vendorFiling1099UploadDetailsState:i,vendorFiling1099UploadDetailsViewState:l,uploadStaus:l.w9FormUploadStatus,authParams:n,billId:a.billId,vendorId:a.vendorId,file:a.file,showAutofill:a.showAutofill,type:a.type,analytics:P,entityId:a.billId,fetchVendorFetchStatus:p,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(on({w9FormFile:t.files[0]})),t.w9_form[0]!=null)){e(sn({ocrData:t.w9_form[0],vendorId:s}));const n=(i=>({street:[i.street.join(" ")],city:i.city,state:i.state,postalCode:i.postal_code,countryCode:i.country_code??void 0,country:i.country??""}))(t.w9_form[0].address);e(ct({addressType:"vendor_address",addressToCreate:n}))}},updateInvoiceUploadFetchState:t=>{e(De({fetchState:t,error:void 0}))},onSkipAutofill:t=>{e(an(t))},onVendorFiling1099UploadDetailsSave:t=>{e(lt(t))},onDeleteClick:()=>{e(De({fetchState:"Not-Started",error:void 0})),e(dt({vendorId:s,w9Documents:[]}))}}}))(qn);function He({appContent:e,showFullScreenSkeletonWhileLoading:a}){const s=$(),t=N(),{vendorId:n}=z(),i=ne(),l=Te(),p=R.getSignedInUser(),[h,v]=u.useState(!1),{useFeatureGate:m}=H(),{isFeatureEnabled:r}=m(M.isVendorRecommendationFeatureEnabled),d=f((D=>U(D))).companyName,c=new AbortController,x=c.signal;let T,g,y,b,I;if(n==null)throw new Error("Vendor ID not found for Vendor Filing 1099 Details Screen");T=f((D=>it(D,n))),g=f((D=>D.vendorFiling1099UploadDetailsState.vendor1099DetailsSaveStatus)),y=f((D=>D.vendorViewState.editVendorStateById[n]?.fetchStatus)),I=f((D=>D.vendorFiling1099UploadDetailsState.vendor1099DetailsLocalData.w9Documents?.[0])),b=f((D=>D.vendorFiling1099UploadDetailsState));const E=y?.fetchState==="In-Progress"||b?.w9FormUploadStatus?.fetchState==="In-Progress",C=()=>{l.toggle()};u.useEffect((()=>()=>{c.abort(),s(rt(n))}),[]),u.useEffect((()=>{h||n!=null&&(v(!0),s(tn(!1,n,x)))}),[n]);const w=Ke(y?.fetchState),A=Ke(g?.fetchState),j=T.vendor?.contactIds,O=j?.[j.length-1],F=f((D=>D.contactState.contactById[O]));if(u.useEffect((()=>{n!=null&&w==="In-Progress"&&y?.fetchState==="Completed"&&T?.vendor!=null&&(s(nn(n,T.vendor,F)),T?.vendor.filing1099W9Files?.[0]!=null&&s(De({fetchState:"Completed",error:void 0})))}),[n,T?.vendor]),u.useEffect((()=>{A==="In-Progress"&&g?.fetchState==="Completed"&&t("../../vendors/filing_1099")}),[g?.fetchState]),a===!0&&y?.fetchState!=="Completed"&&y?.fetchState!=="Error")return o.jsx(Na,{children:o.jsx(Yn,{})});if(p==null)throw Error("Can't access VendorFiling1099UploadScreen without signing in...");return o.jsxs(Aa,{windowSize:i,children:[i!=="small"?o.jsxs(Ba,{children:[o.jsx(_a,{onClick:C}),o.jsxs(La,{showContent:p.userEmailDomain==="zeni.ai",children:[o.jsx(Oa,{showAutofill:!1}),o.jsx(Ma,{showAutofill:!1,children:d})]})]}):null,o.jsx(Ua,{vendorId:n,file:I,showAutofill:!1,type:"w9",isVendorRecommendationEnabled:r,pdfTitle:I?Pa.w9FormTitle:void 0,showTitlebar:!0,showTitlebarIcon:!0,vendorLegalName:T?.vendor?.legalName,isLoading:E}),o.jsx(Ra,{windowSize:i,children:e})]})}const La=B.div`
39
39
  display: ${e=>e.showContent?"flex":"none"};
40
40
  align-items: center;
41
41
  `,Ba=B.div`
@@ -50,14 +50,14 @@ import{j as o}from"./liveblocks-BXyXenK7.js";import{a as u}from"./sentry-D4svnzx
50
50
  height: ${J.sp3};
51
51
  margin: ${J.sp0} ${J.sp3};
52
52
  background-color: ${e=>e.showAutofill?ft.neutralGrey1Light:e.theme.colors.hero};
53
- `,Ma=B(qn.StandardMedium)`
53
+ `,Ma=B(Kn.StandardMedium)`
54
54
  color: ${e=>e.showAutofill?ft.neutralGrey5Light:e.theme.colors.primary};
55
55
  `,Na=B.div`
56
56
  width: 100%;
57
57
  height: 100vh;
58
58
  overflow: hidden;
59
59
  background-color: ${e=>e.theme.colors.grey4};
60
- `,Ga=G((function(e){const a=rn(e);return{vendorDetailView:dn(e),globalMerchantView:a}}),(function(e,a){const{navigate:s}=a;return{updateVendorDetailLocalData:t=>{e(ut({vendorDetails:t}))},fetchRecommendation:t=>{e(cn("tenant",t))},onSaveClick:()=>{e(ln())},onBackClick:()=>{s("../review")}}}))(Hn);function Wa(){const e=N();return o.jsx(Ga,{navigate:e})}const $a=B.div`
60
+ `,Wa=W((function(e){const a=rn(e);return{vendorDetailView:dn(e),globalMerchantView:a}}),(function(e,a){const{navigate:s}=a;return{updateVendorDetailLocalData:t=>{e(ut({vendorDetails:t}))},fetchRecommendation:t=>{e(cn("tenant",t))},onSaveClick:()=>{e(ln())},onBackClick:()=>{s("../review")}}}))(Hn);function $a(){const e=N();return o.jsx(Wa,{navigate:e})}const Ga=B.div`
61
61
  display: flex;
62
62
  min-height: 100%;
63
63
  width: 100%;
@@ -65,11 +65,11 @@ import{j as o}from"./liveblocks-BXyXenK7.js";import{a as u}from"./sentry-D4svnzx
65
65
  flex-direction: column;
66
66
  align-items: center;
67
67
  background-color: ${e=>e.theme.colors.grey4};
68
- `,za=G((function(e,a){const{vendorFirstReviewDetails:s}=a,t=e.globalMerchantAutoCompleteState.autoCompleteText,n=R.getSignedInUser(),i=e.tenantState.currentTenantId,l={userId:n?.userId??"",sessionId:n?.zeniSessionId??"",tenantId:i??""},p=U(e);return{vendorFirstReviewView:s,globalMerchantAutoCompleteData:{globalMerchantAutoCompleteView:s.globalMerchantAutoCompleteView,autoCompleteText:t},analytics:j,authParams:l,attachmentEndpoint:p.externalConnections?.accounting[0]?.connectionName==="netsuite"?`${ee}/vendor_attachments_accounting_provider`:`${ee}/vendor_attachments`}}),(function(e,a){const{navigate:s}=a;return{onFetchVendorReviewView:(t,n,i)=>{e(Ee(t,n,i))},onGlobalMerchantAutoCompleteInputChange:(t,n)=>{t.trim().length>=2?e(vn({searchString:t,globalMerchantType:n??"vendor"})):t.trim().length===0&&e(Je())},onUpdateLocalData:(t,n,i,l)=>{if(n!=null){const p=Ya(n);e(gn({vendorId:t,currentSelection:p,selectedGlobalMerchantId:i,vendorRenamedText:l}))}},onResetVendorLocalData:t=>{e(Sn({vendorId:t}))},onVendorNameClick:(t,n)=>{if(a.tenantEmailDomain!=null){const i=Oe(t,n,a.tenantEmailDomain),l=q(a.location.state?.pathnameStackToGoBack,a.location.pathname);a.navigate(i,{state:{pathnameStackToGoBack:l}})}},onUpdatePageToken:t=>{e(fn({pageToken:t}))},onUpdateSortUiState:(t,n)=>{e(mn({sortOrder:t,sortKey:n}))},onUpdateScrollYOffset:t=>{e(hn({scrollYOffset:t}))},onClickSave:(t,n,i)=>{e(pn(t,n,i))},onClickCancelPopup:()=>{e(un())},onClearGlobalMerchantAutoCompleteResults:()=>{e(Je())},onClickRedirectToQBO:()=>{window.open(`${Le.qboRedirectionUrl}/vendors`,"_blank")},updateVendorDetailLocalData:t=>{e(ut({vendorDetails:t})),s(`./vendor/${t.id}`)},onBackClick:()=>{s("../..")},onReloadList:()=>{e(Ee(null))}}}))(Qn);function Qe(){const e=N(),a=W(),s=K(),{tenantEmailDomain:t}=z(),n=ne(),i=R.getSignedInUser(),{vendorId:l}=z(),p=f((d=>Ye(d))),[h,v]=u.useState(!1),m=f((d=>Ye(d).fetchState));if(u.useEffect((()=>{m==="Not-Started"&&h===!1&&(a(Ee(null)),v(!0))}),[]),i==null)throw Error("Can't access first review page without signing in...");const r=d=>d.trackPageLoaded(Be.Event.vendorTenantReviewListPage);return o.jsxs(o.Fragment,{children:[m==="Completed"?o.jsx(Se,{analytics:j,onLoad:r}):null,o.jsx(Se,{analytics:j,onLoad:r}),o.jsx(ha,{isOpen:l!=null,drawerLeftMargin:new Ue(0,0,300,600),onClose:()=>{e("../review")},children:o.jsx(Ja,{onClick:d=>d.stopPropagation(),children:o.jsx(Wa,{})})}),o.jsx($a,{windowSize:n,children:o.jsx(za,{location:s,navigate:e,vendorFirstReviewDetails:p,tenantEmailDomain:t})})]})}const Ya=e=>e.recommendedFirst===!0?"recommendedFirst":e.recommendedSecond===!0?"recommendedSecond":e.retain===!0?"retain":e.rename===!0?"rename":e.customMerchant===!0?"customMerchant":null,Ja=B(St)`
68
+ `,za=W((function(e,a){const{vendorFirstReviewDetails:s}=a,t=e.globalMerchantAutoCompleteState.autoCompleteText,n=R.getSignedInUser(),i=e.tenantState.currentTenantId,l={userId:n?.userId??"",sessionId:n?.zeniSessionId??"",tenantId:i??""},p=U(e);return{vendorFirstReviewView:s,globalMerchantAutoCompleteData:{globalMerchantAutoCompleteView:s.globalMerchantAutoCompleteView,autoCompleteText:t},analytics:P,authParams:l,attachmentEndpoint:p.externalConnections?.accounting[0]?.connectionName==="netsuite"?`${ee}/vendor_attachments_accounting_provider`:`${ee}/vendor_attachments`}}),(function(e,a){const{navigate:s}=a;return{onFetchVendorReviewView:(t,n,i)=>{e(Ee(t,n,i))},onGlobalMerchantAutoCompleteInputChange:(t,n)=>{t.trim().length>=2?e(vn({searchString:t,globalMerchantType:n??"vendor"})):t.trim().length===0&&e(Je())},onUpdateLocalData:(t,n,i,l)=>{if(n!=null){const p=Ya(n);e(gn({vendorId:t,currentSelection:p,selectedGlobalMerchantId:i,vendorRenamedText:l}))}},onResetVendorLocalData:t=>{e(Sn({vendorId:t}))},onVendorNameClick:(t,n)=>{if(a.tenantEmailDomain!=null){const i=Oe(t,n,a.tenantEmailDomain),l=K(a.location.state?.pathnameStackToGoBack,a.location.pathname);a.navigate(i,{state:{pathnameStackToGoBack:l}})}},onUpdatePageToken:t=>{e(fn({pageToken:t}))},onUpdateSortUiState:(t,n)=>{e(mn({sortOrder:t,sortKey:n}))},onUpdateScrollYOffset:t=>{e(hn({scrollYOffset:t}))},onClickSave:(t,n,i)=>{e(pn(t,n,i))},onClickCancelPopup:()=>{e(un())},onClearGlobalMerchantAutoCompleteResults:()=>{e(Je())},onClickRedirectToQBO:()=>{window.open(`${Le.qboRedirectionUrl}/vendors`,"_blank")},updateVendorDetailLocalData:t=>{e(ut({vendorDetails:t})),s(`./vendor/${t.id}`)},onBackClick:()=>{s("../..")},onReloadList:()=>{e(Ee(null))}}}))(Qn);function Qe(){const e=N(),a=$(),s=q(),{tenantEmailDomain:t}=z(),n=ne(),i=R.getSignedInUser(),{vendorId:l}=z(),p=f((d=>Ye(d))),[h,v]=u.useState(!1),m=f((d=>Ye(d).fetchState));if(u.useEffect((()=>{m==="Not-Started"&&h===!1&&(a(Ee(null)),v(!0))}),[]),i==null)throw Error("Can't access first review page without signing in...");const r=d=>d.trackPageLoaded(Be.Event.vendorTenantReviewListPage);return o.jsxs(o.Fragment,{children:[m==="Completed"?o.jsx(Se,{analytics:P,onLoad:r}):null,o.jsx(Se,{analytics:P,onLoad:r}),o.jsx(ha,{isOpen:l!=null,drawerLeftMargin:new Ue(0,0,300,600),onClose:()=>{e("../review")},children:o.jsx(Ja,{onClick:d=>d.stopPropagation(),children:o.jsx($a,{})})}),o.jsx(Ga,{windowSize:n,children:o.jsx(za,{location:s,navigate:e,vendorFirstReviewDetails:p,tenantEmailDomain:t})})]})}const Ya=e=>e.recommendedFirst===!0?"recommendedFirst":e.recommendedSecond===!0?"recommendedSecond":e.retain===!0?"retain":e.rename===!0?"rename":e.customMerchant===!0?"customMerchant":null,Ja=B(St)`
69
69
  display: flex;
70
70
  min-height: 100%;
71
71
  flex-direction: column;
72
- `,qa=G((function(e,a){const s=R.getSignedInUser(),t=e.tenantState.currentTenantId,n=e.vendorFiling1099UploadDetailsState,i={userId:s?.userId??"",sessionId:s?.zeniSessionId??"",tenantId:t??""};let l={fetchState:"Not-Started",error:void 0};return a.vendorId!=null&&(l=e.vendorViewState.editVendorStateById[a.vendorId]?.fetchStatus),{analytics:j,vendorFiling1099UploadDetailsViewState:n,authParams:i,googleAPIKey:Le.googleMapsAPIKey,vendorId:a.vendorId,fetchVendorFetchStatus:l,vendor:a.vendorFiling1099UploadDetails?.vendor}}),(function(e,a){const{currentTenant:s,navigate:t,location:n,vendorId:i,vendorFiling1099UploadDetails:l}=a,{tenantEmailDomain:p}=s;return{onVendorFiling1099UploadDetailsSave:h=>{e(lt(h)),j.trackVendor1099DetailSave(l.vendor.legalName??"")},onSaveChangesToLocalStore:h=>{e(dt(h))},onResetVendorFiling1099FormStatus:()=>{e(xn())},onAddressEditHandler:h=>{const v=aa((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(ct({addressType:"vendor_address",addressToCreate:v}))},goBackToListPage:()=>{e(rt(i));const h=`/${p}/vendors/filing_1099/`,v=q(n.state?.pathnameStackToGoBack,n.pathname);t(h,{state:{pathnameStackToGoBack:v}})},onAddressClick:h=>{const v=(function(r,d,c){let x=`/${r}/vendors/filing_1099/upload/${c}/edit`;return x=x.concat(`/new/${d}`),x})(p,h,i),m=q(n.state?.pathnameStackToGoBack,n.pathname);t(v,{state:{pathnameStackToGoBack:m}})},AddressFormPage:Xn}}))(Zn);function Ka(){const e=N(),a=K(),{vendorId:s}=z(),t=f((p=>U(p)));let n;if(s==null)throw new Error("Vendor ID not found for Vendor Filing 1099 Details Screen");n=f((p=>it(p,s)));const{tenantEmailDomain:i}=t,l=t.companyId??R.getSignedInUserTenant(i)?.companyId;if(l==null)throw new Error("Company ID not found for Vendor Filing 1099 Details Screen");return o.jsx(qa,{location:a,navigate:e,currentTenant:t,vendorId:s,vendorFiling1099UploadDetails:n,companyId:l})}const Ha=B.div`
72
+ `,Ka=W((function(e,a){const s=R.getSignedInUser(),t=e.tenantState.currentTenantId,n=e.vendorFiling1099UploadDetailsState,i={userId:s?.userId??"",sessionId:s?.zeniSessionId??"",tenantId:t??""};let l={fetchState:"Not-Started",error:void 0};return a.vendorId!=null&&(l=e.vendorViewState.editVendorStateById[a.vendorId]?.fetchStatus),{analytics:P,vendorFiling1099UploadDetailsViewState:n,authParams:i,googleAPIKey:Le.googleMapsAPIKey,vendorId:a.vendorId,fetchVendorFetchStatus:l,vendor:a.vendorFiling1099UploadDetails?.vendor}}),(function(e,a){const{currentTenant:s,navigate:t,location:n,vendorId:i,vendorFiling1099UploadDetails:l}=a,{tenantEmailDomain:p}=s;return{onVendorFiling1099UploadDetailsSave:h=>{e(lt(h)),P.trackVendor1099DetailSave(l.vendor.legalName??"")},onSaveChangesToLocalStore:h=>{e(dt(h))},onResetVendorFiling1099FormStatus:()=>{e(xn())},onAddressEditHandler:h=>{const v=aa((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(ct({addressType:"vendor_address",addressToCreate:v}))},goBackToListPage:()=>{e(rt(i));const h=`/${p}/vendors/filing_1099/`,v=K(n.state?.pathnameStackToGoBack,n.pathname);t(h,{state:{pathnameStackToGoBack:v}})},onAddressClick:h=>{const v=(function(r,d,c){let x=`/${r}/vendors/filing_1099/upload/${c}/edit`;return x=x.concat(`/new/${d}`),x})(p,h,i),m=K(n.state?.pathnameStackToGoBack,n.pathname);t(v,{state:{pathnameStackToGoBack:m}})},AddressFormPage:Xn}}))(Zn);function qa(){const e=N(),a=q(),{vendorId:s}=z(),t=f((p=>U(p)));let n;if(s==null)throw new Error("Vendor ID not found for Vendor Filing 1099 Details Screen");n=f((p=>it(p,s)));const{tenantEmailDomain:i}=t,l=t.companyId??R.getSignedInUserTenant(i)?.companyId;if(l==null)throw new Error("Company ID not found for Vendor Filing 1099 Details Screen");return o.jsx(Ka,{location:a,navigate:e,currentTenant:t,vendorId:s,vendorFiling1099UploadDetails:n,companyId:l})}const Ha=B.div`
73
73
  display: flex;
74
74
  min-height: 100%;
75
75
  width: 100%;
@@ -77,7 +77,7 @@ import{j as o}from"./liveblocks-BXyXenK7.js";import{a as u}from"./sentry-D4svnzx
77
77
  flex-direction: column;
78
78
  align-items: center;
79
79
  background-color: ${e=>e.theme.colors.grey4};
80
- `,Qa=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,i)=>{e(En({sortOrder:n,sortKey:i}))},onUpdateSearchUiState:n=>{e(Dn({searchString:n}))},onVendorRowClick:n=>{if(a.tenantEmailDomain!=null){const i=`/${a.tenantEmailDomain}/vendors/filing_1099/upload/${encodeURIComponent(n)}/edit`,l=q(a.location.state?.pathnameStackToGoBack,a.location.pathname);a.navigate(i,{state:{pathnameStackToGoBack:l}})}},onReloadVendors:()=>{e(Fe(!0))},onBackClick:()=>{e(In()),e(Cn())},onVendorTabSelectionChanged:n=>{const i=de(n);s(i),e(te(le(n)))},onAccountMappingChange:n=>{const{filing1099:i}=n,{bankAccount:l,expenseCategory1099:p}=i,h=ma(a.accountMappingView.bankAccounts1099FilingAccountList,l.selectedOptions),v=fa(a.accountMappingView.expenseAccounts1099FilingAccountList,p),m={selectedBankAccounts1099FilingAccountIds:h.map((r=>r.accountId)),selectedExpenseAccounts1099FilingAccountIds:v};e(wn({data:m}))},onSaveClick:()=>{e(yn()),t.track(Be.Event.vendor1099TabSettingsSave)}}}))(ea);function Ze({vendorTabsToShow:e,previousTabPosition:a,setPreviousTabPosition:s}){const t=N(),n=W(),i=K(),{tenantEmailDomain:l}=z(),p=ne(),h=R.getSignedInUser(),[v,m]=u.useState(!1),[r,d]=u.useState(!1);if(h==null)throw Error("Can't access vendor filing 1099 page without signing in...");ce();const c=f((C=>Tn(C))),x=f((C=>bn(C))),{isAiCfoAccessEnabled:T,onAskAiCfoClick:g}=ie({mobileExploreReferrer:"Vendors — 1099"});se({isDataReady:c.fetchState==="Completed"}),u.useEffect((()=>{r||(d(!0),n(Fe(!1)))}),[r,d]),u.useEffect((()=>{x.saveState.fetchState==="Completed"&&n(Fe(!1))}),[x.saveState.fetchState]);const y=C=>{m(C)},b=f((C=>U(C))),I={userId:h?.userId??"",sessionId:h?.zeniSessionId??"",tenantId:b.tenantId},E=u.useMemo((()=>({authParams:I,tenantName:b.companyName,filing1099ReportEndPoint:`${ee}/filing1099Reports`})),[]);return o.jsxs(o.Fragment,{children:[c.fetchState==="Completed"?o.jsx(o.Fragment,{children:o.jsx(Se,{analytics:j,onLoad:()=>j.trackPageLoaded(Be.Event.vendor1099ListPage)})}):null,o.jsxs(Ha,{windowSize:p,children:[o.jsx(re,{isAppContentDrawerOpen:v,handleDrawerToggle:y}),o.jsx(Qa,{location:i,navigate:t,previousTabPosition:a,setPreviousTabPosition:s,analytics:j,vendorsFiling1099ListDetails:c,vendorTypeList:c.vendorTypeList,accountMappingView:x,downloadParams:E,tenantEmailDomain:l,vendorTabsToShow:e,isAiCfoAccessEnabled:T,onAskAiCfoClick:g,onClickMenuIcon:()=>{y(!0)}})]})]})}const Za=B.div`
80
+ `,Qa=W((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,i)=>{e(En({sortOrder:n,sortKey:i}))},onUpdateSearchUiState:n=>{e(Dn({searchString:n}))},onVendorRowClick:n=>{if(a.tenantEmailDomain!=null){const i=`/${a.tenantEmailDomain}/vendors/filing_1099/upload/${encodeURIComponent(n)}/edit`,l=K(a.location.state?.pathnameStackToGoBack,a.location.pathname);a.navigate(i,{state:{pathnameStackToGoBack:l}})}},onReloadVendors:()=>{e(Fe(!0))},onBackClick:()=>{e(In()),e(Cn())},onVendorTabSelectionChanged:n=>{const i=de(n);s(i),e(te(le(n)))},onAccountMappingChange:n=>{const{filing1099:i}=n,{bankAccount:l,expenseCategory1099:p}=i,h=ma(a.accountMappingView.bankAccounts1099FilingAccountList,l.selectedOptions),v=fa(a.accountMappingView.expenseAccounts1099FilingAccountList,p),m={selectedBankAccounts1099FilingAccountIds:h.map((r=>r.accountId)),selectedExpenseAccounts1099FilingAccountIds:v};e(wn({data:m}))},onSaveClick:()=>{e(yn()),t.track(Be.Event.vendor1099TabSettingsSave)}}}))(ea);function Ze({vendorTabsToShow:e,previousTabPosition:a,setPreviousTabPosition:s}){const t=N(),n=$(),i=q(),{tenantEmailDomain:l}=z(),p=ne(),h=R.getSignedInUser(),[v,m]=u.useState(!1),[r,d]=u.useState(!1);if(h==null)throw Error("Can't access vendor filing 1099 page without signing in...");ce();const c=f((C=>Tn(C))),x=f((C=>bn(C))),{isAiCfoAccessEnabled:T,onAskAiCfoClick:g}=ie({mobileExploreReferrer:"Vendors — 1099"});se({isDataReady:c.fetchState==="Completed"}),u.useEffect((()=>{r||(d(!0),n(Fe(!1)))}),[r,d]),u.useEffect((()=>{x.saveState.fetchState==="Completed"&&n(Fe(!1))}),[x.saveState.fetchState]);const y=C=>{m(C)},b=f((C=>U(C))),I={userId:h?.userId??"",sessionId:h?.zeniSessionId??"",tenantId:b.tenantId},E=u.useMemo((()=>({authParams:I,tenantName:b.companyName,filing1099ReportEndPoint:`${ee}/filing1099Reports`})),[]);return o.jsxs(o.Fragment,{children:[c.fetchState==="Completed"?o.jsx(o.Fragment,{children:o.jsx(Se,{analytics:P,onLoad:()=>P.trackPageLoaded(Be.Event.vendor1099ListPage)})}):null,o.jsxs(Ha,{windowSize:p,children:[o.jsx(re,{isAppContentDrawerOpen:v,handleDrawerToggle:y}),o.jsx(Qa,{location:i,navigate:t,previousTabPosition:a,setPreviousTabPosition:s,analytics:P,vendorsFiling1099ListDetails:c,vendorTypeList:c.vendorTypeList,accountMappingView:x,downloadParams:E,tenantEmailDomain:l,vendorTabsToShow:e,isAiCfoAccessEnabled:T,onAskAiCfoClick:g,onClickMenuIcon:()=>{y(!0)}})]})]})}const Za=B.div`
81
81
  display: flex;
82
82
  min-height: 100%;
83
83
  width: 100%;
@@ -85,4 +85,4 @@ import{j as o}from"./liveblocks-BXyXenK7.js";import{a as u}from"./sentry-D4svnzx
85
85
  flex-direction: column;
86
86
  align-items: center;
87
87
  background-color: ${e=>e.theme.colors.grey4};
88
- `,Xa=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:me(e),analytics:j}}),(function(e,a){const{navigate:s}=a;return{onFetchVendorsList:(t="",n,i)=>{e(_n({searchString:t,keepExistingListItems:n,view:"vendorsTab",pageToken:i}))},onUpdatePageToken:t=>{e(Pn({pageToken:t}))},onUpdateSortUiState:(t,n)=>{e(jn({sortOrder:t,sortkey:n}))},onUpdateCurrentYTDSelection:t=>{e(Vn({ytdSpendSelection:t}))},onVendorRowClick:(t,n)=>{if(a.tenantEmailDomain!=null){const i=Oe(t,n,a.tenantEmailDomain),l=q(a.location.state?.pathnameStackToGoBack,a.location.pathname);a.navigate(i,{state:{pathnameStackToGoBack:l,referrer:"Vendor List"}})}},onReloadVendors:()=>{console.log("Reload vendors")},onUpdateScrollYOffset:t=>{e(kn({scrollYOffset:t}))},onBackClick:()=>{s("../..")},onVendorTabSelectionChanged:t=>{const n=de(t);s(n),e(te(le(t)))}}}))(ta);function eo({vendorTabsToShow:e,previousTabPosition:a,setPreviousTabPosition:s}){const t=N(),n=W(),i=K(),{tenantEmailDomain:l}=z(),p=ne(),h=R.getSignedInUser(),{useFeatureGate:v}=H(),{isFeatureEnabled:m,isFeatureGateLoading:r}=v(M.isOpexByVendorFeatureEnabled);ce();const d=e.includes("prepaid_expenses"),c=e.includes("fixed_assets"),x=e.includes("accrued_expenses"),T=f((k=>oe(k)));let g={};g=f((k=>Fn(k,"vendorsTab")));const[y,b]=u.useState(!1),{isAiCfoAccessEnabled:I,onAskAiCfoClick:E}=ie({mobileExploreReferrer:"Vendors Summary"});se({isDataReady:g.fetchState==="Completed"});const C=f((k=>ue(k))),w=f((k=>Y(k).isReportGenerated));f((k=>Y(k).fetchState))==="Completed"&&w&&m&&!e.includes("operating_expenses_by_vendor")&&e.splice(1,0,"operating_expenses_by_vendor");const[A,P]=u.useState(!1);if(u.useEffect((()=>{(d||c)&&A===!1&&C!=="Completed"&&(n(pe()),P(!0))}),[A]),u.useEffect((()=>{n(he({shouldFetchAccruedExpenses:x,shouldFetchFixedAssets:c,shouldFetchPrepaidExpenses:d,shouldFetchOpexByVendor:m&&r===!1,shouldFetchVendorsList:!0,shouldFetchFiling1099Vendor:!1}))}),[C,c,r,m]),u.useEffect((()=>{y||g.fetchState!=="Completed"||(b(!0),j.trackVendorList(T.currentTab,T.previousTab??null,g.totalVendorCount,g.uiState.sortKey,g.uiState.ytdSpendSelection))}),[g.fetchState]),h==null)throw Error("Can't access address page without signing in...");const[O,F]=u.useState(!1),D=k=>{F(k)};return o.jsxs(Za,{windowSize:p,children:[o.jsx(re,{isAppContentDrawerOpen:O,handleDrawerToggle:D}),o.jsx(Xa,{location:i,navigate:t,vendorsListDetails:g,tenantEmailDomain:l,vendorTabsToShow:e,onClickMenuIcon:()=>{D(!0)},previousTabPosition:a,setPreviousTabPosition:s,isAiCfoAccessEnabled:I,onAskAiCfoClick:E})]})}function ko(){const{useFeatureGate:e}=H(),a=K().state?.referrer,[s,t]=u.useState(!1),[n,i]=u.useState(0),l=R.getSignedInUser(),p=An(l),{isFeatureEnabled:h}=e(M.isOpexByVendorFeatureEnabled),{isFeatureEnabled:v}=e(M.isVendorReviewFeatureEnabled),{isFeatureEnabled:m}=e(M.isScheduledJEPrepaidExpensesFeatureEnabled),{isFeatureEnabled:r}=e(M.isScheduledJEFixedAssetsFeatureEnabled),{isFeatureEnabled:d}=e(M.isScheduledJEAccruedExpensesFeatureEnabled),{isFeatureEnabled:c}=e(M.isFiling1099FeatureEnabled),x=f((E=>U(E))),T=x?.externalConnections?.accounting[0]?.connectionName,g=["vendors_tab"];T!=="netsuite"&&m===!0&&g.push("prepaid_expenses"),T!=="netsuite"&&r===!0&&g.push("fixed_assets"),T!=="netsuite"&&d===!0&&g.push("accrued_expenses"),T!=="netsuite"&&c&&p&&(g.push("filing_1099"),h&&g.splice(1,0,"operating_expenses_by_vendor"));const{isFeatureEnabled:y}=e(M.isDebitCardFeatureEnabled),b=Rn(y,x),I=Un(x);return b===!0||I===!0?o.jsx(Me,{children:o.jsx(V,{path:"/*",element:o.jsx(sa,{})})}):o.jsxs(Me,{children:[o.jsx(V,{path:"/opex",element:h===!0?o.jsx(Da,{previousTabPosition:n,setPreviousTabPosition:i,vendorTabsToShow:g}):o.jsx(L,{to:"../summary"})}),o.jsx(V,{path:"/summary",element:o.jsx(eo,{previousTabPosition:n,setPreviousTabPosition:i,vendorTabsToShow:g})}),o.jsx(V,{path:"schedules/fixed_assets/details/:scheduleDetailId",element:r===!0?o.jsx(ia,{}):o.jsx(L,{to:"../../vendors/opex"})}),o.jsx(V,{path:"schedules/accrued_expenses/details/:scheduleDetailId",element:r===!0?o.jsx(ra,{shouldNavigateBack:s,setShouldNavigateBack:t}):o.jsx(L,{to:"../../vendors/opex"})}),o.jsx(V,{path:"schedules/one_time_accrual/details/:accrualId",element:d===!0?o.jsx(da,{}):o.jsx(L,{to:"../../vendors/opex"})}),o.jsx(V,{path:"schedules/:scheduleType/details/:scheduleDetailId",element:m===!0?o.jsx(la,{}):o.jsx(L,{to:"../../vendors/opex"})}),o.jsx(V,{path:"schedules/:scheduleType/details/:scheduleDetailId/edit_link",element:m===!0||r===!0?o.jsx(va,{}):o.jsx(L,{to:"../../vendors/opex"})}),o.jsx(V,{path:"schedules/accrued_expenses/details/:scheduleDetailId/edit_link",element:d===!0?o.jsx(ca,{setShouldNavigateBack:t}):o.jsx(L,{to:"../../vendors/opex"})}),o.jsx(V,{path:"schedules/prepaid_expenses",element:m===!0?o.jsx(Fa,{previousTabPosition:n,setPreviousTabPosition:i,vendorTabsToShow:g}):o.jsx(L,{to:"../opex"})}),o.jsx(V,{path:"schedules/fixed_assets",element:r===!0?o.jsx(wa,{previousTabPosition:n,setPreviousTabPosition:i,vendorTabsToShow:g}):o.jsx(L,{to:"../opex"})}),o.jsx(V,{path:"schedules/accrued_expenses",element:d===!0?o.jsx(ba,{previousTabPosition:n,setPreviousTabPosition:i,vendorTabsToShow:g}):o.jsx(L,{to:"../opex"})}),o.jsx(V,{path:"/filing_1099",element:c&&p?o.jsx(Ze,{previousTabPosition:n,setPreviousTabPosition:i,vendorTabsToShow:g}):o.jsx(L,{to:"../opex"})}),o.jsx(V,{path:"/filing_1099/:vendorId",element:c&&p?o.jsx(Ze,{vendorTabsToShow:g,previousTabPosition:n,setPreviousTabPosition:i}):o.jsx(L,{to:"../opex"})}),o.jsx(V,{path:"/filing_1099/upload/:vendorId/edit",element:c&&p?o.jsx(He,{appContent:o.jsx(Ka,{}),showFullScreenSkeletonWhileLoading:!0}):o.jsx(L,{to:"../opex"})}),o.jsx(V,{path:"/filing_1099/upload/:vendorId/edit/new/:addressType",element:c&&p?o.jsx(He,{appContent:o.jsx(oa,{isSubPage:!0,hideAddressBackButton:!0,hideAddressSubTitle:!0})}):o.jsx(L,{to:"../opex"})}),o.jsx(V,{path:"/summary/:vendorId/:qboId",element:o.jsx(Ke,{referrerType:a,isFiling1099FeatureEnabled:c&&p})}),o.jsx(V,{path:"/summary/:vendorId/:qboId/:timeframe/:startDate/:endDate",element:o.jsx(Ke,{referrerType:a,isFiling1099FeatureEnabled:c&&p})}),o.jsx(V,{path:"/review",element:v===!0?o.jsx(Qe,{}):o.jsx(fe,{})}),o.jsx(V,{path:"/review/vendor/:vendorId",element:v?o.jsx(Qe,{}):o.jsx(fe,{})}),o.jsx(V,{path:"/",element:o.jsx(L,{to:"summary"})}),o.jsx(V,{path:"*",element:o.jsx(fe,{})})]})}export{ko as default};
88
+ `,Xa=W((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:me(e),analytics:P}}),(function(e,a){const{navigate:s}=a;return{onFetchVendorsList:(t="",n,i)=>{e(_n({searchString:t,keepExistingListItems:n,view:"vendorsTab",pageToken:i}))},onUpdatePageToken:t=>{e(jn({pageToken:t}))},onUpdateSortUiState:(t,n)=>{e(Pn({sortOrder:t,sortkey:n}))},onUpdateCurrentYTDSelection:t=>{e(Vn({ytdSpendSelection:t}))},onVendorRowClick:(t,n)=>{if(a.tenantEmailDomain!=null){const i=Oe(t,n,a.tenantEmailDomain),l=K(a.location.state?.pathnameStackToGoBack,a.location.pathname);a.navigate(i,{state:{pathnameStackToGoBack:l,referrer:"Vendor List"}})}},onReloadVendors:()=>{console.log("Reload vendors")},onUpdateScrollYOffset:t=>{e(kn({scrollYOffset:t}))},onBackClick:()=>{s("../..")},onVendorTabSelectionChanged:t=>{const n=de(t);s(n),e(te(le(t)))}}}))(ta);function eo({vendorTabsToShow:e,previousTabPosition:a,setPreviousTabPosition:s}){const t=N(),n=$(),i=q(),{tenantEmailDomain:l}=z(),p=ne(),h=R.getSignedInUser(),{useFeatureGate:v}=H(),{isFeatureEnabled:m,isFeatureGateLoading:r}=v(M.isOpexByVendorFeatureEnabled);ce();const d=e.includes("prepaid_expenses"),c=e.includes("fixed_assets"),x=e.includes("accrued_expenses"),T=f((k=>oe(k)));let g={};g=f((k=>Fn(k,"vendorsTab")));const[y,b]=u.useState(!1),{isAiCfoAccessEnabled:I,onAskAiCfoClick:E}=ie({mobileExploreReferrer:"Vendors Summary"});se({isDataReady:g.fetchState==="Completed"});const C=f((k=>ue(k))),w=f((k=>Y(k).isReportGenerated));f((k=>Y(k).fetchState))==="Completed"&&w&&m&&!e.includes("operating_expenses_by_vendor")&&e.splice(1,0,"operating_expenses_by_vendor");const[A,j]=u.useState(!1);if(u.useEffect((()=>{(d||c)&&A===!1&&C!=="Completed"&&(n(pe()),j(!0))}),[A]),u.useEffect((()=>{n(he({shouldFetchAccruedExpenses:x,shouldFetchFixedAssets:c,shouldFetchPrepaidExpenses:d,shouldFetchOpexByVendor:m&&r===!1,shouldFetchVendorsList:!0,shouldFetchFiling1099Vendor:!1}))}),[C,c,r,m]),u.useEffect((()=>{y||g.fetchState!=="Completed"||(b(!0),P.trackVendorList(T.currentTab,T.previousTab??null,g.totalVendorCount,g.uiState.sortKey,g.uiState.ytdSpendSelection))}),[g.fetchState]),h==null)throw Error("Can't access address page without signing in...");const[O,F]=u.useState(!1),D=k=>{F(k)};return o.jsxs(Za,{windowSize:p,children:[o.jsx(re,{isAppContentDrawerOpen:O,handleDrawerToggle:D}),o.jsx(Xa,{location:i,navigate:t,vendorsListDetails:g,tenantEmailDomain:l,vendorTabsToShow:e,onClickMenuIcon:()=>{D(!0)},previousTabPosition:a,setPreviousTabPosition:s,isAiCfoAccessEnabled:I,onAskAiCfoClick:E})]})}function ko(){const{useFeatureGate:e}=H(),a=q().state?.referrer,[s,t]=u.useState(!1),[n,i]=u.useState(0),l=R.getSignedInUser(),p=An(l),{isFeatureEnabled:h}=e(M.isOpexByVendorFeatureEnabled),{isFeatureEnabled:v}=e(M.isVendorReviewFeatureEnabled),{isFeatureEnabled:m}=e(M.isScheduledJEPrepaidExpensesFeatureEnabled),{isFeatureEnabled:r}=e(M.isScheduledJEFixedAssetsFeatureEnabled),{isFeatureEnabled:d}=e(M.isScheduledJEAccruedExpensesFeatureEnabled),{isFeatureEnabled:c}=e(M.isFiling1099FeatureEnabled),x=f((E=>U(E))),T=x?.externalConnections?.accounting[0]?.connectionName,g=["vendors_tab"];T!=="netsuite"&&m===!0&&g.push("prepaid_expenses"),T!=="netsuite"&&r===!0&&g.push("fixed_assets"),T!=="netsuite"&&d===!0&&g.push("accrued_expenses"),T!=="netsuite"&&c&&p&&(g.push("filing_1099"),h&&g.splice(1,0,"operating_expenses_by_vendor"));const{isFeatureEnabled:y}=e(M.isDebitCardFeatureEnabled),b=Rn(y,x),I=Un(x);return b===!0||I===!0?o.jsx(Me,{children:o.jsx(V,{path:"/*",element:o.jsx(sa,{})})}):o.jsxs(Me,{children:[o.jsx(V,{path:"/opex",element:h===!0?o.jsx(Da,{previousTabPosition:n,setPreviousTabPosition:i,vendorTabsToShow:g}):o.jsx(L,{to:"../summary"})}),o.jsx(V,{path:"/summary",element:o.jsx(eo,{previousTabPosition:n,setPreviousTabPosition:i,vendorTabsToShow:g})}),o.jsx(V,{path:"schedules/fixed_assets/details/:scheduleDetailId",element:r===!0?o.jsx(ia,{}):o.jsx(L,{to:"../../vendors/opex"})}),o.jsx(V,{path:"schedules/accrued_expenses/details/:scheduleDetailId",element:r===!0?o.jsx(ra,{shouldNavigateBack:s,setShouldNavigateBack:t}):o.jsx(L,{to:"../../vendors/opex"})}),o.jsx(V,{path:"schedules/one_time_accrual/details/:accrualId",element:d===!0?o.jsx(da,{}):o.jsx(L,{to:"../../vendors/opex"})}),o.jsx(V,{path:"schedules/:scheduleType/details/:scheduleDetailId",element:m===!0?o.jsx(la,{}):o.jsx(L,{to:"../../vendors/opex"})}),o.jsx(V,{path:"schedules/:scheduleType/details/:scheduleDetailId/edit_link",element:m===!0||r===!0?o.jsx(va,{}):o.jsx(L,{to:"../../vendors/opex"})}),o.jsx(V,{path:"schedules/accrued_expenses/details/:scheduleDetailId/edit_link",element:d===!0?o.jsx(ca,{setShouldNavigateBack:t}):o.jsx(L,{to:"../../vendors/opex"})}),o.jsx(V,{path:"schedules/prepaid_expenses",element:m===!0?o.jsx(Fa,{previousTabPosition:n,setPreviousTabPosition:i,vendorTabsToShow:g}):o.jsx(L,{to:"../opex"})}),o.jsx(V,{path:"schedules/fixed_assets",element:r===!0?o.jsx(wa,{previousTabPosition:n,setPreviousTabPosition:i,vendorTabsToShow:g}):o.jsx(L,{to:"../opex"})}),o.jsx(V,{path:"schedules/accrued_expenses",element:d===!0?o.jsx(ba,{previousTabPosition:n,setPreviousTabPosition:i,vendorTabsToShow:g}):o.jsx(L,{to:"../opex"})}),o.jsx(V,{path:"/filing_1099",element:c&&p?o.jsx(Ze,{previousTabPosition:n,setPreviousTabPosition:i,vendorTabsToShow:g}):o.jsx(L,{to:"../opex"})}),o.jsx(V,{path:"/filing_1099/:vendorId",element:c&&p?o.jsx(Ze,{vendorTabsToShow:g,previousTabPosition:n,setPreviousTabPosition:i}):o.jsx(L,{to:"../opex"})}),o.jsx(V,{path:"/filing_1099/upload/:vendorId/edit",element:c&&p?o.jsx(He,{appContent:o.jsx(qa,{}),showFullScreenSkeletonWhileLoading:!0}):o.jsx(L,{to:"../opex"})}),o.jsx(V,{path:"/filing_1099/upload/:vendorId/edit/new/:addressType",element:c&&p?o.jsx(He,{appContent:o.jsx(oa,{isSubPage:!0,hideAddressBackButton:!0,hideAddressSubTitle:!0})}):o.jsx(L,{to:"../opex"})}),o.jsx(V,{path:"/summary/:vendorId/:qboId",element:o.jsx(qe,{referrerType:a,isFiling1099FeatureEnabled:c&&p})}),o.jsx(V,{path:"/summary/:vendorId/:qboId/:timeframe/:startDate/:endDate",element:o.jsx(qe,{referrerType:a,isFiling1099FeatureEnabled:c&&p})}),o.jsx(V,{path:"/review",element:v===!0?o.jsx(Qe,{}):o.jsx(fe,{})}),o.jsx(V,{path:"/review/vendor/:vendorId",element:v?o.jsx(Qe,{}):o.jsx(fe,{})}),o.jsx(V,{path:"/",element:o.jsx(L,{to:"summary"})}),o.jsx(V,{path:"*",element:o.jsx(fe,{})})]})}export{ko as default};
@@ -0,0 +1,12 @@
1
+ import{j as o}from"./liveblocks-CW9yScMF.js";import{a as c}from"./sentry-C_uJQK1a.js";import{t as u,u as h,j as y,N as b}from"./core-BI5oX4mx.js";import{Um as I,gi as w,Jp as j}from"./zeni-epic-state-CIizsNeB.js";import{z as f,a7 as x,af as S,ag as D}from"./index-C2L5Bzwa.js";import{n as l}from"./mui-KP5Ep0NX.js";import"./recharts-DRl2ZsSW.js";import"./analytics-5LJ4BXQX.js";import"./plaid-BrgJMdej.js";import"./dnd-D6wtGmk9.js";import"./stripe-cKAAJElX.js";import"./lottie-lQbJqTc2.js";import"./lexical-BLu7UAko.js";import"./pdf-DflcYtDk.js";import"./utils-BzQpFQvw.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]="771620ac-060e-4e8c-b021-b565d06c67c3",e._sentryDebugIdIdentifier="sentry-dbid-771620ac-060e-4e8c-b021-b565d06c67c3")}catch{}})();const B=()=>{const[e]=u(),t=e.get("code")??"",i=e.get("state")??"",g=e.get("profileId")??"",[n,p]=c.useState(!1),a=h(),s=y((m=>I(m))),r=f.getSignedInUser(),d=f.getSignedInUserTenantWithId(i);if(r==null||d==null)return o.jsx(b,{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),c.useEffect((()=>{n||(p(!0),a(j(t,g,i)))}),[n,a]),s.fetchState==="Error"?o.jsx(E,{children:o.jsx(_,{children:s.error?.message??""})}):(s.fetchState==="Completed"&&window.close(),o.jsx(x,{fetchState:"In-Progress"}))},E=l.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
+ `,_=l(D.LargeRegular)`
10
+ display: flex;
11
+ color: ${S.important};
12
+ `;export{B as default};