@zeniai/web-app-ui 5.2.13-qa → 5.2.14-qa

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (122) hide show
  1. package/dist/assets/AddressRoutes-DpL0AFgf.js +1 -0
  2. package/dist/assets/AddressScreen-vfbZQ8IJ.js +9 -0
  3. package/dist/assets/{AiCfoScreen-D4NgYwUZ.js → AiCfoScreen-CXh_Msfw.js} +1 -1
  4. package/dist/assets/{BillPayApprovalRoutes-DLlsLPac.js → BillPayApprovalRoutes-BtIAcI70.js} +1 -1
  5. package/dist/assets/{BillPayRoutes-ChrQ1pAZ.js → BillPayRoutes-IGbJLx9e.js} +1 -1
  6. package/dist/assets/{BusinessVerificationPageScreen-BGwTSYvf.js → BusinessVerificationPageScreen-YZ8HV6ZO.js} +2 -2
  7. package/dist/assets/{CardsAiCfoScreen-DFBwVCAL.js → CardsAiCfoScreen-CtlFalCK.js} +3 -3
  8. package/dist/assets/{ChargeCardRoutes-BPIoTFc8.js → ChargeCardRoutes-D5RwKtuA.js} +1 -1
  9. package/dist/assets/{CompanyPassportScreen-uugzo1WU.js → CompanyPassportScreen-CLIUaKnq.js} +1 -1
  10. package/dist/assets/{ConnectionAuthScreen-5nIimMuJ.js → ConnectionAuthScreen-BC1A1vLv.js} +1 -1
  11. package/dist/assets/CustomerOnboardingAuthScreen-p0YtWw1K.js +1 -0
  12. package/dist/assets/{CustomerOnboardingRoutes-BH_QwFxA.js → CustomerOnboardingRoutes-cwu-Tdz_.js} +4 -4
  13. package/dist/assets/{DashboardRoutes-DevVcpsc.js → DashboardRoutes-eo5bBebP.js} +1 -1
  14. package/dist/assets/{DefaultTenantHome-kfraLn2O.js → DefaultTenantHome-hN6xKUei.js} +1 -1
  15. package/dist/assets/{DomesticWireDetailScreen-D-A33-aQ.js → DomesticWireDetailScreen-B3xL-JF2.js} +3 -3
  16. package/dist/assets/{DrawerScreen-CaJ0qHuQ.js → DrawerScreen-D9iKOMtR.js} +1 -1
  17. package/dist/assets/EntityDetailRoutes-CiYlohhA.js +1 -0
  18. package/dist/assets/{ExpenseAutomationRoutes-BeNa4w-O.js → ExpenseAutomationRoutes-Dwvz_iW2.js} +1 -1
  19. package/dist/assets/FeaturePreviewScreen-s3Vp54dP.js +1 -0
  20. package/dist/assets/{HubSpotOAuthCallbackScreen-DuB_-O5h.js → HubSpotOAuthCallbackScreen-Dfdai8yG.js} +1 -1
  21. package/dist/assets/MagicLinkRoutes-B9ocY9la.js +72 -0
  22. package/dist/assets/MagicLinkSignInScreen-DPX4jd-D.js +12 -0
  23. package/dist/assets/MobileAppDrawer-zOj9FdCe.js +1 -0
  24. package/dist/assets/NotFoundScreen-BUTiP4R3.js +1 -0
  25. package/dist/assets/{NotificationRoutes-B4vYlLWS.js → NotificationRoutes-1pWXvJma.js} +1 -1
  26. package/dist/assets/{OAuthConsentScreen-DNdUxTN0.js → OAuthConsentScreen-BPaiUj7h.js} +1 -1
  27. package/dist/assets/{PandLWithForecastRoutes-Dvmv9t_a.js → PandLWithForecastRoutes-NBWVQC3h.js} +1 -1
  28. package/dist/assets/PeopleRoutes-CLNbH5xH.js +22 -0
  29. package/dist/assets/PerformanceRoutes-BSfxQLbr.js +1 -0
  30. package/dist/assets/{Preview-Mf-iNnbX.js → Preview-Crb4CpIB.js} +1 -1
  31. package/dist/assets/{QBOConnectionScreen-DhWWlIqn.js → QBOConnectionScreen-C74uxhh_.js} +1 -1
  32. package/dist/assets/{ReimbursementApprovalRoutes-YqkT81e-.js → ReimbursementApprovalRoutes-BPKjFZxh.js} +1 -1
  33. package/dist/assets/{ReimbursementApprovalRuleDetailScreen-CgQrnfRD.js → ReimbursementApprovalRuleDetailScreen-BxwMtMxD.js} +1 -1
  34. package/dist/assets/{ReimbursementRoutes-59ojWJmB.js → ReimbursementRoutes-FFTqDLD2.js} +7 -7
  35. package/dist/assets/{ReportsRoutes-BlJSzoDH.js → ReportsRoutes-9W0p6Lya.js} +1 -1
  36. package/dist/assets/RewardsRoutes-CRlPlndV.js +1 -0
  37. package/dist/assets/ScreenRoutes-nLpBg7A5.js +2 -0
  38. package/dist/assets/{SettingsRoutes-DZmVvwdN.js → SettingsRoutes-Qph7SFpV.js} +1 -1
  39. package/dist/assets/{SetupPagesScreen-BA7qIYz5.js → SetupPagesScreen-BKdx-uAP.js} +5 -5
  40. package/dist/assets/{SignInScreen-B1pXXUPE.js → SignInScreen-Ci0IgHAA.js} +1 -1
  41. package/dist/assets/SignOutScreen-X4KjNVza.js +9 -0
  42. package/dist/assets/{TaskListScreen-FhRi98gu.js → TaskListScreen-D6IETmcD.js} +2 -2
  43. package/dist/assets/TaskRoutes-h0bmRs3S.js +9 -0
  44. package/dist/assets/{TransactionDetailRoutes-Cc6D8ifC.js → TransactionDetailRoutes-jM0nexAU.js} +1 -1
  45. package/dist/assets/{TransactionDetailScreen-BUXJ5aYk.js → TransactionDetailScreen-fRW89NFJ.js} +2 -2
  46. package/dist/assets/{TransactionListRoutes-mvNlEqh4.js → TransactionListRoutes-DvFnObzs.js} +1 -1
  47. package/dist/assets/{TreasuryRoutes-DM7Eo_Ug.js → TreasuryRoutes-CA5R7Rfo.js} +1 -1
  48. package/dist/assets/{VendorsRoutes-Dd1EboaF.js → VendorsRoutes-D92Qn8lw.js} +13 -13
  49. package/dist/assets/WiseConfirmationScreen-tXGY6zhr.js +12 -0
  50. package/dist/assets/{ZeniAccountRoutes-CPFO7nCH.js → ZeniAccountRoutes-BHdZYuyZ.js} +1 -1
  51. package/dist/assets/ZeniAccountStatementScreen-DyRW5BgC.js +9 -0
  52. package/dist/assets/{accountMappingHelper-DPo5_oRM.js → accountMappingHelper-B0l8lAeR.js} +1 -1
  53. package/dist/assets/{analytics-C3yKGO2p.js → analytics-CO5gayAE.js} +1 -1
  54. package/dist/assets/analyticsHelper-DFsb6qRL.js +1 -0
  55. package/dist/assets/{core-QBDM2m9E.js → core-DrRun-Wp.js} +1 -1
  56. package/dist/assets/{decodeURIComponentSafe-V0q2i3Mt.js → decodeURIComponentSafe-BqXEXApE.js} +1 -1
  57. package/dist/assets/{dnd-DTpdpLY3.js → dnd-C7lg2kUY.js} +1 -1
  58. package/dist/assets/{empty-DOkYgcMg.js → empty-BxU8KR-q.js} +1 -1
  59. package/dist/assets/{empty-CFhDMTFy.js → empty-CcJKsg0A.js} +1 -1
  60. package/dist/assets/{emptyVideoElement--yp8X02p.js → emptyVideoElement-Jmh-gus6.js} +1 -1
  61. package/dist/assets/{epic-DhMQUuQ_.js → epic-CkW-Ur48.js} +1 -1
  62. package/dist/assets/getLocaleForTenant-BK33tgnz.js +1 -0
  63. package/dist/assets/{index-BTTC92ci.js → index-24dzDu8E.js} +3235 -3221
  64. package/dist/assets/{index-PvNZ50rx.js → index-2hIX2kLH.js} +1 -1
  65. package/dist/assets/{index-Dgg3TEkF.js → index-4Tf9Bt0i.js} +1 -1
  66. package/dist/assets/{index-_F7n4D5D.js → index-BJ6_cpY3.js} +1 -1
  67. package/dist/assets/{index-ChYlKp3n.js → index-CfbU7SR1.js} +1 -1
  68. package/dist/assets/{index-BMXF4zS6.js → index-DdvKvtaE.js} +1 -1
  69. package/dist/assets/{index-C-I3RcJQ.js → index-T7IByhHr.js} +1 -1
  70. package/dist/assets/{index-BD-4IlOh.js → index-cnTKKS-Z.js} +2 -2
  71. package/dist/assets/{lexical-DBGXZJbY.js → lexical-Cceo9d8G.js} +1 -1
  72. package/dist/assets/{liveblocks-ufh19lah.js → liveblocks-0jcT8Dx_.js} +1 -1
  73. package/dist/assets/{lottie-Ceg93JYe.js → lottie-C4eBAM7n.js} +1 -1
  74. package/dist/assets/{mui-CB8RW45Z.js → mui-BCzMCgwZ.js} +1 -1
  75. package/dist/assets/{pathToGoBack-Bi5ALgzm.js → pathToGoBack-aFGIF63I.js} +1 -1
  76. package/dist/assets/{pdf-DdbTijar.js → pdf-C1ioMmzA.js} +3 -3
  77. package/dist/assets/{pdf-lib-DuOAYy25.js → pdf-lib-gor9sGMc.js} +1 -1
  78. package/dist/assets/{plaid-DAwCYgVP.js → plaid-B0k6aBM1.js} +1 -1
  79. package/dist/assets/{pusher-CiZh5qhj.js → pusher-CnlBFFea.js} +1 -1
  80. package/dist/assets/{react-XuQaBloD.js → react-5qcvQnQi.js} +1 -1
  81. package/dist/assets/{react-b_GUNHoi.js → react-C6dV2Ihe.js} +1 -1
  82. package/dist/assets/{react-BNUtRbVm.js → react-COTuHHMD.js} +1 -1
  83. package/dist/assets/{react-C-M5T2pV.js → react-CPmZ-IlI.js} +1 -1
  84. package/dist/assets/{react-C4Bd6CfY.js → react-CbFHkYXj.js} +1 -1
  85. package/dist/assets/{react-BQkbVo66.js → react-CeH9yclr.js} +1 -1
  86. package/dist/assets/{recharts-B8SFxg38.js → recharts-BJColP3b.js} +1 -1
  87. package/dist/assets/{routePaths-DRm-ixUG.js → routePaths-Bty2j8lo.js} +1 -1
  88. package/dist/assets/{sentry-Co2H8v0G.js → sentry-Cix5j_Oe.js} +1 -1
  89. package/dist/assets/{url-D7tTbw7b.js → url-C58jRUwt.js} +1 -1
  90. package/dist/assets/{url-BD8IMRo-.js → url-C5XmMoE_.js} +1 -1
  91. package/dist/assets/{useAiCfoDashboardSuggestedQuestionsChips-DB15Xiff.js → useAiCfoDashboardSuggestedQuestionsChips-dGXlt22_.js} +1 -1
  92. package/dist/assets/useAskAiCfoHostNavButtonProps-DG7vn-Xl.js +1 -0
  93. package/dist/assets/{useCashManagementBanner-D33gFRsv.js → useCashManagementBanner-Y_B1najt.js} +1 -1
  94. package/dist/assets/{useChargeCardPusherEvents-Dh8PVdN6.js → useChargeCardPusherEvents-BcvA45YR.js} +1 -1
  95. package/dist/assets/{useDeviceId-SWL_t36p.js → useDeviceId-34Upzybn.js} +1 -1
  96. package/dist/assets/{useEmailConnectResultRefresh-BjbbVkjV.js → useEmailConnectResultRefresh-Bp3LBWrf.js} +1 -1
  97. package/dist/assets/{useInitialThreadRequest-B3FrSAeQ.js → useInitialThreadRequest-D3N5n5MK.js} +1 -1
  98. package/dist/assets/{utils-CWM6Tene.js → utils-CvfvTDv6.js} +1 -1
  99. package/dist/assets/{withTransactionSidePanel-DhAeegie.js → withTransactionSidePanel-Cu9CJKJJ.js} +2 -2
  100. package/dist/assets/{zeni-epic-state-BF09v22i.js → zeni-epic-state-D1OApLJ3.js} +3 -3
  101. package/dist/index.html +1 -1
  102. package/package.json +3 -3
  103. package/dist/assets/AddressRoutes-ByLwqq1f.js +0 -1
  104. package/dist/assets/AddressScreen-Bn9eD_vN.js +0 -9
  105. package/dist/assets/CustomerOnboardingAuthScreen-B9Xfrjh0.js +0 -1
  106. package/dist/assets/EntityDetailRoutes-DYfqqhFQ.js +0 -1
  107. package/dist/assets/FeaturePreviewScreen-C9BLvwka.js +0 -1
  108. package/dist/assets/MagicLinkRoutes-ZPdOYVHg.js +0 -72
  109. package/dist/assets/MagicLinkSignInScreen-wqd6TRdZ.js +0 -12
  110. package/dist/assets/MobileAppDrawer-CWymkkwv.js +0 -1
  111. package/dist/assets/NotFoundScreen-CIe1EEoJ.js +0 -1
  112. package/dist/assets/PeopleRoutes-f84JOb6h.js +0 -22
  113. package/dist/assets/PerformanceRoutes-CQbkvkKD.js +0 -1
  114. package/dist/assets/RewardsRoutes-DkHhpbpf.js +0 -1
  115. package/dist/assets/ScreenRoutes-DoO6VBZw.js +0 -2
  116. package/dist/assets/SignOutScreen-Dc75amk7.js +0 -9
  117. package/dist/assets/TaskRoutes-Gzx1KgZq.js +0 -9
  118. package/dist/assets/WiseConfirmationScreen-DC9T83oN.js +0 -12
  119. package/dist/assets/ZeniAccountStatementScreen-Cm4JCiss.js +0 -9
  120. package/dist/assets/analyticsHelper-BveTv6Ie.js +0 -1
  121. package/dist/assets/getLocaleForTenant-D6zJFfH-.js +0 -1
  122. package/dist/assets/useAskAiCfoHostNavButtonProps-CPVGdgCK.js +0 -1
