@zeniai/web-app-ui 5.0.62-qa → 5.0.63-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-BGixhU4F.js +1 -0
- package/dist/assets/AddressScreen-BCfbWbk_.js +9 -0
- package/dist/assets/{AiCfoScreen-C0vZP1YL.js → AiCfoScreen-NDN5qE_4.js} +2 -2
- package/dist/assets/BillPayApprovalRoutes-Cvl_sQRW.js +1 -0
- package/dist/assets/{BillPayRoutes-DORdSaXs.js → BillPayRoutes-D-I6yBtH.js} +33 -33
- package/dist/assets/BusinessVerificationPageScreen-C57FErKR.js +9 -0
- package/dist/assets/{ChargeCardRoutes-BHiPj32T.js → ChargeCardRoutes-DNNVmQba.js} +8 -8
- package/dist/assets/{CompanyPassportScreen-CP7xp86t.js → CompanyPassportScreen-D2jISk-U.js} +1 -1
- package/dist/assets/ConnectionAuthScreen-BUE9aXs1.js +11 -0
- package/dist/assets/CustomerOnboardingAuthScreen-BVuWNptI.js +1 -0
- package/dist/assets/{CustomerOnboardingRoutes-tQabyyPB.js → CustomerOnboardingRoutes-D-Ufd69Z.js} +7 -7
- package/dist/assets/{DashboardRoutes-Cnk-C3nT.js → DashboardRoutes-D1kbvPs7.js} +3 -3
- package/dist/assets/DefaultTenantHome-JkQ2goKW.js +1 -0
- package/dist/assets/DomesticWireDetailScreen-DTmfTwYq.js +18 -0
- package/dist/assets/DrawerScreen-DNHIo9Ek.js +1 -0
- package/dist/assets/EntityDetailRoutes-8YxmqISQ.js +1 -0
- package/dist/assets/{ExpenseAutomationRoutes-CkF5XxpD.js → ExpenseAutomationRoutes-DYuR5p-K.js} +4 -4
- package/dist/assets/FeaturePreviewScreen-Xv2JpkA8.js +1 -0
- package/dist/assets/MagicLinkRoutes-D_-f5EfR.js +72 -0
- package/dist/assets/MagicLinkSignInScreen-D8SWcZwO.js +12 -0
- package/dist/assets/MobileAppDrawer-CMz8hWRn.js +1 -0
- package/dist/assets/NotFoundScreen-CojoL2wq.js +1 -0
- package/dist/assets/{NotificationRoutes-YdO3fFDs.js → NotificationRoutes-DKuetMHQ.js} +1 -1
- package/dist/assets/PandLWithForecastRoutes-D4EEGjw5.js +1 -0
- package/dist/assets/PeopleRoutes-CR2pc_sW.js +22 -0
- package/dist/assets/PerformanceRoutes-cynXsyNj.js +1 -0
- package/dist/assets/{Preview-a01dgLdt.js → Preview-DdSrf9_j.js} +1 -1
- package/dist/assets/{QBOConnectionScreen-s3qwiSMy.js → QBOConnectionScreen-B1II2TpX.js} +1 -1
- package/dist/assets/ReferralListScreen-8R81rrOx.js +5 -0
- package/dist/assets/ReimbursementApprovalRoutes-BGrrVRS6.js +1 -0
- package/dist/assets/{ReimbursementApprovalRuleDetailScreen-BE4IHKZp.js → ReimbursementApprovalRuleDetailScreen-5oJldpZm.js} +1 -1
- package/dist/assets/{ReimbursementRoutes-ClJ2U4hB.js → ReimbursementRoutes-BH3HNrZk.js} +10 -10
- package/dist/assets/{ReportsRoutes-C5in9Uhw.js → ReportsRoutes-Dh0vOSd5.js} +1 -1
- package/dist/assets/RewardsRoutes-RRnzfk9s.js +1 -0
- package/dist/assets/ScreenRoutes-DOHIbDe4.js +2 -0
- package/dist/assets/{SettingsRoutes-CNhiCvwZ.js → SettingsRoutes-BJyRTm4m.js} +7 -7
- package/dist/assets/{SetupPagesScreen-kg92bsGG.js → SetupPagesScreen-BWmxAg5_.js} +5 -5
- package/dist/assets/{SignInScreen-BPEkTQq0.js → SignInScreen-B2_szOVQ.js} +1 -1
- package/dist/assets/SignOutScreen-BKysr8-j.js +9 -0
- package/dist/assets/TaskListScreen-DYCQWF7u.js +9 -0
- package/dist/assets/TaskRoutes-GImULClZ.js +9 -0
- package/dist/assets/TransactionDetailRoutes-Dv6VDhjQ.js +1 -0
- package/dist/assets/TransactionDetailScreen-ByHgtPQ5.js +5 -0
- package/dist/assets/{TransactionListRoutes-D5W7s2n8.js → TransactionListRoutes-Bo3hqgom.js} +1 -1
- package/dist/assets/{TreasuryRoutes-3vVOYpSk.js → TreasuryRoutes-VJBsZB_Q.js} +6 -6
- package/dist/assets/{VendorsRoutes-Ds-Ggg2o.js → VendorsRoutes-DafxPLzK.js} +15 -15
- package/dist/assets/WiseConfirmationScreen-CsrsS8Xt.js +12 -0
- package/dist/assets/{ZeniAccountRoutes-b1lH_04J.js → ZeniAccountRoutes-COMo322y.js} +12 -12
- package/dist/assets/ZeniAccountStatementScreen-B1lnm1eV.js +9 -0
- package/dist/assets/{accountMappingHelper-cyeg1rbm.js → accountMappingHelper-D6w4MCc5.js} +1 -1
- package/dist/assets/{analytics-6quGmcJ9.js → analytics-CQOsvcBG.js} +1 -1
- package/dist/assets/{analyticsHelper-DXgEF5Aw.js → analyticsHelper-CwPfLmD8.js} +1 -1
- package/dist/assets/{core-Bsrz_HO3.js → core-CGhI3jCZ.js} +1 -1
- package/dist/assets/{decodeURIComponentSafe-CO5SD6sS.js → decodeURIComponentSafe-CZEzMrgK.js} +1 -1
- package/dist/assets/{dnd-DQWt2Oqt.js → dnd-DKCsG5d8.js} +1 -1
- package/dist/assets/{empty-DkyZJno0.js → empty-BAfFi45J.js} +1 -1
- package/dist/assets/{empty-Jn9Yx-HD.js → empty-CzOjtD5w.js} +1 -1
- package/dist/assets/{emptyVideoElement-bn80pelP.js → emptyVideoElement-qqeUs6C2.js} +1 -1
- package/dist/assets/epic-CY0OxDpl.js +2 -0
- package/dist/assets/{getLocaleForTenant-DsTopByq.js → getLocaleForTenant-D8dvZJzp.js} +1 -1
- package/dist/assets/{index-BZoYXLsp.js → index-2FSYOFek.js} +1 -1
- package/dist/assets/{index-CwB6hQtw.js → index-BDBqjJWE.js} +1 -1
- package/dist/assets/{index-CYTNjdXt.js → index-BRtx8cu_.js} +1 -1
- package/dist/assets/{index-C8HyFXLI.js → index-Bio3vcCU.js} +2 -2
- package/dist/assets/{index-CD3Zb4OY.js → index-D7leYkuC.js} +16795 -15702
- package/dist/assets/{index-BLDAeN7R.js → index-DH8cVwcc.js} +1 -1
- package/dist/assets/{index-nqKyeDxx.js → index-DHmfzpvJ.js} +1 -1
- package/dist/assets/{lexical-BINeBAQD.js → lexical-DT64qE89.js} +1 -1
- package/dist/assets/{liveblocks-D_qjMTev.js → liveblocks-CzlYoB8q.js} +1 -1
- package/dist/assets/{lottie-DsuJTV9-.js → lottie-CLMz6y3A.js} +1 -1
- package/dist/assets/{mui-B-WzuEhL.js → mui-ILn-Gd-L.js} +1 -1
- package/dist/assets/{pathToGoBack-D3h6Q2dm.js → pathToGoBack-B-0xWAao.js} +1 -1
- package/dist/assets/{pdf-CvaAggXr.js → pdf-CUf9xopY.js} +4 -4
- package/dist/assets/{pdf-lib-BPIedIxZ.js → pdf-lib-CWTnCbuI.js} +1 -1
- package/dist/assets/{plaid-D8D4m-Yi.js → plaid-D8caW90M.js} +1 -1
- package/dist/assets/{pusher-Jerb5Wwf.js → pusher-ChRriP4_.js} +1 -1
- package/dist/assets/{react-BKhVWO-J.js → react-BAtU9tgF.js} +1 -1
- package/dist/assets/{react-BXhXAucy.js → react-DJjQrdjO.js} +1 -1
- package/dist/assets/{react-DSTDk7nG.js → react-DSJG23We.js} +1 -1
- package/dist/assets/{react-DM_-ScVY.js → react-Dncm-YTr.js} +1 -1
- package/dist/assets/{react-BFe6OMY5.js → react-DoaQNmh0.js} +1 -1
- package/dist/assets/{react-V_2FFnGc.js → react-DyH9BXY-.js} +1 -1
- package/dist/assets/{recharts-DLyOpEqk.js → recharts-D6qS-pdV.js} +1 -1
- package/dist/assets/{routePaths-guUFi6jP.js → routePaths-DhV05MHP.js} +1 -1
- package/dist/assets/{sentry-8G-PMI1Z.js → sentry-CNCwYM02.js} +1 -1
- package/dist/assets/{url-BJ82BmRR.js → url-CTEP03uL.js} +1 -1
- package/dist/assets/{url-lTh3vvoR.js → url-CWzi7k2i.js} +1 -1
- package/dist/assets/useAskAiCfoHostNavButtonProps-BYwM8iQc.js +1 -0
- package/dist/assets/{useDeviceId-BKsq__8n.js → useDeviceId-D_8GbJBB.js} +1 -1
- package/dist/assets/useFetchSuggestedQuestionsWhenReady-CLFroGaE.js +1 -0
- package/dist/assets/useInitialThreadRequest-XOr6mP2N.js +1 -0
- package/dist/assets/{utils-DwSP01dM.js → utils-zvjLmBW4.js} +1 -1
- package/dist/assets/{withTransactionSidePanel-DrkIOqqu.js → withTransactionSidePanel-caCfdZEh.js} +3 -3
- package/dist/assets/zeni-epic-state-lenVK-tm.js +14 -0
- package/dist/index.html +1 -1
- package/package.json +4 -4
- package/dist/assets/AddressRoutes-BudgT9Tf.js +0 -1
- package/dist/assets/AddressScreen-B5JiBops.js +0 -9
- package/dist/assets/BillPayApprovalRoutes-Fbfb_MBf.js +0 -1
- package/dist/assets/BusinessVerificationPageScreen-CkoxiZjG.js +0 -9
- package/dist/assets/ConnectionAuthScreen-DaPsQep3.js +0 -11
- package/dist/assets/CustomerOnboardingAuthScreen-CSMxvlH4.js +0 -1
- package/dist/assets/DefaultTenantHome-D8exSt4J.js +0 -1
- package/dist/assets/DomesticWireDetailScreen-BR6zHu9V.js +0 -18
- package/dist/assets/DrawerScreen-DcvAr7RJ.js +0 -1
- package/dist/assets/EntityDetailRoutes-DCALdQfe.js +0 -1
- package/dist/assets/FeaturePreviewScreen-zKBzcSjH.js +0 -1
- package/dist/assets/MagicLinkRoutes-BB2uPUFV.js +0 -72
- package/dist/assets/MagicLinkSignInScreen-BvUxN4tf.js +0 -12
- package/dist/assets/MobileAppDrawer-B1UAm8wT.js +0 -1
- package/dist/assets/NotFoundScreen-7pgsDHD4.js +0 -1
- package/dist/assets/PandLWithForecastRoutes-B0-5KdjK.js +0 -1
- package/dist/assets/PeopleRoutes-BY_yNFRo.js +0 -22
- package/dist/assets/PerformanceRoutes-UoHT4j_3.js +0 -1
- package/dist/assets/ReferralListScreen-CLtUXrj_.js +0 -5
- package/dist/assets/ReimbursementApprovalRoutes-2Qd6Uiuj.js +0 -1
- package/dist/assets/RewardsRoutes-BKLXLgos.js +0 -1
- package/dist/assets/ScreenRoutes-q1FJ4qn-.js +0 -2
- package/dist/assets/SignOutScreen-BGFD6mSx.js +0 -9
- package/dist/assets/TaskListScreen-rthYiQl-.js +0 -9
- package/dist/assets/TaskRoutes-CMnVLLkj.js +0 -9
- package/dist/assets/TransactionDetailRoutes-Dic273qP.js +0 -1
- package/dist/assets/TransactionDetailScreen-BUEQCRRD.js +0 -5
- package/dist/assets/WiseConfirmationScreen-Cmyjb9h-.js +0 -12
- package/dist/assets/ZeniAccountStatementScreen-C4dXxS-n.js +0 -9
- package/dist/assets/epic-BrdclDjZ.js +0 -2
- package/dist/assets/useAskAiCfoHostNavButtonProps-V5qZeX-6.js +0 -1
- package/dist/assets/useFetchSuggestedQuestionsWhenReady-DZ4iI1Ee.js +0 -1
- package/dist/assets/useInitialThreadRequest-m86psU6G.js +0 -1
- package/dist/assets/zeni-epic-state-jNbR5Y4-.js +0 -14
package/dist/assets/{CustomerOnboardingRoutes-tQabyyPB.js → CustomerOnboardingRoutes-D-Ufd69Z.js}
RENAMED
|
@@ -1,23 +1,23 @@
|
|
|
1
|
-
import{j as a}from"./liveblocks-
|
|
1
|
+
import{j as a}from"./liveblocks-CzlYoB8q.js";import{t as $e,A as Ce}from"./AddressScreen-BCfbWbk_.js";import ze from"./NotFoundScreen-CojoL2wq.js";import{a as g}from"./sentry-CNCwYM02.js";import{j as oe,u as se,h as ie,l as re,g as D,N as T,k as ce,i as Me,n as qe,o as M}from"./core-CGhI3jCZ.js";import{v as de,I as le,z as B,x as ue,h as Je,c as _,s as V,A as W,d as N,B as we,f as Y,al as Ke,Z as Qe,am as ke,k as te,an as Ze,ao as Ie,o as We,ap as He,aq as Te,ar as Ye}from"./index-D7leYkuC.js";import{bn as Xe,eO as ee,fb as et,eU as pe,eS as me,bv as tt,mk as at,f7 as nt,bN as ot,j3 as ae,j6 as ve,Jd as st,bS as it,c1 as ge,rL as he,rw as rt,Jp as X,rM as _e,GW as ct,k7 as Ue,Jq as Ve,Jr as dt,Js as lt,Jt as ut,j1 as pt,j4 as mt,ry as Be,rK as gt,bD as xe,cu as ht,rY as Ee,pF as ft,pt as yt,j$ as St,fA as bt,fz as Ct,fy as kt,Ju as It,rq as Tt,rZ as xt,s0 as Et,s3 as Ot,s9 as At,cT as Pt}from"./zeni-epic-state-lenVK-tm.js";import{n as fe}from"./mui-ILn-Gd-L.js";import{g as Dt,h as Ft,q as ne}from"./QBOConnectionScreen-B1II2TpX.js";import"./recharts-D6qS-pdV.js";import"./analytics-CQOsvcBG.js";import"./plaid-D8caW90M.js";import"./dnd-DKCsG5d8.js";import"./stripe-DMRn4zHo.js";import"./lottie-CLMz6y3A.js";import"./lexical-DT64qE89.js";import"./pdf-CUf9xopY.js";import"./utils-zvjLmBW4.js";import"./empty-CzOjtD5w.js";import"./pdf-lib-CWTnCbuI.js";import"./index-BRtx8cu_.js";import"./url-CWzi7k2i.js";import"./index-DH8cVwcc.js";import"./decodeURIComponentSafe-CZEzMrgK.js";(function(){try{var t=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},o=new t.Error().stack;o&&(t._sentryDebugIds=t._sentryDebugIds||{},t._sentryDebugIds[o]="4860e52c-6ae3-48c8-b7c1-0269a0cc2bac",t._sentryDebugIdIdentifier="sentry-dbid-4860e52c-6ae3-48c8-b7c1-0269a0cc2bac")}catch{}})();const jt=ce(function(t,o){const s=[];o.isApAgingFeatureEnabled===!1&&s.push("accounts_payable_aging"),o.isArAgingFeatureEnabled===!1&&s.push("accounts_receivable_aging"),o.shouldFetchZeniAccountsPromoCard===!1&&s.push("zeni_accounts_promo_card"),o.shouldFetchRewardsPlanCard===!1&&s.push("rewards_card"),o.isExpenseAutomationEnabledForUser===!1&&s.push("expense_automation_card");const u=nt(t,s,o.signedInUser,o.isExpenseAutomationFeatureEnabledV2,o.isExpenseAutomationEnabledForUser,o.isTreasuryEnabled);return{dashboardFetchState:ot(u.reportsInOrder.map(d=>({fetchState:d.fetchState,error:d.error}))).fetchState}},function(t,o){const{themeState:s,navigate:u,location:d}=o;return{onZeniLogoClick:()=>{s.toggle()},onDashboardFetchDone:()=>{const r=V(d.state?.pathnameStackToGoBack,d.pathname);u("../../dashboard",{state:{pathnameStackToGoBack:r,message:"activation"}})}}})(Ke),wt=()=>{const t=oe(),o=se(),s=ie(),u=de(),[d,r]=g.useState(!1),[p,S]=g.useState(!1),{tenantEmailDomain:e}=re(),n=le(),i=B.getSignedInUser(),h=Xe(i),{useFeatureGate:m}=ue(),I=Je(),{isFeatureEnabled:x}=m(_.isApAgingFeatureEnabled),{isFeatureEnabled:E}=m(_.isArAgingFeatureEnabled),{isFeatureEnabled:k}=m(_.isDepositAccountsFeatureEnabled),{isFeatureEnabled:f}=m(_.isReferralFeatureEnabled),{isFeatureEnabled:U}=m(_.isExpenseAutomationEnabled),{isFeatureEnabled:C}=m(_.isExpenseAutomationEnabledV2),{isFeatureEnabled:F}=m(_.isDebitCardFeatureEnabled),$=C||U&&h,c=D(l=>ee(l)),{isFeatureEnabled:L}=m(_.isTreasuryEnabled),j=c.company!=null&&et(c.company),G=L&&j,O=D(l=>l.onboardingCustomerViewState.fetchState),b=c.excludedResources,R=c.companyId??B.getSignedInUserTenant(e)?.companyId;if(i==null)throw Error("Can't access onboarding flow without signing in...");const w=pe(F,c),A=me(c),P=[],K=b?.resources?.find(l=>l.resource==="/reports/top_expenses")==null,z=b?.resources?.find(l=>l.resource==="/reports/task_card")==null,q=c?.userRole!=null&&tt(c?.userRole),v=b?.resources?.find(l=>l.resource==="/bills")==null&&!q,J=b?.resources?.find(l=>l.resource==="/reimbursements")==null;if(K===!1&&P.push("top_expenses"),z===!1&&P.push("task_card"),v===!1&&P.push("bill_pay_card","bill_pay_promo_card"),J===!1&&P.push("reimbursement_card","reimbursement_promo_card"),k===!1&&P.push("zeni_accounts_promo_card"),f===!1&&P.push("rewards_card"),g.useEffect(()=>{O!=="Completed"||d||w||A||(r(!0),s(at(i.userId,R,c.tenantId,!0,!1,P)))},[d,O,w,A,i,c.tenantId,s]),g.useEffect(()=>{(w||A)&&setTimeout(()=>{S(!0)},5e3)},[w,A]),O!=="Completed")return a.jsx(T,{to:"../"});if(O==="Completed"&&p){const l=V(o.state?.pathnameStackToGoBack,o.pathname);if(w)return a.jsx(T,{to:"../../checking",state:{...o.state,pathnameStackToGoBack:l,message:"activation"}});if(A)return a.jsx(T,{to:"../../cards",state:{...o.state,pathnameStackToGoBack:l,message:"activation"}})}return n?.loggedInUserRoleMap!=null?a.jsxs(a.Fragment,{children:[a.jsx(W,{analytics:N,onLoad:l=>(Q=>Q.trackPageLoaded(Y.Event.onboardingDashboardActivation))(l)}),a.jsx(jt,{navigate:t,location:o,themeState:u,signedInUser:i,isApAgingFeatureEnabled:x,isArAgingFeatureEnabled:E,shouldFetchZeniAccountsPromoCard:k,shouldFetchRewardsPlanCard:f,isExpenseAutomationEnabledForUser:$,isExpenseAutomationFeatureEnabledV2:C,isTreasuryEnabled:G,loggedInUserRoleMap:n?.loggedInUserRoleMap})]}):a.jsx(we,{fetchState:"In-Progress",style:{backgroundColor:I.colors.grey5}})},Oe=fe.div`
|
|
2
2
|
display: flex;
|
|
3
3
|
height: 100vh;
|
|
4
4
|
background-color: ${t=>t.theme.colors.grey4};
|
|
5
|
-
`,
|
|
5
|
+
`,Ae=fe.div`
|
|
6
6
|
display: flex;
|
|
7
7
|
flex-direction: column;
|
|
8
8
|
align-items: center;
|
|
9
|
-
min-width: calc(100% - ${
|
|
10
|
-
padding-left: ${
|
|
9
|
+
min-width: calc(100% - ${Ie}px);
|
|
10
|
+
padding-left: ${Ie}px;
|
|
11
11
|
flex: 1;
|
|
12
12
|
|
|
13
13
|
${t=>t.theme.breakpoints.down("md")} {
|
|
14
14
|
width: 100%;
|
|
15
|
-
padding-left: ${
|
|
15
|
+
padding-left: ${We.sp0};
|
|
16
16
|
}
|
|
17
17
|
|
|
18
18
|
${t=>t.windowSize!=="small"?"overflow: auto;":""}
|
|
19
|
-
`,
|
|
19
|
+
`,Pe=ce(function(t,o){const{companyId:s,isAdmin:u,currentTenant:d,isOnAddressPage:r}=o,p=B.getSignedInUser(),S=d.tenantId,e={userId:p?.userId??"",sessionId:p?.zeniSessionId??"",tenantId:S??""},n=ee(t),i=he(t,s),h=Ve(t),m=ge(d?.userRole??[])&&i.updateStatus.fetchState!=="In-Progress"?void 0:"readonly",I=dt(t.userRoleConfigState);return{onboardingCustomerView:i,analytics:N,isRefreshingViewInBackground:!1,isDisabled:m,companyTitles:I.companyTitles,connectedAccountProvider:n.company?.featuresActivationInfo.connectedAccountProvider??"",fileProps:{filesEndPoint:He.fileMicroServiceBaseUrl,authParams:e},signedInUser:B.getSignedInUser(),currentTenant:d,isAdmin:u,isOnAddressPage:r,meetingUrl:"https://meetings.hubspot.com/niharn/zeni-onboarding-overview?embed=true",cardPaymentView:h,isCardPaymentPopupOpen:!1,stripeKey:te.stripeKey}},function(t,o){const{companyId:s,currentTenant:u,themeState:d,navigate:r,location:p}=o,{tenantEmailDomain:S}=u;return{onFetchLinkTokenClick:(e,n)=>{t(At(e,n))},onEstablishConnectionClick:(e,n)=>{t(Ot(e,n))},onUpdatePaymentAccountStatus:(e,n,i)=>{t(Et(e,n,i))},onUpdatePaymentAccountLoginStatus:(e,n)=>{t(xt(!1,e,n))},onEstablishConnectionSuccess:()=>{t(Tt(s,!0,!1))},handleOnConnectClick:()=>{N.trackOnboardingConnectQBO(),ne.handleClick()},updateQBOPopupState:e=>{t(X({isQBOPopupOpen:e}))},onCompanyOfficerUpdated:e=>{const n=e.map(i=>{const{officerType:h,userId:m,name:I,email:x,ssn:E,nationalityCountryCode:k,dob:f,phone:U,syncToken:C,selectDocument:F,role:$,ownership:c,isSelectedForVerification:L,userVerificationStatus:j,fileIds:G,isPhoneVerified:O}=i;let b;return F.selectDocumentType==="driverLicense"?b="driving_license":F.selectDocumentType==="passport"?b="passport":F.selectDocumentType==="stateId"?b="id_document":F.selectDocumentType==="ssnCard"&&(b="social_security_card"),{officerType:h,userId:m,firstName:I.firstName,lastName:I.lastName,email:x,ssn:E,nationalityCountryCode:k?.selectedOption!=null?Te(k.selectedOption):void 0,phone:U,birthday:f!=null?xe(f?.toString()):f,syncToken:C,titleAtCompany:$.selectedOption,ownershipInCompany:c,documentTypeSelectedForVerification:b,isSelectedForVerification:L,userVerificationStatus:j,fileIds:G,additionalDocumentTypesRequestedForVerification:[],additionalSubmittedDocumentsForVerificationFileIds:[],areAdditionalDocumentsRequestedForVerification:!1,areAdditionalDocumentsSubmittedForVerification:!1,isPhoneVerified:O}});t(Ee({officers:n}))},onGetOtp:(e,n)=>{t(kt(e,"CustomerOnboarding")),n!=null&&t(It({officerType:n,phone:e}))},onResendOtp:e=>{t(Ct(e,"CustomerOnboarding"))},onVerifyOtp:(e,n)=>{t(bt(e,n,"CustomerOnboarding"))},updateFilesEntity:e=>{t(St({files:e}))},onDeleteFile:e=>{t(yt(e))},onEditFileName:(e,n)=>{t(ft(e,n.split(".")[0]))},onCompanyDetailsChanged:e=>{const{companyDescription:n,companyIndustry:i,companyIndustryType:h,companyLegalName:m,companyTaxId:I,companyWebsite:x,companyPhone:E,primaryContactEmail:k,primaryContactName:f,primaryContactUserId:U,primaryContactSyncToken:C,syncToken:F,fileIds:$,typeOfIncorporation:c,stateOfIncorporation:L,incDate:j,companySourceOfFunds:G,companySourceOfFundsDescription:O,companySubIndustry:b,countriesOfOperations:R,purposeOfAccount:w,purposeOfAccountDescription:A,regulatedStatus:P,regulatedStatusDescription:K,transactionVolume:z,transactionVolumeDescription:q,usNexus:v,usNexusTypes:J}=e,l={companyId:s,companyDescription:n,companyIndustry:i.selectedOption,companyIndustryType:h?.selectedOption??"",companyLegalName:m,taxIdOrEIN:I,website:x!=""&&x!=null?ht(x):void 0,phone:E,syncToken:F,fileIds:$,incDate:j!=null?xe(j?.toString()):j,typeOfIncorporation:c?.selectedOption??"",stateOfIncorporation:L?.selectedOption??"",companySourceOfFunds:G?.selectedOption??"",companySourceOfFundsDescription:O,companySubIndustry:b?.selectedOption??"",countriesOfOperations:R?.selectedOptions.map(Z=>Z.length===2?Z:Te(Z))??[],purposeOfAccount:w?.selectedOption??"",purposeOfAccountDescription:A,regulatedStatus:P??"",regulatedStatusDescription:K,transactionVolume:z?.selectedOption??"",transactionVolumeDescription:q,usNexus:v,usNexusTypes:J?.selectedOptions??[]},Q={userId:U,firstName:f.firstName,lastName:f.lastName,email:k,syncToken:C};t(Ee({companyDetails:l,primaryContactDetails:Q}))},onAddressClick:(e,n)=>{const i=De(S,e,n),h=V(p.state?.pathnameStackToGoBack,p.pathname);r(i,{state:{pathnameStackToGoBack:h}})},onRegisteredAddressClick:(e,n)=>{const i=De(S,e,n),h=V(p.state?.pathnameStackToGoBack,p.pathname);r(i,{state:{pathnameStackToGoBack:h}})},onUpdateCustomerView:(e,n,i)=>{t(gt(s,!1,n,i,e))},onAddressEditHandler:e=>{if(e!=null){const n=$e(e);t(Ue({addressType:"subscription_billing_address",addressToCreate:n}))}},onSkipSetupClick:()=>{const e=V(p.state?.pathnameStackToGoBack,p.pathname);t(Be(s,!1,!1)),r("./activation",{state:{pathnameStackToGoBack:e}})},onUpdateStep:e=>{t(_e({step:e}))},onZeniLogoClick:()=>{d.toggle()},handleLogOutClick:()=>{const e=V(p.state?.pathnameStackToGoBack,p.pathname);r("/signout",{replace:!0,state:{pathnameStackToGoBack:e,message:"logout"}})},handleCockpitClick:()=>{window.open("/cockpit")},handleCreateCardSetupIntent:e=>{t(ve(e))},handleConfirmCardSetupIntent:e=>{t(mt(e))},updateCardPaymentModalState:e=>{t(X({isCardPaymentPopupOpen:e}))},handleAddCardPaymentSource:(e,n,i)=>{t(pt(e,n,i))},handleFetchPaymentSources:()=>{t(ae())},resetCardPaymentViewState:()=>{t(ut())},handleResetCardPaymentErrorStatuses:()=>{t(lt())},redirectToProductSuitePage:()=>{const e=V(p.state?.pathnameStackToGoBack,p.pathname);r(`/${S}/onboarding/thankyou`,{state:{pathnameStackToGoBack:e,message:"OnboardingThankyou"},replace:!0})}}})(Ze),H=({taxCFOCustomer:t=!1,isOnAddressPage:o=!1,appContent:s})=>{const u=oe(),d=se(),r=ie(),p=Qe(),S=de(),[e,n]=g.useState(!1),[i,h]=g.useState(!1),[m,I]=g.useState(!1),{tenantEmailDomain:x}=re(),E=le(),{useFeatureGate:k}=ue(),{isFeatureEnabled:f}=k(_.isDebitCardFeatureEnabled),U=Me("/:tenantEmailDomain/onboarding")!==null&&d.search?.includes("code"),C=D(y=>y.onboardingCustomerViewState.fetchState),F=D(y=>y.onboardingCustomerViewState.currentStep),$=D(y=>y.onboardingCustomerViewState.uiState),c=D(y=>ee(y)),L=D(y=>y.userRoleConfigState.fetchState),j=D(y=>y.cardPaymentViewState),G=ke(j.addCardPaymentSourceStatus.fetchState),O=j.addCardPaymentSourceStatus.fetchState,{code:b,realmId:R,state:w}=Dt(d.search),A=c.externalConnections?.accounting[0],P=A?.connectionType,K=A?.connectionName,z=A?.connectionId??"",q=B.getSignedInUser()?.userId??"";g.useEffect(()=>{i||(h(!0),r(ae()))},[i,r]),g.useEffect(()=>{m||(ve(["card"]),I(!0))},[m]),g.useEffect(()=>{G==="In-Progress"&&O==="Completed"&&r(ae())},[G,O]),g.useEffect(()=>{Ft(b,R,w,z,q)===!0&&c.externalConnections?.saveConnectionState!=="In-Progress"&&C==="Completed"&&(r(st(c.tenantId,{connection_type:P??"accounting",connection_name:K??"quickbooks_online",authorization_code:b,realm_id:R,connection_id:z,user_id:q},it(window.location.origin+"/onboarding/auth"))),N.trackOnboardingSaveQBOConnection(R,z),u(d.pathname))},[b,R,w,d.pathname,C]),g.useEffect(()=>{ne.isInitiated===!1&&C==="Completed"&&ne.init("/onboarding/auth",c.tenantEmailDomain)},[C]);const v=c.companyId??B.getSignedInUserTenant(x)?.companyId,J=ge(c?.userRole??[]),l=D(y=>he(y,v));g.useEffect(()=>{e||C!=="Not-Started"||v==null||(n(!0),r(rt(v,!0,!U)))},[e,C,v]),g.useEffect(()=>{c.externalConnections?.saveConnectionState!=="Completed"&&c.externalConnections?.saveConnectionState!=="Error"||!$.isQBOPopupOpen||F!=="qbo_connection"||r(X({isQBOPopupOpen:!1}))},[c.externalConnections?.saveConnectionState]),g.useEffect(()=>{C==="Completed"&&U&&(r(_e({step:"qbo_connection"})),r(X({isQBOPopupOpen:!0})))},[U,C]),g.useEffect(()=>{L==="Not-Started"&&r(ct(!0))},[L,r]);const Q=ke(l.companyDetailsLocalData?.addressStatus);g.useEffect(()=>{l.companyDetailsLocalData?.registeredAddressStatus?.addressToCreate==null&&l.companyDetailsLocalData?.addressStatus?.addressToCreate!=null&&Q==null&&r(Ue({addressType:"company_registered_address",addressToCreate:l.companyDetailsLocalData?.addressStatus?.addressToCreate}))},[l.companyDetailsLocalData?.addressStatus?.addressToCreate,l.companyDetailsLocalData?.registeredAddressStatus?.addressToCreate]);const Z=l.isInterimEmailSent;if(B.getSignedInUser()==null)throw Error("Can't access onboarding flow without signing in...");const Le=pe(f,c),Ge=me(c),ye=c.company?.companyOnboardingInfo.isOnboardingCompleted,Se=y=>y.trackPageLoaded(Y.Event.onboardingPage),be=c.productSettings.isOtherProductsEnabled,Re=c.productSettings.isTreasuryEnabled;if(ye===!0){if(!be)return Re?a.jsx(T,{to:"../../treasury"}):Le?a.jsx(T,{to:"../../checking"}):Ge?a.jsx(T,{to:"../../cards"}):a.jsx(T,{to:"../../dashboard"});const y=l.updateStatus.fetchState==="In-Progress";if(be&&!y)return t?a.jsxs(Oe,{children:[a.jsx(W,{analytics:N,onLoad:Ne=>Se(Ne)}),a.jsx(Pe,{navigate:u,location:d,companyId:v,currentTenant:c,isAdmin:J,isOnAddressPage:o,themeState:S,googleAPIKey:te.googleMapsAPIKey}),s!=null?a.jsx(Ae,{windowSize:p,children:s}):null]}):a.jsx(T,{to:"../../onboarding/thankyou"})}else if(ye===!1&&E?.loggedInUserRoleMap!=null)return Z===!0?a.jsx(T,{to:"../../onboarding/thankyou"}):a.jsxs(Oe,{children:[a.jsx(W,{analytics:N,onLoad:y=>Se(y)}),a.jsx(Pe,{navigate:u,location:d,companyId:v,currentTenant:c,isAdmin:J,isOnAddressPage:o,themeState:S,googleAPIKey:te.googleMapsAPIKey}),s!=null?a.jsx(Ae,{windowSize:p,children:s}):null]});return null};function De(t,o,s){let u=`/${t}/onboarding/address`;return u=s!=null?u.concat(`/edit/${o}/${encodeURIComponent(s)}`):u.concat(`/new/${o}`),u}const Fe=fe.div`
|
|
20
20
|
display: flex;
|
|
21
21
|
height: 100vh;
|
|
22
22
|
background-color: ${t=>t.theme.colors.grey4};
|
|
23
|
-
`,je=ce(function(t,o){const{companyId:s,currentTenant:u}=o,d=he(t,s),r=Ve(t);return{hasVerifiedBankAccount:(d.paymentAccount?.providerVerificationStatus?.code?.includes("verified")??!1)||(r.bankAccountsList[0]?.providerVerificationStatus?.code?.includes("verified")??!1),isDisabled:ge(u?.userRole??[])&&d.updateStatus.fetchState!=="In-Progress"?void 0:"readonly",signedInUser:B.getSignedInUser(),currentTenant:u,meetingUrl:"https://meetings.hubspot.com/niharn/zeni-onboarding-overview?embed=true"}},function(t,o){const{currentTenant:s,themeState:u,navigate:d,location:r}=o,{tenantEmailDomain:p}=s;return{onZeniLogoClick:()=>{u.toggle()},handleLogOutClick:()=>{const S=V(r.state?.pathnameStackToGoBack,r.pathname);d("/signout",{replace:!0,state:{pathnameStackToGoBack:S,message:"logout"}})},handleCockpitClick:()=>{window.open("/cockpit")},handleUpdatePaymentAddressDetailClick:()=>{const S=V(r.state?.pathnameStackToGoBack,r.pathname);d(`/${p}/onboarding/billing/edit`,{state:{pathnameStackToGoBack:S,message:"UpdatePaymentAddressDetail"}})}}})(
|
|
23
|
+
`,je=ce(function(t,o){const{companyId:s,currentTenant:u}=o,d=he(t,s),r=Ve(t);return{hasVerifiedBankAccount:(d.paymentAccount?.providerVerificationStatus?.code?.includes("verified")??!1)||(r.bankAccountsList[0]?.providerVerificationStatus?.code?.includes("verified")??!1),isDisabled:ge(u?.userRole??[])&&d.updateStatus.fetchState!=="In-Progress"?void 0:"readonly",signedInUser:B.getSignedInUser(),currentTenant:u,meetingUrl:"https://meetings.hubspot.com/niharn/zeni-onboarding-overview?embed=true"}},function(t,o){const{currentTenant:s,themeState:u,navigate:d,location:r}=o,{tenantEmailDomain:p}=s;return{onZeniLogoClick:()=>{u.toggle()},handleLogOutClick:()=>{const S=V(r.state?.pathnameStackToGoBack,r.pathname);d("/signout",{replace:!0,state:{pathnameStackToGoBack:S,message:"logout"}})},handleCockpitClick:()=>{window.open("/cockpit")},handleUpdatePaymentAddressDetailClick:()=>{const S=V(r.state?.pathnameStackToGoBack,r.pathname);d(`/${p}/onboarding/billing/edit`,{state:{pathnameStackToGoBack:S,message:"UpdatePaymentAddressDetail"}})}}})(Ye),vt=()=>{const t=oe(),o=ie(),s=se(),u=de(),{useFeatureGate:d}=ue(),{isFeatureEnabled:r}=d(_.isDebitCardFeatureEnabled),{tenantEmailDomain:p}=re(),S=le(),[e,n]=g.useState(!1);g.useEffect(()=>{e===!1&&s.state?.message==="OnboardingThankyou"&&n(!0)},[s.state]);const i=D(f=>ee(f)),h=i.productSettings.isOtherProductsEnabled;g.useEffect(()=>{o(Be(m,!1,!h))},[]);const m=i.companyId??B.getSignedInUserTenant(p)?.companyId;if(S.loggedInUser==null)throw Error("Can't access onboarding flow without signing in...");const I=pe(r,i),x=me(i),E=D(f=>f.onboardingCustomerViewState.updateStatus.fetchState),k=i.company?.companyOnboardingInfo.isOnboardingCompleted;return k!==!0||h?E==="Completed"&&k===!0&&h&&S?.loggedInUserRoleMap!=null?a.jsxs(Fe,{children:[a.jsx(W,{analytics:N,onLoad:f=>{f.trackPageLoaded(Y.Event.onboardingLandingPage,"Onboarding",Pt(i.productSettings))}}),a.jsx(je,{navigate:t,showUpdatePaymentDetailButton:h,location:s,companyId:m,currentTenant:i,themeState:u,isVisitingFirstTime:e})]}):E==="Completed"&&k===!1&&S?.loggedInUserRoleMap!=null?a.jsxs(Fe,{children:[a.jsx(W,{analytics:N,onLoad:f=>{f.trackPageLoaded(Y.Event.onboardingInterimPage)}}),a.jsx(je,{navigate:t,showUpdatePaymentDetailButton:h,location:s,companyId:m,currentTenant:i,themeState:u,isVisitingFirstTime:e})]}):a.jsx(we,{fetchState:E}):I?a.jsx(T,{to:"../../checking"}):x?a.jsx(T,{to:"../../cards"}):a.jsx(T,{to:"../../dashboard"})};function oa(){return a.jsxs(qe,{children:[a.jsx(M,{path:"/",element:a.jsx(H,{})}),a.jsx(M,{path:"/billing/edit",element:a.jsx(H,{taxCFOCustomer:!0})}),a.jsx(M,{path:"/thankyou",element:a.jsx(vt,{})}),a.jsx(M,{path:"/activation",element:a.jsx(wt,{})}),a.jsx(M,{path:"/address/edit/:addressType/:addressId",element:a.jsx(H,{isOnAddressPage:!0,appContent:a.jsx(Ce,{})})}),a.jsx(M,{path:"/address/new/:addressType",element:a.jsx(H,{isOnAddressPage:!0,appContent:a.jsx(Ce,{})})}),a.jsx(M,{path:"*",element:a.jsx(ze,{})})]})}export{oa as default};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{j as l}from"./liveblocks-D_qjMTev.js";import{l as K,g as S,u as z,h as G,j as q,k as H,s as $a,n as at,o as w}from"./core-Bsrz_HO3.js";import{eN as j,Jv as Me,bC as Ut,bq as ue,KI as za,hS as qa,KJ as xt,KK as Za,hV as nt,KL as Re,KM as Ha,h_ as Ja,KN as Tt,KO as Qa,i2 as ot,KP as je,KQ as Xa,cj as rt,KR as Wa,KS as en,JP as tn,iY as an,KT as nn,bn as Ae,KU as Yt,Jj as ee,bc as Vt,ja as Nt,mt as Gt,iV as Kt,Jl as te,Jk as Z,f2 as on,fk as sn,KV as rn,KW as cn,KX as $t,KY as be,tA as ve,tB as Ie,tY as me,tS as ae,tF as Ee,KZ as ln,K_ as dn,K$ as un,L0 as zt,L1 as Ce,L2 as mn,dB as Ue,qc as qt,L3 as pn,L4 as hn,L5 as fn,L6 as it,IH as ct,jq as pe,u4 as lt,qk as gn,L7 as bn,tC as wt,qf as le,qb as Zt,L8 as se,L9 as Cn,La as dt,IF as ut,sc as Ht,Lb as _n,Lc as kn,Ld as Sn,Le as mt,sp as yn,Lf as An,tE as Dt,sb as Jt,Lg as re,Lh as vn,bv as Qt,u8 as Xt,Li as In,Lj as En,Lk as xn,Ll as pt,u3 as Tn,Lm as wn,tD as Ft,u7 as Wt,Ln as ie,Lo as Dn,Lp as Fn,Lq as ea,jf as ta,mq as aa,jk as na,mo as oa,mn as sa,mm as ra,rA as On,fa as Pn,cM as Bn,cN as Rn,mj as jn,f6 as Ln,mA as Mn,Lr as Un,Dc as Yn,Ls as Vn,Lt as Nn,Lu as Gn,b5 as ht,eZ as Kn,gA as $n,fB as zn,mu as qn,iO as Zn,mr as Hn,mp as Jn,eT as Qn,eR as Xn}from"./zeni-epic-state-jNbR5Y4-.js";import{z as R,Q as J,s as D,d as I,D as $,aQ as Wn,A as xe,aR as ia,f as V,aS as eo,j as Te,aT as ca,a as Ye,p as L,h as to,aU as ao,aV as no,K as la,q as oo,c as da,Z as so,aW as ro,aJ as ua,aX as io,aY as co,O as lo,aZ as uo,a_ as mo,am as po,n as ho,M as fo,a$ as go,b0 as ke}from"./index-CD3Zb4OY.js";import{n as ft}from"./mui-B-WzuEhL.js";import{a as b}from"./sentry-8G-PMI1Z.js";import{w as ma}from"./withTransactionSidePanel-DrkIOqqu.js";import{b as pa,t as he,e as ne,a as gt,v as bo}from"./routePaths-guUFi6jP.js";import{u as Q}from"./useAskAiCfoHostNavButtonProps-V5qZeX-6.js";import{c as we,b as Co}from"./useFetchSuggestedQuestionsWhenReady-DZ4iI1Ee.js";import ye from"./NotFoundScreen-7pgsDHD4.js";import{t as ha}from"./analyticsHelper-DXgEF5Aw.js";import{C as _o}from"./CompanyPassportScreen-CP7xp86t.js";import{F as ko}from"./FeaturePreviewScreen-zKBzcSjH.js";import{R as So}from"./ReferralListScreen-CLtUXrj_.js";import"./recharts-DLyOpEqk.js";import"./analytics-6quGmcJ9.js";import"./plaid-D8D4m-Yi.js";import"./dnd-DQWt2Oqt.js";import"./stripe-DMRn4zHo.js";import"./lottie-DsuJTV9-.js";import"./lexical-BINeBAQD.js";import"./pdf-CvaAggXr.js";import"./utils-DwSP01dM.js";import"./TransactionDetailScreen-BUEQCRRD.js";import"./decodeURIComponentSafe-CO5SD6sS.js";import"./MobileAppDrawer-B1UAm8wT.js";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},a=new e.Error().stack;a&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[a]="269264d2-749b-4732-b058-5e62d0fed9cc",e._sentryDebugIdIdentifier="sentry-dbid-269264d2-749b-4732-b058-5e62d0fed9cc")}catch{}})();const yo=ma(function({openTransactionPanel:e,panelContent:a,sidePanelIsOpen:t,sidePanelIsFullView:n}){const{vendorId:o,reportDate:r}=K(),s=R.getSignedInUser(),i=S(x=>x.tenantState.currentTenantId),d=S(x=>j(x)),{tenantEmailDomain:p}=K(),C=z(),g=d?.companyName??"",u={userId:s?.userId??"",sessionId:s?.zeniSessionId??"",tenantId:i??""},c=b.useMemo(()=>({authParams:u,companyName:g,downloadEndPoint:`${J}/agingDetailedReport`,timezone:Me()}),[]),m=b.useMemo(()=>r!=null?Ut(r):ue(),[r]),h=G(),f=q(),k=S(x=>za(x,m,o)),y=b.useCallback(()=>{o!=null&&k.fetchState!=="In-Progress"&&k.fetchState!=="Completed"&&h(qa(o,m))},[m]),_=b.useCallback(()=>{f("../../",{relative:"path"})},[]),A=b.useCallback((x,P)=>{h(xt({sortKey:x,sortOrder:P}))},[]),E=b.useCallback(x=>{h(xt({downloadState:x}))},[]),M=b.useCallback(x=>{if(e)e(x.transactionId,x.transactionType);else if(p!=null){const P=pa({id:x.transactionId,type:x.transactionType},p);f(P);const fe=D(C.state?.pathnameStackToGoBack,C.pathname);f(P,{state:{pathnameStackToGoBack:fe}})}},[p,e]),F=b.useCallback(()=>{k.vendor!=null&&I.trackApAgingDetail("AP Aging",m.format($.getLocalizedStrings().dateFormat.analytics.YYYYDashMMDashDDFormat),k.vendor.id,k.vendor.name)},[k.vendor,m]);return b.useEffect(()=>{y()},[]),b.useEffect(()=>{k.fetchState==="Completed"&&F()},[F,k.fetchState]),l.jsx(Wn,{apAgingDetail:k,downloadParams:c,reportDate:m,analytics:I,onTransactionClick:M,onReload:y,onBackClick:_,onColumnSortConfigChanged:A,updateDownloadStateHandler:E,panelContent:a,sidePanelIsOpen:t,sidePanelIsFullView:n})}),Ao=()=>{const e=G(),a=q(),t=S(A=>Za(A)),{isAiCfoAccessEnabled:n,onAskAiCfoClick:o}=Q({mobileExploreReferrer:"AP Aging"});we({isDataReady:t.fetchState==="Completed"});const r=R.getSignedInUser(),s=S(A=>A.tenantState.currentTenantId),i=S(A=>j(A)),d=i?.companyName??"",p={userId:r?.userId??"",sessionId:r?.zeniSessionId??"",tenantId:s??""},C=b.useMemo(()=>({authParams:p,companyName:d,downloadEndPoint:`${J}/agingReport`,timezone:Me()}),[]),g=t.apAgingUIState.selectedDate??ue(),u=b.useCallback(()=>{t.fetchState!=="In-Progress"&&t.fetchState!=="Completed"&&e(nt(g))},[]);b.useEffect(()=>{u()},[]);const c=b.useCallback(()=>{a("../",{relative:"path"})},[]),m=b.useCallback(A=>{e(Re({searchString:A}))},[]),h=b.useCallback((A,E)=>{e(Re({sortKey:E,sortOrder:A}))},[]),f=b.useCallback(A=>{a(`./${A}/${g.format($.getLocalizedStrings().dateFormat.analytics.YYYYDashMMDashDDFormat)}`)},[g]),k=b.useCallback(A=>{e(Re({downloadState:A}))},[]),y=b.useCallback((A,E)=>{},[]),_=b.useCallback((A,E)=>{e(Re({selectedDate:A,agingDateSelectionType:E})),e(nt(A))},[]);return l.jsxs(l.Fragment,{children:[t.fetchState==="Completed"?l.jsx(xe,{analytics:I,onLoad:A=>A.trackPageLoaded(V.Event.agingReport,"AP Aging")}):null,l.jsx(ia,{uiState:t.apAgingUIState,report:t,downloadParams:C,analytics:I,onReloadReport:u,onBackClick:c,onSearchTextChange:m,onSortOrderChange:h,onEntityNameClick:f,updateDownloadStateHandler:k,onSelectedDateChanged:_,onNodeCollapseToggled:y,isAiCfoAccessEnabled:n,onAskAiCfoClick:o})]})},vo=ma(function({openTransactionPanel:e,panelContent:a,sidePanelIsOpen:t,sidePanelIsFullView:n}){const{customerId:o,reportDate:r}=K(),s=R.getSignedInUser(),i=S(F=>j(F)),{tenantEmailDomain:d}=K(),p=z(),C=i.companyName,g={userId:s?.userId??"",sessionId:s?.zeniSessionId??"",tenantId:i.tenantId},u=b.useMemo(()=>({authParams:g,companyName:C,downloadEndPoint:`${J}/agingDetailedReport`,timezone:Me()}),[]),c=b.useMemo(()=>r!=null?Ut(r):ue(),[r]),m=G(),h=q(),f=S(F=>Ha(F,c,o)),k=b.useCallback(()=>{o!=null&&f.fetchState!=="In-Progress"&&f.fetchState!=="Completed"&&m(Ja(o,c))},[c]),y=b.useCallback(()=>{h("../../",{relative:"path"})},[]),_=b.useCallback((F,x)=>{m(Tt({sortKey:F,sortOrder:x}))},[]),A=b.useCallback(F=>{m(Tt({downloadState:F}))},[]),E=b.useCallback(F=>{if(e)e(F.transactionId,F.transactionType);else if(d!=null){const x=pa({id:F.transactionId,type:F.transactionType},d);h(x);const P=D(p.state?.pathnameStackToGoBack,p.pathname);h(x,{state:{pathnameStackToGoBack:P}})}},[d,e]),M=b.useCallback(()=>{f.customer!=null&&I.trackArAgingDetail("AR Aging",c.format($.getLocalizedStrings().dateFormat.analytics.YYYYDashMMDashDDFormat),f.customer.id,f.customer.name)},[f.customer,c]);return b.useEffect(()=>{k()},[]),b.useEffect(()=>{f.fetchState==="Completed"&&M()},[f.fetchState,M]),l.jsx(eo,{arAgingDetail:f,downloadParams:u,reportDate:c,analytics:I,onTransactionClick:E,onReload:k,onBackClick:y,onColumnSortConfigChanged:_,updateDownloadStateHandler:A,panelContent:a,sidePanelIsOpen:t,sidePanelIsFullView:n})}),Io=()=>{const e=G(),a=q(),t=S(_=>Qa(_)),{isAiCfoAccessEnabled:n,onAskAiCfoClick:o}=Q({mobileExploreReferrer:"AR Aging"});we({isDataReady:t.fetchState==="Completed"});const r=R.getSignedInUser(),s=S(_=>j(_)),i=s.companyName,d={userId:r?.userId??"",sessionId:r?.zeniSessionId??"",tenantId:s.tenantId},p=b.useMemo(()=>({authParams:d,companyName:i,downloadEndPoint:`${J}/agingReport`,timezone:Me()}),[]),C=t.arAgingUIState.selectedDate??ue(),g=b.useCallback(()=>{t.fetchState!=="In-Progress"&&t.fetchState!=="Completed"&&e(ot(C))},[]);b.useEffect(()=>{g()},[]);const u=b.useCallback(()=>{a("../",{relative:"path"})},[]),c=b.useCallback(_=>{e(je({searchString:_}))},[]),m=b.useCallback((_,A)=>{e(je({sortKey:A,sortOrder:_}))},[]),h=b.useCallback(_=>{a(`./${_}/${C.format($.getLocalizedStrings().dateFormat.analytics.YYYYDashMMDashDDFormat)}`)},[C]),f=b.useCallback(_=>{e(je({downloadState:_}))},[]),k=b.useCallback((_,A)=>{e(je({selectedDate:_,agingDateSelectionType:A})),e(ot(_))},[]),y=b.useCallback((_,A)=>{e(Xa({nodeId:_,isCollapsed:A}))},[]);return l.jsxs(l.Fragment,{children:[t.fetchState==="Completed"?l.jsx(xe,{analytics:I,onLoad:_=>_.trackPageLoaded(V.Event.agingReport,"AR Aging")}):null,l.jsx(ia,{uiState:t.arAgingUIState,report:t,downloadParams:p,analytics:I,onReloadReport:g,onBackClick:u,onSearchTextChange:c,onSortOrderChange:m,onEntityNameClick:h,updateDownloadStateHandler:f,onSelectedDateChanged:k,onNodeCollapseToggled:y,isAiCfoAccessEnabled:n,onAskAiCfoClick:o})]})},fa=(e,a)=>({key:a,title:e.accountName,amount:e.balance?.available,logoUri:e.logo?.toString(),source:e});function ga(e,a){const t=tn(a.firstMonthOfFY);return{onItemClick:(n,o)=>{const r=o.accountName===""?o.accountDescription:o.accountName,s=he(a.tenantEmailDomain,o.accountId,o.accountType,r,"quarter",t,!1),i=D(a.location.state?.pathnameStackToGoBack,a.location.pathname);a.navigate(s,{state:{pathnameStackToGoBack:i,referrer:a.referrerType}})},onSetAccountsStatementDate:(n,o)=>{e(an(n,o))},onPromoCardBtnClick:n=>{if(a.isZeniAccountsAdmin){let o=`../../checking/${n}`;n?I.trackZeniAccountsCashBalancePromoClicked("Move Money"):(I.trackZeniAccountsCashBalancePromoClicked("Sign Up for Free"),o="../../checking/promo");const r=D(a.location.state?.pathnameStackToGoBack,a.location.pathname);a.navigate(o,{state:{pathnameStackToGoBack:r}})}else I.trackZeniAccountsCashBalancePromoClicked("Learn More"),window.open("https://www.zeni.ai/product/business-checking-accounts","_blank")}}}const Eo=H(function(e){const a=Wa(e).accountsInOrder.map((n,o)=>fa(n,o)),t=en(e);return{sectionTitle:$.getLocalizedStrings().balanceCard.cashBalanceSectionTitle,transactionArray:a,zeniAccountsPromoCardReport:t,fetchState:e.cashBalanceState.fetchState,analytics:I}},ga)(ca),xo=H(function(e){const a=nn(e).accountsInOrder.map((o,r)=>fa(o,r)),t=R.getSignedInUser(),n=Ae(t);return{sectionTitle:$.getLocalizedStrings().balanceCard.cardBalanceSectionTitle,transactionArray:a,isZeniUser:n,fetchState:e.cardBalanceState.fetchState,analytics:I}},ga)(ca);function To(){const e=q(),a=z(),{tenantEmailDomain:t}=K(),n=Te(),o=S(s=>j(s).company?.companyInfo.firstMonthOfFY??1),r=rt(n?.loggedInUserRoleMap);return S(s=>s.cashBalanceState.fetchState)==="Error"?l.jsx(ye,{}):l.jsx(Eo,{tenantEmailDomain:t,location:a,referrerType:"Cash Balance",navigate:e,isZeniAccountsAdmin:r,firstMonthOfFY:o})}function wo(){const e=q(),a=z(),{tenantEmailDomain:t}=K(),n=Te(),o=rt(n?.loggedInUserRoleMap),r=S(s=>j(s).company?.companyInfo.firstMonthOfFY??1);return S(s=>s.cardBalanceState.fetchState)==="Error"?l.jsx(ye,{}):l.jsx(xo,{tenantEmailDomain:t,location:a,referrerType:"Card Balance",navigate:e,isZeniAccountsAdmin:o,firstMonthOfFY:r})}const Do=ft.div`
|
|
1
|
+
import{j as l}from"./liveblocks-CzlYoB8q.js";import{l as z,g as S,u as K,h as V,j as q,k as H,s as $a,n as at,o as w}from"./core-CGhI3jCZ.js";import{eO as L,JK as Me,bD as Ut,bq as ue,KX as Ka,hT as qa,KY as xt,KZ as Za,hW as nt,K_ as Re,K$ as Ha,h$ as Ja,L0 as Tt,L1 as Qa,i3 as ot,L2 as Le,L3 as Wa,ck as rt,L4 as Xa,L5 as en,K2 as tn,iZ as an,L6 as nn,bn as Ae,L7 as Yt,Jy as ee,bc as Gt,jb as Nt,mu as Vt,iW as zt,JA as te,Jz as Z,f3 as on,fl as sn,L8 as rn,L9 as cn,La as $t,Lb as be,tB as ve,tC as Ie,tZ as me,tT as ae,tG as Ee,Lc as ln,Ld as dn,Le as un,Lf as Kt,Lg as Ce,Lh as mn,dC as Ue,qd as qt,Li as pn,Lj as hn,Lk as fn,Ll as it,IW as ct,jr as pe,u5 as lt,ql as gn,Lm as bn,tD as wt,qg as le,qc as Zt,Ln as se,Lo as Cn,Lp as dt,IU as ut,sd as Ht,Lq as _n,Lr as kn,Ls as Sn,Lt as mt,sq as yn,Lu as An,tF as Dt,sc as Jt,Lv as re,Lw as vn,bv as Qt,u9 as Wt,Lx as In,Ly as En,Lz as xn,LA as pt,u4 as Tn,LB as wn,tE as Ft,u8 as Xt,LC as ie,LD as Dn,LE as Fn,LF as ea,jg as ta,mr as aa,jl as na,mp as oa,mo as sa,mn as ra,rB as On,fb as Pn,cN as Bn,cO as Rn,mk as Ln,f7 as jn,mB as Mn,LG as Un,Dd as Yn,LH as Gn,LI as Nn,LJ as Vn,b5 as ht,e_ as zn,gB as $n,fC as Kn,mv as qn,iP as Zn,ms as Hn,mq as Jn,eU as Qn,eS as Wn}from"./zeni-epic-state-lenVK-tm.js";import{z as R,T as J,s as D,d as I,D as $,aQ as Xn,A as xe,aR as ia,f as G,aS as eo,I as Te,aT as ca,x as Ye,c as j,h as to,aU as ao,aV as no,M as la,Z as oo,a as da,a0 as so,aW as ro,aJ as ua,aX as io,aY as co,R as lo,aZ as uo,a_ as mo,am as po,q as ho,N as fo,a$ as go,b0 as ke}from"./index-D7leYkuC.js";import{n as ft}from"./mui-ILn-Gd-L.js";import{a as b}from"./sentry-CNCwYM02.js";import{w as ma}from"./withTransactionSidePanel-caCfdZEh.js";import{b as pa,t as he,e as ne,a as gt,v as bo}from"./routePaths-DhV05MHP.js";import{u as Q}from"./useAskAiCfoHostNavButtonProps-BYwM8iQc.js";import{c as we,b as Co}from"./useFetchSuggestedQuestionsWhenReady-CLFroGaE.js";import ye from"./NotFoundScreen-CojoL2wq.js";import{t as ha}from"./analyticsHelper-CwPfLmD8.js";import{C as _o}from"./CompanyPassportScreen-D2jISk-U.js";import{F as ko}from"./FeaturePreviewScreen-Xv2JpkA8.js";import{R as So}from"./ReferralListScreen-8R81rrOx.js";import"./recharts-D6qS-pdV.js";import"./analytics-CQOsvcBG.js";import"./plaid-D8caW90M.js";import"./dnd-DKCsG5d8.js";import"./stripe-DMRn4zHo.js";import"./lottie-CLMz6y3A.js";import"./lexical-DT64qE89.js";import"./pdf-CUf9xopY.js";import"./utils-zvjLmBW4.js";import"./TransactionDetailScreen-ByHgtPQ5.js";import"./decodeURIComponentSafe-CZEzMrgK.js";import"./MobileAppDrawer-CMz8hWRn.js";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},a=new e.Error().stack;a&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[a]="1d63f681-95ae-4bc5-946d-468f775ef028",e._sentryDebugIdIdentifier="sentry-dbid-1d63f681-95ae-4bc5-946d-468f775ef028")}catch{}})();const yo=ma(function({openTransactionPanel:e,panelContent:a,sidePanelIsOpen:t,sidePanelIsFullView:n}){const{vendorId:o,reportDate:r}=z(),s=R.getSignedInUser(),i=S(x=>x.tenantState.currentTenantId),d=S(x=>L(x)),{tenantEmailDomain:p}=z(),C=K(),g=d?.companyName??"",u={userId:s?.userId??"",sessionId:s?.zeniSessionId??"",tenantId:i??""},c=b.useMemo(()=>({authParams:u,companyName:g,downloadEndPoint:`${J}/agingDetailedReport`,timezone:Me()}),[]),m=b.useMemo(()=>r!=null?Ut(r):ue(),[r]),h=V(),f=q(),k=S(x=>Ka(x,m,o)),y=b.useCallback(()=>{o!=null&&k.fetchState!=="In-Progress"&&k.fetchState!=="Completed"&&h(qa(o,m))},[m]),_=b.useCallback(()=>{f("../../",{relative:"path"})},[]),A=b.useCallback((x,P)=>{h(xt({sortKey:x,sortOrder:P}))},[]),E=b.useCallback(x=>{h(xt({downloadState:x}))},[]),M=b.useCallback(x=>{if(e)e(x.transactionId,x.transactionType);else if(p!=null){const P=pa({id:x.transactionId,type:x.transactionType},p);f(P);const fe=D(C.state?.pathnameStackToGoBack,C.pathname);f(P,{state:{pathnameStackToGoBack:fe}})}},[p,e]),F=b.useCallback(()=>{k.vendor!=null&&I.trackApAgingDetail("AP Aging",m.format($.getLocalizedStrings().dateFormat.analytics.YYYYDashMMDashDDFormat),k.vendor.id,k.vendor.name)},[k.vendor,m]);return b.useEffect(()=>{y()},[]),b.useEffect(()=>{k.fetchState==="Completed"&&F()},[F,k.fetchState]),l.jsx(Xn,{apAgingDetail:k,downloadParams:c,reportDate:m,analytics:I,onTransactionClick:M,onReload:y,onBackClick:_,onColumnSortConfigChanged:A,updateDownloadStateHandler:E,panelContent:a,sidePanelIsOpen:t,sidePanelIsFullView:n})}),Ao=()=>{const e=V(),a=q(),t=S(A=>Za(A)),{isAiCfoAccessEnabled:n,onAskAiCfoClick:o}=Q({mobileExploreReferrer:"AP Aging"});we({isDataReady:t.fetchState==="Completed"});const r=R.getSignedInUser(),s=S(A=>A.tenantState.currentTenantId),i=S(A=>L(A)),d=i?.companyName??"",p={userId:r?.userId??"",sessionId:r?.zeniSessionId??"",tenantId:s??""},C=b.useMemo(()=>({authParams:p,companyName:d,downloadEndPoint:`${J}/agingReport`,timezone:Me()}),[]),g=t.apAgingUIState.selectedDate??ue(),u=b.useCallback(()=>{t.fetchState!=="In-Progress"&&t.fetchState!=="Completed"&&e(nt(g))},[]);b.useEffect(()=>{u()},[]);const c=b.useCallback(()=>{a("../",{relative:"path"})},[]),m=b.useCallback(A=>{e(Re({searchString:A}))},[]),h=b.useCallback((A,E)=>{e(Re({sortKey:E,sortOrder:A}))},[]),f=b.useCallback(A=>{a(`./${A}/${g.format($.getLocalizedStrings().dateFormat.analytics.YYYYDashMMDashDDFormat)}`)},[g]),k=b.useCallback(A=>{e(Re({downloadState:A}))},[]),y=b.useCallback((A,E)=>{},[]),_=b.useCallback((A,E)=>{e(Re({selectedDate:A,agingDateSelectionType:E})),e(nt(A))},[]);return l.jsxs(l.Fragment,{children:[t.fetchState==="Completed"?l.jsx(xe,{analytics:I,onLoad:A=>A.trackPageLoaded(G.Event.agingReport,"AP Aging")}):null,l.jsx(ia,{uiState:t.apAgingUIState,report:t,downloadParams:C,analytics:I,onReloadReport:u,onBackClick:c,onSearchTextChange:m,onSortOrderChange:h,onEntityNameClick:f,updateDownloadStateHandler:k,onSelectedDateChanged:_,onNodeCollapseToggled:y,isAiCfoAccessEnabled:n,onAskAiCfoClick:o})]})},vo=ma(function({openTransactionPanel:e,panelContent:a,sidePanelIsOpen:t,sidePanelIsFullView:n}){const{customerId:o,reportDate:r}=z(),s=R.getSignedInUser(),i=S(F=>L(F)),{tenantEmailDomain:d}=z(),p=K(),C=i.companyName,g={userId:s?.userId??"",sessionId:s?.zeniSessionId??"",tenantId:i.tenantId},u=b.useMemo(()=>({authParams:g,companyName:C,downloadEndPoint:`${J}/agingDetailedReport`,timezone:Me()}),[]),c=b.useMemo(()=>r!=null?Ut(r):ue(),[r]),m=V(),h=q(),f=S(F=>Ha(F,c,o)),k=b.useCallback(()=>{o!=null&&f.fetchState!=="In-Progress"&&f.fetchState!=="Completed"&&m(Ja(o,c))},[c]),y=b.useCallback(()=>{h("../../",{relative:"path"})},[]),_=b.useCallback((F,x)=>{m(Tt({sortKey:F,sortOrder:x}))},[]),A=b.useCallback(F=>{m(Tt({downloadState:F}))},[]),E=b.useCallback(F=>{if(e)e(F.transactionId,F.transactionType);else if(d!=null){const x=pa({id:F.transactionId,type:F.transactionType},d);h(x);const P=D(p.state?.pathnameStackToGoBack,p.pathname);h(x,{state:{pathnameStackToGoBack:P}})}},[d,e]),M=b.useCallback(()=>{f.customer!=null&&I.trackArAgingDetail("AR Aging",c.format($.getLocalizedStrings().dateFormat.analytics.YYYYDashMMDashDDFormat),f.customer.id,f.customer.name)},[f.customer,c]);return b.useEffect(()=>{k()},[]),b.useEffect(()=>{f.fetchState==="Completed"&&M()},[f.fetchState,M]),l.jsx(eo,{arAgingDetail:f,downloadParams:u,reportDate:c,analytics:I,onTransactionClick:E,onReload:k,onBackClick:y,onColumnSortConfigChanged:_,updateDownloadStateHandler:A,panelContent:a,sidePanelIsOpen:t,sidePanelIsFullView:n})}),Io=()=>{const e=V(),a=q(),t=S(_=>Qa(_)),{isAiCfoAccessEnabled:n,onAskAiCfoClick:o}=Q({mobileExploreReferrer:"AR Aging"});we({isDataReady:t.fetchState==="Completed"});const r=R.getSignedInUser(),s=S(_=>L(_)),i=s.companyName,d={userId:r?.userId??"",sessionId:r?.zeniSessionId??"",tenantId:s.tenantId},p=b.useMemo(()=>({authParams:d,companyName:i,downloadEndPoint:`${J}/agingReport`,timezone:Me()}),[]),C=t.arAgingUIState.selectedDate??ue(),g=b.useCallback(()=>{t.fetchState!=="In-Progress"&&t.fetchState!=="Completed"&&e(ot(C))},[]);b.useEffect(()=>{g()},[]);const u=b.useCallback(()=>{a("../",{relative:"path"})},[]),c=b.useCallback(_=>{e(Le({searchString:_}))},[]),m=b.useCallback((_,A)=>{e(Le({sortKey:A,sortOrder:_}))},[]),h=b.useCallback(_=>{a(`./${_}/${C.format($.getLocalizedStrings().dateFormat.analytics.YYYYDashMMDashDDFormat)}`)},[C]),f=b.useCallback(_=>{e(Le({downloadState:_}))},[]),k=b.useCallback((_,A)=>{e(Le({selectedDate:_,agingDateSelectionType:A})),e(ot(_))},[]),y=b.useCallback((_,A)=>{e(Wa({nodeId:_,isCollapsed:A}))},[]);return l.jsxs(l.Fragment,{children:[t.fetchState==="Completed"?l.jsx(xe,{analytics:I,onLoad:_=>_.trackPageLoaded(G.Event.agingReport,"AR Aging")}):null,l.jsx(ia,{uiState:t.arAgingUIState,report:t,downloadParams:p,analytics:I,onReloadReport:g,onBackClick:u,onSearchTextChange:c,onSortOrderChange:m,onEntityNameClick:h,updateDownloadStateHandler:f,onSelectedDateChanged:k,onNodeCollapseToggled:y,isAiCfoAccessEnabled:n,onAskAiCfoClick:o})]})},fa=(e,a)=>({key:a,title:e.accountName,amount:e.balance?.available,logoUri:e.logo?.toString(),source:e});function ga(e,a){const t=tn(a.firstMonthOfFY);return{onItemClick:(n,o)=>{const r=o.accountName===""?o.accountDescription:o.accountName,s=he(a.tenantEmailDomain,o.accountId,o.accountType,r,"quarter",t,!1),i=D(a.location.state?.pathnameStackToGoBack,a.location.pathname);a.navigate(s,{state:{pathnameStackToGoBack:i,referrer:a.referrerType}})},onSetAccountsStatementDate:(n,o)=>{e(an(n,o))},onPromoCardBtnClick:n=>{if(a.isZeniAccountsAdmin){let o=`../../checking/${n}`;n?I.trackZeniAccountsCashBalancePromoClicked("Move Money"):(I.trackZeniAccountsCashBalancePromoClicked("Sign Up for Free"),o="../../checking/promo");const r=D(a.location.state?.pathnameStackToGoBack,a.location.pathname);a.navigate(o,{state:{pathnameStackToGoBack:r}})}else I.trackZeniAccountsCashBalancePromoClicked("Learn More"),window.open("https://www.zeni.ai/product/business-checking-accounts","_blank")}}}const Eo=H(function(e){const a=Xa(e).accountsInOrder.map((n,o)=>fa(n,o)),t=en(e);return{sectionTitle:$.getLocalizedStrings().balanceCard.cashBalanceSectionTitle,transactionArray:a,zeniAccountsPromoCardReport:t,fetchState:e.cashBalanceState.fetchState,analytics:I}},ga)(ca),xo=H(function(e){const a=nn(e).accountsInOrder.map((o,r)=>fa(o,r)),t=R.getSignedInUser(),n=Ae(t);return{sectionTitle:$.getLocalizedStrings().balanceCard.cardBalanceSectionTitle,transactionArray:a,isZeniUser:n,fetchState:e.cardBalanceState.fetchState,analytics:I}},ga)(ca);function To(){const e=q(),a=K(),{tenantEmailDomain:t}=z(),n=Te(),o=S(s=>L(s).company?.companyInfo.firstMonthOfFY??1),r=rt(n?.loggedInUserRoleMap);return S(s=>s.cashBalanceState.fetchState)==="Error"?l.jsx(ye,{}):l.jsx(Eo,{tenantEmailDomain:t,location:a,referrerType:"Cash Balance",navigate:e,isZeniAccountsAdmin:r,firstMonthOfFY:o})}function wo(){const e=q(),a=K(),{tenantEmailDomain:t}=z(),n=Te(),o=rt(n?.loggedInUserRoleMap),r=S(s=>L(s).company?.companyInfo.firstMonthOfFY??1);return S(s=>s.cardBalanceState.fetchState)==="Error"?l.jsx(ye,{}):l.jsx(xo,{tenantEmailDomain:t,location:a,referrerType:"Card Balance",navigate:e,isZeniAccountsAdmin:o,firstMonthOfFY:r})}const Do=ft.div`
|
|
2
2
|
display: flex;
|
|
3
3
|
flex: 1 1 auto;
|
|
4
4
|
min-height: 100%;
|
|
@@ -10,11 +10,11 @@ import{j as l}from"./liveblocks-D_qjMTev.js";import{l as K,g as S,u as z,h as G,
|
|
|
10
10
|
flex-direction: column;
|
|
11
11
|
align-items: center;
|
|
12
12
|
background-color: ${e=>e.theme.colors.grey4};
|
|
13
|
-
`;function Oo({title:e,reportId:a,entityAutoCompleteView:t,autoCompleteText:n,isAiCfoAccessEnabled:o,onAskAiCfoClick:r}){const s=q(),i=G(),d=z(),{tenantEmailDomain:p}=K(),C=to();return l.jsxs(Do,{children:[l.jsx(ao,{source:a==="cash_balance"?"CashBalanceDetailScreen":"CardBalanceDetailScreen",title:e,onBackClick:()=>{s("../")},hideSearchBtn:!0,backgroundColor:C.colors.grey4,searchAutoComplete:{autoCompleteData:{entityAutoCompleteView:t,autoCompleteText:n},autoCompleteActions:{onAutoCompleteInputChange:g=>{g.trim().length>=2?i(te({searchString:g,searchOrigin:"navbar"})):g.trim().length===0&&i(Z("navbar"))},onAutoCompleteEntity:g=>{n!=null&&I?.trackSearch(V.Event.search,Po(a),g.type,g.name,n);const u=ne(g,p),c=D(d.state?.pathnameStackToGoBack,d.pathname);s(u,{state:{pathnameStackToGoBack:c}})}}},rightSideComponent:l.jsx(no,{isAiCfoAccessEnabled:o,onAskAiCfoClick:r})}),l.jsx(Fo,{children:a==="cash_balance"?l.jsx(To,{}):l.jsx(wo,{})})]})}function Ot(){const e=z(),a=G(),{useFeatureGate:t}=Ye(),{isFeatureEnabled:n}=t(L.isDepositAccountsFeatureEnabled),o=S(h=>h.cashBalanceState.fetchState),r=S(h=>h.cardBalanceState.fetchState),s=R.getSignedInUser();if(s==null)throw Error("Can't access dashboard detail without signing in...");const i=Yt((h=>{const f=Vt(h,"/").split("/");return f[f.length-1]})(e.pathname));let d="Not-Started",p="";const C=$.getLocalizedStrings();switch(i){case"cash_balance":d=o,p=C.reportTitleById.cash_balance;break;case"card_balance":d=r,p=C.reportTitleById.card_balance;break;default:console.error(`${i} is not supported!`)}const{isAiCfoAccessEnabled:g,onAskAiCfoClick:u}=Q({mobileExploreReferrer:i==="card_balance"?"Card Balance":"Cash Balance"});we({isDataReady:d==="Completed"});const c=S(h=>h.entityAutoCompleteState.autoCompleteText.navbar),m=S(h=>ee(h,"navbar"));return b.useEffect(()=>{d==="Not-Started"&&function(h,f,k){switch(f){case"card_balance":h(Kt());break;case"cash_balance":h(Nt()),k===!0&&h(Gt());break;default:throw new Error(`balance report type ${f} is not yet supported`)}}(a,i,n)},[s,a,d]),l.jsxs(l.Fragment,{children:[d==="Completed"?l.jsx(xe,{analytics:I,onLoad:h=>((f,k)=>{switch(k){case"card_balance":f.trackPageLoaded(V.Event.cardBalance);break;case"cash_balance":f.trackPageLoaded(V.Event.cashBalance);break;default:console.error(`Analytics: Not tracking Page Loaded for ${k}!`)}})(h,i)}):null,l.jsx(Oo,{title:p,reportId:i,autoCompleteText:c,entityAutoCompleteView:m,isAiCfoAccessEnabled:g,onAskAiCfoClick:u})]})}const Po=e=>{switch(e){case"cash_balance":return"Cash Balance";case"card_balance":return"Card Balance";default:return"Dashboard"}},Bo=[];function De(e){const{mobileExploreReferrer:a}=e,t=G(),n=q(),o=z(),{tenantEmailDomain:r}=K(),{setIsAiCfoOpen:s,setAiCfoSidePanelQuestionToSubmit:i}=la(),d=oo(),p=lo(d),C=$a(),g=S(P=>on(P)),u=g.uiState?.currentChatSessionId,c=g.allSessionsWithOrderedQuestionAnswers??Bo,m=R.getSignedInUser()?.userId,h=da(),f=Co()&&h&&r!=null,k=so(),y=ro(k),{useDynamicConfig:_}=Ye(),{configValue:A}=_(ua.aiCfoMessageDynamicConfig),E=b.useMemo(()=>Array.isArray(A.default_message_list)?A.default_message_list:[],[A.default_message_list]),M=b.useMemo(()=>(y!=null&&y.length>0?y:E).slice(0,2),[E,y]),F=b.useCallback((P,fe)=>{if(m==null||P.trim()==="")return;const ge=io(C.getState());if(p){const Oe=D(o.state?.pathnameStackToGoBack,o.pathname);n(`/${r}/ai-cfo/explore`,{state:{message:"",origin:"",pathnameStackToGoBack:Oe,referrer:a,aiCfoInitialQuestion:P,aiCfoShouldSubmit:!ge}})}else{if(ge)return t(sn(P)),void s(!0);i(P),s(!0),co(t,P,"insights_section",u,c,m,fe,void 0)}},[c,u,t,p,o.pathname,o.state,a,n,s,i,C,r,m]),x=b.useCallback(()=>{if(p){const P=D(o.state?.pathnameStackToGoBack,o.pathname);n(`/${r}/ai-cfo/explore`,{state:{message:"",origin:"",pathnameStackToGoBack:P,referrer:a}})}else s(!0)},[p,o.pathname,o.state,a,n,s,r]);return b.useMemo(()=>{if(f)return{onAskSomethingElseClick:x,onSuggestedQuestionClick:F,suggestedQuestions:M}},[f,x,F,M])}const Fe=uo,Ro=H(function(e){const a=rn(e),t=cn(e),n=$t(e),{scrollPosition:o,...r}=n,s=$.getLocalizedStrings().reportTitleById.cash_in_cash_out,i=R.getSignedInUser(),d=e.tenantState.currentTenantId,p=j(e),C=p?.companyName??"",g={userId:i?.userId??"",sessionId:i?.zeniSessionId??"",tenantId:d??""},u=e.entityAutoCompleteState.autoCompleteText.navbar,c=ee(e,"navbar");return{selectedRangeReport:a,reportLabels:{reportTitle:s},highlightedRangeReport:t,uiState:r,scrollPosition:o,downloadParams:{downloadState:a.downloadState,currentTenantCompanyName:C,statementEndPoint:`${J}/statement`,authParams:g},analytics:I,autoCompleteData:{autoCompleteText:u,entityAutoCompleteView:c}}},function(e,a){return{updateDownloadStateHandler:t=>{e(ln(t))},onTimeframeSelectionChanged:()=>{},onCOABalancesRangeChanged:(t,n)=>{e(Ee(t,n)),e(be({resetLeftScroll:!0}))},onThisPeriodChanged:t=>{e(me("month")),e(ae(a.firstMonthOfFY,t)),e(be({resetLeftScroll:!0}))},onAdditionalBalanceSelectionChanged:(t,n,o)=>{e(ve(a.firstMonthOfFY,t,o,n)),n.length>0&&e(Ie(a.firstMonthOfFY,n.includes("this_period_vs_last_period")?"compare_mode_amount":"compare_mode_percent",o,n)),a.isCompareModeOn!==t&&setTimeout(()=>e(be({resetLeftScroll:!0})),50)},onElementCollapseStateChanged:(t,n)=>{e(be({nodeCollapseState:{nodeId:t,isCollapsed:n}}))},onTableScroll:t=>{e(be({scrollPosition:t}))},autoCompleteActions:{onAutoCompleteInputChange:t=>{t.trim().length>=2?e(te({searchString:t,searchOrigin:"navbar"})):t.trim().length===0&&e(Z("navbar"))},onAutoCompleteEntity:t=>{const n=ne(t,a.tenantEmailDomain),o=D(a.location.state?.pathnameStackToGoBack,a.location.pathname);a.navigate(n,{state:{pathnameStackToGoBack:o}})}},onBackClick:()=>{a.navigate("../")}}})(Fe),jo=e=>{const{tenantEmailDomain:a,location:t,navigate:n}=e,{isAiCfoAccessEnabled:o,onAskAiCfoClick:r}=Q({mobileExploreReferrer:"DashboardCashInCashOut"}),s=De({mobileExploreReferrer:"DashboardCashInCashOut"}),i=S(d=>$t(d)).mode==="compare_mode";return l.jsx(Ro,{firstMonthOfFY:e.firstMonthOfFY,tenantEmailDomain:a,location:t,isCompareModeOn:i,navigate:n,insightsSectionAiCfoInfo:s,isAiCfoAccessEnabled:o,onAskAiCfoClick:r})},Lo=e=>{let a,t;switch(e.balanceTimeFrame){case"month":case"quarter":a=e.balanceTimeFrame,t=Ue(e);break;case"year":a="quarter",t={startDate:e.endDate.startOf("quarter"),endDate:e.endDate};break;case"free_range":console.error("free_range timeframe is not supported!")}return{timeframe:a,timePeriod:t}},Mo=H(function(e){const a=dn(e),t=un(e),n=zt(e),{scrollPosition:o,...r}=n,s=$.getLocalizedStrings().reportTitleById.cash_position,i=R.getSignedInUser(),d=e.tenantState.currentTenantId,p=j(e),C=p?.companyName??"",g={userId:i?.userId??"",sessionId:i?.zeniSessionId??"",tenantId:d??""},u=e.entityAutoCompleteState.autoCompleteText.navbar,c=ee(e,"navbar");return{selectedRangeReport:a,reportLabels:{reportTitle:s},highlightedRangeReport:t,uiState:r,scrollPosition:o,downloadParams:{downloadState:a.downloadState,currentTenantCompanyName:C,statementEndPoint:`${J}/statement`,authParams:g},analytics:I,autoCompleteData:{autoCompleteText:u,entityAutoCompleteView:c}}},function(e,a){return{updateDownloadStateHandler:t=>{e(mn(t))},onTimeframeSelectionChanged:t=>{e(me(t)),setTimeout(()=>e(Ce({resetLeftScroll:!0})),50)},onCOABalancesRangeChanged:(t,n)=>{e(Ee(t,n)),e(Ce({resetLeftScroll:!0}))},onThisPeriodChanged:t=>{e(ae(a.firstMonthOfFY,t)),e(Ce({resetLeftScroll:!0}))},onAdditionalBalanceSelectionChanged:(t,n,o)=>{e(ve(a.firstMonthOfFY,t,o,n)),n.length>0&&e(Ie(a.firstMonthOfFY,n.includes("this_period_vs_last_period")?"compare_mode_amount":"compare_mode_percent",o,n)),a.isCompareModeOn!==t&&setTimeout(()=>e(Ce({resetLeftScroll:!0})),50)},onAccountBalanceClick:(t,n)=>{const{timePeriod:o,timeframe:r}=Lo(n),s=t.accountName===""?t.accountDescription:t.accountName;if(o!=null&&r!=null){const i=he(a.tenantEmailDomain,t.accountId,t.accountType,s,r,o),d=D(a.location.state?.pathnameStackToGoBack,a.location.pathname);a.navigate(i,{state:{pathnameStackToGoBack:d,referrer:"Cash Position"}})}},autoCompleteActions:{onAutoCompleteInputChange:t=>{t.trim().length>=2?e(te({searchString:t,searchOrigin:"navbar"})):t.trim().length===0&&e(Z("navbar"))},onAutoCompleteEntity:t=>{const n=ne(t,a.tenantEmailDomain),o=D(a.location.state?.pathnameStackToGoBack,a.location.pathname);a.navigate(n,{state:{pathnameStackToGoBack:o}})}},onTableScroll:t=>{e(Ce({scrollPosition:t}))},onBackClick:()=>{a.navigate("../")}}})(Fe),Uo=e=>{const{tenantEmailDomain:a,location:t,navigate:n}=e,{isAiCfoAccessEnabled:o,onAskAiCfoClick:r}=Q({mobileExploreReferrer:"DashboardCashPosition"}),s=De({mobileExploreReferrer:"DashboardCashPosition"}),i=S(d=>zt(d)).mode==="compare_mode";return l.jsx(Mo,{firstMonthOfFY:e.firstMonthOfFY,tenantEmailDomain:a,location:t,isCompareModeOn:i,navigate:n,insightsSectionAiCfoInfo:s,isAiCfoAccessEnabled:o,onAskAiCfoClick:r})},N=(e,a,t,n)=>{e===!1?a!=null&&n("../../",{relative:"path"}):a!=t&&(a!=null&&a.length>0?n(`../${t}`,{replace:!0}):n(`./forecast/${t}`,{replace:!0}))};function Je(){return l.jsxs(at,{children:[l.jsx(w,{path:"/",element:l.jsx(X,{})}),l.jsx(w,{path:"/:forecastId",element:l.jsx(X,{})}),l.jsx(w,{path:"/:forecastId/*",element:l.jsx(ye,{})})]})}const Yo=e=>{let a,t;switch(e.balanceTimeFrame){case"month":case"quarter":a=e.balanceTimeFrame,t=Ue(e);break;case"year":a="quarter",t={startDate:e.endDate.startOf("quarter"),endDate:e.endDate};break;case"free_range":console.error("free_range timeframe is not supported!")}return{timeframe:a,timePeriod:t}},Vo=H(function(e){const a=qt(e),t=pn(e),n=hn(e),o=fn(e),r=it(e),{scrollPosition:s,...i}=r,d=t.reportTitle,p=R.getSignedInUser(),C=e.tenantState.currentTenantId,g=j(e),u=g?.companyName??"",c={userId:p?.userId??"",sessionId:p?.zeniSessionId??"",tenantId:C??""},m=e.entityAutoCompleteState.autoCompleteText.navbar,h=ee(e,"navbar"),f=ct(g);return{selectedRangeReport:a,selectedClassesViewRangeReport:n,reportLabels:{reportTitle:d},highlightedRangeReport:t,highlightedClassesViewRangeReport:o,uiState:i,scrollPosition:s,downloadParams:{downloadState:a.downloadState,currentTenantCompanyName:u,statementEndPoint:`${J}/statement`,authParams:c},analytics:I,isZeniUser:Ae(p),autoCompleteData:{autoCompleteText:m,entityAutoCompleteView:h},isZeniCOAUsed:f,isAccountingClassesEnabled:pe(e)}},function(e,a){return{updateDownloadStateHandler:t=>{e(Cn(t))},onTimeframeSelectionChanged:t=>{e(me(t)),setTimeout(()=>e(se({resetLeftScroll:!0})),50)},onCOABalancesRangeChanged:(t,n)=>{e(Ee(t,n)),e(se({resetLeftScroll:!0}))},onThisPeriodChanged:t=>{e(ae(a.firstMonthOfFY,t)),e(se({resetLeftScroll:!0}))},onAdditionalBalanceSelectionChanged:(t,n,o)=>{e(ve(a.firstMonthOfFY,t,o,n)),n.length>0&&(e(Ie(a.firstMonthOfFY,n.includes("this_period_vs_last_period")?"compare_mode_amount":"compare_mode_percent",o,n)),a.forecastIdFromUrlPath!=null&&t==1&&N(!1,a.forecastIdFromUrlPath,"",a.navigate)),a.isCompareModeOn!==t&&setTimeout(()=>e(se({resetLeftScroll:!0})),50)},onAccountBalanceClick:(t,n)=>{const{timePeriod:o,timeframe:r}=Yo(n);if(o!=null&&r!=null){const s=t.accountName===""?t.accountDescription:t.accountName,i=t.classesViewParentId!=null&&t.classesViewParentId.parentClassId!=null?gt(a.tenantEmailDomain,t.accountId,t.accountType,t.classesViewParentId.parentClassId?.[0],s,r,o):he(a.tenantEmailDomain,t.accountId,t.accountType,s,r,o),d=D(a.location.state?.pathnameStackToGoBack,a.location.pathname);a.navigate(i,{state:{pathnameStackToGoBack:d,referrer:"Burn Rate"}})}},onElementCollapseStateChanged:(t,n)=>{e(se({nodeCollapseState:{nodeId:t,isCollapsed:n}}))},onTableScroll:t=>{e(se({scrollPosition:t}))},autoCompleteActions:{onAutoCompleteInputChange:t=>{t.trim().length>=2?e(te({searchString:t,searchOrigin:"navbar"})):t.trim().length===0&&e(Z("navbar"))},onAutoCompleteEntity:t=>{const n=ne(t,a.tenantEmailDomain),o=D(a.location.state?.pathnameStackToGoBack,a.location.pathname);a.navigate(n,{state:{pathnameStackToGoBack:o}})}},onBackClick:()=>{a.selectedForecastId!=null?a.navigate("../../../"):a.navigate("../")},onForecastToggle:(t,n)=>{e(le(a.firstMonthOfFY,t==="forecast_mode",t==="forecast_mode"?de:bt,n)),t==="forecast_mode"?(e(wt({viewMode:"account_group"})),e(Zt(!1,n?.id)),n!=null&&N(!0,a.forecastIdFromUrlPath,n?.id??"",a.navigate)):N(!1,a.forecastIdFromUrlPath,n?.id??"",a.navigate),e(se({resetLeftScroll:!0}))},onUpdateAccountViewMode:t=>{a.analytics?.trackGroupBySwitch(t==="classes"?"Classes":"Accounts","Burn Rate"),e(wt({viewMode:t}))},onUpdateClassesToFilterOut:t=>{e(bn({classesToFilterOut:t}))},onOpenAccountViewMode:()=>{a.isAccountingClassesEnabled&&e(gn())},onResyncReports:()=>{e(lt("net_burn_or_income_by_classes"))}}})(Fe),No=e=>{const a=G(),{tenantEmailDomain:t,location:n,navigate:o,forecastIdFromUrlPath:r}=e,{isAiCfoAccessEnabled:s,onAskAiCfoClick:i}=Q({mobileExploreReferrer:"DashboardNetBurnOrIncome"}),d=De({mobileExploreReferrer:"DashboardNetBurnOrIncome"}),p=S(_=>it(_)),C=p.isForecastModeOn,g=p.timeframe,u=p.selectedForecast?.id,c=S(_=>dt(_.forecastState,u??"")),m=S(_=>qt(_)),h=S(_=>ut(_)),f=S(_=>pe(_)),k=p.mode==="compare_mode",y=m.dataAvailable;return b.useEffect(()=>{if(u!=null&&C===!0&&(N(C,r,u,o),c!=null)){const _=c?.forecastPeriod,A=y!=null&&_.endDate.isAfter(y?.endDate)===!0?y:_;a(ae(e.firstMonthOfFY,{startDate:A.endDate.startOf(g),endDate:A?.endDate}))}},[u]),l.jsx(Vo,{firstMonthOfFY:e.firstMonthOfFY,tenantEmailDomain:t,selectedForecastId:r,forecastIdFromUrlPath:r,location:n,isAccountingClassesEnabled:f,isCompareModeOn:k,navigate:o,analytics:I,reportsResyncFetchState:h.reportsResyncFetchState,insightsSectionAiCfoInfo:d,isAiCfoAccessEnabled:s,onAskAiCfoClick:i})},Go=e=>{let a,t;switch(e.balanceTimeFrame){case"month":case"quarter":a=e.balanceTimeFrame,t=Ue(e);break;case"year":a="quarter",t={startDate:e.endDate.startOf("quarter"),endDate:e.endDate};break;case"free_range":console.error("free_range timeframe is not supported!")}return{timeframe:a,timePeriod:t}},Ko=H(function(e){const a=Ht(e),t=_n(e),n=kn(e),o=Sn(e),r=mt(e),{scrollPosition:s,...i}=r,d=$.getLocalizedStrings().reportTitleById.operating_expenses,p=R.getSignedInUser(),C=e.tenantState.currentTenantId,g=j(e),u=g?.companyName??"",c={userId:p?.userId??"",sessionId:p?.zeniSessionId??"",tenantId:C??""},m=e.entityAutoCompleteState.autoCompleteText.navbar,h=ee(e,"navbar"),f=ct(g);return{selectedRangeReport:a,selectedClassesViewRangeReport:n,reportLabels:{reportTitle:d},highlightedRangeReport:t,highlightedClassesViewRangeReport:o,uiState:i,scrollPosition:s,downloadParams:{downloadState:a.downloadState,currentTenantCompanyName:u,statementEndPoint:`${J}/statement`,authParams:c},analytics:I,isZeniUser:Ae(p),autoCompleteData:{autoCompleteText:m,entityAutoCompleteView:h},isZeniCOAUsed:f,isAccountingClassesEnabled:pe(e)}},function(e,a){return{updateDownloadStateHandler:t=>{e(vn(t))},onTimeframeSelectionChanged:t=>{e(me(t)),setTimeout(()=>e(re({resetLeftScroll:!0})),50)},onCOABalancesRangeChanged:(t,n)=>{e(Ee(t,n)),e(re({resetLeftScroll:!0}))},onThisPeriodChanged:t=>{e(ae(a.firstMonthOfFY,t)),e(re({resetLeftScroll:!0}))},onAdditionalBalanceSelectionChanged:(t,n,o)=>{e(ve(a.firstMonthOfFY,t,o,n)),n.length>0&&(e(Ie(a.firstMonthOfFY,n.includes("this_period_vs_last_period")?"compare_mode_amount":"compare_mode_percent",o,n)),a.forecastIdFromUrlPath!=null&&t==1&&N(!1,a.forecastIdFromUrlPath,"",a.navigate)),a.isCompareModeOn!==t&&setTimeout(()=>e(re({resetLeftScroll:!0})),50)},onAccountBalanceClick:a.hasTransactionAccess!==!0?void 0:(t,n)=>{const{timePeriod:o,timeframe:r}=Go(n);if(o!=null&&r!=null){const s=t.accountName===""?t.accountDescription:t.accountName,i=t.classesViewParentId!=null&&t.classesViewParentId.parentClassId!=null?gt(a.tenantEmailDomain,t.accountId,t.accountType,t.classesViewParentId.parentClassId?.[0],s,r,o):he(a.tenantEmailDomain,t.accountId,t.accountType,s,r,o),d=D(a.location.state?.pathnameStackToGoBack,a.location.pathname);a.navigate(i,{state:{pathnameStackToGoBack:d,referrer:"Operating Expenses"}})}},onElementCollapseStateChanged:(t,n)=>{e(re({nodeCollapseState:{nodeId:t,isCollapsed:n}}))},onTableScroll:t=>{e(re({scrollPosition:t}))},autoCompleteActions:{onAutoCompleteInputChange:t=>{t.trim().length>=2?e(te({searchString:t,searchOrigin:"navbar"})):t.trim().length===0&&e(Z("navbar"))},onAutoCompleteEntity:t=>{const n=ne(t,a.tenantEmailDomain),o=D(a.location.state?.pathnameStackToGoBack,a.location.pathname);a.navigate(n,{state:{pathnameStackToGoBack:o}})}},onBackClick:()=>{a.selectedForecastId!=null?a.navigate("../../../"):a.navigate("../")},onForecastToggle:(t,n)=>{e(le(a.firstMonthOfFY,t==="forecast_mode",t==="forecast_mode"?de:bt,n)),t=="forecast_mode"?(e(Dt({viewMode:"account_group"})),e(Jt(!1,n?.id)),n!=null&&N(!0,a.forecastIdFromUrlPath,n?.id??"",a.navigate)):N(!1,a.forecastIdFromUrlPath,n?.id??"",a.navigate),e(re({resetLeftScroll:!0}))},onUpdateAccountViewMode:t=>{a.analytics?.trackGroupBySwitch(t==="classes"?"Classes":"Accounts","Operating Expenses"),e(Dt({viewMode:t}))},onUpdateClassesToFilterOut:t=>{e(An({classesToFilterOut:t}))},onOpenAccountViewMode:()=>{a.isAccountingClassesEnabled&&e(yn())},onResyncReports:()=>{e(lt("operating_expenses_by_classes"))}}})(Fe),$o=e=>{const a=G(),{tenantEmailDomain:t,location:n,navigate:o,forecastIdFromUrlPath:r}=e,{isAiCfoAccessEnabled:s,onAskAiCfoClick:i}=Q({mobileExploreReferrer:"DashboardOpEx"}),d=De({mobileExploreReferrer:"DashboardOpEx"}),p=S(E=>mt(E)),C=p.isForecastModeOn,g=p.timeframe,u=p.selectedForecast?.id,c=S(E=>dt(E.forecastState,u??"")),m=S(E=>Ht(E)),h=S(E=>ut(E)),f=S(E=>pe(E)),k=p.mode==="compare_mode",y=m.dataAvailable;b.useEffect(()=>{if(u!=null&&C===!0&&(N(C,r,u,o),c!=null)){const E=c?.forecastPeriod,M=y!=null&&E.endDate.isAfter(y?.endDate)===!0?y:E;a(ae(e.firstMonthOfFY,{startDate:M.endDate.startOf(g),endDate:M?.endDate}))}},[u]);const _=Te(),A=_?.loggedInUserRole!=null&&Qt(_?.loggedInUserRole)!==!0;return l.jsx(Ko,{firstMonthOfFY:e.firstMonthOfFY,tenantEmailDomain:t,selectedForecastId:r,location:n,isAccountingClassesEnabled:f,isCompareModeOn:k,navigate:o,forecastIdFromUrlPath:r,analytics:I,hasTransactionAccess:A,reportsResyncFetchState:h.reportsResyncFetchState,insightsSectionAiCfoInfo:d,isAiCfoAccessEnabled:s,onAskAiCfoClick:i})},zo=e=>{let a,t;switch(e.balanceTimeFrame){case"month":case"quarter":a=e.balanceTimeFrame,t=Ue(e);break;case"year":a="quarter",t={startDate:e.endDate.startOf("quarter"),endDate:e.endDate};break;case"free_range":console.error("free_range timeframe is not supported!")}return{timeframe:a,timePeriod:t}},qo=H(function(e){const a=Xt(e),t=In(e),n=En(e),o=xn(e),r=pt(e),{scrollPosition:s,...i}=r,d=$.getLocalizedStrings().reportTitleById.revenue,p=R.getSignedInUser(),C=e.tenantState.currentTenantId,g=j(e),u=g?.companyName??"",c={userId:p?.userId??"",sessionId:p?.zeniSessionId??"",tenantId:C??""},m=e.entityAutoCompleteState.autoCompleteText.navbar,h=ee(e,"navbar"),f=ct(g);return{selectedRangeReport:a,selectedClassesViewRangeReport:n,reportLabels:{reportTitle:d},highlightedRangeReport:t,highlightedClassesViewRangeReport:o,uiState:i,scrollPosition:s,downloadParams:{downloadState:a.downloadState,currentTenantCompanyName:u,statementEndPoint:`${J}/statement`,authParams:c},analytics:I,isZeniUser:Ae(p),autoCompleteData:{autoCompleteText:m,entityAutoCompleteView:h},isZeniCOAUsed:f,isAccountingClassesEnabled:pe(e)}},function(e,a){return{updateDownloadStateHandler:t=>{e(Dn(t))},onTimeframeSelectionChanged:t=>{e(me(t)),setTimeout(()=>e(ie({resetLeftScroll:!0})),50)},onCOABalancesRangeChanged:(t,n)=>{e(Ee(t,n)),e(ie({resetLeftScroll:!0}))},onThisPeriodChanged:t=>{e(ae(a.firstMonthOfFY,t)),e(ie({resetLeftScroll:!0}))},onAdditionalBalanceSelectionChanged:(t,n,o)=>{e(ve(a.firstMonthOfFY,t,o,n)),n.length>0&&(e(Ie(a.firstMonthOfFY,n.includes("this_period_vs_last_period")?"compare_mode_amount":"compare_mode_percent",o,n)),a.forecastIdFromUrlPath!=null&&t==1&&N(!1,a.forecastIdFromUrlPath,"",a.navigate)),a.isCompareModeOn!==t&&setTimeout(()=>e(ie({resetLeftScroll:!0})),50)},onAccountBalanceClick:(t,n)=>{const{timePeriod:o,timeframe:r}=zo(n);if(o!=null&&r!=null){const s=t.accountName===""?t.accountDescription:t.accountName,i=t.classesViewParentId!=null&&t.classesViewParentId.parentClassId!=null?gt(a.tenantEmailDomain,t.accountId,t.accountType,t.classesViewParentId.parentClassId?.[0],s,r,o):he(a.tenantEmailDomain,t.accountId,t.accountType,s,r,o),d=D(a.location.state?.pathnameStackToGoBack,a.location.pathname);a.navigate(i,{state:{pathnameStackToGoBack:d,referrer:"Revenues"}})}},onElementCollapseStateChanged:(t,n)=>{e(ie({nodeCollapseState:{nodeId:t,isCollapsed:n}}))},onTableScroll:t=>{e(ie({scrollPosition:t}))},autoCompleteActions:{onAutoCompleteInputChange:t=>{t.trim().length>=2?e(te({searchString:t,searchOrigin:"navbar"})):t.trim().length===0&&e(Z("navbar"))},onAutoCompleteEntity:t=>{const n=ne(t,a.tenantEmailDomain),o=D(a.location.state?.pathnameStackToGoBack,a.location.pathname);a.navigate(n,{state:{pathnameStackToGoBack:o}})}},onBackClick:()=>{a.selectedForecastId!=null?a.navigate("../../../"):a.navigate("../")},onForecastToggle:(t,n)=>{e(le(a.firstMonthOfFY,t==="forecast_mode",t==="forecast_mode"?de:bt,n)),t==="forecast_mode"?(e(Ft({viewMode:"account_group"})),e(Wt(!1,n?.id)),n!=null&&N(!0,a.forecastIdFromUrlPath,n?.id??"",a.navigate)):N(!1,a.forecastIdFromUrlPath,n?.id??"",a.navigate),e(ie({resetLeftScroll:!0}))},onUpdateAccountViewMode:t=>{a.analytics?.trackGroupBySwitch(t==="classes"?"Classes":"Accounts","Revenues"),e(Ft({viewMode:t}))},onUpdateClassesToFilterOut:t=>{e(wn({classesToFilterOut:t}))},onOpenAccountViewMode:()=>{a.isAccountingClassesEnabled&&e(Tn())},onResyncReports:()=>{e(lt("revenue_by_classes"))}}})(Fe),Zo=e=>{const a=G(),{tenantEmailDomain:t,location:n,navigate:o,forecastIdFromUrlPath:r}=e,{isAiCfoAccessEnabled:s,onAskAiCfoClick:i}=Q({mobileExploreReferrer:"DashboardRevenue"}),d=De({mobileExploreReferrer:"DashboardRevenue"}),p=S(y=>pt(y)),C=p.isForecastModeOn,g=p.timeframe,u=p.selectedForecast?.id,c=S(y=>dt(y.forecastState,u??"")),m=S(y=>Xt(y)).dataAvailable,h=p.mode==="compare_mode",f=S(y=>pe(y)),k=S(y=>ut(y));return b.useEffect(()=>{if(u!=null&&C===!0&&(N(C,r,u,o),c!=null)){const y=c?.forecastPeriod,_=m!=null&&y.endDate.isAfter(m?.endDate)===!0?m:y;a(ae(e.firstMonthOfFY,{startDate:_.endDate.startOf(g),endDate:_?.endDate}))}},[u]),l.jsx(qo,{firstMonthOfFY:e.firstMonthOfFY,tenantEmailDomain:t,selectedForecastId:r,isAccountingClassesEnabled:f,isCompareModeOn:h,location:n,navigate:o,forecastIdFromUrlPath:r,analytics:I,reportsResyncFetchState:k.reportsResyncFetchState,insightsSectionAiCfoInfo:d,isAiCfoAccessEnabled:s,onAskAiCfoClick:i})},Ho=e=>{let a,t;if(e.endDate!=null)switch(e.timePeriod){case"this_month_to_date":case"last_month":case"this_week_to_date":case"last_week":a="month",t={startDate:e.endDate.startOf("month"),endDate:e.endDate};break;case"last_3_months":case"last_6_months":case"last_12_months":case"this_year_to_date":case"last_year":a="quarter",t={startDate:e.endDate.startOf("quarter"),endDate:e.endDate};break;default:console.error(`this timeperiod ${e.timePeriod} is not supported!`)}return{timeframe:a,timePeriod:t}},Jo=H(function(e){const a=Fn(e),t=e.entityAutoCompleteState.autoCompleteText.navbar,n=ee(e,"navbar");return{report:a,analytics:I,autoCompleteData:{autoCompleteText:t,entityAutoCompleteView:n}}},function(e,a){return{onTimeframeSelectionChanged:t=>{I.trackTimeframeSwitch(ha(t),"Top Expenses"),e(ea(t))},onAccountBalanceClick:(t,n)=>{const{timePeriod:o,timeframe:r}=Ho(n),s=t.accountName===""?t.accountDescription:t.accountName;if(o!=null&&r!=null){const i=he(a.tenantEmailDomain,t.accountId,t.accountType,s,r,o),d=D(a.location.state?.pathnameStackToGoBack,a.location.pathname);a.navigate(i,{state:{pathnameStackToGoBack:d,referrer:"Top Expenses"}})}},autoCompleteActions:{onAutoCompleteInputChange:t=>{t.trim().length>=2?e(te({searchString:t,searchOrigin:"navbar"})):t.trim().length===0&&e(Z("navbar"))},onAutoCompleteEntity:t=>{const n=ne(t,a.tenantEmailDomain),o=D(a.location.state?.pathnameStackToGoBack,a.location.pathname);a.navigate(n,{state:{pathnameStackToGoBack:o}})}},onBackClick:()=>{a.navigate("../")}}})(mo),Qo=e=>{const{tenantEmailDomain:a,location:t,navigate:n}=e;return l.jsx(Jo,{tenantEmailDomain:a,location:t,navigate:n})},Xo=ft.div`
|
|
13
|
+
`;function Oo({title:e,reportId:a,entityAutoCompleteView:t,autoCompleteText:n,isAiCfoAccessEnabled:o,onAskAiCfoClick:r}){const s=q(),i=V(),d=K(),{tenantEmailDomain:p}=z(),C=to();return l.jsxs(Do,{children:[l.jsx(ao,{source:a==="cash_balance"?"CashBalanceDetailScreen":"CardBalanceDetailScreen",title:e,onBackClick:()=>{s("../")},hideSearchBtn:!0,backgroundColor:C.colors.grey4,searchAutoComplete:{autoCompleteData:{entityAutoCompleteView:t,autoCompleteText:n},autoCompleteActions:{onAutoCompleteInputChange:g=>{g.trim().length>=2?i(te({searchString:g,searchOrigin:"navbar"})):g.trim().length===0&&i(Z("navbar"))},onAutoCompleteEntity:g=>{n!=null&&I?.trackSearch(G.Event.search,Po(a),g.type,g.name,n);const u=ne(g,p),c=D(d.state?.pathnameStackToGoBack,d.pathname);s(u,{state:{pathnameStackToGoBack:c}})}}},rightSideComponent:l.jsx(no,{isAiCfoAccessEnabled:o,onAskAiCfoClick:r})}),l.jsx(Fo,{children:a==="cash_balance"?l.jsx(To,{}):l.jsx(wo,{})})]})}function Ot(){const e=K(),a=V(),{useFeatureGate:t}=Ye(),{isFeatureEnabled:n}=t(j.isDepositAccountsFeatureEnabled),o=S(h=>h.cashBalanceState.fetchState),r=S(h=>h.cardBalanceState.fetchState),s=R.getSignedInUser();if(s==null)throw Error("Can't access dashboard detail without signing in...");const i=Yt((h=>{const f=Gt(h,"/").split("/");return f[f.length-1]})(e.pathname));let d="Not-Started",p="";const C=$.getLocalizedStrings();switch(i){case"cash_balance":d=o,p=C.reportTitleById.cash_balance;break;case"card_balance":d=r,p=C.reportTitleById.card_balance;break;default:console.error(`${i} is not supported!`)}const{isAiCfoAccessEnabled:g,onAskAiCfoClick:u}=Q({mobileExploreReferrer:i==="card_balance"?"Card Balance":"Cash Balance"});we({isDataReady:d==="Completed"});const c=S(h=>h.entityAutoCompleteState.autoCompleteText.navbar),m=S(h=>ee(h,"navbar"));return b.useEffect(()=>{d==="Not-Started"&&function(h,f,k){switch(f){case"card_balance":h(zt());break;case"cash_balance":h(Nt()),k===!0&&h(Vt());break;default:throw new Error(`balance report type ${f} is not yet supported`)}}(a,i,n)},[s,a,d]),l.jsxs(l.Fragment,{children:[d==="Completed"?l.jsx(xe,{analytics:I,onLoad:h=>((f,k)=>{switch(k){case"card_balance":f.trackPageLoaded(G.Event.cardBalance);break;case"cash_balance":f.trackPageLoaded(G.Event.cashBalance);break;default:console.error(`Analytics: Not tracking Page Loaded for ${k}!`)}})(h,i)}):null,l.jsx(Oo,{title:p,reportId:i,autoCompleteText:c,entityAutoCompleteView:m,isAiCfoAccessEnabled:g,onAskAiCfoClick:u})]})}const Po=e=>{switch(e){case"cash_balance":return"Cash Balance";case"card_balance":return"Card Balance";default:return"Dashboard"}},Bo=[];function De(e){const{mobileExploreReferrer:a}=e,t=V(),n=q(),o=K(),{tenantEmailDomain:r}=z(),{setIsAiCfoOpen:s,setAiCfoSidePanelQuestionToSubmit:i}=la(),d=oo(),p=lo(d),C=$a(),g=S(P=>on(P)),u=g.uiState?.currentChatSessionId,c=g.allSessionsWithOrderedQuestionAnswers??Bo,m=R.getSignedInUser()?.userId,h=da(),f=Co()&&h&&r!=null,k=so(),y=ro(k),{useDynamicConfig:_}=Ye(),{configValue:A}=_(ua.aiCfoMessageDynamicConfig),E=b.useMemo(()=>Array.isArray(A.default_message_list)?A.default_message_list:[],[A.default_message_list]),M=b.useMemo(()=>(y!=null&&y.length>0?y:E).slice(0,2),[E,y]),F=b.useCallback((P,fe)=>{if(m==null||P.trim()==="")return;const ge=io(C.getState());if(p){const Oe=D(o.state?.pathnameStackToGoBack,o.pathname);n(`/${r}/ai-cfo/explore`,{state:{message:"",origin:"",pathnameStackToGoBack:Oe,referrer:a,aiCfoInitialQuestion:P,aiCfoShouldSubmit:!ge}})}else{if(ge)return t(sn(P)),void s(!0);i(P),s(!0),co(t,P,"insights_section",u,c,m,fe,void 0)}},[c,u,t,p,o.pathname,o.state,a,n,s,i,C,r,m]),x=b.useCallback(()=>{if(p){const P=D(o.state?.pathnameStackToGoBack,o.pathname);n(`/${r}/ai-cfo/explore`,{state:{message:"",origin:"",pathnameStackToGoBack:P,referrer:a}})}else s(!0)},[p,o.pathname,o.state,a,n,s,r]);return b.useMemo(()=>{if(f)return{onAskSomethingElseClick:x,onSuggestedQuestionClick:F,suggestedQuestions:M}},[f,x,F,M])}const Fe=uo,Ro=H(function(e){const a=rn(e),t=cn(e),n=$t(e),{scrollPosition:o,...r}=n,s=$.getLocalizedStrings().reportTitleById.cash_in_cash_out,i=R.getSignedInUser(),d=e.tenantState.currentTenantId,p=L(e),C=p?.companyName??"",g={userId:i?.userId??"",sessionId:i?.zeniSessionId??"",tenantId:d??""},u=e.entityAutoCompleteState.autoCompleteText.navbar,c=ee(e,"navbar");return{selectedRangeReport:a,reportLabels:{reportTitle:s},highlightedRangeReport:t,uiState:r,scrollPosition:o,downloadParams:{downloadState:a.downloadState,currentTenantCompanyName:C,statementEndPoint:`${J}/statement`,authParams:g},analytics:I,autoCompleteData:{autoCompleteText:u,entityAutoCompleteView:c}}},function(e,a){return{updateDownloadStateHandler:t=>{e(ln(t))},onTimeframeSelectionChanged:()=>{},onCOABalancesRangeChanged:(t,n)=>{e(Ee(t,n)),e(be({resetLeftScroll:!0}))},onThisPeriodChanged:t=>{e(me("month")),e(ae(a.firstMonthOfFY,t)),e(be({resetLeftScroll:!0}))},onAdditionalBalanceSelectionChanged:(t,n,o)=>{e(ve(a.firstMonthOfFY,t,o,n)),n.length>0&&e(Ie(a.firstMonthOfFY,n.includes("this_period_vs_last_period")?"compare_mode_amount":"compare_mode_percent",o,n)),a.isCompareModeOn!==t&&setTimeout(()=>e(be({resetLeftScroll:!0})),50)},onElementCollapseStateChanged:(t,n)=>{e(be({nodeCollapseState:{nodeId:t,isCollapsed:n}}))},onTableScroll:t=>{e(be({scrollPosition:t}))},autoCompleteActions:{onAutoCompleteInputChange:t=>{t.trim().length>=2?e(te({searchString:t,searchOrigin:"navbar"})):t.trim().length===0&&e(Z("navbar"))},onAutoCompleteEntity:t=>{const n=ne(t,a.tenantEmailDomain),o=D(a.location.state?.pathnameStackToGoBack,a.location.pathname);a.navigate(n,{state:{pathnameStackToGoBack:o}})}},onBackClick:()=>{a.navigate("../")}}})(Fe),Lo=e=>{const{tenantEmailDomain:a,location:t,navigate:n}=e,{isAiCfoAccessEnabled:o,onAskAiCfoClick:r}=Q({mobileExploreReferrer:"DashboardCashInCashOut"}),s=De({mobileExploreReferrer:"DashboardCashInCashOut"}),i=S(d=>$t(d)).mode==="compare_mode";return l.jsx(Ro,{firstMonthOfFY:e.firstMonthOfFY,tenantEmailDomain:a,location:t,isCompareModeOn:i,navigate:n,insightsSectionAiCfoInfo:s,isAiCfoAccessEnabled:o,onAskAiCfoClick:r})},jo=e=>{let a,t;switch(e.balanceTimeFrame){case"month":case"quarter":a=e.balanceTimeFrame,t=Ue(e);break;case"year":a="quarter",t={startDate:e.endDate.startOf("quarter"),endDate:e.endDate};break;case"free_range":console.error("free_range timeframe is not supported!")}return{timeframe:a,timePeriod:t}},Mo=H(function(e){const a=dn(e),t=un(e),n=Kt(e),{scrollPosition:o,...r}=n,s=$.getLocalizedStrings().reportTitleById.cash_position,i=R.getSignedInUser(),d=e.tenantState.currentTenantId,p=L(e),C=p?.companyName??"",g={userId:i?.userId??"",sessionId:i?.zeniSessionId??"",tenantId:d??""},u=e.entityAutoCompleteState.autoCompleteText.navbar,c=ee(e,"navbar");return{selectedRangeReport:a,reportLabels:{reportTitle:s},highlightedRangeReport:t,uiState:r,scrollPosition:o,downloadParams:{downloadState:a.downloadState,currentTenantCompanyName:C,statementEndPoint:`${J}/statement`,authParams:g},analytics:I,autoCompleteData:{autoCompleteText:u,entityAutoCompleteView:c}}},function(e,a){return{updateDownloadStateHandler:t=>{e(mn(t))},onTimeframeSelectionChanged:t=>{e(me(t)),setTimeout(()=>e(Ce({resetLeftScroll:!0})),50)},onCOABalancesRangeChanged:(t,n)=>{e(Ee(t,n)),e(Ce({resetLeftScroll:!0}))},onThisPeriodChanged:t=>{e(ae(a.firstMonthOfFY,t)),e(Ce({resetLeftScroll:!0}))},onAdditionalBalanceSelectionChanged:(t,n,o)=>{e(ve(a.firstMonthOfFY,t,o,n)),n.length>0&&e(Ie(a.firstMonthOfFY,n.includes("this_period_vs_last_period")?"compare_mode_amount":"compare_mode_percent",o,n)),a.isCompareModeOn!==t&&setTimeout(()=>e(Ce({resetLeftScroll:!0})),50)},onAccountBalanceClick:(t,n)=>{const{timePeriod:o,timeframe:r}=jo(n),s=t.accountName===""?t.accountDescription:t.accountName;if(o!=null&&r!=null){const i=he(a.tenantEmailDomain,t.accountId,t.accountType,s,r,o),d=D(a.location.state?.pathnameStackToGoBack,a.location.pathname);a.navigate(i,{state:{pathnameStackToGoBack:d,referrer:"Cash Position"}})}},autoCompleteActions:{onAutoCompleteInputChange:t=>{t.trim().length>=2?e(te({searchString:t,searchOrigin:"navbar"})):t.trim().length===0&&e(Z("navbar"))},onAutoCompleteEntity:t=>{const n=ne(t,a.tenantEmailDomain),o=D(a.location.state?.pathnameStackToGoBack,a.location.pathname);a.navigate(n,{state:{pathnameStackToGoBack:o}})}},onTableScroll:t=>{e(Ce({scrollPosition:t}))},onBackClick:()=>{a.navigate("../")}}})(Fe),Uo=e=>{const{tenantEmailDomain:a,location:t,navigate:n}=e,{isAiCfoAccessEnabled:o,onAskAiCfoClick:r}=Q({mobileExploreReferrer:"DashboardCashPosition"}),s=De({mobileExploreReferrer:"DashboardCashPosition"}),i=S(d=>Kt(d)).mode==="compare_mode";return l.jsx(Mo,{firstMonthOfFY:e.firstMonthOfFY,tenantEmailDomain:a,location:t,isCompareModeOn:i,navigate:n,insightsSectionAiCfoInfo:s,isAiCfoAccessEnabled:o,onAskAiCfoClick:r})},N=(e,a,t,n)=>{e===!1?a!=null&&n("../../",{relative:"path"}):a!=t&&(a!=null&&a.length>0?n(`../${t}`,{replace:!0}):n(`./forecast/${t}`,{replace:!0}))};function Je(){return l.jsxs(at,{children:[l.jsx(w,{path:"/",element:l.jsx(W,{})}),l.jsx(w,{path:"/:forecastId",element:l.jsx(W,{})}),l.jsx(w,{path:"/:forecastId/*",element:l.jsx(ye,{})})]})}const Yo=e=>{let a,t;switch(e.balanceTimeFrame){case"month":case"quarter":a=e.balanceTimeFrame,t=Ue(e);break;case"year":a="quarter",t={startDate:e.endDate.startOf("quarter"),endDate:e.endDate};break;case"free_range":console.error("free_range timeframe is not supported!")}return{timeframe:a,timePeriod:t}},Go=H(function(e){const a=qt(e),t=pn(e),n=hn(e),o=fn(e),r=it(e),{scrollPosition:s,...i}=r,d=t.reportTitle,p=R.getSignedInUser(),C=e.tenantState.currentTenantId,g=L(e),u=g?.companyName??"",c={userId:p?.userId??"",sessionId:p?.zeniSessionId??"",tenantId:C??""},m=e.entityAutoCompleteState.autoCompleteText.navbar,h=ee(e,"navbar"),f=ct(g);return{selectedRangeReport:a,selectedClassesViewRangeReport:n,reportLabels:{reportTitle:d},highlightedRangeReport:t,highlightedClassesViewRangeReport:o,uiState:i,scrollPosition:s,downloadParams:{downloadState:a.downloadState,currentTenantCompanyName:u,statementEndPoint:`${J}/statement`,authParams:c},analytics:I,isZeniUser:Ae(p),autoCompleteData:{autoCompleteText:m,entityAutoCompleteView:h},isZeniCOAUsed:f,isAccountingClassesEnabled:pe(e)}},function(e,a){return{updateDownloadStateHandler:t=>{e(Cn(t))},onTimeframeSelectionChanged:t=>{e(me(t)),setTimeout(()=>e(se({resetLeftScroll:!0})),50)},onCOABalancesRangeChanged:(t,n)=>{e(Ee(t,n)),e(se({resetLeftScroll:!0}))},onThisPeriodChanged:t=>{e(ae(a.firstMonthOfFY,t)),e(se({resetLeftScroll:!0}))},onAdditionalBalanceSelectionChanged:(t,n,o)=>{e(ve(a.firstMonthOfFY,t,o,n)),n.length>0&&(e(Ie(a.firstMonthOfFY,n.includes("this_period_vs_last_period")?"compare_mode_amount":"compare_mode_percent",o,n)),a.forecastIdFromUrlPath!=null&&t==1&&N(!1,a.forecastIdFromUrlPath,"",a.navigate)),a.isCompareModeOn!==t&&setTimeout(()=>e(se({resetLeftScroll:!0})),50)},onAccountBalanceClick:(t,n)=>{const{timePeriod:o,timeframe:r}=Yo(n);if(o!=null&&r!=null){const s=t.accountName===""?t.accountDescription:t.accountName,i=t.classesViewParentId!=null&&t.classesViewParentId.parentClassId!=null?gt(a.tenantEmailDomain,t.accountId,t.accountType,t.classesViewParentId.parentClassId?.[0],s,r,o):he(a.tenantEmailDomain,t.accountId,t.accountType,s,r,o),d=D(a.location.state?.pathnameStackToGoBack,a.location.pathname);a.navigate(i,{state:{pathnameStackToGoBack:d,referrer:"Burn Rate"}})}},onElementCollapseStateChanged:(t,n)=>{e(se({nodeCollapseState:{nodeId:t,isCollapsed:n}}))},onTableScroll:t=>{e(se({scrollPosition:t}))},autoCompleteActions:{onAutoCompleteInputChange:t=>{t.trim().length>=2?e(te({searchString:t,searchOrigin:"navbar"})):t.trim().length===0&&e(Z("navbar"))},onAutoCompleteEntity:t=>{const n=ne(t,a.tenantEmailDomain),o=D(a.location.state?.pathnameStackToGoBack,a.location.pathname);a.navigate(n,{state:{pathnameStackToGoBack:o}})}},onBackClick:()=>{a.selectedForecastId!=null?a.navigate("../../../"):a.navigate("../")},onForecastToggle:(t,n)=>{e(le(a.firstMonthOfFY,t==="forecast_mode",t==="forecast_mode"?de:bt,n)),t==="forecast_mode"?(e(wt({viewMode:"account_group"})),e(Zt(!1,n?.id)),n!=null&&N(!0,a.forecastIdFromUrlPath,n?.id??"",a.navigate)):N(!1,a.forecastIdFromUrlPath,n?.id??"",a.navigate),e(se({resetLeftScroll:!0}))},onUpdateAccountViewMode:t=>{a.analytics?.trackGroupBySwitch(t==="classes"?"Classes":"Accounts","Burn Rate"),e(wt({viewMode:t}))},onUpdateClassesToFilterOut:t=>{e(bn({classesToFilterOut:t}))},onOpenAccountViewMode:()=>{a.isAccountingClassesEnabled&&e(gn())},onResyncReports:()=>{e(lt("net_burn_or_income_by_classes"))}}})(Fe),No=e=>{const a=V(),{tenantEmailDomain:t,location:n,navigate:o,forecastIdFromUrlPath:r}=e,{isAiCfoAccessEnabled:s,onAskAiCfoClick:i}=Q({mobileExploreReferrer:"DashboardNetBurnOrIncome"}),d=De({mobileExploreReferrer:"DashboardNetBurnOrIncome"}),p=S(_=>it(_)),C=p.isForecastModeOn,g=p.timeframe,u=p.selectedForecast?.id,c=S(_=>dt(_.forecastState,u??"")),m=S(_=>qt(_)),h=S(_=>ut(_)),f=S(_=>pe(_)),k=p.mode==="compare_mode",y=m.dataAvailable;return b.useEffect(()=>{if(u!=null&&C===!0&&(N(C,r,u,o),c!=null)){const _=c?.forecastPeriod,A=y!=null&&_.endDate.isAfter(y?.endDate)===!0?y:_;a(ae(e.firstMonthOfFY,{startDate:A.endDate.startOf(g),endDate:A?.endDate}))}},[u]),l.jsx(Go,{firstMonthOfFY:e.firstMonthOfFY,tenantEmailDomain:t,selectedForecastId:r,forecastIdFromUrlPath:r,location:n,isAccountingClassesEnabled:f,isCompareModeOn:k,navigate:o,analytics:I,reportsResyncFetchState:h.reportsResyncFetchState,insightsSectionAiCfoInfo:d,isAiCfoAccessEnabled:s,onAskAiCfoClick:i})},Vo=e=>{let a,t;switch(e.balanceTimeFrame){case"month":case"quarter":a=e.balanceTimeFrame,t=Ue(e);break;case"year":a="quarter",t={startDate:e.endDate.startOf("quarter"),endDate:e.endDate};break;case"free_range":console.error("free_range timeframe is not supported!")}return{timeframe:a,timePeriod:t}},zo=H(function(e){const a=Ht(e),t=_n(e),n=kn(e),o=Sn(e),r=mt(e),{scrollPosition:s,...i}=r,d=$.getLocalizedStrings().reportTitleById.operating_expenses,p=R.getSignedInUser(),C=e.tenantState.currentTenantId,g=L(e),u=g?.companyName??"",c={userId:p?.userId??"",sessionId:p?.zeniSessionId??"",tenantId:C??""},m=e.entityAutoCompleteState.autoCompleteText.navbar,h=ee(e,"navbar"),f=ct(g);return{selectedRangeReport:a,selectedClassesViewRangeReport:n,reportLabels:{reportTitle:d},highlightedRangeReport:t,highlightedClassesViewRangeReport:o,uiState:i,scrollPosition:s,downloadParams:{downloadState:a.downloadState,currentTenantCompanyName:u,statementEndPoint:`${J}/statement`,authParams:c},analytics:I,isZeniUser:Ae(p),autoCompleteData:{autoCompleteText:m,entityAutoCompleteView:h},isZeniCOAUsed:f,isAccountingClassesEnabled:pe(e)}},function(e,a){return{updateDownloadStateHandler:t=>{e(vn(t))},onTimeframeSelectionChanged:t=>{e(me(t)),setTimeout(()=>e(re({resetLeftScroll:!0})),50)},onCOABalancesRangeChanged:(t,n)=>{e(Ee(t,n)),e(re({resetLeftScroll:!0}))},onThisPeriodChanged:t=>{e(ae(a.firstMonthOfFY,t)),e(re({resetLeftScroll:!0}))},onAdditionalBalanceSelectionChanged:(t,n,o)=>{e(ve(a.firstMonthOfFY,t,o,n)),n.length>0&&(e(Ie(a.firstMonthOfFY,n.includes("this_period_vs_last_period")?"compare_mode_amount":"compare_mode_percent",o,n)),a.forecastIdFromUrlPath!=null&&t==1&&N(!1,a.forecastIdFromUrlPath,"",a.navigate)),a.isCompareModeOn!==t&&setTimeout(()=>e(re({resetLeftScroll:!0})),50)},onAccountBalanceClick:a.hasTransactionAccess!==!0?void 0:(t,n)=>{const{timePeriod:o,timeframe:r}=Vo(n);if(o!=null&&r!=null){const s=t.accountName===""?t.accountDescription:t.accountName,i=t.classesViewParentId!=null&&t.classesViewParentId.parentClassId!=null?gt(a.tenantEmailDomain,t.accountId,t.accountType,t.classesViewParentId.parentClassId?.[0],s,r,o):he(a.tenantEmailDomain,t.accountId,t.accountType,s,r,o),d=D(a.location.state?.pathnameStackToGoBack,a.location.pathname);a.navigate(i,{state:{pathnameStackToGoBack:d,referrer:"Operating Expenses"}})}},onElementCollapseStateChanged:(t,n)=>{e(re({nodeCollapseState:{nodeId:t,isCollapsed:n}}))},onTableScroll:t=>{e(re({scrollPosition:t}))},autoCompleteActions:{onAutoCompleteInputChange:t=>{t.trim().length>=2?e(te({searchString:t,searchOrigin:"navbar"})):t.trim().length===0&&e(Z("navbar"))},onAutoCompleteEntity:t=>{const n=ne(t,a.tenantEmailDomain),o=D(a.location.state?.pathnameStackToGoBack,a.location.pathname);a.navigate(n,{state:{pathnameStackToGoBack:o}})}},onBackClick:()=>{a.selectedForecastId!=null?a.navigate("../../../"):a.navigate("../")},onForecastToggle:(t,n)=>{e(le(a.firstMonthOfFY,t==="forecast_mode",t==="forecast_mode"?de:bt,n)),t=="forecast_mode"?(e(Dt({viewMode:"account_group"})),e(Jt(!1,n?.id)),n!=null&&N(!0,a.forecastIdFromUrlPath,n?.id??"",a.navigate)):N(!1,a.forecastIdFromUrlPath,n?.id??"",a.navigate),e(re({resetLeftScroll:!0}))},onUpdateAccountViewMode:t=>{a.analytics?.trackGroupBySwitch(t==="classes"?"Classes":"Accounts","Operating Expenses"),e(Dt({viewMode:t}))},onUpdateClassesToFilterOut:t=>{e(An({classesToFilterOut:t}))},onOpenAccountViewMode:()=>{a.isAccountingClassesEnabled&&e(yn())},onResyncReports:()=>{e(lt("operating_expenses_by_classes"))}}})(Fe),$o=e=>{const a=V(),{tenantEmailDomain:t,location:n,navigate:o,forecastIdFromUrlPath:r}=e,{isAiCfoAccessEnabled:s,onAskAiCfoClick:i}=Q({mobileExploreReferrer:"DashboardOpEx"}),d=De({mobileExploreReferrer:"DashboardOpEx"}),p=S(E=>mt(E)),C=p.isForecastModeOn,g=p.timeframe,u=p.selectedForecast?.id,c=S(E=>dt(E.forecastState,u??"")),m=S(E=>Ht(E)),h=S(E=>ut(E)),f=S(E=>pe(E)),k=p.mode==="compare_mode",y=m.dataAvailable;b.useEffect(()=>{if(u!=null&&C===!0&&(N(C,r,u,o),c!=null)){const E=c?.forecastPeriod,M=y!=null&&E.endDate.isAfter(y?.endDate)===!0?y:E;a(ae(e.firstMonthOfFY,{startDate:M.endDate.startOf(g),endDate:M?.endDate}))}},[u]);const _=Te(),A=_?.loggedInUserRole!=null&&Qt(_?.loggedInUserRole)!==!0;return l.jsx(zo,{firstMonthOfFY:e.firstMonthOfFY,tenantEmailDomain:t,selectedForecastId:r,location:n,isAccountingClassesEnabled:f,isCompareModeOn:k,navigate:o,forecastIdFromUrlPath:r,analytics:I,hasTransactionAccess:A,reportsResyncFetchState:h.reportsResyncFetchState,insightsSectionAiCfoInfo:d,isAiCfoAccessEnabled:s,onAskAiCfoClick:i})},Ko=e=>{let a,t;switch(e.balanceTimeFrame){case"month":case"quarter":a=e.balanceTimeFrame,t=Ue(e);break;case"year":a="quarter",t={startDate:e.endDate.startOf("quarter"),endDate:e.endDate};break;case"free_range":console.error("free_range timeframe is not supported!")}return{timeframe:a,timePeriod:t}},qo=H(function(e){const a=Wt(e),t=In(e),n=En(e),o=xn(e),r=pt(e),{scrollPosition:s,...i}=r,d=$.getLocalizedStrings().reportTitleById.revenue,p=R.getSignedInUser(),C=e.tenantState.currentTenantId,g=L(e),u=g?.companyName??"",c={userId:p?.userId??"",sessionId:p?.zeniSessionId??"",tenantId:C??""},m=e.entityAutoCompleteState.autoCompleteText.navbar,h=ee(e,"navbar"),f=ct(g);return{selectedRangeReport:a,selectedClassesViewRangeReport:n,reportLabels:{reportTitle:d},highlightedRangeReport:t,highlightedClassesViewRangeReport:o,uiState:i,scrollPosition:s,downloadParams:{downloadState:a.downloadState,currentTenantCompanyName:u,statementEndPoint:`${J}/statement`,authParams:c},analytics:I,isZeniUser:Ae(p),autoCompleteData:{autoCompleteText:m,entityAutoCompleteView:h},isZeniCOAUsed:f,isAccountingClassesEnabled:pe(e)}},function(e,a){return{updateDownloadStateHandler:t=>{e(Dn(t))},onTimeframeSelectionChanged:t=>{e(me(t)),setTimeout(()=>e(ie({resetLeftScroll:!0})),50)},onCOABalancesRangeChanged:(t,n)=>{e(Ee(t,n)),e(ie({resetLeftScroll:!0}))},onThisPeriodChanged:t=>{e(ae(a.firstMonthOfFY,t)),e(ie({resetLeftScroll:!0}))},onAdditionalBalanceSelectionChanged:(t,n,o)=>{e(ve(a.firstMonthOfFY,t,o,n)),n.length>0&&(e(Ie(a.firstMonthOfFY,n.includes("this_period_vs_last_period")?"compare_mode_amount":"compare_mode_percent",o,n)),a.forecastIdFromUrlPath!=null&&t==1&&N(!1,a.forecastIdFromUrlPath,"",a.navigate)),a.isCompareModeOn!==t&&setTimeout(()=>e(ie({resetLeftScroll:!0})),50)},onAccountBalanceClick:(t,n)=>{const{timePeriod:o,timeframe:r}=Ko(n);if(o!=null&&r!=null){const s=t.accountName===""?t.accountDescription:t.accountName,i=t.classesViewParentId!=null&&t.classesViewParentId.parentClassId!=null?gt(a.tenantEmailDomain,t.accountId,t.accountType,t.classesViewParentId.parentClassId?.[0],s,r,o):he(a.tenantEmailDomain,t.accountId,t.accountType,s,r,o),d=D(a.location.state?.pathnameStackToGoBack,a.location.pathname);a.navigate(i,{state:{pathnameStackToGoBack:d,referrer:"Revenues"}})}},onElementCollapseStateChanged:(t,n)=>{e(ie({nodeCollapseState:{nodeId:t,isCollapsed:n}}))},onTableScroll:t=>{e(ie({scrollPosition:t}))},autoCompleteActions:{onAutoCompleteInputChange:t=>{t.trim().length>=2?e(te({searchString:t,searchOrigin:"navbar"})):t.trim().length===0&&e(Z("navbar"))},onAutoCompleteEntity:t=>{const n=ne(t,a.tenantEmailDomain),o=D(a.location.state?.pathnameStackToGoBack,a.location.pathname);a.navigate(n,{state:{pathnameStackToGoBack:o}})}},onBackClick:()=>{a.selectedForecastId!=null?a.navigate("../../../"):a.navigate("../")},onForecastToggle:(t,n)=>{e(le(a.firstMonthOfFY,t==="forecast_mode",t==="forecast_mode"?de:bt,n)),t==="forecast_mode"?(e(Ft({viewMode:"account_group"})),e(Xt(!1,n?.id)),n!=null&&N(!0,a.forecastIdFromUrlPath,n?.id??"",a.navigate)):N(!1,a.forecastIdFromUrlPath,n?.id??"",a.navigate),e(ie({resetLeftScroll:!0}))},onUpdateAccountViewMode:t=>{a.analytics?.trackGroupBySwitch(t==="classes"?"Classes":"Accounts","Revenues"),e(Ft({viewMode:t}))},onUpdateClassesToFilterOut:t=>{e(wn({classesToFilterOut:t}))},onOpenAccountViewMode:()=>{a.isAccountingClassesEnabled&&e(Tn())},onResyncReports:()=>{e(lt("revenue_by_classes"))}}})(Fe),Zo=e=>{const a=V(),{tenantEmailDomain:t,location:n,navigate:o,forecastIdFromUrlPath:r}=e,{isAiCfoAccessEnabled:s,onAskAiCfoClick:i}=Q({mobileExploreReferrer:"DashboardRevenue"}),d=De({mobileExploreReferrer:"DashboardRevenue"}),p=S(y=>pt(y)),C=p.isForecastModeOn,g=p.timeframe,u=p.selectedForecast?.id,c=S(y=>dt(y.forecastState,u??"")),m=S(y=>Wt(y)).dataAvailable,h=p.mode==="compare_mode",f=S(y=>pe(y)),k=S(y=>ut(y));return b.useEffect(()=>{if(u!=null&&C===!0&&(N(C,r,u,o),c!=null)){const y=c?.forecastPeriod,_=m!=null&&y.endDate.isAfter(m?.endDate)===!0?m:y;a(ae(e.firstMonthOfFY,{startDate:_.endDate.startOf(g),endDate:_?.endDate}))}},[u]),l.jsx(qo,{firstMonthOfFY:e.firstMonthOfFY,tenantEmailDomain:t,selectedForecastId:r,isAccountingClassesEnabled:f,isCompareModeOn:h,location:n,navigate:o,forecastIdFromUrlPath:r,analytics:I,reportsResyncFetchState:k.reportsResyncFetchState,insightsSectionAiCfoInfo:d,isAiCfoAccessEnabled:s,onAskAiCfoClick:i})},Ho=e=>{let a,t;if(e.endDate!=null)switch(e.timePeriod){case"this_month_to_date":case"last_month":case"this_week_to_date":case"last_week":a="month",t={startDate:e.endDate.startOf("month"),endDate:e.endDate};break;case"last_3_months":case"last_6_months":case"last_12_months":case"this_year_to_date":case"last_year":a="quarter",t={startDate:e.endDate.startOf("quarter"),endDate:e.endDate};break;default:console.error(`this timeperiod ${e.timePeriod} is not supported!`)}return{timeframe:a,timePeriod:t}},Jo=H(function(e){const a=Fn(e),t=e.entityAutoCompleteState.autoCompleteText.navbar,n=ee(e,"navbar");return{report:a,analytics:I,autoCompleteData:{autoCompleteText:t,entityAutoCompleteView:n}}},function(e,a){return{onTimeframeSelectionChanged:t=>{I.trackTimeframeSwitch(ha(t),"Top Expenses"),e(ea(t))},onAccountBalanceClick:(t,n)=>{const{timePeriod:o,timeframe:r}=Ho(n),s=t.accountName===""?t.accountDescription:t.accountName;if(o!=null&&r!=null){const i=he(a.tenantEmailDomain,t.accountId,t.accountType,s,r,o),d=D(a.location.state?.pathnameStackToGoBack,a.location.pathname);a.navigate(i,{state:{pathnameStackToGoBack:d,referrer:"Top Expenses"}})}},autoCompleteActions:{onAutoCompleteInputChange:t=>{t.trim().length>=2?e(te({searchString:t,searchOrigin:"navbar"})):t.trim().length===0&&e(Z("navbar"))},onAutoCompleteEntity:t=>{const n=ne(t,a.tenantEmailDomain),o=D(a.location.state?.pathnameStackToGoBack,a.location.pathname);a.navigate(n,{state:{pathnameStackToGoBack:o}})}},onBackClick:()=>{a.navigate("../")}}})(mo),Qo=e=>{const{tenantEmailDomain:a,location:t,navigate:n}=e;return l.jsx(Jo,{tenantEmailDomain:a,location:t,navigate:n})},Wo=ft.div`
|
|
14
14
|
display: flex;
|
|
15
15
|
flex: 1 1 auto;
|
|
16
16
|
min-height: 100%;
|
|
17
17
|
flex-direction: column;
|
|
18
18
|
background-color: ${e=>e.theme.colors.grey5};
|
|
19
19
|
align-items: center;
|
|
20
|
-
`,de=3,bt=1;function Wo({fetchState:e,firstMonthOfFY:a,reportId:t,forecastId:n}){const o=q(),r=z(),{tenantEmailDomain:s}=K();let i;we({isDataReady:!0});const d={firstMonthOfFY:a,tenantEmailDomain:s,location:r,navigate:o,forecastIdFromUrlPath:n,fetchState:e};switch(t){case"operating_expenses":i=l.jsx($o,{...d});break;case"revenue":i=l.jsx(Zo,{...d});break;case"net_burn_or_income":i=l.jsx(No,{...d});break;case"cash_position":i=l.jsx(Uo,{...d});break;case"top_expenses":i=l.jsx(Qo,{...d});break;case"cash_in_cash_out":i=l.jsx(jo,{...d});break;default:console.error(`${t} is not supported!`),i=null}return i!=null?l.jsx(Xo,{children:i}):null}function X(){const e=z(),a=G(),{forecastId:t}=K();let n="Not-Started";const o=S(c=>mt(c).fetchState),r=S(c=>pt(c).fetchState),s=S(c=>it(c).fetchState),i=S(c=>c.cashPositionState.fetchState),d=S(c=>c.topExState.fetchState),p=S(c=>c.cashInCashOutState.fetchState);if(R.getSignedInUser()==null)throw Error("Can't access dashboard detail without signing in...");const C=S(c=>j(c)),g=C?.company?.companyInfo?.firstMonthOfFY??1,u=Yt((c=>{const m=Vt(c,"/").split("/");return t!=null?m[m.length-3]:m[m.length-1]})(e.pathname));switch(u){case"operating_expenses":n=o;break;case"revenue":n=r;break;case"net_burn_or_income":n=s;break;case"cash_position":n=i;break;case"top_expenses":n=d;break;case"cash_in_cash_out":n=p;break;default:console.error(`${u} is not supported!`)}return b.useEffect(()=>{n==="Not-Started"&&function(c,m,h,f){switch(m){case"operating_expenses":c(ra(!0)),f!=null&&(c(le(h,!0,de,{id:f,index:0})),c(Jt(!1,f)));break;case"revenue":c(sa(!0)),f!=null&&(c(le(h,!0,de,{id:f,index:0})),c(Wt(!1,f)));break;case"net_burn_or_income":c(oa(!0)),f!=null&&(c(le(h,!0,de,{id:f,index:0})),c(Zt(!1,f)));break;case"cash_position":c(na(!0));break;case"top_expenses":c(aa());break;case"cash_in_cash_out":c(ta());break;default:throw new Error(`report type ${m} is not yet supported`)}}(a,u,g,t)},[t]),l.jsxs(l.Fragment,{children:[n==="Completed"?l.jsx(xe,{analytics:I,onLoad:c=>((m,h)=>{const f=e.state?.referrer;switch(h){case"operating_expenses":m.trackPageLoaded(V.Event.operatingExpenses,f);break;case"revenue":m.trackPageLoaded(V.Event.revenues,f);break;case"net_burn_or_income":m.trackPageLoaded(V.Event.burnRate,f);break;case"cash_position":m.trackPageLoaded(V.Event.cashPosition,f);break;case"top_expenses":m.trackPageLoaded(V.Event.topExpenses,f);break;case"cash_in_cash_out":m.trackPageLoaded(V.Event.cashInCashOut,f);break;default:console.error(`Analytics: Not tracking Page Loaded for ${h}!`)}})(c,u)}):null,l.jsx(Wo,{firstMonthOfFY:g,fetchState:n,reportId:u,forecastId:t})]})}var Qe=typeof navigator<"u"&&navigator.userAgent.toLowerCase().indexOf("firefox")>0;function Xe(e,a,t,n){e.addEventListener?e.addEventListener(a,t,n):e.attachEvent&&e.attachEvent("on".concat(a),function(){t(window.event)})}function ba(e,a){for(var t=a.slice(0,a.length-1),n=0;n<t.length;n++)t[n]=e[t[n].toLowerCase()];return t}function Ca(e){typeof e!="string"&&(e="");for(var a=(e=e.replace(/\s/g,"")).split(","),t=a.lastIndexOf("");t>=0;)a[t-1]+=",",a.splice(t,1),t=a.lastIndexOf("");return a}for(var Ct={backspace:8,tab:9,clear:12,enter:13,return:13,esc:27,escape:27,space:32,left:37,up:38,right:39,down:40,del:46,delete:46,ins:45,insert:45,home:36,end:35,pageup:33,pagedown:34,capslock:20,num_0:96,num_1:97,num_2:98,num_3:99,num_4:100,num_5:101,num_6:102,num_7:103,num_8:104,num_9:105,num_multiply:106,num_add:107,num_enter:108,num_subtract:109,num_decimal:110,num_divide:111,"⇪":20,",":188,".":190,"/":191,"`":192,"-":Qe?173:189,"=":Qe?61:187,";":Qe?59:186,"'":222,"[":219,"]":221,"\\":220},W={"⇧":16,shift:16,"⌥":18,alt:18,option:18,"⌃":17,ctrl:17,control:17,"⌘":91,cmd:91,command:91},st={16:"shiftKey",18:"altKey",17:"ctrlKey",91:"metaKey",shiftKey:16,ctrlKey:17,altKey:18,metaKey:91},B={16:!1,18:!1,17:!1,91:!1},O={},Le=1;Le<20;Le++)Ct["f".concat(Le)]=111+Le;var T=[],Pt=!1,_a="all",Bt=[],Ve=function(e){return Ct[e.toLowerCase()]||W[e.toLowerCase()]||e.toUpperCase().charCodeAt(0)};function Rt(e){_a=e||"all"}function Se(){return _a||"all"}var We=function(e){var a=e.key,t=e.scope,n=e.method,o=e.splitKey,r=o===void 0?"+":o;Ca(a).forEach(function(s){var i=s.split(r),d=i.length,p=i[d-1],C=p==="*"?"*":Ve(p);if(O[C]){t||(t=Se());var g=d>1?ba(W,i):[];O[C]=O[C].filter(function(u){return!((!n||u.method===n)&&u.scope===t&&function(c,m){for(var h=c.length>=m.length?c:m,f=c.length>=m.length?m:c,k=!0,y=0;y<h.length;y++)f.indexOf(h[y])===-1&&(k=!1);return k}(u.mods,g))})}})};function jt(e,a,t,n){var o;if(a.element===n&&(a.scope===t||a.scope==="all")){for(var r in o=a.mods.length>0,B)Object.prototype.hasOwnProperty.call(B,r)&&(!B[r]&&a.mods.indexOf(+r)>-1||B[r]&&a.mods.indexOf(+r)===-1)&&(o=!1);(a.mods.length!==0||B[16]||B[18]||B[17]||B[91])&&!o&&a.shortcut!=="*"||a.method(e,a)===!1&&(e.preventDefault?e.preventDefault():e.returnValue=!1,e.stopPropagation&&e.stopPropagation(),e.cancelBubble&&(e.cancelBubble=!0))}}function Lt(e,a){var t=O["*"],n=e.keyCode||e.which||e.charCode;if(U.filter.call(this,e)){if(n!==93&&n!==224||(n=91),T.indexOf(n)===-1&&n!==229&&T.push(n),["ctrlKey","altKey","shiftKey","metaKey"].forEach(function(m){var h=st[m];e[m]&&T.indexOf(h)===-1?T.push(h):!e[m]&&T.indexOf(h)>-1?T.splice(T.indexOf(h),1):m==="metaKey"&&e[m]&&T.length===3&&(e.ctrlKey||e.shiftKey||e.altKey||(T=T.slice(T.indexOf(h))))}),n in B){for(var o in B[n]=!0,W)W[o]===n&&(U[o]=!0);if(!t)return}for(var r in B)Object.prototype.hasOwnProperty.call(B,r)&&(B[r]=e[st[r]]);e.getModifierState&&(!e.altKey||e.ctrlKey)&&e.getModifierState("AltGraph")&&(T.indexOf(17)===-1&&T.push(17),T.indexOf(18)===-1&&T.push(18),B[17]=!0,B[18]=!0);var s=Se();if(t)for(var i=0;i<t.length;i++)t[i].scope===s&&(e.type==="keydown"&&t[i].keydown||e.type==="keyup"&&t[i].keyup)&&jt(e,t[i],s,a);if(n in O){for(var d=0;d<O[n].length;d++)if((e.type==="keydown"&&O[n][d].keydown||e.type==="keyup"&&O[n][d].keyup)&&O[n][d].key){for(var p=O[n][d],C=p.splitKey,g=p.key.split(C),u=[],c=0;c<g.length;c++)u.push(Ve(g[c]));u.sort().join("")===T.sort().join("")&&jt(e,p,s,a)}}}}function U(e,a,t){T=[];var n=Ca(e),o=[],r="all",s=document,i=0,d=!1,p=!0,C="+",g=!1;for(t===void 0&&typeof a=="function"&&(t=a),Object.prototype.toString.call(a)==="[object Object]"&&(a.scope&&(r=a.scope),a.element&&(s=a.element),a.keyup&&(d=a.keyup),a.keydown!==void 0&&(p=a.keydown),a.capture!==void 0&&(g=a.capture),typeof a.splitKey=="string"&&(C=a.splitKey)),typeof a=="string"&&(r=a);i<n.length;i++)o=[],(e=n[i].split(C)).length>1&&(o=ba(W,e)),(e=(e=e[e.length-1])==="*"?"*":Ve(e))in O||(O[e]=[]),O[e].push({keyup:d,keydown:p,scope:r,mods:o,shortcut:n[i],method:t,key:n[i],splitKey:C,element:s});s!==void 0&&!function(u){return Bt.indexOf(u)>-1}(s)&&window&&(Bt.push(s),Xe(s,"keydown",function(u){Lt(u,s)},g),Pt||(Pt=!0,Xe(window,"focus",function(){T=[]},g)),Xe(s,"keyup",function(u){Lt(u,s),function(c){var m=c.keyCode||c.which||c.charCode,h=T.indexOf(m);if(h>=0&&T.splice(h,1),c.key&&c.key.toLowerCase()==="meta"&&T.splice(0,T.length),m!==93&&m!==224||(m=91),m in B)for(var f in B[m]=!1,W)W[f]===m&&(U[f]=!1)}(u)},g))}var et={setScope:Rt,getScope:Se,deleteScope:function(e,a){var t,n;for(var o in e||(e=Se()),O)if(Object.prototype.hasOwnProperty.call(O,o))for(t=O[o],n=0;n<t.length;)t[n].scope===e?t.splice(n,1):n++;Se()===e&&Rt(a||"all")},getPressedKeyCodes:function(){return T.slice(0)},isPressed:function(e){return typeof e=="string"&&(e=Ve(e)),T.indexOf(e)!==-1},filter:function(e){var a=e.target||e.srcElement,t=a.tagName,n=!0;return!a.isContentEditable&&(t!=="INPUT"&&t!=="TEXTAREA"&&t!=="SELECT"||a.readOnly)||(n=!1),n},trigger:function(e){var a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"all";Object.keys(O).forEach(function(t){var n=O[t].find(function(o){return o.scope===a&&o.shortcut===e});n&&n.method&&n.method()})},unbind:function(e){if(e===void 0)Object.keys(O).forEach(function(s){return delete O[s]});else if(Array.isArray(e))e.forEach(function(s){s.key&&We(s)});else if(typeof e=="object")e.key&&We(e);else if(typeof e=="string"){for(var a=arguments.length,t=new Array(a>1?a-1:0),n=1;n<a;n++)t[n-1]=arguments[n];var o=t[0],r=t[1];typeof o=="function"&&(r=o,o=""),We({key:e,scope:o,method:r,splitKey:"+"})}},keyMap:Ct,modifier:W,modifierMap:st};for(var tt in et)Object.prototype.hasOwnProperty.call(et,tt)&&(U[tt]=et[tt]);if(typeof window<"u"){var es=window.hotkeys;U.noConflict=function(e){return e&&window.hotkeys===U&&(window.hotkeys=es),U},window.hotkeys=U}U.filter=function(){return!0};var Mt=function(e,a){var t=e.target,n=t&&t.tagName;return!!(n&&a&&a.includes(n))};function ts(e,a,t,n){t instanceof Array&&(n=t,t=void 0);var o=t||{},r=o.enableOnTags,s=o.filter,i=o.keyup,d=o.keydown,p=o.filterPreventDefault,C=p===void 0||p,g=o.enabled,u=g===void 0||g,c=o.enableOnContentEditable,m=c!==void 0&&c,h=b.useRef(null),f=b.useCallback(function(k,y){var _,A;return s&&!s(k)?!C:!!(Mt(k,["INPUT","TEXTAREA","SELECT"])&&!Mt(k,r)||(_=k.target)!=null&&_.isContentEditable&&!m)||!!(h.current===null||document.activeElement===h.current||(A=h.current)!=null&&A.contains(document.activeElement))&&(a(k,y),!0)},n?[h,r,s].concat(n):[h,r,s]);return b.useEffect(function(){if(u)return i&&d!==!0&&(t.keydown=!1),U(e,t||{},f),function(){return U.unbind(e,f)};U.unbind(e,f)},[f,e,u]),h}U.isPressed;const as=["net_burn_or_income_story_card","cash_balance","task_card","card_balance","zeni_promo_card","insights_dashboard","information_card","company_details","bill_pay_promo_card","bill_pay_card","reimbursement_card","reimbursement_promo_card","zeni_accounts_promo_card","rewards_card","treasury_promo_card"],ns=(e,a,t,n,o)=>({card:{dimension:ht(t),cardType:n,cardIndex:o,fetchState:a,disableAnimations:!1},data:e.status!=null?{balanceAmount:e.balance?.available,lastUpdatedTime:e.status.lastRefreshSuccessTime,changePercent:e.balance?.change?.percent,changeComparedToDate:e.balance?.change?.since}:void 0}),_e=(e,a,t,n,o)=>({card:{dimension:ht(t),cardType:n,cardIndex:o,fetchState:a,disableAnimations:!1},data:e}),os=(e,a,t,n)=>_e(void 0,e,ke,a,t),ss=(e,a,t,n,o)=>({card:{dimension:ht(ke),cardType:a,cardIndex:t,fetchState:e,disableAnimations:!1},data:{funds:n,hasUserSeenVideo:o,videoUrl:"https://www.youtube.com/watch?v=sqvJWKCMZgk"}}),rs=H(function(e,a){const t=ls(a.dashboardReport),n=a.passedCardsOrdered,o=a.dashboardReport.reportsInOrder,{isInterestedInChargeCard:r,cardsCreditLimit:s,cashbackRate:i,treasuryFundDetails:d,hasUserSeenTreasuryVideo:p,treasuryFetchState:C}=a;let g=n.map((u,c)=>{if(u==="reimbursement_promo_card"||u==="bill_pay_promo_card")return os(t,u,c);if(u==="zeni_promo_card")return _e({isExpressedInterest:r,creditLimit:s,cashbackRate:i,fetchState:"Completed"},a.cardBalanceFetchState,ke,u,c);if(u==="treasury_promo_card")return ss(C,u,c,d,p);if(u==="information_card")return _e(void 0,"Completed",ke,u,c);{const m=o.find(h=>h?.reportId===u);return m?function(h,f,k,y){const _=h.reportId;switch(_){case"card_balance":case"cash_balance":return[ns(h,f,k,_,y)];case"expense_automation_card":case"operating_expenses":case"revenue":case"top_expenses":case"cash_position":case"cash_in_cash_out":case"insights_dashboard":case"company_details":case"task_card":case"bill_pay_card":case"reimbursement_card":case"net_burn_or_income":case"accounts_payable_aging":case"accounts_receivable_aging":case"zeni_accounts_promo_card":case"rewards_card":return[_e(h,f,k,_,y)];case"net_burn_or_income_story_card":return[_e(h,f,k,"net_burn_or_income_story_card",y)];default:return console.error(`card type ${_} not yet supported!`),[]}}(m,m.fetchState,ke,c):[]}}).flat();return a.isSummaryCardsFiltered===!0&&(g=g.filter(u=>as.includes(u.card.cardType)==0).filter(u=>{const c=u.data?.availableNumberOfPeriods;return c!=null?c>0:u.card.cardType!="top_expenses"||u.data==null||function(m){if(m==null||m.length===0)return!0;let h=!0;for(const f of m)if(f.balance.available.amount!==0){h=!1;break}return h}(u.data.topExpenses.accountsOrdered)===!1})),{cardDataArray:g,autoCompleteData:{autoCompleteText:e.entityAutoCompleteState.autoCompleteText.navbar,entityAutoCompleteView:ee(e,"navbar")},analytics:I,isReimbursementEnabled:a.isReimbursementEnabled,isBillPayEnabled:a.isBillPayEnabled}},function(e,a){const t=a.tenantId,n=R.getSignedInUser();return{cardActions:{onCardClick:(o,r,s,i)=>{if(console.warn(`onCardClick at ${o} for the type ${r}`),r==="zeni_promo_card"&&i!=null)I.trackDashboardCardClicked("cards promo",2),I.trackZeniCardsPromoCardClicked(a.isChargeCardFeatureEnabled,i,2,`${n?.firstName??""} ${n?.lastName??""}`,a.isChargeCardFeatureEnabled?a.cardsCreditLimit:void 0),i==="Learn More"?window.open("https://www.zeni.ai/product/business-credit-card","_blank"):a.navigate("../cards/promo",{relative:"path"});else if(a.isForecastOn)switch(r){case"net_burn_or_income":case"operating_expenses":case"revenue":a.navigate(`${r}/forecast/${a.selectedForecastOnDashboard}`,{state:{referrer:s}});break;default:a.navigate(`${r}`,{state:{referrer:s}})}else r==="rewards_card"?(n!=null&&I.trackDashboardCardClicked("rewards promo",o+1),a.navigate("../../rewards/refer",{state:{referrer:s}})):r==="expense_automation_card"?(I.trackMonthEndCloseClicked(a.selectedPeriod.month,a.selectedPeriod.year,"Dashboard"),a.navigate("../../month_end_close_checks/review",{state:{referrer:"Dashboard"}})):a.navigate(`${r}`,{state:{referrer:s}})},onReloadData:(o,r)=>{const s=[];a.isApAgingFeatureEnabled===!1&&s.push("accounts_payable_aging"),a.isArAgingFeatureEnabled===!1&&s.push("accounts_receivable_aging"),a.isZeniAccountEnabled===!1&&s.push("zeni_accounts_promo_card"),a.isRewardsFeatureEnabled===!1&&s.push("rewards_card"),function(i,d,p,C){switch(d){case"card_balance":i(Kt());break;case"cash_balance":i(Nt());break;case"operating_expenses":i(ra(!0));break;case"revenue":i(sa(!0));break;case"net_burn_or_income":i(oa(!0));break;case"net_burn_or_income_story_card":i(Jn(!0));break;case"cash_position":i(na(!0));break;case"top_expenses":i(aa());break;case"cash_in_cash_out":i(ta());break;case"insights_dashboard":i(Hn());break;case"bill_pay_card":i(Zn());break;case"reimbursement_card":i(qn());break;case"company_details":i(zn(p));break;case"task_card":i($n());break;case"accounts_payable_aging":C.includes("accounts_payable_aging")===!1&&i(nt(ue()));break;case"accounts_receivable_aging":i(ot(ue()));break;case"zeni_accounts_promo_card":C.includes("zeni_accounts_promo_card")===!1&&i(Gt());break;case"rewards_card":C.includes("rewards_card")===!1&&i(Kn(!0));break;default:throw new Error(`report type ${d} is not yet supported`)}}(e,r,a.companyId,s)},onTimeframeChange:(o,r)=>{I.trackTimeframeSwitch(ha(r),cs(o),"Dashboard"),function(s,i,d){switch(i){case"operating_expenses":case"revenue":case"net_burn_or_income":case"cash_position":s(me(d));break;case"top_expenses":s(ea(d));break;default:throw new Error(`report type ${i} doesn't support changeTimeframe`)}}(e,o,r)},onUpdateSelectedInsightIndex:o=>{e(Gn(o))},onCategoryClick:(o,r,s)=>{o==="bill-pay"?a.navigate("../bills",{state:{tab:r,subTab:s},relative:"path"}):o==="reimbursement"?a.navigate("../reimbursements",{state:{tab:r,subTab:s},relative:"path"}):o==="uncategorized-account-mapping"?a.navigate("../settings/accounting",{relative:"path"}):o==="show-all-tasks"?a.navigate("../tasks",{relative:"path"}):a.navigate(`../../transactions/${o}`)},onCardBtnClick:(o,r)=>{if(o==="bill_pay_promo_card"){const s="../bills",i=D(a.location.state?.pathnameStackToGoBack,a.location.pathname);a.navigate(s,{state:{pathnameStackToGoBack:i},relative:"path"})}else if(o==="reimbursement_promo_card"){const s="../reimbursements",i=D(a.location.state?.pathnameStackToGoBack,a.location.pathname);a.navigate(s,{state:{pathnameStackToGoBack:i},relative:"path"})}else if(o==="zeni_accounts_promo_card")if(a.hasZeniAccountsAdminAccess){let s="../checking/promo";r!=null&&(s=`../checking/${r}`);const i=D(a.location.state?.pathnameStackToGoBack,a.location.pathname);a.navigate(s,{state:{pathnameStackToGoBack:i},relative:"path"})}else window.open("https://www.zeni.ai/product/business-checking-accounts","_blank");else if(o==="treasury_promo_card")if(a.isUserHasTreasuryAccess){R.saveTreasuryPopupSeen(a.tenantEmailDomain,!0);const s="../treasury",i=D(a.location.state?.pathnameStackToGoBack,a.location.pathname);a.navigate(s,{state:{pathnameStackToGoBack:i},relative:"path"})}else window.open("https://www.zeni.ai/product/treasury","_blank")},onSaveClick:(o,r,s)=>{o==="net_burn_or_income_story_card"&&(I.trackUpdateBurnRateCalculatorSettings(r,s,Vn(s)),e(Nn(t,r,s)))},onVideoPlay:()=>{e(Yn())},onVideoClose:()=>{e(Un())}},autoCompleteActions:{onAutoCompleteInputChange:o=>{o.trim().length>=2?e(te({searchString:o,searchOrigin:"navbar"})):o.trim().length===0&&e(Z("navbar"))},onCancelAutoComplete:()=>{e(Z("navbar"))},onAutoCompleteEntity:o=>{let r="";r=o.type!=="vendor"||o.detailType!=="bank_merchant"&&o.detailType!=="card_merchant"?ne(o,a.tenantEmailDomain):bo(o.zeniId,o.qboId,a.tenantEmailDomain);const s=D(a.location.state?.pathnameStackToGoBack,a.location.pathname);a.navigate(r,{state:{pathnameStackToGoBack:s,referrer:"Search"}})}}}})(go);function is(){const{isAiCfoOpen:e,setIsAiCfoOpen:a}=la(),t=q(),n=G(),o=z(),r=R.getSignedInUser(),{useFeatureGate:s,useDynamicConfig:i}=Ye(),d=Ae(r),[p,C]=b.useState(!1),[g,u]=b.useState(!1),c=da(),{tenantEmailDomain:m}=K(),{isAiCfoAccessEnabled:h,onAskAiCfoClick:f}=Q({mobileExploreReferrer:"Dashboard"}),k=S(v=>v.tenantState.fetchState==="Completed"||v.tenantState.activeTenantFetchState.fetchState==="Completed"?j(v):void 0),y=k??R.getSignedInUserTenant(m),_=y.tenantId,A=y.companyId;b.useEffect(()=>{p===!1&&o.state?.message==="activation"&&(n(On(A)),C(!0))},[o.state,p,A,n]),b.useEffect(()=>{c&&!g&&o.state?.message==="open_ai_cfo_drawer"&&(a(!0),u(!0),t(o.pathname,{replace:!0,state:{...o.state,message:void 0}}))},[o.state,g,c,a,t,o.pathname]);const{isFeatureEnabled:E}=s(L.isApAgingFeatureEnabled),{isFeatureEnabled:M}=s(L.isExpenseAutomationEnabled),{isFeatureEnabled:F}=s(L.isExpenseAutomationEnabledV2),x=F||M&&d,{isFeatureEnabled:P}=s(L.isTreasuryEnabled),fe=po(x),{isFeatureEnabled:ge}=s(L.isArAgingFeatureEnabled),{isFeatureEnabled:Oe}=s(L.isDepositAccountsFeatureEnabled),{isFeatureEnabled:_t}=s(L.isReferralFeatureEnabled),{isFeatureEnabled:ka}=s(L.isChargeCardFeatureEnabled),{isFeatureEnabled:Sa}=s(L.isDashboardSidebarChristmasAnimationEnabled),{isFeatureEnabled:ya}=s(L.isDashboardSidebarNewYearAnimationEnabled),{configValue:kt}=i(ua.zeniCardsConfig),Aa=kt.charge_card_cashback_rate_per_transaction==null?.0175:kt.charge_card_cashback_rate_per_transaction;if(o.state?.message==="activation"){const v=ho(o.state?.pathnameStackToGoBack);t(o.pathname,{state:{...o.state,message:void 0,pathnameStackToGoBack:v.newStack}})}const[St,va]=b.useState(!1),[Ne,Ia]=b.useState(!1);ts("command+p, Control+p",v=>{Ia(!Ne),v.preventDefault()},{enableOnContentEditable:!0,enableOnTags:["INPUT","SELECT","TEXTAREA"]},[Ne]);const yt=k?.externalConnections?.accounting[0]?.isValid;if(r==null)throw Error("Can't access dashboard without signing in...");const oe=S(v=>j(v)?.excludedResources),Ea=S(v=>v.expenseAutomationViewState.selectedPeriodByTenantId),xa=!!k?.companyReimbursementInfo?.info?.isReimbursementEnabled,Ta=!!k?.companyBillPayInfo?.info?.isBillPayEnabled,wa=S(v=>v.treasurySetupViewState.treasuryFundsDetails).fetchStatus.fetchState,Da=k?.company!=null&&Pn(k.company),Ge=P&&Da,Ke=Te(),Fa=rt(Ke?.loggedInUserRoleMap),Y=[],At=oe?.resources?.find(v=>v.resource==="/reports/top_expenses")==null,Oa=oe?.resources?.find(v=>v.resource==="/reports/task_card")==null,$e=k?.userRole!=null&&Qt(k?.userRole),Pa=oe?.resources?.find(v=>v.resource==="/bills")==null&&!$e,Ba=oe?.resources?.find(v=>v.resource==="/reimbursements")==null,Ra=Bn(Ke?.loggedInUserRoleMap),ja=Rn(Ke?.loggedInUserRoleMap),La=k?.company?.companyChargeCardInfo?.chargeCardsCreditAccountLimit??0,Ma=k?.companyChargeCardInfo?.info?.isCompanyInterestedInChargeCard??!1,Ua=S(v=>v.treasurySetupViewState.treasuryFundsDetails).fundsDetails;At===!1&&Y.push("top_expenses"),Oa===!1&&Y.push("task_card"),Pa===!1&&Y.push("bill_pay_card","bill_pay_promo_card"),E===!1&&Y.push("accounts_payable_aging"),ge===!1&&Y.push("accounts_receivable_aging"),(x===!1||$e)&&Y.push("expense_automation_card"),Ba===!1&&Y.push("reimbursement_card","reimbursement_promo_card"),Oe===!1&&Y.push("zeni_accounts_promo_card"),_t===!1&&Y.push("rewards_card"),Ge===!1&&Y.push("treasury_promo_card");const{areTenantIdsInSync:vt}=fo();b.useLayoutEffect(()=>{St&&fe===x||yt!==!0||!vt||oe?.fetchState!=="Completed"&&oe?.fetchState!=="Error"||(va(!0),n(jn(r.userId,A,_,!0,!1,Y)))},[St,r,_,n,At,yt,oe?.fetchState,vt]);const Ya=S(v=>v.reportUIOptionsState.forecastOnDashboard.isForecastModeOn),Va=S(v=>v.revenueState.uiState.selectedForecast?.id),Na=S(v=>v.cardBalanceState.fetchState),ce=S(v=>Ln(v,Y,r,F,M,Ge)),Ga=ce.fetchState;we({isDataReady:!0});const It=k?.isTreasuryVideoViewed===!0||ce.isTreasuryVideoClosed===!0;return l.jsxs(l.Fragment,{children:[Ga==="Completed"?l.jsx(xe,{analytics:I,onLoad:v=>{v.trackPageLoaded(V.Event.dashboard),Ge&&!It&&v.trackTreasuryPromoView("Dashboard Promo Video")}}):null,l.jsx(rs,{maxColumns:e?2:void 0,isAiCfoAccessEnabled:h,onAskAiCfoClick:f,onDragAndDropCard:(v,Ka)=>{const Et=function(Pe,ze,Be){const qe=Be.indexOf(Pe),Ze=Be.indexOf(ze);if(qe===-1||Ze===-1||qe===Ze)return Be;const He=[...Be];return He.splice(qe,1),He.splice(Ze,0,Pe),He}(v,Ka,ce.cardsOrdered);Et.some((Pe,ze)=>Pe!==ce.cardsOrdered[ze])&&n(Mn(Et))},dashboardReport:ce,passedCardsOrdered:ce.cardsForDashboardUI,tenantId:_,companyId:A,tenantEmailDomain:m,location:o,navigate:t,isApAgingFeatureEnabled:E,isArAgingFeatureEnabled:ge,isBillPayEnabled:Ta,isReimbursementEnabled:xa,isSummaryCardsFiltered:Ne,isForecastOn:Ya,selectedForecastOnDashboard:Va,isVisitingFirstTime:p,isZeniAccountEnabled:Oe,isRewardsFeatureEnabled:_t,hasZeniAccountsAdminAccess:Fa,isExpenseAutomationEnabledForUser:x&&$e===!1,selectedPeriod:Ea[_],isChargeCardFeatureEnabled:ka,isUserHasCardsAccess:Ra,isUserHasTreasuryAccess:ja,cardsCreditLimit:La,cashbackRate:Aa,isInterestedInChargeCard:Ma,cardBalanceFetchState:Na,christmasAnimationEnabled:Sa,newYearAnimationEnabled:ya,treasuryFundDetails:Ua,hasUserSeenTreasuryVideo:It,treasuryFetchState:wa})]})}const cs=e=>{switch(e){case"operating_expenses":return"Operating Expenses";case"revenue":return"Revenues";case"top_expenses":return"Top Expenses";case"net_burn_or_income":return"Burn Rate";case"cash_in_cash_out":return"Cash In, Cash Out";case"cash_position":return"Cash Position"}return"Dashboard"},ls=e=>e.fetchState!=="Error"?e.fetchState:e.reportsInOrder.map(a=>a.fetchState).reduce((a,t)=>a==="In-Progress"||a==="Not-Started"?a:t);function Ls(){const e=Te(),a=e?.excludedResources?.find(p=>p.resource==="/reports/top_expenses")==null,{useFeatureGate:t}=Ye(),{isFeatureEnabled:n}=t(L.isApAgingFeatureEnabled),{isFeatureEnabled:o}=t(L.isArAgingFeatureEnabled),r=S(p=>j(p)),{isFeatureEnabled:s}=t(L.isDebitCardFeatureEnabled),i=Qn(s,r),d=Xn(r);return i===!0||d===!0?l.jsx(at,{children:l.jsx(w,{path:"/*",element:l.jsx(ko,{})})}):l.jsxs(at,{children:[l.jsx(w,{path:"/",element:l.jsx(is,{})}),l.jsx(w,{path:"cash_balance/*",element:l.jsx(Ot,{})}),l.jsx(w,{path:"card_balance/*",element:l.jsx(Ot,{})}),l.jsx(w,{path:"operating_expenses/*",element:l.jsx(X,{})}),l.jsx(w,{path:"operating_expenses/forecast/*",element:l.jsx(Je,{})}),l.jsx(w,{path:"revenue/forecast/*",element:l.jsx(Je,{})}),l.jsx(w,{path:"revenue/*",element:l.jsx(X,{})}),l.jsx(w,{path:"net_burn_or_income/forecast/*",element:l.jsx(Je,{})}),l.jsx(w,{path:"net_burn_or_income/*",element:l.jsx(X,{})}),n===!0&&l.jsxs(l.Fragment,{children:[l.jsx(w,{path:"accounts_payable_aging/*",element:l.jsx(Ao,{})}),l.jsx(w,{path:"accounts_payable_aging/:vendorId/:reportDate/*",element:l.jsx(yo,{})})]}),o&&l.jsxs(l.Fragment,{children:[l.jsx(w,{path:"accounts_receivable_aging/:customerId/:reportDate/*",element:l.jsx(vo,{})}),l.jsx(w,{path:"accounts_receivable_aging/*",element:l.jsx(Io,{})})]}),l.jsx(w,{path:"cash_position/*",element:l.jsx(X,{})}),l.jsx(w,{path:"top_expenses/*",element:a===!0?l.jsx(X,{}):l.jsx(ye,{})}),l.jsx(w,{path:"cash_in_cash_out/*",element:l.jsx(X,{})}),l.jsx(w,{path:"company_details",element:l.jsx(_o,{})}),l.jsx(w,{path:"referrals/*",element:l.jsx(So,{})}),l.jsx(w,{path:"*",element:l.jsx(ye,{})})]})}export{Ls as default};
|
|
20
|
+
`,de=3,bt=1;function Xo({fetchState:e,firstMonthOfFY:a,reportId:t,forecastId:n}){const o=q(),r=K(),{tenantEmailDomain:s}=z();let i;we({isDataReady:!0});const d={firstMonthOfFY:a,tenantEmailDomain:s,location:r,navigate:o,forecastIdFromUrlPath:n,fetchState:e};switch(t){case"operating_expenses":i=l.jsx($o,{...d});break;case"revenue":i=l.jsx(Zo,{...d});break;case"net_burn_or_income":i=l.jsx(No,{...d});break;case"cash_position":i=l.jsx(Uo,{...d});break;case"top_expenses":i=l.jsx(Qo,{...d});break;case"cash_in_cash_out":i=l.jsx(Lo,{...d});break;default:console.error(`${t} is not supported!`),i=null}return i!=null?l.jsx(Wo,{children:i}):null}function W(){const e=K(),a=V(),{forecastId:t}=z();let n="Not-Started";const o=S(c=>mt(c).fetchState),r=S(c=>pt(c).fetchState),s=S(c=>it(c).fetchState),i=S(c=>c.cashPositionState.fetchState),d=S(c=>c.topExState.fetchState),p=S(c=>c.cashInCashOutState.fetchState);if(R.getSignedInUser()==null)throw Error("Can't access dashboard detail without signing in...");const C=S(c=>L(c)),g=C?.company?.companyInfo?.firstMonthOfFY??1,u=Yt((c=>{const m=Gt(c,"/").split("/");return t!=null?m[m.length-3]:m[m.length-1]})(e.pathname));switch(u){case"operating_expenses":n=o;break;case"revenue":n=r;break;case"net_burn_or_income":n=s;break;case"cash_position":n=i;break;case"top_expenses":n=d;break;case"cash_in_cash_out":n=p;break;default:console.error(`${u} is not supported!`)}return b.useEffect(()=>{n==="Not-Started"&&function(c,m,h,f){switch(m){case"operating_expenses":c(ra(!0)),f!=null&&(c(le(h,!0,de,{id:f,index:0})),c(Jt(!1,f)));break;case"revenue":c(sa(!0)),f!=null&&(c(le(h,!0,de,{id:f,index:0})),c(Xt(!1,f)));break;case"net_burn_or_income":c(oa(!0)),f!=null&&(c(le(h,!0,de,{id:f,index:0})),c(Zt(!1,f)));break;case"cash_position":c(na(!0));break;case"top_expenses":c(aa());break;case"cash_in_cash_out":c(ta());break;default:throw new Error(`report type ${m} is not yet supported`)}}(a,u,g,t)},[t]),l.jsxs(l.Fragment,{children:[n==="Completed"?l.jsx(xe,{analytics:I,onLoad:c=>((m,h)=>{const f=e.state?.referrer;switch(h){case"operating_expenses":m.trackPageLoaded(G.Event.operatingExpenses,f);break;case"revenue":m.trackPageLoaded(G.Event.revenues,f);break;case"net_burn_or_income":m.trackPageLoaded(G.Event.burnRate,f);break;case"cash_position":m.trackPageLoaded(G.Event.cashPosition,f);break;case"top_expenses":m.trackPageLoaded(G.Event.topExpenses,f);break;case"cash_in_cash_out":m.trackPageLoaded(G.Event.cashInCashOut,f);break;default:console.error(`Analytics: Not tracking Page Loaded for ${h}!`)}})(c,u)}):null,l.jsx(Xo,{firstMonthOfFY:g,fetchState:n,reportId:u,forecastId:t})]})}var Qe=typeof navigator<"u"&&navigator.userAgent.toLowerCase().indexOf("firefox")>0;function We(e,a,t,n){e.addEventListener?e.addEventListener(a,t,n):e.attachEvent&&e.attachEvent("on".concat(a),function(){t(window.event)})}function ba(e,a){for(var t=a.slice(0,a.length-1),n=0;n<t.length;n++)t[n]=e[t[n].toLowerCase()];return t}function Ca(e){typeof e!="string"&&(e="");for(var a=(e=e.replace(/\s/g,"")).split(","),t=a.lastIndexOf("");t>=0;)a[t-1]+=",",a.splice(t,1),t=a.lastIndexOf("");return a}for(var Ct={backspace:8,tab:9,clear:12,enter:13,return:13,esc:27,escape:27,space:32,left:37,up:38,right:39,down:40,del:46,delete:46,ins:45,insert:45,home:36,end:35,pageup:33,pagedown:34,capslock:20,num_0:96,num_1:97,num_2:98,num_3:99,num_4:100,num_5:101,num_6:102,num_7:103,num_8:104,num_9:105,num_multiply:106,num_add:107,num_enter:108,num_subtract:109,num_decimal:110,num_divide:111,"⇪":20,",":188,".":190,"/":191,"`":192,"-":Qe?173:189,"=":Qe?61:187,";":Qe?59:186,"'":222,"[":219,"]":221,"\\":220},X={"⇧":16,shift:16,"⌥":18,alt:18,option:18,"⌃":17,ctrl:17,control:17,"⌘":91,cmd:91,command:91},st={16:"shiftKey",18:"altKey",17:"ctrlKey",91:"metaKey",shiftKey:16,ctrlKey:17,altKey:18,metaKey:91},B={16:!1,18:!1,17:!1,91:!1},O={},je=1;je<20;je++)Ct["f".concat(je)]=111+je;var T=[],Pt=!1,_a="all",Bt=[],Ge=function(e){return Ct[e.toLowerCase()]||X[e.toLowerCase()]||e.toUpperCase().charCodeAt(0)};function Rt(e){_a=e||"all"}function Se(){return _a||"all"}var Xe=function(e){var a=e.key,t=e.scope,n=e.method,o=e.splitKey,r=o===void 0?"+":o;Ca(a).forEach(function(s){var i=s.split(r),d=i.length,p=i[d-1],C=p==="*"?"*":Ge(p);if(O[C]){t||(t=Se());var g=d>1?ba(X,i):[];O[C]=O[C].filter(function(u){return!((!n||u.method===n)&&u.scope===t&&function(c,m){for(var h=c.length>=m.length?c:m,f=c.length>=m.length?m:c,k=!0,y=0;y<h.length;y++)f.indexOf(h[y])===-1&&(k=!1);return k}(u.mods,g))})}})};function Lt(e,a,t,n){var o;if(a.element===n&&(a.scope===t||a.scope==="all")){for(var r in o=a.mods.length>0,B)Object.prototype.hasOwnProperty.call(B,r)&&(!B[r]&&a.mods.indexOf(+r)>-1||B[r]&&a.mods.indexOf(+r)===-1)&&(o=!1);(a.mods.length!==0||B[16]||B[18]||B[17]||B[91])&&!o&&a.shortcut!=="*"||a.method(e,a)===!1&&(e.preventDefault?e.preventDefault():e.returnValue=!1,e.stopPropagation&&e.stopPropagation(),e.cancelBubble&&(e.cancelBubble=!0))}}function jt(e,a){var t=O["*"],n=e.keyCode||e.which||e.charCode;if(U.filter.call(this,e)){if(n!==93&&n!==224||(n=91),T.indexOf(n)===-1&&n!==229&&T.push(n),["ctrlKey","altKey","shiftKey","metaKey"].forEach(function(m){var h=st[m];e[m]&&T.indexOf(h)===-1?T.push(h):!e[m]&&T.indexOf(h)>-1?T.splice(T.indexOf(h),1):m==="metaKey"&&e[m]&&T.length===3&&(e.ctrlKey||e.shiftKey||e.altKey||(T=T.slice(T.indexOf(h))))}),n in B){for(var o in B[n]=!0,X)X[o]===n&&(U[o]=!0);if(!t)return}for(var r in B)Object.prototype.hasOwnProperty.call(B,r)&&(B[r]=e[st[r]]);e.getModifierState&&(!e.altKey||e.ctrlKey)&&e.getModifierState("AltGraph")&&(T.indexOf(17)===-1&&T.push(17),T.indexOf(18)===-1&&T.push(18),B[17]=!0,B[18]=!0);var s=Se();if(t)for(var i=0;i<t.length;i++)t[i].scope===s&&(e.type==="keydown"&&t[i].keydown||e.type==="keyup"&&t[i].keyup)&&Lt(e,t[i],s,a);if(n in O){for(var d=0;d<O[n].length;d++)if((e.type==="keydown"&&O[n][d].keydown||e.type==="keyup"&&O[n][d].keyup)&&O[n][d].key){for(var p=O[n][d],C=p.splitKey,g=p.key.split(C),u=[],c=0;c<g.length;c++)u.push(Ge(g[c]));u.sort().join("")===T.sort().join("")&&Lt(e,p,s,a)}}}}function U(e,a,t){T=[];var n=Ca(e),o=[],r="all",s=document,i=0,d=!1,p=!0,C="+",g=!1;for(t===void 0&&typeof a=="function"&&(t=a),Object.prototype.toString.call(a)==="[object Object]"&&(a.scope&&(r=a.scope),a.element&&(s=a.element),a.keyup&&(d=a.keyup),a.keydown!==void 0&&(p=a.keydown),a.capture!==void 0&&(g=a.capture),typeof a.splitKey=="string"&&(C=a.splitKey)),typeof a=="string"&&(r=a);i<n.length;i++)o=[],(e=n[i].split(C)).length>1&&(o=ba(X,e)),(e=(e=e[e.length-1])==="*"?"*":Ge(e))in O||(O[e]=[]),O[e].push({keyup:d,keydown:p,scope:r,mods:o,shortcut:n[i],method:t,key:n[i],splitKey:C,element:s});s!==void 0&&!function(u){return Bt.indexOf(u)>-1}(s)&&window&&(Bt.push(s),We(s,"keydown",function(u){jt(u,s)},g),Pt||(Pt=!0,We(window,"focus",function(){T=[]},g)),We(s,"keyup",function(u){jt(u,s),function(c){var m=c.keyCode||c.which||c.charCode,h=T.indexOf(m);if(h>=0&&T.splice(h,1),c.key&&c.key.toLowerCase()==="meta"&&T.splice(0,T.length),m!==93&&m!==224||(m=91),m in B)for(var f in B[m]=!1,X)X[f]===m&&(U[f]=!1)}(u)},g))}var et={setScope:Rt,getScope:Se,deleteScope:function(e,a){var t,n;for(var o in e||(e=Se()),O)if(Object.prototype.hasOwnProperty.call(O,o))for(t=O[o],n=0;n<t.length;)t[n].scope===e?t.splice(n,1):n++;Se()===e&&Rt(a||"all")},getPressedKeyCodes:function(){return T.slice(0)},isPressed:function(e){return typeof e=="string"&&(e=Ge(e)),T.indexOf(e)!==-1},filter:function(e){var a=e.target||e.srcElement,t=a.tagName,n=!0;return!a.isContentEditable&&(t!=="INPUT"&&t!=="TEXTAREA"&&t!=="SELECT"||a.readOnly)||(n=!1),n},trigger:function(e){var a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"all";Object.keys(O).forEach(function(t){var n=O[t].find(function(o){return o.scope===a&&o.shortcut===e});n&&n.method&&n.method()})},unbind:function(e){if(e===void 0)Object.keys(O).forEach(function(s){return delete O[s]});else if(Array.isArray(e))e.forEach(function(s){s.key&&Xe(s)});else if(typeof e=="object")e.key&&Xe(e);else if(typeof e=="string"){for(var a=arguments.length,t=new Array(a>1?a-1:0),n=1;n<a;n++)t[n-1]=arguments[n];var o=t[0],r=t[1];typeof o=="function"&&(r=o,o=""),Xe({key:e,scope:o,method:r,splitKey:"+"})}},keyMap:Ct,modifier:X,modifierMap:st};for(var tt in et)Object.prototype.hasOwnProperty.call(et,tt)&&(U[tt]=et[tt]);if(typeof window<"u"){var es=window.hotkeys;U.noConflict=function(e){return e&&window.hotkeys===U&&(window.hotkeys=es),U},window.hotkeys=U}U.filter=function(){return!0};var Mt=function(e,a){var t=e.target,n=t&&t.tagName;return!!(n&&a&&a.includes(n))};function ts(e,a,t,n){t instanceof Array&&(n=t,t=void 0);var o=t||{},r=o.enableOnTags,s=o.filter,i=o.keyup,d=o.keydown,p=o.filterPreventDefault,C=p===void 0||p,g=o.enabled,u=g===void 0||g,c=o.enableOnContentEditable,m=c!==void 0&&c,h=b.useRef(null),f=b.useCallback(function(k,y){var _,A;return s&&!s(k)?!C:!!(Mt(k,["INPUT","TEXTAREA","SELECT"])&&!Mt(k,r)||(_=k.target)!=null&&_.isContentEditable&&!m)||!!(h.current===null||document.activeElement===h.current||(A=h.current)!=null&&A.contains(document.activeElement))&&(a(k,y),!0)},n?[h,r,s].concat(n):[h,r,s]);return b.useEffect(function(){if(u)return i&&d!==!0&&(t.keydown=!1),U(e,t||{},f),function(){return U.unbind(e,f)};U.unbind(e,f)},[f,e,u]),h}U.isPressed;const as=["net_burn_or_income_story_card","cash_balance","task_card","card_balance","zeni_promo_card","insights_dashboard","information_card","company_details","bill_pay_promo_card","bill_pay_card","reimbursement_card","reimbursement_promo_card","zeni_accounts_promo_card","rewards_card","treasury_promo_card"],ns=(e,a,t,n,o)=>({card:{dimension:ht(t),cardType:n,cardIndex:o,fetchState:a,disableAnimations:!1},data:e.status!=null?{balanceAmount:e.balance?.available,lastUpdatedTime:e.status.lastRefreshSuccessTime,changePercent:e.balance?.change?.percent,changeComparedToDate:e.balance?.change?.since}:void 0}),_e=(e,a,t,n,o)=>({card:{dimension:ht(t),cardType:n,cardIndex:o,fetchState:a,disableAnimations:!1},data:e}),os=(e,a,t,n)=>_e(void 0,e,ke,a,t),ss=(e,a,t,n,o)=>({card:{dimension:ht(ke),cardType:a,cardIndex:t,fetchState:e,disableAnimations:!1},data:{funds:n,hasUserSeenVideo:o,videoUrl:"https://www.youtube.com/watch?v=sqvJWKCMZgk"}}),rs=H(function(e,a){const t=ls(a.dashboardReport),n=a.passedCardsOrdered,o=a.dashboardReport.reportsInOrder,{isInterestedInChargeCard:r,cardsCreditLimit:s,cashbackRate:i,treasuryFundDetails:d,hasUserSeenTreasuryVideo:p,treasuryFetchState:C}=a;let g=n.map((u,c)=>{if(u==="reimbursement_promo_card"||u==="bill_pay_promo_card")return os(t,u,c);if(u==="zeni_promo_card")return _e({isExpressedInterest:r,creditLimit:s,cashbackRate:i,fetchState:"Completed"},a.cardBalanceFetchState,ke,u,c);if(u==="treasury_promo_card")return ss(C,u,c,d,p);if(u==="information_card")return _e(void 0,"Completed",ke,u,c);{const m=o.find(h=>h?.reportId===u);return m?function(h,f,k,y){const _=h.reportId;switch(_){case"card_balance":case"cash_balance":return[ns(h,f,k,_,y)];case"expense_automation_card":case"operating_expenses":case"revenue":case"top_expenses":case"cash_position":case"cash_in_cash_out":case"insights_dashboard":case"company_details":case"task_card":case"bill_pay_card":case"reimbursement_card":case"net_burn_or_income":case"accounts_payable_aging":case"accounts_receivable_aging":case"zeni_accounts_promo_card":case"rewards_card":return[_e(h,f,k,_,y)];case"net_burn_or_income_story_card":return[_e(h,f,k,"net_burn_or_income_story_card",y)];default:return console.error(`card type ${_} not yet supported!`),[]}}(m,m.fetchState,ke,c):[]}}).flat();return a.isSummaryCardsFiltered===!0&&(g=g.filter(u=>as.includes(u.card.cardType)==0).filter(u=>{const c=u.data?.availableNumberOfPeriods;return c!=null?c>0:u.card.cardType!="top_expenses"||u.data==null||function(m){if(m==null||m.length===0)return!0;let h=!0;for(const f of m)if(f.balance.available.amount!==0){h=!1;break}return h}(u.data.topExpenses.accountsOrdered)===!1})),{cardDataArray:g,autoCompleteData:{autoCompleteText:e.entityAutoCompleteState.autoCompleteText.navbar,entityAutoCompleteView:ee(e,"navbar")},analytics:I,isReimbursementEnabled:a.isReimbursementEnabled,isBillPayEnabled:a.isBillPayEnabled}},function(e,a){const t=a.tenantId,n=R.getSignedInUser();return{cardActions:{onCardClick:(o,r,s,i)=>{if(console.warn(`onCardClick at ${o} for the type ${r}`),r==="zeni_promo_card"&&i!=null)I.trackDashboardCardClicked("cards promo",2),I.trackZeniCardsPromoCardClicked(a.isChargeCardFeatureEnabled,i,2,`${n?.firstName??""} ${n?.lastName??""}`,a.isChargeCardFeatureEnabled?a.cardsCreditLimit:void 0),i==="Learn More"?window.open("https://www.zeni.ai/product/business-credit-card","_blank"):a.navigate("../cards/promo",{relative:"path"});else if(a.isForecastOn)switch(r){case"net_burn_or_income":case"operating_expenses":case"revenue":a.navigate(`${r}/forecast/${a.selectedForecastOnDashboard}`,{state:{referrer:s}});break;default:a.navigate(`${r}`,{state:{referrer:s}})}else r==="rewards_card"?(n!=null&&I.trackDashboardCardClicked("rewards promo",o+1),a.navigate("../../rewards/refer",{state:{referrer:s}})):r==="expense_automation_card"?(I.trackMonthEndCloseClicked(a.selectedPeriod.month,a.selectedPeriod.year,"Dashboard"),a.navigate("../../month_end_close_checks/review",{state:{referrer:"Dashboard"}})):a.navigate(`${r}`,{state:{referrer:s}})},onReloadData:(o,r)=>{const s=[];a.isApAgingFeatureEnabled===!1&&s.push("accounts_payable_aging"),a.isArAgingFeatureEnabled===!1&&s.push("accounts_receivable_aging"),a.isZeniAccountEnabled===!1&&s.push("zeni_accounts_promo_card"),a.isRewardsFeatureEnabled===!1&&s.push("rewards_card"),function(i,d,p,C){switch(d){case"card_balance":i(zt());break;case"cash_balance":i(Nt());break;case"operating_expenses":i(ra(!0));break;case"revenue":i(sa(!0));break;case"net_burn_or_income":i(oa(!0));break;case"net_burn_or_income_story_card":i(Jn(!0));break;case"cash_position":i(na(!0));break;case"top_expenses":i(aa());break;case"cash_in_cash_out":i(ta());break;case"insights_dashboard":i(Hn());break;case"bill_pay_card":i(Zn());break;case"reimbursement_card":i(qn());break;case"company_details":i(Kn(p));break;case"task_card":i($n());break;case"accounts_payable_aging":C.includes("accounts_payable_aging")===!1&&i(nt(ue()));break;case"accounts_receivable_aging":i(ot(ue()));break;case"zeni_accounts_promo_card":C.includes("zeni_accounts_promo_card")===!1&&i(Vt());break;case"rewards_card":C.includes("rewards_card")===!1&&i(zn(!0));break;default:throw new Error(`report type ${d} is not yet supported`)}}(e,r,a.companyId,s)},onTimeframeChange:(o,r)=>{I.trackTimeframeSwitch(ha(r),cs(o),"Dashboard"),function(s,i,d){switch(i){case"operating_expenses":case"revenue":case"net_burn_or_income":case"cash_position":s(me(d));break;case"top_expenses":s(ea(d));break;default:throw new Error(`report type ${i} doesn't support changeTimeframe`)}}(e,o,r)},onUpdateSelectedInsightIndex:o=>{e(Vn(o))},onCategoryClick:(o,r,s)=>{o==="bill-pay"?a.navigate("../bills",{state:{tab:r,subTab:s},relative:"path"}):o==="reimbursement"?a.navigate("../reimbursements",{state:{tab:r,subTab:s},relative:"path"}):o==="uncategorized-account-mapping"?a.navigate("../settings/accounting",{relative:"path"}):o==="show-all-tasks"?a.navigate("../tasks",{relative:"path"}):a.navigate(`../../transactions/${o}`)},onCardBtnClick:(o,r)=>{if(o==="bill_pay_promo_card"){const s="../bills",i=D(a.location.state?.pathnameStackToGoBack,a.location.pathname);a.navigate(s,{state:{pathnameStackToGoBack:i},relative:"path"})}else if(o==="reimbursement_promo_card"){const s="../reimbursements",i=D(a.location.state?.pathnameStackToGoBack,a.location.pathname);a.navigate(s,{state:{pathnameStackToGoBack:i},relative:"path"})}else if(o==="zeni_accounts_promo_card")if(a.hasZeniAccountsAdminAccess){let s="../checking/promo";r!=null&&(s=`../checking/${r}`);const i=D(a.location.state?.pathnameStackToGoBack,a.location.pathname);a.navigate(s,{state:{pathnameStackToGoBack:i},relative:"path"})}else window.open("https://www.zeni.ai/product/business-checking-accounts","_blank");else if(o==="treasury_promo_card")if(a.isUserHasTreasuryAccess){R.saveTreasuryPopupSeen(a.tenantEmailDomain,!0);const s="../treasury",i=D(a.location.state?.pathnameStackToGoBack,a.location.pathname);a.navigate(s,{state:{pathnameStackToGoBack:i},relative:"path"})}else window.open("https://www.zeni.ai/product/treasury","_blank")},onSaveClick:(o,r,s)=>{o==="net_burn_or_income_story_card"&&(I.trackUpdateBurnRateCalculatorSettings(r,s,Gn(s)),e(Nn(t,r,s)))},onVideoPlay:()=>{e(Yn())},onVideoClose:()=>{e(Un())}},autoCompleteActions:{onAutoCompleteInputChange:o=>{o.trim().length>=2?e(te({searchString:o,searchOrigin:"navbar"})):o.trim().length===0&&e(Z("navbar"))},onCancelAutoComplete:()=>{e(Z("navbar"))},onAutoCompleteEntity:o=>{let r="";r=o.type!=="vendor"||o.detailType!=="bank_merchant"&&o.detailType!=="card_merchant"?ne(o,a.tenantEmailDomain):bo(o.zeniId,o.qboId,a.tenantEmailDomain);const s=D(a.location.state?.pathnameStackToGoBack,a.location.pathname);a.navigate(r,{state:{pathnameStackToGoBack:s,referrer:"Search"}})}}}})(go);function is(){const{isAiCfoOpen:e,setIsAiCfoOpen:a}=la(),t=q(),n=V(),o=K(),r=R.getSignedInUser(),{useFeatureGate:s,useDynamicConfig:i}=Ye(),d=Ae(r),[p,C]=b.useState(!1),[g,u]=b.useState(!1),c=da(),{tenantEmailDomain:m}=z(),{isAiCfoAccessEnabled:h,onAskAiCfoClick:f}=Q({mobileExploreReferrer:"Dashboard"}),k=S(v=>v.tenantState.fetchState==="Completed"||v.tenantState.activeTenantFetchState.fetchState==="Completed"?L(v):void 0),y=k??R.getSignedInUserTenant(m),_=y.tenantId,A=y.companyId;b.useEffect(()=>{p===!1&&o.state?.message==="activation"&&(n(On(A)),C(!0))},[o.state,p,A,n]),b.useEffect(()=>{c&&!g&&o.state?.message==="open_ai_cfo_drawer"&&(a(!0),u(!0),t(o.pathname,{replace:!0,state:{...o.state,message:void 0}}))},[o.state,g,c,a,t,o.pathname]);const{isFeatureEnabled:E}=s(j.isApAgingFeatureEnabled),{isFeatureEnabled:M}=s(j.isExpenseAutomationEnabled),{isFeatureEnabled:F}=s(j.isExpenseAutomationEnabledV2),x=F||M&&d,{isFeatureEnabled:P}=s(j.isTreasuryEnabled),fe=po(x),{isFeatureEnabled:ge}=s(j.isArAgingFeatureEnabled),{isFeatureEnabled:Oe}=s(j.isDepositAccountsFeatureEnabled),{isFeatureEnabled:_t}=s(j.isReferralFeatureEnabled),{isFeatureEnabled:ka}=s(j.isChargeCardFeatureEnabled),{isFeatureEnabled:Sa}=s(j.isDashboardSidebarChristmasAnimationEnabled),{isFeatureEnabled:ya}=s(j.isDashboardSidebarNewYearAnimationEnabled),{configValue:kt}=i(ua.zeniCardsConfig),Aa=kt.charge_card_cashback_rate_per_transaction==null?.0175:kt.charge_card_cashback_rate_per_transaction;if(o.state?.message==="activation"){const v=ho(o.state?.pathnameStackToGoBack);t(o.pathname,{state:{...o.state,message:void 0,pathnameStackToGoBack:v.newStack}})}const[St,va]=b.useState(!1),[Ne,Ia]=b.useState(!1);ts("command+p, Control+p",v=>{Ia(!Ne),v.preventDefault()},{enableOnContentEditable:!0,enableOnTags:["INPUT","SELECT","TEXTAREA"]},[Ne]);const yt=k?.externalConnections?.accounting[0]?.isValid;if(r==null)throw Error("Can't access dashboard without signing in...");const oe=S(v=>L(v)?.excludedResources),Ea=S(v=>v.expenseAutomationViewState.selectedPeriodByTenantId),xa=!!k?.companyReimbursementInfo?.info?.isReimbursementEnabled,Ta=!!k?.companyBillPayInfo?.info?.isBillPayEnabled,wa=S(v=>v.treasurySetupViewState.treasuryFundsDetails).fetchStatus.fetchState,Da=k?.company!=null&&Pn(k.company),Ve=P&&Da,ze=Te(),Fa=rt(ze?.loggedInUserRoleMap),Y=[],At=oe?.resources?.find(v=>v.resource==="/reports/top_expenses")==null,Oa=oe?.resources?.find(v=>v.resource==="/reports/task_card")==null,$e=k?.userRole!=null&&Qt(k?.userRole),Pa=oe?.resources?.find(v=>v.resource==="/bills")==null&&!$e,Ba=oe?.resources?.find(v=>v.resource==="/reimbursements")==null,Ra=Bn(ze?.loggedInUserRoleMap),La=Rn(ze?.loggedInUserRoleMap),ja=k?.company?.companyChargeCardInfo?.chargeCardsCreditAccountLimit??0,Ma=k?.companyChargeCardInfo?.info?.isCompanyInterestedInChargeCard??!1,Ua=S(v=>v.treasurySetupViewState.treasuryFundsDetails).fundsDetails;At===!1&&Y.push("top_expenses"),Oa===!1&&Y.push("task_card"),Pa===!1&&Y.push("bill_pay_card","bill_pay_promo_card"),E===!1&&Y.push("accounts_payable_aging"),ge===!1&&Y.push("accounts_receivable_aging"),(x===!1||$e)&&Y.push("expense_automation_card"),Ba===!1&&Y.push("reimbursement_card","reimbursement_promo_card"),Oe===!1&&Y.push("zeni_accounts_promo_card"),_t===!1&&Y.push("rewards_card"),Ve===!1&&Y.push("treasury_promo_card");const{areTenantIdsInSync:vt}=fo();b.useLayoutEffect(()=>{St&&fe===x||yt!==!0||!vt||oe?.fetchState!=="Completed"&&oe?.fetchState!=="Error"||(va(!0),n(Ln(r.userId,A,_,!0,!1,Y)))},[St,r,_,n,At,yt,oe?.fetchState,vt]);const Ya=S(v=>v.reportUIOptionsState.forecastOnDashboard.isForecastModeOn),Ga=S(v=>v.revenueState.uiState.selectedForecast?.id),Na=S(v=>v.cardBalanceState.fetchState),ce=S(v=>jn(v,Y,r,F,M,Ve)),Va=ce.fetchState;we({isDataReady:!0});const It=k?.isTreasuryVideoViewed===!0||ce.isTreasuryVideoClosed===!0;return l.jsxs(l.Fragment,{children:[Va==="Completed"?l.jsx(xe,{analytics:I,onLoad:v=>{v.trackPageLoaded(G.Event.dashboard),Ve&&!It&&v.trackTreasuryPromoView("Dashboard Promo Video")}}):null,l.jsx(rs,{maxColumns:e?2:void 0,isAiCfoAccessEnabled:h,onAskAiCfoClick:f,onDragAndDropCard:(v,za)=>{const Et=function(Pe,Ke,Be){const qe=Be.indexOf(Pe),Ze=Be.indexOf(Ke);if(qe===-1||Ze===-1||qe===Ze)return Be;const He=[...Be];return He.splice(qe,1),He.splice(Ze,0,Pe),He}(v,za,ce.cardsOrdered);Et.some((Pe,Ke)=>Pe!==ce.cardsOrdered[Ke])&&n(Mn(Et))},dashboardReport:ce,passedCardsOrdered:ce.cardsForDashboardUI,tenantId:_,companyId:A,tenantEmailDomain:m,location:o,navigate:t,isApAgingFeatureEnabled:E,isArAgingFeatureEnabled:ge,isBillPayEnabled:Ta,isReimbursementEnabled:xa,isSummaryCardsFiltered:Ne,isForecastOn:Ya,selectedForecastOnDashboard:Ga,isVisitingFirstTime:p,isZeniAccountEnabled:Oe,isRewardsFeatureEnabled:_t,hasZeniAccountsAdminAccess:Fa,isExpenseAutomationEnabledForUser:x&&$e===!1,selectedPeriod:Ea[_],isChargeCardFeatureEnabled:ka,isUserHasCardsAccess:Ra,isUserHasTreasuryAccess:La,cardsCreditLimit:ja,cashbackRate:Aa,isInterestedInChargeCard:Ma,cardBalanceFetchState:Na,christmasAnimationEnabled:Sa,newYearAnimationEnabled:ya,treasuryFundDetails:Ua,hasUserSeenTreasuryVideo:It,treasuryFetchState:wa})]})}const cs=e=>{switch(e){case"operating_expenses":return"Operating Expenses";case"revenue":return"Revenues";case"top_expenses":return"Top Expenses";case"net_burn_or_income":return"Burn Rate";case"cash_in_cash_out":return"Cash In, Cash Out";case"cash_position":return"Cash Position"}return"Dashboard"},ls=e=>e.fetchState!=="Error"?e.fetchState:e.reportsInOrder.map(a=>a.fetchState).reduce((a,t)=>a==="In-Progress"||a==="Not-Started"?a:t);function js(){const e=Te(),a=e?.excludedResources?.find(p=>p.resource==="/reports/top_expenses")==null,{useFeatureGate:t}=Ye(),{isFeatureEnabled:n}=t(j.isApAgingFeatureEnabled),{isFeatureEnabled:o}=t(j.isArAgingFeatureEnabled),r=S(p=>L(p)),{isFeatureEnabled:s}=t(j.isDebitCardFeatureEnabled),i=Qn(s,r),d=Wn(r);return i===!0||d===!0?l.jsx(at,{children:l.jsx(w,{path:"/*",element:l.jsx(ko,{})})}):l.jsxs(at,{children:[l.jsx(w,{path:"/",element:l.jsx(is,{})}),l.jsx(w,{path:"cash_balance/*",element:l.jsx(Ot,{})}),l.jsx(w,{path:"card_balance/*",element:l.jsx(Ot,{})}),l.jsx(w,{path:"operating_expenses/*",element:l.jsx(W,{})}),l.jsx(w,{path:"operating_expenses/forecast/*",element:l.jsx(Je,{})}),l.jsx(w,{path:"revenue/forecast/*",element:l.jsx(Je,{})}),l.jsx(w,{path:"revenue/*",element:l.jsx(W,{})}),l.jsx(w,{path:"net_burn_or_income/forecast/*",element:l.jsx(Je,{})}),l.jsx(w,{path:"net_burn_or_income/*",element:l.jsx(W,{})}),n===!0&&l.jsxs(l.Fragment,{children:[l.jsx(w,{path:"accounts_payable_aging/*",element:l.jsx(Ao,{})}),l.jsx(w,{path:"accounts_payable_aging/:vendorId/:reportDate/*",element:l.jsx(yo,{})})]}),o&&l.jsxs(l.Fragment,{children:[l.jsx(w,{path:"accounts_receivable_aging/:customerId/:reportDate/*",element:l.jsx(vo,{})}),l.jsx(w,{path:"accounts_receivable_aging/*",element:l.jsx(Io,{})})]}),l.jsx(w,{path:"cash_position/*",element:l.jsx(W,{})}),l.jsx(w,{path:"top_expenses/*",element:a===!0?l.jsx(W,{}):l.jsx(ye,{})}),l.jsx(w,{path:"cash_in_cash_out/*",element:l.jsx(W,{})}),l.jsx(w,{path:"company_details",element:l.jsx(_o,{})}),l.jsx(w,{path:"referrals/*",element:l.jsx(So,{})}),l.jsx(w,{path:"*",element:l.jsx(ye,{})})]})}export{js as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{j as v}from"./liveblocks-CzlYoB8q.js";import{a as u}from"./sentry-CNCwYM02.js";import{h as w,g as b,k as y,u as A,N as k}from"./core-CGhI3jCZ.js";import{Iv as N,eO as _,fj as U,Iw as L,mm as R,Ix as z}from"./zeni-epic-state-lenVK-tm.js";import{u as O,z as f,L as T,t as S,D as j,b as $}from"./index-D7leYkuC.js";import"./mui-ILn-Gd-L.js";import{t as P}from"./getLocaleForTenant-D8dvZJzp.js";import"./recharts-D6qS-pdV.js";import"./analytics-CQOsvcBG.js";import"./plaid-D8caW90M.js";import"./dnd-DKCsG5d8.js";import"./stripe-DMRn4zHo.js";import"./lottie-CLMz6y3A.js";import"./lexical-DT64qE89.js";import"./pdf-CUf9xopY.js";import"./utils-zvjLmBW4.js";(function(){try{var t=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},s=new t.Error().stack;s&&(t._sentryDebugIds=t._sentryDebugIds||{},t._sentryDebugIds[s]="cf247005-59f6-41f4-a081-b4997d245f5a",t._sentryDebugIdIdentifier="sentry-dbid-cf247005-59f6-41f4-a081-b4997d245f5a")}catch{}})();const Q=y(function(t){return{fetchState:t.tenantState.fetchState,activeTenantFetchState:t.tenantState.activeTenantFetchState.fetchState,currentTenant:_(t),tenantsInOrder:z(t).tenantsInOrder}})(function({fetchState:t,activeTenantFetchState:s,currentTenant:o,tenantsInOrder:h}){const r=A(),p=new URLSearchParams(r.search);if(o==null||t!=="Completed"&&s!=="Completed")return null;{let m="";const n=h.map(l=>l.tenantEmailDomain),i=r.state?.origin,a=r.state?.queryParams;let c=`../${o.tenantEmailDomain}`,d=null,e=!1,g=null,I=null;const C=E(r.pathname);if(C!=null)c=`../${o.tenantEmailDomain}/${C}`,m="comingFromV2UrlPath",C==="ai-cfo/explore"&&(d=p.get("question")?.replace(/^["']|["']$/g,"")??null,e=p.get("should_submit")==="true");else if(i!=null)if(n.reduce((l,F)=>l||i.split("/").find(D=>D===F)!=null,!1))c=i,i.includes("ai-cfo")&&a!=null&&(g=a.aiCfoRef??null,I=a.aiCfoEmailRefId??null);else{const l=E(i);l!=null?(c=`../${o.tenantEmailDomain}/${l}`,m="comingFromV2UrlPath",l==="ai-cfo/explore"&&a!=null&&(a.aiCfoQuestion!=null&&(d=a.aiCfoQuestion),a.aiCfoShouldSubmit==="true"&&(e=!0))):console.warn("Don't have access to previous path tenant!")}const x=$(c,p);return v.jsx(k,{to:x,replace:!0,state:{...r.state,origin:"",message:m,aiCfoInitialQuestion:d,aiCfoShouldSubmit:e,aiCfoRef:g,aiCfoEmailRefId:I}})}});function oe(){const t=w(),{setLoading:s,clearAllLoading:o}=O(),h=u.useRef(!1),r=u.useRef(!1),p=u.useRef(null),m=b(e=>N(e)),n=b(e=>e.tenantState.fetchState),i=b(e=>e.tenantState.error),a=b(e=>e.tenantState.activeTenantFetchState.fetchState),c=b(e=>_(e)),d=f.getSignedInUser();return u.useLayoutEffect(()=>{const e=f.getActiveTenantForUser()?.tenantId??null;p.current!==e&&(p.current=e,h.current=!1,r.current=!1,s(T.TENANT_FETCHING)),!h.current||a!=="Completed"&&a!=="Error"||(h.current=!1),!r.current||n!=="Completed"&&n!=="Error"||(r.current=!1)},[a,n]),u.useEffect(()=>{const e=f.getActiveTenantForUser()?.tenantId;h.current===!1&&d!=null&&e!=null&&S.shouldFetchActiveTenant(e)&&(h.current=!0,S.markActiveTenantFetchStarted(e),n==="Completed"||a!=="Not-Started"&&a!=="Error"||(s(T.TENANT_FETCHING),t(U(d.userId,e))))},[n,a,d,t]),u.useEffect(()=>{const e=f.getSignedInUser(),g=f.getActiveTenantForUser()?.tenantId,I=g==null||a==="Completed"||a==="Error";r.current===!1&&e!=null&&I&&S.shouldFetchAllTenants()&&(r.current=!0,S.markAllTenantsFetchStarted(),(n==="Not-Started"||n==="Error"&&!L(i))&&t(R(e.userId)))},[n,a,i,d,t]),u.useEffect(()=>{f.isSignedIn()&&n==="Completed"&&m.tenantsCoreDetailsInOrder.length>0&&(f.saveSignedInUserTenants(m.tenantsCoreDetailsInOrder),o())},[m.tenantsCoreDetailsInOrder,n]),u.useEffect(()=>{!f.isSignedIn()||n!=="Completed"&&a!=="Completed"||c==null||(j.updateAppLocaleID(P(c)),o())},[n,a,c]),v.jsx(Q,{})}const q=["dashboard/cash-balance","dashboard/card-balance","dashboard/operating-expenses","dashboard/revenue","dashboard/burn-rate","dashboard/cash-position","dashboard/top-expenses","dashboard/cash-in-cash-out","dashboard","reports","forecast","uncategorized-expense","uncategorized-income","missing-receipts","bills","cards/activate","cards","reimbursements","wise","checking","aicfo"],G={"dashboard/cash-balance":"dashboard/cash_balance","dashboard/card-balance":"dashboard/card_balance","dashboard/operating-expenses":"dashboard/operating_expenses","dashboard/revenue":"dashboard/revenue","dashboard/burn-rate":"dashboard/net_burn_or_income","dashboard/cash-position":"dashboard/cash_position","dashboard/top-expenses":"dashboard/top_expenses","dashboard/cash-in-cash-out":"dashboard/cash_in_cash_out",dashboard:"dashboard",reports:"reports",forecast:"forecast","uncategorized-expense":"transactions/uncategorized-expense","uncategorized-income":"transactions/uncategorized-income","missing-receipts":"transactions/missing-receipts",bills:"bills",reimbursements:"reimbursements","cards/activate":"cards/activate",cards:"cards",wise:"bills/wise/callback/link-account",checking:"checking",aicfo:"ai-cfo/explore"};function E(t){for(const s of q)if(t.toLocaleLowerCase().includes(s))return G[s]}export{oe as default};
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import{j as l}from"./liveblocks-CzlYoB8q.js";import{j as w,u as C,g as h,k as A,l as P}from"./core-CGhI3jCZ.js";import{Mr as k,My as _,fA as q,fz as J,fy as L,io as W,Jz as K,pw as Q,eO as V,LZ as D,il as T,Ms as S,MB as F,ij as G,iH as j}from"./zeni-epic-state-lenVK-tm.js";import{bn as X,Z as R,x as N,z as U,h as Z,q as p,c as v,B as z,bo as Y,o as O,bp as ee,s as te}from"./index-D7leYkuC.js";import{n as H}from"./mui-ILn-Gd-L.js";import"./sentry-CNCwYM02.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]="a7c59b17-200f-4f1a-931e-424ecde4bb7f",e._sentryDebugIdIdentifier="sentry-dbid-a7c59b17-200f-4f1a-931e-424ecde4bb7f")}catch{}})();const ne=A(null,function(e,t){return{onSaveVendor:n=>{e(W(t.vendorId!==void 0?t.vendorId:void 0,t.billId,void 0,t.isExpressPayPage)),e(K("common")),n!=null&&e(Q(n))},onGetOtp:n=>{e(L(n,"BillPayVendor"))},onResendOtp:n=>{e(J(n,"BillPayVendor"))},onVerifyOtp:(n,a)=>{e(q(n,a,"BillPayVendor"))},onVerifyOtpSuccess:(n,a,o)=>{e(_(n,a,o))}}})(X);function M({vendorId:e,billId:t,isExpressPayPage:n}){const a=w(),o=C(),s=h(c=>k(c,e));return l.jsx(ne,{location:o,navigate:a,vendorId:e,billId:t,vendorViewDetails:s,isExpressPayPage:n??!1})}const ae=H.div`
|
|
2
|
+
display: flex;
|
|
3
|
+
height: 100vh;
|
|
4
|
+
width: 100%;
|
|
5
|
+
flex: 1 1 auto;
|
|
6
|
+
flex-direction: column;
|
|
7
|
+
align-items: center;
|
|
8
|
+
background-color: ${e=>e.theme.colors.grey4};
|
|
9
|
+
`,oe=A(function(e,t){const{vendorId:n,billId:a}=t,o=k(e,n),s=D(e,t.isVendorRecommendationEnabled,t.isZeniAccountsFeatureEnabled,a);return{billId:a,isDisabled:o.bankAccountCreationState.fetchState==="In-Progress"?"readonly":void 0,vendorViewDetails:o,file:s.file,bankAccountContext:t.bankAccountContext}},function(e,t){const{navigate:n,location:a,vendorId:o}=t;return{onFetchBankName:s=>{e(j(s))},onSaveHandler:s=>{e(G(t.bankAccountContext,s,"standard",o))},onCancel:()=>{(()=>{const s=p(a.state?.pathnameStackToGoBack),c=s.poppedPathname??E();n(c,{state:{pathnameStackToGoBack:s.newStack}})})(),e(S())},onACHDetailsUpdated:s=>{const{bankAccountSection:c}=s;e(F({data:c}))},onBackClick:()=>{if(e(T({fetchState:"Not-Started"})),t.bankAccountContext==="express-pay")n("../",{relative:"path"});else{const s=p(t.location.state?.pathnameStackToGoBack),c=s.poppedPathname??E(0);t.navigate(c,{state:{pathnameStackToGoBack:s.newStack}})}e(S())}}})(Y);function fe({vendorIdParam:e,accountContext:t}){const n=w(),a=C(),o=R(),{vendorId:s,billId:c}=P(),d=e??s,{useFeatureGate:r}=N(),i=U.getSignedInUser(),b=h(u=>V(u)),g=Z(),x=p(a.state?.pathnameStackToGoBack),f=t??(x.poppedPathname?.includes("vendor")===!0?"vendor":"billDetail"),m=h(u=>k(u,d)),{isFeatureEnabled:I}=r(v.isVendorRecommendationFeatureEnabled),{isFeatureEnabled:y}=r(v.isDepositAccountsFeatureEnabled);if(i==null)throw Error("Can't access address page without signing in...");return f==="billDetail"&&m.editVendorState?.saveStatus.fetchState==="In-Progress"?l.jsx(z,{fetchState:m.editVendorState?.saveStatus.fetchState??"Not-Started",style:{backgroundColor:g.colors.grey5}}):l.jsxs(ae,{windowSize:o,children:[l.jsx(M,{vendorId:d,billId:c}),l.jsx(oe,{location:a,navigate:n,billId:c,vendorId:d,currentTenant:b,bankAccountContext:f,isVendorRecommendationEnabled:I,isZeniAccountsFeatureEnabled:y})]})}const E=(e=2)=>{let t="../";for(let n=0;n<e;n++)t=`${t}../`;return t},me=(e,t,n)=>{let a=`/${e}/bill/${encodeURIComponent(t)}`;return n=="draft"&&(a+="/edit"),a},he=e=>`/${e}/bills`,ke=(e,t)=>{let n=`/${e}/bill`;return n=t!=null?n.concat(`/${t}/edit`):n.concat("/new"),n},B=(e,t,n,a)=>{let o=`/${e}/bill`;return o+=n!=null?`/${n}/edit/vendor`:"/new/vendor",o+=a!=null?`/${a}/edit/${t}`:`/create/${t}`,o};function Se(e,t,n){return B(e,"ach",t,n)}function ve(e,t,n){return B(e,"domestic",t,n)}function ge(e,t,n){return B(e,"international",t,n)}const se=(e,t,n)=>{let a=`/${e}/bill/`;return a=n!=null?a.concat(`${encodeURIComponent(n)}/${t}/`):a.concat(`new/${t}/`),a},re=H.div`
|
|
10
|
+
display: flex;
|
|
11
|
+
height: 100vh;
|
|
12
|
+
width: 100%;
|
|
13
|
+
flex: 1 1 auto;
|
|
14
|
+
flex-direction: column;
|
|
15
|
+
align-items: center;
|
|
16
|
+
background-color: ${e=>e.theme.colors.grey4};
|
|
17
|
+
box-shadow: ${e=>`0px 2px ${O.sp1} ${e.theme.colors.dropShadowNormal}`};
|
|
18
|
+
`,ce=A(function(e,t){const{vendorId:n,billId:a}=t,o=k(e,n),s=D(e,t.isVendorRecommendationEnabled,t.isZeniAccountsFeatureEnabled,a);return{billId:a,isDisabled:o.bankAccountCreationState.fetchState==="In-Progress"?"readonly":void 0,vendorViewDetails:o,file:s.file,bankAccountContext:t.bankAccountContext}},function(e,t){const{billId:n,navigate:a,location:o,vendorId:s,currentTenant:c}=t,{tenantEmailDomain:d}=c;return{onFetchBankName:r=>{e(j(r))},onSaveHandler:r=>{e(G(t.bankAccountContext,r,"us-domestic",s))},onWireDetailsUpdated:r=>{const{bankAccountSection:i}=r;e(F({data:i}))},onCancel:()=>{(()=>{const r=p(o.state?.pathnameStackToGoBack),i=r.poppedPathname??$();a(i,{state:{pathnameStackToGoBack:r.newStack}})})(),e(S())},onAddressClick:r=>{if(t.bankAccountContext==="express-pay")a("./add-address");else{const i=se(d,r,n),b=te(o.state?.pathnameStackToGoBack,o.pathname);a(i,{state:{pathnameStackToGoBack:b}})}},onBackClick:()=>{if(e(T({fetchState:"Not-Started"})),t.bankAccountContext==="express-pay")a("../",{relative:"path"});else{const r=p(t.location.state?.pathnameStackToGoBack),i=r.poppedPathname??$(0);t.navigate(i,{state:{pathnameStackToGoBack:r.newStack}})}e(S())}}})(ee);function xe({vendorIdParam:e,accountContext:t}){const n=w(),a=C(),o=R(),{vendorId:s,billId:c}=P(),d=e??s,r=U.getSignedInUser(),{useFeatureGate:i}=N(),b=Z(),g=h(u=>V(u)),x=p(a.state?.pathnameStackToGoBack),f=t??(x.poppedPathname?.includes("vendor")===!0?"vendor":"billDetail"),m=h(u=>k(u,d)),{isFeatureEnabled:I}=i(v.isVendorRecommendationFeatureEnabled),{isFeatureEnabled:y}=i(v.isDepositAccountsFeatureEnabled);if(r==null)throw Error("Can't access address page without signing in...");return f==="billDetail"&&m.editVendorState?.saveStatus.fetchState==="In-Progress"?l.jsx(z,{fetchState:m.editVendorState?.saveStatus.fetchState??"Not-Started",style:{backgroundColor:b.colors.grey5,boxShadow:`0px 2px ${O.sp1} ${b.colors.dropShadowNormal}`}}):l.jsxs(re,{windowSize:o,children:[l.jsx(M,{vendorId:d,billId:c}),l.jsx(ce,{location:a,navigate:n,billId:c,vendorId:d,currentTenant:g,bankAccountContext:f,isVendorRecommendationEnabled:I,isZeniAccountsFeatureEnabled:y})]})}const $=(e=2)=>{let t="../";for(let n=0;n<e;n++)t=`${t}../`;return t};export{fe as A,xe as D,M as V,me as a,se as b,ke as c,ve as d,he as g,ge as i,Se as v};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{j as d}from"./liveblocks-CzlYoB8q.js";import{Z as c,E as l,h as f}from"./index-D7leYkuC.js";import{D as p}from"./mui-ILn-Gd-L.js";import"./sentry-CNCwYM02.js";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},r=new e.Error().stack;r&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[r]="10c380cc-f513-470e-9bfa-e47a49402143",e._sentryDebugIdIdentifier="sentry-dbid-10c380cc-f513-470e-9bfa-e47a49402143")}catch{}})();const u={drawerLeftMargin:new l(0,0,240)};function h(e){const{isOpen:r,drawerLeftMargin:o,children:t,onClose:a}=e,n=c(),s=o?.valuePx(n)??u.drawerLeftMargin.valuePx(n),i=f();return d.jsx(p,{anchor:"right",open:r,PaperProps:{style:{width:`calc(100% - ${s})`}},slotProps:{backdrop:{style:{backgroundColor:i.colors.black,opacity:.8,cursor:"pointer"}}},onClose:a,children:t})}export{h as D};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{j as s}from"./liveblocks-CzlYoB8q.js";import{a as d}from"./sentry-CNCwYM02.js";import{j as A,h as B,u as q,l as K,g as c,N,k as O,n as F,o as _}from"./core-CGhI3jCZ.js";import{KG as z,eO as J,K3 as M,kr as R,GO as I,KL as W,Jy as Y,jr as $,GP as S,K8 as L,K9 as V,JA as H,Jz as Q}from"./zeni-epic-state-lenVK-tm.js";import{aN as U,d as X,q as Z,s as tt}from"./index-D7leYkuC.js";import"./mui-ILn-Gd-L.js";import{d as k}from"./decodeURIComponentSafe-CZEzMrgK.js";import{w as et}from"./withTransactionSidePanel-caCfdZEh.js";import{e as at,b as nt}from"./routePaths-DhV05MHP.js";import"./recharts-D6qS-pdV.js";import"./analytics-CQOsvcBG.js";import"./plaid-D8caW90M.js";import"./dnd-DKCsG5d8.js";import"./stripe-DMRn4zHo.js";import"./lottie-CLMz6y3A.js";import"./lexical-DT64qE89.js";import"./pdf-CUf9xopY.js";import"./utils-zvjLmBW4.js";import"./useAskAiCfoHostNavButtonProps-BYwM8iQc.js";import"./useFetchSuggestedQuestionsWhenReady-CLFroGaE.js";import"./TransactionDetailScreen-ByHgtPQ5.js";(function(){try{var a=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new a.Error().stack;t&&(a._sentryDebugIds=a._sentryDebugIds||{},a._sentryDebugIds[t]="66c8f577-29f0-47d1-9c92-6d9dc40aa3c6",a._sentryDebugIdIdentifier="sentry-dbid-66c8f577-29f0-47d1-9c92-6d9dc40aa3c6")}catch{}})();const ot=O(function(a,t){const e=t.entity,o=W(a,t.entity,"EntityDetail");return{selectedEntity:e,autoCompleteData:{autoCompleteText:e.name,entityAutoCompleteView:Y(a,"common")},trendWithTransactionsReport:o,analytics:X,isAccountingClassesEnabled:$(a)}},function(a,t){return{onTransactionItemClick:e=>{if(t.openTransactionPanel)return void t.openTransactionPanel(e.id,e.type);const o=`${nt(e,t.tenantEmailDomain)}`,l=tt(t.location.state?.pathnameStackToGoBack,t.location.pathname);t.navigate(o,{state:{pathnameStackToGoBack:l}})},autoCompleteActions:{onAutoCompleteInputChange:e=>{e.trim().length>=2?a(H({searchString:e,searchOrigin:"common"})):e.trim().length===0&&a(Q("common"))},onAutoCompleteEntity:e=>{const o=at(e,t.tenantEmailDomain);a(L()),a(V()),t.resetTrendIsFetchedStates(),t.navigate(o,{replace:!0,state:{pathnameStackToGoBack:t.location.state?.pathnameStackToGoBack}})},onCancelAutoComplete:()=>{const e=Z(t.location.state?.pathnameStackToGoBack),o=e.poppedPathname??C();t.navigate(o,{state:{pathnameStackToGoBack:e.newStack}})}},onTrendSelectedPeriodChange:e=>{if(t.closeSidePanel?.(),e==null)t.defaultTransactionTimePeriod!=null&&a(S(t.entity,"EntityDetail",{timeframe:"quarter",timePeriod:t.defaultTransactionTimePeriod}));else{const o=e.currentTimePeriod==null?e.addTimePeriod:{startDate:e.addTimePeriod.startDate,endDate:e.currentTimePeriod.endDate};a(I(t.entity,"EntityDetail",{timeframe:e.timeframe,timePeriod:e.addTimePeriod})),a(S(t.entity,"EntityDetail",{timeframe:e.timeframe,timePeriod:o}))}}}})(U),it=et(function({entityType:a,...t}){const e=A(),o=B(),l=q(),[m,T]=d.useState(!1),[h,D]=d.useState(!1),{tenantEmailDomain:b,entityIdEncoded:G,entityNameEncoded:j}=K(),r=k(G??""),p=k(j??""),u=rt(r,p),x=[r,p].filter(n=>n!=null),i={name:p,id:r,type:a,zeniId:r,qboId:r},g=c(n=>z(n.customerIncomeState,n.vendorExpenseState,n.trendState,i,"quarter")),v=c(n=>J(n).company?.companyInfo.firstMonthOfFY??1),f=c(n=>M(n.trendWithTransactionsState,i,"EntityDetail"));d.useEffect(()=>{m===!1&&u===!0&&(T(!0),o(R(i)))},[m,u,i]);const P=c(n=>n.trendState.fetchState),E=f?.selectedPeriod?.timePeriod??g,w=function(n,y){return n!=null&&y!=null?{startDate:n.startDate,endDate:y?.endDate}:y}(f?.selectedPeriod?.timePeriod,g);return d.useEffect(()=>{m===!0&&h===!1&&P==="Completed"&&(D(!0),E!=null&&o(I(i,"EntityDetail",{timeframe:f?.selectedPeriod?.timeframe??"quarter",timePeriod:E})))},[m,h,P]),u?s.jsx(ot,{firstMonthOfFY:v,tenantEmailDomain:b,location:l,navigate:e,entity:i,defaultTransactionTimePeriod:w,resetTrendIsFetchedStates:()=>{T(!1),D(!1)},...t}):s.jsx(N,{to:C(x.length)})}),rt=(a,t)=>t!=null&&t.length>0&&a!=null&&a.length>0,C=(a=2)=>{let t="../";for(let e=0;e<a;e++)t=`${t}../`;return t};function jt({entityType:a}){return s.jsx(F,{children:s.jsx(_,{path:"/:entityIdEncoded/:entityNameEncoded/*",element:s.jsx(it,{entityType:a})})})}export{jt as EntityDetailRoutes,jt as default};
|