@zeniai/web-app-ui 5.3.47-dev → 5.3.48-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 (159) hide show
  1. package/dist/assets/AccountMappingScreen-DeHsC__B.js +9 -0
  2. package/dist/assets/AddressRoutes-Bh2vRJBa.js +1 -0
  3. package/dist/assets/AddressScreen-C9Fk_Z55.js +9 -0
  4. package/dist/assets/AiCfoScreen-DB41E0VN.js +22 -0
  5. package/dist/assets/{AppDrawer-D4O6tn5i.js → AppDrawer-XdZKck2N.js} +3 -3
  6. package/dist/assets/{BillPayApprovalRoutes-BY4P9AKu.js → BillPayApprovalRoutes-Dyxgp6fW.js} +1 -1
  7. package/dist/assets/BillPayRoutes-Bp82WT-5.js +119 -0
  8. package/dist/assets/BusinessVerificationPageScreen-BT5PhS2R.js +9 -0
  9. package/dist/assets/CardsAiCfoScreen-CgeqAvem.js +14 -0
  10. package/dist/assets/ChargeCardRoutes-Ds9toMfJ.js +71 -0
  11. package/dist/assets/CompanyPassportScreen-B2k7aWUB.js +1 -0
  12. package/dist/assets/ConnectionAuthScreen-DrhuD992.js +11 -0
  13. package/dist/assets/CustomerOnboardingAuthScreen-CpbSTPlS.js +1 -0
  14. package/dist/assets/{CustomerOnboardingRoutes-DV3rYEiJ.js → CustomerOnboardingRoutes-RIeFd0Jj.js} +3 -3
  15. package/dist/assets/{DashboardRoutes-D5hdkebN.js → DashboardRoutes-DqcCIUfr.js} +4 -4
  16. package/dist/assets/{DefaultTenantHome-DCPi_wXC.js → DefaultTenantHome-DhG1xEfc.js} +1 -1
  17. package/dist/assets/DomesticWireDetailScreen-BKq5jjLx.js +18 -0
  18. package/dist/assets/{DrawerScreen-BihZ_PpN.js → DrawerScreen-DsFB_53j.js} +1 -1
  19. package/dist/assets/EntityDetailRoutes-mt1xcJ7j.js +1 -0
  20. package/dist/assets/ExpenseAutomationRoutes-lC_JLdAl.js +38 -0
  21. package/dist/assets/FeaturePreviewScreen-BFU7MG_7.js +1 -0
  22. package/dist/assets/HubSpotOAuthCallbackScreen-sKmwa_VW.js +1 -0
  23. package/dist/assets/InboxNotificationsProvider-CLtB_fgp.js +1 -0
  24. package/dist/assets/InvoicingRoutes-9v2-NT7u.js +2 -0
  25. package/dist/assets/MagicLinkRoutes-CXFrKDZN.js +72 -0
  26. package/dist/assets/MagicLinkSignInScreen-dmwIRx3p.js +12 -0
  27. package/dist/assets/MobileAppDrawer-cBt39NZW.js +1 -0
  28. package/dist/assets/NotFoundScreen-DFQDCCRn.js +1 -0
  29. package/dist/assets/NotificationRoutes-DBx2Hpze.js +1 -0
  30. package/dist/assets/OAuthConsentScreen-Y007Isid.js +1 -0
  31. package/dist/assets/PandLWithForecastRoutes-C51wwulq.js +1 -0
  32. package/dist/assets/{PaymentLinkScreen-B8bPleIr.js → PaymentLinkScreen-DJghRBso.js} +7 -7
  33. package/dist/assets/PeopleRoutes-Bm7sOBGu.js +22 -0
  34. package/dist/assets/PerformanceRoutes-BqAferL2.js +1 -0
  35. package/dist/assets/{Preview-DMLQokX_.js → Preview-BTwrFAaN.js} +1 -1
  36. package/dist/assets/{QBOConnectionScreen-CWU6DFJl.js → QBOConnectionScreen-UblfZAiA.js} +1 -1
  37. package/dist/assets/ReimbursementApprovalRoutes-DEDn1IHB.js +1 -0
  38. package/dist/assets/ReimbursementApprovalRuleDetailScreen-QDei_Fzl.js +1 -0
  39. package/dist/assets/{ReimbursementRoutes-BdJ3oqBf.js → ReimbursementRoutes-BHG-L5Ik.js} +9 -9
  40. package/dist/assets/ReportsRoutes-1SHXwblc.js +1 -0
  41. package/dist/assets/RewardsRoutes-bKzfn6ay.js +1 -0
  42. package/dist/assets/ScheduleDetailsPrepaidExpensesScreen-CdJ2LE-G.js +25 -0
  43. package/dist/assets/ScreenRoutes-Bz0Iu7E_.js +2 -0
  44. package/dist/assets/{SettingsRoutes-BGCz0_nd.js → SettingsRoutes-pgiyjQKt.js} +6 -6
  45. package/dist/assets/{SetupPagesScreen-DzNRL7Y-.js → SetupPagesScreen-Dzk7fHhk.js} +5 -5
  46. package/dist/assets/SignInScreen-Rmz1EJ3i.js +1 -0
  47. package/dist/assets/SignOutScreen-BgL1D0p9.js +9 -0
  48. package/dist/assets/{TaskListScreen-Br-mxkKM.js → TaskListScreen-BjJ59grh.js} +2 -2
  49. package/dist/assets/TaskRoutes-cixN3J6B.js +9 -0
  50. package/dist/assets/TransactionDetailRoutes-B_IKz98q.js +1 -0
  51. package/dist/assets/{TransactionDetailScreen-Bp7IFDK0.js → TransactionDetailScreen-BzVEfQec.js} +2 -2
  52. package/dist/assets/TransactionListRoutes-DiO8Bs9p.js +1 -0
  53. package/dist/assets/{TreasuryRoutes-BvvMozYl.js → TreasuryRoutes-DMo68xKo.js} +6 -6
  54. package/dist/assets/{VendorsRoutes-DsJ_lcDO.js → VendorsRoutes-DcubMsnX.js} +17 -17
  55. package/dist/assets/WiseConfirmationScreen-C40X1D6g.js +12 -0
  56. package/dist/assets/ZeniAccountRoutes-B2XcNL7K.js +57 -0
  57. package/dist/assets/ZeniAccountStatementScreen-B4EqmylS.js +9 -0
  58. package/dist/assets/{accountMappingHelper-DqBiQF6x.js → accountMappingHelper-C7mDOec7.js} +1 -1
  59. package/dist/assets/{analytics-D6GpUSOP.js → analytics-D1aMnBue.js} +1 -1
  60. package/dist/assets/{analyticsHelper-CwB3kQvw.js → analyticsHelper-BefphWIe.js} +1 -1
  61. package/dist/assets/{core-B5mDy9pu.js → core-DA_GbUVO.js} +1 -1
  62. package/dist/assets/{decodeURIComponentSafe-DANuhXnG.js → decodeURIComponentSafe-BeWrvHuJ.js} +1 -1
  63. package/dist/assets/{dnd-CGWe1ZMP.js → dnd-BVDuXkBA.js} +1 -1
  64. package/dist/assets/{empty-D0y6rZ_X.js → empty-DkYQEFBR.js} +1 -1
  65. package/dist/assets/{empty-Dj4ZMRNZ.js → empty-kmkuoqGV.js} +1 -1
  66. package/dist/assets/{emptyVideoElement-BbYSqu6F.js → emptyVideoElement-Dr5ohcS7.js} +1 -1
  67. package/dist/assets/epic-DZfUNOLM.js +2 -0
  68. package/dist/assets/expenseAutomationHelper-4Qy8IF7o.js +1 -0
  69. package/dist/assets/{getLocaleForTenant-DH5Avx3x.js → getLocaleForTenant-BYa6QBcb.js} +1 -1
  70. package/dist/assets/{index-BQBXaLiB.js → index-B02Uvg0e.js} +1 -1
  71. package/dist/assets/{index-8s12XWuB.js → index-BVMI-pAw.js} +1 -1
  72. package/dist/assets/{index-k1-Pd2Ki.js → index-BqUvSiTi.js} +1 -1
  73. package/dist/assets/{index-fq0DUtem.js → index-BsYcIz8M.js} +1 -1
  74. package/dist/assets/{index-CI8tXM3D.js → index-C4n_QrNU.js} +1 -1
  75. package/dist/assets/{index-G6Wb7pfX.js → index-C5j9ulaE.js} +2 -2
  76. package/dist/assets/index-CY-CsK5V.js +1 -0
  77. package/dist/assets/{index-6nH5LMe4.js → index-CsnAk3jU.js} +30661 -31464
  78. package/dist/assets/{lexical-DW4lC8Zx.js → lexical-Czsku2z1.js} +1 -1
  79. package/dist/assets/{liveblocks-UOzcPsHa.js → liveblocks-DTaiayIC.js} +2 -2
  80. package/dist/assets/{lottie-C5eNvt0I.js → lottie-CkYI8upo.js} +1 -1
  81. package/dist/assets/{mui-Do6nLzGb.js → mui-yMDYeeMr.js} +1 -1
  82. package/dist/assets/{pathToGoBack-DP_bGWF-.js → pathToGoBack-nmNIndUw.js} +1 -1
  83. package/dist/assets/{pdf-DjwvAC2g.js → pdf-BIYA0Nfl.js} +3 -3
  84. package/dist/assets/{pdf-lib-CZXOqgb4.js → pdf-lib-DZGnWz6X.js} +1 -1
  85. package/dist/assets/{plaid-0g_vwjSd.js → plaid-BtwBxM-6.js} +1 -1
  86. package/dist/assets/{pusher-BwlPp2s7.js → pusher-8BUSKGPT.js} +1 -1
  87. package/dist/assets/{react-BsXfT48C.js → react-Bs3cqIIe.js} +1 -1
  88. package/dist/assets/{react-CU01hiuh.js → react-C6ZyRyfn.js} +1 -1
  89. package/dist/assets/{react-Bja4MeVO.js → react-CxBgzLVF.js} +1 -1
  90. package/dist/assets/{react-Dex3foBA.js → react-a48nQACt.js} +1 -1
  91. package/dist/assets/{react-RZilWHYG.js → react-bpjj59R_.js} +1 -1
  92. package/dist/assets/{react-DkYBVdJJ.js → react-uoYsSJ7d.js} +1 -1
  93. package/dist/assets/{recharts-uFX1dZS-.js → recharts-D3wE7yHJ.js} +1 -1
  94. package/dist/assets/{routePaths-uBvxqlLY.js → routePaths-DeWRBZpS.js} +1 -1
  95. package/dist/assets/{sentry-DHDsO12F.js → sentry-BRmieicQ.js} +1 -1
  96. package/dist/assets/{url-CLCy7GPP.js → url-BAbGMJa_.js} +1 -1
  97. package/dist/assets/{url-BxiN6LKq.js → url-DXDQoAPC.js} +1 -1
  98. package/dist/assets/{useAiCfoDashboardSuggestedQuestionsChips-D8KJqvT7.js → useAiCfoDashboardSuggestedQuestionsChips-SoHaFZ4W.js} +1 -1
  99. package/dist/assets/useAskAiCfoHostNavButtonProps-BOgWSkqa.js +1 -0
  100. package/dist/assets/{useChargeCardPusherEvents-BnH8_thb.js → useChargeCardPusherEvents-C1Fc6NgG.js} +1 -1
  101. package/dist/assets/{useDeviceId-Bi38IJl0.js → useDeviceId-CZzjV8tQ.js} +1 -1
  102. package/dist/assets/{useEmailConnectResultRefresh-Ba8t-BuL.js → useEmailConnectResultRefresh-DtruKk0s.js} +1 -1
  103. package/dist/assets/{useInitialThreadRequest-7Q8HJAH2.js → useInitialThreadRequest-BJ6-q-Ev.js} +1 -1
  104. package/dist/assets/useTaskManagerAccess-Bm40mz18.js +1 -0
  105. package/dist/assets/{utils-BsODCDYR.js → utils-UMm0RYR6.js} +1 -1
  106. package/dist/assets/withTransactionSidePanel-aokrUwcT.js +25 -0
  107. package/dist/assets/{zeni-epic-state-7eY0g-Bc.js → zeni-epic-state-cafsD4rZ.js} +6 -6
  108. package/dist/index.html +1 -1
  109. package/package.json +6 -6
  110. package/dist/assets/AccountMappingScreen-Euit4Ttk.js +0 -9
  111. package/dist/assets/ActualMatchingMatchDetailScreen-BBYzjOqh.js +0 -1
  112. package/dist/assets/AddressRoutes-PvYGzHCA.js +0 -1
  113. package/dist/assets/AddressScreen-DsGvV3N8.js +0 -9
  114. package/dist/assets/AiCfoScreen-DAEPn0_B.js +0 -22
  115. package/dist/assets/BillPayRoutes-CWc4tAqm.js +0 -119
  116. package/dist/assets/BusinessVerificationPageScreen-CSruI1nV.js +0 -9
  117. package/dist/assets/CardsAiCfoScreen-COoYscKz.js +0 -14
  118. package/dist/assets/ChargeCardRoutes-BU6-pfJv.js +0 -71
  119. package/dist/assets/CompanyPassportScreen-BxoatMVb.js +0 -1
  120. package/dist/assets/ConnectionAuthScreen-zbcvhPbz.js +0 -11
  121. package/dist/assets/CustomerOnboardingAuthScreen-8IwDeKdF.js +0 -1
  122. package/dist/assets/DomesticWireDetailScreen-DgE28aJN.js +0 -18
  123. package/dist/assets/EntityDetailRoutes-BqX-J3vM.js +0 -1
  124. package/dist/assets/ExpenseAutomationRoutes-DK-U-YTd.js +0 -38
  125. package/dist/assets/FeaturePreviewScreen-5SleVFKv.js +0 -1
  126. package/dist/assets/HubSpotOAuthCallbackScreen-2RxbRDTZ.js +0 -1
  127. package/dist/assets/InboxNotificationsProvider-BmF5-_KA.js +0 -1
  128. package/dist/assets/InvoicingRoutes-D0S6fDxY.js +0 -2
  129. package/dist/assets/MagicLinkRoutes-C22EnpRm.js +0 -72
  130. package/dist/assets/MagicLinkSignInScreen-BVf-rLEH.js +0 -12
  131. package/dist/assets/MobileAppDrawer-0YtWXA3B.js +0 -1
  132. package/dist/assets/NotFoundScreen-BkYIKPgh.js +0 -1
  133. package/dist/assets/NotificationRoutes-CZQRvVbE.js +0 -1
  134. package/dist/assets/OAuthConsentScreen-Q7ZDvc1F.js +0 -1
  135. package/dist/assets/PandLWithForecastRoutes-BzO_OgSq.js +0 -1
  136. package/dist/assets/PeopleRoutes-D_nqmuPM.js +0 -22
  137. package/dist/assets/PerformanceRoutes-BW6dixVF.js +0 -1
  138. package/dist/assets/ReimbursementApprovalRoutes-DAusugdf.js +0 -1
  139. package/dist/assets/ReimbursementApprovalRuleDetailScreen-phJuB98f.js +0 -1
  140. package/dist/assets/ReportsRoutes-CDSCG28G.js +0 -1
  141. package/dist/assets/RewardsRoutes-CHkOPz1g.js +0 -1
  142. package/dist/assets/ScheduleDetailsPrepaidExpensesScreen-DnVEpQsK.js +0 -33
  143. package/dist/assets/ScreenRoutes-BYAPWka6.js +0 -2
  144. package/dist/assets/SignInScreen-BREpWd6T.js +0 -1
  145. package/dist/assets/SignOutScreen-BNCpbut8.js +0 -9
  146. package/dist/assets/TaskRoutes-CDuiJExM.js +0 -9
  147. package/dist/assets/TransactionDetailRoutes-CYb-4jKQ.js +0 -1
  148. package/dist/assets/TransactionListRoutes-B6NIJUWk.js +0 -1
  149. package/dist/assets/WiseConfirmationScreen-Bg5_g49N.js +0 -12
  150. package/dist/assets/ZeniAccountRoutes-C3fDjuMG.js +0 -57
  151. package/dist/assets/ZeniAccountStatementScreen-CbdRQI0p.js +0 -9
  152. package/dist/assets/epic-mSW644GG.js +0 -2
  153. package/dist/assets/expenseAutomationHelper-DBDpSggk.js +0 -1
  154. package/dist/assets/index-6yt3BfRL.js +0 -1
  155. package/dist/assets/stripSplatSuffix-CQQXAy0N.js +0 -1
  156. package/dist/assets/useActualMatchingMatchDetail-OCZsPxr6.js +0 -1
  157. package/dist/assets/useAskAiCfoHostNavButtonProps-BsP5fVhq.js +0 -1
  158. package/dist/assets/useTaskManagerAccess-BG0Fkj9k.js +0 -1
  159. package/dist/assets/withTransactionSidePanel-DK-Ex27L.js +0 -25