@@ -1 +1 @@
1
- import{j as s}from"./liveblocks-ufh19lah.js";import{h as Z,g as N,u as H,i as Q,j as g,N as G,n as W,o as be,p as j}from"./core-QBDM2m9E.js";import{eZ as U,rb as X,k3 as u,R_ as ee,Ko as De,bo as le,R$ as ve,kG as te,O2 as ae,S0 as ue,S1 as Pe,bE as Y,Kk as ye,S2 as Ee,S3 as me,S4 as je,Kn as Ae,S5 as xe,S6 as pe,S7 as Me,S8 as Se,S9 as Le,Sa as Ce,Sb as fe,LA as Be}from"./zeni-epic-state-BF09v22i.js";import{O as de,A as ne,c as q,f as w,co as ce,v as K,r as oe,_ as Fe,n as Oe}from"./index-BTTC92ci.js";import"./mui-CB8RW45Z.js";import{a as S}from"./sentry-Co2H8v0G.js";import{w as se}from"./withTransactionSidePanel-DhAeegie.js";import{p as ie,c as re}from"./routePaths-DRm-ixUG.js";import{v as ze}from"./utils-CWM6Tene.js";import{d as v}from"./decodeURIComponentSafe-V0q2i3Mt.js";import{Z as we}from"./ZeniAccountStatementScreen-Cm4JCiss.js";import"./recharts-B8SFxg38.js";import"./analytics-C3yKGO2p.js";import"./plaid-DAwCYgVP.js";import"./dnd-DTpdpLY3.js";import"./stripe-cKAAJElX.js";import"./lottie-Ceg93JYe.js";import"./lexical-DBGXZJbY.js";import"./pdf-DdbTijar.js";import"./useAskAiCfoHostNavButtonProps-CPVGdgCK.js";import"./TransactionDetailScreen-BUXJ5aYk.js";(function(){try{var a=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},e=new a.Error().stack;e&&(a._sentryDebugIds=a._sentryDebugIds||{},a._sentryDebugIds[e]="bc69a665-96cb-462c-b4c1-610ab749cecb",a._sentryDebugIdIdentifier="sentry-dbid-bc69a665-96cb-462c-b4c1-610ab749cecb")}catch{}})();const Ge=["uncategorized-income","uncategorized-expense","miscategorized-income","miscategorized-expense","missing-receipts"],J=a=>ze(a),Re=W((function(a,e){const t=ve(a.transactionState,a.transactionListState,e.selectedAccount.period,e.selectedAccount.timeframe,J(e.selectedAccount.tranListType));return{title:e.selectedAccount.title,subTitle:e.selectedAccount.subTitle,timeframe:e.selectedAccount.timeframe,timePeriod:ae(e.selectedAccount.period),dataAvailableForPeriod:e.dataAvailableForPeriod,report:t,currentScrollYOffset:t.uiState?.scrollYOffset??0,isAccountingClassesEnabled:te(a)}}),(function(a,e){return{onBackClick:()=>{const t=oe(e.location.state?.pathnameStackToGoBack),n=t.poppedPathname??"../../";e.navigate(n,{state:{pathnameStackToGoBack:t.newStack}})},onTimePeriodChange:(t,n,c)=>{e.closeSidePanel?.();const o=de.getLocalizedStrings(),l=J(e.selectedAccount.tranListType),m=Ve(t,n,c,l,e.bookCloseDate);w.trackTransactionList(void 0,void 0,void 0,e.selectedAccount.title,void 0,!0),a(ue({uiState:{dateRange:m},type:J(e.selectedAccount.tranListType)})),a(De(l,u(m),!1,l==="missingReceipts"?o.uncategorizedTransactionList.missingReceipt.missingReceiptMinAmount:void 0)),e.onSelectedTimePeriodChange(u(m))},onTransactionItemClick:t=>{if(e.openTransactionPanel)return void e.openTransactionPanel(t.id,t.type);const n=re(t,e.tenantEmailDomain),c=K(e.location.state?.pathnameStackToGoBack,e.location.pathname);e.navigate(n,{state:{pathnameStackToGoBack:c}})},onTransactionListScroll:t=>{a(ue({uiState:{scrollYOffset:t},type:J(e.selectedAccount.tranListType)}))}}}))(ce),V=se((function({...a}){const e=Z(),t=N(),n=H(),c=t.pathname.split("/").find((r=>Ge.includes(r))),o=c??"uncategorized-expense",{tenantEmailDomain:l}=Q(),m=de.getLocalizedStrings(),{accountType:h,title:T,subTitle:D}=_e(o),y="month",I=g((r=>U(r))),p=I.company?.companyInfo.firstMonthOfFY??1,{useFeatureGate:A}=ne(),{isFeatureEnabled:k}=A(q.isProjectsTransactionsEnabled),x=g((r=>X(r)))&&k,{dataAvailable:C,initialTimeframeTick:P}=$e(o,p,I.bookCloseDate),[B,E]=S.useState(!1),[F,O]=S.useState(void 0),f=S.useMemo((()=>{const r=u(P);return{tranListType:o,accountType:ee(h),title:T,subTitle:D,timeframe:y,period:r}}),[o,y,h,C]);S.useEffect((()=>{if(!B&&f!=null){E(!0),w.trackTransactionList(void 0,void 0,void 0,f.title);const r=J(f.tranListType);n(De(r,f.period,!0,r==="missingReceipts"?m.uncategorizedTransactionList.missingReceipt.missingReceiptMinAmount:void 0))}}),[B,f,n]);let M=f;return f!=null&&F!=null&&(M={...f,period:F}),c==null||M==null?s.jsx(G,{to:"../"}):s.jsx(Re,{firstMonthOfFY:p,tenantEmailDomain:l,location:t,useFixedPeriod:{timeframe:"month",numberOfPeriods:12},dataAvailableForPeriod:C,navigate:e,showProjectField:x,selectedAccount:M,referrerType:o,bookCloseDate:I.bookCloseDate,onSelectedTimePeriodChange:r=>O(r),...a})})),_e=a=>{let e="",t="";const n=de.getLocalizedStrings();switch(a){case"uncategorized-income":e="income",t=n.uncategorizedTransactionList.income.title;break;case"uncategorized-expense":e="expenses",t=n.uncategorizedTransactionList.expense.title;break;case"miscategorized-expense":e="expenses",t=n.miscategorizedTransactionList.expense.title;break;case"miscategorized-income":e="income",t=n.miscategorizedTransactionList.income.title;break;case"missing-receipts":t=n.uncategorizedTransactionList.missingReceipt.title}return{accountType:e,title:t,subTitle:""}},$e=(a,e,t)=>{const n=le();let c=le().startOf("month").subtract(11,"month");return t!=null&&a!=="missing-receipts"?t.add(1,"day").isBefore(c)?{dataAvailable:{startDate:t.add(1,"day"),endDate:n},initialTimeframeTick:{startDate:c,endDate:n}}:(c=t.add(1,"day"),{dataAvailable:{startDate:c,endDate:n},initialTimeframeTick:{startDate:c,endDate:n}}):{dataAvailable:ie(5,e),initialTimeframeTick:{startDate:c,endDate:n}}},Ve=(a,e,t,n,c)=>{let o=e;return n==="missingReceipts"||c==null?a.startDate.isBefore(e.startDate,t)?o={startDate:a.startDate,endDate:e.endDate}:a.startDate.isAfter(e.endDate,t)?o={startDate:e.startDate,endDate:a.endDate}:console.error(`Invalid addTimePeriod ${JSON.stringify(a)}`):o=a.startDate.isBefore(c,t)?{startDate:c.add(1,"day"),endDate:e.endDate}:{startDate:a.startDate,endDate:e.endDate},o},Je=W((function(a,e){const t=Ee(a.transactionState,a.transactionListState,e.selectedAccount.accountId,e.selectedAccount.accountType,e.selectedAccount.classId,e.selectedAccount.timeframe,e.selectedAccount.period);return{accountId:e.selectedAccount.accountId,accountType:e.selectedAccount.accountType,title:e.selectedAccount.title,timeframe:e.selectedAccount.timeframe,timePeriod:ae(e.selectedAccount.period),dataAvailableForPeriod:ie(5,e.firstMonthOfFY),report:t,currentScrollYOffset:t.uiState?.scrollYOffset??0,isAccountingClassesEnabled:te(a)}}),(function(a,e){return{onBackClick:()=>{const t=oe(e.location.state?.pathnameStackToGoBack),n=t.poppedPathname??ge();e.navigate(n,{state:{pathnameStackToGoBack:t.newStack}})},onTimePeriodChange:(t,n,c)=>{e.closeSidePanel?.();let o=n;t.startDate.isBefore(n.startDate,c)?o={startDate:t.startDate,endDate:n.endDate}:t.startDate.isAfter(n.endDate,c)?o={startDate:n.startDate,endDate:t.endDate}:console.error(`Invalid addTimePeriod ${JSON.stringify(t)}`),w.trackTransactionList(e.selectedAccount.accountId,void 0,e.referrerType,e.selectedAccount.title,void 0,!0),a(me({accountId:e.selectedAccount.accountId,accountType:e.selectedAccount.accountType,classId:e.selectedAccount.classId,uiState:{dateRange:o}})),a(ye(e.selectedAccount.accountId,e.selectedAccount.accountType,e.selectedAccount.classId,u(o))),e.onSelectedTimePeriodChange(u(o))},onTransactionItemClick:t=>{if(e.openTransactionPanel)return void e.openTransactionPanel(t.id,t.type);const n=re(t,e.tenantEmailDomain),c=K(e.location.state?.pathnameStackToGoBack,e.location.pathname);e.navigate(n,{state:{pathnameStackToGoBack:c}})},onTransactionListScroll:t=>{a(me({accountId:e.selectedAccount.accountId,accountType:e.selectedAccount.accountType,classId:e.selectedAccount.classId,uiState:{scrollYOffset:t}}))}}}))(ce),qe=se((function({referrerType:a,...e}){const t=Z(),n=N(),c=H(),{tenantEmailDomain:o,accountTypeEncoded:l,accountIdEncoded:m,classIdEncoded:h,timeframe:T,startDate:D,endDate:y,titleEncoded:I}=Q(),p=v(l??""),A=v(m??""),k=v(h??""),x=v(I??""),C=g((d=>Pe(d.transactionListState,A,p,k))),[P,B]=S.useState(!1),[E,F]=S.useState(void 0),O=g((d=>U(d))),f=O.company?.companyInfo.firstMonthOfFY??1,{useFeatureGate:M}=ne(),{isFeatureEnabled:r}=M(q.isProjectsTransactionsEnabled),R=g((d=>X(d)))&&r;let i;const z=Ke(p,A,k,T,D,y,x);if(z){const d={startDate:Y(D,"YYYY-MM-DD"),endDate:Y(y,"YYYY-MM-DD")},_=Ne(C?.dateRange,d);i={accountId:A,accountType:ee(p),classId:k,title:x,timeframe:T,period:_}}S.useEffect((()=>{P||i==null||(B(!0),w.trackTransactionList(i.accountId,void 0,a,i.title),c(ye(i.accountId,i.accountType,i.classId,i.period)))}),[P,i,c]);let L=i;i!=null&&E!=null&&(L={...i,period:E});const $=[l,m,h,T,D,y,I].filter((d=>d!=null));return z&&L!=null?s.jsx(Je,{firstMonthOfFY:f,tenantEmailDomain:o,location:n,navigate:t,showProjectField:R,selectedAccount:L,referrerType:a,onSelectedTimePeriodChange:d=>F(d),...e}):s.jsx(G,{to:ge($.length)})})),ge=(a=7)=>{let e="../";for(let t=0;t<a;t++)e=`${e}../`;return e},Ke=(a,e,t,n,c,o,l)=>a!=null&&e!=null&&t!=null&&n!=null&&c!=null&&o!=null&&(n==="month"||n==="quarter")&&Y(c,"YYYY-MM-DD").isValid()&&Y(o,"YYYY-MM-DD").isValid()&&l!=null,Ne=(a,e)=>a!=null&&a.endDate.isSame(e.endDate,"day")&&a.startDate.isBefore(e.startDate,"day")?u(a):u(e),Ue=W((function(a,e){const t=xe(a.transactionState,a.transactionListState,e.selectedAccount.accountId,e.selectedAccount.accountType,e.selectedAccount.projectId,e.selectedAccount.timeframe,e.selectedAccount.period);return{accountId:e.selectedAccount.accountId,accountType:e.selectedAccount.accountType,title:e.selectedAccount.title,timeframe:e.selectedAccount.timeframe,timePeriod:ae(e.selectedAccount.period),dataAvailableForPeriod:ie(5,e.firstMonthOfFY),report:t,currentScrollYOffset:t.uiState?.scrollYOffset??0,isAccountingClassesEnabled:te(a)}}),(function(a,e){return{onBackClick:()=>{const t=oe(e.location.state?.pathnameStackToGoBack),n=t.poppedPathname??he();e.navigate(n,{state:{pathnameStackToGoBack:t.newStack}})},onTimePeriodChange:(t,n,c)=>{e.closeSidePanel?.();let o=n;t.startDate.isBefore(n.startDate,c)?o={startDate:t.startDate,endDate:n.endDate}:t.startDate.isAfter(n.endDate,c)?o={startDate:n.startDate,endDate:t.endDate}:console.error(`Invalid addTimePeriod ${JSON.stringify(t)}`),w.trackTransactionList(e.selectedAccount.accountId,void 0,e.referrerType,e.selectedAccount.title,void 0,!0),a(pe({accountId:e.selectedAccount.accountId,accountType:e.selectedAccount.accountType,projectId:e.selectedAccount.projectId,uiState:{dateRange:o}})),a(Ae(e.selectedAccount.accountId,e.selectedAccount.accountType,e.selectedAccount.projectId,u(o))),e.onSelectedTimePeriodChange(u(o))},onTransactionItemClick:t=>{if(e.openTransactionPanel)return void e.openTransactionPanel(t.id,t.type);const n=re(t,e.tenantEmailDomain),c=K(e.location.state?.pathnameStackToGoBack,e.location.pathname);e.navigate(n,{state:{pathnameStackToGoBack:c}})},onTransactionListScroll:t=>{a(pe({accountId:e.selectedAccount.accountId,accountType:e.selectedAccount.accountType,projectId:e.selectedAccount.projectId,uiState:{scrollYOffset:t}}))}}}))(ce),Ze=se((function({referrerType:a,...e}){const t=Z(),n=N(),c=H(),{tenantEmailDomain:o,accountTypeEncoded:l,accountIdEncoded:m,projectIdEncoded:h,timeframe:T,startDate:D,endDate:y,titleEncoded:I}=Q(),p=v(l??""),A=v(m??""),k=v(h??""),x=v(I??""),C=g((d=>je(d.transactionListState,A,p,k))),[P,B]=S.useState(!1),[E,F]=S.useState(void 0),O=g((d=>U(d))),f=O.company?.companyInfo.firstMonthOfFY??1,{useFeatureGate:M}=ne(),{isFeatureEnabled:r}=M(q.isProjectsTransactionsEnabled),R=g((d=>X(d)))&&r;let i;const z=He(p,A,k,T,D,y,x);if(z){const d={startDate:Y(D,"YYYY-MM-DD"),endDate:Y(y,"YYYY-MM-DD")},_=Qe(C?.dateRange,d);i={accountId:A,accountType:ee(p),projectId:k,title:x,timeframe:T,period:_}}S.useEffect((()=>{P||i==null||(B(!0),w.trackTransactionList(i.accountId,void 0,a,i.title),c(Ae(i.accountId,i.accountType,i.projectId,i.period)))}),[P,i,c]);let L=i;i!=null&&E!=null&&(L={...i,period:E});const $=[l,m,h,T,D,y,I].filter((d=>d!=null));return z&&L!=null?s.jsx(Ue,{firstMonthOfFY:f,tenantEmailDomain:o,location:n,navigate:t,showProjectField:R,selectedAccount:L,referrerType:a,onSelectedTimePeriodChange:d=>F(d),...e}):s.jsx(G,{to:he($.length)})})),he=(a=7)=>{let e="../";for(let t=0;t<a;t++)e=`${e}../`;return e},He=(a,e,t,n,c,o,l)=>a!=null&&e!=null&&t!=null&&n!=null&&c!=null&&o!=null&&(n==="month"||n==="quarter")&&Y(c,"YYYY-MM-DD").isValid()&&Y(o,"YYYY-MM-DD").isValid()&&l!=null,Qe=(a,e)=>a!=null&&a.endDate.isSame(e.endDate,"day")&&a.startDate.isBefore(e.startDate,"day")?u(a):u(e),We=W((function(a,e){const t=Le(a.transactionState,a.transactionListState,e.selectedAccount.accountId,e.selectedAccount.accountType,e.selectedAccount.timeframe,e.selectedAccount.period),n=t.account?.coaId,c=e.isConnectedAccountProviderUnit&&Ce(n??"");return{accountId:e.selectedAccount.accountId,accountType:e.selectedAccount.accountType,title:e.selectedAccount.title,timeframe:e.selectedAccount.timeframe,timePeriod:ae(e.selectedAccount.period),dataAvailableForPeriod:ie(5,e.firstMonthOfFY),report:t,currentScrollYOffset:t.uiState?.scrollYOffset??0,showStatementPageIcon:c,isAccountingClassesEnabled:te(a)}}),(function(a,e){return{onBackClick:()=>{const t=oe(e.location.state?.pathnameStackToGoBack),n=t.poppedPathname??Ie();e.navigate(n,{state:{pathnameStackToGoBack:t.newStack}})},onTimePeriodChange:(t,n,c)=>{e.closeSidePanel?.();let o=n;t.startDate.isBefore(n.startDate,c)?o={startDate:t.startDate,endDate:n.endDate}:t.startDate.isAfter(n.endDate,c)?o={startDate:n.startDate,endDate:t.endDate}:console.error(`Invalid addTimePeriod ${JSON.stringify(t)}`),w.trackTransactionList(e.selectedAccount.accountId,void 0,e.referrerType,e.selectedAccount.title,void 0,!0),a(fe({accountId:e.selectedAccount.accountId,accountType:e.selectedAccount.accountType,uiState:{dateRange:o}})),a(Se(e.selectedAccount.accountId,e.selectedAccount.accountType,u(o))),e.onSelectedTimePeriodChange(u(o))},onTransactionItemClick:t=>{if(e.openTransactionPanel)return void e.openTransactionPanel(t.id,t.type);const n=re(t,e.tenantEmailDomain),c=K(e.location.state?.pathnameStackToGoBack,e.location.pathname);e.navigate(n,{state:{pathnameStackToGoBack:c}})},onTransactionListScroll:t=>{a(fe({accountId:e.selectedAccount.accountId,accountType:e.selectedAccount.accountType,uiState:{scrollYOffset:t}}))},onStatementPageIconClick:()=>{const t=tt(e.tenantEmailDomain),n=K(e.location.state?.pathnameStackToGoBack,e.location.pathname);e.navigate(t,{state:{pathnameStackToGoBack:n}})}}}))(ce),Te=se((function({referrerType:a,...e}){const t=Z(),n=N(),c=H(),{tenantEmailDomain:o,accountTypeEncoded:l,accountIdEncoded:m,timeframe:h,startDate:T,endDate:D,titleEncoded:y,excludeSubAccounts:I}=Q(),p=v(l??""),A=v(m??""),k=v(y??""),x=!(I!=null&&I==="exclude_subaccounts"),C=g((b=>Me(b.transactionListState,A,p))),[P,B]=S.useState(!1),[E,F]=S.useState(void 0),O=g((b=>U(b))),f=O.company?.featuresActivationInfo.connectedAccountProvider==="unit",M=O.company?.companyInfo.firstMonthOfFY??1;let r;const R=Xe(p,A,h,T,D,k);if(R){const b={startDate:Y(T,"YYYY-MM-DD"),endDate:Y(D,"YYYY-MM-DD")},Ye=et(C?.dateRange,b);r={accountId:A,accountType:ee(p),title:k,timeframe:h,period:Ye}}let i=r;r!=null&&E!=null&&(i={...r,period:E});const{useFeatureGate:z}=ne(),{isFeatureEnabled:L}=z(q.isTransactionCommentingEnabled),{isFeatureEnabled:$}=z(q.isProjectsTransactionsEnabled),d=g((b=>X(b)))&&$,{areTenantIdsInSync:_}=Fe();S.useEffect((()=>{!P&&r!=null&&_&&(B(!0),w.trackTransactionList(r.accountId,void 0,a,r.title),c(Se(r.accountId,r.accountType,r.period,void 0,!1,x)))}),[P,r,c,_]);const ke=[l,m,h,T,D,y].filter((b=>b!=null));return R&&i!=null?s.jsx(We,{firstMonthOfFY:M,tenantEmailDomain:o,location:n,navigate:t,isConnectedAccountProviderUnit:f,isTransactionCommentingEnabled:L,showProjectField:d,selectedAccount:i,referrerType:a,onSelectedTimePeriodChange:b=>F(b),...e}):s.jsx(G,{to:Ie(ke.length)})})),Ie=(a=7)=>{let e="../";for(let t=0;t<a;t++)e=`${e}../`;return e},Xe=(a,e,t,n,c,o)=>a!=null&&e!=null&&t!=null&&n!=null&&c!=null&&(t==="month"||t==="quarter")&&Y(n,"YYYY-MM-DD").isValid()&&Y(c,"YYYY-MM-DD").isValid()&&o!=null,et=(a,e)=>a!=null&&a.endDate.isSame(e.endDate,"day")&&a.startDate.isBefore(e.startDate,"day")?u(a):u(e),tt=a=>`/${a}/transactions/${Be}/statements`;function kt(){const a=N().state?.referrer,e=g((n=>n.expenseAutomationViewState.selectedPeriodByTenantId))[g((n=>U(n))).tenantId],t=Oe();return s.jsxs(be,{children:[s.jsx(j,{path:"/:accountTypeEncoded/:accountIdEncoded/:timeframe/:startDate/:endDate/:titleEncoded/:excludeSubAccounts/*",element:s.jsx(Te,{referrerType:a})}),s.jsx(j,{path:"/zeni-clearing-account/statements",element:s.jsx(we,{})}),s.jsx(j,{path:"/*",element:s.jsx(Te,{referrerType:a})}),s.jsx(j,{path:"/uncategorized-income/*",element:s.jsx(V,{})}),s.jsx(j,{path:"/uncategorized-expense/*",element:t?s.jsx(G,{to:`../../month_end_close_checks/review/transaction_categorization/${e.month}-${e.year}`}):s.jsx(V,{})}),s.jsx(j,{path:"/miscategorized-income/*",element:s.jsx(V,{})}),s.jsx(j,{path:"/miscategorized-expense/*",element:t?s.jsx(G,{to:`../../month_end_close_checks/review/transaction_categorization/${e.month}-${e.year}`}):s.jsx(V,{})}),s.jsx(j,{path:"/missing-receipts/*",element:t?s.jsx(G,{to:`../../month_end_close_checks/review/missing_receipts/${e.month}-${e.year}`}):s.jsx(V,{})}),s.jsx(j,{path:"/by-class/:accountTypeEncoded/:accountIdEncoded/:classIdEncoded/:timeframe/:startDate/:endDate/:titleEncoded/*",element:s.jsx(qe,{referrerType:a})}),s.jsx(j,{path:"/by-project/:accountTypeEncoded/:accountIdEncoded/:projectIdEncoded/:timeframe/:startDate/:endDate/:titleEncoded/*",element:s.jsx(Ze,{referrerType:a})})]})}export{kt as default};
1
+ import{j as s}from"./liveblocks-0jcT8Dx_.js";import{h as Z,g as N,u as H,i as Q,j as g,N as G,n as W,o as ve,p as j}from"./core-DrRun-Wp.js";import{eZ as U,rb as X,k3 as u,R_ as ee,Ko as De,bo as le,R$ as be,kG as te,O2 as ae,S0 as ue,S1 as Pe,bE as Y,Kk as ye,S2 as Ee,S3 as me,S4 as je,Kn as Ae,S5 as xe,S6 as pe,S7 as Me,S8 as Se,S9 as Le,Sa as Ce,Sb as fe,LA as Be}from"./zeni-epic-state-D1OApLJ3.js";import{O as de,A as ne,c as q,g as w,co as ce,w as K,s as oe,_ as Fe,i as Oe}from"./index-24dzDu8E.js";import"./mui-BCzMCgwZ.js";import{a as S}from"./sentry-Cix5j_Oe.js";import{w as se}from"./withTransactionSidePanel-Cu9CJKJJ.js";import{p as ie,c as re}from"./routePaths-Bty2j8lo.js";import{v as ze}from"./utils-CvfvTDv6.js";import{d as b}from"./decodeURIComponentSafe-BqXEXApE.js";import{Z as we}from"./ZeniAccountStatementScreen-DyRW5BgC.js";import"./recharts-BJColP3b.js";import"./analytics-CO5gayAE.js";import"./plaid-B0k6aBM1.js";import"./dnd-C7lg2kUY.js";import"./stripe-cKAAJElX.js";import"./lottie-C4eBAM7n.js";import"./lexical-Cceo9d8G.js";import"./pdf-C1ioMmzA.js";import"./useAskAiCfoHostNavButtonProps-DG7vn-Xl.js";import"./TransactionDetailScreen-fRW89NFJ.js";(function(){try{var a=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},e=new a.Error().stack;e&&(a._sentryDebugIds=a._sentryDebugIds||{},a._sentryDebugIds[e]="ba176798-0363-46c0-a62a-084d7d65f468",a._sentryDebugIdIdentifier="sentry-dbid-ba176798-0363-46c0-a62a-084d7d65f468")}catch{}})();const Ge=["uncategorized-income","uncategorized-expense","miscategorized-income","miscategorized-expense","missing-receipts"],J=a=>ze(a),Re=W((function(a,e){const t=be(a.transactionState,a.transactionListState,e.selectedAccount.period,e.selectedAccount.timeframe,J(e.selectedAccount.tranListType));return{title:e.selectedAccount.title,subTitle:e.selectedAccount.subTitle,timeframe:e.selectedAccount.timeframe,timePeriod:ae(e.selectedAccount.period),dataAvailableForPeriod:e.dataAvailableForPeriod,report:t,currentScrollYOffset:t.uiState?.scrollYOffset??0,isAccountingClassesEnabled:te(a)}}),(function(a,e){return{onBackClick:()=>{const t=oe(e.location.state?.pathnameStackToGoBack),n=t.poppedPathname??"../../";e.navigate(n,{state:{pathnameStackToGoBack:t.newStack}})},onTimePeriodChange:(t,n,c)=>{e.closeSidePanel?.();const o=de.getLocalizedStrings(),l=J(e.selectedAccount.tranListType),m=Ve(t,n,c,l,e.bookCloseDate);w.trackTransactionList(void 0,void 0,void 0,e.selectedAccount.title,void 0,!0),a(ue({uiState:{dateRange:m},type:J(e.selectedAccount.tranListType)})),a(De(l,u(m),!1,l==="missingReceipts"?o.uncategorizedTransactionList.missingReceipt.missingReceiptMinAmount:void 0)),e.onSelectedTimePeriodChange(u(m))},onTransactionItemClick:t=>{if(e.openTransactionPanel)return void e.openTransactionPanel(t.id,t.type);const n=re(t,e.tenantEmailDomain),c=K(e.location.state?.pathnameStackToGoBack,e.location.pathname);e.navigate(n,{state:{pathnameStackToGoBack:c}})},onTransactionListScroll:t=>{a(ue({uiState:{scrollYOffset:t},type:J(e.selectedAccount.tranListType)}))}}}))(ce),V=se((function({...a}){const e=Z(),t=N(),n=H(),c=t.pathname.split("/").find((r=>Ge.includes(r))),o=c??"uncategorized-expense",{tenantEmailDomain:l}=Q(),m=de.getLocalizedStrings(),{accountType:h,title:T,subTitle:D}=_e(o),y="month",I=g((r=>U(r))),p=I.company?.companyInfo.firstMonthOfFY??1,{useFeatureGate:A}=ne(),{isFeatureEnabled:k}=A(q.isProjectsTransactionsEnabled),x=g((r=>X(r)))&&k,{dataAvailable:C,initialTimeframeTick:P}=$e(o,p,I.bookCloseDate),[B,E]=S.useState(!1),[F,O]=S.useState(void 0),f=S.useMemo((()=>{const r=u(P);return{tranListType:o,accountType:ee(h),title:T,subTitle:D,timeframe:y,period:r}}),[o,y,h,C]);S.useEffect((()=>{if(!B&&f!=null){E(!0),w.trackTransactionList(void 0,void 0,void 0,f.title);const r=J(f.tranListType);n(De(r,f.period,!0,r==="missingReceipts"?m.uncategorizedTransactionList.missingReceipt.missingReceiptMinAmount:void 0))}}),[B,f,n]);let M=f;return f!=null&&F!=null&&(M={...f,period:F}),c==null||M==null?s.jsx(G,{to:"../"}):s.jsx(Re,{firstMonthOfFY:p,tenantEmailDomain:l,location:t,useFixedPeriod:{timeframe:"month",numberOfPeriods:12},dataAvailableForPeriod:C,navigate:e,showProjectField:x,selectedAccount:M,referrerType:o,bookCloseDate:I.bookCloseDate,onSelectedTimePeriodChange:r=>O(r),...a})})),_e=a=>{let e="",t="";const n=de.getLocalizedStrings();switch(a){case"uncategorized-income":e="income",t=n.uncategorizedTransactionList.income.title;break;case"uncategorized-expense":e="expenses",t=n.uncategorizedTransactionList.expense.title;break;case"miscategorized-expense":e="expenses",t=n.miscategorizedTransactionList.expense.title;break;case"miscategorized-income":e="income",t=n.miscategorizedTransactionList.income.title;break;case"missing-receipts":t=n.uncategorizedTransactionList.missingReceipt.title}return{accountType:e,title:t,subTitle:""}},$e=(a,e,t)=>{const n=le();let c=le().startOf("month").subtract(11,"month");return t!=null&&a!=="missing-receipts"?t.add(1,"day").isBefore(c)?{dataAvailable:{startDate:t.add(1,"day"),endDate:n},initialTimeframeTick:{startDate:c,endDate:n}}:(c=t.add(1,"day"),{dataAvailable:{startDate:c,endDate:n},initialTimeframeTick:{startDate:c,endDate:n}}):{dataAvailable:ie(5,e),initialTimeframeTick:{startDate:c,endDate:n}}},Ve=(a,e,t,n,c)=>{let o=e;return n==="missingReceipts"||c==null?a.startDate.isBefore(e.startDate,t)?o={startDate:a.startDate,endDate:e.endDate}:a.startDate.isAfter(e.endDate,t)?o={startDate:e.startDate,endDate:a.endDate}:console.error(`Invalid addTimePeriod ${JSON.stringify(a)}`):o=a.startDate.isBefore(c,t)?{startDate:c.add(1,"day"),endDate:e.endDate}:{startDate:a.startDate,endDate:e.endDate},o},Je=W((function(a,e){const t=Ee(a.transactionState,a.transactionListState,e.selectedAccount.accountId,e.selectedAccount.accountType,e.selectedAccount.classId,e.selectedAccount.timeframe,e.selectedAccount.period);return{accountId:e.selectedAccount.accountId,accountType:e.selectedAccount.accountType,title:e.selectedAccount.title,timeframe:e.selectedAccount.timeframe,timePeriod:ae(e.selectedAccount.period),dataAvailableForPeriod:ie(5,e.firstMonthOfFY),report:t,currentScrollYOffset:t.uiState?.scrollYOffset??0,isAccountingClassesEnabled:te(a)}}),(function(a,e){return{onBackClick:()=>{const t=oe(e.location.state?.pathnameStackToGoBack),n=t.poppedPathname??ge();e.navigate(n,{state:{pathnameStackToGoBack:t.newStack}})},onTimePeriodChange:(t,n,c)=>{e.closeSidePanel?.();let o=n;t.startDate.isBefore(n.startDate,c)?o={startDate:t.startDate,endDate:n.endDate}:t.startDate.isAfter(n.endDate,c)?o={startDate:n.startDate,endDate:t.endDate}:console.error(`Invalid addTimePeriod ${JSON.stringify(t)}`),w.trackTransactionList(e.selectedAccount.accountId,void 0,e.referrerType,e.selectedAccount.title,void 0,!0),a(me({accountId:e.selectedAccount.accountId,accountType:e.selectedAccount.accountType,classId:e.selectedAccount.classId,uiState:{dateRange:o}})),a(ye(e.selectedAccount.accountId,e.selectedAccount.accountType,e.selectedAccount.classId,u(o))),e.onSelectedTimePeriodChange(u(o))},onTransactionItemClick:t=>{if(e.openTransactionPanel)return void e.openTransactionPanel(t.id,t.type);const n=re(t,e.tenantEmailDomain),c=K(e.location.state?.pathnameStackToGoBack,e.location.pathname);e.navigate(n,{state:{pathnameStackToGoBack:c}})},onTransactionListScroll:t=>{a(me({accountId:e.selectedAccount.accountId,accountType:e.selectedAccount.accountType,classId:e.selectedAccount.classId,uiState:{scrollYOffset:t}}))}}}))(ce),qe=se((function({referrerType:a,...e}){const t=Z(),n=N(),c=H(),{tenantEmailDomain:o,accountTypeEncoded:l,accountIdEncoded:m,classIdEncoded:h,timeframe:T,startDate:D,endDate:y,titleEncoded:I}=Q(),p=b(l??""),A=b(m??""),k=b(h??""),x=b(I??""),C=g((d=>Pe(d.transactionListState,A,p,k))),[P,B]=S.useState(!1),[E,F]=S.useState(void 0),O=g((d=>U(d))),f=O.company?.companyInfo.firstMonthOfFY??1,{useFeatureGate:M}=ne(),{isFeatureEnabled:r}=M(q.isProjectsTransactionsEnabled),R=g((d=>X(d)))&&r;let i;const z=Ke(p,A,k,T,D,y,x);if(z){const d={startDate:Y(D,"YYYY-MM-DD"),endDate:Y(y,"YYYY-MM-DD")},_=Ne(C?.dateRange,d);i={accountId:A,accountType:ee(p),classId:k,title:x,timeframe:T,period:_}}S.useEffect((()=>{P||i==null||(B(!0),w.trackTransactionList(i.accountId,void 0,a,i.title),c(ye(i.accountId,i.accountType,i.classId,i.period)))}),[P,i,c]);let L=i;i!=null&&E!=null&&(L={...i,period:E});const $=[l,m,h,T,D,y,I].filter((d=>d!=null));return z&&L!=null?s.jsx(Je,{firstMonthOfFY:f,tenantEmailDomain:o,location:n,navigate:t,showProjectField:R,selectedAccount:L,referrerType:a,onSelectedTimePeriodChange:d=>F(d),...e}):s.jsx(G,{to:ge($.length)})})),ge=(a=7)=>{let e="../";for(let t=0;t<a;t++)e=`${e}../`;return e},Ke=(a,e,t,n,c,o,l)=>a!=null&&e!=null&&t!=null&&n!=null&&c!=null&&o!=null&&(n==="month"||n==="quarter")&&Y(c,"YYYY-MM-DD").isValid()&&Y(o,"YYYY-MM-DD").isValid()&&l!=null,Ne=(a,e)=>a!=null&&a.endDate.isSame(e.endDate,"day")&&a.startDate.isBefore(e.startDate,"day")?u(a):u(e),Ue=W((function(a,e){const t=xe(a.transactionState,a.transactionListState,e.selectedAccount.accountId,e.selectedAccount.accountType,e.selectedAccount.projectId,e.selectedAccount.timeframe,e.selectedAccount.period);return{accountId:e.selectedAccount.accountId,accountType:e.selectedAccount.accountType,title:e.selectedAccount.title,timeframe:e.selectedAccount.timeframe,timePeriod:ae(e.selectedAccount.period),dataAvailableForPeriod:ie(5,e.firstMonthOfFY),report:t,currentScrollYOffset:t.uiState?.scrollYOffset??0,isAccountingClassesEnabled:te(a)}}),(function(a,e){return{onBackClick:()=>{const t=oe(e.location.state?.pathnameStackToGoBack),n=t.poppedPathname??he();e.navigate(n,{state:{pathnameStackToGoBack:t.newStack}})},onTimePeriodChange:(t,n,c)=>{e.closeSidePanel?.();let o=n;t.startDate.isBefore(n.startDate,c)?o={startDate:t.startDate,endDate:n.endDate}:t.startDate.isAfter(n.endDate,c)?o={startDate:n.startDate,endDate:t.endDate}:console.error(`Invalid addTimePeriod ${JSON.stringify(t)}`),w.trackTransactionList(e.selectedAccount.accountId,void 0,e.referrerType,e.selectedAccount.title,void 0,!0),a(pe({accountId:e.selectedAccount.accountId,accountType:e.selectedAccount.accountType,projectId:e.selectedAccount.projectId,uiState:{dateRange:o}})),a(Ae(e.selectedAccount.accountId,e.selectedAccount.accountType,e.selectedAccount.projectId,u(o))),e.onSelectedTimePeriodChange(u(o))},onTransactionItemClick:t=>{if(e.openTransactionPanel)return void e.openTransactionPanel(t.id,t.type);const n=re(t,e.tenantEmailDomain),c=K(e.location.state?.pathnameStackToGoBack,e.location.pathname);e.navigate(n,{state:{pathnameStackToGoBack:c}})},onTransactionListScroll:t=>{a(pe({accountId:e.selectedAccount.accountId,accountType:e.selectedAccount.accountType,projectId:e.selectedAccount.projectId,uiState:{scrollYOffset:t}}))}}}))(ce),Ze=se((function({referrerType:a,...e}){const t=Z(),n=N(),c=H(),{tenantEmailDomain:o,accountTypeEncoded:l,accountIdEncoded:m,projectIdEncoded:h,timeframe:T,startDate:D,endDate:y,titleEncoded:I}=Q(),p=b(l??""),A=b(m??""),k=b(h??""),x=b(I??""),C=g((d=>je(d.transactionListState,A,p,k))),[P,B]=S.useState(!1),[E,F]=S.useState(void 0),O=g((d=>U(d))),f=O.company?.companyInfo.firstMonthOfFY??1,{useFeatureGate:M}=ne(),{isFeatureEnabled:r}=M(q.isProjectsTransactionsEnabled),R=g((d=>X(d)))&&r;let i;const z=He(p,A,k,T,D,y,x);if(z){const d={startDate:Y(D,"YYYY-MM-DD"),endDate:Y(y,"YYYY-MM-DD")},_=Qe(C?.dateRange,d);i={accountId:A,accountType:ee(p),projectId:k,title:x,timeframe:T,period:_}}S.useEffect((()=>{P||i==null||(B(!0),w.trackTransactionList(i.accountId,void 0,a,i.title),c(Ae(i.accountId,i.accountType,i.projectId,i.period)))}),[P,i,c]);let L=i;i!=null&&E!=null&&(L={...i,period:E});const $=[l,m,h,T,D,y,I].filter((d=>d!=null));return z&&L!=null?s.jsx(Ue,{firstMonthOfFY:f,tenantEmailDomain:o,location:n,navigate:t,showProjectField:R,selectedAccount:L,referrerType:a,onSelectedTimePeriodChange:d=>F(d),...e}):s.jsx(G,{to:he($.length)})})),he=(a=7)=>{let e="../";for(let t=0;t<a;t++)e=`${e}../`;return e},He=(a,e,t,n,c,o,l)=>a!=null&&e!=null&&t!=null&&n!=null&&c!=null&&o!=null&&(n==="month"||n==="quarter")&&Y(c,"YYYY-MM-DD").isValid()&&Y(o,"YYYY-MM-DD").isValid()&&l!=null,Qe=(a,e)=>a!=null&&a.endDate.isSame(e.endDate,"day")&&a.startDate.isBefore(e.startDate,"day")?u(a):u(e),We=W((function(a,e){const t=Le(a.transactionState,a.transactionListState,e.selectedAccount.accountId,e.selectedAccount.accountType,e.selectedAccount.timeframe,e.selectedAccount.period),n=t.account?.coaId,c=e.isConnectedAccountProviderUnit&&Ce(n??"");return{accountId:e.selectedAccount.accountId,accountType:e.selectedAccount.accountType,title:e.selectedAccount.title,timeframe:e.selectedAccount.timeframe,timePeriod:ae(e.selectedAccount.period),dataAvailableForPeriod:ie(5,e.firstMonthOfFY),report:t,currentScrollYOffset:t.uiState?.scrollYOffset??0,showStatementPageIcon:c,isAccountingClassesEnabled:te(a)}}),(function(a,e){return{onBackClick:()=>{const t=oe(e.location.state?.pathnameStackToGoBack),n=t.poppedPathname??Ie();e.navigate(n,{state:{pathnameStackToGoBack:t.newStack}})},onTimePeriodChange:(t,n,c)=>{e.closeSidePanel?.();let o=n;t.startDate.isBefore(n.startDate,c)?o={startDate:t.startDate,endDate:n.endDate}:t.startDate.isAfter(n.endDate,c)?o={startDate:n.startDate,endDate:t.endDate}:console.error(`Invalid addTimePeriod ${JSON.stringify(t)}`),w.trackTransactionList(e.selectedAccount.accountId,void 0,e.referrerType,e.selectedAccount.title,void 0,!0),a(fe({accountId:e.selectedAccount.accountId,accountType:e.selectedAccount.accountType,uiState:{dateRange:o}})),a(Se(e.selectedAccount.accountId,e.selectedAccount.accountType,u(o))),e.onSelectedTimePeriodChange(u(o))},onTransactionItemClick:t=>{if(e.openTransactionPanel)return void e.openTransactionPanel(t.id,t.type);const n=re(t,e.tenantEmailDomain),c=K(e.location.state?.pathnameStackToGoBack,e.location.pathname);e.navigate(n,{state:{pathnameStackToGoBack:c}})},onTransactionListScroll:t=>{a(fe({accountId:e.selectedAccount.accountId,accountType:e.selectedAccount.accountType,uiState:{scrollYOffset:t}}))},onStatementPageIconClick:()=>{const t=tt(e.tenantEmailDomain),n=K(e.location.state?.pathnameStackToGoBack,e.location.pathname);e.navigate(t,{state:{pathnameStackToGoBack:n}})}}}))(ce),Te=se((function({referrerType:a,...e}){const t=Z(),n=N(),c=H(),{tenantEmailDomain:o,accountTypeEncoded:l,accountIdEncoded:m,timeframe:h,startDate:T,endDate:D,titleEncoded:y,excludeSubAccounts:I}=Q(),p=b(l??""),A=b(m??""),k=b(y??""),x=!(I!=null&&I==="exclude_subaccounts"),C=g((v=>Me(v.transactionListState,A,p))),[P,B]=S.useState(!1),[E,F]=S.useState(void 0),O=g((v=>U(v))),f=O.company?.featuresActivationInfo.connectedAccountProvider==="unit",M=O.company?.companyInfo.firstMonthOfFY??1;let r;const R=Xe(p,A,h,T,D,k);if(R){const v={startDate:Y(T,"YYYY-MM-DD"),endDate:Y(D,"YYYY-MM-DD")},Ye=et(C?.dateRange,v);r={accountId:A,accountType:ee(p),title:k,timeframe:h,period:Ye}}let i=r;r!=null&&E!=null&&(i={...r,period:E});const{useFeatureGate:z}=ne(),{isFeatureEnabled:L}=z(q.isTransactionCommentingEnabled),{isFeatureEnabled:$}=z(q.isProjectsTransactionsEnabled),d=g((v=>X(v)))&&$,{areTenantIdsInSync:_}=Fe();S.useEffect((()=>{!P&&r!=null&&_&&(B(!0),w.trackTransactionList(r.accountId,void 0,a,r.title),c(Se(r.accountId,r.accountType,r.period,void 0,!1,x)))}),[P,r,c,_]);const ke=[l,m,h,T,D,y].filter((v=>v!=null));return R&&i!=null?s.jsx(We,{firstMonthOfFY:M,tenantEmailDomain:o,location:n,navigate:t,isConnectedAccountProviderUnit:f,isTransactionCommentingEnabled:L,showProjectField:d,selectedAccount:i,referrerType:a,onSelectedTimePeriodChange:v=>F(v),...e}):s.jsx(G,{to:Ie(ke.length)})})),Ie=(a=7)=>{let e="../";for(let t=0;t<a;t++)e=`${e}../`;return e},Xe=(a,e,t,n,c,o)=>a!=null&&e!=null&&t!=null&&n!=null&&c!=null&&(t==="month"||t==="quarter")&&Y(n,"YYYY-MM-DD").isValid()&&Y(c,"YYYY-MM-DD").isValid()&&o!=null,et=(a,e)=>a!=null&&a.endDate.isSame(e.endDate,"day")&&a.startDate.isBefore(e.startDate,"day")?u(a):u(e),tt=a=>`/${a}/transactions/${Be}/statements`;function kt(){const a=N().state?.referrer,e=g((n=>n.expenseAutomationViewState.selectedPeriodByTenantId))[g((n=>U(n))).tenantId],t=Oe();return s.jsxs(ve,{children:[s.jsx(j,{path:"/:accountTypeEncoded/:accountIdEncoded/:timeframe/:startDate/:endDate/:titleEncoded/:excludeSubAccounts/*",element:s.jsx(Te,{referrerType:a})}),s.jsx(j,{path:"/zeni-clearing-account/statements",element:s.jsx(we,{})}),s.jsx(j,{path:"/*",element:s.jsx(Te,{referrerType:a})}),s.jsx(j,{path:"/uncategorized-income/*",element:s.jsx(V,{})}),s.jsx(j,{path:"/uncategorized-expense/*",element:t?s.jsx(G,{to:`../../month_end_close_checks/review/transaction_categorization/${e.month}-${e.year}`}):s.jsx(V,{})}),s.jsx(j,{path:"/miscategorized-income/*",element:s.jsx(V,{})}),s.jsx(j,{path:"/miscategorized-expense/*",element:t?s.jsx(G,{to:`../../month_end_close_checks/review/transaction_categorization/${e.month}-${e.year}`}):s.jsx(V,{})}),s.jsx(j,{path:"/missing-receipts/*",element:t?s.jsx(G,{to:`../../month_end_close_checks/review/missing_receipts/${e.month}-${e.year}`}):s.jsx(V,{})}),s.jsx(j,{path:"/by-class/:accountTypeEncoded/:accountIdEncoded/:classIdEncoded/:timeframe/:startDate/:endDate/:titleEncoded/*",element:s.jsx(qe,{referrerType:a})}),s.jsx(j,{path:"/by-project/:accountTypeEncoded/:accountIdEncoded/:projectIdEncoded/:timeframe/:startDate/:endDate/:titleEncoded/*",element:s.jsx(Ze,{referrerType:a})})]})}export{kt as default};
@@ -1,4 +1,4 @@
1
- import{j as e}from"./liveblocks-ufh19lah.js";import{h as F,g as L,u as B,i as O,j as g,N as D,n as N,o as Ie,p as k}from"./core-QBDM2m9E.js";import{cr as G,eZ as E,QK as U,GL as ae,fY as H,Gt as ne,QM as Te,GO as ke,QI as je,QJ as se,QY as be,ES as Ae,uw as Ee,QO as ve,H5 as De,QL as re,cV as Q,yP as oe,fE as Fe,fG as Le,RX as Be,RY as Ue,Gu as Pe,RZ as Re,Gv as Me,GE as Ve,bs as Oe,bJ as Ne,cC as Ge,bK as _e,cq as ze,bt as $e,Mj as Ze,cp as He}from"./zeni-epic-state-BF09v22i.js";import{e as _,ar as Qe,z as A,F as z,f as j,ch as Je,ci as Ke,cj as Z,J,y as qe,_ as We,a0 as Ye,A as ie,c as v,H as Xe,E as et,ck as tt,au as K,v as at,cl as nt,r as q,cm as st,V as Y,cn as rt,i as ot}from"./index-BTTC92ci.js";import{D as it,n as R,S as ct}from"./mui-CB8RW45Z.js";import lt from"./NotFoundScreen-CIe1EEoJ.js";import{S as X}from"./SetupPagesScreen-BA7qIYz5.js";import{a as p}from"./sentry-Co2H8v0G.js";import{u as ut}from"./useAskAiCfoHostNavButtonProps-CPVGdgCK.js";import{u as dt}from"./useInitialThreadRequest-B3FrSAeQ.js";import{u as pt}from"./useCashManagementBanner-D33gFRsv.js";import{M as ce}from"./MobileAppDrawer-CWymkkwv.js";import{F as mt}from"./FeaturePreviewScreen-C9BLvwka.js";import{a as ee}from"./analyticsHelper-BveTv6Ie.js";import"./recharts-B8SFxg38.js";import"./analytics-C3yKGO2p.js";import"./plaid-DAwCYgVP.js";import"./dnd-DTpdpLY3.js";import"./stripe-cKAAJElX.js";import"./lottie-Ceg93JYe.js";import"./lexical-DBGXZJbY.js";import"./pdf-DdbTijar.js";import"./utils-CWM6Tene.js";import"./routePaths-DRm-ixUG.js";import"./BusinessVerificationPageScreen-BGwTSYvf.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]="ee4b4c83-9d1d-4b11-9282-058e5e011364",t._sentryDebugIdIdentifier="sentry-dbid-ee4b4c83-9d1d-4b11-9282-058e5e011364")}catch{}})();const ft=N((function(t,a){const{companyId:n}=a;return{treasurySetupView:U(t,n),analytics:j}}),(function(t,a){const{navigate:n,analytics:r,treasurySetupView:m}=a;return{onBackClick:()=>{n("../")},onNextClick:()=>{const s=m.fundAllocationLocalData;r.trackTreasuryPortfolioConfirm(s.riskScore,ee(s)),t(ke(!0))},onUpdateFundAllocation:s=>{r.trackTreasuryAllocationAction("update",ee(s)),t(Te(s))}}}))(Je);function yt(){const t=F(),a=L(),n=B(),{tenantEmailDomain:r}=O(),m=_(),s=g((T=>T.treasurySetupViewState.portfolioAllocationUpdateStatus?.fetchState)),f=Qe(s),o=G(m?.loggedInUserRoleMap),[u,i]=p.useState(!1),[d,w]=p.useState(!1),[c,l]=p.useState(!1),S=g((T=>E(T))),y=A.getSignedInUserTenant(r)?.companyId??S.companyId,x=A.getSignedInUser(),h=g((T=>U(T,y))),I=g((T=>T.treasurySetupViewState.fetchState)),C=g((T=>T.treasurySetupViewState.currentAllocation.fetchStatus?.fetchState)),M=g((T=>T.treasurySetupViewState.treasuryFundsDetails?.fetchStatus?.fetchState));if(x==null)throw Error("Can't access treasury portfolio allocation page without signing in...");if(p.useEffect((()=>{u||I!=="Not-Started"||y==null||(i(!0),n(ae(y,!0,!1)))}),[u,I,y,n]),p.useEffect((()=>{c||M!=="Not-Started"||y==null||(l(!0),n(H()))}),[c,M,y,n]),p.useEffect((()=>{d||C!=="Not-Started"||y==null||(w(!0),n(ne()))}),[d,C,y,n]),p.useEffect((()=>{f==="In-Progress"&&s==="Completed"&&t("../")}),[f,s,t]),S.companyTreasuryInfo?.info?.isTreasuryTOSAccepted===!1)return e.jsx(D,{to:"../promo"});const P=S.companyTreasuryInfo?.info?.isTreasuryTOSAccepted!==!0||I!=="Completed";return e.jsxs(e.Fragment,{children:[!P&&e.jsx(z,{analytics:j,onLoad:()=>{}}),e.jsx(ft,{navigate:t,location:a,companyId:y,isEditMode:!0,isLoading:P,isReadOnly:!o,treasurySetupView:h,analytics:j})]})}const gt=N((function(t,a){const n=a.currentTenant?.companyId;return{plaidConnectionDetails:be(t,n,"zeni_treasury","treasury_setup").plaidConnectionDetails,treasurySetupView:U(t,n)}}),(function(t,a){const{navigate:n,transferDetails:r,treasurySetupView:m}=a,s=r.treasuryTransferMoneyLocalData,f=m.fundAllocationLocalData;return{onCancelClick:()=>{Z(a.analytics,"cancel",s,f,"Transfer"),t(se()),n("../")},onTransferClick:()=>{Z(a.analytics,"confirm",s,f,"Transfer"),t(De())},onSaveChangesToLocalStore:o=>{t(ve(o))},onFetchLinkTokenClick:o=>{t(Ee("treasury_setup",o))},onEstablishConnectionClick:o=>{t(Ae(o,a.currentTenant?.companyId,"treasury_setup","zeni_treasury"))}}}))(Ke),ht=({isFirstTransfer:t})=>{const a=F(),{tenantEmailDomain:n}=O(),r=B(),[m,s]=p.useState(!1),[f,o]=p.useState(!1),[u,i]=p.useState(!1),[d,w]=p.useState(!1),c=g((C=>C.treasurySetupViewState.fetchState)),l=g((C=>C.treasurySetupViewState.treasuryFundsDetails?.fetchStatus?.fetchState)),S=g((C=>C.treasurySetupViewState.currentAllocation.fetchStatus?.fetchState)),y=g((C=>E(C))),x=A.getSignedInUserTenant(n)?.companyId??y.companyId,h=g((C=>je(C))),I=g((C=>U(C,x)));if(A.getSignedInUser()==null)throw Error("Can't access treasury transfer page without signing in...");return p.useEffect((()=>{f||c!=="Not-Started"||x==null||(o(!0),r(ae(x,!0,!1)))}),[f,c,x,r]),p.useEffect((()=>{u||l!=="Not-Started"||x==null||(i(!0),r(H()))}),[u,l,x,r]),p.useEffect((()=>{d||S!=="Not-Started"||x==null||(w(!0),r(ne()))}),[d,S,x,r]),e.jsxs(e.Fragment,{children:[e.jsx(z,{analytics:j,onLoad:()=>{}}),e.jsx(gt,{analytics:j,navigate:a,transferDetails:h,onAnotherTransferClick:()=>{s(!1),r(se())},currentTenant:y,treasurySetupView:I,showReviewContent:m,maxInsuredAmount:5e5,onReviewClick:()=>{Z(j,"review",h.treasuryTransferMoneyLocalData,I.fundAllocationLocalData,"Transfer"),s(!0)},isFirstTransfer:t,setShowReviewContent:s,onBackClick:()=>{}})]})},St=R.div`
1
+ import{j as e}from"./liveblocks-0jcT8Dx_.js";import{h as F,g as L,u as B,i as O,j as g,N as D,n as N,o as Ie,p as k}from"./core-DrRun-Wp.js";import{cr as G,eZ as E,QK as U,GL as ae,fY as H,Gt as ne,QM as Te,GO as ke,QI as je,QJ as se,QY as be,ES as Ae,uw as Ee,QO as ve,H5 as De,QL as re,cV as Q,yP as oe,fE as Fe,fG as Le,RX as Be,RY as Ue,Gu as Pe,RZ as Re,Gv as Me,GE as Ve,bs as Oe,bJ as Ne,cC as Ge,bK as _e,cq as ze,bt as $e,Mj as Ze,cp as He}from"./zeni-epic-state-D1OApLJ3.js";import{f as _,ar as Qe,z as A,E as z,g as j,ch as Je,ci as Ke,cj as Z,J,y as qe,_ as We,a0 as Ye,A as ie,c as v,H as Xe,C as et,ck as tt,au as K,w as at,cl as nt,s as q,cm as st,V as Y,cn as rt,d as ot}from"./index-24dzDu8E.js";import{D as it,n as R,S as ct}from"./mui-BCzMCgwZ.js";import lt from"./NotFoundScreen-BUTiP4R3.js";import{S as X}from"./SetupPagesScreen-BKdx-uAP.js";import{a as p}from"./sentry-Cix5j_Oe.js";import{u as ut}from"./useAskAiCfoHostNavButtonProps-DG7vn-Xl.js";import{u as dt}from"./useInitialThreadRequest-D3N5n5MK.js";import{u as pt}from"./useCashManagementBanner-Y_B1najt.js";import{M as ce}from"./MobileAppDrawer-zOj9FdCe.js";import{F as mt}from"./FeaturePreviewScreen-s3Vp54dP.js";import{a as ee}from"./analyticsHelper-DFsb6qRL.js";import"./recharts-BJColP3b.js";import"./analytics-CO5gayAE.js";import"./plaid-B0k6aBM1.js";import"./dnd-C7lg2kUY.js";import"./stripe-cKAAJElX.js";import"./lottie-C4eBAM7n.js";import"./lexical-Cceo9d8G.js";import"./pdf-C1ioMmzA.js";import"./utils-CvfvTDv6.js";import"./routePaths-Bty2j8lo.js";import"./BusinessVerificationPageScreen-YZ8HV6ZO.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]="df963d3c-af7b-4209-bea8-4eb0e83de4d2",t._sentryDebugIdIdentifier="sentry-dbid-df963d3c-af7b-4209-bea8-4eb0e83de4d2")}catch{}})();const ft=N((function(t,a){const{companyId:n}=a;return{treasurySetupView:U(t,n),analytics:j}}),(function(t,a){const{navigate:n,analytics:r,treasurySetupView:m}=a;return{onBackClick:()=>{n("../")},onNextClick:()=>{const s=m.fundAllocationLocalData;r.trackTreasuryPortfolioConfirm(s.riskScore,ee(s)),t(ke(!0))},onUpdateFundAllocation:s=>{r.trackTreasuryAllocationAction("update",ee(s)),t(Te(s))}}}))(Je);function yt(){const t=F(),a=L(),n=B(),{tenantEmailDomain:r}=O(),m=_(),s=g((T=>T.treasurySetupViewState.portfolioAllocationUpdateStatus?.fetchState)),f=Qe(s),o=G(m?.loggedInUserRoleMap),[u,i]=p.useState(!1),[d,w]=p.useState(!1),[c,l]=p.useState(!1),S=g((T=>E(T))),y=A.getSignedInUserTenant(r)?.companyId??S.companyId,x=A.getSignedInUser(),h=g((T=>U(T,y))),I=g((T=>T.treasurySetupViewState.fetchState)),C=g((T=>T.treasurySetupViewState.currentAllocation.fetchStatus?.fetchState)),M=g((T=>T.treasurySetupViewState.treasuryFundsDetails?.fetchStatus?.fetchState));if(x==null)throw Error("Can't access treasury portfolio allocation page without signing in...");if(p.useEffect((()=>{u||I!=="Not-Started"||y==null||(i(!0),n(ae(y,!0,!1)))}),[u,I,y,n]),p.useEffect((()=>{c||M!=="Not-Started"||y==null||(l(!0),n(H()))}),[c,M,y,n]),p.useEffect((()=>{d||C!=="Not-Started"||y==null||(w(!0),n(ne()))}),[d,C,y,n]),p.useEffect((()=>{f==="In-Progress"&&s==="Completed"&&t("../")}),[f,s,t]),S.companyTreasuryInfo?.info?.isTreasuryTOSAccepted===!1)return e.jsx(D,{to:"../promo"});const P=S.companyTreasuryInfo?.info?.isTreasuryTOSAccepted!==!0||I!=="Completed";return e.jsxs(e.Fragment,{children:[!P&&e.jsx(z,{analytics:j,onLoad:()=>{}}),e.jsx(ft,{navigate:t,location:a,companyId:y,isEditMode:!0,isLoading:P,isReadOnly:!o,treasurySetupView:h,analytics:j})]})}const gt=N((function(t,a){const n=a.currentTenant?.companyId;return{plaidConnectionDetails:be(t,n,"zeni_treasury","treasury_setup").plaidConnectionDetails,treasurySetupView:U(t,n)}}),(function(t,a){const{navigate:n,transferDetails:r,treasurySetupView:m}=a,s=r.treasuryTransferMoneyLocalData,f=m.fundAllocationLocalData;return{onCancelClick:()=>{Z(a.analytics,"cancel",s,f,"Transfer"),t(se()),n("../")},onTransferClick:()=>{Z(a.analytics,"confirm",s,f,"Transfer"),t(De())},onSaveChangesToLocalStore:o=>{t(ve(o))},onFetchLinkTokenClick:o=>{t(Ee("treasury_setup",o))},onEstablishConnectionClick:o=>{t(Ae(o,a.currentTenant?.companyId,"treasury_setup","zeni_treasury"))}}}))(Ke),ht=({isFirstTransfer:t})=>{const a=F(),{tenantEmailDomain:n}=O(),r=B(),[m,s]=p.useState(!1),[f,o]=p.useState(!1),[u,i]=p.useState(!1),[d,w]=p.useState(!1),c=g((C=>C.treasurySetupViewState.fetchState)),l=g((C=>C.treasurySetupViewState.treasuryFundsDetails?.fetchStatus?.fetchState)),S=g((C=>C.treasurySetupViewState.currentAllocation.fetchStatus?.fetchState)),y=g((C=>E(C))),x=A.getSignedInUserTenant(n)?.companyId??y.companyId,h=g((C=>je(C))),I=g((C=>U(C,x)));if(A.getSignedInUser()==null)throw Error("Can't access treasury transfer page without signing in...");return p.useEffect((()=>{f||c!=="Not-Started"||x==null||(o(!0),r(ae(x,!0,!1)))}),[f,c,x,r]),p.useEffect((()=>{u||l!=="Not-Started"||x==null||(i(!0),r(H()))}),[u,l,x,r]),p.useEffect((()=>{d||S!=="Not-Started"||x==null||(w(!0),r(ne()))}),[d,S,x,r]),e.jsxs(e.Fragment,{children:[e.jsx(z,{analytics:j,onLoad:()=>{}}),e.jsx(gt,{analytics:j,navigate:a,transferDetails:h,onAnotherTransferClick:()=>{s(!1),r(se())},currentTenant:y,treasurySetupView:I,showReviewContent:m,maxInsuredAmount:5e5,onReviewClick:()=>{Z(j,"review",h.treasuryTransferMoneyLocalData,I.fundAllocationLocalData,"Transfer"),s(!0)},isFirstTransfer:t,setShowReviewContent:s,onBackClick:()=>{}})]})},St=R.div`
2
2
  display: flex;
