@zeniai/web-app-ui 5.0.95-qa → 5.0.96-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 (121) hide show
  1. package/dist/assets/AddressRoutes-DrJ0R4zA.js +1 -0
  2. package/dist/assets/{AddressScreen-CqBa6_-n.js → AddressScreen-Bg11cvW7.js} +2 -2
  3. package/dist/assets/{AiCfoScreen-BXUvjbhu.js → AiCfoScreen-ttXGMdMj.js} +5 -5
  4. package/dist/assets/{BillPayApprovalRoutes-DLpMtIRS.js → BillPayApprovalRoutes-DSmsDGfo.js} +1 -1
  5. package/dist/assets/{BillPayRoutes-B5l3Tw20.js → BillPayRoutes-DJZxWW5J.js} +34 -34
  6. package/dist/assets/{BusinessVerificationPageScreen-CSKO8lFK.js → BusinessVerificationPageScreen-Bgww5Eni.js} +2 -2
  7. package/dist/assets/{ChargeCardRoutes-jWkInVo_.js → ChargeCardRoutes-DBBIBX3p.js} +8 -8
  8. package/dist/assets/{CompanyPassportScreen-CKvp1ssr.js → CompanyPassportScreen-BY6KqDn5.js} +1 -1
  9. package/dist/assets/ConnectionAuthScreen-BBpw2AR4.js +11 -0
  10. package/dist/assets/CustomerOnboardingAuthScreen-BwmSNWEA.js +1 -0
  11. package/dist/assets/{CustomerOnboardingRoutes-Dr5zRy1K.js → CustomerOnboardingRoutes-CBskXxxc.js} +1 -1
  12. package/dist/assets/{DashboardRoutes-pJhHX-2b.js → DashboardRoutes-B7wfzxUf.js} +4 -4
  13. package/dist/assets/{DefaultTenantHome-DPWdITeE.js → DefaultTenantHome--GVn7qHn.js} +1 -1
  14. package/dist/assets/DomesticWireDetailScreen-CdWlbEyV.js +18 -0
  15. package/dist/assets/DrawerScreen-Cme8vixt.js +1 -0
  16. package/dist/assets/EntityDetailRoutes-mC151u-W.js +1 -0
  17. package/dist/assets/{ExpenseAutomationRoutes-ARewAzCQ.js → ExpenseAutomationRoutes-BI8ssrmn.js} +4 -4
  18. package/dist/assets/FeaturePreviewScreen-CKIBiLol.js +1 -0
  19. package/dist/assets/{HubSpotOAuthCallbackScreen-DZdAM3r7.js → HubSpotOAuthCallbackScreen-BooPYq0F.js} +1 -1
  20. package/dist/assets/MagicLinkRoutes-6F4w3fCs.js +72 -0
  21. package/dist/assets/MagicLinkSignInScreen-CBTOwBE4.js +12 -0
  22. package/dist/assets/{MobileAppDrawer-DjZLcHYq.js → MobileAppDrawer-6SipHCGH.js} +1 -1
  23. package/dist/assets/NotFoundScreen-BbD7D-7R.js +1 -0
  24. package/dist/assets/{NotificationRoutes-BoplnVa2.js → NotificationRoutes-CZA_Ly2E.js} +1 -1
  25. package/dist/assets/OAuthConsentScreen-BQ6c6hkL.js +1 -0
  26. package/dist/assets/PandLWithForecastRoutes-CFV6-GFH.js +1 -0
  27. package/dist/assets/{PeopleRoutes-DreG0KS5.js → PeopleRoutes-CQZMU4bx.js} +5 -5
  28. package/dist/assets/PerformanceRoutes-D4TOcMhX.js +1 -0
  29. package/dist/assets/{Preview-DVbW5PS-.js → Preview-De8DjXIQ.js} +1 -1
  30. package/dist/assets/{QBOConnectionScreen-DckktUOs.js → QBOConnectionScreen-C6YL0sDk.js} +1 -1
  31. package/dist/assets/ReferralListScreen-pub9zNod.js +5 -0
  32. package/dist/assets/ReimbursementApprovalRoutes-CtZYMXXf.js +1 -0
  33. package/dist/assets/{ReimbursementApprovalRuleDetailScreen-BK03a97e.js → ReimbursementApprovalRuleDetailScreen-Cyjo3GHG.js} +1 -1
  34. package/dist/assets/{ReimbursementRoutes-BOTzgYhv.js → ReimbursementRoutes-MFX8Bud0.js} +4 -4
  35. package/dist/assets/{ReportsRoutes-d5fJ62NK.js → ReportsRoutes-CFENeNIe.js} +1 -1
  36. package/dist/assets/RewardsRoutes-C9SyzdEY.js +1 -0
  37. package/dist/assets/{ScreenRoutes-D5644a5x.js → ScreenRoutes-BeA1lKqC.js} +2 -2
  38. package/dist/assets/{SettingsRoutes-DOALXrsx.js → SettingsRoutes-CeD2DwUh.js} +7 -7
  39. package/dist/assets/{SetupPagesScreen-BYhmd0-N.js → SetupPagesScreen-A0QZWQlp.js} +5 -5
  40. package/dist/assets/SignInScreen-BLRkAV-s.js +1 -0
  41. package/dist/assets/SignOutScreen-BmLBsLVz.js +9 -0
  42. package/dist/assets/{TaskListScreen-DXLUHaMY.js → TaskListScreen-oD_ucU4f.js} +2 -2
  43. package/dist/assets/{TaskRoutes-CBpVhxjZ.js → TaskRoutes-DE3EZJLP.js} +2 -2
  44. package/dist/assets/{TransactionDetailRoutes-BM0mSWXo.js → TransactionDetailRoutes-DUjSaKyf.js} +1 -1
  45. package/dist/assets/{TransactionDetailScreen-Mjv-0Vsi.js → TransactionDetailScreen-B3uLE8LG.js} +2 -2
  46. package/dist/assets/{TransactionListRoutes-DX4_qMdv.js → TransactionListRoutes-BlbqsdwG.js} +1 -1
  47. package/dist/assets/{TreasuryRoutes-33SOS81s.js → TreasuryRoutes-BzlbCHr7.js} +6 -6
  48. package/dist/assets/{VendorsRoutes-D8t3eTpL.js → VendorsRoutes-CW522oMp.js} +1 -1
  49. package/dist/assets/WiseConfirmationScreen-D-jXv9gV.js +12 -0
  50. package/dist/assets/{ZeniAccountRoutes-BhbbjK45.js → ZeniAccountRoutes-CSBwxnuu.js} +10 -10
  51. package/dist/assets/ZeniAccountStatementScreen-Dmd7_0nF.js +9 -0
  52. package/dist/assets/{accountMappingHelper-DdryjbCH.js → accountMappingHelper-CoDQ683a.js} +1 -1
  53. package/dist/assets/{analytics-B35UERag.js → analytics-CztvM7Zo.js} +1 -1
  54. package/dist/assets/{analyticsHelper-Cnf9wNpk.js → analyticsHelper-DidHWGct.js} +1 -1
  55. package/dist/assets/{core-B20PugrR.js → core-CAUatE6D.js} +1 -1
  56. package/dist/assets/{decodeURIComponentSafe-HZX6LUOb.js → decodeURIComponentSafe-M2sJXq9C.js} +1 -1
  57. package/dist/assets/{dnd-CTNaOehy.js → dnd-DoUvAW-O.js} +1 -1
  58. package/dist/assets/{empty-DbjE3Pml.js → empty-BtvkP3hw.js} +1 -1
  59. package/dist/assets/{empty-DqPV1QMu.js → empty-D8yvrubO.js} +1 -1
  60. package/dist/assets/{emptyVideoElement-D5A8Alvf.js → emptyVideoElement-Bd8ec_3G.js} +1 -1
  61. package/dist/assets/{epic-C05Fn23e.js → epic-CGb2Dbds.js} +1 -1
  62. package/dist/assets/getLocaleForTenant-DjpfkvqM.js +1 -0
  63. package/dist/assets/{index-DODLcfP6.js → index--Cei8VXn.js} +1 -1
  64. package/dist/assets/{index-DwJt1swd.js → index-7hhSQ-_M.js} +1 -1
  65. package/dist/assets/{index-qbNk-Sh2.js → index-BBI_6CLT.js} +1 -1
  66. package/dist/assets/{index-BJUGjRvu.js → index-BRSfwvH4.js} +1 -1
  67. package/dist/assets/{index-DDN5QRfh.js → index-DklNZPEZ.js} +2 -2
  68. package/dist/assets/{index-Dh7l3Ca4.js → index-eEJDMus_.js} +1 -1
  69. package/dist/assets/{index-CtCI_jgi.js → index-ssCDruz8.js} +7428 -7430
  70. package/dist/assets/{index-Dx-tgz0s.js → index-uJrW53Lh.js} +1 -1
  71. package/dist/assets/{lexical-BDpP_OMn.js → lexical-B4m6CLZ0.js} +1 -1
  72. package/dist/assets/{liveblocks-BSDLCmF2.js → liveblocks-Do-nuGO9.js} +1 -1
  73. package/dist/assets/{lottie-DG71PfmK.js → lottie-DhqFkmtq.js} +1 -1
  74. package/dist/assets/{mui-BBkBdMVO.js → mui-Ee2kkUYC.js} +1 -1
  75. package/dist/assets/{pathToGoBack-BJj5tqvK.js → pathToGoBack-m6LhD1oT.js} +1 -1
  76. package/dist/assets/{pdf-Cp8DoYAG.js → pdf-DGClrODY.js} +4 -4
  77. package/dist/assets/{pdf-lib-BqwRJQ00.js → pdf-lib-QKmlG01y.js} +1 -1
  78. package/dist/assets/{plaid-DHvUog4a.js → plaid-BfqKUq3C.js} +1 -1
  79. package/dist/assets/{pusher-DsZLo3j0.js → pusher-D-t7eVeO.js} +1 -1
  80. package/dist/assets/{react-DpONCvOo.js → react-BJcwMgz5.js} +1 -1
  81. package/dist/assets/{react-BUTkVbbW.js → react-C1ZZYDEp.js} +1 -1
  82. package/dist/assets/{react-D4RyndA4.js → react-D7LvJpSs.js} +1 -1
  83. package/dist/assets/{react-zGcoIiO8.js → react-DNnZi339.js} +1 -1
  84. package/dist/assets/{react-Uu6ZW5p-.js → react-DWvyJqE6.js} +1 -1
  85. package/dist/assets/{react-BPL_4xi4.js → react-mujJLjaM.js} +1 -1
  86. package/dist/assets/{recharts-BzjcN9SN.js → recharts-DfwJcvGU.js} +1 -1
  87. package/dist/assets/{routePaths-Bd-gFJIO.js → routePaths-C0HYOQUJ.js} +1 -1
  88. package/dist/assets/{sentry-67DqaLi1.js → sentry-CpVyi-77.js} +1 -1
  89. package/dist/assets/{url-DgheZiFv.js → url-Dj6kXEk9.js} +1 -1
  90. package/dist/assets/{url-D5ovKX_j.js → url-Dp0KhTaX.js} +1 -1
  91. package/dist/assets/{useAiCfoDashboardSuggestedQuestionsChips-CjjIkZeq.js → useAiCfoDashboardSuggestedQuestionsChips-BymSQq_a.js} +1 -1
  92. package/dist/assets/useAskAiCfoHostNavButtonProps-BiHuzfAQ.js +1 -0
  93. package/dist/assets/{useDeviceId-CZrGGxHD.js → useDeviceId-BXZMNB1t.js} +1 -1
  94. package/dist/assets/{useInitialThreadRequest-CHUXHA4e.js → useInitialThreadRequest-DnRRNYgw.js} +1 -1
  95. package/dist/assets/{utils-C7uJ9upL.js → utils-Bgxe0MRZ.js} +1 -1
  96. package/dist/assets/{withTransactionSidePanel-KXh--JtC.js → withTransactionSidePanel-DKaQybw-.js} +3 -3
  97. package/dist/assets/{zeni-epic-state-B3AwsZqW.js → zeni-epic-state-Cb-J9Nxh.js} +3 -3
  98. package/dist/index.html +1 -1
  99. package/package.json +2 -2
  100. package/dist/assets/AddressRoutes-CjTHTSuI.js +0 -1
  101. package/dist/assets/ConnectionAuthScreen-B4RQUYL_.js +0 -11
  102. package/dist/assets/CustomerOnboardingAuthScreen-BGqU9gPw.js +0 -1
  103. package/dist/assets/DomesticWireDetailScreen-SKLAPI0e.js +0 -18
  104. package/dist/assets/DrawerScreen-D5UV8-Be.js +0 -1
  105. package/dist/assets/EntityDetailRoutes-gOpFte8h.js +0 -1
  106. package/dist/assets/FeaturePreviewScreen-CWGIZoD1.js +0 -1
  107. package/dist/assets/MagicLinkRoutes-GUUoK2nF.js +0 -72
  108. package/dist/assets/MagicLinkSignInScreen-Im4VESmI.js +0 -12
  109. package/dist/assets/NotFoundScreen-GGUH6kfI.js +0 -1
  110. package/dist/assets/OAuthConsentScreen-DxwRtYz2.js +0 -1
  111. package/dist/assets/PandLWithForecastRoutes-D8O3Fecf.js +0 -1
  112. package/dist/assets/PerformanceRoutes-BWWDxy3D.js +0 -1
  113. package/dist/assets/ReferralListScreen-deq5DiBs.js +0 -5
  114. package/dist/assets/ReimbursementApprovalRoutes-XhXfCwat.js +0 -1
  115. package/dist/assets/RewardsRoutes-C4s9WH-A.js +0 -1
  116. package/dist/assets/SignInScreen-CLFmIoF3.js +0 -1
  117. package/dist/assets/SignOutScreen-GZOa1gnF.js +0 -9
  118. package/dist/assets/WiseConfirmationScreen-C9nK-3Oh.js +0 -12
  119. package/dist/assets/ZeniAccountStatementScreen-BSfOyBC_.js +0 -9
  120. package/dist/assets/getLocaleForTenant-DX4sTRBy.js +0 -1
  121. package/dist/assets/useAskAiCfoHostNavButtonProps-CMgniebB.js +0 -1
@@ -1,4 +1,4 @@
1
- import{j as a}from"./liveblocks-BSDLCmF2.js";import{a as p}from"./sentry-67DqaLi1.js";import{h as _,g as R,u as k,j as h,n as F,i as B,o as Y,p as C}from"./core-B20PugrR.js";import{bn as xe,eP as j,gK as de,Lr as Ee,py as Ae,jD as ue,lW as we,gM as je,Lt as Pe,Ls as ke,NS as ve,xL as De,Ce as Me,Nr as Ue,NA as _e,c2 as X,cH as Te,cI as Re,Jy as Fe,NT as Be,Jz as Oe,wb as Ve,NU as Ne,Eu as Le,BW as $e,BN as pe,BK as Ke,wf as ge,BQ as me,BT as fe,BZ as ee,sM as ne,we as ze,jf as q,ji as he,NV as Je,kj as Ze,wu as Ge,Km as He,Kn as We,jd as Ye,NW as qe,jg as Qe,ra as Xe,NX as en,NY as nn,re as tn,gm as an,JH as se,gt as sn,JI as on,wr as cn,NZ as rn,N_ as ln,Cb as dn,eY as be,e_ as Se,N$ as un,fA as pn,JR as gn,wq as oe,fF as ie,fE as mn,wp as fn,fD as hn,fC as bn,O0 as Sn,f1 as Ie,O1 as In,O2 as yn,wx as Cn,wo as ce,O3 as xn,fi as En,wl as An,bV as wn,c1 as jn,c0 as Pn,bW as kn,b_ as vn,bZ as Dn,bY as Mn,b$ as Un,bX as _n}from"./zeni-epic-state-B3AwsZqW.js";import{w as te,I as M,z as x,af as ye,bI as Tn,d as K,f as Rn,k as O,x as ae,bJ as Fn,bK as Bn,aq as On,i as Ce,bL as Vn,bM as Nn,bN as Ln,a9 as $n,Y as Kn,bO as zn,s as Jn,bP as Zn}from"./index-CtCI_jgi.js";import{n as U}from"./mui-BBkBdMVO.js";import{M as v}from"./MobileAppDrawer-DjZLcHYq.js";import{a as L,g as $,m as Gn}from"./accountMappingHelper-DdryjbCH.js";import{t as Hn,A as Wn}from"./AddressScreen-CqBa6_-n.js";import T from"./NotFoundScreen-GGUH6kfI.js";import{g as Yn}from"./analyticsHelper-Cnf9wNpk.js";import{B as qn}from"./BusinessVerificationPageScreen-CSKO8lFK.js";import{C as Qn}from"./CompanyPassportScreen-CKvp1ssr.js";import{q as re}from"./QBOConnectionScreen-DckktUOs.js";import{B as Xn}from"./BillPayApprovalRoutes-DLpMtIRS.js";import{R as et}from"./ReimbursementApprovalRoutes-XhXfCwat.js";import"./recharts-BzjcN9SN.js";import"./analytics-B35UERag.js";import"./plaid-DHvUog4a.js";import"./dnd-CTNaOehy.js";import"./stripe-DMRn4zHo.js";import"./lottie-DG71PfmK.js";import"./lexical-BDpP_OMn.js";import"./pdf-Cp8DoYAG.js";import"./utils-C7uJ9upL.js";import"./routePaths-Bd-gFJIO.js";import"./empty-DbjE3Pml.js";import"./pdf-lib-BqwRJQ00.js";import"./index-qbNk-Sh2.js";import"./url-D5ovKX_j.js";import"./index-Dx-tgz0s.js";import"./decodeURIComponentSafe-HZX6LUOb.js";import"./ReimbursementApprovalRuleDetailScreen-BK03a97e.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]="54fcb11b-7e44-4018-808a-03d264075568",e._sentryDebugIdIdentifier="sentry-dbid-54fcb11b-7e44-4018-808a-03d264075568")}catch{}})();const nt=U.div`
1
+ import{j as a}from"./liveblocks-Do-nuGO9.js";import{a as p}from"./sentry-CpVyi-77.js";import{h as _,g as R,u as k,j as h,n as B,i as F,o as q,p as C}from"./core-CAUatE6D.js";import{bn as xe,eP as j,gK as de,Lr as Ee,py as Ae,jD as ue,lW as we,gM as je,Lt as Pe,Ls as ke,NS as ve,xL as De,Ce as Me,Nr as Ue,NA as _e,c2 as X,cH as Te,cI as Re,Jy as Be,NT as Fe,Jz as Oe,wb as Ve,NU as Ne,Eu as Le,BW as $e,BN as pe,BK as Ke,wf as ge,BQ as me,BT as fe,BZ as ee,sM as ne,we as ze,jf as Q,ji as he,NV as Je,kj as Ze,wu as Ge,Km as He,Kn as We,jd as qe,NW as Qe,jg as Ye,ra as Xe,NX as en,NY as nn,re as tn,gm as an,JH as se,gt as sn,JI as on,wr as cn,NZ as rn,N_ as ln,Cb as dn,eY as be,e_ as Se,N$ as un,fA as pn,JR as gn,wq as oe,fF as ie,fE as mn,wp as fn,fD as hn,fC as bn,O0 as Sn,f1 as Ie,O1 as In,O2 as yn,wx as Cn,wo as ce,O3 as xn,fi as En,wl as An,bV as wn,c1 as jn,c0 as Pn,bW as kn,b_ as vn,bZ as Dn,bY as Mn,b$ as Un,bX as _n}from"./zeni-epic-state-Cb-J9Nxh.js";import{w as te,I as M,z as x,af as ye,bI as Tn,c as K,e as Rn,k as O,B as ae,bJ as Bn,bK as Fn,aq as On,i as Ce,bL as Vn,bM as Nn,bN as Ln,a9 as $n,W as Kn,bO as zn,m as Jn,bP as Zn}from"./index-ssCDruz8.js";import{n as U}from"./mui-Ee2kkUYC.js";import{M as v}from"./MobileAppDrawer-6SipHCGH.js";import{a as L,g as $,m as Gn}from"./accountMappingHelper-CoDQ683a.js";import{t as Hn,A as Wn}from"./AddressScreen-Bg11cvW7.js";import T from"./NotFoundScreen-BbD7D-7R.js";import{g as qn}from"./analyticsHelper-DidHWGct.js";import{B as Qn}from"./BusinessVerificationPageScreen-Bgww5Eni.js";import{C as Yn}from"./CompanyPassportScreen-BY6KqDn5.js";import{q as re}from"./QBOConnectionScreen-C6YL0sDk.js";import{B as Xn}from"./BillPayApprovalRoutes-DSmsDGfo.js";import{R as et}from"./ReimbursementApprovalRoutes-CtZYMXXf.js";import"./recharts-DfwJcvGU.js";import"./analytics-CztvM7Zo.js";import"./plaid-BfqKUq3C.js";import"./dnd-DoUvAW-O.js";import"./stripe-DMRn4zHo.js";import"./lottie-DhqFkmtq.js";import"./lexical-B4m6CLZ0.js";import"./pdf-DGClrODY.js";import"./utils-Bgxe0MRZ.js";import"./routePaths-C0HYOQUJ.js";import"./empty-BtvkP3hw.js";import"./pdf-lib-QKmlG01y.js";import"./index-BBI_6CLT.js";import"./url-Dp0KhTaX.js";import"./index-uJrW53Lh.js";import"./decodeURIComponentSafe-M2sJXq9C.js";import"./ReimbursementApprovalRuleDetailScreen-Cyjo3GHG.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]="36f52a0f-fa7c-4420-96d7-e8a9a803cb52",e._sentryDebugIdIdentifier="sentry-dbid-36f52a0f-fa7c-4420-96d7-e8a9a803cb52")}catch{}})();const nt=U.div`
2
2
  display: flex;
3
3
  height: 100%;
4
4
  width: 100%;
@@ -6,7 +6,7 @@ import{j as a}from"./liveblocks-BSDLCmF2.js";import{a as p}from"./sentry-67DqaLi
6
6
  flex-direction: column;
7
7
  align-items: center;
8
8
  background-color: ${e=>e.theme.colors.grey4};
9
- `,tt=F(function(e,s){return{accountMappingView:s.accountMappingView,isFiling1099FeatureEnabled:s.isFiling1099FeatureEnabled,isAccruedExpensesFeatureEnabled:s.isAccruedExpensesFeatureEnabled,isAccountingClassesEnabled:ue(e),isAccountingClassesUpdateInProgress:e.companyViewState.passportView?.accountingClassesUpdateStatus?.fetchState==="In-Progress",isAccountingProjectsEnabled:Ae(e),meetingUrl:"https://meetings.hubspot.com/niharn/zeni-onboarding-overview?embed=true"}},function(e,s){const{navigate:o,location:c,isFiling1099FeatureEnabled:i}=s;return{onAccountMappingChange:n=>{const{uncategorizedAccountSection:t,billsAccountSection:r,reimbursementsAccountSection:u,vendorsAccountSection:d,filing1099Section:g}=n,{incomeAccount:f,expenseAccount:m}=t,{billPayAccount:l}=r,{reimbursementsAccount:E}=u,{prepaidExpensesAccount:I,fixedAssetsAccount:w,accruedExpensesAccount:S}=d,{bankAccount:y,expenseCategory1099:V}=g,A=L(s.accountMappingView.incomeAccountList,f.selectedOption),z=L(s.accountMappingView.expenseAccountList,m.selectedOption),J=L(s.accountMappingView.billPayAccountList,l.selectedOption),Z=L(s.accountMappingView.reimbursementsAccountList,E.selectedOption),N=$(s.accountMappingView.prepaidExpensesAccountList,I.selectedOptions),b=$(s.accountMappingView.fixedAssetsAccountList,w.selectedOptions),D=$(s.accountMappingView.accruedExpensesAccountList,S.selectedOptions),G=$(s.accountMappingView.bankAccounts1099FilingAccountList,y.selectedOptions),H=Gn(s.accountMappingView.expenseAccounts1099FilingAccountList,V),W={selectedIncomeAccountId:A?.accountId,selectedExpenseAccountId:z?.accountId,selectedBillPayAccountId:J?.accountId,selectedReimbursementsAccountId:Z?.accountId,selectedPrepaidExpensesAccountIds:N.map(P=>P.accountId),selectedFixedAssetsAccountIds:b.map(P=>P.accountId),selectedAccruedExpensesAccountIds:D.map(P=>P.accountId),selectedBankAccounts1099FilingAccountIds:G.map(P=>P.accountId),selectedExpenseAccounts1099FilingAccountIds:H};e(ke({data:W}))},onBackClick:()=>{ye(c)===!1?(o("../../dashboard"),e(Pe())):e(de())},onSaveClick:()=>{e(je()),i&&K.track(Rn.Event.vendor1099AccountingSettingsSave)},onAccountingClassesToggle:n=>{e(we(s.currentTenant.companyId,n))}}})(Tn),at=()=>{const e=_(),s=R(),o=k(),{useFeatureGate:c}=te(),{isFeatureEnabled:i}=c(M.isFiling1099FeatureEnabled),{isFeatureEnabled:n}=c(M.isScheduledJEAccruedExpensesFeatureEnabled),t=x.getSignedInUser(),r=xe(t),u=h(I=>j(I)),[d,g]=p.useState(!1),[f,m]=p.useState(!1);p.useEffect(()=>{d===!1&&(o(de()),g(!0))},[d]);const l=h(I=>Ee(I)),E=I=>{m(I)};return a.jsxs(nt,{children:[a.jsx(v,{isAppContentDrawerOpen:f,handleDrawerToggle:E}),a.jsx(tt,{currentTenant:u,navigate:e,accountMappingView:l,isFiling1099FeatureEnabled:i&&r,isAccruedExpensesFeatureEnabled:n,location:s,isSettings:ye(s),onClickMenuIcon:()=>E(!0)})]})},st=U.div`
9
+ `,tt=B(function(e,s){return{accountMappingView:s.accountMappingView,isFiling1099FeatureEnabled:s.isFiling1099FeatureEnabled,isAccruedExpensesFeatureEnabled:s.isAccruedExpensesFeatureEnabled,isAccountingClassesEnabled:ue(e),isAccountingClassesUpdateInProgress:e.companyViewState.passportView?.accountingClassesUpdateStatus?.fetchState==="In-Progress",isAccountingProjectsEnabled:Ae(e),meetingUrl:"https://meetings.hubspot.com/niharn/zeni-onboarding-overview?embed=true"}},function(e,s){const{navigate:o,location:c,isFiling1099FeatureEnabled:i}=s;return{onAccountMappingChange:n=>{const{uncategorizedAccountSection:t,billsAccountSection:r,reimbursementsAccountSection:u,vendorsAccountSection:d,filing1099Section:g}=n,{incomeAccount:f,expenseAccount:m}=t,{billPayAccount:l}=r,{reimbursementsAccount:E}=u,{prepaidExpensesAccount:I,fixedAssetsAccount:w,accruedExpensesAccount:S}=d,{bankAccount:y,expenseCategory1099:V}=g,A=L(s.accountMappingView.incomeAccountList,f.selectedOption),z=L(s.accountMappingView.expenseAccountList,m.selectedOption),J=L(s.accountMappingView.billPayAccountList,l.selectedOption),Z=L(s.accountMappingView.reimbursementsAccountList,E.selectedOption),N=$(s.accountMappingView.prepaidExpensesAccountList,I.selectedOptions),b=$(s.accountMappingView.fixedAssetsAccountList,w.selectedOptions),D=$(s.accountMappingView.accruedExpensesAccountList,S.selectedOptions),G=$(s.accountMappingView.bankAccounts1099FilingAccountList,y.selectedOptions),H=Gn(s.accountMappingView.expenseAccounts1099FilingAccountList,V),W={selectedIncomeAccountId:A?.accountId,selectedExpenseAccountId:z?.accountId,selectedBillPayAccountId:J?.accountId,selectedReimbursementsAccountId:Z?.accountId,selectedPrepaidExpensesAccountIds:N.map(P=>P.accountId),selectedFixedAssetsAccountIds:b.map(P=>P.accountId),selectedAccruedExpensesAccountIds:D.map(P=>P.accountId),selectedBankAccounts1099FilingAccountIds:G.map(P=>P.accountId),selectedExpenseAccounts1099FilingAccountIds:H};e(ke({data:W}))},onBackClick:()=>{ye(c)===!1?(o("../../dashboard"),e(Pe())):e(de())},onSaveClick:()=>{e(je()),i&&K.track(Rn.Event.vendor1099AccountingSettingsSave)},onAccountingClassesToggle:n=>{e(we(s.currentTenant.companyId,n))}}})(Tn),at=()=>{const e=_(),s=R(),o=k(),{useFeatureGate:c}=te(),{isFeatureEnabled:i}=c(M.isFiling1099FeatureEnabled),{isFeatureEnabled:n}=c(M.isScheduledJEAccruedExpensesFeatureEnabled),t=x.getSignedInUser(),r=xe(t),u=h(I=>j(I)),[d,g]=p.useState(!1),[f,m]=p.useState(!1);p.useEffect(()=>{d===!1&&(o(de()),g(!0))},[d]);const l=h(I=>Ee(I)),E=I=>{m(I)};return a.jsxs(nt,{children:[a.jsx(v,{isAppContentDrawerOpen:f,handleDrawerToggle:E}),a.jsx(tt,{currentTenant:u,navigate:e,accountMappingView:l,isFiling1099FeatureEnabled:i&&r,isAccruedExpensesFeatureEnabled:n,location:s,isSettings:ye(s),onClickMenuIcon:()=>E(!0)})]})},st=U.div`
10
10
  display: flex;
