@zeniai/web-app-ui 5.2.19-next → 5.2.19-prod
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-B7ET6G-y.js +1 -0
- package/dist/assets/{AddressScreen-DM3Cytik.js → AddressScreen-CGTYstNo.js} +1 -1
- package/dist/assets/{AiCfoScreen-C7VAZJ1A.js → AiCfoScreen-CA8qqox4.js} +1 -1
- package/dist/assets/{BillPayApprovalRoutes-C9icCWAb.js → BillPayApprovalRoutes-guz2sdH1.js} +1 -1
- package/dist/assets/{BillPayRoutes-DffUP74I.js → BillPayRoutes-D0Ag3ATI.js} +1 -1
- package/dist/assets/{BusinessVerificationPageScreen-qG6q7Wb6.js → BusinessVerificationPageScreen-BohezKn6.js} +1 -1
- package/dist/assets/{CardsAiCfoScreen-BahaNrfe.js → CardsAiCfoScreen-GOQqQudn.js} +1 -1
- package/dist/assets/{ChargeCardRoutes-SaV3T-oM.js → ChargeCardRoutes-C3e575qW.js} +1 -1
- package/dist/assets/{CompanyPassportScreen-CQUCnlmj.js → CompanyPassportScreen-CxVFTUSz.js} +1 -1
- package/dist/assets/{ConnectionAuthScreen-DxTli2yc.js → ConnectionAuthScreen-CDBmxiL_.js} +1 -1
- package/dist/assets/CustomerOnboardingAuthScreen-DbN5QLGb.js +1 -0
- package/dist/assets/{CustomerOnboardingRoutes-Ber4B0KW.js → CustomerOnboardingRoutes-C6q0UB9j.js} +1 -1
- package/dist/assets/{DashboardRoutes-CDwIkoUk.js → DashboardRoutes-BCmwgis8.js} +1 -1
- package/dist/assets/{DefaultTenantHome-CLCoE5KB.js → DefaultTenantHome-CC2FeaFy.js} +1 -1
- package/dist/assets/{DomesticWireDetailScreen-Cy5XGzM3.js → DomesticWireDetailScreen-qVcyg1bS.js} +1 -1
- package/dist/assets/{DrawerScreen-CFq_1rdP.js → DrawerScreen-YrXahOEM.js} +1 -1
- package/dist/assets/{EntityDetailRoutes-lCFdhj0N.js → EntityDetailRoutes-CteWzOFU.js} +1 -1
- package/dist/assets/{ExpenseAutomationRoutes-BnRbsSz6.js → ExpenseAutomationRoutes-ChtLHwSX.js} +1 -1
- package/dist/assets/{FeaturePreviewScreen-1q69VsC1.js → FeaturePreviewScreen-C_bWMNSt.js} +1 -1
- package/dist/assets/{HubSpotOAuthCallbackScreen-X0-DSjZb.js → HubSpotOAuthCallbackScreen-CFlu3uRE.js} +1 -1
- package/dist/assets/{MagicLinkRoutes-Dfdz57KO.js → MagicLinkRoutes-B6CyGV5n.js} +1 -1
- package/dist/assets/{MagicLinkSignInScreen-3rm3mwQp.js → MagicLinkSignInScreen-CU5qkDL2.js} +1 -1
- package/dist/assets/{MobileAppDrawer-uvkpUvp_.js → MobileAppDrawer-O95nPlSQ.js} +1 -1
- package/dist/assets/NotFoundScreen-BeJq256C.js +1 -0
- package/dist/assets/{NotificationRoutes-Cd2QvtFH.js → NotificationRoutes-dRraueia.js} +1 -1
- package/dist/assets/{OAuthConsentScreen-B3JPBskg.js → OAuthConsentScreen-CRSd0T8_.js} +1 -1
- package/dist/assets/{PandLWithForecastRoutes-W3OrOyHu.js → PandLWithForecastRoutes-DdDF5n8o.js} +1 -1
- package/dist/assets/{PeopleRoutes-DNg7Ihue.js → PeopleRoutes-DPUju30P.js} +1 -1
- package/dist/assets/{PerformanceRoutes-o3ofDHl6.js → PerformanceRoutes-BSNXb7w3.js} +1 -1
- package/dist/assets/{Preview-GrKYlvV7.js → Preview-CxHKvNb3.js} +1 -1
- package/dist/assets/{QBOConnectionScreen-Bky1RVSb.js → QBOConnectionScreen-vAHPaqo7.js} +1 -1
- package/dist/assets/{ReimbursementApprovalRoutes-DGVz-GX1.js → ReimbursementApprovalRoutes-DhrGnU7Q.js} +1 -1
- package/dist/assets/{ReimbursementApprovalRuleDetailScreen-4DU8eod7.js → ReimbursementApprovalRuleDetailScreen-BdQmAA7j.js} +1 -1
- package/dist/assets/{ReimbursementRoutes-C1MfITXr.js → ReimbursementRoutes-OiL1KOsA.js} +1 -1
- package/dist/assets/{ReportsRoutes-CoMGWCHx.js → ReportsRoutes-cJ_74y1a.js} +1 -1
- package/dist/assets/{RewardsRoutes-e7w8wtnX.js → RewardsRoutes-DaWb-BQo.js} +1 -1
- package/dist/assets/{ScreenRoutes-KCqCdpwt.js → ScreenRoutes-CRY8MlH6.js} +2 -2
- package/dist/assets/{SettingsRoutes-BZ_pWEty.js → SettingsRoutes-B0QfLxKl.js} +1 -1
- package/dist/assets/{SetupPagesScreen-D_WJHeIH.js → SetupPagesScreen-DqGd8bGY.js} +1 -1
- package/dist/assets/{SignInScreen-BNoucZFL.js → SignInScreen-wUhLdLU-.js} +1 -1
- package/dist/assets/{SignOutScreen-CMf4hwn3.js → SignOutScreen-BChwhvvy.js} +1 -1
- package/dist/assets/{TaskListScreen-C_rNr9Jk.js → TaskListScreen-q9ElonDb.js} +1 -1
- package/dist/assets/{TaskRoutes-CpISGdNU.js → TaskRoutes-B9S8VECk.js} +1 -1
- package/dist/assets/{TransactionDetailRoutes-CmH9g66g.js → TransactionDetailRoutes-D9ZuqZEq.js} +1 -1
- package/dist/assets/{TransactionDetailScreen-BAzuDRZQ.js → TransactionDetailScreen-B77dqrVQ.js} +1 -1
- package/dist/assets/{TransactionListRoutes-CoFY3pbX.js → TransactionListRoutes-t_0rbITT.js} +1 -1
- package/dist/assets/{TreasuryRoutes--lIehLfz.js → TreasuryRoutes-C2A809wv.js} +1 -1
- package/dist/assets/{VendorsRoutes-BlvpjJIF.js → VendorsRoutes-Ba7d72j7.js} +1 -1
- package/dist/assets/{WiseConfirmationScreen-C62-fzuC.js → WiseConfirmationScreen-AJ6Zf-xE.js} +1 -1
- package/dist/assets/{ZeniAccountRoutes-DsEwo2kw.js → ZeniAccountRoutes-DdIrrwcf.js} +1 -1
- package/dist/assets/{ZeniAccountStatementScreen-DsIySC9T.js → ZeniAccountStatementScreen-BUgkOPv6.js} +1 -1
- package/dist/assets/{accountMappingHelper-DF_wZmqr.js → accountMappingHelper-BmtW64tm.js} +1 -1
- package/dist/assets/{analytics-CsrWBSkJ.js → analytics-C2MbRoEp.js} +1 -1
- package/dist/assets/{analyticsHelper-eo4F52XS.js → analyticsHelper-DqO64pHt.js} +1 -1
- package/dist/assets/{core-Ct1Na3r4.js → core-D2KaS3N5.js} +1 -1
- package/dist/assets/{decodeURIComponentSafe-Dl7JnLtd.js → decodeURIComponentSafe-CD_zntJd.js} +1 -1
- package/dist/assets/{dnd-DXTfJSUb.js → dnd-D-AkKI2c.js} +1 -1
- package/dist/assets/{empty-C9Atwx5F.js → empty-ByGkxZf5.js} +1 -1
- package/dist/assets/{empty-enRUfXAJ.js → empty-D1hMU_8M.js} +1 -1
- package/dist/assets/{emptyVideoElement-BWmmLkB3.js → emptyVideoElement-B0o6h5Gb.js} +1 -1
- package/dist/assets/{epic-CPUd8eYu.js → epic-C_V7SCDP.js} +1 -1
- package/dist/assets/{getLocaleForTenant-C9iKXyPU.js → getLocaleForTenant--JGxRDjE.js} +1 -1
- package/dist/assets/{index-C5jp_Nos.js → index-BFVwI6w6.js} +1 -1
- package/dist/assets/{index-UCOMlrxB.js → index-BQPo7Zt4.js} +1 -1
- package/dist/assets/{index-Lktm9qH-.js → index-CHRJI22G.js} +1 -1
- package/dist/assets/{index-BBFNuY8-.js → index-CivdpZRT.js} +8 -8
- package/dist/assets/{index-DD29fIsd.js → index-CjrIzFQ1.js} +1 -1
- package/dist/assets/{index-DHN0iULb.js → index-D6D50L1U.js} +1 -1
- package/dist/assets/{index-CpAcGISI.js → index-Dyy6NuL-.js} +1 -1
- package/dist/assets/{index-D_W5SS2j.js → index-nz48Z_9j.js} +2 -2
- package/dist/assets/{lexical-5nbymAIm.js → lexical-BQ-Po3YF.js} +1 -1
- package/dist/assets/{liveblocks-P0DntAgT.js → liveblocks-BBLi67DG.js} +1 -1
- package/dist/assets/{lottie-7Wgw-CzS.js → lottie-Dz6JZ58r.js} +1 -1
- package/dist/assets/{mui-SSWNL1tt.js → mui-C1ThRyKO.js} +1 -1
- package/dist/assets/{pathToGoBack-wtH43kNb.js → pathToGoBack-Du20FI7g.js} +1 -1
- package/dist/assets/{pdf-COhrBMN3.js → pdf-2k8d7AeQ.js} +3 -3
- package/dist/assets/{pdf-lib-DerHPYIF.js → pdf-lib-DqPqgk_2.js} +1 -1
- package/dist/assets/{plaid-CdfVkhIW.js → plaid-Do7hhR27.js} +1 -1
- package/dist/assets/{pusher-hTFVCAHJ.js → pusher-TY6R8jm6.js} +1 -1
- package/dist/assets/{react-CYqO4utD.js → react-BReY6fnO.js} +1 -1
- package/dist/assets/{react-Ci3GJXKz.js → react-Bfs0rs07.js} +1 -1
- package/dist/assets/{react-CB88nZl5.js → react-CASCBfCG.js} +1 -1
- package/dist/assets/{react-G31LEvJE.js → react-CCcFi-WD.js} +1 -1
- package/dist/assets/{react-C3avayV7.js → react-D8jfsv_0.js} +1 -1
- package/dist/assets/{react-DAcDxy2I.js → react-DPqkDk9u.js} +1 -1
- package/dist/assets/{recharts-KVNUr0cO.js → recharts-jHFM5Sob.js} +1 -1
- package/dist/assets/{routePaths-Dvh0MCMy.js → routePaths-TRamKMNj.js} +1 -1
- package/dist/assets/{sentry-CfbcqWq3.js → sentry-DW4kKH26.js} +1 -1
- package/dist/assets/{url-CbJg2s3J.js → url-8bOSIiqX.js} +1 -1
- package/dist/assets/{url-FHfZtBCR.js → url-GR46giUc.js} +1 -1
- package/dist/assets/{useAiCfoDashboardSuggestedQuestionsChips-BLXE02N5.js → useAiCfoDashboardSuggestedQuestionsChips-CuA1dWGl.js} +1 -1
- package/dist/assets/{useAskAiCfoHostNavButtonProps-BeiXTDS4.js → useAskAiCfoHostNavButtonProps-CNoSipqI.js} +1 -1
- package/dist/assets/{useCashManagementBanner-D5vpE0Fa.js → useCashManagementBanner-COk5CYpf.js} +1 -1
- package/dist/assets/{useChargeCardPusherEvents-B55cb89o.js → useChargeCardPusherEvents-9ezHPs6j.js} +1 -1
- package/dist/assets/{useDeviceId-BAVWaoiW.js → useDeviceId-CHTVQQ8G.js} +1 -1
- package/dist/assets/{useEmailConnectResultRefresh-DZEhjfaj.js → useEmailConnectResultRefresh-Ddee2XH0.js} +1 -1
- package/dist/assets/{useInitialThreadRequest-J5ElkQVA.js → useInitialThreadRequest-UA6eH2dj.js} +1 -1
- package/dist/assets/{utils-BmRSZi-a.js → utils-DIwqH7uj.js} +1 -1
- package/dist/assets/{withTransactionSidePanel-u9hB8oy5.js → withTransactionSidePanel-DWx4OX2G.js} +1 -1
- package/dist/assets/{zeni-epic-state-x9uZgubN.js → zeni-epic-state-BJ_gdj7r.js} +3 -3
- package/dist/index.html +1 -1
- package/package.json +1 -1
- package/dist/assets/AddressRoutes-D14Xrcr-.js +0 -1
- package/dist/assets/CustomerOnboardingAuthScreen-DCVZbjhG.js +0 -1
- package/dist/assets/NotFoundScreen-DR4zbgK0.js +0 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{j as s}from"./liveblocks-P0DntAgT.js";import{h as W,u as de,g as V,i as Y,j as w,N as _,n as q,l as ct,o as dt,p as C}from"./core-Ct1Na3r4.js";import{eZ as H,R1 as ue,c7 as pe,F0 as Ue,kR as ut,Fd as oe,Fc as re,R2 as pt,bn as be,gw as Le,R3 as bt,Nt as gt,kG as Pe,Nu as ve,Nv as ht,jB as ft,Ql as St,jQ as Rt,EQ as It,uu as yt,jI as vt,FA as $e,R4 as Me,R5 as At,R6 as kt,R7 as Ct,R8 as Et,R9 as wt,Fk as Ae,jW as xt,Qu as Bt,Fe as Tt,E_ as Ft,Ra as jt,EZ as Dt,Rb as Ut,F6 as ke,Fo as Lt,Fn as Pt,Fj as $t,Rc as _e,Kz as Mt,bq as _t,F9 as Nt,FS as Gt,Rd as Ot,Re as zt,Fw as Zt,Ft as Ce,PQ as Vt,EX as Ht,Rf as Ne,Gi as Ee,Gq as Qt,Rg as Wt,Rh as z,Ri as qt,Rj as Ge,Rk as Kt,Rl as Oe,Rm as ze,FI as le,bu as Jt,bK as ge,cI as he,fG as Ze,fE as Ve,Rn as Xt,fB as Yt,Q1 as en,Ro as tn,Rp as He,Q5 as nn,QP as an,Rq as sn,R0 as on,Gn as we,Gm as rn,Rr as ln,Rs as mn,Rt as cn,Ru as dn,Rv as un,QA as pn,Gd as bn,Gh as gn,bs as hn,bJ as fn,cC as Sn,cq as Rn,bt as In,Mh as yn,cS as vn,cV as An,cU as kn,cB as Cn}from"./zeni-epic-state-x9uZgubN.js";import{v as Qe,K as We,A as ee,d as E,z as P,b$ as qe,C as te,f as A,aM as xe,o as j,au as X,I as En,O as Ke,c0 as wn,r as Z,a0 as Je,c1 as xn,e as ne,c2 as Bn,_ as Tn,F as Fn,B as fe,h as Xe,a9 as jn,bn as Dn,a4 as Un,y as Ye,c3 as Ln,i as Pn}from"./index-BBFNuY8-.js";import{n as N,S as $n}from"./mui-SSWNL1tt.js";import me from"./NotFoundScreen-DR4zbgK0.js";import{S as Be}from"./SetupPagesScreen-D_WJHeIH.js";import{F as et}from"./FeaturePreviewScreen-1q69VsC1.js";import{a as f}from"./sentry-CfbcqWq3.js";import{u as Se}from"./useAskAiCfoHostNavButtonProps-BeiXTDS4.js";import{u as tt}from"./useInitialThreadRequest-J5ElkQVA.js";import{D as Mn}from"./DrawerScreen-CFq_1rdP.js";import{M as nt}from"./MobileAppDrawer-uvkpUvp_.js";import{R as _n}from"./ReimbursementApprovalRoutes-DGVz-GX1.js";import{FallBackRoute as Nn}from"./ScreenRoutes-KCqCdpwt.js";import"./recharts-KVNUr0cO.js";import"./analytics-CsrWBSkJ.js";import"./plaid-CdfVkhIW.js";import"./dnd-DXTfJSUb.js";import"./stripe-cKAAJElX.js";import"./lottie-7Wgw-CzS.js";import"./lexical-5nbymAIm.js";import"./pdf-COhrBMN3.js";import"./utils-BmRSZi-a.js";import"./analyticsHelper-eo4F52XS.js";import"./routePaths-Dvh0MCMy.js";import"./BusinessVerificationPageScreen-qG6q7Wb6.js";import"./ReimbursementApprovalRuleDetailScreen-4DU8eod7.js";import"./getLocaleForTenant-C9iKXyPU.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]="44ba6339-b8dc-4a85-9c2f-1971d5560880",e._sentryDebugIdIdentifier="sentry-dbid-44ba6339-b8dc-4a85-9c2f-1971d5560880")}catch{}})();const at=e=>`/${e}/reimbursements`,Gn=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"})),{common:Te,spendManagement:{reimbursement:{reimbursementDetail:M}}}=Ke.getLocalizedStrings(),On=q((function(e,t){const n=t.currentTenant?.companyId,r=pt(e.plaidAccountViewState,"user_reimbursement_account"),d=P.getSignedInUser(),c=be(d),m=r.plaidConnectionDetails,o=Le(e.companyState,n),a=e.tenantState.currentTenantId,i={userId:d?.userId??"",sessionId:d?.zeniSessionId??"",tenantId:a??""},l=ue(e,t.reimbursementId),b=bt(e,d?.userId??"");let y=`${d?.firstName} ${d?.lastName}`,h=!0;t.reimbursementId!=null&&(y=`${l.createdBy?.firstName??"Zeni"} ${l.createdBy?.lastName??""}`,h=d?.userId===l.createdBy?.userId);const T=e.entityAutoCompleteState?.autoCompleteText?.common,u=gt(e,"common");return{remiDetails:l,uploadInvoiceEndPoint:`${X.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:y,isUserAdmin:pe(t.currentTenant?.userRole??[]),isZeniUser:c,plaidConnectionDetails:m,bankNameByRouting:l.bankNameByRouting,bankAccountCreationState:b.bankAccountCreationState,bankAccounts:b.bankAccounts,analytics:A,bankAccountToCreate:l.bankAccountToCreate,fetchBankNameByRoutingStatus:l.fetchBankNameByRoutingStatus,isSignedInUserReimbursementCreator:h,disableInternalOverlay:t.disableInternalOverlay,showSkipAutoFill:t.showSkipAutoFill,setShowSkipAutoFill:t.setShowSkipAutoFill,isAccountingClassesEnabled:Pe(e)}}),(function(e,t){const{reimbursementId:n,currentTenant:r,location:d,navigate:c,themeState:m}=t,{tenantEmailDomain:o}=r,a=P.getSignedInUser();return{onReceiptsUpload:(i,l,b)=>{i!=null&&e(re(i,l,b,n,a?.userId))},onExistingMerchantChange:(i,l)=>{e(ke(!1,l,n,i,void 0))},fetchDuplicateReimbursement:()=>{a?.userId!=null&&e($t(a.userId,!0,n))},clearDuplicateReimbursementDetail:()=>{e(Pt())},clearRemiSaveStatus:()=>{e(Lt("Not-Started",n))},onDuplicateLineClick:(i,l)=>window.open(`/${o}/reimbursement/${i}#L${l}`),onNewMerchantChange:(i,l)=>{e(ke(!1,l,n,void 0,i))},removeFileFromLine:i=>{e(Ut({lineId:i,reimbursementId:n}))},onAmountChanged:(i,l)=>{e(Dt(l,i,n))},updateReimbursementType:(i,l,b)=>{e(jt({reimbursementId:b,lineId:l,reimbursementType:i}))},onHomeCurrencyConversionUpdate:(i,l,b)=>{e(Ft({reimbursementId:b,lineId:l,amountPayload:{amount:i.amount,currency_code:i.currencyCode,currency_symbol:i.currencySymbol}}))},onReimbursementDetailsChanged:i=>{e(Tt({remiDetailLocalData:i,reimbursementId:n}))},saveRemiDetails:i=>{e(Ae(i,!1,n))},onUserBankDetailsUpdated:i=>{const{bankAccountSection:l}=i;e(Bt({data:l}))},onFetchBankName:i=>{e(xt(i))},submitRemiDetails:()=>{e(Ae("pending_approval",!0,n))},discardReimbursementDetailsFromLocalStore:i=>{e(wt({reimbursementId:i}))},updateInvoiceUploadFetchState:i=>{e(oe({reimbursementId:n,fetchState:i}))},clearTentativeNameForLine:i=>{e(Et({reimbursementId:n,lineId:i}))},removeDuplicateReimbursementForLine:i=>{e(Ct({lineId:i}))},onZeniLogoClick:()=>{m.toggle()},clearAddRemiAutoFields:i=>{e(kt({reimbursementId:n,lineId:i}))},redirectToReimbursementListScreen:()=>{e(Me()),e(At());const i=at(o),l=Z(d.state?.pathnameStackToGoBack,d.pathname);c(i,{state:{pathnameStackToGoBack:l}})},redirectToReimbursementDetailScreen:()=>{t.navigate("../")},deleteReimbursement:()=>{n!=null&&(A.trackReimbursementDeleteReimbursement(n),e($e(n)))},onSaveBankAccount:()=>{a?.userId&&e(vt(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(Rt(i,a?.userId??""))},onBackClickFromBankAccountPage:()=>{e(ft({fetchState:"Not-Started"})),e(St())},customerSearchAutoCompleteActions:{onAutoCompleteInputChange:(i,l)=>{i.trim().length>=2?e(ht({searchString:i,entityType:l,searchOrigin:"common"})):e(ve("common"))},onCancelAutoComplete:()=>{e(ve("common"))}}}}))(wn);function Fe(){const e=W(),t=de(),n=V(),{reimbursementId:r}=Y(),d=Qe(),c=We(),[m,o]=f.useState(r==null),[a,i]=f.useState(1),{useFeatureGate:l}=ee(),{isFeatureEnabled:b}=l(E.isLimitedCategoryForReimbursement),{isFeatureEnabled:y}=l(E.isShowDeletedReimbursementsFeatureEnabled),{isFeatureEnabled:h}=l(E.isReimbursementCommentingEnabled),{isAiCfoAccessEnabled:T,onAskAiCfoClick:u}=Se({mobileExploreReferrer:"Reimbursement Details"}),x=V().pathname,F=x.includes("edit"),v=x.includes("reimbursement/new"),[D,B]=f.useState(!1),k=P.getSignedInUser(),R=w((p=>H(p))),g=w((p=>ue(p,r))),U=tt(R?.companyId,{clearParams:g.fetchState==="Completed"}),L=pe(R?.userRole??[]);f.useEffect((()=>{(v&&!D||F&&g.fetchState!="Completed"&&g.fetchState!="In-Progress")&&(B(!0),t(Ue(!1,b,y,r)))}));const $=w((p=>ut(p.accountState,p.accountListState,"reimbursementAccountList")));if(k==null)throw Error("Can't access address page without signing in...");const I={pathname:`../${r}`,search:n.search};return g.isDeleted===!0||g.billStage=="paid"||g.billStage=="scheduled"||g.fetchState=="Not-Started"||L&&g.billStatus==="rejected"||L===!1&&g.billStage==="pending_approval"&&g.billStatus!=="rejected"?s.jsx(_,{to:I}):g.deleteStatus.fetchState==="In-Progress"||g.fetchState!=="Completed"?s.jsx(qe,{isNewReimbursement:r==null}):s.jsxs(zn,{windowSize:c,children:[s.jsx(te,{analytics:A,onLoad:p=>(Q=>{r!=null&&g.deleteStatus.fetchState!=="Completed"&&Q.trackReimbursementEditReimbursement(r)})(p)}),m&&c!=="small"?s.jsx(Zn,{}):null,m&&c!=="small"?s.jsx(Vn,{children:s.jsx(xe,{showAutofill:m,uploadInvoiceEndPoint:`${X.communicationAgentMicroServiceBaseUrl}`,authParams:{userId:k?.userId??"",sessionId:k?.zeniSessionId??"",tenantId:R?.tenantId??""},onSkipAutofill:()=>o(!1),onInvoiceUpload:p=>{p!=null&&t(re(p,a,!0,r,k?.userId))},updateInvoiceUploadFetchState:p=>{t(oe({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:Te.upload,single:M.dropReceipt.single,or:M.dropReceipt.or,multiple:M.dropReceipt.multiple,receipts:M.dropReceipt.receipts}})}):null,m&&c==="small"?s.jsxs(Hn,{children:[s.jsx(Qn,{onClick:()=>o(!1),children:s.jsx(Gn,{})}),s.jsx(xe,{showAutofill:m,uploadInvoiceEndPoint:`${X.communicationAgentMicroServiceBaseUrl}`,authParams:{userId:k?.userId??"",sessionId:k?.zeniSessionId??"",tenantId:R?.tenantId??""},onSkipAutofill:()=>o(!1),onInvoiceUpload:p=>{p!=null&&t(re(p,a,!0,r,k?.userId))},updateInvoiceUploadFetchState:p=>{t(oe({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:Te.upload,single:M.dropReceipt.single,or:M.dropReceipt.or,multiple:M.dropReceipt.multiple,receipts:M.dropReceipt.receipts}})]}):null,s.jsx(Wn,{windowSize:c,children:s.jsx(On,{initialOpenThreadRequest:U??void 0,isReimbursementCommentingEnabled:h,location:n,navigate:e,currentTenant:R,reimbursementId:r,themeState:d,uncategorizedAccounts:$,disableInternalOverlay:!0,showSkipAutoFill:m,setShowSkipAutoFill:o,onCurrentLineIdForUploadChange:i,isAiCfoAccessEnabled:T,onAskAiCfoClick:u})})]})}const zn=N.div`
|
|
1
|
+
import{j as s}from"./liveblocks-BBLi67DG.js";import{h as W,u as de,g as V,i as Y,j as w,N as _,n as q,l as ct,o as dt,p as C}from"./core-D2KaS3N5.js";import{eZ as H,R1 as ue,c7 as pe,F0 as Ue,kR as ut,Fd as oe,Fc as re,R2 as pt,bn as be,gw as Le,R3 as bt,Nt as gt,kG as Pe,Nu as ve,Nv as ht,jB as ft,Ql as St,jQ as Rt,EQ as It,uu as yt,jI as vt,FA as $e,R4 as Me,R5 as At,R6 as kt,R7 as Ct,R8 as Et,R9 as wt,Fk as Ae,jW as xt,Qu as Bt,Fe as Tt,E_ as Ft,Ra as jt,EZ as Dt,Rb as Ut,F6 as ke,Fo as Lt,Fn as Pt,Fj as $t,Rc as _e,Kz as Mt,bq as _t,F9 as Nt,FS as Gt,Rd as Ot,Re as zt,Fw as Zt,Ft as Ce,PQ as Vt,EX as Ht,Rf as Ne,Gi as Ee,Gq as Qt,Rg as Wt,Rh as z,Ri as qt,Rj as Ge,Rk as Kt,Rl as Oe,Rm as ze,FI as le,bu as Jt,bK as ge,cI as he,fG as Ze,fE as Ve,Rn as Xt,fB as Yt,Q1 as en,Ro as tn,Rp as He,Q5 as nn,QP as an,Rq as sn,R0 as on,Gn as we,Gm as rn,Rr as ln,Rs as mn,Rt as cn,Ru as dn,Rv as un,QA as pn,Gd as bn,Gh as gn,bs as hn,bJ as fn,cC as Sn,cq as Rn,bt as In,Mh as yn,cS as vn,cV as An,cU as kn,cB as Cn}from"./zeni-epic-state-BJ_gdj7r.js";import{v as Qe,K as We,A as ee,d as E,z as P,b$ as qe,C as te,f as A,aM as xe,o as j,au as X,I as En,O as Ke,c0 as wn,r as Z,a0 as Je,c1 as xn,e as ne,c2 as Bn,_ as Tn,F as Fn,B as fe,h as Xe,a9 as jn,bn as Dn,a4 as Un,y as Ye,c3 as Ln,i as Pn}from"./index-CivdpZRT.js";import{n as N,S as $n}from"./mui-C1ThRyKO.js";import me from"./NotFoundScreen-BeJq256C.js";import{S as Be}from"./SetupPagesScreen-DqGd8bGY.js";import{F as et}from"./FeaturePreviewScreen-C_bWMNSt.js";import{a as f}from"./sentry-DW4kKH26.js";import{u as Se}from"./useAskAiCfoHostNavButtonProps-CNoSipqI.js";import{u as tt}from"./useInitialThreadRequest-UA6eH2dj.js";import{D as Mn}from"./DrawerScreen-YrXahOEM.js";import{M as nt}from"./MobileAppDrawer-O95nPlSQ.js";import{R as _n}from"./ReimbursementApprovalRoutes-DhrGnU7Q.js";import{FallBackRoute as Nn}from"./ScreenRoutes-CRY8MlH6.js";import"./recharts-jHFM5Sob.js";import"./analytics-C2MbRoEp.js";import"./plaid-Do7hhR27.js";import"./dnd-D-AkKI2c.js";import"./stripe-cKAAJElX.js";import"./lottie-Dz6JZ58r.js";import"./lexical-BQ-Po3YF.js";import"./pdf-2k8d7AeQ.js";import"./utils-DIwqH7uj.js";import"./analyticsHelper-DqO64pHt.js";import"./routePaths-TRamKMNj.js";import"./BusinessVerificationPageScreen-BohezKn6.js";import"./ReimbursementApprovalRuleDetailScreen-BdQmAA7j.js";import"./getLocaleForTenant--JGxRDjE.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]="44ba6339-b8dc-4a85-9c2f-1971d5560880",e._sentryDebugIdIdentifier="sentry-dbid-44ba6339-b8dc-4a85-9c2f-1971d5560880")}catch{}})();const at=e=>`/${e}/reimbursements`,Gn=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"})),{common:Te,spendManagement:{reimbursement:{reimbursementDetail:M}}}=Ke.getLocalizedStrings(),On=q((function(e,t){const n=t.currentTenant?.companyId,r=pt(e.plaidAccountViewState,"user_reimbursement_account"),d=P.getSignedInUser(),c=be(d),m=r.plaidConnectionDetails,o=Le(e.companyState,n),a=e.tenantState.currentTenantId,i={userId:d?.userId??"",sessionId:d?.zeniSessionId??"",tenantId:a??""},l=ue(e,t.reimbursementId),b=bt(e,d?.userId??"");let y=`${d?.firstName} ${d?.lastName}`,h=!0;t.reimbursementId!=null&&(y=`${l.createdBy?.firstName??"Zeni"} ${l.createdBy?.lastName??""}`,h=d?.userId===l.createdBy?.userId);const T=e.entityAutoCompleteState?.autoCompleteText?.common,u=gt(e,"common");return{remiDetails:l,uploadInvoiceEndPoint:`${X.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:y,isUserAdmin:pe(t.currentTenant?.userRole??[]),isZeniUser:c,plaidConnectionDetails:m,bankNameByRouting:l.bankNameByRouting,bankAccountCreationState:b.bankAccountCreationState,bankAccounts:b.bankAccounts,analytics:A,bankAccountToCreate:l.bankAccountToCreate,fetchBankNameByRoutingStatus:l.fetchBankNameByRoutingStatus,isSignedInUserReimbursementCreator:h,disableInternalOverlay:t.disableInternalOverlay,showSkipAutoFill:t.showSkipAutoFill,setShowSkipAutoFill:t.setShowSkipAutoFill,isAccountingClassesEnabled:Pe(e)}}),(function(e,t){const{reimbursementId:n,currentTenant:r,location:d,navigate:c,themeState:m}=t,{tenantEmailDomain:o}=r,a=P.getSignedInUser();return{onReceiptsUpload:(i,l,b)=>{i!=null&&e(re(i,l,b,n,a?.userId))},onExistingMerchantChange:(i,l)=>{e(ke(!1,l,n,i,void 0))},fetchDuplicateReimbursement:()=>{a?.userId!=null&&e($t(a.userId,!0,n))},clearDuplicateReimbursementDetail:()=>{e(Pt())},clearRemiSaveStatus:()=>{e(Lt("Not-Started",n))},onDuplicateLineClick:(i,l)=>window.open(`/${o}/reimbursement/${i}#L${l}`),onNewMerchantChange:(i,l)=>{e(ke(!1,l,n,void 0,i))},removeFileFromLine:i=>{e(Ut({lineId:i,reimbursementId:n}))},onAmountChanged:(i,l)=>{e(Dt(l,i,n))},updateReimbursementType:(i,l,b)=>{e(jt({reimbursementId:b,lineId:l,reimbursementType:i}))},onHomeCurrencyConversionUpdate:(i,l,b)=>{e(Ft({reimbursementId:b,lineId:l,amountPayload:{amount:i.amount,currency_code:i.currencyCode,currency_symbol:i.currencySymbol}}))},onReimbursementDetailsChanged:i=>{e(Tt({remiDetailLocalData:i,reimbursementId:n}))},saveRemiDetails:i=>{e(Ae(i,!1,n))},onUserBankDetailsUpdated:i=>{const{bankAccountSection:l}=i;e(Bt({data:l}))},onFetchBankName:i=>{e(xt(i))},submitRemiDetails:()=>{e(Ae("pending_approval",!0,n))},discardReimbursementDetailsFromLocalStore:i=>{e(wt({reimbursementId:i}))},updateInvoiceUploadFetchState:i=>{e(oe({reimbursementId:n,fetchState:i}))},clearTentativeNameForLine:i=>{e(Et({reimbursementId:n,lineId:i}))},removeDuplicateReimbursementForLine:i=>{e(Ct({lineId:i}))},onZeniLogoClick:()=>{m.toggle()},clearAddRemiAutoFields:i=>{e(kt({reimbursementId:n,lineId:i}))},redirectToReimbursementListScreen:()=>{e(Me()),e(At());const i=at(o),l=Z(d.state?.pathnameStackToGoBack,d.pathname);c(i,{state:{pathnameStackToGoBack:l}})},redirectToReimbursementDetailScreen:()=>{t.navigate("../")},deleteReimbursement:()=>{n!=null&&(A.trackReimbursementDeleteReimbursement(n),e($e(n)))},onSaveBankAccount:()=>{a?.userId&&e(vt(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(Rt(i,a?.userId??""))},onBackClickFromBankAccountPage:()=>{e(ft({fetchState:"Not-Started"})),e(St())},customerSearchAutoCompleteActions:{onAutoCompleteInputChange:(i,l)=>{i.trim().length>=2?e(ht({searchString:i,entityType:l,searchOrigin:"common"})):e(ve("common"))},onCancelAutoComplete:()=>{e(ve("common"))}}}}))(wn);function Fe(){const e=W(),t=de(),n=V(),{reimbursementId:r}=Y(),d=Qe(),c=We(),[m,o]=f.useState(r==null),[a,i]=f.useState(1),{useFeatureGate:l}=ee(),{isFeatureEnabled:b}=l(E.isLimitedCategoryForReimbursement),{isFeatureEnabled:y}=l(E.isShowDeletedReimbursementsFeatureEnabled),{isFeatureEnabled:h}=l(E.isReimbursementCommentingEnabled),{isAiCfoAccessEnabled:T,onAskAiCfoClick:u}=Se({mobileExploreReferrer:"Reimbursement Details"}),x=V().pathname,F=x.includes("edit"),v=x.includes("reimbursement/new"),[D,B]=f.useState(!1),k=P.getSignedInUser(),R=w((p=>H(p))),g=w((p=>ue(p,r))),U=tt(R?.companyId,{clearParams:g.fetchState==="Completed"}),L=pe(R?.userRole??[]);f.useEffect((()=>{(v&&!D||F&&g.fetchState!="Completed"&&g.fetchState!="In-Progress")&&(B(!0),t(Ue(!1,b,y,r)))}));const $=w((p=>ut(p.accountState,p.accountListState,"reimbursementAccountList")));if(k==null)throw Error("Can't access address page without signing in...");const I={pathname:`../${r}`,search:n.search};return g.isDeleted===!0||g.billStage=="paid"||g.billStage=="scheduled"||g.fetchState=="Not-Started"||L&&g.billStatus==="rejected"||L===!1&&g.billStage==="pending_approval"&&g.billStatus!=="rejected"?s.jsx(_,{to:I}):g.deleteStatus.fetchState==="In-Progress"||g.fetchState!=="Completed"?s.jsx(qe,{isNewReimbursement:r==null}):s.jsxs(zn,{windowSize:c,children:[s.jsx(te,{analytics:A,onLoad:p=>(Q=>{r!=null&&g.deleteStatus.fetchState!=="Completed"&&Q.trackReimbursementEditReimbursement(r)})(p)}),m&&c!=="small"?s.jsx(Zn,{}):null,m&&c!=="small"?s.jsx(Vn,{children:s.jsx(xe,{showAutofill:m,uploadInvoiceEndPoint:`${X.communicationAgentMicroServiceBaseUrl}`,authParams:{userId:k?.userId??"",sessionId:k?.zeniSessionId??"",tenantId:R?.tenantId??""},onSkipAutofill:()=>o(!1),onInvoiceUpload:p=>{p!=null&&t(re(p,a,!0,r,k?.userId))},updateInvoiceUploadFetchState:p=>{t(oe({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:Te.upload,single:M.dropReceipt.single,or:M.dropReceipt.or,multiple:M.dropReceipt.multiple,receipts:M.dropReceipt.receipts}})}):null,m&&c==="small"?s.jsxs(Hn,{children:[s.jsx(Qn,{onClick:()=>o(!1),children:s.jsx(Gn,{})}),s.jsx(xe,{showAutofill:m,uploadInvoiceEndPoint:`${X.communicationAgentMicroServiceBaseUrl}`,authParams:{userId:k?.userId??"",sessionId:k?.zeniSessionId??"",tenantId:R?.tenantId??""},onSkipAutofill:()=>o(!1),onInvoiceUpload:p=>{p!=null&&t(re(p,a,!0,r,k?.userId))},updateInvoiceUploadFetchState:p=>{t(oe({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:Te.upload,single:M.dropReceipt.single,or:M.dropReceipt.or,multiple:M.dropReceipt.multiple,receipts:M.dropReceipt.receipts}})]}):null,s.jsx(Wn,{windowSize:c,children:s.jsx(On,{initialOpenThreadRequest:U??void 0,isReimbursementCommentingEnabled:h,location:n,navigate:e,currentTenant:R,reimbursementId:r,themeState:d,uncategorizedAccounts:$,disableInternalOverlay:!0,showSkipAutoFill:m,setShowSkipAutoFill:o,onCurrentLineIdForUploadChange:i,isAiCfoAccessEnabled:T,onAskAiCfoClick:u})})]})}const zn=N.div`
|
|
2
2
|
display: flex;
|
|
3
3
|
position: relative;
|
|
4
4
|
height: 100vh;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{j as p}from"./liveblocks-P0DntAgT.js";import{g as z,h as ge,u as Ce,i as we,j as d,n as Ie,o as Se,p as Y}from"./core-Ct1Na3r4.js";import{eZ as L,fV as w,MK as Te,kG as K,r9 as W,r_ as A,ku as Re,jy as Me,vx as J,s3 as Oe,bs as Ae,ML as ke,bn as Fe,wG as De,MM as je,MN as Ee,vp as Pe,MO as N,MP as Le,MQ as Be,MR as ve,MS as Ve,MT as I,MU as k,MV as F,MW as H,MX as D,MY as j,dI as Ue,wm as xe,wa as $,wb as Z,ws as Ge,wf as q,wy as ze,MZ as Ye,M_ as Ne,M$ as He,N0 as $e,N1 as Ze,fG as qe,fE as Qe}from"./zeni-epic-state-x9uZgubN.js";import{U as Xe,X as Ke,Y as We,Z as Je,K as ea,A as ee,d as E,z as ae,_ as aa,e as sa,a as ta,$ as oa,a0 as na,C as ra,f as P,h as ia,a1 as la,r as se,a2 as ca,a3 as da,a4 as pa}from"./index-BBFNuY8-.js";import"./mui-SSWNL1tt.js";import fa from"./NotFoundScreen-DR4zbgK0.js";import{F as ma}from"./FeaturePreviewScreen-1q69VsC1.js";import{a as _}from"./sentry-CfbcqWq3.js";import{u as ua}from"./useInitialThreadRequest-J5ElkQVA.js";import{t as Q,a as X,b as _a}from"./routePaths-Dvh0MCMy.js";import{M as ha}from"./MobileAppDrawer-uvkpUvp_.js";import"./recharts-KVNUr0cO.js";import"./analytics-CsrWBSkJ.js";import"./plaid-CdfVkhIW.js";import"./dnd-DXTfJSUb.js";import"./stripe-cKAAJElX.js";import"./lottie-7Wgw-CzS.js";import"./lexical-5nbymAIm.js";import"./pdf-COhrBMN3.js";import"./utils-BmRSZi-a.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]="468638e6-e714-4054-9860-c7aef4fe581a",e._sentryDebugIdIdentifier="sentry-dbid-468638e6-e714-4054-9860-c7aef4fe581a")}catch{}})();const ba=["profit_loss","balance_sheet","cash_flow"],y=e=>{e(j({resetLeftScroll:!0})),e(D({resetLeftScroll:!0})),e(F({resetLeftScroll:!0})),e(k({resetLeftScroll:!0}))},ya=e=>{e(Ne()),e(He()),e($e()),e(Ze())},ga=Ie((function(e){const o=ae.getSignedInUser(),f=e.tenantState.currentTenantId,u=L(e),a=u?.companyName??"",s={userId:o?.userId??"",sessionId:o?.zeniSessionId??"",tenantId:f??""},t=w(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:P,isZeniUser:Fe(o),showAccountGroups:r===!0,isAccountingClassesEnabled:K(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(A(o.signedInUser.userId,!0,!1))},updateDownloadStateHandler:a=>{e(Ye(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($(o.firstMonthOfFY,r,c.numberOfPeriods<1?1:c.numberOfPeriods,i)),m.length>0&&e(Z(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(I(a)),(a==="balance_sheet"||a==="cash_flow")&&s==="profit_and_loss_by_classes"&&t==="horizontal"&&e(q({numberOfPeriods:1,orderBy:"ascending_date"})),a!=="profit_and_loss"&&a!=="profit_and_loss_by_classes"&&s==="profit_and_loss_by_classes"&&t==="horizontal"&&e(N({classViewLayout:"vertical"})),y(e)},onCOABalancesRangeChanged:(a,s)=>{e(q(a,s)),y(e)},onThisPeriodChanged:(a,s,t)=>{e(Ge(o.firstMonthOfFY,a,s<1?1:s)),t!==!0&&y(e)},onAdditionalBalanceSelectionChanged:(a,s,t,r)=>{e($(o.firstMonthOfFY,a,t<1?1:t,s)),s.length>0&&e(Z(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(xe({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=Ue(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 Q(o.tenantEmailDomain,a.accountId,a.accountType,m,r,l);if(t?.isHorizontalClassColumn===!0&&s.id!=null)return X(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?X(o.tenantEmailDomain,a.accountId,a.accountType,a.classesViewParentId.parentClassId[0],m,r,l):a.accountType!=null?Q(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(j({scrollPosition:s}));break;case"profit_and_loss_by_classes":e(D({scrollPosition:s}));break;case"profit_and_loss_by_projects":e(H({scrollPosition:s}));break;case"balance_sheet":e(F({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(j({nodeCollapseState:{nodeId:s,isCollapsed:t}}));break;case"profit_and_loss_by_classes":e(D({nodeCollapseState:{nodeId:s,isCollapsed:t}}));break;case"profit_and_loss_by_projects":e(H({nodeCollapseState:{nodeId:s,isCollapsed:t}}));break;case"balance_sheet":e(F({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(ve({viewMode:a})),e(Ve({viewMode:a})),a==="classes"?(o.analytics?.trackGroupBySwitch("Classes",S(o.selectedReportID)),e(I("profit_and_loss_by_classes"))):a==="project"?(o.analytics?.trackGroupBySwitch("Projects",S(o.selectedReportID)),e(I("profit_and_loss_by_projects"))):(o.analytics?.trackGroupBySwitch("Accounts",S(o.selectedReportID)),e(I("profit_and_loss"))),y(e)},onUpdateClassesToFilterOut:a=>{e(Be({classesToFilterOut:a}))},onUpdateProjectsToFilterOut:a=>{e(Le({projectsToFilterOut:a}))},onUpdateClassViewLayout:a=>{e(N({classViewLayout:a}))},onOpenAccountViewMode:()=>{o.isAccountingClassesEnabled&&e(Pe()),o.isAccountingProjectsEnabled&&e(J())},onUpdateDisplayOrder:a=>{e(Ee(a))},onUpdateReportFormat:a=>{ya(e),e(je(a))},onClickMenuIcon:()=>{u(!0)},onResyncReports:()=>{e(De("profit_and_loss_by_classes"))}}}))(ca);function Ca(){const{isAiCfoOpen:e,setIsAiCfoOpen:o}=Je(),f=ea(),u=da(f),a=ge(),s=Ce(),t=z(),{tenantEmailDomain:r}=we(),{useFeatureGate:l}=ee(),{isFeatureEnabled:m}=l(E.isReportsHorizontalClassLayoutSwitchEnabled),c=ae.getSignedInUser(),[i,g]=_.useState(!1),[B,te]=_.useState(!1),{isFeatureEnabled:v}=l(E.isReportsCommentingEnabled);if(c==null)throw Error("Can't access reports page without signing in...");const T=d((n=>L(n))),oe=T.masterTOSInfo?.isMasterTOSAccepted??!1,ne=T.company?.companyInfo.firstMonthOfFY??1,re=ua(v?T?.companyId:void 0),C=d((n=>w(n).fetchState)),ie=d((n=>Te(n))),{areTenantIdsInSync:h}=aa(),R=d((n=>n.financeStatementState.selectedReportId)),V=d((n=>K(n))),M=d((n=>W(n))),le=d((n=>w(n).isCompareModeOn)),b=d((n=>w(n).filter)),O=d((n=>w(n).selectedReportAndTimeframeFetchState)),ce=d((n=>n.profitAndLossClassesViewState.uiState.classViewLayout));_.useEffect((()=>{!i&&h&&(g(!0),s(A(c.userId,!0,!0,!1)))}),[i,c,s,h]),_.useEffect((()=>{i&&!B&&C==="Completed"&&h&&(s(A(c.userId,!1,!0,!1)),te(!0))}),[i,B,C,h]),_.useEffect((()=>{if(i&&O.fetchState==="Not-Started"&&b.timeframe!=="free_range"&&b.timeframe!=="week"&&h)switch(R){case"profit_and_loss":case"profit_and_loss_by_classes":s(Oe(b.timeframe));break;case"profit_and_loss_by_projects":M&&s(J());break;case"balance_sheet":s(Me(b.timeframe));break;case"cash_flow":s(Re(b.timeframe))}}),[i,R,O,h,V,M]);const U=sa(),de=U?.loggedInUserRole!=null&&Ae(U?.loggedInUserRole)!==!0,[pe,fe]=_.useState(!1),x=n=>{fe(n)},me=ta(),ue=oa();return(function(n){const{isDataReady:_e}=n,{pathname:he}=z(),G=Xe(he??"")==="reports",be=Ke(_e),ye=_.useMemo((()=>G?ba:void 0),[G]);We({canFetchSuggestedQuestions:be,pageContexts:ye})})({isDataReady:C==="Completed"}),na({isDataReady:C==="Completed"}),p.jsxs(p.Fragment,{children:[C==="Completed"?p.jsx(ra,{analytics:P,onLoad:n=>n.trackPageLoaded(ia.Event.reports)}):null,p.jsx(ha,{isAppContentDrawerOpen:pe,handleDrawerToggle:x}),p.jsx(ga,{firstMonthOfFY:ne,tenantEmailDomain:r,location:t,navigate:a,windowSize:f,classViewLayout:ce,selectedReportID:R,analytics:P,filter:b,isAccountingClassesEnabled:V,isAccountingProjectsEnabled:M,isCompareModeOn:le,hasTransactionAccess:de,signedInUser:c,selectedReportAndTimeframeFetchState:O,handleDrawerToggle:x,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:v,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 Ga(){const e=d((s=>L(s))),{useFeatureGate:o}=ee(),{isFeatureEnabled:f}=o(E.isDebitCardFeatureEnabled),u=qe(f,e),a=Qe(e);return u===!0||a===!0?p.jsx(ma,{}):p.jsxs(Se,{children:[p.jsx(Y,{path:"/",element:p.jsx(Ca,{})}),p.jsx(Y,{path:"*",element:p.jsx(fa,{})})]})}export{Ga as default};
|
|
1
|
+
import{j as p}from"./liveblocks-BBLi67DG.js";import{g as z,h as ge,u as Ce,i as we,j as d,n as Ie,o as Se,p as Y}from"./core-D2KaS3N5.js";import{eZ as L,fV as w,MK as Te,kG as K,r9 as W,r_ as A,ku as Re,jy as Me,vx as J,s3 as Oe,bs as Ae,ML as ke,bn as Fe,wG as De,MM as je,MN as Ee,vp as Pe,MO as N,MP as Le,MQ as Be,MR as ve,MS as Ve,MT as I,MU as k,MV as F,MW as H,MX as D,MY as j,dI as Ue,wm as xe,wa as $,wb as Z,ws as Ge,wf as q,wy as ze,MZ as Ye,M_ as Ne,M$ as He,N0 as $e,N1 as Ze,fG as qe,fE as Qe}from"./zeni-epic-state-BJ_gdj7r.js";import{U as Xe,X as Ke,Y as We,Z as Je,K as ea,A as ee,d as E,z as ae,_ as aa,e as sa,a as ta,$ as oa,a0 as na,C as ra,f as P,h as ia,a1 as la,r as se,a2 as ca,a3 as da,a4 as pa}from"./index-CivdpZRT.js";import"./mui-C1ThRyKO.js";import fa from"./NotFoundScreen-BeJq256C.js";import{F as ma}from"./FeaturePreviewScreen-C_bWMNSt.js";import{a as _}from"./sentry-DW4kKH26.js";import{u as ua}from"./useInitialThreadRequest-UA6eH2dj.js";import{t as Q,a as X,b as _a}from"./routePaths-TRamKMNj.js";import{M as ha}from"./MobileAppDrawer-O95nPlSQ.js";import"./recharts-jHFM5Sob.js";import"./analytics-C2MbRoEp.js";import"./plaid-Do7hhR27.js";import"./dnd-D-AkKI2c.js";import"./stripe-cKAAJElX.js";import"./lottie-Dz6JZ58r.js";import"./lexical-BQ-Po3YF.js";import"./pdf-2k8d7AeQ.js";import"./utils-DIwqH7uj.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]="468638e6-e714-4054-9860-c7aef4fe581a",e._sentryDebugIdIdentifier="sentry-dbid-468638e6-e714-4054-9860-c7aef4fe581a")}catch{}})();const ba=["profit_loss","balance_sheet","cash_flow"],y=e=>{e(j({resetLeftScroll:!0})),e(D({resetLeftScroll:!0})),e(F({resetLeftScroll:!0})),e(k({resetLeftScroll:!0}))},ya=e=>{e(Ne()),e(He()),e($e()),e(Ze())},ga=Ie((function(e){const o=ae.getSignedInUser(),f=e.tenantState.currentTenantId,u=L(e),a=u?.companyName??"",s={userId:o?.userId??"",sessionId:o?.zeniSessionId??"",tenantId:f??""},t=w(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:P,isZeniUser:Fe(o),showAccountGroups:r===!0,isAccountingClassesEnabled:K(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(A(o.signedInUser.userId,!0,!1))},updateDownloadStateHandler:a=>{e(Ye(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($(o.firstMonthOfFY,r,c.numberOfPeriods<1?1:c.numberOfPeriods,i)),m.length>0&&e(Z(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(I(a)),(a==="balance_sheet"||a==="cash_flow")&&s==="profit_and_loss_by_classes"&&t==="horizontal"&&e(q({numberOfPeriods:1,orderBy:"ascending_date"})),a!=="profit_and_loss"&&a!=="profit_and_loss_by_classes"&&s==="profit_and_loss_by_classes"&&t==="horizontal"&&e(N({classViewLayout:"vertical"})),y(e)},onCOABalancesRangeChanged:(a,s)=>{e(q(a,s)),y(e)},onThisPeriodChanged:(a,s,t)=>{e(Ge(o.firstMonthOfFY,a,s<1?1:s)),t!==!0&&y(e)},onAdditionalBalanceSelectionChanged:(a,s,t,r)=>{e($(o.firstMonthOfFY,a,t<1?1:t,s)),s.length>0&&e(Z(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(xe({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=Ue(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 Q(o.tenantEmailDomain,a.accountId,a.accountType,m,r,l);if(t?.isHorizontalClassColumn===!0&&s.id!=null)return X(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?X(o.tenantEmailDomain,a.accountId,a.accountType,a.classesViewParentId.parentClassId[0],m,r,l):a.accountType!=null?Q(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(j({scrollPosition:s}));break;case"profit_and_loss_by_classes":e(D({scrollPosition:s}));break;case"profit_and_loss_by_projects":e(H({scrollPosition:s}));break;case"balance_sheet":e(F({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(j({nodeCollapseState:{nodeId:s,isCollapsed:t}}));break;case"profit_and_loss_by_classes":e(D({nodeCollapseState:{nodeId:s,isCollapsed:t}}));break;case"profit_and_loss_by_projects":e(H({nodeCollapseState:{nodeId:s,isCollapsed:t}}));break;case"balance_sheet":e(F({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(ve({viewMode:a})),e(Ve({viewMode:a})),a==="classes"?(o.analytics?.trackGroupBySwitch("Classes",S(o.selectedReportID)),e(I("profit_and_loss_by_classes"))):a==="project"?(o.analytics?.trackGroupBySwitch("Projects",S(o.selectedReportID)),e(I("profit_and_loss_by_projects"))):(o.analytics?.trackGroupBySwitch("Accounts",S(o.selectedReportID)),e(I("profit_and_loss"))),y(e)},onUpdateClassesToFilterOut:a=>{e(Be({classesToFilterOut:a}))},onUpdateProjectsToFilterOut:a=>{e(Le({projectsToFilterOut:a}))},onUpdateClassViewLayout:a=>{e(N({classViewLayout:a}))},onOpenAccountViewMode:()=>{o.isAccountingClassesEnabled&&e(Pe()),o.isAccountingProjectsEnabled&&e(J())},onUpdateDisplayOrder:a=>{e(Ee(a))},onUpdateReportFormat:a=>{ya(e),e(je(a))},onClickMenuIcon:()=>{u(!0)},onResyncReports:()=>{e(De("profit_and_loss_by_classes"))}}}))(ca);function Ca(){const{isAiCfoOpen:e,setIsAiCfoOpen:o}=Je(),f=ea(),u=da(f),a=ge(),s=Ce(),t=z(),{tenantEmailDomain:r}=we(),{useFeatureGate:l}=ee(),{isFeatureEnabled:m}=l(E.isReportsHorizontalClassLayoutSwitchEnabled),c=ae.getSignedInUser(),[i,g]=_.useState(!1),[B,te]=_.useState(!1),{isFeatureEnabled:v}=l(E.isReportsCommentingEnabled);if(c==null)throw Error("Can't access reports page without signing in...");const T=d((n=>L(n))),oe=T.masterTOSInfo?.isMasterTOSAccepted??!1,ne=T.company?.companyInfo.firstMonthOfFY??1,re=ua(v?T?.companyId:void 0),C=d((n=>w(n).fetchState)),ie=d((n=>Te(n))),{areTenantIdsInSync:h}=aa(),R=d((n=>n.financeStatementState.selectedReportId)),V=d((n=>K(n))),M=d((n=>W(n))),le=d((n=>w(n).isCompareModeOn)),b=d((n=>w(n).filter)),O=d((n=>w(n).selectedReportAndTimeframeFetchState)),ce=d((n=>n.profitAndLossClassesViewState.uiState.classViewLayout));_.useEffect((()=>{!i&&h&&(g(!0),s(A(c.userId,!0,!0,!1)))}),[i,c,s,h]),_.useEffect((()=>{i&&!B&&C==="Completed"&&h&&(s(A(c.userId,!1,!0,!1)),te(!0))}),[i,B,C,h]),_.useEffect((()=>{if(i&&O.fetchState==="Not-Started"&&b.timeframe!=="free_range"&&b.timeframe!=="week"&&h)switch(R){case"profit_and_loss":case"profit_and_loss_by_classes":s(Oe(b.timeframe));break;case"profit_and_loss_by_projects":M&&s(J());break;case"balance_sheet":s(Me(b.timeframe));break;case"cash_flow":s(Re(b.timeframe))}}),[i,R,O,h,V,M]);const U=sa(),de=U?.loggedInUserRole!=null&&Ae(U?.loggedInUserRole)!==!0,[pe,fe]=_.useState(!1),x=n=>{fe(n)},me=ta(),ue=oa();return(function(n){const{isDataReady:_e}=n,{pathname:he}=z(),G=Xe(he??"")==="reports",be=Ke(_e),ye=_.useMemo((()=>G?ba:void 0),[G]);We({canFetchSuggestedQuestions:be,pageContexts:ye})})({isDataReady:C==="Completed"}),na({isDataReady:C==="Completed"}),p.jsxs(p.Fragment,{children:[C==="Completed"?p.jsx(ra,{analytics:P,onLoad:n=>n.trackPageLoaded(ia.Event.reports)}):null,p.jsx(ha,{isAppContentDrawerOpen:pe,handleDrawerToggle:x}),p.jsx(ga,{firstMonthOfFY:ne,tenantEmailDomain:r,location:t,navigate:a,windowSize:f,classViewLayout:ce,selectedReportID:R,analytics:P,filter:b,isAccountingClassesEnabled:V,isAccountingProjectsEnabled:M,isCompareModeOn:le,hasTransactionAccess:de,signedInUser:c,selectedReportAndTimeframeFetchState:O,handleDrawerToggle:x,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:v,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 Ga(){const e=d((s=>L(s))),{useFeatureGate:o}=ee(),{isFeatureEnabled:f}=o(E.isDebitCardFeatureEnabled),u=qe(f,e),a=Qe(e);return u===!0||a===!0?p.jsx(ma,{}):p.jsxs(Se,{children:[p.jsx(Y,{path:"/",element:p.jsx(Ca,{})}),p.jsx(Y,{path:"*",element:p.jsx(fa,{})})]})}export{Ga as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{j as a}from"./liveblocks-
|
|
1
|
+
import{j as a}from"./liveblocks-BBLi67DG.js";import{z as w,C as S,f,h as E,da as k,A as C,d as I}from"./index-CivdpZRT.js";import"./mui-C1ThRyKO.js";import g from"./NotFoundScreen-BeJq256C.js";import{a as c}from"./sentry-DW4kKH26.js";import{u as D,j as h,h as F,g as L,n as T,o as U,p as d,N as y}from"./core-D2KaS3N5.js";import{eZ as _,T_ as b,T$ as p,w1 as P,fM as V,U0 as $,v$ as z}from"./zeni-epic-state-BJ_gdj7r.js";import"./recharts-jHFM5Sob.js";import"./analytics-C2MbRoEp.js";import"./plaid-Do7hhR27.js";import"./dnd-D-AkKI2c.js";import"./stripe-cKAAJElX.js";import"./lottie-Dz6JZ58r.js";import"./lexical-BQ-Po3YF.js";import"./pdf-2k8d7AeQ.js";import"./utils-DIwqH7uj.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]="1299ddb8-12c7-4de5-ba47-175108e79c47",e._sentryDebugIdIdentifier="sentry-dbid-1299ddb8-12c7-4de5-ba47-175108e79c47")}catch{}})();const A=T((function(e,t){const n=b(e);return{inviteFormView:n.localData,submitStatus:n.saveStatus,userName:t.userName,rewardsPlan:n.rewardsPlan,companyLegalName:t.companyName}}),(function(e,t){const{navigate:n}=t,i=w.getSignedInUser();return{onDismissClick:()=>{e(p()),n("/")},onSendClick:()=>{if(i!=null){const s=[],r=[];t.inviteFormCompayData.forEach((m=>{s.push(m.companyName),r.push(m.emailIds[0])})),f.trackInviteEmailClicked("send",s,r,s.length)}e(z())},onUpdateInviteFormLocalData:s=>{e($({localData:s}))},onSubmitSuccess:()=>{e(p())},onCancelClick:()=>{i!=null&&f.trackInviteEmailClicked("cancel")}}}))(k),G=()=>{const e=D(),[t,n]=c.useState(!1),[i,s]=c.useState(!1),r=h((o=>_(o))),m=F(),j=L(),u=w.getSignedInUser();if(u==null)throw Error("Can't access invite referral screen without signing in...");const l=h((o=>b(o))),x=u?.firstName!=null?u.firstName:"User";c.useEffect((()=>{e(p()),r?.rewardsLastViewedTime==null&&i===!1&&(e(P()),s(!0))}),[]),c.useEffect((()=>{t||l.fetchState!=="Not-Started"||(n(!0),e(V(!0)))}),[l.fetchState,e]);const v=r.company?.companyInfo.companyLegalName??r.companyName;return a.jsxs(a.Fragment,{children:[l.fetchState==="Completed"?a.jsx(S,{analytics:f,onLoad:o=>(N=>N.trackPageLoaded(E.Event.inviteEmailViewed))(o)}):null,a.jsx(A,{navigate:m,location:j,currentTenant:r,companyName:v,userName:x,inviteFormCompayData:l.localData})]})};function ne(){const{useFeatureGate:e}=C(),{isFeatureEnabled:t}=e(I.isReferralFeatureEnabled);return a.jsxs(U,{children:[a.jsx(d,{path:"/",element:a.jsx(y,{to:"refer",replace:!0})}),a.jsx(d,{path:"how-it-works",element:a.jsx(y,{to:"refer",replace:!0})}),a.jsx(d,{path:"refer/*",element:t?a.jsx(G,{}):a.jsx(g,{})}),a.jsx(d,{path:"*",element:a.jsx(g,{})})]})}export{ne as default};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/DashboardRoutes-
|
|
2
|
-
import{_ as t,bn as us,eZ as ds,fG as cs,fE as ms,go as _s,ft as hs,cW as pe,cC as Es,fW as ps,cu as Rs,bE as xs,bo as gs,f_ as Is,v as js,Mg as Ts,bs as As,Mh as fs,bK as ys,bJ as Ds,bt as bs,cq as Cs,Mi as vs,Mj as Us,cS as Os,cV as ws,cU as Ps,cB as Fs,cI as Ls,oi as Re,fC as xe,gB as Hs,g2 as ge,gy as Ie,gz as je,g3 as ks}from"./zeni-epic-state-x9uZgubN.js";import{j as e}from"./liveblocks-P0DntAgT.js";import{a as w}from"./sentry-CfbcqWq3.js";import{u as Bs,h as Vs,i as Ss,g as Ns,j as z,l as Te,N as u,o as Ms,p as a}from"./core-Ct1Na3r4.js";import{y as Zs,u as zs,z as y,A as Gs,a as $s,c as Ws,d as G,i as Ys,S as qs,e as Js,L as F,O as Ae,t as _,P as Ks,f as X,l}from"./index-BBFNuY8-.js";import"./mui-SSWNL1tt.js";import{f as fe}from"./analyticsHelper-eo4F52XS.js";import{t as Qs}from"./getLocaleForTenant-C9iKXyPU.js";import"./recharts-KVNUr0cO.js";import"./analytics-CsrWBSkJ.js";import"./plaid-CdfVkhIW.js";import"./dnd-DXTfJSUb.js";import"./stripe-cKAAJElX.js";import"./lottie-7Wgw-CzS.js";import"./lexical-5nbymAIm.js";import"./pdf-COhrBMN3.js";import"./utils-BmRSZi-a.js";(function(){try{var o=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},T=new o.Error().stack;T&&(o._sentryDebugIds=o._sentryDebugIds||{},o._sentryDebugIds[T]="bfe50aa7-7148-49f2-82bb-9faff2f50205",o._sentryDebugIdIdentifier="sentry-dbid-bfe50aa7-7148-49f2-82bb-9faff2f50205")}catch{}})();const Xs={dashboard:()=>t((()=>import("./DashboardRoutes-CDwIkoUk.js")),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20])),bills:()=>t((()=>import("./BillPayRoutes-DffUP74I.js")),__vite__mapDeps([21,1,2,3,4,5,6,7,22,13,23,9,14,24,17,19,25,15,12,26,27,28,29,20])),reimbursement:()=>t((()=>import("./ReimbursementRoutes-C1MfITXr.js")),__vite__mapDeps([30,1,2,3,4,5,6,7,13,25,17,15,12,26,19,9,14,24,31,28,29,20])),transactions:()=>t((()=>import("./TransactionListRoutes-CoFY3pbX.js")),__vite__mapDeps([32,1,2,3,4,5,6,7,8,9,10,11,12,33,20])),settings:()=>t((()=>import("./SettingsRoutes-BZ_pWEty.js")),__vite__mapDeps([34,1,2,3,4,5,6,7,17,35,22,13,15,26,12,16,36,37,38,39,40,41,11,27,28,31,20])),reports:()=>t((()=>import("./ReportsRoutes-CoMGWCHx.js")),__vite__mapDeps([42,1,2,3,4,5,6,7,13,19,14,12,17,20])),chargeCards:()=>t((()=>import("./ChargeCardRoutes-SaV3T-oM.js")),__vite__mapDeps([43,1,2,3,4,5,6,7,9,17,25,13,15,12,26,14,44,22,20])),people:()=>t((()=>import("./PeopleRoutes-DNg7Ihue.js")),__vite__mapDeps([45,1,2,3,4,5,6,7,13,9,17,20])),expenseAutomation:()=>t((()=>import("./ExpenseAutomationRoutes-BnRbsSz6.js")),__vite__mapDeps([46,1,2,3,13,4,5,6,7,9,10,11,12,8,35,24,20])),treasury:()=>t((()=>import("./TreasuryRoutes--lIehLfz.js")),__vite__mapDeps([47,1,2,3,4,5,6,7,13,25,17,15,12,26,9,14,48,19,20])),vendors:()=>t((()=>import("./VendorsRoutes-BlvpjJIF.js")),__vite__mapDeps([49,1,2,3,4,5,6,7,22,13,19,12,50,9,17,24,35,20])),zeniAccounts:()=>t((()=>import("./ZeniAccountRoutes-DsEwo2kw.js")),__vite__mapDeps([51,1,2,3,4,5,6,7,48,13,25,17,15,12,26,19,23,22,9,33,20]))},et=["bills","transactions","settings","reimbursement","reports","chargeCards","people"],ee=o=>{"requestIdleCallback"in window?requestIdleCallback(o):setTimeout(o,100)},st=l((()=>t((()=>import("./ReportsRoutes-CoMGWCHx.js")),__vite__mapDeps([42,1,2,3,4,5,6,7,13,19,14,12,17,20])))),tt=l((()=>t((()=>import("./AddressRoutes-D14Xrcr-.js")),__vite__mapDeps([52,1,2,3,22,4,5,6,7,13,20])))),nt=l((()=>t((()=>import("./PeopleRoutes-DNg7Ihue.js")),__vite__mapDeps([45,1,2,3,4,5,6,7,13,9,17,20])))),at=l((()=>t((()=>import("./PandLWithForecastRoutes-W3OrOyHu.js")),__vite__mapDeps([53,1,2,3,4,5,6,7,13,19,9,14,12,17,20])))),ot=l((()=>t((()=>import("./CustomerOnboardingRoutes-Ber4B0KW.js")),__vite__mapDeps([54,1,2,3,22,4,5,6,7,13,37,38,39,40,41,11,36,44,20])))),rt=l((()=>t((()=>import("./VendorsRoutes-BlvpjJIF.js")),__vite__mapDeps([49,1,2,3,4,5,6,7,22,13,19,12,50,9,17,24,35,20])))),it=l((()=>t((()=>import("./TransactionDetailRoutes-CmH9g66g.js")),__vite__mapDeps([55,1,2,3,13,4,5,6,7,10,9,11,12,20])))),ye=l((()=>t((()=>import("./EntityDetailRoutes-lCFdhj0N.js")),__vite__mapDeps([56,1,2,3,4,5,6,7,11,8,9,10,12,20])))),lt=l((()=>t((()=>import("./DashboardRoutes-CDwIkoUk.js")),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20])))),De=l((()=>t((()=>import("./BillPayRoutes-DffUP74I.js")),__vite__mapDeps([21,1,2,3,4,5,6,7,22,13,23,9,14,24,17,19,25,15,12,26,27,28,29,20])))),ut=l((()=>t((()=>import("./SettingsRoutes-BZ_pWEty.js")),__vite__mapDeps([34,1,2,3,4,5,6,7,17,35,22,13,15,26,12,16,36,37,38,39,40,41,11,27,28,31,20])))),be=l((()=>t((()=>import("./ReimbursementRoutes-C1MfITXr.js")),__vite__mapDeps([30,1,2,3,4,5,6,7,13,25,17,15,12,26,19,9,14,24,31,28,29,20])))),dt=l((()=>t((()=>import("./ZeniAccountRoutes-DsEwo2kw.js")),__vite__mapDeps([51,1,2,3,4,5,6,7,48,13,25,17,15,12,26,19,23,22,9,33,20])))),ct=l((()=>t((()=>import("./TreasuryRoutes--lIehLfz.js")),__vite__mapDeps([47,1,2,3,4,5,6,7,13,25,17,15,12,26,9,14,48,19,20])))),mt=l((()=>t((()=>import("./TransactionListRoutes-CoFY3pbX.js")),__vite__mapDeps([32,1,2,3,4,5,6,7,8,9,10,11,12,33,20])))),_t=l((()=>t((()=>import("./ChargeCardRoutes-SaV3T-oM.js")),__vite__mapDeps([43,1,2,3,4,5,6,7,9,17,25,13,15,12,26,14,44,22,20])))),ht=l((()=>t((()=>import("./NotificationRoutes-Cd2QvtFH.js")),__vite__mapDeps([57,1,2,3,13,4,5,6,7,9,20])))),Et=l((()=>t((()=>import("./PerformanceRoutes-o3ofDHl6.js")),__vite__mapDeps([58,1,2,3,13,4,5,6,7,9,17,20])))),pt=l((()=>t((()=>import("./ExpenseAutomationRoutes-BnRbsSz6.js")),__vite__mapDeps([46,1,2,3,13,4,5,6,7,9,10,11,12,8,35,24,20])))),Rt=l((()=>t((()=>import("./RewardsRoutes-e7w8wtnX.js")),__vite__mapDeps([59,1,2,3,4,5,6,7,13,20])))),xt=l((()=>t((()=>import("./TaskRoutes-CpISGdNU.js")),__vite__mapDeps([60,1,2,3,13,4,5,6,7,14,17,61,9,20])))),gt=l((()=>t((()=>import("./AiCfoScreen-C7VAZJ1A.js")),__vite__mapDeps([62,1,2,3,4,5,6,7,18,50,20])))),Ce=l((()=>t((()=>import("./CardsAiCfoScreen-BahaNrfe.js")),__vite__mapDeps([63,1,2,3,4,5,6,7,20])))),b=l((()=>t((()=>import("./NotFoundScreen-DR4zbgK0.js")),__vite__mapDeps([13,1,2,3,4,5,6,7,20])))),It=l((()=>t((()=>import("./TaskListScreen-C_rNr9Jk.js")),__vite__mapDeps([61,1,2,3,4,5,6,7,9,17,20]))));function Nt({setTenantEmailDomain:o}){const T=Bs(),B=Vs(),{tenantEmailDomain:i}=Ss(),L=Zs().mode,{setLoading:U,clearAllLoading:C,clearLoading:H}=zs(),v=y.getSignedInUserTenant(i)?.tenantId,I=y.getSignedInUser(),se=us(I),$=Ns(),[V,Pe]=w.useState(!1),r=z((n=>ds(n))),{useFeatureGate:N}=Gs(),M=$s(),te=Ws(),Fe=!!r.company?.companyZeniAccountInfo?.isZeniAccountEnabled,Le=r.companyTreasuryInfo?.info?.businessVerificationStatus?.code==="verified",{isFeatureEnabled:He}=N(G.isChargeCardFeatureEnabled),{isFeatureEnabled:ne}=N(G.isDebitCardFeatureEnabled),A=z((n=>n.tenantState.fetchState)),j=z((n=>n.tenantState.activeTenantFetchState.fetchState)),h=j==="Completed"||A==="Completed"?cs(ne,r):void 0,J=j==="Completed"||A==="Completed"?ms(r):void 0,ke=Ys(r,He,ne),{isCardsHidden:Be}=qs(r?.tenantId),Ve=!ke||!!Be,{isFeatureEnabled:Se}=N(G.isSettingsFeatureEnabled),{isFeatureEnabled:K}=N(G.isAiCfoFileUploadEnabled),W=z((n=>_s(n)));if(i!=null){const n=y.getSignedInUserTenant(i);I!=null&&n!=null&&fe(I,r,L)}const Z={tenantId:v,userId:I?.userId,sessionId:I?.zeniSessionId},ae=hs(),E=Js(),Ne=r.company==null||E?.loggedInUserRoleMap!=null&&pe(E.loggedInUserRole),Me=Es(E?.loggedInUserRoleMap),oe=w.useRef(!0),re=Te("/:tenantEmailDomain/onboarding/*")!==null,Q=Te("/:tenantEmailDomain/month_end_close_checks/review/:selectedTab/:selectedPeriod/*"),Ze=z((n=>Z.tenantId!=null?ps(n,Z.tenantId):void 0));w.useEffect((()=>{U(F.TENANT_FETCHING),o(i)}),[i]),w.useEffect((()=>{if(Q!=null&&v!=null){const n=Q.params.selectedPeriod;if(n!=null){const f=n.split("-");if(f.length===2){const d=Rs(Number(f[0])),s=Number(f[1]),c=xs(`01-${d<10?`0${d}`:d}-${s}`,Ae.getLocalizedStrings().dateFormat.analytics.DDDashMMDashYYYY),S=gs();c.isAfter(S,"month")===!1?T(Is(v,{month:d,year:s})):B("./month_end_close_checks/review")}}}}),[Q,v]),w.useEffect((()=>{V||(Pe(!0),U(F.TENANT_FETCHING)),oe.current?oe.current=!1:!js(ae,Z)&&y.isSignedIn()&&(U(F.TENANT_FETCHING),(function(n,f,d,s){if(xe(f?.userId,f?.zeniSessionId,n.tenantId),d(Hs(!0)),d(ge(n.tenantId)),n.tenantId!=null&&_.clearTenant(n.tenantId),n.tenantId!=null){const c=y.getSignedInUserTenantWithId(n.tenantId);s&&Ae.updateAppLocaleID(Qs(s)),c?.tenantEmailDomain!=null&&y.saveActiveTenantDomainForUser(c?.tenantEmailDomain)}n.userId!=null?X.identify(n.userId,{tenant_id:n.tenantId}):X.resetUserIdentity()})(Z,I,T,Ze))}),[Z,ae,I,T,y]),w.useEffect((()=>{y.isSignedIn()&&(U(F.TENANT_FETCHING),(function(n,f,d,s,c,S,k){if(d==null&&s==null)return void console.warn("There is no current tenant selected!!");const Y=s!=null&&c?.zeniSessionId!=null,rs=d==null||d.tenantId!==s,is=d!=null&&d.excludedResources==null,ls=d!=null&&d.externalConnections==null;if(Y&&rs){k(ge(s));const q=y.getSignedInUserTenantWithId(s);q?.tenantEmailDomain!=null&&y.saveActiveTenantDomainForUser(q?.tenantEmailDomain),xe(c?.userId,c?.zeniSessionId,s),_.shouldFetchExcludedResources(s)&&(_.markExcludedResourcesFetchStarted(s),k(Ie(c.userId,s))),_.shouldFetchConnections(s)&&(_.markConnectionsFetchStarted(s),k(je(c.userId,s)))}else Y&&is&&_.shouldFetchExcludedResources(s)&&(_.markExcludedResourcesFetchStarted(s),k(Ie(c.userId,s))),Y&&ls&&_.shouldFetchConnections(s)&&(_.markConnectionsFetchStarted(s),k(je(c.userId,s)));if(Y){X.identify(c.userId,{tenant_id:s});const q=s==null||s!=null&&(f==="Completed"||f==="Error");n==="Completed"||f!=="Not-Started"&&f!=="Error"||s==null||!_.shouldFetchActiveTenant(s)||(_.markActiveTenantFetchStarted(s),S(F.TENANT_FETCHING),k(ks(c.userId,s,c.zeniSessionId))),q&&(n==="Not-Started"||n==="Error")&&_.shouldFetchAllTenants()&&(_.markAllTenantsFetchStarted(),k(Re(c.userId,c.zeniSessionId)))}})(A,j,r,v,I,U,T))}),[v,j]),w.useEffect((()=>{y.isSignedIn()&&A==="Completed"&&W.tenantsBaseInOrder.length>0&&(H(F.TENANT_FETCHING),y.saveSignedInUserTenants(Ts(W.tenantsBaseInOrder)),I!=null&&fe(I,r,L,void 0,W.tenantsBaseInOrder))}),[W,A,r,I]),w.useEffect((()=>{j==="In-Progress"&&U(F.TENANT_FETCHING),j!=="Completed"&&j!=="Error"||(j==="Completed"&&v!=null?(C(),_.markActiveTenantFetchCompleted(v)):j==="Error"&&v!=null&&(_.markActiveTenantFetchFailed(v),H(F.TENANT_FETCHING),H(F.TENANT_SWITCHING))),A!=="Completed"&&A!=="Error"||(A==="Completed"?_.markAllTenantsFetchCompleted():A==="Error"&&_.markAllTenantsFetchFailed())}),[j,A,v,V]);const ie=w.useRef(!1);w.useEffect((()=>{!ie.current&&j==="Completed"&&V&&(ie.current=!0,(function(n=et,f=3e3){setTimeout((()=>{const d=s=>{if(s>=n.length)return;const c=n[s],S=Xs[c];S!=null?S().then((()=>ee((()=>d(s+1))))).catch((()=>ee((()=>d(s+1))))):d(s+1)};ee((()=>d(0)))}),f)})())}),[j,V]);const O=r?.userRole!=null&&As(r?.userRole),{isFeatureEnabled:ze}=N(G.isReferralFeatureEnabled),Ge=r?.userRole!=null&&r.userRole.includes("charge_card_user"),$e=r?.userRole!=null&&r.userRole.includes("charge_card_admin"),P=r?.userRole!=null&&pe(r.userRole),le=r?.company==null||r.company.featuresActivationInfo?.isBillPayFeatureEnabled&&!O,ue=!Ve&&!O,We=fs(E?.loggedInUserRoleMap),Ye=r.externalConnections?.accounting[0]?.isValid,qe=r.externalConnections?.fetchState==="Completed",de=r.company?.companyOnboardingInfo.isOnboardingCompleted,ce=r?.company==null||r.company.featuresActivationInfo?.isReimbursementFeatureEnabled&&!O,me=ce&&ys(E?.loggedInUserRoleMap),_e=Fe&&!O,Je=Le&&!O,Ke=le&&Ds(E?.loggedInUserRoleMap),Qe=ue&&bs(E?.loggedInUserRoleMap),Xe=_e&&Cs(E?.loggedInUserRoleMap),es=vs(E?.loggedInUserRoleMap),ss=Us(E?.loggedInUserRoleMap),ts=Os(E?.loggedInUserRoleMap),ns=ws(E?.loggedInUserRoleMap),as=Ps(E?.loggedInUserRoleMap),p=Fs(E?.loggedInUserRoleMap),R=Ls(E?.loggedInUserRoleMap),he=le&&p,Ee=ce&&R,x=_e&&ts,g=Je&&ns,m=ue&&as,os=r.excludedResources?.resources?.find((n=>n.resource==="/invites"))!=null||Me===!0||We===!0||es===!0||ss===!0;return y.isSignedIn()?v==null?A==="Completed"?e.jsx(u,{to:"/",replace:!0,state:{...$.state,message:"...",origin:$.pathname}}):(I!=null&&A!=="In-Progress"&&T(Re(I.userId,I.zeniSessionId)),null):j!=="In-Progress"&&j!=="Not-Started"||A==="Completed"?(de===!0||se&&!re)&&qe&&Ye!==!0&&h===!1&&J===!1?(o(void 0),e.jsx(u,{to:"/connection/auth",replace:!0})):!V||de!==!1||re||se?V&&r?.userRole&&h!=null&&J!=null&&i!=null&&Object.keys(E.loggedInUserRoleMap).length>0?e.jsx(Ms,{children:e.jsxs(a,{element:e.jsx(Ks,{}),children:[e.jsx(a,{path:"/",element:e.jsx(jt,{isDashboardAccess:P,showZeniAccountRoute:x,isUserHasBillPayAccess:p,isUserHasReimbursementAccess:R,showTreasuryRoute:g,isTenantBankingOnly:h,isTenantCardsOnly:J,showChargeCardRoute:m})}),e.jsx(a,{path:"dashboard/*",element:P?e.jsx(lt,{}):e.jsx(D,{showZeniAccountRoute:x,isUserHasBillPayAccess:p,isUserHasReimbursementAccess:R,showTreasuryRoute:g,isTenantBankingOnly:h,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(a,{path:"reports/*",element:P?e.jsx(st,{}):e.jsx(D,{showZeniAccountRoute:x,isUserHasBillPayAccess:p,isUserHasReimbursementAccess:R,showTreasuryRoute:g,isTenantBankingOnly:h,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(a,{path:"people/*",element:os||P?e.jsx(nt,{}):e.jsx(D,{showZeniAccountRoute:x,isUserHasBillPayAccess:p,isUserHasReimbursementAccess:R,showTreasuryRoute:g,isTenantBankingOnly:h,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(a,{path:"forecast/*",element:P?e.jsx(at,{}):e.jsx(D,{showZeniAccountRoute:x,isUserHasBillPayAccess:p,isUserHasReimbursementAccess:R,showTreasuryRoute:g,isTenantBankingOnly:h,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(a,{path:"onboarding/*",element:e.jsx(ot,{})}),e.jsx(a,{path:"transaction/*",element:P&&O===!1||Ge||$e?e.jsx(it,{}):e.jsx(D,{showZeniAccountRoute:x,isUserHasBillPayAccess:p,isUserHasReimbursementAccess:R,showTreasuryRoute:g,isTenantBankingOnly:h,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(a,{path:"transactions/*",element:P&&O===!1?e.jsx(mt,{}):e.jsx(D,{showZeniAccountRoute:x,isUserHasBillPayAccess:p,isUserHasReimbursementAccess:R,showTreasuryRoute:g,isTenantBankingOnly:h,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(a,{path:"customer/*",element:P&&O===!1?e.jsx(ye,{entityType:"customer"}):e.jsx(D,{showZeniAccountRoute:x,isUserHasBillPayAccess:p,isUserHasReimbursementAccess:R,isTenantBankingOnly:h,showTreasuryRoute:g,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(a,{path:"vendor/*",element:P&&O===!1?e.jsx(ye,{entityType:"vendor"}):e.jsx(D,{showZeniAccountRoute:x,isUserHasBillPayAccess:p,isUserHasReimbursementAccess:R,showTreasuryRoute:g,isTenantBankingOnly:h,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(a,{path:"tasks",element:e.jsx(It,{})}),e.jsx(a,{path:"tasks/*",element:e.jsx(xt,{})}),e.jsx(a,{path:"address/*",element:Ke||me||Xe||Qe?e.jsx(tt,{}):e.jsx(D,{showZeniAccountRoute:x,isUserHasBillPayAccess:p,isUserHasReimbursementAccess:R,showTreasuryRoute:g,isTenantBankingOnly:h,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(a,{path:"checking/*",element:x?e.jsx(dt,{}):e.jsx(b,{})}),e.jsx(a,{path:"treasury/*",element:g?e.jsx(ct,{}):e.jsx(b,{})}),e.jsx(a,{path:"performance",element:te===!0?e.jsx(Et,{}):e.jsx(we,{tenantEmailDomain:i})}),e.jsx(a,{path:"month_end_close_checks/review/*",element:te===!0&&O===!1?e.jsx(pt,{}):e.jsx(we,{tenantEmailDomain:i})}),e.jsx(a,{path:"notifications/*",element:e.jsx(ht,{})}),e.jsx(a,{path:"vendors/*",element:Ne?e.jsx(rt,{}):e.jsx(b,{})}),e.jsx(a,{path:"bill/*",element:he?e.jsx(De,{}):e.jsx(D,{showZeniAccountRoute:x,isUserHasBillPayAccess:p,isUserHasReimbursementAccess:R,showTreasuryRoute:g,isTenantBankingOnly:h,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(a,{path:"bills/*",element:he?e.jsx(De,{}):e.jsx(D,{showZeniAccountRoute:x,isUserHasBillPayAccess:p,isUserHasReimbursementAccess:R,showTreasuryRoute:g,isTenantBankingOnly:h,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(a,{path:"reimbursement/*",element:Ee?e.jsx(be,{}):e.jsx(D,{showZeniAccountRoute:x,isUserHasBillPayAccess:p,isUserHasReimbursementAccess:R,showTreasuryRoute:g,isTenantBankingOnly:h,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(a,{path:"reimbursements/*",element:Ee?e.jsx(be,{}):e.jsx(D,{showZeniAccountRoute:x,isUserHasBillPayAccess:p,isUserHasReimbursementAccess:R,showTreasuryRoute:g,isTenantBankingOnly:h,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(a,{path:"settings/*",element:Se?e.jsx(ut,{hasAdminLevelAccess:me}):e.jsx(b,{})}),e.jsx(a,{path:"cards/ask",element:m&&M?e.jsx(Ce,{isFileUploadEnabled:K}):e.jsx(b,{})}),e.jsx(a,{path:"cards/ask/:session_id",element:m&&M?e.jsx(Ce,{isFileUploadEnabled:K}):e.jsx(b,{})}),e.jsx(a,{path:"cards/*",element:m?e.jsx(_t,{}):e.jsx(b,{})}),e.jsx(a,{path:"rewards/*",element:ze?e.jsx(Rt,{}):e.jsx(b,{})}),e.jsx(a,{path:"/ai-cfo",element:M?e.jsx(u,{to:"explore"}):e.jsx(b,{})}),e.jsx(a,{path:"/ai-cfo/",element:M?e.jsx(u,{to:"explore"}):e.jsx(b,{})}),e.jsx(a,{path:"/ai-cfo/:session_id",element:M?e.jsx(gt,{isFileUploadEnabled:K}):e.jsx(b,{})}),e.jsx(a,{path:"*",element:e.jsx(b,{})})]})}):null:(o(void 0),e.jsx(u,{to:"onboarding",replace:!0})):null:(console.warn("User logged out!!"),o(void 0),e.jsx(u,{to:"/signin/auth",replace:!0,state:{...$.state,message:"...",origin:$.pathname}}))}const jt=({isDashboardAccess:o,showZeniAccountRoute:T,isUserHasBillPayAccess:B,isUserHasReimbursementAccess:i,showTreasuryRoute:L,isTenantBankingOnly:U,isTenantCardsOnly:C,showChargeCardRoute:H})=>{if(U===!0){if(T)return e.jsx(u,{to:"checking"});if(L)return e.jsx(u,{to:"treasury"});if(H)return e.jsx(u,{to:"cards"})}return C===!0&&H?e.jsx(u,{to:"cards"}):o?e.jsx(u,{to:"dashboard"}):T?e.jsx(u,{to:"checking"}):L?e.jsx(u,{to:"treasury"}):H?e.jsx(u,{to:"cards"}):B?e.jsx(u,{to:"bills"}):i?e.jsx(u,{to:"reimbursements"}):e.jsx(u,{to:"dashboard"})},D=({showZeniAccountRoute:o,isUserHasBillPayAccess:T,isUserHasReimbursementAccess:B,showTreasuryRoute:i,isTenantBankingOnly:L,showChargeCardRoute:U,tenantEmailDomain:C})=>{if(L===!0){if(o)return e.jsx(Ue,{tenantEmailDomain:C});if(i)return e.jsx(ve,{tenantEmailDomain:C});if(U)return e.jsx(Oe,{tenantEmailDomain:C})}return o?e.jsx(Ue,{tenantEmailDomain:C}):i?e.jsx(ve,{tenantEmailDomain:C}):U?e.jsx(Oe,{tenantEmailDomain:C}):T?e.jsx(At,{tenantEmailDomain:C}):B?e.jsx(Tt,{tenantEmailDomain:C}):e.jsx(b,{})},Tt=({tenantEmailDomain:o})=>e.jsx(u,{to:`/${o}/reimbursements`}),At=({tenantEmailDomain:o})=>e.jsx(u,{to:`/${o}/bills`}),ve=({tenantEmailDomain:o})=>e.jsx(u,{to:`/${o}/treasury`}),Ue=({tenantEmailDomain:o})=>e.jsx(u,{to:`/${o}/checking`}),Oe=({tenantEmailDomain:o})=>e.jsx(u,{to:`/${o}/cards`}),we=({tenantEmailDomain:o})=>e.jsx(u,{to:`/${o}/dashboard`});export{D as FallBackRoute,Nt as default};
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/DashboardRoutes-BCmwgis8.js","assets/sentry-DW4kKH26.js","assets/core-D2KaS3N5.js","assets/zeni-epic-state-BJ_gdj7r.js","assets/index-CivdpZRT.js","assets/mui-C1ThRyKO.js","assets/analytics-C2MbRoEp.js","assets/utils-DIwqH7uj.js","assets/withTransactionSidePanel-DWx4OX2G.js","assets/useAskAiCfoHostNavButtonProps-CNoSipqI.js","assets/TransactionDetailScreen-B77dqrVQ.js","assets/decodeURIComponentSafe-CD_zntJd.js","assets/routePaths-TRamKMNj.js","assets/NotFoundScreen-BeJq256C.js","assets/useInitialThreadRequest-UA6eH2dj.js","assets/analyticsHelper-DqO64pHt.js","assets/CompanyPassportScreen-CxVFTUSz.js","assets/MobileAppDrawer-O95nPlSQ.js","assets/useAiCfoDashboardSuggestedQuestionsChips-CuA1dWGl.js","assets/FeaturePreviewScreen-C_bWMNSt.js","assets/index-Czu7h9lW.css","assets/BillPayRoutes-D0Ag3ATI.js","assets/AddressScreen-CGTYstNo.js","assets/DomesticWireDetailScreen-qVcyg1bS.js","assets/DrawerScreen-YrXahOEM.js","assets/SetupPagesScreen-DqGd8bGY.js","assets/BusinessVerificationPageScreen-BohezKn6.js","assets/BillPayApprovalRoutes-guz2sdH1.js","assets/ReimbursementApprovalRuleDetailScreen-BdQmAA7j.js","assets/getLocaleForTenant--JGxRDjE.js","assets/ReimbursementRoutes-OiL1KOsA.js","assets/ReimbursementApprovalRoutes-DhrGnU7Q.js","assets/TransactionListRoutes-t_0rbITT.js","assets/ZeniAccountStatementScreen-BUgkOPv6.js","assets/SettingsRoutes-B0QfLxKl.js","assets/accountMappingHelper-BmtW64tm.js","assets/useEmailConnectResultRefresh-Ddee2XH0.js","assets/QBOConnectionScreen-vAHPaqo7.js","assets/empty-D1hMU_8M.js","assets/index-CHRJI22G.js","assets/url-8bOSIiqX.js","assets/index-Dyy6NuL-.js","assets/ReportsRoutes-cJ_74y1a.js","assets/ChargeCardRoutes-C3e575qW.js","assets/useChargeCardPusherEvents-9ezHPs6j.js","assets/PeopleRoutes-DPUju30P.js","assets/ExpenseAutomationRoutes-ChtLHwSX.js","assets/TreasuryRoutes-C2A809wv.js","assets/useCashManagementBanner-COk5CYpf.js","assets/VendorsRoutes-Ba7d72j7.js","assets/pathToGoBack-Du20FI7g.js","assets/ZeniAccountRoutes-DdIrrwcf.js","assets/AddressRoutes-B7ET6G-y.js","assets/PandLWithForecastRoutes-DdDF5n8o.js","assets/CustomerOnboardingRoutes-C6q0UB9j.js","assets/TransactionDetailRoutes-D9ZuqZEq.js","assets/EntityDetailRoutes-CteWzOFU.js","assets/NotificationRoutes-dRraueia.js","assets/PerformanceRoutes-BSNXb7w3.js","assets/RewardsRoutes-DaWb-BQo.js","assets/TaskRoutes-B9S8VECk.js","assets/TaskListScreen-q9ElonDb.js","assets/AiCfoScreen-CA8qqox4.js","assets/CardsAiCfoScreen-GOQqQudn.js"])))=>i.map(i=>d[i]);
|
|
2
|
+
import{_ as t,bn as us,eZ as ds,fG as cs,fE as ms,go as _s,ft as hs,cW as pe,cC as Es,fW as ps,cu as Rs,bE as xs,bo as gs,f_ as Is,v as js,Mg as Ts,bs as As,Mh as fs,bK as ys,bJ as Ds,bt as bs,cq as Cs,Mi as vs,Mj as Us,cS as Os,cV as ws,cU as Ps,cB as Fs,cI as Ls,oi as Re,fC as xe,gB as Hs,g2 as ge,gy as Ie,gz as je,g3 as ks}from"./zeni-epic-state-BJ_gdj7r.js";import{j as e}from"./liveblocks-BBLi67DG.js";import{a as w}from"./sentry-DW4kKH26.js";import{u as Bs,h as Vs,i as Ss,g as Ns,j as z,l as Te,N as u,o as Ms,p as a}from"./core-D2KaS3N5.js";import{y as Zs,u as zs,z as y,A as Gs,a as $s,c as Ws,d as G,i as Ys,S as qs,e as Js,L as F,O as Ae,t as _,P as Ks,f as X,l}from"./index-CivdpZRT.js";import"./mui-C1ThRyKO.js";import{f as fe}from"./analyticsHelper-DqO64pHt.js";import{t as Qs}from"./getLocaleForTenant--JGxRDjE.js";import"./recharts-jHFM5Sob.js";import"./analytics-C2MbRoEp.js";import"./plaid-Do7hhR27.js";import"./dnd-D-AkKI2c.js";import"./stripe-cKAAJElX.js";import"./lottie-Dz6JZ58r.js";import"./lexical-BQ-Po3YF.js";import"./pdf-2k8d7AeQ.js";import"./utils-DIwqH7uj.js";(function(){try{var o=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},T=new o.Error().stack;T&&(o._sentryDebugIds=o._sentryDebugIds||{},o._sentryDebugIds[T]="bfe50aa7-7148-49f2-82bb-9faff2f50205",o._sentryDebugIdIdentifier="sentry-dbid-bfe50aa7-7148-49f2-82bb-9faff2f50205")}catch{}})();const Xs={dashboard:()=>t((()=>import("./DashboardRoutes-BCmwgis8.js")),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20])),bills:()=>t((()=>import("./BillPayRoutes-D0Ag3ATI.js")),__vite__mapDeps([21,1,2,3,4,5,6,7,22,13,23,9,14,24,17,19,25,15,12,26,27,28,29,20])),reimbursement:()=>t((()=>import("./ReimbursementRoutes-OiL1KOsA.js")),__vite__mapDeps([30,1,2,3,4,5,6,7,13,25,17,15,12,26,19,9,14,24,31,28,29,20])),transactions:()=>t((()=>import("./TransactionListRoutes-t_0rbITT.js")),__vite__mapDeps([32,1,2,3,4,5,6,7,8,9,10,11,12,33,20])),settings:()=>t((()=>import("./SettingsRoutes-B0QfLxKl.js")),__vite__mapDeps([34,1,2,3,4,5,6,7,17,35,22,13,15,26,12,16,36,37,38,39,40,41,11,27,28,31,20])),reports:()=>t((()=>import("./ReportsRoutes-cJ_74y1a.js")),__vite__mapDeps([42,1,2,3,4,5,6,7,13,19,14,12,17,20])),chargeCards:()=>t((()=>import("./ChargeCardRoutes-C3e575qW.js")),__vite__mapDeps([43,1,2,3,4,5,6,7,9,17,25,13,15,12,26,14,44,22,20])),people:()=>t((()=>import("./PeopleRoutes-DPUju30P.js")),__vite__mapDeps([45,1,2,3,4,5,6,7,13,9,17,20])),expenseAutomation:()=>t((()=>import("./ExpenseAutomationRoutes-ChtLHwSX.js")),__vite__mapDeps([46,1,2,3,13,4,5,6,7,9,10,11,12,8,35,24,20])),treasury:()=>t((()=>import("./TreasuryRoutes-C2A809wv.js")),__vite__mapDeps([47,1,2,3,4,5,6,7,13,25,17,15,12,26,9,14,48,19,20])),vendors:()=>t((()=>import("./VendorsRoutes-Ba7d72j7.js")),__vite__mapDeps([49,1,2,3,4,5,6,7,22,13,19,12,50,9,17,24,35,20])),zeniAccounts:()=>t((()=>import("./ZeniAccountRoutes-DdIrrwcf.js")),__vite__mapDeps([51,1,2,3,4,5,6,7,48,13,25,17,15,12,26,19,23,22,9,33,20]))},et=["bills","transactions","settings","reimbursement","reports","chargeCards","people"],ee=o=>{"requestIdleCallback"in window?requestIdleCallback(o):setTimeout(o,100)},st=l((()=>t((()=>import("./ReportsRoutes-cJ_74y1a.js")),__vite__mapDeps([42,1,2,3,4,5,6,7,13,19,14,12,17,20])))),tt=l((()=>t((()=>import("./AddressRoutes-B7ET6G-y.js")),__vite__mapDeps([52,1,2,3,22,4,5,6,7,13,20])))),nt=l((()=>t((()=>import("./PeopleRoutes-DPUju30P.js")),__vite__mapDeps([45,1,2,3,4,5,6,7,13,9,17,20])))),at=l((()=>t((()=>import("./PandLWithForecastRoutes-DdDF5n8o.js")),__vite__mapDeps([53,1,2,3,4,5,6,7,13,19,9,14,12,17,20])))),ot=l((()=>t((()=>import("./CustomerOnboardingRoutes-C6q0UB9j.js")),__vite__mapDeps([54,1,2,3,22,4,5,6,7,13,37,38,39,40,41,11,36,44,20])))),rt=l((()=>t((()=>import("./VendorsRoutes-Ba7d72j7.js")),__vite__mapDeps([49,1,2,3,4,5,6,7,22,13,19,12,50,9,17,24,35,20])))),it=l((()=>t((()=>import("./TransactionDetailRoutes-D9ZuqZEq.js")),__vite__mapDeps([55,1,2,3,13,4,5,6,7,10,9,11,12,20])))),ye=l((()=>t((()=>import("./EntityDetailRoutes-CteWzOFU.js")),__vite__mapDeps([56,1,2,3,4,5,6,7,11,8,9,10,12,20])))),lt=l((()=>t((()=>import("./DashboardRoutes-BCmwgis8.js")),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20])))),De=l((()=>t((()=>import("./BillPayRoutes-D0Ag3ATI.js")),__vite__mapDeps([21,1,2,3,4,5,6,7,22,13,23,9,14,24,17,19,25,15,12,26,27,28,29,20])))),ut=l((()=>t((()=>import("./SettingsRoutes-B0QfLxKl.js")),__vite__mapDeps([34,1,2,3,4,5,6,7,17,35,22,13,15,26,12,16,36,37,38,39,40,41,11,27,28,31,20])))),be=l((()=>t((()=>import("./ReimbursementRoutes-OiL1KOsA.js")),__vite__mapDeps([30,1,2,3,4,5,6,7,13,25,17,15,12,26,19,9,14,24,31,28,29,20])))),dt=l((()=>t((()=>import("./ZeniAccountRoutes-DdIrrwcf.js")),__vite__mapDeps([51,1,2,3,4,5,6,7,48,13,25,17,15,12,26,19,23,22,9,33,20])))),ct=l((()=>t((()=>import("./TreasuryRoutes-C2A809wv.js")),__vite__mapDeps([47,1,2,3,4,5,6,7,13,25,17,15,12,26,9,14,48,19,20])))),mt=l((()=>t((()=>import("./TransactionListRoutes-t_0rbITT.js")),__vite__mapDeps([32,1,2,3,4,5,6,7,8,9,10,11,12,33,20])))),_t=l((()=>t((()=>import("./ChargeCardRoutes-C3e575qW.js")),__vite__mapDeps([43,1,2,3,4,5,6,7,9,17,25,13,15,12,26,14,44,22,20])))),ht=l((()=>t((()=>import("./NotificationRoutes-dRraueia.js")),__vite__mapDeps([57,1,2,3,13,4,5,6,7,9,20])))),Et=l((()=>t((()=>import("./PerformanceRoutes-BSNXb7w3.js")),__vite__mapDeps([58,1,2,3,13,4,5,6,7,9,17,20])))),pt=l((()=>t((()=>import("./ExpenseAutomationRoutes-ChtLHwSX.js")),__vite__mapDeps([46,1,2,3,13,4,5,6,7,9,10,11,12,8,35,24,20])))),Rt=l((()=>t((()=>import("./RewardsRoutes-DaWb-BQo.js")),__vite__mapDeps([59,1,2,3,4,5,6,7,13,20])))),xt=l((()=>t((()=>import("./TaskRoutes-B9S8VECk.js")),__vite__mapDeps([60,1,2,3,13,4,5,6,7,14,17,61,9,20])))),gt=l((()=>t((()=>import("./AiCfoScreen-CA8qqox4.js")),__vite__mapDeps([62,1,2,3,4,5,6,7,18,50,20])))),Ce=l((()=>t((()=>import("./CardsAiCfoScreen-GOQqQudn.js")),__vite__mapDeps([63,1,2,3,4,5,6,7,20])))),b=l((()=>t((()=>import("./NotFoundScreen-BeJq256C.js")),__vite__mapDeps([13,1,2,3,4,5,6,7,20])))),It=l((()=>t((()=>import("./TaskListScreen-q9ElonDb.js")),__vite__mapDeps([61,1,2,3,4,5,6,7,9,17,20]))));function Nt({setTenantEmailDomain:o}){const T=Bs(),B=Vs(),{tenantEmailDomain:i}=Ss(),L=Zs().mode,{setLoading:U,clearAllLoading:C,clearLoading:H}=zs(),v=y.getSignedInUserTenant(i)?.tenantId,I=y.getSignedInUser(),se=us(I),$=Ns(),[V,Pe]=w.useState(!1),r=z((n=>ds(n))),{useFeatureGate:N}=Gs(),M=$s(),te=Ws(),Fe=!!r.company?.companyZeniAccountInfo?.isZeniAccountEnabled,Le=r.companyTreasuryInfo?.info?.businessVerificationStatus?.code==="verified",{isFeatureEnabled:He}=N(G.isChargeCardFeatureEnabled),{isFeatureEnabled:ne}=N(G.isDebitCardFeatureEnabled),A=z((n=>n.tenantState.fetchState)),j=z((n=>n.tenantState.activeTenantFetchState.fetchState)),h=j==="Completed"||A==="Completed"?cs(ne,r):void 0,J=j==="Completed"||A==="Completed"?ms(r):void 0,ke=Ys(r,He,ne),{isCardsHidden:Be}=qs(r?.tenantId),Ve=!ke||!!Be,{isFeatureEnabled:Se}=N(G.isSettingsFeatureEnabled),{isFeatureEnabled:K}=N(G.isAiCfoFileUploadEnabled),W=z((n=>_s(n)));if(i!=null){const n=y.getSignedInUserTenant(i);I!=null&&n!=null&&fe(I,r,L)}const Z={tenantId:v,userId:I?.userId,sessionId:I?.zeniSessionId},ae=hs(),E=Js(),Ne=r.company==null||E?.loggedInUserRoleMap!=null&&pe(E.loggedInUserRole),Me=Es(E?.loggedInUserRoleMap),oe=w.useRef(!0),re=Te("/:tenantEmailDomain/onboarding/*")!==null,Q=Te("/:tenantEmailDomain/month_end_close_checks/review/:selectedTab/:selectedPeriod/*"),Ze=z((n=>Z.tenantId!=null?ps(n,Z.tenantId):void 0));w.useEffect((()=>{U(F.TENANT_FETCHING),o(i)}),[i]),w.useEffect((()=>{if(Q!=null&&v!=null){const n=Q.params.selectedPeriod;if(n!=null){const f=n.split("-");if(f.length===2){const d=Rs(Number(f[0])),s=Number(f[1]),c=xs(`01-${d<10?`0${d}`:d}-${s}`,Ae.getLocalizedStrings().dateFormat.analytics.DDDashMMDashYYYY),S=gs();c.isAfter(S,"month")===!1?T(Is(v,{month:d,year:s})):B("./month_end_close_checks/review")}}}}),[Q,v]),w.useEffect((()=>{V||(Pe(!0),U(F.TENANT_FETCHING)),oe.current?oe.current=!1:!js(ae,Z)&&y.isSignedIn()&&(U(F.TENANT_FETCHING),(function(n,f,d,s){if(xe(f?.userId,f?.zeniSessionId,n.tenantId),d(Hs(!0)),d(ge(n.tenantId)),n.tenantId!=null&&_.clearTenant(n.tenantId),n.tenantId!=null){const c=y.getSignedInUserTenantWithId(n.tenantId);s&&Ae.updateAppLocaleID(Qs(s)),c?.tenantEmailDomain!=null&&y.saveActiveTenantDomainForUser(c?.tenantEmailDomain)}n.userId!=null?X.identify(n.userId,{tenant_id:n.tenantId}):X.resetUserIdentity()})(Z,I,T,Ze))}),[Z,ae,I,T,y]),w.useEffect((()=>{y.isSignedIn()&&(U(F.TENANT_FETCHING),(function(n,f,d,s,c,S,k){if(d==null&&s==null)return void console.warn("There is no current tenant selected!!");const Y=s!=null&&c?.zeniSessionId!=null,rs=d==null||d.tenantId!==s,is=d!=null&&d.excludedResources==null,ls=d!=null&&d.externalConnections==null;if(Y&&rs){k(ge(s));const q=y.getSignedInUserTenantWithId(s);q?.tenantEmailDomain!=null&&y.saveActiveTenantDomainForUser(q?.tenantEmailDomain),xe(c?.userId,c?.zeniSessionId,s),_.shouldFetchExcludedResources(s)&&(_.markExcludedResourcesFetchStarted(s),k(Ie(c.userId,s))),_.shouldFetchConnections(s)&&(_.markConnectionsFetchStarted(s),k(je(c.userId,s)))}else Y&&is&&_.shouldFetchExcludedResources(s)&&(_.markExcludedResourcesFetchStarted(s),k(Ie(c.userId,s))),Y&&ls&&_.shouldFetchConnections(s)&&(_.markConnectionsFetchStarted(s),k(je(c.userId,s)));if(Y){X.identify(c.userId,{tenant_id:s});const q=s==null||s!=null&&(f==="Completed"||f==="Error");n==="Completed"||f!=="Not-Started"&&f!=="Error"||s==null||!_.shouldFetchActiveTenant(s)||(_.markActiveTenantFetchStarted(s),S(F.TENANT_FETCHING),k(ks(c.userId,s,c.zeniSessionId))),q&&(n==="Not-Started"||n==="Error")&&_.shouldFetchAllTenants()&&(_.markAllTenantsFetchStarted(),k(Re(c.userId,c.zeniSessionId)))}})(A,j,r,v,I,U,T))}),[v,j]),w.useEffect((()=>{y.isSignedIn()&&A==="Completed"&&W.tenantsBaseInOrder.length>0&&(H(F.TENANT_FETCHING),y.saveSignedInUserTenants(Ts(W.tenantsBaseInOrder)),I!=null&&fe(I,r,L,void 0,W.tenantsBaseInOrder))}),[W,A,r,I]),w.useEffect((()=>{j==="In-Progress"&&U(F.TENANT_FETCHING),j!=="Completed"&&j!=="Error"||(j==="Completed"&&v!=null?(C(),_.markActiveTenantFetchCompleted(v)):j==="Error"&&v!=null&&(_.markActiveTenantFetchFailed(v),H(F.TENANT_FETCHING),H(F.TENANT_SWITCHING))),A!=="Completed"&&A!=="Error"||(A==="Completed"?_.markAllTenantsFetchCompleted():A==="Error"&&_.markAllTenantsFetchFailed())}),[j,A,v,V]);const ie=w.useRef(!1);w.useEffect((()=>{!ie.current&&j==="Completed"&&V&&(ie.current=!0,(function(n=et,f=3e3){setTimeout((()=>{const d=s=>{if(s>=n.length)return;const c=n[s],S=Xs[c];S!=null?S().then((()=>ee((()=>d(s+1))))).catch((()=>ee((()=>d(s+1))))):d(s+1)};ee((()=>d(0)))}),f)})())}),[j,V]);const O=r?.userRole!=null&&As(r?.userRole),{isFeatureEnabled:ze}=N(G.isReferralFeatureEnabled),Ge=r?.userRole!=null&&r.userRole.includes("charge_card_user"),$e=r?.userRole!=null&&r.userRole.includes("charge_card_admin"),P=r?.userRole!=null&&pe(r.userRole),le=r?.company==null||r.company.featuresActivationInfo?.isBillPayFeatureEnabled&&!O,ue=!Ve&&!O,We=fs(E?.loggedInUserRoleMap),Ye=r.externalConnections?.accounting[0]?.isValid,qe=r.externalConnections?.fetchState==="Completed",de=r.company?.companyOnboardingInfo.isOnboardingCompleted,ce=r?.company==null||r.company.featuresActivationInfo?.isReimbursementFeatureEnabled&&!O,me=ce&&ys(E?.loggedInUserRoleMap),_e=Fe&&!O,Je=Le&&!O,Ke=le&&Ds(E?.loggedInUserRoleMap),Qe=ue&&bs(E?.loggedInUserRoleMap),Xe=_e&&Cs(E?.loggedInUserRoleMap),es=vs(E?.loggedInUserRoleMap),ss=Us(E?.loggedInUserRoleMap),ts=Os(E?.loggedInUserRoleMap),ns=ws(E?.loggedInUserRoleMap),as=Ps(E?.loggedInUserRoleMap),p=Fs(E?.loggedInUserRoleMap),R=Ls(E?.loggedInUserRoleMap),he=le&&p,Ee=ce&&R,x=_e&&ts,g=Je&&ns,m=ue&&as,os=r.excludedResources?.resources?.find((n=>n.resource==="/invites"))!=null||Me===!0||We===!0||es===!0||ss===!0;return y.isSignedIn()?v==null?A==="Completed"?e.jsx(u,{to:"/",replace:!0,state:{...$.state,message:"...",origin:$.pathname}}):(I!=null&&A!=="In-Progress"&&T(Re(I.userId,I.zeniSessionId)),null):j!=="In-Progress"&&j!=="Not-Started"||A==="Completed"?(de===!0||se&&!re)&&qe&&Ye!==!0&&h===!1&&J===!1?(o(void 0),e.jsx(u,{to:"/connection/auth",replace:!0})):!V||de!==!1||re||se?V&&r?.userRole&&h!=null&&J!=null&&i!=null&&Object.keys(E.loggedInUserRoleMap).length>0?e.jsx(Ms,{children:e.jsxs(a,{element:e.jsx(Ks,{}),children:[e.jsx(a,{path:"/",element:e.jsx(jt,{isDashboardAccess:P,showZeniAccountRoute:x,isUserHasBillPayAccess:p,isUserHasReimbursementAccess:R,showTreasuryRoute:g,isTenantBankingOnly:h,isTenantCardsOnly:J,showChargeCardRoute:m})}),e.jsx(a,{path:"dashboard/*",element:P?e.jsx(lt,{}):e.jsx(D,{showZeniAccountRoute:x,isUserHasBillPayAccess:p,isUserHasReimbursementAccess:R,showTreasuryRoute:g,isTenantBankingOnly:h,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(a,{path:"reports/*",element:P?e.jsx(st,{}):e.jsx(D,{showZeniAccountRoute:x,isUserHasBillPayAccess:p,isUserHasReimbursementAccess:R,showTreasuryRoute:g,isTenantBankingOnly:h,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(a,{path:"people/*",element:os||P?e.jsx(nt,{}):e.jsx(D,{showZeniAccountRoute:x,isUserHasBillPayAccess:p,isUserHasReimbursementAccess:R,showTreasuryRoute:g,isTenantBankingOnly:h,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(a,{path:"forecast/*",element:P?e.jsx(at,{}):e.jsx(D,{showZeniAccountRoute:x,isUserHasBillPayAccess:p,isUserHasReimbursementAccess:R,showTreasuryRoute:g,isTenantBankingOnly:h,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(a,{path:"onboarding/*",element:e.jsx(ot,{})}),e.jsx(a,{path:"transaction/*",element:P&&O===!1||Ge||$e?e.jsx(it,{}):e.jsx(D,{showZeniAccountRoute:x,isUserHasBillPayAccess:p,isUserHasReimbursementAccess:R,showTreasuryRoute:g,isTenantBankingOnly:h,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(a,{path:"transactions/*",element:P&&O===!1?e.jsx(mt,{}):e.jsx(D,{showZeniAccountRoute:x,isUserHasBillPayAccess:p,isUserHasReimbursementAccess:R,showTreasuryRoute:g,isTenantBankingOnly:h,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(a,{path:"customer/*",element:P&&O===!1?e.jsx(ye,{entityType:"customer"}):e.jsx(D,{showZeniAccountRoute:x,isUserHasBillPayAccess:p,isUserHasReimbursementAccess:R,isTenantBankingOnly:h,showTreasuryRoute:g,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(a,{path:"vendor/*",element:P&&O===!1?e.jsx(ye,{entityType:"vendor"}):e.jsx(D,{showZeniAccountRoute:x,isUserHasBillPayAccess:p,isUserHasReimbursementAccess:R,showTreasuryRoute:g,isTenantBankingOnly:h,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(a,{path:"tasks",element:e.jsx(It,{})}),e.jsx(a,{path:"tasks/*",element:e.jsx(xt,{})}),e.jsx(a,{path:"address/*",element:Ke||me||Xe||Qe?e.jsx(tt,{}):e.jsx(D,{showZeniAccountRoute:x,isUserHasBillPayAccess:p,isUserHasReimbursementAccess:R,showTreasuryRoute:g,isTenantBankingOnly:h,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(a,{path:"checking/*",element:x?e.jsx(dt,{}):e.jsx(b,{})}),e.jsx(a,{path:"treasury/*",element:g?e.jsx(ct,{}):e.jsx(b,{})}),e.jsx(a,{path:"performance",element:te===!0?e.jsx(Et,{}):e.jsx(we,{tenantEmailDomain:i})}),e.jsx(a,{path:"month_end_close_checks/review/*",element:te===!0&&O===!1?e.jsx(pt,{}):e.jsx(we,{tenantEmailDomain:i})}),e.jsx(a,{path:"notifications/*",element:e.jsx(ht,{})}),e.jsx(a,{path:"vendors/*",element:Ne?e.jsx(rt,{}):e.jsx(b,{})}),e.jsx(a,{path:"bill/*",element:he?e.jsx(De,{}):e.jsx(D,{showZeniAccountRoute:x,isUserHasBillPayAccess:p,isUserHasReimbursementAccess:R,showTreasuryRoute:g,isTenantBankingOnly:h,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(a,{path:"bills/*",element:he?e.jsx(De,{}):e.jsx(D,{showZeniAccountRoute:x,isUserHasBillPayAccess:p,isUserHasReimbursementAccess:R,showTreasuryRoute:g,isTenantBankingOnly:h,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(a,{path:"reimbursement/*",element:Ee?e.jsx(be,{}):e.jsx(D,{showZeniAccountRoute:x,isUserHasBillPayAccess:p,isUserHasReimbursementAccess:R,showTreasuryRoute:g,isTenantBankingOnly:h,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(a,{path:"reimbursements/*",element:Ee?e.jsx(be,{}):e.jsx(D,{showZeniAccountRoute:x,isUserHasBillPayAccess:p,isUserHasReimbursementAccess:R,showTreasuryRoute:g,isTenantBankingOnly:h,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(a,{path:"settings/*",element:Se?e.jsx(ut,{hasAdminLevelAccess:me}):e.jsx(b,{})}),e.jsx(a,{path:"cards/ask",element:m&&M?e.jsx(Ce,{isFileUploadEnabled:K}):e.jsx(b,{})}),e.jsx(a,{path:"cards/ask/:session_id",element:m&&M?e.jsx(Ce,{isFileUploadEnabled:K}):e.jsx(b,{})}),e.jsx(a,{path:"cards/*",element:m?e.jsx(_t,{}):e.jsx(b,{})}),e.jsx(a,{path:"rewards/*",element:ze?e.jsx(Rt,{}):e.jsx(b,{})}),e.jsx(a,{path:"/ai-cfo",element:M?e.jsx(u,{to:"explore"}):e.jsx(b,{})}),e.jsx(a,{path:"/ai-cfo/",element:M?e.jsx(u,{to:"explore"}):e.jsx(b,{})}),e.jsx(a,{path:"/ai-cfo/:session_id",element:M?e.jsx(gt,{isFileUploadEnabled:K}):e.jsx(b,{})}),e.jsx(a,{path:"*",element:e.jsx(b,{})})]})}):null:(o(void 0),e.jsx(u,{to:"onboarding",replace:!0})):null:(console.warn("User logged out!!"),o(void 0),e.jsx(u,{to:"/signin/auth",replace:!0,state:{...$.state,message:"...",origin:$.pathname}}))}const jt=({isDashboardAccess:o,showZeniAccountRoute:T,isUserHasBillPayAccess:B,isUserHasReimbursementAccess:i,showTreasuryRoute:L,isTenantBankingOnly:U,isTenantCardsOnly:C,showChargeCardRoute:H})=>{if(U===!0){if(T)return e.jsx(u,{to:"checking"});if(L)return e.jsx(u,{to:"treasury"});if(H)return e.jsx(u,{to:"cards"})}return C===!0&&H?e.jsx(u,{to:"cards"}):o?e.jsx(u,{to:"dashboard"}):T?e.jsx(u,{to:"checking"}):L?e.jsx(u,{to:"treasury"}):H?e.jsx(u,{to:"cards"}):B?e.jsx(u,{to:"bills"}):i?e.jsx(u,{to:"reimbursements"}):e.jsx(u,{to:"dashboard"})},D=({showZeniAccountRoute:o,isUserHasBillPayAccess:T,isUserHasReimbursementAccess:B,showTreasuryRoute:i,isTenantBankingOnly:L,showChargeCardRoute:U,tenantEmailDomain:C})=>{if(L===!0){if(o)return e.jsx(Ue,{tenantEmailDomain:C});if(i)return e.jsx(ve,{tenantEmailDomain:C});if(U)return e.jsx(Oe,{tenantEmailDomain:C})}return o?e.jsx(Ue,{tenantEmailDomain:C}):i?e.jsx(ve,{tenantEmailDomain:C}):U?e.jsx(Oe,{tenantEmailDomain:C}):T?e.jsx(At,{tenantEmailDomain:C}):B?e.jsx(Tt,{tenantEmailDomain:C}):e.jsx(b,{})},Tt=({tenantEmailDomain:o})=>e.jsx(u,{to:`/${o}/reimbursements`}),At=({tenantEmailDomain:o})=>e.jsx(u,{to:`/${o}/bills`}),ve=({tenantEmailDomain:o})=>e.jsx(u,{to:`/${o}/treasury`}),Ue=({tenantEmailDomain:o})=>e.jsx(u,{to:`/${o}/checking`}),Oe=({tenantEmailDomain:o})=>e.jsx(u,{to:`/${o}/cards`}),we=({tenantEmailDomain:o})=>e.jsx(u,{to:`/${o}/dashboard`});export{D as FallBackRoute,Nt as default};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{j as o}from"./liveblocks-
|
|
1
|
+
import{j as o}from"./liveblocks-BBLi67DG.js";import{a as u}from"./sentry-DW4kKH26.js";import{h as L,g as $,u as U,j as S,s as le,n as Z,i as G,o as ne,p as v}from"./core-D2KaS3N5.js";import{bn as De,eZ as P,gw as Te,n8 as re,OB as Me,hM as he,Os as Ue,r9 as _e,kG as be,n4 as Be,hO as Re,Ou as Fe,Ot as Oe,QR as Ve,zE as ze,F5 as Le,Qq as Ne,Qz as Qe,c7 as ae,cN as $e,cO as Ze,bs as Ge,Mt as He,y4 as Ke,QS as qe,Hw as Je,EN as We,EE as Se,EB as Xe,y8 as ye,EH as Ce,EK as Ie,EQ as oe,uu as se,y7 as Ye,ki as W,kl as Ae,QT as en,lm as nn,yn as tn,Nk as an,Nl as on,kg as sn,QU as cn,kj as ln,rD as rn,Nf as dn,Ng as un,rH as pn,hx as gn,MB as ee,hp as de,hm as mn,hu as fn,MC as hn,yk as bn,QV as Sn,QW as yn,F2 as Cn,fE as Ee,fG as xe,QX as In,gh as An,ML as En,yj as ue,gm as pe,gl as xn,yi as vn,gk as kn,gj as wn,QY as jn,fJ as ve,QZ as Pn,Q_ as Dn,yq as Tn,yh as ge,Q$ as Mn,fZ as Un,ye as _n,b_ as Bn,c6 as Rn,c5 as Fn,b$ as On,c3 as Vn,c2 as zn,c1 as Ln,c4 as Nn,c0 as Qn}from"./zeni-epic-state-BJ_gdj7r.js";import{A as X,d as O,z as w,ag as ke,bR as $n,f as H,h as Zn,bC as Gn,e as K,B as ie,bS as Hn,i as we,S as je,bT as Kn,ar as qn,k as Pe,bU as Jn,bV as Wn,bW as Xn,_ as Yn,bX as et,r as nt,bY as tt}from"./index-CivdpZRT.js";import{n as V}from"./mui-C1ThRyKO.js";import{M as R}from"./MobileAppDrawer-O95nPlSQ.js";import{a as q,g as J,m as at}from"./accountMappingHelper-BmtW64tm.js";import{t as ot,A as st}from"./AddressScreen-CGTYstNo.js";import Q from"./NotFoundScreen-BeJq256C.js";import{g as it}from"./analyticsHelper-DqO64pHt.js";import{B as ct}from"./BusinessVerificationPageScreen-BohezKn6.js";import{C as lt}from"./CompanyPassportScreen-CxVFTUSz.js";import{u as rt,a as dt}from"./useEmailConnectResultRefresh-Ddee2XH0.js";import{q as me}from"./QBOConnectionScreen-vAHPaqo7.js";import{B as ut}from"./BillPayApprovalRoutes-guz2sdH1.js";import{R as pt}from"./ReimbursementApprovalRoutes-DhrGnU7Q.js";import"./recharts-jHFM5Sob.js";import"./analytics-C2MbRoEp.js";import"./plaid-Do7hhR27.js";import"./dnd-D-AkKI2c.js";import"./stripe-cKAAJElX.js";import"./lottie-Dz6JZ58r.js";import"./lexical-BQ-Po3YF.js";import"./pdf-2k8d7AeQ.js";import"./utils-DIwqH7uj.js";import"./routePaths-TRamKMNj.js";import"./empty-D1hMU_8M.js";import"./pdf-lib-DqPqgk_2.js";import"./index-CHRJI22G.js";import"./url-8bOSIiqX.js";import"./index-Dyy6NuL-.js";import"./decodeURIComponentSafe-CD_zntJd.js";import"./ReimbursementApprovalRuleDetailScreen-BdQmAA7j.js";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},a=new e.Error().stack;a&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[a]="64c085e2-e27f-4bed-9edc-dfb1e7174f73",e._sentryDebugIdIdentifier="sentry-dbid-64c085e2-e27f-4bed-9edc-dfb1e7174f73")}catch{}})();const gt=V.div`
|
|
2
2
|
display: flex;
|
|
3
3
|
height: 100%;
|
|
4
4
|
width: 100%;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{j as u}from"./liveblocks-
|
|
1
|
+
import{j as u}from"./liveblocks-BBLi67DG.js";import{h as Y,g as ee,u as ne,i as $,j as P,N as x,n as H,t as en}from"./core-D2KaS3N5.js";import{bJ as nn,cq as Ce,Qe as ye,eZ as B,cC as tn,zU as Q,zE as an,Qq as sn,Qt as on,rW as te,rK as ae,le as ie,u0 as z,Qv as Ie,gl as Ge,gk as $e,gj as He,Qw as cn,A1 as rn,EN as Ae,EE as ke,EB as _e,Ej as J,EH as Ee,EK as ve,EQ as Pe,uu as Te,gD as un,cx as dn,fG as ln,fE as pn,fF as mn,bt as yn,Qx as fn,Dj as le,DX as gn,Qy as bn,bK as Sn,G4 as pe,F5 as hn,Qz as Cn,QA as In,G8 as An,Gc as kn,tV as _n,KC as En,GJ as he,HJ as me,QB as vn,QC as Pn,QD as Tn,QE as We,QF as wn,N3 as Dn,PG as Un,Ni as On,QG as Ke,En as Fn,Nj as Bn,Er as Vn,QH as Oe,H3 as qe,lm as xn,rN as Je,u2 as jn,bE as Ne,ue as Re,cA as Nn,QI as Xe,fY as Rn,Gr as zn,Gv as Ln,QJ as Mn,GM as ze,QK as Zn,QL as Qn,QM as Gn,QN as $n,gw as Hn,Bc as Wn,QO as Kn,Bh as qn,Bg as Jn}from"./zeni-epic-state-BJ_gdj7r.js";import{e as se,A as oe,d as q,y as we,aS as X,bC as Ye,z as U,C as ce,f as O,B as De,h as G,bD as Xn,au as re,bE as V,bF as Yn,bG as et,ag as xe,bH as nt,r as Le,av as Me,K as tt,F as at,bI as it,bJ as st,bK as ot,a9 as ct}from"./index-CivdpZRT.js";import{a as h}from"./sentry-DW4kKH26.js";import{n as Fe,D as rt,S as ut}from"./mui-C1ThRyKO.js";import{M as fe}from"./MobileAppDrawer-O95nPlSQ.js";import R from"./NotFoundScreen-BeJq256C.js";import{a as Ze}from"./analyticsHelper-DqO64pHt.js";import{d as Qe}from"./routePaths-TRamKMNj.js";import{B as Ue}from"./BusinessVerificationPageScreen-BohezKn6.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]="9b73bb41-6d71-429a-b510-fea9f28f4dc9",e._sentryDebugIdIdentifier="sentry-dbid-9b73bb41-6d71-429a-b510-fea9f28f4dc9")}catch{}})();const dt=Fe.div`
|
|
2
2
|
display: flex;
|
|
3
3
|
height: 100%;
|
|
4
4
|
width: 100%;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{j as f}from"./liveblocks-
|
|
1
|
+
import{j as f}from"./liveblocks-BBLi67DG.js";import{a as u,b as M,q as T}from"./sentry-DW4kKH26.js";import{u as A,h as z,j as c,g as D,N as O,n as j}from"./core-D2KaS3N5.js";import{u as P,z as s,y as F,f as E,O as _,g as B,h as N,H as Z,j as V,w as $,k as v}from"./index-CivdpZRT.js";import{eZ as q,Mf as H,Mg as J,fC as W,g2 as G,Ml as K,gv as Q,cZ as R,Mm as C,Mn as X,Mo as Y,bZ as y}from"./zeni-epic-state-BJ_gdj7r.js";import"./mui-C1ThRyKO.js";import{u as ee}from"./useDeviceId-CHTVQQ8G.js";import{f as te}from"./analyticsHelper-DqO64pHt.js";import{t as ne}from"./getLocaleForTenant--JGxRDjE.js";import"./recharts-jHFM5Sob.js";import"./analytics-C2MbRoEp.js";import"./plaid-Do7hhR27.js";import"./dnd-D-AkKI2c.js";import"./stripe-cKAAJElX.js";import"./lottie-Dz6JZ58r.js";import"./lexical-BQ-Po3YF.js";import"./pdf-2k8d7AeQ.js";import"./utils-DIwqH7uj.js";(function(){try{var t=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},i=new t.Error().stack;i&&(t._sentryDebugIds=t._sentryDebugIds||{},t._sentryDebugIds[i]="7f76d847-cd87-4fad-93d5-e12c6cf561fe",t._sentryDebugIdIdentifier="sentry-dbid-7f76d847-cd87-4fad-93d5-e12c6cf561fe")}catch{}})();const ie=j((function(t,i){const d=t.tenantState.fetchState,g=t.tenantState.sendEmailMagicLinkFetchState,{magicLinkExpired:n,magicLinkAlreadyUsed:a,magicLinkExpiredEmail:l}=i;return{googleClientId:v.googleClientId,microsoftClientId:v.microsoftClientId,signInError:t.tenantState.error?.error,fetchState:d,sendMagicLinkStatus:g,magicLinkExpired:n,magicLinkAlreadyUsed:a,magicLinkExpiredEmail:l}}),(function(t,i){const{location:d,navigate:g}=i;return console.warn(JSON.stringify(window.location)),{onOAuthError:(n,a)=>{T({message:`OAuth error from provider ${a} with error ${n}`,level:"error",tags:{authProvider:a,errorType:"zeni.login.error"},extra:{error:n,windowLocation:window.location.href}})},onOAuthSuccess:(n,a)=>{const l=a==="google"?window.location.origin:window.location.origin+window.location.pathname;t(Y({authCode:n,oauthProvider:a,appType:"web",redirectUri:y(l),sourceUri:y(d.state!=null?d.state.origin:"")}))},getSignedInUser:()=>s.getSignedInUser(),onSignedInCallback:()=>{const n=d.state?.origin;n&&n!=="/"?g(n,{replace:!0}):window.open(window.location.origin,"_self")},sendMagicLink:n=>{const{deviceId:a}=i;a!=null&&(s.saveMagicLinkEmail(n),t(X(n,a)))},clearSignInError:()=>{t(C())}}}))($),ae=M.memo(ie);function ve({setTenantEmailDomain:t}){const i=A(),d=z(),{clearAllLoading:g}=P(),n=s.getSignedInUser();u.useLayoutEffect((()=>{g()}),[g]);const a=ee(),l=c((e=>e.tenantState.magicLinkCodeVerifier)),{sendEmailMagicLinkFetchState:h,accountLocked:U,accountUnlockTime:k}=c((e=>e.tenantState)),p=c((e=>e.tenantState.fetchState)),L=c((e=>e.tenantState.activeTenantFetchState.fetchState)),S=c((e=>e.tenantState.signInState)),o=c((e=>e.tenantState.loggedInUser)),r=c((e=>q(e))),I=c((e=>H(e))),m=D(),w=F().mode,b=m.state?.magicLinkExpired,x=m.state?.magicLinkAlreadyUsed;if(u.useEffect((()=>{h.fetchState==="Completed"&&l!=null&&(E.trackSignInLinkSent(),s.saveMagicLinkCodeVerifier(l))}),[h.fetchState,l]),u.useEffect((()=>{t(void 0)}),[]),u.useEffect((()=>{S!=="In-Progress"||p!=="Completed"&&L!=="Completed"||o?.zeniSessionId==null||r==null||(s.savePayNowInfoTooltip(!0,o.zeniSessionId),s.saveSignedInUserWithSession(o,o.zeniSessionId),s.saveSignedInUserTenants(J(I.tenantsInOrder),o.zeniSessionId),W(o.userId,o.zeniSessionId,r.tenantId),i(G(r.tenantId)),s.saveActiveTenantDomainForUser(r.tenantEmailDomain),i(K("Completed")),_.updateAppLocaleID(ne(r)),te(o,r,w,void 0,I.tenantsInOrder),Q().then((()=>{const e=V();e!=null&&B(e)})),setTimeout((()=>{E.trackLogin(N.Event.loginSuccess,o.authProvider??"google",R(r.productSettings))}),2e3))}),[S,p,L,o,r,I,w,m.state,i]),S==="In-Progress"&&p==="Completed"&&o?.zeniSessionId!=null&&r!=null||n!=null){const e=m.state?.origin??"/";return f.jsx(O,{to:e,state:{...m.state,origin:""}})}return f.jsxs(f.Fragment,{children:[f.jsx(ae,{magicLinkExpired:!!b,magicLinkAlreadyUsed:!!x,magicLinkExpiredEmail:s.getMagicLinkEmail()??void 0,location:m,navigate:d,deviceId:a??void 0,showEmailLogin:!0}),U===!0&&k!=null?f.jsx(Z,{onClose:()=>i(C()),unlockDate:k}):null]})}export{ve as default};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{j as s}from"./liveblocks-
|
|
1
|
+
import{j as s}from"./liveblocks-BBLi67DG.js";import{a as i}from"./sentry-DW4kKH26.js";import{u as l,g as c,N as u}from"./core-D2KaS3N5.js";import{z as d,f as a,h as m,B as p}from"./index-CivdpZRT.js";import{gA as g,MD as y}from"./zeni-epic-state-BJ_gdj7r.js";import{n as b}from"./mui-C1ThRyKO.js";import"./recharts-jHFM5Sob.js";import"./analytics-C2MbRoEp.js";import"./plaid-Do7hhR27.js";import"./dnd-D-AkKI2c.js";import"./stripe-cKAAJElX.js";import"./lottie-Dz6JZ58r.js";import"./lexical-BQ-Po3YF.js";import"./pdf-2k8d7AeQ.js";import"./utils-DIwqH7uj.js";(function(){try{var t=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},e=new t.Error().stack;e&&(t._sentryDebugIds=t._sentryDebugIds||{},t._sentryDebugIds[e]="ddb64d63-a7d9-46d5-a06a-fd562ddb4daf",t._sentryDebugIdIdentifier="sentry-dbid-ddb64d63-a7d9-46d5-a06a-fd562ddb4daf")}catch{}})();function M(){const t=l(),e=c(),r=i.useRef(!1),n=d.isSignedIn(),o=e.state?.message==="logout"||n;return i.useEffect((()=>{if(o&&!r.current){r.current=!0;try{t(g()),y(),a.trackLogout(m.Event.logoutSuccess),a.resetUserIdentity(),d.clearAll()}catch(f){console.error("Error during sign out:",f)}finally{window.location.replace("/signin/auth")}}}),[o,t]),o?s.jsx(h,{children:s.jsx(p,{fetchState:"In-Progress"})}):s.jsx(u,{to:"../",replace:!0})}const h=b.div`
|
|
2
2
|
display: flex;
|
|
3
3
|
height: 100vh;
|
|
4
4
|
width: 100%;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{j as u}from"./liveblocks-
|
|
1
|
+
import{j as u}from"./liveblocks-BBLi67DG.js";import{a as b}from"./sentry-DW4kKH26.js";import{h as N,u as v,g as K,j as G,i as _,n as z}from"./core-D2KaS3N5.js";import{z as U,A as M,d as p,a0 as Z,C as O,f as V,h as W,dd as q,r as f,p as Q}from"./index-CivdpZRT.js";import{eZ as H,U5 as F,Jo as y,U6 as R,U1 as X,IM as E,U7 as Y,IU as I,Ie as aa,Jp as S,U8 as B,fB as ea,Jf as ta,Jk as sa,J7 as oa,J5 as w,Jl as na,J2 as ia,U9 as la,Ua as ra,Ub as ca,Uc as ka,Ud as m,ek as da,Ue as ua,Uf as pa}from"./zeni-epic-state-BJ_gdj7r.js";import{n as ma}from"./mui-C1ThRyKO.js";import{u as Ta}from"./useAskAiCfoHostNavButtonProps-CNoSipqI.js";import{M as fa}from"./MobileAppDrawer-O95nPlSQ.js";import"./recharts-jHFM5Sob.js";import"./analytics-C2MbRoEp.js";import"./plaid-Do7hhR27.js";import"./dnd-D-AkKI2c.js";import"./stripe-cKAAJElX.js";import"./lottie-Dz6JZ58r.js";import"./lexical-BQ-Po3YF.js";import"./pdf-2k8d7AeQ.js";import"./utils-DIwqH7uj.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]="b7d7910c-5ff9-4d1f-932c-8b762d9363fc",e._sentryDebugIdIdentifier="sentry-dbid-b7d7910c-5ff9-4d1f-932c-8b762d9363fc")}catch{}})();const ga=ma.div`
|
|
2
2
|
display: flex;
|
|
3
3
|
min-height: 100%;
|
|
4
4
|
width: 100%;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{j as n}from"./liveblocks-
|
|
1
|
+
import{j as n}from"./liveblocks-BBLi67DG.js";import se from"./NotFoundScreen-BeJq256C.js";import{a as c}from"./sentry-DW4kKH26.js";import{h as M,u as O,j as g,g as ne,i as oe,N as ie,n as re,o as ce,p as f}from"./core-D2KaS3N5.js";import{Ir as Z,Iu as le,Io as de,eZ as J,U1 as K,II as H,Il as pe,Jc as ue,J5 as ke,U2 as Q,U3 as z,Ih as me,Ie as fe,rW as ge,rK as he,le as Ie,IC as Se,U4 as Te,IT as be,IQ as Ce,Ix as Ee,IN as Ge,IM as De}from"./zeni-epic-state-BJ_gdj7r.js";import{z as G,db as xe,v as ye,A as je,d as b,p as W,r as w,C as ve,f as V,h as we,dc as Re,k as A,au as Ue}from"./index-CivdpZRT.js";import{n as Fe}from"./mui-C1ThRyKO.js";import{u as Be}from"./useInitialThreadRequest-UA6eH2dj.js";import{M as Pe}from"./MobileAppDrawer-O95nPlSQ.js";import Le from"./TaskListScreen-q9ElonDb.js";import"./recharts-jHFM5Sob.js";import"./analytics-C2MbRoEp.js";import"./plaid-Do7hhR27.js";import"./dnd-D-AkKI2c.js";import"./stripe-cKAAJElX.js";import"./lottie-Dz6JZ58r.js";import"./lexical-BQ-Po3YF.js";import"./pdf-2k8d7AeQ.js";import"./utils-DIwqH7uj.js";import"./useAskAiCfoHostNavButtonProps-CNoSipqI.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]="f696f827-eee7-4e23-9b59-cccf287359e3",e._sentryDebugIdIdentifier="sentry-dbid-f696f827-eee7-4e23-9b59-cccf287359e3")}catch{}})();function Ne(){const e=M(),t=O(),s=G.getSignedInUser(),{cannedResponses:u,fetchState:r,saveFetchState:d}=g((o=>o.cannedResponsesState)),l=c.useCallback((()=>{t(Z())}),[t]),k=c.useCallback(((o,h,I)=>{t(le({name:o,content:h,cannedResponseId:I}))}),[t]),a=c.useCallback((o=>{t(de({cannedResponseId:o}))}),[t]);if(s==null)throw Error("Can't access quick responses page without signing in...");return n.jsx(xe,{cannedResponses:u,isLoading:r==="In-Progress"||r==="Not-Started",isSaving:d==="In-Progress",onBackClick:()=>e(-1),onDelete:a,onFetch:l,onSave:k})}let _,q=[];const $e=re((function(e,t){const{location:s,taskGroupId:u}=t,r=Q(e,t.taskId),d=J(e),l=r.taskGroupId??u,k=l!=null?z(e.taskGroupState,l):void 0,a=G.getSignedInUser(),o=d.tenantId,h={userId:a?.userId??"",sessionId:a?.zeniSessionId??"",tenantId:o??""},I=K(e),{tenantEmailDomain:D}=d,C=r.recurringSourceTaskId,x=C!=null?`${A.appUrl}/${D}/tasks/${encodeURIComponent(C)}`:void 0;var S;return{taskDetailSelectorView:r,authParams:h,isZeniUser:G.isZeniUser(),userGroupList:((S=e.userGroupsState.userGroupByUserGroupId)!==_&&(_=S,q=Object.values(S)),q),isNewClicked:s.state?.message==="comingFromTaskListPage",filesEndPoint:Ue.fileMicroServiceBaseUrl,companyName:t.currentTenant.companyName,companyId:t.currentTenant.companyId,currentUrl:`${A.appUrl}${t.location.pathname}`,cannedResponses:e.cannedResponsesState.cannedResponses,isCannedResponsesLoading:e.cannedResponsesState.fetchState==="In-Progress",recurringSourceTaskUrl:x,tagListView:I,taskGroupName:l!=null&&k!=null&&k.isDefault===!1?k.name:void 0,taskGroupList:e.taskGroupViewState.taskGroupsIds.map((p=>z(e.taskGroupState,p))).filter((p=>p!=null&&!p.isDeleted)).map((p=>({id:p.id,name:p.name,isDefault:p.isDefault})))}}),(function(e,t){const{taskId:s,navigate:u,currentTenant:r,location:d,taskGroupId:l}=t,{tenantEmailDomain:k}=r;return{onSaveChangesToLocalStore:a=>{e(De({taskDetailLocalData:a,taskId:s}))},onSaveDetailClick:a=>{e(Ge(s,a??l))},onArchiveTaskClick:()=>{t.taskId!=null&&e(Ee(t.taskId))},onSnoozeTask:(a,o)=>{e(Ce(a,o))},onUnsnoozeTask:a=>{e(be(a))},onDismissClick:()=>{if(d.state?.message==="triggerBackClick"){const a=W(d.state?.pathnameStackToGoBack),o=a.poppedPathname??"../../dashboard";u(o,{state:{pathnameStackToGoBack:a.newStack}})}else{const a=R(k),o=w(d.state?.pathnameStackToGoBack,d.pathname);u(a,{state:{pathnameStackToGoBack:o}})}e(Te({taskId:s}))},onDeleteTaskClick:()=>{e(Se(s))},updateFilesEntity:a=>{e(Ie({files:a}))},onDeleteFile:a=>{e(he(a))},onEditFileName:(a,o)=>{e(ge(a,o.split(".")[0]))},onReloadTaskDetailPage:()=>{e(H(!1,s))},onCreateTagClick:a=>{e(fe(a,s))},onDeleteTagClick:a=>{e(me(a,s))},onFetchCannedResponses:()=>{e(Z())},onManageTemplatesClick:()=>{u(`/${r.tenantEmailDomain}/tasks/quick-responses`)}}}))(Re);function v(){const e=M(),t=O(),s=ne(),u=ye(),{taskId:r,taskGroupId:d}=oe(),l=g((i=>J(i))),k=Be(l?.companyId),{useFeatureGate:a}=je(),{isFeatureEnabled:o}=a(b.isTaskSnoozeEnabled),{isFeatureEnabled:h}=a(b.isTaskVisibilityEnabled),{isFeatureEnabled:I}=a(b.isTaskCannedResponsesEnabled),{isFeatureEnabled:D}=a(b.isTaskRecurringParentEnabled),{isFeatureEnabled:C}=a(b.isTaskGroupAssigneesEnabled),[x,S]=c.useState(!1),[p,X]=c.useState(!1),[U,Y]=c.useState(!1),[F,ee]=c.useState(!1),[B,y]=c.useState(!1),T=c.useRef(!1),E=g((i=>i.taskListState.updateTasksFetchState.fetchState)),P=g((i=>K(i))),L=g((i=>i.taskGroupViewState.fetchState));c.useEffect((()=>{p||(X(!0),t(H(!1,r)))}),[p,t]),c.useEffect((()=>{U||P.fetchState==="Completed"||(Y(!0),t(pe()))}),[U,t,P.fetchState]),c.useEffect((()=>{F||L==="Completed"||(ee(!0),t(ue()))}),[F,t,L]);const ae=c.useCallback((()=>{r!=null&&(T.current=!1,t(ke([r],null,{isArchived:!1})),y(!0))}),[t,r]);c.useEffect((()=>{if(B)if(E!=="In-Progress"){if(T.current){if(E==="Error")return y(!1),void(T.current=!1);if(E==="Completed"){y(!1),T.current=!1;const{tenantEmailDomain:i}=l;if(s.state?.message==="triggerBackClick"){const m=W(s.state?.pathnameStackToGoBack);e(m.poppedPathname??"../../dashboard",{state:{pathnameStackToGoBack:m.newStack}})}else{const m=R(i);e(m,{state:{pathnameStackToGoBack:w(s.state?.pathnameStackToGoBack,s.pathname)}})}}}}else T.current=!0}),[B,E,l,s,e]);const N=g((i=>Q(i,r))),j=N.fetchState,$=G.getSignedInUser();if($==null)throw Error("Can't access task detail page without signing in...");if(j==="Error"&&N.error?.code===400){const{tenantEmailDomain:i}=l,m=R(i),te=w(s.state?.pathnameStackToGoBack,s.pathname);return n.jsx(ie,{to:m,state:{pathnameStackToGoBack:te}})}return n.jsxs(n.Fragment,{children:[j==="Completed"?n.jsx(ve,{analytics:V,onLoad:i=>(m=>m.trackPageLoaded(we.Event.taskDetailPage))(i)}):null,n.jsxs(ze,{children:[n.jsx(Pe,{isAppContentDrawerOpen:x,handleDrawerToggle:i=>{S(i)}}),n.jsx($e,{analytics:V,currentTenant:l,handleZeniLogoClick:()=>{u.toggle()},initialOpenThreadRequest:k,location:s,loggedInUser:$,navigate:e,taskGroupId:d,taskId:r,taskDetailFetchState:j,onUnarchiveTaskClick:ae,isTaskSnoozeEnabled:o,isTaskVisibilityEnabled:h,isTaskCannedResponsesEnabled:I,isTaskRecurringParentEnabled:D,isTaskGroupAssigneesEnabled:C})]})]})}const ze=Fe.div`
|
|
2
2
|
display: flex;
|
|
3
3
|
min-height: 100%;
|
|
4
4
|
width: 100%;
|
package/dist/assets/{TransactionDetailRoutes-CmH9g66g.js → TransactionDetailRoutes-D9ZuqZEq.js}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{j as t}from"./liveblocks-
|
|
1
|
+
import{j as t}from"./liveblocks-BBLi67DG.js";import i from"./NotFoundScreen-BeJq256C.js";import{T as r}from"./TransactionDetailScreen-B77dqrVQ.js";import"./sentry-DW4kKH26.js";import{o as s,p as o}from"./core-D2KaS3N5.js";import"./zeni-epic-state-BJ_gdj7r.js";import"./recharts-jHFM5Sob.js";import"./index-CivdpZRT.js";import"./mui-C1ThRyKO.js";import"./analytics-C2MbRoEp.js";import"./plaid-Do7hhR27.js";import"./dnd-D-AkKI2c.js";import"./stripe-cKAAJElX.js";import"./lottie-Dz6JZ58r.js";import"./lexical-BQ-Po3YF.js";import"./pdf-2k8d7AeQ.js";import"./utils-DIwqH7uj.js";import"./useAskAiCfoHostNavButtonProps-CNoSipqI.js";import"./decodeURIComponentSafe-CD_zntJd.js";import"./routePaths-TRamKMNj.js";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},n=new e.Error().stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="a4852925-22e4-4d6c-b9c0-7fe8ce24ec96",e._sentryDebugIdIdentifier="sentry-dbid-a4852925-22e4-4d6c-b9c0-7fe8ce24ec96")}catch{}})();function k(){return t.jsxs(s,{children:[t.jsx(o,{path:"/:transactionTypeEncoded/:transactionId",element:t.jsx(r,{})}),t.jsx(o,{path:"/:transactionTypeEncoded/:transactionId/page-not-found",element:t.jsx(i,{})}),t.jsx(o,{path:"/:transactionTypeEncoded/:transactionId/vendor/create",element:t.jsx(r,{})}),t.jsx(o,{path:"/*",element:t.jsx(r,{})})]})}export{k as default};
|
package/dist/assets/{TransactionDetailScreen-BAzuDRZQ.js → TransactionDetailScreen-B77dqrVQ.js}
RENAMED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{j as w}from"./liveblocks-
|
|
1
|
+
import{j as w}from"./liveblocks-BBLi67DG.js";import{a as i}from"./sentry-DW4kKH26.js";import{u as W,k as Ye,j as S,s as fe,g as ge,h as Te,i as be,N as Qe,n as Ze}from"./core-D2KaS3N5.js";import{nX as he,eZ as Q,gw as Xe,OB as et,n8 as tt,mS as at,bn as nt,cW as Ee,bs as ve,ru as K,NA as q,OC as Ie,OD as oe,N_ as De,kR as Ce,OE as ke,O3 as se,O4 as ce,lG as Ae,Kv as ie,Nu as M,kL as Oe,kJ as Ue,kV as ot,nK as st,OF as ct,OG as it,vK as Y,kQ as we,JQ as _e,cj as rt,c_ as lt,OH as dt,Nt as ut,OI as mt,vG as pt,OJ as ft,OK as ht,OL as yt,OM as St,ON as gt,kU as Tt,OO as bt,OP as Et,Nv as vt,OQ as It,OR as Dt,OS as Ct,JK as kt,JA as At,JZ as Ot,kW as Ut,Kw as ye,nP as wt}from"./zeni-epic-state-BJ_gdj7r.js";import{A as H,d as _,z as xe,aS as Pe,y as _t,K as xt,aT as Pt,F as Ft,p as ae,e as Vt,aU as Bt,r as ne,a0 as Nt,aV as Rt,f as Fe,aW as Lt,au as zt,a4 as te}from"./index-CivdpZRT.js";import{n as Gt,S as jt,D as $t}from"./mui-C1ThRyKO.js";import{u as Mt}from"./useAskAiCfoHostNavButtonProps-CNoSipqI.js";import{d as Ve}from"./decodeURIComponentSafe-CD_zntJd.js";import{h as Be,c as Ne,g as Wt,e as Kt}from"./routePaths-TRamKMNj.js";import{u as qt}from"./utils-DIwqH7uj.js";(function(){try{var t=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},e=new t.Error().stack;e&&(t._sentryDebugIds=t._sentryDebugIds||{},t._sentryDebugIds[e]="a6079558-eb3a-4cb8-b34e-e187acdc6189",t._sentryDebugIdIdentifier="sentry-dbid-a6079558-eb3a-4cb8-b34e-e187acdc6189")}catch{}})();function Ht(t=!0){const e=W(),s=Ye(),{useFeatureGate:a}=H(),{isFeatureEnabled:n}=a(_.isCreateTransferEntryFromExpenseEnabled);i.useEffect((()=>{if(!t||n!==!0)return;const o=c=>{const r=s.getState().createTransferEntryState.transferAccountsByType[c].fetchState;return r!=="In-Progress"&&r!=="Completed"};o("transferEntryEligible")&&e(he({kind:"transferEntryEligible"})),o("creditCardOnlyEligible")&&e(he({kind:"creditCardOnlyEligible"}))}),[t,n,e,s])}function Jt(t,e){const s=(function(){const r=W(),[p,g]=i.useState(!1),[A,y]=i.useState(null),[m,O]=i.useState(null),{useDynamicConfig:T}=H(),{configValue:f,isDynamicConfigLoading:C}=T("transaction_categorization_config"),I=!C&&f?.capitalization_enabled===!0,k=S((h=>Q(h))),b=k.companyId,U=S((h=>Xe(h.companyState,k.companyId)?.company.companyLocaleInfo?.currencySymbol??"$")),{capitalizableAccounts:x,capitalizableAccountOverrides:B,dismissedAccounts:z}=S((h=>{const E=h.tenantState.currentTenantId,u=E!=null?h.tenantState.tenantsById[E]:void 0;return{capitalizableAccounts:u?.capitalizableAccounts??null,capitalizableAccountOverrides:u?.capitalizableAccountOverrides??null,dismissedAccounts:u?.capitalizationOnboardingDismissedAccounts??null}}),fe),G=i.useRef(x);G.current=x;const N=i.useRef(B);N.current=B;const P=i.useRef(z);P.current=z;const R=S((h=>et(h.accountState)),fe),v=i.useMemo((()=>{const h={};for(const E of R)E.accountId!=null&&E.accountName!=null&&(h[E.accountId]=E.accountName);return h}),[R]),l=m!=null?v[m]??null:null,j=i.useCallback((h=>{if(!I)return;const E=G.current;if(E==null)return;const u=E.accounts??[],$=new Set(h),Z=N.current??{},J=P.current;for(const L of u)if($.has(L.accountId)&&Z[L.accountId]==null&&J?.[L.accountId]==null)return y(L.classificationType),O(L.accountId),void g(!0)}),[I]),D=i.useCallback(((h,E)=>{r(tt(b,h,E,!0)),g(!1),y(null),O(null)}),[r,b]),F=i.useCallback((()=>{m!=null&&(r(at(b,m)),g(!1),y(null),O(null))}),[r,b,m]);return{showPopup:p&&I,popupType:A,popupAccountId:m,popupAccountName:l,currencySymbol:U,checkAndShowPopup:j,handleSubmit:D,handleDismiss:F}})(),a=i.useRef(void 0),n=i.useRef([]),o=i.useRef(s.checkAndShowPopup);o.current=s.checkAndShowPopup;const c=i.useRef(e);return c.current=e,i.useEffect((()=>{t==="In-Progress"&&(n.current=c.current()),t==="Completed"&&a.current==="In-Progress"&&n.current.length>0&&(o.current(n.current),n.current=[]),a.current=t}),[t]),s}const re=()=>{const t=xe.getSignedInUser(),{useFeatureGate:e}=H(),{isFeatureEnabled:s}=e(_.isChainOfThoughtEnabled);return i.useMemo((()=>nt(t)&&s),[t,s])};function Re(t){if(t!=null){if("customer"in t&&t.customer!=null){const{customer:e}=t;return{id:e.id,name:e.name,logo:e.logo,type:"customer",zeniId:e.id,qboId:e.id}}if("vendor"in t&&t.vendor!=null){const{vendor:e}=t;return{id:e.id,name:e.name,logo:e.logo,type:"vendor",zeniId:e.id,qboId:e.id}}}}function ha(t,e){const s=W(),{useFeatureGate:a,useDynamicConfig:n}=H(),o=S((u=>Q(u))),c=o.userRole.includes("charge_card_user")||o.userRole.includes("charge_card_admin"),r=o.userRole!=null&&Ee(o.userRole),p=o.userRole!=null&&ve(o.userRole),{isFeatureEnabled:g}=a(_.isVendorBulkUpdateOnTransactionEnabled),{isFeatureEnabled:A}=a(_.isExpenseAutomationEnabled),{configValue:y}=n(Pe.enableUncategorizedExpenseCategory),m=y?.uncategorized_expense_category_enabled===!0,O=re(),T=i.useMemo((()=>({id:t,type:K(e)})),[t,e]),f=S((u=>q(u,T))),C=f?.transactionDetailUpdateStatus?.fetchState,I=f?.transactionDetailLocalData?.lineItemById,k=S((u=>{const $=q(u,T)?.transactionDetailLocalData.vendorUpdates?.id;return $==null?"Not-Started":u.transactionVendorViewState.editVendorStateById[$]?.saveStatus.fetchState??"Not-Started"})),b=i.useMemo((()=>f?.fetchState==="Completed"?Re(f?.transaction):void 0),[f?.fetchState,f?.transaction]),U=S((u=>{if(b!=null)return Ie(u.customerIncomeState,u.vendorExpenseState,u.trendState,b,"month")})),x=S((u=>oe(u))),B=S((u=>{if(b!=null)return De(u.trendWithTransactionsState,b,"TransactionDetail")})),z=o.company?.companyInfo.firstMonthOfFY??1,G=S((u=>Ce(u.accountState,u.accountListState,"accountList"))),[N,P]=i.useState(!1),[R,v]=i.useState(!1),[l,j]=i.useState(!1);i.useEffect((()=>{P(!1),v(!1),j(!1)}),[t,e]);const D=i.useCallback((()=>{P(!1),v(!1)}),[]),[F,h]=i.useState(!1),E=B?.selectedPeriod?.timePeriod;return i.useEffect((()=>{l||f==null||f.transaction==null||(s(ke({id:f.transaction.id,type:f.transaction.type})),j(!0)),b!=null&&(!c||r&&p===!1)&&(N?R||U==null||(v(!0),s(ie(b,"TransactionDetail",{timeframe:"month",timePeriod:E??U}))):(s(se()),s(ce()),P(!0),s(Ae(b))))}),[s,l,f?.fetchState,f?.transaction,b,c,r,p,N,R,U,E]),i.useEffect((()=>{x.newVendorState?.vendorDetailLocalData?.vendorName!=null?h(!0):h(!1)}),[x.newVendorState?.vendorDetailLocalData?.vendorName]),i.useEffect((()=>()=>{s(M("common"))}),[s]),{currentTenant:o,loggedInUserHasCardUserOrAdminRole:c,isUserHasDashboardAccess:r,isUserHasInvestorOrBankerAccess:p,isVendorBulkUpdateOnTransactionEnabled:g,isExpenseAutomationEnabled:A,isUncategorizedExpenseCategoryEnabled:m,isChainOfThoughtEnabled:O,selectedTransaction:T,transactionDetail:f,rawDetailSaveStatus:C,rawDetailLineItemById:I,vendorSaveStatus:k,tranEntity:b,defaultTrendTransactionTimePeriod:U,vendorViewDetails:x,uiState:B,firstMonthOfFY:z,uncategorizedAccounts:G,resetTrendIsFetchedStates:D,isCreateVendorDrawerOpen:F,setIsCreateVendorDrawerOpen:h}}const Yt={overlayWidth:new Ft(100,100,58)},Qt=({isOpen:t,onSaveVendor:e,onSaveSuccess:s,onCancel:a,vendorViewDetails:n})=>{const o=_t(),c=xt(),r=W(),p=S((y=>oe(y))),g=()=>{a()},A={vendorDetailView:n??p,onSaveSuccess:()=>{r(Ue()),r(ot("Not-Started")),s()},onSaveVendor:e,onCancelClick:g,saveVendorDetailLocalData:y=>{r(Oe({vendorId:void 0,localData:y}))}};return w.jsx($t,{anchor:"right",open:t,PaperProps:{style:{width:Yt.overlayWidth.valuePercentage(c),boxShadow:"none"}},slotProps:{backdrop:{style:{backgroundColor:o.colors.black,opacity:.4,cursor:"pointer"}}},onClose:g,children:w.jsx(Zt,{onClick:y=>y.stopPropagation(),children:w.jsx(Pt,{...A})})})},Zt=Gt(jt)`
|
|
2
2
|
display: flex;
|
|
3
3
|
min-height: 100%;
|
|
4
4
|
flex-direction: column;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{j as s}from"./liveblocks-P0DntAgT.js";import{h as U,g as N,u as H,i as Q,j as g,N as G,n as W,o as ve,p as j}from"./core-Ct1Na3r4.js";import{eZ as K,r9 as X,k3 as u,RY as ee,Km as De,bo as le,RZ as Pe,kG as te,O0 as ae,R_ as ue,R$ as be,bE as Y,Ki as ye,S0 as Ee,S1 as me,S2 as je,Kl as Ae,S3 as xe,S4 as pe,S5 as Me,S6 as Se,S7 as Le,S8 as Ce,S9 as fe,Ly as Be}from"./zeni-epic-state-x9uZgubN.js";import{O as de,A as ne,d as q,f as w,co as ce,r as Z,p as oe,_ as Fe,c as Oe}from"./index-BBFNuY8-.js";import"./mui-SSWNL1tt.js";import{a as S}from"./sentry-CfbcqWq3.js";import{w as se}from"./withTransactionSidePanel-u9hB8oy5.js";import{p as ie,c as re}from"./routePaths-Dvh0MCMy.js";import{v as ze}from"./utils-BmRSZi-a.js";import{d as P}from"./decodeURIComponentSafe-Dl7JnLtd.js";import{Z as we}from"./ZeniAccountStatementScreen-DsIySC9T.js";import"./recharts-KVNUr0cO.js";import"./analytics-CsrWBSkJ.js";import"./plaid-CdfVkhIW.js";import"./dnd-DXTfJSUb.js";import"./stripe-cKAAJElX.js";import"./lottie-7Wgw-CzS.js";import"./lexical-5nbymAIm.js";import"./pdf-COhrBMN3.js";import"./useAskAiCfoHostNavButtonProps-BeiXTDS4.js";import"./TransactionDetailScreen-BAzuDRZQ.js";(function(){try{var a=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},e=new a.Error().stack;e&&(a._sentryDebugIds=a._sentryDebugIds||{},a._sentryDebugIds[e]="ac84e854-3783-47c2-ba2a-70a8cd7d973c",a._sentryDebugIdIdentifier="sentry-dbid-ac84e854-3783-47c2-ba2a-70a8cd7d973c")}catch{}})();const Ge=["uncategorized-income","uncategorized-expense","miscategorized-income","miscategorized-expense","missing-receipts"],J=a=>ze(a),Re=W((function(a,e){const t=Pe(a.transactionState,a.transactionListState,e.selectedAccount.period,e.selectedAccount.timeframe,J(e.selectedAccount.tranListType));return{title:e.selectedAccount.title,subTitle:e.selectedAccount.subTitle,timeframe:e.selectedAccount.timeframe,timePeriod:ae(e.selectedAccount.period),dataAvailableForPeriod:e.dataAvailableForPeriod,report:t,currentScrollYOffset:t.uiState?.scrollYOffset??0,isAccountingClassesEnabled:te(a)}}),(function(a,e){return{onBackClick:()=>{const t=oe(e.location.state?.pathnameStackToGoBack),n=t.poppedPathname??"../../";e.navigate(n,{state:{pathnameStackToGoBack:t.newStack}})},onTimePeriodChange:(t,n,c)=>{e.closeSidePanel?.();const o=de.getLocalizedStrings(),l=J(e.selectedAccount.tranListType),m=Ve(t,n,c,l,e.bookCloseDate);w.trackTransactionList(void 0,void 0,void 0,e.selectedAccount.title,void 0,!0),a(ue({uiState:{dateRange:m},type:J(e.selectedAccount.tranListType)})),a(De(l,u(m),!1,l==="missingReceipts"?o.uncategorizedTransactionList.missingReceipt.missingReceiptMinAmount:void 0)),e.onSelectedTimePeriodChange(u(m))},onTransactionItemClick:t=>{if(e.openTransactionPanel)return void e.openTransactionPanel(t.id,t.type);const n=re(t,e.tenantEmailDomain),c=Z(e.location.state?.pathnameStackToGoBack,e.location.pathname);e.navigate(n,{state:{pathnameStackToGoBack:c}})},onTransactionListScroll:t=>{a(ue({uiState:{scrollYOffset:t},type:J(e.selectedAccount.tranListType)}))}}}))(ce),V=se((function({...a}){const e=U(),t=N(),n=H(),c=t.pathname.split("/").find((r=>Ge.includes(r))),o=c??"uncategorized-expense",{tenantEmailDomain:l}=Q(),m=de.getLocalizedStrings(),{accountType:h,title:T,subTitle:D}=_e(o),y="month",I=g((r=>K(r))),p=I.company?.companyInfo.firstMonthOfFY??1,{useFeatureGate:A}=ne(),{isFeatureEnabled:k}=A(q.isProjectsTransactionsEnabled),x=g((r=>X(r)))&&k,{dataAvailable:C,initialTimeframeTick:b}=$e(o,p,I.bookCloseDate),[B,E]=S.useState(!1),[F,O]=S.useState(void 0),f=S.useMemo((()=>{const r=u(b);return{tranListType:o,accountType:ee(h),title:T,subTitle:D,timeframe:y,period:r}}),[o,y,h,C]);S.useEffect((()=>{if(!B&&f!=null){E(!0),w.trackTransactionList(void 0,void 0,void 0,f.title);const r=J(f.tranListType);n(De(r,f.period,!0,r==="missingReceipts"?m.uncategorizedTransactionList.missingReceipt.missingReceiptMinAmount:void 0))}}),[B,f,n]);let M=f;return f!=null&&F!=null&&(M={...f,period:F}),c==null||M==null?s.jsx(G,{to:"../"}):s.jsx(Re,{firstMonthOfFY:p,tenantEmailDomain:l,location:t,useFixedPeriod:{timeframe:"month",numberOfPeriods:12},dataAvailableForPeriod:C,navigate:e,showProjectField:x,selectedAccount:M,referrerType:o,bookCloseDate:I.bookCloseDate,onSelectedTimePeriodChange:r=>O(r),...a})})),_e=a=>{let e="",t="";const n=de.getLocalizedStrings();switch(a){case"uncategorized-income":e="income",t=n.uncategorizedTransactionList.income.title;break;case"uncategorized-expense":e="expenses",t=n.uncategorizedTransactionList.expense.title;break;case"miscategorized-expense":e="expenses",t=n.miscategorizedTransactionList.expense.title;break;case"miscategorized-income":e="income",t=n.miscategorizedTransactionList.income.title;break;case"missing-receipts":t=n.uncategorizedTransactionList.missingReceipt.title}return{accountType:e,title:t,subTitle:""}},$e=(a,e,t)=>{const n=le();let c=le().startOf("month").subtract(11,"month");return t!=null&&a!=="missing-receipts"?t.add(1,"day").isBefore(c)?{dataAvailable:{startDate:t.add(1,"day"),endDate:n},initialTimeframeTick:{startDate:c,endDate:n}}:(c=t.add(1,"day"),{dataAvailable:{startDate:c,endDate:n},initialTimeframeTick:{startDate:c,endDate:n}}):{dataAvailable:ie(5,e),initialTimeframeTick:{startDate:c,endDate:n}}},Ve=(a,e,t,n,c)=>{let o=e;return n==="missingReceipts"||c==null?a.startDate.isBefore(e.startDate,t)?o={startDate:a.startDate,endDate:e.endDate}:a.startDate.isAfter(e.endDate,t)?o={startDate:e.startDate,endDate:a.endDate}:console.error(`Invalid addTimePeriod ${JSON.stringify(a)}`):o=a.startDate.isBefore(c,t)?{startDate:c.add(1,"day"),endDate:e.endDate}:{startDate:a.startDate,endDate:e.endDate},o},Je=W((function(a,e){const t=Ee(a.transactionState,a.transactionListState,e.selectedAccount.accountId,e.selectedAccount.accountType,e.selectedAccount.classId,e.selectedAccount.timeframe,e.selectedAccount.period);return{accountId:e.selectedAccount.accountId,accountType:e.selectedAccount.accountType,title:e.selectedAccount.title,timeframe:e.selectedAccount.timeframe,timePeriod:ae(e.selectedAccount.period),dataAvailableForPeriod:ie(5,e.firstMonthOfFY),report:t,currentScrollYOffset:t.uiState?.scrollYOffset??0,isAccountingClassesEnabled:te(a)}}),(function(a,e){return{onBackClick:()=>{const t=oe(e.location.state?.pathnameStackToGoBack),n=t.poppedPathname??ge();e.navigate(n,{state:{pathnameStackToGoBack:t.newStack}})},onTimePeriodChange:(t,n,c)=>{e.closeSidePanel?.();let o=n;t.startDate.isBefore(n.startDate,c)?o={startDate:t.startDate,endDate:n.endDate}:t.startDate.isAfter(n.endDate,c)?o={startDate:n.startDate,endDate:t.endDate}:console.error(`Invalid addTimePeriod ${JSON.stringify(t)}`),w.trackTransactionList(e.selectedAccount.accountId,void 0,e.referrerType,e.selectedAccount.title,void 0,!0),a(me({accountId:e.selectedAccount.accountId,accountType:e.selectedAccount.accountType,classId:e.selectedAccount.classId,uiState:{dateRange:o}})),a(ye(e.selectedAccount.accountId,e.selectedAccount.accountType,e.selectedAccount.classId,u(o))),e.onSelectedTimePeriodChange(u(o))},onTransactionItemClick:t=>{if(e.openTransactionPanel)return void e.openTransactionPanel(t.id,t.type);const n=re(t,e.tenantEmailDomain),c=Z(e.location.state?.pathnameStackToGoBack,e.location.pathname);e.navigate(n,{state:{pathnameStackToGoBack:c}})},onTransactionListScroll:t=>{a(me({accountId:e.selectedAccount.accountId,accountType:e.selectedAccount.accountType,classId:e.selectedAccount.classId,uiState:{scrollYOffset:t}}))}}}))(ce),qe=se((function({referrerType:a,...e}){const t=U(),n=N(),c=H(),{tenantEmailDomain:o,accountTypeEncoded:l,accountIdEncoded:m,classIdEncoded:h,timeframe:T,startDate:D,endDate:y,titleEncoded:I}=Q(),p=P(l??""),A=P(m??""),k=P(h??""),x=P(I??""),C=g((d=>be(d.transactionListState,A,p,k))),[b,B]=S.useState(!1),[E,F]=S.useState(void 0),O=g((d=>K(d))),f=O.company?.companyInfo.firstMonthOfFY??1,{useFeatureGate:M}=ne(),{isFeatureEnabled:r}=M(q.isProjectsTransactionsEnabled),R=g((d=>X(d)))&&r;let i;const z=Ze(p,A,k,T,D,y,x);if(z){const d={startDate:Y(D,"YYYY-MM-DD"),endDate:Y(y,"YYYY-MM-DD")},_=Ne(C?.dateRange,d);i={accountId:A,accountType:ee(p),classId:k,title:x,timeframe:T,period:_}}S.useEffect((()=>{b||i==null||(B(!0),w.trackTransactionList(i.accountId,void 0,a,i.title),c(ye(i.accountId,i.accountType,i.classId,i.period)))}),[b,i,c]);let L=i;i!=null&&E!=null&&(L={...i,period:E});const $=[l,m,h,T,D,y,I].filter((d=>d!=null));return z&&L!=null?s.jsx(Je,{firstMonthOfFY:f,tenantEmailDomain:o,location:n,navigate:t,showProjectField:R,selectedAccount:L,referrerType:a,onSelectedTimePeriodChange:d=>F(d),...e}):s.jsx(G,{to:ge($.length)})})),ge=(a=7)=>{let e="../";for(let t=0;t<a;t++)e=`${e}../`;return e},Ze=(a,e,t,n,c,o,l)=>a!=null&&e!=null&&t!=null&&n!=null&&c!=null&&o!=null&&(n==="month"||n==="quarter")&&Y(c,"YYYY-MM-DD").isValid()&&Y(o,"YYYY-MM-DD").isValid()&&l!=null,Ne=(a,e)=>a!=null&&a.endDate.isSame(e.endDate,"day")&&a.startDate.isBefore(e.startDate,"day")?u(a):u(e),Ke=W((function(a,e){const t=xe(a.transactionState,a.transactionListState,e.selectedAccount.accountId,e.selectedAccount.accountType,e.selectedAccount.projectId,e.selectedAccount.timeframe,e.selectedAccount.period);return{accountId:e.selectedAccount.accountId,accountType:e.selectedAccount.accountType,title:e.selectedAccount.title,timeframe:e.selectedAccount.timeframe,timePeriod:ae(e.selectedAccount.period),dataAvailableForPeriod:ie(5,e.firstMonthOfFY),report:t,currentScrollYOffset:t.uiState?.scrollYOffset??0,isAccountingClassesEnabled:te(a)}}),(function(a,e){return{onBackClick:()=>{const t=oe(e.location.state?.pathnameStackToGoBack),n=t.poppedPathname??he();e.navigate(n,{state:{pathnameStackToGoBack:t.newStack}})},onTimePeriodChange:(t,n,c)=>{e.closeSidePanel?.();let o=n;t.startDate.isBefore(n.startDate,c)?o={startDate:t.startDate,endDate:n.endDate}:t.startDate.isAfter(n.endDate,c)?o={startDate:n.startDate,endDate:t.endDate}:console.error(`Invalid addTimePeriod ${JSON.stringify(t)}`),w.trackTransactionList(e.selectedAccount.accountId,void 0,e.referrerType,e.selectedAccount.title,void 0,!0),a(pe({accountId:e.selectedAccount.accountId,accountType:e.selectedAccount.accountType,projectId:e.selectedAccount.projectId,uiState:{dateRange:o}})),a(Ae(e.selectedAccount.accountId,e.selectedAccount.accountType,e.selectedAccount.projectId,u(o))),e.onSelectedTimePeriodChange(u(o))},onTransactionItemClick:t=>{if(e.openTransactionPanel)return void e.openTransactionPanel(t.id,t.type);const n=re(t,e.tenantEmailDomain),c=Z(e.location.state?.pathnameStackToGoBack,e.location.pathname);e.navigate(n,{state:{pathnameStackToGoBack:c}})},onTransactionListScroll:t=>{a(pe({accountId:e.selectedAccount.accountId,accountType:e.selectedAccount.accountType,projectId:e.selectedAccount.projectId,uiState:{scrollYOffset:t}}))}}}))(ce),Ue=se((function({referrerType:a,...e}){const t=U(),n=N(),c=H(),{tenantEmailDomain:o,accountTypeEncoded:l,accountIdEncoded:m,projectIdEncoded:h,timeframe:T,startDate:D,endDate:y,titleEncoded:I}=Q(),p=P(l??""),A=P(m??""),k=P(h??""),x=P(I??""),C=g((d=>je(d.transactionListState,A,p,k))),[b,B]=S.useState(!1),[E,F]=S.useState(void 0),O=g((d=>K(d))),f=O.company?.companyInfo.firstMonthOfFY??1,{useFeatureGate:M}=ne(),{isFeatureEnabled:r}=M(q.isProjectsTransactionsEnabled),R=g((d=>X(d)))&&r;let i;const z=He(p,A,k,T,D,y,x);if(z){const d={startDate:Y(D,"YYYY-MM-DD"),endDate:Y(y,"YYYY-MM-DD")},_=Qe(C?.dateRange,d);i={accountId:A,accountType:ee(p),projectId:k,title:x,timeframe:T,period:_}}S.useEffect((()=>{b||i==null||(B(!0),w.trackTransactionList(i.accountId,void 0,a,i.title),c(Ae(i.accountId,i.accountType,i.projectId,i.period)))}),[b,i,c]);let L=i;i!=null&&E!=null&&(L={...i,period:E});const $=[l,m,h,T,D,y,I].filter((d=>d!=null));return z&&L!=null?s.jsx(Ke,{firstMonthOfFY:f,tenantEmailDomain:o,location:n,navigate:t,showProjectField:R,selectedAccount:L,referrerType:a,onSelectedTimePeriodChange:d=>F(d),...e}):s.jsx(G,{to:he($.length)})})),he=(a=7)=>{let e="../";for(let t=0;t<a;t++)e=`${e}../`;return e},He=(a,e,t,n,c,o,l)=>a!=null&&e!=null&&t!=null&&n!=null&&c!=null&&o!=null&&(n==="month"||n==="quarter")&&Y(c,"YYYY-MM-DD").isValid()&&Y(o,"YYYY-MM-DD").isValid()&&l!=null,Qe=(a,e)=>a!=null&&a.endDate.isSame(e.endDate,"day")&&a.startDate.isBefore(e.startDate,"day")?u(a):u(e),We=W((function(a,e){const t=Le(a.transactionState,a.transactionListState,e.selectedAccount.accountId,e.selectedAccount.accountType,e.selectedAccount.timeframe,e.selectedAccount.period),n=t.account?.coaId,c=e.isConnectedAccountProviderUnit&&Ce(n??"");return{accountId:e.selectedAccount.accountId,accountType:e.selectedAccount.accountType,title:e.selectedAccount.title,timeframe:e.selectedAccount.timeframe,timePeriod:ae(e.selectedAccount.period),dataAvailableForPeriod:ie(5,e.firstMonthOfFY),report:t,currentScrollYOffset:t.uiState?.scrollYOffset??0,showStatementPageIcon:c,isAccountingClassesEnabled:te(a)}}),(function(a,e){return{onBackClick:()=>{const t=oe(e.location.state?.pathnameStackToGoBack),n=t.poppedPathname??Ie();e.navigate(n,{state:{pathnameStackToGoBack:t.newStack}})},onTimePeriodChange:(t,n,c)=>{e.closeSidePanel?.();let o=n;t.startDate.isBefore(n.startDate,c)?o={startDate:t.startDate,endDate:n.endDate}:t.startDate.isAfter(n.endDate,c)?o={startDate:n.startDate,endDate:t.endDate}:console.error(`Invalid addTimePeriod ${JSON.stringify(t)}`),w.trackTransactionList(e.selectedAccount.accountId,void 0,e.referrerType,e.selectedAccount.title,void 0,!0),a(fe({accountId:e.selectedAccount.accountId,accountType:e.selectedAccount.accountType,uiState:{dateRange:o}})),a(Se(e.selectedAccount.accountId,e.selectedAccount.accountType,u(o))),e.onSelectedTimePeriodChange(u(o))},onTransactionItemClick:t=>{if(e.openTransactionPanel)return void e.openTransactionPanel(t.id,t.type);const n=re(t,e.tenantEmailDomain),c=Z(e.location.state?.pathnameStackToGoBack,e.location.pathname);e.navigate(n,{state:{pathnameStackToGoBack:c}})},onTransactionListScroll:t=>{a(fe({accountId:e.selectedAccount.accountId,accountType:e.selectedAccount.accountType,uiState:{scrollYOffset:t}}))},onStatementPageIconClick:()=>{const t=tt(e.tenantEmailDomain),n=Z(e.location.state?.pathnameStackToGoBack,e.location.pathname);e.navigate(t,{state:{pathnameStackToGoBack:n}})}}}))(ce),Te=se((function({referrerType:a,...e}){const t=U(),n=N(),c=H(),{tenantEmailDomain:o,accountTypeEncoded:l,accountIdEncoded:m,timeframe:h,startDate:T,endDate:D,titleEncoded:y,excludeSubAccounts:I}=Q(),p=P(l??""),A=P(m??""),k=P(y??""),x=!(I!=null&&I==="exclude_subaccounts"),C=g((v=>Me(v.transactionListState,A,p))),[b,B]=S.useState(!1),[E,F]=S.useState(void 0),O=g((v=>K(v))),f=O.company?.featuresActivationInfo.connectedAccountProvider==="unit",M=O.company?.companyInfo.firstMonthOfFY??1;let r;const R=Xe(p,A,h,T,D,k);if(R){const v={startDate:Y(T,"YYYY-MM-DD"),endDate:Y(D,"YYYY-MM-DD")},Ye=et(C?.dateRange,v);r={accountId:A,accountType:ee(p),title:k,timeframe:h,period:Ye}}let i=r;r!=null&&E!=null&&(i={...r,period:E});const{useFeatureGate:z}=ne(),{isFeatureEnabled:L}=z(q.isTransactionCommentingEnabled),{isFeatureEnabled:$}=z(q.isProjectsTransactionsEnabled),d=g((v=>X(v)))&&$,{areTenantIdsInSync:_}=Fe();S.useEffect((()=>{!b&&r!=null&&_&&(B(!0),w.trackTransactionList(r.accountId,void 0,a,r.title),c(Se(r.accountId,r.accountType,r.period,void 0,!1,x)))}),[b,r,c,_]);const ke=[l,m,h,T,D,y].filter((v=>v!=null));return R&&i!=null?s.jsx(We,{firstMonthOfFY:M,tenantEmailDomain:o,location:n,navigate:t,isConnectedAccountProviderUnit:f,isTransactionCommentingEnabled:L,showProjectField:d,selectedAccount:i,referrerType:a,onSelectedTimePeriodChange:v=>F(v),...e}):s.jsx(G,{to:Ie(ke.length)})})),Ie=(a=7)=>{let e="../";for(let t=0;t<a;t++)e=`${e}../`;return e},Xe=(a,e,t,n,c,o)=>a!=null&&e!=null&&t!=null&&n!=null&&c!=null&&(t==="month"||t==="quarter")&&Y(n,"YYYY-MM-DD").isValid()&&Y(c,"YYYY-MM-DD").isValid()&&o!=null,et=(a,e)=>a!=null&&a.endDate.isSame(e.endDate,"day")&&a.startDate.isBefore(e.startDate,"day")?u(a):u(e),tt=a=>`/${a}/transactions/${Be}/statements`;function kt(){const a=N().state?.referrer,e=g((n=>n.expenseAutomationViewState.selectedPeriodByTenantId))[g((n=>K(n))).tenantId],t=Oe();return s.jsxs(ve,{children:[s.jsx(j,{path:"/:accountTypeEncoded/:accountIdEncoded/:timeframe/:startDate/:endDate/:titleEncoded/:excludeSubAccounts/*",element:s.jsx(Te,{referrerType:a})}),s.jsx(j,{path:"/zeni-clearing-account/statements",element:s.jsx(we,{})}),s.jsx(j,{path:"/*",element:s.jsx(Te,{referrerType:a})}),s.jsx(j,{path:"/uncategorized-income/*",element:s.jsx(V,{})}),s.jsx(j,{path:"/uncategorized-expense/*",element:t?s.jsx(G,{to:`../../month_end_close_checks/review/transaction_categorization/${e.month}-${e.year}`}):s.jsx(V,{})}),s.jsx(j,{path:"/miscategorized-income/*",element:s.jsx(V,{})}),s.jsx(j,{path:"/miscategorized-expense/*",element:t?s.jsx(G,{to:`../../month_end_close_checks/review/transaction_categorization/${e.month}-${e.year}`}):s.jsx(V,{})}),s.jsx(j,{path:"/missing-receipts/*",element:t?s.jsx(G,{to:`../../month_end_close_checks/review/missing_receipts/${e.month}-${e.year}`}):s.jsx(V,{})}),s.jsx(j,{path:"/by-class/:accountTypeEncoded/:accountIdEncoded/:classIdEncoded/:timeframe/:startDate/:endDate/:titleEncoded/*",element:s.jsx(qe,{referrerType:a})}),s.jsx(j,{path:"/by-project/:accountTypeEncoded/:accountIdEncoded/:projectIdEncoded/:timeframe/:startDate/:endDate/:titleEncoded/*",element:s.jsx(Ue,{referrerType:a})})]})}export{kt as default};
|
|
1
|
+
import{j as s}from"./liveblocks-BBLi67DG.js";import{h as U,g as N,u as H,i as Q,j as g,N as G,n as W,o as ve,p as j}from"./core-D2KaS3N5.js";import{eZ as K,r9 as X,k3 as u,RY as ee,Km as De,bo as le,RZ as Pe,kG as te,O0 as ae,R_ as ue,R$ as be,bE as Y,Ki as ye,S0 as Ee,S1 as me,S2 as je,Kl as Ae,S3 as xe,S4 as pe,S5 as Me,S6 as Se,S7 as Le,S8 as Ce,S9 as fe,Ly as Be}from"./zeni-epic-state-BJ_gdj7r.js";import{O as de,A as ne,d as q,f as w,co as ce,r as Z,p as oe,_ as Fe,c as Oe}from"./index-CivdpZRT.js";import"./mui-C1ThRyKO.js";import{a as S}from"./sentry-DW4kKH26.js";import{w as se}from"./withTransactionSidePanel-DWx4OX2G.js";import{p as ie,c as re}from"./routePaths-TRamKMNj.js";import{v as ze}from"./utils-DIwqH7uj.js";import{d as P}from"./decodeURIComponentSafe-CD_zntJd.js";import{Z as we}from"./ZeniAccountStatementScreen-BUgkOPv6.js";import"./recharts-jHFM5Sob.js";import"./analytics-C2MbRoEp.js";import"./plaid-Do7hhR27.js";import"./dnd-D-AkKI2c.js";import"./stripe-cKAAJElX.js";import"./lottie-Dz6JZ58r.js";import"./lexical-BQ-Po3YF.js";import"./pdf-2k8d7AeQ.js";import"./useAskAiCfoHostNavButtonProps-CNoSipqI.js";import"./TransactionDetailScreen-B77dqrVQ.js";(function(){try{var a=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},e=new a.Error().stack;e&&(a._sentryDebugIds=a._sentryDebugIds||{},a._sentryDebugIds[e]="ac84e854-3783-47c2-ba2a-70a8cd7d973c",a._sentryDebugIdIdentifier="sentry-dbid-ac84e854-3783-47c2-ba2a-70a8cd7d973c")}catch{}})();const Ge=["uncategorized-income","uncategorized-expense","miscategorized-income","miscategorized-expense","missing-receipts"],J=a=>ze(a),Re=W((function(a,e){const t=Pe(a.transactionState,a.transactionListState,e.selectedAccount.period,e.selectedAccount.timeframe,J(e.selectedAccount.tranListType));return{title:e.selectedAccount.title,subTitle:e.selectedAccount.subTitle,timeframe:e.selectedAccount.timeframe,timePeriod:ae(e.selectedAccount.period),dataAvailableForPeriod:e.dataAvailableForPeriod,report:t,currentScrollYOffset:t.uiState?.scrollYOffset??0,isAccountingClassesEnabled:te(a)}}),(function(a,e){return{onBackClick:()=>{const t=oe(e.location.state?.pathnameStackToGoBack),n=t.poppedPathname??"../../";e.navigate(n,{state:{pathnameStackToGoBack:t.newStack}})},onTimePeriodChange:(t,n,c)=>{e.closeSidePanel?.();const o=de.getLocalizedStrings(),l=J(e.selectedAccount.tranListType),m=Ve(t,n,c,l,e.bookCloseDate);w.trackTransactionList(void 0,void 0,void 0,e.selectedAccount.title,void 0,!0),a(ue({uiState:{dateRange:m},type:J(e.selectedAccount.tranListType)})),a(De(l,u(m),!1,l==="missingReceipts"?o.uncategorizedTransactionList.missingReceipt.missingReceiptMinAmount:void 0)),e.onSelectedTimePeriodChange(u(m))},onTransactionItemClick:t=>{if(e.openTransactionPanel)return void e.openTransactionPanel(t.id,t.type);const n=re(t,e.tenantEmailDomain),c=Z(e.location.state?.pathnameStackToGoBack,e.location.pathname);e.navigate(n,{state:{pathnameStackToGoBack:c}})},onTransactionListScroll:t=>{a(ue({uiState:{scrollYOffset:t},type:J(e.selectedAccount.tranListType)}))}}}))(ce),V=se((function({...a}){const e=U(),t=N(),n=H(),c=t.pathname.split("/").find((r=>Ge.includes(r))),o=c??"uncategorized-expense",{tenantEmailDomain:l}=Q(),m=de.getLocalizedStrings(),{accountType:h,title:T,subTitle:D}=_e(o),y="month",I=g((r=>K(r))),p=I.company?.companyInfo.firstMonthOfFY??1,{useFeatureGate:A}=ne(),{isFeatureEnabled:k}=A(q.isProjectsTransactionsEnabled),x=g((r=>X(r)))&&k,{dataAvailable:C,initialTimeframeTick:b}=$e(o,p,I.bookCloseDate),[B,E]=S.useState(!1),[F,O]=S.useState(void 0),f=S.useMemo((()=>{const r=u(b);return{tranListType:o,accountType:ee(h),title:T,subTitle:D,timeframe:y,period:r}}),[o,y,h,C]);S.useEffect((()=>{if(!B&&f!=null){E(!0),w.trackTransactionList(void 0,void 0,void 0,f.title);const r=J(f.tranListType);n(De(r,f.period,!0,r==="missingReceipts"?m.uncategorizedTransactionList.missingReceipt.missingReceiptMinAmount:void 0))}}),[B,f,n]);let M=f;return f!=null&&F!=null&&(M={...f,period:F}),c==null||M==null?s.jsx(G,{to:"../"}):s.jsx(Re,{firstMonthOfFY:p,tenantEmailDomain:l,location:t,useFixedPeriod:{timeframe:"month",numberOfPeriods:12},dataAvailableForPeriod:C,navigate:e,showProjectField:x,selectedAccount:M,referrerType:o,bookCloseDate:I.bookCloseDate,onSelectedTimePeriodChange:r=>O(r),...a})})),_e=a=>{let e="",t="";const n=de.getLocalizedStrings();switch(a){case"uncategorized-income":e="income",t=n.uncategorizedTransactionList.income.title;break;case"uncategorized-expense":e="expenses",t=n.uncategorizedTransactionList.expense.title;break;case"miscategorized-expense":e="expenses",t=n.miscategorizedTransactionList.expense.title;break;case"miscategorized-income":e="income",t=n.miscategorizedTransactionList.income.title;break;case"missing-receipts":t=n.uncategorizedTransactionList.missingReceipt.title}return{accountType:e,title:t,subTitle:""}},$e=(a,e,t)=>{const n=le();let c=le().startOf("month").subtract(11,"month");return t!=null&&a!=="missing-receipts"?t.add(1,"day").isBefore(c)?{dataAvailable:{startDate:t.add(1,"day"),endDate:n},initialTimeframeTick:{startDate:c,endDate:n}}:(c=t.add(1,"day"),{dataAvailable:{startDate:c,endDate:n},initialTimeframeTick:{startDate:c,endDate:n}}):{dataAvailable:ie(5,e),initialTimeframeTick:{startDate:c,endDate:n}}},Ve=(a,e,t,n,c)=>{let o=e;return n==="missingReceipts"||c==null?a.startDate.isBefore(e.startDate,t)?o={startDate:a.startDate,endDate:e.endDate}:a.startDate.isAfter(e.endDate,t)?o={startDate:e.startDate,endDate:a.endDate}:console.error(`Invalid addTimePeriod ${JSON.stringify(a)}`):o=a.startDate.isBefore(c,t)?{startDate:c.add(1,"day"),endDate:e.endDate}:{startDate:a.startDate,endDate:e.endDate},o},Je=W((function(a,e){const t=Ee(a.transactionState,a.transactionListState,e.selectedAccount.accountId,e.selectedAccount.accountType,e.selectedAccount.classId,e.selectedAccount.timeframe,e.selectedAccount.period);return{accountId:e.selectedAccount.accountId,accountType:e.selectedAccount.accountType,title:e.selectedAccount.title,timeframe:e.selectedAccount.timeframe,timePeriod:ae(e.selectedAccount.period),dataAvailableForPeriod:ie(5,e.firstMonthOfFY),report:t,currentScrollYOffset:t.uiState?.scrollYOffset??0,isAccountingClassesEnabled:te(a)}}),(function(a,e){return{onBackClick:()=>{const t=oe(e.location.state?.pathnameStackToGoBack),n=t.poppedPathname??ge();e.navigate(n,{state:{pathnameStackToGoBack:t.newStack}})},onTimePeriodChange:(t,n,c)=>{e.closeSidePanel?.();let o=n;t.startDate.isBefore(n.startDate,c)?o={startDate:t.startDate,endDate:n.endDate}:t.startDate.isAfter(n.endDate,c)?o={startDate:n.startDate,endDate:t.endDate}:console.error(`Invalid addTimePeriod ${JSON.stringify(t)}`),w.trackTransactionList(e.selectedAccount.accountId,void 0,e.referrerType,e.selectedAccount.title,void 0,!0),a(me({accountId:e.selectedAccount.accountId,accountType:e.selectedAccount.accountType,classId:e.selectedAccount.classId,uiState:{dateRange:o}})),a(ye(e.selectedAccount.accountId,e.selectedAccount.accountType,e.selectedAccount.classId,u(o))),e.onSelectedTimePeriodChange(u(o))},onTransactionItemClick:t=>{if(e.openTransactionPanel)return void e.openTransactionPanel(t.id,t.type);const n=re(t,e.tenantEmailDomain),c=Z(e.location.state?.pathnameStackToGoBack,e.location.pathname);e.navigate(n,{state:{pathnameStackToGoBack:c}})},onTransactionListScroll:t=>{a(me({accountId:e.selectedAccount.accountId,accountType:e.selectedAccount.accountType,classId:e.selectedAccount.classId,uiState:{scrollYOffset:t}}))}}}))(ce),qe=se((function({referrerType:a,...e}){const t=U(),n=N(),c=H(),{tenantEmailDomain:o,accountTypeEncoded:l,accountIdEncoded:m,classIdEncoded:h,timeframe:T,startDate:D,endDate:y,titleEncoded:I}=Q(),p=P(l??""),A=P(m??""),k=P(h??""),x=P(I??""),C=g((d=>be(d.transactionListState,A,p,k))),[b,B]=S.useState(!1),[E,F]=S.useState(void 0),O=g((d=>K(d))),f=O.company?.companyInfo.firstMonthOfFY??1,{useFeatureGate:M}=ne(),{isFeatureEnabled:r}=M(q.isProjectsTransactionsEnabled),R=g((d=>X(d)))&&r;let i;const z=Ze(p,A,k,T,D,y,x);if(z){const d={startDate:Y(D,"YYYY-MM-DD"),endDate:Y(y,"YYYY-MM-DD")},_=Ne(C?.dateRange,d);i={accountId:A,accountType:ee(p),classId:k,title:x,timeframe:T,period:_}}S.useEffect((()=>{b||i==null||(B(!0),w.trackTransactionList(i.accountId,void 0,a,i.title),c(ye(i.accountId,i.accountType,i.classId,i.period)))}),[b,i,c]);let L=i;i!=null&&E!=null&&(L={...i,period:E});const $=[l,m,h,T,D,y,I].filter((d=>d!=null));return z&&L!=null?s.jsx(Je,{firstMonthOfFY:f,tenantEmailDomain:o,location:n,navigate:t,showProjectField:R,selectedAccount:L,referrerType:a,onSelectedTimePeriodChange:d=>F(d),...e}):s.jsx(G,{to:ge($.length)})})),ge=(a=7)=>{let e="../";for(let t=0;t<a;t++)e=`${e}../`;return e},Ze=(a,e,t,n,c,o,l)=>a!=null&&e!=null&&t!=null&&n!=null&&c!=null&&o!=null&&(n==="month"||n==="quarter")&&Y(c,"YYYY-MM-DD").isValid()&&Y(o,"YYYY-MM-DD").isValid()&&l!=null,Ne=(a,e)=>a!=null&&a.endDate.isSame(e.endDate,"day")&&a.startDate.isBefore(e.startDate,"day")?u(a):u(e),Ke=W((function(a,e){const t=xe(a.transactionState,a.transactionListState,e.selectedAccount.accountId,e.selectedAccount.accountType,e.selectedAccount.projectId,e.selectedAccount.timeframe,e.selectedAccount.period);return{accountId:e.selectedAccount.accountId,accountType:e.selectedAccount.accountType,title:e.selectedAccount.title,timeframe:e.selectedAccount.timeframe,timePeriod:ae(e.selectedAccount.period),dataAvailableForPeriod:ie(5,e.firstMonthOfFY),report:t,currentScrollYOffset:t.uiState?.scrollYOffset??0,isAccountingClassesEnabled:te(a)}}),(function(a,e){return{onBackClick:()=>{const t=oe(e.location.state?.pathnameStackToGoBack),n=t.poppedPathname??he();e.navigate(n,{state:{pathnameStackToGoBack:t.newStack}})},onTimePeriodChange:(t,n,c)=>{e.closeSidePanel?.();let o=n;t.startDate.isBefore(n.startDate,c)?o={startDate:t.startDate,endDate:n.endDate}:t.startDate.isAfter(n.endDate,c)?o={startDate:n.startDate,endDate:t.endDate}:console.error(`Invalid addTimePeriod ${JSON.stringify(t)}`),w.trackTransactionList(e.selectedAccount.accountId,void 0,e.referrerType,e.selectedAccount.title,void 0,!0),a(pe({accountId:e.selectedAccount.accountId,accountType:e.selectedAccount.accountType,projectId:e.selectedAccount.projectId,uiState:{dateRange:o}})),a(Ae(e.selectedAccount.accountId,e.selectedAccount.accountType,e.selectedAccount.projectId,u(o))),e.onSelectedTimePeriodChange(u(o))},onTransactionItemClick:t=>{if(e.openTransactionPanel)return void e.openTransactionPanel(t.id,t.type);const n=re(t,e.tenantEmailDomain),c=Z(e.location.state?.pathnameStackToGoBack,e.location.pathname);e.navigate(n,{state:{pathnameStackToGoBack:c}})},onTransactionListScroll:t=>{a(pe({accountId:e.selectedAccount.accountId,accountType:e.selectedAccount.accountType,projectId:e.selectedAccount.projectId,uiState:{scrollYOffset:t}}))}}}))(ce),Ue=se((function({referrerType:a,...e}){const t=U(),n=N(),c=H(),{tenantEmailDomain:o,accountTypeEncoded:l,accountIdEncoded:m,projectIdEncoded:h,timeframe:T,startDate:D,endDate:y,titleEncoded:I}=Q(),p=P(l??""),A=P(m??""),k=P(h??""),x=P(I??""),C=g((d=>je(d.transactionListState,A,p,k))),[b,B]=S.useState(!1),[E,F]=S.useState(void 0),O=g((d=>K(d))),f=O.company?.companyInfo.firstMonthOfFY??1,{useFeatureGate:M}=ne(),{isFeatureEnabled:r}=M(q.isProjectsTransactionsEnabled),R=g((d=>X(d)))&&r;let i;const z=He(p,A,k,T,D,y,x);if(z){const d={startDate:Y(D,"YYYY-MM-DD"),endDate:Y(y,"YYYY-MM-DD")},_=Qe(C?.dateRange,d);i={accountId:A,accountType:ee(p),projectId:k,title:x,timeframe:T,period:_}}S.useEffect((()=>{b||i==null||(B(!0),w.trackTransactionList(i.accountId,void 0,a,i.title),c(Ae(i.accountId,i.accountType,i.projectId,i.period)))}),[b,i,c]);let L=i;i!=null&&E!=null&&(L={...i,period:E});const $=[l,m,h,T,D,y,I].filter((d=>d!=null));return z&&L!=null?s.jsx(Ke,{firstMonthOfFY:f,tenantEmailDomain:o,location:n,navigate:t,showProjectField:R,selectedAccount:L,referrerType:a,onSelectedTimePeriodChange:d=>F(d),...e}):s.jsx(G,{to:he($.length)})})),he=(a=7)=>{let e="../";for(let t=0;t<a;t++)e=`${e}../`;return e},He=(a,e,t,n,c,o,l)=>a!=null&&e!=null&&t!=null&&n!=null&&c!=null&&o!=null&&(n==="month"||n==="quarter")&&Y(c,"YYYY-MM-DD").isValid()&&Y(o,"YYYY-MM-DD").isValid()&&l!=null,Qe=(a,e)=>a!=null&&a.endDate.isSame(e.endDate,"day")&&a.startDate.isBefore(e.startDate,"day")?u(a):u(e),We=W((function(a,e){const t=Le(a.transactionState,a.transactionListState,e.selectedAccount.accountId,e.selectedAccount.accountType,e.selectedAccount.timeframe,e.selectedAccount.period),n=t.account?.coaId,c=e.isConnectedAccountProviderUnit&&Ce(n??"");return{accountId:e.selectedAccount.accountId,accountType:e.selectedAccount.accountType,title:e.selectedAccount.title,timeframe:e.selectedAccount.timeframe,timePeriod:ae(e.selectedAccount.period),dataAvailableForPeriod:ie(5,e.firstMonthOfFY),report:t,currentScrollYOffset:t.uiState?.scrollYOffset??0,showStatementPageIcon:c,isAccountingClassesEnabled:te(a)}}),(function(a,e){return{onBackClick:()=>{const t=oe(e.location.state?.pathnameStackToGoBack),n=t.poppedPathname??Ie();e.navigate(n,{state:{pathnameStackToGoBack:t.newStack}})},onTimePeriodChange:(t,n,c)=>{e.closeSidePanel?.();let o=n;t.startDate.isBefore(n.startDate,c)?o={startDate:t.startDate,endDate:n.endDate}:t.startDate.isAfter(n.endDate,c)?o={startDate:n.startDate,endDate:t.endDate}:console.error(`Invalid addTimePeriod ${JSON.stringify(t)}`),w.trackTransactionList(e.selectedAccount.accountId,void 0,e.referrerType,e.selectedAccount.title,void 0,!0),a(fe({accountId:e.selectedAccount.accountId,accountType:e.selectedAccount.accountType,uiState:{dateRange:o}})),a(Se(e.selectedAccount.accountId,e.selectedAccount.accountType,u(o))),e.onSelectedTimePeriodChange(u(o))},onTransactionItemClick:t=>{if(e.openTransactionPanel)return void e.openTransactionPanel(t.id,t.type);const n=re(t,e.tenantEmailDomain),c=Z(e.location.state?.pathnameStackToGoBack,e.location.pathname);e.navigate(n,{state:{pathnameStackToGoBack:c}})},onTransactionListScroll:t=>{a(fe({accountId:e.selectedAccount.accountId,accountType:e.selectedAccount.accountType,uiState:{scrollYOffset:t}}))},onStatementPageIconClick:()=>{const t=tt(e.tenantEmailDomain),n=Z(e.location.state?.pathnameStackToGoBack,e.location.pathname);e.navigate(t,{state:{pathnameStackToGoBack:n}})}}}))(ce),Te=se((function({referrerType:a,...e}){const t=U(),n=N(),c=H(),{tenantEmailDomain:o,accountTypeEncoded:l,accountIdEncoded:m,timeframe:h,startDate:T,endDate:D,titleEncoded:y,excludeSubAccounts:I}=Q(),p=P(l??""),A=P(m??""),k=P(y??""),x=!(I!=null&&I==="exclude_subaccounts"),C=g((v=>Me(v.transactionListState,A,p))),[b,B]=S.useState(!1),[E,F]=S.useState(void 0),O=g((v=>K(v))),f=O.company?.featuresActivationInfo.connectedAccountProvider==="unit",M=O.company?.companyInfo.firstMonthOfFY??1;let r;const R=Xe(p,A,h,T,D,k);if(R){const v={startDate:Y(T,"YYYY-MM-DD"),endDate:Y(D,"YYYY-MM-DD")},Ye=et(C?.dateRange,v);r={accountId:A,accountType:ee(p),title:k,timeframe:h,period:Ye}}let i=r;r!=null&&E!=null&&(i={...r,period:E});const{useFeatureGate:z}=ne(),{isFeatureEnabled:L}=z(q.isTransactionCommentingEnabled),{isFeatureEnabled:$}=z(q.isProjectsTransactionsEnabled),d=g((v=>X(v)))&&$,{areTenantIdsInSync:_}=Fe();S.useEffect((()=>{!b&&r!=null&&_&&(B(!0),w.trackTransactionList(r.accountId,void 0,a,r.title),c(Se(r.accountId,r.accountType,r.period,void 0,!1,x)))}),[b,r,c,_]);const ke=[l,m,h,T,D,y].filter((v=>v!=null));return R&&i!=null?s.jsx(We,{firstMonthOfFY:M,tenantEmailDomain:o,location:n,navigate:t,isConnectedAccountProviderUnit:f,isTransactionCommentingEnabled:L,showProjectField:d,selectedAccount:i,referrerType:a,onSelectedTimePeriodChange:v=>F(v),...e}):s.jsx(G,{to:Ie(ke.length)})})),Ie=(a=7)=>{let e="../";for(let t=0;t<a;t++)e=`${e}../`;return e},Xe=(a,e,t,n,c,o)=>a!=null&&e!=null&&t!=null&&n!=null&&c!=null&&(t==="month"||t==="quarter")&&Y(n,"YYYY-MM-DD").isValid()&&Y(c,"YYYY-MM-DD").isValid()&&o!=null,et=(a,e)=>a!=null&&a.endDate.isSame(e.endDate,"day")&&a.startDate.isBefore(e.startDate,"day")?u(a):u(e),tt=a=>`/${a}/transactions/${Be}/statements`;function kt(){const a=N().state?.referrer,e=g((n=>n.expenseAutomationViewState.selectedPeriodByTenantId))[g((n=>K(n))).tenantId],t=Oe();return s.jsxs(ve,{children:[s.jsx(j,{path:"/:accountTypeEncoded/:accountIdEncoded/:timeframe/:startDate/:endDate/:titleEncoded/:excludeSubAccounts/*",element:s.jsx(Te,{referrerType:a})}),s.jsx(j,{path:"/zeni-clearing-account/statements",element:s.jsx(we,{})}),s.jsx(j,{path:"/*",element:s.jsx(Te,{referrerType:a})}),s.jsx(j,{path:"/uncategorized-income/*",element:s.jsx(V,{})}),s.jsx(j,{path:"/uncategorized-expense/*",element:t?s.jsx(G,{to:`../../month_end_close_checks/review/transaction_categorization/${e.month}-${e.year}`}):s.jsx(V,{})}),s.jsx(j,{path:"/miscategorized-income/*",element:s.jsx(V,{})}),s.jsx(j,{path:"/miscategorized-expense/*",element:t?s.jsx(G,{to:`../../month_end_close_checks/review/transaction_categorization/${e.month}-${e.year}`}):s.jsx(V,{})}),s.jsx(j,{path:"/missing-receipts/*",element:t?s.jsx(G,{to:`../../month_end_close_checks/review/missing_receipts/${e.month}-${e.year}`}):s.jsx(V,{})}),s.jsx(j,{path:"/by-class/:accountTypeEncoded/:accountIdEncoded/:classIdEncoded/:timeframe/:startDate/:endDate/:titleEncoded/*",element:s.jsx(qe,{referrerType:a})}),s.jsx(j,{path:"/by-project/:accountTypeEncoded/:accountIdEncoded/:projectIdEncoded/:timeframe/:startDate/:endDate/:titleEncoded/*",element:s.jsx(Ue,{referrerType:a})})]})}export{kt as default};
|