3
3
  min-height: 100%;
4
4
  width: 100%;
@@ -1,4 +1,4 @@
1
- import{j as l}from"./liveblocks-ufh19lah.js";import{a as f}from"./sentry-Co2H8v0G.js";import{h as J,g as K,i as N,j as S,n as G,u as Y,o as at,p as O,N as $}from"./core-QBDM2m9E.js";import{eZ as L,Ns as Ee,Nt as Re,gA as X,cx as be,cy as Ie,xo as St,Nu as nt,xs as Yt,Lr as ee,kG as te,xm as Kt,xg as qt,Nv as Ue,x8 as Ht,x7 as Qt,x1 as Wt,xd as Zt,xt as Xt,Nw as he,Nx as Me,x9 as ea,Ny as pe,fL as ft,xI as gt,xB as vt,Nz as xt,q1 as Tt,xw as yt,xu as Dt,NA as Ct,xP as Et,xM as bt,xx as It,xO as Je,JS as kt,NB as ta,NC as aa,cA as na,ND as sa,NE as oa,NF as me,NG as ie,NH as ke,Ls as Ge,y2 as ye,Lq as De,xR as wt,xp as $e,NI as la,Lt as H,NJ as ze,xj as ia,NK as ca,NL as da,NM as Ye,NN as Ke,NO as qe,NP as He,xY as we,NQ as At,xF as Ft,NR as ra,NS as ua,NT as ha,NU as pa,NV as ma,NW as Sa,NX as fa,NY as ga,uI as va,uQ as xa,uJ as Ta,Ky as Fe,NZ as ya,N_ as Da,k3 as je,bo as Ca,N$ as Ea,O0 as ba,lE as Ia,lN as ka,Kx as Pe,bE as st,O1 as jt,K8 as Pt,O2 as wa,O3 as Aa,O4 as Fa,lP as ja,O5 as ot,O6 as lt,O7 as it,O8 as ct,O9 as Pa,lL as _a,Oa as Va,lO as La,Ob as Oa,Oc as _t,KT as Vt,l2 as Ba,Od as Na,Oe as _e,Of as Lt,KR as Ot,Ak as Ra,Og as Ua,Oh as Ma,lm as Bt,Oi as Ja,Oj as Ga,L3 as $a,sh as za,Ok as Nt,Ol as dt,L0 as Ve,Om as rt,On as Ya,L5 as Ka,Oo as qa,Op as Ha,Oq as Qa,Or as Wa,Os as Za,sk as Xa,Ot as en,Lu as tn,Ou as an,KK as Le,hL as nn,Ov as sn,Ow as on,hJ as ln,Ox as cn,Oy as dn,Ao as rn,Oz as un,OA as hn,OB as pn,OC as mn,l6 as Sn,bn as fn,fG as gn,fE as vn}from"./zeni-epic-state-BF09v22i.js";import{z as R,ar as Oe,E as Rt,F as W,f as F,a4 as Z,aB as xn,v as M,O as Ce,B as ce,aC as Qe,aD as Tn,aE as yn,r as We,aF as Dn,y as Cn,J as de,H as Ze,A as ae,c as z,aG as En,m as Xe,a0 as Se,aH as bn,aI as Ut,_ as In,aJ as kn,e as wn,aK as An,au as Mt,aL as Fn,o as Q,G as jn,K as Jt,M as Pn,aM as _n,aN as Vn,h as et,aO as Ln,aP as On,D as Bn,aQ as Nn,aR as Rn}from"./index-BTTC92ci.js";import{n as U,D as Un,S as Gt}from"./mui-CB8RW45Z.js";import{t as Mn,A as Jn}from"./AddressScreen-Bn9eD_vN.js";import le from"./NotFoundScreen-CIe1EEoJ.js";import{F as Gn}from"./FeaturePreviewScreen-C9BLvwka.js";import{c as q,v as tt,d as $n}from"./routePaths-DRm-ixUG.js";import{p as $t}from"./pathToGoBack-Bi5ALgzm.js";import{u as fe}from"./useAskAiCfoHostNavButtonProps-CPVGdgCK.js";import{M as ge}from"./MobileAppDrawer-CWymkkwv.js";import{D as zn}from"./DrawerScreen-CaJ0qHuQ.js";import{g as Yn,m as Kn}from"./accountMappingHelper-DPo5_oRM.js";import"./recharts-B8SFxg38.js";import"./analytics-C3yKGO2p.js";import"./plaid-DAwCYgVP.js";import"./dnd-DTpdpLY3.js";import"./stripe-cKAAJElX.js";import"./lottie-Ceg93JYe.js";import"./lexical-DBGXZJbY.js";import"./pdf-DdbTijar.js";import"./utils-CWM6Tene.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]="43bd72d3-423b-4fdd-b019-cfc11eca2afd",e._sentryDebugIdIdentifier="sentry-dbid-43bd72d3-423b-4fdd-b019-cfc11eca2afd")}catch{}})();const qn=Ce.getLocalizedStrings(),Hn=G((function(e,a){const s=Re(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(Yt()),s("..",{relative:"path"})},onTransactionClick:n=>{const o=`${q(n,a.tenantEmailDomain)}`,c=M(t.state?.pathnameStackToGoBack,t.pathname);s(o,{state:{pathnameStackToGoBack:c}})},onLinkSave(){a.setShouldNavigateBack(!1),e(St(a.scheduleTab,a.scheduleAccruedDetailsView.selectedJEAccruedSchedule?.jeScheduleId))}}}))(xn),Qn=({setShouldNavigateBack:e})=>{const a=J(),s=K(),{scheduleDetailId:t,tenantEmailDomain:n}=N(),{scheduleType:o}=N();if(n==null)throw Error("Can't access Link Bill Expense page without tenant Email Domain");const c=S((g=>L(g))),r=Ee(o)??"accrued_expenses",h=R.getSignedInUser();if(h==null)throw Error("Can't access Link Bill Expensedetail page without signing in...");if(t==null)throw Error("Invalid Schedule Detail Id");const i=S((g=>Re(g,r))),p=i.selectedJELinkRowIndex,d=S((g=>X(g,c.companyId))),u=Oe(i.updateStatus.fetchState);f.useEffect((()=>{u==="In-Progress"&&i.updateStatus.fetchState==="Completed"&&a("..",{relative:"path"})}),[u,i.updateStatus.fetchState]),f.useEffect((()=>{i.fetchState==="Not-Started"&&a("..",{relative:"path"})}),[]),f.useEffect((()=>{i.selectedJEAccruedSchedule!=null&&i.selectedJELinkRowIndex!=null||a("..",{relative:"path"})}),[i.selectedJEAccruedSchedule,i.selectedJELinkRowIndex]);const m=i.linkBillExpenseView.fetchState==="Completed";return l.jsx(l.Fragment,{children:i.linkBillExpenseView.fetchState==="In-Progress"?l.jsx(Rt,{fetchState:i.linkBillExpenseView.fetchState}):i.selectedJEAccruedSchedule!=null&&p!=null?l.jsxs(l.Fragment,{children:[m===!0?l.jsx(W,{analytics:F,onLoad:()=>{Wn(i,r,d)}}):null,l.jsx(Hn,{signedInUser:h,attachmentEndPoint:`${Z}/vendor_attachments`,setShouldNavigateBack:e,scheduleVendorId:i.selectedJEAccruedSchedule.vendor.id??"",location:s,tenantEmailDomain:n,scheduleAccruedDetailsView:i,saveFetchState:i.updateStatus.fetchState,scheduleTab:r,navigate:a,analytics:F,controllerUserDetails:d,saveStatus:i.updateStatus.fetchState,jeAccruedSchedule:i.selectedJEAccruedSchedule,localData:i.scheduleAccruedDetailsLocalData.jeScheduleDetails[p]})]}):null})},zt=e=>{const a=qn.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}},Wn=(e,a,s)=>{const t=e.selectedJEAccruedSchedule,n=e.selectedJELinkRowIndex;let o;n!=null&&t!=null&&(o=t.scheduledJournalEntry[n]);const{transactions:c}=e.linkBillExpenseView,r=c.some((p=>p.isRecommendedTransaction===!0)),h=be(s.controllers),i=Ie(s.controllerUserIds);t!=null&&F.trackScheduleAccruedDetailsJournalEntryLinkedLoaded({scheduleType:a,schedule:{...zt(t)},scheduleExpenseCategoryAndClass:{expenseCategory:t.jeDebit.account?.accountName??null,expenseClass:t.jeDebit.accountingClass?.className??null},journalEntryDetails:{wasRecommendationAvailable:r,journalEntryPostingStatus:o?.status.label??""},vendorName:t.vendor.name??null,controllerEmails:h,controllerUserIds:i})},Zn=U.div`
1
+ import{j as l}from"./liveblocks-0jcT8Dx_.js";import{a as f}from"./sentry-Cix5j_Oe.js";import{h as J,g as K,i as N,j as S,n as G,u as Y,o as at,p as O,N as $}from"./core-DrRun-Wp.js";import{eZ as L,Ns as Ee,Nt as Re,gA as X,cx as be,cy as Ie,xo as St,Nu as nt,xs as Yt,Lr as ee,kG as te,xm as Kt,xg as qt,Nv as Ue,x8 as Ht,x7 as Qt,x1 as Wt,xd as Zt,xt as Xt,Nw as he,Nx as Me,x9 as ea,Ny as pe,fL as ft,xI as gt,xB as vt,Nz as xt,q1 as Tt,xw as yt,xu as Dt,NA as Ct,xP as Et,xM as bt,xx as It,xO as Je,JS as wt,NB as ta,NC as aa,cA as na,ND as sa,NE as oa,NF as me,NG as ie,NH as we,Ls as Ge,y2 as ye,Lq as De,xR as kt,xp as $e,NI as la,Lt as H,NJ as ze,xj as ia,NK as ca,NL as da,NM as Ye,NN as Ke,NO as qe,NP as He,xY as ke,NQ as At,xF as jt,NR as ra,NS as ua,NT as ha,NU as pa,NV as ma,NW as Sa,NX as fa,NY as ga,uI as va,uQ as xa,uJ as Ta,Ky as je,NZ as ya,N_ as Da,k3 as Fe,bo as Ca,N$ as Ea,O0 as ba,lE as Ia,lN as wa,Kx as Pe,bE as st,O1 as Ft,K8 as Pt,O2 as ka,O3 as Aa,O4 as ja,lP as Fa,O5 as ot,O6 as lt,O7 as it,O8 as ct,O9 as Pa,lL as _a,Oa as Va,lO as La,Ob as Oa,Oc as _t,KT as Vt,l2 as Ba,Od as Na,Oe as _e,Of as Lt,KR as Ot,Ak as Ra,Og as Ua,Oh as Ma,lm as Bt,Oi as Ja,Oj as Ga,L3 as $a,sh as za,Ok as Nt,Ol as dt,L0 as Ve,Om as rt,On as Ya,L5 as Ka,Oo as qa,Op as Ha,Oq as Qa,Or as Wa,Os as Za,sk as Xa,Ot as en,Lu as tn,Ou as an,KK as Le,hL as nn,Ov as sn,Ow as on,hJ as ln,Ox as cn,Oy as dn,Ao as rn,Oz as un,OA as hn,OB as pn,OC as mn,l6 as Sn,bn as fn,fG as gn,fE as vn}from"./zeni-epic-state-D1OApLJ3.js";import{z as R,ar as Oe,C as Rt,E as W,g as j,a4 as Z,aB as xn,w as M,O as Ce,S as ce,aC as Qe,aD as Tn,aE as yn,s as We,aF as Dn,y as Cn,J as de,H as Ze,A as ae,c as z,aG as En,p as Xe,a0 as Se,aH as bn,aI as Ut,_ as In,aJ as wn,f as kn,aK as An,au as Mt,aL as jn,o as Q,G as Fn,K as Jt,M as Pn,aM as _n,aN as Vn,j as et,aO as Ln,aP as On,D as Bn,aQ as Nn,aR as Rn}from"./index-24dzDu8E.js";import{n as U,D as Un,S as Gt}from"./mui-BCzMCgwZ.js";import{t as Mn,A as Jn}from"./AddressScreen-vfbZQ8IJ.js";import le from"./NotFoundScreen-BUTiP4R3.js";import{F as Gn}from"./FeaturePreviewScreen-s3Vp54dP.js";import{c as q,v as tt,d as $n}from"./routePaths-Bty2j8lo.js";import{p as $t}from"./pathToGoBack-aFGIF63I.js";import{u as fe}from"./useAskAiCfoHostNavButtonProps-DG7vn-Xl.js";import{M as ge}from"./MobileAppDrawer-zOj9FdCe.js";import{D as zn}from"./DrawerScreen-D9iKOMtR.js";import{g as Yn,m as Kn}from"./accountMappingHelper-B0l8lAeR.js";import"./recharts-BJColP3b.js";import"./analytics-CO5gayAE.js";import"./plaid-B0k6aBM1.js";import"./dnd-C7lg2kUY.js";import"./stripe-cKAAJElX.js";import"./lottie-C4eBAM7n.js";import"./lexical-Cceo9d8G.js";import"./pdf-C1ioMmzA.js";import"./utils-CvfvTDv6.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]="8a224ecc-20ca-46f7-ab03-d3412840b505",e._sentryDebugIdIdentifier="sentry-dbid-8a224ecc-20ca-46f7-ab03-d3412840b505")}catch{}})();const qn=Ce.getLocalizedStrings(),Hn=G((function(e,a){const s=Re(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(Yt()),s("..",{relative:"path"})},onTransactionClick:n=>{const o=`${q(n,a.tenantEmailDomain)}`,c=M(t.state?.pathnameStackToGoBack,t.pathname);s(o,{state:{pathnameStackToGoBack:c}})},onLinkSave(){a.setShouldNavigateBack(!1),e(St(a.scheduleTab,a.scheduleAccruedDetailsView.selectedJEAccruedSchedule?.jeScheduleId))}}}))(xn),Qn=({setShouldNavigateBack:e})=>{const a=J(),s=K(),{scheduleDetailId:t,tenantEmailDomain:n}=N(),{scheduleType:o}=N();if(n==null)throw Error("Can't access Link Bill Expense page without tenant Email Domain");const c=S((g=>L(g))),r=Ee(o)??"accrued_expenses",h=R.getSignedInUser();if(h==null)throw Error("Can't access Link Bill Expensedetail page without signing in...");if(t==null)throw Error("Invalid Schedule Detail Id");const i=S((g=>Re(g,r))),p=i.selectedJELinkRowIndex,d=S((g=>X(g,c.companyId))),u=Oe(i.updateStatus.fetchState);f.useEffect((()=>{u==="In-Progress"&&i.updateStatus.fetchState==="Completed"&&a("..",{relative:"path"})}),[u,i.updateStatus.fetchState]),f.useEffect((()=>{i.fetchState==="Not-Started"&&a("..",{relative:"path"})}),[]),f.useEffect((()=>{i.selectedJEAccruedSchedule!=null&&i.selectedJELinkRowIndex!=null||a("..",{relative:"path"})}),[i.selectedJEAccruedSchedule,i.selectedJELinkRowIndex]);const m=i.linkBillExpenseView.fetchState==="Completed";return l.jsx(l.Fragment,{children:i.linkBillExpenseView.fetchState==="In-Progress"?l.jsx(Rt,{fetchState:i.linkBillExpenseView.fetchState}):i.selectedJEAccruedSchedule!=null&&p!=null?l.jsxs(l.Fragment,{children:[m===!0?l.jsx(W,{analytics:j,onLoad:()=>{Wn(i,r,d)}}):null,l.jsx(Hn,{signedInUser:h,attachmentEndPoint:`${Z}/vendor_attachments`,setShouldNavigateBack:e,scheduleVendorId:i.selectedJEAccruedSchedule.vendor.id??"",location:s,tenantEmailDomain:n,scheduleAccruedDetailsView:i,saveFetchState:i.updateStatus.fetchState,scheduleTab:r,navigate:a,analytics:j,controllerUserDetails:d,saveStatus:i.updateStatus.fetchState,jeAccruedSchedule:i.selectedJEAccruedSchedule,localData:i.scheduleAccruedDetailsLocalData.jeScheduleDetails[p]})]}):null})},zt=e=>{const a=qn.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}},Wn=(e,a,s)=>{const t=e.selectedJEAccruedSchedule,n=e.selectedJELinkRowIndex;let o;n!=null&&t!=null&&(o=t.scheduledJournalEntry[n]);const{transactions:c}=e.linkBillExpenseView,r=c.some((p=>p.isRecommendedTransaction===!0)),h=be(s.controllers),i=Ie(s.controllerUserIds);t!=null&&j.trackScheduleAccruedDetailsJournalEntryLinkedLoaded({scheduleType:a,schedule:{...zt(t)},scheduleExpenseCategoryAndClass:{expenseCategory:t.jeDebit.account?.accountName??null,expenseClass:t.jeDebit.accountingClass?.className??null},journalEntryDetails:{wasRecommendationAvailable:r,journalEntryPostingStatus:o?.status.label??""},vendorName:t.vendor.name??null,controllerEmails:h,controllerUserIds:i})},Zn=U.div`
2
2
  display: flex;
3
3
  min-height: 100%;
4
4
  width: 100%;
@@ -6,7 +6,7 @@ import{j as l}from"./liveblocks-ufh19lah.js";import{a as f}from"./sentry-Co2H8v0
6
6
  flex-direction: column;
7
7
  align-items: center;
8
8
  background-color: ${e=>e.theme.colors.grey4};
