@zeniai/web-app-ui 5.1.46-dev → 5.1.47-next
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.
- package/dist/assets/AddressRoutes-B57B205H.js +1 -0
- package/dist/assets/AddressScreen-CCQ88S3j.js +9 -0
- package/dist/assets/AiCfoScreen-12AaZrKz.js +22 -0
- package/dist/assets/BillPayApprovalRoutes-Fxu2CkTc.js +1 -0
- package/dist/assets/{BillPayRoutes-UlCXMjZ_.js → BillPayRoutes-CGm7mDxV.js} +33 -33
- package/dist/assets/BusinessVerificationPageScreen-CPrvTfeI.js +9 -0
- package/dist/assets/ChargeCardRoutes-gC5tn768.js +71 -0
- package/dist/assets/{CompanyPassportScreen-Jd7RmMxP.js → CompanyPassportScreen-DkE_gJb0.js} +1 -1
- package/dist/assets/ConnectionAuthScreen-DIGnFWmg.js +11 -0
- package/dist/assets/CustomerOnboardingAuthScreen-1IBksY_5.js +1 -0
- package/dist/assets/{CustomerOnboardingRoutes-BeYw23eY.js → CustomerOnboardingRoutes-Dke_UCjq.js} +5 -5
- package/dist/assets/{DashboardRoutes-BKrnUTFX.js → DashboardRoutes-DYlid3qZ.js} +4 -4
- package/dist/assets/DefaultTenantHome-ClvDenFW.js +1 -0
- package/dist/assets/DomesticWireDetailScreen-C3aR_Bfd.js +18 -0
- package/dist/assets/DrawerScreen-Cazcn7Rk.js +1 -0
- package/dist/assets/EntityDetailRoutes-CRq9mJ9L.js +1 -0
- package/dist/assets/ExpenseAutomationRoutes-CQopNWx8.js +25 -0
- package/dist/assets/FeaturePreviewScreen-CQMcWtea.js +1 -0
- package/dist/assets/HubSpotOAuthCallbackScreen-Duf0jNJd.js +1 -0
- package/dist/assets/MagicLinkRoutes-BnnvRyEE.js +72 -0
- package/dist/assets/MagicLinkSignInScreen-DqJ2KZ_S.js +12 -0
- package/dist/assets/MobileAppDrawer-Mbdc14x0.js +1 -0
- package/dist/assets/NotFoundScreen-B4DpKEjs.js +1 -0
- package/dist/assets/{NotificationRoutes-DkowgBJj.js → NotificationRoutes-Lv43iwZQ.js} +1 -1
- package/dist/assets/OAuthConsentScreen-CQO6F9GN.js +1 -0
- package/dist/assets/PandLWithForecastRoutes-BeL7Lehp.js +1 -0
- package/dist/assets/PeopleRoutes-PYFu4zWO.js +22 -0
- package/dist/assets/PerformanceRoutes-9UJ4wNxI.js +1 -0
- package/dist/assets/{Preview-DkidNz3z.js → Preview-CnczY1aB.js} +1 -1
- package/dist/assets/{QBOConnectionScreen-DwoHkIu2.js → QBOConnectionScreen--f6RIZ12.js} +1 -1
- package/dist/assets/ReferralListScreen-Fp7Vwl0u.js +5 -0
- package/dist/assets/ReimbursementApprovalRoutes-TQsZnhto.js +1 -0
- package/dist/assets/{ReimbursementApprovalRuleDetailScreen-BtppAsqY.js → ReimbursementApprovalRuleDetailScreen-Ch9v3Gh-.js} +1 -1
- package/dist/assets/{ReimbursementRoutes-eiz8xheE.js → ReimbursementRoutes-DIHzKloW.js} +9 -9
- package/dist/assets/ReportsRoutes-D8ox_6Ub.js +1 -0
- package/dist/assets/RewardsRoutes-3LGiD-BC.js +1 -0
- package/dist/assets/ScreenRoutes-Cg46Pt3V.js +2 -0
- package/dist/assets/{SettingsRoutes-BI4dN7RS.js → SettingsRoutes-B6mX4TxX.js} +8 -8
- package/dist/assets/{SetupPagesScreen-D-neLjJM.js → SetupPagesScreen-XEp1kQFR.js} +5 -5
- package/dist/assets/SignInScreen-d7faXEuU.js +1 -0
- package/dist/assets/SignOutScreen-DhJ33mB0.js +9 -0
- package/dist/assets/TaskListScreen-BVihwzZC.js +9 -0
- package/dist/assets/TaskRoutes-D7mVo-mO.js +9 -0
- package/dist/assets/TransactionDetailRoutes-CUIl0cYW.js +1 -0
- package/dist/assets/{TransactionDetailScreen-Bshs2g2Z.js → TransactionDetailScreen-7oGkn8s8.js} +2 -2
- package/dist/assets/TransactionListRoutes-nXmLKfGU.js +1 -0
- package/dist/assets/{TreasuryRoutes-CNbtiHFp.js → TreasuryRoutes-CF5MXT61.js} +6 -6
- package/dist/assets/{VendorsRoutes-C5KKIVE-.js → VendorsRoutes-T3gDuJPY.js} +27 -27
- package/dist/assets/WiseConfirmationScreen-C3AyB_6Q.js +12 -0
- package/dist/assets/ZeniAccountRoutes-M7DnzrB2.js +57 -0
- package/dist/assets/ZeniAccountStatementScreen-C1dFEu7A.js +9 -0
- package/dist/assets/{accountMappingHelper-cmIw559z.js → accountMappingHelper-C3cxjqIM.js} +1 -1
- package/dist/assets/{analytics-DORMe8dT.js → analytics-CgnjVt5D.js} +1 -1
- package/dist/assets/{analyticsHelper-aSqJwcvL.js → analyticsHelper-S9v9q0r_.js} +1 -1
- package/dist/assets/{core-D95G1COY.js → core-CjggIORY.js} +2 -2
- package/dist/assets/{decodeURIComponentSafe-BLmfpdcW.js → decodeURIComponentSafe-B9x_jCmd.js} +1 -1
- package/dist/assets/{dnd-BXlaBlTc.js → dnd-BkcbdaLH.js} +1 -1
- package/dist/assets/{empty-BE68b5E4.js → empty-B-YUfrA-.js} +1 -1
- package/dist/assets/empty-DnUJyHGh.js +1 -0
- package/dist/assets/{emptyVideoElement-NX2rx7EQ.js → emptyVideoElement-BpLqkt3D.js} +1 -1
- package/dist/assets/epic-BolPn7V3.js +2 -0
- package/dist/assets/getLocaleForTenant-DoMce50l.js +1 -0
- package/dist/assets/{index-CnP5hpUl.js → index-BLg-ZRMW.js} +1 -1
- package/dist/assets/index-Bhp-y0XH.js +1 -0
- package/dist/assets/{empty-BTAxEJiS.js → index-C9TMsP3g.js} +1 -1
- package/dist/assets/{index-cIfsvMlJ.js → index-CqhCLSUw.js} +1 -1
- package/dist/assets/{index-BjNhU8qP.js → index-D-6jjZwE.js} +1 -1
- package/dist/assets/{index-CruHx9g6.js → index-DfH8_y4r.js} +1 -1
- package/dist/assets/{index-BUmr5maU.css → index-R6GjjTB3.css} +1 -1
- package/dist/assets/{index-C8tyyalR.js → index-T3RPvQKw.js} +15593 -17927
- package/dist/assets/{index-B_Cirr74.js → index-pj8moFgk.js} +2 -2
- package/dist/assets/{lexical-D90cNSQE.js → lexical-ztGMt0Co.js} +1 -1
- package/dist/assets/{liveblocks-8SEYIom7.js → liveblocks-BrHep0IE.js} +1 -1
- package/dist/assets/{lottie-DGqwGfHh.js → lottie-apaaj5nl.js} +1 -1
- package/dist/assets/{mui-jqvOLufq.js → mui-BHbKLhAL.js} +1 -1
- package/dist/assets/{pathToGoBack-Csr3Iao-.js → pathToGoBack-DmuGVa1m.js} +1 -1
- package/dist/assets/{pdf-CMafEn8a.js → pdf-DUoZzTWI.js} +4 -4
- package/dist/assets/{pdf-lib-C0lYQdSO.js → pdf-lib-OO0mpuMM.js} +1 -1
- package/dist/assets/{plaid-BvitY7vM.js → plaid-Ki-s5Z-l.js} +1 -1
- package/dist/assets/{pusher-DVRirJfe.js → pusher-fL9oKfF1.js} +1 -1
- package/dist/assets/{react-CVOHOwD-.js → react-B0LrczHK.js} +1 -1
- package/dist/assets/{react-DJ_69eFR.js → react-BEIFHHJf.js} +1 -1
- package/dist/assets/{react-C-4UGOsg.js → react-Bp7G6QMT.js} +1 -1
- package/dist/assets/{react-CAXdypQs.js → react-CuxEeVaR.js} +1 -1
- package/dist/assets/{react-DADgee2G.js → react-Cww0Nqy2.js} +1 -1
- package/dist/assets/{react-DOyz-DAB.js → react-Hzc9qCeE.js} +1 -1
- package/dist/assets/{recharts-B5BD4Kau.js → recharts-CqDxIFtp.js} +1 -1
- package/dist/assets/{routePaths-STLgTv0l.js → routePaths-BO2NCass.js} +1 -1
- package/dist/assets/{sentry-Bpr6hwv_.js → sentry-Bhe05Ckf.js} +1 -1
- package/dist/assets/{url-tRs_qG1D.js → url--07kYo43.js} +1 -1
- package/dist/assets/{url-83NdFFZ3.js → url-CLTAUVW1.js} +1 -1
- package/dist/assets/{useAiCfoDashboardSuggestedQuestionsChips-BfufDhKS.js → useAiCfoDashboardSuggestedQuestionsChips-BZBtFcNp.js} +1 -1
- package/dist/assets/useAskAiCfoHostNavButtonProps-almazpmI.js +1 -0
- package/dist/assets/{useDeviceId-DNdkDSci.js → useDeviceId-DtODfw6K.js} +1 -1
- package/dist/assets/useInitialThreadRequest-C0UyKc5f.js +1 -0
- package/dist/assets/{utils-kj_q6fLI.js → utils-BWXl495q.js} +2 -2
- package/dist/assets/{withTransactionSidePanel-CyTjTf4e.js → withTransactionSidePanel-Dpd3vYhS.js} +4 -4
- package/dist/assets/{zeni-epic-state-BnmnEdbj.js → zeni-epic-state-BY4R57V8.js} +6 -6
- package/dist/index.html +1 -1
- package/package.json +4 -4
- package/dist/assets/AddressRoutes-Bu1wLdr9.js +0 -1
- package/dist/assets/AddressScreen-DyCQJjNT.js +0 -9
- package/dist/assets/AiCfoScreen-DpYulm6L.js +0 -22
- package/dist/assets/BillPayApprovalRoutes-BiuKI-Rl.js +0 -1
- package/dist/assets/BusinessVerificationPageScreen-fLqoQmHN.js +0 -9
- package/dist/assets/CardsAiCfoScreen-D49SttU_.js +0 -14
- package/dist/assets/ChargeCardRoutes-lr8bIl57.js +0 -71
- package/dist/assets/ConnectionAuthScreen-JILvaDGY.js +0 -11
- package/dist/assets/CustomerOnboardingAuthScreen-BM-quSNh.js +0 -1
- package/dist/assets/DefaultTenantHome-C4xFfbR_.js +0 -1
- package/dist/assets/DomesticWireDetailScreen-DN6hsoHQ.js +0 -18
- package/dist/assets/DrawerScreen-C3rL34Nr.js +0 -1
- package/dist/assets/EntityDetailRoutes-B6x-jsr1.js +0 -1
- package/dist/assets/ExpenseAutomationRoutes-Cs8BXmkZ.js +0 -25
- package/dist/assets/FeaturePreviewScreen-Bq9eSSz9.js +0 -1
- package/dist/assets/HubSpotOAuthCallbackScreen-B3oZEnMP.js +0 -1
- package/dist/assets/MagicLinkRoutes-Bvtkhcw0.js +0 -72
- package/dist/assets/MagicLinkSignInScreen-RvwdSqqO.js +0 -12
- package/dist/assets/MobileAppDrawer-D8HOXn7v.js +0 -1
- package/dist/assets/NotFoundScreen-0h0DiOvj.js +0 -1
- package/dist/assets/OAuthConsentScreen-MNbkNl_v.js +0 -1
- package/dist/assets/PandLWithForecastRoutes-DXEDmlZd.js +0 -1
- package/dist/assets/PeopleRoutes-CsAbJBHX.js +0 -22
- package/dist/assets/PerformanceRoutes-8SJwQoaV.js +0 -1
- package/dist/assets/ReferralListScreen-DAUAqg4I.js +0 -5
- package/dist/assets/ReimbursementApprovalRoutes-DxtKouwg.js +0 -1
- package/dist/assets/ReportsRoutes-_Zdg3F2x.js +0 -1
- package/dist/assets/RewardsRoutes-UFPd_8TA.js +0 -1
- package/dist/assets/ScreenRoutes-BoQ6iXAM.js +0 -2
- package/dist/assets/SignInScreen-qgS7vG1A.js +0 -1
- package/dist/assets/SignOutScreen-BbyO1zZV.js +0 -9
- package/dist/assets/TaskListScreen-CVeALlL0.js +0 -9
- package/dist/assets/TaskRoutes-Gx5x8B3t.js +0 -9
- package/dist/assets/TransactionDetailRoutes-Dngsr6y1.js +0 -1
- package/dist/assets/TransactionListRoutes-Bg_zUk5Q.js +0 -1
- package/dist/assets/WiseConfirmationScreen-Bqy3cyw-.js +0 -12
- package/dist/assets/ZeniAccountRoutes-CDeXOkOl.js +0 -57
- package/dist/assets/ZeniAccountStatementScreen-DE1cm9kp.js +0 -9
- package/dist/assets/epic-K6OBBbJr.js +0 -2
- package/dist/assets/getLocaleForTenant-HT8Btw6T.js +0 -1
- package/dist/assets/index-DLVDaPoM.js +0 -1
- package/dist/assets/index-DMreRMIr.js +0 -1
- package/dist/assets/useAskAiCfoHostNavButtonProps-CE4sjmcs.js +0 -1
- package/dist/assets/useInitialThreadRequest-DzF6un_U.js +0 -1
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import{j as s}from"./liveblocks-8SEYIom7.js";import{h as W,u as re,g as H,i as K,j as E,N as _,n as X,l as mt,o as ct,p as C}from"./core-D95G1COY.js";import{eT as Z,PT as le,c3 as me,DX as Be,kA as dt,E8 as ne,E7 as ae,PU as ut,bn as ce,gk as Te,PV as pt,Me as bt,kp as De,Mf as Se,Mg as gt,jk as ht,P7 as ft,jz as St,DL as It,tX as yt,jr as Rt,Ev as je,PW as Fe,PX as kt,PY as At,PZ as vt,P_ as Ct,P$ as Et,Ef as Ie,jF as wt,Pg as xt,E9 as Bt,DV as Tt,Q0 as Dt,DU as jt,Q1 as Ft,E1 as ye,Ej as Ut,Ei as Lt,Ee as Pt,Q2 as Ue,Js as $t,bo as Mt,E4 as _t,EN as Nt,Q3 as Ot,Q4 as Qt,Er as zt,Eo as Re,OC as Gt,DS as Ht,Q5 as Le,Fa as ke,Fi as Zt,Q6 as Vt,Q7 as z,Q8 as Wt,Q9 as Pe,Qa as Xt,Qb as $e,Qc as Me,ED as se,bu as qt,bG as de,cD as ue,fa as _e,f8 as Ne,Qd as Jt,hC as Kt,OP as Yt,Qe as en,Qf as Oe,OT as tn,PB as nn,Qg as an,PS as sn,Ff as Ae,Fe as on,Qh as rn,Qi as ln,Qj as mn,Qk as cn,Ql as dn,Pm as un,F5 as pn,F9 as bn,bt as gn,bF as hn,cy as fn,cm as Sn,bs as In,La as yn,cN as Rn,cP as kn,cO as An,cx as vn}from"./zeni-epic-state-BnmnEdbj.js";import{E as Qe,J as ze,f as Y,c as A,z as $,bT as Ge,N as ee,d as v,aH as ve,o as j,at as J,D as Cn,O as He,bU as En,q as G,_ as Ze,bV as wn,A as te,bW as xn,X as Bn,y as Tn,B as pe,g as Ve,a7 as Dn,bk as jn,a2 as Fn,m as We,bX as Un,a9 as Ln}from"./index-C8tyyalR.js";import{n as N,S as Pn}from"./mui-jqvOLufq.js";import ie from"./NotFoundScreen-0h0DiOvj.js";import{S as Ce}from"./SetupPagesScreen-D-neLjJM.js";import{F as Xe}from"./FeaturePreviewScreen-Bq9eSSz9.js";import{a as f}from"./sentry-Bpr6hwv_.js";import{u as be}from"./useAskAiCfoHostNavButtonProps-CE4sjmcs.js";import{u as qe}from"./useInitialThreadRequest-DzF6un_U.js";import{D as $n}from"./DrawerScreen-C3rL34Nr.js";import{M as Je}from"./MobileAppDrawer-D8HOXn7v.js";import{R as Mn}from"./ReimbursementApprovalRoutes-DxtKouwg.js";import{FallBackRoute as _n}from"./ScreenRoutes-BoQ6iXAM.js";import"./recharts-B5BD4Kau.js";import"./analytics-DORMe8dT.js";import"./plaid-BvitY7vM.js";import"./dnd-BXlaBlTc.js";import"./stripe-DMRn4zHo.js";import"./lottie-DGqwGfHh.js";import"./lexical-D90cNSQE.js";import"./pdf-CMafEn8a.js";import"./utils-kj_q6fLI.js";import"./analyticsHelper-aSqJwcvL.js";import"./routePaths-STLgTv0l.js";import"./BusinessVerificationPageScreen-fLqoQmHN.js";import"./ReimbursementApprovalRuleDetailScreen-BtppAsqY.js";import"./getLocaleForTenant-HT8Btw6T.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]="415e1149-3ac6-4c38-95b0-314b929c37ca",e._sentryDebugIdIdentifier="sentry-dbid-415e1149-3ac6-4c38-95b0-314b929c37ca")}catch{}})();const Ke=e=>`/${e}/reimbursements`,Nn=e=>f.createElement("svg",{viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",...e},f.createElement("path",{d:"M12.5 3.5L3.5 12.5",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round"}),f.createElement("path",{d:"M12.5 12.5L3.5 3.5",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round"})),{spendManagement:{reimbursement:{reimbursementDetail:L}}}=He.getLocalizedStrings(),On=X(function(e,t){const n=t.currentTenant?.companyId,r=ut(e.plaidAccountViewState,"user_reimbursement_account"),d=$.getSignedInUser(),c=ce(d),m=r.plaidConnectionDetails,o=Te(e.companyState,n),a=e.tenantState.currentTenantId,i={userId:d?.userId??"",sessionId:d?.zeniSessionId??"",tenantId:a??""},l=le(e,t.reimbursementId),b=pt(e,d?.userId??"");let R=`${d?.firstName} ${d?.lastName}`,h=!0;t.reimbursementId!=null&&(R=`${l.createdBy?.firstName??"Zeni"} ${l.createdBy?.lastName??""}`,h=d?.userId===l.createdBy?.userId);const T=e.entityAutoCompleteState?.autoCompleteText?.common,u=bt(e,"common");return{remiDetails:l,uploadInvoiceEndPoint:`${J.communicationAgentMicroServiceBaseUrl}`,reimbursementId:t.reimbursementId,customerSearchAutoCompleteData:{autoCompleteText:T,entityAutoCompleteView:u},authParams:i,defaultCurrency:{currencySymbol:o?.company.companyLocaleInfo.currencySymbol??"$",currencyCode:o?.company.companyLocaleInfo.currencyCode??"USD"},companyMileageConfigInfo:o?.company.configInfo.mileageRateConfig,createdBy:R,isUserAdmin:me(t.currentTenant?.userRole??[]),isZeniUser:c,plaidConnectionDetails:m,bankNameByRouting:l.bankNameByRouting,bankAccountCreationState:b.bankAccountCreationState,bankAccounts:b.bankAccounts,analytics:v,bankAccountToCreate:l.bankAccountToCreate,fetchBankNameByRoutingStatus:l.fetchBankNameByRoutingStatus,isSignedInUserReimbursementCreator:h,disableInternalOverlay:t.disableInternalOverlay,showSkipAutoFill:t.showSkipAutoFill,setShowSkipAutoFill:t.setShowSkipAutoFill,isAccountingClassesEnabled:De(e)}},function(e,t){const{reimbursementId:n,currentTenant:r,location:d,navigate:c,themeState:m}=t,{tenantEmailDomain:o}=r,a=$.getSignedInUser();return{onReceiptsUpload:(i,l,b)=>{i!=null&&e(ae(i,l,b,n,a?.userId))},onExistingMerchantChange:(i,l)=>{e(ye(!1,l,n,i,void 0))},fetchDuplicateReimbursement:()=>{a?.userId!=null&&e(Pt(a.userId,!0,n))},clearDuplicateReimbursementDetail:()=>{e(Lt())},clearRemiSaveStatus:()=>{e(Ut("Not-Started",n))},onDuplicateLineClick:(i,l)=>window.open(`/${o}/reimbursement/${i}#L${l}`),onNewMerchantChange:(i,l)=>{e(ye(!1,l,n,void 0,i))},removeFileFromLine:i=>{e(Ft({lineId:i,reimbursementId:n}))},onAmountChanged:(i,l)=>{e(jt(l,i,n))},updateReimbursementType:(i,l,b)=>{e(Dt({reimbursementId:b,lineId:l,reimbursementType:i}))},onHomeCurrencyConversionUpdate:(i,l,b)=>{e(Tt({reimbursementId:b,lineId:l,amountPayload:{amount:i.amount,currency_code:i.currencyCode,currency_symbol:i.currencySymbol}}))},onReimbursementDetailsChanged:i=>{e(Bt({remiDetailLocalData:i,reimbursementId:n}))},saveRemiDetails:i=>{e(Ie(i,!1,n))},onUserBankDetailsUpdated:i=>{const{bankAccountSection:l}=i;e(xt({data:l}))},onFetchBankName:i=>{e(wt(i))},submitRemiDetails:()=>{e(Ie("pending_approval",!0,n))},discardReimbursementDetailsFromLocalStore:i=>{e(Et({reimbursementId:i}))},updateInvoiceUploadFetchState:i=>{e(ne({reimbursementId:n,fetchState:i}))},clearTentativeNameForLine:i=>{e(Ct({reimbursementId:n,lineId:i}))},removeDuplicateReimbursementForLine:i=>{e(vt({lineId:i}))},onZeniLogoClick:()=>{m.toggle()},clearAddRemiAutoFields:i=>{e(At({reimbursementId:n,lineId:i}))},redirectToReimbursementListScreen:()=>{e(Fe()),e(kt());const i=Ke(o),l=G(d.state?.pathnameStackToGoBack,d.pathname);c(i,{state:{pathnameStackToGoBack:l}})},redirectToReimbursementDetailScreen:()=>{t.navigate("../")},deleteReimbursement:()=>{n!=null&&(v.trackReimbursementDeleteReimbursement(n),e(je(n)))},onSaveBankAccount:()=>{a?.userId&&e(Rt(a?.userId,n))},onFetchLinkTokenClick:i=>{e(yt("user_reimbursement_account",i))},onEstablishConnectionClick:i=>{e(It(i,r.companyId,"user_reimbursement_account",void 0,"link_account_no_microdeposit"))},deleteBankAccount:i=>{e(St(i,a?.userId??""))},onBackClickFromBankAccountPage:()=>{e(ht({fetchState:"Not-Started"})),e(ft())},customerSearchAutoCompleteActions:{onAutoCompleteInputChange:(i,l)=>{i.trim().length>=2?e(gt({searchString:i,entityType:l,searchOrigin:"common"})):e(Se("common"))},onCancelAutoComplete:()=>{e(Se("common"))}}}})(En);function Ee(){const e=W(),t=re(),n=H(),{reimbursementId:r}=K(),d=Qe(),c=ze(),[m,o]=f.useState(r==null),[a,i]=f.useState(1),{useFeatureGate:l}=Y(),{isFeatureEnabled:b}=l(A.isLimitedCategoryForReimbursement),{isFeatureEnabled:R}=l(A.isShowDeletedReimbursementsFeatureEnabled),{isFeatureEnabled:h}=l(A.isReimbursementCommentingEnabled),{isAiCfoAccessEnabled:T,onAskAiCfoClick:u}=be({mobileExploreReferrer:"Reimbursement Details"}),w=H().pathname,D=w.includes("edit"),k=w.includes("reimbursement/new"),[F,x]=f.useState(!1),B=$.getSignedInUser(),I=E(p=>Z(p)),g=E(p=>le(p,r)),P=qe(I?.companyId,{clearParams:g.fetchState==="Completed"}),U=me(I?.userRole??[]);f.useEffect(()=>{(k&&!F||D&&g.fetchState!="Completed"&&g.fetchState!="In-Progress")&&(x(!0),t(Be(!1,b,R,r)))});const M=E(p=>dt(p.accountState,p.accountListState,"reimbursementAccountList"));if(B==null)throw Error("Can't access address page without signing in...");const y={pathname:`../${r}`,search:n.search};return g.isDeleted===!0||g.billStage=="paid"||g.billStage=="scheduled"||g.fetchState=="Not-Started"||U&&g.billStatus==="rejected"||U===!1&&g.billStage==="pending_approval"&&g.billStatus!=="rejected"?s.jsx(_,{to:y}):g.deleteStatus.fetchState==="In-Progress"||g.fetchState!=="Completed"?s.jsx(Ge,{isNewReimbursement:r==null}):s.jsxs(Qn,{windowSize:c,children:[s.jsx(ee,{analytics:v,onLoad:p=>(V=>{r!=null&&g.deleteStatus.fetchState!=="Completed"&&V.trackReimbursementEditReimbursement(r)})(p)}),m&&c!=="small"?s.jsx(zn,{}):null,m&&c!=="small"?s.jsx(Gn,{children:s.jsx(ve,{showAutofill:m,uploadInvoiceEndPoint:`${J.communicationAgentMicroServiceBaseUrl}`,authParams:{userId:B?.userId??"",sessionId:B?.zeniSessionId??"",tenantId:I?.tenantId??""},onSkipAutofill:()=>o(!1),onInvoiceUpload:p=>{p!=null&&t(ae(p,a,!0,r,B?.userId))},updateInvoiceUploadFetchState:p=>{t(ne({reimbursementId:r,fetchState:p}))},allowMultiFiles:m,showInfoText:!1,type:"reimbursement",style:{width:"100%",paddingTop:"78px",paddingRight:j.sp3,paddingBottom:"15px",paddingLeft:j.sp5},dropFilePlaceholder:{upload:L.dropReceipt.upload,single:L.dropReceipt.single,or:L.dropReceipt.or,multiple:L.dropReceipt.multiple,receipts:L.dropReceipt.receipts}})}):null,m&&c==="small"?s.jsxs(Hn,{children:[s.jsx(Zn,{onClick:()=>o(!1),children:s.jsx(Nn,{})}),s.jsx(ve,{showAutofill:m,uploadInvoiceEndPoint:`${J.communicationAgentMicroServiceBaseUrl}`,authParams:{userId:B?.userId??"",sessionId:B?.zeniSessionId??"",tenantId:I?.tenantId??""},onSkipAutofill:()=>o(!1),onInvoiceUpload:p=>{p!=null&&t(ae(p,a,!0,r,B?.userId))},updateInvoiceUploadFetchState:p=>{t(ne({reimbursementId:r,fetchState:p}))},allowMultiFiles:m,showInfoText:!1,type:"reimbursement",style:{width:"100%",paddingTop:j.sp5,paddingRight:j.sp3,paddingBottom:j.sp5,paddingLeft:j.sp3},dropFilePlaceholder:{upload:L.dropReceipt.upload,single:L.dropReceipt.single,or:L.dropReceipt.or,multiple:L.dropReceipt.multiple,receipts:L.dropReceipt.receipts}})]}):null,s.jsx(Vn,{windowSize:c,children:s.jsx(On,{initialOpenThreadRequest:P??void 0,isReimbursementCommentingEnabled:h,location:n,navigate:e,currentTenant:I,reimbursementId:r,themeState:d,uncategorizedAccounts:M,disableInternalOverlay:!0,showSkipAutoFill:m,setShowSkipAutoFill:o,onCurrentLineIdForUploadChange:i,isAiCfoAccessEnabled:T,onAskAiCfoClick:u})})]})}const Qn=N.div`
|
|
1
|
+
import{j as s}from"./liveblocks-BrHep0IE.js";import{h as J,u as re,g as Z,i as K,j as E,N as M,n as X,l as mt,o as ct,p as C}from"./core-CjggIORY.js";import{eR as V,OI as le,c2 as me,CJ as Be,jT as dt,CW as ne,CV as ae,OJ as ut,bn as ce,fO as De,OK as pt,L3 as bt,jI as Te,L4 as Se,L5 as gt,iD as ht,NY as ft,iS as St,Cx as It,tc as yt,iK as Rt,Dh as je,OL as Fe,OM as At,ON as kt,OO as vt,OP as Ct,OQ as Et,D1 as Ie,iY as wt,O5 as xt,CX as Bt,CH as Dt,OR as Tt,CG as jt,OS as Ft,CP as ye,D5 as Ut,D4 as Lt,D0 as Pt,OT as Ue,Ie as Ot,bo as $t,CS as Mt,Dz as _t,OU as Nt,OV as zt,Dd as Gt,Da as Re,Nr as Ht,CE as Zt,OW as Le,DY as Ae,E4 as Vt,OX as Wt,OY as G,OZ as Jt,O_ as Pe,O$ as Xt,P0 as Oe,P1 as $e,Dp as se,bu as qt,bG as de,cC as ue,f0 as Me,e_ as _e,P2 as Yt,gV as Kt,NE as Qt,P3 as en,P4 as Ne,NI as tn,Oq as nn,P5 as an,OH as sn,E1 as ke,E0 as on,P6 as rn,P7 as ln,P8 as mn,P9 as cn,Pa as dn,Ob as un,DT as pn,DX as bn,bt as gn,bF as hn,cx as fn,cl as Sn,bs as In,J_ as yn,cM as Rn,cO as An,cN as kn,cw as vn}from"./zeni-epic-state-BY4R57V8.js";import{H as ze,J as Ge,s as Q,d as k,z as O,bT as He,x as ee,e as v,aH as ve,o as j,at as Y,C as Cn,D as Ze,bU as En,v as H,Z as Ve,bV as wn,k as te,bW as xn,V as Bn,A as Dn,B as pe,g as We,a7 as Tn,bk as jn,a2 as Fn,m as Je,bX as Un,a9 as Ln}from"./index-T3RPvQKw.js";import{n as _,S as Pn}from"./mui-BHbKLhAL.js";import ie from"./NotFoundScreen-B4DpKEjs.js";import{S as Ce}from"./SetupPagesScreen-XEp1kQFR.js";import{F as Xe}from"./FeaturePreviewScreen-CQMcWtea.js";import{a as f}from"./sentry-Bhe05Ckf.js";import{u as be}from"./useAskAiCfoHostNavButtonProps-almazpmI.js";import{u as qe}from"./useInitialThreadRequest-C0UyKc5f.js";import{D as On}from"./DrawerScreen-Cazcn7Rk.js";import{M as Ye}from"./MobileAppDrawer-Mbdc14x0.js";import{R as $n}from"./ReimbursementApprovalRoutes-TQsZnhto.js";import{FallBackRoute as Mn}from"./ScreenRoutes-Cg46Pt3V.js";import"./recharts-CqDxIFtp.js";import"./analytics-CgnjVt5D.js";import"./plaid-Ki-s5Z-l.js";import"./dnd-BkcbdaLH.js";import"./stripe-DMRn4zHo.js";import"./lottie-apaaj5nl.js";import"./lexical-ztGMt0Co.js";import"./pdf-DUoZzTWI.js";import"./utils-BWXl495q.js";import"./analyticsHelper-S9v9q0r_.js";import"./routePaths-BO2NCass.js";import"./BusinessVerificationPageScreen-CPrvTfeI.js";import"./ReimbursementApprovalRuleDetailScreen-Ch9v3Gh-.js";import"./getLocaleForTenant-DoMce50l.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]="848e9c20-3736-44c6-8983-d73dd89ebfb6",e._sentryDebugIdIdentifier="sentry-dbid-848e9c20-3736-44c6-8983-d73dd89ebfb6")}catch{}})();const Ke=e=>`/${e}/reimbursements`,_n=e=>f.createElement("svg",{viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",...e},f.createElement("path",{d:"M12.5 3.5L3.5 12.5",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round"}),f.createElement("path",{d:"M12.5 12.5L3.5 3.5",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round"})),{spendManagement:{reimbursement:{reimbursementDetail:L}}}=Ze.getLocalizedStrings(),Nn=X(function(e,t){const n=t.currentTenant?.companyId,r=ut(e.plaidAccountViewState,"user_reimbursement_account"),d=O.getSignedInUser(),c=ce(d),m=r.plaidConnectionDetails,o=De(e.companyState,n),a=e.tenantState.currentTenantId,i={userId:d?.userId??"",sessionId:d?.zeniSessionId??"",tenantId:a??""},l=le(e,t.reimbursementId),b=pt(e,d?.userId??"");let R=`${d?.firstName} ${d?.lastName}`,h=!0;t.reimbursementId!=null&&(R=`${l.createdBy?.firstName??"Zeni"} ${l.createdBy?.lastName??""}`,h=d?.userId===l.createdBy?.userId);const D=e.entityAutoCompleteState?.autoCompleteText?.common,u=bt(e,"common");return{remiDetails:l,uploadInvoiceEndPoint:`${Y.communicationAgentMicroServiceBaseUrl}`,reimbursementId:t.reimbursementId,customerSearchAutoCompleteData:{autoCompleteText:D,entityAutoCompleteView:u},authParams:i,defaultCurrency:{currencySymbol:o?.company.companyLocaleInfo.currencySymbol??"$",currencyCode:o?.company.companyLocaleInfo.currencyCode??"USD"},companyMileageConfigInfo:o?.company.configInfo.mileageRateConfig,createdBy:R,isUserAdmin:me(t.currentTenant?.userRole??[]),isZeniUser:c,plaidConnectionDetails:m,bankNameByRouting:l.bankNameByRouting,bankAccountCreationState:b.bankAccountCreationState,bankAccounts:b.bankAccounts,analytics:v,bankAccountToCreate:l.bankAccountToCreate,fetchBankNameByRoutingStatus:l.fetchBankNameByRoutingStatus,isSignedInUserReimbursementCreator:h,disableInternalOverlay:t.disableInternalOverlay,showSkipAutoFill:t.showSkipAutoFill,setShowSkipAutoFill:t.setShowSkipAutoFill,isAccountingClassesEnabled:Te(e)}},function(e,t){const{reimbursementId:n,currentTenant:r,location:d,navigate:c,themeState:m}=t,{tenantEmailDomain:o}=r,a=O.getSignedInUser();return{onReceiptsUpload:(i,l,b)=>{i!=null&&e(ae(i,l,b,n,a?.userId))},onExistingMerchantChange:(i,l)=>{e(ye(!1,l,n,i,void 0))},fetchDuplicateReimbursement:()=>{a?.userId!=null&&e(Pt(a.userId,!0,n))},clearDuplicateReimbursementDetail:()=>{e(Lt())},clearRemiSaveStatus:()=>{e(Ut("Not-Started",n))},onDuplicateLineClick:(i,l)=>window.open(`/${o}/reimbursement/${i}#L${l}`),onNewMerchantChange:(i,l)=>{e(ye(!1,l,n,void 0,i))},removeFileFromLine:i=>{e(Ft({lineId:i,reimbursementId:n}))},onAmountChanged:(i,l)=>{e(jt(l,i,n))},updateReimbursementType:(i,l,b)=>{e(Tt({reimbursementId:b,lineId:l,reimbursementType:i}))},onHomeCurrencyConversionUpdate:(i,l,b)=>{e(Dt({reimbursementId:b,lineId:l,amountPayload:{amount:i.amount,currency_code:i.currencyCode,currency_symbol:i.currencySymbol}}))},onReimbursementDetailsChanged:i=>{e(Bt({remiDetailLocalData:i,reimbursementId:n}))},saveRemiDetails:i=>{e(Ie(i,!1,n))},onUserBankDetailsUpdated:i=>{const{bankAccountSection:l}=i;e(xt({data:l}))},onFetchBankName:i=>{e(wt(i))},submitRemiDetails:()=>{e(Ie("pending_approval",!0,n))},discardReimbursementDetailsFromLocalStore:i=>{e(Et({reimbursementId:i}))},updateInvoiceUploadFetchState:i=>{e(ne({reimbursementId:n,fetchState:i}))},clearTentativeNameForLine:i=>{e(Ct({reimbursementId:n,lineId:i}))},removeDuplicateReimbursementForLine:i=>{e(vt({lineId:i}))},onZeniLogoClick:()=>{m.toggle()},clearAddRemiAutoFields:i=>{e(kt({reimbursementId:n,lineId:i}))},redirectToReimbursementListScreen:()=>{e(Fe()),e(At());const i=Ke(o),l=H(d.state?.pathnameStackToGoBack,d.pathname);c(i,{state:{pathnameStackToGoBack:l}})},redirectToReimbursementDetailScreen:()=>{t.navigate("../")},deleteReimbursement:()=>{n!=null&&(v.trackReimbursementDeleteReimbursement(n),e(je(n)))},onSaveBankAccount:()=>{a?.userId&&e(Rt(a?.userId,n))},onFetchLinkTokenClick:i=>{e(yt("user_reimbursement_account",i))},onEstablishConnectionClick:i=>{e(It(i,r.companyId,"user_reimbursement_account",void 0,"link_account_no_microdeposit"))},deleteBankAccount:i=>{e(St(i,a?.userId??""))},onBackClickFromBankAccountPage:()=>{e(ht({fetchState:"Not-Started"})),e(ft())},customerSearchAutoCompleteActions:{onAutoCompleteInputChange:(i,l)=>{i.trim().length>=2?e(gt({searchString:i,entityType:l,searchOrigin:"common"})):e(Se("common"))},onCancelAutoComplete:()=>{e(Se("common"))}}}})(En);function Ee(){const e=J(),t=re(),n=Z(),{reimbursementId:r}=K(),d=ze(),c=Ge(),[m,o]=f.useState(r==null),[a,i]=f.useState(1),{useFeatureGate:l}=Q(),{isFeatureEnabled:b}=l(k.isLimitedCategoryForReimbursement),{isFeatureEnabled:R}=l(k.isShowDeletedReimbursementsFeatureEnabled),{isFeatureEnabled:h}=l(k.isReimbursementCommentingEnabled),{isAiCfoAccessEnabled:D,onAskAiCfoClick:u}=be({mobileExploreReferrer:"Reimbursement Details"}),w=Z().pathname,T=w.includes("edit"),A=w.includes("reimbursement/new"),[F,x]=f.useState(!1),B=O.getSignedInUser(),I=E(p=>V(p)),g=E(p=>le(p,r)),P=qe(I?.companyId,{clearParams:g.fetchState==="Completed"}),U=me(I?.userRole??[]);f.useEffect(()=>{(A&&!F||T&&g.fetchState!="Completed"&&g.fetchState!="In-Progress")&&(x(!0),t(Be(!1,b,R,r)))});const $=E(p=>dt(p.accountState,p.accountListState,"reimbursementAccountList"));if(B==null)throw Error("Can't access address page without signing in...");const y={pathname:`../${r}`,search:n.search};return g.isDeleted===!0||g.billStage=="paid"||g.billStage=="scheduled"||g.fetchState=="Not-Started"||U&&g.billStatus==="rejected"||U===!1&&g.billStage==="pending_approval"&&g.billStatus!=="rejected"?s.jsx(M,{to:y}):g.deleteStatus.fetchState==="In-Progress"||g.fetchState!=="Completed"?s.jsx(He,{isNewReimbursement:r==null}):s.jsxs(zn,{windowSize:c,children:[s.jsx(ee,{analytics:v,onLoad:p=>(W=>{r!=null&&g.deleteStatus.fetchState!=="Completed"&&W.trackReimbursementEditReimbursement(r)})(p)}),m&&c!=="small"?s.jsx(Gn,{}):null,m&&c!=="small"?s.jsx(Hn,{children:s.jsx(ve,{showAutofill:m,uploadInvoiceEndPoint:`${Y.communicationAgentMicroServiceBaseUrl}`,authParams:{userId:B?.userId??"",sessionId:B?.zeniSessionId??"",tenantId:I?.tenantId??""},onSkipAutofill:()=>o(!1),onInvoiceUpload:p=>{p!=null&&t(ae(p,a,!0,r,B?.userId))},updateInvoiceUploadFetchState:p=>{t(ne({reimbursementId:r,fetchState:p}))},allowMultiFiles:m,showInfoText:!1,type:"reimbursement",style:{width:"100%",paddingTop:"78px",paddingRight:j.sp3,paddingBottom:"15px",paddingLeft:j.sp5},dropFilePlaceholder:{upload:L.dropReceipt.upload,single:L.dropReceipt.single,or:L.dropReceipt.or,multiple:L.dropReceipt.multiple,receipts:L.dropReceipt.receipts}})}):null,m&&c==="small"?s.jsxs(Zn,{children:[s.jsx(Vn,{onClick:()=>o(!1),children:s.jsx(_n,{})}),s.jsx(ve,{showAutofill:m,uploadInvoiceEndPoint:`${Y.communicationAgentMicroServiceBaseUrl}`,authParams:{userId:B?.userId??"",sessionId:B?.zeniSessionId??"",tenantId:I?.tenantId??""},onSkipAutofill:()=>o(!1),onInvoiceUpload:p=>{p!=null&&t(ae(p,a,!0,r,B?.userId))},updateInvoiceUploadFetchState:p=>{t(ne({reimbursementId:r,fetchState:p}))},allowMultiFiles:m,showInfoText:!1,type:"reimbursement",style:{width:"100%",paddingTop:j.sp5,paddingRight:j.sp3,paddingBottom:j.sp5,paddingLeft:j.sp3},dropFilePlaceholder:{upload:L.dropReceipt.upload,single:L.dropReceipt.single,or:L.dropReceipt.or,multiple:L.dropReceipt.multiple,receipts:L.dropReceipt.receipts}})]}):null,s.jsx(Wn,{windowSize:c,children:s.jsx(Nn,{initialOpenThreadRequest:P??void 0,isReimbursementCommentingEnabled:h,location:n,navigate:e,currentTenant:I,reimbursementId:r,themeState:d,uncategorizedAccounts:$,disableInternalOverlay:!0,showSkipAutoFill:m,setShowSkipAutoFill:o,onCurrentLineIdForUploadChange:i,isAiCfoAccessEnabled:D,onAskAiCfoClick:u})})]})}const zn=_.div`
|
|
2
2
|
display: flex;
|
|
3
3
|
position: relative;
|
|
4
4
|
height: 100vh;
|
|
5
5
|
flex-direction: ${e=>e.windowSize==="small"?"column":"row"};
|
|
6
6
|
background-color: ${e=>e.theme.colors.grey4};
|
|
7
|
-
`,
|
|
7
|
+
`,Gn=_.div`
|
|
8
8
|
position: fixed;
|
|
9
9
|
top: 0;
|
|
10
10
|
left: 0;
|
|
@@ -12,7 +12,7 @@ import{j as s}from"./liveblocks-8SEYIom7.js";import{h as W,u as re,g as H,i as K
|
|
|
12
12
|
bottom: 0;
|
|
13
13
|
background-color: ${Cn.overlayBackgroundBlack};
|
|
14
14
|
z-index: 5;
|
|
15
|
-
`,
|
|
15
|
+
`,Hn=_.div`
|
|
16
16
|
position: absolute;
|
|
17
17
|
top: 0;
|
|
18
18
|
left: 0;
|
|
@@ -22,7 +22,7 @@ import{j as s}from"./liveblocks-8SEYIom7.js";import{h as W,u as re,g as H,i as K
|
|
|
22
22
|
display: flex;
|
|
23
23
|
background-color: transparent;
|
|
24
24
|
overflow: hidden;
|
|
25
|
-
`,
|
|
25
|
+
`,Zn=_.div`
|
|
26
26
|
position: fixed;
|
|
27
27
|
top: 0;
|
|
28
28
|
left: 0;
|
|
@@ -33,7 +33,7 @@ import{j as s}from"./liveblocks-8SEYIom7.js";import{h as W,u as re,g as H,i as K
|
|
|
33
33
|
flex-direction: column;
|
|
34
34
|
overflow-y: auto;
|
|
35
35
|
background-color: ${e=>e.theme.colors.grey4};
|
|
36
|
-
`,
|
|
36
|
+
`,Vn=_.button`
|
|
37
37
|
align-self: flex-end;
|
|
38
38
|
background: none;
|
|
39
39
|
border: none;
|
|
@@ -48,12 +48,12 @@ import{j as s}from"./liveblocks-8SEYIom7.js";import{h as W,u as re,g as H,i as K
|
|
|
48
48
|
width: ${j.sp4};
|
|
49
49
|
height: ${j.sp4};
|
|
50
50
|
}
|
|
51
|
-
`,
|
|
51
|
+
`,Wn=_.div`
|
|
52
52
|
display: flex;
|
|
53
53
|
flex-direction: column;
|
|
54
54
|
width: 100%;
|
|
55
55
|
${e=>e.windowSize!=="small"?"overflow: auto;":""}
|
|
56
|
-
`,
|
|
56
|
+
`,Jn=X(function(e,t){const n=Ue(e,t.reimbursementId),r=O.getSignedInUser(),d=ce(r),c=e.tenantState.currentTenantId,m={userId:r?.userId??"",sessionId:r?.zeniSessionId??"",tenantId:c??""},o=`${n.createdBy?.firstName??"Zeni"} ${n.createdBy?.lastName??""}`;let a=!1;n?.remiActivities.length>0&&(a=Nt(n.remiActivities,zt(t.currentTenant),r));const i=me(t.currentTenant?.userRole??[]),l=r?.userId===n.createdBy?.userId;return{remiDetails:n,uploadInvoiceEndPoint:`${Y.communicationAgentMicroServiceBaseUrl}`,authParams:m,signedInUser:r,createdBy:o,isRealTimeApprovalEnabled:t.isRealTimeApprovalEnabled,isAdmin:i,showApproveRejectBtns:a,isZeniUser:d,isSignedInUserReimbursementCreator:l,isAccountingClassesEnabled:Te(e)}},function(e,t){const{reimbursementId:n,currentTenant:r,location:d,navigate:c,themeState:m}=t,{tenantEmailDomain:o}=r;return{onDuplicateLineClick:(a,i)=>window.open(`/${o}/reimbursement/${a}#L${i}`),redirectToReimbursementListScreen:()=>{e(Fe());const a=Ke(o),i=H(d.state?.pathnameStackToGoBack,d.pathname);c(a,{state:{pathnameStackToGoBack:i}})},onSaveRealTimeApprovals:a=>{e(Zt(n,"reimbursement",a))},updateEditRealTimeApproverClicked:a=>{e(Ht({isEdit:a,entityId:n,entityType:"reimbursement"}))},approveOrRejectRemi:a=>{a.type==="approved"?e(Re(n,a.type,"")):e(Re(n,a.type,a.description??""))},redirectToEditableReimbursementScreen:()=>{const a=H(d.state?.pathnameStackToGoBack,d.pathname);c("./edit",{state:{pathnameStackToGoBack:a}})},deleteReimbursement:()=>{v.trackReimbursementDeleteReimbursement(n),e(je(n))},cancelAndDeleteReport:a=>{a===!0?v.trackReimbursementCancelAndDeleteReimbursement(n):v.trackReimbursementCancelReimbursement(n),e(Gt(n,a))},handleZeniLogoClick:()=>{m.toggle()}}})(wn);function Xn(){const e=J(),t=re(),n=Z(),r=n.hash.substring(1),d=ze(),{reimbursementId:c}=K(),m=O.getSignedInUser(),o=E(y=>V(y)),a=E(y=>Ue(y,c??"")),i=a.remiDetails?.reimbursementInfo.stage.code==="draft",l=qe(o?.companyId,{clearParams:a.fetchState==="Completed"&&!i}),{isAiCfoAccessEnabled:b,onAskAiCfoClick:R}=be({mobileExploreReferrer:"Reimbursement Details"});Ve({isDataReady:a.fetchState==="Completed"});const{useFeatureGate:h}=Q(),{isFeatureEnabled:D}=h(k.isLimitedCategoryForReimbursement),[u,w]=f.useState(!1),[T,A]=f.useState(!1),[F,x]=f.useState(!1),{isFeatureEnabled:B}=h(k.isReimbursementCommentingEnabled),{isFeatureEnabled:I}=h(k.isShowDeletedReimbursementsFeatureEnabled),g=E(y=>le(y,c??"")),P=Ot(o),U=$t(o.userRole),$=a.fetchState;if(f.useEffect(()=>{u||c==null?u==1&&$==="Error"&&e("page-not-found",{replace:!0}):(w(!0),t(Mt(c,!1,I)))},[u,c,t,$]),f.useEffect(()=>{I&&a.remiDetails?.isDeleted===!0||o.isZeni===!0&&m?.userEmailDomain==="zeni.ai"&&P===!1?x(!1):x(a.remiActivities[0]?.isRealTimeApprovalEnabled&&(U||a.allApprovers.find(y=>y.user.userId===m?.userId)!=null||a.remiDetails?.lastUpdatedBy===m?.userId))},[a.remiActivities[0]?.isRealTimeApprovalEnabled,a.allApprovers,a.remiDetails?.lastUpdatedBy,U,o.isZeni,P,m]),f.useEffect(()=>{T||a.fetchState!="Completed"||a.remiDetails?.reimbursementInfo.stage.code=="paid"||a.remiDetails?.reimbursementInfo.stage.code=="scheduled"||g.fetchState=="Completed"||g.fetchState=="In-Progress"||(A(!0),t(Be(!1,D,I,c)),a.remiActivities[0]?.isRealTimeApprovalEnabled===!0&&t(_t(!1,!0,!0,a.lastUpdatedByUserId)))},[T,a,c,t]),m==null)throw Error("Can't access address page without signing in...");return a.remiDetails?.reimbursementInfo.stage.code=="draft"&&g.fetchState=="Completed"&&a.remiDetails.isDeleted===!1?s.jsx(M,{to:`./edit${n.search}`}):a.deleteStatus.fetchState==="In-Progress"||a.cancelAndDeleteStatus.fetchState==="In-Progress"||a.remiDetails?.reimbursementInfo.stage.code=="draft"&&g.fetchState!="Completed"||a.fetchState!="Completed"?s.jsx(He,{}):s.jsxs(s.Fragment,{children:[s.jsx(ee,{analytics:v,onLoad:y=>(p=>{c!=null&&p.trackReimbursementReimbursementDetails(c)})(y)}),s.jsx(Jn,{initialOpenThreadRequest:l??void 0,scrollId:r,isReimbursementCommentingEnabled:B,isShowDeletedReimbursementEnabled:I,location:n,navigate:e,isRealTimeApprovalEnabled:F,currentTenant:o,reimbursementId:c??"",themeState:d,isAiCfoAccessEnabled:b,onAskAiCfoClick:R})]})}const qn=X(function(e,t){return{remisReviewView:Le(e),analytics:t.analytics}},function(e,t){return{onCloseOverlay:()=>{t.navigate("./"),e(G())},onCloseReviewItem:n=>{e(Wt(n))},onProceedForBulkActionClick:(n,r)=>{switch(n){case"send_for_approval":e(Vt());break;case"approve":e(Ae("approved",r??""));break;case"reject":e(Ae("rejected",r??""))}}}})(xn);function Yn(){const e=J(),t=E(c=>c.remisBulkActionViewState.bulkSubmissionFetchState.fetchState),{remisForReview:n}=E(c=>Le(c)),r=te(),d=r?.loggedInUserRole?.includes("admin")===!0;return f.useEffect(()=>{t!=="Completed"&&n.length!==0||e("./")},[t,n.length]),s.jsx(qn,{navigate:e,analytics:v,isAdmin:d})}const z=tn(),Qe="bulk-operation-update",oe="reimbursement-approval-rule-update",{spendManagement:Kn,common:we}=Ze.getLocalizedStrings(),xe=Kn.reimbursement.bulkActions,Qn=_.div`
|
|
57
57
|
display: flex;
|
|
58
58
|
min-height: 100%;
|
|
59
59
|
width: 100%;
|
|
@@ -61,8 +61,8 @@ import{j as s}from"./liveblocks-8SEYIom7.js";import{h as W,u as re,g as H,i as K
|
|
|
61
61
|
flex-direction: column;
|
|
62
62
|
align-items: center;
|
|
63
63
|
background-color: ${e=>e.theme.colors.grey4};
|
|
64
|
-
`,ea=X(function(e,t){const n
|
|
64
|
+
`,ea=X(function(e,t){const n=$e(e,z,t.isBulkActionEnabled);let r=n.allSubTabs;const d=O.getSignedInUser(),c=ce(d),m=e.tenantState.currentTenantId,o=V(e),a=o?.companyName??"",i={userId:d?.userId??"",sessionId:d?.zeniSessionId??"",tenantId:m??""},l=e.remiListState.downloadUIState.downloadState;t.isShowDeletedReimbursementEnabled===!1&&(r=r.filter(h=>h!=="deleted"));const b=n.fetchState,R=nn(e);return{transactionList:t.isShowDeletedReimbursementEnabled?n.reimbursements:n.reimbursements.filter(h=>h.isDeleted===!1),isAdmin:t.isAdmin,isZeniUser:c,isBillPayCommentingEnabled:t.isBillPayCommentingEnabled,isReimbursementCommentingEnabled:t.isReimbursementCommentingEnabled,allSubTabs:r,isEmployee:t.isEmployee,currentTab:n.currentTab,currentSubTab:n.currentSubTab,approvalCount:n.approvalCount,fetchState:b,botEmail:n.reimbursementBotEmail,analytics:v,uiState:n.uiState,searchText:n.searchText,filters:n.filters,downloadParams:{authParams:i,companyName:a,timePeriod:z,spendManagementEndPoint:`${Fn}/spendManagement`,isShowDeletedBillsEnabled:t.isShowDeletedBillsEnabled,isShowDeletedReimbursementEnabled:t.isShowDeletedReimbursementEnabled},downloadState:l,isBulkActionAllowed:n.remiListBulkActionInfo?.isBulkActionAllowed,transactionsSelectedForBulkAction:n.remiListBulkActionInfo?.remisSelectedForBulkAction,allowedBulkActions:n.remiListBulkActionInfo?.allowedBulkActions,remiApprovalRulesAffectedEntityIds:R.affectedEntityIds}},function(e,t){const{navigate:n,currentTenant:r,location:d,period:c}=t,{tenantEmailDomain:m}=r;return{updateTabToState:o=>{e(G()),e(Pe(o))},onSubtabChange:o=>{e(G()),e(Oe(o))},onTransactionClick:(o,a)=>{const i=aa(m,o,a),l=H(d.state?.pathnameStackToGoBack,d.pathname);n(i,{state:{pathnameStackToGoBack:l}})},onClickSetupIcon:()=>{const o=na(m),a=H(d.state?.pathnameStackToGoBack,d.pathname);n(o,{state:{pathnameStackToGoBack:a}})},onAddTransactionClick:()=>{const{tenantEmailDomain:o}=t.currentTenant;v?.trackReimbursementNewReimbursement();const a=`/${o}/reimbursement/new`,i=H(t.location.state?.pathnameStackToGoBack,t.location.pathname);t.navigate(a,{state:{pathnameStackToGoBack:i}})},onColumnSortConfigChanged:(o,a)=>{e(dn({uiState:{sortKey:o,sortOrder:a},period:t.period}))},onSearchTextChanged:o=>{e(cn(o))},onFiltersChange:o=>{e(mn({filters:o})),o.categories.every(a=>a.field!=null&&a.values?.length!==0)&&v.trackSpendManagmentFilterChange("reimbursement",o.categories.map(a=>`${a.field}-${JSON.stringify(a.values)}`))},updateDownloadStateHandler:o=>{o==="In-Progress"&&v.trackSpendManagementDownloadClick("reimbursement"),e(ln({uiState:{downloadState:o}}))},onReloadTransactions:()=>{e(se(c,!0,t.isShowDeletedReimbursementEnabled,!1,!0))},onBackClick:()=>{n("../",{relative:"path"})},onNavigateToSettings:()=>{n("../reimbursements/setup")},updateBulkActionList:o=>{e(rn(o))},removeAllTransactionsFromBulkActionList:()=>{e(G())},onProceedForBulkActionClick:(o,a)=>{switch(o){case"delete":case"cancel":e(on(o,a??""));break;case"send_for_approval":e(ke("send_for_approval")),t.navigate("./bulk-review");break;case"review":e(ke("approve")),t.navigate("./bulk-review")}},onReimbursementApprovalRulesEventReceived:o=>{o.endsWith(oe)&&e(sn(!1))},onEventReceived:o=>{o===Qe&&e(an())}}})(Tn(jn));function ta(){const e=J(),t=re(),n=Z(),r=n.state,d=Ge(),[c,m]=f.useState(null),o=mt("/:tenantEmailDomain/reimbursements/bulk-review")!=null;f.useEffect(()=>{if(r?.tab!=null&&r?.subTab!=null){const S=Jt(r.tab.toString());S!=null?t(Pe(S)):console.log("Warning:Not a valid remiListTab");const N=Xt(r.subTab.toString());N!=null?t(Oe(N)):console.log("Warning:Not a valid remiListSubTab")}return()=>{t(G())}},[]);const{useFeatureGate:a}=Q(),{isFeatureEnabled:i}=a(k.isShowDeletedBillsFeatureEnabled),{isFeatureEnabled:l}=a(k.isShowDeletedReimbursementsFeatureEnabled),{isFeatureEnabled:b}=a(k.isBillPayCommentingEnabled),{isFeatureEnabled:R}=a(k.isReimbursementCommentingEnabled),{isFeatureEnabled:h}=a(k.isReimbursementBulkActionEnabled),D=O.getSignedInUser(),u=E(S=>V(S)),[w,T]=f.useState(!1),[A,F]=f.useState(!1),x=te(),B=x?.loggedInUserRole?.includes("admin")===!0,I=E(S=>$e(S,z,h)),{areTenantIdsInSync:g}=Bn(),P=I.fetchState,{isAiCfoAccessEnabled:U,onAskAiCfoClick:$}=be({mobileExploreReferrer:"Reimbursement List"});if(Ve({isDataReady:P==="Completed"}),f.useEffect(()=>{!A&&g&&(F(!0),t(se(z,!0,l,!1,!0)))},[A,z,t,g]),D==null)throw Error("Can't access address page without signing in...");const y=!!u?.userRole&&qt(u),p=de(x?.loggedInUserRoleMap),W=ue(x?.loggedInUserRoleMap),et=!!u.userReimbursementInfo?.isReimbursementTOSAccepted,tt=!!u.companyReimbursementInfo?.info?.isReimbursementEnabled,nt=!!u.companyReimbursementInfo?.info?.isReimbursementTOSAccepted,at=E(S=>De(S.companyState,u.companyId)),st=at?.company.featuresActivationInfo.connectedAccountProvider,ge=S=>{T(S)},{isFeatureEnabled:it}=a(k.isDebitCardFeatureEnabled),ot=Me(it,u),rt=_e(u),{remisProcessed:q,remisProcessing:he}=E(S=>Yt(S));f.useEffect(()=>{q===he&&c!=null&&(t(Kt({messageSection:"reimbursement_bulk_processed",messageText:"success",type:"success",showStatusIcon:!0,variables:[{variableName:"_report_",variableValue:q>1?xe.reports:xe.report},{variableName:"_has_",variableValue:q>1?we.texts.have:we.texts.has},{variableName:"_action_",variableValue:Qt(c)}]})),t(en()),setTimeout(()=>{t(se(z,!0,l,!1,!0,!0))},3e3),m(null))},[q,he]);const lt={events:u.companyId!=null?[`private-encrypted-${u.companyId}.${Qe}`,`private-encrypted-${u.companyId}.${oe}`]:[],eventCallback:(S,N,fe)=>{S.endsWith(oe)?fe.onReimbursementApprovalRulesEventReceived?.(S):N.entity_type==="reimbursement"&&(m(N.operation_type),fe.onEventReceived(S))}};return n.pathname.endsWith("/reimbursements/")||n.pathname.endsWith("/reimbursements")||n.pathname.endsWith("/reimbursements/bulk-review")?ot===!0||rt===!0?s.jsx(Xe,{}):tt&&(!y||p)||W&&et?s.jsxs(s.Fragment,{children:[P==="Completed"?s.jsx(ee,{analytics:v,onLoad:S=>(N=>N.trackPageLoaded(We.Event.reimbursementHome))(S)}):null,s.jsx(Ye,{isAppContentDrawerOpen:w,handleDrawerToggle:ge}),s.jsxs(Qn,{windowSize:d,children:[s.jsx(On,{isOpen:o,drawerLeftMargin:new Dn(0,0,300,600),onClose:()=>{e("./"),t(G())},children:s.jsx(sa,{onClick:S=>S.stopPropagation(),children:s.jsx(Yn,{})})}),s.jsx(ea,{isShowDeletedBillsEnabled:i,isShowDeletedReimbursementEnabled:l,isBillPayCommentingEnabled:b,isReimbursementCommentingEnabled:R,location:n,navigate:e,currentTenant:u,period:z,isAdmin:B,isEmployee:y,entity:"reimbursement",onClickMenuIcon:()=>{ge(!0)},createdByUserList:I.createdByUserList,createdByUserListFetchState:I.createdByUserListFetchState,isDownloadEnabled:I.isDownloadEnabled,connectedAccountProvider:st,isBulkActionEnabled:h,bulkSubmissionLimit:I.remiBulkSubmissionLimit,bulkSubmissionFetchState:I.remiListBulkActionInfo.bulkSubmissionFetchState,isAiCfoAccessEnabled:U,onAskAiCfoClick:$,...lt})]})]}):nt&&p?s.jsx(M,{to:"../setup"}):x!=null&&Ne(u,x.loggedInUserRoleMap)?s.jsx(M,{to:"../promo"}):s.jsx(pe,{fetchState:"In-Progress"}):s.jsx(ie,{})}const na=e=>`/${e}/reimbursements/setup`,aa=(e,t,n)=>{let r=`/${e}/reimbursement/${encodeURIComponent(t)}`;return n=="draft"&&(r+="/edit"),r},sa=_(Pn)`
|
|
65
65
|
display: flex;
|
|
66
66
|
min-height: 100%;
|
|
67
67
|
flex-direction: column;
|
|
68
|
-
`,ia=X(function(e,t){const{companyId:n}=t;return{reimbursementSetupView:un(e,n),analytics:v,meetingUrl:"https://meetings.hubspot.com/niharn/demo-reimbursements?embed=true",videoUrl:"https://player.vimeo.com/video/814821498?h=e7fd11e13e&badge=0&autopause=0&player_id=0&app_id=122963"}},function(e,t){const{companyId:n,navigate:r}=t;return{onSetupButtonClick:()=>{e(bn(n))},onCreateNewRemiButtonClick:()=>{e(pn(t.userRoleId))},onBackClick:()=>{r("../..",{relative:"path"})},onSetupReimbursementSuccess:()=>{t.isEmployee?r("../../reimbursement/new",{relative:"path"}):r("../reimbursements/setup",{relative:"path"})}}})(Un),oa=()=>{const e=
|
|
68
|
+
`,ia=X(function(e,t){const{companyId:n}=t;return{reimbursementSetupView:un(e,n),analytics:v,meetingUrl:"https://meetings.hubspot.com/niharn/demo-reimbursements?embed=true",videoUrl:"https://player.vimeo.com/video/814821498?h=e7fd11e13e&badge=0&autopause=0&player_id=0&app_id=122963"}},function(e,t){const{companyId:n,navigate:r}=t;return{onSetupButtonClick:()=>{e(bn(n))},onCreateNewRemiButtonClick:()=>{e(pn(t.userRoleId))},onBackClick:()=>{r("../..",{relative:"path"})},onSetupReimbursementSuccess:()=>{t.isEmployee?r("../../reimbursement/new",{relative:"path"}):r("../reimbursements/setup",{relative:"path"})}}})(Un),oa=()=>{const e=J(),t=Z(),{tenantEmailDomain:n}=K(),r=Je(),[d,c]=f.useState(!1),m=E(A=>V(A)),o=O.getSignedInUserTenant(n)?.companyId??m.companyId,a=O.getSignedInUser(),i=m.userRoleId,l=!!m.userRole?.includes("reimbursements_user"),b=te(),R=de(b?.loggedInUserRoleMap),h=ue(b?.loggedInUserRoleMap),D=!!m.userReimbursementInfo?.isReimbursementTOSAccepted,u=!!m.companyReimbursementInfo?.info?.isReimbursementEnabled,w=!!m.companyReimbursementInfo?.info?.isReimbursementTOSAccepted,T=A=>{c(A)};if(a==null)throw Error("Can't access reimbursement promo page without signing in...");return u&&h&&D?s.jsx(M,{to:"../../../reimbursements"}):w&&R?s.jsx(M,{to:"../../reimbursements/setup"}):m.companyReimbursementInfo&&!w||m.userReimbursementInfo&&h&&D===!1?s.jsxs(s.Fragment,{children:[s.jsx(ee,{analytics:v,onLoad:A=>(F=>F.trackPageLoaded(We.Event.reimbursementPromoPage))(A)}),s.jsx(Ye,{isAppContentDrawerOpen:d,handleDrawerToggle:T}),s.jsx(ia,{companyId:o,navigate:e,location:t,userReimbursementInfo:m.userReimbursementInfo,userRoleId:i,isEmployee:l,onClickMenuIcon:()=>{T(!0)}})]}):s.jsx(pe,{fetchState:"In-Progress",style:{backgroundColor:r.colors.grey5}})};function Pa(){const e=E(W=>V(W)),t=te(),n=!!e.company?.companyReimbursementInfo.isReimbursementEnabled,r=Je(),d=!!e.company?.companyReimbursementInfo.isReimbursementTOSAccepted,c=!!e.userReimbursementInfo?.isReimbursementTOSAccepted,{useFeatureGate:m}=Q(),{isFeatureEnabled:o}=m(k.isChargeCardFeatureEnabled),{isFeatureEnabled:a}=m(k.isDebitCardFeatureEnabled),i=Me(a,e),l=_e(e),b=e?.userRole!=null&&gn(e?.userRole),R=(e?.company==null||e.company.featuresActivationInfo?.isBillPayFeatureEnabled&&!b)&&hn(t?.loggedInUserRoleMap),h=fn(t?.loggedInUserRoleMap),D=e?.company==null||e.company.featuresActivationInfo?.isReimbursementFeatureEnabled&&!b,u=de(t?.loggedInUserRoleMap),w=D&&u,{isFeatureEnabled:T}=m(k.isDepositAccountsFeatureEnabled),A=T&&!b&&Sn(t?.loggedInUserRoleMap),F=Ln(e,o,a)&&!b&&In(t?.loggedInUserRoleMap),x=yn(t?.loggedInUserRoleMap),B=Rn(t?.loggedInUserRoleMap),I=An(t?.loggedInUserRoleMap),g=kn(t?.loggedInUserRoleMap),P=vn(t?.loggedInUserRoleMap),U=ue(t?.loggedInUserRoleMap),{tenantEmailDomain:$}=K(),y=Z(),p=n===!0&&(u||U&&c);return s.jsxs(ct,{children:[y.pathname.includes("/reimbursements")?s.jsxs(s.Fragment,{children:[s.jsx(C,{path:"verification",element:s.jsx(Ce,{isBillPayAdminLevelAccess:R,isUserHasOnlyBillPayAccess:h,isReimbursementAdminLevelAccess:w,isZeniAccountAdminLevelAccess:A,isChargeCardAdminLevelAccess:F,isUserHasOnlyCardAccess:x,productType:"reimbursement",type:"verification"})}),s.jsx(C,{path:"setup",element:s.jsx(Ce,{isBillPayAdminLevelAccess:R,isUserHasOnlyBillPayAccess:h,isReimbursementAdminLevelAccess:w,isZeniAccountAdminLevelAccess:A,isChargeCardAdminLevelAccess:F,isUserHasOnlyCardAccess:x,productType:"reimbursement",type:"setup"})}),s.jsx(C,{path:"promo",element:s.jsx(oa,{})}),s.jsx(C,{path:"approval-rules/*",element:w?s.jsx($n,{}):s.jsx(Mn,{isUserHasZeniAccountsAccess:B,isUserHasChargeCardAccess:g,isUserHasBillPayAccess:P,isUserHasReimbursementAccess:U,isUserHasTreasuryAccess:I,isTenantBankingOnly:i,tenantEmailDomain:$??""})}),p&&s.jsx(C,{path:"*",element:s.jsx(ta,{})}),(i===!0||l===!0)&&s.jsx(C,{path:"/*",element:s.jsx(Xe,{})}),t!=null&&Ne(e,t?.loggedInUserRoleMap)&&s.jsx(C,{path:"*",element:s.jsx(M,{to:"../promo"})}),d&&u&&s.jsx(C,{path:"*",element:s.jsx(M,{to:"../setup"})})]}):y.pathname.includes("/reimbursement")?s.jsxs(s.Fragment,{children:[s.jsx(C,{path:"new",element:s.jsx(Ee,{})}),s.jsx(C,{path:":reimbursementId",element:s.jsx(Xn,{})}),s.jsx(C,{path:":reimbursementId/edit",element:s.jsx(Ee,{})}),s.jsx(C,{path:"*",element:s.jsx(ie,{})})]}):s.jsx(C,{path:"*",element:s.jsx(pe,{fetchState:"In-Progress",style:{backgroundColor:r.colors.grey5,boxShadow:`0px 2px ${j.sp1} ${r.colors.dropShadowNormal}`}})}),s.jsx(C,{path:"*",element:s.jsx(ie,{})})]})}export{Pa as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{j as p}from"./liveblocks-BrHep0IE.js";import{g as z,h as ge,u as Ce,i as Ie,j as d,n as we,o as Se,p as G}from"./core-CjggIORY.js";import{eR as v,ff as I,Kr as Re,jI as Q,p_ as W,qP as F,jw as Te,iA as Oe,uc as X,qU as Ae,bt as Fe,Ks as ke,bn as De,vl as je,Kt as Ee,Ku as Pe,u4 as Me,Kv as H,Kw as ve,Kx as Le,Ky as Be,Kz as Ke,KA as w,KB as k,KC as D,KD as Y,KE as j,KF as E,dE as Ve,v1 as Ue,uR as N,uS as q,v7 as xe,uW as $,vd as ze,KG as Ge,KH as He,KI as Ye,KJ as Ne,KK as qe,f0 as $e,e_ as Ze}from"./zeni-epic-state-BY4R57V8.js";import{M as Je,N as Qe,O as We,R as Xe,J as ea,s as ee,d as P,z as ae,V as aa,k as sa,a as ta,X as oa,Z as na,x as ra,e as M,g as ia,_ as la,v as se,a0 as ca,a1 as da,a2 as pa}from"./index-T3RPvQKw.js";import"./mui-BHbKLhAL.js";import fa from"./NotFoundScreen-B4DpKEjs.js";import{F as ma}from"./FeaturePreviewScreen-CQMcWtea.js";import{a as _}from"./sentry-Bhe05Ckf.js";import{u as ua}from"./useInitialThreadRequest-C0UyKc5f.js";import{t as Z,a as J,b as _a}from"./routePaths-BO2NCass.js";import{M as ha}from"./MobileAppDrawer-Mbdc14x0.js";import"./recharts-CqDxIFtp.js";import"./analytics-CgnjVt5D.js";import"./plaid-Ki-s5Z-l.js";import"./dnd-BkcbdaLH.js";import"./stripe-DMRn4zHo.js";import"./lottie-apaaj5nl.js";import"./lexical-ztGMt0Co.js";import"./pdf-DUoZzTWI.js";import"./utils-BWXl495q.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]="f276b2f1-42a1-492f-ade1-70a9fb8d7991",e._sentryDebugIdIdentifier="sentry-dbid-f276b2f1-42a1-492f-ade1-70a9fb8d7991")}catch{}})();const ba=["profit_loss","balance_sheet","cash_flow"],y=e=>{e(E({resetLeftScroll:!0})),e(j({resetLeftScroll:!0})),e(D({resetLeftScroll:!0})),e(k({resetLeftScroll:!0}))},ya=e=>{e(He()),e(Ye()),e(Ne()),e(qe())},ga=we(function(e){const o=ae.getSignedInUser(),f=e.tenantState.currentTenantId,u=v(e),a=u?.companyName??"",s={userId:o?.userId??"",sessionId:o?.zeniSessionId??"",tenantId:f??""},t=I(e),r=ke(u);return{fetchState:t.fetchState,selectedTimeframe:t.filter.timeframe,selectedReport:t.selectedReportId,displayOrder:t.displayOrder,reportFormat:t.reportFormat,dataAvailable:t.dataAvailable,balancesInTimeframe:t.balancesInTimeframe,allTimeframeTicks:t.allTimeframeTicks,selectedCOABalancesRange:t.filter.balancesRange,isCompareMode:t.isCompareModeOn,profitAndLossReport:t.profitAndLossReport,profitAndLossClassesViewReport:t.profitAndLossByClassReport,profitAndLossProjectViewReport:t.profitAndLossByProjectReport,profitAndLossByClassHorizontalReport:t.profitAndLossByClassHorizontalReport,balanceSheetReport:t.balanceSheetReport,cashFlowReport:t.cashFlowReport,downloadState:t.downloadState,analytics:M,isZeniUser:De(o),showAccountGroups:r===!0,isAccountingClassesEnabled:Q(e),isAccountingProjectsEnabled:W(e),currentTenantCompanyName:a,statementEndPoint:`${pa}/statement`,authParams:s,isZeniCOAUsed:r}},function(e,o){const{navigate:f,handleDrawerToggle:u}=o;return{onReloadReport:()=>{o.signedInUser!=null&&e(F(o.signedInUser.userId,!0,!1))},updateDownloadStateHandler:a=>{e(Ge(a))},onTimeframeSelectionChanged:(a,s,t)=>{if(e(ze(a)),s){const{isCompareModeOn:r,filter:l}=o,{additionalBalances:m,balancesRange:c}=l;let i=[...m];a==="year"&&(i=i.filter(g=>g!=="this_period_vs_same_period_last_year"&&g!=="this_period_vs_same_period_last_year_percent"&&g!=="same_period_last_year")),e(N(o.firstMonthOfFY,r,c.numberOfPeriods<1?1:c.numberOfPeriods,i)),m.length>0&&e(q(o.firstMonthOfFY,i.includes("this_period_vs_last_period")?"compare_mode_amount":"compare_mode_percent",c.numberOfPeriods<1?1:c.numberOfPeriods,i))}t!==!0&&setTimeout(()=>y(e),50)},onReportSelectionChanged:a=>{const s=o.selectedReportID;if(a===s)return;const t=o.classViewLayout;e(w(a)),(a==="balance_sheet"||a==="cash_flow")&&s==="profit_and_loss_by_classes"&&t==="horizontal"&&e($({numberOfPeriods:1,orderBy:"ascending_date"})),a!=="profit_and_loss"&&a!=="profit_and_loss_by_classes"&&s==="profit_and_loss_by_classes"&&t==="horizontal"&&e(H({classViewLayout:"vertical"})),y(e)},onCOABalancesRangeChanged:(a,s)=>{e($(a,s)),y(e)},onThisPeriodChanged:(a,s,t)=>{e(xe(o.firstMonthOfFY,a,s<1?1:s)),t!==!0&&y(e)},onAdditionalBalanceSelectionChanged:(a,s,t,r)=>{e(N(o.firstMonthOfFY,a,t<1?1:t,s)),s.length>0&&e(q(o.firstMonthOfFY,s.includes("this_period_vs_last_period")?"compare_mode_amount":"compare_mode_percent",t<1?1:t,s)),r!==!0&&o.isCompareModeOn===a||setTimeout(()=>y(e),50)},onUpdateHighlightedNumberOfPeriods:(a,s,t,r)=>{e(Ue({firstMonthOfFY:o.firstMonthOfFY,isCompareModeOn:s,additionalBalances:a,maxNumOfPeriodsToHighlight:t<1?1:t,coaBalances:r}))},onAccountBalanceClick:o.hasTransactionAccess!==!0?void 0:(a,s,t)=>{let r,l;if(s.balanceTimeFrame==="month"||s.balanceTimeFrame==="quarter"?(r=s.balanceTimeFrame,l=Ve(s)):s.balanceTimeFrame==="year"?(r="quarter",l={startDate:s.endDate.startOf("quarter"),endDate:s.endDate}):console.error(`timeframe ${s.balanceTimeFrame} is not supported`),l!=null&&r!=null){const m=a.accountName===""?a.accountDescription:a.accountName,c=(()=>{if(o.selectedReportID==="profit_and_loss_by_classes"&&o.classViewLayout==="horizontal"&&a.accountType!=null){if(t?.isHorizontalClassTotalColumn===!0)return Z(o.tenantEmailDomain,a.accountId,a.accountType,m,r,l);if(t?.isHorizontalClassColumn===!0&&s.id!=null)return J(o.tenantEmailDomain,a.accountId,a.accountType,s.id,m,r,l)}return a.projectsViewParentId?.projectId!=null&&a.accountType!=null?_a(o.tenantEmailDomain,a.accountId,a.accountType,a.projectsViewParentId.projectId,m,r,l):a.classesViewParentId!=null&&a.classesViewParentId.parentClassId!=null&&a.accountType!=null?J(o.tenantEmailDomain,a.accountId,a.accountType,a.classesViewParentId.parentClassId[0],m,r,l):a.accountType!=null?Z(o.tenantEmailDomain,a.accountId,a.accountType,m,r,l):void 0})();if(c!=null){const i=se(o.location.state?.pathnameStackToGoBack,o.location.pathname);f(c,{state:{pathnameStackToGoBack:i,referrer:S(o.selectedReportID)}})}}},onTableScroll:(a,s)=>{switch(a){case"profit_and_loss":e(E({scrollPosition:s}));break;case"profit_and_loss_by_classes":e(j({scrollPosition:s}));break;case"profit_and_loss_by_projects":e(Y({scrollPosition:s}));break;case"balance_sheet":e(D({scrollPosition:s}));break;case"cash_flow":e(k({scrollPosition:s}));break;default:console.log(`Table Scroll state for ${a} is not handled`)}},onElementCollapseStateChanged:(a,s,t)=>{switch(a){case"profit_and_loss":e(E({nodeCollapseState:{nodeId:s,isCollapsed:t}}));break;case"profit_and_loss_by_classes":e(j({nodeCollapseState:{nodeId:s,isCollapsed:t}}));break;case"profit_and_loss_by_projects":e(Y({nodeCollapseState:{nodeId:s,isCollapsed:t}}));break;case"balance_sheet":e(D({nodeCollapseState:{nodeId:s,isCollapsed:t}}));break;case"cash_flow":e(k({nodeCollapseState:{nodeId:s,isCollapsed:t}}));break;default:console.log(`Collapse state toggle for ${a} is not handled`)}},onBackClick:()=>{f("../../")},onUpdateAccountViewMode:a=>{e(Be({viewMode:a})),e(Ke({viewMode:a})),a==="classes"?(o.analytics?.trackGroupBySwitch("Classes",S(o.selectedReportID)),e(w("profit_and_loss_by_classes"))):a==="project"?(o.analytics?.trackGroupBySwitch("Projects",S(o.selectedReportID)),e(w("profit_and_loss_by_projects"))):(o.analytics?.trackGroupBySwitch("Accounts",S(o.selectedReportID)),e(w("profit_and_loss"))),y(e)},onUpdateClassesToFilterOut:a=>{e(Le({classesToFilterOut:a}))},onUpdateProjectsToFilterOut:a=>{e(ve({projectsToFilterOut:a}))},onUpdateClassViewLayout:a=>{e(H({classViewLayout:a}))},onOpenAccountViewMode:()=>{o.isAccountingClassesEnabled&&e(Me()),o.isAccountingProjectsEnabled&&e(X())},onUpdateDisplayOrder:a=>{e(Pe(a))},onUpdateReportFormat:a=>{ya(e),e(Ee(a))},onClickMenuIcon:()=>{u(!0)},onResyncReports:()=>{e(je("profit_and_loss_by_classes"))}}})(ca);function Ca(){const{isAiCfoOpen:e,setIsAiCfoOpen:o}=Xe(),f=ea(),u=da(f),a=ge(),s=Ce(),t=z(),{tenantEmailDomain:r}=Ie(),{useFeatureGate:l}=ee(),{isFeatureEnabled:m}=l(P.isReportsHorizontalClassLayoutSwitchEnabled),c=ae.getSignedInUser(),[i,g]=_.useState(!1),[L,te]=_.useState(!1),{isFeatureEnabled:B}=l(P.isReportsCommentingEnabled);if(c==null)throw Error("Can't access reports page without signing in...");const R=d(n=>v(n)),oe=R.masterTOSInfo?.isMasterTOSAccepted??!1,ne=R.company?.companyInfo.firstMonthOfFY??1,re=ua(B?R?.companyId:void 0),C=d(n=>I(n).fetchState),ie=d(n=>Re(n)),{areTenantIdsInSync:h}=aa(),T=d(n=>n.financeStatementState.selectedReportId),K=d(n=>Q(n)),O=d(n=>W(n)),le=d(n=>I(n).isCompareModeOn),b=d(n=>I(n).filter),A=d(n=>I(n).selectedReportAndTimeframeFetchState),ce=d(n=>n.profitAndLossClassesViewState.uiState.classViewLayout);_.useEffect(()=>{!i&&h&&(g(!0),s(F(c.userId,!0,!0,!1)))},[i,c,s,h]),_.useEffect(()=>{i&&!L&&C==="Completed"&&h&&(s(F(c.userId,!1,!0,!1)),te(!0))},[i,L,C,h]),_.useEffect(()=>{if(i&&A.fetchState==="Not-Started"&&b.timeframe!=="free_range"&&b.timeframe!=="week"&&h)switch(T){case"profit_and_loss":case"profit_and_loss_by_classes":s(Ae(b.timeframe));break;case"profit_and_loss_by_projects":O&&s(X());break;case"balance_sheet":s(Oe(b.timeframe));break;case"cash_flow":s(Te(b.timeframe))}},[i,T,A,h,K,O]);const V=sa(),de=V?.loggedInUserRole!=null&&Fe(V?.loggedInUserRole)!==!0,[pe,fe]=_.useState(!1),U=n=>{fe(n)},me=ta(),ue=oa();return function(n){const{isDataReady:_e}=n,{pathname:he}=z(),x=Je(he??"")==="reports",be=Qe(_e),ye=_.useMemo(()=>x?ba:void 0,[x]);We({canFetchSuggestedQuestions:be,pageContexts:ye})}({isDataReady:C==="Completed"}),na({isDataReady:C==="Completed"}),p.jsxs(p.Fragment,{children:[C==="Completed"?p.jsx(ra,{analytics:M,onLoad:n=>n.trackPageLoaded(ia.Event.reports)}):null,p.jsx(ha,{isAppContentDrawerOpen:pe,handleDrawerToggle:U}),p.jsx(ga,{firstMonthOfFY:ne,tenantEmailDomain:r,location:t,navigate:a,windowSize:f,classViewLayout:ce,selectedReportID:T,analytics:M,filter:b,isAccountingClassesEnabled:K,isAccountingProjectsEnabled:O,isCompareModeOn:le,hasTransactionAccess:de,signedInUser:c,selectedReportAndTimeframeFetchState:A,handleDrawerToggle:U,reportsResyncFetchState:ie.reportsResyncFetchState,isAiCfoAccessEnabled:ue&&me&&!e,onAskAiCfoClick:()=>{if(oe)if(u){const n=se(t.state?.pathnameStackToGoBack,t.pathname);a(`/${r}/ai-cfo/explore`,{state:{pathnameStackToGoBack:n,referrer:"Reports"}})}else o(!0);else la({location:t,navigate:a,mergeState:{referrer:"Reports"}})},isHorizontalClassReportSwitchEnabled:m,isReportsCommentingEnabled:B,initialOpenThreadRequest:re})]})}const S=e=>{switch(e){case"profit_and_loss":return"Profit & Loss";case"balance_sheet":return"Balance Sheet";case"cash_flow":return"Cash Flow";default:return"Reports"}};function xa(){const e=d(s=>v(s)),{useFeatureGate:o}=ee(),{isFeatureEnabled:f}=o(P.isDebitCardFeatureEnabled),u=$e(f,e),a=Ze(e);return u===!0||a===!0?p.jsx(ma,{}):p.jsxs(Se,{children:[p.jsx(G,{path:"/",element:p.jsx(Ca,{})}),p.jsx(G,{path:"*",element:p.jsx(fa,{})})]})}export{xa as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{j as a}from"./liveblocks-BrHep0IE.js";import{s as j,z as w,aN as b,x as E,e as p,g as R,cQ as F,d as L}from"./index-T3RPvQKw.js";import"./mui-BHbKLhAL.js";import l from"./NotFoundScreen-B4DpKEjs.js";import{a as u}from"./sentry-Bhe05Ckf.js";import{u as P,j as y,h as T,g as V,n as U,o as z,p as f}from"./core-CjggIORY.js";import{eR as A,Rg as C,NR as G,Rh as N,uI as Y,f6 as O,Ri as Q,uG as q}from"./zeni-epic-state-BY4R57V8.js";import{R as x}from"./ReferralListScreen-Fp7Vwl0u.js";import"./recharts-CqDxIFtp.js";import"./analytics-CgnjVt5D.js";import"./plaid-Ki-s5Z-l.js";import"./dnd-BkcbdaLH.js";import"./stripe-DMRn4zHo.js";import"./lottie-apaaj5nl.js";import"./lexical-ztGMt0Co.js";import"./pdf-DUoZzTWI.js";import"./utils-BWXl495q.js";import"./useAskAiCfoHostNavButtonProps-almazpmI.js";import"./MobileAppDrawer-Mbdc14x0.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]="12e0bcb5-fd5b-4218-96c7-5428ae7f8aba",e._sentryDebugIdIdentifier="sentry-dbid-12e0bcb5-fd5b-4218-96c7-5428ae7f8aba")}catch{}})();const B=U(function(e,t){const n=C(e);return{inviteFormView:n.localData,submitStatus:n.saveStatus,userName:t.userName,rewardsPlan:n.rewardsPlan,companyLegalName:t.companyName}},function(e,t){const{navigate:n}=t,o=w.getSignedInUser();return{onDismissClick:()=>{e(N()),n("..")},onSendClick:()=>{if(o!=null){const s=[],r=[];t.inviteFormCompayData.forEach(c=>{s.push(c.companyName),r.push(c.emailIds[0])}),p.trackInviteEmailClicked("send",s,r,s.length)}e(q())},onUpdateInviteFormLocalData:s=>{e(Q({localData:s}))},onSubmitSuccess:()=>{n("../../")},onCancelClick:()=>{o!=null&&p.trackInviteEmailClicked("cancel")}}})(F),H=()=>{const e=P(),[t,n]=u.useState(!1),[o,s]=u.useState(!1),r=y(i=>A(i)),c=T(),_=V(),{useDynamicConfig:g}=j(),d=w.getSignedInUser();if(d==null)throw Error("Can't access invite referral screen without signing in...");const m=y(i=>C(i)),k=d?.firstName!=null?d.firstName:"User",{configValue:h}=g(b.zeniCardsConfig),{configValue:v}=g(b.zeniAccountsConfig),D=G(v);u.useEffect(()=>{e(N()),r?.rewardsLastViewedTime==null&&o===!1&&(e(Y()),s(!0))},[]),u.useEffect(()=>{t||m.fetchState!=="Not-Started"||(n(!0),e(O(!0)))},[m.fetchState,e]);const I=r.company?.companyInfo.companyLegalName??r.companyName;return a.jsxs(a.Fragment,{children:[m.fetchState==="Completed"?a.jsx(E,{analytics:p,onLoad:i=>(S=>S.trackPageLoaded(R.Event.inviteEmailViewed))(i)}):null,a.jsx(B,{navigate:c,location:_,currentTenant:r,companyName:I,userName:k,inviteFormCompayData:m.localData,chargeCardCashbackRatePerTransaction:h.charge_card_cashback_rate_per_transaction!=null?h.charge_card_cashback_rate_per_transaction:.0175,maxAnnualPercentageYield:D.maxAnnualPercentageYield})]})};function fe(){const{useFeatureGate:e}=j(),{isFeatureEnabled:t}=e(L.isReferralFeatureEnabled);return a.jsxs(z,{children:[a.jsx(f,{path:"/",element:t?a.jsx(x,{}):a.jsx(l,{})}),a.jsx(f,{path:"how-it-works",element:t?a.jsx(x,{isReferralDrawerOpen:!0}):a.jsx(l,{})}),a.jsx(f,{path:"refer/*",element:t?a.jsx(H,{}):a.jsx(l,{})}),a.jsx(f,{path:"*",element:a.jsx(l,{})})]})}export{fe as default};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/DashboardRoutes-DYlid3qZ.js","assets/sentry-Bhe05Ckf.js","assets/core-CjggIORY.js","assets/zeni-epic-state-BY4R57V8.js","assets/index-T3RPvQKw.js","assets/mui-BHbKLhAL.js","assets/analytics-CgnjVt5D.js","assets/utils-BWXl495q.js","assets/withTransactionSidePanel-Dpd3vYhS.js","assets/useAskAiCfoHostNavButtonProps-almazpmI.js","assets/TransactionDetailScreen-7oGkn8s8.js","assets/decodeURIComponentSafe-B9x_jCmd.js","assets/routePaths-BO2NCass.js","assets/NotFoundScreen-B4DpKEjs.js","assets/useInitialThreadRequest-C0UyKc5f.js","assets/analyticsHelper-S9v9q0r_.js","assets/CompanyPassportScreen-DkE_gJb0.js","assets/MobileAppDrawer-Mbdc14x0.js","assets/useAiCfoDashboardSuggestedQuestionsChips-BZBtFcNp.js","assets/FeaturePreviewScreen-CQMcWtea.js","assets/ReferralListScreen-Fp7Vwl0u.js","assets/index-R6GjjTB3.css","assets/BillPayRoutes-CGm7mDxV.js","assets/AddressScreen-CCQ88S3j.js","assets/DomesticWireDetailScreen-C3aR_Bfd.js","assets/DrawerScreen-Cazcn7Rk.js","assets/SetupPagesScreen-XEp1kQFR.js","assets/BusinessVerificationPageScreen-CPrvTfeI.js","assets/BillPayApprovalRoutes-Fxu2CkTc.js","assets/ReimbursementApprovalRuleDetailScreen-Ch9v3Gh-.js","assets/getLocaleForTenant-DoMce50l.js","assets/ReimbursementRoutes-DIHzKloW.js","assets/ReimbursementApprovalRoutes-TQsZnhto.js","assets/TransactionListRoutes-nXmLKfGU.js","assets/ZeniAccountStatementScreen-C1dFEu7A.js","assets/SettingsRoutes-B6mX4TxX.js","assets/accountMappingHelper-C3cxjqIM.js","assets/QBOConnectionScreen--f6RIZ12.js","assets/empty-B-YUfrA-.js","assets/index-DfH8_y4r.js","assets/url--07kYo43.js","assets/index-Bhp-y0XH.js","assets/ReportsRoutes-D8ox_6Ub.js","assets/ChargeCardRoutes-gC5tn768.js","assets/PeopleRoutes-PYFu4zWO.js","assets/ExpenseAutomationRoutes-CQopNWx8.js","assets/TreasuryRoutes-CF5MXT61.js","assets/VendorsRoutes-T3gDuJPY.js","assets/pathToGoBack-DmuGVa1m.js","assets/ZeniAccountRoutes-M7DnzrB2.js","assets/AddressRoutes-B57B205H.js","assets/PandLWithForecastRoutes-BeL7Lehp.js","assets/CustomerOnboardingRoutes-Dke_UCjq.js","assets/TransactionDetailRoutes-CUIl0cYW.js","assets/EntityDetailRoutes-CRq9mJ9L.js","assets/NotificationRoutes-Lv43iwZQ.js","assets/PerformanceRoutes-9UJ4wNxI.js","assets/RewardsRoutes-3LGiD-BC.js","assets/TaskRoutes-D7mVo-mO.js","assets/TaskListScreen-BVihwzZC.js","assets/AiCfoScreen-12AaZrKz.js"])))=>i.map(i=>d[i]);
|
|
2
|
+
import{_ as n,bn as os,eR as ls,f0 as cs,e_ as ds,e$ as ms,fJ as us,eV as _s,cP as Ee,cx as Es,fg as As,cp as ps,bE as gs,bq as xs,fl as Is,v as Ts,JZ as hs,bt as js,J_ as Us,bG as bs,fi as Rs,bF as Hs,bs as Ds,cl as ys,J$ as fs,K0 as Cs,cM as vs,cO as Os,cN as Ps,cw as Fs,cC as Ls,ng as Ae,eY as pe,fT as Bs,fp as ge,fQ as xe,fR as Ie,fq as ks}from"./zeni-epic-state-BY4R57V8.js";import{j as e}from"./liveblocks-BrHep0IE.js";import{a as v}from"./sentry-Bhe05Ckf.js";import{u as Vs,h as Ss,i as Ns,g as Ms,j as G,l as Te,N as c,o as Zs,p as t}from"./core-CjggIORY.js";import{m as ws,u as Gs,z as R,s as $s,a as zs,c as Ys,d as L,k as qs,L as B,D as he,t as _,P as Js,e as X,l}from"./index-T3RPvQKw.js";import"./mui-BHbKLhAL.js";import{f as je}from"./analyticsHelper-S9v9q0r_.js";import{t as Ws}from"./getLocaleForTenant-DoMce50l.js";import"./recharts-CqDxIFtp.js";import"./analytics-CgnjVt5D.js";import"./plaid-Ki-s5Z-l.js";import"./dnd-BkcbdaLH.js";import"./stripe-DMRn4zHo.js";import"./lottie-apaaj5nl.js";import"./lexical-ztGMt0Co.js";import"./pdf-DUoZzTWI.js";import"./utils-BWXl495q.js";(function(){try{var i=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},U=new i.Error().stack;U&&(i._sentryDebugIds=i._sentryDebugIds||{},i._sentryDebugIds[U]="365d7b61-ba5c-4cf8-bce6-cc799196b606",i._sentryDebugIdIdentifier="sentry-dbid-365d7b61-ba5c-4cf8-bce6-cc799196b606")}catch{}})();const Ks={dashboard:()=>n(()=>import("./DashboardRoutes-DYlid3qZ.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21])),bills:()=>n(()=>import("./BillPayRoutes-CGm7mDxV.js"),__vite__mapDeps([22,1,2,3,4,5,6,7,23,13,24,9,14,25,17,19,26,15,12,27,28,29,30,21])),reimbursement:()=>n(()=>import("./ReimbursementRoutes-DIHzKloW.js"),__vite__mapDeps([31,1,2,3,4,5,6,7,13,26,17,15,12,27,19,9,14,25,32,29,30,21])),transactions:()=>n(()=>import("./TransactionListRoutes-nXmLKfGU.js"),__vite__mapDeps([33,1,2,3,4,5,6,7,8,9,10,11,12,34,21])),settings:()=>n(()=>import("./SettingsRoutes-B6mX4TxX.js"),__vite__mapDeps([35,1,2,3,4,5,6,7,17,36,23,13,15,27,12,16,37,38,39,40,41,11,28,29,32,21])),reports:()=>n(()=>import("./ReportsRoutes-D8ox_6Ub.js"),__vite__mapDeps([42,1,2,3,4,5,6,7,13,19,14,12,17,21])),chargeCards:()=>n(()=>import("./ChargeCardRoutes-gC5tn768.js"),__vite__mapDeps([43,1,2,3,4,5,6,7,26,17,13,15,12,27,14,9,23,21])),people:()=>n(()=>import("./PeopleRoutes-PYFu4zWO.js"),__vite__mapDeps([44,1,2,3,4,5,6,7,13,9,17,21])),expenseAutomation:()=>n(()=>import("./ExpenseAutomationRoutes-CQopNWx8.js"),__vite__mapDeps([45,1,2,3,13,4,5,6,7,9,10,11,12,8,36,25,21])),treasury:()=>n(()=>import("./TreasuryRoutes-CF5MXT61.js"),__vite__mapDeps([46,1,2,3,4,5,6,7,13,26,17,15,12,27,9,14,19,21])),vendors:()=>n(()=>import("./VendorsRoutes-T3gDuJPY.js"),__vite__mapDeps([47,1,2,3,4,5,6,7,23,13,19,12,48,9,17,25,36,21])),zeniAccounts:()=>n(()=>import("./ZeniAccountRoutes-M7DnzrB2.js"),__vite__mapDeps([49,1,2,3,4,5,6,7,13,26,17,15,12,27,19,24,23,9,34,21]))},Qs=["bills","transactions","settings","reimbursement","reports","chargeCards","people"],ee=i=>{"requestIdleCallback"in window?requestIdleCallback(i):setTimeout(i,100)},Xs=l(()=>n(()=>import("./ReportsRoutes-D8ox_6Ub.js"),__vite__mapDeps([42,1,2,3,4,5,6,7,13,19,14,12,17,21]))),en=l(()=>n(()=>import("./AddressRoutes-B57B205H.js"),__vite__mapDeps([50,1,2,3,23,4,5,6,7,13,21]))),sn=l(()=>n(()=>import("./PeopleRoutes-PYFu4zWO.js"),__vite__mapDeps([44,1,2,3,4,5,6,7,13,9,17,21]))),nn=l(()=>n(()=>import("./PandLWithForecastRoutes-BeL7Lehp.js"),__vite__mapDeps([51,1,2,3,4,5,6,7,13,19,9,14,12,17,21]))),an=l(()=>n(()=>import("./CustomerOnboardingRoutes-Dke_UCjq.js"),__vite__mapDeps([52,1,2,3,23,4,5,6,7,13,37,38,39,40,41,11,21]))),tn=l(()=>n(()=>import("./VendorsRoutes-T3gDuJPY.js"),__vite__mapDeps([47,1,2,3,4,5,6,7,23,13,19,12,48,9,17,25,36,21]))),rn=l(()=>n(()=>import("./TransactionDetailRoutes-CUIl0cYW.js"),__vite__mapDeps([53,1,2,3,13,4,5,6,7,10,9,11,12,21]))),Ue=l(()=>n(()=>import("./EntityDetailRoutes-CRq9mJ9L.js"),__vite__mapDeps([54,1,2,3,4,5,6,7,11,8,9,10,12,21]))),on=l(()=>n(()=>import("./DashboardRoutes-DYlid3qZ.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21]))),be=l(()=>n(()=>import("./BillPayRoutes-CGm7mDxV.js"),__vite__mapDeps([22,1,2,3,4,5,6,7,23,13,24,9,14,25,17,19,26,15,12,27,28,29,30,21]))),ln=l(()=>n(()=>import("./SettingsRoutes-B6mX4TxX.js"),__vite__mapDeps([35,1,2,3,4,5,6,7,17,36,23,13,15,27,12,16,37,38,39,40,41,11,28,29,32,21]))),Re=l(()=>n(()=>import("./ReimbursementRoutes-DIHzKloW.js"),__vite__mapDeps([31,1,2,3,4,5,6,7,13,26,17,15,12,27,19,9,14,25,32,29,30,21]))),cn=l(()=>n(()=>import("./ZeniAccountRoutes-M7DnzrB2.js"),__vite__mapDeps([49,1,2,3,4,5,6,7,13,26,17,15,12,27,19,24,23,9,34,21]))),dn=l(()=>n(()=>import("./TreasuryRoutes-CF5MXT61.js"),__vite__mapDeps([46,1,2,3,4,5,6,7,13,26,17,15,12,27,9,14,19,21]))),mn=l(()=>n(()=>import("./TransactionListRoutes-nXmLKfGU.js"),__vite__mapDeps([33,1,2,3,4,5,6,7,8,9,10,11,12,34,21]))),un=l(()=>n(()=>import("./ChargeCardRoutes-gC5tn768.js"),__vite__mapDeps([43,1,2,3,4,5,6,7,26,17,13,15,12,27,14,9,23,21]))),_n=l(()=>n(()=>import("./NotificationRoutes-Lv43iwZQ.js"),__vite__mapDeps([55,1,2,3,13,4,5,6,7,9,21]))),En=l(()=>n(()=>import("./PerformanceRoutes-9UJ4wNxI.js"),__vite__mapDeps([56,1,2,3,13,4,5,6,7,9,17,21]))),An=l(()=>n(()=>import("./ExpenseAutomationRoutes-CQopNWx8.js"),__vite__mapDeps([45,1,2,3,13,4,5,6,7,9,10,11,12,8,36,25,21]))),pn=l(()=>n(()=>import("./RewardsRoutes-3LGiD-BC.js"),__vite__mapDeps([57,1,2,3,4,5,6,7,13,20,9,17,21]))),gn=l(()=>n(()=>import("./TaskRoutes-D7mVo-mO.js"),__vite__mapDeps([58,1,2,3,13,4,5,6,7,14,17,59,9,21]))),xn=l(()=>n(()=>import("./AiCfoScreen-12AaZrKz.js"),__vite__mapDeps([60,1,2,3,4,5,6,7,18,48,21]))),y=l(()=>n(()=>import("./NotFoundScreen-B4DpKEjs.js"),__vite__mapDeps([13,1,2,3,4,5,6,7,21]))),In=l(()=>n(()=>import("./TaskListScreen-BVihwzZC.js"),__vite__mapDeps([59,1,2,3,4,5,6,7,9,17,21])));function wn({setTenantEmailDomain:i}){const U=Vs(),V=Ss(),{tenantEmailDomain:o}=Ns(),S=ws().mode,{setLoading:f,clearAllLoading:O,clearLoading:Z}=Gs(),D=R.getSignedInUserTenant(o)?.tenantId,h=R.getSignedInUser(),W=os(h),$=Ms(),[N,De]=v.useState(!1),r=G(a=>ls(a)),{useFeatureGate:P}=$s(),K=zs(),ye=Ys(),{isFeatureEnabled:fe}=P(L.isExpenseAutomationEnabled),{isFeatureEnabled:Ce}=P(L.isExpenseAutomationEnabledV2),ve=Ce||fe&&W,{isFeatureEnabled:Oe}=P(L.isDepositAccountsFeatureEnabled),{isFeatureEnabled:Pe}=P(L.isTreasuryEnabled),{isFeatureEnabled:Fe}=P(L.isChargeCardFeatureEnabled),{isFeatureEnabled:se}=P(L.isDebitCardFeatureEnabled),j=G(a=>a.tenantState.fetchState),A=G(a=>a.tenantState.activeTenantFetchState.fetchState),u=A==="Completed"||j==="Completed"?cs(se,r):void 0,z=A==="Completed"||j==="Completed"?ds(r):void 0,Le=A==="Completed"||j==="Completed"?ms(r):void 0,Be=Fe||se||!!Le||!!z||!!u,{isFeatureEnabled:ke}=P(L.isSettingsFeatureEnabled),{isFeatureEnabled:Ve}=P(L.isAiCfoFileUploadEnabled),Y=G(a=>us(a));if(o!=null){const a=R.getSignedInUserTenant(o);h!=null&&a!=null&&je(h,r,S)}const w={tenantId:D,userId:h?.userId,sessionId:h?.zeniSessionId},ne=_s(),E=qs(),Se=r.company==null||E?.loggedInUserRoleMap!=null&&Ee(E.loggedInUserRole),Ne=Es(E?.loggedInUserRoleMap),ae=v.useRef(!0),te=Te("/:tenantEmailDomain/onboarding/*")!==null,Q=Te("/:tenantEmailDomain/month_end_close_checks/review/:selectedTab/:selectedPeriod/*"),Me=G(a=>w.tenantId!=null?As(a,w.tenantId):void 0);v.useEffect(()=>{f(B.TENANT_FETCHING),i(o)},[o]),v.useEffect(()=>{if(Q!=null&&D!=null){const a=Q.params.selectedPeriod;if(a!=null){const b=a.split("-");if(b.length===2){const d=ps(Number(b[0])),s=Number(b[1]),m=gs(`01-${d<10?`0${d}`:d}-${s}`,he.getLocalizedStrings().dateFormat.analytics.DDDashMMDashYYYY),M=xs();m.isAfter(M,"month")===!1?U(Is(D,{month:d,year:s})):V("./month_end_close_checks/review")}}}},[Q,D]),v.useEffect(()=>{N||(De(!0),f(B.TENANT_FETCHING)),ae.current?ae.current=!1:!Ts(ne,w)&&R.isSignedIn()&&(f(B.TENANT_FETCHING),function(a,b,d,s){if(pe(b?.userId,b?.zeniSessionId,a.tenantId),d(Bs(!0)),d(ge(a.tenantId)),a.tenantId!=null&&_.clearTenant(a.tenantId),a.tenantId!=null){const m=R.getSignedInUserTenantWithId(a.tenantId);s&&he.updateAppLocaleID(Ws(s)),m?.tenantEmailDomain!=null&&R.saveActiveTenantDomainForUser(m?.tenantEmailDomain)}a.userId!=null?X.identify(a.userId,{tenant_id:a.tenantId}):X.resetUserIdentity()}(w,h,U,Me))},[w,ne,h,U,R]),v.useEffect(()=>{R.isSignedIn()&&(f(B.TENANT_FETCHING),function(a,b,d,s,m,M,k){if(d==null&&s==null)return void console.warn("There is no current tenant selected!!");const q=s!=null&&m?.zeniSessionId!=null,ts=d==null||d.tenantId!==s,is=d!=null&&d.excludedResources==null,rs=d!=null&&d.externalConnections==null;if(q&&ts){k(ge(s));const J=R.getSignedInUserTenantWithId(s);J?.tenantEmailDomain!=null&&R.saveActiveTenantDomainForUser(J?.tenantEmailDomain),pe(m?.userId,m?.zeniSessionId,s),_.shouldFetchExcludedResources(s)&&(_.markExcludedResourcesFetchStarted(s),k(xe(m.userId,s))),_.shouldFetchConnections(s)&&(_.markConnectionsFetchStarted(s),k(Ie(m.userId,s)))}else q&&is&&_.shouldFetchExcludedResources(s)&&(_.markExcludedResourcesFetchStarted(s),k(xe(m.userId,s))),q&&rs&&_.shouldFetchConnections(s)&&(_.markConnectionsFetchStarted(s),k(Ie(m.userId,s)));if(q){X.identify(m.userId,{tenant_id:s});const J=s==null||s!=null&&(b==="Completed"||b==="Error");a==="Completed"||b!=="Not-Started"&&b!=="Error"||s==null||!_.shouldFetchActiveTenant(s)||(_.markActiveTenantFetchStarted(s),M(B.TENANT_FETCHING),k(ks(m.userId,s,m.zeniSessionId))),J&&(a==="Not-Started"||a==="Error")&&_.shouldFetchAllTenants()&&(_.markAllTenantsFetchStarted(),k(Ae(m.userId,m.zeniSessionId)))}}(j,A,r,D,h,f,U))},[D,A]),v.useEffect(()=>{R.isSignedIn()&&j==="Completed"&&Y.tenantsBaseInOrder.length>0&&(Z(B.TENANT_FETCHING),R.saveSignedInUserTenants(hs(Y.tenantsBaseInOrder)),h!=null&&je(h,r,S,void 0,Y.tenantsBaseInOrder))},[Y,j,r,h]),v.useEffect(()=>{A==="In-Progress"&&f(B.TENANT_FETCHING),A!=="Completed"&&A!=="Error"||(A==="Completed"&&D!=null?(O(),_.markActiveTenantFetchCompleted(D)):A==="Error"&&D!=null&&(_.markActiveTenantFetchFailed(D),Z(B.TENANT_FETCHING),Z(B.TENANT_SWITCHING))),j!=="Completed"&&j!=="Error"||(j==="Completed"?_.markAllTenantsFetchCompleted():j==="Error"&&_.markAllTenantsFetchFailed())},[A,j,D,N]);const ie=v.useRef(!1);v.useEffect(()=>{!ie.current&&A==="Completed"&&N&&(ie.current=!0,function(a=Qs,b=3e3){setTimeout(()=>{const d=s=>{if(s>=a.length)return;const m=a[s],M=Ks[m];M!=null?M().then(()=>ee(()=>d(s+1))).catch(()=>ee(()=>d(s+1))):d(s+1)};ee(()=>d(0))},b)}())},[A,N]);const C=r?.userRole!=null&&js(r?.userRole),{isFeatureEnabled:Ze}=P(L.isReferralFeatureEnabled),we=r?.userRole!=null&&r.userRole.includes("charge_card_user"),Ge=r?.userRole!=null&&r.userRole.includes("charge_card_admin"),F=r?.userRole!=null&&Ee(r.userRole),re=r?.company==null||r.company.featuresActivationInfo?.isBillPayFeatureEnabled&&!C,oe=Be&&!C,$e=Us(E?.loggedInUserRoleMap),ze=r.externalConnections?.accounting[0]?.isValid,le=r.company?.companyOnboardingInfo.isOnboardingCompleted,ce=r?.company==null||r.company.featuresActivationInfo?.isReimbursementFeatureEnabled&&!C,de=ce&&bs(E?.loggedInUserRoleMap),me=Oe&&!C,Ye=r.company!=null&&Rs(r.company),qe=Pe&&Ye===!0&&!C,Je=re&&Hs(E?.loggedInUserRoleMap),We=oe&&Ds(E?.loggedInUserRoleMap),Ke=me&&ys(E?.loggedInUserRoleMap),Qe=fs(E?.loggedInUserRoleMap),Xe=Cs(E?.loggedInUserRoleMap),p=vs(E?.loggedInUserRoleMap),g=Os(E?.loggedInUserRoleMap),x=Ps(E?.loggedInUserRoleMap),I=Fs(E?.loggedInUserRoleMap),T=Ls(E?.loggedInUserRoleMap),ue=re&&I,_e=ce&&T,es=me&&p,ss=qe&&g,ns=oe&&x,as=r.excludedResources?.resources?.find(a=>a.resource==="/invites")!=null||Ne===!0||$e===!0||Qe===!0||Xe===!0;return R.isSignedIn()?D==null?j==="Completed"?e.jsx(c,{to:"/",replace:!0,state:{...$.state,message:"...",origin:$.pathname}}):(h!=null&&j!=="In-Progress"&&U(Ae(h.userId,h.zeniSessionId)),null):A!=="In-Progress"&&A!=="Not-Started"||j==="Completed"?(le===!0||W&&!te)&&ze===!1&&u===!1&&z===!1?(i(void 0),e.jsx(c,{to:"/connection/auth",replace:!0})):!N||le!==!1||te||W?N&&r?.userRole&&u!=null&&z!=null&&o!=null&&Object.keys(E.loggedInUserRoleMap).length>0?e.jsx(Zs,{children:e.jsxs(t,{element:e.jsx(Js,{}),children:[e.jsx(t,{path:"/",element:e.jsx(Tn,{isDashboardAccess:F,isUserHasZeniAccountsAccess:p,isUserHasChargeCardAccess:x,isUserHasBillPayAccess:I,isUserHasReimbursementAccess:T,isUserHasTreasuryAccess:g,isTenantBankingOnly:u,isTenantCardsOnly:z})}),e.jsx(t,{path:"dashboard/*",element:F?e.jsx(on,{}):e.jsx(H,{isUserHasZeniAccountsAccess:p,isUserHasChargeCardAccess:x,isUserHasBillPayAccess:I,isUserHasReimbursementAccess:T,isUserHasTreasuryAccess:g,isTenantBankingOnly:u,tenantEmailDomain:o})}),e.jsx(t,{path:"reports/*",element:F?e.jsx(Xs,{}):e.jsx(H,{isUserHasZeniAccountsAccess:p,isUserHasChargeCardAccess:x,isUserHasBillPayAccess:I,isUserHasReimbursementAccess:T,isUserHasTreasuryAccess:g,isTenantBankingOnly:u,tenantEmailDomain:o})}),e.jsx(t,{path:"people/*",element:as||F?e.jsx(sn,{}):e.jsx(H,{isUserHasZeniAccountsAccess:p,isUserHasChargeCardAccess:x,isUserHasBillPayAccess:I,isUserHasReimbursementAccess:T,isUserHasTreasuryAccess:g,isTenantBankingOnly:u,tenantEmailDomain:o})}),e.jsx(t,{path:"forecast/*",element:F?e.jsx(nn,{}):e.jsx(H,{isUserHasZeniAccountsAccess:p,isUserHasChargeCardAccess:x,isUserHasBillPayAccess:I,isUserHasReimbursementAccess:T,isUserHasTreasuryAccess:g,isTenantBankingOnly:u,tenantEmailDomain:o})}),e.jsx(t,{path:"onboarding/*",element:e.jsx(an,{})}),e.jsx(t,{path:"transaction/*",element:F&&C===!1||we||Ge?e.jsx(rn,{}):e.jsx(H,{isUserHasZeniAccountsAccess:p,isUserHasChargeCardAccess:x,isUserHasBillPayAccess:I,isUserHasReimbursementAccess:T,isUserHasTreasuryAccess:g,isTenantBankingOnly:u,tenantEmailDomain:o})}),e.jsx(t,{path:"transactions/*",element:F&&C===!1?e.jsx(mn,{}):e.jsx(H,{isUserHasZeniAccountsAccess:p,isUserHasChargeCardAccess:x,isUserHasBillPayAccess:I,isUserHasReimbursementAccess:T,isUserHasTreasuryAccess:g,isTenantBankingOnly:u,tenantEmailDomain:o})}),e.jsx(t,{path:"customer/*",element:F&&C===!1?e.jsx(Ue,{entityType:"customer"}):e.jsx(H,{isUserHasZeniAccountsAccess:p,isUserHasChargeCardAccess:x,isUserHasBillPayAccess:I,isUserHasReimbursementAccess:T,isTenantBankingOnly:u,isUserHasTreasuryAccess:g,tenantEmailDomain:o})}),e.jsx(t,{path:"vendor/*",element:F&&C===!1?e.jsx(Ue,{entityType:"vendor"}):e.jsx(H,{isUserHasZeniAccountsAccess:p,isUserHasChargeCardAccess:x,isUserHasBillPayAccess:I,isUserHasReimbursementAccess:T,isUserHasTreasuryAccess:g,isTenantBankingOnly:u,tenantEmailDomain:o})}),e.jsx(t,{path:"tasks",element:e.jsx(In,{})}),e.jsx(t,{path:"tasks/*",element:e.jsx(gn,{})}),e.jsx(t,{path:"address/*",element:Je||de||Ke||We?e.jsx(en,{}):e.jsx(H,{isUserHasZeniAccountsAccess:p,isUserHasChargeCardAccess:x,isUserHasBillPayAccess:I,isUserHasReimbursementAccess:T,isUserHasTreasuryAccess:g,isTenantBankingOnly:u,tenantEmailDomain:o})}),e.jsx(t,{path:"checking/*",element:es?e.jsx(cn,{}):e.jsx(y,{})}),e.jsx(t,{path:"treasury/*",element:ss?e.jsx(dn,{}):e.jsx(y,{})}),e.jsx(t,{path:"performance",element:ye?e.jsx(En,{}):e.jsx(He,{tenantEmailDomain:o})}),e.jsx(t,{path:"month_end_close_checks/review/*",element:ve&&C===!1?e.jsx(An,{}):e.jsx(He,{tenantEmailDomain:o})}),e.jsx(t,{path:"notifications/*",element:e.jsx(_n,{})}),e.jsx(t,{path:"vendors/*",element:Se?e.jsx(tn,{}):e.jsx(y,{})}),e.jsx(t,{path:"bill/*",element:ue?e.jsx(be,{}):e.jsx(H,{isUserHasZeniAccountsAccess:p,isUserHasChargeCardAccess:x,isUserHasBillPayAccess:I,isUserHasReimbursementAccess:T,isUserHasTreasuryAccess:g,isTenantBankingOnly:u,tenantEmailDomain:o})}),e.jsx(t,{path:"bills/*",element:ue?e.jsx(be,{}):e.jsx(H,{isUserHasZeniAccountsAccess:p,isUserHasChargeCardAccess:x,isUserHasBillPayAccess:I,isUserHasReimbursementAccess:T,isUserHasTreasuryAccess:g,isTenantBankingOnly:u,tenantEmailDomain:o})}),e.jsx(t,{path:"reimbursement/*",element:_e?e.jsx(Re,{}):e.jsx(H,{isUserHasZeniAccountsAccess:p,isUserHasChargeCardAccess:x,isUserHasBillPayAccess:I,isUserHasReimbursementAccess:T,isUserHasTreasuryAccess:g,isTenantBankingOnly:u,tenantEmailDomain:o})}),e.jsx(t,{path:"reimbursements/*",element:_e?e.jsx(Re,{}):e.jsx(H,{isUserHasZeniAccountsAccess:p,isUserHasChargeCardAccess:x,isUserHasBillPayAccess:I,isUserHasReimbursementAccess:T,isUserHasTreasuryAccess:g,isTenantBankingOnly:u,tenantEmailDomain:o})}),e.jsx(t,{path:"settings/*",element:ke?e.jsx(ln,{hasAdminLevelAccess:de}):e.jsx(y,{})}),e.jsx(t,{path:"cards/*",element:ns?e.jsx(un,{}):e.jsx(y,{})}),e.jsx(t,{path:"rewards/*",element:Ze?e.jsx(pn,{}):e.jsx(y,{})}),e.jsx(t,{path:"/ai-cfo",element:K?e.jsx(c,{to:"explore"}):e.jsx(y,{})}),e.jsx(t,{path:"/ai-cfo/",element:K?e.jsx(c,{to:"explore"}):e.jsx(y,{})}),e.jsx(t,{path:"/ai-cfo/:session_id",element:K?e.jsx(xn,{isFileUploadEnabled:Ve}):e.jsx(y,{})}),e.jsx(t,{path:"*",element:e.jsx(y,{})})]})}):null:(i(void 0),e.jsx(c,{to:"onboarding",replace:!0})):null:(console.warn("User logged out!!"),i(void 0),e.jsx(c,{to:"/signin/auth",replace:!0,state:{...$.state,message:"...",origin:$.pathname}}))}const Tn=({isDashboardAccess:i,isUserHasZeniAccountsAccess:U,isUserHasChargeCardAccess:V,isUserHasBillPayAccess:o,isUserHasReimbursementAccess:S,isUserHasTreasuryAccess:f,isTenantBankingOnly:O,isTenantCardsOnly:Z})=>O===!0&&U?e.jsx(c,{to:"checking"}):Z===!0?e.jsx(c,{to:"cards"}):i?e.jsx(c,{to:"dashboard"}):U?e.jsx(c,{to:"checking"}):f?e.jsx(c,{to:"treasury"}):V?e.jsx(c,{to:"cards"}):o?e.jsx(c,{to:"bills"}):S?e.jsx(c,{to:"reimbursements"}):e.jsx(c,{to:"dashboard"}),H=({isUserHasZeniAccountsAccess:i,isUserHasChargeCardAccess:U,isUserHasBillPayAccess:V,isUserHasReimbursementAccess:o,isUserHasTreasuryAccess:S,isTenantBankingOnly:f,tenantEmailDomain:O})=>f===!0||i?e.jsx(bn,{tenantEmailDomain:O}):S?e.jsx(Un,{tenantEmailDomain:O}):U?e.jsx(Rn,{tenantEmailDomain:O}):V?e.jsx(jn,{tenantEmailDomain:O}):o?e.jsx(hn,{tenantEmailDomain:O}):e.jsx(y,{}),hn=({tenantEmailDomain:i})=>e.jsx(c,{to:`/${i}/reimbursements`}),jn=({tenantEmailDomain:i})=>e.jsx(c,{to:`/${i}/bills`}),Un=({tenantEmailDomain:i})=>e.jsx(c,{to:`/${i}/treasury`}),bn=({tenantEmailDomain:i})=>e.jsx(c,{to:`/${i}/checking`}),Rn=({tenantEmailDomain:i})=>e.jsx(c,{to:`/${i}/cards`}),He=({tenantEmailDomain:i})=>e.jsx(c,{to:`/${i}/dashboard`});export{H as FallBackRoute,wn as default};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{j as o}from"./liveblocks-
|
|
1
|
+
import{j as o}from"./liveblocks-BrHep0IE.js";import{a as p}from"./sentry-Bhe05Ckf.js";import{h as V,g as $,u as M,j as h,t as se,n as K,i as G,o as Y,p as I}from"./core-CjggIORY.js";import{bn as Ee,eR as P,fO as Ae,m5 as we,Os as ve,gP as ue,M2 as je,p_ as ke,jI as pe,l$ as Pe,gR as Te,M4 as Me,M3 as De,Ot as Ue,yj as _e,CO as Oe,O1 as Re,Oa as Fe,c2 as ee,cH as Be,cI as Ve,K9 as ze,Ou as Le,Ka as Ne,wL as $e,Ov as Ke,Fa as Ge,Cu as Ze,Cl as ge,Ci as He,wP as me,Co as he,Cr as fe,Cx as ne,tc as te,wO as qe,jk as W,jn as be,Ow as Qe,ko as Je,x2 as Ye,KZ as We,K_ as Xe,ji as en,Ox as nn,jl as tn,qs as an,Oy as on,Oz as sn,qw as cn,gz as ln,Ki as J,go as rn,gv as dn,Kj as un,w$ as pn,OA as gn,OB as mn,CL as hn,e_ as Se,f0 as Ce,OC as fn,fC as bn,Ks as Sn,w_ as ie,fH as ce,fG as Cn,wZ as yn,fF as In,fE as xn,OD as En,f3 as ye,OE as An,OF as wn,x5 as vn,wY as le,OG as jn,fk as kn,wV as Pn,bV as Tn,c1 as Mn,c0 as Dn,bW as Un,b_ as _n,bZ as On,bY as Rn,b$ as Fn,bX as Bn}from"./zeni-epic-state-BY4R57V8.js";import{s as ae,d as O,z as A,af as Ie,bK as Vn,e as Q,g as zn,k as Z,B as oe,bL as Ln,bM as Nn,aq as $n,j as xe,bN as Kn,bO as Gn,bP as Zn,a9 as Hn,V as qn,bQ as Qn,v as Jn,bR as Yn}from"./index-T3RPvQKw.js";import{n as R}from"./mui-BHbKLhAL.js";import{M as D}from"./MobileAppDrawer-Mbdc14x0.js";import{a as H,g as q,m as Wn}from"./accountMappingHelper-C3cxjqIM.js";import{t as Xn,A as et}from"./AddressScreen-CCQ88S3j.js";import N from"./NotFoundScreen-B4DpKEjs.js";import{g as nt}from"./analyticsHelper-S9v9q0r_.js";import{B as tt}from"./BusinessVerificationPageScreen-CPrvTfeI.js";import{C as at}from"./CompanyPassportScreen-DkE_gJb0.js";import{q as re}from"./QBOConnectionScreen--f6RIZ12.js";import{B as ot}from"./BillPayApprovalRoutes-Fxu2CkTc.js";import{R as st}from"./ReimbursementApprovalRoutes-TQsZnhto.js";import"./recharts-CqDxIFtp.js";import"./analytics-CgnjVt5D.js";import"./plaid-Ki-s5Z-l.js";import"./dnd-BkcbdaLH.js";import"./stripe-DMRn4zHo.js";import"./lottie-apaaj5nl.js";import"./lexical-ztGMt0Co.js";import"./pdf-DUoZzTWI.js";import"./utils-BWXl495q.js";import"./routePaths-BO2NCass.js";import"./empty-B-YUfrA-.js";import"./pdf-lib-OO0mpuMM.js";import"./index-DfH8_y4r.js";import"./url--07kYo43.js";import"./index-Bhp-y0XH.js";import"./decodeURIComponentSafe-B9x_jCmd.js";import"./ReimbursementApprovalRuleDetailScreen-Ch9v3Gh-.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]="02a9ae71-65fd-49a3-bc81-faedc8da0d40",e._sentryDebugIdIdentifier="sentry-dbid-02a9ae71-65fd-49a3-bc81-faedc8da0d40")}catch{}})();const it=R.div`
|
|
2
2
|
display: flex;
|
|
3
3
|
height: 100%;
|
|
4
4
|
width: 100%;
|
|
@@ -6,7 +6,7 @@ import{j as o}from"./liveblocks-8SEYIom7.js";import{a as p}from"./sentry-Bpr6hwv
|
|
|
6
6
|
flex-direction: column;
|
|
7
7
|
align-items: center;
|
|
8
8
|
background-color: ${e=>e.theme.colors.grey4};
|
|
9
|
-
`,ct=
|
|
9
|
+
`,ct=K(function(e,t){return{accountMappingView:t.accountMappingView,isFiling1099FeatureEnabled:t.isFiling1099FeatureEnabled,isAccruedExpensesFeatureEnabled:t.isAccruedExpensesFeatureEnabled,isAccountingClassesEnabled:pe(e),isAccountingClassesUpdateInProgress:e.companyViewState.passportView?.accountingClassesUpdateStatus?.fetchState==="In-Progress",isAccountingProjectsEnabled:ke(e),meetingUrl:"https://meetings.hubspot.com/niharn/zeni-onboarding-overview?embed=true",isCapitalizationFeatureEnabled:t.isCapitalizationFeatureEnabled,capitalizableAccounts:t.capitalizableAccounts,accountNamesById:t.accountNamesById,capitalizationThreshold:t.capitalizationThreshold,capitalizationThresholdMaxCeiling:t.capitalizationThresholdMaxCeiling,isCapitalizationThresholdSaving:t.isCapitalizationThresholdSaving,onSaveCapitalizationThresholds:t.onSaveCapitalizationThresholds}},function(e,t){const{navigate:s,location:r,isFiling1099FeatureEnabled:i}=t;return{onAccountMappingChange:n=>{const{uncategorizedAccountSection:a,billsAccountSection:c,reimbursementsAccountSection:u,vendorsAccountSection:d,filing1099Section:m}=n,{incomeAccount:f,expenseAccount:g}=a,{billPayAccount:l}=c,{reimbursementsAccount:w}=u,{prepaidExpensesAccount:x,fixedAssetsAccount:v,accruedExpensesAccount:S}=d,{bankAccount:y,expenseCategory1099:U}=m,E=H(t.accountMappingView.incomeAccountList,f.selectedOption),F=H(t.accountMappingView.expenseAccountList,g.selectedOption),z=H(t.accountMappingView.billPayAccountList,l.selectedOption),L=H(t.accountMappingView.reimbursementsAccountList,w.selectedOption),B=q(t.accountMappingView.prepaidExpensesAccountList,x.selectedOptions),b=q(t.accountMappingView.fixedAssetsAccountList,v.selectedOptions),T=q(t.accountMappingView.accruedExpensesAccountList,S.selectedOptions),C=q(t.accountMappingView.bankAccounts1099FilingAccountList,y.selectedOptions),j=Wn(t.accountMappingView.expenseAccounts1099FilingAccountList,U),_={selectedIncomeAccountId:E?.accountId,selectedExpenseAccountId:F?.accountId,selectedBillPayAccountId:z?.accountId,selectedReimbursementsAccountId:L?.accountId,selectedPrepaidExpensesAccountIds:B.map(k=>k.accountId),selectedFixedAssetsAccountIds:b.map(k=>k.accountId),selectedAccruedExpensesAccountIds:T.map(k=>k.accountId),selectedBankAccounts1099FilingAccountIds:C.map(k=>k.accountId),selectedExpenseAccounts1099FilingAccountIds:j};e(De({data:_}))},onBackClick:()=>{Ie(r)===!1?(s("../../dashboard"),e(Me())):e(ue())},onSaveClick:()=>{e(Te()),i&&Q.track(zn.Event.vendor1099AccountingSettingsSave)},onAccountingClassesToggle:n=>{e(Pe(t.currentTenant.companyId,n))}}})(Vn),lt=()=>{const e=V(),t=$(),s=M(),{useFeatureGate:r,useDynamicConfig:i}=ae(),{isFeatureEnabled:n}=r(O.isFiling1099FeatureEnabled),{isFeatureEnabled:a}=r(O.isScheduledJEAccruedExpensesFeatureEnabled),{configValue:c,isDynamicConfigLoading:u}=i("transaction_categorization_config"),d=!u&&c?.capitalization_enabled===!0,m=A.getSignedInUser(),f=Ee(m),g=h(C=>P(C)),{capitalizableAccounts:l,capitalizationThreshold:w,capitalizationThresholdMaxCeiling:x,isCapitalizationThresholdSaving:v,currencySymbol:S}=h(C=>{const j=C.tenantState.currentTenantId,_=j!=null?C.tenantState.tenantsById[j]:void 0,k=Ae(C.companyState,g.companyId);return{capitalizableAccounts:_?.capitalizableAccounts??null,capitalizationThreshold:_?.capitalizationThreshold??null,capitalizationThresholdMaxCeiling:_?.capitalizationThresholdMaxCeiling??null,isCapitalizationThresholdSaving:C.companyViewState.passportView?.capitalizationThresholdUpdateStatus?.fetchState==="In-Progress",currencySymbol:k?.company.companyLocaleInfo?.currencySymbol??"$"}},se),y=p.useCallback((C,j)=>{s(we(g.companyId,C,j))},[s,g.companyId]),U=h(C=>ve(C.accountState),se),E=p.useMemo(()=>{const C={};for(const j of U)j.accountId!=null&&j.accountName!=null&&(C[j.accountId]=j.accountName);return C},[U]),[F,z]=p.useState(!1),[L,B]=p.useState(!1);p.useEffect(()=>{F===!1&&(s(ue()),z(!0))},[F]);const b=h(C=>je(C)),T=C=>{B(C)};return o.jsxs(it,{children:[o.jsx(D,{isAppContentDrawerOpen:L,handleDrawerToggle:T}),o.jsx(ct,{currentTenant:g,navigate:e,accountMappingView:b,isFiling1099FeatureEnabled:n&&f,isAccruedExpensesFeatureEnabled:a,isCapitalizationFeatureEnabled:d,capitalizableAccounts:l,accountNamesById:E,capitalizationThreshold:w,capitalizationThresholdMaxCeiling:x,currencySymbol:S,isCapitalizationThresholdSaving:v,onSaveCapitalizationThresholds:y,location:t,isSettings:Ie(t),onClickMenuIcon:()=>T(!0)})]})},rt=R.div`
|
|
10
10
|
display: flex;
|
|
11
11
|
height: 100%;
|
|
12
12
|
width: 100%;
|
|
@@ -14,7 +14,7 @@ import{j as o}from"./liveblocks-8SEYIom7.js";import{a as p}from"./sentry-Bpr6hwv
|
|
|
14
14
|
flex-direction: column;
|
|
15
15
|
align-items: center;
|
|
16
16
|
background-color: ${e=>e.theme.colors.grey4};
|
|
17
|
-
`,dt=
|
|
17
|
+
`,dt=K(function(e,t){const s=P(e),r=Re(e),i=Fe(e),n=t.roleMap.bill_pay_admin;return{isDisabled:(ee(s?.userRole??[])||n)&&"readonly",billpayApprovalView:r,remiApproverView:i,analytics:Q}},function(e,t){const{navigate:s,currentTenant:r}=t;return{onSetupApprovalRulesBillPaySectionClick:()=>{s("bills/approval-rules")},onSetupApprovalRulesRemiSectionClick:()=>{s("reimbursements/approval-rules")},onBackClick:()=>{r?.companyBillPayInfo?.info?.isBillPayEnabled!=null&&r.companyBillPayInfo.info.isBillPayEnabled===!1?s("../.."):s("../")},onNavigateToDashboard:()=>{s("../dashboard")}}})(Ln),ut=()=>{const e=V(),t=$(),s=M(),{tenantEmailDomain:r}=G(),[i,n]=p.useState(!1),[a,c]=p.useState(!1),[u,d]=p.useState(!1),m=h(S=>P(S)),f=h(S=>S.billPaySetupApproverViewState.fetchState),g=h(S=>S.remiSetupApproverViewState.fetchState),l=h(S=>Ue(S)),w=m.companyId??A.getSignedInUserTenant(r)?.companyId;if(A.getSignedInUser()==null)throw Error("Can't access Approval Rules settings page without signing in...");const x=Z();p.useEffect(()=>{u||f!=="Not-Started"||(d(!0),s(_e(!0)))},[u,f,s]),p.useEffect(()=>{a||g!=="Not-Started"||(c(!0),s(Oe(!0)))},[a,g,s]);const v=S=>{n(S)};return x?.loggedInUserRoleMap!=null?o.jsxs(rt,{children:[o.jsx(D,{isAppContentDrawerOpen:i,handleDrawerToggle:v}),o.jsx(dt,{navigate:e,location:t,companyId:w,currentTenant:m,roleMap:x.loggedInUserRoleMap,onClickMenuIcon:()=>{v(!0)}})]}):o.jsx(oe,{fetchState:l.fetchState})},pt=R.div`
|
|
18
18
|
display: flex;
|
|
19
19
|
height: 100%;
|
|
20
20
|
width: 100%;
|
|
@@ -22,7 +22,7 @@ import{j as o}from"./liveblocks-8SEYIom7.js";import{a as p}from"./sentry-Bpr6hwv
|
|
|
22
22
|
flex-direction: column;
|
|
23
23
|
align-items: center;
|
|
24
24
|
background-color: ${e=>e.theme.colors.grey4};
|
|
25
|
-
`,gt=
|
|
25
|
+
`,gt=K(function(e,t){const{companyId:s,isZeniAccountEnabled:r,isChargeCardEnabled:i,isBillPayEnabled:n,isRemiEnabled:a,isTreasuryEnabled:c}=t,u=P(e);return{bankSetupView:Ke(e,s,n,a,r,i,c),connectedAccountProvider:u.company?.featuresActivationInfo.connectedAccountProvider??"",analytics:Q}},function(e,t){const{navigate:s,currentTenant:r,companyId:i}=t;return{onFetchLinkTokenClick:(n,a,c)=>{e(te(a,n,c))},onEstablishConnectionClick:(n,a,c)=>{e(ne(n,i,a,c))},onUpdatePaymentAccountStatus:(n,a,c,u,d)=>{e(fe(n,a,d,u,c))},onUpdatePaymentAccountLoginStatus:(n,a,c,u)=>{e(he(!1,n,u,c,a))},onEstablishConnectionSuccess:(n,a)=>{e(me(a,n))},onUpdateAccountClick:(n,a,c,u,d)=>{e(d==="paymentAccount"?ge(n,a,c,u):He(u,n,a))},onUpdatePrimaryFundingAccount:(n,a,c)=>{e(Ze(i,a,n,c))},onRemoveConnection:n=>{e(Ge(n))},onBackClick:()=>{r?.companyBillPayInfo?.info?.isBillPayEnabled!=null&&r.companyBillPayInfo.info.isBillPayEnabled===!1?s("../.."):s("../")},onNavigateToDashboard:()=>{s("../dashboard")}}})(Nn),mt=()=>{const e=V(),t=$(),s=M(),{tenantEmailDomain:r}=G(),i=Z(),[n,a]=p.useState(!1),[c,u]=p.useState(!1),d=h(y=>P(y)),m=h(y=>y.settingsViewState.bankConnection.fetchState),f=Be(d,i?.loggedInUserRoleMap),g=Ve(d,i?.loggedInUserRoleMap),l=ze(d,i?.loggedInUserRoleMap),w=Le(d,i?.loggedInUserRoleMap),x=Ne(d,i?.loggedInUserRoleMap),v=d.companyId??A.getSignedInUserTenant(r)?.companyId;if(A.getSignedInUser()==null)throw Error("Can't access bank connections page without signing in...");p.useEffect(()=>{c||m==="Completed"||(u(!0),s($e(!1)))},[c,s,m]);const S=y=>{a(y)};return f||l||g||x?o.jsxs(pt,{children:[o.jsx(D,{isAppContentDrawerOpen:n,handleDrawerToggle:S}),o.jsx(gt,{navigate:e,location:t,companyId:v,currentTenant:d,roleMap:i.loggedInUserRoleMap,isBillPayEnabled:f,isRemiEnabled:g,isZeniAccountEnabled:l,isChargeCardEnabled:x,isTreasuryEnabled:w,onClickMenuIcon:()=>{S(!0)}})]}):o.jsx(N,{})},ht=R.div`
|
|
26
26
|
display: flex;
|
|
27
27
|
height: 100%;
|
|
28
28
|
width: 100%;
|
|
@@ -30,7 +30,7 @@ import{j as o}from"./liveblocks-8SEYIom7.js";import{a as p}from"./sentry-Bpr6hwv
|
|
|
30
30
|
flex-direction: column;
|
|
31
31
|
align-items: center;
|
|
32
32
|
background-color: ${e=>e.theme.colors.grey4};
|
|
33
|
-
`,ft=
|
|
33
|
+
`,ft=K(function(e,t){const{companyId:s}=t,r=P(e),i=t.roleMap.bill_pay_admin,n=Qe(e,s),{uiState:a}=n,c=(ee(r?.userRole??[])||i)&&n.setupView.accountFetchStatus.fetchState!=="In-Progress"&&n.setupView.plaidConnectionDetails.link_account.updateStatus.fetchState!=="In-Progress"&&n.setupView.plaidConnectionDetails.update_account.updateStatus.fetchState!=="In-Progress"&&n.setupView.accountUpdateStatus.fetchState!=="In-Progress"?void 0:"readonly";return{billingSetupView:n,uiState:a,stripeKey:xe.stripeKey,isCardPaymentPopupOpen:!1,connectedAccountProvider:r.company?.featuresActivationInfo.connectedAccountProvider??"",isDisabled:c,analytics:Q}},function(e,t){const{navigate:s,currentTenant:r,companyId:i}=t;return{onFetchLinkTokenClick:(n,a)=>{e(te("billing_setup",n,a))},onEstablishConnectionClick:n=>{e(ne(n,i,"billing_setup","billing"))},onEstablishConnectionSuccess:()=>{e(me("billing","billing_setup"))},onUpdatePaymentAccountStatus:(n,a,c)=>{e(fe(n,a,"billing","billing_setup",c))},onUpdatePaymentAccountLoginStatus:(n,a)=>{e(he(!1,n,"billing","billing_setup",a))},onUpdateAccountClick:(n,a)=>{e(ge(n,a,"billing","billing_setup"))},onBackClick:()=>{r?.companyBillPayInfo?.info?.isBillPayEnabled!=null&&r.companyBillPayInfo.info.isBillPayEnabled===!1?s("../.."):s("../")},onNavigateToDashboard:()=>{s("../dashboard")},handleCreateCardSetupIntent:n=>{e(be(n))},handleConfirmCardSetupIntent:n=>{e(tn(n))},updateCardPaymentModalState:n=>{e(nn({isCardPaymentPopupOpen:n}))},handleAddCardPaymentSource:(n,a,c)=>{e(en(n,a,c))},handleFetchPaymentSources:()=>{e(W())},resetCardPaymentViewState:()=>{e(Xe())},handleResetCardPaymentErrorStatuses:()=>{e(We())},onBillingAddressSave:n=>{e(Ye(n))},onAddressEditHandler:n=>{if(n!=null){const a=Xn(n);e(Je({addressType:"subscription_billing_address",addressToCreate:a}))}}}})(Kn),bt=()=>{const e=V(),t=$(),s=M(),{tenantEmailDomain:r}=G(),[i,n]=p.useState(!1),[a,c]=p.useState(!1),[u,d]=p.useState(!1),m=h(y=>P(y)),f=h(y=>y.cardPaymentViewState),g=h(y=>y.plaidAccountViewState.billing_setup.accountDetails.fetchStatus.fetchState),l=$n(f.addCardPaymentSourceStatus.fetchState),w=f.addCardPaymentSourceStatus.fetchState,x=m.companyId??A.getSignedInUserTenant(r)?.companyId;if(A.getSignedInUser()==null)throw Error("Can't access bank connections page without signing in...");const v=Z();p.useEffect(()=>{x!=null&&s(qe(x,!1))},[x,s]),p.useEffect(()=>{a||(c(!0),s(W()))},[a,s]),p.useEffect(()=>{u||(be(["card"]),d(!0))},[u]),p.useEffect(()=>{l==="In-Progress"&&w==="Completed"&&s(W())},[l,w]);const S=y=>{n(y)};return v?.loggedInUserRoleMap!=null?o.jsxs(ht,{children:[o.jsx(D,{isAppContentDrawerOpen:i,handleDrawerToggle:S}),o.jsx(ft,{navigate:e,location:t,companyId:x,currentTenant:m,roleMap:v.loggedInUserRoleMap,onClickMenuIcon:()=>{S(!0)},googleAPIKey:xe.googleMapsAPIKey})]}):o.jsx(oe,{fetchState:g})},X="external_integrations",St=K(function(e){const t=sn(e,X);return{meetingUrl:"https://meetings.hubspot.com/niharn/zeni-onboarding-overview?embed=true",notifyMeRegisteredSlugs:new Set(t.map(s=>s.additionalInfo).filter(s=>s!=null))}},function(e,t){const{navigate:s,integrationsView:r,signedInUserEmail:i,tenantEmailDomain:n,tenantId:a}=t;return{onBackClick:()=>{s("../")},onNavigateToDashboard:()=>{s("../dashboard")},onReconnectQBO:()=>{re.init("/connection/auth",n),re.handleClick()},onRefreshClick:()=>{r.integrations.refreshQBO.fetchState!=="In-Progress"&&e(pn())},onSaveChargeBeeCredentials:(c,u)=>{const d=r.externalConnections?.revenue?.find(m=>m.connectionName==="chargebee")?.connectionId;d!=null&&e(dn(a,d,J("revenue"),un("chargebee"),{api_key:c,site:u}))},onConnectHubSpot:(c,u)=>{const d=r.externalConnections?.revenue?.find(m=>m.connectionName==="hubspot")?.connectionId;if(d!=null){const m=`${window.location.origin}/oauth/hubspot/callback`;sessionStorage.setItem("hubspot_oauth_pending",JSON.stringify({client_id:c,client_secret:u,connection_id:d,redirect_uri:m,tenant_id:a}));const f="oauth crm.objects.deals.read crm.objects.owners.read";window.location.href=`https://app.hubspot.com/oauth/authorize?client_id=${encodeURIComponent(c)}&scope=${encodeURIComponent(f)}&redirect_uri=${encodeURIComponent(m)}`}},onDisconnect:(c,u)=>{e(rn(a,c,J(u)))},onSaveConnectorCredentials:c=>{e(ln(a,J("payments"),c))},onNotifyMe:c=>{e(cn(X,c,i))}}})(Gn),Ct=()=>{const e=V(),t=M(),{tenantEmailDomain:s}=G(),[r,i]=p.useState(!1),n=h(l=>l.tenantState.fetchState),a=h(l=>P(l)),c=a.companyId??A.getSignedInUserTenant(s)?.companyId,u=A.getSignedInUser(),d=Z(),m=ee(a.userRole??[]);if(u==null)throw Error("Can't access Integrations page without signing in...");p.useEffect(()=>{t(an(X))},[t]);const f=l=>{i(l)},g=h(l=>on(l,c));return d?.loggedInUserRoleMap!=null?o.jsxs(yt,{children:[o.jsx(D,{isAppContentDrawerOpen:r,handleDrawerToggle:f}),o.jsx(St,{navigate:e,onClickMenuIcon:()=>{f(!0)},isAdmin:m,integrationsView:g,signedInUserEmail:u.userEmail??"",tenantEmailDomain:a.tenantEmailDomain??s??"",tenantId:a.tenantId,saveChargeBeeState:g.externalConnections?.saveAPIKeyConnectionState??"Not-Started",saveChargeBeeError:g.externalConnections?.saveAPIKeyConnectionError?.message,saveHubSpotState:g.externalConnections?.saveOAuthConnectionState??"Not-Started",saveHubSpotError:g.externalConnections?.saveOAuthConnectionError?.message,saveConnectorCredentialsStateBySlug:g.externalConnections?.saveConnectorCredentialsStateBySlug??{},saveConnectorCredentialsErrorBySlug:Object.fromEntries(Object.entries(g.externalConnections?.saveConnectorCredentialsErrorBySlug??{}).map(([l,w])=>[l,w?.message])),deleteConnectionState:g.externalConnections?.deleteConnectionState??"Not-Started",deleteConnectionError:g.externalConnections?.deleteConnectionError?.message,isLoading:n==="In-Progress"})]}):o.jsx(oe,{fetchState:n})},yt=R.div`
|
|
34
34
|
display: flex;
|
|
35
35
|
height: 100%;
|
|
36
36
|
width: 100%;
|
|
@@ -38,7 +38,7 @@ import{j as o}from"./liveblocks-8SEYIom7.js";import{a as p}from"./sentry-Bpr6hwv
|
|
|
38
38
|
flex-direction: column;
|
|
39
39
|
align-items: center;
|
|
40
40
|
background-color: ${e=>e.theme.colors.grey4};
|
|
41
|
-
`,It=
|
|
41
|
+
`,It=R.div`
|
|
42
42
|
display: flex;
|
|
43
43
|
height: 100%;
|
|
44
44
|
width: 100%;
|
|
@@ -46,7 +46,7 @@ import{j as o}from"./liveblocks-8SEYIom7.js";import{a as p}from"./sentry-Bpr6hwv
|
|
|
46
46
|
flex-direction: column;
|
|
47
47
|
align-items: center;
|
|
48
48
|
background-color: ${e=>e.theme.colors.grey4};
|
|
49
|
-
`,xt=()=>{const e=
|
|
49
|
+
`,xt=()=>{const e=M(),{tenantEmailDomain:t}=G(),[s,r]=p.useState(!1),i=h(l=>P(l)).companyId??A.getSignedInUserTenant(t)?.companyId,n=A.getSignedInUser();if(n==null)throw Error("Can't access my bank connections page without signing in...");const a=h(l=>gn(l,n.userId)),c=h(l=>mn(l,i,"bill_pay","user_reimbursement_account")),{plaidConnectionDetails:u}=c,d=l=>{r(l)},m=p.useCallback(l=>{e(te("user_reimbursement_account",l))},[]),f=p.useCallback(l=>{e(ne(l,i,"user_reimbursement_account",void 0,"link_account_no_microdeposit"))},[]);p.useEffect(()=>{a.fetchState!=="Completed"&&a.fetchState!=="In-Progress"&&e(hn(n.userId))},[n.userId,a.fetchState]);const g=a.fetchState==="Not-Started"||a.fetchState==="In-Progress";return o.jsxs(It,{children:[o.jsx(D,{isAppContentDrawerOpen:s,handleDrawerToggle:d}),o.jsx(Zn,{plaidConnectionDetails:u,isLoading:g,myBankConnectionsView:a,onFetchLinkTokenClick:m,onEstablishConnectionClick:f,onClickMenuIcon:()=>{d(!0)}})]})},Et=R.div`
|
|
50
50
|
display: flex;
|
|
51
51
|
height: 100%;
|
|
52
52
|
width: 100%;
|
|
@@ -54,4 +54,4 @@ import{j as o}from"./liveblocks-8SEYIom7.js";import{a as p}from"./sentry-Bpr6hwv
|
|
|
54
54
|
flex-direction: column;
|
|
55
55
|
align-items: center;
|
|
56
56
|
background-color: ${e=>e.theme.colors.grey4};
|
|
57
|
-
`,de=({appContent:e})=>{const t=
|
|
57
|
+
`,de=({appContent:e})=>{const t=M(),s=V(),r=$(),[i,n]=p.useState(!1),a=h(b=>P(b)),{tenantEmailDomain:c}=a,u=a.companyId??A.getSignedInUserTenant(c)?.companyId;if(A.getSignedInUser()==null)throw Error("Can't access My Profile page without signing in...");const{useFeatureGate:d}=ae(),{isFeatureEnabled:m}=d(O.isDepositAccountsFeatureEnabled),{isFeatureEnabled:f}=d(O.isChargeCardFeatureEnabled),{isFeatureEnabled:g}=d(O.isDebitCardFeatureEnabled),{isFeatureEnabled:l}=d(O.isTreasuryEnabled),w=h(b=>pe(b)),x=Se(a),v=Ce(g,a),S=!v&&w,y=Hn(a,f,g),{areTenantIdsInSync:U}=qn();p.useEffect(()=>{U&&t(fn(u,S))},[u,t,S,U]);const E=h(b=>bn(b,S)),F=E.fetchState==="Not-Started"||E.fetchState==="In-Progress"||u==null,z=Sn(a),L=!!a.company?.featuresActivationInfo?.isReimbursementFeatureEnabled,B=b=>{n(b)};return o.jsxs(Et,{children:[o.jsx(D,{isAppContentDrawerOpen:i,handleDrawerToggle:B}),e!=null?o.jsx(o.Fragment,{children:e}):o.jsx(Qn,{myProfileView:E,isAccountingClassesEnabled:w,isReimbursementDisabled:L===!1,isZeniAccountsDisabled:m===!1,isChargeCardDisabled:y===!1,isTreasuryDisabled:l===!1,isLiteRoleDisabled:z===!1,onClickMenuIcon:()=>{B(!0)},isLoading:F,isBankingOnlyTenant:v,isCardsOnlyTenant:x,onAddressClick:b=>{const T=function(j,_){let k=`/${j}/settings/my_profile`;return k=k.concat(`/new/${_}`),k}(c,b),C=Jn(r.state?.pathnameStackToGoBack,r.pathname);s(T,{state:{pathnameStackToGoBack:C}})},onGetOtp:b=>{const T={...E.myProfileLocalData,phone:b};t(ie({localData:T})),t(xn(b,"MyProfile"))},onResendOtp:b=>{t(In(b,"MyProfile"))},onCancelClick:()=>{t(yn())},onSaveClick:()=>{t(ce("MyProfile",E.myProfileLocalData.phone,E.myProfileLocalData.otpChallenge,E.myProfileLocalData.dateOfBirth,E.addressData?.addressToCreate))},onVerifyOtp:(b,T)=>{t(Cn(b,T,"MyProfile"))},onVerifyOtpSuccess:b=>{b!=null&&A.saveZeniOtpToken(b),t(ce("MyProfile",E.myProfileLocalData.phone,E.myProfileLocalData.otpChallenge,E.myProfileLocalData.dateOfBirth,E.addressData?.addressToCreate))},updateMyProfileLocalData:b=>{t(ie({localData:b}))}})]})};function At(){const e=M(),t=h(l=>P(l)).companyId,s=h(l=>En(l)),r=h(l=>ye(l)),i=A.getSignedInUser(),[n,a]=p.useState(!1),c=p.useCallback(l=>{a(l)},[]),u=p.useCallback(l=>{e(An(l))},[]),d=p.useCallback(()=>{i?.userEmail!=null&&e(wn({loggedInUserEmail:i.userEmail}))},[i?.userEmail]),m=p.useCallback(()=>{e(vn())},[]);if(i==null)throw Error("Can't access Notification Settings page without signing in...");const f=p.useCallback(()=>{const l=r.notificationSettings.monthEndInsightsNotificationSettings.enabled!=null;e(le(l,t))},[t,r.notificationSettings.monthEndInsightsNotificationSettings.enabled]),g=p.useCallback(()=>{e(jn())},[]);return p.useEffect(()=>{if(r.fetchState==="Completed"&&s.fetchState!=="In-Progress"&&s.fetchState!=="Completed"){const l=r.notificationSettings.monthEndInsightsNotificationSettings.enabled!=null;e(le(l,t))}},[s.fetchState,t,r.notificationSettings.monthEndInsightsNotificationSettings.enabled,r.fetchState]),o.jsxs(o.Fragment,{children:[o.jsx(D,{isAppContentDrawerOpen:n,handleDrawerToggle:c}),o.jsx(Yn,{notificationSettingsView:s,onFormDataChange:u,onCancel:d,onSave:m,onClickMenuIcon:()=>{c(!0)},signedInUser:i,onRefresh:f,resetUpdateStatus:g})]})}function sa(e){const[t,s]=p.useState(!1),r=h(l=>ye(l)),i=h(l=>P(l)),n=Z(),a=A.getSignedInUser(),c=M(),{useFeatureGate:u}=ae(),{isFeatureEnabled:d}=u(O.isDebitCardFeatureEnabled),m=a?.userEmail==null||r.fetchState!=="Completed"||kn(r.notificationSettings,a.userEmail,d,i);p.useEffect(()=>{r.fetchState!=="In-Progress"&&r.fetchState!=="Completed"&&t===!1&&(s(!0),c(Pn()))},[r.fetchState,t]);const f=Ce(d,i),g=Se(i);return r.fetchState!=="In-Progress"&&r.fetchState!=="Not-Started"||m!==!0?Tn(i)?o.jsxs(Y,{children:[Mn(n?.loggedInUserRole??[],d,i,n?.loggedInUserRoleMap)&&o.jsx(I,{path:"accounting/*",element:o.jsx(lt,{})}),Dn(n?.loggedInUserRole??[],d,i,n?.loggedInUserRoleMap)&&o.jsx(I,{path:"approval_rules/*",element:o.jsx(wt,{hasAdminLevelAccess:e.hasAdminLevelAccess})}),Un(i,n?.loggedInUserRoleMap)&&o.jsx(I,{path:"my_bank_connections",element:o.jsx(xt,{})}),_n(i,n?.loggedInUserRoleMap)&&o.jsx(I,{path:"bank_connections",element:o.jsx(mt,{})}),On(i,n?.loggedInUserRoleMap)&&o.jsx(I,{path:"business_verification",element:o.jsx(tt,{productType:f?"zeni_accounts":g?"charge_cards":nt(i,n?.loggedInUserRoleMap)})}),Rn(n?.loggedInUserRole??[],i,n?.loggedInUserRoleMap)&&o.jsx(I,{path:"company_details",element:o.jsx(at,{})}),Fn(n?.loggedInUserRole??[],i)&&o.jsx(I,{path:"billing",element:o.jsx(bt,{})}),Bn(n?.loggedInUserRole??[],d,i)&&o.jsx(I,{path:"integrations",element:o.jsx(Ct,{})}),o.jsx(I,{path:"my_profile/new/:addressType",element:o.jsx(de,{appContent:o.jsx(et,{isSubPage:!1})})}),o.jsx(I,{path:"my_profile",element:o.jsx(de,{})}),m&&o.jsx(I,{path:"notifications",element:o.jsx(At,{})}),o.jsx(I,{path:"*",element:o.jsx(N,{})})]}):o.jsx(Y,{children:o.jsx(I,{path:"*",element:o.jsx(N,{})})}):null}function wt(e){return o.jsxs(Y,{children:[o.jsx(I,{path:"/",element:o.jsx(ut,{})}),o.jsx(I,{path:"bills/approval-rules/*",element:o.jsx(ot,{})}),o.jsx(I,{path:"reimbursements/approval-rules/*",element:e.hasAdminLevelAccess?o.jsx(st,{}):o.jsx(N,{})}),o.jsx(I,{path:"*",element:o.jsx(N,{})})]})}export{sa as default};
|