@zeniai/web-app-ui 5.1.55-qa → 5.1.56-qa

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (129) hide show
  1. package/dist/assets/AddressRoutes-DsuoPslx.js +1 -0
  2. package/dist/assets/{AddressScreen-CvPxhYFs.js → AddressScreen-Jgfq0eWZ.js} +2 -2
  3. package/dist/assets/{AiCfoScreen-DTTgGSqT.js → AiCfoScreen-ngmwmSfT.js} +2 -2
  4. package/dist/assets/{BillPayApprovalRoutes-2y_Smb3L.js → BillPayApprovalRoutes-DjjjDtRL.js} +1 -1
  5. package/dist/assets/{BillPayRoutes-D1KmPs-P.js → BillPayRoutes-zXfejo42.js} +9 -9
  6. package/dist/assets/BusinessVerificationPageScreen-BiV9G1-i.js +9 -0
  7. package/dist/assets/CardsAiCfoScreen-Z2PndTe3.js +14 -0
  8. package/dist/assets/{ChargeCardRoutes-YoDH7ylN.js → ChargeCardRoutes-CBFlKgnf.js} +12 -12
  9. package/dist/assets/{CompanyPassportScreen-CfrYFFuL.js → CompanyPassportScreen-CE4f1mRO.js} +1 -1
  10. package/dist/assets/ConnectionAuthScreen-BFW2NVDD.js +11 -0
  11. package/dist/assets/CustomerOnboardingAuthScreen-DZoaiMvV.js +1 -0
  12. package/dist/assets/{CustomerOnboardingRoutes-BAxjCtaH.js → CustomerOnboardingRoutes-Doltk1XW.js} +4 -4
  13. package/dist/assets/{DashboardRoutes-Cnv2Os-7.js → DashboardRoutes-YclW7oS0.js} +3 -3
  14. package/dist/assets/{DefaultTenantHome-D1mjvDxR.js → DefaultTenantHome-cEuyRwZp.js} +1 -1
  15. package/dist/assets/DomesticWireDetailScreen-3X6dnm4U.js +18 -0
  16. package/dist/assets/DrawerScreen-DcUdH_zJ.js +1 -0
  17. package/dist/assets/EntityDetailRoutes-D020FlPl.js +1 -0
  18. package/dist/assets/{ExpenseAutomationRoutes-UMX9R2ZB.js → ExpenseAutomationRoutes-CTZlVWwO.js} +4 -4
  19. package/dist/assets/FeaturePreviewScreen-DgqstYkZ.js +1 -0
  20. package/dist/assets/HubSpotOAuthCallbackScreen-DlnwVV1p.js +1 -0
  21. package/dist/assets/MagicLinkRoutes-C901TSTh.js +72 -0
  22. package/dist/assets/MagicLinkSignInScreen-DFljjGc3.js +12 -0
  23. package/dist/assets/MobileAppDrawer-B4f1me8_.js +1 -0
  24. package/dist/assets/NotFoundScreen-CxRYls3k.js +1 -0
  25. package/dist/assets/NotificationRoutes-Dw__n9YA.js +1 -0
  26. package/dist/assets/OAuthConsentScreen-Ur-mQS8z.js +1 -0
  27. package/dist/assets/PandLWithForecastRoutes-DSq1hcWm.js +1 -0
  28. package/dist/assets/{PeopleRoutes-DwtjCeU9.js → PeopleRoutes-CUtLjfXT.js} +3 -3
  29. package/dist/assets/PerformanceRoutes-D4zDazyB.js +1 -0
  30. package/dist/assets/{Preview-JiizEL_C.js → Preview-f2ns8xny.js} +1 -1
  31. package/dist/assets/{QBOConnectionScreen-BD3gRv9C.js → QBOConnectionScreen-CSgGZuyl.js} +1 -1
  32. package/dist/assets/{ReferralListScreen-DPPvxoTI.js → ReferralListScreen-CbCeYBu8.js} +2 -2
  33. package/dist/assets/ReimbursementApprovalRoutes-CQrzmhSh.js +1 -0
  34. package/dist/assets/{ReimbursementApprovalRuleDetailScreen-CcTmDK2L.js → ReimbursementApprovalRuleDetailScreen-DTZkQzQY.js} +1 -1
  35. package/dist/assets/{ReimbursementRoutes-DHjMtvfB.js → ReimbursementRoutes-CzlU6LYx.js} +7 -7
  36. package/dist/assets/{ReportsRoutes-B4rkl99K.js → ReportsRoutes-D_wjWb18.js} +1 -1
  37. package/dist/assets/RewardsRoutes-Bfg59urI.js +1 -0
  38. package/dist/assets/ScreenRoutes-D5k4uqAt.js +2 -0
  39. package/dist/assets/{SettingsRoutes-Bvbg8LVY.js → SettingsRoutes-3hV9qN1I.js} +7 -7
  40. package/dist/assets/{SetupPagesScreen-N7NZbMog.js → SetupPagesScreen-CPey4cOW.js} +5 -5
  41. package/dist/assets/SignInScreen-gQzAHzdj.js +1 -0
  42. package/dist/assets/SignOutScreen-GvUCBNk6.js +9 -0
  43. package/dist/assets/{TaskListScreen-DNjQxRsg.js → TaskListScreen-Cuce7GNl.js} +2 -2
  44. package/dist/assets/TaskRoutes-DmGo1lNA.js +9 -0
  45. package/dist/assets/{TransactionDetailRoutes-9wsPGvQA.js → TransactionDetailRoutes-CgKCf_lf.js} +1 -1
  46. package/dist/assets/{TransactionDetailScreen-DdyjxpNe.js → TransactionDetailScreen-CoGsdLTa.js} +2 -2
  47. package/dist/assets/{TransactionListRoutes-Y3HUjCX4.js → TransactionListRoutes-C4QYqCpP.js} +1 -1
  48. package/dist/assets/{TreasuryRoutes-Po66nW-G.js → TreasuryRoutes-jiXgJCAb.js} +5 -5
  49. package/dist/assets/{VendorsRoutes-Bhe46MLu.js → VendorsRoutes-BZFmR2hI.js} +14 -14
  50. package/dist/assets/WiseConfirmationScreen-BLK_tJR5.js +12 -0
  51. package/dist/assets/{ZeniAccountRoutes-BVrcLxAX.js → ZeniAccountRoutes-DVnj5-p6.js} +13 -13
  52. package/dist/assets/ZeniAccountStatementScreen-3bZVHWI7.js +9 -0
  53. package/dist/assets/{accountMappingHelper-BfrLGhoG.js → accountMappingHelper-DS9ya8eF.js} +1 -1
  54. package/dist/assets/{analytics-CQmVOD4d.js → analytics-BLbM2ksu.js} +1 -1
  55. package/dist/assets/{analyticsHelper-Bvqx3iRr.js → analyticsHelper-BU5wlVa9.js} +1 -1
  56. package/dist/assets/{core-CbpoBsNm.js → core-OMb8nkC1.js} +1 -1
  57. package/dist/assets/{decodeURIComponentSafe-9Mzf3G8U.js → decodeURIComponentSafe-CrZYJ6cg.js} +1 -1
  58. package/dist/assets/{dnd-CX5suNP6.js → dnd-DVcQZAG5.js} +1 -1
  59. package/dist/assets/{empty-DhAifQ6-.js → empty-BACf_dXg.js} +1 -1
  60. package/dist/assets/{empty-BijKctOw.js → empty-CyDTyMxd.js} +1 -1
  61. package/dist/assets/{emptyVideoElement-D-mIIbkx.js → emptyVideoElement-wUn7k4Wi.js} +1 -1
  62. package/dist/assets/{epic-D_RLnD_Y.js → epic-C0I2MvV5.js} +1 -1
  63. package/dist/assets/getLocaleForTenant-Bn16hOPH.js +1 -0
  64. package/dist/assets/{index-B781xFYL.js → index-5gq8gNHx.js} +2 -2
  65. package/dist/assets/{index-Mdt1gUpR.js → index-BNIZfLgU.js} +1 -1
  66. package/dist/assets/{index-Bg6fgf4p.js → index-BQIzm-tN.js} +1 -1
  67. package/dist/assets/{index-D-GsKzyX.js → index-CPre97x9.js} +1 -1
  68. package/dist/assets/{index-CR_Xz42r.js → index-CVJX5WNC.js} +1 -1
  69. package/dist/assets/{index-CTRa-Eva.js → index-DmsNrKhC.js} +1 -1
  70. package/dist/assets/{index-aZImxzjX.js → index-NcZU0lXl.js} +7454 -7454
  71. package/dist/assets/{index-cXBO33fb.js → index-SfOqAjbR.js} +1 -1
  72. package/dist/assets/{lexical-BS7d_1CV.js → lexical-CNfNgAkp.js} +1 -1
  73. package/dist/assets/{liveblocks-BLlSTcoD.js → liveblocks-BUQfB0Zp.js} +1 -1
  74. package/dist/assets/{lottie-BY8e0Ufw.js → lottie-DDI83OWz.js} +1 -1
  75. package/dist/assets/{mui-DcNGd9L2.js → mui-JZY-3hhJ.js} +1 -1
  76. package/dist/assets/{pathToGoBack-C2QnAeVh.js → pathToGoBack-iJW8VSI1.js} +1 -1
  77. package/dist/assets/{pdf-BslZhgI8.js → pdf-6FZlivdz.js} +4 -4
  78. package/dist/assets/{pdf-lib-BxiXr152.js → pdf-lib-CtBKoWQc.js} +1 -1
  79. package/dist/assets/{plaid-B62punae.js → plaid-B_OuebQv.js} +1 -1
  80. package/dist/assets/{pusher-yI34WBaU.js → pusher-BqrLLY7v.js} +1 -1
  81. package/dist/assets/{react-bALoVfnT.js → react-BVW_zt6p.js} +1 -1
  82. package/dist/assets/{react-BhNVTcBK.js → react-Crq75Q-S.js} +1 -1
  83. package/dist/assets/{react-D4d29E8H.js → react-D-VI0x0-.js} +1 -1
  84. package/dist/assets/{react-Bxt57-xI.js → react-PG_EpTGq.js} +1 -1
  85. package/dist/assets/{react-CcJOgdcP.js → react-axoushfz.js} +1 -1
  86. package/dist/assets/{react-DP_wuGKo.js → react-uplfhPO2.js} +1 -1
  87. package/dist/assets/{recharts-C0aThBg3.js → recharts-DAM4r1-u.js} +1 -1
  88. package/dist/assets/{routePaths-DyIc-n3M.js → routePaths-DZldr9mG.js} +1 -1
  89. package/dist/assets/{sentry-D_xp3E3Q.js → sentry-BLIwU6uZ.js} +1 -1
  90. package/dist/assets/{url-Cn_1-HsX.js → url-BMb7_G4N.js} +1 -1
  91. package/dist/assets/{url-DZdoYQOC.js → url-CbGZb3kM.js} +1 -1
  92. package/dist/assets/{useAiCfoDashboardSuggestedQuestionsChips-ClwyrxTK.js → useAiCfoDashboardSuggestedQuestionsChips-DEWGXdch.js} +1 -1
  93. package/dist/assets/{useAskAiCfoHostNavButtonProps-BZImc5qT.js → useAskAiCfoHostNavButtonProps-DS5Fxq3U.js} +1 -1
  94. package/dist/assets/useCashManagementBanner-CtcuIjhq.js +1 -0
  95. package/dist/assets/{useDeviceId-BX67JldO.js → useDeviceId-l9JfwAte.js} +1 -1
  96. package/dist/assets/{useInitialThreadRequest-DVxzaQcg.js → useInitialThreadRequest-Bh1NrHII.js} +1 -1
  97. package/dist/assets/{utils-BQO84dIV.js → utils-Bia5qc4p.js} +1 -1
  98. package/dist/assets/{withTransactionSidePanel-MinVWpma.js → withTransactionSidePanel-DxHfrYsZ.js} +4 -4
  99. package/dist/assets/{zeni-epic-state-CkeDRiud.js → zeni-epic-state-BZ6N8nVI.js} +6 -6
  100. package/dist/index.html +1 -1
  101. package/package.json +3 -3
  102. package/dist/assets/AddressRoutes-ENVkkepY.js +0 -1
  103. package/dist/assets/BusinessVerificationPageScreen-D2N5zUvV.js +0 -9
  104. package/dist/assets/CardsAiCfoScreen-bhVF9e_F.js +0 -14
  105. package/dist/assets/ConnectionAuthScreen-B6tGghLx.js +0 -11
  106. package/dist/assets/CustomerOnboardingAuthScreen-CpXzEPeL.js +0 -1
  107. package/dist/assets/DomesticWireDetailScreen-DEZpmV1y.js +0 -18
  108. package/dist/assets/DrawerScreen-CfPgZFbu.js +0 -1
  109. package/dist/assets/EntityDetailRoutes-ByNAOdBV.js +0 -1
  110. package/dist/assets/FeaturePreviewScreen-Bbo-4gXG.js +0 -1
  111. package/dist/assets/HubSpotOAuthCallbackScreen-Cngdo8vI.js +0 -1
  112. package/dist/assets/MagicLinkRoutes-CP3FxH4t.js +0 -72
  113. package/dist/assets/MagicLinkSignInScreen-DfMGZywc.js +0 -12
  114. package/dist/assets/MobileAppDrawer-CWBhYKqW.js +0 -1
  115. package/dist/assets/NotFoundScreen-Bnx2UPHv.js +0 -1
  116. package/dist/assets/NotificationRoutes-Qy8HYHkb.js +0 -1
  117. package/dist/assets/OAuthConsentScreen-DffRqRWT.js +0 -1
  118. package/dist/assets/PandLWithForecastRoutes-DzMNbzsJ.js +0 -1
  119. package/dist/assets/PerformanceRoutes-DJjg_nmN.js +0 -1
  120. package/dist/assets/ReimbursementApprovalRoutes-BwiPly2p.js +0 -1
  121. package/dist/assets/RewardsRoutes-CmWH02Nb.js +0 -1
  122. package/dist/assets/ScreenRoutes-BVhH5D33.js +0 -2
  123. package/dist/assets/SignInScreen-DqCXO7t5.js +0 -1
  124. package/dist/assets/SignOutScreen-PgaK8hUe.js +0 -9
  125. package/dist/assets/TaskRoutes-DddYQsp2.js +0 -9
  126. package/dist/assets/WiseConfirmationScreen-gcw35kRr.js +0 -12
  127. package/dist/assets/ZeniAccountStatementScreen-NjdxQEux.js +0 -9
  128. package/dist/assets/getLocaleForTenant-9euvow3p.js +0 -1
  129. package/dist/assets/useCashManagementBanner-BWjfwjGa.js +0 -1
@@ -1,4 +1,4 @@
1
- import{j as o}from"./liveblocks-BLlSTcoD.js";import{a as p}from"./sentry-D_xp3E3Q.js";import{h as V,g as Q,u as T,j as h,s as ce,n as $,i as G,o as X,p as A}from"./core-CbpoBsNm.js";import{bn as we,eW as D,gn as Pe,mV as le,NM as je,hz as me,ND as De,qM as Me,kr as he,mR as Ue,hB as Te,NF as _e,NE as Re,Q2 as Fe,z3 as Be,Eo as Oe,PD as Ve,PM as ze,c7 as ee,cM as Le,cN as Ne,LL as Qe,Q3 as $e,LM as Ge,xv as Ke,Q4 as Ze,GP as He,E4 as qe,DX as fe,DU as Je,xz as be,D_ as Se,E1 as ye,E7 as ne,tZ as te,xy as Xe,k3 as W,k6 as Ce,Q5 as We,l7 as Ye,xO as en,My as nn,Mz as tn,k1 as an,Q6 as on,k4 as sn,re as cn,Q7 as ln,Q8 as rn,ri as dn,hk as un,LU as J,hd as pn,hg as gn,LV as mn,xL as hn,Q9 as fn,Qa as bn,El as Sn,fz as Ie,fB as xe,Qb as yn,gb as Cn,M2 as In,xK as re,gg as de,gf as xn,xJ as En,ge as An,gd as vn,Qc as kn,fE as Ee,Qd as wn,Qe as Pn,xR as jn,xI as ue,Qf as Dn,fV as Mn,xF as Un,b_ as Tn,c6 as _n,c5 as Rn,b$ as Fn,c3 as Bn,c2 as On,c1 as Vn,c4 as zn,c0 as Ln}from"./zeni-epic-state-CkeDRiud.js";import{F as ae,x as R,z as P,af as Ae,bO as Nn,d as q,f as Qn,bz as $n,j as K,B as oe,bP as Gn,bQ as Kn,aq as Zn,h as ve,bR as Hn,bS as qn,bT as Jn,a9 as Xn,X as Wn,bU as Yn,s as et,bV as nt}from"./index-aZImxzjX.js";import{n as F}from"./mui-DcNGd9L2.js";import{M as _}from"./MobileAppDrawer-CWBhYKqW.js";import{a as Z,g as H,m as tt}from"./accountMappingHelper-BfrLGhoG.js";import{t as at,A as ot}from"./AddressScreen-CvPxhYFs.js";import N from"./NotFoundScreen-Bnx2UPHv.js";import{g as st}from"./analyticsHelper-Bvqx3iRr.js";import{B as it}from"./BusinessVerificationPageScreen-D2N5zUvV.js";import{C as ct}from"./CompanyPassportScreen-CfrYFFuL.js";import{q as pe}from"./QBOConnectionScreen-BD3gRv9C.js";import{B as lt}from"./BillPayApprovalRoutes-2y_Smb3L.js";import{R as rt}from"./ReimbursementApprovalRoutes-BwiPly2p.js";import"./recharts-C0aThBg3.js";import"./analytics-CQmVOD4d.js";import"./plaid-B62punae.js";import"./dnd-CX5suNP6.js";import"./stripe-DMRn4zHo.js";import"./lottie-BY8e0Ufw.js";import"./lexical-BS7d_1CV.js";import"./pdf-BslZhgI8.js";import"./utils-BQO84dIV.js";import"./routePaths-DyIc-n3M.js";import"./empty-DhAifQ6-.js";import"./pdf-lib-BxiXr152.js";import"./index-D-GsKzyX.js";import"./url-Cn_1-HsX.js";import"./index-Bg6fgf4p.js";import"./decodeURIComponentSafe-9Mzf3G8U.js";import"./ReimbursementApprovalRuleDetailScreen-CcTmDK2L.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]="13695760-94a0-45fd-810c-c23a5966ca66",e._sentryDebugIdIdentifier="sentry-dbid-13695760-94a0-45fd-810c-c23a5966ca66")}catch{}})();const dt=F.div`
1
+ import{j as o}from"./liveblocks-BUQfB0Zp.js";import{a as p}from"./sentry-BLIwU6uZ.js";import{h as L,g as Q,u as T,j as h,s as ce,n as $,i as K,o as W,p as A}from"./core-OMb8nkC1.js";import{bn as we,eV as D,gm as je,mU as le,NL as Pe,hy as me,NC as De,qL as Ue,kq as he,mQ as Me,hA as Te,NE as _e,ND as Re,Q1 as Fe,z2 as Be,En as Oe,PC as Le,PL as Ve,c6 as ee,cL as ze,cM as Ne,LK as Qe,Q2 as $e,LL as Ke,xu as Ge,Q3 as Ze,GO as He,E3 as qe,DW as fe,DT as Je,xy as be,DZ as Se,E0 as ye,E6 as ne,tY as te,xx as We,k2 as Y,k5 as Ce,Q4 as Ye,l6 as Xe,xN as en,Mx as nn,My as tn,k0 as an,Q5 as on,k3 as sn,rd as cn,Q6 as ln,Q7 as rn,rh as dn,hj as un,LT as J,hc as pn,hf as gn,LU as mn,xK as hn,Q8 as fn,Q9 as bn,Ek as Sn,fy as Ie,fA as xe,Qa as yn,ga as Cn,M1 as In,xJ as re,gf as de,ge as xn,xI as En,gd as An,gc as vn,Qb as kn,fD as Ee,Qc as wn,Qd as jn,xQ as Pn,xH as ue,Qe as Dn,fU as Un,xE as Mn,bZ as Tn,c5 as _n,c4 as Rn,b_ as Fn,c2 as Bn,c1 as On,c0 as Ln,c3 as Vn,b$ as zn}from"./zeni-epic-state-BZ6N8nVI.js";import{a as ae,F as R,z as j,af as Ae,bO as Nn,d as q,f as Qn,bz as $n,j as G,B as oe,bP as Kn,bQ as Gn,aq as Zn,k as ve,bR as Hn,bS as qn,bT as Jn,a9 as Wn,W as Yn,bU as Xn,s as et,bV as nt}from"./index-NcZU0lXl.js";import{n as F}from"./mui-JZY-3hhJ.js";import{M as _}from"./MobileAppDrawer-B4f1me8_.js";import{a as Z,g as H,m as tt}from"./accountMappingHelper-DS9ya8eF.js";import{t as at,A as ot}from"./AddressScreen-Jgfq0eWZ.js";import N from"./NotFoundScreen-CxRYls3k.js";import{g as st}from"./analyticsHelper-BU5wlVa9.js";import{B as it}from"./BusinessVerificationPageScreen-BiV9G1-i.js";import{C as ct}from"./CompanyPassportScreen-CE4f1mRO.js";import{q as pe}from"./QBOConnectionScreen-CSgGZuyl.js";import{B as lt}from"./BillPayApprovalRoutes-DjjjDtRL.js";import{R as rt}from"./ReimbursementApprovalRoutes-CQrzmhSh.js";import"./recharts-DAM4r1-u.js";import"./analytics-BLbM2ksu.js";import"./plaid-B_OuebQv.js";import"./dnd-DVcQZAG5.js";import"./stripe-DMRn4zHo.js";import"./lottie-DDI83OWz.js";import"./lexical-CNfNgAkp.js";import"./pdf-6FZlivdz.js";import"./utils-Bia5qc4p.js";import"./routePaths-DZldr9mG.js";import"./empty-BACf_dXg.js";import"./pdf-lib-CtBKoWQc.js";import"./index-CPre97x9.js";import"./url-BMb7_G4N.js";import"./index-BQIzm-tN.js";import"./decodeURIComponentSafe-CrZYJ6cg.js";import"./ReimbursementApprovalRuleDetailScreen-DTZkQzQY.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]="1371b605-91d6-4af0-b9cd-47983463115f",e._sentryDebugIdIdentifier="sentry-dbid-1371b605-91d6-4af0-b9cd-47983463115f")}catch{}})();const dt=F.div`
2
2
  display: flex;
3
3
  height: 100%;
4
4
  width: 100%;
@@ -6,7 +6,7 @@ import{j as o}from"./liveblocks-BLlSTcoD.js";import{a as p}from"./sentry-D_xp3E3
6
6
  flex-direction: column;
7
7
  align-items: center;
8
8
  background-color: ${e=>e.theme.colors.grey4};
