@zeniai/web-app-ui 5.4.12-dev → 5.4.13-dev

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (169) hide show
  1. package/dist/assets/{AccountMappingScreen-CtnQtVOI.js → AccountMappingScreen-BRzigj9b.js} +2 -2
  2. package/dist/assets/ActualMatchingMatchDetailScreen-BAnhij0b.js +1 -0
  3. package/dist/assets/AddressRoutes-CENGCuuf.js +1 -0
  4. package/dist/assets/{AddressScreen-CiPLLpNX.js → AddressScreen-B1WKzTxJ.js} +2 -2
  5. package/dist/assets/AiCfoScreen-C-9SCmEd.js +22 -0
  6. package/dist/assets/{AppDrawer-Bxmzf_KR.js → AppDrawer-BMUNiLoq.js} +1 -1
  7. package/dist/assets/{BillPayApprovalRoutes-Bhwrq5tr.js → BillPayApprovalRoutes-DKLoOuwS.js} +1 -1
  8. package/dist/assets/{BillPayRoutes-CQCAwPWX.js → BillPayRoutes-VPiZq7wX.js} +8 -8
  9. package/dist/assets/{BusinessVerificationPageScreen-71JxUYXB.js → BusinessVerificationPageScreen-BBfkNXWr.js} +2 -2
  10. package/dist/assets/CardsAiCfoScreen-DvGNnU6w.js +14 -0
  11. package/dist/assets/{ChargeCardRoutes-CvC_JvPH.js → ChargeCardRoutes-CulF2JvM.js} +9 -9
  12. package/dist/assets/CompanyPassportScreen-CO0hs3h5.js +1 -0
  13. package/dist/assets/ConnectionAuthScreen-BEy82Ssf.js +11 -0
  14. package/dist/assets/CustomerOnboardingAuthScreen-BMc4DHei.js +1 -0
  15. package/dist/assets/{CustomerOnboardingRoutes-BMrjyYZ8.js → CustomerOnboardingRoutes-rnOyKIiB.js} +3 -3
  16. package/dist/assets/{DashboardRoutes-DYfRGtw5.js → DashboardRoutes-Cu8fYKAV.js} +4 -4
  17. package/dist/assets/{DefaultTenantHome-DmRqFqlc.js → DefaultTenantHome-CVMojLIT.js} +1 -1
  18. package/dist/assets/DomesticWireDetailScreen-DvqNzOqw.js +18 -0
  19. package/dist/assets/DrawerScreen-DcCH_0uM.js +1 -0
  20. package/dist/assets/EntityDetailRoutes-CU_8Y8KV.js +1 -0
  21. package/dist/assets/{ExpenseAutomationRoutes-Bks-mNnn.js → ExpenseAutomationRoutes-BDWC6-9s.js} +6 -6
  22. package/dist/assets/FeaturePreviewScreen-BNMkwdyk.js +1 -0
  23. package/dist/assets/HubSpotOAuthCallbackScreen-BCwidLV1.js +1 -0
  24. package/dist/assets/InboxNotificationsProvider-dYyDAGLI.js +1 -0
  25. package/dist/assets/InvoicingRoutes-92Lk9pMJ.js +3 -0
  26. package/dist/assets/{MagicLinkRoutes-BQns5k2S.js → MagicLinkRoutes-qLj928yC.js} +9 -9
  27. package/dist/assets/MagicLinkSignInScreen-B5rANZEW.js +12 -0
  28. package/dist/assets/MobileAppDrawer-DfwkluKE.js +1 -0
  29. package/dist/assets/NotFoundScreen-QNLsV8PR.js +1 -0
  30. package/dist/assets/NotificationRoutes-ByCMeGhn.js +1 -0
  31. package/dist/assets/OAuthConsentScreen-DvZbWzs6.js +1 -0
  32. package/dist/assets/PandLWithForecastRoutes-CddU1LvP.js +1 -0
  33. package/dist/assets/{PaymentLinkScreen-BADSNyXp.js → PaymentLinkScreen-DJv-jPN7.js} +2 -2
  34. package/dist/assets/PeopleRoutes-seHwQw6o.js +22 -0
  35. package/dist/assets/PerformanceRoutes-DNmhsmNx.js +1 -0
  36. package/dist/assets/{Preview-DGZHmpgt.js → Preview-DYy1N-vn.js} +1 -1
  37. package/dist/assets/QBOConnectionScreen-BnjbZJvL.js +100 -0
  38. package/dist/assets/{ReimbursementApprovalRoutes-CsG7QtOs.js → ReimbursementApprovalRoutes-DUvLzvwu.js} +1 -1
  39. package/dist/assets/ReimbursementApprovalRuleDetailScreen-BliFeglB.js +1 -0
  40. package/dist/assets/ReimbursementRoutes-uqQhXzD_.js +68 -0
  41. package/dist/assets/ReportsRoutes-Ty52_HTE.js +1 -0
  42. package/dist/assets/RewardsRoutes-DLgsJCTB.js +1 -0
  43. package/dist/assets/{ScheduleDetailsPrepaidExpensesScreen-v3zw3e0R.js → ScheduleDetailsPrepaidExpensesScreen-DW_6SN7k.js} +5 -5
  44. package/dist/assets/ScreenRoutes-DJPFTJup.js +2 -0
  45. package/dist/assets/{SettingsRoutes-CwW3Kcyz.js → SettingsRoutes-DucmuzJP.js} +6 -6
  46. package/dist/assets/{SetupPagesScreen-DPnnq4jj.js → SetupPagesScreen-DK6Wiu69.js} +5 -5
  47. package/dist/assets/SignInScreen-DaPgU2Nl.js +1 -0
  48. package/dist/assets/SignOutScreen-B59RCl56.js +9 -0
  49. package/dist/assets/TaskListScreen-Cvt-fENk.js +9 -0
  50. package/dist/assets/TaskRoutes-D2FIt6Mv.js +9 -0
  51. package/dist/assets/TransactionDetailRoutes-tbHHbIBD.js +1 -0
  52. package/dist/assets/TransactionDetailScreen-Ch0LCj8G.js +5 -0
  53. package/dist/assets/{TransactionListRoutes-aYhnWH8H.js → TransactionListRoutes-C3bzQYFS.js} +1 -1
  54. package/dist/assets/TreasuryRoutes-DDeLTUpi.js +37 -0
  55. package/dist/assets/{VendorsRoutes-QudM99vQ.js → VendorsRoutes-DJp9Lw7q.js} +11 -11
  56. package/dist/assets/WiseConfirmationScreen-CLvpbPdm.js +12 -0
  57. package/dist/assets/{ZeniAccountRoutes-DeSodvmm.js → ZeniAccountRoutes-DaY0WnU3.js} +11 -11
  58. package/dist/assets/ZeniAccountStatementScreen-iiLi8G_s.js +9 -0
  59. package/dist/assets/{accountMappingHelper-7kGWRPlV.js → accountMappingHelper-Bhr6esKF.js} +1 -1
  60. package/dist/assets/{analytics-BfKlFVdJ.js → analytics-DQKmqYV4.js} +4 -4
  61. package/dist/assets/{analyticsHelper-Cn2rORl_.js → analyticsHelper-BwgoMQXe.js} +1 -1
  62. package/dist/assets/{core-BWRpGVdr.js → core--MkqccHv.js} +1 -1
  63. package/dist/assets/{decodeURIComponentSafe-DN9u1X8y.js → decodeURIComponentSafe-BEyzjo_o.js} +1 -1
  64. package/dist/assets/{dnd-wLfPcqQ_.js → dnd-CP4whtxN.js} +1 -1
  65. package/dist/assets/{empty-CKwCpajm.js → empty-BNS5Y1pB.js} +1 -1
  66. package/dist/assets/{empty-BxjviaN4.js → empty-ClM8DHuA.js} +1 -1
  67. package/dist/assets/{emptyVideoElement-BURd-WPn.js → emptyVideoElement-fa_uGl7-.js} +1 -1
  68. package/dist/assets/epic-D_XIiCBV.js +2 -0
  69. package/dist/assets/expenseAutomationHelper-Dgshk1zd.js +1 -0
  70. package/dist/assets/getLocaleForTenant-GT2HpY4t.js +1 -0
  71. package/dist/assets/{index-9pdMsp-M.js → index-B3QEycF9.js} +14277 -14277
  72. package/dist/assets/{index-DwbDgvVM.js → index-BF_3R8uL.js} +1 -1
  73. package/dist/assets/{index-DYK9WSJX.js → index-BeoiOG5z.js} +1 -1
  74. package/dist/assets/{index-BtcZVjM1.js → index-CgMPBz0t.js} +1 -1
  75. package/dist/assets/{index-CcNUb4uI.js → index-D6eGMXVa.js} +2 -2
  76. package/dist/assets/index-eDdhdaqL.js +1 -0
  77. package/dist/assets/{index-D6O1UsWW.js → index-unoqrRj0.js} +1 -1
  78. package/dist/assets/index-yOyvZ3iU.js +1 -0
  79. package/dist/assets/{lexical-ljfsYSTd.js → lexical-BSiUIp1H.js} +1 -1
  80. package/dist/assets/liveblocks-DxRiM6VH.js +59 -0
  81. package/dist/assets/{lottie-ByqRhfis.js → lottie-ixiiUTSF.js} +1 -1
  82. package/dist/assets/{mui-BmHHlwSU.js → mui-kCJnrqYM.js} +1 -1
  83. package/dist/assets/{pathToGoBack-Dr_s0YFt.js → pathToGoBack-bat7ZlX9.js} +1 -1
  84. package/dist/assets/{pdf-C42gprG9.js → pdf-CRxQY5HT.js} +5 -5
  85. package/dist/assets/{pdf-lib-D4o6Nk27.js → pdf-lib-CHqQ3Ry3.js} +1 -1
  86. package/dist/assets/{plaid-CNV6JDhi.js → plaid-D94Y0H1P.js} +1 -1
  87. package/dist/assets/{pusher-DvjXiGU0.js → pusher-D0JY_FIf.js} +1 -1
  88. package/dist/assets/{react-DJxNpxcE.js → react-BBat2v6H.js} +1 -1
  89. package/dist/assets/{react-CdlDO5TG.js → react-BMVWGyVG.js} +1 -1
  90. package/dist/assets/{react-s5yBxYCg.js → react-Bv8sZiPk.js} +1 -1
  91. package/dist/assets/{react-CFwPpD-1.js → react-CiS3ccRD.js} +1 -1
  92. package/dist/assets/{react-Ct2ZzE_U.js → react-DTdBaAd3.js} +1 -1
  93. package/dist/assets/{react-CFX1RFZH.js → react-ltAkcaDC.js} +1 -1
  94. package/dist/assets/{recharts-BXLxGQ-T.js → recharts-EjKi4hbc.js} +1 -1
  95. package/dist/assets/{reportTimeframe-tJTkNTvP.js → reportTimeframe-DQT7aPWx.js} +1 -1
  96. package/dist/assets/{routePaths--TXDBUUo.js → routePaths-33YxbFc-.js} +1 -1
  97. package/dist/assets/{sentry-bpmZUW7k.js → sentry-B-dIf5xz.js} +1 -1
  98. package/dist/assets/{stripSplatSuffix-Bizh1-Tx.js → stripSplatSuffix-xBjFkZSJ.js} +1 -1
  99. package/dist/assets/{url-Cc_9bwX-.js → url-Bs4Dq0vG.js} +1 -1
  100. package/dist/assets/{url-8ONn8gmN.js → url-hbMZAh9y.js} +1 -1
  101. package/dist/assets/useActualMatchingMatchDetail-CAIVsCJG.js +1 -0
  102. package/dist/assets/useAiCfoDashboardSuggestedQuestionsChips-BTEnEWTt.js +1 -0
  103. package/dist/assets/useAskAiCfoHostNavButtonProps-BZFKDw3z.js +1 -0
  104. package/dist/assets/useChargeCardPusherEvents-DG1lA66n.js +1 -0
  105. package/dist/assets/{useDeviceId-3o80RPjJ.js → useDeviceId-8baAH1vH.js} +1 -1
  106. package/dist/assets/useEmailConnectResultRefresh-BEw2d8Jv.js +1 -0
  107. package/dist/assets/useEnsureVendorListLoaded-IzkQpfDE.js +1 -0
  108. package/dist/assets/useInitialThreadRequest-D8OFP51H.js +1 -0
  109. package/dist/assets/useTaskManagerAccess-ULuU1uGf.js +1 -0
  110. package/dist/assets/useTaskManagerPusherEvents-WPqjoQIF.js +1 -0
  111. package/dist/assets/utils-BPWa_pEs.js +36 -0
  112. package/dist/assets/withTransactionSidePanel-RKi7LGHx.js +25 -0
  113. package/dist/assets/{zeni-epic-state-BlWDBO75.js → zeni-epic-state-Dg1W8Zu5.js} +4 -4
  114. package/dist/index.html +1 -1
  115. package/package.json +4 -4
  116. package/dist/assets/ActualMatchingMatchDetailScreen-COb45lJn.js +0 -1
  117. package/dist/assets/AddressRoutes-CXRpuLt0.js +0 -1
  118. package/dist/assets/AiCfoScreen-DPuJRDN-.js +0 -22
  119. package/dist/assets/CardsAiCfoScreen-Dze-_SQs.js +0 -14
  120. package/dist/assets/CompanyPassportScreen-dRN2jnGn.js +0 -1
  121. package/dist/assets/ConnectionAuthScreen-CrQ3LZFB.js +0 -11
  122. package/dist/assets/CustomerOnboardingAuthScreen-BUiUC1A4.js +0 -1
  123. package/dist/assets/DomesticWireDetailScreen-YfGiQgSo.js +0 -18
  124. package/dist/assets/DrawerScreen-DH40ycW6.js +0 -1
  125. package/dist/assets/EntityDetailRoutes-BgqO6DqU.js +0 -1
  126. package/dist/assets/FeaturePreviewScreen-B9UACzAC.js +0 -1
  127. package/dist/assets/HubSpotOAuthCallbackScreen-BjEMURaY.js +0 -1
  128. package/dist/assets/InboxNotificationsProvider-Cd4NxEtR.js +0 -1
  129. package/dist/assets/InvoicingRoutes-UHPes0q9.js +0 -3
  130. package/dist/assets/MagicLinkSignInScreen-IXnuvHt3.js +0 -12
  131. package/dist/assets/MobileAppDrawer-rCVKr3J3.js +0 -1
  132. package/dist/assets/NotFoundScreen-C94S-cmy.js +0 -1
  133. package/dist/assets/NotificationRoutes-h53g4kBO.js +0 -1
  134. package/dist/assets/OAuthConsentScreen-35XPz7Vp.js +0 -1
  135. package/dist/assets/PandLWithForecastRoutes-OnVWoGgX.js +0 -1
  136. package/dist/assets/PeopleRoutes-CnmV1pW5.js +0 -22
  137. package/dist/assets/PerformanceRoutes-MYTxvcMA.js +0 -1
  138. package/dist/assets/QBOConnectionScreen-C1Kn9y8q.js +0 -101
  139. package/dist/assets/ReimbursementApprovalRuleDetailScreen-BzhkgPjS.js +0 -1
  140. package/dist/assets/ReimbursementRoutes-BcjYsUHB.js +0 -68
  141. package/dist/assets/ReportsRoutes-Bcm2EvxJ.js +0 -1
  142. package/dist/assets/RewardsRoutes-Do7moyFI.js +0 -1
  143. package/dist/assets/ScreenRoutes-vTLuTGuW.js +0 -2
  144. package/dist/assets/SignInScreen-ColMnPgQ.js +0 -1
  145. package/dist/assets/SignOutScreen-DILD5ueP.js +0 -9
  146. package/dist/assets/TaskListScreen-aizYXFWj.js +0 -9
  147. package/dist/assets/TaskRoutes-CWWa57kf.js +0 -9
  148. package/dist/assets/TransactionDetailRoutes-DWXM95sG.js +0 -1
  149. package/dist/assets/TransactionDetailScreen-CNMo1Iyr.js +0 -5
  150. package/dist/assets/TreasuryRoutes-DnAsQTrn.js +0 -37
  151. package/dist/assets/WiseConfirmationScreen-CkFHmO99.js +0 -12
  152. package/dist/assets/ZeniAccountStatementScreen-DKVtRt3N.js +0 -9
  153. package/dist/assets/epic-Nc2-Ka61.js +0 -2
  154. package/dist/assets/expenseAutomationHelper-Dr99xbt1.js +0 -1
  155. package/dist/assets/getLocaleForTenant-BNAJG7gN.js +0 -1
  156. package/dist/assets/index-BXpurrfG.js +0 -1
  157. package/dist/assets/index-mJCZBkgN.js +0 -1
  158. package/dist/assets/liveblocks-V5YQZeeY.js +0 -59
  159. package/dist/assets/useActualMatchingMatchDetail-Mft821vz.js +0 -1
  160. package/dist/assets/useAiCfoDashboardSuggestedQuestionsChips-3ayut61P.js +0 -1
  161. package/dist/assets/useAskAiCfoHostNavButtonProps-E2UGdnp9.js +0 -1
  162. package/dist/assets/useChargeCardPusherEvents-DVeqwUB9.js +0 -1
  163. package/dist/assets/useEmailConnectResultRefresh-F8OBO8EU.js +0 -1
  164. package/dist/assets/useEnsureVendorListLoaded-CKZrwkQQ.js +0 -1
  165. package/dist/assets/useInitialThreadRequest-Df-inltN.js +0 -1
  166. package/dist/assets/useTaskManagerAccess-Bq9TDvwr.js +0 -1
  167. package/dist/assets/useTaskManagerPusherEvents-Ctn5L7kn.js +0 -1
  168. package/dist/assets/utils-CXFQdt3d.js +0 -36
  169. package/dist/assets/withTransactionSidePanel-DOV8YzFf.js +0 -25
@@ -1,4 +1,4 @@
1
- import{j as a}from"./liveblocks-V5YQZeeY.js";import{a as d}from"./sentry-bpmZUW7k.js";import{h as O,g as H,u as U,i as L,j as C,l as K,n as J,o as k}from"./core-BWRpGVdr.js";import{fE as v,_p as je,Oa as Pe,ZY as ve,_5 as we,c6 as X,cR as Ae,cS as De,bm as Ue,dc as Re,Gs as Te,_q as Me,PD as Be,N1 as Ne,MU as de,MR as Ve,Gw as ue,MX as pe,M_ as ge,N4 as Y,CA as ee,Gv as Fe,lu as Z,lx as me,_r as Oe,mH as Le,GN as Ge,Wq as $e,Wr as Ze,ls as He,_s as Ke,lv as qe,uL as ze,Wl as We,Wm as Je,uP as Qe,hV as Xe,Vi as W,hN as ae,hK as Ye,hS as en,Vj as nn,GK as tn,_t as an,_u as on,Ni as sn,l$ as rn,dY as fe,dZ as he,_v as ln,gB as cn,Vz as dn,GJ as oe,gG as se,gF as un,GI as pn,gE as gn,gD as mn,_w as fn,UK as Ce,_x as hn,_y as Cn,_z as yn,_A as Sn,_B as bn,_C as In,GQ as xn,_D as En,GH as ie,GB as $,_E as kn,_F as _n,_G as re,_H as jn,dR as Pn,_I as vn,_J as wn,_K as An,UW as Dn,b_ as Un,c5 as Rn,c4 as Tn,b$ as Mn,_L as Bn,c2 as Nn,c1 as Vn,c3 as Fn,c0 as On}from"./zeni-epic-state-BlWDBO75.js";import{bV as Ln,z as P,V as G,a6 as ne,c5 as Gn,m as q,p as te,c as V,j as ye,O as Se,c6 as $n,l as Zn,X as be,c7 as Hn,ah as Kn,c8 as qn,c9 as zn,ap as Wn,ca as Jn,n as Qn,d as Ie,cb as Xn}from"./index-9pdMsp-M.js";import{n as B}from"./mui-BmHHlwSU.js";import{u as xe}from"./useTaskManagerAccess-Bq9TDvwr.js";import{U as Yn}from"./AccountMappingScreen-CtnQtVOI.js";import{t as et,A as nt}from"./AddressScreen-CiPLLpNX.js";import F from"./NotFoundScreen-C94S-cmy.js";import{g as tt}from"./analyticsHelper-Cn2rORl_.js";import{u as at,B as ot}from"./BusinessVerificationPageScreen-71JxUYXB.js";import{C as st}from"./CompanyPassportScreen-dRN2jnGn.js";import{M as T}from"./MobileAppDrawer-rCVKr3J3.js";import{u as it,a as rt}from"./useEmailConnectResultRefresh-F8OBO8EU.js";import{q as le}from"./QBOConnectionScreen-C1Kn9y8q.js";import{B as lt}from"./BillPayApprovalRoutes-Bhwrq5tr.js";import{R as ct}from"./ReimbursementApprovalRoutes-CsG7QtOs.js";import"./recharts-BXLxGQ-T.js";import"./analytics-BfKlFVdJ.js";import"./plaid-CNV6JDhi.js";import"./dnd-wLfPcqQ_.js";import"./stripe-cKAAJElX.js";import"./lottie-ByqRhfis.js";import"./lexical-ljfsYSTd.js";import"./pdf-C42gprG9.js";import"./utils-CXFQdt3d.js";import"./accountMappingHelper-7kGWRPlV.js";import"./routePaths--TXDBUUo.js";import"./InboxNotificationsProvider-Cd4NxEtR.js";import"./url-Cc_9bwX-.js";import"./empty-BxjviaN4.js";import"./pdf-lib-D4o6Nk27.js";import"./index-DYK9WSJX.js";import"./index-BXpurrfG.js";import"./decodeURIComponentSafe-DN9u1X8y.js";import"./useEnsureVendorListLoaded-CKZrwkQQ.js";import"./ReimbursementApprovalRuleDetailScreen-BzhkgPjS.js";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},l=new e.Error().stack;l&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[l]="24d2f4a5-4fc8-47f1-8481-7ac62be76efd",e._sentryDebugIdIdentifier="sentry-dbid-24d2f4a5-4fc8-47f1-8481-7ac62be76efd")}catch{}})();const dt=B.div`
1
+ import{j as a}from"./liveblocks-DxRiM6VH.js";import{a as d}from"./sentry-B-dIf5xz.js";import{h as F,g as H,u as U,i as L,j as C,l as K,n as J,o as k}from"./core--MkqccHv.js";import{fI as v,_t as Pe,Oe as je,_0 as ve,_9 as we,ca as Y,cV as Ae,cW as De,bq as Ue,dg as Re,Gw as Te,_u as Me,PH as Be,N5 as Ne,MY as de,MV as Oe,GA as ue,M$ as pe,N2 as ge,N8 as X,CE as ee,Gz as Ve,ly as Z,lB as me,_v as Fe,mL as Le,GR as Ge,Wu as $e,Wv as Ze,lw as He,_w as Ke,lz as We,uP as ze,Wp as qe,Wq as Je,uT as Qe,hZ as Ye,Vm as q,hR as ae,hO as Xe,hW as en,Vn as nn,GO as tn,_x as an,_y as on,Nm as sn,m3 as rn,e0 as fe,e1 as he,_z as ln,gF as cn,VD as dn,GN as oe,gK as se,gJ as un,GM as pn,gI as gn,gH as mn,_A as fn,UO as Ce,_B as hn,_C as Cn,_D as yn,_E as Sn,_F as bn,_G as In,GU as xn,_H as En,GL as ie,GF as $,_I as kn,_J as _n,_K as re,_L as Pn,dV as jn,_M as vn,_N as wn,_O as An,U_ as Dn,c2 as Un,c9 as Rn,c8 as Tn,c3 as Mn,_P as Bn,c6 as Nn,c5 as On,c7 as Vn,c4 as Fn}from"./zeni-epic-state-Dg1W8Zu5.js";import{bU as Ln,z as j,V as G,a5 as ne,c4 as Gn,k as W,p as te,d as O,h as ye,K as Se,c5 as $n,j as Zn,W as be,c6 as Hn,ag as Kn,c7 as Wn,c8 as zn,ao as qn,c9 as Jn,l as Qn,e as Ie,ca as Yn}from"./index-B3QEycF9.js";import{n as B}from"./mui-kCJnrqYM.js";import{u as xe}from"./useTaskManagerAccess-ULuU1uGf.js";import{U as Xn}from"./AccountMappingScreen-BRzigj9b.js";import{t as et,A as nt}from"./AddressScreen-B1WKzTxJ.js";import V from"./NotFoundScreen-QNLsV8PR.js";import{g as tt}from"./analyticsHelper-BwgoMQXe.js";import{u as at,B as ot}from"./BusinessVerificationPageScreen-BBfkNXWr.js";import{C as st}from"./CompanyPassportScreen-CO0hs3h5.js";import{M as T}from"./MobileAppDrawer-DfwkluKE.js";import{u as it,a as rt}from"./useEmailConnectResultRefresh-BEw2d8Jv.js";import{q as le}from"./QBOConnectionScreen-BnjbZJvL.js";import{B as lt}from"./BillPayApprovalRoutes-DKLoOuwS.js";import{R as ct}from"./ReimbursementApprovalRoutes-DUvLzvwu.js";import"./recharts-EjKi4hbc.js";import"./analytics-DQKmqYV4.js";import"./plaid-D94Y0H1P.js";import"./dnd-CP4whtxN.js";import"./stripe-cKAAJElX.js";import"./lottie-ixiiUTSF.js";import"./lexical-BSiUIp1H.js";import"./pdf-CRxQY5HT.js";import"./utils-BPWa_pEs.js";import"./accountMappingHelper-Bhr6esKF.js";import"./routePaths-33YxbFc-.js";import"./InboxNotificationsProvider-dYyDAGLI.js";import"./empty-ClM8DHuA.js";import"./pdf-lib-CHqQ3Ry3.js";import"./index-BeoiOG5z.js";import"./url-Bs4Dq0vG.js";import"./index-eDdhdaqL.js";import"./decodeURIComponentSafe-BEyzjo_o.js";import"./useEnsureVendorListLoaded-IzkQpfDE.js";import"./ReimbursementApprovalRuleDetailScreen-BliFeglB.js";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},l=new e.Error().stack;l&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[l]="d3550452-3a46-4437-8c5d-994dae6b85c4",e._sentryDebugIdIdentifier="sentry-dbid-d3550452-3a46-4437-8c5d-994dae6b85c4")}catch{}})();const dt=B.div`
2
2
  display: flex;
3
3
  height: 100%;
4
4
  width: 100%;
@@ -6,7 +6,7 @@ import{j as a}from"./liveblocks-V5YQZeeY.js";import{a as d}from"./sentry-bpmZUW7
6
6
  flex-direction: column;
7
7
  align-items: center;
8
8
  background-color: ${e=>e.theme.colors.grey4};
9
- `,ut=K((function(e,l){const o=v(e),i=ve(e),r=we(e),n=l.roleMap.bill_pay_admin;return{isDisabled:(X(o?.userRole??[])||n)&&"readonly",billpayApprovalView:i,remiApproverView:r,analytics:q}}),(function(e,l){const{navigate:o,currentTenant:i}=l;return{onSetupApprovalRulesBillPaySectionClick:()=>{o("bills/approval-rules")},onSetupApprovalRulesRemiSectionClick:()=>{o("reimbursements/approval-rules")},onBackClick:()=>{i?.companyBillPayInfo?.info?.isBillPayEnabled!=null&&i.companyBillPayInfo.info.isBillPayEnabled===!1?o("../.."):o("../")},onNavigateToDashboard:()=>{o("../dashboard")}}}))(Gn),pt=()=>{const e=O(),l=H(),o=U(),{tenantEmailDomain:i}=L(),[r,n]=d.useState(!1),[t,s]=d.useState(!1),c=C((g=>v(g)));at();const u=C((g=>g.remiSetupApproverViewState.fetchState)),h=C((g=>je(g))),{isApprovalRulesV3Enabled:S,isLoading:m}=Ln(c?.tenantId),p=c.companyId??P.getSignedInUserTenant(i)?.companyId;if(P.getSignedInUser()==null)throw Error("Can't access Approval Rules settings page without signing in...");const b=G();d.useEffect((()=>{t||u!=="Not-Started"||m||c?.tenantId==null||(s(!0),o(Pe(!0,!1,!1,S)))}),[t,u,m,S,c?.tenantId,o]);const E=g=>{n(g)};return b?.loggedInUserRoleMap!=null?a.jsxs(dt,{children:[a.jsx(T,{isAppContentDrawerOpen:r,handleDrawerToggle:E}),a.jsx(ut,{navigate:e,location:l,companyId:p,currentTenant:c,roleMap:b.loggedInUserRoleMap,onClickMenuIcon:()=>{E(!0)}})]}):a.jsx(ne,{fetchState:h.fetchState})},gt=B.div`
9
+ `,ut=K((function(e,l){const o=v(e),i=ve(e),r=we(e),n=l.roleMap.bill_pay_admin;return{isDisabled:(Y(o?.userRole??[])||n)&&"readonly",billpayApprovalView:i,remiApproverView:r,analytics:W}}),(function(e,l){const{navigate:o,currentTenant:i}=l;return{onSetupApprovalRulesBillPaySectionClick:()=>{o("bills/approval-rules")},onSetupApprovalRulesRemiSectionClick:()=>{o("reimbursements/approval-rules")},onBackClick:()=>{i?.companyBillPayInfo?.info?.isBillPayEnabled!=null&&i.companyBillPayInfo.info.isBillPayEnabled===!1?o("../.."):o("../")},onNavigateToDashboard:()=>{o("../dashboard")}}}))(Gn),pt=()=>{const e=F(),l=H(),o=U(),{tenantEmailDomain:i}=L(),[r,n]=d.useState(!1),[t,s]=d.useState(!1),c=C((g=>v(g)));at();const u=C((g=>g.remiSetupApproverViewState.fetchState)),h=C((g=>Pe(g))),{isApprovalRulesV3Enabled:S,isLoading:m}=Ln(c?.tenantId),p=c.companyId??j.getSignedInUserTenant(i)?.companyId;if(j.getSignedInUser()==null)throw Error("Can't access Approval Rules settings page without signing in...");const b=G();d.useEffect((()=>{t||u!=="Not-Started"||m||c?.tenantId==null||(s(!0),o(je(!0,!1,!1,S)))}),[t,u,m,S,c?.tenantId,o]);const E=g=>{n(g)};return b?.loggedInUserRoleMap!=null?a.jsxs(dt,{children:[a.jsx(T,{isAppContentDrawerOpen:r,handleDrawerToggle:E}),a.jsx(ut,{navigate:e,location:l,companyId:p,currentTenant:c,roleMap:b.loggedInUserRoleMap,onClickMenuIcon:()=>{E(!0)}})]}):a.jsx(ne,{fetchState:h.fetchState})},gt=B.div`
10
10
  display: flex;
11
11
  height: 100%;
12
12
  width: 100%;
@@ -14,7 +14,7 @@ import{j as a}from"./liveblocks-V5YQZeeY.js";import{a as d}from"./sentry-bpmZUW7
14
14
  flex-direction: column;
15
15
  align-items: center;
16
16
  background-color: ${e=>e.theme.colors.grey4};