9
- `,Xn=G((function(e){const a=L(e),s=e.entityAutoCompleteState.autoCompleteText.common,t=Ue(e,"common");return{tenantName:a.companyName,vendorSearchAutoCompleteData:{autoCompleteText:s,entityAutoCompleteView:t}}}),(function(e,a){const{navigate:s,location:t}=a,n="accrued_expenses";return{onNavigateBack:()=>{s("../schedules/accrued_expenses")},onZeniLogoClick:()=>{a.themeState.toggle()},onSave:o=>{a.setShouldNavigateBack(!0),e(St(n,o))},onDelete:o=>{e(ea(n,o))},vendorSearchAutoCompleteActions:{onAutoCompleteInputChange:(o,c)=>{o.trim().length>=2?e(Me({searchString:o,entityType:c,searchOrigin:"common"})):o.trim().length===0&&e(he("common"))},onCancelAutoComplete:()=>{e(he("common"))}},onEditAmount:(o,c)=>{e(Xt(n,o,c))},onJELinkClick:o=>{e(Zt({selectedJELinkRowIndex:o})),s("./edit_link")},onCancelAccrual:(o,c,r)=>{e(Wt(o,c,r))},onTransactionClick:o=>{const c=`${q(o,a.tenantEmailDomain)}`,r=M(t.state?.pathnameStackToGoBack,t.pathname);s(c,{state:{pathnameStackToGoBack:r}})},onViewPostedJE:o=>{const c=`${q(o,a.tenantEmailDomain)}`,r=M(t.state?.pathnameStackToGoBack,t.pathname);s(c,{state:{pathnameStackToGoBack:r}})},onViewRecordedJE:o=>{const c=`${q(o,a.tenantEmailDomain)}`,r=M(t.state?.pathnameStackToGoBack,t.pathname);s(c,{state:{pathnameStackToGoBack:r}})},onViewBillExpense:o=>{const c=`${q(o,a.tenantEmailDomain)}`,r=M(t.state?.pathnameStackToGoBack,t.pathname);s(c,{state:{pathnameStackToGoBack:r}})},onDetailPageChange:(o,c,r)=>{const{scheduleDetailsAccruedExpensesSection:h}=o,{amount:i,memo:p,months:d,scheduleAccruedExpenseCategory:u,scheduleClass:m,scheduleExpenseCategory:g,startDate:D,vendor:x}=h,b=m.selectedOption!=null?a.classList.find((I=>I.classId===m.selectedOption)):void 0,C=g.selectedOption!=null?a.accountList.find((I=>I.qboId===g.selectedOption)):void 0,E=u.selectedOption!=null?a.accruedAccountList.find((I=>I.qboId===u.selectedOption)):void 0,w=d?.selectedOption;e(Ht({scheduleType:n,localData:c,selectedJeScheduleDetailId:a.scheduleDetailId})),r!==!1||a.scheduleDetailId!=null||C?.accountId==null||a.isAccountingClassesEnabled!==!1&&b?.classId==null||E==null||x.selectedOption==null||p==null||i==null&&i==0||D==null||w==null||e(Qt({scheduleType:n}))}}}))(Tn),es=({shouldNavigateBack:e,setShouldNavigateBack:a})=>{const s=J(),t=K(),n=Y(),o=ce(),{tenantEmailDomain:c}=N(),[r,h]=f.useState(!1);if(c==null)throw new Error("Can't access this page without a tenantEmailDomain");const{scheduleDetailId:i}=N();let p;i!=="new"&&(p=i);const d=ts(i),u=S((y=>y.scheduleAccruedDetailState.selectedJEAccruedScheduleKey)),m="accrued_expenses",g=S((y=>Re(y,"accrued_expenses"))),D=S((y=>ee(y))),x=S((y=>y.classListState.fetchState)),b=S((y=>te(y))),C=D!=="Completed"||x!=="Completed";f.useEffect((()=>{r===!1&&C?(n(Kt(m,p)),h(!0)):C===!1&&r===!1&&i!=="new"&&(n(qt(m,i)),h(!0))}),[r]);const E=S((y=>L(y))),w=S((y=>X(y,E.companyId))),I=g.fetchState,k=g.allAccountList,_=g.allClassList,j=g.allAccruedAccountList,V=g.scheduleAccruedDetailsLocalData;if(d!==!0||g.fetchState==="Error")return l.jsx(le,{});const A=I==="Completed"&&r===!0;return I!=="Completed"&&I!=="Not-Started"?l.jsx(Qe,{}):l.jsxs(Zn,{children:[A===!0?l.jsx(W,{analytics:F,onLoad:()=>{as(g,m,w)}}):null,l.jsx(Xn,{setShouldNavigateBack:a,scheduleAccruedDetailsView:g,location:t,navigate:s,classList:_,accountList:k,shouldNavigateBack:e,accruedAccountList:j,scheduleLocalData:V,selectedJEScheduleKey:u,scheduleDetailId:p,selectedScheduledJournalEntries:g.selectedJEAccruedSchedule?.scheduledJournalEntry??[],themeState:o,tenantEmailDomain:c,analytics:F,controllerUserDetails:w,isAccountingClassesEnabled:b,status:g.selectedJEAccruedSchedule?.status.code})]})},ts=e=>e!=null,as=(e,a,s)=>{const t=e.selectedJEAccruedSchedule,n=be(s.controllers),o=Ie(s.controllerUserIds);t!=null&&F.trackScheduleAccruedDetailsLoaded({scheduleType:a,scheduleExpenseCategoryAndClass:{expenseCategory:t.jeDebit.account?.accountName??null,expenseClass:t.jeDebit.accountingClass?.className??null},schedule:{...zt(t)},vendorName:t.vendor.name??null,controllerEmails:n,controllerUserIds:o})},ns=U.div`
9
+ `,Xn=G((function(e){const a=L(e),s=e.entityAutoCompleteState.autoCompleteText.common,t=Ue(e,"common");return{tenantName:a.companyName,vendorSearchAutoCompleteData:{autoCompleteText:s,entityAutoCompleteView:t}}}),(function(e,a){const{navigate:s,location:t}=a,n="accrued_expenses";return{onNavigateBack:()=>{s("../schedules/accrued_expenses")},onZeniLogoClick:()=>{a.themeState.toggle()},onSave:o=>{a.setShouldNavigateBack(!0),e(St(n,o))},onDelete:o=>{e(ea(n,o))},vendorSearchAutoCompleteActions:{onAutoCompleteInputChange:(o,c)=>{o.trim().length>=2?e(Me({searchString:o,entityType:c,searchOrigin:"common"})):o.trim().length===0&&e(he("common"))},onCancelAutoComplete:()=>{e(he("common"))}},onEditAmount:(o,c)=>{e(Xt(n,o,c))},onJELinkClick:o=>{e(Zt({selectedJELinkRowIndex:o})),s("./edit_link")},onCancelAccrual:(o,c,r)=>{e(Wt(o,c,r))},onTransactionClick:o=>{const c=`${q(o,a.tenantEmailDomain)}`,r=M(t.state?.pathnameStackToGoBack,t.pathname);s(c,{state:{pathnameStackToGoBack:r}})},onViewPostedJE:o=>{const c=`${q(o,a.tenantEmailDomain)}`,r=M(t.state?.pathnameStackToGoBack,t.pathname);s(c,{state:{pathnameStackToGoBack:r}})},onViewRecordedJE:o=>{const c=`${q(o,a.tenantEmailDomain)}`,r=M(t.state?.pathnameStackToGoBack,t.pathname);s(c,{state:{pathnameStackToGoBack:r}})},onViewBillExpense:o=>{const c=`${q(o,a.tenantEmailDomain)}`,r=M(t.state?.pathnameStackToGoBack,t.pathname);s(c,{state:{pathnameStackToGoBack:r}})},onDetailPageChange:(o,c,r)=>{const{scheduleDetailsAccruedExpensesSection:h}=o,{amount:i,memo:p,months:d,scheduleAccruedExpenseCategory:u,scheduleClass:m,scheduleExpenseCategory:g,startDate:D,vendor:x}=h,b=m.selectedOption!=null?a.classList.find((I=>I.classId===m.selectedOption)):void 0,C=g.selectedOption!=null?a.accountList.find((I=>I.qboId===g.selectedOption)):void 0,E=u.selectedOption!=null?a.accruedAccountList.find((I=>I.qboId===u.selectedOption)):void 0,k=d?.selectedOption;e(Ht({scheduleType:n,localData:c,selectedJeScheduleDetailId:a.scheduleDetailId})),r!==!1||a.scheduleDetailId!=null||C?.accountId==null||a.isAccountingClassesEnabled!==!1&&b?.classId==null||E==null||x.selectedOption==null||p==null||i==null&&i==0||D==null||k==null||e(Qt({scheduleType:n}))}}}))(Tn),es=({shouldNavigateBack:e,setShouldNavigateBack:a})=>{const s=J(),t=K(),n=Y(),o=ce(),{tenantEmailDomain:c}=N(),[r,h]=f.useState(!1);if(c==null)throw new Error("Can't access this page without a tenantEmailDomain");const{scheduleDetailId:i}=N();let p;i!=="new"&&(p=i);const d=ts(i),u=S((y=>y.scheduleAccruedDetailState.selectedJEAccruedScheduleKey)),m="accrued_expenses",g=S((y=>Re(y,"accrued_expenses"))),D=S((y=>ee(y))),x=S((y=>y.classListState.fetchState)),b=S((y=>te(y))),C=D!=="Completed"||x!=="Completed";f.useEffect((()=>{r===!1&&C?(n(Kt(m,p)),h(!0)):C===!1&&r===!1&&i!=="new"&&(n(qt(m,i)),h(!0))}),[r]);const E=S((y=>L(y))),k=S((y=>X(y,E.companyId))),I=g.fetchState,w=g.allAccountList,_=g.allClassList,F=g.allAccruedAccountList,V=g.scheduleAccruedDetailsLocalData;if(d!==!0||g.fetchState==="Error")return l.jsx(le,{});const A=I==="Completed"&&r===!0;return I!=="Completed"&&I!=="Not-Started"?l.jsx(Qe,{}):l.jsxs(Zn,{children:[A===!0?l.jsx(W,{analytics:j,onLoad:()=>{as(g,m,k)}}):null,l.jsx(Xn,{setShouldNavigateBack:a,scheduleAccruedDetailsView:g,location:t,navigate:s,classList:_,accountList:w,shouldNavigateBack:e,accruedAccountList:F,scheduleLocalData:V,selectedJEScheduleKey:u,scheduleDetailId:p,selectedScheduledJournalEntries:g.selectedJEAccruedSchedule?.scheduledJournalEntry??[],themeState:o,tenantEmailDomain:c,analytics:j,controllerUserDetails:k,isAccountingClassesEnabled:b,status:g.selectedJEAccruedSchedule?.status.code})]})},ts=e=>e!=null,as=(e,a,s)=>{const t=e.selectedJEAccruedSchedule,n=be(s.controllers),o=Ie(s.controllerUserIds);t!=null&&j.trackScheduleAccruedDetailsLoaded({scheduleType:a,scheduleExpenseCategoryAndClass:{expenseCategory:t.jeDebit.account?.accountName??null,expenseClass:t.jeDebit.accountingClass?.className??null},schedule:{...zt(t)},vendorName:t.vendor.name??null,controllerEmails:n,controllerUserIds:o})},ns=U.div`
10
10
  display: flex;
11
11
  min-height: 100%;
12
12
  width: 100%;
@@ -14,7 +14,7 @@ import{j as l}from"./liveblocks-ufh19lah.js";import{a as f}from"./sentry-Co2H8v0
14
14
  flex-direction: column;
15
15
  align-items: center;
16
16
  background-color: ${e=>e.theme.colors.grey4};
17
- `,Be=Ce.getLocalizedStrings().dateFormat.analytics.YYYYDashMMDashDDFormat,ss=G((function(e){const a=L(e),s=pe(e,"fixed_assets");return{tenantName:a.companyName,scheduleDetailsView:s}}),(function(e,a){const{navigate:s,location:t,vendorSearchAutoCompleteData:n,selectedScheduledJournalEntries:o}=a,c="fixed_assets",r=t.state?.message==="expenseAutomation",h=o.flatMap((i=>i.error)).filter((i=>!!i))??[];return{onNavigateBack:()=>{if(r===!0){const i=We(a.location.state?.pathnameStackToGoBack),p=i.poppedPathname??$t(2);a.navigate(p,{state:{pathnameStackToGoBack:i.newStack}})}else s("../schedules/fixed_assets")},onZeniLogoClick:()=>{a.themeState.toggle()},onSave:i=>{e(Je(c,i,h.length>0))},onDelete:i=>{e(It(c,i))},onMarkAsComplete:()=>{a.selectedJEScheduleKey!=null&&e(bt(c,a.selectedJEScheduleKey))},onEditAmount:(i,p)=>{e(Et(c,i,p))},onJELinkClick:i=>{e(Ct({selectedJELinkRowIndex:i})),s("./edit_link")},onTransactionClick:i=>{const p=`${q(i,a.tenantEmailDomain)}`,d=M(t.state?.pathnameStackToGoBack,t.pathname);s(p,{state:{pathnameStackToGoBack:d,message:"comingFromScheduleDetailsFixedAssets"}})},onViewLinkedJE:i=>{const p=`${q(i,a.tenantEmailDomain)}`,d=M(t.state?.pathnameStackToGoBack,t.pathname);s(p,{state:{pathnameStackToGoBack:d}})},vendorSearchAutoCompleteActions:{onAutoCompleteInputChange:(i,p)=>{i.trim().length>=2?e(Me({searchString:i,entityType:p,searchOrigin:"common"})):i.trim().length===0&&e(he("common"))},onCancelAutoComplete:()=>{e(he("common"))}},onDetailPageChange:(i,p)=>{const{scheduleDetailsFixedAssetsSection:d,scheduleDetailsListSection:u}=i,{scheduleClass:m,scheduleExpenseCategory:g,accumulatedDepreciationCategory:D,assetId:x,months:b,startDate:C,postingDate:E,vendor:w}=d,I=n.entityAutoCompleteView.vendor.length>0?n.entityAutoCompleteView.vendor.find((v=>v.id===w?.selectedOption)):void 0,k={id:I?.zeniId??w?.selectedOption??"",name:I?.name??w?.defaultOptions.find((v=>v.value===w?.selectedOption))?.label??"",logo:I?.logo},_=m.selectedOption!=null?a.classList.find((v=>v.classId===m.selectedOption)):void 0,j=g.selectedOption!=null?a.accountList.find((v=>v.qboId===g.selectedOption)):void 0,V=D.selectedOption!=null?a.depAccountList.find((v=>v.qboId===D.selectedOption)):void 0,A=b?.selectedOption,y=u.map(((v,re)=>({...a.scheduleLocalData.jeScheduleDetails[re],amount:{...a.scheduleLocalData.jeScheduleDetails[re].amount,amount:v.amount}}))),P=E.type==="day"?E.dayOfMonth?E.dayOfMonth:1:void 0,T=E.type==="lastDayOfMonth"||void 0;e(yt({scheduleType:c,localData:{selectedAccount:j?.accountId,selectedClass:_?.classId,selectedAccumulatedDepreciationCategory:V?.accountId,selectedDate:C,selectedMonths:A,assetId:x,jeScheduleDetails:y,lastDayOfMonth:T,selectedDayOfMonth:P,selectedVendor:k},selectedJeScheduleDetailId:a.scheduleDetailId})),p!==!1||V?.accountId==null||a.scheduleDetailId!=null&&a.status!=="draft"&&a.status!=="marked_as_completed"||j?.accountId==null||a.isAccountingClassesEnabled!==!1&&_?.classId==null||C==null||A==null||T!==!0&&P==null||e(Dt({scheduleType:c}))}}}))(yn),os=()=>{const e=J(),a=K(),s=Y(),t=ce(),{tenantEmailDomain:n}=N(),[o,c]=f.useState(!1),{scheduleDetailId:r}=N(),h=a.state?.message==="expenseAutomation",i=ls(r),p=S((T=>T.scheduleDetailState.selectedJEScheduleKey));f.useEffect((()=>{p!=null&&p.length!==0||r!=="new"||e("../schedules/fixed_assets")}),[p,r]);const d="fixed_assets",u=S((T=>pe(T,d))),m=S((T=>T.entityAutoCompleteState.autoCompleteText.common)),g=S((T=>Ue(T,"common"))),D=S((T=>ee(T))),x=S((T=>T.classListState.fetchState)),b=S((T=>te(T))),C=S((T=>ft(T).selectedPeriod)),E=D!=="Completed"||x!=="Completed";f.useEffect((()=>{o===!1&&E?(s(gt(d,y,!0)),c(!0)):E===!1&&o===!1&&(s(vt(d,r==="new"?void 0:r,!0)),c(!0))}),[o]),f.useEffect((()=>{if(u.markAsCompleteStatus.fetchState==="Completed")if(s(xt()),h===!0){const{month:T,year:v}=C;e(`../../month_end_close_checks/review/je_schedules/${T}-${v}`)}else e("../schedules/fixed_assets")}),[u.markAsCompleteStatus.fetchState]);const w=S((T=>L(T))),I=S((T=>X(T,w.companyId))),k=u.fetchState,_=u.allAccountList,j=u.allClassList,V=u.allDepreciationAccountList,A=u.scheduleDetailsLocalData.fixed_assets;let y;if(r!=="new"&&(y=r),i!==!0||u.fetchState==="Error")return l.jsx(le,{});const P=k==="Completed"&&o===!0;return k!=="Completed"?l.jsx(Qe,{}):l.jsxs(ns,{children:[P===!0?l.jsx(W,{analytics:F,onLoad:()=>{cs(u,d,I)}}):null,l.jsx(ss,{location:a,navigate:e,classList:j,vendorSearchEntityAutoCompleteView:g,vendorSearchAutoCompleteData:{autoCompleteText:m,entityAutoCompleteView:g},expenseAutomationSelectedPeriod:C,usedInExpenseAutomation:h,removeJeScheduleTransactionKey:(T,v)=>{s(Tt(T,v))},accountList:_,depAccountList:V,scheduleLocalData:A,selectedJEScheduleKey:p,scheduleDetailId:y,selectedScheduledJournalEntries:u.selectedJEScheduleTransaction?.scheduledJournalEntry??[],themeState:t,tenantEmailDomain:n,analytics:F,controllerUserDetails:I,isAccountingClassesEnabled:b,status:u.selectedJEScheduleTransaction?.status.code})]})},ls=e=>e!=null,is=e=>({transactionDate:e.date.format(Be),transactionAmount:e.amount,scheduleCategory:e.account.accountName,scheduleClass:e.classBase?.className??null,description:e.memo}),cs=(e,a,s)=>{const t=e.selectedJEScheduleTransaction?.baseTransaction,n=e.selectedJEScheduleTransaction,o=be(s.controllers),c=Ie(s.controllerUserIds);var r;t!=null&&n!=null&&F.trackScheduleDetailsLoaded({scheduleType:a,transaction:{...is(t)},scheduleExpenseCategoryAndClass:{expenseCategory:n.jeDebit.account?.accountName??null,expenseClass:n.jeDebit.accountingClass?.className??null},scheduledTransaction:{...(r=n,{currentBalance:r.balanceAsOfToday??null,currentStatus:r.status.label,period:r.period??null,startMonth:r.startDate?.format(Be)??null,endMonth:r.endDate?.format(Be)??null})},vendorName:n.vendor.name??null,fixedAssetsDetails:{accumulatedDepreciationCategory:n.jeCredit.account?.accountName??null,assetId:n.otherAttributes.assetId??null},controllerEmails:o,controllerUserIds:c})},ds=U.div`
17
+ `,Be=Ce.getLocalizedStrings().dateFormat.analytics.YYYYDashMMDashDDFormat,ss=G((function(e){const a=L(e),s=pe(e,"fixed_assets");return{tenantName:a.companyName,scheduleDetailsView:s}}),(function(e,a){const{navigate:s,location:t,vendorSearchAutoCompleteData:n,selectedScheduledJournalEntries:o}=a,c="fixed_assets",r=t.state?.message==="expenseAutomation",h=o.flatMap((i=>i.error)).filter((i=>!!i))??[];return{onNavigateBack:()=>{if(r===!0){const i=We(a.location.state?.pathnameStackToGoBack),p=i.poppedPathname??$t(2);a.navigate(p,{state:{pathnameStackToGoBack:i.newStack}})}else s("../schedules/fixed_assets")},onZeniLogoClick:()=>{a.themeState.toggle()},onSave:i=>{e(Je(c,i,h.length>0))},onDelete:i=>{e(It(c,i))},onMarkAsComplete:()=>{a.selectedJEScheduleKey!=null&&e(bt(c,a.selectedJEScheduleKey))},onEditAmount:(i,p)=>{e(Et(c,i,p))},onJELinkClick:i=>{e(Ct({selectedJELinkRowIndex:i})),s("./edit_link")},onTransactionClick:i=>{const p=`${q(i,a.tenantEmailDomain)}`,d=M(t.state?.pathnameStackToGoBack,t.pathname);s(p,{state:{pathnameStackToGoBack:d,message:"comingFromScheduleDetailsFixedAssets"}})},onViewLinkedJE:i=>{const p=`${q(i,a.tenantEmailDomain)}`,d=M(t.state?.pathnameStackToGoBack,t.pathname);s(p,{state:{pathnameStackToGoBack:d}})},vendorSearchAutoCompleteActions:{onAutoCompleteInputChange:(i,p)=>{i.trim().length>=2?e(Me({searchString:i,entityType:p,searchOrigin:"common"})):i.trim().length===0&&e(he("common"))},onCancelAutoComplete:()=>{e(he("common"))}},onDetailPageChange:(i,p)=>{const{scheduleDetailsFixedAssetsSection:d,scheduleDetailsListSection:u}=i,{scheduleClass:m,scheduleExpenseCategory:g,accumulatedDepreciationCategory:D,assetId:x,months:b,startDate:C,postingDate:E,vendor:k}=d,I=n.entityAutoCompleteView.vendor.length>0?n.entityAutoCompleteView.vendor.find((v=>v.id===k?.selectedOption)):void 0,w={id:I?.zeniId??k?.selectedOption??"",name:I?.name??k?.defaultOptions.find((v=>v.value===k?.selectedOption))?.label??"",logo:I?.logo},_=m.selectedOption!=null?a.classList.find((v=>v.classId===m.selectedOption)):void 0,F=g.selectedOption!=null?a.accountList.find((v=>v.qboId===g.selectedOption)):void 0,V=D.selectedOption!=null?a.depAccountList.find((v=>v.qboId===D.selectedOption)):void 0,A=b?.selectedOption,y=u.map(((v,re)=>({...a.scheduleLocalData.jeScheduleDetails[re],amount:{...a.scheduleLocalData.jeScheduleDetails[re].amount,amount:v.amount}}))),P=E.type==="day"?E.dayOfMonth?E.dayOfMonth:1:void 0,T=E.type==="lastDayOfMonth"||void 0;e(yt({scheduleType:c,localData:{selectedAccount:F?.accountId,selectedClass:_?.classId,selectedAccumulatedDepreciationCategory:V?.accountId,selectedDate:C,selectedMonths:A,assetId:x,jeScheduleDetails:y,lastDayOfMonth:T,selectedDayOfMonth:P,selectedVendor:w},selectedJeScheduleDetailId:a.scheduleDetailId})),p!==!1||V?.accountId==null||a.scheduleDetailId!=null&&a.status!=="draft"&&a.status!=="marked_as_completed"||F?.accountId==null||a.isAccountingClassesEnabled!==!1&&_?.classId==null||C==null||A==null||T!==!0&&P==null||e(Dt({scheduleType:c}))}}}))(yn),os=()=>{const e=J(),a=K(),s=Y(),t=ce(),{tenantEmailDomain:n}=N(),[o,c]=f.useState(!1),{scheduleDetailId:r}=N(),h=a.state?.message==="expenseAutomation",i=ls(r),p=S((T=>T.scheduleDetailState.selectedJEScheduleKey));f.useEffect((()=>{p!=null&&p.length!==0||r!=="new"||e("../schedules/fixed_assets")}),[p,r]);const d="fixed_assets",u=S((T=>pe(T,d))),m=S((T=>T.entityAutoCompleteState.autoCompleteText.common)),g=S((T=>Ue(T,"common"))),D=S((T=>ee(T))),x=S((T=>T.classListState.fetchState)),b=S((T=>te(T))),C=S((T=>ft(T).selectedPeriod)),E=D!=="Completed"||x!=="Completed";f.useEffect((()=>{o===!1&&E?(s(gt(d,y,!0)),c(!0)):E===!1&&o===!1&&(s(vt(d,r==="new"?void 0:r,!0)),c(!0))}),[o]),f.useEffect((()=>{if(u.markAsCompleteStatus.fetchState==="Completed")if(s(xt()),h===!0){const{month:T,year:v}=C;e(`../../month_end_close_checks/review/je_schedules/${T}-${v}`)}else e("../schedules/fixed_assets")}),[u.markAsCompleteStatus.fetchState]);const k=S((T=>L(T))),I=S((T=>X(T,k.companyId))),w=u.fetchState,_=u.allAccountList,F=u.allClassList,V=u.allDepreciationAccountList,A=u.scheduleDetailsLocalData.fixed_assets;let y;if(r!=="new"&&(y=r),i!==!0||u.fetchState==="Error")return l.jsx(le,{});const P=w==="Completed"&&o===!0;return w!=="Completed"?l.jsx(Qe,{}):l.jsxs(ns,{children:[P===!0?l.jsx(W,{analytics:j,onLoad:()=>{cs(u,d,I)}}):null,l.jsx(ss,{location:a,navigate:e,classList:F,vendorSearchEntityAutoCompleteView:g,vendorSearchAutoCompleteData:{autoCompleteText:m,entityAutoCompleteView:g},expenseAutomationSelectedPeriod:C,usedInExpenseAutomation:h,removeJeScheduleTransactionKey:(T,v)=>{s(Tt(T,v))},accountList:_,depAccountList:V,scheduleLocalData:A,selectedJEScheduleKey:p,scheduleDetailId:y,selectedScheduledJournalEntries:u.selectedJEScheduleTransaction?.scheduledJournalEntry??[],themeState:t,tenantEmailDomain:n,analytics:j,controllerUserDetails:I,isAccountingClassesEnabled:b,status:u.selectedJEScheduleTransaction?.status.code})]})},ls=e=>e!=null,is=e=>({transactionDate:e.date.format(Be),transactionAmount:e.amount,scheduleCategory:e.account.accountName,scheduleClass:e.classBase?.className??null,description:e.memo}),cs=(e,a,s)=>{const t=e.selectedJEScheduleTransaction?.baseTransaction,n=e.selectedJEScheduleTransaction,o=be(s.controllers),c=Ie(s.controllerUserIds);var r;t!=null&&n!=null&&j.trackScheduleDetailsLoaded({scheduleType:a,transaction:{...is(t)},scheduleExpenseCategoryAndClass:{expenseCategory:n.jeDebit.account?.accountName??null,expenseClass:n.jeDebit.accountingClass?.className??null},scheduledTransaction:{...(r=n,{currentBalance:r.balanceAsOfToday??null,currentStatus:r.status.label,period:r.period??null,startMonth:r.startDate?.format(Be)??null,endMonth:r.endDate?.format(Be)??null})},vendorName:n.vendor.name??null,fixedAssetsDetails:{accumulatedDepreciationCategory:n.jeCredit.account?.accountName??null,assetId:n.otherAttributes.assetId??null},controllerEmails:o,controllerUserIds:c})},ds=U.div`
18
18
  display: flex;
19
19
  min-height: 100%;
20
20
  width: 100%;
@@ -22,11 +22,11 @@ import{j as l}from"./liveblocks-ufh19lah.js";import{a as f}from"./sentry-Co2H8v0
22
22
  flex-direction: column;
23
23
  align-items: center;
24
24
  background-color: ${e=>e.theme.colors.grey4};
