@zeniai/web-app-ui 5.3.26-qa → 5.3.27-dev

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (150) hide show
  1. package/dist/assets/AccountMappingScreen-DaqZZA1y.js +9 -0
  2. package/dist/assets/AddressRoutes--CFKCkaL.js +1 -0
  3. package/dist/assets/AddressScreen-Dqyvg_DE.js +9 -0
  4. package/dist/assets/AiCfoScreen-Fn3zvhfE.js +22 -0
  5. package/dist/assets/AppDrawer-D0bkqw7G.js +10 -0
  6. package/dist/assets/{BillPayApprovalRoutes-BWcKljpL.js → BillPayApprovalRoutes-eILGhkg-.js} +1 -1
  7. package/dist/assets/{BillPayRoutes-DxfZSGDE.js → BillPayRoutes-37ip4fRF.js} +18 -18
  8. package/dist/assets/{BusinessVerificationPageScreen-BnngOdPs.js → BusinessVerificationPageScreen-BBPD780e.js} +2 -2
  9. package/dist/assets/{CardsAiCfoScreen-C9jErKn4.js → CardsAiCfoScreen-Baf8zOAK.js} +1 -1
  10. package/dist/assets/{ChargeCardRoutes-CpllRZ3I.js → ChargeCardRoutes-DmeZJCQT.js} +8 -8
  11. package/dist/assets/CompanyPassportScreen-C_pRUVln.js +1 -0
  12. package/dist/assets/ConnectionAuthScreen-CUo0NJEq.js +11 -0
  13. package/dist/assets/CustomerOnboardingAuthScreen-Bwf9kXMI.js +1 -0
  14. package/dist/assets/{CustomerOnboardingRoutes-C4NalCKf.js → CustomerOnboardingRoutes-BLu4eEKn.js} +5 -5
  15. package/dist/assets/{DashboardRoutes-BYYgNdD2.js → DashboardRoutes-ORzWlYnm.js} +4 -4
  16. package/dist/assets/{DefaultTenantHome-C6nJD7za.js → DefaultTenantHome-i-6bhA98.js} +1 -1
  17. package/dist/assets/DomesticWireDetailScreen-CyLkyrfk.js +18 -0
  18. package/dist/assets/DrawerScreen-BUgCVChB.js +1 -0
  19. package/dist/assets/EntityDetailRoutes-D9J_IXUi.js +1 -0
  20. package/dist/assets/{ExpenseAutomationRoutes-8pbTDpsO.js → ExpenseAutomationRoutes-CsGdQ1mY.js} +4 -4
  21. package/dist/assets/FeaturePreviewScreen-Crks8H4y.js +1 -0
  22. package/dist/assets/HubSpotOAuthCallbackScreen-BtM4S0nt.js +1 -0
  23. package/dist/assets/{InboxNotificationsProvider-yp4VlF4V.js → InboxNotificationsProvider-CzhxlkVm.js} +1 -1
  24. package/dist/assets/{InvoicingRoutes-D5cSux-9.js → InvoicingRoutes-BkqhDwSy.js} +2 -2
  25. package/dist/assets/{MagicLinkRoutes-rwao6E2u.js → MagicLinkRoutes-D5MiWWQ9.js} +10 -10
  26. package/dist/assets/MagicLinkSignInScreen-DW04FMtl.js +12 -0
  27. package/dist/assets/MobileAppDrawer-CmjsL1eQ.js +1 -0
  28. package/dist/assets/NotFoundScreen-BPjOFceW.js +1 -0
  29. package/dist/assets/NotificationRoutes-B9_H_iqh.js +1 -0
  30. package/dist/assets/OAuthConsentScreen-4cOTWmRk.js +1 -0
  31. package/dist/assets/PandLWithForecastRoutes-FasScyWQ.js +1 -0
  32. package/dist/assets/{PaymentLinkScreen-CxAwIeqN.js → PaymentLinkScreen-B7dK2OwX.js} +5 -5
  33. package/dist/assets/PeopleRoutes-CfXWqRXn.js +22 -0
  34. package/dist/assets/PerformanceRoutes-D4ErL_G-.js +1 -0
  35. package/dist/assets/{Preview-BxM5wosg.js → Preview-D-cOupgE.js} +1 -1
  36. package/dist/assets/{QBOConnectionScreen-CIODRsNA.js → QBOConnectionScreen-DHJG1ivI.js} +22 -22
  37. package/dist/assets/ReimbursementApprovalRoutes-COQTrupK.js +1 -0
  38. package/dist/assets/ReimbursementApprovalRuleDetailScreen-C7IYySTX.js +1 -0
  39. package/dist/assets/ReimbursementRoutes-DmGebZS2.js +68 -0
  40. package/dist/assets/ReportsRoutes-DhhA3Eh2.js +1 -0
  41. package/dist/assets/RewardsRoutes-CvdxwlDw.js +1 -0
  42. package/dist/assets/ScreenRoutes-CyuHmZKb.js +2 -0
  43. package/dist/assets/{SettingsRoutes-Dv5UDyEV.js → SettingsRoutes-C2oGjPkC.js} +7 -7
  44. package/dist/assets/{SetupPagesScreen-CvaReXCR.js → SetupPagesScreen-CGt-iJzo.js} +5 -5
  45. package/dist/assets/SignInScreen-CSy256fR.js +1 -0
  46. package/dist/assets/SignOutScreen-B_qJIye2.js +9 -0
  47. package/dist/assets/TaskListScreen-CextY5A5.js +9 -0
  48. package/dist/assets/TaskRoutes-CPBzDWI1.js +9 -0
  49. package/dist/assets/TransactionDetailRoutes-BncTDbnc.js +1 -0
  50. package/dist/assets/TransactionDetailScreen-8UnSIXVI.js +5 -0
  51. package/dist/assets/{TransactionListRoutes-ChfbF5Yn.js → TransactionListRoutes-DvLfPQCB.js} +1 -1
  52. package/dist/assets/{TreasuryRoutes-OIkwuzMV.js → TreasuryRoutes-G7tiwivZ.js} +5 -5
  53. package/dist/assets/{VendorsRoutes-BUXB41aT.js → VendorsRoutes-eWQSdeAw.js} +27 -27
  54. package/dist/assets/{WiseConfirmationScreen-D9W1pM9c.js → WiseConfirmationScreen-Bjcw2-vK.js} +2 -2
  55. package/dist/assets/{ZeniAccountRoutes-DD4g7Ugu.js → ZeniAccountRoutes-u7qTUA3M.js} +10 -10
  56. package/dist/assets/ZeniAccountStatementScreen-BvNm7lVB.js +9 -0
  57. package/dist/assets/{accountMappingHelper-C4yUO_tP.js → accountMappingHelper-CabpVb3J.js} +1 -1
  58. package/dist/assets/{analytics-p9dV2gEo.js → analytics-CsVp7bfq.js} +1 -1
  59. package/dist/assets/{analyticsHelper-Cq4tYGNc.js → analyticsHelper-DQMoVHAr.js} +1 -1
  60. package/dist/assets/{core-35eDsgGP.js → core-DFhvjgE1.js} +1 -1
  61. package/dist/assets/{decodeURIComponentSafe-DhnAz_92.js → decodeURIComponentSafe-Bq1r0pP9.js} +1 -1
  62. package/dist/assets/{dnd-Dm1d6mZC.js → dnd-CR945ANw.js} +1 -1
  63. package/dist/assets/{empty-BDPRkuRZ.js → empty-BUo7eNC4.js} +1 -1
  64. package/dist/assets/{empty-DpY1OPz6.js → empty-DtCztbrx.js} +1 -1
  65. package/dist/assets/{emptyVideoElement-C6tD2_Is.js → emptyVideoElement-BHUR8Iif.js} +1 -1
  66. package/dist/assets/epic-CXAAQW1t.js +2 -0
  67. package/dist/assets/{expenseAutomationHelper-XBf0IYWB.js → expenseAutomationHelper-BDz030nC.js} +1 -1
  68. package/dist/assets/getLocaleForTenant-7H39EvyO.js +1 -0
  69. package/dist/assets/{index-DqXFykf0.js → index-BBYtI_9U.js} +1 -1
  70. package/dist/assets/{index-B3U6gyEe.js → index-BaZwiGCV.js} +1 -1
  71. package/dist/assets/{index-D-ldiYpS.js → index-BjpjXshH.js} +1 -1
  72. package/dist/assets/{index-DHtuXNZa.js → index-BuEv25D3.js} +1 -1
  73. package/dist/assets/{index-D-oz9cOM.js → index-BvtiyGfj.js} +1 -1
  74. package/dist/assets/{index-CJI7GB_s.js → index-CFhckac5.js} +1 -1
  75. package/dist/assets/{index-BBhWSYD8.js → index-CKPer1bp.js} +28540 -27684
  76. package/dist/assets/{index-g5u7iWai.js → index-DiQe_6d7.js} +2 -2
  77. package/dist/assets/{lexical-DQ4lSvQh.js → lexical-CCIwPSwQ.js} +1 -1
  78. package/dist/assets/{liveblocks-D0hIH2N0.js → liveblocks-BY1qt3Nf.js} +1 -1
  79. package/dist/assets/{lottie-TJOzQ6Cz.js → lottie-DgdF8254.js} +1 -1
  80. package/dist/assets/{mui-CY_LMiAy.js → mui-DesXezzU.js} +1 -1
  81. package/dist/assets/{pathToGoBack-n4Mx0taW.js → pathToGoBack-9ah_vxgB.js} +1 -1
  82. package/dist/assets/{pdf-DElOA9Iz.js → pdf-BVKoD2Fp.js} +4 -4
  83. package/dist/assets/{pdf-lib-D54M6RaZ.js → pdf-lib-B25n7och.js} +1 -1
  84. package/dist/assets/{plaid-CoaHurGj.js → plaid---yWAm21.js} +1 -1
  85. package/dist/assets/{pusher-BBz5Zhu2.js → pusher-D7k49qkv.js} +1 -1
  86. package/dist/assets/{react-psgyYffq.js → react-B5sZlhmO.js} +1 -1
  87. package/dist/assets/{react-DRB89Tf-.js → react-CNwSpjM6.js} +1 -1
  88. package/dist/assets/{react-Cn6RRlX0.js → react-Cwl8BPa_.js} +1 -1
  89. package/dist/assets/{react-CFjwLJT9.js → react-Dmj3hcZb.js} +1 -1
  90. package/dist/assets/{react-CcppuOI-.js → react-DyW_yLGE.js} +1 -1
  91. package/dist/assets/{react-DlGIFhE7.js → react-KT_bO9_E.js} +1 -1
  92. package/dist/assets/{recharts-B8j-bW95.js → recharts-Co89o1ZO.js} +1 -1
  93. package/dist/assets/routePaths-CpftjCME.js +1 -0
  94. package/dist/assets/{sentry-DhqS_W-k.js → sentry-xWYlrqHr.js} +1 -1
  95. package/dist/assets/{url-BniS_9P1.js → url-B6D8gSqv.js} +1 -1
  96. package/dist/assets/{url-BlblTlRS.js → url-BQb6aJ6P.js} +1 -1
  97. package/dist/assets/useAiCfoDashboardSuggestedQuestionsChips-BGnMOAjq.js +1 -0
  98. package/dist/assets/useAskAiCfoHostNavButtonProps-CxYBeccP.js +1 -0
  99. package/dist/assets/useChargeCardPusherEvents-DD6FQHkD.js +1 -0
  100. package/dist/assets/{useDeviceId-Cd5EU_Dl.js → useDeviceId-BklKiHEX.js} +1 -1
  101. package/dist/assets/useEmailConnectResultRefresh-CeYzFDv9.js +1 -0
  102. package/dist/assets/useInitialThreadRequest-CAaLEese.js +1 -0
  103. package/dist/assets/{useTaskManagerAccess-DRrr5b-Z.js → useTaskManagerAccess-BMNTpSgs.js} +1 -1
  104. package/dist/assets/{utils-CgQOqOwX.js → utils-18zApAFM.js} +1 -1
  105. package/dist/assets/{withTransactionSidePanel-Cyf8gB6i.js → withTransactionSidePanel-BqPfYxXB.js} +4 -4
  106. package/dist/assets/{zeni-epic-state-BRRtwAQl.js → zeni-epic-state-DxmmAR38.js} +6 -6
  107. package/dist/index.html +1 -1
  108. package/package.json +3 -3
  109. package/dist/assets/AccountMappingScreen-vvnlkgXd.js +0 -9
  110. package/dist/assets/AddressRoutes-CqGLkDqt.js +0 -1
  111. package/dist/assets/AddressScreen-anqh6to9.js +0 -9
  112. package/dist/assets/AiCfoScreen-ZhNzgLev.js +0 -22
  113. package/dist/assets/AppDrawer-DMcZyfYw.js +0 -10
  114. package/dist/assets/CompanyPassportScreen-BQcZnLc-.js +0 -1
  115. package/dist/assets/ConnectionAuthScreen-D3Mf7qK3.js +0 -11
  116. package/dist/assets/CustomerOnboardingAuthScreen-C0sBjs60.js +0 -1
  117. package/dist/assets/DomesticWireDetailScreen-Df9Zx-eI.js +0 -18
  118. package/dist/assets/DrawerScreen-B_ZAZq-c.js +0 -1
  119. package/dist/assets/EntityDetailRoutes-BPJmlwG-.js +0 -1
  120. package/dist/assets/FeaturePreviewScreen-BhcrS0dM.js +0 -1
  121. package/dist/assets/HubSpotOAuthCallbackScreen-DY9bdeeM.js +0 -1
  122. package/dist/assets/MagicLinkSignInScreen-e8SmU6Yc.js +0 -12
  123. package/dist/assets/MobileAppDrawer-C9wi8312.js +0 -1
  124. package/dist/assets/NotFoundScreen-B6L1cY3I.js +0 -1
  125. package/dist/assets/NotificationRoutes-HbqGfq1a.js +0 -1
  126. package/dist/assets/OAuthConsentScreen-CwgWaIOt.js +0 -1
  127. package/dist/assets/PandLWithForecastRoutes-nx90MfxG.js +0 -1
  128. package/dist/assets/PeopleRoutes-4LCfOWjr.js +0 -22
  129. package/dist/assets/PerformanceRoutes-EfI4IfLY.js +0 -1
  130. package/dist/assets/ReimbursementApprovalRoutes-DfUkgvoL.js +0 -1
  131. package/dist/assets/ReimbursementApprovalRuleDetailScreen-HPs-AWde.js +0 -1
  132. package/dist/assets/ReimbursementRoutes-DvUFtazN.js +0 -68
  133. package/dist/assets/ReportsRoutes-CFpVRFNe.js +0 -1
  134. package/dist/assets/RewardsRoutes-CS-_8unl.js +0 -1
  135. package/dist/assets/ScreenRoutes-B_vqHZtF.js +0 -2
  136. package/dist/assets/SignInScreen-Cis2Hrqo.js +0 -1
  137. package/dist/assets/SignOutScreen-CgiJ4aJR.js +0 -9
  138. package/dist/assets/TaskListScreen-DsFWTjuD.js +0 -9
  139. package/dist/assets/TaskRoutes-BDVAqm9e.js +0 -9
  140. package/dist/assets/TransactionDetailRoutes-BDvPcX4f.js +0 -1
  141. package/dist/assets/TransactionDetailScreen-Bgc2K53s.js +0 -5
  142. package/dist/assets/ZeniAccountStatementScreen-BlteVo42.js +0 -9
  143. package/dist/assets/epic-BLC2ItWM.js +0 -2
  144. package/dist/assets/getLocaleForTenant-C0JZQLGG.js +0 -1
  145. package/dist/assets/routePaths-BgYQMm9p.js +0 -1
  146. package/dist/assets/useAiCfoDashboardSuggestedQuestionsChips-Dw4vBi90.js +0 -1
  147. package/dist/assets/useAskAiCfoHostNavButtonProps-DGTLHvUD.js +0 -1
  148. package/dist/assets/useChargeCardPusherEvents-COwRMcoJ.js +0 -1
  149. package/dist/assets/useEmailConnectResultRefresh-D_zBEeqz.js +0 -1
  150. package/dist/assets/useInitialThreadRequest-UvGRmRxR.js +0 -1