17
- `,mt=K((function(e,l){const{companyId:o,isZeniAccountEnabled:i,isChargeCardEnabled:r,isBillPayEnabled:n,isRemiEnabled:t,isTreasuryEnabled:s}=l,c=v(e);return{bankSetupView:Me(e,o,n,t,i,r,s),connectedAccountProvider:c.company?.featuresActivationInfo.connectedAccountProvider??"",analytics:q}}),(function(e,l){const{navigate:o,currentTenant:i,companyId:r}=l;return{onFetchLinkTokenClick:(n,t,s)=>{e(ee(t,n,s))},onEstablishConnectionClick:(n,t,s)=>{e(Y(n,r,t,s))},onUpdatePaymentAccountStatus:(n,t,s,c,u)=>{e(ge(n,t,u,c,s))},onUpdatePaymentAccountLoginStatus:(n,t,s,c)=>{e(pe(!1,n,c,s,t))},onEstablishConnectionSuccess:(n,t)=>{e(ue(t,n))},onUpdateAccountClick:(n,t,s,c,u)=>{e(u==="paymentAccount"?de(n,t,s,c):Ve(c,n,t))},onUpdatePrimaryFundingAccount:(n,t,s)=>{e(Ne(r,t,n,s))},onRemoveConnection:n=>{e(Be(n))},onBackClick:()=>{i?.companyBillPayInfo?.info?.isBillPayEnabled!=null&&i.companyBillPayInfo.info.isBillPayEnabled===!1?o("../.."):o("../")},onNavigateToDashboard:()=>{o("../dashboard")}}}))($n),ft=()=>{const e=O(),l=H(),o=U(),{tenantEmailDomain:i}=L(),r=G(),{useFeatureGate:n}=te(),{isFeatureEnabled:t}=n(V.isChargeCardFeatureEnabled),{isFeatureEnabled:s}=n(V.isDebitCardFeatureEnabled),[c,u]=d.useState(!1),[h,S]=d.useState(!1),m=C((w=>v(w))),p=C((w=>w.settingsViewState.bankConnection.fetchState)),b=Ae(m,r?.loggedInUserRoleMap),E=De(m,r?.loggedInUserRoleMap),g=m?.userRole!=null&&Ue(m.userRole),j=!!m.company?.companyZeniAccountInfo?.isZeniAccountEnabled&&!g,_=m.companyTreasuryInfo?.info?.businessVerificationStatus?.code==="verified"&&!g,R=ye(m,t,s),A=Re(m,r?.loggedInUserRoleMap)&&R,{isCardsHidden:I}=Se(m?.tenantId),x=m.companyId??P.getSignedInUserTenant(i)?.companyId;if(P.getSignedInUser()==null)throw Error("Can't access bank connections page without signing in...");d.useEffect((()=>{h||p==="Completed"||(S(!0),o(Te(!1)))}),[h,o,p]);const M=w=>{u(w)};return b||j||E||A?a.jsxs(gt,{children:[a.jsx(T,{isAppContentDrawerOpen:c,handleDrawerToggle:M}),a.jsx(mt,{navigate:e,location:l,companyId:x,currentTenant:m,roleMap:r.loggedInUserRoleMap,isBillPayEnabled:b,isRemiEnabled:E,isZeniAccountEnabled:j,isChargeCardEnabled:A,isChargeCardsHidden:I,isTreasuryEnabled:_,onClickMenuIcon:()=>{M(!0)}})]}):a.jsx(F,{})},ht=B.div`
17
+ `,mt=K((function(e,l){const{companyId:o,isZeniAccountEnabled:i,isChargeCardEnabled:r,isBillPayEnabled:n,isRemiEnabled:t,isTreasuryEnabled:s}=l,c=v(e);return{bankSetupView:Me(e,o,n,t,i,r,s),connectedAccountProvider:c.company?.featuresActivationInfo.connectedAccountProvider??"",analytics:W}}),(function(e,l){const{navigate:o,currentTenant:i,companyId:r}=l;return{onFetchLinkTokenClick:(n,t,s)=>{e(ee(t,n,s))},onEstablishConnectionClick:(n,t,s)=>{e(X(n,r,t,s))},onUpdatePaymentAccountStatus:(n,t,s,c,u)=>{e(ge(n,t,u,c,s))},onUpdatePaymentAccountLoginStatus:(n,t,s,c)=>{e(pe(!1,n,c,s,t))},onEstablishConnectionSuccess:(n,t)=>{e(ue(t,n))},onUpdateAccountClick:(n,t,s,c,u)=>{e(u==="paymentAccount"?de(n,t,s,c):Oe(c,n,t))},onUpdatePrimaryFundingAccount:(n,t,s)=>{e(Ne(r,t,n,s))},onRemoveConnection:n=>{e(Be(n))},onBackClick:()=>{i?.companyBillPayInfo?.info?.isBillPayEnabled!=null&&i.companyBillPayInfo.info.isBillPayEnabled===!1?o("../.."):o("../")},onNavigateToDashboard:()=>{o("../dashboard")}}}))($n),ft=()=>{const e=F(),l=H(),o=U(),{tenantEmailDomain:i}=L(),r=G(),{useFeatureGate:n}=te(),{isFeatureEnabled:t}=n(O.isChargeCardFeatureEnabled),{isFeatureEnabled:s}=n(O.isDebitCardFeatureEnabled),[c,u]=d.useState(!1),[h,S]=d.useState(!1),m=C((w=>v(w))),p=C((w=>w.settingsViewState.bankConnection.fetchState)),b=Ae(m,r?.loggedInUserRoleMap),E=De(m,r?.loggedInUserRoleMap),g=m?.userRole!=null&&Ue(m.userRole),P=!!m.company?.companyZeniAccountInfo?.isZeniAccountEnabled&&!g,_=m.companyTreasuryInfo?.info?.businessVerificationStatus?.code==="verified"&&!g,R=ye(m,t,s),A=Re(m,r?.loggedInUserRoleMap)&&R,{isCardsHidden:I}=Se(m?.tenantId),x=m.companyId??j.getSignedInUserTenant(i)?.companyId;if(j.getSignedInUser()==null)throw Error("Can't access bank connections page without signing in...");d.useEffect((()=>{h||p==="Completed"||(S(!0),o(Te(!1)))}),[h,o,p]);const M=w=>{u(w)};return b||P||E||A?a.jsxs(gt,{children:[a.jsx(T,{isAppContentDrawerOpen:c,handleDrawerToggle:M}),a.jsx(mt,{navigate:e,location:l,companyId:x,currentTenant:m,roleMap:r.loggedInUserRoleMap,isBillPayEnabled:b,isRemiEnabled:E,isZeniAccountEnabled:P,isChargeCardEnabled:A,isChargeCardsHidden:I,isTreasuryEnabled:_,onClickMenuIcon:()=>{M(!0)}})]}):a.jsx(V,{})},ht=B.div`
18
18
  display: flex;
19
19
  height: 100%;
20
20
  width: 100%;
@@ -22,7 +22,7 @@ import{j as a}from"./liveblocks-V5YQZeeY.js";import{a as d}from"./sentry-bpmZUW7
22
22
  flex-direction: column;
23
23
  align-items: center;
24
24
  background-color: ${e=>e.theme.colors.grey4};
25
- `,Ct=K((function(e,l){const{companyId:o}=l,i=v(e),r=l.roleMap.bill_pay_admin,n=Oe(e,o),{uiState:t}=n,s=(X(i?.userRole??[])||r)&&n.setupView.accountFetchStatus.fetchState!=="In-Progress"&&n.setupView.plaidConnectionDetails.link_account.updateStatus.fetchState!=="In-Progress"&&n.setupView.plaidConnectionDetails.update_account.updateStatus.fetchState!=="In-Progress"&&n.setupView.accountUpdateStatus.fetchState!=="In-Progress"?void 0:"readonly";return{billingSetupView:n,uiState:t,stripeKey:be.stripeKey,isCardPaymentPopupOpen:!1,connectedAccountProvider:i.company?.featuresActivationInfo.connectedAccountProvider??"",isDisabled:s,analytics:q}}),(function(e,l){const{navigate:o,currentTenant:i,companyId:r}=l;return{onFetchLinkTokenClick:(n,t)=>{e(ee("billing_setup",n,t))},onEstablishConnectionClick:n=>{e(Y(n,r,"billing_setup","billing"))},onEstablishConnectionSuccess:()=>{e(ue("billing","billing_setup"))},onUpdatePaymentAccountStatus:(n,t,s)=>{e(ge(n,t,"billing","billing_setup",s))},onUpdatePaymentAccountLoginStatus:(n,t)=>{e(pe(!1,n,"billing","billing_setup",t))},onUpdateAccountClick:(n,t)=>{e(de(n,t,"billing","billing_setup"))},onBackClick:()=>{i?.companyBillPayInfo?.info?.isBillPayEnabled!=null&&i.companyBillPayInfo.info.isBillPayEnabled===!1?o("../.."):o("../")},onNavigateToDashboard:()=>{o("../dashboard")},handleCreateCardSetupIntent:n=>{e(me(n))},handleConfirmCardSetupIntent:n=>{e(qe(n))},updateCardPaymentModalState:n=>{e(Ke({isCardPaymentPopupOpen:n}))},handleAddCardPaymentSource:(n,t,s)=>{e(He(n,t,s))},handleFetchPaymentSources:()=>{e(Z())},resetCardPaymentViewState:()=>{e(Ze())},handleResetCardPaymentErrorStatuses:()=>{e($e())},onBillingAddressSave:n=>{e(Ge(n))},onAddressEditHandler:n=>{if(n!=null){const t=et(n);e(Le({addressType:"subscription_billing_address",addressToCreate:t}))}}}}))(Hn),yt=()=>{const e=O(),l=H(),o=U(),{tenantEmailDomain:i}=L(),[r,n]=d.useState(!1),[t,s]=d.useState(!1),[c,u]=d.useState(!1),h=C((_=>v(_))),S=C((_=>_.cardPaymentViewState)),m=C((_=>_.plaidAccountViewState.billing_setup.accountDetails.fetchStatus.fetchState)),p=Zn(S.addCardPaymentSourceStatus.fetchState),b=S.addCardPaymentSourceStatus.fetchState,E=h.companyId??P.getSignedInUserTenant(i)?.companyId;if(P.getSignedInUser()==null)throw Error("Can't access bank connections page without signing in...");const g=G();d.useEffect((()=>{E!=null&&o(Fe(E,!1))}),[E,o]),d.useEffect((()=>{t||(s(!0),o(Z()))}),[t,o]),d.useEffect((()=>{c||(me(["card"]),u(!0))}),[c]),d.useEffect((()=>{p==="In-Progress"&&b==="Completed"&&o(Z())}),[p,b]);const j=_=>{n(_)};return g?.loggedInUserRoleMap!=null?a.jsxs(ht,{children:[a.jsx(T,{isAppContentDrawerOpen:r,handleDrawerToggle:j}),a.jsx(Ct,{navigate:e,location:l,companyId:E,currentTenant:h,roleMap:g.loggedInUserRoleMap,onClickMenuIcon:()=>{j(!0)},googleAPIKey:be.googleMapsAPIKey})]}):a.jsx(ne,{fetchState:m})},Q="external_integrations",St=K((function(e){const l=Je(e,Q);return{notifyMeRegisteredSlugs:new Set(l.map((o=>o.additionalInfo)).filter((o=>o!=null)))}}),(function(e,l){const{navigate:o,integrationsView:i,signedInUserEmail:r,tenantEmailDomain:n,tenantId:t}=l;return{onBackClick:()=>{o("../")},onNavigateToDashboard:()=>{o("../dashboard")},onReconnectQBO:()=>{le.init("/connection/auth",n),le.handleClick()},onRefreshClick:()=>{i.integrations.refreshQBO.fetchState!=="In-Progress"&&e(tn())},onSaveChargeBeeCredentials:(s,c)=>{const u=i.externalConnections?.revenue?.find((h=>h.connectionName==="chargebee"))?.connectionId;u!=null&&e(en(t,u,W("revenue"),nn("chargebee"),{api_key:s,site:c}))},onConnectHubSpot:(s,c)=>{const u=i.externalConnections?.revenue?.find((h=>h.connectionName==="hubspot"))?.connectionId;if(u!=null){const h=`${window.location.origin}/oauth/hubspot/callback`;sessionStorage.setItem("hubspot_oauth_pending",JSON.stringify({client_id:s,client_secret:c,connection_id:u,redirect_uri:h,tenant_id:t}));const S="oauth crm.objects.deals.read crm.objects.owners.read";window.location.href=`https://app.hubspot.com/oauth/authorize?client_id=${encodeURIComponent(s)}&scope=${encodeURIComponent(S)}&redirect_uri=${encodeURIComponent(h)}`}},onDisconnect:(s,c)=>{e(Ye(t,s,W(c)))},onConnectGmail:()=>{e(ae(t,"gmail",window.location.href))},onConnectOutlook:()=>{e(ae(t,"outlook",window.location.href))},onSaveConnectorCredentials:s=>{e(Xe(t,W("payments"),s))},onNotifyMe:s=>{q.trackIntegrationsNotifyMeClicked("Settings",s),e(Qe(Q,s,r))}}}))(qn),bt=()=>{const e=Kn(),l=O(),o=U(),{tenantEmailDomain:i}=L(),{pendingAutoFocusTabId:r}=it(),[n,t]=d.useState(!1),s=C((I=>I.tenantState.fetchState)),c=C((I=>v(I))),u=c.companyId??P.getSignedInUserTenant(i)?.companyId,h=P.getSignedInUser(),S=G(),m=X(c.userRole??[]);if(h==null)throw Error("Can't access Integrations page without signing in...");d.useEffect((()=>{o(ze(Q))}),[o]);const[p,b]=d.useState(!1);d.useEffect((()=>{p||(b(!0),o(Z()))}),[p,o]);const E=I=>{t(I)},g=C((I=>We(I,u))),j=C((I=>I.plaidAccountViewState.external_account.plaidConnectionDetails)),{plaidAccounts:_,onAddPlaidAccount:R,onReLoginPlaidAccount:A}=rt({companyId:u??c.companyId});return S?.loggedInUserRoleMap!=null?a.jsxs(It,{children:[a.jsx(T,{isAppContentDrawerOpen:n,handleDrawerToggle:E}),a.jsx(St,{navigate:l,meetingUrl:e("settings_integrations"),onClickMenuIcon:()=>{E(!0)},isAdmin:m,integrationsView:g,signedInUserEmail:h.userEmail??"",tenantEmailDomain:c.tenantEmailDomain??i??"",tenantId:c.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((([I,x])=>[I,x?.message]))),deleteConnectionState:g.externalConnections?.deleteConnectionState??"Not-Started",deleteConnectionError:g.externalConnections?.deleteConnectionError?.message,isLoading:s==="In-Progress",autoFocusTabId:r??void 0,plaidAccounts:_,onAddPlaidAccount:R,onReLoginPlaidAccount:A,plaidConnectionDetails:j})]}):a.jsx(ne,{fetchState:s})},It=B.div`
25
+ `,Ct=K((function(e,l){const{companyId:o}=l,i=v(e),r=l.roleMap.bill_pay_admin,n=Fe(e,o),{uiState:t}=n,s=(Y(i?.userRole??[])||r)&&n.setupView.accountFetchStatus.fetchState!=="In-Progress"&&n.setupView.plaidConnectionDetails.link_account.updateStatus.fetchState!=="In-Progress"&&n.setupView.plaidConnectionDetails.update_account.updateStatus.fetchState!=="In-Progress"&&n.setupView.accountUpdateStatus.fetchState!=="In-Progress"?void 0:"readonly";return{billingSetupView:n,uiState:t,stripeKey:be.stripeKey,isCardPaymentPopupOpen:!1,connectedAccountProvider:i.company?.featuresActivationInfo.connectedAccountProvider??"",isDisabled:s,analytics:W}}),(function(e,l){const{navigate:o,currentTenant:i,companyId:r}=l;return{onFetchLinkTokenClick:(n,t)=>{e(ee("billing_setup",n,t))},onEstablishConnectionClick:n=>{e(X(n,r,"billing_setup","billing"))},onEstablishConnectionSuccess:()=>{e(ue("billing","billing_setup"))},onUpdatePaymentAccountStatus:(n,t,s)=>{e(ge(n,t,"billing","billing_setup",s))},onUpdatePaymentAccountLoginStatus:(n,t)=>{e(pe(!1,n,"billing","billing_setup",t))},onUpdateAccountClick:(n,t)=>{e(de(n,t,"billing","billing_setup"))},onBackClick:()=>{i?.companyBillPayInfo?.info?.isBillPayEnabled!=null&&i.companyBillPayInfo.info.isBillPayEnabled===!1?o("../.."):o("../")},onNavigateToDashboard:()=>{o("../dashboard")},handleCreateCardSetupIntent:n=>{e(me(n))},handleConfirmCardSetupIntent:n=>{e(We(n))},updateCardPaymentModalState:n=>{e(Ke({isCardPaymentPopupOpen:n}))},handleAddCardPaymentSource:(n,t,s)=>{e(He(n,t,s))},handleFetchPaymentSources:()=>{e(Z())},resetCardPaymentViewState:()=>{e(Ze())},handleResetCardPaymentErrorStatuses:()=>{e($e())},onBillingAddressSave:n=>{e(Ge(n))},onAddressEditHandler:n=>{if(n!=null){const t=et(n);e(Le({addressType:"subscription_billing_address",addressToCreate:t}))}}}}))(Hn),yt=()=>{const e=F(),l=H(),o=U(),{tenantEmailDomain:i}=L(),[r,n]=d.useState(!1),[t,s]=d.useState(!1),[c,u]=d.useState(!1),h=C((_=>v(_))),S=C((_=>_.cardPaymentViewState)),m=C((_=>_.plaidAccountViewState.billing_setup.accountDetails.fetchStatus.fetchState)),p=Zn(S.addCardPaymentSourceStatus.fetchState),b=S.addCardPaymentSourceStatus.fetchState,E=h.companyId??j.getSignedInUserTenant(i)?.companyId;if(j.getSignedInUser()==null)throw Error("Can't access bank connections page without signing in...");const g=G();d.useEffect((()=>{E!=null&&o(Ve(E,!1))}),[E,o]),d.useEffect((()=>{t||(s(!0),o(Z()))}),[t,o]),d.useEffect((()=>{c||(me(["card"]),u(!0))}),[c]),d.useEffect((()=>{p==="In-Progress"&&b==="Completed"&&o(Z())}),[p,b]);const P=_=>{n(_)};return g?.loggedInUserRoleMap!=null?a.jsxs(ht,{children:[a.jsx(T,{isAppContentDrawerOpen:r,handleDrawerToggle:P}),a.jsx(Ct,{navigate:e,location:l,companyId:E,currentTenant:h,roleMap:g.loggedInUserRoleMap,onClickMenuIcon:()=>{P(!0)},googleAPIKey:be.googleMapsAPIKey})]}):a.jsx(ne,{fetchState:m})},Q="external_integrations",St=K((function(e){const l=Je(e,Q);return{notifyMeRegisteredSlugs:new Set(l.map((o=>o.additionalInfo)).filter((o=>o!=null)))}}),(function(e,l){const{navigate:o,integrationsView:i,signedInUserEmail:r,tenantEmailDomain:n,tenantId:t}=l;return{onBackClick:()=>{o("../")},onNavigateToDashboard:()=>{o("../dashboard")},onReconnectQBO:()=>{le.init("/connection/auth",n),le.handleClick()},onRefreshClick:()=>{i.integrations.refreshQBO.fetchState!=="In-Progress"&&e(tn())},onSaveChargeBeeCredentials:(s,c)=>{const u=i.externalConnections?.revenue?.find((h=>h.connectionName==="chargebee"))?.connectionId;u!=null&&e(en(t,u,q("revenue"),nn("chargebee"),{api_key:s,site:c}))},onConnectHubSpot:(s,c)=>{const u=i.externalConnections?.revenue?.find((h=>h.connectionName==="hubspot"))?.connectionId;if(u!=null){const h=`${window.location.origin}/oauth/hubspot/callback`;sessionStorage.setItem("hubspot_oauth_pending",JSON.stringify({client_id:s,client_secret:c,connection_id:u,redirect_uri:h,tenant_id:t}));const S="oauth crm.objects.deals.read crm.objects.owners.read";window.location.href=`https://app.hubspot.com/oauth/authorize?client_id=${encodeURIComponent(s)}&scope=${encodeURIComponent(S)}&redirect_uri=${encodeURIComponent(h)}`}},onDisconnect:(s,c)=>{e(Xe(t,s,q(c)))},onConnectGmail:()=>{e(ae(t,"gmail",window.location.href))},onConnectOutlook:()=>{e(ae(t,"outlook",window.location.href))},onSaveConnectorCredentials:s=>{e(Ye(t,q("payments"),s))},onNotifyMe:s=>{W.trackIntegrationsNotifyMeClicked("Settings",s),e(Qe(Q,s,r))}}}))(Wn),bt=()=>{const e=Kn(),l=F(),o=U(),{tenantEmailDomain:i}=L(),{pendingAutoFocusTabId:r}=it(),[n,t]=d.useState(!1),s=C((I=>I.tenantState.fetchState)),c=C((I=>v(I))),u=c.companyId??j.getSignedInUserTenant(i)?.companyId,h=j.getSignedInUser(),S=G(),m=Y(c.userRole??[]);if(h==null)throw Error("Can't access Integrations page without signing in...");d.useEffect((()=>{o(ze(Q))}),[o]);const[p,b]=d.useState(!1);d.useEffect((()=>{p||(b(!0),o(Z()))}),[p,o]);const E=I=>{t(I)},g=C((I=>qe(I,u))),P=C((I=>I.plaidAccountViewState.external_account.plaidConnectionDetails)),{plaidAccounts:_,onAddPlaidAccount:R,onReLoginPlaidAccount:A}=rt({companyId:u??c.companyId});return S?.loggedInUserRoleMap!=null?a.jsxs(It,{children:[a.jsx(T,{isAppContentDrawerOpen:n,handleDrawerToggle:E}),a.jsx(St,{navigate:l,meetingUrl:e("settings_integrations"),onClickMenuIcon:()=>{E(!0)},isAdmin:m,integrationsView:g,signedInUserEmail:h.userEmail??"",tenantEmailDomain:c.tenantEmailDomain??i??"",tenantId:c.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((([I,x])=>[I,x?.message]))),deleteConnectionState:g.externalConnections?.deleteConnectionState??"Not-Started",deleteConnectionError:g.externalConnections?.deleteConnectionError?.message,isLoading:s==="In-Progress",autoFocusTabId:r??void 0,plaidAccounts:_,onAddPlaidAccount:R,onReLoginPlaidAccount:A,plaidConnectionDetails:P})]}):a.jsx(ne,{fetchState:s})},It=B.div`
26
26
  display: flex;
27
27
  height: 100%;
28
28
  width: 100%;
@@ -38,7 +38,7 @@ import{j as a}from"./liveblocks-V5YQZeeY.js";import{a as d}from"./sentry-bpmZUW7
38
38
  flex-direction: column;
39
39
  align-items: center;
40
40
  background-color: ${e=>e.theme.colors.grey4};
41
- `,Et=()=>{const e=U(),{tenantEmailDomain:l}=L(),[o,i]=d.useState(!1),r=C((p=>v(p))).companyId??P.getSignedInUserTenant(l)?.companyId,n=P.getSignedInUser();if(n==null)throw Error("Can't access my bank connections page without signing in...");const t=C((p=>an(p,n.userId))),s=C((p=>on(p,r,"bill_pay","user_reimbursement_account"))),{plaidConnectionDetails:c}=s,u=p=>{i(p)},h=d.useCallback((p=>{e(ee("user_reimbursement_account",p))}),[]),S=d.useCallback((p=>{e(Y(p,r,"user_reimbursement_account",void 0,"link_account_no_microdeposit"))}),[]);d.useEffect((()=>{t.fetchState!=="Completed"&&t.fetchState!=="In-Progress"&&e(sn(n.userId))}),[n.userId,t.fetchState]);const m=t.fetchState==="Not-Started"||t.fetchState==="In-Progress";return a.jsxs(xt,{children:[a.jsx(T,{isAppContentDrawerOpen:o,handleDrawerToggle:u}),a.jsx(zn,{plaidConnectionDetails:c,isLoading:m,myBankConnectionsView:t,onFetchLinkTokenClick:h,onEstablishConnectionClick:S,onClickMenuIcon:()=>{u(!0)}})]})},kt=B.div`
41
+ `,Et=()=>{const e=U(),{tenantEmailDomain:l}=L(),[o,i]=d.useState(!1),r=C((p=>v(p))).companyId??j.getSignedInUserTenant(l)?.companyId,n=j.getSignedInUser();if(n==null)throw Error("Can't access my bank connections page without signing in...");const t=C((p=>an(p,n.userId))),s=C((p=>on(p,r,"bill_pay","user_reimbursement_account"))),{plaidConnectionDetails:c}=s,u=p=>{i(p)},h=d.useCallback((p=>{e(ee("user_reimbursement_account",p))}),[]),S=d.useCallback((p=>{e(X(p,r,"user_reimbursement_account",void 0,"link_account_no_microdeposit"))}),[]);d.useEffect((()=>{t.fetchState!=="Completed"&&t.fetchState!=="In-Progress"&&e(sn(n.userId))}),[n.userId,t.fetchState]);const m=t.fetchState==="Not-Started"||t.fetchState==="In-Progress";return a.jsxs(xt,{children:[a.jsx(T,{isAppContentDrawerOpen:o,handleDrawerToggle:u}),a.jsx(zn,{plaidConnectionDetails:c,isLoading:m,myBankConnectionsView:t,onFetchLinkTokenClick:h,onEstablishConnectionClick:S,onClickMenuIcon:()=>{u(!0)}})]})},kt=B.div`
42
42
  display: flex;
43
43
  height: 100%;
44
44
  width: 100%;
@@ -46,4 +46,4 @@ import{j as a}from"./liveblocks-V5YQZeeY.js";import{a as d}from"./sentry-bpmZUW7
46
46
  flex-direction: column;
47
47
  align-items: center;
48
48
  background-color: ${e=>e.theme.colors.grey4};
