@zeniai/web-app-ui 5.2.6-dev → 5.2.6-next
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/assets/AddressRoutes-BmKpIsRQ.js +1 -0
- package/dist/assets/{AddressScreen-_QOTUIVr.js → AddressScreen-B4AZf_Bb.js} +1 -1
- package/dist/assets/{AiCfoScreen-CX7E8Peo.js → AiCfoScreen-CiyAYMLp.js} +1 -1
- package/dist/assets/{BillPayApprovalRoutes-ClmCpYFd.js → BillPayApprovalRoutes-BEMba1i2.js} +1 -1
- package/dist/assets/{BillPayRoutes-DoSwk72T.js → BillPayRoutes-Bwf5D0Ek.js} +1 -1
- package/dist/assets/{BusinessVerificationPageScreen-CzDFv09Y.js → BusinessVerificationPageScreen-4IUxwsvU.js} +1 -1
- package/dist/assets/{CardsAiCfoScreen-eeV0SveA.js → CardsAiCfoScreen-Qy6tRjXd.js} +1 -1
- package/dist/assets/{ChargeCardRoutes-D-2cGFR8.js → ChargeCardRoutes-ktPwuMp3.js} +1 -1
- package/dist/assets/{CompanyPassportScreen-Dgc1b90N.js → CompanyPassportScreen-B68PA8m9.js} +1 -1
- package/dist/assets/{ConnectionAuthScreen-BJNKfgFC.js → ConnectionAuthScreen-B0WN_s8F.js} +1 -1
- package/dist/assets/CustomerOnboardingAuthScreen-B5mDIUFK.js +1 -0
- package/dist/assets/{CustomerOnboardingRoutes-CU2s9JFJ.js → CustomerOnboardingRoutes-Cv6JYdq2.js} +1 -1
- package/dist/assets/{DashboardRoutes-D_nR7gnV.js → DashboardRoutes-D_Oe_3IB.js} +1 -1
- package/dist/assets/{DefaultTenantHome-CAghXBT6.js → DefaultTenantHome-DEXR2qDR.js} +1 -1
- package/dist/assets/{DomesticWireDetailScreen-BrMTJ0LT.js → DomesticWireDetailScreen-D1g6ymLx.js} +1 -1
- package/dist/assets/{DrawerScreen-DbaoUmyp.js → DrawerScreen-VzjRjwq9.js} +1 -1
- package/dist/assets/{EntityDetailRoutes-RWRqdoUW.js → EntityDetailRoutes-Cqud1mzd.js} +1 -1
- package/dist/assets/{ExpenseAutomationRoutes-Bg1lugdX.js → ExpenseAutomationRoutes-C7SP-bG3.js} +1 -1
- package/dist/assets/{FeaturePreviewScreen-BfuOs-n9.js → FeaturePreviewScreen-D3aqd5vk.js} +1 -1
- package/dist/assets/{HubSpotOAuthCallbackScreen-Tm6-OaLw.js → HubSpotOAuthCallbackScreen-CjZI1Wlx.js} +1 -1
- package/dist/assets/{MagicLinkRoutes-BPFrOlQS.js → MagicLinkRoutes-BIRU8uV8.js} +1 -1
- package/dist/assets/{MagicLinkSignInScreen-_-oIW3R9.js → MagicLinkSignInScreen-CWyYym-G.js} +1 -1
- package/dist/assets/{MobileAppDrawer-BVsx0d52.js → MobileAppDrawer-DmvUd-9k.js} +1 -1
- package/dist/assets/NotFoundScreen-DicN0NsA.js +1 -0
- package/dist/assets/{NotificationRoutes-m7aisVZh.js → NotificationRoutes-DoDTRf3S.js} +1 -1
- package/dist/assets/{OAuthConsentScreen-Dr5xHicR.js → OAuthConsentScreen-CwvL5eG7.js} +1 -1
- package/dist/assets/{PandLWithForecastRoutes-DWPW45GW.js → PandLWithForecastRoutes-A_vEVo_6.js} +1 -1
- package/dist/assets/{PeopleRoutes-CeN9aIQp.js → PeopleRoutes-CCcVYPJc.js} +1 -1
- package/dist/assets/{PerformanceRoutes-Dhkh0POj.js → PerformanceRoutes-2qmBImXf.js} +1 -1
- package/dist/assets/{Preview-B54tVRwE.js → Preview-DncjoGuv.js} +1 -1
- package/dist/assets/{QBOConnectionScreen-DaV3loZh.js → QBOConnectionScreen-CyRXuV7l.js} +1 -1
- package/dist/assets/{ReimbursementApprovalRoutes-D6a0suIn.js → ReimbursementApprovalRoutes-FCPg3UiN.js} +1 -1
- package/dist/assets/{ReimbursementApprovalRuleDetailScreen-LSfhRsMC.js → ReimbursementApprovalRuleDetailScreen-CDZuZjie.js} +1 -1
- package/dist/assets/{ReimbursementRoutes-Bh9_hMkC.js → ReimbursementRoutes-i0ob4XKl.js} +1 -1
- package/dist/assets/{ReportsRoutes-vW__-mqO.js → ReportsRoutes-CpfaB-E1.js} +1 -1
- package/dist/assets/{RewardsRoutes-DTUZ1AWT.js → RewardsRoutes-CBafBLnP.js} +1 -1
- package/dist/assets/{ScreenRoutes-foz6ng2P.js → ScreenRoutes-BUNOPfus.js} +2 -2
- package/dist/assets/{SettingsRoutes-fWbhF4uP.js → SettingsRoutes-BkvEavBt.js} +1 -1
- package/dist/assets/{SetupPagesScreen-B8WYHzUu.js → SetupPagesScreen-BwdSvHh-.js} +1 -1
- package/dist/assets/{SignInScreen-CHWWmIOt.js → SignInScreen-w8bmD3TH.js} +1 -1
- package/dist/assets/{SignOutScreen-xt4AkWg7.js → SignOutScreen-t5hIQIt-.js} +1 -1
- package/dist/assets/{TaskListScreen-BNNdSA1G.js → TaskListScreen-cv3YBBd9.js} +1 -1
- package/dist/assets/{TaskRoutes-Brk_g9vS.js → TaskRoutes-BZmEZp3A.js} +1 -1
- package/dist/assets/{TransactionDetailRoutes-D6y-8FuE.js → TransactionDetailRoutes-CqJldaCF.js} +1 -1
- package/dist/assets/{TransactionDetailScreen-CHtoQtM9.js → TransactionDetailScreen-BM6LDN-M.js} +1 -1
- package/dist/assets/{TransactionListRoutes-DqRETwf-.js → TransactionListRoutes-D0cyEIdU.js} +1 -1
- package/dist/assets/{TreasuryRoutes-Bgqikq-u.js → TreasuryRoutes-F8-NxpXC.js} +1 -1
- package/dist/assets/{VendorsRoutes-CHFxSJdV.js → VendorsRoutes-Cz8Uv4rJ.js} +1 -1
- package/dist/assets/{WiseConfirmationScreen-XYoM1z3h.js → WiseConfirmationScreen-FQBUaicY.js} +1 -1
- package/dist/assets/{ZeniAccountRoutes-Chw_TTRS.js → ZeniAccountRoutes-PrDQqACj.js} +1 -1
- package/dist/assets/{ZeniAccountStatementScreen-C6Lownq7.js → ZeniAccountStatementScreen-DhRygyJr.js} +1 -1
- package/dist/assets/{accountMappingHelper-Cb6Phjli.js → accountMappingHelper-Cg-otc9W.js} +1 -1
- package/dist/assets/{analytics-CMhYvjgp.js → analytics-C2sLqqt-.js} +1 -1
- package/dist/assets/{analyticsHelper-D86wGf3h.js → analyticsHelper-DsJZpHCL.js} +1 -1
- package/dist/assets/{core-BjRnoVdN.js → core-DcS-HXN0.js} +1 -1
- package/dist/assets/{decodeURIComponentSafe-8RHUrhvv.js → decodeURIComponentSafe-HMBZoUM8.js} +1 -1
- package/dist/assets/{dnd-DD1NomKe.js → dnd-D_MmPpoN.js} +1 -1
- package/dist/assets/{empty-BxET7kap.js → empty-DOLvt4hu.js} +1 -1
- package/dist/assets/{empty-Lyk-jq4r.js → empty-wN7l41-_.js} +1 -1
- package/dist/assets/{emptyVideoElement-6B6_1DjQ.js → emptyVideoElement-D7OSmVU6.js} +1 -1
- package/dist/assets/{epic-Bndm1KHn.js → epic-LDbwfKnb.js} +1 -1
- package/dist/assets/{getLocaleForTenant-B67NSzYh.js → getLocaleForTenant-Dq62iB8Q.js} +1 -1
- package/dist/assets/{index-0VsUkhux.js → index-BbzLsG-V.js} +1 -1
- package/dist/assets/{index-CQBqRx-l.js → index-Bs2Rgjng.js} +1 -1
- package/dist/assets/{index-BfsWyp4D.js → index-C4-1q7CM.js} +1 -1
- package/dist/assets/{index-DlX43o9f.js → index-CDYnfUul.js} +1 -1
- package/dist/assets/{index-DaCvER1D.js → index-D3neFh91.js} +1 -1
- package/dist/assets/{index-DG5dsziC.js → index-DC0dQLD1.js} +7 -7
- package/dist/assets/{index-BgcyTzzQ.js → index-DGnq9uuc.js} +2 -2
- package/dist/assets/{index-BT-czevE.js → index-Fd_ZlxLV.js} +1 -1
- package/dist/assets/{lexical-CkYiXWk9.js → lexical-BhgGR8eI.js} +1 -1
- package/dist/assets/{liveblocks-BxpjjfmG.js → liveblocks-DTbLGSQH.js} +1 -1
- package/dist/assets/{lottie-iCzPfqr5.js → lottie-XNZ0j4Vk.js} +1 -1
- package/dist/assets/{mui-CdxnWIp4.js → mui-D4oYUocG.js} +1 -1
- package/dist/assets/{pathToGoBack-ne1S9CXU.js → pathToGoBack-Dj_I2yPM.js} +1 -1
- package/dist/assets/{pdf-C9PyNDT1.js → pdf-kyzMB0kM.js} +3 -3
- package/dist/assets/{pdf-lib-AYWezrZl.js → pdf-lib-D_BFR41U.js} +1 -1
- package/dist/assets/{plaid-DtXw88Ai.js → plaid-DnXASLGE.js} +1 -1
- package/dist/assets/{pusher-BKAtqq4a.js → pusher-DlahWwF6.js} +1 -1
- package/dist/assets/{react-C9kbZlRC.js → react-9rESx23A.js} +1 -1
- package/dist/assets/{react-BU5_UEj2.js → react-A5E9DoGU.js} +1 -1
- package/dist/assets/{react-CpTVGU-U.js → react-DqY84OaM.js} +1 -1
- package/dist/assets/{react-nOMx_HSn.js → react-HyYJAwxt.js} +1 -1
- package/dist/assets/{react-BoUZ92nm.js → react-KGpTRRzm.js} +1 -1
- package/dist/assets/{react-DT4sGgUJ.js → react-t50erd17.js} +1 -1
- package/dist/assets/{recharts-CFinCL-a.js → recharts-B-6eSeb6.js} +1 -1
- package/dist/assets/{routePaths-C7myDwxn.js → routePaths-CD1cpX2J.js} +1 -1
- package/dist/assets/{sentry-B06otMHd.js → sentry--iMGn_c-.js} +1 -1
- package/dist/assets/{url-CX7iFnba.js → url-B9kBE-_j.js} +1 -1
- package/dist/assets/{url-C1h0szFu.js → url-Dxw5WQzJ.js} +1 -1
- package/dist/assets/{useAiCfoDashboardSuggestedQuestionsChips-TpXXYr6r.js → useAiCfoDashboardSuggestedQuestionsChips-mlw7oi_d.js} +1 -1
- package/dist/assets/{useAskAiCfoHostNavButtonProps-CFgUcHmD.js → useAskAiCfoHostNavButtonProps-CvQ724tN.js} +1 -1
- package/dist/assets/{useCashManagementBanner-FLL8Hs1-.js → useCashManagementBanner-DewpKyRp.js} +1 -1
- package/dist/assets/{useChargeCardPusherEvents-DT2ptjCA.js → useChargeCardPusherEvents-CtCp4KqM.js} +1 -1
- package/dist/assets/{useDeviceId-BTkaAWDK.js → useDeviceId-BdsUHxd2.js} +1 -1
- package/dist/assets/{useEmailConnectResultRefresh-DG9AkHtd.js → useEmailConnectResultRefresh-BR0ijVLk.js} +1 -1
- package/dist/assets/{useInitialThreadRequest-Dc7yU2XH.js → useInitialThreadRequest-zbm4ek8Z.js} +1 -1
- package/dist/assets/{utils-CaYSR2MR.js → utils-CiOzvYGH.js} +1 -1
- package/dist/assets/{withTransactionSidePanel-tBE2uHP9.js → withTransactionSidePanel-CcdsL6he.js} +1 -1
- package/dist/assets/{zeni-epic-state-BkEKIYbX.js → zeni-epic-state-D9zlxAus.js} +3 -3
- package/dist/index.html +1 -1
- package/package.json +1 -1
- package/dist/assets/AddressRoutes-CRqr9Fgx.js +0 -1
- package/dist/assets/CustomerOnboardingAuthScreen-B5MRHJlf.js +0 -1
- package/dist/assets/NotFoundScreen-6c0jfbLt.js +0 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{j as s}from"./liveblocks-BxpjjfmG.js";import{h as W,u as de,g as Z,i as Y,j as w,N as _,n as J,l as mt,o as ct,p as C}from"./core-BjRnoVdN.js";import{eW as V,QJ as ue,c7 as pe,EI as Fe,kH as dt,EV as oe,EU as re,QK as ut,bn as be,go as Ue,QL as pt,N9 as bt,kw as Le,Na as ke,Nb as gt,jr as ht,Q1 as ft,jG as St,Ew as It,ua as Rt,jy as yt,Fg as Pe,QM as $e,QN as kt,QO as vt,QP as At,QQ as Ct,QR as Et,F0 as ve,jM as wt,Qa as xt,EW as Bt,EG as Tt,QS as jt,EF as Dt,QT as Ft,EO as Ae,F4 as Ut,F3 as Lt,E$ as Pt,QU as Me,Kf as $t,bq as Mt,ER as _t,Fy as Nt,QV as Ot,QW as Qt,Fc as Gt,F9 as Ce,Pw as zt,ED as Zt,QX as _e,F_ as Ee,G6 as Vt,QY as Ht,QZ as G,Q_ as Wt,Q$ as Ne,R0 as Jt,R1 as Oe,R2 as Qe,Fo as le,bu as qt,bK as ge,cI as he,fD as Ge,fB as ze,R3 as Kt,fy as Xt,PJ as Yt,R4 as en,R5 as Ze,PN as tn,Qv as nn,R6 as an,QI as sn,G3 as we,G2 as on,R7 as rn,R8 as ln,R9 as mn,Ra as cn,Rb as dn,Qg as un,FV as pn,FZ as bn,bs as gn,bJ as hn,cC as fn,cq as Sn,bt as In,LZ as Rn,cS as yn,cV as kn,cU as vn,cB as An}from"./zeni-epic-state-BkEKIYbX.js";import{w as Ve,K as He,C as ee,G as E,z as $,b$ as We,D as te,d as v,aM as xe,o as D,au as X,J as Cn,a as Je,c0 as En,s as z,a0 as qe,c1 as wn,k as ne,c2 as xn,Z as Bn,F as Tn,B as fe,f as Ke,a9 as jn,bn as Dn,a4 as Fn,y as Xe,c3 as Un,i as Ln}from"./index-DG5dsziC.js";import{n as N,S as Pn}from"./mui-CdxnWIp4.js";import me from"./NotFoundScreen-6c0jfbLt.js";import{S as Be}from"./SetupPagesScreen-B8WYHzUu.js";import{F as Ye}from"./FeaturePreviewScreen-BfuOs-n9.js";import{a as f}from"./sentry-B06otMHd.js";import{u as Se}from"./useAskAiCfoHostNavButtonProps-CFgUcHmD.js";import{u as et}from"./useInitialThreadRequest-Dc7yU2XH.js";import{D as $n}from"./DrawerScreen-DbaoUmyp.js";import{M as tt}from"./MobileAppDrawer-BVsx0d52.js";import{R as Mn}from"./ReimbursementApprovalRoutes-D6a0suIn.js";import{FallBackRoute as _n}from"./ScreenRoutes-foz6ng2P.js";import"./recharts-CFinCL-a.js";import"./analytics-CMhYvjgp.js";import"./plaid-DtXw88Ai.js";import"./dnd-DD1NomKe.js";import"./stripe-DMRn4zHo.js";import"./lottie-iCzPfqr5.js";import"./lexical-CkYiXWk9.js";import"./pdf-C9PyNDT1.js";import"./utils-CaYSR2MR.js";import"./analyticsHelper-D86wGf3h.js";import"./routePaths-C7myDwxn.js";import"./BusinessVerificationPageScreen-CzDFv09Y.js";import"./ReimbursementApprovalRuleDetailScreen-LSfhRsMC.js";import"./getLocaleForTenant-B67NSzYh.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]="e1be49b4-8405-40c7-b012-0cbca394bb78",e._sentryDebugIdIdentifier="sentry-dbid-e1be49b4-8405-40c7-b012-0cbca394bb78")}catch{}})();const nt=e=>`/${e}/reimbursements`,Nn=e=>f.createElement("svg",{viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",...e},f.createElement("path",{d:"M12.5 3.5L3.5 12.5",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round"}),f.createElement("path",{d:"M12.5 12.5L3.5 3.5",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round"})),{spendManagement:{reimbursement:{reimbursementDetail:U}}}=Je.getLocalizedStrings(),On=J(function(e,t){const n=t.currentTenant?.companyId,r=ut(e.plaidAccountViewState,"user_reimbursement_account"),d=$.getSignedInUser(),c=be(d),m=r.plaidConnectionDetails,o=Ue(e.companyState,n),a=e.tenantState.currentTenantId,i={userId:d?.userId??"",sessionId:d?.zeniSessionId??"",tenantId:a??""},l=ue(e,t.reimbursementId),b=pt(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=bt(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:v,bankAccountToCreate:l.bankAccountToCreate,fetchBankNameByRoutingStatus:l.fetchBankNameByRoutingStatus,isSignedInUserReimbursementCreator:h,disableInternalOverlay:t.disableInternalOverlay,showSkipAutoFill:t.showSkipAutoFill,setShowSkipAutoFill:t.setShowSkipAutoFill,isAccountingClassesEnabled:Le(e)}},function(e,t){const{reimbursementId:n,currentTenant:r,location:d,navigate:c,themeState:m}=t,{tenantEmailDomain:o}=r,a=$.getSignedInUser();return{onReceiptsUpload:(i,l,b)=>{i!=null&&e(re(i,l,b,n,a?.userId))},onExistingMerchantChange:(i,l)=>{e(Ae(!1,l,n,i,void 0))},fetchDuplicateReimbursement:()=>{a?.userId!=null&&e(Pt(a.userId,!0,n))},clearDuplicateReimbursementDetail:()=>{e(Lt())},clearRemiSaveStatus:()=>{e(Ut("Not-Started",n))},onDuplicateLineClick:(i,l)=>window.open(`/${o}/reimbursement/${i}#L${l}`),onNewMerchantChange:(i,l)=>{e(Ae(!1,l,n,void 0,i))},removeFileFromLine:i=>{e(Ft({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(Tt({reimbursementId:b,lineId:l,amountPayload:{amount:i.amount,currency_code:i.currencyCode,currency_symbol:i.currencySymbol}}))},onReimbursementDetailsChanged:i=>{e(Bt({remiDetailLocalData:i,reimbursementId:n}))},saveRemiDetails:i=>{e(ve(i,!1,n))},onUserBankDetailsUpdated:i=>{const{bankAccountSection:l}=i;e(xt({data:l}))},onFetchBankName:i=>{e(wt(i))},submitRemiDetails:()=>{e(ve("pending_approval",!0,n))},discardReimbursementDetailsFromLocalStore:i=>{e(Et({reimbursementId:i}))},updateInvoiceUploadFetchState:i=>{e(oe({reimbursementId:n,fetchState:i}))},clearTentativeNameForLine:i=>{e(Ct({reimbursementId:n,lineId:i}))},removeDuplicateReimbursementForLine:i=>{e(At({lineId:i}))},onZeniLogoClick:()=>{m.toggle()},clearAddRemiAutoFields:i=>{e(vt({reimbursementId:n,lineId:i}))},redirectToReimbursementListScreen:()=>{e($e()),e(kt());const i=nt(o),l=z(d.state?.pathnameStackToGoBack,d.pathname);c(i,{state:{pathnameStackToGoBack:l}})},redirectToReimbursementDetailScreen:()=>{t.navigate("../")},deleteReimbursement:()=>{n!=null&&(v.trackReimbursementDeleteReimbursement(n),e(Pe(n)))},onSaveBankAccount:()=>{a?.userId&&e(yt(a?.userId,n))},onFetchLinkTokenClick:i=>{e(Rt("user_reimbursement_account",i))},onEstablishConnectionClick:i=>{e(It(i,r.companyId,"user_reimbursement_account",void 0,"link_account_no_microdeposit"))},deleteBankAccount:i=>{e(St(i,a?.userId??""))},onBackClickFromBankAccountPage:()=>{e(ht({fetchState:"Not-Started"})),e(ft())},customerSearchAutoCompleteActions:{onAutoCompleteInputChange:(i,l)=>{i.trim().length>=2?e(gt({searchString:i,entityType:l,searchOrigin:"common"})):e(ke("common"))},onCancelAutoComplete:()=>{e(ke("common"))}}}})(En);function Te(){const e=W(),t=de(),n=Z(),{reimbursementId:r}=Y(),d=Ve(),c=He(),[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=Z().pathname,j=x.includes("edit"),k=x.includes("reimbursement/new"),[F,B]=f.useState(!1),A=$.getSignedInUser(),I=w(p=>V(p)),g=w(p=>ue(p,r)),L=et(I?.companyId,{clearParams:g.fetchState==="Completed"}),P=pe(I?.userRole??[]);f.useEffect(()=>{(k&&!F||j&&g.fetchState!="Completed"&&g.fetchState!="In-Progress")&&(B(!0),t(Fe(!1,b,y,r)))});const M=w(p=>dt(p.accountState,p.accountListState,"reimbursementAccountList"));if(A==null)throw Error("Can't access address page without signing in...");const R={pathname:`../${r}`,search:n.search};return g.isDeleted===!0||g.billStage=="paid"||g.billStage=="scheduled"||g.fetchState=="Not-Started"||P&&g.billStatus==="rejected"||P===!1&&g.billStage==="pending_approval"&&g.billStatus!=="rejected"?s.jsx(_,{to:R}):g.deleteStatus.fetchState==="In-Progress"||g.fetchState!=="Completed"?s.jsx(We,{isNewReimbursement:r==null}):s.jsxs(Qn,{windowSize:c,children:[s.jsx(te,{analytics:v,onLoad:p=>(H=>{r!=null&&g.deleteStatus.fetchState!=="Completed"&&H.trackReimbursementEditReimbursement(r)})(p)}),m&&c!=="small"?s.jsx(Gn,{}):null,m&&c!=="small"?s.jsx(zn,{children:s.jsx(xe,{showAutofill:m,uploadInvoiceEndPoint:`${X.communicationAgentMicroServiceBaseUrl}`,authParams:{userId:A?.userId??"",sessionId:A?.zeniSessionId??"",tenantId:I?.tenantId??""},onSkipAutofill:()=>o(!1),onInvoiceUpload:p=>{p!=null&&t(re(p,a,!0,r,A?.userId))},updateInvoiceUploadFetchState:p=>{t(oe({reimbursementId:r,fetchState:p}))},allowMultiFiles:m,showInfoText:!1,type:"reimbursement",style:{width:"100%",paddingTop:"78px",paddingRight:D.sp3,paddingBottom:"15px",paddingLeft:D.sp5},dropFilePlaceholder:{upload:U.dropReceipt.upload,single:U.dropReceipt.single,or:U.dropReceipt.or,multiple:U.dropReceipt.multiple,receipts:U.dropReceipt.receipts}})}):null,m&&c==="small"?s.jsxs(Zn,{children:[s.jsx(Vn,{onClick:()=>o(!1),children:s.jsx(Nn,{})}),s.jsx(xe,{showAutofill:m,uploadInvoiceEndPoint:`${X.communicationAgentMicroServiceBaseUrl}`,authParams:{userId:A?.userId??"",sessionId:A?.zeniSessionId??"",tenantId:I?.tenantId??""},onSkipAutofill:()=>o(!1),onInvoiceUpload:p=>{p!=null&&t(re(p,a,!0,r,A?.userId))},updateInvoiceUploadFetchState:p=>{t(oe({reimbursementId:r,fetchState:p}))},allowMultiFiles:m,showInfoText:!1,type:"reimbursement",style:{width:"100%",paddingTop:D.sp5,paddingRight:D.sp3,paddingBottom:D.sp5,paddingLeft:D.sp3},dropFilePlaceholder:{upload:U.dropReceipt.upload,single:U.dropReceipt.single,or:U.dropReceipt.or,multiple:U.dropReceipt.multiple,receipts:U.dropReceipt.receipts}})]}):null,s.jsx(Hn,{windowSize:c,children:s.jsx(On,{initialOpenThreadRequest:L??void 0,isReimbursementCommentingEnabled:h,location:n,navigate:e,currentTenant:I,reimbursementId:r,themeState:d,uncategorizedAccounts:M,disableInternalOverlay:!0,showSkipAutoFill:m,setShowSkipAutoFill:o,onCurrentLineIdForUploadChange:i,isAiCfoAccessEnabled:T,onAskAiCfoClick:u})})]})}const Qn=N.div`
|
|
1
|
+
import{j as s}from"./liveblocks-DTbLGSQH.js";import{h as W,u as de,g as Z,i as Y,j as w,N as _,n as J,l as mt,o as ct,p as C}from"./core-DcS-HXN0.js";import{eW as V,QJ as ue,c7 as pe,EI as Fe,kH as dt,EV as oe,EU as re,QK as ut,bn as be,go as Ue,QL as pt,N9 as bt,kw as Le,Na as ke,Nb as gt,jr as ht,Q1 as ft,jG as St,Ew as It,ua as Rt,jy as yt,Fg as Pe,QM as $e,QN as kt,QO as vt,QP as At,QQ as Ct,QR as Et,F0 as ve,jM as wt,Qa as xt,EW as Bt,EG as Tt,QS as jt,EF as Dt,QT as Ft,EO as Ae,F4 as Ut,F3 as Lt,E$ as Pt,QU as Me,Kf as $t,bq as Mt,ER as _t,Fy as Nt,QV as Ot,QW as Qt,Fc as Gt,F9 as Ce,Pw as zt,ED as Zt,QX as _e,F_ as Ee,G6 as Vt,QY as Ht,QZ as G,Q_ as Wt,Q$ as Ne,R0 as Jt,R1 as Oe,R2 as Qe,Fo as le,bu as qt,bK as ge,cI as he,fD as Ge,fB as ze,R3 as Kt,fy as Xt,PJ as Yt,R4 as en,R5 as Ze,PN as tn,Qv as nn,R6 as an,QI as sn,G3 as we,G2 as on,R7 as rn,R8 as ln,R9 as mn,Ra as cn,Rb as dn,Qg as un,FV as pn,FZ as bn,bs as gn,bJ as hn,cC as fn,cq as Sn,bt as In,LZ as Rn,cS as yn,cV as kn,cU as vn,cB as An}from"./zeni-epic-state-D9zlxAus.js";import{w as Ve,K as He,C as ee,G as E,z as $,b$ as We,D as te,d as v,aM as xe,o as D,au as X,J as Cn,a as Je,c0 as En,s as z,a0 as qe,c1 as wn,k as ne,c2 as xn,Z as Bn,F as Tn,B as fe,f as Ke,a9 as jn,bn as Dn,a4 as Fn,y as Xe,c3 as Un,i as Ln}from"./index-DC0dQLD1.js";import{n as N,S as Pn}from"./mui-D4oYUocG.js";import me from"./NotFoundScreen-DicN0NsA.js";import{S as Be}from"./SetupPagesScreen-BwdSvHh-.js";import{F as Ye}from"./FeaturePreviewScreen-D3aqd5vk.js";import{a as f}from"./sentry--iMGn_c-.js";import{u as Se}from"./useAskAiCfoHostNavButtonProps-CvQ724tN.js";import{u as et}from"./useInitialThreadRequest-zbm4ek8Z.js";import{D as $n}from"./DrawerScreen-VzjRjwq9.js";import{M as tt}from"./MobileAppDrawer-DmvUd-9k.js";import{R as Mn}from"./ReimbursementApprovalRoutes-FCPg3UiN.js";import{FallBackRoute as _n}from"./ScreenRoutes-BUNOPfus.js";import"./recharts-B-6eSeb6.js";import"./analytics-C2sLqqt-.js";import"./plaid-DnXASLGE.js";import"./dnd-D_MmPpoN.js";import"./stripe-DMRn4zHo.js";import"./lottie-XNZ0j4Vk.js";import"./lexical-BhgGR8eI.js";import"./pdf-kyzMB0kM.js";import"./utils-CiOzvYGH.js";import"./analyticsHelper-DsJZpHCL.js";import"./routePaths-CD1cpX2J.js";import"./BusinessVerificationPageScreen-4IUxwsvU.js";import"./ReimbursementApprovalRuleDetailScreen-CDZuZjie.js";import"./getLocaleForTenant-Dq62iB8Q.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]="e1be49b4-8405-40c7-b012-0cbca394bb78",e._sentryDebugIdIdentifier="sentry-dbid-e1be49b4-8405-40c7-b012-0cbca394bb78")}catch{}})();const nt=e=>`/${e}/reimbursements`,Nn=e=>f.createElement("svg",{viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",...e},f.createElement("path",{d:"M12.5 3.5L3.5 12.5",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round"}),f.createElement("path",{d:"M12.5 12.5L3.5 3.5",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round"})),{spendManagement:{reimbursement:{reimbursementDetail:U}}}=Je.getLocalizedStrings(),On=J(function(e,t){const n=t.currentTenant?.companyId,r=ut(e.plaidAccountViewState,"user_reimbursement_account"),d=$.getSignedInUser(),c=be(d),m=r.plaidConnectionDetails,o=Ue(e.companyState,n),a=e.tenantState.currentTenantId,i={userId:d?.userId??"",sessionId:d?.zeniSessionId??"",tenantId:a??""},l=ue(e,t.reimbursementId),b=pt(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=bt(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:v,bankAccountToCreate:l.bankAccountToCreate,fetchBankNameByRoutingStatus:l.fetchBankNameByRoutingStatus,isSignedInUserReimbursementCreator:h,disableInternalOverlay:t.disableInternalOverlay,showSkipAutoFill:t.showSkipAutoFill,setShowSkipAutoFill:t.setShowSkipAutoFill,isAccountingClassesEnabled:Le(e)}},function(e,t){const{reimbursementId:n,currentTenant:r,location:d,navigate:c,themeState:m}=t,{tenantEmailDomain:o}=r,a=$.getSignedInUser();return{onReceiptsUpload:(i,l,b)=>{i!=null&&e(re(i,l,b,n,a?.userId))},onExistingMerchantChange:(i,l)=>{e(Ae(!1,l,n,i,void 0))},fetchDuplicateReimbursement:()=>{a?.userId!=null&&e(Pt(a.userId,!0,n))},clearDuplicateReimbursementDetail:()=>{e(Lt())},clearRemiSaveStatus:()=>{e(Ut("Not-Started",n))},onDuplicateLineClick:(i,l)=>window.open(`/${o}/reimbursement/${i}#L${l}`),onNewMerchantChange:(i,l)=>{e(Ae(!1,l,n,void 0,i))},removeFileFromLine:i=>{e(Ft({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(Tt({reimbursementId:b,lineId:l,amountPayload:{amount:i.amount,currency_code:i.currencyCode,currency_symbol:i.currencySymbol}}))},onReimbursementDetailsChanged:i=>{e(Bt({remiDetailLocalData:i,reimbursementId:n}))},saveRemiDetails:i=>{e(ve(i,!1,n))},onUserBankDetailsUpdated:i=>{const{bankAccountSection:l}=i;e(xt({data:l}))},onFetchBankName:i=>{e(wt(i))},submitRemiDetails:()=>{e(ve("pending_approval",!0,n))},discardReimbursementDetailsFromLocalStore:i=>{e(Et({reimbursementId:i}))},updateInvoiceUploadFetchState:i=>{e(oe({reimbursementId:n,fetchState:i}))},clearTentativeNameForLine:i=>{e(Ct({reimbursementId:n,lineId:i}))},removeDuplicateReimbursementForLine:i=>{e(At({lineId:i}))},onZeniLogoClick:()=>{m.toggle()},clearAddRemiAutoFields:i=>{e(vt({reimbursementId:n,lineId:i}))},redirectToReimbursementListScreen:()=>{e($e()),e(kt());const i=nt(o),l=z(d.state?.pathnameStackToGoBack,d.pathname);c(i,{state:{pathnameStackToGoBack:l}})},redirectToReimbursementDetailScreen:()=>{t.navigate("../")},deleteReimbursement:()=>{n!=null&&(v.trackReimbursementDeleteReimbursement(n),e(Pe(n)))},onSaveBankAccount:()=>{a?.userId&&e(yt(a?.userId,n))},onFetchLinkTokenClick:i=>{e(Rt("user_reimbursement_account",i))},onEstablishConnectionClick:i=>{e(It(i,r.companyId,"user_reimbursement_account",void 0,"link_account_no_microdeposit"))},deleteBankAccount:i=>{e(St(i,a?.userId??""))},onBackClickFromBankAccountPage:()=>{e(ht({fetchState:"Not-Started"})),e(ft())},customerSearchAutoCompleteActions:{onAutoCompleteInputChange:(i,l)=>{i.trim().length>=2?e(gt({searchString:i,entityType:l,searchOrigin:"common"})):e(ke("common"))},onCancelAutoComplete:()=>{e(ke("common"))}}}})(En);function Te(){const e=W(),t=de(),n=Z(),{reimbursementId:r}=Y(),d=Ve(),c=He(),[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=Z().pathname,j=x.includes("edit"),k=x.includes("reimbursement/new"),[F,B]=f.useState(!1),A=$.getSignedInUser(),I=w(p=>V(p)),g=w(p=>ue(p,r)),L=et(I?.companyId,{clearParams:g.fetchState==="Completed"}),P=pe(I?.userRole??[]);f.useEffect(()=>{(k&&!F||j&&g.fetchState!="Completed"&&g.fetchState!="In-Progress")&&(B(!0),t(Fe(!1,b,y,r)))});const M=w(p=>dt(p.accountState,p.accountListState,"reimbursementAccountList"));if(A==null)throw Error("Can't access address page without signing in...");const R={pathname:`../${r}`,search:n.search};return g.isDeleted===!0||g.billStage=="paid"||g.billStage=="scheduled"||g.fetchState=="Not-Started"||P&&g.billStatus==="rejected"||P===!1&&g.billStage==="pending_approval"&&g.billStatus!=="rejected"?s.jsx(_,{to:R}):g.deleteStatus.fetchState==="In-Progress"||g.fetchState!=="Completed"?s.jsx(We,{isNewReimbursement:r==null}):s.jsxs(Qn,{windowSize:c,children:[s.jsx(te,{analytics:v,onLoad:p=>(H=>{r!=null&&g.deleteStatus.fetchState!=="Completed"&&H.trackReimbursementEditReimbursement(r)})(p)}),m&&c!=="small"?s.jsx(Gn,{}):null,m&&c!=="small"?s.jsx(zn,{children:s.jsx(xe,{showAutofill:m,uploadInvoiceEndPoint:`${X.communicationAgentMicroServiceBaseUrl}`,authParams:{userId:A?.userId??"",sessionId:A?.zeniSessionId??"",tenantId:I?.tenantId??""},onSkipAutofill:()=>o(!1),onInvoiceUpload:p=>{p!=null&&t(re(p,a,!0,r,A?.userId))},updateInvoiceUploadFetchState:p=>{t(oe({reimbursementId:r,fetchState:p}))},allowMultiFiles:m,showInfoText:!1,type:"reimbursement",style:{width:"100%",paddingTop:"78px",paddingRight:D.sp3,paddingBottom:"15px",paddingLeft:D.sp5},dropFilePlaceholder:{upload:U.dropReceipt.upload,single:U.dropReceipt.single,or:U.dropReceipt.or,multiple:U.dropReceipt.multiple,receipts:U.dropReceipt.receipts}})}):null,m&&c==="small"?s.jsxs(Zn,{children:[s.jsx(Vn,{onClick:()=>o(!1),children:s.jsx(Nn,{})}),s.jsx(xe,{showAutofill:m,uploadInvoiceEndPoint:`${X.communicationAgentMicroServiceBaseUrl}`,authParams:{userId:A?.userId??"",sessionId:A?.zeniSessionId??"",tenantId:I?.tenantId??""},onSkipAutofill:()=>o(!1),onInvoiceUpload:p=>{p!=null&&t(re(p,a,!0,r,A?.userId))},updateInvoiceUploadFetchState:p=>{t(oe({reimbursementId:r,fetchState:p}))},allowMultiFiles:m,showInfoText:!1,type:"reimbursement",style:{width:"100%",paddingTop:D.sp5,paddingRight:D.sp3,paddingBottom:D.sp5,paddingLeft:D.sp3},dropFilePlaceholder:{upload:U.dropReceipt.upload,single:U.dropReceipt.single,or:U.dropReceipt.or,multiple:U.dropReceipt.multiple,receipts:U.dropReceipt.receipts}})]}):null,s.jsx(Hn,{windowSize:c,children:s.jsx(On,{initialOpenThreadRequest:L??void 0,isReimbursementCommentingEnabled:h,location:n,navigate:e,currentTenant:I,reimbursementId:r,themeState:d,uncategorizedAccounts:M,disableInternalOverlay:!0,showSkipAutoFill:m,setShowSkipAutoFill:o,onCurrentLineIdForUploadChange:i,isAiCfoAccessEnabled:T,onAskAiCfoClick:u})})]})}const Qn=N.div`
|
|
2
2
|
display: flex;
|
|
3
3
|
position: relative;
|
|
4
4
|
height: 100vh;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{j as p}from"./liveblocks-BxpjjfmG.js";import{g as G,h as Ce,u as ge,i as we,j as d,n as Ie,o as Se,p as H}from"./core-BjRnoVdN.js";import{eW as v,fS as w,Mq as Te,kw as K,qQ as J,rF as k,kk as Re,jo as Me,vd as W,rK as Oe,bs as ke,Mr as Ae,bn as Fe,wm as De,Ms as je,Mt as Ee,v5 as Pe,Mu as Y,Mv as ve,Mw as Le,Mx as Be,My as Ve,Mz as I,MA as A,MB as F,MC as N,MD as D,ME as j,dI as Ue,w2 as xe,vS as q,vT as $,w8 as ze,vX as Z,we as Ge,MF as He,MG as Ye,MH as Ne,MI as qe,MJ as $e,fD as Ze,fB as Qe}from"./zeni-epic-state-BkEKIYbX.js";import{R as Xe,T as Ke,V as Je,X as We,K as ea,C as ee,G as E,z as ae,Z as aa,k as sa,c as ta,_ as oa,a0 as na,D as ra,d as P,f as ia,a1 as la,s as se,a2 as ca,a3 as da,a4 as pa}from"./index-DG5dsziC.js";import"./mui-CdxnWIp4.js";import fa from"./NotFoundScreen-6c0jfbLt.js";import{F as ma}from"./FeaturePreviewScreen-BfuOs-n9.js";import{a as _}from"./sentry-B06otMHd.js";import{u as ua}from"./useInitialThreadRequest-Dc7yU2XH.js";import{t as Q,a as X,b as _a}from"./routePaths-C7myDwxn.js";import{M as ha}from"./MobileAppDrawer-BVsx0d52.js";import"./recharts-CFinCL-a.js";import"./analytics-CMhYvjgp.js";import"./plaid-DtXw88Ai.js";import"./dnd-DD1NomKe.js";import"./stripe-DMRn4zHo.js";import"./lottie-iCzPfqr5.js";import"./lexical-CkYiXWk9.js";import"./pdf-C9PyNDT1.js";import"./utils-CaYSR2MR.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]="7825e39e-69cc-4864-9b10-494b82656038",e._sentryDebugIdIdentifier="sentry-dbid-7825e39e-69cc-4864-9b10-494b82656038")}catch{}})();const ba=["profit_loss","balance_sheet","cash_flow"],y=e=>{e(j({resetLeftScroll:!0})),e(D({resetLeftScroll:!0})),e(F({resetLeftScroll:!0})),e(A({resetLeftScroll:!0}))},ya=e=>{e(Ye()),e(Ne()),e(qe()),e($e())},Ca=Ie(function(e){const o=ae.getSignedInUser(),f=e.tenantState.currentTenantId,u=v(e),a=u?.companyName??"",s={userId:o?.userId??"",sessionId:o?.zeniSessionId??"",tenantId:f??""},t=w(e),r=Ae(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:J(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(k(o.signedInUser.userId,!0,!1))},updateDownloadStateHandler:a=>{e(He(a))},onTimeframeSelectionChanged:(a,s,t)=>{if(e(Ge(a)),s){const{isCompareModeOn:r,filter:l}=o,{additionalBalances:m,balancesRange:c}=l;let i=[...m];a==="year"&&(i=i.filter(C=>C!=="this_period_vs_same_period_last_year"&&C!=="this_period_vs_same_period_last_year_percent"&&C!=="same_period_last_year")),e(q(o.firstMonthOfFY,r,c.numberOfPeriods<1?1:c.numberOfPeriods,i)),m.length>0&&e($(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(Z({numberOfPeriods:1,orderBy:"ascending_date"})),a!=="profit_and_loss"&&a!=="profit_and_loss_by_classes"&&s==="profit_and_loss_by_classes"&&t==="horizontal"&&e(Y({classViewLayout:"vertical"})),y(e)},onCOABalancesRangeChanged:(a,s)=>{e(Z(a,s)),y(e)},onThisPeriodChanged:(a,s,t)=>{e(ze(o.firstMonthOfFY,a,s<1?1:s)),t!==!0&&y(e)},onAdditionalBalanceSelectionChanged:(a,s,t,r)=>{e(q(o.firstMonthOfFY,a,t<1?1:t,s)),s.length>0&&e($(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(N({scrollPosition:s}));break;case"balance_sheet":e(F({scrollPosition:s}));break;case"cash_flow":e(A({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(N({nodeCollapseState:{nodeId:s,isCollapsed:t}}));break;case"balance_sheet":e(F({nodeCollapseState:{nodeId:s,isCollapsed:t}}));break;case"cash_flow":e(A({nodeCollapseState:{nodeId:s,isCollapsed:t}}));break;default:console.log(`Collapse state toggle for ${a} is not handled`)}},onBackClick:()=>{f("../../")},onUpdateAccountViewMode:a=>{e(Be({viewMode:a})),e(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(Le({classesToFilterOut:a}))},onUpdateProjectsToFilterOut:a=>{e(ve({projectsToFilterOut:a}))},onUpdateClassViewLayout:a=>{e(Y({classViewLayout:a}))},onOpenAccountViewMode:()=>{o.isAccountingClassesEnabled&&e(Pe()),o.isAccountingProjectsEnabled&&e(W())},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 ga(){const{isAiCfoOpen:e,setIsAiCfoOpen:o}=We(),f=ea(),u=da(f),a=Ce(),s=ge(),t=G(),{tenantEmailDomain:r}=we(),{useFeatureGate:l}=ee(),{isFeatureEnabled:m}=l(E.isReportsHorizontalClassLayoutSwitchEnabled),c=ae.getSignedInUser(),[i,C]=_.useState(!1),[L,te]=_.useState(!1),{isFeatureEnabled:B}=l(E.isReportsCommentingEnabled);if(c==null)throw Error("Can't access reports page without signing in...");const T=d(n=>v(n)),oe=T.masterTOSInfo?.isMasterTOSAccepted??!1,ne=T.company?.companyInfo.firstMonthOfFY??1,re=ua(B?T?.companyId:void 0),g=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=>J(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&&(C(!0),s(k(c.userId,!0,!0,!1)))},[i,c,s,h]),_.useEffect(()=>{i&&!L&&g==="Completed"&&h&&(s(k(c.userId,!1,!0,!1)),te(!0))},[i,L,g,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(W());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&&ke(U?.loggedInUserRole)!==!0,[pe,fe]=_.useState(!1),x=n=>{fe(n)},me=ta(),ue=oa();return function(n){const{isDataReady:_e}=n,{pathname:he}=G(),z=Xe(he??"")==="reports",be=Ke(_e),ye=_.useMemo(()=>z?ba:void 0,[z]);Je({canFetchSuggestedQuestions:be,pageContexts:ye})}({isDataReady:g==="Completed"}),na({isDataReady:g==="Completed"}),p.jsxs(p.Fragment,{children:[g==="Completed"?p.jsx(ra,{analytics:P,onLoad:n=>n.trackPageLoaded(ia.Event.reports)}):null,p.jsx(ha,{isAppContentDrawerOpen:pe,handleDrawerToggle:x}),p.jsx(Ca,{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:B,initialOpenThreadRequest:re})]})}const S=e=>{switch(e){case"profit_and_loss":return"Profit & Loss";case"balance_sheet":return"Balance Sheet";case"cash_flow":return"Cash Flow";default:return"Reports"}};function za(){const e=d(s=>v(s)),{useFeatureGate:o}=ee(),{isFeatureEnabled:f}=o(E.isDebitCardFeatureEnabled),u=Ze(f,e),a=Qe(e);return u===!0||a===!0?p.jsx(ma,{}):p.jsxs(Se,{children:[p.jsx(H,{path:"/",element:p.jsx(ga,{})}),p.jsx(H,{path:"*",element:p.jsx(fa,{})})]})}export{za as default};
|
|
1
|
+
import{j as p}from"./liveblocks-DTbLGSQH.js";import{g as G,h as Ce,u as ge,i as we,j as d,n as Ie,o as Se,p as H}from"./core-DcS-HXN0.js";import{eW as v,fS as w,Mq as Te,kw as K,qQ as J,rF as k,kk as Re,jo as Me,vd as W,rK as Oe,bs as ke,Mr as Ae,bn as Fe,wm as De,Ms as je,Mt as Ee,v5 as Pe,Mu as Y,Mv as ve,Mw as Le,Mx as Be,My as Ve,Mz as I,MA as A,MB as F,MC as N,MD as D,ME as j,dI as Ue,w2 as xe,vS as q,vT as $,w8 as ze,vX as Z,we as Ge,MF as He,MG as Ye,MH as Ne,MI as qe,MJ as $e,fD as Ze,fB as Qe}from"./zeni-epic-state-D9zlxAus.js";import{R as Xe,T as Ke,V as Je,X as We,K as ea,C as ee,G as E,z as ae,Z as aa,k as sa,c as ta,_ as oa,a0 as na,D as ra,d as P,f as ia,a1 as la,s as se,a2 as ca,a3 as da,a4 as pa}from"./index-DC0dQLD1.js";import"./mui-D4oYUocG.js";import fa from"./NotFoundScreen-DicN0NsA.js";import{F as ma}from"./FeaturePreviewScreen-D3aqd5vk.js";import{a as _}from"./sentry--iMGn_c-.js";import{u as ua}from"./useInitialThreadRequest-zbm4ek8Z.js";import{t as Q,a as X,b as _a}from"./routePaths-CD1cpX2J.js";import{M as ha}from"./MobileAppDrawer-DmvUd-9k.js";import"./recharts-B-6eSeb6.js";import"./analytics-C2sLqqt-.js";import"./plaid-DnXASLGE.js";import"./dnd-D_MmPpoN.js";import"./stripe-DMRn4zHo.js";import"./lottie-XNZ0j4Vk.js";import"./lexical-BhgGR8eI.js";import"./pdf-kyzMB0kM.js";import"./utils-CiOzvYGH.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]="7825e39e-69cc-4864-9b10-494b82656038",e._sentryDebugIdIdentifier="sentry-dbid-7825e39e-69cc-4864-9b10-494b82656038")}catch{}})();const ba=["profit_loss","balance_sheet","cash_flow"],y=e=>{e(j({resetLeftScroll:!0})),e(D({resetLeftScroll:!0})),e(F({resetLeftScroll:!0})),e(A({resetLeftScroll:!0}))},ya=e=>{e(Ye()),e(Ne()),e(qe()),e($e())},Ca=Ie(function(e){const o=ae.getSignedInUser(),f=e.tenantState.currentTenantId,u=v(e),a=u?.companyName??"",s={userId:o?.userId??"",sessionId:o?.zeniSessionId??"",tenantId:f??""},t=w(e),r=Ae(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:J(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(k(o.signedInUser.userId,!0,!1))},updateDownloadStateHandler:a=>{e(He(a))},onTimeframeSelectionChanged:(a,s,t)=>{if(e(Ge(a)),s){const{isCompareModeOn:r,filter:l}=o,{additionalBalances:m,balancesRange:c}=l;let i=[...m];a==="year"&&(i=i.filter(C=>C!=="this_period_vs_same_period_last_year"&&C!=="this_period_vs_same_period_last_year_percent"&&C!=="same_period_last_year")),e(q(o.firstMonthOfFY,r,c.numberOfPeriods<1?1:c.numberOfPeriods,i)),m.length>0&&e($(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(Z({numberOfPeriods:1,orderBy:"ascending_date"})),a!=="profit_and_loss"&&a!=="profit_and_loss_by_classes"&&s==="profit_and_loss_by_classes"&&t==="horizontal"&&e(Y({classViewLayout:"vertical"})),y(e)},onCOABalancesRangeChanged:(a,s)=>{e(Z(a,s)),y(e)},onThisPeriodChanged:(a,s,t)=>{e(ze(o.firstMonthOfFY,a,s<1?1:s)),t!==!0&&y(e)},onAdditionalBalanceSelectionChanged:(a,s,t,r)=>{e(q(o.firstMonthOfFY,a,t<1?1:t,s)),s.length>0&&e($(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(N({scrollPosition:s}));break;case"balance_sheet":e(F({scrollPosition:s}));break;case"cash_flow":e(A({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(N({nodeCollapseState:{nodeId:s,isCollapsed:t}}));break;case"balance_sheet":e(F({nodeCollapseState:{nodeId:s,isCollapsed:t}}));break;case"cash_flow":e(A({nodeCollapseState:{nodeId:s,isCollapsed:t}}));break;default:console.log(`Collapse state toggle for ${a} is not handled`)}},onBackClick:()=>{f("../../")},onUpdateAccountViewMode:a=>{e(Be({viewMode:a})),e(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(Le({classesToFilterOut:a}))},onUpdateProjectsToFilterOut:a=>{e(ve({projectsToFilterOut:a}))},onUpdateClassViewLayout:a=>{e(Y({classViewLayout:a}))},onOpenAccountViewMode:()=>{o.isAccountingClassesEnabled&&e(Pe()),o.isAccountingProjectsEnabled&&e(W())},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 ga(){const{isAiCfoOpen:e,setIsAiCfoOpen:o}=We(),f=ea(),u=da(f),a=Ce(),s=ge(),t=G(),{tenantEmailDomain:r}=we(),{useFeatureGate:l}=ee(),{isFeatureEnabled:m}=l(E.isReportsHorizontalClassLayoutSwitchEnabled),c=ae.getSignedInUser(),[i,C]=_.useState(!1),[L,te]=_.useState(!1),{isFeatureEnabled:B}=l(E.isReportsCommentingEnabled);if(c==null)throw Error("Can't access reports page without signing in...");const T=d(n=>v(n)),oe=T.masterTOSInfo?.isMasterTOSAccepted??!1,ne=T.company?.companyInfo.firstMonthOfFY??1,re=ua(B?T?.companyId:void 0),g=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=>J(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&&(C(!0),s(k(c.userId,!0,!0,!1)))},[i,c,s,h]),_.useEffect(()=>{i&&!L&&g==="Completed"&&h&&(s(k(c.userId,!1,!0,!1)),te(!0))},[i,L,g,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(W());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&&ke(U?.loggedInUserRole)!==!0,[pe,fe]=_.useState(!1),x=n=>{fe(n)},me=ta(),ue=oa();return function(n){const{isDataReady:_e}=n,{pathname:he}=G(),z=Xe(he??"")==="reports",be=Ke(_e),ye=_.useMemo(()=>z?ba:void 0,[z]);Je({canFetchSuggestedQuestions:be,pageContexts:ye})}({isDataReady:g==="Completed"}),na({isDataReady:g==="Completed"}),p.jsxs(p.Fragment,{children:[g==="Completed"?p.jsx(ra,{analytics:P,onLoad:n=>n.trackPageLoaded(ia.Event.reports)}):null,p.jsx(ha,{isAppContentDrawerOpen:pe,handleDrawerToggle:x}),p.jsx(Ca,{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:B,initialOpenThreadRequest:re})]})}const S=e=>{switch(e){case"profit_and_loss":return"Profit & Loss";case"balance_sheet":return"Balance Sheet";case"cash_flow":return"Cash Flow";default:return"Reports"}};function za(){const e=d(s=>v(s)),{useFeatureGate:o}=ee(),{isFeatureEnabled:f}=o(E.isDebitCardFeatureEnabled),u=Ze(f,e),a=Qe(e);return u===!0||a===!0?p.jsx(ma,{}):p.jsxs(Se,{children:[p.jsx(H,{path:"/",element:p.jsx(ga,{})}),p.jsx(H,{path:"*",element:p.jsx(fa,{})})]})}export{za as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{j as a}from"./liveblocks-
|
|
1
|
+
import{j as a}from"./liveblocks-DTbLGSQH.js";import{z as b,D as C,d as u,f as N,d7 as S,C as E,G as k}from"./index-DC0dQLD1.js";import"./mui-D4oYUocG.js";import g from"./NotFoundScreen-DicN0NsA.js";import{a as c}from"./sentry--iMGn_c-.js";import{u as I,j as h,h as F,g as T,n as L,o as U,p as f,N as y}from"./core-DcS-HXN0.js";import{eW as _,TB as j,TC as p,vJ as P,fJ as V,TD as G,vH as J}from"./zeni-epic-state-D9zlxAus.js";import"./recharts-B-6eSeb6.js";import"./analytics-C2sLqqt-.js";import"./plaid-DnXASLGE.js";import"./dnd-D_MmPpoN.js";import"./stripe-DMRn4zHo.js";import"./lottie-XNZ0j4Vk.js";import"./lexical-BhgGR8eI.js";import"./pdf-kyzMB0kM.js";import"./utils-CiOzvYGH.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]="e22cf382-851b-4956-b380-4fc93bd8f2f7",e._sentryDebugIdIdentifier="sentry-dbid-e22cf382-851b-4956-b380-4fc93bd8f2f7")}catch{}})();const z=L(function(e,t){const n=j(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=b.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])}),u.trackInviteEmailClicked("send",s,r,s.length)}e(J())},onUpdateInviteFormLocalData:s=>{e(G({localData:s}))},onSubmitSuccess:()=>{e(p())},onCancelClick:()=>{i!=null&&u.trackInviteEmailClicked("cancel")}}})(S),B=()=>{const e=I(),[t,n]=c.useState(!1),[i,s]=c.useState(!1),r=h(o=>_(o)),m=F(),v=T(),d=b.getSignedInUser();if(d==null)throw Error("Can't access invite referral screen without signing in...");const l=h(o=>j(o)),w=d?.firstName!=null?d.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 x=r.company?.companyInfo.companyLegalName??r.companyName;return a.jsxs(a.Fragment,{children:[l.fetchState==="Completed"?a.jsx(C,{analytics:u,onLoad:o=>(D=>D.trackPageLoaded(N.Event.inviteEmailViewed))(o)}):null,a.jsx(z,{navigate:m,location:v,currentTenant:r,companyName:x,userName:w,inviteFormCompayData:l.localData})]})};function ne(){const{useFeatureGate:e}=E(),{isFeatureEnabled:t}=e(k.isReferralFeatureEnabled);return a.jsxs(U,{children:[a.jsx(f,{path:"/",element:a.jsx(y,{to:"refer",replace:!0})}),a.jsx(f,{path:"how-it-works",element:a.jsx(y,{to:"refer",replace:!0})}),a.jsx(f,{path:"refer/*",element:t?a.jsx(B,{}):a.jsx(g,{})}),a.jsx(f,{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 ls,eW as us,fD as ds,fB as cs,gj as ms,fq as _s,cW as pe,cC as hs,fT as Es,cu as ps,bE as Rs,bo as xs,fX as gs,v as Is,LY as js,bs as Ts,LZ as As,bK as fs,bJ as bs,bt as Ds,cq as ys,L_ as Cs,L$ as vs,cS as Us,cV as ws,cU as Os,cB as Ps,cI as Fs,o8 as Re,fz as xe,gt as Ls,f$ as ge,gq as Ie,gr as je,g0 as ks}from"./zeni-epic-state-BkEKIYbX.js";import{j as e}from"./liveblocks-BxpjjfmG.js";import{a as O}from"./sentry-B06otMHd.js";import{u as Hs,h as Bs,i as Vs,g as Ss,j as z,l as Te,N as u,o as Ns,p as a}from"./core-BjRnoVdN.js";import{y as Zs,u as Ms,z as b,C as zs,c as Gs,A as $s,G,i as Ws,W as qs,k as Ys,L as F,a as Ae,t as _,P as Js,d as Q,l}from"./index-DG5dsziC.js";import"./mui-CdxnWIp4.js";import{f as fe}from"./analyticsHelper-D86wGf3h.js";import{t as Ks}from"./getLocaleForTenant-B67NSzYh.js";import"./recharts-CFinCL-a.js";import"./analytics-CMhYvjgp.js";import"./plaid-DtXw88Ai.js";import"./dnd-DD1NomKe.js";import"./stripe-DMRn4zHo.js";import"./lottie-iCzPfqr5.js";import"./lexical-CkYiXWk9.js";import"./pdf-C9PyNDT1.js";import"./utils-CaYSR2MR.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]="96fd1b0a-8d9f-400a-a06b-b357b5e81b68",o._sentryDebugIdIdentifier="sentry-dbid-96fd1b0a-8d9f-400a-a06b-b357b5e81b68")}catch{}})();const Xs={dashboard:()=>t(()=>import("./DashboardRoutes-D_nR7gnV.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-DoSwk72T.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-Bh9_hMkC.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-DqRETwf-.js"),__vite__mapDeps([32,1,2,3,4,5,6,7,8,9,10,11,12,33,20])),settings:()=>t(()=>import("./SettingsRoutes-fWbhF4uP.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-vW__-mqO.js"),__vite__mapDeps([42,1,2,3,4,5,6,7,13,19,14,12,17,20])),chargeCards:()=>t(()=>import("./ChargeCardRoutes-D-2cGFR8.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-CeN9aIQp.js"),__vite__mapDeps([45,1,2,3,4,5,6,7,13,9,17,20])),expenseAutomation:()=>t(()=>import("./ExpenseAutomationRoutes-Bg1lugdX.js"),__vite__mapDeps([46,1,2,3,13,4,5,6,7,9,10,11,12,8,35,24,20])),treasury:()=>t(()=>import("./TreasuryRoutes-Bgqikq-u.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-CHFxSJdV.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-Chw_TTRS.js"),__vite__mapDeps([51,1,2,3,4,5,6,7,48,13,25,17,15,12,26,19,23,22,9,33,20]))},Qs=["bills","transactions","settings","reimbursement","reports","chargeCards","people"],ee=o=>{"requestIdleCallback"in window?requestIdleCallback(o):setTimeout(o,100)},et=l(()=>t(()=>import("./ReportsRoutes-vW__-mqO.js"),__vite__mapDeps([42,1,2,3,4,5,6,7,13,19,14,12,17,20]))),st=l(()=>t(()=>import("./AddressRoutes-CRqr9Fgx.js"),__vite__mapDeps([52,1,2,3,22,4,5,6,7,13,20]))),tt=l(()=>t(()=>import("./PeopleRoutes-CeN9aIQp.js"),__vite__mapDeps([45,1,2,3,4,5,6,7,13,9,17,20]))),nt=l(()=>t(()=>import("./PandLWithForecastRoutes-DWPW45GW.js"),__vite__mapDeps([53,1,2,3,4,5,6,7,13,19,9,14,12,17,20]))),at=l(()=>t(()=>import("./CustomerOnboardingRoutes-CU2s9JFJ.js"),__vite__mapDeps([54,1,2,3,22,4,5,6,7,13,37,38,39,40,41,11,36,44,20]))),ot=l(()=>t(()=>import("./VendorsRoutes-CHFxSJdV.js"),__vite__mapDeps([49,1,2,3,4,5,6,7,22,13,19,12,50,9,17,24,35,20]))),rt=l(()=>t(()=>import("./TransactionDetailRoutes-D6y-8FuE.js"),__vite__mapDeps([55,1,2,3,13,4,5,6,7,10,9,11,12,20]))),be=l(()=>t(()=>import("./EntityDetailRoutes-RWRqdoUW.js"),__vite__mapDeps([56,1,2,3,4,5,6,7,11,8,9,10,12,20]))),it=l(()=>t(()=>import("./DashboardRoutes-D_nR7gnV.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-DoSwk72T.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]))),lt=l(()=>t(()=>import("./SettingsRoutes-fWbhF4uP.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]))),ye=l(()=>t(()=>import("./ReimbursementRoutes-Bh9_hMkC.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]))),ut=l(()=>t(()=>import("./ZeniAccountRoutes-Chw_TTRS.js"),__vite__mapDeps([51,1,2,3,4,5,6,7,48,13,25,17,15,12,26,19,23,22,9,33,20]))),dt=l(()=>t(()=>import("./TreasuryRoutes-Bgqikq-u.js"),__vite__mapDeps([47,1,2,3,4,5,6,7,13,25,17,15,12,26,9,14,48,19,20]))),ct=l(()=>t(()=>import("./TransactionListRoutes-DqRETwf-.js"),__vite__mapDeps([32,1,2,3,4,5,6,7,8,9,10,11,12,33,20]))),mt=l(()=>t(()=>import("./ChargeCardRoutes-D-2cGFR8.js"),__vite__mapDeps([43,1,2,3,4,5,6,7,9,17,25,13,15,12,26,14,44,22,20]))),_t=l(()=>t(()=>import("./NotificationRoutes-m7aisVZh.js"),__vite__mapDeps([57,1,2,3,13,4,5,6,7,9,20]))),ht=l(()=>t(()=>import("./PerformanceRoutes-Dhkh0POj.js"),__vite__mapDeps([58,1,2,3,13,4,5,6,7,9,17,20]))),Et=l(()=>t(()=>import("./ExpenseAutomationRoutes-Bg1lugdX.js"),__vite__mapDeps([46,1,2,3,13,4,5,6,7,9,10,11,12,8,35,24,20]))),pt=l(()=>t(()=>import("./RewardsRoutes-DTUZ1AWT.js"),__vite__mapDeps([59,1,2,3,4,5,6,7,13,20]))),Rt=l(()=>t(()=>import("./TaskRoutes-Brk_g9vS.js"),__vite__mapDeps([60,1,2,3,13,4,5,6,7,14,17,61,9,20]))),xt=l(()=>t(()=>import("./AiCfoScreen-CX7E8Peo.js"),__vite__mapDeps([62,1,2,3,4,5,6,7,18,50,20]))),Ce=l(()=>t(()=>import("./CardsAiCfoScreen-eeV0SveA.js"),__vite__mapDeps([63,1,2,3,4,5,6,7,20]))),y=l(()=>t(()=>import("./NotFoundScreen-6c0jfbLt.js"),__vite__mapDeps([13,1,2,3,4,5,6,7,20]))),gt=l(()=>t(()=>import("./TaskListScreen-BNNdSA1G.js"),__vite__mapDeps([61,1,2,3,4,5,6,7,9,17,20])));function St({setTenantEmailDomain:o}){const T=Hs(),B=Bs(),{tenantEmailDomain:i}=Vs(),L=Zs().mode,{setLoading:U,clearAllLoading:C,clearLoading:k}=Ms(),v=b.getSignedInUserTenant(i)?.tenantId,I=b.getSignedInUser(),se=ls(I),$=Ss(),[V,Pe]=O.useState(!1),r=z(n=>us(n)),{useFeatureGate:N}=zs(),Z=Gs(),te=$s(),Fe=!!r.company?.companyZeniAccountInfo?.isZeniAccountEnabled,Le=r.companyTreasuryInfo?.info?.businessVerificationStatus?.code==="verified",{isFeatureEnabled:ke}=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"?ds(ne,r):void 0,J=j==="Completed"||A==="Completed"?cs(r):void 0,He=Ws(r,ke,ne),{isCardsHidden:Be}=qs(r?.tenantId),Ve=!He||!!Be,{isFeatureEnabled:Se}=N(G.isSettingsFeatureEnabled),{isFeatureEnabled:K}=N(G.isAiCfoFileUploadEnabled),W=z(n=>ms(n));if(i!=null){const n=b.getSignedInUserTenant(i);I!=null&&n!=null&&fe(I,r,L)}const M={tenantId:v,userId:I?.userId,sessionId:I?.zeniSessionId},ae=_s(),E=Ys(),Ne=r.company==null||E?.loggedInUserRoleMap!=null&&pe(E.loggedInUserRole),Ze=hs(E?.loggedInUserRoleMap),oe=O.useRef(!0),re=Te("/:tenantEmailDomain/onboarding/*")!==null,X=Te("/:tenantEmailDomain/month_end_close_checks/review/:selectedTab/:selectedPeriod/*"),Me=z(n=>M.tenantId!=null?Es(n,M.tenantId):void 0);O.useEffect(()=>{U(F.TENANT_FETCHING),o(i)},[i]),O.useEffect(()=>{if(X!=null&&v!=null){const n=X.params.selectedPeriod;if(n!=null){const f=n.split("-");if(f.length===2){const d=ps(Number(f[0])),s=Number(f[1]),c=Rs(`01-${d<10?`0${d}`:d}-${s}`,Ae.getLocalizedStrings().dateFormat.analytics.DDDashMMDashYYYY),S=xs();c.isAfter(S,"month")===!1?T(gs(v,{month:d,year:s})):B("./month_end_close_checks/review")}}}},[X,v]),O.useEffect(()=>{V||(Pe(!0),U(F.TENANT_FETCHING)),oe.current?oe.current=!1:!Is(ae,M)&&b.isSignedIn()&&(U(F.TENANT_FETCHING),function(n,f,d,s){if(xe(f?.userId,f?.zeniSessionId,n.tenantId),d(Ls(!0)),d(ge(n.tenantId)),n.tenantId!=null&&_.clearTenant(n.tenantId),n.tenantId!=null){const c=b.getSignedInUserTenantWithId(n.tenantId);s&&Ae.updateAppLocaleID(Ks(s)),c?.tenantEmailDomain!=null&&b.saveActiveTenantDomainForUser(c?.tenantEmailDomain)}n.userId!=null?Q.identify(n.userId,{tenant_id:n.tenantId}):Q.resetUserIdentity()}(M,I,T,Me))},[M,ae,I,T,b]),O.useEffect(()=>{b.isSignedIn()&&(U(F.TENANT_FETCHING),function(n,f,d,s,c,S,H){if(d==null&&s==null)return void console.warn("There is no current tenant selected!!");const q=s!=null&&c?.zeniSessionId!=null,os=d==null||d.tenantId!==s,rs=d!=null&&d.excludedResources==null,is=d!=null&&d.externalConnections==null;if(q&&os){H(ge(s));const Y=b.getSignedInUserTenantWithId(s);Y?.tenantEmailDomain!=null&&b.saveActiveTenantDomainForUser(Y?.tenantEmailDomain),xe(c?.userId,c?.zeniSessionId,s),_.shouldFetchExcludedResources(s)&&(_.markExcludedResourcesFetchStarted(s),H(Ie(c.userId,s))),_.shouldFetchConnections(s)&&(_.markConnectionsFetchStarted(s),H(je(c.userId,s)))}else q&&rs&&_.shouldFetchExcludedResources(s)&&(_.markExcludedResourcesFetchStarted(s),H(Ie(c.userId,s))),q&&is&&_.shouldFetchConnections(s)&&(_.markConnectionsFetchStarted(s),H(je(c.userId,s)));if(q){Q.identify(c.userId,{tenant_id:s});const Y=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),H(ks(c.userId,s,c.zeniSessionId))),Y&&(n==="Not-Started"||n==="Error")&&_.shouldFetchAllTenants()&&(_.markAllTenantsFetchStarted(),H(Re(c.userId,c.zeniSessionId)))}}(A,j,r,v,I,U,T))},[v,j]),O.useEffect(()=>{b.isSignedIn()&&A==="Completed"&&W.tenantsBaseInOrder.length>0&&(k(F.TENANT_FETCHING),b.saveSignedInUserTenants(js(W.tenantsBaseInOrder)),I!=null&&fe(I,r,L,void 0,W.tenantsBaseInOrder))},[W,A,r,I]),O.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),k(F.TENANT_FETCHING),k(F.TENANT_SWITCHING))),A!=="Completed"&&A!=="Error"||(A==="Completed"?_.markAllTenantsFetchCompleted():A==="Error"&&_.markAllTenantsFetchFailed())},[j,A,v,V]);const ie=O.useRef(!1);O.useEffect(()=>{!ie.current&&j==="Completed"&&V&&(ie.current=!0,function(n=Qs,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 w=r?.userRole!=null&&Ts(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&&!w,ue=!Ve&&!w,We=As(E?.loggedInUserRoleMap),qe=r.externalConnections?.accounting[0]?.isValid,de=r.company?.companyOnboardingInfo.isOnboardingCompleted,ce=r?.company==null||r.company.featuresActivationInfo?.isReimbursementFeatureEnabled&&!w,me=ce&&fs(E?.loggedInUserRoleMap),_e=Fe&&!w,Ye=Le&&!w,Je=le&&bs(E?.loggedInUserRoleMap),Ke=ue&&Ds(E?.loggedInUserRoleMap),Xe=_e&&ys(E?.loggedInUserRoleMap),Qe=Cs(E?.loggedInUserRoleMap),es=vs(E?.loggedInUserRoleMap),ss=Us(E?.loggedInUserRoleMap),ts=ws(E?.loggedInUserRoleMap),ns=Os(E?.loggedInUserRoleMap),p=Ps(E?.loggedInUserRoleMap),R=Fs(E?.loggedInUserRoleMap),he=le&&p,Ee=ce&&R,x=_e&&ss,g=Ye&&ts,m=ue&&ns,as=r.excludedResources?.resources?.find(n=>n.resource==="/invites")!=null||Ze===!0||We===!0||Qe===!0||es===!0;return b.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===!1&&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(Ns,{children:e.jsxs(a,{element:e.jsx(Js,{}),children:[e.jsx(a,{path:"/",element:e.jsx(It,{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(it,{}):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(et,{}):e.jsx(D,{showZeniAccountRoute:x,isUserHasBillPayAccess:p,isUserHasReimbursementAccess:R,showTreasuryRoute:g,isTenantBankingOnly:h,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(a,{path:"people/*",element:as||P?e.jsx(tt,{}):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(nt,{}):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(at,{})}),e.jsx(a,{path:"transaction/*",element:P&&w===!1||Ge||$e?e.jsx(rt,{}):e.jsx(D,{showZeniAccountRoute:x,isUserHasBillPayAccess:p,isUserHasReimbursementAccess:R,showTreasuryRoute:g,isTenantBankingOnly:h,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(a,{path:"transactions/*",element:P&&w===!1?e.jsx(ct,{}):e.jsx(D,{showZeniAccountRoute:x,isUserHasBillPayAccess:p,isUserHasReimbursementAccess:R,showTreasuryRoute:g,isTenantBankingOnly:h,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(a,{path:"customer/*",element:P&&w===!1?e.jsx(be,{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&&w===!1?e.jsx(be,{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(gt,{})}),e.jsx(a,{path:"tasks/*",element:e.jsx(Rt,{})}),e.jsx(a,{path:"address/*",element:Je||me||Xe||Ke?e.jsx(st,{}):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(ut,{}):e.jsx(y,{})}),e.jsx(a,{path:"treasury/*",element:g?e.jsx(dt,{}):e.jsx(y,{})}),e.jsx(a,{path:"performance",element:te===!0?e.jsx(ht,{}):e.jsx(Oe,{tenantEmailDomain:i})}),e.jsx(a,{path:"month_end_close_checks/review/*",element:te===!0&&w===!1?e.jsx(Et,{}):e.jsx(Oe,{tenantEmailDomain:i})}),e.jsx(a,{path:"notifications/*",element:e.jsx(_t,{})}),e.jsx(a,{path:"vendors/*",element:Ne?e.jsx(ot,{}):e.jsx(y,{})}),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(ye,{}):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(ye,{}):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(lt,{hasAdminLevelAccess:me}):e.jsx(y,{})}),e.jsx(a,{path:"cards/ask",element:m&&Z?e.jsx(Ce,{isFileUploadEnabled:K}):e.jsx(y,{})}),e.jsx(a,{path:"cards/ask/:session_id",element:m&&Z?e.jsx(Ce,{isFileUploadEnabled:K}):e.jsx(y,{})}),e.jsx(a,{path:"cards/*",element:m?e.jsx(mt,{}):e.jsx(y,{})}),e.jsx(a,{path:"rewards/*",element:ze?e.jsx(pt,{}):e.jsx(y,{})}),e.jsx(a,{path:"/ai-cfo",element:Z?e.jsx(u,{to:"explore"}):e.jsx(y,{})}),e.jsx(a,{path:"/ai-cfo/",element:Z?e.jsx(u,{to:"explore"}):e.jsx(y,{})}),e.jsx(a,{path:"/ai-cfo/:session_id",element:Z?e.jsx(xt,{isFileUploadEnabled:K}):e.jsx(y,{})}),e.jsx(a,{path:"*",element:e.jsx(y,{})})]})}):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 It=({isDashboardAccess:o,showZeniAccountRoute:T,isUserHasBillPayAccess:B,isUserHasReimbursementAccess:i,showTreasuryRoute:L,isTenantBankingOnly:U,isTenantCardsOnly:C,showChargeCardRoute:k})=>{if(U===!0){if(T)return e.jsx(u,{to:"checking"});if(L)return e.jsx(u,{to:"treasury"});if(k)return e.jsx(u,{to:"cards"})}return C===!0&&k?e.jsx(u,{to:"cards"}):o?e.jsx(u,{to:"dashboard"}):T?e.jsx(u,{to:"checking"}):L?e.jsx(u,{to:"treasury"}):k?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(we,{tenantEmailDomain:C})}return o?e.jsx(Ue,{tenantEmailDomain:C}):i?e.jsx(ve,{tenantEmailDomain:C}):U?e.jsx(we,{tenantEmailDomain:C}):T?e.jsx(Tt,{tenantEmailDomain:C}):B?e.jsx(jt,{tenantEmailDomain:C}):e.jsx(y,{})},jt=({tenantEmailDomain:o})=>e.jsx(u,{to:`/${o}/reimbursements`}),Tt=({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`}),we=({tenantEmailDomain:o})=>e.jsx(u,{to:`/${o}/cards`}),Oe=({tenantEmailDomain:o})=>e.jsx(u,{to:`/${o}/dashboard`});export{D as FallBackRoute,St as default};
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/DashboardRoutes-D_Oe_3IB.js","assets/sentry--iMGn_c-.js","assets/core-DcS-HXN0.js","assets/zeni-epic-state-D9zlxAus.js","assets/index-DC0dQLD1.js","assets/mui-D4oYUocG.js","assets/analytics-C2sLqqt-.js","assets/utils-CiOzvYGH.js","assets/withTransactionSidePanel-CcdsL6he.js","assets/useAskAiCfoHostNavButtonProps-CvQ724tN.js","assets/TransactionDetailScreen-BM6LDN-M.js","assets/decodeURIComponentSafe-HMBZoUM8.js","assets/routePaths-CD1cpX2J.js","assets/NotFoundScreen-DicN0NsA.js","assets/useInitialThreadRequest-zbm4ek8Z.js","assets/analyticsHelper-DsJZpHCL.js","assets/CompanyPassportScreen-B68PA8m9.js","assets/MobileAppDrawer-DmvUd-9k.js","assets/useAiCfoDashboardSuggestedQuestionsChips-mlw7oi_d.js","assets/FeaturePreviewScreen-D3aqd5vk.js","assets/index-BUmr5maU.css","assets/BillPayRoutes-Bwf5D0Ek.js","assets/AddressScreen-B4AZf_Bb.js","assets/DomesticWireDetailScreen-D1g6ymLx.js","assets/DrawerScreen-VzjRjwq9.js","assets/SetupPagesScreen-BwdSvHh-.js","assets/BusinessVerificationPageScreen-4IUxwsvU.js","assets/BillPayApprovalRoutes-BEMba1i2.js","assets/ReimbursementApprovalRuleDetailScreen-CDZuZjie.js","assets/getLocaleForTenant-Dq62iB8Q.js","assets/ReimbursementRoutes-i0ob4XKl.js","assets/ReimbursementApprovalRoutes-FCPg3UiN.js","assets/TransactionListRoutes-D0cyEIdU.js","assets/ZeniAccountStatementScreen-DhRygyJr.js","assets/SettingsRoutes-BkvEavBt.js","assets/accountMappingHelper-Cg-otc9W.js","assets/useEmailConnectResultRefresh-BR0ijVLk.js","assets/QBOConnectionScreen-CyRXuV7l.js","assets/empty-DOLvt4hu.js","assets/index-Fd_ZlxLV.js","assets/url-B9kBE-_j.js","assets/index-BbzLsG-V.js","assets/ReportsRoutes-CpfaB-E1.js","assets/ChargeCardRoutes-ktPwuMp3.js","assets/useChargeCardPusherEvents-CtCp4KqM.js","assets/PeopleRoutes-CCcVYPJc.js","assets/ExpenseAutomationRoutes-C7SP-bG3.js","assets/TreasuryRoutes-F8-NxpXC.js","assets/useCashManagementBanner-DewpKyRp.js","assets/VendorsRoutes-Cz8Uv4rJ.js","assets/pathToGoBack-Dj_I2yPM.js","assets/ZeniAccountRoutes-PrDQqACj.js","assets/AddressRoutes-BmKpIsRQ.js","assets/PandLWithForecastRoutes-A_vEVo_6.js","assets/CustomerOnboardingRoutes-Cv6JYdq2.js","assets/TransactionDetailRoutes-CqJldaCF.js","assets/EntityDetailRoutes-Cqud1mzd.js","assets/NotificationRoutes-DoDTRf3S.js","assets/PerformanceRoutes-2qmBImXf.js","assets/RewardsRoutes-CBafBLnP.js","assets/TaskRoutes-BZmEZp3A.js","assets/TaskListScreen-cv3YBBd9.js","assets/AiCfoScreen-CiyAYMLp.js","assets/CardsAiCfoScreen-Qy6tRjXd.js"])))=>i.map(i=>d[i]);
|
|
2
|
+
import{_ as t,bn as ls,eW as us,fD as ds,fB as cs,gj as ms,fq as _s,cW as pe,cC as hs,fT as Es,cu as ps,bE as Rs,bo as xs,fX as gs,v as Is,LY as js,bs as Ts,LZ as As,bK as fs,bJ as bs,bt as Ds,cq as ys,L_ as Cs,L$ as vs,cS as Us,cV as ws,cU as Os,cB as Ps,cI as Fs,o8 as Re,fz as xe,gt as Ls,f$ as ge,gq as Ie,gr as je,g0 as ks}from"./zeni-epic-state-D9zlxAus.js";import{j as e}from"./liveblocks-DTbLGSQH.js";import{a as O}from"./sentry--iMGn_c-.js";import{u as Hs,h as Bs,i as Vs,g as Ss,j as z,l as Te,N as u,o as Ns,p as a}from"./core-DcS-HXN0.js";import{y as Zs,u as Ms,z as b,C as zs,c as Gs,A as $s,G,i as Ws,W as qs,k as Ys,L as F,a as Ae,t as _,P as Js,d as Q,l}from"./index-DC0dQLD1.js";import"./mui-D4oYUocG.js";import{f as fe}from"./analyticsHelper-DsJZpHCL.js";import{t as Ks}from"./getLocaleForTenant-Dq62iB8Q.js";import"./recharts-B-6eSeb6.js";import"./analytics-C2sLqqt-.js";import"./plaid-DnXASLGE.js";import"./dnd-D_MmPpoN.js";import"./stripe-DMRn4zHo.js";import"./lottie-XNZ0j4Vk.js";import"./lexical-BhgGR8eI.js";import"./pdf-kyzMB0kM.js";import"./utils-CiOzvYGH.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]="96fd1b0a-8d9f-400a-a06b-b357b5e81b68",o._sentryDebugIdIdentifier="sentry-dbid-96fd1b0a-8d9f-400a-a06b-b357b5e81b68")}catch{}})();const Xs={dashboard:()=>t(()=>import("./DashboardRoutes-D_Oe_3IB.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-Bwf5D0Ek.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-i0ob4XKl.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-D0cyEIdU.js"),__vite__mapDeps([32,1,2,3,4,5,6,7,8,9,10,11,12,33,20])),settings:()=>t(()=>import("./SettingsRoutes-BkvEavBt.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-CpfaB-E1.js"),__vite__mapDeps([42,1,2,3,4,5,6,7,13,19,14,12,17,20])),chargeCards:()=>t(()=>import("./ChargeCardRoutes-ktPwuMp3.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-CCcVYPJc.js"),__vite__mapDeps([45,1,2,3,4,5,6,7,13,9,17,20])),expenseAutomation:()=>t(()=>import("./ExpenseAutomationRoutes-C7SP-bG3.js"),__vite__mapDeps([46,1,2,3,13,4,5,6,7,9,10,11,12,8,35,24,20])),treasury:()=>t(()=>import("./TreasuryRoutes-F8-NxpXC.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-Cz8Uv4rJ.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-PrDQqACj.js"),__vite__mapDeps([51,1,2,3,4,5,6,7,48,13,25,17,15,12,26,19,23,22,9,33,20]))},Qs=["bills","transactions","settings","reimbursement","reports","chargeCards","people"],ee=o=>{"requestIdleCallback"in window?requestIdleCallback(o):setTimeout(o,100)},et=l(()=>t(()=>import("./ReportsRoutes-CpfaB-E1.js"),__vite__mapDeps([42,1,2,3,4,5,6,7,13,19,14,12,17,20]))),st=l(()=>t(()=>import("./AddressRoutes-BmKpIsRQ.js"),__vite__mapDeps([52,1,2,3,22,4,5,6,7,13,20]))),tt=l(()=>t(()=>import("./PeopleRoutes-CCcVYPJc.js"),__vite__mapDeps([45,1,2,3,4,5,6,7,13,9,17,20]))),nt=l(()=>t(()=>import("./PandLWithForecastRoutes-A_vEVo_6.js"),__vite__mapDeps([53,1,2,3,4,5,6,7,13,19,9,14,12,17,20]))),at=l(()=>t(()=>import("./CustomerOnboardingRoutes-Cv6JYdq2.js"),__vite__mapDeps([54,1,2,3,22,4,5,6,7,13,37,38,39,40,41,11,36,44,20]))),ot=l(()=>t(()=>import("./VendorsRoutes-Cz8Uv4rJ.js"),__vite__mapDeps([49,1,2,3,4,5,6,7,22,13,19,12,50,9,17,24,35,20]))),rt=l(()=>t(()=>import("./TransactionDetailRoutes-CqJldaCF.js"),__vite__mapDeps([55,1,2,3,13,4,5,6,7,10,9,11,12,20]))),be=l(()=>t(()=>import("./EntityDetailRoutes-Cqud1mzd.js"),__vite__mapDeps([56,1,2,3,4,5,6,7,11,8,9,10,12,20]))),it=l(()=>t(()=>import("./DashboardRoutes-D_Oe_3IB.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-Bwf5D0Ek.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]))),lt=l(()=>t(()=>import("./SettingsRoutes-BkvEavBt.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]))),ye=l(()=>t(()=>import("./ReimbursementRoutes-i0ob4XKl.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]))),ut=l(()=>t(()=>import("./ZeniAccountRoutes-PrDQqACj.js"),__vite__mapDeps([51,1,2,3,4,5,6,7,48,13,25,17,15,12,26,19,23,22,9,33,20]))),dt=l(()=>t(()=>import("./TreasuryRoutes-F8-NxpXC.js"),__vite__mapDeps([47,1,2,3,4,5,6,7,13,25,17,15,12,26,9,14,48,19,20]))),ct=l(()=>t(()=>import("./TransactionListRoutes-D0cyEIdU.js"),__vite__mapDeps([32,1,2,3,4,5,6,7,8,9,10,11,12,33,20]))),mt=l(()=>t(()=>import("./ChargeCardRoutes-ktPwuMp3.js"),__vite__mapDeps([43,1,2,3,4,5,6,7,9,17,25,13,15,12,26,14,44,22,20]))),_t=l(()=>t(()=>import("./NotificationRoutes-DoDTRf3S.js"),__vite__mapDeps([57,1,2,3,13,4,5,6,7,9,20]))),ht=l(()=>t(()=>import("./PerformanceRoutes-2qmBImXf.js"),__vite__mapDeps([58,1,2,3,13,4,5,6,7,9,17,20]))),Et=l(()=>t(()=>import("./ExpenseAutomationRoutes-C7SP-bG3.js"),__vite__mapDeps([46,1,2,3,13,4,5,6,7,9,10,11,12,8,35,24,20]))),pt=l(()=>t(()=>import("./RewardsRoutes-CBafBLnP.js"),__vite__mapDeps([59,1,2,3,4,5,6,7,13,20]))),Rt=l(()=>t(()=>import("./TaskRoutes-BZmEZp3A.js"),__vite__mapDeps([60,1,2,3,13,4,5,6,7,14,17,61,9,20]))),xt=l(()=>t(()=>import("./AiCfoScreen-CiyAYMLp.js"),__vite__mapDeps([62,1,2,3,4,5,6,7,18,50,20]))),Ce=l(()=>t(()=>import("./CardsAiCfoScreen-Qy6tRjXd.js"),__vite__mapDeps([63,1,2,3,4,5,6,7,20]))),y=l(()=>t(()=>import("./NotFoundScreen-DicN0NsA.js"),__vite__mapDeps([13,1,2,3,4,5,6,7,20]))),gt=l(()=>t(()=>import("./TaskListScreen-cv3YBBd9.js"),__vite__mapDeps([61,1,2,3,4,5,6,7,9,17,20])));function St({setTenantEmailDomain:o}){const T=Hs(),B=Bs(),{tenantEmailDomain:i}=Vs(),L=Zs().mode,{setLoading:U,clearAllLoading:C,clearLoading:k}=Ms(),v=b.getSignedInUserTenant(i)?.tenantId,I=b.getSignedInUser(),se=ls(I),$=Ss(),[V,Pe]=O.useState(!1),r=z(n=>us(n)),{useFeatureGate:N}=zs(),Z=Gs(),te=$s(),Fe=!!r.company?.companyZeniAccountInfo?.isZeniAccountEnabled,Le=r.companyTreasuryInfo?.info?.businessVerificationStatus?.code==="verified",{isFeatureEnabled:ke}=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"?ds(ne,r):void 0,J=j==="Completed"||A==="Completed"?cs(r):void 0,He=Ws(r,ke,ne),{isCardsHidden:Be}=qs(r?.tenantId),Ve=!He||!!Be,{isFeatureEnabled:Se}=N(G.isSettingsFeatureEnabled),{isFeatureEnabled:K}=N(G.isAiCfoFileUploadEnabled),W=z(n=>ms(n));if(i!=null){const n=b.getSignedInUserTenant(i);I!=null&&n!=null&&fe(I,r,L)}const M={tenantId:v,userId:I?.userId,sessionId:I?.zeniSessionId},ae=_s(),E=Ys(),Ne=r.company==null||E?.loggedInUserRoleMap!=null&&pe(E.loggedInUserRole),Ze=hs(E?.loggedInUserRoleMap),oe=O.useRef(!0),re=Te("/:tenantEmailDomain/onboarding/*")!==null,X=Te("/:tenantEmailDomain/month_end_close_checks/review/:selectedTab/:selectedPeriod/*"),Me=z(n=>M.tenantId!=null?Es(n,M.tenantId):void 0);O.useEffect(()=>{U(F.TENANT_FETCHING),o(i)},[i]),O.useEffect(()=>{if(X!=null&&v!=null){const n=X.params.selectedPeriod;if(n!=null){const f=n.split("-");if(f.length===2){const d=ps(Number(f[0])),s=Number(f[1]),c=Rs(`01-${d<10?`0${d}`:d}-${s}`,Ae.getLocalizedStrings().dateFormat.analytics.DDDashMMDashYYYY),S=xs();c.isAfter(S,"month")===!1?T(gs(v,{month:d,year:s})):B("./month_end_close_checks/review")}}}},[X,v]),O.useEffect(()=>{V||(Pe(!0),U(F.TENANT_FETCHING)),oe.current?oe.current=!1:!Is(ae,M)&&b.isSignedIn()&&(U(F.TENANT_FETCHING),function(n,f,d,s){if(xe(f?.userId,f?.zeniSessionId,n.tenantId),d(Ls(!0)),d(ge(n.tenantId)),n.tenantId!=null&&_.clearTenant(n.tenantId),n.tenantId!=null){const c=b.getSignedInUserTenantWithId(n.tenantId);s&&Ae.updateAppLocaleID(Ks(s)),c?.tenantEmailDomain!=null&&b.saveActiveTenantDomainForUser(c?.tenantEmailDomain)}n.userId!=null?Q.identify(n.userId,{tenant_id:n.tenantId}):Q.resetUserIdentity()}(M,I,T,Me))},[M,ae,I,T,b]),O.useEffect(()=>{b.isSignedIn()&&(U(F.TENANT_FETCHING),function(n,f,d,s,c,S,H){if(d==null&&s==null)return void console.warn("There is no current tenant selected!!");const q=s!=null&&c?.zeniSessionId!=null,os=d==null||d.tenantId!==s,rs=d!=null&&d.excludedResources==null,is=d!=null&&d.externalConnections==null;if(q&&os){H(ge(s));const Y=b.getSignedInUserTenantWithId(s);Y?.tenantEmailDomain!=null&&b.saveActiveTenantDomainForUser(Y?.tenantEmailDomain),xe(c?.userId,c?.zeniSessionId,s),_.shouldFetchExcludedResources(s)&&(_.markExcludedResourcesFetchStarted(s),H(Ie(c.userId,s))),_.shouldFetchConnections(s)&&(_.markConnectionsFetchStarted(s),H(je(c.userId,s)))}else q&&rs&&_.shouldFetchExcludedResources(s)&&(_.markExcludedResourcesFetchStarted(s),H(Ie(c.userId,s))),q&&is&&_.shouldFetchConnections(s)&&(_.markConnectionsFetchStarted(s),H(je(c.userId,s)));if(q){Q.identify(c.userId,{tenant_id:s});const Y=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),H(ks(c.userId,s,c.zeniSessionId))),Y&&(n==="Not-Started"||n==="Error")&&_.shouldFetchAllTenants()&&(_.markAllTenantsFetchStarted(),H(Re(c.userId,c.zeniSessionId)))}}(A,j,r,v,I,U,T))},[v,j]),O.useEffect(()=>{b.isSignedIn()&&A==="Completed"&&W.tenantsBaseInOrder.length>0&&(k(F.TENANT_FETCHING),b.saveSignedInUserTenants(js(W.tenantsBaseInOrder)),I!=null&&fe(I,r,L,void 0,W.tenantsBaseInOrder))},[W,A,r,I]),O.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),k(F.TENANT_FETCHING),k(F.TENANT_SWITCHING))),A!=="Completed"&&A!=="Error"||(A==="Completed"?_.markAllTenantsFetchCompleted():A==="Error"&&_.markAllTenantsFetchFailed())},[j,A,v,V]);const ie=O.useRef(!1);O.useEffect(()=>{!ie.current&&j==="Completed"&&V&&(ie.current=!0,function(n=Qs,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 w=r?.userRole!=null&&Ts(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&&!w,ue=!Ve&&!w,We=As(E?.loggedInUserRoleMap),qe=r.externalConnections?.accounting[0]?.isValid,de=r.company?.companyOnboardingInfo.isOnboardingCompleted,ce=r?.company==null||r.company.featuresActivationInfo?.isReimbursementFeatureEnabled&&!w,me=ce&&fs(E?.loggedInUserRoleMap),_e=Fe&&!w,Ye=Le&&!w,Je=le&&bs(E?.loggedInUserRoleMap),Ke=ue&&Ds(E?.loggedInUserRoleMap),Xe=_e&&ys(E?.loggedInUserRoleMap),Qe=Cs(E?.loggedInUserRoleMap),es=vs(E?.loggedInUserRoleMap),ss=Us(E?.loggedInUserRoleMap),ts=ws(E?.loggedInUserRoleMap),ns=Os(E?.loggedInUserRoleMap),p=Ps(E?.loggedInUserRoleMap),R=Fs(E?.loggedInUserRoleMap),he=le&&p,Ee=ce&&R,x=_e&&ss,g=Ye&&ts,m=ue&&ns,as=r.excludedResources?.resources?.find(n=>n.resource==="/invites")!=null||Ze===!0||We===!0||Qe===!0||es===!0;return b.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===!1&&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(Ns,{children:e.jsxs(a,{element:e.jsx(Js,{}),children:[e.jsx(a,{path:"/",element:e.jsx(It,{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(it,{}):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(et,{}):e.jsx(D,{showZeniAccountRoute:x,isUserHasBillPayAccess:p,isUserHasReimbursementAccess:R,showTreasuryRoute:g,isTenantBankingOnly:h,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(a,{path:"people/*",element:as||P?e.jsx(tt,{}):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(nt,{}):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(at,{})}),e.jsx(a,{path:"transaction/*",element:P&&w===!1||Ge||$e?e.jsx(rt,{}):e.jsx(D,{showZeniAccountRoute:x,isUserHasBillPayAccess:p,isUserHasReimbursementAccess:R,showTreasuryRoute:g,isTenantBankingOnly:h,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(a,{path:"transactions/*",element:P&&w===!1?e.jsx(ct,{}):e.jsx(D,{showZeniAccountRoute:x,isUserHasBillPayAccess:p,isUserHasReimbursementAccess:R,showTreasuryRoute:g,isTenantBankingOnly:h,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(a,{path:"customer/*",element:P&&w===!1?e.jsx(be,{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&&w===!1?e.jsx(be,{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(gt,{})}),e.jsx(a,{path:"tasks/*",element:e.jsx(Rt,{})}),e.jsx(a,{path:"address/*",element:Je||me||Xe||Ke?e.jsx(st,{}):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(ut,{}):e.jsx(y,{})}),e.jsx(a,{path:"treasury/*",element:g?e.jsx(dt,{}):e.jsx(y,{})}),e.jsx(a,{path:"performance",element:te===!0?e.jsx(ht,{}):e.jsx(Oe,{tenantEmailDomain:i})}),e.jsx(a,{path:"month_end_close_checks/review/*",element:te===!0&&w===!1?e.jsx(Et,{}):e.jsx(Oe,{tenantEmailDomain:i})}),e.jsx(a,{path:"notifications/*",element:e.jsx(_t,{})}),e.jsx(a,{path:"vendors/*",element:Ne?e.jsx(ot,{}):e.jsx(y,{})}),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(ye,{}):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(ye,{}):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(lt,{hasAdminLevelAccess:me}):e.jsx(y,{})}),e.jsx(a,{path:"cards/ask",element:m&&Z?e.jsx(Ce,{isFileUploadEnabled:K}):e.jsx(y,{})}),e.jsx(a,{path:"cards/ask/:session_id",element:m&&Z?e.jsx(Ce,{isFileUploadEnabled:K}):e.jsx(y,{})}),e.jsx(a,{path:"cards/*",element:m?e.jsx(mt,{}):e.jsx(y,{})}),e.jsx(a,{path:"rewards/*",element:ze?e.jsx(pt,{}):e.jsx(y,{})}),e.jsx(a,{path:"/ai-cfo",element:Z?e.jsx(u,{to:"explore"}):e.jsx(y,{})}),e.jsx(a,{path:"/ai-cfo/",element:Z?e.jsx(u,{to:"explore"}):e.jsx(y,{})}),e.jsx(a,{path:"/ai-cfo/:session_id",element:Z?e.jsx(xt,{isFileUploadEnabled:K}):e.jsx(y,{})}),e.jsx(a,{path:"*",element:e.jsx(y,{})})]})}):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 It=({isDashboardAccess:o,showZeniAccountRoute:T,isUserHasBillPayAccess:B,isUserHasReimbursementAccess:i,showTreasuryRoute:L,isTenantBankingOnly:U,isTenantCardsOnly:C,showChargeCardRoute:k})=>{if(U===!0){if(T)return e.jsx(u,{to:"checking"});if(L)return e.jsx(u,{to:"treasury"});if(k)return e.jsx(u,{to:"cards"})}return C===!0&&k?e.jsx(u,{to:"cards"}):o?e.jsx(u,{to:"dashboard"}):T?e.jsx(u,{to:"checking"}):L?e.jsx(u,{to:"treasury"}):k?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(we,{tenantEmailDomain:C})}return o?e.jsx(Ue,{tenantEmailDomain:C}):i?e.jsx(ve,{tenantEmailDomain:C}):U?e.jsx(we,{tenantEmailDomain:C}):T?e.jsx(Tt,{tenantEmailDomain:C}):B?e.jsx(jt,{tenantEmailDomain:C}):e.jsx(y,{})},jt=({tenantEmailDomain:o})=>e.jsx(u,{to:`/${o}/reimbursements`}),Tt=({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`}),we=({tenantEmailDomain:o})=>e.jsx(u,{to:`/${o}/cards`}),Oe=({tenantEmailDomain:o})=>e.jsx(u,{to:`/${o}/dashboard`});export{D as FallBackRoute,St as default};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{j as o}from"./liveblocks-
|
|
1
|
+
import{j as o}from"./liveblocks-DTbLGSQH.js";import{a as u}from"./sentry--iMGn_c-.js";import{h as L,g as $,u as U,j as S,s as re,n as G,i as Z,o as ne,p as v}from"./core-DcS-HXN0.js";import{bn as De,eW as j,go as Me,m_ as le,Oh as Te,hE as he,O8 as Ue,qQ as _e,kw as be,mW as Be,hG as Re,Oa as Fe,O9 as Oe,Qx as Ve,zk as ze,EN as Le,Q6 as Ne,Qf as Qe,c7 as ae,cN as $e,cO as Ge,bs as Ze,M9 as He,xM as Ke,Qy as We,Hc as qe,Et as Je,Ek as Se,Eh as Xe,xQ as ye,En as Ce,Eq as Ie,Ew as oe,ua as se,xP as Ye,k8 as J,kb as Ae,Qz as en,lc as nn,y3 as tn,N0 as an,N1 as on,k6 as sn,QA as cn,k9 as rn,ri as ln,MX as dn,MY as un,rm as pn,hp as gn,Mh as ee,hh as de,he as mn,hm as fn,Mi as hn,y0 as bn,QB as Sn,QC as yn,EK as Cn,fB as Ee,fD as xe,QD as In,gc as An,Mr as En,x$ as ue,gh as pe,gg as xn,x_ as vn,gf as kn,ge as wn,QE as Pn,fG as ve,QF as jn,QG as Dn,y6 as Mn,xZ as ge,QH as Tn,fW as Un,xW 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-D9zlxAus.js";import{C as X,G as O,z as w,ag as ke,bR as $n,d as H,f as Gn,bC as Zn,k as K,B as ie,bS as Hn,i as we,W as Pe,bT as Kn,ar as Wn,m as je,bU as qn,bV as Jn,bW as Xn,Z as Yn,bX as et,s as nt,bY as tt}from"./index-DC0dQLD1.js";import{n as V}from"./mui-D4oYUocG.js";import{M as R}from"./MobileAppDrawer-DmvUd-9k.js";import{a as W,g as q,m as at}from"./accountMappingHelper-Cg-otc9W.js";import{t as ot,A as st}from"./AddressScreen-B4AZf_Bb.js";import Q from"./NotFoundScreen-DicN0NsA.js";import{g as it}from"./analyticsHelper-DsJZpHCL.js";import{B as ct}from"./BusinessVerificationPageScreen-4IUxwsvU.js";import{C as rt}from"./CompanyPassportScreen-B68PA8m9.js";import{u as lt,a as dt}from"./useEmailConnectResultRefresh-BR0ijVLk.js";import{q as me}from"./QBOConnectionScreen-CyRXuV7l.js";import{B as ut}from"./BillPayApprovalRoutes-BEMba1i2.js";import{R as pt}from"./ReimbursementApprovalRoutes-FCPg3UiN.js";import"./recharts-B-6eSeb6.js";import"./analytics-C2sLqqt-.js";import"./plaid-DnXASLGE.js";import"./dnd-D_MmPpoN.js";import"./stripe-DMRn4zHo.js";import"./lottie-XNZ0j4Vk.js";import"./lexical-BhgGR8eI.js";import"./pdf-kyzMB0kM.js";import"./utils-CiOzvYGH.js";import"./routePaths-CD1cpX2J.js";import"./empty-DOLvt4hu.js";import"./pdf-lib-D_BFR41U.js";import"./index-Fd_ZlxLV.js";import"./url-B9kBE-_j.js";import"./index-BbzLsG-V.js";import"./decodeURIComponentSafe-HMBZoUM8.js";import"./ReimbursementApprovalRuleDetailScreen-CDZuZjie.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]="6e1700d6-81e0-4b10-ab56-0a46fdfcdddf",e._sentryDebugIdIdentifier="sentry-dbid-6e1700d6-81e0-4b10-ab56-0a46fdfcdddf")}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-DTbLGSQH.js";import{h as X,g as ee,u as ne,i as G,j as P,N as x,n as W,t as en}from"./core-DcS-HXN0.js";import{bJ as nn,cq as Ce,PW as ye,eW as V,cC as tn,zA as Q,zk as an,Q6 as sn,Q9 as on,rB as te,rp as ae,l4 as ie,tI as z,Qb as Ie,gg as $e,gf as Ge,ge as We,Qc as cn,zJ as rn,Et as Ae,Ek as ke,Eh as _e,D$ as J,En as ve,Eq as Ee,Ew as Pe,ua as Te,gv as un,cx as dn,fD as ln,fB as pn,fC as mn,bt as yn,Qd as fn,C$ as le,DD as gn,Qe as bn,bK as Sn,FM as pe,EN as hn,Qf as Cn,Qg as In,FQ as An,FU as kn,tB as _n,Ki as vn,Gp as he,Hp as me,Qh as En,Qi as Pn,Qj as Tn,Qk as He,Ql as wn,ML as Dn,Pm as Un,M_ as On,Qm as Ke,E3 as Fn,M$ as Vn,E7 as Bn,Qn as Oe,GL as qe,lc as xn,rs as Je,tK as jn,bE as Re,tW as Ne,cA as Rn,Qo as Ye,fV as Nn,G7 as zn,Gb as Ln,Qp as Mn,Gs as ze,Qq as Zn,Qr as Qn,Qs as $n,Qt as Gn,go as Wn,AU as Hn,Qu as Kn,AZ as qn,AY as Jn}from"./zeni-epic-state-D9zlxAus.js";import{k as se,C as oe,G as q,y as we,aS as Y,bC as Xe,z as U,D as ce,d as O,B as De,f as $,bD as Yn,au as re,bE as B,bF as Xn,bG as et,ag as xe,bH as nt,s 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-DC0dQLD1.js";import{a as h}from"./sentry--iMGn_c-.js";import{n as Fe,D as rt,S as ut}from"./mui-D4oYUocG.js";import{M as fe}from"./MobileAppDrawer-DmvUd-9k.js";import N from"./NotFoundScreen-DicN0NsA.js";import{a as Ze}from"./analyticsHelper-DsJZpHCL.js";import{d as Qe}from"./routePaths-CD1cpX2J.js";import{B as Ue}from"./BusinessVerificationPageScreen-4IUxwsvU.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]="1e27c7d0-17dd-40f1-a04a-e0b0334afb48",e._sentryDebugIdIdentifier="sentry-dbid-1e27c7d0-17dd-40f1-a04a-e0b0334afb48")}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-DTbLGSQH.js";import{a as u,b as T,q as A}from"./sentry--iMGn_c-.js";import{u as M,h as z,j as c,g as D,N as j,n as O}from"./core-DcS-HXN0.js";import{u as P,z as s,y as F,d as E,a as B,e as _,f as N,g as $,h as V,j as W,m as v}from"./index-DC0dQLD1.js";import{eW as Z,LX as q,LY as J,fz as X,f$ as Y,M1 as H,gn as G,cZ as K,M2 as b,M3 as Q,M4 as R,bZ as y}from"./zeni-epic-state-D9zlxAus.js";import"./mui-D4oYUocG.js";import{u as ee}from"./useDeviceId-BdsUHxd2.js";import{f as te}from"./analyticsHelper-DsJZpHCL.js";import{t as ne}from"./getLocaleForTenant-Dq62iB8Q.js";import"./recharts-B-6eSeb6.js";import"./analytics-C2sLqqt-.js";import"./plaid-DnXASLGE.js";import"./dnd-D_MmPpoN.js";import"./stripe-DMRn4zHo.js";import"./lottie-XNZ0j4Vk.js";import"./lexical-BhgGR8eI.js";import"./pdf-kyzMB0kM.js";import"./utils-CiOzvYGH.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]="6cd9b703-67fc-468d-a192-2df1f950315d",t._sentryDebugIdIdentifier="sentry-dbid-6cd9b703-67fc-468d-a192-2df1f950315d")}catch{}})();const ie=O(function(t,i){const d=t.tenantState.fetchState,g=t.tenantState.sendEmailMagicLinkFetchState,{magicLinkExpired:n,magicLinkAlreadyUsed:a,magicLinkExpiredEmail:l}=i;return{googleClientId:v.googleClientId,microsoftClientId:v.microsoftClientId,signInError:t.tenantState.error?.error,fetchState:d,sendMagicLinkStatus:g,magicLinkExpired:n,magicLinkAlreadyUsed:a,magicLinkExpiredEmail:l}},function(t,i){const{location:d,navigate:g}=i;return console.warn(JSON.stringify(window.location)),{onOAuthError:(n,a)=>{A({message:`OAuth error from provider ${a} with error ${n}`,level:"error",tags:{authProvider:a,errorType:"zeni.login.error"},extra:{error:n,windowLocation:window.location.href}})},onOAuthSuccess:(n,a)=>{const l=a==="google"?window.location.origin:window.location.origin+window.location.pathname;t(R({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(Q(n,a)))},clearSignInError:()=>{t(b())}}})(W),ae=T.memo(ie);function ve({setTenantEmailDomain:t}){const i=M(),d=z(),{clearAllLoading:g}=P(),n=s.getSignedInUser();u.useLayoutEffect(()=>{g()},[g]);const a=ee(),l=c(e=>e.tenantState.magicLinkCodeVerifier),{sendEmailMagicLinkFetchState:h,accountLocked:C,accountUnlockTime:L}=c(e=>e.tenantState),p=c(e=>e.tenantState.fetchState),k=c(e=>e.tenantState.activeTenantFetchState.fetchState),S=c(e=>e.tenantState.signInState),o=c(e=>e.tenantState.loggedInUser),r=c(e=>Z(e)),I=c(e=>q(e)),m=D(),w=F().mode,U=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"&&k!=="Completed"||o?.zeniSessionId==null||r==null||(s.savePayNowInfoTooltip(!0,o.zeniSessionId),s.saveSignedInUserWithSession(o,o.zeniSessionId),s.saveSignedInUserTenants(J(I.tenantsInOrder),o.zeniSessionId),X(o.userId,o.zeniSessionId,r.tenantId),i(Y(r.tenantId)),s.saveActiveTenantDomainForUser(r.tenantEmailDomain),i(H("Completed")),B.updateAppLocaleID(ne(r)),te(o,r,w,void 0,I.tenantsInOrder),G().then(()=>{const e=V();e!=null&&_(e)}),setTimeout(()=>{E.trackLogin(N.Event.loginSuccess,o.authProvider??"google",K(r.productSettings))},2e3))},[S,p,k,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(j,{to:e,state:{...m.state,origin:""}})}return f.jsxs(f.Fragment,{children:[f.jsx(ae,{magicLinkExpired:!!U,magicLinkAlreadyUsed:!!x,magicLinkExpiredEmail:s.getMagicLinkEmail()??void 0,location:m,navigate:d,deviceId:a??void 0,showEmailLogin:!0}),C===!0&&L!=null?f.jsx($,{onClose:()=>i(b()),unlockDate:L}):null]})}export{ve as default};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{j as s}from"./liveblocks-
|
|
1
|
+
import{j as s}from"./liveblocks-DTbLGSQH.js";import{a as i}from"./sentry--iMGn_c-.js";import{u as c,g as l,N as u}from"./core-DcS-HXN0.js";import{z as n,d as a,f as m,B as p}from"./index-DC0dQLD1.js";import{gs as g,Mj as b}from"./zeni-epic-state-D9zlxAus.js";import{n as y}from"./mui-D4oYUocG.js";import"./recharts-B-6eSeb6.js";import"./analytics-C2sLqqt-.js";import"./plaid-DnXASLGE.js";import"./dnd-D_MmPpoN.js";import"./stripe-DMRn4zHo.js";import"./lottie-XNZ0j4Vk.js";import"./lexical-BhgGR8eI.js";import"./pdf-kyzMB0kM.js";import"./utils-CiOzvYGH.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]="f4d99bb8-d795-4055-a3b6-afc872b4c734",e._sentryDebugIdIdentifier="sentry-dbid-f4d99bb8-d795-4055-a3b6-afc872b4c734")}catch{}})();function M(){const e=c(),t=l(),r=i.useRef(!1),f=n.isSignedIn(),o=t.state?.message==="logout"||f;return i.useEffect(()=>{if(o&&!r.current){r.current=!0;try{e(g()),b(),a.trackLogout(m.Event.logoutSuccess),a.resetUserIdentity(),n.clearAll()}catch(d){console.error("Error during sign out:",d)}finally{window.location.replace("/signin/auth")}}},[o,e]),o?s.jsx(h,{children:s.jsx(p,{fetchState:"In-Progress"})}):s.jsx(u,{to:"../",replace:!0})}const h=y.div`
|
|
2
2
|
display: flex;
|
|
3
3
|
height: 100vh;
|
|
4
4
|
width: 100%;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{j as d}from"./liveblocks-
|
|
1
|
+
import{j as d}from"./liveblocks-DTbLGSQH.js";import{a as D}from"./sentry--iMGn_c-.js";import{h as U,u as v,g as J,j as G,i as _,n as z}from"./core-DcS-HXN0.js";import{z as R,C as W,G as p,a0 as M,D as O,d as Q,f as V,da as Z,s as g,r as q}from"./index-DC0dQLD1.js";import{eW as H,TI as F,J4 as I,TJ as A,TE as X,Is as y,TK as Y,IA as E,HW as aa,J5 as S,TL as B,fy as ea,IX as ta,J0 as sa,IP as oa,IN as w,J1 as na,IK as ia,TM as la,TN as ra,TO as ka,TP as ca,TQ as T,eh as ua,TR as da,TS as pa}from"./zeni-epic-state-D9zlxAus.js";import{n as Ta}from"./mui-D4oYUocG.js";import{u as ma}from"./useAskAiCfoHostNavButtonProps-CvQ724tN.js";import{M as ga}from"./MobileAppDrawer-DmvUd-9k.js";import"./recharts-B-6eSeb6.js";import"./analytics-C2sLqqt-.js";import"./plaid-DnXASLGE.js";import"./dnd-D_MmPpoN.js";import"./stripe-DMRn4zHo.js";import"./lottie-XNZ0j4Vk.js";import"./lexical-BhgGR8eI.js";import"./pdf-kyzMB0kM.js";import"./utils-CiOzvYGH.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]="bf419972-87dc-491b-b132-1a60b68b3159",e._sentryDebugIdIdentifier="sentry-dbid-bf419972-87dc-491b-b132-1a60b68b3159")}catch{}})();const fa=Ta.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-DTbLGSQH.js";import se from"./NotFoundScreen-DicN0NsA.js";import{a as c}from"./sentry--iMGn_c-.js";import{h as q,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-DcS-HXN0.js";import{I7 as H,Ia as le,I4 as de,eW as M,TE as W,Io as J,I1 as pe,IU as ue,IN as ke,TF as X,TG as z,HZ as me,HW as fe,rB as ge,rp as he,l4 as Ie,Ii as Se,TH as Te,Iz as be,Iw as Ee,Id as Ge,It as Ce,Is as De}from"./zeni-epic-state-D9zlxAus.js";import{z as C,d8 as xe,w as we,C as ye,G as b,r as Y,s as v,D as je,d as V,f as ve,d9 as Re,m as A,au as Fe}from"./index-DC0dQLD1.js";import{n as Be}from"./mui-D4oYUocG.js";import{u as Ue}from"./useInitialThreadRequest-zbm4ek8Z.js";import{M as Pe}from"./MobileAppDrawer-DmvUd-9k.js";import Le from"./TaskListScreen-cv3YBBd9.js";import"./recharts-B-6eSeb6.js";import"./analytics-C2sLqqt-.js";import"./plaid-DnXASLGE.js";import"./dnd-D_MmPpoN.js";import"./stripe-DMRn4zHo.js";import"./lottie-XNZ0j4Vk.js";import"./lexical-BhgGR8eI.js";import"./pdf-kyzMB0kM.js";import"./utils-CiOzvYGH.js";import"./useAskAiCfoHostNavButtonProps-CvQ724tN.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]="2e303da2-299a-493c-93f5-247d246b59d5",e._sentryDebugIdIdentifier="sentry-dbid-2e303da2-299a-493c-93f5-247d246b59d5")}catch{}})();function Ne(){const e=q(),t=O(),s=C.getSignedInUser(),{cannedResponses:u,fetchState:r,saveFetchState:d}=g(o=>o.cannedResponsesState),l=c.useCallback(()=>{t(H())},[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 Z,_=[];const $e=re(function(e,t){const{location:s,taskGroupId:u}=t,r=X(e,t.taskId),d=M(e),l=r.taskGroupId??u,k=l!=null?z(e.taskGroupState,l):void 0,a=C.getSignedInUser(),o=d.tenantId,h={userId:a?.userId??"",sessionId:a?.zeniSessionId??"",tenantId:o??""},I=W(e),{tenantEmailDomain:D}=d,E=r.recurringSourceTaskId,x=E!=null?`${A.appUrl}/${D}/tasks/${encodeURIComponent(E)}`:void 0;var S;return{taskDetailSelectorView:r,authParams:h,isZeniUser:C.isZeniUser(),userGroupList:((S=e.userGroupsState.userGroupByUserGroupId)!==Z&&(Z=S,_=Object.values(S)),_),isNewClicked:s.state?.message==="comingFromTaskListPage",filesEndPoint:Fe.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(Ce(s,a??l))},onArchiveTaskClick:()=>{t.taskId!=null&&e(Ge(t.taskId))},onSnoozeTask:(a,o)=>{e(Ee(a,o))},onUnsnoozeTask:a=>{e(be(a))},onDismissClick:()=>{if(d.state?.message==="triggerBackClick"){const a=Y(d.state?.pathnameStackToGoBack),o=a.poppedPathname??"../../dashboard";u(o,{state:{pathnameStackToGoBack:a.newStack}})}else{const a=R(k),o=v(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(J(!1,s))},onCreateTagClick:a=>{e(fe(a,s))},onDeleteTagClick:a=>{e(me(a,s))},onFetchCannedResponses:()=>{e(H())},onManageTemplatesClick:()=>{u(`/${r.tenantEmailDomain}/tasks/quick-responses`)}}})(Re);function j(){const e=q(),t=O(),s=ne(),u=we(),{taskId:r,taskGroupId:d}=oe(),l=g(i=>M(i)),k=Ue(l?.companyId),{useFeatureGate:a}=ye(),{isFeatureEnabled:o}=a(b.isTaskSnoozeEnabled),{isFeatureEnabled:h}=a(b.isTaskVisibilityEnabled),{isFeatureEnabled:I}=a(b.isTaskCannedResponsesEnabled),{isFeatureEnabled:D}=a(b.isTaskRecurringParentEnabled),{isFeatureEnabled:E}=a(b.isTaskGroupAssigneesEnabled),[x,S]=c.useState(!1),[p,K]=c.useState(!1),[F,Q]=c.useState(!1),[B,ee]=c.useState(!1),[U,w]=c.useState(!1),T=c.useRef(!1),G=g(i=>i.taskListState.updateTasksFetchState.fetchState),P=g(i=>W(i)),L=g(i=>i.taskGroupViewState.fetchState);c.useEffect(()=>{p||(K(!0),t(J(!1,r)))},[p,t]),c.useEffect(()=>{F||P.fetchState==="Completed"||(Q(!0),t(pe()))},[F,t,P.fetchState]),c.useEffect(()=>{B||L==="Completed"||(ee(!0),t(ue()))},[B,t,L]);const ae=c.useCallback(()=>{r!=null&&(T.current=!1,t(ke([r],null,{isArchived:!1})),w(!0))},[t,r]);c.useEffect(()=>{if(U)if(G!=="In-Progress"){if(T.current){if(G==="Error")return w(!1),void(T.current=!1);if(G==="Completed"){w(!1),T.current=!1;const{tenantEmailDomain:i}=l;if(s.state?.message==="triggerBackClick"){const m=Y(s.state?.pathnameStackToGoBack);e(m.poppedPathname??"../../dashboard",{state:{pathnameStackToGoBack:m.newStack}})}else{const m=R(i);e(m,{state:{pathnameStackToGoBack:v(s.state?.pathnameStackToGoBack,s.pathname)}})}}}}else T.current=!0},[U,G,l,s,e]);const N=g(i=>X(i,r)),y=N.fetchState,$=C.getSignedInUser();if($==null)throw Error("Can't access task detail page without signing in...");if(y==="Error"&&N.error?.code===400){const{tenantEmailDomain:i}=l,m=R(i),te=v(s.state?.pathnameStackToGoBack,s.pathname);return n.jsx(ie,{to:m,state:{pathnameStackToGoBack:te}})}return n.jsxs(n.Fragment,{children:[y==="Completed"?n.jsx(je,{analytics:V,onLoad:i=>(m=>m.trackPageLoaded(ve.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:y,onUnarchiveTaskClick:ae,isTaskSnoozeEnabled:o,isTaskVisibilityEnabled:h,isTaskCannedResponsesEnabled:I,isTaskRecurringParentEnabled:D,isTaskGroupAssigneesEnabled:E})]})]})}const ze=Be.div`
|
|
2
2
|
display: flex;
|
|
3
3
|
min-height: 100%;
|
|
4
4
|
width: 100%;
|
package/dist/assets/{TransactionDetailRoutes-D6y-8FuE.js → TransactionDetailRoutes-CqJldaCF.js}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{j as t}from"./liveblocks-
|
|
1
|
+
import{j as t}from"./liveblocks-DTbLGSQH.js";import i from"./NotFoundScreen-DicN0NsA.js";import{T as r}from"./TransactionDetailScreen-BM6LDN-M.js";import"./sentry--iMGn_c-.js";import{o as s,p as o}from"./core-DcS-HXN0.js";import"./zeni-epic-state-D9zlxAus.js";import"./recharts-B-6eSeb6.js";import"./index-DC0dQLD1.js";import"./mui-D4oYUocG.js";import"./analytics-C2sLqqt-.js";import"./plaid-DnXASLGE.js";import"./dnd-D_MmPpoN.js";import"./stripe-DMRn4zHo.js";import"./lottie-XNZ0j4Vk.js";import"./lexical-BhgGR8eI.js";import"./pdf-kyzMB0kM.js";import"./utils-CiOzvYGH.js";import"./useAskAiCfoHostNavButtonProps-CvQ724tN.js";import"./decodeURIComponentSafe-HMBZoUM8.js";import"./routePaths-CD1cpX2J.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-CHtoQtM9.js → TransactionDetailScreen-BM6LDN-M.js}
RENAMED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{j as U}from"./liveblocks-
|
|
1
|
+
import{j as U}from"./liveblocks-DTbLGSQH.js";import{a as i}from"./sentry--iMGn_c-.js";import{u as W,k as Ye,j as g,s as fe,g as Se,h as Te,i as be,N as Qe,n as Xe}from"./core-DcS-HXN0.js";import{nN as he,eW as Q,go as Ze,Oh as et,m_ as tt,mI as at,bn as nt,cW as Ee,bs as Ie,r9 as q,Ng as H,Oi as ve,Oj as oe,NG as De,kH as Ce,Ok as ke,NL as se,NM as ce,lw as Ae,Kb as ie,Na as $,kB as Oe,kz as we,kL as ot,nA as st,Ol as ct,Om as it,vq as Y,kG as Ue,Jw as xe,cj as rt,c_ as lt,On as dt,N9 as ut,Oo as mt,vm as pt,Op as ft,Oq as ht,Or as yt,Os as gt,Ot as St,kK as Tt,Ou as bt,Ov as Et,Nb as It,Ow as vt,Ox as Dt,Oy as Ct,Jq as kt,Jg as At,JF as Ot,kM as wt,Kc as ye,nF as Ut}from"./zeni-epic-state-D9zlxAus.js";import{C as J,G as x,z as _e,aS as Fe,y as xt,K as _t,aT as Ft,F as Pt,r as ae,k as Vt,aU as Bt,s as ne,a0 as Nt,aV as Lt,d as Pe,aW as zt,au as Rt,a4 as te}from"./index-DC0dQLD1.js";import{n as Gt,S as jt,D as Mt}from"./mui-D4oYUocG.js";import{u as $t}from"./useAskAiCfoHostNavButtonProps-CvQ724tN.js";import{d as Ve}from"./decodeURIComponentSafe-HMBZoUM8.js";import{h as Be,c as Ne,g as Wt,e as qt}from"./routePaths-CD1cpX2J.js";import{u as Ht}from"./utils-CiOzvYGH.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]="92505aa6-c256-4d80-b08e-720024834ecd",t._sentryDebugIdIdentifier="sentry-dbid-92505aa6-c256-4d80-b08e-720024834ecd")}catch{}})();function Jt(t=!0){const e=W(),s=Ye(),{useFeatureGate:a}=J(),{isFeatureEnabled:n}=a(x.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 Kt(t,e){const s=function(){const r=W(),[p,S]=i.useState(!1),[A,y]=i.useState(null),[m,O]=i.useState(null),{useDynamicConfig:T}=J(),{configValue:f,isDynamicConfigLoading:C}=T("transaction_categorization_config"),v=!C&&f?.capitalization_enabled===!0,k=g(h=>Q(h)),b=k.companyId,w=g(h=>Ze(h.companyState,k.companyId)?.company.companyLocaleInfo?.currencySymbol??"$"),{capitalizableAccounts:_,capitalizableAccountOverrides:B,dismissedAccounts:R}=g(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(_);G.current=_;const N=i.useRef(B);N.current=B;const F=i.useRef(R);F.current=R;const L=g(h=>et(h.accountState),fe),I=i.useMemo(()=>{const h={};for(const E of L)E.accountId!=null&&E.accountName!=null&&(h[E.accountId]=E.accountName);return h},[L]),l=m!=null?I[m]??null:null,j=i.useCallback(h=>{if(!v)return;const E=G.current;if(E==null)return;const u=E.accounts??[],M=new Set(h),X=N.current??{},K=F.current;for(const z of u)if(M.has(z.accountId)&&X[z.accountId]==null&&K?.[z.accountId]==null)return y(z.classificationType),O(z.accountId),void S(!0)},[v]),D=i.useCallback((h,E)=>{r(tt(b,h,E,!0)),S(!1),y(null),O(null)},[r,b]),P=i.useCallback(()=>{m!=null&&(r(at(b,m)),S(!1),y(null),O(null))},[r,b,m]);return{showPopup:p&&v,popupType:A,popupAccountId:m,popupAccountName:l,currencySymbol:w,checkAndShowPopup:j,handleSubmit:D,handleDismiss:P}}(),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=_e.getSignedInUser(),{useFeatureGate:e}=J(),{isFeatureEnabled:s}=e(x.isChainOfThoughtEnabled);return i.useMemo(()=>nt(t)&&s,[t,s])};function Le(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}=J(),o=g(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&&Ie(o.userRole),{isFeatureEnabled:S}=a(x.isVendorBulkUpdateOnTransactionEnabled),{isFeatureEnabled:A}=a(x.isExpenseAutomationEnabled),{configValue:y}=n(Fe.enableUncategorizedExpenseCategory),m=y?.uncategorized_expense_category_enabled===!0,O=re(),T=i.useMemo(()=>({id:t,type:q(e)}),[t,e]),f=g(u=>H(u,T)),C=f?.transactionDetailUpdateStatus?.fetchState,v=f?.transactionDetailLocalData?.lineItemById,k=g(u=>{const M=H(u,T)?.transactionDetailLocalData.vendorUpdates?.id;return M==null?"Not-Started":u.transactionVendorViewState.editVendorStateById[M]?.saveStatus.fetchState??"Not-Started"}),b=i.useMemo(()=>f?.fetchState==="Completed"?Le(f?.transaction):void 0,[f?.fetchState,f?.transaction]),w=g(u=>{if(b!=null)return ve(u.customerIncomeState,u.vendorExpenseState,u.trendState,b,"month")}),_=g(u=>oe(u)),B=g(u=>{if(b!=null)return De(u.trendWithTransactionsState,b,"TransactionDetail")}),R=o.company?.companyInfo.firstMonthOfFY??1,G=g(u=>Ce(u.accountState,u.accountListState,"accountList")),[N,F]=i.useState(!1),[L,I]=i.useState(!1),[l,j]=i.useState(!1);i.useEffect(()=>{F(!1),I(!1),j(!1)},[t,e]);const D=i.useCallback(()=>{F(!1),I(!1)},[]),[P,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?L||w==null||(I(!0),s(ie(b,"TransactionDetail",{timeframe:"month",timePeriod:E??w}))):(s(se()),s(ce()),F(!0),s(Ae(b))))},[s,l,f?.fetchState,f?.transaction,b,c,r,p,N,L,w,E]),i.useEffect(()=>{_.newVendorState?.vendorDetailLocalData?.vendorName!=null?h(!0):h(!1)},[_.newVendorState?.vendorDetailLocalData?.vendorName]),i.useEffect(()=>()=>{s($("common"))},[s]),{currentTenant:o,loggedInUserHasCardUserOrAdminRole:c,isUserHasDashboardAccess:r,isUserHasInvestorOrBankerAccess:p,isVendorBulkUpdateOnTransactionEnabled:S,isExpenseAutomationEnabled:A,isUncategorizedExpenseCategoryEnabled:m,isChainOfThoughtEnabled:O,selectedTransaction:T,transactionDetail:f,rawDetailSaveStatus:C,rawDetailLineItemById:v,vendorSaveStatus:k,tranEntity:b,defaultTrendTransactionTimePeriod:w,vendorViewDetails:_,uiState:B,firstMonthOfFY:R,uncategorizedAccounts:G,resetTrendIsFetchedStates:D,isCreateVendorDrawerOpen:P,setIsCreateVendorDrawerOpen:h}}const Yt={overlayWidth:new Pt(100,100,58)},Qt=({isOpen:t,onSaveVendor:e,onSaveSuccess:s,onCancel:a,vendorViewDetails:n})=>{const o=xt(),c=_t(),r=W(),p=g(y=>oe(y)),S=()=>{a()},A={vendorDetailView:n??p,onSaveSuccess:()=>{r(we()),r(ot("Not-Started")),s()},onSaveVendor:e,onCancelClick:S,saveVendorDetailLocalData:y=>{r(Oe({vendorId:void 0,localData:y}))}};return U.jsx(Mt,{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:S,children:U.jsx(Xt,{onClick:y=>y.stopPropagation(),children:U.jsx(Ft,{...A})})})},Xt=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-BxpjjfmG.js";import{h as U,g as K,u as H,i as W,j as h,N as z,n as Z,o as ve,p as j}from"./core-BjRnoVdN.js";import{eW as Q,qQ as X,jV as u,RE as ee,K2 as De,bo as le,RF as be,kw as te,NI as ae,RG as ue,RH as Pe,bE as Y,J_ as ye,RI as Ee,RJ as me,RK as je,K1 as Ae,RL as xe,RM as pe,RN as Me,RO as ge,RP as Le,RQ as Ce,RR as fe,Le as Be}from"./zeni-epic-state-BkEKIYbX.js";import{a as de,C as ne,G as V,d as G,co as ce,s as q,r as oe,Z as Fe,A as Oe}from"./index-DG5dsziC.js";import"./mui-CdxnWIp4.js";import{a as g}from"./sentry-B06otMHd.js";import{w as se}from"./withTransactionSidePanel-tBE2uHP9.js";import{p as ie,c as re}from"./routePaths-C7myDwxn.js";import{v as Re}from"./utils-CaYSR2MR.js";import{d as b}from"./decodeURIComponentSafe-8RHUrhvv.js";import{Z as Ge}from"./ZeniAccountStatementScreen-C6Lownq7.js";import"./recharts-CFinCL-a.js";import"./analytics-CMhYvjgp.js";import"./plaid-DtXw88Ai.js";import"./dnd-DD1NomKe.js";import"./stripe-DMRn4zHo.js";import"./lottie-iCzPfqr5.js";import"./lexical-CkYiXWk9.js";import"./pdf-C9PyNDT1.js";import"./useAskAiCfoHostNavButtonProps-CFgUcHmD.js";import"./TransactionDetailScreen-CHtoQtM9.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]="dc58aa9a-7df2-4bba-bd60-841179761e47",a._sentryDebugIdIdentifier="sentry-dbid-dc58aa9a-7df2-4bba-bd60-841179761e47")}catch{}})();const ze=["uncategorized-income","uncategorized-expense","miscategorized-income","miscategorized-expense","missing-receipts"],J=a=>Re(a),we=Z(function(a,e){const t=be(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=Ne(t,n,c,l,e.bookCloseDate);G.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=q(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),N=se(function({...a}){const e=U(),t=K(),n=H(),c=t.pathname.split("/").find(r=>ze.includes(r)),o=c??"uncategorized-expense",{tenantEmailDomain:l}=W(),m=de.getLocalizedStrings(),{accountType:S,title:T,subTitle:D}=_e(o),y="month",I=h(r=>Q(r)),p=I.company?.companyInfo.firstMonthOfFY??1,{useFeatureGate:A}=ne(),{isFeatureEnabled:k}=A(V.isProjectsTransactionsEnabled),x=h(r=>X(r))&&k,{dataAvailable:C,initialTimeframeTick:P}=$e(o,p,I.bookCloseDate),[B,E]=g.useState(!1),[F,O]=g.useState(void 0),f=g.useMemo(()=>{const r=u(P);return{tranListType:o,accountType:ee(S),title:T,subTitle:D,timeframe:y,period:r}},[o,y,S,C]);g.useEffect(()=>{if(!B&&f!=null){E(!0),G.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(z,{to:"../"}):s.jsx(we,{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}}},Ne=(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=Z(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??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)}`),G.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=q(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),Ve=se(function({referrerType:a,...e}){const t=U(),n=K(),c=H(),{tenantEmailDomain:o,accountTypeEncoded:l,accountIdEncoded:m,classIdEncoded:S,timeframe:T,startDate:D,endDate:y,titleEncoded:I}=W(),p=b(l??""),A=b(m??""),k=b(S??""),x=b(I??""),C=h(d=>Pe(d.transactionListState,A,p,k)),[P,B]=g.useState(!1),[E,F]=g.useState(void 0),O=h(d=>Q(d)),f=O.company?.companyInfo.firstMonthOfFY??1,{useFeatureGate:M}=ne(),{isFeatureEnabled:r}=M(V.isProjectsTransactionsEnabled),w=h(d=>X(d))&&r;let i;const R=qe(p,A,k,T,D,y,x);if(R){const d={startDate:Y(D,"YYYY-MM-DD"),endDate:Y(y,"YYYY-MM-DD")},_=Ke(C?.dateRange,d);i={accountId:A,accountType:ee(p),classId:k,title:x,timeframe:T,period:_}}g.useEffect(()=>{P||i==null||(B(!0),G.trackTransactionList(i.accountId,void 0,a,i.title),c(ye(i.accountId,i.accountType,i.classId,i.period)))},[P,i,c]);let L=i;i!=null&&E!=null&&(L={...i,period:E});const $=[l,m,S,T,D,y,I].filter(d=>d!=null);return R&&L!=null?s.jsx(Je,{firstMonthOfFY:f,tenantEmailDomain:o,location:n,navigate:t,showProjectField:w,selectedAccount:L,referrerType:a,onSelectedTimePeriodChange:d=>F(d),...e}):s.jsx(z,{to:he($.length)})}),he=(a=7)=>{let e="../";for(let t=0;t<a;t++)e=`${e}../`;return e},qe=(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,Ke=(a,e)=>a!=null&&a.endDate.isSame(e.endDate,"day")&&a.startDate.isBefore(e.startDate,"day")?u(a):u(e),Qe=Z(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??Se();e.navigate(n,{state:{pathnameStackToGoBack:t.newStack}})},onTimePeriodChange:(t,n,c)=>{e.closeSidePanel?.();let o=n;t.startDate.isBefore(n.startDate,c)?o={startDate:t.startDate,endDate:n.endDate}:t.startDate.isAfter(n.endDate,c)?o={startDate:n.startDate,endDate:t.endDate}:console.error(`Invalid addTimePeriod ${JSON.stringify(t)}`),G.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=q(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=K(),c=H(),{tenantEmailDomain:o,accountTypeEncoded:l,accountIdEncoded:m,projectIdEncoded:S,timeframe:T,startDate:D,endDate:y,titleEncoded:I}=W(),p=b(l??""),A=b(m??""),k=b(S??""),x=b(I??""),C=h(d=>je(d.transactionListState,A,p,k)),[P,B]=g.useState(!1),[E,F]=g.useState(void 0),O=h(d=>Q(d)),f=O.company?.companyInfo.firstMonthOfFY??1,{useFeatureGate:M}=ne(),{isFeatureEnabled:r}=M(V.isProjectsTransactionsEnabled),w=h(d=>X(d))&&r;let i;const R=He(p,A,k,T,D,y,x);if(R){const d={startDate:Y(D,"YYYY-MM-DD"),endDate:Y(y,"YYYY-MM-DD")},_=We(C?.dateRange,d);i={accountId:A,accountType:ee(p),projectId:k,title:x,timeframe:T,period:_}}g.useEffect(()=>{P||i==null||(B(!0),G.trackTransactionList(i.accountId,void 0,a,i.title),c(Ae(i.accountId,i.accountType,i.projectId,i.period)))},[P,i,c]);let L=i;i!=null&&E!=null&&(L={...i,period:E});const $=[l,m,S,T,D,y,I].filter(d=>d!=null);return R&&L!=null?s.jsx(Qe,{firstMonthOfFY:f,tenantEmailDomain:o,location:n,navigate:t,showProjectField:w,selectedAccount:L,referrerType:a,onSelectedTimePeriodChange:d=>F(d),...e}):s.jsx(z,{to:Se($.length)})}),Se=(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,We=(a,e)=>a!=null&&a.endDate.isSame(e.endDate,"day")&&a.startDate.isBefore(e.startDate,"day")?u(a):u(e),Ze=Z(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)}`),G.trackTransactionList(e.selectedAccount.accountId,void 0,e.referrerType,e.selectedAccount.title,void 0,!0),a(fe({accountId:e.selectedAccount.accountId,accountType:e.selectedAccount.accountType,uiState:{dateRange:o}})),a(ge(e.selectedAccount.accountId,e.selectedAccount.accountType,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=q(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=q(e.location.state?.pathnameStackToGoBack,e.location.pathname);e.navigate(t,{state:{pathnameStackToGoBack:n}})}}})(ce),Te=se(function({referrerType:a,...e}){const t=U(),n=K(),c=H(),{tenantEmailDomain:o,accountTypeEncoded:l,accountIdEncoded:m,timeframe:S,startDate:T,endDate:D,titleEncoded:y,excludeSubAccounts:I}=W(),p=b(l??""),A=b(m??""),k=b(y??""),x=!(I!=null&&I==="exclude_subaccounts"),C=h(v=>Me(v.transactionListState,A,p)),[P,B]=g.useState(!1),[E,F]=g.useState(void 0),O=h(v=>Q(v)),f=O.company?.featuresActivationInfo.connectedAccountProvider==="unit",M=O.company?.companyInfo.firstMonthOfFY??1;let r;const w=Xe(p,A,S,T,D,k);if(w){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:S,period:Ye}}let i=r;r!=null&&E!=null&&(i={...r,period:E});const{useFeatureGate:R}=ne(),{isFeatureEnabled:L}=R(V.isTransactionCommentingEnabled),{isFeatureEnabled:$}=R(V.isProjectsTransactionsEnabled),d=h(v=>X(v))&&$,{areTenantIdsInSync:_}=Fe();g.useEffect(()=>{!P&&r!=null&&_&&(B(!0),G.trackTransactionList(r.accountId,void 0,a,r.title),c(ge(r.accountId,r.accountType,r.period,void 0,!1,x)))},[P,r,c,_]);const ke=[l,m,S,T,D,y].filter(v=>v!=null);return w&&i!=null?s.jsx(Ze,{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(z,{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=K().state?.referrer,e=h(n=>n.expenseAutomationViewState.selectedPeriodByTenantId)[h(n=>Q(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(Ge,{})}),s.jsx(j,{path:"/*",element:s.jsx(Te,{referrerType:a})}),s.jsx(j,{path:"/uncategorized-income/*",element:s.jsx(N,{})}),s.jsx(j,{path:"/uncategorized-expense/*",element:t?s.jsx(z,{to:`../../month_end_close_checks/review/transaction_categorization/${e.month}-${e.year}`}):s.jsx(N,{})}),s.jsx(j,{path:"/miscategorized-income/*",element:s.jsx(N,{})}),s.jsx(j,{path:"/miscategorized-expense/*",element:t?s.jsx(z,{to:`../../month_end_close_checks/review/transaction_categorization/${e.month}-${e.year}`}):s.jsx(N,{})}),s.jsx(j,{path:"/missing-receipts/*",element:t?s.jsx(z,{to:`../../month_end_close_checks/review/missing_receipts/${e.month}-${e.year}`}):s.jsx(N,{})}),s.jsx(j,{path:"/by-class/:accountTypeEncoded/:accountIdEncoded/:classIdEncoded/:timeframe/:startDate/:endDate/:titleEncoded/*",element:s.jsx(Ve,{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-DTbLGSQH.js";import{h as U,g as K,u as H,i as W,j as h,N as z,n as Z,o as ve,p as j}from"./core-DcS-HXN0.js";import{eW as Q,qQ as X,jV as u,RE as ee,K2 as De,bo as le,RF as be,kw as te,NI as ae,RG as ue,RH as Pe,bE as Y,J_ as ye,RI as Ee,RJ as me,RK as je,K1 as Ae,RL as xe,RM as pe,RN as Me,RO as ge,RP as Le,RQ as Ce,RR as fe,Le as Be}from"./zeni-epic-state-D9zlxAus.js";import{a as de,C as ne,G as V,d as G,co as ce,s as q,r as oe,Z as Fe,A as Oe}from"./index-DC0dQLD1.js";import"./mui-D4oYUocG.js";import{a as g}from"./sentry--iMGn_c-.js";import{w as se}from"./withTransactionSidePanel-CcdsL6he.js";import{p as ie,c as re}from"./routePaths-CD1cpX2J.js";import{v as Re}from"./utils-CiOzvYGH.js";import{d as b}from"./decodeURIComponentSafe-HMBZoUM8.js";import{Z as Ge}from"./ZeniAccountStatementScreen-DhRygyJr.js";import"./recharts-B-6eSeb6.js";import"./analytics-C2sLqqt-.js";import"./plaid-DnXASLGE.js";import"./dnd-D_MmPpoN.js";import"./stripe-DMRn4zHo.js";import"./lottie-XNZ0j4Vk.js";import"./lexical-BhgGR8eI.js";import"./pdf-kyzMB0kM.js";import"./useAskAiCfoHostNavButtonProps-CvQ724tN.js";import"./TransactionDetailScreen-BM6LDN-M.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]="dc58aa9a-7df2-4bba-bd60-841179761e47",a._sentryDebugIdIdentifier="sentry-dbid-dc58aa9a-7df2-4bba-bd60-841179761e47")}catch{}})();const ze=["uncategorized-income","uncategorized-expense","miscategorized-income","miscategorized-expense","missing-receipts"],J=a=>Re(a),we=Z(function(a,e){const t=be(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=Ne(t,n,c,l,e.bookCloseDate);G.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=q(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),N=se(function({...a}){const e=U(),t=K(),n=H(),c=t.pathname.split("/").find(r=>ze.includes(r)),o=c??"uncategorized-expense",{tenantEmailDomain:l}=W(),m=de.getLocalizedStrings(),{accountType:S,title:T,subTitle:D}=_e(o),y="month",I=h(r=>Q(r)),p=I.company?.companyInfo.firstMonthOfFY??1,{useFeatureGate:A}=ne(),{isFeatureEnabled:k}=A(V.isProjectsTransactionsEnabled),x=h(r=>X(r))&&k,{dataAvailable:C,initialTimeframeTick:P}=$e(o,p,I.bookCloseDate),[B,E]=g.useState(!1),[F,O]=g.useState(void 0),f=g.useMemo(()=>{const r=u(P);return{tranListType:o,accountType:ee(S),title:T,subTitle:D,timeframe:y,period:r}},[o,y,S,C]);g.useEffect(()=>{if(!B&&f!=null){E(!0),G.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(z,{to:"../"}):s.jsx(we,{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}}},Ne=(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=Z(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??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)}`),G.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=q(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),Ve=se(function({referrerType:a,...e}){const t=U(),n=K(),c=H(),{tenantEmailDomain:o,accountTypeEncoded:l,accountIdEncoded:m,classIdEncoded:S,timeframe:T,startDate:D,endDate:y,titleEncoded:I}=W(),p=b(l??""),A=b(m??""),k=b(S??""),x=b(I??""),C=h(d=>Pe(d.transactionListState,A,p,k)),[P,B]=g.useState(!1),[E,F]=g.useState(void 0),O=h(d=>Q(d)),f=O.company?.companyInfo.firstMonthOfFY??1,{useFeatureGate:M}=ne(),{isFeatureEnabled:r}=M(V.isProjectsTransactionsEnabled),w=h(d=>X(d))&&r;let i;const R=qe(p,A,k,T,D,y,x);if(R){const d={startDate:Y(D,"YYYY-MM-DD"),endDate:Y(y,"YYYY-MM-DD")},_=Ke(C?.dateRange,d);i={accountId:A,accountType:ee(p),classId:k,title:x,timeframe:T,period:_}}g.useEffect(()=>{P||i==null||(B(!0),G.trackTransactionList(i.accountId,void 0,a,i.title),c(ye(i.accountId,i.accountType,i.classId,i.period)))},[P,i,c]);let L=i;i!=null&&E!=null&&(L={...i,period:E});const $=[l,m,S,T,D,y,I].filter(d=>d!=null);return R&&L!=null?s.jsx(Je,{firstMonthOfFY:f,tenantEmailDomain:o,location:n,navigate:t,showProjectField:w,selectedAccount:L,referrerType:a,onSelectedTimePeriodChange:d=>F(d),...e}):s.jsx(z,{to:he($.length)})}),he=(a=7)=>{let e="../";for(let t=0;t<a;t++)e=`${e}../`;return e},qe=(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,Ke=(a,e)=>a!=null&&a.endDate.isSame(e.endDate,"day")&&a.startDate.isBefore(e.startDate,"day")?u(a):u(e),Qe=Z(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??Se();e.navigate(n,{state:{pathnameStackToGoBack:t.newStack}})},onTimePeriodChange:(t,n,c)=>{e.closeSidePanel?.();let o=n;t.startDate.isBefore(n.startDate,c)?o={startDate:t.startDate,endDate:n.endDate}:t.startDate.isAfter(n.endDate,c)?o={startDate:n.startDate,endDate:t.endDate}:console.error(`Invalid addTimePeriod ${JSON.stringify(t)}`),G.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=q(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=K(),c=H(),{tenantEmailDomain:o,accountTypeEncoded:l,accountIdEncoded:m,projectIdEncoded:S,timeframe:T,startDate:D,endDate:y,titleEncoded:I}=W(),p=b(l??""),A=b(m??""),k=b(S??""),x=b(I??""),C=h(d=>je(d.transactionListState,A,p,k)),[P,B]=g.useState(!1),[E,F]=g.useState(void 0),O=h(d=>Q(d)),f=O.company?.companyInfo.firstMonthOfFY??1,{useFeatureGate:M}=ne(),{isFeatureEnabled:r}=M(V.isProjectsTransactionsEnabled),w=h(d=>X(d))&&r;let i;const R=He(p,A,k,T,D,y,x);if(R){const d={startDate:Y(D,"YYYY-MM-DD"),endDate:Y(y,"YYYY-MM-DD")},_=We(C?.dateRange,d);i={accountId:A,accountType:ee(p),projectId:k,title:x,timeframe:T,period:_}}g.useEffect(()=>{P||i==null||(B(!0),G.trackTransactionList(i.accountId,void 0,a,i.title),c(Ae(i.accountId,i.accountType,i.projectId,i.period)))},[P,i,c]);let L=i;i!=null&&E!=null&&(L={...i,period:E});const $=[l,m,S,T,D,y,I].filter(d=>d!=null);return R&&L!=null?s.jsx(Qe,{firstMonthOfFY:f,tenantEmailDomain:o,location:n,navigate:t,showProjectField:w,selectedAccount:L,referrerType:a,onSelectedTimePeriodChange:d=>F(d),...e}):s.jsx(z,{to:Se($.length)})}),Se=(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,We=(a,e)=>a!=null&&a.endDate.isSame(e.endDate,"day")&&a.startDate.isBefore(e.startDate,"day")?u(a):u(e),Ze=Z(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)}`),G.trackTransactionList(e.selectedAccount.accountId,void 0,e.referrerType,e.selectedAccount.title,void 0,!0),a(fe({accountId:e.selectedAccount.accountId,accountType:e.selectedAccount.accountType,uiState:{dateRange:o}})),a(ge(e.selectedAccount.accountId,e.selectedAccount.accountType,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=q(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=q(e.location.state?.pathnameStackToGoBack,e.location.pathname);e.navigate(t,{state:{pathnameStackToGoBack:n}})}}})(ce),Te=se(function({referrerType:a,...e}){const t=U(),n=K(),c=H(),{tenantEmailDomain:o,accountTypeEncoded:l,accountIdEncoded:m,timeframe:S,startDate:T,endDate:D,titleEncoded:y,excludeSubAccounts:I}=W(),p=b(l??""),A=b(m??""),k=b(y??""),x=!(I!=null&&I==="exclude_subaccounts"),C=h(v=>Me(v.transactionListState,A,p)),[P,B]=g.useState(!1),[E,F]=g.useState(void 0),O=h(v=>Q(v)),f=O.company?.featuresActivationInfo.connectedAccountProvider==="unit",M=O.company?.companyInfo.firstMonthOfFY??1;let r;const w=Xe(p,A,S,T,D,k);if(w){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:S,period:Ye}}let i=r;r!=null&&E!=null&&(i={...r,period:E});const{useFeatureGate:R}=ne(),{isFeatureEnabled:L}=R(V.isTransactionCommentingEnabled),{isFeatureEnabled:$}=R(V.isProjectsTransactionsEnabled),d=h(v=>X(v))&&$,{areTenantIdsInSync:_}=Fe();g.useEffect(()=>{!P&&r!=null&&_&&(B(!0),G.trackTransactionList(r.accountId,void 0,a,r.title),c(ge(r.accountId,r.accountType,r.period,void 0,!1,x)))},[P,r,c,_]);const ke=[l,m,S,T,D,y].filter(v=>v!=null);return w&&i!=null?s.jsx(Ze,{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(z,{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=K().state?.referrer,e=h(n=>n.expenseAutomationViewState.selectedPeriodByTenantId)[h(n=>Q(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(Ge,{})}),s.jsx(j,{path:"/*",element:s.jsx(Te,{referrerType:a})}),s.jsx(j,{path:"/uncategorized-income/*",element:s.jsx(N,{})}),s.jsx(j,{path:"/uncategorized-expense/*",element:t?s.jsx(z,{to:`../../month_end_close_checks/review/transaction_categorization/${e.month}-${e.year}`}):s.jsx(N,{})}),s.jsx(j,{path:"/miscategorized-income/*",element:s.jsx(N,{})}),s.jsx(j,{path:"/miscategorized-expense/*",element:t?s.jsx(z,{to:`../../month_end_close_checks/review/transaction_categorization/${e.month}-${e.year}`}):s.jsx(N,{})}),s.jsx(j,{path:"/missing-receipts/*",element:t?s.jsx(z,{to:`../../month_end_close_checks/review/missing_receipts/${e.month}-${e.year}`}):s.jsx(N,{})}),s.jsx(j,{path:"/by-class/:accountTypeEncoded/:accountIdEncoded/:classIdEncoded/:timeframe/:startDate/:endDate/:titleEncoded/*",element:s.jsx(Ve,{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,4 +1,4 @@
|
|
|
1
|
-
import{j as e}from"./liveblocks-
|
|
1
|
+
import{j as e}from"./liveblocks-DTbLGSQH.js";import{h as F,g as B,u as L,i as O,j as g,N as D,n as G,o as Te,p as k}from"./core-DcS-HXN0.js";import{cr as N,eW as E,Qo as U,Gp as ae,fV as Q,G7 as ne,Qq as Ie,Gs as ke,Qm as je,Qn as se,QC as be,Ew as Ae,ua as Ee,Qs as ve,GL as De,Qp as re,cV as H,yt as oe,fB as Fe,fD as Be,RB as Le,RC as Ue,G8 as Pe,RD as Re,G9 as Me,Gi as Ve,bs as Oe,bJ as Ge,cC as Ne,bK as _e,cq as ze,bt as $e,LZ as Ze,cp as Qe}from"./zeni-epic-state-D9zlxAus.js";import{k as _,ar as He,z as A,D as z,d as j,ch as qe,ci as Ke,cj as Z,K as q,y as We,Z as Je,a0 as Xe,C as ie,G as v,F as Ye,B as et,ck as tt,au as K,s as at,cl as nt,r as W,cm as st,H as X,cn as rt,i as ot}from"./index-DC0dQLD1.js";import{D as it,n as R,S as ct}from"./mui-D4oYUocG.js";import lt from"./NotFoundScreen-DicN0NsA.js";import{S as Y}from"./SetupPagesScreen-BwdSvHh-.js";import{a as p}from"./sentry--iMGn_c-.js";import{u as ut}from"./useAskAiCfoHostNavButtonProps-CvQ724tN.js";import{u as dt}from"./useInitialThreadRequest-zbm4ek8Z.js";import{u as pt}from"./useCashManagementBanner-DewpKyRp.js";import{M as ce}from"./MobileAppDrawer-DmvUd-9k.js";import{F as mt}from"./FeaturePreviewScreen-D3aqd5vk.js";import{a as ee}from"./analyticsHelper-DsJZpHCL.js";import"./recharts-B-6eSeb6.js";import"./analytics-C2sLqqt-.js";import"./plaid-DnXASLGE.js";import"./dnd-D_MmPpoN.js";import"./stripe-DMRn4zHo.js";import"./lottie-XNZ0j4Vk.js";import"./lexical-BhgGR8eI.js";import"./pdf-kyzMB0kM.js";import"./utils-CiOzvYGH.js";import"./routePaths-CD1cpX2J.js";import"./BusinessVerificationPageScreen-4IUxwsvU.js";(function(){try{var t=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},a=new t.Error().stack;a&&(t._sentryDebugIds=t._sentryDebugIds||{},t._sentryDebugIds[a]="46c4645c-47e1-44c5-a7aa-d8f4837ba100",t._sentryDebugIdIdentifier="sentry-dbid-46c4645c-47e1-44c5-a7aa-d8f4837ba100")}catch{}})();const ft=G(function(t,a){const{companyId:n}=a;return{treasurySetupView:U(t,n),analytics:j}},function(t,a){const{navigate:n,analytics:r,treasurySetupView:m}=a;return{onBackClick:()=>{n("../")},onNextClick:()=>{const s=m.fundAllocationLocalData;r.trackTreasuryPortfolioConfirm(s.riskScore,ee(s)),t(ke(!0))},onUpdateFundAllocation:s=>{r.trackTreasuryAllocationAction("update",ee(s)),t(Ie(s))}}})(qe);function yt(){const t=F(),a=B(),n=L(),{tenantEmailDomain:r}=O(),m=_(),s=g(I=>I.treasurySetupViewState.portfolioAllocationUpdateStatus?.fetchState),f=He(s),o=N(m?.loggedInUserRoleMap),[u,i]=p.useState(!1),[d,w]=p.useState(!1),[c,l]=p.useState(!1),S=g(I=>E(I)),y=A.getSignedInUserTenant(r)?.companyId??S.companyId,C=A.getSignedInUser(),h=g(I=>U(I,y)),T=g(I=>I.treasurySetupViewState.fetchState),x=g(I=>I.treasurySetupViewState.currentAllocation.fetchStatus?.fetchState),M=g(I=>I.treasurySetupViewState.treasuryFundsDetails?.fetchStatus?.fetchState);if(C==null)throw Error("Can't access treasury portfolio allocation page without signing in...");if(p.useEffect(()=>{u||T!=="Not-Started"||y==null||(i(!0),n(ae(y,!0,!1)))},[u,T,y,n]),p.useEffect(()=>{c||M!=="Not-Started"||y==null||(l(!0),n(Q()))},[c,M,y,n]),p.useEffect(()=>{d||x!=="Not-Started"||y==null||(w(!0),n(ne()))},[d,x,y,n]),p.useEffect(()=>{f==="In-Progress"&&s==="Completed"&&t("../")},[f,s,t]),S.companyTreasuryInfo?.info?.isTreasuryTOSAccepted===!1)return e.jsx(D,{to:"../promo"});const P=S.companyTreasuryInfo?.info?.isTreasuryTOSAccepted!==!0||T!=="Completed";return e.jsxs(e.Fragment,{children:[!P&&e.jsx(z,{analytics:j,onLoad:()=>{}}),e.jsx(ft,{navigate:t,location:a,companyId:y,isEditMode:!0,isLoading:P,isReadOnly:!o,treasurySetupView:h,analytics:j})]})}const gt=G(function(t,a){const n=a.currentTenant?.companyId;return{plaidConnectionDetails:be(t,n,"zeni_treasury","treasury_setup").plaidConnectionDetails,treasurySetupView:U(t,n)}},function(t,a){const{navigate:n,transferDetails:r,treasurySetupView:m}=a,s=r.treasuryTransferMoneyLocalData,f=m.fundAllocationLocalData;return{onCancelClick:()=>{Z(a.analytics,"cancel",s,f,"Transfer"),t(se()),n("../")},onTransferClick:()=>{Z(a.analytics,"confirm",s,f,"Transfer"),t(De())},onSaveChangesToLocalStore:o=>{t(ve(o))},onFetchLinkTokenClick:o=>{t(Ee("treasury_setup",o))},onEstablishConnectionClick:o=>{t(Ae(o,a.currentTenant?.companyId,"treasury_setup","zeni_treasury"))}}})(Ke),ht=({isFirstTransfer:t})=>{const a=F(),{tenantEmailDomain:n}=O(),r=L(),[m,s]=p.useState(!1),[f,o]=p.useState(!1),[u,i]=p.useState(!1),[d,w]=p.useState(!1),c=g(x=>x.treasurySetupViewState.fetchState),l=g(x=>x.treasurySetupViewState.treasuryFundsDetails?.fetchStatus?.fetchState),S=g(x=>x.treasurySetupViewState.currentAllocation.fetchStatus?.fetchState),y=g(x=>E(x)),C=A.getSignedInUserTenant(n)?.companyId??y.companyId,h=g(x=>je(x)),T=g(x=>U(x,C));if(A.getSignedInUser()==null)throw Error("Can't access treasury transfer page without signing in...");return p.useEffect(()=>{f||c!=="Not-Started"||C==null||(o(!0),r(ae(C,!0,!1)))},[f,c,C,r]),p.useEffect(()=>{u||l!=="Not-Started"||C==null||(i(!0),r(Q()))},[u,l,C,r]),p.useEffect(()=>{d||S!=="Not-Started"||C==null||(w(!0),r(ne()))},[d,S,C,r]),e.jsxs(e.Fragment,{children:[e.jsx(z,{analytics:j,onLoad:()=>{}}),e.jsx(gt,{analytics:j,navigate:a,transferDetails:h,onAnotherTransferClick:()=>{s(!1),r(se())},currentTenant:y,treasurySetupView:T,showReviewContent:m,maxInsuredAmount:5e5,onReviewClick:()=>{Z(j,"review",h.treasuryTransferMoneyLocalData,T.fundAllocationLocalData,"Transfer"),s(!0)},isFirstTransfer:t,setShowReviewContent:s,onBackClick:()=>{}})]})},St=R.div`
|
|
2
2
|
display: flex;
|
|
3
3
|
min-height: 100%;
|
|
4
4
|
width: 100%;
|