11
11
  height: 100%;
12
12
  width: 100%;
@@ -14,7 +14,7 @@ import{j as a}from"./liveblocks-BSDLCmF2.js";import{a as p}from"./sentry-67DqaLi
14
14
  flex-direction: column;
15
15
  align-items: center;
16
16
  background-color: ${e=>e.theme.colors.grey4};
17
- `,ot=F(function(e,s){const o=j(e),c=Ue(e),i=_e(e),n=s.roleMap.bill_pay_admin;return{isDisabled:(X(o?.userRole??[])||n)&&"readonly",billpayApprovalView:c,remiApproverView:i,analytics:K}},function(e,s){const{navigate:o,currentTenant:c}=s;return{onSetupApprovalRulesBillPaySectionClick:()=>{o("bills/approval-rules")},onSetupApprovalRulesRemiSectionClick:()=>{o("reimbursements/approval-rules")},onBackClick:()=>{c?.companyBillPayInfo?.info?.isBillPayEnabled!=null&&c.companyBillPayInfo.info.isBillPayEnabled===!1?o("../.."):o("../")},onNavigateToDashboard:()=>{o("../dashboard")}}})(Fn),it=()=>{const e=_(),s=R(),o=k(),{tenantEmailDomain:c}=B(),[i,n]=p.useState(!1),[t,r]=p.useState(!1),[u,d]=p.useState(!1),g=h(S=>j(S)),f=h(S=>S.billPaySetupApproverViewState.fetchState),m=h(S=>S.remiSetupApproverViewState.fetchState),l=h(S=>ve(S)),E=g.companyId??x.getSignedInUserTenant(c)?.companyId;if(x.getSignedInUser()==null)throw Error("Can't access Approval Rules settings page without signing in...");const I=O();p.useEffect(()=>{u||f!=="Not-Started"||(d(!0),o(De(!0)))},[u,f,o]),p.useEffect(()=>{t||m!=="Not-Started"||(r(!0),o(Me(!0)))},[t,m,o]);const w=S=>{n(S)};return I?.loggedInUserRoleMap!=null?a.jsxs(st,{children:[a.jsx(v,{isAppContentDrawerOpen:i,handleDrawerToggle:w}),a.jsx(ot,{navigate:e,location:s,companyId:E,currentTenant:g,roleMap:I.loggedInUserRoleMap,onClickMenuIcon:()=>{w(!0)}})]}):a.jsx(ae,{fetchState:l.fetchState})},ct=U.div`
17
+ `,ot=B(function(e,s){const o=j(e),c=Ue(e),i=_e(e),n=s.roleMap.bill_pay_admin;return{isDisabled:(X(o?.userRole??[])||n)&&"readonly",billpayApprovalView:c,remiApproverView:i,analytics:K}},function(e,s){const{navigate:o,currentTenant:c}=s;return{onSetupApprovalRulesBillPaySectionClick:()=>{o("bills/approval-rules")},onSetupApprovalRulesRemiSectionClick:()=>{o("reimbursements/approval-rules")},onBackClick:()=>{c?.companyBillPayInfo?.info?.isBillPayEnabled!=null&&c.companyBillPayInfo.info.isBillPayEnabled===!1?o("../.."):o("../")},onNavigateToDashboard:()=>{o("../dashboard")}}})(Bn),it=()=>{const e=_(),s=R(),o=k(),{tenantEmailDomain:c}=F(),[i,n]=p.useState(!1),[t,r]=p.useState(!1),[u,d]=p.useState(!1),g=h(S=>j(S)),f=h(S=>S.billPaySetupApproverViewState.fetchState),m=h(S=>S.remiSetupApproverViewState.fetchState),l=h(S=>ve(S)),E=g.companyId??x.getSignedInUserTenant(c)?.companyId;if(x.getSignedInUser()==null)throw Error("Can't access Approval Rules settings page without signing in...");const I=O();p.useEffect(()=>{u||f!=="Not-Started"||(d(!0),o(De(!0)))},[u,f,o]),p.useEffect(()=>{t||m!=="Not-Started"||(r(!0),o(Me(!0)))},[t,m,o]);const w=S=>{n(S)};return I?.loggedInUserRoleMap!=null?a.jsxs(st,{children:[a.jsx(v,{isAppContentDrawerOpen:i,handleDrawerToggle:w}),a.jsx(ot,{navigate:e,location:s,companyId:E,currentTenant:g,roleMap:I.loggedInUserRoleMap,onClickMenuIcon:()=>{w(!0)}})]}):a.jsx(ae,{fetchState:l.fetchState})},ct=U.div`
18
18
  display: flex;
19
19
  height: 100%;
20
20
  width: 100%;
@@ -22,7 +22,7 @@ import{j as a}from"./liveblocks-BSDLCmF2.js";import{a as p}from"./sentry-67DqaLi
22
22
  flex-direction: column;
23
23
  align-items: center;
24
24
  background-color: ${e=>e.theme.colors.grey4};
25
- `,rt=F(function(e,s){const{companyId:o,isZeniAccountEnabled:c,isChargeCardEnabled:i,isBillPayEnabled:n,isRemiEnabled:t,isTreasuryEnabled:r}=s,u=j(e);return{bankSetupView:Ne(e,o,n,t,c,i,r),connectedAccountProvider:u.company?.featuresActivationInfo.connectedAccountProvider??"",analytics:K}},function(e,s){const{navigate:o,currentTenant:c,companyId:i}=s;return{onFetchLinkTokenClick:(n,t,r)=>{e(ne(t,n,r))},onEstablishConnectionClick:(n,t,r)=>{e(ee(n,i,t,r))},onUpdatePaymentAccountStatus:(n,t,r,u,d)=>{e(fe(n,t,d,u,r))},onUpdatePaymentAccountLoginStatus:(n,t,r,u)=>{e(me(!1,n,u,r,t))},onEstablishConnectionSuccess:(n,t)=>{e(ge(t,n))},onUpdateAccountClick:(n,t,r,u,d)=>{e(d==="paymentAccount"?pe(n,t,r,u):Ke(u,n,t))},onUpdatePrimaryFundingAccount:(n,t,r)=>{e($e(i,t,n,r))},onRemoveConnection:n=>{e(Le(n))},onBackClick:()=>{c?.companyBillPayInfo?.info?.isBillPayEnabled!=null&&c.companyBillPayInfo.info.isBillPayEnabled===!1?o("../.."):o("../")},onNavigateToDashboard:()=>{o("../dashboard")}}})(Bn),lt=()=>{const e=_(),s=R(),o=k(),{tenantEmailDomain:c}=B(),i=O(),[n,t]=p.useState(!1),[r,u]=p.useState(!1),d=h(y=>j(y)),g=h(y=>y.settingsViewState.bankConnection.fetchState),f=Te(d,i?.loggedInUserRoleMap),m=Re(d,i?.loggedInUserRoleMap),l=Fe(d,i?.loggedInUserRoleMap),E=Be(d,i?.loggedInUserRoleMap),I=Oe(d,i?.loggedInUserRoleMap),w=d.companyId??x.getSignedInUserTenant(c)?.companyId;if(x.getSignedInUser()==null)throw Error("Can't access bank connections page without signing in...");p.useEffect(()=>{r||g==="Completed"||(u(!0),o(Ve(!1)))},[r,o,g]);const S=y=>{t(y)};return f||l||m||I?a.jsxs(ct,{children:[a.jsx(v,{isAppContentDrawerOpen:n,handleDrawerToggle:S}),a.jsx(rt,{navigate:e,location:s,companyId:w,currentTenant:d,roleMap:i.loggedInUserRoleMap,isBillPayEnabled:f,isRemiEnabled:m,isZeniAccountEnabled:l,isChargeCardEnabled:I,isTreasuryEnabled:E,onClickMenuIcon:()=>{S(!0)}})]}):a.jsx(T,{})},dt=U.div`
25
+ `,rt=B(function(e,s){const{companyId:o,isZeniAccountEnabled:c,isChargeCardEnabled:i,isBillPayEnabled:n,isRemiEnabled:t,isTreasuryEnabled:r}=s,u=j(e);return{bankSetupView:Ne(e,o,n,t,c,i,r),connectedAccountProvider:u.company?.featuresActivationInfo.connectedAccountProvider??"",analytics:K}},function(e,s){const{navigate:o,currentTenant:c,companyId:i}=s;return{onFetchLinkTokenClick:(n,t,r)=>{e(ne(t,n,r))},onEstablishConnectionClick:(n,t,r)=>{e(ee(n,i,t,r))},onUpdatePaymentAccountStatus:(n,t,r,u,d)=>{e(fe(n,t,d,u,r))},onUpdatePaymentAccountLoginStatus:(n,t,r,u)=>{e(me(!1,n,u,r,t))},onEstablishConnectionSuccess:(n,t)=>{e(ge(t,n))},onUpdateAccountClick:(n,t,r,u,d)=>{e(d==="paymentAccount"?pe(n,t,r,u):Ke(u,n,t))},onUpdatePrimaryFundingAccount:(n,t,r)=>{e($e(i,t,n,r))},onRemoveConnection:n=>{e(Le(n))},onBackClick:()=>{c?.companyBillPayInfo?.info?.isBillPayEnabled!=null&&c.companyBillPayInfo.info.isBillPayEnabled===!1?o("../.."):o("../")},onNavigateToDashboard:()=>{o("../dashboard")}}})(Fn),lt=()=>{const e=_(),s=R(),o=k(),{tenantEmailDomain:c}=F(),i=O(),[n,t]=p.useState(!1),[r,u]=p.useState(!1),d=h(y=>j(y)),g=h(y=>y.settingsViewState.bankConnection.fetchState),f=Te(d,i?.loggedInUserRoleMap),m=Re(d,i?.loggedInUserRoleMap),l=Be(d,i?.loggedInUserRoleMap),E=Fe(d,i?.loggedInUserRoleMap),I=Oe(d,i?.loggedInUserRoleMap),w=d.companyId??x.getSignedInUserTenant(c)?.companyId;if(x.getSignedInUser()==null)throw Error("Can't access bank connections page without signing in...");p.useEffect(()=>{r||g==="Completed"||(u(!0),o(Ve(!1)))},[r,o,g]);const S=y=>{t(y)};return f||l||m||I?a.jsxs(ct,{children:[a.jsx(v,{isAppContentDrawerOpen:n,handleDrawerToggle:S}),a.jsx(rt,{navigate:e,location:s,companyId:w,currentTenant:d,roleMap:i.loggedInUserRoleMap,isBillPayEnabled:f,isRemiEnabled:m,isZeniAccountEnabled:l,isChargeCardEnabled:I,isTreasuryEnabled:E,onClickMenuIcon:()=>{S(!0)}})]}):a.jsx(T,{})},dt=U.div`
26
26
  display: flex;
27
27
  height: 100%;
28
28
  width: 100%;
@@ -30,7 +30,7 @@ import{j as a}from"./liveblocks-BSDLCmF2.js";import{a as p}from"./sentry-67DqaLi
30
30
  flex-direction: column;
31
31
  align-items: center;
32
32
  background-color: ${e=>e.theme.colors.grey4};
33
- `,ut=F(function(e,s){const{companyId:o}=s,c=j(e),i=s.roleMap.bill_pay_admin,n=Je(e,o),{uiState:t}=n,r=(X(c?.userRole??[])||i)&&n.setupView.accountFetchStatus.fetchState!=="In-Progress"&&n.setupView.plaidConnectionDetails.link_account.updateStatus.fetchState!=="In-Progress"&&n.setupView.plaidConnectionDetails.update_account.updateStatus.fetchState!=="In-Progress"&&n.setupView.accountUpdateStatus.fetchState!=="In-Progress"?void 0:"readonly";return{billingSetupView:n,uiState:t,stripeKey:Ce.stripeKey,isCardPaymentPopupOpen:!1,connectedAccountProvider:c.company?.featuresActivationInfo.connectedAccountProvider??"",isDisabled:r,analytics:K}},function(e,s){const{navigate:o,currentTenant:c,companyId:i}=s;return{onFetchLinkTokenClick:(n,t)=>{e(ne("billing_setup",n,t))},onEstablishConnectionClick:n=>{e(ee(n,i,"billing_setup","billing"))},onEstablishConnectionSuccess:()=>{e(ge("billing","billing_setup"))},onUpdatePaymentAccountStatus:(n,t,r)=>{e(fe(n,t,"billing","billing_setup",r))},onUpdatePaymentAccountLoginStatus:(n,t)=>{e(me(!1,n,"billing","billing_setup",t))},onUpdateAccountClick:(n,t)=>{e(pe(n,t,"billing","billing_setup"))},onBackClick:()=>{c?.companyBillPayInfo?.info?.isBillPayEnabled!=null&&c.companyBillPayInfo.info.isBillPayEnabled===!1?o("../.."):o("../")},onNavigateToDashboard:()=>{o("../dashboard")},handleCreateCardSetupIntent:n=>{e(he(n))},handleConfirmCardSetupIntent:n=>{e(Qe(n))},updateCardPaymentModalState:n=>{e(qe({isCardPaymentPopupOpen:n}))},handleAddCardPaymentSource:(n,t,r)=>{e(Ye(n,t,r))},handleFetchPaymentSources:()=>{e(q())},resetCardPaymentViewState:()=>{e(We())},handleResetCardPaymentErrorStatuses:()=>{e(He())},onBillingAddressSave:n=>{e(Ge(n))},onAddressEditHandler:n=>{if(n!=null){const t=Hn(n);e(Ze({addressType:"subscription_billing_address",addressToCreate:t}))}}}})(Vn),pt=()=>{const e=_(),s=R(),o=k(),{tenantEmailDomain:c}=B(),[i,n]=p.useState(!1),[t,r]=p.useState(!1),[u,d]=p.useState(!1),g=h(y=>j(y)),f=h(y=>y.cardPaymentViewState),m=h(y=>y.plaidAccountViewState.billing_setup.accountDetails.fetchStatus.fetchState),l=On(f.addCardPaymentSourceStatus.fetchState),E=f.addCardPaymentSourceStatus.fetchState,I=g.companyId??x.getSignedInUserTenant(c)?.companyId;if(x.getSignedInUser()==null)throw Error("Can't access bank connections page without signing in...");const w=O();p.useEffect(()=>{I!=null&&o(ze(I,!1))},[I,o]),p.useEffect(()=>{t||(r(!0),o(q()))},[t,o]),p.useEffect(()=>{u||(he(["card"]),d(!0))},[u]),p.useEffect(()=>{l==="In-Progress"&&E==="Completed"&&o(q())},[l,E]);const S=y=>{n(y)};return w?.loggedInUserRoleMap!=null?a.jsxs(dt,{children:[a.jsx(v,{isAppContentDrawerOpen:i,handleDrawerToggle:S}),a.jsx(ut,{navigate:e,location:s,companyId:I,currentTenant:g,roleMap:w.loggedInUserRoleMap,onClickMenuIcon:()=>{S(!0)},googleAPIKey:Ce.googleMapsAPIKey})]}):a.jsx(ae,{fetchState:m})},Q="external_integrations",gt=F(function(e){const s=nn(e,Q);return{meetingUrl:"https://meetings.hubspot.com/niharn/zeni-onboarding-overview?embed=true",notifyMeRegisteredSlugs:new Set(s.map(o=>o.additionalInfo).filter(o=>o!=null))}},function(e,s){const{navigate:o,integrationsView:c,signedInUserEmail:i,tenantEmailDomain:n,tenantId:t}=s;return{onBackClick:()=>{o("../")},onNavigateToDashboard:()=>{o("../dashboard")},onReconnectQBO:()=>{re.init("/connection/auth",n),re.handleClick()},onRefreshClick:()=>{c.integrations.refreshQBO.fetchState!=="In-Progress"&&e(cn())},onSaveChargeBeeCredentials:(r,u)=>{const d=c.externalConnections?.revenue?.find(g=>g.connectionName==="chargebee")?.connectionId;d!=null&&e(sn(t,d,se("revenue"),on("chargebee"),{api_key:r,site:u}))},onConnectHubSpot:(r,u)=>{const d=c.externalConnections?.revenue?.find(g=>g.connectionName==="hubspot")?.connectionId;if(d!=null){const g=`${window.location.origin}/oauth/hubspot/callback`;sessionStorage.setItem("hubspot_oauth_pending",JSON.stringify({client_id:r,client_secret:u,connection_id:d,redirect_uri:g,tenant_id:t}));const f="oauth crm.objects.deals.read crm.objects.owners.read";window.location.href=`https://app.hubspot.com/oauth/authorize?client_id=${encodeURIComponent(r)}&scope=${encodeURIComponent(f)}&redirect_uri=${encodeURIComponent(g)}`}},onDisconnect:(r,u)=>{e(an(t,r,se(u)))},onNotifyMe:r=>{e(tn(Q,r,i))}}})(Nn),mt=()=>{const e=_(),s=k(),{tenantEmailDomain:o}=B(),[c,i]=p.useState(!1),n=h(l=>l.tenantState.fetchState),t=h(l=>j(l)),r=t.companyId??x.getSignedInUserTenant(o)?.companyId,u=x.getSignedInUser(),d=O(),g=X(t.userRole??[]);if(u==null)throw Error("Can't access Integrations page without signing in...");p.useEffect(()=>{s(Xe(Q))},[s]);const f=l=>{i(l)},m=h(l=>en(l,r));return d?.loggedInUserRoleMap!=null?a.jsxs(ft,{children:[a.jsx(v,{isAppContentDrawerOpen:c,handleDrawerToggle:f}),a.jsx(gt,{navigate:e,onClickMenuIcon:()=>{f(!0)},isAdmin:g,integrationsView:m,signedInUserEmail:u.userEmail??"",tenantEmailDomain:t.tenantEmailDomain??o??"",tenantId:t.tenantId,saveChargeBeeState:m.externalConnections?.saveAPIKeyConnectionState??"Not-Started",saveChargeBeeError:m.externalConnections?.saveAPIKeyConnectionError?.message,saveHubSpotState:m.externalConnections?.saveOAuthConnectionState??"Not-Started",saveHubSpotError:m.externalConnections?.saveOAuthConnectionError?.message,deleteConnectionState:m.externalConnections?.deleteConnectionState??"Not-Started",deleteConnectionError:m.externalConnections?.deleteConnectionError?.message,isLoading:n==="In-Progress"})]}):a.jsx(ae,{fetchState:n})},ft=U.div`
33
+ `,ut=B(function(e,s){const{companyId:o}=s,c=j(e),i=s.roleMap.bill_pay_admin,n=Je(e,o),{uiState:t}=n,r=(X(c?.userRole??[])||i)&&n.setupView.accountFetchStatus.fetchState!=="In-Progress"&&n.setupView.plaidConnectionDetails.link_account.updateStatus.fetchState!=="In-Progress"&&n.setupView.plaidConnectionDetails.update_account.updateStatus.fetchState!=="In-Progress"&&n.setupView.accountUpdateStatus.fetchState!=="In-Progress"?void 0:"readonly";return{billingSetupView:n,uiState:t,stripeKey:Ce.stripeKey,isCardPaymentPopupOpen:!1,connectedAccountProvider:c.company?.featuresActivationInfo.connectedAccountProvider??"",isDisabled:r,analytics:K}},function(e,s){const{navigate:o,currentTenant:c,companyId:i}=s;return{onFetchLinkTokenClick:(n,t)=>{e(ne("billing_setup",n,t))},onEstablishConnectionClick:n=>{e(ee(n,i,"billing_setup","billing"))},onEstablishConnectionSuccess:()=>{e(ge("billing","billing_setup"))},onUpdatePaymentAccountStatus:(n,t,r)=>{e(fe(n,t,"billing","billing_setup",r))},onUpdatePaymentAccountLoginStatus:(n,t)=>{e(me(!1,n,"billing","billing_setup",t))},onUpdateAccountClick:(n,t)=>{e(pe(n,t,"billing","billing_setup"))},onBackClick:()=>{c?.companyBillPayInfo?.info?.isBillPayEnabled!=null&&c.companyBillPayInfo.info.isBillPayEnabled===!1?o("../.."):o("../")},onNavigateToDashboard:()=>{o("../dashboard")},handleCreateCardSetupIntent:n=>{e(he(n))},handleConfirmCardSetupIntent:n=>{e(Ye(n))},updateCardPaymentModalState:n=>{e(Qe({isCardPaymentPopupOpen:n}))},handleAddCardPaymentSource:(n,t,r)=>{e(qe(n,t,r))},handleFetchPaymentSources:()=>{e(Q())},resetCardPaymentViewState:()=>{e(We())},handleResetCardPaymentErrorStatuses:()=>{e(He())},onBillingAddressSave:n=>{e(Ge(n))},onAddressEditHandler:n=>{if(n!=null){const t=Hn(n);e(Ze({addressType:"subscription_billing_address",addressToCreate:t}))}}}})(Vn),pt=()=>{const e=_(),s=R(),o=k(),{tenantEmailDomain:c}=F(),[i,n]=p.useState(!1),[t,r]=p.useState(!1),[u,d]=p.useState(!1),g=h(y=>j(y)),f=h(y=>y.cardPaymentViewState),m=h(y=>y.plaidAccountViewState.billing_setup.accountDetails.fetchStatus.fetchState),l=On(f.addCardPaymentSourceStatus.fetchState),E=f.addCardPaymentSourceStatus.fetchState,I=g.companyId??x.getSignedInUserTenant(c)?.companyId;if(x.getSignedInUser()==null)throw Error("Can't access bank connections page without signing in...");const w=O();p.useEffect(()=>{I!=null&&o(ze(I,!1))},[I,o]),p.useEffect(()=>{t||(r(!0),o(Q()))},[t,o]),p.useEffect(()=>{u||(he(["card"]),d(!0))},[u]),p.useEffect(()=>{l==="In-Progress"&&E==="Completed"&&o(Q())},[l,E]);const S=y=>{n(y)};return w?.loggedInUserRoleMap!=null?a.jsxs(dt,{children:[a.jsx(v,{isAppContentDrawerOpen:i,handleDrawerToggle:S}),a.jsx(ut,{navigate:e,location:s,companyId:I,currentTenant:g,roleMap:w.loggedInUserRoleMap,onClickMenuIcon:()=>{S(!0)},googleAPIKey:Ce.googleMapsAPIKey})]}):a.jsx(ae,{fetchState:m})},Y="external_integrations",gt=B(function(e){const s=nn(e,Y);return{meetingUrl:"https://meetings.hubspot.com/niharn/zeni-onboarding-overview?embed=true",notifyMeRegisteredSlugs:new Set(s.map(o=>o.additionalInfo).filter(o=>o!=null))}},function(e,s){const{navigate:o,integrationsView:c,signedInUserEmail:i,tenantEmailDomain:n,tenantId:t}=s;return{onBackClick:()=>{o("../")},onNavigateToDashboard:()=>{o("../dashboard")},onReconnectQBO:()=>{re.init("/connection/auth",n),re.handleClick()},onRefreshClick:()=>{c.integrations.refreshQBO.fetchState!=="In-Progress"&&e(cn())},onSaveChargeBeeCredentials:(r,u)=>{const d=c.externalConnections?.revenue?.find(g=>g.connectionName==="chargebee")?.connectionId;d!=null&&e(sn(t,d,se("revenue"),on("chargebee"),{api_key:r,site:u}))},onConnectHubSpot:(r,u)=>{const d=c.externalConnections?.revenue?.find(g=>g.connectionName==="hubspot")?.connectionId;if(d!=null){const g=`${window.location.origin}/oauth/hubspot/callback`;sessionStorage.setItem("hubspot_oauth_pending",JSON.stringify({client_id:r,client_secret:u,connection_id:d,redirect_uri:g,tenant_id:t}));const f="oauth crm.objects.deals.read crm.objects.owners.read";window.location.href=`https://app.hubspot.com/oauth/authorize?client_id=${encodeURIComponent(r)}&scope=${encodeURIComponent(f)}&redirect_uri=${encodeURIComponent(g)}`}},onDisconnect:(r,u)=>{e(an(t,r,se(u)))},onNotifyMe:r=>{e(tn(Y,r,i))}}})(Nn),mt=()=>{const e=_(),s=k(),{tenantEmailDomain:o}=F(),[c,i]=p.useState(!1),n=h(l=>l.tenantState.fetchState),t=h(l=>j(l)),r=t.companyId??x.getSignedInUserTenant(o)?.companyId,u=x.getSignedInUser(),d=O(),g=X(t.userRole??[]);if(u==null)throw Error("Can't access Integrations page without signing in...");p.useEffect(()=>{s(Xe(Y))},[s]);const f=l=>{i(l)},m=h(l=>en(l,r));return d?.loggedInUserRoleMap!=null?a.jsxs(ft,{children:[a.jsx(v,{isAppContentDrawerOpen:c,handleDrawerToggle:f}),a.jsx(gt,{navigate:e,onClickMenuIcon:()=>{f(!0)},isAdmin:g,integrationsView:m,signedInUserEmail:u.userEmail??"",tenantEmailDomain:t.tenantEmailDomain??o??"",tenantId:t.tenantId,saveChargeBeeState:m.externalConnections?.saveAPIKeyConnectionState??"Not-Started",saveChargeBeeError:m.externalConnections?.saveAPIKeyConnectionError?.message,saveHubSpotState:m.externalConnections?.saveOAuthConnectionState??"Not-Started",saveHubSpotError:m.externalConnections?.saveOAuthConnectionError?.message,deleteConnectionState:m.externalConnections?.deleteConnectionState??"Not-Started",deleteConnectionError:m.externalConnections?.deleteConnectionError?.message,isLoading:n==="In-Progress"})]}):a.jsx(ae,{fetchState:n})},ft=U.div`
34
34
  display: flex;
35
35
  height: 100%;
36
36
  width: 100%;
@@ -46,7 +46,7 @@ import{j as a}from"./liveblocks-BSDLCmF2.js";import{a as p}from"./sentry-67DqaLi
46
46
  flex-direction: column;
47
47
  align-items: center;
48
48
  background-color: ${e=>e.theme.colors.grey4};
49
- `,bt=()=>{const e=k(),{tenantEmailDomain:s}=B(),[o,c]=p.useState(!1),i=h(l=>j(l)).companyId??x.getSignedInUserTenant(s)?.companyId,n=x.getSignedInUser();if(n==null)throw Error("Can't access my bank connections page without signing in...");const t=h(l=>rn(l,n.userId)),r=h(l=>ln(l,i,"bill_pay","user_reimbursement_account")),{plaidConnectionDetails:u}=r,d=l=>{c(l)},g=p.useCallback(l=>{e(ne("user_reimbursement_account",l))},[]),f=p.useCallback(l=>{e(ee(l,i,"user_reimbursement_account",void 0,"link_account_no_microdeposit"))},[]);p.useEffect(()=>{t.fetchState!=="Completed"&&t.fetchState!=="In-Progress"&&e(dn(n.userId))},[n.userId,t.fetchState]);const m=t.fetchState==="Not-Started"||t.fetchState==="In-Progress";return a.jsxs(ht,{children:[a.jsx(v,{isAppContentDrawerOpen:o,handleDrawerToggle:d}),a.jsx(Ln,{plaidConnectionDetails:u,isLoading:m,myBankConnectionsView:t,onFetchLinkTokenClick:g,onEstablishConnectionClick:f,onClickMenuIcon:()=>{d(!0)}})]})},St=U.div`
49
+ `,bt=()=>{const e=k(),{tenantEmailDomain:s}=F(),[o,c]=p.useState(!1),i=h(l=>j(l)).companyId??x.getSignedInUserTenant(s)?.companyId,n=x.getSignedInUser();if(n==null)throw Error("Can't access my bank connections page without signing in...");const t=h(l=>rn(l,n.userId)),r=h(l=>ln(l,i,"bill_pay","user_reimbursement_account")),{plaidConnectionDetails:u}=r,d=l=>{c(l)},g=p.useCallback(l=>{e(ne("user_reimbursement_account",l))},[]),f=p.useCallback(l=>{e(ee(l,i,"user_reimbursement_account",void 0,"link_account_no_microdeposit"))},[]);p.useEffect(()=>{t.fetchState!=="Completed"&&t.fetchState!=="In-Progress"&&e(dn(n.userId))},[n.userId,t.fetchState]);const m=t.fetchState==="Not-Started"||t.fetchState==="In-Progress";return a.jsxs(ht,{children:[a.jsx(v,{isAppContentDrawerOpen:o,handleDrawerToggle:d}),a.jsx(Ln,{plaidConnectionDetails:u,isLoading:m,myBankConnectionsView:t,onFetchLinkTokenClick:g,onEstablishConnectionClick:f,onClickMenuIcon:()=>{d(!0)}})]})},St=U.div`
50
50
  display: flex;
51
51
  height: 100%;
52
52
  width: 100%;
@@ -54,4 +54,4 @@ import{j as a}from"./liveblocks-BSDLCmF2.js";import{a as p}from"./sentry-67DqaLi
54
54
  flex-direction: column;
55
55
  align-items: center;
56
56
  background-color: ${e=>e.theme.colors.grey4};