49
- `,ce=({appContent:e})=>{const l=U(),o=O(),i=H(),[r,n]=d.useState(!1),t=C((y=>v(y))),{tenantEmailDomain:s}=t,c=t.companyId??P.getSignedInUserTenant(s)?.companyId;if(P.getSignedInUser()==null)throw Error("Can't access My Profile page without signing in...");const{useFeatureGate:u}=te(),h=!!t.company?.companyZeniAccountInfo?.isZeniAccountEnabled,{isFeatureEnabled:S}=u(V.isChargeCardFeatureEnabled),{isFeatureEnabled:m}=u(V.isDebitCardFeatureEnabled),p=t.companyTreasuryInfo?.info?.businessVerificationStatus?.code==="verified",b=C((y=>rn(y))),E=fe(t),g=he(m,t),j=!g&&b,_=ye(t,S,m),{isCardsHidden:R}=Se(t?.tenantId),A=!_||R,{areTenantIdsInSync:I}=Wn();d.useEffect((()=>{I&&l(ln(c,j))}),[c,l,j,I]);const x=C((y=>cn(y,j))),M=x.fetchState==="Not-Started"||x.fetchState==="In-Progress"||c==null,w=dn(t),f=!!t.company?.featuresActivationInfo?.isReimbursementFeatureEnabled,D=y=>{n(y)};return a.jsxs(kt,{children:[a.jsx(T,{isAppContentDrawerOpen:r,handleDrawerToggle:D}),e!=null?a.jsx(a.Fragment,{children:e}):a.jsx(Jn,{myProfileView:x,isAccountingClassesEnabled:b,isReimbursementDisabled:f===!1,isZeniAccountsDisabled:h===!1,isChargeCardDisabled:A,isTreasuryDisabled:p===!1,isLiteRoleDisabled:w===!1,onClickMenuIcon:()=>{D(!0)},isLoading:M,isBankingOnlyTenant:g,isCardsOnlyTenant:E,onAddressClick:y=>{const N=(function(ke,_e){let z=`/${ke}/settings/my_profile`;return z=z.concat(`/new/${_e}`),z})(s,y),Ee=Qn(i.state?.pathnameStackToGoBack,i.pathname);o(N,{state:{pathnameStackToGoBack:Ee}})},onGetOtp:y=>{const N={...x.myProfileLocalData,phone:y};l(oe({localData:N})),l(mn(y,"MyProfile"))},onResendOtp:y=>{l(gn(y,"MyProfile"))},onCancelClick:()=>{l(pn())},onSaveClick:()=>{l(se("MyProfile",x.myProfileLocalData.phone,x.myProfileLocalData.otpChallenge,x.myProfileLocalData.dateOfBirth,x.addressData?.addressToCreate))},onVerifyOtp:(y,N)=>{l(un(y,N,"MyProfile"))},onVerifyOtpSuccess:y=>{y!=null&&P.saveZeniOtpToken(y),l(se("MyProfile",x.myProfileLocalData.phone,x.myProfileLocalData.otpChallenge,x.myProfileLocalData.dateOfBirth,x.addressData?.addressToCreate))},updateMyProfileLocalData:y=>{l(oe({localData:y}))}})]})};function _t(){const e=U(),l=C((f=>v(f))),o=l.companyId,i=l.tenantId,r=C((f=>fn(f))),n=C((f=>Ce(f))),t=C((f=>hn(f.notificationRegistryState))),s=C((f=>Cn(f))),c=C((f=>yn(f))),u=Ie(),{isZeniUser:h,isNotificationControlsEnabled:S}=xe(u),[m,p]=d.useState(!1),b=d.useCallback((f=>{p(f)}),[]),E=d.useCallback((f=>{e(Sn(f))}),[]),g=d.useCallback((()=>{u?.userEmail!=null&&e(bn({loggedInUserEmail:u.userEmail})),e(In())}),[u?.userEmail]),j=d.useCallback((()=>{e(xn()),c&&e(En())}),[c]);if(u==null)throw Error("Can't access Notification Settings page without signing in...");const _=d.useCallback((()=>{const f=n.notificationSettings.monthEndInsightsNotificationSettings.enabled!=null;e(ie(f,o)),e($())}),[o,n.notificationSettings.monthEndInsightsNotificationSettings.enabled]),R=d.useCallback((()=>{e(kn())}),[]),A=d.useCallback(((f,D,y)=>{e(_n({eventId:f,channel:re(D),enabled:y}))}),[e]),I=d.useCallback(((f,D)=>{e(jn({groupId:f,frequency:Pn(D)}))}),[e]),x=d.useCallback(((f,D,y)=>{e(vn({groupId:f,channel:re(D),enabled:y}))}),[e]),M=d.useMemo((()=>{if(S&&t!=null)return{isZeniUser:h,registry:t,preferences:s,onToggleEventChannel:A,onSetGroupFrequency:I,onSetGroupChannelMaster:x}}),[S,h,t,s,A,I,x]);d.useEffect((()=>{i!=null&&n.fetchState==="Not-Started"&&e($())}),[e,i,n.fetchState]);const w=d.useRef(i);return d.useEffect((()=>{w.current!==i&&(e(wn()),e(An()),e($()),w.current=i)}),[e,i]),d.useEffect((()=>{if(n.fetchState==="Completed"&&r.fetchState!=="In-Progress"&&r.fetchState!=="Completed"){const f=n.notificationSettings.monthEndInsightsNotificationSettings.enabled!=null;e(ie(f,o))}}),[r.fetchState,o,n.notificationSettings.monthEndInsightsNotificationSettings.enabled,n.fetchState]),a.jsxs(a.Fragment,{children:[a.jsx(T,{isAppContentDrawerOpen:m,handleDrawerToggle:b}),a.jsx(Xn,{notificationSettingsView:r,onFormDataChange:E,onCancel:g,onSave:j,onClickMenuIcon:()=>{b(!0)},signedInUser:u,onRefresh:_,resetUpdateStatus:R,taskNotifications:M,isTaskNotificationsDirty:c})]})}function ua(e){const[l,o]=d.useState(!1),i=C((b=>Ce(b))),r=C((b=>v(b))),n=G(),t=Ie(),s=U(),{useFeatureGate:c}=te(),{isFeatureEnabled:u}=c(V.isDebitCardFeatureEnabled),{isTaskManagerAccessEnabled:h}=xe(t),S=t?.userEmail==null||i.fetchState!=="Completed"||Dn(i.notificationSettings,t.userEmail,u,r,h);d.useEffect((()=>{i.fetchState!=="In-Progress"&&i.fetchState!=="Completed"&&l===!1&&(o(!0),s($()))}),[i.fetchState,l]);const m=he(u,r),p=fe(r);return i.fetchState!=="In-Progress"&&i.fetchState!=="Not-Started"||S!==!0?Un(r)?a.jsxs(J,{children:[Rn(n?.loggedInUserRole??[],u,r,n?.loggedInUserRoleMap)&&a.jsx(k,{path:"accounting/*",element:a.jsx(Yn,{})}),Tn(n?.loggedInUserRole??[],u,r,n?.loggedInUserRoleMap)&&a.jsx(k,{path:"approval_rules/*",element:a.jsx(jt,{hasAdminLevelAccess:e.hasAdminLevelAccess})}),Mn(r,n?.loggedInUserRoleMap)&&a.jsx(k,{path:"my_bank_connections",element:a.jsx(Et,{})}),Bn(r,n?.loggedInUserRoleMap)&&a.jsx(k,{path:"bank_connections",element:a.jsx(ft,{})}),Nn(r,n?.loggedInUserRoleMap)&&a.jsx(k,{path:"business_verification",element:a.jsx(ot,{productType:m?"zeni_accounts":p?"charge_cards":tt(r,n?.loggedInUserRoleMap)})}),Vn(n?.loggedInUserRole??[],r,n?.loggedInUserRoleMap)&&a.jsx(k,{path:"company_details",element:a.jsx(st,{})}),Fn(n?.loggedInUserRole??[],r)&&a.jsx(k,{path:"billing",element:a.jsx(yt,{})}),On(n?.loggedInUserRole??[],u,r)&&a.jsx(k,{path:"integrations",element:a.jsx(bt,{})}),a.jsx(k,{path:"my_profile/new/:addressType",element:a.jsx(ce,{appContent:a.jsx(nt,{isSubPage:!1})})}),a.jsx(k,{path:"my_profile",element:a.jsx(ce,{})}),S&&a.jsx(k,{path:"notifications",element:a.jsx(_t,{})}),a.jsx(k,{path:"*",element:a.jsx(F,{})})]}):a.jsx(J,{children:a.jsx(k,{path:"*",element:a.jsx(F,{})})}):null}function jt(e){return a.jsxs(J,{children:[a.jsx(k,{path:"/",element:a.jsx(pt,{})}),a.jsx(k,{path:"bills/approval-rules/*",element:a.jsx(lt,{})}),a.jsx(k,{path:"reimbursements/approval-rules/*",element:e.hasAdminLevelAccess?a.jsx(ct,{}):a.jsx(F,{})}),a.jsx(k,{path:"*",element:a.jsx(F,{})})]})}export{ua as default};
49
+ `,ce=({appContent:e})=>{const l=U(),o=F(),i=H(),[r,n]=d.useState(!1),t=C((y=>v(y))),{tenantEmailDomain:s}=t,c=t.companyId??j.getSignedInUserTenant(s)?.companyId;if(j.getSignedInUser()==null)throw Error("Can't access My Profile page without signing in...");const{useFeatureGate:u}=te(),h=!!t.company?.companyZeniAccountInfo?.isZeniAccountEnabled,{isFeatureEnabled:S}=u(O.isChargeCardFeatureEnabled),{isFeatureEnabled:m}=u(O.isDebitCardFeatureEnabled),p=t.companyTreasuryInfo?.info?.businessVerificationStatus?.code==="verified",b=C((y=>rn(y))),E=fe(t),g=he(m,t),P=!g&&b,_=ye(t,S,m),{isCardsHidden:R}=Se(t?.tenantId),A=!_||R,{areTenantIdsInSync:I}=qn();d.useEffect((()=>{I&&l(ln(c,P))}),[c,l,P,I]);const x=C((y=>cn(y,P))),M=x.fetchState==="Not-Started"||x.fetchState==="In-Progress"||c==null,w=dn(t),f=!!t.company?.featuresActivationInfo?.isReimbursementFeatureEnabled,D=y=>{n(y)};return a.jsxs(kt,{children:[a.jsx(T,{isAppContentDrawerOpen:r,handleDrawerToggle:D}),e!=null?a.jsx(a.Fragment,{children:e}):a.jsx(Jn,{myProfileView:x,isAccountingClassesEnabled:b,isReimbursementDisabled:f===!1,isZeniAccountsDisabled:h===!1,isChargeCardDisabled:A,isTreasuryDisabled:p===!1,isLiteRoleDisabled:w===!1,onClickMenuIcon:()=>{D(!0)},isLoading:M,isBankingOnlyTenant:g,isCardsOnlyTenant:E,onAddressClick:y=>{const N=(function(ke,_e){let z=`/${ke}/settings/my_profile`;return z=z.concat(`/new/${_e}`),z})(s,y),Ee=Qn(i.state?.pathnameStackToGoBack,i.pathname);o(N,{state:{pathnameStackToGoBack:Ee}})},onGetOtp:y=>{const N={...x.myProfileLocalData,phone:y};l(oe({localData:N})),l(mn(y,"MyProfile"))},onResendOtp:y=>{l(gn(y,"MyProfile"))},onCancelClick:()=>{l(pn())},onSaveClick:()=>{l(se("MyProfile",x.myProfileLocalData.phone,x.myProfileLocalData.otpChallenge,x.myProfileLocalData.dateOfBirth,x.addressData?.addressToCreate))},onVerifyOtp:(y,N)=>{l(un(y,N,"MyProfile"))},onVerifyOtpSuccess:y=>{y!=null&&j.saveZeniOtpToken(y),l(se("MyProfile",x.myProfileLocalData.phone,x.myProfileLocalData.otpChallenge,x.myProfileLocalData.dateOfBirth,x.addressData?.addressToCreate))},updateMyProfileLocalData:y=>{l(oe({localData:y}))}})]})};function _t(){const e=U(),l=C((f=>v(f))),o=l.companyId,i=l.tenantId,r=C((f=>fn(f))),n=C((f=>Ce(f))),t=C((f=>hn(f.notificationRegistryState))),s=C((f=>Cn(f))),c=C((f=>yn(f))),u=Ie(),{isZeniUser:h,isNotificationControlsEnabled:S}=xe(u),[m,p]=d.useState(!1),b=d.useCallback((f=>{p(f)}),[]),E=d.useCallback((f=>{e(Sn(f))}),[]),g=d.useCallback((()=>{u?.userEmail!=null&&e(bn({loggedInUserEmail:u.userEmail})),e(In())}),[u?.userEmail]),P=d.useCallback((()=>{e(xn()),c&&e(En())}),[c]);if(u==null)throw Error("Can't access Notification Settings page without signing in...");const _=d.useCallback((()=>{const f=n.notificationSettings.monthEndInsightsNotificationSettings.enabled!=null;e(ie(f,o)),e($())}),[o,n.notificationSettings.monthEndInsightsNotificationSettings.enabled]),R=d.useCallback((()=>{e(kn())}),[]),A=d.useCallback(((f,D,y)=>{e(_n({eventId:f,channel:re(D),enabled:y}))}),[e]),I=d.useCallback(((f,D)=>{e(Pn({groupId:f,frequency:jn(D)}))}),[e]),x=d.useCallback(((f,D,y)=>{e(vn({groupId:f,channel:re(D),enabled:y}))}),[e]),M=d.useMemo((()=>{if(S&&t!=null)return{isZeniUser:h,registry:t,preferences:s,onToggleEventChannel:A,onSetGroupFrequency:I,onSetGroupChannelMaster:x}}),[S,h,t,s,A,I,x]);d.useEffect((()=>{i!=null&&n.fetchState==="Not-Started"&&e($())}),[e,i,n.fetchState]);const w=d.useRef(i);return d.useEffect((()=>{w.current!==i&&(e(wn()),e(An()),e($()),w.current=i)}),[e,i]),d.useEffect((()=>{if(n.fetchState==="Completed"&&r.fetchState!=="In-Progress"&&r.fetchState!=="Completed"){const f=n.notificationSettings.monthEndInsightsNotificationSettings.enabled!=null;e(ie(f,o))}}),[r.fetchState,o,n.notificationSettings.monthEndInsightsNotificationSettings.enabled,n.fetchState]),a.jsxs(a.Fragment,{children:[a.jsx(T,{isAppContentDrawerOpen:m,handleDrawerToggle:b}),a.jsx(Yn,{notificationSettingsView:r,onFormDataChange:E,onCancel:g,onSave:P,onClickMenuIcon:()=>{b(!0)},signedInUser:u,onRefresh:_,resetUpdateStatus:R,taskNotifications:M,isTaskNotificationsDirty:c})]})}function ua(e){const[l,o]=d.useState(!1),i=C((b=>Ce(b))),r=C((b=>v(b))),n=G(),t=Ie(),s=U(),{useFeatureGate:c}=te(),{isFeatureEnabled:u}=c(O.isDebitCardFeatureEnabled),{isTaskManagerAccessEnabled:h}=xe(t),S=t?.userEmail==null||i.fetchState!=="Completed"||Dn(i.notificationSettings,t.userEmail,u,r,h);d.useEffect((()=>{i.fetchState!=="In-Progress"&&i.fetchState!=="Completed"&&l===!1&&(o(!0),s($()))}),[i.fetchState,l]);const m=he(u,r),p=fe(r);return i.fetchState!=="In-Progress"&&i.fetchState!=="Not-Started"||S!==!0?Un(r)?a.jsxs(J,{children:[Rn(n?.loggedInUserRole??[],u,r,n?.loggedInUserRoleMap)&&a.jsx(k,{path:"accounting/*",element:a.jsx(Xn,{})}),Tn(n?.loggedInUserRole??[],u,r,n?.loggedInUserRoleMap)&&a.jsx(k,{path:"approval_rules/*",element:a.jsx(Pt,{hasAdminLevelAccess:e.hasAdminLevelAccess})}),Mn(r,n?.loggedInUserRoleMap)&&a.jsx(k,{path:"my_bank_connections",element:a.jsx(Et,{})}),Bn(r,n?.loggedInUserRoleMap)&&a.jsx(k,{path:"bank_connections",element:a.jsx(ft,{})}),Nn(r,n?.loggedInUserRoleMap)&&a.jsx(k,{path:"business_verification",element:a.jsx(ot,{productType:m?"zeni_accounts":p?"charge_cards":tt(r,n?.loggedInUserRoleMap)})}),On(n?.loggedInUserRole??[],r,n?.loggedInUserRoleMap)&&a.jsx(k,{path:"company_details",element:a.jsx(st,{})}),Vn(n?.loggedInUserRole??[],r)&&a.jsx(k,{path:"billing",element:a.jsx(yt,{})}),Fn(n?.loggedInUserRole??[],u,r)&&a.jsx(k,{path:"integrations",element:a.jsx(bt,{})}),a.jsx(k,{path:"my_profile/new/:addressType",element:a.jsx(ce,{appContent:a.jsx(nt,{isSubPage:!1})})}),a.jsx(k,{path:"my_profile",element:a.jsx(ce,{})}),S&&a.jsx(k,{path:"notifications",element:a.jsx(_t,{})}),a.jsx(k,{path:"*",element:a.jsx(V,{})})]}):a.jsx(J,{children:a.jsx(k,{path:"*",element:a.jsx(V,{})})}):null}function Pt(e){return a.jsxs(J,{children:[a.jsx(k,{path:"/",element:a.jsx(pt,{})}),a.jsx(k,{path:"bills/approval-rules/*",element:a.jsx(lt,{})}),a.jsx(k,{path:"reimbursements/approval-rules/*",element:e.hasAdminLevelAccess?a.jsx(ct,{}):a.jsx(V,{})}),a.jsx(k,{path:"*",element:a.jsx(V,{})})]})}export{ua as default};
@@ -1,4 +1,4 @@
1
- import{j as d}from"./liveblocks-V5YQZeeY.js";import{h as X,g as Q,u as ee,i as W,j as k,N as R,l as H,t as en}from"./core-BWRpGVdr.js";import{bH as nn,fE as V,cE as tn,Ik as J,ZY as an,Z$ as sn,v2 as ne,uS as te,mz as ae,C6 as L,_1 as be,gF as He,gE as Ge,gD as Ke,_2 as on,It as cn,N1 as Ce,MU as he,MR as Ie,Mw as Y,MX as Ae,M_ as _e,N4 as ke,CA as ve,g_ as rn,cz as dn,dZ as un,dY as ln,dg as pn,bq as mn,cs as Fe,_3 as yn,Lw as fe,M8 as fn,_4 as gn,bI as Sn,Om as ge,Oa as bn,_5 as Cn,_6 as hn,Oq as In,Ou as An,_7 as je,B$ as _n,T3 as kn,_8 as vn,_9 as Pn,_a as Tn,_b as qe,_c as En,_d as Dn,W9 as Un,Zd as On,Wo as wn,_e as Je,MI as Fn,MA as Vn,Wp as xn,ME as Bn,_f as Oe,Pa as Ye,mH as jn,uV as Xe,C8 as Rn,bC as Re,Ck as Ne,cC as Nn,_g as Qe,P0 as we,OJ as Ln,OK as Mn,OO as zn,_h as Zn,P3 as Le,_i as $n,_j as Wn,_k as Hn,PR as Se,_l as Gn,gV as Kn,JF as qn,_m as Jn,JK as Yn,JJ as Xn}from"./zeni-epic-state-BlWDBO75.js";import{ah as Pe,V as ie,p as ue,c as q,z as E,a7 as se,m as D,a6 as Te,S as $,bS as Qn,ad as oe,bT as x,bk as Ve,bU as et,bV as nt,bW as tt,x as Be,bX as at,n as Me,aF as ze,a0 as it,aa as st,bY as ot,bZ as ct,b_ as rt,w as dt}from"./index-9pdMsp-M.js";import{a as h}from"./sentry-bpmZUW7k.js";import{u as Ee,n as xe,D as ut,S as lt}from"./mui-BmHHlwSU.js";import{u as pt,d as Ze,B as Ue}from"./BusinessVerificationPageScreen-71JxUYXB.js";import{M as le}from"./MobileAppDrawer-rCVKr3J3.js";import N from"./NotFoundScreen-C94S-cmy.js";import{a as $e}from"./analyticsHelper-Cn2rORl_.js";import{d as We}from"./routePaths--TXDBUUo.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]="72d2bda9-be75-48d3-930b-6ad1bd650721",e._sentryDebugIdIdentifier="sentry-dbid-72d2bda9-be75-48d3-930b-6ad1bd650721")}catch{}})();const mt=xe.div`
1
+ import{j as u}from"./liveblocks-DxRiM6VH.js";import{h as X,g as Q,u as ee,i as W,j as k,N as R,l as G,t as en}from"./core--MkqccHv.js";import{bL as nn,fI as V,cI as tn,Io as J,_0 as an,_3 as sn,v6 as ne,uW as te,mD as ae,Ca as L,_5 as be,gJ as Ge,gI as He,gH as qe,_6 as on,Ix as cn,N5 as Ce,MY as he,MV as Ie,MA as Y,M$ as Ae,N2 as _e,N8 as ke,CE as ve,h2 as rn,cD as un,e1 as dn,e0 as ln,dk as pn,bu as mn,cw as Fe,_7 as yn,LA as fe,Mc as fn,_8 as gn,bM as Sn,Oq as ge,Oe as bn,_9 as Cn,_a as hn,Ou as In,Oy as An,_b as je,C3 as _n,T7 as kn,_c as vn,_d as Pn,_e as Tn,_f as Ke,_g as En,_h as Dn,Wd as On,Zh as Un,Ws as wn,_i as Je,MM as Fn,ME as Vn,Wt as xn,MI as Bn,_j as Ue,Pe as Ye,mL as jn,uZ as Xe,Cc as Rn,bG as Re,Co as Ne,cG as Nn,_k as Qe,P4 as we,ON as Ln,OO as Mn,OS as zn,_l as Zn,P7 as Le,_m as $n,_n as Wn,_o as Gn,PV as Se,_p as Hn,gZ as qn,JJ as Kn,_q as Jn,JO as Yn,JN as Xn}from"./zeni-epic-state-Dg1W8Zu5.js";import{ag as Pe,V as ie,p as de,d as K,z as E,a6 as se,k as D,a5 as Te,O as $,bR as Qn,ac as oe,bS as x,bj as Ve,bT as et,bU as nt,bV as tt,q as Be,bW as at,l as Me,aE as ze,$ as it,a9 as st,bX as ot,bY as ct,bZ as rt,w as ut}from"./index-B3QEycF9.js";import{a as h}from"./sentry-B-dIf5xz.js";import{u as Ee,n as xe,D as dt,S as lt}from"./mui-kCJnrqYM.js";import{u as pt,d as Ze,B as Oe}from"./BusinessVerificationPageScreen-BBfkNXWr.js";import{M as le}from"./MobileAppDrawer-DfwkluKE.js";import N from"./NotFoundScreen-QNLsV8PR.js";import{a as $e}from"./analyticsHelper-BwgoMQXe.js";import{d as We}from"./routePaths-33YxbFc-.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]="e57aa233-d145-4343-963c-d343ecad92fd",e._sentryDebugIdIdentifier="sentry-dbid-e57aa233-d145-4343-963c-d343ecad92fd")}catch{}})();const mt=xe.div`
2
2
  display: flex;
3
3
  height: 100%;
4
4
  width: 100%;
