@zeniai/web-app-ui 5.0.91-qa → 5.0.92-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 (119) hide show
  1. package/dist/assets/AddressRoutes-CojtNX27.js +1 -0
  2. package/dist/assets/AddressScreen-CuGNy3IM.js +9 -0
  3. package/dist/assets/{AiCfoScreen-HGbtKnxx.js → AiCfoScreen-C9ttZvTj.js} +1 -1
  4. package/dist/assets/{BillPayApprovalRoutes-WO8R24uy.js → BillPayApprovalRoutes-CL6D_7dw.js} +1 -1
  5. package/dist/assets/{BillPayRoutes-OfGi1DH5.js → BillPayRoutes-fvhaclgV.js} +28 -28
  6. package/dist/assets/{BusinessVerificationPageScreen-Cwb0O2iw.js → BusinessVerificationPageScreen-Lfv0XtEV.js} +2 -2
  7. package/dist/assets/{ChargeCardRoutes-rGxvQDtl.js → ChargeCardRoutes-D1tC8X9c.js} +9 -9
  8. package/dist/assets/{CompanyPassportScreen-BLCufivU.js → CompanyPassportScreen-BwKa_LUc.js} +1 -1
  9. package/dist/assets/ConnectionAuthScreen-DcxIu2av.js +11 -0
  10. package/dist/assets/CustomerOnboardingAuthScreen-D76H2W7e.js +1 -0
  11. package/dist/assets/{CustomerOnboardingRoutes-DX7TTN0z.js → CustomerOnboardingRoutes-BjxUysyp.js} +4 -4
  12. package/dist/assets/{DashboardRoutes-DsB2iHa0.js → DashboardRoutes-DSV2c9Hg.js} +3 -3
  13. package/dist/assets/{DefaultTenantHome-s96KbqYN.js → DefaultTenantHome-BM5doKP0.js} +1 -1
  14. package/dist/assets/{DomesticWireDetailScreen-masdKbKT.js → DomesticWireDetailScreen-XA3QzAyw.js} +3 -3
  15. package/dist/assets/{DrawerScreen-D7lcO0VJ.js → DrawerScreen-2PFFQiRL.js} +1 -1
  16. package/dist/assets/EntityDetailRoutes-Cpm2zn0V.js +1 -0
  17. package/dist/assets/ExpenseAutomationRoutes-BXsX48QL.js +25 -0
  18. package/dist/assets/{FeaturePreviewScreen-D4qKJlp2.js → FeaturePreviewScreen-DBbU3hyx.js} +1 -1
  19. package/dist/assets/{HubSpotOAuthCallbackScreen-CLs0WVB9.js → HubSpotOAuthCallbackScreen-mukQpBXO.js} +1 -1
  20. package/dist/assets/{MagicLinkRoutes-CH7xneTX.js → MagicLinkRoutes-DKenhM-1.js} +8 -8
  21. package/dist/assets/MagicLinkSignInScreen-0g7D-J_c.js +12 -0
  22. package/dist/assets/{MobileAppDrawer-Ccfg2tLY.js → MobileAppDrawer-C1owD1l4.js} +1 -1
  23. package/dist/assets/NotFoundScreen-CDTENjn3.js +1 -0
  24. package/dist/assets/{NotificationRoutes-DVhgz2MT.js → NotificationRoutes-CKh3SMt4.js} +1 -1
  25. package/dist/assets/{OAuthConsentScreen-CdvqeO7v.js → OAuthConsentScreen-28eY7N8v.js} +1 -1
  26. package/dist/assets/PandLWithForecastRoutes-BRmUZUjI.js +1 -0
  27. package/dist/assets/{PeopleRoutes-DwTgxifH.js → PeopleRoutes-DhjKygIO.js} +9 -9
  28. package/dist/assets/PerformanceRoutes-CnVEsdqq.js +1 -0
  29. package/dist/assets/{Preview-CHoySpAn.js → Preview-BcfL_4SY.js} +1 -1
  30. package/dist/assets/{QBOConnectionScreen-MmUXgGtM.js → QBOConnectionScreen-WmVdfC19.js} +1 -1
  31. package/dist/assets/{ReferralListScreen-B2ACfYZr.js → ReferralListScreen-PEBFhlmP.js} +2 -2
  32. package/dist/assets/{ReimbursementApprovalRoutes-CT4lWRTd.js → ReimbursementApprovalRoutes-BkLIE_PW.js} +1 -1
  33. package/dist/assets/{ReimbursementApprovalRuleDetailScreen-CNt84ZGM.js → ReimbursementApprovalRuleDetailScreen-dkA2aqfF.js} +1 -1
  34. package/dist/assets/{ReimbursementRoutes-BHzTaVBa.js → ReimbursementRoutes-BiXGzoNt.js} +4 -4
  35. package/dist/assets/{ReportsRoutes-BDSCsmt2.js → ReportsRoutes-C6YTBKT9.js} +1 -1
  36. package/dist/assets/RewardsRoutes-CvorIu5L.js +1 -0
  37. package/dist/assets/ScreenRoutes-Dk4hXC7S.js +2 -0
  38. package/dist/assets/{SettingsRoutes-B5I2T9gT.js → SettingsRoutes-D8oriWAW.js} +3 -3
  39. package/dist/assets/{SetupPagesScreen-CWz4vIj-.js → SetupPagesScreen-BHZjOSHJ.js} +5 -5
  40. package/dist/assets/SignInScreen-Y6BuxpSu.js +1 -0
  41. package/dist/assets/SignOutScreen-CdkUNxjq.js +9 -0
  42. package/dist/assets/{TaskListScreen-DgDHZCji.js → TaskListScreen-DuuYXRRr.js} +2 -2
  43. package/dist/assets/{TaskRoutes-1dpFKupm.js → TaskRoutes-BMtkIWCF.js} +1 -1
  44. package/dist/assets/{TransactionDetailRoutes-BRCYDEe1.js → TransactionDetailRoutes-C3Fb8KbQ.js} +1 -1
  45. package/dist/assets/{TransactionDetailScreen-Dz99_JkB.js → TransactionDetailScreen-CUNFX6ex.js} +2 -2
  46. package/dist/assets/TransactionListRoutes-C4xg5Sow.js +1 -0
  47. package/dist/assets/{TreasuryRoutes-DjyI2oxa.js → TreasuryRoutes-DJhXjsa5.js} +5 -5
  48. package/dist/assets/{VendorsRoutes-Df4R1sQP.js → VendorsRoutes-WEkjdTRS.js} +19 -19
  49. package/dist/assets/WiseConfirmationScreen-B3-p2tMs.js +12 -0
  50. package/dist/assets/{ZeniAccountRoutes-C8pdGbMJ.js → ZeniAccountRoutes-C9ludMke.js} +11 -11
  51. package/dist/assets/{ZeniAccountStatementScreen-DmJw_u4G.js → ZeniAccountStatementScreen-BOPEKBSK.js} +1 -1
  52. package/dist/assets/{accountMappingHelper-DZZWkdNS.js → accountMappingHelper-DWvcSK1C.js} +1 -1
  53. package/dist/assets/{analytics-BpTmj6-G.js → analytics-DYzLSwIZ.js} +1 -1
  54. package/dist/assets/{analyticsHelper-CWJll2iT.js → analyticsHelper-Dc1kU1of.js} +1 -1
  55. package/dist/assets/{core-lbYY5woS.js → core-BeBBWfga.js} +1 -1
  56. package/dist/assets/{decodeURIComponentSafe-Bt7TpCfB.js → decodeURIComponentSafe-OtMMCMcE.js} +1 -1
  57. package/dist/assets/{dnd-BBkXCQMv.js → dnd-UF85x-t5.js} +1 -1
  58. package/dist/assets/{empty-BXlVh-7L.js → empty-BWGTDoK6.js} +1 -1
  59. package/dist/assets/{empty-DuvQh38L.js → empty-BaCT02t1.js} +1 -1
  60. package/dist/assets/{emptyVideoElement-DsiEcnQV.js → emptyVideoElement-BnRvKEhd.js} +1 -1
  61. package/dist/assets/epic-n0VtNHE8.js +2 -0
  62. package/dist/assets/getLocaleForTenant-CXwRfDGi.js +1 -0
  63. package/dist/assets/{index-D5mVmx24.js → index-BHdC4ErN.js} +1 -1
  64. package/dist/assets/{index-CmU3R7ot.js → index-BXVcb2Xp.js} +2 -2
  65. package/dist/assets/{index-YSIKqInC.js → index-CjNRshif.js} +1 -1
  66. package/dist/assets/{index-BnCtlDzJ.js → index-CvWmMArW.js} +1 -1
  67. package/dist/assets/{index-DBlyACY-.js → index-DS8xe4Yw.js} +1 -1
  68. package/dist/assets/{index-CR1sBuly.js → index-DWCyzMUX.js} +12214 -12214
  69. package/dist/assets/{index-9bPjdOkz.js → index-_ohVjyws.js} +1 -1
  70. package/dist/assets/{index-wZ-HUxAq.js → index-u46W4WpS.js} +1 -1
  71. package/dist/assets/{lexical-BoKYrzBU.js → lexical-C_ylRY16.js} +1 -1
  72. package/dist/assets/{liveblocks-BEuWW_o5.js → liveblocks-BNlilBXq.js} +1 -1
  73. package/dist/assets/{lottie-DW3oQVJC.js → lottie-DbxhFPB1.js} +1 -1
  74. package/dist/assets/{mui-hUAh7HgW.js → mui-CnlqDSRv.js} +1 -1
  75. package/dist/assets/{pathToGoBack-BTgB24PY.js → pathToGoBack-CHG8tIif.js} +1 -1
  76. package/dist/assets/{pdf-D4eIZozg.js → pdf-Dp2xnkno.js} +4 -4
  77. package/dist/assets/{pdf-lib-CQ6bcQhi.js → pdf-lib-BEgmFXIU.js} +1 -1
  78. package/dist/assets/{plaid-DtmQg7la.js → plaid-CBNEU__p.js} +1 -1
  79. package/dist/assets/{pusher-BH0WSonH.js → pusher-C2HLHaTd.js} +1 -1
  80. package/dist/assets/{react-FJ8t_fEG.js → react-7oI-YZOA.js} +1 -1
  81. package/dist/assets/{react-uiz0Bf7s.js → react-CVgRRIOa.js} +1 -1
  82. package/dist/assets/{react-I3T6BtSv.js → react-PfdOvJhF.js} +1 -1
  83. package/dist/assets/{react-u3t1vzKM.js → react-QblHkUSH.js} +1 -1
  84. package/dist/assets/{react-DPfcpAvs.js → react-V6AXUc49.js} +1 -1
  85. package/dist/assets/{react-DHaugbA3.js → react-vkffk7Xs.js} +1 -1
  86. package/dist/assets/{recharts-aApoEySM.js → recharts-C5E4pGR4.js} +1 -1
  87. package/dist/assets/{routePaths-BoWQ8YXQ.js → routePaths-aWjSXoc2.js} +1 -1
  88. package/dist/assets/{sentry-DsHW_1mX.js → sentry-CH2pQ4tM.js} +1 -1
  89. package/dist/assets/{url-CPbSl3Sf.js → url-BcTKj4a2.js} +1 -1
  90. package/dist/assets/{url-rO4wjCNo.js → url-CBu622rf.js} +1 -1
  91. package/dist/assets/{useAiCfoDashboardSuggestedQuestionsChips-Xp4UZg6R.js → useAiCfoDashboardSuggestedQuestionsChips-D5XSlLnm.js} +1 -1
  92. package/dist/assets/useAskAiCfoHostNavButtonProps-DbBvDdaC.js +1 -0
  93. package/dist/assets/{useDeviceId-CUIt81hA.js → useDeviceId-W860NCQ9.js} +1 -1
  94. package/dist/assets/{useInitialThreadRequest-oMQ4nobf.js → useInitialThreadRequest-DS5F5QV2.js} +1 -1
  95. package/dist/assets/{utils-AZPawxk4.js → utils-C2zbYn9G.js} +1 -1
  96. package/dist/assets/{withTransactionSidePanel-C6lz4d-6.js → withTransactionSidePanel-Bsk-acAb.js} +2 -2
  97. package/dist/assets/zeni-epic-state-5fEaVO5b.js +13 -0
  98. package/dist/index.html +1 -1
  99. package/package.json +4 -3
  100. package/dist/assets/AddressRoutes-D5m9Txpa.js +0 -1
  101. package/dist/assets/AddressScreen-9ZQKW4Vc.js +0 -9
  102. package/dist/assets/ConnectionAuthScreen-DPjlQt6j.js +0 -11
  103. package/dist/assets/CustomerOnboardingAuthScreen-BLnBp8eI.js +0 -1
  104. package/dist/assets/EntityDetailRoutes-DWIHI0bf.js +0 -1
  105. package/dist/assets/ExpenseAutomationRoutes-Df1ZmsUn.js +0 -25
  106. package/dist/assets/MagicLinkSignInScreen-Ij-bum6F.js +0 -12
  107. package/dist/assets/NotFoundScreen-DdK7GyZ6.js +0 -1
  108. package/dist/assets/PandLWithForecastRoutes-CSnkyLzm.js +0 -1
  109. package/dist/assets/PerformanceRoutes-BLUJTpzt.js +0 -1
  110. package/dist/assets/RewardsRoutes-YDsLsdCp.js +0 -1
  111. package/dist/assets/ScreenRoutes-r_yq8fzi.js +0 -2
  112. package/dist/assets/SignInScreen-Dp0TAL4V.js +0 -1
  113. package/dist/assets/SignOutScreen-DeydCvA_.js +0 -9
  114. package/dist/assets/TransactionListRoutes-C05fsgRv.js +0 -1
  115. package/dist/assets/WiseConfirmationScreen-W0w1BuqD.js +0 -12
  116. package/dist/assets/epic-CqNfoxZY.js +0 -2
  117. package/dist/assets/getLocaleForTenant-D8IeK8ro.js +0 -1
  118. package/dist/assets/useAskAiCfoHostNavButtonProps-D2I_ptqP.js +0 -1
  119. package/dist/assets/zeni-epic-state-DsxPZxrE.js +0 -13
@@ -1,4 +1,4 @@
1
- import{j as u}from"./liveblocks-BEuWW_o5.js";import{l as J,u as X,h as Y,i as W,g as E,N as j,n as H,s as Xe}from"./core-lbYY5woS.js";import{bF as Ye,cl as Ie,Nf as ye,eQ as F,cx as en,xW as Z,xL as nn,Nr as tn,Nu as an,qa as ee,p_ as ne,kb as te,sg as z,Nw as Ae,fE as $e,fD as We,fC as He,Nx as sn,y3 as on,BW as ke,BN as _e,BK as ve,BB as q,BQ as Pe,BT as Ee,BZ as we,sK as De,fT as cn,cs as rn,eY as un,eW as dn,eX as ln,bs as pn,Ny as mn,AD as le,Bf as yn,Nz as fn,bG as gn,Da as pe,Ce as Sn,NA as bn,NB as hn,De as Cn,Di as In,s9 as An,HH as kn,DP as Ce,EI as me,NC as _n,ND as vn,NE as Pn,NF as Ge,NG as En,K9 as wn,ME as Dn,Kl as Tn,NH as Ke,NI as xe,E1 as qe,kj as Un,q1 as Qe,si as On,bE as Ne,su as je,cv as Bn,NJ as Je,fg as xn,Dx as Fn,DB as Vn,NK as Nn,DS as Re,NL as jn,NM as Rn,NN as zn,NO as Ln,fM as Mn,ze as Zn,NP as $n,zj as Wn,zi as Hn}from"./zeni-epic-state-DsxPZxrE.js";import{I as ae,C as ie,j as de,m as Te,aN as Q,z as D,R as se,c as w,B as Ue,e as $,bv as Gn,at as oe,bw as V,bx as Kn,by as qn,af as Ve,bz as Qn,n as ze,au as Le,K as Jn,w as Xn,bA as Yn,bB as et,bC as nt,a6 as tt}from"./index-CR1sBuly.js";import{a as C}from"./sentry-DsHW_1mX.js";import{n as Fe,D as at,S as it}from"./mui-hUAh7HgW.js";import{M as fe}from"./MobileAppDrawer-Ccfg2tLY.js";import R from"./NotFoundScreen-DdK7GyZ6.js";import{a as Me}from"./analyticsHelper-CWJll2iT.js";import{d as Ze}from"./routePaths-BoWQ8YXQ.js";import{B as Be}from"./BusinessVerificationPageScreen-Cwb0O2iw.js";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},o=new e.Error().stack;o&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[o]="d687bd5e-55ed-4e5b-bf59-0bc507d5712d",e._sentryDebugIdIdentifier="sentry-dbid-d687bd5e-55ed-4e5b-bf59-0bc507d5712d")}catch{}})();const st=Fe.div`
1
+ import{j as u}from"./liveblocks-BNlilBXq.js";import{l as J,u as X,h as Y,i as W,g as E,N as j,n as H,s as Xe}from"./core-BeBBWfga.js";import{bF as Ye,cl as Ie,Nf as ye,eQ as F,cx as en,xW as Z,xL as nn,Nr as tn,Nu as an,qc as ee,q0 as ne,kb as te,si as R,Nw as Ae,fE as $e,fD as We,fC as He,Nx as sn,y3 as on,BW as ke,BN as _e,BK as ve,BB as K,BQ as Pe,BT as Ee,BZ as we,sM as De,fT as cn,cs as rn,eY as un,eW as dn,eX as ln,bs as pn,Ny as mn,AD as le,Bf as yn,Nz as fn,bG as gn,Da as pe,Ce as Sn,NA as bn,NB as hn,De as Cn,Di as In,sb as An,HH as kn,DP as Ce,EI as me,NC as _n,ND as vn,NE as Pn,NF as Ge,NG as En,K9 as wn,ME as Dn,Kl as Tn,NH as qe,NI as xe,E1 as Ke,kj as Un,q3 as Qe,sk as On,bE as Ne,sw as je,cv as Bn,NJ as Je,fg as xn,Dx as Fn,DB as Vn,NK as Nn,DS as ze,NL as jn,NM as zn,NN as Rn,NO as Ln,fM as Mn,ze as Zn,NP as $n,zj as Wn,zi as Hn}from"./zeni-epic-state-5fEaVO5b.js";import{d as ae,a as ie,I as de,m as Te,aN as Q,z as D,v as se,f as w,B as Ue,h as $,bv as Gn,at as oe,bw as V,bx as qn,by as Kn,af as Ve,bz as Qn,q as Re,au as Le,K as Jn,w as Xn,bA as Yn,bB as et,bC as nt,a6 as tt}from"./index-DWCyzMUX.js";import{a as C}from"./sentry-CH2pQ4tM.js";import{n as Fe,D as at,S as it}from"./mui-CnlqDSRv.js";import{M as fe}from"./MobileAppDrawer-C1owD1l4.js";import z from"./NotFoundScreen-CDTENjn3.js";import{a as Me}from"./analyticsHelper-Dc1kU1of.js";import{d as Ze}from"./routePaths-aWjSXoc2.js";import{B as Be}from"./BusinessVerificationPageScreen-Lfv0XtEV.js";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},o=new e.Error().stack;o&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[o]="89b78f8d-b848-4c83-bc8c-04d531081014",e._sentryDebugIdIdentifier="sentry-dbid-89b78f8d-b848-4c83-bc8c-04d531081014")}catch{}})();const st=Fe.div`
2
2
  display: flex;
3
3
  height: 100%;
4
4
  width: 100%;