25
- `,Ne=Ce.getLocalizedStrings().dateFormat.analytics.YYYYDashMMDashDDFormat,rs=G((function(e,a){const s=L(e),t=pe(e,a.scheduleTab);return{tenantName:s.companyName,scheduleDetailsView:t}}),(function(e,a){const{navigate:s,location:t,usedInExpenseAutomation:n,vendorSearchAutoCompleteData:o,selectedScheduledJournalEntries:c}=a,r=c.flatMap((h=>h.error)).filter((h=>!!h))??[];return{onNavigateBack:()=>{if(n===!0){const h=We(a.location.state?.pathnameStackToGoBack),i=h.poppedPathname??$t(2);a.navigate(i,{state:{pathnameStackToGoBack:h.newStack}})}else s("../schedules/prepaid_expenses")},onZeniLogoClick:()=>{a.themeState.toggle()},onSave:h=>{e(Je(a.scheduleTab,h,r.length>0))},onDelete:h=>{e(It(a.scheduleTab,h))},onMarkAsComplete:()=>{a.selectedJEScheduleKey!=null&&e(bt(a.scheduleTab,a.selectedJEScheduleKey))},onEditAmount:(h,i)=>{e(Et(a.scheduleTab,h,i))},onJELinkClick:h=>{e(Ct({selectedJELinkRowIndex:h})),s("./edit_link")},onTransactionClick:h=>{const i=`${q(h,a.tenantEmailDomain)}`,p=M(t.state?.pathnameStackToGoBack,t.pathname);s(i,{state:{pathnameStackToGoBack:p,message:"comingFromScheduleDetails"}})},onViewLinkedJE:h=>{const i=`${q(h,a.tenantEmailDomain)}`,p=M(t.state?.pathnameStackToGoBack,t.pathname);s(i,{state:{pathnameStackToGoBack:p}})},vendorSearchAutoCompleteActions:{onAutoCompleteInputChange:(h,i)=>{h.trim().length>=2?e(Me({searchString:h,entityType:i,searchOrigin:"common"})):h.trim().length===0&&e(he("common"))},onCancelAutoComplete:()=>{e(he("common"))}},onDetailPageChange:(h,i)=>{const{scheduleDetailsSection:p,scheduleDetailsListSection:d}=h,{scheduleClass:u,scheduleExpenseCategory:m,months:g,startDate:D,postingDate:x,vendor:b}=p,C=o.entityAutoCompleteView.vendor.length>0?o.entityAutoCompleteView.vendor.find((y=>y.id===b?.selectedOption)):void 0,E={id:C?.zeniId??b?.selectedOption??"",name:C?.name??b?.defaultOptions.find((y=>y.value===b?.selectedOption))?.label??"",logo:C?.logo},w=u.selectedOption!=null?a.classList.find((y=>y.classId===u.selectedOption)):void 0,I=m.selectedOption!=null?a.accountList.find((y=>y.qboId===m.selectedOption)):void 0,k=g?.selectedOption,_=d.map(((y,P)=>({...a.scheduleLocalData.jeScheduleDetails[P],amount:{...a.scheduleLocalData.jeScheduleDetails[P].amount,amount:y.amount}}))),j=x.type==="day"?x.dayOfMonth?x.dayOfMonth:1:void 0,V=x.type==="lastDayOfMonth"||void 0,A={selectedAccount:I?.accountId,selectedClass:w?.classId,selectedDate:D,selectedMonths:k,jeScheduleDetails:_,lastDayOfMonth:V,selectedVendor:E,selectedDayOfMonth:j};e(yt({scheduleType:a.scheduleTab,localData:A,selectedJeScheduleDetailId:a.scheduleDetailId})),i!==!1||a.scheduleDetailId!=null&&a.status!=="draft"&&a.status!=="marked_as_completed"||I?.accountId==null||a.isAccountingClassesEnabled!==!1&&w?.classId==null||D==null||k==null||V!==!0&&j==null||e(Dt({scheduleType:a.scheduleTab}))}}}))(Dn),us=()=>{const e=J(),a=K(),s=Y(),t=ce(),{tenantEmailDomain:n}=N(),[o,c]=f.useState(!1),r=a.state?.message==="expenseAutomation",{scheduleType:h,scheduleDetailId:i}=N(),p=hs(h,i),d=S((T=>T.scheduleDetailState.selectedJEScheduleKey));f.useEffect((()=>{d!=null&&d.length!==0||i!=="new"||e("../schedules/prepaid_expenses")}),[d,i]);const u=Ee(h)??"prepaid_expenses",m=S((T=>pe(T,u))),g=S((T=>T.entityAutoCompleteState.autoCompleteText.common)),D=S((T=>Ue(T,"common"))),x=S((T=>ee(T))),b=S((T=>T.classListState.fetchState)),C=S((T=>te(T))),E=S((T=>ft(T).selectedPeriod)),w=x!=="Completed"||b!=="Completed";f.useEffect((()=>{o===!1&&w?(s(gt(u,y,!0)),c(!0)):w===!1&&o===!1&&(s(vt(u,i==="new"?void 0:i,!0)),c(!0))}),[o]),f.useEffect((()=>{if(m.markAsCompleteStatus.fetchState==="Completed")if(s(xt()),r===!0){const{month:T,year:v}=E;e(`../../month_end_close_checks/review/je_schedules/${T}-${v}`)}else e("../schedules/prepaid_expenses")}),[m.markAsCompleteStatus.fetchState]);const I=S((T=>L(T))),k=S((T=>X(T,I.companyId))),_=m.fetchState,j=m.allAccountList,V=m.allClassList,A=m.scheduleDetailsLocalData;let y;if(i!=="new"&&(y=i),p!==!0||m.fetchState==="Error")return l.jsx(le,{});const P=_==="Completed"&&o===!0;return _!=="Completed"?l.jsx(Qe,{}):l.jsxs(ds,{children:[P===!0?l.jsx(W,{analytics:F,onLoad:()=>{ms(m,u,k)}}):null,l.jsx(rs,{location:a,vendorSearchEntityAutoCompleteView:D,vendorSearchAutoCompleteData:{autoCompleteText:g,entityAutoCompleteView:D},usedInExpenseAutomation:r,removeJeScheduleTransactionKey:(T,v)=>{s(Tt(T,v))},expenseAutomationSelectedPeriod:E,navigate:e,classList:V,accountList:j,scheduleLocalData:A[u],selectedJEScheduleKey:d,scheduleDetailId:y,selectedScheduledJournalEntries:m.selectedJEScheduleTransaction?.scheduledJournalEntry??[],themeState:t,tenantEmailDomain:n,scheduleTab:u,analytics:F,controllerUserDetails:k,isAccountingClassesEnabled:C,status:m.selectedJEScheduleTransaction?.status.code})]})},hs=(e,a)=>Ee(e)!=null&&a!=null,ps=e=>({transactionDate:e.date.format(Ne),transactionAmount:e.amount,scheduleCategory:e.account.accountName,scheduleClass:e.classBase?.className??null,description:e.memo}),ms=(e,a,s)=>{const t=e.selectedJEScheduleTransaction?.baseTransaction,n=e.selectedJEScheduleTransaction,o=be(s.controllers),c=Ie(s.controllerUserIds);var r;t!=null&&n!=null&&F.trackScheduleDetailsLoaded({scheduleType:a,transaction:{...ps(t)},scheduleExpenseCategoryAndClass:{expenseCategory:n.jeDebit.account?.accountName??null,expenseClass:n.jeDebit.accountingClass?.className??null},scheduledTransaction:{...(r=n,{currentBalance:r.balanceAsOfToday??null,currentStatus:r.status.label,period:r.period??null,startMonth:r.startDate?.format(Ne)??null,endMonth:r.endDate?.format(Ne)??null})},vendorName:n.vendor.name??null,controllerEmails:o,controllerUserIds:c})},Ss={drawerLeftMargin:new Ze(0,0,100,200)},fs=G((function(e,a){const{jeScheduledTransaction:s,selectedJERow:t,scheduleType:n,isVendorBulkUpdateOnTransactionEnabled:o}=a,{scheduleDetailsLocalData:c,updateStatus:r}=pe(e,a.scheduleType),h=L(e),i=c[n].jeScheduleDetails[t].jeLink,p=i.type==="recommended"?i.recommendedTransactionID:i.transactionDetailID,d=p!=null?aa(e,p):void 0,u=R.getSignedInUser(),m=e.tenantState.currentTenantId,g={userId:u?.userId??"",sessionId:u?.zeniSessionId??"",tenantId:h.tenantId??m},D=h?.company?.companyInfo?.firstMonthOfFY??1;return{jeScheduledTransaction:s,transactionDetail:d,localData:c[n].jeScheduleDetails[t],saveStatus:r.fetchState,authParams:g,isVendorBulkUpdateOnTransactionEnabled:o,firstMonthOfFY:D,isDisabled:r.fetchState==="In-Progress"?"readonly":void 0,analytics:F,qboAppUrl:na(Xe.qboRedirectionUrl)}}),(function(e,a){const{selectedJERow:s,jeScheduleDetailId:t,navigate:n}=a;return{onUpdateLocalData:o=>{const c=o.linkJETransaction.qboURL;c!=null&&e(oa({scheduleType:a.scheduleType,jeScheduleDetailId:t,rowId:s,jeLink:c}))},onFetchTransactionClick:o=>{e(kt(o))},onSaveClick:()=>{e(Je(a.scheduleType,t))},onBackClick:()=>{n("..",{relative:"path"})},onCancelClick:()=>{const o=a.jeScheduledTransaction.scheduledJournalEntry[s];e(sa({scheduleType:a.scheduleType,jeScheduleDetailId:t,rowId:s,originalScheduledJE:o})),n("..",{relative:"path"})}}}))(En),gs=()=>{const e=Cn(),a=J(),s=Y(),{scheduleDetailId:t}=N(),n=de(),o=Ss.drawerLeftMargin.valuePx(n),{scheduleType:c}=N(),{useFeatureGate:r}=ae(),{isFeatureEnabled:h}=r(z.isVendorBulkUpdateOnTransactionEnabled),i=Ee(c)??"prepaid_expenses",[p,d]=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 u=S((C=>pe(C,i)));f.useEffect((()=>{u.fetchState==="Not-Started"&&a("..",{relative:"path"})}),[]);const m=u.selectedJELinkRowIndex,g=m!=null?u.scheduleDetailsLocalData[i].jeScheduleDetails[m]?.jeLink:null,D=g?.type==="recommended"?g.recommendedTransactionID:g?.transactionDetailID;f.useEffect((()=>{D!=null&&s(kt(D))}),[]),f.useEffect((()=>{g?.type==="recommended"&&p===!1&&m!=null&&(d(!0),s(ta({scheduleType:i,jeScheduleDetailId:t,rowId:m})))}));const x=S((C=>L(C))),b=S((C=>X(C,x.companyId)));return l.jsx(Un,{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(vs,{onClick:C=>C.stopPropagation(),children:u.fetchState!=="Completed"||u.selectedJEScheduleTransaction==null||m==null?l.jsx(Rt,{fetchState:u.fetchState}):l.jsx(fs,{scheduleType:i,jeScheduleDetailId:t,selectedJERow:m,jeScheduledTransaction:u.selectedJEScheduleTransaction,isCOTEnabled:!1,navigate:a,scheduleTab:i,controllerUserDetails:b,isVendorBulkUpdateOnTransactionEnabled:h})})})},vs=U(Gt)`
25
+ `,Ne=Ce.getLocalizedStrings().dateFormat.analytics.YYYYDashMMDashDDFormat,rs=G((function(e,a){const s=L(e),t=pe(e,a.scheduleTab);return{tenantName:s.companyName,scheduleDetailsView:t}}),(function(e,a){const{navigate:s,location:t,usedInExpenseAutomation:n,vendorSearchAutoCompleteData:o,selectedScheduledJournalEntries:c}=a,r=c.flatMap((h=>h.error)).filter((h=>!!h))??[];return{onNavigateBack:()=>{if(n===!0){const h=We(a.location.state?.pathnameStackToGoBack),i=h.poppedPathname??$t(2);a.navigate(i,{state:{pathnameStackToGoBack:h.newStack}})}else s("../schedules/prepaid_expenses")},onZeniLogoClick:()=>{a.themeState.toggle()},onSave:h=>{e(Je(a.scheduleTab,h,r.length>0))},onDelete:h=>{e(It(a.scheduleTab,h))},onMarkAsComplete:()=>{a.selectedJEScheduleKey!=null&&e(bt(a.scheduleTab,a.selectedJEScheduleKey))},onEditAmount:(h,i)=>{e(Et(a.scheduleTab,h,i))},onJELinkClick:h=>{e(Ct({selectedJELinkRowIndex:h})),s("./edit_link")},onTransactionClick:h=>{const i=`${q(h,a.tenantEmailDomain)}`,p=M(t.state?.pathnameStackToGoBack,t.pathname);s(i,{state:{pathnameStackToGoBack:p,message:"comingFromScheduleDetails"}})},onViewLinkedJE:h=>{const i=`${q(h,a.tenantEmailDomain)}`,p=M(t.state?.pathnameStackToGoBack,t.pathname);s(i,{state:{pathnameStackToGoBack:p}})},vendorSearchAutoCompleteActions:{onAutoCompleteInputChange:(h,i)=>{h.trim().length>=2?e(Me({searchString:h,entityType:i,searchOrigin:"common"})):h.trim().length===0&&e(he("common"))},onCancelAutoComplete:()=>{e(he("common"))}},onDetailPageChange:(h,i)=>{const{scheduleDetailsSection:p,scheduleDetailsListSection:d}=h,{scheduleClass:u,scheduleExpenseCategory:m,months:g,startDate:D,postingDate:x,vendor:b}=p,C=o.entityAutoCompleteView.vendor.length>0?o.entityAutoCompleteView.vendor.find((y=>y.id===b?.selectedOption)):void 0,E={id:C?.zeniId??b?.selectedOption??"",name:C?.name??b?.defaultOptions.find((y=>y.value===b?.selectedOption))?.label??"",logo:C?.logo},k=u.selectedOption!=null?a.classList.find((y=>y.classId===u.selectedOption)):void 0,I=m.selectedOption!=null?a.accountList.find((y=>y.qboId===m.selectedOption)):void 0,w=g?.selectedOption,_=d.map(((y,P)=>({...a.scheduleLocalData.jeScheduleDetails[P],amount:{...a.scheduleLocalData.jeScheduleDetails[P].amount,amount:y.amount}}))),F=x.type==="day"?x.dayOfMonth?x.dayOfMonth:1:void 0,V=x.type==="lastDayOfMonth"||void 0,A={selectedAccount:I?.accountId,selectedClass:k?.classId,selectedDate:D,selectedMonths:w,jeScheduleDetails:_,lastDayOfMonth:V,selectedVendor:E,selectedDayOfMonth:F};e(yt({scheduleType:a.scheduleTab,localData:A,selectedJeScheduleDetailId:a.scheduleDetailId})),i!==!1||a.scheduleDetailId!=null&&a.status!=="draft"&&a.status!=="marked_as_completed"||I?.accountId==null||a.isAccountingClassesEnabled!==!1&&k?.classId==null||D==null||w==null||V!==!0&&F==null||e(Dt({scheduleType:a.scheduleTab}))}}}))(Dn),us=()=>{const e=J(),a=K(),s=Y(),t=ce(),{tenantEmailDomain:n}=N(),[o,c]=f.useState(!1),r=a.state?.message==="expenseAutomation",{scheduleType:h,scheduleDetailId:i}=N(),p=hs(h,i),d=S((T=>T.scheduleDetailState.selectedJEScheduleKey));f.useEffect((()=>{d!=null&&d.length!==0||i!=="new"||e("../schedules/prepaid_expenses")}),[d,i]);const u=Ee(h)??"prepaid_expenses",m=S((T=>pe(T,u))),g=S((T=>T.entityAutoCompleteState.autoCompleteText.common)),D=S((T=>Ue(T,"common"))),x=S((T=>ee(T))),b=S((T=>T.classListState.fetchState)),C=S((T=>te(T))),E=S((T=>ft(T).selectedPeriod)),k=x!=="Completed"||b!=="Completed";f.useEffect((()=>{o===!1&&k?(s(gt(u,y,!0)),c(!0)):k===!1&&o===!1&&(s(vt(u,i==="new"?void 0:i,!0)),c(!0))}),[o]),f.useEffect((()=>{if(m.markAsCompleteStatus.fetchState==="Completed")if(s(xt()),r===!0){const{month:T,year:v}=E;e(`../../month_end_close_checks/review/je_schedules/${T}-${v}`)}else e("../schedules/prepaid_expenses")}),[m.markAsCompleteStatus.fetchState]);const I=S((T=>L(T))),w=S((T=>X(T,I.companyId))),_=m.fetchState,F=m.allAccountList,V=m.allClassList,A=m.scheduleDetailsLocalData;let y;if(i!=="new"&&(y=i),p!==!0||m.fetchState==="Error")return l.jsx(le,{});const P=_==="Completed"&&o===!0;return _!=="Completed"?l.jsx(Qe,{}):l.jsxs(ds,{children:[P===!0?l.jsx(W,{analytics:j,onLoad:()=>{ms(m,u,w)}}):null,l.jsx(rs,{location:a,vendorSearchEntityAutoCompleteView:D,vendorSearchAutoCompleteData:{autoCompleteText:g,entityAutoCompleteView:D},usedInExpenseAutomation:r,removeJeScheduleTransactionKey:(T,v)=>{s(Tt(T,v))},expenseAutomationSelectedPeriod:E,navigate:e,classList:V,accountList:F,scheduleLocalData:A[u],selectedJEScheduleKey:d,scheduleDetailId:y,selectedScheduledJournalEntries:m.selectedJEScheduleTransaction?.scheduledJournalEntry??[],themeState:t,tenantEmailDomain:n,scheduleTab:u,analytics:j,controllerUserDetails:w,isAccountingClassesEnabled:C,status:m.selectedJEScheduleTransaction?.status.code})]})},hs=(e,a)=>Ee(e)!=null&&a!=null,ps=e=>({transactionDate:e.date.format(Ne),transactionAmount:e.amount,scheduleCategory:e.account.accountName,scheduleClass:e.classBase?.className??null,description:e.memo}),ms=(e,a,s)=>{const t=e.selectedJEScheduleTransaction?.baseTransaction,n=e.selectedJEScheduleTransaction,o=be(s.controllers),c=Ie(s.controllerUserIds);var r;t!=null&&n!=null&&j.trackScheduleDetailsLoaded({scheduleType:a,transaction:{...ps(t)},scheduleExpenseCategoryAndClass:{expenseCategory:n.jeDebit.account?.accountName??null,expenseClass:n.jeDebit.accountingClass?.className??null},scheduledTransaction:{...(r=n,{currentBalance:r.balanceAsOfToday??null,currentStatus:r.status.label,period:r.period??null,startMonth:r.startDate?.format(Ne)??null,endMonth:r.endDate?.format(Ne)??null})},vendorName:n.vendor.name??null,controllerEmails:o,controllerUserIds:c})},Ss={drawerLeftMargin:new Ze(0,0,100,200)},fs=G((function(e,a){const{jeScheduledTransaction:s,selectedJERow:t,scheduleType:n,isVendorBulkUpdateOnTransactionEnabled:o}=a,{scheduleDetailsLocalData:c,updateStatus:r}=pe(e,a.scheduleType),h=L(e),i=c[n].jeScheduleDetails[t].jeLink,p=i.type==="recommended"?i.recommendedTransactionID:i.transactionDetailID,d=p!=null?aa(e,p):void 0,u=R.getSignedInUser(),m=e.tenantState.currentTenantId,g={userId:u?.userId??"",sessionId:u?.zeniSessionId??"",tenantId:h.tenantId??m},D=h?.company?.companyInfo?.firstMonthOfFY??1;return{jeScheduledTransaction:s,transactionDetail:d,localData:c[n].jeScheduleDetails[t],saveStatus:r.fetchState,authParams:g,isVendorBulkUpdateOnTransactionEnabled:o,firstMonthOfFY:D,isDisabled:r.fetchState==="In-Progress"?"readonly":void 0,analytics:j,qboAppUrl:na(Xe.qboRedirectionUrl)}}),(function(e,a){const{selectedJERow:s,jeScheduleDetailId:t,navigate:n}=a;return{onUpdateLocalData:o=>{const c=o.linkJETransaction.qboURL;c!=null&&e(oa({scheduleType:a.scheduleType,jeScheduleDetailId:t,rowId:s,jeLink:c}))},onFetchTransactionClick:o=>{e(wt(o))},onSaveClick:()=>{e(Je(a.scheduleType,t))},onBackClick:()=>{n("..",{relative:"path"})},onCancelClick:()=>{const o=a.jeScheduledTransaction.scheduledJournalEntry[s];e(sa({scheduleType:a.scheduleType,jeScheduleDetailId:t,rowId:s,originalScheduledJE:o})),n("..",{relative:"path"})}}}))(En),gs=()=>{const e=Cn(),a=J(),s=Y(),{scheduleDetailId:t}=N(),n=de(),o=Ss.drawerLeftMargin.valuePx(n),{scheduleType:c}=N(),{useFeatureGate:r}=ae(),{isFeatureEnabled:h}=r(z.isVendorBulkUpdateOnTransactionEnabled),i=Ee(c)??"prepaid_expenses",[p,d]=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 u=S((C=>pe(C,i)));f.useEffect((()=>{u.fetchState==="Not-Started"&&a("..",{relative:"path"})}),[]);const m=u.selectedJELinkRowIndex,g=m!=null?u.scheduleDetailsLocalData[i].jeScheduleDetails[m]?.jeLink:null,D=g?.type==="recommended"?g.recommendedTransactionID:g?.transactionDetailID;f.useEffect((()=>{D!=null&&s(wt(D))}),[]),f.useEffect((()=>{g?.type==="recommended"&&p===!1&&m!=null&&(d(!0),s(ta({scheduleType:i,jeScheduleDetailId:t,rowId:m})))}));const x=S((C=>L(C))),b=S((C=>X(C,x.companyId)));return l.jsx(Un,{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(vs,{onClick:C=>C.stopPropagation(),children:u.fetchState!=="Completed"||u.selectedJEScheduleTransaction==null||m==null?l.jsx(Rt,{fetchState:u.fetchState}):l.jsx(fs,{scheduleType:i,jeScheduleDetailId:t,selectedJERow:m,jeScheduledTransaction:u.selectedJEScheduleTransaction,isCOTEnabled:!1,navigate:a,scheduleTab:i,controllerUserDetails:b,isVendorBulkUpdateOnTransactionEnabled:h})})})},vs=U(Gt)`
26
26
  display: flex;
27
27
  min-height: 100%;
28
28
  flex-direction: column;
29
- `,ve=e=>{switch(e){case"vendors_tab":return"../summary";case"filing_1099":return"../filing_1099";case"prepaid_expenses":return"../schedules/prepaid_expenses";case"fixed_assets":return"../schedules/fixed_assets";case"accrued_expenses":return"../schedules/accrued_expenses";default:return"../opex"}},xe=e=>{switch(e){case"prepaid_expenses":return"prepaid_expenses";case"fixed_assets":return"fixed_assets";case"accrued_expenses":return"accrued_expenses";case"operating_expenses_by_vendor":return"operating_expenses";default:return"vendors_list"}},Te=()=>{const e=K(),a=Y(),s=S((t=>me(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},ne="accrued_expenses",xs=G((function(e,a){const s=L(e),t=me(e);return{tenantName:s.companyName,vendorTabsToShow:a.vendorTabsToShow,report:a.scheduleListReport,downloadParams:a.downloadParams,companyIncorporationDate:a.companyIncDate,vendorTabView:t,isAccountingClassesEnabled:te(e)}}),(function(e,a){const{navigate:s}=a;return{onBackClick:()=>{s("../../..")},onVendorTabSelectionChanged:t=>{const n=ve(t);s(n),e(ie(xe(t)))},onSortOrderChanged:(t,n)=>{e(He({scheduleType:ne,sortKey:t,sortOrder:n}))},onChangeSubTab:t=>{e(qe({scheduleType:ne,subTab:t}))},onSearchTextChanged:t=>{e(Ke({scheduleType:ne,searchText:t}))},onReloadReport:()=>{e(wt(ne))},onScroll:t=>{e(Ye({scheduleType:ne,scrollYOffset:t}))},onClickNewButton:()=>{e(ca()),e(da()),F.trackScheduleAccruedDetailsNewRequested({scheduleType:"accrued_expenses"}),s("details/new")},onClickSchedule:t=>{e(ia({selectedJEScheduleKey:t}));const n=a.scheduleListReport.jeAccruedSchedules.find((o=>o.jeAccruedScheduleKey===t));s(`details/${n?.jeScheduleId}`)},updateDownloadStateHandler:t=>{e(ze({scheduleType:ne,fetchState:t}))}}}))(bn),Ts=({vendorTabsToShow:e,previousTabPosition:a,setPreviousTabPosition:s})=>{const[t,n]=f.useState(!1),[o,c]=f.useState(!1),r=J(),h=Y(),{useFeatureGate:i}=ae(),p=ce();Te();const{isFeatureEnabled:d,isFeatureGateLoading:u}=i(z.isOpexByVendorFeatureEnabled),m=R.getSignedInUser(),g=S((v=>L(v))),D={userId:m?.userId??"",sessionId:m?.zeniSessionId??"",tenantId:g.tenantId},x=f.useMemo((()=>({authParams:D,jeScheduleEndPoint:`${Z}/jeScheduleReports`,timezone:ke(),companyName:g.companyName})),[]),[b,C]=f.useState(!1),E=S((v=>ee(v))),w=S((v=>Ge(v,"accrued_expenses"))),I=e.includes("prepaid_expenses"),k=e.includes("fixed_assets"),_=e.includes("accrued_expenses");f.useEffect((()=>{(I||k||_)&&b===!1&&E!=="Completed"&&(h(ye()),C(!0))}),[b]),f.useEffect((()=>{u===!1&&(h(De({shouldFetchAccruedExpenses:_,shouldFetchFixedAssets:!0,shouldFetchPrepaidExpenses:I,shouldFetchOpexByVendor:d,shouldFetchVendorsList:!1,shouldFetchFiling1099Vendor:!1})),n(!0))}),[E,k,u,d]),f.useEffect((()=>{t===!1&&w==="Completed"&&h(wt("accrued_expenses",{selectedTimeframe:$e("accrued_expenses"),selectedCategoryId:"all"},!0))}),[t,w]);const j=S((v=>la(v,ne))),{isAiCfoAccessEnabled:V,onAskAiCfoClick:A}=fe({mobileExploreReferrer:"Vendors — Accrued Expenses"});Se({isDataReady:j.fetchState==="Completed"});const y=S((v=>H(v).isReportGenerated));S((v=>H(v).fetchState))!=="Completed"||y!==!0||d!==!0||e.includes("operating_expenses_by_vendor")||e.splice(1,0,"operating_expenses_by_vendor"),_||r("../opex");const P=S((v=>X(v,g.companyId))),T=v=>{c(v)};return l.jsxs(l.Fragment,{children:[l.jsx(ge,{isAppContentDrawerOpen:o,handleDrawerToggle:T}),l.jsx(xs,{navigate:r,previousTabPosition:a,setPreviousTabPosition:s,scheduleListReport:j,downloadParams:x,themeState:p,vendorTabsToShow:e,analytics:F,controllerUserDetails:P,isAiCfoAccessEnabled:V,onAskAiCfoClick:A,onClickMenuIcon:()=>T(!0)})]})},se="fixed_assets",ys=G((function(e,a){const s=L(e),t=me(e);return{tenantName:s.companyName,vendorTabsToShow:a.vendorTabsToShow,report:a.scheduleListReport,downloadParams:a.downloadParams,companyIncorporationDate:a.companyIncDate,controllerUserDetails:a.controllerUserDetails,vendorTabView:t,isAccountingClassesEnabled:te(e)}}),(function(e,a){const{navigate:s}=a;return{onBackClick:()=>{s("../../..")},onVendorTabSelectionChanged:t=>{const n=ve(t);s(n),e(ie(xe(t)))},onSortOrderChanged:(t,n)=>{e(He({scheduleType:se,sortKey:t,sortOrder:n}))},onChangeSubTab:t=>{e(qe({scheduleType:se,subTab:t}))},onSearchTextChanged:t=>{e(Ke({scheduleType:se,searchText:t}))},onReloadReport:()=>{e(we(se))},onScroll:t=>{e(Ye({scheduleType:se,scrollYOffset:t}))},onClickSchedule:t=>{e(Ft({selectedJEScheduleKey:t}));const n=a.scheduleListReport.jeScheduledTransactions.find((o=>o.jeScheduleTransactionKey===t));s(n?.jeScheduleId==null?"details/new":`details/${n.jeScheduleId}`)},updateDownloadStateHandler:t=>{e(ze({scheduleType:se,fetchState:t}))}}}))(Ut),Ds=({vendorTabsToShow:e,previousTabPosition:a,setPreviousTabPosition:s})=>{const[t,n]=f.useState(!1),o=J(),c=Y();Te();const{useFeatureGate:r}=ae(),h=ce(),{isFeatureEnabled:i,isFeatureGateLoading:p}=r(z.isOpexByVendorFeatureEnabled),d=R.getSignedInUser(),u=S((v=>L(v))),m={userId:d?.userId??"",sessionId:d?.zeniSessionId??"",tenantId:u.tenantId},g=f.useMemo((()=>({authParams:m,jeScheduleEndPoint:`${Z}/jeScheduleReports`,timezone:ke(),companyName:u.companyName})),[]),[D,x]=f.useState(!1),b=S((v=>ee(v))),C=S((v=>Ge(v,"fixed_assets"))),E=e.includes("prepaid_expenses"),w=e.includes("fixed_assets"),I=e.includes("accrued_expenses");f.useEffect((()=>{(E||w||I)&&D===!1&&b!=="Completed"&&(c(ye()),x(!0))}),[D]),f.useEffect((()=>{p===!1&&(c(De({shouldFetchAccruedExpenses:I,shouldFetchFixedAssets:!0,shouldFetchPrepaidExpenses:E,shouldFetchOpexByVendor:i,shouldFetchVendorsList:!1,shouldFetchFiling1099Vendor:!1})),n(!0))}),[b,w,p,i]),f.useEffect((()=>{t===!1&&C==="Completed"&&c(we("fixed_assets",{selectedTimeframe:$e("fixed_assets"),selectedCategoryId:"all"},!0))}),[t,C]);const k=S((v=>At(v,se))),{isAiCfoAccessEnabled:_,onAskAiCfoClick:j}=fe({mobileExploreReferrer:"Vendors — Fixed Assets"});Se({isDataReady:k.fetchState==="Completed"});const V=S((v=>H(v).isReportGenerated));S((v=>H(v).fetchState))!=="Completed"||V!==!0||i!==!0||e.includes("operating_expenses_by_vendor")||e.splice(1,0,"operating_expenses_by_vendor"),w||o("../opex");const A=S((v=>X(v,u.companyId))),[y,P]=f.useState(!1),T=v=>{P(v)};return l.jsxs(l.Fragment,{children:[l.jsx(ge,{isAppContentDrawerOpen:y,handleDrawerToggle:T}),l.jsx(ys,{navigate:o,scheduleListReport:k,downloadParams:g,previousTabPosition:a,setPreviousTabPosition:s,themeState:h,vendorTabsToShow:e,analytics:F,controllerUserDetails:A,isAiCfoAccessEnabled:_,onAskAiCfoClick:j,onClickMenuIcon:()=>{T(!0)}})]})},Cs=U.div`
29
+ `,ve=e=>{switch(e){case"vendors_tab":return"../summary";case"filing_1099":return"../filing_1099";case"prepaid_expenses":return"../schedules/prepaid_expenses";case"fixed_assets":return"../schedules/fixed_assets";case"accrued_expenses":return"../schedules/accrued_expenses";default:return"../opex"}},xe=e=>{switch(e){case"prepaid_expenses":return"prepaid_expenses";case"fixed_assets":return"fixed_assets";case"accrued_expenses":return"accrued_expenses";case"operating_expenses_by_vendor":return"operating_expenses";default:return"vendors_list"}},Te=()=>{const e=K(),a=Y(),s=S((t=>me(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},ne="accrued_expenses",xs=G((function(e,a){const s=L(e),t=me(e);return{tenantName:s.companyName,vendorTabsToShow:a.vendorTabsToShow,report:a.scheduleListReport,downloadParams:a.downloadParams,companyIncorporationDate:a.companyIncDate,vendorTabView:t,isAccountingClassesEnabled:te(e)}}),(function(e,a){const{navigate:s}=a;return{onBackClick:()=>{s("../../..")},onVendorTabSelectionChanged:t=>{const n=ve(t);s(n),e(ie(xe(t)))},onSortOrderChanged:(t,n)=>{e(He({scheduleType:ne,sortKey:t,sortOrder:n}))},onChangeSubTab:t=>{e(qe({scheduleType:ne,subTab:t}))},onSearchTextChanged:t=>{e(Ke({scheduleType:ne,searchText:t}))},onReloadReport:()=>{e(kt(ne))},onScroll:t=>{e(Ye({scheduleType:ne,scrollYOffset:t}))},onClickNewButton:()=>{e(ca()),e(da()),j.trackScheduleAccruedDetailsNewRequested({scheduleType:"accrued_expenses"}),s("details/new")},onClickSchedule:t=>{e(ia({selectedJEScheduleKey:t}));const n=a.scheduleListReport.jeAccruedSchedules.find((o=>o.jeAccruedScheduleKey===t));s(`details/${n?.jeScheduleId}`)},updateDownloadStateHandler:t=>{e(ze({scheduleType:ne,fetchState:t}))}}}))(bn),Ts=({vendorTabsToShow:e,previousTabPosition:a,setPreviousTabPosition:s})=>{const[t,n]=f.useState(!1),[o,c]=f.useState(!1),r=J(),h=Y(),{useFeatureGate:i}=ae(),p=ce();Te();const{isFeatureEnabled:d,isFeatureGateLoading:u}=i(z.isOpexByVendorFeatureEnabled),m=R.getSignedInUser(),g=S((v=>L(v))),D={userId:m?.userId??"",sessionId:m?.zeniSessionId??"",tenantId:g.tenantId},x=f.useMemo((()=>({authParams:D,jeScheduleEndPoint:`${Z}/jeScheduleReports`,timezone:we(),companyName:g.companyName})),[]),[b,C]=f.useState(!1),E=S((v=>ee(v))),k=S((v=>Ge(v,"accrued_expenses"))),I=e.includes("prepaid_expenses"),w=e.includes("fixed_assets"),_=e.includes("accrued_expenses");f.useEffect((()=>{(I||w||_)&&b===!1&&E!=="Completed"&&(h(ye()),C(!0))}),[b]),f.useEffect((()=>{u===!1&&(h(De({shouldFetchAccruedExpenses:_,shouldFetchFixedAssets:!0,shouldFetchPrepaidExpenses:I,shouldFetchOpexByVendor:d,shouldFetchVendorsList:!1,shouldFetchFiling1099Vendor:!1})),n(!0))}),[E,w,u,d]),f.useEffect((()=>{t===!1&&k==="Completed"&&h(kt("accrued_expenses",{selectedTimeframe:$e("accrued_expenses"),selectedCategoryId:"all"},!0))}),[t,k]);const F=S((v=>la(v,ne))),{isAiCfoAccessEnabled:V,onAskAiCfoClick:A}=fe({mobileExploreReferrer:"Vendors — Accrued Expenses"});Se({isDataReady:F.fetchState==="Completed"});const y=S((v=>H(v).isReportGenerated));S((v=>H(v).fetchState))!=="Completed"||y!==!0||d!==!0||e.includes("operating_expenses_by_vendor")||e.splice(1,0,"operating_expenses_by_vendor"),_||r("../opex");const P=S((v=>X(v,g.companyId))),T=v=>{c(v)};return l.jsxs(l.Fragment,{children:[l.jsx(ge,{isAppContentDrawerOpen:o,handleDrawerToggle:T}),l.jsx(xs,{navigate:r,previousTabPosition:a,setPreviousTabPosition:s,scheduleListReport:F,downloadParams:x,themeState:p,vendorTabsToShow:e,analytics:j,controllerUserDetails:P,isAiCfoAccessEnabled:V,onAskAiCfoClick:A,onClickMenuIcon:()=>T(!0)})]})},se="fixed_assets",ys=G((function(e,a){const s=L(e),t=me(e);return{tenantName:s.companyName,vendorTabsToShow:a.vendorTabsToShow,report:a.scheduleListReport,downloadParams:a.downloadParams,companyIncorporationDate:a.companyIncDate,controllerUserDetails:a.controllerUserDetails,vendorTabView:t,isAccountingClassesEnabled:te(e)}}),(function(e,a){const{navigate:s}=a;return{onBackClick:()=>{s("../../..")},onVendorTabSelectionChanged:t=>{const n=ve(t);s(n),e(ie(xe(t)))},onSortOrderChanged:(t,n)=>{e(He({scheduleType:se,sortKey:t,sortOrder:n}))},onChangeSubTab:t=>{e(qe({scheduleType:se,subTab:t}))},onSearchTextChanged:t=>{e(Ke({scheduleType:se,searchText:t}))},onReloadReport:()=>{e(ke(se))},onScroll:t=>{e(Ye({scheduleType:se,scrollYOffset:t}))},onClickSchedule:t=>{e(jt({selectedJEScheduleKey:t}));const n=a.scheduleListReport.jeScheduledTransactions.find((o=>o.jeScheduleTransactionKey===t));s(n?.jeScheduleId==null?"details/new":`details/${n.jeScheduleId}`)},updateDownloadStateHandler:t=>{e(ze({scheduleType:se,fetchState:t}))}}}))(Ut),Ds=({vendorTabsToShow:e,previousTabPosition:a,setPreviousTabPosition:s})=>{const[t,n]=f.useState(!1),o=J(),c=Y();Te();const{useFeatureGate:r}=ae(),h=ce(),{isFeatureEnabled:i,isFeatureGateLoading:p}=r(z.isOpexByVendorFeatureEnabled),d=R.getSignedInUser(),u=S((v=>L(v))),m={userId:d?.userId??"",sessionId:d?.zeniSessionId??"",tenantId:u.tenantId},g=f.useMemo((()=>({authParams:m,jeScheduleEndPoint:`${Z}/jeScheduleReports`,timezone:we(),companyName:u.companyName})),[]),[D,x]=f.useState(!1),b=S((v=>ee(v))),C=S((v=>Ge(v,"fixed_assets"))),E=e.includes("prepaid_expenses"),k=e.includes("fixed_assets"),I=e.includes("accrued_expenses");f.useEffect((()=>{(E||k||I)&&D===!1&&b!=="Completed"&&(c(ye()),x(!0))}),[D]),f.useEffect((()=>{p===!1&&(c(De({shouldFetchAccruedExpenses:I,shouldFetchFixedAssets:!0,shouldFetchPrepaidExpenses:E,shouldFetchOpexByVendor:i,shouldFetchVendorsList:!1,shouldFetchFiling1099Vendor:!1})),n(!0))}),[b,k,p,i]),f.useEffect((()=>{t===!1&&C==="Completed"&&c(ke("fixed_assets",{selectedTimeframe:$e("fixed_assets"),selectedCategoryId:"all"},!0))}),[t,C]);const w=S((v=>At(v,se))),{isAiCfoAccessEnabled:_,onAskAiCfoClick:F}=fe({mobileExploreReferrer:"Vendors — Fixed Assets"});Se({isDataReady:w.fetchState==="Completed"});const V=S((v=>H(v).isReportGenerated));S((v=>H(v).fetchState))!=="Completed"||V!==!0||i!==!0||e.includes("operating_expenses_by_vendor")||e.splice(1,0,"operating_expenses_by_vendor"),k||o("../opex");const A=S((v=>X(v,u.companyId))),[y,P]=f.useState(!1),T=v=>{P(v)};return l.jsxs(l.Fragment,{children:[l.jsx(ge,{isAppContentDrawerOpen:y,handleDrawerToggle:T}),l.jsx(ys,{navigate:o,scheduleListReport:w,downloadParams:g,previousTabPosition:a,setPreviousTabPosition:s,themeState:h,vendorTabsToShow:e,analytics:j,controllerUserDetails:A,isAiCfoAccessEnabled:_,onAskAiCfoClick:F,onClickMenuIcon:()=>{T(!0)}})]})},Cs=U.div`
30
30
  display: flex;
