@zeniai/web-app-ui 5.3.41-qa → 5.3.42-dev

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (151) hide show
  1. package/dist/assets/AccountMappingScreen-5txeuTng.js +9 -0
  2. package/dist/assets/ActualMatchingMatchDetailScreen-BvCTHIwN.js +1 -0
  3. package/dist/assets/AddressRoutes-CysroEs-.js +1 -0
  4. package/dist/assets/AddressScreen-C1CfOA8k.js +9 -0
  5. package/dist/assets/{AiCfoScreen-BjMYvl6E.js → AiCfoScreen-C0gnDsXr.js} +5 -5
  6. package/dist/assets/{AppDrawer-ByoXxMIV.js → AppDrawer-CZ5MsAyB.js} +2 -2
  7. package/dist/assets/{BillPayApprovalRoutes-Z4uvf0-n.js → BillPayApprovalRoutes-Dba8jEIY.js} +1 -1
  8. package/dist/assets/{BillPayRoutes-8zmFRoA_.js → BillPayRoutes-BInjoPbL.js} +11 -11
  9. package/dist/assets/BusinessVerificationPageScreen-BmHKq1LL.js +9 -0
  10. package/dist/assets/{CardsAiCfoScreen-B7sfpD2b.js → CardsAiCfoScreen-C6Rnq8nD.js} +1 -1
  11. package/dist/assets/ChargeCardRoutes-P239JK-b.js +71 -0
  12. package/dist/assets/{CompanyPassportScreen-DDKosLEE.js → CompanyPassportScreen-yPmE04_9.js} +1 -1
  13. package/dist/assets/ConnectionAuthScreen-6-1bG5gz.js +11 -0
  14. package/dist/assets/CustomerOnboardingAuthScreen-C__JnnR_.js +1 -0
  15. package/dist/assets/CustomerOnboardingRoutes-CbzzxK0y.js +30 -0
  16. package/dist/assets/{DashboardRoutes-B5yb7VGD.js → DashboardRoutes-DhWNQvqz.js} +4 -4
  17. package/dist/assets/{DefaultTenantHome-DXPTZTHs.js → DefaultTenantHome-Fsi_QjM5.js} +1 -1
  18. package/dist/assets/DomesticWireDetailScreen-CuBtrLRo.js +18 -0
  19. package/dist/assets/{DrawerScreen--7ksii2j.js → DrawerScreen-o43C4sHm.js} +1 -1
  20. package/dist/assets/EntityDetailRoutes-Vj0NPJut.js +1 -0
  21. package/dist/assets/ExpenseAutomationRoutes-faxOwOvi.js +38 -0
  22. package/dist/assets/FeaturePreviewScreen-CEOFkjIy.js +1 -0
  23. package/dist/assets/HubSpotOAuthCallbackScreen-CnHqx1ge.js +1 -0
  24. package/dist/assets/{InboxNotificationsProvider-D007v5X6.js → InboxNotificationsProvider-Cf5DQSg3.js} +1 -1
  25. package/dist/assets/{InvoicingRoutes-6Wikj2BP.js → InvoicingRoutes--kNvLDpX.js} +2 -2
  26. package/dist/assets/{MagicLinkRoutes-D0y8ZbiR.js → MagicLinkRoutes-_oMvrXOe.js} +8 -8
  27. package/dist/assets/MagicLinkSignInScreen-D2yfAbuX.js +12 -0
  28. package/dist/assets/MobileAppDrawer-Q8q8ssn0.js +1 -0
  29. package/dist/assets/NotFoundScreen-3YmbDG-O.js +1 -0
  30. package/dist/assets/{NotificationRoutes-La5Ef0Sp.js → NotificationRoutes-BFjfuaHE.js} +1 -1
  31. package/dist/assets/OAuthConsentScreen-Ce7q6w-7.js +1 -0
  32. package/dist/assets/PandLWithForecastRoutes-Cb8E55Qo.js +1 -0
  33. package/dist/assets/{PaymentLinkScreen-C3veO1_u.js → PaymentLinkScreen-CN69RRr9.js} +1 -1
  34. package/dist/assets/PeopleRoutes-DNCzXaoC.js +22 -0
  35. package/dist/assets/PerformanceRoutes-DyNYMyLi.js +1 -0
  36. package/dist/assets/{Preview-DA8U2xpZ.js → Preview-BCwFnEAM.js} +1 -1
  37. package/dist/assets/{QBOConnectionScreen-BbB3FEE8.js → QBOConnectionScreen-DX5rBjLM.js} +1 -1
  38. package/dist/assets/ReimbursementApprovalRoutes-DifzmUQS.js +1 -0
  39. package/dist/assets/{ReimbursementApprovalRuleDetailScreen-lW1DSyNO.js → ReimbursementApprovalRuleDetailScreen-6W7aXQIv.js} +1 -1
  40. package/dist/assets/{ReimbursementRoutes-03Hgu3V3.js → ReimbursementRoutes-Caztwlhg.js} +9 -9
  41. package/dist/assets/{ReportsRoutes-B9cy_-f4.js → ReportsRoutes-CfScWyxA.js} +1 -1
  42. package/dist/assets/RewardsRoutes-BaqYIdkd.js +1 -0
  43. package/dist/assets/ScheduleDetailsPrepaidExpensesScreen-DuraGGsO.js +33 -0
  44. package/dist/assets/ScreenRoutes-QNvqH_bZ.js +2 -0
  45. package/dist/assets/{SettingsRoutes-BAJmUy_d.js → SettingsRoutes-DzQurTcP.js} +6 -6
  46. package/dist/assets/{SetupPagesScreen-CNVeqnHU.js → SetupPagesScreen-CsSP_P2k.js} +5 -5
  47. package/dist/assets/SignInScreen-CRymVKij.js +1 -0
  48. package/dist/assets/SignOutScreen-B0U7u8Hy.js +9 -0
  49. package/dist/assets/{TaskListScreen-B_HBW--i.js → TaskListScreen-CXn6czhu.js} +2 -2
  50. package/dist/assets/TaskRoutes-0Yfh5AkX.js +9 -0
  51. package/dist/assets/TransactionDetailRoutes-BiIqbu_-.js +1 -0
  52. package/dist/assets/{TransactionDetailScreen-BISRvrnZ.js → TransactionDetailScreen-Cxl44PLi.js} +2 -2
  53. package/dist/assets/TransactionListRoutes-CBLSrFS8.js +1 -0
  54. package/dist/assets/{TreasuryRoutes-DQeUZ7RQ.js → TreasuryRoutes-a3UpD3kR.js} +6 -6
  55. package/dist/assets/{VendorsRoutes-AD9AzaGF.js → VendorsRoutes-DlFjWODu.js} +18 -18
  56. package/dist/assets/WiseConfirmationScreen-BJ1TyqgG.js +12 -0
  57. package/dist/assets/ZeniAccountRoutes-C0xgRuTa.js +57 -0
  58. package/dist/assets/ZeniAccountStatementScreen-C8J1M6mP.js +9 -0
  59. package/dist/assets/{accountMappingHelper-qlU24D2s.js → accountMappingHelper-2xXLJj4S.js} +1 -1
  60. package/dist/assets/{analytics-BvodL4nJ.js → analytics-CvsRIk3B.js} +1 -1
  61. package/dist/assets/{analyticsHelper-BBEm35nD.js → analyticsHelper-tF6p2yRC.js} +1 -1
  62. package/dist/assets/{core-gUqdW_kq.js → core-DGLzDXWl.js} +1 -1
  63. package/dist/assets/{decodeURIComponentSafe-Cst3Y24b.js → decodeURIComponentSafe-k3ZAUeWI.js} +1 -1
  64. package/dist/assets/{dnd-YSyN45zY.js → dnd-SnD389s6.js} +1 -1
  65. package/dist/assets/{empty-BAVoovBk.js → empty-BfBfVq50.js} +1 -1
  66. package/dist/assets/{empty-CkcqWk4Z.js → empty-BjVnPUF5.js} +1 -1
  67. package/dist/assets/{emptyVideoElement-DMVtoCOe.js → emptyVideoElement-Bb1KlJXy.js} +1 -1
  68. package/dist/assets/epic-CPuRNynX.js +2 -0
  69. package/dist/assets/expenseAutomationHelper-DWDIPthN.js +1 -0
  70. package/dist/assets/{getLocaleForTenant-BFGbVplK.js → getLocaleForTenant-CZIO6uAG.js} +1 -1
  71. package/dist/assets/{index-70FTEc4H.js → index-B2CKeHlo.js} +1 -1
  72. package/dist/assets/{index-ChcsxO47.js → index-BMI1TT7Z.js} +1 -1
  73. package/dist/assets/{index-1WLkQfLs.js → index-Buyjnqrt.js} +1 -1
  74. package/dist/assets/{index-BhZ9H0Qw.js → index-C54xa34r.js} +1 -1
  75. package/dist/assets/index-CQFc7TiS.js +1 -0
  76. package/dist/assets/{index-BzFSQsxk.js → index-CzPkUTbT.js} +2 -2
  77. package/dist/assets/{index-DRDpUzzs.js → index-DGjciFPC.js} +16718 -15885
  78. package/dist/assets/{index-6dqseRo4.js → index-DPcuwgM-.js} +1 -1
  79. package/dist/assets/{lexical-Euc6kCJG.js → lexical-CMBMntF_.js} +1 -1
  80. package/dist/assets/{liveblocks-B3m51ZRo.js → liveblocks-DRsJ0YIJ.js} +1 -1
  81. package/dist/assets/{lottie-DLBd_qLT.js → lottie-DEqUWUd5.js} +1 -1
  82. package/dist/assets/{mui-DCW4m3lZ.js → mui-BuJ3P0FU.js} +1 -1
  83. package/dist/assets/{pathToGoBack-Ds-XNEX3.js → pathToGoBack-BzjHaNqp.js} +1 -1
  84. package/dist/assets/{pdf-BDXl9G7N.js → pdf-B_v4zyN7.js} +3 -3
  85. package/dist/assets/{pdf-lib-Bku26ZcE.js → pdf-lib-DxbyphS9.js} +1 -1
  86. package/dist/assets/{plaid-BrXe9xNf.js → plaid-i7y7YD6O.js} +1 -1
  87. package/dist/assets/{pusher-BzxZmWnS.js → pusher-BYBfYYCn.js} +1 -1
  88. package/dist/assets/{react-DtuhKjd8.js → react-B90rw7na.js} +1 -1
  89. package/dist/assets/{react-pusavzWL.js → react-C2HSs5Iu.js} +1 -1
  90. package/dist/assets/{react-C43HbBFY.js → react-CAYYQ7Si.js} +1 -1
  91. package/dist/assets/{react-Db0eqcPH.js → react-CAr2Hff_.js} +1 -1
  92. package/dist/assets/{react-Cp8yT8Rr.js → react-Dm85ZpZj.js} +1 -1
  93. package/dist/assets/{react-FxzlmTOI.js → react-leqbcToB.js} +1 -1
  94. package/dist/assets/{recharts-HpXoq1DR.js → recharts-CJlXFxhv.js} +1 -1
  95. package/dist/assets/{routePaths-BlnN04aI.js → routePaths-COaM8xFB.js} +1 -1
  96. package/dist/assets/{sentry-DI7gLUjw.js → sentry-G4ZANa8Z.js} +1 -1
  97. package/dist/assets/stripSplatSuffix-BTaD_7hZ.js +1 -0
  98. package/dist/assets/{url-BVmez_R2.js → url--ciz_Nq8.js} +1 -1
  99. package/dist/assets/{url-qyBRakHR.js → url-CtF92dYM.js} +1 -1
  100. package/dist/assets/useActualMatchingMatchDetail-Dtg-Odjs.js +1 -0
  101. package/dist/assets/{useAiCfoDashboardSuggestedQuestionsChips-C8tiJ4-s.js → useAiCfoDashboardSuggestedQuestionsChips-DXgID2ue.js} +1 -1
  102. package/dist/assets/useAskAiCfoHostNavButtonProps-DY2m50un.js +1 -0
  103. package/dist/assets/{useChargeCardPusherEvents-K7_8wfj8.js → useChargeCardPusherEvents-C-hT_5jI.js} +1 -1
  104. package/dist/assets/{useDeviceId-kl-tdydV.js → useDeviceId-C9MUyzJJ.js} +1 -1
  105. package/dist/assets/useEmailConnectResultRefresh-B7XzuZ4T.js +1 -0
  106. package/dist/assets/{useInitialThreadRequest-TMWlbA40.js → useInitialThreadRequest-Cdwnj1Ib.js} +1 -1
  107. package/dist/assets/useTaskManagerAccess-i7vk79Wr.js +1 -0
  108. package/dist/assets/{utils-8Dv5nUFZ.js → utils-Bz8wuSWM.js} +1 -1
  109. package/dist/assets/withTransactionSidePanel-_ek7stLz.js +25 -0
  110. package/dist/assets/{zeni-epic-state-C-d25VTi.js → zeni-epic-state-Dm2vDWXH.js} +6 -6
  111. package/dist/index.html +1 -1
  112. package/package.json +4 -4
  113. package/dist/assets/AccountMappingScreen-C3HFW5Ij.js +0 -9
  114. package/dist/assets/AddressRoutes-Bt5wsDb7.js +0 -1
  115. package/dist/assets/AddressScreen-CSJE0p29.js +0 -9
  116. package/dist/assets/BusinessVerificationPageScreen-CmhKA9oQ.js +0 -9
  117. package/dist/assets/ChargeCardRoutes-C7bJJS3x.js +0 -71
  118. package/dist/assets/ConnectionAuthScreen-tllRDLdE.js +0 -11
  119. package/dist/assets/CustomerOnboardingAuthScreen-BtQtr6Oc.js +0 -1
  120. package/dist/assets/CustomerOnboardingRoutes-zfeAaUV5.js +0 -30
  121. package/dist/assets/DomesticWireDetailScreen-Bl1py3nW.js +0 -18
  122. package/dist/assets/EntityDetailRoutes-Cjc6zlA1.js +0 -1
  123. package/dist/assets/ExpenseAutomationRoutes-Dg2fewAy.js +0 -38
  124. package/dist/assets/FeaturePreviewScreen-CaIMasua.js +0 -1
  125. package/dist/assets/HubSpotOAuthCallbackScreen-y0UiA1as.js +0 -1
  126. package/dist/assets/MagicLinkSignInScreen-CYMk4ubj.js +0 -12
  127. package/dist/assets/MobileAppDrawer-Bh8VAeHB.js +0 -1
  128. package/dist/assets/NotFoundScreen-BFfoIcMt.js +0 -1
  129. package/dist/assets/OAuthConsentScreen-qHtuiZOo.js +0 -1
  130. package/dist/assets/PandLWithForecastRoutes-AChf_KvX.js +0 -1
  131. package/dist/assets/PeopleRoutes-Dx-0mEVQ.js +0 -22
  132. package/dist/assets/PerformanceRoutes-3JW12kzP.js +0 -1
  133. package/dist/assets/ReimbursementApprovalRoutes-CvLfwozC.js +0 -1
  134. package/dist/assets/RewardsRoutes-DQIZ8X-t.js +0 -1
  135. package/dist/assets/ScheduleDetailsPrepaidExpensesScreen-D9k6A3OE.js +0 -33
  136. package/dist/assets/ScreenRoutes-DBgMcdH4.js +0 -2
  137. package/dist/assets/SignInScreen-_6ovFcIG.js +0 -1
  138. package/dist/assets/SignOutScreen-DQot6FAh.js +0 -9
  139. package/dist/assets/TaskRoutes-CIgfsl6U.js +0 -9
  140. package/dist/assets/TransactionDetailRoutes-CEwE4Bbf.js +0 -1
  141. package/dist/assets/TransactionListRoutes-DHaTXNgW.js +0 -1
  142. package/dist/assets/WiseConfirmationScreen-DnPfMtVh.js +0 -12
  143. package/dist/assets/ZeniAccountRoutes-BKcFRSlc.js +0 -57
  144. package/dist/assets/ZeniAccountStatementScreen-Cn72q1Zx.js +0 -9
  145. package/dist/assets/epic-DHyjKhvW.js +0 -2
  146. package/dist/assets/expenseAutomationHelper-DDRCXr7k.js +0 -1
  147. package/dist/assets/index-DhQKJDfi.js +0 -1
  148. package/dist/assets/useAskAiCfoHostNavButtonProps-DNzUy0g0.js +0 -1
  149. package/dist/assets/useEmailConnectResultRefresh-BJXmlYiy.js +0 -1
  150. package/dist/assets/useTaskManagerAccess-BJoTHFNB.js +0 -1
  151. package/dist/assets/withTransactionSidePanel-ZShW5IUX.js +0 -25