@@ -6,7 +6,7 @@ import{j as u}from"./liveblocks-BEuWW_o5.js";import{l as J,u as X,h as Y,i as W,
6
6
  flex-direction: column;
7
7
  align-items: center;
8
8
  background-color: ${e=>e.theme.colors.grey4};
9
- `,ot=H(function(e,o){const{isUserBillPayAdmin:t,companyId:a}=o,c=F(e),n=tn(e),i=D.getSignedInUser(),l=c.tenantId,s={userId:i?.userId??"",sessionId:i?.zeniSessionId??"",tenantId:l??""},r=an(e,a),p=t&&r.updateStatus.fetchState!=="In-Progress"&&r.plaidConnectionDetails.link_account.updateStatus.fetchState!=="In-Progress"&&r.plaidConnectionDetails.update_account.updateStatus.fetchState!=="In-Progress"&&r.accountUpdateStatus?.fetchState!=="In-Progress"?void 0:"readonly",y=!!c.companyZeniAccountInfo?.info?.isZeniAccountEnabled;return{billPaySetupView:r,connectedAccountProvider:c.company?.featuresActivationInfo.connectedAccountProvider??"",isAccountsEnabled:y,showIntlWiseWidget:o.showIntlWiseWidget,isDisabled:p,billpayApprovalView:n,meetingUrl:"https://meetings.hubspot.com/snehals/demo-bill-pay?embed=true",analytics:w,filesEndPoint:`${oe.fileMicroServiceBaseUrl}`,authParams:s}},function(e,o){const{navigate:t,companyId:a,currentTenant:c}=o;return{onBusinessVerificationSectionClick:()=>{t("../verification"),c?.company?.companyBillPayInfo!=null&&c?.company?.companyBillPayInfo?.businessVerificationStatus?.code==="pending_review"&&e(Z(a,!1,!0))},onSetupApprovalRulesSectionClick:()=>{t("../approval-rules")},onFetchLinkTokenClick:(n,i)=>{e(De("bill_pay_setup",n,i))},onEstablishConnectionClick:n=>{e(we(n,a,"bill_pay_setup","bill_pay"))},onUpdatePaymentAccountStatus:(n,i,l)=>{e(Ee(n,i,"bill_pay","bill_pay_setup",l))},onUpdatePaymentAccountLoginStatus:(n,i)=>{e(Pe(!1,n,"bill_pay","bill_pay_setup",i))},onEstablishConnectionSuccess:()=>{e(Z(a,!0))},onEnableBillPayClick:()=>{e(q(a,"bill_pay"))},onUpdateAccountClick:(n,i,l)=>{e(l==="paymentAccount"?_e(n,i,"bill_pay","bill_pay_setup"):ve("reimbursement_setup",n,i))},onUpdatePrimaryFundingAccount:(n,i)=>{e(ke(a,"bill_pay_setup",n,i))},onEnableBillPaySuccess:()=>{t("../",{relative:"path"})},onBackClick:()=>{c?.companyBillPayInfo?.info?.isBillPayEnabled!=null&&c.companyBillPayInfo.info.isBillPayEnabled===!1?t("../.."):t("../",{relative:"path"})},onAcceptUpdatedTOS:()=>{e(on(a))},onAcceptUpdatedTOSSuccess:()=>{e(Z(a,!0))},onGetOtp:(n,i)=>{e(He(n,"SpendManagementSetup")),i!=null&&e(sn({officerType:i,phone:n}))},onResendOtp:n=>{e(We(n,"SpendManagementSetup"))},onVerifyOtp:(n,i)=>{e($e(n,i,"SpendManagementSetup"))},onVerifyOtpSuccess:(n,i)=>{n!=null&&i!=null&&e(z(a,n,"bill_pay",!0,!0))},onNavigateToDashboard:()=>{t("../../dashboard")},onNavigateToSettings:()=>{t("../bills/setup")},onInternationPaymentSetUpClick:()=>{t("../international-wire")},onCompanyOfficerUpdated:(n,i)=>{e(Ae({officerType:n,fileIds:i}))},onSendForVerificationClick:n=>{e(z(a,n,"bill_pay",!0,!0,!0))},updateFilesEntity:n=>{e(te({files:n}))},onDeleteFile:n=>{e(ne(n))},onEditFileName:(n,i)=>{e(ee(n,i.split(".")[0]))},onSignUpClick:()=>{o.hasZeniAccountsAdminAccess?window.open("../checking/promo","_blank"):window.open("https://www.zeni.ai/product/business-checking-accounts","_blank")}}})(Gn),ct=()=>{const e=J(),o=X(),t=Y(),{tenantEmailDomain:a}=W(),c=ae(),n=Ye(c?.loggedInUserRoleMap),i=Ie(c?.loggedInUserRoleMap),{useFeatureGate:l,useDynamicConfig:s}=ie(),{isFeatureEnabled:r}=l(de.billPaySetupShowInternationalPaymentByWise),{isFeatureEnabled:p}=l(de.isBillPayLocalCurrencyFeatureEnabled),y=Te(),{configValue:I}=s(Q.zeniAccountsConfig),d=ye(I),[m,S]=C.useState(!1),v=C.useRef(!1),[g,f]=C.useState(!1),P=E(B=>B.billPaySetupViewState.fetchState),A=E(B=>F(B)),_=E(B=>B.billPaySetupApproverViewState.fetchState),b=A.companyId??D.getSignedInUserTenant(a)?.companyId;if(D.getSignedInUser()==null)throw Error("Can't access bill pay setup page without signing in...");const k=!!A.companyBillPayInfo?.info?.isBillPayTOSAccepted,h=en(c?.loggedInUserRoleMap);C.useEffect(()=>{v.current||P!=="Not-Started"||b==null?v.current||P!=="Completed"||b==null||A.companyBillPayInfo?.info?.businessVerificationStatus?.code!=="pending_review"||(v.current=!0,t(Z(b,!1,!0))):(v.current=!0,t(Z(b,!0)))},[P,b,t]),C.useEffect(()=>{g||_!=="Not-Started"||(f(!0),t(nn(!0)))},[g,_,t]);const T=B=>{S(B)};if(k===!1||h&&!c?.loggedInUserRoleMap?.bill_pay_admin)return u.jsx(j,{to:"../promo"});if(k===!0&&c?.loggedInUserRoleMap!=null){const B=U=>U.trackPageLoaded($.Event.billPaySetup);return u.jsxs(st,{children:[u.jsx(se,{analytics:w,onLoad:U=>B(U)}),u.jsx(fe,{isAppContentDrawerOpen:m,handleDrawerToggle:T}),u.jsx(ot,{navigate:e,location:o,companyId:b,currentTenant:A,isUserBillPayAdmin:n,showIntlWiseWidget:r,onClickMenuIcon:()=>{T(!0)},hasZeniAccountsAdminAccess:i,accountsPromoConfig:d,isLocalCurrencyEnabled:p})]})}return u.jsx(Ue,{fetchState:"In-Progress",style:{backgroundColor:y.colors.grey5}})},Rt=(e,o)=>e!=null&&function(t){return t==="debit"||t==="credit"||t==="debit_and_credit"}(e)?e:o,zt=e=>`/${e}/cards`,Lt=e=>`/${e}/cards/setup`,Mt=e=>`/${e}/cards/onboard`,Zt=(e,o,t,a,c=!1)=>{let n=`/${e}/cards/${encodeURIComponent(o)}`;return a==null||a.status.code!=="inactive"||a.cardHolderUserId!==t.userId||a.type.code!=="business_physical_credit_card"&&a.type.code!=="business_physical_debit_card"?a!=null&&a.status.code==="active"&&a.cardHolderUserId===t.userId&&a.type.code==="business_physical_credit_card"&&c===!0?n+="/addToWallet":a==null||a.type.code!=="business_physical_debit_card"&&a.type.code!=="business_virtual_debit_card"||a.status.code!=="active"||a.cardHolderUserId!==t.userId||a.isPinSet!==!1||(n+="/setPin"):n+="/activate",n},$t=(e,o)=>e.find(t=>t.id===o),Wt=(e,o,t)=>!e||!o||t.fetchState==="Completed",rt=(e,o,t,a)=>({isCreditCardOffered:e,isDebitCardOffered:o,isDebitCardEnabled:t,isCreditCardEnabled:a}),Ht=(e,o)=>e?{creditCardCashbackOffer:`${o.cashbackAnalytics.creditCardCashbackOffer}%`,debitCardCashbackOffer:`${o.cashbackAnalytics.debitCardCashbackOffer}%`,totalEarnedCashback:V(o.cashbackSummary.cashbackEarned.amount),redeemedCashback:V(o.cashbackSummary.cashbackRedeemed.amount),availableCashback:V(o.cashbackSummary.cashbackAvailable.amount),creditCardCashbackRedemptionMode:o.cashbackAnalytics.creditCardCashbackRedemptionMode,debitCardCashbackRedemptionMode:o.cashbackAnalytics.debitCardCashbackRedemptionMode}:void 0,Gt=(e,o,t,a,c)=>e&&o&&t?{creditAccountId:a.id,creditAccountLimit:V(a.limit.amount),creditAccountAvailableAmount:V(a.available.amount),creditAccountSpentAmount:V(a.balance.amount+a.hold.amount),creditAccountStatus:a.status,outstandingBalance:V(c.remainingAmountDue.amount)}:void 0,Kt=(e,o,t,a,c)=>e&&o&&t?{debitAccountId:a.depositAccounts.map(n=>n.id),debitAccountName:a.depositAccounts.map(n=>n.accountName),debitAccountBalance:a.depositAccounts.map(n=>V(n.accountBalance.available.amount)),debitCardsSpend:V(c?.currentMonthSpends.amount??0),debitAccountStatus:a.depositAccounts.map(n=>n.accountStatus)}:void 0,qt=(e,o)=>e&&o.depositAccountLimit!=null&&o.chargeCard!=null?{debitAccountId:o.depositAccountLimit.id,debitAccountName:o.depositAccountLimit?.accountName??o.connectedAccount?.accountName,debitAccountBalance:V(o.depositAccountLimit?.accountBalance.available.amount),debitCardsSpend:V(o.chargeCard.limit.amount-o.chargeCard.available.amount),debitAccountStatus:o.depositAccountLimit?.accountStatus??o.connectedAccount?.accountStatus}:void 0,Qt=80,Jt=80,ut=({isBankingOnlyTenant:e,isDebitCardFeatureEnabled:o})=>o||e,dt=({isCardsOnlyTenant:e,isChargeCardFeatureEnabled:o,isBookKeepingTenant:t,isDebitCardProductVisible:a,chargeCardsCreditAccountLimit:c})=>(e||o||t)&&(!a||c>0),Xt=({isCardsOnlyTenant:e,isChargeCardFeatureEnabled:o,isBookKeepingTenant:t})=>e||o||t,Yt=({cardInfo:e,isProductVisible:o,isTOSAccepted:t,isSetupEnabled:a,isUserHasCardsAdminLevelAccess:c,isUserHasCardsAccess:n})=>!!e&&o&&(!t&&c||n&&!c&&!a),lt=H(function(e,o){const{isUserChargeCardAdmin:t,chargeCardSetUpView:a,isDebitCardOnlyEnabled:c,isCreditCardOnlyEnabled:n}=o,i=F(e),l=D.getSignedInUser(),s=i.tenantId,r={userId:l?.userId??"",sessionId:l?.zeniSessionId??"",tenantId:s??""},p=t&&a.updateStatus.fetchState!=="In-Progress"&&a.plaidConnectionDetails.link_account.updateStatus.fetchState!=="In-Progress"&&a.plaidConnectionDetails.update_account.updateStatus.fetchState!=="In-Progress"&&a.accountUpdateStatus?.fetchState!=="In-Progress"?void 0:"readonly",y=!!i.companyZeniAccountInfo?.info?.isZeniAccountEnabled;return{chargeCardSetUpView:a,connectedAccountProvider:i.company?.featuresActivationInfo.connectedAccountProvider??"",isAccountsEnabled:y,isDisabled:p,meetingUrl:"https://meetings.hubspot.com/niharn/demo-accounts?embed=true",analytics:w,isDebitCardOnlyEnabled:c,isCreditCardOnlyEnabled:n,filesEndPoint:`${oe.fileMicroServiceBaseUrl}`,authParams:r}},function(e,o){const{navigate:t,companyId:a,currentTenant:c,chargeCardSetUpView:n,isDebitCardTOSAccepted:i,isChargeCardTOSAccepted:l,isChargeCardSetupEnabled:s,isDebitCardSetupEnabled:r,productInformation:p,controllerEmails:y,businessVerificationStatus:I}=o;return{onBusinessVerificationSectionClick:()=>{w.trackCardsVerifyIdentityCompanyDetailsClick(y,p,I?.code),t("../verification"),c?.company?.companyChargeCardInfo!=null&&c.company.companyBillPayInfo?.businessVerificationStatus?.code==="pending_review"&&e(le(a,!1,!0))},onFetchLinkTokenClick:(d,m)=>{e(De("charge_card_setup",d,m))},onEstablishConnectionClick:d=>{e(we(d,a,"charge_card_setup","charge_cards"))},onUpdatePaymentAccountStatus:(d,m,S)=>{e(Ee(d,m,"charge_cards","charge_card_setup",S))},onUpdatePaymentAccountLoginStatus:(d,m)=>{e(Pe(!1,d,"charge_cards","charge_card_setup",m))},onEstablishConnectionSuccess:()=>{e(le(a,!0))},onEnableChargeCardClick:()=>{w.trackCardsEnableCardsClick(y,p,"Cards Card Setup"),l===!0&&i===!0&&s===!1&&r===!1?e(q(a,"charge_cards__debit_cards")):l===!0&&s===!1?e(q(a,"charge_cards")):i===!0&&r===!1&&e(q(a,"debit_cards"))},onUpdateChargeCardClick:(d,m,S)=>{const v=n.allBankAccounts.find(f=>f.accountId===n.primaryFundingAccount?.zeniAccountId),g=n.allBankAccounts.find(f=>f.accountId===d);w.trackCardsZeniCashAccountChangeClick(y,p,{oldZeniCashAccount:v?.accountName??"",newZeniCashAccount:g?.accountName??"",oldZeniCashAccountPosition:n.allBankAccounts.findIndex(f=>f.accountId===n.primaryFundingAccount?.zeniAccountId)+1,newZeniCashAccountPosition:n.allBankAccounts.findIndex(f=>f.accountId===d)+1,numberOfCashAccounts:n.allBankAccounts.length}),e(S==="paymentAccount"?_e(d,m,"charge_cards","charge_card_setup"):ve("charge_card_setup",d,m))},onUpdatePrimaryFundingAccount:(d,m)=>{const S=n.allFundingAccounts.find(f=>f.id===d),v=n.allFundingAccounts.findIndex(f=>f.id===n.primaryFundingAccount?.id)+1,g=n.allFundingAccounts.findIndex(f=>f.id===d)+1;w.trackCardsPaymentAccountChangeClick(y,p,{oldPaymentAccountName:n.primaryFundingAccount?.label??"",oldPaymentAccountBalance:V(n.primaryFundingAccount?.accountBalance?.available?.amount??0),newPaymentAccountName:S?.label??"",newPaymentAccountBalance:V(S?.accountBalance?.available?.amount??0),isOldPaymentAccountRecommended:n.primaryFundingAccount?.accType==="depositAccount",isNewPaymentAccountRecommended:S?.accType==="depositAccount",oldPaymentAccountPosition:v,newPaymentAccountPosition:g,numberOfPaymentAccounts:n.allFundingAccounts.length}),e(ke(a,"charge_card_setup",d,m))},onEnableChargeCardSuccess:()=>{e(fn()),t("../",{relative:"path"})},onBackClick:()=>{c?.companyChargeCardInfo?.info?.isChargeCardEnabled||c?.companyDebitCardInfo?.info?.isDebitCardEnabled?t("../",{relative:"path"}):t("../..",{relative:"path"})},onNavigateToDashboard:()=>{t("../../dashboard")},onCompanyOfficerUpdated:(d,m)=>{e(Ae({officerType:d,fileIds:m}))},onSendForVerificationClick:d=>{l===!0&&i===!0?e(z(a,d,"charge_cards__debit_cards",!0,!0,!0)):l===!0?e(z(a,d,"charge_cards",!0,!0,!0)):i===!0&&e(z(a,d,"debit_cards",!0,!0,!0))},updateFilesEntity:d=>{e(te({files:d}))},onDeleteFile:d=>{e(ne(d))},onEditFileName:(d,m)=>{e(ee(d,m.split(".")[0]))},onSignUpClick:()=>{o.hasZeniAccountsAdminAccess?window.open("../checking/promo","_blank"):window.open("https://www.zeni.ai/product/business-checking-accounts","_blank")},onUpdateAutoPayClick:d=>{e(yn(a,d))}}})(Kn),pt=()=>{const e=J(),o=X(),t=Y(),{tenantEmailDomain:a}=W(),c=ae(),n=E(L=>F(L)),{useDynamicConfig:i,useFeatureGate:l}=ie(),s=o.state?.pathnameStackToGoBack?.[0],{configValue:r}=i(Q.zeniAccountsConfig),{configValue:p}=i(Q.zeniCardsConfig),y=p.credit_card_auto_pay_threshold_by_company_id?.[n.companyId]??p.default_credit_card_auto_pay_threshold??80,{isFeatureEnabled:I}=l(de.isDebitCardFeatureEnabled),{isFeatureEnabled:d}=l(de.isChargeCardFeatureEnabled),{isFeatureEnabled:m}=l(de.isEarlyPayFeatureEnabled),S=E(L=>cn(L,n.companyId)),v=rn(S.controllers),g=!!n.company?.companyChargeCardInfo.isChargeCardEnabled,f=!!n.company?.companyDebitCardInfo.isDebitCardEnabled,P=un(I,n),A=ut({isDebitCardFeatureEnabled:I,isBankingOnlyTenant:P}),_=dn(n),b=ln(n),k=n.companyChargeCardInfo?.info?.chargeCardsCreditAccountLimit??0,h=dt({isCardsOnlyTenant:_,isChargeCardFeatureEnabled:d,isBookKeepingTenant:b,isDebitCardProductVisible:A,chargeCardsCreditAccountLimit:k}),T=A&&h===!1,B=A===!1&&h,U=ye(r),x=pn(c?.loggedInUserRoleMap),ce=Ie(c?.loggedInUserRoleMap),[G,ge]=C.useState(!1),[K,re]=C.useState(!1),M=E(L=>L.chargeCardSetupViewState.fetchState),N=D.getSignedInUserTenant(a)?.companyId??n.companyId,O=D.getSignedInUser(),Oe=L=>{ge(L)},Se=E(L=>mn(L,N));if(O==null)throw Error("Can't access charge card setup page without signing in...");C.useEffect(()=>{K||M!=="Not-Started"||N==null?K||M!=="Completed"||N==null||n.companyBillPayInfo?.info?.businessVerificationStatus?.code!=="pending_review"||t(le(N,!1,!0)):(re(!0),t(le(N,!0)))},[K,M,N,t]);const be=!!n.company?.companyChargeCardInfo.isChargeCardTOSAccepted,he=!!n.company?.companyDebitCardInfo.isDebitCardTOSAccepted,ue=rt(h,A,f,g);return be||he?be||he?u.jsxs(u.Fragment,{children:[u.jsx(se,{analytics:w,onLoad:()=>{w.trackPageLoaded($.Event.cardsSetupVisited),w.trackCardsCardSetupView(v,ue,s==null?"Cards Setup":s.includes("cards/promo")?"Promo":s.includes("cards")?"Settings":"Cards Tab")}}),u.jsx(fe,{isAppContentDrawerOpen:G,handleDrawerToggle:Oe}),u.jsx(lt,{autoPayThreshold:y,navigate:e,location:o,companyId:N,currentTenant:n,isEarlyPayEnabled:m,isChargeCardTOSAccepted:be,isDebitCardTOSAccepted:he,isUserChargeCardAdmin:x,isDebitCardOnlyEnabled:T,isCreditCardOnlyEnabled:B,chargeCardSetUpView:Se,isCreditCardProductVisible:h,isDebitCardFeatureEnabled:A,isChargeCardSetupEnabled:g,isDebitCardSetupEnabled:f,businessVerificationStatus:n.companyBillPayInfo?.info?.businessVerificationStatus,controllerEmails:v,productInformation:ue,onClickMenuIcon:()=>{Oe(!0)},hasZeniAccountsAdminAccess:ce,accountsPromoConfig:U})]}):u.jsx(Ue,{fetchState:"Not-Started"}):u.jsx(j,{to:"../promo"})},mt=Fe.div`
9
+ `,ot=H(function(e,o){const{isUserBillPayAdmin:t,companyId:a}=o,c=F(e),n=tn(e),i=D.getSignedInUser(),l=c.tenantId,s={userId:i?.userId??"",sessionId:i?.zeniSessionId??"",tenantId:l??""},r=an(e,a),p=t&&r.updateStatus.fetchState!=="In-Progress"&&r.plaidConnectionDetails.link_account.updateStatus.fetchState!=="In-Progress"&&r.plaidConnectionDetails.update_account.updateStatus.fetchState!=="In-Progress"&&r.accountUpdateStatus?.fetchState!=="In-Progress"?void 0:"readonly",y=!!c.companyZeniAccountInfo?.info?.isZeniAccountEnabled;return{billPaySetupView:r,connectedAccountProvider:c.company?.featuresActivationInfo.connectedAccountProvider??"",isAccountsEnabled:y,showIntlWiseWidget:o.showIntlWiseWidget,isDisabled:p,billpayApprovalView:n,meetingUrl:"https://meetings.hubspot.com/snehals/demo-bill-pay?embed=true",analytics:w,filesEndPoint:`${oe.fileMicroServiceBaseUrl}`,authParams:s}},function(e,o){const{navigate:t,companyId:a,currentTenant:c}=o;return{onBusinessVerificationSectionClick:()=>{t("../verification"),c?.company?.companyBillPayInfo!=null&&c?.company?.companyBillPayInfo?.businessVerificationStatus?.code==="pending_review"&&e(Z(a,!1,!0))},onSetupApprovalRulesSectionClick:()=>{t("../approval-rules")},onFetchLinkTokenClick:(n,i)=>{e(De("bill_pay_setup",n,i))},onEstablishConnectionClick:n=>{e(we(n,a,"bill_pay_setup","bill_pay"))},onUpdatePaymentAccountStatus:(n,i,l)=>{e(Ee(n,i,"bill_pay","bill_pay_setup",l))},onUpdatePaymentAccountLoginStatus:(n,i)=>{e(Pe(!1,n,"bill_pay","bill_pay_setup",i))},onEstablishConnectionSuccess:()=>{e(Z(a,!0))},onEnableBillPayClick:()=>{e(K(a,"bill_pay"))},onUpdateAccountClick:(n,i,l)=>{e(l==="paymentAccount"?_e(n,i,"bill_pay","bill_pay_setup"):ve("reimbursement_setup",n,i))},onUpdatePrimaryFundingAccount:(n,i)=>{e(ke(a,"bill_pay_setup",n,i))},onEnableBillPaySuccess:()=>{t("../",{relative:"path"})},onBackClick:()=>{c?.companyBillPayInfo?.info?.isBillPayEnabled!=null&&c.companyBillPayInfo.info.isBillPayEnabled===!1?t("../.."):t("../",{relative:"path"})},onAcceptUpdatedTOS:()=>{e(on(a))},onAcceptUpdatedTOSSuccess:()=>{e(Z(a,!0))},onGetOtp:(n,i)=>{e(He(n,"SpendManagementSetup")),i!=null&&e(sn({officerType:i,phone:n}))},onResendOtp:n=>{e(We(n,"SpendManagementSetup"))},onVerifyOtp:(n,i)=>{e($e(n,i,"SpendManagementSetup"))},onVerifyOtpSuccess:(n,i)=>{n!=null&&i!=null&&e(R(a,n,"bill_pay",!0,!0))},onNavigateToDashboard:()=>{t("../../dashboard")},onNavigateToSettings:()=>{t("../bills/setup")},onInternationPaymentSetUpClick:()=>{t("../international-wire")},onCompanyOfficerUpdated:(n,i)=>{e(Ae({officerType:n,fileIds:i}))},onSendForVerificationClick:n=>{e(R(a,n,"bill_pay",!0,!0,!0))},updateFilesEntity:n=>{e(te({files:n}))},onDeleteFile:n=>{e(ne(n))},onEditFileName:(n,i)=>{e(ee(n,i.split(".")[0]))},onSignUpClick:()=>{o.hasZeniAccountsAdminAccess?window.open("../checking/promo","_blank"):window.open("https://www.zeni.ai/product/business-checking-accounts","_blank")}}})(Gn),ct=()=>{const e=J(),o=X(),t=Y(),{tenantEmailDomain:a}=W(),c=ae(),n=Ye(c?.loggedInUserRoleMap),i=Ie(c?.loggedInUserRoleMap),{useFeatureGate:l,useDynamicConfig:s}=ie(),{isFeatureEnabled:r}=l(de.billPaySetupShowInternationalPaymentByWise),{isFeatureEnabled:p}=l(de.isBillPayLocalCurrencyFeatureEnabled),y=Te(),{configValue:I}=s(Q.zeniAccountsConfig),d=ye(I),[m,S]=C.useState(!1),v=C.useRef(!1),[g,f]=C.useState(!1),P=E(B=>B.billPaySetupViewState.fetchState),A=E(B=>F(B)),_=E(B=>B.billPaySetupApproverViewState.fetchState),b=A.companyId??D.getSignedInUserTenant(a)?.companyId;if(D.getSignedInUser()==null)throw Error("Can't access bill pay setup page without signing in...");const k=!!A.companyBillPayInfo?.info?.isBillPayTOSAccepted,h=en(c?.loggedInUserRoleMap);C.useEffect(()=>{v.current||P!=="Not-Started"||b==null?v.current||P!=="Completed"||b==null||A.companyBillPayInfo?.info?.businessVerificationStatus?.code!=="pending_review"||(v.current=!0,t(Z(b,!1,!0))):(v.current=!0,t(Z(b,!0)))},[P,b,t]),C.useEffect(()=>{g||_!=="Not-Started"||(f(!0),t(nn(!0)))},[g,_,t]);const T=B=>{S(B)};if(k===!1||h&&!c?.loggedInUserRoleMap?.bill_pay_admin)return u.jsx(j,{to:"../promo"});if(k===!0&&c?.loggedInUserRoleMap!=null){const B=U=>U.trackPageLoaded($.Event.billPaySetup);return u.jsxs(st,{children:[u.jsx(se,{analytics:w,onLoad:U=>B(U)}),u.jsx(fe,{isAppContentDrawerOpen:m,handleDrawerToggle:T}),u.jsx(ot,{navigate:e,location:o,companyId:b,currentTenant:A,isUserBillPayAdmin:n,showIntlWiseWidget:r,onClickMenuIcon:()=>{T(!0)},hasZeniAccountsAdminAccess:i,accountsPromoConfig:d,isLocalCurrencyEnabled:p})]})}return u.jsx(Ue,{fetchState:"In-Progress",style:{backgroundColor:y.colors.grey5}})},zt=(e,o)=>e!=null&&function(t){return t==="debit"||t==="credit"||t==="debit_and_credit"}(e)?e:o,Rt=e=>`/${e}/cards`,Lt=e=>`/${e}/cards/setup`,Mt=e=>`/${e}/cards/onboard`,Zt=(e,o,t,a,c=!1)=>{let n=`/${e}/cards/${encodeURIComponent(o)}`;return a==null||a.status.code!=="inactive"||a.cardHolderUserId!==t.userId||a.type.code!=="business_physical_credit_card"&&a.type.code!=="business_physical_debit_card"?a!=null&&a.status.code==="active"&&a.cardHolderUserId===t.userId&&a.type.code==="business_physical_credit_card"&&c===!0?n+="/addToWallet":a==null||a.type.code!=="business_physical_debit_card"&&a.type.code!=="business_virtual_debit_card"||a.status.code!=="active"||a.cardHolderUserId!==t.userId||a.isPinSet!==!1||(n+="/setPin"):n+="/activate",n},$t=(e,o)=>e.find(t=>t.id===o),Wt=(e,o,t)=>!e||!o||t.fetchState==="Completed",rt=(e,o,t,a)=>({isCreditCardOffered:e,isDebitCardOffered:o,isDebitCardEnabled:t,isCreditCardEnabled:a}),Ht=(e,o)=>e?{creditCardCashbackOffer:`${o.cashbackAnalytics.creditCardCashbackOffer}%`,debitCardCashbackOffer:`${o.cashbackAnalytics.debitCardCashbackOffer}%`,totalEarnedCashback:V(o.cashbackSummary.cashbackEarned.amount),redeemedCashback:V(o.cashbackSummary.cashbackRedeemed.amount),availableCashback:V(o.cashbackSummary.cashbackAvailable.amount),creditCardCashbackRedemptionMode:o.cashbackAnalytics.creditCardCashbackRedemptionMode,debitCardCashbackRedemptionMode:o.cashbackAnalytics.debitCardCashbackRedemptionMode}:void 0,Gt=(e,o,t,a,c)=>e&&o&&t?{creditAccountId:a.id,creditAccountLimit:V(a.limit.amount),creditAccountAvailableAmount:V(a.available.amount),creditAccountSpentAmount:V(a.balance.amount+a.hold.amount),creditAccountStatus:a.status,outstandingBalance:V(c.remainingAmountDue.amount)}:void 0,qt=(e,o,t,a,c)=>e&&o&&t?{debitAccountId:a.depositAccounts.map(n=>n.id),debitAccountName:a.depositAccounts.map(n=>n.accountName),debitAccountBalance:a.depositAccounts.map(n=>V(n.accountBalance.available.amount)),debitCardsSpend:V(c?.currentMonthSpends.amount??0),debitAccountStatus:a.depositAccounts.map(n=>n.accountStatus)}:void 0,Kt=(e,o)=>e&&o.depositAccountLimit!=null&&o.chargeCard!=null?{debitAccountId:o.depositAccountLimit.id,debitAccountName:o.depositAccountLimit?.accountName??o.connectedAccount?.accountName,debitAccountBalance:V(o.depositAccountLimit?.accountBalance.available.amount),debitCardsSpend:V(o.chargeCard.limit.amount-o.chargeCard.available.amount),debitAccountStatus:o.depositAccountLimit?.accountStatus??o.connectedAccount?.accountStatus}:void 0,Qt=80,Jt=80,ut=({isBankingOnlyTenant:e,isDebitCardFeatureEnabled:o})=>o||e,dt=({isCardsOnlyTenant:e,isChargeCardFeatureEnabled:o,isBookKeepingTenant:t,isDebitCardProductVisible:a,chargeCardsCreditAccountLimit:c})=>(e||o||t)&&(!a||c>0),Xt=({isCardsOnlyTenant:e,isChargeCardFeatureEnabled:o,isBookKeepingTenant:t})=>e||o||t,Yt=({cardInfo:e,isProductVisible:o,isTOSAccepted:t,isSetupEnabled:a,isUserHasCardsAdminLevelAccess:c,isUserHasCardsAccess:n})=>!!e&&o&&(!t&&c||n&&!c&&!a),lt=H(function(e,o){const{isUserChargeCardAdmin:t,chargeCardSetUpView:a,isDebitCardOnlyEnabled:c,isCreditCardOnlyEnabled:n}=o,i=F(e),l=D.getSignedInUser(),s=i.tenantId,r={userId:l?.userId??"",sessionId:l?.zeniSessionId??"",tenantId:s??""},p=t&&a.updateStatus.fetchState!=="In-Progress"&&a.plaidConnectionDetails.link_account.updateStatus.fetchState!=="In-Progress"&&a.plaidConnectionDetails.update_account.updateStatus.fetchState!=="In-Progress"&&a.accountUpdateStatus?.fetchState!=="In-Progress"?void 0:"readonly",y=!!i.companyZeniAccountInfo?.info?.isZeniAccountEnabled;return{chargeCardSetUpView:a,connectedAccountProvider:i.company?.featuresActivationInfo.connectedAccountProvider??"",isAccountsEnabled:y,isDisabled:p,meetingUrl:"https://meetings.hubspot.com/niharn/demo-accounts?embed=true",analytics:w,isDebitCardOnlyEnabled:c,isCreditCardOnlyEnabled:n,filesEndPoint:`${oe.fileMicroServiceBaseUrl}`,authParams:r}},function(e,o){const{navigate:t,companyId:a,currentTenant:c,chargeCardSetUpView:n,isDebitCardTOSAccepted:i,isChargeCardTOSAccepted:l,isChargeCardSetupEnabled:s,isDebitCardSetupEnabled:r,productInformation:p,controllerEmails:y,businessVerificationStatus:I}=o;return{onBusinessVerificationSectionClick:()=>{w.trackCardsVerifyIdentityCompanyDetailsClick(y,p,I?.code),t("../verification"),c?.company?.companyChargeCardInfo!=null&&c.company.companyBillPayInfo?.businessVerificationStatus?.code==="pending_review"&&e(le(a,!1,!0))},onFetchLinkTokenClick:(d,m)=>{e(De("charge_card_setup",d,m))},onEstablishConnectionClick:d=>{e(we(d,a,"charge_card_setup","charge_cards"))},onUpdatePaymentAccountStatus:(d,m,S)=>{e(Ee(d,m,"charge_cards","charge_card_setup",S))},onUpdatePaymentAccountLoginStatus:(d,m)=>{e(Pe(!1,d,"charge_cards","charge_card_setup",m))},onEstablishConnectionSuccess:()=>{e(le(a,!0))},onEnableChargeCardClick:()=>{w.trackCardsEnableCardsClick(y,p,"Cards Card Setup"),l===!0&&i===!0&&s===!1&&r===!1?e(K(a,"charge_cards__debit_cards")):l===!0&&s===!1?e(K(a,"charge_cards")):i===!0&&r===!1&&e(K(a,"debit_cards"))},onUpdateChargeCardClick:(d,m,S)=>{const v=n.allBankAccounts.find(f=>f.accountId===n.primaryFundingAccount?.zeniAccountId),g=n.allBankAccounts.find(f=>f.accountId===d);w.trackCardsZeniCashAccountChangeClick(y,p,{oldZeniCashAccount:v?.accountName??"",newZeniCashAccount:g?.accountName??"",oldZeniCashAccountPosition:n.allBankAccounts.findIndex(f=>f.accountId===n.primaryFundingAccount?.zeniAccountId)+1,newZeniCashAccountPosition:n.allBankAccounts.findIndex(f=>f.accountId===d)+1,numberOfCashAccounts:n.allBankAccounts.length}),e(S==="paymentAccount"?_e(d,m,"charge_cards","charge_card_setup"):ve("charge_card_setup",d,m))},onUpdatePrimaryFundingAccount:(d,m)=>{const S=n.allFundingAccounts.find(f=>f.id===d),v=n.allFundingAccounts.findIndex(f=>f.id===n.primaryFundingAccount?.id)+1,g=n.allFundingAccounts.findIndex(f=>f.id===d)+1;w.trackCardsPaymentAccountChangeClick(y,p,{oldPaymentAccountName:n.primaryFundingAccount?.label??"",oldPaymentAccountBalance:V(n.primaryFundingAccount?.accountBalance?.available?.amount??0),newPaymentAccountName:S?.label??"",newPaymentAccountBalance:V(S?.accountBalance?.available?.amount??0),isOldPaymentAccountRecommended:n.primaryFundingAccount?.accType==="depositAccount",isNewPaymentAccountRecommended:S?.accType==="depositAccount",oldPaymentAccountPosition:v,newPaymentAccountPosition:g,numberOfPaymentAccounts:n.allFundingAccounts.length}),e(ke(a,"charge_card_setup",d,m))},onEnableChargeCardSuccess:()=>{e(fn()),t("../",{relative:"path"})},onBackClick:()=>{c?.companyChargeCardInfo?.info?.isChargeCardEnabled||c?.companyDebitCardInfo?.info?.isDebitCardEnabled?t("../",{relative:"path"}):t("../..",{relative:"path"})},onNavigateToDashboard:()=>{t("../../dashboard")},onCompanyOfficerUpdated:(d,m)=>{e(Ae({officerType:d,fileIds:m}))},onSendForVerificationClick:d=>{l===!0&&i===!0?e(R(a,d,"charge_cards__debit_cards",!0,!0,!0)):l===!0?e(R(a,d,"charge_cards",!0,!0,!0)):i===!0&&e(R(a,d,"debit_cards",!0,!0,!0))},updateFilesEntity:d=>{e(te({files:d}))},onDeleteFile:d=>{e(ne(d))},onEditFileName:(d,m)=>{e(ee(d,m.split(".")[0]))},onSignUpClick:()=>{o.hasZeniAccountsAdminAccess?window.open("../checking/promo","_blank"):window.open("https://www.zeni.ai/product/business-checking-accounts","_blank")},onUpdateAutoPayClick:d=>{e(yn(a,d))}}})(qn),pt=()=>{const e=J(),o=X(),t=Y(),{tenantEmailDomain:a}=W(),c=ae(),n=E(L=>F(L)),{useDynamicConfig:i,useFeatureGate:l}=ie(),s=o.state?.pathnameStackToGoBack?.[0],{configValue:r}=i(Q.zeniAccountsConfig),{configValue:p}=i(Q.zeniCardsConfig),y=p.credit_card_auto_pay_threshold_by_company_id?.[n.companyId]??p.default_credit_card_auto_pay_threshold??80,{isFeatureEnabled:I}=l(de.isDebitCardFeatureEnabled),{isFeatureEnabled:d}=l(de.isChargeCardFeatureEnabled),{isFeatureEnabled:m}=l(de.isEarlyPayFeatureEnabled),S=E(L=>cn(L,n.companyId)),v=rn(S.controllers),g=!!n.company?.companyChargeCardInfo.isChargeCardEnabled,f=!!n.company?.companyDebitCardInfo.isDebitCardEnabled,P=un(I,n),A=ut({isDebitCardFeatureEnabled:I,isBankingOnlyTenant:P}),_=dn(n),b=ln(n),k=n.companyChargeCardInfo?.info?.chargeCardsCreditAccountLimit??0,h=dt({isCardsOnlyTenant:_,isChargeCardFeatureEnabled:d,isBookKeepingTenant:b,isDebitCardProductVisible:A,chargeCardsCreditAccountLimit:k}),T=A&&h===!1,B=A===!1&&h,U=ye(r),x=pn(c?.loggedInUserRoleMap),ce=Ie(c?.loggedInUserRoleMap),[G,ge]=C.useState(!1),[q,re]=C.useState(!1),M=E(L=>L.chargeCardSetupViewState.fetchState),N=D.getSignedInUserTenant(a)?.companyId??n.companyId,O=D.getSignedInUser(),Oe=L=>{ge(L)},Se=E(L=>mn(L,N));if(O==null)throw Error("Can't access charge card setup page without signing in...");C.useEffect(()=>{q||M!=="Not-Started"||N==null?q||M!=="Completed"||N==null||n.companyBillPayInfo?.info?.businessVerificationStatus?.code!=="pending_review"||t(le(N,!1,!0)):(re(!0),t(le(N,!0)))},[q,M,N,t]);const be=!!n.company?.companyChargeCardInfo.isChargeCardTOSAccepted,he=!!n.company?.companyDebitCardInfo.isDebitCardTOSAccepted,ue=rt(h,A,f,g);return be||he?be||he?u.jsxs(u.Fragment,{children:[u.jsx(se,{analytics:w,onLoad:()=>{w.trackPageLoaded($.Event.cardsSetupVisited),w.trackCardsCardSetupView(v,ue,s==null?"Cards Setup":s.includes("cards/promo")?"Promo":s.includes("cards")?"Settings":"Cards Tab")}}),u.jsx(fe,{isAppContentDrawerOpen:G,handleDrawerToggle:Oe}),u.jsx(lt,{autoPayThreshold:y,navigate:e,location:o,companyId:N,currentTenant:n,isEarlyPayEnabled:m,isChargeCardTOSAccepted:be,isDebitCardTOSAccepted:he,isUserChargeCardAdmin:x,isDebitCardOnlyEnabled:T,isCreditCardOnlyEnabled:B,chargeCardSetUpView:Se,isCreditCardProductVisible:h,isDebitCardFeatureEnabled:A,isChargeCardSetupEnabled:g,isDebitCardSetupEnabled:f,businessVerificationStatus:n.companyBillPayInfo?.info?.businessVerificationStatus,controllerEmails:v,productInformation:ue,onClickMenuIcon:()=>{Oe(!0)},hasZeniAccountsAdminAccess:ce,accountsPromoConfig:U})]}):u.jsx(Ue,{fetchState:"Not-Started"}):u.jsx(j,{to:"../promo"})},mt=Fe.div`
10
10
  display: flex;
11
11
  height: 100%;
12
12
  width: 100%;
@@ -14,11 +14,11 @@ import{j as u}from"./liveblocks-BEuWW_o5.js";import{l as J,u as X,h as Y,i as W,
14
14
  flex-direction: column;
15
15
  align-items: center;
16
16
  background-color: ${e=>e.theme.colors.grey4};
17
- `,yt=H(function(e,o){const{isUserRemiAdmin:t,companyId:a}=o,c=F(e),n=bn(e),i=hn(e,a),l=D.getSignedInUser(),s=c.tenantId,r={userId:l?.userId??"",sessionId:l?.zeniSessionId??"",tenantId:s??""},p=t&&i.updateStatus.fetchState!=="In-Progress"&&i.plaidConnectionDetails.link_account.updateStatus.fetchState!=="In-Progress"&&i.plaidConnectionDetails.update_account.updateStatus.fetchState!=="In-Progress"&&i.accountUpdateStatus?.fetchState!=="In-Progress"?void 0:"readonly",y=!!c.companyZeniAccountInfo?.info?.isZeniAccountEnabled;return{remiSetupView:i,isDisabled:p,remiApprovalView:n,connectedAccountProvider:c.company?.featuresActivationInfo.connectedAccountProvider??"",isAccountsEnabled:y,meetingUrl:"https://meetings.hubspot.com/niharn/demo-reimbursements?embed=true",analytics:w,filesEndPoint:`${oe.fileMicroServiceBaseUrl}`,authParams:r}},function(e,o){const{navigate:t,companyId:a,currentTenant:c}=o;return{updateMileageDetails:n=>{const{mileageAmount:i,mileageUnit:l,mileageCurrencyCode:s,mileageCurrencySymbol:r,denomination:p,denominationSymbol:y,mileageAmountInDenomination:I,description:d}=n;e(In({mileageDetails:{mileageUnitAmount:{amount:i,currencyCode:s,currencySymbol:r},denomination:p,denominationSymbol:y,mileageAmountInDenomination:I,mileageCurrencyCode:s,mileageCurrencySymbol:r,mileageUnit:l,description:d}}))},onSaveMileageClick:n=>{e(Cn(a)),w.trackReimbursementMileageRateSave(n)},onBusinessVerificationSectionClick:()=>{t("../verification"),c?.company?.companyReimbursementInfo!=null&&c?.company?.companyBillPayInfo?.businessVerificationStatus?.code==="pending_review"&&e(pe(a,!1,!0))},onSetupApprovalRulesSectionClick:()=>{t("../approval-rules")},onFetchLinkTokenClick:(n,i)=>{e(De("reimbursement_setup",n,i))},onEstablishConnectionClick:n=>{e(we(n,a,"reimbursement_setup","reimbursement"))},onUpdatePaymentAccountStatus:(n,i,l)=>{e(Ee(n,i,"reimbursement","reimbursement_setup",l))},onUpdatePaymentAccountLoginStatus:(n,i)=>{e(Pe(!1,n,"reimbursement","reimbursement_setup",i))},onEstablishConnectionSuccess:()=>{e(pe(a,!0))},onEnableRemiClick:()=>{e(q(a,"reimbursement"))},onUpdateAccountClick:(n,i,l)=>{e(l==="paymentAccount"?_e(n,i,"reimbursement","reimbursement_setup"):ve("reimbursement_setup",n,i))},onEnableRemiSuccess:()=>{t("../",{relative:"path"})},onBackClick:()=>{c?.companyReimbursementInfo?.info?.isReimbursementEnabled!=null&&c.companyReimbursementInfo.info.isReimbursementEnabled===!1?t("../.."):t("../",{relative:"path"})},onCompanyOfficerUpdated:(n,i)=>{e(Ae({officerType:n,fileIds:i}))},onSendForVerificationClick:n=>{e(z(a,n,"reimbursement",!0,!0,!0))},updateFilesEntity:n=>{e(te({files:n}))},onDeleteFile:n=>{e(ne(n))},onEditFileName:(n,i)=>{e(ee(n,i.split(".")[0]))},onUpdatePrimaryFundingAccount:(n,i)=>{e(ke(a,"reimbursement_setup",n,i))},onSignUpClick:()=>{o.hasZeniAccountsAdminAccess?window.open("../checking/promo","_blank"):window.open("https://www.zeni.ai/product/business-checking-accounts","_blank")}}})(qn),ft=()=>{const e=J(),o=X(),t=Y(),{tenantEmailDomain:a}=W(),c=ae(),{useDynamicConfig:n}=ie(),i=Te(),{configValue:l}=n(Q.zeniAccountsConfig),s=ye(l),r=gn(c?.loggedInUserRoleMap),p=Ie(c?.loggedInUserRoleMap),[y,I]=C.useState(!1),d=C.useRef(!1),[m,S]=C.useState(!1),v=E(b=>b.remiSetupViewState.fetchState),g=E(b=>F(b)),f=E(b=>b.remiSetupApproverViewState.fetchState),P=D.getSignedInUserTenant(a)?.companyId??g.companyId,A=D.getSignedInUser(),_=b=>{I(b)};if(A==null)throw Error("Can't access reimbursement setup page without signing in...");if(C.useEffect(()=>{d.current||v!=="Not-Started"||P==null?d.current||v!=="Completed"||P==null||g.companyBillPayInfo?.info?.businessVerificationStatus?.code!=="pending_review"||(d.current=!0,t(pe(P,!1,!0))):(d.current=!0,t(pe(P,!0)))},[v,P,t]),C.useEffect(()=>{m||f!=="Not-Started"||(S(!0),t(Sn(!0)))},[m,f,t]),g.companyReimbursementInfo?.info?.isReimbursementTOSAccepted===!1)return u.jsx(j,{to:"../promo"});if(g.companyReimbursementInfo?.info?.isReimbursementTOSAccepted===!0){const b=k=>k.trackPageLoaded($.Event.reimbursementSetup);return u.jsxs(mt,{children:[u.jsx(se,{analytics:w,onLoad:k=>b(k)}),u.jsx(fe,{isAppContentDrawerOpen:y,handleDrawerToggle:_}),u.jsx(yt,{navigate:e,location:o,companyId:P,currentTenant:g,isUserRemiAdmin:r,onClickMenuIcon:()=>{_(!0)},hasZeniAccountsAdminAccess:p,accountsPromoConfig:s})]})}return u.jsx(Ue,{fetchState:"In-Progress",style:{backgroundColor:i.colors.grey5}})},gt=H(function(e,o){const{businessVerificationDetails:t,productType:a}=o,c=F(e),n=D.getSignedInUser(),i=c.tenantId,l={userId:n?.userId??"",sessionId:n?.zeniSessionId??"",tenantId:i??""},s=wn(o.roleMap)&&t.updateStatus.fetchState!=="In-Progress"?void 0:"readonly",r=Dn(e.companyConfigState),p=Tn(e.userRoleConfigState),y=a==="zeni_treasury"?Ke(e):void 0;return{businessVerificationDetails:t,verficationDetailsFetchState:t.fetchState,isRefreshingViewInBackground:t.isRefreshingViewInBackground,allNationalityCountries:t.allNationalityCountries,filesEndPoint:`${oe.fileMicroServiceBaseUrl}`,authParams:l,isDisabled:s,allIndustries:r.companyIndustries??[],companyTitles:p.companyTitles,transferDetails:y}},function(e,o){const{companyId:t,productType:a,currentTenant:c,navigate:n,location:i}=o,{tenantEmailDomain:l}=c;return{onCompanyDetailsChanged:s=>{const{companyDescription:r,companyIndustry:p,companyIndustryType:y,companyLegalName:I,companyTaxId:d,companyWebsite:m,companyPhone:S,primaryContactEmail:v,primaryContactName:g,primaryContactUserId:f,primaryContactSyncToken:P,syncToken:A,fileIds:_,incDate:b,typeOfIncorporation:k,stateOfIncorporation:h,sourceOfFunds:T,companySubIndustry:B,countriesOfOperations:U,companySourceOfFunds:x,companySourceOfFundsDescription:ce,transactionVolume:G,transactionVolumeDescription:ge,purposeOfAccount:K,purposeOfAccountDescription:re,regulatedStatus:M,regulatedStatusDescription:N,usNexus:O,usNexusTypes:Oe}=s,Se=y?.selectedOption,be={companyId:t,companyDescription:r,companyIndustry:p.selectedOption,companyIndustryType:Se==null||Se===""?void 0:Se,companyLegalName:I,taxIdOrEIN:d,website:m!=""&&m!=null?Bn(m):void 0,phone:S,syncToken:A,fileIds:_,incDate:b!=null?Ne(b?.toString()):b,typeOfIncorporation:k?.selectedOption??"",stateOfIncorporation:h?.selectedOption??"",sourceOfFunds:T?.selectedOption??"",companySubIndustry:B?.selectedOption??"",countriesOfOperations:U?.selectedOptions.map(ue=>ue.length===2?ue:Le(ue))??[],companySourceOfFunds:x?.selectedOption??"",companySourceOfFundsDescription:ce,transactionVolume:G?.selectedOption??"",transactionVolumeDescription:ge,purposeOfAccount:K?.selectedOption??"",purposeOfAccountDescription:re,regulatedStatus:M??"",regulatedStatusDescription:N,usNexus:O,usNexusTypes:Oe?.selectedOptions??[]},he={userId:f,firstName:g.firstName,lastName:g.lastName,email:v,syncToken:P};e(je({companyDetails:be,primaryContactDetails:he}))},onCompanyOfficerUpdated:s=>{const r=s.map(p=>{const{officerType:y,userId:I,name:d,email:m,nationalityCountryCode:S,ssn:v,dob:g,phone:f,syncToken:P,selectDocument:A,role:_,ownership:b,isSelectedForVerification:k,userVerificationStatus:h,treasuryUserVerificationStatus:T,fileIds:B}=p;let U;return A.selectDocumentType==="driverLicense"?U="driving_license":A.selectDocumentType==="passport"?U="passport":A.selectDocumentType==="stateId"?U="id_document":A.selectDocumentType==="ssnCard"&&(U="social_security_card"),{officerType:y,userId:I,firstName:d.firstName,lastName:d.lastName,email:m,ssn:v,nationalityCountryCode:S?.selectedOption!=null?Le(S.selectedOption):void 0,phone:f,birthday:g!=null?Ne(g?.toString()):g,syncToken:P,titleAtCompany:_.selectedOption,ownershipInCompany:b,documentTypeSelectedForVerification:U,isSelectedForVerification:k,userVerificationStatus:h,treasuryUserVerificationStatus:T,fileIds:B,additionalDocumentTypesRequestedForVerification:[],additionalSubmittedDocumentsForVerificationFileIds:[],areAdditionalDocumentsRequestedForVerification:!1,areAdditionalDocumentsSubmittedForVerification:!1}});e(je({officers:r}))},onSaveDetailsClick:s=>{e(z(t,s,a))},onSendForVerificationClick:s=>{e(z(t,s,a,!0))},onAddressClick:s=>{const r=Ze(l,s),p=ze(i.state?.pathnameStackToGoBack,i.pathname),y=new URLSearchParams(i.search),I={};y.forEach((d,m)=>{I[m]=d}),n(r,{state:{pathnameStackToGoBack:p,queryParams:Object.keys(I).length>0?I:void 0}})},onRegisteredAddressClick:s=>{const r=Ze(l,s),p=ze(i.state?.pathnameStackToGoBack,i.pathname),y=new URLSearchParams(i.search),I=Object.fromEntries(y.entries());n(r,{state:{pathnameStackToGoBack:p,queryParams:Object.keys(I).length>0?I:void 0}})},onBackClick:()=>{e(On({companyId:t})),n("../setup")},updateFilesEntity:s=>{e(te({files:s}))},onDeleteFile:s=>{e(ne(s))},onDeleteFileList:s=>{e(Qe(s))},onEditFileName:(s,r)=>{e(ee(s,r.split(".")[0]))},onGetOtp:s=>{e(He(s,"SpendManagementSetup"))},onResendOtp:s=>{e(We(s,"SpendManagementSetup"))},onVerifyOtp:(s,r)=>{e($e(s,r,"SpendManagementSetup"))},saveNewAddressInLocalStore:(s,r)=>{e(Un({addressType:s,addressToCreate:r}))},onExecuteTreasuryTransfer:()=>{e(qe())},onOverlayClose:()=>{e(xe())}}})(Qn),St=({productType:e,isBusinessVerificationDrawerOpen:o,closeDrawerHandler:t})=>{const a=J(),c=X(),n=Y(),[i]=Xe(),l=i.get("showStepProgress"),s=i.get("isTransferInitiated"),[r,p]=C.useState(!1),{tenantEmailDomain:y}=W(),I=ae(),{useDynamicConfig:d}=ie(),m=Te(),{configValue:S}=d(Q.zeniAccountsConfig),v=ye(S),g=E(h=>{switch(e){case"zeni_accounts":return h.zeniAccountSetupViewState.fetchState;case"reimbursement":return h.remiSetupViewState.fetchState;case"charge_cards":return h.chargeCardSetupViewState.fetchState;case"zeni_treasury":return h.treasurySetupViewState.fetchState;default:return h.billPaySetupViewState.fetchState}}),f=E(h=>h.companyConfigState.fetchState),P=E(h=>h.userRoleConfigState.fetchState),A=E(h=>F(h)),_=A.companyId??D.getSignedInUserTenant(y)?.companyId;if(C.useEffect(()=>{f==="Not-Started"&&n(An()),P==="Not-Started"&&n(kn(!0))},[f,P,n]),C.useEffect(()=>{if(!r&&g==="Not-Started"&&_!=null)switch(p(!0),e){case"zeni_accounts":n(me(_,!0));break;case"zeni_treasury":n(Ce(_,!0));break;case"reimbursement":n(pe(_,!0));break;case"charge_cards":n(le(_,!0));break;default:n(Z(_,!0))}},[r,g,_,n]),D.getSignedInUser()==null)throw Error("Can't access business verification without signing in...");let b;switch(e){case"zeni_accounts":b=A.companyZeniAccountInfo?.info?.isZeniAccountTOSAccepted;break;case"reimbursement":b=A.companyReimbursementInfo?.info?.isReimbursementTOSAccepted;break;case"charge_cards":b=A.companyChargeCardInfo?.info?.isChargeCardTOSAccepted===!0||A.companyDebitCardInfo?.info?.isDebitCardTOSAccepted;break;case"zeni_treasury":b=A.companyTreasuryInfo?.info?.isTreasuryTOSAccepted;break;default:b=A.companyBillPayInfo?.info?.isBillPayTOSAccepted}const k=E(h=>{let T;switch(e){case"zeni_accounts":T=En(h,_);break;case"zeni_treasury":T=Ge(h,_);break;case"charge_cards":T=Pn(h,_);break;case"reimbursement":T=vn(h,_);break;default:T=_n(h,_)}return T});return b===!1?null:k.fetchState==="Completed"&&b===!0&&I?.loggedInUserRoleMap!=null?u.jsxs(u.Fragment,{children:[u.jsx(se,{analytics:w,onLoad:h=>(T=>{switch(e){case"zeni_accounts":return T.trackPageLoaded($.Event.zeniAccountsBusinessVerification);case"reimbursement":case"charge_cards":return T.trackPageLoaded($.Event.reimbursementBusinessVerification);default:return T.trackPageLoaded($.Event.billPayBusinessVerification,Ve(c)?"Settings":void 0)}})(h)}),u.jsx(gt,{businessVerificationDetails:k,navigate:a,location:c,companyId:_,analytics:w,currentTenant:A,productType:e,roleMap:I.loggedInUserRoleMap,isSettings:Ve(c),isOverlay:!0,isStepInProgress:l!=null,isTreasuryTransferInitiated:s!=null,onClickMenuIcon:()=>{},maxInsuredAmount:v.maxInsuredAmount,isBusinessVerificationDrawerOpen:o,closeDrawerHandler:t})]}):u.jsx(Ue,{fetchState:"In-Progress",style:{backgroundColor:m.colors.grey5}})},bt={overlayWidth:new Xn(100,100,59)},ht=H(function(e,o){const{isUserZeniAccountsAdmin:t,companyId:a,accountsPromoConfig:c}=o,n=F(e),i=D.getSignedInUser(),l=n.tenantId,s={userId:i?.userId??"",sessionId:i?.zeniSessionId??"",tenantId:l??""},r=Je(e,a),p=Ge(e,a),y=t&&r.updateStatus.fetchState!=="In-Progress"&&r.plaidConnectionDetails.link_account.updateStatus.fetchState!=="In-Progress"&&r.plaidConnectionDetails.update_account.updateStatus.fetchState!=="In-Progress"&&r.accountUpdateStatus?.fetchState!=="In-Progress"?void 0:"readonly",I=Nn(e),d=I.transactions,m=Ke(e),S=I.accountSummary?.totalBalance?.amount,v=d.length===0||S===0;return{treasurySetupView:r,businessVerificationDetails:p,connectedAccountProvider:n.company?.featuresActivationInfo.connectedAccountProvider??"",transactions:d,transferDetails:m,isFirstTransfer:v,isDisabled:y,meetingUrl:"https://meetings.hubspot.com/niharn/demo-accounts?embed=true",analytics:w,filesEndPoint:`${oe.fileMicroServiceBaseUrl}`,authParams:s,isOnSetup:!0,maxInsuredAmount:c.maxInsuredAmount}},function(e,o){const{navigate:t,companyId:a,currentTenant:c,isAllocationDone:n,analytics:i,treasurySetupView:l}=o;return{onTransferSaveChangesToLocalStore:s=>{e(zn(s))},onBusinessVerificationSectionClick:(s,r)=>{let p="../verification";s&&(p+="?showStepProgress=true",r&&(p+="&isTransferInitiated=true")),t(p),c?.company?.companyTreasuryInfo!=null&&c?.company?.companyTreasuryInfo?.businessVerificationStatus?.code==="pending_review"&&e(Ce(a,!1,!0))},onFetchLinkTokenClick:(s,r)=>{e(De("treasury_setup",s,r))},onEstablishConnectionClick:s=>{e(we(s,a,"treasury_setup","zeni_treasury"))},onUpdatePaymentAccountStatus:(s,r,p)=>{e(Ee(s,r,"zeni_treasury","treasury_setup",p))},onUpdatePaymentAccountLoginStatus:(s,r)=>{e(Pe(!1,s,"zeni_treasury","treasury_setup",r))},onEstablishConnectionSuccess:()=>{e(Ce(a,!0))},onEnableTreasuryClick:()=>{e(q(a,"zeni_treasury"))},onUpdateTreasuryClick:(s,r,p)=>{e(p==="paymentAccount"?_e(s,r,"zeni_treasury","treasury_setup"):ve("treasury_setup",s,r))},onUpdatePrimaryFundingAccount:(s,r)=>{e(ke(a,"treasury_setup",s,r))},onNavigateToDashboard:()=>{t(c?.company?.companyTreasuryInfo?.businessVerificationStatus?.code==="verified"?"../":"../../")},onCompanyOfficerUpdated:(s,r)=>{e(Ae({officerType:s,fileIds:r}))},onSendForVerificationClick:(s,r)=>{if(e(z(a,s,"zeni_treasury",!0,!0,!0)),!n){const p=l.fundAllocationLocalData;i.trackTreasuryPortfolioConfirm(p.riskScore,Me(p)),e(Re(!1))}r===!0&&e(qe())},updateFilesEntity:s=>{e(te({files:s}))},onDeleteFile:s=>{e(ne(s))},onEditFileName:(s,r)=>{e(ee(s,r.split(".")[0]))},onAdditionalVerificationFieldsChanged:s=>{const{sourceOfFunds:r}=s;e(Rn({sourceOfFunds:r?.selectedOption??""}))},onUpdateFundAllocation:s=>{i.trackTreasuryAllocationAction("update",Me(s)),e(jn(s))},onConfirmFundAllocation:()=>{e(Re(n))},onSignUpClick:()=>{o.isUserZeniAccountsAdmin?window.open("../checking/promo","_blank","noopener,noreferrer"):window.open("https://www.zeni.ai/product/business-checking-accounts","_blank","noopener,noreferrer")},onOverlayClose:()=>{e(xe())}}})(Yn),Ct=()=>{const e=J(),o=X(),t=Y(),a=Te(),c=Jn(),{tenantEmailDomain:n}=W(),{useDynamicConfig:i}=ie(),l=ae(),[s,r]=C.useState(!1),p=Ie(l?.loggedInUserRoleMap),{configValue:y}=i(Q.zeniAccountsConfig),I=ye(y),[d,m]=C.useState(!1),[S,v]=C.useState(!1),[g,f]=C.useState(!1),[P,A]=C.useState(!1),[_,b]=C.useState(!1),k=E(O=>O.treasurySetupViewState.fetchState),h=E(O=>O.treasurySetupViewState.treasuryFundsDetails?.fetchStatus?.fetchState),T=E(O=>O.treasurySetupViewState.currentAllocation.fetchStatus?.fetchState),B=E(O=>O.treasuryDetailState.transactionsState?.fetchState),U=E(O=>F(O)),x=D.getSignedInUserTenant(n)?.companyId??U.companyId,ce=E(O=>Je(O,x)),G=ce.isAtomicAccountExists,ge=!!U.companyZeniAccountInfo?.info?.isZeniAccountEnabled,K=D.getSignedInUser(),re=O=>{m(O)};if(K==null)throw Error("Can't access treasury setup page without signing in...");C.useEffect(()=>{S||k!=="Not-Started"||x==null||(v(!0),t(Ce(x,!0,!1)))},[S,k,x,t]),C.useEffect(()=>{g||h!=="Not-Started"||x==null||(f(!0),t(xn()))},[g,h,x,t]),C.useEffect(()=>{P||T!=="Not-Started"||x==null||(A(!0),t(Fn()))},[P,T,x,t]),C.useEffect(()=>{_||B!=="Not-Started"||x==null||(b(!0),t(Vn(!0)))},[_,B,x,t]);const M=U.companyTreasuryInfo?.info?.businessVerificationStatus?.code,N=M==="pending_review"||M==="verified";return C.useEffect(()=>{s||k!=="Completed"||G||N||!o.pathname.includes("setup")||r(!0)},[k,G,N]),U.companyTreasuryInfo?.info?.isTreasuryTOSAccepted===!1?u.jsx(j,{to:"../promo"}):u.jsxs(u.Fragment,{children:[u.jsx(se,{analytics:w,onLoad:()=>{}}),u.jsx(fe,{isAppContentDrawerOpen:d,handleDrawerToggle:re}),u.jsx(at,{onClose:()=>{t(xe()),e("../setup")},anchor:"right",open:o.pathname.includes("verification"),transitionDuration:s?0:250,PaperProps:{style:{width:bt.overlayWidth.valuePercentage(c),boxShadow:"none"}},slotProps:{backdrop:{style:{backgroundColor:s?"transparent":a.colors.black,opacity:.75,cursor:"pointer"}}},children:u.jsx(It,{onClick:O=>O.stopPropagation(),children:u.jsx(St,{productType:"zeni_treasury",isBusinessVerificationDrawerOpen:!0,closeDrawerHandler:()=>{t(xe()),e("../setup")}})})}),u.jsx(ht,{navigate:e,location:o,companyId:x,currentTenant:U,isUserZeniAccountsAdmin:p,accountsPromoConfig:I,isAccountsEnabled:ge,isAllocationDone:G,analytics:w,treasurySetupView:ce,onClickMenuIcon:()=>{re(!0)},showTreasurySetupOverlay:s,setShowTreasurySetupOverlay:r})]})},It=Fe(it)`
17
+ `,yt=H(function(e,o){const{isUserRemiAdmin:t,companyId:a}=o,c=F(e),n=bn(e),i=hn(e,a),l=D.getSignedInUser(),s=c.tenantId,r={userId:l?.userId??"",sessionId:l?.zeniSessionId??"",tenantId:s??""},p=t&&i.updateStatus.fetchState!=="In-Progress"&&i.plaidConnectionDetails.link_account.updateStatus.fetchState!=="In-Progress"&&i.plaidConnectionDetails.update_account.updateStatus.fetchState!=="In-Progress"&&i.accountUpdateStatus?.fetchState!=="In-Progress"?void 0:"readonly",y=!!c.companyZeniAccountInfo?.info?.isZeniAccountEnabled;return{remiSetupView:i,isDisabled:p,remiApprovalView:n,connectedAccountProvider:c.company?.featuresActivationInfo.connectedAccountProvider??"",isAccountsEnabled:y,meetingUrl:"https://meetings.hubspot.com/niharn/demo-reimbursements?embed=true",analytics:w,filesEndPoint:`${oe.fileMicroServiceBaseUrl}`,authParams:r}},function(e,o){const{navigate:t,companyId:a,currentTenant:c}=o;return{updateMileageDetails:n=>{const{mileageAmount:i,mileageUnit:l,mileageCurrencyCode:s,mileageCurrencySymbol:r,denomination:p,denominationSymbol:y,mileageAmountInDenomination:I,description:d}=n;e(In({mileageDetails:{mileageUnitAmount:{amount:i,currencyCode:s,currencySymbol:r},denomination:p,denominationSymbol:y,mileageAmountInDenomination:I,mileageCurrencyCode:s,mileageCurrencySymbol:r,mileageUnit:l,description:d}}))},onSaveMileageClick:n=>{e(Cn(a)),w.trackReimbursementMileageRateSave(n)},onBusinessVerificationSectionClick:()=>{t("../verification"),c?.company?.companyReimbursementInfo!=null&&c?.company?.companyBillPayInfo?.businessVerificationStatus?.code==="pending_review"&&e(pe(a,!1,!0))},onSetupApprovalRulesSectionClick:()=>{t("../approval-rules")},onFetchLinkTokenClick:(n,i)=>{e(De("reimbursement_setup",n,i))},onEstablishConnectionClick:n=>{e(we(n,a,"reimbursement_setup","reimbursement"))},onUpdatePaymentAccountStatus:(n,i,l)=>{e(Ee(n,i,"reimbursement","reimbursement_setup",l))},onUpdatePaymentAccountLoginStatus:(n,i)=>{e(Pe(!1,n,"reimbursement","reimbursement_setup",i))},onEstablishConnectionSuccess:()=>{e(pe(a,!0))},onEnableRemiClick:()=>{e(K(a,"reimbursement"))},onUpdateAccountClick:(n,i,l)=>{e(l==="paymentAccount"?_e(n,i,"reimbursement","reimbursement_setup"):ve("reimbursement_setup",n,i))},onEnableRemiSuccess:()=>{t("../",{relative:"path"})},onBackClick:()=>{c?.companyReimbursementInfo?.info?.isReimbursementEnabled!=null&&c.companyReimbursementInfo.info.isReimbursementEnabled===!1?t("../.."):t("../",{relative:"path"})},onCompanyOfficerUpdated:(n,i)=>{e(Ae({officerType:n,fileIds:i}))},onSendForVerificationClick:n=>{e(R(a,n,"reimbursement",!0,!0,!0))},updateFilesEntity:n=>{e(te({files:n}))},onDeleteFile:n=>{e(ne(n))},onEditFileName:(n,i)=>{e(ee(n,i.split(".")[0]))},onUpdatePrimaryFundingAccount:(n,i)=>{e(ke(a,"reimbursement_setup",n,i))},onSignUpClick:()=>{o.hasZeniAccountsAdminAccess?window.open("../checking/promo","_blank"):window.open("https://www.zeni.ai/product/business-checking-accounts","_blank")}}})(Kn),ft=()=>{const e=J(),o=X(),t=Y(),{tenantEmailDomain:a}=W(),c=ae(),{useDynamicConfig:n}=ie(),i=Te(),{configValue:l}=n(Q.zeniAccountsConfig),s=ye(l),r=gn(c?.loggedInUserRoleMap),p=Ie(c?.loggedInUserRoleMap),[y,I]=C.useState(!1),d=C.useRef(!1),[m,S]=C.useState(!1),v=E(b=>b.remiSetupViewState.fetchState),g=E(b=>F(b)),f=E(b=>b.remiSetupApproverViewState.fetchState),P=D.getSignedInUserTenant(a)?.companyId??g.companyId,A=D.getSignedInUser(),_=b=>{I(b)};if(A==null)throw Error("Can't access reimbursement setup page without signing in...");if(C.useEffect(()=>{d.current||v!=="Not-Started"||P==null?d.current||v!=="Completed"||P==null||g.companyBillPayInfo?.info?.businessVerificationStatus?.code!=="pending_review"||(d.current=!0,t(pe(P,!1,!0))):(d.current=!0,t(pe(P,!0)))},[v,P,t]),C.useEffect(()=>{m||f!=="Not-Started"||(S(!0),t(Sn(!0)))},[m,f,t]),g.companyReimbursementInfo?.info?.isReimbursementTOSAccepted===!1)return u.jsx(j,{to:"../promo"});if(g.companyReimbursementInfo?.info?.isReimbursementTOSAccepted===!0){const b=k=>k.trackPageLoaded($.Event.reimbursementSetup);return u.jsxs(mt,{children:[u.jsx(se,{analytics:w,onLoad:k=>b(k)}),u.jsx(fe,{isAppContentDrawerOpen:y,handleDrawerToggle:_}),u.jsx(yt,{navigate:e,location:o,companyId:P,currentTenant:g,isUserRemiAdmin:r,onClickMenuIcon:()=>{_(!0)},hasZeniAccountsAdminAccess:p,accountsPromoConfig:s})]})}return u.jsx(Ue,{fetchState:"In-Progress",style:{backgroundColor:i.colors.grey5}})},gt=H(function(e,o){const{businessVerificationDetails:t,productType:a}=o,c=F(e),n=D.getSignedInUser(),i=c.tenantId,l={userId:n?.userId??"",sessionId:n?.zeniSessionId??"",tenantId:i??""},s=wn(o.roleMap)&&t.updateStatus.fetchState!=="In-Progress"?void 0:"readonly",r=Dn(e.companyConfigState),p=Tn(e.userRoleConfigState),y=a==="zeni_treasury"?qe(e):void 0;return{businessVerificationDetails:t,verficationDetailsFetchState:t.fetchState,isRefreshingViewInBackground:t.isRefreshingViewInBackground,allNationalityCountries:t.allNationalityCountries,filesEndPoint:`${oe.fileMicroServiceBaseUrl}`,authParams:l,isDisabled:s,allIndustries:r.companyIndustries??[],companyTitles:p.companyTitles,transferDetails:y}},function(e,o){const{companyId:t,productType:a,currentTenant:c,navigate:n,location:i}=o,{tenantEmailDomain:l}=c;return{onCompanyDetailsChanged:s=>{const{companyDescription:r,companyIndustry:p,companyIndustryType:y,companyLegalName:I,companyTaxId:d,companyWebsite:m,companyPhone:S,primaryContactEmail:v,primaryContactName:g,primaryContactUserId:f,primaryContactSyncToken:P,syncToken:A,fileIds:_,incDate:b,typeOfIncorporation:k,stateOfIncorporation:h,sourceOfFunds:T,companySubIndustry:B,countriesOfOperations:U,companySourceOfFunds:x,companySourceOfFundsDescription:ce,transactionVolume:G,transactionVolumeDescription:ge,purposeOfAccount:q,purposeOfAccountDescription:re,regulatedStatus:M,regulatedStatusDescription:N,usNexus:O,usNexusTypes:Oe}=s,Se=y?.selectedOption,be={companyId:t,companyDescription:r,companyIndustry:p.selectedOption,companyIndustryType:Se==null||Se===""?void 0:Se,companyLegalName:I,taxIdOrEIN:d,website:m!=""&&m!=null?Bn(m):void 0,phone:S,syncToken:A,fileIds:_,incDate:b!=null?Ne(b?.toString()):b,typeOfIncorporation:k?.selectedOption??"",stateOfIncorporation:h?.selectedOption??"",sourceOfFunds:T?.selectedOption??"",companySubIndustry:B?.selectedOption??"",countriesOfOperations:U?.selectedOptions.map(ue=>ue.length===2?ue:Le(ue))??[],companySourceOfFunds:x?.selectedOption??"",companySourceOfFundsDescription:ce,transactionVolume:G?.selectedOption??"",transactionVolumeDescription:ge,purposeOfAccount:q?.selectedOption??"",purposeOfAccountDescription:re,regulatedStatus:M??"",regulatedStatusDescription:N,usNexus:O,usNexusTypes:Oe?.selectedOptions??[]},he={userId:f,firstName:g.firstName,lastName:g.lastName,email:v,syncToken:P};e(je({companyDetails:be,primaryContactDetails:he}))},onCompanyOfficerUpdated:s=>{const r=s.map(p=>{const{officerType:y,userId:I,name:d,email:m,nationalityCountryCode:S,ssn:v,dob:g,phone:f,syncToken:P,selectDocument:A,role:_,ownership:b,isSelectedForVerification:k,userVerificationStatus:h,treasuryUserVerificationStatus:T,fileIds:B}=p;let U;return A.selectDocumentType==="driverLicense"?U="driving_license":A.selectDocumentType==="passport"?U="passport":A.selectDocumentType==="stateId"?U="id_document":A.selectDocumentType==="ssnCard"&&(U="social_security_card"),{officerType:y,userId:I,firstName:d.firstName,lastName:d.lastName,email:m,ssn:v,nationalityCountryCode:S?.selectedOption!=null?Le(S.selectedOption):void 0,phone:f,birthday:g!=null?Ne(g?.toString()):g,syncToken:P,titleAtCompany:_.selectedOption,ownershipInCompany:b,documentTypeSelectedForVerification:U,isSelectedForVerification:k,userVerificationStatus:h,treasuryUserVerificationStatus:T,fileIds:B,additionalDocumentTypesRequestedForVerification:[],additionalSubmittedDocumentsForVerificationFileIds:[],areAdditionalDocumentsRequestedForVerification:!1,areAdditionalDocumentsSubmittedForVerification:!1}});e(je({officers:r}))},onSaveDetailsClick:s=>{e(R(t,s,a))},onSendForVerificationClick:s=>{e(R(t,s,a,!0))},onAddressClick:s=>{const r=Ze(l,s),p=Re(i.state?.pathnameStackToGoBack,i.pathname),y=new URLSearchParams(i.search),I={};y.forEach((d,m)=>{I[m]=d}),n(r,{state:{pathnameStackToGoBack:p,queryParams:Object.keys(I).length>0?I:void 0}})},onRegisteredAddressClick:s=>{const r=Ze(l,s),p=Re(i.state?.pathnameStackToGoBack,i.pathname),y=new URLSearchParams(i.search),I=Object.fromEntries(y.entries());n(r,{state:{pathnameStackToGoBack:p,queryParams:Object.keys(I).length>0?I:void 0}})},onBackClick:()=>{e(On({companyId:t})),n("../setup")},updateFilesEntity:s=>{e(te({files:s}))},onDeleteFile:s=>{e(ne(s))},onDeleteFileList:s=>{e(Qe(s))},onEditFileName:(s,r)=>{e(ee(s,r.split(".")[0]))},onGetOtp:s=>{e(He(s,"SpendManagementSetup"))},onResendOtp:s=>{e(We(s,"SpendManagementSetup"))},onVerifyOtp:(s,r)=>{e($e(s,r,"SpendManagementSetup"))},saveNewAddressInLocalStore:(s,r)=>{e(Un({addressType:s,addressToCreate:r}))},onExecuteTreasuryTransfer:()=>{e(Ke())},onOverlayClose:()=>{e(xe())}}})(Qn),St=({productType:e,isBusinessVerificationDrawerOpen:o,closeDrawerHandler:t})=>{const a=J(),c=X(),n=Y(),[i]=Xe(),l=i.get("showStepProgress"),s=i.get("isTransferInitiated"),[r,p]=C.useState(!1),{tenantEmailDomain:y}=W(),I=ae(),{useDynamicConfig:d}=ie(),m=Te(),{configValue:S}=d(Q.zeniAccountsConfig),v=ye(S),g=E(h=>{switch(e){case"zeni_accounts":return h.zeniAccountSetupViewState.fetchState;case"reimbursement":return h.remiSetupViewState.fetchState;case"charge_cards":return h.chargeCardSetupViewState.fetchState;case"zeni_treasury":return h.treasurySetupViewState.fetchState;default:return h.billPaySetupViewState.fetchState}}),f=E(h=>h.companyConfigState.fetchState),P=E(h=>h.userRoleConfigState.fetchState),A=E(h=>F(h)),_=A.companyId??D.getSignedInUserTenant(y)?.companyId;if(C.useEffect(()=>{f==="Not-Started"&&n(An()),P==="Not-Started"&&n(kn(!0))},[f,P,n]),C.useEffect(()=>{if(!r&&g==="Not-Started"&&_!=null)switch(p(!0),e){case"zeni_accounts":n(me(_,!0));break;case"zeni_treasury":n(Ce(_,!0));break;case"reimbursement":n(pe(_,!0));break;case"charge_cards":n(le(_,!0));break;default:n(Z(_,!0))}},[r,g,_,n]),D.getSignedInUser()==null)throw Error("Can't access business verification without signing in...");let b;switch(e){case"zeni_accounts":b=A.companyZeniAccountInfo?.info?.isZeniAccountTOSAccepted;break;case"reimbursement":b=A.companyReimbursementInfo?.info?.isReimbursementTOSAccepted;break;case"charge_cards":b=A.companyChargeCardInfo?.info?.isChargeCardTOSAccepted===!0||A.companyDebitCardInfo?.info?.isDebitCardTOSAccepted;break;case"zeni_treasury":b=A.companyTreasuryInfo?.info?.isTreasuryTOSAccepted;break;default:b=A.companyBillPayInfo?.info?.isBillPayTOSAccepted}const k=E(h=>{let T;switch(e){case"zeni_accounts":T=En(h,_);break;case"zeni_treasury":T=Ge(h,_);break;case"charge_cards":T=Pn(h,_);break;case"reimbursement":T=vn(h,_);break;default:T=_n(h,_)}return T});return b===!1?null:k.fetchState==="Completed"&&b===!0&&I?.loggedInUserRoleMap!=null?u.jsxs(u.Fragment,{children:[u.jsx(se,{analytics:w,onLoad:h=>(T=>{switch(e){case"zeni_accounts":return T.trackPageLoaded($.Event.zeniAccountsBusinessVerification);case"reimbursement":case"charge_cards":return T.trackPageLoaded($.Event.reimbursementBusinessVerification);default:return T.trackPageLoaded($.Event.billPayBusinessVerification,Ve(c)?"Settings":void 0)}})(h)}),u.jsx(gt,{businessVerificationDetails:k,navigate:a,location:c,companyId:_,analytics:w,currentTenant:A,productType:e,roleMap:I.loggedInUserRoleMap,isSettings:Ve(c),isOverlay:!0,isStepInProgress:l!=null,isTreasuryTransferInitiated:s!=null,onClickMenuIcon:()=>{},maxInsuredAmount:v.maxInsuredAmount,isBusinessVerificationDrawerOpen:o,closeDrawerHandler:t})]}):u.jsx(Ue,{fetchState:"In-Progress",style:{backgroundColor:m.colors.grey5}})},bt={overlayWidth:new Xn(100,100,59)},ht=H(function(e,o){const{isUserZeniAccountsAdmin:t,companyId:a,accountsPromoConfig:c}=o,n=F(e),i=D.getSignedInUser(),l=n.tenantId,s={userId:i?.userId??"",sessionId:i?.zeniSessionId??"",tenantId:l??""},r=Je(e,a),p=Ge(e,a),y=t&&r.updateStatus.fetchState!=="In-Progress"&&r.plaidConnectionDetails.link_account.updateStatus.fetchState!=="In-Progress"&&r.plaidConnectionDetails.update_account.updateStatus.fetchState!=="In-Progress"&&r.accountUpdateStatus?.fetchState!=="In-Progress"?void 0:"readonly",I=Nn(e),d=I.transactions,m=qe(e),S=I.accountSummary?.totalBalance?.amount,v=d.length===0||S===0;return{treasurySetupView:r,businessVerificationDetails:p,connectedAccountProvider:n.company?.featuresActivationInfo.connectedAccountProvider??"",transactions:d,transferDetails:m,isFirstTransfer:v,isDisabled:y,meetingUrl:"https://meetings.hubspot.com/niharn/demo-accounts?embed=true",analytics:w,filesEndPoint:`${oe.fileMicroServiceBaseUrl}`,authParams:s,isOnSetup:!0,maxInsuredAmount:c.maxInsuredAmount}},function(e,o){const{navigate:t,companyId:a,currentTenant:c,isAllocationDone:n,analytics:i,treasurySetupView:l}=o;return{onTransferSaveChangesToLocalStore:s=>{e(Rn(s))},onBusinessVerificationSectionClick:(s,r)=>{let p="../verification";s&&(p+="?showStepProgress=true",r&&(p+="&isTransferInitiated=true")),t(p),c?.company?.companyTreasuryInfo!=null&&c?.company?.companyTreasuryInfo?.businessVerificationStatus?.code==="pending_review"&&e(Ce(a,!1,!0))},onFetchLinkTokenClick:(s,r)=>{e(De("treasury_setup",s,r))},onEstablishConnectionClick:s=>{e(we(s,a,"treasury_setup","zeni_treasury"))},onUpdatePaymentAccountStatus:(s,r,p)=>{e(Ee(s,r,"zeni_treasury","treasury_setup",p))},onUpdatePaymentAccountLoginStatus:(s,r)=>{e(Pe(!1,s,"zeni_treasury","treasury_setup",r))},onEstablishConnectionSuccess:()=>{e(Ce(a,!0))},onEnableTreasuryClick:()=>{e(K(a,"zeni_treasury"))},onUpdateTreasuryClick:(s,r,p)=>{e(p==="paymentAccount"?_e(s,r,"zeni_treasury","treasury_setup"):ve("treasury_setup",s,r))},onUpdatePrimaryFundingAccount:(s,r)=>{e(ke(a,"treasury_setup",s,r))},onNavigateToDashboard:()=>{t(c?.company?.companyTreasuryInfo?.businessVerificationStatus?.code==="verified"?"../":"../../")},onCompanyOfficerUpdated:(s,r)=>{e(Ae({officerType:s,fileIds:r}))},onSendForVerificationClick:(s,r)=>{if(e(R(a,s,"zeni_treasury",!0,!0,!0)),!n){const p=l.fundAllocationLocalData;i.trackTreasuryPortfolioConfirm(p.riskScore,Me(p)),e(ze(!1))}r===!0&&e(Ke())},updateFilesEntity:s=>{e(te({files:s}))},onDeleteFile:s=>{e(ne(s))},onEditFileName:(s,r)=>{e(ee(s,r.split(".")[0]))},onAdditionalVerificationFieldsChanged:s=>{const{sourceOfFunds:r}=s;e(zn({sourceOfFunds:r?.selectedOption??""}))},onUpdateFundAllocation:s=>{i.trackTreasuryAllocationAction("update",Me(s)),e(jn(s))},onConfirmFundAllocation:()=>{e(ze(n))},onSignUpClick:()=>{o.isUserZeniAccountsAdmin?window.open("../checking/promo","_blank","noopener,noreferrer"):window.open("https://www.zeni.ai/product/business-checking-accounts","_blank","noopener,noreferrer")},onOverlayClose:()=>{e(xe())}}})(Yn),Ct=()=>{const e=J(),o=X(),t=Y(),a=Te(),c=Jn(),{tenantEmailDomain:n}=W(),{useDynamicConfig:i}=ie(),l=ae(),[s,r]=C.useState(!1),p=Ie(l?.loggedInUserRoleMap),{configValue:y}=i(Q.zeniAccountsConfig),I=ye(y),[d,m]=C.useState(!1),[S,v]=C.useState(!1),[g,f]=C.useState(!1),[P,A]=C.useState(!1),[_,b]=C.useState(!1),k=E(O=>O.treasurySetupViewState.fetchState),h=E(O=>O.treasurySetupViewState.treasuryFundsDetails?.fetchStatus?.fetchState),T=E(O=>O.treasurySetupViewState.currentAllocation.fetchStatus?.fetchState),B=E(O=>O.treasuryDetailState.transactionsState?.fetchState),U=E(O=>F(O)),x=D.getSignedInUserTenant(n)?.companyId??U.companyId,ce=E(O=>Je(O,x)),G=ce.isAtomicAccountExists,ge=!!U.companyZeniAccountInfo?.info?.isZeniAccountEnabled,q=D.getSignedInUser(),re=O=>{m(O)};if(q==null)throw Error("Can't access treasury setup page without signing in...");C.useEffect(()=>{S||k!=="Not-Started"||x==null||(v(!0),t(Ce(x,!0,!1)))},[S,k,x,t]),C.useEffect(()=>{g||h!=="Not-Started"||x==null||(f(!0),t(xn()))},[g,h,x,t]),C.useEffect(()=>{P||T!=="Not-Started"||x==null||(A(!0),t(Fn()))},[P,T,x,t]),C.useEffect(()=>{_||B!=="Not-Started"||x==null||(b(!0),t(Vn(!0)))},[_,B,x,t]);const M=U.companyTreasuryInfo?.info?.businessVerificationStatus?.code,N=M==="pending_review"||M==="verified";return C.useEffect(()=>{s||k!=="Completed"||G||N||!o.pathname.includes("setup")||r(!0)},[k,G,N]),U.companyTreasuryInfo?.info?.isTreasuryTOSAccepted===!1?u.jsx(j,{to:"../promo"}):u.jsxs(u.Fragment,{children:[u.jsx(se,{analytics:w,onLoad:()=>{}}),u.jsx(fe,{isAppContentDrawerOpen:d,handleDrawerToggle:re}),u.jsx(at,{onClose:()=>{t(xe()),e("../setup")},anchor:"right",open:o.pathname.includes("verification"),transitionDuration:s?0:250,PaperProps:{style:{width:bt.overlayWidth.valuePercentage(c),boxShadow:"none"}},slotProps:{backdrop:{style:{backgroundColor:s?"transparent":a.colors.black,opacity:.75,cursor:"pointer"}}},children:u.jsx(It,{onClick:O=>O.stopPropagation(),children:u.jsx(St,{productType:"zeni_treasury",isBusinessVerificationDrawerOpen:!0,closeDrawerHandler:()=>{t(xe()),e("../setup")}})})}),u.jsx(ht,{navigate:e,location:o,companyId:x,currentTenant:U,isUserZeniAccountsAdmin:p,accountsPromoConfig:I,isAccountsEnabled:ge,isAllocationDone:G,analytics:w,treasurySetupView:ce,onClickMenuIcon:()=>{re(!0)},showTreasurySetupOverlay:s,setShowTreasurySetupOverlay:r})]})},It=Fe(it)`
18
18
  display: flex;
19
19
  min-height: 100%;
20
20
  flex-direction: column;
21
- `,At=H(function(e,o){const{isUserZeniAccountsAdmin:t,companyId:a}=o,c=F(e),n=D.getSignedInUser(),i=c.tenantId,l={userId:n?.userId??"",sessionId:n?.zeniSessionId??"",tenantId:i??""},s=Ln(e,a),r=t&&s.updateStatus.fetchState!=="In-Progress"&&s.plaidConnectionDetails.link_account.updateStatus.fetchState!=="In-Progress"&&s.plaidConnectionDetails.update_account.updateStatus.fetchState!=="In-Progress"&&s.accountUpdateStatus?.fetchState!=="In-Progress"?void 0:"readonly";return{zeniAccountSetUpView:s,connectedAccountProvider:c.company?.featuresActivationInfo.connectedAccountProvider??"",isDisabled:r,meetingUrl:"https://meetings.hubspot.com/niharn/demo-accounts?embed=true",analytics:w,filesEndPoint:`${oe.fileMicroServiceBaseUrl}`,authParams:l}},function(e,o){const{navigate:t,companyId:a,currentTenant:c}=o;return{onBusinessVerificationSectionClick:()=>{t("../verification"),c?.company?.companyZeniAccountInfo!=null&&c?.company?.companyBillPayInfo?.businessVerificationStatus?.code==="pending_review"&&e(me(a,!1,!0))},onFetchLinkTokenClick:(n,i)=>{e(De("account_setup",n,i))},onEstablishConnectionClick:n=>{e(we(n,a,"account_setup","zeni_accounts"))},onUpdatePaymentAccountStatus:(n,i,l)=>{e(Ee(n,i,"zeni_accounts","account_setup",l))},onUpdatePaymentAccountLoginStatus:(n,i)=>{e(Pe(!1,n,"zeni_accounts","account_setup",i))},onEstablishConnectionSuccess:()=>{e(me(a,!0))},onEnableZeniAccountClick:()=>{e(q(a,"zeni_accounts"))},onUpdateZeniAccountClick:(n,i,l)=>{e(l==="paymentAccount"?_e(n,i,"zeni_accounts","account_setup"):ve("account_setup",n,i))},onUpdatePrimaryFundingAccount:(n,i)=>{e(ke(a,"account_setup",n,i))},onEnableZeniAccountSuccess:()=>{t("../",{relative:"path"})},onBackClick:()=>{c?.companyZeniAccountInfo?.info?.isZeniAccountEnabled?t("../"):t("../../")},onNavigateToDashboard:()=>{t("../../dashboard")},onCompanyOfficerUpdated:(n,i)=>{e(Ae({officerType:n,fileIds:i}))},onSendForVerificationClick:n=>{e(z(a,n,"zeni_accounts",!0,!0,!0))},updateFilesEntity:n=>{e(te({files:n}))},onDeleteFile:n=>{e(ne(n))},onEditFileName:(n,i)=>{e(ee(n,i.split(".")[0]))}}})(et),kt=()=>{const e=J(),o=X(),t=Y(),{tenantEmailDomain:a}=W(),{useDynamicConfig:c}=ie(),n=ae(),i=Ie(n?.loggedInUserRoleMap),{configValue:l}=c(Q.zeniAccountsConfig),s=ye(l),[r,p]=C.useState(!1),[y,I]=C.useState(!1),d=E(f=>f.zeniAccountSetupViewState.fetchState),m=E(f=>F(f)),S=D.getSignedInUserTenant(a)?.companyId??m.companyId,v=D.getSignedInUser(),g=f=>{p(f)};if(v==null)throw Error("Can't access zeni bank account setup page without signing in...");if(C.useEffect(()=>{y||d!=="Not-Started"||S==null?y||d!=="Completed"||S==null||m.companyBillPayInfo?.info?.businessVerificationStatus?.code!=="pending_review"||t(me(S,!1,!0)):(I(!0),t(me(S,!0)))},[y,d,S,t]),m.companyZeniAccountInfo?.info?.isZeniAccountTOSAccepted===!1)return u.jsx(j,{to:"../promo"});{const f=P=>P.trackPageLoaded($.Event.zeniAccountsSetup);return u.jsxs(u.Fragment,{children:[u.jsx(se,{analytics:w,onLoad:P=>f(P)}),u.jsx(fe,{isAppContentDrawerOpen:r,handleDrawerToggle:g}),u.jsx(At,{navigate:e,location:o,companyId:S,currentTenant:m,isUserZeniAccountsAdmin:i,accountsPromoConfig:s,onClickMenuIcon:()=>{g(!0)}})]})}},_t=Fe.div`
21
+ `,At=H(function(e,o){const{isUserZeniAccountsAdmin:t,companyId:a}=o,c=F(e),n=D.getSignedInUser(),i=c.tenantId,l={userId:n?.userId??"",sessionId:n?.zeniSessionId??"",tenantId:i??""},s=Ln(e,a),r=t&&s.updateStatus.fetchState!=="In-Progress"&&s.plaidConnectionDetails.link_account.updateStatus.fetchState!=="In-Progress"&&s.plaidConnectionDetails.update_account.updateStatus.fetchState!=="In-Progress"&&s.accountUpdateStatus?.fetchState!=="In-Progress"?void 0:"readonly";return{zeniAccountSetUpView:s,connectedAccountProvider:c.company?.featuresActivationInfo.connectedAccountProvider??"",isDisabled:r,meetingUrl:"https://meetings.hubspot.com/niharn/demo-accounts?embed=true",analytics:w,filesEndPoint:`${oe.fileMicroServiceBaseUrl}`,authParams:l}},function(e,o){const{navigate:t,companyId:a,currentTenant:c}=o;return{onBusinessVerificationSectionClick:()=>{t("../verification"),c?.company?.companyZeniAccountInfo!=null&&c?.company?.companyBillPayInfo?.businessVerificationStatus?.code==="pending_review"&&e(me(a,!1,!0))},onFetchLinkTokenClick:(n,i)=>{e(De("account_setup",n,i))},onEstablishConnectionClick:n=>{e(we(n,a,"account_setup","zeni_accounts"))},onUpdatePaymentAccountStatus:(n,i,l)=>{e(Ee(n,i,"zeni_accounts","account_setup",l))},onUpdatePaymentAccountLoginStatus:(n,i)=>{e(Pe(!1,n,"zeni_accounts","account_setup",i))},onEstablishConnectionSuccess:()=>{e(me(a,!0))},onEnableZeniAccountClick:()=>{e(K(a,"zeni_accounts"))},onUpdateZeniAccountClick:(n,i,l)=>{e(l==="paymentAccount"?_e(n,i,"zeni_accounts","account_setup"):ve("account_setup",n,i))},onUpdatePrimaryFundingAccount:(n,i)=>{e(ke(a,"account_setup",n,i))},onEnableZeniAccountSuccess:()=>{t("../",{relative:"path"})},onBackClick:()=>{c?.companyZeniAccountInfo?.info?.isZeniAccountEnabled?t("../"):t("../../")},onNavigateToDashboard:()=>{t("../../dashboard")},onCompanyOfficerUpdated:(n,i)=>{e(Ae({officerType:n,fileIds:i}))},onSendForVerificationClick:n=>{e(R(a,n,"zeni_accounts",!0,!0,!0))},updateFilesEntity:n=>{e(te({files:n}))},onDeleteFile:n=>{e(ne(n))},onEditFileName:(n,i)=>{e(ee(n,i.split(".")[0]))}}})(et),kt=()=>{const e=J(),o=X(),t=Y(),{tenantEmailDomain:a}=W(),{useDynamicConfig:c}=ie(),n=ae(),i=Ie(n?.loggedInUserRoleMap),{configValue:l}=c(Q.zeniAccountsConfig),s=ye(l),[r,p]=C.useState(!1),[y,I]=C.useState(!1),d=E(f=>f.zeniAccountSetupViewState.fetchState),m=E(f=>F(f)),S=D.getSignedInUserTenant(a)?.companyId??m.companyId,v=D.getSignedInUser(),g=f=>{p(f)};if(v==null)throw Error("Can't access zeni bank account setup page without signing in...");if(C.useEffect(()=>{y||d!=="Not-Started"||S==null?y||d!=="Completed"||S==null||m.companyBillPayInfo?.info?.businessVerificationStatus?.code!=="pending_review"||t(me(S,!1,!0)):(I(!0),t(me(S,!0)))},[y,d,S,t]),m.companyZeniAccountInfo?.info?.isZeniAccountTOSAccepted===!1)return u.jsx(j,{to:"../promo"});{const f=P=>P.trackPageLoaded($.Event.zeniAccountsSetup);return u.jsxs(u.Fragment,{children:[u.jsx(se,{analytics:w,onLoad:P=>f(P)}),u.jsx(fe,{isAppContentDrawerOpen:r,handleDrawerToggle:g}),u.jsx(At,{navigate:e,location:o,companyId:S,currentTenant:m,isUserZeniAccountsAdmin:i,accountsPromoConfig:s,onClickMenuIcon:()=>{g(!0)}})]})}},_t=Fe.div`
22
22
  display: flex;
23
23
  height: 100vh;
24
24
  width: 100%;
@@ -26,4 +26,4 @@ import{j as u}from"./liveblocks-BEuWW_o5.js";import{l as J,u as X,h as Y,i as W,
26
26
  flex-direction: column;
27
27
  align-items: center;
28
28
  background-color: ${e=>e.theme.colors.grey4};
29
- `,vt=H(function(e,o){const t=F(e),a=D.getSignedInUser(),c=t.tenantId,n={userId:a?.userId??"",sessionId:a?.zeniSessionId??"",tenantId:c??""};return{internationalOnboardingDetails:$n(e),isReadonly:o.isFormReadonly,filesEndPoint:`${oe.fileMicroServiceBaseUrl}`,authParams:n,analytics:w}},function(e,o){const{navigate:t}=o;return{onFormDataChange:a=>{e(Hn(a))},onSubmitClick:()=>{e(Wn(o.companyId))},onCancelClick:()=>{t("../setup")},updateFilesEntity:a=>{e(te({files:a}))},onDeleteFile:a=>{e(ne(a))},onDeleteFileList:a=>{e(Qe(a))},onEditFileName:(a,c)=>{e(ee(a,c.split(".")[0]))}}})(nt),Pt=()=>{const e=J(),o=X(),t=Y(),[a,c]=C.useState(!1),[n,i]=C.useState(!1),[l,s]=C.useState(!1),{tenantEmailDomain:r}=W(),p=ae(),{useFeatureGate:y}=ie(),{isFeatureEnabled:I}=y(de.isBillPayLocalCurrencyFeatureEnabled),d=E(k=>k.internationalWireVerificationState.verificationFormFetchState.fetchState),m=E(k=>k.billPaySetupViewState.fetchState),S=E(k=>F(k)),v=Te(),g=S.companyId??D.getSignedInUserTenant(r)?.companyId,f=E(k=>Mn(k.companyState,S.companyId)),P=f?.company.companyBillPayInfo.internationalWireOnboardingStatus,A=P?.code==="onboarding_status_not_started"?void 0:"readonly";if(C.useEffect(()=>{a||d!=="Not-Started"||g==null||(c(!0),t(Zn(g)))},[a,d,g,t]),C.useEffect(()=>{n||m!=="Not-Started"||g==null||(i(!0),t(Z(g,!0)))},[m,n,g,t]),D.getSignedInUser()==null)throw Error("Can't access international verification without signing in...");const _=S.companyBillPayInfo?.info?.isBillPayTOSAccepted,b=k=>{s(k)};return _===!1?u.jsx(j,{to:"../promo"}):_===!0&&p?.loggedInUserRoleMap!=null?u.jsxs(_t,{children:[u.jsx(se,{analytics:w,onLoad:k=>(h=>h.trackPageLoaded($.Event.billPayBusinessVerification,void 0))(k)}),Ve(o)?u.jsx(fe,{isAppContentDrawerOpen:l,handleDrawerToggle:b}):null,u.jsx(vt,{navigate:e,location:o,companyId:g,analytics:w,currentTenant:S,roleMap:p.loggedInUserRoleMap,isFormReadonly:A,isLocalCurrencyEnabled:I})]}):u.jsx(Ue,{fetchState:"In-Progress",style:{backgroundColor:v.colors.grey5}})},Et=H(function(){return{}},function(e,o){const{companyId:t,productType:a}=o;return{onEventReceived:c=>{switch(c){case"bill-pay-set-up-verification-update":case"bill-pay-wise-setup":switch(a){case"reimbursement":e(pe(t,!0,!0));break;case"zeni_accounts":e(me(t,!0,!0));break;case"charge_cards":e(le(t,!0,!0));break;case"zeni_treasury":e(Ce(t,!0,!0));break;default:e(Z(t,!0,!0))}}}}})(tt(e=>{const{isBillPayAdminLevelAccess:o,isUserHasOnlyBillPayAccess:t,isReimbursementAdminLevelAccess:a,isZeniAccountAdminLevelAccess:c,isTreasuryAdminLevelAccess:n,isChargeCardAdminLevelAccess:i,isUserHasOnlyCardAccess:l,productType:s,type:r}=e;switch(s){case"bill_pay":switch(r){case"verification":return o?u.jsx(Be,{productType:s}):t?u.jsx(j,{to:"../"}):u.jsx(R,{});case"international-wire":return o?u.jsx(Pt,{}):t?u.jsx(j,{to:"../"}):u.jsx(R,{});default:return o?u.jsx(ct,{}):t?u.jsx(j,{to:"../"}):u.jsx(R,{})}case"reimbursement":return r==="verification"?a?u.jsx(Be,{productType:s}):u.jsx(R,{}):a?u.jsx(ft,{}):u.jsx(R,{});case"zeni_accounts":return r==="verification"?c?u.jsx(Be,{productType:"zeni_accounts"}):u.jsx(R,{}):c?u.jsx(kt,{}):u.jsx(R,{});case"zeni_treasury":return n===!0?u.jsx(Ct,{}):u.jsx(R,{});case"charge_cards":return r==="verification"?i?u.jsx(Be,{productType:"charge_cards"}):l?u.jsx(j,{to:"../"}):u.jsx(R,{}):i?u.jsx(pt,{}):l?u.jsx(j,{to:"../"}):u.jsx(R,{})}}));function ea(e){const{tenantEmailDomain:o}=W(),t=E(c=>F(c)).companyId??D.getSignedInUserTenant(o)?.companyId,a={events:t!=null?[`private-encrypted-${t}.bill-pay-set-up-verification-update`,`private-encrypted-${t}.bill-pay-wise-setup`]:[],eventCallback:(c,n,i)=>{i.onEventReceived(c)}};if(D.getSignedInUser()==null)throw Error("Can't access setup details page without signing in...");return u.jsx(Et,{...e,companyId:t,...a})}export{Qt as A,Jt as P,ea as S,Gt as a,qt as b,ut as c,dt as d,rt as e,zt as f,Zt as g,Ht as h,Kt as i,Xt as j,Wt as k,$t as l,Lt as m,Mt as n,Rt as p,Yt as s};
29
+ `,vt=H(function(e,o){const t=F(e),a=D.getSignedInUser(),c=t.tenantId,n={userId:a?.userId??"",sessionId:a?.zeniSessionId??"",tenantId:c??""};return{internationalOnboardingDetails:$n(e),isReadonly:o.isFormReadonly,filesEndPoint:`${oe.fileMicroServiceBaseUrl}`,authParams:n,analytics:w}},function(e,o){const{navigate:t}=o;return{onFormDataChange:a=>{e(Hn(a))},onSubmitClick:()=>{e(Wn(o.companyId))},onCancelClick:()=>{t("../setup")},updateFilesEntity:a=>{e(te({files:a}))},onDeleteFile:a=>{e(ne(a))},onDeleteFileList:a=>{e(Qe(a))},onEditFileName:(a,c)=>{e(ee(a,c.split(".")[0]))}}})(nt),Pt=()=>{const e=J(),o=X(),t=Y(),[a,c]=C.useState(!1),[n,i]=C.useState(!1),[l,s]=C.useState(!1),{tenantEmailDomain:r}=W(),p=ae(),{useFeatureGate:y}=ie(),{isFeatureEnabled:I}=y(de.isBillPayLocalCurrencyFeatureEnabled),d=E(k=>k.internationalWireVerificationState.verificationFormFetchState.fetchState),m=E(k=>k.billPaySetupViewState.fetchState),S=E(k=>F(k)),v=Te(),g=S.companyId??D.getSignedInUserTenant(r)?.companyId,f=E(k=>Mn(k.companyState,S.companyId)),P=f?.company.companyBillPayInfo.internationalWireOnboardingStatus,A=P?.code==="onboarding_status_not_started"?void 0:"readonly";if(C.useEffect(()=>{a||d!=="Not-Started"||g==null||(c(!0),t(Zn(g)))},[a,d,g,t]),C.useEffect(()=>{n||m!=="Not-Started"||g==null||(i(!0),t(Z(g,!0)))},[m,n,g,t]),D.getSignedInUser()==null)throw Error("Can't access international verification without signing in...");const _=S.companyBillPayInfo?.info?.isBillPayTOSAccepted,b=k=>{s(k)};return _===!1?u.jsx(j,{to:"../promo"}):_===!0&&p?.loggedInUserRoleMap!=null?u.jsxs(_t,{children:[u.jsx(se,{analytics:w,onLoad:k=>(h=>h.trackPageLoaded($.Event.billPayBusinessVerification,void 0))(k)}),Ve(o)?u.jsx(fe,{isAppContentDrawerOpen:l,handleDrawerToggle:b}):null,u.jsx(vt,{navigate:e,location:o,companyId:g,analytics:w,currentTenant:S,roleMap:p.loggedInUserRoleMap,isFormReadonly:A,isLocalCurrencyEnabled:I})]}):u.jsx(Ue,{fetchState:"In-Progress",style:{backgroundColor:v.colors.grey5}})},Et=H(function(){return{}},function(e,o){const{companyId:t,productType:a}=o;return{onEventReceived:c=>{switch(c){case"bill-pay-set-up-verification-update":case"bill-pay-wise-setup":switch(a){case"reimbursement":e(pe(t,!0,!0));break;case"zeni_accounts":e(me(t,!0,!0));break;case"charge_cards":e(le(t,!0,!0));break;case"zeni_treasury":e(Ce(t,!0,!0));break;default:e(Z(t,!0,!0))}}}}})(tt(e=>{const{isBillPayAdminLevelAccess:o,isUserHasOnlyBillPayAccess:t,isReimbursementAdminLevelAccess:a,isZeniAccountAdminLevelAccess:c,isTreasuryAdminLevelAccess:n,isChargeCardAdminLevelAccess:i,isUserHasOnlyCardAccess:l,productType:s,type:r}=e;switch(s){case"bill_pay":switch(r){case"verification":return o?u.jsx(Be,{productType:s}):t?u.jsx(j,{to:"../"}):u.jsx(z,{});case"international-wire":return o?u.jsx(Pt,{}):t?u.jsx(j,{to:"../"}):u.jsx(z,{});default:return o?u.jsx(ct,{}):t?u.jsx(j,{to:"../"}):u.jsx(z,{})}case"reimbursement":return r==="verification"?a?u.jsx(Be,{productType:s}):u.jsx(z,{}):a?u.jsx(ft,{}):u.jsx(z,{});case"zeni_accounts":return r==="verification"?c?u.jsx(Be,{productType:"zeni_accounts"}):u.jsx(z,{}):c?u.jsx(kt,{}):u.jsx(z,{});case"zeni_treasury":return n===!0?u.jsx(Ct,{}):u.jsx(z,{});case"charge_cards":return r==="verification"?i?u.jsx(Be,{productType:"charge_cards"}):l?u.jsx(j,{to:"../"}):u.jsx(z,{}):i?u.jsx(pt,{}):l?u.jsx(j,{to:"../"}):u.jsx(z,{})}}));function ea(e){const{tenantEmailDomain:o}=W(),t=E(c=>F(c)).companyId??D.getSignedInUserTenant(o)?.companyId,a={events:t!=null?[`private-encrypted-${t}.bill-pay-set-up-verification-update`,`private-encrypted-${t}.bill-pay-wise-setup`]:[],eventCallback:(c,n,i)=>{i.onEventReceived(c)}};if(D.getSignedInUser()==null)throw Error("Can't access setup details page without signing in...");return u.jsx(Et,{...e,companyId:t,...a})}export{Qt as A,Jt as P,ea as S,Gt as a,Kt as b,ut as c,dt as d,rt as e,Rt as f,Zt as g,Ht as h,qt as i,Xt as j,Wt as k,$t as l,Lt as m,Mt as n,zt as p,Yt as s};
@@ -0,0 +1 @@
1
+ import{j as f}from"./liveblocks-BNlilBXq.js";import{a as u,b as T,q as A}from"./sentry-CH2pQ4tM.js";import{h as z,l as D,g as c,u as J,N as M,n as O}from"./core-BeBBWfga.js";import{u as P,z as s,m as j,f as E,O as F,g as _,h as B,J as N,i as V,M as $,j as v}from"./index-DWCyzMUX.js";import{eQ as q,Jl as Q,Jm as W,eU as G,fm as H,Jr as K,fL as R,cU as X,Js as b,Jt as Y,Ju as Z,bT as y}from"./zeni-epic-state-5fEaVO5b.js";import"./mui-CnlqDSRv.js";import{u as ee}from"./useDeviceId-W860NCQ9.js";import{f as te}from"./analyticsHelper-Dc1kU1of.js";import{t as ne}from"./getLocaleForTenant-CXwRfDGi.js";import"./recharts-C5E4pGR4.js";import"./analytics-DYzLSwIZ.js";import"./plaid-CBNEU__p.js";import"./dnd-UF85x-t5.js";import"./stripe-DMRn4zHo.js";import"./lottie-DbxhFPB1.js";import"./lexical-C_ylRY16.js";import"./pdf-Dp2xnkno.js";import"./utils-C2zbYn9G.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]="19470acf-36a9-417f-9d2b-c5c0a5f208b7",t._sentryDebugIdIdentifier="sentry-dbid-19470acf-36a9-417f-9d2b-c5c0a5f208b7")}catch{}})();const ie=O(function(t,i){const d=t.tenantState.fetchState,g=t.tenantState.sendEmailMagicLinkFetchState,{magicLinkExpired:n,magicLinkAlreadyUsed:a,magicLinkExpiredEmail:l}=i;return{googleClientId:v.googleClientId,microsoftClientId:v.microsoftClientId,signInError:t.tenantState.error?.error,fetchState:d,sendMagicLinkStatus:g,magicLinkExpired:n,magicLinkAlreadyUsed:a,magicLinkExpiredEmail:l}},function(t,i){const{location:d,navigate:g}=i;return console.warn(JSON.stringify(window.location)),{onOAuthError:(n,a)=>{A({message:`OAuth error from provider ${a} with error ${n}`,level:"error",tags:{authProvider:a,errorType:"zeni.login.error"},extra:{error:n,windowLocation:window.location.href}})},onOAuthSuccess:(n,a)=>{const l=a==="google"?window.location.origin:window.location.origin+window.location.pathname;t(Z({authCode:n,oauthProvider:a,appType:"web",redirectUri:y(l),sourceUri:y(d.state!=null?d.state.origin:"")}))},getSignedInUser:()=>s.getSignedInUser(),onSignedInCallback:()=>{const n=d.state?.origin;n&&n!=="/"?g(n,{replace:!0}):window.open(window.location.origin,"_self")},sendMagicLink:n=>{const{deviceId:a}=i;a!=null&&(s.saveMagicLinkEmail(n),t(Y(n,a)))},clearSignInError:()=>{t(b())}}})($),ae=T.memo(ie);function ve({setTenantEmailDomain:t}){const i=z(),d=D(),{clearAllLoading:g}=P(),n=s.getSignedInUser();u.useLayoutEffect(()=>{g()},[g]);const a=ee(),l=c(e=>e.tenantState.magicLinkCodeVerifier),{sendEmailMagicLinkFetchState:h,accountLocked:U,accountUnlockTime:k}=c(e=>e.tenantState),p=c(e=>e.tenantState.fetchState),L=c(e=>e.tenantState.activeTenantFetchState.fetchState),S=c(e=>e.tenantState.signInState),o=c(e=>e.tenantState.loggedInUser),r=c(e=>q(e)),I=c(e=>Q(e)),m=J(),w=j().mode,C=m.state?.magicLinkExpired,x=m.state?.magicLinkAlreadyUsed;if(u.useEffect(()=>{h.fetchState==="Completed"&&l!=null&&(E.trackSignInLinkSent(),s.saveMagicLinkCodeVerifier(l))},[h.fetchState,l]),u.useEffect(()=>{t(void 0)},[]),u.useEffect(()=>{S!=="In-Progress"||p!=="Completed"&&L!=="Completed"||o?.zeniSessionId==null||r==null||(s.savePayNowInfoTooltip(!0,o.zeniSessionId),s.saveSignedInUserWithSession(o,o.zeniSessionId),s.saveSignedInUserTenants(W(I.tenantsInOrder),o.zeniSessionId),G(o.userId,o.zeniSessionId,r.tenantId),i(H(r.tenantId)),s.saveActiveTenantDomainForUser(r.tenantEmailDomain),i(K("Completed")),F.updateAppLocaleID(ne(r)),te(o,r,w,void 0,I.tenantsInOrder),R().then(()=>{const e=V();e!=null&&_(e)}),setTimeout(()=>{E.trackLogin(B.Event.loginSuccess,o.authProvider??"google",X(r.productSettings))},2e3))},[S,p,L,o,r,I,w,m.state,i]),S==="In-Progress"&&p==="Completed"&&o?.zeniSessionId!=null&&r!=null||n!=null){const e=m.state?.origin??"/";return f.jsx(M,{to:e,state:{...m.state,origin:""}})}return f.jsxs(f.Fragment,{children:[f.jsx(ae,{magicLinkExpired:!!C,magicLinkAlreadyUsed:!!x,magicLinkExpiredEmail:s.getMagicLinkEmail()??void 0,location:m,navigate:d,deviceId:a??void 0,showEmailLogin:!0}),U===!0&&k!=null?f.jsx(N,{onClose:()=>i(b()),unlockDate:k}):null]})}export{ve as default};
@@ -0,0 +1,9 @@
1
+ import{j as s}from"./liveblocks-BNlilBXq.js";import{a as n}from"./sentry-CH2pQ4tM.js";import{h as u,u as m,l as p,N as g}from"./core-BeBBWfga.js";import{z as c,B as y,t as h,f as d,h as b}from"./index-DWCyzMUX.js";import{fQ as x,fR as I,JJ as j}from"./zeni-epic-state-5fEaVO5b.js";import{n as w}from"./mui-CnlqDSRv.js";import"./recharts-C5E4pGR4.js";import"./analytics-DYzLSwIZ.js";import"./plaid-CBNEU__p.js";import"./dnd-UF85x-t5.js";import"./stripe-DMRn4zHo.js";import"./lottie-DbxhFPB1.js";import"./lexical-C_ylRY16.js";import"./pdf-Dp2xnkno.js";import"./utils-C2zbYn9G.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]="a7a5119d-a465-4b08-819e-7d0c1c6408ca",e._sentryDebugIdIdentifier="sentry-dbid-a7a5119d-a465-4b08-819e-7d0c1c6408ca")}catch{}})();function U(){const e=u(),t=m(),a=p(),i=n.useRef(!1),f=c.isSignedIn(),r=t.state?.message==="logout",o=r||f;return n.useEffect(()=>{o&&!i.current&&(i.current=!0,setTimeout(()=>{try{c.clearAll(),e(x()),e(I(!1)),j(),h.reset(),d.trackLogout(b.Event.logoutSuccess),d.resetUserIdentity()}catch(l){console.error("Error during sign out:",l)}finally{r||a("/signin/auth",{replace:!0})}},0))},[o,r]),o?s.jsx(v,{children:s.jsx(y,{fetchState:"In-Progress"})}):s.jsx(g,{to:"../",replace:!0})}const v=w.div`
2
+ display: flex;
3
+ height: 100vh;
4
+ width: 100%;
5
+ flex: 1 1 auto;
6
+ flex-direction: column;
7
+ align-items: center;
8
+ background-color: ${e=>e.theme.colors.grey4};
9
+ `;export{U as default};
@@ -1,4 +1,4 @@
1
- import{j as u}from"./liveblocks-BEuWW_o5.js";import{a as g}from"./sentry-DsHW_1mX.js";import{l as _,h as v,u as z,g as b,i as Z,n as M}from"./core-lbYY5woS.js";import{z as Q,C as O,j as p,_ as V,R as W,c as q,e as H,cN as J,n as f,p as X}from"./index-CR1sBuly.js";import{eQ as Y,QA as R,Ge as E,QB as A,Qw as aa,FG as S,QC as ea,FK as I,Fd as ta,Gf as B,QD as w,gQ as sa,G5 as oa,Ga as na,FZ as ia,FX as F,Gb as la,FU as ra,QE as ca,QF as ka,QG as da,QH as ua,QI as m,ec as pa,QJ as ma,QK as Ta}from"./zeni-epic-state-DsxPZxrE.js";import{n as ga}from"./mui-hUAh7HgW.js";import{u as fa}from"./useAskAiCfoHostNavButtonProps-D2I_ptqP.js";import{M as Ga}from"./MobileAppDrawer-Ccfg2tLY.js";import"./recharts-aApoEySM.js";import"./analytics-BpTmj6-G.js";import"./plaid-DtmQg7la.js";import"./dnd-BBkXCQMv.js";import"./stripe-DMRn4zHo.js";import"./lottie-DW3oQVJC.js";import"./lexical-BoKYrzBU.js";import"./pdf-D4eIZozg.js";import"./utils-AZPawxk4.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]="310d9a66-d15a-4e61-95f4-9f3d1fa8c0f1",e._sentryDebugIdIdentifier="sentry-dbid-310d9a66-d15a-4e61-95f4-9f3d1fa8c0f1")}catch{}})();const ha=ga.div`
1
+ import{j as d}from"./liveblocks-BNlilBXq.js";import{a as g}from"./sentry-CH2pQ4tM.js";import{l as U,h as _,u as z,g as b,i as Z,n as q}from"./core-BeBBWfga.js";import{z as Q,a as M,I as p,Z as O,v as V,f as W,h as H,cN as J,q as f,p as X}from"./index-DWCyzMUX.js";import{eQ as Y,QA as R,Ge as E,QB as A,Qw as aa,FG as S,QC as ea,FK as I,Fd as ta,Gf as B,QD as w,gQ as sa,G5 as oa,Ga as na,FZ as ia,FX as F,Gb as la,FU as ra,QE as ca,QF as ka,QG as ua,QH as da,QI as m,ec as pa,QJ as ma,QK as Ta}from"./zeni-epic-state-5fEaVO5b.js";import{n as ga}from"./mui-CnlqDSRv.js";import{u as fa}from"./useAskAiCfoHostNavButtonProps-DbBvDdaC.js";import{M as Ga}from"./MobileAppDrawer-C1owD1l4.js";import"./recharts-C5E4pGR4.js";import"./analytics-DYzLSwIZ.js";import"./plaid-CBNEU__p.js";import"./dnd-UF85x-t5.js";import"./stripe-DMRn4zHo.js";import"./lottie-DbxhFPB1.js";import"./lexical-C_ylRY16.js";import"./pdf-Dp2xnkno.js";import"./utils-C2zbYn9G.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]="459a6c43-7c8f-45a0-a97e-d4591324c5f8",e._sentryDebugIdIdentifier="sentry-dbid-459a6c43-7c8f-45a0-a97e-d4591324c5f8")}catch{}})();const ha=ga.div`
2
2
  display: flex;
3
3
  min-height: 100%;
4
4
  width: 100%;
@@ -6,4 +6,4 @@ import{j as u}from"./liveblocks-BEuWW_o5.js";import{a as g}from"./sentry-DsHW_1m
6
6
  flex-direction: column;
7
7
  align-items: center;
8
8
  background-color: ${e=>e.theme.colors.grey4};
9
- `,Da=M(function(e,t){const o=R(e,t.isTaskTemplatesEnabled),{taskGroupId:c}=t,i=c!=null&&c!==""?{...o,taskGroupsWithTasksList:o.taskGroupsWithTasksList.map(l=>({...l,tasks:l.tasks.filter(a=>a.taskGroupIds.includes(c))})).filter(l=>l.tasks.length>0)}:o,d=aa(e),n=Q.isZeniUser();return{taskListView:i,tagListView:d,localData:i.localData,isTaskTemplatesEnabled:t.isTaskTemplatesEnabled,isZeniUser:n}},function(e,t){const{navigate:o,currentTenant:c,location:i,isTaskTemplatesEnabled:d}=t,{tenantEmailDomain:n}=c,{groupByKey:l}=t.uiState;return{onTaskManagementRowClick:a=>{const s=L(n,a),k=f(i.state?.pathnameStackToGoBack,i.pathname);o(s,{state:{pathnameStackToGoBack:k}})},onReloadTasks:()=>{e(E(!0,d))},onTabChange:a=>{e(ua(a))},onParentTaskClick:a=>{const s=L(n,a);window.open(s,"_blank","noopener")},bulkUpdateTasks:(a,s)=>{e(F(a,null,s))},onNewTaskClick:()=>{if(t.localData.defaultTaskGroupId!=null){const a=C(n,t.localData.defaultTaskGroupId),s=f(i.state?.pathnameStackToGoBack,i.pathname);o(a,{state:{pathnameStackToGoBack:s,message:"comingFromTaskListPage"}})}},onColumnSortConfigChanged:(a,s)=>{e(w({uiState:{sortKey:a,sortOrder:s}}))},onFiltersChange:a=>{e(da({filters:a}))},onSearchTextChanged:a=>{e(ka({searchText:a}))},onReloadCards:()=>{e(E(!0,d))},onBackClick:()=>{if(i.state?.message==="triggerBackClick"){const a=X(i.state?.pathnameStackToGoBack),s=a.poppedPathname??"../";o(s,{state:{pathnameStackToGoBack:a.newStack}})}else o("../")},updateLocalData:a=>{e(ca({localData:a}))},resetLocalData:()=>{e(A({taskGroupById:t.taskGroupState.taskGroupById}))},handleCreateGroup:a=>{e(ra(t.localData.newTaskGroupName,a))},assignGroupToTasks:a=>{e(F(t.localData.selectedTaskIds,a,la(t.uiState.groupByKey,a)))},onDeleteTaskGroup:a=>{e(ia(a))},onAddNewTaskToTaskGroup:a=>{if(t.localData.defaultTaskGroupId!=null){const s=ba(l,a);e(S({taskDetailLocalData:s}));const k=C(n,t.uiState.groupByKey==="groupName"?a:t.localData.defaultTaskGroupId),G=f(i.state?.pathnameStackToGoBack,i.pathname);o(k,{state:{pathnameStackToGoBack:G,message:"comingFromTaskListPage"}})}},onDragNDrop:(a,s)=>{e(na(t.localData.selectedTaskIds.length>0?t.localData.selectedTaskIds:[a],s))},onTaskGroupRename:(a,s)=>{e(oa(a,s))},onTimeSpentUpdate:(a,s)=>{e(B({task:a,updates:s}))},onShowToast:a=>{e(sa(a))},onGroupByFilterChange:a=>{e(w({uiState:{groupByKey:a}}))},updateTask:(a,s)=>{e(B({task:a,updates:s}))},onCreateTagClick:(a,s)=>{e(ta(a,s))},handleGroupTemplateClick:a=>{e(I(a,[]))},handleGroupTemplateTaskClick:(a,s)=>{e(I(a,[s]))},handleNewTaskInitialization:a=>{if(e(S({taskDetailLocalData:{...ea,name:a}})),t.localData.defaultTaskGroupId!=null){const s=C(n,t.localData.defaultTaskGroupId),k=f(i.state?.pathnameStackToGoBack,i.pathname);o(s,{state:{pathnameStackToGoBack:k,message:"comingFromTaskListPage"}})}},onTaskGroupNameClick:a=>{o(`/${n}/tasks/group/${a}`)},onQuickResponsesClick:()=>{o(`/${n}/tasks/quick-responses`)}}})(J);function Ka(){const e=_(),t=v(),o=z(),c=Q.getSignedInUser(),i=b(r=>Y(r)),{taskGroupId:d}=Z(),{useFeatureGate:n}=O(),{isFeatureEnabled:l}=n(p.isTaskTemplatesEnabled),{isFeatureEnabled:a}=n(p.isTaskCannedResponsesEnabled),{isFeatureEnabled:s}=n(p.isTaskCategorizationEnabled),{isFeatureEnabled:k}=n(p.isTaskBulkResolutionEnabled),{isFeatureEnabled:G}=n(p.isTaskGroupAssigneesEnabled),{isFeatureEnabled:x}=n(p.isTaskRecurringParentEnabled),[y,P]=g.useState(!1),[N,$]=g.useState(!1),h=b(r=>R(r,l)),D=b(r=>r.taskGroupState),T=h.fetchState,{isAiCfoAccessEnabled:j,onAskAiCfoClick:K}=fa({mobileExploreReferrer:"Task Checklist"});if(V({isDataReady:T==="Completed"}),g.useEffect(()=>{y||(P(!0),t(E(!1,l)))},[y,t]),g.useEffect(()=>{T==="Completed"&&t(A({taskGroupById:D.taskGroupById}))},[T,D.taskGroupById]),c==null)throw Error("Can't access task list page without signing in...");return u.jsxs(u.Fragment,{children:[T==="Completed"?u.jsx(W,{analytics:q,onLoad:r=>(U=>U.trackPageLoaded(H.Event.taskListPage))(r)}):null,u.jsxs(ha,{children:[u.jsx(Ga,{isAppContentDrawerOpen:N,handleDrawerToggle:r=>{$(r)}}),u.jsx(Da,{location:o,navigate:e,currentTenant:i,taskGroupId:d,taskGroupState:D,localData:h.localData,uiState:h.uiState,isTaskTemplatesEnabled:l,taskListFetchState:T,isTaskCategorizationEnabled:s,isTaskCannedResponsesEnabled:a,isTaskBulkResolutionEnabled:k,isTaskGroupAssigneesEnabled:G,isTaskRecurringParentEnabled:x,isAiCfoAccessEnabled:j,onAskAiCfoClick:K})]})]})}const L=(e,t)=>`/${e}/tasks/${encodeURIComponent(t)}`,C=(e,t)=>`/${e}/tasks/new/${t}`,ba=(e,t)=>{if(e==="assignee"){const o=t.split(",");return{...m.taskDetailLocalData,assignee:o}}if(e==="priority"){const o=pa(t);return{...m.taskDetailLocalData,priority:o}}if(e==="status"){const o=ma(t);return{...m.taskDetailLocalData,status:o}}if(e==="tag"){const o=t.split(",");return{...m.taskDetailLocalData,tagIds:o}}if(e==="dueDate"){const o=Ta(t);return{...m.taskDetailLocalData,dueDate:o}}return{...m.taskDetailLocalData}};export{Ka as default};
9
+ `,Da=q(function(e,t){const o=R(e,t.isTaskTemplatesEnabled),{taskGroupId:c}=t,i=c!=null&&c!==""?{...o,taskGroupsWithTasksList:o.taskGroupsWithTasksList.map(l=>({...l,tasks:l.tasks.filter(a=>a.taskGroupIds.includes(c))})).filter(l=>l.tasks.length>0)}:o,u=aa(e),n=Q.isZeniUser();return{taskListView:i,tagListView:u,localData:i.localData,isTaskTemplatesEnabled:t.isTaskTemplatesEnabled,isZeniUser:n}},function(e,t){const{navigate:o,currentTenant:c,location:i,isTaskTemplatesEnabled:u}=t,{tenantEmailDomain:n}=c,{groupByKey:l}=t.uiState;return{onTaskManagementRowClick:a=>{const s=L(n,a),k=f(i.state?.pathnameStackToGoBack,i.pathname);o(s,{state:{pathnameStackToGoBack:k}})},onReloadTasks:()=>{e(E(!0,u))},onTabChange:a=>{e(da(a))},onParentTaskClick:a=>{const s=L(n,a);window.open(s,"_blank","noopener")},bulkUpdateTasks:(a,s)=>{e(F(a,null,s))},onNewTaskClick:()=>{if(t.localData.defaultTaskGroupId!=null){const a=C(n,t.localData.defaultTaskGroupId),s=f(i.state?.pathnameStackToGoBack,i.pathname);o(a,{state:{pathnameStackToGoBack:s,message:"comingFromTaskListPage"}})}},onColumnSortConfigChanged:(a,s)=>{e(w({uiState:{sortKey:a,sortOrder:s}}))},onFiltersChange:a=>{e(ua({filters:a}))},onSearchTextChanged:a=>{e(ka({searchText:a}))},onReloadCards:()=>{e(E(!0,u))},onBackClick:()=>{if(i.state?.message==="triggerBackClick"){const a=X(i.state?.pathnameStackToGoBack),s=a.poppedPathname??"../";o(s,{state:{pathnameStackToGoBack:a.newStack}})}else o("../")},updateLocalData:a=>{e(ca({localData:a}))},resetLocalData:()=>{e(A({taskGroupById:t.taskGroupState.taskGroupById}))},handleCreateGroup:a=>{e(ra(t.localData.newTaskGroupName,a))},assignGroupToTasks:a=>{e(F(t.localData.selectedTaskIds,a,la(t.uiState.groupByKey,a)))},onDeleteTaskGroup:a=>{e(ia(a))},onAddNewTaskToTaskGroup:a=>{if(t.localData.defaultTaskGroupId!=null){const s=ba(l,a);e(S({taskDetailLocalData:s}));const k=C(n,t.uiState.groupByKey==="groupName"?a:t.localData.defaultTaskGroupId),G=f(i.state?.pathnameStackToGoBack,i.pathname);o(k,{state:{pathnameStackToGoBack:G,message:"comingFromTaskListPage"}})}},onDragNDrop:(a,s)=>{e(na(t.localData.selectedTaskIds.length>0?t.localData.selectedTaskIds:[a],s))},onTaskGroupRename:(a,s)=>{e(oa(a,s))},onTimeSpentUpdate:(a,s)=>{e(B({task:a,updates:s}))},onShowToast:a=>{e(sa(a))},onGroupByFilterChange:a=>{e(w({uiState:{groupByKey:a}}))},updateTask:(a,s)=>{e(B({task:a,updates:s}))},onCreateTagClick:(a,s)=>{e(ta(a,s))},handleGroupTemplateClick:a=>{e(I(a,[]))},handleGroupTemplateTaskClick:(a,s)=>{e(I(a,[s]))},handleNewTaskInitialization:a=>{if(e(S({taskDetailLocalData:{...ea,name:a}})),t.localData.defaultTaskGroupId!=null){const s=C(n,t.localData.defaultTaskGroupId),k=f(i.state?.pathnameStackToGoBack,i.pathname);o(s,{state:{pathnameStackToGoBack:k,message:"comingFromTaskListPage"}})}},onTaskGroupNameClick:a=>{o(`/${n}/tasks/group/${a}`)},onQuickResponsesClick:()=>{o(`/${n}/tasks/quick-responses`)}}})(J);function va(){const e=U(),t=_(),o=z(),c=Q.getSignedInUser(),i=b(r=>Y(r)),{taskGroupId:u}=Z(),{useFeatureGate:n}=M(),{isFeatureEnabled:l}=n(p.isTaskTemplatesEnabled),{isFeatureEnabled:a}=n(p.isTaskCannedResponsesEnabled),{isFeatureEnabled:s}=n(p.isTaskCategorizationEnabled),{isFeatureEnabled:k}=n(p.isTaskBulkResolutionEnabled),{isFeatureEnabled:G}=n(p.isTaskGroupAssigneesEnabled),{isFeatureEnabled:x}=n(p.isTaskRecurringParentEnabled),[y,P]=g.useState(!1),[N,$]=g.useState(!1),h=b(r=>R(r,l)),D=b(r=>r.taskGroupState),T=h.fetchState,{isAiCfoAccessEnabled:j,onAskAiCfoClick:v}=fa({mobileExploreReferrer:"Task Checklist"});if(O({isDataReady:T==="Completed"}),g.useEffect(()=>{y||(P(!0),t(E(!1,l)))},[y,t]),g.useEffect(()=>{T==="Completed"&&t(A({taskGroupById:D.taskGroupById}))},[T,D.taskGroupById]),c==null)throw Error("Can't access task list page without signing in...");return d.jsxs(d.Fragment,{children:[T==="Completed"?d.jsx(V,{analytics:W,onLoad:r=>(K=>K.trackPageLoaded(H.Event.taskListPage))(r)}):null,d.jsxs(ha,{children:[d.jsx(Ga,{isAppContentDrawerOpen:N,handleDrawerToggle:r=>{$(r)}}),d.jsx(Da,{location:o,navigate:e,currentTenant:i,taskGroupId:u,taskGroupState:D,localData:h.localData,uiState:h.uiState,isTaskTemplatesEnabled:l,taskListFetchState:T,isTaskCategorizationEnabled:s,isTaskCannedResponsesEnabled:a,isTaskBulkResolutionEnabled:k,isTaskGroupAssigneesEnabled:G,isTaskRecurringParentEnabled:x,isAiCfoAccessEnabled:j,onAskAiCfoClick:v})]})]})}const L=(e,t)=>`/${e}/tasks/${encodeURIComponent(t)}`,C=(e,t)=>`/${e}/tasks/new/${t}`,ba=(e,t)=>{if(e==="assignee"){const o=t.split(",");return{...m.taskDetailLocalData,assignee:o}}if(e==="priority"){const o=pa(t);return{...m.taskDetailLocalData,priority:o}}if(e==="status"){const o=ma(t);return{...m.taskDetailLocalData,status:o}}if(e==="tag"){const o=t.split(",");return{...m.taskDetailLocalData,tagIds:o}}if(e==="dueDate"){const o=Ta(t);return{...m.taskDetailLocalData,dueDate:o}}return{...m.taskDetailLocalData}};export{va as default};
@@ -1,4 +1,4 @@
1
- import{j as n}from"./liveblocks-BEuWW_o5.js";import se from"./NotFoundScreen-DdK7GyZ6.js";import{a as c}from"./sentry-DsHW_1mX.js";import{l as _,h as M,g,u as ne,i as oe,N as ie,n as re,o as ce,p as f}from"./core-lbYY5woS.js";import{Gi as O,Gl as le,Go as de,eQ as Z,Qw as H,FC as X,Fk as pe,G2 as ue,FX as ke,Qx as K,Qy as N,Fg as me,Fd as fe,qa as ge,p_ as he,kb as Se,Fs as Ie,Qz as Te,Fx as be,Fu as Ge,Fn as Ce,FH as Ee,FG as De}from"./zeni-epic-state-DsxPZxrE.js";import{z as E,cL as Fe,s as xe,C as ye,j as b,p as W,n as w,R as je,c as V,e as we,cM as ve,h as q,at as Re}from"./index-CR1sBuly.js";import{n as Be}from"./mui-hUAh7HgW.js";import{u as Pe}from"./useInitialThreadRequest-oMQ4nobf.js";import{M as Ue}from"./MobileAppDrawer-Ccfg2tLY.js";import Le from"./TaskListScreen-DgDHZCji.js";import"./recharts-aApoEySM.js";import"./analytics-BpTmj6-G.js";import"./plaid-DtmQg7la.js";import"./dnd-BBkXCQMv.js";import"./stripe-DMRn4zHo.js";import"./lottie-DW3oQVJC.js";import"./lexical-BoKYrzBU.js";import"./pdf-D4eIZozg.js";import"./utils-AZPawxk4.js";import"./useAskAiCfoHostNavButtonProps-D2I_ptqP.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]="191f66ed-7400-427a-a7f5-9afb58ef463c",e._sentryDebugIdIdentifier="sentry-dbid-191f66ed-7400-427a-a7f5-9afb58ef463c")}catch{}})();function $e(){const e=_(),t=M(),s=E.getSignedInUser(),{cannedResponses:u,fetchState:r,saveFetchState:d}=g(o=>o.cannedResponsesState),l=c.useCallback(()=>{t(O())},[t]),k=c.useCallback((o,h,S)=>{t(le({name:o,content:h,cannedResponseId:S}))},[t]),a=c.useCallback(o=>{t(de({cannedResponseId:o}))},[t]);if(s==null)throw Error("Can't access quick responses page without signing in...");return n.jsx(Fe,{cannedResponses:u,isLoading:r==="In-Progress"||r==="Not-Started",isSaving:d==="In-Progress",onBackClick:()=>e(-1),onDelete:a,onFetch:l,onSave:k})}let A,Q=[];const ze=re(function(e,t){const{location:s,taskGroupId:u}=t,r=K(e,t.taskId),d=Z(e),l=r.taskGroupId??u,k=l!=null?N(e.taskGroupState,l):void 0,a=E.getSignedInUser(),o=d.tenantId,h={userId:a?.userId??"",sessionId:a?.zeniSessionId??"",tenantId:o??""},S=H(e),{tenantEmailDomain:D}=d,G=r.recurringSourceTaskId,F=G!=null?`${q.appUrl}/${D}/tasks/${encodeURIComponent(G)}`:void 0;var I;return{taskDetailSelectorView:r,authParams:h,isZeniUser:E.isZeniUser(),userGroupList:((I=e.userGroupsState.userGroupByUserGroupId)!==A&&(A=I,Q=Object.values(I)),Q),isNewClicked:s.state?.message==="comingFromTaskListPage",filesEndPoint:Re.fileMicroServiceBaseUrl,companyName:t.currentTenant.companyName,companyId:t.currentTenant.companyId,currentUrl:`${q.appUrl}${t.location.pathname}`,cannedResponses:e.cannedResponsesState.cannedResponses,isCannedResponsesLoading:e.cannedResponsesState.fetchState==="In-Progress",recurringSourceTaskUrl:F,tagListView:S,taskGroupName:l!=null&&k!=null&&k.isDefault===!1?k.name:void 0,taskGroupList:e.taskGroupViewState.taskGroupsIds.map(p=>N(e.taskGroupState,p)).filter(p=>p!=null&&!p.isDeleted).map(p=>({id:p.id,name:p.name,isDefault:p.isDefault}))}},function(e,t){const{taskId:s,navigate:u,currentTenant:r,location:d,taskGroupId:l}=t,{tenantEmailDomain:k}=r;return{onSaveChangesToLocalStore:a=>{e(De({taskDetailLocalData:a,taskId:s}))},onSaveDetailClick:a=>{e(Ee(s,a??l))},onArchiveTaskClick:()=>{t.taskId!=null&&e(Ce(t.taskId))},onSnoozeTask:(a,o)=>{e(Ge(a,o))},onUnsnoozeTask:a=>{e(be(a))},onDismissClick:()=>{if(d.state?.message==="triggerBackClick"){const a=W(d.state?.pathnameStackToGoBack),o=a.poppedPathname??"../../dashboard";u(o,{state:{pathnameStackToGoBack:a.newStack}})}else{const a=v(k),o=w(d.state?.pathnameStackToGoBack,d.pathname);u(a,{state:{pathnameStackToGoBack:o}})}e(Te({taskId:s}))},onDeleteTaskClick:()=>{e(Ie(s))},updateFilesEntity:a=>{e(Se({files:a}))},onDeleteFile:a=>{e(he(a))},onEditFileName:(a,o)=>{e(ge(a,o.split(".")[0]))},onReloadTaskDetailPage:()=>{e(X(!1,s))},onCreateTagClick:a=>{e(fe(a,s))},onDeleteTagClick:a=>{e(me(a,s))},onFetchCannedResponses:()=>{e(O())},onManageTemplatesClick:()=>{u(`/${r.tenantEmailDomain}/tasks/quick-responses`)}}})(ve);function j(){const e=_(),t=M(),s=ne(),u=xe(),{taskId:r,taskGroupId:d}=oe(),l=g(i=>Z(i)),k=Pe(l?.companyId),{useFeatureGate:a}=ye(),{isFeatureEnabled:o}=a(b.isTaskSnoozeEnabled),{isFeatureEnabled:h}=a(b.isTaskVisibilityEnabled),{isFeatureEnabled:S}=a(b.isTaskCannedResponsesEnabled),{isFeatureEnabled:D}=a(b.isTaskRecurringParentEnabled),{isFeatureEnabled:G}=a(b.isTaskGroupAssigneesEnabled),[F,I]=c.useState(!1),[p,Y]=c.useState(!1),[R,J]=c.useState(!1),[B,ee]=c.useState(!1),[P,x]=c.useState(!1),T=c.useRef(!1),C=g(i=>i.taskListState.updateTasksFetchState.fetchState),U=g(i=>H(i)),L=g(i=>i.taskGroupViewState.fetchState);c.useEffect(()=>{p||(Y(!0),t(X(!1,r)))},[p,t]),c.useEffect(()=>{R||U.fetchState==="Completed"||(J(!0),t(pe()))},[R,t,U.fetchState]),c.useEffect(()=>{B||L==="Completed"||(ee(!0),t(ue()))},[B,t,L]);const ae=c.useCallback(()=>{r!=null&&(T.current=!1,t(ke([r],null,{isArchived:!1})),x(!0))},[t,r]);c.useEffect(()=>{if(P)if(C!=="In-Progress"){if(T.current){if(C==="Error")return x(!1),void(T.current=!1);if(C==="Completed"){x(!1),T.current=!1;const{tenantEmailDomain:i}=l;if(s.state?.message==="triggerBackClick"){const m=W(s.state?.pathnameStackToGoBack);e(m.poppedPathname??"../../dashboard",{state:{pathnameStackToGoBack:m.newStack}})}else{const m=v(i);e(m,{state:{pathnameStackToGoBack:w(s.state?.pathnameStackToGoBack,s.pathname)}})}}}}else T.current=!0},[P,C,l,s,e]);const $=g(i=>K(i,r)),y=$.fetchState,z=E.getSignedInUser();if(z==null)throw Error("Can't access task detail page without signing in...");if(y==="Error"&&$.error?.code===400){const{tenantEmailDomain:i}=l,m=v(i),te=w(s.state?.pathnameStackToGoBack,s.pathname);return n.jsx(ie,{to:m,state:{pathnameStackToGoBack:te}})}return n.jsxs(n.Fragment,{children:[y==="Completed"?n.jsx(je,{analytics:V,onLoad:i=>(m=>m.trackPageLoaded(we.Event.taskDetailPage))(i)}):null,n.jsxs(Ne,{children:[n.jsx(Ue,{isAppContentDrawerOpen:F,handleDrawerToggle:i=>{I(i)}}),n.jsx(ze,{analytics:V,currentTenant:l,handleZeniLogoClick:()=>{u.toggle()},initialOpenThreadRequest:k,location:s,loggedInUser:z,navigate:e,taskGroupId:d,taskId:r,taskDetailFetchState:y,onUnarchiveTaskClick:ae,isTaskSnoozeEnabled:o,isTaskVisibilityEnabled:h,isTaskCannedResponsesEnabled:S,isTaskRecurringParentEnabled:D,isTaskGroupAssigneesEnabled:G})]})]})}const Ne=Be.div`
1
+ import{j as n}from"./liveblocks-BNlilBXq.js";import se from"./NotFoundScreen-CDTENjn3.js";import{a as c}from"./sentry-CH2pQ4tM.js";import{l as _,h as M,g,u as ne,i as oe,N as ie,n as re,o as ce,p as f}from"./core-BeBBWfga.js";import{Gi as O,Gl as le,Go as de,eQ as Z,Qw as H,FC as X,Fk as pe,G2 as ue,FX as ke,Qx as W,Qy as z,Fg as me,Fd as fe,qc as ge,q0 as he,kb as Se,Fs as Ie,Qz as Te,Fx as be,Fu as Ge,Fn as Ee,FH as Ce,FG as De}from"./zeni-epic-state-5fEaVO5b.js";import{z as C,cL as Fe,R as xe,a as ye,I as b,p as Y,q as w,v as je,f as N,h as we,cM as ve,j as V,at as Re}from"./index-DWCyzMUX.js";import{n as Be}from"./mui-CnlqDSRv.js";import{u as Pe}from"./useInitialThreadRequest-DS5F5QV2.js";import{M as Ue}from"./MobileAppDrawer-C1owD1l4.js";import Le from"./TaskListScreen-DuuYXRRr.js";import"./recharts-C5E4pGR4.js";import"./analytics-DYzLSwIZ.js";import"./plaid-CBNEU__p.js";import"./dnd-UF85x-t5.js";import"./stripe-DMRn4zHo.js";import"./lottie-DbxhFPB1.js";import"./lexical-C_ylRY16.js";import"./pdf-Dp2xnkno.js";import"./utils-C2zbYn9G.js";import"./useAskAiCfoHostNavButtonProps-DbBvDdaC.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]="39f72b5b-a8c0-47f1-94d3-9f7651f173da",e._sentryDebugIdIdentifier="sentry-dbid-39f72b5b-a8c0-47f1-94d3-9f7651f173da")}catch{}})();function $e(){const e=_(),t=M(),s=C.getSignedInUser(),{cannedResponses:u,fetchState:r,saveFetchState:d}=g(o=>o.cannedResponsesState),l=c.useCallback(()=>{t(O())},[t]),k=c.useCallback((o,h,S)=>{t(le({name:o,content:h,cannedResponseId:S}))},[t]),a=c.useCallback(o=>{t(de({cannedResponseId:o}))},[t]);if(s==null)throw Error("Can't access quick responses page without signing in...");return n.jsx(Fe,{cannedResponses:u,isLoading:r==="In-Progress"||r==="Not-Started",isSaving:d==="In-Progress",onBackClick:()=>e(-1),onDelete:a,onFetch:l,onSave:k})}let A,Q=[];const qe=re(function(e,t){const{location:s,taskGroupId:u}=t,r=W(e,t.taskId),d=Z(e),l=r.taskGroupId??u,k=l!=null?z(e.taskGroupState,l):void 0,a=C.getSignedInUser(),o=d.tenantId,h={userId:a?.userId??"",sessionId:a?.zeniSessionId??"",tenantId:o??""},S=H(e),{tenantEmailDomain:D}=d,G=r.recurringSourceTaskId,F=G!=null?`${V.appUrl}/${D}/tasks/${encodeURIComponent(G)}`:void 0;var I;return{taskDetailSelectorView:r,authParams:h,isZeniUser:C.isZeniUser(),userGroupList:((I=e.userGroupsState.userGroupByUserGroupId)!==A&&(A=I,Q=Object.values(I)),Q),isNewClicked:s.state?.message==="comingFromTaskListPage",filesEndPoint:Re.fileMicroServiceBaseUrl,companyName:t.currentTenant.companyName,companyId:t.currentTenant.companyId,currentUrl:`${V.appUrl}${t.location.pathname}`,cannedResponses:e.cannedResponsesState.cannedResponses,isCannedResponsesLoading:e.cannedResponsesState.fetchState==="In-Progress",recurringSourceTaskUrl:F,tagListView:S,taskGroupName:l!=null&&k!=null&&k.isDefault===!1?k.name:void 0,taskGroupList:e.taskGroupViewState.taskGroupsIds.map(p=>z(e.taskGroupState,p)).filter(p=>p!=null&&!p.isDeleted).map(p=>({id:p.id,name:p.name,isDefault:p.isDefault}))}},function(e,t){const{taskId:s,navigate:u,currentTenant:r,location:d,taskGroupId:l}=t,{tenantEmailDomain:k}=r;return{onSaveChangesToLocalStore:a=>{e(De({taskDetailLocalData:a,taskId:s}))},onSaveDetailClick:a=>{e(Ce(s,a??l))},onArchiveTaskClick:()=>{t.taskId!=null&&e(Ee(t.taskId))},onSnoozeTask:(a,o)=>{e(Ge(a,o))},onUnsnoozeTask:a=>{e(be(a))},onDismissClick:()=>{if(d.state?.message==="triggerBackClick"){const a=Y(d.state?.pathnameStackToGoBack),o=a.poppedPathname??"../../dashboard";u(o,{state:{pathnameStackToGoBack:a.newStack}})}else{const a=v(k),o=w(d.state?.pathnameStackToGoBack,d.pathname);u(a,{state:{pathnameStackToGoBack:o}})}e(Te({taskId:s}))},onDeleteTaskClick:()=>{e(Ie(s))},updateFilesEntity:a=>{e(Se({files:a}))},onDeleteFile:a=>{e(he(a))},onEditFileName:(a,o)=>{e(ge(a,o.split(".")[0]))},onReloadTaskDetailPage:()=>{e(X(!1,s))},onCreateTagClick:a=>{e(fe(a,s))},onDeleteTagClick:a=>{e(me(a,s))},onFetchCannedResponses:()=>{e(O())},onManageTemplatesClick:()=>{u(`/${r.tenantEmailDomain}/tasks/quick-responses`)}}})(ve);function j(){const e=_(),t=M(),s=ne(),u=xe(),{taskId:r,taskGroupId:d}=oe(),l=g(i=>Z(i)),k=Pe(l?.companyId),{useFeatureGate:a}=ye(),{isFeatureEnabled:o}=a(b.isTaskSnoozeEnabled),{isFeatureEnabled:h}=a(b.isTaskVisibilityEnabled),{isFeatureEnabled:S}=a(b.isTaskCannedResponsesEnabled),{isFeatureEnabled:D}=a(b.isTaskRecurringParentEnabled),{isFeatureEnabled:G}=a(b.isTaskGroupAssigneesEnabled),[F,I]=c.useState(!1),[p,J]=c.useState(!1),[R,K]=c.useState(!1),[B,ee]=c.useState(!1),[P,x]=c.useState(!1),T=c.useRef(!1),E=g(i=>i.taskListState.updateTasksFetchState.fetchState),U=g(i=>H(i)),L=g(i=>i.taskGroupViewState.fetchState);c.useEffect(()=>{p||(J(!0),t(X(!1,r)))},[p,t]),c.useEffect(()=>{R||U.fetchState==="Completed"||(K(!0),t(pe()))},[R,t,U.fetchState]),c.useEffect(()=>{B||L==="Completed"||(ee(!0),t(ue()))},[B,t,L]);const ae=c.useCallback(()=>{r!=null&&(T.current=!1,t(ke([r],null,{isArchived:!1})),x(!0))},[t,r]);c.useEffect(()=>{if(P)if(E!=="In-Progress"){if(T.current){if(E==="Error")return x(!1),void(T.current=!1);if(E==="Completed"){x(!1),T.current=!1;const{tenantEmailDomain:i}=l;if(s.state?.message==="triggerBackClick"){const m=Y(s.state?.pathnameStackToGoBack);e(m.poppedPathname??"../../dashboard",{state:{pathnameStackToGoBack:m.newStack}})}else{const m=v(i);e(m,{state:{pathnameStackToGoBack:w(s.state?.pathnameStackToGoBack,s.pathname)}})}}}}else T.current=!0},[P,E,l,s,e]);const $=g(i=>W(i,r)),y=$.fetchState,q=C.getSignedInUser();if(q==null)throw Error("Can't access task detail page without signing in...");if(y==="Error"&&$.error?.code===400){const{tenantEmailDomain:i}=l,m=v(i),te=w(s.state?.pathnameStackToGoBack,s.pathname);return n.jsx(ie,{to:m,state:{pathnameStackToGoBack:te}})}return n.jsxs(n.Fragment,{children:[y==="Completed"?n.jsx(je,{analytics:N,onLoad:i=>(m=>m.trackPageLoaded(we.Event.taskDetailPage))(i)}):null,n.jsxs(ze,{children:[n.jsx(Ue,{isAppContentDrawerOpen:F,handleDrawerToggle:i=>{I(i)}}),n.jsx(qe,{analytics:N,currentTenant:l,handleZeniLogoClick:()=>{u.toggle()},initialOpenThreadRequest:k,location:s,loggedInUser:q,navigate:e,taskGroupId:d,taskId:r,taskDetailFetchState:y,onUnarchiveTaskClick:ae,isTaskSnoozeEnabled:o,isTaskVisibilityEnabled:h,isTaskCannedResponsesEnabled:S,isTaskRecurringParentEnabled:D,isTaskGroupAssigneesEnabled:G})]})]})}const ze=Be.div`
2
2
  display: flex;
3
3
  min-height: 100%;
4
4
  width: 100%;
@@ -1 +1 @@
1
- import{j as t}from"./liveblocks-BEuWW_o5.js";import i from"./NotFoundScreen-DdK7GyZ6.js";import{T as r}from"./TransactionDetailScreen-Dz99_JkB.js";import"./sentry-DsHW_1mX.js";import{o as a,p as o}from"./core-lbYY5woS.js";import"./zeni-epic-state-DsxPZxrE.js";import"./recharts-aApoEySM.js";import"./index-CR1sBuly.js";import"./mui-hUAh7HgW.js";import"./analytics-BpTmj6-G.js";import"./plaid-DtmQg7la.js";import"./dnd-BBkXCQMv.js";import"./stripe-DMRn4zHo.js";import"./lottie-DW3oQVJC.js";import"./lexical-BoKYrzBU.js";import"./pdf-D4eIZozg.js";import"./utils-AZPawxk4.js";import"./useAskAiCfoHostNavButtonProps-D2I_ptqP.js";import"./decodeURIComponentSafe-Bt7TpCfB.js";import"./routePaths-BoWQ8YXQ.js";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},n=new e.Error().stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="8f33aac6-3389-4f99-92e2-514bb2135525",e._sentryDebugIdIdentifier="sentry-dbid-8f33aac6-3389-4f99-92e2-514bb2135525")}catch{}})();function k(){return t.jsxs(a,{children:[t.jsx(o,{path:"/:transactionTypeEncoded/:transactionId",element:t.jsx(r,{})}),t.jsx(o,{path:"/:transactionTypeEncoded/:transactionId/page-not-found",element:t.jsx(i,{})}),t.jsx(o,{path:"/:transactionTypeEncoded/:transactionId/vendor/create",element:t.jsx(r,{})}),t.jsx(o,{path:"/*",element:t.jsx(r,{})})]})}export{k as default};
1
+ import{j as t}from"./liveblocks-BNlilBXq.js";import i from"./NotFoundScreen-CDTENjn3.js";import{T as r}from"./TransactionDetailScreen-CUNFX6ex.js";import"./sentry-CH2pQ4tM.js";import{o as a,p as o}from"./core-BeBBWfga.js";import"./zeni-epic-state-5fEaVO5b.js";import"./recharts-C5E4pGR4.js";import"./index-DWCyzMUX.js";import"./mui-CnlqDSRv.js";import"./analytics-DYzLSwIZ.js";import"./plaid-CBNEU__p.js";import"./dnd-UF85x-t5.js";import"./stripe-DMRn4zHo.js";import"./lottie-DbxhFPB1.js";import"./lexical-C_ylRY16.js";import"./pdf-Dp2xnkno.js";import"./utils-C2zbYn9G.js";import"./useAskAiCfoHostNavButtonProps-DbBvDdaC.js";import"./decodeURIComponentSafe-OtMMCMcE.js";import"./routePaths-aWjSXoc2.js";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},n=new e.Error().stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="8f33aac6-3389-4f99-92e2-514bb2135525",e._sentryDebugIdIdentifier="sentry-dbid-8f33aac6-3389-4f99-92e2-514bb2135525")}catch{}})();function k(){return t.jsxs(a,{children:[t.jsx(o,{path:"/:transactionTypeEncoded/:transactionId",element:t.jsx(r,{})}),t.jsx(o,{path:"/:transactionTypeEncoded/:transactionId/page-not-found",element:t.jsx(i,{})}),t.jsx(o,{path:"/:transactionTypeEncoded/:transactionId/vendor/create",element:t.jsx(r,{})}),t.jsx(o,{path:"/*",element:t.jsx(r,{})})]})}export{k as default};
@@ -1,5 +1,5 @@
1
- import{j as k}from"./liveblocks-BEuWW_o5.js";import{a as d}from"./sentry-DsHW_1mX.js";import{h as G,g as S,u as re,l as le,i as de,N as Ge,n as je}from"./core-lbYY5woS.js";import{bn as $e,eQ as q,cQ as ue,bv as me,pR as Q,Kz as w,LA as pe,LB as Y,KZ as he,jO as fe,LC as ge,L2 as J,L3 as Z,kD as Se,Hz as X,Kt as _,jI as Te,jG as ye,jS as He,LD as Me,LE as We,tR as N,jN as ve,GR as Ee,cV as Ke,cW as qe,LF as Qe,Ks as Ye,LG as Je,tV as Ze,LH as Xe,LI as ea,LJ as aa,LK as ta,LL as na,jR as oa,LM as sa,LN as ia,Ku as ca,LO as ra,LP as la,LQ as da,GL as ua,Gz as ma,H1 as pa,jT as ha,HA as ie,GI as fa}from"./zeni-epic-state-DsxPZxrE.js";import{z as De,C as ee,j as L,aN as be,m as ga,K as Sa,aO as Ta,w as ya,p as W,I as va,aP as Ea,n as K,_ as Da,c as Ce,aQ as ba,at as Ca,a1 as M}from"./index-CR1sBuly.js";import{n as Ia,S as ka,D as La}from"./mui-hUAh7HgW.js";import{u as Aa}from"./useAskAiCfoHostNavButtonProps-D2I_ptqP.js";import{d as Ie}from"./decodeURIComponentSafe-Bt7TpCfB.js";import{h as ke,g as Ua,e as _a,c as xa}from"./routePaths-BoWQ8YXQ.js";import{t as Va}from"./utils-AZPawxk4.js";(function(){try{var a=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},e=new a.Error().stack;e&&(a._sentryDebugIds=a._sentryDebugIds||{},a._sentryDebugIds[e]="f625425e-4487-4c86-9bcd-58be4e9d0bc7",a._sentryDebugIdIdentifier="sentry-dbid-f625425e-4487-4c86-9bcd-58be4e9d0bc7")}catch{}})();const ae=()=>{const a=De.getSignedInUser(),{useFeatureGate:e}=ee(),{isFeatureEnabled:s}=e(L.isChainOfThoughtEnabled);return d.useMemo(()=>$e(a)&&s,[a,s])};function Le(a){if(a!=null){if("customer"in a&&a.customer!=null){const{customer:e}=a;return{id:e.id,name:e.name,logo:e.logo,type:"customer",zeniId:e.id,qboId:e.id}}if("vendor"in a&&a.vendor!=null){const{vendor:e}=a;return{id:e.id,name:e.name,logo:e.logo,type:"vendor",zeniId:e.id,qboId:e.id}}}}function Ya(a,e){const s=G(),{useFeatureGate:t,useDynamicConfig:n}=ee(),o=S(u=>q(u)),i=o.userRole.includes("charge_card_user")||o.userRole.includes("charge_card_admin"),l=o.userRole!=null&&ue(o.userRole),g=o.userRole!=null&&me(o.userRole),{isFeatureEnabled:T}=t(L.isVendorBulkUpdateOnTransactionEnabled),{isFeatureEnabled:C}=t(L.isExpenseAutomationEnabled),{configValue:h}=n(be.enableUncategorizedExpenseCategory),f=h?.uncategorized_expense_category_enabled===!0,A=ae(),y=d.useMemo(()=>({id:a,type:Q(e)}),[a,e]),m=S(u=>w(u,y)),b=S(u=>{const R=w(u,y)?.transactionDetailLocalData.vendorUpdates?.id;return R==null?"Not-Started":u.transactionVendorViewState.editVendorStateById[R]?.saveStatus.fetchState??"Not-Started"}),p=d.useMemo(()=>m?.fetchState==="Completed"?Le(m?.transaction):void 0,[m?.fetchState,m?.transaction]),v=S(u=>{if(p!=null)return pe(u.customerIncomeState,u.vendorExpenseState,u.trendState,p,"month")}),U=S(u=>Y(u)),x=S(u=>{if(p!=null)return he(u.trendWithTransactionsState,p,"TransactionDetail")}),j=o.company?.companyInfo.firstMonthOfFY??1,$=S(u=>fe(u.accountState,u.accountListState,"accountList")),[F,V]=d.useState(!1),[O,P]=d.useState(!1),[E,c]=d.useState(!1);d.useEffect(()=>{V(!1),P(!1),c(!1)},[a,e]);const H=d.useCallback(()=>{V(!1),P(!1)},[]),[D,I]=d.useState(!1),B=x?.selectedPeriod?.timePeriod;return d.useEffect(()=>{E||m==null||m.transaction==null||(s(ge({id:m.transaction.id,type:m.transaction.type})),c(!0)),p!=null&&(!i||l&&g===!1)&&(F?O||v==null||(P(!0),s(X(p,"TransactionDetail",{timeframe:"month",timePeriod:B??v}))):(s(J()),s(Z()),V(!0),s(Se(p))))},[s,E,m?.fetchState,m?.transaction,p,i,l,g,F,O,v,B]),d.useEffect(()=>{U.newVendorState?.vendorDetailLocalData?.vendorName!=null?I(!0):I(!1)},[U.newVendorState?.vendorDetailLocalData?.vendorName]),d.useEffect(()=>()=>{s(_("common"))},[s]),{currentTenant:o,loggedInUserHasCardUserOrAdminRole:i,isUserHasDashboardAccess:l,isUserHasInvestorOrBankerAccess:g,isVendorBulkUpdateOnTransactionEnabled:T,isExpenseAutomationEnabled:C,isUncategorizedExpenseCategoryEnabled:f,isChainOfThoughtEnabled:A,selectedTransaction:y,transactionDetail:m,vendorSaveStatus:b,tranEntity:p,defaultTrendTransactionTimePeriod:v,vendorViewDetails:U,uiState:x,firstMonthOfFY:j,uncategorizedAccounts:$,resetTrendIsFetchedStates:H,isCreateVendorDrawerOpen:D,setIsCreateVendorDrawerOpen:I}}const Pa={overlayWidth:new ya(100,100,58)},Ba=({isOpen:a,onSaveVendor:e,onSaveSuccess:s,onCancel:t,vendorViewDetails:n})=>{const o=ga(),i=Sa(),l=G(),g=S(h=>Y(h)),T=()=>{t()},C={vendorDetailView:n??g,onSaveSuccess:()=>{l(ye()),l(He("Not-Started")),s()},onSaveVendor:e,onCancelClick:T,saveVendorDetailLocalData:h=>{l(Te({vendorId:void 0,localData:h}))}};return k.jsx(La,{anchor:"right",open:a,PaperProps:{style:{width:Pa.overlayWidth.valuePercentage(i),boxShadow:"none"}},slotProps:{backdrop:{style:{backgroundColor:o.colors.black,opacity:.4,cursor:"pointer"}}},onClose:T,children:k.jsx(wa,{onClick:h=>h.stopPropagation(),children:k.jsx(Ta,{...C})})})},wa=Ia(ka)`
1
+ import{j as k}from"./liveblocks-BNlilBXq.js";import{a as d}from"./sentry-CH2pQ4tM.js";import{h as G,g as S,u as re,l as le,i as de,N as Ge,n as je}from"./core-BeBBWfga.js";import{bn as $e,eQ as K,cQ as ue,bv as me,pT as Q,Kz as w,LA as pe,LB as Y,KZ as he,jO as fe,LC as ge,L2 as Z,L3 as J,kD as Se,Hz as X,Kt as x,jI as Te,jG as ye,jS as He,LD as Me,LE as We,tR as N,jN as ve,GR as Ee,cV as qe,cW as Ke,LF as Qe,Ks as Ye,LG as Ze,tV as Je,LH as Xe,LI as ea,LJ as aa,LK as ta,LL as na,jR as oa,LM as sa,LN as ia,Ku as ca,LO as ra,LP as la,LQ as da,GL as ua,Gz as ma,H1 as pa,jT as ha,HA as ie,GI as fa}from"./zeni-epic-state-5fEaVO5b.js";import{z as De,a as ee,I as L,aN as be,m as ga,K as Sa,aO as Ta,w as ya,p as W,d as va,aP as Ea,q,Z as Da,f as Ce,aQ as ba,at as Ca,a1 as M}from"./index-DWCyzMUX.js";import{n as Ia,S as ka,D as La}from"./mui-CnlqDSRv.js";import{u as Aa}from"./useAskAiCfoHostNavButtonProps-DbBvDdaC.js";import{d as Ie}from"./decodeURIComponentSafe-OtMMCMcE.js";import{h as ke,g as Ua,e as xa,c as _a}from"./routePaths-aWjSXoc2.js";import{t as Va}from"./utils-C2zbYn9G.js";(function(){try{var a=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},e=new a.Error().stack;e&&(a._sentryDebugIds=a._sentryDebugIds||{},a._sentryDebugIds[e]="90238570-3ad4-4b12-88a4-1212c4813c95",a._sentryDebugIdIdentifier="sentry-dbid-90238570-3ad4-4b12-88a4-1212c4813c95")}catch{}})();const ae=()=>{const a=De.getSignedInUser(),{useFeatureGate:e}=ee(),{isFeatureEnabled:s}=e(L.isChainOfThoughtEnabled);return d.useMemo(()=>$e(a)&&s,[a,s])};function Le(a){if(a!=null){if("customer"in a&&a.customer!=null){const{customer:e}=a;return{id:e.id,name:e.name,logo:e.logo,type:"customer",zeniId:e.id,qboId:e.id}}if("vendor"in a&&a.vendor!=null){const{vendor:e}=a;return{id:e.id,name:e.name,logo:e.logo,type:"vendor",zeniId:e.id,qboId:e.id}}}}function Ya(a,e){const s=G(),{useFeatureGate:t,useDynamicConfig:n}=ee(),o=S(u=>K(u)),i=o.userRole.includes("charge_card_user")||o.userRole.includes("charge_card_admin"),l=o.userRole!=null&&ue(o.userRole),g=o.userRole!=null&&me(o.userRole),{isFeatureEnabled:T}=t(L.isVendorBulkUpdateOnTransactionEnabled),{isFeatureEnabled:C}=t(L.isExpenseAutomationEnabled),{configValue:h}=n(be.enableUncategorizedExpenseCategory),f=h?.uncategorized_expense_category_enabled===!0,A=ae(),y=d.useMemo(()=>({id:a,type:Q(e)}),[a,e]),m=S(u=>w(u,y)),b=S(u=>{const z=w(u,y)?.transactionDetailLocalData.vendorUpdates?.id;return z==null?"Not-Started":u.transactionVendorViewState.editVendorStateById[z]?.saveStatus.fetchState??"Not-Started"}),p=d.useMemo(()=>m?.fetchState==="Completed"?Le(m?.transaction):void 0,[m?.fetchState,m?.transaction]),v=S(u=>{if(p!=null)return pe(u.customerIncomeState,u.vendorExpenseState,u.trendState,p,"month")}),U=S(u=>Y(u)),_=S(u=>{if(p!=null)return he(u.trendWithTransactionsState,p,"TransactionDetail")}),j=o.company?.companyInfo.firstMonthOfFY??1,$=S(u=>fe(u.accountState,u.accountListState,"accountList")),[F,V]=d.useState(!1),[O,P]=d.useState(!1),[E,c]=d.useState(!1);d.useEffect(()=>{V(!1),P(!1),c(!1)},[a,e]);const H=d.useCallback(()=>{V(!1),P(!1)},[]),[D,I]=d.useState(!1),B=_?.selectedPeriod?.timePeriod;return d.useEffect(()=>{E||m==null||m.transaction==null||(s(ge({id:m.transaction.id,type:m.transaction.type})),c(!0)),p!=null&&(!i||l&&g===!1)&&(F?O||v==null||(P(!0),s(X(p,"TransactionDetail",{timeframe:"month",timePeriod:B??v}))):(s(Z()),s(J()),V(!0),s(Se(p))))},[s,E,m?.fetchState,m?.transaction,p,i,l,g,F,O,v,B]),d.useEffect(()=>{U.newVendorState?.vendorDetailLocalData?.vendorName!=null?I(!0):I(!1)},[U.newVendorState?.vendorDetailLocalData?.vendorName]),d.useEffect(()=>()=>{s(x("common"))},[s]),{currentTenant:o,loggedInUserHasCardUserOrAdminRole:i,isUserHasDashboardAccess:l,isUserHasInvestorOrBankerAccess:g,isVendorBulkUpdateOnTransactionEnabled:T,isExpenseAutomationEnabled:C,isUncategorizedExpenseCategoryEnabled:f,isChainOfThoughtEnabled:A,selectedTransaction:y,transactionDetail:m,vendorSaveStatus:b,tranEntity:p,defaultTrendTransactionTimePeriod:v,vendorViewDetails:U,uiState:_,firstMonthOfFY:j,uncategorizedAccounts:$,resetTrendIsFetchedStates:H,isCreateVendorDrawerOpen:D,setIsCreateVendorDrawerOpen:I}}const Pa={overlayWidth:new ya(100,100,58)},Ba=({isOpen:a,onSaveVendor:e,onSaveSuccess:s,onCancel:t,vendorViewDetails:n})=>{const o=ga(),i=Sa(),l=G(),g=S(h=>Y(h)),T=()=>{t()},C={vendorDetailView:n??g,onSaveSuccess:()=>{l(ye()),l(He("Not-Started")),s()},onSaveVendor:e,onCancelClick:T,saveVendorDetailLocalData:h=>{l(Te({vendorId:void 0,localData:h}))}};return k.jsx(La,{anchor:"right",open:a,PaperProps:{style:{width:Pa.overlayWidth.valuePercentage(i),boxShadow:"none"}},slotProps:{backdrop:{style:{backgroundColor:o.colors.black,opacity:.4,cursor:"pointer"}}},onClose:T,children:k.jsx(wa,{onClick:h=>h.stopPropagation(),children:k.jsx(Ta,{...C})})})},wa=Ia(ka)`
2
2
  display: flex;