@@ -1,4 +1,4 @@
1
- import{j as e}from"./liveblocks-D0hIH2N0.js";import{h as L,g as F,u as B,i as V,j as y,N as D,l as M,n as Te,o as k}from"./core-35eDsgGP.js";import{cu as O,fB as v,Yb as U,Nu as ae,Nb as Z,Nc as ne,Yd as Ie,Nx as we,Y9 as Ce,Ya as se,Yp as ke,Ly as je,Bf as Ae,Yf as be,NE as Ee,Yc as re,d9 as q,FL as oe,dU as ve,dV as De,_B as Le,_C as Fe,Nd as Be,_D as Ue,Ne as Pe,Nn as Re,bq as Ne,bJ as Ve,cF as Me,bK as Oe,ct as _e,bt as ze,Tc as $e,cs as Ge}from"./zeni-epic-state-BRRtwAQl.js";import{U as _,j as Ye,z as E,a6 as z,k as A,d3 as Ze,d4 as qe,d5 as Y,$ as H,E as He,ao as Ke,aq as We,I as ie,d as R,a9 as Je,a5 as Qe,d6 as Xe,ac as K,p as et,d7 as tt,a2 as W,d8 as at,ag as nt,Z as Q,d9 as st,h as rt}from"./index-BBhWSYD8.js";import{D as ot,n as N,S as it}from"./mui-CY_LMiAy.js";import ct from"./NotFoundScreen-B6L1cY3I.js";import{S as X}from"./SetupPagesScreen-CvaReXCR.js";import{a as p}from"./sentry-DhqS_W-k.js";import{u as lt}from"./useAskAiCfoHostNavButtonProps-DGTLHvUD.js";import{u as ut}from"./useInitialThreadRequest-UvGRmRxR.js";import{M as ce}from"./MobileAppDrawer-C9wi8312.js";import{F as dt}from"./FeaturePreviewScreen-BhcrS0dM.js";import{a as ee}from"./analyticsHelper-Cq4tYGNc.js";import"./recharts-B8j-bW95.js";import"./analytics-p9dV2gEo.js";import"./plaid-CoaHurGj.js";import"./dnd-Dm1d6mZC.js";import"./stripe-cKAAJElX.js";import"./lottie-TJOzQ6Cz.js";import"./lexical-DQ4lSvQh.js";import"./pdf-DElOA9Iz.js";import"./utils-CgQOqOwX.js";import"./BusinessVerificationPageScreen-BnngOdPs.js";import"./routePaths-BgYQMm9p.js";import"./InboxNotificationsProvider-yp4VlF4V.js";import"./useTaskManagerAccess-DRrr5b-Z.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]="2f110050-1c73-47f5-9398-73528f4e69ca",t._sentryDebugIdIdentifier="sentry-dbid-2f110050-1c73-47f5-9398-73528f4e69ca")}catch{}})();const pt=M((function(t,a){const{companyId:n}=a;return{treasurySetupView:U(t,n),analytics:A}}),(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))}}}))(Ze);function mt(){const t=L(),a=F(),n=B(),{tenantEmailDomain:o}=V(),i=_(),r=y((w=>w.treasurySetupViewState.portfolioAllocationUpdateStatus?.fetchState)),m=Ye(r),s=O(i?.loggedInUserRoleMap),[d,c]=p.useState(!1),[S,T]=p.useState(!1),[l,u]=p.useState(!1),x=y((w=>v(w))),f=E.getSignedInUserTenant(o)?.companyId??x.companyId,C=E.getSignedInUser(),h=y((w=>U(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(Z()))}),[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(z,{analytics:A,onLoad:()=>{}}),e.jsx(pt,{navigate:t,location:a,companyId:f,isEditMode:!0,isLoading:P,isReadOnly:!s,treasurySetupView:h,analytics:A})]})}const ft=M((function(t,a){const n=a.currentTenant?.companyId;return{plaidConnectionDetails:ke(t,n,"zeni_treasury","treasury_setup").plaidConnectionDetails,treasurySetupView:U(t,n)}}),(function(t,a){const{navigate:n,transferDetails:o,treasurySetupView:i}=a,r=o.treasuryTransferMoneyLocalData,m=i.fundAllocationLocalData;return{onCancelClick:()=>{Y(a.analytics,"cancel",r,m,"Transfer"),t(se()),n("../")},onTransferClick:()=>{Y(a.analytics,"confirm",r,m,"Transfer"),t(Ee())},onSaveChangesToLocalStore:s=>{t(be(s))},onFetchLinkTokenClick:s=>{t(Ae("treasury_setup",s))},onEstablishConnectionClick:s=>{t(je(s,a.currentTenant?.companyId,"treasury_setup","zeni_treasury"))}}}))(qe),yt=({isFirstTransfer:t,isTransactionsLoaded:a})=>{const n=L(),{tenantEmailDomain:o}=V(),i=B(),[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=>v(I))),h=E.getSignedInUserTenant(o)?.companyId??C.companyId,g=y((I=>Ce(I))),j=y((I=>U(I,h)));if(E.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(Z()))}),[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(z,{analytics:A,onLoad:()=>{}}),e.jsx(ft,{analytics:A,navigate:n,transferDetails:g,onAnotherTransferClick:()=>{m(!1),i(se())},currentTenant:C,treasurySetupView:j,showReviewContent:r,maxInsuredAmount:5e5,onReviewClick:()=>{Y(A,"review",g.treasuryTransferMoneyLocalData,j.fundAllocationLocalData,"Transfer"),m(!0)},isFirstTransfer:t,isTransactionsLoaded:a,setShowReviewContent:m,onBackClick:()=>{}})]})},gt=N.div`
1
+ import{j as e}from"./liveblocks-BY1qt3Nf.js";import{h as L,g as F,u as U,i as V,j as y,N as D,l as M,n as Te,o as k}from"./core-DFhvjgE1.js";import{cu as O,fB as v,Yv as B,NK as ae,Nr as q,Ns as ne,Yx as we,NN as Ie,Yt as Ce,Yu as se,YJ as ke,LO as je,Bv as be,Yz as Ae,NU as Ee,Yw as re,d9 as Z,F$ as oe,dU as ve,dV as De,_V as Le,_W as Fe,Nt as Ue,_X as Be,Nu as Pe,ND as Re,bq as Ne,bJ as Ve,cF as Me,bK as Oe,ct as _e,bt as ze,Tw as $e,cs as Ge}from"./zeni-epic-state-DxmmAR38.js";import{V as _,j as Ye,z as E,a8 as z,k as b,d5 as qe,d6 as Ze,d7 as Y,a1 as H,E as He,aq as Ke,as as We,c as ie,y as R,ab as Je,a7 as Xe,d8 as Qe,ae as K,p as et,d9 as tt,a4 as W,da as at,ai as nt,$ as X,db as st,g as rt}from"./index-CKPer1bp.js";import{D as ot,n as N,S as it}from"./mui-DesXezzU.js";import ct from"./NotFoundScreen-BPjOFceW.js";import{S as Q}from"./SetupPagesScreen-CGt-iJzo.js";import{a as p}from"./sentry-xWYlrqHr.js";import{u as lt}from"./useAskAiCfoHostNavButtonProps-CxYBeccP.js";import{u as ut}from"./useInitialThreadRequest-CAaLEese.js";import{M as ce}from"./MobileAppDrawer-CmjsL1eQ.js";import{F as dt}from"./FeaturePreviewScreen-Crks8H4y.js";import{a as ee}from"./analyticsHelper-DQMoVHAr.js";import"./recharts-Co89o1ZO.js";import"./analytics-CsVp7bfq.js";import"./plaid---yWAm21.js";import"./dnd-CR945ANw.js";import"./stripe-cKAAJElX.js";import"./lottie-DgdF8254.js";import"./lexical-CCIwPSwQ.js";import"./pdf-BVKoD2Fp.js";import"./utils-18zApAFM.js";import"./BusinessVerificationPageScreen-BBPD780e.js";import"./routePaths-CpftjCME.js";import"./InboxNotificationsProvider-CzhxlkVm.js";import"./useTaskManagerAccess-BMNTpSgs.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]="b12a405b-5d31-48d4-8506-51de0cb2f890",t._sentryDebugIdIdentifier="sentry-dbid-b12a405b-5d31-48d4-8506-51de0cb2f890")}catch{}})();const pt=M((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(Ie(!0))},onUpdateFundAllocation:r=>{o.trackTreasuryAllocationAction("update",ee(r)),t(we(r))}}}))(qe);function mt(){const t=L(),a=F(),n=U(),{tenantEmailDomain:o}=V(),i=_(),r=y((I=>I.treasurySetupViewState.portfolioAllocationUpdateStatus?.fetchState)),m=Ye(r),s=O(i?.loggedInUserRoleMap),[d,c]=p.useState(!1),[S,T]=p.useState(!1),[l,u]=p.useState(!1),x=y((I=>v(I))),f=E.getSignedInUserTenant(o)?.companyId??x.companyId,C=E.getSignedInUser(),h=y((I=>B(I,f))),g=y((I=>I.treasurySetupViewState.fetchState)),j=y((I=>I.treasurySetupViewState.currentAllocation.fetchStatus?.fetchState)),w=y((I=>I.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||w!=="Not-Started"||f==null||(u(!0),n(q()))}),[l,w,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(z,{analytics:b,onLoad:()=>{}}),e.jsx(pt,{navigate:t,location:a,companyId:f,isEditMode:!0,isLoading:P,isReadOnly:!s,treasurySetupView:h,analytics:b})]})}const ft=M((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:()=>{Y(a.analytics,"cancel",r,m,"Transfer"),t(se()),n("../")},onTransferClick:()=>{Y(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"))}}}))(Ze),yt=({isFirstTransfer:t,isTransactionsLoaded:a})=>{const n=L(),{tenantEmailDomain:o}=V(),i=U(),[r,m]=p.useState(!1),[s,d]=p.useState(!1),[c,S]=p.useState(!1),[T,l]=p.useState(!1),u=y((w=>w.treasurySetupViewState.fetchState)),x=y((w=>w.treasurySetupViewState.treasuryFundsDetails?.fetchStatus?.fetchState)),f=y((w=>w.treasurySetupViewState.currentAllocation.fetchStatus?.fetchState)),C=y((w=>v(w))),h=E.getSignedInUserTenant(o)?.companyId??C.companyId,g=y((w=>Ce(w))),j=y((w=>B(w,h)));if(E.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(z,{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:()=>{Y(b,"review",g.treasuryTransferMoneyLocalData,j.fundAllocationLocalData,"Transfer"),m(!0)},isFirstTransfer:t,isTransactionsLoaded:a,setShowReviewContent:m,onBackClick:()=>{}})]})},gt=N.div`
2
2
  display: flex;
3
3
  min-height: 100%;
4
4
  width: 100%;
@@ -6,7 +6,7 @@ import{j as e}from"./liveblocks-D0hIH2N0.js";import{h as L,g as F,u as B,i as V,
6
6
  flex-direction: column;
7
7
  align-items: center;
8
8
  background-color: ${t=>t.theme.colors.grey4};
9
- `,St={overlayWidth:new Je(100,100,48)},ht=M((function(t,a){const n=re(t),{companyId:o}=a;return{treasuryDetail:n,treasurySetupView:U(t,o),downloadEndPoint:`${K.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")}}}))(Xe);function G({isTransferDrawerOpen:t,isEditPortfolioDrawerOpen:a}){const n=F(),o=L(),i=B(),r=H(),m=He(),s=y((b=>v(b))),{tenantEmailDomain:d}=V(),c=s.companyId??E.getSignedInUserTenant(d)?.companyId,[S,T]=p.useState(!1),l=y((b=>re(b))),u=l.fetchState,x=l.accountSummary?.totalBalance?.amount,f=y((b=>b.treasurySetupViewState.treasuryFundsDetails?.fetchStatus)),C=s.companyTreasuryInfo?.info?.businessVerificationStatus?.code==="verified",h=_(),g=!!s.companyTreasuryInfo?.info?.isTreasuryTOSAccepted,j=O(h?.loggedInUserRoleMap),I=q(h?.loggedInUserRoleMap),{areTenantIdsInSync:P}=Ke();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),J=b=>{ue(b)},{isAiCfoAccessEnabled:de,onAskAiCfoClick:pe}=lt({mobileExploreReferrer:"Treasury"});We({isDataReady:u==="Completed"});const{useFeatureGate:$}=ie(),{isFeatureEnabled:me}=$(R.isDebitCardFeatureEnabled),{isFeatureEnabled:fe}=$(R.isAutoTransferRuleEnabled),{isFeatureEnabled:ye}=$(R.isTreasuryCommentingEnabled),ge=ut(c,{clearParams:u==="Completed"&&f?.fetchState==="Completed"}),Se=ve(s),he=De(me,s);if(Se===!0&&he!==!0)return e.jsx(dt,{});if(C){const b=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(z,{analytics:A,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:J}),e.jsx(ht,{treasuryDetailsView:l,isAutoTransferRuleEnabled:fe,navigate:o,currentTenant:s,location:n,companyId:c,analytics:A,isTreasuryCommentingEnabled:ye,handleDrawerToggle:J,initialOpenThreadRequest:ge,isLoading:b,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=N(it)`
9
+ `,St={overlayWidth:new Je(100,100,48)},ht=M((function(t,a){const n=re(t),{companyId:o}=a;return{treasuryDetail:n,treasurySetupView:B(t,o),downloadEndPoint:`${K.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=wt(s):d==="settings"&&(c=It(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")}}}))(Qe);function G({isTransferDrawerOpen:t,isEditPortfolioDrawerOpen:a}){const n=F(),o=L(),i=U(),r=H(),m=He(),s=y((A=>v(A))),{tenantEmailDomain:d}=V(),c=s.companyId??E.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=O(h?.loggedInUserRoleMap),w=Z(h?.loggedInUserRoleMap),{areTenantIdsInSync:P}=Ke();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 I=()=>{o("..")},[le,ue]=p.useState(!1),J=A=>{ue(A)},{isAiCfoAccessEnabled:de,onAskAiCfoClick:pe}=lt({mobileExploreReferrer:"Treasury"});We({isDataReady:u==="Completed"});const{useFeatureGate:$}=ie(),{isFeatureEnabled:me}=$(R.isDebitCardFeatureEnabled),{isFeatureEnabled:fe}=$(R.isAutoTransferRuleEnabled),{isFeatureEnabled:ye}=$(R.isTreasuryCommentingEnabled),ge=ut(c,{clearParams:u==="Completed"&&f?.fetchState==="Completed"}),Se=ve(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(z,{analytics:b,onLoad:()=>{}}):null,e.jsx(ot,{onClose:I,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:J}),e.jsx(ht,{treasuryDetailsView:l,isAutoTransferRuleEnabled:fe,navigate:o,currentTenant:s,location:n,companyId:c,analytics:b,isTreasuryCommentingEnabled:ye,handleDrawerToggle:J,initialOpenThreadRequest:ge,isLoading:A,isAiCfoAccessEnabled:de,onAskAiCfoClick:pe})]})]})}return g&&j?e.jsx(D,{to:"../setup"}):s.companyTreasuryInfo?.info&&!g&&w?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`,wt=t=>`/${t}/treasury/tax-letter`,It=t=>`/${t}/treasury/setup`,Ct=N(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-D0hIH2N0.js";import{h as L,g as F,u as B,i as V,
18
18
  flex-direction: column;
19
19
  align-items: center;
20
20
  background-color: ${t=>t.theme.colors.grey4};
21
- `;function jt(){const t=L(),a=B(),n=H(),o=F(),i=`${K.bankingMicroServiceBaseUrl}/1.0/treasury-account`,[r,m]=p.useState(!1),s=y((u=>Fe(u)));p.useEffect((()=>{r||s.fetchState!=="Not-Started"||(m(!0),a(Be(!1)))}),[r,s.fetchState,a]);const d=E.getSignedInUser(),c=y((u=>v(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=W(o.state?.pathnameStackToGoBack),x=u.poppedPathname??"..";t(x,{state:{pathnameStackToGoBack:u.newStack}})},authParams:S,downloadEndPoint:i})})}const At=N.div`
21
+ `;function jt(){const t=L(),a=U(),n=H(),o=F(),i=`${K.bankingMicroServiceBaseUrl}/1.0/treasury-account`,[r,m]=p.useState(!1),s=y((u=>Fe(u)));p.useEffect((()=>{r||s.fetchState!=="Not-Started"||(m(!0),a(Ue(!1)))}),[r,s.fetchState,a]);const d=E.getSignedInUser(),c=y((u=>v(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=W(o.state?.pathnameStackToGoBack),x=u.poppedPathname??"..";t(x,{state:{pathnameStackToGoBack:u.newStack}})},authParams:S,downloadEndPoint:i})})}const bt=N.div`
22
22
  display: flex;
23
23
  height: 100vh;
24
24
  width: 100%;
@@ -26,7 +26,7 @@ import{j as e}from"./liveblocks-D0hIH2N0.js";import{h as L,g as F,u as B,i as V,
26
26
  flex-direction: column;
27
27
  align-items: center;
28
28
  background-color: ${t=>t.theme.colors.grey4};
29
- `;function bt(){const t=L(),a=H(),n=F(),o=B(),i=`${K.bankingMicroServiceBaseUrl}/1.0/treasury-account`,[r,m]=p.useState(!1),s=y((u=>Ue(u)));p.useEffect((()=>{r||s.fetchState!=="Not-Started"||(m(!0),o(Pe(!1)))}),[r,s.fetchState,o]);const d=E.getSignedInUser(),c=y((u=>v(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(At,{windowSize:a,children:e.jsx(at,{currentTenantCompanyName:T,taxLetterListView:s,isLoading:l,onBackClick:()=>{const u=W(n.state?.pathnameStackToGoBack),x=u.poppedPathname??"..";t(x,{state:{pathnameStackToGoBack:u.newStack}})},authParams:S,downloadEndPoint:i})})}const Et=M((function(t,a){const{companyId:n}=a,o=U(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(Re(o))},onBackClick:()=>{n("../..",{relative:"path"})},onTreasurySetupSuccess:i=>{n(i?"..":"../setup",{relative:"path"})}}}))(st),vt=()=>{const t=nt(),a=L(),n=F(),o=B(),{tenantEmailDomain:i}=V(),[r,m]=p.useState(!1),s=y((g=>v(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(Z()))}),[S,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=O(f?.loggedInUserRoleMap),h=q(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=W(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(Q,{size:"ExtraLarge",start:!0})}):e.jsxs(e.Fragment,{children:[e.jsx(z,{analytics:A,onLoad:g=>(j=>j.trackTreasuryPromoView("Treasury Promo Page"))(g)}),e.jsx(ce,{isAppContentDrawerOpen:r,handleDrawerToggle:x}),e.jsx(Et,{analytics:A,navigate:a,companyId:T,meetingUrl:t("treasury_promo"),onClickMenuIcon:()=>{x(!0)}})]})}return e.jsx(te,{children:e.jsx(Q,{size:"ExtraLarge",start:!0})})},te=N.div`
29
+ `;function At(){const t=L(),a=H(),n=F(),o=U(),i=`${K.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=E.getSignedInUser(),c=y((u=>v(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=W(n.state?.pathnameStackToGoBack),x=u.poppedPathname??"..";t(x,{state:{pathnameStackToGoBack:u.newStack}})},authParams:S,downloadEndPoint:i})})}const Et=M((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(Re(o))},onBackClick:()=>{n("../..",{relative:"path"})},onTreasurySetupSuccess:i=>{n(i?"..":"../setup",{relative:"path"})}}}))(st),vt=()=>{const t=nt(),a=L(),n=F(),o=U(),{tenantEmailDomain:i}=V(),[r,m]=p.useState(!1),s=y((g=>v(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=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=O(f?.loggedInUserRoleMap),h=Z(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=W(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(z,{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(X,{size:"ExtraLarge",start:!0})})},te=N.div`
30
30
  display: flex;
31
31
  width: 100%;
32
32
  height: 100%;
@@ -34,4 +34,4 @@ import{j as e}from"./liveblocks-D0hIH2N0.js";import{h as L,g as F,u as B,i as V,
34
34
  justify-content: center;
35
35
  align-items: center;
36
36
  background-color: ${t=>t.theme.colors.grey5};
37
- `;function aa(){const t=F(),a=y((g=>v(g))),{useFeatureGate:n}=ie(),o=a.companyTreasuryInfo?.info?.businessVerificationStatus?.code==="verified",i=!!a.company?.companyTreasuryInfo?.isTreasuryTOSAccepted,r=_(),m=q(r?.loggedInUserRoleMap),s=a?.userRole!=null&&Ne(a?.userRole),d=(a?.company==null||a.company.featuresActivationInfo?.isBillPayFeatureEnabled&&!s)&&Ve(r?.loggedInUserRoleMap),c=Me(r?.loggedInUserRoleMap),S=(a?.company==null||a.company.featuresActivationInfo?.isReimbursementFeatureEnabled&&!s)&&Oe(r?.loggedInUserRoleMap),T=!!a.company?.companyZeniAccountInfo?.isZeniAccountEnabled&&!s&&_e(r?.loggedInUserRoleMap),l=o&&!s&&O(r?.loggedInUserRoleMap),{isFeatureEnabled:u}=n(R.isChargeCardFeatureEnabled),{isFeatureEnabled:x}=n(R.isDebitCardFeatureEnabled),f=rt(a,u,x)&&!s&&ze(r?.loggedInUserRoleMap),C=$e(r?.loggedInUserRoleMap),h=Ge(r?.loggedInUserRoleMap);return e.jsxs(Te,{children:[h?null:e.jsx(k,{path:"setup",element:e.jsx(X,{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(X,{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(vt,{})}),e.jsx(k,{path:"statements",element:e.jsx(jt,{})}),e.jsx(k,{path:"tax-letter",element:e.jsx(bt,{})}),o?e.jsxs(e.Fragment,{children:[e.jsx(k,{path:"/",element:e.jsx(G,{isTransferDrawerOpen:!1,isEditPortfolioDrawerOpen:!1})}),l?e.jsxs(e.Fragment,{children:[e.jsx(k,{path:"edit-portfolio",element:e.jsx(G,{isEditPortfolioDrawerOpen:!0,isTransferDrawerOpen:!1})}),e.jsx(k,{path:"transfer",element:e.jsx(G,{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=F(),a=y((g=>v(g))),{useFeatureGate:n}=ie(),o=a.companyTreasuryInfo?.info?.businessVerificationStatus?.code==="verified",i=!!a.company?.companyTreasuryInfo?.isTreasuryTOSAccepted,r=_(),m=Z(r?.loggedInUserRoleMap),s=a?.userRole!=null&&Ne(a?.userRole),d=(a?.company==null||a.company.featuresActivationInfo?.isBillPayFeatureEnabled&&!s)&&Ve(r?.loggedInUserRoleMap),c=Me(r?.loggedInUserRoleMap),S=(a?.company==null||a.company.featuresActivationInfo?.isReimbursementFeatureEnabled&&!s)&&Oe(r?.loggedInUserRoleMap),T=!!a.company?.companyZeniAccountInfo?.isZeniAccountEnabled&&!s&&_e(r?.loggedInUserRoleMap),l=o&&!s&&O(r?.loggedInUserRoleMap),{isFeatureEnabled:u}=n(R.isChargeCardFeatureEnabled),{isFeatureEnabled:x}=n(R.isDebitCardFeatureEnabled),f=rt(a,u,x)&&!s&&ze(r?.loggedInUserRoleMap),C=$e(r?.loggedInUserRoleMap),h=Ge(r?.loggedInUserRoleMap);return e.jsxs(Te,{children:[h?null:e.jsx(k,{path:"setup",element:e.jsx(Q,{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(Q,{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(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(G,{isTransferDrawerOpen:!1,isEditPortfolioDrawerOpen:!1})}),l?e.jsxs(e.Fragment,{children:[e.jsx(k,{path:"edit-portfolio",element:e.jsx(G,{isEditPortfolioDrawerOpen:!0,isTransferDrawerOpen:!1})}),e.jsx(k,{path:"transfer",element:e.jsx(G,{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,4 +1,4 @@
1
- import{j as l}from"./liveblocks-D0hIH2N0.js";import{a as f}from"./sentry-DhqS_W-k.js";import{i as O,u as z,h as J,g as K,j as m,l as G,n as at,o as B,N as $}from"./core-35eDsgGP.js";import{UG as zt,UH as Yt,lF as W,ry as Kt,rK as qt,s0 as Ht,r_ as Qt,s1 as Wt,s4 as Xt,UI as Zt,fB as L,UJ as Ee,UK as Me,gX as te,cA as Ie,cB as be,Eg as St,UL as nt,Ek as ea,S7 as ae,Ee as ta,E8 as aa,UM as Je,E0 as na,D$ as sa,DW as oa,E5 as la,El as ia,UN as ue,UO as Ge,E1 as ca,UP as he,gL as ft,EB as gt,Eu as vt,UQ as xt,rE as Tt,Eo as yt,Em as Ct,UR as Dt,EI as Et,EF as It,Ep as bt,EH as $e,Qy as kt,US as da,UT as ra,cD as ua,UU as ha,UV as pa,UW as pe,UX as ie,UY as ke,S8 as ze,EX as Te,S6 as ye,EK as wt,Eh as Ye,UZ as ma,S9 as H,U_ as Ke,Eb as Sa,U$ as fa,V0 as ga,V1 as qe,V2 as He,V3 as Qe,V4 as We,ER as we,V5 as At,Ey as Vt,V6 as va,V7 as xa,V8 as Ta,V9 as ya,Va as Ca,Vb as Da,Vc as Ea,Vd as Ia,Br as ba,Bz as ka,Bs as wa,Re as je,Ve as Aa,Vf as Va,kV as Pe,br as Fa,Vg as ja,Vh as Pa,mD as _a,mM as La,Rd as _e,bE as st,Vi as Ft,QQ as jt,Vj as Ba,Vk as Ua,Vl as Oa,mO as Ra,Vm as ot,Vn as lt,Vo as it,Vp as ct,Vq as Na,mK as Ma,Vr as Ja,mN as Ga,Vs as $a,Vt as Pt,Rz as _t,m1 as za,Vu as Ya,Vv as Le,Vw as Lt,Rx as Bt,Hg as Ka,Vx as qa,Vy as Ha,ml as Ut,Vz as Qa,VA as Wa,RL as Xa,um as Za,VB as Ot,VC as dt,RI as Be,VD as rt,VE as en,RN as tn,VF as an,VG as nn,VH as sn,VI as on,VJ as ln,up as cn,VK as dn,Sa as rn,TF as un,Rq as Ue,i7 as hn,TH as pn,TG as mn,i5 as Sn,VL as fn,VM as gn,Hl as vn,VN as xn,VO as Tn,VP as yn,VQ as Cn,m5 as Dn,bn as En,dV as In,dU as bn}from"./zeni-epic-state-BRRtwAQl.js";import{a2 as Ce,aK as Ae,aL as kn,z as R,j as Oe,a5 as Rt,a6 as Z,k as V,at as ee,aM as wn,p as M,G as De,c as ce,aN as An,aO as Vn,aP as Fn,E as jn,$ as de,a9 as Xe,I as ne,d as Y,aQ as Pn,X as Ze,aq as me,aR as _n,aS as Nt,ao as Ln,aT as Bn,U as Un,aU as On,ac as Mt,aV as Rn,J as X,a7 as Nn,ad as Jt,ae as Mn,aW as Jn,aX as Gn,S as et,aY as $n,aZ as zn,a1 as Yn,a_ as Kn,a$ as qn}from"./index-BBhWSYD8.js";import{n as N,D as Hn,S as Gt}from"./mui-CY_LMiAy.js";import{t as Qn,A as Wn}from"./AddressScreen-anqh6to9.js";import Q from"./NotFoundScreen-B6L1cY3I.js";import{F as Xn}from"./FeaturePreviewScreen-BhcrS0dM.js";import{p as Zn}from"./pathToGoBack-n4Mx0taW.js";import{c as q,v as tt,d as es}from"./routePaths-BgYQMm9p.js";import{u as Se}from"./useAskAiCfoHostNavButtonProps-DGTLHvUD.js";import{M as fe}from"./MobileAppDrawer-C9wi8312.js";import{D as ts}from"./DrawerScreen-B_ZAZq-c.js";import{a as as,m as ns}from"./accountMappingHelper-C4yUO_tP.js";import"./recharts-B8j-bW95.js";import"./analytics-p9dV2gEo.js";import"./plaid-CoaHurGj.js";import"./dnd-Dm1d6mZC.js";import"./stripe-cKAAJElX.js";import"./lottie-TJOzQ6Cz.js";import"./lexical-DQ4lSvQh.js";import"./pdf-DElOA9Iz.js";import"./utils-CgQOqOwX.js";import"./InboxNotificationsProvider-yp4VlF4V.js";import"./useTaskManagerAccess-DRrr5b-Z.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]="869a29be-af0e-4abf-9631-524419e205e3",e._sentryDebugIdIdentifier="sentry-dbid-869a29be-af0e-4abf-9631-524419e205e3")}catch{}})();function ss(){const{accrualId:e}=O(),a=z(),s=J(),t=K(),{accrual:n,actionFetchState:o,detailFetchState:d,localData:i}=m((c=>zt(c,e??""))),u=m((c=>Yt(c))),h=m((c=>W(c))),S=f.useCallback((()=>{const c=Ce(t.state?.pathnameStackToGoBack);s(c.poppedPathname??Zn(4),{state:{pathnameStackToGoBack:c.newStack}})}),[t.state,s]),r=f.useRef(!1);return f.useEffect((()=>{o.fetchState!=="In-Progress"&&r.current&&o.fetchState==="Completed"&&(r.current=!1,S())}),[o.fetchState,S]),f.useEffect((()=>{e!=null&&n==null&&d.fetchState==="Not-Started"&&a(Kt(e))}),[e,n,d.fetchState]),f.useEffect((()=>{a(qt({scheduleType:"prepaid_expenses",shouldResetEnteredData:!1}))}),[a]),e==null?l.jsx(Q,{}):n==null?d.fetchState==="Not-Started"||d.fetchState==="In-Progress"?l.jsx(Ae,{}):l.jsx(Q,{}):l.jsx(kn,{accrual:n,actionFetchState:o.fetchState,isAccountingClassesEnabled:h,localData:i,newAccrualAccountsView:u,onAccrualFormChange:(c,p)=>{a(Zt({accrualId:c,localData:p}))},onAccrualFormClear:c=>{a(Xt({accrualId:c}))},onApproveAndPost:c=>{a(Wt(e,c))},onNavigateBack:S,onRevert:(c,p)=>{r.current=!0,a(Qt(e,c,p))},onSkip:(c,p)=>{a(Ht(e,c,p))}})}const os=De.getLocalizedStrings(),ls=G((function(e,a){const s=Me(e,a.scheduleTab),t=e.tenantState.currentTenantId;return{authParams:{userId:a.signedInUser.userId??"",sessionId:a.signedInUser.zeniSessionId??"",tenantId:t??""},linkBillExpenseView:s.linkBillExpenseView,transactions:s.linkBillExpenseView.transactions}}),(function(e,a){const{navigate:s,location:t}=a;return{onTransactionSelect(n){e(nt({selectedTransaction:n}))},onBackClick:()=>{s("..",{relative:"path"})},onCancel(){e(nt({selectedTransaction:void 0})),e(ea()),s("..",{relative:"path"})},onTransactionClick:n=>{const o=`${q(n,a.tenantEmailDomain)}`,d=M(t.state?.pathnameStackToGoBack,t.pathname);s(o,{state:{pathnameStackToGoBack:d}})},onLinkSave(){a.setShouldNavigateBack(!1),e(St(a.scheduleTab,a.scheduleAccruedDetailsView.selectedJEAccruedSchedule?.jeScheduleId))}}}))(wn),is=({setShouldNavigateBack:e})=>{const a=J(),s=K(),{scheduleDetailId:t,tenantEmailDomain:n}=O(),{scheduleType:o}=O();if(n==null)throw Error("Can't access Link Bill Expense page without tenant Email Domain");const d=m((g=>L(g))),i=Ee(o)??"accrued_expenses",u=R.getSignedInUser();if(u==null)throw Error("Can't access Link Bill Expensedetail page without signing in...");if(t==null)throw Error("Invalid Schedule Detail Id");const h=m((g=>Me(g,i))),S=h.selectedJELinkRowIndex,r=m((g=>te(g,d.companyId))),c=Oe(h.updateStatus.fetchState);f.useEffect((()=>{c==="In-Progress"&&h.updateStatus.fetchState==="Completed"&&a("..",{relative:"path"})}),[c,h.updateStatus.fetchState]),f.useEffect((()=>{h.fetchState==="Not-Started"&&a("..",{relative:"path"})}),[]),f.useEffect((()=>{h.selectedJEAccruedSchedule!=null&&h.selectedJELinkRowIndex!=null||a("..",{relative:"path"})}),[h.selectedJEAccruedSchedule,h.selectedJELinkRowIndex]);const p=h.linkBillExpenseView.fetchState==="Completed";return l.jsx(l.Fragment,{children:h.linkBillExpenseView.fetchState==="In-Progress"?l.jsx(Rt,{fetchState:h.linkBillExpenseView.fetchState}):h.selectedJEAccruedSchedule!=null&&S!=null?l.jsxs(l.Fragment,{children:[p===!0?l.jsx(Z,{analytics:V,onLoad:()=>{cs(h,i,r)}}):null,l.jsx(ls,{signedInUser:u,attachmentEndPoint:`${ee}/vendor_attachments`,setShouldNavigateBack:e,scheduleVendorId:h.selectedJEAccruedSchedule.vendor.id??"",location:s,tenantEmailDomain:n,scheduleAccruedDetailsView:h,saveFetchState:h.updateStatus.fetchState,scheduleTab:i,navigate:a,analytics:V,controllerUserDetails:r,saveStatus:h.updateStatus.fetchState,jeAccruedSchedule:h.selectedJEAccruedSchedule,localData:h.scheduleAccruedDetailsLocalData.jeScheduleDetails[S]})]}):null})},$t=e=>{const a=os.dateFormat.analytics.YYYYDashMMDashDDFormat;return{scheduleCreateDate:e.createTime.format(a)??null,scheduleMonthlyAmount:e.recurringAmount??null,startingBalance:e.otherAttributes.startingBalance??null,scheduleAccountCategory:e.jeCredit.account?.accountName??null,description:e.memo,runningBalance:e.balanceAsOfToday??null,currentBalance:e.balanceAsOfToday??null,currentStatus:e.status.label,period:e.period??null,startMonth:e.startDate?.format(a)??null,endMonth:e.endDate?.format(a)??null}},cs=(e,a,s)=>{const t=e.selectedJEAccruedSchedule,n=e.selectedJELinkRowIndex;let o;n!=null&&t!=null&&(o=t.scheduledJournalEntry[n]);const{transactions:d}=e.linkBillExpenseView,i=d.some((S=>S.isRecommendedTransaction===!0)),u=Ie(s.controllers),h=be(s.controllerUserIds);t!=null&&V.trackScheduleAccruedDetailsJournalEntryLinkedLoaded({scheduleType:a,schedule:{...$t(t)},scheduleExpenseCategoryAndClass:{expenseCategory:t.jeDebit.account?.accountName??null,expenseClass:t.jeDebit.accountingClass?.className??null},journalEntryDetails:{wasRecommendationAvailable:i,journalEntryPostingStatus:o?.status.label??""},vendorName:t.vendor.name??null,controllerEmails:u,controllerUserIds:h})},ds=N.div`
1
+ import{j as l}from"./liveblocks-BY1qt3Nf.js";import{a as f}from"./sentry-xWYlrqHr.js";import{i as R,u as Y,h as G,g as K,j as m,l as J,n as at,o as B,N as $}from"./core-DFhvjgE1.js";import{U_ as Yt,U$ as zt,lX as Q,rP as Kt,r$ as qt,sh as Wt,sf as Ht,si as Qt,sl as Zt,V0 as Xt,fB as L,V1 as Ee,V2 as Me,gX as te,cA as be,cB as Ie,Ew as St,V3 as nt,EA as ea,Sn as ae,Eu as ta,Eo as aa,V4 as Ge,Eg as na,Ef as sa,Ea as oa,El as la,EB as ia,V5 as ue,V6 as Je,Eh as ca,V7 as he,gL as ft,ER as gt,EK as vt,V8 as xt,rV as Tt,EE as yt,EC as Ct,V9 as Dt,EY as Et,EV as bt,EF as It,EX as $e,QO as kt,Va as da,Vb as ra,cD as ua,Vc as ha,Vd as pa,Ve as pe,Vf as ie,Vg as ke,So as Ye,Fb as Te,Sm as ye,E_ as wt,Ex as ze,Vh as ma,Sp as W,Vi as Ke,Er as Sa,Vj as fa,Vk as ga,Vl as qe,Vm as We,Vn as He,Vo as Qe,F5 as we,Vp as At,EO as Vt,Vq as va,Vr as xa,Vs as Ta,Vt as ya,Vu as Ca,Vv as Da,Vw as Ea,Vx as ba,BH as Ia,BP as ka,BI as wa,Ru as Fe,Vy as Aa,Vz as Va,lb as Pe,br as ja,VA as Fa,VB as Pa,mV as _a,n2 as La,Rt as _e,bE as st,VC as jt,R4 as Ft,VD as Ba,VE as Oa,VF as Ra,n4 as Ua,VG as ot,VH as lt,VI as it,VJ as ct,VK as Na,n0 as Ma,VL as Ga,n3 as Ja,VM as $a,VN as Pt,RP as _t,mj as Ya,VO as za,VP as Le,VQ as Lt,RN as Bt,Hw as Ka,VR as qa,VS as Wa,mD as Ot,VT as Ha,VU as Qa,R$ as Za,uD as Xa,VV as Rt,VW as dt,RY as Be,VX as rt,VY as en,S1 as tn,VZ as an,V_ as nn,V$ as sn,W0 as on,W1 as ln,uG as cn,W2 as dn,Sq as rn,TZ as un,RG as Oe,i7 as hn,T$ as pn,T_ as mn,i5 as Sn,W3 as fn,W4 as gn,HB as vn,W5 as xn,W6 as Tn,W7 as yn,W8 as Cn,mn as Dn,bn as En,dV as bn,dU as In}from"./zeni-epic-state-DxmmAR38.js";import{a4 as Ce,aM as Ae,aN as kn,z as U,j as Re,a7 as Ut,a8 as X,k as V,av as ee,aO as wn,p as M,G as De,M as ce,aP as An,aQ as Vn,aR as jn,E as Fn,a1 as de,ab as Ze,c as ne,y as z,aS as Pn,Z as Xe,as as me,aT as _n,aU as Nt,aq as Ln,aV as Bn,V as On,aW as Rn,ae as Mt,aX as Un,N as Z,a9 as Nn,af as Gt,ag as Mn,aY as Gn,aZ as Jn,U as et,a_ as $n,a$ as Yn,a3 as zn,b0 as Kn,b1 as qn}from"./index-CKPer1bp.js";import{n as N,D as Wn,S as Jt}from"./mui-DesXezzU.js";import{t as Hn,A as Qn}from"./AddressScreen-Dqyvg_DE.js";import H from"./NotFoundScreen-BPjOFceW.js";import{F as Zn}from"./FeaturePreviewScreen-Crks8H4y.js";import{p as Xn}from"./pathToGoBack-9ah_vxgB.js";import{c as q,v as tt,d as es}from"./routePaths-CpftjCME.js";import{u as Se}from"./useAskAiCfoHostNavButtonProps-CxYBeccP.js";import{M as fe}from"./MobileAppDrawer-CmjsL1eQ.js";import{D as ts}from"./DrawerScreen-BUgCVChB.js";import{a as as,m as ns}from"./accountMappingHelper-CabpVb3J.js";import"./recharts-Co89o1ZO.js";import"./analytics-CsVp7bfq.js";import"./plaid---yWAm21.js";import"./dnd-CR945ANw.js";import"./stripe-cKAAJElX.js";import"./lottie-DgdF8254.js";import"./lexical-CCIwPSwQ.js";import"./pdf-BVKoD2Fp.js";import"./utils-18zApAFM.js";import"./InboxNotificationsProvider-CzhxlkVm.js";import"./useTaskManagerAccess-BMNTpSgs.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]="d26b4b22-caa5-4e3e-9441-00cfe0786269",e._sentryDebugIdIdentifier="sentry-dbid-d26b4b22-caa5-4e3e-9441-00cfe0786269")}catch{}})();function ss(){const{accrualId:e}=R(),a=Y(),s=G(),t=K(),{accrual:n,actionFetchState:o,detailFetchState:d,localData:i}=m((c=>Yt(c,e??""))),u=m((c=>zt(c))),h=m((c=>Q(c))),S=f.useCallback((()=>{const c=Ce(t.state?.pathnameStackToGoBack);s(c.poppedPathname??Xn(4),{state:{pathnameStackToGoBack:c.newStack}})}),[t.state,s]),r=f.useRef(!1);return f.useEffect((()=>{o.fetchState!=="In-Progress"&&r.current&&o.fetchState==="Completed"&&(r.current=!1,S())}),[o.fetchState,S]),f.useEffect((()=>{e!=null&&n==null&&d.fetchState==="Not-Started"&&a(Kt(e))}),[e,n,d.fetchState]),f.useEffect((()=>{a(qt({scheduleType:"prepaid_expenses",shouldResetEnteredData:!1}))}),[a]),e==null?l.jsx(H,{}):n==null?d.fetchState==="Not-Started"||d.fetchState==="In-Progress"?l.jsx(Ae,{}):l.jsx(H,{}):l.jsx(kn,{accrual:n,actionFetchState:o.fetchState,isAccountingClassesEnabled:h,localData:i,newAccrualAccountsView:u,onAccrualFormChange:(c,p)=>{a(Xt({accrualId:c,localData:p}))},onAccrualFormClear:c=>{a(Zt({accrualId:c}))},onApproveAndPost:c=>{a(Qt(e,c))},onNavigateBack:S,onRevert:(c,p)=>{r.current=!0,a(Ht(e,c,p))},onSkip:(c,p)=>{a(Wt(e,c,p))}})}const os=De.getLocalizedStrings(),ls=J((function(e,a){const s=Me(e,a.scheduleTab),t=e.tenantState.currentTenantId;return{authParams:{userId:a.signedInUser.userId??"",sessionId:a.signedInUser.zeniSessionId??"",tenantId:t??""},linkBillExpenseView:s.linkBillExpenseView,transactions:s.linkBillExpenseView.transactions}}),(function(e,a){const{navigate:s,location:t}=a;return{onTransactionSelect(n){e(nt({selectedTransaction:n}))},onBackClick:()=>{s("..",{relative:"path"})},onCancel(){e(nt({selectedTransaction:void 0})),e(ea()),s("..",{relative:"path"})},onTransactionClick:n=>{const o=`${q(n,a.tenantEmailDomain)}`,d=M(t.state?.pathnameStackToGoBack,t.pathname);s(o,{state:{pathnameStackToGoBack:d}})},onLinkSave(){a.setShouldNavigateBack(!1),e(St(a.scheduleTab,a.scheduleAccruedDetailsView.selectedJEAccruedSchedule?.jeScheduleId))}}}))(wn),is=({setShouldNavigateBack:e})=>{const a=G(),s=K(),{scheduleDetailId:t,tenantEmailDomain:n}=R(),{scheduleType:o}=R();if(n==null)throw Error("Can't access Link Bill Expense page without tenant Email Domain");const d=m((g=>L(g))),i=Ee(o)??"accrued_expenses",u=U.getSignedInUser();if(u==null)throw Error("Can't access Link Bill Expensedetail page without signing in...");if(t==null)throw Error("Invalid Schedule Detail Id");const h=m((g=>Me(g,i))),S=h.selectedJELinkRowIndex,r=m((g=>te(g,d.companyId))),c=Re(h.updateStatus.fetchState);f.useEffect((()=>{c==="In-Progress"&&h.updateStatus.fetchState==="Completed"&&a("..",{relative:"path"})}),[c,h.updateStatus.fetchState]),f.useEffect((()=>{h.fetchState==="Not-Started"&&a("..",{relative:"path"})}),[]),f.useEffect((()=>{h.selectedJEAccruedSchedule!=null&&h.selectedJELinkRowIndex!=null||a("..",{relative:"path"})}),[h.selectedJEAccruedSchedule,h.selectedJELinkRowIndex]);const p=h.linkBillExpenseView.fetchState==="Completed";return l.jsx(l.Fragment,{children:h.linkBillExpenseView.fetchState==="In-Progress"?l.jsx(Ut,{fetchState:h.linkBillExpenseView.fetchState}):h.selectedJEAccruedSchedule!=null&&S!=null?l.jsxs(l.Fragment,{children:[p===!0?l.jsx(X,{analytics:V,onLoad:()=>{cs(h,i,r)}}):null,l.jsx(ls,{signedInUser:u,attachmentEndPoint:`${ee}/vendor_attachments`,setShouldNavigateBack:e,scheduleVendorId:h.selectedJEAccruedSchedule.vendor.id??"",location:s,tenantEmailDomain:n,scheduleAccruedDetailsView:h,saveFetchState:h.updateStatus.fetchState,scheduleTab:i,navigate:a,analytics:V,controllerUserDetails:r,saveStatus:h.updateStatus.fetchState,jeAccruedSchedule:h.selectedJEAccruedSchedule,localData:h.scheduleAccruedDetailsLocalData.jeScheduleDetails[S]})]}):null})},$t=e=>{const a=os.dateFormat.analytics.YYYYDashMMDashDDFormat;return{scheduleCreateDate:e.createTime.format(a)??null,scheduleMonthlyAmount:e.recurringAmount??null,startingBalance:e.otherAttributes.startingBalance??null,scheduleAccountCategory:e.jeCredit.account?.accountName??null,description:e.memo,runningBalance:e.balanceAsOfToday??null,currentBalance:e.balanceAsOfToday??null,currentStatus:e.status.label,period:e.period??null,startMonth:e.startDate?.format(a)??null,endMonth:e.endDate?.format(a)??null}},cs=(e,a,s)=>{const t=e.selectedJEAccruedSchedule,n=e.selectedJELinkRowIndex;let o;n!=null&&t!=null&&(o=t.scheduledJournalEntry[n]);const{transactions:d}=e.linkBillExpenseView,i=d.some((S=>S.isRecommendedTransaction===!0)),u=be(s.controllers),h=Ie(s.controllerUserIds);t!=null&&V.trackScheduleAccruedDetailsJournalEntryLinkedLoaded({scheduleType:a,schedule:{...$t(t)},scheduleExpenseCategoryAndClass:{expenseCategory:t.jeDebit.account?.accountName??null,expenseClass:t.jeDebit.accountingClass?.className??null},journalEntryDetails:{wasRecommendationAvailable:i,journalEntryPostingStatus:o?.status.label??""},vendorName:t.vendor.name??null,controllerEmails:u,controllerUserIds:h})},ds=N.div`
2
2
  display: flex;
3
3
  min-height: 100%;
4
4
  width: 100%;
@@ -6,7 +6,7 @@ import{j as l}from"./liveblocks-D0hIH2N0.js";import{a as f}from"./sentry-DhqS_W-
6
6
  flex-direction: column;
7
7
  align-items: center;
8
8
  background-color: ${e=>e.theme.colors.grey4};
9
- `,rs=G((function(e){const a=L(e),s=e.entityAutoCompleteState.autoCompleteText.common,t=Je(e,"common");return{tenantName:a.companyName,vendorSearchAutoCompleteData:{autoCompleteText:s,entityAutoCompleteView:t}}}),(function(e,a){const{navigate:s,location:t}=a,n="accrued_expenses";return{onNavigateBack:()=>{const o=Ce(t.state?.pathnameStackToGoBack);o.poppedPathname==null?s("../schedules/accrued_expenses"):s(o.poppedPathname,{state:{pathnameStackToGoBack:o.newStack}})},onZeniLogoClick:()=>{a.themeState.toggle()},onSave:o=>{a.setShouldNavigateBack(!0),e(St(n,o))},onDelete:o=>{e(ca(n,o))},vendorSearchAutoCompleteActions:{onAutoCompleteInputChange:(o,d)=>{o.trim().length>=2?e(Ge({searchString:o,entityType:d,searchOrigin:"common"})):o.trim().length===0&&e(ue("common"))},onCancelAutoComplete:()=>{e(ue("common"))}},onEditAmount:(o,d)=>{e(ia(n,o,d))},onJELinkClick:o=>{e(la({selectedJELinkRowIndex:o})),s("./edit_link")},onCancelAccrual:(o,d,i)=>{e(oa(o,d,i))},onTransactionClick:o=>{const d=`${q(o,a.tenantEmailDomain)}`,i=M(t.state?.pathnameStackToGoBack,t.pathname);s(d,{state:{pathnameStackToGoBack:i}})},onViewPostedJE:o=>{const d=`${q(o,a.tenantEmailDomain)}`,i=M(t.state?.pathnameStackToGoBack,t.pathname);s(d,{state:{pathnameStackToGoBack:i}})},onViewRecordedJE:o=>{const d=`${q(o,a.tenantEmailDomain)}`,i=M(t.state?.pathnameStackToGoBack,t.pathname);s(d,{state:{pathnameStackToGoBack:i}})},onViewBillExpense:o=>{const d=`${q(o,a.tenantEmailDomain)}`,i=M(t.state?.pathnameStackToGoBack,t.pathname);s(d,{state:{pathnameStackToGoBack:i}})},onDetailPageChange:(o,d,i)=>{const{scheduleDetailsAccruedExpensesSection:u}=o,{amount:h,memo:S,months:r,scheduleAccruedExpenseCategory:c,scheduleClass:p,scheduleExpenseCategory:g,startDate:y,vendor:x}=u,I=p.selectedOption!=null?a.classList.find((b=>b.classId===p.selectedOption)):void 0,D=g.selectedOption!=null?a.accountList.find((b=>b.qboId===g.selectedOption)):void 0,E=c.selectedOption!=null?a.accruedAccountList.find((b=>b.qboId===c.selectedOption)):void 0,w=r?.selectedOption;e(na({scheduleType:n,localData:d,selectedJeScheduleDetailId:a.scheduleDetailId})),i!==!1||a.scheduleDetailId!=null||D?.accountId==null||a.isAccountingClassesEnabled!==!1&&I?.classId==null||E==null||x.selectedOption==null||S==null||h==null&&h==0||y==null||w==null||e(sa({scheduleType:n}))}}}))(An),us=({shouldNavigateBack:e,setShouldNavigateBack:a})=>{const s=J(),t=K(),n=z(),o=ce(),{tenantEmailDomain:d}=O(),[i,u]=f.useState(!1);if(d==null)throw new Error("Can't access this page without a tenantEmailDomain");const{scheduleDetailId:h}=O();let S;h!=="new"&&(S=h);const r=hs(h),c=m((C=>C.scheduleAccruedDetailState.selectedJEAccruedScheduleKey)),p="accrued_expenses",g=m((C=>Me(C,"accrued_expenses"))),y=m((C=>ae(C))),x=m((C=>C.classListState.fetchState)),I=m((C=>W(C))),D=y!=="Completed"||x!=="Completed";f.useEffect((()=>{i===!1&&D?(n(ta(p,S)),u(!0)):D===!1&&i===!1&&h!=="new"&&(n(aa(p,h)),u(!0))}),[i]);const E=m((C=>L(C))),w=m((C=>te(C,E.companyId))),b=g.fetchState,k=g.allAccountList,j=g.allClassList,F=g.allAccruedAccountList,_=g.scheduleAccruedDetailsLocalData;if(r!==!0||g.fetchState==="Error")return l.jsx(Q,{});const A=b==="Completed"&&i===!0;return b!=="Completed"&&b!=="Not-Started"?l.jsx(Ae,{}):l.jsxs(ds,{children:[A===!0?l.jsx(Z,{analytics:V,onLoad:()=>{ps(g,p,w)}}):null,l.jsx(rs,{setShouldNavigateBack:a,scheduleAccruedDetailsView:g,location:t,navigate:s,classList:j,accountList:k,shouldNavigateBack:e,accruedAccountList:F,scheduleLocalData:_,selectedJEScheduleKey:c,scheduleDetailId:S,selectedScheduledJournalEntries:g.selectedJEAccruedSchedule?.scheduledJournalEntry??[],themeState:o,tenantEmailDomain:d,analytics:V,controllerUserDetails:w,isAccountingClassesEnabled:I,status:g.selectedJEAccruedSchedule?.status.code})]})},hs=e=>e!=null,ps=(e,a,s)=>{const t=e.selectedJEAccruedSchedule,n=Ie(s.controllers),o=be(s.controllerUserIds);t!=null&&V.trackScheduleAccruedDetailsLoaded({scheduleType:a,scheduleExpenseCategoryAndClass:{expenseCategory:t.jeDebit.account?.accountName??null,expenseClass:t.jeDebit.accountingClass?.className??null},schedule:{...$t(t)},vendorName:t.vendor.name??null,controllerEmails:n,controllerUserIds:o})},ms=N.div`
9
+ `,rs=J((function(e){const a=L(e),s=e.entityAutoCompleteState.autoCompleteText.common,t=Ge(e,"common");return{tenantName:a.companyName,vendorSearchAutoCompleteData:{autoCompleteText:s,entityAutoCompleteView:t}}}),(function(e,a){const{navigate:s,location:t}=a,n="accrued_expenses";return{onNavigateBack:()=>{const o=Ce(t.state?.pathnameStackToGoBack);o.poppedPathname==null?s("../schedules/accrued_expenses"):s(o.poppedPathname,{state:{pathnameStackToGoBack:o.newStack}})},onZeniLogoClick:()=>{a.themeState.toggle()},onSave:o=>{a.setShouldNavigateBack(!0),e(St(n,o))},onDelete:o=>{e(ca(n,o))},vendorSearchAutoCompleteActions:{onAutoCompleteInputChange:(o,d)=>{o.trim().length>=2?e(Je({searchString:o,entityType:d,searchOrigin:"common"})):o.trim().length===0&&e(ue("common"))},onCancelAutoComplete:()=>{e(ue("common"))}},onEditAmount:(o,d)=>{e(ia(n,o,d))},onJELinkClick:o=>{e(la({selectedJELinkRowIndex:o})),s("./edit_link")},onCancelAccrual:(o,d,i)=>{e(oa(o,d,i))},onTransactionClick:o=>{const d=`${q(o,a.tenantEmailDomain)}`,i=M(t.state?.pathnameStackToGoBack,t.pathname);s(d,{state:{pathnameStackToGoBack:i}})},onViewPostedJE:o=>{const d=`${q(o,a.tenantEmailDomain)}`,i=M(t.state?.pathnameStackToGoBack,t.pathname);s(d,{state:{pathnameStackToGoBack:i}})},onViewRecordedJE:o=>{const d=`${q(o,a.tenantEmailDomain)}`,i=M(t.state?.pathnameStackToGoBack,t.pathname);s(d,{state:{pathnameStackToGoBack:i}})},onViewBillExpense:o=>{const d=`${q(o,a.tenantEmailDomain)}`,i=M(t.state?.pathnameStackToGoBack,t.pathname);s(d,{state:{pathnameStackToGoBack:i}})},onDetailPageChange:(o,d,i)=>{const{scheduleDetailsAccruedExpensesSection:u}=o,{amount:h,memo:S,months:r,scheduleAccruedExpenseCategory:c,scheduleClass:p,scheduleExpenseCategory:g,startDate:y,vendor:x}=u,b=p.selectedOption!=null?a.classList.find((I=>I.classId===p.selectedOption)):void 0,D=g.selectedOption!=null?a.accountList.find((I=>I.qboId===g.selectedOption)):void 0,E=c.selectedOption!=null?a.accruedAccountList.find((I=>I.qboId===c.selectedOption)):void 0,w=r?.selectedOption;e(na({scheduleType:n,localData:d,selectedJeScheduleDetailId:a.scheduleDetailId})),i!==!1||a.scheduleDetailId!=null||D?.accountId==null||a.isAccountingClassesEnabled!==!1&&b?.classId==null||E==null||x.selectedOption==null||S==null||h==null&&h==0||y==null||w==null||e(sa({scheduleType:n}))}}}))(An),us=({shouldNavigateBack:e,setShouldNavigateBack:a})=>{const s=G(),t=K(),n=Y(),o=ce(),{tenantEmailDomain:d}=R(),[i,u]=f.useState(!1);if(d==null)throw new Error("Can't access this page without a tenantEmailDomain");const{scheduleDetailId:h}=R();let S;h!=="new"&&(S=h);const r=hs(h),c=m((C=>C.scheduleAccruedDetailState.selectedJEAccruedScheduleKey)),p="accrued_expenses",g=m((C=>Me(C,"accrued_expenses"))),y=m((C=>ae(C))),x=m((C=>C.classListState.fetchState)),b=m((C=>Q(C))),D=y!=="Completed"||x!=="Completed";f.useEffect((()=>{i===!1&&D?(n(ta(p,S)),u(!0)):D===!1&&i===!1&&h!=="new"&&(n(aa(p,h)),u(!0))}),[i]);const E=m((C=>L(C))),w=m((C=>te(C,E.companyId))),I=g.fetchState,k=g.allAccountList,F=g.allClassList,j=g.allAccruedAccountList,_=g.scheduleAccruedDetailsLocalData;if(r!==!0||g.fetchState==="Error")return l.jsx(H,{});const A=I==="Completed"&&i===!0;return I!=="Completed"&&I!=="Not-Started"?l.jsx(Ae,{}):l.jsxs(ds,{children:[A===!0?l.jsx(X,{analytics:V,onLoad:()=>{ps(g,p,w)}}):null,l.jsx(rs,{setShouldNavigateBack:a,scheduleAccruedDetailsView:g,location:t,navigate:s,classList:F,accountList:k,shouldNavigateBack:e,accruedAccountList:j,scheduleLocalData:_,selectedJEScheduleKey:c,scheduleDetailId:S,selectedScheduledJournalEntries:g.selectedJEAccruedSchedule?.scheduledJournalEntry??[],themeState:o,tenantEmailDomain:d,analytics:V,controllerUserDetails:w,isAccountingClassesEnabled:b,status:g.selectedJEAccruedSchedule?.status.code})]})},hs=e=>e!=null,ps=(e,a,s)=>{const t=e.selectedJEAccruedSchedule,n=be(s.controllers),o=Ie(s.controllerUserIds);t!=null&&V.trackScheduleAccruedDetailsLoaded({scheduleType:a,scheduleExpenseCategoryAndClass:{expenseCategory:t.jeDebit.account?.accountName??null,expenseClass:t.jeDebit.accountingClass?.className??null},schedule:{...$t(t)},vendorName:t.vendor.name??null,controllerEmails:n,controllerUserIds:o})},ms=N.div`
10
10
  display: flex;
11
11
  min-height: 100%;
12
12
  width: 100%;
@@ -14,7 +14,7 @@ import{j as l}from"./liveblocks-D0hIH2N0.js";import{a as f}from"./sentry-DhqS_W-
14
14
  flex-direction: column;
15
15
  align-items: center;
16
16
  background-color: ${e=>e.theme.colors.grey4};
17
- `,Re=De.getLocalizedStrings().dateFormat.analytics.YYYYDashMMDashDDFormat,Ss=G((function(e){const a=L(e),s=he(e,"fixed_assets");return{tenantName:a.companyName,scheduleDetailsView:s}}),(function(e,a){const{navigate:s,location:t,vendorSearchAutoCompleteData:n,selectedScheduledJournalEntries:o}=a,d="fixed_assets",i=o.flatMap((u=>u.error)).filter((u=>!!u))??[];return{onNavigateBack:()=>{const u=Ce(a.location.state?.pathnameStackToGoBack);u.poppedPathname==null?s("../schedules/fixed_assets"):a.navigate(u.poppedPathname,{state:{pathnameStackToGoBack:u.newStack}})},onZeniLogoClick:()=>{a.themeState.toggle()},onSave:u=>{e($e(d,u,i.length>0))},onDelete:u=>{e(bt(d,u))},onMarkAsComplete:()=>{a.selectedJEScheduleKey!=null&&e(It(d,a.selectedJEScheduleKey))},onEditAmount:(u,h)=>{e(Et(d,u,h))},onJELinkClick:u=>{e(Dt({selectedJELinkRowIndex:u})),s("./edit_link")},onTransactionClick:u=>{const h=`${q(u,a.tenantEmailDomain)}`,S=M(t.state?.pathnameStackToGoBack,t.pathname);s(h,{state:{pathnameStackToGoBack:S,message:"comingFromScheduleDetailsFixedAssets"}})},onViewLinkedJE:u=>{const h=`${q(u,a.tenantEmailDomain)}`,S=M(t.state?.pathnameStackToGoBack,t.pathname);s(h,{state:{pathnameStackToGoBack:S}})},vendorSearchAutoCompleteActions:{onAutoCompleteInputChange:(u,h)=>{u.trim().length>=2?e(Ge({searchString:u,entityType:h,searchOrigin:"common"})):u.trim().length===0&&e(ue("common"))},onCancelAutoComplete:()=>{e(ue("common"))}},onDetailPageChange:(u,h)=>{const{scheduleDetailsFixedAssetsSection:S,scheduleDetailsListSection:r}=u,{scheduleClass:c,scheduleExpenseCategory:p,accumulatedDepreciationCategory:g,assetId:y,months:x,startDate:I,postingDate:D,vendor:E}=S,w=n.entityAutoCompleteView.vendor.length>0?n.entityAutoCompleteView.vendor.find((v=>v.id===E?.selectedOption)):void 0,b={id:w?.zeniId??E?.selectedOption??"",name:w?.name??E?.defaultOptions.find((v=>v.value===E?.selectedOption))?.label??"",logo:w?.logo},k=c.selectedOption!=null?a.classList.find((v=>v.classId===c.selectedOption)):void 0,j=p.selectedOption!=null?a.accountList.find((v=>v.qboId===p.selectedOption)):void 0,F=g.selectedOption!=null?a.depAccountList.find((v=>v.qboId===g.selectedOption)):void 0,_=x?.selectedOption,A=r.map(((v,T)=>({...a.scheduleLocalData.jeScheduleDetails[T],amount:{...a.scheduleLocalData.jeScheduleDetails[T].amount,amount:v.amount}}))),C=D.type==="day"?D.dayOfMonth?D.dayOfMonth:1:void 0,P=D.type==="lastDayOfMonth"||void 0;e(yt({scheduleType:d,localData:{selectedAccount:j?.accountId,selectedClass:k?.classId,selectedAccumulatedDepreciationCategory:F?.accountId,selectedDate:I,selectedMonths:_,assetId:y,jeScheduleDetails:A,lastDayOfMonth:P,selectedDayOfMonth:C,selectedVendor:b},selectedJeScheduleDetailId:a.scheduleDetailId})),h!==!1||F?.accountId==null||a.scheduleDetailId!=null&&a.status!=="draft"&&a.status!=="marked_as_completed"||j?.accountId==null||a.isAccountingClassesEnabled!==!1&&k?.classId==null||I==null||_==null||P!==!0&&C==null||e(Ct({scheduleType:d}))}}}))(Vn),fs=()=>{const e=J(),a=K(),s=z(),t=ce(),{tenantEmailDomain:n}=O(),[o,d]=f.useState(!1),{scheduleDetailId:i}=O(),u=a.state?.message==="expenseAutomation",h=gs(i),S=m((v=>v.scheduleDetailState.selectedJEScheduleKey));f.useEffect((()=>{S!=null&&S.length!==0||i!=="new"||e("../schedules/fixed_assets")}),[S,i]);const r="fixed_assets",c=m((v=>he(v,r))),p=m((v=>v.entityAutoCompleteState.autoCompleteText.common)),g=m((v=>Je(v,"common"))),y=m((v=>ae(v))),x=m((v=>v.classListState.fetchState)),I=m((v=>W(v))),D=m((v=>ft(v).selectedPeriod)),E=y!=="Completed"||x!=="Completed";f.useEffect((()=>{o===!1&&E?(s(gt(r,C,!0)),d(!0)):E===!1&&o===!1&&(s(vt(r,i==="new"?void 0:i,!0)),d(!0))}),[o]),f.useEffect((()=>{if(c.markAsCompleteStatus.fetchState==="Completed")if(s(xt()),u===!0){const{month:v,year:T}=D;e(`../../month_end_close_checks/review/je_schedules/${v}-${T}`)}else e("../schedules/fixed_assets")}),[c.markAsCompleteStatus.fetchState]);const w=m((v=>L(v))),b=m((v=>te(v,w.companyId))),k=c.fetchState,j=c.allAccountList,F=c.allClassList,_=c.allDepreciationAccountList,A=c.scheduleDetailsLocalData.fixed_assets;let C;if(i!=="new"&&(C=i),h!==!0||c.fetchState==="Error")return l.jsx(Q,{});const P=k==="Completed"&&o===!0;return k!=="Completed"?l.jsx(Ae,{}):l.jsxs(ms,{children:[P===!0?l.jsx(Z,{analytics:V,onLoad:()=>{xs(c,r,b)}}):null,l.jsx(Ss,{location:a,navigate:e,classList:F,vendorSearchEntityAutoCompleteView:g,vendorSearchAutoCompleteData:{autoCompleteText:p,entityAutoCompleteView:g},expenseAutomationSelectedPeriod:D,usedInExpenseAutomation:u,removeJeScheduleTransactionKey:(v,T)=>{s(Tt(v,T))},accountList:j,depAccountList:_,scheduleLocalData:A,selectedJEScheduleKey:S,scheduleDetailId:C,selectedScheduledJournalEntries:c.selectedJEScheduleTransaction?.scheduledJournalEntry??[],themeState:t,tenantEmailDomain:n,analytics:V,controllerUserDetails:b,isAccountingClassesEnabled:I,status:c.selectedJEScheduleTransaction?.status.code})]})},gs=e=>e!=null,vs=e=>({transactionDate:e.date.format(Re),transactionAmount:e.amount,scheduleCategory:e.account.accountName,scheduleClass:e.classBase?.className??null,description:e.memo}),xs=(e,a,s)=>{const t=e.selectedJEScheduleTransaction?.baseTransaction,n=e.selectedJEScheduleTransaction,o=Ie(s.controllers),d=be(s.controllerUserIds);var i;t!=null&&n!=null&&V.trackScheduleDetailsLoaded({scheduleType:a,transaction:{...vs(t)},scheduleExpenseCategoryAndClass:{expenseCategory:n.jeDebit.account?.accountName??null,expenseClass:n.jeDebit.accountingClass?.className??null},scheduledTransaction:{...(i=n,{currentBalance:i.balanceAsOfToday??null,currentStatus:i.status.label,period:i.period??null,startMonth:i.startDate?.format(Re)??null,endMonth:i.endDate?.format(Re)??null})},vendorName:n.vendor.name??null,fixedAssetsDetails:{accumulatedDepreciationCategory:n.jeCredit.account?.accountName??null,assetId:n.otherAttributes.assetId??null},controllerEmails:o,controllerUserIds:d})},Ts=N.div`
17
+ `,Ue=De.getLocalizedStrings().dateFormat.analytics.YYYYDashMMDashDDFormat,Ss=J((function(e){const a=L(e),s=he(e,"fixed_assets");return{tenantName:a.companyName,scheduleDetailsView:s}}),(function(e,a){const{navigate:s,location:t,vendorSearchAutoCompleteData:n,selectedScheduledJournalEntries:o}=a,d="fixed_assets",i=o.flatMap((u=>u.error)).filter((u=>!!u))??[];return{onNavigateBack:()=>{const u=Ce(a.location.state?.pathnameStackToGoBack);u.poppedPathname==null?s("../schedules/fixed_assets"):a.navigate(u.poppedPathname,{state:{pathnameStackToGoBack:u.newStack}})},onZeniLogoClick:()=>{a.themeState.toggle()},onSave:u=>{e($e(d,u,i.length>0))},onDelete:u=>{e(It(d,u))},onMarkAsComplete:()=>{a.selectedJEScheduleKey!=null&&e(bt(d,a.selectedJEScheduleKey))},onEditAmount:(u,h)=>{e(Et(d,u,h))},onJELinkClick:u=>{e(Dt({selectedJELinkRowIndex:u})),s("./edit_link")},onTransactionClick:u=>{const h=`${q(u,a.tenantEmailDomain)}`,S=M(t.state?.pathnameStackToGoBack,t.pathname);s(h,{state:{pathnameStackToGoBack:S,message:"comingFromScheduleDetailsFixedAssets"}})},onViewLinkedJE:u=>{const h=`${q(u,a.tenantEmailDomain)}`,S=M(t.state?.pathnameStackToGoBack,t.pathname);s(h,{state:{pathnameStackToGoBack:S}})},vendorSearchAutoCompleteActions:{onAutoCompleteInputChange:(u,h)=>{u.trim().length>=2?e(Je({searchString:u,entityType:h,searchOrigin:"common"})):u.trim().length===0&&e(ue("common"))},onCancelAutoComplete:()=>{e(ue("common"))}},onDetailPageChange:(u,h)=>{const{scheduleDetailsFixedAssetsSection:S,scheduleDetailsListSection:r}=u,{scheduleClass:c,scheduleExpenseCategory:p,accumulatedDepreciationCategory:g,assetId:y,months:x,startDate:b,postingDate:D,vendor:E}=S,w=n.entityAutoCompleteView.vendor.length>0?n.entityAutoCompleteView.vendor.find((v=>v.id===E?.selectedOption)):void 0,I={id:w?.zeniId??E?.selectedOption??"",name:w?.name??E?.defaultOptions.find((v=>v.value===E?.selectedOption))?.label??"",logo:w?.logo},k=c.selectedOption!=null?a.classList.find((v=>v.classId===c.selectedOption)):void 0,F=p.selectedOption!=null?a.accountList.find((v=>v.qboId===p.selectedOption)):void 0,j=g.selectedOption!=null?a.depAccountList.find((v=>v.qboId===g.selectedOption)):void 0,_=x?.selectedOption,A=r.map(((v,T)=>({...a.scheduleLocalData.jeScheduleDetails[T],amount:{...a.scheduleLocalData.jeScheduleDetails[T].amount,amount:v.amount}}))),C=D.type==="day"?D.dayOfMonth?D.dayOfMonth:1:void 0,P=D.type==="lastDayOfMonth"||void 0;e(yt({scheduleType:d,localData:{selectedAccount:F?.accountId,selectedClass:k?.classId,selectedAccumulatedDepreciationCategory:j?.accountId,selectedDate:b,selectedMonths:_,assetId:y,jeScheduleDetails:A,lastDayOfMonth:P,selectedDayOfMonth:C,selectedVendor:I},selectedJeScheduleDetailId:a.scheduleDetailId})),h!==!1||j?.accountId==null||a.scheduleDetailId!=null&&a.status!=="draft"&&a.status!=="marked_as_completed"||F?.accountId==null||a.isAccountingClassesEnabled!==!1&&k?.classId==null||b==null||_==null||P!==!0&&C==null||e(Ct({scheduleType:d}))}}}))(Vn),fs=()=>{const e=G(),a=K(),s=Y(),t=ce(),{tenantEmailDomain:n}=R(),[o,d]=f.useState(!1),{scheduleDetailId:i}=R(),u=a.state?.message==="expenseAutomation",h=gs(i),S=m((v=>v.scheduleDetailState.selectedJEScheduleKey));f.useEffect((()=>{S!=null&&S.length!==0||i!=="new"||e("../schedules/fixed_assets")}),[S,i]);const r="fixed_assets",c=m((v=>he(v,r))),p=m((v=>v.entityAutoCompleteState.autoCompleteText.common)),g=m((v=>Ge(v,"common"))),y=m((v=>ae(v))),x=m((v=>v.classListState.fetchState)),b=m((v=>Q(v))),D=m((v=>ft(v).selectedPeriod)),E=y!=="Completed"||x!=="Completed";f.useEffect((()=>{o===!1&&E?(s(gt(r,C,!0)),d(!0)):E===!1&&o===!1&&(s(vt(r,i==="new"?void 0:i,!0)),d(!0))}),[o]),f.useEffect((()=>{if(c.markAsCompleteStatus.fetchState==="Completed")if(s(xt()),u===!0){const{month:v,year:T}=D;e(`../../month_end_close_checks/review/je_schedules/${v}-${T}`)}else e("../schedules/fixed_assets")}),[c.markAsCompleteStatus.fetchState]);const w=m((v=>L(v))),I=m((v=>te(v,w.companyId))),k=c.fetchState,F=c.allAccountList,j=c.allClassList,_=c.allDepreciationAccountList,A=c.scheduleDetailsLocalData.fixed_assets;let C;if(i!=="new"&&(C=i),h!==!0||c.fetchState==="Error")return l.jsx(H,{});const P=k==="Completed"&&o===!0;return k!=="Completed"?l.jsx(Ae,{}):l.jsxs(ms,{children:[P===!0?l.jsx(X,{analytics:V,onLoad:()=>{xs(c,r,I)}}):null,l.jsx(Ss,{location:a,navigate:e,classList:j,vendorSearchEntityAutoCompleteView:g,vendorSearchAutoCompleteData:{autoCompleteText:p,entityAutoCompleteView:g},expenseAutomationSelectedPeriod:D,usedInExpenseAutomation:u,removeJeScheduleTransactionKey:(v,T)=>{s(Tt(v,T))},accountList:F,depAccountList:_,scheduleLocalData:A,selectedJEScheduleKey:S,scheduleDetailId:C,selectedScheduledJournalEntries:c.selectedJEScheduleTransaction?.scheduledJournalEntry??[],themeState:t,tenantEmailDomain:n,analytics:V,controllerUserDetails:I,isAccountingClassesEnabled:b,status:c.selectedJEScheduleTransaction?.status.code})]})},gs=e=>e!=null,vs=e=>({transactionDate:e.date.format(Ue),transactionAmount:e.amount,scheduleCategory:e.account.accountName,scheduleClass:e.classBase?.className??null,description:e.memo}),xs=(e,a,s)=>{const t=e.selectedJEScheduleTransaction?.baseTransaction,n=e.selectedJEScheduleTransaction,o=be(s.controllers),d=Ie(s.controllerUserIds);var i;t!=null&&n!=null&&V.trackScheduleDetailsLoaded({scheduleType:a,transaction:{...vs(t)},scheduleExpenseCategoryAndClass:{expenseCategory:n.jeDebit.account?.accountName??null,expenseClass:n.jeDebit.accountingClass?.className??null},scheduledTransaction:{...(i=n,{currentBalance:i.balanceAsOfToday??null,currentStatus:i.status.label,period:i.period??null,startMonth:i.startDate?.format(Ue)??null,endMonth:i.endDate?.format(Ue)??null})},vendorName:n.vendor.name??null,fixedAssetsDetails:{accumulatedDepreciationCategory:n.jeCredit.account?.accountName??null,assetId:n.otherAttributes.assetId??null},controllerEmails:o,controllerUserIds:d})},Ts=N.div`
18
18
  display: flex;
19
19
  min-height: 100%;
20
20
  width: 100%;
@@ -22,11 +22,11 @@ import{j as l}from"./liveblocks-D0hIH2N0.js";import{a as f}from"./sentry-DhqS_W-
22
22
  flex-direction: column;
23
23
  align-items: center;
24
24
  background-color: ${e=>e.theme.colors.grey4};
25
- `,Ne=De.getLocalizedStrings().dateFormat.analytics.YYYYDashMMDashDDFormat,ys=G((function(e,a){const s=L(e),t=he(e,a.scheduleTab);return{tenantName:s.companyName,scheduleDetailsView:t}}),(function(e,a){const{navigate:s,location:t,vendorSearchAutoCompleteData:n,selectedScheduledJournalEntries:o}=a,d=o.flatMap((i=>i.error)).filter((i=>!!i))??[];return{onNavigateBack:()=>{const i=Ce(a.location.state?.pathnameStackToGoBack);i.poppedPathname==null?s("../schedules/prepaid_expenses"):a.navigate(i.poppedPathname,{state:{pathnameStackToGoBack:i.newStack}})},onZeniLogoClick:()=>{a.themeState.toggle()},onSave:i=>{e($e(a.scheduleTab,i,d.length>0))},onDelete:i=>{e(bt(a.scheduleTab,i))},onMarkAsComplete:()=>{a.selectedJEScheduleKey!=null&&e(It(a.scheduleTab,a.selectedJEScheduleKey))},onEditAmount:(i,u)=>{e(Et(a.scheduleTab,i,u))},onJELinkClick:i=>{e(Dt({selectedJELinkRowIndex:i})),s("./edit_link")},onTransactionClick:i=>{const u=`${q(i,a.tenantEmailDomain)}`,h=M(t.state?.pathnameStackToGoBack,t.pathname);s(u,{state:{pathnameStackToGoBack:h,message:"comingFromScheduleDetails"}})},onViewLinkedJE:i=>{const u=`${q(i,a.tenantEmailDomain)}`,h=M(t.state?.pathnameStackToGoBack,t.pathname);s(u,{state:{pathnameStackToGoBack:h}})},vendorSearchAutoCompleteActions:{onAutoCompleteInputChange:(i,u)=>{i.trim().length>=2?e(Ge({searchString:i,entityType:u,searchOrigin:"common"})):i.trim().length===0&&e(ue("common"))},onCancelAutoComplete:()=>{e(ue("common"))}},onDetailPageChange:(i,u)=>{const{scheduleDetailsSection:h,scheduleDetailsListSection:S}=i,{scheduleClass:r,scheduleExpenseCategory:c,months:p,startDate:g,postingDate:y,vendor:x}=h,I=n.entityAutoCompleteView.vendor.length>0?n.entityAutoCompleteView.vendor.find((A=>A.id===x?.selectedOption)):void 0,D={id:I?.zeniId??x?.selectedOption??"",name:I?.name??x?.defaultOptions.find((A=>A.value===x?.selectedOption))?.label??"",logo:I?.logo},E=r.selectedOption!=null?a.classList.find((A=>A.classId===r.selectedOption)):void 0,w=c.selectedOption!=null?a.accountList.find((A=>A.qboId===c.selectedOption)):void 0,b=p?.selectedOption,k=S.map(((A,C)=>({...a.scheduleLocalData.jeScheduleDetails[C],amount:{...a.scheduleLocalData.jeScheduleDetails[C].amount,amount:A.amount}}))),j=y.type==="day"?y.dayOfMonth?y.dayOfMonth:1:void 0,F=y.type==="lastDayOfMonth"||void 0,_={selectedAccount:w?.accountId,selectedClass:E?.classId,selectedDate:g,selectedMonths:b,jeScheduleDetails:k,lastDayOfMonth:F,selectedVendor:D,selectedDayOfMonth:j};e(yt({scheduleType:a.scheduleTab,localData:_,selectedJeScheduleDetailId:a.scheduleDetailId})),u!==!1||a.scheduleDetailId!=null&&a.status!=="draft"&&a.status!=="marked_as_completed"||w?.accountId==null||a.isAccountingClassesEnabled!==!1&&E?.classId==null||g==null||b==null||F!==!0&&j==null||e(Ct({scheduleType:a.scheduleTab}))}}}))(Fn),Cs=()=>{const e=J(),a=K(),s=z(),t=ce(),{tenantEmailDomain:n}=O(),[o,d]=f.useState(!1),i=a.state?.message==="expenseAutomation",{scheduleType:u,scheduleDetailId:h}=O(),S=Ds(u,h),r=m((v=>v.scheduleDetailState.selectedJEScheduleKey));f.useEffect((()=>{r!=null&&r.length!==0||h!=="new"||e("../schedules/prepaid_expenses")}),[r,h]);const c=Ee(u)??"prepaid_expenses",p=m((v=>he(v,c))),g=m((v=>v.entityAutoCompleteState.autoCompleteText.common)),y=m((v=>Je(v,"common"))),x=m((v=>ae(v))),I=m((v=>v.classListState.fetchState)),D=m((v=>W(v))),E=m((v=>ft(v).selectedPeriod)),w=x!=="Completed"||I!=="Completed";f.useEffect((()=>{o===!1&&w?(s(gt(c,C,!0)),d(!0)):w===!1&&o===!1&&(s(vt(c,h==="new"?void 0:h,!0)),d(!0))}),[o]),f.useEffect((()=>{if(p.markAsCompleteStatus.fetchState==="Completed")if(s(xt()),i===!0){const{month:v,year:T}=E;e(`../../month_end_close_checks/review/je_schedules/${v}-${T}`)}else e("../schedules/prepaid_expenses")}),[p.markAsCompleteStatus.fetchState]);const b=m((v=>L(v))),k=m((v=>te(v,b.companyId))),j=p.fetchState,F=p.allAccountList,_=p.allClassList,A=p.scheduleDetailsLocalData;let C;if(h!=="new"&&(C=h),S!==!0||p.fetchState==="Error")return l.jsx(Q,{});const P=j==="Completed"&&o===!0;return j!=="Completed"?l.jsx(Ae,{}):l.jsxs(Ts,{children:[P===!0?l.jsx(Z,{analytics:V,onLoad:()=>{Is(p,c,k)}}):null,l.jsx(ys,{location:a,vendorSearchEntityAutoCompleteView:y,vendorSearchAutoCompleteData:{autoCompleteText:g,entityAutoCompleteView:y},usedInExpenseAutomation:i,removeJeScheduleTransactionKey:(v,T)=>{s(Tt(v,T))},expenseAutomationSelectedPeriod:E,navigate:e,classList:_,accountList:F,scheduleLocalData:A[c],selectedJEScheduleKey:r,scheduleDetailId:C,selectedScheduledJournalEntries:p.selectedJEScheduleTransaction?.scheduledJournalEntry??[],themeState:t,tenantEmailDomain:n,scheduleTab:c,analytics:V,controllerUserDetails:k,isAccountingClassesEnabled:D,status:p.selectedJEScheduleTransaction?.status.code})]})},Ds=(e,a)=>Ee(e)!=null&&a!=null,Es=e=>({transactionDate:e.date.format(Ne),transactionAmount:e.amount,scheduleCategory:e.account.accountName,scheduleClass:e.classBase?.className??null,description:e.memo}),Is=(e,a,s)=>{const t=e.selectedJEScheduleTransaction?.baseTransaction,n=e.selectedJEScheduleTransaction,o=Ie(s.controllers),d=be(s.controllerUserIds);var i;t!=null&&n!=null&&V.trackScheduleDetailsLoaded({scheduleType:a,transaction:{...Es(t)},scheduleExpenseCategoryAndClass:{expenseCategory:n.jeDebit.account?.accountName??null,expenseClass:n.jeDebit.accountingClass?.className??null},scheduledTransaction:{...(i=n,{currentBalance:i.balanceAsOfToday??null,currentStatus:i.status.label,period:i.period??null,startMonth:i.startDate?.format(Ne)??null,endMonth:i.endDate?.format(Ne)??null})},vendorName:n.vendor.name??null,controllerEmails:o,controllerUserIds:d})},bs={drawerLeftMargin:new Xe(0,0,100,200)},ks=G((function(e,a){const{jeScheduledTransaction:s,selectedJERow:t,scheduleType:n,isVendorBulkUpdateOnTransactionEnabled:o}=a,{scheduleDetailsLocalData:d,updateStatus:i}=he(e,a.scheduleType),u=L(e),h=d[n].jeScheduleDetails[t].jeLink,S=h.type==="recommended"?h.recommendedTransactionID:h.transactionDetailID,r=S!=null?ra(e,S):void 0,c=R.getSignedInUser(),p=e.tenantState.currentTenantId,g={userId:c?.userId??"",sessionId:c?.zeniSessionId??"",tenantId:u.tenantId??p},y=u?.company?.companyInfo?.firstMonthOfFY??1;return{jeScheduledTransaction:s,transactionDetail:r,localData:d[n].jeScheduleDetails[t],saveStatus:i.fetchState,authParams:g,isVendorBulkUpdateOnTransactionEnabled:o,firstMonthOfFY:y,isDisabled:i.fetchState==="In-Progress"?"readonly":void 0,analytics:V,qboAppUrl:ua(Ze.qboRedirectionUrl)}}),(function(e,a){const{selectedJERow:s,jeScheduleDetailId:t,navigate:n}=a;return{onUpdateLocalData:o=>{const d=o.linkJETransaction.qboURL;d!=null&&e(pa({scheduleType:a.scheduleType,jeScheduleDetailId:t,rowId:s,jeLink:d}))},onFetchTransactionClick:o=>{e(kt(o))},onSaveClick:()=>{e($e(a.scheduleType,t))},onBackClick:()=>{n("..",{relative:"path"})},onCancelClick:()=>{const o=a.jeScheduledTransaction.scheduledJournalEntry[s];e(ha({scheduleType:a.scheduleType,jeScheduleDetailId:t,rowId:s,originalScheduledJE:o})),n("..",{relative:"path"})}}}))(Pn),ws=()=>{const e=jn(),a=J(),s=z(),{scheduleDetailId:t}=O(),n=de(),o=bs.drawerLeftMargin.valuePx(n),{scheduleType:d}=O(),{useFeatureGate:i}=ne(),{isFeatureEnabled:u}=i(Y.isVendorBulkUpdateOnTransactionEnabled),h=Ee(d)??"prepaid_expenses",[S,r]=f.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 c=m((D=>he(D,h)));f.useEffect((()=>{c.fetchState==="Not-Started"&&a("..",{relative:"path"})}),[]);const p=c.selectedJELinkRowIndex,g=p!=null?c.scheduleDetailsLocalData[h].jeScheduleDetails[p]?.jeLink:null,y=g?.type==="recommended"?g.recommendedTransactionID:g?.transactionDetailID;f.useEffect((()=>{y!=null&&s(kt(y))}),[]),f.useEffect((()=>{g?.type==="recommended"&&S===!1&&p!=null&&(r(!0),s(da({scheduleType:h,jeScheduleDetailId:t,rowId:p})))}));const x=m((D=>L(D))),I=m((D=>te(D,x.companyId)));return l.jsx(Hn,{anchor:"right",open:!0,PaperProps:{style:{width:`calc(100% - ${o})`,boxShadow:"none"}},slotProps:{backdrop:{style:{backgroundColor:e.colors.black,opacity:.75,cursor:"pointer"}}},onClose:()=>a("..",{relative:"path"}),children:l.jsx(As,{onClick:D=>D.stopPropagation(),children:c.fetchState!=="Completed"||c.selectedJEScheduleTransaction==null||p==null?l.jsx(Rt,{fetchState:c.fetchState}):l.jsx(ks,{scheduleType:h,jeScheduleDetailId:t,selectedJERow:p,jeScheduledTransaction:c.selectedJEScheduleTransaction,isCOTEnabled:!1,navigate:a,scheduleTab:h,controllerUserDetails:I,isVendorBulkUpdateOnTransactionEnabled:u})})})},As=N(Gt)`
25
+ `,Ne=De.getLocalizedStrings().dateFormat.analytics.YYYYDashMMDashDDFormat,ys=J((function(e,a){const s=L(e),t=he(e,a.scheduleTab);return{tenantName:s.companyName,scheduleDetailsView:t}}),(function(e,a){const{navigate:s,location:t,vendorSearchAutoCompleteData:n,selectedScheduledJournalEntries:o}=a,d=o.flatMap((i=>i.error)).filter((i=>!!i))??[];return{onNavigateBack:()=>{const i=Ce(a.location.state?.pathnameStackToGoBack);i.poppedPathname==null?s("../schedules/prepaid_expenses"):a.navigate(i.poppedPathname,{state:{pathnameStackToGoBack:i.newStack}})},onZeniLogoClick:()=>{a.themeState.toggle()},onSave:i=>{e($e(a.scheduleTab,i,d.length>0))},onDelete:i=>{e(It(a.scheduleTab,i))},onMarkAsComplete:()=>{a.selectedJEScheduleKey!=null&&e(bt(a.scheduleTab,a.selectedJEScheduleKey))},onEditAmount:(i,u)=>{e(Et(a.scheduleTab,i,u))},onJELinkClick:i=>{e(Dt({selectedJELinkRowIndex:i})),s("./edit_link")},onTransactionClick:i=>{const u=`${q(i,a.tenantEmailDomain)}`,h=M(t.state?.pathnameStackToGoBack,t.pathname);s(u,{state:{pathnameStackToGoBack:h,message:"comingFromScheduleDetails"}})},onViewLinkedJE:i=>{const u=`${q(i,a.tenantEmailDomain)}`,h=M(t.state?.pathnameStackToGoBack,t.pathname);s(u,{state:{pathnameStackToGoBack:h}})},vendorSearchAutoCompleteActions:{onAutoCompleteInputChange:(i,u)=>{i.trim().length>=2?e(Je({searchString:i,entityType:u,searchOrigin:"common"})):i.trim().length===0&&e(ue("common"))},onCancelAutoComplete:()=>{e(ue("common"))}},onDetailPageChange:(i,u)=>{const{scheduleDetailsSection:h,scheduleDetailsListSection:S}=i,{scheduleClass:r,scheduleExpenseCategory:c,months:p,startDate:g,postingDate:y,vendor:x}=h,b=n.entityAutoCompleteView.vendor.length>0?n.entityAutoCompleteView.vendor.find((A=>A.id===x?.selectedOption)):void 0,D={id:b?.zeniId??x?.selectedOption??"",name:b?.name??x?.defaultOptions.find((A=>A.value===x?.selectedOption))?.label??"",logo:b?.logo},E=r.selectedOption!=null?a.classList.find((A=>A.classId===r.selectedOption)):void 0,w=c.selectedOption!=null?a.accountList.find((A=>A.qboId===c.selectedOption)):void 0,I=p?.selectedOption,k=S.map(((A,C)=>({...a.scheduleLocalData.jeScheduleDetails[C],amount:{...a.scheduleLocalData.jeScheduleDetails[C].amount,amount:A.amount}}))),F=y.type==="day"?y.dayOfMonth?y.dayOfMonth:1:void 0,j=y.type==="lastDayOfMonth"||void 0,_={selectedAccount:w?.accountId,selectedClass:E?.classId,selectedDate:g,selectedMonths:I,jeScheduleDetails:k,lastDayOfMonth:j,selectedVendor:D,selectedDayOfMonth:F};e(yt({scheduleType:a.scheduleTab,localData:_,selectedJeScheduleDetailId:a.scheduleDetailId})),u!==!1||a.scheduleDetailId!=null&&a.status!=="draft"&&a.status!=="marked_as_completed"||w?.accountId==null||a.isAccountingClassesEnabled!==!1&&E?.classId==null||g==null||I==null||j!==!0&&F==null||e(Ct({scheduleType:a.scheduleTab}))}}}))(jn),Cs=()=>{const e=G(),a=K(),s=Y(),t=ce(),{tenantEmailDomain:n}=R(),[o,d]=f.useState(!1),i=a.state?.message==="expenseAutomation",{scheduleType:u,scheduleDetailId:h}=R(),S=Ds(u,h),r=m((v=>v.scheduleDetailState.selectedJEScheduleKey));f.useEffect((()=>{r!=null&&r.length!==0||h!=="new"||e("../schedules/prepaid_expenses")}),[r,h]);const c=Ee(u)??"prepaid_expenses",p=m((v=>he(v,c))),g=m((v=>v.entityAutoCompleteState.autoCompleteText.common)),y=m((v=>Ge(v,"common"))),x=m((v=>ae(v))),b=m((v=>v.classListState.fetchState)),D=m((v=>Q(v))),E=m((v=>ft(v).selectedPeriod)),w=x!=="Completed"||b!=="Completed";f.useEffect((()=>{o===!1&&w?(s(gt(c,C,!0)),d(!0)):w===!1&&o===!1&&(s(vt(c,h==="new"?void 0:h,!0)),d(!0))}),[o]),f.useEffect((()=>{if(p.markAsCompleteStatus.fetchState==="Completed")if(s(xt()),i===!0){const{month:v,year:T}=E;e(`../../month_end_close_checks/review/je_schedules/${v}-${T}`)}else e("../schedules/prepaid_expenses")}),[p.markAsCompleteStatus.fetchState]);const I=m((v=>L(v))),k=m((v=>te(v,I.companyId))),F=p.fetchState,j=p.allAccountList,_=p.allClassList,A=p.scheduleDetailsLocalData;let C;if(h!=="new"&&(C=h),S!==!0||p.fetchState==="Error")return l.jsx(H,{});const P=F==="Completed"&&o===!0;return F!=="Completed"?l.jsx(Ae,{}):l.jsxs(Ts,{children:[P===!0?l.jsx(X,{analytics:V,onLoad:()=>{bs(p,c,k)}}):null,l.jsx(ys,{location:a,vendorSearchEntityAutoCompleteView:y,vendorSearchAutoCompleteData:{autoCompleteText:g,entityAutoCompleteView:y},usedInExpenseAutomation:i,removeJeScheduleTransactionKey:(v,T)=>{s(Tt(v,T))},expenseAutomationSelectedPeriod:E,navigate:e,classList:_,accountList:j,scheduleLocalData:A[c],selectedJEScheduleKey:r,scheduleDetailId:C,selectedScheduledJournalEntries:p.selectedJEScheduleTransaction?.scheduledJournalEntry??[],themeState:t,tenantEmailDomain:n,scheduleTab:c,analytics:V,controllerUserDetails:k,isAccountingClassesEnabled:D,status:p.selectedJEScheduleTransaction?.status.code})]})},Ds=(e,a)=>Ee(e)!=null&&a!=null,Es=e=>({transactionDate:e.date.format(Ne),transactionAmount:e.amount,scheduleCategory:e.account.accountName,scheduleClass:e.classBase?.className??null,description:e.memo}),bs=(e,a,s)=>{const t=e.selectedJEScheduleTransaction?.baseTransaction,n=e.selectedJEScheduleTransaction,o=be(s.controllers),d=Ie(s.controllerUserIds);var i;t!=null&&n!=null&&V.trackScheduleDetailsLoaded({scheduleType:a,transaction:{...Es(t)},scheduleExpenseCategoryAndClass:{expenseCategory:n.jeDebit.account?.accountName??null,expenseClass:n.jeDebit.accountingClass?.className??null},scheduledTransaction:{...(i=n,{currentBalance:i.balanceAsOfToday??null,currentStatus:i.status.label,period:i.period??null,startMonth:i.startDate?.format(Ne)??null,endMonth:i.endDate?.format(Ne)??null})},vendorName:n.vendor.name??null,controllerEmails:o,controllerUserIds:d})},Is={drawerLeftMargin:new Ze(0,0,100,200)},ks=J((function(e,a){const{jeScheduledTransaction:s,selectedJERow:t,scheduleType:n,isVendorBulkUpdateOnTransactionEnabled:o}=a,{scheduleDetailsLocalData:d,updateStatus:i}=he(e,a.scheduleType),u=L(e),h=d[n].jeScheduleDetails[t].jeLink,S=h.type==="recommended"?h.recommendedTransactionID:h.transactionDetailID,r=S!=null?ra(e,S):void 0,c=U.getSignedInUser(),p=e.tenantState.currentTenantId,g={userId:c?.userId??"",sessionId:c?.zeniSessionId??"",tenantId:u.tenantId??p},y=u?.company?.companyInfo?.firstMonthOfFY??1;return{jeScheduledTransaction:s,transactionDetail:r,localData:d[n].jeScheduleDetails[t],saveStatus:i.fetchState,authParams:g,isVendorBulkUpdateOnTransactionEnabled:o,firstMonthOfFY:y,isDisabled:i.fetchState==="In-Progress"?"readonly":void 0,analytics:V,qboAppUrl:ua(Xe.qboRedirectionUrl)}}),(function(e,a){const{selectedJERow:s,jeScheduleDetailId:t,navigate:n}=a;return{onUpdateLocalData:o=>{const d=o.linkJETransaction.qboURL;d!=null&&e(pa({scheduleType:a.scheduleType,jeScheduleDetailId:t,rowId:s,jeLink:d}))},onFetchTransactionClick:o=>{e(kt(o))},onSaveClick:()=>{e($e(a.scheduleType,t))},onBackClick:()=>{n("..",{relative:"path"})},onCancelClick:()=>{const o=a.jeScheduledTransaction.scheduledJournalEntry[s];e(ha({scheduleType:a.scheduleType,jeScheduleDetailId:t,rowId:s,originalScheduledJE:o})),n("..",{relative:"path"})}}}))(Pn),ws=()=>{const e=Fn(),a=G(),s=Y(),{scheduleDetailId:t}=R(),n=de(),o=Is.drawerLeftMargin.valuePx(n),{scheduleType:d}=R(),{useFeatureGate:i}=ne(),{isFeatureEnabled:u}=i(z.isVendorBulkUpdateOnTransactionEnabled),h=Ee(d)??"prepaid_expenses",[S,r]=f.useState(!1);if(U.getSignedInUser()==null)throw Error("Can't access Account detail page without signing in...");if(t==null)throw Error("Invalid Schedule Detail Id");const c=m((D=>he(D,h)));f.useEffect((()=>{c.fetchState==="Not-Started"&&a("..",{relative:"path"})}),[]);const p=c.selectedJELinkRowIndex,g=p!=null?c.scheduleDetailsLocalData[h].jeScheduleDetails[p]?.jeLink:null,y=g?.type==="recommended"?g.recommendedTransactionID:g?.transactionDetailID;f.useEffect((()=>{y!=null&&s(kt(y))}),[]),f.useEffect((()=>{g?.type==="recommended"&&S===!1&&p!=null&&(r(!0),s(da({scheduleType:h,jeScheduleDetailId:t,rowId:p})))}));const x=m((D=>L(D))),b=m((D=>te(D,x.companyId)));return l.jsx(Wn,{anchor:"right",open:!0,PaperProps:{style:{width:`calc(100% - ${o})`,boxShadow:"none"}},slotProps:{backdrop:{style:{backgroundColor:e.colors.black,opacity:.75,cursor:"pointer"}}},onClose:()=>a("..",{relative:"path"}),children:l.jsx(As,{onClick:D=>D.stopPropagation(),children:c.fetchState!=="Completed"||c.selectedJEScheduleTransaction==null||p==null?l.jsx(Ut,{fetchState:c.fetchState}):l.jsx(ks,{scheduleType:h,jeScheduleDetailId:t,selectedJERow:p,jeScheduledTransaction:c.selectedJEScheduleTransaction,isCOTEnabled:!1,navigate:a,scheduleTab:h,controllerUserDetails:b,isVendorBulkUpdateOnTransactionEnabled:u})})})},As=N(Jt)`
26
26
  display: flex;
27
27
  min-height: 100%;
28
28
  flex-direction: column;
29
- `,ge=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"}},ve=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"}},xe=()=>{const e=K(),a=z(),s=m((t=>pe(t)));return f.useEffect((()=>{const t=e.pathname.split("/").pop();if(t!=null){const n=(o=>{switch(o){case"prepaid_expenses":return"prepaid_expenses";case"fixed_assets":return"fixed_assets";case"accrued_expenses":return"accrued_expenses";case"opex":return"operating_expenses";case"filing_1099":return"filing_1099";default:return"vendors_list"}})(t);n!==s.currentTab&&a(ie(n))}}),[e.pathname,s.currentTab,a]),s},se="accrued_expenses",Vs=G((function(e,a){const s=L(e),t=pe(e);return{tenantName:s.companyName,vendorTabsToShow:a.vendorTabsToShow,report:a.scheduleListReport,downloadParams:a.downloadParams,companyIncorporationDate:a.companyIncDate,vendorTabView:t,isAccountingClassesEnabled:W(e)}}),(function(e,a){const{navigate:s}=a;return{onBackClick:()=>{s("../../..")},onVendorTabSelectionChanged:t=>{const n=ge(t);s(n),e(ie(ve(t)))},onSortOrderChanged:(t,n)=>{e(We({scheduleType:se,sortKey:t,sortOrder:n}))},onChangeSubTab:t=>{e(Qe({scheduleType:se,subTab:t}))},onSearchTextChanged:t=>{e(He({scheduleType:se,searchText:t}))},onReloadReport:()=>{e(wt(se))},onScroll:t=>{e(qe({scheduleType:se,scrollYOffset:t}))},onClickNewButton:()=>{e(fa()),e(ga()),V.trackScheduleAccruedDetailsNewRequested({scheduleType:"accrued_expenses"}),s("details/new")},onClickSchedule:t=>{e(Sa({selectedJEScheduleKey:t}));const n=a.scheduleListReport.jeAccruedSchedules.find((o=>o.jeAccruedScheduleKey===t));s(`details/${n?.jeScheduleId}`)},updateDownloadStateHandler:t=>{e(Ke({scheduleType:se,fetchState:t}))}}}))(_n),Fs=({vendorTabsToShow:e,previousTabPosition:a,setPreviousTabPosition:s})=>{const[t,n]=f.useState(!1),[o,d]=f.useState(!1),i=J(),u=z(),{useFeatureGate:h}=ne(),S=ce();xe();const{isFeatureEnabled:r,isFeatureGateLoading:c}=h(Y.isOpexByVendorFeatureEnabled),p=R.getSignedInUser(),g=m((T=>L(T))),y={userId:p?.userId??"",sessionId:p?.zeniSessionId??"",tenantId:g.tenantId},x=f.useMemo((()=>({authParams:y,jeScheduleEndPoint:`${ee}/jeScheduleReports`,timezone:ke(),companyName:g.companyName})),[]),[I,D]=f.useState(!1),E=m((T=>ae(T))),w=m((T=>ze(T,"accrued_expenses"))),b=e.includes("prepaid_expenses"),k=e.includes("fixed_assets"),j=e.includes("accrued_expenses");f.useEffect((()=>{(b||k||j)&&I===!1&&E!=="Completed"&&(u(Te()),D(!0))}),[I]),f.useEffect((()=>{c===!1&&(u(ye({shouldFetchAccruedExpenses:j,shouldFetchFixedAssets:!0,shouldFetchPrepaidExpenses:b,shouldFetchOpexByVendor:r,shouldFetchVendorsList:!1,shouldFetchFiling1099Vendor:!1})),n(!0))}),[E,k,c,r]),f.useEffect((()=>{t===!1&&w==="Completed"&&u(wt("accrued_expenses",{selectedTimeframe:Ye("accrued_expenses"),selectedCategoryId:"all"},!0))}),[t,w]);const F=m((T=>ma(T,se))),{isAiCfoAccessEnabled:_,onAskAiCfoClick:A}=Se({mobileExploreReferrer:"Vendors — Accrued Expenses"});me({isDataReady:F.fetchState==="Completed"});const C=m((T=>H(T).isReportGenerated));m((T=>H(T).fetchState))!=="Completed"||C!==!0||r!==!0||e.includes("operating_expenses_by_vendor")||e.splice(1,0,"operating_expenses_by_vendor"),j||i("../opex");const P=m((T=>te(T,g.companyId))),v=T=>{d(T)};return l.jsxs(l.Fragment,{children:[l.jsx(fe,{isAppContentDrawerOpen:o,handleDrawerToggle:v}),l.jsx(Vs,{navigate:i,previousTabPosition:a,setPreviousTabPosition:s,scheduleListReport:F,downloadParams:x,themeState:S,vendorTabsToShow:e,analytics:V,controllerUserDetails:P,isAiCfoAccessEnabled:_,onAskAiCfoClick:A,onClickMenuIcon:()=>v(!0)})]})},oe="fixed_assets",js=G((function(e,a){const s=L(e),t=pe(e);return{tenantName:s.companyName,vendorTabsToShow:a.vendorTabsToShow,report:a.scheduleListReport,downloadParams:a.downloadParams,companyIncorporationDate:a.companyIncDate,controllerUserDetails:a.controllerUserDetails,vendorTabView:t,isAccountingClassesEnabled:W(e)}}),(function(e,a){const{navigate:s}=a;return{onBackClick:()=>{s("../../..")},onVendorTabSelectionChanged:t=>{const n=ge(t);s(n),e(ie(ve(t)))},onSortOrderChanged:(t,n)=>{e(We({scheduleType:oe,sortKey:t,sortOrder:n}))},onChangeSubTab:t=>{e(Qe({scheduleType:oe,subTab:t}))},onSearchTextChanged:t=>{e(He({scheduleType:oe,searchText:t}))},onReloadReport:()=>{e(we(oe))},onScroll:t=>{e(qe({scheduleType:oe,scrollYOffset:t}))},onClickSchedule:t=>{e(Vt({selectedJEScheduleKey:t}));const n=a.scheduleListReport.jeScheduledTransactions.find((o=>o.jeScheduleTransactionKey===t));s(n?.jeScheduleId==null?"details/new":`details/${n.jeScheduleId}`)},updateDownloadStateHandler:t=>{e(Ke({scheduleType:oe,fetchState:t}))}}}))(Nt),Ps=({vendorTabsToShow:e,previousTabPosition:a,setPreviousTabPosition:s})=>{const[t,n]=f.useState(!1),o=J(),d=z();xe();const{useFeatureGate:i}=ne(),u=ce(),{isFeatureEnabled:h,isFeatureGateLoading:S}=i(Y.isOpexByVendorFeatureEnabled),r=R.getSignedInUser(),c=m((T=>L(T))),p={userId:r?.userId??"",sessionId:r?.zeniSessionId??"",tenantId:c.tenantId},g=f.useMemo((()=>({authParams:p,jeScheduleEndPoint:`${ee}/jeScheduleReports`,timezone:ke(),companyName:c.companyName})),[]),[y,x]=f.useState(!1),I=m((T=>ae(T))),D=m((T=>ze(T,"fixed_assets"))),E=e.includes("prepaid_expenses"),w=e.includes("fixed_assets"),b=e.includes("accrued_expenses");f.useEffect((()=>{(E||w||b)&&y===!1&&I!=="Completed"&&(d(Te()),x(!0))}),[y]),f.useEffect((()=>{S===!1&&(d(ye({shouldFetchAccruedExpenses:b,shouldFetchFixedAssets:!0,shouldFetchPrepaidExpenses:E,shouldFetchOpexByVendor:h,shouldFetchVendorsList:!1,shouldFetchFiling1099Vendor:!1})),n(!0))}),[I,w,S,h]),f.useEffect((()=>{t===!1&&D==="Completed"&&d(we("fixed_assets",{selectedTimeframe:Ye("fixed_assets"),selectedCategoryId:"all"},!0))}),[t,D]);const k=m((T=>At(T,oe))),{isAiCfoAccessEnabled:j,onAskAiCfoClick:F}=Se({mobileExploreReferrer:"Vendors — Fixed Assets"});me({isDataReady:k.fetchState==="Completed"});const _=m((T=>H(T).isReportGenerated));m((T=>H(T).fetchState))!=="Completed"||_!==!0||h!==!0||e.includes("operating_expenses_by_vendor")||e.splice(1,0,"operating_expenses_by_vendor"),w||o("../opex");const A=m((T=>te(T,c.companyId))),[C,P]=f.useState(!1),v=T=>{P(T)};return l.jsxs(l.Fragment,{children:[l.jsx(fe,{isAppContentDrawerOpen:C,handleDrawerToggle:v}),l.jsx(js,{navigate:o,scheduleListReport:k,downloadParams:g,previousTabPosition:a,setPreviousTabPosition:s,themeState:u,vendorTabsToShow:e,analytics:V,controllerUserDetails:A,isAiCfoAccessEnabled:j,onAskAiCfoClick:F,onClickMenuIcon:()=>{v(!0)}})]})},_s=N.div`
29
+ `,ge=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"}},ve=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"}},xe=()=>{const e=K(),a=Y(),s=m((t=>pe(t)));return f.useEffect((()=>{const t=e.pathname.split("/").pop();if(t!=null){const n=(o=>{switch(o){case"prepaid_expenses":return"prepaid_expenses";case"fixed_assets":return"fixed_assets";case"accrued_expenses":return"accrued_expenses";case"opex":return"operating_expenses";case"filing_1099":return"filing_1099";default:return"vendors_list"}})(t);n!==s.currentTab&&a(ie(n))}}),[e.pathname,s.currentTab,a]),s},se="accrued_expenses",Vs=J((function(e,a){const s=L(e),t=pe(e);return{tenantName:s.companyName,vendorTabsToShow:a.vendorTabsToShow,report:a.scheduleListReport,downloadParams:a.downloadParams,companyIncorporationDate:a.companyIncDate,vendorTabView:t,isAccountingClassesEnabled:Q(e)}}),(function(e,a){const{navigate:s}=a;return{onBackClick:()=>{s("../../..")},onVendorTabSelectionChanged:t=>{const n=ge(t);s(n),e(ie(ve(t)))},onSortOrderChanged:(t,n)=>{e(Qe({scheduleType:se,sortKey:t,sortOrder:n}))},onChangeSubTab:t=>{e(He({scheduleType:se,subTab:t}))},onSearchTextChanged:t=>{e(We({scheduleType:se,searchText:t}))},onReloadReport:()=>{e(wt(se))},onScroll:t=>{e(qe({scheduleType:se,scrollYOffset:t}))},onClickNewButton:()=>{e(fa()),e(ga()),V.trackScheduleAccruedDetailsNewRequested({scheduleType:"accrued_expenses"}),s("details/new")},onClickSchedule:t=>{e(Sa({selectedJEScheduleKey:t}));const n=a.scheduleListReport.jeAccruedSchedules.find((o=>o.jeAccruedScheduleKey===t));s(`details/${n?.jeScheduleId}`)},updateDownloadStateHandler:t=>{e(Ke({scheduleType:se,fetchState:t}))}}}))(_n),js=({vendorTabsToShow:e,previousTabPosition:a,setPreviousTabPosition:s})=>{const[t,n]=f.useState(!1),[o,d]=f.useState(!1),i=G(),u=Y(),{useFeatureGate:h}=ne(),S=ce();xe();const{isFeatureEnabled:r,isFeatureGateLoading:c}=h(z.isOpexByVendorFeatureEnabled),p=U.getSignedInUser(),g=m((T=>L(T))),y={userId:p?.userId??"",sessionId:p?.zeniSessionId??"",tenantId:g.tenantId},x=f.useMemo((()=>({authParams:y,jeScheduleEndPoint:`${ee}/jeScheduleReports`,timezone:ke(),companyName:g.companyName})),[]),[b,D]=f.useState(!1),E=m((T=>ae(T))),w=m((T=>Ye(T,"accrued_expenses"))),I=e.includes("prepaid_expenses"),k=e.includes("fixed_assets"),F=e.includes("accrued_expenses");f.useEffect((()=>{(I||k||F)&&b===!1&&E!=="Completed"&&(u(Te()),D(!0))}),[b]),f.useEffect((()=>{c===!1&&(u(ye({shouldFetchAccruedExpenses:F,shouldFetchFixedAssets:!0,shouldFetchPrepaidExpenses:I,shouldFetchOpexByVendor:r,shouldFetchVendorsList:!1,shouldFetchFiling1099Vendor:!1})),n(!0))}),[E,k,c,r]),f.useEffect((()=>{t===!1&&w==="Completed"&&u(wt("accrued_expenses",{selectedTimeframe:ze("accrued_expenses"),selectedCategoryId:"all"},!0))}),[t,w]);const j=m((T=>ma(T,se))),{isAiCfoAccessEnabled:_,onAskAiCfoClick:A}=Se({mobileExploreReferrer:"Vendors — Accrued Expenses"});me({isDataReady:j.fetchState==="Completed"});const C=m((T=>W(T).isReportGenerated));m((T=>W(T).fetchState))!=="Completed"||C!==!0||r!==!0||e.includes("operating_expenses_by_vendor")||e.splice(1,0,"operating_expenses_by_vendor"),F||i("../opex");const P=m((T=>te(T,g.companyId))),v=T=>{d(T)};return l.jsxs(l.Fragment,{children:[l.jsx(fe,{isAppContentDrawerOpen:o,handleDrawerToggle:v}),l.jsx(Vs,{navigate:i,previousTabPosition:a,setPreviousTabPosition:s,scheduleListReport:j,downloadParams:x,themeState:S,vendorTabsToShow:e,analytics:V,controllerUserDetails:P,isAiCfoAccessEnabled:_,onAskAiCfoClick:A,onClickMenuIcon:()=>v(!0)})]})},oe="fixed_assets",Fs=J((function(e,a){const s=L(e),t=pe(e);return{tenantName:s.companyName,vendorTabsToShow:a.vendorTabsToShow,report:a.scheduleListReport,downloadParams:a.downloadParams,companyIncorporationDate:a.companyIncDate,controllerUserDetails:a.controllerUserDetails,vendorTabView:t,isAccountingClassesEnabled:Q(e)}}),(function(e,a){const{navigate:s}=a;return{onBackClick:()=>{s("../../..")},onVendorTabSelectionChanged:t=>{const n=ge(t);s(n),e(ie(ve(t)))},onSortOrderChanged:(t,n)=>{e(Qe({scheduleType:oe,sortKey:t,sortOrder:n}))},onChangeSubTab:t=>{e(He({scheduleType:oe,subTab:t}))},onSearchTextChanged:t=>{e(We({scheduleType:oe,searchText:t}))},onReloadReport:()=>{e(we(oe))},onScroll:t=>{e(qe({scheduleType:oe,scrollYOffset:t}))},onClickSchedule:t=>{e(Vt({selectedJEScheduleKey:t}));const n=a.scheduleListReport.jeScheduledTransactions.find((o=>o.jeScheduleTransactionKey===t));s(n?.jeScheduleId==null?"details/new":`details/${n.jeScheduleId}`)},updateDownloadStateHandler:t=>{e(Ke({scheduleType:oe,fetchState:t}))}}}))(Nt),Ps=({vendorTabsToShow:e,previousTabPosition:a,setPreviousTabPosition:s})=>{const[t,n]=f.useState(!1),o=G(),d=Y();xe();const{useFeatureGate:i}=ne(),u=ce(),{isFeatureEnabled:h,isFeatureGateLoading:S}=i(z.isOpexByVendorFeatureEnabled),r=U.getSignedInUser(),c=m((T=>L(T))),p={userId:r?.userId??"",sessionId:r?.zeniSessionId??"",tenantId:c.tenantId},g=f.useMemo((()=>({authParams:p,jeScheduleEndPoint:`${ee}/jeScheduleReports`,timezone:ke(),companyName:c.companyName})),[]),[y,x]=f.useState(!1),b=m((T=>ae(T))),D=m((T=>Ye(T,"fixed_assets"))),E=e.includes("prepaid_expenses"),w=e.includes("fixed_assets"),I=e.includes("accrued_expenses");f.useEffect((()=>{(E||w||I)&&y===!1&&b!=="Completed"&&(d(Te()),x(!0))}),[y]),f.useEffect((()=>{S===!1&&(d(ye({shouldFetchAccruedExpenses:I,shouldFetchFixedAssets:!0,shouldFetchPrepaidExpenses:E,shouldFetchOpexByVendor:h,shouldFetchVendorsList:!1,shouldFetchFiling1099Vendor:!1})),n(!0))}),[b,w,S,h]),f.useEffect((()=>{t===!1&&D==="Completed"&&d(we("fixed_assets",{selectedTimeframe:ze("fixed_assets"),selectedCategoryId:"all"},!0))}),[t,D]);const k=m((T=>At(T,oe))),{isAiCfoAccessEnabled:F,onAskAiCfoClick:j}=Se({mobileExploreReferrer:"Vendors — Fixed Assets"});me({isDataReady:k.fetchState==="Completed"});const _=m((T=>W(T).isReportGenerated));m((T=>W(T).fetchState))!=="Completed"||_!==!0||h!==!0||e.includes("operating_expenses_by_vendor")||e.splice(1,0,"operating_expenses_by_vendor"),w||o("../opex");const A=m((T=>te(T,c.companyId))),[C,P]=f.useState(!1),v=T=>{P(T)};return l.jsxs(l.Fragment,{children:[l.jsx(fe,{isAppContentDrawerOpen:C,handleDrawerToggle:v}),l.jsx(Fs,{navigate:o,scheduleListReport:k,downloadParams:g,previousTabPosition:a,setPreviousTabPosition:s,themeState:u,vendorTabsToShow:e,analytics:V,controllerUserDetails:A,isAiCfoAccessEnabled:F,onAskAiCfoClick:j,onClickMenuIcon:()=>{v(!0)}})]})},_s=N.div`
30
30
  display: flex;
31
31
  min-height: 100%;
32
32
  width: 100%;
@@ -34,7 +34,7 @@ import{j as l}from"./liveblocks-D0hIH2N0.js";import{a as f}from"./sentry-DhqS_W-
34
34
  flex-direction: column;
35
35
  align-items: center;
36
36
  background-color: ${e=>e.theme.colors.grey4};
37
- `,Ls=G((function(e,a){const s=R.getSignedInUser(),t=e.tenantState.currentTenantId,n=L(e),o=n?.companyName??"",d={userId:s?.userId??"",sessionId:s?.zeniSessionId??"",tenantId:t??""},i=H(e),u=va(e);return{report:i,uiState:u,isAccountingClassesEnabled:W(e),analytics:V,vendorTabsToShow:a.vendorTabsToShow,downloadParams:{downloadState:u.downloadState,currentTenantCompanyName:o,statementEndPoint:`${ee}/opexByVendor`,authParams:d,timezone:ke()}}}),(function(e,a){const{navigate:s}=a;return{onFetchOpExByVendors:(t,n,o)=>{e(wa(t,n,o))},onVendorNameAndBalanceClicked:(t,n)=>{if(a.tenantEmailDomain!=null){const o=tt(t.id,t.qboId,a.tenantEmailDomain,n),d=M(a.location.state?.pathnameStackToGoBack,a.location.pathname);a.navigate(o,{state:{pathnameStackToGoBack:d,referrer:"Operating Expenses By Vendor"}})}},onRefresh:()=>{e(ka())},onReloadReport:()=>{e(ba(!0))},onBackClick:()=>{s("../../dashboard")},onTimeframeSelectionChanged:t=>{e(Ia(t))},onAdditionalBalanceSelectionChanged:(t,n)=>{e(Ea({isCompareModeOn:t,additionalBalances:n}))},onSortOrderChanged:(t,n,o)=>{e(Da({sortkey:n,sortOrder:t,timeframe:o}))},onVendorTabSelectionChanged:t=>{const n=ge(t);s(n),e(ie(ve(t)))},onSortOrSearchStarted:t=>{e(Ca(t))},onPageFetchStarted:()=>{e(ya(!0))},updateDownloadStateHandler:t=>{e(Ta(t))},onClearSearch:t=>{e(xa({timeframe:t}))}}}))(Bn);function Bs({vendorTabsToShow:e,previousTabPosition:a,setPreviousTabPosition:s}){const t=J(),n=z(),o=K(),{tenantEmailDomain:d}=O(),i=de(),u=R.getSignedInUser(),{useFeatureGate:h}=ne(),{isFeatureEnabled:S,isFeatureGateLoading:r}=h(Y.isOpexByVendorFeatureEnabled),c=m((A=>H(A)));if(u==null)throw Error("Can't access opex by vendor page without signing in...");xe();const[p,g]=f.useState(!1),y=m((A=>ae(A))),x=e.includes("prepaid_expenses"),I=e.includes("fixed_assets"),D=e.includes("accrued_expenses"),E=m((A=>pe(A))),{isAiCfoAccessEnabled:w,onAskAiCfoClick:b}=Se({mobileExploreReferrer:"Vendors — Operating Expenses by Vendor"});me({isDataReady:c.fetchState==="Completed"&&c.isReportGenerated===!0});const{areTenantIdsInSync:k}=Ln();f.useEffect((()=>{(x||I||D)&&p===!1&&y!=="Completed"&&k&&(n(Te()),g(!0))}),[p,k]),f.useEffect((()=>{k&&n(ye({shouldFetchAccruedExpenses:D,shouldFetchFixedAssets:I,shouldFetchPrepaidExpenses:x,shouldFetchOpexByVendor:S===!0&&r===!1,shouldFetchVendorsList:!1,shouldFetchFiling1099Vendor:!1}))}),[y,I,r,S,k]),c.fetchState!=="Completed"||c.isReportGenerated!==!0||S!==!0||e.includes("operating_expenses_by_vendor")||e.splice(1,0,"operating_expenses_by_vendor"),f.useEffect((()=>{k&&(c.isReportGenerated===!1&&c.fetchState==="Completed"||S===!1&&r===!1)&&t("../summary")}),[k,c.isReportGenerated,c.fetchState,S,r,t]);const[j,F]=f.useState(!1),_=A=>{F(A)};return l.jsxs(_s,{windowSize:i,children:[c.fetchState==="Completed"?l.jsx(Z,{analytics:V,onLoad:A=>{E.previousTab==null?A.trackVendorOperatingExpensesPageLoaded("Side Panel"):A.trackVendorOperatingExpenses(E.currentTab,E.previousTab??null)}}):null,l.jsx(fe,{isAppContentDrawerOpen:j,handleDrawerToggle:_}),l.jsx(Ls,{location:o,navigate:t,previousTabPosition:a,setPreviousTabPosition:s,tenantEmailDomain:d,vendorTabsToShow:e,isAiCfoAccessEnabled:w,onAskAiCfoClick:b,onClickMenuIcon:()=>{_(!0)}})]})}const le="prepaid_expenses",Us=G((function(e,a){const s=L(e),t=pe(e);return{tenantName:s.companyName,vendorTabsToShow:a.vendorTabsToShow,report:a.scheduleListReport,downloadParams:a.downloadParams,companyIncorporationDate:a.companyIncDate,controllerUserDetails:a.controllerUserDetails,vendorTabView:t,isAccountingClassesEnabled:W(e)}}),(function(e,a){const{navigate:s}=a;return{onBackClick:()=>{s("../../..")},onVendorTabSelectionChanged:t=>{const n=ge(t);s(n),e(ie(ve(t)))},onSortOrderChanged:(t,n)=>{e(We({scheduleType:le,sortKey:t,sortOrder:n}))},onChangeSubTab:t=>{e(Qe({scheduleType:le,subTab:t}))},onSearchTextChanged:t=>{e(He({scheduleType:le,searchText:t}))},onReloadReport:()=>{e(we(le))},onScroll:t=>{e(qe({scheduleType:le,scrollYOffset:t}))},onClickSchedule:t=>{e(Vt({selectedJEScheduleKey:t}));const n=a.scheduleListReport.jeScheduledTransactions.find((o=>o.jeScheduleTransactionKey===t));s(n?.jeScheduleId==null?"details/new":`details/${n.jeScheduleId}`)},updateDownloadStateHandler:t=>{e(Ke({scheduleType:le,fetchState:t}))}}}))(Nt),Os=({vendorTabsToShow:e,previousTabPosition:a,setPreviousTabPosition:s})=>{const[t,n]=f.useState(!1),o=J(),d=z(),{useFeatureGate:i}=ne(),u=ce();xe();const h=R.getSignedInUser(),{isFeatureEnabled:S,isFeatureGateLoading:r}=i(Y.isOpexByVendorFeatureEnabled),c=m((T=>L(T))),p=m((T=>ze(T,"prepaid_expenses"))),g={userId:h?.userId??"",sessionId:h?.zeniSessionId??"",tenantId:c.tenantId},y=f.useMemo((()=>({authParams:g,jeScheduleEndPoint:`${ee}/jeScheduleReports`,timezone:ke(),companyName:c.companyName})),[]),[x,I]=f.useState(!1),D=m((T=>ae(T))),E=e.includes("prepaid_expenses"),w=e.includes("fixed_assets"),b=e.includes("accrued_expenses");f.useEffect((()=>{(E||w||b)&&x===!1&&D!=="Completed"&&(d(Te()),I(!0))}),[x]),f.useEffect((()=>{t===!1&&p==="Completed"&&d(we("prepaid_expenses",{selectedTimeframe:Ye("prepaid_expenses"),selectedCategoryId:"all"},!0))}),[t,p]),f.useEffect((()=>{r===!1&&(d(ye({shouldFetchAccruedExpenses:b,shouldFetchFixedAssets:w,shouldFetchPrepaidExpenses:!0,shouldFetchOpexByVendor:S,shouldFetchVendorsList:!1,shouldFetchFiling1099Vendor:!1})),n(!0))}),[D,w,r,S]);const k=m((T=>At(T,le))),{isAiCfoAccessEnabled:j,onAskAiCfoClick:F}=Se({mobileExploreReferrer:"Vendors — Prepaid Expenses"});me({isDataReady:k.fetchState==="Completed"});const _=m((T=>H(T).isReportGenerated));m((T=>H(T).fetchState))!=="Completed"||_!==!0||S!==!0||e.includes("operating_expenses_by_vendor")||e.splice(1,0,"operating_expenses_by_vendor"),E||o("../opex");const A=m((T=>te(T,c.companyId))),[C,P]=f.useState(!1),v=T=>{P(T)};return l.jsxs(l.Fragment,{children:[l.jsx(fe,{isAppContentDrawerOpen:C,handleDrawerToggle:v}),l.jsx(Us,{navigate:o,previousTabPosition:a,setPreviousTabPosition:s,scheduleListReport:k,downloadParams:y,themeState:u,vendorTabsToShow:e,analytics:V,controllerUserDetails:A,isAiCfoAccessEnabled:j,onAskAiCfoClick:F,onClickMenuIcon:()=>{v(!0)}})]})},Rs=N.div`
37
+ `,Ls=J((function(e,a){const s=U.getSignedInUser(),t=e.tenantState.currentTenantId,n=L(e),o=n?.companyName??"",d={userId:s?.userId??"",sessionId:s?.zeniSessionId??"",tenantId:t??""},i=W(e),u=va(e);return{report:i,uiState:u,isAccountingClassesEnabled:Q(e),analytics:V,vendorTabsToShow:a.vendorTabsToShow,downloadParams:{downloadState:u.downloadState,currentTenantCompanyName:o,statementEndPoint:`${ee}/opexByVendor`,authParams:d,timezone:ke()}}}),(function(e,a){const{navigate:s}=a;return{onFetchOpExByVendors:(t,n,o)=>{e(wa(t,n,o))},onVendorNameAndBalanceClicked:(t,n)=>{if(a.tenantEmailDomain!=null){const o=tt(t.id,t.qboId,a.tenantEmailDomain,n),d=M(a.location.state?.pathnameStackToGoBack,a.location.pathname);a.navigate(o,{state:{pathnameStackToGoBack:d,referrer:"Operating Expenses By Vendor"}})}},onRefresh:()=>{e(ka())},onReloadReport:()=>{e(Ia(!0))},onBackClick:()=>{s("../../dashboard")},onTimeframeSelectionChanged:t=>{e(ba(t))},onAdditionalBalanceSelectionChanged:(t,n)=>{e(Ea({isCompareModeOn:t,additionalBalances:n}))},onSortOrderChanged:(t,n,o)=>{e(Da({sortkey:n,sortOrder:t,timeframe:o}))},onVendorTabSelectionChanged:t=>{const n=ge(t);s(n),e(ie(ve(t)))},onSortOrSearchStarted:t=>{e(Ca(t))},onPageFetchStarted:()=>{e(ya(!0))},updateDownloadStateHandler:t=>{e(Ta(t))},onClearSearch:t=>{e(xa({timeframe:t}))}}}))(Bn);function Bs({vendorTabsToShow:e,previousTabPosition:a,setPreviousTabPosition:s}){const t=G(),n=Y(),o=K(),{tenantEmailDomain:d}=R(),i=de(),u=U.getSignedInUser(),{useFeatureGate:h}=ne(),{isFeatureEnabled:S,isFeatureGateLoading:r}=h(z.isOpexByVendorFeatureEnabled),c=m((A=>W(A)));if(u==null)throw Error("Can't access opex by vendor page without signing in...");xe();const[p,g]=f.useState(!1),y=m((A=>ae(A))),x=e.includes("prepaid_expenses"),b=e.includes("fixed_assets"),D=e.includes("accrued_expenses"),E=m((A=>pe(A))),{isAiCfoAccessEnabled:w,onAskAiCfoClick:I}=Se({mobileExploreReferrer:"Vendors — Operating Expenses by Vendor"});me({isDataReady:c.fetchState==="Completed"&&c.isReportGenerated===!0});const{areTenantIdsInSync:k}=Ln();f.useEffect((()=>{(x||b||D)&&p===!1&&y!=="Completed"&&k&&(n(Te()),g(!0))}),[p,k]),f.useEffect((()=>{k&&n(ye({shouldFetchAccruedExpenses:D,shouldFetchFixedAssets:b,shouldFetchPrepaidExpenses:x,shouldFetchOpexByVendor:S===!0&&r===!1,shouldFetchVendorsList:!1,shouldFetchFiling1099Vendor:!1}))}),[y,b,r,S,k]),c.fetchState!=="Completed"||c.isReportGenerated!==!0||S!==!0||e.includes("operating_expenses_by_vendor")||e.splice(1,0,"operating_expenses_by_vendor"),f.useEffect((()=>{k&&(c.isReportGenerated===!1&&c.fetchState==="Completed"||S===!1&&r===!1)&&t("../summary")}),[k,c.isReportGenerated,c.fetchState,S,r,t]);const[F,j]=f.useState(!1),_=A=>{j(A)};return l.jsxs(_s,{windowSize:i,children:[c.fetchState==="Completed"?l.jsx(X,{analytics:V,onLoad:A=>{E.previousTab==null?A.trackVendorOperatingExpensesPageLoaded("Side Panel"):A.trackVendorOperatingExpenses(E.currentTab,E.previousTab??null)}}):null,l.jsx(fe,{isAppContentDrawerOpen:F,handleDrawerToggle:_}),l.jsx(Ls,{location:o,navigate:t,previousTabPosition:a,setPreviousTabPosition:s,tenantEmailDomain:d,vendorTabsToShow:e,isAiCfoAccessEnabled:w,onAskAiCfoClick:I,onClickMenuIcon:()=>{_(!0)}})]})}const le="prepaid_expenses",Os=J((function(e,a){const s=L(e),t=pe(e);return{tenantName:s.companyName,vendorTabsToShow:a.vendorTabsToShow,report:a.scheduleListReport,downloadParams:a.downloadParams,companyIncorporationDate:a.companyIncDate,controllerUserDetails:a.controllerUserDetails,vendorTabView:t,isAccountingClassesEnabled:Q(e)}}),(function(e,a){const{navigate:s}=a;return{onBackClick:()=>{s("../../..")},onVendorTabSelectionChanged:t=>{const n=ge(t);s(n),e(ie(ve(t)))},onSortOrderChanged:(t,n)=>{e(Qe({scheduleType:le,sortKey:t,sortOrder:n}))},onChangeSubTab:t=>{e(He({scheduleType:le,subTab:t}))},onSearchTextChanged:t=>{e(We({scheduleType:le,searchText:t}))},onReloadReport:()=>{e(we(le))},onScroll:t=>{e(qe({scheduleType:le,scrollYOffset:t}))},onClickSchedule:t=>{e(Vt({selectedJEScheduleKey:t}));const n=a.scheduleListReport.jeScheduledTransactions.find((o=>o.jeScheduleTransactionKey===t));s(n?.jeScheduleId==null?"details/new":`details/${n.jeScheduleId}`)},updateDownloadStateHandler:t=>{e(Ke({scheduleType:le,fetchState:t}))}}}))(Nt),Rs=({vendorTabsToShow:e,previousTabPosition:a,setPreviousTabPosition:s})=>{const[t,n]=f.useState(!1),o=G(),d=Y(),{useFeatureGate:i}=ne(),u=ce();xe();const h=U.getSignedInUser(),{isFeatureEnabled:S,isFeatureGateLoading:r}=i(z.isOpexByVendorFeatureEnabled),c=m((T=>L(T))),p=m((T=>Ye(T,"prepaid_expenses"))),g={userId:h?.userId??"",sessionId:h?.zeniSessionId??"",tenantId:c.tenantId},y=f.useMemo((()=>({authParams:g,jeScheduleEndPoint:`${ee}/jeScheduleReports`,timezone:ke(),companyName:c.companyName})),[]),[x,b]=f.useState(!1),D=m((T=>ae(T))),E=e.includes("prepaid_expenses"),w=e.includes("fixed_assets"),I=e.includes("accrued_expenses");f.useEffect((()=>{(E||w||I)&&x===!1&&D!=="Completed"&&(d(Te()),b(!0))}),[x]),f.useEffect((()=>{t===!1&&p==="Completed"&&d(we("prepaid_expenses",{selectedTimeframe:ze("prepaid_expenses"),selectedCategoryId:"all"},!0))}),[t,p]),f.useEffect((()=>{r===!1&&(d(ye({shouldFetchAccruedExpenses:I,shouldFetchFixedAssets:w,shouldFetchPrepaidExpenses:!0,shouldFetchOpexByVendor:S,shouldFetchVendorsList:!1,shouldFetchFiling1099Vendor:!1})),n(!0))}),[D,w,r,S]);const k=m((T=>At(T,le))),{isAiCfoAccessEnabled:F,onAskAiCfoClick:j}=Se({mobileExploreReferrer:"Vendors — Prepaid Expenses"});me({isDataReady:k.fetchState==="Completed"});const _=m((T=>W(T).isReportGenerated));m((T=>W(T).fetchState))!=="Completed"||_!==!0||S!==!0||e.includes("operating_expenses_by_vendor")||e.splice(1,0,"operating_expenses_by_vendor"),E||o("../opex");const A=m((T=>te(T,c.companyId))),[C,P]=f.useState(!1),v=T=>{P(T)};return l.jsxs(l.Fragment,{children:[l.jsx(fe,{isAppContentDrawerOpen:C,handleDrawerToggle:v}),l.jsx(Os,{navigate:o,previousTabPosition:a,setPreviousTabPosition:s,scheduleListReport:k,downloadParams:y,themeState:u,vendorTabsToShow:e,analytics:V,controllerUserDetails:A,isAiCfoAccessEnabled:F,onAskAiCfoClick:j,onClickMenuIcon:()=>{v(!0)}})]})},Us=N.div`
38
38
  display: flex;
39
39
  min-height: 100%;
40
40
  width: 100%;
@@ -42,9 +42,9 @@ import{j as l}from"./liveblocks-D0hIH2N0.js";import{a as f}from"./sentry-DhqS_W-
42
42
  flex-direction: column;
43
43
  align-items: center;
44
44
  background-color: ${e=>e.theme.colors.grey4};
45
- `,Ns=G((function(e,a){const{isFiling1099FeatureEnabled:s,vendorDetailView:t,selectedVendor:n,firstMonthOfFY:o,currentTenant:d,currentUserRoleMap:i}=a,u=R.getSignedInUser(),h={userId:u?.userId??"",sessionId:u?.zeniSessionId??"",tenantId:d.tenantId??""};return{firstMonthOfFY:o,isFiling1099FeatureEnabled:s,vendorDetailView:t,allTransactions:t?.allVendorTransactionsView,allTransactionsTabData:t?.allTransactionsTabData!=null?{timePeriod:Ba(t?.allTransactionsTabData.timePeriod),numberOfQuartersFetched:t?.allTransactionsTabData.numberOfQuartersFetched}:void 0,vendorLogo:n?.logo,readOnlyMode:i?.bookkeeping_user===!0,filesEndPoint:Mt.fileMicroServiceBaseUrl,authParams:h,scrollToTrend:a.isTrendPeriodSelected}}),(function(e,a){const{navigate:s,vendorDetailView:t,vendorId:n,defaultTransactionTimePeriod:o,vendorEntity:d,tenantEmailDomain:i,location:u,firstMonthOfFY:h}=a,S=()=>{const r=Ce(u.state?.pathnameStackToGoBack),c=r.poppedPathname??((p=2)=>{let g=p;a.isTrendPeriodSelected===!0&&(g=5);let y="../";for(let x=0;x<g;x++)y=`${y}../`;return y})(1);s(c,{state:{pathnameStackToGoBack:r.newStack}})};return{onSaveVendor:()=>{t!=null&&((r,c)=>{const{vendorId:p,vendorName:g,existingCategory:y,existingClass:x,existingOwner:I,selectedCategory:D,selectedClass:E,selectedOwner:w,isRecommendedCategorySelected:b,isRecommendedClassSelected:k,categoryRecommendationTypeSelected:j,classRecommendationTypeSelected:F}=$a(r,c);p!=null&&V.trackVendorDetailsSave(p,g??"",y,x,I,D,E,w,b,k,j,F)})(t?.vendorViewDetails,t?.vendorViewDetails.ownerList),n!=null&&e(Ga(n,void 0))},onVendorSpendTrendFilterTabClick:r=>{e(Ja(r))},saveVendorDetailLocalData:r=>{n!=null&&e(Ma({vendorId:n,localData:r}))},saveContactsInVendorTabDetailLocalData:(r,c)=>{e(Na({vendorId:r,localData:{contacts:c}}))},onCancelClick:()=>{var r;t?.vendorViewDetails.vendorView?.vendorBasic!=null&&(r=t.vendorViewDetails.vendorView.vendorBasic).id!=null&&V.trackVendorDetailsCancel(r.id??"",r.name,r.account?.accountName,r.class?.className,r.owner?.email),e(ot()),e(lt()),e(it()),e(ct()),S()},handleSpendTrendPercentChangeClick:()=>{var r;t?.vendorViewDetails.vendorView?.vendorBasic!=null&&(r=t.vendorViewDetails.vendorView?.vendorBasic,r.id!=null&&V.trackVendorDetailsSpendTrendHotlinkClicked(r.id??"",r.name,r.account?.accountName,r.class?.className,r.owner?.email))},onSaveSuccess:()=>{n!=null&&e(Ra("Not-Started",n)),e(ot()),e(lt()),e(it()),e(ct()),S()},onTrendSelectedPeriodChange:r=>{if(r==null)o!=null&&e(je(d,"EntityDetail",{timeframe:"quarter",timePeriod:o}));else{const c=r.currentTimePeriod==null?r.addTimePeriod:{startDate:r.addTimePeriod.startDate,endDate:r.currentTimePeriod.endDate};e(_e(d,"EntityDetail",{timeframe:r.timeframe,timePeriod:r.addTimePeriod},h)),e(je(d,"EntityDetail",{timeframe:r.timeframe,timePeriod:c}))}},onVendorTabSelectionChanged:r=>{e(Oa(r))},onAddressClick:(r,c)=>{if(i==null)return;const p=es(i,r,c),g=M(u.state?.pathnameStackToGoBack,u.pathname);s(p,{state:{pathnameStackToGoBack:g}})},onVendorDetailUIChange:r=>{e(Ua({collapsableStatus:r}))},onTransactionItemClick:r=>{const c=`${q(r,i)}`,p=M(u.state?.pathnameStackToGoBack,u.pathname);s(c,{state:{pathnameStackToGoBack:p}})},onLoadPreviousTransactionsClick:(r,c)=>{e(Ft({timePeriod:Pe(r),numberOfQuartersFetched:c})),e(jt(d,Pe(r),!0,!0))}}}))(On);function ut({referrerType:e,isFiling1099FeatureEnabled:a}){const s=z(),t=K(),n=J(),o=Un(),[d,i]=f.useState(!1),[u,h]=f.useState(!1),[S,r]=f.useState(!1),c=O(),p=c.vendorId,g=c.qboId,{tenantEmailDomain:y,timeframe:x,startDate:I,endDate:D}=c,E={id:g??"",name:"",type:"vendor",zeniId:p??"",qboId:g??""};f.useEffect((()=>{x!=null&&I!=null&&D!=null?i(!0):(i(!1),S===!1&&(r(!0),s(je(E,"EntityDetail"))))}),[x,I,D]);const w=de(),b=m((U=>L(U))),k=m((U=>p!=null?Aa(U,p,E):void 0)),j=m((U=>U.vendorState.vendorByID[p??""])),F=m((U=>L(U).company?.companyInfo.firstMonthOfFY??1)),_=m((()=>Va(F,2))),A=Pe({startDate:_.startDate,endDate:Fa()}),C=ja(F),P=m((U=>Pa(U.trendWithTransactionsState,E,"EntityDetail"))),[v,T]=f.useState(!1),Ve=d===!1&&S===!1?void 0:P?.selectedPeriod?.timePeriod??C;return f.useEffect((()=>(e==null&&k?.fetchState!=="Not-Started"||p==null||s(_a(p,E)),()=>{e!=null&&p!=null&&s(La(p))})),[p,t.state,s]),f.useEffect((()=>{k?.fetchState==="Completed"&&k?.vendorViewDetails.vendorView?.vendorBasic!=null&&((U,re,Fe)=>{U.id!=null&&V.trackVendorDetails(U.id,U.name,Fe,U.account?.accountName,U.class?.className,U.owner?.email,re.percentChange,re.last30DaysSpend,re.last90DaysSpend,re.yearToDateSpend)})(k?.vendorViewDetails.vendorView?.vendorBasic,k?.vendorSpend,e),T(!1)}),[k?.fetchState]),f.useEffect((()=>{if(k?.fetchState==="Completed"&&v===!1){Ve!=null&&d===!1&&(s(_e(E,"EntityDetail",{timeframe:P?.selectedPeriod?.timeframe??"quarter",timePeriod:Ve},F)),T(!0));const U=De.getLocalizedStrings().dateFormat.analytics;if(d===!0&&x!=null&&I!=null&&D!=null){T(!0);const re=x,Fe={startDate:st(I,U.YYYYDashMMDashDDFormat),endDate:st(D,U.YYYYDashMMDashDDFormat)};s(_e(E,"EntityDetail",{timeframe:re,timePeriod:Fe}))}}}),[k?.fetchState,Ve,P?.selectedPeriod?.timeframe,d,F]),f.useEffect((()=>{k?.fetchState==="Completed"&&u===!1&&(s(Ft({timePeriod:A,numberOfQuartersFetched:3})),s(jt(E,k.allTransactionsTabData?.timePeriod??A,!1,!0)),h(!0))}),[k?.fetchState,u]),p==null?l.jsx(Q,{}):l.jsx(Rs,{windowSize:w,children:l.jsx(Ns,{location:t,navigate:n,isFiling1099FeatureEnabled:a,vendorDetailView:k,vendorId:p,currentTenant:b,selectedVendor:j,firstMonthOfFY:F,isTrendPeriodSelected:d,selectedPeriodTimePeriod:P?.selectedPeriod?.timePeriod,defaultTransactionTimePeriod:C,vendorEntity:E,currentUserRoleMap:o?.loggedInUserRoleMap,tenantEmailDomain:y})})}const Ms=De.getLocalizedStrings().spendManagement.billPay.vendorCreation.vendorDetails,Js={containerWidth:new Xe(100,58)},Gs=N(Nn)`
46
- width: ${X.sp4};
47
- height: ${X.sp4};
45
+ `,Ns=J((function(e,a){const{isFiling1099FeatureEnabled:s,vendorDetailView:t,selectedVendor:n,firstMonthOfFY:o,currentTenant:d,currentUserRoleMap:i}=a,u=U.getSignedInUser(),h={userId:u?.userId??"",sessionId:u?.zeniSessionId??"",tenantId:d.tenantId??""};return{firstMonthOfFY:o,isFiling1099FeatureEnabled:s,vendorDetailView:t,allTransactions:t?.allVendorTransactionsView,allTransactionsTabData:t?.allTransactionsTabData!=null?{timePeriod:Ba(t?.allTransactionsTabData.timePeriod),numberOfQuartersFetched:t?.allTransactionsTabData.numberOfQuartersFetched}:void 0,vendorLogo:n?.logo,readOnlyMode:i?.bookkeeping_user===!0,filesEndPoint:Mt.fileMicroServiceBaseUrl,authParams:h,scrollToTrend:a.isTrendPeriodSelected}}),(function(e,a){const{navigate:s,vendorDetailView:t,vendorId:n,defaultTransactionTimePeriod:o,vendorEntity:d,tenantEmailDomain:i,location:u,firstMonthOfFY:h}=a,S=()=>{const r=Ce(u.state?.pathnameStackToGoBack),c=r.poppedPathname??((p=2)=>{let g=p;a.isTrendPeriodSelected===!0&&(g=5);let y="../";for(let x=0;x<g;x++)y=`${y}../`;return y})(1);s(c,{state:{pathnameStackToGoBack:r.newStack}})};return{onSaveVendor:()=>{t!=null&&((r,c)=>{const{vendorId:p,vendorName:g,existingCategory:y,existingClass:x,existingOwner:b,selectedCategory:D,selectedClass:E,selectedOwner:w,isRecommendedCategorySelected:I,isRecommendedClassSelected:k,categoryRecommendationTypeSelected:F,classRecommendationTypeSelected:j}=$a(r,c);p!=null&&V.trackVendorDetailsSave(p,g??"",y,x,b,D,E,w,I,k,F,j)})(t?.vendorViewDetails,t?.vendorViewDetails.ownerList),n!=null&&e(Ja(n,void 0))},onVendorSpendTrendFilterTabClick:r=>{e(Ga(r))},saveVendorDetailLocalData:r=>{n!=null&&e(Ma({vendorId:n,localData:r}))},saveContactsInVendorTabDetailLocalData:(r,c)=>{e(Na({vendorId:r,localData:{contacts:c}}))},onCancelClick:()=>{var r;t?.vendorViewDetails.vendorView?.vendorBasic!=null&&(r=t.vendorViewDetails.vendorView.vendorBasic).id!=null&&V.trackVendorDetailsCancel(r.id??"",r.name,r.account?.accountName,r.class?.className,r.owner?.email),e(ot()),e(lt()),e(it()),e(ct()),S()},handleSpendTrendPercentChangeClick:()=>{var r;t?.vendorViewDetails.vendorView?.vendorBasic!=null&&(r=t.vendorViewDetails.vendorView?.vendorBasic,r.id!=null&&V.trackVendorDetailsSpendTrendHotlinkClicked(r.id??"",r.name,r.account?.accountName,r.class?.className,r.owner?.email))},onSaveSuccess:()=>{n!=null&&e(Ua("Not-Started",n)),e(ot()),e(lt()),e(it()),e(ct()),S()},onTrendSelectedPeriodChange:r=>{if(r==null)o!=null&&e(Fe(d,"EntityDetail",{timeframe:"quarter",timePeriod:o}));else{const c=r.currentTimePeriod==null?r.addTimePeriod:{startDate:r.addTimePeriod.startDate,endDate:r.currentTimePeriod.endDate};e(_e(d,"EntityDetail",{timeframe:r.timeframe,timePeriod:r.addTimePeriod},h)),e(Fe(d,"EntityDetail",{timeframe:r.timeframe,timePeriod:c}))}},onVendorTabSelectionChanged:r=>{e(Ra(r))},onAddressClick:(r,c)=>{if(i==null)return;const p=es(i,r,c),g=M(u.state?.pathnameStackToGoBack,u.pathname);s(p,{state:{pathnameStackToGoBack:g}})},onVendorDetailUIChange:r=>{e(Oa({collapsableStatus:r}))},onTransactionItemClick:r=>{const c=`${q(r,i)}`,p=M(u.state?.pathnameStackToGoBack,u.pathname);s(c,{state:{pathnameStackToGoBack:p}})},onLoadPreviousTransactionsClick:(r,c)=>{e(jt({timePeriod:Pe(r),numberOfQuartersFetched:c})),e(Ft(d,Pe(r),!0,!0))}}}))(Rn);function ut({referrerType:e,isFiling1099FeatureEnabled:a}){const s=Y(),t=K(),n=G(),o=On(),[d,i]=f.useState(!1),[u,h]=f.useState(!1),[S,r]=f.useState(!1),c=R(),p=c.vendorId,g=c.qboId,{tenantEmailDomain:y,timeframe:x,startDate:b,endDate:D}=c,E={id:g??"",name:"",type:"vendor",zeniId:p??"",qboId:g??""};f.useEffect((()=>{x!=null&&b!=null&&D!=null?i(!0):(i(!1),S===!1&&(r(!0),s(Fe(E,"EntityDetail"))))}),[x,b,D]);const w=de(),I=m((O=>L(O))),k=m((O=>p!=null?Aa(O,p,E):void 0)),F=m((O=>O.vendorState.vendorByID[p??""])),j=m((O=>L(O).company?.companyInfo.firstMonthOfFY??1)),_=m((()=>Va(j,2))),A=Pe({startDate:_.startDate,endDate:ja()}),C=Fa(j),P=m((O=>Pa(O.trendWithTransactionsState,E,"EntityDetail"))),[v,T]=f.useState(!1),Ve=d===!1&&S===!1?void 0:P?.selectedPeriod?.timePeriod??C;return f.useEffect((()=>(e==null&&k?.fetchState!=="Not-Started"||p==null||s(_a(p,E)),()=>{e!=null&&p!=null&&s(La(p))})),[p,t.state,s]),f.useEffect((()=>{k?.fetchState==="Completed"&&k?.vendorViewDetails.vendorView?.vendorBasic!=null&&((O,re,je)=>{O.id!=null&&V.trackVendorDetails(O.id,O.name,je,O.account?.accountName,O.class?.className,O.owner?.email,re.percentChange,re.last30DaysSpend,re.last90DaysSpend,re.yearToDateSpend)})(k?.vendorViewDetails.vendorView?.vendorBasic,k?.vendorSpend,e),T(!1)}),[k?.fetchState]),f.useEffect((()=>{if(k?.fetchState==="Completed"&&v===!1){Ve!=null&&d===!1&&(s(_e(E,"EntityDetail",{timeframe:P?.selectedPeriod?.timeframe??"quarter",timePeriod:Ve},j)),T(!0));const O=De.getLocalizedStrings().dateFormat.analytics;if(d===!0&&x!=null&&b!=null&&D!=null){T(!0);const re=x,je={startDate:st(b,O.YYYYDashMMDashDDFormat),endDate:st(D,O.YYYYDashMMDashDDFormat)};s(_e(E,"EntityDetail",{timeframe:re,timePeriod:je}))}}}),[k?.fetchState,Ve,P?.selectedPeriod?.timeframe,d,j]),f.useEffect((()=>{k?.fetchState==="Completed"&&u===!1&&(s(jt({timePeriod:A,numberOfQuartersFetched:3})),s(Ft(E,k.allTransactionsTabData?.timePeriod??A,!1,!0)),h(!0))}),[k?.fetchState,u]),p==null?l.jsx(H,{}):l.jsx(Us,{windowSize:w,children:l.jsx(Ns,{location:t,navigate:n,isFiling1099FeatureEnabled:a,vendorDetailView:k,vendorId:p,currentTenant:I,selectedVendor:F,firstMonthOfFY:j,isTrendPeriodSelected:d,selectedPeriodTimePeriod:P?.selectedPeriod?.timePeriod,defaultTransactionTimePeriod:C,vendorEntity:E,currentUserRoleMap:o?.loggedInUserRoleMap,tenantEmailDomain:y})})}const Ms=De.getLocalizedStrings().spendManagement.billPay.vendorCreation.vendorDetails,Gs={containerWidth:new Ze(100,58)},Js=N(Nn)`
46
+ width: ${Z.sp4};
47
+ height: ${Z.sp4};
48
48
  cursor: pointer;
49
49
  color: ${e=>e.theme.colors.brandColorJade};
50
50
  `,$s=N.div`
@@ -54,34 +54,34 @@ import{j as l}from"./liveblocks-D0hIH2N0.js";import{a as f}from"./sentry-DhqS_W-
54
54
  width: 100%;
55
55
  overflow-y: scroll;
56
56
  background-color: ${e=>e.theme.colors.grey4};
57
- `,zs=N.div`
57
+ `,Ys=N.div`
58
58
  display: flex;
59
59
  flex-direction: column;
60
- width: ${e=>`${Js.containerWidth.value(e.windowSize)}%`};
60
+ width: ${e=>`${Gs.containerWidth.value(e.windowSize)}%`};
61
61
  ${e=>e.windowSize!=="small"?"overflow: auto;":""}
62
- `,Ys=G((function(e,a){const s=R.getSignedInUser(),t=e.tenantState.currentTenantId,n={userId:s?.userId??"",sessionId:s?.zeniSessionId??"",tenantId:t??""},o=e.vendorFiling1099UploadDetailsState,d=e.vendorFiling1099UploadDetailsState;let i={fetchState:"Not-Started",error:void 0};return a.vendorId!=null&&(i=e.vendorViewState.editVendorStateById[a.vendorId]?.fetchStatus),{uploadInvoiceEndPoint:`${Mt.documentAIMicroServiceBaseUrl}`,vendorFiling1099UploadDetailsState:o,vendorFiling1099UploadDetailsViewState:d,uploadStaus:d.w9FormUploadStatus,authParams:n,billId:a.billId,vendorId:a.vendorId,file:a.file,showAutofill:a.showAutofill,type:a.type,analytics:V,entityId:a.billId,fetchVendorFetchStatus:i,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(qa({w9FormFile:t.files[0]})),t.w9_form[0]!=null)){e(Ha({ocrData:t.w9_form[0],vendorId:s}));const n=(o=>({street:[o.street.join(" ")],city:o.city,state:o.state,postalCode:o.postal_code,countryCode:o.country_code??void 0,country:o.country??""}))(t.w9_form[0].address);e(Ut({addressType:"vendor_address",addressToCreate:n}))}},updateInvoiceUploadFetchState:t=>{e(Le({fetchState:t,error:void 0}))},onSkipAutofill:t=>{e(Ka(t))},onVendorFiling1099UploadDetailsSave:t=>{e(Bt(t))},onDeleteClick:()=>{e(Le({fetchState:"Not-Started",error:void 0})),e(Lt({vendorId:s,w9Documents:[]}))}}}))(Jn);function ht({appContent:e,showFullScreenSkeletonWhileLoading:a}){const s=z(),t=J(),{vendorId:n}=O(),o=de(),d=ce(),i=R.getSignedInUser(),[u,h]=f.useState(!1),{useFeatureGate:S}=ne(),{isFeatureEnabled:r}=S(Y.isVendorRecommendationFeatureEnabled),c=m((C=>L(C))).companyName,p=new AbortController,g=p.signal;let y,x,I,D,E;if(n==null)throw new Error("Vendor ID not found for Vendor Filing 1099 Details Screen");y=m((C=>Pt(C,n))),x=m((C=>C.vendorFiling1099UploadDetailsState.vendor1099DetailsSaveStatus)),I=m((C=>C.vendorViewState.editVendorStateById[n]?.fetchStatus)),E=m((C=>C.vendorFiling1099UploadDetailsState.vendor1099DetailsLocalData.w9Documents?.[0])),D=m((C=>C.vendorFiling1099UploadDetailsState));const w=I?.fetchState==="In-Progress"||D?.w9FormUploadStatus?.fetchState==="In-Progress",b=()=>{d.toggle()};f.useEffect((()=>()=>{p.abort(),s(_t(n))}),[]),f.useEffect((()=>{u||n!=null&&(h(!0),s(za(!1,n,g)))}),[n]);const k=Oe(I?.fetchState),j=Oe(x?.fetchState),F=y.vendor?.contactIds,_=F?.[F.length-1],A=m((C=>C.contactState.contactById[_]));if(f.useEffect((()=>{n!=null&&k==="In-Progress"&&I?.fetchState==="Completed"&&y?.vendor!=null&&(s(Ya(n,y.vendor,A)),y?.vendor.filing1099W9Files?.[0]!=null&&s(Le({fetchState:"Completed",error:void 0})))}),[n,y?.vendor]),f.useEffect((()=>{j==="In-Progress"&&x?.fetchState==="Completed"&&t("../../vendors/filing_1099")}),[x?.fetchState]),a===!0&&I?.fetchState!=="Completed"&&I?.fetchState!=="Error")return l.jsx(Ws,{children:l.jsx(Rn,{})});if(i==null)throw Error("Can't access VendorFiling1099UploadScreen without signing in...");return l.jsxs($s,{windowSize:o,children:[o!=="small"?l.jsxs(qs,{children:[l.jsx(Gs,{onClick:b}),l.jsxs(Ks,{showContent:i.userEmailDomain==="zeni.ai",children:[l.jsx(Hs,{showAutofill:!1}),l.jsx(Qs,{showAutofill:!1,children:c})]})]}):null,l.jsx(Ys,{vendorId:n,file:E,showAutofill:!1,type:"w9",isVendorRecommendationEnabled:r,pdfTitle:E?Ms.w9FormTitle:void 0,showTitlebar:!0,showTitlebarIcon:!0,vendorLegalName:y?.vendor?.legalName,isLoading:w}),l.jsx(zs,{windowSize:o,children:e})]})}const Ks=N.div`
62
+ `,zs=J((function(e,a){const s=U.getSignedInUser(),t=e.tenantState.currentTenantId,n={userId:s?.userId??"",sessionId:s?.zeniSessionId??"",tenantId:t??""},o=e.vendorFiling1099UploadDetailsState,d=e.vendorFiling1099UploadDetailsState;let i={fetchState:"Not-Started",error:void 0};return a.vendorId!=null&&(i=e.vendorViewState.editVendorStateById[a.vendorId]?.fetchStatus),{uploadInvoiceEndPoint:`${Mt.documentAIMicroServiceBaseUrl}`,vendorFiling1099UploadDetailsState:o,vendorFiling1099UploadDetailsViewState:d,uploadStaus:d.w9FormUploadStatus,authParams:n,billId:a.billId,vendorId:a.vendorId,file:a.file,showAutofill:a.showAutofill,type:a.type,analytics:V,entityId:a.billId,fetchVendorFetchStatus:i,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(qa({w9FormFile:t.files[0]})),t.w9_form[0]!=null)){e(Wa({ocrData:t.w9_form[0],vendorId:s}));const n=(o=>({street:[o.street.join(" ")],city:o.city,state:o.state,postalCode:o.postal_code,countryCode:o.country_code??void 0,country:o.country??""}))(t.w9_form[0].address);e(Ot({addressType:"vendor_address",addressToCreate:n}))}},updateInvoiceUploadFetchState:t=>{e(Le({fetchState:t,error:void 0}))},onSkipAutofill:t=>{e(Ka(t))},onVendorFiling1099UploadDetailsSave:t=>{e(Bt(t))},onDeleteClick:()=>{e(Le({fetchState:"Not-Started",error:void 0})),e(Lt({vendorId:s,w9Documents:[]}))}}}))(Gn);function ht({appContent:e,showFullScreenSkeletonWhileLoading:a}){const s=Y(),t=G(),{vendorId:n}=R(),o=de(),d=ce(),i=U.getSignedInUser(),[u,h]=f.useState(!1),{useFeatureGate:S}=ne(),{isFeatureEnabled:r}=S(z.isVendorRecommendationFeatureEnabled),c=m((C=>L(C))).companyName,p=new AbortController,g=p.signal;let y,x,b,D,E;if(n==null)throw new Error("Vendor ID not found for Vendor Filing 1099 Details Screen");y=m((C=>Pt(C,n))),x=m((C=>C.vendorFiling1099UploadDetailsState.vendor1099DetailsSaveStatus)),b=m((C=>C.vendorViewState.editVendorStateById[n]?.fetchStatus)),E=m((C=>C.vendorFiling1099UploadDetailsState.vendor1099DetailsLocalData.w9Documents?.[0])),D=m((C=>C.vendorFiling1099UploadDetailsState));const w=b?.fetchState==="In-Progress"||D?.w9FormUploadStatus?.fetchState==="In-Progress",I=()=>{d.toggle()};f.useEffect((()=>()=>{p.abort(),s(_t(n))}),[]),f.useEffect((()=>{u||n!=null&&(h(!0),s(Ya(!1,n,g)))}),[n]);const k=Re(b?.fetchState),F=Re(x?.fetchState),j=y.vendor?.contactIds,_=j?.[j.length-1],A=m((C=>C.contactState.contactById[_]));if(f.useEffect((()=>{n!=null&&k==="In-Progress"&&b?.fetchState==="Completed"&&y?.vendor!=null&&(s(za(n,y.vendor,A)),y?.vendor.filing1099W9Files?.[0]!=null&&s(Le({fetchState:"Completed",error:void 0})))}),[n,y?.vendor]),f.useEffect((()=>{F==="In-Progress"&&x?.fetchState==="Completed"&&t("../../vendors/filing_1099")}),[x?.fetchState]),a===!0&&b?.fetchState!=="Completed"&&b?.fetchState!=="Error")return l.jsx(Qs,{children:l.jsx(Un,{})});if(i==null)throw Error("Can't access VendorFiling1099UploadScreen without signing in...");return l.jsxs($s,{windowSize:o,children:[o!=="small"?l.jsxs(qs,{children:[l.jsx(Js,{onClick:I}),l.jsxs(Ks,{showContent:i.userEmailDomain==="zeni.ai",children:[l.jsx(Ws,{showAutofill:!1}),l.jsx(Hs,{showAutofill:!1,children:c})]})]}):null,l.jsx(zs,{vendorId:n,file:E,showAutofill:!1,type:"w9",isVendorRecommendationEnabled:r,pdfTitle:E?Ms.w9FormTitle:void 0,showTitlebar:!0,showTitlebarIcon:!0,vendorLegalName:y?.vendor?.legalName,isLoading:w}),l.jsx(Ys,{windowSize:o,children:e})]})}const Ks=N.div`
63
63
  display: ${e=>e.showContent?"flex":"none"};
64
64
  align-items: center;
65
65
  `,qs=N.div`
66
- margin-bottom: ${X.sp3};
67
- margin-top: ${X.sp3};
68
- margin-left: ${X.sp8};
66
+ margin-bottom: ${Z.sp3};
67
+ margin-top: ${Z.sp3};
68
+ margin-left: ${Z.sp8};
69
69
  position: absolute;
70
70
  display: flex;
71
71
  align-items: center;
72
- `,Hs=N.div`
73
- width: 1px;
74
- height: ${X.sp3};
75
- margin: ${X.sp0} ${X.sp3};
76
- background-color: ${e=>e.showAutofill?Jt.neutralGrey1Light:e.theme.colors.hero};
77
- `,Qs=N(Mn.StandardMedium)`
78
- color: ${e=>e.showAutofill?Jt.neutralGrey5Light:e.theme.colors.primary};
79
72
  `,Ws=N.div`
73
+ width: 1px;
74
+ height: ${Z.sp3};
75
+ margin: ${Z.sp0} ${Z.sp3};
76
+ background-color: ${e=>e.showAutofill?Gt.neutralGrey1Light:e.theme.colors.hero};
77
+ `,Hs=N(Mn.StandardMedium)`
78
+ color: ${e=>e.showAutofill?Gt.neutralGrey5Light:e.theme.colors.primary};
79
+ `,Qs=N.div`
80
80
  width: 100%;
81
81
  height: 100vh;
82
82
  overflow: hidden;
83
83
  background-color: ${e=>e.theme.colors.grey4};
84
- `,Xs=G((function(e){const a=Qa(e);return{vendorDetailView:Wa(e),globalMerchantView:a}}),(function(e,a){const{navigate:s}=a;return{updateVendorDetailLocalData:t=>{e(Ot({vendorDetails:t}))},fetchRecommendation:t=>{e(Za("tenant",t))},onSaveClick:()=>{e(Xa())},onBackClick:()=>{s("../review")}}}))(Gn);function Zs(){const e=J();return l.jsx(Xs,{navigate:e})}const eo=N.div`
84
+ `,Zs=J((function(e){const a=Ha(e);return{vendorDetailView:Qa(e),globalMerchantView:a}}),(function(e,a){const{navigate:s}=a;return{updateVendorDetailLocalData:t=>{e(Rt({vendorDetails:t}))},fetchRecommendation:t=>{e(Xa("tenant",t))},onSaveClick:()=>{e(Za())},onBackClick:()=>{s("../review")}}}))(Jn);function Xs(){const e=G();return l.jsx(Zs,{navigate:e})}const eo=N.div`
85
85
  display: flex;
86
86
  min-height: 100%;
87
87
  width: 100%;
@@ -89,11 +89,11 @@ import{j as l}from"./liveblocks-D0hIH2N0.js";import{a as f}from"./sentry-DhqS_W-
89
89
  flex-direction: column;
90
90
  align-items: center;
91
91
  background-color: ${e=>e.theme.colors.grey4};
92
- `,to=G((function(e,a){const{vendorFirstReviewDetails:s}=a,t=e.globalMerchantAutoCompleteState.autoCompleteText,n=R.getSignedInUser(),o=e.tenantState.currentTenantId,d={userId:n?.userId??"",sessionId:n?.zeniSessionId??"",tenantId:o??""},i=L(e);return{vendorFirstReviewView:s,globalMerchantAutoCompleteData:{globalMerchantAutoCompleteView:s.globalMerchantAutoCompleteView,autoCompleteText:t},analytics:V,authParams:d,attachmentEndpoint:i.externalConnections?.accounting[0]?.connectionName==="netsuite"?`${ee}/vendor_attachments_accounting_provider`:`${ee}/vendor_attachments`}}),(function(e,a){const{navigate:s}=a;return{onFetchVendorReviewView:(t,n,o)=>{e(Be(t,n,o))},onGlobalMerchantAutoCompleteInputChange:(t,n)=>{t.trim().length>=2?e(cn({searchString:t,globalMerchantType:n??"vendor"})):t.trim().length===0&&e(rt())},onUpdateLocalData:(t,n,o,d)=>{if(n!=null){const i=ao(n);e(ln({vendorId:t,currentSelection:i,selectedGlobalMerchantId:o,vendorRenamedText:d}))}},onResetVendorLocalData:t=>{e(on({vendorId:t}))},onVendorNameClick:(t,n)=>{if(a.tenantEmailDomain!=null){const o=tt(t,n,a.tenantEmailDomain),d=M(a.location.state?.pathnameStackToGoBack,a.location.pathname);a.navigate(o,{state:{pathnameStackToGoBack:d}})}},onUpdatePageToken:t=>{e(sn({pageToken:t}))},onUpdateSortUiState:(t,n)=>{e(nn({sortOrder:t,sortKey:n}))},onUpdateScrollYOffset:t=>{e(an({scrollYOffset:t}))},onClickSave:(t,n,o)=>{e(tn(t,n,o))},onClickCancelPopup:()=>{e(en())},onClearGlobalMerchantAutoCompleteResults:()=>{e(rt())},onClickRedirectToQBO:()=>{window.open(`${Ze.qboRedirectionUrl}/vendors`,"_blank")},updateVendorDetailLocalData:t=>{e(Ot({vendorDetails:t})),s(`./vendor/${t.id}`)},onBackClick:()=>{s("../..")},onReloadList:()=>{e(Be(null))}}}))($n);function pt(){const e=J(),a=z(),s=K(),{tenantEmailDomain:t}=O(),n=de(),o=R.getSignedInUser(),{vendorId:d}=O(),i=m((c=>dt(c))),[u,h]=f.useState(!1),S=m((c=>dt(c).fetchState));if(f.useEffect((()=>{S==="Not-Started"&&u===!1&&(a(Be(null)),h(!0))}),[]),o==null)throw Error("Can't access first review page without signing in...");const r=c=>c.trackPageLoaded(et.Event.vendorTenantReviewListPage);return l.jsxs(l.Fragment,{children:[S==="Completed"?l.jsx(Z,{analytics:V,onLoad:r}):null,l.jsx(Z,{analytics:V,onLoad:r}),l.jsx(ts,{isOpen:d!=null,drawerLeftMargin:new Xe(0,0,300,600),onClose:()=>{e("../review")},children:l.jsx(no,{onClick:c=>c.stopPropagation(),children:l.jsx(Zs,{})})}),l.jsx(eo,{windowSize:n,children:l.jsx(to,{location:s,navigate:e,vendorFirstReviewDetails:i,tenantEmailDomain:t})})]})}const ao=e=>e.recommendedFirst===!0?"recommendedFirst":e.recommendedSecond===!0?"recommendedSecond":e.retain===!0?"retain":e.rename===!0?"rename":e.customMerchant===!0?"customMerchant":null,no=N(Gt)`
92
+ `,to=J((function(e,a){const{vendorFirstReviewDetails:s}=a,t=e.globalMerchantAutoCompleteState.autoCompleteText,n=U.getSignedInUser(),o=e.tenantState.currentTenantId,d={userId:n?.userId??"",sessionId:n?.zeniSessionId??"",tenantId:o??""},i=L(e);return{vendorFirstReviewView:s,globalMerchantAutoCompleteData:{globalMerchantAutoCompleteView:s.globalMerchantAutoCompleteView,autoCompleteText:t},analytics:V,authParams:d,attachmentEndpoint:i.externalConnections?.accounting[0]?.connectionName==="netsuite"?`${ee}/vendor_attachments_accounting_provider`:`${ee}/vendor_attachments`}}),(function(e,a){const{navigate:s}=a;return{onFetchVendorReviewView:(t,n,o)=>{e(Be(t,n,o))},onGlobalMerchantAutoCompleteInputChange:(t,n)=>{t.trim().length>=2?e(cn({searchString:t,globalMerchantType:n??"vendor"})):t.trim().length===0&&e(rt())},onUpdateLocalData:(t,n,o,d)=>{if(n!=null){const i=ao(n);e(ln({vendorId:t,currentSelection:i,selectedGlobalMerchantId:o,vendorRenamedText:d}))}},onResetVendorLocalData:t=>{e(on({vendorId:t}))},onVendorNameClick:(t,n)=>{if(a.tenantEmailDomain!=null){const o=tt(t,n,a.tenantEmailDomain),d=M(a.location.state?.pathnameStackToGoBack,a.location.pathname);a.navigate(o,{state:{pathnameStackToGoBack:d}})}},onUpdatePageToken:t=>{e(sn({pageToken:t}))},onUpdateSortUiState:(t,n)=>{e(nn({sortOrder:t,sortKey:n}))},onUpdateScrollYOffset:t=>{e(an({scrollYOffset:t}))},onClickSave:(t,n,o)=>{e(tn(t,n,o))},onClickCancelPopup:()=>{e(en())},onClearGlobalMerchantAutoCompleteResults:()=>{e(rt())},onClickRedirectToQBO:()=>{window.open(`${Xe.qboRedirectionUrl}/vendors`,"_blank")},updateVendorDetailLocalData:t=>{e(Rt({vendorDetails:t})),s(`./vendor/${t.id}`)},onBackClick:()=>{s("../..")},onReloadList:()=>{e(Be(null))}}}))($n);function pt(){const e=G(),a=Y(),s=K(),{tenantEmailDomain:t}=R(),n=de(),o=U.getSignedInUser(),{vendorId:d}=R(),i=m((c=>dt(c))),[u,h]=f.useState(!1),S=m((c=>dt(c).fetchState));if(f.useEffect((()=>{S==="Not-Started"&&u===!1&&(a(Be(null)),h(!0))}),[]),o==null)throw Error("Can't access first review page without signing in...");const r=c=>c.trackPageLoaded(et.Event.vendorTenantReviewListPage);return l.jsxs(l.Fragment,{children:[S==="Completed"?l.jsx(X,{analytics:V,onLoad:r}):null,l.jsx(X,{analytics:V,onLoad:r}),l.jsx(ts,{isOpen:d!=null,drawerLeftMargin:new Ze(0,0,300,600),onClose:()=>{e("../review")},children:l.jsx(no,{onClick:c=>c.stopPropagation(),children:l.jsx(Xs,{})})}),l.jsx(eo,{windowSize:n,children:l.jsx(to,{location:s,navigate:e,vendorFirstReviewDetails:i,tenantEmailDomain:t})})]})}const ao=e=>e.recommendedFirst===!0?"recommendedFirst":e.recommendedSecond===!0?"recommendedSecond":e.retain===!0?"retain":e.rename===!0?"rename":e.customMerchant===!0?"customMerchant":null,no=N(Jt)`
93
93
  display: flex;
94
94
  min-height: 100%;
95
95
  flex-direction: column;
96
- `,so=G((function(e,a){const s=R.getSignedInUser(),t=e.tenantState.currentTenantId,n=e.vendorFiling1099UploadDetailsState,o={userId:s?.userId??"",sessionId:s?.zeniSessionId??"",tenantId:t??""};let d={fetchState:"Not-Started",error:void 0};return a.vendorId!=null&&(d=e.vendorViewState.editVendorStateById[a.vendorId]?.fetchStatus),{analytics:V,vendorFiling1099UploadDetailsViewState:n,authParams:o,googleAPIKey:Ze.googleMapsAPIKey,vendorId:a.vendorId,fetchVendorFetchStatus:d,vendor:a.vendorFiling1099UploadDetails?.vendor}}),(function(e,a){const{currentTenant:s,navigate:t,location:n,vendorId:o,vendorFiling1099UploadDetails:d}=a,{tenantEmailDomain:i}=s;return{onVendorFiling1099UploadDetailsSave:u=>{e(Bt(u)),V.trackVendor1099DetailSave(d.vendor.legalName??"")},onSaveChangesToLocalStore:u=>{e(Lt(u))},onResetVendorFiling1099FormStatus:()=>{e(dn())},onAddressEditHandler:u=>{const h=Qn((S=>({street:S.vendor1099FilingSectionId.street,suite:S.vendor1099FilingSectionId.suite,city:S.vendor1099FilingSectionId.city,state:S.vendor1099FilingSectionId.state,country:S.vendor1099FilingSectionId.country,countryCode:S.vendor1099FilingSectionId.countryCode,postalCode:S.vendor1099FilingSectionId.postalCode,secondaryInfo:S.vendor1099FilingSectionId.secondaryInfo}))(u));e(Ut({addressType:"vendor_address",addressToCreate:h}))},goBackToListPage:()=>{e(_t(o));const u=`/${i}/vendors/filing_1099/`,h=M(n.state?.pathnameStackToGoBack,n.pathname);t(u,{state:{pathnameStackToGoBack:h}})},onAddressClick:u=>{const h=(function(r,c,p){let g=`/${r}/vendors/filing_1099/upload/${p}/edit`;return g=g.concat(`/new/${c}`),g})(i,u,o),S=M(n.state?.pathnameStackToGoBack,n.pathname);t(h,{state:{pathnameStackToGoBack:S}})},AddressFormPage:Yn}}))(zn);function oo(){const e=J(),a=K(),{vendorId:s}=O(),t=m((i=>L(i)));let n;if(s==null)throw new Error("Vendor ID not found for Vendor Filing 1099 Details Screen");n=m((i=>Pt(i,s)));const{tenantEmailDomain:o}=t,d=t.companyId??R.getSignedInUserTenant(o)?.companyId;if(d==null)throw new Error("Company ID not found for Vendor Filing 1099 Details Screen");return l.jsx(so,{location:a,navigate:e,currentTenant:t,vendorId:s,vendorFiling1099UploadDetails:n,companyId:d})}const lo=N.div`
96
+ `,so=J((function(e,a){const s=U.getSignedInUser(),t=e.tenantState.currentTenantId,n=e.vendorFiling1099UploadDetailsState,o={userId:s?.userId??"",sessionId:s?.zeniSessionId??"",tenantId:t??""};let d={fetchState:"Not-Started",error:void 0};return a.vendorId!=null&&(d=e.vendorViewState.editVendorStateById[a.vendorId]?.fetchStatus),{analytics:V,vendorFiling1099UploadDetailsViewState:n,authParams:o,googleAPIKey:Xe.googleMapsAPIKey,vendorId:a.vendorId,fetchVendorFetchStatus:d,vendor:a.vendorFiling1099UploadDetails?.vendor}}),(function(e,a){const{currentTenant:s,navigate:t,location:n,vendorId:o,vendorFiling1099UploadDetails:d}=a,{tenantEmailDomain:i}=s;return{onVendorFiling1099UploadDetailsSave:u=>{e(Bt(u)),V.trackVendor1099DetailSave(d.vendor.legalName??"")},onSaveChangesToLocalStore:u=>{e(Lt(u))},onResetVendorFiling1099FormStatus:()=>{e(dn())},onAddressEditHandler:u=>{const h=Hn((S=>({street:S.vendor1099FilingSectionId.street,suite:S.vendor1099FilingSectionId.suite,city:S.vendor1099FilingSectionId.city,state:S.vendor1099FilingSectionId.state,country:S.vendor1099FilingSectionId.country,countryCode:S.vendor1099FilingSectionId.countryCode,postalCode:S.vendor1099FilingSectionId.postalCode,secondaryInfo:S.vendor1099FilingSectionId.secondaryInfo}))(u));e(Ot({addressType:"vendor_address",addressToCreate:h}))},goBackToListPage:()=>{e(_t(o));const u=`/${i}/vendors/filing_1099/`,h=M(n.state?.pathnameStackToGoBack,n.pathname);t(u,{state:{pathnameStackToGoBack:h}})},onAddressClick:u=>{const h=(function(r,c,p){let g=`/${r}/vendors/filing_1099/upload/${p}/edit`;return g=g.concat(`/new/${c}`),g})(i,u,o),S=M(n.state?.pathnameStackToGoBack,n.pathname);t(h,{state:{pathnameStackToGoBack:S}})},AddressFormPage:zn}}))(Yn);function oo(){const e=G(),a=K(),{vendorId:s}=R(),t=m((i=>L(i)));let n;if(s==null)throw new Error("Vendor ID not found for Vendor Filing 1099 Details Screen");n=m((i=>Pt(i,s)));const{tenantEmailDomain:o}=t,d=t.companyId??U.getSignedInUserTenant(o)?.companyId;if(d==null)throw new Error("Company ID not found for Vendor Filing 1099 Details Screen");return l.jsx(so,{location:a,navigate:e,currentTenant:t,vendorId:s,vendorFiling1099UploadDetails:n,companyId:d})}const lo=N.div`
97
97
  display: flex;
98
98
  min-height: 100%;
99
99
  width: 100%;
@@ -101,7 +101,7 @@ import{j as l}from"./liveblocks-D0hIH2N0.js";import{a as f}from"./sentry-DhqS_W-
101
101
  flex-direction: column;
102
102
  align-items: center;
103
103
  background-color: ${e=>e.theme.colors.grey4};
104
- `,io=G((function(e,a){const{vendorsFiling1099ListDetails:s,accountMappingView:t,analytics:n}=a;return{analytics:n,vendorsFiling1099List:s.vendors,isVendor1099Populated:s.isVendor1099Populated,accountMappingView:t,fetchState:s.fetchState,uiState:s.uiState,lastRefreshSuccessTime:s.lastRefreshSuccessTime,vendorTabsToShow:a.vendorTabsToShow}}),(function(e,a){const{navigate:s,analytics:t}=a;return{onUpdateSortUiState:(n,o)=>{e(gn({sortOrder:n,sortKey:o}))},onUpdateSearchUiState:n=>{e(fn({searchString:n}))},onVendorRowClick:n=>{if(a.tenantEmailDomain!=null){const o=`/${a.tenantEmailDomain}/vendors/filing_1099/upload/${encodeURIComponent(n)}/edit`,d=M(a.location.state?.pathnameStackToGoBack,a.location.pathname);a.navigate(o,{state:{pathnameStackToGoBack:d}})}},onReloadVendors:()=>{e(Ue(!0))},onBackClick:()=>{e(mn()),e(Sn())},onVendorTabSelectionChanged:n=>{const o=ge(n);s(o),e(ie(ve(n)))},onAccountMappingChange:n=>{const{filing1099:o}=n,{bankAccount:d,expenseCategory1099:i}=o,u=as(a.accountMappingView.bankAccounts1099FilingAccountList,d.selectedOptions),h=ns(a.accountMappingView.expenseAccounts1099FilingAccountList,i),S={selectedBankAccounts1099FilingAccountIds:u.map((r=>r.accountId)),selectedExpenseAccounts1099FilingAccountIds:h};e(pn({data:S}))},onSaveClick:()=>{e(hn()),t.track(et.Event.vendor1099TabSettingsSave)}}}))(Kn);function mt({vendorTabsToShow:e,previousTabPosition:a,setPreviousTabPosition:s}){const t=J(),n=z(),o=K(),{tenantEmailDomain:d}=O(),i=de(),u=R.getSignedInUser(),[h,S]=f.useState(!1),[r,c]=f.useState(!1);if(u==null)throw Error("Can't access vendor filing 1099 page without signing in...");xe();const p=m((b=>rn(b))),g=m((b=>un(b))),{isAiCfoAccessEnabled:y,onAskAiCfoClick:x}=Se({mobileExploreReferrer:"Vendors — 1099"});me({isDataReady:p.fetchState==="Completed"}),f.useEffect((()=>{r||(c(!0),n(Ue(!1)))}),[r,c]),f.useEffect((()=>{g.saveState.fetchState==="Completed"&&n(Ue(!1))}),[g.saveState.fetchState]);const I=b=>{S(b)},D=m((b=>L(b))),E={userId:u?.userId??"",sessionId:u?.zeniSessionId??"",tenantId:D.tenantId},w=f.useMemo((()=>({authParams:E,tenantName:D.companyName,filing1099ReportEndPoint:`${ee}/filing1099Reports`})),[]);return l.jsxs(l.Fragment,{children:[p.fetchState==="Completed"?l.jsx(l.Fragment,{children:l.jsx(Z,{analytics:V,onLoad:()=>V.trackPageLoaded(et.Event.vendor1099ListPage)})}):null,l.jsxs(lo,{windowSize:i,children:[l.jsx(fe,{isAppContentDrawerOpen:h,handleDrawerToggle:I}),l.jsx(io,{location:o,navigate:t,previousTabPosition:a,setPreviousTabPosition:s,analytics:V,vendorsFiling1099ListDetails:p,vendorTypeList:p.vendorTypeList,accountMappingView:g,downloadParams:w,tenantEmailDomain:d,vendorTabsToShow:e,isAiCfoAccessEnabled:y,onAskAiCfoClick:x,onClickMenuIcon:()=>{I(!0)}})]})]})}const co=N.div`
104
+ `,io=J((function(e,a){const{vendorsFiling1099ListDetails:s,accountMappingView:t,analytics:n}=a;return{analytics:n,vendorsFiling1099List:s.vendors,isVendor1099Populated:s.isVendor1099Populated,accountMappingView:t,fetchState:s.fetchState,uiState:s.uiState,lastRefreshSuccessTime:s.lastRefreshSuccessTime,vendorTabsToShow:a.vendorTabsToShow}}),(function(e,a){const{navigate:s,analytics:t}=a;return{onUpdateSortUiState:(n,o)=>{e(gn({sortOrder:n,sortKey:o}))},onUpdateSearchUiState:n=>{e(fn({searchString:n}))},onVendorRowClick:n=>{if(a.tenantEmailDomain!=null){const o=`/${a.tenantEmailDomain}/vendors/filing_1099/upload/${encodeURIComponent(n)}/edit`,d=M(a.location.state?.pathnameStackToGoBack,a.location.pathname);a.navigate(o,{state:{pathnameStackToGoBack:d}})}},onReloadVendors:()=>{e(Oe(!0))},onBackClick:()=>{e(mn()),e(Sn())},onVendorTabSelectionChanged:n=>{const o=ge(n);s(o),e(ie(ve(n)))},onAccountMappingChange:n=>{const{filing1099:o}=n,{bankAccount:d,expenseCategory1099:i}=o,u=as(a.accountMappingView.bankAccounts1099FilingAccountList,d.selectedOptions),h=ns(a.accountMappingView.expenseAccounts1099FilingAccountList,i),S={selectedBankAccounts1099FilingAccountIds:u.map((r=>r.accountId)),selectedExpenseAccounts1099FilingAccountIds:h};e(pn({data:S}))},onSaveClick:()=>{e(hn()),t.track(et.Event.vendor1099TabSettingsSave)}}}))(Kn);function mt({vendorTabsToShow:e,previousTabPosition:a,setPreviousTabPosition:s}){const t=G(),n=Y(),o=K(),{tenantEmailDomain:d}=R(),i=de(),u=U.getSignedInUser(),[h,S]=f.useState(!1),[r,c]=f.useState(!1);if(u==null)throw Error("Can't access vendor filing 1099 page without signing in...");xe();const p=m((I=>rn(I))),g=m((I=>un(I))),{isAiCfoAccessEnabled:y,onAskAiCfoClick:x}=Se({mobileExploreReferrer:"Vendors — 1099"});me({isDataReady:p.fetchState==="Completed"}),f.useEffect((()=>{r||(c(!0),n(Oe(!1)))}),[r,c]),f.useEffect((()=>{g.saveState.fetchState==="Completed"&&n(Oe(!1))}),[g.saveState.fetchState]);const b=I=>{S(I)},D=m((I=>L(I))),E={userId:u?.userId??"",sessionId:u?.zeniSessionId??"",tenantId:D.tenantId},w=f.useMemo((()=>({authParams:E,tenantName:D.companyName,filing1099ReportEndPoint:`${ee}/filing1099Reports`})),[]);return l.jsxs(l.Fragment,{children:[p.fetchState==="Completed"?l.jsx(l.Fragment,{children:l.jsx(X,{analytics:V,onLoad:()=>V.trackPageLoaded(et.Event.vendor1099ListPage)})}):null,l.jsxs(lo,{windowSize:i,children:[l.jsx(fe,{isAppContentDrawerOpen:h,handleDrawerToggle:b}),l.jsx(io,{location:o,navigate:t,previousTabPosition:a,setPreviousTabPosition:s,analytics:V,vendorsFiling1099ListDetails:p,vendorTypeList:p.vendorTypeList,accountMappingView:g,downloadParams:w,tenantEmailDomain:d,vendorTabsToShow:e,isAiCfoAccessEnabled:y,onAskAiCfoClick:x,onClickMenuIcon:()=>{b(!0)}})]})]})}const co=N.div`
105
105
  display: flex;
106
106
  min-height: 100%;
107
107
  width: 100%;
@@ -109,4 +109,4 @@ import{j as l}from"./liveblocks-D0hIH2N0.js";import{a as f}from"./sentry-DhqS_W-
109
109
  flex-direction: column;
110
110
  align-items: center;
111
111
  background-color: ${e=>e.theme.colors.grey4};
112
- `,ro=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:W(e),analytics:V}}),(function(e,a){const{navigate:s}=a;return{onFetchVendorsList:(t="",n,o)=>{e(Dn({searchString:t,keepExistingListItems:n,view:"vendorsTab",pageToken:o}))},onUpdatePageToken:t=>{e(Cn({pageToken:t}))},onUpdateSortUiState:(t,n)=>{e(yn({sortOrder:t,sortkey:n}))},onUpdateCurrentYTDSelection:t=>{e(Tn({ytdSpendSelection:t}))},onVendorRowClick:(t,n)=>{if(a.tenantEmailDomain!=null){const o=tt(t,n,a.tenantEmailDomain),d=M(a.location.state?.pathnameStackToGoBack,a.location.pathname);a.navigate(o,{state:{pathnameStackToGoBack:d,referrer:"Vendor List"}})}},onReloadVendors:()=>{console.log("Reload vendors")},onUpdateScrollYOffset:t=>{e(xn({scrollYOffset:t}))},onBackClick:()=>{s("../..")},onVendorTabSelectionChanged:t=>{const n=ge(t);s(n),e(ie(ve(t)))}}}))(qn);function uo({vendorTabsToShow:e,previousTabPosition:a,setPreviousTabPosition:s}){const t=J(),n=z(),o=K(),{tenantEmailDomain:d}=O(),i=de(),u=R.getSignedInUser(),{useFeatureGate:h}=ne(),{isFeatureEnabled:S,isFeatureGateLoading:r}=h(Y.isOpexByVendorFeatureEnabled);xe();const c=e.includes("prepaid_expenses"),p=e.includes("fixed_assets"),g=e.includes("accrued_expenses"),y=m((P=>pe(P)));let x={};x=m((P=>vn(P,"vendorsTab")));const[I,D]=f.useState(!1),{isAiCfoAccessEnabled:E,onAskAiCfoClick:w}=Se({mobileExploreReferrer:"Vendors Summary"});me({isDataReady:x.fetchState==="Completed"});const b=m((P=>ae(P))),k=m((P=>H(P).isReportGenerated));m((P=>H(P).fetchState))==="Completed"&&k&&S&&!e.includes("operating_expenses_by_vendor")&&e.splice(1,0,"operating_expenses_by_vendor");const[j,F]=f.useState(!1);if(f.useEffect((()=>{(c||p)&&j===!1&&b!=="Completed"&&(n(Te()),F(!0))}),[j]),f.useEffect((()=>{n(ye({shouldFetchAccruedExpenses:g,shouldFetchFixedAssets:p,shouldFetchPrepaidExpenses:c,shouldFetchOpexByVendor:S&&r===!1,shouldFetchVendorsList:!0,shouldFetchFiling1099Vendor:!1}))}),[b,p,r,S]),f.useEffect((()=>{I||x.fetchState!=="Completed"||(D(!0),V.trackVendorList(y.currentTab,y.previousTab??null,x.totalVendorCount,x.uiState.sortKey,x.uiState.ytdSpendSelection))}),[x.fetchState]),u==null)throw Error("Can't access address page without signing in...");const[_,A]=f.useState(!1),C=P=>{A(P)};return l.jsxs(co,{windowSize:i,children:[l.jsx(fe,{isAppContentDrawerOpen:_,handleDrawerToggle:C}),l.jsx(ro,{location:o,navigate:t,vendorsListDetails:x,tenantEmailDomain:d,vendorTabsToShow:e,onClickMenuIcon:()=>{C(!0)},previousTabPosition:a,setPreviousTabPosition:s,isAiCfoAccessEnabled:E,onAskAiCfoClick:w})]})}function Oo(){const{useFeatureGate:e}=ne(),a=K().state?.referrer,[s,t]=f.useState(!1),[n,o]=f.useState(0),d=R.getSignedInUser(),i=En(d),{isFeatureEnabled:u}=e(Y.isOpexByVendorFeatureEnabled),{isFeatureEnabled:h}=e(Y.isVendorReviewFeatureEnabled),{isFeatureEnabled:S}=e(Y.isScheduledJEPrepaidExpensesFeatureEnabled),{isFeatureEnabled:r}=e(Y.isScheduledJEFixedAssetsFeatureEnabled),{isFeatureEnabled:c}=e(Y.isScheduledJEAccruedExpensesFeatureEnabled),{isFeatureEnabled:p}=e(Y.isFiling1099FeatureEnabled),g=m((w=>L(w))),y=g?.externalConnections?.accounting[0]?.connectionName,x=["vendors_tab"];y!=="netsuite"&&S===!0&&x.push("prepaid_expenses"),y!=="netsuite"&&r===!0&&x.push("fixed_assets"),y!=="netsuite"&&c===!0&&x.push("accrued_expenses"),y!=="netsuite"&&p&&i&&(x.push("filing_1099"),u&&x.splice(1,0,"operating_expenses_by_vendor"));const{isFeatureEnabled:I}=e(Y.isDebitCardFeatureEnabled),D=In(I,g),E=bn(g);return D===!0||E===!0?l.jsx(at,{children:l.jsx(B,{path:"/*",element:l.jsx(Xn,{})})}):l.jsxs(at,{children:[l.jsx(B,{path:"/opex",element:u===!0?l.jsx(Bs,{previousTabPosition:n,setPreviousTabPosition:o,vendorTabsToShow:x}):l.jsx($,{to:"../summary"})}),l.jsx(B,{path:"/summary",element:l.jsx(uo,{previousTabPosition:n,setPreviousTabPosition:o,vendorTabsToShow:x})}),l.jsx(B,{path:"schedules/fixed_assets/details/:scheduleDetailId",element:r===!0?l.jsx(fs,{}):l.jsx($,{to:"../../vendors/opex"})}),l.jsx(B,{path:"schedules/accrued_expenses/details/:scheduleDetailId",element:r===!0?l.jsx(us,{shouldNavigateBack:s,setShouldNavigateBack:t}):l.jsx($,{to:"../../vendors/opex"})}),l.jsx(B,{path:"schedules/one_time_accrual/details/:accrualId",element:c===!0?l.jsx(ss,{}):l.jsx($,{to:"../../vendors/opex"})}),l.jsx(B,{path:"schedules/:scheduleType/details/:scheduleDetailId",element:S===!0?l.jsx(Cs,{}):l.jsx($,{to:"../../vendors/opex"})}),l.jsx(B,{path:"schedules/:scheduleType/details/:scheduleDetailId/edit_link",element:S===!0||r===!0?l.jsx(ws,{}):l.jsx($,{to:"../../vendors/opex"})}),l.jsx(B,{path:"schedules/accrued_expenses/details/:scheduleDetailId/edit_link",element:c===!0?l.jsx(is,{setShouldNavigateBack:t}):l.jsx($,{to:"../../vendors/opex"})}),l.jsx(B,{path:"schedules/prepaid_expenses",element:S===!0?l.jsx(Os,{previousTabPosition:n,setPreviousTabPosition:o,vendorTabsToShow:x}):l.jsx($,{to:"../opex"})}),l.jsx(B,{path:"schedules/fixed_assets",element:r===!0?l.jsx(Ps,{previousTabPosition:n,setPreviousTabPosition:o,vendorTabsToShow:x}):l.jsx($,{to:"../opex"})}),l.jsx(B,{path:"schedules/accrued_expenses",element:c===!0?l.jsx(Fs,{previousTabPosition:n,setPreviousTabPosition:o,vendorTabsToShow:x}):l.jsx($,{to:"../opex"})}),l.jsx(B,{path:"/filing_1099",element:p&&i?l.jsx(mt,{previousTabPosition:n,setPreviousTabPosition:o,vendorTabsToShow:x}):l.jsx($,{to:"../opex"})}),l.jsx(B,{path:"/filing_1099/:vendorId",element:p&&i?l.jsx(mt,{vendorTabsToShow:x,previousTabPosition:n,setPreviousTabPosition:o}):l.jsx($,{to:"../opex"})}),l.jsx(B,{path:"/filing_1099/upload/:vendorId/edit",element:p&&i?l.jsx(ht,{appContent:l.jsx(oo,{}),showFullScreenSkeletonWhileLoading:!0}):l.jsx($,{to:"../opex"})}),l.jsx(B,{path:"/filing_1099/upload/:vendorId/edit/new/:addressType",element:p&&i?l.jsx(ht,{appContent:l.jsx(Wn,{isSubPage:!0,hideAddressBackButton:!0,hideAddressSubTitle:!0})}):l.jsx($,{to:"../opex"})}),l.jsx(B,{path:"/summary/:vendorId/:qboId",element:l.jsx(ut,{referrerType:a,isFiling1099FeatureEnabled:p&&i})}),l.jsx(B,{path:"/summary/:vendorId/:qboId/:timeframe/:startDate/:endDate",element:l.jsx(ut,{referrerType:a,isFiling1099FeatureEnabled:p&&i})}),l.jsx(B,{path:"/review",element:h===!0?l.jsx(pt,{}):l.jsx(Q,{})}),l.jsx(B,{path:"/review/vendor/:vendorId",element:h?l.jsx(pt,{}):l.jsx(Q,{})}),l.jsx(B,{path:"/",element:l.jsx($,{to:"summary"})}),l.jsx(B,{path:"*",element:l.jsx(Q,{})})]})}export{Oo as default};
112
+ `,ro=J((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:Q(e),analytics:V}}),(function(e,a){const{navigate:s}=a;return{onFetchVendorsList:(t="",n,o)=>{e(Dn({searchString:t,keepExistingListItems:n,view:"vendorsTab",pageToken:o}))},onUpdatePageToken:t=>{e(Cn({pageToken:t}))},onUpdateSortUiState:(t,n)=>{e(yn({sortOrder:t,sortkey:n}))},onUpdateCurrentYTDSelection:t=>{e(Tn({ytdSpendSelection:t}))},onVendorRowClick:(t,n)=>{if(a.tenantEmailDomain!=null){const o=tt(t,n,a.tenantEmailDomain),d=M(a.location.state?.pathnameStackToGoBack,a.location.pathname);a.navigate(o,{state:{pathnameStackToGoBack:d,referrer:"Vendor List"}})}},onReloadVendors:()=>{console.log("Reload vendors")},onUpdateScrollYOffset:t=>{e(xn({scrollYOffset:t}))},onBackClick:()=>{s("../..")},onVendorTabSelectionChanged:t=>{const n=ge(t);s(n),e(ie(ve(t)))}}}))(qn);function uo({vendorTabsToShow:e,previousTabPosition:a,setPreviousTabPosition:s}){const t=G(),n=Y(),o=K(),{tenantEmailDomain:d}=R(),i=de(),u=U.getSignedInUser(),{useFeatureGate:h}=ne(),{isFeatureEnabled:S,isFeatureGateLoading:r}=h(z.isOpexByVendorFeatureEnabled);xe();const c=e.includes("prepaid_expenses"),p=e.includes("fixed_assets"),g=e.includes("accrued_expenses"),y=m((P=>pe(P)));let x={};x=m((P=>vn(P,"vendorsTab")));const[b,D]=f.useState(!1),{isAiCfoAccessEnabled:E,onAskAiCfoClick:w}=Se({mobileExploreReferrer:"Vendors Summary"});me({isDataReady:x.fetchState==="Completed"});const I=m((P=>ae(P))),k=m((P=>W(P).isReportGenerated));m((P=>W(P).fetchState))==="Completed"&&k&&S&&!e.includes("operating_expenses_by_vendor")&&e.splice(1,0,"operating_expenses_by_vendor");const[F,j]=f.useState(!1);if(f.useEffect((()=>{(c||p)&&F===!1&&I!=="Completed"&&(n(Te()),j(!0))}),[F]),f.useEffect((()=>{n(ye({shouldFetchAccruedExpenses:g,shouldFetchFixedAssets:p,shouldFetchPrepaidExpenses:c,shouldFetchOpexByVendor:S&&r===!1,shouldFetchVendorsList:!0,shouldFetchFiling1099Vendor:!1}))}),[I,p,r,S]),f.useEffect((()=>{b||x.fetchState!=="Completed"||(D(!0),V.trackVendorList(y.currentTab,y.previousTab??null,x.totalVendorCount,x.uiState.sortKey,x.uiState.ytdSpendSelection))}),[x.fetchState]),u==null)throw Error("Can't access address page without signing in...");const[_,A]=f.useState(!1),C=P=>{A(P)};return l.jsxs(co,{windowSize:i,children:[l.jsx(fe,{isAppContentDrawerOpen:_,handleDrawerToggle:C}),l.jsx(ro,{location:o,navigate:t,vendorsListDetails:x,tenantEmailDomain:d,vendorTabsToShow:e,onClickMenuIcon:()=>{C(!0)},previousTabPosition:a,setPreviousTabPosition:s,isAiCfoAccessEnabled:E,onAskAiCfoClick:w})]})}function Ro(){const{useFeatureGate:e}=ne(),a=K().state?.referrer,[s,t]=f.useState(!1),[n,o]=f.useState(0),d=U.getSignedInUser(),i=En(d),{isFeatureEnabled:u}=e(z.isOpexByVendorFeatureEnabled),{isFeatureEnabled:h}=e(z.isVendorReviewFeatureEnabled),{isFeatureEnabled:S}=e(z.isScheduledJEPrepaidExpensesFeatureEnabled),{isFeatureEnabled:r}=e(z.isScheduledJEFixedAssetsFeatureEnabled),{isFeatureEnabled:c}=e(z.isScheduledJEAccruedExpensesFeatureEnabled),{isFeatureEnabled:p}=e(z.isFiling1099FeatureEnabled),g=m((w=>L(w))),y=g?.externalConnections?.accounting[0]?.connectionName,x=["vendors_tab"];y!=="netsuite"&&S===!0&&x.push("prepaid_expenses"),y!=="netsuite"&&r===!0&&x.push("fixed_assets"),y!=="netsuite"&&c===!0&&x.push("accrued_expenses"),y!=="netsuite"&&p&&i&&(x.push("filing_1099"),u&&x.splice(1,0,"operating_expenses_by_vendor"));const{isFeatureEnabled:b}=e(z.isDebitCardFeatureEnabled),D=bn(b,g),E=In(g);return D===!0||E===!0?l.jsx(at,{children:l.jsx(B,{path:"/*",element:l.jsx(Zn,{})})}):l.jsxs(at,{children:[l.jsx(B,{path:"/opex",element:u===!0?l.jsx(Bs,{previousTabPosition:n,setPreviousTabPosition:o,vendorTabsToShow:x}):l.jsx($,{to:"../summary"})}),l.jsx(B,{path:"/summary",element:l.jsx(uo,{previousTabPosition:n,setPreviousTabPosition:o,vendorTabsToShow:x})}),l.jsx(B,{path:"schedules/fixed_assets/details/:scheduleDetailId",element:r===!0?l.jsx(fs,{}):l.jsx($,{to:"../../vendors/opex"})}),l.jsx(B,{path:"schedules/accrued_expenses/details/:scheduleDetailId",element:r===!0?l.jsx(us,{shouldNavigateBack:s,setShouldNavigateBack:t}):l.jsx($,{to:"../../vendors/opex"})}),l.jsx(B,{path:"schedules/one_time_accrual/details/:accrualId",element:c===!0?l.jsx(ss,{}):l.jsx($,{to:"../../vendors/opex"})}),l.jsx(B,{path:"schedules/:scheduleType/details/:scheduleDetailId",element:S===!0?l.jsx(Cs,{}):l.jsx($,{to:"../../vendors/opex"})}),l.jsx(B,{path:"schedules/:scheduleType/details/:scheduleDetailId/edit_link",element:S===!0||r===!0?l.jsx(ws,{}):l.jsx($,{to:"../../vendors/opex"})}),l.jsx(B,{path:"schedules/accrued_expenses/details/:scheduleDetailId/edit_link",element:c===!0?l.jsx(is,{setShouldNavigateBack:t}):l.jsx($,{to:"../../vendors/opex"})}),l.jsx(B,{path:"schedules/prepaid_expenses",element:S===!0?l.jsx(Rs,{previousTabPosition:n,setPreviousTabPosition:o,vendorTabsToShow:x}):l.jsx($,{to:"../opex"})}),l.jsx(B,{path:"schedules/fixed_assets",element:r===!0?l.jsx(Ps,{previousTabPosition:n,setPreviousTabPosition:o,vendorTabsToShow:x}):l.jsx($,{to:"../opex"})}),l.jsx(B,{path:"schedules/accrued_expenses",element:c===!0?l.jsx(js,{previousTabPosition:n,setPreviousTabPosition:o,vendorTabsToShow:x}):l.jsx($,{to:"../opex"})}),l.jsx(B,{path:"/filing_1099",element:p&&i?l.jsx(mt,{previousTabPosition:n,setPreviousTabPosition:o,vendorTabsToShow:x}):l.jsx($,{to:"../opex"})}),l.jsx(B,{path:"/filing_1099/:vendorId",element:p&&i?l.jsx(mt,{vendorTabsToShow:x,previousTabPosition:n,setPreviousTabPosition:o}):l.jsx($,{to:"../opex"})}),l.jsx(B,{path:"/filing_1099/upload/:vendorId/edit",element:p&&i?l.jsx(ht,{appContent:l.jsx(oo,{}),showFullScreenSkeletonWhileLoading:!0}):l.jsx($,{to:"../opex"})}),l.jsx(B,{path:"/filing_1099/upload/:vendorId/edit/new/:addressType",element:p&&i?l.jsx(ht,{appContent:l.jsx(Qn,{isSubPage:!0,hideAddressBackButton:!0,hideAddressSubTitle:!0})}):l.jsx($,{to:"../opex"})}),l.jsx(B,{path:"/summary/:vendorId/:qboId",element:l.jsx(ut,{referrerType:a,isFiling1099FeatureEnabled:p&&i})}),l.jsx(B,{path:"/summary/:vendorId/:qboId/:timeframe/:startDate/:endDate",element:l.jsx(ut,{referrerType:a,isFiling1099FeatureEnabled:p&&i})}),l.jsx(B,{path:"/review",element:h===!0?l.jsx(pt,{}):l.jsx(H,{})}),l.jsx(B,{path:"/review/vendor/:vendorId",element:h?l.jsx(pt,{}):l.jsx(H,{})}),l.jsx(B,{path:"/",element:l.jsx($,{to:"summary"})}),l.jsx(B,{path:"*",element:l.jsx(H,{})})]})}export{Ro as default};