31
31
  min-height: 100%;
32
32
  width: 100%;
@@ -34,7 +34,7 @@ import{j as l}from"./liveblocks-ufh19lah.js";import{a as f}from"./sentry-Co2H8v0
34
34
  flex-direction: column;
35
35
  align-items: center;
36
36
  background-color: ${e=>e.theme.colors.grey4};
37
- `,Es=G((function(e,a){const s=R.getSignedInUser(),t=e.tenantState.currentTenantId,n=L(e),o=n?.companyName??"",c={userId:s?.userId??"",sessionId:s?.zeniSessionId??"",tenantId:t??""},r=H(e),h=ra(e);return{report:r,uiState:h,isAccountingClassesEnabled:te(e),analytics:F,vendorTabsToShow:a.vendorTabsToShow,downloadParams:{downloadState:h.downloadState,currentTenantCompanyName:o,statementEndPoint:`${Z}/opexByVendor`,authParams:c,timezone:ke()}}}),(function(e,a){const{navigate:s}=a;return{onFetchOpExByVendors:(t,n,o)=>{e(Ta(t,n,o))},onVendorNameAndBalanceClicked:(t,n)=>{if(a.tenantEmailDomain!=null){const o=tt(t.id,t.qboId,a.tenantEmailDomain,n),c=M(a.location.state?.pathnameStackToGoBack,a.location.pathname);a.navigate(o,{state:{pathnameStackToGoBack:c,referrer:"Operating Expenses By Vendor"}})}},onRefresh:()=>{e(xa())},onReloadReport:()=>{e(va(!0))},onBackClick:()=>{s("../../dashboard")},onTimeframeSelectionChanged:t=>{e(ga(t))},onAdditionalBalanceSelectionChanged:(t,n)=>{e(fa({isCompareModeOn:t,additionalBalances:n}))},onSortOrderChanged:(t,n,o)=>{e(Sa({sortkey:n,sortOrder:t,timeframe:o}))},onVendorTabSelectionChanged:t=>{const n=ve(t);s(n),e(ie(xe(t)))},onSortOrSearchStarted:t=>{e(ma(t))},onPageFetchStarted:()=>{e(pa(!0))},updateDownloadStateHandler:t=>{e(ha(t))},onClearSearch:t=>{e(ua({timeframe:t}))}}}))(kn);function bs({vendorTabsToShow:e,previousTabPosition:a,setPreviousTabPosition:s}){const t=J(),n=Y(),o=K(),{tenantEmailDomain:c}=N(),r=de(),h=R.getSignedInUser(),{useFeatureGate:i}=ae(),{isFeatureEnabled:p,isFeatureGateLoading:d}=i(z.isOpexByVendorFeatureEnabled),u=S((A=>H(A)));if(h==null)throw Error("Can't access opex by vendor page without signing in...");Te();const[m,g]=f.useState(!1),D=S((A=>ee(A))),x=e.includes("prepaid_expenses"),b=e.includes("fixed_assets"),C=e.includes("accrued_expenses"),E=S((A=>me(A))),{isAiCfoAccessEnabled:w,onAskAiCfoClick:I}=fe({mobileExploreReferrer:"Vendors — Operating Expenses by Vendor"});Se({isDataReady:u.fetchState==="Completed"&&u.isReportGenerated===!0});const{areTenantIdsInSync:k}=In();f.useEffect((()=>{(x||b||C)&&m===!1&&D!=="Completed"&&k&&(n(ye()),g(!0))}),[m,k]),f.useEffect((()=>{k&&n(De({shouldFetchAccruedExpenses:C,shouldFetchFixedAssets:b,shouldFetchPrepaidExpenses:x,shouldFetchOpexByVendor:p===!0&&d===!1,shouldFetchVendorsList:!1,shouldFetchFiling1099Vendor:!1}))}),[D,b,d,p,k]),u.fetchState!=="Completed"||u.isReportGenerated!==!0||p!==!0||e.includes("operating_expenses_by_vendor")||e.splice(1,0,"operating_expenses_by_vendor"),f.useEffect((()=>{k&&(u.isReportGenerated===!1&&u.fetchState==="Completed"||p===!1&&d===!1)&&t("../summary")}),[k,u.isReportGenerated,u.fetchState,p,d,t]);const[_,j]=f.useState(!1),V=A=>{j(A)};return l.jsxs(Cs,{windowSize:r,children:[u.fetchState==="Completed"?l.jsx(W,{analytics:F,onLoad:A=>{E.previousTab==null?A.trackVendorOperatingExpensesPageLoaded("Side Panel"):A.trackVendorOperatingExpenses(E.currentTab,E.previousTab??null)}}):null,l.jsx(ge,{isAppContentDrawerOpen:_,handleDrawerToggle:V}),l.jsx(Es,{location:o,navigate:t,previousTabPosition:a,setPreviousTabPosition:s,tenantEmailDomain:c,vendorTabsToShow:e,isAiCfoAccessEnabled:w,onAskAiCfoClick:I,onClickMenuIcon:()=>{V(!0)}})]})}const oe="prepaid_expenses",Is=G((function(e,a){const s=L(e),t=me(e);return{tenantName:s.companyName,vendorTabsToShow:a.vendorTabsToShow,report:a.scheduleListReport,downloadParams:a.downloadParams,companyIncorporationDate:a.companyIncDate,controllerUserDetails:a.controllerUserDetails,vendorTabView:t,isAccountingClassesEnabled:te(e)}}),(function(e,a){const{navigate:s}=a;return{onBackClick:()=>{s("../../..")},onVendorTabSelectionChanged:t=>{const n=ve(t);s(n),e(ie(xe(t)))},onSortOrderChanged:(t,n)=>{e(He({scheduleType:oe,sortKey:t,sortOrder:n}))},onChangeSubTab:t=>{e(qe({scheduleType:oe,subTab:t}))},onSearchTextChanged:t=>{e(Ke({scheduleType:oe,searchText:t}))},onReloadReport:()=>{e(we(oe))},onScroll:t=>{e(Ye({scheduleType:oe,scrollYOffset:t}))},onClickSchedule:t=>{e(Ft({selectedJEScheduleKey:t}));const n=a.scheduleListReport.jeScheduledTransactions.find((o=>o.jeScheduleTransactionKey===t));s(n?.jeScheduleId==null?"details/new":`details/${n.jeScheduleId}`)},updateDownloadStateHandler:t=>{e(ze({scheduleType:oe,fetchState:t}))}}}))(Ut),ks=({vendorTabsToShow:e,previousTabPosition:a,setPreviousTabPosition:s})=>{const[t,n]=f.useState(!1),o=J(),c=Y(),{useFeatureGate:r}=ae(),h=ce();Te();const i=R.getSignedInUser(),{isFeatureEnabled:p,isFeatureGateLoading:d}=r(z.isOpexByVendorFeatureEnabled),u=S((v=>L(v))),m=S((v=>Ge(v,"prepaid_expenses"))),g={userId:i?.userId??"",sessionId:i?.zeniSessionId??"",tenantId:u.tenantId},D=f.useMemo((()=>({authParams:g,jeScheduleEndPoint:`${Z}/jeScheduleReports`,timezone:ke(),companyName:u.companyName})),[]),[x,b]=f.useState(!1),C=S((v=>ee(v))),E=e.includes("prepaid_expenses"),w=e.includes("fixed_assets"),I=e.includes("accrued_expenses");f.useEffect((()=>{(E||w||I)&&x===!1&&C!=="Completed"&&(c(ye()),b(!0))}),[x]),f.useEffect((()=>{t===!1&&m==="Completed"&&c(we("prepaid_expenses",{selectedTimeframe:$e("prepaid_expenses"),selectedCategoryId:"all"},!0))}),[t,m]),f.useEffect((()=>{d===!1&&(c(De({shouldFetchAccruedExpenses:I,shouldFetchFixedAssets:w,shouldFetchPrepaidExpenses:!0,shouldFetchOpexByVendor:p,shouldFetchVendorsList:!1,shouldFetchFiling1099Vendor:!1})),n(!0))}),[C,w,d,p]);const k=S((v=>At(v,oe))),{isAiCfoAccessEnabled:_,onAskAiCfoClick:j}=fe({mobileExploreReferrer:"Vendors — Prepaid Expenses"});Se({isDataReady:k.fetchState==="Completed"});const V=S((v=>H(v).isReportGenerated));S((v=>H(v).fetchState))!=="Completed"||V!==!0||p!==!0||e.includes("operating_expenses_by_vendor")||e.splice(1,0,"operating_expenses_by_vendor"),E||o("../opex");const A=S((v=>X(v,u.companyId))),[y,P]=f.useState(!1),T=v=>{P(v)};return l.jsxs(l.Fragment,{children:[l.jsx(ge,{isAppContentDrawerOpen:y,handleDrawerToggle:T}),l.jsx(Is,{navigate:o,previousTabPosition:a,setPreviousTabPosition:s,scheduleListReport:k,downloadParams:D,themeState:h,vendorTabsToShow:e,analytics:F,controllerUserDetails:A,isAiCfoAccessEnabled:_,onAskAiCfoClick:j,onClickMenuIcon:()=>{T(!0)}})]})},ws=U.div`
37
+ `,Es=G((function(e,a){const s=R.getSignedInUser(),t=e.tenantState.currentTenantId,n=L(e),o=n?.companyName??"",c={userId:s?.userId??"",sessionId:s?.zeniSessionId??"",tenantId:t??""},r=H(e),h=ra(e);return{report:r,uiState:h,isAccountingClassesEnabled:te(e),analytics:j,vendorTabsToShow:a.vendorTabsToShow,downloadParams:{downloadState:h.downloadState,currentTenantCompanyName:o,statementEndPoint:`${Z}/opexByVendor`,authParams:c,timezone:we()}}}),(function(e,a){const{navigate:s}=a;return{onFetchOpExByVendors:(t,n,o)=>{e(Ta(t,n,o))},onVendorNameAndBalanceClicked:(t,n)=>{if(a.tenantEmailDomain!=null){const o=tt(t.id,t.qboId,a.tenantEmailDomain,n),c=M(a.location.state?.pathnameStackToGoBack,a.location.pathname);a.navigate(o,{state:{pathnameStackToGoBack:c,referrer:"Operating Expenses By Vendor"}})}},onRefresh:()=>{e(xa())},onReloadReport:()=>{e(va(!0))},onBackClick:()=>{s("../../dashboard")},onTimeframeSelectionChanged:t=>{e(ga(t))},onAdditionalBalanceSelectionChanged:(t,n)=>{e(fa({isCompareModeOn:t,additionalBalances:n}))},onSortOrderChanged:(t,n,o)=>{e(Sa({sortkey:n,sortOrder:t,timeframe:o}))},onVendorTabSelectionChanged:t=>{const n=ve(t);s(n),e(ie(xe(t)))},onSortOrSearchStarted:t=>{e(ma(t))},onPageFetchStarted:()=>{e(pa(!0))},updateDownloadStateHandler:t=>{e(ha(t))},onClearSearch:t=>{e(ua({timeframe:t}))}}}))(wn);function bs({vendorTabsToShow:e,previousTabPosition:a,setPreviousTabPosition:s}){const t=J(),n=Y(),o=K(),{tenantEmailDomain:c}=N(),r=de(),h=R.getSignedInUser(),{useFeatureGate:i}=ae(),{isFeatureEnabled:p,isFeatureGateLoading:d}=i(z.isOpexByVendorFeatureEnabled),u=S((A=>H(A)));if(h==null)throw Error("Can't access opex by vendor page without signing in...");Te();const[m,g]=f.useState(!1),D=S((A=>ee(A))),x=e.includes("prepaid_expenses"),b=e.includes("fixed_assets"),C=e.includes("accrued_expenses"),E=S((A=>me(A))),{isAiCfoAccessEnabled:k,onAskAiCfoClick:I}=fe({mobileExploreReferrer:"Vendors — Operating Expenses by Vendor"});Se({isDataReady:u.fetchState==="Completed"&&u.isReportGenerated===!0});const{areTenantIdsInSync:w}=In();f.useEffect((()=>{(x||b||C)&&m===!1&&D!=="Completed"&&w&&(n(ye()),g(!0))}),[m,w]),f.useEffect((()=>{w&&n(De({shouldFetchAccruedExpenses:C,shouldFetchFixedAssets:b,shouldFetchPrepaidExpenses:x,shouldFetchOpexByVendor:p===!0&&d===!1,shouldFetchVendorsList:!1,shouldFetchFiling1099Vendor:!1}))}),[D,b,d,p,w]),u.fetchState!=="Completed"||u.isReportGenerated!==!0||p!==!0||e.includes("operating_expenses_by_vendor")||e.splice(1,0,"operating_expenses_by_vendor"),f.useEffect((()=>{w&&(u.isReportGenerated===!1&&u.fetchState==="Completed"||p===!1&&d===!1)&&t("../summary")}),[w,u.isReportGenerated,u.fetchState,p,d,t]);const[_,F]=f.useState(!1),V=A=>{F(A)};return l.jsxs(Cs,{windowSize:r,children:[u.fetchState==="Completed"?l.jsx(W,{analytics:j,onLoad:A=>{E.previousTab==null?A.trackVendorOperatingExpensesPageLoaded("Side Panel"):A.trackVendorOperatingExpenses(E.currentTab,E.previousTab??null)}}):null,l.jsx(ge,{isAppContentDrawerOpen:_,handleDrawerToggle:V}),l.jsx(Es,{location:o,navigate:t,previousTabPosition:a,setPreviousTabPosition:s,tenantEmailDomain:c,vendorTabsToShow:e,isAiCfoAccessEnabled:k,onAskAiCfoClick:I,onClickMenuIcon:()=>{V(!0)}})]})}const oe="prepaid_expenses",Is=G((function(e,a){const s=L(e),t=me(e);return{tenantName:s.companyName,vendorTabsToShow:a.vendorTabsToShow,report:a.scheduleListReport,downloadParams:a.downloadParams,companyIncorporationDate:a.companyIncDate,controllerUserDetails:a.controllerUserDetails,vendorTabView:t,isAccountingClassesEnabled:te(e)}}),(function(e,a){const{navigate:s}=a;return{onBackClick:()=>{s("../../..")},onVendorTabSelectionChanged:t=>{const n=ve(t);s(n),e(ie(xe(t)))},onSortOrderChanged:(t,n)=>{e(He({scheduleType:oe,sortKey:t,sortOrder:n}))},onChangeSubTab:t=>{e(qe({scheduleType:oe,subTab:t}))},onSearchTextChanged:t=>{e(Ke({scheduleType:oe,searchText:t}))},onReloadReport:()=>{e(ke(oe))},onScroll:t=>{e(Ye({scheduleType:oe,scrollYOffset:t}))},onClickSchedule:t=>{e(jt({selectedJEScheduleKey:t}));const n=a.scheduleListReport.jeScheduledTransactions.find((o=>o.jeScheduleTransactionKey===t));s(n?.jeScheduleId==null?"details/new":`details/${n.jeScheduleId}`)},updateDownloadStateHandler:t=>{e(ze({scheduleType:oe,fetchState:t}))}}}))(Ut),ws=({vendorTabsToShow:e,previousTabPosition:a,setPreviousTabPosition:s})=>{const[t,n]=f.useState(!1),o=J(),c=Y(),{useFeatureGate:r}=ae(),h=ce();Te();const i=R.getSignedInUser(),{isFeatureEnabled:p,isFeatureGateLoading:d}=r(z.isOpexByVendorFeatureEnabled),u=S((v=>L(v))),m=S((v=>Ge(v,"prepaid_expenses"))),g={userId:i?.userId??"",sessionId:i?.zeniSessionId??"",tenantId:u.tenantId},D=f.useMemo((()=>({authParams:g,jeScheduleEndPoint:`${Z}/jeScheduleReports`,timezone:we(),companyName:u.companyName})),[]),[x,b]=f.useState(!1),C=S((v=>ee(v))),E=e.includes("prepaid_expenses"),k=e.includes("fixed_assets"),I=e.includes("accrued_expenses");f.useEffect((()=>{(E||k||I)&&x===!1&&C!=="Completed"&&(c(ye()),b(!0))}),[x]),f.useEffect((()=>{t===!1&&m==="Completed"&&c(ke("prepaid_expenses",{selectedTimeframe:$e("prepaid_expenses"),selectedCategoryId:"all"},!0))}),[t,m]),f.useEffect((()=>{d===!1&&(c(De({shouldFetchAccruedExpenses:I,shouldFetchFixedAssets:k,shouldFetchPrepaidExpenses:!0,shouldFetchOpexByVendor:p,shouldFetchVendorsList:!1,shouldFetchFiling1099Vendor:!1})),n(!0))}),[C,k,d,p]);const w=S((v=>At(v,oe))),{isAiCfoAccessEnabled:_,onAskAiCfoClick:F}=fe({mobileExploreReferrer:"Vendors — Prepaid Expenses"});Se({isDataReady:w.fetchState==="Completed"});const V=S((v=>H(v).isReportGenerated));S((v=>H(v).fetchState))!=="Completed"||V!==!0||p!==!0||e.includes("operating_expenses_by_vendor")||e.splice(1,0,"operating_expenses_by_vendor"),E||o("../opex");const A=S((v=>X(v,u.companyId))),[y,P]=f.useState(!1),T=v=>{P(v)};return l.jsxs(l.Fragment,{children:[l.jsx(ge,{isAppContentDrawerOpen:y,handleDrawerToggle:T}),l.jsx(Is,{navigate:o,previousTabPosition:a,setPreviousTabPosition:s,scheduleListReport:w,downloadParams:D,themeState:h,vendorTabsToShow:e,analytics:j,controllerUserDetails:A,isAiCfoAccessEnabled:_,onAskAiCfoClick:F,onClickMenuIcon:()=>{T(!0)}})]})},ks=U.div`
38
38
  display: flex;
39
39
  min-height: 100%;
40
40
  width: 100%;
@@ -42,7 +42,7 @@ import{j as l}from"./liveblocks-ufh19lah.js";import{a as f}from"./sentry-Co2H8v0
42
42
  flex-direction: column;
43
43
  align-items: center;
44
44
  background-color: ${e=>e.theme.colors.grey4};
45
- `,As=G((function(e,a){const{isFiling1099FeatureEnabled:s,vendorDetailView:t,selectedVendor:n,firstMonthOfFY:o,currentTenant:c,currentUserRoleMap:r}=a,h=R.getSignedInUser(),i={userId:h?.userId??"",sessionId:h?.zeniSessionId??"",tenantId:c.tenantId??""};return{firstMonthOfFY:o,isFiling1099FeatureEnabled:s,vendorDetailView:t,allTransactions:t?.allVendorTransactionsView,allTransactionsTabData:t?.allTransactionsTabData!=null?{timePeriod:wa(t?.allTransactionsTabData.timePeriod),numberOfQuartersFetched:t?.allTransactionsTabData.numberOfQuartersFetched}:void 0,vendorLogo:n?.logo,readOnlyMode:r?.bookkeeping_user===!0,filesEndPoint:Mt.fileMicroServiceBaseUrl,authParams:i,scrollToTrend:a.isTrendPeriodSelected}}),(function(e,a){const{navigate:s,vendorDetailView:t,vendorId:n,defaultTransactionTimePeriod:o,vendorEntity:c,tenantEmailDomain:r,location:h,firstMonthOfFY:i}=a,p=()=>{const d=We(h.state?.pathnameStackToGoBack),u=d.poppedPathname??((m=2)=>{let g=m;a.isTrendPeriodSelected===!0&&(g=5);let D="../";for(let x=0;x<g;x++)D=`${D}../`;return D})(1);s(u,{state:{pathnameStackToGoBack:d.newStack}})};return{onSaveVendor:()=>{t!=null&&((d,u)=>{const{vendorId:m,vendorName:g,existingCategory:D,existingClass:x,existingOwner:b,selectedCategory:C,selectedClass:E,selectedOwner:w,isRecommendedCategorySelected:I,isRecommendedClassSelected:k,categoryRecommendationTypeSelected:_,classRecommendationTypeSelected:j}=Oa(d,u);m!=null&&F.trackVendorDetailsSave(m,g??"",D,x,b,C,E,w,I,k,_,j)})(t?.vendorViewDetails,t?.vendorViewDetails.ownerList),n!=null&&e(La(n,void 0))},onVendorSpendTrendFilterTabClick:d=>{e(Va(d))},saveVendorDetailLocalData:d=>{n!=null&&e(_a({vendorId:n,localData:d}))},saveContactsInVendorTabDetailLocalData:(d,u)=>{e(Pa({vendorId:d,localData:{contacts:u}}))},onCancelClick:()=>{var d;t?.vendorViewDetails.vendorView?.vendorBasic!=null&&(d=t.vendorViewDetails.vendorView.vendorBasic).id!=null&&F.trackVendorDetailsCancel(d.id??"",d.name,d.account?.accountName,d.class?.className,d.owner?.email),e(ot()),e(lt()),e(it()),e(ct()),p()},handleSpendTrendPercentChangeClick:()=>{var d;t?.vendorViewDetails.vendorView?.vendorBasic!=null&&(d=t.vendorViewDetails.vendorView?.vendorBasic,d.id!=null&&F.trackVendorDetailsSpendTrendHotlinkClicked(d.id??"",d.name,d.account?.accountName,d.class?.className,d.owner?.email))},onSaveSuccess:()=>{n!=null&&e(ja("Not-Started",n)),e(ot()),e(lt()),e(it()),e(ct()),p()},onTrendSelectedPeriodChange:d=>{if(d==null)o!=null&&e(Fe(c,"EntityDetail",{timeframe:"quarter",timePeriod:o}));else{const u=d.currentTimePeriod==null?d.addTimePeriod:{startDate:d.addTimePeriod.startDate,endDate:d.currentTimePeriod.endDate};e(Pe(c,"EntityDetail",{timeframe:d.timeframe,timePeriod:d.addTimePeriod},i)),e(Fe(c,"EntityDetail",{timeframe:d.timeframe,timePeriod:u}))}},onVendorTabSelectionChanged:d=>{e(Fa(d))},onAddressClick:(d,u)=>{if(r==null)return;const m=$n(r,d,u),g=M(h.state?.pathnameStackToGoBack,h.pathname);s(m,{state:{pathnameStackToGoBack:g}})},onVendorDetailUIChange:d=>{e(Aa({collapsableStatus:d}))},onTransactionItemClick:d=>{const u=`${q(d,r)}`,m=M(h.state?.pathnameStackToGoBack,h.pathname);s(u,{state:{pathnameStackToGoBack:m}})},onLoadPreviousTransactionsClick:(d,u)=>{e(jt({timePeriod:je(d),numberOfQuartersFetched:u})),e(Pt(c,je(d),!0,!0))}}}))(An);function ut({referrerType:e,isFiling1099FeatureEnabled:a}){const s=Y(),t=K(),n=J(),o=wn(),[c,r]=f.useState(!1),[h,i]=f.useState(!1),[p,d]=f.useState(!1),u=N(),m=u.vendorId,g=u.qboId,{tenantEmailDomain:D,timeframe:x,startDate:b,endDate:C}=u,E={id:g??"",name:"",type:"vendor",zeniId:m??"",qboId:g??""};f.useEffect((()=>{x!=null&&b!=null&&C!=null?r(!0):(r(!1),p===!1&&(d(!0),s(Fe(E,"EntityDetail"))))}),[x,b,C]);const w=de(),I=S((B=>L(B))),k=S((B=>m!=null?ya(B,m,E):void 0)),_=S((B=>B.vendorState.vendorByID[m??""])),j=S((B=>L(B).company?.companyInfo.firstMonthOfFY??1)),V=S((()=>Da(j,2))),A=je({startDate:V.startDate,endDate:Ca()}),y=Ea(j),P=S((B=>ba(B.trendWithTransactionsState,E,"EntityDetail"))),[T,v]=f.useState(!1),re=c===!1&&p===!1?void 0:P?.selectedPeriod?.timePeriod??y;return f.useEffect((()=>(e==null&&k?.fetchState!=="Not-Started"||m==null||s(Ia(m,E)),()=>{e!=null&&m!=null&&s(ka(m))})),[m,t.state,s]),f.useEffect((()=>{k?.fetchState==="Completed"&&k?.vendorViewDetails.vendorView?.vendorBasic!=null&&((B,ue,Ae)=>{B.id!=null&&F.trackVendorDetails(B.id,B.name,Ae,B.account?.accountName,B.class?.className,B.owner?.email,ue.percentChange,ue.last30DaysSpend,ue.last90DaysSpend,ue.yearToDateSpend)})(k?.vendorViewDetails.vendorView?.vendorBasic,k?.vendorSpend,e),v(!1)}),[k?.fetchState]),f.useEffect((()=>{if(k?.fetchState==="Completed"&&T===!1){re!=null&&c===!1&&(s(Pe(E,"EntityDetail",{timeframe:P?.selectedPeriod?.timeframe??"quarter",timePeriod:re},j)),v(!0));const B=Ce.getLocalizedStrings().dateFormat.analytics;if(c===!0&&x!=null&&b!=null&&C!=null){v(!0);const ue=x,Ae={startDate:st(b,B.YYYYDashMMDashDDFormat),endDate:st(C,B.YYYYDashMMDashDDFormat)};s(Pe(E,"EntityDetail",{timeframe:ue,timePeriod:Ae}))}}}),[k?.fetchState,re,P?.selectedPeriod?.timeframe,c,j]),f.useEffect((()=>{k?.fetchState==="Completed"&&h===!1&&(s(jt({timePeriod:A,numberOfQuartersFetched:3})),s(Pt(E,k.allTransactionsTabData?.timePeriod??A,!1,!0)),i(!0))}),[k?.fetchState,h]),m==null?l.jsx(le,{}):l.jsx(ws,{windowSize:w,children:l.jsx(As,{location:t,navigate:n,isFiling1099FeatureEnabled:a,vendorDetailView:k,vendorId:m,currentTenant:I,selectedVendor:_,firstMonthOfFY:j,isTrendPeriodSelected:c,selectedPeriodTimePeriod:P?.selectedPeriod?.timePeriod,defaultTransactionTimePeriod:y,vendorEntity:E,currentUserRoleMap:o?.loggedInUserRoleMap,tenantEmailDomain:D})})}const Fs=Ce.getLocalizedStrings().spendManagement.billPay.vendorCreation.vendorDetails,js={containerWidth:new Ze(100,58)},Ps=U(jn)`
45
+ `,As=G((function(e,a){const{isFiling1099FeatureEnabled:s,vendorDetailView:t,selectedVendor:n,firstMonthOfFY:o,currentTenant:c,currentUserRoleMap:r}=a,h=R.getSignedInUser(),i={userId:h?.userId??"",sessionId:h?.zeniSessionId??"",tenantId:c.tenantId??""};return{firstMonthOfFY:o,isFiling1099FeatureEnabled:s,vendorDetailView:t,allTransactions:t?.allVendorTransactionsView,allTransactionsTabData:t?.allTransactionsTabData!=null?{timePeriod:ka(t?.allTransactionsTabData.timePeriod),numberOfQuartersFetched:t?.allTransactionsTabData.numberOfQuartersFetched}:void 0,vendorLogo:n?.logo,readOnlyMode:r?.bookkeeping_user===!0,filesEndPoint:Mt.fileMicroServiceBaseUrl,authParams:i,scrollToTrend:a.isTrendPeriodSelected}}),(function(e,a){const{navigate:s,vendorDetailView:t,vendorId:n,defaultTransactionTimePeriod:o,vendorEntity:c,tenantEmailDomain:r,location:h,firstMonthOfFY:i}=a,p=()=>{const d=We(h.state?.pathnameStackToGoBack),u=d.poppedPathname??((m=2)=>{let g=m;a.isTrendPeriodSelected===!0&&(g=5);let D="../";for(let x=0;x<g;x++)D=`${D}../`;return D})(1);s(u,{state:{pathnameStackToGoBack:d.newStack}})};return{onSaveVendor:()=>{t!=null&&((d,u)=>{const{vendorId:m,vendorName:g,existingCategory:D,existingClass:x,existingOwner:b,selectedCategory:C,selectedClass:E,selectedOwner:k,isRecommendedCategorySelected:I,isRecommendedClassSelected:w,categoryRecommendationTypeSelected:_,classRecommendationTypeSelected:F}=Oa(d,u);m!=null&&j.trackVendorDetailsSave(m,g??"",D,x,b,C,E,k,I,w,_,F)})(t?.vendorViewDetails,t?.vendorViewDetails.ownerList),n!=null&&e(La(n,void 0))},onVendorSpendTrendFilterTabClick:d=>{e(Va(d))},saveVendorDetailLocalData:d=>{n!=null&&e(_a({vendorId:n,localData:d}))},saveContactsInVendorTabDetailLocalData:(d,u)=>{e(Pa({vendorId:d,localData:{contacts:u}}))},onCancelClick:()=>{var d;t?.vendorViewDetails.vendorView?.vendorBasic!=null&&(d=t.vendorViewDetails.vendorView.vendorBasic).id!=null&&j.trackVendorDetailsCancel(d.id??"",d.name,d.account?.accountName,d.class?.className,d.owner?.email),e(ot()),e(lt()),e(it()),e(ct()),p()},handleSpendTrendPercentChangeClick:()=>{var d;t?.vendorViewDetails.vendorView?.vendorBasic!=null&&(d=t.vendorViewDetails.vendorView?.vendorBasic,d.id!=null&&j.trackVendorDetailsSpendTrendHotlinkClicked(d.id??"",d.name,d.account?.accountName,d.class?.className,d.owner?.email))},onSaveSuccess:()=>{n!=null&&e(Fa("Not-Started",n)),e(ot()),e(lt()),e(it()),e(ct()),p()},onTrendSelectedPeriodChange:d=>{if(d==null)o!=null&&e(je(c,"EntityDetail",{timeframe:"quarter",timePeriod:o}));else{const u=d.currentTimePeriod==null?d.addTimePeriod:{startDate:d.addTimePeriod.startDate,endDate:d.currentTimePeriod.endDate};e(Pe(c,"EntityDetail",{timeframe:d.timeframe,timePeriod:d.addTimePeriod},i)),e(je(c,"EntityDetail",{timeframe:d.timeframe,timePeriod:u}))}},onVendorTabSelectionChanged:d=>{e(ja(d))},onAddressClick:(d,u)=>{if(r==null)return;const m=$n(r,d,u),g=M(h.state?.pathnameStackToGoBack,h.pathname);s(m,{state:{pathnameStackToGoBack:g}})},onVendorDetailUIChange:d=>{e(Aa({collapsableStatus:d}))},onTransactionItemClick:d=>{const u=`${q(d,r)}`,m=M(h.state?.pathnameStackToGoBack,h.pathname);s(u,{state:{pathnameStackToGoBack:m}})},onLoadPreviousTransactionsClick:(d,u)=>{e(Ft({timePeriod:Fe(d),numberOfQuartersFetched:u})),e(Pt(c,Fe(d),!0,!0))}}}))(An);function ut({referrerType:e,isFiling1099FeatureEnabled:a}){const s=Y(),t=K(),n=J(),o=kn(),[c,r]=f.useState(!1),[h,i]=f.useState(!1),[p,d]=f.useState(!1),u=N(),m=u.vendorId,g=u.qboId,{tenantEmailDomain:D,timeframe:x,startDate:b,endDate:C}=u,E={id:g??"",name:"",type:"vendor",zeniId:m??"",qboId:g??""};f.useEffect((()=>{x!=null&&b!=null&&C!=null?r(!0):(r(!1),p===!1&&(d(!0),s(je(E,"EntityDetail"))))}),[x,b,C]);const k=de(),I=S((B=>L(B))),w=S((B=>m!=null?ya(B,m,E):void 0)),_=S((B=>B.vendorState.vendorByID[m??""])),F=S((B=>L(B).company?.companyInfo.firstMonthOfFY??1)),V=S((()=>Da(F,2))),A=Fe({startDate:V.startDate,endDate:Ca()}),y=Ea(F),P=S((B=>ba(B.trendWithTransactionsState,E,"EntityDetail"))),[T,v]=f.useState(!1),re=c===!1&&p===!1?void 0:P?.selectedPeriod?.timePeriod??y;return f.useEffect((()=>(e==null&&w?.fetchState!=="Not-Started"||m==null||s(Ia(m,E)),()=>{e!=null&&m!=null&&s(wa(m))})),[m,t.state,s]),f.useEffect((()=>{w?.fetchState==="Completed"&&w?.vendorViewDetails.vendorView?.vendorBasic!=null&&((B,ue,Ae)=>{B.id!=null&&j.trackVendorDetails(B.id,B.name,Ae,B.account?.accountName,B.class?.className,B.owner?.email,ue.percentChange,ue.last30DaysSpend,ue.last90DaysSpend,ue.yearToDateSpend)})(w?.vendorViewDetails.vendorView?.vendorBasic,w?.vendorSpend,e),v(!1)}),[w?.fetchState]),f.useEffect((()=>{if(w?.fetchState==="Completed"&&T===!1){re!=null&&c===!1&&(s(Pe(E,"EntityDetail",{timeframe:P?.selectedPeriod?.timeframe??"quarter",timePeriod:re},F)),v(!0));const B=Ce.getLocalizedStrings().dateFormat.analytics;if(c===!0&&x!=null&&b!=null&&C!=null){v(!0);const ue=x,Ae={startDate:st(b,B.YYYYDashMMDashDDFormat),endDate:st(C,B.YYYYDashMMDashDDFormat)};s(Pe(E,"EntityDetail",{timeframe:ue,timePeriod:Ae}))}}}),[w?.fetchState,re,P?.selectedPeriod?.timeframe,c,F]),f.useEffect((()=>{w?.fetchState==="Completed"&&h===!1&&(s(Ft({timePeriod:A,numberOfQuartersFetched:3})),s(Pt(E,w.allTransactionsTabData?.timePeriod??A,!1,!0)),i(!0))}),[w?.fetchState,h]),m==null?l.jsx(le,{}):l.jsx(ks,{windowSize:k,children:l.jsx(As,{location:t,navigate:n,isFiling1099FeatureEnabled:a,vendorDetailView:w,vendorId:m,currentTenant:I,selectedVendor:_,firstMonthOfFY:F,isTrendPeriodSelected:c,selectedPeriodTimePeriod:P?.selectedPeriod?.timePeriod,defaultTransactionTimePeriod:y,vendorEntity:E,currentUserRoleMap:o?.loggedInUserRoleMap,tenantEmailDomain:D})})}const js=Ce.getLocalizedStrings().spendManagement.billPay.vendorCreation.vendorDetails,Fs={containerWidth:new Ze(100,58)},Ps=U(Fn)`
46
46
  width: ${Q.sp4};