3
3
  min-height: 100%;
4
4
  flex-direction: column;
5
- `,Fa=({closeDrawerHandler:a,overrideTransactionId:e,overrideTransactionType:s})=>{const t=re(),n=le(),o=G(),i=ae(),{transactionTypeEncoded:l,transactionId:g}=de(),T=e??g,C=s??Ie(l??"");let h;ke(T,C)&&(h={id:T,type:Q(C)});const f=h!=null?S(y=>w(y,h)):void 0,A=()=>{const y=W(t.state?.pathnameStackToGoBack),m=y.poppedPathname??((b=2)=>{let p="../";for(let v=0;v<b;v++)p=`${p}../`;return p})(1);n(m,{state:{pathnameStackToGoBack:y.newStack}})};return{transactionId:h,onSaveVendor:()=>{o(ve(h,void 0))},onSaveSuccess:()=>{if(f!=null&&f?.transaction&&f?.transactionDetailLocalData.vendorUpdates?.qboId!=null&&f?.transactionDetailLocalData.vendorUpdates?.id!=null){const y=f?.transactionDetailLocalData.vendorUpdates,m={id:f?.transactionDetailLocalData.vendorUpdates?.qboId,zeniId:f?.transactionDetailLocalData.vendorUpdates?.id,type:"vendor",name:y?.name,qboId:f?.transactionDetailLocalData.vendorUpdates?.qboId??""},b={transactionId:{id:f?.transaction?.id,type:f?.transaction?.type},transaction:f?.transaction,lineIds:f?.transaction?.lines?.map(p=>p.id)??[]};o(N(m,f?.transaction?.amount.amount,b,!1,!1,i))}A()},onCancel:()=>{h!=null&&o(Me({transactionId:h})),o(ye()),o(We()),a(!0),A()}}},Oa=je(function(a,e){const s=w(a,e.selectedTransaction);let t;s==null&&console.warn("Check if the you've selected the transaction before getting the details");const n=De.getSignedInUser(),o=a.tenantState.currentTenantId,i={userId:n?.userId??"",sessionId:n?.zeniSessionId??"",tenantId:o??""};s!=null&&s.fetchState==="Completed"&&s.transaction!=null&&e.entity!=null&&(t=Qe(a,e.entity,"TransactionDetail"));const l=a.entityAutoCompleteState.autoCompleteText.common,g=Ye(a,"common"),T=q(a);return{transactionDetail:s,transactionAttachmentEndpointToDownload:`${M}/transaction_attachment`,transactionAttachmentsEndpointToFetch:T.externalConnections?.accounting[0]?.connectionName==="netsuite"?`${M}/transaction_attachments_accounting_provider`:`${M}/transaction_attachments`,attachmentUploadEndpoint:`${Ca.accountMicroServiceBaseUrl}`,isCOTEnabled:e.isCOTEnabled,authParams:i,trendReport:t,analytics:Ce,uncategorizedAccounts:e.uncategorizedAccounts,autoCompleteData:{autoCompleteText:l,entityAutoCompleteView:g},isVendorBulkUpdateOnTransactionEnabled:e.isVendorBulkUpdateOnTransactionEnabled,isExpenseAutomationEnabled:e.isExpenseAutomationEnabled,isUncategorizedExpenseCategoryEnabled:e.isUncategorizedExpenseCategoryEnabled,enableBackClickOnSave:e.location.state?.message?.startsWith("comingFromScheduleDetails")}},function(a,e){const{isCOTEnabled:s}=e;return{onBackClick:()=>{if(a(_("common")),e.onBackClick!=null)return void e.onBackClick();const t=W(e.location.state?.pathnameStackToGoBack),n=t.poppedPathname??Ae(2);e.navigate(n,{state:{pathnameStackToGoBack:t.newStack,message:"comingFromTransactionDetail"}})},discardTransactionDetailLocalData:(t,n)=>{e.transaction!=null&&a(fa({transactionId:{id:e.transaction.id,type:e.transaction.type},vendorId:t,customerId:n}))},onTransactionClick:t=>{e.resetTrendIsFetchedStates(),a(J()),a(Z());const n=K(e.location.state?.pathnameStackToGoBack,e.location.pathname);e.navigate(xa(t,e.tenantEmailDomain),{state:{pathnameStackToGoBack:n}})},onTrendSelectedPeriodChange:t=>{if(t==null)e.defaultTrendTransactionTimePeriod!=null&&a(ie(e.entity,"TransactionDetail",{timeframe:"month",timePeriod:e.defaultTrendTransactionTimePeriod}));else{const n=t.currentTimePeriod==null?t.addTimePeriod:{startDate:t.addTimePeriod.startDate,endDate:t.currentTimePeriod.endDate};a(X(e.entity,"TransactionDetail",{timeframe:t.timeframe,timePeriod:t.addTimePeriod})),a(ie(e.entity,"TransactionDetail",{timeframe:t.timeframe,timePeriod:n}))}},onSaveUpdates:(t,n,o,i)=>{a(i===!0&&o!=null?ve(t,o,!0,e.isExpenseAutomationEnabled,e.isUncategorizedExpenseCategoryEnabled):ha({transactionId:t,isExpenseAutomationEnabled:e.isExpenseAutomationEnabled,cotTransactionTracking:n,isUncategorizedExpenseCategoryEnabled:e.isUncategorizedExpenseCategoryEnabled})),a(_("common"))},onUploadAttachmentAttachment:t=>{a(pa(t))},onDeleteAttachment:t=>{e.transaction!=null&&a(ma(t,{id:e.transaction.id,type:e.transaction.type}))},onSaveTransactionDetailLocalData:(t,n)=>{a(ua({transactionId:t,transactionLocalData:n}))},onUpdateAllChecked:(t,n,o,i)=>{e.transaction!=null&&a(da(e.selectedTransaction,e.transaction,t,n,o,i))},onResetLineItemsCategoryClassInLocalData:(t,n,o,i,l,g)=>{a(la(t,n,o,i,l,g))},onChangeCategoryClassWhenUpdateAllIsChecked:(t,n)=>{e.transaction!=null&&a(ra({id:e.transaction.id,type:e.transaction.type},e.transaction,t,n))},onSaveSuccess:()=>{const t=W(e.location.state?.pathnameStackToGoBack);if(t.poppedPathname!=null){const n=Va(t.poppedPathname,"/").split("/"),o=n[n.length-1];if(["uncategorized-income","uncategorized-expense","missing-receipts"].includes(o)&&e.navigate(t.poppedPathname,{state:{pathnameStackToGoBack:t.newStack}}),e.location.state?.message==="comingFromScheduleDetails"){const i=`${Ua(e.tenantEmailDomain)}`;e.navigate(i)}else if(e.location.state?.message==="comingFromScheduleDetailsFixedAssets"){const i=`${_a(e.tenantEmailDomain)}`;e.navigate(i)}}},onPageRefresh:()=>{a(Ee(e.selectedTransaction,!0))},autoCompleteActions:{onAutoCompleteInputChange:(t,n)=>{t.trim().length>=2?a(ca({searchString:t,entityType:n,searchOrigin:"common"})):t.trim().length===0&&a(_("common"))},onCancelAutoComplete:()=>{a(_("common"))}},onFetchRecommendationsForEntity:(t,n,o,i)=>{a(N(t,n,o,i,!1,s))},clearRecommendationForLineId:t=>{const{transactionId:n,transaction:o,lineId:i}=t;a(ia(n,o,i))},resetUpdateErrorState:()=>{const t={id:e.selectedTransaction.id,type:e.selectedTransaction.type};a(sa(t))},onSaveVendorInLocalData:(t,n,o,i,l)=>{if(a(oa({transactionId:t,vendorUpdates:n,entity:o})),n.id!=null&&o!=null&&i!=null&&l!=null&&a(N(o,i,l,!1,!1,s)),a(Te({vendorId:n.id?n.id:void 0,localData:{vendorName:n.name,vendorId:n.id?n.id:void 0}})),!n.id&&e.transaction!=null){const g=e.transaction,T=K(e.location.state?.pathnameStackToGoBack,e.location.pathname);e.navigate(`/${e.tenantEmailDomain}/transaction/${encodeURIComponent(g.type??"")}/${g.id}/vendor/create`,{state:{pathnameStackToGoBack:T}})}},onSaveCustomerInLocalData:(t,n,o,i,l)=>{a(na({transactionId:t,customerUpdates:n,entity:o})),n.id!=null&&o!=null&&i!=null&&l!=null&&a(N(o,i,l,!1,!1,s))},onUpdateAllTranactionsWithCurrentVendorChecked:t=>{a(ta({transactionId:{id:e.selectedTransaction.id,type:e.selectedTransaction.type},isUpdateEnabled:t}))},onClickUpdateVendorToAllLineItems:(t,n,o)=>{a(aa(t,n,o))},onResetVendorToAllLineItems:(t,n,o)=>{a(ea(t,n,o))},saveLatestSelectedEntity:(t,n,o)=>{a(Xe({transactionId:t,lineId:n,entity:o}))},updateVendorBulkRecommendationsFetchStatus:(t,n)=>{a(Ze(t,n))},setIsVendorUpdateAllChecked:(t,n,o)=>{a(Je(t,n,o))}}})(ba);function Ja(){const a=le(),e=G(),s=re(),{useFeatureGate:t,useDynamicConfig:n}=ee(),o=va(),i=S(r=>q(r)),l=i.userRole.includes("charge_card_user")||i.userRole.includes("charge_card_admin"),g=i.userRole!=null&&ue(i.userRole),T=i.userRole!=null&&me(i.userRole),{isFeatureEnabled:C}=t(L.isVendorBulkUpdateOnTransactionEnabled),{isFeatureEnabled:h}=t(L.isExpenseAutomationEnabled),{configValue:f}=n(be.enableUncategorizedExpenseCategory),A=f?.uncategorized_expense_category_enabled===!0,{tenantEmailDomain:y,transactionTypeEncoded:m,transactionId:b}=de(),[p,v]=d.useState(!1),U=Ie(m??""),x=ke(b,U),j=S(r=>r.transactionVendorViewState),$=ae(),{isFeatureEnabled:F}=t(L.isTransactionCommentingEnabled),{isFeatureEnabled:V}=t(L.isProjectsTransactionsEnabled),O=o?.currentTenant?.companyId,P=o?.currentTenant?.companyName;let E;x&&(E={id:b,type:Q(U)});const c=E!=null?S(r=>w(r,E)):void 0,H=c?.transactionDetailLocalData.vendorUpdates?.id!=null?j.editVendorStateById[c?.transactionDetailLocalData.vendorUpdates.id]?.saveStatus.fetchState:"Not-Started",D=c?.fetchState==="Completed"?Le(c?.transaction):void 0,I=S(r=>D!=null?pe(r.customerIncomeState,r.vendorExpenseState,r.trendState,D,"month"):void 0),B=S(r=>Y(r)),u=S(r=>D!=null?he(r.trendWithTransactionsState,D,"TransactionDetail"):void 0),R=i.company?.companyInfo.firstMonthOfFY??1,Ue=S(r=>fe(r.accountState,r.accountListState,"accountList")),[_e,te]=d.useState(!1),[xe,ne]=d.useState(!1),[Ve,Pe]=d.useState(!1),oe=()=>{te(!1),ne(!1)},Be=Ea();d.useEffect(()=>{if(E!=null&&c!=null&&c.fetchState==="Not-Started")e(Ee(E)),oe();else if(E!=null&&c!=null&&c.fetchState==="Error"){const r=K(s.state?.pathnameStackToGoBack,s.pathname),z={pathnameStackToGoBack:r,message:"pageNotFound",origin:"transaction_detail"};Be&&(z.message="expenseAutomation",z.origin="transaction_categorization",z.pathnameStackToGoBack=r),a("page-not-found",{replace:!0,state:z})}},[E]),d.useEffect(()=>{Ve||c==null||c.transaction==null||(e(ge({id:c.transaction.id,type:c.transaction.type})),Pe(!0)),D==null&&c?.fetchState==="Completed"&&ce(c?.transaction),D!=null&&(!l||g&&T===!1)&&(_e?xe||I==null||(ne(!0),e(X(D,"TransactionDetail",{timeframe:"month",timePeriod:u?.selectedPeriod?.timePeriod??I}))):(e(J()),e(Z()),ce(c?.transaction),te(!0),e(Se(D))))},[c?.fetchState,c?.transaction,I,l]),d.useEffect(()=>{B.newVendorState?.vendorDetailLocalData?.vendorName!=null?v(!0):v(!1)},[B.newVendorState?.vendorDetailLocalData?.vendorName]),d.useEffect(()=>()=>{e(_("common"))},[]);const we=[m,b].filter(r=>r!=null),{transactionId:se,onSaveVendor:Fe,onSaveSuccess:Oe,onCancel:Re}=Fa({closeDrawerHandler:r=>{v(!1),a(r?"../":"../..")}}),{isAiCfoAccessEnabled:ze,onAskAiCfoClick:Ne}=Aa({mobileExploreReferrer:"Transaction Details"});return Da({isDataReady:c?.fetchState==="Completed"}),x?k.jsxs(k.Fragment,{children:[se!=null&&p&&k.jsx(Ba,{isOpen:p,transactionId:se,onSaveVendor:Fe,onSaveSuccess:Oe,onCancel:Re}),k.jsx(Oa,{hideDeleteAttachment:!0,firstMonthOfFY:R,isDisabled:c?.transaction?.type==="transfer"&&o?.connectionName==="netsuite"?"readonly":void 0,tenantEmailDomain:y,location:s,navigate:a,selectedTransaction:E,entity:D,isCOTEnabled:$,defaultTrendTransactionTimePeriod:I,resetTrendIsFetchedStates:oe,transaction:c?.transaction,uncategorizedAccounts:Ue,vendorSaveStatus:H,isVendorBulkUpdateOnTransactionEnabled:C,isExpenseAutomationEnabled:h,isUncategorizedExpenseCategoryEnabled:A,isAiCfoAccessEnabled:ze,onAskAiCfoClick:Ne,isTransactionCommentingEnabled:F,isProjectsTransactionsEnabled:V,companyId:O,companyName:P})]}):k.jsx(Ge,{to:Ae(we.length)})}const Ae=(a=2)=>{let e="../";for(let s=0;s<a;s++)e=`${e}../`;return e},ce=a=>{if(a!=null){const{transactionCategory:e,transactionClass:s}=Ra(a),t=za(a);Ce.trackTransactionDetails(a.account?.accountId,a.account?.accountName,a.id,t,e.length>0?e:void 0,s.length>0?s:void 0,a.type,a.amount,a.memo,a.lines?.length??0,a.attachments?.map(n=>n.fileName))}},Ra=a=>{const e=[],s=[];return a.lines?.forEach(t=>{switch(t.type){case"transaction_with_account_and_class_line":case"transaction_with_product_or_service_line":case"journal_entry_transaction_line":case"linked_transaction_line":{const n=t;n!=null&&n.account!=null&&n.account.accountName?.length>0&&e.push(n.account.accountName),n.class!=null&&n.class.className?.length>0&&s.push(n.class.className);break}}}),{transactionCategory:e,transactionClass:s}},za=a=>Ke(a)===!0?a.customer?.name??"":qe(a)===!0?a.vendor?.name??"":a.memo!=null?a.memo:a.type;export{Ba as C,Ja as T,Fa as a,Oa as b,ae as c,Ya as u};
5
+ `,Fa=({closeDrawerHandler:a,overrideTransactionId:e,overrideTransactionType:s})=>{const t=re(),n=le(),o=G(),i=ae(),{transactionTypeEncoded:l,transactionId:g}=de(),T=e??g,C=s??Ie(l??"");let h;ke(T,C)&&(h={id:T,type:Q(C)});const f=h!=null?S(y=>w(y,h)):void 0,A=()=>{const y=W(t.state?.pathnameStackToGoBack),m=y.poppedPathname??((b=2)=>{let p="../";for(let v=0;v<b;v++)p=`${p}../`;return p})(1);n(m,{state:{pathnameStackToGoBack:y.newStack}})};return{transactionId:h,onSaveVendor:()=>{o(ve(h,void 0))},onSaveSuccess:()=>{if(f!=null&&f?.transaction&&f?.transactionDetailLocalData.vendorUpdates?.qboId!=null&&f?.transactionDetailLocalData.vendorUpdates?.id!=null){const y=f?.transactionDetailLocalData.vendorUpdates,m={id:f?.transactionDetailLocalData.vendorUpdates?.qboId,zeniId:f?.transactionDetailLocalData.vendorUpdates?.id,type:"vendor",name:y?.name,qboId:f?.transactionDetailLocalData.vendorUpdates?.qboId??""},b={transactionId:{id:f?.transaction?.id,type:f?.transaction?.type},transaction:f?.transaction,lineIds:f?.transaction?.lines?.map(p=>p.id)??[]};o(N(m,f?.transaction?.amount.amount,b,!1,!1,i))}A()},onCancel:()=>{h!=null&&o(Me({transactionId:h})),o(ye()),o(We()),a(!0),A()}}},Oa=je(function(a,e){const s=w(a,e.selectedTransaction);let t;s==null&&console.warn("Check if the you've selected the transaction before getting the details");const n=De.getSignedInUser(),o=a.tenantState.currentTenantId,i={userId:n?.userId??"",sessionId:n?.zeniSessionId??"",tenantId:o??""};s!=null&&s.fetchState==="Completed"&&s.transaction!=null&&e.entity!=null&&(t=Qe(a,e.entity,"TransactionDetail"));const l=a.entityAutoCompleteState.autoCompleteText.common,g=Ye(a,"common"),T=K(a);return{transactionDetail:s,transactionAttachmentEndpointToDownload:`${M}/transaction_attachment`,transactionAttachmentsEndpointToFetch:T.externalConnections?.accounting[0]?.connectionName==="netsuite"?`${M}/transaction_attachments_accounting_provider`:`${M}/transaction_attachments`,attachmentUploadEndpoint:`${Ca.accountMicroServiceBaseUrl}`,isCOTEnabled:e.isCOTEnabled,authParams:i,trendReport:t,analytics:Ce,uncategorizedAccounts:e.uncategorizedAccounts,autoCompleteData:{autoCompleteText:l,entityAutoCompleteView:g},isVendorBulkUpdateOnTransactionEnabled:e.isVendorBulkUpdateOnTransactionEnabled,isExpenseAutomationEnabled:e.isExpenseAutomationEnabled,isUncategorizedExpenseCategoryEnabled:e.isUncategorizedExpenseCategoryEnabled,enableBackClickOnSave:e.location.state?.message?.startsWith("comingFromScheduleDetails")}},function(a,e){const{isCOTEnabled:s}=e;return{onBackClick:()=>{if(a(x("common")),e.onBackClick!=null)return void e.onBackClick();const t=W(e.location.state?.pathnameStackToGoBack),n=t.poppedPathname??Ae(2);e.navigate(n,{state:{pathnameStackToGoBack:t.newStack,message:"comingFromTransactionDetail"}})},discardTransactionDetailLocalData:(t,n)=>{e.transaction!=null&&a(fa({transactionId:{id:e.transaction.id,type:e.transaction.type},vendorId:t,customerId:n}))},onTransactionClick:t=>{e.resetTrendIsFetchedStates(),a(Z()),a(J());const n=q(e.location.state?.pathnameStackToGoBack,e.location.pathname);e.navigate(_a(t,e.tenantEmailDomain),{state:{pathnameStackToGoBack:n}})},onTrendSelectedPeriodChange:t=>{if(t==null)e.defaultTrendTransactionTimePeriod!=null&&a(ie(e.entity,"TransactionDetail",{timeframe:"month",timePeriod:e.defaultTrendTransactionTimePeriod}));else{const n=t.currentTimePeriod==null?t.addTimePeriod:{startDate:t.addTimePeriod.startDate,endDate:t.currentTimePeriod.endDate};a(X(e.entity,"TransactionDetail",{timeframe:t.timeframe,timePeriod:t.addTimePeriod})),a(ie(e.entity,"TransactionDetail",{timeframe:t.timeframe,timePeriod:n}))}},onSaveUpdates:(t,n,o,i)=>{a(i===!0&&o!=null?ve(t,o,!0,e.isExpenseAutomationEnabled,e.isUncategorizedExpenseCategoryEnabled):ha({transactionId:t,isExpenseAutomationEnabled:e.isExpenseAutomationEnabled,cotTransactionTracking:n,isUncategorizedExpenseCategoryEnabled:e.isUncategorizedExpenseCategoryEnabled})),a(x("common"))},onUploadAttachmentAttachment:t=>{a(pa(t))},onDeleteAttachment:t=>{e.transaction!=null&&a(ma(t,{id:e.transaction.id,type:e.transaction.type}))},onSaveTransactionDetailLocalData:(t,n)=>{a(ua({transactionId:t,transactionLocalData:n}))},onUpdateAllChecked:(t,n,o,i)=>{e.transaction!=null&&a(da(e.selectedTransaction,e.transaction,t,n,o,i))},onResetLineItemsCategoryClassInLocalData:(t,n,o,i,l,g)=>{a(la(t,n,o,i,l,g))},onChangeCategoryClassWhenUpdateAllIsChecked:(t,n)=>{e.transaction!=null&&a(ra({id:e.transaction.id,type:e.transaction.type},e.transaction,t,n))},onSaveSuccess:()=>{const t=W(e.location.state?.pathnameStackToGoBack);if(t.poppedPathname!=null){const n=Va(t.poppedPathname,"/").split("/"),o=n[n.length-1];if(["uncategorized-income","uncategorized-expense","missing-receipts"].includes(o)&&e.navigate(t.poppedPathname,{state:{pathnameStackToGoBack:t.newStack}}),e.location.state?.message==="comingFromScheduleDetails"){const i=`${Ua(e.tenantEmailDomain)}`;e.navigate(i)}else if(e.location.state?.message==="comingFromScheduleDetailsFixedAssets"){const i=`${xa(e.tenantEmailDomain)}`;e.navigate(i)}}},onPageRefresh:()=>{a(Ee(e.selectedTransaction,!0))},autoCompleteActions:{onAutoCompleteInputChange:(t,n)=>{t.trim().length>=2?a(ca({searchString:t,entityType:n,searchOrigin:"common"})):t.trim().length===0&&a(x("common"))},onCancelAutoComplete:()=>{a(x("common"))}},onFetchRecommendationsForEntity:(t,n,o,i)=>{a(N(t,n,o,i,!1,s))},clearRecommendationForLineId:t=>{const{transactionId:n,transaction:o,lineId:i}=t;a(ia(n,o,i))},resetUpdateErrorState:()=>{const t={id:e.selectedTransaction.id,type:e.selectedTransaction.type};a(sa(t))},onSaveVendorInLocalData:(t,n,o,i,l)=>{if(a(oa({transactionId:t,vendorUpdates:n,entity:o})),n.id!=null&&o!=null&&i!=null&&l!=null&&a(N(o,i,l,!1,!1,s)),a(Te({vendorId:n.id?n.id:void 0,localData:{vendorName:n.name,vendorId:n.id?n.id:void 0}})),!n.id&&e.transaction!=null){const g=e.transaction,T=q(e.location.state?.pathnameStackToGoBack,e.location.pathname);e.navigate(`/${e.tenantEmailDomain}/transaction/${encodeURIComponent(g.type??"")}/${g.id}/vendor/create`,{state:{pathnameStackToGoBack:T}})}},onSaveCustomerInLocalData:(t,n,o,i,l)=>{a(na({transactionId:t,customerUpdates:n,entity:o})),n.id!=null&&o!=null&&i!=null&&l!=null&&a(N(o,i,l,!1,!1,s))},onUpdateAllTranactionsWithCurrentVendorChecked:t=>{a(ta({transactionId:{id:e.selectedTransaction.id,type:e.selectedTransaction.type},isUpdateEnabled:t}))},onClickUpdateVendorToAllLineItems:(t,n,o)=>{a(aa(t,n,o))},onResetVendorToAllLineItems:(t,n,o)=>{a(ea(t,n,o))},saveLatestSelectedEntity:(t,n,o)=>{a(Xe({transactionId:t,lineId:n,entity:o}))},updateVendorBulkRecommendationsFetchStatus:(t,n)=>{a(Je(t,n))},setIsVendorUpdateAllChecked:(t,n,o)=>{a(Ze(t,n,o))}}})(ba);function Za(){const a=le(),e=G(),s=re(),{useFeatureGate:t,useDynamicConfig:n}=ee(),o=va(),i=S(r=>K(r)),l=i.userRole.includes("charge_card_user")||i.userRole.includes("charge_card_admin"),g=i.userRole!=null&&ue(i.userRole),T=i.userRole!=null&&me(i.userRole),{isFeatureEnabled:C}=t(L.isVendorBulkUpdateOnTransactionEnabled),{isFeatureEnabled:h}=t(L.isExpenseAutomationEnabled),{configValue:f}=n(be.enableUncategorizedExpenseCategory),A=f?.uncategorized_expense_category_enabled===!0,{tenantEmailDomain:y,transactionTypeEncoded:m,transactionId:b}=de(),[p,v]=d.useState(!1),U=Ie(m??""),_=ke(b,U),j=S(r=>r.transactionVendorViewState),$=ae(),{isFeatureEnabled:F}=t(L.isTransactionCommentingEnabled),{isFeatureEnabled:V}=t(L.isProjectsTransactionsEnabled),O=o?.currentTenant?.companyId,P=o?.currentTenant?.companyName;let E;_&&(E={id:b,type:Q(U)});const c=E!=null?S(r=>w(r,E)):void 0,H=c?.transactionDetailLocalData.vendorUpdates?.id!=null?j.editVendorStateById[c?.transactionDetailLocalData.vendorUpdates.id]?.saveStatus.fetchState:"Not-Started",D=c?.fetchState==="Completed"?Le(c?.transaction):void 0,I=S(r=>D!=null?pe(r.customerIncomeState,r.vendorExpenseState,r.trendState,D,"month"):void 0),B=S(r=>Y(r)),u=S(r=>D!=null?he(r.trendWithTransactionsState,D,"TransactionDetail"):void 0),z=i.company?.companyInfo.firstMonthOfFY??1,Ue=S(r=>fe(r.accountState,r.accountListState,"accountList")),[xe,te]=d.useState(!1),[_e,ne]=d.useState(!1),[Ve,Pe]=d.useState(!1),oe=()=>{te(!1),ne(!1)},Be=Ea();d.useEffect(()=>{if(E!=null&&c!=null&&c.fetchState==="Not-Started")e(Ee(E)),oe();else if(E!=null&&c!=null&&c.fetchState==="Error"){const r=q(s.state?.pathnameStackToGoBack,s.pathname),R={pathnameStackToGoBack:r,message:"pageNotFound",origin:"transaction_detail"};Be&&(R.message="expenseAutomation",R.origin="transaction_categorization",R.pathnameStackToGoBack=r),a("page-not-found",{replace:!0,state:R})}},[E]),d.useEffect(()=>{Ve||c==null||c.transaction==null||(e(ge({id:c.transaction.id,type:c.transaction.type})),Pe(!0)),D==null&&c?.fetchState==="Completed"&&ce(c?.transaction),D!=null&&(!l||g&&T===!1)&&(xe?_e||I==null||(ne(!0),e(X(D,"TransactionDetail",{timeframe:"month",timePeriod:u?.selectedPeriod?.timePeriod??I}))):(e(Z()),e(J()),ce(c?.transaction),te(!0),e(Se(D))))},[c?.fetchState,c?.transaction,I,l]),d.useEffect(()=>{B.newVendorState?.vendorDetailLocalData?.vendorName!=null?v(!0):v(!1)},[B.newVendorState?.vendorDetailLocalData?.vendorName]),d.useEffect(()=>()=>{e(x("common"))},[]);const we=[m,b].filter(r=>r!=null),{transactionId:se,onSaveVendor:Fe,onSaveSuccess:Oe,onCancel:ze}=Fa({closeDrawerHandler:r=>{v(!1),a(r?"../":"../..")}}),{isAiCfoAccessEnabled:Re,onAskAiCfoClick:Ne}=Aa({mobileExploreReferrer:"Transaction Details"});return Da({isDataReady:c?.fetchState==="Completed"}),_?k.jsxs(k.Fragment,{children:[se!=null&&p&&k.jsx(Ba,{isOpen:p,transactionId:se,onSaveVendor:Fe,onSaveSuccess:Oe,onCancel:ze}),k.jsx(Oa,{hideDeleteAttachment:!0,firstMonthOfFY:z,isDisabled:c?.transaction?.type==="transfer"&&o?.connectionName==="netsuite"?"readonly":void 0,tenantEmailDomain:y,location:s,navigate:a,selectedTransaction:E,entity:D,isCOTEnabled:$,defaultTrendTransactionTimePeriod:I,resetTrendIsFetchedStates:oe,transaction:c?.transaction,uncategorizedAccounts:Ue,vendorSaveStatus:H,isVendorBulkUpdateOnTransactionEnabled:C,isExpenseAutomationEnabled:h,isUncategorizedExpenseCategoryEnabled:A,isAiCfoAccessEnabled:Re,onAskAiCfoClick:Ne,isTransactionCommentingEnabled:F,isProjectsTransactionsEnabled:V,companyId:O,companyName:P})]}):k.jsx(Ge,{to:Ae(we.length)})}const Ae=(a=2)=>{let e="../";for(let s=0;s<a;s++)e=`${e}../`;return e},ce=a=>{if(a!=null){const{transactionCategory:e,transactionClass:s}=za(a),t=Ra(a);Ce.trackTransactionDetails(a.account?.accountId,a.account?.accountName,a.id,t,e.length>0?e:void 0,s.length>0?s:void 0,a.type,a.amount,a.memo,a.lines?.length??0,a.attachments?.map(n=>n.fileName))}},za=a=>{const e=[],s=[];return a.lines?.forEach(t=>{switch(t.type){case"transaction_with_account_and_class_line":case"transaction_with_product_or_service_line":case"journal_entry_transaction_line":case"linked_transaction_line":{const n=t;n!=null&&n.account!=null&&n.account.accountName?.length>0&&e.push(n.account.accountName),n.class!=null&&n.class.className?.length>0&&s.push(n.class.className);break}}}),{transactionCategory:e,transactionClass:s}},Ra=a=>qe(a)===!0?a.customer?.name??"":Ke(a)===!0?a.vendor?.name??"":a.memo!=null?a.memo:a.type;export{Ba as C,Za as T,Fa as a,Oa as b,ae as c,Ya as u};
@@ -0,0 +1 @@
1
+ import{j as s}from"./liveblocks-BNlilBXq.js";import{l as Q,u as N,h as K,i as W,g as h,N as G,n as X,o as Pe,p as j}from"./core-BeBBWfga.js";import{eQ as U,py as ee,j0 as p,OY as te,Hq as De,bq as le,OZ as ve,jD as ae,K$ as ne,O_ as ue,O$ as Ee,bE as Y,Hm as ye,P0 as be,P1 as me,P2 as je,Hn as Ae,P3 as xe,P4 as pe,P5 as Me,P6 as ge,P7 as Le,P8 as Fe,P9 as fe,ID as Ce,bn as Be}from"./zeni-epic-state-5fEaVO5b.js";import{O as de,a as Z,I as _,f as w,cb as ce,q as H,p as oe,V as Oe,z as ze}from"./index-DWCyzMUX.js";import"./mui-CnlqDSRv.js";import{a as S}from"./sentry-CH2pQ4tM.js";import{w as se}from"./withTransactionSidePanel-Bsk-acAb.js";import{p as ie,c as re}from"./routePaths-aWjSXoc2.js";import{u as we}from"./utils-C2zbYn9G.js";import{d as v}from"./decodeURIComponentSafe-OtMMCMcE.js";import{Z as Ge}from"./ZeniAccountStatementScreen-BOPEKBSK.js";import"./recharts-C5E4pGR4.js";import"./analytics-DYzLSwIZ.js";import"./plaid-CBNEU__p.js";import"./dnd-UF85x-t5.js";import"./stripe-DMRn4zHo.js";import"./lottie-DbxhFPB1.js";import"./lexical-C_ylRY16.js";import"./pdf-Dp2xnkno.js";import"./useAskAiCfoHostNavButtonProps-DbBvDdaC.js";import"./TransactionDetailScreen-CUNFX6ex.js";(function(){try{var a=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},e=new a.Error().stack;e&&(a._sentryDebugIds=a._sentryDebugIds||{},a._sentryDebugIds[e]="e1f32005-3e23-44ea-8f23-e5e1a5107901",a._sentryDebugIdIdentifier="sentry-dbid-e1f32005-3e23-44ea-8f23-e5e1a5107901")}catch{}})();const _e=["uncategorized-income","uncategorized-expense","miscategorized-income","miscategorized-expense","missing-receipts"],J=a=>we(a),Re=X(function(a,e){const t=ve(a.transactionState,a.transactionListState,e.selectedAccount.period,e.selectedAccount.timeframe,J(e.selectedAccount.tranListType));return{title:e.selectedAccount.title,subTitle:e.selectedAccount.subTitle,timeframe:e.selectedAccount.timeframe,timePeriod:ne(e.selectedAccount.period),dataAvailableForPeriod:e.dataAvailableForPeriod,report:t,currentScrollYOffset:t.uiState?.scrollYOffset??0,isAccountingClassesEnabled:ae(a)}},function(a,e){return{onBackClick:()=>{const t=oe(e.location.state?.pathnameStackToGoBack),n=t.poppedPathname??"../../";e.navigate(n,{state:{pathnameStackToGoBack:t.newStack}})},onTimePeriodChange:(t,n,c)=>{e.closeSidePanel?.();const o=de.getLocalizedStrings(),l=J(e.selectedAccount.tranListType),u=qe(t,n,c,l,e.bookCloseDate);w.trackTransactionList(void 0,void 0,void 0,e.selectedAccount.title,void 0,!0),a(ue({uiState:{dateRange:u},type:J(e.selectedAccount.tranListType)})),a(De(l,p(u),!1,l==="missingReceipts"?o.uncategorizedTransactionList.missingReceipt.missingReceiptMinAmount:void 0)),e.onSelectedTimePeriodChange(p(u))},onTransactionItemClick:t=>{if(e.openTransactionPanel)return void e.openTransactionPanel(t.id,t.type);const n=re(t,e.tenantEmailDomain),c=H(e.location.state?.pathnameStackToGoBack,e.location.pathname);e.navigate(n,{state:{pathnameStackToGoBack:c}})},onTransactionListScroll:t=>{a(ue({uiState:{scrollYOffset:t},type:J(e.selectedAccount.tranListType)}))}}})(ce),q=se(function({...a}){const e=Q(),t=N(),n=K(),c=t.pathname.split("/").find(r=>_e.includes(r)),o=c??"uncategorized-expense",{tenantEmailDomain:l}=W(),u=de.getLocalizedStrings(),{accountType:m,title:D,subTitle:y}=$e(o),A="month",I=h(r=>U(r)),f=I.company?.companyInfo.firstMonthOfFY??1,{useFeatureGate:g}=Z(),{isFeatureEnabled:k}=g(_.isProjectsTransactionsEnabled),x=h(r=>ee(r))&&k,{dataAvailable:F,initialTimeframeTick:E}=Ve(o,f,I.bookCloseDate),[C,b]=S.useState(!1),[B,O]=S.useState(void 0),T=S.useMemo(()=>{const r=p(E);return{tranListType:o,accountType:te(m),title:D,subTitle:y,timeframe:A,period:r}},[o,A,m,F]);S.useEffect(()=>{if(!C&&T!=null){b(!0),w.trackTransactionList(void 0,void 0,void 0,T.title);const r=J(T.tranListType);n(De(r,T.period,!0,r==="missingReceipts"?u.uncategorizedTransactionList.missingReceipt.missingReceiptMinAmount:void 0))}},[C,T,n]);let M=T;return T!=null&&B!=null&&(M={...T,period:B}),c==null||M==null?s.jsx(G,{to:"../"}):s.jsx(Re,{firstMonthOfFY:f,tenantEmailDomain:l,location:t,useFixedPeriod:{timeframe:"month",numberOfPeriods:12},dataAvailableForPeriod:F,navigate:e,showProjectField:x,selectedAccount:M,referrerType:o,bookCloseDate:I.bookCloseDate,onSelectedTimePeriodChange:r=>O(r),...a})}),$e=a=>{let e="",t="";const n=de.getLocalizedStrings();switch(a){case"uncategorized-income":e="income",t=n.uncategorizedTransactionList.income.title;break;case"uncategorized-expense":e="expenses",t=n.uncategorizedTransactionList.expense.title;break;case"miscategorized-expense":e="expenses",t=n.miscategorizedTransactionList.expense.title;break;case"miscategorized-income":e="income",t=n.miscategorizedTransactionList.income.title;break;case"missing-receipts":t=n.uncategorizedTransactionList.missingReceipt.title}return{accountType:e,title:t,subTitle:""}},Ve=(a,e,t)=>{const n=le();let c=le().startOf("month").subtract(11,"month");return t!=null&&a!=="missing-receipts"?t.add(1,"day").isBefore(c)?{dataAvailable:{startDate:t.add(1,"day"),endDate:n},initialTimeframeTick:{startDate:c,endDate:n}}:(c=t.add(1,"day"),{dataAvailable:{startDate:c,endDate:n},initialTimeframeTick:{startDate:c,endDate:n}}):{dataAvailable:ie(5,e),initialTimeframeTick:{startDate:c,endDate:n}}},qe=(a,e,t,n,c)=>{let o=e;return n==="missingReceipts"||c==null?a.startDate.isBefore(e.startDate,t)?o={startDate:a.startDate,endDate:e.endDate}:a.startDate.isAfter(e.endDate,t)?o={startDate:e.startDate,endDate:a.endDate}:console.error(`Invalid addTimePeriod ${JSON.stringify(a)}`):o=a.startDate.isBefore(c,t)?{startDate:c.add(1,"day"),endDate:e.endDate}:{startDate:a.startDate,endDate:e.endDate},o},Je=X(function(a,e){const t=be(a.transactionState,a.transactionListState,e.selectedAccount.accountId,e.selectedAccount.accountType,e.selectedAccount.classId,e.selectedAccount.timeframe,e.selectedAccount.period);return{accountId:e.selectedAccount.accountId,accountType:e.selectedAccount.accountType,title:e.selectedAccount.title,timeframe:e.selectedAccount.timeframe,timePeriod:ne(e.selectedAccount.period),dataAvailableForPeriod:ie(5,e.firstMonthOfFY),report:t,currentScrollYOffset:t.uiState?.scrollYOffset??0,isAccountingClassesEnabled:ae(a)}},function(a,e){return{onBackClick:()=>{const t=oe(e.location.state?.pathnameStackToGoBack),n=t.poppedPathname??Se();e.navigate(n,{state:{pathnameStackToGoBack:t.newStack}})},onTimePeriodChange:(t,n,c)=>{e.closeSidePanel?.();let o=n;t.startDate.isBefore(n.startDate,c)?o={startDate:t.startDate,endDate:n.endDate}:t.startDate.isAfter(n.endDate,c)?o={startDate:n.startDate,endDate:t.endDate}:console.error(`Invalid addTimePeriod ${JSON.stringify(t)}`),w.trackTransactionList(e.selectedAccount.accountId,void 0,e.referrerType,e.selectedAccount.title,void 0,!0),a(me({accountId:e.selectedAccount.accountId,accountType:e.selectedAccount.accountType,classId:e.selectedAccount.classId,uiState:{dateRange:o}})),a(ye(e.selectedAccount.accountId,e.selectedAccount.accountType,e.selectedAccount.classId,p(o))),e.onSelectedTimePeriodChange(p(o))},onTransactionItemClick:t=>{if(e.openTransactionPanel)return void e.openTransactionPanel(t.id,t.type);const n=re(t,e.tenantEmailDomain),c=H(e.location.state?.pathnameStackToGoBack,e.location.pathname);e.navigate(n,{state:{pathnameStackToGoBack:c}})},onTransactionListScroll:t=>{a(me({accountId:e.selectedAccount.accountId,accountType:e.selectedAccount.accountType,classId:e.selectedAccount.classId,uiState:{scrollYOffset:t}}))}}})(ce),He=se(function({referrerType:a,...e}){const t=Q(),n=N(),c=K(),{tenantEmailDomain:o,accountTypeEncoded:l,accountIdEncoded:u,classIdEncoded:m,timeframe:D,startDate:y,endDate:A,titleEncoded:I}=W(),f=v(l??""),g=v(u??""),k=v(m??""),x=v(I??""),F=h(d=>Ee(d.transactionListState,g,f,k)),[E,C]=S.useState(!1),[b,B]=S.useState(void 0),O=h(d=>U(d)),T=O.company?.companyInfo.firstMonthOfFY??1,{useFeatureGate:M}=Z(),{isFeatureEnabled:r}=M(_.isProjectsTransactionsEnabled),R=h(d=>ee(d))&&r;let i;const z=Ne(f,g,k,D,y,A,x);if(z){const d={startDate:Y(y,"YYYY-MM-DD"),endDate:Y(A,"YYYY-MM-DD")},$=Ue(F?.dateRange,d);i={accountId:g,accountType:te(f),classId:k,title:x,timeframe:D,period:$}}S.useEffect(()=>{E||i==null||(C(!0),w.trackTransactionList(i.accountId,void 0,a,i.title),c(ye(i.accountId,i.accountType,i.classId,i.period)))},[E,i,c]);let L=i;i!=null&&b!=null&&(L={...i,period:b});const V=[l,u,m,D,y,A,I].filter(d=>d!=null);return z&&L!=null?s.jsx(Je,{firstMonthOfFY:T,tenantEmailDomain:o,location:n,navigate:t,showProjectField:R,selectedAccount:L,referrerType:a,onSelectedTimePeriodChange:d=>B(d),...e}):s.jsx(G,{to:Se(V.length)})}),Se=(a=7)=>{let e="../";for(let t=0;t<a;t++)e=`${e}../`;return e},Ne=(a,e,t,n,c,o,l)=>a!=null&&e!=null&&t!=null&&n!=null&&c!=null&&o!=null&&(n==="month"||n==="quarter")&&Y(c,"YYYY-MM-DD").isValid()&&Y(o,"YYYY-MM-DD").isValid()&&l!=null,Ue=(a,e)=>a!=null&&a.endDate.isSame(e.endDate,"day")&&a.startDate.isBefore(e.startDate,"day")?p(a):p(e),Ze=X(function(a,e){const t=xe(a.transactionState,a.transactionListState,e.selectedAccount.accountId,e.selectedAccount.accountType,e.selectedAccount.projectId,e.selectedAccount.timeframe,e.selectedAccount.period);return{accountId:e.selectedAccount.accountId,accountType:e.selectedAccount.accountType,title:e.selectedAccount.title,timeframe:e.selectedAccount.timeframe,timePeriod:ne(e.selectedAccount.period),dataAvailableForPeriod:ie(5,e.firstMonthOfFY),report:t,currentScrollYOffset:t.uiState?.scrollYOffset??0,isAccountingClassesEnabled:ae(a)}},function(a,e){return{onBackClick:()=>{const t=oe(e.location.state?.pathnameStackToGoBack),n=t.poppedPathname??he();e.navigate(n,{state:{pathnameStackToGoBack:t.newStack}})},onTimePeriodChange:(t,n,c)=>{e.closeSidePanel?.();let o=n;t.startDate.isBefore(n.startDate,c)?o={startDate:t.startDate,endDate:n.endDate}:t.startDate.isAfter(n.endDate,c)?o={startDate:n.startDate,endDate:t.endDate}:console.error(`Invalid addTimePeriod ${JSON.stringify(t)}`),w.trackTransactionList(e.selectedAccount.accountId,void 0,e.referrerType,e.selectedAccount.title,void 0,!0),a(pe({accountId:e.selectedAccount.accountId,accountType:e.selectedAccount.accountType,projectId:e.selectedAccount.projectId,uiState:{dateRange:o}})),a(Ae(e.selectedAccount.accountId,e.selectedAccount.accountType,e.selectedAccount.projectId,p(o))),e.onSelectedTimePeriodChange(p(o))},onTransactionItemClick:t=>{if(e.openTransactionPanel)return void e.openTransactionPanel(t.id,t.type);const n=re(t,e.tenantEmailDomain),c=H(e.location.state?.pathnameStackToGoBack,e.location.pathname);e.navigate(n,{state:{pathnameStackToGoBack:c}})},onTransactionListScroll:t=>{a(pe({accountId:e.selectedAccount.accountId,accountType:e.selectedAccount.accountType,projectId:e.selectedAccount.projectId,uiState:{scrollYOffset:t}}))}}})(ce),Qe=se(function({referrerType:a,...e}){const t=Q(),n=N(),c=K(),{tenantEmailDomain:o,accountTypeEncoded:l,accountIdEncoded:u,projectIdEncoded:m,timeframe:D,startDate:y,endDate:A,titleEncoded:I}=W(),f=v(l??""),g=v(u??""),k=v(m??""),x=v(I??""),F=h(d=>je(d.transactionListState,g,f,k)),[E,C]=S.useState(!1),[b,B]=S.useState(void 0),O=h(d=>U(d)),T=O.company?.companyInfo.firstMonthOfFY??1,{useFeatureGate:M}=Z(),{isFeatureEnabled:r}=M(_.isProjectsTransactionsEnabled),R=h(d=>ee(d))&&r;let i;const z=Ke(f,g,k,D,y,A,x);if(z){const d={startDate:Y(y,"YYYY-MM-DD"),endDate:Y(A,"YYYY-MM-DD")},$=We(F?.dateRange,d);i={accountId:g,accountType:te(f),projectId:k,title:x,timeframe:D,period:$}}S.useEffect(()=>{E||i==null||(C(!0),w.trackTransactionList(i.accountId,void 0,a,i.title),c(Ae(i.accountId,i.accountType,i.projectId,i.period)))},[E,i,c]);let L=i;i!=null&&b!=null&&(L={...i,period:b});const V=[l,u,m,D,y,A,I].filter(d=>d!=null);return z&&L!=null?s.jsx(Ze,{firstMonthOfFY:T,tenantEmailDomain:o,location:n,navigate:t,showProjectField:R,selectedAccount:L,referrerType:a,onSelectedTimePeriodChange:d=>B(d),...e}):s.jsx(G,{to:he(V.length)})}),he=(a=7)=>{let e="../";for(let t=0;t<a;t++)e=`${e}../`;return e},Ke=(a,e,t,n,c,o,l)=>a!=null&&e!=null&&t!=null&&n!=null&&c!=null&&o!=null&&(n==="month"||n==="quarter")&&Y(c,"YYYY-MM-DD").isValid()&&Y(o,"YYYY-MM-DD").isValid()&&l!=null,We=(a,e)=>a!=null&&a.endDate.isSame(e.endDate,"day")&&a.startDate.isBefore(e.startDate,"day")?p(a):p(e),Xe=X(function(a,e){const t=Le(a.transactionState,a.transactionListState,e.selectedAccount.accountId,e.selectedAccount.accountType,e.selectedAccount.timeframe,e.selectedAccount.period),n=t.account?.coaId,c=e.isConnectedAccountProviderUnit&&Fe(n??"");return{accountId:e.selectedAccount.accountId,accountType:e.selectedAccount.accountType,title:e.selectedAccount.title,timeframe:e.selectedAccount.timeframe,timePeriod:ne(e.selectedAccount.period),dataAvailableForPeriod:ie(5,e.firstMonthOfFY),report:t,currentScrollYOffset:t.uiState?.scrollYOffset??0,showStatementPageIcon:c,isAccountingClassesEnabled:ae(a)}},function(a,e){return{onBackClick:()=>{const t=oe(e.location.state?.pathnameStackToGoBack),n=t.poppedPathname??Ie();e.navigate(n,{state:{pathnameStackToGoBack:t.newStack}})},onTimePeriodChange:(t,n,c)=>{e.closeSidePanel?.();let o=n;t.startDate.isBefore(n.startDate,c)?o={startDate:t.startDate,endDate:n.endDate}:t.startDate.isAfter(n.endDate,c)?o={startDate:n.startDate,endDate:t.endDate}:console.error(`Invalid addTimePeriod ${JSON.stringify(t)}`),w.trackTransactionList(e.selectedAccount.accountId,void 0,e.referrerType,e.selectedAccount.title,void 0,!0),a(fe({accountId:e.selectedAccount.accountId,accountType:e.selectedAccount.accountType,uiState:{dateRange:o}})),a(ge(e.selectedAccount.accountId,e.selectedAccount.accountType,p(o))),e.onSelectedTimePeriodChange(p(o))},onTransactionItemClick:t=>{if(e.openTransactionPanel)return void e.openTransactionPanel(t.id,t.type);const n=re(t,e.tenantEmailDomain),c=H(e.location.state?.pathnameStackToGoBack,e.location.pathname);e.navigate(n,{state:{pathnameStackToGoBack:c}})},onTransactionListScroll:t=>{a(fe({accountId:e.selectedAccount.accountId,accountType:e.selectedAccount.accountType,uiState:{scrollYOffset:t}}))},onStatementPageIconClick:()=>{const t=at(e.tenantEmailDomain),n=H(e.location.state?.pathnameStackToGoBack,e.location.pathname);e.navigate(t,{state:{pathnameStackToGoBack:n}})}}})(ce),Te=se(function({referrerType:a,...e}){const t=Q(),n=N(),c=K(),{tenantEmailDomain:o,accountTypeEncoded:l,accountIdEncoded:u,timeframe:m,startDate:D,endDate:y,titleEncoded:A,excludeSubAccounts:I}=W(),f=v(l??""),g=v(u??""),k=v(A??""),x=!(I!=null&&I==="exclude_subaccounts"),F=h(P=>Me(P.transactionListState,g,f)),[E,C]=S.useState(!1),[b,B]=S.useState(void 0),O=h(P=>U(P)),T=O.company?.featuresActivationInfo.connectedAccountProvider==="unit",M=O.company?.companyInfo.firstMonthOfFY??1;let r;const R=et(f,g,m,D,y,k);if(R){const P={startDate:Y(D,"YYYY-MM-DD"),endDate:Y(y,"YYYY-MM-DD")},Ye=tt(F?.dateRange,P);r={accountId:g,accountType:te(f),title:k,timeframe:m,period:Ye}}let i=r;r!=null&&b!=null&&(i={...r,period:b});const{useFeatureGate:z}=Z(),{isFeatureEnabled:L}=z(_.isTransactionCommentingEnabled),{isFeatureEnabled:V}=z(_.isProjectsTransactionsEnabled),d=h(P=>ee(P))&&V,{areTenantIdsInSync:$}=Oe();S.useEffect(()=>{!E&&r!=null&&$&&(C(!0),w.trackTransactionList(r.accountId,void 0,a,r.title),c(ge(r.accountId,r.accountType,r.period,void 0,!1,x)))},[E,r,c,$]);const ke=[l,u,m,D,y,A].filter(P=>P!=null);return R&&i!=null?s.jsx(Xe,{firstMonthOfFY:M,tenantEmailDomain:o,location:n,navigate:t,isConnectedAccountProviderUnit:T,isTransactionCommentingEnabled:L,showProjectField:d,selectedAccount:i,referrerType:a,onSelectedTimePeriodChange:P=>B(P),...e}):s.jsx(G,{to:Ie(ke.length)})}),Ie=(a=7)=>{let e="../";for(let t=0;t<a;t++)e=`${e}../`;return e},et=(a,e,t,n,c,o)=>a!=null&&e!=null&&t!=null&&n!=null&&c!=null&&(t==="month"||t==="quarter")&&Y(n,"YYYY-MM-DD").isValid()&&Y(c,"YYYY-MM-DD").isValid()&&o!=null,tt=(a,e)=>a!=null&&a.endDate.isSame(e.endDate,"day")&&a.startDate.isBefore(e.startDate,"day")?p(a):p(e),at=a=>`/${a}/transactions/${Ce}/statements`;function Yt(){const a=N().state?.referrer,e=ze.getSignedInUser(),t=Be(e),{useFeatureGate:n}=Z(),{isFeatureEnabled:c}=n(_.isExpenseAutomationEnabled),o=h(m=>m.expenseAutomationViewState.selectedPeriodByTenantId)[h(m=>U(m)).tenantId],{isFeatureEnabled:l}=n(_.isExpenseAutomationEnabledV2),u=l||c&&t;return s.jsxs(Pe,{children:[s.jsx(j,{path:"/:accountTypeEncoded/:accountIdEncoded/:timeframe/:startDate/:endDate/:titleEncoded/:excludeSubAccounts/*",element:s.jsx(Te,{referrerType:a})}),s.jsx(j,{path:"/zeni-clearing-account/statements",element:s.jsx(Ge,{})}),s.jsx(j,{path:"/*",element:s.jsx(Te,{referrerType:a})}),s.jsx(j,{path:"/uncategorized-income/*",element:s.jsx(q,{})}),s.jsx(j,{path:"/uncategorized-expense/*",element:u?s.jsx(G,{to:`../../month_end_close_checks/review/transaction_categorization/${o.month}-${o.year}`}):s.jsx(q,{})}),s.jsx(j,{path:"/miscategorized-income/*",element:s.jsx(q,{})}),s.jsx(j,{path:"/miscategorized-expense/*",element:u?s.jsx(G,{to:`../../month_end_close_checks/review/transaction_categorization/${o.month}-${o.year}`}):s.jsx(q,{})}),s.jsx(j,{path:"/missing-receipts/*",element:u?s.jsx(G,{to:`../../month_end_close_checks/review/missing_receipts/${o.month}-${o.year}`}):s.jsx(q,{})}),s.jsx(j,{path:"/by-class/:accountTypeEncoded/:accountIdEncoded/:classIdEncoded/:timeframe/:startDate/:endDate/:titleEncoded/*",element:s.jsx(He,{referrerType:a})}),s.jsx(j,{path:"/by-project/:accountTypeEncoded/:accountIdEncoded/:projectIdEncoded/:timeframe/:startDate/:endDate/:titleEncoded/*",element:s.jsx(Qe,{referrerType:a})})]})}export{Yt as default};