9
- `,ut=$(function(e,t){return{accountMappingView:t.accountMappingView,isFiling1099FeatureEnabled:t.isFiling1099FeatureEnabled,isAccruedExpensesFeatureEnabled:t.isAccruedExpensesFeatureEnabled,isAccountingClassesEnabled:he(e),isAccountingClassesUpdateInProgress:e.companyViewState.passportView?.accountingClassesUpdateStatus?.fetchState==="In-Progress",isAccountingProjectsEnabled:Me(e),meetingUrl:"https://meetings.hubspot.com/niharn/zeni-onboarding-overview?embed=true",isCapitalizationFeatureEnabled:t.isCapitalizationFeatureEnabled,capitalizableAccounts:t.capitalizableAccounts,accountNamesById:t.accountNamesById,capitalizableAccountOverrides:t.capitalizableAccountOverrides,isCapitalizationThresholdSaving:t.isCapitalizationThresholdSaving,onSaveCapitalizationAccountThreshold:t.onSaveCapitalizationAccountThreshold}},function(e,t){const{navigate:s,location:r,isFiling1099FeatureEnabled:i}=t;return{onAccountMappingChange:n=>{const{uncategorizedAccountSection:a,billsAccountSection:c,reimbursementsAccountSection:u,vendorsAccountSection:d,filing1099Section:m}=n,{incomeAccount:f,expenseAccount:g}=a,{billPayAccount:l}=c,{reimbursementsAccount:C}=u,{prepaidExpensesAccount:I,fixedAssetsAccount:j,accruedExpensesAccount:v}=d,{bankAccount:y,expenseCategory1099:E}=m,k=Z(t.accountMappingView.incomeAccountList,f.selectedOption),B=Z(t.accountMappingView.expenseAccountList,g.selectedOption),z=Z(t.accountMappingView.billPayAccountList,l.selectedOption),L=Z(t.accountMappingView.reimbursementsAccountList,C.selectedOption),O=H(t.accountMappingView.prepaidExpensesAccountList,I.selectedOptions),b=H(t.accountMappingView.fixedAssetsAccountList,j.selectedOptions),M=H(t.accountMappingView.accruedExpensesAccountList,v.selectedOptions),S=H(t.accountMappingView.bankAccounts1099FilingAccountList,y.selectedOptions),x=tt(t.accountMappingView.expenseAccounts1099FilingAccountList,E),U={selectedIncomeAccountId:k?.accountId,selectedExpenseAccountId:B?.accountId,selectedBillPayAccountId:z?.accountId,selectedReimbursementsAccountId:L?.accountId,selectedPrepaidExpensesAccountIds:O.map(w=>w.accountId),selectedFixedAssetsAccountIds:b.map(w=>w.accountId),selectedAccruedExpensesAccountIds:M.map(w=>w.accountId),selectedBankAccounts1099FilingAccountIds:S.map(w=>w.accountId),selectedExpenseAccounts1099FilingAccountIds:x};e(Re({data:U}))},onBackClick:()=>{Ae(r)===!1?(s("../../dashboard"),e(_e())):e(me())},onSaveClick:()=>{e(Te()),i&&q.track(Qn.Event.vendor1099AccountingSettingsSave)},onAccountingClassesToggle:n=>{e(Ue(t.currentTenant.companyId,n))}}})(Nn),pt=()=>{const e=V(),t=Q(),s=T(),{useFeatureGate:r,useDynamicConfig:i}=ae(),{isFeatureEnabled:n}=r(R.isFiling1099FeatureEnabled),{isFeatureEnabled:a}=r(R.isScheduledJEAccruedExpensesFeatureEnabled),{configValue:c,isDynamicConfigLoading:u}=i("transaction_categorization_config"),d=!u&&c?.capitalization_enabled===!0,m=P.getSignedInUser(),f=we(m),g=h(S=>D(S)),{capitalizableAccounts:l,capitalizableAccountOverrides:C,isCapitalizationThresholdSaving:I,currencySymbol:j}=h(S=>{const x=S.tenantState.currentTenantId,U=x!=null?S.tenantState.tenantsById[x]:void 0,w=Pe(S.companyState,g.companyId);return{capitalizableAccounts:U?.capitalizableAccounts??null,capitalizableAccountOverrides:U?.capitalizableAccountOverrides??null,isCapitalizationThresholdSaving:S.companyViewState.passportView?.capitalizationThresholdUpdateStatus?.fetchState==="In-Progress",currencySymbol:w?.company.companyLocaleInfo?.currencySymbol??"$"}},ce),v=p.useCallback((S,x)=>{s(le(g.companyId,S,x))},[s,g.companyId]),y=p.useCallback(S=>{const x={...C??{}},U=Object.entries(S);for(const[se,ie]of U)ie===null?delete x[se]:x[se]=ie;const[w,ke]=U[0]??[];w!=null&&s(le(g.companyId,w,ke,void 0,Object.keys(x).length>0?x:null))},[s,g.companyId,C]),E=h(S=>je(S.accountState),ce),k=p.useMemo(()=>{const S={};for(const x of E)x.accountId!=null&&x.accountName!=null&&(S[x.accountId]=x.accountName);return S},[E]),[B,z]=p.useState(!1),[L,O]=p.useState(!1);p.useEffect(()=>{B===!1&&(s(me()),z(!0))},[B]);const b=h(S=>De(S)),M=S=>{O(S)};return o.jsxs(dt,{children:[o.jsx(_,{isAppContentDrawerOpen:L,handleDrawerToggle:M}),o.jsx(ut,{currentTenant:g,navigate:e,accountMappingView:b,isFiling1099FeatureEnabled:n&&f,isAccruedExpensesFeatureEnabled:a,isCapitalizationFeatureEnabled:d,capitalizableAccounts:l,accountNamesById:k,capitalizableAccountOverrides:C,currencySymbol:j,isCapitalizationThresholdSaving:I,onSaveCapitalizationAccountThreshold:v,onSaveCapitalizationAccountThresholds:y,location:t,isSettings:Ae(t),onClickMenuIcon:()=>M(!0)})]})},gt=F.div`
9
+ `,ut=$(function(e,t){return{accountMappingView:t.accountMappingView,isFiling1099FeatureEnabled:t.isFiling1099FeatureEnabled,isAccruedExpensesFeatureEnabled:t.isAccruedExpensesFeatureEnabled,isAccountingClassesEnabled:he(e),isAccountingClassesUpdateInProgress:e.companyViewState.passportView?.accountingClassesUpdateStatus?.fetchState==="In-Progress",isAccountingProjectsEnabled:Ue(e),meetingUrl:"https://meetings.hubspot.com/niharn/zeni-onboarding-overview?embed=true",isCapitalizationFeatureEnabled:t.isCapitalizationFeatureEnabled,capitalizableAccounts:t.capitalizableAccounts,accountNamesById:t.accountNamesById,capitalizableAccountOverrides:t.capitalizableAccountOverrides,isCapitalizationThresholdSaving:t.isCapitalizationThresholdSaving,onSaveCapitalizationAccountThreshold:t.onSaveCapitalizationAccountThreshold}},function(e,t){const{navigate:s,location:r,isFiling1099FeatureEnabled:i}=t;return{onAccountMappingChange:n=>{const{uncategorizedAccountSection:a,billsAccountSection:c,reimbursementsAccountSection:u,vendorsAccountSection:d,filing1099Section:m}=n,{incomeAccount:f,expenseAccount:g}=a,{billPayAccount:l}=c,{reimbursementsAccount:C}=u,{prepaidExpensesAccount:I,fixedAssetsAccount:P,accruedExpensesAccount:v}=d,{bankAccount:y,expenseCategory1099:E}=m,k=Z(t.accountMappingView.incomeAccountList,f.selectedOption),B=Z(t.accountMappingView.expenseAccountList,g.selectedOption),V=Z(t.accountMappingView.billPayAccountList,l.selectedOption),z=Z(t.accountMappingView.reimbursementsAccountList,C.selectedOption),O=H(t.accountMappingView.prepaidExpensesAccountList,I.selectedOptions),b=H(t.accountMappingView.fixedAssetsAccountList,P.selectedOptions),U=H(t.accountMappingView.accruedExpensesAccountList,v.selectedOptions),S=H(t.accountMappingView.bankAccounts1099FilingAccountList,y.selectedOptions),x=tt(t.accountMappingView.expenseAccounts1099FilingAccountList,E),M={selectedIncomeAccountId:k?.accountId,selectedExpenseAccountId:B?.accountId,selectedBillPayAccountId:V?.accountId,selectedReimbursementsAccountId:z?.accountId,selectedPrepaidExpensesAccountIds:O.map(w=>w.accountId),selectedFixedAssetsAccountIds:b.map(w=>w.accountId),selectedAccruedExpensesAccountIds:U.map(w=>w.accountId),selectedBankAccounts1099FilingAccountIds:S.map(w=>w.accountId),selectedExpenseAccounts1099FilingAccountIds:x};e(Re({data:M}))},onBackClick:()=>{Ae(r)===!1?(s("../../dashboard"),e(_e())):e(me())},onSaveClick:()=>{e(Te()),i&&q.track(Qn.Event.vendor1099AccountingSettingsSave)},onAccountingClassesToggle:n=>{e(Me(t.currentTenant.companyId,n))}}})(Nn),pt=()=>{const e=L(),t=Q(),s=T(),{useFeatureGate:r,useDynamicConfig:i}=ae(),{isFeatureEnabled:n}=r(R.isFiling1099FeatureEnabled),{isFeatureEnabled:a}=r(R.isScheduledJEAccruedExpensesFeatureEnabled),{configValue:c,isDynamicConfigLoading:u}=i("transaction_categorization_config"),d=!u&&c?.capitalization_enabled===!0,m=j.getSignedInUser(),f=we(m),g=h(S=>D(S)),{capitalizableAccounts:l,capitalizableAccountOverrides:C,isCapitalizationThresholdSaving:I,currencySymbol:P}=h(S=>{const x=S.tenantState.currentTenantId,M=x!=null?S.tenantState.tenantsById[x]:void 0,w=je(S.companyState,g.companyId);return{capitalizableAccounts:M?.capitalizableAccounts??null,capitalizableAccountOverrides:M?.capitalizableAccountOverrides??null,isCapitalizationThresholdSaving:S.companyViewState.passportView?.capitalizationThresholdUpdateStatus?.fetchState==="In-Progress",currencySymbol:w?.company.companyLocaleInfo?.currencySymbol??"$"}},ce),v=p.useCallback((S,x)=>{s(le(g.companyId,S,x))},[s,g.companyId]),y=p.useCallback(S=>{const x={...C??{}},M=Object.entries(S);for(const[se,ie]of M)ie===null?delete x[se]:x[se]=ie;const[w,ke]=M[0]??[];w!=null&&s(le(g.companyId,w,ke,void 0,Object.keys(x).length>0?x:null))},[s,g.companyId,C]),E=h(S=>Pe(S.accountState),ce),k=p.useMemo(()=>{const S={};for(const x of E)x.accountId!=null&&x.accountName!=null&&(S[x.accountId]=x.accountName);return S},[E]),[B,V]=p.useState(!1),[z,O]=p.useState(!1);p.useEffect(()=>{B===!1&&(s(me()),V(!0))},[B]);const b=h(S=>De(S)),U=S=>{O(S)};return o.jsxs(dt,{children:[o.jsx(_,{isAppContentDrawerOpen:z,handleDrawerToggle:U}),o.jsx(ut,{currentTenant:g,navigate:e,accountMappingView:b,isFiling1099FeatureEnabled:n&&f,isAccruedExpensesFeatureEnabled:a,isCapitalizationFeatureEnabled:d,capitalizableAccounts:l,accountNamesById:k,capitalizableAccountOverrides:C,currencySymbol:P,isCapitalizationThresholdSaving:I,onSaveCapitalizationAccountThreshold:v,onSaveCapitalizationAccountThresholds:y,location:t,isSettings:Ae(t),onClickMenuIcon:()=>U(!0)})]})},gt=F.div`
10
10
  display: flex;
11
11
  height: 100%;
12
12
  width: 100%;
@@ -14,7 +14,7 @@ import{j as o}from"./liveblocks-BLlSTcoD.js";import{a as p}from"./sentry-D_xp3E3
14
14
  flex-direction: column;
15
15
  align-items: center;
16
16
  background-color: ${e=>e.theme.colors.grey4};
17
- `,mt=$(function(e,t){const s=D(e),r=Ve(e),i=ze(e),n=t.roleMap.bill_pay_admin;return{isDisabled:(ee(s?.userRole??[])||n)&&"readonly",billpayApprovalView:r,remiApproverView:i,analytics:q}},function(e,t){const{navigate:s,currentTenant:r}=t;return{onSetupApprovalRulesBillPaySectionClick:()=>{s("bills/approval-rules")},onSetupApprovalRulesRemiSectionClick:()=>{s("reimbursements/approval-rules")},onBackClick:()=>{r?.companyBillPayInfo?.info?.isBillPayEnabled!=null&&r.companyBillPayInfo.info.isBillPayEnabled===!1?s("../.."):s("../")},onNavigateToDashboard:()=>{s("../dashboard")}}})(Gn),ht=()=>{const e=V(),t=Q(),s=T(),{tenantEmailDomain:r}=G(),[i,n]=p.useState(!1),[a,c]=p.useState(!1),[u,d]=p.useState(!1),m=h(E=>D(E)),f=h(E=>E.billPaySetupApproverViewState.fetchState),g=h(E=>E.remiSetupApproverViewState.fetchState),l=h(E=>Fe(E)),{isApprovalRulesV3Enabled:C,isLoading:I}=$n(m?.tenantId),j=m.companyId??P.getSignedInUserTenant(r)?.companyId;if(P.getSignedInUser()==null)throw Error("Can't access Approval Rules settings page without signing in...");const v=K();p.useEffect(()=>{u||f!=="Not-Started"||I||(d(!0),s(Be(!0,!0,C)))},[u,f,I,C,s]),p.useEffect(()=>{a||g!=="Not-Started"||I||(c(!0),s(Oe(!0,!1,!1,C)))},[a,g,I,C,s]);const y=E=>{n(E)};return v?.loggedInUserRoleMap!=null?o.jsxs(gt,{children:[o.jsx(_,{isAppContentDrawerOpen:i,handleDrawerToggle:y}),o.jsx(mt,{navigate:e,location:t,companyId:j,currentTenant:m,roleMap:v.loggedInUserRoleMap,onClickMenuIcon:()=>{y(!0)}})]}):o.jsx(oe,{fetchState:l.fetchState})},ft=F.div`
17
+ `,mt=$(function(e,t){const s=D(e),r=Le(e),i=Ve(e),n=t.roleMap.bill_pay_admin;return{isDisabled:(ee(s?.userRole??[])||n)&&"readonly",billpayApprovalView:r,remiApproverView:i,analytics:q}},function(e,t){const{navigate:s,currentTenant:r}=t;return{onSetupApprovalRulesBillPaySectionClick:()=>{s("bills/approval-rules")},onSetupApprovalRulesRemiSectionClick:()=>{s("reimbursements/approval-rules")},onBackClick:()=>{r?.companyBillPayInfo?.info?.isBillPayEnabled!=null&&r.companyBillPayInfo.info.isBillPayEnabled===!1?s("../.."):s("../")},onNavigateToDashboard:()=>{s("../dashboard")}}})(Kn),ht=()=>{const e=L(),t=Q(),s=T(),{tenantEmailDomain:r}=K(),[i,n]=p.useState(!1),[a,c]=p.useState(!1),[u,d]=p.useState(!1),m=h(E=>D(E)),f=h(E=>E.billPaySetupApproverViewState.fetchState),g=h(E=>E.remiSetupApproverViewState.fetchState),l=h(E=>Fe(E)),{isApprovalRulesV3Enabled:C,isLoading:I}=$n(m?.tenantId),P=m.companyId??j.getSignedInUserTenant(r)?.companyId;if(j.getSignedInUser()==null)throw Error("Can't access Approval Rules settings page without signing in...");const v=G();p.useEffect(()=>{u||f!=="Not-Started"||I||(d(!0),s(Be(!0,!0,C)))},[u,f,I,C,s]),p.useEffect(()=>{a||g!=="Not-Started"||I||(c(!0),s(Oe(!0,!1,!1,C)))},[a,g,I,C,s]);const y=E=>{n(E)};return v?.loggedInUserRoleMap!=null?o.jsxs(gt,{children:[o.jsx(_,{isAppContentDrawerOpen:i,handleDrawerToggle:y}),o.jsx(mt,{navigate:e,location:t,companyId:P,currentTenant:m,roleMap:v.loggedInUserRoleMap,onClickMenuIcon:()=>{y(!0)}})]}):o.jsx(oe,{fetchState:l.fetchState})},ft=F.div`
18
18
  display: flex;
19
19
  height: 100%;
20
20
  width: 100%;
@@ -22,7 +22,7 @@ import{j as o}from"./liveblocks-BLlSTcoD.js";import{a as p}from"./sentry-D_xp3E3
22
22
  flex-direction: column;
23
23
  align-items: center;
24
24
  background-color: ${e=>e.theme.colors.grey4};
25
- `,bt=$(function(e,t){const{companyId:s,isZeniAccountEnabled:r,isChargeCardEnabled:i,isBillPayEnabled:n,isRemiEnabled:a,isTreasuryEnabled:c}=t,u=D(e);return{bankSetupView:Ze(e,s,n,a,r,i,c),connectedAccountProvider:u.company?.featuresActivationInfo.connectedAccountProvider??"",analytics:q}},function(e,t){const{navigate:s,currentTenant:r,companyId:i}=t;return{onFetchLinkTokenClick:(n,a,c)=>{e(te(a,n,c))},onEstablishConnectionClick:(n,a,c)=>{e(ne(n,i,a,c))},onUpdatePaymentAccountStatus:(n,a,c,u,d)=>{e(ye(n,a,d,u,c))},onUpdatePaymentAccountLoginStatus:(n,a,c,u)=>{e(Se(!1,n,u,c,a))},onEstablishConnectionSuccess:(n,a)=>{e(be(a,n))},onUpdateAccountClick:(n,a,c,u,d)=>{e(d==="paymentAccount"?fe(n,a,c,u):Je(u,n,a))},onUpdatePrimaryFundingAccount:(n,a,c)=>{e(qe(i,a,n,c))},onRemoveConnection:n=>{e(He(n))},onBackClick:()=>{r?.companyBillPayInfo?.info?.isBillPayEnabled!=null&&r.companyBillPayInfo.info.isBillPayEnabled===!1?s("../.."):s("../")},onNavigateToDashboard:()=>{s("../dashboard")}}})(Kn),St=()=>{const e=V(),t=Q(),s=T(),{tenantEmailDomain:r}=G(),i=K(),[n,a]=p.useState(!1),[c,u]=p.useState(!1),d=h(y=>D(y)),m=h(y=>y.settingsViewState.bankConnection.fetchState),f=Le(d,i?.loggedInUserRoleMap),g=Ne(d,i?.loggedInUserRoleMap),l=Qe(d,i?.loggedInUserRoleMap),C=$e(d,i?.loggedInUserRoleMap),I=Ge(d,i?.loggedInUserRoleMap),j=d.companyId??P.getSignedInUserTenant(r)?.companyId;if(P.getSignedInUser()==null)throw Error("Can't access bank connections page without signing in...");p.useEffect(()=>{c||m==="Completed"||(u(!0),s(Ke(!1)))},[c,s,m]);const v=y=>{a(y)};return f||l||g||I?o.jsxs(ft,{children:[o.jsx(_,{isAppContentDrawerOpen:n,handleDrawerToggle:v}),o.jsx(bt,{navigate:e,location:t,companyId:j,currentTenant:d,roleMap:i.loggedInUserRoleMap,isBillPayEnabled:f,isRemiEnabled:g,isZeniAccountEnabled:l,isChargeCardEnabled:I,isTreasuryEnabled:C,onClickMenuIcon:()=>{v(!0)}})]}):o.jsx(N,{})},yt=F.div`
25
+ `,bt=$(function(e,t){const{companyId:s,isZeniAccountEnabled:r,isChargeCardEnabled:i,isBillPayEnabled:n,isRemiEnabled:a,isTreasuryEnabled:c}=t,u=D(e);return{bankSetupView:Ze(e,s,n,a,r,i,c),connectedAccountProvider:u.company?.featuresActivationInfo.connectedAccountProvider??"",analytics:q}},function(e,t){const{navigate:s,currentTenant:r,companyId:i}=t;return{onFetchLinkTokenClick:(n,a,c)=>{e(te(a,n,c))},onEstablishConnectionClick:(n,a,c)=>{e(ne(n,i,a,c))},onUpdatePaymentAccountStatus:(n,a,c,u,d)=>{e(ye(n,a,d,u,c))},onUpdatePaymentAccountLoginStatus:(n,a,c,u)=>{e(Se(!1,n,u,c,a))},onEstablishConnectionSuccess:(n,a)=>{e(be(a,n))},onUpdateAccountClick:(n,a,c,u,d)=>{e(d==="paymentAccount"?fe(n,a,c,u):Je(u,n,a))},onUpdatePrimaryFundingAccount:(n,a,c)=>{e(qe(i,a,n,c))},onRemoveConnection:n=>{e(He(n))},onBackClick:()=>{r?.companyBillPayInfo?.info?.isBillPayEnabled!=null&&r.companyBillPayInfo.info.isBillPayEnabled===!1?s("../.."):s("../")},onNavigateToDashboard:()=>{s("../dashboard")}}})(Gn),St=()=>{const e=L(),t=Q(),s=T(),{tenantEmailDomain:r}=K(),i=G(),[n,a]=p.useState(!1),[c,u]=p.useState(!1),d=h(y=>D(y)),m=h(y=>y.settingsViewState.bankConnection.fetchState),f=ze(d,i?.loggedInUserRoleMap),g=Ne(d,i?.loggedInUserRoleMap),l=Qe(d,i?.loggedInUserRoleMap),C=$e(d,i?.loggedInUserRoleMap),I=Ke(d,i?.loggedInUserRoleMap),P=d.companyId??j.getSignedInUserTenant(r)?.companyId;if(j.getSignedInUser()==null)throw Error("Can't access bank connections page without signing in...");p.useEffect(()=>{c||m==="Completed"||(u(!0),s(Ge(!1)))},[c,s,m]);const v=y=>{a(y)};return f||l||g||I?o.jsxs(ft,{children:[o.jsx(_,{isAppContentDrawerOpen:n,handleDrawerToggle:v}),o.jsx(bt,{navigate:e,location:t,companyId:P,currentTenant:d,roleMap:i.loggedInUserRoleMap,isBillPayEnabled:f,isRemiEnabled:g,isZeniAccountEnabled:l,isChargeCardEnabled:I,isTreasuryEnabled:C,onClickMenuIcon:()=>{v(!0)}})]}):o.jsx(N,{})},yt=F.div`
26
26
  display: flex;
27
27
  height: 100%;
28
28
  width: 100%;
@@ -30,7 +30,7 @@ import{j as o}from"./liveblocks-BLlSTcoD.js";import{a as p}from"./sentry-D_xp3E3
30
30
  flex-direction: column;
31
31
  align-items: center;
32
32
  background-color: ${e=>e.theme.colors.grey4};