57
- `,le=({appContent:e})=>{const s=k(),o=_(),c=R(),[i,n]=p.useState(!1),t=h(b=>j(b)),{tenantEmailDomain:r}=t,u=t.companyId??x.getSignedInUserTenant(r)?.companyId;if(x.getSignedInUser()==null)throw Error("Can't access My Profile page without signing in...");const{useFeatureGate:d}=te(),{isFeatureEnabled:g}=d(M.isDepositAccountsFeatureEnabled),{isFeatureEnabled:f}=d(M.isChargeCardFeatureEnabled),{isFeatureEnabled:m}=d(M.isDebitCardFeatureEnabled),{isFeatureEnabled:l}=d(M.isTreasuryEnabled),E=h(b=>ue(b)),I=be(t),w=Se(m,t),S=!w&&E,y=$n(t,f,m),{areTenantIdsInSync:V}=Kn();p.useEffect(()=>{V&&s(un(u,S))},[u,s,S,V]);const A=h(b=>pn(b,S)),z=A.fetchState==="Not-Started"||A.fetchState==="In-Progress"||u==null,J=gn(t),Z=!!t.company?.featuresActivationInfo?.isReimbursementFeatureEnabled,N=b=>{n(b)};return a.jsxs(St,{children:[a.jsx(v,{isAppContentDrawerOpen:i,handleDrawerToggle:N}),e!=null?a.jsx(a.Fragment,{children:e}):a.jsx(zn,{myProfileView:A,isAccountingClassesEnabled:E,isReimbursementDisabled:Z===!1,isZeniAccountsDisabled:g===!1,isChargeCardDisabled:y===!1,isTreasuryDisabled:l===!1,isLiteRoleDisabled:J===!1,onClickMenuIcon:()=>{N(!0)},isLoading:z,isBankingOnlyTenant:w,isCardsOnlyTenant:I,onAddressClick:b=>{const D=function(H,W){let P=`/${H}/settings/my_profile`;return P=P.concat(`/new/${W}`),P}(r,b),G=Jn(c.state?.pathnameStackToGoBack,c.pathname);o(D,{state:{pathnameStackToGoBack:G}})},onGetOtp:b=>{const D={...A.myProfileLocalData,phone:b};s(oe({localData:D})),s(bn(b,"MyProfile"))},onResendOtp:b=>{s(hn(b,"MyProfile"))},onCancelClick:()=>{s(fn())},onSaveClick:()=>{s(ie("MyProfile",A.myProfileLocalData.phone,A.myProfileLocalData.otpChallenge,A.myProfileLocalData.dateOfBirth,A.addressData?.addressToCreate))},onVerifyOtp:(b,D)=>{s(mn(b,D,"MyProfile"))},onVerifyOtpSuccess:b=>{b!=null&&x.saveZeniOtpToken(b),s(ie("MyProfile",A.myProfileLocalData.phone,A.myProfileLocalData.otpChallenge,A.myProfileLocalData.dateOfBirth,A.addressData?.addressToCreate))},updateMyProfileLocalData:b=>{s(oe({localData:b}))}})]})};function It(){const e=k(),s=h(l=>j(l)).companyId,o=h(l=>Sn(l)),c=h(l=>Ie(l)),i=x.getSignedInUser(),[n,t]=p.useState(!1),r=p.useCallback(l=>{t(l)},[]),u=p.useCallback(l=>{e(In(l))},[]),d=p.useCallback(()=>{i?.userEmail!=null&&e(yn({loggedInUserEmail:i.userEmail}))},[i?.userEmail]),g=p.useCallback(()=>{e(Cn())},[]);if(i==null)throw Error("Can't access Notification Settings page without signing in...");const f=p.useCallback(()=>{const l=c.notificationSettings.monthEndInsightsNotificationSettings.enabled!=null;e(ce(l,s))},[s,c.notificationSettings.monthEndInsightsNotificationSettings.enabled]),m=p.useCallback(()=>{e(xn())},[]);return p.useEffect(()=>{if(c.fetchState==="Completed"&&o.fetchState!=="In-Progress"&&o.fetchState!=="Completed"){const l=c.notificationSettings.monthEndInsightsNotificationSettings.enabled!=null;e(ce(l,s))}},[o.fetchState,s,c.notificationSettings.monthEndInsightsNotificationSettings.enabled,c.fetchState]),a.jsxs(a.Fragment,{children:[a.jsx(v,{isAppContentDrawerOpen:n,handleDrawerToggle:r}),a.jsx(Zn,{notificationSettingsView:o,onFormDataChange:u,onCancel:d,onSave:g,onClickMenuIcon:()=>{r(!0)},signedInUser:i,onRefresh:f,resetUpdateStatus:m})]})}function ea(e){const[s,o]=p.useState(!1),c=h(l=>Ie(l)),i=h(l=>j(l)),n=O(),t=x.getSignedInUser(),r=k(),{useFeatureGate:u}=te(),{isFeatureEnabled:d}=u(M.isDebitCardFeatureEnabled),g=t?.userEmail==null||c.fetchState!=="Completed"||En(c.notificationSettings,t.userEmail,d,i);p.useEffect(()=>{c.fetchState!=="In-Progress"&&c.fetchState!=="Completed"&&s===!1&&(o(!0),r(An()))},[c.fetchState,s]);const f=Se(d,i),m=be(i);return c.fetchState!=="In-Progress"&&c.fetchState!=="Not-Started"||g!==!0?wn(i)?a.jsxs(Y,{children:[jn(n?.loggedInUserRole??[],d,i,n?.loggedInUserRoleMap)&&a.jsx(C,{path:"accounting/*",element:a.jsx(at,{})}),Pn(n?.loggedInUserRole??[],d,i,n?.loggedInUserRoleMap)&&a.jsx(C,{path:"approval_rules/*",element:a.jsx(yt,{hasAdminLevelAccess:e.hasAdminLevelAccess})}),kn(i,n?.loggedInUserRoleMap)&&a.jsx(C,{path:"my_bank_connections",element:a.jsx(bt,{})}),vn(i,n?.loggedInUserRoleMap)&&a.jsx(C,{path:"bank_connections",element:a.jsx(lt,{})}),Dn(i,n?.loggedInUserRoleMap)&&a.jsx(C,{path:"business_verification",element:a.jsx(qn,{productType:f?"zeni_accounts":m?"charge_cards":Yn(i,n?.loggedInUserRoleMap)})}),Mn(n?.loggedInUserRole??[],i,n?.loggedInUserRoleMap)&&a.jsx(C,{path:"company_details",element:a.jsx(Qn,{})}),Un(n?.loggedInUserRole??[],i)&&a.jsx(C,{path:"billing",element:a.jsx(pt,{})}),_n(n?.loggedInUserRole??[],d,i)&&a.jsx(C,{path:"integrations",element:a.jsx(mt,{})}),a.jsx(C,{path:"my_profile/new/:addressType",element:a.jsx(le,{appContent:a.jsx(Wn,{isSubPage:!1})})}),a.jsx(C,{path:"my_profile",element:a.jsx(le,{})}),g&&a.jsx(C,{path:"notifications",element:a.jsx(It,{})}),a.jsx(C,{path:"*",element:a.jsx(T,{})})]}):a.jsx(Y,{children:a.jsx(C,{path:"*",element:a.jsx(T,{})})}):null}function yt(e){return a.jsxs(Y,{children:[a.jsx(C,{path:"/",element:a.jsx(it,{})}),a.jsx(C,{path:"bills/approval-rules/*",element:a.jsx(Xn,{})}),a.jsx(C,{path:"reimbursements/approval-rules/*",element:e.hasAdminLevelAccess?a.jsx(et,{}):a.jsx(T,{})}),a.jsx(C,{path:"*",element:a.jsx(T,{})})]})}export{ea as default};
57
+ `,le=({appContent:e})=>{const s=k(),o=_(),c=R(),[i,n]=p.useState(!1),t=h(b=>j(b)),{tenantEmailDomain:r}=t,u=t.companyId??x.getSignedInUserTenant(r)?.companyId;if(x.getSignedInUser()==null)throw Error("Can't access My Profile page without signing in...");const{useFeatureGate:d}=te(),{isFeatureEnabled:g}=d(M.isDepositAccountsFeatureEnabled),{isFeatureEnabled:f}=d(M.isChargeCardFeatureEnabled),{isFeatureEnabled:m}=d(M.isDebitCardFeatureEnabled),{isFeatureEnabled:l}=d(M.isTreasuryEnabled),E=h(b=>ue(b)),I=be(t),w=Se(m,t),S=!w&&E,y=$n(t,f,m),{areTenantIdsInSync:V}=Kn();p.useEffect(()=>{V&&s(un(u,S))},[u,s,S,V]);const A=h(b=>pn(b,S)),z=A.fetchState==="Not-Started"||A.fetchState==="In-Progress"||u==null,J=gn(t),Z=!!t.company?.featuresActivationInfo?.isReimbursementFeatureEnabled,N=b=>{n(b)};return a.jsxs(St,{children:[a.jsx(v,{isAppContentDrawerOpen:i,handleDrawerToggle:N}),e!=null?a.jsx(a.Fragment,{children:e}):a.jsx(zn,{myProfileView:A,isAccountingClassesEnabled:E,isReimbursementDisabled:Z===!1,isZeniAccountsDisabled:g===!1,isChargeCardDisabled:y===!1,isTreasuryDisabled:l===!1,isLiteRoleDisabled:J===!1,onClickMenuIcon:()=>{N(!0)},isLoading:z,isBankingOnlyTenant:w,isCardsOnlyTenant:I,onAddressClick:b=>{const D=function(H,W){let P=`/${H}/settings/my_profile`;return P=P.concat(`/new/${W}`),P}(r,b),G=Jn(c.state?.pathnameStackToGoBack,c.pathname);o(D,{state:{pathnameStackToGoBack:G}})},onGetOtp:b=>{const D={...A.myProfileLocalData,phone:b};s(oe({localData:D})),s(bn(b,"MyProfile"))},onResendOtp:b=>{s(hn(b,"MyProfile"))},onCancelClick:()=>{s(fn())},onSaveClick:()=>{s(ie("MyProfile",A.myProfileLocalData.phone,A.myProfileLocalData.otpChallenge,A.myProfileLocalData.dateOfBirth,A.addressData?.addressToCreate))},onVerifyOtp:(b,D)=>{s(mn(b,D,"MyProfile"))},onVerifyOtpSuccess:b=>{b!=null&&x.saveZeniOtpToken(b),s(ie("MyProfile",A.myProfileLocalData.phone,A.myProfileLocalData.otpChallenge,A.myProfileLocalData.dateOfBirth,A.addressData?.addressToCreate))},updateMyProfileLocalData:b=>{s(oe({localData:b}))}})]})};function It(){const e=k(),s=h(l=>j(l)).companyId,o=h(l=>Sn(l)),c=h(l=>Ie(l)),i=x.getSignedInUser(),[n,t]=p.useState(!1),r=p.useCallback(l=>{t(l)},[]),u=p.useCallback(l=>{e(In(l))},[]),d=p.useCallback(()=>{i?.userEmail!=null&&e(yn({loggedInUserEmail:i.userEmail}))},[i?.userEmail]),g=p.useCallback(()=>{e(Cn())},[]);if(i==null)throw Error("Can't access Notification Settings page without signing in...");const f=p.useCallback(()=>{const l=c.notificationSettings.monthEndInsightsNotificationSettings.enabled!=null;e(ce(l,s))},[s,c.notificationSettings.monthEndInsightsNotificationSettings.enabled]),m=p.useCallback(()=>{e(xn())},[]);return p.useEffect(()=>{if(c.fetchState==="Completed"&&o.fetchState!=="In-Progress"&&o.fetchState!=="Completed"){const l=c.notificationSettings.monthEndInsightsNotificationSettings.enabled!=null;e(ce(l,s))}},[o.fetchState,s,c.notificationSettings.monthEndInsightsNotificationSettings.enabled,c.fetchState]),a.jsxs(a.Fragment,{children:[a.jsx(v,{isAppContentDrawerOpen:n,handleDrawerToggle:r}),a.jsx(Zn,{notificationSettingsView:o,onFormDataChange:u,onCancel:d,onSave:g,onClickMenuIcon:()=>{r(!0)},signedInUser:i,onRefresh:f,resetUpdateStatus:m})]})}function ea(e){const[s,o]=p.useState(!1),c=h(l=>Ie(l)),i=h(l=>j(l)),n=O(),t=x.getSignedInUser(),r=k(),{useFeatureGate:u}=te(),{isFeatureEnabled:d}=u(M.isDebitCardFeatureEnabled),g=t?.userEmail==null||c.fetchState!=="Completed"||En(c.notificationSettings,t.userEmail,d,i);p.useEffect(()=>{c.fetchState!=="In-Progress"&&c.fetchState!=="Completed"&&s===!1&&(o(!0),r(An()))},[c.fetchState,s]);const f=Se(d,i),m=be(i);return c.fetchState!=="In-Progress"&&c.fetchState!=="Not-Started"||g!==!0?wn(i)?a.jsxs(q,{children:[jn(n?.loggedInUserRole??[],d,i,n?.loggedInUserRoleMap)&&a.jsx(C,{path:"accounting/*",element:a.jsx(at,{})}),Pn(n?.loggedInUserRole??[],d,i,n?.loggedInUserRoleMap)&&a.jsx(C,{path:"approval_rules/*",element:a.jsx(yt,{hasAdminLevelAccess:e.hasAdminLevelAccess})}),kn(i,n?.loggedInUserRoleMap)&&a.jsx(C,{path:"my_bank_connections",element:a.jsx(bt,{})}),vn(i,n?.loggedInUserRoleMap)&&a.jsx(C,{path:"bank_connections",element:a.jsx(lt,{})}),Dn(i,n?.loggedInUserRoleMap)&&a.jsx(C,{path:"business_verification",element:a.jsx(Qn,{productType:f?"zeni_accounts":m?"charge_cards":qn(i,n?.loggedInUserRoleMap)})}),Mn(n?.loggedInUserRole??[],i,n?.loggedInUserRoleMap)&&a.jsx(C,{path:"company_details",element:a.jsx(Yn,{})}),Un(n?.loggedInUserRole??[],i)&&a.jsx(C,{path:"billing",element:a.jsx(pt,{})}),_n(n?.loggedInUserRole??[],d,i)&&a.jsx(C,{path:"integrations",element:a.jsx(mt,{})}),a.jsx(C,{path:"my_profile/new/:addressType",element:a.jsx(le,{appContent:a.jsx(Wn,{isSubPage:!1})})}),a.jsx(C,{path:"my_profile",element:a.jsx(le,{})}),g&&a.jsx(C,{path:"notifications",element:a.jsx(It,{})}),a.jsx(C,{path:"*",element:a.jsx(T,{})})]}):a.jsx(q,{children:a.jsx(C,{path:"*",element:a.jsx(T,{})})}):null}function yt(e){return a.jsxs(q,{children:[a.jsx(C,{path:"/",element:a.jsx(it,{})}),a.jsx(C,{path:"bills/approval-rules/*",element:a.jsx(Xn,{})}),a.jsx(C,{path:"reimbursements/approval-rules/*",element:e.hasAdminLevelAccess?a.jsx(et,{}):a.jsx(T,{})}),a.jsx(C,{path:"*",element:a.jsx(T,{})})]})}export{ea as default};
@@ -1,4 +1,4 @@
1
- import{j as u}from"./liveblocks-BSDLCmF2.js";import{h as Q,g as Y,u as X,i as W,j as E,N as j,n as H,s as Ye}from"./core-B20PugrR.js";import{bF as Xe,cl as Ie,Nf as ye,eP as F,cx as en,xW as Z,xL as nn,Nr as tn,Nu as an,qc as ee,q0 as ne,kb as te,si as R,Nw as Ae,fE as $e,fD as We,fC as He,Nx as sn,y3 as on,BW as ke,BN as _e,BK as ve,BB as K,BQ as Pe,BT as Ee,BZ as we,sM as De,fT as cn,cs as rn,e_ as un,eY as dn,eZ as ln,bs as pn,Ny as mn,AD as le,Bf as yn,Nz as fn,bG as gn,Da as pe,Ce as Sn,NA as bn,NB as hn,De as Cn,Di as In,sb as An,HH as kn,DP as Ce,EI as me,NC as _n,ND as vn,NE as Pn,NF as Ge,NG as En,K9 as wn,ME as Dn,Kl as Tn,NH as qe,NI as xe,E1 as Ke,kj as Un,q3 as Je,sk as On,bE as Ne,sw as je,cv as Bn,NJ as Qe,fh as xn,Dx as Fn,DB as Vn,NK as Nn,DS as ze,NL as jn,NM as zn,NN as Rn,NO as Ln,fM as Mn,ze as Zn,NP as $n,zj as Wn,zi as Hn}from"./zeni-epic-state-B3AwsZqW.js";import{k as ae,w as ie,I as de,m as Te,aN as J,z as D,N as se,d as w,x as Ue,f as $,bx as Gn,at as oe,by as V,bz as qn,bA as Kn,af as Ve,bB as Jn,s as Re,au as Le,p as Qn,y as Yn,bC as Xn,bD as et,bE as nt,a7 as tt}from"./index-CtCI_jgi.js";import{a as C}from"./sentry-67DqaLi1.js";import{n as Fe,D as at,S as it}from"./mui-BBkBdMVO.js";import{M as fe}from"./MobileAppDrawer-DjZLcHYq.js";import z from"./NotFoundScreen-GGUH6kfI.js";import{a as Me}from"./analyticsHelper-Cnf9wNpk.js";import{d as Ze}from"./routePaths-Bd-gFJIO.js";import{B as Be}from"./BusinessVerificationPageScreen-CSKO8lFK.js";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},o=new e.Error().stack;o&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[o]="3e15cd50-01ac-42e2-b43e-5587747ab8f6",e._sentryDebugIdIdentifier="sentry-dbid-3e15cd50-01ac-42e2-b43e-5587747ab8f6")}catch{}})();const st=Fe.div`
1
+ import{j as u}from"./liveblocks-Do-nuGO9.js";import{h as Q,g as Y,u as X,i as W,j as E,N as j,n as H,s as Ye}from"./core-CAUatE6D.js";import{bF as Xe,cl as Ie,Nf as ye,eP as F,cx as en,xW as Z,xL as nn,Nr as tn,Nu as an,qc as ee,q0 as ne,kb as te,si as R,Nw as Ae,fE as $e,fD as We,fC as He,Nx as sn,y3 as on,BW as ke,BN as _e,BK as ve,BB as q,BQ as Pe,BT as Ee,BZ as we,sM as De,fT as cn,cs as rn,e_ as un,eY as dn,eZ as ln,bs as pn,Ny as mn,AD as le,Bf as yn,Nz as fn,bG as gn,Da as pe,Ce as Sn,NA as bn,NB as hn,De as Cn,Di as In,sb as An,HH as kn,DP as Ce,EI as me,NC as _n,ND as vn,NE as Pn,NF as Ge,NG as En,K9 as wn,ME as Dn,Kl as Tn,NH as Ke,NI as xe,E1 as qe,kj as Un,q3 as Je,sk as On,bE as Ne,sw as je,cv as Bn,NJ as Qe,fh as xn,Dx as Fn,DB as Vn,NK as Nn,DS as ze,NL as jn,NM as zn,NN as Rn,NO as Ln,fM as Mn,ze as Zn,NP as $n,zj as Wn,zi as Hn}from"./zeni-epic-state-Cb-J9Nxh.js";import{k as ae,w as ie,I as de,h as Te,aN as J,z as D,V as se,c as w,B as Ue,e as $,bx as Gn,at as oe,by as V,bz as Kn,bA as qn,af as Ve,bB as Jn,m as Re,au as Le,K as Qn,r as Yn,bC as Xn,bD as et,bE as nt,a7 as tt}from"./index-ssCDruz8.js";import{a as C}from"./sentry-CpVyi-77.js";import{n as Fe,D as at,S as it}from"./mui-Ee2kkUYC.js";import{M as fe}from"./MobileAppDrawer-6SipHCGH.js";import z from"./NotFoundScreen-BbD7D-7R.js";import{a as Me}from"./analyticsHelper-DidHWGct.js";import{d as Ze}from"./routePaths-C0HYOQUJ.js";import{B as Be}from"./BusinessVerificationPageScreen-Bgww5Eni.js";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},o=new e.Error().stack;o&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[o]="b8b51fda-268c-42df-b9ed-7eecc4c0b361",e._sentryDebugIdIdentifier="sentry-dbid-b8b51fda-268c-42df-b9ed-7eecc4c0b361")}catch{}})();const st=Fe.div`
2
2
  display: flex;
3
3
  height: 100%;
4
4
  width: 100%;