47
47
  height: ${Q.sp4};
48
48
  cursor: pointer;
@@ -57,9 +57,9 @@ import{j as l}from"./liveblocks-ufh19lah.js";import{a as f}from"./sentry-Co2H8v0
57
57
  `,Vs=U.div`
58
58
  display: flex;
59
59
  flex-direction: column;
60
- width: ${e=>`${js.containerWidth.value(e.windowSize)}%`};
60
+ width: ${e=>`${Fs.containerWidth.value(e.windowSize)}%`};
61
61
  ${e=>e.windowSize!=="small"?"overflow: auto;":""}
62
- `,Ls=G((function(e,a){const s=R.getSignedInUser(),t=e.tenantState.currentTenantId,n={userId:s?.userId??"",sessionId:s?.zeniSessionId??"",tenantId:t??""},o=e.vendorFiling1099UploadDetailsState,c=e.vendorFiling1099UploadDetailsState;let r={fetchState:"Not-Started",error:void 0};return a.vendorId!=null&&(r=e.vendorViewState.editVendorStateById[a.vendorId]?.fetchStatus),{uploadInvoiceEndPoint:`${Mt.documentAIMicroServiceBaseUrl}`,vendorFiling1099UploadDetailsState:o,vendorFiling1099UploadDetailsViewState:c,uploadStaus:c.w9FormUploadStatus,authParams:n,billId:a.billId,vendorId:a.vendorId,file:a.file,showAutofill:a.showAutofill,type:a.type,analytics:F,entityId:a.billId,fetchVendorFetchStatus:r,vendorLegalName:a.vendorLegalName}}),(function(e,a){const s=a.vendorId;return{onInvoiceUpload:t=>{if((function(n){return n!=null&&"w9_form"in n})(t)&&(e(Ua({w9FormFile:t.files[0]})),t.w9_form[0]!=null)){e(Ma({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(Bt({addressType:"vendor_address",addressToCreate:n}))}},updateInvoiceUploadFetchState:t=>{e(_e({fetchState:t,error:void 0}))},onSkipAutofill:t=>{e(Ra(t))},onVendorFiling1099UploadDetailsSave:t=>{e(Ot(t))},onDeleteClick:()=>{e(_e({fetchState:"Not-Started",error:void 0})),e(Lt({vendorId:s,w9Documents:[]}))}}}))(_n);function ht({appContent:e,showFullScreenSkeletonWhileLoading:a}){const s=Y(),t=J(),{vendorId:n}=N(),o=de(),c=ce(),r=R.getSignedInUser(),[h,i]=f.useState(!1),{useFeatureGate:p}=ae(),{isFeatureEnabled:d}=p(z.isVendorRecommendationFeatureEnabled),u=S((y=>L(y))).companyName,m=new AbortController,g=m.signal;let D,x,b,C,E;if(n==null)throw new Error("Vendor ID not found for Vendor Filing 1099 Details Screen");D=S((y=>_t(y,n))),x=S((y=>y.vendorFiling1099UploadDetailsState.vendor1099DetailsSaveStatus)),b=S((y=>y.vendorViewState.editVendorStateById[n]?.fetchStatus)),E=S((y=>y.vendorFiling1099UploadDetailsState.vendor1099DetailsLocalData.w9Documents?.[0])),C=S((y=>y.vendorFiling1099UploadDetailsState));const w=b?.fetchState==="In-Progress"||C?.w9FormUploadStatus?.fetchState==="In-Progress",I=()=>{c.toggle()};f.useEffect((()=>()=>{m.abort(),s(Vt(n))}),[]),f.useEffect((()=>{h||n!=null&&(i(!0),s(Ba(!1,n,g)))}),[n]);const k=Oe(b?.fetchState),_=Oe(x?.fetchState),j=D.vendor?.contactIds,V=j?.[j.length-1],A=S((y=>y.contactState.contactById[V]));if(f.useEffect((()=>{n!=null&&k==="In-Progress"&&b?.fetchState==="Completed"&&D?.vendor!=null&&(s(Na(n,D.vendor,A)),D?.vendor.filing1099W9Files?.[0]!=null&&s(_e({fetchState:"Completed",error:void 0})))}),[n,D?.vendor]),f.useEffect((()=>{_==="In-Progress"&&x?.fetchState==="Completed"&&t("../../vendors/filing_1099")}),[x?.fetchState]),a===!0&&b?.fetchState!=="Completed"&&b?.fetchState!=="Error")return l.jsx(Us,{children:l.jsx(Fn,{})});if(r==null)throw Error("Can't access VendorFiling1099UploadScreen without signing in...");return l.jsxs(_s,{windowSize:o,children:[o!=="small"?l.jsxs(Bs,{children:[l.jsx(Ps,{onClick:I}),l.jsxs(Os,{showContent:r.userEmailDomain==="zeni.ai",children:[l.jsx(Ns,{showAutofill:!1}),l.jsx(Rs,{showAutofill:!1,children:u})]})]}):null,l.jsx(Ls,{vendorId:n,file:E,showAutofill:!1,type:"w9",isVendorRecommendationEnabled:d,pdfTitle:E?Fs.w9FormTitle:void 0,showTitlebar:!0,showTitlebarIcon:!0,vendorLegalName:D?.vendor?.legalName,isLoading:w}),l.jsx(Vs,{windowSize:o,children:e})]})}const Os=U.div`
62
+ `,Ls=G((function(e,a){const s=R.getSignedInUser(),t=e.tenantState.currentTenantId,n={userId:s?.userId??"",sessionId:s?.zeniSessionId??"",tenantId:t??""},o=e.vendorFiling1099UploadDetailsState,c=e.vendorFiling1099UploadDetailsState;let r={fetchState:"Not-Started",error:void 0};return a.vendorId!=null&&(r=e.vendorViewState.editVendorStateById[a.vendorId]?.fetchStatus),{uploadInvoiceEndPoint:`${Mt.documentAIMicroServiceBaseUrl}`,vendorFiling1099UploadDetailsState:o,vendorFiling1099UploadDetailsViewState:c,uploadStaus:c.w9FormUploadStatus,authParams:n,billId:a.billId,vendorId:a.vendorId,file:a.file,showAutofill:a.showAutofill,type:a.type,analytics:j,entityId:a.billId,fetchVendorFetchStatus:r,vendorLegalName:a.vendorLegalName}}),(function(e,a){const s=a.vendorId;return{onInvoiceUpload:t=>{if((function(n){return n!=null&&"w9_form"in n})(t)&&(e(Ua({w9FormFile:t.files[0]})),t.w9_form[0]!=null)){e(Ma({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(Bt({addressType:"vendor_address",addressToCreate:n}))}},updateInvoiceUploadFetchState:t=>{e(_e({fetchState:t,error:void 0}))},onSkipAutofill:t=>{e(Ra(t))},onVendorFiling1099UploadDetailsSave:t=>{e(Ot(t))},onDeleteClick:()=>{e(_e({fetchState:"Not-Started",error:void 0})),e(Lt({vendorId:s,w9Documents:[]}))}}}))(_n);function ht({appContent:e,showFullScreenSkeletonWhileLoading:a}){const s=Y(),t=J(),{vendorId:n}=N(),o=de(),c=ce(),r=R.getSignedInUser(),[h,i]=f.useState(!1),{useFeatureGate:p}=ae(),{isFeatureEnabled:d}=p(z.isVendorRecommendationFeatureEnabled),u=S((y=>L(y))).companyName,m=new AbortController,g=m.signal;let D,x,b,C,E;if(n==null)throw new Error("Vendor ID not found for Vendor Filing 1099 Details Screen");D=S((y=>_t(y,n))),x=S((y=>y.vendorFiling1099UploadDetailsState.vendor1099DetailsSaveStatus)),b=S((y=>y.vendorViewState.editVendorStateById[n]?.fetchStatus)),E=S((y=>y.vendorFiling1099UploadDetailsState.vendor1099DetailsLocalData.w9Documents?.[0])),C=S((y=>y.vendorFiling1099UploadDetailsState));const k=b?.fetchState==="In-Progress"||C?.w9FormUploadStatus?.fetchState==="In-Progress",I=()=>{c.toggle()};f.useEffect((()=>()=>{m.abort(),s(Vt(n))}),[]),f.useEffect((()=>{h||n!=null&&(i(!0),s(Ba(!1,n,g)))}),[n]);const w=Oe(b?.fetchState),_=Oe(x?.fetchState),F=D.vendor?.contactIds,V=F?.[F.length-1],A=S((y=>y.contactState.contactById[V]));if(f.useEffect((()=>{n!=null&&w==="In-Progress"&&b?.fetchState==="Completed"&&D?.vendor!=null&&(s(Na(n,D.vendor,A)),D?.vendor.filing1099W9Files?.[0]!=null&&s(_e({fetchState:"Completed",error:void 0})))}),[n,D?.vendor]),f.useEffect((()=>{_==="In-Progress"&&x?.fetchState==="Completed"&&t("../../vendors/filing_1099")}),[x?.fetchState]),a===!0&&b?.fetchState!=="Completed"&&b?.fetchState!=="Error")return l.jsx(Us,{children:l.jsx(jn,{})});if(r==null)throw Error("Can't access VendorFiling1099UploadScreen without signing in...");return l.jsxs(_s,{windowSize:o,children:[o!=="small"?l.jsxs(Bs,{children:[l.jsx(Ps,{onClick:I}),l.jsxs(Os,{showContent:r.userEmailDomain==="zeni.ai",children:[l.jsx(Ns,{showAutofill:!1}),l.jsx(Rs,{showAutofill:!1,children:u})]})]}):null,l.jsx(Ls,{vendorId:n,file:E,showAutofill:!1,type:"w9",isVendorRecommendationEnabled:d,pdfTitle:E?js.w9FormTitle:void 0,showTitlebar:!0,showTitlebarIcon:!0,vendorLegalName:D?.vendor?.legalName,isLoading:k}),l.jsx(Vs,{windowSize:o,children:e})]})}const Os=U.div`
63
63
  display: ${e=>e.showContent?"flex":"none"};
64
64
  align-items: center;
65
65
  `,Bs=U.div`
@@ -89,11 +89,11 @@ import{j as l}from"./liveblocks-ufh19lah.js";import{a as f}from"./sentry-Co2H8v0
89
89
  flex-direction: column;
90
90
  align-items: center;
91
91
  background-color: ${e=>e.theme.colors.grey4};
92
- `,$s=G((function(e,a){const{vendorFirstReviewDetails:s}=a,t=e.globalMerchantAutoCompleteState.autoCompleteText,n=R.getSignedInUser(),o=e.tenantState.currentTenantId,c={userId:n?.userId??"",sessionId:n?.zeniSessionId??"",tenantId:o??""},r=L(e);return{vendorFirstReviewView:s,globalMerchantAutoCompleteData:{globalMerchantAutoCompleteView:s.globalMerchantAutoCompleteView,autoCompleteText:t},analytics:F,authParams:c,attachmentEndpoint:r.externalConnections?.accounting[0]?.connectionName==="netsuite"?`${Z}/vendor_attachments_accounting_provider`:`${Z}/vendor_attachments`}}),(function(e,a){const{navigate:s}=a;return{onFetchVendorReviewView:(t,n,o)=>{e(Ve(t,n,o))},onGlobalMerchantAutoCompleteInputChange:(t,n)=>{t.trim().length>=2?e(Xa({searchString:t,globalMerchantType:n??"vendor"})):t.trim().length===0&&e(rt())},onUpdateLocalData:(t,n,o,c)=>{if(n!=null){const r=zs(n);e(Za({vendorId:t,currentSelection:r,selectedGlobalMerchantId:o,vendorRenamedText:c}))}},onResetVendorLocalData:t=>{e(Wa({vendorId:t}))},onVendorNameClick:(t,n)=>{if(a.tenantEmailDomain!=null){const o=tt(t,n,a.tenantEmailDomain),c=M(a.location.state?.pathnameStackToGoBack,a.location.pathname);a.navigate(o,{state:{pathnameStackToGoBack:c}})}},onUpdatePageToken:t=>{e(Qa({pageToken:t}))},onUpdateSortUiState:(t,n)=>{e(Ha({sortOrder:t,sortKey:n}))},onUpdateScrollYOffset:t=>{e(qa({scrollYOffset:t}))},onClickSave:(t,n,o)=>{e(Ka(t,n,o))},onClickCancelPopup:()=>{e(Ya())},onClearGlobalMerchantAutoCompleteResults:()=>{e(rt())},onClickRedirectToQBO:()=>{window.open(`${Xe.qboRedirectionUrl}/vendors`,"_blank")},updateVendorDetailLocalData:t=>{e(Nt({vendorDetails:t})),s(`./vendor/${t.id}`)},onBackClick:()=>{s("../..")},onReloadList:()=>{e(Ve(null))}}}))(Ln);function pt(){const e=J(),a=Y(),s=K(),{tenantEmailDomain:t}=N(),n=de(),o=R.getSignedInUser(),{vendorId:c}=N(),r=S((u=>dt(u))),[h,i]=f.useState(!1),p=S((u=>dt(u).fetchState));if(f.useEffect((()=>{p==="Not-Started"&&h===!1&&(a(Ve(null)),i(!0))}),[]),o==null)throw Error("Can't access first review page without signing in...");const d=u=>u.trackPageLoaded(et.Event.vendorTenantReviewListPage);return l.jsxs(l.Fragment,{children:[p==="Completed"?l.jsx(W,{analytics:F,onLoad:d}):null,l.jsx(W,{analytics:F,onLoad:d}),l.jsx(zn,{isOpen:c!=null,drawerLeftMargin:new Ze(0,0,300,600),onClose:()=>{e("../review")},children:l.jsx(Ys,{onClick:u=>u.stopPropagation(),children:l.jsx(Js,{})})}),l.jsx(Gs,{windowSize:n,children:l.jsx($s,{location:s,navigate:e,vendorFirstReviewDetails:r,tenantEmailDomain:t})})]})}const zs=e=>e.recommendedFirst===!0?"recommendedFirst":e.recommendedSecond===!0?"recommendedSecond":e.retain===!0?"retain":e.rename===!0?"rename":e.customMerchant===!0?"customMerchant":null,Ys=U(Gt)`
92
+ `,$s=G((function(e,a){const{vendorFirstReviewDetails:s}=a,t=e.globalMerchantAutoCompleteState.autoCompleteText,n=R.getSignedInUser(),o=e.tenantState.currentTenantId,c={userId:n?.userId??"",sessionId:n?.zeniSessionId??"",tenantId:o??""},r=L(e);return{vendorFirstReviewView:s,globalMerchantAutoCompleteData:{globalMerchantAutoCompleteView:s.globalMerchantAutoCompleteView,autoCompleteText:t},analytics:j,authParams:c,attachmentEndpoint:r.externalConnections?.accounting[0]?.connectionName==="netsuite"?`${Z}/vendor_attachments_accounting_provider`:`${Z}/vendor_attachments`}}),(function(e,a){const{navigate:s}=a;return{onFetchVendorReviewView:(t,n,o)=>{e(Ve(t,n,o))},onGlobalMerchantAutoCompleteInputChange:(t,n)=>{t.trim().length>=2?e(Xa({searchString:t,globalMerchantType:n??"vendor"})):t.trim().length===0&&e(rt())},onUpdateLocalData:(t,n,o,c)=>{if(n!=null){const r=zs(n);e(Za({vendorId:t,currentSelection:r,selectedGlobalMerchantId:o,vendorRenamedText:c}))}},onResetVendorLocalData:t=>{e(Wa({vendorId:t}))},onVendorNameClick:(t,n)=>{if(a.tenantEmailDomain!=null){const o=tt(t,n,a.tenantEmailDomain),c=M(a.location.state?.pathnameStackToGoBack,a.location.pathname);a.navigate(o,{state:{pathnameStackToGoBack:c}})}},onUpdatePageToken:t=>{e(Qa({pageToken:t}))},onUpdateSortUiState:(t,n)=>{e(Ha({sortOrder:t,sortKey:n}))},onUpdateScrollYOffset:t=>{e(qa({scrollYOffset:t}))},onClickSave:(t,n,o)=>{e(Ka(t,n,o))},onClickCancelPopup:()=>{e(Ya())},onClearGlobalMerchantAutoCompleteResults:()=>{e(rt())},onClickRedirectToQBO:()=>{window.open(`${Xe.qboRedirectionUrl}/vendors`,"_blank")},updateVendorDetailLocalData:t=>{e(Nt({vendorDetails:t})),s(`./vendor/${t.id}`)},onBackClick:()=>{s("../..")},onReloadList:()=>{e(Ve(null))}}}))(Ln);function pt(){const e=J(),a=Y(),s=K(),{tenantEmailDomain:t}=N(),n=de(),o=R.getSignedInUser(),{vendorId:c}=N(),r=S((u=>dt(u))),[h,i]=f.useState(!1),p=S((u=>dt(u).fetchState));if(f.useEffect((()=>{p==="Not-Started"&&h===!1&&(a(Ve(null)),i(!0))}),[]),o==null)throw Error("Can't access first review page without signing in...");const d=u=>u.trackPageLoaded(et.Event.vendorTenantReviewListPage);return l.jsxs(l.Fragment,{children:[p==="Completed"?l.jsx(W,{analytics:j,onLoad:d}):null,l.jsx(W,{analytics:j,onLoad:d}),l.jsx(zn,{isOpen:c!=null,drawerLeftMargin:new Ze(0,0,300,600),onClose:()=>{e("../review")},children:l.jsx(Ys,{onClick:u=>u.stopPropagation(),children:l.jsx(Js,{})})}),l.jsx(Gs,{windowSize:n,children:l.jsx($s,{location:s,navigate:e,vendorFirstReviewDetails:r,tenantEmailDomain:t})})]})}const zs=e=>e.recommendedFirst===!0?"recommendedFirst":e.recommendedSecond===!0?"recommendedSecond":e.retain===!0?"retain":e.rename===!0?"rename":e.customMerchant===!0?"customMerchant":null,Ys=U(Gt)`
93
93
  display: flex;
94
94
  min-height: 100%;
95
95
  flex-direction: column;
96
- `,Ks=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 c={fetchState:"Not-Started",error:void 0};return a.vendorId!=null&&(c=e.vendorViewState.editVendorStateById[a.vendorId]?.fetchStatus),{analytics:F,vendorFiling1099UploadDetailsViewState:n,authParams:o,googleAPIKey:Xe.googleMapsAPIKey,vendorId:a.vendorId,fetchVendorFetchStatus:c,vendor:a.vendorFiling1099UploadDetails?.vendor}}),(function(e,a){const{currentTenant:s,navigate:t,location:n,vendorId:o,vendorFiling1099UploadDetails:c}=a,{tenantEmailDomain:r}=s;return{onVendorFiling1099UploadDetailsSave:h=>{e(Ot(h)),F.trackVendor1099DetailSave(c.vendor.legalName??"")},onSaveChangesToLocalStore:h=>{e(Lt(h))},onResetVendorFiling1099FormStatus:()=>{e(en())},onAddressEditHandler:h=>{const i=Mn((p=>({street:p.vendor1099FilingSectionId.street,suite:p.vendor1099FilingSectionId.suite,city:p.vendor1099FilingSectionId.city,state:p.vendor1099FilingSectionId.state,country:p.vendor1099FilingSectionId.country,countryCode:p.vendor1099FilingSectionId.countryCode,postalCode:p.vendor1099FilingSectionId.postalCode,secondaryInfo:p.vendor1099FilingSectionId.secondaryInfo}))(h));e(Bt({addressType:"vendor_address",addressToCreate:i}))},goBackToListPage:()=>{e(Vt(o));const h=`/${r}/vendors/filing_1099/`,i=M(n.state?.pathnameStackToGoBack,n.pathname);t(h,{state:{pathnameStackToGoBack:i}})},onAddressClick:h=>{const i=(function(d,u,m){let g=`/${d}/vendors/filing_1099/upload/${m}/edit`;return g=g.concat(`/new/${u}`),g})(r,h,o),p=M(n.state?.pathnameStackToGoBack,n.pathname);t(i,{state:{pathnameStackToGoBack:p}})},AddressFormPage:Bn}}))(On);function qs(){const e=J(),a=K(),{vendorId:s}=N(),t=S((r=>L(r)));let n;if(s==null)throw new Error("Vendor ID not found for Vendor Filing 1099 Details Screen");n=S((r=>_t(r,s)));const{tenantEmailDomain:o}=t,c=t.companyId??R.getSignedInUserTenant(o)?.companyId;if(c==null)throw new Error("Company ID not found for Vendor Filing 1099 Details Screen");return l.jsx(Ks,{location:a,navigate:e,currentTenant:t,vendorId:s,vendorFiling1099UploadDetails:n,companyId:c})}const Hs=U.div`
96
+ `,Ks=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 c={fetchState:"Not-Started",error:void 0};return a.vendorId!=null&&(c=e.vendorViewState.editVendorStateById[a.vendorId]?.fetchStatus),{analytics:j,vendorFiling1099UploadDetailsViewState:n,authParams:o,googleAPIKey:Xe.googleMapsAPIKey,vendorId:a.vendorId,fetchVendorFetchStatus:c,vendor:a.vendorFiling1099UploadDetails?.vendor}}),(function(e,a){const{currentTenant:s,navigate:t,location:n,vendorId:o,vendorFiling1099UploadDetails:c}=a,{tenantEmailDomain:r}=s;return{onVendorFiling1099UploadDetailsSave:h=>{e(Ot(h)),j.trackVendor1099DetailSave(c.vendor.legalName??"")},onSaveChangesToLocalStore:h=>{e(Lt(h))},onResetVendorFiling1099FormStatus:()=>{e(en())},onAddressEditHandler:h=>{const i=Mn((p=>({street:p.vendor1099FilingSectionId.street,suite:p.vendor1099FilingSectionId.suite,city:p.vendor1099FilingSectionId.city,state:p.vendor1099FilingSectionId.state,country:p.vendor1099FilingSectionId.country,countryCode:p.vendor1099FilingSectionId.countryCode,postalCode:p.vendor1099FilingSectionId.postalCode,secondaryInfo:p.vendor1099FilingSectionId.secondaryInfo}))(h));e(Bt({addressType:"vendor_address",addressToCreate:i}))},goBackToListPage:()=>{e(Vt(o));const h=`/${r}/vendors/filing_1099/`,i=M(n.state?.pathnameStackToGoBack,n.pathname);t(h,{state:{pathnameStackToGoBack:i}})},onAddressClick:h=>{const i=(function(d,u,m){let g=`/${d}/vendors/filing_1099/upload/${m}/edit`;return g=g.concat(`/new/${u}`),g})(r,h,o),p=M(n.state?.pathnameStackToGoBack,n.pathname);t(i,{state:{pathnameStackToGoBack:p}})},AddressFormPage:Bn}}))(On);function qs(){const e=J(),a=K(),{vendorId:s}=N(),t=S((r=>L(r)));let n;if(s==null)throw new Error("Vendor ID not found for Vendor Filing 1099 Details Screen");n=S((r=>_t(r,s)));const{tenantEmailDomain:o}=t,c=t.companyId??R.getSignedInUserTenant(o)?.companyId;if(c==null)throw new Error("Company ID not found for Vendor Filing 1099 Details Screen");return l.jsx(Ks,{location:a,navigate:e,currentTenant:t,vendorId:s,vendorFiling1099UploadDetails:n,companyId:c})}const Hs=U.div`
97
97
  display: flex;
98
98
  min-height: 100%;
99
99
  width: 100%;
@@ -101,7 +101,7 @@ import{j as l}from"./liveblocks-ufh19lah.js";import{a as f}from"./sentry-Co2H8v0
101
101
  flex-direction: column;
102
102
  align-items: center;
103
103
  background-color: ${e=>e.theme.colors.grey4};
104
- `,Qs=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(dn({sortOrder:n,sortKey:o}))},onUpdateSearchUiState:n=>{e(cn({searchString:n}))},onVendorRowClick:n=>{if(a.tenantEmailDomain!=null){const o=`/${a.tenantEmailDomain}/vendors/filing_1099/upload/${encodeURIComponent(n)}/edit`,c=M(a.location.state?.pathnameStackToGoBack,a.location.pathname);a.navigate(o,{state:{pathnameStackToGoBack:c}})}},onReloadVendors:()=>{e(Le(!0))},onBackClick:()=>{e(on()),e(ln())},onVendorTabSelectionChanged:n=>{const o=ve(n);s(o),e(ie(xe(n)))},onAccountMappingChange:n=>{const{filing1099:o}=n,{bankAccount:c,expenseCategory1099:r}=o,h=Yn(a.accountMappingView.bankAccounts1099FilingAccountList,c.selectedOptions),i=Kn(a.accountMappingView.expenseAccounts1099FilingAccountList,r),p={selectedBankAccounts1099FilingAccountIds:h.map((d=>d.accountId)),selectedExpenseAccounts1099FilingAccountIds:i};e(sn({data:p}))},onSaveClick:()=>{e(nn()),t.track(et.Event.vendor1099TabSettingsSave)}}}))(Nn);function mt({vendorTabsToShow:e,previousTabPosition:a,setPreviousTabPosition:s}){const t=J(),n=Y(),o=K(),{tenantEmailDomain:c}=N(),r=de(),h=R.getSignedInUser(),[i,p]=f.useState(!1),[d,u]=f.useState(!1);if(h==null)throw Error("Can't access vendor filing 1099 page without signing in...");Te();const m=S((I=>tn(I))),g=S((I=>an(I))),{isAiCfoAccessEnabled:D,onAskAiCfoClick:x}=fe({mobileExploreReferrer:"Vendors — 1099"});Se({isDataReady:m.fetchState==="Completed"}),f.useEffect((()=>{d||(u(!0),n(Le(!1)))}),[d,u]),f.useEffect((()=>{g.saveState.fetchState==="Completed"&&n(Le(!1))}),[g.saveState.fetchState]);const b=I=>{p(I)},C=S((I=>L(I))),E={userId:h?.userId??"",sessionId:h?.zeniSessionId??"",tenantId:C.tenantId},w=f.useMemo((()=>({authParams:E,tenantName:C.companyName,filing1099ReportEndPoint:`${Z}/filing1099Reports`})),[]);return l.jsxs(l.Fragment,{children:[m.fetchState==="Completed"?l.jsx(l.Fragment,{children:l.jsx(W,{analytics:F,onLoad:()=>F.trackPageLoaded(et.Event.vendor1099ListPage)})}):null,l.jsxs(Hs,{windowSize:r,children:[l.jsx(ge,{isAppContentDrawerOpen:i,handleDrawerToggle:b}),l.jsx(Qs,{location:o,navigate:t,previousTabPosition:a,setPreviousTabPosition:s,analytics:F,vendorsFiling1099ListDetails:m,vendorTypeList:m.vendorTypeList,accountMappingView:g,downloadParams:w,tenantEmailDomain:c,vendorTabsToShow:e,isAiCfoAccessEnabled:D,onAskAiCfoClick:x,onClickMenuIcon:()=>{b(!0)}})]})]})}const Ws=U.div`
104
+ `,Qs=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(dn({sortOrder:n,sortKey:o}))},onUpdateSearchUiState:n=>{e(cn({searchString:n}))},onVendorRowClick:n=>{if(a.tenantEmailDomain!=null){const o=`/${a.tenantEmailDomain}/vendors/filing_1099/upload/${encodeURIComponent(n)}/edit`,c=M(a.location.state?.pathnameStackToGoBack,a.location.pathname);a.navigate(o,{state:{pathnameStackToGoBack:c}})}},onReloadVendors:()=>{e(Le(!0))},onBackClick:()=>{e(on()),e(ln())},onVendorTabSelectionChanged:n=>{const o=ve(n);s(o),e(ie(xe(n)))},onAccountMappingChange:n=>{const{filing1099:o}=n,{bankAccount:c,expenseCategory1099:r}=o,h=Yn(a.accountMappingView.bankAccounts1099FilingAccountList,c.selectedOptions),i=Kn(a.accountMappingView.expenseAccounts1099FilingAccountList,r),p={selectedBankAccounts1099FilingAccountIds:h.map((d=>d.accountId)),selectedExpenseAccounts1099FilingAccountIds:i};e(sn({data:p}))},onSaveClick:()=>{e(nn()),t.track(et.Event.vendor1099TabSettingsSave)}}}))(Nn);function mt({vendorTabsToShow:e,previousTabPosition:a,setPreviousTabPosition:s}){const t=J(),n=Y(),o=K(),{tenantEmailDomain:c}=N(),r=de(),h=R.getSignedInUser(),[i,p]=f.useState(!1),[d,u]=f.useState(!1);if(h==null)throw Error("Can't access vendor filing 1099 page without signing in...");Te();const m=S((I=>tn(I))),g=S((I=>an(I))),{isAiCfoAccessEnabled:D,onAskAiCfoClick:x}=fe({mobileExploreReferrer:"Vendors — 1099"});Se({isDataReady:m.fetchState==="Completed"}),f.useEffect((()=>{d||(u(!0),n(Le(!1)))}),[d,u]),f.useEffect((()=>{g.saveState.fetchState==="Completed"&&n(Le(!1))}),[g.saveState.fetchState]);const b=I=>{p(I)},C=S((I=>L(I))),E={userId:h?.userId??"",sessionId:h?.zeniSessionId??"",tenantId:C.tenantId},k=f.useMemo((()=>({authParams:E,tenantName:C.companyName,filing1099ReportEndPoint:`${Z}/filing1099Reports`})),[]);return l.jsxs(l.Fragment,{children:[m.fetchState==="Completed"?l.jsx(l.Fragment,{children:l.jsx(W,{analytics:j,onLoad:()=>j.trackPageLoaded(et.Event.vendor1099ListPage)})}):null,l.jsxs(Hs,{windowSize:r,children:[l.jsx(ge,{isAppContentDrawerOpen:i,handleDrawerToggle:b}),l.jsx(Qs,{location:o,navigate:t,previousTabPosition:a,setPreviousTabPosition:s,analytics:j,vendorsFiling1099ListDetails:m,vendorTypeList:m.vendorTypeList,accountMappingView:g,downloadParams:k,tenantEmailDomain:c,vendorTabsToShow:e,isAiCfoAccessEnabled:D,onAskAiCfoClick:x,onClickMenuIcon:()=>{b(!0)}})]})]})}const Ws=U.div`
105
105
  display: flex;