33
- `,Ct=$(function(e,t){const{companyId:s}=t,r=D(e),i=t.roleMap.bill_pay_admin,n=We(e,s),{uiState:a}=n,c=(ee(r?.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:a,stripeKey:ve.stripeKey,isCardPaymentPopupOpen:!1,connectedAccountProvider:r.company?.featuresActivationInfo.connectedAccountProvider??"",isDisabled:c,analytics:q}},function(e,t){const{navigate:s,currentTenant:r,companyId:i}=t;return{onFetchLinkTokenClick:(n,a)=>{e(te("billing_setup",n,a))},onEstablishConnectionClick:n=>{e(ne(n,i,"billing_setup","billing"))},onEstablishConnectionSuccess:()=>{e(be("billing","billing_setup"))},onUpdatePaymentAccountStatus:(n,a,c)=>{e(ye(n,a,"billing","billing_setup",c))},onUpdatePaymentAccountLoginStatus:(n,a)=>{e(Se(!1,n,"billing","billing_setup",a))},onUpdateAccountClick:(n,a)=>{e(fe(n,a,"billing","billing_setup"))},onBackClick:()=>{r?.companyBillPayInfo?.info?.isBillPayEnabled!=null&&r.companyBillPayInfo.info.isBillPayEnabled===!1?s("../.."):s("../")},onNavigateToDashboard:()=>{s("../dashboard")},handleCreateCardSetupIntent:n=>{e(Ce(n))},handleConfirmCardSetupIntent:n=>{e(sn(n))},updateCardPaymentModalState:n=>{e(on({isCardPaymentPopupOpen:n}))},handleAddCardPaymentSource:(n,a,c)=>{e(an(n,a,c))},handleFetchPaymentSources:()=>{e(W())},resetCardPaymentViewState:()=>{e(tn())},handleResetCardPaymentErrorStatuses:()=>{e(nn())},onBillingAddressSave:n=>{e(en(n))},onAddressEditHandler:n=>{if(n!=null){const a=at(n);e(Ye({addressType:"subscription_billing_address",addressToCreate:a}))}}}})(Hn),It=()=>{const e=V(),t=Q(),s=T(),{tenantEmailDomain:r}=G(),[i,n]=p.useState(!1),[a,c]=p.useState(!1),[u,d]=p.useState(!1),m=h(y=>D(y)),f=h(y=>y.cardPaymentViewState),g=h(y=>y.plaidAccountViewState.billing_setup.accountDetails.fetchStatus.fetchState),l=Zn(f.addCardPaymentSourceStatus.fetchState),C=f.addCardPaymentSourceStatus.fetchState,I=m.companyId??P.getSignedInUserTenant(r)?.companyId;if(P.getSignedInUser()==null)throw Error("Can't access bank connections page without signing in...");const j=K();p.useEffect(()=>{I!=null&&s(Xe(I,!1))},[I,s]),p.useEffect(()=>{a||(c(!0),s(W()))},[a,s]),p.useEffect(()=>{u||(Ce(["card"]),d(!0))},[u]),p.useEffect(()=>{l==="In-Progress"&&C==="Completed"&&s(W())},[l,C]);const v=y=>{n(y)};return j?.loggedInUserRoleMap!=null?o.jsxs(yt,{children:[o.jsx(_,{isAppContentDrawerOpen:i,handleDrawerToggle:v}),o.jsx(Ct,{navigate:e,location:t,companyId:I,currentTenant:m,roleMap:j.loggedInUserRoleMap,onClickMenuIcon:()=>{v(!0)},googleAPIKey:ve.googleMapsAPIKey})]}):o.jsx(oe,{fetchState:g})},Y="external_integrations",xt=$(function(e){const t=rn(e,Y);return{meetingUrl:"https://meetings.hubspot.com/niharn/zeni-onboarding-overview?embed=true",notifyMeRegisteredSlugs:new Set(t.map(s=>s.additionalInfo).filter(s=>s!=null))}},function(e,t){const{navigate:s,integrationsView:r,signedInUserEmail:i,tenantEmailDomain:n,tenantId:a}=t;return{onBackClick:()=>{s("../")},onNavigateToDashboard:()=>{s("../dashboard")},onReconnectQBO:()=>{pe.init("/connection/auth",n),pe.handleClick()},onRefreshClick:()=>{r.integrations.refreshQBO.fetchState!=="In-Progress"&&e(hn())},onSaveChargeBeeCredentials:(c,u)=>{const d=r.externalConnections?.revenue?.find(m=>m.connectionName==="chargebee")?.connectionId;d!=null&&e(gn(a,d,J("revenue"),mn("chargebee"),{api_key:c,site:u}))},onConnectHubSpot:(c,u)=>{const d=r.externalConnections?.revenue?.find(m=>m.connectionName==="hubspot")?.connectionId;if(d!=null){const m=`${window.location.origin}/oauth/hubspot/callback`;sessionStorage.setItem("hubspot_oauth_pending",JSON.stringify({client_id:c,client_secret:u,connection_id:d,redirect_uri:m,tenant_id:a}));const f="oauth crm.objects.deals.read crm.objects.owners.read";window.location.href=`https://app.hubspot.com/oauth/authorize?client_id=${encodeURIComponent(c)}&scope=${encodeURIComponent(f)}&redirect_uri=${encodeURIComponent(m)}`}},onDisconnect:(c,u)=>{e(pn(a,c,J(u)))},onSaveConnectorCredentials:c=>{e(un(a,J("payments"),c))},onNotifyMe:c=>{e(dn(Y,c,i))}}})(qn),Et=()=>{const e=V(),t=T(),{tenantEmailDomain:s}=G(),[r,i]=p.useState(!1),n=h(l=>l.tenantState.fetchState),a=h(l=>D(l)),c=a.companyId??P.getSignedInUserTenant(s)?.companyId,u=P.getSignedInUser(),d=K(),m=ee(a.userRole??[]);if(u==null)throw Error("Can't access Integrations page without signing in...");p.useEffect(()=>{t(cn(Y))},[t]);const f=l=>{i(l)},g=h(l=>ln(l,c));return d?.loggedInUserRoleMap!=null?o.jsxs(At,{children:[o.jsx(_,{isAppContentDrawerOpen:r,handleDrawerToggle:f}),o.jsx(xt,{navigate:e,onClickMenuIcon:()=>{f(!0)},isAdmin:m,integrationsView:g,signedInUserEmail:u.userEmail??"",tenantEmailDomain:a.tenantEmailDomain??s??"",tenantId:a.tenantId,saveChargeBeeState:g.externalConnections?.saveAPIKeyConnectionState??"Not-Started",saveChargeBeeError:g.externalConnections?.saveAPIKeyConnectionError?.message,saveHubSpotState:g.externalConnections?.saveOAuthConnectionState??"Not-Started",saveHubSpotError:g.externalConnections?.saveOAuthConnectionError?.message,saveConnectorCredentialsStateBySlug:g.externalConnections?.saveConnectorCredentialsStateBySlug??{},saveConnectorCredentialsErrorBySlug:Object.fromEntries(Object.entries(g.externalConnections?.saveConnectorCredentialsErrorBySlug??{}).map(([l,C])=>[l,C?.message])),deleteConnectionState:g.externalConnections?.deleteConnectionState??"Not-Started",deleteConnectionError:g.externalConnections?.deleteConnectionError?.message,isLoading:n==="In-Progress"})]}):o.jsx(oe,{fetchState:n})},At=F.div`
33
+ `,Ct=$(function(e,t){const{companyId:s}=t,r=D(e),i=t.roleMap.bill_pay_admin,n=Ye(e,s),{uiState:a}=n,c=(ee(r?.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:a,stripeKey:ve.stripeKey,isCardPaymentPopupOpen:!1,connectedAccountProvider:r.company?.featuresActivationInfo.connectedAccountProvider??"",isDisabled:c,analytics:q}},function(e,t){const{navigate:s,currentTenant:r,companyId:i}=t;return{onFetchLinkTokenClick:(n,a)=>{e(te("billing_setup",n,a))},onEstablishConnectionClick:n=>{e(ne(n,i,"billing_setup","billing"))},onEstablishConnectionSuccess:()=>{e(be("billing","billing_setup"))},onUpdatePaymentAccountStatus:(n,a,c)=>{e(ye(n,a,"billing","billing_setup",c))},onUpdatePaymentAccountLoginStatus:(n,a)=>{e(Se(!1,n,"billing","billing_setup",a))},onUpdateAccountClick:(n,a)=>{e(fe(n,a,"billing","billing_setup"))},onBackClick:()=>{r?.companyBillPayInfo?.info?.isBillPayEnabled!=null&&r.companyBillPayInfo.info.isBillPayEnabled===!1?s("../.."):s("../")},onNavigateToDashboard:()=>{s("../dashboard")},handleCreateCardSetupIntent:n=>{e(Ce(n))},handleConfirmCardSetupIntent:n=>{e(sn(n))},updateCardPaymentModalState:n=>{e(on({isCardPaymentPopupOpen:n}))},handleAddCardPaymentSource:(n,a,c)=>{e(an(n,a,c))},handleFetchPaymentSources:()=>{e(Y())},resetCardPaymentViewState:()=>{e(tn())},handleResetCardPaymentErrorStatuses:()=>{e(nn())},onBillingAddressSave:n=>{e(en(n))},onAddressEditHandler:n=>{if(n!=null){const a=at(n);e(Xe({addressType:"subscription_billing_address",addressToCreate:a}))}}}})(Hn),It=()=>{const e=L(),t=Q(),s=T(),{tenantEmailDomain:r}=K(),[i,n]=p.useState(!1),[a,c]=p.useState(!1),[u,d]=p.useState(!1),m=h(y=>D(y)),f=h(y=>y.cardPaymentViewState),g=h(y=>y.plaidAccountViewState.billing_setup.accountDetails.fetchStatus.fetchState),l=Zn(f.addCardPaymentSourceStatus.fetchState),C=f.addCardPaymentSourceStatus.fetchState,I=m.companyId??j.getSignedInUserTenant(r)?.companyId;if(j.getSignedInUser()==null)throw Error("Can't access bank connections page without signing in...");const P=G();p.useEffect(()=>{I!=null&&s(We(I,!1))},[I,s]),p.useEffect(()=>{a||(c(!0),s(Y()))},[a,s]),p.useEffect(()=>{u||(Ce(["card"]),d(!0))},[u]),p.useEffect(()=>{l==="In-Progress"&&C==="Completed"&&s(Y())},[l,C]);const v=y=>{n(y)};return P?.loggedInUserRoleMap!=null?o.jsxs(yt,{children:[o.jsx(_,{isAppContentDrawerOpen:i,handleDrawerToggle:v}),o.jsx(Ct,{navigate:e,location:t,companyId:I,currentTenant:m,roleMap:P.loggedInUserRoleMap,onClickMenuIcon:()=>{v(!0)},googleAPIKey:ve.googleMapsAPIKey})]}):o.jsx(oe,{fetchState:g})},X="external_integrations",xt=$(function(e){const t=rn(e,X);return{meetingUrl:"https://meetings.hubspot.com/niharn/zeni-onboarding-overview?embed=true",notifyMeRegisteredSlugs:new Set(t.map(s=>s.additionalInfo).filter(s=>s!=null))}},function(e,t){const{navigate:s,integrationsView:r,signedInUserEmail:i,tenantEmailDomain:n,tenantId:a}=t;return{onBackClick:()=>{s("../")},onNavigateToDashboard:()=>{s("../dashboard")},onReconnectQBO:()=>{pe.init("/connection/auth",n),pe.handleClick()},onRefreshClick:()=>{r.integrations.refreshQBO.fetchState!=="In-Progress"&&e(hn())},onSaveChargeBeeCredentials:(c,u)=>{const d=r.externalConnections?.revenue?.find(m=>m.connectionName==="chargebee")?.connectionId;d!=null&&e(gn(a,d,J("revenue"),mn("chargebee"),{api_key:c,site:u}))},onConnectHubSpot:(c,u)=>{const d=r.externalConnections?.revenue?.find(m=>m.connectionName==="hubspot")?.connectionId;if(d!=null){const m=`${window.location.origin}/oauth/hubspot/callback`;sessionStorage.setItem("hubspot_oauth_pending",JSON.stringify({client_id:c,client_secret:u,connection_id:d,redirect_uri:m,tenant_id:a}));const f="oauth crm.objects.deals.read crm.objects.owners.read";window.location.href=`https://app.hubspot.com/oauth/authorize?client_id=${encodeURIComponent(c)}&scope=${encodeURIComponent(f)}&redirect_uri=${encodeURIComponent(m)}`}},onDisconnect:(c,u)=>{e(pn(a,c,J(u)))},onSaveConnectorCredentials:c=>{e(un(a,J("payments"),c))},onNotifyMe:c=>{e(dn(X,c,i))}}})(qn),Et=()=>{const e=L(),t=T(),{tenantEmailDomain:s}=K(),[r,i]=p.useState(!1),n=h(l=>l.tenantState.fetchState),a=h(l=>D(l)),c=a.companyId??j.getSignedInUserTenant(s)?.companyId,u=j.getSignedInUser(),d=G(),m=ee(a.userRole??[]);if(u==null)throw Error("Can't access Integrations page without signing in...");p.useEffect(()=>{t(cn(X))},[t]);const f=l=>{i(l)},g=h(l=>ln(l,c));return d?.loggedInUserRoleMap!=null?o.jsxs(At,{children:[o.jsx(_,{isAppContentDrawerOpen:r,handleDrawerToggle:f}),o.jsx(xt,{navigate:e,onClickMenuIcon:()=>{f(!0)},isAdmin:m,integrationsView:g,signedInUserEmail:u.userEmail??"",tenantEmailDomain:a.tenantEmailDomain??s??"",tenantId:a.tenantId,saveChargeBeeState:g.externalConnections?.saveAPIKeyConnectionState??"Not-Started",saveChargeBeeError:g.externalConnections?.saveAPIKeyConnectionError?.message,saveHubSpotState:g.externalConnections?.saveOAuthConnectionState??"Not-Started",saveHubSpotError:g.externalConnections?.saveOAuthConnectionError?.message,saveConnectorCredentialsStateBySlug:g.externalConnections?.saveConnectorCredentialsStateBySlug??{},saveConnectorCredentialsErrorBySlug:Object.fromEntries(Object.entries(g.externalConnections?.saveConnectorCredentialsErrorBySlug??{}).map(([l,C])=>[l,C?.message])),deleteConnectionState:g.externalConnections?.deleteConnectionState??"Not-Started",deleteConnectionError:g.externalConnections?.deleteConnectionError?.message,isLoading:n==="In-Progress"})]}):o.jsx(oe,{fetchState:n})},At=F.div`
34
34
  display: flex;
35
35
  height: 100%;
36
36
  width: 100%;
@@ -46,7 +46,7 @@ import{j as o}from"./liveblocks-BLlSTcoD.js";import{a as p}from"./sentry-D_xp3E3
46
46
  flex-direction: column;
47
47
  align-items: center;
48
48
  background-color: ${e=>e.theme.colors.grey4};
49
- `,kt=()=>{const e=T(),{tenantEmailDomain:t}=G(),[s,r]=p.useState(!1),i=h(l=>D(l)).companyId??P.getSignedInUserTenant(t)?.companyId,n=P.getSignedInUser();if(n==null)throw Error("Can't access my bank connections page without signing in...");const a=h(l=>fn(l,n.userId)),c=h(l=>bn(l,i,"bill_pay","user_reimbursement_account")),{plaidConnectionDetails:u}=c,d=l=>{r(l)},m=p.useCallback(l=>{e(te("user_reimbursement_account",l))},[]),f=p.useCallback(l=>{e(ne(l,i,"user_reimbursement_account",void 0,"link_account_no_microdeposit"))},[]);p.useEffect(()=>{a.fetchState!=="Completed"&&a.fetchState!=="In-Progress"&&e(Sn(n.userId))},[n.userId,a.fetchState]);const g=a.fetchState==="Not-Started"||a.fetchState==="In-Progress";return o.jsxs(vt,{children:[o.jsx(_,{isAppContentDrawerOpen:s,handleDrawerToggle:d}),o.jsx(Jn,{plaidConnectionDetails:u,isLoading:g,myBankConnectionsView:a,onFetchLinkTokenClick:m,onEstablishConnectionClick:f,onClickMenuIcon:()=>{d(!0)}})]})},wt=F.div`
49
+ `,kt=()=>{const e=T(),{tenantEmailDomain:t}=K(),[s,r]=p.useState(!1),i=h(l=>D(l)).companyId??j.getSignedInUserTenant(t)?.companyId,n=j.getSignedInUser();if(n==null)throw Error("Can't access my bank connections page without signing in...");const a=h(l=>fn(l,n.userId)),c=h(l=>bn(l,i,"bill_pay","user_reimbursement_account")),{plaidConnectionDetails:u}=c,d=l=>{r(l)},m=p.useCallback(l=>{e(te("user_reimbursement_account",l))},[]),f=p.useCallback(l=>{e(ne(l,i,"user_reimbursement_account",void 0,"link_account_no_microdeposit"))},[]);p.useEffect(()=>{a.fetchState!=="Completed"&&a.fetchState!=="In-Progress"&&e(Sn(n.userId))},[n.userId,a.fetchState]);const g=a.fetchState==="Not-Started"||a.fetchState==="In-Progress";return o.jsxs(vt,{children:[o.jsx(_,{isAppContentDrawerOpen:s,handleDrawerToggle:d}),o.jsx(Jn,{plaidConnectionDetails:u,isLoading:g,myBankConnectionsView:a,onFetchLinkTokenClick:m,onEstablishConnectionClick:f,onClickMenuIcon:()=>{d(!0)}})]})},wt=F.div`
50
50
  display: flex;
51
51
  height: 100%;
52
52
  width: 100%;
@@ -54,4 +54,4 @@ import{j as o}from"./liveblocks-BLlSTcoD.js";import{a as p}from"./sentry-D_xp3E3
54
54
  flex-direction: column;
55
55
  align-items: center;
56
56
  background-color: ${e=>e.theme.colors.grey4};
57
- `,ge=({appContent:e})=>{const t=T(),s=V(),r=Q(),[i,n]=p.useState(!1),a=h(b=>D(b)),{tenantEmailDomain:c}=a,u=a.companyId??P.getSignedInUserTenant(c)?.companyId;if(P.getSignedInUser()==null)throw Error("Can't access My Profile page without signing in...");const{useFeatureGate:d}=ae(),{isFeatureEnabled:m}=d(R.isDepositAccountsFeatureEnabled),{isFeatureEnabled:f}=d(R.isChargeCardFeatureEnabled),{isFeatureEnabled:g}=d(R.isDebitCardFeatureEnabled),{isFeatureEnabled:l}=d(R.isTreasuryEnabled),C=h(b=>he(b)),I=Ie(a),j=xe(g,a),v=!j&&C,y=Xn(a,f,g),{areTenantIdsInSync:E}=Wn();p.useEffect(()=>{E&&t(yn(u,v))},[u,t,v,E]);const k=h(b=>Cn(b,v)),B=k.fetchState==="Not-Started"||k.fetchState==="In-Progress"||u==null,z=In(a),L=!!a.company?.featuresActivationInfo?.isReimbursementFeatureEnabled,O=b=>{n(b)};return o.jsxs(wt,{children:[o.jsx(_,{isAppContentDrawerOpen:i,handleDrawerToggle:O}),e!=null?o.jsx(o.Fragment,{children:e}):o.jsx(Yn,{myProfileView:k,isAccountingClassesEnabled:C,isReimbursementDisabled:L===!1,isZeniAccountsDisabled:m===!1,isChargeCardDisabled:y===!1,isTreasuryDisabled:l===!1,isLiteRoleDisabled:z===!1,onClickMenuIcon:()=>{O(!0)},isLoading:B,isBankingOnlyTenant:j,isCardsOnlyTenant:I,onAddressClick:b=>{const M=function(x,U){let w=`/${x}/settings/my_profile`;return w=w.concat(`/new/${U}`),w}(c,b),S=et(r.state?.pathnameStackToGoBack,r.pathname);s(M,{state:{pathnameStackToGoBack:S}})},onGetOtp:b=>{const M={...k.myProfileLocalData,phone:b};t(re({localData:M})),t(vn(b,"MyProfile"))},onResendOtp:b=>{t(An(b,"MyProfile"))},onCancelClick:()=>{t(En())},onSaveClick:()=>{t(de("MyProfile",k.myProfileLocalData.phone,k.myProfileLocalData.otpChallenge,k.myProfileLocalData.dateOfBirth,k.addressData?.addressToCreate))},onVerifyOtp:(b,M)=>{t(xn(b,M,"MyProfile"))},onVerifyOtpSuccess:b=>{b!=null&&P.saveZeniOtpToken(b),t(de("MyProfile",k.myProfileLocalData.phone,k.myProfileLocalData.otpChallenge,k.myProfileLocalData.dateOfBirth,k.addressData?.addressToCreate))},updateMyProfileLocalData:b=>{t(re({localData:b}))}})]})};function Pt(){const e=T(),t=h(l=>D(l)).companyId,s=h(l=>kn(l)),r=h(l=>Ee(l)),i=P.getSignedInUser(),[n,a]=p.useState(!1),c=p.useCallback(l=>{a(l)},[]),u=p.useCallback(l=>{e(wn(l))},[]),d=p.useCallback(()=>{i?.userEmail!=null&&e(Pn({loggedInUserEmail:i.userEmail}))},[i?.userEmail]),m=p.useCallback(()=>{e(jn())},[]);if(i==null)throw Error("Can't access Notification Settings page without signing in...");const f=p.useCallback(()=>{const l=r.notificationSettings.monthEndInsightsNotificationSettings.enabled!=null;e(ue(l,t))},[t,r.notificationSettings.monthEndInsightsNotificationSettings.enabled]),g=p.useCallback(()=>{e(Dn())},[]);return p.useEffect(()=>{if(r.fetchState==="Completed"&&s.fetchState!=="In-Progress"&&s.fetchState!=="Completed"){const l=r.notificationSettings.monthEndInsightsNotificationSettings.enabled!=null;e(ue(l,t))}},[s.fetchState,t,r.notificationSettings.monthEndInsightsNotificationSettings.enabled,r.fetchState]),o.jsxs(o.Fragment,{children:[o.jsx(_,{isAppContentDrawerOpen:n,handleDrawerToggle:c}),o.jsx(nt,{notificationSettingsView:s,onFormDataChange:u,onCancel:d,onSave:m,onClickMenuIcon:()=>{c(!0)},signedInUser:i,onRefresh:f,resetUpdateStatus:g})]})}function ra(e){const[t,s]=p.useState(!1),r=h(l=>Ee(l)),i=h(l=>D(l)),n=K(),a=P.getSignedInUser(),c=T(),{useFeatureGate:u}=ae(),{isFeatureEnabled:d}=u(R.isDebitCardFeatureEnabled),m=a?.userEmail==null||r.fetchState!=="Completed"||Mn(r.notificationSettings,a.userEmail,d,i);p.useEffect(()=>{r.fetchState!=="In-Progress"&&r.fetchState!=="Completed"&&t===!1&&(s(!0),c(Un()))},[r.fetchState,t]);const f=xe(d,i),g=Ie(i);return r.fetchState!=="In-Progress"&&r.fetchState!=="Not-Started"||m!==!0?Tn(i)?o.jsxs(X,{children:[_n(n?.loggedInUserRole??[],d,i,n?.loggedInUserRoleMap)&&o.jsx(A,{path:"accounting/*",element:o.jsx(pt,{})}),Rn(n?.loggedInUserRole??[],d,i,n?.loggedInUserRoleMap)&&o.jsx(A,{path:"approval_rules/*",element:o.jsx(jt,{hasAdminLevelAccess:e.hasAdminLevelAccess})}),Fn(i,n?.loggedInUserRoleMap)&&o.jsx(A,{path:"my_bank_connections",element:o.jsx(kt,{})}),Bn(i,n?.loggedInUserRoleMap)&&o.jsx(A,{path:"bank_connections",element:o.jsx(St,{})}),On(i,n?.loggedInUserRoleMap)&&o.jsx(A,{path:"business_verification",element:o.jsx(it,{productType:f?"zeni_accounts":g?"charge_cards":st(i,n?.loggedInUserRoleMap)})}),Vn(n?.loggedInUserRole??[],i,n?.loggedInUserRoleMap)&&o.jsx(A,{path:"company_details",element:o.jsx(ct,{})}),zn(n?.loggedInUserRole??[],i)&&o.jsx(A,{path:"billing",element:o.jsx(It,{})}),Ln(n?.loggedInUserRole??[],d,i)&&o.jsx(A,{path:"integrations",element:o.jsx(Et,{})}),o.jsx(A,{path:"my_profile/new/:addressType",element:o.jsx(ge,{appContent:o.jsx(ot,{isSubPage:!1})})}),o.jsx(A,{path:"my_profile",element:o.jsx(ge,{})}),m&&o.jsx(A,{path:"notifications",element:o.jsx(Pt,{})}),o.jsx(A,{path:"*",element:o.jsx(N,{})})]}):o.jsx(X,{children:o.jsx(A,{path:"*",element:o.jsx(N,{})})}):null}function jt(e){return o.jsxs(X,{children:[o.jsx(A,{path:"/",element:o.jsx(ht,{})}),o.jsx(A,{path:"bills/approval-rules/*",element:o.jsx(lt,{})}),o.jsx(A,{path:"reimbursements/approval-rules/*",element:e.hasAdminLevelAccess?o.jsx(rt,{}):o.jsx(N,{})}),o.jsx(A,{path:"*",element:o.jsx(N,{})})]})}export{ra as default};
57
+ `,ge=({appContent:e})=>{const t=T(),s=L(),r=Q(),[i,n]=p.useState(!1),a=h(b=>D(b)),{tenantEmailDomain:c}=a,u=a.companyId??j.getSignedInUserTenant(c)?.companyId;if(j.getSignedInUser()==null)throw Error("Can't access My Profile page without signing in...");const{useFeatureGate:d}=ae(),{isFeatureEnabled:m}=d(R.isDepositAccountsFeatureEnabled),{isFeatureEnabled:f}=d(R.isChargeCardFeatureEnabled),{isFeatureEnabled:g}=d(R.isDebitCardFeatureEnabled),{isFeatureEnabled:l}=d(R.isTreasuryEnabled),C=h(b=>he(b)),I=Ie(a),P=xe(g,a),v=!P&&C,y=Wn(a,f,g),{areTenantIdsInSync:E}=Yn();p.useEffect(()=>{E&&t(yn(u,v))},[u,t,v,E]);const k=h(b=>Cn(b,v)),B=k.fetchState==="Not-Started"||k.fetchState==="In-Progress"||u==null,V=In(a),z=!!a.company?.featuresActivationInfo?.isReimbursementFeatureEnabled,O=b=>{n(b)};return o.jsxs(wt,{children:[o.jsx(_,{isAppContentDrawerOpen:i,handleDrawerToggle:O}),e!=null?o.jsx(o.Fragment,{children:e}):o.jsx(Xn,{myProfileView:k,isAccountingClassesEnabled:C,isReimbursementDisabled:z===!1,isZeniAccountsDisabled:m===!1,isChargeCardDisabled:y===!1,isTreasuryDisabled:l===!1,isLiteRoleDisabled:V===!1,onClickMenuIcon:()=>{O(!0)},isLoading:B,isBankingOnlyTenant:P,isCardsOnlyTenant:I,onAddressClick:b=>{const U=function(x,M){let w=`/${x}/settings/my_profile`;return w=w.concat(`/new/${M}`),w}(c,b),S=et(r.state?.pathnameStackToGoBack,r.pathname);s(U,{state:{pathnameStackToGoBack:S}})},onGetOtp:b=>{const U={...k.myProfileLocalData,phone:b};t(re({localData:U})),t(vn(b,"MyProfile"))},onResendOtp:b=>{t(An(b,"MyProfile"))},onCancelClick:()=>{t(En())},onSaveClick:()=>{t(de("MyProfile",k.myProfileLocalData.phone,k.myProfileLocalData.otpChallenge,k.myProfileLocalData.dateOfBirth,k.addressData?.addressToCreate))},onVerifyOtp:(b,U)=>{t(xn(b,U,"MyProfile"))},onVerifyOtpSuccess:b=>{b!=null&&j.saveZeniOtpToken(b),t(de("MyProfile",k.myProfileLocalData.phone,k.myProfileLocalData.otpChallenge,k.myProfileLocalData.dateOfBirth,k.addressData?.addressToCreate))},updateMyProfileLocalData:b=>{t(re({localData:b}))}})]})};function jt(){const e=T(),t=h(l=>D(l)).companyId,s=h(l=>kn(l)),r=h(l=>Ee(l)),i=j.getSignedInUser(),[n,a]=p.useState(!1),c=p.useCallback(l=>{a(l)},[]),u=p.useCallback(l=>{e(wn(l))},[]),d=p.useCallback(()=>{i?.userEmail!=null&&e(jn({loggedInUserEmail:i.userEmail}))},[i?.userEmail]),m=p.useCallback(()=>{e(Pn())},[]);if(i==null)throw Error("Can't access Notification Settings page without signing in...");const f=p.useCallback(()=>{const l=r.notificationSettings.monthEndInsightsNotificationSettings.enabled!=null;e(ue(l,t))},[t,r.notificationSettings.monthEndInsightsNotificationSettings.enabled]),g=p.useCallback(()=>{e(Dn())},[]);return p.useEffect(()=>{if(r.fetchState==="Completed"&&s.fetchState!=="In-Progress"&&s.fetchState!=="Completed"){const l=r.notificationSettings.monthEndInsightsNotificationSettings.enabled!=null;e(ue(l,t))}},[s.fetchState,t,r.notificationSettings.monthEndInsightsNotificationSettings.enabled,r.fetchState]),o.jsxs(o.Fragment,{children:[o.jsx(_,{isAppContentDrawerOpen:n,handleDrawerToggle:c}),o.jsx(nt,{notificationSettingsView:s,onFormDataChange:u,onCancel:d,onSave:m,onClickMenuIcon:()=>{c(!0)},signedInUser:i,onRefresh:f,resetUpdateStatus:g})]})}function ra(e){const[t,s]=p.useState(!1),r=h(l=>Ee(l)),i=h(l=>D(l)),n=G(),a=j.getSignedInUser(),c=T(),{useFeatureGate:u}=ae(),{isFeatureEnabled:d}=u(R.isDebitCardFeatureEnabled),m=a?.userEmail==null||r.fetchState!=="Completed"||Un(r.notificationSettings,a.userEmail,d,i);p.useEffect(()=>{r.fetchState!=="In-Progress"&&r.fetchState!=="Completed"&&t===!1&&(s(!0),c(Mn()))},[r.fetchState,t]);const f=xe(d,i),g=Ie(i);return r.fetchState!=="In-Progress"&&r.fetchState!=="Not-Started"||m!==!0?Tn(i)?o.jsxs(W,{children:[_n(n?.loggedInUserRole??[],d,i,n?.loggedInUserRoleMap)&&o.jsx(A,{path:"accounting/*",element:o.jsx(pt,{})}),Rn(n?.loggedInUserRole??[],d,i,n?.loggedInUserRoleMap)&&o.jsx(A,{path:"approval_rules/*",element:o.jsx(Pt,{hasAdminLevelAccess:e.hasAdminLevelAccess})}),Fn(i,n?.loggedInUserRoleMap)&&o.jsx(A,{path:"my_bank_connections",element:o.jsx(kt,{})}),Bn(i,n?.loggedInUserRoleMap)&&o.jsx(A,{path:"bank_connections",element:o.jsx(St,{})}),On(i,n?.loggedInUserRoleMap)&&o.jsx(A,{path:"business_verification",element:o.jsx(it,{productType:f?"zeni_accounts":g?"charge_cards":st(i,n?.loggedInUserRoleMap)})}),Ln(n?.loggedInUserRole??[],i,n?.loggedInUserRoleMap)&&o.jsx(A,{path:"company_details",element:o.jsx(ct,{})}),Vn(n?.loggedInUserRole??[],i)&&o.jsx(A,{path:"billing",element:o.jsx(It,{})}),zn(n?.loggedInUserRole??[],d,i)&&o.jsx(A,{path:"integrations",element:o.jsx(Et,{})}),o.jsx(A,{path:"my_profile/new/:addressType",element:o.jsx(ge,{appContent:o.jsx(ot,{isSubPage:!1})})}),o.jsx(A,{path:"my_profile",element:o.jsx(ge,{})}),m&&o.jsx(A,{path:"notifications",element:o.jsx(jt,{})}),o.jsx(A,{path:"*",element:o.jsx(N,{})})]}):o.jsx(W,{children:o.jsx(A,{path:"*",element:o.jsx(N,{})})}):null}function Pt(e){return o.jsxs(W,{children:[o.jsx(A,{path:"/",element:o.jsx(ht,{})}),o.jsx(A,{path:"bills/approval-rules/*",element:o.jsx(lt,{})}),o.jsx(A,{path:"reimbursements/approval-rules/*",element:e.hasAdminLevelAccess?o.jsx(rt,{}):o.jsx(N,{})}),o.jsx(A,{path:"*",element:o.jsx(N,{})})]})}export{ra as default};
@@ -1,4 +1,4 @@
1
- import{j as u}from"./liveblocks-BLlSTcoD.js";import{h as X,g as Y,u as ee,i as W,j as _,N as j,n as H,t as Ye}from"./core-CbpoBsNm.js";import{bJ as en,cp as Ie,Pr as ye,eW as V,cB as nn,zj as $,z3 as tn,PD as an,PG as sn,rx as ne,rl as te,k$ as ae,tv as L,PI as Ae,gf as $e,ge as Ge,gd as We,PJ as on,zs as cn,E4 as ke,DX as Pe,DU as _e,DL as J,D_ as ve,E1 as Ee,E7 as we,tZ as De,gu as rn,cw as un,fB as dn,fz as ln,fA as pn,bs as mn,PK as yn,CL as le,Dn as fn,PL as gn,bK as Sn,Fn as pe,Eo as bn,PM as hn,PN as Cn,Fr as In,Fv as An,to as kn,JV as Pn,G0 as Ce,H0 as me,PO as _n,PP as vn,PQ as En,PR as He,PS as wn,Mm as Dn,OQ as Tn,Mx as Un,PT as Ke,PU as Ve,Gm as qe,l7 as On,ro as Je,tx as Fn,bE as je,tJ as Re,cz as Vn,PV as Qe,fU as xn,FK as Bn,FO as jn,PW as Rn,G3 as ze,PX as zn,PY as Nn,PZ as Ln,P_ as Mn,gn as Zn,AD as $n,P$ as Gn,AI as Wn,AH as Hn}from"./zeni-epic-state-CkeDRiud.js";import{j as ie,F as se,x as de,m as Te,aN as Q,bz as Xe,z as T,A as oe,d as U,B as Ue,f as G,bA as Kn,at as ce,bB as x,bC as qn,bD as Jn,af as Be,bE as Qn,s as Ne,au as Le,K as Xn,G as Yn,bF as et,bG as nt,bH as tt,a7 as at}from"./index-aZImxzjX.js";import{a as C}from"./sentry-D_xp3E3Q.js";import{n as xe,D as it,S as st}from"./mui-DcNGd9L2.js";import{M as fe}from"./MobileAppDrawer-CWBhYKqW.js";import N from"./NotFoundScreen-Bnx2UPHv.js";import{a as Me}from"./analyticsHelper-Bvqx3iRr.js";import{d as Ze}from"./routePaths-DyIc-n3M.js";import{B as Fe}from"./BusinessVerificationPageScreen-D2N5zUvV.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]="6020a01b-67a1-48de-99f2-4f690f8265da",e._sentryDebugIdIdentifier="sentry-dbid-6020a01b-67a1-48de-99f2-4f690f8265da")}catch{}})();const ot=xe.div`
1
+ import{j as u}from"./liveblocks-BUQfB0Zp.js";import{h as Q,g as X,u as ee,i as W,j as _,N as j,n as H,t as Xe}from"./core-OMb8nkC1.js";import{bJ as en,co as Ie,Pq as ye,eV as V,cA as nn,zi as $,z2 as tn,PC as an,PF as sn,rw as ne,rk as te,k_ as ae,tu as L,PH as Ae,ge as $e,gd as Ge,gc as We,PI as on,zr as cn,E3 as ke,DW as Pe,DT as _e,DK as J,DZ as ve,E0 as Ee,E6 as we,tY as Te,gt as rn,cv as un,fA as dn,fy as ln,fz as pn,bt as mn,PJ as yn,CK as le,Dm as fn,PK as gn,bK as Sn,Fm as pe,En as bn,PL as hn,PM as Cn,Fq as In,Fu as An,tn as kn,JU as Pn,F$ as Ce,G$ as me,PN as _n,PO as vn,PP as En,PQ as He,PR as wn,Ml as Tn,OP as Dn,Mw as Un,PS as Ke,PT as Ve,Gl as qe,l6 as On,rn as Je,tw as Fn,bE as je,tI as Re,cy as Vn,PU as Ye,fT as Bn,FJ as xn,FN as jn,PV as Rn,G2 as Ne,PW as Nn,PX as zn,PY as Ln,PZ as Mn,gm as Zn,AC as $n,P_ as Gn,AH as Wn,AG as Hn}from"./zeni-epic-state-BZ6N8nVI.js";import{j as ie,a as se,F as de,m as De,aN as Y,bz as Qe,z as D,E as oe,d as U,B as Ue,f as G,bA as Kn,at as ce,bB as B,bC as qn,bD as Jn,af as xe,bE as Yn,s as ze,au as Le,J as Qn,A as Xn,bF as et,bG as nt,bH as tt,a7 as at}from"./index-NcZU0lXl.js";import{a as C}from"./sentry-BLIwU6uZ.js";import{n as Be,D as it,S as st}from"./mui-JZY-3hhJ.js";import{M as fe}from"./MobileAppDrawer-B4f1me8_.js";import z from"./NotFoundScreen-CxRYls3k.js";import{a as Me}from"./analyticsHelper-BU5wlVa9.js";import{d as Ze}from"./routePaths-DZldr9mG.js";import{B as Fe}from"./BusinessVerificationPageScreen-BiV9G1-i.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]="c4bd3323-22fe-449b-9f79-bd873d9ed214",e._sentryDebugIdIdentifier="sentry-dbid-c4bd3323-22fe-449b-9f79-bd873d9ed214")}catch{}})();const ot=Be.div`
2
2
  display: flex;