@@ -6,7 +6,7 @@ import{j as d}from"./liveblocks-V5YQZeeY.js";import{h as X,g as Q,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
- `,yt=H((function(e,o){const{isUserBillPayAdmin:a,companyId:t}=o,r=V(e),n=an(e),i=E.getSignedInUser(),l=r.tenantId,s={userId:i?.userId??"",sessionId:i?.zeniSessionId??"",tenantId:l??""},c=sn(e,t),p=a&&c.updateStatus.fetchState!=="In-Progress"&&c.plaidConnectionDetails.link_account.updateStatus.fetchState!=="In-Progress"&&c.plaidConnectionDetails.update_account.updateStatus.fetchState!=="In-Progress"&&c.accountUpdateStatus?.fetchState!=="In-Progress"?void 0:"readonly";return{billPaySetupView:c,connectedAccountProvider:r.company?.featuresActivationInfo.connectedAccountProvider??"",showIntlWiseWidget:o.showIntlWiseWidget,isDisabled:p,billpayApprovalView:n,analytics:D,filesEndPoint:`${oe.fileMicroServiceBaseUrl}`,authParams:s}}),(function(e,o){const{navigate:a,companyId:t,currentTenant:r}=o;return{onBusinessVerificationSectionClick:()=>{a("../verification"),r?.company?.companyBillPayInfo!=null&&r?.company?.companyBillPayInfo?.businessVerificationStatus?.code==="pending_review"&&e(J(t,!1,!0))},onSetupApprovalRulesSectionClick:()=>{a("../approval-rules")},onFetchLinkTokenClick:(n,i)=>{e(ve("bill_pay_setup",n,i))},onEstablishConnectionClick:n=>{e(ke(n,t,"bill_pay_setup","bill_pay"))},onUpdatePaymentAccountStatus:(n,i,l)=>{e(_e(n,i,"bill_pay","bill_pay_setup",l))},onUpdatePaymentAccountLoginStatus:(n,i)=>{e(Ae(!1,n,"bill_pay","bill_pay_setup",i))},onEstablishConnectionSuccess:()=>{e(J(t,!0))},onEnableBillPayClick:()=>{e(Y(t,"bill_pay"))},onUpdateAccountClick:(n,i,l)=>{e(l==="paymentAccount"?he(n,i,"bill_pay","bill_pay_setup"):Ie("reimbursement_setup",n,i))},onUpdatePrimaryFundingAccount:(n,i)=>{e(Ce(t,"bill_pay_setup",n,i))},onEnableBillPaySuccess:()=>{a("../",{relative:"path"})},onBackClick:()=>{r?.companyBillPayInfo?.info?.isBillPayEnabled!=null&&r.companyBillPayInfo.info.isBillPayEnabled===!1?a("../.."):a("../",{relative:"path"})},onAcceptUpdatedTOS:()=>{e(cn(t))},onAcceptUpdatedTOSSuccess:()=>{e(J(t,!0))},onGetOtp:(n,i)=>{e(Ke(n,"SpendManagementSetup")),i!=null&&e(on({officerType:i,phone:n}))},onResendOtp:n=>{e(Ge(n,"SpendManagementSetup"))},onVerifyOtp:(n,i)=>{e(He(n,i,"SpendManagementSetup"))},onVerifyOtpSuccess:(n,i)=>{n!=null&&i!=null&&e(L(t,n,"bill_pay",!0,!0))},onNavigateToDashboard:()=>{a("../../dashboard")},onNavigateToSettings:()=>{a("../bills/setup")},onInternationPaymentSetUpClick:()=>{a("../international-wire")},onCompanyOfficerUpdated:(n,i)=>{e(be({officerType:n,fileIds:i}))},onSendForVerificationClick:n=>{e(L(t,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]))}}}))(Qn),ft=()=>{const e=Pe(),o=X(),a=Q(),t=ee(),{tenantEmailDomain:r}=W(),n=ie(),i=nn(n?.loggedInUserRoleMap),{useFeatureGate:l}=ue(),{isFeatureEnabled:s}=l(q.billPaySetupShowInternationalPaymentByWise),{isFeatureEnabled:c}=l(q.isBillPayLocalCurrencyFeatureEnabled),p=Ee(),[g,S]=h.useState(!1),_=h.useRef(!1),I=k((m=>m.billPaySetupViewState.fetchState)),u=k((m=>V(m)));pt();const y=u.companyId??E.getSignedInUserTenant(r)?.companyId;if(E.getSignedInUser()==null)throw Error("Can't access bill pay setup page without signing in...");const f=!!u.companyBillPayInfo?.info?.isBillPayTOSAccepted,v=tn(n?.loggedInUserRoleMap);h.useEffect((()=>{_.current||I!=="Not-Started"||y==null?_.current||I!=="Completed"||y==null||u.companyBillPayInfo?.info?.businessVerificationStatus?.code!=="pending_review"||(_.current=!0,t(J(y,!1,!0))):(_.current=!0,t(J(y,!0)))}),[I,y,t]);const b=m=>{S(m)};if(f===!1||v&&!n?.loggedInUserRoleMap?.bill_pay_admin)return d.jsx(R,{to:"../promo"});if(f===!0&&n?.loggedInUserRoleMap!=null){const m=C=>C.trackPageLoaded($.Event.billPaySetup);return d.jsxs(mt,{children:[d.jsx(se,{analytics:D,onLoad:C=>m(C)}),d.jsx(le,{isAppContentDrawerOpen:g,handleDrawerToggle:b}),d.jsx(yt,{navigate:o,location:a,companyId:y,currentTenant:u,isUserBillPayAdmin:i,showIntlWiseWidget:s,meetingUrl:e("bill_pay_setup"),onClickMenuIcon:()=>{b(!0)},isLocalCurrencyEnabled:c})]})}return d.jsx(Te,{fetchState:"In-Progress",style:{backgroundColor:p.colors.grey5}})},Gt=(e,o)=>e!=null&&(function(a){return a==="debit"||a==="credit"||a==="debit_and_credit"})(e)?e:o,Kt=e=>`/${e}/cards`,qt=e=>`/${e}/cards/setup`,Jt=e=>`/${e}/cards/onboard`,Yt=(e,o,a,t,r=!1)=>{let n=`/${e}/cards/${encodeURIComponent(o)}`;return t==null||t.status.code!=="inactive"||t.cardHolderUserId!==a.userId||t.type.code!=="business_physical_credit_card"&&t.type.code!=="business_physical_debit_card"?t!=null&&t.status.code==="active"&&t.cardHolderUserId===a.userId&&t.type.code==="business_physical_credit_card"&&r===!0?n+="/addToWallet":t==null||t.type.code!=="business_physical_debit_card"&&t.type.code!=="business_virtual_debit_card"||t.status.code!=="active"||t.cardHolderUserId!==a.userId||t.isPinSet!==!1||(n+="/setPin"):n+="/activate",n},Xt=(e,o)=>e.find((a=>a.id===o)),Qt=(e,o,a)=>!e||!o||a.fetchState==="Completed",gt=(e,o,a,t)=>({isCreditCardOffered:e,isDebitCardOffered:o,isDebitCardEnabled:a,isCreditCardEnabled:t}),ea=(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,na=(e,o,a,t,r)=>e&&o&&a?{creditAccountId:t.id,creditAccountLimit:x(t.limit.amount),creditAccountAvailableAmount:x(t.available.amount),creditAccountSpentAmount:x(t.balance.amount+t.hold.amount),creditAccountStatus:t.status,outstandingBalance:x(r.remainingAmountDue.amount)}:void 0,ta=(e,o,a,t,r)=>e&&o&&a?{debitAccountId:t.depositAccounts.map((n=>n.id)),debitAccountName:t.depositAccounts.map((n=>n.accountName)),debitAccountBalance:t.depositAccounts.map((n=>x(n.accountBalance.available.amount))),debitCardsSpend:x(r?.currentMonthSpends.amount??0),debitAccountStatus:t.depositAccounts.map((n=>n.accountStatus))}:void 0,aa=(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,ia=80,sa=80,oa=e=>e.companyId??E.getSignedInUserTenant(e.tenantEmailDomain)?.companyId,St=({isBankingOnlyTenant:e,isDebitCardFeatureEnabled:o})=>o||e,bt=({isCardsOnlyTenant:e,isChargeCardFeatureEnabled:o,isBookKeepingTenant:a,isDebitCardProductVisible:t,chargeCardsCreditAccountLimit:r})=>(e||o||a)&&(!t||r>0),ca=({isCardsOnlyTenant:e,isChargeCardFeatureEnabled:o,isBookKeepingTenant:a})=>e||o||a,ra=({cardInfo:e,isProductVisible:o,isTOSAccepted:a,isSetupEnabled:t,isUserHasCardsAdminLevelAccess:r,isUserHasCardsAccess:n})=>!!e&&o&&(!a&&r||n&&!r&&!t),Ct=H((function(e,o){const{isUserChargeCardAdmin:a,chargeCardSetUpView:t,isDebitCardOnlyEnabled:r,isCreditCardOnlyEnabled:n}=o,i=V(e),l=E.getSignedInUser(),s=i.tenantId,c={userId:l?.userId??"",sessionId:l?.zeniSessionId??"",tenantId:s??""},p=a&&t.updateStatus.fetchState!=="In-Progress"&&t.plaidConnectionDetails.link_account.updateStatus.fetchState!=="In-Progress"&&t.plaidConnectionDetails.update_account.updateStatus.fetchState!=="In-Progress"&&t.accountUpdateStatus?.fetchState!=="In-Progress"?void 0:"readonly";return{chargeCardSetUpView:t,connectedAccountProvider:i.company?.featuresActivationInfo.connectedAccountProvider??"",isDisabled:p,analytics:D,isDebitCardOnlyEnabled:r,isCreditCardOnlyEnabled:n,filesEndPoint:`${oe.fileMicroServiceBaseUrl}`,authParams:c}}),(function(e,o){const{navigate:a,companyId:t,currentTenant:r,chargeCardSetUpView:n,isDebitCardTOSAccepted:i,isChargeCardTOSAccepted:l,isChargeCardSetupEnabled:s,isDebitCardSetupEnabled:c,productInformation:p,controllerEmails:g,businessVerificationStatus:S,isCardPolicyEnabled:_,isUserChargeCardAdmin:I}=o;return{onBusinessVerificationSectionClick:()=>{D.trackCardsVerifyIdentityCompanyDetailsClick(g,p,S?.code),a("../verification"),r?.company?.companyChargeCardInfo!=null&&r.company.companyBillPayInfo?.businessVerificationStatus?.code==="pending_review"&&e(fe(t,!1,!0))},...I&&_?{onCardPolicySectionClick:()=>{a("../policy")}}:{},onFetchLinkTokenClick:(u,y)=>{e(ve("charge_card_setup",u,y))},onEstablishConnectionClick:u=>{e(ke(u,t,"charge_card_setup","charge_cards"))},onUpdatePaymentAccountStatus:(u,y,f)=>{e(_e(u,y,"charge_cards","charge_card_setup",f))},onUpdatePaymentAccountLoginStatus:(u,y)=>{e(Ae(!1,u,"charge_cards","charge_card_setup",y))},onEstablishConnectionSuccess:()=>{e(fe(t,!0))},onEnableChargeCardClick:()=>{D.trackCardsEnableCardsClick(g,p,"Cards Card Setup"),l===!0&&i===!0&&s===!1&&c===!1?e(Y(t,"charge_cards__debit_cards")):l===!0&&s===!1?e(Y(t,"charge_cards")):i===!0&&c===!1&&e(Y(t,"debit_cards"))},onUpdateChargeCardClick:(u,y,f)=>{const v=n.allBankAccounts.find((m=>m.accountId===n.primaryFundingAccount?.zeniAccountId)),b=n.allBankAccounts.find((m=>m.accountId===u));D.trackCardsZeniCashAccountChangeClick(g,p,{oldZeniCashAccount:v?.accountName??"",newZeniCashAccount:b?.accountName??"",oldZeniCashAccountPosition:n.allBankAccounts.findIndex((m=>m.accountId===n.primaryFundingAccount?.zeniAccountId))+1,newZeniCashAccountPosition:n.allBankAccounts.findIndex((m=>m.accountId===u))+1,numberOfCashAccounts:n.allBankAccounts.length}),e(f==="paymentAccount"?he(u,y,"charge_cards","charge_card_setup"):Ie("charge_card_setup",u,y))},onUpdatePrimaryFundingAccount:(u,y)=>{const f=n.allFundingAccounts.find((m=>m.id===u)),v=n.allFundingAccounts.findIndex((m=>m.id===n.primaryFundingAccount?.id))+1,b=n.allFundingAccounts.findIndex((m=>m.id===u))+1;D.trackCardsPaymentAccountChangeClick(g,p,{oldPaymentAccountName:n.primaryFundingAccount?.label??"",oldPaymentAccountBalance:x(n.primaryFundingAccount?.accountBalance?.available?.amount??0),newPaymentAccountName:f?.label??"",newPaymentAccountBalance:x(f?.accountBalance?.available?.amount??0),isOldPaymentAccountRecommended:n.primaryFundingAccount?.accType==="depositAccount",isNewPaymentAccountRecommended:f?.accType==="depositAccount",oldPaymentAccountPosition:v,newPaymentAccountPosition:b,numberOfPaymentAccounts:n.allFundingAccounts.length}),e(Ce(t,"charge_card_setup",u,y))},onEnableChargeCardSuccess:()=>{e(gn()),a("../",{relative:"path"})},onBackClick:()=>{r?.companyChargeCardInfo?.info?.isChargeCardEnabled||r?.companyDebitCardInfo?.info?.isDebitCardEnabled?a("../",{relative:"path"}):a("../..",{relative:"path"})},onNavigateToDashboard:()=>{a("../../dashboard")},onCompanyOfficerUpdated:(u,y)=>{e(be({officerType:u,fileIds:y}))},onSendForVerificationClick:u=>{l===!0&&i===!0?e(L(t,u,"charge_cards__debit_cards",!0,!0,!0)):l===!0?e(L(t,u,"charge_cards",!0,!0,!0)):i===!0&&e(L(t,u,"debit_cards",!0,!0,!0))},updateFilesEntity:u=>{e(ae({files:u}))},onDeleteFile:u=>{e(te(u))},onEditFileName:(u,y)=>{e(ne(u,y.split(".")[0]))},onUpdateAutoPayClick:u=>{e(fn(t,u))}}}))(et),ht=()=>{const e=Pe(),o=X(),a=Q(),t=ee(),{tenantEmailDomain:r}=W(),n=ie(),i=k((M=>V(M))),{useDynamicConfig:l,useFeatureGate:s}=ue(),c=a.state?.pathnameStackToGoBack?.[0],{configValue:p}=l(Ve.zeniCardsConfig),g=p.credit_card_auto_pay_threshold_by_company_id?.[i.companyId]??p.default_credit_card_auto_pay_threshold??80,{isFeatureEnabled:S}=s(q.isDebitCardFeatureEnabled),{isFeatureEnabled:_}=s(q.isChargeCardFeatureEnabled),{isFeatureEnabled:I}=s(q.isEarlyPayFeatureEnabled),{isFeatureEnabled:u}=s(q.isCardPolicyEnabled),y=k((M=>rn(M,i.companyId))),f=dn(y.controllers),v=!!i.company?.companyChargeCardInfo.isChargeCardEnabled,b=!!i.company?.companyDebitCardInfo.isDebitCardEnabled,m=un(S,i),C=St({isDebitCardFeatureEnabled:S,isBankingOnlyTenant:m}),P=ln(i),T=pn(i),U=i.companyChargeCardInfo?.info?.chargeCardsCreditAccountLimit??0,A=bt({isCardsOnlyTenant:P,isChargeCardFeatureEnabled:_,isBookKeepingTenant:T,isDebitCardProductVisible:C,chargeCardsCreditAccountLimit:U}),O=C&&A===!1,B=C===!1&&A,z=mn(n?.loggedInUserRoleMap),F=Fe(n?.loggedInUserRoleMap),[ce,G]=h.useState(!1),[K,re]=h.useState(!1),Z=k((M=>M.chargeCardSetupViewState.fetchState)),j=E.getSignedInUserTenant(r)?.companyId??i.companyId,w=E.getSignedInUser(),De=M=>{G(M)},pe=k((M=>yn(M,j)));if(w==null)throw Error("Can't access charge card setup page without signing in...");h.useEffect((()=>{K||Z!=="Not-Started"||j==null?K||Z!=="Completed"||j==null||i.companyBillPayInfo?.info?.businessVerificationStatus?.code!=="pending_review"||t(fe(j,!1,!0)):(re(!0),t(fe(j,!0)))}),[K,Z,j,t]);const me=!!i.company?.companyChargeCardInfo.isChargeCardTOSAccepted,ye=!!i.company?.companyDebitCardInfo.isDebitCardTOSAccepted,de=gt(A,C,b,v);return me||ye?me||ye?d.jsxs(d.Fragment,{children:[d.jsx(se,{analytics:D,onLoad:()=>{D.trackPageLoaded($.Event.cardsSetupVisited),D.trackCardsCardSetupView(f,de,c==null?"Cards Setup":c.includes("cards/promo")?"Promo":c.includes("cards")?"Settings":"Cards Tab")}}),d.jsx(le,{isAppContentDrawerOpen:ce,handleDrawerToggle:De}),d.jsx(Ct,{autoPayThreshold:g,navigate:o,meetingUrl:e("charge_card_setup"),location:a,companyId:j,currentTenant:i,isEarlyPayEnabled:I,isChargeCardTOSAccepted:me,isDebitCardTOSAccepted:ye,isUserChargeCardAdmin:z,isCardPolicyEnabled:u,isDebitCardOnlyEnabled:O,isCreditCardOnlyEnabled:B,chargeCardSetUpView:pe,isCreditCardProductVisible:A,isDebitCardFeatureEnabled:C,isChargeCardSetupEnabled:v,isDebitCardSetupEnabled:b,businessVerificationStatus:i.companyBillPayInfo?.info?.businessVerificationStatus,controllerEmails:f,productInformation:de,onClickMenuIcon:()=>{De(!0)},hasZeniAccountsAdminAccess:F})]}):d.jsx(Te,{fetchState:"Not-Started"}):d.jsx(R,{to:"../promo"})},It=xe.div`
9
+ `,yt=G((function(e,o){const{isUserBillPayAdmin:a,companyId:t}=o,r=V(e),n=an(e),i=E.getSignedInUser(),l=r.tenantId,s={userId:i?.userId??"",sessionId:i?.zeniSessionId??"",tenantId:l??""},c=sn(e,t),p=a&&c.updateStatus.fetchState!=="In-Progress"&&c.plaidConnectionDetails.link_account.updateStatus.fetchState!=="In-Progress"&&c.plaidConnectionDetails.update_account.updateStatus.fetchState!=="In-Progress"&&c.accountUpdateStatus?.fetchState!=="In-Progress"?void 0:"readonly";return{billPaySetupView:c,connectedAccountProvider:r.company?.featuresActivationInfo.connectedAccountProvider??"",showIntlWiseWidget:o.showIntlWiseWidget,isDisabled:p,billpayApprovalView:n,analytics:D,filesEndPoint:`${oe.fileMicroServiceBaseUrl}`,authParams:s}}),(function(e,o){const{navigate:a,companyId:t,currentTenant:r}=o;return{onBusinessVerificationSectionClick:()=>{a("../verification"),r?.company?.companyBillPayInfo!=null&&r?.company?.companyBillPayInfo?.businessVerificationStatus?.code==="pending_review"&&e(J(t,!1,!0))},onSetupApprovalRulesSectionClick:()=>{a("../approval-rules")},onFetchLinkTokenClick:(n,i)=>{e(ve("bill_pay_setup",n,i))},onEstablishConnectionClick:n=>{e(ke(n,t,"bill_pay_setup","bill_pay"))},onUpdatePaymentAccountStatus:(n,i,l)=>{e(_e(n,i,"bill_pay","bill_pay_setup",l))},onUpdatePaymentAccountLoginStatus:(n,i)=>{e(Ae(!1,n,"bill_pay","bill_pay_setup",i))},onEstablishConnectionSuccess:()=>{e(J(t,!0))},onEnableBillPayClick:()=>{e(Y(t,"bill_pay"))},onUpdateAccountClick:(n,i,l)=>{e(l==="paymentAccount"?he(n,i,"bill_pay","bill_pay_setup"):Ie("reimbursement_setup",n,i))},onUpdatePrimaryFundingAccount:(n,i)=>{e(Ce(t,"bill_pay_setup",n,i))},onEnableBillPaySuccess:()=>{a("../",{relative:"path"})},onBackClick:()=>{r?.companyBillPayInfo?.info?.isBillPayEnabled!=null&&r.companyBillPayInfo.info.isBillPayEnabled===!1?a("../.."):a("../",{relative:"path"})},onAcceptUpdatedTOS:()=>{e(cn(t))},onAcceptUpdatedTOSSuccess:()=>{e(J(t,!0))},onGetOtp:(n,i)=>{e(qe(n,"SpendManagementSetup")),i!=null&&e(on({officerType:i,phone:n}))},onResendOtp:n=>{e(He(n,"SpendManagementSetup"))},onVerifyOtp:(n,i)=>{e(Ge(n,i,"SpendManagementSetup"))},onVerifyOtpSuccess:(n,i)=>{n!=null&&i!=null&&e(L(t,n,"bill_pay",!0,!0))},onNavigateToDashboard:()=>{a("../../dashboard")},onNavigateToSettings:()=>{a("../bills/setup")},onInternationPaymentSetUpClick:()=>{a("../international-wire")},onCompanyOfficerUpdated:(n,i)=>{e(be({officerType:n,fileIds:i}))},onSendForVerificationClick:n=>{e(L(t,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]))}}}))(Qn),ft=()=>{const e=Pe(),o=X(),a=Q(),t=ee(),{tenantEmailDomain:r}=W(),n=ie(),i=nn(n?.loggedInUserRoleMap),{useFeatureGate:l}=de(),{isFeatureEnabled:s}=l(K.billPaySetupShowInternationalPaymentByWise),{isFeatureEnabled:c}=l(K.isBillPayLocalCurrencyFeatureEnabled),p=Ee(),[g,S]=h.useState(!1),_=h.useRef(!1),I=k((m=>m.billPaySetupViewState.fetchState)),d=k((m=>V(m)));pt();const y=d.companyId??E.getSignedInUserTenant(r)?.companyId;if(E.getSignedInUser()==null)throw Error("Can't access bill pay setup page without signing in...");const f=!!d.companyBillPayInfo?.info?.isBillPayTOSAccepted,v=tn(n?.loggedInUserRoleMap);h.useEffect((()=>{_.current||I!=="Not-Started"||y==null?_.current||I!=="Completed"||y==null||d.companyBillPayInfo?.info?.businessVerificationStatus?.code!=="pending_review"||(_.current=!0,t(J(y,!1,!0))):(_.current=!0,t(J(y,!0)))}),[I,y,t]);const b=m=>{S(m)};if(f===!1||v&&!n?.loggedInUserRoleMap?.bill_pay_admin)return u.jsx(R,{to:"../promo"});if(f===!0&&n?.loggedInUserRoleMap!=null){const m=C=>C.trackPageLoaded($.Event.billPaySetup);return u.jsxs(mt,{children:[u.jsx(se,{analytics:D,onLoad:C=>m(C)}),u.jsx(le,{isAppContentDrawerOpen:g,handleDrawerToggle:b}),u.jsx(yt,{navigate:o,location:a,companyId:y,currentTenant:d,isUserBillPayAdmin:i,showIntlWiseWidget:s,meetingUrl:e("bill_pay_setup"),onClickMenuIcon:()=>{b(!0)},isLocalCurrencyEnabled:c})]})}return u.jsx(Te,{fetchState:"In-Progress",style:{backgroundColor:p.colors.grey5}})},Ht=(e,o)=>e!=null&&(function(a){return a==="debit"||a==="credit"||a==="debit_and_credit"})(e)?e:o,qt=e=>`/${e}/cards`,Kt=e=>`/${e}/cards/setup`,Jt=e=>`/${e}/cards/onboard`,Yt=(e,o,a,t,r=!1)=>{let n=`/${e}/cards/${encodeURIComponent(o)}`;return t==null||t.status.code!=="inactive"||t.cardHolderUserId!==a.userId||t.type.code!=="business_physical_credit_card"&&t.type.code!=="business_physical_debit_card"?t!=null&&t.status.code==="active"&&t.cardHolderUserId===a.userId&&t.type.code==="business_physical_credit_card"&&r===!0?n+="/addToWallet":t==null||t.type.code!=="business_physical_debit_card"&&t.type.code!=="business_virtual_debit_card"||t.status.code!=="active"||t.cardHolderUserId!==a.userId||t.isPinSet!==!1||(n+="/setPin"):n+="/activate",n},Xt=(e,o)=>e.find((a=>a.id===o)),Qt=(e,o,a)=>!e||!o||a.fetchState==="Completed",gt=(e,o,a,t)=>({isCreditCardOffered:e,isDebitCardOffered:o,isDebitCardEnabled:a,isCreditCardEnabled:t}),ea=(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,na=(e,o,a,t,r)=>e&&o&&a?{creditAccountId:t.id,creditAccountLimit:x(t.limit.amount),creditAccountAvailableAmount:x(t.available.amount),creditAccountSpentAmount:x(t.balance.amount+t.hold.amount),creditAccountStatus:t.status,outstandingBalance:x(r.remainingAmountDue.amount)}:void 0,ta=(e,o,a,t,r)=>e&&o&&a?{debitAccountId:t.depositAccounts.map((n=>n.id)),debitAccountName:t.depositAccounts.map((n=>n.accountName)),debitAccountBalance:t.depositAccounts.map((n=>x(n.accountBalance.available.amount))),debitCardsSpend:x(r?.currentMonthSpends.amount??0),debitAccountStatus:t.depositAccounts.map((n=>n.accountStatus))}:void 0,aa=(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,ia=80,sa=80,oa=e=>e.companyId??E.getSignedInUserTenant(e.tenantEmailDomain)?.companyId,St=({isBankingOnlyTenant:e,isDebitCardFeatureEnabled:o})=>o||e,bt=({isCardsOnlyTenant:e,isChargeCardFeatureEnabled:o,isBookKeepingTenant:a,isDebitCardProductVisible:t,chargeCardsCreditAccountLimit:r})=>(e||o||a)&&(!t||r>0),ca=({isCardsOnlyTenant:e,isChargeCardFeatureEnabled:o,isBookKeepingTenant:a})=>e||o||a,ra=({cardInfo:e,isProductVisible:o,isTOSAccepted:a,isSetupEnabled:t,isUserHasCardsAdminLevelAccess:r,isUserHasCardsAccess:n})=>!!e&&o&&(!a&&r||n&&!r&&!t),Ct=G((function(e,o){const{isUserChargeCardAdmin:a,chargeCardSetUpView:t,isDebitCardOnlyEnabled:r,isCreditCardOnlyEnabled:n}=o,i=V(e),l=E.getSignedInUser(),s=i.tenantId,c={userId:l?.userId??"",sessionId:l?.zeniSessionId??"",tenantId:s??""},p=a&&t.updateStatus.fetchState!=="In-Progress"&&t.plaidConnectionDetails.link_account.updateStatus.fetchState!=="In-Progress"&&t.plaidConnectionDetails.update_account.updateStatus.fetchState!=="In-Progress"&&t.accountUpdateStatus?.fetchState!=="In-Progress"?void 0:"readonly";return{chargeCardSetUpView:t,connectedAccountProvider:i.company?.featuresActivationInfo.connectedAccountProvider??"",isDisabled:p,analytics:D,isDebitCardOnlyEnabled:r,isCreditCardOnlyEnabled:n,filesEndPoint:`${oe.fileMicroServiceBaseUrl}`,authParams:c}}),(function(e,o){const{navigate:a,companyId:t,currentTenant:r,chargeCardSetUpView:n,isDebitCardTOSAccepted:i,isChargeCardTOSAccepted:l,isChargeCardSetupEnabled:s,isDebitCardSetupEnabled:c,productInformation:p,controllerEmails:g,businessVerificationStatus:S,isCardPolicyEnabled:_,isUserChargeCardAdmin:I}=o;return{onBusinessVerificationSectionClick:()=>{D.trackCardsVerifyIdentityCompanyDetailsClick(g,p,S?.code),a("../verification"),r?.company?.companyChargeCardInfo!=null&&r.company.companyBillPayInfo?.businessVerificationStatus?.code==="pending_review"&&e(fe(t,!1,!0))},...I&&_?{onCardPolicySectionClick:()=>{a("../policy")}}:{},onFetchLinkTokenClick:(d,y)=>{e(ve("charge_card_setup",d,y))},onEstablishConnectionClick:d=>{e(ke(d,t,"charge_card_setup","charge_cards"))},onUpdatePaymentAccountStatus:(d,y,f)=>{e(_e(d,y,"charge_cards","charge_card_setup",f))},onUpdatePaymentAccountLoginStatus:(d,y)=>{e(Ae(!1,d,"charge_cards","charge_card_setup",y))},onEstablishConnectionSuccess:()=>{e(fe(t,!0))},onEnableChargeCardClick:()=>{D.trackCardsEnableCardsClick(g,p,"Cards Card Setup"),l===!0&&i===!0&&s===!1&&c===!1?e(Y(t,"charge_cards__debit_cards")):l===!0&&s===!1?e(Y(t,"charge_cards")):i===!0&&c===!1&&e(Y(t,"debit_cards"))},onUpdateChargeCardClick:(d,y,f)=>{const v=n.allBankAccounts.find((m=>m.accountId===n.primaryFundingAccount?.zeniAccountId)),b=n.allBankAccounts.find((m=>m.accountId===d));D.trackCardsZeniCashAccountChangeClick(g,p,{oldZeniCashAccount:v?.accountName??"",newZeniCashAccount:b?.accountName??"",oldZeniCashAccountPosition:n.allBankAccounts.findIndex((m=>m.accountId===n.primaryFundingAccount?.zeniAccountId))+1,newZeniCashAccountPosition:n.allBankAccounts.findIndex((m=>m.accountId===d))+1,numberOfCashAccounts:n.allBankAccounts.length}),e(f==="paymentAccount"?he(d,y,"charge_cards","charge_card_setup"):Ie("charge_card_setup",d,y))},onUpdatePrimaryFundingAccount:(d,y)=>{const f=n.allFundingAccounts.find((m=>m.id===d)),v=n.allFundingAccounts.findIndex((m=>m.id===n.primaryFundingAccount?.id))+1,b=n.allFundingAccounts.findIndex((m=>m.id===d))+1;D.trackCardsPaymentAccountChangeClick(g,p,{oldPaymentAccountName:n.primaryFundingAccount?.label??"",oldPaymentAccountBalance:x(n.primaryFundingAccount?.accountBalance?.available?.amount??0),newPaymentAccountName:f?.label??"",newPaymentAccountBalance:x(f?.accountBalance?.available?.amount??0),isOldPaymentAccountRecommended:n.primaryFundingAccount?.accType==="depositAccount",isNewPaymentAccountRecommended:f?.accType==="depositAccount",oldPaymentAccountPosition:v,newPaymentAccountPosition:b,numberOfPaymentAccounts:n.allFundingAccounts.length}),e(Ce(t,"charge_card_setup",d,y))},onEnableChargeCardSuccess:()=>{e(gn()),a("../",{relative:"path"})},onBackClick:()=>{r?.companyChargeCardInfo?.info?.isChargeCardEnabled||r?.companyDebitCardInfo?.info?.isDebitCardEnabled?a("../",{relative:"path"}):a("../..",{relative:"path"})},onNavigateToDashboard:()=>{a("../../dashboard")},onCompanyOfficerUpdated:(d,y)=>{e(be({officerType:d,fileIds:y}))},onSendForVerificationClick:d=>{l===!0&&i===!0?e(L(t,d,"charge_cards__debit_cards",!0,!0,!0)):l===!0?e(L(t,d,"charge_cards",!0,!0,!0)):i===!0&&e(L(t,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]))},onUpdateAutoPayClick:d=>{e(fn(t,d))}}}))(et),ht=()=>{const e=Pe(),o=X(),a=Q(),t=ee(),{tenantEmailDomain:r}=W(),n=ie(),i=k((M=>V(M))),{useDynamicConfig:l,useFeatureGate:s}=de(),c=a.state?.pathnameStackToGoBack?.[0],{configValue:p}=l(Ve.zeniCardsConfig),g=p.credit_card_auto_pay_threshold_by_company_id?.[i.companyId]??p.default_credit_card_auto_pay_threshold??80,{isFeatureEnabled:S}=s(K.isDebitCardFeatureEnabled),{isFeatureEnabled:_}=s(K.isChargeCardFeatureEnabled),{isFeatureEnabled:I}=s(K.isEarlyPayFeatureEnabled),{isFeatureEnabled:d}=s(K.isCardPolicyEnabled),y=k((M=>rn(M,i.companyId))),f=un(y.controllers),v=!!i.company?.companyChargeCardInfo.isChargeCardEnabled,b=!!i.company?.companyDebitCardInfo.isDebitCardEnabled,m=dn(S,i),C=St({isDebitCardFeatureEnabled:S,isBankingOnlyTenant:m}),P=ln(i),T=pn(i),O=i.companyChargeCardInfo?.info?.chargeCardsCreditAccountLimit??0,A=bt({isCardsOnlyTenant:P,isChargeCardFeatureEnabled:_,isBookKeepingTenant:T,isDebitCardProductVisible:C,chargeCardsCreditAccountLimit:O}),U=C&&A===!1,B=C===!1&&A,z=mn(n?.loggedInUserRoleMap),F=Fe(n?.loggedInUserRoleMap),[ce,H]=h.useState(!1),[q,re]=h.useState(!1),Z=k((M=>M.chargeCardSetupViewState.fetchState)),j=E.getSignedInUserTenant(r)?.companyId??i.companyId,w=E.getSignedInUser(),De=M=>{H(M)},pe=k((M=>yn(M,j)));if(w==null)throw Error("Can't access charge card setup page without signing in...");h.useEffect((()=>{q||Z!=="Not-Started"||j==null?q||Z!=="Completed"||j==null||i.companyBillPayInfo?.info?.businessVerificationStatus?.code!=="pending_review"||t(fe(j,!1,!0)):(re(!0),t(fe(j,!0)))}),[q,Z,j,t]);const me=!!i.company?.companyChargeCardInfo.isChargeCardTOSAccepted,ye=!!i.company?.companyDebitCardInfo.isDebitCardTOSAccepted,ue=gt(A,C,b,v);return me||ye?me||ye?u.jsxs(u.Fragment,{children:[u.jsx(se,{analytics:D,onLoad:()=>{D.trackPageLoaded($.Event.cardsSetupVisited),D.trackCardsCardSetupView(f,ue,c==null?"Cards Setup":c.includes("cards/promo")?"Promo":c.includes("cards")?"Settings":"Cards Tab")}}),u.jsx(le,{isAppContentDrawerOpen:ce,handleDrawerToggle:De}),u.jsx(Ct,{autoPayThreshold:g,navigate:o,meetingUrl:e("charge_card_setup"),location:a,companyId:j,currentTenant:i,isEarlyPayEnabled:I,isChargeCardTOSAccepted:me,isDebitCardTOSAccepted:ye,isUserChargeCardAdmin:z,isCardPolicyEnabled:d,isDebitCardOnlyEnabled:U,isCreditCardOnlyEnabled:B,chargeCardSetUpView:pe,isCreditCardProductVisible:A,isDebitCardFeatureEnabled:C,isChargeCardSetupEnabled:v,isDebitCardSetupEnabled:b,businessVerificationStatus:i.companyBillPayInfo?.info?.businessVerificationStatus,controllerEmails:f,productInformation:ue,onClickMenuIcon:()=>{De(!0)},hasZeniAccountsAdminAccess:F})]}):u.jsx(Te,{fetchState:"Not-Started"}):u.jsx(R,{to:"../promo"})},It=xe.div`
10
10
  display: flex;
11
11
  height: 100%;
12
12
  width: 100%;
@@ -14,11 +14,11 @@ import{j as d}from"./liveblocks-V5YQZeeY.js";import{h as X,g as Q,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
- `,At=H((function(e,o){const{isUserRemiAdmin:a,companyId:t}=o,r=V(e),n=Cn(e),i=hn(e,t),l=E.getSignedInUser(),s=r.tenantId,c={userId:l?.userId??"",sessionId:l?.zeniSessionId??"",tenantId:s??""};return{remiSetupView:i,isDisabled:a&&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",remiApprovalView:n,connectedAccountProvider:r.company?.featuresActivationInfo.connectedAccountProvider??"",analytics:D,filesEndPoint:`${oe.fileMicroServiceBaseUrl}`,authParams:c}}),(function(e,o){const{navigate:a,companyId:t,currentTenant:r}=o;return{updateMileageDetails:n=>{const{mileageAmount:i,mileageUnit:l,mileageCurrencyCode:s,mileageCurrencySymbol:c,denomination:p,denominationSymbol:g,mileageAmountInDenomination:S,description:_}=n;e(An({mileageDetails:{mileageUnitAmount:{amount:i,currencyCode:s,currencySymbol:c},denomination:p,denominationSymbol:g,mileageAmountInDenomination:S,mileageCurrencyCode:s,mileageCurrencySymbol:c,mileageUnit:l,description:_}}))},onSaveMileageClick:n=>{e(In(t)),D.trackReimbursementMileageRateSave(n)},onBusinessVerificationSectionClick:()=>{a("../verification"),r?.company?.companyReimbursementInfo!=null&&r?.company?.companyBillPayInfo?.businessVerificationStatus?.code==="pending_review"&&e(ge(t,!1,!0))},onSetupApprovalRulesSectionClick:()=>{a("../approval-rules")},onFetchLinkTokenClick:(n,i)=>{e(ve("reimbursement_setup",n,i))},onEstablishConnectionClick:n=>{e(ke(n,t,"reimbursement_setup","reimbursement"))},onUpdatePaymentAccountStatus:(n,i,l)=>{e(_e(n,i,"reimbursement","reimbursement_setup",l))},onUpdatePaymentAccountLoginStatus:(n,i)=>{e(Ae(!1,n,"reimbursement","reimbursement_setup",i))},onEstablishConnectionSuccess:()=>{e(ge(t,!0))},onEnableRemiClick:()=>{e(Y(t,"reimbursement"))},onUpdateAccountClick:(n,i,l)=>{e(l==="paymentAccount"?he(n,i,"reimbursement","reimbursement_setup"):Ie("reimbursement_setup",n,i))},onEnableRemiSuccess:()=>{a("../",{relative:"path"})},onBackClick:()=>{r?.companyReimbursementInfo?.info?.isReimbursementEnabled!=null&&r.companyReimbursementInfo.info.isReimbursementEnabled===!1?a("../.."):a("../",{relative:"path"})},onCompanyOfficerUpdated:(n,i)=>{e(be({officerType:n,fileIds:i}))},onSendForVerificationClick:n=>{e(L(t,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(Ce(t,"reimbursement_setup",n,i))}}}))(tt),_t=()=>{const e=Pe(),o=X(),a=Q(),t=ee(),{tenantEmailDomain:r}=W(),n=ie(),i=Ee(),l=Sn(n?.loggedInUserRoleMap),s=Fe(n?.loggedInUserRoleMap),[c,p]=h.useState(!1),g=h.useRef(!1),[S,_]=h.useState(!1),I=k((P=>P.remiSetupViewState.fetchState)),u=k((P=>V(P))),y=k((P=>P.remiSetupApproverViewState.fetchState)),{isApprovalRulesV3Enabled:f,isLoading:v}=nt(u?.tenantId),b=E.getSignedInUserTenant(r)?.companyId??u.companyId,m=E.getSignedInUser(),C=P=>{p(P)};if(m==null)throw Error("Can't access reimbursement setup page without signing in...");if(h.useEffect((()=>{g.current||I!=="Not-Started"||b==null?g.current||I!=="Completed"||b==null||u.companyBillPayInfo?.info?.businessVerificationStatus?.code!=="pending_review"||(g.current=!0,t(ge(b,!1,!0))):(g.current=!0,t(ge(b,!0)))}),[I,b,t]),h.useEffect((()=>{S||y!=="Not-Started"||v||(_(!0),t(bn(!0,!1,!1,f)))}),[S,y,v,f,t]),u.companyReimbursementInfo?.info?.isReimbursementTOSAccepted===!1)return d.jsx(R,{to:"../promo"});if(u.companyReimbursementInfo?.info?.isReimbursementTOSAccepted===!0){const P=T=>T.trackPageLoaded($.Event.reimbursementSetup);return d.jsxs(It,{children:[d.jsx(se,{analytics:D,onLoad:T=>P(T)}),d.jsx(le,{isAppContentDrawerOpen:c,handleDrawerToggle:C}),d.jsx(At,{navigate:o,location:a,companyId:b,currentTenant:u,isUserRemiAdmin:l,meetingUrl:e("reimbursement_setup"),onClickMenuIcon:()=>{C(!0)},hasZeniAccountsAdminAccess:s})]})}return d.jsx(Te,{fetchState:"In-Progress",style:{backgroundColor:i.colors.grey5}})},kt=H((function(e,o){const{businessVerificationDetails:a,productType:t}=o,r=V(e),n=E.getSignedInUser(),i=r.tenantId,l={userId:n?.userId??"",sessionId:n?.zeniSessionId??"",tenantId:i??""},s=Un(o.roleMap)&&a.updateStatus.fetchState!=="In-Progress"?void 0:"readonly",c=On(e.companyConfigState),p=wn(e.userRoleConfigState),g=t==="zeni_treasury"?Je(e):void 0;return{businessVerificationDetails:a,verficationDetailsFetchState:a.fetchState,isRefreshingViewInBackground:a.isRefreshingViewInBackground,allNationalityCountries:a.allNationalityCountries,filesEndPoint:`${oe.fileMicroServiceBaseUrl}`,authParams:l,isDisabled:s,allIndustries:c.companyIndustries??[],companyTitles:p.companyTitles,transferDetails:g}}),(function(e,o){const{companyId:a,productType:t,currentTenant:r,navigate:n,location:i}=o,{tenantEmailDomain:l}=r;return{onCompanyDetailsChanged:s=>{const{companyDescription:c,companyIndustry:p,companyIndustryType:g,companyLegalName:S,companyTaxId:_,companyWebsite:I,companyPhone:u,primaryContactEmail:y,primaryContactName:f,primaryContactUserId:v,primaryContactSyncToken:b,syncToken:m,fileIds:C,incDate:P,typeOfIncorporation:T,stateOfIncorporation:U,sourceOfFunds:A,companySubIndustry:O,countriesOfOperations:B,companySourceOfFunds:z,companySourceOfFundsDescription:F,transactionVolume:ce,transactionVolumeDescription:G,purposeOfAccount:K,purposeOfAccountDescription:re,regulatedStatus:Z,regulatedStatusDescription:j,usNexus:w,usNexusTypes:De}=s,pe=g?.selectedOption,me={companyId:a,companyDescription:c,companyIndustry:p.selectedOption,companyIndustryType:pe==null||pe===""?void 0:pe,companyLegalName:S,taxIdOrEIN:_,website:I!=""&&I!=null?Nn(I):void 0,phone:u,syncToken:m,fileIds:C,incDate:P!=null?Re(P?.toString()):P,typeOfIncorporation:T?.selectedOption??"",stateOfIncorporation:U?.selectedOption??"",sourceOfFunds:A?.selectedOption??"",companySubIndustry:O?.selectedOption??"",countriesOfOperations:B?.selectedOptions.map((de=>de.length===2?de:ze(de)))??[],companySourceOfFunds:z?.selectedOption??"",companySourceOfFundsDescription:F,transactionVolume:ce?.selectedOption??"",transactionVolumeDescription:G,purposeOfAccount:K?.selectedOption??"",purposeOfAccountDescription:re,regulatedStatus:Z??"",regulatedStatusDescription:j,usNexus:w,usNexusTypes:De?.selectedOptions??[]},ye={userId:v,firstName:f.firstName,lastName:f.lastName,email:y,syncToken:b};e(Ne({companyDetails:me,primaryContactDetails:ye}))},onCompanyOfficerUpdated:s=>{const c=s.map((p=>{const{officerType:g,userId:S,name:_,email:I,nationalityCountryCode:u,ssn:y,dob:f,phone:v,syncToken:b,selectDocument:m,role:C,ownership:P,isSelectedForVerification:T,userVerificationStatus:U,treasuryUserVerificationStatus:A,fileIds:O}=p;let B;return m.selectDocumentType==="driverLicense"?B="driving_license":m.selectDocumentType==="passport"?B="passport":m.selectDocumentType==="stateId"?B="id_document":m.selectDocumentType==="ssnCard"&&(B="social_security_card"),{officerType:g,userId:S,firstName:_.firstName,lastName:_.lastName,email:I,ssn:y,nationalityCountryCode:u?.selectedOption!=null?ze(u.selectedOption):void 0,phone:v,birthday:f!=null?Re(f?.toString()):f,syncToken:b,titleAtCompany:C.selectedOption,ownershipInCompany:P,documentTypeSelectedForVerification:B,isSelectedForVerification:T,userVerificationStatus:U,treasuryUserVerificationStatus:A,fileIds:O,additionalDocumentTypesRequestedForVerification:[],additionalSubmittedDocumentsForVerificationFileIds:[],areAdditionalDocumentsRequestedForVerification:!1,areAdditionalDocumentsSubmittedForVerification:!1}}));e(Ne({officers:c}))},onSaveDetailsClick:s=>{e(L(a,s,t))},onSendForVerificationClick:s=>{e(L(a,s,t,!0))},onAddressClick:s=>{const c=We(l,s),p=Me(i.state?.pathnameStackToGoBack,i.pathname),g=new URLSearchParams(i.search),S={};g.forEach(((_,I)=>{S[I]=_})),n(c,{state:{pathnameStackToGoBack:p,queryParams:Object.keys(S).length>0?S:void 0}})},onRegisteredAddressClick:s=>{const c=We(l,s),p=Me(i.state?.pathnameStackToGoBack,i.pathname),g=new URLSearchParams(i.search),S=Object.fromEntries(g.entries());n(c,{state:{pathnameStackToGoBack:p,queryParams:Object.keys(S).length>0?S:void 0}})},onBackClick:()=>{e(Rn({companyId:a})),n("../setup")},updateFilesEntity:s=>{e(ae({files:s}))},onDeleteFile:s=>{e(te(s))},onDeleteFileList:s=>{e(Xe(s))},onEditFileName:(s,c)=>{e(ne(s,c.split(".")[0]))},onGetOtp:s=>{e(Ke(s,"SpendManagementSetup"))},onResendOtp:s=>{e(Ge(s,"SpendManagementSetup"))},onVerifyOtp:(s,c)=>{e(He(s,c,"SpendManagementSetup"))},saveNewAddressInLocalStore:(s,c)=>{e(jn({addressType:s,addressToCreate:c}))},onExecuteTreasuryTransfer:()=>{e(Ye())},onOverlayClose:()=>{e(Oe())},onIdentityDocumentUploadedForAutofill:s=>{if(a==null)return;const c=xn(s.documentType);c!=null&&e(Bn({target:"setup",companyId:a,officerType:s.officerType,fileId:s.fileId,documentType:c}))},onCompanyDocumentUploadedForAutofill:s=>{a!=null&&e(Vn({target:"setup",companyId:a,fileId:s.fileId,documentType:s.documentType}))},onResetKycKybClick:()=>{e(Fn())}}}))(at),vt=({productType:e,isBusinessVerificationDrawerOpen:o,closeDrawerHandler:a})=>{const t=X(),r=Q(),n=ee(),[i]=en(),l=i.get("showStepProgress"),s=i.get("isTransferInitiated"),[c,p]=h.useState(!1),{tenantEmailDomain:g}=W(),S=ie(),{useDynamicConfig:_}=ue(),I=Ee(),{configValue:u}=_(Ve.zeniAccountsConfig),y=je(u),f=k((A=>{switch(e){case"zeni_accounts":return A.zeniAccountSetupViewState.fetchState;case"reimbursement":return A.remiSetupViewState.fetchState;case"charge_cards":return A.chargeCardSetupViewState.fetchState;case"zeni_treasury":return A.treasurySetupViewState.fetchState;default:return A.billPaySetupViewState.fetchState}})),v=k((A=>A.companyConfigState.fetchState)),b=k((A=>A.userRoleConfigState.fetchState)),m=k((A=>V(A))),C=m.companyId??E.getSignedInUserTenant(g)?.companyId;h.useEffect((()=>{v==="Not-Started"&&n(_n()),b==="Not-Started"&&n(kn(!0))}),[v,b,n]),h.useEffect((()=>{c||f!=="Not-Started"||C==null||(p(!0),Ze(n,e,C))}),[c,f,C,n]);const P=k((A=>{let O;switch(e){case"zeni_accounts":O=En(A,C);break;case"zeni_treasury":O=qe(A,C);break;case"charge_cards":O=Tn(A,C);break;case"reimbursement":O=Pn(A,C);break;default:O=vn(A,C)}return O})),T=P.kycKybResetStatus.fetchState;if(h.useEffect((()=>{T==="Completed"&&C!=null&&(Ze(n,e,C,!0),n(Dn()))}),[T,C,e,n]),E.getSignedInUser()==null)throw Error("Can't access business verification without signing in...");let U;switch(e){case"zeni_accounts":U=m.companyZeniAccountInfo?.info?.isZeniAccountTOSAccepted;break;case"reimbursement":U=m.companyReimbursementInfo?.info?.isReimbursementTOSAccepted;break;case"charge_cards":U=m.companyChargeCardInfo?.info?.isChargeCardTOSAccepted===!0||m.companyDebitCardInfo?.info?.isDebitCardTOSAccepted;break;case"zeni_treasury":U=m.companyTreasuryInfo?.info?.isTreasuryTOSAccepted;break;default:U=m.companyBillPayInfo?.info?.isBillPayTOSAccepted}return U===!1?null:P.fetchState==="Completed"&&U===!0&&S?.loggedInUserRoleMap!=null?d.jsxs(d.Fragment,{children:[d.jsx(se,{analytics:D,onLoad:A=>(O=>{switch(e){case"zeni_accounts":return O.trackPageLoaded($.Event.zeniAccountsBusinessVerification);case"reimbursement":case"charge_cards":return O.trackPageLoaded($.Event.reimbursementBusinessVerification);default:return O.trackPageLoaded($.Event.billPayBusinessVerification,Be(r)?"Settings":void 0)}})(A)}),d.jsx(kt,{businessVerificationDetails:P,navigate:t,location:r,companyId:C,analytics:D,currentTenant:m,productType:e,roleMap:S.loggedInUserRoleMap,isSettings:Be(r),isOverlay:!0,isStepInProgress:l!=null,isTreasuryTransferInitiated:s!=null,onClickMenuIcon:()=>{},maxInsuredAmount:y.maxInsuredAmount,isBusinessVerificationDrawerOpen:o,closeDrawerHandler:a})]}):d.jsx(Te,{fetchState:"In-Progress",style:{backgroundColor:I.colors.grey5}})},Pt={overlayWidth:new st(100,100,59)},Tt=H((function(e,o){const{isUserZeniAccountsAdmin:a,companyId:t}=o,r=V(e),n=E.getSignedInUser(),i=r.tenantId,l={userId:n?.userId??"",sessionId:n?.zeniSessionId??"",tenantId:i??""},s=Qe(e,t),c=qe(e,t),p=a&&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",g=Zn(e),S=g.transactions,_=Je(e),I=g.accountSummary?.totalBalance?.amount,u=S.length===0||I===0;return{treasurySetupView:s,businessVerificationDetails:c,connectedAccountProvider:r.company?.featuresActivationInfo.connectedAccountProvider??"",transactions:S,transferDetails:_,isFirstTransfer:u,isDisabled:p,analytics:D,filesEndPoint:`${oe.fileMicroServiceBaseUrl}`,authParams:l,isOnSetup:!0,maxInsuredAmount:o.maxInsuredAmount}}),(function(e,o){const{navigate:a,companyId:t,currentTenant:r,isAllocationDone:n,analytics:i,treasurySetupView:l}=o;return{onTransferSaveChangesToLocalStore:s=>{e(Hn(s))},onBusinessVerificationSectionClick:(s,c)=>{let p="../verification";s&&(p+="?showStepProgress=true",c&&(p+="&isTransferInitiated=true")),a(p),r?.company?.companyTreasuryInfo!=null&&r?.company?.companyTreasuryInfo?.businessVerificationStatus?.code==="pending_review"&&e(we(t,!1,!0))},onFetchLinkTokenClick:(s,c)=>{e(ve("treasury_setup",s,c))},onEstablishConnectionClick:s=>{e(ke(s,t,"treasury_setup","zeni_treasury"))},onUpdatePaymentAccountStatus:(s,c,p)=>{e(_e(s,c,"zeni_treasury","treasury_setup",p))},onUpdatePaymentAccountLoginStatus:(s,c)=>{e(Ae(!1,s,"zeni_treasury","treasury_setup",c))},onEstablishConnectionSuccess:()=>{e(we(t,!0))},onEnableTreasuryClick:()=>{e(Y(t,"zeni_treasury"))},onUpdateTreasuryClick:(s,c,p)=>{e(p==="paymentAccount"?he(s,c,"zeni_treasury","treasury_setup"):Ie("treasury_setup",s,c))},onUpdatePrimaryFundingAccount:(s,c)=>{e(Ce(t,"treasury_setup",s,c))},onNavigateToDashboard:()=>{a(r?.company?.companyTreasuryInfo?.businessVerificationStatus?.code==="verified"?"../":"../../")},onCompanyOfficerUpdated:(s,c)=>{e(be({officerType:s,fileIds:c}))},onSendForVerificationClick:(s,c)=>{if(e(L(t,s,"zeni_treasury",!0,!0,!0)),!n){const p=l.fundAllocationLocalData;i.trackTreasuryPortfolioConfirm(p.riskScore,$e(p)),e(Le(!1))}c===!0&&e(Ye())},updateFilesEntity:s=>{e(ae({files:s}))},onDeleteFile:s=>{e(te(s))},onEditFileName:(s,c)=>{e(ne(s,c.split(".")[0]))},onAdditionalVerificationFieldsChanged:s=>{const{sourceOfFunds:c}=s;e(Wn({sourceOfFunds:c?.selectedOption??""}))},onUpdateFundAllocation:s=>{i.trackTreasuryAllocationAction("update",$e(s)),e($n(s))},onConfirmFundAllocation:()=>{e(Le(n))},onOverlayClose:()=>{e(Oe())}}}))(ot),Et=()=>{const e=Pe(),o=X(),a=Q(),t=ee(),r=Ee(),n=it(),{tenantEmailDomain:i}=W(),{useDynamicConfig:l}=ue(),s=ie(),[c,p]=h.useState(!1),g=Fe(s?.loggedInUserRoleMap),{configValue:S}=l(Ve.zeniAccountsConfig),_=je(S),[I,u]=h.useState(!1),[y,f]=h.useState(!1),[v,b]=h.useState(!1),[m,C]=h.useState(!1),[P,T]=h.useState(!1),U=k((w=>w.treasurySetupViewState.fetchState)),A=k((w=>w.treasurySetupViewState.treasuryFundsDetails?.fetchStatus?.fetchState)),O=k((w=>w.treasurySetupViewState.currentAllocation.fetchStatus?.fetchState)),B=k((w=>w.treasuryDetailState.transactionsState?.fetchState)),z=k((w=>V(w))),F=E.getSignedInUserTenant(i)?.companyId??z.companyId,ce=k((w=>Qe(w,F))),G=ce.isAtomicAccountExists,K=E.getSignedInUser(),re=w=>{u(w)};if(K==null)throw Error("Can't access treasury setup page without signing in...");h.useEffect((()=>{y||U!=="Not-Started"||F==null||(f(!0),t(we(F,!0,!1)))}),[y,U,F,t]),h.useEffect((()=>{v||A!=="Not-Started"||F==null||(b(!0),t(Ln()))}),[v,A,F,t]),h.useEffect((()=>{m||O!=="Not-Started"||F==null||(C(!0),t(Mn()))}),[m,O,F,t]),h.useEffect((()=>{P||B!=="Not-Started"||F==null||(T(!0),t(zn(!0)))}),[P,B,F,t]);const Z=z.companyTreasuryInfo?.info?.businessVerificationStatus?.code,j=Z==="pending_review"||Z==="verified";return h.useEffect((()=>{c||U!=="Completed"||G||j||!a.pathname.includes("setup")||p(!0)}),[U,G,j]),z.companyTreasuryInfo?.info?.isTreasuryTOSAccepted===!1?d.jsx(R,{to:"../promo"}):d.jsxs(d.Fragment,{children:[d.jsx(se,{analytics:D,onLoad:()=>{}}),d.jsx(le,{isAppContentDrawerOpen:I,handleDrawerToggle:re}),d.jsx(ut,{onClose:()=>{t(Oe()),o("../setup")},anchor:"right",open:a.pathname.includes("verification"),transitionDuration:c?0:250,PaperProps:{style:{width:Pt.overlayWidth.valuePercentage(n),boxShadow:"none"}},slotProps:{backdrop:{style:{backgroundColor:c?"transparent":r.colors.black,opacity:.75,cursor:"pointer"}}},children:d.jsx(Dt,{onClick:w=>w.stopPropagation(),children:d.jsx(vt,{productType:"zeni_treasury",isBusinessVerificationDrawerOpen:!0,closeDrawerHandler:()=>{t(Oe()),o("../setup")}})})}),d.jsx(Tt,{navigate:o,location:a,companyId:F,currentTenant:z,isUserZeniAccountsAdmin:g,meetingUrl:e("treasury_setup"),maxInsuredAmount:_.maxInsuredAmount,isAllocationDone:G,analytics:D,treasurySetupView:ce,onClickMenuIcon:()=>{re(!0)},showTreasurySetupOverlay:c,setShowTreasurySetupOverlay:p})]})},Dt=xe(lt)`
17
+ `,At=G((function(e,o){const{isUserRemiAdmin:a,companyId:t}=o,r=V(e),n=Cn(e),i=hn(e,t),l=E.getSignedInUser(),s=r.tenantId,c={userId:l?.userId??"",sessionId:l?.zeniSessionId??"",tenantId:s??""};return{remiSetupView:i,isDisabled:a&&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",remiApprovalView:n,connectedAccountProvider:r.company?.featuresActivationInfo.connectedAccountProvider??"",analytics:D,filesEndPoint:`${oe.fileMicroServiceBaseUrl}`,authParams:c}}),(function(e,o){const{navigate:a,companyId:t,currentTenant:r}=o;return{updateMileageDetails:n=>{const{mileageAmount:i,mileageUnit:l,mileageCurrencyCode:s,mileageCurrencySymbol:c,denomination:p,denominationSymbol:g,mileageAmountInDenomination:S,description:_}=n;e(An({mileageDetails:{mileageUnitAmount:{amount:i,currencyCode:s,currencySymbol:c},denomination:p,denominationSymbol:g,mileageAmountInDenomination:S,mileageCurrencyCode:s,mileageCurrencySymbol:c,mileageUnit:l,description:_}}))},onSaveMileageClick:n=>{e(In(t)),D.trackReimbursementMileageRateSave(n)},onBusinessVerificationSectionClick:()=>{a("../verification"),r?.company?.companyReimbursementInfo!=null&&r?.company?.companyBillPayInfo?.businessVerificationStatus?.code==="pending_review"&&e(ge(t,!1,!0))},onSetupApprovalRulesSectionClick:()=>{a("../approval-rules")},onFetchLinkTokenClick:(n,i)=>{e(ve("reimbursement_setup",n,i))},onEstablishConnectionClick:n=>{e(ke(n,t,"reimbursement_setup","reimbursement"))},onUpdatePaymentAccountStatus:(n,i,l)=>{e(_e(n,i,"reimbursement","reimbursement_setup",l))},onUpdatePaymentAccountLoginStatus:(n,i)=>{e(Ae(!1,n,"reimbursement","reimbursement_setup",i))},onEstablishConnectionSuccess:()=>{e(ge(t,!0))},onEnableRemiClick:()=>{e(Y(t,"reimbursement"))},onUpdateAccountClick:(n,i,l)=>{e(l==="paymentAccount"?he(n,i,"reimbursement","reimbursement_setup"):Ie("reimbursement_setup",n,i))},onEnableRemiSuccess:()=>{a("../",{relative:"path"})},onBackClick:()=>{r?.companyReimbursementInfo?.info?.isReimbursementEnabled!=null&&r.companyReimbursementInfo.info.isReimbursementEnabled===!1?a("../.."):a("../",{relative:"path"})},onCompanyOfficerUpdated:(n,i)=>{e(be({officerType:n,fileIds:i}))},onSendForVerificationClick:n=>{e(L(t,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(Ce(t,"reimbursement_setup",n,i))}}}))(tt),_t=()=>{const e=Pe(),o=X(),a=Q(),t=ee(),{tenantEmailDomain:r}=W(),n=ie(),i=Ee(),l=Sn(n?.loggedInUserRoleMap),s=Fe(n?.loggedInUserRoleMap),[c,p]=h.useState(!1),g=h.useRef(!1),[S,_]=h.useState(!1),I=k((P=>P.remiSetupViewState.fetchState)),d=k((P=>V(P))),y=k((P=>P.remiSetupApproverViewState.fetchState)),{isApprovalRulesV3Enabled:f,isLoading:v}=nt(d?.tenantId),b=E.getSignedInUserTenant(r)?.companyId??d.companyId,m=E.getSignedInUser(),C=P=>{p(P)};if(m==null)throw Error("Can't access reimbursement setup page without signing in...");if(h.useEffect((()=>{g.current||I!=="Not-Started"||b==null?g.current||I!=="Completed"||b==null||d.companyBillPayInfo?.info?.businessVerificationStatus?.code!=="pending_review"||(g.current=!0,t(ge(b,!1,!0))):(g.current=!0,t(ge(b,!0)))}),[I,b,t]),h.useEffect((()=>{S||y!=="Not-Started"||v||(_(!0),t(bn(!0,!1,!1,f)))}),[S,y,v,f,t]),d.companyReimbursementInfo?.info?.isReimbursementTOSAccepted===!1)return u.jsx(R,{to:"../promo"});if(d.companyReimbursementInfo?.info?.isReimbursementTOSAccepted===!0){const P=T=>T.trackPageLoaded($.Event.reimbursementSetup);return u.jsxs(It,{children:[u.jsx(se,{analytics:D,onLoad:T=>P(T)}),u.jsx(le,{isAppContentDrawerOpen:c,handleDrawerToggle:C}),u.jsx(At,{navigate:o,location:a,companyId:b,currentTenant:d,isUserRemiAdmin:l,meetingUrl:e("reimbursement_setup"),onClickMenuIcon:()=>{C(!0)},hasZeniAccountsAdminAccess:s})]})}return u.jsx(Te,{fetchState:"In-Progress",style:{backgroundColor:i.colors.grey5}})},kt=G((function(e,o){const{businessVerificationDetails:a,productType:t}=o,r=V(e),n=E.getSignedInUser(),i=r.tenantId,l={userId:n?.userId??"",sessionId:n?.zeniSessionId??"",tenantId:i??""},s=On(o.roleMap)&&a.updateStatus.fetchState!=="In-Progress"?void 0:"readonly",c=Un(e.companyConfigState),p=wn(e.userRoleConfigState),g=t==="zeni_treasury"?Je(e):void 0;return{businessVerificationDetails:a,verficationDetailsFetchState:a.fetchState,isRefreshingViewInBackground:a.isRefreshingViewInBackground,allNationalityCountries:a.allNationalityCountries,filesEndPoint:`${oe.fileMicroServiceBaseUrl}`,authParams:l,isDisabled:s,allIndustries:c.companyIndustries??[],companyTitles:p.companyTitles,transferDetails:g}}),(function(e,o){const{companyId:a,productType:t,currentTenant:r,navigate:n,location:i}=o,{tenantEmailDomain:l}=r;return{onCompanyDetailsChanged:s=>{const{companyDescription:c,companyIndustry:p,companyIndustryType:g,companyLegalName:S,companyTaxId:_,companyWebsite:I,companyPhone:d,primaryContactEmail:y,primaryContactName:f,primaryContactUserId:v,primaryContactSyncToken:b,syncToken:m,fileIds:C,incDate:P,typeOfIncorporation:T,stateOfIncorporation:O,sourceOfFunds:A,companySubIndustry:U,countriesOfOperations:B,companySourceOfFunds:z,companySourceOfFundsDescription:F,transactionVolume:ce,transactionVolumeDescription:H,purposeOfAccount:q,purposeOfAccountDescription:re,regulatedStatus:Z,regulatedStatusDescription:j,usNexus:w,usNexusTypes:De}=s,pe=g?.selectedOption,me={companyId:a,companyDescription:c,companyIndustry:p.selectedOption,companyIndustryType:pe==null||pe===""?void 0:pe,companyLegalName:S,taxIdOrEIN:_,website:I!=""&&I!=null?Nn(I):void 0,phone:d,syncToken:m,fileIds:C,incDate:P!=null?Re(P?.toString()):P,typeOfIncorporation:T?.selectedOption??"",stateOfIncorporation:O?.selectedOption??"",sourceOfFunds:A?.selectedOption??"",companySubIndustry:U?.selectedOption??"",countriesOfOperations:B?.selectedOptions.map((ue=>ue.length===2?ue:ze(ue)))??[],companySourceOfFunds:z?.selectedOption??"",companySourceOfFundsDescription:F,transactionVolume:ce?.selectedOption??"",transactionVolumeDescription:H,purposeOfAccount:q?.selectedOption??"",purposeOfAccountDescription:re,regulatedStatus:Z??"",regulatedStatusDescription:j,usNexus:w,usNexusTypes:De?.selectedOptions??[]},ye={userId:v,firstName:f.firstName,lastName:f.lastName,email:y,syncToken:b};e(Ne({companyDetails:me,primaryContactDetails:ye}))},onCompanyOfficerUpdated:s=>{const c=s.map((p=>{const{officerType:g,userId:S,name:_,email:I,nationalityCountryCode:d,ssn:y,dob:f,phone:v,syncToken:b,selectDocument:m,role:C,ownership:P,isSelectedForVerification:T,userVerificationStatus:O,treasuryUserVerificationStatus:A,fileIds:U}=p;let B;return m.selectDocumentType==="driverLicense"?B="driving_license":m.selectDocumentType==="passport"?B="passport":m.selectDocumentType==="stateId"?B="id_document":m.selectDocumentType==="ssnCard"&&(B="social_security_card"),{officerType:g,userId:S,firstName:_.firstName,lastName:_.lastName,email:I,ssn:y,nationalityCountryCode:d?.selectedOption!=null?ze(d.selectedOption):void 0,phone:v,birthday:f!=null?Re(f?.toString()):f,syncToken:b,titleAtCompany:C.selectedOption,ownershipInCompany:P,documentTypeSelectedForVerification:B,isSelectedForVerification:T,userVerificationStatus:O,treasuryUserVerificationStatus:A,fileIds:U,additionalDocumentTypesRequestedForVerification:[],additionalSubmittedDocumentsForVerificationFileIds:[],areAdditionalDocumentsRequestedForVerification:!1,areAdditionalDocumentsSubmittedForVerification:!1}}));e(Ne({officers:c}))},onSaveDetailsClick:s=>{e(L(a,s,t))},onSendForVerificationClick:s=>{e(L(a,s,t,!0))},onAddressClick:s=>{const c=We(l,s),p=Me(i.state?.pathnameStackToGoBack,i.pathname),g=new URLSearchParams(i.search),S={};g.forEach(((_,I)=>{S[I]=_})),n(c,{state:{pathnameStackToGoBack:p,queryParams:Object.keys(S).length>0?S:void 0}})},onRegisteredAddressClick:s=>{const c=We(l,s),p=Me(i.state?.pathnameStackToGoBack,i.pathname),g=new URLSearchParams(i.search),S=Object.fromEntries(g.entries());n(c,{state:{pathnameStackToGoBack:p,queryParams:Object.keys(S).length>0?S:void 0}})},onBackClick:()=>{e(Rn({companyId:a})),n("../setup")},updateFilesEntity:s=>{e(ae({files:s}))},onDeleteFile:s=>{e(te(s))},onDeleteFileList:s=>{e(Xe(s))},onEditFileName:(s,c)=>{e(ne(s,c.split(".")[0]))},onGetOtp:s=>{e(qe(s,"SpendManagementSetup"))},onResendOtp:s=>{e(He(s,"SpendManagementSetup"))},onVerifyOtp:(s,c)=>{e(Ge(s,c,"SpendManagementSetup"))},saveNewAddressInLocalStore:(s,c)=>{e(jn({addressType:s,addressToCreate:c}))},onExecuteTreasuryTransfer:()=>{e(Ye())},onOverlayClose:()=>{e(Ue())},onIdentityDocumentUploadedForAutofill:s=>{if(a==null)return;const c=xn(s.documentType);c!=null&&e(Bn({target:"setup",companyId:a,officerType:s.officerType,fileId:s.fileId,documentType:c}))},onCompanyDocumentUploadedForAutofill:s=>{a!=null&&e(Vn({target:"setup",companyId:a,fileId:s.fileId,documentType:s.documentType}))},onResetKycKybClick:()=>{e(Fn())}}}))(at),vt=({productType:e,isBusinessVerificationDrawerOpen:o,closeDrawerHandler:a})=>{const t=X(),r=Q(),n=ee(),[i]=en(),l=i.get("showStepProgress"),s=i.get("isTransferInitiated"),[c,p]=h.useState(!1),{tenantEmailDomain:g}=W(),S=ie(),{useDynamicConfig:_}=de(),I=Ee(),{configValue:d}=_(Ve.zeniAccountsConfig),y=je(d),f=k((A=>{switch(e){case"zeni_accounts":return A.zeniAccountSetupViewState.fetchState;case"reimbursement":return A.remiSetupViewState.fetchState;case"charge_cards":return A.chargeCardSetupViewState.fetchState;case"zeni_treasury":return A.treasurySetupViewState.fetchState;default:return A.billPaySetupViewState.fetchState}})),v=k((A=>A.companyConfigState.fetchState)),b=k((A=>A.userRoleConfigState.fetchState)),m=k((A=>V(A))),C=m.companyId??E.getSignedInUserTenant(g)?.companyId;h.useEffect((()=>{v==="Not-Started"&&n(_n()),b==="Not-Started"&&n(kn(!0))}),[v,b,n]),h.useEffect((()=>{c||f!=="Not-Started"||C==null||(p(!0),Ze(n,e,C))}),[c,f,C,n]);const P=k((A=>{let U;switch(e){case"zeni_accounts":U=En(A,C);break;case"zeni_treasury":U=Ke(A,C);break;case"charge_cards":U=Tn(A,C);break;case"reimbursement":U=Pn(A,C);break;default:U=vn(A,C)}return U})),T=P.kycKybResetStatus.fetchState;if(h.useEffect((()=>{T==="Completed"&&C!=null&&(Ze(n,e,C,!0),n(Dn()))}),[T,C,e,n]),E.getSignedInUser()==null)throw Error("Can't access business verification without signing in...");let O;switch(e){case"zeni_accounts":O=m.companyZeniAccountInfo?.info?.isZeniAccountTOSAccepted;break;case"reimbursement":O=m.companyReimbursementInfo?.info?.isReimbursementTOSAccepted;break;case"charge_cards":O=m.companyChargeCardInfo?.info?.isChargeCardTOSAccepted===!0||m.companyDebitCardInfo?.info?.isDebitCardTOSAccepted;break;case"zeni_treasury":O=m.companyTreasuryInfo?.info?.isTreasuryTOSAccepted;break;default:O=m.companyBillPayInfo?.info?.isBillPayTOSAccepted}return O===!1?null:P.fetchState==="Completed"&&O===!0&&S?.loggedInUserRoleMap!=null?u.jsxs(u.Fragment,{children:[u.jsx(se,{analytics:D,onLoad:A=>(U=>{switch(e){case"zeni_accounts":return U.trackPageLoaded($.Event.zeniAccountsBusinessVerification);case"reimbursement":case"charge_cards":return U.trackPageLoaded($.Event.reimbursementBusinessVerification);default:return U.trackPageLoaded($.Event.billPayBusinessVerification,Be(r)?"Settings":void 0)}})(A)}),u.jsx(kt,{businessVerificationDetails:P,navigate:t,location:r,companyId:C,analytics:D,currentTenant:m,productType:e,roleMap:S.loggedInUserRoleMap,isSettings:Be(r),isOverlay:!0,isStepInProgress:l!=null,isTreasuryTransferInitiated:s!=null,onClickMenuIcon:()=>{},maxInsuredAmount:y.maxInsuredAmount,isBusinessVerificationDrawerOpen:o,closeDrawerHandler:a})]}):u.jsx(Te,{fetchState:"In-Progress",style:{backgroundColor:I.colors.grey5}})},Pt={overlayWidth:new st(100,100,59)},Tt=G((function(e,o){const{isUserZeniAccountsAdmin:a,companyId:t}=o,r=V(e),n=E.getSignedInUser(),i=r.tenantId,l={userId:n?.userId??"",sessionId:n?.zeniSessionId??"",tenantId:i??""},s=Qe(e,t),c=Ke(e,t),p=a&&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",g=Zn(e),S=g.transactions,_=Je(e),I=g.accountSummary?.totalBalance?.amount,d=S.length===0||I===0;return{treasurySetupView:s,businessVerificationDetails:c,connectedAccountProvider:r.company?.featuresActivationInfo.connectedAccountProvider??"",transactions:S,transferDetails:_,isFirstTransfer:d,isDisabled:p,analytics:D,filesEndPoint:`${oe.fileMicroServiceBaseUrl}`,authParams:l,isOnSetup:!0,maxInsuredAmount:o.maxInsuredAmount}}),(function(e,o){const{navigate:a,companyId:t,currentTenant:r,isAllocationDone:n,analytics:i,treasurySetupView:l}=o;return{onTransferSaveChangesToLocalStore:s=>{e(Gn(s))},onBusinessVerificationSectionClick:(s,c)=>{let p="../verification";s&&(p+="?showStepProgress=true",c&&(p+="&isTransferInitiated=true")),a(p),r?.company?.companyTreasuryInfo!=null&&r?.company?.companyTreasuryInfo?.businessVerificationStatus?.code==="pending_review"&&e(we(t,!1,!0))},onFetchLinkTokenClick:(s,c)=>{e(ve("treasury_setup",s,c))},onEstablishConnectionClick:s=>{e(ke(s,t,"treasury_setup","zeni_treasury"))},onUpdatePaymentAccountStatus:(s,c,p)=>{e(_e(s,c,"zeni_treasury","treasury_setup",p))},onUpdatePaymentAccountLoginStatus:(s,c)=>{e(Ae(!1,s,"zeni_treasury","treasury_setup",c))},onEstablishConnectionSuccess:()=>{e(we(t,!0))},onEnableTreasuryClick:()=>{e(Y(t,"zeni_treasury"))},onUpdateTreasuryClick:(s,c,p)=>{e(p==="paymentAccount"?he(s,c,"zeni_treasury","treasury_setup"):Ie("treasury_setup",s,c))},onUpdatePrimaryFundingAccount:(s,c)=>{e(Ce(t,"treasury_setup",s,c))},onNavigateToDashboard:()=>{a(r?.company?.companyTreasuryInfo?.businessVerificationStatus?.code==="verified"?"../":"../../")},onCompanyOfficerUpdated:(s,c)=>{e(be({officerType:s,fileIds:c}))},onSendForVerificationClick:(s,c)=>{if(e(L(t,s,"zeni_treasury",!0,!0,!0)),!n){const p=l.fundAllocationLocalData;i.trackTreasuryPortfolioConfirm(p.riskScore,$e(p)),e(Le(!1))}c===!0&&e(Ye())},updateFilesEntity:s=>{e(ae({files:s}))},onDeleteFile:s=>{e(te(s))},onEditFileName:(s,c)=>{e(ne(s,c.split(".")[0]))},onAdditionalVerificationFieldsChanged:s=>{const{sourceOfFunds:c}=s;e(Wn({sourceOfFunds:c?.selectedOption??""}))},onUpdateFundAllocation:s=>{i.trackTreasuryAllocationAction("update",$e(s)),e($n(s))},onConfirmFundAllocation:()=>{e(Le(n))},onOverlayClose:()=>{e(Ue())}}}))(ot),Et=()=>{const e=Pe(),o=X(),a=Q(),t=ee(),r=Ee(),n=it(),{tenantEmailDomain:i}=W(),{useDynamicConfig:l}=de(),s=ie(),[c,p]=h.useState(!1),g=Fe(s?.loggedInUserRoleMap),{configValue:S}=l(Ve.zeniAccountsConfig),_=je(S),[I,d]=h.useState(!1),[y,f]=h.useState(!1),[v,b]=h.useState(!1),[m,C]=h.useState(!1),[P,T]=h.useState(!1),O=k((w=>w.treasurySetupViewState.fetchState)),A=k((w=>w.treasurySetupViewState.treasuryFundsDetails?.fetchStatus?.fetchState)),U=k((w=>w.treasurySetupViewState.currentAllocation.fetchStatus?.fetchState)),B=k((w=>w.treasuryDetailState.transactionsState?.fetchState)),z=k((w=>V(w))),F=E.getSignedInUserTenant(i)?.companyId??z.companyId,ce=k((w=>Qe(w,F))),H=ce.isAtomicAccountExists,q=E.getSignedInUser(),re=w=>{d(w)};if(q==null)throw Error("Can't access treasury setup page without signing in...");h.useEffect((()=>{y||O!=="Not-Started"||F==null||(f(!0),t(we(F,!0,!1)))}),[y,O,F,t]),h.useEffect((()=>{v||A!=="Not-Started"||F==null||(b(!0),t(Ln()))}),[v,A,F,t]),h.useEffect((()=>{m||U!=="Not-Started"||F==null||(C(!0),t(Mn()))}),[m,U,F,t]),h.useEffect((()=>{P||B!=="Not-Started"||F==null||(T(!0),t(zn(!0)))}),[P,B,F,t]);const Z=z.companyTreasuryInfo?.info?.businessVerificationStatus?.code,j=Z==="pending_review"||Z==="verified";return h.useEffect((()=>{c||O!=="Completed"||H||j||!a.pathname.includes("setup")||p(!0)}),[O,H,j]),z.companyTreasuryInfo?.info?.isTreasuryTOSAccepted===!1?u.jsx(R,{to:"../promo"}):u.jsxs(u.Fragment,{children:[u.jsx(se,{analytics:D,onLoad:()=>{}}),u.jsx(le,{isAppContentDrawerOpen:I,handleDrawerToggle:re}),u.jsx(dt,{onClose:()=>{t(Ue()),o("../setup")},anchor:"right",open:a.pathname.includes("verification"),transitionDuration:c?0:250,PaperProps:{style:{width:Pt.overlayWidth.valuePercentage(n),boxShadow:"none"}},slotProps:{backdrop:{style:{backgroundColor:c?"transparent":r.colors.black,opacity:.75,cursor:"pointer"}}},children:u.jsx(Dt,{onClick:w=>w.stopPropagation(),children:u.jsx(vt,{productType:"zeni_treasury",isBusinessVerificationDrawerOpen:!0,closeDrawerHandler:()=>{t(Ue()),o("../setup")}})})}),u.jsx(Tt,{navigate:o,location:a,companyId:F,currentTenant:z,isUserZeniAccountsAdmin:g,meetingUrl:e("treasury_setup"),maxInsuredAmount:_.maxInsuredAmount,isAllocationDone:H,analytics:D,treasurySetupView:ce,onClickMenuIcon:()=>{re(!0)},showTreasurySetupOverlay:c,setShowTreasurySetupOverlay:p})]})},Dt=xe(lt)`
18
18
  display: flex;
19
19
  min-height: 100%;
20
20
  flex-direction: column;
21
- `,Ut=H((function(e,o){const{isUserZeniAccountsAdmin:a,companyId:t}=o,r=V(e),n=E.getSignedInUser(),i=r.tenantId,l={userId:n?.userId??"",sessionId:n?.zeniSessionId??"",tenantId:i??""},s=Gn(e,t),c=a&&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:r.company?.featuresActivationInfo.connectedAccountProvider??"",isDisabled:c,analytics:D,filesEndPoint:`${oe.fileMicroServiceBaseUrl}`,authParams:l}}),(function(e,o){const{navigate:a,companyId:t,currentTenant:r}=o;return{onBusinessVerificationSectionClick:()=>{a("../verification"),r?.company?.companyZeniAccountInfo!=null&&r?.company?.companyBillPayInfo?.businessVerificationStatus?.code==="pending_review"&&e(Se(t,!1,!0))},onFetchLinkTokenClick:(n,i)=>{e(ve("account_setup",n,i))},onEstablishConnectionClick:n=>{e(ke(n,t,"account_setup","zeni_accounts"))},onUpdatePaymentAccountStatus:(n,i,l)=>{e(_e(n,i,"zeni_accounts","account_setup",l))},onUpdatePaymentAccountLoginStatus:(n,i)=>{e(Ae(!1,n,"zeni_accounts","account_setup",i))},onEstablishConnectionSuccess:()=>{e(Se(t,!0))},onEnableZeniAccountClick:()=>{e(Y(t,"zeni_accounts"))},onUpdateZeniAccountClick:(n,i,l)=>{e(l==="paymentAccount"?he(n,i,"zeni_accounts","account_setup"):Ie("account_setup",n,i))},onUpdatePrimaryFundingAccount:(n,i)=>{e(Ce(t,"account_setup",n,i))},onEnableZeniAccountSuccess:()=>{a("../",{relative:"path"})},onBackClick:()=>{r?.companyZeniAccountInfo?.info?.isZeniAccountEnabled?a("../"):a("../../")},onNavigateToDashboard:()=>{a("../../dashboard")},onCompanyOfficerUpdated:(n,i)=>{e(be({officerType:n,fileIds:i}))},onSendForVerificationClick:n=>{e(L(t,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]))}}}))(ct),Ot=()=>{const e=Pe(),o=X(),a=Q(),t=ee(),{tenantEmailDomain:r}=W(),{useDynamicConfig:n}=ue(),i=ie(),l=Fe(i?.loggedInUserRoleMap),{configValue:s}=n(Ve.zeniAccountsConfig),c=je(s),[p,g]=h.useState(!1),[S,_]=h.useState(!1),I=k((b=>b.zeniAccountSetupViewState.fetchState)),u=k((b=>V(b))),y=E.getSignedInUserTenant(r)?.companyId??u.companyId,f=E.getSignedInUser(),v=b=>{g(b)};if(f==null)throw Error("Can't access zeni bank account setup page without signing in...");if(h.useEffect((()=>{S||I!=="Not-Started"||y==null?S||I!=="Completed"||y==null||u.companyBillPayInfo?.info?.businessVerificationStatus?.code!=="pending_review"||t(Se(y,!1,!0)):(_(!0),t(Se(y,!0)))}),[S,I,y,t]),u.companyZeniAccountInfo?.info?.isZeniAccountTOSAccepted===!1)return d.jsx(R,{to:"../promo"});{const b=m=>m.trackPageLoaded($.Event.zeniAccountsSetup);return d.jsxs(d.Fragment,{children:[d.jsx(se,{analytics:D,onLoad:m=>b(m)}),d.jsx(le,{isAppContentDrawerOpen:p,handleDrawerToggle:v}),d.jsx(Ut,{navigate:o,location:a,companyId:y,currentTenant:u,isUserZeniAccountsAdmin:l,accountsPromoConfig:c,meetingUrl:e("zeni_accounts_setup"),onClickMenuIcon:()=>{v(!0)}})]})}},wt=xe.div`
21
+ `,Ot=G((function(e,o){const{isUserZeniAccountsAdmin:a,companyId:t}=o,r=V(e),n=E.getSignedInUser(),i=r.tenantId,l={userId:n?.userId??"",sessionId:n?.zeniSessionId??"",tenantId:i??""},s=Hn(e,t),c=a&&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:r.company?.featuresActivationInfo.connectedAccountProvider??"",isDisabled:c,analytics:D,filesEndPoint:`${oe.fileMicroServiceBaseUrl}`,authParams:l}}),(function(e,o){const{navigate:a,companyId:t,currentTenant:r}=o;return{onBusinessVerificationSectionClick:()=>{a("../verification"),r?.company?.companyZeniAccountInfo!=null&&r?.company?.companyBillPayInfo?.businessVerificationStatus?.code==="pending_review"&&e(Se(t,!1,!0))},onFetchLinkTokenClick:(n,i)=>{e(ve("account_setup",n,i))},onEstablishConnectionClick:n=>{e(ke(n,t,"account_setup","zeni_accounts"))},onUpdatePaymentAccountStatus:(n,i,l)=>{e(_e(n,i,"zeni_accounts","account_setup",l))},onUpdatePaymentAccountLoginStatus:(n,i)=>{e(Ae(!1,n,"zeni_accounts","account_setup",i))},onEstablishConnectionSuccess:()=>{e(Se(t,!0))},onEnableZeniAccountClick:()=>{e(Y(t,"zeni_accounts"))},onUpdateZeniAccountClick:(n,i,l)=>{e(l==="paymentAccount"?he(n,i,"zeni_accounts","account_setup"):Ie("account_setup",n,i))},onUpdatePrimaryFundingAccount:(n,i)=>{e(Ce(t,"account_setup",n,i))},onEnableZeniAccountSuccess:()=>{a("../",{relative:"path"})},onBackClick:()=>{r?.companyZeniAccountInfo?.info?.isZeniAccountEnabled?a("../"):a("../../")},onNavigateToDashboard:()=>{a("../../dashboard")},onCompanyOfficerUpdated:(n,i)=>{e(be({officerType:n,fileIds:i}))},onSendForVerificationClick:n=>{e(L(t,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]))}}}))(ct),Ut=()=>{const e=Pe(),o=X(),a=Q(),t=ee(),{tenantEmailDomain:r}=W(),{useDynamicConfig:n}=de(),i=ie(),l=Fe(i?.loggedInUserRoleMap),{configValue:s}=n(Ve.zeniAccountsConfig),c=je(s),[p,g]=h.useState(!1),[S,_]=h.useState(!1),I=k((b=>b.zeniAccountSetupViewState.fetchState)),d=k((b=>V(b))),y=E.getSignedInUserTenant(r)?.companyId??d.companyId,f=E.getSignedInUser(),v=b=>{g(b)};if(f==null)throw Error("Can't access zeni bank account setup page without signing in...");if(h.useEffect((()=>{S||I!=="Not-Started"||y==null?S||I!=="Completed"||y==null||d.companyBillPayInfo?.info?.businessVerificationStatus?.code!=="pending_review"||t(Se(y,!1,!0)):(_(!0),t(Se(y,!0)))}),[S,I,y,t]),d.companyZeniAccountInfo?.info?.isZeniAccountTOSAccepted===!1)return u.jsx(R,{to:"../promo"});{const b=m=>m.trackPageLoaded($.Event.zeniAccountsSetup);return u.jsxs(u.Fragment,{children:[u.jsx(se,{analytics:D,onLoad:m=>b(m)}),u.jsx(le,{isAppContentDrawerOpen:p,handleDrawerToggle:v}),u.jsx(Ot,{navigate:o,location:a,companyId:y,currentTenant:d,isUserZeniAccountsAdmin:l,accountsPromoConfig:c,meetingUrl:e("zeni_accounts_setup"),onClickMenuIcon:()=>{v(!0)}})]})}},wt=xe.div`
22
22
  display: flex;
23
23
  height: 100vh;
24
24
  width: 100%;
@@ -26,4 +26,4 @@ import{j as d}from"./liveblocks-V5YQZeeY.js";import{h as X,g as Q,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
- `,Ft=H((function(e,o){const a=V(e),t=E.getSignedInUser(),r=a.tenantId,n={userId:t?.userId??"",sessionId:t?.zeniSessionId??"",tenantId:r??""};return{internationalOnboardingDetails:Jn(e),isReadonly:o.isFormReadonly,filesEndPoint:`${oe.fileMicroServiceBaseUrl}`,authParams:n,analytics:D}}),(function(e,o){const{navigate:a}=o;return{onFormDataChange:t=>{e(Xn(t))},onSubmitClick:()=>{e(Yn(o.companyId))},onCancelClick:()=>{a("../setup")},updateFilesEntity:t=>{e(ae({files:t}))},onDeleteFile:t=>{e(te(t))},onDeleteFileList:t=>{e(Xe(t))},onEditFileName:(t,r)=>{e(ne(t,r.split(".")[0]))}}}))(rt),Vt=()=>{const e=X(),o=Q(),a=ee(),[t,r]=h.useState(!1),[n,i]=h.useState(!1),[l,s]=h.useState(!1),{tenantEmailDomain:c}=W(),p=ie(),{useFeatureGate:g}=ue(),{isFeatureEnabled:S}=g(q.isBillPayLocalCurrencyFeatureEnabled),_=k((T=>T.internationalWireVerificationState.verificationFormFetchState.fetchState)),I=k((T=>T.billPaySetupViewState.fetchState)),u=k((T=>V(T))),y=Ee(),f=u.companyId??E.getSignedInUserTenant(c)?.companyId,v=k((T=>Kn(T.companyState,u.companyId))),b=v?.company.companyBillPayInfo.internationalWireOnboardingStatus,m=b?.code==="onboarding_status_not_started"?void 0:"readonly";if(h.useEffect((()=>{t||_!=="Not-Started"||f==null||(r(!0),a(qn(f)))}),[t,_,f,a]),h.useEffect((()=>{n||I!=="Not-Started"||f==null||(i(!0),a(J(f,!0)))}),[I,n,f,a]),E.getSignedInUser()==null)throw Error("Can't access international verification without signing in...");const C=u.companyBillPayInfo?.info?.isBillPayTOSAccepted,P=T=>{s(T)};return C===!1?d.jsx(R,{to:"../promo"}):C===!0&&p?.loggedInUserRoleMap!=null?d.jsxs(wt,{children:[d.jsx(se,{analytics:D,onLoad:T=>(U=>U.trackPageLoaded($.Event.billPayBusinessVerification,void 0))(T)}),Be(o)?d.jsx(le,{isAppContentDrawerOpen:l,handleDrawerToggle:P}):null,d.jsx(Ft,{navigate:e,location:o,companyId:f,analytics:D,currentTenant:u,roleMap:p.loggedInUserRoleMap,isFormReadonly:m,isLocalCurrencyEnabled:S})]}):d.jsx(Te,{fetchState:"In-Progress",style:{backgroundColor:y.colors.grey5}})},xt=H((function(){return{}}),(function(e,o){const{companyId:a,productType:t}=o;return{onEventReceived:r=>{switch(r){case"bill-pay-set-up-verification-update":case"bill-pay-wise-setup":switch(t){case"reimbursement":e(ge(a,!0,!0));break;case"zeni_accounts":e(Se(a,!0,!0));break;case"charge_cards":e(fe(a,!0,!0));break;case"zeni_treasury":e(we(a,!0,!0));break;default:e(J(a,!0,!0))}}}}}))(dt((e=>{const{isBillPayAdminLevelAccess:o,isUserHasOnlyBillPayAccess:a,isReimbursementAdminLevelAccess:t,isZeniAccountAdminLevelAccess:r,isTreasuryAdminLevelAccess:n,isChargeCardAdminLevelAccess:i,isUserHasOnlyCardAccess:l,productType:s,type:c}=e;switch(s){case"bill_pay":switch(c){case"verification":return o?d.jsx(Ue,{productType:s}):a?d.jsx(R,{to:"../"}):d.jsx(N,{});case"international-wire":return o?d.jsx(Vt,{}):a?d.jsx(R,{to:"../"}):d.jsx(N,{});default:return o?d.jsx(ft,{}):a?d.jsx(R,{to:"../"}):d.jsx(N,{})}case"reimbursement":return c==="verification"?t?d.jsx(Ue,{productType:s}):d.jsx(N,{}):t?d.jsx(_t,{}):d.jsx(N,{});case"zeni_accounts":return c==="verification"?r?d.jsx(Ue,{productType:"zeni_accounts"}):d.jsx(N,{}):r?d.jsx(Ot,{}):d.jsx(N,{});case"zeni_treasury":return n===!0?d.jsx(Et,{}):d.jsx(N,{});case"charge_cards":return c==="verification"?i?d.jsx(Ue,{productType:"charge_cards"}):l?d.jsx(R,{to:"../"}):d.jsx(N,{}):i?d.jsx(ht,{}):l?d.jsx(R,{to:"../"}):d.jsx(N,{})}})));function da(e){const{tenantEmailDomain:o}=W(),a=k((r=>V(r))).companyId??E.getSignedInUserTenant(o)?.companyId,t={events:a!=null?[`private-encrypted-${a}.bill-pay-set-up-verification-update`,`private-encrypted-${a}.bill-pay-wise-setup`]:[],eventCallback:(r,n,i)=>{i.onEventReceived(r)}};if(E.getSignedInUser()==null)throw Error("Can't access setup details page without signing in...");return d.jsx(xt,{...e,companyId:a,...t})}export{ia as A,sa as P,da as S,na as a,aa as b,St as c,bt as d,gt as e,oa as f,Yt as g,Kt as h,ea as i,ta as j,ca as k,Qt as l,Xt as m,qt as n,Jt as o,Gt as p,ra as s};
29
+ `,Ft=G((function(e,o){const a=V(e),t=E.getSignedInUser(),r=a.tenantId,n={userId:t?.userId??"",sessionId:t?.zeniSessionId??"",tenantId:r??""};return{internationalOnboardingDetails:Jn(e),isReadonly:o.isFormReadonly,filesEndPoint:`${oe.fileMicroServiceBaseUrl}`,authParams:n,analytics:D}}),(function(e,o){const{navigate:a}=o;return{onFormDataChange:t=>{e(Xn(t))},onSubmitClick:()=>{e(Yn(o.companyId))},onCancelClick:()=>{a("../setup")},updateFilesEntity:t=>{e(ae({files:t}))},onDeleteFile:t=>{e(te(t))},onDeleteFileList:t=>{e(Xe(t))},onEditFileName:(t,r)=>{e(ne(t,r.split(".")[0]))}}}))(rt),Vt=()=>{const e=X(),o=Q(),a=ee(),[t,r]=h.useState(!1),[n,i]=h.useState(!1),[l,s]=h.useState(!1),{tenantEmailDomain:c}=W(),p=ie(),{useFeatureGate:g}=de(),{isFeatureEnabled:S}=g(K.isBillPayLocalCurrencyFeatureEnabled),_=k((T=>T.internationalWireVerificationState.verificationFormFetchState.fetchState)),I=k((T=>T.billPaySetupViewState.fetchState)),d=k((T=>V(T))),y=Ee(),f=d.companyId??E.getSignedInUserTenant(c)?.companyId,v=k((T=>qn(T.companyState,d.companyId))),b=v?.company.companyBillPayInfo.internationalWireOnboardingStatus,m=b?.code==="onboarding_status_not_started"?void 0:"readonly";if(h.useEffect((()=>{t||_!=="Not-Started"||f==null||(r(!0),a(Kn(f)))}),[t,_,f,a]),h.useEffect((()=>{n||I!=="Not-Started"||f==null||(i(!0),a(J(f,!0)))}),[I,n,f,a]),E.getSignedInUser()==null)throw Error("Can't access international verification without signing in...");const C=d.companyBillPayInfo?.info?.isBillPayTOSAccepted,P=T=>{s(T)};return C===!1?u.jsx(R,{to:"../promo"}):C===!0&&p?.loggedInUserRoleMap!=null?u.jsxs(wt,{children:[u.jsx(se,{analytics:D,onLoad:T=>(O=>O.trackPageLoaded($.Event.billPayBusinessVerification,void 0))(T)}),Be(o)?u.jsx(le,{isAppContentDrawerOpen:l,handleDrawerToggle:P}):null,u.jsx(Ft,{navigate:e,location:o,companyId:f,analytics:D,currentTenant:d,roleMap:p.loggedInUserRoleMap,isFormReadonly:m,isLocalCurrencyEnabled:S})]}):u.jsx(Te,{fetchState:"In-Progress",style:{backgroundColor:y.colors.grey5}})},xt=G((function(){return{}}),(function(e,o){const{companyId:a,productType:t}=o;return{onEventReceived:r=>{switch(r){case"bill-pay-set-up-verification-update":case"bill-pay-wise-setup":switch(t){case"reimbursement":e(ge(a,!0,!0));break;case"zeni_accounts":e(Se(a,!0,!0));break;case"charge_cards":e(fe(a,!0,!0));break;case"zeni_treasury":e(we(a,!0,!0));break;default:e(J(a,!0,!0))}}}}}))(ut((e=>{const{isBillPayAdminLevelAccess:o,isUserHasOnlyBillPayAccess:a,isReimbursementAdminLevelAccess:t,isZeniAccountAdminLevelAccess:r,isTreasuryAdminLevelAccess:n,isChargeCardAdminLevelAccess:i,isUserHasOnlyCardAccess:l,productType:s,type:c}=e;switch(s){case"bill_pay":switch(c){case"verification":return o?u.jsx(Oe,{productType:s}):a?u.jsx(R,{to:"../"}):u.jsx(N,{});case"international-wire":return o?u.jsx(Vt,{}):a?u.jsx(R,{to:"../"}):u.jsx(N,{});default:return o?u.jsx(ft,{}):a?u.jsx(R,{to:"../"}):u.jsx(N,{})}case"reimbursement":return c==="verification"?t?u.jsx(Oe,{productType:s}):u.jsx(N,{}):t?u.jsx(_t,{}):u.jsx(N,{});case"zeni_accounts":return c==="verification"?r?u.jsx(Oe,{productType:"zeni_accounts"}):u.jsx(N,{}):r?u.jsx(Ut,{}):u.jsx(N,{});case"zeni_treasury":return n===!0?u.jsx(Et,{}):u.jsx(N,{});case"charge_cards":return c==="verification"?i?u.jsx(Oe,{productType:"charge_cards"}):l?u.jsx(R,{to:"../"}):u.jsx(N,{}):i?u.jsx(ht,{}):l?u.jsx(R,{to:"../"}):u.jsx(N,{})}})));function ua(e){const{tenantEmailDomain:o}=W(),a=k((r=>V(r))).companyId??E.getSignedInUserTenant(o)?.companyId,t={events:a!=null?[`private-encrypted-${a}.bill-pay-set-up-verification-update`,`private-encrypted-${a}.bill-pay-wise-setup`]:[],eventCallback:(r,n,i)=>{i.onEventReceived(r)}};if(E.getSignedInUser()==null)throw Error("Can't access setup details page without signing in...");return u.jsx(xt,{...e,companyId:a,...t})}export{ia as A,sa as P,ua as S,na as a,aa as b,St as c,bt as d,gt as e,oa as f,Yt as g,qt as h,ea as i,ta as j,ca as k,Qt as l,Xt as m,Kt as n,Jt as o,Ht as p,ra as s};
@@ -0,0 +1 @@
1
+ import{j as f}from"./liveblocks-DxRiM6VH.js";import{a as u,R as b,t as A}from"./sentry-B-dIf5xz.js";import{u as z,h as D,j as d,g as M,N as O,l as V}from"./core--MkqccHv.js";import{u as j,z as s,k as E,G as F,N as P,O as N,S as _,R as B,T as R,W as v}from"./index-B3QEycF9.js";import{fI as W,UK as $,V2 as J,gl as K,gn as Y,V7 as G,gY as H,dl as q,V8 as U,V9 as Q,Va as X,c1 as y}from"./zeni-epic-state-Dg1W8Zu5.js";import{u as Z}from"./mui-kCJnrqYM.js";import{u as ee}from"./useDeviceId-8baAH1vH.js";import{f as te}from"./analyticsHelper-BwgoMQXe.js";import{t as ne}from"./getLocaleForTenant-GT2HpY4t.js";import"./recharts-EjKi4hbc.js";import"./analytics-DQKmqYV4.js";import"./plaid-D94Y0H1P.js";import"./dnd-CP4whtxN.js";import"./stripe-cKAAJElX.js";import"./lottie-ixiiUTSF.js";import"./lexical-BSiUIp1H.js";import"./pdf-CRxQY5HT.js";import"./utils-BPWa_pEs.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]="9c12789f-46f1-43e6-8418-a30c03200c47",t._sentryDebugIdIdentifier="sentry-dbid-9c12789f-46f1-43e6-8418-a30c03200c47")}catch{}})();const ie=V((function(t,i){const c=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:c,sendMagicLinkStatus:g,magicLinkExpired:n,magicLinkAlreadyUsed:a,magicLinkExpiredEmail:l}}),(function(t,i){const{location:c,navigate:g}=i;return console.warn(JSON.stringify(window.location)),{onOAuthError:(n,a)=>{A({message:`OAuth error from provider ${a} with error ${n}`,level:"error",tags:{authProvider:a,errorType:"zeni.login.error"},extra:{error:n,windowLocation:window.location.href}})},onOAuthSuccess:(n,a)=>{const l=a==="google"?window.location.origin:window.location.origin+window.location.pathname;t(X({authCode:n,oauthProvider:a,appType:"web",redirectUri:y(l),sourceUri:y(c.state!=null?c.state.origin:"")}))},getSignedInUser:()=>s.getSignedInUser(),onSignedInCallback:()=>{const n=c.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(U())}}}))(R),ae=b.memo(ie);function ve({setTenantEmailDomain:t}){const i=z(),c=D(),{clearAllLoading:g}=j(),n=s.getSignedInUser();u.useLayoutEffect((()=>{g()}),[g]);const a=ee(),l=d((e=>e.tenantState.magicLinkCodeVerifier)),{sendEmailMagicLinkFetchState:k,accountLocked:C,accountUnlockTime:L}=d((e=>e.tenantState)),p=d((e=>e.tenantState.fetchState)),h=d((e=>e.tenantState.activeTenantFetchState.fetchState)),S=d((e=>e.tenantState.signInState)),o=d((e=>e.tenantState.loggedInUser)),r=d((e=>W(e))),I=d((e=>$(e))),m=M(),w=Z().mode,x=m.state?.magicLinkExpired,T=m.state?.magicLinkAlreadyUsed;if(u.useEffect((()=>{k.fetchState==="Completed"&&l!=null&&(E.trackSignInLinkSent(),s.saveMagicLinkCodeVerifier(l))}),[k.fetchState,l]),u.useEffect((()=>{t(void 0)}),[]),u.useEffect((()=>{S!=="In-Progress"||p!=="Completed"&&h!=="Completed"||o?.zeniSessionId==null||r==null||(s.savePayNowInfoTooltip(!0,o.zeniSessionId),s.saveSignedInUserWithSession(o,o.zeniSessionId),s.saveSignedInUserTenants(J(I.tenantsInOrder),o.zeniSessionId),K(o.userId,o.zeniSessionId,r.tenantId),i(Y(r.tenantId)),s.saveActiveTenantDomainForUser(r.tenantEmailDomain),i(G("Completed")),F.updateAppLocaleID(ne(r)),te(o,r,w,void 0,I.tenantsInOrder),H().then((()=>{const e=B();e!=null&&P(e)})),setTimeout((()=>{E.trackLogin(N.Event.loginSuccess,o.authProvider??"google",q(r.productSettings))}),2e3))}),[S,p,h,o,r,I,w,m.state,i]),S==="In-Progress"&&p==="Completed"&&o?.zeniSessionId!=null&&r!=null||n!=null){const e=m.state?.origin??"/";return f.jsx(O,{to:e,state:{...m.state,origin:""}})}return f.jsxs(f.Fragment,{children:[f.jsx(ae,{magicLinkExpired:!!x,magicLinkAlreadyUsed:!!T,magicLinkExpiredEmail:s.getMagicLinkEmail()??void 0,location:m,navigate:c,deviceId:a??void 0,showEmailLogin:!0}),C===!0&&L!=null?f.jsx(_,{onClose:()=>i(U()),unlockDate:L}):null]})}export{ve as default};
@@ -0,0 +1,9 @@
1
+ import{j as s}from"./liveblocks-DxRiM6VH.js";import{a as i}from"./sentry-B-dIf5xz.js";import{u as l,g as d,N as u}from"./core--MkqccHv.js";import{z as n,k as f,O as m,a5 as p}from"./index-B3QEycF9.js";import{g$ as g,Vo as y}from"./zeni-epic-state-Dg1W8Zu5.js";import{n as h}from"./mui-kCJnrqYM.js";import"./recharts-EjKi4hbc.js";import"./analytics-DQKmqYV4.js";import"./plaid-D94Y0H1P.js";import"./dnd-CP4whtxN.js";import"./stripe-cKAAJElX.js";import"./lottie-ixiiUTSF.js";import"./lexical-BSiUIp1H.js";import"./pdf-CRxQY5HT.js";import"./utils-BPWa_pEs.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]="574f85ef-4f5c-43c4-8ece-23963f12f852",e._sentryDebugIdIdentifier="sentry-dbid-574f85ef-4f5c-43c4-8ece-23963f12f852")}catch{}})();function N(){const e=l(),t=d(),o=i.useRef(!1),a=n.isSignedIn(),r=t.state?.message==="logout"||a;return i.useEffect((()=>{if(r&&!o.current){o.current=!0;try{e(g()),y(),f.trackLogout(m.Event.logoutSuccess),f.resetUserIdentity(),n.clearAll()}catch(c){console.error("Error during sign out:",c)}finally{window.location.replace("/signin/auth")}}}),[r,e]),r?s.jsx(b,{children:s.jsx(p,{fetchState:"In-Progress"})}):s.jsx(u,{to:"../",replace:!0})}const b=h.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{N as default};
@@ -0,0 +1,9 @@
1
+ import{j as A}from"./liveblocks-DxRiM6VH.js";import{a as u}from"./sentry-B-dIf5xz.js";import{u as J,k as H,j as G,h as ma,g as Sa,i as ya,l as ba}from"./core--MkqccHv.js";import{z as M,p as Da,d as I,aq as Ea,a6 as ha,k as Ga,O as Ca,e9 as Aa,l as F,a2 as Ia}from"./index-B3QEycF9.js";import{QM as Ra,Rx as va,fI as Ba,a3b as na,gQ as Q,a3c as ra,a36 as La,R1 as X,a3d as Ka,Rd as Y,QO as wa,Qq as Ua,RJ as aa,a3e as ea,gk as Pa,RA as Fa,RF as ja,Rs as xa,Rq as ta,RG as Oa,Rn as $a,a3f as Na,a3g as za,a3h as qa,a3i as Ma,a3j as R,dz as Qa,dy as Za,a3k as Va,QL as Wa}from"./zeni-epic-state-Dg1W8Zu5.js";import{n as Ja}from"./mui-kCJnrqYM.js";import{u as Ha}from"./useAskAiCfoHostNavButtonProps-BZFKDw3z.js";import{M as Xa}from"./MobileAppDrawer-DfwkluKE.js";import{u as Ya}from"./useTaskManagerPusherEvents-WPqjoQIF.js";(function(){try{var a=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new a.Error().stack;t&&(a._sentryDebugIds=a._sentryDebugIds||{},a._sentryDebugIds[t]="c29b1529-4c33-4656-a00a-ba917221ba5f",a._sentryDebugIdIdentifier="sentry-dbid-c29b1529-4c33-4656-a00a-ba917221ba5f")}catch{}})();const _={TASK_CREATED:"task-created",TASK_UPDATED:"task-updated",TASK_SNOOZE_RESURFACED:"task-snooze-resurfaced",TASKS_BULK_UPDATED:"tasks-bulk-updated",TASKS_BULK_DELETED:"tasks-bulk-deleted"},ae=(a,t)=>a==null||a===""?[]:t.map((n=>`private-encrypted-${a}.${n}`)),ee=(a,t)=>a==null||a===""?[]:t.map((n=>`private-encrypted-${a}.${n}`)),j=a=>Array.isArray(a)&&a.every((t=>typeof t=="string")),oa=a=>typeof a.task_id=="string"?a.task_id:typeof a.id=="string"?a.id:null,ge=a=>{if(a==null||typeof a!="object")return null;const t=a,n=oa(t);if(n==null)return null;const c={task_id:n};return typeof t.parent_task_id=="string"&&(c.parent_task_id=t.parent_task_id),typeof t.sync_token=="string"&&(c.sync_token=t.sync_token),typeof t.is_deleted=="boolean"&&(c.is_deleted=t.is_deleted),typeof t.is_private=="boolean"&&(c.is_private=t.is_private),c},te=a=>{if(a==null||typeof a!="object")return null;const t=a;return j(t.task_ids)?{task_ids:t.task_ids}:null},_e=a=>{if(a==null||typeof a!="object")return null;const t=a;return typeof t.task_id!="string"?null:{task_id:t.task_id}},se=Ja.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: ${a=>a.theme.colors.grey4};
9
+ `,ne=ba((function(a,t){const n=na(a,t.isTaskTemplatesEnabled),{taskGroupId:c}=t,p=c!=null&&c!==""?{...n,taskGroupsWithTasksList:n.taskGroupsWithTasksList.map((e=>({...e,tasks:e.tasks.filter((s=>s.taskGroupIds.includes(c)))}))).filter((e=>e.tasks.length>0))}:n,y=La(a),f=M.isZeniUser(),v=a.taskDetailState?.subTaskCreateStatus?.fetchState;return{taskListView:p,tagListView:y,localData:p.localData,isTaskTemplatesEnabled:t.isTaskTemplatesEnabled,isZeniUser:f,subTaskCreateStatus:v}}),(function(a,t){const{navigate:n,currentTenant:c,location:p,isTaskTemplatesEnabled:y}=t,{tenantEmailDomain:f}=c,{groupByKey:v}=t.uiState;return{onTaskManagementRowClick:e=>{const s=sa(f,e),b=F(p.state?.pathnameStackToGoBack,p.pathname);n(s,{state:{pathnameStackToGoBack:b}})},onReloadTasks:()=>{a(Q(!0,y))},onTabChange:e=>{a(Ma(e))},onParentTaskClick:e=>{const s=sa(f,e);window.open(s,"_blank","noopener")},bulkUpdateTasks:(e,s)=>{a(ta(e,null,s))},onNewTaskClick:()=>{if(t.localData.defaultTaskGroupId!=null){const e=q(f,t.localData.defaultTaskGroupId),s=F(p.state?.pathnameStackToGoBack,p.pathname);n(e,{state:{pathnameStackToGoBack:s,message:"comingFromTaskListPage"}})}},onColumnSortConfigChanged:(e,s)=>{a(ea({uiState:{sortKey:e,sortOrder:s}}))},onFiltersChange:e=>{a(qa({filters:e}))},onSearchTextChanged:e=>{a(za({searchText:e}))},onReloadCards:()=>{a(Q(!0,y))},onBackClick:()=>{if(p.state?.message==="triggerBackClick"){const e=Ia(p.state?.pathnameStackToGoBack),s=e.poppedPathname??"../";n(s,{state:{pathnameStackToGoBack:e.newStack}})}else n("../")},updateLocalData:e=>{a(Na({localData:e}))},resetLocalData:()=>{a(ra({taskGroupById:t.taskGroupState.taskGroupById}))},handleCreateGroup:e=>{a($a(t.localData.newTaskGroupName,e))},assignGroupToTasks:e=>{a(ta(t.localData.selectedTaskIds,e,Oa(t.uiState.groupByKey,e)))},onDeleteTaskGroup:e=>{a(xa(e))},onAddNewTaskToTaskGroup:e=>{if(t.localData.defaultTaskGroupId!=null){const s=oe(v,e);a(X({taskDetailLocalData:s}));const b=q(f,t.uiState.groupByKey==="groupName"?e:t.localData.defaultTaskGroupId),x=F(p.state?.pathnameStackToGoBack,p.pathname);n(b,{state:{pathnameStackToGoBack:x,message:"comingFromTaskListPage"}})}},onDragNDrop:(e,s)=>{a(ja(t.localData.selectedTaskIds.length>0?t.localData.selectedTaskIds:[e],s))},onTaskGroupRename:(e,s)=>{a(Fa(e,s))},onTimeSpentUpdate:(e,s)=>{a(aa({task:e,updates:s}))},onShowToast:e=>{a(Pa(e))},onGroupByFilterChange:e=>{a(ea({uiState:{groupByKey:e}}))},updateTask:(e,s)=>{a(aa({task:e,updates:s}))},onCreateTagClick:(e,s)=>{a(Ua(e,s))},onSubtaskCreation:(e,s)=>{a(wa({...s,parentTaskId:e}))},handleGroupTemplateClick:e=>{a(Y(e,[]))},handleGroupTemplateTaskClick:(e,s)=>{a(Y(e,[s]))},handleNewTaskInitialization:e=>{if(a(X({taskDetailLocalData:{...Ka,name:e}})),t.localData.defaultTaskGroupId!=null){const s=q(f,t.localData.defaultTaskGroupId),b=F(p.state?.pathnameStackToGoBack,p.pathname);n(s,{state:{pathnameStackToGoBack:b,message:"comingFromTaskListPage"}})}},onTaskGroupNameClick:e=>{n(`/${f}/tasks/group/${e}`)},onQuickResponsesClick:()=>{n(`/${f}/tasks/quick-responses`)}}}))(Aa);function re(){const a=ma(),t=J(),n=Sa(),c=M.getSignedInUser(),p=M.isZeniUser(),y=H(),f=G((d=>Ba(d))),{taskGroupId:v}=ya(),{useFeatureGate:e}=Da(),{isFeatureEnabled:s}=e(I.isTaskTemplatesEnabled),{isFeatureEnabled:b}=e(I.isTaskCannedResponsesEnabled),{isFeatureEnabled:x}=e(I.isTaskCategorizationEnabled),{isFeatureEnabled:ia}=e(I.isTaskBulkResolutionEnabled),{isFeatureEnabled:la}=e(I.isTaskGroupAssigneesEnabled),{isFeatureEnabled:ua}=e(I.isTaskRecurringParentEnabled),[ca,da]=u.useState(!1),O=G((d=>na(d,s))),$=G((d=>d.taskGroupState)),B=O.fetchState,{isAiCfoAccessEnabled:ka,onAskAiCfoClick:pa}=Ha({mobileExploreReferrer:"Task Checklist"});Ea({isDataReady:B==="Completed"});const{markBoardFetchInFlight:Z,requestTaskRefetch:N}=(function(d){const m=J(),r=H(),T=u.useRef(!1),o=u.useRef(!1),k=u.useRef(!1),g=u.useRef(),l=u.useRef(),S=u.useRef(!1),L=u.useRef(),K=u.useCallback((()=>{L.current=r.getState().taskListState.byTab.live,S.current=!0}),[r]),w=u.useCallback((()=>{K(),m(Ra())}),[m,K]),D=u.useCallback((()=>{g.current=r.getState().taskGroupState.taskGroupById,k.current=!0,m(va())}),[m,r]),E=u.useCallback((()=>{T.current=!1,l.current!=null&&(clearTimeout(l.current),l.current=void 0),w(),k.current||r.getState().taskGroupViewState.fetchState==="In-Progress"?o.current=!0:D()}),[w,D,r]),z=u.useCallback((()=>{S.current?(T.current=!0,l.current==null&&(l.current=setTimeout((()=>{l.current=void 0,T.current&&r.getState().taskListState.fetchState!=="In-Progress"&&(S.current=!1,E())}),6e3))):E()}),[E,r]);u.useEffect((()=>{l.current!=null&&(clearTimeout(l.current),l.current=void 0),T.current=!1,o.current=!1,k.current=!1}),[d]);const h=G((i=>i.taskListState.fetchState)),C=G((i=>i.taskGroupViewState.fetchState)),U=G((i=>i.taskListState.byTab.live)),P=G((i=>i.taskGroupState.taskGroupById));return u.useEffect((()=>{h!=="In-Progress"&&(!S.current||U!==L.current||h==="Error")&&(S.current=!1,T.current&&(h!=="Completed"?h==="Error"&&(T.current=!1,l.current!=null&&(clearTimeout(l.current),l.current=void 0)):E()))}),[h,U,E]),u.useEffect((()=>{C!=="In-Progress"&&(!k.current||P!==g.current||C==="Error")&&(k.current=!1,o.current&&(o.current=!1,C!=="Error"&&D()))}),[C,P,D]),u.useEffect((()=>()=>{l.current!=null&&(clearTimeout(l.current),l.current=void 0)}),[]),{markBoardFetchInFlight:K,requestTaskRefetch:z}})(f?.tenantId);u.useEffect((()=>{y.getState().taskListState.hasValidState()||Z(),t(Q(!1,s))}),[f?.tenantId,t,s,Z,y]);const fa=u.useMemo((()=>{const d=[_.TASK_CREATED,_.TASK_UPDATED,_.TASKS_BULK_UPDATED,_.TASKS_BULK_DELETED],m=[_.TASK_CREATED,_.TASK_UPDATED,_.TASK_SNOOZE_RESURFACED,_.TASKS_BULK_UPDATED];return[...ae(f?.companyId,d),...ee(c?.userId,m)]}),[f?.companyId,c?.userId]);if(Ya({events:fa,onEvent:(d,m)=>{switch(d){case _.TASK_CREATED:case _.TASK_UPDATED:{const r=(T=>{if(T==null||typeof T!="object")return null;const o=T,k=oa(o);if(k==null||typeof o.tenant_id!="string"||typeof o.event_type!="string")return null;const g={task_id:k,tenant_id:o.tenant_id,event_type:o.event_type};return typeof o.is_private=="boolean"&&(g.is_private=o.is_private),j(o.assignees)&&(g.assignees=o.assignees),j(o.direct_assignees)&&(g.direct_assignees=o.direct_assignees),typeof o.created_by=="string"&&(g.created_by=o.created_by),j(o.task_group_ids)&&(g.task_group_ids=o.task_group_ids),typeof o.name=="string"&&(g.name=o.name),typeof o.parent_task_id=="string"&&(g.parent_task_id=o.parent_task_id),g})(m);if(r!=null){const T=y.getState(),o=r.task_id,k=o!=null?T.taskState.taskByID?.[o]:void 0,g=k!=null;if(!p)if(r.is_private===!0){if(!g)return}else{const l=c?.userId,S=new Set([...r.assignees??[],...r.direct_assignees??[]]);if(r.created_by!=null&&r.created_by!==""&&S.add(r.created_by),!(l!=null&&S.has(l))&&!g)return}if(d===_.TASK_UPDATED&&g&&k!=null&&Array.isArray(r.task_group_ids)){const l=new Set(Object.values(T.taskGroupState.taskGroupById??{}).filter((i=>i!=null&&!i.isDeleted)).map((i=>i.id))),S=(k.taskGroupIds??[]).filter((i=>l.has(i))),L=(r.task_group_ids??[]).filter((i=>l.has(i))),K=S.length===L.length&&S.every((i=>L.includes(i))),w=k.taskGroupIds??[],D=r.task_group_ids??[],E=w.length!==D.length||!w.every((i=>D.includes(i))),z=(i,Ta)=>{const V=i??[],W=Ta??[];if(V.length!==W.length)return!1;const ga=new Set(W);return V.every((_a=>ga.has(_a)))},h=r.name==null||r.name===k.name,C=r.is_private==null||r.is_private===k.isPrivate,U=r.assignees==null||z(r.assignees,k.assignees),P=r.direct_assignees==null;if(K&&E&&h&&C&&U&&P)return}}return void N()}case _.TASKS_BULK_DELETED:{const r=te(m);return r==null?void 0:void r.task_ids.forEach((T=>t(Wa(T))))}case _.TASKS_BULK_UPDATED:case _.TASK_SNOOZE_RESURFACED:return void N()}},onSubscribed:()=>{N()}}),u.useEffect((()=>{B==="Completed"&&t(ra({taskGroupById:$.taskGroupById}))}),[B,$.taskGroupById]),c==null)throw Error("Can't access task list page without signing in...");return A.jsxs(A.Fragment,{children:[B==="Completed"?A.jsx(ha,{analytics:Ga,onLoad:d=>(m=>m.trackPageLoaded(Ca.Event.taskListPage))(d)}):null,A.jsxs(se,{children:[A.jsx(Xa,{isAppContentDrawerOpen:ca,handleDrawerToggle:d=>{da(d)}}),A.jsx(ne,{location:n,navigate:a,currentTenant:f,taskGroupId:v,taskGroupState:$,localData:O.localData,uiState:O.uiState,isTaskTemplatesEnabled:s,taskListFetchState:B,isTaskCategorizationEnabled:x,isTaskCannedResponsesEnabled:b,isTaskBulkResolutionEnabled:ia,isTaskGroupAssigneesEnabled:la,isTaskRecurringParentEnabled:ua,isAiCfoAccessEnabled:ka,onAskAiCfoClick:pa})]})]})}const sa=(a,t)=>`/${a}/tasks/${encodeURIComponent(t)}`,q=(a,t)=>`/${a}/tasks/new/${t}`,oe=(a,t)=>{if(a==="assignee"){const n=t.split(",");return{...R.taskDetailLocalData,assignee:n}}if(a==="priority"){const n=Qa(t);return{...R.taskDetailLocalData,priority:n}}if(a==="status"){const n=Za(t);return{...R.taskDetailLocalData,status:n}}if(a==="tag"){const n=t.split(",");return{...R.taskDetailLocalData,tagIds:n}}if(a==="dueDate"){const n=Va(t);return{...R.taskDetailLocalData,dueDate:n}}return{...R.taskDetailLocalData}},me=Object.freeze(Object.defineProperty({__proto__:null,default:re},Symbol.toStringTag,{value:"Module"}));export{_ as T,ee as a,ae as b,_e as c,te as d,re as e,me as f,ge as t};
@@ -0,0 +1,9 @@
1
+ import{j as r}from"./liveblocks-DxRiM6VH.js";import Te from"./NotFoundScreen-QNLsV8PR.js";import{a as u}from"./sentry-B-dIf5xz.js";import{h as ee,u as ae,j as g,g as ge,i as he,N as Ee,l as be,n as De,o as h}from"./core--MkqccHv.js";import{QD as se,QG as Ie,QA as Ce,a35 as Re,fI as te,a36 as ne,R2 as b,QU as E,Qx as _e,Rx as Ge,Rq as ye,a37 as oe,gk as ie,a38 as W,a39 as Ae,Qt as Ue,Qq as ve,v6 as xe,uW as Be,mD as we,QS as je,a3a as Pe,RJ as Fe,QO as Le,Rc as Ke,R9 as Ne,QJ as $e,R6 as Qe,R1 as Oe}from"./zeni-epic-state-Dg1W8Zu5.js";import{z as D,e7 as Ze,c as qe,p as ze,d as _,a2 as re,l as G,a6 as Ve,k as H,O as Me,e8 as Je,W as X,ac as We}from"./index-B3QEycF9.js";import{n as He}from"./mui-kCJnrqYM.js";import{u as Xe}from"./useInitialThreadRequest-D8OFP51H.js";import{M as Ye}from"./MobileAppDrawer-DfwkluKE.js";import{T as m,t as ea,b as aa,a as sa,c as ta,d as Y,e as na}from"./TaskListScreen-Cvt-fENk.js";import{u as oa}from"./useTaskManagerPusherEvents-WPqjoQIF.js";import"./recharts-EjKi4hbc.js";import"./analytics-DQKmqYV4.js";import"./plaid-D94Y0H1P.js";import"./dnd-CP4whtxN.js";import"./stripe-cKAAJElX.js";import"./lottie-ixiiUTSF.js";import"./lexical-BSiUIp1H.js";import"./pdf-CRxQY5HT.js";import"./utils-BPWa_pEs.js";import"./InboxNotificationsProvider-dYyDAGLI.js";import"./useTaskManagerAccess-ULuU1uGf.js";import"./useAskAiCfoHostNavButtonProps-BZFKDw3z.js";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},a=new e.Error().stack;a&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[a]="5bf3a674-f5b3-4a54-9328-62589138bf7f",e._sentryDebugIdIdentifier="sentry-dbid-5bf3a674-f5b3-4a54-9328-62589138bf7f")}catch{}})();function ia(){const e=ee(),a=ae(),n=D.getSignedInUser(),{cannedResponses:c,fetchState:t,saveFetchState:l}=g((i=>i.cannedResponsesState)),d=u.useCallback((()=>{a(se())}),[a]),S=u.useCallback(((i,I,C)=>{a(Ie({name:i,content:I,cannedResponseId:C}))}),[a]),s=u.useCallback((i=>{a(Ce({cannedResponseId:i}))}),[a]);if(n==null)throw Error("Can't access quick responses page without signing in...");return r.jsx(Ze,{cannedResponses:c,isLoading:t==="In-Progress"||t==="Not-Started",isSaving:l==="In-Progress",onBackClick:()=>e(-1),onDelete:s,onFetch:d,onSave:S})}const K=e=>e?.taskState?.taskByID,F=(e,a)=>{const n=K(e);if(a!=null&&n!=null)return n[a]?.parentTaskId??void 0},ra=Re([F,(e,a)=>{const n=F(e,a),c=K(e);if(n!=null&&c!=null)return c[n]?.name},(e,a)=>{const n=F(e,a),c=K(e);return n!=null&&c!=null&&c[n]!=null}],((e,a,n)=>{if(e!=null&&n===!0)return{id:e,name:a??""}})),ca=be((function(e,a){const{location:n,taskGroupId:c}=a,t=oe(e,a.taskId),l=te(e),d=ra(e,a.taskId),S=t.taskGroupId??c,s=S!=null?W(e.taskGroupState,S):void 0,i=D.getSignedInUser(),I=l.tenantId,C={userId:i?.userId??"",sessionId:i?.zeniSessionId??"",tenantId:I??""},v=ne(e),{tenantEmailDomain:x}=l,y=t.recurringSourceTaskId,B=y!=null?`${X.appUrl}/${x}/tasks/${encodeURIComponent(y)}`:void 0;return{taskDetailSelectorView:t,authParams:C,isZeniUser:D.isZeniUser(),userGroupList:Ae(e),isNewClicked:n.state?.message==="comingFromTaskListPage",filesEndPoint:We.fileMicroServiceBaseUrl,companyName:a.currentTenant.companyName,companyId:a.currentTenant.companyId,currentUrl:`${X.appUrl}${a.location.pathname}`,cannedResponses:e.cannedResponsesState.cannedResponses,isCannedResponsesLoading:e.cannedResponsesState.fetchState==="In-Progress",recurringSourceTaskUrl:B,tagListView:v,taskGroupName:S!=null&&s!=null&&s.isDefault===!1?s.name:void 0,taskGroupList:e.taskGroupViewState.taskGroupsIds.map((f=>W(e.taskGroupState,f))).filter((f=>f!=null&&!f.isDeleted)).map((f=>({id:f.id,name:f.name,isDefault:f.isDefault}))),subtasks:t.subtasks,parentTaskRef:d,subTaskCreateStatus:e.taskDetailState?.subTaskCreateStatus?.fetchState}}),(function(e,a){const{taskId:n,navigate:c,currentTenant:t,location:l,taskGroupId:d}=a,{tenantEmailDomain:S}=t;return{onSaveChangesToLocalStore:s=>{e(Oe({taskDetailLocalData:s,taskId:n}))},onSaveDetailClick:s=>{e(Qe(n,s??d))},onArchiveTaskClick:()=>{a.taskId!=null&&e($e(a.taskId))},onSnoozeTask:(s,i)=>{e(Ne(s,i))},onUnsnoozeTask:s=>{e(Ke(s))},onCreateSubtask:(s,i)=>{e(Le({...i,parentTaskId:s}))},onSubtaskUpdate:(s,i)=>{e(Fe({task:s,updates:i}))},onShowToast:s=>{e(ie(s))},onSubtaskRowClick:s=>{c(`/${S}/tasks/${s}`,{state:{pathnameStackToGoBack:G(l.state?.pathnameStackToGoBack,l.pathname)}})},onParentBreadcrumbClick:s=>{c(`/${S}/tasks/${s}`,{state:{pathnameStackToGoBack:G(l.state?.pathnameStackToGoBack,l.pathname)}})},onDismissClick:()=>{if(l.state?.message==="triggerBackClick"){const s=re(l.state?.pathnameStackToGoBack),i=s.poppedPathname??"../../dashboard";c(i,{state:{pathnameStackToGoBack:s.newStack}})}else{const s=U(S),i=G(l.state?.pathnameStackToGoBack,l.pathname);c(s,{state:{pathnameStackToGoBack:i}})}e(Pe({taskId:n}))},onDeleteTaskClick:()=>{e(je(n))},updateFilesEntity:s=>{e(we({files:s}))},onDeleteFile:s=>{e(Be(s))},onEditFileName:(s,i)=>{e(xe(s,i.split(".")[0]))},onReloadTaskDetailPage:()=>{e(b(!1,n))},onCreateTagClick:s=>{e(ve(s,n))},onDeleteTagClick:s=>{e(Ue(s,n))},onFetchCannedResponses:()=>{e(se())},onManageTemplatesClick:()=>{c(`/${t.tenantEmailDomain}/tasks/quick-responses`)}}}))(Je);function L(){const e=ee(),a=ae(),n=ge(),c=qe(),{taskId:t,taskGroupId:l}=he(),d=g((o=>te(o))),S=Xe(d?.companyId),{useFeatureGate:s}=ze(),{isFeatureEnabled:i}=s(_.isTaskSnoozeEnabled),{isFeatureEnabled:I}=s(_.isTaskVisibilityEnabled),{isFeatureEnabled:C}=s(_.isTaskCannedResponsesEnabled),{isFeatureEnabled:v}=s(_.isTaskRecurringParentEnabled),{isFeatureEnabled:x}=s(_.isTaskGroupAssigneesEnabled),[y,B]=u.useState(!1),[f,ce]=u.useState(!1),[N,le]=u.useState(!1),[$,w]=u.useState(!1),R=u.useRef(!1),A=g((o=>o.taskListState.updateTasksFetchState.fetchState)),Q=g((o=>ne(o))),O=g((o=>o.taskGroupViewState.fetchState));u.useEffect((()=>{a(b(!1,t)),t!=null&&a(E(t))}),[a,t]);const Z=D.getSignedInUser()?.userId,de=D.isZeniUser(),ke=g((o=>t!=null?o.taskState.taskByID[t]?.syncToken:void 0)),q=()=>{d?.tenantEmailDomain!=null&&e(U(d.tenantEmailDomain))},z=()=>{a(ie({messageSection:"delete_task",messageText:"success",type:"success"})),q()},ue=u.useMemo((()=>{const o=[m.TASK_CREATED,m.TASK_UPDATED,m.TASKS_BULK_UPDATED,m.TASKS_BULK_DELETED],k=[...o,m.TASK_SNOOZE_RESURFACED];return[...aa(d?.companyId,o),...sa(Z,k)]}),[d?.companyId,Z]);oa({events:ue,onSubscribed:()=>{t!=null&&(a(b(!0,t)),a(E(t)))},onEvent:(o,k)=>{if(t!=null)switch(o){case m.TASK_CREATED:case m.TASK_UPDATED:{const p=((P,me,{isZeniUser:Se,storedSyncToken:fe,taskId:J})=>{if(P!==m.TASK_CREATED&&P!==m.TASK_UPDATED)return"none";const T=ea(me);return T==null?"none":T.parent_task_id===J?"refreshSubtasks":P!==m.TASK_UPDATED||T.task_id!==J?"none":T.is_deleted===!0?"leaveDeleted":T.is_private!==!0||Se?T.sync_token!=null&&T.sync_token===fe?"none":"refreshTask":"leaveNoAccess"})(o,k,{isZeniUser:de,storedSyncToken:ke,taskId:t});p==="refreshTask"?(a(b(!0,t)),a(E(t))):p==="refreshSubtasks"?a(E(t)):p==="leaveDeleted"?z():p==="leaveNoAccess"&&q();break}case m.TASKS_BULK_UPDATED:{const p=Y(k);if(p==null)break;p.task_ids.includes(t)&&a(b(!0,t)),a(E(t));break}case m.TASKS_BULK_DELETED:{const p=Y(k);if(p==null)break;if(p.task_ids.includes(t)){z();break}a(E(t));break}case m.TASK_SNOOZE_RESURFACED:{ta(k)?.task_id===t&&a(b(!0,t));break}}}}),u.useEffect((()=>{f||Q.fetchState==="Completed"||(ce(!0),a(_e()))}),[f,a,Q.fetchState]),u.useEffect((()=>{N||O==="Completed"||(le(!0),a(Ge()))}),[N,a,O]);const pe=u.useCallback((()=>{t!=null&&(R.current=!1,a(ye([t],null,{isArchived:!1})),w(!0))}),[a,t]);u.useEffect((()=>{if($)if(A!=="In-Progress"){if(R.current){if(A==="Error")return w(!1),void(R.current=!1);if(A==="Completed"){w(!1),R.current=!1;const{tenantEmailDomain:o}=d;if(n.state?.message==="triggerBackClick"){const k=re(n.state?.pathnameStackToGoBack);e(k.poppedPathname??"../../dashboard",{state:{pathnameStackToGoBack:k.newStack}})}else{const k=U(o);e(k,{state:{pathnameStackToGoBack:G(n.state?.pathnameStackToGoBack,n.pathname)}})}}}}else R.current=!0}),[$,A,d,n,e]);const V=g((o=>oe(o,t))),j=V.fetchState,M=D.getSignedInUser();if(M==null)throw Error("Can't access task detail page without signing in...");if(j==="Error"&&V.error?.code===400){const{tenantEmailDomain:o}=d,k=U(o),p=G(n.state?.pathnameStackToGoBack,n.pathname);return r.jsx(Ee,{to:k,state:{pathnameStackToGoBack:p}})}return r.jsxs(r.Fragment,{children:[j==="Completed"?r.jsx(Ve,{analytics:H,onLoad:o=>(k=>k.trackPageLoaded(Me.Event.taskDetailPage))(o)}):null,r.jsxs(la,{children:[r.jsx(Ye,{isAppContentDrawerOpen:y,handleDrawerToggle:o=>{B(o)}}),r.jsx(ca,{analytics:H,currentTenant:d,handleZeniLogoClick:()=>{c.toggle()},initialOpenThreadRequest:S,location:n,loggedInUser:M,navigate:e,taskGroupId:l,taskId:t,taskDetailFetchState:j,onUnarchiveTaskClick:pe,isTaskSnoozeEnabled:i,isTaskVisibilityEnabled:I,isTaskCannedResponsesEnabled:C,isTaskRecurringParentEnabled:v,isTaskGroupAssigneesEnabled:x})]})]})}const la=He.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
+ `,U=e=>`/${e}/tasks`;function Ba(){return r.jsxs(De,{children:[r.jsx(h,{path:"/new",element:r.jsx(L,{})}),r.jsx(h,{path:"/new/:taskGroupId",element:r.jsx(L,{})}),r.jsx(h,{path:"/group/:taskGroupId",element:r.jsx(na,{})}),r.jsx(h,{path:"/quick-responses",element:r.jsx(ia,{})}),r.jsx(h,{path:"/:taskId",element:r.jsx(L,{})}),r.jsx(h,{path:"*",element:r.jsx(Te,{})})]})}export{Ba as default};
@@ -0,0 +1 @@
1
+ import{j as c}from"./liveblocks-DxRiM6VH.js";import B from"./NotFoundScreen-QNLsV8PR.js";import{a as n}from"./sentry-B-dIf5xz.js";import{u as ft,h as yt,g as bt,i as St,j as o,n as ht,o as f}from"./core--MkqccHv.js";import{fI as It,gZ as Lt,m3 as Tt,ul as jt,XR as Ct,XG as Et,XS as gt,S2 as At,S3 as kt,i3 as L,m1 as vt,um as xt,RU as Dt,St as Rt,XT as _t,XU as Nt,R$ as Xt,RY as wt,XV as Ft,XW as Mt,XX as Ut}from"./zeni-epic-state-Dg1W8Zu5.js";import{p as zt,V as Ht,d as H,b0 as Pt,z as qt,g as Vt,b1 as Bt,k as P,b2 as Gt,ac as $t,G as Ot}from"./index-B3QEycF9.js";import"./mui-kCJnrqYM.js";import{d as Yt}from"./decodeURIComponentSafe-BEyzjo_o.js";import{u as Zt}from"./useEnsureVendorListLoaded-IzkQpfDE.js";import{u as Wt,T}from"./TransactionDetailScreen-Ch0LCj8G.js";import{c as Jt}from"./routePaths-33YxbFc-.js";import"./recharts-EjKi4hbc.js";import"./analytics-DQKmqYV4.js";import"./plaid-D94Y0H1P.js";import"./dnd-CP4whtxN.js";import"./stripe-cKAAJElX.js";import"./lottie-ixiiUTSF.js";import"./lexical-BSiUIp1H.js";import"./pdf-CRxQY5HT.js";import"./utils-BPWa_pEs.js";import"./useAskAiCfoHostNavButtonProps-BZFKDw3z.js";import"./useInitialThreadRequest-D8OFP51H.js";import"./expenseAutomationHelper-Dgshk1zd.js";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},d=new e.Error().stack;d&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[d]="0a6f0b63-baee-4af4-bf81-4c4d9ad766a4",e._sentryDebugIdIdentifier="sentry-dbid-0a6f0b63-baee-4af4-bf81-4c4d9ad766a4")}catch{}})();const Kt=["bank","credit_card","other_current_assets"],q=e=>`/${e}/month_end_close_checks/review/transaction_categorization`,{common:{currency:V}}=Ot.getLocalizedStrings();function Qt(){const e=ft(),d=yt(),m=bt(),{tenantEmailDomain:u,transactionTypeEncoded:G}=St(),{useFeatureGate:j}=zt(),$=Ht(),{isFeatureEnabled:O}=j(H.isCreateTransactionEnabled),{isFeatureEnabled:C}=j(H.isProjectsTransactionsEnabled),Y=Yt(G??""),a=Ut.find((t=>t===Y)),S=o((t=>It(t))),E=Pt(S.companyId,a),g=o((t=>Lt(t.companyState,S.companyId)?.company.companyLocaleInfo)),Z=g?.currencyCode??V.currencyCode,W=g?.currencySymbol??V.currencySymbol,A=o((t=>t.tenantState.currentTenantId)),k=qt.getSignedInUser(),v=k?.userId??"",x=k?.zeniSessionId??"",J=n.useMemo((()=>({userId:v,sessionId:x,tenantId:A??""})),[v,x,A]),K=o((t=>Tt(t))),D=o((t=>jt(t))),R=D&&C===!0,h=o((t=>t.projectListState)),_=o((t=>t.projectState)),Q=n.useMemo((()=>Ct(_,h).projects),[_,h]),I=o((t=>Et(t,"common"))),N=o((t=>t.accountListState.byReportId.accountList.fetchState)),X=o((t=>t.accountListState.byReportId.createTransactionLineAccountList.fetchState)),w=o((t=>t.accountListState.byReportId.createTransactionPaymentAccountList.fetchState)),F=o((t=>t.classListState.fetchState)),s=o((t=>a!=null?gt(t,a):void 0));n.useEffect((()=>{if(a!=null)return e(At(a)),()=>{e(kt(a))}}),[e,a]);const tt=Vt(),et=o((t=>{const{activeTenantFetchState:i,currentTenantId:b,fetchState:mt,tenantsById:pt}=t.tenantState;return b!=null&&pt[b]!=null&&(i.fetchState==="Completed"||mt==="Completed")})),r=tt&&et;n.useEffect((()=>{r&&a==="transfer"&&N==="Not-Started"&&e(L("accountList"))}),[e,r,a,N]),n.useEffect((()=>{r&&X==="Not-Started"&&e(L("createTransactionLineAccountList"))}),[e,r,X]),n.useEffect((()=>{r&&w==="Not-Started"&&e(L("createTransactionPaymentAccountList",!1,!1,!1,!1,Kt))}),[e,r,w]),n.useEffect((()=>{r&&F==="Not-Started"&&e(vt())}),[e,r,F]);const M=h.fetchState;n.useEffect((()=>{r&&R&&M==="Not-Started"&&e(xt())}),[e,r,R,M]),Zt(r),Wt(r&&a==="transfer",!1);const at=n.useCallback(((t,i=[])=>{if(i.length>0&&e(Dt(i)),u==null)return;const b=Bt(m.state)??[q(u)];d(Jt(t,u),{replace:!0,state:{pathnameStackToGoBack:b}})}),[e,u,d,m.state]),nt=n.useCallback((()=>{m.key==="default"?u!=null&&d(q(u)):d(-1)}),[m.key,d,u]),ot=n.useCallback((t=>{e(Rt(t))}),[e]),U=n.useRef(void 0),p=s?.createStatus.error;n.useEffect((()=>{if(a==null||p==null)return;const t=`${p.code??""}-${p.message??""}`;U.current!==t&&(U.current=t,P.trackCreateTransactionFailed({transactionType:a,errorCode:p.code}))}),[p,a]);const y=n.useCallback((t=>t),[]),l=n.useMemo((()=>(s?.vendorList??[]).filter((t=>!t.isDeleted)).sort(((t,i)=>t.name.localeCompare(i.name)))),[s?.vendorList]),z=s?.localData.vendorId,st=n.useMemo((()=>{const t=l.find((i=>i.id===z));if(t!=null)return t.qboId!==""&&t.qboId!==t.name?t.qboId:t.name}),[l,z]),ct=o((t=>_t(t,st))),rt=n.useMemo((()=>y(l.map((t=>({id:t.id,label:t.name}))))),[l,y]),it=n.useMemo((()=>({...I,vendor:[...l.map((t=>({id:t.id,name:t.name,qboId:t.qboId,type:"vendor",zeniId:t.id}))),...I.vendor]})),[I,l]),dt=n.useMemo((()=>y((s?.transferAccountsList??[]).map((t=>({id:t.accountId,label:t.accountName}))))),[s?.transferAccountsList,y]),ut=n.useCallback((t=>{a!=null&&e(Nt(a,t))}),[e,a]),lt=n.useCallback(((t,i)=>{a!=null&&e(Xt(a,i,t))}),[e,a]);return E==null?null:a!=null&&s!=null&&O===!0&&E&&$?.connectionName!=="netsuite"?c.jsx(Gt,{analytics:P,attachmentUploadEndpoint:$t.accountMicroServiceBaseUrl,authParams:J,createdTransactionId:s.createdTransactionId,transactionType:a,localData:s.localData,createStatus:s.createStatus,accountsHierarchyList:s.accountListNestedAccountHierarchy,paymentAccountsHierarchyList:s.paymentAccountListNestedAccountHierarchy,classHierarchyList:s.classListNestedAccountHierarchy,vendorOptions:rt,transferAccountOptions:dt,isAccountingClassesEnabled:K,isAccountingProjectsEnabled:D,isProjectsTransactionsEnabled:C===!0,projects:Q,currencyCode:Z,currencySymbol:W,bookCloseDate:S.bookCloseDate?.toDate(),entityAutoCompleteView:it,vendorRecommendationFetchState:ct.fetchState,onUpdateLocalData:ut,onAddLine:()=>e(Mt(a)),onRemoveLine:t=>e(Ft(a,t)),onSubmit:()=>e(wt(a)),onCancel:nt,onCreateTransactionComplete:at,onUploadAttachmentAttachment:ot,onFetchRecommendationsForVendor:lt}):c.jsx(B,{})}function Ce(){return c.jsxs(ht,{children:[c.jsx(f,{path:"/new/:transactionTypeEncoded",element:c.jsx(Qt,{})}),c.jsx(f,{path:"/:transactionTypeEncoded/:transactionId",element:c.jsx(T,{})}),c.jsx(f,{path:"/:transactionTypeEncoded/:transactionId/page-not-found",element:c.jsx(B,{})}),c.jsx(f,{path:"/:transactionTypeEncoded/:transactionId/vendor/create",element:c.jsx(T,{})}),c.jsx(f,{path:"/*",element:c.jsx(T,{})})]})}export{Ce as default};
@@ -0,0 +1,5 @@
1
+ import{j as _}from"./liveblocks-DxRiM6VH.js";import{a as i}from"./sentry-B-dIf5xz.js";import{u as j,k as ot,j as g,s as ge,g as Ee,h as Ce,i as Ae,N as st,l as ct}from"./core--MkqccHv.js";import{pD as Ie,fI as Q,gZ as it,Vv as rt,oJ as lt,of as dt,E4 as se,XY as ut,gk as mt,bn as pt,dh as _e,bq as Re,t1 as q,WD as W,XZ as we,X_ as le,X1 as Pe,me as Fe,X$ as Ue,X6 as de,X7 as ue,n3 as xe,S$ as me,XH as M,m8 as Le,m6 as Ve,mi as ft,pq as ht,Y0 as St,Y1 as yt,DX as J,md as Be,Sk as Oe,co as Tt,dn as bt,Y2 as gt,XG as It,Y3 as vt,Y4 as kt,Y5 as Dt,Y6 as Et,DT as Ct,Y7 as At,Y8 as _t,Y9 as Rt,Ya as wt,Yb as Pt,mh as Ft,Yc as Ut,Yd as xt,XI as Lt,Ye as Vt,Yf as Bt,Yg as Ot,Se as Nt,S4 as zt,St as Yt,mj as jt,T0 as ve,pv as Gt}from"./zeni-epic-state-Dg1W8Zu5.js";import{p as H,d as w,k as $,b3 as Mt,z as Ne,$ as $t,b4 as Xt,a9 as qt,a2 as ce,V as Wt,b5 as Ht,l as ie,aq as Zt,b6 as Jt,b7 as Kt,b8 as Qt,ac as en,at as oe}from"./index-B3QEycF9.js";import{n as tn,S as nn,u as an,D as on}from"./mui-kCJnrqYM.js";import{u as sn}from"./useAskAiCfoHostNavButtonProps-BZFKDw3z.js";import{d as ze}from"./decodeURIComponentSafe-BEyzjo_o.js";import{u as cn}from"./useInitialThreadRequest-D8OFP51H.js";import{h as Ye,c as je,g as rn,e as ln}from"./routePaths-33YxbFc-.js";import{u as dn}from"./expenseAutomationHelper-Dgshk1zd.js";import{A as un}from"./utils-BPWa_pEs.js";(function(){try{var t=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},e=new t.Error().stack;e&&(t._sentryDebugIds=t._sentryDebugIds||{},t._sentryDebugIds[e]="81f53c77-3f50-4a4b-92fe-3354b8237aab",t._sentryDebugIdIdentifier="sentry-dbid-81f53c77-3f50-4a4b-92fe-3354b8237aab")}catch{}})();function mn(t=!0,e=!0){const o=j(),n=ot(),{useFeatureGate:a}=H(),{isFeatureEnabled:s}=a(w.isCreateTransferEntryFromExpenseEnabled);i.useEffect((()=>{if(!t||e&&s!==!0)return;const c=d=>{const h=n.getState().createTransferEntryState.transferAccountsByType[d].fetchState;return h!=="In-Progress"&&h!=="Completed"};c("transferEntryEligible")&&o(Ie({kind:"transferEntryEligible"})),c("creditCardOnlyEligible")&&o(Ie({kind:"creditCardOnlyEligible"}))}),[t,e,s,o,n])}function pn(t,e){const o=(function(){const d=j(),[h,S]=i.useState(!1),[E,p]=i.useState(null),[l,u]=i.useState(null),{useDynamicConfig:y}=H(),{configValue:v,isDynamicConfigLoading:f}=y("transaction_categorization_config"),T=!f&&v?.capitalization_enabled===!0,D=g((I=>Q(I))),C=D.companyId,P=g((I=>it(I.companyState,D.companyId)?.company.companyLocaleInfo?.currencySymbol??"$")),{capitalizableAccounts:A,capitalizableAccountOverrides:F,dismissedAccounts:U}=g((I=>{const b=I.tenantState.currentTenantId,R=b!=null?I.tenantState.tenantsById[b]:void 0;return{capitalizableAccounts:R?.capitalizableAccounts??null,capitalizableAccountOverrides:R?.capitalizableAccountOverrides??null,dismissedAccounts:R?.capitalizationOnboardingDismissedAccounts??null}}),ge),V=i.useRef(A);V.current=A;const x=i.useRef(F);x.current=F;const B=i.useRef(U);B.current=U;const O=g((I=>rt(I.accountState)),ge),G=i.useMemo((()=>{const I={};for(const b of O)b.accountId!=null&&b.accountName!=null&&(I[b.accountId]=b.accountName);return I}),[O]),X=l!=null?G[l]??null:null,N=i.useCallback((I=>{if(!T)return;const b=V.current;if(b==null)return;const R=b.accounts??[],Z=new Set(I),ee=x.current??{},te=B.current;for(const z of R)if(Z.has(z.accountId)&&ee[z.accountId]==null&&te?.[z.accountId]==null)return p(z.classificationType),u(z.accountId),void S(!0)}),[T]),k=i.useCallback(((I,b)=>{d(lt(C,I,b,!0)),S(!1),p(null),u(null)}),[d,C]),r=i.useCallback((()=>{l!=null&&(d(dt(C,l)),S(!1),p(null),u(null))}),[d,C,l]);return{showPopup:h&&T,popupType:E,popupAccountId:l,popupAccountName:X,currencySymbol:P,checkAndShowPopup:N,handleSubmit:k,handleDismiss:r}})(),n=i.useRef(void 0),a=i.useRef([]),s=i.useRef(o.checkAndShowPopup);s.current=o.checkAndShowPopup;const c=i.useRef(e);return c.current=e,i.useEffect((()=>{t==="In-Progress"&&(a.current=c.current()),t==="Completed"&&n.current==="In-Progress"&&a.current.length>0&&(s.current(a.current),a.current=[]),n.current=t}),[t]),o}const Y=new Map,ke=(t,e,o)=>`${t}|${e??""}|${o}`,K=(t,e)=>{const[o,n]=t.shownRecommendations;return{recommendationFor:t.dimension,recommendation:o?.name??"",recommendationSource:o?.engine??null,recommendationConfidencePercentage:o?.confidencePercentage??null,alternativeRecommendation:n?.name??null,alternativeRecommendationSource:n?.engine??null,alternativeRecommendationConfidencePercentage:n?.confidencePercentage??null,selectedValue:t.selected.name,numberOfRecommendations:t.shownRecommendations.length,transactionId:e,lineId:t.lineId??null}},re=(t,e,o)=>({transactionId:e,lineId:t.lineId,dimension:t.dimension,outcome:t.outcome,selected:{name:t.selected.name,id:t.selected.id},matchedSource:t.matchedSource,matchedRank:t.matchedRank,topPickSource:t.topPickSource,shownRecommendations:t.shownRecommendations.map((n=>({source:n.source,rank:n.rank,value:{name:n.name,id:n.id},confidence:n.confidencePercentage!=null?n.confidencePercentage/100:void 0}))),...o}),Ge=(t,e,o)=>{$.trackRecommendationFeedbackRetracted(K(e,o)),t(se(re(e,o,{outcome:"retracted"})))},Vn=(t,e)=>{const o=new Set(e.map(String));Y.forEach(((n,a)=>{o.has(n.transactionId)&&(Y.delete(a),Ge(t,n.feedback,n.transactionId))}))},Bn=t=>{const e=new Set(t.map(String));Y.forEach(((o,n)=>{e.has(o.transactionId)&&Y.delete(n)}))};function fn(t){const e=j(),[o,n]=i.useState(null),[a,s]=i.useState(!1),{fetchState:c}=g(ut),{isEnabled:d,fallbackTransactionId:h}=t,S=i.useCallback((u=>u.transactionId??h??""),[h]),E=i.useCallback((u=>{if(!d)return;const y=S(u);if(y==="")return;if(u.outcome!=="accepted")return void n(u);((f,T,D,C)=>{const P=ke(T,D,C),A=Y.get(P);return A!=null&&(Y.delete(P),Ge(f,A.feedback,A.transactionId),!0)})(e,y,u.lineId,u.dimension)||(((f,T)=>{$.trackRecommendationAccepted(K(f,T))})(u,y),e(se(re(u,y,{}))))}),[d,S,e]),p=i.useCallback((u=>{if(o==null)return;const y=S(o);((v,f,T)=>{$.trackRecommendationFeedbackSubmitted({...K(v,f),feedbackReason:T})})(o,y,u),e(se(re(o,y,{reasonText:u,skipped:!1}))),((v,f)=>{Y.set(ke(f,v.lineId,v.dimension),{feedback:v,transactionId:f})})(o,y),s(!0)}),[o,S,e]),l=i.useCallback((()=>{var u,y;o!=null&&(u=o,y=S(o),$.trackRecommendationFeedbackSkipped(K(u,y)),s(!1),n(null))}),[o,S]);return i.useEffect((()=>{if(!a||c!=="Completed"&&c!=="Error")return;s(!1),n(null);const u=c==="Completed";e(mt({messageSection:"recommendation_feedback",messageText:u?"success":"failed",type:u?"success":"error",showStatusIcon:!0}))}),[a,c,e]),{onRecommendationSelection:E,popup:o!=null?_.jsx(Mt,{feedback:o,submitState:a?c:"Not-Started",onSubmit:p,onSkip:l}):null}}const pe=()=>{const t=Ne.getSignedInUser(),{useFeatureGate:e}=H(),{isFeatureEnabled:o}=e(w.isChainOfThoughtEnabled);return i.useMemo((()=>pt(t)&&o),[t,o])};function Me(t){if(t!=null){if("customer"in t&&t.customer!=null){const{customer:e}=t;return{id:e.id,name:e.name,logo:e.logo,type:"customer",zeniId:e.id,qboId:e.id}}if("vendor"in t&&t.vendor!=null){const{vendor:e}=t;return{id:e.id,name:e.name,logo:e.logo,type:"vendor",zeniId:e.id,qboId:e.id}}}}function On(t,e){const o=j(),{useFeatureGate:n}=H(),a=g((r=>Q(r))),s=a.userRole.includes("charge_card_user")||a.userRole.includes("charge_card_admin"),c=a.userRole!=null&&_e(a.userRole),d=a.userRole!=null&&Re(a.userRole),{isFeatureEnabled:h}=n(w.isVendorBulkUpdateOnTransactionEnabled),{isFeatureEnabled:S}=n(w.isExpenseAutomationEnabled),E=pe(),p=i.useMemo((()=>({id:t,type:q(e)})),[t,e]),l=g((r=>W(r,p))),u=l?.transactionDetailUpdateStatus?.fetchState,y=l?.transactionDetailLocalData?.lineItemById,v=g((r=>{const I=W(r,p)?.transactionDetailLocalData.vendorUpdates?.id;return I==null?"Not-Started":r.transactionVendorViewState.editVendorStateById[I]?.saveStatus.fetchState??"Not-Started"})),f=i.useMemo((()=>l?.fetchState==="Completed"?Me(l?.transaction):void 0),[l?.fetchState,l?.transaction]),T=g((r=>{if(f!=null)return we(r.customerIncomeState,r.vendorExpenseState,r.trendState,f,"month")})),D=g((r=>le(r))),C=g((r=>{if(f!=null)return Pe(r.trendWithTransactionsState,f,"TransactionDetail")})),P=a.company?.companyInfo.firstMonthOfFY??1,A=g((r=>Fe(r.accountState,r.accountListState,"accountList"))),[F,U]=i.useState(!1),[V,x]=i.useState(!1),[B,O]=i.useState(!1);i.useEffect((()=>{U(!1),x(!1),O(!1)}),[t,e]);const G=i.useCallback((()=>{U(!1),x(!1)}),[]),[X,N]=i.useState(!1),k=C?.selectedPeriod?.timePeriod;return i.useEffect((()=>{B||l==null||l.transaction==null||(o(Ue({id:l.transaction.id,type:l.transaction.type})),O(!0)),f!=null&&(!s||c&&d===!1)&&(F?V||T==null||(x(!0),o(me(f,"TransactionDetail",{timeframe:"month",timePeriod:k??T}))):(o(de()),o(ue()),U(!0),o(xe(f))))}),[o,B,l?.fetchState,l?.transaction,f,s,c,d,F,V,T,k]),i.useEffect((()=>{D.newVendorState?.vendorDetailLocalData?.vendorName!=null?N(!0):N(!1)}),[D.newVendorState?.vendorDetailLocalData?.vendorName]),i.useEffect((()=>()=>{o(M("common"))}),[o]),{currentTenant:a,loggedInUserHasCardUserOrAdminRole:s,isUserHasDashboardAccess:c,isUserHasInvestorOrBankerAccess:d,isVendorBulkUpdateOnTransactionEnabled:h,isExpenseAutomationEnabled:S,isChainOfThoughtEnabled:E,selectedTransaction:p,transactionDetail:l,rawDetailSaveStatus:u,rawDetailLineItemById:y,vendorSaveStatus:v,tranEntity:f,defaultTrendTransactionTimePeriod:T,vendorViewDetails:D,uiState:C,firstMonthOfFY:P,uncategorizedAccounts:A,resetTrendIsFetchedStates:G,isCreateVendorDrawerOpen:X,setIsCreateVendorDrawerOpen:N}}const hn={overlayWidth:new qt(100,100,58)},Sn=({isOpen:t,onSaveVendor:e,onSaveSuccess:o,onCancel:n,vendorViewDetails:a})=>{const s=an(),c=$t(),d=j(),h=g((p=>le(p))),S=()=>{n()},E={vendorDetailView:a??h,onSaveSuccess:()=>{d(Ve()),d(ft("Not-Started")),o()},onSaveVendor:e,onCancelClick:S,saveVendorDetailLocalData:p=>{d(Le({vendorId:void 0,localData:p}))}};return _.jsx(on,{anchor:"right",open:t,PaperProps:{style:{width:hn.overlayWidth.valuePercentage(c),boxShadow:"none"}},slotProps:{backdrop:{style:{backgroundColor:s.colors.black,opacity:.4,cursor:"pointer"}}},onClose:S,children:_.jsx(yn,{onClick:p=>p.stopPropagation(),children:_.jsx(Xt,{...E})})})},yn=tn(nn)`
2
+ display: flex;
3
+ min-height: 100%;
4
+ flex-direction: column;
5
+ `;function Tn(t,e){t(ht({transactionId:e.transactionId,creditAccountIntegrationId:e.creditAccountIntegrationId,debitAccountIntegrationId:e.debitAccountIntegrationId,memo:e.memo,transactionType:q(e.transactionType),sourceTransactionType:q(e.sourceTransactionType)}))}function bn({currentTransactionId:t,enabled:e=!0,buildPath:o,beforeNavigate:n,navigate:a,navigateState:s}){const c=g((h=>h.createTransferEntryState.lastTransferEntryReplacement)),d=i.useRef(null);i.useEffect((()=>{if(!e||c==null||t==null||d.current===c)return;const{previousTransactionId:h,newTransactionId:S}=c;t.id===h.id&&t.type===h.type&&(d.current=c,n?.(),a(o(S),{replace:!0,state:s}))}),[e,c,t,o,n,a,s])}const gn=({closeDrawerHandler:t,overrideTransactionId:e,overrideTransactionType:o})=>{const n=Ee(),a=Ce(),s=j(),c=pe(),{transactionTypeEncoded:d,transactionId:h}=Ae(),S=e??h,E=o??ze(d??"");let p;Ye(S,E)&&(p={id:S,type:q(E)});const l=p!=null?g((y=>W(y,p))):void 0,u=()=>{const y=ce(n.state?.pathnameStackToGoBack),v=y.poppedPathname??((f=2)=>{let T="../";for(let D=0;D<f;D++)T=`${T}../`;return T})(1);a(v,{state:{pathnameStackToGoBack:y.newStack}})};return{transactionId:p,onSaveVendor:()=>{s(Be(p,void 0))},onSaveSuccess:()=>{if(l!=null&&l?.transaction&&l?.transactionDetailLocalData.vendorUpdates?.qboId!=null&&l?.transactionDetailLocalData.vendorUpdates?.id!=null){const y=l?.transactionDetailLocalData.vendorUpdates,v={id:l?.transactionDetailLocalData.vendorUpdates?.qboId,zeniId:l?.transactionDetailLocalData.vendorUpdates?.id,type:"vendor",name:y?.name,qboId:l?.transactionDetailLocalData.vendorUpdates?.qboId??""},f={transactionId:{id:l?.transaction?.id,type:l?.transaction?.type},transaction:l?.transaction,lineIds:l?.transaction?.lines?.map((T=>T.id))??[]};s(J({entity:v,amount:l?.transaction?.amount.amount,transactionDetails:f,flowType:"detail",isFetchCOT:c}))}u()},onCancel:()=>{p!=null&&s(St({transactionId:p})),s(Ve()),s(yt()),t(!0),u()}}},In=ct((function(t,e){const o=W(t,e.selectedTransaction);let n;o==null&&console.warn("Check if the you've selected the transaction before getting the details");const a=Ne.getSignedInUser(),s=t.tenantState.currentTenantId,c={userId:a?.userId??"",sessionId:a?.zeniSessionId??"",tenantId:s??""};o!=null&&o.fetchState==="Completed"&&o.transaction!=null&&e.entity!=null&&(n=gt(t,e.entity,"TransactionDetail"));const d=t.entityAutoCompleteState.autoCompleteText.common,h=It(t,"common"),S=Q(t);return{transactionDetail:o,transactionAttachmentEndpointToDownload:`${oe}/transaction_attachment`,transactionAttachmentsEndpointToFetch:S.externalConnections?.accounting[0]?.connectionName==="netsuite"?`${oe}/transaction_attachments_accounting_provider`:`${oe}/transaction_attachments`,attachmentUploadEndpoint:`${en.accountMicroServiceBaseUrl}`,isCOTEnabled:e.isCOTEnabled,authParams:c,trendReport:n,analytics:$,uncategorizedAccounts:e.uncategorizedAccounts,autoCompleteData:{autoCompleteText:d,entityAutoCompleteView:h},isVendorBulkUpdateOnTransactionEnabled:e.isVendorBulkUpdateOnTransactionEnabled,isExpenseAutomationEnabled:e.isExpenseAutomationEnabled,enableBackClickOnSave:e.location.state?.message?.startsWith("comingFromScheduleDetails"),isTransactionSplitEditMode:o?.transactionDetailLocalData?.editMode??!1}}),(function(t,e){const{isCOTEnabled:o}=e;return{onBackClick:()=>{if(t(M("common")),e.onBackClick!=null)return void e.onBackClick();const n=ce(e.location.state?.pathnameStackToGoBack),a=n.poppedPathname??$e(2);e.navigate(a,{state:{pathnameStackToGoBack:n.newStack,message:"comingFromTransactionDetail"}})},discardTransactionDetailLocalData:(n,a)=>{e.transaction!=null&&t(Gt({transactionId:{id:e.transaction.id,type:e.transaction.type},vendorId:n,customerId:a}))},onTransactionClick:n=>{e.resetTrendIsFetchedStates(),t(de()),t(ue());const a=ie(e.location.state?.pathnameStackToGoBack,e.location.pathname);e.navigate(je(n,e.tenantEmailDomain),{state:{pathnameStackToGoBack:a}})},onTrendSelectedPeriodChange:n=>{if(n==null)e.defaultTrendTransactionTimePeriod!=null&&t(ve(e.entity,"TransactionDetail",{timeframe:"month",timePeriod:e.defaultTrendTransactionTimePeriod}));else{const a=n.currentTimePeriod==null?n.addTimePeriod:{startDate:n.addTimePeriod.startDate,endDate:n.currentTimePeriod.endDate};t(me(e.entity,"TransactionDetail",{timeframe:n.timeframe,timePeriod:n.addTimePeriod})),t(ve(e.entity,"TransactionDetail",{timeframe:n.timeframe,timePeriod:a}))}},onSaveUpdates:(n,a,s,c)=>{t(c===!0&&s!=null?Be(n,s,!0,e.isExpenseAutomationEnabled):jt({transactionId:n,isExpenseAutomationEnabled:e.isExpenseAutomationEnabled,cotTransactionTracking:a})),t(M("common"))},onUploadAttachmentAttachment:n=>{t(Yt(n))},onDeleteAttachment:n=>{e.transaction!=null&&t(zt(n,{id:e.transaction.id,type:e.transaction.type}))},onSaveTransactionDetailLocalData:(n,a)=>{t(Nt({transactionId:n,transactionLocalData:a}))},onUpdateAllChecked:(n,a,s,c)=>{e.transaction!=null&&t(Ot(e.selectedTransaction,e.transaction,n,a,s,c))},onResetLineItemsCategoryClassInLocalData:(n,a,s,c,d,h)=>{t(Bt(n,a,s,c,d,h))},onChangeCategoryClassWhenUpdateAllIsChecked:(n,a)=>{e.transaction!=null&&t(Vt({id:e.transaction.id,type:e.transaction.type},e.transaction,n,a))},onSaveSuccess:()=>{const n=ce(e.location.state?.pathnameStackToGoBack);if(n.poppedPathname!=null){const a=un(n.poppedPathname,"/").split("/"),s=a[a.length-1];if(["uncategorized-income","uncategorized-expense","missing-receipts"].includes(s)&&e.navigate(n.poppedPathname,{state:{pathnameStackToGoBack:n.newStack}}),e.location.state?.message==="comingFromScheduleDetails"){const c=`${rn(e.tenantEmailDomain)}`;e.navigate(c)}else if(e.location.state?.message==="comingFromScheduleDetailsFixedAssets"){const c=`${ln(e.tenantEmailDomain)}`;e.navigate(c)}}},onPageRefresh:()=>{t(Oe(e.selectedTransaction,!0))},autoCompleteActions:{onAutoCompleteInputChange:(n,a)=>{n.trim().length>=2?t(Lt({searchString:n,entityType:a,searchOrigin:"common"})):n.trim().length===0&&t(M("common"))},onCancelAutoComplete:()=>{t(M("common"))}},onFetchRecommendationsForEntity:(n,a,s,c)=>{t(J({entity:n,amount:a,transactionDetails:s,flowType:"detail",isBulkFetch:c,isFetchCOT:o}))},clearRecommendationForLineId:n=>{const{transactionId:a,transaction:s,lineId:c}=n;t(xt(a,s,c))},resetUpdateErrorState:()=>{const n={id:e.selectedTransaction.id,type:e.selectedTransaction.type};t(Ut(n))},onSaveVendorInLocalData:(n,a,s,c,d)=>{if(t(Ft({transactionId:n,vendorUpdates:a,entity:s})),a.id!=null&&s!=null&&c!=null&&d!=null&&t(J({entity:s,amount:c,transactionDetails:d,flowType:"detail",isFetchCOT:o})),t(Le({vendorId:a.id?a.id:void 0,localData:{vendorName:a.name,vendorId:a.id?a.id:void 0}})),!a.id&&e.transaction!=null){const h=e.transaction,S=ie(e.location.state?.pathnameStackToGoBack,e.location.pathname);e.navigate(`/${e.tenantEmailDomain}/transaction/${encodeURIComponent(h.type??"")}/${h.id}/vendor/create`,{state:{pathnameStackToGoBack:S}})}},onSaveCustomerInLocalData:(n,a,s,c,d)=>{t(Pt({transactionId:n,customerUpdates:a,entity:s})),a.id!=null&&s!=null&&c!=null&&d!=null&&t(J({entity:s,amount:c,transactionDetails:d,flowType:"detail",isFetchCOT:o}))},onUpdateAllTranactionsWithCurrentVendorChecked:n=>{t(wt({transactionId:{id:e.selectedTransaction.id,type:e.selectedTransaction.type},isUpdateEnabled:n}))},onClickUpdateVendorToAllLineItems:(n,a,s)=>{t(Rt(n,a,s))},onResetVendorToAllLineItems:(n,a,s)=>{t(_t(n,a,s))},saveLatestSelectedEntity:(n,a,s)=>{t(At({transactionId:n,lineId:a,entity:s}))},updateVendorBulkRecommendationsFetchStatus:(n,a)=>{t(Ct(n,a))},setIsVendorUpdateAllChecked:(n,a,s)=>{t(Et(n,a,s))},onCreateTransferEntry:e.isCreateTransferEntryFromExpenseEnabled===!0?n=>Tn(t,n):void 0,onLineAdd:()=>{if(e.transaction==null)return;const n={id:e.transaction.id,type:e.transaction.type},a=e.transaction.type==="journal_entry",s=e.transaction.amount?.currencyCode??"",c=e.transaction.amount?.currencySymbol??"",d=a?{amount:{amount:0,currencyCode:s,currencySymbol:c},id:crypto.randomUUID(),isCategoryMiscategorized:!1,isClassMiscategorized:!1,lineDescription:"",platformLineDetailType:"journal_entry_line_detail",type:"journal_entry_transaction_line",postingType:void 0,postingTypeName:"",lineTransactionType:"journal_entry"}:{amount:{amount:0,currencyCode:s,currencySymbol:c},id:crypto.randomUUID(),isCategoryMiscategorized:!1,isClassMiscategorized:!1,lineDescription:"",platformLineDetailType:"account_based_expense_line_detail",type:"transaction_with_account_and_class_line"};t(Dt(n,d))},onLineDelete:n=>{if(e.transaction==null)return;const a={id:e.transaction.id,type:e.transaction.type};t(kt(a,n))},onToggleSplitEditMode:n=>{if(e.transaction==null)return;const a={id:e.transaction.id,type:e.transaction.type};t(vt(a,n))}}}))(Qt);function Nn(){const t=Ce(),e=j(),o=Ee(),{useFeatureGate:n}=H(),a=Wt(),s=g((m=>Q(m))),c=s.userRole.includes("charge_card_user")||s.userRole.includes("charge_card_admin"),d=s.userRole!=null&&_e(s.userRole),h=s.userRole!=null&&Re(s.userRole),{isFeatureEnabled:S}=n(w.isVendorBulkUpdateOnTransactionEnabled),{isFeatureEnabled:E}=n(w.isExpenseAutomationEnabled),{tenantEmailDomain:p,transactionTypeEncoded:l,transactionId:u}=Ae(),[y,v]=i.useState(!1),f=ze(l??""),T=Ye(u,f),D=g((m=>m.transactionVendorViewState)),C=pe(),{isFeatureEnabled:P}=n(w.isRecommendationFeedbackEnabled),A=Ht(),{onRecommendationSelection:F,popup:U}=fn({isEnabled:P,fallbackTransactionId:u}),V=i.useMemo((()=>({...A,onRecommendationSelection:F})),[A,F]),{isFeatureEnabled:x}=n(w.isCreateTransferEntryFromExpenseEnabled),{isFeatureEnabled:B}=n(w.isProjectsTransactionsEnabled),{isFeatureEnabled:O}=n(w.isTransactionSplitEnabled),G=a?.currentTenant?.companyId,X=a?.currentTenant?.companyName,N=cn(G),k=i.useMemo((()=>{if(T)return{id:u,type:q(f)}}),[T,u,f]),r=k!=null?g((m=>W(m,k))):void 0,I=r?.transactionDetailLocalData.vendorUpdates?.id!=null?D.editVendorStateById[r?.transactionDetailLocalData.vendorUpdates.id]?.saveStatus.fetchState:"Not-Started",b=r?.fetchState==="Completed"?Me(r?.transaction):void 0,R=g((m=>b!=null?we(m.customerIncomeState,m.vendorExpenseState,m.trendState,b,"month"):void 0)),Z=g((m=>le(m))),ee=g((m=>b!=null?Pe(m.trendWithTransactionsState,b,"TransactionDetail"):void 0)),te=s.company?.companyInfo.firstMonthOfFY??1,z=g((m=>Fe(m.accountState,m.accountListState,"accountList"))),[Xe,fe]=i.useState(!1),[qe,he]=i.useState(!1),[We,Se]=i.useState(!1),He=i.useCallback((m=>je(m,p??"")+o.search),[p,o.search]),Ze=i.useCallback((()=>{Se(!1)}),[]);bn({currentTransactionId:k,enabled:p!=null&&p!=="",buildPath:He,beforeNavigate:Ze,navigate:t,navigateState:o.state});const ye=()=>{fe(!1),he(!1)},Te=dn();mn();const ne=i.useRef(r?.transaction);ne.current=r?.transaction;const Je=r?.transactionDetailUpdateStatus?.fetchState,L=pn(Je,(()=>{const m=[];if(ne.current!=null)for(const ae of ne.current.lines??[])"account"in ae&&ae.account?.accountId!=null&&m.push(ae.account.accountId);return m}));i.useEffect((()=>{k!=null&&r!=null&&r.fetchState==="Not-Started"&&(e(Oe(k,!1)),ye())}),[e,k,r?.fetchState]),i.useEffect((()=>{if(k!=null&&r?.fetchState==="Error"){const m=ie(o.state?.pathnameStackToGoBack,o.pathname);t("page-not-found",{replace:!0,state:Te?{pathnameStackToGoBack:m,message:"expenseAutomation",origin:"transaction_categorization"}:{pathnameStackToGoBack:m,message:"pageNotFound",origin:"transaction_detail"}})}}),[k,r?.fetchState,t,o.state,o.pathname,Te]),i.useEffect((()=>{We||r==null||r.transaction==null||(e(Ue({id:r.transaction.id,type:r.transaction.type})),Se(!0));const m=o.state?.searchContext;b==null&&r?.fetchState==="Completed"&&De(r?.transaction,m),b!=null&&(!c||d&&h===!1)&&(Xe?qe||R==null||(he(!0),e(me(b,"TransactionDetail",{timeframe:"month",timePeriod:ee?.selectedPeriod?.timePeriod??R}))):(e(de()),e(ue()),De(r?.transaction,m),fe(!0),e(xe(b))))}),[r?.fetchState,r?.transaction,R,c]),i.useEffect((()=>{Z.newVendorState?.vendorDetailLocalData?.vendorName!=null?v(!0):v(!1)}),[Z.newVendorState?.vendorDetailLocalData?.vendorName]),i.useEffect((()=>()=>{e(M("common"))}),[]);const Ke=[l,u].filter((m=>m!=null)),{transactionId:be,onSaveVendor:Qe,onSaveSuccess:et,onCancel:tt}=gn({closeDrawerHandler:m=>{v(!1),t(m?"../":"../..")}}),{isAiCfoAccessEnabled:nt,onAskAiCfoClick:at}=sn({mobileExploreReferrer:"Transaction Details"});return Zt({isDataReady:r?.fetchState==="Completed"}),T?_.jsxs(_.Fragment,{children:[be!=null&&y&&_.jsx(Sn,{isOpen:y,transactionId:be,onSaveVendor:Qe,onSaveSuccess:et,onCancel:tt}),_.jsx(Jt,{toolkit:V,children:_.jsx(In,{hideDeleteAttachment:!0,firstMonthOfFY:te,isDisabled:r?.transaction?.type==="transfer"&&a?.connectionName==="netsuite"?"readonly":void 0,tenantEmailDomain:p,location:o,navigate:t,selectedTransaction:k,entity:b,isCOTEnabled:C,defaultTrendTransactionTimePeriod:R,resetTrendIsFetchedStates:ye,transaction:r?.transaction,uncategorizedAccounts:z,vendorSaveStatus:I,isVendorBulkUpdateOnTransactionEnabled:S,isCreateTransferEntryFromExpenseEnabled:x,isExpenseAutomationEnabled:E,isAiCfoAccessEnabled:nt,onAskAiCfoClick:at,isProjectsTransactionsEnabled:B,isTransactionSplitEnabled:O,companyId:G,companyName:X,initialOpenThreadRequest:N})}),U,L.showPopup&&L.popupType!=null&&_.jsx(Kt,{popupType:L.popupType,currencySymbol:L.currencySymbol,accountId:L.popupAccountId??"",accountName:L.popupAccountName??"",onSubmit:L.handleSubmit,onDismiss:L.handleDismiss})]}):_.jsx(st,{to:$e(Ke.length)})}const $e=(t=2)=>{let e="../";for(let o=0;o<t;o++)e=`${e}../`;return e},De=(t,e)=>{if(t!=null){const{transactionCategory:o,transactionClass:n}=vn(t),a=kn(t);$.trackTransactionDetails(t.account?.accountId,t.account?.accountName,t.id,a,o.length>0?o:void 0,n.length>0?n:void 0,t.type,t.amount,t.memo,t.lines?.length??0,t.attachments?.map((s=>s.fileName)),e!=null?"Search":void 0,e?.searchTerm,e?.resultPosition,e?.resultsCount)}},vn=t=>{const e=[],o=[];return t.lines?.forEach((n=>{switch(n.type){case"transaction_with_account_and_class_line":case"transaction_with_product_or_service_line":case"journal_entry_transaction_line":case"linked_transaction_line":{const a=n;a!=null&&a.account!=null&&a.account.accountName?.length>0&&e.push(a.account.accountName),a.class!=null&&a.class.className?.length>0&&o.push(a.class.className);break}}})),{transactionCategory:e,transactionClass:o}},kn=t=>Tt(t)===!0?t.customer?.name??"":bt(t)===!0?t.vendor?.name??"":t.memo!=null?t.memo:t.type;export{Sn as C,Nn as T,On as a,fn as b,pn as c,gn as d,In as e,bn as f,pe as g,Tn as h,Bn as i,De as l,Vn as r,mn as u};