@@ -1,18 +0,0 @@
1
- import{j as l}from"./liveblocks-B3m51ZRo.js";import{h as w,g as C,j as h,l as E,i as V}from"./core-gUqdW_kq.js";import{Y6 as k,Yd as M,gF as _,gE as W,gD as J,kO as K,W5 as X,uc as q,fE as B,XF as D,kM as F,Y7 as S,Yg as T,kK as G,l5 as j}from"./zeni-epic-state-C-d25VTi.js";import{bM as L,a1 as N,M as R,z as O,E as U,a4 as b,y as v,a7 as Y,bN as Q,J as Z,bO as ee,p as te}from"./index-DRDpUzzs.js";import{n as z}from"./mui-DCW4m3lZ.js";import"./sentry-DI7gLUjw.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]="fcee25e8-099d-47d6-8065-01080177333c",e._sentryDebugIdIdentifier="sentry-dbid-fcee25e8-099d-47d6-8065-01080177333c")}catch{}})();const ne=E(null,(function(e,t){return{onSaveVendor:n=>{e(K(t.vendorId!==void 0?t.vendorId:void 0,t.billId,void 0,t.isExpressPayPage)),e(X("common")),n!=null&&e(q(n))},onGetOtp:n=>{e(J(n,"BillPayVendor"))},onResendOtp:n=>{e(W(n,"BillPayVendor"))},onVerifyOtp:(n,a)=>{e(_(n,a,"BillPayVendor"))},onVerifyOtpSuccess:(n,a,o)=>{e(M(n,a,o))}}}))(L);function H({vendorId:e,billId:t,isExpressPayPage:n}){const a=w(),o=C(),s=h((d=>k(d,e)));return l.jsx(ne,{location:o,navigate:a,vendorId:e,billId:t,vendorViewDetails:s,isExpressPayPage:n??!1})}const ae=z.div`
2
- display: flex;
3
- height: 100vh;
4
- width: 100%;
5
- flex: 1 1 auto;
6
- flex-direction: column;
7
- align-items: center;
8
- background-color: ${e=>e.theme.colors.grey4};
9
- `,oe=E((function(e,t){const{vendorId:n,billId:a}=t,o=k(e,n),s=D(e,t.isVendorRecommendationEnabled,t.isZeniAccountsFeatureEnabled,a);return{billId:a,isDisabled:o.bankAccountCreationState.fetchState==="In-Progress"?"readonly":void 0,vendorViewDetails:o,file:s.file,bankAccountContext:t.bankAccountContext}}),(function(e,t){const{navigate:n,location:a,vendorId:o}=t;return{onFetchBankName:s=>{e(j(s))},onSaveHandler:s=>{e(G(t.bankAccountContext,s,"standard",o))},onCancel:()=>{(()=>{const s=b(a.state?.pathnameStackToGoBack),d=s.poppedPathname??P();n(d,{state:{pathnameStackToGoBack:s.newStack}})})(),e(S())},onACHDetailsUpdated:s=>{const{bankAccountSection:d}=s;e(T({data:d}))},onBackClick:()=>{if(e(F({fetchState:"Not-Started"})),t.bankAccountContext==="express-pay")n("../",{relative:"path"});else{const s=b(t.location.state?.pathnameStackToGoBack),d=s.poppedPathname??P(0);t.navigate(d,{state:{pathnameStackToGoBack:s.newStack}})}e(S())}}}))(Q);function fe({vendorIdParam:e,accountContext:t}){const n=w(),a=C(),o=N(),{vendorId:s,billId:d}=V(),i=e??s,{useFeatureGate:c}=R(),r=O.getSignedInUser(),p=h((u=>B(u))),g=U(),x=b(a.state?.pathnameStackToGoBack),f=t??(x.poppedPathname?.includes("vendor")===!0?"vendor":"billDetail"),m=h((u=>k(u,i))),{isFeatureEnabled:I}=c(v.isVendorRecommendationFeatureEnabled),{isFeatureEnabled:y}=c(v.isDepositAccountsFeatureEnabled);if(r==null)throw Error("Can't access address page without signing in...");return f==="billDetail"&&m.editVendorState?.saveStatus.fetchState==="In-Progress"?l.jsx(Y,{fetchState:m.editVendorState?.saveStatus.fetchState??"Not-Started",style:{backgroundColor:g.colors.grey5}}):l.jsxs(ae,{windowSize:o,children:[l.jsx(H,{vendorId:i,billId:d}),l.jsx(oe,{location:a,navigate:n,billId:d,vendorId:i,currentTenant:p,bankAccountContext:f,isVendorRecommendationEnabled:I,isZeniAccountsFeatureEnabled:y})]})}const P=(e=2)=>{let t="../";for(let n=0;n<e;n++)t=`${t}../`;return t},me=(e,t,n)=>{let a=`/${e}/bill/${encodeURIComponent(t)}`;return n=="draft"&&(a+="/edit"),a},he=e=>`/${e}/bills`,ke=(e,t)=>{let n=`/${e}/bill`;return n=t!=null?n.concat(`/${t}/edit`):n.concat("/new"),n},A=(e,t,n,a)=>{let o=`/${e}/bill`;return o+=n!=null?`/${n}/edit/vendor`:"/new/vendor",o+=a!=null?`/${a}/edit/${t}`:`/create/${t}`,o};function Se(e,t,n){return A(e,"ach",t,n)}function ve(e,t,n){return A(e,"domestic",t,n)}function ge(e,t,n){return A(e,"international",t,n)}const se=(e,t,n)=>{let a=`/${e}/bill/`;return a=n!=null?a.concat(`${encodeURIComponent(n)}/${t}/`):a.concat(`new/${t}/`),a},ce=z.div`
10
- display: flex;
11
- height: 100vh;
12
- width: 100%;
13
- flex: 1 1 auto;
14
- flex-direction: column;
15
- align-items: center;
16
- background-color: ${e=>e.theme.colors.grey4};
17
- box-shadow: ${e=>`0px 2px ${Z.sp1} ${e.theme.colors.dropShadowNormal}`};
18
- `,de=E((function(e,t){const{vendorId:n,billId:a}=t,o=k(e,n),s=D(e,t.isVendorRecommendationEnabled,t.isZeniAccountsFeatureEnabled,a);return{billId:a,isDisabled:o.bankAccountCreationState.fetchState==="In-Progress"?"readonly":void 0,vendorViewDetails:o,file:s.file,bankAccountContext:t.bankAccountContext}}),(function(e,t){const{billId:n,navigate:a,location:o,vendorId:s,currentTenant:d}=t,{tenantEmailDomain:i}=d;return{onFetchBankName:c=>{e(j(c))},onSaveHandler:c=>{e(G(t.bankAccountContext,c,"us-domestic",s))},onWireDetailsUpdated:c=>{const{bankAccountSection:r}=c;e(T({data:r}))},onCancel:()=>{(()=>{const c=b(o.state?.pathnameStackToGoBack),r=c.poppedPathname??$();a(r,{state:{pathnameStackToGoBack:c.newStack}})})(),e(S())},onAddressClick:c=>{if(t.bankAccountContext==="express-pay")a("./add-address");else{const r=se(i,c,n),p=te(o.state?.pathnameStackToGoBack,o.pathname);a(r,{state:{pathnameStackToGoBack:p}})}},onBackClick:()=>{if(e(F({fetchState:"Not-Started"})),t.bankAccountContext==="express-pay")a("../",{relative:"path"});else{const c=b(t.location.state?.pathnameStackToGoBack),r=c.poppedPathname??$(0);t.navigate(r,{state:{pathnameStackToGoBack:c.newStack}})}e(S())}}}))(ee);function xe({vendorIdParam:e,accountContext:t}){const n=w(),a=C(),o=N(),{vendorId:s,billId:d}=V(),i=e??s,c=O.getSignedInUser(),{useFeatureGate:r}=R(),p=U(),g=h((u=>B(u))),x=b(a.state?.pathnameStackToGoBack),f=t??(x.poppedPathname?.includes("vendor")===!0?"vendor":"billDetail"),m=h((u=>k(u,i))),{isFeatureEnabled:I}=r(v.isVendorRecommendationFeatureEnabled),{isFeatureEnabled:y}=r(v.isDepositAccountsFeatureEnabled);if(c==null)throw Error("Can't access address page without signing in...");return f==="billDetail"&&m.editVendorState?.saveStatus.fetchState==="In-Progress"?l.jsx(Y,{fetchState:m.editVendorState?.saveStatus.fetchState??"Not-Started",style:{backgroundColor:p.colors.grey5,boxShadow:`0px 2px ${Z.sp1} ${p.colors.dropShadowNormal}`}}):l.jsxs(ce,{windowSize:o,children:[l.jsx(H,{vendorId:i,billId:d}),l.jsx(de,{location:a,navigate:n,billId:d,vendorId:i,currentTenant:g,bankAccountContext:f,isVendorRecommendationEnabled:I,isZeniAccountsFeatureEnabled:y})]})}const $=(e=2)=>{let t="../";for(let n=0;n<e;n++)t=`${t}../`;return t};export{fe as A,xe as D,H as V,me as a,se as b,ke as c,ve as d,he as g,ge as i,Se as v};
@@ -1 +0,0 @@
1
- import{j as s}from"./liveblocks-B3m51ZRo.js";import{a as d}from"./sentry-DI7gLUjw.js";import{h as B,u as G,g as A,i as R,j as l,N as _,l as q,n as F,o as V}from"./core-gUqdW_kq.js";import{W9 as N,fE as O,Vr as M,m_ as Y,Rt as I,We as $,W4 as z,l_ as H,Ru as S,Vw as J,Vx as K,W6 as L,W5 as Q}from"./zeni-epic-state-C-d25VTi.js";import{b8 as U,k as X,a4 as Z,p as tt}from"./index-DRDpUzzs.js";import"./mui-DCW4m3lZ.js";import{d as k}from"./decodeURIComponentSafe-Cst3Y24b.js";import{w as et}from"./withTransactionSidePanel-ZShW5IUX.js";import{f as at,c as nt}from"./routePaths-BlnN04aI.js";import"./recharts-HpXoq1DR.js";import"./analytics-BvodL4nJ.js";import"./plaid-BrXe9xNf.js";import"./dnd-YSyN45zY.js";import"./stripe-cKAAJElX.js";import"./lottie-DLBd_qLT.js";import"./lexical-Euc6kCJG.js";import"./pdf-BDXl9G7N.js";import"./utils-8Dv5nUFZ.js";import"./useAskAiCfoHostNavButtonProps-DNzUy0g0.js";import"./TransactionDetailScreen-BISRvrnZ.js";import"./useInitialThreadRequest-TMWlbA40.js";import"./expenseAutomationHelper-DDRCXr7k.js";(function(){try{var a=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new a.Error().stack;t&&(a._sentryDebugIds=a._sentryDebugIds||{},a._sentryDebugIds[t]="46527319-2e55-4046-bc45-2f41dc619ff4",a._sentryDebugIdIdentifier="sentry-dbid-46527319-2e55-4046-bc45-2f41dc619ff4")}catch{}})();const ot=q((function(a,t){const e=t.entity,o=$(a,t.entity,"EntityDetail");return{selectedEntity:e,autoCompleteData:{autoCompleteText:e.name,entityAutoCompleteView:z(a,"common")},trendWithTransactionsReport:o,analytics:X,isAccountingClassesEnabled:H(a)}}),(function(a,t){return{onTransactionItemClick:e=>{if(t.openTransactionPanel)return void t.openTransactionPanel(e.id,e.type);const o=`${nt(e,t.tenantEmailDomain)}`,c=tt(t.location.state?.pathnameStackToGoBack,t.location.pathname);t.navigate(o,{state:{pathnameStackToGoBack:c}})},autoCompleteActions:{onAutoCompleteInputChange:e=>{e.trim().length>=2?a(L({searchString:e,searchOrigin:"common"})):e.trim().length===0&&a(Q("common"))},onAutoCompleteEntity:e=>{const o=at(e,t.tenantEmailDomain);a(J()),a(K()),t.resetTrendIsFetchedStates(),t.navigate(o,{replace:!0,state:{pathnameStackToGoBack:t.location.state?.pathnameStackToGoBack}})},onCancelAutoComplete:()=>{const e=Z(t.location.state?.pathnameStackToGoBack),o=e.poppedPathname??b();t.navigate(o,{state:{pathnameStackToGoBack:e.newStack}})}},onTrendSelectedPeriodChange:e=>{if(t.closeSidePanel?.(),e==null)t.defaultTransactionTimePeriod!=null&&a(S(t.entity,"EntityDetail",{timeframe:"quarter",timePeriod:t.defaultTransactionTimePeriod}));else{const o=e.currentTimePeriod==null?e.addTimePeriod:{startDate:e.addTimePeriod.startDate,endDate:e.currentTimePeriod.endDate};a(I(t.entity,"EntityDetail",{timeframe:e.timeframe,timePeriod:e.addTimePeriod})),a(S(t.entity,"EntityDetail",{timeframe:e.timeframe,timePeriod:o}))}}}}))(U),it=et((function({entityType:a,...t}){const e=B(),o=G(),c=A(),[m,T]=d.useState(!1),[h,D]=d.useState(!1),{tenantEmailDomain:C,entityIdEncoded:x,entityNameEncoded:w}=R(),r=k(x??""),p=k(w??""),f=rt(r,p),j=[r,p].filter((n=>n!=null)),i={name:p,id:r,type:a,zeniId:r,qboId:r},g=l((n=>N(n.customerIncomeState,n.vendorExpenseState,n.trendState,i,"quarter"))),v=l((n=>O(n).company?.companyInfo.firstMonthOfFY??1)),u=l((n=>M(n.trendWithTransactionsState,i,"EntityDetail")));d.useEffect((()=>{m===!1&&f===!0&&(T(!0),o(Y(i)))}),[m,f,i]);const E=l((n=>n.trendState.fetchState)),P=u?.selectedPeriod?.timePeriod??g,W=(function(n,y){return n!=null&&y!=null?{startDate:n.startDate,endDate:y?.endDate}:y})(u?.selectedPeriod?.timePeriod,g);return d.useEffect((()=>{m===!0&&h===!1&&E==="Completed"&&(D(!0),P!=null&&o(I(i,"EntityDetail",{timeframe:u?.selectedPeriod?.timeframe??"quarter",timePeriod:P})))}),[m,h,E]),f?s.jsx(ot,{firstMonthOfFY:v,tenantEmailDomain:C,location:c,navigate:e,entity:i,defaultTransactionTimePeriod:W,resetTrendIsFetchedStates:()=>{T(!1),D(!1)},...t}):s.jsx(_,{to:b(j.length)})})),rt=(a,t)=>t!=null&&t.length>0&&a!=null&&a.length>0,b=(a=2)=>{let t="../";for(let e=0;e<a;e++)t=`${t}../`;return t};function jt({entityType:a}){return s.jsx(F,{children:s.jsx(V,{path:"/:entityIdEncoded/:entityNameEncoded/*",element:s.jsx(it,{entityType:a})})})}export{jt as EntityDetailRoutes,jt as default};
@@ -1,38 +0,0 @@
1
- import{j as f}from"./liveblocks-B3m51ZRo.js";import Ba from"./NotFoundScreen-BFfoIcMt.js";import{a as s,R as Pn}from"./sentry-DI7gLUjw.js";import{n as be,S as Ua}from"./mui-DCW4m3lZ.js";import{u as Se,h as Tt,g as Xe,j as F,i as Ct,l as Va,t as Oa,n as Ma,o as ut}from"./core-gUqdW_kq.js";import{fE as Ue,a0i as ja,p$ as _e,Ts as La,zn as za,a0j as $a,a0k as Ga,a0l as qa,a0m as mt,a0n as Je,gg as ft,a0o as nn,eM as Na,f$ as Ja,a0p as an,a0q as We,qS as Wa,uf as Ya,gR as Qa,gP as Ha,a0r as Ka,r3 as Za,rc as Xa,qa as es,qo as An,gO as de,gQ as ts,a0s as ns,qK as xn,rd as as,ql as ss,qg as os,ul as cs,gN as Fe,a0t as He,Bx as wn,LO as Dn,a0u as Rn,EQ as _n,a0v as is,fj as ls,fl as rs,sg as It,Wa as sn,Wc as ds,m1 as us,Wd as ms,m8 as ps,dk as hs,CQ as kt,a0w as Ss,a0x as gs,s6 as Cs,s7 as fs,W0 as Is,V6 as ks,$M as bs,qD as Fn,ri as Ke,a0y as Ts,W6 as on,W5 as Ne,a0z as cn,mp as ys,a0A as Es,a0B as vs,a0C as Ps,a0D as As,qy as xs,rl as Ye,a0E as ws,a0F as Ds,a0G as Rs,rt as _s,mc as Fs,m3 as Bs,a0H as Us,mb as ln,Wn as Vs,a0I as Os,a0J as Ms,tS as js,tt as Ls,rj as he,ts as pt,a0K as zs,a0L as $s,a0M as Gs,a0N as qs,nI as Ns,br as Js,nD as rn,np as Ws,a0O as Ys,g_ as Qs,nA as Hs,si as Ks,sk as Zs,r$ as Xs,V9 as eo,Va as to,Ei as no,Eh as ao,Ey as so,a0P as dn,s5 as oo,fw as bt,sb as co,a0Q as io,sr as lo,rV as ro,sw as uo,r_ as mo,rE as po,a0R as ho,Ti as Bn,qW as So,qu as go,qB as un,ro as Co,a0S as fo,a0T as Io,rk as Un,a0U as ko,a0V as bo,a0W as To,a0X as yo,sA as Eo,a0Y as vo,a0Z as Po,a0_ as mn,u1 as Ao,tk as xo,s2 as pn,W4 as wo,a0$ as Do,a10 as Ro,ma as _o,a11 as Fo,Qu as Bo,m9 as Uo,l_ as Vo,Th as Oo,sT as Vn,td as Mo,rh as hn,rm as jo,bE as Lo,nx as zo,nu as $o,a12 as Go,rD as Sn,t9 as gn,t7 as qo,a13 as No,sY as Jo,sD as Wo,ta as Yo,a14 as Qo,a15 as Ho,sJ as Ko,a16 as Zo,sE as Xo,sI as ec,sG as tc,tg as nc}from"./zeni-epic-state-C-d25VTi.js";import{M as Ze,y as H,k as Y,p as ne,aq as On,as as Mn,dQ as ac,z as et,dR as sc,dS as oc,dT as cc,ae as Be,dU as ic,dV as Cn,ba as fn,dW as lc,a7 as jn,dX as rc,j as Qe,G as dc,w as uc,dY as mc,av as In,dZ as pc,a as hc,d_ as Sc,d$ as gc,c as Cc,Q as fc,e0 as Ic,e1 as kc,e2 as bc,b4 as Tc,br as yc,ab as Ec,b5 as vc,b6 as Pc}from"./index-DRDpUzzs.js";import{u as Ln}from"./useAskAiCfoHostNavButtonProps-DNzUy0g0.js";import{g as kn,h as Ac,r as xc,b as wc,c as Dc,i as Rc,a as _c,C as Fc}from"./TransactionDetailScreen-BISRvrnZ.js";import{b as Bc,S as Uc,a as Vc,J as Oc}from"./ScheduleDetailsPrepaidExpensesScreen-D9k6A3OE.js";import{s as bn,i as zn,h as Mc,v as jc,c as Lc}from"./routePaths-BlnN04aI.js";import{u as zc,a as $c,w as Gc}from"./withTransactionSidePanel-ZShW5IUX.js";import{a as ht}from"./accountMappingHelper-qlU24D2s.js";import{D as qc}from"./DrawerScreen--7ksii2j.js";import"./recharts-HpXoq1DR.js";import"./analytics-BvodL4nJ.js";import"./plaid-BrXe9xNf.js";import"./dnd-YSyN45zY.js";import"./stripe-cKAAJElX.js";import"./lottie-DLBd_qLT.js";import"./lexical-Euc6kCJG.js";import"./pdf-BDXl9G7N.js";import"./utils-8Dv5nUFZ.js";import"./decodeURIComponentSafe-Cst3Y24b.js";import"./useInitialThreadRequest-TMWlbA40.js";import"./expenseAutomationHelper-DDRCXr7k.js";import"./pathToGoBack-Ds-XNEX3.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]="ee0744be-b90b-4c88-a56d-d7e96b216a50",t._sentryDebugIdIdentifier="sentry-dbid-ee0744be-b90b-4c88-a56d-d7e96b216a50")}catch{}})();const Nc=()=>{const t=Se(),a=Tt(),b=Xe(),h=F((S=>Ue(S))),{useFeatureGate:C}=Ze(),{isFeatureEnabled:i}=C(H.isRealtimeInsightsFeatureEnabled),{isFeatureEnabled:d}=C(H.aiAuditScorePercentage),P=F((S=>S.expenseAutomationViewState.selectedPeriodByTenantId)),r=F((S=>ja(S,h.tenantId))),{isAiCfoAccessEnabled:E,onAskAiCfoClick:w}=Ln({mobileExploreReferrer:"Month-End Close Overview"}),A=s.useCallback(((S,l,q=!1)=>{t(_e({tenantId:l,period:{month:S.month,year:S.year},refreshViewInBackground:q}))}),[]),T=s.useCallback((S=>{const l=b.state?.referrer;r.monthEndCloseChecks?.auditSummary!=null&&Y.trackMonthCloseAuditPage(S.month,S.year,r.monthEndCloseChecks.reportEmailSentDate!=null?"closed":"in-review",r.monthEndCloseChecks.auditSummary.auditScorePercentage,!1,l??null),t(La(h.tenantId,S))}),[h.tenantId,r.monthEndCloseChecks?.auditSummary,r.monthEndCloseChecks?.reportEmailSentDate]),p=P[h.tenantId],u=s.useCallback((()=>{const S=b.state?.referrer;r.monthEndCloseChecks?.auditSummary!=null&&Y.trackMonthCloseAuditPage(p.month,p.year,r.monthEndCloseChecks.reportEmailSentDate!=null?"closed":"in-review",r.monthEndCloseChecks.auditSummary.auditScorePercentage,!0,S??null),A(p,h.tenantId,!0)}),[A,p,h.tenantId,r.monthEndCloseChecks?.auditSummary,r.monthEndCloseChecks?.reportEmailSentDate]),_=ne(b.state?.pathnameStackToGoBack,b.pathname),x=s.useCallback((()=>{if(r.monthEndCloseChecks!=null&&p!=null){const S=r.monthEndCloseChecks.monthEndCloseCheckList.find((l=>l.progress<100));if(S!=null)return void a(`./${S.id}/${p.month}-${p.year}`,{state:{pathnameStackToGoBack:_,message:"comingFromOverview"}});a(`./month_end_insights/${p.month}-${p.year}`,{state:{pathnameStackToGoBack:_,message:"comingFromOverview"}})}}),[r.monthEndCloseChecks,p]),{areTenantIdsInSync:g}=On();return Mn({isDataReady:r.fetchState==="Completed"}),s.useEffect((()=>{p!=null&&r.fetchState!=="In-Progress"&&r.fetchState!=="Completed"&&g&&A(p,h.tenantId)}),[A,p,r.fetchState,h.tenantId,g]),s.useEffect((()=>{p!=null&&r.monthClosePerformanceTrendFetchStatus.fetchState!=="In-Progress"&&r.monthClosePerformanceTrendFetchStatus.fetchState!=="Completed"&&g&&t(za(p))}),[p,r.monthClosePerformanceTrendFetchStatus.fetchState,g]),s.useEffect((()=>{const S=setInterval((()=>{r.fetchState!=="In-Progress"&&r.fetchState==="Completed"&&u()}),3e5);return()=>clearInterval(S)}),[r.fetchState]),s.useEffect((()=>{if(r.fetchState==="Completed"&&r.monthEndCloseChecks?.auditSummary!=null){const S=b.state?.referrer;Y.trackMonthCloseAuditPage(r.selectedPeriod.month,r.selectedPeriod.year,r.monthEndCloseChecks.reportEmailSentDate!=null?"closed":"in-review",r.monthEndCloseChecks.auditSummary.auditScorePercentage,!1,S??null)}}),[r.fetchState,r.selectedPeriod,r.monthEndCloseChecks?.auditSummary,r.monthEndCloseChecks?.reportEmailSentDate]),f.jsx(Jc,{children:f.jsx(ac,{monthEndCloseChecksView:r,isRealtimeInsightsFeatureEnabled:i,onMonthEndCheckClick:S=>{a(`./${S}/${p.month}-${p.year}`,{state:{pathnameStackToGoBack:_,message:"comingFromOverview",referrer:"Expense Automation - Overview"}})},onPeriodChange:T,handleReviewButtonClick:x,onBackClick:()=>{a("../../dashboard")},onReload:u,isAiCfoAccessEnabled:E,onAskAiCfoClick:w,aiAuditScorePercentageEnabled:d})})},Jc=be.div`
2
- display: flex;
3
- height: 100vh;
4
- width: 100%;
5
- flex: 1 1 auto;
6
- flex-direction: column;
7
- background-color: ${t=>t.theme.colors.grey4};
8
- `,Wc=Pn.memo((({reconciliation:t,selectedDrawerAccountId:a,onClose:b,onFetchLinkTokenClick:h,onEstablishConnectionClick:C})=>{const i=Se(),{useFeatureGate:d}=Ze(),{isFeatureEnabled:P}=d(H.isReconV3Enabled),{isFeatureEnabled:r}=d(H.isReconciliationCombinedStatementEnabled),E=et.getSignedInUser(),w=F((k=>Ue(k))),A=s.useMemo((()=>({userId:E?.userId??"",sessionId:E?.zeniSessionId??"",tenantId:w?.tenantId??""})),[E?.userId,E?.zeniSessionId,w?.tenantId]),{accountReconciliationsByAccountID:T,excludedAccountIDs:p,monthYearPeriod:u,statementUploadChosen:_}=t,x=T[a],g=s.useMemo((()=>$a(T,a)),[T,a]),S=s.useMemo((()=>Ga(T)),[T]),l=s.useMemo((()=>qa(T,a)),[T,a]),q=s.useRef(!1),N=s.useCallback((k=>{q.current=k,Cn(a,k)}),[a]),L=s.useCallback((k=>{i(mt({accountId:a,selectedPeriod:u,dismissedToBackground:!0,backgroundCompletedSteps:k.completedSteps,startedAtMs:k.startedAtMs,totalDurationSeconds:k.totalDurationSeconds})),k.accountMappings!=null&&i(Je({accountId:a,selectedPeriod:u,localData:{combinedStatementAccountMappings:k.accountMappings}})),x!=null&&requestAnimationFrame((()=>{q.current||i(ft({messageSection:"statement_parsing_in_progress",messageText:"success",type:"info",showStatusIcon:!0,variables:[{variableName:"_account_name_",variableValue:sc(x)}]}))}))}),[i,u,x,a]),z=s.useCallback((()=>{i(mt({accountId:a,selectedPeriod:u,dismissedToBackground:!1}))}),[i,a,u]),$=s.useCallback((k=>{i(nn({accountId:a,selectedPeriod:u,backgroundCompletedSteps:k}))}),[i,u,a]),G=s.useCallback((()=>{i(nn({accountId:a,selectedPeriod:u,backgroundCompletedSteps:0})),i(mt({accountId:a,selectedPeriod:u,dismissedToBackground:!1}))}),[i,u,a]);s.useEffect((()=>()=>{Cn(null,!1)}),[]);const e=x?.parsedStatementData?.statementUpload?.statementMeta?.statementUploadId??x?.accountReconEntity.statementMetaData?.statementUploadId,n=x?.statementDateConflict?.previousReconciliationInfo?.reconciledByUserId,c=F((k=>n!=null&&n!==""?Na(Ja(k.userState,n)):"")),m=s.useCallback((()=>{i(an({accountId:a,selectedPeriod:u}))}),[i,a,u]),I=s.useCallback((()=>{i(an({accountId:a,selectedPeriod:u})),i(We({statementUploadChosen:!0}))}),[i,a,u]),y=(k,Z)=>{i(cs(k,Z.split(".")[0]))},D=(k,Z)=>{if(Z===!0){const oe=x?.combinedStatementGroupId??x?.parsedStatementData?.statementUpload?.statementMeta?.combinedStatementGroupId??x?.parsedStatementData?.statementUpload?.combinedStatementDetails?.combinedStatementGroupId;if(oe!=null&&oe!=="")return void i(ss({accountId:a,selectedPeriod:u,combinedStatementGroupId:oe,fileId:k}))}e!=null&&i(os({accountId:a,selectedPeriod:u,fileId:k,statementUploadId:e}))},V=()=>{i(We({statementUploadChosen:!1}))},W=k=>{i(as({accountId:a,selectedPeriod:u,payload:k,statementAccountScope:r===!0?x?.localData?.statementAccountScope??"single_account":"single_account"}))},K=s.useCallback(((k,Z,oe)=>{i(Wa({accountId:k,selectedPeriod:Z,statementUploadId:oe}))}),[i]),se=s.useCallback(((k,Z,oe,ge,Ce)=>{Ce!=null&&Ce!==""&&i(Ya(Ce)),i(ge==null||ge===""?Ha({accountId:k,selectedPeriod:Z,statementUploadId:oe}):Qa({accountId:k,selectedPeriod:Z,statementUploadId:oe,combinedStatementGroupId:ge}))}),[i]),R=s.useCallback(((k,Z)=>{Z!==""&&i(Ka({accountId:a,selectedPeriod:u,statementUpdateLocalData:k,statementUploadId:Z}))}),[i,a,u]),Te=s.useCallback((()=>{e!=null&&i(x?.localData?.statementAccountScope!=="multi_account"?Xa({accountId:a,selectedPeriod:u,statementUploadId:e}):Za({accountId:a,selectedPeriod:u,statementUploadId:e}))}),[i,x?.localData?.statementAccountScope,a,u,e]),ue=s.useCallback((k=>{e!=null&&i(es({accountId:a,selectedPeriod:u,statementUploadId:e,accountMappings:k}))}),[i,u,a,e]),ye=s.useCallback((()=>{i(We({statementUploadChosen:!0}))}),[i]),J=k=>{i(Je({accountId:a,selectedPeriod:u,localData:{accountSource:k}}))},tt=k=>{i(Je({accountId:a,selectedPeriod:u,localData:{statementAccountScope:k}}))},Ee=s.useCallback((()=>{i(An({accountId:a}))}),[i,a]),X=s.useCallback((k=>{i(de(u,k,!0)),b()}),[i,u,b]),ie=s.useCallback((()=>{i(ts({accountId:a,selectedPeriod:u,statementProcessingFailed:!1})),i(ns({accountId:a,selectedPeriod:u}))}),[i,a,u]),ee=s.useCallback((()=>{i(xn({accountId:a}))}),[i,a]),ve=p.includes(a)?t.excludedAccountReconciliationByAccountID[a]:void 0;if(ve!=null)return f.jsx(Tn,{children:f.jsx(yn,{$isV3:P===!0,children:f.jsx(oc,{excludedAccountReconciliation:ve,includeAccountFetch:t.includeAccountFetchState,isReconV3Enabled:P,onDismissClick:b,onIncludeIntoReconciliation:ee})})});if(x!=null){const k=P===!0?f.jsx(cc,{excludeAccountFetch:t.excludeAccountFetchState,accountReconciliation:x,monthYearPeriod:u,onDismissClick:b,plaidConnectionDetails:t.plaidConnectionDetails,onFetchLinkTokenClick:h,onEstablishConnectionClick:C,onEditFileName:y,onDeleteFile:D,onSelectSourceType:J,onSelectStatementAccountScope:tt,isReconciliationCombinedStatementEnabled:r===!0,ledgerAccounts:g,statementOverrideWarningAccountIds:l,unavailableLedgerAccountIds:S,onConfirmStatementMapping:ue,filesEndPoint:Be.fileMicroServiceBaseUrl,authParams:A,openFilePicker:_,onStatementUploadSuccess:W,onUploadWindowOpenedOnce:V,onExcludeFromReconciliation:Ee,onRetryParsing:K,onFetchStatementParseInfo:se,onReviewClicked:X,statementProcessingFailed:x.statementProcessingFailed,statementProcessingDismissedToBackground:x.statementProcessingDismissedToBackground,onDismissStatementProcessingFailed:ie,onContinueInBackground:L,onClearStatementProcessingDismissedToBackground:z,onResetStatementProcessingProgress:G,onStatementProcessingProgressChange:$,onStatementFlowVisibilityChange:N,onReuploadStatement:ye,onStatementFormDataChange:R,onStatementConfirmSave:Te,reconciledByName:c,onDismissDateConflict:m,onReuploadAfterDateConflict:I,isReconV3Enabled:P}):f.jsx(ic,{excludeAccountFetch:t.excludeAccountFetchState,accountReconciliation:x,monthYearPeriod:u,onDismissClick:b,plaidConnectionDetails:t.plaidConnectionDetails,onFetchLinkTokenClick:h,onEstablishConnectionClick:C,onEditFileName:y,onDeleteFile:D,onSelectSourceType:J,filesEndPoint:Be.fileMicroServiceBaseUrl,authParams:A,openFilePicker:_,onStatementUploadSuccess:W,onUploadWindowOpenedOnce:V,onExcludeFromReconciliation:Ee});return f.jsx(Tn,{children:f.jsx(yn,{$isV3:P===!0,children:k})})}return null})),Tn=be.div`
9
- display: flex;
10
- flex-direction: column;
11
- height: 100%;
12
- `,yn=be.div`
13
- flex: 1;
14
- min-height: 0;
15
- display: flex;
16
- flex-direction: column;
17
- box-sizing: border-box;
18
- min-width: 0;
19
- overflow-x: hidden;
20
- overflow-y: ${t=>t.$isV3===!0?"hidden":"auto"};
21
- `;function Yc({panelType:t,scheduleId:a,onClose:b,onCloseAfterDecision:h}){return f.jsx(Hc,{children:f.jsx(Kc,{children:Qc(t,a,b,h)})})}function Qc(t,a,b,h){switch(t){case"one_time_accrual":return f.jsx(Oc,{isRenderedInPanel:!0,accrualIdOverride:a,onPanelNavigateBack:b});case"accrued_expenses":return f.jsx(Vc,{isRenderedInPanel:!0,scheduleDetailIdOverride:a,onPanelNavigateBack:b,onPanelCloseAfterDecision:h});case"fixed_assets":return f.jsx(Uc,{isRenderedInPanel:!0,scheduleDetailIdOverride:a,onPanelNavigateBack:b,onPanelCloseAfterDecision:h});case"prepaid_expenses":return f.jsx(Bc,{isRenderedInPanel:!0,scheduleDetailIdOverride:a,scheduleTypeOverride:"prepaid_expenses",onPanelNavigateBack:b,onPanelCloseAfterDecision:h})}}const Hc=be.div`
22
- display: flex;
23
- flex-direction: column;
24
- height: 100%;
25
- `,Kc=be.div`
26
- flex: 1;
27
- min-height: 0;
28
- display: flex;
29
- flex-direction: column;
30
- box-sizing: border-box;
31
- min-width: 0;
32
- overflow-x: hidden;
33
- overflow-y: auto;
34
- `,Zc=/^schedule\/(prepaid_expenses|fixed_assets|accrued_expenses|one_time_accrual)\/([^/?]+)$/,Xc=$c({displayNamePrefix:"withScheduleSidePanel",usePanelSetup:function(t){const a=(function(T=!0){const p=Tt(),u=Xe(),_=Se(),x=Ct(),g=zc({childPathPattern:Zc,enabled:T}),S=g.matchGroups[0],l=zn(S)?S:void 0,q=g.matchGroups[1]!=null&&g.matchGroups[1]!==""?g.matchGroups[1]:void 0,N=g.isOpen&&l!=null&&q!=null,L=x.tenantEmailDomain??u.pathname.split("/").find(Boolean)??"",z=s.useRef({isOpen:N,scheduleId:q});z.current={isOpen:N,scheduleId:q};const $=s.useCallback(((e,n,c)=>{c!=null&&(n==="prepaid_expenses"||n==="fixed_assets")&&_(_n({selectedJEScheduleKey:c})),!g.isMobile&&T?z.current.isOpen&&z.current.scheduleId===e?g.closePanel():g.navigateToChild(`schedule/${n}/${e}`,{replace:z.current.isOpen}):p(bn(n,e,L),{state:{message:"expenseAutomation",origin:"je_schedules"}})}),[_,p,g.isMobile,g.navigateToChild,g.closePanel,T,L]),G=s.useCallback((()=>{if(l==null||q==null)return;const e=ne(u.state?.pathnameStackToGoBack,u.pathname);p(bn(l,q,L),{state:{pathnameStackToGoBack:e,message:"expenseAutomation",origin:"je_schedules"}})}),[p,l,q,L,u.pathname,u.state]);return{closePanel:g.closePanel,isOpen:N,maximize:G,openPanel:$,panelType:N?l:void 0,scheduleId:N?q:void 0}})(t),b=s.useRef(null),[h,C]=s.useState(null),i=s.useMemo((()=>({registerPanelDirtyGuard:T=>{b.current=T}})),[]),d=s.useCallback((T=>{b.current?.isDirty()===!0?C((()=>T)):T()}),[]),P=s.useCallback((()=>{d(a.closePanel)}),[d,a.closePanel]),r=s.useCallback((()=>{d(a.maximize)}),[d,a.maximize]),E=s.useCallback(((T,p,u)=>{d((()=>a.openPanel(T,p,u)))}),[d,a.openPanel]),w=s.useMemo((()=>{if(h!=null)return{onCancel:()=>C(null),onDiscard:()=>{b.current=null,C(null),h()}}}),[h]),A=s.useMemo((()=>{if(a.isOpen&&a.panelType!=null&&a.scheduleId!=null)return f.jsx(lc.Provider,{value:i,children:f.jsx(Yc,{panelType:a.panelType,scheduleId:a.scheduleId,onClose:P,onCloseAfterDecision:()=>{b.current=null,a.closePanel()}},`${a.panelType}:${a.scheduleId}`)})}),[a.isOpen,a.panelType,a.scheduleId,a.closePanel,P,i]);return{injectedProps:s.useMemo((()=>({closeSchedulePanel:P,isSchedulePanelOpen:a.isOpen,openSchedulePanel:E,schedulePanelContent:A,schedulePendingDiscardConfirmation:w})),[P,E,A,w,a.isOpen]),selectedItemId:a.scheduleId,sidePanel:{closePanel:P,maximize:r}}}});function ei({companyId:t,closeCustomerRequestDrawer:a,addCustomerRequest:b,resetCustomerRequest:h}){const C=et.getSignedInUser();if(C==null)throw Error("Can't access Customer Request page without signing in...");const i=F((d=>is(d,t,C)));return s.useEffect((()=>{h()}),[]),f.jsx(f.Fragment,{children:i.fetchState==="In-Progress"||i.companyMonthEndReportTemplatesData.fetchState==="In-Progress"?f.jsx(jn,{fetchState:"In-Progress"}):f.jsx(rc,{onCloseClick:a,addCustomerRequest:b,snippets:i.companyMonthEndReportTemplatesData,bulletPoints:i.zeniRequestsData??[]})})}const ti={schedules:"Review Schedules",existing_schedules:"Existing Schedules"},ni=()=>{const t=F((w=>Fe(w))),a=Xe(),{currentSelectedViewFetchState:b,currentSelectedView:h,selectedPeriod:C}=t,i=Qe(h),d=Qe(b.fetchState),P=t.jeSchedules.uiState.selectedPageTab??"schedules",r=Qe(P),E=s.useCallback((w=>{const A=a.state?.referrer;h==="transaction_categorization"&&(t.selectedTransactionCategorizationTab==="review"?Y.trackTransactionsReviewPage(C.month,C.year,t.transactionView.totalCountByTab.review,0,w,A??null):Y.trackTransactionsAutoCategorisedPage(C.month,C.year,t.transactionView.totalCountByTab.autoCategorized,0,w,A??null)),h==="missing_receipts"&&Y.trackMissingReceiptsPage(C.month,C.year,w,t.missingReceipts.transactions.length,A??null),h==="je_schedules"&&Y.trackMonthCloseScheduleListPage(C.month,C.year,w,t.jeSchedules.pendingReviewSchedules.length,t.jeSchedules.resolveSchedules.length,(T=>{const p={accruedCount:0,fixedAssetsCount:0,oneTimeAccrualCount:0,prepaidCount:0};return T.forEach((u=>{if(ls(u))p.oneTimeAccrualCount+=1;else switch(rs(u)){case"prepaid_expenses":p.prepaidCount+=1;break;case"fixed_assets":p.fixedAssetsCount+=1;break;case"accrued_expenses":p.accruedCount+=1}})),p})(t.jeSchedules.pendingReviewSchedules),ti[P],A??null),h==="flux_analysis"&&Y.trackFluxAnalysisPage(C.month,C.year,w,ai(t.fluxAnalysis),A??null),h==="month_end_insights"&&t.auditSummary?.auditScorePercentage!=null&&Y.trackInsightsEmailPage(C.month,C.year,w,"draft",t.auditSummary.auditScorePercentage,null,A??null)}),[C,t,P]);return s.useEffect((()=>{(d!==b.fetchState||h!==i||h==="je_schedules"&&r!=null&&P!==r)&&b.fetchState==="Completed"&&E(!1)}),[h,b.fetchState,i,P,r]),E},ai=t=>t.sections.generalExpense.vendors.length+t.sections.reimbursement.vendors.length,{common:{strings:{hyphen:si,comma:En,space:oi}},dateFormat:$n}=dc.getLocalizedStrings(),vn=nc,ci=Va((function(t,a){const{uncategorizedAccounts:b,vendorSearchAutoCompleteData:h,monthEndInsightsCustomerRequestData:C,monthEndInsightsPreviewMode:i,companyId:d,isMissingReceiptsBulkUploadEnabled:P,isTransactionActivityEnabled:r,newScheduleActiveType:E}=a,w=et.getSignedInUser(),A=t.tenantState.currentTenantId,T={userId:w?.userId??"",sessionId:w?.zeniSessionId??"",tenantId:A??""},p=Fe(t),{selectedTransactionCategorizationTab:u}=p,{searchTransactionsResults:_,searchTransactionsFetchState:x}=Ss(t),g=E==="prepaid_expenses"?"prepaid_expenses":"fixed_assets",{accountListNestedAccountHierarchy:S,classListNestedAccountHierarchy:l,allDepreciationAccountListNestedAccountHierarchy:q,newScheduleLocalData:N,saveStatus:L}=gs(t,g);return{expenseAutomationViewSelector:p,accountListNestedAccountHierarchy:S,allDepreciationAccountListNestedAccountHierarchy:q,baseTransactionSearchFetchState:x,baseTransactionSearchResults:_,classListNestedAccountHierarchy:l,newScheduleLocalData:N,initialSelectedBaseTransaction:N.selectedBaseTransactionId!=null?Cs(t.transactionState,fs(N.selectedBaseTransactionId)):void 0,newAccrualAccountsView:Is(t),newScheduleSaveStatus:L,bulkUploadSelector:P===!0?p.missingReceipts.bulkUpload:void 0,vendorSearchAutoCompleteData:h,authParams:T,receiptUploadEndpoint:`${Be.accountMicroServiceBaseUrl}`,transactionAttachmentsEndpoint:`${In}/transaction_attachments`,bulkUploadEndpoint:P===!0?`${Be.communicationAgentMicroServiceBaseUrl}/1.0/receipts/bulk-upload`:void 0,isDisabled:!1,currentTab:u,selectedTransactionGroup:p.transactionView.selectedTransactionGroup,monthEndInsightsCustomerRequestData:C,monthEndInsightsPreviewMode:i,allThreadsSectionOpen:!1,enableMonthEndInsightsZeniGPTFeature:!1,loggedInUser:w,uncategorizedAccounts:b,companyId:d,isTransactionActivityEnabled:r,receiptsEmail:bs(t.tenantState,A),downloadParams:{authParams:T,jeScheduleEndPoint:`${In}/jeScheduleReports`,timezone:ks(),companyName:Ue(t).companyName}}}),(function(t,a){const{themeState:b,isAccountingClassesEnabled:h,isCOTEnabled:C,isMissingReceiptsBulkUploadEnabled:i,location:d,vendorSearchAutoCompleteData:P,expenseAutomationViewSelector:r,currentTenant:E,newScheduleActiveType:w,uncategorizedAccounts:A,navigate:T,onClickCustomerRequest:p,handleEditClick:u,closeSchedulePanel:_,isSchedulePanelOpen:x,openSchedulePanel:g,setActivityLogTransactionId:S}=a,{selectedPeriod:l,currentSelectedView:q,reconciliation:{selectedAccountId:N}}=r,{accountSettingsView:L}=r.jeSchedules,z=Fn(l),$=Ke(z.start),G=Ke(z.end);return{onZeniLogoClick:()=>{b.toggle()},onUploadReceiptAttachment:e=>{Y.trackMissingReceiptAttached(l.month,l.year),t(xo(e))},onUploadTransactionReceipt:(e,n,c,m,I,y)=>{t(mn(e,n,{fetchState:"In-Progress"}));const D=()=>t(mn(e,n,{fetchState:"Error"}));pc(`${Be.accountMicroServiceBaseUrl}/1.0/transactions/${n}/attachments`,y,n,c,m,I).then((V=>{V!=null?t(Ao(e,V)):D()})).catch(D)},onMissingReceiptsRowClick:(e,n)=>{if(a.openTransactionPanel)return void a.openTransactionPanel(e,n);const c=ne(d.state?.pathnameStackToGoBack,d.pathname);T(`../../transaction/${n}/${e}`,{state:{pathnameStackToGoBack:c,message:"expenseAutomation",origin:"missing_receipts"}})},onUploadReceiptComplete:(e,n)=>{t(Po(e,n)),E!=null&&t(_e({tenantId:E.tenantId,period:n,refreshViewInBackground:!0}))},onUploadReceiptFetchStatus:(e,n,c,m)=>{t(vo(e,{fetchState:n,error:c})),c!=null&&t(ft({messageSection:"missing_receipts_attachment",messageText:"failed",type:"error",showStatusIcon:!0,variables:[{variableName:"__message__",variableValue:m!=null?oi+si+m+En:En}]}))},onUpdateJESchedulesUIState:e=>{const n=r.jeSchedules.uiState,c=e.selectedPageTab!=null&&e.selectedPageTab!==n.selectedPageTab,m=e.selectedJETypeFilter!==void 0&&e.selectedJETypeFilter!==n.selectedJETypeFilter;x===!0&&(c||m)&&_?.(),e.createdGroupCollapsed!=null?t(bo()):e.pendingGroupCollapsed!=null?t(To()):e.selectedJETypeFilter!==void 0?t(yo(e.selectedJETypeFilter)):t(Eo(e))},onUpdateMissingReceiptsUIState:e=>{t(ko(e))},onFetchMissingReceiptsList:()=>{G!=null&&$!=null&&t(Un({start:$,end:G},{amount:75,currencyCode:"USD",currencySymbol:"$"},!0,!1))},...i===!0?{onBulkUploadFiles:e=>{t(tc(e))},onBulkUploadProgress:e=>{t(ec(e))},onBulkUploadSuccess:e=>{t(Xo({batchId:e}))},onBulkUploadUploadedFileCount:e=>{t(Zo(e))},onConfirmBulkUploadMatch:(e,n,c,m,I)=>{t(Ko(e,n,c,m,I))},onBulkUploadConfirmMatchAcknowledged:()=>{t(Ho())},onSetBulkUploadResultsTab:e=>{t(Qo(e))},onSetBulkUploadCompletedSubTab:e=>{t(Yo(e))},onSetBulkUploadSortConfig:(e,n)=>{t(gn({sortKey:e,sortOrder:n}))},onClearBulkUpload:()=>{t(Wo())},onSearchTransactionsForManualMatch:(e,n)=>{t(vn(e,n??void 0))},onLoadMoreManualSearch:()=>{const{manualSearch:e}=r.missingReceipts.bulkUpload;e.nextPageToken!=null&&e.searchQuery!==""&&t(vn(e.searchQuery,e.nextPageToken))},onFetchCompletedTransactions:(e,n)=>{t(Jo(e,n))},onClearBulkUploadBatchDetailsForScopeChange:()=>{t(No())},onFetchBulkUploadBatches:e=>{t(Vn(e))},onFetchMoreBatchDetails:()=>{t(qo())},onResetBulkUploadSort:()=>{t(gn({sortKey:void 0,sortOrder:void 0}))}}:{},onClearMissingReceiptsTabNavigation:()=>{t(Io())},onSearchTextChanged:e=>{const n=r.currentSelectedView,c=r.selectedTransactionCategorizationTab;n==="transaction_categorization"&&(t(pt({selectedTab:c,uiState:{searchString:e}})),G!=null&&$!=null&&t(he(c,{start:$,end:G},!0,!1,e,void 0,!1,!0)))},onFiltersChange:e=>{const n=r.selectedTransactionCategorizationTab;t(fo({filters:e,selectedTab:n}))},onRefresh:()=>{a.trackExpenseAutomationTabAnalytics(!0),t(Co())},onClose:()=>{q==="reconciliation"&&N!=null&&t(un({selectedAccountId:void 0})),T("../")},onBack:()=>{q==="reconciliation"&&N!=null&&t(un({selectedAccountId:void 0}))},onSaveReconciliation:e=>{t(go(e))},onSaveReconciliationReview:e=>{t(So(e))},onUpdateStep:e=>{const{selectedPeriod:n}=r,c=ne(d.state?.pathnameStackToGoBack,d.pathname);T(`../${e}/${n.month}-${n.year}`,{state:{pathnameStackToGoBack:c,referrer:r.currentSelectedView}}),t(Bn(e))},handleLogOutClick:()=>{const e=ne(d.state?.pathnameStackToGoBack,d.pathname);T("/signout",{replace:!0,state:{pathnameStackToGoBack:e,message:"logout"}})},onJeAccountSettingsChange:e=>{const{vendorsAccountSection:n}=e,{prepaidExpensesAccount:c,fixedAssetsAccount:m,accruedExpensesAccount:I}=n,y=ht(L.prepaidExpensesAccountList,c.selectedOptions),D=ht(L.fixedAssetsAccountList,m.selectedOptions),V=ht(L.accruedExpensesAccountList,I.selectedOptions),W={selectedPrepaidExpensesAccountIds:y.map((K=>K.accountId)),selectedFixedAssetsAccountIds:D.map((K=>K.accountId)),selectedAccruedExpensesAccountIds:V.map((K=>K.accountId))};t(ho({data:W}))},onSaveJeAccountSettingsClick:()=>{t(po())},onJESchedulesFormDataChange(e,n){const{jeScheduleID:c,accumulatedDepreciationCategory:m,scheduleClass:I,scheduleExpenseCategory:y,vendor:D}=n,{allAccountList:V,allClassList:W,allDepreciationAccountList:K}=r.jeSchedules,se=P.entityAutoCompleteView.vendor.length>0?P.entityAutoCompleteView.vendor.find((J=>J.id===D?.selectedOption)):void 0,R={id:se?.zeniId??D?.selectedOption??"",name:se?.name??D?.defaultOptions.find((J=>J.value===D?.selectedOption))?.label??"",logo:se?.logo},Te=y?.selectedOption!=null?V.find((J=>J.qboId===y.selectedOption)):void 0,ue=I?.selectedOption!=null?W.find((J=>J.classId===I.selectedOption)):void 0,ye=m?.selectedOption!=null?K.find((J=>J.qboId===m.selectedOption)):void 0;t(mo({scheduledJournalEntryID:e,localData:{jeScheduleID:c,scheduledJournalEntryID:e,updatedCategoryId:Te?.accountId,updatedClassId:ue?.classId,updatedAccumulatedDepreciationCategoryID:ye?.accountId,updatedVendor:{id:R.id,name:R.name}}}))},onRevertJeSchedule(e,n,c,m,I){t(uo(e,n,c,m,I))},ignoreRecommendedJeSchedule(e,n,c,m){t(ro(e,n,c,m))},vendorSearchAutoCompleteActions:{onAutoCompleteInputChange:(e,n)=>{e.trim().length>=2?t(on({searchString:e,entityType:n,searchOrigin:"common"})):e.trim().length===0&&t(Ne("common"))},onCancelAutoComplete:()=>{t(Ne("common"))}},onPostJESchedule(e,n){t(lo({scheduledJournalEntryID:e,jeScheduleTransactionKey:n}))},clearJeScheduleLocalData(){t(io())},onViewTransaction(e){if(a.tenantEmailDomain==null)return;const n=Lc(e,a.tenantEmailDomain),c=ne(a.location.state?.pathnameStackToGoBack,`${a.location.pathname}${a.location.search}`);a.navigate(n,{state:{pathnameStackToGoBack:c,message:"expenseAutomation",origin:"je_schedules"}})},onSearchBaseTransaction(e){t(co({query:e,scheduleType:w==="prepaid_expenses"?"prepaid_expenses":"fixed_assets"}))},onNewScheduleFormChange(e,n){const c=bt(e)==="prepaid_expenses"?"prepaid_expenses":"fixed_assets";t(dn({scheduleType:c,localData:n}))},onSaveSchedule(e,n){const c=e==="prepaid_expenses"?"prepaid_expenses":"fixed_assets",{allAccountList:m,allDepreciationAccountList:I}=r.jeSchedules,y=n.selectedAccount!=null?m.find((V=>V.qboId===n.selectedAccount)):void 0,D=n.selectedAccumulatedDepreciationCategory!=null?I.find((V=>V.qboId===n.selectedAccumulatedDepreciationCategory)):void 0;t(dn({scheduleType:c,localData:{...n,selectedAccount:y?.accountId,selectedAccumulatedDepreciationCategory:D?.accountId}})),t(oo({scheduleType:c}))},onCreateAccruedSchedule(e){const n="accrued_expenses";t(eo()),t(to()),t(no({scheduleType:n,localData:e,selectedJeScheduleDetailId:void 0})),t(ao({scheduleType:n})),t(so(n,void 0))},onCreateOneTimeAccrual(e){t(Xs(e))},handleJeScheduleClick:(e,n,c)=>{if((function(I,y){return y!=="accrued_expenses"})(0,c)&&t(_n({selectedJEScheduleKey:n})),g!=null&&zn(c))return void g(e,c,n);const m=ne(d.state?.pathnameStackToGoBack,d.pathname);T(`../../vendors/schedules/${c}/details/${e}`,{state:{pathnameStackToGoBack:m,message:"expenseAutomation",origin:"je_schedules"}})},onOneTimeAccrualFeedback:(e,n,c,m)=>{t(n!=="revert"?Zs(e,c,m):Ks(e,c,m))},onOneTimeAccrualClick:e=>{if(g!=null)return void g(e,"one_time_accrual");const n=ne(d.state?.pathnameStackToGoBack,d.pathname);T(`../../vendors/schedules/one_time_accrual/details/${e}`,{state:{pathnameStackToGoBack:n,message:"expenseAutomation",origin:"je_schedules"}})},improveMonthEndInsightsUsingZeniGPTClick:e=>{E!=null&&t(Hs(e,E.companyId,E.tenantId))},onClickCustomerRequest:p,setActivityLogTransactionId:S,onCloseAllThreadsSection:()=>{},onCloseFileAttachmentSnackBar:()=>{t(Qs())},onOpenFileAttachmentSnackBar:()=>{t(ft({messageSection:"cockpit_month_end_email_attachment_upload",messageText:"failed",type:"error",showStatusIcon:!0}))},onRemoveFileAttachment:e=>{t(Ys(e))},onUpdateFileAttachment:e=>{t(Ws({files:e}))},previewMonthEndReport:(e,n,c,m,I)=>{E!=null&&t(rn(e,E.companyId,n,!0,c,m,{agentInsightEdits:I,tenantId:E.tenantId}))},saveMonthEndReport:(e,n,c,m,I)=>{E!=null&&t(rn(e,E.companyId,n,!1,c,m,{agentInsightEdits:I,tenantId:E.tenantId}))},onEditMonthEndInsightsClick:u,sendMonthEndReport:e=>{const n=d.state?.referrer,{selectedPeriod:c,auditSummary:m}=r;E!=null&&m?.auditScorePercentage!=null&&(t(Ns(E.companyId,e,E.tenantId)),Y.trackInsightsEmailPage(c.month,c.year,!1,"draft",m.auditScorePercentage,Js().format($n.analytics.MMMDDCommaYYYYformat),n??null))},onTransactionCategorizationRowClick:(e,n)=>{const c=r.transactionView.uiState.searchString??"",m=r.transactionView.transactions,I=m.findIndex((V=>V.id===e)),y=c.length>0?{resultPosition:I>=0?I+1:void 0,resultsCount:m.length,searchTerm:c}:void 0;if(a.openTransactionPanel)return void a.openTransactionPanel(e,n,y);const D=ne(d.state?.pathnameStackToGoBack,d.pathname);T(`../../transaction/${n}/${e}`,{state:{pathnameStackToGoBack:D,message:"expenseAutomation",origin:"transaction_categorization",searchContext:y}})},setLocalDataForCategoryAndClass:(e,n,c,m,I,y,D,V,W,K,se,R)=>{t(qs(e,n,c,m,A,I,y,D,V,W,K,se,R))},onCancelAutoComplete:()=>{t(Ne("common"))},updateExpenseAutomationReconListScrollPosition:e=>{t(cn({scrollPosition:e}))},onUpdateTab:e=>{a.closeSidePanel?.(),G!=null&&$!=null&&(t(he(e,{start:$,end:G},!1,!1)),t(Gs(e)))},onUpdateTransactionCategorizationCompletedSubTab:e=>{a.closeSidePanel?.(),G!=null&&$!=null&&(t($s(e)),t(he("autoCategorized",{start:$,end:G},!1,!1)))},onTransactionGroupChange:e=>{a.closeSidePanel?.(),G!=null&&$!=null&&(t(zs(e)),t(he(a.expenseAutomationViewSelector.selectedTransactionCategorizationTab,{start:$,end:G},!1,!1)))},onUpdateTransactionCategorizationUIState:(e,n)=>{t(pt({selectedTab:e,uiState:n})),G!=null&&$!=null&&t(he(e,{start:$,end:G},!1,!1,n.searchString,null,!0))},onUpdateScrollYOffSetTransactionCategorizationUIState:(e,n)=>{t(pt({selectedTab:e,uiState:n}))},onFetchTransactionCategorizationList:(e,n,c,m,I,y)=>{G!=null&&$!=null&&t(he(e,{start:$,end:G},!0,c,n,m,I,y))},resetTransactionCategorizationLocalData:(e,n,c,m,I,y,D)=>{t(Ls(e,n,c,m,D??null,I,y,!1)),xc(t,n.map(String))},updateSelectedVendorForTransaction:(e,n,c,m,I)=>{t(ln({selectedTab:e,transactionId:n,lineId:c,selectedTransaction:m,uncategorizedAccounts:A,updatedVendor:I,isAccountingClassesEnabled:h}))},onSaveUpdateTransactionCategorization:(e,n,c)=>{const m=d.state?.referrer;e==="autoCategorized"?Y.trackTransactionsAutoCategorisedPage(l.month,l.year,r.transactionView.totalCountByTab.autoCategorized,n.length,!1,m??null):Y.trackTransactionsReviewPage(l.month,l.year,r.transactionView.totalCountByTab.review,n.length,!1,m??null),t(js(e,n,c)),Ac(n.map(String))},onUpdateSelectedCheckboxTransactionIds:(e,n)=>{t(Ms({selectedTab:e,transactionIds:n}))},onFetchRecommendationsForEntityCategorizationWithCustomer:(e,n,c,m,I,y)=>{const{transactionId:D,transaction:V,lineIds:W}=n;y!=null&&t(Vs({transactionId:D,customerUpdates:y})),t(Os({selectedTab:m,transactionId:D.id,lineId:W[0],selectedTransaction:V,uncategorizedAccounts:A,updatedCustomer:y,selectedEntity:I,isAccountingClassesEnabled:h})),I!=null&&t(kt({entity:I,amount:e,transactionDetails:n,flowType:"categorization",selectedTab:m,isFetchCOT:C}))},onFetchRecommendationsForEntityCategorization:(e,n,c,m,I,y)=>{const{transactionId:D,transaction:V,lineIds:W}=n;y!=null&&(t(Fs({transactionId:D,vendorUpdates:{name:y.name,id:y.id?y.id:void 0}})),t(Bs({vendorId:y.id?y.id:void 0,localData:{vendorName:y.name,vendorId:y.id?y.id:void 0}}))),y?.id?(t(ln({selectedTab:m,transactionId:D.id,lineId:W[0],selectedTransaction:V,uncategorizedAccounts:A,updatedVendor:y,selectedEntity:I,isAccountingClassesEnabled:h})),I!=null&&t(kt({entity:I,amount:e,transactionDetails:n,flowType:"categorization",selectedTab:m,isFetchCOT:C}))):t(Us({selectedTab:m,transactionId:D.id,lineId:W[0]}))},fetchFluxViewOnScroll:(e,n)=>{t(Ye(e,!0,!1,n,!1,!0))},onFetchFluxViewList:()=>{t(Ye(l,!0,!1,null,!1,!1))},markAsReview:(e,n,c,m)=>{Y.trackFluxAnalysisReviewed(c.month,c.year,m??!1,e),t(_s(n,e,c,m??!1))},onUpdateFluxAnalysisUIState:e=>{t(Rs(e))},updateOperatingExpensesIdsForReview:e=>{t(Ds({operatingExpenseIds:e,selectedPeriod:l}))},redirectToVendorDetailPage:e=>{if(a.tenantEmailDomain!=null){const n=jc(e.id,e.qboId,a.tenantEmailDomain),c=ne(a.location.state?.pathnameStackToGoBack,a.location.pathname);a.navigate(n,{state:{pathnameStackToGoBack:c,message:"expenseAutomation",referrer:"Vendor List",origin:"flux_analysis"}})}},updateSectionIdsForReview:e=>{t(ws({sectionId:e,selectedPeriod:l}))},onFetchReimbursementView:(e,n,c)=>{t(Ye(e,!0,!1,n,!0,c))},onReviewClicked:e=>{t(de(l,e))},setOpenDrawerClicked:e=>{t(He({selectedDrawerAccountId:e}))},onFetchLinkTokenClick:(e,n)=>{t(wn("expense_automation_reconcile",e,n))},onEstablishConnectionClick:(e,n)=>{const c=E?.companyId;c!=null&&(t(Dn(e,c,"expense_automation_reconcile",void 0,"link_account_no_microdeposit",n)),t(Rn({accountId:n,connectionInProgress:!0})))},onAddStatementClick:e=>{t(He({selectedDrawerAccountId:e})),t(Je({accountId:e,selectedPeriod:l,localData:{accountSource:"bank_statement"}})),t(We({statementUploadChosen:!0}))},onReloadReconciliationListPage:()=>{t(de(l,void 0,!0,!1))},onUpdateReconcileTabLocalData:e=>{t(xs({selectedTransactionIds:e}))},onReconTabColumnSortConfigChanged:(e,n)=>{t(As({sortKey:e,sortOrder:n}))},onReconReviewTabColumnSortConfigChanged:(e,n)=>{t(Ps({sortKey:e,sortOrder:n}))},onReconTabUpdate:e=>{a.closeSidePanel?.(),t(vs({selectedTab:e}))},updateReconReviewTabLocalData:(e,n,c)=>{const m=e.vendor?.id;c&&m!=null&&t(ys(m)),t(Es({data:e,transactionId:n}))},onReconMatchedTransactionClick:e=>{if(a.openTransactionPanel)return void a.openTransactionPanel(e,It("bill"));const n=ne(d.state?.pathnameStackToGoBack,d.pathname);T(`../../transaction/bill/${e}`,{state:{pathnameStackToGoBack:n,message:"expenseAutomation",origin:"reconciliation"}})},onReloadPage:()=>{window.location.reload()},onBackClick:()=>{T(-1)},onReconListPageScroll:e=>{t(cn({scrollPosition:e}))},onVendorAutoCompleteInputChange:e=>{e.trim().length>=2?t(on({searchString:e,searchOrigin:"common"})):e.trim().length===0&&t(Ne("common"))},onReconNodeCollapseToggled:(e,n)=>{t(Ts({nodeId:e,collapsed:n}))},updateSectionCollapseStatus:()=>{},onExcludeAccountFromReconciliation:e=>{t(An({accountId:e}))},onIncludeAccountIntoReconciliation:e=>{t(xn({accountId:e}))}}}),((t,a,b)=>{const{isMissingReceiptsBulkUploadEnabled:h,...C}=b;return(function(i,d,P){return{...i,...d,...P,onUploadTransactionReceipt:(r,E,w,A,T)=>{d.onUploadTransactionReceipt(r,E,w,A,T,i.authParams)}}})(t,a,C)}))(uc(mc)),St="newScheduleMode",gt="newScheduleType",ii=Xc(Gc((function(t){const a=t.displayName??t.name??"Component",b=Pn.memo(t),h=C=>{const i=Se(),d=(function(){const g=Se(),S=F((l=>Fe(l).reconciliation.selectedDrawerAccountId));return{isOpen:S!=null,selectedAccountId:S,openPanel:s.useCallback((l=>{g(He({selectedDrawerAccountId:l}))}),[g]),closePanel:s.useCallback((()=>{g(He({selectedDrawerAccountId:void 0}))}),[g])}})(),P=F((g=>Fe(g).reconciliation)),r=F((g=>Ue(g))),E=s.useCallback(((g,S)=>{i(wn("expense_automation_reconcile",g,S))}),[i]),w=s.useCallback(((g,S)=>{const l=r?.companyId;l!=null&&(i(Dn(g,l,"expense_automation_reconcile",void 0,"link_account_no_microdeposit",S)),i(Rn({accountId:S,connectionInProgress:!0})))}),[i,r?.companyId]),A=s.useMemo((()=>{if(d.isOpen&&d.selectedAccountId!=null)return f.jsx(Wc,{reconciliation:P,selectedDrawerAccountId:d.selectedAccountId,onClose:d.closePanel,onFetchLinkTokenClick:E,onEstablishConnectionClick:w})}),[d.isOpen,d.selectedAccountId,d.closePanel,P,E,w]),T=s.useMemo((()=>({reconPanelContent:A,reconSidePanelIsOpen:d.isOpen,closeReconSidePanel:d.closePanel})),[A,d.isOpen,d.closePanel]),{useFeatureGate:p}=Ze(),{isFeatureEnabled:u}=p(H.isReconV3Enabled),_=s.useContext(fn),x=s.useMemo((()=>d.isOpen?u===!0?{selectedItemId:d.selectedAccountId}:{closePanel:d.closePanel,selectedItemId:d.selectedAccountId}:_),[d.isOpen,d.closePanel,d.selectedAccountId,_,u]);return f.jsx(fn.Provider,{value:x,children:f.jsx(b,{...C,...T})})};return h.displayName=`withReconSidePanel(${a})`,h})((({closeSidePanel:t,openTransactionPanel:a,panelContent:b,sidePanelIsFullView:h,sidePanelIsOpen:C,reconPanelContent:i,reconSidePanelIsOpen:d,closeReconSidePanel:P,isSchedulePanelOpen:r,closeSchedulePanel:E,openSchedulePanel:w,schedulePanelContent:A,schedulePendingDiscardConfirmation:T})=>{const{isAiCfoOpen:p,setIsAiCfoOpen:u}=hc(),_=Sc(),{isOpen:x}=gc(),g=Tt(),S=Xe(),l=Se(),{isAiCfoAccessEnabled:q,onAskAiCfoClick:N}=Ln({mobileExploreReferrer:"Transaction categorization"}),L=s.useCallback((()=>{C===!0&&h!==!0&&t?.()}),[t,C,h]),{areTenantIdsInSync:z}=On(),$=ni(),G=Cc(),[e,n]=s.useState(!1),[c,m]=Oa(),I=s.useCallback((o=>{m((v=>{const j=new URLSearchParams(v);return o==null?(j.delete(St),j.delete(gt),j):(j.set(St,o.scheduleDetailsMode),j.set(gt,o.scheduleType),j)}),{replace:!0})}),[m]),[y,D]=s.useState(void 0),V=s.useCallback(((o,v,j)=>{const M=bt(o);D(M),I({scheduleDetailsMode:v,scheduleType:o}),l(pn({scheduleType:M==="prepaid_expenses"?"prepaid_expenses":"fixed_assets",shouldResetEnteredData:j}))}),[l,I]),W=s.useMemo((()=>{const o=c.get(St),v=c.get(gt);return o!=null&&v!=null?{scheduleDetailsMode:o,scheduleType:v}:void 0}),[c]),K=s.useCallback((o=>{I(o),o!=null&&l(pn({scheduleType:bt(o.scheduleType)==="prepaid_expenses"?"prepaid_expenses":"fixed_assets",shouldResetEnteredData:!0}))}),[l,I]),se=F((o=>sn(o))),R=F((o=>Ue(o))),[Te,ue]=s.useState(!1),[ye,J]=s.useState(!1),[tt,Ee]=s.useState([]),[X,ie]=s.useState(null),ee=s.useCallback((()=>{ie(null)}),[]),ve=X?.contentType==="activity"?X.detail.transactionId:void 0,k=s.useCallback((o=>{o!=null?(p&&u(!1),_(),L(),ie({contentType:"activity",detail:{transactionId:o}})):ie((v=>v?.contentType==="activity"?null:v))}),[L,p,_,u]),Z=s.useCallback((o=>{p&&u(!1),_(),L(),ie({contentType:"transfer",detail:o})}),[L,p,_,u]),oe=s.useCallback((()=>{_(),ee(),L(),N()}),[L,ee,N,_]),ge=s.useRef(p);s.useEffect((()=>{p===!0&&ge.current===!1&&(_(),ee(),L()),ge.current=p}),[L,ee,p,_]);const Ce=s.useRef(x);s.useEffect((()=>{x===!0&&Ce.current===!1&&(p&&u(!1),ee(),C===!0&&h!==!0&&t?.()),Ce.current=x}),[ee,t,x,p,u,h,C]);const Ve=C===!0&&h!==!0,yt=s.useRef(Ve);s.useEffect((()=>{Ve&&!yt.current&&(p&&u(!1),_(),ee()),yt.current=Ve}),[ee,p,Ve,_,u]);const[Et,Gn]=s.useState(!1),vt=s.useRef(!1),{selectedTab:Pt}=Ct(),{tenantEmailDomain:nt}=Ct(),[at,At]=s.useState(S.state?.message==="comingFromTransactionDetail"),xt=S.state?.message==="comingFromOverview",qn=fc(),st=et.getSignedInUser(),{useFeatureGate:ce}=Ze(),{isFeatureEnabled:wt}=ce(H.isRealtimeInsightsFeatureEnabled),{isFeatureEnabled:Pe}=ce(H.isMissingReceiptsBulkUploadEnabled),{isFeatureEnabled:ot}=ce(H.isTransactionActivityEnabled),{isFeatureEnabled:Nn}=ce(H.isAccrualEnabled),{isFeatureEnabled:Dt}=ce(H.isCreateTransferEntryFromExpenseEnabled),{isFeatureEnabled:Jn}=ce(H.isExpenseAutomationCommentingEnabled),{isFeatureEnabled:Wn}=ce(H.isProjectsTransactionsEnabled),{isFeatureEnabled:Yn}=ce(H.isReconV3Enabled),Qn=s.useCallback((o=>{const v=It(o.transactionType??(o.view==="reconciliation"?"bill":"expense")),j=ne(S.state?.pathnameStackToGoBack,S.pathname),M=new URLSearchParams({view:"full"});o.threadId!=null&&M.set("thread_id",o.threadId),o.entityType!=null&&M.set("entity_type",o.entityType),g(`/${nt}/transaction/${encodeURIComponent(v)}/${o.transactionId??o.entityId}?${M.toString()}`,{state:{pathnameStackToGoBack:j,message:"expenseAutomation"}})}),[g,nt,S.state,S.pathname]),Hn=F((o=>wo(o,"common"))),O=F((o=>Fe(o))),{categoryOptions:Kn,paymentAccountNames:Zn}=F((o=>Do(o.accountState))),Xn=F((o=>Ro(o.classState))),{monthEndCloseChecksView:Q,currentSelectedView:B,selectedPeriod:U,selectedTransactionCategorizationTab:ct,currentSelectedViewBackgroundRefreshFetchState:ea,currentSelectedViewFetchState:le,jeSchedules:it,reconciliation:Rt}=O;wc(B==="transaction_categorization");const ta=O.transactionView.saveStatus.fetchState,Oe=O.transactionView.transactions,_t=s.useRef(Oe);_t.current=Oe;const Ft=F((o=>o.expenseAutomationTransactionsViewState?.transactionCategorizationView)),Bt=F((o=>o.expenseAutomationTransactionsViewState?.selectedTransactionCategorizationTab)),Ut=s.useRef(Ft);Ut.current=Ft;const Vt=s.useRef(Bt);Vt.current=Bt;const Me=F((o=>{const v=o.expenseAutomationTransactionsViewState?.selectedTransactionCategorizationTab;return v!=null?o.expenseAutomationTransactionsViewState?.transactionCategorizationView?.[v]?.filters:void 0})),Ot=s.useRef("");s.useEffect((()=>{if(B!=="transaction_categorization")return;const o=O.transactionView.uiState.searchString??"";if(le.fetchState!=="Completed"||o.length===0||o===Ot.current)return;Ot.current=o;const v=Me!=null?Ic(Me):0,j=Me?.categories.filter((M=>M.values.length>0&&String(M.values[0]??"").trim()!=="")).map((M=>`${M.field}:${M.values.join(",")}`))??[];Y.trackAiCloseTransactionSearch({filtersApplied:j,hasResults:Oe.length>0,isFiltered:v>0,resultsCount:Oe.length,searchTerm:o,searchType:"free_text"})}),[B,le.fetchState,O.transactionView.uiState.searchString,O.transactionView.transactions,Me]);const re=Dc(ta,(()=>{const o=[],v=Vt.current,j=Ut.current,M=j!=null&&v!=null?j[v]:void 0;if(M?.transactionReviewLocalDataById!=null)for(const Ie of Object.values(M.transactionReviewLocalDataById)){const te=Ie?.transactionReviewLocalData?.lineItemById;if(te!=null)for(const lt of Object.values(te)){const Re=lt?.account;Re?.accountId!=null&&o.push(Re.accountId)}}const fe=_t.current;for(const Ie of fe)for(const te of Ie.lines??[])"account"in te&&te.account?.accountId!=null&&o.push(te.account.accountId);return o}));s.useEffect((()=>{B==="transaction_categorization"&&C!==!0||k(void 0)}),[B,k,C]),s.useEffect((()=>{d===!0&&P?.()}),[B,Rt.selectedAccountId]);const na=O.transactionView.selectedTransactionCategorizationCompletedSubTab,aa=O.transactionView.selectedTransactionGroup,je=`${ct}|${na}|${aa}`,Le=s.useRef(null),Mt=s.useRef(null);s.useEffect((()=>{Le.current!==null?Le.current!==je&&(Le.current=je,B==="transaction_categorization"&&ee()):Le.current=je}),[ee,B,je]);const sa=F((o=>ve==null?void 0:_o(o.transactionState,ve))),me=sa?.qboId,jt=F((o=>me==null?void 0:Fo(o,me)));s.useEffect((()=>{me!=null&&l(Bo(me))}),[l,me]);const{createTransferEntryStatus:Lt,creditCardTransferAccountsList:zt,transferAccounts:$t}=O.transactionView,Gt=s.useCallback((o=>Rc(l,o)),[l]),qt=s.useMemo((()=>B!=="transaction_categorization"||X==null?null:X.contentType==="activity"?ot===!0?f.jsx(kc,{activityLogView:jt,qboId:me,onClose:()=>ie(null),selectedTransactionId:X.detail.transactionId,isQuickViewCardStyle:!0},String(X.detail.transactionId)):null:X.contentType==="transfer"?f.jsx(bc,{createTransferEntryStatus:Lt,creditCardTransferAccountsList:zt,transaction:X.detail,transferAccounts:$t,onClose:()=>ie(null),onCreateTransfer:Gt,isQuickViewCardStyle:!0},String(X.detail.transactionId)):null),[B,X,ot,jt,me,Lt,zt,$t,Gt]),oa=qt!=null,{selectedAccountId:Ae}=Rt,Nt=Qe(it.accountSettingsView.saveState.fetchState),ca=F((o=>Uo(o.accountState,o.accountListState,"accountList"))),ia=F((o=>Vo(o))),xe=Pt!=null?Oo(Pt):B,la=F((o=>o.entityAutoCompleteState.autoCompleteText.common));if(Mn({isDataReady:le.fetchState==="Completed"}),st==null)throw Error("Can't access expense automation screen without signing in...");const Jt=Fn(U),we=Ke(Jt.start),De=Ke(Jt.end);if(we==null||De==null)throw Error(`Invalid start - ${we} and end - ${De} period from given ${U}`);const ra=s.useCallback((()=>{ue(!1)}),[]),da=s.useCallback((()=>{J(!0)}),[]),ua=s.useCallback((o=>{Ee(o),J(!1)}),[]),ma=s.useCallback((()=>{Ee([])}),[]),ze=O.missingReceipts.bulkUpload.phase,Wt=O.missingReceipts.bulkUpload.currentBatchId;s.useEffect((()=>{Pe===!0&&B==="missing_receipts"&&ze==="matching"&&Wt!=null&&l(Vn({cacheOverride:!0}))}),[Pe,B,ze,Wt,l]);const Yt=st?.userId,pa=U.month,ha=U.year,Qt=R?.tenantId;s.useEffect((()=>{B==="missing_receipts"&&Pe!==!1&&ze==="idle"&&Yt!=null&&Qt!=null&&l(Mo())}),[B,Pe,ze,Yt,Qt,pa,ha,l]),s.useEffect((()=>{se.newVendorState?.vendorDetailLocalData?.vendorName!=null?n(!0):n(!1)}),[se.newVendorState?.vendorDetailLocalData?.vendorName]),s.useEffect((()=>{xe!=null&&B!==xe&&l(Bn(xe))}),[xe]),s.useEffect((()=>{Et===!1&&le.fetchState==="Completed"&&z&&(Gn(!0),l(hn(!1,!1)))}),[Et,le,z]),s.useEffect((()=>{const o={month:U.month,year:U.year},v=Mt.current;Mt.current=o,v===null||v.month===o.month&&v.year===o.year||!xt&&z&&(l(hn(!1,!1)),l(de(U,Ae,!1,!1)))}),[U.month,U.year,z]);const $e=s.useCallback(((o=!1,v=!1)=>{const j={start:we,end:De};switch(B){case"transaction_categorization":l(he(ct,j,o,!at,void 0,void 0,v)),At(!1);break;case"flux_analysis":l(Ye(U,o,v,null));break;case"month_end_insights":if(v===!1){const M=new Date(U.year,U.month,0),fe=Lo(M.toDateString()).format($n.analytics.YYYYDashMMDashDDFormat);l(zo(!0,R.companyId,R.tenantId,fe)),l($o(R.companyId,R.tenantId))}break;case"je_schedules":l(jo(j,v));break;case"missing_receipts":l(Un(j,{amount:75,currencyCode:"USD",currencySymbol:"$"},o,v));break;default:l(de(U,Ae,o,v))}}),[B,we,De,R.companyId,R.tenantId,ct,U,Ae,at,At]),Sa=s.useCallback((()=>{$e(!0,!0)}),[$e]);s.useEffect((()=>{B===xe&&le.fetchState==="Not-Started"&&z&&$e(!0)}),[le,we,De,R.companyId,R.tenantId,z]),s.useEffect((()=>{xt||at||vt.current||ea.fetchState==="In-Progress"||le.fetchState!=="Completed"||(vt.current=!0,$e(!0,!0))}),[]),s.useEffect((()=>{Q.fetchState!=="In-Progress"&&Q.fetchState!=="Completed"&&Q.fetchState!=="Error"&&R?.tenantId!=null&&l(_e({tenantId:R.tenantId,period:U,refreshViewInBackground:!1}))}),[Q.fetchState,R?.tenantId]),s.useEffect((()=>{Q.fetchState!=="Completed"||!z||(Q.monthEndCloseChecks?.monthEndCloseCheckList.some((o=>o.id==="reconciliation"))??!1)&&O.reconciliation.fetchStatus.fetchState==="Not-Started"&&l(de(U,void 0,!1,!1))}),[Q.fetchState,z,U.month,U.year,O.reconciliation.fetchStatus.fetchState,l]),s.useEffect((()=>{O.monthEndInsights?.previewMonthEndReportStatus?.fetchState==="Completed"?ue(!0):ue(!1)}),[O.monthEndInsights?.previewMonthEndReportStatus?.fetchState]),s.useEffect((()=>{O.monthEndInsights?.sendMonthEndReportStatus?.fetchState==="Completed"&&z&&(l(_e({tenantId:R.tenantId,period:U,refreshViewInBackground:!0})),l(Go({companyId:R.companyId})),g("../"))}),[O.monthEndInsights?.sendMonthEndReportStatus?.fetchState,R.tenantId,U,R.companyId,z]),s.useEffect((()=>{const o=setInterval((()=>{Q.fetchState!=="In-Progress"&&Q.fetchState==="Completed"&&l(_e({tenantId:R.tenantId,period:U,refreshViewInBackground:!0}))}),3e5);return()=>clearInterval(o)}),[Q.fetchState,R.tenantId,U,l]),s.useEffect((()=>{const o=setInterval((()=>{B==="reconciliation"&&Ae==null&&O.reconciliation.fetchStatus.fetchState==="Completed"&&O.reconciliation.refreshStatus.fetchState!=="In-Progress"&&l(de(U,void 0,!0,!0))}),3e5);return()=>clearInterval(o)}),[B,l,O.reconciliation.fetchStatus.fetchState,O.reconciliation.refreshStatus.fetchState,de,Ae,U]);const ga=kn(),{isFeatureEnabled:Ca}=ce(H.isRecommendationFeedbackEnabled),Ht=Tc(),{onRecommendationSelection:Kt,popup:fa}=_c({isEnabled:Ca}),Ia=s.useMemo((()=>({...Ht,onRecommendationSelection:Kt})),[Ht,Kt]);s.useEffect((()=>{const o=(Q.monthEndCloseChecks?.monthEndCloseCheckList.find((v=>v.id==="month_end_insights"))?.isDisabled??!1)&&!wt;B!=="month_end_insights"||!o&&Q.monthEndCloseChecks?.reportEmailSentDate==null||g("../")}),[B,Q.monthEndCloseChecks]);const ka=d===!0?i:b,ba=d===!0||C===!0,Ta=d===!0?P:t;s.useEffect((()=>{Nt==="In-Progress"&&it.accountSettingsView.saveState.fetchState==="Completed"&&l(Sn())}),[Nt,it.accountSettingsView.saveState.fetchState,Sn]);const{transactionId:Zt,onSaveVendor:ya,onSaveSuccess:Ea,onCancel:va,vendorViewDetails:Pa}=(({expenseAutomationViewSelector:o,closeDrawerHandler:v,currentSelectedView:j})=>{const M=Se();let fe,Ie,te;const lt=kn(),Re=o.transactionView;let Xt=()=>{};const{transactions:Aa,selectedTransactionId:ke,selectedTransactionLineId:Ge,transactionLocalData:xa}=Re;if(j==="transaction_categorization"){const rt=xa.find((pe=>pe.transactionId===ke)),ae=Aa.find((pe=>pe.id===ke)),en=Ge!=null?rt?.transactionReviewLocalData?.lineItemById[Ge]:void 0,tn=en?.account;Ie=en?.class?.classId,fe=["Uncategorized Income","Uncategorized Expense"].includes(tn?.accountName??"")?void 0:tn?.accountId;const Da=Mc(ke,ae?.typeOfTransaction);ae!=null&&Da&&(te={id:ke,type:It(ae.typeOfTransaction)}),Xt=()=>{if(ke!=null&&Ge!=null&&ae!=null){const pe=Re.transactionLocalData.find((qe=>qe.transactionId===ke))?.transactionReviewLocalData;if(pe!=null&&ae.lines!=null&&ae.lines.length>0){const qe=pe.lineItemById[Ge];let dt=pe.selectedEntity;if(hs(ae)||(dt=qe.selectedEntityLine),dt!=null){const Ra=dt,_a={transactionId:{id:ae.id,type:ae.type},transaction:ae,lineIds:ae.lines.map((Fa=>Fa.id))??[]};M(kt({entity:Ra,amount:qe.amount.amount,transactionDetails:_a,flowType:"categorization",selectedTab:o.selectedTransactionCategorizationTab,isFetchCOT:lt}))}}}}}const wa=F((rt=>sn(rt,void 0,fe,Ie)));return{transactionId:te,onSaveVendor:()=>{M(ps(te,void 0,!1,!0))},onSaveSuccess:Xt,onCancel:()=>{te!=null&&M(ds({transactionId:te})),M(us()),M(ms()),v()},vendorViewDetails:wa}})({expenseAutomationViewSelector:O,closeDrawerHandler:()=>{n(!1)},currentSelectedView:B});return qn?.loggedInUserRoleMap==null?Q.fetchState==="Error"?f.jsx(yc,{onGoHome:()=>g("../",{replace:!0}),onReload:()=>window.location.reload()}):f.jsx(jn,{fetchState:"In-Progress"}):f.jsxs(f.Fragment,{children:[f.jsx(qc,{isOpen:ye,drawerLeftMargin:new Ec(0,0,300,650),onClose:()=>{J(!1)},children:f.jsx(li,{onClick:o=>o.stopPropagation(),children:f.jsx(ei,{companyId:R.companyId,closeCustomerRequestDrawer:()=>J(!1),addCustomerRequest:ua,resetCustomerRequest:ma})})}),Zt!=null&&e&&f.jsx(Fc,{isOpen:e,transactionId:Zt,onSaveVendor:ya,onSaveSuccess:Ea,onCancel:va,vendorViewDetails:Pa}),f.jsx(vc,{toolkit:Ia,children:f.jsx(ci,{events:[],eventCallback:(o,v,j)=>{},navigate:g,location:S,themeState:G,categoryOptions:Kn,classesForFilters:Xn,accountsForFilters:Zn,vendorSearchAutoCompleteData:{autoCompleteText:la,entityAutoCompleteView:Hn},expenseAutomationViewSelector:O,isMissingReceiptsBulkUploadEnabled:Pe,monthEndInsightsPreviewMode:Te,monthEndInsightsCustomerRequestData:tt,isRealtimeInsightsFeatureEnabled:wt,isCreateTransferEntryFromExpenseEnabled:Dt,isAccountingClassesEnabled:ia,isProjectsTransactionsEnabled:Wn,isCOTEnabled:ga,currentTenant:R,companyId:R.companyId,signedInUser:st,isTransactionActivityEnabled:ot,isRightPanelOpen:oa,rightSidePanel:qt,onOpenTransferRightPanel:Dt===!0?Z:void 0,uncategorizedAccounts:ca,newScheduleActiveType:y,isAccrualEnabled:Nn,newScheduleSelection:W,onNewScheduleSelectionChange:K,onScheduleTypeChange:V,onNewScheduleSaved:Sa,onClickCustomerRequest:da,handleEditClick:ra,tenantEmailDomain:nt,trackExpenseAutomationTabAnalytics:$,setActivityLogTransactionId:k,closeSidePanel:Ta,openTransactionPanel:a,closeSchedulePanel:E,openSchedulePanel:w,sidePanelIsOpen:ba,sidePanelIsFullView:d!==!0&&h,panelContent:ka,isAiCfoAccessEnabled:q,onAskAiCfoClick:oe,isExpenseAutomationCommentingEnabled:Jn,isReconV3Enabled:Yn,onExpenseAutomationCommentingThreadClick:Qn,sidePanelListPercent:d===!0?66:void 0,isSchedulePanelOpen:r,schedulePanelContent:A,schedulePendingDiscardConfirmation:T})}),fa,re.showPopup&&re.popupType!=null&&f.jsx(Pc,{popupType:re.popupType,currencySymbol:re.currencySymbol,accountId:re.popupAccountId??"",accountName:re.popupAccountName??"",onSubmit:re.handleSubmit,onDismiss:re.handleDismiss})]})})))),li=be(Ua)`
35
- display: flex;
36
- min-height: 100%;
37
- flex-direction: column;
38
- `;function Vi(){return f.jsxs(Ma,{children:[f.jsx(ut,{path:"*",element:f.jsx(Nc,{})}),f.jsx(ut,{path:"/:selectedTab/:selectedPeriod/*",element:f.jsx(ii,{})}),f.jsx(ut,{path:"*",element:f.jsx(Ba,{})})]})}export{Vi as default};
@@ -1 +0,0 @@
1
- import{j as s}from"./liveblocks-B3m51ZRo.js";import{a as r}from"./sentry-DI7gLUjw.js";import{aw as l,ax as p,K as m,a4 as b}from"./index-DRDpUzzs.js";import"./mui-DCW4m3lZ.js";import f from"./NotFoundScreen-BFfoIcMt.js";import{h as c,g as u}from"./core-gUqdW_kq.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]="329a4908-6bb4-4729-9d92-aea020ea334b",a._sentryDebugIdIdentifier="sentry-dbid-329a4908-6bb4-4729-9d92-aea020ea334b")}catch{}})();const _=()=>{const a=c(),e=u(),t=r.useCallback((()=>{window.open("https://www.zeni.ai/demo/request","_blank")}),[]),i=r.useCallback((()=>{(()=>{const n=b(e.state?.pathnameStackToGoBack),d=n.poppedPathname??k();a(d,{state:{pathnameStackToGoBack:n.newStack}})})()}),[]),o=l(e.pathname);return o!=null?s.jsx(p,{menuItem:m(o),onDemoClick:t,onGoBack:i}):s.jsx(f,{})},k=(a=2)=>{let e="../";for(let t=0;t<a;t++)e=`${e}../`;return e};export{_ as F};
@@ -1 +0,0 @@
1
- import{a as r}from"./sentry-DI7gLUjw.js";import{u as l,h as m,g as p}from"./core-gUqdW_kq.js";import{hX as f,TP as g,TQ as _}from"./zeni-epic-state-C-d25VTi.js";import{u as h,L as b,z as y}from"./index-DRDpUzzs.js";import"./liveblocks-B3m51ZRo.js";import"./recharts-HpXoq1DR.js";import"./mui-DCW4m3lZ.js";import"./analytics-BvodL4nJ.js";import"./plaid-BrXe9xNf.js";import"./dnd-YSyN45zY.js";import"./stripe-cKAAJElX.js";import"./lottie-DLBd_qLT.js";import"./lexical-Euc6kCJG.js";import"./pdf-BDXl9G7N.js";import"./utils-8Dv5nUFZ.js";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},n=new e.Error().stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="ec601175-4065-42c0-8005-e7a1386e1045",e._sentryDebugIdIdentifier="sentry-dbid-ec601175-4065-42c0-8005-e7a1386e1045")}catch{}})();function R(){const e=l(),n=m(),o=p(),{setLoading:i,clearAllLoading:d}=h(),s=r.useRef(!1);return r.useLayoutEffect((()=>{i(b.CONNECTION_AUTH)}),[i]),r.useEffect((()=>{if(s.current)return;s.current=!0;const a=new URLSearchParams(o.search).get("code"),c=sessionStorage.getItem("hubspot_oauth_pending");if(sessionStorage.removeItem("hubspot_oauth_pending"),a!=null&&c!=null){const t=JSON.parse(c);e(f(t.tenant_id,t.connection_id,g("revenue"),_("hubspot"),{authorization_code:a,client_id:t.client_id,client_secret:t.client_secret,redirect_uri:t.redirect_uri}))}d();const u=y.getActiveTenantForUser();n(u?.tenantEmailDomain!=null?`/${u.tenantEmailDomain}/settings/integrations`:"/",{replace:!0})}),[]),null}export{R as default};
@@ -1,12 +0,0 @@
1
- import{j as u}from"./liveblocks-B3m51ZRo.js";import{a as g}from"./sentry-DI7gLUjw.js";import{u as O,g as _,h as w,t as A,j as l,N as L}from"./core-gUqdW_kq.js";import{z as r,E as M,G as P,T as V,k as N,U as G,_ as W,$,W as R}from"./index-DRDpUzzs.js";import{fE as q,Tb as B,TE as H,Tv as J,gh as K,gj as Q,TA as X,gT as Y,di as Z,TF as ee,TG as te}from"./zeni-epic-state-C-d25VTi.js";import{n as ne}from"./mui-DCW4m3lZ.js";import{u as ae}from"./useDeviceId-kl-tdydV.js";import{f as se}from"./analyticsHelper-BBEm35nD.js";import{t as ie}from"./getLocaleForTenant-BFGbVplK.js";import"./recharts-HpXoq1DR.js";import"./analytics-BvodL4nJ.js";import"./plaid-BrXe9xNf.js";import"./dnd-YSyN45zY.js";import"./stripe-cKAAJElX.js";import"./lottie-DLBd_qLT.js";import"./lexical-Euc6kCJG.js";import"./pdf-BDXl9G7N.js";import"./utils-8Dv5nUFZ.js";(function(){try{var t=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},s=new t.Error().stack;s&&(t._sentryDebugIds=t._sentryDebugIds||{},t._sentryDebugIds[s]="a93563e1-caef-44dd-9ba9-07363a91a2e2",t._sentryDebugIdIdentifier="sentry-dbid-a93563e1-caef-44dd-9ba9-07363a91a2e2")}catch{}})();const E=(t,s)=>t!=null&&t.length>0&&s==="magic_links";function Ee(){const t=O(),s=_(),f=w(),[b]=A(),n=b.get("token"),p=b.get("stytch_token_type"),m=r.getMagicLinkCodeVerifier(),i=ae(),{otpChallenge:d,twoFAPhoneNumber:x,magicLinkEmail:c,verifyDeviceFetchState:z,resendVerifyDeviceOTPFetchState:C}=l((e=>e.tenantState)),S=l((e=>e.tenantState.fetchState)),y=l((e=>e.tenantState.activeTenantFetchState.fetchState)),h=l((e=>e.tenantState.signInState)),I=l((e=>e.tenantState.magicLinkSignInFetchState.fetchState)),a=l((e=>e.tenantState.loggedInUser)),o=l((e=>q(e))),k=l((e=>B(e))),D=r.getSignedInUser(),T=M().mode;g.useEffect((()=>{a?.zeniSessionId==null&&n!=null&&E(n,p)&&i!=null&&m!=null&&(r.saveMagicLinkTriggered(n),t(H(n,i,m)))}),[n,p,t,i,m,a?.zeniSessionId]),g.useEffect((()=>{h!=="In-Progress"||S!=="Completed"&&y!=="Completed"||a?.zeniSessionId==null||o==null||(n!=null&&r.saveLastUsedMagicLinkToken(n),r.saveSignedInUserWithSession(a,a.zeniSessionId),r.saveSignedInUserTenants(J(k.tenantsInOrder),a.zeniSessionId),K(a.userId,a.zeniSessionId,o.tenantId),t(Q(o.tenantId)),r.saveActiveTenantDomainForUser(o.tenantEmailDomain),t(X("Completed")),P.updateAppLocaleID(ie(o)),se(a,o,T,void 0,k.tenantsInOrder),Y().then((()=>{const e=R();e!=null&&V(e)})),setTimeout((()=>{N.trackLogin(G.Event.loginSuccess,"email",Z(o.productSettings))}),2e3))}),[h,S,y,a,o,k,T,s.state,t]);const j=g.useCallback((()=>{f("/signin/auth")}),[f]),F=g.useCallback((()=>{i!=null&&d!=null&&c!=null&&t(ee(i,c,d))}),[i,d,t,c]),U=g.useCallback((e=>{i!=null&&n!=null&&c!=null&&d!=null&&t(te(e,i,c,d))}),[i,n,t,c,d]);if(I==="Completed"&&d!=null)return u.jsx(W,{phoneNumber:x,verifyOtpFetchState:z.fetchState,resendVerifyDeviceOTPFetchState:C,onResendOtp:F,onVerifyOtp:U,onCancelVerifyDevice:j});if(h==="In-Progress"&&S==="Completed"&&a?.zeniSessionId!=null&&o!=null||D!=null){const e=s.state?.origin??"/";return u.jsx(L,{to:e,state:{...s.state,origin:""}})}if(!E(n,p)||m==null||I==="Error"){const e=s.state?.origin??"/",v=n!=null&&r.getLastUsedMagicLinkToken()===n;return u.jsx(L,{to:e,state:{...s.state,origin:"",magicLinkAlreadyUsed:v,magicLinkExpired:!v&&(r.isMagicLinkTriggered(n??"")||I==="Error"&&a?.zeniSessionId==null)}})}return u.jsx(oe,{"data-testid":"smooth-loader",children:u.jsx($,{size:"ExtraLarge",start:!0})})}const oe=ne.div`
2
- position: fixed;
3
- top: 0;
4
- left: 0;
5
- right: 0;
6
- bottom: 0;
7
- display: flex;
8
- align-items: center;
9
- justify-content: center;
10
- z-index: 9999;
11
- background-color: ${t=>t.theme.colors.background};
12
- `;export{Ee as default};
@@ -1 +0,0 @@
1
- import{j as B}from"./liveblocks-B3m51ZRo.js";import{a as m}from"./sentry-DI7gLUjw.js";import{u as te,j as t,i as $e,g as Ge,h as Me,q as _}from"./core-gUqdW_kq.js";import{fE as ne,Tc as Ne,Td as se,g8 as xe,fD as Pe,Tm as Re,Tf as Ve,Tg as je,p_ as Le,gl as Oe,Tj as b,To as Ue,Tp as Q,gm as Ze,Tq as qe,Dt as ze,h0 as He,cV as Ye,Tr as We,g7 as Je,gn as Ke}from"./zeni-epic-state-C-d25VTi.js";import{w as Qe,i as Xe,c as ea,M as aa,d as ta,f as na,u as sa,y as c,g as oa,s as ia,z as ra,e as da,l as ca,n as la,r as ua,o as ma,q as X,L as fa,F as ha,H as ba,p as S,k as ee,A as pa,N as ae,C as ga,D as Sa}from"./index-DRDpUzzs.js";import{D as Ta}from"./mui-DCW4m3lZ.js";import{u as ka}from"./InboxNotificationsProvider-D007v5X6.js";import{u as Ea}from"./useTaskManagerAccess-BJoTHFNB.js";(function(){try{var l=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},i=new l.Error().stack;i&&(l._sentryDebugIds=l._sentryDebugIds||{},l._sentryDebugIds[i]="ea940dc2-25e8-4322-a2d6-b73f4881c445",l._sentryDebugIdIdentifier="sentry-dbid-ea940dc2-25e8-4322-a2d6-b73f4881c445")}catch{}})();const Ca=Qe((({isAppContentDrawerOpen:l,handleDrawerToggle:i})=>{const{tenantEmailDomain:s}=$e(),a=Ge(),T=ea(),n=Me(),F=xe(),r=te(),{useFeatureGate:d}=aa(),p=ta(),{isTaskManagerAccessEnabled:k}=Ea(p),o=t((e=>ne(e))),oe=o.masterTOSInfo?.isMasterTOSAccepted??!1,$=t((e=>Pe(e))),{status:ie}=t(Re),G=$.uiState.currentChatSessionId,E=na(),{setLoading:re}=sa(),[w,M]=m.useState(void 0),A=_("/:tenantEmailDomain/dashboard")!==null,N=_("/:tenantEmailDomain/reports")!==null,f=_("/:tenantEmailDomain/onboarding/*")!==null,de=!!o.company?.companyZeniAccountInfo?.isZeniAccountEnabled,{isFeatureEnabled:ce}=d(c.isChargeCardFeatureEnabled),{isFeatureEnabled:x}=d(c.isDebitCardFeatureEnabled),le=oa(o,ce,x),{isFeatureEnabled:ue}=d(c.isSettingsFeatureEnabled),P=t((e=>Ve(e))),{isFeatureEnabled:C}=d(c.isReferralFeatureEnabled),v=t((e=>je(e)));m.useEffect((()=>{E&&C&&!f&&v.fetchState==="Not-Started"&&r(Le(!0))}),[E,C,v.fetchState,f]);const D=t((e=>e.tenantState)),me=t((e=>D.fetchState==="Completed"?Oe(e):[])),g=t((e=>e.expenseAutomationViewState.selectedPeriodByTenantId)),{isFeatureEnabled:fe}=d(c.isApAgingFeatureEnabled),{isFeatureEnabled:he}=d(c.isArAgingFeatureEnabled),R=ia(),{isFeatureEnabled:be}=d(c.isDashboardSidebarHalloweenAnimationEnabled),{isFeatureEnabled:pe}=d(c.isDashboardSidebarThanksGivingAnimationEnabled),{isFeatureEnabled:ge}=d(c.isDashboardSidebarChristmasAnimationEnabled),{isFeatureEnabled:Se}=d(c.isDashboardSidebarNewYearAnimationEnabled),Te=o.companyTreasuryInfo?.info?.businessVerificationStatus?.code==="verified",ke=t((e=>b(e).totalUnreadCount)),Ee=t((e=>b(e).reducedFetchCountState)),V=t((e=>b(e).notificationDetailsByTab.tasks.uiState.unreadCount)),j=t((e=>b(e).notificationDetailsByTab.comments.uiState.unreadCount)),L=t((e=>b(e).notificationDetailsByTab.tasks.fetchCountState)),I=t((e=>b(e).notificationDetailsByTab.comments.fetchCountState)),{inboxNotifications:O,isLoading:U,isFetchingMore:Z,hasFetchedAll:q,fetchMore:Ce}=ka();m.useEffect((()=>{const e=setTimeout((()=>Ce?.()),0);return()=>clearTimeout(e)})),m.useEffect((()=>{if(U===!1&&Z===!1&&q===!0)if(o?.companyId!=null&&O!=null){const e=`dashboard_${o.companyId}`;M(O.filter((u=>u.roomId===e&&u.readAt==null)).length)}else M(0)}),[U,Z,q]),m.useEffect((()=>{E&&k&&!f&&L.fetchState==="Not-Started"&&F.tenantId!=null&&r(Ue("task_manager","dashboard"))}),[E,k,f,L.fetchState,F.tenantId,r]),m.useEffect((()=>{f||I.fetchState!=="Not-Started"||r(Q({fetchCountState:{fetchState:"In-Progress",error:void 0}},"comments"))}),[f,I.fetchState,r]),m.useEffect((()=>{w!=null&&I.fetchState==="In-Progress"&&(r(Q({fetchCountState:{fetchState:"Completed",error:void 0}},"comments")),r(se({unreadCount:w},"comments")))}),[w,I.fetchState]);const Ie={fetchStatus:Ee,count:ke},z=s!=null?ra.getSignedInUserTenant(s):null,H=t((e=>z?.tenantId!=null?Ze(e,z.tenantId):void 0)),h=[];fe===!1&&h.push("accounts_payable_aging"),he===!1&&h.push("accounts_receivable_aging"),h.push("zeni_accounts_promo_card","treasury_promo_card"),C===!1&&h.push("rewards_card"),R===!1&&h.push("expense_automation_card");const Y=t((e=>qe(e,h).fetchState)),W=t((e=>ze(e).fetchState)),ye=A&&(Y==="Completed"||Y==="Error")||N&&(W==="Completed"||W==="Error")||!A&&!N?void 0:"disabled",we=m.useMemo((()=>He(o.userRole)),[o.userRole]),Ae=Ye(we),ve=o?.rewardsLastViewedTime==null,De=p?.userEmail!=null&&P.fetchState==="Completed"&&We(P.notificationSettings,p.userEmail,x,o,k),J=da(),_e=J&&ca(a);return B.jsx(Ta,{container:window.document.body,variant:"temporary",open:l,onClose:()=>i(!1),PaperProps:{sx:{width:240,zIndex:8,borderRight:"none",backgroundImage:"none"}},ModalProps:{keepMounted:!0},children:B.jsx(la,{signedInUser:p,currentTenantId:D.currentTenantId??"",tenants:D.fetchState==="Completed"?me:H!=null?[H]:[],currentTenant:o,isTenantDropdownDisabled:ye,isSettings:X(a),isInvoicing:ma(a)&&ie==="completed",isSettingsFeatureEnabled:ue,isVendorsTabVisible:Ae,isZeniAccountEnabled:de,isChargeCardEnabled:le,isTreasuryEnabled:Te,isNotificationsTabVisible:De,notificationCountDetails:Ie,isExpenseAutomationEnabledForUser:R,selectedMenu:ua(a),rewardsConfiguration:{isRewardsTabVisible:C,isRewardsAnimated:ve,rewardsPlan:v.rewardsPlan},isAiCfoAccessEnabled:J,onNotificationIconClick:()=>{i(!1);let e=V===0&&j>0?"notifications/comments":"notifications/tasks";X(a)&&(e=V===0&&j>0?"../../notifications/comments":"../../notifications/tasks");const u=S(a.state?.pathnameStackToGoBack,a.pathname);n(e,{state:{pathnameStackToGoBack:u}})},handleCockpitClick:()=>{window.open("/cockpit")},handleLogOutClick:()=>{i(!1);const e=S(a.state?.pathnameStackToGoBack,a.pathname);n("/signout",{replace:!0,state:{pathnameStackToGoBack:e,message:"logout"}})},handleMenuChange:e=>{if(i(!1),s==null)return;if(e.type==="invoicing")return void n(`../${s}/invoicing/overview`,{state:{pathnameStackToGoBack:S(a.state?.pathnameStackToGoBack,a.pathname),referrer:"Sidebar"}});if(e.type==="ai_cfo"){if(ee.trackAICFOChatScreenStateChanged("viewed","left_menu",G??null,null),!oe)return void pa({location:a,navigate:n,mergeState:{referrer:"Sidebar"}});const y=S(a.state?.pathnameStackToGoBack,a.pathname);return void n(`/${s}/ai-cfo/explore`,{state:{pathnameStackToGoBack:y,referrer:"Sidebar"}})}const u=S(a.state?.pathnameStackToGoBack,a.pathname),K=e.type,Be=ae(K)&&K!=="command_center";if(ae(e.type)&&g[o.tenantId]!=null&&ee.trackMonthEndCloseClicked(g[o.tenantId].month,g[o.tenantId].year,"Sidebar"),Be&&g[o.tenantId]!=null){const y=g[o.tenantId];return void n(`/${s}/month_end_close_checks/review/${e.type}/${y.month}-${y.year}`,{state:{pathnameStackToGoBack:u,referrer:"Sidebar"}})}const Fe=ga(e.type);Sa(e.type)?(G!=null&&r(Ke()),n(`/${s}/ai-cfo/${e.type}`,{state:{pathnameStackToGoBack:u.slice(0,-1),referrer:"Sidebar"}})):n(`/${s}/${Fe}`,{state:{pathnameStackToGoBack:u,referrer:"Sidebar"}})},handleMyProfileClick:()=>{i(!1),n(`/${s}/settings/my_profile`)},handleReferralsClick:()=>{i(!1),n(`/${s}/rewards`)},handleBackClick:()=>{n(`/${s}/dashboard`)},handleTenantSelect:e=>{re(fa.TENANT_SWITCHING),i(!1),ha({dispatch:r,navigate:n,pathToNavigate:ba(e.tenantEmailDomain,a),selectedTenant:e,signedInUser:p})},onZeniLogoClick:()=>{T.toggle()},isAiCfo:_e,aiCfoView:$,isOnDashboard:A,updateCurrentChatSessionId:e=>{r(Je({sessionId:e,agentId:"controller"})),n(`/${s}/ai-cfo/${e}`,{state:{...a.state}})},halloweenAnimationEnabled:be,isTaskManagerAccessEnabled:k,thanksGivingAnimationEnabled:pe,christmasAnimationEnabled:ge,newYearAnimationEnabled:Se})})})),Fa=l=>{const i=te(),s=t((T=>ne(T))),a={events:s.userRoleId!=null?[`private-encrypted-${s.userRoleId}.dashboard-user-notification`]:[],eventCallback:(T,n)=>{Xe(n)&&Ne(n.mode)==="dashboard"&&i(se({unreadCount:n.data.unread},"tasks"))}};return B.jsx(Ca,{...l,...a})};export{Fa as M};
@@ -1 +0,0 @@
1
- import{j as e}from"./liveblocks-B3m51ZRo.js";import{h as r,l as i}from"./core-gUqdW_kq.js";import{am as n}from"./index-DRDpUzzs.js";import"./mui-DCW4m3lZ.js";import"./sentry-DI7gLUjw.js";import"./zeni-epic-state-C-d25VTi.js";import"./recharts-HpXoq1DR.js";import"./analytics-BvodL4nJ.js";import"./plaid-BrXe9xNf.js";import"./dnd-YSyN45zY.js";import"./stripe-cKAAJElX.js";import"./lottie-DLBd_qLT.js";import"./lexical-Euc6kCJG.js";import"./pdf-BDXl9G7N.js";import"./utils-8Dv5nUFZ.js";(function(){try{var o=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new o.Error().stack;t&&(o._sentryDebugIds=o._sentryDebugIds||{},o._sentryDebugIds[t]="f2f6ef04-8019-4dfe-8bec-98d5efe59039",o._sentryDebugIdIdentifier="sentry-dbid-f2f6ef04-8019-4dfe-8bec-98d5efe59039")}catch{}})();const f=i(null,(function(o,t){return{onGoBack:()=>{t.navigate(-1)},onGoHome:()=>{t.navigate("/")}}}))(n);function _(){const o=r();return e.jsx(f,{navigate:o})}export{_ as default};
@@ -1 +0,0 @@
1
- import{j as m}from"./liveblocks-B3m51ZRo.js";import{a as r}from"./sentry-DI7gLUjw.js";import{u as A,g as j,j as o,N as x}from"./core-gUqdW_kq.js";import{TS as C,fE as P,gl as R,TT as z,TU as D,TV as M,TW as L,pR as k,Sx as N}from"./zeni-epic-state-C-d25VTi.js";import{z as h,ah as I}from"./index-DRDpUzzs.js";import"./mui-DCW4m3lZ.js";import"./recharts-HpXoq1DR.js";import"./analytics-BvodL4nJ.js";import"./plaid-BrXe9xNf.js";import"./dnd-YSyN45zY.js";import"./stripe-cKAAJElX.js";import"./lottie-DLBd_qLT.js";import"./lexical-Euc6kCJG.js";import"./pdf-BDXl9G7N.js";import"./utils-8Dv5nUFZ.js";(function(){try{var n=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},s=new n.Error().stack;s&&(n._sentryDebugIds=n._sentryDebugIds||{},n._sentryDebugIds[s]="4e1249b3-deeb-43bd-8854-70af7383960e",n._sentryDebugIdIdentifier="sentry-dbid-4e1249b3-deeb-43bd-8854-70af7383960e")}catch{}})();function ee(){const n=A(),s=j(),{params:t,error:i}=r.useMemo((()=>C(s.search)),[s.search]),w=r.useMemo((()=>new URLSearchParams(s.search).get("client_name")??t?.clientId??"Unknown Application"),[s.search,t]),p=h.isSignedIn(),a=h.getSignedInUser(),f=o((e=>P(e))),l=o((e=>R(e))),d=o((e=>e.tenantState.fetchState)),b=o(z),y=o(D),u=o(M),[S,v]=r.useState(null),[T,E]=r.useState(null);r.useEffect((()=>{document.querySelector("#app-shell-loader")?.remove()}),[]),r.useEffect((()=>()=>{n(L())}),[n,s.search]),r.useEffect((()=>{i!=null&&console.warn("[OAuthConsent] invalid params:",i)}),[i]);const g=r.useRef(!1);r.useEffect((()=>{p&&a!=null&&!g.current&&(d!=="Not-Started"&&d!=="Error"||(g.current=!0,n(k(a.userId,a.zeniSessionId??void 0))))}),[p,a,d,n]),r.useEffect((()=>{u!=null&&u!==""&&(window.location.href=u)}),[u]);const U=r.useMemo((()=>{if(f?.tenantId!=null)return f.tenantId;const e=h.getActiveTenantForUser()?.tenantId;return e!=null&&l.some((_=>_.tenantId===e))?e:l.length===1?l[0].tenantId:null}),[f?.tenantId,l]),c=S??U;return i!=null?m.jsx(I,{variant:"invalid_params",paramsError:i}):p?m.jsx(I,{variant:"signed_in",clientName:w,userEmail:a?.userEmail,isInitializing:d!=="Completed",tenants:l,selectedTenantId:c,onSelectTenant:v,approveError:T??y,isApproving:b==="In-Progress",showAllowButton:c!=null,onApprove:()=>{t!=null&&a!=null&&c!=null&&n(N(a.userId,a.zeniSessionId??void 0,c,t.clientId,t.redirectUri,t.codeChallenge,t.codeChallengeMethod,t.state,t.responseType))},onDeny:()=>{if(t!=null)try{const e=new URL(t.redirectUri);e.searchParams.set("error","access_denied"),e.searchParams.set("error_description","The user denied the request"),e.searchParams.set("state",t.state),window.location.href=e.toString()}catch{E("Unable to deny: redirect_uri is not a valid URL. Close this window or contact support.")}}}):m.jsx(x,{to:"/signin/auth",state:{origin:s.pathname+s.search},replace:!0})}export{ee as default};
@@ -1 +0,0 @@
1
- import{j as n}from"./liveblocks-B3m51ZRo.js";import{h as K,u as Q,g as X,i as H,j as d,l as Z,n as ee,o as C}from"./core-gUqdW_kq.js";import{fE as M,zw as O,uv as ae,UJ as w,uq as y,bq as te,b$ as se,ur as oe,UK as re,Ur as S,eb as ne,Di as ce,UL as ie,DG as le,dY as de,dX as me}from"./zeni-epic-state-C-d25VTi.js";import{ai as fe,z as pe,aq as ue,as as he,Q as Fe,M as q,y as $,a8 as ge,k as _,aD as be,p as Ie}from"./index-DRDpUzzs.js";import"./mui-DCW4m3lZ.js";import Ce from"./NotFoundScreen-BFfoIcMt.js";import{F as Se}from"./FeaturePreviewScreen-CaIMasua.js";import{a as F}from"./sentry-DI7gLUjw.js";import{u as ye}from"./useAskAiCfoHostNavButtonProps-DNzUy0g0.js";import{u as Te}from"./useInitialThreadRequest-TMWlbA40.js";import{t as De}from"./routePaths-BlnN04aI.js";import{M as Ae}from"./MobileAppDrawer-Bh8VAeHB.js";import"./recharts-HpXoq1DR.js";import"./analytics-BvodL4nJ.js";import"./plaid-BrXe9xNf.js";import"./dnd-YSyN45zY.js";import"./stripe-cKAAJElX.js";import"./lottie-DLBd_qLT.js";import"./lexical-Euc6kCJG.js";import"./pdf-BDXl9G7N.js";import"./utils-8Dv5nUFZ.js";import"./InboxNotificationsProvider-D007v5X6.js";import"./useTaskManagerAccess-BJoTHFNB.js";(function(){try{var s=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},e=new s.Error().stack;e&&(s._sentryDebugIds=s._sentryDebugIds||{},s._sentryDebugIds[e]="08ffc8da-709f-4db2-aaae-f92882156b6c",s._sentryDebugIdIdentifier="sentry-dbid-08ffc8da-709f-4db2-aaae-f92882156b6c")}catch{}})();const T=(s,e,a,o)=>{if(s!=e){const r=o??"";s!=null&&s.length>0?a(`../${e}${r}`,{replace:!0}):a(`${e}${r}`,{replace:!0})}},xe=Z((function(s){const e=re(s),a={},o=e.pandLReportWithForecast.uiState.nodeCollapseState;return Object.keys(o).forEach((r=>{a[r]=o[r]===!1})),{selectedTimeframe:e.selectedTimeframe,isForecastVsActualOn:e.isForecastVsActualOn,compareMode:e.compareMode,forecastList:e.forecastList,selectedForecast:e.selectedForecast,pandLreport:e.pandLReportWithForecast,scrollPosition:e.pandLReportWithForecast.uiState.scrollPosition,nodeOpenStatus:a,type:"name+balances_forecast",analytics:_}}),(function(s,e){return{onForecastSelectionChanged:(a,o)=>{s(w(a,o)),e.isPandLReportFetched(a)||s(y(a)),T(e.forecastIdFromUrlPath,a,e.navigate)},onTimeframeChanged:a=>{s(le(a))},onForecastVsActualsCompareToggle:a=>{s(ie(a)),s(S({forecastId:e.forecastIdFromUrlPath,scrollPosition:{scrollLeft:0,scrollTop:0}}))},onCompareModeChanged:a=>{s(ce(e.firstMonthOfFY,a,0,[]))},onAccountBalanceClick:e.hasTransactionAccess!==!0?void 0:(a,o)=>{let r,c;const p=a.accountName===""?a.accountDescription:a.accountName;if(o.balanceTimeFrame==="month"||o.balanceTimeFrame==="quarter"?(r=o.balanceTimeFrame,c=ne(o)):o.balanceTimeFrame==="year"?(r="quarter",c={startDate:o.endDate.startOf("quarter"),endDate:o.endDate}):console.error(`timeframe ${o.balanceTimeFrame} is not supported`),c!=null&&r!=null){const u=De(e.tenantEmailDomain,a.accountId,a.accountType,p,r,c),m=Ie(e.location.state?.pathnameStackToGoBack,e.location.pathname);e.navigate(u,{state:{pathnameStackToGoBack:m,referrer:"Forecast"}})}},onNodeCollapseToggled:(a,o)=>{s(S({forecastId:e.forecastIdFromUrlPath,nodeCollapseState:{nodeId:a,isCollapsed:o===!1}}))},onTableScroll:a=>{s(S({forecastId:e.forecastIdFromUrlPath,scrollPosition:a}))},onBackClick:()=>{e.navigate("../../")}}}))(be);function v(){const s=fe(),e=K(),a=Q(),o=X(),{forecastId:r,tenantEmailDomain:c}=H(),[p,u]=F.useState(!1),[m,D]=F.useState(!1),g=pe.getSignedInUser(),A=d((t=>M(t))),B=A.company?.companyInfo.firstMonthOfFY??1,i=d((t=>O(t.forecastState,t.forecastListState))),l=d((t=>t.forecastListState.fetchState==="Completed")),x=d((t=>t.profitAndLossState)),k=d((t=>t.reportUIOptionsState.selectedForecast)),E=t=>x.pandLByForecastID[t]!=null&&oe(t,x).reducedAllFetchState.fetchState==="Completed",{areTenantIdsInSync:b}=ue();he({isDataReady:l});const{isAiCfoAccessEnabled:G,onAskAiCfoClick:N}=ye({mobileExploreReferrer:"Forecast"});F.useEffect((()=>{if(!p&&b)u(!0),l||a(ae());else if(l&&!m){D(!0);const t=((f,U,R)=>U!=null?f.forecasts.findIndex((I=>I.id===U)):R!=null?f.forecasts.findIndex((I=>I.id===R)):f.forecasts.length>0?0:-1)(i,r,k?.id);t===-1&&r!=null?e("page-not-found",{replace:!0}):t!==-1&&t!=k?.index?(a(w(i.forecasts[t].id,t)),T(r,i.forecasts[t].id,e,o.search)):r==null&&t!==-1&&T(void 0,i.forecasts[t].id,e,o.search),t!==-1&&!E(i.forecasts[t].id)&&b&&a(y(i.forecasts[t].id))}}),[p,u,a,l,i,m,D,O,y,b]);const L=Fe(),V=L?.loggedInUserRole!=null&&te(L.loggedInUserRole),{useFeatureGate:W}=q(),{isFeatureEnabled:j}=W($.isReportsCommentingEnabled),Y=Te(j?A?.companyId:void 0,{clearParams:l&&m}),[z,J]=F.useState(!1),h=new URL(s("forecast_pandl"));h.searchParams.set("firstname",g?.firstName??""),h.searchParams.set("lastname",g?.lastName??""),h.searchParams.set("email",g?.userEmail??"");const P=t=>{J(t)};return n.jsxs(n.Fragment,{children:[l?n.jsx(ge,{analytics:_,onLoad:t=>(f=>f.trackForecast())(t)}):null,n.jsx(Ae,{isAppContentDrawerOpen:z,handleDrawerToggle:P}),n.jsx(xe,{firstMonthOfFY:B,tenantEmailDomain:c,forecastIdFromUrlPath:r,navigate:e,location:o,isPandLReportFetched:E,meetingUrl:se(h.toString()),hasTransactionAccess:V,isAiCfoAccessEnabled:G,onAskAiCfoClick:N,isReportsCommentingEnabled:j,initialOpenThreadRequest:Y,onClickMenuIcon:()=>{P(!0)}})]})}function Qe(){const s=d((c=>M(c))),{useFeatureGate:e}=q(),{isFeatureEnabled:a}=e($.isDebitCardFeatureEnabled),o=de(a,s),r=me(s);return o===!0||r===!0?n.jsx(Se,{}):n.jsxs(ee,{children:[n.jsx(C,{path:"/",element:n.jsx(v,{})}),n.jsx(C,{path:"/:forecastId",element:n.jsx(v,{})}),n.jsx(C,{path:"/:forecastId/*",element:n.jsx(Ce,{})})]})}export{Qe as default};
@@ -1,22 +0,0 @@
1
- import{j as a}from"./liveblocks-B3m51ZRo.js";import{UF as re,fE as Y,l_ as G,dY as N,dX as le,Rx as Q,U2 as ce,Cf as Pe,UG as J,C4 as je,Cp as Le,Cj as de,C8 as pe,Cn as ve,Ck as Te,UH as ue,rL as Ae,g5 as Re,gC as Fe,UI as H,Cc as me,Cb as ge,Cs as Oe,c8 as Ue}from"./zeni-epic-state-C-d25VTi.js";import{a1 as Ce,M as X,y as _,z as K,g as fe,P as he,af as be,az as ye,aA as Ve,ab as Se,J as O,ag as we,G as W,aB as Ze,aq as Be,as as $e,a8 as ze,k as xe,U as He,p as _e,aC as Ge,Q as Ke}from"./index-DRDpUzzs.js";import{D as De,n as M,S as Ie}from"./mui-DCW4m3lZ.js";import ae from"./NotFoundScreen-BFfoIcMt.js";import{a as c}from"./sentry-DI7gLUjw.js";import{u as ee,i as We,j as g,h as Me,g as qe,l as Je,n as se,o as z}from"./core-gUqdW_kq.js";import{u as Ye}from"./useAskAiCfoHostNavButtonProps-DNzUy0g0.js";import{M as Ne}from"./MobileAppDrawer-Bh8VAeHB.js";import"./recharts-HpXoq1DR.js";import"./analytics-BvodL4nJ.js";import"./plaid-BrXe9xNf.js";import"./dnd-YSyN45zY.js";import"./stripe-cKAAJElX.js";import"./lottie-DLBd_qLT.js";import"./lexical-Euc6kCJG.js";import"./pdf-BDXl9G7N.js";import"./utils-8Dv5nUFZ.js";import"./InboxNotificationsProvider-D007v5X6.js";import"./useTaskManagerAccess-BJoTHFNB.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]="729e29ea-ce06-45b9-bcd9-2ad2f8b43635",e._sentryDebugIdIdentifier="sentry-dbid-729e29ea-ce06-45b9-bcd9-2ad2f8b43635")}catch{}})();const Qe={overlayWidth:new Se(100,100,48)},te=W.getLocalizedStrings().peoplePage.invitePage,ne=W.getLocalizedStrings().common,Xe=({companyId:e,managersListView:t,companyPassportView:d,classListView:n,mode:C,isEditPeopleDrawerOpen:i,closeDrawerHandler:y})=>{const f=Ce(),m=ee(),[U,V]=c.useState(!1),[k,S]=c.useState(!1),{userId:w}=We(),r=g((l=>re(l))),p=g((l=>Y(l))),E=g((l=>G(l))),{useFeatureGate:D}=X(),{isFeatureEnabled:I}=D(_.isDebitCardFeatureEnabled),P=N(I,p),v=le(p),T=Q(p),Z=ce(p),B=!!p.company?.featuresActivationInfo?.isReimbursementFeatureEnabled,x=!P&&E&&n.fetchState!=="Completed"||t.fetchState!=="Completed"||d.fetchState!=="Completed"||e==null;if(K.getSignedInUser()==null)throw Error("Can't access invite people page without signing in...");const h=()=>{m(J()),y()},A=()=>{U===!0?S(!0):h()},$=d.companyView?.controllers?.map((l=>l.user)),u=!!p.company?.companyZeniAccountInfo?.isZeniAccountEnabled,{isFeatureEnabled:j}=D(_.isChargeCardFeatureEnabled),L=fe(p,j,I),{isCardsHidden:R}=he(p?.tenantId),b=!L||R,F=p.companyTreasuryInfo?.info?.businessVerificationStatus?.code==="verified",s={peopleDetails:r,classList:n.classes,managersList:t.users,controllersList:$,mode:C,isZeniTenant:T,isAccountingClassesEnabled:E,isReimbursementDisabled:B===!1,isZeniAccountsDisabled:u===!1,isChargeCardDisabled:b,isTreasuryDisabled:F===!1,isLiteRoleDisabled:Z===!1,isBankingOnlyTenant:P,isCardsOnlyTenant:v,onResetClick:h,onDeleteUser:l=>{m(pe(l.userId,l.userRole.userRoleId))},onPeopleLocalDataUpdated:l=>{m(de({peopleLocalData:l})),V(!0)},onSaveClick:()=>{m(C==="zeni_only"?je(e):Le(T))},onCloseClick:A,isLoading:x||r.person==null},o={onOkClick:()=>{S(!1),h()},onCancelClick:()=>{S(!1)}};return c.useEffect((()=>{x===!1&&w!=null&&m(Pe(w))}),[x,w]),c.useEffect((()=>{r.updatePersonState.fetchState==="Completed"&&h()}),[r.updatePersonState.fetchState]),a.jsx(De,{anchor:"right",open:i,PaperProps:{style:{width:Qe.overlayWidth.valuePercentage(f),boxShadow:"none"}},slotProps:{backdrop:{style:{backgroundColor:be.overlayDark,cursor:"pointer"}}},onClose:A,children:a.jsxs(ea,{onClick:l=>l.stopPropagation(),children:[k===!0?a.jsx(ye,{titleComponent:a.jsx(ke,{children:te.discardTitle}),descriptionComponent:a.jsx(Ee,{children:te.discardDescription}),primaryButtonText:ne.yes,secondaryButtonText:ne.no,action:o,isEditPopup:!0}):null,a.jsx(Ve,{...s})]})})},ea=M(Ie)`
2
- display: flex;
3
- min-height: 100%;
4
- flex-direction: column;
5
- `,ke=M(we.H6Regular)`
6
- margin-top: ${O.sp7};
7
- padding-left: ${O.sp8};
8
- padding-right: ${O.sp8};
9
- color: ${e=>e.theme.colors.primary};
10
- word-break: break-word;
11
- `,Ee=M(we.LargeRegularSp)`
12
- color: ${e=>e.theme.colors.hero};
13
- padding-left: ${O.sp8};
14
- padding-right: ${O.sp8};
15
- margin-bottom: 30px;
16
- margin-top: ${O.sp4};
17
- white-space: pre-line;
18
- `,aa={overlayWidth:new Se(100,100,48)},oe=W.getLocalizedStrings().peoplePage.invitePage,ie=W.getLocalizedStrings().common,sa=({companyId:e,managersListView:t,companyPassportView:d,classListView:n,mode:C,isInvitePeopleDrawerOpen:i,closeDrawerHandler:y})=>{const f=Ce(),m=ee(),[U,V]=c.useState(!1),[k,S]=c.useState(!1),w=g((o=>re(o))),r=g((o=>Y(o))),p=g((o=>G(o))),{useFeatureGate:E}=X(),{isFeatureEnabled:D}=E(_.isDebitCardFeatureEnabled),I=N(D,r),P=le(r),v=Q(r),T=ce(r),Z=!!r.company?.featuresActivationInfo?.isReimbursementFeatureEnabled,B=!I&&p&&n.fetchState!=="Completed"||t.fetchState!=="Completed"||d.fetchState!=="Completed"||e==null;if(K.getSignedInUser()==null)throw Error("Can't access invite people page without signing in...");const x=()=>{y(),m(J())},h=()=>{U===!0?S(!0):x()},A={onOkClick:()=>{S(!1),x()},onCancelClick:()=>{S(!1)}},$=d.companyView?.controllers.map((o=>o.user)),u=!!r.company?.companyZeniAccountInfo?.isZeniAccountEnabled,{isFeatureEnabled:j}=E(_.isChargeCardFeatureEnabled),L=fe(r,j,D),{isCardsHidden:R}=he(r?.tenantId),b=!L||R,F=r.companyTreasuryInfo?.info?.businessVerificationStatus?.code==="verified",s={classList:n.classes,managersList:t.users,controllersList:$,mode:C,isZeniTenant:v,onPeopleLocalDataUpdated:o=>{m(de({peopleLocalData:o})),V(!0)},onResetClick:x,onSaveClick:()=>{m(C==="zeni_only"?ve(e):Te())},onCloseClick:h,peopleDetails:w,isAccountingClassesEnabled:p,isReimbursementDisabled:Z===!1,isLiteRoleDisabled:T===!1,isZeniAccountsDisabled:u===!1,isChargeCardDisabled:b,isTreasuryDisabled:F===!1,isBankingOnlyTenant:I,isCardsOnlyTenant:P,isLoading:B};return c.useEffect((()=>{w.invitePersonState.fetchState==="Completed"&&(y(),m(J()))}),[w.invitePersonState.fetchState]),a.jsx(De,{anchor:"right",open:i,PaperProps:{style:{width:aa.overlayWidth.valuePercentage(f),boxShadow:"none"}},slotProps:{backdrop:{style:{backgroundColor:be.overlayDark,cursor:"pointer"}}},onClose:h,children:a.jsxs(ta,{onClick:o=>o.stopPropagation(),children:[k===!0?a.jsx(ye,{titleComponent:a.jsx(ke,{children:oe.discardTitle}),descriptionComponent:a.jsx(Ee,{children:oe.discardDescription}),primaryButtonText:ie.yes,secondaryButtonText:ie.no,action:A}):null,a.jsx(Ze,{...s})]})})},ta=M(Ie)`
19
- display: flex;
20
- min-height: 100%;
21
- flex-direction: column;
22
- `,na=Je((function(e,t){const d=ue(e),n=K.getSignedInUser();return{data:d,loggedinUserId:n?.userId??"",isZeniTenant:t.isZeniTenant===!0,shouldFetchClasses:t.shouldFetchClasses,isZeniAdminUser:n?.userEmailDomain==="zeni.ai"&&t.isZeni===!0,isAccountingClassesEnabled:G(e),analytics:xe}}),(function(e,t){const{navigate:d,companyId:n,shouldFetchClasses:C}=t;return{personAction:{onPersonDelete:(i,y)=>{e(pe(i,y))},onResendInvite:i=>{e(Oe(i))},onReloadPeople:()=>{e(me()),e(ge(n,C))},onBackClick:()=>{d("../../")},onModeChange:i=>{e(H({mode:i,searchText:"",sortKey:"name",sortOrder:"ascending"}))},onSearchTextChanged:i=>{e(H({searchText:i}))}}}}))(Ge);function q({isInvitePeopleDrawerOpen:e,isEditPeopleDrawerOpen:t}){const d=Me(),n=ee(),C=qe(),{areTenantIdsInSync:i}=Be(),y=K.getSignedInUser(),f=g((s=>Y(s))),{useFeatureGate:m}=X(),{isFeatureEnabled:U}=m(_.isDebitCardFeatureEnabled),V=g((s=>G(s))),k=!N(U,f)&&V,S=Q(f),w=f?.tenantId,{tenantEmailDomain:r}=f,[p,E]=c.useState(!1),[D,I]=c.useState(!1),[P,v]=c.useState(!1),[T,Z]=c.useState("off"),[B,x]=c.useState(!1),h=s=>{x(s)},{isAiCfoAccessEnabled:A,onAskAiCfoClick:$}=Ye({mobileExploreReferrer:"People"}),u=g((s=>ue(s)));$e({isDataReady:u.fetchState==="Completed"});const j=g((s=>Ae(s.classState,s.classListState))),L=g((s=>Re(s.userState,s.userRoleState,s.userListViewState,"manager"))),R=g((s=>Fe(s))),b=f?.companyId;c.useEffect((()=>{p&&T===u.uiState.mode||!i||(n(H({searchText:"",sortKey:"name",sortOrder:"ascending"})),Z(u.uiState.mode),E(!0),n(me()))}),[p,y,w,n,u.uiState.mode,i]),c.useEffect((()=>{b!=null&&i&&n(ge(b,k))}),[b,k,i]),c.useEffect((()=>{I(e!=null&&e===!0),v(t!=null&&t===!0&&t)}),[e,t]),c.useEffect((()=>{n(H({searchText:"",sortKey:"name",sortOrder:"ascending"}))}),[]);const F=()=>{I(!1),v(!1),d("../")};return a.jsxs(a.Fragment,{children:[u.fetchState==="Completed"?a.jsx(ze,{analytics:xe,onLoad:s=>s.trackPageLoaded(He.Event.members)}):null,D===!0?a.jsx(sa,{closeDrawerHandler:F,isInvitePeopleDrawerOpen:D,managersListView:L,companyPassportView:R,classListView:j,companyId:b,mode:u.uiState.mode}):null,P===!0?a.jsx(Xe,{closeDrawerHandler:F,isEditPeopleDrawerOpen:P,managersListView:L,companyPassportView:R,classListView:j,companyId:b,mode:u.uiState.mode}):null,a.jsx(Ne,{isAppContentDrawerOpen:B,handleDrawerToggle:h}),a.jsx(na,{navigate:d,signedInUser:y,isZeni:f.isZeni,isZeniTenant:S,peopleUIState:u.uiState,companyId:b,shouldFetchClasses:k,classList:j,managersView:L,peopleView:u,onInvitePeopleClick:()=>{d("./new")},onColumnSortConfigChanged:(s,o)=>{n(H({sortKey:s,sortOrder:o}))},onRowClick:s=>{const o=`/${r}/people/${encodeURIComponent(s)}/edit`,l=_e(C.state?.pathnameStackToGoBack,C.pathname);d(o,{state:{pathnameStackToGoBack:l}})},onClickMenuIcon:()=>{h(!0)},isAiCfoAccessEnabled:A,onAskAiCfoClick:$})]})}function ka(){const e=Ke();return Ue(e?.loggedInUserRole??[])?a.jsxs(se,{children:[a.jsx(z,{path:"/",element:a.jsx(q,{})}),a.jsx(z,{path:"new",element:a.jsx(q,{isInvitePeopleDrawerOpen:!0})}),a.jsx(z,{path:":userId/edit",element:a.jsx(q,{isEditPeopleDrawerOpen:!0})}),a.jsx(z,{path:"*",element:a.jsx(ae,{})})]}):a.jsx(se,{children:a.jsx(z,{path:"*",element:a.jsx(ae,{})})})}export{ka as default};
@@ -1 +0,0 @@
1
- import{j as s}from"./liveblocks-B3m51ZRo.js";import T from"./NotFoundScreen-BFfoIcMt.js";import{a as r}from"./sentry-DI7gLUjw.js";import{h as _,g as v,j as p,i as M,u as P,N as U,l as z,n as O,o as h}from"./core-gUqdW_kq.js";import{fE as B,a0h as b,bo as F,bn as N,iK as V,gg as K}from"./zeni-epic-state-C-d25VTi.js";import{c as $,z as I,as as q,dP as G}from"./index-DRDpUzzs.js";import"./mui-DCW4m3lZ.js";import{u as H}from"./useAskAiCfoHostNavButtonProps-DNzUy0g0.js";import{M as J}from"./MobileAppDrawer-Bh8VAeHB.js";import"./recharts-HpXoq1DR.js";import"./analytics-BvodL4nJ.js";import"./plaid-BrXe9xNf.js";import"./dnd-YSyN45zY.js";import"./stripe-cKAAJElX.js";import"./lottie-DLBd_qLT.js";import"./lexical-Euc6kCJG.js";import"./pdf-BDXl9G7N.js";import"./utils-8Dv5nUFZ.js";import"./InboxNotificationsProvider-D007v5X6.js";import"./useTaskManagerAccess-BJoTHFNB.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]="3c97e24d-4ce0-4764-a394-10ea90c86462",e._sentryDebugIdIdentifier="sentry-dbid-3c97e24d-4ce0-4764-a394-10ea90c86462")}catch{}})();const L=z((function(e){const t=I.getSignedInUser(),c=e.tenantState.currentTenantId,o={userId:t?.userId??"",sessionId:t?.zeniSessionId??"",tenantId:c??""},{aggregatedReportViewState:n}=b(e);return{authParams:o,isDisabled:!1,loggedInUser:t,aggregatedReport:n}}),(function(e,t){return{onBackClick:()=>{t.navigate("../../")},onClickMenuIcon:()=>{t.handleDrawerToggle(!0)}}}))(G),Q=()=>{const e=_(),t=v(),c=$(),o=p((a=>B(a))),{aggregatedReportViewState:n}=p((a=>b(a))),{tenantEmailDomain:g}=M(),u=P(),l=I.getSignedInUser();if(l==null)throw new Error("Can't access this page without signing in...");const m=r.useRef(!1),[w,S]=r.useState(!1),C=F(o?.userRole??[]),k=o?.userRole?.includes("bookkeeping_admin")??!1,x=N(l),y=C||k||x,d=r.useCallback(((a,i,E)=>{u(V({fromMonth:a,toMonth:i,cacheOverride:E}))}),[]);r.useEffect((()=>{n?.fetchState==="Completed"&&m.current&&(u(K({messageSection:"data_refresh_update",messageText:"success",type:"success",showStatusIcon:!0})),m.current=!1)}),[n?.fetchState]);const D=r.useCallback(((a,i)=>{n!=null&&n?.fetchState==="In-Progress"||d(a,i,!0),m.current=!0}),[n?.fetchState,d]),j=r.useCallback(((a,i)=>{d(a,i,!1)}),[d]),f=a=>{S(a)},{isAiCfoAccessEnabled:R,onAskAiCfoClick:A}=H({mobileExploreReferrer:"Performance"});return q({isDataReady:n?.fetchState==="Completed"}),y?s.jsxs(s.Fragment,{children:[s.jsx(J,{isAppContentDrawerOpen:w,handleDrawerToggle:f}),s.jsx(L,{navigate:e,location:t,themeState:c,currentTenant:o,signedInUser:l,tenantEmailDomain:g,onReload:D,onTimeRangeSelect:j,handleDrawerToggle:f,isAiCfoAccessEnabled:R,onAskAiCfoClick:A})]}):s.jsx(U,{to:`/${g}/dashboard`,replace:!0})};function he(){return s.jsxs(O,{children:[s.jsx(h,{path:"*",element:s.jsx(Q,{})}),s.jsx(h,{path:"*",element:s.jsx(T,{})})]})}export{he as default};
@@ -1 +0,0 @@
1
- import{j as r}from"./liveblocks-B3m51ZRo.js";import W from"./NotFoundScreen-BFfoIcMt.js";import{a as p}from"./sentry-DI7gLUjw.js";import{h as C,g as D,u as V,j as u,N as k,l as U,n as Y,o as g}from"./core-gUqdW_kq.js";import{fE as I,Yl as h,YC as R,MY as N,MU as L,MX as f,MN as $,Y$ as B,MR as q,M_ as z}from"./zeni-epic-state-C-d25VTi.js";import{z as M,w as T,c9 as K,q as _,bS as X,ca as F}from"./index-DRDpUzzs.js";import"./mui-DCW4m3lZ.js";import{u as G,R as x}from"./ReimbursementApprovalRuleDetailScreen-lW1DSyNO.js";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},s=new e.Error().stack;s&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[s]="2e89e605-99dd-45fe-ad3a-ed1fbcb18eda",e._sentryDebugIdIdentifier="sentry-dbid-2e89e605-99dd-45fe-ad3a-ed1fbcb18eda")}catch{}})();const A="reimbursement-approval-rule-update",H=U((function(e){return{approvalView:h(e),remiSetupApproverViewUpdateData:R(e).remiSetupApproverViewUpdateData}}),(function(e,s){const{navigate:n,location:a}=s;return{onApprovalRulesEventReceived:t=>{t.endsWith(A)&&e(B(!1))},onBackClick:()=>{_(a)?n("../../"):n("../../../reimbursements/setup")},onDeleteRuleClick:t=>{e($(t,!1))},onEditRuleClick:t=>{t!=null?(e(f(t)),n(`./${t}/edit`)):(e(f()),n("./new"))}}}))(T(K)),J=({isLoading:e})=>{const s=C(),n=D(),a=V(),[t,l]=p.useState(!1),[v,w]=p.useState(!1),S=u((o=>o.remiSetupApproverViewState.fetchState)),d=u((o=>I(o))),c=u((o=>h(o))),b=u((o=>R(o).remiSetupApproverViewUpdateData));if(p.useEffect((()=>{b?.updateStatus.fetchState==="Completed"&&a(N())}),[b]),p.useEffect((()=>{t||S!=="Not-Started"||e||(l(!0),a(L(!0,!1,!1,!1)))}),[t,S,e,a]),M.getSignedInUser()==null)throw Error("Can't access reimbursement approval without signing in...");p.useEffect((()=>{c.allApprovalRules.length===0&&c.fetchState==="Completed"&&(v||(w(!0),a(f())),s("./new"))}),[v,c,a]);const m={events:d.companyId!=null?[`private-encrypted-${d.companyId}.${A}`]:[],eventCallback:(o,y,j)=>{o.endsWith(A)&&j.onApprovalRulesEventReceived(o)}};return d?.companyReimbursementInfo?.info?.isReimbursementTOSAccepted===!1?r.jsx(k,{to:"../../promo"}):r.jsx(H,{currentTenant:d,location:n,navigate:s,...m})},E="reimbursement-approval-rule-update",P=U((function(e){const s=h(e),n=R(e).remiSetupApproverViewUpdateData,a={};for(const l of Object.values(e.vendorState.vendorByID))l?.id!=null&&(a[l.id]=l.name);const t={};for(const l of Object.values(e.classState.classesByKey))l?.classId!=null&&(t[l.classId]=l.className);return{approvalView:s,remiSetupApproverViewUpdateData:n,vendorNamesById:a,departmentNamesById:t}}),(function(e,s){const{navigate:n,location:a}=s;return{onApprovalRulesEventReceived:t=>{t.endsWith(E)&&e(B(!1))},onBackClick:()=>{_(a)?n("../../"):n("../../../reimbursements/setup")},onDeleteRuleClick:t=>{e($(t,!0))},onEditRuleClick:t=>{t!=null?(e(f(t)),n(`./${t}/edit`)):(e(f()),n("./new"))},onReorderRules:t=>{e(z(t,!0))}}}))(T(F)),Q=()=>{const e=u((a=>I(a))),{isApprovalRulesV3Enabled:s,isLoading:n}=X(e?.tenantId);return s?r.jsx(Z,{isLoading:n}):r.jsx(J,{isLoading:n})},Z=({isLoading:e})=>{const s=C(),n=D(),a=V(),[t,l]=p.useState(!1),[v,w]=p.useState(!1),[S,d]=p.useState(!1),c=u((i=>i.remiSetupApproverViewState.fetchState)),b=u((i=>i.remiSetupApproverViewState.approverListState.fetchStatus.fetchState)),m=u((i=>I(i))),o=u((i=>h(i)));G();const y=u((i=>R(i).remiSetupApproverViewUpdateData));if(p.useEffect((()=>{y?.updateStatus.fetchState==="Completed"&&a(N())}),[y]),p.useEffect((()=>{t||c!=="Not-Started"||e||(l(!0),a(L(!0,!1,!1,!0)))}),[t,c,e,a]),p.useEffect((()=>{v||b!=="Not-Started"||e||(w(!0),a(q(!1,!0)))}),[v,b,e,a]),M.getSignedInUser()==null)throw Error("Can't access reimbursement approval without signing in...");p.useEffect((()=>{o.allApprovalRules.length===0&&o.fetchState==="Completed"&&(S||(d(!0),a(f())),s("./new"))}),[S,o,a]);const j={events:m.companyId!=null?[`private-encrypted-${m.companyId}.${E}`]:[],eventCallback:(i,ee,O)=>{i.endsWith(E)&&O.onApprovalRulesEventReceived(i)}};return m?.companyReimbursementInfo?.info?.isReimbursementTOSAccepted===!1?r.jsx(k,{to:"../../promo"}):r.jsx(P,{currentTenant:m,location:n,navigate:s,isLoading:e,...j})};function le(){return r.jsxs(Y,{children:[r.jsx(g,{path:"/",element:r.jsx(Q,{})}),r.jsx(g,{path:"/new",element:r.jsx(x,{})}),r.jsx(g,{path:"/:approvalRuleId/edit",element:r.jsx(x,{})}),r.jsx(g,{path:"*",element:r.jsx(W,{})})]})}export{le as R};
@@ -1 +0,0 @@
1
- import{j as a}from"./liveblocks-B3m51ZRo.js";import{z as j,a8 as N,k as f,U as S,e3 as b,M as k,y as C}from"./index-DRDpUzzs.js";import"./mui-DCW4m3lZ.js";import g from"./NotFoundScreen-BFfoIcMt.js";import{a as m}from"./sentry-DI7gLUjw.js";import{u as I,j as y,h as F,g as L,l as U,n as _,o as d,N as h}from"./core-gUqdW_kq.js";import{fE as T,a17 as w,a18 as p,D8 as P,p_ as V,a19 as z,D6 as G}from"./zeni-epic-state-C-d25VTi.js";import"./recharts-HpXoq1DR.js";import"./analytics-BvodL4nJ.js";import"./plaid-BrXe9xNf.js";import"./dnd-YSyN45zY.js";import"./stripe-cKAAJElX.js";import"./lottie-DLBd_qLT.js";import"./lexical-Euc6kCJG.js";import"./pdf-BDXl9G7N.js";import"./utils-8Dv5nUFZ.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]="066c9869-6c82-453d-8e38-d179132ac322",e._sentryDebugIdIdentifier="sentry-dbid-066c9869-6c82-453d-8e38-d179132ac322")}catch{}})();const M=U((function(e,t){const n=w(e);return{inviteFormView:n.localData,submitStatus:n.saveStatus,userName:t.userName,rewardsPlan:n.rewardsPlan,companyLegalName:t.companyName}}),(function(e,t){const{navigate:n}=t,i=j.getSignedInUser();return{onDismissClick:()=>{e(p()),n("/")},onSendClick:()=>{if(i!=null){const s=[],r=[];t.inviteFormCompayData.forEach((c=>{s.push(c.companyName),r.push(c.emailIds[0])})),f.trackInviteEmailClicked("send",s,r,s.length)}e(G())},onUpdateInviteFormLocalData:s=>{e(z({localData:s}))},onSubmitSuccess:()=>{e(p())},onCancelClick:()=>{i!=null&&f.trackInviteEmailClicked("cancel")}}}))(b),R=()=>{const e=I(),[t,n]=m.useState(!1),[i,s]=m.useState(!1),r=y((o=>T(o))),c=F(),x=L(),u=j.getSignedInUser();if(u==null)throw Error("Can't access invite referral screen without signing in...");const l=y((o=>w(o))),D=u?.firstName!=null?u.firstName:"User";m.useEffect((()=>{e(p()),r?.rewardsLastViewedTime==null&&i===!1&&(e(P()),s(!0))}),[]),m.useEffect((()=>{t||l.fetchState!=="Not-Started"||(n(!0),e(V(!0)))}),[l.fetchState,e]);const v=r.company?.companyInfo.companyLegalName??r.companyName;return a.jsxs(a.Fragment,{children:[l.fetchState==="Completed"?a.jsx(N,{analytics:f,onLoad:o=>(E=>E.trackPageLoaded(S.Event.inviteEmailViewed))(o)}):null,a.jsx(M,{navigate:c,location:x,currentTenant:r,companyName:v,userName:D,inviteFormCompayData:l.localData})]})};function ne(){const{useFeatureGate:e}=k(),{isFeatureEnabled:t}=e(C.isReferralFeatureEnabled);return a.jsxs(_,{children:[a.jsx(d,{path:"/",element:a.jsx(h,{to:"refer",replace:!0})}),a.jsx(d,{path:"how-it-works",element:a.jsx(h,{to:"refer",replace:!0})}),a.jsx(d,{path:"refer/*",element:t?a.jsx(R,{}):a.jsx(g,{})}),a.jsx(d,{path:"*",element:a.jsx(g,{})})]})}export{ne as default};
@@ -1,33 +0,0 @@
1
- import{j as k}from"./liveblocks-B3m51ZRo.js";import{a as A}from"./sentry-DI7gLUjw.js";import{i as $,u as X,h as Q,g as ee,j as h,l as te}from"./core-gUqdW_kq.js";import{V$ as Ve,W0 as Me,l_ as ae,rS as Ge,s2 as $e,sk as Re,si as Fe,sl as Ke,so as Ue,W1 as Ye,fE as K,U_ as pe,W2 as Se,gZ as ne,cB as le,cC as se,Ey as ve,W3 as Ce,EC as We,gN as ce,rV as qe,sw as ze,dB as Ze,dA as He,Sn as fe,Ew as Xe,Eq as Qe,W4 as De,Ei as et,Eh as tt,Ec as at,En as nt,ED as lt,W5 as Y,W6 as ge,Ej as st,U$ as oe,ET as Ae,EM as Ie,W7 as xe,rY as Te,EG as Be,EE as we,W8 as Le,E_ as je,EX as be,EH as Je,EZ as _e}from"./zeni-epic-state-C-d25VTi.js";import{a4 as de,aY as ie,aZ as ct,z as ot,j as dt,a7 as it,a8 as ue,k as N,av as ut,a_ as rt,p as M,G as Ee,c as ke,a$ as ht,b0 as mt,b1 as pt}from"./index-DRDpUzzs.js";import{n as re}from"./mui-DCW4m3lZ.js";import{p as St}from"./pathToGoBack-Ds-XNEX3.js";import H from"./NotFoundScreen-BFfoIcMt.js";import{c as G}from"./routePaths-BlnN04aI.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]="825e7279-2036-4081-9ba1-96f70186f8e8",e._sentryDebugIdIdentifier="sentry-dbid-825e7279-2036-4081-9ba1-96f70186f8e8")}catch{}})();function Ft({isRenderedInPanel:e=!1,accrualIdOverride:t,onPanelNavigateBack:c}={}){const{accrualId:l}=$(),s=t??l,n=X(),i=Q(),a=ee(),{accrual:d,actionFetchState:o,detailFetchState:m,localData:I}=h((u=>Ve(u,s??""))),p=h((u=>Me(u))),C=h((u=>ae(u))),g=A.useCallback((()=>{const u=de(a.state?.pathnameStackToGoBack);i(u.poppedPathname??St(4),{state:{pathnameStackToGoBack:u.newStack}})}),[a.state,i]),f=A.useRef(!1);return A.useEffect((()=>{o.fetchState!=="In-Progress"&&f.current&&o.fetchState==="Completed"&&(f.current=!1,g())}),[o.fetchState,g]),A.useEffect((()=>{s!=null&&d==null&&m.fetchState==="Not-Started"&&n(Ge(s))}),[s,d,m.fetchState]),A.useEffect((()=>{n($e({scheduleType:"prepaid_expenses",shouldResetEnteredData:!1}))}),[n]),s==null?k.jsx(H,{}):d==null?m.fetchState==="Not-Started"||m.fetchState==="In-Progress"?k.jsx(ie,{}):k.jsx(H,{}):k.jsx(ft,{children:k.jsx(ct,{isRenderedInPanel:e,accrual:d,actionFetchState:o.fetchState,isAccountingClassesEnabled:C,localData:I,newAccrualAccountsView:p,onAccrualFormChange:(u,r)=>{n(Ye({accrualId:u,localData:r}))},onAccrualFormClear:u=>{n(Ue({accrualId:u}))},onApproveAndPost:u=>{n(Ke(s,u))},onNavigateBack:c??g,onRevert:(u,r)=>{f.current=!0,n(Fe(s,u,r))},onSkip:(u,r)=>{n(Re(s,u,r))}})})}const ft=re.div`
2
- display: flex;
3
- min-height: 100%;
4
- width: 100%;
5
- flex: 1 0 auto;
6
- flex-direction: column;
7
- align-items: center;
8
- background-color: ${e=>e.theme.colors.grey4};
9
- `,Dt=Ee.getLocalizedStrings(),gt=te((function(e,t){const c=Se(e,t.scheduleTab),l=e.tenantState.currentTenantId;return{authParams:{userId:t.signedInUser.userId??"",sessionId:t.signedInUser.zeniSessionId??"",tenantId:l??""},linkBillExpenseView:c.linkBillExpenseView,transactions:c.linkBillExpenseView.transactions}}),(function(e,t){const{navigate:c,location:l}=t;return{onTransactionSelect(s){e(Ce({selectedTransaction:s}))},onBackClick:()=>{c("..",{relative:"path"})},onCancel(){e(Ce({selectedTransaction:void 0})),e(We()),c("..",{relative:"path"})},onTransactionClick:s=>{const n=`${G(s,t.tenantEmailDomain)}`,i=M(l.state?.pathnameStackToGoBack,l.pathname);c(n,{state:{pathnameStackToGoBack:i}})},onLinkSave(){t.setShouldNavigateBack(!1),e(ve(t.scheduleTab,t.scheduleAccruedDetailsView.selectedJEAccruedSchedule?.jeScheduleId))}}}))(rt),Kt=({setShouldNavigateBack:e})=>{const t=Q(),c=ee(),{scheduleDetailId:l,tenantEmailDomain:s}=$(),{scheduleType:n}=$();if(s==null)throw Error("Can't access Link Bill Expense page without tenant Email Domain");const i=h((g=>K(g))),a=pe(n)??"accrued_expenses",d=ot.getSignedInUser();if(d==null)throw Error("Can't access Link Bill Expensedetail page without signing in...");if(l==null)throw Error("Invalid Schedule Detail Id");const o=h((g=>Se(g,a))),m=o.selectedJELinkRowIndex,I=h((g=>ne(g,i.companyId))),p=dt(o.updateStatus.fetchState);A.useEffect((()=>{p==="In-Progress"&&o.updateStatus.fetchState==="Completed"&&t("..",{relative:"path"})}),[p,o.updateStatus.fetchState]),A.useEffect((()=>{o.fetchState==="Not-Started"&&t("..",{relative:"path"})}),[]),A.useEffect((()=>{o.selectedJEAccruedSchedule!=null&&o.selectedJELinkRowIndex!=null||t("..",{relative:"path"})}),[o.selectedJEAccruedSchedule,o.selectedJELinkRowIndex]);const C=o.linkBillExpenseView.fetchState==="Completed";return k.jsx(k.Fragment,{children:o.linkBillExpenseView.fetchState==="In-Progress"?k.jsx(it,{fetchState:o.linkBillExpenseView.fetchState}):o.selectedJEAccruedSchedule!=null&&m!=null?k.jsxs(k.Fragment,{children:[C===!0?k.jsx(ue,{analytics:N,onLoad:()=>{Et(o,a,I)}}):null,k.jsx(gt,{signedInUser:d,attachmentEndPoint:`${ut}/vendor_attachments`,setShouldNavigateBack:e,scheduleVendorId:o.selectedJEAccruedSchedule.vendor.id??"",location:c,tenantEmailDomain:s,scheduleAccruedDetailsView:o,saveFetchState:o.updateStatus.fetchState,scheduleTab:a,navigate:t,analytics:N,controllerUserDetails:I,saveStatus:o.updateStatus.fetchState,jeAccruedSchedule:o.selectedJEAccruedSchedule,localData:o.scheduleAccruedDetailsLocalData.jeScheduleDetails[m]})]}):null})},Ne=e=>{const t=Dt.dateFormat.analytics.YYYYDashMMDashDDFormat;return{scheduleCreateDate:e.createTime.format(t)??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(t)??null,endMonth:e.endDate?.format(t)??null}},Et=(e,t,c)=>{const l=e.selectedJEAccruedSchedule,s=e.selectedJELinkRowIndex;let n;s!=null&&l!=null&&(n=l.scheduledJournalEntry[s]);const{transactions:i}=e.linkBillExpenseView,a=i.some((m=>m.isRecommendedTransaction===!0)),d=le(c.controllers),o=se(c.controllerUserIds);l!=null&&N.trackScheduleAccruedDetailsJournalEntryLinkedLoaded({scheduleType:t,schedule:{...Ne(l)},scheduleExpenseCategoryAndClass:{expenseCategory:l.jeDebit.account?.accountName??null,expenseClass:l.jeDebit.accountingClass?.className??null},journalEntryDetails:{wasRecommendationAvailable:a,journalEntryPostingStatus:n?.status.label??""},vendorName:l.vendor.name??null,controllerEmails:d,controllerUserIds:o})};function ye({jeScheduleId:e,scheduleKey:t,scheduleType:c,onDecided:l}){const s=X(),{ignoreStatusById:n,revertStatusById:i}=h((I=>ce(I).jeSchedules)),a=A.useRef(void 0),d=t==null||a.current==null?void 0:a.current==="ignore"?n[t]?.fetchState:i[t]?.fetchState,o=A.useRef(!1),m=A.useRef(l);return m.current=l,A.useEffect((()=>{o.current&&d==="Completed"&&(o.current=!1,m.current())}),[d]),{onScheduleDecision:A.useCallback(((I,p,C)=>{if(t!=null){if(I==="ignore")return(function(g){return Ze.includes(g)})(p)?(o.current=!0,a.current="ignore",void s(qe(t,c,p,C))):void 0;e!=null&&(function(g){return He.includes(g)})(p)&&(o.current=!0,a.current="revert",s(ze(e,t,c,p,C)))}}),[s,e,t,c]),scheduleDecisionStatus:d}}const kt=re.div`
10
- display: flex;
11
- min-height: 100%;
12
- width: 100%;
13
- flex: 1 0 auto;
14
- flex-direction: column;
15
- align-items: center;
16
- background-color: ${e=>e.theme.colors.grey4};
17
- `,yt=te((function(e){const t=K(e),c=e.entityAutoCompleteState.autoCompleteText.common,l=De(e,"common");return{tenantName:t.companyName,vendorSearchAutoCompleteData:{autoCompleteText:c,entityAutoCompleteView:l}}}),(function(e,t){const{navigate:c,location:l}=t,s="accrued_expenses";return{onNavigateBack:()=>{if(t.onPanelNavigateBack!=null)return void t.onPanelNavigateBack();const n=de(l.state?.pathnameStackToGoBack);n.poppedPathname==null?c("../schedules/accrued_expenses"):c(n.poppedPathname,{state:{pathnameStackToGoBack:n.newStack}})},onZeniLogoClick:()=>{t.themeState.toggle()},onSave:n=>{t.setShouldNavigateBack(!0),e(ve(s,n))},onDelete:n=>{e(st(s,n))},vendorSearchAutoCompleteActions:{onAutoCompleteInputChange:(n,i)=>{n.trim().length>=2?e(ge({searchString:n,entityType:i,searchOrigin:"common"})):n.trim().length===0&&e(Y("common"))},onCancelAutoComplete:()=>{e(Y("common"))}},onEditAmount:(n,i)=>{e(lt(s,n,i))},onJELinkClick:n=>{e(nt({selectedJELinkRowIndex:n})),c("./edit_link")},onCancelAccrual:(n,i,a)=>{e(at(n,i,a))},onTransactionClick:n=>{const i=`${G(n,t.tenantEmailDomain)}`,a=M(l.state?.pathnameStackToGoBack,l.pathname);c(i,{state:{pathnameStackToGoBack:a}})},onViewPostedJE:n=>{const i=`${G(n,t.tenantEmailDomain)}`,a=M(l.state?.pathnameStackToGoBack,l.pathname);c(i,{state:{pathnameStackToGoBack:a}})},onViewRecordedJE:n=>{const i=`${G(n,t.tenantEmailDomain)}`,a=M(l.state?.pathnameStackToGoBack,l.pathname);c(i,{state:{pathnameStackToGoBack:a}})},onViewBillExpense:n=>{const i=`${G(n,t.tenantEmailDomain)}`,a=M(l.state?.pathnameStackToGoBack,l.pathname);c(i,{state:{pathnameStackToGoBack:a}})},onDetailPageChange:(n,i,a)=>{const{scheduleDetailsAccruedExpensesSection:d}=n,{amount:o,memo:m,months:I,scheduleAccruedExpenseCategory:p,scheduleClass:C,scheduleExpenseCategory:g,startDate:f,vendor:u}=d,r=C.selectedOption!=null?t.classList.find((B=>B.classId===C.selectedOption)):void 0,v=g.selectedOption!=null?t.accountList.find((B=>B.qboId===g.selectedOption)):void 0,D=p.selectedOption!=null?t.accruedAccountList.find((B=>B.qboId===p.selectedOption)):void 0,L=I?.selectedOption;e(et({scheduleType:s,localData:i,selectedJeScheduleDetailId:t.scheduleDetailId})),a!==!1||t.scheduleDetailId!=null||v?.accountId==null||t.isAccountingClassesEnabled!==!1&&r?.classId==null||D==null||u.selectedOption==null||m==null||o==null&&o==0||f==null||L==null||e(tt({scheduleType:s}))}}}))(ht),Ut=({shouldNavigateBack:e,setShouldNavigateBack:t,isRenderedInPanel:c=!1,scheduleDetailIdOverride:l,onPanelCloseAfterDecision:s,onPanelNavigateBack:n}={})=>{const[i,a]=A.useState(!1),d=e??i,o=t??a,m=Q(),I=ee(),p=X(),C=ke(),{tenantEmailDomain:g}=$(),[f,u]=A.useState(!1);if(g==null)throw new Error("Can't access this page without a tenantEmailDomain");const{scheduleDetailId:r}=$(),v=l??r;let D;v!=="new"&&(D=v);const L=Ct(v),B=h((w=>w.scheduleAccruedDetailState.selectedJEAccruedScheduleKey)),j="accrued_expenses",y=h((w=>Se(w,"accrued_expenses"))),b=h((w=>fe(w))),J=h((w=>w.classListState.fetchState)),x=h((w=>ae(w))),_=b!=="Completed"||J!=="Completed";A.useEffect((()=>{f===!1&&_?(p(Xe(j,D)),u(!0)):_===!1&&f===!1&&v!=="new"&&(p(Qe(j,v)),u(!0))}),[f]);const P=h((w=>K(w))),T=h((w=>ne(w,P.companyId))),O=I.state?.message==="expenseAutomation",W=h((w=>ce(w).selectedPeriod)),U=c||O,{onScheduleDecision:q,scheduleDecisionStatus:z}=ye({jeScheduleId:y.selectedJEAccruedSchedule?.jeScheduleId,scheduleKey:y.selectedJEAccruedSchedule?.jeAccruedScheduleKey,scheduleType:j,onDecided:()=>{if(s==null)if(O!==!0)m("../schedules/accrued_expenses");else{const{month:w,year:Pe}=W;m(`../../month_end_close_checks/review/je_schedules/${w}-${Pe}`)}else s()}}),V=y.fetchState,R=y.allAccountList,Z=y.allClassList,E=y.allAccruedAccountList,S=y.scheduleAccruedDetailsLocalData;if(L!==!0||y.fetchState==="Error")return k.jsx(H,{});const F=V==="Completed"&&f===!0,Oe=y.selectedJEAccruedSchedule!=null;return V==="Completed"||V==="Not-Started"||c===!0&&Oe?k.jsxs(kt,{children:[F===!0?k.jsx(ue,{analytics:N,onLoad:()=>{vt(y,j,T)}}):null,k.jsx(yt,{onScheduleDecision:U?q:void 0,scheduleDecisionStatus:z,isRenderedInPanel:c,onPanelNavigateBack:n,setShouldNavigateBack:o,scheduleAccruedDetailsView:y,location:I,navigate:m,classList:Z,accountList:R,shouldNavigateBack:d,accruedAccountList:E,scheduleLocalData:S,selectedJEScheduleKey:B,scheduleDetailId:D,selectedScheduledJournalEntries:y.selectedJEAccruedSchedule?.scheduledJournalEntry??[],themeState:C,tenantEmailDomain:g,analytics:N,controllerUserDetails:T,isAccountingClassesEnabled:x,status:y.selectedJEAccruedSchedule?.status.code})]}):k.jsx(ie,{})},Ct=e=>e!=null,vt=(e,t,c)=>{const l=e.selectedJEAccruedSchedule,s=le(c.controllers),n=se(c.controllerUserIds);l!=null&&N.trackScheduleAccruedDetailsLoaded({scheduleType:t,scheduleExpenseCategoryAndClass:{expenseCategory:l.jeDebit.account?.accountName??null,expenseClass:l.jeDebit.accountingClass?.className??null},schedule:{...Ne(l)},vendorName:l.vendor.name??null,controllerEmails:s,controllerUserIds:n})},At=re.div`
18
- display: flex;
19
- min-height: 100%;
20
- width: 100%;
21
- flex: 1 0 auto;
22
- flex-direction: column;
23
- align-items: center;
24
- background-color: ${e=>e.theme.colors.grey4};
25
- `,he=Ee.getLocalizedStrings().dateFormat.analytics.YYYYDashMMDashDDFormat,It=te((function(e){const t=K(e),c=oe(e,"fixed_assets");return{tenantName:t.companyName,scheduleDetailsView:c}}),(function(e,t){const{navigate:c,location:l,vendorSearchAutoCompleteData:s,selectedScheduledJournalEntries:n}=t,i="fixed_assets",a=n.flatMap((d=>d.error)).filter((d=>!!d))??[];return{onNavigateBack:()=>{if(t.onPanelNavigateBack!=null)return void t.onPanelNavigateBack();const d=de(t.location.state?.pathnameStackToGoBack);d.poppedPathname==null?c("../schedules/fixed_assets"):t.navigate(d.poppedPathname,{state:{pathnameStackToGoBack:d.newStack}})},onZeniLogoClick:()=>{t.themeState.toggle()},onSave:d=>{e(_e(i,d,a.length>0))},onDelete:d=>{e(Je(i,d))},onMarkAsComplete:()=>{t.selectedJEScheduleKey!=null&&e(be(i,t.selectedJEScheduleKey))},onEditAmount:(d,o)=>{e(je(i,d,o))},onJELinkClick:d=>{e(Le({selectedJELinkRowIndex:d})),c("./edit_link")},onTransactionClick:d=>{const o=`${G(d,t.tenantEmailDomain)}`,m=M(l.state?.pathnameStackToGoBack,l.pathname);c(o,{state:{pathnameStackToGoBack:m,message:"comingFromScheduleDetailsFixedAssets"}})},onViewLinkedJE:d=>{const o=`${G(d,t.tenantEmailDomain)}`,m=M(l.state?.pathnameStackToGoBack,l.pathname);c(o,{state:{pathnameStackToGoBack:m}})},vendorSearchAutoCompleteActions:{onAutoCompleteInputChange:(d,o)=>{d.trim().length>=2?e(ge({searchString:d,entityType:o,searchOrigin:"common"})):d.trim().length===0&&e(Y("common"))},onCancelAutoComplete:()=>{e(Y("common"))}},onDetailPageChange:(d,o)=>{const{scheduleDetailsFixedAssetsSection:m,scheduleDetailsListSection:I}=d,{scheduleClass:p,scheduleExpenseCategory:C,accumulatedDepreciationCategory:g,assetId:f,months:u,startDate:r,postingDate:v,vendor:D}=m,L=s.entityAutoCompleteView.vendor.length>0?s.entityAutoCompleteView.vendor.find((T=>T.id===D?.selectedOption)):void 0,B={id:L?.zeniId??D?.selectedOption??"",name:L?.name??D?.defaultOptions.find((T=>T.value===D?.selectedOption))?.label??"",logo:L?.logo},j=p.selectedOption!=null?t.classList.find((T=>T.classId===p.selectedOption)):void 0,y=C.selectedOption!=null?t.accountList.find((T=>T.qboId===C.selectedOption)):void 0,b=g.selectedOption!=null?t.depAccountList.find((T=>T.qboId===g.selectedOption)):void 0,J=u?.selectedOption,x=I.map(((T,O)=>({...t.scheduleLocalData.jeScheduleDetails[O],amount:{...t.scheduleLocalData.jeScheduleDetails[O].amount,amount:T.amount}}))),_=v.type==="day"?v.dayOfMonth?v.dayOfMonth:1:void 0,P=v.type==="lastDayOfMonth"||void 0;e(Be({scheduleType:i,localData:{selectedAccount:y?.accountId,selectedClass:j?.classId,selectedAccumulatedDepreciationCategory:b?.accountId,selectedDate:r,selectedMonths:J,assetId:f,jeScheduleDetails:x,lastDayOfMonth:P,selectedDayOfMonth:_,selectedVendor:B},selectedJeScheduleDetailId:t.scheduleDetailId})),o!==!1||b?.accountId==null||t.scheduleDetailId!=null&&t.status!=="draft"&&t.status!=="marked_as_completed"||y?.accountId==null||t.isAccountingClassesEnabled!==!1&&j?.classId==null||r==null||J==null||P!==!0&&_==null||e(we({scheduleType:i}))}}}))(mt),Yt=({isRenderedInPanel:e=!1,scheduleDetailIdOverride:t,onPanelCloseAfterDecision:c,onPanelNavigateBack:l}={})=>{const s=Q(),n=ee(),i=X(),a=ke(),{tenantEmailDomain:d}=$(),[o,m]=A.useState(!1),{scheduleDetailId:I}=$(),p=t??I,C=n.state?.message==="expenseAutomation",g=xt(p),f=h((E=>E.scheduleDetailState.selectedJEScheduleKey));A.useEffect((()=>{f!=null&&f.length!==0||p!=="new"||s("../schedules/fixed_assets")}),[f,p]);const u="fixed_assets",r=h((E=>oe(E,u))),v=h((E=>E.entityAutoCompleteState.autoCompleteText.common)),D=h((E=>De(E,"common"))),L=h((E=>fe(E))),B=h((E=>E.classListState.fetchState)),j=h((E=>ae(E))),y=h((E=>ce(E).selectedPeriod)),b=L!=="Completed"||B!=="Completed";A.useEffect((()=>{o===!1&&b?(i(Ae(u,V,!0)),m(!0)):b===!1&&o===!1&&(i(Ie(u,p==="new"?void 0:p,!0)),m(!0))}),[o]),A.useEffect((()=>{if(r.markAsCompleteStatus.fetchState==="Completed")if(i(xe()),C===!0){const{month:E,year:S}=y;s(`../../month_end_close_checks/review/je_schedules/${E}-${S}`)}else s("../schedules/fixed_assets")}),[r.markAsCompleteStatus.fetchState]);const J=h((E=>K(E))),x=h((E=>ne(E,J.companyId))),_=e||C,{onScheduleDecision:P,scheduleDecisionStatus:T}=ye({jeScheduleId:r.selectedJEScheduleTransaction?.jeScheduleId,scheduleKey:r.selectedJEScheduleTransaction?.jeScheduleTransactionKey,scheduleType:u,onDecided:()=>{if(c==null)if(C!==!0)s("../schedules/fixed_assets");else{const{month:E,year:S}=y;s(`../../month_end_close_checks/review/je_schedules/${E}-${S}`)}else c()}}),O=r.fetchState,W=r.allAccountList,U=r.allClassList,q=r.allDepreciationAccountList,z=r.scheduleDetailsLocalData.fixed_assets;let V;if(p!=="new"&&(V=p),g!==!0||r.fetchState==="Error")return k.jsx(H,{});const R=O==="Completed"&&o===!0,Z=r.selectedJEScheduleTransaction!=null;return O==="Completed"||e===!0&&Z?k.jsxs(At,{children:[R===!0?k.jsx(ue,{analytics:N,onLoad:()=>{Bt(r,u,x)}}):null,k.jsx(It,{onScheduleDecision:_?P:void 0,scheduleDecisionStatus:T,isRenderedInPanel:e,onPanelNavigateBack:l,location:n,navigate:s,classList:U,vendorSearchEntityAutoCompleteView:D,vendorSearchAutoCompleteData:{autoCompleteText:v,entityAutoCompleteView:D},expenseAutomationSelectedPeriod:y,usedInExpenseAutomation:C,removeJeScheduleTransactionKey:(E,S)=>{i(Te(E,S))},accountList:W,depAccountList:q,scheduleLocalData:z,selectedJEScheduleKey:f,scheduleDetailId:V,selectedScheduledJournalEntries:r.selectedJEScheduleTransaction?.scheduledJournalEntry??[],themeState:a,tenantEmailDomain:d,analytics:N,controllerUserDetails:x,isAccountingClassesEnabled:j,status:r.selectedJEScheduleTransaction?.status.code})]}):k.jsx(ie,{})},xt=e=>e!=null,Tt=e=>({transactionDate:e.date.format(he),transactionAmount:e.amount,scheduleCategory:e.account.accountName,scheduleClass:e.classBase?.className??null,description:e.memo}),Bt=(e,t,c)=>{const l=e.selectedJEScheduleTransaction?.baseTransaction,s=e.selectedJEScheduleTransaction,n=le(c.controllers),i=se(c.controllerUserIds);var a;l!=null&&s!=null&&N.trackScheduleDetailsLoaded({scheduleType:t,transaction:{...Tt(l)},scheduleExpenseCategoryAndClass:{expenseCategory:s.jeDebit.account?.accountName??null,expenseClass:s.jeDebit.accountingClass?.className??null},scheduledTransaction:{...(a=s,{currentBalance:a.balanceAsOfToday??null,currentStatus:a.status.label,period:a.period??null,startMonth:a.startDate?.format(he)??null,endMonth:a.endDate?.format(he)??null})},vendorName:s.vendor.name??null,fixedAssetsDetails:{accumulatedDepreciationCategory:s.jeCredit.account?.accountName??null,assetId:s.otherAttributes.assetId??null},controllerEmails:n,controllerUserIds:i})},wt=re.div`
26
- display: flex;
27
- min-height: 100%;
28
- width: 100%;
29
- flex: 1 0 auto;
30
- flex-direction: column;
31
- align-items: center;
32
- background-color: ${e=>e.theme.colors.grey4};
33
- `,me=Ee.getLocalizedStrings().dateFormat.analytics.YYYYDashMMDashDDFormat,Lt=te((function(e,t){const c=K(e),l=oe(e,t.scheduleTab);return{tenantName:c.companyName,scheduleDetailsView:l}}),(function(e,t){const{navigate:c,location:l,vendorSearchAutoCompleteData:s,selectedScheduledJournalEntries:n}=t,i=n.flatMap((a=>a.error)).filter((a=>!!a))??[];return{onNavigateBack:()=>{if(t.onPanelNavigateBack!=null)return void t.onPanelNavigateBack();const a=de(t.location.state?.pathnameStackToGoBack);a.poppedPathname==null?c("../schedules/prepaid_expenses"):t.navigate(a.poppedPathname,{state:{pathnameStackToGoBack:a.newStack}})},onZeniLogoClick:()=>{t.themeState.toggle()},onSave:a=>{e(_e(t.scheduleTab,a,i.length>0))},onDelete:a=>{e(Je(t.scheduleTab,a))},onMarkAsComplete:()=>{t.selectedJEScheduleKey!=null&&e(be(t.scheduleTab,t.selectedJEScheduleKey))},onEditAmount:(a,d)=>{e(je(t.scheduleTab,a,d))},onJELinkClick:a=>{e(Le({selectedJELinkRowIndex:a})),c("./edit_link")},onTransactionClick:a=>{const d=`${G(a,t.tenantEmailDomain)}`,o=M(l.state?.pathnameStackToGoBack,l.pathname);c(d,{state:{pathnameStackToGoBack:o,message:"comingFromScheduleDetails"}})},onViewLinkedJE:a=>{const d=`${G(a,t.tenantEmailDomain)}`,o=M(l.state?.pathnameStackToGoBack,l.pathname);c(d,{state:{pathnameStackToGoBack:o}})},vendorSearchAutoCompleteActions:{onAutoCompleteInputChange:(a,d)=>{a.trim().length>=2?e(ge({searchString:a,entityType:d,searchOrigin:"common"})):a.trim().length===0&&e(Y("common"))},onCancelAutoComplete:()=>{e(Y("common"))}},onDetailPageChange:(a,d)=>{const{scheduleDetailsSection:o,scheduleDetailsListSection:m}=a,{scheduleClass:I,scheduleExpenseCategory:p,months:C,startDate:g,postingDate:f,vendor:u}=o,r=s.entityAutoCompleteView.vendor.length>0?s.entityAutoCompleteView.vendor.find((x=>x.id===u?.selectedOption)):void 0,v={id:r?.zeniId??u?.selectedOption??"",name:r?.name??u?.defaultOptions.find((x=>x.value===u?.selectedOption))?.label??"",logo:r?.logo},D=I.selectedOption!=null?t.classList.find((x=>x.classId===I.selectedOption)):void 0,L=p.selectedOption!=null?t.accountList.find((x=>x.qboId===p.selectedOption)):void 0,B=C?.selectedOption,j=m.map(((x,_)=>({...t.scheduleLocalData.jeScheduleDetails[_],amount:{...t.scheduleLocalData.jeScheduleDetails[_].amount,amount:x.amount}}))),y=f.type==="day"?f.dayOfMonth?f.dayOfMonth:1:void 0,b=f.type==="lastDayOfMonth"||void 0,J={selectedAccount:L?.accountId,selectedClass:D?.classId,selectedDate:g,selectedMonths:B,jeScheduleDetails:j,lastDayOfMonth:b,selectedVendor:v,selectedDayOfMonth:y};e(Be({scheduleType:t.scheduleTab,localData:J,selectedJeScheduleDetailId:t.scheduleDetailId})),d!==!1||t.scheduleDetailId!=null&&t.status!=="draft"&&t.status!=="marked_as_completed"||L?.accountId==null||t.isAccountingClassesEnabled!==!1&&D?.classId==null||g==null||B==null||b!==!0&&y==null||e(we({scheduleType:t.scheduleTab}))}}}))(pt),Wt=({isRenderedInPanel:e=!1,scheduleDetailIdOverride:t,scheduleTypeOverride:c,onPanelCloseAfterDecision:l,onPanelNavigateBack:s}={})=>{const n=Q(),i=ee(),a=X(),d=ke(),{tenantEmailDomain:o}=$(),[m,I]=A.useState(!1),p=i.state?.message==="expenseAutomation",{scheduleType:C,scheduleDetailId:g}=$(),f=t??g,u=jt(c??C,f),r=h((S=>S.scheduleDetailState.selectedJEScheduleKey));A.useEffect((()=>{r!=null&&r.length!==0||f!=="new"||n("../schedules/prepaid_expenses")}),[r,f]);const v=c??pe(C)??"prepaid_expenses",D=h((S=>oe(S,v))),L=h((S=>S.entityAutoCompleteState.autoCompleteText.common)),B=h((S=>De(S,"common"))),j=h((S=>fe(S))),y=h((S=>S.classListState.fetchState)),b=h((S=>ae(S))),J=h((S=>ce(S).selectedPeriod)),x=j!=="Completed"||y!=="Completed";A.useEffect((()=>{m===!1&&x?(a(Ae(v,R,!0)),I(!0)):x===!1&&m===!1&&(a(Ie(v,f==="new"?void 0:f,!0)),I(!0))}),[m]),A.useEffect((()=>{if(D.markAsCompleteStatus.fetchState==="Completed")if(a(xe()),p===!0){const{month:S,year:F}=J;n(`../../month_end_close_checks/review/je_schedules/${S}-${F}`)}else n("../schedules/prepaid_expenses")}),[D.markAsCompleteStatus.fetchState]);const _=h((S=>K(S))),P=h((S=>ne(S,_.companyId))),T=e||p,{onScheduleDecision:O,scheduleDecisionStatus:W}=ye({jeScheduleId:D.selectedJEScheduleTransaction?.jeScheduleId,scheduleKey:D.selectedJEScheduleTransaction?.jeScheduleTransactionKey,scheduleType:v,onDecided:()=>{if(l==null)if(p!==!0)n("../schedules/prepaid_expenses");else{const{month:S,year:F}=J;n(`../../month_end_close_checks/review/je_schedules/${S}-${F}`)}else l()}}),U=D.fetchState,q=D.allAccountList,z=D.allClassList,V=D.scheduleDetailsLocalData;let R;if(f!=="new"&&(R=f),u!==!0||D.fetchState==="Error")return k.jsx(H,{});const Z=U==="Completed"&&m===!0,E=D.selectedJEScheduleTransaction!=null;return U==="Completed"||e===!0&&E?k.jsxs(wt,{children:[Z===!0?k.jsx(ue,{analytics:N,onLoad:()=>{Jt(D,v,P)}}):null,k.jsx(Lt,{onScheduleDecision:T?O:void 0,scheduleDecisionStatus:W,isRenderedInPanel:e,onPanelNavigateBack:s,location:i,vendorSearchEntityAutoCompleteView:B,vendorSearchAutoCompleteData:{autoCompleteText:L,entityAutoCompleteView:B},usedInExpenseAutomation:p,removeJeScheduleTransactionKey:(S,F)=>{a(Te(S,F))},expenseAutomationSelectedPeriod:J,navigate:n,classList:z,accountList:q,scheduleLocalData:V[v],selectedJEScheduleKey:r,scheduleDetailId:R,selectedScheduledJournalEntries:D.selectedJEScheduleTransaction?.scheduledJournalEntry??[],themeState:d,tenantEmailDomain:o,scheduleTab:v,analytics:N,controllerUserDetails:P,isAccountingClassesEnabled:b,status:D.selectedJEScheduleTransaction?.status.code})]}):k.jsx(ie,{})},jt=(e,t)=>pe(e)!=null&&t!=null,bt=e=>({transactionDate:e.date.format(me),transactionAmount:e.amount,scheduleCategory:e.account.accountName,scheduleClass:e.classBase?.className??null,description:e.memo}),Jt=(e,t,c)=>{const l=e.selectedJEScheduleTransaction?.baseTransaction,s=e.selectedJEScheduleTransaction,n=le(c.controllers),i=se(c.controllerUserIds);var a;l!=null&&s!=null&&N.trackScheduleDetailsLoaded({scheduleType:t,transaction:{...bt(l)},scheduleExpenseCategoryAndClass:{expenseCategory:s.jeDebit.account?.accountName??null,expenseClass:s.jeDebit.accountingClass?.className??null},scheduledTransaction:{...(a=s,{currentBalance:a.balanceAsOfToday??null,currentStatus:a.status.label,period:a.period??null,startMonth:a.startDate?.format(me)??null,endMonth:a.endDate?.format(me)??null})},vendorName:s.vendor.name??null,controllerEmails:n,controllerUserIds:i})};export{Ft as J,Yt as S,Ut as a,Wt as b,Kt as c};
@@ -1,2 +0,0 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/NotFoundScreen-BFfoIcMt.js","assets/sentry-DI7gLUjw.js","assets/core-gUqdW_kq.js","assets/zeni-epic-state-C-d25VTi.js","assets/index-DRDpUzzs.js","assets/mui-DCW4m3lZ.js","assets/analytics-BvodL4nJ.js","assets/utils-8Dv5nUFZ.js","assets/index-BhC2LNQw.css","assets/DashboardRoutes-B5yb7VGD.js","assets/withTransactionSidePanel-ZShW5IUX.js","assets/useAskAiCfoHostNavButtonProps-DNzUy0g0.js","assets/TransactionDetailScreen-BISRvrnZ.js","assets/decodeURIComponentSafe-Cst3Y24b.js","assets/useInitialThreadRequest-TMWlbA40.js","assets/routePaths-BlnN04aI.js","assets/expenseAutomationHelper-DDRCXr7k.js","assets/analyticsHelper-BBEm35nD.js","assets/CompanyPassportScreen-DDKosLEE.js","assets/MobileAppDrawer-Bh8VAeHB.js","assets/InboxNotificationsProvider-D007v5X6.js","assets/useTaskManagerAccess-BJoTHFNB.js","assets/useAiCfoDashboardSuggestedQuestionsChips-C8tiJ4-s.js","assets/FeaturePreviewScreen-CaIMasua.js","assets/BillPayRoutes-8zmFRoA_.js","assets/AddressScreen-CSJE0p29.js","assets/DomesticWireDetailScreen-Bl1py3nW.js","assets/BusinessVerificationPageScreen-CmhKA9oQ.js","assets/DrawerScreen--7ksii2j.js","assets/SetupPagesScreen-CNVeqnHU.js","assets/BillPayApprovalRoutes-Z4uvf0-n.js","assets/ReimbursementApprovalRuleDetailScreen-lW1DSyNO.js","assets/getLocaleForTenant-BFGbVplK.js","assets/ReimbursementRoutes-03Hgu3V3.js","assets/ReimbursementApprovalRoutes-CvLfwozC.js","assets/TransactionListRoutes-DHaTXNgW.js","assets/ZeniAccountStatementScreen-Cn72q1Zx.js","assets/SettingsRoutes-BAJmUy_d.js","assets/AccountMappingScreen-C3HFW5Ij.js","assets/QBOConnectionScreen-BbB3FEE8.js","assets/empty-CkcqWk4Z.js","assets/index-70FTEc4H.js","assets/url-qyBRakHR.js","assets/index-DhQKJDfi.js","assets/accountMappingHelper-qlU24D2s.js","assets/useEmailConnectResultRefresh-BJXmlYiy.js","assets/ReportsRoutes-B9cy_-f4.js","assets/ChargeCardRoutes-C7bJJS3x.js","assets/useChargeCardPusherEvents-K7_8wfj8.js","assets/PeopleRoutes-Dx-0mEVQ.js","assets/ExpenseAutomationRoutes-Dg2fewAy.js","assets/ScheduleDetailsPrepaidExpensesScreen-D9k6A3OE.js","assets/pathToGoBack-Ds-XNEX3.js","assets/TreasuryRoutes-DQeUZ7RQ.js","assets/VendorsRoutes-AD9AzaGF.js","assets/ZeniAccountRoutes-BKcFRSlc.js","assets/AddressRoutes-Bt5wsDb7.js","assets/PandLWithForecastRoutes-AChf_KvX.js","assets/CustomerOnboardingRoutes-zfeAaUV5.js","assets/TransactionDetailRoutes-CEwE4Bbf.js","assets/EntityDetailRoutes-Cjc6zlA1.js","assets/InvoicingRoutes-6Wikj2BP.js","assets/NotificationRoutes-La5Ef0Sp.js","assets/PerformanceRoutes-3JW12kzP.js","assets/RewardsRoutes-DQIZ8X-t.js","assets/TaskRoutes-CIgfsl6U.js","assets/TaskListScreen-B_HBW--i.js","assets/AiCfoScreen-BjMYvl6E.js","assets/CardsAiCfoScreen-B7sfpD2b.js"])))=>i.map(i=>d[i]);
2
- import{_ as s,bn as ms,fE as _s,dY as Es,dX as hs,Al as ps,dh as gs,c8 as Rs,gI as xs,g8 as Is,de as pe,cG as js,gm as Ts,cy as As,bE as bs,br as ys,Ts as Ds,v as fs,Tv as Cs,bq as vs,Tw as Os,bK as Ps,bJ as ws,bt as Us,cu as Fs,Tx as Ls,Ty as ks,d9 as Hs,dc as Vs,db as Ss,cF as Bs,cM as Ns,pR as ge,gh as Re,gX as Ms,gj as xe,gK as Ie,gL as je,gk as Zs}from"./zeni-epic-state-C-d25VTi.js";import{j as e}from"./liveblocks-B3m51ZRo.js";import{a as w}from"./sentry-DI7gLUjw.js";import{N as u,u as Gs,h as $s,i as zs,g as Ys,j as $,q as Te,n as qs,o as t}from"./core-gUqdW_kq.js";import{O as l,E as Ws,u as Xs,z as D,M as Ks,e as Qs,s as Js,y as M,g as en,P as sn,Q as nn,L as F,G as Ae,t as _,R as tn,S as an,k as ne}from"./index-DRDpUzzs.js";import"./mui-DCW4m3lZ.js";import{f as be}from"./analyticsHelper-BBEm35nD.js";import{t as on}from"./getLocaleForTenant-BFGbVplK.js";(function(){try{var a=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},A=new a.Error().stack;A&&(a._sentryDebugIds=a._sentryDebugIds||{},a._sentryDebugIds[A]="00753516-2b53-43b7-8839-98e19983a39b",a._sentryDebugIdIdentifier="sentry-dbid-00753516-2b53-43b7-8839-98e19983a39b")}catch{}})();const rn=l((()=>s((()=>import("./NotFoundScreen-BFfoIcMt.js")),__vite__mapDeps([0,1,2,3,4,5,6,7,8])))),ln=({tenantEmailDomain:a})=>e.jsx(u,{to:`/${a}/reimbursements`}),un=({tenantEmailDomain:a})=>e.jsx(u,{to:`/${a}/bills`}),ye=({tenantEmailDomain:a})=>e.jsx(u,{to:`/${a}/treasury`}),De=({tenantEmailDomain:a})=>e.jsx(u,{to:`/${a}/checking`}),fe=({tenantEmailDomain:a})=>e.jsx(u,{to:`/${a}/cards`}),f=({showZeniAccountRoute:a,isUserHasBillPayAccess:A,isUserHasReimbursementAccess:S,showTreasuryRoute:i,isTenantBankingOnly:k,showChargeCardRoute:O,tenantEmailDomain:v})=>{if(k===!0){if(a)return e.jsx(De,{tenantEmailDomain:v});if(i)return e.jsx(ye,{tenantEmailDomain:v});if(O)return e.jsx(fe,{tenantEmailDomain:v})}return a?e.jsx(De,{tenantEmailDomain:v}):i?e.jsx(ye,{tenantEmailDomain:v}):O?e.jsx(fe,{tenantEmailDomain:v}):A?e.jsx(un,{tenantEmailDomain:v}):S?e.jsx(ln,{tenantEmailDomain:v}):e.jsx(rn,{})},dn={dashboard:()=>s((()=>import("./DashboardRoutes-B5yb7VGD.js")),__vite__mapDeps([9,1,2,3,4,5,6,7,10,11,12,13,14,15,16,0,17,18,19,20,21,22,23,8])),bills:()=>s((()=>import("./BillPayRoutes-8zmFRoA_.js")),__vite__mapDeps([24,1,2,3,4,5,6,7,25,0,26,11,14,27,15,19,20,21,28,23,29,17,30,31,32,8])),reimbursement:()=>s((()=>import("./ReimbursementRoutes-03Hgu3V3.js")),__vite__mapDeps([33,1,2,3,4,5,6,7,0,29,27,15,19,20,21,17,23,11,14,28,34,31,32,8])),transactions:()=>s((()=>import("./TransactionListRoutes-DHaTXNgW.js")),__vite__mapDeps([35,1,2,3,4,5,6,7,10,11,12,13,14,15,16,36,8])),settings:()=>s((()=>import("./SettingsRoutes-BAJmUy_d.js")),__vite__mapDeps([37,1,2,3,4,5,6,7,21,38,19,20,39,40,41,42,43,13,44,25,0,17,27,15,18,45,30,31,34,8])),reports:()=>s((()=>import("./ReportsRoutes-B9cy_-f4.js")),__vite__mapDeps([46,1,2,3,4,5,6,7,0,23,14,15,19,20,21,8])),chargeCards:()=>s((()=>import("./ChargeCardRoutes-C7bJJS3x.js")),__vite__mapDeps([47,1,2,3,4,5,6,7,11,19,20,21,29,27,15,0,17,14,48,25,8])),people:()=>s((()=>import("./PeopleRoutes-Dx-0mEVQ.js")),__vite__mapDeps([49,1,2,3,4,5,6,7,0,11,19,20,21,8])),expenseAutomation:()=>s((()=>import("./ExpenseAutomationRoutes-Dg2fewAy.js")),__vite__mapDeps([50,1,2,3,0,4,5,6,7,11,12,13,14,15,16,51,52,10,44,28,8])),treasury:()=>s((()=>import("./TreasuryRoutes-DQeUZ7RQ.js")),__vite__mapDeps([53,1,2,3,4,5,6,7,0,29,27,15,19,20,21,17,11,14,23,8])),vendors:()=>s((()=>import("./VendorsRoutes-AD9AzaGF.js")),__vite__mapDeps([54,1,2,3,4,5,6,7,25,0,23,51,52,15,11,19,20,21,28,44,8])),zeniAccounts:()=>s((()=>import("./ZeniAccountRoutes-BKcFRSlc.js")),__vite__mapDeps([55,1,2,3,4,5,6,7,0,29,27,15,19,20,21,17,23,26,25,11,36,8]))},cn=["bills","transactions","settings","reimbursement","reports","chargeCards","people"],te=a=>{"requestIdleCallback"in window?requestIdleCallback(a):setTimeout(a,100)},mn=l((()=>s((()=>import("./ReportsRoutes-B9cy_-f4.js")),__vite__mapDeps([46,1,2,3,4,5,6,7,0,23,14,15,19,20,21,8])))),_n=l((()=>s((()=>import("./AddressRoutes-Bt5wsDb7.js")),__vite__mapDeps([56,1,2,3,25,4,5,6,7,0,8])))),En=l((()=>s((()=>import("./PeopleRoutes-Dx-0mEVQ.js")),__vite__mapDeps([49,1,2,3,4,5,6,7,0,11,19,20,21,8])))),hn=l((()=>s((()=>import("./PandLWithForecastRoutes-AChf_KvX.js")),__vite__mapDeps([57,1,2,3,4,5,6,7,0,23,11,14,15,19,20,21,8])))),pn=l((()=>s((()=>import("./CustomerOnboardingRoutes-zfeAaUV5.js")),__vite__mapDeps([58,1,2,3,25,4,5,6,7,0,39,40,41,42,43,13,45,48,8])))),gn=l((()=>s((()=>import("./VendorsRoutes-AD9AzaGF.js")),__vite__mapDeps([54,1,2,3,4,5,6,7,25,0,23,51,52,15,11,19,20,21,28,44,8])))),Rn=l((()=>s((()=>import("./TransactionDetailRoutes-CEwE4Bbf.js")),__vite__mapDeps([59,1,2,3,0,4,5,6,7,12,11,13,14,15,16,8])))),Ce=l((()=>s((()=>import("./EntityDetailRoutes-Cjc6zlA1.js")),__vite__mapDeps([60,1,2,3,4,5,6,7,13,10,11,12,14,15,16,8])))),xn=l((()=>s((()=>import("./DashboardRoutes-B5yb7VGD.js")),__vite__mapDeps([9,1,2,3,4,5,6,7,10,11,12,13,14,15,16,0,17,18,19,20,21,22,23,8])))),ve=l((()=>s((()=>import("./BillPayRoutes-8zmFRoA_.js")),__vite__mapDeps([24,1,2,3,4,5,6,7,25,0,26,11,14,27,15,19,20,21,28,23,29,17,30,31,32,8])))),In=l((()=>s((()=>import("./SettingsRoutes-BAJmUy_d.js")),__vite__mapDeps([37,1,2,3,4,5,6,7,21,38,19,20,39,40,41,42,43,13,44,25,0,17,27,15,18,45,30,31,34,8])))),jn=l((()=>s((()=>import("./InvoicingRoutes-6Wikj2BP.js")),__vite__mapDeps([61,1,2,3,4,5,6,7,25,0,19,20,21,39,40,41,42,43,13,8])))),Oe=l((()=>s((()=>import("./ReimbursementRoutes-03Hgu3V3.js")),__vite__mapDeps([33,1,2,3,4,5,6,7,0,29,27,15,19,20,21,17,23,11,14,28,34,31,32,8])))),Tn=l((()=>s((()=>import("./ZeniAccountRoutes-BKcFRSlc.js")),__vite__mapDeps([55,1,2,3,4,5,6,7,0,29,27,15,19,20,21,17,23,26,25,11,36,8])))),An=l((()=>s((()=>import("./TreasuryRoutes-DQeUZ7RQ.js")),__vite__mapDeps([53,1,2,3,4,5,6,7,0,29,27,15,19,20,21,17,11,14,23,8])))),bn=l((()=>s((()=>import("./TransactionListRoutes-DHaTXNgW.js")),__vite__mapDeps([35,1,2,3,4,5,6,7,10,11,12,13,14,15,16,36,8])))),yn=l((()=>s((()=>import("./ChargeCardRoutes-C7bJJS3x.js")),__vite__mapDeps([47,1,2,3,4,5,6,7,11,19,20,21,29,27,15,0,17,14,48,25,8])))),Dn=l((()=>s((()=>import("./NotificationRoutes-La5Ef0Sp.js")),__vite__mapDeps([62,1,2,3,0,4,5,6,7,11,21,8])))),fn=l((()=>s((()=>import("./PerformanceRoutes-3JW12kzP.js")),__vite__mapDeps([63,1,2,3,0,4,5,6,7,11,19,20,21,8])))),Cn=l((()=>s((()=>import("./ExpenseAutomationRoutes-Dg2fewAy.js")),__vite__mapDeps([50,1,2,3,0,4,5,6,7,11,12,13,14,15,16,51,52,10,44,28,8])))),vn=l((()=>s((()=>import("./RewardsRoutes-DQIZ8X-t.js")),__vite__mapDeps([64,1,2,3,4,5,6,7,0,8])))),On=l((()=>s((()=>import("./TaskRoutes-CIgfsl6U.js")),__vite__mapDeps([65,1,2,3,0,4,5,6,7,14,19,20,21,66,11,8])))),Pn=l((()=>s((()=>import("./AiCfoScreen-BjMYvl6E.js")),__vite__mapDeps([67,1,2,3,4,5,6,7,22,52,15,8])))),Pe=l((()=>s((()=>import("./CardsAiCfoScreen-B7sfpD2b.js")),__vite__mapDeps([68,1,2,3,4,5,6,7,8])))),C=l((()=>s((()=>import("./NotFoundScreen-BFfoIcMt.js")),__vite__mapDeps([0,1,2,3,4,5,6,7,8])))),wn=l((()=>s((()=>import("./TaskListScreen-B_HBW--i.js").then((a=>a.f))),__vite__mapDeps([66,1,2,3,4,5,6,7,11,19,20,21,8])))),Un=({isDashboardAccess:a,showZeniAccountRoute:A,isUserHasBillPayAccess:S,isUserHasReimbursementAccess:i,showTreasuryRoute:k,isTenantBankingOnly:O,isTenantCardsOnly:v,showChargeCardRoute:H})=>{if(O===!0){if(A)return e.jsx(u,{to:"checking"});if(k)return e.jsx(u,{to:"treasury"});if(H)return e.jsx(u,{to:"cards"})}return v===!0&&H?e.jsx(u,{to:"cards"}):a?e.jsx(u,{to:"dashboard"}):A?e.jsx(u,{to:"checking"}):k?e.jsx(u,{to:"treasury"}):H?e.jsx(u,{to:"cards"}):S?e.jsx(u,{to:"bills"}):i?e.jsx(u,{to:"reimbursements"}):e.jsx(u,{to:"dashboard"})},we=({tenantEmailDomain:a})=>e.jsx(u,{to:`/${a}/dashboard`}),Mn=Object.freeze(Object.defineProperty({__proto__:null,default:function({setTenantEmailDomain:a}){const A=Gs(),S=$s(),{tenantEmailDomain:i}=zs(),k=Ws().mode,{setLoading:O,clearAllLoading:v,clearLoading:H}=Xs(),b=D.getSignedInUserTenant(i)?.tenantId,j=D.getSignedInUser(),X=ms(j),z=Ys(),[L,Ue]=w.useState(!1),r=$((o=>_s(o))),{useFeatureGate:B}=Ks(),Z=Qs(),ae=Js(),Fe=!!r.company?.companyZeniAccountInfo?.isZeniAccountEnabled,Le=r.companyTreasuryInfo?.info?.businessVerificationStatus?.code==="verified",{isFeatureEnabled:ke}=B(M.isChargeCardFeatureEnabled),{isFeatureEnabled:oe}=B(M.isDebitCardFeatureEnabled),T=$((o=>o.tenantState.fetchState)),p=$((o=>o.tenantState.activeTenantFetchState.fetchState)),E=p==="Completed"||T==="Completed"?Es(oe,r):void 0,K=p==="Completed"||T==="Completed"?hs(r):void 0,re=p==="Completed"||T==="Completed"?ps(r)&&!gs(r):void 0,He=en(r,ke,oe),{isCardsHidden:Ve}=sn(r?.tenantId),Se=!He||!!Ve,{isFeatureEnabled:Be}=B(M.isSettingsFeatureEnabled),{isFeatureEnabled:Q}=B(M.isAiCfoFileUploadEnabled),{isFeatureEnabled:Ne}=B(M.isInvoicingFeatureEnabled??"is_invoicing_feature_enabled"),Me=Ne||an==="DEV",Ze=r?.userRole!=null&&Rs(r.userRole),Y=$((o=>xs(o)));if(i!=null){const o=D.getSignedInUserTenant(i);j!=null&&o!=null&&be(j,r,k)}const G={tenantId:b,userId:j?.userId,sessionId:j?.zeniSessionId},ie=Is(),h=nn(),Ge=r.company==null||h?.loggedInUserRoleMap!=null&&pe(h.loggedInUserRole),$e=js(h?.loggedInUserRoleMap),J=Te("/:tenantEmailDomain/onboarding/*")!==null,ee=Te("/:tenantEmailDomain/month_end_close_checks/review/:selectedTab/:selectedPeriod/*"),ze=$((o=>G.tenantId!=null?Ts(o,G.tenantId):void 0));w.useEffect((()=>{O(F.TENANT_FETCHING),a(i)}),[i]),w.useEffect((()=>{if(ee!=null&&b!=null){const o=ee.params.selectedPeriod;if(o!=null){const y=o.split("-");if(y.length===2){const d=As(Number(y[0])),n=Number(y[1]),c=bs(`01-${d<10?`0${d}`:d}-${n}`,Ae.getLocalizedStrings().dateFormat.analytics.DDDashMMDashYYYY),N=ys();c.isAfter(N,"month")===!1?A(Ds(b,{month:d,year:n})):S(`/${i}/month_end_close_checks/review`)}}}}),[ee,b]),w.useEffect((()=>{L||(Ue(!0),O(F.TENANT_FETCHING))}),[L,G,ie,j,A,D]),w.useLayoutEffect((()=>{!fs(ie,G)&&D.isSignedIn()&&(O(F.TENANT_FETCHING),(function(o,y,d,n){if(Re(y?.userId,y?.zeniSessionId,o.tenantId),d(Ms(!0)),d(xe(o.tenantId)),o.tenantId!=null&&_.clearTenant(o.tenantId),o.tenantId!=null){const c=D.getSignedInUserTenantWithId(o.tenantId);n&&Ae.updateAppLocaleID(on(n)),c?.tenantEmailDomain!=null&&D.saveActiveTenantDomainForUser(c?.tenantEmailDomain)}o.userId!=null?ne.identify(o.userId,{tenant_id:o.tenantId}):ne.resetUserIdentity()})(G,j,A,ze))}),[b]),w.useEffect((()=>{D.isSignedIn()&&(O(F.TENANT_FETCHING),(function(o,y,d,n,c,N,V){if(d==null&&n==null)return void console.warn("There is no current tenant selected!!");const q=n!=null&&c?.zeniSessionId!=null,us=d==null||d.tenantId!==n,ds=d!=null&&d.excludedResources==null,cs=d!=null&&d.externalConnections==null;if(q&&us){V(xe(n));const W=D.getSignedInUserTenantWithId(n);W?.tenantEmailDomain!=null&&D.saveActiveTenantDomainForUser(W?.tenantEmailDomain),Re(c?.userId,c?.zeniSessionId,n),_.shouldFetchExcludedResources(n)&&(_.markExcludedResourcesFetchStarted(n),V(Ie(c.userId,n))),_.shouldFetchConnections(n)&&(_.markConnectionsFetchStarted(n),V(je(c.userId,n)))}else q&&ds&&_.shouldFetchExcludedResources(n)&&(_.markExcludedResourcesFetchStarted(n),V(Ie(c.userId,n))),q&&cs&&_.shouldFetchConnections(n)&&(_.markConnectionsFetchStarted(n),V(je(c.userId,n)));if(q){ne.identify(c.userId,{tenant_id:n});const W=n==null||n!=null&&(y==="Completed"||y==="Error");o==="Completed"||y!=="Not-Started"&&y!=="Error"||n==null||!_.shouldFetchActiveTenant(n)||(_.markActiveTenantFetchStarted(n),N(F.TENANT_FETCHING),V(Zs(c.userId,n,c.zeniSessionId))),W&&(o==="Not-Started"||o==="Error")&&_.shouldFetchAllTenants()&&(_.markAllTenantsFetchStarted(),V(ge(c.userId,c.zeniSessionId)))}})(T,p,r,b,j,O,A))}),[b,p]),w.useEffect((()=>{D.isSignedIn()&&T==="Completed"&&Y.tenantsBaseInOrder.length>0&&(H(F.TENANT_FETCHING),D.saveSignedInUserTenants(Cs(Y.tenantsBaseInOrder)),j!=null&&be(j,r,k,void 0,Y.tenantsBaseInOrder))}),[Y,T,r,j]),w.useEffect((()=>{p==="In-Progress"&&O(F.TENANT_FETCHING),p!=="Completed"&&p!=="Error"||(p==="Completed"&&b!=null?(v(),_.markActiveTenantFetchCompleted(b)):p==="Error"&&b!=null&&(_.markActiveTenantFetchFailed(b),H(F.TENANT_FETCHING),H(F.TENANT_SWITCHING))),T!=="Completed"&&T!=="Error"||(T==="Completed"?_.markAllTenantsFetchCompleted():T==="Error"&&_.markAllTenantsFetchFailed())}),[p,T,b,L]);const le=w.useRef(!1);w.useEffect((()=>{!le.current&&p==="Completed"&&L&&(le.current=!0,(function(o=cn,y=3e3){setTimeout((()=>{const d=n=>{if(n>=o.length)return;const c=o[n],N=dn[c];N!=null?N().then((()=>te((()=>d(n+1))))).catch((()=>te((()=>d(n+1))))):d(n+1)};te((()=>d(0)))}),y)})())}),[p,L]);const P=r?.userRole!=null&&vs(r?.userRole),{isFeatureEnabled:Ye}=B(M.isReferralFeatureEnabled),qe=r?.userRole!=null&&r.userRole.includes("charge_card_user"),We=r?.userRole!=null&&r.userRole.includes("charge_card_admin"),U=r?.userRole!=null&&pe(r.userRole),ue=r?.company==null||r.company.featuresActivationInfo?.isBillPayFeatureEnabled&&!P,de=!Se&&!P,Xe=Os(h?.loggedInUserRoleMap),Ke=r.externalConnections?.accounting[0]?.isValid,Qe=r.externalConnections?.fetchState==="Completed",se=r.company?.companyOnboardingInfo.isOnboardingCompleted,ce=r?.company==null||r.company.featuresActivationInfo?.isReimbursementFeatureEnabled&&!P,me=ce&&Ps(h?.loggedInUserRoleMap),_e=Fe&&!P,Je=Le&&!P,es=ue&&ws(h?.loggedInUserRoleMap),ss=de&&Us(h?.loggedInUserRoleMap),ns=_e&&Fs(h?.loggedInUserRoleMap),ts=Ls(h?.loggedInUserRoleMap),as=ks(h?.loggedInUserRoleMap),os=Hs(h?.loggedInUserRoleMap),rs=Vs(h?.loggedInUserRoleMap),is=Ss(h?.loggedInUserRoleMap),g=Bs(h?.loggedInUserRoleMap),R=Ns(h?.loggedInUserRoleMap),Ee=ue&&g,he=ce&&R,x=_e&&os,I=Je&&rs,m=de&&is,ls=r.excludedResources?.resources?.find((o=>o.resource==="/invites"))!=null||$e===!0||Xe===!0||ts===!0||as===!0;return D.isSignedIn()?b==null?T==="Completed"?e.jsx(u,{to:"/",replace:!0,state:{...z.state,message:"...",origin:z.pathname}}):(j!=null&&T!=="In-Progress"&&A(ge(j.userId,j.zeniSessionId)),null):p!=="In-Progress"&&p!=="Not-Started"||T==="Completed"?(se===!0||X&&!J)&&Qe&&Ke!==!0&&E===!1&&K===!1&&re===!1?(a(void 0),e.jsx(u,{to:"/connection/auth",replace:!0})):!L||re!==!0||se!==!0||J||X?!L||se!==!1||J||X?L&&r?.userRole&&E!=null&&K!=null&&i!=null&&Object.keys(h.loggedInUserRoleMap).length>0?e.jsx(qs,{children:e.jsxs(t,{element:e.jsx(tn,{}),children:[e.jsx(t,{path:"/",element:e.jsx(Un,{isDashboardAccess:U,showZeniAccountRoute:x,isUserHasBillPayAccess:g,isUserHasReimbursementAccess:R,showTreasuryRoute:I,isTenantBankingOnly:E,isTenantCardsOnly:K,showChargeCardRoute:m})}),e.jsx(t,{path:"dashboard/*",element:U?e.jsx(xn,{}):e.jsx(f,{showZeniAccountRoute:x,isUserHasBillPayAccess:g,isUserHasReimbursementAccess:R,showTreasuryRoute:I,isTenantBankingOnly:E,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(t,{path:"reports/*",element:U?e.jsx(mn,{}):e.jsx(f,{showZeniAccountRoute:x,isUserHasBillPayAccess:g,isUserHasReimbursementAccess:R,showTreasuryRoute:I,isTenantBankingOnly:E,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(t,{path:"people/*",element:ls||U?e.jsx(En,{}):e.jsx(f,{showZeniAccountRoute:x,isUserHasBillPayAccess:g,isUserHasReimbursementAccess:R,showTreasuryRoute:I,isTenantBankingOnly:E,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(t,{path:"forecast/*",element:U?e.jsx(hn,{}):e.jsx(f,{showZeniAccountRoute:x,isUserHasBillPayAccess:g,isUserHasReimbursementAccess:R,showTreasuryRoute:I,isTenantBankingOnly:E,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(t,{path:"onboarding/*",element:e.jsx(pn,{})}),e.jsx(t,{path:"transaction/*",element:U&&P===!1||qe||We?e.jsx(Rn,{}):e.jsx(f,{showZeniAccountRoute:x,isUserHasBillPayAccess:g,isUserHasReimbursementAccess:R,showTreasuryRoute:I,isTenantBankingOnly:E,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(t,{path:"transactions/*",element:U&&P===!1?e.jsx(bn,{}):e.jsx(f,{showZeniAccountRoute:x,isUserHasBillPayAccess:g,isUserHasReimbursementAccess:R,showTreasuryRoute:I,isTenantBankingOnly:E,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(t,{path:"customer/*",element:U&&P===!1?e.jsx(Ce,{entityType:"customer"}):e.jsx(f,{showZeniAccountRoute:x,isUserHasBillPayAccess:g,isUserHasReimbursementAccess:R,isTenantBankingOnly:E,showTreasuryRoute:I,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(t,{path:"vendor/*",element:U&&P===!1?e.jsx(Ce,{entityType:"vendor"}):e.jsx(f,{showZeniAccountRoute:x,isUserHasBillPayAccess:g,isUserHasReimbursementAccess:R,showTreasuryRoute:I,isTenantBankingOnly:E,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(t,{path:"tasks",element:e.jsx(wn,{})}),e.jsx(t,{path:"tasks/*",element:e.jsx(On,{})}),e.jsx(t,{path:"address/*",element:es||me||ns||ss?e.jsx(_n,{}):e.jsx(f,{showZeniAccountRoute:x,isUserHasBillPayAccess:g,isUserHasReimbursementAccess:R,showTreasuryRoute:I,isTenantBankingOnly:E,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(t,{path:"checking/*",element:x?e.jsx(Tn,{}):e.jsx(C,{})}),e.jsx(t,{path:"treasury/*",element:I?e.jsx(An,{}):e.jsx(C,{})}),e.jsx(t,{path:"performance",element:ae===!0?e.jsx(fn,{}):e.jsx(we,{tenantEmailDomain:i})}),e.jsx(t,{path:"month_end_close_checks/review/*",element:ae===!0&&P===!1?e.jsx(Cn,{}):e.jsx(we,{tenantEmailDomain:i})}),e.jsx(t,{path:"notifications/*",element:e.jsx(Dn,{})}),e.jsx(t,{path:"vendors/*",element:Ge?e.jsx(gn,{}):e.jsx(C,{})}),e.jsx(t,{path:"bill/*",element:Ee?e.jsx(ve,{}):e.jsx(f,{showZeniAccountRoute:x,isUserHasBillPayAccess:g,isUserHasReimbursementAccess:R,showTreasuryRoute:I,isTenantBankingOnly:E,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(t,{path:"bills/*",element:Ee?e.jsx(ve,{}):e.jsx(f,{showZeniAccountRoute:x,isUserHasBillPayAccess:g,isUserHasReimbursementAccess:R,showTreasuryRoute:I,isTenantBankingOnly:E,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(t,{path:"reimbursement/*",element:he?e.jsx(Oe,{}):e.jsx(f,{showZeniAccountRoute:x,isUserHasBillPayAccess:g,isUserHasReimbursementAccess:R,showTreasuryRoute:I,isTenantBankingOnly:E,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(t,{path:"reimbursements/*",element:he?e.jsx(Oe,{}):e.jsx(f,{showZeniAccountRoute:x,isUserHasBillPayAccess:g,isUserHasReimbursementAccess:R,showTreasuryRoute:I,isTenantBankingOnly:E,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(t,{path:"settings/*",element:Be?e.jsx(In,{hasAdminLevelAccess:me}):e.jsx(C,{})}),e.jsx(t,{path:"invoicing/*",element:Me&&Ze?e.jsx(jn,{}):e.jsx(C,{})}),e.jsx(t,{path:"cards/ask",element:m&&Z?e.jsx(Pe,{isFileUploadEnabled:Q}):e.jsx(C,{})}),e.jsx(t,{path:"cards/ask/:session_id",element:m&&Z?e.jsx(Pe,{isFileUploadEnabled:Q}):e.jsx(C,{})}),e.jsx(t,{path:"cards/*",element:m?e.jsx(yn,{}):e.jsx(C,{})}),e.jsx(t,{path:"rewards/*",element:Ye?e.jsx(vn,{}):e.jsx(C,{})}),e.jsx(t,{path:"/ai-cfo",element:Z?e.jsx(u,{to:"explore"}):e.jsx(C,{})}),e.jsx(t,{path:"/ai-cfo/",element:Z?e.jsx(u,{to:"explore"}):e.jsx(C,{})}),e.jsx(t,{path:"/ai-cfo/:session_id",element:Z?e.jsx(Pn,{isFileUploadEnabled:Q}):e.jsx(C,{})}),e.jsx(t,{path:"*",element:e.jsx(C,{})})]})}):null:(a(void 0),e.jsx(u,{to:`/${i}/onboarding`,replace:!0})):(a(void 0),e.jsx(u,{to:`/${i}/onboarding/thankyou`,replace:!0})):null:(console.warn("User logged out!!"),a(void 0),e.jsx(u,{to:"/signin/auth",replace:!0,state:{...z.state,message:"...",origin:z.pathname}}))}},Symbol.toStringTag,{value:"Module"}));export{f as F,Mn as S};
@@ -1 +0,0 @@
1
- import{j as u}from"./liveblocks-B3m51ZRo.js";import{a as f,R as x,q as A}from"./sentry-DI7gLUjw.js";import{u as D,h as z,j as l,g as j,N as M,l as O}from"./core-gUqdW_kq.js";import{u as P,z as s,E as B,k as w,G as F,T as _,U as N,V,W as $,Z as W,X as v}from"./index-DRDpUzzs.js";import{fE as q,Tb as J,Tv as R,gh as X,gj as Z,TA as G,gT as H,di as K,TB as T,TC as Q,TD as Y,b$ as y}from"./zeni-epic-state-C-d25VTi.js";import"./mui-DCW4m3lZ.js";import{u as ee}from"./useDeviceId-kl-tdydV.js";import{f as te}from"./analyticsHelper-BBEm35nD.js";import{t as ne}from"./getLocaleForTenant-BFGbVplK.js";import"./recharts-HpXoq1DR.js";import"./analytics-BvodL4nJ.js";import"./plaid-BrXe9xNf.js";import"./dnd-YSyN45zY.js";import"./stripe-cKAAJElX.js";import"./lottie-DLBd_qLT.js";import"./lexical-Euc6kCJG.js";import"./pdf-BDXl9G7N.js";import"./utils-8Dv5nUFZ.js";(function(){try{var t=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},i=new t.Error().stack;i&&(t._sentryDebugIds=t._sentryDebugIds||{},t._sentryDebugIds[i]="a2d53080-b532-476a-a15b-584a0169c19a",t._sentryDebugIdIdentifier="sentry-dbid-a2d53080-b532-476a-a15b-584a0169c19a")}catch{}})();const ie=O((function(t,i){const d=t.tenantState.fetchState,g=t.tenantState.sendEmailMagicLinkFetchState,{magicLinkExpired:n,magicLinkAlreadyUsed:a,magicLinkExpiredEmail:c}=i;return{googleClientId:v.googleClientId,microsoftClientId:v.microsoftClientId,signInError:t.tenantState.error?.error,fetchState:d,sendMagicLinkStatus:g,magicLinkExpired:n,magicLinkAlreadyUsed:a,magicLinkExpiredEmail:c}}),(function(t,i){const{location:d,navigate:g}=i;return console.warn(JSON.stringify(window.location)),{onOAuthError:(n,a)=>{A({message:`OAuth error from provider ${a} with error ${n}`,level:"error",tags:{authProvider:a,errorType:"zeni.login.error"},extra:{error:n,windowLocation:window.location.href}})},onOAuthSuccess:(n,a)=>{const c=a==="google"?window.location.origin:window.location.origin+window.location.pathname;t(Y({authCode:n,oauthProvider:a,appType:"web",redirectUri:y(c),sourceUri:y(d.state!=null?d.state.origin:"")}))},getSignedInUser:()=>s.getSignedInUser(),onSignedInCallback:()=>{const n=d.state?.origin;n&&n!=="/"?g(n,{replace:!0}):window.open(window.location.origin,"_self")},sendMagicLink:n=>{const{deviceId:a}=i;a!=null&&(s.saveMagicLinkEmail(n),t(Q(n,a)))},clearSignInError:()=>{t(T())}}}))(W),ae=x.memo(ie);function ve({setTenantEmailDomain:t}){const i=D(),d=z(),{clearAllLoading:g}=P(),n=s.getSignedInUser();f.useLayoutEffect((()=>{g()}),[g]);const a=ee(),c=l((e=>e.tenantState.magicLinkCodeVerifier)),{sendEmailMagicLinkFetchState:E,accountLocked:b,accountUnlockTime:h}=l((e=>e.tenantState)),p=l((e=>e.tenantState.fetchState)),k=l((e=>e.tenantState.activeTenantFetchState.fetchState)),S=l((e=>e.tenantState.signInState)),o=l((e=>e.tenantState.loggedInUser)),r=l((e=>q(e))),I=l((e=>J(e))),m=j(),L=B().mode,C=m.state?.magicLinkExpired,U=m.state?.magicLinkAlreadyUsed;if(f.useEffect((()=>{E.fetchState==="Completed"&&c!=null&&(w.trackSignInLinkSent(),s.saveMagicLinkCodeVerifier(c))}),[E.fetchState,c]),f.useEffect((()=>{t(void 0)}),[]),f.useEffect((()=>{S!=="In-Progress"||p!=="Completed"&&k!=="Completed"||o?.zeniSessionId==null||r==null||(s.savePayNowInfoTooltip(!0,o.zeniSessionId),s.saveSignedInUserWithSession(o,o.zeniSessionId),s.saveSignedInUserTenants(R(I.tenantsInOrder),o.zeniSessionId),X(o.userId,o.zeniSessionId,r.tenantId),i(Z(r.tenantId)),s.saveActiveTenantDomainForUser(r.tenantEmailDomain),i(G("Completed")),F.updateAppLocaleID(ne(r)),te(o,r,L,void 0,I.tenantsInOrder),H().then((()=>{const e=$();e!=null&&_(e)})),setTimeout((()=>{w.trackLogin(N.Event.loginSuccess,o.authProvider??"google",K(r.productSettings))}),2e3))}),[S,p,k,o,r,I,L,m.state,i]),S==="In-Progress"&&p==="Completed"&&o?.zeniSessionId!=null&&r!=null||n!=null){const e=m.state?.origin??"/";return u.jsx(M,{to:e,state:{...m.state,origin:""}})}return u.jsxs(u.Fragment,{children:[u.jsx(ae,{magicLinkExpired:!!C,magicLinkAlreadyUsed:!!U,magicLinkExpiredEmail:s.getMagicLinkEmail()??void 0,location:m,navigate:d,deviceId:a??void 0,showEmailLogin:!0}),b===!0&&h!=null?u.jsx(V,{onClose:()=>i(T()),unlockDate:h}):null]})}export{ve as default};
@@ -1,9 +0,0 @@
1
- import{j as s}from"./liveblocks-B3m51ZRo.js";import{a as i}from"./sentry-DI7gLUjw.js";import{u as l,g as c,N as u}from"./core-gUqdW_kq.js";import{z as n,k as a,U as m,a7 as p}from"./index-DRDpUzzs.js";import{gW as g,TR as y}from"./zeni-epic-state-C-d25VTi.js";import{n as b}from"./mui-DCW4m3lZ.js";import"./recharts-HpXoq1DR.js";import"./analytics-BvodL4nJ.js";import"./plaid-BrXe9xNf.js";import"./dnd-YSyN45zY.js";import"./stripe-cKAAJElX.js";import"./lottie-DLBd_qLT.js";import"./lexical-Euc6kCJG.js";import"./pdf-BDXl9G7N.js";import"./utils-8Dv5nUFZ.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]="678d9fd4-058e-4235-b8e9-1179ffb13e8c",e._sentryDebugIdIdentifier="sentry-dbid-678d9fd4-058e-4235-b8e9-1179ffb13e8c")}catch{}})();function L(){const e=l(),t=c(),r=i.useRef(!1),f=n.isSignedIn(),o=t.state?.message==="logout"||f;return i.useEffect((()=>{if(o&&!r.current){r.current=!0;try{e(g()),y(),a.trackLogout(m.Event.logoutSuccess),a.resetUserIdentity(),n.clearAll()}catch(d){console.error("Error during sign out:",d)}finally{window.location.replace("/signin/auth")}}}),[o,e]),o?s.jsx(h,{children:s.jsx(p,{fetchState:"In-Progress"})}):s.jsx(u,{to:"../",replace:!0})}const h=b.div`
2
- display: flex;
3
- height: 100vh;
4
- width: 100%;
5
- flex: 1 1 auto;
6
- flex-direction: column;
7
- align-items: center;
8
- background-color: ${e=>e.theme.colors.grey4};
9
- `;export{L as default};