3
3
  height: 100%;
4
4
  width: 100%;
@@ -6,7 +6,7 @@ import{j as u}from"./liveblocks-BLlSTcoD.js";import{h as X,g as Y,u as ee,i as W
6
6
  flex-direction: column;
7
7
  align-items: center;
8
8
  background-color: ${e=>e.theme.colors.grey4};
9
- `,ct=H(function(e,o){const{isUserBillPayAdmin:t,companyId:a}=o,c=V(e),n=an(e),i=T.getSignedInUser(),l=c.tenantId,s={userId:i?.userId??"",sessionId:i?.zeniSessionId??"",tenantId:l??""},r=sn(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",f=!!c.companyZeniAccountInfo?.info?.isZeniAccountEnabled;return{billPaySetupView:r,connectedAccountProvider:c.company?.featuresActivationInfo.connectedAccountProvider??"",isAccountsEnabled:f,showIntlWiseWidget:o.showIntlWiseWidget,isDisabled:p,billpayApprovalView:n,meetingUrl:"https://meetings.hubspot.com/snehals/demo-bill-pay?embed=true",analytics:U,filesEndPoint:`${ce.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($(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(ve(!1,n,"bill_pay","bill_pay_setup",i))},onEstablishConnectionSuccess:()=>{e($(a,!0))},onEnableBillPayClick:()=>{e(J(a,"bill_pay"))},onUpdateAccountClick:(n,i,l)=>{e(l==="paymentAccount"?Pe(n,i,"bill_pay","bill_pay_setup"):_e("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(cn(a))},onAcceptUpdatedTOSSuccess:()=>{e($(a,!0))},onGetOtp:(n,i)=>{e(We(n,"SpendManagementSetup")),i!=null&&e(on({officerType:i,phone:n}))},onResendOtp:n=>{e(Ge(n,"SpendManagementSetup"))},onVerifyOtp:(n,i)=>{e($e(n,i,"SpendManagementSetup"))},onVerifyOtpSuccess:(n,i)=>{n!=null&&i!=null&&e(L(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(L(a,n,"bill_pay",!0,!0,!0))},updateFilesEntity:n=>{e(ae({files:n}))},onDeleteFile:n=>{e(te(n))},onEditFileName:(n,i)=>{e(ne(n,i.split(".")[0]))},onSignUpClick:()=>{o.hasZeniAccountsAdminAccess?window.open("../checking/promo","_blank"):window.open("https://www.zeni.ai/product/business-checking-accounts","_blank")}}})(Kn),rt=()=>{const e=X(),o=Y(),t=ee(),{tenantEmailDomain:a}=W(),c=ie(),n=en(c?.loggedInUserRoleMap),i=Ie(c?.loggedInUserRoleMap),{useFeatureGate:l,useDynamicConfig:s}=se(),{isFeatureEnabled:r}=l(de.billPaySetupShowInternationalPaymentByWise),{isFeatureEnabled:p}=l(de.isBillPayLocalCurrencyFeatureEnabled),f=Te(),{configValue:A}=s(Q.zeniAccountsConfig),d=ye(A),[y,b]=C.useState(!1),P=C.useRef(!1),[g,S]=C.useState(!1),w=_(E=>E.billPaySetupViewState.fetchState),I=_(E=>V(E)),h=_(E=>E.billPaySetupApproverViewState.fetchState),{isApprovalRulesV3Enabled:D,isLoading:k}=Xe(I?.tenantId),m=I.companyId??T.getSignedInUserTenant(a)?.companyId;if(T.getSignedInUser()==null)throw Error("Can't access bill pay setup page without signing in...");const v=!!I.companyBillPayInfo?.info?.isBillPayTOSAccepted,R=nn(c?.loggedInUserRoleMap);C.useEffect(()=>{P.current||w!=="Not-Started"||m==null?P.current||w!=="Completed"||m==null||I.companyBillPayInfo?.info?.businessVerificationStatus?.code!=="pending_review"||(P.current=!0,t($(m,!1,!0))):(P.current=!0,t($(m,!0)))},[w,m,t]),C.useEffect(()=>{g||h!=="Not-Started"||k||(S(!0),t(tn(!0,!0,D)))},[g,h,k,D,t]);const F=E=>{b(E)};if(v===!1||R&&!c?.loggedInUserRoleMap?.bill_pay_admin)return u.jsx(j,{to:"../promo"});if(v===!0&&c?.loggedInUserRoleMap!=null){const E=z=>z.trackPageLoaded(G.Event.billPaySetup);return u.jsxs(ot,{children:[u.jsx(oe,{analytics:U,onLoad:z=>E(z)}),u.jsx(fe,{isAppContentDrawerOpen:y,handleDrawerToggle:F}),u.jsx(ct,{navigate:e,location:o,companyId:m,currentTenant:I,isUserBillPayAdmin:n,showIntlWiseWidget:r,onClickMenuIcon:()=>{F(!0)},hasZeniAccountsAdminAccess:i,accountsPromoConfig:d,isLocalCurrencyEnabled:p})]})}return u.jsx(Ue,{fetchState:"In-Progress",style:{backgroundColor:f.colors.grey5}})},Nt=(e,o)=>e!=null&&function(t){return t==="debit"||t==="credit"||t==="debit_and_credit"}(e)?e:o,Lt=e=>`/${e}/cards`,Mt=e=>`/${e}/cards/setup`,Zt=e=>`/${e}/cards/onboard`,$t=(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},Gt=(e,o)=>e.find(t=>t.id===o),Wt=(e,o,t)=>!e||!o||t.fetchState==="Completed",ut=(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:x(o.cashbackSummary.cashbackEarned.amount),redeemedCashback:x(o.cashbackSummary.cashbackRedeemed.amount),availableCashback:x(o.cashbackSummary.cashbackAvailable.amount),creditCardCashbackRedemptionMode:o.cashbackAnalytics.creditCardCashbackRedemptionMode,debitCardCashbackRedemptionMode:o.cashbackAnalytics.debitCardCashbackRedemptionMode}:void 0,Kt=(e,o,t,a,c)=>e&&o&&t?{creditAccountId:a.id,creditAccountLimit:x(a.limit.amount),creditAccountAvailableAmount:x(a.available.amount),creditAccountSpentAmount:x(a.balance.amount+a.hold.amount),creditAccountStatus:a.status,outstandingBalance:x(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=>x(n.accountBalance.available.amount)),debitCardsSpend:x(c?.currentMonthSpends.amount??0),debitAccountStatus:a.depositAccounts.map(n=>n.accountStatus)}:void 0,Jt=(e,o)=>e&&o.depositAccountLimit!=null&&o.chargeCard!=null?{debitAccountId:o.depositAccountLimit.id,debitAccountName:o.depositAccountLimit?.accountName??o.connectedAccount?.accountName,debitAccountBalance:x(o.depositAccountLimit?.accountBalance.available.amount),debitCardsSpend:x(o.chargeCard.limit.amount-o.chargeCard.available.amount),debitAccountStatus:o.depositAccountLimit?.accountStatus??o.connectedAccount?.accountStatus}:void 0,Qt=80,Xt=80,Yt=e=>e.companyId??T.getSignedInUserTenant(e.tenantEmailDomain)?.companyId,dt=({isBankingOnlyTenant:e,isDebitCardFeatureEnabled:o})=>o||e,lt=({isCardsOnlyTenant:e,isChargeCardFeatureEnabled:o,isBookKeepingTenant:t,isDebitCardProductVisible:a,chargeCardsCreditAccountLimit:c})=>(e||o||t)&&(!a||c>0),ea=({isCardsOnlyTenant:e,isChargeCardFeatureEnabled:o,isBookKeepingTenant:t})=>e||o||t,na=({cardInfo:e,isProductVisible:o,isTOSAccepted:t,isSetupEnabled:a,isUserHasCardsAdminLevelAccess:c,isUserHasCardsAccess:n})=>!!e&&o&&(!t&&c||n&&!c&&!a),pt=H(function(e,o){const{isUserChargeCardAdmin:t,chargeCardSetUpView:a,isDebitCardOnlyEnabled:c,isCreditCardOnlyEnabled:n}=o,i=V(e),l=T.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",f=!!i.companyZeniAccountInfo?.info?.isZeniAccountEnabled;return{chargeCardSetUpView:a,connectedAccountProvider:i.company?.featuresActivationInfo.connectedAccountProvider??"",isAccountsEnabled:f,isDisabled:p,meetingUrl:"https://meetings.hubspot.com/niharn/demo-accounts?embed=true",analytics:U,isDebitCardOnlyEnabled:c,isCreditCardOnlyEnabled:n,filesEndPoint:`${ce.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:f,businessVerificationStatus:A}=o;return{onBusinessVerificationSectionClick:()=>{U.trackCardsVerifyIdentityCompanyDetailsClick(f,p,A?.code),t("../verification"),c?.company?.companyChargeCardInfo!=null&&c.company.companyBillPayInfo?.businessVerificationStatus?.code==="pending_review"&&e(le(a,!1,!0))},onCardPolicySectionClick:()=>{t("../policy")},onFetchLinkTokenClick:(d,y)=>{e(De("charge_card_setup",d,y))},onEstablishConnectionClick:d=>{e(we(d,a,"charge_card_setup","charge_cards"))},onUpdatePaymentAccountStatus:(d,y,b)=>{e(Ee(d,y,"charge_cards","charge_card_setup",b))},onUpdatePaymentAccountLoginStatus:(d,y)=>{e(ve(!1,d,"charge_cards","charge_card_setup",y))},onEstablishConnectionSuccess:()=>{e(le(a,!0))},onEnableChargeCardClick:()=>{U.trackCardsEnableCardsClick(f,p,"Cards Card Setup"),l===!0&&i===!0&&s===!1&&r===!1?e(J(a,"charge_cards__debit_cards")):l===!0&&s===!1?e(J(a,"charge_cards")):i===!0&&r===!1&&e(J(a,"debit_cards"))},onUpdateChargeCardClick:(d,y,b)=>{const P=n.allBankAccounts.find(S=>S.accountId===n.primaryFundingAccount?.zeniAccountId),g=n.allBankAccounts.find(S=>S.accountId===d);U.trackCardsZeniCashAccountChangeClick(f,p,{oldZeniCashAccount:P?.accountName??"",newZeniCashAccount:g?.accountName??"",oldZeniCashAccountPosition:n.allBankAccounts.findIndex(S=>S.accountId===n.primaryFundingAccount?.zeniAccountId)+1,newZeniCashAccountPosition:n.allBankAccounts.findIndex(S=>S.accountId===d)+1,numberOfCashAccounts:n.allBankAccounts.length}),e(b==="paymentAccount"?Pe(d,y,"charge_cards","charge_card_setup"):_e("charge_card_setup",d,y))},onUpdatePrimaryFundingAccount:(d,y)=>{const b=n.allFundingAccounts.find(S=>S.id===d),P=n.allFundingAccounts.findIndex(S=>S.id===n.primaryFundingAccount?.id)+1,g=n.allFundingAccounts.findIndex(S=>S.id===d)+1;U.trackCardsPaymentAccountChangeClick(f,p,{oldPaymentAccountName:n.primaryFundingAccount?.label??"",oldPaymentAccountBalance:x(n.primaryFundingAccount?.accountBalance?.available?.amount??0),newPaymentAccountName:b?.label??"",newPaymentAccountBalance:x(b?.accountBalance?.available?.amount??0),isOldPaymentAccountRecommended:n.primaryFundingAccount?.accType==="depositAccount",isNewPaymentAccountRecommended:b?.accType==="depositAccount",oldPaymentAccountPosition:P,newPaymentAccountPosition:g,numberOfPaymentAccounts:n.allFundingAccounts.length}),e(ke(a,"charge_card_setup",d,y))},onEnableChargeCardSuccess:()=>{e(gn()),t("../",{relative:"path"})},onBackClick:()=>{c?.companyChargeCardInfo?.info?.isChargeCardEnabled||c?.companyDebitCardInfo?.info?.isDebitCardEnabled?t("../",{relative:"path"}):t("../..",{relative:"path"})},onNavigateToDashboard:()=>{t("../../dashboard")},onCompanyOfficerUpdated:(d,y)=>{e(Ae({officerType:d,fileIds:y}))},onSendForVerificationClick:d=>{l===!0&&i===!0?e(L(a,d,"charge_cards__debit_cards",!0,!0,!0)):l===!0?e(L(a,d,"charge_cards",!0,!0,!0)):i===!0&&e(L(a,d,"debit_cards",!0,!0,!0))},updateFilesEntity:d=>{e(ae({files:d}))},onDeleteFile:d=>{e(te(d))},onEditFileName:(d,y)=>{e(ne(d,y.split(".")[0]))},onSignUpClick:()=>{o.hasZeniAccountsAdminAccess?window.open("../checking/promo","_blank"):window.open("https://www.zeni.ai/product/business-checking-accounts","_blank")},onUpdateAutoPayClick:d=>{e(fn(a,d))}}})(qn),mt=()=>{const e=X(),o=Y(),t=ee(),{tenantEmailDomain:a}=W(),c=ie(),n=_(M=>V(M)),{useDynamicConfig:i,useFeatureGate:l}=se(),s=o.state?.pathnameStackToGoBack?.[0],{configValue:r}=i(Q.zeniAccountsConfig),{configValue:p}=i(Q.zeniCardsConfig),f=p.credit_card_auto_pay_threshold_by_company_id?.[n.companyId]??p.default_credit_card_auto_pay_threshold??80,{isFeatureEnabled:A}=l(de.isDebitCardFeatureEnabled),{isFeatureEnabled:d}=l(de.isChargeCardFeatureEnabled),{isFeatureEnabled:y}=l(de.isEarlyPayFeatureEnabled),b=_(M=>rn(M,n.companyId)),P=un(b.controllers),g=!!n.company?.companyChargeCardInfo.isChargeCardEnabled,S=!!n.company?.companyDebitCardInfo.isDebitCardEnabled,w=dn(A,n),I=dt({isDebitCardFeatureEnabled:A,isBankingOnlyTenant:w}),h=ln(n),D=pn(n),k=n.companyChargeCardInfo?.info?.chargeCardsCreditAccountLimit??0,m=lt({isCardsOnlyTenant:h,isChargeCardFeatureEnabled:d,isBookKeepingTenant:D,isDebitCardProductVisible:I,chargeCardsCreditAccountLimit:k}),v=I&&m===!1,R=I===!1&&m,F=ye(r),E=mn(c?.loggedInUserRoleMap),z=Ie(c?.loggedInUserRoleMap),[K,ge]=C.useState(!1),[q,re]=C.useState(!1),Z=_(M=>M.chargeCardSetupViewState.fetchState),B=T.getSignedInUserTenant(a)?.companyId??n.companyId,O=T.getSignedInUser(),Oe=M=>{ge(M)},Se=_(M=>yn(M,B));if(O==null)throw Error("Can't access charge card setup page without signing in...");C.useEffect(()=>{q||Z!=="Not-Started"||B==null?q||Z!=="Completed"||B==null||n.companyBillPayInfo?.info?.businessVerificationStatus?.code!=="pending_review"||t(le(B,!1,!0)):(re(!0),t(le(B,!0)))},[q,Z,B,t]);const be=!!n.company?.companyChargeCardInfo.isChargeCardTOSAccepted,he=!!n.company?.companyDebitCardInfo.isDebitCardTOSAccepted,ue=ut(m,I,S,g);return be||he?be||he?u.jsxs(u.Fragment,{children:[u.jsx(oe,{analytics:U,onLoad:()=>{U.trackPageLoaded(G.Event.cardsSetupVisited),U.trackCardsCardSetupView(P,ue,s==null?"Cards Setup":s.includes("cards/promo")?"Promo":s.includes("cards")?"Settings":"Cards Tab")}}),u.jsx(fe,{isAppContentDrawerOpen:K,handleDrawerToggle:Oe}),u.jsx(pt,{autoPayThreshold:f,navigate:e,location:o,companyId:B,currentTenant:n,isEarlyPayEnabled:y,isChargeCardTOSAccepted:be,isDebitCardTOSAccepted:he,isUserChargeCardAdmin:E,isDebitCardOnlyEnabled:v,isCreditCardOnlyEnabled:R,chargeCardSetUpView:Se,isCreditCardProductVisible:m,isDebitCardFeatureEnabled:I,isChargeCardSetupEnabled:g,isDebitCardSetupEnabled:S,businessVerificationStatus:n.companyBillPayInfo?.info?.businessVerificationStatus,controllerEmails:P,productInformation:ue,onClickMenuIcon:()=>{Oe(!0)},hasZeniAccountsAdminAccess:z,accountsPromoConfig:F})]}):u.jsx(Ue,{fetchState:"Not-Started"}):u.jsx(j,{to:"../promo"})},yt=xe.div`
9
+ `,ct=H(function(e,o){const{isUserBillPayAdmin:t,companyId:a}=o,c=V(e),n=an(e),i=D.getSignedInUser(),l=c.tenantId,s={userId:i?.userId??"",sessionId:i?.zeniSessionId??"",tenantId:l??""},r=sn(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",f=!!c.companyZeniAccountInfo?.info?.isZeniAccountEnabled;return{billPaySetupView:r,connectedAccountProvider:c.company?.featuresActivationInfo.connectedAccountProvider??"",isAccountsEnabled:f,showIntlWiseWidget:o.showIntlWiseWidget,isDisabled:p,billpayApprovalView:n,meetingUrl:"https://meetings.hubspot.com/snehals/demo-bill-pay?embed=true",analytics:U,filesEndPoint:`${ce.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($(a,!1,!0))},onSetupApprovalRulesSectionClick:()=>{t("../approval-rules")},onFetchLinkTokenClick:(n,i)=>{e(Te("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(ve(!1,n,"bill_pay","bill_pay_setup",i))},onEstablishConnectionSuccess:()=>{e($(a,!0))},onEnableBillPayClick:()=>{e(J(a,"bill_pay"))},onUpdateAccountClick:(n,i,l)=>{e(l==="paymentAccount"?Pe(n,i,"bill_pay","bill_pay_setup"):_e("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(cn(a))},onAcceptUpdatedTOSSuccess:()=>{e($(a,!0))},onGetOtp:(n,i)=>{e(We(n,"SpendManagementSetup")),i!=null&&e(on({officerType:i,phone:n}))},onResendOtp:n=>{e(Ge(n,"SpendManagementSetup"))},onVerifyOtp:(n,i)=>{e($e(n,i,"SpendManagementSetup"))},onVerifyOtpSuccess:(n,i)=>{n!=null&&i!=null&&e(L(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(L(a,n,"bill_pay",!0,!0,!0))},updateFilesEntity:n=>{e(ae({files:n}))},onDeleteFile:n=>{e(te(n))},onEditFileName:(n,i)=>{e(ne(n,i.split(".")[0]))},onSignUpClick:()=>{o.hasZeniAccountsAdminAccess?window.open("../checking/promo","_blank"):window.open("https://www.zeni.ai/product/business-checking-accounts","_blank")}}})(Kn),rt=()=>{const e=Q(),o=X(),t=ee(),{tenantEmailDomain:a}=W(),c=ie(),n=en(c?.loggedInUserRoleMap),i=Ie(c?.loggedInUserRoleMap),{useFeatureGate:l,useDynamicConfig:s}=se(),{isFeatureEnabled:r}=l(de.billPaySetupShowInternationalPaymentByWise),{isFeatureEnabled:p}=l(de.isBillPayLocalCurrencyFeatureEnabled),f=De(),{configValue:A}=s(Y.zeniAccountsConfig),d=ye(A),[y,b]=C.useState(!1),P=C.useRef(!1),[g,S]=C.useState(!1),w=_(E=>E.billPaySetupViewState.fetchState),I=_(E=>V(E)),h=_(E=>E.billPaySetupApproverViewState.fetchState),{isApprovalRulesV3Enabled:T,isLoading:k}=Qe(I?.tenantId),m=I.companyId??D.getSignedInUserTenant(a)?.companyId;if(D.getSignedInUser()==null)throw Error("Can't access bill pay setup page without signing in...");const v=!!I.companyBillPayInfo?.info?.isBillPayTOSAccepted,R=nn(c?.loggedInUserRoleMap);C.useEffect(()=>{P.current||w!=="Not-Started"||m==null?P.current||w!=="Completed"||m==null||I.companyBillPayInfo?.info?.businessVerificationStatus?.code!=="pending_review"||(P.current=!0,t($(m,!1,!0))):(P.current=!0,t($(m,!0)))},[w,m,t]),C.useEffect(()=>{g||h!=="Not-Started"||k||(S(!0),t(tn(!0,!0,T)))},[g,h,k,T,t]);const F=E=>{b(E)};if(v===!1||R&&!c?.loggedInUserRoleMap?.bill_pay_admin)return u.jsx(j,{to:"../promo"});if(v===!0&&c?.loggedInUserRoleMap!=null){const E=N=>N.trackPageLoaded(G.Event.billPaySetup);return u.jsxs(ot,{children:[u.jsx(oe,{analytics:U,onLoad:N=>E(N)}),u.jsx(fe,{isAppContentDrawerOpen:y,handleDrawerToggle:F}),u.jsx(ct,{navigate:e,location:o,companyId:m,currentTenant:I,isUserBillPayAdmin:n,showIntlWiseWidget:r,onClickMenuIcon:()=>{F(!0)},hasZeniAccountsAdminAccess:i,accountsPromoConfig:d,isLocalCurrencyEnabled:p})]})}return u.jsx(Ue,{fetchState:"In-Progress",style:{backgroundColor:f.colors.grey5}})},zt=(e,o)=>e!=null&&function(t){return t==="debit"||t==="credit"||t==="debit_and_credit"}(e)?e:o,Lt=e=>`/${e}/cards`,Mt=e=>`/${e}/cards/setup`,Zt=e=>`/${e}/cards/onboard`,$t=(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},Gt=(e,o)=>e.find(t=>t.id===o),Wt=(e,o,t)=>!e||!o||t.fetchState==="Completed",ut=(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:B(o.cashbackSummary.cashbackEarned.amount),redeemedCashback:B(o.cashbackSummary.cashbackRedeemed.amount),availableCashback:B(o.cashbackSummary.cashbackAvailable.amount),creditCardCashbackRedemptionMode:o.cashbackAnalytics.creditCardCashbackRedemptionMode,debitCardCashbackRedemptionMode:o.cashbackAnalytics.debitCardCashbackRedemptionMode}:void 0,Kt=(e,o,t,a,c)=>e&&o&&t?{creditAccountId:a.id,creditAccountLimit:B(a.limit.amount),creditAccountAvailableAmount:B(a.available.amount),creditAccountSpentAmount:B(a.balance.amount+a.hold.amount),creditAccountStatus:a.status,outstandingBalance:B(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=>B(n.accountBalance.available.amount)),debitCardsSpend:B(c?.currentMonthSpends.amount??0),debitAccountStatus:a.depositAccounts.map(n=>n.accountStatus)}:void 0,Jt=(e,o)=>e&&o.depositAccountLimit!=null&&o.chargeCard!=null?{debitAccountId:o.depositAccountLimit.id,debitAccountName:o.depositAccountLimit?.accountName??o.connectedAccount?.accountName,debitAccountBalance:B(o.depositAccountLimit?.accountBalance.available.amount),debitCardsSpend:B(o.chargeCard.limit.amount-o.chargeCard.available.amount),debitAccountStatus:o.depositAccountLimit?.accountStatus??o.connectedAccount?.accountStatus}:void 0,Yt=80,Qt=80,Xt=e=>e.companyId??D.getSignedInUserTenant(e.tenantEmailDomain)?.companyId,dt=({isBankingOnlyTenant:e,isDebitCardFeatureEnabled:o})=>o||e,lt=({isCardsOnlyTenant:e,isChargeCardFeatureEnabled:o,isBookKeepingTenant:t,isDebitCardProductVisible:a,chargeCardsCreditAccountLimit:c})=>(e||o||t)&&(!a||c>0),ea=({isCardsOnlyTenant:e,isChargeCardFeatureEnabled:o,isBookKeepingTenant:t})=>e||o||t,na=({cardInfo:e,isProductVisible:o,isTOSAccepted:t,isSetupEnabled:a,isUserHasCardsAdminLevelAccess:c,isUserHasCardsAccess:n})=>!!e&&o&&(!t&&c||n&&!c&&!a),pt=H(function(e,o){const{isUserChargeCardAdmin:t,chargeCardSetUpView:a,isDebitCardOnlyEnabled:c,isCreditCardOnlyEnabled:n}=o,i=V(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",f=!!i.companyZeniAccountInfo?.info?.isZeniAccountEnabled;return{chargeCardSetUpView:a,connectedAccountProvider:i.company?.featuresActivationInfo.connectedAccountProvider??"",isAccountsEnabled:f,isDisabled:p,meetingUrl:"https://meetings.hubspot.com/niharn/demo-accounts?embed=true",analytics:U,isDebitCardOnlyEnabled:c,isCreditCardOnlyEnabled:n,filesEndPoint:`${ce.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:f,businessVerificationStatus:A}=o;return{onBusinessVerificationSectionClick:()=>{U.trackCardsVerifyIdentityCompanyDetailsClick(f,p,A?.code),t("../verification"),c?.company?.companyChargeCardInfo!=null&&c.company.companyBillPayInfo?.businessVerificationStatus?.code==="pending_review"&&e(le(a,!1,!0))},onCardPolicySectionClick:()=>{t("../policy")},onFetchLinkTokenClick:(d,y)=>{e(Te("charge_card_setup",d,y))},onEstablishConnectionClick:d=>{e(we(d,a,"charge_card_setup","charge_cards"))},onUpdatePaymentAccountStatus:(d,y,b)=>{e(Ee(d,y,"charge_cards","charge_card_setup",b))},onUpdatePaymentAccountLoginStatus:(d,y)=>{e(ve(!1,d,"charge_cards","charge_card_setup",y))},onEstablishConnectionSuccess:()=>{e(le(a,!0))},onEnableChargeCardClick:()=>{U.trackCardsEnableCardsClick(f,p,"Cards Card Setup"),l===!0&&i===!0&&s===!1&&r===!1?e(J(a,"charge_cards__debit_cards")):l===!0&&s===!1?e(J(a,"charge_cards")):i===!0&&r===!1&&e(J(a,"debit_cards"))},onUpdateChargeCardClick:(d,y,b)=>{const P=n.allBankAccounts.find(S=>S.accountId===n.primaryFundingAccount?.zeniAccountId),g=n.allBankAccounts.find(S=>S.accountId===d);U.trackCardsZeniCashAccountChangeClick(f,p,{oldZeniCashAccount:P?.accountName??"",newZeniCashAccount:g?.accountName??"",oldZeniCashAccountPosition:n.allBankAccounts.findIndex(S=>S.accountId===n.primaryFundingAccount?.zeniAccountId)+1,newZeniCashAccountPosition:n.allBankAccounts.findIndex(S=>S.accountId===d)+1,numberOfCashAccounts:n.allBankAccounts.length}),e(b==="paymentAccount"?Pe(d,y,"charge_cards","charge_card_setup"):_e("charge_card_setup",d,y))},onUpdatePrimaryFundingAccount:(d,y)=>{const b=n.allFundingAccounts.find(S=>S.id===d),P=n.allFundingAccounts.findIndex(S=>S.id===n.primaryFundingAccount?.id)+1,g=n.allFundingAccounts.findIndex(S=>S.id===d)+1;U.trackCardsPaymentAccountChangeClick(f,p,{oldPaymentAccountName:n.primaryFundingAccount?.label??"",oldPaymentAccountBalance:B(n.primaryFundingAccount?.accountBalance?.available?.amount??0),newPaymentAccountName:b?.label??"",newPaymentAccountBalance:B(b?.accountBalance?.available?.amount??0),isOldPaymentAccountRecommended:n.primaryFundingAccount?.accType==="depositAccount",isNewPaymentAccountRecommended:b?.accType==="depositAccount",oldPaymentAccountPosition:P,newPaymentAccountPosition:g,numberOfPaymentAccounts:n.allFundingAccounts.length}),e(ke(a,"charge_card_setup",d,y))},onEnableChargeCardSuccess:()=>{e(gn()),t("../",{relative:"path"})},onBackClick:()=>{c?.companyChargeCardInfo?.info?.isChargeCardEnabled||c?.companyDebitCardInfo?.info?.isDebitCardEnabled?t("../",{relative:"path"}):t("../..",{relative:"path"})},onNavigateToDashboard:()=>{t("../../dashboard")},onCompanyOfficerUpdated:(d,y)=>{e(Ae({officerType:d,fileIds:y}))},onSendForVerificationClick:d=>{l===!0&&i===!0?e(L(a,d,"charge_cards__debit_cards",!0,!0,!0)):l===!0?e(L(a,d,"charge_cards",!0,!0,!0)):i===!0&&e(L(a,d,"debit_cards",!0,!0,!0))},updateFilesEntity:d=>{e(ae({files:d}))},onDeleteFile:d=>{e(te(d))},onEditFileName:(d,y)=>{e(ne(d,y.split(".")[0]))},onSignUpClick:()=>{o.hasZeniAccountsAdminAccess?window.open("../checking/promo","_blank"):window.open("https://www.zeni.ai/product/business-checking-accounts","_blank")},onUpdateAutoPayClick:d=>{e(fn(a,d))}}})(qn),mt=()=>{const e=Q(),o=X(),t=ee(),{tenantEmailDomain:a}=W(),c=ie(),n=_(M=>V(M)),{useDynamicConfig:i,useFeatureGate:l}=se(),s=o.state?.pathnameStackToGoBack?.[0],{configValue:r}=i(Y.zeniAccountsConfig),{configValue:p}=i(Y.zeniCardsConfig),f=p.credit_card_auto_pay_threshold_by_company_id?.[n.companyId]??p.default_credit_card_auto_pay_threshold??80,{isFeatureEnabled:A}=l(de.isDebitCardFeatureEnabled),{isFeatureEnabled:d}=l(de.isChargeCardFeatureEnabled),{isFeatureEnabled:y}=l(de.isEarlyPayFeatureEnabled),b=_(M=>rn(M,n.companyId)),P=un(b.controllers),g=!!n.company?.companyChargeCardInfo.isChargeCardEnabled,S=!!n.company?.companyDebitCardInfo.isDebitCardEnabled,w=dn(A,n),I=dt({isDebitCardFeatureEnabled:A,isBankingOnlyTenant:w}),h=ln(n),T=pn(n),k=n.companyChargeCardInfo?.info?.chargeCardsCreditAccountLimit??0,m=lt({isCardsOnlyTenant:h,isChargeCardFeatureEnabled:d,isBookKeepingTenant:T,isDebitCardProductVisible:I,chargeCardsCreditAccountLimit:k}),v=I&&m===!1,R=I===!1&&m,F=ye(r),E=mn(c?.loggedInUserRoleMap),N=Ie(c?.loggedInUserRoleMap),[K,ge]=C.useState(!1),[q,re]=C.useState(!1),Z=_(M=>M.chargeCardSetupViewState.fetchState),x=D.getSignedInUserTenant(a)?.companyId??n.companyId,O=D.getSignedInUser(),Oe=M=>{ge(M)},Se=_(M=>yn(M,x));if(O==null)throw Error("Can't access charge card setup page without signing in...");C.useEffect(()=>{q||Z!=="Not-Started"||x==null?q||Z!=="Completed"||x==null||n.companyBillPayInfo?.info?.businessVerificationStatus?.code!=="pending_review"||t(le(x,!1,!0)):(re(!0),t(le(x,!0)))},[q,Z,x,t]);const be=!!n.company?.companyChargeCardInfo.isChargeCardTOSAccepted,he=!!n.company?.companyDebitCardInfo.isDebitCardTOSAccepted,ue=ut(m,I,S,g);return be||he?be||he?u.jsxs(u.Fragment,{children:[u.jsx(oe,{analytics:U,onLoad:()=>{U.trackPageLoaded(G.Event.cardsSetupVisited),U.trackCardsCardSetupView(P,ue,s==null?"Cards Setup":s.includes("cards/promo")?"Promo":s.includes("cards")?"Settings":"Cards Tab")}}),u.jsx(fe,{isAppContentDrawerOpen:K,handleDrawerToggle:Oe}),u.jsx(pt,{autoPayThreshold:f,navigate:e,location:o,companyId:x,currentTenant:n,isEarlyPayEnabled:y,isChargeCardTOSAccepted:be,isDebitCardTOSAccepted:he,isUserChargeCardAdmin:E,isDebitCardOnlyEnabled:v,isCreditCardOnlyEnabled:R,chargeCardSetUpView:Se,isCreditCardProductVisible:m,isDebitCardFeatureEnabled:I,isChargeCardSetupEnabled:g,isDebitCardSetupEnabled:S,businessVerificationStatus:n.companyBillPayInfo?.info?.businessVerificationStatus,controllerEmails:P,productInformation:ue,onClickMenuIcon:()=>{Oe(!0)},hasZeniAccountsAdminAccess:N,accountsPromoConfig:F})]}):u.jsx(Ue,{fetchState:"Not-Started"}):u.jsx(j,{to:"../promo"})},yt=Be.div`
10
10
  display: flex;
11
11
  height: 100%;
12
12
  width: 100%;
@@ -14,11 +14,11 @@ import{j as u}from"./liveblocks-BLlSTcoD.js";import{h as X,g as Y,u as ee,i as W
14
14
  flex-direction: column;
15
15
  align-items: center;
16
16
  background-color: ${e=>e.theme.colors.grey4};
17
- `,ft=H(function(e,o){const{isUserRemiAdmin:t,companyId:a}=o,c=V(e),n=hn(e),i=Cn(e,a),l=T.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",f=!!c.companyZeniAccountInfo?.info?.isZeniAccountEnabled;return{remiSetupView:i,isDisabled:p,remiApprovalView:n,connectedAccountProvider:c.company?.featuresActivationInfo.connectedAccountProvider??"",isAccountsEnabled:f,meetingUrl:"https://meetings.hubspot.com/niharn/demo-reimbursements?embed=true",analytics:U,filesEndPoint:`${ce.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:f,mileageAmountInDenomination:A,description:d}=n;e(An({mileageDetails:{mileageUnitAmount:{amount:i,currencyCode:s,currencySymbol:r},denomination:p,denominationSymbol:f,mileageAmountInDenomination:A,mileageCurrencyCode:s,mileageCurrencySymbol:r,mileageUnit:l,description:d}}))},onSaveMileageClick:n=>{e(In(a)),U.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(ve(!1,n,"reimbursement","reimbursement_setup",i))},onEstablishConnectionSuccess:()=>{e(pe(a,!0))},onEnableRemiClick:()=>{e(J(a,"reimbursement"))},onUpdateAccountClick:(n,i,l)=>{e(l==="paymentAccount"?Pe(n,i,"reimbursement","reimbursement_setup"):_e("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(L(a,n,"reimbursement",!0,!0,!0))},updateFilesEntity:n=>{e(ae({files:n}))},onDeleteFile:n=>{e(te(n))},onEditFileName:(n,i)=>{e(ne(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")}}})(Jn),gt=()=>{const e=X(),o=Y(),t=ee(),{tenantEmailDomain:a}=W(),c=ie(),{useDynamicConfig:n}=se(),i=Te(),{configValue:l}=n(Q.zeniAccountsConfig),s=ye(l),r=Sn(c?.loggedInUserRoleMap),p=Ie(c?.loggedInUserRoleMap),[f,A]=C.useState(!1),d=C.useRef(!1),[y,b]=C.useState(!1),P=_(m=>m.remiSetupViewState.fetchState),g=_(m=>V(m)),S=_(m=>m.remiSetupApproverViewState.fetchState),{isApprovalRulesV3Enabled:w,isLoading:I}=Xe(g?.tenantId),h=T.getSignedInUserTenant(a)?.companyId??g.companyId,D=T.getSignedInUser(),k=m=>{A(m)};if(D==null)throw Error("Can't access reimbursement setup page without signing in...");if(C.useEffect(()=>{d.current||P!=="Not-Started"||h==null?d.current||P!=="Completed"||h==null||g.companyBillPayInfo?.info?.businessVerificationStatus?.code!=="pending_review"||(d.current=!0,t(pe(h,!1,!0))):(d.current=!0,t(pe(h,!0)))},[P,h,t]),C.useEffect(()=>{y||S!=="Not-Started"||I||(b(!0),t(bn(!0,!1,!1,w)))},[y,S,I,w,t]),g.companyReimbursementInfo?.info?.isReimbursementTOSAccepted===!1)return u.jsx(j,{to:"../promo"});if(g.companyReimbursementInfo?.info?.isReimbursementTOSAccepted===!0){const m=v=>v.trackPageLoaded(G.Event.reimbursementSetup);return u.jsxs(yt,{children:[u.jsx(oe,{analytics:U,onLoad:v=>m(v)}),u.jsx(fe,{isAppContentDrawerOpen:f,handleDrawerToggle:k}),u.jsx(ft,{navigate:e,location:o,companyId:h,currentTenant:g,isUserRemiAdmin:r,onClickMenuIcon:()=>{k(!0)},hasZeniAccountsAdminAccess:p,accountsPromoConfig:s})]})}return u.jsx(Ue,{fetchState:"In-Progress",style:{backgroundColor:i.colors.grey5}})},St=H(function(e,o){const{businessVerificationDetails:t,productType:a}=o,c=V(e),n=T.getSignedInUser(),i=c.tenantId,l={userId:n?.userId??"",sessionId:n?.zeniSessionId??"",tenantId:i??""},s=Dn(o.roleMap)&&t.updateStatus.fetchState!=="In-Progress"?void 0:"readonly",r=Tn(e.companyConfigState),p=Un(e.userRoleConfigState),f=a==="zeni_treasury"?Ke(e):void 0;return{businessVerificationDetails:t,verficationDetailsFetchState:t.fetchState,isRefreshingViewInBackground:t.isRefreshingViewInBackground,allNationalityCountries:t.allNationalityCountries,filesEndPoint:`${ce.fileMicroServiceBaseUrl}`,authParams:l,isDisabled:s,allIndustries:r.companyIndustries??[],companyTitles:p.companyTitles,transferDetails:f}},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:f,companyLegalName:A,companyTaxId:d,companyWebsite:y,companyPhone:b,primaryContactEmail:P,primaryContactName:g,primaryContactUserId:S,primaryContactSyncToken:w,syncToken:I,fileIds:h,incDate:D,typeOfIncorporation:k,stateOfIncorporation:m,sourceOfFunds:v,companySubIndustry:R,countriesOfOperations:F,companySourceOfFunds:E,companySourceOfFundsDescription:z,transactionVolume:K,transactionVolumeDescription:ge,purposeOfAccount:q,purposeOfAccountDescription:re,regulatedStatus:Z,regulatedStatusDescription:B,usNexus:O,usNexusTypes:Oe}=s,Se=f?.selectedOption,be={companyId:t,companyDescription:r,companyIndustry:p.selectedOption,companyIndustryType:Se==null||Se===""?void 0:Se,companyLegalName:A,taxIdOrEIN:d,website:y!=""&&y!=null?Vn(y):void 0,phone:b,syncToken:I,fileIds:h,incDate:D!=null?je(D?.toString()):D,typeOfIncorporation:k?.selectedOption??"",stateOfIncorporation:m?.selectedOption??"",sourceOfFunds:v?.selectedOption??"",companySubIndustry:R?.selectedOption??"",countriesOfOperations:F?.selectedOptions.map(ue=>ue.length===2?ue:Le(ue))??[],companySourceOfFunds:E?.selectedOption??"",companySourceOfFundsDescription:z,transactionVolume:K?.selectedOption??"",transactionVolumeDescription:ge,purposeOfAccount:q?.selectedOption??"",purposeOfAccountDescription:re,regulatedStatus:Z??"",regulatedStatusDescription:B,usNexus:O,usNexusTypes:Oe?.selectedOptions??[]},he={userId:S,firstName:g.firstName,lastName:g.lastName,email:P,syncToken:w};e(Re({companyDetails:be,primaryContactDetails:he}))},onCompanyOfficerUpdated:s=>{const r=s.map(p=>{const{officerType:f,userId:A,name:d,email:y,nationalityCountryCode:b,ssn:P,dob:g,phone:S,syncToken:w,selectDocument:I,role:h,ownership:D,isSelectedForVerification:k,userVerificationStatus:m,treasuryUserVerificationStatus:v,fileIds:R}=p;let F;return I.selectDocumentType==="driverLicense"?F="driving_license":I.selectDocumentType==="passport"?F="passport":I.selectDocumentType==="stateId"?F="id_document":I.selectDocumentType==="ssnCard"&&(F="social_security_card"),{officerType:f,userId:A,firstName:d.firstName,lastName:d.lastName,email:y,ssn:P,nationalityCountryCode:b?.selectedOption!=null?Le(b.selectedOption):void 0,phone:S,birthday:g!=null?je(g?.toString()):g,syncToken:w,titleAtCompany:h.selectedOption,ownershipInCompany:D,documentTypeSelectedForVerification:F,isSelectedForVerification:k,userVerificationStatus:m,treasuryUserVerificationStatus:v,fileIds:R,additionalDocumentTypesRequestedForVerification:[],additionalSubmittedDocumentsForVerificationFileIds:[],areAdditionalDocumentsRequestedForVerification:!1,areAdditionalDocumentsSubmittedForVerification:!1}});e(Re({officers:r}))},onSaveDetailsClick:s=>{e(L(t,s,a))},onSendForVerificationClick:s=>{e(L(t,s,a,!0))},onAddressClick:s=>{const r=Ze(l,s),p=Ne(i.state?.pathnameStackToGoBack,i.pathname),f=new URLSearchParams(i.search),A={};f.forEach((d,y)=>{A[y]=d}),n(r,{state:{pathnameStackToGoBack:p,queryParams:Object.keys(A).length>0?A:void 0}})},onRegisteredAddressClick:s=>{const r=Ze(l,s),p=Ne(i.state?.pathnameStackToGoBack,i.pathname),f=new URLSearchParams(i.search),A=Object.fromEntries(f.entries());n(r,{state:{pathnameStackToGoBack:p,queryParams:Object.keys(A).length>0?A:void 0}})},onBackClick:()=>{e(Fn({companyId:t})),n("../setup")},updateFilesEntity:s=>{e(ae({files:s}))},onDeleteFile:s=>{e(te(s))},onDeleteFileList:s=>{e(Je(s))},onEditFileName:(s,r)=>{e(ne(s,r.split(".")[0]))},onGetOtp:s=>{e(We(s,"SpendManagementSetup"))},onResendOtp:s=>{e(Ge(s,"SpendManagementSetup"))},onVerifyOtp:(s,r)=>{e($e(s,r,"SpendManagementSetup"))},saveNewAddressInLocalStore:(s,r)=>{e(On({addressType:s,addressToCreate:r}))},onExecuteTreasuryTransfer:()=>{e(qe())},onOverlayClose:()=>{e(Ve())}}})(Qn),bt=({productType:e,isBusinessVerificationDrawerOpen:o,closeDrawerHandler:t})=>{const a=X(),c=Y(),n=ee(),[i]=Ye(),l=i.get("showStepProgress"),s=i.get("isTransferInitiated"),[r,p]=C.useState(!1),{tenantEmailDomain:f}=W(),A=ie(),{useDynamicConfig:d}=se(),y=Te(),{configValue:b}=d(Q.zeniAccountsConfig),P=ye(b),g=_(m=>{switch(e){case"zeni_accounts":return m.zeniAccountSetupViewState.fetchState;case"reimbursement":return m.remiSetupViewState.fetchState;case"charge_cards":return m.chargeCardSetupViewState.fetchState;case"zeni_treasury":return m.treasurySetupViewState.fetchState;default:return m.billPaySetupViewState.fetchState}}),S=_(m=>m.companyConfigState.fetchState),w=_(m=>m.userRoleConfigState.fetchState),I=_(m=>V(m)),h=I.companyId??T.getSignedInUserTenant(f)?.companyId;if(C.useEffect(()=>{S==="Not-Started"&&n(kn()),w==="Not-Started"&&n(Pn(!0))},[S,w,n]),C.useEffect(()=>{if(!r&&g==="Not-Started"&&h!=null)switch(p(!0),e){case"zeni_accounts":n(me(h,!0));break;case"zeni_treasury":n(Ce(h,!0));break;case"reimbursement":n(pe(h,!0));break;case"charge_cards":n(le(h,!0));break;default:n($(h,!0))}},[r,g,h,n]),T.getSignedInUser()==null)throw Error("Can't access business verification without signing in...");let D;switch(e){case"zeni_accounts":D=I.companyZeniAccountInfo?.info?.isZeniAccountTOSAccepted;break;case"reimbursement":D=I.companyReimbursementInfo?.info?.isReimbursementTOSAccepted;break;case"charge_cards":D=I.companyChargeCardInfo?.info?.isChargeCardTOSAccepted===!0||I.companyDebitCardInfo?.info?.isDebitCardTOSAccepted;break;case"zeni_treasury":D=I.companyTreasuryInfo?.info?.isTreasuryTOSAccepted;break;default:D=I.companyBillPayInfo?.info?.isBillPayTOSAccepted}const k=_(m=>{let v;switch(e){case"zeni_accounts":v=wn(m,h);break;case"zeni_treasury":v=He(m,h);break;case"charge_cards":v=En(m,h);break;case"reimbursement":v=vn(m,h);break;default:v=_n(m,h)}return v});return D===!1?null:k.fetchState==="Completed"&&D===!0&&A?.loggedInUserRoleMap!=null?u.jsxs(u.Fragment,{children:[u.jsx(oe,{analytics:U,onLoad:m=>(v=>{switch(e){case"zeni_accounts":return v.trackPageLoaded(G.Event.zeniAccountsBusinessVerification);case"reimbursement":case"charge_cards":return v.trackPageLoaded(G.Event.reimbursementBusinessVerification);default:return v.trackPageLoaded(G.Event.billPayBusinessVerification,Be(c)?"Settings":void 0)}})(m)}),u.jsx(St,{businessVerificationDetails:k,navigate:a,location:c,companyId:h,analytics:U,currentTenant:I,productType:e,roleMap:A.loggedInUserRoleMap,isSettings:Be(c),isOverlay:!0,isStepInProgress:l!=null,isTreasuryTransferInitiated:s!=null,onClickMenuIcon:()=>{},maxInsuredAmount:P.maxInsuredAmount,isBusinessVerificationDrawerOpen:o,closeDrawerHandler:t})]}):u.jsx(Ue,{fetchState:"In-Progress",style:{backgroundColor:y.colors.grey5}})},ht={overlayWidth:new Yn(100,100,59)},Ct=H(function(e,o){const{isUserZeniAccountsAdmin:t,companyId:a,accountsPromoConfig:c}=o,n=V(e),i=T.getSignedInUser(),l=n.tenantId,s={userId:i?.userId??"",sessionId:i?.zeniSessionId??"",tenantId:l??""},r=Qe(e,a),p=He(e,a),f=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",A=Rn(e),d=A.transactions,y=Ke(e),b=A.accountSummary?.totalBalance?.amount,P=d.length===0||b===0;return{treasurySetupView:r,businessVerificationDetails:p,connectedAccountProvider:n.company?.featuresActivationInfo.connectedAccountProvider??"",transactions:d,transferDetails:y,isFirstTransfer:P,isDisabled:f,meetingUrl:"https://meetings.hubspot.com/niharn/demo-accounts?embed=true",analytics:U,filesEndPoint:`${ce.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(Ln(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(ve(!1,s,"zeni_treasury","treasury_setup",r))},onEstablishConnectionSuccess:()=>{e(Ce(a,!0))},onEnableTreasuryClick:()=>{e(J(a,"zeni_treasury"))},onUpdateTreasuryClick:(s,r,p)=>{e(p==="paymentAccount"?Pe(s,r,"zeni_treasury","treasury_setup"):_e("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(L(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(ae({files:s}))},onDeleteFile:s=>{e(te(s))},onEditFileName:(s,r)=>{e(ne(s,r.split(".")[0]))},onAdditionalVerificationFieldsChanged:s=>{const{sourceOfFunds:r}=s;e(Nn({sourceOfFunds:r?.selectedOption??""}))},onUpdateFundAllocation:s=>{i.trackTreasuryAllocationAction("update",Me(s)),e(zn(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(Ve())}}})(et),It=()=>{const e=X(),o=Y(),t=ee(),a=Te(),c=Xn(),{tenantEmailDomain:n}=W(),{useDynamicConfig:i}=se(),l=ie(),[s,r]=C.useState(!1),p=Ie(l?.loggedInUserRoleMap),{configValue:f}=i(Q.zeniAccountsConfig),A=ye(f),[d,y]=C.useState(!1),[b,P]=C.useState(!1),[g,S]=C.useState(!1),[w,I]=C.useState(!1),[h,D]=C.useState(!1),k=_(O=>O.treasurySetupViewState.fetchState),m=_(O=>O.treasurySetupViewState.treasuryFundsDetails?.fetchStatus?.fetchState),v=_(O=>O.treasurySetupViewState.currentAllocation.fetchStatus?.fetchState),R=_(O=>O.treasuryDetailState.transactionsState?.fetchState),F=_(O=>V(O)),E=T.getSignedInUserTenant(n)?.companyId??F.companyId,z=_(O=>Qe(O,E)),K=z.isAtomicAccountExists,ge=!!F.companyZeniAccountInfo?.info?.isZeniAccountEnabled,q=T.getSignedInUser(),re=O=>{y(O)};if(q==null)throw Error("Can't access treasury setup page without signing in...");C.useEffect(()=>{b||k!=="Not-Started"||E==null||(P(!0),t(Ce(E,!0,!1)))},[b,k,E,t]),C.useEffect(()=>{g||m!=="Not-Started"||E==null||(S(!0),t(xn()))},[g,m,E,t]),C.useEffect(()=>{w||v!=="Not-Started"||E==null||(I(!0),t(Bn()))},[w,v,E,t]),C.useEffect(()=>{h||R!=="Not-Started"||E==null||(D(!0),t(jn(!0)))},[h,R,E,t]);const Z=F.companyTreasuryInfo?.info?.businessVerificationStatus?.code,B=Z==="pending_review"||Z==="verified";return C.useEffect(()=>{s||k!=="Completed"||K||B||!o.pathname.includes("setup")||r(!0)},[k,K,B]),F.companyTreasuryInfo?.info?.isTreasuryTOSAccepted===!1?u.jsx(j,{to:"../promo"}):u.jsxs(u.Fragment,{children:[u.jsx(oe,{analytics:U,onLoad:()=>{}}),u.jsx(fe,{isAppContentDrawerOpen:d,handleDrawerToggle:re}),u.jsx(it,{onClose:()=>{t(Ve()),e("../setup")},anchor:"right",open:o.pathname.includes("verification"),transitionDuration:s?0:250,PaperProps:{style:{width:ht.overlayWidth.valuePercentage(c),boxShadow:"none"}},slotProps:{backdrop:{style:{backgroundColor:s?"transparent":a.colors.black,opacity:.75,cursor:"pointer"}}},children:u.jsx(At,{onClick:O=>O.stopPropagation(),children:u.jsx(bt,{productType:"zeni_treasury",isBusinessVerificationDrawerOpen:!0,closeDrawerHandler:()=>{t(Ve()),e("../setup")}})})}),u.jsx(Ct,{navigate:e,location:o,companyId:E,currentTenant:F,isUserZeniAccountsAdmin:p,accountsPromoConfig:A,isAccountsEnabled:ge,isAllocationDone:K,analytics:U,treasurySetupView:z,onClickMenuIcon:()=>{re(!0)},showTreasurySetupOverlay:s,setShowTreasurySetupOverlay:r})]})},At=xe(st)`
17
+ `,ft=H(function(e,o){const{isUserRemiAdmin:t,companyId:a}=o,c=V(e),n=hn(e),i=Cn(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",f=!!c.companyZeniAccountInfo?.info?.isZeniAccountEnabled;return{remiSetupView:i,isDisabled:p,remiApprovalView:n,connectedAccountProvider:c.company?.featuresActivationInfo.connectedAccountProvider??"",isAccountsEnabled:f,meetingUrl:"https://meetings.hubspot.com/niharn/demo-reimbursements?embed=true",analytics:U,filesEndPoint:`${ce.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:f,mileageAmountInDenomination:A,description:d}=n;e(An({mileageDetails:{mileageUnitAmount:{amount:i,currencyCode:s,currencySymbol:r},denomination:p,denominationSymbol:f,mileageAmountInDenomination:A,mileageCurrencyCode:s,mileageCurrencySymbol:r,mileageUnit:l,description:d}}))},onSaveMileageClick:n=>{e(In(a)),U.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(Te("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(ve(!1,n,"reimbursement","reimbursement_setup",i))},onEstablishConnectionSuccess:()=>{e(pe(a,!0))},onEnableRemiClick:()=>{e(J(a,"reimbursement"))},onUpdateAccountClick:(n,i,l)=>{e(l==="paymentAccount"?Pe(n,i,"reimbursement","reimbursement_setup"):_e("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(L(a,n,"reimbursement",!0,!0,!0))},updateFilesEntity:n=>{e(ae({files:n}))},onDeleteFile:n=>{e(te(n))},onEditFileName:(n,i)=>{e(ne(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")}}})(Jn),gt=()=>{const e=Q(),o=X(),t=ee(),{tenantEmailDomain:a}=W(),c=ie(),{useDynamicConfig:n}=se(),i=De(),{configValue:l}=n(Y.zeniAccountsConfig),s=ye(l),r=Sn(c?.loggedInUserRoleMap),p=Ie(c?.loggedInUserRoleMap),[f,A]=C.useState(!1),d=C.useRef(!1),[y,b]=C.useState(!1),P=_(m=>m.remiSetupViewState.fetchState),g=_(m=>V(m)),S=_(m=>m.remiSetupApproverViewState.fetchState),{isApprovalRulesV3Enabled:w,isLoading:I}=Qe(g?.tenantId),h=D.getSignedInUserTenant(a)?.companyId??g.companyId,T=D.getSignedInUser(),k=m=>{A(m)};if(T==null)throw Error("Can't access reimbursement setup page without signing in...");if(C.useEffect(()=>{d.current||P!=="Not-Started"||h==null?d.current||P!=="Completed"||h==null||g.companyBillPayInfo?.info?.businessVerificationStatus?.code!=="pending_review"||(d.current=!0,t(pe(h,!1,!0))):(d.current=!0,t(pe(h,!0)))},[P,h,t]),C.useEffect(()=>{y||S!=="Not-Started"||I||(b(!0),t(bn(!0,!1,!1,w)))},[y,S,I,w,t]),g.companyReimbursementInfo?.info?.isReimbursementTOSAccepted===!1)return u.jsx(j,{to:"../promo"});if(g.companyReimbursementInfo?.info?.isReimbursementTOSAccepted===!0){const m=v=>v.trackPageLoaded(G.Event.reimbursementSetup);return u.jsxs(yt,{children:[u.jsx(oe,{analytics:U,onLoad:v=>m(v)}),u.jsx(fe,{isAppContentDrawerOpen:f,handleDrawerToggle:k}),u.jsx(ft,{navigate:e,location:o,companyId:h,currentTenant:g,isUserRemiAdmin:r,onClickMenuIcon:()=>{k(!0)},hasZeniAccountsAdminAccess:p,accountsPromoConfig:s})]})}return u.jsx(Ue,{fetchState:"In-Progress",style:{backgroundColor:i.colors.grey5}})},St=H(function(e,o){const{businessVerificationDetails:t,productType:a}=o,c=V(e),n=D.getSignedInUser(),i=c.tenantId,l={userId:n?.userId??"",sessionId:n?.zeniSessionId??"",tenantId:i??""},s=Tn(o.roleMap)&&t.updateStatus.fetchState!=="In-Progress"?void 0:"readonly",r=Dn(e.companyConfigState),p=Un(e.userRoleConfigState),f=a==="zeni_treasury"?Ke(e):void 0;return{businessVerificationDetails:t,verficationDetailsFetchState:t.fetchState,isRefreshingViewInBackground:t.isRefreshingViewInBackground,allNationalityCountries:t.allNationalityCountries,filesEndPoint:`${ce.fileMicroServiceBaseUrl}`,authParams:l,isDisabled:s,allIndustries:r.companyIndustries??[],companyTitles:p.companyTitles,transferDetails:f}},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:f,companyLegalName:A,companyTaxId:d,companyWebsite:y,companyPhone:b,primaryContactEmail:P,primaryContactName:g,primaryContactUserId:S,primaryContactSyncToken:w,syncToken:I,fileIds:h,incDate:T,typeOfIncorporation:k,stateOfIncorporation:m,sourceOfFunds:v,companySubIndustry:R,countriesOfOperations:F,companySourceOfFunds:E,companySourceOfFundsDescription:N,transactionVolume:K,transactionVolumeDescription:ge,purposeOfAccount:q,purposeOfAccountDescription:re,regulatedStatus:Z,regulatedStatusDescription:x,usNexus:O,usNexusTypes:Oe}=s,Se=f?.selectedOption,be={companyId:t,companyDescription:r,companyIndustry:p.selectedOption,companyIndustryType:Se==null||Se===""?void 0:Se,companyLegalName:A,taxIdOrEIN:d,website:y!=""&&y!=null?Vn(y):void 0,phone:b,syncToken:I,fileIds:h,incDate:T!=null?je(T?.toString()):T,typeOfIncorporation:k?.selectedOption??"",stateOfIncorporation:m?.selectedOption??"",sourceOfFunds:v?.selectedOption??"",companySubIndustry:R?.selectedOption??"",countriesOfOperations:F?.selectedOptions.map(ue=>ue.length===2?ue:Le(ue))??[],companySourceOfFunds:E?.selectedOption??"",companySourceOfFundsDescription:N,transactionVolume:K?.selectedOption??"",transactionVolumeDescription:ge,purposeOfAccount:q?.selectedOption??"",purposeOfAccountDescription:re,regulatedStatus:Z??"",regulatedStatusDescription:x,usNexus:O,usNexusTypes:Oe?.selectedOptions??[]},he={userId:S,firstName:g.firstName,lastName:g.lastName,email:P,syncToken:w};e(Re({companyDetails:be,primaryContactDetails:he}))},onCompanyOfficerUpdated:s=>{const r=s.map(p=>{const{officerType:f,userId:A,name:d,email:y,nationalityCountryCode:b,ssn:P,dob:g,phone:S,syncToken:w,selectDocument:I,role:h,ownership:T,isSelectedForVerification:k,userVerificationStatus:m,treasuryUserVerificationStatus:v,fileIds:R}=p;let F;return I.selectDocumentType==="driverLicense"?F="driving_license":I.selectDocumentType==="passport"?F="passport":I.selectDocumentType==="stateId"?F="id_document":I.selectDocumentType==="ssnCard"&&(F="social_security_card"),{officerType:f,userId:A,firstName:d.firstName,lastName:d.lastName,email:y,ssn:P,nationalityCountryCode:b?.selectedOption!=null?Le(b.selectedOption):void 0,phone:S,birthday:g!=null?je(g?.toString()):g,syncToken:w,titleAtCompany:h.selectedOption,ownershipInCompany:T,documentTypeSelectedForVerification:F,isSelectedForVerification:k,userVerificationStatus:m,treasuryUserVerificationStatus:v,fileIds:R,additionalDocumentTypesRequestedForVerification:[],additionalSubmittedDocumentsForVerificationFileIds:[],areAdditionalDocumentsRequestedForVerification:!1,areAdditionalDocumentsSubmittedForVerification:!1}});e(Re({officers:r}))},onSaveDetailsClick:s=>{e(L(t,s,a))},onSendForVerificationClick:s=>{e(L(t,s,a,!0))},onAddressClick:s=>{const r=Ze(l,s),p=ze(i.state?.pathnameStackToGoBack,i.pathname),f=new URLSearchParams(i.search),A={};f.forEach((d,y)=>{A[y]=d}),n(r,{state:{pathnameStackToGoBack:p,queryParams:Object.keys(A).length>0?A:void 0}})},onRegisteredAddressClick:s=>{const r=Ze(l,s),p=ze(i.state?.pathnameStackToGoBack,i.pathname),f=new URLSearchParams(i.search),A=Object.fromEntries(f.entries());n(r,{state:{pathnameStackToGoBack:p,queryParams:Object.keys(A).length>0?A:void 0}})},onBackClick:()=>{e(Fn({companyId:t})),n("../setup")},updateFilesEntity:s=>{e(ae({files:s}))},onDeleteFile:s=>{e(te(s))},onDeleteFileList:s=>{e(Je(s))},onEditFileName:(s,r)=>{e(ne(s,r.split(".")[0]))},onGetOtp:s=>{e(We(s,"SpendManagementSetup"))},onResendOtp:s=>{e(Ge(s,"SpendManagementSetup"))},onVerifyOtp:(s,r)=>{e($e(s,r,"SpendManagementSetup"))},saveNewAddressInLocalStore:(s,r)=>{e(On({addressType:s,addressToCreate:r}))},onExecuteTreasuryTransfer:()=>{e(qe())},onOverlayClose:()=>{e(Ve())}}})(Yn),bt=({productType:e,isBusinessVerificationDrawerOpen:o,closeDrawerHandler:t})=>{const a=Q(),c=X(),n=ee(),[i]=Xe(),l=i.get("showStepProgress"),s=i.get("isTransferInitiated"),[r,p]=C.useState(!1),{tenantEmailDomain:f}=W(),A=ie(),{useDynamicConfig:d}=se(),y=De(),{configValue:b}=d(Y.zeniAccountsConfig),P=ye(b),g=_(m=>{switch(e){case"zeni_accounts":return m.zeniAccountSetupViewState.fetchState;case"reimbursement":return m.remiSetupViewState.fetchState;case"charge_cards":return m.chargeCardSetupViewState.fetchState;case"zeni_treasury":return m.treasurySetupViewState.fetchState;default:return m.billPaySetupViewState.fetchState}}),S=_(m=>m.companyConfigState.fetchState),w=_(m=>m.userRoleConfigState.fetchState),I=_(m=>V(m)),h=I.companyId??D.getSignedInUserTenant(f)?.companyId;if(C.useEffect(()=>{S==="Not-Started"&&n(kn()),w==="Not-Started"&&n(Pn(!0))},[S,w,n]),C.useEffect(()=>{if(!r&&g==="Not-Started"&&h!=null)switch(p(!0),e){case"zeni_accounts":n(me(h,!0));break;case"zeni_treasury":n(Ce(h,!0));break;case"reimbursement":n(pe(h,!0));break;case"charge_cards":n(le(h,!0));break;default:n($(h,!0))}},[r,g,h,n]),D.getSignedInUser()==null)throw Error("Can't access business verification without signing in...");let T;switch(e){case"zeni_accounts":T=I.companyZeniAccountInfo?.info?.isZeniAccountTOSAccepted;break;case"reimbursement":T=I.companyReimbursementInfo?.info?.isReimbursementTOSAccepted;break;case"charge_cards":T=I.companyChargeCardInfo?.info?.isChargeCardTOSAccepted===!0||I.companyDebitCardInfo?.info?.isDebitCardTOSAccepted;break;case"zeni_treasury":T=I.companyTreasuryInfo?.info?.isTreasuryTOSAccepted;break;default:T=I.companyBillPayInfo?.info?.isBillPayTOSAccepted}const k=_(m=>{let v;switch(e){case"zeni_accounts":v=wn(m,h);break;case"zeni_treasury":v=He(m,h);break;case"charge_cards":v=En(m,h);break;case"reimbursement":v=vn(m,h);break;default:v=_n(m,h)}return v});return T===!1?null:k.fetchState==="Completed"&&T===!0&&A?.loggedInUserRoleMap!=null?u.jsxs(u.Fragment,{children:[u.jsx(oe,{analytics:U,onLoad:m=>(v=>{switch(e){case"zeni_accounts":return v.trackPageLoaded(G.Event.zeniAccountsBusinessVerification);case"reimbursement":case"charge_cards":return v.trackPageLoaded(G.Event.reimbursementBusinessVerification);default:return v.trackPageLoaded(G.Event.billPayBusinessVerification,xe(c)?"Settings":void 0)}})(m)}),u.jsx(St,{businessVerificationDetails:k,navigate:a,location:c,companyId:h,analytics:U,currentTenant:I,productType:e,roleMap:A.loggedInUserRoleMap,isSettings:xe(c),isOverlay:!0,isStepInProgress:l!=null,isTreasuryTransferInitiated:s!=null,onClickMenuIcon:()=>{},maxInsuredAmount:P.maxInsuredAmount,isBusinessVerificationDrawerOpen:o,closeDrawerHandler:t})]}):u.jsx(Ue,{fetchState:"In-Progress",style:{backgroundColor:y.colors.grey5}})},ht={overlayWidth:new Xn(100,100,59)},Ct=H(function(e,o){const{isUserZeniAccountsAdmin:t,companyId:a,accountsPromoConfig:c}=o,n=V(e),i=D.getSignedInUser(),l=n.tenantId,s={userId:i?.userId??"",sessionId:i?.zeniSessionId??"",tenantId:l??""},r=Ye(e,a),p=He(e,a),f=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",A=Rn(e),d=A.transactions,y=Ke(e),b=A.accountSummary?.totalBalance?.amount,P=d.length===0||b===0;return{treasurySetupView:r,businessVerificationDetails:p,connectedAccountProvider:n.company?.featuresActivationInfo.connectedAccountProvider??"",transactions:d,transferDetails:y,isFirstTransfer:P,isDisabled:f,meetingUrl:"https://meetings.hubspot.com/niharn/demo-accounts?embed=true",analytics:U,filesEndPoint:`${ce.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(Ln(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(Te("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(ve(!1,s,"zeni_treasury","treasury_setup",r))},onEstablishConnectionSuccess:()=>{e(Ce(a,!0))},onEnableTreasuryClick:()=>{e(J(a,"zeni_treasury"))},onUpdateTreasuryClick:(s,r,p)=>{e(p==="paymentAccount"?Pe(s,r,"zeni_treasury","treasury_setup"):_e("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(L(a,s,"zeni_treasury",!0,!0,!0)),!n){const p=l.fundAllocationLocalData;i.trackTreasuryPortfolioConfirm(p.riskScore,Me(p)),e(Ne(!1))}r===!0&&e(qe())},updateFilesEntity:s=>{e(ae({files:s}))},onDeleteFile:s=>{e(te(s))},onEditFileName:(s,r)=>{e(ne(s,r.split(".")[0]))},onAdditionalVerificationFieldsChanged:s=>{const{sourceOfFunds:r}=s;e(zn({sourceOfFunds:r?.selectedOption??""}))},onUpdateFundAllocation:s=>{i.trackTreasuryAllocationAction("update",Me(s)),e(Nn(s))},onConfirmFundAllocation:()=>{e(Ne(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(Ve())}}})(et),It=()=>{const e=Q(),o=X(),t=ee(),a=De(),c=Qn(),{tenantEmailDomain:n}=W(),{useDynamicConfig:i}=se(),l=ie(),[s,r]=C.useState(!1),p=Ie(l?.loggedInUserRoleMap),{configValue:f}=i(Y.zeniAccountsConfig),A=ye(f),[d,y]=C.useState(!1),[b,P]=C.useState(!1),[g,S]=C.useState(!1),[w,I]=C.useState(!1),[h,T]=C.useState(!1),k=_(O=>O.treasurySetupViewState.fetchState),m=_(O=>O.treasurySetupViewState.treasuryFundsDetails?.fetchStatus?.fetchState),v=_(O=>O.treasurySetupViewState.currentAllocation.fetchStatus?.fetchState),R=_(O=>O.treasuryDetailState.transactionsState?.fetchState),F=_(O=>V(O)),E=D.getSignedInUserTenant(n)?.companyId??F.companyId,N=_(O=>Ye(O,E)),K=N.isAtomicAccountExists,ge=!!F.companyZeniAccountInfo?.info?.isZeniAccountEnabled,q=D.getSignedInUser(),re=O=>{y(O)};if(q==null)throw Error("Can't access treasury setup page without signing in...");C.useEffect(()=>{b||k!=="Not-Started"||E==null||(P(!0),t(Ce(E,!0,!1)))},[b,k,E,t]),C.useEffect(()=>{g||m!=="Not-Started"||E==null||(S(!0),t(Bn()))},[g,m,E,t]),C.useEffect(()=>{w||v!=="Not-Started"||E==null||(I(!0),t(xn()))},[w,v,E,t]),C.useEffect(()=>{h||R!=="Not-Started"||E==null||(T(!0),t(jn(!0)))},[h,R,E,t]);const Z=F.companyTreasuryInfo?.info?.businessVerificationStatus?.code,x=Z==="pending_review"||Z==="verified";return C.useEffect(()=>{s||k!=="Completed"||K||x||!o.pathname.includes("setup")||r(!0)},[k,K,x]),F.companyTreasuryInfo?.info?.isTreasuryTOSAccepted===!1?u.jsx(j,{to:"../promo"}):u.jsxs(u.Fragment,{children:[u.jsx(oe,{analytics:U,onLoad:()=>{}}),u.jsx(fe,{isAppContentDrawerOpen:d,handleDrawerToggle:re}),u.jsx(it,{onClose:()=>{t(Ve()),e("../setup")},anchor:"right",open:o.pathname.includes("verification"),transitionDuration:s?0:250,PaperProps:{style:{width:ht.overlayWidth.valuePercentage(c),boxShadow:"none"}},slotProps:{backdrop:{style:{backgroundColor:s?"transparent":a.colors.black,opacity:.75,cursor:"pointer"}}},children:u.jsx(At,{onClick:O=>O.stopPropagation(),children:u.jsx(bt,{productType:"zeni_treasury",isBusinessVerificationDrawerOpen:!0,closeDrawerHandler:()=>{t(Ve()),e("../setup")}})})}),u.jsx(Ct,{navigate:e,location:o,companyId:E,currentTenant:F,isUserZeniAccountsAdmin:p,accountsPromoConfig:A,isAccountsEnabled:ge,isAllocationDone:K,analytics:U,treasurySetupView:N,onClickMenuIcon:()=>{re(!0)},showTreasurySetupOverlay:s,setShowTreasurySetupOverlay:r})]})},At=Be(st)`
18
18
  display: flex;
19
19
  min-height: 100%;
20
20
  flex-direction: column;
21
- `,kt=H(function(e,o){const{isUserZeniAccountsAdmin:t,companyId:a}=o,c=V(e),n=T.getSignedInUser(),i=c.tenantId,l={userId:n?.userId??"",sessionId:n?.zeniSessionId??"",tenantId:i??""},s=Mn(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:U,filesEndPoint:`${ce.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(ve(!1,n,"zeni_accounts","account_setup",i))},onEstablishConnectionSuccess:()=>{e(me(a,!0))},onEnableZeniAccountClick:()=>{e(J(a,"zeni_accounts"))},onUpdateZeniAccountClick:(n,i,l)=>{e(l==="paymentAccount"?Pe(n,i,"zeni_accounts","account_setup"):_e("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(L(a,n,"zeni_accounts",!0,!0,!0))},updateFilesEntity:n=>{e(ae({files:n}))},onDeleteFile:n=>{e(te(n))},onEditFileName:(n,i)=>{e(ne(n,i.split(".")[0]))}}})(nt),Pt=()=>{const e=X(),o=Y(),t=ee(),{tenantEmailDomain:a}=W(),{useDynamicConfig:c}=se(),n=ie(),i=Ie(n?.loggedInUserRoleMap),{configValue:l}=c(Q.zeniAccountsConfig),s=ye(l),[r,p]=C.useState(!1),[f,A]=C.useState(!1),d=_(S=>S.zeniAccountSetupViewState.fetchState),y=_(S=>V(S)),b=T.getSignedInUserTenant(a)?.companyId??y.companyId,P=T.getSignedInUser(),g=S=>{p(S)};if(P==null)throw Error("Can't access zeni bank account setup page without signing in...");if(C.useEffect(()=>{f||d!=="Not-Started"||b==null?f||d!=="Completed"||b==null||y.companyBillPayInfo?.info?.businessVerificationStatus?.code!=="pending_review"||t(me(b,!1,!0)):(A(!0),t(me(b,!0)))},[f,d,b,t]),y.companyZeniAccountInfo?.info?.isZeniAccountTOSAccepted===!1)return u.jsx(j,{to:"../promo"});{const S=w=>w.trackPageLoaded(G.Event.zeniAccountsSetup);return u.jsxs(u.Fragment,{children:[u.jsx(oe,{analytics:U,onLoad:w=>S(w)}),u.jsx(fe,{isAppContentDrawerOpen:r,handleDrawerToggle:g}),u.jsx(kt,{navigate:e,location:o,companyId:b,currentTenant:y,isUserZeniAccountsAdmin:i,accountsPromoConfig:s,onClickMenuIcon:()=>{g(!0)}})]})}},_t=xe.div`
21
+ `,kt=H(function(e,o){const{isUserZeniAccountsAdmin:t,companyId:a}=o,c=V(e),n=D.getSignedInUser(),i=c.tenantId,l={userId:n?.userId??"",sessionId:n?.zeniSessionId??"",tenantId:i??""},s=Mn(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:U,filesEndPoint:`${ce.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(Te("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(ve(!1,n,"zeni_accounts","account_setup",i))},onEstablishConnectionSuccess:()=>{e(me(a,!0))},onEnableZeniAccountClick:()=>{e(J(a,"zeni_accounts"))},onUpdateZeniAccountClick:(n,i,l)=>{e(l==="paymentAccount"?Pe(n,i,"zeni_accounts","account_setup"):_e("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(L(a,n,"zeni_accounts",!0,!0,!0))},updateFilesEntity:n=>{e(ae({files:n}))},onDeleteFile:n=>{e(te(n))},onEditFileName:(n,i)=>{e(ne(n,i.split(".")[0]))}}})(nt),Pt=()=>{const e=Q(),o=X(),t=ee(),{tenantEmailDomain:a}=W(),{useDynamicConfig:c}=se(),n=ie(),i=Ie(n?.loggedInUserRoleMap),{configValue:l}=c(Y.zeniAccountsConfig),s=ye(l),[r,p]=C.useState(!1),[f,A]=C.useState(!1),d=_(S=>S.zeniAccountSetupViewState.fetchState),y=_(S=>V(S)),b=D.getSignedInUserTenant(a)?.companyId??y.companyId,P=D.getSignedInUser(),g=S=>{p(S)};if(P==null)throw Error("Can't access zeni bank account setup page without signing in...");if(C.useEffect(()=>{f||d!=="Not-Started"||b==null?f||d!=="Completed"||b==null||y.companyBillPayInfo?.info?.businessVerificationStatus?.code!=="pending_review"||t(me(b,!1,!0)):(A(!0),t(me(b,!0)))},[f,d,b,t]),y.companyZeniAccountInfo?.info?.isZeniAccountTOSAccepted===!1)return u.jsx(j,{to:"../promo"});{const S=w=>w.trackPageLoaded(G.Event.zeniAccountsSetup);return u.jsxs(u.Fragment,{children:[u.jsx(oe,{analytics:U,onLoad:w=>S(w)}),u.jsx(fe,{isAppContentDrawerOpen:r,handleDrawerToggle:g}),u.jsx(kt,{navigate:e,location:o,companyId:b,currentTenant:y,isUserZeniAccountsAdmin:i,accountsPromoConfig:s,onClickMenuIcon:()=>{g(!0)}})]})}},_t=Be.div`
22
22
  display: flex;
23
23
  height: 100vh;
24
24
  width: 100%;
@@ -26,4 +26,4 @@ import{j as u}from"./liveblocks-BLlSTcoD.js";import{h as X,g as Y,u as ee,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=V(e),a=T.getSignedInUser(),c=t.tenantId,n={userId:a?.userId??"",sessionId:a?.zeniSessionId??"",tenantId:c??""};return{internationalOnboardingDetails:Gn(e),isReadonly:o.isFormReadonly,filesEndPoint:`${ce.fileMicroServiceBaseUrl}`,authParams:n,analytics:U}},function(e,o){const{navigate:t}=o;return{onFormDataChange:a=>{e(Hn(a))},onSubmitClick:()=>{e(Wn(o.companyId))},onCancelClick:()=>{t("../setup")},updateFilesEntity:a=>{e(ae({files:a}))},onDeleteFile:a=>{e(te(a))},onDeleteFileList:a=>{e(Je(a))},onEditFileName:(a,c)=>{e(ne(a,c.split(".")[0]))}}})(tt),Et=()=>{const e=X(),o=Y(),t=ee(),[a,c]=C.useState(!1),[n,i]=C.useState(!1),[l,s]=C.useState(!1),{tenantEmailDomain:r}=W(),p=ie(),{useFeatureGate:f}=se(),{isFeatureEnabled:A}=f(de.isBillPayLocalCurrencyFeatureEnabled),d=_(k=>k.internationalWireVerificationState.verificationFormFetchState.fetchState),y=_(k=>k.billPaySetupViewState.fetchState),b=_(k=>V(k)),P=Te(),g=b.companyId??T.getSignedInUserTenant(r)?.companyId,S=_(k=>Zn(k.companyState,b.companyId)),w=S?.company.companyBillPayInfo.internationalWireOnboardingStatus,I=w?.code==="onboarding_status_not_started"?void 0:"readonly";if(C.useEffect(()=>{a||d!=="Not-Started"||g==null||(c(!0),t($n(g)))},[a,d,g,t]),C.useEffect(()=>{n||y!=="Not-Started"||g==null||(i(!0),t($(g,!0)))},[y,n,g,t]),T.getSignedInUser()==null)throw Error("Can't access international verification without signing in...");const h=b.companyBillPayInfo?.info?.isBillPayTOSAccepted,D=k=>{s(k)};return h===!1?u.jsx(j,{to:"../promo"}):h===!0&&p?.loggedInUserRoleMap!=null?u.jsxs(_t,{children:[u.jsx(oe,{analytics:U,onLoad:k=>(m=>m.trackPageLoaded(G.Event.billPayBusinessVerification,void 0))(k)}),Be(o)?u.jsx(fe,{isAppContentDrawerOpen:l,handleDrawerToggle:D}):null,u.jsx(vt,{navigate:e,location:o,companyId:g,analytics:U,currentTenant:b,roleMap:p.loggedInUserRoleMap,isFormReadonly:I,isLocalCurrencyEnabled:A})]}):u.jsx(Ue,{fetchState:"In-Progress",style:{backgroundColor:P.colors.grey5}})},wt=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($(t,!0,!0))}}}}})(at(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(Fe,{productType:s}):t?u.jsx(j,{to:"../"}):u.jsx(N,{});case"international-wire":return o?u.jsx(Et,{}):t?u.jsx(j,{to:"../"}):u.jsx(N,{});default:return o?u.jsx(rt,{}):t?u.jsx(j,{to:"../"}):u.jsx(N,{})}case"reimbursement":return r==="verification"?a?u.jsx(Fe,{productType:s}):u.jsx(N,{}):a?u.jsx(gt,{}):u.jsx(N,{});case"zeni_accounts":return r==="verification"?c?u.jsx(Fe,{productType:"zeni_accounts"}):u.jsx(N,{}):c?u.jsx(Pt,{}):u.jsx(N,{});case"zeni_treasury":return n===!0?u.jsx(It,{}):u.jsx(N,{});case"charge_cards":return r==="verification"?i?u.jsx(Fe,{productType:"charge_cards"}):l?u.jsx(j,{to:"../"}):u.jsx(N,{}):i?u.jsx(mt,{}):l?u.jsx(j,{to:"../"}):u.jsx(N,{})}}));function ta(e){const{tenantEmailDomain:o}=W(),t=_(c=>V(c)).companyId??T.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(T.getSignedInUser()==null)throw Error("Can't access setup details page without signing in...");return u.jsx(wt,{...e,companyId:t,...a})}export{Qt as A,Xt as P,ta as S,Kt as a,Jt as b,dt as c,lt as d,ut as e,Yt as f,$t as g,Lt as h,Ht as i,qt as j,ea as k,Wt as l,Gt as m,Mt as n,Zt as o,Nt as p,na as s};
29
+ `,vt=H(function(e,o){const t=V(e),a=D.getSignedInUser(),c=t.tenantId,n={userId:a?.userId??"",sessionId:a?.zeniSessionId??"",tenantId:c??""};return{internationalOnboardingDetails:Gn(e),isReadonly:o.isFormReadonly,filesEndPoint:`${ce.fileMicroServiceBaseUrl}`,authParams:n,analytics:U}},function(e,o){const{navigate:t}=o;return{onFormDataChange:a=>{e(Hn(a))},onSubmitClick:()=>{e(Wn(o.companyId))},onCancelClick:()=>{t("../setup")},updateFilesEntity:a=>{e(ae({files:a}))},onDeleteFile:a=>{e(te(a))},onDeleteFileList:a=>{e(Je(a))},onEditFileName:(a,c)=>{e(ne(a,c.split(".")[0]))}}})(tt),Et=()=>{const e=Q(),o=X(),t=ee(),[a,c]=C.useState(!1),[n,i]=C.useState(!1),[l,s]=C.useState(!1),{tenantEmailDomain:r}=W(),p=ie(),{useFeatureGate:f}=se(),{isFeatureEnabled:A}=f(de.isBillPayLocalCurrencyFeatureEnabled),d=_(k=>k.internationalWireVerificationState.verificationFormFetchState.fetchState),y=_(k=>k.billPaySetupViewState.fetchState),b=_(k=>V(k)),P=De(),g=b.companyId??D.getSignedInUserTenant(r)?.companyId,S=_(k=>Zn(k.companyState,b.companyId)),w=S?.company.companyBillPayInfo.internationalWireOnboardingStatus,I=w?.code==="onboarding_status_not_started"?void 0:"readonly";if(C.useEffect(()=>{a||d!=="Not-Started"||g==null||(c(!0),t($n(g)))},[a,d,g,t]),C.useEffect(()=>{n||y!=="Not-Started"||g==null||(i(!0),t($(g,!0)))},[y,n,g,t]),D.getSignedInUser()==null)throw Error("Can't access international verification without signing in...");const h=b.companyBillPayInfo?.info?.isBillPayTOSAccepted,T=k=>{s(k)};return h===!1?u.jsx(j,{to:"../promo"}):h===!0&&p?.loggedInUserRoleMap!=null?u.jsxs(_t,{children:[u.jsx(oe,{analytics:U,onLoad:k=>(m=>m.trackPageLoaded(G.Event.billPayBusinessVerification,void 0))(k)}),xe(o)?u.jsx(fe,{isAppContentDrawerOpen:l,handleDrawerToggle:T}):null,u.jsx(vt,{navigate:e,location:o,companyId:g,analytics:U,currentTenant:b,roleMap:p.loggedInUserRoleMap,isFormReadonly:I,isLocalCurrencyEnabled:A})]}):u.jsx(Ue,{fetchState:"In-Progress",style:{backgroundColor:P.colors.grey5}})},wt=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($(t,!0,!0))}}}}})(at(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(Fe,{productType:s}):t?u.jsx(j,{to:"../"}):u.jsx(z,{});case"international-wire":return o?u.jsx(Et,{}):t?u.jsx(j,{to:"../"}):u.jsx(z,{});default:return o?u.jsx(rt,{}):t?u.jsx(j,{to:"../"}):u.jsx(z,{})}case"reimbursement":return r==="verification"?a?u.jsx(Fe,{productType:s}):u.jsx(z,{}):a?u.jsx(gt,{}):u.jsx(z,{});case"zeni_accounts":return r==="verification"?c?u.jsx(Fe,{productType:"zeni_accounts"}):u.jsx(z,{}):c?u.jsx(Pt,{}):u.jsx(z,{});case"zeni_treasury":return n===!0?u.jsx(It,{}):u.jsx(z,{});case"charge_cards":return r==="verification"?i?u.jsx(Fe,{productType:"charge_cards"}):l?u.jsx(j,{to:"../"}):u.jsx(z,{}):i?u.jsx(mt,{}):l?u.jsx(j,{to:"../"}):u.jsx(z,{})}}));function ta(e){const{tenantEmailDomain:o}=W(),t=_(c=>V(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(wt,{...e,companyId:t,...a})}export{Yt as A,Qt as P,ta as S,Kt as a,Jt as b,dt as c,lt as d,ut as e,Xt as f,$t as g,Lt as h,Ht as i,qt as j,ea as k,Wt as l,Gt as m,Mt as n,Zt as o,zt as p,na as s};
@@ -0,0 +1 @@
1
+ import{j as f}from"./liveblocks-BUQfB0Zp.js";import{a as u,b as D,q as T}from"./sentry-BLIwU6uZ.js";import{u as A,h as z,j as c,g as M,N as O,n as j}from"./core-OMb8nkC1.js";import{u as F,z as s,m as P,d as w,D as B,e as _,f as N,G as V,g as G,i as $,k as v}from"./index-NcZU0lXl.js";import{eV as q,Lx as J,Ly as W,fw as X,fZ as Y,LD as H,gl as Z,cX as K,LE as b,LF as Q,LG as R,bY as y}from"./zeni-epic-state-BZ6N8nVI.js";import"./mui-JZY-3hhJ.js";import{u as ee}from"./useDeviceId-l9JfwAte.js";import{f as te}from"./analyticsHelper-BU5wlVa9.js";import{t as ne}from"./getLocaleForTenant-Bn16hOPH.js";import"./recharts-DAM4r1-u.js";import"./analytics-BLbM2ksu.js";import"./plaid-B_OuebQv.js";import"./dnd-DVcQZAG5.js";import"./stripe-DMRn4zHo.js";import"./lottie-DDI83OWz.js";import"./lexical-CNfNgAkp.js";import"./pdf-6FZlivdz.js";import"./utils-Bia5qc4p.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]="a63f69ab-1369-4715-a66c-c9c1087d9e02",t._sentryDebugIdIdentifier="sentry-dbid-a63f69ab-1369-4715-a66c-c9c1087d9e02")}catch{}})();const ie=j(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)=>{T({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(R({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(Q(n,a)))},clearSignInError:()=>{t(b())}}})($),ae=D.memo(ie);function ve({setTenantEmailDomain:t}){const i=A(),d=z(),{clearAllLoading:g}=F(),n=s.getSignedInUser();u.useLayoutEffect(()=>{g()},[g]);const a=ee(),l=c(e=>e.tenantState.magicLinkCodeVerifier),{sendEmailMagicLinkFetchState:L,accountLocked:x,accountUnlockTime:k}=c(e=>e.tenantState),p=c(e=>e.tenantState.fetchState),E=c(e=>e.tenantState.activeTenantFetchState.fetchState),S=c(e=>e.tenantState.signInState),o=c(e=>e.tenantState.loggedInUser),r=c(e=>q(e)),I=c(e=>J(e)),m=M(),h=P().mode,C=m.state?.magicLinkExpired,U=m.state?.magicLinkAlreadyUsed;if(u.useEffect(()=>{L.fetchState==="Completed"&&l!=null&&(w.trackSignInLinkSent(),s.saveMagicLinkCodeVerifier(l))},[L.fetchState,l]),u.useEffect(()=>{t(void 0)},[]),u.useEffect(()=>{S!=="In-Progress"||p!=="Completed"&&E!=="Completed"||o?.zeniSessionId==null||r==null||(s.savePayNowInfoTooltip(!0,o.zeniSessionId),s.saveSignedInUserWithSession(o,o.zeniSessionId),s.saveSignedInUserTenants(W(I.tenantsInOrder),o.zeniSessionId),X(o.userId,o.zeniSessionId,r.tenantId),i(Y(r.tenantId)),s.saveActiveTenantDomainForUser(r.tenantEmailDomain),i(H("Completed")),B.updateAppLocaleID(ne(r)),te(o,r,h,void 0,I.tenantsInOrder),Z().then(()=>{const e=G();e!=null&&_(e)}),setTimeout(()=>{w.trackLogin(N.Event.loginSuccess,o.authProvider??"google",K(r.productSettings))},2e3))},[S,p,E,o,r,I,h,m.state,i]),S==="In-Progress"&&p==="Completed"&&o?.zeniSessionId!=null&&r!=null||n!=null){const e=m.state?.origin??"/";return f.jsx(O,{to:e,state:{...m.state,origin:""}})}return f.jsxs(f.Fragment,{children:[f.jsx(ae,{magicLinkExpired:!!C,magicLinkAlreadyUsed:!!U,magicLinkExpiredEmail:s.getMagicLinkEmail()??void 0,location:m,navigate:d,deviceId:a??void 0,showEmailLogin:!0}),x===!0&&k!=null?f.jsx(V,{onClose:()=>i(b()),unlockDate:k}):null]})}export{ve as default};
@@ -0,0 +1,9 @@
1
+ import{j as s}from"./liveblocks-BUQfB0Zp.js";import{a as n}from"./sentry-BLIwU6uZ.js";import{u,g as m,h as g,N as p}from"./core-OMb8nkC1.js";import{z as f,B as b,t as y,d,f as h}from"./index-NcZU0lXl.js";import{gq as x,gr as I,LV as w}from"./zeni-epic-state-BZ6N8nVI.js";import{n as j}from"./mui-JZY-3hhJ.js";import"./recharts-DAM4r1-u.js";import"./analytics-BLbM2ksu.js";import"./plaid-B_OuebQv.js";import"./dnd-DVcQZAG5.js";import"./stripe-DMRn4zHo.js";import"./lottie-DDI83OWz.js";import"./lexical-CNfNgAkp.js";import"./pdf-6FZlivdz.js";import"./utils-Bia5qc4p.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]="29f85011-f1e8-4b83-8d01-6cbeb1adefae",e._sentryDebugIdIdentifier="sentry-dbid-29f85011-f1e8-4b83-8d01-6cbeb1adefae")}catch{}})();function V(){const e=u(),t=m(),i=g(),a=n.useRef(!1),l=f.isSignedIn(),r=t.state?.message==="logout",o=r||l;return n.useEffect(()=>{o&&!a.current&&(a.current=!0,setTimeout(()=>{try{f.clearAll(),e(x()),e(I(!1)),w(),y.reset(),d.trackLogout(h.Event.logoutSuccess),d.resetUserIdentity()}catch(c){console.error("Error during sign out:",c)}finally{r||i("/signin/auth",{replace:!0})}},0))},[o,r]),o?s.jsx(v,{children:s.jsx(b,{fetchState:"In-Progress"})}):s.jsx(p,{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{V as default};
@@ -1,4 +1,4 @@
1
- import{j as u}from"./liveblocks-BLlSTcoD.js";import{a as G}from"./sentry-D_xp3E3Q.js";import{h as _,u as v,g as K,j as b,i as z,n as q}from"./core-CbpoBsNm.js";import{z as F,F as W,x as p,_ as H,A as M,d as O,f as V,d8 as Z,s as g,p as Q}from"./index-aZImxzjX.js";import{eW as J,Th as x,IH as C,Ti as R,Td as X,I3 as y,Tj as Y,Ib as E,Hx as aa,II as S,Tk as B,fw as ea,Iy as ta,ID as sa,Iq as oa,Io as w,IE as na,Il as ia,Tl as la,Tm as ra,Tn as ca,To as ka,Tp as T,ei as da,Tq as ua,Tr as pa}from"./zeni-epic-state-CkeDRiud.js";import{n as Ta}from"./mui-DcNGd9L2.js";import{u as ma}from"./useAskAiCfoHostNavButtonProps-BZImc5qT.js";import{M as ga}from"./MobileAppDrawer-CWBhYKqW.js";import"./recharts-C0aThBg3.js";import"./analytics-CQmVOD4d.js";import"./plaid-B62punae.js";import"./dnd-CX5suNP6.js";import"./stripe-DMRn4zHo.js";import"./lottie-BY8e0Ufw.js";import"./lexical-BS7d_1CV.js";import"./pdf-BslZhgI8.js";import"./utils-BQO84dIV.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]="a31d21cd-eca4-4c21-9745-49e18bf1d6f3",e._sentryDebugIdIdentifier="sentry-dbid-a31d21cd-eca4-4c21-9745-49e18bf1d6f3")}catch{}})();const fa=Ta.div`
1
+ import{j as u}from"./liveblocks-BUQfB0Zp.js";import{a as G}from"./sentry-BLIwU6uZ.js";import{h as U,u as _,g as K,j as b,i as z,n as q}from"./core-OMb8nkC1.js";import{z as F,a as V,F as p,_ as H,E as M,d as O,f as W,d8 as Z,s as g,q as Q}from"./index-NcZU0lXl.js";import{eV as J,Tg as R,IG as C,Th as x,Tc as X,I2 as E,Ti as Y,Ia as y,Hw as aa,IH as S,Tj as B,fv as ea,Ix as ta,IC as sa,Ip as oa,In as w,ID as na,Ik as ia,Tk as la,Tl as ra,Tm as ka,Tn as ca,To as T,eh as da,Tp as ua,Tq as pa}from"./zeni-epic-state-BZ6N8nVI.js";import{n as Ta}from"./mui-JZY-3hhJ.js";import{u as ma}from"./useAskAiCfoHostNavButtonProps-DS5Fxq3U.js";import{M as ga}from"./MobileAppDrawer-B4f1me8_.js";import"./recharts-DAM4r1-u.js";import"./analytics-BLbM2ksu.js";import"./plaid-B_OuebQv.js";import"./dnd-DVcQZAG5.js";import"./stripe-DMRn4zHo.js";import"./lottie-DDI83OWz.js";import"./lexical-CNfNgAkp.js";import"./pdf-6FZlivdz.js";import"./utils-Bia5qc4p.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]="492f170c-a6a1-477d-9cff-7b4958dbd772",e._sentryDebugIdIdentifier="sentry-dbid-492f170c-a6a1-477d-9cff-7b4958dbd772")}catch{}})();const fa=Ta.div`
2
2
  display: flex;
3
3
  min-height: 100%;
4
4
  width: 100%;
@@ -6,4 +6,4 @@ import{j as u}from"./liveblocks-BLlSTcoD.js";import{a as G}from"./sentry-D_xp3E3
6
6
  flex-direction: column;
7
7
  align-items: center;
8
8
  background-color: ${e=>e.theme.colors.grey4};
9
- `,ha=q(function(e,t){const o=x(e,t.isTaskTemplatesEnabled),{taskGroupId:c}=t,n=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,d=X(e),i=F.isZeniUser();return{taskListView:n,tagListView:d,localData:n.localData,isTaskTemplatesEnabled:t.isTaskTemplatesEnabled,isZeniUser:i}},function(e,t){const{navigate:o,currentTenant:c,location:n,isTaskTemplatesEnabled:d}=t,{tenantEmailDomain:i}=c,{groupByKey:l}=t.uiState;return{onTaskManagementRowClick:a=>{const s=L(i,a),k=g(n.state?.pathnameStackToGoBack,n.pathname);o(s,{state:{pathnameStackToGoBack:k}})},onReloadTasks:()=>{e(C(!0,d))},onTabChange:a=>{e(ka(a))},onParentTaskClick:a=>{const s=L(i,a);window.open(s,"_blank","noopener")},bulkUpdateTasks:(a,s)=>{e(w(a,null,s))},onNewTaskClick:()=>{if(t.localData.defaultTaskGroupId!=null){const a=I(i,t.localData.defaultTaskGroupId),s=g(n.state?.pathnameStackToGoBack,n.pathname);o(a,{state:{pathnameStackToGoBack:s,message:"comingFromTaskListPage"}})}},onColumnSortConfigChanged:(a,s)=>{e(B({uiState:{sortKey:a,sortOrder:s}}))},onFiltersChange:a=>{e(ca({filters:a}))},onSearchTextChanged:a=>{e(ra({searchText:a}))},onReloadCards:()=>{e(C(!0,d))},onBackClick:()=>{if(n.state?.message==="triggerBackClick"){const a=Q(n.state?.pathnameStackToGoBack),s=a.poppedPathname??"../";o(s,{state:{pathnameStackToGoBack:a.newStack}})}else o("../")},updateLocalData:a=>{e(la({localData:a}))},resetLocalData:()=>{e(R({taskGroupById:t.taskGroupState.taskGroupById}))},handleCreateGroup:a=>{e(ia(t.localData.newTaskGroupName,a))},assignGroupToTasks:a=>{e(w(t.localData.selectedTaskIds,a,na(t.uiState.groupByKey,a)))},onDeleteTaskGroup:a=>{e(oa(a))},onAddNewTaskToTaskGroup:a=>{if(t.localData.defaultTaskGroupId!=null){const s=Da(l,a);e(y({taskDetailLocalData:s}));const k=I(i,t.uiState.groupByKey==="groupName"?a:t.localData.defaultTaskGroupId),f=g(n.state?.pathnameStackToGoBack,n.pathname);o(k,{state:{pathnameStackToGoBack:f,message:"comingFromTaskListPage"}})}},onDragNDrop:(a,s)=>{e(sa(t.localData.selectedTaskIds.length>0?t.localData.selectedTaskIds:[a],s))},onTaskGroupRename:(a,s)=>{e(ta(a,s))},onTimeSpentUpdate:(a,s)=>{e(S({task:a,updates:s}))},onShowToast:a=>{e(ea(a))},onGroupByFilterChange:a=>{e(B({uiState:{groupByKey:a}}))},updateTask:(a,s)=>{e(S({task:a,updates:s}))},onCreateTagClick:(a,s)=>{e(aa(a,s))},handleGroupTemplateClick:a=>{e(E(a,[]))},handleGroupTemplateTaskClick:(a,s)=>{e(E(a,[s]))},handleNewTaskInitialization:a=>{if(e(y({taskDetailLocalData:{...Y,name:a}})),t.localData.defaultTaskGroupId!=null){const s=I(i,t.localData.defaultTaskGroupId),k=g(n.state?.pathnameStackToGoBack,n.pathname);o(s,{state:{pathnameStackToGoBack:k,message:"comingFromTaskListPage"}})}},onTaskGroupNameClick:a=>{o(`/${i}/tasks/group/${a}`)},onQuickResponsesClick:()=>{o(`/${i}/tasks/quick-responses`)}}})(Z);function Na(){const e=_(),t=v(),o=K(),c=F.getSignedInUser(),n=b(r=>J(r)),{taskGroupId:d}=z(),{useFeatureGate:i}=W(),{isFeatureEnabled:l}=i(p.isTaskTemplatesEnabled),{isFeatureEnabled:a}=i(p.isTaskCannedResponsesEnabled),{isFeatureEnabled:s}=i(p.isTaskCategorizationEnabled),{isFeatureEnabled:k}=i(p.isTaskBulkResolutionEnabled),{isFeatureEnabled:f}=i(p.isTaskGroupAssigneesEnabled),{isFeatureEnabled:A}=i(p.isTaskRecurringParentEnabled),[P,j]=G.useState(!1),h=b(r=>x(r,l)),D=b(r=>r.taskGroupState),m=h.fetchState,{isAiCfoAccessEnabled:$,onAskAiCfoClick:N}=ma({mobileExploreReferrer:"Task Checklist"});if(H({isDataReady:m==="Completed"}),G.useEffect(()=>{t(C(!1,l))},[n?.tenantId,t,l]),G.useEffect(()=>{m==="Completed"&&t(R({taskGroupById:D.taskGroupById}))},[m,D.taskGroupById]),c==null)throw Error("Can't access task list page without signing in...");return u.jsxs(u.Fragment,{children:[m==="Completed"?u.jsx(M,{analytics:O,onLoad:r=>(U=>U.trackPageLoaded(V.Event.taskListPage))(r)}):null,u.jsxs(fa,{children:[u.jsx(ga,{isAppContentDrawerOpen:P,handleDrawerToggle:r=>{j(r)}}),u.jsx(ha,{location:o,navigate:e,currentTenant:n,taskGroupId:d,taskGroupState:D,localData:h.localData,uiState:h.uiState,isTaskTemplatesEnabled:l,taskListFetchState:m,isTaskCategorizationEnabled:s,isTaskCannedResponsesEnabled:a,isTaskBulkResolutionEnabled:k,isTaskGroupAssigneesEnabled:f,isTaskRecurringParentEnabled:A,isAiCfoAccessEnabled:$,onAskAiCfoClick:N})]})]})}const L=(e,t)=>`/${e}/tasks/${encodeURIComponent(t)}`,I=(e,t)=>`/${e}/tasks/new/${t}`,Da=(e,t)=>{if(e==="assignee"){const o=t.split(",");return{...T.taskDetailLocalData,assignee:o}}if(e==="priority"){const o=da(t);return{...T.taskDetailLocalData,priority:o}}if(e==="status"){const o=ua(t);return{...T.taskDetailLocalData,status:o}}if(e==="tag"){const o=t.split(",");return{...T.taskDetailLocalData,tagIds:o}}if(e==="dueDate"){const o=pa(t);return{...T.taskDetailLocalData,dueDate:o}}return{...T.taskDetailLocalData}};export{Na as default};
9
+ `,ha=q(function(e,t){const o=R(e,t.isTaskTemplatesEnabled),{taskGroupId:k}=t,n=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=X(e),i=F.isZeniUser();return{taskListView:n,tagListView:d,localData:n.localData,isTaskTemplatesEnabled:t.isTaskTemplatesEnabled,isZeniUser:i}},function(e,t){const{navigate:o,currentTenant:k,location:n,isTaskTemplatesEnabled:d}=t,{tenantEmailDomain:i}=k,{groupByKey:l}=t.uiState;return{onTaskManagementRowClick:a=>{const s=L(i,a),c=g(n.state?.pathnameStackToGoBack,n.pathname);o(s,{state:{pathnameStackToGoBack:c}})},onReloadTasks:()=>{e(C(!0,d))},onTabChange:a=>{e(ca(a))},onParentTaskClick:a=>{const s=L(i,a);window.open(s,"_blank","noopener")},bulkUpdateTasks:(a,s)=>{e(w(a,null,s))},onNewTaskClick:()=>{if(t.localData.defaultTaskGroupId!=null){const a=I(i,t.localData.defaultTaskGroupId),s=g(n.state?.pathnameStackToGoBack,n.pathname);o(a,{state:{pathnameStackToGoBack:s,message:"comingFromTaskListPage"}})}},onColumnSortConfigChanged:(a,s)=>{e(B({uiState:{sortKey:a,sortOrder:s}}))},onFiltersChange:a=>{e(ka({filters:a}))},onSearchTextChanged:a=>{e(ra({searchText:a}))},onReloadCards:()=>{e(C(!0,d))},onBackClick:()=>{if(n.state?.message==="triggerBackClick"){const a=Q(n.state?.pathnameStackToGoBack),s=a.poppedPathname??"../";o(s,{state:{pathnameStackToGoBack:a.newStack}})}else o("../")},updateLocalData:a=>{e(la({localData:a}))},resetLocalData:()=>{e(x({taskGroupById:t.taskGroupState.taskGroupById}))},handleCreateGroup:a=>{e(ia(t.localData.newTaskGroupName,a))},assignGroupToTasks:a=>{e(w(t.localData.selectedTaskIds,a,na(t.uiState.groupByKey,a)))},onDeleteTaskGroup:a=>{e(oa(a))},onAddNewTaskToTaskGroup:a=>{if(t.localData.defaultTaskGroupId!=null){const s=Da(l,a);e(E({taskDetailLocalData:s}));const c=I(i,t.uiState.groupByKey==="groupName"?a:t.localData.defaultTaskGroupId),f=g(n.state?.pathnameStackToGoBack,n.pathname);o(c,{state:{pathnameStackToGoBack:f,message:"comingFromTaskListPage"}})}},onDragNDrop:(a,s)=>{e(sa(t.localData.selectedTaskIds.length>0?t.localData.selectedTaskIds:[a],s))},onTaskGroupRename:(a,s)=>{e(ta(a,s))},onTimeSpentUpdate:(a,s)=>{e(S({task:a,updates:s}))},onShowToast:a=>{e(ea(a))},onGroupByFilterChange:a=>{e(B({uiState:{groupByKey:a}}))},updateTask:(a,s)=>{e(S({task:a,updates:s}))},onCreateTagClick:(a,s)=>{e(aa(a,s))},handleGroupTemplateClick:a=>{e(y(a,[]))},handleGroupTemplateTaskClick:(a,s)=>{e(y(a,[s]))},handleNewTaskInitialization:a=>{if(e(E({taskDetailLocalData:{...Y,name:a}})),t.localData.defaultTaskGroupId!=null){const s=I(i,t.localData.defaultTaskGroupId),c=g(n.state?.pathnameStackToGoBack,n.pathname);o(s,{state:{pathnameStackToGoBack:c,message:"comingFromTaskListPage"}})}},onTaskGroupNameClick:a=>{o(`/${i}/tasks/group/${a}`)},onQuickResponsesClick:()=>{o(`/${i}/tasks/quick-responses`)}}})(Z);function Na(){const e=U(),t=_(),o=K(),k=F.getSignedInUser(),n=b(r=>J(r)),{taskGroupId:d}=z(),{useFeatureGate:i}=V(),{isFeatureEnabled:l}=i(p.isTaskTemplatesEnabled),{isFeatureEnabled:a}=i(p.isTaskCannedResponsesEnabled),{isFeatureEnabled:s}=i(p.isTaskCategorizationEnabled),{isFeatureEnabled:c}=i(p.isTaskBulkResolutionEnabled),{isFeatureEnabled:f}=i(p.isTaskGroupAssigneesEnabled),{isFeatureEnabled:A}=i(p.isTaskRecurringParentEnabled),[P,j]=G.useState(!1),h=b(r=>R(r,l)),D=b(r=>r.taskGroupState),m=h.fetchState,{isAiCfoAccessEnabled:$,onAskAiCfoClick:N}=ma({mobileExploreReferrer:"Task Checklist"});if(H({isDataReady:m==="Completed"}),G.useEffect(()=>{t(C(!1,l))},[n?.tenantId,t,l]),G.useEffect(()=>{m==="Completed"&&t(x({taskGroupById:D.taskGroupById}))},[m,D.taskGroupById]),k==null)throw Error("Can't access task list page without signing in...");return u.jsxs(u.Fragment,{children:[m==="Completed"?u.jsx(M,{analytics:O,onLoad:r=>(v=>v.trackPageLoaded(W.Event.taskListPage))(r)}):null,u.jsxs(fa,{children:[u.jsx(ga,{isAppContentDrawerOpen:P,handleDrawerToggle:r=>{j(r)}}),u.jsx(ha,{location:o,navigate:e,currentTenant:n,taskGroupId:d,taskGroupState:D,localData:h.localData,uiState:h.uiState,isTaskTemplatesEnabled:l,taskListFetchState:m,isTaskCategorizationEnabled:s,isTaskCannedResponsesEnabled:a,isTaskBulkResolutionEnabled:c,isTaskGroupAssigneesEnabled:f,isTaskRecurringParentEnabled:A,isAiCfoAccessEnabled:$,onAskAiCfoClick:N})]})]})}const L=(e,t)=>`/${e}/tasks/${encodeURIComponent(t)}`,I=(e,t)=>`/${e}/tasks/new/${t}`,Da=(e,t)=>{if(e==="assignee"){const o=t.split(",");return{...T.taskDetailLocalData,assignee:o}}if(e==="priority"){const o=da(t);return{...T.taskDetailLocalData,priority:o}}if(e==="status"){const o=ua(t);return{...T.taskDetailLocalData,status:o}}if(e==="tag"){const o=t.split(",");return{...T.taskDetailLocalData,tagIds:o}}if(e==="dueDate"){const o=pa(t);return{...T.taskDetailLocalData,dueDate:o}}return{...T.taskDetailLocalData}};export{Na as default};
@@ -0,0 +1,9 @@
1
+ import{j as n}from"./liveblocks-BUQfB0Zp.js";import se from"./NotFoundScreen-CxRYls3k.js";import{a as c}from"./sentry-BLIwU6uZ.js";import{h as A,u as Z,j as g,g as ne,i as oe,N as ie,n as re,o as ce,p as f}from"./core-OMb8nkC1.js";import{HJ as M,HM as le,HG as de,eV as O,Tc as J,H_ as W,HD as pe,Iu as ue,In as ke,Td as X,Te as z,Hz as me,Hw as fe,rw as ge,rk as he,k_ as Se,HU as Ie,Tf as Te,I9 as be,I6 as Ee,HP as Ge,I3 as Ce,I2 as De}from"./zeni-epic-state-BZ6N8nVI.js";import{z as C,d6 as xe,Z as we,a as je,F as b,q as Y,s as v,E as ye,d as N,f as ve,d7 as Re,k as V,at as Fe}from"./index-NcZU0lXl.js";import{n as Ue}from"./mui-JZY-3hhJ.js";import{u as Be}from"./useInitialThreadRequest-Bh1NrHII.js";import{M as Pe}from"./MobileAppDrawer-B4f1me8_.js";import Le from"./TaskListScreen-Cuce7GNl.js";import"./recharts-DAM4r1-u.js";import"./analytics-BLbM2ksu.js";import"./plaid-B_OuebQv.js";import"./dnd-DVcQZAG5.js";import"./stripe-DMRn4zHo.js";import"./lottie-DDI83OWz.js";import"./lexical-CNfNgAkp.js";import"./pdf-6FZlivdz.js";import"./utils-Bia5qc4p.js";import"./useAskAiCfoHostNavButtonProps-DS5Fxq3U.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]="18cdd220-b63a-40a2-9f08-697a6c0f16d2",e._sentryDebugIdIdentifier="sentry-dbid-18cdd220-b63a-40a2-9f08-697a6c0f16d2")}catch{}})();function He(){const e=A(),t=Z(),s=C.getSignedInUser(),{cannedResponses:u,fetchState:r,saveFetchState:d}=g(o=>o.cannedResponsesState),l=c.useCallback(()=>{t(M())},[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(xe,{cannedResponses:u,isLoading:r==="In-Progress"||r==="Not-Started",isSaving:d==="In-Progress",onBackClick:()=>e(-1),onDelete:a,onFetch:l,onSave:k})}let _,q=[];const $e=re(function(e,t){const{location:s,taskGroupId:u}=t,r=X(e,t.taskId),d=O(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=J(e),{tenantEmailDomain:D}=d,E=r.recurringSourceTaskId,x=E!=null?`${V.appUrl}/${D}/tasks/${encodeURIComponent(E)}`:void 0;var I;return{taskDetailSelectorView:r,authParams:h,isZeniUser:C.isZeniUser(),userGroupList:((I=e.userGroupsState.userGroupByUserGroupId)!==_&&(_=I,q=Object.values(I)),q),isNewClicked:s.state?.message==="comingFromTaskListPage",filesEndPoint:Fe.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:x,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(De({taskDetailLocalData:a,taskId:s}))},onSaveDetailClick:a=>{e(Ce(s,a??l))},onArchiveTaskClick:()=>{t.taskId!=null&&e(Ge(t.taskId))},onSnoozeTask:(a,o)=>{e(Ee(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=R(k),o=v(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(W(!1,s))},onCreateTagClick:a=>{e(fe(a,s))},onDeleteTagClick:a=>{e(me(a,s))},onFetchCannedResponses:()=>{e(M())},onManageTemplatesClick:()=>{u(`/${r.tenantEmailDomain}/tasks/quick-responses`)}}})(Re);function y(){const e=A(),t=Z(),s=ne(),u=we(),{taskId:r,taskGroupId:d}=oe(),l=g(i=>O(i)),k=Be(l?.companyId),{useFeatureGate:a}=je(),{isFeatureEnabled:o}=a(b.isTaskSnoozeEnabled),{isFeatureEnabled:h}=a(b.isTaskVisibilityEnabled),{isFeatureEnabled:S}=a(b.isTaskCannedResponsesEnabled),{isFeatureEnabled:D}=a(b.isTaskRecurringParentEnabled),{isFeatureEnabled:E}=a(b.isTaskGroupAssigneesEnabled),[x,I]=c.useState(!1),[p,K]=c.useState(!1),[F,Q]=c.useState(!1),[U,ee]=c.useState(!1),[B,w]=c.useState(!1),T=c.useRef(!1),G=g(i=>i.taskListState.updateTasksFetchState.fetchState),P=g(i=>J(i)),L=g(i=>i.taskGroupViewState.fetchState);c.useEffect(()=>{p||(K(!0),t(W(!1,r)))},[p,t]),c.useEffect(()=>{F||P.fetchState==="Completed"||(Q(!0),t(pe()))},[F,t,P.fetchState]),c.useEffect(()=>{U||L==="Completed"||(ee(!0),t(ue()))},[U,t,L]);const ae=c.useCallback(()=>{r!=null&&(T.current=!1,t(ke([r],null,{isArchived:!1})),w(!0))},[t,r]);c.useEffect(()=>{if(B)if(G!=="In-Progress"){if(T.current){if(G==="Error")return w(!1),void(T.current=!1);if(G==="Completed"){w(!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=R(i);e(m,{state:{pathnameStackToGoBack:v(s.state?.pathnameStackToGoBack,s.pathname)}})}}}}else T.current=!0},[B,G,l,s,e]);const H=g(i=>X(i,r)),j=H.fetchState,$=C.getSignedInUser();if($==null)throw Error("Can't access task detail page without signing in...");if(j==="Error"&&H.error?.code===400){const{tenantEmailDomain:i}=l,m=R(i),te=v(s.state?.pathnameStackToGoBack,s.pathname);return n.jsx(ie,{to:m,state:{pathnameStackToGoBack:te}})}return n.jsxs(n.Fragment,{children:[j==="Completed"?n.jsx(ye,{analytics:N,onLoad:i=>(m=>m.trackPageLoaded(ve.Event.taskDetailPage))(i)}):null,n.jsxs(ze,{children:[n.jsx(Pe,{isAppContentDrawerOpen:x,handleDrawerToggle:i=>{I(i)}}),n.jsx($e,{analytics:N,currentTenant:l,handleZeniLogoClick:()=>{u.toggle()},initialOpenThreadRequest:k,location:s,loggedInUser:$,navigate:e,taskGroupId:d,taskId:r,taskDetailFetchState:j,onUnarchiveTaskClick:ae,isTaskSnoozeEnabled:o,isTaskVisibilityEnabled:h,isTaskCannedResponsesEnabled:S,isTaskRecurringParentEnabled:D,isTaskGroupAssigneesEnabled:E})]})]})}const ze=Ue.div`
2
+ display: flex;
3
+ min-height: 100%;
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
+ `,R=e=>`/${e}/tasks`;function ia(){return n.jsxs(ce,{children:[n.jsx(f,{path:"/new",element:n.jsx(y,{})}),n.jsx(f,{path:"/new/:taskGroupId",element:n.jsx(y,{})}),n.jsx(f,{path:"/group/:taskGroupId",element:n.jsx(Le,{})}),n.jsx(f,{path:"/quick-responses",element:n.jsx(He,{})}),n.jsx(f,{path:"/:taskId",element:n.jsx(y,{})}),n.jsx(f,{path:"*",element:n.jsx(se,{})})]})}export{ia as default};
@@ -1 +1 @@
1
- import{j as t}from"./liveblocks-BLlSTcoD.js";import i from"./NotFoundScreen-Bnx2UPHv.js";import{T as r}from"./TransactionDetailScreen-DdyjxpNe.js";import"./sentry-D_xp3E3Q.js";import{o as a,p as o}from"./core-CbpoBsNm.js";import"./zeni-epic-state-CkeDRiud.js";import"./recharts-C0aThBg3.js";import"./index-aZImxzjX.js";import"./mui-DcNGd9L2.js";import"./analytics-CQmVOD4d.js";import"./plaid-B62punae.js";import"./dnd-CX5suNP6.js";import"./stripe-DMRn4zHo.js";import"./lottie-BY8e0Ufw.js";import"./lexical-BS7d_1CV.js";import"./pdf-BslZhgI8.js";import"./utils-BQO84dIV.js";import"./useAskAiCfoHostNavButtonProps-BZImc5qT.js";import"./decodeURIComponentSafe-9Mzf3G8U.js";import"./routePaths-DyIc-n3M.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]="56b6774e-1a6b-43e6-92ce-ea2969956395",e._sentryDebugIdIdentifier="sentry-dbid-56b6774e-1a6b-43e6-92ce-ea2969956395")}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-BUQfB0Zp.js";import i from"./NotFoundScreen-CxRYls3k.js";import{T as r}from"./TransactionDetailScreen-CoGsdLTa.js";import"./sentry-BLIwU6uZ.js";import{o as a,p as o}from"./core-OMb8nkC1.js";import"./zeni-epic-state-BZ6N8nVI.js";import"./recharts-DAM4r1-u.js";import"./index-NcZU0lXl.js";import"./mui-JZY-3hhJ.js";import"./analytics-BLbM2ksu.js";import"./plaid-B_OuebQv.js";import"./dnd-DVcQZAG5.js";import"./stripe-DMRn4zHo.js";import"./lottie-DDI83OWz.js";import"./lexical-CNfNgAkp.js";import"./pdf-6FZlivdz.js";import"./utils-Bia5qc4p.js";import"./useAskAiCfoHostNavButtonProps-DS5Fxq3U.js";import"./decodeURIComponentSafe-CrZYJ6cg.js";import"./routePaths-DZldr9mG.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]="56b6774e-1a6b-43e6-92ce-ea2969956395",e._sentryDebugIdIdentifier="sentry-dbid-56b6774e-1a6b-43e6-92ce-ea2969956395")}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};