106
106
  min-height: 100%;
107
107
  width: 100%;
@@ -109,4 +109,4 @@ import{j as l}from"./liveblocks-ufh19lah.js";import{a as f}from"./sentry-Co2H8v0
109
109
  flex-direction: column;
110
110
  align-items: center;
111
111
  background-color: ${e=>e.theme.colors.grey4};
112
- `,Zs=G((function(e,a){const{vendorsListDetails:s}=a;return{vendorsList:s.vendors,totalVendorCount:s.totalVendorCount,fetchState:s.fetchState,uiState:s.uiState,searchText:s.searchString,lastRefreshSuccessTime:s.lastRefreshSuccessTime,vendorTabsToShow:a.vendorTabsToShow,isAccountingClassesEnabled:te(e),analytics:F}}),(function(e,a){const{navigate:s}=a;return{onFetchVendorsList:(t="",n,o)=>{e(Sn({searchString:t,keepExistingListItems:n,view:"vendorsTab",pageToken:o}))},onUpdatePageToken:t=>{e(mn({pageToken:t}))},onUpdateSortUiState:(t,n)=>{e(pn({sortOrder:t,sortkey:n}))},onUpdateCurrentYTDSelection:t=>{e(hn({ytdSpendSelection:t}))},onVendorRowClick:(t,n)=>{if(a.tenantEmailDomain!=null){const o=tt(t,n,a.tenantEmailDomain),c=M(a.location.state?.pathnameStackToGoBack,a.location.pathname);a.navigate(o,{state:{pathnameStackToGoBack:c,referrer:"Vendor List"}})}},onReloadVendors:()=>{console.log("Reload vendors")},onUpdateScrollYOffset:t=>{e(un({scrollYOffset:t}))},onBackClick:()=>{s("../..")},onVendorTabSelectionChanged:t=>{const n=ve(t);s(n),e(ie(xe(t)))}}}))(Rn);function Xs({vendorTabsToShow:e,previousTabPosition:a,setPreviousTabPosition:s}){const t=J(),n=Y(),o=K(),{tenantEmailDomain:c}=N(),r=de(),h=R.getSignedInUser(),{useFeatureGate:i}=ae(),{isFeatureEnabled:p,isFeatureGateLoading:d}=i(z.isOpexByVendorFeatureEnabled);Te();const u=e.includes("prepaid_expenses"),m=e.includes("fixed_assets"),g=e.includes("accrued_expenses"),D=S((P=>me(P)));let x={};x=S((P=>rn(P,"vendorsTab")));const[b,C]=f.useState(!1),{isAiCfoAccessEnabled:E,onAskAiCfoClick:w}=fe({mobileExploreReferrer:"Vendors Summary"});Se({isDataReady:x.fetchState==="Completed"});const I=S((P=>ee(P))),k=S((P=>H(P).isReportGenerated));S((P=>H(P).fetchState))==="Completed"&&k&&p&&!e.includes("operating_expenses_by_vendor")&&e.splice(1,0,"operating_expenses_by_vendor");const[_,j]=f.useState(!1);if(f.useEffect((()=>{(u||m)&&_===!1&&I!=="Completed"&&(n(ye()),j(!0))}),[_]),f.useEffect((()=>{n(De({shouldFetchAccruedExpenses:g,shouldFetchFixedAssets:m,shouldFetchPrepaidExpenses:u,shouldFetchOpexByVendor:p&&d===!1,shouldFetchVendorsList:!0,shouldFetchFiling1099Vendor:!1}))}),[I,m,d,p]),f.useEffect((()=>{b||x.fetchState!=="Completed"||(C(!0),F.trackVendorList(D.currentTab,D.previousTab??null,x.totalVendorCount,x.uiState.sortKey,x.uiState.ytdSpendSelection))}),[x.fetchState]),h==null)throw Error("Can't access address page without signing in...");const[V,A]=f.useState(!1),y=P=>{A(P)};return l.jsxs(Ws,{windowSize:r,children:[l.jsx(ge,{isAppContentDrawerOpen:V,handleDrawerToggle:y}),l.jsx(Zs,{location:o,navigate:t,vendorsListDetails:x,tenantEmailDomain:c,vendorTabsToShow:e,onClickMenuIcon:()=>{y(!0)},previousTabPosition:a,setPreviousTabPosition:s,isAiCfoAccessEnabled:E,onAskAiCfoClick:w})]})}function bo(){const{useFeatureGate:e}=ae(),a=K().state?.referrer,[s,t]=f.useState(!1),[n,o]=f.useState(0),c=R.getSignedInUser(),r=fn(c),{isFeatureEnabled:h}=e(z.isOpexByVendorFeatureEnabled),{isFeatureEnabled:i}=e(z.isVendorReviewFeatureEnabled),{isFeatureEnabled:p}=e(z.isScheduledJEPrepaidExpensesFeatureEnabled),{isFeatureEnabled:d}=e(z.isScheduledJEFixedAssetsFeatureEnabled),{isFeatureEnabled:u}=e(z.isScheduledJEAccruedExpensesFeatureEnabled),{isFeatureEnabled:m}=e(z.isFiling1099FeatureEnabled),g=S((w=>L(w))),D=g?.externalConnections?.accounting[0]?.connectionName,x=["vendors_tab"];D!=="netsuite"&&p===!0&&x.push("prepaid_expenses"),D!=="netsuite"&&d===!0&&x.push("fixed_assets"),D!=="netsuite"&&u===!0&&x.push("accrued_expenses"),D!=="netsuite"&&m&&r&&(x.push("filing_1099"),h&&x.splice(1,0,"operating_expenses_by_vendor"));const{isFeatureEnabled:b}=e(z.isDebitCardFeatureEnabled),C=gn(b,g),E=vn(g);return C===!0||E===!0?l.jsx(at,{children:l.jsx(O,{path:"/*",element:l.jsx(Gn,{})})}):l.jsxs(at,{children:[l.jsx(O,{path:"/opex",element:h===!0?l.jsx(bs,{previousTabPosition:n,setPreviousTabPosition:o,vendorTabsToShow:x}):l.jsx($,{to:"../summary"})}),l.jsx(O,{path:"/summary",element:l.jsx(Xs,{previousTabPosition:n,setPreviousTabPosition:o,vendorTabsToShow:x})}),l.jsx(O,{path:"schedules/fixed_assets/details/:scheduleDetailId",element:d===!0?l.jsx(os,{}):l.jsx($,{to:"../../vendors/opex"})}),l.jsx(O,{path:"schedules/accrued_expenses/details/:scheduleDetailId",element:d===!0?l.jsx(es,{shouldNavigateBack:s,setShouldNavigateBack:t}):l.jsx($,{to:"../../vendors/opex"})}),l.jsx(O,{path:"schedules/:scheduleType/details/:scheduleDetailId",element:p===!0?l.jsx(us,{}):l.jsx($,{to:"../../vendors/opex"})}),l.jsx(O,{path:"schedules/:scheduleType/details/:scheduleDetailId/edit_link",element:p===!0||d===!0?l.jsx(gs,{}):l.jsx($,{to:"../../vendors/opex"})}),l.jsx(O,{path:"schedules/accrued_expenses/details/:scheduleDetailId/edit_link",element:u===!0?l.jsx(Qn,{setShouldNavigateBack:t}):l.jsx($,{to:"../../vendors/opex"})}),l.jsx(O,{path:"schedules/prepaid_expenses",element:p===!0?l.jsx(ks,{previousTabPosition:n,setPreviousTabPosition:o,vendorTabsToShow:x}):l.jsx($,{to:"../opex"})}),l.jsx(O,{path:"schedules/fixed_assets",element:d===!0?l.jsx(Ds,{previousTabPosition:n,setPreviousTabPosition:o,vendorTabsToShow:x}):l.jsx($,{to:"../opex"})}),l.jsx(O,{path:"schedules/accrued_expenses",element:u===!0?l.jsx(Ts,{previousTabPosition:n,setPreviousTabPosition:o,vendorTabsToShow:x}):l.jsx($,{to:"../opex"})}),l.jsx(O,{path:"/filing_1099",element:m&&r?l.jsx(mt,{previousTabPosition:n,setPreviousTabPosition:o,vendorTabsToShow:x}):l.jsx($,{to:"../opex"})}),l.jsx(O,{path:"/filing_1099/:vendorId",element:m&&r?l.jsx(mt,{vendorTabsToShow:x,previousTabPosition:n,setPreviousTabPosition:o}):l.jsx($,{to:"../opex"})}),l.jsx(O,{path:"/filing_1099/upload/:vendorId/edit",element:m&&r?l.jsx(ht,{appContent:l.jsx(qs,{}),showFullScreenSkeletonWhileLoading:!0}):l.jsx($,{to:"../opex"})}),l.jsx(O,{path:"/filing_1099/upload/:vendorId/edit/new/:addressType",element:m&&r?l.jsx(ht,{appContent:l.jsx(Jn,{isSubPage:!0,hideAddressBackButton:!0,hideAddressSubTitle:!0})}):l.jsx($,{to:"../opex"})}),l.jsx(O,{path:"/summary/:vendorId/:qboId",element:l.jsx(ut,{referrerType:a,isFiling1099FeatureEnabled:m&&r})}),l.jsx(O,{path:"/summary/:vendorId/:qboId/:timeframe/:startDate/:endDate",element:l.jsx(ut,{referrerType:a,isFiling1099FeatureEnabled:m&&r})}),l.jsx(O,{path:"/review",element:i===!0?l.jsx(pt,{}):l.jsx(le,{})}),l.jsx(O,{path:"/review/vendor/:vendorId",element:i?l.jsx(pt,{}):l.jsx(le,{})}),l.jsx(O,{path:"/",element:l.jsx($,{to:"summary"})}),l.jsx(O,{path:"*",element:l.jsx(le,{})})]})}export{bo as default};
112
+ `,Zs=G((function(e,a){const{vendorsListDetails:s}=a;return{vendorsList:s.vendors,totalVendorCount:s.totalVendorCount,fetchState:s.fetchState,uiState:s.uiState,searchText:s.searchString,lastRefreshSuccessTime:s.lastRefreshSuccessTime,vendorTabsToShow:a.vendorTabsToShow,isAccountingClassesEnabled:te(e),analytics:j}}),(function(e,a){const{navigate:s}=a;return{onFetchVendorsList:(t="",n,o)=>{e(Sn({searchString:t,keepExistingListItems:n,view:"vendorsTab",pageToken:o}))},onUpdatePageToken:t=>{e(mn({pageToken:t}))},onUpdateSortUiState:(t,n)=>{e(pn({sortOrder:t,sortkey:n}))},onUpdateCurrentYTDSelection:t=>{e(hn({ytdSpendSelection:t}))},onVendorRowClick:(t,n)=>{if(a.tenantEmailDomain!=null){const o=tt(t,n,a.tenantEmailDomain),c=M(a.location.state?.pathnameStackToGoBack,a.location.pathname);a.navigate(o,{state:{pathnameStackToGoBack:c,referrer:"Vendor List"}})}},onReloadVendors:()=>{console.log("Reload vendors")},onUpdateScrollYOffset:t=>{e(un({scrollYOffset:t}))},onBackClick:()=>{s("../..")},onVendorTabSelectionChanged:t=>{const n=ve(t);s(n),e(ie(xe(t)))}}}))(Rn);function Xs({vendorTabsToShow:e,previousTabPosition:a,setPreviousTabPosition:s}){const t=J(),n=Y(),o=K(),{tenantEmailDomain:c}=N(),r=de(),h=R.getSignedInUser(),{useFeatureGate:i}=ae(),{isFeatureEnabled:p,isFeatureGateLoading:d}=i(z.isOpexByVendorFeatureEnabled);Te();const u=e.includes("prepaid_expenses"),m=e.includes("fixed_assets"),g=e.includes("accrued_expenses"),D=S((P=>me(P)));let x={};x=S((P=>rn(P,"vendorsTab")));const[b,C]=f.useState(!1),{isAiCfoAccessEnabled:E,onAskAiCfoClick:k}=fe({mobileExploreReferrer:"Vendors Summary"});Se({isDataReady:x.fetchState==="Completed"});const I=S((P=>ee(P))),w=S((P=>H(P).isReportGenerated));S((P=>H(P).fetchState))==="Completed"&&w&&p&&!e.includes("operating_expenses_by_vendor")&&e.splice(1,0,"operating_expenses_by_vendor");const[_,F]=f.useState(!1);if(f.useEffect((()=>{(u||m)&&_===!1&&I!=="Completed"&&(n(ye()),F(!0))}),[_]),f.useEffect((()=>{n(De({shouldFetchAccruedExpenses:g,shouldFetchFixedAssets:m,shouldFetchPrepaidExpenses:u,shouldFetchOpexByVendor:p&&d===!1,shouldFetchVendorsList:!0,shouldFetchFiling1099Vendor:!1}))}),[I,m,d,p]),f.useEffect((()=>{b||x.fetchState!=="Completed"||(C(!0),j.trackVendorList(D.currentTab,D.previousTab??null,x.totalVendorCount,x.uiState.sortKey,x.uiState.ytdSpendSelection))}),[x.fetchState]),h==null)throw Error("Can't access address page without signing in...");const[V,A]=f.useState(!1),y=P=>{A(P)};return l.jsxs(Ws,{windowSize:r,children:[l.jsx(ge,{isAppContentDrawerOpen:V,handleDrawerToggle:y}),l.jsx(Zs,{location:o,navigate:t,vendorsListDetails:x,tenantEmailDomain:c,vendorTabsToShow:e,onClickMenuIcon:()=>{y(!0)},previousTabPosition:a,setPreviousTabPosition:s,isAiCfoAccessEnabled:E,onAskAiCfoClick:k})]})}function bo(){const{useFeatureGate:e}=ae(),a=K().state?.referrer,[s,t]=f.useState(!1),[n,o]=f.useState(0),c=R.getSignedInUser(),r=fn(c),{isFeatureEnabled:h}=e(z.isOpexByVendorFeatureEnabled),{isFeatureEnabled:i}=e(z.isVendorReviewFeatureEnabled),{isFeatureEnabled:p}=e(z.isScheduledJEPrepaidExpensesFeatureEnabled),{isFeatureEnabled:d}=e(z.isScheduledJEFixedAssetsFeatureEnabled),{isFeatureEnabled:u}=e(z.isScheduledJEAccruedExpensesFeatureEnabled),{isFeatureEnabled:m}=e(z.isFiling1099FeatureEnabled),g=S((k=>L(k))),D=g?.externalConnections?.accounting[0]?.connectionName,x=["vendors_tab"];D!=="netsuite"&&p===!0&&x.push("prepaid_expenses"),D!=="netsuite"&&d===!0&&x.push("fixed_assets"),D!=="netsuite"&&u===!0&&x.push("accrued_expenses"),D!=="netsuite"&&m&&r&&(x.push("filing_1099"),h&&x.splice(1,0,"operating_expenses_by_vendor"));const{isFeatureEnabled:b}=e(z.isDebitCardFeatureEnabled),C=gn(b,g),E=vn(g);return C===!0||E===!0?l.jsx(at,{children:l.jsx(O,{path:"/*",element:l.jsx(Gn,{})})}):l.jsxs(at,{children:[l.jsx(O,{path:"/opex",element:h===!0?l.jsx(bs,{previousTabPosition:n,setPreviousTabPosition:o,vendorTabsToShow:x}):l.jsx($,{to:"../summary"})}),l.jsx(O,{path:"/summary",element:l.jsx(Xs,{previousTabPosition:n,setPreviousTabPosition:o,vendorTabsToShow:x})}),l.jsx(O,{path:"schedules/fixed_assets/details/:scheduleDetailId",element:d===!0?l.jsx(os,{}):l.jsx($,{to:"../../vendors/opex"})}),l.jsx(O,{path:"schedules/accrued_expenses/details/:scheduleDetailId",element:d===!0?l.jsx(es,{shouldNavigateBack:s,setShouldNavigateBack:t}):l.jsx($,{to:"../../vendors/opex"})}),l.jsx(O,{path:"schedules/:scheduleType/details/:scheduleDetailId",element:p===!0?l.jsx(us,{}):l.jsx($,{to:"../../vendors/opex"})}),l.jsx(O,{path:"schedules/:scheduleType/details/:scheduleDetailId/edit_link",element:p===!0||d===!0?l.jsx(gs,{}):l.jsx($,{to:"../../vendors/opex"})}),l.jsx(O,{path:"schedules/accrued_expenses/details/:scheduleDetailId/edit_link",element:u===!0?l.jsx(Qn,{setShouldNavigateBack:t}):l.jsx($,{to:"../../vendors/opex"})}),l.jsx(O,{path:"schedules/prepaid_expenses",element:p===!0?l.jsx(ws,{previousTabPosition:n,setPreviousTabPosition:o,vendorTabsToShow:x}):l.jsx($,{to:"../opex"})}),l.jsx(O,{path:"schedules/fixed_assets",element:d===!0?l.jsx(Ds,{previousTabPosition:n,setPreviousTabPosition:o,vendorTabsToShow:x}):l.jsx($,{to:"../opex"})}),l.jsx(O,{path:"schedules/accrued_expenses",element:u===!0?l.jsx(Ts,{previousTabPosition:n,setPreviousTabPosition:o,vendorTabsToShow:x}):l.jsx($,{to:"../opex"})}),l.jsx(O,{path:"/filing_1099",element:m&&r?l.jsx(mt,{previousTabPosition:n,setPreviousTabPosition:o,vendorTabsToShow:x}):l.jsx($,{to:"../opex"})}),l.jsx(O,{path:"/filing_1099/:vendorId",element:m&&r?l.jsx(mt,{vendorTabsToShow:x,previousTabPosition:n,setPreviousTabPosition:o}):l.jsx($,{to:"../opex"})}),l.jsx(O,{path:"/filing_1099/upload/:vendorId/edit",element:m&&r?l.jsx(ht,{appContent:l.jsx(qs,{}),showFullScreenSkeletonWhileLoading:!0}):l.jsx($,{to:"../opex"})}),l.jsx(O,{path:"/filing_1099/upload/:vendorId/edit/new/:addressType",element:m&&r?l.jsx(ht,{appContent:l.jsx(Jn,{isSubPage:!0,hideAddressBackButton:!0,hideAddressSubTitle:!0})}):l.jsx($,{to:"../opex"})}),l.jsx(O,{path:"/summary/:vendorId/:qboId",element:l.jsx(ut,{referrerType:a,isFiling1099FeatureEnabled:m&&r})}),l.jsx(O,{path:"/summary/:vendorId/:qboId/:timeframe/:startDate/:endDate",element:l.jsx(ut,{referrerType:a,isFiling1099FeatureEnabled:m&&r})}),l.jsx(O,{path:"/review",element:i===!0?l.jsx(pt,{}):l.jsx(le,{})}),l.jsx(O,{path:"/review/vendor/:vendorId",element:i?l.jsx(pt,{}):l.jsx(le,{})}),l.jsx(O,{path:"/",element:l.jsx($,{to:"summary"})}),l.jsx(O,{path:"*",element:l.jsx(le,{})})]})}export{bo as default};
@@ -0,0 +1,12 @@
1
+ import{j as o}from"./liveblocks-0jcT8Dx_.js";import{a as f}from"./sentry-Cix5j_Oe.js";import{t as u,u as h,j as y,N as I}from"./core-DrRun-Wp.js";import{MC as b,fC as w,BF as j}from"./zeni-epic-state-D1OApLJ3.js";import{z as l,C as x,K as S,M as C}from"./index-24dzDu8E.js";import{n as c}from"./mui-BCzMCgwZ.js";import"./recharts-BJColP3b.js";import"./analytics-CO5gayAE.js";import"./plaid-B0k6aBM1.js";import"./dnd-C7lg2kUY.js";import"./stripe-cKAAJElX.js";import"./lottie-C4eBAM7n.js";import"./lexical-Cceo9d8G.js";import"./pdf-C1ioMmzA.js";import"./utils-CvfvTDv6.js";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="0e2c210f-92cb-4080-a800-e596d9ca52d0",e._sentryDebugIdIdentifier="sentry-dbid-0e2c210f-92cb-4080-a800-e596d9ca52d0")}catch{}})();const W=()=>{const[e]=u(),t=e.get("code")??"",s=e.get("state")??"",p=e.get("profileId")??"",[n,g]=f.useState(!1),a=h(),i=y((m=>b(m))),r=l.getSignedInUser(),d=l.getSignedInUserTenantWithId(s);if(r==null||d==null)return o.jsx(I,{to:"/signin/auth",replace:!0});if(r==null)throw Error("Can't access this page without signing in...");return w(r.userId,r.zeniSessionId,d?.tenantId),f.useEffect((()=>{n||(g(!0),a(j(t,p,s)))}),[n,a]),i.fetchState==="Error"?o.jsx(D,{children:o.jsx(E,{children:i.error?.message??""})}):(i.fetchState==="Completed"&&window.close(),o.jsx(x,{fetchState:"In-Progress"}))},D=c.div`
2
+ display: flex;
3
+ width: 100%;
4
+ height: 100vh;
5
+ flex-direction: row;
6
+ justify-content: center;
7
+ align-items: center;
8
+ background-color: ${e=>e.theme.colors.grey5};
9
+ `,E=c(C.LargeRegular)`
10
+ display: flex;
11
+ color: ${S.important};
12
+ `;export{W as default};
@@ -1,4 +1,4 @@
1
- import{j as e}from"./liveblocks-ufh19lah.js";import{u as U,h as Z,i as G,j as A,N as Q,n as W,g as K,o as $e,p as f}from"./core-QBDM2m9E.js";import{Ry as He,Rz as Un,BK as Mn,RA as zn,RB as $n,bH as Hn,RC as Ve,DN as Ne,RD as Ze,eZ as M,yN as Ge,PE as We,cq as te,cr as Ye,yH as Vn,RE as Nn,RF as Zn,yK as Gn,yR as ye,yE as Wn,yB as Yn,RG as Qe,BQ as Qn,Qn as de,RH as qn,Hr as Kn,Nv as Jn,Ht as Xn,ln as Re,RI as ea,rY as qe,rM as Ke,le as Je,lh as Be,Nw as Fe,Nx as na,RJ as aa,lg as ta,lD as oa,l5 as sa,jE as ra,jD as ia,RK as ca,RL as xe,H8 as la,RM as da,RN as ua,Qg as we,RO as Oe,RP as pa,HE as ma,QY as fa,ES as Xe,uw as en,RQ as ha,HB as ga,RR as nn,cS as Ae,BR as an,fY as ya,fE as tn,fG as De,HG as xa,EM as Ca,Hy as wa,RS as on,RT as sn,Ha as rn,Hk as Le,RU as Aa,QP as Da,HI as ka,bs as Sa,bJ as Ia,cC as ba,bK as ja,bt as Ea,Mj as va}from"./zeni-epic-state-BF09v22i.js";import{J as z,c4 as Pa,e as oe,A as N,c as F,z as S,a4 as ke,c5 as Ta,y as $,E as ue,c6 as Ra,H as J,r as cn,ar as Ba,ag as _e,f as _,c7 as Fa,au as Se,c8 as Oa,F as pe,c9 as La,h as Ie,aS as q,ca as _a,_ as Ua,a0 as ln,ad as Ma,cb as Ue,cc as za,v as le,cd as $a,ce as Ha,cf as Va,i as Na,o as Za}from"./index-BTTC92ci.js";import{n as O,D as X,S as ee}from"./mui-CB8RW45Z.js";import{a as p}from"./sentry-Co2H8v0G.js";import{u as dn}from"./useCashManagementBanner-D33gFRsv.js";import V from"./NotFoundScreen-CIe1EEoJ.js";import{S as Me}from"./SetupPagesScreen-BA7qIYz5.js";import{F as un}from"./FeaturePreviewScreen-C9BLvwka.js";import{M as me}from"./MobileAppDrawer-CWymkkwv.js";import{A as Ga,D as Wa,V as Ya}from"./DomesticWireDetailScreen-D-A33-aQ.js";import{A as Qa}from"./AddressScreen-Bn9eD_vN.js";import{u as pn}from"./useAskAiCfoHostNavButtonProps-CPVGdgCK.js";import{Z as qa}from"./ZeniAccountStatementScreen-Cm4JCiss.js";import"./recharts-B8SFxg38.js";import"./analytics-C3yKGO2p.js";import"./plaid-DAwCYgVP.js";import"./dnd-DTpdpLY3.js";import"./stripe-cKAAJElX.js";import"./lottie-Ceg93JYe.js";import"./lexical-DBGXZJbY.js";import"./pdf-DdbTijar.js";import"./utils-CWM6Tene.js";import"./analyticsHelper-BveTv6Ie.js";import"./routePaths-DRm-ixUG.js";import"./BusinessVerificationPageScreen-BGwTSYvf.js";(function(){try{var n=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},a=new n.Error().stack;a&&(n._sentryDebugIds=n._sentryDebugIds||{},n._sentryDebugIds[a]="29de0b6a-461a-42a4-8ed1-11739e42765b",n._sentryDebugIdIdentifier="sentry-dbid-29de0b6a-461a-42a4-8ed1-11739e42765b")}catch{}})();const Ka=O.div`
1
+ import{j as e}from"./liveblocks-0jcT8Dx_.js";import{u as U,h as Z,i as G,j as A,N as Q,n as W,g as K,o as $e,p as f}from"./core-DrRun-Wp.js";import{Ry as He,Rz as Un,BK as Mn,RA as zn,RB as $n,bH as Hn,RC as Ve,DN as Ne,RD as Ze,eZ as M,yN as Ge,PE as We,cq as te,cr as Ye,yH as Vn,RE as Nn,RF as Zn,yK as Gn,yR as ye,yE as Wn,yB as Yn,RG as Qe,BQ as Qn,Qn as de,RH as qn,Hr as Kn,Nv as Jn,Ht as Xn,ln as Re,RI as ea,rY as qe,rM as Ke,le as Je,lh as Be,Nw as Fe,Nx as na,RJ as aa,lg as ta,lD as oa,l5 as sa,jE as ra,jD as ia,RK as ca,RL as xe,H8 as la,RM as da,RN as ua,Qg as we,RO as Oe,RP as pa,HE as ma,QY as fa,ES as Xe,uw as en,RQ as ha,HB as ga,RR as nn,cS as Ae,BR as an,fY as ya,fE as tn,fG as De,HG as xa,EM as Ca,Hy as wa,RS as on,RT as sn,Ha as rn,Hk as Le,RU as Aa,QP as Da,HI as ka,bs as Sa,bJ as Ia,cC as ba,bK as ja,bt as Ea,Mj as va}from"./zeni-epic-state-D1OApLJ3.js";import{J as z,c4 as Pa,f as oe,A as N,c as F,z as S,a4 as ke,c5 as Ta,y as $,C as ue,c6 as Ra,H as J,s as cn,ar as Ba,ag as _e,g as _,c7 as Fa,au as Se,c8 as Oa,E as pe,c9 as La,j as Ie,aS as q,ca as _a,_ as Ua,a0 as ln,ad as Ma,cb as Ue,cc as za,w as le,cd as $a,ce as Ha,cf as Va,d as Na,o as Za}from"./index-24dzDu8E.js";import{n as O,D as X,S as ee}from"./mui-BCzMCgwZ.js";import{a as p}from"./sentry-Cix5j_Oe.js";import{u as dn}from"./useCashManagementBanner-Y_B1najt.js";import V from"./NotFoundScreen-BUTiP4R3.js";import{S as Me}from"./SetupPagesScreen-BKdx-uAP.js";import{F as un}from"./FeaturePreviewScreen-s3Vp54dP.js";import{M as me}from"./MobileAppDrawer-zOj9FdCe.js";import{A as Ga,D as Wa,V as Ya}from"./DomesticWireDetailScreen-B3xL-JF2.js";import{A as Qa}from"./AddressScreen-vfbZQ8IJ.js";import{u as pn}from"./useAskAiCfoHostNavButtonProps-DG7vn-Xl.js";import{Z as qa}from"./ZeniAccountStatementScreen-DyRW5BgC.js";import"./recharts-BJColP3b.js";import"./analytics-CO5gayAE.js";import"./plaid-B0k6aBM1.js";import"./dnd-C7lg2kUY.js";import"./stripe-cKAAJElX.js";import"./lottie-C4eBAM7n.js";import"./lexical-Cceo9d8G.js";import"./pdf-C1ioMmzA.js";import"./utils-CvfvTDv6.js";import"./analyticsHelper-DFsb6qRL.js";import"./routePaths-Bty2j8lo.js";import"./BusinessVerificationPageScreen-YZ8HV6ZO.js";(function(){try{var n=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},a=new n.Error().stack;a&&(n._sentryDebugIds=n._sentryDebugIds||{},n._sentryDebugIds[a]="7964cf46-f643-4fb8-a193-3c4f9803f24f",n._sentryDebugIdIdentifier="sentry-dbid-7964cf46-f643-4fb8-a193-3c4f9803f24f")}catch{}})();const Ka=O.div`
2
2
  display: flex;
3
3
  min-height: 100%;
4
4
  width: 100%;
@@ -0,0 +1,9 @@
1
+ import{j as c}from"./liveblocks-0jcT8Dx_.js";import{a as m}from"./sentry-Cix5j_Oe.js";import{h as x,u as C,g as L,i as $,j as p}from"./core-DrRun-Wp.js";import{LA as s,Lz as j,RV as v,eZ as z,RW as B}from"./zeni-epic-state-D1OApLJ3.js";import{J as T,au as g,y as D,z as E,C as P,cg as N,s as U}from"./index-24dzDu8E.js";import{n as _}from"./mui-BCzMCgwZ.js";(function(){try{var a=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},n=new a.Error().stack;n&&(a._sentryDebugIds=a._sentryDebugIds||{},a._sentryDebugIds[n]="1540f140-74a1-47ba-8037-5a9f5863a648",a._sentryDebugIdIdentifier="sentry-dbid-1540f140-74a1-47ba-8037-5a9f5863a648")}catch{}})();const A=_.div`
2
+ display: flex;
3
+ height: 100vh;
4
+ width: 100%;
5
+ flex: 1 1 auto;
6
+ flex-direction: column;
7
+ align-items: center;
8
+ background-color: ${a=>a.theme.colors.grey4};
9
+ `;function W(){const a=x(),n=C(),d=T(),l=L();let{accountId:e}=$(),f=`${g.bankingMicroServiceBaseUrl}/1.0/deposit-accounts/${e}`;e==null&&l.pathname.includes(`${s}/statements`)&&(e=s,f=`${g.bankingMicroServiceBaseUrl}/1.0/${s}`);const[u,y]=m.useState(!1),h=D();m.useEffect((()=>{u||(y(!0),n(j(e??"",!1)))}),[u,n]);const o=p((t=>v(t,e??""))),I=()=>{const t=U(l.state?.pathnameStackToGoBack),S=t.poppedPathname??"..";a(S,{state:{pathnameStackToGoBack:t.newStack}})},r=E.getSignedInUser(),i=p((t=>z(t))),b={userId:r?.userId??"",sessionId:r?.zeniSessionId??"",tenantId:i.tenantId??""},w=B(e??"")===!0?s:o.zeniAccountDetail?.accountLast4??"",k=i.company?.companyInfo.companyLegalName??i.companyName;if(r==null)throw Error("Can't access address page without signing in...");return o.fetchState!=="Completed"?c.jsx(P,{fetchState:"In-Progress",style:{backgroundColor:h.colors.grey5}}):c.jsx(A,{windowSize:d,children:c.jsx(N,{currentTenantCompanyName:k,statementListView:o,accountLast4:w,onBackClick:I,authParams:b,downloadEndPoint:f})})}export{W as Z};