@zeniai/web-app-ui 5.1.62-dev → 5.1.62-qa
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-DvuqFlm5.js → AddressRoutes-CZL5IIDj.js} +1 -1
- package/dist/assets/{AddressScreen-D7DCNUGo.js → AddressScreen-CxOVTdB3.js} +1 -1
- package/dist/assets/{AiCfoScreen-Bv6DgXwH.js → AiCfoScreen-Ufyr17L2.js} +1 -1
- package/dist/assets/{BillPayApprovalRoutes-DxIJLeU6.js → BillPayApprovalRoutes-COMjZNBM.js} +1 -1
- package/dist/assets/{BillPayRoutes-CxAjptk9.js → BillPayRoutes-ycYrxG7k.js} +1 -1
- package/dist/assets/{BusinessVerificationPageScreen-HLhTZBjl.js → BusinessVerificationPageScreen-BSOfMkHj.js} +1 -1
- package/dist/assets/{CardsAiCfoScreen-BQXIEsXX.js → CardsAiCfoScreen-BofarOgC.js} +1 -1
- package/dist/assets/{ChargeCardRoutes-CF9hoDo5.js → ChargeCardRoutes-iiwF-L1o.js} +1 -1
- package/dist/assets/{CompanyPassportScreen-Dd-P8T6z.js → CompanyPassportScreen-N6HtNLO2.js} +1 -1
- package/dist/assets/{ConnectionAuthScreen-BWQPD0qS.js → ConnectionAuthScreen-GiDrTcJ9.js} +1 -1
- package/dist/assets/{CustomerOnboardingAuthScreen-BycVZ7K6.js → CustomerOnboardingAuthScreen-CIo2QvBW.js} +1 -1
- package/dist/assets/{CustomerOnboardingRoutes-B4tFhrDj.js → CustomerOnboardingRoutes-C39jSTCn.js} +1 -1
- package/dist/assets/{DashboardRoutes-uPgpLI1W.js → DashboardRoutes-dFcQ-Udv.js} +1 -1
- package/dist/assets/{DefaultTenantHome-Bhp_uriR.js → DefaultTenantHome-CiIQC--y.js} +1 -1
- package/dist/assets/{DomesticWireDetailScreen-YZRErnfJ.js → DomesticWireDetailScreen-Cv3GFhdJ.js} +1 -1
- package/dist/assets/{DrawerScreen-BqYmVuny.js → DrawerScreen-Dz_Ifi-A.js} +1 -1
- package/dist/assets/{EntityDetailRoutes-DbpAgwXS.js → EntityDetailRoutes-CGqc-n2O.js} +1 -1
- package/dist/assets/{ExpenseAutomationRoutes-ChVJkArc.js → ExpenseAutomationRoutes-iUGrHrmT.js} +1 -1
- package/dist/assets/{FeaturePreviewScreen-kp5WtNsg.js → FeaturePreviewScreen-CdQFs282.js} +1 -1
- package/dist/assets/{HubSpotOAuthCallbackScreen-BAfTUuIq.js → HubSpotOAuthCallbackScreen-Crp8q0ZQ.js} +1 -1
- package/dist/assets/{MagicLinkRoutes-CGh8IMWW.js → MagicLinkRoutes-BPzX2NJX.js} +1 -1
- package/dist/assets/{MagicLinkSignInScreen-BFMyglUM.js → MagicLinkSignInScreen-BoA-7inn.js} +1 -1
- package/dist/assets/{MobileAppDrawer-BuakBUGx.js → MobileAppDrawer-cGG4tefr.js} +1 -1
- package/dist/assets/{NotFoundScreen-AsC21qGx.js → NotFoundScreen-DmxmtGfC.js} +1 -1
- package/dist/assets/{NotificationRoutes-B06j6V42.js → NotificationRoutes-DRjXwQc4.js} +1 -1
- package/dist/assets/{OAuthConsentScreen-B6euKfvQ.js → OAuthConsentScreen-HR6-AToH.js} +1 -1
- package/dist/assets/{PandLWithForecastRoutes-DfEV7guz.js → PandLWithForecastRoutes-COEiLMeU.js} +1 -1
- package/dist/assets/{PeopleRoutes-qz_hXV4C.js → PeopleRoutes-CQ7KgSTF.js} +1 -1
- package/dist/assets/{PerformanceRoutes-v5FcQW2N.js → PerformanceRoutes-CUptxU2M.js} +1 -1
- package/dist/assets/{QBOConnectionScreen-Cx74YOuE.js → QBOConnectionScreen-MiEEvzBf.js} +1 -1
- package/dist/assets/{ReferralListScreen-G8WgDfU8.js → ReferralListScreen-BqOgHlgl.js} +1 -1
- package/dist/assets/{ReimbursementApprovalRoutes-yvcY1FyR.js → ReimbursementApprovalRoutes-CuEZag2r.js} +1 -1
- package/dist/assets/{ReimbursementApprovalRuleDetailScreen-s9Cc-PAW.js → ReimbursementApprovalRuleDetailScreen-DSLe2MhL.js} +1 -1
- package/dist/assets/{ReimbursementRoutes-vHQ3hpWm.js → ReimbursementRoutes--RsJPCEP.js} +1 -1
- package/dist/assets/{ReportsRoutes-DIUc8s5q.js → ReportsRoutes-uT5eAJf1.js} +1 -1
- package/dist/assets/{RewardsRoutes-lnm6cAkX.js → RewardsRoutes-DNPQGfAV.js} +1 -1
- package/dist/assets/{ScreenRoutes-CAtz09zv.js → ScreenRoutes-BEMAKpuY.js} +2 -2
- package/dist/assets/{SettingsRoutes-B4g8CJnG.js → SettingsRoutes-DqieIzNx.js} +1 -1
- package/dist/assets/{SetupPagesScreen-BkPb95y9.js → SetupPagesScreen-Pz567UQO.js} +1 -1
- package/dist/assets/{SignInScreen-Dhh5qz65.js → SignInScreen-DPJ9eMik.js} +1 -1
- package/dist/assets/{SignOutScreen-3sXSL_QM.js → SignOutScreen-BmbWt3Pd.js} +1 -1
- package/dist/assets/{TaskListScreen-DGOHeeuZ.js → TaskListScreen-Chd2rxBe.js} +1 -1
- package/dist/assets/{TaskRoutes-CDomkVrp.js → TaskRoutes-DXfXoaYF.js} +1 -1
- package/dist/assets/{TransactionDetailRoutes-BXwhj2nX.js → TransactionDetailRoutes-Dko7BvP2.js} +1 -1
- package/dist/assets/{TransactionDetailScreen-DUZV5JDK.js → TransactionDetailScreen-B7KMTXiT.js} +1 -1
- package/dist/assets/{TransactionListRoutes-CDDcflri.js → TransactionListRoutes-MalhqO-o.js} +1 -1
- package/dist/assets/{TreasuryRoutes-CZyF8G2k.js → TreasuryRoutes-BJIzvR2Q.js} +1 -1
- package/dist/assets/{VendorsRoutes-B0mGOZoL.js → VendorsRoutes-45nX3W2c.js} +1 -1
- package/dist/assets/{WiseConfirmationScreen-B3-wTx7l.js → WiseConfirmationScreen-CWe-skzP.js} +1 -1
- package/dist/assets/{ZeniAccountRoutes-BeZsG6M5.js → ZeniAccountRoutes-DWsFxkzK.js} +1 -1
- package/dist/assets/{ZeniAccountStatementScreen-CU5lpB3Y.js → ZeniAccountStatementScreen-BqtUjZCP.js} +1 -1
- package/dist/assets/{analyticsHelper-CQXeRvKo.js → analyticsHelper-MomIUc09.js} +1 -1
- package/dist/assets/{getLocaleForTenant-C55KVru2.js → getLocaleForTenant-DBZLLRpQ.js} +1 -1
- package/dist/assets/{index-DsVH62ZK.js → index-BsmcHa9A.js} +5 -5
- package/dist/assets/{routePaths-Dq5U7lhs.js → routePaths-ieN8hn7m.js} +1 -1
- package/dist/assets/{useAiCfoDashboardSuggestedQuestionsChips-BzB3gTK8.js → useAiCfoDashboardSuggestedQuestionsChips-Ber5T8-o.js} +1 -1
- package/dist/assets/{useAskAiCfoHostNavButtonProps-uVGdd0zj.js → useAskAiCfoHostNavButtonProps-5Ek-t3F9.js} +1 -1
- package/dist/assets/{useCashManagementBanner-BB3WgTJ-.js → useCashManagementBanner-B0ma2Yzx.js} +1 -1
- package/dist/assets/{useChargeCardPusherEvents-BOkZNaGv.js → useChargeCardPusherEvents-RkbvNufi.js} +1 -1
- package/dist/assets/{useEmailConnectResultRefresh-FRZ2xd4V.js → useEmailConnectResultRefresh-CiHOFzmr.js} +1 -1
- package/dist/assets/{useInitialThreadRequest-D9ebiXdA.js → useInitialThreadRequest-Dr9FuJUY.js} +1 -1
- package/dist/assets/{withTransactionSidePanel-iGXE6khP.js → withTransactionSidePanel-C15NQsNY.js} +1 -1
- package/dist/index.html +1 -1
- package/package.json +1 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{j as s}from"./liveblocks-evjZPqs_.js";import{h as W,u as re,g as H,i as X,j as E,N as _,n as K,l as mt,o as ct,p as C}from"./core-DmAftQ4g.js";import{eW as Z,QI as le,c6 as me,EE as Be,kG as dt,ER as ne,EQ as ae,QJ as ut,bn as ce,gn as Te,QK as pt,N5 as bt,kv as Fe,N6 as Se,N7 as gt,jq as ht,P$ as ft,jF as St,Es as It,u9 as Rt,jx as yt,Fc as je,QL as De,QM as At,QN as kt,QO as vt,QP as Ct,QQ as Et,EY as Ie,jL as wt,Q8 as xt,ES as Bt,EC as Tt,QR as Ft,EB as jt,QS as Dt,EK as Re,F0 as Ut,E$ as Lt,EX as Pt,QT as Ue,Kb as $t,bq as Mt,EN as _t,Fu as Nt,QU as Qt,QV as Ot,F8 as zt,F5 as ye,Pu as Gt,Ez as Ht,QW as Le,FW as Ae,G2 as Zt,QX as Vt,QY as z,QZ as Wt,Q_ as Pe,Q$ as Kt,R0 as $e,R1 as Me,Fk as se,bu as qt,bK as de,cG as ue,fB as _e,fz as Ne,R2 as Jt,fw as Xt,PH as Yt,R3 as en,R4 as Qe,PL as tn,Qt as nn,R5 as an,QH as sn,F$ as ke,F_ as on,R6 as rn,R7 as ln,R8 as mn,R9 as cn,Ra as dn,Qe as un,FR as pn,FV as bn,bs as gn,bJ as hn,cA as fn,co as Sn,bt as In,LV as Rn,cQ as yn,cS as An,cR as kn,cz as vn}from"./zeni-epic-state-vtQ66nN6.js";import{v as Oe,Z as ze,W as Y,U as k,z as $,b$ as Ge,x as ee,c as v,aK as ve,o as j,au as J,C as Cn,O as He,c0 as En,q as G,_ as Ze,c1 as wn,I as te,c2 as xn,X as Bn,y as Tn,B as pe,e as Ve,a7 as Fn,bn as jn,a2 as Dn,m as We,c3 as Un,a9 as Ln}from"./index-DsVH62ZK.js";import{n as N,S as Pn}from"./mui-PcDpEhsm.js";import ie from"./NotFoundScreen-AsC21qGx.js";import{S as Ce}from"./SetupPagesScreen-BkPb95y9.js";import{F as Ke}from"./FeaturePreviewScreen-kp5WtNsg.js";import{a as f}from"./sentry-CCZGmBkl.js";import{u as be}from"./useAskAiCfoHostNavButtonProps-uVGdd0zj.js";import{u as qe}from"./useInitialThreadRequest-D9ebiXdA.js";import{D as $n}from"./DrawerScreen-BqYmVuny.js";import{M as Je}from"./MobileAppDrawer-BuakBUGx.js";import{R as Mn}from"./ReimbursementApprovalRoutes-yvcY1FyR.js";import{FallBackRoute as _n}from"./ScreenRoutes-CAtz09zv.js";import"./recharts-CgEqsrFw.js";import"./analytics-DCrhd8oB.js";import"./plaid-DSnXUEUK.js";import"./dnd-3F1D24DQ.js";import"./stripe-DMRn4zHo.js";import"./lottie-CmTLY-9t.js";import"./lexical-PVlNGkpS.js";import"./pdf-CbXlPYUs.js";import"./utils--mWNe9J7.js";import"./analyticsHelper-CQXeRvKo.js";import"./routePaths-Dq5U7lhs.js";import"./BusinessVerificationPageScreen-HLhTZBjl.js";import"./ReimbursementApprovalRuleDetailScreen-s9Cc-PAW.js";import"./getLocaleForTenant-C55KVru2.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]="5316dca9-0939-4498-ae2d-24fe5defa88c",e._sentryDebugIdIdentifier="sentry-dbid-5316dca9-0939-4498-ae2d-24fe5defa88c")}catch{}})();const Xe=e=>`/${e}/reimbursements`,Nn=e=>f.createElement("svg",{viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",...e},f.createElement("path",{d:"M12.5 3.5L3.5 12.5",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round"}),f.createElement("path",{d:"M12.5 12.5L3.5 3.5",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round"})),{spendManagement:{reimbursement:{reimbursementDetail:L}}}=He.getLocalizedStrings(),Qn=K(function(e,t){const n=t.currentTenant?.companyId,r=ut(e.plaidAccountViewState,"user_reimbursement_account"),d=$.getSignedInUser(),c=ce(d),m=r.plaidConnectionDetails,o=Te(e.companyState,n),a=e.tenantState.currentTenantId,i={userId:d?.userId??"",sessionId:d?.zeniSessionId??"",tenantId:a??""},l=le(e,t.reimbursementId),b=pt(e,d?.userId??"");let 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:`${J.communicationAgentMicroServiceBaseUrl}`,reimbursementId:t.reimbursementId,customerSearchAutoCompleteData:{autoCompleteText:T,entityAutoCompleteView:u},authParams:i,defaultCurrency:{currencySymbol:o?.company.companyLocaleInfo.currencySymbol??"$",currencyCode:o?.company.companyLocaleInfo.currencyCode??"USD"},companyMileageConfigInfo:o?.company.configInfo.mileageRateConfig,createdBy:y,isUserAdmin:me(t.currentTenant?.userRole??[]),isZeniUser:c,plaidConnectionDetails:m,bankNameByRouting:l.bankNameByRouting,bankAccountCreationState:b.bankAccountCreationState,bankAccounts:b.bankAccounts,analytics:v,bankAccountToCreate:l.bankAccountToCreate,fetchBankNameByRoutingStatus:l.fetchBankNameByRoutingStatus,isSignedInUserReimbursementCreator:h,disableInternalOverlay:t.disableInternalOverlay,showSkipAutoFill:t.showSkipAutoFill,setShowSkipAutoFill:t.setShowSkipAutoFill,isAccountingClassesEnabled:Fe(e)}},function(e,t){const{reimbursementId:n,currentTenant:r,location:d,navigate:c,themeState:m}=t,{tenantEmailDomain:o}=r,a=$.getSignedInUser();return{onReceiptsUpload:(i,l,b)=>{i!=null&&e(ae(i,l,b,n,a?.userId))},onExistingMerchantChange:(i,l)=>{e(Re(!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(Re(!1,l,n,void 0,i))},removeFileFromLine:i=>{e(Dt({lineId:i,reimbursementId:n}))},onAmountChanged:(i,l)=>{e(jt(l,i,n))},updateReimbursementType:(i,l,b)=>{e(Ft({reimbursementId:b,lineId:l,reimbursementType:i}))},onHomeCurrencyConversionUpdate:(i,l,b)=>{e(Tt({reimbursementId:b,lineId:l,amountPayload:{amount:i.amount,currency_code:i.currencyCode,currency_symbol:i.currencySymbol}}))},onReimbursementDetailsChanged:i=>{e(Bt({remiDetailLocalData:i,reimbursementId:n}))},saveRemiDetails:i=>{e(Ie(i,!1,n))},onUserBankDetailsUpdated:i=>{const{bankAccountSection:l}=i;e(xt({data:l}))},onFetchBankName:i=>{e(wt(i))},submitRemiDetails:()=>{e(Ie("pending_approval",!0,n))},discardReimbursementDetailsFromLocalStore:i=>{e(Et({reimbursementId:i}))},updateInvoiceUploadFetchState:i=>{e(ne({reimbursementId:n,fetchState:i}))},clearTentativeNameForLine:i=>{e(Ct({reimbursementId:n,lineId:i}))},removeDuplicateReimbursementForLine:i=>{e(vt({lineId:i}))},onZeniLogoClick:()=>{m.toggle()},clearAddRemiAutoFields:i=>{e(kt({reimbursementId:n,lineId:i}))},redirectToReimbursementListScreen:()=>{e(De()),e(At());const i=Xe(o),l=G(d.state?.pathnameStackToGoBack,d.pathname);c(i,{state:{pathnameStackToGoBack:l}})},redirectToReimbursementDetailScreen:()=>{t.navigate("../")},deleteReimbursement:()=>{n!=null&&(v.trackReimbursementDeleteReimbursement(n),e(je(n)))},onSaveBankAccount:()=>{a?.userId&&e(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(Se("common"))},onCancelAutoComplete:()=>{e(Se("common"))}}}})(En);function Ee(){const e=W(),t=re(),n=H(),{reimbursementId:r}=X(),d=Oe(),c=ze(),[m,o]=f.useState(r==null),[a,i]=f.useState(1),{useFeatureGate:l}=Y(),{isFeatureEnabled:b}=l(k.isLimitedCategoryForReimbursement),{isFeatureEnabled:y}=l(k.isShowDeletedReimbursementsFeatureEnabled),{isFeatureEnabled:h}=l(k.isReimbursementCommentingEnabled),{isAiCfoAccessEnabled:T,onAskAiCfoClick:u}=be({mobileExploreReferrer:"Reimbursement Details"}),w=H().pathname,F=w.includes("edit"),A=w.includes("reimbursement/new"),[D,x]=f.useState(!1),B=$.getSignedInUser(),I=E(p=>Z(p)),g=E(p=>le(p,r)),P=qe(I?.companyId,{clearParams:g.fetchState==="Completed"}),U=me(I?.userRole??[]);f.useEffect(()=>{(A&&!D||F&&g.fetchState!="Completed"&&g.fetchState!="In-Progress")&&(x(!0),t(Be(!1,b,y,r)))});const M=E(p=>dt(p.accountState,p.accountListState,"reimbursementAccountList"));if(B==null)throw Error("Can't access address page without signing in...");const R={pathname:`../${r}`,search:n.search};return g.isDeleted===!0||g.billStage=="paid"||g.billStage=="scheduled"||g.fetchState=="Not-Started"||U&&g.billStatus==="rejected"||U===!1&&g.billStage==="pending_approval"&&g.billStatus!=="rejected"?s.jsx(_,{to:R}):g.deleteStatus.fetchState==="In-Progress"||g.fetchState!=="Completed"?s.jsx(Ge,{isNewReimbursement:r==null}):s.jsxs(On,{windowSize:c,children:[s.jsx(ee,{analytics:v,onLoad:p=>(V=>{r!=null&&g.deleteStatus.fetchState!=="Completed"&&V.trackReimbursementEditReimbursement(r)})(p)}),m&&c!=="small"?s.jsx(zn,{}):null,m&&c!=="small"?s.jsx(Gn,{children:s.jsx(ve,{showAutofill:m,uploadInvoiceEndPoint:`${J.communicationAgentMicroServiceBaseUrl}`,authParams:{userId:B?.userId??"",sessionId:B?.zeniSessionId??"",tenantId:I?.tenantId??""},onSkipAutofill:()=>o(!1),onInvoiceUpload:p=>{p!=null&&t(ae(p,a,!0,r,B?.userId))},updateInvoiceUploadFetchState:p=>{t(ne({reimbursementId:r,fetchState:p}))},allowMultiFiles:m,showInfoText:!1,type:"reimbursement",style:{width:"100%",paddingTop:"78px",paddingRight:j.sp3,paddingBottom:"15px",paddingLeft:j.sp5},dropFilePlaceholder:{upload:L.dropReceipt.upload,single:L.dropReceipt.single,or:L.dropReceipt.or,multiple:L.dropReceipt.multiple,receipts:L.dropReceipt.receipts}})}):null,m&&c==="small"?s.jsxs(Hn,{children:[s.jsx(Zn,{onClick:()=>o(!1),children:s.jsx(Nn,{})}),s.jsx(ve,{showAutofill:m,uploadInvoiceEndPoint:`${J.communicationAgentMicroServiceBaseUrl}`,authParams:{userId:B?.userId??"",sessionId:B?.zeniSessionId??"",tenantId:I?.tenantId??""},onSkipAutofill:()=>o(!1),onInvoiceUpload:p=>{p!=null&&t(ae(p,a,!0,r,B?.userId))},updateInvoiceUploadFetchState:p=>{t(ne({reimbursementId:r,fetchState:p}))},allowMultiFiles:m,showInfoText:!1,type:"reimbursement",style:{width:"100%",paddingTop:j.sp5,paddingRight:j.sp3,paddingBottom:j.sp5,paddingLeft:j.sp3},dropFilePlaceholder:{upload:L.dropReceipt.upload,single:L.dropReceipt.single,or:L.dropReceipt.or,multiple:L.dropReceipt.multiple,receipts:L.dropReceipt.receipts}})]}):null,s.jsx(Vn,{windowSize:c,children:s.jsx(Qn,{initialOpenThreadRequest:P??void 0,isReimbursementCommentingEnabled:h,location:n,navigate:e,currentTenant:I,reimbursementId:r,themeState:d,uncategorizedAccounts:M,disableInternalOverlay:!0,showSkipAutoFill:m,setShowSkipAutoFill:o,onCurrentLineIdForUploadChange:i,isAiCfoAccessEnabled:T,onAskAiCfoClick:u})})]})}const On=N.div`
|
|
1
|
+
import{j as s}from"./liveblocks-evjZPqs_.js";import{h as W,u as re,g as H,i as X,j as E,N as _,n as K,l as mt,o as ct,p as C}from"./core-DmAftQ4g.js";import{eW as Z,QI as le,c6 as me,EE as Be,kG as dt,ER as ne,EQ as ae,QJ as ut,bn as ce,gn as Te,QK as pt,N5 as bt,kv as Fe,N6 as Se,N7 as gt,jq as ht,P$ as ft,jF as St,Es as It,u9 as Rt,jx as yt,Fc as je,QL as De,QM as At,QN as kt,QO as vt,QP as Ct,QQ as Et,EY as Ie,jL as wt,Q8 as xt,ES as Bt,EC as Tt,QR as Ft,EB as jt,QS as Dt,EK as Re,F0 as Ut,E$ as Lt,EX as Pt,QT as Ue,Kb as $t,bq as Mt,EN as _t,Fu as Nt,QU as Qt,QV as Ot,F8 as zt,F5 as ye,Pu as Gt,Ez as Ht,QW as Le,FW as Ae,G2 as Zt,QX as Vt,QY as z,QZ as Wt,Q_ as Pe,Q$ as Kt,R0 as $e,R1 as Me,Fk as se,bu as qt,bK as de,cG as ue,fB as _e,fz as Ne,R2 as Jt,fw as Xt,PH as Yt,R3 as en,R4 as Qe,PL as tn,Qt as nn,R5 as an,QH as sn,F$ as ke,F_ as on,R6 as rn,R7 as ln,R8 as mn,R9 as cn,Ra as dn,Qe as un,FR as pn,FV as bn,bs as gn,bJ as hn,cA as fn,co as Sn,bt as In,LV as Rn,cQ as yn,cS as An,cR as kn,cz as vn}from"./zeni-epic-state-vtQ66nN6.js";import{v as Oe,Z as ze,W as Y,U as k,z as $,b$ as Ge,x as ee,c as v,aK as ve,o as j,au as J,C as Cn,O as He,c0 as En,q as G,_ as Ze,c1 as wn,I as te,c2 as xn,X as Bn,y as Tn,B as pe,e as Ve,a7 as Fn,bn as jn,a2 as Dn,m as We,c3 as Un,a9 as Ln}from"./index-BsmcHa9A.js";import{n as N,S as Pn}from"./mui-PcDpEhsm.js";import ie from"./NotFoundScreen-DmxmtGfC.js";import{S as Ce}from"./SetupPagesScreen-Pz567UQO.js";import{F as Ke}from"./FeaturePreviewScreen-CdQFs282.js";import{a as f}from"./sentry-CCZGmBkl.js";import{u as be}from"./useAskAiCfoHostNavButtonProps-5Ek-t3F9.js";import{u as qe}from"./useInitialThreadRequest-Dr9FuJUY.js";import{D as $n}from"./DrawerScreen-Dz_Ifi-A.js";import{M as Je}from"./MobileAppDrawer-cGG4tefr.js";import{R as Mn}from"./ReimbursementApprovalRoutes-CuEZag2r.js";import{FallBackRoute as _n}from"./ScreenRoutes-BEMAKpuY.js";import"./recharts-CgEqsrFw.js";import"./analytics-DCrhd8oB.js";import"./plaid-DSnXUEUK.js";import"./dnd-3F1D24DQ.js";import"./stripe-DMRn4zHo.js";import"./lottie-CmTLY-9t.js";import"./lexical-PVlNGkpS.js";import"./pdf-CbXlPYUs.js";import"./utils--mWNe9J7.js";import"./analyticsHelper-MomIUc09.js";import"./routePaths-ieN8hn7m.js";import"./BusinessVerificationPageScreen-BSOfMkHj.js";import"./ReimbursementApprovalRuleDetailScreen-DSLe2MhL.js";import"./getLocaleForTenant-DBZLLRpQ.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]="5316dca9-0939-4498-ae2d-24fe5defa88c",e._sentryDebugIdIdentifier="sentry-dbid-5316dca9-0939-4498-ae2d-24fe5defa88c")}catch{}})();const Xe=e=>`/${e}/reimbursements`,Nn=e=>f.createElement("svg",{viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",...e},f.createElement("path",{d:"M12.5 3.5L3.5 12.5",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round"}),f.createElement("path",{d:"M12.5 12.5L3.5 3.5",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round"})),{spendManagement:{reimbursement:{reimbursementDetail:L}}}=He.getLocalizedStrings(),Qn=K(function(e,t){const n=t.currentTenant?.companyId,r=ut(e.plaidAccountViewState,"user_reimbursement_account"),d=$.getSignedInUser(),c=ce(d),m=r.plaidConnectionDetails,o=Te(e.companyState,n),a=e.tenantState.currentTenantId,i={userId:d?.userId??"",sessionId:d?.zeniSessionId??"",tenantId:a??""},l=le(e,t.reimbursementId),b=pt(e,d?.userId??"");let 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:`${J.communicationAgentMicroServiceBaseUrl}`,reimbursementId:t.reimbursementId,customerSearchAutoCompleteData:{autoCompleteText:T,entityAutoCompleteView:u},authParams:i,defaultCurrency:{currencySymbol:o?.company.companyLocaleInfo.currencySymbol??"$",currencyCode:o?.company.companyLocaleInfo.currencyCode??"USD"},companyMileageConfigInfo:o?.company.configInfo.mileageRateConfig,createdBy:y,isUserAdmin:me(t.currentTenant?.userRole??[]),isZeniUser:c,plaidConnectionDetails:m,bankNameByRouting:l.bankNameByRouting,bankAccountCreationState:b.bankAccountCreationState,bankAccounts:b.bankAccounts,analytics:v,bankAccountToCreate:l.bankAccountToCreate,fetchBankNameByRoutingStatus:l.fetchBankNameByRoutingStatus,isSignedInUserReimbursementCreator:h,disableInternalOverlay:t.disableInternalOverlay,showSkipAutoFill:t.showSkipAutoFill,setShowSkipAutoFill:t.setShowSkipAutoFill,isAccountingClassesEnabled:Fe(e)}},function(e,t){const{reimbursementId:n,currentTenant:r,location:d,navigate:c,themeState:m}=t,{tenantEmailDomain:o}=r,a=$.getSignedInUser();return{onReceiptsUpload:(i,l,b)=>{i!=null&&e(ae(i,l,b,n,a?.userId))},onExistingMerchantChange:(i,l)=>{e(Re(!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(Re(!1,l,n,void 0,i))},removeFileFromLine:i=>{e(Dt({lineId:i,reimbursementId:n}))},onAmountChanged:(i,l)=>{e(jt(l,i,n))},updateReimbursementType:(i,l,b)=>{e(Ft({reimbursementId:b,lineId:l,reimbursementType:i}))},onHomeCurrencyConversionUpdate:(i,l,b)=>{e(Tt({reimbursementId:b,lineId:l,amountPayload:{amount:i.amount,currency_code:i.currencyCode,currency_symbol:i.currencySymbol}}))},onReimbursementDetailsChanged:i=>{e(Bt({remiDetailLocalData:i,reimbursementId:n}))},saveRemiDetails:i=>{e(Ie(i,!1,n))},onUserBankDetailsUpdated:i=>{const{bankAccountSection:l}=i;e(xt({data:l}))},onFetchBankName:i=>{e(wt(i))},submitRemiDetails:()=>{e(Ie("pending_approval",!0,n))},discardReimbursementDetailsFromLocalStore:i=>{e(Et({reimbursementId:i}))},updateInvoiceUploadFetchState:i=>{e(ne({reimbursementId:n,fetchState:i}))},clearTentativeNameForLine:i=>{e(Ct({reimbursementId:n,lineId:i}))},removeDuplicateReimbursementForLine:i=>{e(vt({lineId:i}))},onZeniLogoClick:()=>{m.toggle()},clearAddRemiAutoFields:i=>{e(kt({reimbursementId:n,lineId:i}))},redirectToReimbursementListScreen:()=>{e(De()),e(At());const i=Xe(o),l=G(d.state?.pathnameStackToGoBack,d.pathname);c(i,{state:{pathnameStackToGoBack:l}})},redirectToReimbursementDetailScreen:()=>{t.navigate("../")},deleteReimbursement:()=>{n!=null&&(v.trackReimbursementDeleteReimbursement(n),e(je(n)))},onSaveBankAccount:()=>{a?.userId&&e(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(Se("common"))},onCancelAutoComplete:()=>{e(Se("common"))}}}})(En);function Ee(){const e=W(),t=re(),n=H(),{reimbursementId:r}=X(),d=Oe(),c=ze(),[m,o]=f.useState(r==null),[a,i]=f.useState(1),{useFeatureGate:l}=Y(),{isFeatureEnabled:b}=l(k.isLimitedCategoryForReimbursement),{isFeatureEnabled:y}=l(k.isShowDeletedReimbursementsFeatureEnabled),{isFeatureEnabled:h}=l(k.isReimbursementCommentingEnabled),{isAiCfoAccessEnabled:T,onAskAiCfoClick:u}=be({mobileExploreReferrer:"Reimbursement Details"}),w=H().pathname,F=w.includes("edit"),A=w.includes("reimbursement/new"),[D,x]=f.useState(!1),B=$.getSignedInUser(),I=E(p=>Z(p)),g=E(p=>le(p,r)),P=qe(I?.companyId,{clearParams:g.fetchState==="Completed"}),U=me(I?.userRole??[]);f.useEffect(()=>{(A&&!D||F&&g.fetchState!="Completed"&&g.fetchState!="In-Progress")&&(x(!0),t(Be(!1,b,y,r)))});const M=E(p=>dt(p.accountState,p.accountListState,"reimbursementAccountList"));if(B==null)throw Error("Can't access address page without signing in...");const R={pathname:`../${r}`,search:n.search};return g.isDeleted===!0||g.billStage=="paid"||g.billStage=="scheduled"||g.fetchState=="Not-Started"||U&&g.billStatus==="rejected"||U===!1&&g.billStage==="pending_approval"&&g.billStatus!=="rejected"?s.jsx(_,{to:R}):g.deleteStatus.fetchState==="In-Progress"||g.fetchState!=="Completed"?s.jsx(Ge,{isNewReimbursement:r==null}):s.jsxs(On,{windowSize:c,children:[s.jsx(ee,{analytics:v,onLoad:p=>(V=>{r!=null&&g.deleteStatus.fetchState!=="Completed"&&V.trackReimbursementEditReimbursement(r)})(p)}),m&&c!=="small"?s.jsx(zn,{}):null,m&&c!=="small"?s.jsx(Gn,{children:s.jsx(ve,{showAutofill:m,uploadInvoiceEndPoint:`${J.communicationAgentMicroServiceBaseUrl}`,authParams:{userId:B?.userId??"",sessionId:B?.zeniSessionId??"",tenantId:I?.tenantId??""},onSkipAutofill:()=>o(!1),onInvoiceUpload:p=>{p!=null&&t(ae(p,a,!0,r,B?.userId))},updateInvoiceUploadFetchState:p=>{t(ne({reimbursementId:r,fetchState:p}))},allowMultiFiles:m,showInfoText:!1,type:"reimbursement",style:{width:"100%",paddingTop:"78px",paddingRight:j.sp3,paddingBottom:"15px",paddingLeft:j.sp5},dropFilePlaceholder:{upload:L.dropReceipt.upload,single:L.dropReceipt.single,or:L.dropReceipt.or,multiple:L.dropReceipt.multiple,receipts:L.dropReceipt.receipts}})}):null,m&&c==="small"?s.jsxs(Hn,{children:[s.jsx(Zn,{onClick:()=>o(!1),children:s.jsx(Nn,{})}),s.jsx(ve,{showAutofill:m,uploadInvoiceEndPoint:`${J.communicationAgentMicroServiceBaseUrl}`,authParams:{userId:B?.userId??"",sessionId:B?.zeniSessionId??"",tenantId:I?.tenantId??""},onSkipAutofill:()=>o(!1),onInvoiceUpload:p=>{p!=null&&t(ae(p,a,!0,r,B?.userId))},updateInvoiceUploadFetchState:p=>{t(ne({reimbursementId:r,fetchState:p}))},allowMultiFiles:m,showInfoText:!1,type:"reimbursement",style:{width:"100%",paddingTop:j.sp5,paddingRight:j.sp3,paddingBottom:j.sp5,paddingLeft:j.sp3},dropFilePlaceholder:{upload:L.dropReceipt.upload,single:L.dropReceipt.single,or:L.dropReceipt.or,multiple:L.dropReceipt.multiple,receipts:L.dropReceipt.receipts}})]}):null,s.jsx(Vn,{windowSize:c,children:s.jsx(Qn,{initialOpenThreadRequest:P??void 0,isReimbursementCommentingEnabled:h,location:n,navigate:e,currentTenant:I,reimbursementId:r,themeState:d,uncategorizedAccounts:M,disableInternalOverlay:!0,showSkipAutoFill:m,setShowSkipAutoFill:o,onCurrentLineIdForUploadChange:i,isAiCfoAccessEnabled:T,onAskAiCfoClick:u})})]})}const On=N.div`
|
|
2
2
|
display: flex;
|
|
3
3
|
position: relative;
|
|
4
4
|
height: 100vh;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{j as p}from"./liveblocks-evjZPqs_.js";import{g as G,h as ge,u as Ce,i as we,j as d,n as Ie,o as Se,p as Y}from"./core-DmAftQ4g.js";import{eW as v,fQ as w,Mm as Te,kv as W,qP as X,rE as A,kj as Re,jn as Me,v8 as K,rJ as Oe,bs as Ae,Mn as Fe,bn as ke,wh as De,Mo as je,Mp as Ee,v0 as Pe,Mq as H,Mr as ve,Ms as Le,Mt as Be,Mu as Ve,Mv as I,Mw as F,Mx as k,My as N,Mz as D,MA as j,dJ as Ue,vZ as xe,vN as q,vO as $,w3 as ze,vS as Z,w9 as Ge,MB as Ye,MC as He,MD as Ne,ME as qe,MF as $e,fB as Ze,fz as Qe}from"./zeni-epic-state-vtQ66nN6.js";import{N as Je,Q as We,R as Xe,V as Ke,Z as ea,W as ee,U as E,z as ae,X as aa,I as sa,a as ta,Y as oa,_ as na,x as ra,c as P,e as ia,$ as la,q as se,a0 as ca,a1 as da,a2 as pa}from"./index-DsVH62ZK.js";import"./mui-PcDpEhsm.js";import fa from"./NotFoundScreen-AsC21qGx.js";import{F as ma}from"./FeaturePreviewScreen-kp5WtNsg.js";import{a as _}from"./sentry-CCZGmBkl.js";import{u as ua}from"./useInitialThreadRequest-D9ebiXdA.js";import{t as Q,a as J,b as _a}from"./routePaths-Dq5U7lhs.js";import{M as ba}from"./MobileAppDrawer-BuakBUGx.js";import"./recharts-CgEqsrFw.js";import"./analytics-DCrhd8oB.js";import"./plaid-DSnXUEUK.js";import"./dnd-3F1D24DQ.js";import"./stripe-DMRn4zHo.js";import"./lottie-CmTLY-9t.js";import"./lexical-PVlNGkpS.js";import"./pdf-CbXlPYUs.js";import"./utils--mWNe9J7.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]="a941a05f-92ab-44db-aebe-8bbf0f3e8fb2",e._sentryDebugIdIdentifier="sentry-dbid-a941a05f-92ab-44db-aebe-8bbf0f3e8fb2")}catch{}})();const ha=["profit_loss","balance_sheet","cash_flow"],y=e=>{e(j({resetLeftScroll:!0})),e(D({resetLeftScroll:!0})),e(k({resetLeftScroll:!0})),e(F({resetLeftScroll:!0}))},ya=e=>{e(He()),e(Ne()),e(qe()),e($e())},ga=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=Fe(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:ke(o),showAccountGroups:r===!0,isAccountingClassesEnabled:W(e),isAccountingProjectsEnabled:X(e),currentTenantCompanyName:a,statementEndPoint:`${pa}/statement`,authParams:s,isZeniCOAUsed:r}},function(e,o){const{navigate:f,handleDrawerToggle:u}=o;return{onReloadReport:()=>{o.signedInUser!=null&&e(A(o.signedInUser.userId,!0,!1))},updateDownloadStateHandler:a=>{e(Ye(a))},onTimeframeSelectionChanged:(a,s,t)=>{if(e(Ge(a)),s){const{isCompareModeOn:r,filter:l}=o,{additionalBalances:m,balancesRange:c}=l;let i=[...m];a==="year"&&(i=i.filter(g=>g!=="this_period_vs_same_period_last_year"&&g!=="this_period_vs_same_period_last_year_percent"&&g!=="same_period_last_year")),e(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(H({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 J(o.tenantEmailDomain,a.accountId,a.accountType,s.id,m,r,l)}return a.projectsViewParentId?.projectId!=null&&a.accountType!=null?_a(o.tenantEmailDomain,a.accountId,a.accountType,a.projectsViewParentId.projectId,m,r,l):a.classesViewParentId!=null&&a.classesViewParentId.parentClassId!=null&&a.accountType!=null?J(o.tenantEmailDomain,a.accountId,a.accountType,a.classesViewParentId.parentClassId[0],m,r,l):a.accountType!=null?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(k({scrollPosition:s}));break;case"cash_flow":e(F({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(k({nodeCollapseState:{nodeId:s,isCollapsed:t}}));break;case"cash_flow":e(F({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(H({classViewLayout:a}))},onOpenAccountViewMode:()=>{o.isAccountingClassesEnabled&&e(Pe()),o.isAccountingProjectsEnabled&&e(K())},onUpdateDisplayOrder:a=>{e(Ee(a))},onUpdateReportFormat:a=>{ya(e),e(je(a))},onClickMenuIcon:()=>{u(!0)},onResyncReports:()=>{e(De("profit_and_loss_by_classes"))}}})(ca);function Ca(){const{isAiCfoOpen:e,setIsAiCfoOpen:o}=Ke(),f=ea(),u=da(f),a=ge(),s=Ce(),t=G(),{tenantEmailDomain:r}=we(),{useFeatureGate:l}=ee(),{isFeatureEnabled:m}=l(E.isReportsHorizontalClassLayoutSwitchEnabled),c=ae.getSignedInUser(),[i,g]=_.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),C=d(n=>w(n).fetchState),ie=d(n=>Te(n)),{areTenantIdsInSync:b}=aa(),R=d(n=>n.financeStatementState.selectedReportId),V=d(n=>W(n)),M=d(n=>X(n)),le=d(n=>w(n).isCompareModeOn),h=d(n=>w(n).filter),O=d(n=>w(n).selectedReportAndTimeframeFetchState),ce=d(n=>n.profitAndLossClassesViewState.uiState.classViewLayout);_.useEffect(()=>{!i&&b&&(g(!0),s(A(c.userId,!0,!0,!1)))},[i,c,s,b]),_.useEffect(()=>{i&&!L&&C==="Completed"&&b&&(s(A(c.userId,!1,!0,!1)),te(!0))},[i,L,C,b]),_.useEffect(()=>{if(i&&O.fetchState==="Not-Started"&&h.timeframe!=="free_range"&&h.timeframe!=="week"&&b)switch(R){case"profit_and_loss":case"profit_and_loss_by_classes":s(Oe(h.timeframe));break;case"profit_and_loss_by_projects":M&&s(K());break;case"balance_sheet":s(Me(h.timeframe));break;case"cash_flow":s(Re(h.timeframe))}},[i,R,O,b,V,M]);const U=sa(),de=U?.loggedInUserRole!=null&&Ae(U?.loggedInUserRole)!==!0,[pe,fe]=_.useState(!1),x=n=>{fe(n)},me=ta(),ue=oa();return function(n){const{isDataReady:_e}=n,{pathname:be}=G(),z=Je(be??"")==="reports",he=We(_e),ye=_.useMemo(()=>z?ha:void 0,[z]);Xe({canFetchSuggestedQuestions:he,pageContexts:ye})}({isDataReady:C==="Completed"}),na({isDataReady:C==="Completed"}),p.jsxs(p.Fragment,{children:[C==="Completed"?p.jsx(ra,{analytics:P,onLoad:n=>n.trackPageLoaded(ia.Event.reports)}):null,p.jsx(ba,{isAppContentDrawerOpen:pe,handleDrawerToggle:x}),p.jsx(ga,{firstMonthOfFY:ne,tenantEmailDomain:r,location:t,navigate:a,windowSize:f,classViewLayout:ce,selectedReportID:R,analytics:P,filter:h,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(Y,{path:"/",element:p.jsx(Ca,{})}),p.jsx(Y,{path:"*",element:p.jsx(fa,{})})]})}export{za as default};
|
|
1
|
+
import{j as p}from"./liveblocks-evjZPqs_.js";import{g as G,h as ge,u as Ce,i as we,j as d,n as Ie,o as Se,p as Y}from"./core-DmAftQ4g.js";import{eW as v,fQ as w,Mm as Te,kv as W,qP as X,rE as A,kj as Re,jn as Me,v8 as K,rJ as Oe,bs as Ae,Mn as Fe,bn as ke,wh as De,Mo as je,Mp as Ee,v0 as Pe,Mq as H,Mr as ve,Ms as Le,Mt as Be,Mu as Ve,Mv as I,Mw as F,Mx as k,My as N,Mz as D,MA as j,dJ as Ue,vZ as xe,vN as q,vO as $,w3 as ze,vS as Z,w9 as Ge,MB as Ye,MC as He,MD as Ne,ME as qe,MF as $e,fB as Ze,fz as Qe}from"./zeni-epic-state-vtQ66nN6.js";import{N as Je,Q as We,R as Xe,V as Ke,Z as ea,W as ee,U as E,z as ae,X as aa,I as sa,a as ta,Y as oa,_ as na,x as ra,c as P,e as ia,$ as la,q as se,a0 as ca,a1 as da,a2 as pa}from"./index-BsmcHa9A.js";import"./mui-PcDpEhsm.js";import fa from"./NotFoundScreen-DmxmtGfC.js";import{F as ma}from"./FeaturePreviewScreen-CdQFs282.js";import{a as _}from"./sentry-CCZGmBkl.js";import{u as ua}from"./useInitialThreadRequest-Dr9FuJUY.js";import{t as Q,a as J,b as _a}from"./routePaths-ieN8hn7m.js";import{M as ba}from"./MobileAppDrawer-cGG4tefr.js";import"./recharts-CgEqsrFw.js";import"./analytics-DCrhd8oB.js";import"./plaid-DSnXUEUK.js";import"./dnd-3F1D24DQ.js";import"./stripe-DMRn4zHo.js";import"./lottie-CmTLY-9t.js";import"./lexical-PVlNGkpS.js";import"./pdf-CbXlPYUs.js";import"./utils--mWNe9J7.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]="a941a05f-92ab-44db-aebe-8bbf0f3e8fb2",e._sentryDebugIdIdentifier="sentry-dbid-a941a05f-92ab-44db-aebe-8bbf0f3e8fb2")}catch{}})();const ha=["profit_loss","balance_sheet","cash_flow"],y=e=>{e(j({resetLeftScroll:!0})),e(D({resetLeftScroll:!0})),e(k({resetLeftScroll:!0})),e(F({resetLeftScroll:!0}))},ya=e=>{e(He()),e(Ne()),e(qe()),e($e())},ga=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=Fe(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:ke(o),showAccountGroups:r===!0,isAccountingClassesEnabled:W(e),isAccountingProjectsEnabled:X(e),currentTenantCompanyName:a,statementEndPoint:`${pa}/statement`,authParams:s,isZeniCOAUsed:r}},function(e,o){const{navigate:f,handleDrawerToggle:u}=o;return{onReloadReport:()=>{o.signedInUser!=null&&e(A(o.signedInUser.userId,!0,!1))},updateDownloadStateHandler:a=>{e(Ye(a))},onTimeframeSelectionChanged:(a,s,t)=>{if(e(Ge(a)),s){const{isCompareModeOn:r,filter:l}=o,{additionalBalances:m,balancesRange:c}=l;let i=[...m];a==="year"&&(i=i.filter(g=>g!=="this_period_vs_same_period_last_year"&&g!=="this_period_vs_same_period_last_year_percent"&&g!=="same_period_last_year")),e(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(H({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 J(o.tenantEmailDomain,a.accountId,a.accountType,s.id,m,r,l)}return a.projectsViewParentId?.projectId!=null&&a.accountType!=null?_a(o.tenantEmailDomain,a.accountId,a.accountType,a.projectsViewParentId.projectId,m,r,l):a.classesViewParentId!=null&&a.classesViewParentId.parentClassId!=null&&a.accountType!=null?J(o.tenantEmailDomain,a.accountId,a.accountType,a.classesViewParentId.parentClassId[0],m,r,l):a.accountType!=null?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(k({scrollPosition:s}));break;case"cash_flow":e(F({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(k({nodeCollapseState:{nodeId:s,isCollapsed:t}}));break;case"cash_flow":e(F({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(H({classViewLayout:a}))},onOpenAccountViewMode:()=>{o.isAccountingClassesEnabled&&e(Pe()),o.isAccountingProjectsEnabled&&e(K())},onUpdateDisplayOrder:a=>{e(Ee(a))},onUpdateReportFormat:a=>{ya(e),e(je(a))},onClickMenuIcon:()=>{u(!0)},onResyncReports:()=>{e(De("profit_and_loss_by_classes"))}}})(ca);function Ca(){const{isAiCfoOpen:e,setIsAiCfoOpen:o}=Ke(),f=ea(),u=da(f),a=ge(),s=Ce(),t=G(),{tenantEmailDomain:r}=we(),{useFeatureGate:l}=ee(),{isFeatureEnabled:m}=l(E.isReportsHorizontalClassLayoutSwitchEnabled),c=ae.getSignedInUser(),[i,g]=_.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),C=d(n=>w(n).fetchState),ie=d(n=>Te(n)),{areTenantIdsInSync:b}=aa(),R=d(n=>n.financeStatementState.selectedReportId),V=d(n=>W(n)),M=d(n=>X(n)),le=d(n=>w(n).isCompareModeOn),h=d(n=>w(n).filter),O=d(n=>w(n).selectedReportAndTimeframeFetchState),ce=d(n=>n.profitAndLossClassesViewState.uiState.classViewLayout);_.useEffect(()=>{!i&&b&&(g(!0),s(A(c.userId,!0,!0,!1)))},[i,c,s,b]),_.useEffect(()=>{i&&!L&&C==="Completed"&&b&&(s(A(c.userId,!1,!0,!1)),te(!0))},[i,L,C,b]),_.useEffect(()=>{if(i&&O.fetchState==="Not-Started"&&h.timeframe!=="free_range"&&h.timeframe!=="week"&&b)switch(R){case"profit_and_loss":case"profit_and_loss_by_classes":s(Oe(h.timeframe));break;case"profit_and_loss_by_projects":M&&s(K());break;case"balance_sheet":s(Me(h.timeframe));break;case"cash_flow":s(Re(h.timeframe))}},[i,R,O,b,V,M]);const U=sa(),de=U?.loggedInUserRole!=null&&Ae(U?.loggedInUserRole)!==!0,[pe,fe]=_.useState(!1),x=n=>{fe(n)},me=ta(),ue=oa();return function(n){const{isDataReady:_e}=n,{pathname:be}=G(),z=Je(be??"")==="reports",he=We(_e),ye=_.useMemo(()=>z?ha:void 0,[z]);Xe({canFetchSuggestedQuestions:he,pageContexts:ye})}({isDataReady:C==="Completed"}),na({isDataReady:C==="Completed"}),p.jsxs(p.Fragment,{children:[C==="Completed"?p.jsx(ra,{analytics:P,onLoad:n=>n.trackPageLoaded(ia.Event.reports)}):null,p.jsx(ba,{isAppContentDrawerOpen:pe,handleDrawerToggle:x}),p.jsx(ga,{firstMonthOfFY:ne,tenantEmailDomain:r,location:t,navigate:a,windowSize:f,classViewLayout:ce,selectedReportID:R,analytics:P,filter:h,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(Y,{path:"/",element:p.jsx(Ca,{})}),p.jsx(Y,{path:"*",element:p.jsx(fa,{})})]})}export{za as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{j as a}from"./liveblocks-evjZPqs_.js";import{W as C,z as j,aQ as b,x as I,c as p,e as F,d6 as P,U as T}from"./index-
|
|
1
|
+
import{j as a}from"./liveblocks-evjZPqs_.js";import{W as C,z as j,aQ as b,x as I,c as p,e as F,d6 as P,U as T}from"./index-BsmcHa9A.js";import"./mui-PcDpEhsm.js";import m from"./NotFoundScreen-DmxmtGfC.js";import{a as f}from"./sentry-CCZGmBkl.js";import{u as L,j as y,h as U,g as V,n as A,o as R,p as d}from"./core-DmAftQ4g.js";import{eW as z,TB as w,PU as W,TC as v,vE as Y,fH as B,TD as G,vC as H}from"./zeni-epic-state-vtQ66nN6.js";import{R as x}from"./ReferralListScreen-BqOgHlgl.js";import"./recharts-CgEqsrFw.js";import"./analytics-DCrhd8oB.js";import"./plaid-DSnXUEUK.js";import"./dnd-3F1D24DQ.js";import"./stripe-DMRn4zHo.js";import"./lottie-CmTLY-9t.js";import"./lexical-PVlNGkpS.js";import"./pdf-CbXlPYUs.js";import"./utils--mWNe9J7.js";import"./useAskAiCfoHostNavButtonProps-5Ek-t3F9.js";import"./MobileAppDrawer-cGG4tefr.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]="1b65cfcb-d311-4ffb-8bfc-6917d7c851a6",e._sentryDebugIdIdentifier="sentry-dbid-1b65cfcb-d311-4ffb-8bfc-6917d7c851a6")}catch{}})();const O=A(function(e,t){const n=w(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=j.getSignedInUser();return{onDismissClick:()=>{e(v()),n("..")},onSendClick:()=>{if(i!=null){const s=[],r=[];t.inviteFormCompayData.forEach(c=>{s.push(c.companyName),r.push(c.emailIds[0])}),p.trackInviteEmailClicked("send",s,r,s.length)}e(H())},onUpdateInviteFormLocalData:s=>{e(G({localData:s}))},onSubmitSuccess:()=>{n("../../")},onCancelClick:()=>{i!=null&&p.trackInviteEmailClicked("cancel")}}})(P),Q=()=>{const e=L(),[t,n]=f.useState(!1),[i,s]=f.useState(!1),r=y(o=>z(o)),c=U(),D=V(),{useDynamicConfig:g}=C(),u=j.getSignedInUser();if(u==null)throw Error("Can't access invite referral screen without signing in...");const l=y(o=>w(o)),_=u?.firstName!=null?u.firstName:"User",{configValue:h}=g(b.zeniCardsConfig),{configValue:k}=g(b.zeniAccountsConfig),N=W(k);f.useEffect(()=>{e(v()),r?.rewardsLastViewedTime==null&&i===!1&&(e(Y()),s(!0))},[]),f.useEffect(()=>{t||l.fetchState!=="Not-Started"||(n(!0),e(B(!0)))},[l.fetchState,e]);const S=r.company?.companyInfo.companyLegalName??r.companyName;return a.jsxs(a.Fragment,{children:[l.fetchState==="Completed"?a.jsx(I,{analytics:p,onLoad:o=>(E=>E.trackPageLoaded(F.Event.inviteEmailViewed))(o)}):null,a.jsx(O,{navigate:c,location:D,currentTenant:r,companyName:S,userName:_,inviteFormCompayData:l.localData,chargeCardCashbackRatePerTransaction:h.charge_card_cashback_rate_per_transaction!=null?h.charge_card_cashback_rate_per_transaction:.0175,maxAnnualPercentageYield:N.maxAnnualPercentageYield})]})};function de(){const{useFeatureGate:e}=C(),{isFeatureEnabled:t}=e(T.isReferralFeatureEnabled);return a.jsxs(R,{children:[a.jsx(d,{path:"/",element:t?a.jsx(x,{}):a.jsx(m,{})}),a.jsx(d,{path:"how-it-works",element:t?a.jsx(x,{isReferralDrawerOpen:!0}):a.jsx(m,{})}),a.jsx(d,{path:"refer/*",element:t?a.jsx(Q,{}):a.jsx(m,{})}),a.jsx(d,{path:"*",element:a.jsx(m,{})})]})}export{de as default};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/DashboardRoutes-
|
|
2
|
-
import{_ as a,bn as is,eW as rs,fB as os,fz as ls,fA as cs,gi as ds,fo as ms,cT as xe,cA as us,fR as _s,cs as ps,bE as As,bo as Es,fW as xs,v as gs,LU as Is,bs as Ts,LV as js,bK as hs,fT as Us,bJ as Rs,bt as bs,co as Hs,LW as Ds,LX as fs,cQ as ys,cS as Cs,cR as vs,cz as Os,cG as Ps,o7 as ge,fx as Ie,gs as Fs,f_ as Te,gp as je,gq as he,f$ as Ls}from"./zeni-epic-state-vtQ66nN6.js";import{j as e}from"./liveblocks-evjZPqs_.js";import{a as v}from"./sentry-CCZGmBkl.js";import{u as ks,h as Bs,i as Vs,g as Ss,j as G,l as Ue,N as c,o as Ns,p as t}from"./core-DmAftQ4g.js";import{m as Ms,u as Zs,z as b,W as ws,a as zs,n as Gs,U as B,I as $s,L as F,O as Re,t as _,P as Ws,c as ee,l}from"./index-DsVH62ZK.js";import"./mui-PcDpEhsm.js";import{f as be}from"./analyticsHelper-CQXeRvKo.js";import{t as Ys}from"./getLocaleForTenant-C55KVru2.js";import"./recharts-CgEqsrFw.js";import"./analytics-DCrhd8oB.js";import"./plaid-DSnXUEUK.js";import"./dnd-3F1D24DQ.js";import"./stripe-DMRn4zHo.js";import"./lottie-CmTLY-9t.js";import"./lexical-PVlNGkpS.js";import"./pdf-CbXlPYUs.js";import"./utils--mWNe9J7.js";(function(){try{var i=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},U=new i.Error().stack;U&&(i._sentryDebugIds=i._sentryDebugIds||{},i._sentryDebugIds[U]="06f5cf64-14bb-4452-b6f8-0781336049ed",i._sentryDebugIdIdentifier="sentry-dbid-06f5cf64-14bb-4452-b6f8-0781336049ed")}catch{}})();const qs={dashboard:()=>a(()=>import("./DashboardRoutes-uPgpLI1W.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21])),bills:()=>a(()=>import("./BillPayRoutes-CxAjptk9.js"),__vite__mapDeps([22,1,2,3,4,5,6,7,23,13,24,9,14,25,17,19,26,15,12,27,28,29,30,21])),reimbursement:()=>a(()=>import("./ReimbursementRoutes-vHQ3hpWm.js"),__vite__mapDeps([31,1,2,3,4,5,6,7,13,26,17,15,12,27,19,9,14,25,32,29,30,21])),transactions:()=>a(()=>import("./TransactionListRoutes-CDDcflri.js"),__vite__mapDeps([33,1,2,3,4,5,6,7,8,9,10,11,12,34,21])),settings:()=>a(()=>import("./SettingsRoutes-B4g8CJnG.js"),__vite__mapDeps([35,1,2,3,4,5,6,7,17,36,23,13,15,27,12,16,37,38,39,40,41,11,42,28,29,32,21])),reports:()=>a(()=>import("./ReportsRoutes-DIUc8s5q.js"),__vite__mapDeps([43,1,2,3,4,5,6,7,13,19,14,12,17,21])),chargeCards:()=>a(()=>import("./ChargeCardRoutes-CF9hoDo5.js"),__vite__mapDeps([44,1,2,3,4,5,6,7,9,17,26,13,15,12,27,14,45,23,21])),people:()=>a(()=>import("./PeopleRoutes-qz_hXV4C.js"),__vite__mapDeps([46,1,2,3,4,5,6,7,13,9,17,21])),expenseAutomation:()=>a(()=>import("./ExpenseAutomationRoutes-ChVJkArc.js"),__vite__mapDeps([47,1,2,3,13,4,5,6,7,9,10,11,12,8,36,25,21])),treasury:()=>a(()=>import("./TreasuryRoutes-CZyF8G2k.js"),__vite__mapDeps([48,1,2,3,4,5,6,7,13,26,17,15,12,27,9,14,49,19,21])),vendors:()=>a(()=>import("./VendorsRoutes-B0mGOZoL.js"),__vite__mapDeps([50,1,2,3,4,5,6,7,23,13,19,12,51,9,17,25,36,21])),zeniAccounts:()=>a(()=>import("./ZeniAccountRoutes-BeZsG6M5.js"),__vite__mapDeps([52,1,2,3,4,5,6,7,49,13,26,17,15,12,27,19,24,23,9,34,21]))},Js=["bills","transactions","settings","reimbursement","reports","chargeCards","people"],se=i=>{"requestIdleCallback"in window?requestIdleCallback(i):setTimeout(i,100)},Ks=l(()=>a(()=>import("./ReportsRoutes-DIUc8s5q.js"),__vite__mapDeps([43,1,2,3,4,5,6,7,13,19,14,12,17,21]))),Qs=l(()=>a(()=>import("./AddressRoutes-DvuqFlm5.js"),__vite__mapDeps([53,1,2,3,23,4,5,6,7,13,21]))),Xs=l(()=>a(()=>import("./PeopleRoutes-qz_hXV4C.js"),__vite__mapDeps([46,1,2,3,4,5,6,7,13,9,17,21]))),ea=l(()=>a(()=>import("./PandLWithForecastRoutes-DfEV7guz.js"),__vite__mapDeps([54,1,2,3,4,5,6,7,13,19,9,14,12,17,21]))),sa=l(()=>a(()=>import("./CustomerOnboardingRoutes-B4tFhrDj.js"),__vite__mapDeps([55,1,2,3,23,4,5,6,7,13,37,38,39,40,41,11,42,45,21]))),aa=l(()=>a(()=>import("./VendorsRoutes-B0mGOZoL.js"),__vite__mapDeps([50,1,2,3,4,5,6,7,23,13,19,12,51,9,17,25,36,21]))),na=l(()=>a(()=>import("./TransactionDetailRoutes-BXwhj2nX.js"),__vite__mapDeps([56,1,2,3,13,4,5,6,7,10,9,11,12,21]))),He=l(()=>a(()=>import("./EntityDetailRoutes-DbpAgwXS.js"),__vite__mapDeps([57,1,2,3,4,5,6,7,11,8,9,10,12,21]))),ta=l(()=>a(()=>import("./DashboardRoutes-uPgpLI1W.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21]))),De=l(()=>a(()=>import("./BillPayRoutes-CxAjptk9.js"),__vite__mapDeps([22,1,2,3,4,5,6,7,23,13,24,9,14,25,17,19,26,15,12,27,28,29,30,21]))),ia=l(()=>a(()=>import("./SettingsRoutes-B4g8CJnG.js"),__vite__mapDeps([35,1,2,3,4,5,6,7,17,36,23,13,15,27,12,16,37,38,39,40,41,11,42,28,29,32,21]))),fe=l(()=>a(()=>import("./ReimbursementRoutes-vHQ3hpWm.js"),__vite__mapDeps([31,1,2,3,4,5,6,7,13,26,17,15,12,27,19,9,14,25,32,29,30,21]))),ra=l(()=>a(()=>import("./ZeniAccountRoutes-BeZsG6M5.js"),__vite__mapDeps([52,1,2,3,4,5,6,7,49,13,26,17,15,12,27,19,24,23,9,34,21]))),oa=l(()=>a(()=>import("./TreasuryRoutes-CZyF8G2k.js"),__vite__mapDeps([48,1,2,3,4,5,6,7,13,26,17,15,12,27,9,14,49,19,21]))),la=l(()=>a(()=>import("./TransactionListRoutes-CDDcflri.js"),__vite__mapDeps([33,1,2,3,4,5,6,7,8,9,10,11,12,34,21]))),ca=l(()=>a(()=>import("./ChargeCardRoutes-CF9hoDo5.js"),__vite__mapDeps([44,1,2,3,4,5,6,7,9,17,26,13,15,12,27,14,45,23,21]))),da=l(()=>a(()=>import("./NotificationRoutes-B06j6V42.js"),__vite__mapDeps([58,1,2,3,13,4,5,6,7,9,21]))),ma=l(()=>a(()=>import("./PerformanceRoutes-v5FcQW2N.js"),__vite__mapDeps([59,1,2,3,13,4,5,6,7,9,17,21]))),ua=l(()=>a(()=>import("./ExpenseAutomationRoutes-ChVJkArc.js"),__vite__mapDeps([47,1,2,3,13,4,5,6,7,9,10,11,12,8,36,25,21]))),_a=l(()=>a(()=>import("./RewardsRoutes-lnm6cAkX.js"),__vite__mapDeps([60,1,2,3,4,5,6,7,13,20,9,17,21]))),pa=l(()=>a(()=>import("./TaskRoutes-CDomkVrp.js"),__vite__mapDeps([61,1,2,3,13,4,5,6,7,14,17,62,9,21]))),Aa=l(()=>a(()=>import("./AiCfoScreen-Bv6DgXwH.js"),__vite__mapDeps([63,1,2,3,4,5,6,7,18,51,21]))),ye=l(()=>a(()=>import("./CardsAiCfoScreen-BQXIEsXX.js"),__vite__mapDeps([64,1,2,3,4,5,6,7,21]))),D=l(()=>a(()=>import("./NotFoundScreen-AsC21qGx.js"),__vite__mapDeps([13,1,2,3,4,5,6,7,21]))),Ea=l(()=>a(()=>import("./TaskListScreen-DGOHeeuZ.js"),__vite__mapDeps([62,1,2,3,4,5,6,7,9,17,21])));function Na({setTenantEmailDomain:i}){const U=ks(),V=Bs(),{tenantEmailDomain:o}=Vs(),S=Ms().mode,{setLoading:y,clearAllLoading:O,clearLoading:Z}=Zs(),f=b.getSignedInUserTenant(o)?.tenantId,j=b.getSignedInUser(),ae=is(j),$=Ss(),[N,ve]=v.useState(!1),r=G(n=>rs(n)),{useFeatureGate:L}=ws(),w=zs(),ne=Gs(),{isFeatureEnabled:Oe}=L(B.isDepositAccountsFeatureEnabled),{isFeatureEnabled:Pe}=L(B.isTreasuryEnabled),{isFeatureEnabled:Fe}=L(B.isChargeCardFeatureEnabled),{isFeatureEnabled:te}=L(B.isDebitCardFeatureEnabled),h=G(n=>n.tenantState.fetchState),A=G(n=>n.tenantState.activeTenantFetchState.fetchState),u=A==="Completed"||h==="Completed"?os(te,r):void 0,W=A==="Completed"||h==="Completed"?ls(r):void 0,Le=A==="Completed"||h==="Completed"?cs(r):void 0,ke=Fe||te||!!Le||!!W||!!u,{isFeatureEnabled:Be}=L(B.isSettingsFeatureEnabled),{isFeatureEnabled:K}=L(B.isAiCfoFileUploadEnabled),Y=G(n=>ds(n));if(o!=null){const n=b.getSignedInUserTenant(o);j!=null&&n!=null&&be(j,r,S)}const z={tenantId:f,userId:j?.userId,sessionId:j?.zeniSessionId},ie=ms(),p=$s(),Ve=r.company==null||p?.loggedInUserRoleMap!=null&&xe(p.loggedInUserRole),Se=us(p?.loggedInUserRoleMap),re=v.useRef(!0),oe=Ue("/:tenantEmailDomain/onboarding/*")!==null,Q=Ue("/:tenantEmailDomain/month_end_close_checks/review/:selectedTab/:selectedPeriod/*"),Ne=G(n=>z.tenantId!=null?_s(n,z.tenantId):void 0);v.useEffect(()=>{y(F.TENANT_FETCHING),i(o)},[o]),v.useEffect(()=>{if(Q!=null&&f!=null){const n=Q.params.selectedPeriod;if(n!=null){const R=n.split("-");if(R.length===2){const d=ps(Number(R[0])),s=Number(R[1]),m=As(`01-${d<10?`0${d}`:d}-${s}`,Re.getLocalizedStrings().dateFormat.analytics.DDDashMMDashYYYY),M=Es();m.isAfter(M,"month")===!1?U(xs(f,{month:d,year:s})):V("./month_end_close_checks/review")}}}},[Q,f]),v.useEffect(()=>{N||(ve(!0),y(F.TENANT_FETCHING)),re.current?re.current=!1:!gs(ie,z)&&b.isSignedIn()&&(y(F.TENANT_FETCHING),function(n,R,d,s){if(Ie(R?.userId,R?.zeniSessionId,n.tenantId),d(Fs(!0)),d(Te(n.tenantId)),n.tenantId!=null&&_.clearTenant(n.tenantId),n.tenantId!=null){const m=b.getSignedInUserTenantWithId(n.tenantId);s&&Re.updateAppLocaleID(Ys(s)),m?.tenantEmailDomain!=null&&b.saveActiveTenantDomainForUser(m?.tenantEmailDomain)}n.userId!=null?ee.identify(n.userId,{tenant_id:n.tenantId}):ee.resetUserIdentity()}(z,j,U,Ne))},[z,ie,j,U,b]),v.useEffect(()=>{b.isSignedIn()&&(y(F.TENANT_FETCHING),function(n,R,d,s,m,M,k){if(d==null&&s==null)return void console.warn("There is no current tenant selected!!");const q=s!=null&&m?.zeniSessionId!=null,as=d==null||d.tenantId!==s,ns=d!=null&&d.excludedResources==null,ts=d!=null&&d.externalConnections==null;if(q&&as){k(Te(s));const J=b.getSignedInUserTenantWithId(s);J?.tenantEmailDomain!=null&&b.saveActiveTenantDomainForUser(J?.tenantEmailDomain),Ie(m?.userId,m?.zeniSessionId,s),_.shouldFetchExcludedResources(s)&&(_.markExcludedResourcesFetchStarted(s),k(je(m.userId,s))),_.shouldFetchConnections(s)&&(_.markConnectionsFetchStarted(s),k(he(m.userId,s)))}else q&&ns&&_.shouldFetchExcludedResources(s)&&(_.markExcludedResourcesFetchStarted(s),k(je(m.userId,s))),q&&ts&&_.shouldFetchConnections(s)&&(_.markConnectionsFetchStarted(s),k(he(m.userId,s)));if(q){ee.identify(m.userId,{tenant_id:s});const J=s==null||s!=null&&(R==="Completed"||R==="Error");n==="Completed"||R!=="Not-Started"&&R!=="Error"||s==null||!_.shouldFetchActiveTenant(s)||(_.markActiveTenantFetchStarted(s),M(F.TENANT_FETCHING),k(Ls(m.userId,s,m.zeniSessionId))),J&&(n==="Not-Started"||n==="Error")&&_.shouldFetchAllTenants()&&(_.markAllTenantsFetchStarted(),k(ge(m.userId,m.zeniSessionId)))}}(h,A,r,f,j,y,U))},[f,A]),v.useEffect(()=>{b.isSignedIn()&&h==="Completed"&&Y.tenantsBaseInOrder.length>0&&(Z(F.TENANT_FETCHING),b.saveSignedInUserTenants(Is(Y.tenantsBaseInOrder)),j!=null&&be(j,r,S,void 0,Y.tenantsBaseInOrder))},[Y,h,r,j]),v.useEffect(()=>{A==="In-Progress"&&y(F.TENANT_FETCHING),A!=="Completed"&&A!=="Error"||(A==="Completed"&&f!=null?(O(),_.markActiveTenantFetchCompleted(f)):A==="Error"&&f!=null&&(_.markActiveTenantFetchFailed(f),Z(F.TENANT_FETCHING),Z(F.TENANT_SWITCHING))),h!=="Completed"&&h!=="Error"||(h==="Completed"?_.markAllTenantsFetchCompleted():h==="Error"&&_.markAllTenantsFetchFailed())},[A,h,f,N]);const le=v.useRef(!1);v.useEffect(()=>{!le.current&&A==="Completed"&&N&&(le.current=!0,function(n=Js,R=3e3){setTimeout(()=>{const d=s=>{if(s>=n.length)return;const m=n[s],M=qs[m];M!=null?M().then(()=>se(()=>d(s+1))).catch(()=>se(()=>d(s+1))):d(s+1)};se(()=>d(0))},R)}())},[A,N]);const C=r?.userRole!=null&&Ts(r?.userRole),{isFeatureEnabled:Me}=L(B.isReferralFeatureEnabled),Ze=r?.userRole!=null&&r.userRole.includes("charge_card_user"),we=r?.userRole!=null&&r.userRole.includes("charge_card_admin"),P=r?.userRole!=null&&xe(r.userRole),ce=r?.company==null||r.company.featuresActivationInfo?.isBillPayFeatureEnabled&&!C,de=ke&&!C,ze=js(p?.loggedInUserRoleMap),Ge=r.externalConnections?.accounting[0]?.isValid,me=r.company?.companyOnboardingInfo.isOnboardingCompleted,ue=r?.company==null||r.company.featuresActivationInfo?.isReimbursementFeatureEnabled&&!C,_e=ue&&hs(p?.loggedInUserRoleMap),pe=Oe&&!C,$e=r.company!=null&&Us(r.company),We=Pe&&$e===!0&&!C,Ye=ce&&Rs(p?.loggedInUserRoleMap),qe=de&&bs(p?.loggedInUserRoleMap),Je=pe&&Hs(p?.loggedInUserRoleMap),Ke=Ds(p?.loggedInUserRoleMap),Qe=fs(p?.loggedInUserRoleMap),E=ys(p?.loggedInUserRoleMap),x=Cs(p?.loggedInUserRoleMap),g=vs(p?.loggedInUserRoleMap),I=Os(p?.loggedInUserRoleMap),T=Ps(p?.loggedInUserRoleMap),Ae=ce&&I,Ee=ue&&T,Xe=pe&&E,es=We&&x,X=de&&g,ss=r.excludedResources?.resources?.find(n=>n.resource==="/invites")!=null||Se===!0||ze===!0||Ke===!0||Qe===!0;return b.isSignedIn()?f==null?h==="Completed"?e.jsx(c,{to:"/",replace:!0,state:{...$.state,message:"...",origin:$.pathname}}):(j!=null&&h!=="In-Progress"&&U(ge(j.userId,j.zeniSessionId)),null):A!=="In-Progress"&&A!=="Not-Started"||h==="Completed"?(me===!0||ae&&!oe)&&Ge===!1&&u===!1&&W===!1?(i(void 0),e.jsx(c,{to:"/connection/auth",replace:!0})):!N||me!==!1||oe||ae?N&&r?.userRole&&u!=null&&W!=null&&o!=null&&Object.keys(p.loggedInUserRoleMap).length>0?e.jsx(Ns,{children:e.jsxs(t,{element:e.jsx(Ws,{}),children:[e.jsx(t,{path:"/",element:e.jsx(xa,{isDashboardAccess:P,isUserHasZeniAccountsAccess:E,isUserHasChargeCardAccess:g,isUserHasBillPayAccess:I,isUserHasReimbursementAccess:T,isUserHasTreasuryAccess:x,isTenantBankingOnly:u,isTenantCardsOnly:W})}),e.jsx(t,{path:"dashboard/*",element:P?e.jsx(ta,{}):e.jsx(H,{isUserHasZeniAccountsAccess:E,isUserHasChargeCardAccess:g,isUserHasBillPayAccess:I,isUserHasReimbursementAccess:T,isUserHasTreasuryAccess:x,isTenantBankingOnly:u,tenantEmailDomain:o})}),e.jsx(t,{path:"reports/*",element:P?e.jsx(Ks,{}):e.jsx(H,{isUserHasZeniAccountsAccess:E,isUserHasChargeCardAccess:g,isUserHasBillPayAccess:I,isUserHasReimbursementAccess:T,isUserHasTreasuryAccess:x,isTenantBankingOnly:u,tenantEmailDomain:o})}),e.jsx(t,{path:"people/*",element:ss||P?e.jsx(Xs,{}):e.jsx(H,{isUserHasZeniAccountsAccess:E,isUserHasChargeCardAccess:g,isUserHasBillPayAccess:I,isUserHasReimbursementAccess:T,isUserHasTreasuryAccess:x,isTenantBankingOnly:u,tenantEmailDomain:o})}),e.jsx(t,{path:"forecast/*",element:P?e.jsx(ea,{}):e.jsx(H,{isUserHasZeniAccountsAccess:E,isUserHasChargeCardAccess:g,isUserHasBillPayAccess:I,isUserHasReimbursementAccess:T,isUserHasTreasuryAccess:x,isTenantBankingOnly:u,tenantEmailDomain:o})}),e.jsx(t,{path:"onboarding/*",element:e.jsx(sa,{})}),e.jsx(t,{path:"transaction/*",element:P&&C===!1||Ze||we?e.jsx(na,{}):e.jsx(H,{isUserHasZeniAccountsAccess:E,isUserHasChargeCardAccess:g,isUserHasBillPayAccess:I,isUserHasReimbursementAccess:T,isUserHasTreasuryAccess:x,isTenantBankingOnly:u,tenantEmailDomain:o})}),e.jsx(t,{path:"transactions/*",element:P&&C===!1?e.jsx(la,{}):e.jsx(H,{isUserHasZeniAccountsAccess:E,isUserHasChargeCardAccess:g,isUserHasBillPayAccess:I,isUserHasReimbursementAccess:T,isUserHasTreasuryAccess:x,isTenantBankingOnly:u,tenantEmailDomain:o})}),e.jsx(t,{path:"customer/*",element:P&&C===!1?e.jsx(He,{entityType:"customer"}):e.jsx(H,{isUserHasZeniAccountsAccess:E,isUserHasChargeCardAccess:g,isUserHasBillPayAccess:I,isUserHasReimbursementAccess:T,isTenantBankingOnly:u,isUserHasTreasuryAccess:x,tenantEmailDomain:o})}),e.jsx(t,{path:"vendor/*",element:P&&C===!1?e.jsx(He,{entityType:"vendor"}):e.jsx(H,{isUserHasZeniAccountsAccess:E,isUserHasChargeCardAccess:g,isUserHasBillPayAccess:I,isUserHasReimbursementAccess:T,isUserHasTreasuryAccess:x,isTenantBankingOnly:u,tenantEmailDomain:o})}),e.jsx(t,{path:"tasks",element:e.jsx(Ea,{})}),e.jsx(t,{path:"tasks/*",element:e.jsx(pa,{})}),e.jsx(t,{path:"address/*",element:Ye||_e||Je||qe?e.jsx(Qs,{}):e.jsx(H,{isUserHasZeniAccountsAccess:E,isUserHasChargeCardAccess:g,isUserHasBillPayAccess:I,isUserHasReimbursementAccess:T,isUserHasTreasuryAccess:x,isTenantBankingOnly:u,tenantEmailDomain:o})}),e.jsx(t,{path:"checking/*",element:Xe?e.jsx(ra,{}):e.jsx(D,{})}),e.jsx(t,{path:"treasury/*",element:es?e.jsx(oa,{}):e.jsx(D,{})}),e.jsx(t,{path:"performance",element:ne===!0?e.jsx(ma,{}):e.jsx(Ce,{tenantEmailDomain:o})}),e.jsx(t,{path:"month_end_close_checks/review/*",element:ne===!0&&C===!1?e.jsx(ua,{}):e.jsx(Ce,{tenantEmailDomain:o})}),e.jsx(t,{path:"notifications/*",element:e.jsx(da,{})}),e.jsx(t,{path:"vendors/*",element:Ve?e.jsx(aa,{}):e.jsx(D,{})}),e.jsx(t,{path:"bill/*",element:Ae?e.jsx(De,{}):e.jsx(H,{isUserHasZeniAccountsAccess:E,isUserHasChargeCardAccess:g,isUserHasBillPayAccess:I,isUserHasReimbursementAccess:T,isUserHasTreasuryAccess:x,isTenantBankingOnly:u,tenantEmailDomain:o})}),e.jsx(t,{path:"bills/*",element:Ae?e.jsx(De,{}):e.jsx(H,{isUserHasZeniAccountsAccess:E,isUserHasChargeCardAccess:g,isUserHasBillPayAccess:I,isUserHasReimbursementAccess:T,isUserHasTreasuryAccess:x,isTenantBankingOnly:u,tenantEmailDomain:o})}),e.jsx(t,{path:"reimbursement/*",element:Ee?e.jsx(fe,{}):e.jsx(H,{isUserHasZeniAccountsAccess:E,isUserHasChargeCardAccess:g,isUserHasBillPayAccess:I,isUserHasReimbursementAccess:T,isUserHasTreasuryAccess:x,isTenantBankingOnly:u,tenantEmailDomain:o})}),e.jsx(t,{path:"reimbursements/*",element:Ee?e.jsx(fe,{}):e.jsx(H,{isUserHasZeniAccountsAccess:E,isUserHasChargeCardAccess:g,isUserHasBillPayAccess:I,isUserHasReimbursementAccess:T,isUserHasTreasuryAccess:x,isTenantBankingOnly:u,tenantEmailDomain:o})}),e.jsx(t,{path:"settings/*",element:Be?e.jsx(ia,{hasAdminLevelAccess:_e}):e.jsx(D,{})}),e.jsx(t,{path:"cards/ask",element:X&&w?e.jsx(ye,{isFileUploadEnabled:K}):e.jsx(D,{})}),e.jsx(t,{path:"cards/ask/:session_id",element:X&&w?e.jsx(ye,{isFileUploadEnabled:K}):e.jsx(D,{})}),e.jsx(t,{path:"cards/*",element:X?e.jsx(ca,{}):e.jsx(D,{})}),e.jsx(t,{path:"rewards/*",element:Me?e.jsx(_a,{}):e.jsx(D,{})}),e.jsx(t,{path:"/ai-cfo",element:w?e.jsx(c,{to:"explore"}):e.jsx(D,{})}),e.jsx(t,{path:"/ai-cfo/",element:w?e.jsx(c,{to:"explore"}):e.jsx(D,{})}),e.jsx(t,{path:"/ai-cfo/:session_id",element:w?e.jsx(Aa,{isFileUploadEnabled:K}):e.jsx(D,{})}),e.jsx(t,{path:"*",element:e.jsx(D,{})})]})}):null:(i(void 0),e.jsx(c,{to:"onboarding",replace:!0})):null:(console.warn("User logged out!!"),i(void 0),e.jsx(c,{to:"/signin/auth",replace:!0,state:{...$.state,message:"...",origin:$.pathname}}))}const xa=({isDashboardAccess:i,isUserHasZeniAccountsAccess:U,isUserHasChargeCardAccess:V,isUserHasBillPayAccess:o,isUserHasReimbursementAccess:S,isUserHasTreasuryAccess:y,isTenantBankingOnly:O,isTenantCardsOnly:Z})=>O===!0&&U?e.jsx(c,{to:"checking"}):Z===!0?e.jsx(c,{to:"cards"}):i?e.jsx(c,{to:"dashboard"}):U?e.jsx(c,{to:"checking"}):y?e.jsx(c,{to:"treasury"}):V?e.jsx(c,{to:"cards"}):o?e.jsx(c,{to:"bills"}):S?e.jsx(c,{to:"reimbursements"}):e.jsx(c,{to:"dashboard"}),H=({isUserHasZeniAccountsAccess:i,isUserHasChargeCardAccess:U,isUserHasBillPayAccess:V,isUserHasReimbursementAccess:o,isUserHasTreasuryAccess:S,isTenantBankingOnly:y,tenantEmailDomain:O})=>y===!0||i?e.jsx(ja,{tenantEmailDomain:O}):S?e.jsx(Ta,{tenantEmailDomain:O}):U?e.jsx(ha,{tenantEmailDomain:O}):V?e.jsx(Ia,{tenantEmailDomain:O}):o?e.jsx(ga,{tenantEmailDomain:O}):e.jsx(D,{}),ga=({tenantEmailDomain:i})=>e.jsx(c,{to:`/${i}/reimbursements`}),Ia=({tenantEmailDomain:i})=>e.jsx(c,{to:`/${i}/bills`}),Ta=({tenantEmailDomain:i})=>e.jsx(c,{to:`/${i}/treasury`}),ja=({tenantEmailDomain:i})=>e.jsx(c,{to:`/${i}/checking`}),ha=({tenantEmailDomain:i})=>e.jsx(c,{to:`/${i}/cards`}),Ce=({tenantEmailDomain:i})=>e.jsx(c,{to:`/${i}/dashboard`});export{H as FallBackRoute,Na as default};
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/DashboardRoutes-dFcQ-Udv.js","assets/sentry-CCZGmBkl.js","assets/core-DmAftQ4g.js","assets/zeni-epic-state-vtQ66nN6.js","assets/index-BsmcHa9A.js","assets/mui-PcDpEhsm.js","assets/analytics-DCrhd8oB.js","assets/utils--mWNe9J7.js","assets/withTransactionSidePanel-C15NQsNY.js","assets/useAskAiCfoHostNavButtonProps-5Ek-t3F9.js","assets/TransactionDetailScreen-B7KMTXiT.js","assets/decodeURIComponentSafe-C70tsXnj.js","assets/routePaths-ieN8hn7m.js","assets/NotFoundScreen-DmxmtGfC.js","assets/useInitialThreadRequest-Dr9FuJUY.js","assets/analyticsHelper-MomIUc09.js","assets/CompanyPassportScreen-N6HtNLO2.js","assets/MobileAppDrawer-cGG4tefr.js","assets/useAiCfoDashboardSuggestedQuestionsChips-Ber5T8-o.js","assets/FeaturePreviewScreen-CdQFs282.js","assets/ReferralListScreen-BqOgHlgl.js","assets/index-BUmr5maU.css","assets/BillPayRoutes-ycYrxG7k.js","assets/AddressScreen-CxOVTdB3.js","assets/DomesticWireDetailScreen-Cv3GFhdJ.js","assets/DrawerScreen-Dz_Ifi-A.js","assets/SetupPagesScreen-Pz567UQO.js","assets/BusinessVerificationPageScreen-BSOfMkHj.js","assets/BillPayApprovalRoutes-COMjZNBM.js","assets/ReimbursementApprovalRuleDetailScreen-DSLe2MhL.js","assets/getLocaleForTenant-DBZLLRpQ.js","assets/ReimbursementRoutes--RsJPCEP.js","assets/ReimbursementApprovalRoutes-CuEZag2r.js","assets/TransactionListRoutes-MalhqO-o.js","assets/ZeniAccountStatementScreen-BqtUjZCP.js","assets/SettingsRoutes-DqieIzNx.js","assets/accountMappingHelper-CSvCSQoY.js","assets/QBOConnectionScreen-MiEEvzBf.js","assets/empty-CDCfsLV4.js","assets/index-EyTFjAAZ.js","assets/url-9kg5cual.js","assets/index-DniSRtks.js","assets/useEmailConnectResultRefresh-CiHOFzmr.js","assets/ReportsRoutes-uT5eAJf1.js","assets/ChargeCardRoutes-iiwF-L1o.js","assets/useChargeCardPusherEvents-RkbvNufi.js","assets/PeopleRoutes-CQ7KgSTF.js","assets/ExpenseAutomationRoutes-iUGrHrmT.js","assets/TreasuryRoutes-BJIzvR2Q.js","assets/useCashManagementBanner-B0ma2Yzx.js","assets/VendorsRoutes-45nX3W2c.js","assets/pathToGoBack-Dt8AwbCr.js","assets/ZeniAccountRoutes-DWsFxkzK.js","assets/AddressRoutes-CZL5IIDj.js","assets/PandLWithForecastRoutes-COEiLMeU.js","assets/CustomerOnboardingRoutes-C39jSTCn.js","assets/TransactionDetailRoutes-Dko7BvP2.js","assets/EntityDetailRoutes-CGqc-n2O.js","assets/NotificationRoutes-DRjXwQc4.js","assets/PerformanceRoutes-CUptxU2M.js","assets/RewardsRoutes-DNPQGfAV.js","assets/TaskRoutes-DXfXoaYF.js","assets/TaskListScreen-Chd2rxBe.js","assets/AiCfoScreen-Ufyr17L2.js","assets/CardsAiCfoScreen-BofarOgC.js"])))=>i.map(i=>d[i]);
|
|
2
|
+
import{_ as a,bn as is,eW as rs,fB as os,fz as ls,fA as cs,gi as ds,fo as ms,cT as xe,cA as us,fR as _s,cs as ps,bE as As,bo as Es,fW as xs,v as gs,LU as Is,bs as Ts,LV as js,bK as hs,fT as Us,bJ as Rs,bt as bs,co as Hs,LW as Ds,LX as fs,cQ as ys,cS as Cs,cR as vs,cz as Os,cG as Ps,o7 as ge,fx as Ie,gs as Fs,f_ as Te,gp as je,gq as he,f$ as Ls}from"./zeni-epic-state-vtQ66nN6.js";import{j as e}from"./liveblocks-evjZPqs_.js";import{a as v}from"./sentry-CCZGmBkl.js";import{u as ks,h as Bs,i as Vs,g as Ss,j as G,l as Ue,N as c,o as Ns,p as t}from"./core-DmAftQ4g.js";import{m as Ms,u as Zs,z as b,W as ws,a as zs,n as Gs,U as B,I as $s,L as F,O as Re,t as _,P as Ws,c as ee,l}from"./index-BsmcHa9A.js";import"./mui-PcDpEhsm.js";import{f as be}from"./analyticsHelper-MomIUc09.js";import{t as Ys}from"./getLocaleForTenant-DBZLLRpQ.js";import"./recharts-CgEqsrFw.js";import"./analytics-DCrhd8oB.js";import"./plaid-DSnXUEUK.js";import"./dnd-3F1D24DQ.js";import"./stripe-DMRn4zHo.js";import"./lottie-CmTLY-9t.js";import"./lexical-PVlNGkpS.js";import"./pdf-CbXlPYUs.js";import"./utils--mWNe9J7.js";(function(){try{var i=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},U=new i.Error().stack;U&&(i._sentryDebugIds=i._sentryDebugIds||{},i._sentryDebugIds[U]="06f5cf64-14bb-4452-b6f8-0781336049ed",i._sentryDebugIdIdentifier="sentry-dbid-06f5cf64-14bb-4452-b6f8-0781336049ed")}catch{}})();const qs={dashboard:()=>a(()=>import("./DashboardRoutes-dFcQ-Udv.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21])),bills:()=>a(()=>import("./BillPayRoutes-ycYrxG7k.js"),__vite__mapDeps([22,1,2,3,4,5,6,7,23,13,24,9,14,25,17,19,26,15,12,27,28,29,30,21])),reimbursement:()=>a(()=>import("./ReimbursementRoutes--RsJPCEP.js"),__vite__mapDeps([31,1,2,3,4,5,6,7,13,26,17,15,12,27,19,9,14,25,32,29,30,21])),transactions:()=>a(()=>import("./TransactionListRoutes-MalhqO-o.js"),__vite__mapDeps([33,1,2,3,4,5,6,7,8,9,10,11,12,34,21])),settings:()=>a(()=>import("./SettingsRoutes-DqieIzNx.js"),__vite__mapDeps([35,1,2,3,4,5,6,7,17,36,23,13,15,27,12,16,37,38,39,40,41,11,42,28,29,32,21])),reports:()=>a(()=>import("./ReportsRoutes-uT5eAJf1.js"),__vite__mapDeps([43,1,2,3,4,5,6,7,13,19,14,12,17,21])),chargeCards:()=>a(()=>import("./ChargeCardRoutes-iiwF-L1o.js"),__vite__mapDeps([44,1,2,3,4,5,6,7,9,17,26,13,15,12,27,14,45,23,21])),people:()=>a(()=>import("./PeopleRoutes-CQ7KgSTF.js"),__vite__mapDeps([46,1,2,3,4,5,6,7,13,9,17,21])),expenseAutomation:()=>a(()=>import("./ExpenseAutomationRoutes-iUGrHrmT.js"),__vite__mapDeps([47,1,2,3,13,4,5,6,7,9,10,11,12,8,36,25,21])),treasury:()=>a(()=>import("./TreasuryRoutes-BJIzvR2Q.js"),__vite__mapDeps([48,1,2,3,4,5,6,7,13,26,17,15,12,27,9,14,49,19,21])),vendors:()=>a(()=>import("./VendorsRoutes-45nX3W2c.js"),__vite__mapDeps([50,1,2,3,4,5,6,7,23,13,19,12,51,9,17,25,36,21])),zeniAccounts:()=>a(()=>import("./ZeniAccountRoutes-DWsFxkzK.js"),__vite__mapDeps([52,1,2,3,4,5,6,7,49,13,26,17,15,12,27,19,24,23,9,34,21]))},Js=["bills","transactions","settings","reimbursement","reports","chargeCards","people"],se=i=>{"requestIdleCallback"in window?requestIdleCallback(i):setTimeout(i,100)},Ks=l(()=>a(()=>import("./ReportsRoutes-uT5eAJf1.js"),__vite__mapDeps([43,1,2,3,4,5,6,7,13,19,14,12,17,21]))),Qs=l(()=>a(()=>import("./AddressRoutes-CZL5IIDj.js"),__vite__mapDeps([53,1,2,3,23,4,5,6,7,13,21]))),Xs=l(()=>a(()=>import("./PeopleRoutes-CQ7KgSTF.js"),__vite__mapDeps([46,1,2,3,4,5,6,7,13,9,17,21]))),ea=l(()=>a(()=>import("./PandLWithForecastRoutes-COEiLMeU.js"),__vite__mapDeps([54,1,2,3,4,5,6,7,13,19,9,14,12,17,21]))),sa=l(()=>a(()=>import("./CustomerOnboardingRoutes-C39jSTCn.js"),__vite__mapDeps([55,1,2,3,23,4,5,6,7,13,37,38,39,40,41,11,42,45,21]))),aa=l(()=>a(()=>import("./VendorsRoutes-45nX3W2c.js"),__vite__mapDeps([50,1,2,3,4,5,6,7,23,13,19,12,51,9,17,25,36,21]))),na=l(()=>a(()=>import("./TransactionDetailRoutes-Dko7BvP2.js"),__vite__mapDeps([56,1,2,3,13,4,5,6,7,10,9,11,12,21]))),He=l(()=>a(()=>import("./EntityDetailRoutes-CGqc-n2O.js"),__vite__mapDeps([57,1,2,3,4,5,6,7,11,8,9,10,12,21]))),ta=l(()=>a(()=>import("./DashboardRoutes-dFcQ-Udv.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21]))),De=l(()=>a(()=>import("./BillPayRoutes-ycYrxG7k.js"),__vite__mapDeps([22,1,2,3,4,5,6,7,23,13,24,9,14,25,17,19,26,15,12,27,28,29,30,21]))),ia=l(()=>a(()=>import("./SettingsRoutes-DqieIzNx.js"),__vite__mapDeps([35,1,2,3,4,5,6,7,17,36,23,13,15,27,12,16,37,38,39,40,41,11,42,28,29,32,21]))),fe=l(()=>a(()=>import("./ReimbursementRoutes--RsJPCEP.js"),__vite__mapDeps([31,1,2,3,4,5,6,7,13,26,17,15,12,27,19,9,14,25,32,29,30,21]))),ra=l(()=>a(()=>import("./ZeniAccountRoutes-DWsFxkzK.js"),__vite__mapDeps([52,1,2,3,4,5,6,7,49,13,26,17,15,12,27,19,24,23,9,34,21]))),oa=l(()=>a(()=>import("./TreasuryRoutes-BJIzvR2Q.js"),__vite__mapDeps([48,1,2,3,4,5,6,7,13,26,17,15,12,27,9,14,49,19,21]))),la=l(()=>a(()=>import("./TransactionListRoutes-MalhqO-o.js"),__vite__mapDeps([33,1,2,3,4,5,6,7,8,9,10,11,12,34,21]))),ca=l(()=>a(()=>import("./ChargeCardRoutes-iiwF-L1o.js"),__vite__mapDeps([44,1,2,3,4,5,6,7,9,17,26,13,15,12,27,14,45,23,21]))),da=l(()=>a(()=>import("./NotificationRoutes-DRjXwQc4.js"),__vite__mapDeps([58,1,2,3,13,4,5,6,7,9,21]))),ma=l(()=>a(()=>import("./PerformanceRoutes-CUptxU2M.js"),__vite__mapDeps([59,1,2,3,13,4,5,6,7,9,17,21]))),ua=l(()=>a(()=>import("./ExpenseAutomationRoutes-iUGrHrmT.js"),__vite__mapDeps([47,1,2,3,13,4,5,6,7,9,10,11,12,8,36,25,21]))),_a=l(()=>a(()=>import("./RewardsRoutes-DNPQGfAV.js"),__vite__mapDeps([60,1,2,3,4,5,6,7,13,20,9,17,21]))),pa=l(()=>a(()=>import("./TaskRoutes-DXfXoaYF.js"),__vite__mapDeps([61,1,2,3,13,4,5,6,7,14,17,62,9,21]))),Aa=l(()=>a(()=>import("./AiCfoScreen-Ufyr17L2.js"),__vite__mapDeps([63,1,2,3,4,5,6,7,18,51,21]))),ye=l(()=>a(()=>import("./CardsAiCfoScreen-BofarOgC.js"),__vite__mapDeps([64,1,2,3,4,5,6,7,21]))),D=l(()=>a(()=>import("./NotFoundScreen-DmxmtGfC.js"),__vite__mapDeps([13,1,2,3,4,5,6,7,21]))),Ea=l(()=>a(()=>import("./TaskListScreen-Chd2rxBe.js"),__vite__mapDeps([62,1,2,3,4,5,6,7,9,17,21])));function Na({setTenantEmailDomain:i}){const U=ks(),V=Bs(),{tenantEmailDomain:o}=Vs(),S=Ms().mode,{setLoading:y,clearAllLoading:O,clearLoading:Z}=Zs(),f=b.getSignedInUserTenant(o)?.tenantId,j=b.getSignedInUser(),ae=is(j),$=Ss(),[N,ve]=v.useState(!1),r=G(n=>rs(n)),{useFeatureGate:L}=ws(),w=zs(),ne=Gs(),{isFeatureEnabled:Oe}=L(B.isDepositAccountsFeatureEnabled),{isFeatureEnabled:Pe}=L(B.isTreasuryEnabled),{isFeatureEnabled:Fe}=L(B.isChargeCardFeatureEnabled),{isFeatureEnabled:te}=L(B.isDebitCardFeatureEnabled),h=G(n=>n.tenantState.fetchState),A=G(n=>n.tenantState.activeTenantFetchState.fetchState),u=A==="Completed"||h==="Completed"?os(te,r):void 0,W=A==="Completed"||h==="Completed"?ls(r):void 0,Le=A==="Completed"||h==="Completed"?cs(r):void 0,ke=Fe||te||!!Le||!!W||!!u,{isFeatureEnabled:Be}=L(B.isSettingsFeatureEnabled),{isFeatureEnabled:K}=L(B.isAiCfoFileUploadEnabled),Y=G(n=>ds(n));if(o!=null){const n=b.getSignedInUserTenant(o);j!=null&&n!=null&&be(j,r,S)}const z={tenantId:f,userId:j?.userId,sessionId:j?.zeniSessionId},ie=ms(),p=$s(),Ve=r.company==null||p?.loggedInUserRoleMap!=null&&xe(p.loggedInUserRole),Se=us(p?.loggedInUserRoleMap),re=v.useRef(!0),oe=Ue("/:tenantEmailDomain/onboarding/*")!==null,Q=Ue("/:tenantEmailDomain/month_end_close_checks/review/:selectedTab/:selectedPeriod/*"),Ne=G(n=>z.tenantId!=null?_s(n,z.tenantId):void 0);v.useEffect(()=>{y(F.TENANT_FETCHING),i(o)},[o]),v.useEffect(()=>{if(Q!=null&&f!=null){const n=Q.params.selectedPeriod;if(n!=null){const R=n.split("-");if(R.length===2){const d=ps(Number(R[0])),s=Number(R[1]),m=As(`01-${d<10?`0${d}`:d}-${s}`,Re.getLocalizedStrings().dateFormat.analytics.DDDashMMDashYYYY),M=Es();m.isAfter(M,"month")===!1?U(xs(f,{month:d,year:s})):V("./month_end_close_checks/review")}}}},[Q,f]),v.useEffect(()=>{N||(ve(!0),y(F.TENANT_FETCHING)),re.current?re.current=!1:!gs(ie,z)&&b.isSignedIn()&&(y(F.TENANT_FETCHING),function(n,R,d,s){if(Ie(R?.userId,R?.zeniSessionId,n.tenantId),d(Fs(!0)),d(Te(n.tenantId)),n.tenantId!=null&&_.clearTenant(n.tenantId),n.tenantId!=null){const m=b.getSignedInUserTenantWithId(n.tenantId);s&&Re.updateAppLocaleID(Ys(s)),m?.tenantEmailDomain!=null&&b.saveActiveTenantDomainForUser(m?.tenantEmailDomain)}n.userId!=null?ee.identify(n.userId,{tenant_id:n.tenantId}):ee.resetUserIdentity()}(z,j,U,Ne))},[z,ie,j,U,b]),v.useEffect(()=>{b.isSignedIn()&&(y(F.TENANT_FETCHING),function(n,R,d,s,m,M,k){if(d==null&&s==null)return void console.warn("There is no current tenant selected!!");const q=s!=null&&m?.zeniSessionId!=null,as=d==null||d.tenantId!==s,ns=d!=null&&d.excludedResources==null,ts=d!=null&&d.externalConnections==null;if(q&&as){k(Te(s));const J=b.getSignedInUserTenantWithId(s);J?.tenantEmailDomain!=null&&b.saveActiveTenantDomainForUser(J?.tenantEmailDomain),Ie(m?.userId,m?.zeniSessionId,s),_.shouldFetchExcludedResources(s)&&(_.markExcludedResourcesFetchStarted(s),k(je(m.userId,s))),_.shouldFetchConnections(s)&&(_.markConnectionsFetchStarted(s),k(he(m.userId,s)))}else q&&ns&&_.shouldFetchExcludedResources(s)&&(_.markExcludedResourcesFetchStarted(s),k(je(m.userId,s))),q&&ts&&_.shouldFetchConnections(s)&&(_.markConnectionsFetchStarted(s),k(he(m.userId,s)));if(q){ee.identify(m.userId,{tenant_id:s});const J=s==null||s!=null&&(R==="Completed"||R==="Error");n==="Completed"||R!=="Not-Started"&&R!=="Error"||s==null||!_.shouldFetchActiveTenant(s)||(_.markActiveTenantFetchStarted(s),M(F.TENANT_FETCHING),k(Ls(m.userId,s,m.zeniSessionId))),J&&(n==="Not-Started"||n==="Error")&&_.shouldFetchAllTenants()&&(_.markAllTenantsFetchStarted(),k(ge(m.userId,m.zeniSessionId)))}}(h,A,r,f,j,y,U))},[f,A]),v.useEffect(()=>{b.isSignedIn()&&h==="Completed"&&Y.tenantsBaseInOrder.length>0&&(Z(F.TENANT_FETCHING),b.saveSignedInUserTenants(Is(Y.tenantsBaseInOrder)),j!=null&&be(j,r,S,void 0,Y.tenantsBaseInOrder))},[Y,h,r,j]),v.useEffect(()=>{A==="In-Progress"&&y(F.TENANT_FETCHING),A!=="Completed"&&A!=="Error"||(A==="Completed"&&f!=null?(O(),_.markActiveTenantFetchCompleted(f)):A==="Error"&&f!=null&&(_.markActiveTenantFetchFailed(f),Z(F.TENANT_FETCHING),Z(F.TENANT_SWITCHING))),h!=="Completed"&&h!=="Error"||(h==="Completed"?_.markAllTenantsFetchCompleted():h==="Error"&&_.markAllTenantsFetchFailed())},[A,h,f,N]);const le=v.useRef(!1);v.useEffect(()=>{!le.current&&A==="Completed"&&N&&(le.current=!0,function(n=Js,R=3e3){setTimeout(()=>{const d=s=>{if(s>=n.length)return;const m=n[s],M=qs[m];M!=null?M().then(()=>se(()=>d(s+1))).catch(()=>se(()=>d(s+1))):d(s+1)};se(()=>d(0))},R)}())},[A,N]);const C=r?.userRole!=null&&Ts(r?.userRole),{isFeatureEnabled:Me}=L(B.isReferralFeatureEnabled),Ze=r?.userRole!=null&&r.userRole.includes("charge_card_user"),we=r?.userRole!=null&&r.userRole.includes("charge_card_admin"),P=r?.userRole!=null&&xe(r.userRole),ce=r?.company==null||r.company.featuresActivationInfo?.isBillPayFeatureEnabled&&!C,de=ke&&!C,ze=js(p?.loggedInUserRoleMap),Ge=r.externalConnections?.accounting[0]?.isValid,me=r.company?.companyOnboardingInfo.isOnboardingCompleted,ue=r?.company==null||r.company.featuresActivationInfo?.isReimbursementFeatureEnabled&&!C,_e=ue&&hs(p?.loggedInUserRoleMap),pe=Oe&&!C,$e=r.company!=null&&Us(r.company),We=Pe&&$e===!0&&!C,Ye=ce&&Rs(p?.loggedInUserRoleMap),qe=de&&bs(p?.loggedInUserRoleMap),Je=pe&&Hs(p?.loggedInUserRoleMap),Ke=Ds(p?.loggedInUserRoleMap),Qe=fs(p?.loggedInUserRoleMap),E=ys(p?.loggedInUserRoleMap),x=Cs(p?.loggedInUserRoleMap),g=vs(p?.loggedInUserRoleMap),I=Os(p?.loggedInUserRoleMap),T=Ps(p?.loggedInUserRoleMap),Ae=ce&&I,Ee=ue&&T,Xe=pe&&E,es=We&&x,X=de&&g,ss=r.excludedResources?.resources?.find(n=>n.resource==="/invites")!=null||Se===!0||ze===!0||Ke===!0||Qe===!0;return b.isSignedIn()?f==null?h==="Completed"?e.jsx(c,{to:"/",replace:!0,state:{...$.state,message:"...",origin:$.pathname}}):(j!=null&&h!=="In-Progress"&&U(ge(j.userId,j.zeniSessionId)),null):A!=="In-Progress"&&A!=="Not-Started"||h==="Completed"?(me===!0||ae&&!oe)&&Ge===!1&&u===!1&&W===!1?(i(void 0),e.jsx(c,{to:"/connection/auth",replace:!0})):!N||me!==!1||oe||ae?N&&r?.userRole&&u!=null&&W!=null&&o!=null&&Object.keys(p.loggedInUserRoleMap).length>0?e.jsx(Ns,{children:e.jsxs(t,{element:e.jsx(Ws,{}),children:[e.jsx(t,{path:"/",element:e.jsx(xa,{isDashboardAccess:P,isUserHasZeniAccountsAccess:E,isUserHasChargeCardAccess:g,isUserHasBillPayAccess:I,isUserHasReimbursementAccess:T,isUserHasTreasuryAccess:x,isTenantBankingOnly:u,isTenantCardsOnly:W})}),e.jsx(t,{path:"dashboard/*",element:P?e.jsx(ta,{}):e.jsx(H,{isUserHasZeniAccountsAccess:E,isUserHasChargeCardAccess:g,isUserHasBillPayAccess:I,isUserHasReimbursementAccess:T,isUserHasTreasuryAccess:x,isTenantBankingOnly:u,tenantEmailDomain:o})}),e.jsx(t,{path:"reports/*",element:P?e.jsx(Ks,{}):e.jsx(H,{isUserHasZeniAccountsAccess:E,isUserHasChargeCardAccess:g,isUserHasBillPayAccess:I,isUserHasReimbursementAccess:T,isUserHasTreasuryAccess:x,isTenantBankingOnly:u,tenantEmailDomain:o})}),e.jsx(t,{path:"people/*",element:ss||P?e.jsx(Xs,{}):e.jsx(H,{isUserHasZeniAccountsAccess:E,isUserHasChargeCardAccess:g,isUserHasBillPayAccess:I,isUserHasReimbursementAccess:T,isUserHasTreasuryAccess:x,isTenantBankingOnly:u,tenantEmailDomain:o})}),e.jsx(t,{path:"forecast/*",element:P?e.jsx(ea,{}):e.jsx(H,{isUserHasZeniAccountsAccess:E,isUserHasChargeCardAccess:g,isUserHasBillPayAccess:I,isUserHasReimbursementAccess:T,isUserHasTreasuryAccess:x,isTenantBankingOnly:u,tenantEmailDomain:o})}),e.jsx(t,{path:"onboarding/*",element:e.jsx(sa,{})}),e.jsx(t,{path:"transaction/*",element:P&&C===!1||Ze||we?e.jsx(na,{}):e.jsx(H,{isUserHasZeniAccountsAccess:E,isUserHasChargeCardAccess:g,isUserHasBillPayAccess:I,isUserHasReimbursementAccess:T,isUserHasTreasuryAccess:x,isTenantBankingOnly:u,tenantEmailDomain:o})}),e.jsx(t,{path:"transactions/*",element:P&&C===!1?e.jsx(la,{}):e.jsx(H,{isUserHasZeniAccountsAccess:E,isUserHasChargeCardAccess:g,isUserHasBillPayAccess:I,isUserHasReimbursementAccess:T,isUserHasTreasuryAccess:x,isTenantBankingOnly:u,tenantEmailDomain:o})}),e.jsx(t,{path:"customer/*",element:P&&C===!1?e.jsx(He,{entityType:"customer"}):e.jsx(H,{isUserHasZeniAccountsAccess:E,isUserHasChargeCardAccess:g,isUserHasBillPayAccess:I,isUserHasReimbursementAccess:T,isTenantBankingOnly:u,isUserHasTreasuryAccess:x,tenantEmailDomain:o})}),e.jsx(t,{path:"vendor/*",element:P&&C===!1?e.jsx(He,{entityType:"vendor"}):e.jsx(H,{isUserHasZeniAccountsAccess:E,isUserHasChargeCardAccess:g,isUserHasBillPayAccess:I,isUserHasReimbursementAccess:T,isUserHasTreasuryAccess:x,isTenantBankingOnly:u,tenantEmailDomain:o})}),e.jsx(t,{path:"tasks",element:e.jsx(Ea,{})}),e.jsx(t,{path:"tasks/*",element:e.jsx(pa,{})}),e.jsx(t,{path:"address/*",element:Ye||_e||Je||qe?e.jsx(Qs,{}):e.jsx(H,{isUserHasZeniAccountsAccess:E,isUserHasChargeCardAccess:g,isUserHasBillPayAccess:I,isUserHasReimbursementAccess:T,isUserHasTreasuryAccess:x,isTenantBankingOnly:u,tenantEmailDomain:o})}),e.jsx(t,{path:"checking/*",element:Xe?e.jsx(ra,{}):e.jsx(D,{})}),e.jsx(t,{path:"treasury/*",element:es?e.jsx(oa,{}):e.jsx(D,{})}),e.jsx(t,{path:"performance",element:ne===!0?e.jsx(ma,{}):e.jsx(Ce,{tenantEmailDomain:o})}),e.jsx(t,{path:"month_end_close_checks/review/*",element:ne===!0&&C===!1?e.jsx(ua,{}):e.jsx(Ce,{tenantEmailDomain:o})}),e.jsx(t,{path:"notifications/*",element:e.jsx(da,{})}),e.jsx(t,{path:"vendors/*",element:Ve?e.jsx(aa,{}):e.jsx(D,{})}),e.jsx(t,{path:"bill/*",element:Ae?e.jsx(De,{}):e.jsx(H,{isUserHasZeniAccountsAccess:E,isUserHasChargeCardAccess:g,isUserHasBillPayAccess:I,isUserHasReimbursementAccess:T,isUserHasTreasuryAccess:x,isTenantBankingOnly:u,tenantEmailDomain:o})}),e.jsx(t,{path:"bills/*",element:Ae?e.jsx(De,{}):e.jsx(H,{isUserHasZeniAccountsAccess:E,isUserHasChargeCardAccess:g,isUserHasBillPayAccess:I,isUserHasReimbursementAccess:T,isUserHasTreasuryAccess:x,isTenantBankingOnly:u,tenantEmailDomain:o})}),e.jsx(t,{path:"reimbursement/*",element:Ee?e.jsx(fe,{}):e.jsx(H,{isUserHasZeniAccountsAccess:E,isUserHasChargeCardAccess:g,isUserHasBillPayAccess:I,isUserHasReimbursementAccess:T,isUserHasTreasuryAccess:x,isTenantBankingOnly:u,tenantEmailDomain:o})}),e.jsx(t,{path:"reimbursements/*",element:Ee?e.jsx(fe,{}):e.jsx(H,{isUserHasZeniAccountsAccess:E,isUserHasChargeCardAccess:g,isUserHasBillPayAccess:I,isUserHasReimbursementAccess:T,isUserHasTreasuryAccess:x,isTenantBankingOnly:u,tenantEmailDomain:o})}),e.jsx(t,{path:"settings/*",element:Be?e.jsx(ia,{hasAdminLevelAccess:_e}):e.jsx(D,{})}),e.jsx(t,{path:"cards/ask",element:X&&w?e.jsx(ye,{isFileUploadEnabled:K}):e.jsx(D,{})}),e.jsx(t,{path:"cards/ask/:session_id",element:X&&w?e.jsx(ye,{isFileUploadEnabled:K}):e.jsx(D,{})}),e.jsx(t,{path:"cards/*",element:X?e.jsx(ca,{}):e.jsx(D,{})}),e.jsx(t,{path:"rewards/*",element:Me?e.jsx(_a,{}):e.jsx(D,{})}),e.jsx(t,{path:"/ai-cfo",element:w?e.jsx(c,{to:"explore"}):e.jsx(D,{})}),e.jsx(t,{path:"/ai-cfo/",element:w?e.jsx(c,{to:"explore"}):e.jsx(D,{})}),e.jsx(t,{path:"/ai-cfo/:session_id",element:w?e.jsx(Aa,{isFileUploadEnabled:K}):e.jsx(D,{})}),e.jsx(t,{path:"*",element:e.jsx(D,{})})]})}):null:(i(void 0),e.jsx(c,{to:"onboarding",replace:!0})):null:(console.warn("User logged out!!"),i(void 0),e.jsx(c,{to:"/signin/auth",replace:!0,state:{...$.state,message:"...",origin:$.pathname}}))}const xa=({isDashboardAccess:i,isUserHasZeniAccountsAccess:U,isUserHasChargeCardAccess:V,isUserHasBillPayAccess:o,isUserHasReimbursementAccess:S,isUserHasTreasuryAccess:y,isTenantBankingOnly:O,isTenantCardsOnly:Z})=>O===!0&&U?e.jsx(c,{to:"checking"}):Z===!0?e.jsx(c,{to:"cards"}):i?e.jsx(c,{to:"dashboard"}):U?e.jsx(c,{to:"checking"}):y?e.jsx(c,{to:"treasury"}):V?e.jsx(c,{to:"cards"}):o?e.jsx(c,{to:"bills"}):S?e.jsx(c,{to:"reimbursements"}):e.jsx(c,{to:"dashboard"}),H=({isUserHasZeniAccountsAccess:i,isUserHasChargeCardAccess:U,isUserHasBillPayAccess:V,isUserHasReimbursementAccess:o,isUserHasTreasuryAccess:S,isTenantBankingOnly:y,tenantEmailDomain:O})=>y===!0||i?e.jsx(ja,{tenantEmailDomain:O}):S?e.jsx(Ta,{tenantEmailDomain:O}):U?e.jsx(ha,{tenantEmailDomain:O}):V?e.jsx(Ia,{tenantEmailDomain:O}):o?e.jsx(ga,{tenantEmailDomain:O}):e.jsx(D,{}),ga=({tenantEmailDomain:i})=>e.jsx(c,{to:`/${i}/reimbursements`}),Ia=({tenantEmailDomain:i})=>e.jsx(c,{to:`/${i}/bills`}),Ta=({tenantEmailDomain:i})=>e.jsx(c,{to:`/${i}/treasury`}),ja=({tenantEmailDomain:i})=>e.jsx(c,{to:`/${i}/checking`}),ha=({tenantEmailDomain:i})=>e.jsx(c,{to:`/${i}/cards`}),Ce=({tenantEmailDomain:i})=>e.jsx(c,{to:`/${i}/dashboard`});export{H as FallBackRoute,Na as default};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{j as o}from"./liveblocks-evjZPqs_.js";import{a as p}from"./sentry-CCZGmBkl.js";import{h as V,g as Q,u as T,j as h,s as ce,n as $,i as G,o as J,p as A}from"./core-DmAftQ4g.js";import{bn as je,eW as M,gn as Pe,mZ as le,Od as Me,hD as he,O4 as De,qP as Ue,kv as fe,mV as Te,hF as _e,O6 as Re,O5 as Be,Qv as Fe,zf as Oe,EJ as Ve,Q4 as ze,Qd as Le,c6 as ee,cL as Ne,cM as Qe,M4 as $e,Qw as Ge,M5 as Ke,xH as He,Qx as Ze,H8 as We,Ep as qe,Eg as be,Ed as Je,xL as Se,Ej as ye,Em as Ce,Es as ne,u9 as te,xK as Xe,k7 as X,ka as Ie,Qy as Ye,lb as en,x_ as nn,M_ as tn,M$ as an,k5 as on,Qz as sn,k8 as cn,rh as ln,MV as rn,MW as dn,rl as un,ho as pn,Md as q,hg as re,hd as gn,hl as mn,Me as hn,xX as fn,QA as bn,QB as Sn,EG as yn,fz as xe,fB as Ee,QC as Cn,gb as In,Mn as xn,xW as de,gg as ue,gf as En,xV as An,ge as vn,gd as wn,QD as kn,fE as Ae,QE as jn,QF as Pn,y1 as Mn,xU as pe,QG as Dn,fV as Un,xR as Tn,bZ as _n,c5 as Rn,c4 as Bn,b_ as Fn,c2 as On,c1 as Vn,c0 as zn,c3 as Ln,b$ as Nn}from"./zeni-epic-state-vtQ66nN6.js";import{W as ae,U as R,z as j,af as ve,bR as Qn,c as W,e as $n,bC as Gn,I as K,B as oe,bS as Kn,bT as Hn,ar as Zn,i as we,bU as Wn,bV as qn,bW as Jn,a9 as Xn,X as Yn,bX as et,q as nt,bY as tt}from"./index-
|
|
1
|
+
import{j as o}from"./liveblocks-evjZPqs_.js";import{a as p}from"./sentry-CCZGmBkl.js";import{h as V,g as Q,u as T,j as h,s as ce,n as $,i as G,o as J,p as A}from"./core-DmAftQ4g.js";import{bn as je,eW as M,gn as Pe,mZ as le,Od as Me,hD as he,O4 as De,qP as Ue,kv as fe,mV as Te,hF as _e,O6 as Re,O5 as Be,Qv as Fe,zf as Oe,EJ as Ve,Q4 as ze,Qd as Le,c6 as ee,cL as Ne,cM as Qe,M4 as $e,Qw as Ge,M5 as Ke,xH as He,Qx as Ze,H8 as We,Ep as qe,Eg as be,Ed as Je,xL as Se,Ej as ye,Em as Ce,Es as ne,u9 as te,xK as Xe,k7 as X,ka as Ie,Qy as Ye,lb as en,x_ as nn,M_ as tn,M$ as an,k5 as on,Qz as sn,k8 as cn,rh as ln,MV as rn,MW as dn,rl as un,ho as pn,Md as q,hg as re,hd as gn,hl as mn,Me as hn,xX as fn,QA as bn,QB as Sn,EG as yn,fz as xe,fB as Ee,QC as Cn,gb as In,Mn as xn,xW as de,gg as ue,gf as En,xV as An,ge as vn,gd as wn,QD as kn,fE as Ae,QE as jn,QF as Pn,y1 as Mn,xU as pe,QG as Dn,fV as Un,xR as Tn,bZ as _n,c5 as Rn,c4 as Bn,b_ as Fn,c2 as On,c1 as Vn,c0 as zn,c3 as Ln,b$ as Nn}from"./zeni-epic-state-vtQ66nN6.js";import{W as ae,U as R,z as j,af as ve,bR as Qn,c as W,e as $n,bC as Gn,I as K,B as oe,bS as Kn,bT as Hn,ar as Zn,i as we,bU as Wn,bV as qn,bW as Jn,a9 as Xn,X as Yn,bX as et,q as nt,bY as tt}from"./index-BsmcHa9A.js";import{n as B}from"./mui-PcDpEhsm.js";import{M as _}from"./MobileAppDrawer-cGG4tefr.js";import{a as H,g as Z,m as at}from"./accountMappingHelper-CSvCSQoY.js";import{t as ot,A as st}from"./AddressScreen-CxOVTdB3.js";import N from"./NotFoundScreen-DmxmtGfC.js";import{g as it}from"./analyticsHelper-MomIUc09.js";import{B as ct}from"./BusinessVerificationPageScreen-BSOfMkHj.js";import{C as lt}from"./CompanyPassportScreen-N6HtNLO2.js";import{q as ge}from"./QBOConnectionScreen-MiEEvzBf.js";import{u as rt}from"./useEmailConnectResultRefresh-CiHOFzmr.js";import{B as dt}from"./BillPayApprovalRoutes-COMjZNBM.js";import{R as ut}from"./ReimbursementApprovalRoutes-CuEZag2r.js";import"./recharts-CgEqsrFw.js";import"./analytics-DCrhd8oB.js";import"./plaid-DSnXUEUK.js";import"./dnd-3F1D24DQ.js";import"./stripe-DMRn4zHo.js";import"./lottie-CmTLY-9t.js";import"./lexical-PVlNGkpS.js";import"./pdf-CbXlPYUs.js";import"./utils--mWNe9J7.js";import"./routePaths-ieN8hn7m.js";import"./empty-CDCfsLV4.js";import"./pdf-lib-CU5FhbnZ.js";import"./index-EyTFjAAZ.js";import"./url-9kg5cual.js";import"./index-DniSRtks.js";import"./decodeURIComponentSafe-C70tsXnj.js";import"./ReimbursementApprovalRuleDetailScreen-DSLe2MhL.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]="3ac6a534-cf81-47df-b787-68495eee9355",e._sentryDebugIdIdentifier="sentry-dbid-3ac6a534-cf81-47df-b787-68495eee9355")}catch{}})();const pt=B.div`
|
|
2
2
|
display: flex;
|
|
3
3
|
height: 100%;
|
|
4
4
|
width: 100%;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{j as u}from"./liveblocks-evjZPqs_.js";import{h as X,g as Y,u as ee,i as G,j as v,N as j,n as H,t as Ye}from"./core-DmAftQ4g.js";import{bJ as en,co as Ie,PU as ye,eW as V,cA as nn,zv as Q,zf as tn,Q4 as an,Q7 as on,rA as ne,ro as te,l3 as ae,tH as L,Q9 as Ae,gf as Qe,ge as $e,gd as Ge,Qa as sn,zE as cn,Ep as ke,Eg as _e,Ed as ve,DX as K,Ej as Pe,Em as Ee,Es as Te,u9 as we,gu as rn,cv as un,fB as dn,fz as ln,fA as pn,bt as mn,Qb as yn,CX as le,Dz as fn,Qc as gn,bK as Sn,FI as pe,EJ as bn,Qd as hn,Qe as Cn,FM as In,FQ as An,tA as kn,Ke as _n,Gl as Ce,Hl as me,Qf as vn,Qg as Pn,Qh as En,Qi as He,Qj as Tn,MH as wn,Ph as Dn,MY as Un,Qk as We,D$ as On,MZ as Fn,E3 as Vn,Ql as Ve,GH as qe,lb as Bn,rr as Ke,tJ as xn,bE as je,tV as Re,cy as jn,Qm as Je,fU as Rn,G3 as zn,G7 as Nn,Qn as Ln,Go as ze,Qo as Mn,Qp as Zn,Qq as Qn,Qr as $n,gn as Gn,AP as Hn,Qs as Wn,AU as qn,AT as Kn}from"./zeni-epic-state-vtQ66nN6.js";import{I as ie,W as oe,U as de,m as De,aQ as J,bC as Xe,z as D,x as se,c as U,B as Ue,e as $,bD as Jn,au as ce,bE as B,bF as Xn,bG as Yn,af as xe,bH as et,q as Ne,av as Le,Z as nt,y as tt,bI as at,bJ as it,bK as ot,a7 as st}from"./index-
|
|
1
|
+
import{j as u}from"./liveblocks-evjZPqs_.js";import{h as X,g as Y,u as ee,i as G,j as v,N as j,n as H,t as Ye}from"./core-DmAftQ4g.js";import{bJ as en,co as Ie,PU as ye,eW as V,cA as nn,zv as Q,zf as tn,Q4 as an,Q7 as on,rA as ne,ro as te,l3 as ae,tH as L,Q9 as Ae,gf as Qe,ge as $e,gd as Ge,Qa as sn,zE as cn,Ep as ke,Eg as _e,Ed as ve,DX as K,Ej as Pe,Em as Ee,Es as Te,u9 as we,gu as rn,cv as un,fB as dn,fz as ln,fA as pn,bt as mn,Qb as yn,CX as le,Dz as fn,Qc as gn,bK as Sn,FI as pe,EJ as bn,Qd as hn,Qe as Cn,FM as In,FQ as An,tA as kn,Ke as _n,Gl as Ce,Hl as me,Qf as vn,Qg as Pn,Qh as En,Qi as He,Qj as Tn,MH as wn,Ph as Dn,MY as Un,Qk as We,D$ as On,MZ as Fn,E3 as Vn,Ql as Ve,GH as qe,lb as Bn,rr as Ke,tJ as xn,bE as je,tV as Re,cy as jn,Qm as Je,fU as Rn,G3 as zn,G7 as Nn,Qn as Ln,Go as ze,Qo as Mn,Qp as Zn,Qq as Qn,Qr as $n,gn as Gn,AP as Hn,Qs as Wn,AU as qn,AT as Kn}from"./zeni-epic-state-vtQ66nN6.js";import{I as ie,W as oe,U as de,m as De,aQ as J,bC as Xe,z as D,x as se,c as U,B as Ue,e as $,bD as Jn,au as ce,bE as B,bF as Xn,bG as Yn,af as xe,bH as et,q as Ne,av as Le,Z as nt,y as tt,bI as at,bJ as it,bK as ot,a7 as st}from"./index-BsmcHa9A.js";import{a as C}from"./sentry-CCZGmBkl.js";import{n as Be,D as ct,S as rt}from"./mui-PcDpEhsm.js";import{M as fe}from"./MobileAppDrawer-cGG4tefr.js";import N from"./NotFoundScreen-DmxmtGfC.js";import{a as Me}from"./analyticsHelper-MomIUc09.js";import{d as Ze}from"./routePaths-ieN8hn7m.js";import{B as Fe}from"./BusinessVerificationPageScreen-BSOfMkHj.js";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},s=new e.Error().stack;s&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[s]="35e7d7c4-1760-4d1d-a481-ba4de3040c93",e._sentryDebugIdIdentifier="sentry-dbid-35e7d7c4-1760-4d1d-a481-ba4de3040c93")}catch{}})();const ut=Be.div`
|
|
2
2
|
display: flex;
|
|
3
3
|
height: 100%;
|
|
4
4
|
width: 100%;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{j as f}from"./liveblocks-evjZPqs_.js";import{a as u,b as T,q as A}from"./sentry-CCZGmBkl.js";import{u as z,h as D,j as c,g as M,N as O,n as _}from"./core-DmAftQ4g.js";import{u as j,z as s,m as P,c as E,O as F,d as B,e as N,f as $,g as V,h as W,i as b}from"./index-
|
|
1
|
+
import{j as f}from"./liveblocks-evjZPqs_.js";import{a as u,b as T,q as A}from"./sentry-CCZGmBkl.js";import{u as z,h as D,j as c,g as M,N as O,n as _}from"./core-DmAftQ4g.js";import{u as j,z as s,m as P,c as E,O as F,d as B,e as N,f as $,g as V,h as W,i as b}from"./index-BsmcHa9A.js";import{eW as q,LT as J,LU as X,fx as Y,f_ as H,LZ as Z,gm as G,cX as K,L_ as y,L$ as Q,M0 as R,bY as v}from"./zeni-epic-state-vtQ66nN6.js";import"./mui-PcDpEhsm.js";import{u as ee}from"./useDeviceId-DGJPBja9.js";import{f as te}from"./analyticsHelper-MomIUc09.js";import{t as ne}from"./getLocaleForTenant-DBZLLRpQ.js";import"./recharts-CgEqsrFw.js";import"./analytics-DCrhd8oB.js";import"./plaid-DSnXUEUK.js";import"./dnd-3F1D24DQ.js";import"./stripe-DMRn4zHo.js";import"./lottie-CmTLY-9t.js";import"./lexical-PVlNGkpS.js";import"./pdf-CbXlPYUs.js";import"./utils--mWNe9J7.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]="36e0bbcd-be4d-4592-9a9c-e122ffb1b913",t._sentryDebugIdIdentifier="sentry-dbid-36e0bbcd-be4d-4592-9a9c-e122ffb1b913")}catch{}})();const ie=_(function(t,i){const d=t.tenantState.fetchState,g=t.tenantState.sendEmailMagicLinkFetchState,{magicLinkExpired:n,magicLinkAlreadyUsed:a,magicLinkExpiredEmail:l}=i;return{googleClientId:b.googleClientId,microsoftClientId:b.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:v(l),sourceUri:v(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(y())}}})(W),ae=T.memo(ie);function be({setTenantEmailDomain:t}){const i=z(),d=D(),{clearAllLoading:g}=j(),n=s.getSignedInUser();u.useLayoutEffect(()=>{g()},[g]);const a=ee(),l=c(e=>e.tenantState.magicLinkCodeVerifier),{sendEmailMagicLinkFetchState:L,accountLocked:U,accountUnlockTime:h}=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=>q(e)),I=c(e=>J(e)),m=M(),w=P().mode,x=m.state?.magicLinkExpired,C=m.state?.magicLinkAlreadyUsed;if(u.useEffect(()=>{L.fetchState==="Completed"&&l!=null&&(E.trackSignInLinkSent(),s.saveMagicLinkCodeVerifier(l))},[L.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(X(I.tenantsInOrder),o.zeniSessionId),Y(o.userId,o.zeniSessionId,r.tenantId),i(H(r.tenantId)),s.saveActiveTenantDomainForUser(r.tenantEmailDomain),i(Z("Completed")),F.updateAppLocaleID(ne(r)),te(o,r,w,void 0,I.tenantsInOrder),G().then(()=>{const e=V();e!=null&&B(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(O,{to:e,state:{...m.state,origin:""}})}return f.jsxs(f.Fragment,{children:[f.jsx(ae,{magicLinkExpired:!!x,magicLinkAlreadyUsed:!!C,magicLinkExpiredEmail:s.getMagicLinkEmail()??void 0,location:m,navigate:d,deviceId:a??void 0,showEmailLogin:!0}),U===!0&&h!=null?f.jsx($,{onClose:()=>i(y()),unlockDate:h}):null]})}export{be as default};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{j as s}from"./liveblocks-evjZPqs_.js";import{a}from"./sentry-CCZGmBkl.js";import{u,g as m,h as g,N as p}from"./core-DmAftQ4g.js";import{z as d,B as b,t as y,c,e as h}from"./index-
|
|
1
|
+
import{j as s}from"./liveblocks-evjZPqs_.js";import{a}from"./sentry-CCZGmBkl.js";import{u,g as m,h as g,N as p}from"./core-DmAftQ4g.js";import{z as d,B as b,t as y,c,e as h}from"./index-BsmcHa9A.js";import{gr as x,gs as I,Mf as w}from"./zeni-epic-state-vtQ66nN6.js";import{n as j}from"./mui-PcDpEhsm.js";import"./recharts-CgEqsrFw.js";import"./analytics-DCrhd8oB.js";import"./plaid-DSnXUEUK.js";import"./dnd-3F1D24DQ.js";import"./stripe-DMRn4zHo.js";import"./lottie-CmTLY-9t.js";import"./lexical-PVlNGkpS.js";import"./pdf-CbXlPYUs.js";import"./utils--mWNe9J7.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]="0b2be4e0-e755-48b1-998d-d88dce2935e0",e._sentryDebugIdIdentifier="sentry-dbid-0b2be4e0-e755-48b1-998d-d88dce2935e0")}catch{}})();function $(){const e=u(),t=m(),i=g(),n=a.useRef(!1),f=d.isSignedIn(),r=t.state?.message==="logout",o=r||f;return a.useEffect(()=>{o&&!n.current&&(n.current=!0,setTimeout(()=>{try{d.clearAll(),e(x()),e(I(!1)),w(),y.reset(),c.trackLogout(h.Event.logoutSuccess),c.resetUserIdentity()}catch(l){console.error("Error during sign out:",l)}finally{r||i("/signin/auth",{replace:!0})}},0))},[o,r]),o?s.jsx(v,{children:s.jsx(b,{fetchState:"In-Progress"})}):s.jsx(p,{to:"../",replace:!0})}const v=j.div`
|
|
2
2
|
display: flex;
|
|
3
3
|
height: 100vh;
|
|
4
4
|
width: 100%;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{j as u}from"./liveblocks-evjZPqs_.js";import{a as D}from"./sentry-CCZGmBkl.js";import{h as K,u as _,g as v,j as G,i as z,n as J}from"./core-DmAftQ4g.js";import{z as R,W,U as p,_ as M,x as O,c as Z,e as q,d9 as Q,q as g,p as V}from"./index-
|
|
1
|
+
import{j as u}from"./liveblocks-evjZPqs_.js";import{a as D}from"./sentry-CCZGmBkl.js";import{h as K,u as _,g as v,j as G,i as z,n as J}from"./core-DmAftQ4g.js";import{z as R,W,U as p,_ as M,x as O,c as Z,e as q,d9 as Q,q as g,p as V}from"./index-BsmcHa9A.js";import{eW as H,TI as F,J0 as C,TJ as x,TE as Y,Io as E,TK as X,Iw as y,HS as aa,J1 as S,TL as w,fw as ea,IT as ta,IY as sa,IL as oa,IJ as B,IZ as na,IG as ia,TM as la,TN as ra,TO as ca,TP as ka,TQ as T,ei as da,TR as ua,TS as pa}from"./zeni-epic-state-vtQ66nN6.js";import{n as Ta}from"./mui-PcDpEhsm.js";import{u as ma}from"./useAskAiCfoHostNavButtonProps-5Ek-t3F9.js";import{M as ga}from"./MobileAppDrawer-cGG4tefr.js";import"./recharts-CgEqsrFw.js";import"./analytics-DCrhd8oB.js";import"./plaid-DSnXUEUK.js";import"./dnd-3F1D24DQ.js";import"./stripe-DMRn4zHo.js";import"./lottie-CmTLY-9t.js";import"./lexical-PVlNGkpS.js";import"./pdf-CbXlPYUs.js";import"./utils--mWNe9J7.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]="8bcb6c3d-e19a-4dd2-be4a-7ddbe11fff99",e._sentryDebugIdIdentifier="sentry-dbid-8bcb6c3d-e19a-4dd2-be4a-7ddbe11fff99")}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-evjZPqs_.js";import se from"./NotFoundScreen-
|
|
1
|
+
import{j as n}from"./liveblocks-evjZPqs_.js";import se from"./NotFoundScreen-DmxmtGfC.js";import{a as c}from"./sentry-CCZGmBkl.js";import{h as _,u as H,j as g,g as ne,i as oe,N as ie,n as re,o as ce,p as f}from"./core-DmAftQ4g.js";import{I3 as O,I6 as le,I0 as de,eW as M,TE as W,Ik as J,HZ as pe,IQ as ue,IJ as ke,TF as Q,TG as V,HV as me,HS as fe,rA as ge,ro as he,l3 as Ie,Ie as Se,TH as Te,Iv as be,Is as Ee,I9 as Ge,Ip as Ce,Io as De}from"./zeni-epic-state-vtQ66nN6.js";import{z as C,d7 as xe,v as ye,W as je,U as b,p as X,q as w,x as ve,c as z,e as we,d8 as Re,i as A,au as Fe}from"./index-BsmcHa9A.js";import{n as Ue}from"./mui-PcDpEhsm.js";import{u as Be}from"./useInitialThreadRequest-Dr9FuJUY.js";import{M as Pe}from"./MobileAppDrawer-cGG4tefr.js";import Le from"./TaskListScreen-Chd2rxBe.js";import"./recharts-CgEqsrFw.js";import"./analytics-DCrhd8oB.js";import"./plaid-DSnXUEUK.js";import"./dnd-3F1D24DQ.js";import"./stripe-DMRn4zHo.js";import"./lottie-CmTLY-9t.js";import"./lexical-PVlNGkpS.js";import"./pdf-CbXlPYUs.js";import"./utils--mWNe9J7.js";import"./useAskAiCfoHostNavButtonProps-5Ek-t3F9.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]="3a9543af-7f93-4595-a464-338cfbebdcf6",e._sentryDebugIdIdentifier="sentry-dbid-3a9543af-7f93-4595-a464-338cfbebdcf6")}catch{}})();function $e(){const e=_(),t=H(),s=C.getSignedInUser(),{cannedResponses:u,fetchState:r,saveFetchState:d}=g(o=>o.cannedResponsesState),l=c.useCallback(()=>{t(O())},[t]),k=c.useCallback((o,h,I)=>{t(le({name:o,content:h,cannedResponseId:I}))},[t]),a=c.useCallback(o=>{t(de({cannedResponseId:o}))},[t]);if(s==null)throw Error("Can't access quick responses page without signing in...");return n.jsx(xe,{cannedResponses:u,isLoading:r==="In-Progress"||r==="Not-Started",isSaving:d==="In-Progress",onBackClick:()=>e(-1),onDelete:a,onFetch:l,onSave:k})}let q,Z=[];const Ne=re(function(e,t){const{location:s,taskGroupId:u}=t,r=Q(e,t.taskId),d=M(e),l=r.taskGroupId??u,k=l!=null?V(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)!==q&&(q=S,Z=Object.values(S)),Z),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=>V(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=X(d.state?.pathnameStackToGoBack),o=a.poppedPathname??"../../dashboard";u(o,{state:{pathnameStackToGoBack:a.newStack}})}else{const a=R(k),o=w(d.state?.pathnameStackToGoBack,d.pathname);u(a,{state:{pathnameStackToGoBack:o}})}e(Te({taskId:s}))},onDeleteTaskClick:()=>{e(Se(s))},updateFilesEntity:a=>{e(Ie({files:a}))},onDeleteFile:a=>{e(he(a))},onEditFileName:(a,o)=>{e(ge(a,o.split(".")[0]))},onReloadTaskDetailPage:()=>{e(J(!1,s))},onCreateTagClick:a=>{e(fe(a,s))},onDeleteTagClick:a=>{e(me(a,s))},onFetchCannedResponses:()=>{e(O())},onManageTemplatesClick:()=>{u(`/${r.tenantEmailDomain}/tasks/quick-responses`)}}})(Re);function v(){const e=_(),t=H(),s=ne(),u=ye(),{taskId:r,taskGroupId:d}=oe(),l=g(i=>M(i)),k=Be(l?.companyId),{useFeatureGate:a}=je(),{isFeatureEnabled:o}=a(b.isTaskSnoozeEnabled),{isFeatureEnabled:h}=a(b.isTaskVisibilityEnabled),{isFeatureEnabled:I}=a(b.isTaskCannedResponsesEnabled),{isFeatureEnabled:D}=a(b.isTaskRecurringParentEnabled),{isFeatureEnabled:E}=a(b.isTaskGroupAssigneesEnabled),[x,S]=c.useState(!1),[p,Y]=c.useState(!1),[F,K]=c.useState(!1),[U,ee]=c.useState(!1),[B,y]=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||(Y(!0),t(J(!1,r)))},[p,t]),c.useEffect(()=>{F||P.fetchState==="Completed"||(K(!0),t(pe()))},[F,t,P.fetchState]),c.useEffect(()=>{U||L==="Completed"||(ee(!0),t(ue()))},[U,t,L]);const ae=c.useCallback(()=>{r!=null&&(T.current=!1,t(ke([r],null,{isArchived:!1})),y(!0))},[t,r]);c.useEffect(()=>{if(B)if(G!=="In-Progress"){if(T.current){if(G==="Error")return y(!1),void(T.current=!1);if(G==="Completed"){y(!1),T.current=!1;const{tenantEmailDomain:i}=l;if(s.state?.message==="triggerBackClick"){const m=X(s.state?.pathnameStackToGoBack);e(m.poppedPathname??"../../dashboard",{state:{pathnameStackToGoBack:m.newStack}})}else{const m=R(i);e(m,{state:{pathnameStackToGoBack:w(s.state?.pathnameStackToGoBack,s.pathname)}})}}}}else T.current=!0},[B,G,l,s,e]);const $=g(i=>Q(i,r)),j=$.fetchState,N=C.getSignedInUser();if(N==null)throw Error("Can't access task detail page without signing in...");if(j==="Error"&&$.error?.code===400){const{tenantEmailDomain:i}=l,m=R(i),te=w(s.state?.pathnameStackToGoBack,s.pathname);return n.jsx(ie,{to:m,state:{pathnameStackToGoBack:te}})}return n.jsxs(n.Fragment,{children:[j==="Completed"?n.jsx(ve,{analytics:z,onLoad:i=>(m=>m.trackPageLoaded(we.Event.taskDetailPage))(i)}):null,n.jsxs(Ve,{children:[n.jsx(Pe,{isAppContentDrawerOpen:x,handleDrawerToggle:i=>{S(i)}}),n.jsx(Ne,{analytics:z,currentTenant:l,handleZeniLogoClick:()=>{u.toggle()},initialOpenThreadRequest:k,location:s,loggedInUser:N,navigate:e,taskGroupId:d,taskId:r,taskDetailFetchState:j,onUnarchiveTaskClick:ae,isTaskSnoozeEnabled:o,isTaskVisibilityEnabled:h,isTaskCannedResponsesEnabled:I,isTaskRecurringParentEnabled:D,isTaskGroupAssigneesEnabled:E})]})]})}const Ve=Ue.div`
|
|
2
2
|
display: flex;
|
|
3
3
|
min-height: 100%;
|
|
4
4
|
width: 100%;
|
package/dist/assets/{TransactionDetailRoutes-BXwhj2nX.js → TransactionDetailRoutes-Dko7BvP2.js}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{j as t}from"./liveblocks-evjZPqs_.js";import i from"./NotFoundScreen-
|
|
1
|
+
import{j as t}from"./liveblocks-evjZPqs_.js";import i from"./NotFoundScreen-DmxmtGfC.js";import{T as r}from"./TransactionDetailScreen-B7KMTXiT.js";import"./sentry-CCZGmBkl.js";import{o as s,p as o}from"./core-DmAftQ4g.js";import"./zeni-epic-state-vtQ66nN6.js";import"./recharts-CgEqsrFw.js";import"./index-BsmcHa9A.js";import"./mui-PcDpEhsm.js";import"./analytics-DCrhd8oB.js";import"./plaid-DSnXUEUK.js";import"./dnd-3F1D24DQ.js";import"./stripe-DMRn4zHo.js";import"./lottie-CmTLY-9t.js";import"./lexical-PVlNGkpS.js";import"./pdf-CbXlPYUs.js";import"./utils--mWNe9J7.js";import"./useAskAiCfoHostNavButtonProps-5Ek-t3F9.js";import"./decodeURIComponentSafe-C70tsXnj.js";import"./routePaths-ieN8hn7m.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-DUZV5JDK.js → TransactionDetailScreen-B7KMTXiT.js}
RENAMED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{j as x}from"./liveblocks-evjZPqs_.js";import{a as i}from"./sentry-CCZGmBkl.js";import{u as W,k as Ke,j as S,s as fe,g as ge,h as Te,i as Ee,N as Ze,n as Qe}from"./core-DmAftQ4g.js";import{nM as he,eW as Z,gn as Xe,Od as et,mZ as tt,mH as at,bn as nt,cT as be,bs as Ie,r8 as q,Nc as H,Oe as ve,Of as oe,NC as De,kG as Ce,Og as ke,NH as se,NI as ce,lv as Ae,K7 as ie,N6 as M,kA as Oe,ky as Ue,kK as ot,nz as st,Oh as ct,Oi as it,vl as K,kF as xe,Js as _e,cY as rt,cZ as lt,Oj as dt,N5 as ut,Ok as mt,vh as pt,Ol as ft,Om as ht,On as yt,Oo as St,Op as gt,kJ as Tt,Oq as Et,Or as bt,N7 as It,Os as vt,Ot as Dt,Ou as Ct,Jm as kt,Jc as At,JB as Ot,kL as Ut,K8 as ye,nE as xt}from"./zeni-epic-state-vtQ66nN6.js";import{W as J,U as _,z as we,aQ as Pe,m as _t,Z as wt,aR as Pt,y as Ft,p as ae,I as Vt,aS as Nt,q as ne,_ as Bt,aT as Rt,c as Fe,aU as zt,au as Lt,a2 as te}from"./index-
|
|
1
|
+
import{j as x}from"./liveblocks-evjZPqs_.js";import{a as i}from"./sentry-CCZGmBkl.js";import{u as W,k as Ke,j as S,s as fe,g as ge,h as Te,i as Ee,N as Ze,n as Qe}from"./core-DmAftQ4g.js";import{nM as he,eW as Z,gn as Xe,Od as et,mZ as tt,mH as at,bn as nt,cT as be,bs as Ie,r8 as q,Nc as H,Oe as ve,Of as oe,NC as De,kG as Ce,Og as ke,NH as se,NI as ce,lv as Ae,K7 as ie,N6 as M,kA as Oe,ky as Ue,kK as ot,nz as st,Oh as ct,Oi as it,vl as K,kF as xe,Js as _e,cY as rt,cZ as lt,Oj as dt,N5 as ut,Ok as mt,vh as pt,Ol as ft,Om as ht,On as yt,Oo as St,Op as gt,kJ as Tt,Oq as Et,Or as bt,N7 as It,Os as vt,Ot as Dt,Ou as Ct,Jm as kt,Jc as At,JB as Ot,kL as Ut,K8 as ye,nE as xt}from"./zeni-epic-state-vtQ66nN6.js";import{W as J,U as _,z as we,aQ as Pe,m as _t,Z as wt,aR as Pt,y as Ft,p as ae,I as Vt,aS as Nt,q as ne,_ as Bt,aT as Rt,c as Fe,aU as zt,au as Lt,a2 as te}from"./index-BsmcHa9A.js";import{n as Gt,S as jt,D as $t}from"./mui-PcDpEhsm.js";import{u as Mt}from"./useAskAiCfoHostNavButtonProps-5Ek-t3F9.js";import{d as Ve}from"./decodeURIComponentSafe-C70tsXnj.js";import{h as Ne,c as Be,g as Wt,e as qt}from"./routePaths-ieN8hn7m.js";import{u as Ht}from"./utils--mWNe9J7.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]="e5ba4b05-2229-4ad5-ac37-01039611dc53",t._sentryDebugIdIdentifier="sentry-dbid-e5ba4b05-2229-4ad5-ac37-01039611dc53")}catch{}})();function Jt(t=!0){const e=W(),s=Ke(),{useFeatureGate:a}=J(),{isFeatureEnabled:n}=a(_.isCreateTransferEntryFromExpenseEnabled);i.useEffect(()=>{if(!t||n!==!0)return;const o=c=>{const r=s.getState().createTransferEntryState.transferAccountsByType[c].fetchState;return r!=="In-Progress"&&r!=="Completed"};o("transferEntryEligible")&&e(he({kind:"transferEntryEligible"})),o("creditCardOnlyEligible")&&e(he({kind:"creditCardOnlyEligible"}))},[t,n,e,s])}function Yt(t,e){const s=function(){const r=W(),[p,g]=i.useState(!1),[A,y]=i.useState(null),[m,O]=i.useState(null),{useDynamicConfig:T}=J(),{configValue:f,isDynamicConfigLoading:C}=T("transaction_categorization_config"),v=!C&&f?.capitalization_enabled===!0,k=S(h=>Z(h)),E=k.companyId,U=S(h=>Xe(h.companyState,k.companyId)?.company.companyLocaleInfo?.currencySymbol??"$"),{capitalizableAccounts:w,capitalizableAccountOverrides:N,dismissedAccounts:L}=S(h=>{const b=h.tenantState.currentTenantId,u=b!=null?h.tenantState.tenantsById[b]:void 0;return{capitalizableAccounts:u?.capitalizableAccounts??null,capitalizableAccountOverrides:u?.capitalizableAccountOverrides??null,dismissedAccounts:u?.capitalizationOnboardingDismissedAccounts??null}},fe),G=i.useRef(w);G.current=w;const B=i.useRef(N);B.current=N;const P=i.useRef(L);P.current=L;const R=S(h=>et(h.accountState),fe),I=i.useMemo(()=>{const h={};for(const b of R)b.accountId!=null&&b.accountName!=null&&(h[b.accountId]=b.accountName);return h},[R]),l=m!=null?I[m]??null:null,j=i.useCallback(h=>{if(!v)return;const b=G.current;if(b==null)return;const u=b.accounts??[],$=new Set(h),Q=B.current??{},Y=P.current;for(const z of u)if($.has(z.accountId)&&Q[z.accountId]==null&&Y?.[z.accountId]==null)return y(z.classificationType),O(z.accountId),void g(!0)},[v]),D=i.useCallback((h,b)=>{r(tt(E,h,b,!0)),g(!1),y(null),O(null)},[r,E]),F=i.useCallback(()=>{m!=null&&(r(at(E,m)),g(!1),y(null),O(null))},[r,E,m]);return{showPopup:p&&v,popupType:A,popupAccountId:m,popupAccountName:l,currencySymbol:U,checkAndShowPopup:j,handleSubmit:D,handleDismiss:F}}(),a=i.useRef(void 0),n=i.useRef([]),o=i.useRef(s.checkAndShowPopup);o.current=s.checkAndShowPopup;const c=i.useRef(e);return c.current=e,i.useEffect(()=>{t==="In-Progress"&&(n.current=c.current()),t==="Completed"&&a.current==="In-Progress"&&n.current.length>0&&(o.current(n.current),n.current=[]),a.current=t},[t]),s}const re=()=>{const t=we.getSignedInUser(),{useFeatureGate:e}=J(),{isFeatureEnabled:s}=e(_.isChainOfThoughtEnabled);return i.useMemo(()=>nt(t)&&s,[t,s])};function Re(t){if(t!=null){if("customer"in t&&t.customer!=null){const{customer:e}=t;return{id:e.id,name:e.name,logo:e.logo,type:"customer",zeniId:e.id,qboId:e.id}}if("vendor"in t&&t.vendor!=null){const{vendor:e}=t;return{id:e.id,name:e.name,logo:e.logo,type:"vendor",zeniId:e.id,qboId:e.id}}}}function ha(t,e){const s=W(),{useFeatureGate:a,useDynamicConfig:n}=J(),o=S(u=>Z(u)),c=o.userRole.includes("charge_card_user")||o.userRole.includes("charge_card_admin"),r=o.userRole!=null&&be(o.userRole),p=o.userRole!=null&&Ie(o.userRole),{isFeatureEnabled:g}=a(_.isVendorBulkUpdateOnTransactionEnabled),{isFeatureEnabled:A}=a(_.isExpenseAutomationEnabled),{configValue:y}=n(Pe.enableUncategorizedExpenseCategory),m=y?.uncategorized_expense_category_enabled===!0,O=re(),T=i.useMemo(()=>({id:t,type:q(e)}),[t,e]),f=S(u=>H(u,T)),C=f?.transactionDetailUpdateStatus?.fetchState,v=f?.transactionDetailLocalData?.lineItemById,k=S(u=>{const $=H(u,T)?.transactionDetailLocalData.vendorUpdates?.id;return $==null?"Not-Started":u.transactionVendorViewState.editVendorStateById[$]?.saveStatus.fetchState??"Not-Started"}),E=i.useMemo(()=>f?.fetchState==="Completed"?Re(f?.transaction):void 0,[f?.fetchState,f?.transaction]),U=S(u=>{if(E!=null)return ve(u.customerIncomeState,u.vendorExpenseState,u.trendState,E,"month")}),w=S(u=>oe(u)),N=S(u=>{if(E!=null)return De(u.trendWithTransactionsState,E,"TransactionDetail")}),L=o.company?.companyInfo.firstMonthOfFY??1,G=S(u=>Ce(u.accountState,u.accountListState,"accountList")),[B,P]=i.useState(!1),[R,I]=i.useState(!1),[l,j]=i.useState(!1);i.useEffect(()=>{P(!1),I(!1),j(!1)},[t,e]);const D=i.useCallback(()=>{P(!1),I(!1)},[]),[F,h]=i.useState(!1),b=N?.selectedPeriod?.timePeriod;return i.useEffect(()=>{l||f==null||f.transaction==null||(s(ke({id:f.transaction.id,type:f.transaction.type})),j(!0)),E!=null&&(!c||r&&p===!1)&&(B?R||U==null||(I(!0),s(ie(E,"TransactionDetail",{timeframe:"month",timePeriod:b??U}))):(s(se()),s(ce()),P(!0),s(Ae(E))))},[s,l,f?.fetchState,f?.transaction,E,c,r,p,B,R,U,b]),i.useEffect(()=>{w.newVendorState?.vendorDetailLocalData?.vendorName!=null?h(!0):h(!1)},[w.newVendorState?.vendorDetailLocalData?.vendorName]),i.useEffect(()=>()=>{s(M("common"))},[s]),{currentTenant:o,loggedInUserHasCardUserOrAdminRole:c,isUserHasDashboardAccess:r,isUserHasInvestorOrBankerAccess:p,isVendorBulkUpdateOnTransactionEnabled:g,isExpenseAutomationEnabled:A,isUncategorizedExpenseCategoryEnabled:m,isChainOfThoughtEnabled:O,selectedTransaction:T,transactionDetail:f,rawDetailSaveStatus:C,rawDetailLineItemById:v,vendorSaveStatus:k,tranEntity:E,defaultTrendTransactionTimePeriod:U,vendorViewDetails:w,uiState:N,firstMonthOfFY:L,uncategorizedAccounts:G,resetTrendIsFetchedStates:D,isCreateVendorDrawerOpen:F,setIsCreateVendorDrawerOpen:h}}const Kt={overlayWidth:new Ft(100,100,58)},Zt=({isOpen:t,onSaveVendor:e,onSaveSuccess:s,onCancel:a,vendorViewDetails:n})=>{const o=_t(),c=wt(),r=W(),p=S(y=>oe(y)),g=()=>{a()},A={vendorDetailView:n??p,onSaveSuccess:()=>{r(Ue()),r(ot("Not-Started")),s()},onSaveVendor:e,onCancelClick:g,saveVendorDetailLocalData:y=>{r(Oe({vendorId:void 0,localData:y}))}};return x.jsx($t,{anchor:"right",open:t,PaperProps:{style:{width:Kt.overlayWidth.valuePercentage(c),boxShadow:"none"}},slotProps:{backdrop:{style:{backgroundColor:o.colors.black,opacity:.4,cursor:"pointer"}}},onClose:g,children:x.jsx(Qt,{onClick:y=>y.stopPropagation(),children:x.jsx(Pt,{...A})})})},Qt=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-evjZPqs_.js";import{h as H,g as U,u as K,i as Q,j as h,N as z,n as Z,o as ve,p as j}from"./core-DmAftQ4g.js";import{eW as W,qP as X,jU as u,RD as ee,J_ as De,bo as le,RE as Pe,kv as te,NE as ae,RF as ue,RG as Ee,bE as Y,JW as ye,RH as be,RI as me,RJ as je,JZ as Ae,RK as xe,RL as pe,RM as Me,RN as ge,RO as Le,RP as Ce,RQ as fe,La as Be}from"./zeni-epic-state-vtQ66nN6.js";import{O as de,W as ne,U as q,c as G,co as ce,q as N,p as oe,X as Fe,n as Oe}from"./index-DsVH62ZK.js";import"./mui-PcDpEhsm.js";import{a as g}from"./sentry-CCZGmBkl.js";import{w as se}from"./withTransactionSidePanel-iGXE6khP.js";import{p as ie,c as re}from"./routePaths-Dq5U7lhs.js";import{v as Re}from"./utils--mWNe9J7.js";import{d as P}from"./decodeURIComponentSafe-C70tsXnj.js";import{Z as Ge}from"./ZeniAccountStatementScreen-CU5lpB3Y.js";import"./recharts-CgEqsrFw.js";import"./analytics-DCrhd8oB.js";import"./plaid-DSnXUEUK.js";import"./dnd-3F1D24DQ.js";import"./stripe-DMRn4zHo.js";import"./lottie-CmTLY-9t.js";import"./lexical-PVlNGkpS.js";import"./pdf-CbXlPYUs.js";import"./useAskAiCfoHostNavButtonProps-uVGdd0zj.js";import"./TransactionDetailScreen-DUZV5JDK.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]="c90fccca-ddf9-419f-aa4e-64ab570f00e0",a._sentryDebugIdIdentifier="sentry-dbid-c90fccca-ddf9-419f-aa4e-64ab570f00e0")}catch{}})();const ze=["uncategorized-income","uncategorized-expense","miscategorized-income","miscategorized-expense","missing-receipts"],V=a=>Re(a),we=Z(function(a,e){const t=Pe(a.transactionState,a.transactionListState,e.selectedAccount.period,e.selectedAccount.timeframe,V(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=V(e.selectedAccount.tranListType),m=Je(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:V(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=N(e.location.state?.pathnameStackToGoBack,e.location.pathname);e.navigate(n,{state:{pathnameStackToGoBack:c}})},onTransactionListScroll:t=>{a(ue({uiState:{scrollYOffset:t},type:V(e.selectedAccount.tranListType)}))}}})(ce),J=se(function({...a}){const e=H(),t=U(),n=K(),c=t.pathname.split("/").find(r=>ze.includes(r)),o=c??"uncategorized-expense",{tenantEmailDomain:l}=Q(),m=de.getLocalizedStrings(),{accountType:S,title:T,subTitle:D}=_e(o),y="month",I=h(r=>W(r)),p=I.company?.companyInfo.firstMonthOfFY??1,{useFeatureGate:A}=ne(),{isFeatureEnabled:k}=A(q.isProjectsTransactionsEnabled),x=h(r=>X(r))&&k,{dataAvailable:C,initialTimeframeTick:E}=$e(o,p,I.bookCloseDate),[B,b]=g.useState(!1),[F,O]=g.useState(void 0),f=g.useMemo(()=>{const r=u(E);return{tranListType:o,accountType:ee(S),title:T,subTitle:D,timeframe:y,period:r}},[o,y,S,C]);g.useEffect(()=>{if(!B&&f!=null){b(!0),G.trackTransactionList(void 0,void 0,void 0,f.title);const r=V(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}}},Je=(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},Ve=Z(function(a,e){const t=be(a.transactionState,a.transactionListState,e.selectedAccount.accountId,e.selectedAccount.accountType,e.selectedAccount.classId,e.selectedAccount.timeframe,e.selectedAccount.period);return{accountId:e.selectedAccount.accountId,accountType:e.selectedAccount.accountType,title:e.selectedAccount.title,timeframe:e.selectedAccount.timeframe,timePeriod: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=N(e.location.state?.pathnameStackToGoBack,e.location.pathname);e.navigate(n,{state:{pathnameStackToGoBack:c}})},onTransactionListScroll:t=>{a(me({accountId:e.selectedAccount.accountId,accountType:e.selectedAccount.accountType,classId:e.selectedAccount.classId,uiState:{scrollYOffset:t}}))}}})(ce),qe=se(function({referrerType:a,...e}){const t=H(),n=U(),c=K(),{tenantEmailDomain:o,accountTypeEncoded:l,accountIdEncoded:m,classIdEncoded:S,timeframe:T,startDate:D,endDate:y,titleEncoded:I}=Q(),p=P(l??""),A=P(m??""),k=P(S??""),x=P(I??""),C=h(d=>Ee(d.transactionListState,A,p,k)),[E,B]=g.useState(!1),[b,F]=g.useState(void 0),O=h(d=>W(d)),f=O.company?.companyInfo.firstMonthOfFY??1,{useFeatureGate:M}=ne(),{isFeatureEnabled:r}=M(q.isProjectsTransactionsEnabled),w=h(d=>X(d))&&r;let i;const R=Ne(p,A,k,T,D,y,x);if(R){const d={startDate:Y(D,"YYYY-MM-DD"),endDate:Y(y,"YYYY-MM-DD")},_=Ue(C?.dateRange,d);i={accountId:A,accountType:ee(p),classId:k,title:x,timeframe:T,period:_}}g.useEffect(()=>{E||i==null||(B(!0),G.trackTransactionList(i.accountId,void 0,a,i.title),c(ye(i.accountId,i.accountType,i.classId,i.period)))},[E,i,c]);let L=i;i!=null&&b!=null&&(L={...i,period:b});const $=[l,m,S,T,D,y,I].filter(d=>d!=null);return R&&L!=null?s.jsx(Ve,{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},Ne=(a,e,t,n,c,o,l)=>a!=null&&e!=null&&t!=null&&n!=null&&c!=null&&o!=null&&(n==="month"||n==="quarter")&&Y(c,"YYYY-MM-DD").isValid()&&Y(o,"YYYY-MM-DD").isValid()&&l!=null,Ue=(a,e)=>a!=null&&a.endDate.isSame(e.endDate,"day")&&a.startDate.isBefore(e.startDate,"day")?u(a):u(e),We=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=N(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),He=se(function({referrerType:a,...e}){const t=H(),n=U(),c=K(),{tenantEmailDomain:o,accountTypeEncoded:l,accountIdEncoded:m,projectIdEncoded:S,timeframe:T,startDate:D,endDate:y,titleEncoded:I}=Q(),p=P(l??""),A=P(m??""),k=P(S??""),x=P(I??""),C=h(d=>je(d.transactionListState,A,p,k)),[E,B]=g.useState(!1),[b,F]=g.useState(void 0),O=h(d=>W(d)),f=O.company?.companyInfo.firstMonthOfFY??1,{useFeatureGate:M}=ne(),{isFeatureEnabled:r}=M(q.isProjectsTransactionsEnabled),w=h(d=>X(d))&&r;let i;const R=Ke(p,A,k,T,D,y,x);if(R){const d={startDate:Y(D,"YYYY-MM-DD"),endDate:Y(y,"YYYY-MM-DD")},_=Qe(C?.dateRange,d);i={accountId:A,accountType:ee(p),projectId:k,title:x,timeframe:T,period:_}}g.useEffect(()=>{E||i==null||(B(!0),G.trackTransactionList(i.accountId,void 0,a,i.title),c(Ae(i.accountId,i.accountType,i.projectId,i.period)))},[E,i,c]);let L=i;i!=null&&b!=null&&(L={...i,period:b});const $=[l,m,S,T,D,y,I].filter(d=>d!=null);return R&&L!=null?s.jsx(We,{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},Ke=(a,e,t,n,c,o,l)=>a!=null&&e!=null&&t!=null&&n!=null&&c!=null&&o!=null&&(n==="month"||n==="quarter")&&Y(c,"YYYY-MM-DD").isValid()&&Y(o,"YYYY-MM-DD").isValid()&&l!=null,Qe=(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=N(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=N(e.location.state?.pathnameStackToGoBack,e.location.pathname);e.navigate(t,{state:{pathnameStackToGoBack:n}})}}})(ce),Te=se(function({referrerType:a,...e}){const t=H(),n=U(),c=K(),{tenantEmailDomain:o,accountTypeEncoded:l,accountIdEncoded:m,timeframe:S,startDate:T,endDate:D,titleEncoded:y,excludeSubAccounts:I}=Q(),p=P(l??""),A=P(m??""),k=P(y??""),x=!(I!=null&&I==="exclude_subaccounts"),C=h(v=>Me(v.transactionListState,A,p)),[E,B]=g.useState(!1),[b,F]=g.useState(void 0),O=h(v=>W(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&&b!=null&&(i={...r,period:b});const{useFeatureGate:R}=ne(),{isFeatureEnabled:L}=R(q.isTransactionCommentingEnabled),{isFeatureEnabled:$}=R(q.isProjectsTransactionsEnabled),d=h(v=>X(v))&&$,{areTenantIdsInSync:_}=Fe();g.useEffect(()=>{!E&&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)))},[E,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=U().state?.referrer,e=h(n=>n.expenseAutomationViewState.selectedPeriodByTenantId)[h(n=>W(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(J,{})}),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(J,{})}),s.jsx(j,{path:"/miscategorized-income/*",element:s.jsx(J,{})}),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(J,{})}),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(J,{})}),s.jsx(j,{path:"/by-class/:accountTypeEncoded/:accountIdEncoded/:classIdEncoded/:timeframe/:startDate/:endDate/:titleEncoded/*",element:s.jsx(qe,{referrerType:a})}),s.jsx(j,{path:"/by-project/:accountTypeEncoded/:accountIdEncoded/:projectIdEncoded/:timeframe/:startDate/:endDate/:titleEncoded/*",element:s.jsx(He,{referrerType:a})})]})}export{kt as default};
|
|
1
|
+
import{j as s}from"./liveblocks-evjZPqs_.js";import{h as H,g as U,u as K,i as Q,j as h,N as z,n as Z,o as ve,p as j}from"./core-DmAftQ4g.js";import{eW as W,qP as X,jU as u,RD as ee,J_ as De,bo as le,RE as Pe,kv as te,NE as ae,RF as ue,RG as Ee,bE as Y,JW as ye,RH as be,RI as me,RJ as je,JZ as Ae,RK as xe,RL as pe,RM as Me,RN as ge,RO as Le,RP as Ce,RQ as fe,La as Be}from"./zeni-epic-state-vtQ66nN6.js";import{O as de,W as ne,U as q,c as G,co as ce,q as N,p as oe,X as Fe,n as Oe}from"./index-BsmcHa9A.js";import"./mui-PcDpEhsm.js";import{a as g}from"./sentry-CCZGmBkl.js";import{w as se}from"./withTransactionSidePanel-C15NQsNY.js";import{p as ie,c as re}from"./routePaths-ieN8hn7m.js";import{v as Re}from"./utils--mWNe9J7.js";import{d as P}from"./decodeURIComponentSafe-C70tsXnj.js";import{Z as Ge}from"./ZeniAccountStatementScreen-BqtUjZCP.js";import"./recharts-CgEqsrFw.js";import"./analytics-DCrhd8oB.js";import"./plaid-DSnXUEUK.js";import"./dnd-3F1D24DQ.js";import"./stripe-DMRn4zHo.js";import"./lottie-CmTLY-9t.js";import"./lexical-PVlNGkpS.js";import"./pdf-CbXlPYUs.js";import"./useAskAiCfoHostNavButtonProps-5Ek-t3F9.js";import"./TransactionDetailScreen-B7KMTXiT.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]="c90fccca-ddf9-419f-aa4e-64ab570f00e0",a._sentryDebugIdIdentifier="sentry-dbid-c90fccca-ddf9-419f-aa4e-64ab570f00e0")}catch{}})();const ze=["uncategorized-income","uncategorized-expense","miscategorized-income","miscategorized-expense","missing-receipts"],V=a=>Re(a),we=Z(function(a,e){const t=Pe(a.transactionState,a.transactionListState,e.selectedAccount.period,e.selectedAccount.timeframe,V(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=V(e.selectedAccount.tranListType),m=Je(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:V(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=N(e.location.state?.pathnameStackToGoBack,e.location.pathname);e.navigate(n,{state:{pathnameStackToGoBack:c}})},onTransactionListScroll:t=>{a(ue({uiState:{scrollYOffset:t},type:V(e.selectedAccount.tranListType)}))}}})(ce),J=se(function({...a}){const e=H(),t=U(),n=K(),c=t.pathname.split("/").find(r=>ze.includes(r)),o=c??"uncategorized-expense",{tenantEmailDomain:l}=Q(),m=de.getLocalizedStrings(),{accountType:S,title:T,subTitle:D}=_e(o),y="month",I=h(r=>W(r)),p=I.company?.companyInfo.firstMonthOfFY??1,{useFeatureGate:A}=ne(),{isFeatureEnabled:k}=A(q.isProjectsTransactionsEnabled),x=h(r=>X(r))&&k,{dataAvailable:C,initialTimeframeTick:E}=$e(o,p,I.bookCloseDate),[B,b]=g.useState(!1),[F,O]=g.useState(void 0),f=g.useMemo(()=>{const r=u(E);return{tranListType:o,accountType:ee(S),title:T,subTitle:D,timeframe:y,period:r}},[o,y,S,C]);g.useEffect(()=>{if(!B&&f!=null){b(!0),G.trackTransactionList(void 0,void 0,void 0,f.title);const r=V(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}}},Je=(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},Ve=Z(function(a,e){const t=be(a.transactionState,a.transactionListState,e.selectedAccount.accountId,e.selectedAccount.accountType,e.selectedAccount.classId,e.selectedAccount.timeframe,e.selectedAccount.period);return{accountId:e.selectedAccount.accountId,accountType:e.selectedAccount.accountType,title:e.selectedAccount.title,timeframe:e.selectedAccount.timeframe,timePeriod: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=N(e.location.state?.pathnameStackToGoBack,e.location.pathname);e.navigate(n,{state:{pathnameStackToGoBack:c}})},onTransactionListScroll:t=>{a(me({accountId:e.selectedAccount.accountId,accountType:e.selectedAccount.accountType,classId:e.selectedAccount.classId,uiState:{scrollYOffset:t}}))}}})(ce),qe=se(function({referrerType:a,...e}){const t=H(),n=U(),c=K(),{tenantEmailDomain:o,accountTypeEncoded:l,accountIdEncoded:m,classIdEncoded:S,timeframe:T,startDate:D,endDate:y,titleEncoded:I}=Q(),p=P(l??""),A=P(m??""),k=P(S??""),x=P(I??""),C=h(d=>Ee(d.transactionListState,A,p,k)),[E,B]=g.useState(!1),[b,F]=g.useState(void 0),O=h(d=>W(d)),f=O.company?.companyInfo.firstMonthOfFY??1,{useFeatureGate:M}=ne(),{isFeatureEnabled:r}=M(q.isProjectsTransactionsEnabled),w=h(d=>X(d))&&r;let i;const R=Ne(p,A,k,T,D,y,x);if(R){const d={startDate:Y(D,"YYYY-MM-DD"),endDate:Y(y,"YYYY-MM-DD")},_=Ue(C?.dateRange,d);i={accountId:A,accountType:ee(p),classId:k,title:x,timeframe:T,period:_}}g.useEffect(()=>{E||i==null||(B(!0),G.trackTransactionList(i.accountId,void 0,a,i.title),c(ye(i.accountId,i.accountType,i.classId,i.period)))},[E,i,c]);let L=i;i!=null&&b!=null&&(L={...i,period:b});const $=[l,m,S,T,D,y,I].filter(d=>d!=null);return R&&L!=null?s.jsx(Ve,{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},Ne=(a,e,t,n,c,o,l)=>a!=null&&e!=null&&t!=null&&n!=null&&c!=null&&o!=null&&(n==="month"||n==="quarter")&&Y(c,"YYYY-MM-DD").isValid()&&Y(o,"YYYY-MM-DD").isValid()&&l!=null,Ue=(a,e)=>a!=null&&a.endDate.isSame(e.endDate,"day")&&a.startDate.isBefore(e.startDate,"day")?u(a):u(e),We=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=N(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),He=se(function({referrerType:a,...e}){const t=H(),n=U(),c=K(),{tenantEmailDomain:o,accountTypeEncoded:l,accountIdEncoded:m,projectIdEncoded:S,timeframe:T,startDate:D,endDate:y,titleEncoded:I}=Q(),p=P(l??""),A=P(m??""),k=P(S??""),x=P(I??""),C=h(d=>je(d.transactionListState,A,p,k)),[E,B]=g.useState(!1),[b,F]=g.useState(void 0),O=h(d=>W(d)),f=O.company?.companyInfo.firstMonthOfFY??1,{useFeatureGate:M}=ne(),{isFeatureEnabled:r}=M(q.isProjectsTransactionsEnabled),w=h(d=>X(d))&&r;let i;const R=Ke(p,A,k,T,D,y,x);if(R){const d={startDate:Y(D,"YYYY-MM-DD"),endDate:Y(y,"YYYY-MM-DD")},_=Qe(C?.dateRange,d);i={accountId:A,accountType:ee(p),projectId:k,title:x,timeframe:T,period:_}}g.useEffect(()=>{E||i==null||(B(!0),G.trackTransactionList(i.accountId,void 0,a,i.title),c(Ae(i.accountId,i.accountType,i.projectId,i.period)))},[E,i,c]);let L=i;i!=null&&b!=null&&(L={...i,period:b});const $=[l,m,S,T,D,y,I].filter(d=>d!=null);return R&&L!=null?s.jsx(We,{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},Ke=(a,e,t,n,c,o,l)=>a!=null&&e!=null&&t!=null&&n!=null&&c!=null&&o!=null&&(n==="month"||n==="quarter")&&Y(c,"YYYY-MM-DD").isValid()&&Y(o,"YYYY-MM-DD").isValid()&&l!=null,Qe=(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=N(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=N(e.location.state?.pathnameStackToGoBack,e.location.pathname);e.navigate(t,{state:{pathnameStackToGoBack:n}})}}})(ce),Te=se(function({referrerType:a,...e}){const t=H(),n=U(),c=K(),{tenantEmailDomain:o,accountTypeEncoded:l,accountIdEncoded:m,timeframe:S,startDate:T,endDate:D,titleEncoded:y,excludeSubAccounts:I}=Q(),p=P(l??""),A=P(m??""),k=P(y??""),x=!(I!=null&&I==="exclude_subaccounts"),C=h(v=>Me(v.transactionListState,A,p)),[E,B]=g.useState(!1),[b,F]=g.useState(void 0),O=h(v=>W(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&&b!=null&&(i={...r,period:b});const{useFeatureGate:R}=ne(),{isFeatureEnabled:L}=R(q.isTransactionCommentingEnabled),{isFeatureEnabled:$}=R(q.isProjectsTransactionsEnabled),d=h(v=>X(v))&&$,{areTenantIdsInSync:_}=Fe();g.useEffect(()=>{!E&&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)))},[E,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=U().state?.referrer,e=h(n=>n.expenseAutomationViewState.selectedPeriodByTenantId)[h(n=>W(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(J,{})}),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(J,{})}),s.jsx(j,{path:"/miscategorized-income/*",element:s.jsx(J,{})}),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(J,{})}),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(J,{})}),s.jsx(j,{path:"/by-class/:accountTypeEncoded/:accountIdEncoded/:classIdEncoded/:timeframe/:startDate/:endDate/:titleEncoded/*",element:s.jsx(qe,{referrerType:a})}),s.jsx(j,{path:"/by-project/:accountTypeEncoded/:accountIdEncoded/:projectIdEncoded/:timeframe/:startDate/:endDate/:titleEncoded/*",element:s.jsx(He,{referrerType:a})})]})}export{kt as default};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{j as e}from"./liveblocks-evjZPqs_.js";import{h as U,g as L,u as P,i as O,j as y,N as B,n as N,o as we,p as k}from"./core-DmAftQ4g.js";import{cp as G,eW as D,Qm as R,Gl as ae,fU as q,G3 as ne,Qo as Ie,Go as ke,Qk as be,Ql as se,QB as je,Es as Ae,u9 as Ee,Qq as ve,GH as De,Qn as re,cS as H,yo as oe,fz as Fe,fB as Be,RA as Ue,RB as Le,G4 as Pe,RC as Re,G5 as Me,Ge as Ve,bs as Oe,bJ as Ne,cA as Ge,bK as _e,co as ze,fT as $e,bt as Qe,LV as qe,cn as He}from"./zeni-epic-state-vtQ66nN6.js";import{I as _,ar as We,z as A,x as z,c as b,ch as Ze,ci as Ke,cj as Q,Z as W,m as Je,X as Xe,_ as Ye,W as ie,U as E,y as et,B as tt,ck as at,au as Z,q as nt,cl as st,p as K,cm as rt,D as X,cn as ot,a9 as it}from"./index-
|
|
1
|
+
import{j as e}from"./liveblocks-evjZPqs_.js";import{h as U,g as L,u as P,i as O,j as y,N as B,n as N,o as we,p as k}from"./core-DmAftQ4g.js";import{cp as G,eW as D,Qm as R,Gl as ae,fU as q,G3 as ne,Qo as Ie,Go as ke,Qk as be,Ql as se,QB as je,Es as Ae,u9 as Ee,Qq as ve,GH as De,Qn as re,cS as H,yo as oe,fz as Fe,fB as Be,RA as Ue,RB as Le,G4 as Pe,RC as Re,G5 as Me,Ge as Ve,bs as Oe,bJ as Ne,cA as Ge,bK as _e,co as ze,fT as $e,bt as Qe,LV as qe,cn as He}from"./zeni-epic-state-vtQ66nN6.js";import{I as _,ar as We,z as A,x as z,c as b,ch as Ze,ci as Ke,cj as Q,Z as W,m as Je,X as Xe,_ as Ye,W as ie,U as E,y as et,B as tt,ck as at,au as Z,q as nt,cl as st,p as K,cm as rt,D as X,cn as ot,a9 as it}from"./index-BsmcHa9A.js";import{D as ct,n as M,S as lt}from"./mui-PcDpEhsm.js";import ut from"./NotFoundScreen-DmxmtGfC.js";import{S as Y}from"./SetupPagesScreen-Pz567UQO.js";import{a as p}from"./sentry-CCZGmBkl.js";import{u as dt}from"./useAskAiCfoHostNavButtonProps-5Ek-t3F9.js";import{u as pt}from"./useInitialThreadRequest-Dr9FuJUY.js";import{u as mt}from"./useCashManagementBanner-B0ma2Yzx.js";import{M as ce}from"./MobileAppDrawer-cGG4tefr.js";import{F as ft}from"./FeaturePreviewScreen-CdQFs282.js";import{a as ee}from"./analyticsHelper-MomIUc09.js";import"./recharts-CgEqsrFw.js";import"./analytics-DCrhd8oB.js";import"./plaid-DSnXUEUK.js";import"./dnd-3F1D24DQ.js";import"./stripe-DMRn4zHo.js";import"./lottie-CmTLY-9t.js";import"./lexical-PVlNGkpS.js";import"./pdf-CbXlPYUs.js";import"./utils--mWNe9J7.js";import"./routePaths-ieN8hn7m.js";import"./BusinessVerificationPageScreen-BSOfMkHj.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]="51b6b362-e499-4ed1-b397-752d0bf2de02",t._sentryDebugIdIdentifier="sentry-dbid-51b6b362-e499-4ed1-b397-752d0bf2de02")}catch{}})();const yt=N(function(t,a){const{companyId:n}=a;return{treasurySetupView:R(t,n),analytics:b}},function(t,a){const{navigate:n,analytics:o,treasurySetupView:m}=a;return{onBackClick:()=>{n("../")},onNextClick:()=>{const s=m.fundAllocationLocalData;o.trackTreasuryPortfolioConfirm(s.riskScore,ee(s)),t(ke(!0))},onUpdateFundAllocation:s=>{o.trackTreasuryAllocationAction("update",ee(s)),t(Ie(s))}}})(Ze);function gt(){const t=U(),a=L(),n=P(),{tenantEmailDomain:o}=O(),m=_(),s=y(I=>I.treasurySetupViewState.portfolioAllocationUpdateStatus?.fetchState),f=We(s),r=G(m?.loggedInUserRoleMap),[l,i]=p.useState(!1),[u,T]=p.useState(!1),[d,c]=p.useState(!1),h=y(I=>D(I)),g=A.getSignedInUserTenant(o)?.companyId??h.companyId,C=A.getSignedInUser(),S=y(I=>R(I,g)),w=y(I=>I.treasurySetupViewState.fetchState),x=y(I=>I.treasurySetupViewState.currentAllocation.fetchStatus?.fetchState),F=y(I=>I.treasurySetupViewState.treasuryFundsDetails?.fetchStatus?.fetchState);if(C==null)throw Error("Can't access treasury portfolio allocation page without signing in...");if(p.useEffect(()=>{l||w!=="Not-Started"||g==null||(i(!0),n(ae(g,!0,!1)))},[l,w,g,n]),p.useEffect(()=>{d||F!=="Not-Started"||g==null||(c(!0),n(q()))},[d,F,g,n]),p.useEffect(()=>{u||x!=="Not-Started"||g==null||(T(!0),n(ne()))},[u,x,g,n]),p.useEffect(()=>{f==="In-Progress"&&s==="Completed"&&t("../")},[f,s,t]),h.companyTreasuryInfo?.info?.isTreasuryTOSAccepted===!1)return e.jsx(B,{to:"../promo"});const v=h.companyTreasuryInfo?.info?.isTreasuryTOSAccepted!==!0||w!=="Completed";return e.jsxs(e.Fragment,{children:[!v&&e.jsx(z,{analytics:b,onLoad:()=>{}}),e.jsx(yt,{navigate:t,location:a,companyId:g,isEditMode:!0,isLoading:v,isReadOnly:!r,treasurySetupView:S,analytics:b})]})}const ht=N(function(t,a){const n=a.currentTenant?.companyId;return{plaidConnectionDetails:je(t,n,"zeni_treasury","treasury_setup").plaidConnectionDetails,treasurySetupView:R(t,n)}},function(t,a){const{navigate:n,transferDetails:o,treasurySetupView:m}=a,s=o.treasuryTransferMoneyLocalData,f=m.fundAllocationLocalData;return{onCancelClick:()=>{Q(a.analytics,"cancel",s,f,"Transfer"),t(se()),n("../")},onTransferClick:()=>{Q(a.analytics,"confirm",s,f,"Transfer"),t(De())},onSaveChangesToLocalStore:r=>{t(ve(r))},onFetchLinkTokenClick:r=>{t(Ee("treasury_setup",r))},onEstablishConnectionClick:r=>{t(Ae(r,a.currentTenant?.companyId,"treasury_setup","zeni_treasury"))}}})(Ke),St=({isFirstTransfer:t})=>{const a=U(),{tenantEmailDomain:n}=O(),o=P(),[m,s]=p.useState(!1),[f,r]=p.useState(!1),[l,i]=p.useState(!1),[u,T]=p.useState(!1),d=y(x=>x.treasurySetupViewState.fetchState),c=y(x=>x.treasurySetupViewState.treasuryFundsDetails?.fetchStatus?.fetchState),h=y(x=>x.treasurySetupViewState.currentAllocation.fetchStatus?.fetchState),g=y(x=>D(x)),C=A.getSignedInUserTenant(n)?.companyId??g.companyId,S=y(x=>be(x)),w=y(x=>R(x,C));if(A.getSignedInUser()==null)throw Error("Can't access treasury transfer page without signing in...");return p.useEffect(()=>{f||d!=="Not-Started"||C==null||(r(!0),o(ae(C,!0,!1)))},[f,d,C,o]),p.useEffect(()=>{l||c!=="Not-Started"||C==null||(i(!0),o(q()))},[l,c,C,o]),p.useEffect(()=>{u||h!=="Not-Started"||C==null||(T(!0),o(ne()))},[u,h,C,o]),e.jsxs(e.Fragment,{children:[e.jsx(z,{analytics:b,onLoad:()=>{}}),e.jsx(ht,{analytics:b,navigate:a,transferDetails:S,onAnotherTransferClick:()=>{s(!1),o(se())},currentTenant:g,treasurySetupView:w,showReviewContent:m,maxInsuredAmount:5e5,onReviewClick:()=>{Q(b,"review",S.treasuryTransferMoneyLocalData,w.fundAllocationLocalData,"Transfer"),s(!0)},isFirstTransfer:t,setShowReviewContent:s,onBackClick:()=>{}})]})},xt=M.div`
|
|
2
2
|
display: flex;
|
|
3
3
|
min-height: 100%;
|
|
4
4
|
width: 100%;
|