@@ -1,71 +0,0 @@
1
- import{j as o}from"./liveblocks-UOzcPsHa.js";import{u as me,j as d,h as de,g as he,i as Ne,N as Je,s as _t,l as Pe,t as _n,n as cs,o as ne}from"./core-B5mDy9pu.js";import{fS as Pt,$J as is,g2 as wt,bt as Te,$K as ds,$L as ls,fH as fn,$M as Pn,fQ as wn,$N as vn,$O as Tn,$P as Fn,$Q as xn,fR as Ln,g1 as Bn,$R as Rn,$S as us,fX as ms,fW as Cs,$T as ps,JW as On,g4 as ia,$U as hs,$V as fs,fJ as gs,fI as bs,gh as ze,fZ as Un,fY as jn,$W as Ss,f_ as ys,Js as Is,Jr as ks,Jv as Es,Jx as As,ga as Ds,fE as Mn,$X as _s,$Y as Ps,gf as Nn,$Z as ws,gg as yt,JD as vs,JA as Ts,fF as fe,$_ as qa,dZ as Fe,di as xe,d_ as Le,g_ as da,cB as la,$$ as ua,a00 as vt,CR as Ga,m7 as Ka,a01 as za,Ka as ka,g5 as qe,Kc as Tt,lZ as Vn,a02 as ma,J_ as _a,a03 as Fs,a04 as xs,K1 as Ja,a05 as Ls,YV as Qa,g0 as Hn,K7 as ba,iq as Bs,a06 as $n,fT as Ca,br as Rs,a07 as Os,gG as Xa,gF as et,KG as Us,gE as at,a08 as Gn,cu as Kn,da as js,YU as wa,Lf as zn,a09 as gn,KR as Pa,a0a as Yn,Lg as Ms,Zi as Ns,Lh as Vs,Mm as Hs,C5 as $s,Mg as Gs,a0b as Ks,Kb as oa,a0c as zs,a0d as Ys,a0e as Zs,a0f as Ws,a0g as qs,a0h as Ft,a0i as Js,Kr as Zn,Kk as Qs,a0j as Xs,h0 as eo,a0k as Wn,KA as qn,KE as Jn,g$ as ao,a0l as to,L1 as Qn,a0m as no,a0n as ro,a0o as so,KC as Xn,Kn as er,K4 as ar,Kw as tr,Ku as nr,Ky as oo,a0p as rr,a0q as co,gc as io,gd as lo,ge as uo,a0r as tt,g6 as sr,dc as xt,a0s as mo,a0t as Co,a0u as po,a0v as ho,KM as It,L8 as fo,L4 as go,KI as bo,L6 as So,KY as yo,K_ as Io,a0w as or,Le as $a,S5 as ko,a0x as Eo,a0y as Ao,a0z as Do,a0A as cr,a0B as _o,LB as Po,KQ as ir,KL as Me,KP as wo,a0C as vo,a0D as To,JX as Fo,a0E as dr,f$ as lr,a0F as xo,JZ as Lo,JY as bn,a0G as Bo,a0H as Ro,a0I as Oo,Vd as Uo,a0J as Lt,a0K as jo,FY as ur,mH as Mo,ie as No,LG as Vo,a0L as mr,fN as Ho,fO as $o,a0M as Go,dO as Ko,g3 as zo,Lw as Yo,Lq as We,bq as Zo,bJ as Wo,cG as qo,bK as Jo,U4 as Qo}from"./zeni-epic-state-7eY0g-Bc.js";import{U as Be,df as Cr,a4 as we,dg as pr,dh as hr,di as Xo,G as ea,as as Bt,dj as ec,dk as ac,a as fr,e as gr,ar as br,p as ke,N as le,c as Z,h as ya,dl as Sr,dm as tc,dn as nc,z as te,a7 as va,d4 as nt,dp as rc,dq as sc,dr as oc,a1 as Ta,bi as Qe,bE as Rt,ds as cc,ab as Fa,Z as rt,E as Ot,j as ae,w as st,dt as ic,bQ as Sa,du as kt,dv as dc,a8 as Ut,dw as lc,ae as yr,av as Et,dx as uc,aq as Ir,J as kr,S as Er,dy as mc,dz as Cc,dA as pc,dB as hc,dC as fc,dD as gc,dE as bc,H as Ya,dF as Sc,dG as yc,m as ht,M as Ic,dH as kc,dI as Ec,dJ as Ac,ai as Dc,dK as _c,dL as Pc,g as wc}from"./index-6nH5LMe4.js";import{n as Ve,D as Ar,S as vc}from"./mui-Do6nLzGb.js";import{a as r}from"./sentry-DHDsO12F.js";import{u as xa}from"./useAskAiCfoHostNavButtonProps-BsP5fVhq.js";import{M as Ee}from"./MobileAppDrawer-0YtWXA3B.js";import{d as jt}from"./recharts-uFX1dZS-.js";import{g as _e,a as La,b as Dr,c as Re,d as Oe,e as Xe,f as aa,h as ta,A as Tc,i as Mt,P as Fc,j as Nt,s as Ia,k as _r,l as ca,m as Pr,n as xc,o as wr,p as Lc,S as Sn}from"./SetupPagesScreen-DzNRL7Y-.js";import{u as vr}from"./useInitialThreadRequest-7Q8HJAH2.js";import ot from"./NotFoundScreen-BkYIKPgh.js";import{u as Vt}from"./useChargeCardPusherEvents-BnH8_thb.js";import{n as yn}from"./utils-BsODCDYR.js";import{t as Bc}from"./AddressScreen-DsGvV3N8.js";import"./analytics-D6GpUSOP.js";import"./plaid-0g_vwjSd.js";import"./dnd-CGWe1ZMP.js";import"./stripe-cKAAJElX.js";import"./lottie-C5eNvt0I.js";import"./lexical-DW4lC8Zx.js";import"./pdf-DjwvAC2g.js";import"./InboxNotificationsProvider-BmF5-_KA.js";import"./useTaskManagerAccess-BG0Fkj9k.js";import"./BusinessVerificationPageScreen-CSruI1nV.js";import"./routePaths-uBvxqlLY.js";import"./analyticsHelper-CwB3kQvw.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]="f61df82b-0f1e-4708-a008-89321c65e70d",e._sentryDebugIdIdentifier="sentry-dbid-f61df82b-0f1e-4708-a008-89321c65e70d")}catch{}})();const Rc=e=>{const a=e.cardHolderUser,n=`${a.firstName??""} ${a.lastName??""}`.trim()||a.email||a.userId;return{userId:a.userId,displayName:n,roleLabel:e.cardHolderRoles?.titleAtCompany}},Tr=e=>({id:e.id,isChecked:!1,cardName:e.cardName,last4:e.accountLast4,limitAmount:e.limit?.amount??0,limitCadence:e.creditLimitFrequency?.code,owner:Rc(e),utilizationAmount:(e.limit?.amount??0)-(e.available?.amount??0)});function Fr(){const e=me(),a=d((t=>Pt(t.cardPolicyState))),n=d((t=>is(t.cardPolicyState)));r.useEffect((()=>{n!==""||a==="Completed"&&n===""||a==="In-Progress"||e(wt())}),[e,a,n])}const{spendManagement:{chargeCard:{cardPolicyPage:In}}}=ea.getLocalizedStrings(),Oc=e=>Un(e,!1),Uc=e=>jn(e.name,!1);function jc(){const e=de(),a=he(),{tenantEmailDomain:n}=Ne(),t=me(),s=Be(),g=Te(s?.loggedInUserRoleMap),[b,h]=r.useState(!1),A=r.useCallback((O=>{h(O)}),[]),u=r.useCallback((()=>{A(!0)}),[A]),{isAiCfoAccessEnabled:m,onAskAiCfoClick:F}=xa({mobileExploreReferrer:"Card Policy"});r.useEffect((()=>()=>{t(ds()),t(ls()),t(fn())}),[t]);const w=d((O=>Pn(O.cardPolicyState))),p=d((O=>wn(O.cardPolicyState))),T=d((O=>vn(O.cardPolicyState))),B=d((O=>Tn(O.cardPolicyState))),S=d((O=>Fn(O.cardPolicyState))),l=d((O=>xn(O.cardPolicyState))),C=d((O=>Ln(O.cardPolicyState))),L=d((O=>Pt(O.cardPolicyState))),k=d((O=>O.chargeCardConfigState.receiptRequiredAboveAmount.amount)),_=d((O=>O.chargeCardConfigState.fetchState));r.useEffect((()=>{w!=="Completed"&&w!=="In-Progress"&&t(Bn())}),[t,w]),Fr();const D=d((O=>Rn(O.createCardPolicyState))),M=d((O=>us(O.createCardPolicyState))),E=d((O=>ms(O.cardPolicyState))),y=d((O=>Cs(O.cardPolicyState))),R=d((O=>ps(O.createCardPolicyState))),i=d((O=>On(O)));r.useEffect((()=>{i.fetchState==="Not-Started"&&t(ia(!1,!1,!1))}),[i.fetchState,t]);const f=r.useMemo((()=>p.map(Oc)),[p]),j=r.useMemo((()=>C.map(Uc)),[C]),G=r.useMemo((()=>i.cards.filter((O=>!Cr(O.status.code))).map(Tr)),[i.cards]),U=w==="Completed"&&i.fetchState==="Completed"&&_==="Completed";r.useEffect((()=>{U&&R==null&&t(hs({cardsMasterList:G,defaultRequireReceiptAmount:k,suggestedAllowMerchants:T,suggestedBlockMerchants:B,suggestedAllowCategories:S,suggestedBlockCategories:l}))}),[_,t,U,R,G,k,T,B,S,l]);const x=r.useMemo((()=>jt((O=>{t(wt(O))}),250)),[t]);r.useEffect((()=>()=>{x.cancel()}),[x]);const z=r.useCallback((O=>{x(O)}),[x]),H=D.fetchState,v=n!=null?`/${n}/cards/policy`:"..",P=r.useCallback((()=>{const O=we(a.state?.pathnameStackToGoBack),q=O.poppedPathname??v;e(q,{state:{pathnameStackToGoBack:O.newStack}})}),[a.state,e,v]),K=r.useCallback((()=>{e(v)}),[e,v]),W=r.useCallback((O=>{t(fs(O))}),[t]),I=r.useCallback((O=>{const q=pr(O);t(gs({templates:[q]}))}),[t]),N=r.useCallback((O=>{O.length!==0&&t(bs(O))}),[t]),V=r.useCallback((()=>{t(fn())}),[t]),Q=r.useRef(H);r.useEffect((()=>{const O=Q.current;Q.current=H,H==="Completed"&&O!=="Completed"&&M!=null&&(t(ze({messageSection:"card_policy_created",messageText:"success",type:"success"})),e(v))}),[t,H,M,e,v]);const c=H==="Error"?D.error?.message??In.createPolicyGenericErrorMessage:void 0;return g&&n!=null?R==null?o.jsxs(o.Fragment,{children:[o.jsx(Ee,{isAppContentDrawerOpen:b,handleDrawerToggle:A}),o.jsx(hr,{showUploadDocumentSection:!0,navBarTitle:In.createPageTitle,onBackClick:P,onClickMenuIcon:u,isAiCfoAccessEnabled:m,onAskAiCfoClick:F})]}):o.jsxs(o.Fragment,{children:[o.jsx(Ee,{isAppContentDrawerOpen:b,handleDrawerToggle:A}),o.jsx(Xo,{formDraft:R,vendorSearchOptions:j,categorySearchOptions:f,isVendorSearchLoading:L==="In-Progress",onVendorSearchTextChange:z,submitState:H,submitErrorMessage:c,documentUploadState:E,uploadedFileName:y,isAiCfoAccessEnabled:m,onAskAiCfoClick:F,onBackClick:P,onCancelClick:K,onClickMenuIcon:u,onFormChange:W,onSubmit:I,onUploadDocument:N,onRemoveDocument:V})]}):o.jsx(Je,{to:"..",replace:!0})}const{spendManagement:{chargeCard:{cardPolicyPage:Mc}}}=ea.getLocalizedStrings(),Nc=e=>Un(e,!1),Vc=e=>jn(e.name,!1);function Hc(){const e=de(),a=he(),{tenantEmailDomain:n,templateId:t}=Ne(),s=me(),g=Be(),b=Te(g?.loggedInUserRoleMap),[h,A]=r.useState(!1),u=r.useCallback((c=>{A(c)}),[]),m=r.useCallback((()=>{u(!0)}),[u]),{isAiCfoAccessEnabled:F,onAskAiCfoClick:w}=xa({mobileExploreReferrer:"Card Policy"}),p=d((c=>Ss(c))),T=d((c=>Pn(c.cardPolicyState))),B=d((c=>wn(c.cardPolicyState))),S=d((c=>vn(c.cardPolicyState))),l=d((c=>Tn(c.cardPolicyState))),C=d((c=>Fn(c.cardPolicyState))),L=d((c=>xn(c.cardPolicyState))),k=d((c=>Ln(c.cardPolicyState))),_=d((c=>Pt(c.cardPolicyState))),D=d((c=>On(c))),M=d((c=>t!=null?ys(c.cardPolicyState,t):void 0)),E=r.useMemo((()=>p.templateId===t&&p.formDraft!=null?p.formDraft:M!=null?Is(M):void 0),[p.templateId,p.formDraft,M,t]);r.useEffect((()=>{if(t==null)return;const c=p.detailFetchState.fetchState;p.templateId===t&&(c==="Completed"||c==="In-Progress")||M!=null||s(ks(t))}),[s,t,p.templateId,p.detailFetchState.fetchState,M]),r.useEffect((()=>{T!=="Completed"&&T!=="In-Progress"&&s(Bn())}),[s,T]),Fr();const y=d((c=>c.chargeCardConfigState.receiptRequiredAboveAmount.amount));r.useEffect((()=>{D.fetchState==="Not-Started"&&s(ia(!1,!1,!1))}),[D.fetchState,s]);const R=r.useMemo((()=>B.map(Nc)),[B]),i=r.useMemo((()=>k.map(Vc)),[k]),f=r.useMemo((()=>D.cards.filter((c=>!Cr(c.status.code))).map(Tr)),[D.cards]);Bt({isDataReady:E!=null});const j=r.useMemo((()=>{if(E!=null)return ec({draft:E,cardRows:f,categorySearchOptions:R,vendorSearchOptions:i,defaultRequireReceiptAmount:y,suggestedAllowMerchants:S,suggestedBlockMerchants:l,suggestedAllowCategories:C,suggestedBlockCategories:L})}),[E,f,R,i,y,S,l,C,L]),[G,U]=r.useState(void 0),x=r.useRef(!1);r.useEffect((()=>{x.current||G!=null||j==null||(x.current=!0,U(j))}),[G,j]);const z=r.useCallback((c=>{U(c)}),[]),H=r.useMemo((()=>jt((c=>{s(wt(c))}),250)),[s]);r.useEffect((()=>()=>{H.cancel()}),[H]);const v=r.useCallback((c=>{H(c)}),[H]),P=p.updateFetchState.fetchState,K=n!=null?`/${n}/cards/policy`:"..",W=r.useCallback((()=>{const c=we(a.state?.pathnameStackToGoBack),O=c.poppedPathname??K;e(O,{state:{pathnameStackToGoBack:c.newStack}})}),[a.state,e,K]),I=r.useCallback((()=>{e(K)}),[e,K]),N=r.useCallback((c=>{if(t==null)return;const O=pr(c);s(Es(O)),s(As(t))}),[s,t]),V=r.useRef(P);r.useEffect((()=>{const c=V.current;V.current=P,P==="Completed"&&c!=="Completed"&&(s(ze({messageSection:"card_policy_updated",messageText:"success",type:"success"})),e(K))}),[s,P,e,K]);const Q=P==="Error"?p.updateFetchState.error?.message??Mc.updatePolicyGenericErrorMessage:void 0;return!b||n==null||t==null?o.jsx(Je,{to:"..",replace:!0}):G!=null&&T==="Completed"&&D.fetchState==="Completed"?o.jsxs(o.Fragment,{children:[o.jsx(Ee,{isAppContentDrawerOpen:h,handleDrawerToggle:u}),o.jsx(ac,{templateName:p.template?.name??"",formDraft:G,vendorSearchOptions:i,categorySearchOptions:R,isVendorSearchLoading:_==="In-Progress",onVendorSearchTextChange:v,submitState:P,submitErrorMessage:Q,isAiCfoAccessEnabled:F,onAskAiCfoClick:w,onBackClick:W,onCancelClick:I,onClickMenuIcon:m,onFormChange:z,onSubmit:N})]}):o.jsxs(o.Fragment,{children:[o.jsx(Ee,{isAppContentDrawerOpen:h,handleDrawerToggle:u}),o.jsx(hr,{showUploadDocumentSection:!1,navBarTitle:p.template?.name,onBackClick:W,onClickMenuIcon:m,isAiCfoAccessEnabled:F,onAskAiCfoClick:w})]})}function xr(e,a,n){return a?e.filter((t=>t!=null&&t.trim().length>0)).slice(0,n):[]}function Lr(e){return d((a=>e==null||e===""?{chips:ft,isResolved:!1}:(function(n){const t=n?.fetchState,s=t==="Completed"||t==="Error";return{chips:t==="Completed"?n?.suggestedQuestions??ft:ft,isResolved:s}})(Ds(a,e))),_t)}const ft=[],{spendManagement:{chargeCard:{cardPolicyAiCfoHero:{headline:$c,subheadline:Gc,pageTitle:Kc}}}}=ea.getLocalizedStrings(),zc=e=>{const a=e.cardsCount>0?e.cardsCount:e.appliedCards.length,n=e.allowedEntity.merchantNames.length+e.blockedEntity.merchantNames.length,t=e.allowedEntity.categoryCodes.length+e.blockedEntity.categoryCodes.length;return{templateId:e.templateId,name:e.name,description:e.description,mode:e.mode==="flexible"?"flexible":"strict",createdAtFormatted:e.createdAt.format("ll"),cardsCount:a,vendorRestrictionsCount:n,categoryRestrictionsCount:t}};function Yc(){const e=de(),a=he(),{tenantEmailDomain:n}=Ne(),t=me(),s=Be(),g=Te(s?.loggedInUserRoleMap),[b,h]=r.useState(!1),A=r.useCallback((v=>{h(v)}),[]),u=r.useCallback((()=>{A(!0)}),[A]),{useFeatureGate:m}=le(),{isFeatureEnabled:F}=m(Z.isAiCfoFileUploadEnabled),{isFeatureEnabled:w}=m(Z.isCardPolicyEnabled),{isAiCfoAccessEnabled:p,onAskAiCfoClick:T}=xa({mobileExploreReferrer:"Card Policy"}),B=d((v=>_s(v))),S=d((v=>Rn(v.createCardPolicyState))),l=d((v=>Ps(v.createCardPolicyState))),C=d((v=>l==null?[]:Nn(v.aiCfoState,l).filter((P=>P.kind==="creating_policy"))),_t),L=S.fetchState==="In-Progress"?Math.max(C.length,1):0,k=d((v=>ws(v.createCardPolicyState))),_=ya(S.fetchState);r.useEffect((()=>{if(_==="In-Progress"&&S.fetchState==="Completed"&&l!=null)C.forEach((v=>{t(yt({chatSessionId:l,id:v.id,entityIds:k,kind:"created_policy"}))}));else if(_==="In-Progress"&&S.fetchState==="Error"&&l!=null){C.forEach((P=>{t(yt({chatSessionId:l,id:P.id,kind:"errored_policy"}))}));const v=S.error?.message!=null&&S.error.message.length>0?S.error.message:ea.getLocalizedStrings().common.errorMessage.somethingWentWrongPleaseTryAgain;t(ze({messageSection:"card_policy_created",messageText:"failed",type:"error",showStatusIcon:!0,variables:[{variableName:"_api-error_",variableValue:v}]}))}}),[S.error?.message,S.fetchState,t,l,k,C,_]);const D=B.fetchState.fetchState;r.useEffect((()=>{D!=="Not-Started"&&D!=="Error"||t(vs())}),[t,D]);const M=B.archiveFetchState.fetchState,E=ya(M);r.useEffect((()=>{E==="In-Progress"&&M==="Completed"&&t(ze({messageSection:"card_policy_deleted",messageText:"success",type:"success"}))}),[M,t,E]);const y=r.useMemo((()=>B.templates.map(zc)),[B.templates]);Bt({isDataReady:B.fetchState.fetchState==="Completed"});const R=y.length>0||L>0,i=(function(v){const{hasAnyPolicies:P,isChargeCardAdmin:K,isFileUploadEnabled:W}=v,I=de(),N=he(),{tenantEmailDomain:V}=Ne(),{isAiCfoOpen:Q,setIsAiCfoOpen:c}=fr(),O=gr(),q=br(),se=d((J=>Mn(J))).createSessionAndSubmitState.fetchState==="In-Progress",{chips:X,isResolved:He}=Lr("card_policy"),Ae=r.useMemo((()=>xr(X,He,3)),[X,He]),[ge,re]=r.useState(""),be=q&&O&&V!=null&&!Q,ue=r.useCallback((J=>{if(V==null)return;const fa=ke(N.state?.pathnameStackToGoBack,N.pathname);I(`/${V}/cards/ask`,{state:{message:"",origin:"",pathnameStackToGoBack:fa,referrer:"card_policy_hero",aiCfoInitialQuestion:J,aiCfoShouldSubmit:J!=null&&J.trim().length>0}})}),[N.pathname,N.state,I,V]),oe=r.useCallback((J=>{J.trim().length!==0&&(re(""),ue(J))}),[ue]),Se=r.useCallback((()=>{const J=ge.trim();J.length!==0&&(re(""),ue(J))}),[ge,ue]),ee=r.useCallback((()=>{}),[]),De=r.useCallback((J=>{re(J)}),[]),ve=r.useCallback((()=>{c(!0)}),[c]),Ce=r.useCallback((()=>{ue(void 0)}),[ue]);return r.useMemo((()=>{if(be&&!P&&K)return{aiAgentName:Kc,headline:$c,subheadline:Gc,promptChips:Ae,composer:{currentInput:ge,isSubmitting:se,isFileUploadEnabled:W,onInputChange:De,onSubmit:Se,onStopSubmit:ee},onPromptClick:oe,onOpenSidePanel:ve,onOpenFullView:Ce,dataTestIdPrefix:"card-policy-ai-cfo-hero"}}),[ge,P,be,K,W,se,De,Ce,ve,oe,ee,Se,Ae])})({hasAnyPolicies:R,isChargeCardAdmin:g,isFileUploadEnabled:F}),f=w&&i!=null?o.jsx(Sr,{...i}):null,j=p&&f==null,G=r.useCallback((()=>{const v=we(a.state?.pathnameStackToGoBack),P=v.poppedPathname??"..";e(P,{state:{pathnameStackToGoBack:v.newStack}})}),[a.state,e]),U=r.useCallback((()=>{n!=null&&e(`/${n}/cards/policy/new`)}),[e,n]),x=r.useCallback((v=>{n!=null&&e(`/${n}/cards/policy/${v}/edit`)}),[e,n]),z=r.useCallback((v=>{t(Ts(v))}),[t]),H=B.fetchState.fetchState;return!R&&H!=="Completed"&&H!=="Error"?o.jsxs(o.Fragment,{children:[o.jsx(Ee,{isAppContentDrawerOpen:b,handleDrawerToggle:A}),o.jsx(tc,{onBackClick:G,onNewPolicyClick:U,onClickMenuIcon:u,isAiCfoAccessEnabled:p,onAskAiCfoClick:T})]}):o.jsxs(o.Fragment,{children:[o.jsx(Ee,{isAppContentDrawerOpen:b,handleDrawerToggle:A}),o.jsx(nc,{policies:y,archivingTemplateId:B.archiveTargetTemplateId,pendingCreationCount:L,onBackClick:G,onNewPolicyClick:U,onEditPolicyClick:x,onArchivePolicyClick:z,onClickMenuIcon:u,policyAiCfoHero:f,isAiCfoAccessEnabled:j,onAskAiCfoClick:T})]})}function Zc(){const e=de(),{cardId:a}=Ne(),n=me(),t=te.getSignedInUser(),s=d((X=>fe(X))),g=Be(),b=Te(g?.loggedInUserRoleMap),{useFeatureGate:h}=le();if(t==null)throw Error("Can't access Add To Wallet Page without signing in...");const[A,u]=r.useState(!1),m=d((X=>qa(X).firstViewAfterActivation));if(a==null)throw Error("Empty card id is not valid...");const F=s.userRole.includes("charge_card_user"),{isFeatureEnabled:w}=h(Z.isChargeCardFeatureEnabled),p=!!s.companyChargeCardInfo?.info?.isChargeCardEnabled,{isFeatureEnabled:T}=h(Z.isDebitCardFeatureEnabled),B=Fe(s),S=xe(s),l=Le(T,s),C=s.companyChargeCardInfo?.info?.chargeCardsCreditAccountLimit??0,L=Re({isDebitCardFeatureEnabled:T,isBankingOnlyTenant:l}),k=Oe({isCardsOnlyTenant:B,isChargeCardFeatureEnabled:w,isBookKeepingTenant:S,isDebitCardProductVisible:L,chargeCardsCreditAccountLimit:C}),_=!!s.companyDebitCardInfo?.info?.isDebitCardEnabled,D=d((X=>da(X,s.companyId))),M=la(D.controllers),{creditAccount:E,creditAccountRepayment:y}=d((X=>ua(X))),R=d((X=>X.classListState.fetchState)),i=!F&&k&&p,f=d((X=>vt(X,a,i,k))),[j,G]=r.useState(!1),U=f.chargeCard,x=U?.cardCreatedByUser?.userId,z=d((X=>x!=null?Ga(X.userRoleState,x):void 0)),H=z?.accountingClassIDs[0],v=d((X=>H!=null?Ka(X.classState,{classId:H,reportId:"class_list"}):void 0)),P=U?.cardHolderUser?.userId,K=d((X=>P!=null?Ga(X.userRoleState,P):void 0)),W=K?.accountingClassIDs[0],I=d((X=>W!=null?Ka(X.classState,{classId:W,reportId:"class_list"}):void 0)),N=U?.type.code==="business_physical_credit_card"||U?.type.code==="business_physical_debit_card",V=U?.type.code==="business_physical_debit_card";r.useEffect((()=>{m&&A===!1&&N&&(u(!0),setTimeout((()=>{n(za()),V&&n(ze({messageSection:"set_debit_card_pin",messageText:"success",type:"success",showStatusIcon:!0}))}),5e3))}),[m,A,N,V]),r.useEffect((()=>{j||f.fetchState==="Completed"||f.fetchState==="In-Progress"||a==null||(G(!0),n(ka(a,i,!1)))}),[j,f,a,n]),r.useEffect((()=>{if(f.fetchState==="Completed"&&(N===!1||N&&U?.status?.code!=="active"||U?.cardHolderUserId!==t.userId||m===!1&&A===!1||U?.type.code==="business_physical_debit_card"||U?.type.code==="business_virtual_debit_card")){const X=_e(s.tenantEmailDomain,a,t,U,m);e(X)}}),[f.fetchState,m,N]),r.useEffect((()=>{E.fetchState!=="Completed"&&E.fetchState!=="In-Progress"&&k&&p&&b&&n(qe()),y.fetchState!=="Completed"&&y.fetchState!=="In-Progress"&&k&&p&&b&&n(Tt()),R!=="Completed"&&R!=="In-Progress"&&n(Vn())}),[E.fetchState,y.fetchState,n,k,p,b,R]);const Q=()=>{if(t!=null&&a!=null){n(za());const X=_e(s.tenantEmailDomain,a,t);e(X)}},c=U?.type.code==="business_physical_debit_card"||U?.type.code==="business_virtual_debit_card",O=Xe(k,L,_,p),q=La(k,p,b,E,y),se=Dr(c,f);return f.fetchState!=="Completed"?o.jsx(va,{fetchState:"In-Progress"}):o.jsxs(o.Fragment,{children:[o.jsx(nt,{showConfetti:m}),o.jsx(rc,{onGotItClick:Q,isDebitCard:U?.type.code==="business_physical_debit_card",controllerEmails:M,isChargeCardFeatureEnabled:k,isDebitCardFeatureEnabled:L,isDebitCardSetupEnabled:_,isChargeCardSetupEnabled:p,productInformation:O,creditAccountInformation:q,debitAccountInformation:se,chargeCardDetailView:f,creditAccount:E,classListFetchState:R,creditAccountRepayment:y,cardIssuedByRoles:z?.userRoles,cardIssuedByDepartmentName:v?.className,cardHolderRoles:K?.userRoles,cardHolderDepartmentName:I?.className})]})}const Br="charge-card-transaction-update",Rr="charge-card-transaction-created",Or="charge-card-transaction-declined",Ur="charge-card-transaction-updated",jr="charge-card-transaction-receipt-uploaded",pa="charge-card-status-update",Ht="charge-card-spending-updated",ct="credit-account-balance-updated",it="charge-card-created",$t="charge-card-limit-updated",Gt="charge-card-limit-reset",Kt="charge-card-renamed",Wc="charge-card-department-updated",Mr="charge-card-repayment-completed",Nr="charge-card-payment-date-updated",Ba="charge-card-cashback-redeemed",Ra="charge-card-cashback-earned",ha=(e,a)=>e==null||e===""?[]:a.map((n=>`private-encrypted-${e}.${n}`)),qc=[Ra,Ba],Jc=Pe((function(e){const a=ma(e);return{insightsData:a.insight,cashbackByPeriod:a.cashbackByPeriod,uiState:a.uiState,cashbackSummary:a.cashbackSummary}}),(function(e){return{onColumnSortConfigChanged:(a,n)=>{e(Fs({uiState:{sortKey:a,sortOrder:n}}))}}}))(oc);function Qc(){const e=de(),a=me(),n=he(),t=te.getSignedInUser(),s=d((T=>fe(T))),{useFeatureGate:g}=le(),{isFeatureEnabled:b}=g(Z.isCardsCommentingEnabled),[h,A]=r.useState(!1),u=d((T=>ma(T))),m=vr(s.companyId,{clearParams:u.fetchState==="Completed"}),F=r.useCallback((()=>{const T=we(n.state?.pathnameStackToGoBack),B=T.poppedPathname??Xc(s.tenantEmailDomain);e(B,{state:{pathnameStackToGoBack:T.newStack}})}),[e,n,s.tenantEmailDomain]),w=aa(s);if(Vt({events:ha(w,qc),onEvent:T=>{switch(T){case Ra:case Ba:return void a(_a(!0))}},onSubscribed:()=>{a(_a(!0))}}),r.useEffect((()=>{h||u.fetchState==="Completed"||u.fetchState==="In-Progress"||(A(!0),a(_a()))}),[h,u,a]),t==null)throw Error("Can't access cashback detail page without signing in...");const p=u.cashbackSummary?.cashbackEarned?.amount!=null&&u.fetchState!=="Not-Started";return u.fetchState!=="In-Progress"||p?(u.cashbackSummary?.cashbackEarned?.amount??0)===0&&u.fetchState==="Completed"?o.jsx(ot,{}):o.jsx(Jc,{onBackClick:F,isCardsCommentingEnabled:b,initialOpenThreadRequest:m}):o.jsx(sc,{onBackClick:F})}const Xc=e=>`/${e}/cards`,ei={containerWidth:new Fa(100,58)},ai=({appContent:e})=>{const a=Ta(),n=me(),t=de(),{cardId:s}=Ne(),g=he(),{useDynamicConfig:b}=le(),[h,A]=r.useState(!1),[u,m]=r.useState(!1),[F,w]=r.useState(!1),[p,T]=r.useState(!1),B=te.getSignedInUser();if(B==null)throw Error("Can't access onboarding card page without signing in...");const S=d((I=>fe(I)));if(s==null)throw Error("Empty card id is not valid...");const{configValue:l}=b(Qe.zeniCardsConfig),C=l.max_charge_card_activation_attempts_by_card_id,L=d((I=>xs(I,s))),k=L.chargeCard,_=d((I=>I.chargeCardConfigState.fetchState)),{useFeatureGate:D}=le(),{isFeatureEnabled:M}=D(Z.isChargeCardFeatureEnabled),{isFeatureEnabled:E}=D(Z.isDebitCardFeatureEnabled),y=Le(E,S),R=Re({isDebitCardFeatureEnabled:E,isBankingOnlyTenant:y}),i=!!S.companyChargeCardInfo?.info?.isChargeCardEnabled,f=S.userRole.includes("charge_card_user"),j=Fe(S),G=xe(S),U=S.companyChargeCardInfo?.info?.chargeCardsCreditAccountLimit??0,x=Oe({isCardsOnlyTenant:j,isChargeCardFeatureEnabled:M,isBookKeepingTenant:G,isDebitCardProductVisible:R,chargeCardsCreditAccountLimit:U}),z=!f&&x&&i;r.useEffect((()=>{h===!1&&_!=="In-Progress"&&_!=="Completed"&&(n(Ja()),A(!0)),u===!1&&L.fetchState==="Not-Started"&&(m(!0),n(ka(s,z,x)))}),[u,L.fetchState,h,_]);const H=k?.type.code==="business_physical_credit_card"||k?.type.code==="business_physical_debit_card";r.useEffect((()=>{if(L.fetchState==="Completed"){if(F===!1&&(H===!1||H&&k?.status?.code!=="inactive"||k?.cardHolderUserId!==B.userId)){const I=_e(S.tenantEmailDomain,s,B,k,!0),N=ke(g.state?.pathnameStackToGoBack,g.pathname);t(I,{state:{pathnameStackToGoBack:N}})}else if(F&&L.isRefreshingViewInBackground===!1&&k?.status?.code==="active"){n(Ls({chargeCardId:s}));const I=_e(S.tenantEmailDomain,s,B,k,!0),N=ke(g.state?.pathnameStackToGoBack,g.pathname);n(Qa()),t(I,{state:{pathnameStackToGoBack:N}})}}}),[L.fetchState,k?.type.code,F,L.isRefreshingViewInBackground]);const v=te.getZeniOtpTokenForCardHolder(s),P=d((I=>Hn(I.userState,B.userId))),K=()=>{k?.status?.code!=="active"&&n(ba(s,!0))};r.useEffect((()=>{L.updatePhysicalChargeCardAttemptFetchState.fetchState==="Completed"&&k?.cardActivationAttemptHistory.some((I=>I.statusCode==="success"))===!0&&F===!1&&(setTimeout(K,3e3),w(!0))}),[L.updatePhysicalChargeCardAttemptFetchState.fetchState,k?.cardActivationAttemptHistory]);const W=I=>{T(I)};if(_!=="Completed"||k==null)return o.jsx(va,{fetchState:"In-Progress"});if(k.shippingAddressId==null)throw Error("Can't access shippingAddressId.");if(P?.phone==null)throw Error("Can't access user phone number.");return o.jsxs(ri,{children:[o.jsx(Ee,{isAppContentDrawerOpen:p,handleDrawerToggle:W}),o.jsx(ti,{cardId:s,card:k,shippingAddressId:k.shippingAddressId,phone:P.phone,signedInUser:B,isSandboxEnv:Rt(),chargeCardDetailState:L,signedInUserToken:v,navigate:t,currentTenant:S,location:g,maxChargeCardActivationAttempts:C[s]!=null?C[s]:l.default_max_charge_card_activation_attempts!=null?l.default_max_charge_card_activation_attempts:3,chargeCardCashbackRatePerTransaction:l.charge_card_cashback_rate_per_transaction!=null?l.charge_card_cashback_rate_per_transaction:.0175,onClickMenuIcon:()=>{W(!0)}}),e!=null?o.jsx(ni,{windowSize:a,children:e}):null]})},ti=Pe((function(e,{chargeCardDetailState:a,shippingAddressId:n,location:t,cardId:s}){const g=Bs(e.addressState,n);if(g==null)throw Error("Can't access shippingAddress.");const b=$n(e,s),h=a.updateStatus,A=Ca(e,!1,!1,!1);let u=!1;A.fetchState==="Completed"&&A.cards.length<=1&&(u=!0);const m=t.state?.message==="comingFromV2UrlPath";return{showActivatePage:a.chargeCard?.providerCardCreateTime!=null&&a.chargeCard.providerCardCreateTime.add(24,"h").isBefore(Rs())||m,showMenuIcon:u,shippingAddress:g,vgsVaultId:rt.cardVaultId,twoFAView:b,activationWaitStatus:h,isRefreshingViewInBackground:a.isRefreshingViewInBackground}}),(function(e,a){const{navigate:n,cardId:t,location:s,currentTenant:g,chargeCardDetailState:b}=a,h=b.chargeCard?.cardProviderID,{tenantEmailDomain:A}=g;return{onGetOtp:u=>{h!=null&&e(at(u,"ChargeCardHolder",t))},onUpdatePhysicalChargeCardAttempt:u=>{e(Us(t,u))},onResendOtp:u=>{h!=null&&e(et(u,"ChargeCardHolder",t))},onVerifyOtp:(u,m)=>{h!=null&&e(Xa(u,m,"ChargeCardHolder",t))},onVerifyOtpSuccess:u=>{u!=null&&te.saveZeniOtpTokenForCardHolder(u,t)},onCVVActivateSuccess:()=>{e(Os({chargeCardId:t}))},onBackClick:()=>{const u=we(s.state?.pathnameStackToGoBack),m=u.poppedPathname==null||u.poppedPathname.includes("onboard")===!0?ta(A):u.poppedPathname;n(m,{state:{pathnameStackToGoBack:u.newStack}})}}}))(cc),ni=Ve.div`
2
- display: flex;
3
- flex-direction: column;
4
- width: ${e=>`${ei.containerWidth.value(e.windowSize)}%`};
5
- ${e=>e.windowSize!=="small"?"overflow: auto;":""}
6
- `,ri=Ve.div`
7
- display: flex;
8
- min-height: 100%;
9
- width: 100%;
10
- flex: 1 1 auto;
11
- flex-direction: column;
12
- align-items: center;
13
- background-color: ${e=>e.theme.colors.grey4};
14
- `,Za=ea.getLocalizedStrings().dateFormat,si={overlayWidth:new Fa(100,100,58)},Vr=[Mr,ct],oi=new Set(Vr),ci=Pe((function(e,a){const n=a.currentTenant?.companyId;return{plaidConnectionDetails:Ns(e,n,"zeni_accounts","external_account").plaidConnectionDetails,depositAccountListView:Vs(e.depositAccountState,e.depositAccountListState)}}),(function(e,a){const{navigate:n,currentTenant:t,isCashbackInfoFetchStateCompleted:s,isCreditCardInfoFetchStateCompleted:g,isDebitCardInfoFetchStateCompleted:b,controllerEmails:h,paymentDetails:A,productInformation:u,cashbackInformation:m,paymentSourceInformation:F,creditAccountInformation:w,debitAccountInformation:p,paymentInitiatedDate:T,sourcePage:B}=a,{tenantEmailDomain:S}=t,l=()=>{e(zn(!0));const C=aa(t);C!=null&&C!==""&&e(Pa(C,!0,!0)),e(qe(!0))};return{onBackNavigation:()=>{if(s&&g&&b&&m!=null&&ae.trackCardsPayEarlyFormClick(h,u,m,"Back",A.chargeCardRepaymentDetailLocalData.isAutoRepayment,{paymentAmount:A.chargeCardRepaymentDetailLocalData.amount.amount,paymentAccountName:A.chargeCardRepaymentDetailLocalData.transferFrom?.label,paymentAccountType:A.chargeCardRepaymentDetailLocalData.transferFrom?.accType,paymentAccountLastFourDigits:A.chargeCardRepaymentDetailLocalData.transferFrom?.accountLast4,paymentCompleteEta:T?.add(3,"day").format(Za.visual.MMMDCommaYYYYformat),paymentInitiatedDate:T?.format(Za.visual.MMMDCommaYYYYformat)},F,w,p),B==="cardPaymentHistory")a.closeDrawerHandler(!0),e(Yn());else{const C=ta(S);n(C)}},onUpdatePaymentAccountStatus:(C,L,k)=>{e(Gs(C,L,"bill_pay","bill_pay_detail",k))},onEstablishConnectionSuccess:()=>{e(Pa(t.companyId,!0))},onFetchLinkTokenClick:C=>{e($s("external_account",C))},onEstablishConnectionClick:C=>{e(Hs(C,t.companyId,"charge_card_payment","charge_cards"))},onEventReceived:C=>{oi.has(C)&&l()},onPusherSubscribed:l}}))(st(ic)),zt=({isPaymentDrawerOpen:e,closeDrawerHandler:a,pageName:n,creditAccountSpentAmount:t,productInformation:s,sourcePage:g,creditAccountInformation:b,debitAccountInformation:h,cashbackInformation:A,isDebitCardInfoFetchStateCompleted:u,isCreditCardInfoFetchStateCompleted:m,isCashbackInfoFetchStateCompleted:F,paymentInitiatedDate:w,retryRepayment:p})=>{const T=de(),{useDynamicConfig:B}=le(),S=d((V=>Gn(V))),{creditAccount:l}=d((V=>ua(V))),C=d((V=>fe(V))),L=Ot(),k=Ta(),_=me(),D=te.getSignedInUser(),M=Be(),[E,y]=r.useState(!1),[R,i]=r.useState(!1),{configValue:f}=B(Qe.zeniCardsConfig),j=f.credit_card_auto_pay_threshold_by_company_id?.[C.companyId]??f.default_credit_card_auto_pay_threshold??Tc,G=Kn(M?.loggedInUserRoleMap),U=js(M?.loggedInUserRoleMap),x=d((V=>wa(V,C.companyId))),z=x.companyChargeCardInfo?.primaryFundingAccount,H=x.allFundingAccounts.find((V=>V.id===z?.accountId)),v=d((V=>da(V,C.companyId))),P=la(v.controllers);r.useEffect((()=>{if(S.fetchState!=="Completed"&&S.fetchState!=="In-Progress"&&_(zn()),S.fetchState==="Completed"&&!R){const V=C.companyChargeCardInfo?.info?.primaryFundingAccount?.accountId,Q=S.transferFromAccounts.find((O=>O.id===V));let c;if(g==="cardPaymentHistory"&&p){const O=p.paymentAccountId!=null?S.transferFromAccounts.find((q=>q.id===p.paymentAccountId)):void 0;c={amount:p.amount,isAutoRepayment:C.companyChargeCardInfo?.info?.isAutoPayEnabled??!1,idempotencyKey:yn(),transferFrom:O??Q}}else c={amount:{amount:l.balance.amount+l.hold.amount,currencyCode:l.balance.currencyCode,currencySymbol:l.balance.currencySymbol},isAutoRepayment:C.companyChargeCardInfo?.info?.isAutoPayEnabled??!1,idempotencyKey:yn(),transferFrom:Q};_(gn(c)),i(!0)}}),[S.fetchState,R,g,p,S.transferFromAccounts,C.companyChargeCardInfo?.info?.primaryFundingAccount?.accountId,C.companyChargeCardInfo?.info?.isAutoPayEnabled,l.balance.amount,l.balance.currencyCode,l.balance.currencySymbol,l.hold.amount,_]);const K={isZeniCheckingEnabled:C.companyZeniAccountInfo?.info?.isZeniAccountEnabled??!1,isZeniCheckingPaymentSource:H?.accType==="depositAccount",creditCardPaymentSourceAccountName:H?.label,creditCardPaymentSourceAccountType:H?.accType,creditCardPaymentSourceLastFourDigits:H?.accountLast4,creditCardPaymentSourceBalance:H?.accountBalance?.available?.amount??0};if(r.useEffect((()=>{x.fetchState!=="Completed"&&x.fetchState!=="In-Progress"&&_(Pa(C.companyId,!0))}),[x.fetchState]),r.useEffect((()=>{S.updateStatus==="Completed"&&A!=null&&F&&m&&u&&ae.trackCardsPayEarlyPayNowClick(P,s,A,S.chargeCardRepaymentDetailLocalData.isAutoRepayment,{paymentAmount:S.chargeCardRepaymentDetailLocalData.amount.amount,paymentAccountName:S.chargeCardRepaymentDetailLocalData.transferFrom?.label,paymentAccountType:S.chargeCardRepaymentDetailLocalData.transferFrom?.accType,paymentAccountLastFourDigits:S.chargeCardRepaymentDetailLocalData.transferFrom?.accountLast4,paymentCompleteEta:w?.add(3,"day").format(Za.visual.MMMDCommaYYYYformat),paymentInitiatedDate:w?.format(Za.visual.MMMDCommaYYYYformat)},K,b,h)}),[S.updateStatus,A,F,m,u,w]),r.useEffect((()=>{S.fetchState==="Completed"&&A!=null&&F&&m&&u&&!E&&e&&R&&A!=null&&(ae.trackCardsPayEarlyFormView(P,s,A,n,C.companyChargeCardInfo?.info?.isAutoPayEnabled??!1,l.balance.amount,K,b,h),y(!0))}),[S,F,m,u,E,e,R]),D==null)throw Error("Can't access invite people page without signing in...");const W=()=>{a(!0),_(Yn())},I=aa(C),N={events:e?ha(I,Vr):[],eventCallback:(V,Q,c)=>{c.onEventReceived(V)},onSubscribed:V=>{V.onPusherSubscribed()}};return o.jsx(o.Fragment,{children:o.jsx(Ar,{onClose:()=>{W()},anchor:"right",transitionDuration:250,open:e,PaperProps:{style:{width:si.overlayWidth.valuePercentage(k),boxShadow:"none"}},slotProps:{backdrop:{style:{backgroundColor:L.colors.black,opacity:.75,cursor:"pointer"}}},children:o.jsx(ii,{onClick:V=>V.stopPropagation(),children:o.jsx(ci,{...N,closeDrawerHandler:a,navigate:T,paymentDetails:S,creditAccountSpentAmount:t,onTransferClick:()=>{F&&m&&u&&A!=null&&ae.trackCardsPayEarlyFormClick(P,s,A,"Pay Now",S.chargeCardRepaymentDetailLocalData.isAutoRepayment,{paymentAmount:S.chargeCardRepaymentDetailLocalData.amount.amount,paymentAccountName:S.chargeCardRepaymentDetailLocalData.transferFrom?.label,paymentAccountType:S.chargeCardRepaymentDetailLocalData.transferFrom?.accType,paymentAccountLastFourDigits:S.chargeCardRepaymentDetailLocalData.transferFrom?.accountLast4,paymentCompleteEta:void 0,paymentInitiatedDate:void 0},K,b,h),_(Ms({companyId:C.companyId}))},onDismissClick:W,onSaveChangesToLocalStore:V=>{_(gn(V))},currentTenant:C,hasZeniAccountsAdminAccess:G,isZeniAccountsUser:U,productInformation:s,sourcePage:g,controllerEmails:P,autoPayThreshold:j,paymentSourceInformation:K,creditAccountInformation:b,debitAccountInformation:h,cashbackInformation:A,isCashbackInfoFetchStateCompleted:F,isCreditCardInfoFetchStateCompleted:m,isDebitCardInfoFetchStateCompleted:u,paymentInitiatedDate:w})})})})},ii=Ve(vc)`
15
- display: flex;
16
- min-height: 100%;
17
- flex-direction: column;
18
- `,Yt=e=>e!=null&&typeof e=="object"?e:null,ie=e=>typeof e=="string"?e:void 0,je=e=>typeof e=="number"&&Number.isFinite(e)?e:void 0,Wa=e=>e!=null&&typeof e=="object"&&typeof e.code=="string"&&typeof e.name=="string",gt=e=>{if(e==null||typeof e!="object")return!1;const a=e;return typeof a.transaction_id=="string"&&typeof a.amount=="number"&&typeof a.currency_code=="string"&&typeof a.currency_symbol=="string"&&typeof a.direction=="string"&&!!Wa(a.transaction_status)&&!!Wa(a.transaction_type)},Zt=(e,a)=>{const n=e?.card_status;if(!Wa(n))return null;const t=e?.is_locked_by_admin;return{cardId:a,cardStatus:n,isLockedByAdmin:typeof t=="boolean"?t:void 0}},At=[Br,Rr,Or,Ur,jr,pa,Ht,ct,$t,Gt,Kt],Hr=[Ra,Ba],di=new Set([...At,...Hr]),bt=ea.getLocalizedStrings().dateFormat,li=Pe((function(e,a){const{includeCreditAccountInfo:n,cardId:t,signedInUserToken:s,isChargeCardFeatureEnabled:g}=a,b=te.getSignedInUser(),h=e.tenantState.currentTenantId,A={userId:b?.userId??"",sessionId:b?.zeniSessionId??"",tenantId:h??""},u=vt(e,t,n,g),m=Xs(e,t),F=eo(e);return{chargeCardDetailView:u,chargeCardsRecurringExpensesState:m,vgsVaultId:rt.cardVaultId,transactionAttachmentsEndpointToFetch:`${Et}/card_transaction_attachments`,transactionAttachmentEndpointToDownload:`${Et}/card_transaction_attachment`,authParams:A,isSnackbarOpen:F.isSnackbarOpen,cardsEndPoint:`${yr.cardMicroServiceBaseUrl}`,signedInUserToken:u.twoFAView.token??s,receiptsEmail:Wn(e.tenantState,h)}}),(function(e,a){const{cardId:n,currentTenant:t,navigate:s,location:g,cardProviderId:b,includeCreditAccountInfo:h,setIsPaymentOpen:A,controllerEmails:u,productInformation:m,cashbackInformation:F,primaryFundingAccountDetails:w,creditAccountInformation:p,debitAccountInformation:T,isChargeCardFeatureEnabled:B}=a,{tenantEmailDomain:S}=t;return{onEventReceived:(l,C)=>{(({event:L,data:k,cardId:_,dispatch:D,subscribedEvents:M})=>{const E=Yt(k);switch(L){case Ra:case Ba:return void D(_a(!0));case Br:{const y=ie(E?.card_id);if(y==null||y!==_)return;const R=ie(E?.transaction_id),i=E?.transaction_status;return R!=null&&Wa(i)?void D(Js({transactionId:R,transactionStatus:i})):void D(oa(_,null,null,!0))}case pa:{const y=ie(E?.card_id)??_;if(y!==_)return;const R=Zt(E,y);return R!=null?void D(Ft(R)):void D(ba(_,!0))}case Ht:{const y=ie(E?.card_id)??_;if(y!==_)return;const R=ie(E?.currency_code),i=ie(E?.currency_symbol),f=je(E?.balance);return R!=null&&i!=null&&f!=null?(D(qs({cardId:y,currencyCode:R,currencySymbol:i,balance:f,hold:je(E?.hold),dailyPurchaseSpends:je(E?.daily_purchase_spends),monthlyPurchaseSpends:je(E?.monthly_purchase_spends),dailyWithdrawals:je(E?.daily_withdrawals),monthlyWithdrawals:je(E?.monthly_withdrawals)})),void D(qe(!0))):(D(ba(_,!0)),void D(qe(!0)))}case ct:{const y=ie(E?.currency_code),R=ie(E?.currency_symbol),i=je(E?.available_amount),f=je(E?.balance_amount);return y!=null&&R!=null&&i!=null&&f!=null?void D(Ws({currencyCode:y,currencySymbol:R,available:i,balance:f,hold:je(E?.hold_amount),cashback:je(E?.cashback_amount)})):void D(qe(!0))}case Rr:{const y=ie(E?.card_id)??_;if(y!==_)return;const R=E?.transaction;return gt(R)?void D(Zs({cardId:y,transaction:R})):void D(oa(_,null,null,!0))}case Or:{const y=ie(E?.card_id)??_;if(y!==_)return;const R=E?.transaction;return gt(R)?void D(Ys({cardId:y,declineReason:ie(E?.decline_reason),transaction:R})):void D(oa(_,null,null,!0))}case Ur:{const y=ie(E?.card_id)??_;if(y!==_)return;const R=E?.transaction;return gt(R)?void D(zs({cardId:y,transaction:R})):void D(oa(_,null,null,!0))}case jr:{const y=ie(E?.card_id)??_;if(y!==_)return;const R=ie(E?.transaction_id),i=E?.attachment_file_paths;return R!=null&&Array.isArray(i)&&i.every((f=>typeof f=="string"))?void D(Ks({cardId:y,transactionId:R,attachmentFilePaths:i})):void D(oa(_,null,null,!0))}case $t:case Gt:case Kt:{const y=ie(E?.card_id);if(y==null||y!==_)return;D(ba(_,!0))}}})({event:l,data:C,cardId:n,dispatch:e,subscribedEvents:di})},onPusherSubscribed:()=>{e(ba(n,!0)),e(oa(n,null,null,!0)),e(qe(!0))},onReloadTransactions:()=>{e(ka(n,h,B))},onFetchChargeCardTransactionList:(l,C)=>{e(oa(n,l,C))},onUpdateScrollYOffset:l=>{},onGetOtp:l=>{b!=null&&e(at(l,"ChargeCardHolder",n))},onResendOtp:l=>{b!=null&&e(et(l,"ChargeCardHolder",n))},onVerifyOtp:(l,C)=>{b!=null&&e(Xa(l,C,"ChargeCardHolder",n))},onVerifyOtpSuccess:l=>{l!=null&&te.saveZeniOtpTokenForCardHolder(l,n)},onColorCodeChange:l=>{e(oo(n,l))},onLockChargeCard:(l,C)=>{e(nr(l,n,C))},onUnlockChargeCard:l=>{e(tr(l,n))},onCloseChargeCard:l=>{e(ar(n,l))},onFetchChargeCardsRecurringExpenses:()=>{e(er([n]))},updateChargeCardName:(l,C)=>{e(Xn(l,n,C))},updateChargeCardTransactionAttachments:(l,C)=>{C!=null&&e(so({transactionId:l,data:C}))},updateChargeCardTransactionUploadReceiptsFetchStatus:(l,C,L,k)=>{e(ro({chargeCardId:C,transactionId:l,fetchState:L,error:k}))},updateChargeCardTransactionReceiptsShowTick:(l,C,L)=>{e(no({chargeCardId:C,transactionId:l,shouldShowTick:L}))},onChargeCardRevokeInviteClick:()=>{e(Qn(n))},updateChargeCardTransactionIsViewReceiptClicked:(l,C,L)=>{e(to({chargeCardId:C,transactionId:l,isViewReceiptClicked:L}))},onChargeCardTransactionRowClick:(l,C)=>{const L=ke(g.state?.pathnameStackToGoBack,g.pathname);s(`../../transaction/${l}/${C}`,{state:{pathnameStackToGoBack:L}})},onBackClick:()=>{const l=we(g.state?.pathnameStackToGoBack),C=ta(S);s(C,{state:{pathnameStackToGoBack:l.newStack,message:"comingFromCardDetail"}})},removeSnackbar:()=>{e(ao())},onUpdateDebitCardPinAttempt:l=>{e(Jn(n,l)),l==="success"&&e(ze({messageSection:"update_debit_card_pin_attempt",messageText:"success",type:"success",showStatusIcon:!0}))},onUploadReceiptComplete:(l,C)=>{l?e(ze({messageSection:"charge_card_receipt_upload",messageText:"success",type:"success",showStatusIcon:!0})):C!=null&&e(ze({messageSection:"charge_card_receipt_upload",messageText:"failed",type:"error",showStatusIcon:!0,variables:[{variableName:"_api-error_",variableValue:C.message}]}))},updateSpendLimit(l,C,L,k){e(qn(l,C,L.code,k))},shouldOpenCreditCardPaymentDrawer(l){l&&F!=null&&ae.trackCardsPayEarlyClick(u,m,F,"Card Detail","Text Button","Pay Now",{isZeniCheckingEnabled:t.company?.companyZeniAccountInfo.isZeniAccountEnabled??!1,isZeniCheckingPaymentSource:w?.accType==="depositAccount",creditCardPaymentSourceAccountName:w?.label,creditCardPaymentSourceAccountType:w?.accType,creditCardPaymentSourceLastFourDigits:w?.accountLast4,creditCardPaymentSourceBalance:w?.accountBalance?.available?.amount??0},p,T),A(l)}}}))(st(lc));function ui(){const e=de(),a=me(),n=he(),{cardId:t}=Ne(),[s,g]=r.useState(!1),[b,h]=r.useState(!1),{useDynamicConfig:A}=le(),u=te.getSignedInUser(),m=d((Y=>fe(Y))),F=d((Y=>qa(Y).firstViewAfterActivation)),w=d((Y=>Y.classListState.fetchState)),{configValue:p}=A(Qe.documentAiReceiptMaxSizeLimitBytesConfig),{configValue:T}=A(Qe.zeniCardsConfig),B=T.enable_card_controls_for_company_ids,S=T.is_card_controls_enabled_for_all_tenants===!0||Array.isArray(B)&&B.includes(m.companyId),[l,C]=r.useState(!1),[L,k]=r.useState(!1),{useFeatureGate:_}=le(),{isFeatureEnabled:D}=_(Z.isChargeCardFeatureEnabled),{isFeatureEnabled:M}=_(Z.isDebitCardFeatureEnabled),E=Le(M,m),y=Re({isDebitCardFeatureEnabled:M,isBankingOnlyTenant:E}),{isFeatureEnabled:R}=_(Z.isEarlyPayFeatureEnabled),{isFeatureEnabled:i}=_(Z.isCardsCommentingEnabled),f=xe(m),j=Fe(m),G=m.companyChargeCardInfo?.info?.chargeCardsCreditAccountLimit??0,U=Oe({isCardsOnlyTenant:j,isChargeCardFeatureEnabled:D,isBookKeepingTenant:f,isDebitCardProductVisible:y,chargeCardsCreditAccountLimit:G}),x=!!m.companyDebitCardInfo?.info?.isDebitCardEnabled,z=!!m.companyChargeCardInfo?.info?.isChargeCardEnabled,H=!m.userRole.includes("charge_card_user")&&U&&z;if(t==null)throw Error("Empty card id is not valid...");const v=d((Y=>wa(Y,m.companyId))),{creditAccount:P,creditAccountRepayment:K}=d((Y=>ua(Y))),W=te.getZeniOtpTokenForCardHolder(t),I=d((Y=>vt(Y,t,H,U))),{isAiCfoAccessEnabled:N,onAskAiCfoClick:V}=xa({mobileExploreReferrer:"Card Detail"});Bt({isDataReady:I.fetchState==="Completed"});const Q=d((Y=>ma(Y))),c=I.chargeCard,O=Be(),q=Te(O?.loggedInUserRoleMap),se=c?.type.code==="business_physical_debit_card"||c?.type.code==="business_virtual_debit_card",X=c?.type.code==="business_physical_debit_card"||c?.type.code==="business_physical_credit_card",He=c?.type.code==="business_virtual_debit_card"||c?.type.code==="business_virtual_credit_card",Ae=c?.type.code==="business_virtual_debit_card",ge=La(U,z,q,P,K),re=Dr(se,I),be=Mt(q,Q),ue=Xe(U,y,x,z),oe=I.depositAccountLimitFetchState.fetchState!=="Completed"&&I.depositAccountLimitFetchState.fetchState!=="In-Progress",Se=d((Y=>da(Y,m.companyId))),ee=la(Se.controllers),De=d((Y=>c?.cardCreatedByUser?.userId!=null?Ga(Y.userRoleState,c?.cardCreatedByUser?.userId):void 0)),ve=d((Y=>De?.accountingClassIDs[0]!=null?Ka(Y.classState,{classId:De?.accountingClassIDs[0],reportId:"class_list"}):void 0)),Ce=d((Y=>c?.cardHolderUser?.userId!=null?Ga(Y.userRoleState,c?.cardHolderUser?.userId):void 0)),J=d((Y=>Ce?.accountingClassIDs[0]!=null?Ka(Y.classState,{classId:Ce?.accountingClassIDs[0],reportId:"class_list"}):void 0)),fa=m?.userRole,na=d((Y=>Ca(Y,!1,y,D).revokeCardInvite)),Oa=ya(na.saveStatus.fetchState);if(r.useEffect((()=>{if(Oa==="In-Progress"&&na.saveStatus.fetchState==="Completed"){const Y=ta(m.tenantEmailDomain);e(Y)}}),[Oa,na.saveStatus.fetchState,e,m.tenantEmailDomain]),r.useEffect((()=>{F&&s===!1&&He&&(g(!0),setTimeout((()=>{a(za()),Ae&&a(ze({messageSection:"set_debit_card_pin",messageText:"success",type:"success",showStatusIcon:!0}))}),5e3))}),[F,s,He,Ae]),r.useEffect((()=>{l||I.fetchState==="Completed"||I.fetchState==="In-Progress"||t==null||(C(!0),a(ka(t,H,U,!1)))}),[l,I,t,a]),r.useEffect((()=>{!L&&I.fetchState==="Completed"&&I.chargeCard?.connectedAccountId!=null&&se&&oe&&q&&(k(!0),a(Zn({depositAccountId:I.chargeCard?.connectedAccountId})))}),[L,I,a,oe,q]),r.useEffect((()=>{Q.fetchState!=="Completed"&&Q.fetchState!=="In-Progress"&&q&&a(_a()),w!=="Completed"&&w!=="In-Progress"&&a(Vn()),I.transactionStatistics.fetchState!=="Completed"&&I.transactionStatistics.fetchState!=="In-Progress"&&a(Qs({chargeCardId:t})),v.fetchState!=="Completed"&&v.fetchState!=="In-Progress"&&a(Pa(m.companyId,!0))}),[Q.fetchState,a,q,w,I.transactionStatistics.fetchState,v.fetchState]),r.useEffect((()=>{if(!(I.fetchState!=="Completed"||U&&P.fetchState!=="Completed"||c==null||I.transactionStatistics.fetchState!=="Completed"||se&&q&&I.depositAccountLimitFetchState.fetchState!=="Completed")){const Y=c.type.code.includes("physical"),ye=Y?c.cardActivationAttemptHistory[0]?.timestamp:c.createTime;ae.trackCardsCardDetailView(ee,ue,{cardId:t,cardName:c.cardName,cardType:c.type.code.includes("credit")?"credit":"debit",cardCategory:Y?"physical":"virtual",cardLimit:Sa(c.limit.amount),cardLastFourDigits:c.accountLast4,cardStatus:c.status.code,cardAssignedDate:c.createTime?.format(bt.analytics.MMMDashDDDashYYYYFormat),cardIssuedDate:c.providerCardCreateTime?.format(bt.analytics.MMMDashDDDashYYYYFormat),cardActivatedDate:ye?.format(bt.analytics.MMMDashDDDashYYYYFormat),cardLimitFrequency:c.creditLimitFrequency.name,cardSpentAmount:Sa(c.balance.amount),cardAvailableLimit:Sa(c.available.amount),cardUtilizationPercent:c.limit.amount>0?Math.round((c.limit.amount-c.available.amount)/c.limit.amount*100):0,cardUtilizationAmount:Sa(c.limit.amount-c.available.amount),totalNumberOfDeclinedTransactions:I.transactionStatistics.statistics.totalNumberOfDeclinedTransactions,numberOfDeclinedTransactionsCurrentMonth:I.transactionStatistics.statistics.numberOfDeclinedTransactionsCurrentMonth,totalNumberOfPaidTransactions:I.transactionStatistics.statistics.totalNumberOfPaidTransactions,numberOfPaidTransactionsCurrentMonth:I.transactionStatistics.statistics.numberOfPaidTransactionsCurrentMonth,totalNumberOfCanceledTransactions:I.transactionStatistics.statistics.totalNumberOfCanceledTransactions,numberOfCanceledTransactionsCurrentMonth:I.transactionStatistics.statistics.numberOfCanceledTransactionsCurrentMonth,totalNumberOfAuthorizedTransactions:I.transactionStatistics.statistics.totalNumberOfAuthorizedTransactions,numberOfAuthorizedTransactionsCurrentMonth:I.transactionStatistics.statistics.numberOfAuthorizedTransactionsCurrentMonth,totalNumberOfTransactionsWithReceipts:I.transactionStatistics.statistics.totalNumberOfTransactionsWithReceipts,numberOfTransactionsWithReceiptsCurrentMonth:I.transactionStatistics.statistics.numberOfTransactionsWithReceiptsCurrentMonth},{cardIssuedByName:kt(c.cardCreatedByUser,!1),cardIssuedByEmail:c.cardCreatedByUser?.email,cardIssuedByUserId:c.cardCreatedByUser?.userId,cardIssuedByRole:De?.userRoles,cardIssuedByDepartment:ve?.className},{cardholderName:kt(c.cardHolderUser,!1),cardholderEmail:c.cardHolderUser?.email,cardholderRole:Ce?.userRoles,cardholderUserId:c.cardHolderUser?.userId,cardholderDepartment:J?.className},ge,re)}}),[I.fetchState,I.depositAccountLimitFetchState.fetchState,I.transactionStatistics.fetchState,P.fetchState,q]),u==null)throw Error("Can't access card detail page without signing in...");const dt=aa(m),Ea=q?[...At,...Hr]:At,ra={events:ha(dt,Ea),eventCallback:(Y,ye,ce)=>{ce.onEventReceived(Y,ye)},onSubscribed:Y=>{Y.onPusherSubscribed()}},Aa=()=>{if(t!=null&&c!=null){const{ownerName:Y,cardName:ye,utilisation:ce,limit:$e,frequency:Ye,cardColor:Ge}=St(c),Ke=c.cardHolderUserId===u.userId;ae.trackCardsDetailPageViewed(t,Y,ye,ce,$e,Ye,Ge,Ke)}};r.useEffect((()=>{if(I.fetchState==="Completed"){const Y=I.chargeCard;if(Y?.status.code==="inactive"||se&&Y?.isPinSet===!1||X&&F){const ye=_e(m.tenantEmailDomain,t,u,c,F);e(ye)}}}),[I.fetchState]);const lt=(Y,ye)=>{if(t!=null&&c!=null){const{ownerName:ce,cardName:$e,utilisation:Ye,limit:Ge,frequency:Ke}=St(c),sa=c.cardHolderUserId===u.userId;ae.trackCardsDetailPageClicked(t,ce,$e,Ye,Ge,Ke,Y,sa,ye)}},ut=(Y,ye)=>{if(t!=null&&c!=null){const{ownerName:ce,cardName:$e,utilisation:Ye,limit:Ge,frequency:Ke}=St(c),sa=c.cardHolderUserId===u.userId;ae.trackCardsVerifyPopUpClick(t,ce,$e,Ye,Ge,Ke,Y,sa,ye)}},pe=P.balance.amount+P.hold.amount,Ua=m.companyChargeCardInfo?.info?.primaryFundingAccount,Da=v.allFundingAccounts.find((Y=>Y.id===Ua?.accountId)),ja=I.chargeCard!=null,Ma=I.depositAccountLimit!=null;return I.fetchState!=="Error"||ja?!ja&&(I.fetchState==="In-Progress"||I.fetchState==="Not-Started")||na.saveStatus.fetchState==="In-Progress"||!Ma&&se&&q&&I.depositAccountLimitFetchState.fetchState!=="Completed"?o.jsx(dc,{}):o.jsxs(o.Fragment,{children:[o.jsx(nt,{showConfetti:F}),I.fetchState==="Completed"?o.jsx(Ut,{analytics:ae,onLoad:Aa}):null,b===!0?o.jsx(zt,{closeDrawerHandler:()=>h(!1),isPaymentDrawerOpen:b,pageName:"Card Detail",sourcePage:"cardDetailPage",productInformation:ue,creditAccountInformation:ge,debitAccountInformation:re,cashbackInformation:be,creditAccountSpentAmount:pe,isDebitCardInfoFetchStateCompleted:!se||!q||I.depositAccountLimitFetchState.fetchState==="Completed",isCreditCardInfoFetchStateCompleted:!U||P.fetchState==="Completed",isCashbackInfoFetchStateCompleted:!q||Q.fetchState==="Completed",paymentInitiatedDate:K.initiatedRepaymentDate}):null,o.jsx(li,{...ra,hideSorting:!0,onColumnSortConfigChanged:()=>{},onFireVerifyPopOnClickAnalytics:ut,onFireOnClickAnalytics:lt,isSandboxEnv:Rt(),signedInUser:u,location:n,navigate:e,setIsPaymentOpen:h,cardIssuedByRoles:De?.userRoles,cardIssuedByDepartmentName:ve?.className,cardHolderRoles:Ce?.userRoles,cardHolderDepartmentName:J?.className,loggedInUserRole:fa,isChargeCardFeatureEnabled:U,isDebitCardFeatureEnabled:y,isDebitCardSetupEnabled:x,isChargeCardSetupEnabled:z,isCardControlsEnabled:S,isEarlyPayEnabled:R,controllerEmails:ee,chargeCardCashbackDetailState:Q,productInformation:ue,creditAccountInformation:ge,debitAccountInformation:re,cashbackInformation:be,classListFetchState:w,primaryFundingAccountDetails:Da,currentTenant:m,cardProviderId:I.chargeCard?.cardProviderID,cardId:t,creditAccount:P,creditAccountRepayment:K,includeCreditAccountInfo:H,signedInUserToken:W,appleWalletLink:"shoebox://",googleWalletLink:"https://www.android.com/payapp/",documentAiReceiptMaxSizeLimit:p.documentAiReceiptMaxSizeLimitBytes!=null?p.documentAiReceiptMaxSizeLimitBytes:9437184,isAiCfoAccessEnabled:N,onAskAiCfoClick:V,isCardsCommentingEnabled:i})]}):o.jsx(ot,{})}const St=e=>{const a=`${e.cardHolderUser?.firstName.toLowerCase()} ${e.cardHolderUser?.lastName.toLowerCase()}`,n=e.cardName,t=(e.limit.amount??0)-(e.available.amount??0),s=e.limit.amount,g=e.creditLimitFrequency.name;return{ownerName:a,cardName:n,utilisation:t,cardColor:e.cardColorCode??"",frequency:g,limit:s}},{spendManagement:{chargeCard:{cardsAiCfoHero:{headline:mi,subheadline:Ci,pageTitle:pi}}}}=ea.getLocalizedStrings(),$r=[pa,ct,Nr,Ba,Ra,it,Kt,Wc,$t,Gt,Ht],hi=new Set($r),Dt=jt(((e,a,n,t)=>{e(ia(a,n,t,!0))}),400),fi=Ve.div`
19
- display: flex;
20
- width: 100%;
21
- flex: 1 1 auto;
22
- flex-direction: column;
23
- align-items: center;
24
- background-color: ${e=>e.theme.colors.grey4};
25
- `,gi=Pe((function(e,a){const n=Ca(e,a.includeCreditAccountDebitSummaryAndCashbackInfo,a.isDebitCardFeatureEnabled&&a.isDebitCardSetupEnabled,a.isChargeCardFeatureEnabled&&a.isChargeCardSetupEnabled);return{chargeCardListView:n,rowActionView:mo(e),bulkActionView:Co(e),companyLegalName:a.currentTenant.companyName,admins:a.admins,searchText:n.searchText,uiState:n.uiState,signedInUser:a.signedInUser,receiptsEmail:Wn(e.tenantState,a.currentTenant.tenantId)}}),(function(e,a){const{navigateAndClearBulkSelection:n,currentTenant:t,location:s,signedInUser:g,chargeCardListState:b,includeCreditAccountDebitSummaryAndCashbackInfo:h,isChargeCardFeatureEnabled:A,isCreditCardProductVisibleForExpressInterest:u,isChargeCardSetupEnabled:m,isDebitCardFeatureEnabled:F,isDebitCardSetupEnabled:w,isDebitCardTOSAccepted:p,isChargeCardTOSAccepted:T,controllerEmails:B,depositAccountListWithDebitCardIssued:S,primaryFundingAccountDetails:l,chargeCardSetUpViewFetchState:C,productInformation:L,cashbackInformation:k,creditAccountInformation:_,debitAccountInformation:D,updatePayNowInfoTooltip:M,isUserHasCardsAdminLevelAccess:E}=a,{tenantEmailDomain:y}=t,{cards:R}=b;return{onChargeCardRowClick:(i,f)=>{const j=Pr(R,i);let G;j!=null&&((x=>{const z=x.limit.amount-x.available.amount,H=`${x.cardHolderUser?.firstName.toLowerCase()} ${x.cardHolderUser?.lastName.toLowerCase()}`,v=x.cardName,P=x.department?.className??"",K=x.limit.amount,W=x.creditLimitFrequency.name;ae.trackCardsListRowClicked(H,v,P,z,K,W,g.userId===x.cardHolderUserId)})(j),ca(F,w,S)&&ae.trackCardsCardListRowClick(B,L,"Card Row Item","row_clicked",f+1,{cardOwner:kt(j.cardHolderUser,!1),cardName:j.cardName,cardType:j.type.code.includes("credit")?"credit":"debit",cardStatus:j.status.code,cardUtilizationAmount:Sa(j.limit.amount-j.available.amount),cardUtilizationPercent:j.limit.amount>0?Math.round((j.limit.amount-j.available.amount)/j.limit.amount*100):0,cardLimit:Sa(j.limit.amount)},k,_,D)),G=j?.status.code==="request_on_hold"&&g.userId===j.cardHolderUserId?wr(y):_e(y,i,g,j);const U=ke(s.state?.pathnameStackToGoBack,s.pathname);n(G,{state:{pathnameStackToGoBack:U}})},onFetchChargeCardsRecurringExpenses:i=>{e(er(i))},onFetchDepositAccountLimit:i=>{e(Zn({depositAccountId:i}))},onChargeCardResendInviteClick:i=>{e(Io(i))},onChargeCardRevokeInviteClick:i=>{e(Qn(i))},onLockChargeCardList:(i,f)=>{e(yo(i,f))},onUnlockChargeCardList:i=>{e(So(i))},onCloseChargeCardList:(i,f)=>{e(bo(i,f))},onRevokeChargeCardList:i=>{e(go(i))},updateChargeCardListSpendLimit(i,f,j){e(fo(i,f,j.code))},onLockChargeCard:(i,f)=>{e(nr(E,i,f))},onUnlockChargeCard:i=>{e(tr(E,i))},onCloseChargeCard:(i,f)=>{e(ar(i,f))},onUpdateSpendLimit(i,f,j,G){e(qn(i,f,j.code,G))},updateChargeCardName:(i,f)=>{e(Xn(E,i,f))},onClickSetupIcon:()=>{ae.trackCardsListPageClicked("settings"),ca(F,w,S)&&k!=null&&ae.trackCardsSettingsClick(B,L,k,_,D);const i=xc(y),f=ke(s.state?.pathnameStackToGoBack,s.pathname);n(i,{state:{pathnameStackToGoBack:f}})},onIssueCardClick:()=>{ae.trackCardsListPageClicked("new card"),ca(F,w,S)&&k!=null&&ae.trackCardsNewCardClick(B,L,k,"New Button","card_creation_initiated","Card List",_,D);const i=bi(y),f=ke(s.state?.pathnameStackToGoBack,s.pathname);n(i,{state:{pathnameStackToGoBack:f}})},onColumnSortConfigChanged:(i,f)=>{ca(F,w,S)&&k!=null&&ae.trackCardsCardListSortClick(B,L,k,"Sort Icon","sort",i,f==="ascending"?"ASC":"DESC","Cards List",_,D),e(It({uiState:{sortKey:i,sortOrder:f}}))},onSearchTextChanged:i=>{e(ho(i))},onReloadCards:()=>{e(ia(h,F&&w,A&&m,!0))},onLetsGoClick:()=>{n("./onboard")},onBackClick:()=>{n("../../")},onTotalCashbackClick:()=>{ca(F,w,S)&&k!=null&&ae.trackCardsCashbackOverviewClick(B,L,k,"Cashback Overview","cashback_details_viewed",_,D),n("./cashback")},onClickStatementsIcon:()=>{ca(F,w,S)&&k!=null&&ae.trackCardsStatementsClick(B,L,k,_,D),n("./statements")},onCreateNowClick:i=>{ca(F,w,S)&&k!=null&&ae.trackCardsNewCardClick(B,L,k,"Promo Banner","card_creation_initiated","Card List",_,D),n(`./new?cardType=${i}`)},onPromoCardClick:i=>{n(i==="debit"&&F&&!p||i==="credit"&&u&&!T?`../promo?cardPromoType=${i}`:"./setup")},navigateToCreditCardPaymentPage:(i,f)=>{C==="Completed"&&t.company!=null&&k!=null&&ae.trackCardsPayEarlyClick(B,L,k,"Card List",i,f,{isZeniCheckingEnabled:t.company.companyZeniAccountInfo.isZeniAccountEnabled,isZeniCheckingPaymentSource:l?.accType==="depositAccount",creditCardPaymentSourceAccountName:l?.label,creditCardPaymentSourceAccountType:l?.accType,creditCardPaymentSourceLastFourDigits:l?.accountLast4,creditCardPaymentSourceBalance:l?.accountBalance?.available?.amount??0},_,D);const j=Si(y);n(j)},navigateToCreditCardPaymentHistoryPage:()=>{const i=yi(y),f=ke(s.state?.pathnameStackToGoBack,s.pathname);n(i,{state:{pathnameStackToGoBack:f}})},shouldShowPayNowInfoTooltip:M,onSetRowActionCardId:i=>{e(po(i))},onSetBulkActionCardIds:i=>{e(rr(i))},onEventReceived:i=>{hi.has(i)&&Dt(e,h,F&&w,A&&m)},onPusherSubscribed:()=>{Dt(e,h,F&&w,A&&m)}}}))(st(Cc));function kn({isPaymentDrawerOpen:e}){const a=de(),n=me(),t=he(),s=r.useCallback((($,Ue)=>{n(rr([])),a($,Ue)}),[n,a]),[g,b]=r.useState(!1),[h,A]=r.useState(te.getPayNowInfoTooltip()??!1),u=$=>{te.savePayNowInfoTooltip($),A($)},[m,F]=r.useState(!1),w=te.getSignedInUser(),p=d(($=>fe($))),[T,B]=r.useState(!1),[S,l]=r.useState(!1),{isAiCfoAccessEnabled:C,onAskAiCfoClick:L}=xa({mobileExploreReferrer:"Cards"}),k=p.userRole.includes("charge_card_user"),_=!k,D=!!p.companyDebitCardInfo?.info?.isDebitCardEnabled,{useFeatureGate:M,useDynamicConfig:E}=le(),{isFeatureEnabled:y}=M(Z.isCashbackFeatureEnabled),{isFeatureEnabled:R}=M(Z.isChargeCardFeatureEnabled),{isFeatureEnabled:i}=M(Z.isDebitCardFeatureEnabled),{isFeatureEnabled:f}=M(Z.isEarlyPayFeatureEnabled),{isFeatureEnabled:j}=M(Z.isChargeCardPaymentHistoryFeatureEnabled),{isFeatureEnabled:G}=M(Z.isCardsCommentingEnabled),{isFeatureEnabled:U}=M(Z.isAiCfoFileUploadEnabled),{isFeatureEnabled:x}=M(Z.isCardPolicyEnabled),{isFeatureEnabled:z}=M(Z.isAiCardCreationEnabled),H=Le(i,p),v=Re({isDebitCardFeatureEnabled:i,isBankingOnlyTenant:H}),P=Fe(p),K=xe(p),W=p.companyChargeCardInfo?.info?.chargeCardsCreditAccountLimit??0,I=Oe({isCardsOnlyTenant:P,isChargeCardFeatureEnabled:R,isBookKeepingTenant:K,isDebitCardProductVisible:v,chargeCardsCreditAccountLimit:W}),N=_r({isCardsOnlyTenant:P,isChargeCardFeatureEnabled:R,isBookKeepingTenant:K}),{configValue:V}=E(Qe.zeniCardsConfig),Q=Be(),c=Te(Q?.loggedInUserRoleMap),O=d(($=>da($,p.companyId))),q=la(O.controllers),se=V.charge_card_cashback_rate_per_transaction!=null?V.charge_card_cashback_rate_per_transaction:.0175,X=V.credit_card_pay_now_threshold_by_company_id?.[p.companyId]??V.default_credit_card_pay_now_threshold??Fc,He=V.is_card_controls_enabled_for_all_tenants===!0||Array.isArray(V.enable_card_controls_for_company_ids)&&V.enable_card_controls_for_company_ids.includes(p.companyId),Ae=!!p.companyChargeCardInfo?.info?.isChargeCardTOSAccepted,ge=!!p.companyDebitCardInfo?.info?.isDebitCardTOSAccepted,re=!!p.companyChargeCardInfo?.info?.isChargeCardEnabled,be=!!p.company?.companyChargeCardInfo?.isChargeCardEnabled,ue=!!p.company?.companyDebitCardInfo?.isDebitCardEnabled,oe=d(($=>Gn($))),Se=ya(oe.updateStatus),ee=d(($=>Ca($,_,v&&D,I&&re))),De=d(($=>co($))),ve=d(($=>io($))),Ce=d(($=>lo($))),J=d(($=>uo($))),fa=d(($=>Ce==null?[]:Nn($.aiCfoState,Ce).filter((Ue=>Ue.kind==="creating_cards"))),_t),na=ya(ve.fetchState);r.useEffect((()=>{na==="In-Progress"&&ve.fetchState==="Completed"&&Ce!=null&&fa.forEach(($=>{n(yt({chatSessionId:Ce,id:$.id,entityIds:J,kind:"created_cards"}))}))}),[n,ve.fetchState,Ce,J,fa,na]);const Oa=ee.cards.filter(($=>$.type.code.includes("debit"))).map(($=>$.connectedAccountId)),dt=[...new Set(Oa)],Ea=d(($=>ma($))),ra=d(($=>tt($,dt))),Aa=d(($=>wa($,p.companyId))),lt=Aa.companyChargeCardInfo?.primaryFundingAccount,ut=Aa.allFundingAccounts.find(($=>$.id===lt?.accountId)),pe=ee.fetchState,Ua=ee.creditAccount,Da=r.useCallback((()=>c===!0&&x===!0&&pe==="Completed"&&te.getCardPolicyPopupSeen(p.tenantEmailDomain??"")!==!0),[c,x,pe,p.tenantEmailDomain]),[ja,Ma]=r.useState(Da);r.useEffect((()=>{Ma(Da())}),[Da]);const Y=()=>{te.saveCardPolicyPopupSeen(p.tenantEmailDomain??"",!0),Ma(!1)},ye=pe==="Completed"&&!ee.hasCreditCard&&!ee.hasDebitCard;uc({isDataReady:pe==="Completed",pageContext:ye?"cards_creation":"cards"});const{creditAccountRepayment:ce}=d(($=>ua($))),$e=d(($=>qa($).firstViewAfterActivation)),{areTenantIdsInSync:Ye}=Ir(),Ge=Mt(c,Ea),Ke=La(I,re,c,Ua,ce),sa=Nt(v,D,c,ra,ee.debitCardSummary),mt=Xe(I,v,D,re),Ct=ee.creditAccount.balance.amount+ee.creditAccount.hold.amount;if(r.useEffect((()=>{pe==="Completed"&&(te.getPayNowInfoTooltip()==null||Ct<X*ee.creditAccount.limit.amount/100)&&u(!0)}),[pe,X,Ct,ee.creditAccount.limit.amount]),r.useEffect((()=>{if(e!=null&&e===!0&&ce.initiatedRepayments.amount===0&&ce.fetchState==="Completed"||Se==="In-Progress"&&oe.updateStatus==="Completed")u(!1),b(!0);else if(ce.initiatedRepayments.amount>0&&ce.fetchState==="Completed"){b(!1),document.body.style.overflow="auto";const $=ta(p.tenantEmailDomain);s($)}}),[e,ce.initiatedRepayments.amount,ce.fetchState,Se,oe.updateStatus,s,p.tenantEmailDomain]),r.useEffect((()=>{!T&&(re||D)&&(be||ue)&&Ye&&(B(!0),n(ia(_,v&&D,I&&re,!1)))}),[T,_,n,Ye,be,ue]),r.useEffect((()=>{$e&&m===!1&&(F(!0),setTimeout((()=>{n(za())}),5e3))}),[$e,m]),r.useEffect((()=>()=>{Dt.flush()}),[]),r.useEffect((()=>{pe==="Completed"&&k&&ee.cards.length===1&&(ee.cards[0].status.code==="inactive"&&ee.cards[0].type.code==="business_physical_credit_card"?s(`./${ee.cards[0].id}/activate`):ee.cards[0].status.code!=="request_on_hold"&&(t.state?.message==="comingFromCardDetail"?s("../../"):s(`./${ee.cards[0].id}`)))}),[pe,k,t.state,s,ee.cards]),r.useEffect((()=>{if(pe==="Completed"&&k){const $=ee.cards.length,Ue=ee.cards.filter((Ze=>Ze.cardHolderUserId===w?.userId)).filter((Ze=>Ze.status.code==="request_on_hold"));Ue.length>0&&$===Ue.length&&s("./onboard")}}),[pe,ee.cards,k,s,w?.userId]),r.useEffect((()=>{pe!=="Completed"||I&&ce.fetchState!=="Completed"||v&&D&&c&&ra.fetchState!=="Completed"||ae.trackCardsCardListView(q,mt,Ge,Ke,sa)}),[pe,Ua,ce.fetchState,ra.fetchState,c]),w==null)throw Error("Can't access charge card list page without signing in...");const Yr=d(($=>sr($.userState,$.userRoleState,$.userListViewState,"cardAdmin"))),Wt=xt(Q?.loggedInUserRoleMap),qt=$=>{l($)},Zr=ee.creditAccount.limit,Wr=()=>{b(!1),s("..")},qr=p.companyChargeCardInfo?.info!=null&&Ia({cardInfo:p.companyChargeCardInfo.info,isProductVisible:I&&be,isTOSAccepted:Ae,isSetupEnabled:re,isUserHasCardsAdminLevelAccess:c,isUserHasCardsAccess:Wt}),Jr=p.companyDebitCardInfo?.info!=null&&Ia({cardInfo:p.companyDebitCardInfo.info,isProductVisible:v&&ue,isTOSAccepted:ge,isSetupEnabled:D,isUserHasCardsAdminLevelAccess:c,isUserHasCardsAccess:Wt}),Qr=qr||Jr,Jt=(function($){const{isEmptyCardsState:Ue,isChargeCardAdmin:Ze,isFileUploadEnabled:an}=$,tn=de(),Na=he(),{tenantEmailDomain:Va}=Ne(),{isAiCfoOpen:ns,setIsAiCfoOpen:nn}=fr(),rs=gr(),ss=br(),rn=d((Ie=>Mn(Ie))).createSessionAndSubmitState.fetchState==="In-Progress",{chips:sn,isResolved:on}=Lr("cards_creation"),cn=r.useMemo((()=>xr(sn,on,3)),[sn,on]),[Ha,pt]=r.useState(""),dn=ss&&rs&&Va!=null&&!ns,ga=r.useCallback((Ie=>{if(Va==null)return;const os=ke(Na.state?.pathnameStackToGoBack,Na.pathname);tn(`/${Va}/cards/ask`,{state:{message:"",origin:"",pathnameStackToGoBack:os,referrer:"cards_hero",aiCfoInitialQuestion:Ie,aiCfoShouldSubmit:Ie!=null&&Ie.trim().length>0}})}),[Na.pathname,Na.state,tn,Va]),ln=r.useCallback((Ie=>{Ie.trim().length!==0&&(pt(""),ga(Ie))}),[ga]),un=r.useCallback((()=>{const Ie=Ha.trim();Ie.length!==0&&(pt(""),ga(Ie))}),[Ha,ga]),mn=r.useCallback((()=>{}),[]),Cn=r.useCallback((Ie=>{pt(Ie)}),[]),pn=r.useCallback((()=>{nn(!0)}),[nn]),hn=r.useCallback((()=>{ga(void 0)}),[ga]);return r.useMemo((()=>{if(dn&&Ue&&Ze)return{aiAgentName:pi,headline:mi,subheadline:Ci,promptChips:cn,composer:{currentInput:Ha,isSubmitting:rn,isFileUploadEnabled:an,onInputChange:Cn,onSubmit:un,onStopSubmit:mn},onPromptClick:ln,onOpenSidePanel:pn,onOpenFullView:hn,dataTestIdPrefix:"cards-ai-cfo-hero"}}),[Ha,dn,Ze,Ue,an,rn,Cn,hn,pn,ln,mn,un,cn])})({isEmptyCardsState:ye,isChargeCardAdmin:c,isFileUploadEnabled:U}),Qt=z&&Jt!=null?o.jsx(Sr,{...Jt}):null,{isCardsShuttingDown:Xt,shutdownContent:en}=kr(p.tenantId,p.company?.managementInfo?.receiverEmails),Xr=Xt===!0&&en!=null?o.jsx(mc,{shutdownContent:en}):null,es=C&&Qt==null,as=aa(p),ts={events:ha(as,$r),eventCallback:($,Ue,Ze)=>{Ze.onEventReceived($)},onSubscribed:$=>{$.onPusherSubscribed()}};return re||D?o.jsxs(o.Fragment,{children:[pe==="Completed"?o.jsxs(o.Fragment,{children:[o.jsx(Ut,{analytics:ae,onLoad:()=>{ae.trackPageLoaded(Er.Event.cardsListPage),(I&&!re||v&&!D)&&ae.trackCardsPromoView(q,{isCreditCardOffered:I,isDebitCardOffered:v,isDebitCardEnabled:D,isCreditCardEnabled:re},"Banner",v&&!D?"Debit Card":I&&!re?"Credit Card":"","Card List")}}),o.jsx(nt,{showConfetti:$e})]}):null,g===!0?o.jsx(zt,{closeDrawerHandler:Wr,isPaymentDrawerOpen:g,pageName:"Card List",sourcePage:"cardListPage",creditAccountSpentAmount:Ct,productInformation:mt,creditAccountInformation:Ke,debitAccountInformation:sa,cashbackInformation:Ge,isDebitCardInfoFetchStateCompleted:!(v&&D&&c)||ra.fetchState==="Completed",isCreditCardInfoFetchStateCompleted:!I||ce.fetchState==="Completed",isCashbackInfoFetchStateCompleted:!c||Ea.fetchState==="Completed",paymentInitiatedDate:ce.initiatedRepaymentDate}):null,o.jsxs(fi,{children:[o.jsx(Ee,{isAppContentDrawerOpen:S,handleDrawerToggle:qt}),o.jsx(gi,{...ts,isCashbackFeatureEnabled:y,isChargeCardFeatureEnabled:I,isDebitCardFeatureEnabled:v,isCreditCardProductVisibleForExpressInterest:N,updatePayNowInfoTooltip:u,showPayNowInfoTooltip:h,creditCardPayNowThreshold:X,signedInUser:w,chargeCardListState:ee,location:t,admins:Yr.users,navigateAndClearBulkSelection:s,currentTenant:p,isCardControlsEnabled:He,companyChargeCardInfoCreditAccountLimit:p.companyChargeCardInfo?.info?.chargeCardsCreditAccountLimit??0,isCompanyInterestedInChargeCard:p.companyChargeCardInfo?.info?.isCompanyInterestedInChargeCard??!1,isUserHasCardsAdminLevelAccess:c,includeCreditAccountDebitSummaryAndCashbackInfo:_,onClickMenuIcon:()=>{qt(!0)},creditLimit:Zr,isChargeCardSetupEnabled:re,isChargeCardEnabledOnCompany:be,isDebitCardSetupEnabled:D,isDebitCardEnabledOnCompany:ue,isEarlyPayEnabled:f,isChargeCardPaymentHistoryFeatureEnabled:j,cashbackRate:se,controllerEmails:q,chargeCardCashbackDetailState:Ea,depositAccountListWithDebitCardIssued:ra,isChargeCardTOSAccepted:Ae,isDebitCardTOSAccepted:ge,primaryFundingAccountDetails:ut,chargeCardSetUpViewFetchState:Aa.fetchState,productInformation:mt,creditAccountInformation:Ke,debitAccountInformation:sa,cashbackInformation:Ge,isAiCfoAccessEnabled:es,onAskAiCfoClick:L,isCardsCommentingEnabled:G,cardsAiCfoHero:Qt,cardsShutdownBanner:Xr,isCardsShuttingDown:Xt,onClickPolicyIcon:c&&x?()=>a(Ii(p.tenantEmailDomain)):void 0,isPolicyIntroTooltipVisible:ja,onPolicyIntroTooltipClose:Y,pendingCreationCount:De})]})]}):(Ae||ge)&&c===!0?o.jsx(Je,{to:"../setup"}):Qr?o.jsx(Je,{to:"../promo"}):o.jsx(va,{fetchState:pe})}const bi=e=>`/${e}/cards/new`,Si=e=>`/${e}/cards/payment`,yi=e=>`/${e}/cards/payment-history`,Ii=e=>`/${e}/cards/policy`,Gr=[Mr,Nr],ki=new Set(Gr),Ei=Pe((function(e){const a=te.getSignedInUser(),n=fe(e),t=e.tenantState.currentTenantId,s=or(e),g={userId:a?.userId??"",sessionId:a?.zeniSessionId??"",tenantId:t??""},b=n?.companyName??"",h=e.chargeCardPaymentHistoryState.downloadUIState.downloadState;return{fetchState:s.fetchState,filters:s.filters,isZeniTenant:ko(n),repaymentList:s.repaymentHistory,searchText:s.searchText,repaymentHistoryUsers:s.repaymentHistoryUsers,sortConfig:{sortKey:s.uiState.sortKey,sortOrder:s.uiState.sortOrder},downloadParams:{authParams:g,companyName:b,spendManagementEndPoint:`${Et}/spendManagement`,isShowDeletedBillsEnabled:!1,isShowDeletedReimbursementEnabled:!1},downloadState:h}}),(function(e,a){const{location:n,navigate:t}=a;return{onBackClick:()=>{const s=we(n.state?.pathnameStackToGoBack),g=s.poppedPathname??"..";t(g,{state:{pathnameStackToGoBack:s.newStack}})},onColumnSortConfigChanged:(s,g)=>{e({type:"chargeCardPaymentHistory/updatePaymentHistoryUIState",payload:{uiState:{sortKey:s,sortOrder:g}}})},onFiltersChange:s=>{e(Ao({filters:s}))},onReloadPayments:()=>{e($a(!0))},onEventReceived:s=>{ki.has(s)&&e($a(!0))},onPusherSubscribed:()=>{e($a(!0))},onSearchTextChanged:s=>{e({type:"chargeCardPaymentHistory/updatePaymentHistorySearchText",payload:s})},updateDownloadStateHandler:s=>{e(Eo({uiState:{downloadState:s}}))}}}))(st(pc));function Ai(){const e=de(),a=he(),n=me(),{areTenantIdsInSync:t}=Ir(),{useFeatureGate:s}=le();if(te.getSignedInUser()==null)throw Error("Can't access payment history page without signing in...");const g=d((c=>fe(c))),b=d((c=>or(c))),[h,A]=r.useState(!1),[u,m]=r.useState(!1),[F,w]=r.useState(!1),[p,T]=r.useState(null),B=!g.userRole.includes("charge_card_user"),S=!!g.companyDebitCardInfo?.info?.isDebitCardEnabled,{isFeatureEnabled:l}=s(Z.isChargeCardFeatureEnabled),{isFeatureEnabled:C}=s(Z.isDebitCardFeatureEnabled),L=Le(C,g),k=Re({isDebitCardFeatureEnabled:C,isBankingOnlyTenant:L}),_=Fe(g),D=xe(g),M=g.companyChargeCardInfo?.info?.chargeCardsCreditAccountLimit??0,E=Oe({isCardsOnlyTenant:_,isChargeCardFeatureEnabled:l,isBookKeepingTenant:D,isDebitCardProductVisible:k,chargeCardsCreditAccountLimit:M}),y=!!g.companyChargeCardInfo?.info?.isChargeCardEnabled,R=Be(),i=Te(R?.loggedInUserRoleMap),f=d((c=>Ca(c,B,k&&S,E&&y))),j=r.useMemo((()=>{const c=f.cards.filter((O=>O.type.code.includes("debit")));return[...new Set(c.map((O=>O.connectedAccountId)))]}),[f.cards]),G=d((c=>ma(c))),U=d((c=>tt(c,j))),{creditAccountRepayment:x}=d((c=>ua(c))),z=r.useMemo((()=>Mt(i,G)),[i,G]),H=r.useMemo((()=>La(E,y,i,f.creditAccount,x)),[E,y,i,f.creditAccount,x]),v=r.useMemo((()=>Nt(k,S,i,U,f.debitCardSummary)),[k,S,i,U,f.debitCardSummary]),P=r.useMemo((()=>Xe(E,k,S,y)),[E,k,S,y]),K=f.creditAccount.balance.amount+f.creditAccount.hold.amount,W=r.useMemo((()=>p!=null?b.repaymentHistory.find((c=>c.cardRepaymentId===p)):void 0),[p,b.repaymentHistory]),I=r.useCallback((c=>{T(c),n(ia(B,k&&S,E&&y,!1)),w(!0)}),[n,B,k,S,E,y]),N=r.useCallback((()=>{w(!1),T(null),document.body.style.overflow="auto"}),[]);r.useEffect((()=>{h||b.fetchState==="Completed"||b.fetchState==="In-Progress"||(A(!0),n($a()))}),[h,n,b.fetchState]),r.useEffect((()=>{!u&&(y||S)&&t&&(m(!0),n(ia(B,!1,E&&y,!1)))}),[u,y,S,t,n,B,E]);const V=aa(g),Q={events:ha(V,Gr),eventCallback:(c,O,q)=>{q.onEventReceived(c)},onSubscribed:c=>{c.onPusherSubscribed()}};return o.jsxs(o.Fragment,{children:[F?o.jsx(zt,{closeDrawerHandler:N,isPaymentDrawerOpen:F,pageName:"Payment History",sourcePage:"cardPaymentHistory",creditAccountSpentAmount:K,productInformation:P,creditAccountInformation:H,debitAccountInformation:v,cashbackInformation:z,isDebitCardInfoFetchStateCompleted:!(k&&S&&i)||U.fetchState==="Completed",isCreditCardInfoFetchStateCompleted:!E||x.fetchState==="Completed",isCashbackInfoFetchStateCompleted:!i||G.fetchState==="Completed",paymentInitiatedDate:x.initiatedRepaymentDate,retryRepayment:W}):null,o.jsx(Ei,{...Q,location:a,navigate:e,accountInfoByAccountId:b.accountInfoByAccountId,onRetryPaymentClick:I})]})}const En=Ve.div`
26
- display: flex;
27
- height: 100vh;
28
- width: 100%;
29
- flex: 1 1 auto;
30
- flex-direction: column;
31
- overflow: auto;
32
- align-items: center;
33
- background-color: ${e=>e.theme.colors.grey4};
34
- `,An=ea.getLocalizedStrings().months;function Di(){const e=de(),a=me(),n=he(),{creditAccount:t,creditAccountRepayment:s}=d((P=>ua(P))),g=`${yr.cardMicroServiceBaseUrl}/1.0/credit-accounts/${t.id}`,[b,h]=r.useState(!1),[A,u]=r.useState(!1),m=d((P=>Do(P))),{useFeatureGate:F}=le(),w=d((P=>fe(P))),{isFeatureEnabled:p}=F(Z.isChargeCardFeatureEnabled),{isFeatureEnabled:T}=F(Z.isDebitCardFeatureEnabled),{isFeatureEnabled:B}=F(Z.isCardsCommentingEnabled),S=vr(B?w.companyId:void 0,{clearParams:B&&m.fetchState==="Completed"}),l=Le(T,w),C=Re({isDebitCardFeatureEnabled:T,isBankingOnlyTenant:l}),L=Fe(w),k=xe(w),_=w.companyChargeCardInfo?.info?.chargeCardsCreditAccountLimit??0,D=Oe({isCardsOnlyTenant:L,isChargeCardFeatureEnabled:p,isBookKeepingTenant:k,isDebitCardProductVisible:C,chargeCardsCreditAccountLimit:_}),M=!!w.companyDebitCardInfo?.info?.isDebitCardEnabled,E=!!w.companyChargeCardInfo?.info?.isChargeCardEnabled,y=d((P=>da(P,w.companyId))),R=la(y.controllers),i=d((P=>cr(P))),f=i.cards.filter((P=>P.type.code.includes("debit"))).map((P=>P.connectedAccountId)),j=[...new Set(f)],G=d((P=>tt(P,j))),U=d((P=>_o(P)));r.useEffect((()=>{A||t.fetchState==="Completed"||t.fetchState==="In-Progress"||(h(!0),a(qe()))}),[b,a,t.fetchState]),r.useEffect((()=>{A||t.fetchState!=="Completed"||t.id==null||m.fetchState==="Completed"||m.fetchState==="In-Progress"||(u(!0),a(Po(t.id)))}),[A,a,t.fetchState,t.id,m.fetchState]),r.useEffect((()=>{G.fetchState!=="Completed"&&G.fetchState!=="In-Progress"&&C&&M&&a(ir()),i.fetchState!=="Completed"&&i.fetchState!=="In-Progress"&&a(Me()),U.fetchState!=="Completed"&&U.fetchState!=="In-Progress"&&C&&M&&a(wo()),s.fetchState!=="Completed"&&s.fetchState!=="In-Progress"&&D&&E&&a(Tt())}),[G.fetchState,C,M,i.fetchState,U.fetchState,s.fetchState,D,E]),r.useEffect((()=>{if(m.fetchState==="Completed"&&t.fetchState==="Completed"&&s.fetchState==="Completed"&&i.fetchState==="Completed"&&(!C||!M||G.fetchState==="Completed"&&U.fetchState==="Completed")){let P="",K="";if(m.statements.length>0){const V=m.statements[m.statements.length-1].period,[Q,c]=V.split("-"),O=m.statements[0].period,[q,se]=O.split("-");P=`${An[parseInt(c)-1]} ${Q}`,K=`${An[parseInt(se)-1]} ${q}`}const W=Xe(D,C,M,E),I=La(D,E,!0,t,s),N=Nt(C,M,!0,G,U);ae.trackCardsCreditCardStatementsView(R,W,{numberOfStatements:m.statements.length,oldestStatementMonthYear:P,latestStatementMonthYear:K},I,N)}}),[m.fetchState,t.fetchState,s.fetchState,G.fetchState,i.fetchState,U.fetchState]);const x=()=>{const P=we(n.state?.pathnameStackToGoBack),K=P.poppedPathname??"..";e(K,{state:{pathnameStackToGoBack:P.newStack}})},z=d((P=>ma(P))),H=te.getSignedInUser(),v={userId:H?.userId??"",sessionId:H?.zeniSessionId??"",tenantId:w.tenantId??""};if(H==null)throw Error("Can't access address page without signing in...");if(m.fetchState!=="Completed")return o.jsx(En,{children:o.jsx(hc,{onBackClick:x})});{const P=Xe(D,C,M,E);return o.jsx(En,{children:o.jsx(fc,{currentTenantCompanyName:w.companyName,statementListView:m,productInformation:P,onBackClick:x,authParams:v,controllerEmails:R,isChargeCardFeatureEnabled:D,isDebitCardFeatureEnabled:C,isDebitCardSetupEnabled:M,isChargeCardSetupEnabled:E,isCardsCommentingEnabled:B,initialOpenThreadRequest:S,chargeCardCashbackDetailState:z,creditAccount:t,creditAccountRepayment:s,depositAccountListWithDebitCardIssued:G,debitCardSummary:U,downloadEndPoint:g})})}}const Kr=[pa,it],_i=new Set(Kr),Pi={containerWidth:new Fa(100,58)},wi=({appContent:e})=>{const a=Ta(),n=me(),t=de(),s=he(),{useDynamicConfig:g}=le(),[b,h]=r.useState(!1),[A,u]=r.useState(!1),[m,F]=r.useState(!1),[w,p]=r.useState(!1),T=r.useRef(!1),B=r.useRef(null);r.useEffect((()=>()=>{B.current!=null&&(clearTimeout(B.current),B.current=null)}),[]);const[S,l]=r.useState(!1),[C,L]=r.useState(!1),k=te.getSignedInUser();if(k==null)throw Error("Can't access onboarding card page without signing in...");const _=d((N=>fe(N))),{configValue:D}=g(Qe.zeniCardsConfig),M=d((N=>vo(N))),{tenantEmailDomain:E}=_,y=d((N=>N.settingsViewState.profile.fetchState)),R=d((N=>N.chargeCardListState.fetchState)),i=d((N=>N.settingsViewState.profile.userId)),f=d((N=>N.chargeCardConfigState.fetchState));r.useEffect((()=>{b===!1&&y!=="In-Progress"&&y!=="Completed"&&(n(To()),h(!0)),A===!1&&f!=="In-Progress"&&f!=="Completed"&&(n(Ja()),u(!0)),m===!1&&R==="Not-Started"&&(F(!0),n(Me()))}),[b,m,R,A,f]),r.useEffect((()=>{y==="Completed"&&S===!1&&i!=null&&R==="Completed"&&M.cards.length>0&&(n(Fo({userId:i})),n(dr({cardId:M.cards[M.cards.length-1].id})),l(!0))}),[y,S,i,R]),r.useEffect((()=>{if(!w&&M.fetchState==="Completed"&&M.cards.length===0){const N=we(s.state?.pathnameStackToGoBack),V=N.poppedPathname??ta(E);t(V,{state:{pathnameStackToGoBack:N.newStack}})}}),[M.fetchState,M.cards,w]);const j=d((N=>qa(N))),G=ya(j.updateStatus.fetchState),U=j.currentDisplayedCardId,{useFeatureGate:x}=le(),{isFeatureEnabled:z}=x(Z.isChargeCardFeatureEnabled),H=!!_.companyChargeCardInfo?.info?.isChargeCardEnabled,v=!_.userRole.includes("charge_card_user")&&z&&H,P=d((N=>U!=null?lr(N.chargeCardState,U):null)),K=()=>{U!=null&&(T.current=!0,B.current!=null&&clearTimeout(B.current),B.current=setTimeout((()=>{T.current=!1,B.current=null}),5e3),n(ka(U,v,!0)),n(Me(!0)),p(!0))},W=aa(_);Vt({events:ha(W,Kr),onSubscribed:()=>{n(Me(!0))},onEvent:(N,V)=>{if(!_i.has(N))return;const Q=Yt(V),c=T.current;if(N===pa){const q=ie(Q?.card_id)??U;if(q!=null){const se=Zt(Q,q);if(se!=null)return n(Ft(se)),void(q!==U||c||K())}}if(N===it)return void n(Me(!0));const O=ie(Q?.card_id)??U;(U==null||O===U)&&U!=null?c||K():n(Me(!0))}}),r.useEffect((()=>{if(w&&U!=null&&P!=null&&P.status.code!=="request_on_hold"){const N=_e(_.tenantEmailDomain,U,k,P),V=ke(s.state?.pathnameStackToGoBack,s.pathname);n(xo()),P?.type.code==="business_virtual_credit_card"&&n(Qa()),t(N,{state:{pathnameStackToGoBack:V},replace:!0}),T.current=!1,B.current!=null&&(clearTimeout(B.current),B.current=null)}}),[w,P?.status.code]),r.useEffect((()=>{G==="In-Progress"&&j.updateStatus.fetchState==="Completed"&&setTimeout(K,3e3)}),[G,j.updateStatus.fetchState]);const I=N=>{L(N)};if(y!=="Completed"||M.cards.length===0)return o.jsxs(Dn,{children:[o.jsx(Ee,{isAppContentDrawerOpen:C,handleDrawerToggle:I}),o.jsx(gc,{})]});if(i==null)throw Error("Can't access my userId.");return o.jsxs(Dn,{children:[o.jsx(Ee,{isAppContentDrawerOpen:C,handleDrawerToggle:I}),o.jsx(vi,{chargeCardListView:M,cardUserOnboardingView:j,navigate:t,currentTenant:_,myUserId:i,location:s,chargeCardCashbackRatePerTransaction:D.charge_card_cashback_rate_per_transaction!=null?D.charge_card_cashback_rate_per_transaction:.0175,onClickMenuIcon:()=>{I(!0)}}),e!=null?o.jsx(Ti,{windowSize:a,children:e}):null]})},vi=Pe((function(e,{currentTenant:a,cardUserOnboardingView:n,chargeCardListView:t,myUserId:s}){const g=Ca(e,!1,!1,!1);let b=!1;return g.fetchState==="Completed"&&g.cards.length<=1&&(b=!0),{cards:t.cards,showMenuIcon:b,companyLegalName:a.companyName,twoFAView:n.twoFAView,cardUserOnboardingLocalData:n.cardUserOnboardingLocalData??{userId:s},isDOBDisabled:n.isDOBPresent,onboardingProgressStatus:n.onboardingProgressStatus}}),(function(e,a){const{navigate:n,cardUserOnboardingView:t,location:s,currentTenant:g}=a,{tenantEmailDomain:b}=g;return{updateCardUserOnboardingLocalData:h=>{e(bn({localData:h}))},onGetOtp:h=>{if(t.cardUserOnboardingLocalData!=null){const A={...t.cardUserOnboardingLocalData,phone:h};e(bn({localData:A}))}e(at(h,"CardUserOnboarding"))},onResendOtp:h=>{e(et(h,"CardUserOnboarding"))},onVerifyOtp:(h,A)=>{e(Xa(h,A,"CardUserOnboarding"))},onVerifyOtpSuccess:h=>{e(Lo()),h!=null&&te.saveZeniOtpToken(h)},setCurrentDisplayedCardId:h=>{e(dr({cardId:h}))},onBackClick:()=>{const h=we(s.state?.pathnameStackToGoBack),A=h.poppedPathname??ta(b);n(A,{state:{pathnameStackToGoBack:h.newStack}})}}}))(bc),Ti=Ve.div`
35
- display: flex;
36
- flex-direction: column;
37
- width: ${e=>`${Pi.containerWidth.value(e.windowSize)}%`};
38
- ${e=>e.windowSize!=="small"?"overflow: auto;":""}
39
- `,Dn=Ve.div`
40
- display: flex;
41
- min-height: 100%;
42
- width: 100%;
43
- flex: 1 1 auto;
44
- flex-direction: column;
45
- align-items: center;
46
- background-color: ${e=>e.theme.colors.grey4};
47
- `,Fi={containerWidth:new Fa(100,58)},xi=({appContent:e})=>{const a=Ta(),n=me(),t=de(),{cardId:s}=Ne(),g=he(),{useDynamicConfig:b,useFeatureGate:h}=le(),[A,u]=r.useState(!1),[m,F]=r.useState(!1),[w,p]=r.useState(!1),[T,B]=r.useState(!1),S=te.getSignedInUser();if(S==null)throw Error("Can't access onboarding card page without signing in...");const l=d((v=>fe(v)));if(s==null)throw Error("Empty card id is not valid...");const{configValue:C}=b(Qe.zeniCardsConfig),L=d((v=>Bo(v,s))),{isFeatureEnabled:k}=h(Z.isChargeCardFeatureEnabled),{isFeatureEnabled:_}=h(Z.isDebitCardFeatureEnabled),D=Le(_,l),M=Re({isDebitCardFeatureEnabled:_,isBankingOnlyTenant:D}),E=Fe(l),y=xe(l),R=l.companyChargeCardInfo?.info?.chargeCardsCreditAccountLimit??0,i=Oe({isCardsOnlyTenant:E,isChargeCardFeatureEnabled:k,isBookKeepingTenant:y,isDebitCardProductVisible:M,chargeCardsCreditAccountLimit:R}),f=L.chargeCard,j=d((v=>v.chargeCardConfigState.fetchState));r.useEffect((()=>{A===!1&&j!=="In-Progress"&&j!=="Completed"&&(n(Ja()),u(!0)),m===!1&&L.fetchState==="Not-Started"&&(F(!0),n(ka(s,!1,i)))}),[m,L.fetchState,A,j]);const G=f?.type.code==="business_physical_debit_card"||f?.type.code==="business_virtual_debit_card";r.useEffect((()=>{if(L.fetchState==="Completed"){if(w===!1&&(G===!1||G&&f.status?.code!=="active"||G&&f.status.code==="active"&&f.isPinSet||f.cardHolderUserId!==S.userId)){const v=_e(l.tenantEmailDomain,s,S,f,!0),P=ke(g.state?.pathnameStackToGoBack,g.pathname);t(v,{state:{pathnameStackToGoBack:P}})}else if(w&&L.isRefreshingViewInBackground===!1&&f?.isPinSet===!0){n(Ro({chargeCardId:s}));const v=_e(l.tenantEmailDomain,s,S,f,!0),P=ke(g.state?.pathnameStackToGoBack,g.pathname);n(Qa()),t(v,{state:{pathnameStackToGoBack:P}})}}}),[L.fetchState,f?.type.code,w,L.isRefreshingViewInBackground]);const U=te.getZeniOtpTokenForCardHolder(s),x=d((v=>Hn(v.userState,S.userId))),z=()=>{f?.isPinSet!==!0&&n(ba(s,!0))};r.useEffect((()=>{L.updateDebitCardPinAttemptFetchState.fetchState==="Completed"&&(setTimeout(z,3e3),p(!0))}),[L.updateDebitCardPinAttemptFetchState.fetchState]);const H=v=>{B(v)};if(j!=="Completed"||f==null)return o.jsx(va,{fetchState:"In-Progress"});if(x?.phone==null)throw Error("Can't access user phone number.");return o.jsxs(Ri,{children:[o.jsx(Ee,{isAppContentDrawerOpen:T,handleDrawerToggle:H}),o.jsx(Li,{cardId:s,card:f,phone:x.phone,signedInUser:S,isSandboxEnv:Rt(),debitCardDetailState:L,signedInUserToken:U,navigate:t,currentTenant:l,location:g,chargeCardCashbackRatePerTransaction:C.charge_card_cashback_rate_per_transaction!=null?C.charge_card_cashback_rate_per_transaction:.0175,onClickMenuIcon:()=>{H(!0)}}),e!=null?o.jsx(Bi,{windowSize:a,children:e}):null]})},Li=Pe((function(e,{debitCardDetailState:a,cardId:n}){const t=$n(e,n),s=a.updateStatus,g=Ca(e,!1,!1,!1);let b=!1;return g.fetchState==="Completed"&&g.cards.length<=1&&(b=!0),{showMenuIcon:b,vgsVaultId:rt.cardVaultId,twoFAView:t,setPinWaitStatus:s}}),(function(e,a){const{navigate:n,cardId:t,location:s,currentTenant:g,debitCardDetailState:b}=a,h=b.chargeCard?.cardProviderID,{tenantEmailDomain:A}=g;return{onGetOtp:u=>{h!=null&&e(at(u,"ChargeCardHolder",t))},onUpdateDebitCardPinAttempt:u=>{e(Jn(t,u))},onResendOtp:u=>{h!=null&&e(et(u,"ChargeCardHolder",t))},onVerifyOtp:(u,m)=>{h!=null&&e(Xa(u,m,"ChargeCardHolder",t))},onVerifyOtpSuccess:u=>{u!=null&&te.saveZeniOtpTokenForCardHolder(u,t)},onSetPinSuccess:()=>{e(Oo({chargeCardId:t}))},onBackClick:()=>{const u=we(s.state?.pathnameStackToGoBack),m=u.poppedPathname==null||u.poppedPathname.includes("activate")===!0?ta(A):u.poppedPathname;n(m,{state:{pathnameStackToGoBack:u.newStack}})}}}))(Sc),Bi=Ve.div`
48
- display: flex;
49
- flex-direction: column;
50
- width: ${e=>`${Fi.containerWidth.value(e.windowSize)}%`};
51
- ${e=>e.windowSize!=="small"?"overflow: auto;":""}
52
- box-shadow: ${e=>`${Ya.sp0} 2px ${Ya.sp1} ${e.theme.colors.dropShadowNormal}`};
53
- `,Ri=Ve.div`
54
- display: flex;
55
- min-height: 100%;
56
- width: 100%;
57
- flex: 1 1 auto;
58
- flex-direction: column;
59
- align-items: center;
60
- background-color: ${e=>e.theme.colors.grey4};
61
- box-shadow: ${e=>`${Ya.sp0} 2px ${Ya.sp1} ${e.theme.colors.dropShadowNormal}`};
62
- `,Oi={overlayWidth:new Fa(ht[12],ht[12],ht[9])},Ui=Pe((function(e,a){const n=Lt(e,!1,!1),t=a.lineId,s=n.customAddress[t],g=n.customAddressStatus[t]??{fetchState:"Not-Started",error:void 0};return{googleAPIKey:a.googleAPIKey,customAddress:s,customAddressStatus:g,lineId:t}}),(function(e,a){const{newCustomAddressId:n,lineId:t,chargeCardTypeOption:s}=a;return{onSubmitHandler:g=>{n!=null&&e(ur(`${s==="creditCard"?"credit":"debit"}_custom_shipping_${t}_address`));const b=Bc(g);e(Mo({addressType:`${s==="creditCard"?"credit":"debit"}_custom_shipping_${t}_address`,addressToCreate:b})),e(No(`${s==="creditCard"?"credit":"debit"}_custom_shipping_${t}_address`))},onDismissClick:()=>{a.onDismissClick(),n!=null&&e(jo({addressId:n,cardLineId:t,cardType:s==="creditCard"?"business_physical_credit_card":"business_physical_debit_card"}))}}}))(yc),ji=({lineId:e,closeDrawerHandler:a,chargeCardTypeOption:n})=>{const t=Ot(),s=Ta(),g=()=>{a()},b=d((h=>Uo(`${n==="creditCard"?"credit":"debit"}_custom_shipping_${e}_address`,h)))?.newAddressId;return o.jsx(Ar,{anchor:"right",open:e.length>0,PaperProps:{style:{minWidth:Oi.overlayWidth.valuePercentage(s),boxShadow:"none",zIndex:8}},slotProps:{backdrop:{style:{opacity:.75,backgroundColor:t.colors.black,cursor:"pointer"}}},onClose:(h,A)=>(A==="backdropClick"||A==="escapeKeyDown")&&g(),children:o.jsx(Ui,{googleAPIKey:rt.googleMapsAPIKey,onDismissClick:g,lineId:e,chargeCardTypeOption:n,newCustomAddressId:b})})},Mi=Pe((function(e,a){const{isChargeCardFeatureEnabled:n,isDebitCardFeatureEnabled:t,isIssuePhysicalCardEnabled:s,isIssuePhysicalDebitCardEnabled:g,isChargeCardSetupEnabled:b,isDebitCardSetupEnabled:h}=a,A=Lt(e,n&&b,t&&h);return{issueChargeCards:A,isIssuePhysicalCardEnabled:s,isIssuePhysicalDebitCardEnabled:g,isDebitCardFeatureEnabled:t,isChargeCardFeatureEnabled:n,isChargeCardSetupEnabled:b,isDebitCardSetupEnabled:h,cardHolderCandidates:A.userList.map((u=>u.user)).filter(Boolean),allRoles:A.userList.map((u=>u.userRole)),allAccountingClasses:A.allAccountingClasses,userList:A.userList}}),(function(e,a){return{onIssueCardClick:()=>{e($o())},onSaveChangesToLocalStore:n=>{e(Ho(n))},onDismissClick:()=>{e(mr()),a.navigate("../")},resetCustomAddressByLineID:(n,t)=>{e(ur(`${t==="creditCard"?"credit":"debit"}_custom_shipping_${n}_address`))},openAddAddressDrawerHandler:a.openAddAddressDrawerHandler}}))(Ec);function Ni(){const e=te.getSignedInUser(),a=de(),n=me(),t=Ic(),[s]=_n(),g=s.get("cardType"),{useFeatureGate:b}=le(),{isFeatureEnabled:h}=b(Z.isIssuePhysicalCardEnabled),{isFeatureEnabled:A}=b(Z.isIssuePhysicalDebitCardEnabled),{isFeatureEnabled:u}=b(Z.isDebitCardFeatureEnabled),{isFeatureEnabled:m}=b(Z.isChargeCardFeatureEnabled),F=d((z=>fe(z))),w=Le(u,F),p=Re({isDebitCardFeatureEnabled:u,isBankingOnlyTenant:w}),T=Fe(F),B=xe(F),S=F.companyChargeCardInfo?.info?.chargeCardsCreditAccountLimit??0,l=Oe({isCardsOnlyTenant:T,isChargeCardFeatureEnabled:m,isBookKeepingTenant:B,isDebitCardProductVisible:p,chargeCardsCreditAccountLimit:S}),[C,L]=r.useState(!1);if(e==null)throw Error("Can't access issue card page without signing in...");r.useEffect((()=>{C||(L(!0),n(Vo(p&&_,l&&k,!1)))}),[C,L,n]);const k=!!F.companyChargeCardInfo?.info?.isChargeCardEnabled,_=!!F.companyDebitCardInfo?.info?.isDebitCardEnabled,D=d((z=>Lt(z,l&&k,p&&_))),M=D.fetchState,E=D.issueCardStatus.fetchState,y=D.lastSelfIssuedDebitCardId,R=d((z=>y!=null?lr(z.chargeCardState,y):void 0)),[i,f]=r.useState(null),[j,G]=r.useState(null),U=()=>{f(null)},x=(z,H)=>{f(z),G(H)};return r.useEffect((()=>{if(E==="Completed"){if(y!=null&&R?.type.code==="business_virtual_debit_card"){let z;z=R?.status.code==="request_on_hold"&&e.userId===R.cardHolderUserId?wr(F.tenantEmailDomain):_e(F.tenantEmailDomain,y,e,R),a(z)}else a("../");n(mr())}}),[E,y]),M==="Completed"?o.jsxs(o.Fragment,{children:[i!==null&&j!==null?o.jsx(ji,{closeDrawerHandler:U,lineId:i,chargeCardTypeOption:j}):null,o.jsx(Mi,{themeState:t,isIssuePhysicalCardEnabled:h,isIssuePhysicalDebitCardEnabled:A,isDebitCardFeatureEnabled:p,isChargeCardFeatureEnabled:l,isChargeCardSetupEnabled:k,isDebitCardSetupEnabled:_,navigate:a,fetchState:D.fetchState,openAddAddressDrawerHandler:x,defaultCardType:g==="creditCard"||g==="debitCard"?g:void 0})]}):M==="Error"?o.jsx(ot,{}):o.jsx(kc,{})}const zr=[pa,it],Vi=new Set(zr),Hi=Ve.div`
63
- display: flex;
64
- height: 100vh;
65
- width: 100%;
66
- flex: 1 1 auto;
67
- flex-direction: column;
68
- overflow: auto;
69
- align-items: center;
70
- background-color: ${e=>e.theme.colors.grey4};
71
- `,$i=Pe((function(e,a){const{myPendingActivationChargeCardListState:n}=a;return{myPendingActivationChargeCardListView:n,uiState:n.uiState,signedInUser:a.signedInUser}}),(function(e,a){const{navigate:n,currentTenant:t,location:s,signedInUser:g,myPendingActivationChargeCardListState:b}=a,{tenantEmailDomain:h}=t,{cards:A}=b;return{onChargeCardRowClick:u=>{const m=Pr(A,u),F=_e(h,u,g,m),w=ke(s.state?.pathnameStackToGoBack,s.pathname);n(F,{state:{pathnameStackToGoBack:w}})},onColumnSortConfigChanged:(u,m)=>{e(It({uiState:{sortKey:u,sortOrder:m}}))},onReloadCards:()=>{e(Me())},onBackClick:()=>{const u=t.userRole.includes("charge_card_user");e(It({uiState:{sortKey:u?"cardName":"owner",sortOrder:"ascending"}})),n("../")}}}))(Ac);function Gi(){const e=de(),a=me(),n=he(),t=Ot(),[s,g]=r.useState(!1),b=d((x=>Go(x))),h=d((x=>fe(x))),A=d((x=>da(x,h.companyId))),u=la(A.controllers),{useFeatureGate:m}=le(),{isFeatureEnabled:F}=m(Z.isChargeCardFeatureEnabled),{isFeatureEnabled:w}=m(Z.isDebitCardFeatureEnabled),p=Le(w,h),T=Re({isDebitCardFeatureEnabled:w,isBankingOnlyTenant:p}),B=!!h.companyDebitCardInfo?.info?.isDebitCardEnabled,S=!!h.companyChargeCardInfo?.info?.isChargeCardEnabled,l=Be(),C=Fe(h),L=xe(h),k=h.companyChargeCardInfo?.info?.chargeCardsCreditAccountLimit??0,_=Oe({isCardsOnlyTenant:C,isChargeCardFeatureEnabled:F,isBookKeepingTenant:L,isDebitCardProductVisible:T,chargeCardsCreditAccountLimit:k}),D=Te(l?.loggedInUserRoleMap),M=d((x=>ma(x))),{creditAccount:E,creditAccountRepayment:y}=d((x=>ua(x))),R=d((x=>cr(x))).cards.filter((x=>x.type.code.includes("debit"))).map((x=>x.connectedAccountId)),i=[...new Set(R)],f=d((x=>tt(x,i)));r.useEffect((()=>{s||b.fetchState==="Completed"||b.fetchState==="In-Progress"||(g(!0),a(Me()),a(Ja()))}),[s,a,b.fetchState]),r.useEffect((()=>{if(b.fetchState==="Completed"&&b.cards.length===1&&j!=null){const x=_e(h.tenantEmailDomain,b.cards[0].id,j,b.cards[0]);e(x,{state:{message:n.state?.message}})}}),[b.fetchState,b.cards]);const j=te.getSignedInUser();r.useEffect((()=>{E.fetchState!=="Completed"&&E.fetchState!=="In-Progress"&&_&&S&&D&&a(qe()),y.fetchState!=="Completed"&&y.fetchState!=="In-Progress"&&D&&a(Tt()),f.fetchState!=="Completed"&&f.fetchState!=="In-Progress"&&T&&B&&D&&a(ir())}),[E.fetchState,y.fetchState,a,f.fetchState,T,B,D,_,S]);const G=aa(h);if(Vt({events:ha(G,zr),onEvent:(x,z)=>{if(!Vi.has(x))return;const H=Yt(z);if(x===pa){const v=ie(H?.card_id);if(v!=null){const P=Zt(H,v);if(P!=null)return void a(Ft(P))}}a(Me(!0))},onSubscribed:()=>{a(Me(!0))}}),j==null)throw Error("Can't access address page without signing in...");const U=b.cards!=null&&b.cards.length>0;if(b.fetchState==="Completed"||U){const x=Xe(_,T,B,S);return o.jsx(Hi,{children:o.jsx($i,{navigate:e,currentTenant:h,signedInUser:j,productInformation:x,myPendingActivationChargeCardListState:b,isChargeCardFeatureEnabled:_,isDebitCardFeatureEnabled:T,isDebitCardSetupEnabled:B,isChargeCardSetupEnabled:S,chargeCardCashbackDetailState:M,creditAccount:E,creditAccountRepayment:y,depositAccountListWithDebitCardIssued:f,controllerEmails:u,location:n})})}return o.jsx(va,{fetchState:"In-Progress",style:{backgroundColor:t.colors.grey5}})}const Ki=Pe((function(e,a){const{companyId:n,companyLegalName:t}=a;return{chargeCardSetupView:wa(e,n),admins:a.adminList,companyLegalName:t}}),(function(e,a){const{navigate:n,companyId:t,isCompanyBusinessVerificationAndPaymentSetUpDone:s,isDebitCardSetupEnabled:g,isChargeCardSetupEnabled:b,signedInUser:h,location:A,productInformation:u,isEarlyPayEnabled:m,controllerEmails:F,chargeCardsCreditAccountLimit:w}=a;return{onSetupButtonClick:p=>{if(h!=null&&ae.trackCardsPromoPageClicked("enable cards"),s)switch(ae.trackCardsEnableCardsClick(F,u,"Cards Promo"),p){case"credit":e(We(t,!0,"charge_cards",m,!1));break;case"debit":e(We(t,!0,"debit_cards",m,!1));break;case"debit_and_credit":e(w===0?We(t,!0,"debit_cards",m,!0):We(t,!0,"charge_cards__debit_cards",m,!1))}else switch(ae.trackCardsSetupCardsClick(F,u,"Cards Promo"),p){case"credit":e(We(t,!1,"charge_cards",m,!1));break;case"debit":e(We(t,!1,"debit_cards",m,!1));break;case"debit_and_credit":e(w===0?We(t,!1,"debit_cards",m,!0):We(t,!1,"charge_cards__debit_cards",m,!1))}},onBackClick:()=>{const p=we(A.state?.pathnameStackToGoBack);let T=p.poppedPathname;T==null&&(T=g||b?"..":"../.."),n(T,{state:{pathnameStackToGoBack:p.newStack}})},onLetsGoClick:()=>{n("./onboard")},onSetupChargeCardSuccess:()=>{s?(e(Qa()),n("../",{relative:"path"})):n("../setup",{relative:"path"})},onExpressInterestClick:()=>{e(Yo(t))}}}))(Pc),zi=()=>{const e=Dc(),a=de(),{tenantEmailDomain:n}=Ne(),[t]=_n(),s=t.get("cardPromoType"),g=me(),{useDynamicConfig:b,useFeatureGate:h}=le(),[A,u]=r.useState(!1),{isFeatureEnabled:m}=h(Z.isDebitCardFeatureEnabled),{isFeatureEnabled:F}=h(Z.isEarlyPayFeatureEnabled),{isFeatureEnabled:w}=h(Z.isChargeCardFeatureEnabled),{configValue:p}=b(Qe.zeniCardsConfig),T=d((J=>fe(J))),B=d((J=>da(J,T.companyId))),S=la(B.controllers),l=p.charge_card_cashback_rate_per_transaction!=null?p.charge_card_cashback_rate_per_transaction:.0175,C=he(),L=te.getSignedInUserTenant(n)?.companyId??T.companyId,k=d((J=>wa(J,L))),_=k.primaryFundingAccount,D=T.companyBillPayInfo?.info,M=Fe(T),E=xe(T),y=Le(m,T),R=T.companyChargeCardInfo?.info?.chargeCardsCreditAccountLimit??0,i=Re({isDebitCardFeatureEnabled:m,isBankingOnlyTenant:y}),f=Oe({isCardsOnlyTenant:M,isChargeCardFeatureEnabled:w,isBookKeepingTenant:E,isDebitCardProductVisible:i,chargeCardsCreditAccountLimit:R}),j=_r({isCardsOnlyTenant:M,isChargeCardFeatureEnabled:w,isBookKeepingTenant:E}),G=i&&f===!1,U=D?.businessVerificationStatus?.code==="verified"&&(G||_?.accType==="depositAccount"||Ko(_?.providerVerificationStatus?.code??"")),x=te.getSignedInUser(),z=!!T.companyZeniAccountInfo?.info?.isZeniAccountEnabled,H=!!T.companyChargeCardInfo?.info?.isChargeCardTOSAccepted,v=!!T.company?.companyChargeCardInfo?.isChargeCardEnabled,P=!!T.company?.companyDebitCardInfo?.isDebitCardEnabled,K=!!T.companyChargeCardInfo?.info?.isChargeCardEnabled,W=!!T.companyDebitCardInfo?.info?.isDebitCardEnabled,I=!!T.companyDebitCardInfo?.info?.isDebitCardTOSAccepted,N=J=>{u(J)},V=d((J=>J.chargeCardSetupViewState.fetchState));if(x==null)throw Error("Can't access Charge Card promo page without signing in...");const Q=Be(),c=Te(Q?.loggedInUserRoleMap),O=xt(Q?.loggedInUserRoleMap),[q,se]=r.useState(!1),[X,He]=r.useState(!1),[Ae,ge]=r.useState(!1);r.useEffect((()=>{q===!1&&C.state?.message==="activation"&&se(!0)}),[C.state]),r.useEffect((()=>{X||V!=="Not-Started"||L==null||(He(!0),g(Pa(L,!0)))}),[X,V,L,g]);const re=T.companyChargeCardInfo?.info!=null&&Ia({cardInfo:T.companyChargeCardInfo.info,isProductVisible:j&&v,isTOSAccepted:H,isSetupEnabled:K,isUserHasCardsAdminLevelAccess:c,isUserHasCardsAccess:O}),be=T.companyDebitCardInfo?.info!=null&&Ia({cardInfo:T.companyDebitCardInfo.info,isProductVisible:i&&P,isTOSAccepted:I,isSetupEnabled:W,isUserHasCardsAdminLevelAccess:c,isUserHasCardsAccess:O}),ue=i&&be&&j&&R>=0&&re?"debit_and_credit":i&&be?"debit":"credit",oe=Lc(s,ue),Se=k?.chargeCardTermsDetails?.fetchStatus?.fetchState,ee=r.useRef(null);r.useEffect((()=>{Se==="In-Progress"?ee.current=oe:Se!=="Error"&&Se!=="Not-Started"||(ee.current=null)}),[Se,oe]);const De=Se!=="In-Progress"&&Se!=="Completed"||ee.current==null?oe:ee.current;r.useEffect((()=>{oe==="credit"&&(K||j===!1&&W)||oe==="debit"&&W||oe==="debit_and_credit"&&W&&K?a("../"):(oe==="debit_and_credit"&&H===!0&&I===!0||oe==="credit"&&(H===!0||j===!1&&I===!0)||oe==="debit"&&I===!0)&&c===!0&&a("../setup")}),[U,K,W,oe,H,I]),r.useEffect((()=>{Ae||(g(zo("cardAdmin")),ge(!0))}),[Ae]);const ve=d((J=>sr(J.userState,J.userRoleState,J.userListViewState,"cardAdmin"))),Ce=Xe(j,i,W,K);return(J=>{switch(J){case"credit":return v;case"debit":return P;case"debit_and_credit":return v&&P;default:return!1}})(De)?(re||be)&&V==="Completed"?o.jsxs(o.Fragment,{children:[o.jsx(Ut,{analytics:ae,onLoad:()=>{if(ae.trackPageLoaded(Er.Event.cardsPromoPage),!!j&&!K||!!i&&!W||!!j&&!!i&&!W&&!K){const J=Yi({isDebitCardSetupEnabled:W,isChargeCardSetupEnabled:K,isCreditCardProductVisibleForExpressInterest:j,isDebitCardProductVisible:i});ae.trackCardsPromoView(S,Ce,"Page",J,"Promo Page")}}}),o.jsx(nt,{showConfetti:q}),o.jsx(Ee,{isAppContentDrawerOpen:A,handleDrawerToggle:N}),o.jsx(Ki,{signedInUser:x,location:C,meetingUrl:e("charge_card_promo"),showEnableCardButton:U,isCompanyBusinessVerificationAndPaymentSetUpDone:U,isChargeCardSetupEnabled:K,isDebitCardSetupEnabled:W,companyLegalName:T.companyName,adminList:ve.users,isCheckingEnabled:z,navigate:a,companyId:L,cardPromoType:De,controllerEmails:S,productInformation:Ce,isCreditCardProductVisible:f,isDebitCardFeatureEnabled:m,isEarlyPayEnabled:F,cashbackRate:l,chargeCardsCreditAccountLimit:R,onClickMenuIcon:()=>{N(!0)}})]}):o.jsxs(o.Fragment,{children:[o.jsx(Ee,{isAppContentDrawerOpen:A,handleDrawerToggle:N}),o.jsx(_c,{})]}):o.jsx(Je,{to:"../",replace:!0})},Yi=({isDebitCardSetupEnabled:e,isChargeCardSetupEnabled:a,isCreditCardProductVisibleForExpressInterest:n,isDebitCardProductVisible:t})=>n&&t&&!e&&!a?"Credit & Debit Card":n&&!a?"Credit Card":t&&!e?"Debit Card":"";function Id(){const e=he(),a=d((Q=>fe(Q))),{useFeatureGate:n}=le(),{isFeatureEnabled:t}=n(Z.isChargeCardFeatureEnabled),{isFeatureEnabled:s}=n(Z.isDebitCardFeatureEnabled),{isFeatureEnabled:g}=n(Z.isEarlyPayFeatureEnabled),{isFeatureEnabled:b}=n(Z.isChargeCardPaymentHistoryFeatureEnabled),{isFeatureEnabled:h}=n(Z.isCardPolicyEnabled),A=Le(s,a),u=Re({isDebitCardFeatureEnabled:s,isBankingOnlyTenant:A}),m=wc(a,t,s),F=!!a.company?.companyChargeCardInfo.isChargeCardTOSAccepted,w=!!a.company?.companyDebitCardInfo.isDebitCardTOSAccepted,p=!!a.company?.companyChargeCardInfo?.isChargeCardEnabled,T=!!a.company?.companyDebitCardInfo?.isDebitCardEnabled,B=!!a.companyChargeCardInfo?.info?.isChargeCardEnabled,S=!!a.companyDebitCardInfo?.info?.isDebitCardEnabled,l=Be(),C=Te(l?.loggedInUserRoleMap),{isCardsShuttingDown:L}=kr(a.tenantId,a.company?.managementInfo?.receiverEmails),k=xt(l?.loggedInUserRoleMap),{isFeatureEnabled:_}=n(Z.isCashbackFeatureEnabled),D=a.userRole.includes("charge_card_user"),M=!D,E=!D&&B,y=a?.userRole!=null&&Zo(a?.userRole),R=(a?.company==null||a.company.featuresActivationInfo?.isBillPayFeatureEnabled&&!y)&&Wo(l?.loggedInUserRoleMap),i=qo(l?.loggedInUserRoleMap),f=(a?.company==null||a.company.featuresActivationInfo?.isReimbursementFeatureEnabled&&!y)&&Jo(l?.loggedInUserRoleMap),{isFeatureEnabled:j}=n(Z.isDepositAccountsFeatureEnabled),G=j&&!y&&Kn(l?.loggedInUserRoleMap),U=B&&p&&!y,x=S&&T&&!y,z=m&&!y&&Te(l?.loggedInUserRoleMap),H=Qo(l?.loggedInUserRoleMap),v=Fe(a),P=xe(a),K=a.companyChargeCardInfo?.info?.chargeCardsCreditAccountLimit??0,W=Oe({isCardsOnlyTenant:v,isChargeCardFeatureEnabled:t,isBookKeepingTenant:P,isDebitCardProductVisible:u,chargeCardsCreditAccountLimit:K}),I=a.companyChargeCardInfo?.info!=null&&Ia({cardInfo:a.companyChargeCardInfo.info,isProductVisible:W&&p,isTOSAccepted:F,isSetupEnabled:B,isUserHasCardsAdminLevelAccess:C,isUserHasCardsAccess:k}),N=a.companyDebitCardInfo?.info!=null&&Ia({cardInfo:a.companyDebitCardInfo.info,isProductVisible:u&&T,isTOSAccepted:w,isSetupEnabled:S,isUserHasCardsAdminLevelAccess:C,isUserHasCardsAccess:k}),V=I||N;return o.jsxs(cs,{children:[C?o.jsx(ne,{path:"setup",element:o.jsx(Sn,{isBillPayAdminLevelAccess:R,isReimbursementAdminLevelAccess:f,isZeniAccountAdminLevelAccess:G,isChargeCardAdminLevelAccess:z,isUserHasOnlyCardAccess:H,isUserHasOnlyBillPayAccess:i,productType:"charge_cards",type:"setup"})}):null,C?o.jsx(ne,{path:"verification",element:o.jsx(Sn,{isBillPayAdminLevelAccess:R,isUserHasOnlyBillPayAccess:i,isReimbursementAdminLevelAccess:f,isZeniAccountAdminLevelAccess:G,isChargeCardAdminLevelAccess:z,isUserHasOnlyCardAccess:H,productType:"charge_cards",type:"verification"})}):null,C&&h?o.jsxs(o.Fragment,{children:[o.jsx(ne,{path:"policy",element:o.jsx(Yc,{})}),o.jsx(ne,{path:"policy/new",element:o.jsx(jc,{})}),o.jsx(ne,{path:"policy/:templateId/edit",element:o.jsx(Hc,{})})]}):null,o.jsx(ne,{path:"promo",element:o.jsx(zi,{})}),U||x?o.jsxs(o.Fragment,{children:[o.jsx(ne,{path:"/",element:o.jsx(kn,{isPaymentDrawerOpen:!1})}),z&&g?o.jsx(ne,{path:"payment",element:o.jsx(kn,{isPaymentDrawerOpen:!0})}):null,o.jsx(ne,{path:"activate",element:o.jsx(Gi,{})}),o.jsx(ne,{path:"onboard",element:o.jsx(wi,{})}),C&&L!==!0?o.jsx(ne,{path:"new",element:o.jsx(Ni,{})}):C?o.jsx(ne,{path:"new",element:o.jsx(Je,{to:"..",replace:!0})}):null,_&&M?o.jsx(ne,{path:"cashback",element:o.jsx(Qc,{})}):null,E?o.jsx(ne,{path:"statements",element:o.jsx(Di,{})}):null,z&&b&&B?o.jsx(ne,{path:"payment-history",element:o.jsx(Ai,{})}):null,o.jsx(ne,{path:":cardId/activate",element:o.jsx(ai,{})}),o.jsx(ne,{path:":cardId/setPin",element:o.jsx(xi,{})}),o.jsx(ne,{path:":cardId/addToWallet",element:o.jsx(Zc,{})}),o.jsx(ne,{path:":cardId/*",element:o.jsx(ui,{})}),o.jsx(ne,{path:"*",element:o.jsx(ot,{})})]}):(F||w)&&C?o.jsx(ne,{path:"*",element:o.jsx(Je,{to:"../setup"})}):V?o.jsx(ne,{path:"*",element:o.jsx(Je,{to:"../promo",state:e.state})}):o.jsx(ne,{path:"*",element:null})]})}export{Id as default};
@@ -1 +0,0 @@
1
- import{j as m}from"./liveblocks-UOzcPsHa.js";import{a as g}from"./sentry-DHDsO12F.js";import{h as w,u as T,g as x,i as k,j as O,l as E}from"./core-B5mDy9pu.js";import{z as D,br as F,a8 as P,j,S as V,n as C,bs as A,ae as L,aG as U,p as B}from"./index-6nH5LMe4.js";import{fF as b,gI as M,Bw as _,gD as z,c8 as G,Y2 as R,bn as Y,uT as H,uH as Z,mz as $,o8 as S,Y3 as q,bE as J,cE as N,oj as K,ot as Q}from"./zeni-epic-state-7eY0g-Bc.js";import"./mui-Do6nLzGb.js";import{d as W}from"./routePaths-uBvxqlLY.js";import{M as X}from"./MobileAppDrawer-0YtWXA3B.js";(function(){try{var t=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},a=new t.Error().stack;a&&(t._sentryDebugIds=t._sentryDebugIds||{},t._sentryDebugIds[a]="ecde6560-97cb-4d6c-9923-dedc9e847859",t._sentryDebugIdIdentifier="sentry-dbid-ecde6560-97cb-4d6c-9923-dedc9e847859")}catch{}})();const ee=E((function(t){const a=z(t),i=D.getSignedInUser(),p=b(t),c=p.tenantId,l={userId:i?.userId??"",sessionId:i?.zeniSessionId??"",tenantId:c??""},f=G(p?.userRole??[])&&a.localData.updateStatus.fetchState!=="In-Progress"?void 0:"readonly",e=R(t.companyConfigState),n=t.countryListState?.byCountryListCode?.nationalityCountryList?.countries??[];return{isCompanyVerified:a.companyView?.company?.company?.companyBillPayInfo?.companyVerificationStatus?.code==="verified",companyPassportView:a,allIndustries:e.companyIndustries??[],allNationalityCountries:n,isDisabled:f,authParams:l,filesEndPoint:`${L.fileMicroServiceBaseUrl}`,isZeniUser:Y(i)}}),(function(t,a){const{companyId:i,currentTenant:p,navigate:c,location:l}=a,{tenantEmailDomain:f}=p;return{onScheduleClick:e=>{let n=e.href;n.includes("http")||(n="https://".concat(n)),window.open(n,"_blank")},onSaveAll:()=>{t(Q())},onAddressClick:e=>{const n=W(f,e),o=B(l.state?.pathnameStackToGoBack,l.pathname);c(n,{state:{pathnameStackToGoBack:o}})},onResetClick:()=>{t(K({companyId:i}))},onBackClick:()=>{c("../")},onCompanyDetailsChanged:e=>{const{companyInfo:n,incInfo:o,taxDetails:r,zeniFinanceTeam:d}=e,{website:u}=n,{meetingLink:y}=d,{incDate:s}=o,{taxesFiledYears:h}=r,v={companyInfo:{...n,website:u!=""&&u!=null?N(u):void 0,meetingLink:y!=""&&y!=null?N(y):void 0,industry:n.industry.selectedOption,companyIndustryType:n.companyIndustryType?.selectedOption??void 0,companySubIndustry:n.companySubIndustry?.selectedOption??void 0,businessModel:n.businessModel.selectedOption??"",companySourceOfFunds:n.companySourceOfFunds?.selectedOption,companySourceOfFundsDescription:n.companySourceOfFundsDescription??void 0,countriesOfOperations:n.countriesOfOperations?.selectedOptions?.map((I=>I.length===2?I:U(I)))??[],transactionVolume:n.transactionVolume?.selectedOption??void 0,transactionVolumeDescription:n.transactionVolumeDescription??void 0,regulatedStatus:n.regulatedStatus??void 0,regulatedStatusDescription:n.regulatedStatusDescription??void 0,usNexus:n.usNexus??void 0,usNexusTypes:n.usNexusTypes?.selectedOptions??[],purposeOfAccount:n.purposeOfAccount?.selectedOption??void 0,purposeOfAccountDescription:n.purposeOfAccountDescription??void 0},incInfo:{typeOfInc:o.typeOfInc.selectedOption??"",stateOfInc:o.stateOfInc.selectedOption??"",incDate:s!=null?J(s?.toString()):s,fileId:o.fileIds[0]},taxDetails:{taxIdOrEIN:r.taxIdOrEIN,sicCode:r.sicCode,naicsCode:r.naicsCode,dunsNumber:r.dunsNumber,taxesFiledYears:h.selectedOptions.map((I=>parseInt(I))),fileId:r.fileIds[0]}};t(S({companyDetails:v}))},onPrimaryContactDetailsUpdated:e=>{t(S({primaryContact:{userId:e.userId,email:e.email.trim(),firstName:e.name.firstName,lastName:e.name.lastName}}))},onNewCompanyOfficerAdded:e=>{t(S({officers:[{officerType:e.officerType,email:e.email.trim(),phone:e.phone,firstName:e.name.firstName,lastName:e.name.lastName,userId:void 0}]}))},onNewCompanyOfficerRemoved:e=>{t(q(e))},onCompanyOfficerUpdated:e=>{t(S({officers:[{officerType:e.officerType,email:e.email.trim(),phone:e.phone,firstName:e.name.firstName,lastName:e.name.lastName,userId:e.userId}]}))},updateFilesEntity:e=>{t($({files:e}))},onDeleteFile:e=>{t(Z(e))},onEditFileName:(e,n)=>{t(H(e,n.split(".")[0]))}}}))(A);function de(){const t=w(),a=T(),i=x(),{tenantEmailDomain:p}=k(),[c,l]=g.useState(!1),[f,e]=g.useState(!1),n=O((s=>s.companyViewState.passportView.fetchState)),o=O((s=>s.companyConfigState.fetchState)),r=O((s=>b(s))),d=r.companyId??D.getSignedInUserTenant(p)?.companyId;if(D.getSignedInUser()==null)throw Error("Can't access company details page without signing in...");g.useEffect((()=>{c||n!=="Not-Started"||d==null||(l(!0),a(M(d)))}),[c,n,d,a]),g.useEffect((()=>{o==="Not-Started"&&a(_())}),[o,a]);const u=s=>{e(s)},y=n==="Not-Started"||n==="In-Progress"||o==="Not-Started"||o==="In-Progress";return d!=null&&n==="Error"?m.jsx(F,{onGoHome:()=>t("../",{replace:!0}),onReload:()=>window.location.reload()}):m.jsxs(m.Fragment,{children:[m.jsx(P,{analytics:j,onLoad:s=>s.trackPageLoaded(V.Event.companyPassport,C(i)?"Settings":"Company Passport")}),C(i)?m.jsx(X,{isAppContentDrawerOpen:f,handleDrawerToggle:u}):null,m.jsx(ee,{companyId:d,navigate:t,location:i,isLoading:y,currentTenant:r,isSettings:C(i),onClickMenuIcon:()=>{u(!0)}})]})}export{de as C};
@@ -1,11 +0,0 @@
1
- import{j as I}from"./liveblocks-UOzcPsHa.js";import{a as o}from"./sentry-DHDsO12F.js";import{u as H,h as P,g as R,j as C,N as w}from"./core-B5mDy9pu.js";import{TJ as q,fF as z,gl as G,pS as J,gM as A,gk as M,gi as Q,U7 as V,gh as O}from"./zeni-epic-state-7eY0g-Bc.js";import{u as B,z as E,L as D,G as K,H as W}from"./index-6nH5LMe4.js";import{n as X}from"./mui-Do6nLzGb.js";import{P as b,a as _}from"./AccountMappingScreen-Euit4Ttk.js";import{t as Y}from"./getLocaleForTenant-DH5Avx3x.js";import{g as Z,Q as ee}from"./QBOConnectionScreen-CWU6DFJl.js";import"./recharts-uFX1dZS-.js";import"./analytics-D6GpUSOP.js";import"./plaid-0g_vwjSd.js";import"./dnd-CGWe1ZMP.js";import"./stripe-cKAAJElX.js";import"./lottie-C5eNvt0I.js";import"./lexical-DW4lC8Zx.js";import"./pdf-DjwvAC2g.js";import"./utils-BsODCDYR.js";import"./MobileAppDrawer-0YtWXA3B.js";import"./InboxNotificationsProvider-BmF5-_KA.js";import"./useTaskManagerAccess-BG0Fkj9k.js";import"./accountMappingHelper-DqBiQF6x.js";import"./empty-Dj4ZMRNZ.js";import"./pdf-lib-CZXOqgb4.js";import"./index-k1-Pd2Ki.js";import"./url-BxiN6LKq.js";import"./index-6yt3BfRL.js";import"./decodeURIComponentSafe-DANuhXnG.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]="c6bf3300-3d69-4bea-8a7b-ec8fb6fd63cc",t._sentryDebugIdIdentifier="sentry-dbid-c6bf3300-3d69-4bea-8a7b-ec8fb6fd63cc")}catch{}})();const te=X.div`
2
- display: flex;
3
- flex: 1 1 auto;
4
- flex-direction: row;
5
- justify-content: center;
6
- align-items: center;
7
- width: 100%;
8
- height: 100vh;
9
- background-color: ${t=>t.theme.colors.background};
10
- box-shadow: ${t=>`0px 2px ${W.sp1} ${t.theme.colors.dropShadowNormal}`};
11
- `;function we(){const t=H(),i=P(),v=R(),{setLoading:d,clearAllLoading:m}=B(),h=o.useRef(!1),S=o.useRef(!1),N=o.useRef(!1),f=o.useRef(!1),{code:U,realmId:$,state:F}=Z(v.search),p=U!==""&&$!==""&&F!=="";p&&(N.current=!0);const j=sessionStorage.getItem(b),u=j===_.pending,L=j===_.ready,x=C((s=>q(s))),e=C((s=>z(s))),n=C((s=>s.tenantState.fetchState)),r=C((s=>s.tenantState.activeTenantFetchState.fetchState)),a=E.getSignedInUser(),g=E.getActiveTenantForUser()?.tenantId,l=e?.externalConnections?.fetchState,c=e?.externalConnections?.saveConnectionState,y=e.externalConnections?.accounting[0]?.isValid;o.useLayoutEffect((()=>{d(D.CONNECTION_AUTH)}),[d]),o.useEffect((()=>{h.current||a==null||g==null||(h.current=!0,n==="Completed"||r!=="Not-Started"&&r!=="Error"||(d(D.TENANT_FETCHING),t(G(a.userId,g))))}),[h,n,d]),o.useEffect((()=>{e.tenantId==null&&!S.current&&a!=null&&(S.current=!0,!(g==null||g!=null&&(r==="Completed"||r==="Error"))||n!=="Not-Started"&&n!=="Error"||t(J(a.userId)))}),[S,n,r]),o.useEffect((()=>{a==null||e?.tenantId==null||e.externalConnections!=null||n!=="Completed"&&r!=="Completed"||l==="In-Progress"||c!=="Error"||(d(D.CONNECTION_AUTH),t(A(a.userId,e.tenantId)))}),[c]),o.useEffect((()=>{n!=="Completed"&&r!=="Completed"||a==null||e?.tenantId==null||(t(M(e.tenantId)),E.saveActiveTenantDomainForUser(e.tenantEmailDomain),Q(a?.userId,a?.zeniSessionId,e.tenantId),K.updateAppLocaleID(Y(V(e))),e.externalConnections!=null||n!=="Completed"&&r!=="Completed"||l==="In-Progress"||a==null||e==null||t(A(a.userId,e.tenantId)))}),[n,r,l]),o.useEffect((()=>{x.tenantsCoreDetailsInOrder.length>0&&n==="Completed"&&E.saveSignedInUserTenants(x.tenantsCoreDetailsInOrder)}),[x.tenantsCoreDetailsInOrder.length,n]);const T=e==null||n!=="Completed"&&r!=="Completed"||l!=="Completed";if(o.useEffect((()=>{n!=="Completed"&&n!=="Error"||r!=="Completed"&&r!=="Error"||l!=="Completed"&&l!=="Error"||m()}),[n,r,l]),o.useEffect((()=>{u&&c==="In-Progress"&&(f.current=!0)}),[u,c]),o.useEffect((()=>{if(!u||T)return;const s=e.tenantEmailDomain!=null?`/${e.tenantEmailDomain}/settings/accounting`:"/";return f.current&&c==="Completed"?(sessionStorage.setItem(b,_.ready),m(),void i(s,{replace:!0})):f.current&&c==="Error"?(sessionStorage.removeItem(b),t(O({messageSection:"accounting_projects_qbo_reconnect_failed",messageText:"failed",type:"error"})),m(),void i(s,{replace:!0})):void(p||N.current||f.current||y!==!0||(sessionStorage.removeItem(b),t(O({messageSection:"accounting_projects_qbo_reconnect_failed",messageText:"failed",type:"error"})),m(),i(s,{replace:!0})))}),[u,T,c,p,y,e.tenantEmailDomain,m,t,i]),T)return null;if(p||y!==!0)return I.jsx(te,{children:I.jsx(ee,{})});if(u)return null;const k=e.tenantEmailDomain!=null?`/${e.tenantEmailDomain}/settings/accounting`:"/";return L?I.jsx(w,{to:k,replace:!0}):I.jsx(w,{to:"/",replace:!0})}export{we as default};
@@ -1 +0,0 @@
1
- import{j as i}from"./liveblocks-UOzcPsHa.js";import{z as m}from"./index-6nH5LMe4.js";import{g as n}from"./QBOConnectionScreen-CWU6DFJl.js";import"./sentry-DHDsO12F.js";import{g as p,N as a}from"./core-B5mDy9pu.js";import"./zeni-epic-state-7eY0g-Bc.js";import"./recharts-uFX1dZS-.js";import"./mui-Do6nLzGb.js";import"./analytics-D6GpUSOP.js";import"./plaid-0g_vwjSd.js";import"./dnd-CGWe1ZMP.js";import"./stripe-cKAAJElX.js";import"./lottie-C5eNvt0I.js";import"./lexical-DW4lC8Zx.js";import"./pdf-DjwvAC2g.js";import"./utils-BsODCDYR.js";import"./empty-Dj4ZMRNZ.js";import"./pdf-lib-CZXOqgb4.js";import"./index-k1-Pd2Ki.js";import"./url-BxiN6LKq.js";import"./index-6yt3BfRL.js";import"./decodeURIComponentSafe-DANuhXnG.js";(function(){try{var t=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},o=new t.Error().stack;o&&(t._sentryDebugIds=t._sentryDebugIds||{},t._sentryDebugIds[o]="a1205b81-d106-415b-bd92-85aeae53ace3",t._sentryDebugIdIdentifier="sentry-dbid-a1205b81-d106-415b-bd92-85aeae53ace3")}catch{}})();const U=()=>{const t=p(),{code:o,realmId:r,state:e}=n(t.search),s=m.getSignedInUser()?.userId??"";if(f(o,r,e,s)===!0){const d=`../../${e}/onboarding?code=${o}&realmId=${r}&state=auth_flow`;return i.jsx(a,{to:d})}return i.jsx(a,{to:"../../"})},f=(t,o,r,e)=>t!=""&&o!=""&&r!=""&&e!=null&&e!="";export{U as default,f as hasValidParams};
@@ -1,18 +0,0 @@
1
- import{j as l}from"./liveblocks-UOzcPsHa.js";import{h as w,g as C,j as h,l as E,i as V}from"./core-B5mDy9pu.js";import{YH as k,YO as _,gG as W,gF as K,gE as L,kP as M,WG as q,uK as J,fF as B,Ye as D,kN as F,YI as S,YR as G,kL as T,l6 as j}from"./zeni-epic-state-7eY0g-Bc.js";import{bM as Q,a1 as N,N as R,z as O,E as U,a4 as b,c as v,a7 as H,bN as X,H as Y,bO as ee,p as te}from"./index-6nH5LMe4.js";import{n as Z}from"./mui-Do6nLzGb.js";import"./sentry-DHDsO12F.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]="aa3e6d38-a4d4-4493-80f3-0e7691066cd6",e._sentryDebugIdIdentifier="sentry-dbid-aa3e6d38-a4d4-4493-80f3-0e7691066cd6")}catch{}})();const ae=E(null,(function(e,t){return{onSaveVendor:a=>{e(M(t.vendorId!==void 0?t.vendorId:void 0,t.billId,void 0,t.isExpressPayPage)),e(q("common")),a!=null&&e(J(a))},onGetOtp:a=>{e(L(a,"BillPayVendor"))},onResendOtp:a=>{e(K(a,"BillPayVendor"))},onVerifyOtp:(a,n)=>{e(W(a,n,"BillPayVendor"))},onVerifyOtpSuccess:(a,n,o)=>{e(_(a,n,o))}}}))(Q);function z({vendorId:e,billId:t,isExpressPayPage:a}){const n=w(),o=C(),s=h((r=>k(r,e)));return l.jsx(ae,{location:o,navigate:n,vendorId:e,billId:t,vendorViewDetails:s,isExpressPayPage:a??!1})}const ne=Z.div`
2
- display: flex;
3
- height: 100vh;
4
- width: 100%;
5
- flex: 1 1 auto;
6
- flex-direction: column;
7
- align-items: center;
8
- background-color: ${e=>e.theme.colors.grey4};
9
- `,oe=E((function(e,t){const{vendorId:a,billId:n}=t,o=k(e,a),s=D(e,t.isVendorRecommendationEnabled,t.isZeniAccountsFeatureEnabled,n);return{billId:n,isDisabled:o.bankAccountCreationState.fetchState==="In-Progress"?"readonly":void 0,vendorViewDetails:o,file:s.file,bankAccountContext:t.bankAccountContext}}),(function(e,t){const{navigate:a,location:n,vendorId:o}=t;return{onFetchBankName:s=>{e(j(s))},onSaveHandler:s=>{e(T(t.bankAccountContext,s,"standard",o))},onCancel:()=>{(()=>{const s=b(n.state?.pathnameStackToGoBack),r=s.poppedPathname??P();a(r,{state:{pathnameStackToGoBack:s.newStack}})})(),e(S())},onACHDetailsUpdated:s=>{const{bankAccountSection:r}=s;e(G({data:r}))},onBackClick:()=>{if(e(F({fetchState:"Not-Started"})),t.bankAccountContext==="express-pay")a("../",{relative:"path"});else{const s=b(t.location.state?.pathnameStackToGoBack),r=s.poppedPathname??P(0);t.navigate(r,{state:{pathnameStackToGoBack:s.newStack}})}e(S())}}}))(X);function fe({vendorIdParam:e,accountContext:t}){const a=w(),n=C(),o=N(),{vendorId:s,billId:r}=V(),i=e??s,{useFeatureGate:d}=R(),c=O.getSignedInUser(),p=h((u=>B(u))),g=U(),I=b(n.state?.pathnameStackToGoBack),f=t??(I.poppedPathname?.includes("vendor")===!0?"vendor":"billDetail"),m=h((u=>k(u,i))),{isFeatureEnabled:x}=d(v.isVendorRecommendationFeatureEnabled),{isFeatureEnabled:y}=d(v.isDepositAccountsFeatureEnabled);if(c==null)throw Error("Can't access address page without signing in...");return f==="billDetail"&&m.editVendorState?.saveStatus.fetchState==="In-Progress"?l.jsx(H,{fetchState:m.editVendorState?.saveStatus.fetchState??"Not-Started",style:{backgroundColor:g.colors.grey5}}):l.jsxs(ne,{windowSize:o,children:[l.jsx(z,{vendorId:i,billId:r}),l.jsx(oe,{location:n,navigate:a,billId:r,vendorId:i,currentTenant:p,bankAccountContext:f,isVendorRecommendationEnabled:x,isZeniAccountsFeatureEnabled:y})]})}const P=(e=2)=>{let t="../";for(let a=0;a<e;a++)t=`${t}../`;return t},me=(e,t,a)=>{let n=`/${e}/bill/${encodeURIComponent(t)}`;return a=="draft"&&(n+="/edit"),n},he=e=>`/${e}/bills`,ke=(e,t)=>{let a=`/${e}/bill`;return a=t!=null?a.concat(`/${t}/edit`):a.concat("/new"),a},A=(e,t,a,n)=>{let o=`/${e}/bill`;return o+=a!=null?`/${a}/edit/vendor`:"/new/vendor",o+=n!=null?`/${n}/edit/${t}`:`/create/${t}`,o};function Se(e,t,a){return A(e,"ach",t,a)}function ve(e,t,a){return A(e,"domestic",t,a)}function ge(e,t,a){return A(e,"international",t,a)}const se=(e,t,a)=>{let n=`/${e}/bill/`;return n=a!=null?n.concat(`${encodeURIComponent(a)}/${t}/`):n.concat(`new/${t}/`),n},de=Z.div`
10
- display: flex;
11
- height: 100vh;
12
- width: 100%;
13
- flex: 1 1 auto;
14
- flex-direction: column;
15
- align-items: center;
16
- background-color: ${e=>e.theme.colors.grey4};
17
- box-shadow: ${e=>`0px 2px ${Y.sp1} ${e.theme.colors.dropShadowNormal}`};
18
- `,re=E((function(e,t){const{vendorId:a,billId:n}=t,o=k(e,a),s=D(e,t.isVendorRecommendationEnabled,t.isZeniAccountsFeatureEnabled,n);return{billId:n,isDisabled:o.bankAccountCreationState.fetchState==="In-Progress"?"readonly":void 0,vendorViewDetails:o,file:s.file,bankAccountContext:t.bankAccountContext}}),(function(e,t){const{billId:a,navigate:n,location:o,vendorId:s,currentTenant:r}=t,{tenantEmailDomain:i}=r;return{onFetchBankName:d=>{e(j(d))},onSaveHandler:d=>{e(T(t.bankAccountContext,d,"us-domestic",s))},onWireDetailsUpdated:d=>{const{bankAccountSection:c}=d;e(G({data:c}))},onCancel:()=>{(()=>{const d=b(o.state?.pathnameStackToGoBack),c=d.poppedPathname??$();n(c,{state:{pathnameStackToGoBack:d.newStack}})})(),e(S())},onAddressClick:d=>{if(t.bankAccountContext==="express-pay")n("./add-address");else{const c=se(i,d,a),p=te(o.state?.pathnameStackToGoBack,o.pathname);n(c,{state:{pathnameStackToGoBack:p}})}},onBackClick:()=>{if(e(F({fetchState:"Not-Started"})),t.bankAccountContext==="express-pay")n("../",{relative:"path"});else{const d=b(t.location.state?.pathnameStackToGoBack),c=d.poppedPathname??$(0);t.navigate(c,{state:{pathnameStackToGoBack:d.newStack}})}e(S())}}}))(ee);function Ie({vendorIdParam:e,accountContext:t}){const a=w(),n=C(),o=N(),{vendorId:s,billId:r}=V(),i=e??s,d=O.getSignedInUser(),{useFeatureGate:c}=R(),p=U(),g=h((u=>B(u))),I=b(n.state?.pathnameStackToGoBack),f=t??(I.poppedPathname?.includes("vendor")===!0?"vendor":"billDetail"),m=h((u=>k(u,i))),{isFeatureEnabled:x}=c(v.isVendorRecommendationFeatureEnabled),{isFeatureEnabled:y}=c(v.isDepositAccountsFeatureEnabled);if(d==null)throw Error("Can't access address page without signing in...");return f==="billDetail"&&m.editVendorState?.saveStatus.fetchState==="In-Progress"?l.jsx(H,{fetchState:m.editVendorState?.saveStatus.fetchState??"Not-Started",style:{backgroundColor:p.colors.grey5,boxShadow:`0px 2px ${Y.sp1} ${p.colors.dropShadowNormal}`}}):l.jsxs(de,{windowSize:o,children:[l.jsx(z,{vendorId:i,billId:r}),l.jsx(re,{location:n,navigate:a,billId:r,vendorId:i,currentTenant:g,bankAccountContext:f,isVendorRecommendationEnabled:x,isZeniAccountsFeatureEnabled:y})]})}const $=(e=2)=>{let t="../";for(let a=0;a<e;a++)t=`${t}../`;return t};export{fe as A,Ie as D,z as V,me as a,se as b,ke as c,ve as d,he as g,ge as i,Se as v};
@@ -1 +0,0 @@
1
- import{j as s}from"./liveblocks-UOzcPsHa.js";import{a as d}from"./sentry-DHDsO12F.js";import{h as B,u as F,g as G,i as A,j as l,N as q,l as $,n as N,o as _}from"./core-B5mDy9pu.js";import{WK as O,fF as H,W0 as M,m$ as R,S1 as k,WP as Y,WF as z,l$ as K,S2 as S,W5 as V,W6 as J,WH as L,WG as Q}from"./zeni-epic-state-7eY0g-Bc.js";import{b8 as U,j as X,a4 as Z,p as tt}from"./index-6nH5LMe4.js";import"./mui-Do6nLzGb.js";import{d as b}from"./decodeURIComponentSafe-DANuhXnG.js";import{w as et}from"./withTransactionSidePanel-DK-Ex27L.js";import{f as at,c as nt}from"./routePaths-uBvxqlLY.js";import"./recharts-uFX1dZS-.js";import"./analytics-D6GpUSOP.js";import"./plaid-0g_vwjSd.js";import"./dnd-CGWe1ZMP.js";import"./stripe-cKAAJElX.js";import"./lottie-C5eNvt0I.js";import"./lexical-DW4lC8Zx.js";import"./pdf-DjwvAC2g.js";import"./utils-BsODCDYR.js";import"./useAskAiCfoHostNavButtonProps-BsP5fVhq.js";import"./TransactionDetailScreen-Bp7IFDK0.js";import"./useInitialThreadRequest-7Q8HJAH2.js";import"./expenseAutomationHelper-DBDpSggk.js";import"./stripSplatSuffix-CQQXAy0N.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]="11f1af5d-9526-4fb9-9d3e-7799b2b3153d",a._sentryDebugIdIdentifier="sentry-dbid-11f1af5d-9526-4fb9-9d3e-7799b2b3153d")}catch{}})();const ot=$((function(a,t){const e=t.entity,o=Y(a,t.entity,"EntityDetail");return{selectedEntity:e,autoCompleteData:{autoCompleteText:e.name,entityAutoCompleteView:z(a,"common")},trendWithTransactionsReport:o,analytics:X,isAccountingClassesEnabled:K(a)}}),(function(a,t){return{onTransactionItemClick:e=>{if(t.openTransactionPanel)return void t.openTransactionPanel(e.id,e.type);const o=`${nt(e,t.tenantEmailDomain)}`,c=tt(t.location.state?.pathnameStackToGoBack,t.location.pathname);t.navigate(o,{state:{pathnameStackToGoBack:c}})},autoCompleteActions:{onAutoCompleteInputChange:e=>{e.trim().length>=2?a(L({searchString:e,searchOrigin:"common"})):e.trim().length===0&&a(Q("common"))},onAutoCompleteEntity:e=>{const o=at(e,t.tenantEmailDomain);a(V()),a(J()),t.resetTrendIsFetchedStates(),t.navigate(o,{replace:!0,state:{pathnameStackToGoBack:t.location.state?.pathnameStackToGoBack}})},onCancelAutoComplete:()=>{const e=Z(t.location.state?.pathnameStackToGoBack),o=e.poppedPathname??I();t.navigate(o,{state:{pathnameStackToGoBack:e.newStack}})}},onTrendSelectedPeriodChange:e=>{if(t.closeSidePanel?.(),e==null)t.defaultTransactionTimePeriod!=null&&a(S(t.entity,"EntityDetail",{timeframe:"quarter",timePeriod:t.defaultTransactionTimePeriod}));else{const o=e.currentTimePeriod==null?e.addTimePeriod:{startDate:e.addTimePeriod.startDate,endDate:e.currentTimePeriod.endDate};a(k(t.entity,"EntityDetail",{timeframe:e.timeframe,timePeriod:e.addTimePeriod})),a(S(t.entity,"EntityDetail",{timeframe:e.timeframe,timePeriod:o}))}}}}))(U),it=et((function({entityType:a,...t}){const e=B(),o=F(),c=G(),[m,T]=d.useState(!1),[h,D]=d.useState(!1),{tenantEmailDomain:C,entityIdEncoded:W,entityNameEncoded:w}=A(),r=b(W??""),p=b(w??""),f=rt(r,p),x=[r,p].filter((n=>n!=null)),i={name:p,id:r,type:a,zeniId:r,qboId:r},g=l((n=>O(n.customerIncomeState,n.vendorExpenseState,n.trendState,i,"quarter"))),j=l((n=>H(n).company?.companyInfo.firstMonthOfFY??1)),u=l((n=>M(n.trendWithTransactionsState,i,"EntityDetail")));d.useEffect((()=>{m===!1&&f===!0&&(T(!0),o(R(i)))}),[m,f,i]);const P=l((n=>n.trendState.fetchState)),E=u?.selectedPeriod?.timePeriod??g,v=(function(n,y){return n!=null&&y!=null?{startDate:n.startDate,endDate:y?.endDate}:y})(u?.selectedPeriod?.timePeriod,g);return d.useEffect((()=>{m===!0&&h===!1&&P==="Completed"&&(D(!0),E!=null&&o(k(i,"EntityDetail",{timeframe:u?.selectedPeriod?.timeframe??"quarter",timePeriod:E})))}),[m,h,P]),f?s.jsx(ot,{firstMonthOfFY:j,tenantEmailDomain:C,location:c,navigate:e,entity:i,defaultTransactionTimePeriod:v,resetTrendIsFetchedStates:()=>{T(!1),D(!1)},...t}):s.jsx(q,{to:I(x.length)})})),rt=(a,t)=>t!=null&&t.length>0&&a!=null&&a.length>0,I=(a=2)=>{let t="../";for(let e=0;e<a;e++)t=`${t}../`;return t};function jt({entityType:a}){return s.jsx(N,{children:s.jsx(_,{path:"/:entityIdEncoded/:entityNameEncoded/*",element:s.jsx(it,{entityType:a})})})}export{jt as EntityDetailRoutes,jt as default};
@@ -1,38 +0,0 @@
1
- import{j as f}from"./liveblocks-UOzcPsHa.js";import{u as he,h as nt,g as be,j as F,i as Ue,t as qn,l as Jn,n as Wn,o as He,N as Yn}from"./core-B5mDy9pu.js";import{fF as ke,a0S as Hn,q0 as _e,U0 as Kn,zX as Zn,a0T as Qn,a0U as Xn,a0V as es,a0W as gt,a0X as Ze,gh as bt,a0Y as oa,eW as ts,g0 as as,a0Z as ca,a0_ as Qe,qT as ns,uN as ss,gS as os,gQ as cs,a0$ as is,r4 as ls,rd as rs,qb as ds,qp as xa,gP as re,gR as us,a10 as ms,qL as wa,re as ps,qm as hs,qh as Ss,uT as gs,gO as Me,a11 as tt,C5 as Ra,Mm as Da,a12 as Fa,Fo as _a,a13 as Cs,eZ as fs,e$ as Is,sP as Tt,WL as ia,WN as ks,m2 as bs,WO as Ts,m9 as Ps,dl as ys,Do as Pt,a14 as vs,a15 as Es,fm as yt,sD as la,WF as As,a16 as xs,a17 as ws,mb as Rs,a18 as Ds,R2 as Fs,ma as _s,l$ as Ms,qE as Ma,rj as at,tp as Oa,tL as Os,TS as Ua,ri as ra,rl as Ba,rn as Us,bE as Bs,ny as Vs,nv as js,rm as Xe,rk as pe,a19 as zs,rE as da,a1a as Ls,a1b as $s,sH as Gs,sI as Ns,WB as qs,VH as Js,a0k as Ws,a1c as Ys,WH as ua,WG as Ke,a1d as ma,mq as Hs,a1e as Ks,a1f as Zs,a1g as Qs,a1h as Xs,qz as eo,a1i as to,a1j as ao,a1k as no,ru as so,md as oo,m4 as co,a1l as io,mc as pa,WY as lo,a1m as ro,a1n as uo,uo as mo,t$ as po,t_ as Ct,a1o as ho,a1p as So,a1q as go,a1r as Co,nJ as fo,br as Io,nE as ha,nq as ko,a1s as bo,g$ as To,nB as Po,sR as yo,sT as vo,sA as Eo,VK as Ao,VL as xo,ES as wo,ER as Ro,F6 as Do,a1t as Sa,sG as Fo,a1u as _o,rU as Mo,r_ as Oo,s9 as Uo,rX as Bo,a1v as Vo,s8 as jo,sM as zo,a1w as Lo,sZ as $o,su as Go,t2 as No,sz as qo,rF as Jo,a1x as Wo,qX as Yo,qv as Ho,qC as ga,rp as Ko,a1y as Zo,a1z as Qo,a1A as Xo,a1B as ec,a1C as tc,a1D as ac,t6 as nc,a1E as sc,a1F as oc,a1G as Ca,uz as cc,tS as ic,tH as fa,tF as lc,a1H as rc,tu as dc,t9 as uc,tI as mc,a1I as pc,a1J as hc,tf as Sc,a1K as gc,ta as Cc,te as fc,tc as Ic,tO as kc}from"./zeni-epic-state-7eY0g-Bc.js";import Va from"./NotFoundScreen-BkYIKPgh.js";import{a as s,R as ja}from"./sentry-DHDsO12F.js";import{n as Te,S as bc}from"./mui-Do6nLzGb.js";import{N as Be,c as H,j as Q,p as te,aq as za,as as La,dQ as Tc,dR as Pc,z as st,dS as yc,dT as vc,dU as Ec,ae as Oe,dV as Ac,dW as Ia,ba as ka,dX as xc,a7 as $a,dY as wc,h as et,a as Rc,dZ as Dc,d_ as Fc,M as _c,U as Mc,d$ as Oc,e0 as Uc,e1 as Bc,b4 as Vc,br as jc,ab as zc,b5 as Lc,b6 as $c,G as Gc,w as Nc,e2 as qc,av as ba,e3 as Jc}from"./index-6nH5LMe4.js";import{u as Ga}from"./useAskAiCfoHostNavButtonProps-BsP5fVhq.js";import{g as Ta,b as Wc,c as Yc,h as Hc,a as Kc,i as Zc,r as Qc,C as Xc}from"./TransactionDetailScreen-Bp7IFDK0.js";import{u as ei}from"./useActualMatchingMatchDetail-OCZsPxr6.js";import{d as ti}from"./decodeURIComponentSafe-DANuhXnG.js";import{m as Na,a as qa}from"./expenseAutomationHelper-DBDpSggk.js";import{u as Ja,a as Wa,w as ai}from"./withTransactionSidePanel-DK-Ex27L.js";import{b as ni,S as si,a as oi,J as ci}from"./ScheduleDetailsPrepaidExpensesScreen-DnVEpQsK.js";import{s as Pa,i as Ya,h as ii,v as li,c as ri}from"./routePaths-uBvxqlLY.js";import{a as ft}from"./accountMappingHelper-DqBiQF6x.js";import{D as di}from"./DrawerScreen-BihZ_PpN.js";import"./recharts-uFX1dZS-.js";import"./analytics-D6GpUSOP.js";import"./plaid-0g_vwjSd.js";import"./dnd-CGWe1ZMP.js";import"./stripe-cKAAJElX.js";import"./lottie-C5eNvt0I.js";import"./lexical-DW4lC8Zx.js";import"./pdf-DjwvAC2g.js";import"./utils-BsODCDYR.js";import"./useInitialThreadRequest-7Q8HJAH2.js";import"./stripSplatSuffix-CQQXAy0N.js";import"./pathToGoBack-DP_bGWF-.js";(function(){try{var t=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},n=new t.Error().stack;n&&(t._sentryDebugIds=t._sentryDebugIds||{},t._sentryDebugIds[n]="f337eab2-8151-42e7-b967-fbe098858f94",t._sentryDebugIdIdentifier="sentry-dbid-f337eab2-8151-42e7-b967-fbe098858f94")}catch{}})();const ui=()=>{const t=he(),n=nt(),S=be(),g=F((h=>ke(h))),{useFeatureGate:d}=Be(),{isFeatureEnabled:i}=d(H.isRealtimeInsightsFeatureEnabled),{isFeatureEnabled:r}=d(H.aiAuditScorePercentage),A=F((h=>h.expenseAutomationViewState.selectedPeriodByTenantId)),l=F((h=>Hn(h,g.tenantId))),{isAiCfoAccessEnabled:b,onAskAiCfoClick:R}=Ga({mobileExploreReferrer:"Month-End Close Overview"}),k=s.useCallback(((h,T,z=!1)=>{t(_e({tenantId:T,period:{month:h.month,year:h.year},refreshViewInBackground:z}))}),[]),C=s.useCallback((h=>{const T=S.state?.referrer;l.monthEndCloseChecks?.auditSummary!=null&&Q.trackMonthCloseAuditPage(h.month,h.year,l.monthEndCloseChecks.reportEmailSentDate!=null?"closed":"in-review",l.monthEndCloseChecks.auditSummary.auditScorePercentage,!1,T??null),t(Kn(g.tenantId,h))}),[g.tenantId,l.monthEndCloseChecks?.auditSummary,l.monthEndCloseChecks?.reportEmailSentDate]),I=A[g.tenantId],m=s.useCallback((()=>{const h=S.state?.referrer;l.monthEndCloseChecks?.auditSummary!=null&&Q.trackMonthCloseAuditPage(I.month,I.year,l.monthEndCloseChecks.reportEmailSentDate!=null?"closed":"in-review",l.monthEndCloseChecks.auditSummary.auditScorePercentage,!0,h??null),k(I,g.tenantId,!0)}),[k,I,g.tenantId,l.monthEndCloseChecks?.auditSummary,l.monthEndCloseChecks?.reportEmailSentDate]),_=te(S.state?.pathnameStackToGoBack,S.pathname),x=s.useCallback((()=>{if(l.monthEndCloseChecks!=null&&I!=null){const h=l.monthEndCloseChecks.monthEndCloseCheckList.find((T=>T.progress<100));if(h!=null)return void n(`./${h.id}/${I.month}-${I.year}`,{state:{pathnameStackToGoBack:_,message:"comingFromOverview"}});n(`./month_end_insights/${I.month}-${I.year}`,{state:{pathnameStackToGoBack:_,message:"comingFromOverview"}})}}),[l.monthEndCloseChecks,I]),{areTenantIdsInSync:p}=za();return La({isDataReady:l.fetchState==="Completed"}),s.useEffect((()=>{I!=null&&l.fetchState!=="In-Progress"&&l.fetchState!=="Completed"&&p&&k(I,g.tenantId)}),[k,I,l.fetchState,g.tenantId,p]),s.useEffect((()=>{I!=null&&l.monthClosePerformanceTrendFetchStatus.fetchState!=="In-Progress"&&l.monthClosePerformanceTrendFetchStatus.fetchState!=="Completed"&&p&&t(Zn(I))}),[I,l.monthClosePerformanceTrendFetchStatus.fetchState,p]),s.useEffect((()=>{const h=setInterval((()=>{l.fetchState!=="In-Progress"&&l.fetchState==="Completed"&&m()}),3e5);return()=>clearInterval(h)}),[l.fetchState]),s.useEffect((()=>{if(l.fetchState==="Completed"&&l.monthEndCloseChecks?.auditSummary!=null){const h=S.state?.referrer;Q.trackMonthCloseAuditPage(l.selectedPeriod.month,l.selectedPeriod.year,l.monthEndCloseChecks.reportEmailSentDate!=null?"closed":"in-review",l.monthEndCloseChecks.auditSummary.auditScorePercentage,!1,h??null)}}),[l.fetchState,l.selectedPeriod,l.monthEndCloseChecks?.auditSummary,l.monthEndCloseChecks?.reportEmailSentDate]),f.jsx(mi,{children:f.jsx(Tc,{monthEndCloseChecksView:l,isRealtimeInsightsFeatureEnabled:i,onMonthEndCheckClick:h=>{n(`./${h}/${I.month}-${I.year}`,{state:{pathnameStackToGoBack:_,message:"comingFromOverview",referrer:"Expense Automation - Overview"}})},onPeriodChange:C,handleReviewButtonClick:x,onBackClick:()=>{n("../../dashboard")},onReload:m,isAiCfoAccessEnabled:b,onAskAiCfoClick:R,aiAuditScorePercentageEnabled:r})})},mi=Te.div`
2
- display: flex;
3
- height: 100vh;
4
- width: 100%;
5
- flex: 1 1 auto;
6
- flex-direction: column;
7
- background-color: ${t=>t.theme.colors.grey4};
8
- `;function pi({isFullView:t,matchId:n,onClose:S}){const{match:g,detailFetchState:d,handleOpenBill:i,handleContinueMatch:r,handleRefresh:A,handleUndoReversal:l,lastMatchResults:b,lastUndoResults:R,refreshStatus:k,undoReversalStatus:C}=ei(n);return f.jsx(Pc,{match:g,detailFetchState:d.fetchState,isRenderedInPanel:!t,isUndoInFlight:C.fetchState==="In-Progress",refreshStatus:k.fetchState,onNavigateBack:S,onOpenBill:i,onContinueMatch:r,onRefresh:A,onUndoReversal:l,lastMatchResults:b,lastUndoResults:R})}const hi=/^match\/([^/?]+)$/,Si=Wa({displayNamePrefix:"withActualMatchingSidePanel",usePanelSetup:function(t){const{useFeatureGate:n}=Be(),{isFeatureEnabled:S}=n(H.isTransactionDetailSplitViewEnabled),{isFeatureEnabled:g}=n(H.isAccrualEnabled),d=(function(r=!0){const A=nt(),l=be(),b=Ue(),R=Na(b),k=Ja({childPathPattern:hi,enabled:r,listPath:R}),C=k.matchGroups[0]!=null&&k.matchGroups[0]!==""?ti(k.matchGroups[0]):void 0,I=b.tenantEmailDomain??l.pathname.split("/").find(Boolean)??"",m=s.useRef({isOpen:k.isOpen,matchId:C});m.current={isOpen:k.isOpen,matchId:C};const _=s.useCallback((h=>{!k.isMobile&&r?m.current.isOpen&&m.current.matchId===h?k.closePanel():k.navigateToChild(`match/${encodeURIComponent(h)}`,{replace:m.current.isOpen}):A(`/${I}/expense-automation/actual-matching/${encodeURIComponent(h)}`)}),[A,k.isMobile,k.navigateToChild,k.closePanel,r,I]),x=s.useCallback((()=>{if(C==null)return;const h=te(l.state?.pathnameStackToGoBack,`${l.pathname}${l.search}`);A(`/${I}/expense-automation/actual-matching/${encodeURIComponent(C)}`,{state:{pathnameStackToGoBack:h}})}),[l.pathname,l.search,l.state,C,A,I]),p=k.isOpen&&C!=null;return{closePanel:k.closePanel,isOpen:p,maximize:x,matchId:r&&p?C:void 0,openPanel:_}})(t&&g===!0&&S===!0),i=s.useMemo((()=>{if(d.isOpen&&d.matchId!=null)return f.jsx(pi,{isFullView:!1,matchId:d.matchId,onClose:d.closePanel},d.matchId)}),[d.closePanel,d.isOpen,d.matchId]);return{injectedProps:s.useMemo((()=>({closeMatchSidePanel:d.closePanel,isMatchPanelOpen:d.isOpen,matchPanelContent:i,matchPanelMatchId:d.matchId,openMatchPanel:d.openPanel})),[i,d.closePanel,d.isOpen,d.matchId,d.openPanel]),selectedItemId:d.matchId,sidePanel:{closePanel:d.closePanel,maximize:d.maximize}}}}),gi=ja.memo((({reconciliation:t,selectedDrawerAccountId:n,onClose:S,onFetchLinkTokenClick:g,onEstablishConnectionClick:d})=>{const i=he(),{useFeatureGate:r}=Be(),{isFeatureEnabled:A}=r(H.isReconV3Enabled),{isFeatureEnabled:l}=r(H.isReconciliationCombinedStatementEnabled),b=st.getSignedInUser(),R=F((v=>ke(v))),k=s.useMemo((()=>({userId:b?.userId??"",sessionId:b?.zeniSessionId??"",tenantId:R?.tenantId??""})),[b?.userId,b?.zeniSessionId,R?.tenantId]),{accountReconciliationsByAccountID:C,excludedAccountIDs:I,monthYearPeriod:m,statementUploadChosen:_}=t,x=C[n],p=s.useMemo((()=>Qn(C,n)),[C,n]),h=s.useMemo((()=>Xn(C)),[C]),T=s.useMemo((()=>es(C,n)),[C,n]),z=s.useRef(!1),G=s.useCallback((v=>{z.current=v,Ia(n,v)}),[n]),q=s.useCallback((v=>{i(gt({accountId:n,selectedPeriod:m,dismissedToBackground:!0,backgroundCompletedSteps:v.completedSteps,startedAtMs:v.startedAtMs,totalDurationSeconds:v.totalDurationSeconds})),v.accountMappings!=null&&i(Ze({accountId:n,selectedPeriod:m,localData:{combinedStatementAccountMappings:v.accountMappings}})),x!=null&&requestAnimationFrame((()=>{z.current||i(bt({messageSection:"statement_parsing_in_progress",messageText:"success",type:"info",showStatusIcon:!0,variables:[{variableName:"_account_name_",variableValue:yc(x)}]}))}))}),[i,m,x,n]),P=s.useCallback((()=>{i(gt({accountId:n,selectedPeriod:m,dismissedToBackground:!1}))}),[i,n,m]),J=s.useCallback((v=>{i(oa({accountId:n,selectedPeriod:m,backgroundCompletedSteps:v}))}),[i,m,n]),N=s.useCallback((()=>{i(oa({accountId:n,selectedPeriod:m,backgroundCompletedSteps:0})),i(gt({accountId:n,selectedPeriod:m,dismissedToBackground:!1}))}),[i,m,n]);s.useEffect((()=>()=>{Ia(null,!1)}),[]);const e=x?.parsedStatementData?.statementUpload?.statementMeta?.statementUploadId??x?.accountReconEntity.statementMetaData?.statementUploadId,a=x?.statementDateConflict?.previousReconciliationInfo?.reconciledByUserId,c=F((v=>a!=null&&a!==""?ts(as(v.userState,a)):"")),u=s.useCallback((()=>{i(ca({accountId:n,selectedPeriod:m}))}),[i,n,m]),E=s.useCallback((()=>{i(ca({accountId:n,selectedPeriod:m})),i(Qe({statementUploadChosen:!0}))}),[i,n,m]),y=(v,L)=>{i(gs(v,L.split(".")[0]))},D=(v,L)=>{if(L===!0){const Z=x?.combinedStatementGroupId??x?.parsedStatementData?.statementUpload?.statementMeta?.combinedStatementGroupId??x?.parsedStatementData?.statementUpload?.combinedStatementDetails?.combinedStatementGroupId;if(Z!=null&&Z!=="")return void i(hs({accountId:n,selectedPeriod:m,combinedStatementGroupId:Z,fileId:v}))}e!=null&&i(Ss({accountId:n,selectedPeriod:m,fileId:v,statementUploadId:e}))},M=()=>{i(Qe({statementUploadChosen:!1}))},W=v=>{i(ps({accountId:n,selectedPeriod:m,payload:v,statementAccountScope:l===!0?x?.localData?.statementAccountScope??"single_account":"single_account"}))},Y=s.useCallback(((v,L,Z)=>{i(ns({accountId:v,selectedPeriod:L,statementUploadId:Z}))}),[i]),se=s.useCallback(((v,L,Z,X,ge)=>{ge!=null&&ge!==""&&i(ss(ge)),i(X==null||X===""?cs({accountId:v,selectedPeriod:L,statementUploadId:Z}):os({accountId:v,selectedPeriod:L,statementUploadId:Z,combinedStatementGroupId:X}))}),[i]),ce=s.useCallback(((v,L)=>{L!==""&&i(is({accountId:n,selectedPeriod:m,statementUpdateLocalData:v,statementUploadId:L}))}),[i,n,m]),Pe=s.useCallback((()=>{e!=null&&i(x?.localData?.statementAccountScope!=="multi_account"?rs({accountId:n,selectedPeriod:m,statementUploadId:e}):ls({accountId:n,selectedPeriod:m,statementUploadId:e}))}),[i,x?.localData?.statementAccountScope,n,m,e]),ye=s.useCallback((v=>{e!=null&&i(ds({accountId:n,selectedPeriod:m,statementUploadId:e,accountMappings:v}))}),[i,m,n,e]),ve=s.useCallback((()=>{i(Qe({statementUploadChosen:!0}))}),[i]),K=v=>{i(Ze({accountId:n,selectedPeriod:m,localData:{accountSource:v}}))},B=v=>{i(Ze({accountId:n,selectedPeriod:m,localData:{statementAccountScope:v}}))},Ve=s.useCallback((()=>{i(xa({accountId:n}))}),[i,n]),Ee=s.useCallback((v=>{i(re(m,v,!0)),S()}),[i,m,S]),ot=s.useCallback((()=>{i(us({accountId:n,selectedPeriod:m,statementProcessingFailed:!1})),i(ms({accountId:n,selectedPeriod:m}))}),[i,n,m]),Se=s.useCallback((()=>{i(wa({accountId:n}))}),[i,n]),je=I.includes(n)?t.excludedAccountReconciliationByAccountID[n]:void 0;if(je!=null)return f.jsx(ya,{children:f.jsx(va,{$isV3:A===!0,children:f.jsx(vc,{excludedAccountReconciliation:je,includeAccountFetch:t.includeAccountFetchState,isReconV3Enabled:A,onDismissClick:S,onIncludeIntoReconciliation:Se})})});if(x!=null){const v=A===!0?f.jsx(Ec,{excludeAccountFetch:t.excludeAccountFetchState,accountReconciliation:x,monthYearPeriod:m,onDismissClick:S,plaidConnectionDetails:t.plaidConnectionDetails,onFetchLinkTokenClick:g,onEstablishConnectionClick:d,onEditFileName:y,onDeleteFile:D,onSelectSourceType:K,onSelectStatementAccountScope:B,isReconciliationCombinedStatementEnabled:l===!0,ledgerAccounts:p,statementOverrideWarningAccountIds:T,unavailableLedgerAccountIds:h,onConfirmStatementMapping:ye,filesEndPoint:Oe.fileMicroServiceBaseUrl,authParams:k,openFilePicker:_,onStatementUploadSuccess:W,onUploadWindowOpenedOnce:M,onExcludeFromReconciliation:Ve,onRetryParsing:Y,onFetchStatementParseInfo:se,onReviewClicked:Ee,statementProcessingFailed:x.statementProcessingFailed,statementProcessingDismissedToBackground:x.statementProcessingDismissedToBackground,onDismissStatementProcessingFailed:ot,onContinueInBackground:q,onClearStatementProcessingDismissedToBackground:P,onResetStatementProcessingProgress:N,onStatementProcessingProgressChange:J,onStatementFlowVisibilityChange:G,onReuploadStatement:ve,onStatementFormDataChange:ce,onStatementConfirmSave:Pe,reconciledByName:c,onDismissDateConflict:u,onReuploadAfterDateConflict:E,isReconV3Enabled:A}):f.jsx(Ac,{excludeAccountFetch:t.excludeAccountFetchState,accountReconciliation:x,monthYearPeriod:m,onDismissClick:S,plaidConnectionDetails:t.plaidConnectionDetails,onFetchLinkTokenClick:g,onEstablishConnectionClick:d,onEditFileName:y,onDeleteFile:D,onSelectSourceType:K,filesEndPoint:Oe.fileMicroServiceBaseUrl,authParams:k,openFilePicker:_,onStatementUploadSuccess:W,onUploadWindowOpenedOnce:M,onExcludeFromReconciliation:Ve});return f.jsx(ya,{children:f.jsx(va,{$isV3:A===!0,children:v})})}return null})),ya=Te.div`
9
- display: flex;
10
- flex-direction: column;
11
- height: 100%;
12
- `,va=Te.div`
13
- flex: 1;
14
- min-height: 0;
15
- display: flex;
16
- flex-direction: column;
17
- box-sizing: border-box;
18
- min-width: 0;
19
- overflow-x: hidden;
20
- overflow-y: ${t=>t.$isV3===!0?"hidden":"auto"};
21
- `;function Ci({panelType:t,scheduleId:n,onClose:S,onCloseAfterDecision:g}){return f.jsx(Ii,{children:f.jsx(ki,{children:fi(t,n,S,g)})})}function fi(t,n,S,g){switch(t){case"one_time_accrual":return f.jsx(ci,{isRenderedInPanel:!0,accrualIdOverride:n,onPanelNavigateBack:S});case"accrued_expenses":return f.jsx(oi,{isRenderedInPanel:!0,scheduleDetailIdOverride:n,onPanelNavigateBack:S,onPanelCloseAfterDecision:g});case"fixed_assets":return f.jsx(si,{isRenderedInPanel:!0,scheduleDetailIdOverride:n,onPanelNavigateBack:S,onPanelCloseAfterDecision:g});case"prepaid_expenses":return f.jsx(ni,{isRenderedInPanel:!0,scheduleDetailIdOverride:n,scheduleTypeOverride:"prepaid_expenses",onPanelNavigateBack:S,onPanelCloseAfterDecision:g})}}const Ii=Te.div`
22
- display: flex;
23
- flex-direction: column;
24
- height: 100%;
25
- `,ki=Te.div`
26
- flex: 1;
27
- min-height: 0;
28
- display: flex;
29
- flex-direction: column;
30
- box-sizing: border-box;
31
- min-width: 0;
32
- overflow-x: hidden;
33
- overflow-y: auto;
34
- `,bi=/^schedule\/(prepaid_expenses|fixed_assets|accrued_expenses|one_time_accrual)\/([^/?]+)$/,Ti=Wa({displayNamePrefix:"withScheduleSidePanel",usePanelSetup:function(t){const n=(function(C=!0){const I=nt(),m=be(),_=he(),x=Ue(),p=Ja({childPathPattern:bi,enabled:C}),h=p.matchGroups[0],T=Ya(h)?h:void 0,z=p.matchGroups[1]!=null&&p.matchGroups[1]!==""?p.matchGroups[1]:void 0,G=p.isOpen&&T!=null&&z!=null,q=x.tenantEmailDomain??m.pathname.split("/").find(Boolean)??"",P=s.useRef({isOpen:G,scheduleId:z});P.current={isOpen:G,scheduleId:z};const J=s.useCallback(((e,a,c)=>{c!=null&&(a==="prepaid_expenses"||a==="fixed_assets")&&_(_a({selectedJEScheduleKey:c})),!p.isMobile&&C?P.current.isOpen&&P.current.scheduleId===e?p.closePanel():p.navigateToChild(`schedule/${a}/${e}`,{replace:P.current.isOpen}):I(Pa(a,e,q),{state:{message:"expenseAutomation",origin:"je_schedules"}})}),[_,I,p.isMobile,p.navigateToChild,p.closePanel,C,q]),N=s.useCallback((()=>{if(T==null||z==null)return;const e=te(m.state?.pathnameStackToGoBack,m.pathname);I(Pa(T,z,q),{state:{pathnameStackToGoBack:e,message:"expenseAutomation",origin:"je_schedules"}})}),[I,T,z,q,m.pathname,m.state]);return{closePanel:p.closePanel,isOpen:G,maximize:N,openPanel:J,panelType:G?T:void 0,scheduleId:G?z:void 0}})(t),S=s.useRef(null),[g,d]=s.useState(null),i=s.useMemo((()=>({registerPanelDirtyGuard:C=>{S.current=C}})),[]),r=s.useCallback((C=>{S.current?.isDirty()===!0?d((()=>C)):C()}),[]),A=s.useCallback((()=>{r(n.closePanel)}),[r,n.closePanel]),l=s.useCallback((()=>{r(n.maximize)}),[r,n.maximize]),b=s.useCallback(((C,I,m)=>{r((()=>n.openPanel(C,I,m)))}),[r,n.openPanel]),R=s.useMemo((()=>{if(g!=null)return{onCancel:()=>d(null),onDiscard:()=>{S.current=null,d(null),g()}}}),[g]),k=s.useMemo((()=>{if(n.isOpen&&n.panelType!=null&&n.scheduleId!=null)return f.jsx(xc.Provider,{value:i,children:f.jsx(Ci,{panelType:n.panelType,scheduleId:n.scheduleId,onClose:A,onCloseAfterDecision:()=>{S.current=null,n.closePanel()}},`${n.panelType}:${n.scheduleId}`)})}),[n.isOpen,n.panelType,n.scheduleId,n.closePanel,A,i]);return{injectedProps:s.useMemo((()=>({closeSchedulePanel:A,isSchedulePanelOpen:n.isOpen,openSchedulePanel:b,schedulePanelContent:k,schedulePendingDiscardConfirmation:R})),[A,b,k,R,n.isOpen]),selectedItemId:n.scheduleId,sidePanel:{closePanel:A,maximize:l}}}});function Pi({companyId:t,closeCustomerRequestDrawer:n,addCustomerRequest:S,resetCustomerRequest:g}){const d=st.getSignedInUser();if(d==null)throw Error("Can't access Customer Request page without signing in...");const i=F((r=>Cs(r,t,d)));return s.useEffect((()=>{g()}),[]),f.jsx(f.Fragment,{children:i.fetchState==="In-Progress"||i.companyMonthEndReportTemplatesData.fetchState==="In-Progress"?f.jsx($a,{fetchState:"In-Progress"}):f.jsx(wc,{onCloseClick:n,addCustomerRequest:S,snippets:i.companyMonthEndReportTemplatesData,bulletPoints:i.zeniRequestsData??[]})})}const yi={schedules:"Review Schedules",actual_matching:"Actual Matching",existing_schedules:"Existing Schedules"},vi=()=>{const t=F((R=>Me(R))),n=be(),{currentSelectedViewFetchState:S,currentSelectedView:g,selectedPeriod:d}=t,i=et(g),r=et(S.fetchState),A=t.jeSchedules.uiState.selectedPageTab??"schedules",l=et(A),b=s.useCallback((R=>{const k=n.state?.referrer;g==="transaction_categorization"&&(t.selectedTransactionCategorizationTab==="review"?Q.trackTransactionsReviewPage(d.month,d.year,t.transactionView.totalCountByTab.review,0,R,k??null):Q.trackTransactionsAutoCategorisedPage(d.month,d.year,t.transactionView.totalCountByTab.autoCategorized,0,R,k??null)),g==="missing_receipts"&&Q.trackMissingReceiptsPage(d.month,d.year,R,t.missingReceipts.transactions.length,k??null),g==="je_schedules"&&Q.trackMonthCloseScheduleListPage(d.month,d.year,R,t.jeSchedules.pendingReviewSchedules.length,t.jeSchedules.resolveSchedules.length,(C=>{const I={accruedCount:0,fixedAssetsCount:0,oneTimeAccrualCount:0,prepaidCount:0};return C.forEach((m=>{if(fs(m))I.oneTimeAccrualCount+=1;else switch(Is(m)){case"prepaid_expenses":I.prepaidCount+=1;break;case"fixed_assets":I.fixedAssetsCount+=1;break;case"accrued_expenses":I.accruedCount+=1}})),I})(t.jeSchedules.pendingReviewSchedules),yi[A],k??null),g==="flux_analysis"&&Q.trackFluxAnalysisPage(d.month,d.year,R,Ei(t.fluxAnalysis),k??null),g==="month_end_insights"&&t.auditSummary?.auditScorePercentage!=null&&Q.trackInsightsEmailPage(d.month,d.year,R,"draft",t.auditSummary.auditScorePercentage,null,k??null)}),[d,t,A]);return s.useEffect((()=>{(r!==S.fetchState||g!==i||g==="je_schedules"&&l!=null&&A!==l)&&S.fetchState==="Completed"&&b(!1)}),[g,S.fetchState,i,A,l]),b},Ei=t=>t.sections.generalExpense.vendors.length+t.sections.reimbursement.vendors.length,{common:{strings:{hyphen:Ai,comma:Ea,space:xi}},dateFormat:Ha}=Gc.getLocalizedStrings(),Aa=kc,wi=Jn((function(t,n){const{uncategorizedAccounts:S,vendorSearchAutoCompleteData:g,monthEndInsightsCustomerRequestData:d,monthEndInsightsPreviewMode:i,companyId:r,isMissingReceiptsBulkUploadEnabled:A,isTransactionActivityEnabled:l,newScheduleActiveType:b}=n,R=st.getSignedInUser(),k=t.tenantState.currentTenantId,C={userId:R?.userId??"",sessionId:R?.zeniSessionId??"",tenantId:k??""},I=Me(t),{selectedTransactionCategorizationTab:m}=I,{searchTransactionsResults:_,searchTransactionsFetchState:x}=Ls(t),p=b==="prepaid_expenses"?"prepaid_expenses":"fixed_assets",{accountListNestedAccountHierarchy:h,classListNestedAccountHierarchy:T,allDepreciationAccountListNestedAccountHierarchy:z,newScheduleLocalData:G,saveStatus:q}=$s(t,p);return{expenseAutomationViewSelector:I,accountListNestedAccountHierarchy:h,allDepreciationAccountListNestedAccountHierarchy:z,baseTransactionSearchFetchState:x,baseTransactionSearchResults:_,classListNestedAccountHierarchy:T,newScheduleLocalData:G,initialSelectedBaseTransaction:G.selectedBaseTransactionId!=null?Gs(t.transactionState,Ns(G.selectedBaseTransactionId)):void 0,newAccrualAccountsView:qs(t),newScheduleSaveStatus:q,bulkUploadSelector:A===!0?I.missingReceipts.bulkUpload:void 0,vendorSearchAutoCompleteData:g,authParams:C,receiptUploadEndpoint:`${Oe.accountMicroServiceBaseUrl}`,transactionAttachmentsEndpoint:`${ba}/transaction_attachments`,bulkUploadEndpoint:A===!0?`${Oe.communicationAgentMicroServiceBaseUrl}/1.0/receipts/bulk-upload`:void 0,isDisabled:!1,currentTab:m,selectedTransactionGroup:I.transactionView.selectedTransactionGroup,monthEndInsightsCustomerRequestData:d,monthEndInsightsPreviewMode:i,allThreadsSectionOpen:!1,enableMonthEndInsightsZeniGPTFeature:!1,loggedInUser:R,uncategorizedAccounts:S,companyId:r,isTransactionActivityEnabled:l,receiptsEmail:Ws(t.tenantState,k),downloadParams:{authParams:C,jeScheduleEndPoint:`${ba}/jeScheduleReports`,timezone:Js(),companyName:ke(t).companyName}}}),(function(t,n){const{themeState:S,isAccountingClassesEnabled:g,isCOTEnabled:d,isMissingReceiptsBulkUploadEnabled:i,location:r,vendorSearchAutoCompleteData:A,expenseAutomationViewSelector:l,currentTenant:b,newScheduleActiveType:R,uncategorizedAccounts:k,navigate:C,onClickCustomerRequest:I,handleEditClick:m,closeSchedulePanel:_,isSchedulePanelOpen:x,openSchedulePanel:p,setActivityLogTransactionId:h}=n,{selectedPeriod:T,currentSelectedView:z,reconciliation:{selectedAccountId:G}}=l,{accountSettingsView:q}=l.jeSchedules,P=Ma(T),J=at(P.start),N=at(P.end);return{onZeniLogoClick:()=>{S.toggle()},onUploadReceiptAttachment:e=>{Q.trackMissingReceiptAttached(T.month,T.year),t(ic(e))},onUploadTransactionReceipt:(e,a,c,u,E,y)=>{t(Ca(e,a,{fetchState:"In-Progress"}));const D=()=>t(Ca(e,a,{fetchState:"Error"}));Jc(`${Oe.accountMicroServiceBaseUrl}/1.0/transactions/${a}/attachments`,y,a,c,u,E).then((M=>{M!=null?t(cc(e,M)):D()})).catch(D)},onMissingReceiptsRowClick:(e,a)=>{if(n.openTransactionPanel)return void n.openTransactionPanel(e,a);const c=te(r.state?.pathnameStackToGoBack,r.pathname);C(`../../transaction/${a}/${e}`,{state:{pathnameStackToGoBack:c,message:"expenseAutomation",origin:"missing_receipts"}})},onUploadReceiptComplete:(e,a)=>{t(oc(e,a)),b!=null&&t(_e({tenantId:b.tenantId,period:a,refreshViewInBackground:!0}))},onUploadReceiptFetchStatus:(e,a,c,u)=>{t(sc(e,{fetchState:a,error:c})),c!=null&&t(bt({messageSection:"missing_receipts_attachment",messageText:"failed",type:"error",showStatusIcon:!0,variables:[{variableName:"__message__",variableValue:u!=null?xi+Ai+u+Ea:Ea}]}))},onUpdateJESchedulesUIState:e=>{const a=l.jeSchedules.uiState,c=e.selectedPageTab!=null&&e.selectedPageTab!==a.selectedPageTab,u=e.selectedJETypeFilter!==void 0&&e.selectedJETypeFilter!==a.selectedJETypeFilter;c&&n.closeMatchSidePanel?.(),x===!0&&(c||u)&&_?.(),e.createdGroupCollapsed!=null?t(ec()):e.pendingGroupCollapsed!=null?t(tc()):e.selectedJETypeFilter!==void 0?t(ac(e.selectedJETypeFilter)):t(nc(e))},onUpdateMissingReceiptsUIState:e=>{t(Xo(e))},onFetchMissingReceiptsList:()=>{N!=null&&J!=null&&t(Ba({start:J,end:N},{amount:75,currencyCode:"USD",currencySymbol:"$"},!0,!1))},...i===!0?{onBulkUploadFiles:e=>{t(Ic(e))},onBulkUploadProgress:e=>{t(fc(e))},onBulkUploadSuccess:e=>{t(Cc({batchId:e}))},onBulkUploadUploadedFileCount:e=>{t(gc(e))},onConfirmBulkUploadMatch:(e,a,c,u,E)=>{t(Sc(e,a,c,u,E))},onBulkUploadConfirmMatchAcknowledged:()=>{t(hc())},onSetBulkUploadResultsTab:e=>{t(pc(e))},onSetBulkUploadCompletedSubTab:e=>{t(mc(e))},onSetBulkUploadSortConfig:(e,a)=>{t(fa({sortKey:e,sortOrder:a}))},onClearBulkUpload:()=>{t(uc())},onSearchTransactionsForManualMatch:(e,a)=>{t(Aa(e,a??void 0))},onLoadMoreManualSearch:()=>{const{manualSearch:e}=l.missingReceipts.bulkUpload;e.nextPageToken!=null&&e.searchQuery!==""&&t(Aa(e.searchQuery,e.nextPageToken))},onFetchCompletedTransactions:(e,a)=>{t(dc(e,a))},onClearBulkUploadBatchDetailsForScopeChange:()=>{t(rc())},onFetchBulkUploadBatches:e=>{t(Oa(e))},onFetchMoreBatchDetails:()=>{t(lc())},onResetBulkUploadSort:()=>{t(fa({sortKey:void 0,sortOrder:void 0}))}}:{},onClearMissingReceiptsTabNavigation:()=>{t(Qo())},onSearchTextChanged:e=>{const a=l.currentSelectedView,c=l.selectedTransactionCategorizationTab;a==="transaction_categorization"&&(t(Ct({selectedTab:c,uiState:{searchString:e}})),N!=null&&J!=null&&t(pe(c,{start:J,end:N},!0,!1,e,void 0,!1,!0)))},onFiltersChange:e=>{const a=l.selectedTransactionCategorizationTab;t(Zo({filters:e,selectedTab:a}))},onRefresh:()=>{n.trackExpenseAutomationTabAnalytics(!0),t(Ko())},onClose:()=>{z==="reconciliation"&&G!=null&&t(ga({selectedAccountId:void 0})),C("../")},onBack:()=>{z==="reconciliation"&&G!=null&&t(ga({selectedAccountId:void 0}))},onSaveReconciliation:e=>{t(Ho(e))},onSaveReconciliationReview:e=>{t(Yo(e))},onUpdateStep:e=>{const{selectedPeriod:a}=l,c=te(r.state?.pathnameStackToGoBack,r.pathname);C(`../${e}/${a.month}-${a.year}`,{state:{pathnameStackToGoBack:c,referrer:l.currentSelectedView}}),t(Ua(e))},handleLogOutClick:()=>{const e=te(r.state?.pathnameStackToGoBack,r.pathname);C("/signout",{replace:!0,state:{pathnameStackToGoBack:e,message:"logout"}})},onJeAccountSettingsChange:e=>{const{vendorsAccountSection:a}=e,{prepaidExpensesAccount:c,fixedAssetsAccount:u,accruedExpensesAccount:E}=a,y=ft(q.prepaidExpensesAccountList,c.selectedOptions),D=ft(q.fixedAssetsAccountList,u.selectedOptions),M=ft(q.accruedExpensesAccountList,E.selectedOptions),W={selectedPrepaidExpensesAccountIds:y.map((Y=>Y.accountId)),selectedFixedAssetsAccountIds:D.map((Y=>Y.accountId)),selectedAccruedExpensesAccountIds:M.map((Y=>Y.accountId))};t(Wo({data:W}))},onSaveJeAccountSettingsClick:()=>{t(Jo())},onJESchedulesFormDataChange(e,a){const{jeScheduleID:c,accumulatedDepreciationCategory:u,scheduleClass:E,scheduleExpenseCategory:y,vendor:D}=a,{allAccountList:M,allClassList:W,allDepreciationAccountList:Y}=l.jeSchedules,se=A.entityAutoCompleteView.vendor.length>0?A.entityAutoCompleteView.vendor.find((K=>K.id===D?.selectedOption)):void 0,ce={id:se?.zeniId??D?.selectedOption??"",name:se?.name??D?.defaultOptions.find((K=>K.value===D?.selectedOption))?.label??"",logo:se?.logo},Pe=y?.selectedOption!=null?M.find((K=>K.qboId===y.selectedOption)):void 0,ye=E?.selectedOption!=null?W.find((K=>K.classId===E.selectedOption)):void 0,ve=u?.selectedOption!=null?Y.find((K=>K.qboId===u.selectedOption)):void 0;t(qo({scheduledJournalEntryID:e,localData:{jeScheduleID:c,scheduledJournalEntryID:e,updatedCategoryId:Pe?.accountId,updatedClassId:ye?.classId,updatedAccumulatedDepreciationCategoryID:ve?.accountId,updatedVendor:{id:ce.id,name:ce.name}}}))},onRevertJeSchedule(e,a,c,u,E){t(No(e,a,c,u,E))},ignoreRecommendedJeSchedule(e,a,c,u){t(Go(e,a,c,u))},vendorSearchAutoCompleteActions:{onAutoCompleteInputChange:(e,a)=>{e.trim().length>=2?t(ua({searchString:e,entityType:a,searchOrigin:"common"})):e.trim().length===0&&t(Ke("common"))},onCancelAutoComplete:()=>{t(Ke("common"))}},onPostJESchedule(e,a){t($o({scheduledJournalEntryID:e,jeScheduleTransactionKey:a}))},clearJeScheduleLocalData(){t(Lo())},onViewTransaction(e){if(n.tenantEmailDomain==null)return;const a=ri(e,n.tenantEmailDomain),c=te(n.location.state?.pathnameStackToGoBack,`${n.location.pathname}${n.location.search}`);n.navigate(a,{state:{pathnameStackToGoBack:c,message:"expenseAutomation",origin:"je_schedules"}})},onSearchBaseTransaction(e){t(zo({query:e,scheduleType:R==="prepaid_expenses"?"prepaid_expenses":"fixed_assets"}))},onNewScheduleFormChange(e,a){const c=yt(e)==="prepaid_expenses"?"prepaid_expenses":"fixed_assets";t(Sa({scheduleType:c,localData:a}))},onOpenMatchNewModal(e){t(jo(e))},onCloseMatchNewModal(){t(Vo())},onClearMatchNewModal(){t(Bo())},onSearchMatchTransactions(e,a){t(Uo(e,a))},onSearchMatchAccruals(e,a){t(Oo(e,a))},onMatchAndReverse(e){t(Mo(e.transactionId,e.transactionIntegrationId,e.transactionType,e.lineIds,e.transactionSyncToken,e.accrualIds))},onUpdateActualMatchingUIState(e){t(_o(e))},onSaveSchedule(e,a){const c=e==="prepaid_expenses"?"prepaid_expenses":"fixed_assets",{allAccountList:u,allDepreciationAccountList:E}=l.jeSchedules,y=a.selectedAccount!=null?u.find((M=>M.qboId===a.selectedAccount)):void 0,D=a.selectedAccumulatedDepreciationCategory!=null?E.find((M=>M.qboId===a.selectedAccumulatedDepreciationCategory)):void 0;t(Sa({scheduleType:c,localData:{...a,selectedAccount:y?.accountId,selectedAccumulatedDepreciationCategory:D?.accountId}})),t(Fo({scheduleType:c}))},onCreateAccruedSchedule(e){const a="accrued_expenses";t(Ao()),t(xo()),t(wo({scheduleType:a,localData:e,selectedJeScheduleDetailId:void 0})),t(Ro({scheduleType:a})),t(Do(a,void 0))},onCreateOneTimeAccrual(e){t(Eo(e))},handleJeScheduleClick:(e,a,c)=>{if((function(E,y){return y!=="accrued_expenses"})(0,c)&&t(_a({selectedJEScheduleKey:a})),p!=null&&Ya(c))return void p(e,c,a);const u=te(r.state?.pathnameStackToGoBack,r.pathname);C(`../../vendors/schedules/${c}/details/${e}`,{state:{pathnameStackToGoBack:u,message:"expenseAutomation",origin:"je_schedules"}})},onOneTimeAccrualFeedback:(e,a,c,u)=>{t(a!=="revert"?vo(e,c,u):yo(e,c,u))},onOneTimeAccrualClick:e=>{if(p!=null)return void p(e,"one_time_accrual");const a=te(r.state?.pathnameStackToGoBack,r.pathname);C(`../../vendors/schedules/one_time_accrual/details/${e}`,{state:{pathnameStackToGoBack:a,message:"expenseAutomation",origin:"je_schedules"}})},onOpenMatch:e=>{n.openMatchPanel?.(e)},improveMonthEndInsightsUsingZeniGPTClick:e=>{b!=null&&t(Po(e,b.companyId,b.tenantId))},onClickCustomerRequest:I,setActivityLogTransactionId:h,onCloseAllThreadsSection:()=>{},onCloseFileAttachmentSnackBar:()=>{t(To())},onOpenFileAttachmentSnackBar:()=>{t(bt({messageSection:"cockpit_month_end_email_attachment_upload",messageText:"failed",type:"error",showStatusIcon:!0}))},onRemoveFileAttachment:e=>{t(bo(e))},onUpdateFileAttachment:e=>{t(ko({files:e}))},previewMonthEndReport:(e,a,c,u,E)=>{b!=null&&t(ha(e,b.companyId,a,!0,c,u,{agentInsightEdits:E,tenantId:b.tenantId}))},saveMonthEndReport:(e,a,c,u,E)=>{b!=null&&t(ha(e,b.companyId,a,!1,c,u,{agentInsightEdits:E,tenantId:b.tenantId}))},onEditMonthEndInsightsClick:m,sendMonthEndReport:e=>{const a=r.state?.referrer,{selectedPeriod:c,auditSummary:u}=l;b!=null&&u?.auditScorePercentage!=null&&(t(fo(b.companyId,e,b.tenantId)),Q.trackInsightsEmailPage(c.month,c.year,!1,"draft",u.auditScorePercentage,Io().format(Ha.analytics.MMMDDCommaYYYYformat),a??null))},onTransactionCategorizationRowClick:(e,a)=>{const c=l.transactionView.uiState.searchString??"",u=l.transactionView.transactions,E=u.findIndex((M=>M.id===e)),y=c.length>0?{resultPosition:E>=0?E+1:void 0,resultsCount:u.length,searchTerm:c}:void 0;if(n.openTransactionPanel)return void n.openTransactionPanel(e,a,y);const D=te(r.state?.pathnameStackToGoBack,r.pathname);C(`../../transaction/${a}/${e}`,{state:{pathnameStackToGoBack:D,message:"expenseAutomation",origin:"transaction_categorization",searchContext:y}})},setLocalDataForCategoryAndClass:(e,a,c,u,E,y,D,M,W,Y,se,ce)=>{t(Co(e,a,c,u,k,E,y,D,M,W,Y,se,ce))},onCancelAutoComplete:()=>{t(Ke("common"))},updateExpenseAutomationReconListScrollPosition:e=>{t(ma({scrollPosition:e}))},onUpdateTab:e=>{n.closeSidePanel?.(),N!=null&&J!=null&&(t(pe(e,{start:J,end:N},!1,!1)),t(go(e)))},onUpdateTransactionCategorizationCompletedSubTab:e=>{n.closeSidePanel?.(),N!=null&&J!=null&&(t(So(e)),t(pe("autoCategorized",{start:J,end:N},!1,!1)))},onTransactionGroupChange:e=>{n.closeSidePanel?.(),N!=null&&J!=null&&(t(ho(e)),t(pe(n.expenseAutomationViewSelector.selectedTransactionCategorizationTab,{start:J,end:N},!1,!1)))},onUpdateTransactionCategorizationUIState:(e,a)=>{t(Ct({selectedTab:e,uiState:a})),N!=null&&J!=null&&t(pe(e,{start:J,end:N},!1,!1,a.searchString,null,!0))},onUpdateScrollYOffSetTransactionCategorizationUIState:(e,a)=>{t(Ct({selectedTab:e,uiState:a}))},onFetchTransactionCategorizationList:(e,a,c,u,E,y)=>{N!=null&&J!=null&&t(pe(e,{start:J,end:N},!0,c,a,u,E,y))},resetTransactionCategorizationLocalData:(e,a,c,u,E,y,D)=>{t(po(e,a,c,u,D??null,E,y,!1)),Qc(t,a.map(String))},updateSelectedVendorForTransaction:(e,a,c,u,E)=>{t(pa({selectedTab:e,transactionId:a,lineId:c,selectedTransaction:u,uncategorizedAccounts:k,updatedVendor:E,isAccountingClassesEnabled:g}))},onSaveUpdateTransactionCategorization:(e,a,c)=>{const u=r.state?.referrer;e==="autoCategorized"?Q.trackTransactionsAutoCategorisedPage(T.month,T.year,l.transactionView.totalCountByTab.autoCategorized,a.length,!1,u??null):Q.trackTransactionsReviewPage(T.month,T.year,l.transactionView.totalCountByTab.review,a.length,!1,u??null),t(mo(e,a,c)),Zc(a.map(String))},onUpdateSelectedCheckboxTransactionIds:(e,a)=>{t(uo({selectedTab:e,transactionIds:a}))},onFetchRecommendationsForEntityCategorizationWithCustomer:(e,a,c,u,E,y)=>{const{transactionId:D,transaction:M,lineIds:W}=a;y!=null&&t(lo({transactionId:D,customerUpdates:y})),t(ro({selectedTab:u,transactionId:D.id,lineId:W[0],selectedTransaction:M,uncategorizedAccounts:k,updatedCustomer:y,selectedEntity:E,isAccountingClassesEnabled:g})),E!=null&&t(Pt({entity:E,amount:e,transactionDetails:a,flowType:"categorization",selectedTab:u,isFetchCOT:d}))},onFetchRecommendationsForEntityCategorization:(e,a,c,u,E,y)=>{const{transactionId:D,transaction:M,lineIds:W}=a;y!=null&&(t(oo({transactionId:D,vendorUpdates:{name:y.name,id:y.id?y.id:void 0}})),t(co({vendorId:y.id?y.id:void 0,localData:{vendorName:y.name,vendorId:y.id?y.id:void 0}}))),y?.id?(t(pa({selectedTab:u,transactionId:D.id,lineId:W[0],selectedTransaction:M,uncategorizedAccounts:k,updatedVendor:y,selectedEntity:E,isAccountingClassesEnabled:g})),E!=null&&t(Pt({entity:E,amount:e,transactionDetails:a,flowType:"categorization",selectedTab:u,isFetchCOT:d}))):t(io({selectedTab:u,transactionId:D.id,lineId:W[0]}))},fetchFluxViewOnScroll:(e,a)=>{t(Xe(e,!0,!1,a,!1,!0))},onFetchFluxViewList:()=>{t(Xe(T,!0,!1,null,!1,!1))},markAsReview:(e,a,c,u)=>{Q.trackFluxAnalysisReviewed(c.month,c.year,u??!1,e),t(so(a,e,c,u??!1))},onUpdateFluxAnalysisUIState:e=>{t(no(e))},updateOperatingExpensesIdsForReview:e=>{t(ao({operatingExpenseIds:e,selectedPeriod:T}))},redirectToVendorDetailPage:e=>{if(n.tenantEmailDomain!=null){const a=li(e.id,e.qboId,n.tenantEmailDomain),c=te(n.location.state?.pathnameStackToGoBack,n.location.pathname);n.navigate(a,{state:{pathnameStackToGoBack:c,message:"expenseAutomation",referrer:"Vendor List",origin:"flux_analysis"}})}},updateSectionIdsForReview:e=>{t(to({sectionId:e,selectedPeriod:T}))},onFetchReimbursementView:(e,a,c)=>{t(Xe(e,!0,!1,a,!0,c))},onReviewClicked:e=>{t(re(T,e))},setOpenDrawerClicked:e=>{t(tt({selectedDrawerAccountId:e}))},onFetchLinkTokenClick:(e,a)=>{t(Ra("expense_automation_reconcile",e,a))},onEstablishConnectionClick:(e,a)=>{const c=b?.companyId;c!=null&&(t(Da(e,c,"expense_automation_reconcile",void 0,"link_account_no_microdeposit",a)),t(Fa({accountId:a,connectionInProgress:!0})))},onAddStatementClick:e=>{t(tt({selectedDrawerAccountId:e})),t(Ze({accountId:e,selectedPeriod:T,localData:{accountSource:"bank_statement"}})),t(Qe({statementUploadChosen:!0}))},onReloadReconciliationListPage:()=>{t(re(T,void 0,!0,!1))},onUpdateReconcileTabLocalData:e=>{t(eo({selectedTransactionIds:e}))},onReconTabColumnSortConfigChanged:(e,a)=>{t(Xs({sortKey:e,sortOrder:a}))},onReconReviewTabColumnSortConfigChanged:(e,a)=>{t(Qs({sortKey:e,sortOrder:a}))},onReconTabUpdate:e=>{n.closeSidePanel?.(),t(Zs({selectedTab:e}))},updateReconReviewTabLocalData:(e,a,c)=>{const u=e.vendor?.id;c&&u!=null&&t(Hs(u)),t(Ks({data:e,transactionId:a}))},onReconMatchedTransactionClick:e=>{if(n.openTransactionPanel)return void n.openTransactionPanel(e,Tt("bill"));const a=te(r.state?.pathnameStackToGoBack,r.pathname);C(`../../transaction/bill/${e}`,{state:{pathnameStackToGoBack:a,message:"expenseAutomation",origin:"reconciliation"}})},onReloadPage:()=>{window.location.reload()},onBackClick:()=>{C(-1)},onReconListPageScroll:e=>{t(ma({scrollPosition:e}))},onVendorAutoCompleteInputChange:e=>{e.trim().length>=2?t(ua({searchString:e,searchOrigin:"common"})):e.trim().length===0&&t(Ke("common"))},onReconNodeCollapseToggled:(e,a)=>{t(Ys({nodeId:e,collapsed:a}))},updateSectionCollapseStatus:()=>{},onExcludeAccountFromReconciliation:e=>{t(xa({accountId:e}))},onIncludeAccountIntoReconciliation:e=>{t(wa({accountId:e}))}}}),((t,n,S)=>{const{isMissingReceiptsBulkUploadEnabled:g,...d}=S;return(function(i,r,A){return{...i,...r,...A,onUploadTransactionReceipt:(l,b,R,k,C)=>{r.onUploadTransactionReceipt(l,b,R,k,C,i.authParams)}}})(t,n,d)}))(Nc(qc)),It="newScheduleMode",kt="newScheduleType",Ri=Ti(ai((function(t){const n=t.displayName??t.name??"Component",S=ja.memo(t),g=d=>{const i=he(),r=(function(){const p=he(),h=F((T=>Me(T).reconciliation.selectedDrawerAccountId));return{isOpen:h!=null,selectedAccountId:h,openPanel:s.useCallback((T=>{p(tt({selectedDrawerAccountId:T}))}),[p]),closePanel:s.useCallback((()=>{p(tt({selectedDrawerAccountId:void 0}))}),[p])}})(),A=F((p=>Me(p).reconciliation)),l=F((p=>ke(p))),b=s.useCallback(((p,h)=>{i(Ra("expense_automation_reconcile",p,h))}),[i]),R=s.useCallback(((p,h)=>{const T=l?.companyId;T!=null&&(i(Da(p,T,"expense_automation_reconcile",void 0,"link_account_no_microdeposit",h)),i(Fa({accountId:h,connectionInProgress:!0})))}),[i,l?.companyId]),k=s.useMemo((()=>{if(r.isOpen&&r.selectedAccountId!=null)return f.jsx(gi,{reconciliation:A,selectedDrawerAccountId:r.selectedAccountId,onClose:r.closePanel,onFetchLinkTokenClick:b,onEstablishConnectionClick:R})}),[r.isOpen,r.selectedAccountId,r.closePanel,A,b,R]),C=s.useMemo((()=>({reconPanelContent:k,reconSidePanelIsOpen:r.isOpen,closeReconSidePanel:r.closePanel})),[k,r.isOpen,r.closePanel]),{useFeatureGate:I}=Be(),{isFeatureEnabled:m}=I(H.isReconV3Enabled),_=s.useContext(ka),x=s.useMemo((()=>r.isOpen?m===!0?{selectedItemId:r.selectedAccountId}:{closePanel:r.closePanel,selectedItemId:r.selectedAccountId}:_),[r.isOpen,r.closePanel,r.selectedAccountId,_,m]);return f.jsx(ka.Provider,{value:x,children:f.jsx(S,{...d,...C})})};return g.displayName=`withReconSidePanel(${n})`,g})(Si((({closeMatchSidePanel:t,closeReconSidePanel:n,closeSidePanel:S,matchPanelContent:g,isMatchPanelOpen:d,openMatchPanel:i,openTransactionPanel:r,panelContent:A,reconPanelContent:l,reconSidePanelIsOpen:b,isSchedulePanelOpen:R,closeSchedulePanel:k,openSchedulePanel:C,schedulePanelContent:I,schedulePendingDiscardConfirmation:m,sidePanelIsFullView:_,sidePanelIsOpen:x})=>{const{isAiCfoOpen:p,setIsAiCfoOpen:h}=Rc(),T=Dc(),{isOpen:z}=Fc(),G=nt(),q=be(),P=he(),{isAiCfoAccessEnabled:J,onAskAiCfoClick:N}=Ga({mobileExploreReferrer:"Transaction categorization"}),e=s.useCallback((()=>{d===!0&&t?.(),x===!0&&_!==!0&&S?.()}),[t,S,d,_,x]),a=F(vs);s.useEffect((()=>{a===!0&&(e(),P(Es()))}),[a,e,P]);const{areTenantIdsInSync:c}=za(),u=vi(),E=_c(),[y,D]=s.useState(!1),[M,W]=qn(),Y=s.useCallback((o=>{W((w=>{const $=new URLSearchParams(w);return o==null?($.delete(It),$.delete(kt),$):($.set(It,o.scheduleDetailsMode),$.set(kt,o.scheduleType),$)}),{replace:!0})}),[W]),[se,ce]=s.useState(void 0),Pe=s.useCallback(((o,w,$)=>{const j=yt(o);ce(j),Y({scheduleDetailsMode:w,scheduleType:o}),P(la({scheduleType:j==="prepaid_expenses"?"prepaid_expenses":"fixed_assets",shouldResetEnteredData:$}))}),[P,Y]),ye=s.useMemo((()=>{const o=M.get(It),w=M.get(kt);return o!=null&&w!=null?{scheduleDetailsMode:o,scheduleType:w}:void 0}),[M]),ve=s.useCallback((o=>{Y(o),o!=null&&P(la({scheduleType:yt(o.scheduleType)==="prepaid_expenses"?"prepaid_expenses":"fixed_assets",shouldResetEnteredData:!0}))}),[P,Y]),K=F((o=>ia(o))),B=F((o=>ke(o))),[Ve,Ee]=s.useState(!1),[ot,Se]=s.useState(!1),[je,v]=s.useState([]),[L,Z]=s.useState(null),X=s.useCallback((()=>{Z(null)}),[]),ge=L?.contentType==="activity"?L.detail.transactionId:void 0,ct=s.useCallback((o=>{o!=null?(p&&h(!1),T(),e(),Z({contentType:"activity",detail:{transactionId:o}})):Z((w=>w?.contentType==="activity"?null:w))}),[e,p,T,h]),Ka=s.useCallback((o=>{p&&h(!1),T(),e(),Z({contentType:"transfer",detail:o})}),[e,p,T,h]),Za=s.useCallback((()=>{T(),X(),e(),N()}),[e,X,N,T]),vt=s.useRef(p);s.useEffect((()=>{p===!0&&vt.current===!1&&(T(),X(),e()),vt.current=p}),[e,X,p,T]);const Et=s.useRef(z);s.useEffect((()=>{z===!0&&Et.current===!1&&(p&&h(!1),X(),d===!0&&t?.(),x===!0&&_!==!0&&S?.()),Et.current=z}),[X,t,S,z,p,d,h,_,x]);const ze=x===!0&&_!==!0||d===!0,At=s.useRef(ze);s.useEffect((()=>{ze&&!At.current&&(p&&h(!1),T(),X()),At.current=ze}),[X,p,ze,T,h]);const[xt,Qa]=s.useState(!1),wt=s.useRef(!1),{selectedTab:Xa}=Ue(),{tenantEmailDomain:it}=Ue(),[lt,Rt]=s.useState(q.state?.message==="comingFromTransactionDetail"),Dt=q.state?.message==="comingFromOverview",en=Mc(),rt=st.getSignedInUser(),{useFeatureGate:oe}=Be(),{isFeatureEnabled:Ft}=oe(H.isRealtimeInsightsFeatureEnabled),{isFeatureEnabled:Ae}=oe(H.isMissingReceiptsBulkUploadEnabled),{isFeatureEnabled:dt}=oe(H.isTransactionActivityEnabled),{isFeatureEnabled:de}=oe(H.isAccrualEnabled),{isFeatureEnabled:_t}=oe(H.isCreateTransferEntryFromExpenseEnabled),{isFeatureEnabled:tn}=oe(H.isExpenseAutomationCommentingEnabled),{isFeatureEnabled:an}=oe(H.isProjectsTransactionsEnabled),{isFeatureEnabled:nn}=oe(H.isReconV3Enabled),sn=s.useCallback((o=>{const w=Tt(o.transactionType??(o.view==="reconciliation"?"bill":"expense")),$=te(q.state?.pathnameStackToGoBack,q.pathname),j=new URLSearchParams({view:"full"});o.threadId!=null&&j.set("thread_id",o.threadId),o.entityType!=null&&j.set("entity_type",o.entityType),G(`/${it}/transaction/${encodeURIComponent(w)}/${o.transactionId??o.entityId}?${j.toString()}`,{state:{pathnameStackToGoBack:$,message:"expenseAutomation"}})}),[G,it,q.state,q.pathname]),on=F((o=>As(o,"common"))),V=F((o=>Me(o))),{categoryOptions:cn,paymentAccountNames:ln}=F((o=>xs(o.accountState))),rn=F((o=>ws(o.classState))),{monthEndCloseChecksView:ee,currentSelectedView:O,selectedPeriod:U,selectedTransactionCategorizationTab:ut,currentSelectedViewBackgroundRefreshFetchState:dn,currentSelectedViewFetchState:ie,jeSchedules:mt,reconciliation:Mt}=V;Wc(O==="transaction_categorization");const un=V.transactionView.saveStatus.fetchState,Le=V.transactionView.transactions,Ot=s.useRef(Le);Ot.current=Le;const Ut=F((o=>o.expenseAutomationTransactionsViewState?.transactionCategorizationView)),Bt=F((o=>o.expenseAutomationTransactionsViewState?.selectedTransactionCategorizationTab)),Vt=s.useRef(Ut);Vt.current=Ut;const jt=s.useRef(Bt);jt.current=Bt;const $e=F((o=>{const w=o.expenseAutomationTransactionsViewState?.selectedTransactionCategorizationTab;return w!=null?o.expenseAutomationTransactionsViewState?.transactionCategorizationView?.[w]?.filters:void 0})),zt=s.useRef("");s.useEffect((()=>{if(O!=="transaction_categorization")return;const o=V.transactionView.uiState.searchString??"";if(ie.fetchState!=="Completed"||o.length===0||o===zt.current)return;zt.current=o;const w=$e!=null?Oc($e):0,$=$e?.categories.filter((j=>j.values.length>0&&String(j.values[0]??"").trim()!=="")).map((j=>`${j.field}:${j.values.join(",")}`))??[];Q.trackAiCloseTransactionSearch({filtersApplied:$,hasResults:Le.length>0,isFiltered:w>0,resultsCount:Le.length,searchTerm:o,searchType:"free_text"})}),[O,ie.fetchState,V.transactionView.uiState.searchString,V.transactionView.transactions,$e]);const le=Yc(un,(()=>{const o=[],w=jt.current,$=Vt.current,j=$!=null&&w!=null?$[w]:void 0;if(j?.transactionReviewLocalDataById!=null)for(const fe of Object.values(j.transactionReviewLocalDataById)){const ae=fe?.transactionReviewLocalData?.lineItemById;if(ae!=null)for(const pt of Object.values(ae)){const Fe=pt?.account;Fe?.accountId!=null&&o.push(Fe.accountId)}}const Ce=Ot.current;for(const fe of Ce)for(const ae of fe.lines??[])"account"in ae&&ae.account?.accountId!=null&&o.push(ae.account.accountId);return o}));s.useEffect((()=>{O==="transaction_categorization"&&x!==!0||ct(void 0)}),[O,ct,x]),s.useEffect((()=>{b===!0&&n?.()}),[O,Mt.selectedAccountId]);const mn=V.transactionView.selectedTransactionCategorizationCompletedSubTab,pn=V.transactionView.selectedTransactionGroup,Ge=`${ut}|${mn}|${pn}`,Ne=s.useRef(null),Lt=s.useRef(null);s.useEffect((()=>{Ne.current!==null?Ne.current!==Ge&&(Ne.current=Ge,O==="transaction_categorization"&&X()):Ne.current=Ge}),[X,O,Ge]);const hn=F((o=>ge==null?void 0:Rs(o.transactionState,ge))),ue=hn?.qboId,$t=F((o=>ue==null?void 0:Ds(o,ue)));s.useEffect((()=>{ue!=null&&P(Fs(ue))}),[P,ue]);const{createTransferEntryStatus:Gt,creditCardTransferAccountsList:Nt,transferAccounts:qt}=V.transactionView,Jt=s.useCallback((o=>Hc(P,o)),[P]),Wt=s.useMemo((()=>O!=="transaction_categorization"||L==null?null:L.contentType==="activity"?dt===!0?f.jsx(Uc,{activityLogView:$t,qboId:ue,onClose:()=>Z(null),selectedTransactionId:L.detail.transactionId,isQuickViewCardStyle:!0},String(L.detail.transactionId)):null:L.contentType==="transfer"?f.jsx(Bc,{createTransferEntryStatus:Gt,creditCardTransferAccountsList:Nt,transaction:L.detail,transferAccounts:qt,onClose:()=>Z(null),onCreateTransfer:Jt,isQuickViewCardStyle:!0},String(L.detail.transactionId)):null),[O,L,dt,$t,ue,Gt,Nt,qt,Jt]),Sn=Wt!=null,{selectedAccountId:xe}=Mt,Yt=et(mt.accountSettingsView.saveState.fetchState),gn=F((o=>_s(o.accountState,o.accountListState,"accountList"))),Cn=F((o=>Ms(o))),we=qa(Xa)??O,fn=F((o=>o.entityAutoCompleteState.autoCompleteText.common));if(La({isDataReady:ie.fetchState==="Completed"}),rt==null)throw Error("Can't access expense automation screen without signing in...");const Ht=Ma(U),Re=at(Ht.start),De=at(Ht.end);if(Re==null||De==null)throw Error(`Invalid start - ${Re} and end - ${De} period from given ${U}`);const In=s.useCallback((()=>{Ee(!1)}),[]),kn=s.useCallback((()=>{Se(!0)}),[]),bn=s.useCallback((o=>{v(o),Se(!1)}),[]),Tn=s.useCallback((()=>{v([])}),[]),qe=V.missingReceipts.bulkUpload.phase,Kt=V.missingReceipts.bulkUpload.currentBatchId;s.useEffect((()=>{Ae===!0&&O==="missing_receipts"&&qe==="matching"&&Kt!=null&&P(Oa({cacheOverride:!0}))}),[Ae,O,qe,Kt,P]);const Zt=rt?.userId,Pn=U.month,yn=U.year,Qt=B?.tenantId;s.useEffect((()=>{O==="missing_receipts"&&Ae!==!1&&qe==="idle"&&Zt!=null&&Qt!=null&&P(Os())}),[O,Ae,qe,Zt,Qt,Pn,yn,P]),s.useEffect((()=>{K.newVendorState?.vendorDetailLocalData?.vendorName!=null?D(!0):D(!1)}),[K.newVendorState?.vendorDetailLocalData?.vendorName]),s.useEffect((()=>{we!=null&&O!==we&&P(Ua(we))}),[we]),s.useEffect((()=>{xt===!1&&ie.fetchState==="Completed"&&c&&(Qa(!0),P(ra(!1,!1,de===!0)))}),[xt,ie,c,de]),s.useEffect((()=>{const o={month:U.month,year:U.year},w=Lt.current;Lt.current=o,w===null||w.month===o.month&&w.year===o.year||!Dt&&c&&(P(ra(!1,!1,de===!0)),P(re(U,xe,!1,!1)))}),[U.month,U.year,c,de]);const Je=s.useCallback(((o=!1,w=!1)=>{const $={start:Re,end:De};switch(O){case"transaction_categorization":P(pe(ut,$,o,!lt,void 0,void 0,w)),Rt(!1);break;case"flux_analysis":P(Xe(U,o,w,null));break;case"month_end_insights":if(w===!1){const j=new Date(U.year,U.month,0),Ce=Bs(j.toDateString()).format(Ha.analytics.YYYYDashMMDashDDFormat);P(Vs(!0,B.companyId,B.tenantId,Ce)),P(js(B.companyId,B.tenantId))}break;case"je_schedules":P(Us($,w,de===!0));break;case"missing_receipts":P(Ba($,{amount:75,currencyCode:"USD",currencySymbol:"$"},o,w));break;default:P(re(U,xe,o,w))}}),[O,Re,De,B.companyId,B.tenantId,ut,U,xe,lt,Rt,de]),vn=s.useCallback((()=>{Je(!0,!0)}),[Je]);s.useEffect((()=>{O===we&&ie.fetchState==="Not-Started"&&c&&Je(!0)}),[ie,Re,De,B.companyId,B.tenantId,c]),s.useEffect((()=>{Dt||lt||wt.current||dn.fetchState==="In-Progress"||ie.fetchState!=="Completed"||(wt.current=!0,Je(!0,!0))}),[]),s.useEffect((()=>{ee.fetchState!=="In-Progress"&&ee.fetchState!=="Completed"&&ee.fetchState!=="Error"&&B?.tenantId!=null&&P(_e({tenantId:B.tenantId,period:U,refreshViewInBackground:!1}))}),[ee.fetchState,B?.tenantId]),s.useEffect((()=>{ee.fetchState!=="Completed"||!c||(ee.monthEndCloseChecks?.monthEndCloseCheckList.some((o=>o.id==="reconciliation"))??!1)&&V.reconciliation.fetchStatus.fetchState==="Not-Started"&&P(re(U,void 0,!1,!1))}),[ee.fetchState,c,U.month,U.year,V.reconciliation.fetchStatus.fetchState,P]),s.useEffect((()=>{V.monthEndInsights?.previewMonthEndReportStatus?.fetchState==="Completed"?Ee(!0):Ee(!1)}),[V.monthEndInsights?.previewMonthEndReportStatus?.fetchState]),s.useEffect((()=>{V.monthEndInsights?.sendMonthEndReportStatus?.fetchState==="Completed"&&c&&(P(_e({tenantId:B.tenantId,period:U,refreshViewInBackground:!0})),P(zs({companyId:B.companyId})),G("../"))}),[V.monthEndInsights?.sendMonthEndReportStatus?.fetchState,B.tenantId,U,B.companyId,c]),s.useEffect((()=>{const o=setInterval((()=>{ee.fetchState!=="In-Progress"&&ee.fetchState==="Completed"&&P(_e({tenantId:B.tenantId,period:U,refreshViewInBackground:!0}))}),3e5);return()=>clearInterval(o)}),[ee.fetchState,B.tenantId,U,P]),s.useEffect((()=>{const o=setInterval((()=>{O==="reconciliation"&&xe==null&&V.reconciliation.fetchStatus.fetchState==="Completed"&&V.reconciliation.refreshStatus.fetchState!=="In-Progress"&&P(re(U,void 0,!0,!0))}),3e5);return()=>clearInterval(o)}),[O,P,V.reconciliation.fetchStatus.fetchState,V.reconciliation.refreshStatus.fetchState,re,xe,U]);const En=Ta(),{isFeatureEnabled:An}=oe(H.isRecommendationFeedbackEnabled),Xt=Vc(),{onRecommendationSelection:ea,popup:xn}=Kc({isEnabled:An}),wn=s.useMemo((()=>({...Xt,onRecommendationSelection:ea})),[Xt,ea]);s.useEffect((()=>{const o=(ee.monthEndCloseChecks?.monthEndCloseCheckList.find((w=>w.id==="month_end_insights"))?.isDisabled??!1)&&!Ft;O!=="month_end_insights"||!o&&ee.monthEndCloseChecks?.reportEmailSentDate==null||G("../")}),[O,ee.monthEndCloseChecks]);const Rn=b===!0?l:A,Dn=b===!0||x===!0,Fn=b===!0?n:S,_n=b!==!0&&_;s.useEffect((()=>{Yt==="In-Progress"&&mt.accountSettingsView.saveState.fetchState==="Completed"&&P(da())}),[Yt,mt.accountSettingsView.saveState.fetchState,da]);const{transactionId:ta,onSaveVendor:Mn,onSaveSuccess:On,onCancel:Un,vendorViewDetails:Bn}=(({expenseAutomationViewSelector:o,closeDrawerHandler:w,currentSelectedView:$})=>{const j=he();let Ce,fe,ae;const pt=Ta(),Fe=o.transactionView;let aa=()=>{};const{transactions:Vn,selectedTransactionId:Ie,selectedTransactionLineId:We,transactionLocalData:jn}=Fe;if($==="transaction_categorization"){const ht=jn.find((me=>me.transactionId===Ie)),ne=Vn.find((me=>me.id===Ie)),na=We!=null?ht?.transactionReviewLocalData?.lineItemById[We]:void 0,sa=na?.account;fe=na?.class?.classId,Ce=["Uncategorized Income","Uncategorized Expense"].includes(sa?.accountName??"")?void 0:sa?.accountId;const Ln=ii(Ie,ne?.typeOfTransaction);ne!=null&&Ln&&(ae={id:Ie,type:Tt(ne.typeOfTransaction)}),aa=()=>{if(Ie!=null&&We!=null&&ne!=null){const me=Fe.transactionLocalData.find((Ye=>Ye.transactionId===Ie))?.transactionReviewLocalData;if(me!=null&&ne.lines!=null&&ne.lines.length>0){const Ye=me.lineItemById[We];let St=me.selectedEntity;if(ys(ne)||(St=Ye.selectedEntityLine),St!=null){const $n=St,Gn={transactionId:{id:ne.id,type:ne.type},transaction:ne,lineIds:ne.lines.map((Nn=>Nn.id))??[]};j(Pt({entity:$n,amount:Ye.amount.amount,transactionDetails:Gn,flowType:"categorization",selectedTab:o.selectedTransactionCategorizationTab,isFetchCOT:pt}))}}}}}const zn=F((ht=>ia(ht,void 0,Ce,fe)));return{transactionId:ae,onSaveVendor:()=>{j(Ps(ae,void 0,!1,!0))},onSaveSuccess:aa,onCancel:()=>{ae!=null&&j(ks({transactionId:ae})),j(bs()),j(Ts()),w()},vendorViewDetails:zn}})({expenseAutomationViewSelector:V,closeDrawerHandler:()=>{D(!1)},currentSelectedView:O});return en?.loggedInUserRoleMap==null?ee.fetchState==="Error"?f.jsx(jc,{onGoHome:()=>G("../",{replace:!0}),onReload:()=>window.location.reload()}):f.jsx($a,{fetchState:"In-Progress"}):f.jsxs(f.Fragment,{children:[f.jsx(di,{isOpen:ot,drawerLeftMargin:new zc(0,0,300,650),onClose:()=>{Se(!1)},children:f.jsx(Di,{onClick:o=>o.stopPropagation(),children:f.jsx(Pi,{companyId:B.companyId,closeCustomerRequestDrawer:()=>Se(!1),addCustomerRequest:bn,resetCustomerRequest:Tn})})}),ta!=null&&y&&f.jsx(Xc,{isOpen:y,transactionId:ta,onSaveVendor:Mn,onSaveSuccess:On,onCancel:Un,vendorViewDetails:Bn}),f.jsx(Lc,{toolkit:wn,children:f.jsx(wi,{events:[],eventCallback:(o,w,$)=>{},navigate:G,location:q,themeState:E,categoryOptions:cn,classesForFilters:rn,accountsForFilters:ln,vendorSearchAutoCompleteData:{autoCompleteText:fn,entityAutoCompleteView:on},expenseAutomationViewSelector:V,isMissingReceiptsBulkUploadEnabled:Ae,monthEndInsightsPreviewMode:Ve,monthEndInsightsCustomerRequestData:je,isRealtimeInsightsFeatureEnabled:Ft,isCreateTransferEntryFromExpenseEnabled:_t,isAccountingClassesEnabled:Cn,isProjectsTransactionsEnabled:an,isCOTEnabled:En,currentTenant:B,companyId:B.companyId,signedInUser:rt,isTransactionActivityEnabled:dt,isRightPanelOpen:Sn,rightSidePanel:Wt,onOpenTransferRightPanel:_t===!0?Ka:void 0,uncategorizedAccounts:gn,newScheduleActiveType:se,isAccrualEnabled:de,newScheduleSelection:ye,onNewScheduleSelectionChange:ve,onScheduleTypeChange:Pe,onNewScheduleSaved:vn,onClickCustomerRequest:kn,handleEditClick:In,tenantEmailDomain:it,trackExpenseAutomationTabAnalytics:u,setActivityLogTransactionId:ct,closeMatchSidePanel:t,closeSidePanel:Fn,openTransactionPanel:r,closeSchedulePanel:k,openSchedulePanel:C,openMatchPanel:i,sidePanelIsOpen:Dn,sidePanelIsFullView:_n,panelContent:Rn,isAiCfoAccessEnabled:J,onAskAiCfoClick:Za,isExpenseAutomationCommentingEnabled:tn,isReconV3Enabled:nn,onExpenseAutomationCommentingThreadClick:sn,sidePanelListPercent:b===!0?66:void 0,isMatchPanelOpen:d,isSchedulePanelOpen:R,matchPanelContent:g,schedulePanelContent:I,schedulePendingDiscardConfirmation:m})}),xn,le.showPopup&&le.popupType!=null&&f.jsx($c,{popupType:le.popupType,currencySymbol:le.currencySymbol,accountId:le.popupAccountId??"",accountName:le.popupAccountName??"",onSubmit:le.handleSubmit,onDismiss:le.handleDismiss})]})}))))),Di=Te(bc)`
35
- display: flex;
36
- min-height: 100%;
37
- flex-direction: column;
38
- `;function Fi(){const t=be(),{selectedTab:n,tenantEmailDomain:S}=Ue(),g=F((r=>ke(r))),d=F((r=>r.expenseAutomationViewState.selectedPeriodByTenantId[g.tenantId]));if(qa(n)==null)return f.jsx(Va,{});const i=Na({tenantEmailDomain:S,selectedTab:n,selectedPeriod:d!=null?`${d.month}-${d.year}`:void 0});return i==null?null:f.jsx(Yn,{to:i,replace:!0,state:t.state})}function ll(){return f.jsxs(Wn,{children:[f.jsx(He,{index:!0,element:f.jsx(ui,{})}),f.jsx(He,{path:"/:selectedTab/:selectedPeriod/*",element:f.jsx(Ri,{})}),f.jsx(He,{path:"/:selectedTab",element:f.jsx(Fi,{})}),f.jsx(He,{path:"*",element:f.jsx(Va,{})})]})}export{ll as default};
@@ -1 +0,0 @@
1
- import{j as s}from"./liveblocks-UOzcPsHa.js";import{a as r}from"./sentry-DHDsO12F.js";import{aw as f,ax as l,o as p,a4 as b}from"./index-6nH5LMe4.js";import"./mui-Do6nLzGb.js";import m from"./NotFoundScreen-BkYIKPgh.js";import{h as c,g as u}from"./core-B5mDy9pu.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]="a4845c9e-9816-4d47-ad6f-7bb2b55829fb",e._sentryDebugIdIdentifier="sentry-dbid-a4845c9e-9816-4d47-ad6f-7bb2b55829fb")}catch{}})();const _=()=>{const e=c(),a=u(),t=r.useCallback((()=>{window.open("https://www.zeni.ai/demo/request","_blank")}),[]),d=r.useCallback((()=>{(()=>{const n=b(a.state?.pathnameStackToGoBack),i=n.poppedPathname??k();e(i,{state:{pathnameStackToGoBack:n.newStack}})})()}),[]),o=f(a.pathname);return o!=null?s.jsx(l,{menuItem:p(o),onDemoClick:t,onGoBack:d}):s.jsx(m,{})},k=(e=2)=>{let a="../";for(let t=0;t<e;t++)a=`${a}../`;return a};export{_ as F};
@@ -1 +0,0 @@
1
- import{a as o}from"./sentry-DHDsO12F.js";import{u as l,h as f,g as m}from"./core-B5mDy9pu.js";import{hY as p,Un as g,Uo as _}from"./zeni-epic-state-7eY0g-Bc.js";import{u as b,L as h,z as y}from"./index-6nH5LMe4.js";import"./liveblocks-UOzcPsHa.js";import"./recharts-uFX1dZS-.js";import"./mui-Do6nLzGb.js";import"./analytics-D6GpUSOP.js";import"./plaid-0g_vwjSd.js";import"./dnd-CGWe1ZMP.js";import"./stripe-cKAAJElX.js";import"./lottie-C5eNvt0I.js";import"./lexical-DW4lC8Zx.js";import"./pdf-DjwvAC2g.js";import"./utils-BsODCDYR.js";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},n=new e.Error().stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="82557390-56bd-46f8-81c9-de5dca58baf7",e._sentryDebugIdIdentifier="sentry-dbid-82557390-56bd-46f8-81c9-de5dca58baf7")}catch{}})();function j(){const e=l(),n=f(),r=m(),{setLoading:i,clearAllLoading:u}=b(),s=o.useRef(!1);return o.useLayoutEffect((()=>{i(h.CONNECTION_AUTH)}),[i]),o.useEffect((()=>{if(s.current)return;s.current=!0;const a=new URLSearchParams(r.search).get("code"),d=sessionStorage.getItem("hubspot_oauth_pending");if(sessionStorage.removeItem("hubspot_oauth_pending"),a!=null&&d!=null){const t=JSON.parse(d);e(p(t.tenant_id,t.connection_id,g("revenue"),_("hubspot"),{authorization_code:a,client_id:t.client_id,client_secret:t.client_secret,redirect_uri:t.redirect_uri}))}u();const c=y.getActiveTenantForUser();n(c?.tenantEmailDomain!=null?`/${c.tenantEmailDomain}/settings/integrations`:"/",{replace:!0})}),[]),null}export{j as default};