@@ -6,7 +6,7 @@ import{j as u}from"./liveblocks-BSDLCmF2.js";import{h as Q,g as Y,u as X,i as W,
6
6
  flex-direction: column;
7
7
  align-items: center;
8
8
  background-color: ${e=>e.theme.colors.grey4};
9
- `,ot=H(function(e,o){const{isUserBillPayAdmin:t,companyId:a}=o,c=F(e),n=tn(e),i=D.getSignedInUser(),l=c.tenantId,s={userId:i?.userId??"",sessionId:i?.zeniSessionId??"",tenantId:l??""},r=an(e,a),p=t&&r.updateStatus.fetchState!=="In-Progress"&&r.plaidConnectionDetails.link_account.updateStatus.fetchState!=="In-Progress"&&r.plaidConnectionDetails.update_account.updateStatus.fetchState!=="In-Progress"&&r.accountUpdateStatus?.fetchState!=="In-Progress"?void 0:"readonly",y=!!c.companyZeniAccountInfo?.info?.isZeniAccountEnabled;return{billPaySetupView:r,connectedAccountProvider:c.company?.featuresActivationInfo.connectedAccountProvider??"",isAccountsEnabled:y,showIntlWiseWidget:o.showIntlWiseWidget,isDisabled:p,billpayApprovalView:n,meetingUrl:"https://meetings.hubspot.com/snehals/demo-bill-pay?embed=true",analytics:w,filesEndPoint:`${oe.fileMicroServiceBaseUrl}`,authParams:s}},function(e,o){const{navigate:t,companyId:a,currentTenant:c}=o;return{onBusinessVerificationSectionClick:()=>{t("../verification"),c?.company?.companyBillPayInfo!=null&&c?.company?.companyBillPayInfo?.businessVerificationStatus?.code==="pending_review"&&e(Z(a,!1,!0))},onSetupApprovalRulesSectionClick:()=>{t("../approval-rules")},onFetchLinkTokenClick:(n,i)=>{e(De("bill_pay_setup",n,i))},onEstablishConnectionClick:n=>{e(we(n,a,"bill_pay_setup","bill_pay"))},onUpdatePaymentAccountStatus:(n,i,l)=>{e(Ee(n,i,"bill_pay","bill_pay_setup",l))},onUpdatePaymentAccountLoginStatus:(n,i)=>{e(Pe(!1,n,"bill_pay","bill_pay_setup",i))},onEstablishConnectionSuccess:()=>{e(Z(a,!0))},onEnableBillPayClick:()=>{e(K(a,"bill_pay"))},onUpdateAccountClick:(n,i,l)=>{e(l==="paymentAccount"?_e(n,i,"bill_pay","bill_pay_setup"):ve("reimbursement_setup",n,i))},onUpdatePrimaryFundingAccount:(n,i)=>{e(ke(a,"bill_pay_setup",n,i))},onEnableBillPaySuccess:()=>{t("../",{relative:"path"})},onBackClick:()=>{c?.companyBillPayInfo?.info?.isBillPayEnabled!=null&&c.companyBillPayInfo.info.isBillPayEnabled===!1?t("../.."):t("../",{relative:"path"})},onAcceptUpdatedTOS:()=>{e(on(a))},onAcceptUpdatedTOSSuccess:()=>{e(Z(a,!0))},onGetOtp:(n,i)=>{e(He(n,"SpendManagementSetup")),i!=null&&e(sn({officerType:i,phone:n}))},onResendOtp:n=>{e(We(n,"SpendManagementSetup"))},onVerifyOtp:(n,i)=>{e($e(n,i,"SpendManagementSetup"))},onVerifyOtpSuccess:(n,i)=>{n!=null&&i!=null&&e(R(a,n,"bill_pay",!0,!0))},onNavigateToDashboard:()=>{t("../../dashboard")},onNavigateToSettings:()=>{t("../bills/setup")},onInternationPaymentSetUpClick:()=>{t("../international-wire")},onCompanyOfficerUpdated:(n,i)=>{e(Ae({officerType:n,fileIds:i}))},onSendForVerificationClick:n=>{e(R(a,n,"bill_pay",!0,!0,!0))},updateFilesEntity:n=>{e(te({files:n}))},onDeleteFile:n=>{e(ne(n))},onEditFileName:(n,i)=>{e(ee(n,i.split(".")[0]))},onSignUpClick:()=>{o.hasZeniAccountsAdminAccess?window.open("../checking/promo","_blank"):window.open("https://www.zeni.ai/product/business-checking-accounts","_blank")}}})(Gn),ct=()=>{const e=Q(),o=Y(),t=X(),{tenantEmailDomain:a}=W(),c=ae(),n=Xe(c?.loggedInUserRoleMap),i=Ie(c?.loggedInUserRoleMap),{useFeatureGate:l,useDynamicConfig:s}=ie(),{isFeatureEnabled:r}=l(de.billPaySetupShowInternationalPaymentByWise),{isFeatureEnabled:p}=l(de.isBillPayLocalCurrencyFeatureEnabled),y=Te(),{configValue:I}=s(J.zeniAccountsConfig),d=ye(I),[m,S]=C.useState(!1),v=C.useRef(!1),[g,f]=C.useState(!1),P=E(B=>B.billPaySetupViewState.fetchState),A=E(B=>F(B)),_=E(B=>B.billPaySetupApproverViewState.fetchState),b=A.companyId??D.getSignedInUserTenant(a)?.companyId;if(D.getSignedInUser()==null)throw Error("Can't access bill pay setup page without signing in...");const k=!!A.companyBillPayInfo?.info?.isBillPayTOSAccepted,h=en(c?.loggedInUserRoleMap);C.useEffect(()=>{v.current||P!=="Not-Started"||b==null?v.current||P!=="Completed"||b==null||A.companyBillPayInfo?.info?.businessVerificationStatus?.code!=="pending_review"||(v.current=!0,t(Z(b,!1,!0))):(v.current=!0,t(Z(b,!0)))},[P,b,t]),C.useEffect(()=>{g||_!=="Not-Started"||(f(!0),t(nn(!0)))},[g,_,t]);const T=B=>{S(B)};if(k===!1||h&&!c?.loggedInUserRoleMap?.bill_pay_admin)return u.jsx(j,{to:"../promo"});if(k===!0&&c?.loggedInUserRoleMap!=null){const B=U=>U.trackPageLoaded($.Event.billPaySetup);return u.jsxs(st,{children:[u.jsx(se,{analytics:w,onLoad:U=>B(U)}),u.jsx(fe,{isAppContentDrawerOpen:m,handleDrawerToggle:T}),u.jsx(ot,{navigate:e,location:o,companyId:b,currentTenant:A,isUserBillPayAdmin:n,showIntlWiseWidget:r,onClickMenuIcon:()=>{T(!0)},hasZeniAccountsAdminAccess:i,accountsPromoConfig:d,isLocalCurrencyEnabled:p})]})}return u.jsx(Ue,{fetchState:"In-Progress",style:{backgroundColor:y.colors.grey5}})},zt=(e,o)=>e!=null&&function(t){return t==="debit"||t==="credit"||t==="debit_and_credit"}(e)?e:o,Rt=e=>`/${e}/cards`,Lt=e=>`/${e}/cards/setup`,Mt=e=>`/${e}/cards/onboard`,Zt=(e,o,t,a,c=!1)=>{let n=`/${e}/cards/${encodeURIComponent(o)}`;return a==null||a.status.code!=="inactive"||a.cardHolderUserId!==t.userId||a.type.code!=="business_physical_credit_card"&&a.type.code!=="business_physical_debit_card"?a!=null&&a.status.code==="active"&&a.cardHolderUserId===t.userId&&a.type.code==="business_physical_credit_card"&&c===!0?n+="/addToWallet":a==null||a.type.code!=="business_physical_debit_card"&&a.type.code!=="business_virtual_debit_card"||a.status.code!=="active"||a.cardHolderUserId!==t.userId||a.isPinSet!==!1||(n+="/setPin"):n+="/activate",n},$t=(e,o)=>e.find(t=>t.id===o),Wt=(e,o,t)=>!e||!o||t.fetchState==="Completed",rt=(e,o,t,a)=>({isCreditCardOffered:e,isDebitCardOffered:o,isDebitCardEnabled:t,isCreditCardEnabled:a}),Ht=(e,o)=>e?{creditCardCashbackOffer:`${o.cashbackAnalytics.creditCardCashbackOffer}%`,debitCardCashbackOffer:`${o.cashbackAnalytics.debitCardCashbackOffer}%`,totalEarnedCashback:V(o.cashbackSummary.cashbackEarned.amount),redeemedCashback:V(o.cashbackSummary.cashbackRedeemed.amount),availableCashback:V(o.cashbackSummary.cashbackAvailable.amount),creditCardCashbackRedemptionMode:o.cashbackAnalytics.creditCardCashbackRedemptionMode,debitCardCashbackRedemptionMode:o.cashbackAnalytics.debitCardCashbackRedemptionMode}:void 0,Gt=(e,o,t,a,c)=>e&&o&&t?{creditAccountId:a.id,creditAccountLimit:V(a.limit.amount),creditAccountAvailableAmount:V(a.available.amount),creditAccountSpentAmount:V(a.balance.amount+a.hold.amount),creditAccountStatus:a.status,outstandingBalance:V(c.remainingAmountDue.amount)}:void 0,qt=(e,o,t,a,c)=>e&&o&&t?{debitAccountId:a.depositAccounts.map(n=>n.id),debitAccountName:a.depositAccounts.map(n=>n.accountName),debitAccountBalance:a.depositAccounts.map(n=>V(n.accountBalance.available.amount)),debitCardsSpend:V(c?.currentMonthSpends.amount??0),debitAccountStatus:a.depositAccounts.map(n=>n.accountStatus)}:void 0,Kt=(e,o)=>e&&o.depositAccountLimit!=null&&o.chargeCard!=null?{debitAccountId:o.depositAccountLimit.id,debitAccountName:o.depositAccountLimit?.accountName??o.connectedAccount?.accountName,debitAccountBalance:V(o.depositAccountLimit?.accountBalance.available.amount),debitCardsSpend:V(o.chargeCard.limit.amount-o.chargeCard.available.amount),debitAccountStatus:o.depositAccountLimit?.accountStatus??o.connectedAccount?.accountStatus}:void 0,Jt=80,Qt=80,ut=({isBankingOnlyTenant:e,isDebitCardFeatureEnabled:o})=>o||e,dt=({isCardsOnlyTenant:e,isChargeCardFeatureEnabled:o,isBookKeepingTenant:t,isDebitCardProductVisible:a,chargeCardsCreditAccountLimit:c})=>(e||o||t)&&(!a||c>0),Yt=({isCardsOnlyTenant:e,isChargeCardFeatureEnabled:o,isBookKeepingTenant:t})=>e||o||t,Xt=({cardInfo:e,isProductVisible:o,isTOSAccepted:t,isSetupEnabled:a,isUserHasCardsAdminLevelAccess:c,isUserHasCardsAccess:n})=>!!e&&o&&(!t&&c||n&&!c&&!a),lt=H(function(e,o){const{isUserChargeCardAdmin:t,chargeCardSetUpView:a,isDebitCardOnlyEnabled:c,isCreditCardOnlyEnabled:n}=o,i=F(e),l=D.getSignedInUser(),s=i.tenantId,r={userId:l?.userId??"",sessionId:l?.zeniSessionId??"",tenantId:s??""},p=t&&a.updateStatus.fetchState!=="In-Progress"&&a.plaidConnectionDetails.link_account.updateStatus.fetchState!=="In-Progress"&&a.plaidConnectionDetails.update_account.updateStatus.fetchState!=="In-Progress"&&a.accountUpdateStatus?.fetchState!=="In-Progress"?void 0:"readonly",y=!!i.companyZeniAccountInfo?.info?.isZeniAccountEnabled;return{chargeCardSetUpView:a,connectedAccountProvider:i.company?.featuresActivationInfo.connectedAccountProvider??"",isAccountsEnabled:y,isDisabled:p,meetingUrl:"https://meetings.hubspot.com/niharn/demo-accounts?embed=true",analytics:w,isDebitCardOnlyEnabled:c,isCreditCardOnlyEnabled:n,filesEndPoint:`${oe.fileMicroServiceBaseUrl}`,authParams:r}},function(e,o){const{navigate:t,companyId:a,currentTenant:c,chargeCardSetUpView:n,isDebitCardTOSAccepted:i,isChargeCardTOSAccepted:l,isChargeCardSetupEnabled:s,isDebitCardSetupEnabled:r,productInformation:p,controllerEmails:y,businessVerificationStatus:I}=o;return{onBusinessVerificationSectionClick:()=>{w.trackCardsVerifyIdentityCompanyDetailsClick(y,p,I?.code),t("../verification"),c?.company?.companyChargeCardInfo!=null&&c.company.companyBillPayInfo?.businessVerificationStatus?.code==="pending_review"&&e(le(a,!1,!0))},onFetchLinkTokenClick:(d,m)=>{e(De("charge_card_setup",d,m))},onEstablishConnectionClick:d=>{e(we(d,a,"charge_card_setup","charge_cards"))},onUpdatePaymentAccountStatus:(d,m,S)=>{e(Ee(d,m,"charge_cards","charge_card_setup",S))},onUpdatePaymentAccountLoginStatus:(d,m)=>{e(Pe(!1,d,"charge_cards","charge_card_setup",m))},onEstablishConnectionSuccess:()=>{e(le(a,!0))},onEnableChargeCardClick:()=>{w.trackCardsEnableCardsClick(y,p,"Cards Card Setup"),l===!0&&i===!0&&s===!1&&r===!1?e(K(a,"charge_cards__debit_cards")):l===!0&&s===!1?e(K(a,"charge_cards")):i===!0&&r===!1&&e(K(a,"debit_cards"))},onUpdateChargeCardClick:(d,m,S)=>{const v=n.allBankAccounts.find(f=>f.accountId===n.primaryFundingAccount?.zeniAccountId),g=n.allBankAccounts.find(f=>f.accountId===d);w.trackCardsZeniCashAccountChangeClick(y,p,{oldZeniCashAccount:v?.accountName??"",newZeniCashAccount:g?.accountName??"",oldZeniCashAccountPosition:n.allBankAccounts.findIndex(f=>f.accountId===n.primaryFundingAccount?.zeniAccountId)+1,newZeniCashAccountPosition:n.allBankAccounts.findIndex(f=>f.accountId===d)+1,numberOfCashAccounts:n.allBankAccounts.length}),e(S==="paymentAccount"?_e(d,m,"charge_cards","charge_card_setup"):ve("charge_card_setup",d,m))},onUpdatePrimaryFundingAccount:(d,m)=>{const S=n.allFundingAccounts.find(f=>f.id===d),v=n.allFundingAccounts.findIndex(f=>f.id===n.primaryFundingAccount?.id)+1,g=n.allFundingAccounts.findIndex(f=>f.id===d)+1;w.trackCardsPaymentAccountChangeClick(y,p,{oldPaymentAccountName:n.primaryFundingAccount?.label??"",oldPaymentAccountBalance:V(n.primaryFundingAccount?.accountBalance?.available?.amount??0),newPaymentAccountName:S?.label??"",newPaymentAccountBalance:V(S?.accountBalance?.available?.amount??0),isOldPaymentAccountRecommended:n.primaryFundingAccount?.accType==="depositAccount",isNewPaymentAccountRecommended:S?.accType==="depositAccount",oldPaymentAccountPosition:v,newPaymentAccountPosition:g,numberOfPaymentAccounts:n.allFundingAccounts.length}),e(ke(a,"charge_card_setup",d,m))},onEnableChargeCardSuccess:()=>{e(fn()),t("../",{relative:"path"})},onBackClick:()=>{c?.companyChargeCardInfo?.info?.isChargeCardEnabled||c?.companyDebitCardInfo?.info?.isDebitCardEnabled?t("../",{relative:"path"}):t("../..",{relative:"path"})},onNavigateToDashboard:()=>{t("../../dashboard")},onCompanyOfficerUpdated:(d,m)=>{e(Ae({officerType:d,fileIds:m}))},onSendForVerificationClick:d=>{l===!0&&i===!0?e(R(a,d,"charge_cards__debit_cards",!0,!0,!0)):l===!0?e(R(a,d,"charge_cards",!0,!0,!0)):i===!0&&e(R(a,d,"debit_cards",!0,!0,!0))},updateFilesEntity:d=>{e(te({files:d}))},onDeleteFile:d=>{e(ne(d))},onEditFileName:(d,m)=>{e(ee(d,m.split(".")[0]))},onSignUpClick:()=>{o.hasZeniAccountsAdminAccess?window.open("../checking/promo","_blank"):window.open("https://www.zeni.ai/product/business-checking-accounts","_blank")},onUpdateAutoPayClick:d=>{e(yn(a,d))}}})(qn),pt=()=>{const e=Q(),o=Y(),t=X(),{tenantEmailDomain:a}=W(),c=ae(),n=E(L=>F(L)),{useDynamicConfig:i,useFeatureGate:l}=ie(),s=o.state?.pathnameStackToGoBack?.[0],{configValue:r}=i(J.zeniAccountsConfig),{configValue:p}=i(J.zeniCardsConfig),y=p.credit_card_auto_pay_threshold_by_company_id?.[n.companyId]??p.default_credit_card_auto_pay_threshold??80,{isFeatureEnabled:I}=l(de.isDebitCardFeatureEnabled),{isFeatureEnabled:d}=l(de.isChargeCardFeatureEnabled),{isFeatureEnabled:m}=l(de.isEarlyPayFeatureEnabled),S=E(L=>cn(L,n.companyId)),v=rn(S.controllers),g=!!n.company?.companyChargeCardInfo.isChargeCardEnabled,f=!!n.company?.companyDebitCardInfo.isDebitCardEnabled,P=un(I,n),A=ut({isDebitCardFeatureEnabled:I,isBankingOnlyTenant:P}),_=dn(n),b=ln(n),k=n.companyChargeCardInfo?.info?.chargeCardsCreditAccountLimit??0,h=dt({isCardsOnlyTenant:_,isChargeCardFeatureEnabled:d,isBookKeepingTenant:b,isDebitCardProductVisible:A,chargeCardsCreditAccountLimit:k}),T=A&&h===!1,B=A===!1&&h,U=ye(r),x=pn(c?.loggedInUserRoleMap),ce=Ie(c?.loggedInUserRoleMap),[G,ge]=C.useState(!1),[q,re]=C.useState(!1),M=E(L=>L.chargeCardSetupViewState.fetchState),N=D.getSignedInUserTenant(a)?.companyId??n.companyId,O=D.getSignedInUser(),Oe=L=>{ge(L)},Se=E(L=>mn(L,N));if(O==null)throw Error("Can't access charge card setup page without signing in...");C.useEffect(()=>{q||M!=="Not-Started"||N==null?q||M!=="Completed"||N==null||n.companyBillPayInfo?.info?.businessVerificationStatus?.code!=="pending_review"||t(le(N,!1,!0)):(re(!0),t(le(N,!0)))},[q,M,N,t]);const be=!!n.company?.companyChargeCardInfo.isChargeCardTOSAccepted,he=!!n.company?.companyDebitCardInfo.isDebitCardTOSAccepted,ue=rt(h,A,f,g);return be||he?be||he?u.jsxs(u.Fragment,{children:[u.jsx(se,{analytics:w,onLoad:()=>{w.trackPageLoaded($.Event.cardsSetupVisited),w.trackCardsCardSetupView(v,ue,s==null?"Cards Setup":s.includes("cards/promo")?"Promo":s.includes("cards")?"Settings":"Cards Tab")}}),u.jsx(fe,{isAppContentDrawerOpen:G,handleDrawerToggle:Oe}),u.jsx(lt,{autoPayThreshold:y,navigate:e,location:o,companyId:N,currentTenant:n,isEarlyPayEnabled:m,isChargeCardTOSAccepted:be,isDebitCardTOSAccepted:he,isUserChargeCardAdmin:x,isDebitCardOnlyEnabled:T,isCreditCardOnlyEnabled:B,chargeCardSetUpView:Se,isCreditCardProductVisible:h,isDebitCardFeatureEnabled:A,isChargeCardSetupEnabled:g,isDebitCardSetupEnabled:f,businessVerificationStatus:n.companyBillPayInfo?.info?.businessVerificationStatus,controllerEmails:v,productInformation:ue,onClickMenuIcon:()=>{Oe(!0)},hasZeniAccountsAdminAccess:ce,accountsPromoConfig:U})]}):u.jsx(Ue,{fetchState:"Not-Started"}):u.jsx(j,{to:"../promo"})},mt=Fe.div`
9
+ `,ot=H(function(e,o){const{isUserBillPayAdmin:t,companyId:a}=o,c=F(e),n=tn(e),i=D.getSignedInUser(),l=c.tenantId,s={userId:i?.userId??"",sessionId:i?.zeniSessionId??"",tenantId:l??""},r=an(e,a),p=t&&r.updateStatus.fetchState!=="In-Progress"&&r.plaidConnectionDetails.link_account.updateStatus.fetchState!=="In-Progress"&&r.plaidConnectionDetails.update_account.updateStatus.fetchState!=="In-Progress"&&r.accountUpdateStatus?.fetchState!=="In-Progress"?void 0:"readonly",y=!!c.companyZeniAccountInfo?.info?.isZeniAccountEnabled;return{billPaySetupView:r,connectedAccountProvider:c.company?.featuresActivationInfo.connectedAccountProvider??"",isAccountsEnabled:y,showIntlWiseWidget:o.showIntlWiseWidget,isDisabled:p,billpayApprovalView:n,meetingUrl:"https://meetings.hubspot.com/snehals/demo-bill-pay?embed=true",analytics:w,filesEndPoint:`${oe.fileMicroServiceBaseUrl}`,authParams:s}},function(e,o){const{navigate:t,companyId:a,currentTenant:c}=o;return{onBusinessVerificationSectionClick:()=>{t("../verification"),c?.company?.companyBillPayInfo!=null&&c?.company?.companyBillPayInfo?.businessVerificationStatus?.code==="pending_review"&&e(Z(a,!1,!0))},onSetupApprovalRulesSectionClick:()=>{t("../approval-rules")},onFetchLinkTokenClick:(n,i)=>{e(De("bill_pay_setup",n,i))},onEstablishConnectionClick:n=>{e(we(n,a,"bill_pay_setup","bill_pay"))},onUpdatePaymentAccountStatus:(n,i,l)=>{e(Ee(n,i,"bill_pay","bill_pay_setup",l))},onUpdatePaymentAccountLoginStatus:(n,i)=>{e(Pe(!1,n,"bill_pay","bill_pay_setup",i))},onEstablishConnectionSuccess:()=>{e(Z(a,!0))},onEnableBillPayClick:()=>{e(q(a,"bill_pay"))},onUpdateAccountClick:(n,i,l)=>{e(l==="paymentAccount"?_e(n,i,"bill_pay","bill_pay_setup"):ve("reimbursement_setup",n,i))},onUpdatePrimaryFundingAccount:(n,i)=>{e(ke(a,"bill_pay_setup",n,i))},onEnableBillPaySuccess:()=>{t("../",{relative:"path"})},onBackClick:()=>{c?.companyBillPayInfo?.info?.isBillPayEnabled!=null&&c.companyBillPayInfo.info.isBillPayEnabled===!1?t("../.."):t("../",{relative:"path"})},onAcceptUpdatedTOS:()=>{e(on(a))},onAcceptUpdatedTOSSuccess:()=>{e(Z(a,!0))},onGetOtp:(n,i)=>{e(He(n,"SpendManagementSetup")),i!=null&&e(sn({officerType:i,phone:n}))},onResendOtp:n=>{e(We(n,"SpendManagementSetup"))},onVerifyOtp:(n,i)=>{e($e(n,i,"SpendManagementSetup"))},onVerifyOtpSuccess:(n,i)=>{n!=null&&i!=null&&e(R(a,n,"bill_pay",!0,!0))},onNavigateToDashboard:()=>{t("../../dashboard")},onNavigateToSettings:()=>{t("../bills/setup")},onInternationPaymentSetUpClick:()=>{t("../international-wire")},onCompanyOfficerUpdated:(n,i)=>{e(Ae({officerType:n,fileIds:i}))},onSendForVerificationClick:n=>{e(R(a,n,"bill_pay",!0,!0,!0))},updateFilesEntity:n=>{e(te({files:n}))},onDeleteFile:n=>{e(ne(n))},onEditFileName:(n,i)=>{e(ee(n,i.split(".")[0]))},onSignUpClick:()=>{o.hasZeniAccountsAdminAccess?window.open("../checking/promo","_blank"):window.open("https://www.zeni.ai/product/business-checking-accounts","_blank")}}})(Gn),ct=()=>{const e=Q(),o=Y(),t=X(),{tenantEmailDomain:a}=W(),c=ae(),n=Xe(c?.loggedInUserRoleMap),i=Ie(c?.loggedInUserRoleMap),{useFeatureGate:l,useDynamicConfig:s}=ie(),{isFeatureEnabled:r}=l(de.billPaySetupShowInternationalPaymentByWise),{isFeatureEnabled:p}=l(de.isBillPayLocalCurrencyFeatureEnabled),y=Te(),{configValue:I}=s(J.zeniAccountsConfig),d=ye(I),[m,S]=C.useState(!1),v=C.useRef(!1),[g,f]=C.useState(!1),P=E(B=>B.billPaySetupViewState.fetchState),A=E(B=>F(B)),_=E(B=>B.billPaySetupApproverViewState.fetchState),b=A.companyId??D.getSignedInUserTenant(a)?.companyId;if(D.getSignedInUser()==null)throw Error("Can't access bill pay setup page without signing in...");const k=!!A.companyBillPayInfo?.info?.isBillPayTOSAccepted,h=en(c?.loggedInUserRoleMap);C.useEffect(()=>{v.current||P!=="Not-Started"||b==null?v.current||P!=="Completed"||b==null||A.companyBillPayInfo?.info?.businessVerificationStatus?.code!=="pending_review"||(v.current=!0,t(Z(b,!1,!0))):(v.current=!0,t(Z(b,!0)))},[P,b,t]),C.useEffect(()=>{g||_!=="Not-Started"||(f(!0),t(nn(!0)))},[g,_,t]);const T=B=>{S(B)};if(k===!1||h&&!c?.loggedInUserRoleMap?.bill_pay_admin)return u.jsx(j,{to:"../promo"});if(k===!0&&c?.loggedInUserRoleMap!=null){const B=U=>U.trackPageLoaded($.Event.billPaySetup);return u.jsxs(st,{children:[u.jsx(se,{analytics:w,onLoad:U=>B(U)}),u.jsx(fe,{isAppContentDrawerOpen:m,handleDrawerToggle:T}),u.jsx(ot,{navigate:e,location:o,companyId:b,currentTenant:A,isUserBillPayAdmin:n,showIntlWiseWidget:r,onClickMenuIcon:()=>{T(!0)},hasZeniAccountsAdminAccess:i,accountsPromoConfig:d,isLocalCurrencyEnabled:p})]})}return u.jsx(Ue,{fetchState:"In-Progress",style:{backgroundColor:y.colors.grey5}})},zt=(e,o)=>e!=null&&function(t){return t==="debit"||t==="credit"||t==="debit_and_credit"}(e)?e:o,Rt=e=>`/${e}/cards`,Lt=e=>`/${e}/cards/setup`,Mt=e=>`/${e}/cards/onboard`,Zt=(e,o,t,a,c=!1)=>{let n=`/${e}/cards/${encodeURIComponent(o)}`;return a==null||a.status.code!=="inactive"||a.cardHolderUserId!==t.userId||a.type.code!=="business_physical_credit_card"&&a.type.code!=="business_physical_debit_card"?a!=null&&a.status.code==="active"&&a.cardHolderUserId===t.userId&&a.type.code==="business_physical_credit_card"&&c===!0?n+="/addToWallet":a==null||a.type.code!=="business_physical_debit_card"&&a.type.code!=="business_virtual_debit_card"||a.status.code!=="active"||a.cardHolderUserId!==t.userId||a.isPinSet!==!1||(n+="/setPin"):n+="/activate",n},$t=(e,o)=>e.find(t=>t.id===o),Wt=(e,o,t)=>!e||!o||t.fetchState==="Completed",rt=(e,o,t,a)=>({isCreditCardOffered:e,isDebitCardOffered:o,isDebitCardEnabled:t,isCreditCardEnabled:a}),Ht=(e,o)=>e?{creditCardCashbackOffer:`${o.cashbackAnalytics.creditCardCashbackOffer}%`,debitCardCashbackOffer:`${o.cashbackAnalytics.debitCardCashbackOffer}%`,totalEarnedCashback:V(o.cashbackSummary.cashbackEarned.amount),redeemedCashback:V(o.cashbackSummary.cashbackRedeemed.amount),availableCashback:V(o.cashbackSummary.cashbackAvailable.amount),creditCardCashbackRedemptionMode:o.cashbackAnalytics.creditCardCashbackRedemptionMode,debitCardCashbackRedemptionMode:o.cashbackAnalytics.debitCardCashbackRedemptionMode}:void 0,Gt=(e,o,t,a,c)=>e&&o&&t?{creditAccountId:a.id,creditAccountLimit:V(a.limit.amount),creditAccountAvailableAmount:V(a.available.amount),creditAccountSpentAmount:V(a.balance.amount+a.hold.amount),creditAccountStatus:a.status,outstandingBalance:V(c.remainingAmountDue.amount)}:void 0,Kt=(e,o,t,a,c)=>e&&o&&t?{debitAccountId:a.depositAccounts.map(n=>n.id),debitAccountName:a.depositAccounts.map(n=>n.accountName),debitAccountBalance:a.depositAccounts.map(n=>V(n.accountBalance.available.amount)),debitCardsSpend:V(c?.currentMonthSpends.amount??0),debitAccountStatus:a.depositAccounts.map(n=>n.accountStatus)}:void 0,qt=(e,o)=>e&&o.depositAccountLimit!=null&&o.chargeCard!=null?{debitAccountId:o.depositAccountLimit.id,debitAccountName:o.depositAccountLimit?.accountName??o.connectedAccount?.accountName,debitAccountBalance:V(o.depositAccountLimit?.accountBalance.available.amount),debitCardsSpend:V(o.chargeCard.limit.amount-o.chargeCard.available.amount),debitAccountStatus:o.depositAccountLimit?.accountStatus??o.connectedAccount?.accountStatus}:void 0,Jt=80,Qt=80,ut=({isBankingOnlyTenant:e,isDebitCardFeatureEnabled:o})=>o||e,dt=({isCardsOnlyTenant:e,isChargeCardFeatureEnabled:o,isBookKeepingTenant:t,isDebitCardProductVisible:a,chargeCardsCreditAccountLimit:c})=>(e||o||t)&&(!a||c>0),Yt=({isCardsOnlyTenant:e,isChargeCardFeatureEnabled:o,isBookKeepingTenant:t})=>e||o||t,Xt=({cardInfo:e,isProductVisible:o,isTOSAccepted:t,isSetupEnabled:a,isUserHasCardsAdminLevelAccess:c,isUserHasCardsAccess:n})=>!!e&&o&&(!t&&c||n&&!c&&!a),lt=H(function(e,o){const{isUserChargeCardAdmin:t,chargeCardSetUpView:a,isDebitCardOnlyEnabled:c,isCreditCardOnlyEnabled:n}=o,i=F(e),l=D.getSignedInUser(),s=i.tenantId,r={userId:l?.userId??"",sessionId:l?.zeniSessionId??"",tenantId:s??""},p=t&&a.updateStatus.fetchState!=="In-Progress"&&a.plaidConnectionDetails.link_account.updateStatus.fetchState!=="In-Progress"&&a.plaidConnectionDetails.update_account.updateStatus.fetchState!=="In-Progress"&&a.accountUpdateStatus?.fetchState!=="In-Progress"?void 0:"readonly",y=!!i.companyZeniAccountInfo?.info?.isZeniAccountEnabled;return{chargeCardSetUpView:a,connectedAccountProvider:i.company?.featuresActivationInfo.connectedAccountProvider??"",isAccountsEnabled:y,isDisabled:p,meetingUrl:"https://meetings.hubspot.com/niharn/demo-accounts?embed=true",analytics:w,isDebitCardOnlyEnabled:c,isCreditCardOnlyEnabled:n,filesEndPoint:`${oe.fileMicroServiceBaseUrl}`,authParams:r}},function(e,o){const{navigate:t,companyId:a,currentTenant:c,chargeCardSetUpView:n,isDebitCardTOSAccepted:i,isChargeCardTOSAccepted:l,isChargeCardSetupEnabled:s,isDebitCardSetupEnabled:r,productInformation:p,controllerEmails:y,businessVerificationStatus:I}=o;return{onBusinessVerificationSectionClick:()=>{w.trackCardsVerifyIdentityCompanyDetailsClick(y,p,I?.code),t("../verification"),c?.company?.companyChargeCardInfo!=null&&c.company.companyBillPayInfo?.businessVerificationStatus?.code==="pending_review"&&e(le(a,!1,!0))},onFetchLinkTokenClick:(d,m)=>{e(De("charge_card_setup",d,m))},onEstablishConnectionClick:d=>{e(we(d,a,"charge_card_setup","charge_cards"))},onUpdatePaymentAccountStatus:(d,m,S)=>{e(Ee(d,m,"charge_cards","charge_card_setup",S))},onUpdatePaymentAccountLoginStatus:(d,m)=>{e(Pe(!1,d,"charge_cards","charge_card_setup",m))},onEstablishConnectionSuccess:()=>{e(le(a,!0))},onEnableChargeCardClick:()=>{w.trackCardsEnableCardsClick(y,p,"Cards Card Setup"),l===!0&&i===!0&&s===!1&&r===!1?e(q(a,"charge_cards__debit_cards")):l===!0&&s===!1?e(q(a,"charge_cards")):i===!0&&r===!1&&e(q(a,"debit_cards"))},onUpdateChargeCardClick:(d,m,S)=>{const v=n.allBankAccounts.find(f=>f.accountId===n.primaryFundingAccount?.zeniAccountId),g=n.allBankAccounts.find(f=>f.accountId===d);w.trackCardsZeniCashAccountChangeClick(y,p,{oldZeniCashAccount:v?.accountName??"",newZeniCashAccount:g?.accountName??"",oldZeniCashAccountPosition:n.allBankAccounts.findIndex(f=>f.accountId===n.primaryFundingAccount?.zeniAccountId)+1,newZeniCashAccountPosition:n.allBankAccounts.findIndex(f=>f.accountId===d)+1,numberOfCashAccounts:n.allBankAccounts.length}),e(S==="paymentAccount"?_e(d,m,"charge_cards","charge_card_setup"):ve("charge_card_setup",d,m))},onUpdatePrimaryFundingAccount:(d,m)=>{const S=n.allFundingAccounts.find(f=>f.id===d),v=n.allFundingAccounts.findIndex(f=>f.id===n.primaryFundingAccount?.id)+1,g=n.allFundingAccounts.findIndex(f=>f.id===d)+1;w.trackCardsPaymentAccountChangeClick(y,p,{oldPaymentAccountName:n.primaryFundingAccount?.label??"",oldPaymentAccountBalance:V(n.primaryFundingAccount?.accountBalance?.available?.amount??0),newPaymentAccountName:S?.label??"",newPaymentAccountBalance:V(S?.accountBalance?.available?.amount??0),isOldPaymentAccountRecommended:n.primaryFundingAccount?.accType==="depositAccount",isNewPaymentAccountRecommended:S?.accType==="depositAccount",oldPaymentAccountPosition:v,newPaymentAccountPosition:g,numberOfPaymentAccounts:n.allFundingAccounts.length}),e(ke(a,"charge_card_setup",d,m))},onEnableChargeCardSuccess:()=>{e(fn()),t("../",{relative:"path"})},onBackClick:()=>{c?.companyChargeCardInfo?.info?.isChargeCardEnabled||c?.companyDebitCardInfo?.info?.isDebitCardEnabled?t("../",{relative:"path"}):t("../..",{relative:"path"})},onNavigateToDashboard:()=>{t("../../dashboard")},onCompanyOfficerUpdated:(d,m)=>{e(Ae({officerType:d,fileIds:m}))},onSendForVerificationClick:d=>{l===!0&&i===!0?e(R(a,d,"charge_cards__debit_cards",!0,!0,!0)):l===!0?e(R(a,d,"charge_cards",!0,!0,!0)):i===!0&&e(R(a,d,"debit_cards",!0,!0,!0))},updateFilesEntity:d=>{e(te({files:d}))},onDeleteFile:d=>{e(ne(d))},onEditFileName:(d,m)=>{e(ee(d,m.split(".")[0]))},onSignUpClick:()=>{o.hasZeniAccountsAdminAccess?window.open("../checking/promo","_blank"):window.open("https://www.zeni.ai/product/business-checking-accounts","_blank")},onUpdateAutoPayClick:d=>{e(yn(a,d))}}})(Kn),pt=()=>{const e=Q(),o=Y(),t=X(),{tenantEmailDomain:a}=W(),c=ae(),n=E(L=>F(L)),{useDynamicConfig:i,useFeatureGate:l}=ie(),s=o.state?.pathnameStackToGoBack?.[0],{configValue:r}=i(J.zeniAccountsConfig),{configValue:p}=i(J.zeniCardsConfig),y=p.credit_card_auto_pay_threshold_by_company_id?.[n.companyId]??p.default_credit_card_auto_pay_threshold??80,{isFeatureEnabled:I}=l(de.isDebitCardFeatureEnabled),{isFeatureEnabled:d}=l(de.isChargeCardFeatureEnabled),{isFeatureEnabled:m}=l(de.isEarlyPayFeatureEnabled),S=E(L=>cn(L,n.companyId)),v=rn(S.controllers),g=!!n.company?.companyChargeCardInfo.isChargeCardEnabled,f=!!n.company?.companyDebitCardInfo.isDebitCardEnabled,P=un(I,n),A=ut({isDebitCardFeatureEnabled:I,isBankingOnlyTenant:P}),_=dn(n),b=ln(n),k=n.companyChargeCardInfo?.info?.chargeCardsCreditAccountLimit??0,h=dt({isCardsOnlyTenant:_,isChargeCardFeatureEnabled:d,isBookKeepingTenant:b,isDebitCardProductVisible:A,chargeCardsCreditAccountLimit:k}),T=A&&h===!1,B=A===!1&&h,U=ye(r),x=pn(c?.loggedInUserRoleMap),ce=Ie(c?.loggedInUserRoleMap),[G,ge]=C.useState(!1),[K,re]=C.useState(!1),M=E(L=>L.chargeCardSetupViewState.fetchState),N=D.getSignedInUserTenant(a)?.companyId??n.companyId,O=D.getSignedInUser(),Oe=L=>{ge(L)},Se=E(L=>mn(L,N));if(O==null)throw Error("Can't access charge card setup page without signing in...");C.useEffect(()=>{K||M!=="Not-Started"||N==null?K||M!=="Completed"||N==null||n.companyBillPayInfo?.info?.businessVerificationStatus?.code!=="pending_review"||t(le(N,!1,!0)):(re(!0),t(le(N,!0)))},[K,M,N,t]);const be=!!n.company?.companyChargeCardInfo.isChargeCardTOSAccepted,he=!!n.company?.companyDebitCardInfo.isDebitCardTOSAccepted,ue=rt(h,A,f,g);return be||he?be||he?u.jsxs(u.Fragment,{children:[u.jsx(se,{analytics:w,onLoad:()=>{w.trackPageLoaded($.Event.cardsSetupVisited),w.trackCardsCardSetupView(v,ue,s==null?"Cards Setup":s.includes("cards/promo")?"Promo":s.includes("cards")?"Settings":"Cards Tab")}}),u.jsx(fe,{isAppContentDrawerOpen:G,handleDrawerToggle:Oe}),u.jsx(lt,{autoPayThreshold:y,navigate:e,location:o,companyId:N,currentTenant:n,isEarlyPayEnabled:m,isChargeCardTOSAccepted:be,isDebitCardTOSAccepted:he,isUserChargeCardAdmin:x,isDebitCardOnlyEnabled:T,isCreditCardOnlyEnabled:B,chargeCardSetUpView:Se,isCreditCardProductVisible:h,isDebitCardFeatureEnabled:A,isChargeCardSetupEnabled:g,isDebitCardSetupEnabled:f,businessVerificationStatus:n.companyBillPayInfo?.info?.businessVerificationStatus,controllerEmails:v,productInformation:ue,onClickMenuIcon:()=>{Oe(!0)},hasZeniAccountsAdminAccess:ce,accountsPromoConfig:U})]}):u.jsx(Ue,{fetchState:"Not-Started"}):u.jsx(j,{to:"../promo"})},mt=Fe.div`
10
10
  display: flex;
11
11
  height: 100%;
12
12
  width: 100%;
@@ -14,11 +14,11 @@ import{j as u}from"./liveblocks-BSDLCmF2.js";import{h as Q,g as Y,u as X,i as W,
14
14
  flex-direction: column;
15
15
  align-items: center;
16
16
  background-color: ${e=>e.theme.colors.grey4};
17
- `,yt=H(function(e,o){const{isUserRemiAdmin:t,companyId:a}=o,c=F(e),n=bn(e),i=hn(e,a),l=D.getSignedInUser(),s=c.tenantId,r={userId:l?.userId??"",sessionId:l?.zeniSessionId??"",tenantId:s??""},p=t&&i.updateStatus.fetchState!=="In-Progress"&&i.plaidConnectionDetails.link_account.updateStatus.fetchState!=="In-Progress"&&i.plaidConnectionDetails.update_account.updateStatus.fetchState!=="In-Progress"&&i.accountUpdateStatus?.fetchState!=="In-Progress"?void 0:"readonly",y=!!c.companyZeniAccountInfo?.info?.isZeniAccountEnabled;return{remiSetupView:i,isDisabled:p,remiApprovalView:n,connectedAccountProvider:c.company?.featuresActivationInfo.connectedAccountProvider??"",isAccountsEnabled:y,meetingUrl:"https://meetings.hubspot.com/niharn/demo-reimbursements?embed=true",analytics:w,filesEndPoint:`${oe.fileMicroServiceBaseUrl}`,authParams:r}},function(e,o){const{navigate:t,companyId:a,currentTenant:c}=o;return{updateMileageDetails:n=>{const{mileageAmount:i,mileageUnit:l,mileageCurrencyCode:s,mileageCurrencySymbol:r,denomination:p,denominationSymbol:y,mileageAmountInDenomination:I,description:d}=n;e(In({mileageDetails:{mileageUnitAmount:{amount:i,currencyCode:s,currencySymbol:r},denomination:p,denominationSymbol:y,mileageAmountInDenomination:I,mileageCurrencyCode:s,mileageCurrencySymbol:r,mileageUnit:l,description:d}}))},onSaveMileageClick:n=>{e(Cn(a)),w.trackReimbursementMileageRateSave(n)},onBusinessVerificationSectionClick:()=>{t("../verification"),c?.company?.companyReimbursementInfo!=null&&c?.company?.companyBillPayInfo?.businessVerificationStatus?.code==="pending_review"&&e(pe(a,!1,!0))},onSetupApprovalRulesSectionClick:()=>{t("../approval-rules")},onFetchLinkTokenClick:(n,i)=>{e(De("reimbursement_setup",n,i))},onEstablishConnectionClick:n=>{e(we(n,a,"reimbursement_setup","reimbursement"))},onUpdatePaymentAccountStatus:(n,i,l)=>{e(Ee(n,i,"reimbursement","reimbursement_setup",l))},onUpdatePaymentAccountLoginStatus:(n,i)=>{e(Pe(!1,n,"reimbursement","reimbursement_setup",i))},onEstablishConnectionSuccess:()=>{e(pe(a,!0))},onEnableRemiClick:()=>{e(K(a,"reimbursement"))},onUpdateAccountClick:(n,i,l)=>{e(l==="paymentAccount"?_e(n,i,"reimbursement","reimbursement_setup"):ve("reimbursement_setup",n,i))},onEnableRemiSuccess:()=>{t("../",{relative:"path"})},onBackClick:()=>{c?.companyReimbursementInfo?.info?.isReimbursementEnabled!=null&&c.companyReimbursementInfo.info.isReimbursementEnabled===!1?t("../.."):t("../",{relative:"path"})},onCompanyOfficerUpdated:(n,i)=>{e(Ae({officerType:n,fileIds:i}))},onSendForVerificationClick:n=>{e(R(a,n,"reimbursement",!0,!0,!0))},updateFilesEntity:n=>{e(te({files:n}))},onDeleteFile:n=>{e(ne(n))},onEditFileName:(n,i)=>{e(ee(n,i.split(".")[0]))},onUpdatePrimaryFundingAccount:(n,i)=>{e(ke(a,"reimbursement_setup",n,i))},onSignUpClick:()=>{o.hasZeniAccountsAdminAccess?window.open("../checking/promo","_blank"):window.open("https://www.zeni.ai/product/business-checking-accounts","_blank")}}})(Kn),ft=()=>{const e=Q(),o=Y(),t=X(),{tenantEmailDomain:a}=W(),c=ae(),{useDynamicConfig:n}=ie(),i=Te(),{configValue:l}=n(J.zeniAccountsConfig),s=ye(l),r=gn(c?.loggedInUserRoleMap),p=Ie(c?.loggedInUserRoleMap),[y,I]=C.useState(!1),d=C.useRef(!1),[m,S]=C.useState(!1),v=E(b=>b.remiSetupViewState.fetchState),g=E(b=>F(b)),f=E(b=>b.remiSetupApproverViewState.fetchState),P=D.getSignedInUserTenant(a)?.companyId??g.companyId,A=D.getSignedInUser(),_=b=>{I(b)};if(A==null)throw Error("Can't access reimbursement setup page without signing in...");if(C.useEffect(()=>{d.current||v!=="Not-Started"||P==null?d.current||v!=="Completed"||P==null||g.companyBillPayInfo?.info?.businessVerificationStatus?.code!=="pending_review"||(d.current=!0,t(pe(P,!1,!0))):(d.current=!0,t(pe(P,!0)))},[v,P,t]),C.useEffect(()=>{m||f!=="Not-Started"||(S(!0),t(Sn(!0)))},[m,f,t]),g.companyReimbursementInfo?.info?.isReimbursementTOSAccepted===!1)return u.jsx(j,{to:"../promo"});if(g.companyReimbursementInfo?.info?.isReimbursementTOSAccepted===!0){const b=k=>k.trackPageLoaded($.Event.reimbursementSetup);return u.jsxs(mt,{children:[u.jsx(se,{analytics:w,onLoad:k=>b(k)}),u.jsx(fe,{isAppContentDrawerOpen:y,handleDrawerToggle:_}),u.jsx(yt,{navigate:e,location:o,companyId:P,currentTenant:g,isUserRemiAdmin:r,onClickMenuIcon:()=>{_(!0)},hasZeniAccountsAdminAccess:p,accountsPromoConfig:s})]})}return u.jsx(Ue,{fetchState:"In-Progress",style:{backgroundColor:i.colors.grey5}})},gt=H(function(e,o){const{businessVerificationDetails:t,productType:a}=o,c=F(e),n=D.getSignedInUser(),i=c.tenantId,l={userId:n?.userId??"",sessionId:n?.zeniSessionId??"",tenantId:i??""},s=wn(o.roleMap)&&t.updateStatus.fetchState!=="In-Progress"?void 0:"readonly",r=Dn(e.companyConfigState),p=Tn(e.userRoleConfigState),y=a==="zeni_treasury"?qe(e):void 0;return{businessVerificationDetails:t,verficationDetailsFetchState:t.fetchState,isRefreshingViewInBackground:t.isRefreshingViewInBackground,allNationalityCountries:t.allNationalityCountries,filesEndPoint:`${oe.fileMicroServiceBaseUrl}`,authParams:l,isDisabled:s,allIndustries:r.companyIndustries??[],companyTitles:p.companyTitles,transferDetails:y}},function(e,o){const{companyId:t,productType:a,currentTenant:c,navigate:n,location:i}=o,{tenantEmailDomain:l}=c;return{onCompanyDetailsChanged:s=>{const{companyDescription:r,companyIndustry:p,companyIndustryType:y,companyLegalName:I,companyTaxId:d,companyWebsite:m,companyPhone:S,primaryContactEmail:v,primaryContactName:g,primaryContactUserId:f,primaryContactSyncToken:P,syncToken:A,fileIds:_,incDate:b,typeOfIncorporation:k,stateOfIncorporation:h,sourceOfFunds:T,companySubIndustry:B,countriesOfOperations:U,companySourceOfFunds:x,companySourceOfFundsDescription:ce,transactionVolume:G,transactionVolumeDescription:ge,purposeOfAccount:q,purposeOfAccountDescription:re,regulatedStatus:M,regulatedStatusDescription:N,usNexus:O,usNexusTypes:Oe}=s,Se=y?.selectedOption,be={companyId:t,companyDescription:r,companyIndustry:p.selectedOption,companyIndustryType:Se==null||Se===""?void 0:Se,companyLegalName:I,taxIdOrEIN:d,website:m!=""&&m!=null?Bn(m):void 0,phone:S,syncToken:A,fileIds:_,incDate:b!=null?Ne(b?.toString()):b,typeOfIncorporation:k?.selectedOption??"",stateOfIncorporation:h?.selectedOption??"",sourceOfFunds:T?.selectedOption??"",companySubIndustry:B?.selectedOption??"",countriesOfOperations:U?.selectedOptions.map(ue=>ue.length===2?ue:Le(ue))??[],companySourceOfFunds:x?.selectedOption??"",companySourceOfFundsDescription:ce,transactionVolume:G?.selectedOption??"",transactionVolumeDescription:ge,purposeOfAccount:q?.selectedOption??"",purposeOfAccountDescription:re,regulatedStatus:M??"",regulatedStatusDescription:N,usNexus:O,usNexusTypes:Oe?.selectedOptions??[]},he={userId:f,firstName:g.firstName,lastName:g.lastName,email:v,syncToken:P};e(je({companyDetails:be,primaryContactDetails:he}))},onCompanyOfficerUpdated:s=>{const r=s.map(p=>{const{officerType:y,userId:I,name:d,email:m,nationalityCountryCode:S,ssn:v,dob:g,phone:f,syncToken:P,selectDocument:A,role:_,ownership:b,isSelectedForVerification:k,userVerificationStatus:h,treasuryUserVerificationStatus:T,fileIds:B}=p;let U;return A.selectDocumentType==="driverLicense"?U="driving_license":A.selectDocumentType==="passport"?U="passport":A.selectDocumentType==="stateId"?U="id_document":A.selectDocumentType==="ssnCard"&&(U="social_security_card"),{officerType:y,userId:I,firstName:d.firstName,lastName:d.lastName,email:m,ssn:v,nationalityCountryCode:S?.selectedOption!=null?Le(S.selectedOption):void 0,phone:f,birthday:g!=null?Ne(g?.toString()):g,syncToken:P,titleAtCompany:_.selectedOption,ownershipInCompany:b,documentTypeSelectedForVerification:U,isSelectedForVerification:k,userVerificationStatus:h,treasuryUserVerificationStatus:T,fileIds:B,additionalDocumentTypesRequestedForVerification:[],additionalSubmittedDocumentsForVerificationFileIds:[],areAdditionalDocumentsRequestedForVerification:!1,areAdditionalDocumentsSubmittedForVerification:!1}});e(je({officers:r}))},onSaveDetailsClick:s=>{e(R(t,s,a))},onSendForVerificationClick:s=>{e(R(t,s,a,!0))},onAddressClick:s=>{const r=Ze(l,s),p=Re(i.state?.pathnameStackToGoBack,i.pathname),y=new URLSearchParams(i.search),I={};y.forEach((d,m)=>{I[m]=d}),n(r,{state:{pathnameStackToGoBack:p,queryParams:Object.keys(I).length>0?I:void 0}})},onRegisteredAddressClick:s=>{const r=Ze(l,s),p=Re(i.state?.pathnameStackToGoBack,i.pathname),y=new URLSearchParams(i.search),I=Object.fromEntries(y.entries());n(r,{state:{pathnameStackToGoBack:p,queryParams:Object.keys(I).length>0?I:void 0}})},onBackClick:()=>{e(On({companyId:t})),n("../setup")},updateFilesEntity:s=>{e(te({files:s}))},onDeleteFile:s=>{e(ne(s))},onDeleteFileList:s=>{e(Je(s))},onEditFileName:(s,r)=>{e(ee(s,r.split(".")[0]))},onGetOtp:s=>{e(He(s,"SpendManagementSetup"))},onResendOtp:s=>{e(We(s,"SpendManagementSetup"))},onVerifyOtp:(s,r)=>{e($e(s,r,"SpendManagementSetup"))},saveNewAddressInLocalStore:(s,r)=>{e(Un({addressType:s,addressToCreate:r}))},onExecuteTreasuryTransfer:()=>{e(Ke())},onOverlayClose:()=>{e(xe())}}})(Jn),St=({productType:e,isBusinessVerificationDrawerOpen:o,closeDrawerHandler:t})=>{const a=Q(),c=Y(),n=X(),[i]=Ye(),l=i.get("showStepProgress"),s=i.get("isTransferInitiated"),[r,p]=C.useState(!1),{tenantEmailDomain:y}=W(),I=ae(),{useDynamicConfig:d}=ie(),m=Te(),{configValue:S}=d(J.zeniAccountsConfig),v=ye(S),g=E(h=>{switch(e){case"zeni_accounts":return h.zeniAccountSetupViewState.fetchState;case"reimbursement":return h.remiSetupViewState.fetchState;case"charge_cards":return h.chargeCardSetupViewState.fetchState;case"zeni_treasury":return h.treasurySetupViewState.fetchState;default:return h.billPaySetupViewState.fetchState}}),f=E(h=>h.companyConfigState.fetchState),P=E(h=>h.userRoleConfigState.fetchState),A=E(h=>F(h)),_=A.companyId??D.getSignedInUserTenant(y)?.companyId;if(C.useEffect(()=>{f==="Not-Started"&&n(An()),P==="Not-Started"&&n(kn(!0))},[f,P,n]),C.useEffect(()=>{if(!r&&g==="Not-Started"&&_!=null)switch(p(!0),e){case"zeni_accounts":n(me(_,!0));break;case"zeni_treasury":n(Ce(_,!0));break;case"reimbursement":n(pe(_,!0));break;case"charge_cards":n(le(_,!0));break;default:n(Z(_,!0))}},[r,g,_,n]),D.getSignedInUser()==null)throw Error("Can't access business verification without signing in...");let b;switch(e){case"zeni_accounts":b=A.companyZeniAccountInfo?.info?.isZeniAccountTOSAccepted;break;case"reimbursement":b=A.companyReimbursementInfo?.info?.isReimbursementTOSAccepted;break;case"charge_cards":b=A.companyChargeCardInfo?.info?.isChargeCardTOSAccepted===!0||A.companyDebitCardInfo?.info?.isDebitCardTOSAccepted;break;case"zeni_treasury":b=A.companyTreasuryInfo?.info?.isTreasuryTOSAccepted;break;default:b=A.companyBillPayInfo?.info?.isBillPayTOSAccepted}const k=E(h=>{let T;switch(e){case"zeni_accounts":T=En(h,_);break;case"zeni_treasury":T=Ge(h,_);break;case"charge_cards":T=Pn(h,_);break;case"reimbursement":T=vn(h,_);break;default:T=_n(h,_)}return T});return b===!1?null:k.fetchState==="Completed"&&b===!0&&I?.loggedInUserRoleMap!=null?u.jsxs(u.Fragment,{children:[u.jsx(se,{analytics:w,onLoad:h=>(T=>{switch(e){case"zeni_accounts":return T.trackPageLoaded($.Event.zeniAccountsBusinessVerification);case"reimbursement":case"charge_cards":return T.trackPageLoaded($.Event.reimbursementBusinessVerification);default:return T.trackPageLoaded($.Event.billPayBusinessVerification,Ve(c)?"Settings":void 0)}})(h)}),u.jsx(gt,{businessVerificationDetails:k,navigate:a,location:c,companyId:_,analytics:w,currentTenant:A,productType:e,roleMap:I.loggedInUserRoleMap,isSettings:Ve(c),isOverlay:!0,isStepInProgress:l!=null,isTreasuryTransferInitiated:s!=null,onClickMenuIcon:()=>{},maxInsuredAmount:v.maxInsuredAmount,isBusinessVerificationDrawerOpen:o,closeDrawerHandler:t})]}):u.jsx(Ue,{fetchState:"In-Progress",style:{backgroundColor:m.colors.grey5}})},bt={overlayWidth:new Yn(100,100,59)},ht=H(function(e,o){const{isUserZeniAccountsAdmin:t,companyId:a,accountsPromoConfig:c}=o,n=F(e),i=D.getSignedInUser(),l=n.tenantId,s={userId:i?.userId??"",sessionId:i?.zeniSessionId??"",tenantId:l??""},r=Qe(e,a),p=Ge(e,a),y=t&&r.updateStatus.fetchState!=="In-Progress"&&r.plaidConnectionDetails.link_account.updateStatus.fetchState!=="In-Progress"&&r.plaidConnectionDetails.update_account.updateStatus.fetchState!=="In-Progress"&&r.accountUpdateStatus?.fetchState!=="In-Progress"?void 0:"readonly",I=Nn(e),d=I.transactions,m=qe(e),S=I.accountSummary?.totalBalance?.amount,v=d.length===0||S===0;return{treasurySetupView:r,businessVerificationDetails:p,connectedAccountProvider:n.company?.featuresActivationInfo.connectedAccountProvider??"",transactions:d,transferDetails:m,isFirstTransfer:v,isDisabled:y,meetingUrl:"https://meetings.hubspot.com/niharn/demo-accounts?embed=true",analytics:w,filesEndPoint:`${oe.fileMicroServiceBaseUrl}`,authParams:s,isOnSetup:!0,maxInsuredAmount:c.maxInsuredAmount}},function(e,o){const{navigate:t,companyId:a,currentTenant:c,isAllocationDone:n,analytics:i,treasurySetupView:l}=o;return{onTransferSaveChangesToLocalStore:s=>{e(Rn(s))},onBusinessVerificationSectionClick:(s,r)=>{let p="../verification";s&&(p+="?showStepProgress=true",r&&(p+="&isTransferInitiated=true")),t(p),c?.company?.companyTreasuryInfo!=null&&c?.company?.companyTreasuryInfo?.businessVerificationStatus?.code==="pending_review"&&e(Ce(a,!1,!0))},onFetchLinkTokenClick:(s,r)=>{e(De("treasury_setup",s,r))},onEstablishConnectionClick:s=>{e(we(s,a,"treasury_setup","zeni_treasury"))},onUpdatePaymentAccountStatus:(s,r,p)=>{e(Ee(s,r,"zeni_treasury","treasury_setup",p))},onUpdatePaymentAccountLoginStatus:(s,r)=>{e(Pe(!1,s,"zeni_treasury","treasury_setup",r))},onEstablishConnectionSuccess:()=>{e(Ce(a,!0))},onEnableTreasuryClick:()=>{e(K(a,"zeni_treasury"))},onUpdateTreasuryClick:(s,r,p)=>{e(p==="paymentAccount"?_e(s,r,"zeni_treasury","treasury_setup"):ve("treasury_setup",s,r))},onUpdatePrimaryFundingAccount:(s,r)=>{e(ke(a,"treasury_setup",s,r))},onNavigateToDashboard:()=>{t(c?.company?.companyTreasuryInfo?.businessVerificationStatus?.code==="verified"?"../":"../../")},onCompanyOfficerUpdated:(s,r)=>{e(Ae({officerType:s,fileIds:r}))},onSendForVerificationClick:(s,r)=>{if(e(R(a,s,"zeni_treasury",!0,!0,!0)),!n){const p=l.fundAllocationLocalData;i.trackTreasuryPortfolioConfirm(p.riskScore,Me(p)),e(ze(!1))}r===!0&&e(Ke())},updateFilesEntity:s=>{e(te({files:s}))},onDeleteFile:s=>{e(ne(s))},onEditFileName:(s,r)=>{e(ee(s,r.split(".")[0]))},onAdditionalVerificationFieldsChanged:s=>{const{sourceOfFunds:r}=s;e(zn({sourceOfFunds:r?.selectedOption??""}))},onUpdateFundAllocation:s=>{i.trackTreasuryAllocationAction("update",Me(s)),e(jn(s))},onConfirmFundAllocation:()=>{e(ze(n))},onSignUpClick:()=>{o.isUserZeniAccountsAdmin?window.open("../checking/promo","_blank","noopener,noreferrer"):window.open("https://www.zeni.ai/product/business-checking-accounts","_blank","noopener,noreferrer")},onOverlayClose:()=>{e(xe())}}})(Xn),Ct=()=>{const e=Q(),o=Y(),t=X(),a=Te(),c=Qn(),{tenantEmailDomain:n}=W(),{useDynamicConfig:i}=ie(),l=ae(),[s,r]=C.useState(!1),p=Ie(l?.loggedInUserRoleMap),{configValue:y}=i(J.zeniAccountsConfig),I=ye(y),[d,m]=C.useState(!1),[S,v]=C.useState(!1),[g,f]=C.useState(!1),[P,A]=C.useState(!1),[_,b]=C.useState(!1),k=E(O=>O.treasurySetupViewState.fetchState),h=E(O=>O.treasurySetupViewState.treasuryFundsDetails?.fetchStatus?.fetchState),T=E(O=>O.treasurySetupViewState.currentAllocation.fetchStatus?.fetchState),B=E(O=>O.treasuryDetailState.transactionsState?.fetchState),U=E(O=>F(O)),x=D.getSignedInUserTenant(n)?.companyId??U.companyId,ce=E(O=>Qe(O,x)),G=ce.isAtomicAccountExists,ge=!!U.companyZeniAccountInfo?.info?.isZeniAccountEnabled,q=D.getSignedInUser(),re=O=>{m(O)};if(q==null)throw Error("Can't access treasury setup page without signing in...");C.useEffect(()=>{S||k!=="Not-Started"||x==null||(v(!0),t(Ce(x,!0,!1)))},[S,k,x,t]),C.useEffect(()=>{g||h!=="Not-Started"||x==null||(f(!0),t(xn()))},[g,h,x,t]),C.useEffect(()=>{P||T!=="Not-Started"||x==null||(A(!0),t(Fn()))},[P,T,x,t]),C.useEffect(()=>{_||B!=="Not-Started"||x==null||(b(!0),t(Vn(!0)))},[_,B,x,t]);const M=U.companyTreasuryInfo?.info?.businessVerificationStatus?.code,N=M==="pending_review"||M==="verified";return C.useEffect(()=>{s||k!=="Completed"||G||N||!o.pathname.includes("setup")||r(!0)},[k,G,N]),U.companyTreasuryInfo?.info?.isTreasuryTOSAccepted===!1?u.jsx(j,{to:"../promo"}):u.jsxs(u.Fragment,{children:[u.jsx(se,{analytics:w,onLoad:()=>{}}),u.jsx(fe,{isAppContentDrawerOpen:d,handleDrawerToggle:re}),u.jsx(at,{onClose:()=>{t(xe()),e("../setup")},anchor:"right",open:o.pathname.includes("verification"),transitionDuration:s?0:250,PaperProps:{style:{width:bt.overlayWidth.valuePercentage(c),boxShadow:"none"}},slotProps:{backdrop:{style:{backgroundColor:s?"transparent":a.colors.black,opacity:.75,cursor:"pointer"}}},children:u.jsx(It,{onClick:O=>O.stopPropagation(),children:u.jsx(St,{productType:"zeni_treasury",isBusinessVerificationDrawerOpen:!0,closeDrawerHandler:()=>{t(xe()),e("../setup")}})})}),u.jsx(ht,{navigate:e,location:o,companyId:x,currentTenant:U,isUserZeniAccountsAdmin:p,accountsPromoConfig:I,isAccountsEnabled:ge,isAllocationDone:G,analytics:w,treasurySetupView:ce,onClickMenuIcon:()=>{re(!0)},showTreasurySetupOverlay:s,setShowTreasurySetupOverlay:r})]})},It=Fe(it)`
17
+ `,yt=H(function(e,o){const{isUserRemiAdmin:t,companyId:a}=o,c=F(e),n=bn(e),i=hn(e,a),l=D.getSignedInUser(),s=c.tenantId,r={userId:l?.userId??"",sessionId:l?.zeniSessionId??"",tenantId:s??""},p=t&&i.updateStatus.fetchState!=="In-Progress"&&i.plaidConnectionDetails.link_account.updateStatus.fetchState!=="In-Progress"&&i.plaidConnectionDetails.update_account.updateStatus.fetchState!=="In-Progress"&&i.accountUpdateStatus?.fetchState!=="In-Progress"?void 0:"readonly",y=!!c.companyZeniAccountInfo?.info?.isZeniAccountEnabled;return{remiSetupView:i,isDisabled:p,remiApprovalView:n,connectedAccountProvider:c.company?.featuresActivationInfo.connectedAccountProvider??"",isAccountsEnabled:y,meetingUrl:"https://meetings.hubspot.com/niharn/demo-reimbursements?embed=true",analytics:w,filesEndPoint:`${oe.fileMicroServiceBaseUrl}`,authParams:r}},function(e,o){const{navigate:t,companyId:a,currentTenant:c}=o;return{updateMileageDetails:n=>{const{mileageAmount:i,mileageUnit:l,mileageCurrencyCode:s,mileageCurrencySymbol:r,denomination:p,denominationSymbol:y,mileageAmountInDenomination:I,description:d}=n;e(In({mileageDetails:{mileageUnitAmount:{amount:i,currencyCode:s,currencySymbol:r},denomination:p,denominationSymbol:y,mileageAmountInDenomination:I,mileageCurrencyCode:s,mileageCurrencySymbol:r,mileageUnit:l,description:d}}))},onSaveMileageClick:n=>{e(Cn(a)),w.trackReimbursementMileageRateSave(n)},onBusinessVerificationSectionClick:()=>{t("../verification"),c?.company?.companyReimbursementInfo!=null&&c?.company?.companyBillPayInfo?.businessVerificationStatus?.code==="pending_review"&&e(pe(a,!1,!0))},onSetupApprovalRulesSectionClick:()=>{t("../approval-rules")},onFetchLinkTokenClick:(n,i)=>{e(De("reimbursement_setup",n,i))},onEstablishConnectionClick:n=>{e(we(n,a,"reimbursement_setup","reimbursement"))},onUpdatePaymentAccountStatus:(n,i,l)=>{e(Ee(n,i,"reimbursement","reimbursement_setup",l))},onUpdatePaymentAccountLoginStatus:(n,i)=>{e(Pe(!1,n,"reimbursement","reimbursement_setup",i))},onEstablishConnectionSuccess:()=>{e(pe(a,!0))},onEnableRemiClick:()=>{e(q(a,"reimbursement"))},onUpdateAccountClick:(n,i,l)=>{e(l==="paymentAccount"?_e(n,i,"reimbursement","reimbursement_setup"):ve("reimbursement_setup",n,i))},onEnableRemiSuccess:()=>{t("../",{relative:"path"})},onBackClick:()=>{c?.companyReimbursementInfo?.info?.isReimbursementEnabled!=null&&c.companyReimbursementInfo.info.isReimbursementEnabled===!1?t("../.."):t("../",{relative:"path"})},onCompanyOfficerUpdated:(n,i)=>{e(Ae({officerType:n,fileIds:i}))},onSendForVerificationClick:n=>{e(R(a,n,"reimbursement",!0,!0,!0))},updateFilesEntity:n=>{e(te({files:n}))},onDeleteFile:n=>{e(ne(n))},onEditFileName:(n,i)=>{e(ee(n,i.split(".")[0]))},onUpdatePrimaryFundingAccount:(n,i)=>{e(ke(a,"reimbursement_setup",n,i))},onSignUpClick:()=>{o.hasZeniAccountsAdminAccess?window.open("../checking/promo","_blank"):window.open("https://www.zeni.ai/product/business-checking-accounts","_blank")}}})(qn),ft=()=>{const e=Q(),o=Y(),t=X(),{tenantEmailDomain:a}=W(),c=ae(),{useDynamicConfig:n}=ie(),i=Te(),{configValue:l}=n(J.zeniAccountsConfig),s=ye(l),r=gn(c?.loggedInUserRoleMap),p=Ie(c?.loggedInUserRoleMap),[y,I]=C.useState(!1),d=C.useRef(!1),[m,S]=C.useState(!1),v=E(b=>b.remiSetupViewState.fetchState),g=E(b=>F(b)),f=E(b=>b.remiSetupApproverViewState.fetchState),P=D.getSignedInUserTenant(a)?.companyId??g.companyId,A=D.getSignedInUser(),_=b=>{I(b)};if(A==null)throw Error("Can't access reimbursement setup page without signing in...");if(C.useEffect(()=>{d.current||v!=="Not-Started"||P==null?d.current||v!=="Completed"||P==null||g.companyBillPayInfo?.info?.businessVerificationStatus?.code!=="pending_review"||(d.current=!0,t(pe(P,!1,!0))):(d.current=!0,t(pe(P,!0)))},[v,P,t]),C.useEffect(()=>{m||f!=="Not-Started"||(S(!0),t(Sn(!0)))},[m,f,t]),g.companyReimbursementInfo?.info?.isReimbursementTOSAccepted===!1)return u.jsx(j,{to:"../promo"});if(g.companyReimbursementInfo?.info?.isReimbursementTOSAccepted===!0){const b=k=>k.trackPageLoaded($.Event.reimbursementSetup);return u.jsxs(mt,{children:[u.jsx(se,{analytics:w,onLoad:k=>b(k)}),u.jsx(fe,{isAppContentDrawerOpen:y,handleDrawerToggle:_}),u.jsx(yt,{navigate:e,location:o,companyId:P,currentTenant:g,isUserRemiAdmin:r,onClickMenuIcon:()=>{_(!0)},hasZeniAccountsAdminAccess:p,accountsPromoConfig:s})]})}return u.jsx(Ue,{fetchState:"In-Progress",style:{backgroundColor:i.colors.grey5}})},gt=H(function(e,o){const{businessVerificationDetails:t,productType:a}=o,c=F(e),n=D.getSignedInUser(),i=c.tenantId,l={userId:n?.userId??"",sessionId:n?.zeniSessionId??"",tenantId:i??""},s=wn(o.roleMap)&&t.updateStatus.fetchState!=="In-Progress"?void 0:"readonly",r=Dn(e.companyConfigState),p=Tn(e.userRoleConfigState),y=a==="zeni_treasury"?Ke(e):void 0;return{businessVerificationDetails:t,verficationDetailsFetchState:t.fetchState,isRefreshingViewInBackground:t.isRefreshingViewInBackground,allNationalityCountries:t.allNationalityCountries,filesEndPoint:`${oe.fileMicroServiceBaseUrl}`,authParams:l,isDisabled:s,allIndustries:r.companyIndustries??[],companyTitles:p.companyTitles,transferDetails:y}},function(e,o){const{companyId:t,productType:a,currentTenant:c,navigate:n,location:i}=o,{tenantEmailDomain:l}=c;return{onCompanyDetailsChanged:s=>{const{companyDescription:r,companyIndustry:p,companyIndustryType:y,companyLegalName:I,companyTaxId:d,companyWebsite:m,companyPhone:S,primaryContactEmail:v,primaryContactName:g,primaryContactUserId:f,primaryContactSyncToken:P,syncToken:A,fileIds:_,incDate:b,typeOfIncorporation:k,stateOfIncorporation:h,sourceOfFunds:T,companySubIndustry:B,countriesOfOperations:U,companySourceOfFunds:x,companySourceOfFundsDescription:ce,transactionVolume:G,transactionVolumeDescription:ge,purposeOfAccount:K,purposeOfAccountDescription:re,regulatedStatus:M,regulatedStatusDescription:N,usNexus:O,usNexusTypes:Oe}=s,Se=y?.selectedOption,be={companyId:t,companyDescription:r,companyIndustry:p.selectedOption,companyIndustryType:Se==null||Se===""?void 0:Se,companyLegalName:I,taxIdOrEIN:d,website:m!=""&&m!=null?Bn(m):void 0,phone:S,syncToken:A,fileIds:_,incDate:b!=null?Ne(b?.toString()):b,typeOfIncorporation:k?.selectedOption??"",stateOfIncorporation:h?.selectedOption??"",sourceOfFunds:T?.selectedOption??"",companySubIndustry:B?.selectedOption??"",countriesOfOperations:U?.selectedOptions.map(ue=>ue.length===2?ue:Le(ue))??[],companySourceOfFunds:x?.selectedOption??"",companySourceOfFundsDescription:ce,transactionVolume:G?.selectedOption??"",transactionVolumeDescription:ge,purposeOfAccount:K?.selectedOption??"",purposeOfAccountDescription:re,regulatedStatus:M??"",regulatedStatusDescription:N,usNexus:O,usNexusTypes:Oe?.selectedOptions??[]},he={userId:f,firstName:g.firstName,lastName:g.lastName,email:v,syncToken:P};e(je({companyDetails:be,primaryContactDetails:he}))},onCompanyOfficerUpdated:s=>{const r=s.map(p=>{const{officerType:y,userId:I,name:d,email:m,nationalityCountryCode:S,ssn:v,dob:g,phone:f,syncToken:P,selectDocument:A,role:_,ownership:b,isSelectedForVerification:k,userVerificationStatus:h,treasuryUserVerificationStatus:T,fileIds:B}=p;let U;return A.selectDocumentType==="driverLicense"?U="driving_license":A.selectDocumentType==="passport"?U="passport":A.selectDocumentType==="stateId"?U="id_document":A.selectDocumentType==="ssnCard"&&(U="social_security_card"),{officerType:y,userId:I,firstName:d.firstName,lastName:d.lastName,email:m,ssn:v,nationalityCountryCode:S?.selectedOption!=null?Le(S.selectedOption):void 0,phone:f,birthday:g!=null?Ne(g?.toString()):g,syncToken:P,titleAtCompany:_.selectedOption,ownershipInCompany:b,documentTypeSelectedForVerification:U,isSelectedForVerification:k,userVerificationStatus:h,treasuryUserVerificationStatus:T,fileIds:B,additionalDocumentTypesRequestedForVerification:[],additionalSubmittedDocumentsForVerificationFileIds:[],areAdditionalDocumentsRequestedForVerification:!1,areAdditionalDocumentsSubmittedForVerification:!1}});e(je({officers:r}))},onSaveDetailsClick:s=>{e(R(t,s,a))},onSendForVerificationClick:s=>{e(R(t,s,a,!0))},onAddressClick:s=>{const r=Ze(l,s),p=Re(i.state?.pathnameStackToGoBack,i.pathname),y=new URLSearchParams(i.search),I={};y.forEach((d,m)=>{I[m]=d}),n(r,{state:{pathnameStackToGoBack:p,queryParams:Object.keys(I).length>0?I:void 0}})},onRegisteredAddressClick:s=>{const r=Ze(l,s),p=Re(i.state?.pathnameStackToGoBack,i.pathname),y=new URLSearchParams(i.search),I=Object.fromEntries(y.entries());n(r,{state:{pathnameStackToGoBack:p,queryParams:Object.keys(I).length>0?I:void 0}})},onBackClick:()=>{e(On({companyId:t})),n("../setup")},updateFilesEntity:s=>{e(te({files:s}))},onDeleteFile:s=>{e(ne(s))},onDeleteFileList:s=>{e(Je(s))},onEditFileName:(s,r)=>{e(ee(s,r.split(".")[0]))},onGetOtp:s=>{e(He(s,"SpendManagementSetup"))},onResendOtp:s=>{e(We(s,"SpendManagementSetup"))},onVerifyOtp:(s,r)=>{e($e(s,r,"SpendManagementSetup"))},saveNewAddressInLocalStore:(s,r)=>{e(Un({addressType:s,addressToCreate:r}))},onExecuteTreasuryTransfer:()=>{e(qe())},onOverlayClose:()=>{e(xe())}}})(Jn),St=({productType:e,isBusinessVerificationDrawerOpen:o,closeDrawerHandler:t})=>{const a=Q(),c=Y(),n=X(),[i]=Ye(),l=i.get("showStepProgress"),s=i.get("isTransferInitiated"),[r,p]=C.useState(!1),{tenantEmailDomain:y}=W(),I=ae(),{useDynamicConfig:d}=ie(),m=Te(),{configValue:S}=d(J.zeniAccountsConfig),v=ye(S),g=E(h=>{switch(e){case"zeni_accounts":return h.zeniAccountSetupViewState.fetchState;case"reimbursement":return h.remiSetupViewState.fetchState;case"charge_cards":return h.chargeCardSetupViewState.fetchState;case"zeni_treasury":return h.treasurySetupViewState.fetchState;default:return h.billPaySetupViewState.fetchState}}),f=E(h=>h.companyConfigState.fetchState),P=E(h=>h.userRoleConfigState.fetchState),A=E(h=>F(h)),_=A.companyId??D.getSignedInUserTenant(y)?.companyId;if(C.useEffect(()=>{f==="Not-Started"&&n(An()),P==="Not-Started"&&n(kn(!0))},[f,P,n]),C.useEffect(()=>{if(!r&&g==="Not-Started"&&_!=null)switch(p(!0),e){case"zeni_accounts":n(me(_,!0));break;case"zeni_treasury":n(Ce(_,!0));break;case"reimbursement":n(pe(_,!0));break;case"charge_cards":n(le(_,!0));break;default:n(Z(_,!0))}},[r,g,_,n]),D.getSignedInUser()==null)throw Error("Can't access business verification without signing in...");let b;switch(e){case"zeni_accounts":b=A.companyZeniAccountInfo?.info?.isZeniAccountTOSAccepted;break;case"reimbursement":b=A.companyReimbursementInfo?.info?.isReimbursementTOSAccepted;break;case"charge_cards":b=A.companyChargeCardInfo?.info?.isChargeCardTOSAccepted===!0||A.companyDebitCardInfo?.info?.isDebitCardTOSAccepted;break;case"zeni_treasury":b=A.companyTreasuryInfo?.info?.isTreasuryTOSAccepted;break;default:b=A.companyBillPayInfo?.info?.isBillPayTOSAccepted}const k=E(h=>{let T;switch(e){case"zeni_accounts":T=En(h,_);break;case"zeni_treasury":T=Ge(h,_);break;case"charge_cards":T=Pn(h,_);break;case"reimbursement":T=vn(h,_);break;default:T=_n(h,_)}return T});return b===!1?null:k.fetchState==="Completed"&&b===!0&&I?.loggedInUserRoleMap!=null?u.jsxs(u.Fragment,{children:[u.jsx(se,{analytics:w,onLoad:h=>(T=>{switch(e){case"zeni_accounts":return T.trackPageLoaded($.Event.zeniAccountsBusinessVerification);case"reimbursement":case"charge_cards":return T.trackPageLoaded($.Event.reimbursementBusinessVerification);default:return T.trackPageLoaded($.Event.billPayBusinessVerification,Ve(c)?"Settings":void 0)}})(h)}),u.jsx(gt,{businessVerificationDetails:k,navigate:a,location:c,companyId:_,analytics:w,currentTenant:A,productType:e,roleMap:I.loggedInUserRoleMap,isSettings:Ve(c),isOverlay:!0,isStepInProgress:l!=null,isTreasuryTransferInitiated:s!=null,onClickMenuIcon:()=>{},maxInsuredAmount:v.maxInsuredAmount,isBusinessVerificationDrawerOpen:o,closeDrawerHandler:t})]}):u.jsx(Ue,{fetchState:"In-Progress",style:{backgroundColor:m.colors.grey5}})},bt={overlayWidth:new Yn(100,100,59)},ht=H(function(e,o){const{isUserZeniAccountsAdmin:t,companyId:a,accountsPromoConfig:c}=o,n=F(e),i=D.getSignedInUser(),l=n.tenantId,s={userId:i?.userId??"",sessionId:i?.zeniSessionId??"",tenantId:l??""},r=Qe(e,a),p=Ge(e,a),y=t&&r.updateStatus.fetchState!=="In-Progress"&&r.plaidConnectionDetails.link_account.updateStatus.fetchState!=="In-Progress"&&r.plaidConnectionDetails.update_account.updateStatus.fetchState!=="In-Progress"&&r.accountUpdateStatus?.fetchState!=="In-Progress"?void 0:"readonly",I=Nn(e),d=I.transactions,m=Ke(e),S=I.accountSummary?.totalBalance?.amount,v=d.length===0||S===0;return{treasurySetupView:r,businessVerificationDetails:p,connectedAccountProvider:n.company?.featuresActivationInfo.connectedAccountProvider??"",transactions:d,transferDetails:m,isFirstTransfer:v,isDisabled:y,meetingUrl:"https://meetings.hubspot.com/niharn/demo-accounts?embed=true",analytics:w,filesEndPoint:`${oe.fileMicroServiceBaseUrl}`,authParams:s,isOnSetup:!0,maxInsuredAmount:c.maxInsuredAmount}},function(e,o){const{navigate:t,companyId:a,currentTenant:c,isAllocationDone:n,analytics:i,treasurySetupView:l}=o;return{onTransferSaveChangesToLocalStore:s=>{e(Rn(s))},onBusinessVerificationSectionClick:(s,r)=>{let p="../verification";s&&(p+="?showStepProgress=true",r&&(p+="&isTransferInitiated=true")),t(p),c?.company?.companyTreasuryInfo!=null&&c?.company?.companyTreasuryInfo?.businessVerificationStatus?.code==="pending_review"&&e(Ce(a,!1,!0))},onFetchLinkTokenClick:(s,r)=>{e(De("treasury_setup",s,r))},onEstablishConnectionClick:s=>{e(we(s,a,"treasury_setup","zeni_treasury"))},onUpdatePaymentAccountStatus:(s,r,p)=>{e(Ee(s,r,"zeni_treasury","treasury_setup",p))},onUpdatePaymentAccountLoginStatus:(s,r)=>{e(Pe(!1,s,"zeni_treasury","treasury_setup",r))},onEstablishConnectionSuccess:()=>{e(Ce(a,!0))},onEnableTreasuryClick:()=>{e(q(a,"zeni_treasury"))},onUpdateTreasuryClick:(s,r,p)=>{e(p==="paymentAccount"?_e(s,r,"zeni_treasury","treasury_setup"):ve("treasury_setup",s,r))},onUpdatePrimaryFundingAccount:(s,r)=>{e(ke(a,"treasury_setup",s,r))},onNavigateToDashboard:()=>{t(c?.company?.companyTreasuryInfo?.businessVerificationStatus?.code==="verified"?"../":"../../")},onCompanyOfficerUpdated:(s,r)=>{e(Ae({officerType:s,fileIds:r}))},onSendForVerificationClick:(s,r)=>{if(e(R(a,s,"zeni_treasury",!0,!0,!0)),!n){const p=l.fundAllocationLocalData;i.trackTreasuryPortfolioConfirm(p.riskScore,Me(p)),e(ze(!1))}r===!0&&e(qe())},updateFilesEntity:s=>{e(te({files:s}))},onDeleteFile:s=>{e(ne(s))},onEditFileName:(s,r)=>{e(ee(s,r.split(".")[0]))},onAdditionalVerificationFieldsChanged:s=>{const{sourceOfFunds:r}=s;e(zn({sourceOfFunds:r?.selectedOption??""}))},onUpdateFundAllocation:s=>{i.trackTreasuryAllocationAction("update",Me(s)),e(jn(s))},onConfirmFundAllocation:()=>{e(ze(n))},onSignUpClick:()=>{o.isUserZeniAccountsAdmin?window.open("../checking/promo","_blank","noopener,noreferrer"):window.open("https://www.zeni.ai/product/business-checking-accounts","_blank","noopener,noreferrer")},onOverlayClose:()=>{e(xe())}}})(Xn),Ct=()=>{const e=Q(),o=Y(),t=X(),a=Te(),c=Qn(),{tenantEmailDomain:n}=W(),{useDynamicConfig:i}=ie(),l=ae(),[s,r]=C.useState(!1),p=Ie(l?.loggedInUserRoleMap),{configValue:y}=i(J.zeniAccountsConfig),I=ye(y),[d,m]=C.useState(!1),[S,v]=C.useState(!1),[g,f]=C.useState(!1),[P,A]=C.useState(!1),[_,b]=C.useState(!1),k=E(O=>O.treasurySetupViewState.fetchState),h=E(O=>O.treasurySetupViewState.treasuryFundsDetails?.fetchStatus?.fetchState),T=E(O=>O.treasurySetupViewState.currentAllocation.fetchStatus?.fetchState),B=E(O=>O.treasuryDetailState.transactionsState?.fetchState),U=E(O=>F(O)),x=D.getSignedInUserTenant(n)?.companyId??U.companyId,ce=E(O=>Qe(O,x)),G=ce.isAtomicAccountExists,ge=!!U.companyZeniAccountInfo?.info?.isZeniAccountEnabled,K=D.getSignedInUser(),re=O=>{m(O)};if(K==null)throw Error("Can't access treasury setup page without signing in...");C.useEffect(()=>{S||k!=="Not-Started"||x==null||(v(!0),t(Ce(x,!0,!1)))},[S,k,x,t]),C.useEffect(()=>{g||h!=="Not-Started"||x==null||(f(!0),t(xn()))},[g,h,x,t]),C.useEffect(()=>{P||T!=="Not-Started"||x==null||(A(!0),t(Fn()))},[P,T,x,t]),C.useEffect(()=>{_||B!=="Not-Started"||x==null||(b(!0),t(Vn(!0)))},[_,B,x,t]);const M=U.companyTreasuryInfo?.info?.businessVerificationStatus?.code,N=M==="pending_review"||M==="verified";return C.useEffect(()=>{s||k!=="Completed"||G||N||!o.pathname.includes("setup")||r(!0)},[k,G,N]),U.companyTreasuryInfo?.info?.isTreasuryTOSAccepted===!1?u.jsx(j,{to:"../promo"}):u.jsxs(u.Fragment,{children:[u.jsx(se,{analytics:w,onLoad:()=>{}}),u.jsx(fe,{isAppContentDrawerOpen:d,handleDrawerToggle:re}),u.jsx(at,{onClose:()=>{t(xe()),e("../setup")},anchor:"right",open:o.pathname.includes("verification"),transitionDuration:s?0:250,PaperProps:{style:{width:bt.overlayWidth.valuePercentage(c),boxShadow:"none"}},slotProps:{backdrop:{style:{backgroundColor:s?"transparent":a.colors.black,opacity:.75,cursor:"pointer"}}},children:u.jsx(It,{onClick:O=>O.stopPropagation(),children:u.jsx(St,{productType:"zeni_treasury",isBusinessVerificationDrawerOpen:!0,closeDrawerHandler:()=>{t(xe()),e("../setup")}})})}),u.jsx(ht,{navigate:e,location:o,companyId:x,currentTenant:U,isUserZeniAccountsAdmin:p,accountsPromoConfig:I,isAccountsEnabled:ge,isAllocationDone:G,analytics:w,treasurySetupView:ce,onClickMenuIcon:()=>{re(!0)},showTreasurySetupOverlay:s,setShowTreasurySetupOverlay:r})]})},It=Fe(it)`
18
18
  display: flex;
19
19
  min-height: 100%;
20
20
  flex-direction: column;
21
- `,At=H(function(e,o){const{isUserZeniAccountsAdmin:t,companyId:a}=o,c=F(e),n=D.getSignedInUser(),i=c.tenantId,l={userId:n?.userId??"",sessionId:n?.zeniSessionId??"",tenantId:i??""},s=Ln(e,a),r=t&&s.updateStatus.fetchState!=="In-Progress"&&s.plaidConnectionDetails.link_account.updateStatus.fetchState!=="In-Progress"&&s.plaidConnectionDetails.update_account.updateStatus.fetchState!=="In-Progress"&&s.accountUpdateStatus?.fetchState!=="In-Progress"?void 0:"readonly";return{zeniAccountSetUpView:s,connectedAccountProvider:c.company?.featuresActivationInfo.connectedAccountProvider??"",isDisabled:r,meetingUrl:"https://meetings.hubspot.com/niharn/demo-accounts?embed=true",analytics:w,filesEndPoint:`${oe.fileMicroServiceBaseUrl}`,authParams:l}},function(e,o){const{navigate:t,companyId:a,currentTenant:c}=o;return{onBusinessVerificationSectionClick:()=>{t("../verification"),c?.company?.companyZeniAccountInfo!=null&&c?.company?.companyBillPayInfo?.businessVerificationStatus?.code==="pending_review"&&e(me(a,!1,!0))},onFetchLinkTokenClick:(n,i)=>{e(De("account_setup",n,i))},onEstablishConnectionClick:n=>{e(we(n,a,"account_setup","zeni_accounts"))},onUpdatePaymentAccountStatus:(n,i,l)=>{e(Ee(n,i,"zeni_accounts","account_setup",l))},onUpdatePaymentAccountLoginStatus:(n,i)=>{e(Pe(!1,n,"zeni_accounts","account_setup",i))},onEstablishConnectionSuccess:()=>{e(me(a,!0))},onEnableZeniAccountClick:()=>{e(K(a,"zeni_accounts"))},onUpdateZeniAccountClick:(n,i,l)=>{e(l==="paymentAccount"?_e(n,i,"zeni_accounts","account_setup"):ve("account_setup",n,i))},onUpdatePrimaryFundingAccount:(n,i)=>{e(ke(a,"account_setup",n,i))},onEnableZeniAccountSuccess:()=>{t("../",{relative:"path"})},onBackClick:()=>{c?.companyZeniAccountInfo?.info?.isZeniAccountEnabled?t("../"):t("../../")},onNavigateToDashboard:()=>{t("../../dashboard")},onCompanyOfficerUpdated:(n,i)=>{e(Ae({officerType:n,fileIds:i}))},onSendForVerificationClick:n=>{e(R(a,n,"zeni_accounts",!0,!0,!0))},updateFilesEntity:n=>{e(te({files:n}))},onDeleteFile:n=>{e(ne(n))},onEditFileName:(n,i)=>{e(ee(n,i.split(".")[0]))}}})(et),kt=()=>{const e=Q(),o=Y(),t=X(),{tenantEmailDomain:a}=W(),{useDynamicConfig:c}=ie(),n=ae(),i=Ie(n?.loggedInUserRoleMap),{configValue:l}=c(J.zeniAccountsConfig),s=ye(l),[r,p]=C.useState(!1),[y,I]=C.useState(!1),d=E(f=>f.zeniAccountSetupViewState.fetchState),m=E(f=>F(f)),S=D.getSignedInUserTenant(a)?.companyId??m.companyId,v=D.getSignedInUser(),g=f=>{p(f)};if(v==null)throw Error("Can't access zeni bank account setup page without signing in...");if(C.useEffect(()=>{y||d!=="Not-Started"||S==null?y||d!=="Completed"||S==null||m.companyBillPayInfo?.info?.businessVerificationStatus?.code!=="pending_review"||t(me(S,!1,!0)):(I(!0),t(me(S,!0)))},[y,d,S,t]),m.companyZeniAccountInfo?.info?.isZeniAccountTOSAccepted===!1)return u.jsx(j,{to:"../promo"});{const f=P=>P.trackPageLoaded($.Event.zeniAccountsSetup);return u.jsxs(u.Fragment,{children:[u.jsx(se,{analytics:w,onLoad:P=>f(P)}),u.jsx(fe,{isAppContentDrawerOpen:r,handleDrawerToggle:g}),u.jsx(At,{navigate:e,location:o,companyId:S,currentTenant:m,isUserZeniAccountsAdmin:i,accountsPromoConfig:s,onClickMenuIcon:()=>{g(!0)}})]})}},_t=Fe.div`
21
+ `,At=H(function(e,o){const{isUserZeniAccountsAdmin:t,companyId:a}=o,c=F(e),n=D.getSignedInUser(),i=c.tenantId,l={userId:n?.userId??"",sessionId:n?.zeniSessionId??"",tenantId:i??""},s=Ln(e,a),r=t&&s.updateStatus.fetchState!=="In-Progress"&&s.plaidConnectionDetails.link_account.updateStatus.fetchState!=="In-Progress"&&s.plaidConnectionDetails.update_account.updateStatus.fetchState!=="In-Progress"&&s.accountUpdateStatus?.fetchState!=="In-Progress"?void 0:"readonly";return{zeniAccountSetUpView:s,connectedAccountProvider:c.company?.featuresActivationInfo.connectedAccountProvider??"",isDisabled:r,meetingUrl:"https://meetings.hubspot.com/niharn/demo-accounts?embed=true",analytics:w,filesEndPoint:`${oe.fileMicroServiceBaseUrl}`,authParams:l}},function(e,o){const{navigate:t,companyId:a,currentTenant:c}=o;return{onBusinessVerificationSectionClick:()=>{t("../verification"),c?.company?.companyZeniAccountInfo!=null&&c?.company?.companyBillPayInfo?.businessVerificationStatus?.code==="pending_review"&&e(me(a,!1,!0))},onFetchLinkTokenClick:(n,i)=>{e(De("account_setup",n,i))},onEstablishConnectionClick:n=>{e(we(n,a,"account_setup","zeni_accounts"))},onUpdatePaymentAccountStatus:(n,i,l)=>{e(Ee(n,i,"zeni_accounts","account_setup",l))},onUpdatePaymentAccountLoginStatus:(n,i)=>{e(Pe(!1,n,"zeni_accounts","account_setup",i))},onEstablishConnectionSuccess:()=>{e(me(a,!0))},onEnableZeniAccountClick:()=>{e(q(a,"zeni_accounts"))},onUpdateZeniAccountClick:(n,i,l)=>{e(l==="paymentAccount"?_e(n,i,"zeni_accounts","account_setup"):ve("account_setup",n,i))},onUpdatePrimaryFundingAccount:(n,i)=>{e(ke(a,"account_setup",n,i))},onEnableZeniAccountSuccess:()=>{t("../",{relative:"path"})},onBackClick:()=>{c?.companyZeniAccountInfo?.info?.isZeniAccountEnabled?t("../"):t("../../")},onNavigateToDashboard:()=>{t("../../dashboard")},onCompanyOfficerUpdated:(n,i)=>{e(Ae({officerType:n,fileIds:i}))},onSendForVerificationClick:n=>{e(R(a,n,"zeni_accounts",!0,!0,!0))},updateFilesEntity:n=>{e(te({files:n}))},onDeleteFile:n=>{e(ne(n))},onEditFileName:(n,i)=>{e(ee(n,i.split(".")[0]))}}})(et),kt=()=>{const e=Q(),o=Y(),t=X(),{tenantEmailDomain:a}=W(),{useDynamicConfig:c}=ie(),n=ae(),i=Ie(n?.loggedInUserRoleMap),{configValue:l}=c(J.zeniAccountsConfig),s=ye(l),[r,p]=C.useState(!1),[y,I]=C.useState(!1),d=E(f=>f.zeniAccountSetupViewState.fetchState),m=E(f=>F(f)),S=D.getSignedInUserTenant(a)?.companyId??m.companyId,v=D.getSignedInUser(),g=f=>{p(f)};if(v==null)throw Error("Can't access zeni bank account setup page without signing in...");if(C.useEffect(()=>{y||d!=="Not-Started"||S==null?y||d!=="Completed"||S==null||m.companyBillPayInfo?.info?.businessVerificationStatus?.code!=="pending_review"||t(me(S,!1,!0)):(I(!0),t(me(S,!0)))},[y,d,S,t]),m.companyZeniAccountInfo?.info?.isZeniAccountTOSAccepted===!1)return u.jsx(j,{to:"../promo"});{const f=P=>P.trackPageLoaded($.Event.zeniAccountsSetup);return u.jsxs(u.Fragment,{children:[u.jsx(se,{analytics:w,onLoad:P=>f(P)}),u.jsx(fe,{isAppContentDrawerOpen:r,handleDrawerToggle:g}),u.jsx(At,{navigate:e,location:o,companyId:S,currentTenant:m,isUserZeniAccountsAdmin:i,accountsPromoConfig:s,onClickMenuIcon:()=>{g(!0)}})]})}},_t=Fe.div`
22
22
  display: flex;
23
23
  height: 100vh;
24
24
  width: 100%;
@@ -26,4 +26,4 @@ import{j as u}from"./liveblocks-BSDLCmF2.js";import{h as Q,g as Y,u as X,i as W,
26
26
  flex-direction: column;
27
27
  align-items: center;
28
28
  background-color: ${e=>e.theme.colors.grey4};
29
- `,vt=H(function(e,o){const t=F(e),a=D.getSignedInUser(),c=t.tenantId,n={userId:a?.userId??"",sessionId:a?.zeniSessionId??"",tenantId:c??""};return{internationalOnboardingDetails:$n(e),isReadonly:o.isFormReadonly,filesEndPoint:`${oe.fileMicroServiceBaseUrl}`,authParams:n,analytics:w}},function(e,o){const{navigate:t}=o;return{onFormDataChange:a=>{e(Hn(a))},onSubmitClick:()=>{e(Wn(o.companyId))},onCancelClick:()=>{t("../setup")},updateFilesEntity:a=>{e(te({files:a}))},onDeleteFile:a=>{e(ne(a))},onDeleteFileList:a=>{e(Je(a))},onEditFileName:(a,c)=>{e(ee(a,c.split(".")[0]))}}})(nt),Pt=()=>{const e=Q(),o=Y(),t=X(),[a,c]=C.useState(!1),[n,i]=C.useState(!1),[l,s]=C.useState(!1),{tenantEmailDomain:r}=W(),p=ae(),{useFeatureGate:y}=ie(),{isFeatureEnabled:I}=y(de.isBillPayLocalCurrencyFeatureEnabled),d=E(k=>k.internationalWireVerificationState.verificationFormFetchState.fetchState),m=E(k=>k.billPaySetupViewState.fetchState),S=E(k=>F(k)),v=Te(),g=S.companyId??D.getSignedInUserTenant(r)?.companyId,f=E(k=>Mn(k.companyState,S.companyId)),P=f?.company.companyBillPayInfo.internationalWireOnboardingStatus,A=P?.code==="onboarding_status_not_started"?void 0:"readonly";if(C.useEffect(()=>{a||d!=="Not-Started"||g==null||(c(!0),t(Zn(g)))},[a,d,g,t]),C.useEffect(()=>{n||m!=="Not-Started"||g==null||(i(!0),t(Z(g,!0)))},[m,n,g,t]),D.getSignedInUser()==null)throw Error("Can't access international verification without signing in...");const _=S.companyBillPayInfo?.info?.isBillPayTOSAccepted,b=k=>{s(k)};return _===!1?u.jsx(j,{to:"../promo"}):_===!0&&p?.loggedInUserRoleMap!=null?u.jsxs(_t,{children:[u.jsx(se,{analytics:w,onLoad:k=>(h=>h.trackPageLoaded($.Event.billPayBusinessVerification,void 0))(k)}),Ve(o)?u.jsx(fe,{isAppContentDrawerOpen:l,handleDrawerToggle:b}):null,u.jsx(vt,{navigate:e,location:o,companyId:g,analytics:w,currentTenant:S,roleMap:p.loggedInUserRoleMap,isFormReadonly:A,isLocalCurrencyEnabled:I})]}):u.jsx(Ue,{fetchState:"In-Progress",style:{backgroundColor:v.colors.grey5}})},Et=H(function(){return{}},function(e,o){const{companyId:t,productType:a}=o;return{onEventReceived:c=>{switch(c){case"bill-pay-set-up-verification-update":case"bill-pay-wise-setup":switch(a){case"reimbursement":e(pe(t,!0,!0));break;case"zeni_accounts":e(me(t,!0,!0));break;case"charge_cards":e(le(t,!0,!0));break;case"zeni_treasury":e(Ce(t,!0,!0));break;default:e(Z(t,!0,!0))}}}}})(tt(e=>{const{isBillPayAdminLevelAccess:o,isUserHasOnlyBillPayAccess:t,isReimbursementAdminLevelAccess:a,isZeniAccountAdminLevelAccess:c,isTreasuryAdminLevelAccess:n,isChargeCardAdminLevelAccess:i,isUserHasOnlyCardAccess:l,productType:s,type:r}=e;switch(s){case"bill_pay":switch(r){case"verification":return o?u.jsx(Be,{productType:s}):t?u.jsx(j,{to:"../"}):u.jsx(z,{});case"international-wire":return o?u.jsx(Pt,{}):t?u.jsx(j,{to:"../"}):u.jsx(z,{});default:return o?u.jsx(ct,{}):t?u.jsx(j,{to:"../"}):u.jsx(z,{})}case"reimbursement":return r==="verification"?a?u.jsx(Be,{productType:s}):u.jsx(z,{}):a?u.jsx(ft,{}):u.jsx(z,{});case"zeni_accounts":return r==="verification"?c?u.jsx(Be,{productType:"zeni_accounts"}):u.jsx(z,{}):c?u.jsx(kt,{}):u.jsx(z,{});case"zeni_treasury":return n===!0?u.jsx(Ct,{}):u.jsx(z,{});case"charge_cards":return r==="verification"?i?u.jsx(Be,{productType:"charge_cards"}):l?u.jsx(j,{to:"../"}):u.jsx(z,{}):i?u.jsx(pt,{}):l?u.jsx(j,{to:"../"}):u.jsx(z,{})}}));function ea(e){const{tenantEmailDomain:o}=W(),t=E(c=>F(c)).companyId??D.getSignedInUserTenant(o)?.companyId,a={events:t!=null?[`private-encrypted-${t}.bill-pay-set-up-verification-update`,`private-encrypted-${t}.bill-pay-wise-setup`]:[],eventCallback:(c,n,i)=>{i.onEventReceived(c)}};if(D.getSignedInUser()==null)throw Error("Can't access setup details page without signing in...");return u.jsx(Et,{...e,companyId:t,...a})}export{Jt as A,Qt as P,ea as S,Gt as a,Kt as b,ut as c,dt as d,rt as e,Rt as f,Zt as g,Ht as h,qt as i,Yt as j,Wt as k,$t as l,Lt as m,Mt as n,zt as p,Xt as s};
29
+ `,vt=H(function(e,o){const t=F(e),a=D.getSignedInUser(),c=t.tenantId,n={userId:a?.userId??"",sessionId:a?.zeniSessionId??"",tenantId:c??""};return{internationalOnboardingDetails:$n(e),isReadonly:o.isFormReadonly,filesEndPoint:`${oe.fileMicroServiceBaseUrl}`,authParams:n,analytics:w}},function(e,o){const{navigate:t}=o;return{onFormDataChange:a=>{e(Hn(a))},onSubmitClick:()=>{e(Wn(o.companyId))},onCancelClick:()=>{t("../setup")},updateFilesEntity:a=>{e(te({files:a}))},onDeleteFile:a=>{e(ne(a))},onDeleteFileList:a=>{e(Je(a))},onEditFileName:(a,c)=>{e(ee(a,c.split(".")[0]))}}})(nt),Pt=()=>{const e=Q(),o=Y(),t=X(),[a,c]=C.useState(!1),[n,i]=C.useState(!1),[l,s]=C.useState(!1),{tenantEmailDomain:r}=W(),p=ae(),{useFeatureGate:y}=ie(),{isFeatureEnabled:I}=y(de.isBillPayLocalCurrencyFeatureEnabled),d=E(k=>k.internationalWireVerificationState.verificationFormFetchState.fetchState),m=E(k=>k.billPaySetupViewState.fetchState),S=E(k=>F(k)),v=Te(),g=S.companyId??D.getSignedInUserTenant(r)?.companyId,f=E(k=>Mn(k.companyState,S.companyId)),P=f?.company.companyBillPayInfo.internationalWireOnboardingStatus,A=P?.code==="onboarding_status_not_started"?void 0:"readonly";if(C.useEffect(()=>{a||d!=="Not-Started"||g==null||(c(!0),t(Zn(g)))},[a,d,g,t]),C.useEffect(()=>{n||m!=="Not-Started"||g==null||(i(!0),t(Z(g,!0)))},[m,n,g,t]),D.getSignedInUser()==null)throw Error("Can't access international verification without signing in...");const _=S.companyBillPayInfo?.info?.isBillPayTOSAccepted,b=k=>{s(k)};return _===!1?u.jsx(j,{to:"../promo"}):_===!0&&p?.loggedInUserRoleMap!=null?u.jsxs(_t,{children:[u.jsx(se,{analytics:w,onLoad:k=>(h=>h.trackPageLoaded($.Event.billPayBusinessVerification,void 0))(k)}),Ve(o)?u.jsx(fe,{isAppContentDrawerOpen:l,handleDrawerToggle:b}):null,u.jsx(vt,{navigate:e,location:o,companyId:g,analytics:w,currentTenant:S,roleMap:p.loggedInUserRoleMap,isFormReadonly:A,isLocalCurrencyEnabled:I})]}):u.jsx(Ue,{fetchState:"In-Progress",style:{backgroundColor:v.colors.grey5}})},Et=H(function(){return{}},function(e,o){const{companyId:t,productType:a}=o;return{onEventReceived:c=>{switch(c){case"bill-pay-set-up-verification-update":case"bill-pay-wise-setup":switch(a){case"reimbursement":e(pe(t,!0,!0));break;case"zeni_accounts":e(me(t,!0,!0));break;case"charge_cards":e(le(t,!0,!0));break;case"zeni_treasury":e(Ce(t,!0,!0));break;default:e(Z(t,!0,!0))}}}}})(tt(e=>{const{isBillPayAdminLevelAccess:o,isUserHasOnlyBillPayAccess:t,isReimbursementAdminLevelAccess:a,isZeniAccountAdminLevelAccess:c,isTreasuryAdminLevelAccess:n,isChargeCardAdminLevelAccess:i,isUserHasOnlyCardAccess:l,productType:s,type:r}=e;switch(s){case"bill_pay":switch(r){case"verification":return o?u.jsx(Be,{productType:s}):t?u.jsx(j,{to:"../"}):u.jsx(z,{});case"international-wire":return o?u.jsx(Pt,{}):t?u.jsx(j,{to:"../"}):u.jsx(z,{});default:return o?u.jsx(ct,{}):t?u.jsx(j,{to:"../"}):u.jsx(z,{})}case"reimbursement":return r==="verification"?a?u.jsx(Be,{productType:s}):u.jsx(z,{}):a?u.jsx(ft,{}):u.jsx(z,{});case"zeni_accounts":return r==="verification"?c?u.jsx(Be,{productType:"zeni_accounts"}):u.jsx(z,{}):c?u.jsx(kt,{}):u.jsx(z,{});case"zeni_treasury":return n===!0?u.jsx(Ct,{}):u.jsx(z,{});case"charge_cards":return r==="verification"?i?u.jsx(Be,{productType:"charge_cards"}):l?u.jsx(j,{to:"../"}):u.jsx(z,{}):i?u.jsx(pt,{}):l?u.jsx(j,{to:"../"}):u.jsx(z,{})}}));function ea(e){const{tenantEmailDomain:o}=W(),t=E(c=>F(c)).companyId??D.getSignedInUserTenant(o)?.companyId,a={events:t!=null?[`private-encrypted-${t}.bill-pay-set-up-verification-update`,`private-encrypted-${t}.bill-pay-wise-setup`]:[],eventCallback:(c,n,i)=>{i.onEventReceived(c)}};if(D.getSignedInUser()==null)throw Error("Can't access setup details page without signing in...");return u.jsx(Et,{...e,companyId:t,...a})}export{Jt as A,Qt as P,ea as S,Gt as a,qt as b,ut as c,dt as d,rt as e,Rt as f,Zt as g,Ht as h,Kt as i,Yt as j,Wt as k,$t as l,Lt as m,Mt as n,zt as p,Xt as s};
@@ -0,0 +1 @@
1
+ import{j as u}from"./liveblocks-Do-nuGO9.js";import{a as f,b as T,q as A}from"./sentry-CpVyi-77.js";import{u as D,h as z,j as c,g as J,N as M,n as O}from"./core-CAUatE6D.js";import{u as P,z as s,h as j,c as E,D as F,d as _,e as B,y as N,g as V,f as W,i as v}from"./index-ssCDruz8.js";import{eP as $,Jl as q,Jm as G,eW as H,fn as K,Jr as Q,fL as R,cT as X,Js as C,Jt as Y,Ju as Z,bT as y}from"./zeni-epic-state-Cb-J9Nxh.js";import"./mui-Ee2kkUYC.js";import{u as ee}from"./useDeviceId-BXZMNB1t.js";import{f as te}from"./analyticsHelper-DidHWGct.js";import{t as ne}from"./getLocaleForTenant-DjpfkvqM.js";import"./recharts-DfwJcvGU.js";import"./analytics-CztvM7Zo.js";import"./plaid-BfqKUq3C.js";import"./dnd-DoUvAW-O.js";import"./stripe-DMRn4zHo.js";import"./lottie-DhqFkmtq.js";import"./lexical-B4m6CLZ0.js";import"./pdf-DGClrODY.js";import"./utils-Bgxe0MRZ.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]="ac074131-a8c7-4327-9e90-31ed2351211a",t._sentryDebugIdIdentifier="sentry-dbid-ac074131-a8c7-4327-9e90-31ed2351211a")}catch{}})();const ie=O(function(t,i){const d=t.tenantState.fetchState,g=t.tenantState.sendEmailMagicLinkFetchState,{magicLinkExpired:n,magicLinkAlreadyUsed:a,magicLinkExpiredEmail:l}=i;return{googleClientId:v.googleClientId,microsoftClientId:v.microsoftClientId,signInError:t.tenantState.error?.error,fetchState:d,sendMagicLinkStatus:g,magicLinkExpired:n,magicLinkAlreadyUsed:a,magicLinkExpiredEmail:l}},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 l=a==="google"?window.location.origin:window.location.origin+window.location.pathname;t(Z({authCode:n,oauthProvider:a,appType:"web",redirectUri:y(l),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(Y(n,a)))},clearSignInError:()=>{t(C())}}})(W),ae=T.memo(ie);function ve({setTenantEmailDomain:t}){const i=D(),d=z(),{clearAllLoading:g}=P(),n=s.getSignedInUser();f.useLayoutEffect(()=>{g()},[g]);const a=ee(),l=c(e=>e.tenantState.magicLinkCodeVerifier),{sendEmailMagicLinkFetchState:h,accountLocked:U,accountUnlockTime:k}=c(e=>e.tenantState),p=c(e=>e.tenantState.fetchState),L=c(e=>e.tenantState.activeTenantFetchState.fetchState),S=c(e=>e.tenantState.signInState),o=c(e=>e.tenantState.loggedInUser),r=c(e=>$(e)),I=c(e=>q(e)),m=J(),w=j().mode,b=m.state?.magicLinkExpired,x=m.state?.magicLinkAlreadyUsed;if(f.useEffect(()=>{h.fetchState==="Completed"&&l!=null&&(E.trackSignInLinkSent(),s.saveMagicLinkCodeVerifier(l))},[h.fetchState,l]),f.useEffect(()=>{t(void 0)},[]),f.useEffect(()=>{S!=="In-Progress"||p!=="Completed"&&L!=="Completed"||o?.zeniSessionId==null||r==null||(s.savePayNowInfoTooltip(!0,o.zeniSessionId),s.saveSignedInUserWithSession(o,o.zeniSessionId),s.saveSignedInUserTenants(G(I.tenantsInOrder),o.zeniSessionId),H(o.userId,o.zeniSessionId,r.tenantId),i(K(r.tenantId)),s.saveActiveTenantDomainForUser(r.tenantEmailDomain),i(Q("Completed")),F.updateAppLocaleID(ne(r)),te(o,r,w,void 0,I.tenantsInOrder),R().then(()=>{const e=V();e!=null&&_(e)}),setTimeout(()=>{E.trackLogin(B.Event.loginSuccess,o.authProvider??"google",X(r.productSettings))},2e3))},[S,p,L,o,r,I,w,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:!!b,magicLinkAlreadyUsed:!!x,magicLinkExpiredEmail:s.getMagicLinkEmail()??void 0,location:m,navigate:d,deviceId:a??void 0,showEmailLogin:!0}),U===!0&&k!=null?u.jsx(N,{onClose:()=>i(C()),unlockDate:k}):null]})}export{ve as default};
@@ -0,0 +1,9 @@
1
+ import{j as s}from"./liveblocks-Do-nuGO9.js";import{a as n}from"./sentry-CpVyi-77.js";import{u,g as m,h as p,N as g}from"./core-CAUatE6D.js";import{z as d,B as y,t as b,c as f,e as h}from"./index-ssCDruz8.js";import{fQ as x,fR as I,JJ as w}from"./zeni-epic-state-Cb-J9Nxh.js";import{n as j}from"./mui-Ee2kkUYC.js";import"./recharts-DfwJcvGU.js";import"./analytics-CztvM7Zo.js";import"./plaid-BfqKUq3C.js";import"./dnd-DoUvAW-O.js";import"./stripe-DMRn4zHo.js";import"./lottie-DhqFkmtq.js";import"./lexical-B4m6CLZ0.js";import"./pdf-DGClrODY.js";import"./utils-Bgxe0MRZ.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]="564a7409-f1d8-493d-a35a-12b25bfdddae",e._sentryDebugIdIdentifier="sentry-dbid-564a7409-f1d8-493d-a35a-12b25bfdddae")}catch{}})();function U(){const e=u(),t=m(),a=p(),i=n.useRef(!1),l=d.isSignedIn(),r=t.state?.message==="logout",o=r||l;return n.useEffect(()=>{o&&!i.current&&(i.current=!0,setTimeout(()=>{try{d.clearAll(),e(x()),e(I(!1)),w(),b.reset(),f.trackLogout(h.Event.logoutSuccess),f.resetUserIdentity()}catch(c){console.error("Error during sign out:",c)}finally{r||a("/signin/auth",{replace:!0})}},0))},[o,r]),o?s.jsx(v,{children:s.jsx(y,{fetchState:"In-Progress"})}):s.jsx(g,{to:"../",replace:!0})}const v=j.div`
2
+ display: flex;
3
+ height: 100vh;
4
+ width: 100%;
5
+ flex: 1 1 auto;
6
+ flex-direction: column;
7
+ align-items: center;
8
+ background-color: ${e=>e.theme.colors.grey4};
9
+ `;export{U as default};
@@ -1,4 +1,4 @@
1
- import{j as u}from"./liveblocks-BSDLCmF2.js";import{a as g}from"./sentry-67DqaLi1.js";import{h as _,u as v,g as z,j as b,i as Z,n as M}from"./core-B20PugrR.js";import{z as Q,w as O,I as p,_ as V,N as W,d as q,f as H,cP as J,s as f,r as X}from"./index-CtCI_jgi.js";import{eP as Y,QA as R,Ge as E,QB as A,Qw as aa,FG as S,QC as ea,FK as I,Fd as ta,Gf as B,QD as w,gQ as sa,G5 as oa,Ga as na,FZ as ia,FX as F,Gb as la,FU as ra,QE as ka,QF as ca,QG as da,QH as ua,QI as m,ec as pa,QJ as ma,QK as Ta}from"./zeni-epic-state-B3AwsZqW.js";import{n as ga}from"./mui-BBkBdMVO.js";import{u as fa}from"./useAskAiCfoHostNavButtonProps-CMgniebB.js";import{M as Ga}from"./MobileAppDrawer-DjZLcHYq.js";import"./recharts-BzjcN9SN.js";import"./analytics-B35UERag.js";import"./plaid-DHvUog4a.js";import"./dnd-CTNaOehy.js";import"./stripe-DMRn4zHo.js";import"./lottie-DG71PfmK.js";import"./lexical-BDpP_OMn.js";import"./pdf-Cp8DoYAG.js";import"./utils-C7uJ9upL.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]="6896be3b-c1d2-459f-9de7-3858d846e76e",e._sentryDebugIdIdentifier="sentry-dbid-6896be3b-c1d2-459f-9de7-3858d846e76e")}catch{}})();const ha=ga.div`
1
+ import{j as d}from"./liveblocks-Do-nuGO9.js";import{a as g}from"./sentry-CpVyi-77.js";import{h as v,u as z,g as _,j as b,i as V,n as Z}from"./core-CAUatE6D.js";import{z as Q,w as M,I as p,Y as O,V as W,c as q,e as H,cP as J,m as f,p as X}from"./index-ssCDruz8.js";import{eP as Y,QA as R,Ge as E,QB as A,Qw as aa,FG as S,QC as ea,FK as I,Fd as ta,Gf as B,QD as w,gQ as sa,G5 as oa,Ga as na,FZ as ia,FX as F,Gb as la,FU as ra,QE as ca,QF as ka,QG as ua,QH as da,QI as m,ec as pa,QJ as ma,QK as Ta}from"./zeni-epic-state-Cb-J9Nxh.js";import{n as ga}from"./mui-Ee2kkUYC.js";import{u as fa}from"./useAskAiCfoHostNavButtonProps-BiHuzfAQ.js";import{M as Ga}from"./MobileAppDrawer-6SipHCGH.js";import"./recharts-DfwJcvGU.js";import"./analytics-CztvM7Zo.js";import"./plaid-BfqKUq3C.js";import"./dnd-DoUvAW-O.js";import"./stripe-DMRn4zHo.js";import"./lottie-DhqFkmtq.js";import"./lexical-B4m6CLZ0.js";import"./pdf-DGClrODY.js";import"./utils-Bgxe0MRZ.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]="0cb159ad-2527-4338-9e26-a8e44a87c71f",e._sentryDebugIdIdentifier="sentry-dbid-0cb159ad-2527-4338-9e26-a8e44a87c71f")}catch{}})();const ha=ga.div`
2
2
  display: flex;
3
3
  min-height: 100%;
4
4
  width: 100%;
@@ -6,4 +6,4 @@ import{j as u}from"./liveblocks-BSDLCmF2.js";import{a as g}from"./sentry-67DqaLi
6
6
  flex-direction: column;
7
7
  align-items: center;
8
8
  background-color: ${e=>e.theme.colors.grey4};
9
- `,Da=M(function(e,t){const o=R(e,t.isTaskTemplatesEnabled),{taskGroupId:k}=t,i=k!=null&&k!==""?{...o,taskGroupsWithTasksList:o.taskGroupsWithTasksList.map(l=>({...l,tasks:l.tasks.filter(a=>a.taskGroupIds.includes(k))})).filter(l=>l.tasks.length>0)}:o,d=aa(e),n=Q.isZeniUser();return{taskListView:i,tagListView:d,localData:i.localData,isTaskTemplatesEnabled:t.isTaskTemplatesEnabled,isZeniUser:n}},function(e,t){const{navigate:o,currentTenant:k,location:i,isTaskTemplatesEnabled:d}=t,{tenantEmailDomain:n}=k,{groupByKey:l}=t.uiState;return{onTaskManagementRowClick:a=>{const s=L(n,a),c=f(i.state?.pathnameStackToGoBack,i.pathname);o(s,{state:{pathnameStackToGoBack:c}})},onReloadTasks:()=>{e(E(!0,d))},onTabChange:a=>{e(ua(a))},onParentTaskClick:a=>{const s=L(n,a);window.open(s,"_blank","noopener")},bulkUpdateTasks:(a,s)=>{e(F(a,null,s))},onNewTaskClick:()=>{if(t.localData.defaultTaskGroupId!=null){const a=C(n,t.localData.defaultTaskGroupId),s=f(i.state?.pathnameStackToGoBack,i.pathname);o(a,{state:{pathnameStackToGoBack:s,message:"comingFromTaskListPage"}})}},onColumnSortConfigChanged:(a,s)=>{e(w({uiState:{sortKey:a,sortOrder:s}}))},onFiltersChange:a=>{e(da({filters:a}))},onSearchTextChanged:a=>{e(ca({searchText:a}))},onReloadCards:()=>{e(E(!0,d))},onBackClick:()=>{if(i.state?.message==="triggerBackClick"){const a=X(i.state?.pathnameStackToGoBack),s=a.poppedPathname??"../";o(s,{state:{pathnameStackToGoBack:a.newStack}})}else o("../")},updateLocalData:a=>{e(ka({localData:a}))},resetLocalData:()=>{e(A({taskGroupById:t.taskGroupState.taskGroupById}))},handleCreateGroup:a=>{e(ra(t.localData.newTaskGroupName,a))},assignGroupToTasks:a=>{e(F(t.localData.selectedTaskIds,a,la(t.uiState.groupByKey,a)))},onDeleteTaskGroup:a=>{e(ia(a))},onAddNewTaskToTaskGroup:a=>{if(t.localData.defaultTaskGroupId!=null){const s=ba(l,a);e(S({taskDetailLocalData:s}));const c=C(n,t.uiState.groupByKey==="groupName"?a:t.localData.defaultTaskGroupId),G=f(i.state?.pathnameStackToGoBack,i.pathname);o(c,{state:{pathnameStackToGoBack:G,message:"comingFromTaskListPage"}})}},onDragNDrop:(a,s)=>{e(na(t.localData.selectedTaskIds.length>0?t.localData.selectedTaskIds:[a],s))},onTaskGroupRename:(a,s)=>{e(oa(a,s))},onTimeSpentUpdate:(a,s)=>{e(B({task:a,updates:s}))},onShowToast:a=>{e(sa(a))},onGroupByFilterChange:a=>{e(w({uiState:{groupByKey:a}}))},updateTask:(a,s)=>{e(B({task:a,updates:s}))},onCreateTagClick:(a,s)=>{e(ta(a,s))},handleGroupTemplateClick:a=>{e(I(a,[]))},handleGroupTemplateTaskClick:(a,s)=>{e(I(a,[s]))},handleNewTaskInitialization:a=>{if(e(S({taskDetailLocalData:{...ea,name:a}})),t.localData.defaultTaskGroupId!=null){const s=C(n,t.localData.defaultTaskGroupId),c=f(i.state?.pathnameStackToGoBack,i.pathname);o(s,{state:{pathnameStackToGoBack:c,message:"comingFromTaskListPage"}})}},onTaskGroupNameClick:a=>{o(`/${n}/tasks/group/${a}`)},onQuickResponsesClick:()=>{o(`/${n}/tasks/quick-responses`)}}})(J);function Ka(){const e=_(),t=v(),o=z(),k=Q.getSignedInUser(),i=b(r=>Y(r)),{taskGroupId:d}=Z(),{useFeatureGate:n}=O(),{isFeatureEnabled:l}=n(p.isTaskTemplatesEnabled),{isFeatureEnabled:a}=n(p.isTaskCannedResponsesEnabled),{isFeatureEnabled:s}=n(p.isTaskCategorizationEnabled),{isFeatureEnabled:c}=n(p.isTaskBulkResolutionEnabled),{isFeatureEnabled:G}=n(p.isTaskGroupAssigneesEnabled),{isFeatureEnabled:x}=n(p.isTaskRecurringParentEnabled),[y,P]=g.useState(!1),[N,$]=g.useState(!1),h=b(r=>R(r,l)),D=b(r=>r.taskGroupState),T=h.fetchState,{isAiCfoAccessEnabled:j,onAskAiCfoClick:K}=fa({mobileExploreReferrer:"Task Checklist"});if(V({isDataReady:T==="Completed"}),g.useEffect(()=>{y||(P(!0),t(E(!1,l)))},[y,t]),g.useEffect(()=>{T==="Completed"&&t(A({taskGroupById:D.taskGroupById}))},[T,D.taskGroupById]),k==null)throw Error("Can't access task list page without signing in...");return u.jsxs(u.Fragment,{children:[T==="Completed"?u.jsx(W,{analytics:q,onLoad:r=>(U=>U.trackPageLoaded(H.Event.taskListPage))(r)}):null,u.jsxs(ha,{children:[u.jsx(Ga,{isAppContentDrawerOpen:N,handleDrawerToggle:r=>{$(r)}}),u.jsx(Da,{location:o,navigate:e,currentTenant:i,taskGroupId:d,taskGroupState:D,localData:h.localData,uiState:h.uiState,isTaskTemplatesEnabled:l,taskListFetchState:T,isTaskCategorizationEnabled:s,isTaskCannedResponsesEnabled:a,isTaskBulkResolutionEnabled:c,isTaskGroupAssigneesEnabled:G,isTaskRecurringParentEnabled:x,isAiCfoAccessEnabled:j,onAskAiCfoClick:K})]})]})}const L=(e,t)=>`/${e}/tasks/${encodeURIComponent(t)}`,C=(e,t)=>`/${e}/tasks/new/${t}`,ba=(e,t)=>{if(e==="assignee"){const o=t.split(",");return{...m.taskDetailLocalData,assignee:o}}if(e==="priority"){const o=pa(t);return{...m.taskDetailLocalData,priority:o}}if(e==="status"){const o=ma(t);return{...m.taskDetailLocalData,status:o}}if(e==="tag"){const o=t.split(",");return{...m.taskDetailLocalData,tagIds:o}}if(e==="dueDate"){const o=Ta(t);return{...m.taskDetailLocalData,dueDate:o}}return{...m.taskDetailLocalData}};export{Ka as default};
9
+ `,Da=Z(function(e,t){const o=R(e,t.isTaskTemplatesEnabled),{taskGroupId:c}=t,i=c!=null&&c!==""?{...o,taskGroupsWithTasksList:o.taskGroupsWithTasksList.map(l=>({...l,tasks:l.tasks.filter(a=>a.taskGroupIds.includes(c))})).filter(l=>l.tasks.length>0)}:o,u=aa(e),n=Q.isZeniUser();return{taskListView:i,tagListView:u,localData:i.localData,isTaskTemplatesEnabled:t.isTaskTemplatesEnabled,isZeniUser:n}},function(e,t){const{navigate:o,currentTenant:c,location:i,isTaskTemplatesEnabled:u}=t,{tenantEmailDomain:n}=c,{groupByKey:l}=t.uiState;return{onTaskManagementRowClick:a=>{const s=L(n,a),k=f(i.state?.pathnameStackToGoBack,i.pathname);o(s,{state:{pathnameStackToGoBack:k}})},onReloadTasks:()=>{e(E(!0,u))},onTabChange:a=>{e(da(a))},onParentTaskClick:a=>{const s=L(n,a);window.open(s,"_blank","noopener")},bulkUpdateTasks:(a,s)=>{e(F(a,null,s))},onNewTaskClick:()=>{if(t.localData.defaultTaskGroupId!=null){const a=C(n,t.localData.defaultTaskGroupId),s=f(i.state?.pathnameStackToGoBack,i.pathname);o(a,{state:{pathnameStackToGoBack:s,message:"comingFromTaskListPage"}})}},onColumnSortConfigChanged:(a,s)=>{e(w({uiState:{sortKey:a,sortOrder:s}}))},onFiltersChange:a=>{e(ua({filters:a}))},onSearchTextChanged:a=>{e(ka({searchText:a}))},onReloadCards:()=>{e(E(!0,u))},onBackClick:()=>{if(i.state?.message==="triggerBackClick"){const a=X(i.state?.pathnameStackToGoBack),s=a.poppedPathname??"../";o(s,{state:{pathnameStackToGoBack:a.newStack}})}else o("../")},updateLocalData:a=>{e(ca({localData:a}))},resetLocalData:()=>{e(A({taskGroupById:t.taskGroupState.taskGroupById}))},handleCreateGroup:a=>{e(ra(t.localData.newTaskGroupName,a))},assignGroupToTasks:a=>{e(F(t.localData.selectedTaskIds,a,la(t.uiState.groupByKey,a)))},onDeleteTaskGroup:a=>{e(ia(a))},onAddNewTaskToTaskGroup:a=>{if(t.localData.defaultTaskGroupId!=null){const s=ba(l,a);e(S({taskDetailLocalData:s}));const k=C(n,t.uiState.groupByKey==="groupName"?a:t.localData.defaultTaskGroupId),G=f(i.state?.pathnameStackToGoBack,i.pathname);o(k,{state:{pathnameStackToGoBack:G,message:"comingFromTaskListPage"}})}},onDragNDrop:(a,s)=>{e(na(t.localData.selectedTaskIds.length>0?t.localData.selectedTaskIds:[a],s))},onTaskGroupRename:(a,s)=>{e(oa(a,s))},onTimeSpentUpdate:(a,s)=>{e(B({task:a,updates:s}))},onShowToast:a=>{e(sa(a))},onGroupByFilterChange:a=>{e(w({uiState:{groupByKey:a}}))},updateTask:(a,s)=>{e(B({task:a,updates:s}))},onCreateTagClick:(a,s)=>{e(ta(a,s))},handleGroupTemplateClick:a=>{e(I(a,[]))},handleGroupTemplateTaskClick:(a,s)=>{e(I(a,[s]))},handleNewTaskInitialization:a=>{if(e(S({taskDetailLocalData:{...ea,name:a}})),t.localData.defaultTaskGroupId!=null){const s=C(n,t.localData.defaultTaskGroupId),k=f(i.state?.pathnameStackToGoBack,i.pathname);o(s,{state:{pathnameStackToGoBack:k,message:"comingFromTaskListPage"}})}},onTaskGroupNameClick:a=>{o(`/${n}/tasks/group/${a}`)},onQuickResponsesClick:()=>{o(`/${n}/tasks/quick-responses`)}}})(J);function Na(){const e=v(),t=z(),o=_(),c=Q.getSignedInUser(),i=b(r=>Y(r)),{taskGroupId:u}=V(),{useFeatureGate:n}=M(),{isFeatureEnabled:l}=n(p.isTaskTemplatesEnabled),{isFeatureEnabled:a}=n(p.isTaskCannedResponsesEnabled),{isFeatureEnabled:s}=n(p.isTaskCategorizationEnabled),{isFeatureEnabled:k}=n(p.isTaskBulkResolutionEnabled),{isFeatureEnabled:G}=n(p.isTaskGroupAssigneesEnabled),{isFeatureEnabled:x}=n(p.isTaskRecurringParentEnabled),[y,P]=g.useState(!1),[$,j]=g.useState(!1),h=b(r=>R(r,l)),D=b(r=>r.taskGroupState),T=h.fetchState,{isAiCfoAccessEnabled:K,onAskAiCfoClick:N}=fa({mobileExploreReferrer:"Task Checklist"});if(O({isDataReady:T==="Completed"}),g.useEffect(()=>{y||(P(!0),t(E(!1,l)))},[y,t]),g.useEffect(()=>{T==="Completed"&&t(A({taskGroupById:D.taskGroupById}))},[T,D.taskGroupById]),c==null)throw Error("Can't access task list page without signing in...");return d.jsxs(d.Fragment,{children:[T==="Completed"?d.jsx(W,{analytics:q,onLoad:r=>(U=>U.trackPageLoaded(H.Event.taskListPage))(r)}):null,d.jsxs(ha,{children:[d.jsx(Ga,{isAppContentDrawerOpen:$,handleDrawerToggle:r=>{j(r)}}),d.jsx(Da,{location:o,navigate:e,currentTenant:i,taskGroupId:u,taskGroupState:D,localData:h.localData,uiState:h.uiState,isTaskTemplatesEnabled:l,taskListFetchState:T,isTaskCategorizationEnabled:s,isTaskCannedResponsesEnabled:a,isTaskBulkResolutionEnabled:k,isTaskGroupAssigneesEnabled:G,isTaskRecurringParentEnabled:x,isAiCfoAccessEnabled:K,onAskAiCfoClick:N})]})]})}const L=(e,t)=>`/${e}/tasks/${encodeURIComponent(t)}`,C=(e,t)=>`/${e}/tasks/new/${t}`,ba=(e,t)=>{if(e==="assignee"){const o=t.split(",");return{...m.taskDetailLocalData,assignee:o}}if(e==="priority"){const o=pa(t);return{...m.taskDetailLocalData,priority:o}}if(e==="status"){const o=ma(t);return{...m.taskDetailLocalData,status:o}}if(e==="tag"){const o=t.split(",");return{...m.taskDetailLocalData,tagIds:o}}if(e==="dueDate"){const o=Ta(t);return{...m.taskDetailLocalData,dueDate:o}}return{...m.taskDetailLocalData}};export{Na as default};
@@ -1,4 +1,4 @@
1
- import{j as n}from"./liveblocks-BSDLCmF2.js";import se from"./NotFoundScreen-GGUH6kfI.js";import{a as c}from"./sentry-67DqaLi1.js";import{h as _,u as O,j as g,g as ne,i as oe,N as ie,n as re,o as ce,p as f}from"./core-B20PugrR.js";import{Gi as Z,Gl as le,Go as de,eP as M,Qw as H,FC as X,Fk as pe,G2 as ue,FX as ke,Qx as W,Qy as z,Fg as me,Fd as fe,qc as ge,q0 as he,kb as Se,Fs as Ie,Qz as Te,Fx as be,Fu as Ge,Fn as Ee,FH as Ce,FG as Fe}from"./zeni-epic-state-B3AwsZqW.js";import{z as C,cN as De,F as xe,w as ye,I as b,r as Y,s as j,N as we,d as q,f as je,cO as ve,i as V,at as Re}from"./index-CtCI_jgi.js";import{n as Be}from"./mui-BBkBdMVO.js";import{u as Pe}from"./useInitialThreadRequest-CHUXHA4e.js";import{M as Ue}from"./MobileAppDrawer-DjZLcHYq.js";import Le from"./TaskListScreen-DXLUHaMY.js";import"./recharts-BzjcN9SN.js";import"./analytics-B35UERag.js";import"./plaid-DHvUog4a.js";import"./dnd-CTNaOehy.js";import"./stripe-DMRn4zHo.js";import"./lottie-DG71PfmK.js";import"./lexical-BDpP_OMn.js";import"./pdf-Cp8DoYAG.js";import"./utils-C7uJ9upL.js";import"./useAskAiCfoHostNavButtonProps-CMgniebB.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]="9aef2f1c-114e-4f78-895b-505d01292f04",e._sentryDebugIdIdentifier="sentry-dbid-9aef2f1c-114e-4f78-895b-505d01292f04")}catch{}})();function Ne(){const e=_(),t=O(),s=C.getSignedInUser(),{cannedResponses:u,fetchState:r,saveFetchState:d}=g(o=>o.cannedResponsesState),l=c.useCallback(()=>{t(Z())},[t]),k=c.useCallback((o,h,S)=>{t(le({name:o,content:h,cannedResponseId:S}))},[t]),a=c.useCallback(o=>{t(de({cannedResponseId:o}))},[t]);if(s==null)throw Error("Can't access quick responses page without signing in...");return n.jsx(De,{cannedResponses:u,isLoading:r==="In-Progress"||r==="Not-Started",isSaving:d==="In-Progress",onBackClick:()=>e(-1),onDelete:a,onFetch:l,onSave:k})}let A,Q=[];const $e=re(function(e,t){const{location:s,taskGroupId:u}=t,r=W(e,t.taskId),d=M(e),l=r.taskGroupId??u,k=l!=null?z(e.taskGroupState,l):void 0,a=C.getSignedInUser(),o=d.tenantId,h={userId:a?.userId??"",sessionId:a?.zeniSessionId??"",tenantId:o??""},S=H(e),{tenantEmailDomain:F}=d,G=r.recurringSourceTaskId,D=G!=null?`${V.appUrl}/${F}/tasks/${encodeURIComponent(G)}`:void 0;var I;return{taskDetailSelectorView:r,authParams:h,isZeniUser:C.isZeniUser(),userGroupList:((I=e.userGroupsState.userGroupByUserGroupId)!==A&&(A=I,Q=Object.values(I)),Q),isNewClicked:s.state?.message==="comingFromTaskListPage",filesEndPoint:Re.fileMicroServiceBaseUrl,companyName:t.currentTenant.companyName,companyId:t.currentTenant.companyId,currentUrl:`${V.appUrl}${t.location.pathname}`,cannedResponses:e.cannedResponsesState.cannedResponses,isCannedResponsesLoading:e.cannedResponsesState.fetchState==="In-Progress",recurringSourceTaskUrl:D,tagListView:S,taskGroupName:l!=null&&k!=null&&k.isDefault===!1?k.name:void 0,taskGroupList:e.taskGroupViewState.taskGroupsIds.map(p=>z(e.taskGroupState,p)).filter(p=>p!=null&&!p.isDeleted).map(p=>({id:p.id,name:p.name,isDefault:p.isDefault}))}},function(e,t){const{taskId:s,navigate:u,currentTenant:r,location:d,taskGroupId:l}=t,{tenantEmailDomain:k}=r;return{onSaveChangesToLocalStore:a=>{e(Fe({taskDetailLocalData:a,taskId:s}))},onSaveDetailClick:a=>{e(Ce(s,a??l))},onArchiveTaskClick:()=>{t.taskId!=null&&e(Ee(t.taskId))},onSnoozeTask:(a,o)=>{e(Ge(a,o))},onUnsnoozeTask:a=>{e(be(a))},onDismissClick:()=>{if(d.state?.message==="triggerBackClick"){const a=Y(d.state?.pathnameStackToGoBack),o=a.poppedPathname??"../../dashboard";u(o,{state:{pathnameStackToGoBack:a.newStack}})}else{const a=v(k),o=j(d.state?.pathnameStackToGoBack,d.pathname);u(a,{state:{pathnameStackToGoBack:o}})}e(Te({taskId:s}))},onDeleteTaskClick:()=>{e(Ie(s))},updateFilesEntity:a=>{e(Se({files:a}))},onDeleteFile:a=>{e(he(a))},onEditFileName:(a,o)=>{e(ge(a,o.split(".")[0]))},onReloadTaskDetailPage:()=>{e(X(!1,s))},onCreateTagClick:a=>{e(fe(a,s))},onDeleteTagClick:a=>{e(me(a,s))},onFetchCannedResponses:()=>{e(Z())},onManageTemplatesClick:()=>{u(`/${r.tenantEmailDomain}/tasks/quick-responses`)}}})(ve);function w(){const e=_(),t=O(),s=ne(),u=xe(),{taskId:r,taskGroupId:d}=oe(),l=g(i=>M(i)),k=Pe(l?.companyId),{useFeatureGate:a}=ye(),{isFeatureEnabled:o}=a(b.isTaskSnoozeEnabled),{isFeatureEnabled:h}=a(b.isTaskVisibilityEnabled),{isFeatureEnabled:S}=a(b.isTaskCannedResponsesEnabled),{isFeatureEnabled:F}=a(b.isTaskRecurringParentEnabled),{isFeatureEnabled:G}=a(b.isTaskGroupAssigneesEnabled),[D,I]=c.useState(!1),[p,J]=c.useState(!1),[R,K]=c.useState(!1),[B,ee]=c.useState(!1),[P,x]=c.useState(!1),T=c.useRef(!1),E=g(i=>i.taskListState.updateTasksFetchState.fetchState),U=g(i=>H(i)),L=g(i=>i.taskGroupViewState.fetchState);c.useEffect(()=>{p||(J(!0),t(X(!1,r)))},[p,t]),c.useEffect(()=>{R||U.fetchState==="Completed"||(K(!0),t(pe()))},[R,t,U.fetchState]),c.useEffect(()=>{B||L==="Completed"||(ee(!0),t(ue()))},[B,t,L]);const ae=c.useCallback(()=>{r!=null&&(T.current=!1,t(ke([r],null,{isArchived:!1})),x(!0))},[t,r]);c.useEffect(()=>{if(P)if(E!=="In-Progress"){if(T.current){if(E==="Error")return x(!1),void(T.current=!1);if(E==="Completed"){x(!1),T.current=!1;const{tenantEmailDomain:i}=l;if(s.state?.message==="triggerBackClick"){const m=Y(s.state?.pathnameStackToGoBack);e(m.poppedPathname??"../../dashboard",{state:{pathnameStackToGoBack:m.newStack}})}else{const m=v(i);e(m,{state:{pathnameStackToGoBack:j(s.state?.pathnameStackToGoBack,s.pathname)}})}}}}else T.current=!0},[P,E,l,s,e]);const N=g(i=>W(i,r)),y=N.fetchState,$=C.getSignedInUser();if($==null)throw Error("Can't access task detail page without signing in...");if(y==="Error"&&N.error?.code===400){const{tenantEmailDomain:i}=l,m=v(i),te=j(s.state?.pathnameStackToGoBack,s.pathname);return n.jsx(ie,{to:m,state:{pathnameStackToGoBack:te}})}return n.jsxs(n.Fragment,{children:[y==="Completed"?n.jsx(we,{analytics:q,onLoad:i=>(m=>m.trackPageLoaded(je.Event.taskDetailPage))(i)}):null,n.jsxs(ze,{children:[n.jsx(Ue,{isAppContentDrawerOpen:D,handleDrawerToggle:i=>{I(i)}}),n.jsx($e,{analytics:q,currentTenant:l,handleZeniLogoClick:()=>{u.toggle()},initialOpenThreadRequest:k,location:s,loggedInUser:$,navigate:e,taskGroupId:d,taskId:r,taskDetailFetchState:y,onUnarchiveTaskClick:ae,isTaskSnoozeEnabled:o,isTaskVisibilityEnabled:h,isTaskCannedResponsesEnabled:S,isTaskRecurringParentEnabled:F,isTaskGroupAssigneesEnabled:G})]})]})}const ze=Be.div`
1
+ import{j as n}from"./liveblocks-Do-nuGO9.js";import se from"./NotFoundScreen-BbD7D-7R.js";import{a as c}from"./sentry-CpVyi-77.js";import{h as _,u as O,j as f,g as ne,i as oe,N as ie,n as re,o as ce,p as g}from"./core-CAUatE6D.js";import{Gi as Z,Gl as le,Go as de,eP as M,Qw as H,FC as X,Fk as pe,G2 as ue,FX as ke,Qx as W,Qy as z,Fg as me,Fd as ge,qc as fe,q0 as he,kb as Se,Fs as Ie,Qz as be,Fx as Te,Fu as Ge,Fn as Ee,FH as Ce,FG as Fe}from"./zeni-epic-state-Cb-J9Nxh.js";import{z as C,cN as De,F as xe,w as ye,I as T,p as Y,m as j,V as we,c as q,e as je,cO as ve,i as V,at as Re}from"./index-ssCDruz8.js";import{n as Be}from"./mui-Ee2kkUYC.js";import{u as Pe}from"./useInitialThreadRequest-DnRRNYgw.js";import{M as Ue}from"./MobileAppDrawer-6SipHCGH.js";import Le from"./TaskListScreen-oD_ucU4f.js";import"./recharts-DfwJcvGU.js";import"./analytics-CztvM7Zo.js";import"./plaid-BfqKUq3C.js";import"./dnd-DoUvAW-O.js";import"./stripe-DMRn4zHo.js";import"./lottie-DhqFkmtq.js";import"./lexical-B4m6CLZ0.js";import"./pdf-DGClrODY.js";import"./utils-Bgxe0MRZ.js";import"./useAskAiCfoHostNavButtonProps-BiHuzfAQ.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]="b20e92db-f5d4-4c54-a861-043b9d56d86c",e._sentryDebugIdIdentifier="sentry-dbid-b20e92db-f5d4-4c54-a861-043b9d56d86c")}catch{}})();function Ne(){const e=_(),t=O(),s=C.getSignedInUser(),{cannedResponses:u,fetchState:r,saveFetchState:d}=f(o=>o.cannedResponsesState),l=c.useCallback(()=>{t(Z())},[t]),k=c.useCallback((o,h,S)=>{t(le({name:o,content:h,cannedResponseId:S}))},[t]),a=c.useCallback(o=>{t(de({cannedResponseId:o}))},[t]);if(s==null)throw Error("Can't access quick responses page without signing in...");return n.jsx(De,{cannedResponses:u,isLoading:r==="In-Progress"||r==="Not-Started",isSaving:d==="In-Progress",onBackClick:()=>e(-1),onDelete:a,onFetch:l,onSave:k})}let A,Q=[];const $e=re(function(e,t){const{location:s,taskGroupId:u}=t,r=W(e,t.taskId),d=M(e),l=r.taskGroupId??u,k=l!=null?z(e.taskGroupState,l):void 0,a=C.getSignedInUser(),o=d.tenantId,h={userId:a?.userId??"",sessionId:a?.zeniSessionId??"",tenantId:o??""},S=H(e),{tenantEmailDomain:F}=d,G=r.recurringSourceTaskId,D=G!=null?`${V.appUrl}/${F}/tasks/${encodeURIComponent(G)}`:void 0;var I;return{taskDetailSelectorView:r,authParams:h,isZeniUser:C.isZeniUser(),userGroupList:((I=e.userGroupsState.userGroupByUserGroupId)!==A&&(A=I,Q=Object.values(I)),Q),isNewClicked:s.state?.message==="comingFromTaskListPage",filesEndPoint:Re.fileMicroServiceBaseUrl,companyName:t.currentTenant.companyName,companyId:t.currentTenant.companyId,currentUrl:`${V.appUrl}${t.location.pathname}`,cannedResponses:e.cannedResponsesState.cannedResponses,isCannedResponsesLoading:e.cannedResponsesState.fetchState==="In-Progress",recurringSourceTaskUrl:D,tagListView:S,taskGroupName:l!=null&&k!=null&&k.isDefault===!1?k.name:void 0,taskGroupList:e.taskGroupViewState.taskGroupsIds.map(p=>z(e.taskGroupState,p)).filter(p=>p!=null&&!p.isDeleted).map(p=>({id:p.id,name:p.name,isDefault:p.isDefault}))}},function(e,t){const{taskId:s,navigate:u,currentTenant:r,location:d,taskGroupId:l}=t,{tenantEmailDomain:k}=r;return{onSaveChangesToLocalStore:a=>{e(Fe({taskDetailLocalData:a,taskId:s}))},onSaveDetailClick:a=>{e(Ce(s,a??l))},onArchiveTaskClick:()=>{t.taskId!=null&&e(Ee(t.taskId))},onSnoozeTask:(a,o)=>{e(Ge(a,o))},onUnsnoozeTask:a=>{e(Te(a))},onDismissClick:()=>{if(d.state?.message==="triggerBackClick"){const a=Y(d.state?.pathnameStackToGoBack),o=a.poppedPathname??"../../dashboard";u(o,{state:{pathnameStackToGoBack:a.newStack}})}else{const a=v(k),o=j(d.state?.pathnameStackToGoBack,d.pathname);u(a,{state:{pathnameStackToGoBack:o}})}e(be({taskId:s}))},onDeleteTaskClick:()=>{e(Ie(s))},updateFilesEntity:a=>{e(Se({files:a}))},onDeleteFile:a=>{e(he(a))},onEditFileName:(a,o)=>{e(fe(a,o.split(".")[0]))},onReloadTaskDetailPage:()=>{e(X(!1,s))},onCreateTagClick:a=>{e(ge(a,s))},onDeleteTagClick:a=>{e(me(a,s))},onFetchCannedResponses:()=>{e(Z())},onManageTemplatesClick:()=>{u(`/${r.tenantEmailDomain}/tasks/quick-responses`)}}})(ve);function w(){const e=_(),t=O(),s=ne(),u=xe(),{taskId:r,taskGroupId:d}=oe(),l=f(i=>M(i)),k=Pe(l?.companyId),{useFeatureGate:a}=ye(),{isFeatureEnabled:o}=a(T.isTaskSnoozeEnabled),{isFeatureEnabled:h}=a(T.isTaskVisibilityEnabled),{isFeatureEnabled:S}=a(T.isTaskCannedResponsesEnabled),{isFeatureEnabled:F}=a(T.isTaskRecurringParentEnabled),{isFeatureEnabled:G}=a(T.isTaskGroupAssigneesEnabled),[D,I]=c.useState(!1),[p,J]=c.useState(!1),[R,K]=c.useState(!1),[B,ee]=c.useState(!1),[P,x]=c.useState(!1),b=c.useRef(!1),E=f(i=>i.taskListState.updateTasksFetchState.fetchState),U=f(i=>H(i)),L=f(i=>i.taskGroupViewState.fetchState);c.useEffect(()=>{p||(J(!0),t(X(!1,r)))},[p,t]),c.useEffect(()=>{R||U.fetchState==="Completed"||(K(!0),t(pe()))},[R,t,U.fetchState]),c.useEffect(()=>{B||L==="Completed"||(ee(!0),t(ue()))},[B,t,L]);const ae=c.useCallback(()=>{r!=null&&(b.current=!1,t(ke([r],null,{isArchived:!1})),x(!0))},[t,r]);c.useEffect(()=>{if(P)if(E!=="In-Progress"){if(b.current){if(E==="Error")return x(!1),void(b.current=!1);if(E==="Completed"){x(!1),b.current=!1;const{tenantEmailDomain:i}=l;if(s.state?.message==="triggerBackClick"){const m=Y(s.state?.pathnameStackToGoBack);e(m.poppedPathname??"../../dashboard",{state:{pathnameStackToGoBack:m.newStack}})}else{const m=v(i);e(m,{state:{pathnameStackToGoBack:j(s.state?.pathnameStackToGoBack,s.pathname)}})}}}}else b.current=!0},[P,E,l,s,e]);const N=f(i=>W(i,r)),y=N.fetchState,$=C.getSignedInUser();if($==null)throw Error("Can't access task detail page without signing in...");if(y==="Error"&&N.error?.code===400){const{tenantEmailDomain:i}=l,m=v(i),te=j(s.state?.pathnameStackToGoBack,s.pathname);return n.jsx(ie,{to:m,state:{pathnameStackToGoBack:te}})}return n.jsxs(n.Fragment,{children:[y==="Completed"?n.jsx(we,{analytics:q,onLoad:i=>(m=>m.trackPageLoaded(je.Event.taskDetailPage))(i)}):null,n.jsxs(ze,{children:[n.jsx(Ue,{isAppContentDrawerOpen:D,handleDrawerToggle:i=>{I(i)}}),n.jsx($e,{analytics:q,currentTenant:l,handleZeniLogoClick:()=>{u.toggle()},initialOpenThreadRequest:k,location:s,loggedInUser:$,navigate:e,taskGroupId:d,taskId:r,taskDetailFetchState:y,onUnarchiveTaskClick:ae,isTaskSnoozeEnabled:o,isTaskVisibilityEnabled:h,isTaskCannedResponsesEnabled:S,isTaskRecurringParentEnabled:F,isTaskGroupAssigneesEnabled:G})]})]})}const ze=Be.div`
2
2
  display: flex;
3
3
  min-height: 100%;
4
4
  width: 100%;
@@ -6,4 +6,4 @@ import{j as n}from"./liveblocks-BSDLCmF2.js";import se from"./NotFoundScreen-GGU
6
6
  flex-direction: column;
7
7
  align-items: center;
8
8
  background-color: ${e=>e.theme.colors.grey4};
9
- `,v=e=>`/${e}/tasks`;function ia(){return n.jsxs(ce,{children:[n.jsx(f,{path:"/new",element:n.jsx(w,{})}),n.jsx(f,{path:"/new/:taskGroupId",element:n.jsx(w,{})}),n.jsx(f,{path:"/group/:taskGroupId",element:n.jsx(Le,{})}),n.jsx(f,{path:"/quick-responses",element:n.jsx(Ne,{})}),n.jsx(f,{path:"/:taskId",element:n.jsx(w,{})}),n.jsx(f,{path:"*",element:n.jsx(se,{})})]})}export{ia as default};
9
+ `,v=e=>`/${e}/tasks`;function ia(){return n.jsxs(ce,{children:[n.jsx(g,{path:"/new",element:n.jsx(w,{})}),n.jsx(g,{path:"/new/:taskGroupId",element:n.jsx(w,{})}),n.jsx(g,{path:"/group/:taskGroupId",element:n.jsx(Le,{})}),n.jsx(g,{path:"/quick-responses",element:n.jsx(Ne,{})}),n.jsx(g,{path:"/:taskId",element:n.jsx(w,{})}),n.jsx(g,{path:"*",element:n.jsx(se,{})})]})}export{ia as default};
@@ -1 +1 @@
1
- import{j as t}from"./liveblocks-BSDLCmF2.js";import i from"./NotFoundScreen-GGUH6kfI.js";import{T as r}from"./TransactionDetailScreen-Mjv-0Vsi.js";import"./sentry-67DqaLi1.js";import{o as a,p as o}from"./core-B20PugrR.js";import"./zeni-epic-state-B3AwsZqW.js";import"./recharts-BzjcN9SN.js";import"./index-CtCI_jgi.js";import"./mui-BBkBdMVO.js";import"./analytics-B35UERag.js";import"./plaid-DHvUog4a.js";import"./dnd-CTNaOehy.js";import"./stripe-DMRn4zHo.js";import"./lottie-DG71PfmK.js";import"./lexical-BDpP_OMn.js";import"./pdf-Cp8DoYAG.js";import"./utils-C7uJ9upL.js";import"./useAskAiCfoHostNavButtonProps-CMgniebB.js";import"./decodeURIComponentSafe-HZX6LUOb.js";import"./routePaths-Bd-gFJIO.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]="8f33aac6-3389-4f99-92e2-514bb2135525",e._sentryDebugIdIdentifier="sentry-dbid-8f33aac6-3389-4f99-92e2-514bb2135525")}catch{}})();function k(){return t.jsxs(a,{children:[t.jsx(o,{path:"/:transactionTypeEncoded/:transactionId",element:t.jsx(r,{})}),t.jsx(o,{path:"/:transactionTypeEncoded/:transactionId/page-not-found",element:t.jsx(i,{})}),t.jsx(o,{path:"/:transactionTypeEncoded/:transactionId/vendor/create",element:t.jsx(r,{})}),t.jsx(o,{path:"/*",element:t.jsx(r,{})})]})}export{k as default};
1
+ import{j as t}from"./liveblocks-Do-nuGO9.js";import i from"./NotFoundScreen-BbD7D-7R.js";import{T as r}from"./TransactionDetailScreen-B3uLE8LG.js";import"./sentry-CpVyi-77.js";import{o as a,p as o}from"./core-CAUatE6D.js";import"./zeni-epic-state-Cb-J9Nxh.js";import"./recharts-DfwJcvGU.js";import"./index-ssCDruz8.js";import"./mui-Ee2kkUYC.js";import"./analytics-CztvM7Zo.js";import"./plaid-BfqKUq3C.js";import"./dnd-DoUvAW-O.js";import"./stripe-DMRn4zHo.js";import"./lottie-DhqFkmtq.js";import"./lexical-B4m6CLZ0.js";import"./pdf-DGClrODY.js";import"./utils-Bgxe0MRZ.js";import"./useAskAiCfoHostNavButtonProps-BiHuzfAQ.js";import"./decodeURIComponentSafe-M2sJXq9C.js";import"./routePaths-C0HYOQUJ.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]="8f33aac6-3389-4f99-92e2-514bb2135525",e._sentryDebugIdIdentifier="sentry-dbid-8f33aac6-3389-4f99-92e2-514bb2135525")}catch{}})();function k(){return t.jsxs(a,{children:[t.jsx(o,{path:"/:transactionTypeEncoded/:transactionId",element:t.jsx(r,{})}),t.jsx(o,{path:"/:transactionTypeEncoded/:transactionId/page-not-found",element:t.jsx(i,{})}),t.jsx(o,{path:"/:transactionTypeEncoded/:transactionId/vendor/create",element:t.jsx(r,{})}),t.jsx(o,{path:"/*",element:t.jsx(r,{})})]})}export{k as default};