@zeniai/web-app-ui 5.0.11-qa → 5.0.12-dev
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-RZvAbm7b.js +1 -0
- package/dist/assets/AddressScreen-fg6k52x4.js +9 -0
- package/dist/assets/AiCfoScreen-jLlIeMQC.js +11 -0
- package/dist/assets/{BillPayApprovalRoutes-D1G1EEnU.js → BillPayApprovalRoutes-BuPgz0VZ.js} +1 -1
- package/dist/assets/{BillPayRoutes-DzsUW3zL.js → BillPayRoutes-CQiDaAlk.js} +10 -10
- package/dist/assets/{BusinessVerificationPageScreen-D3SOVYA6.js → BusinessVerificationPageScreen-Z_-aQI_5.js} +1 -1
- package/dist/assets/{ChargeCardRoutes-BzSBkBL5.js → ChargeCardRoutes-mbNdCQ5I.js} +1 -1
- package/dist/assets/CompanyPassportScreen-Dof8QyCO.js +1 -0
- package/dist/assets/{ConnectionAuthScreen-Co54Kb5x.js → ConnectionAuthScreen-D3iY5CZB.js} +1 -1
- package/dist/assets/CustomerOnboardingAuthScreen-InYw6yWH.js +1 -0
- package/dist/assets/{CustomerOnboardingRoutes-BeHfvWk3.js → CustomerOnboardingRoutes-DNuKHrz2.js} +4 -4
- package/dist/assets/{DashboardRoutes-Byh6Wica.js → DashboardRoutes-B8hxKVWr.js} +1 -1
- package/dist/assets/{DefaultTenantHome-VOG2pJf5.js → DefaultTenantHome-By01i4JV.js} +1 -1
- package/dist/assets/{DomesticWireDetailScreen-D--tuAm3.js → DomesticWireDetailScreen-BknvyqFc.js} +1 -1
- package/dist/assets/{DrawerScreen-B5IcX1NQ.js → DrawerScreen-CPuMvDg7.js} +1 -1
- package/dist/assets/{EntityDetailRoutes-BgOBvlJ0.js → EntityDetailRoutes-CehcYova.js} +1 -1
- package/dist/assets/{ExpenseAutomationRoutes-g5zvTO2O.js → ExpenseAutomationRoutes--qEGkNAZ.js} +5 -5
- package/dist/assets/FeaturePreviewScreen-BDotwidZ.js +1 -0
- package/dist/assets/MagicLinkRoutes-B7lTPJi5.js +72 -0
- package/dist/assets/MagicLinkSignInScreen-CIKfHfB4.js +12 -0
- package/dist/assets/{MobileAppDrawer-D4Lm7SnG.js → MobileAppDrawer-gMG7WLxC.js} +1 -1
- package/dist/assets/NotFoundScreen-DKiPvQrK.js +1 -0
- package/dist/assets/{NotificationRoutes-DBvEJit6.js → NotificationRoutes-DRSZhtx9.js} +1 -1
- package/dist/assets/{PandLWithForecastRoutes-DdrBP85e.js → PandLWithForecastRoutes-CzASlWgo.js} +1 -1
- package/dist/assets/{PeopleRoutes-BElhGlGm.js → PeopleRoutes-2EjYhZMl.js} +3 -3
- package/dist/assets/PerformanceRoutes-hWmBUaHL.js +1 -0
- package/dist/assets/{Preview-CKmcpteJ.js → Preview-C3TcKeZU.js} +1 -1
- package/dist/assets/{QBOConnectionScreen-C3OSQzLP.js → QBOConnectionScreen-CHf-hKza.js} +1 -1
- package/dist/assets/{ReferralListScreen-DdUl0T7k.js → ReferralListScreen-DmQVP2Me.js} +2 -2
- package/dist/assets/{ReimbursementApprovalRoutes-tJ8vLs2I.js → ReimbursementApprovalRoutes-D_6AwVb9.js} +1 -1
- package/dist/assets/{ReimbursementApprovalRuleDetailScreen-C-7RGxpi.js → ReimbursementApprovalRuleDetailScreen-CMkDXxn8.js} +1 -1
- package/dist/assets/{ReimbursementRoutes-CDamna2D.js → ReimbursementRoutes-DpKjqTcA.js} +4 -4
- package/dist/assets/{ReportsRoutes-BmQ5XJSE.js → ReportsRoutes-D7nHEFeV.js} +1 -1
- package/dist/assets/RewardsRoutes-BgSfJ48K.js +1 -0
- package/dist/assets/{ScreenRoutes-B-Nb3wBc.js → ScreenRoutes-CPqWF-Ww.js} +2 -2
- package/dist/assets/{SettingsRoutes-BIWZSv3F.js → SettingsRoutes-B5wg5ovm.js} +7 -7
- package/dist/assets/{SetupPagesScreen-DhkETt-o.js → SetupPagesScreen-BanbOOgQ.js} +5 -5
- package/dist/assets/SignInScreen-CZI8HoAd.js +1 -0
- package/dist/assets/SignOutScreen-CpX3JLX_.js +9 -0
- package/dist/assets/{TaskListScreen-PZG8iT0i.js → TaskListScreen-C090Vv7j.js} +2 -2
- package/dist/assets/TaskRoutes-D4NPFxWo.js +9 -0
- package/dist/assets/TransactionDetailRoutes-DQpiFP5C.js +1 -0
- package/dist/assets/{TransactionDetailScreen-C2vSq-tp.js → TransactionDetailScreen-B_ny21sj.js} +1 -1
- package/dist/assets/{TransactionListRoutes-BAY1BHys.js → TransactionListRoutes-BeBY15XF.js} +1 -1
- package/dist/assets/{TreasuryRoutes-DPgpDe0A.js → TreasuryRoutes-Cfd3gerU.js} +5 -5
- package/dist/assets/{VendorsRoutes-CEWWGZ92.js → VendorsRoutes-Bg_qB9es.js} +1 -1
- package/dist/assets/WiseConfirmationScreen-RvJMSTLm.js +12 -0
- package/dist/assets/{ZeniAccountRoutes-cVh2JOw7.js → ZeniAccountRoutes-B-_OsFeA.js} +8 -8
- package/dist/assets/{ZeniAccountStatementScreen-C4d7tQ2P.js → ZeniAccountStatementScreen-CVRPKBLf.js} +1 -1
- package/dist/assets/{accountMappingHelper-BIF_cEGy.js → accountMappingHelper-DUJwjv4V.js} +1 -1
- package/dist/assets/{analytics-YTm4e0V2.js → analytics-DuZD1FBf.js} +1 -1
- package/dist/assets/{analyticsHelper-DpEWp8DR.js → analyticsHelper-CezXrIid.js} +1 -1
- package/dist/assets/{core-cQ_UGuA8.js → core-CHx9v1R3.js} +1 -1
- package/dist/assets/{decodeURIComponentSafe-CzQtaU9d.js → decodeURIComponentSafe-IyDHJK_-.js} +1 -1
- package/dist/assets/{dnd-BKb14efZ.js → dnd-Ci4anwe2.js} +1 -1
- package/dist/assets/{empty-DNHXYLLo.js → empty-CXijM8Yn.js} +1 -1
- package/dist/assets/{empty-DZNLkcgK.js → empty-DC_zzPcD.js} +1 -1
- package/dist/assets/{emptyVideoElement-CBnuw-R_.js → emptyVideoElement-C2-_1qo0.js} +1 -1
- package/dist/assets/{epic-B020-YAE.js → epic-ClqXieiv.js} +1 -1
- package/dist/assets/getLocaleForTenant-BobWg4Hu.js +1 -0
- package/dist/assets/{index-Dv9AJolW.js → index-BJaFzjLY.js} +1 -1
- package/dist/assets/{index-jWD7VWky.js → index-BYgpnDFl.js} +1 -1
- package/dist/assets/{index-BU0MpF_k.js → index-DW2V2aM1.js} +1 -1
- package/dist/assets/{index-DAAltHsi.js → index-DXrrGmep.js} +1 -1
- package/dist/assets/{index-COB8HvQe.js → index-DZjotWfe.js} +2 -2
- package/dist/assets/{index-6MiIPIRp.js → index-DvW5_poC.js} +1 -1
- package/dist/assets/{index-D90Egw4V.js → index-_YbuoSTd.js} +12394 -12319
- package/dist/assets/{lexical-Dhe13gAE.js → lexical-DQpmcVQ9.js} +1 -1
- package/dist/assets/{liveblocks-BGrTvYCQ.js → liveblocks-CQd3J_Jz.js} +1 -1
- package/dist/assets/{lottie-DunuFFva.js → lottie-Dnly7PBz.js} +1 -1
- package/dist/assets/{mui-bgnk9Y8D.js → mui-B5MJXy46.js} +1 -1
- package/dist/assets/{pathToGoBack-CrwnkzZo.js → pathToGoBack-eAzzRDV4.js} +1 -1
- package/dist/assets/{pdf-pb-ViLbf.js → pdf-DYwn2DuC.js} +4 -4
- package/dist/assets/{pdf-lib-CWFeXKHq.js → pdf-lib-DV6Dg2jz.js} +1 -1
- package/dist/assets/{plaid-D86kekqV.js → plaid-CcgrQve1.js} +1 -1
- package/dist/assets/{pusher-Dl_gaLc0.js → pusher-SIueaQE_.js} +1 -1
- package/dist/assets/{react-DjMti-au.js → react-BOC875DV.js} +1 -1
- package/dist/assets/{react-B-GK82Mh.js → react-B_6uxiQm.js} +1 -1
- package/dist/assets/{react-BSv395g0.js → react-C7IO6ybw.js} +1 -1
- package/dist/assets/{react-CsXicgmu.js → react-Df7SmVuu.js} +1 -1
- package/dist/assets/{react-BGx71-xQ.js → react-fY2vQLDW.js} +1 -1
- package/dist/assets/{react-amVh9j5p.js → react-vH2UXDZO.js} +1 -1
- package/dist/assets/{recharts-d-EnR1VF.js → recharts-nKX4-UUs.js} +1 -1
- package/dist/assets/{routePaths-D-FUiDMc.js → routePaths-abbP8AF2.js} +1 -1
- package/dist/assets/{sentry-B-sG2CiU.js → sentry-BO53Tmje.js} +1 -1
- package/dist/assets/{url-DXZa-f5b.js → url-CXCHGUpp.js} +1 -1
- package/dist/assets/{url-BOXP7fzy.js → url-kAF8xbJK.js} +1 -1
- package/dist/assets/useAskAiCfoHostNavButtonProps-BndHsfWo.js +1 -0
- package/dist/assets/{useDeviceId-D2nSr5j2.js → useDeviceId-J1-jcXdc.js} +1 -1
- package/dist/assets/useFetchSuggestedQuestionsWhenReady-B8UnhkhU.js +1 -0
- package/dist/assets/{useInitialThreadRequest-lcYH42cE.js → useInitialThreadRequest-DORcYYgp.js} +1 -1
- package/dist/assets/{utils-CU50wlH3.js → utils-DpJstXha.js} +1 -1
- package/dist/assets/{withTransactionSidePanel-o5Urauag.js → withTransactionSidePanel-Bvasj9MO.js} +1 -1
- package/dist/assets/{zeni-epic-state-BObvmHAZ.js → zeni-epic-state-T7UkKQQw.js} +3 -3
- package/dist/index.html +1 -1
- package/package.json +3 -3
- package/dist/assets/AddressRoutes-BkGoEeBW.js +0 -1
- package/dist/assets/AddressScreen-DouQ279W.js +0 -9
- package/dist/assets/AiCfoScreen-iECVixdo.js +0 -11
- package/dist/assets/CompanyPassportScreen-CL7XHD_F.js +0 -1
- package/dist/assets/CustomerOnboardingAuthScreen-BWGLMwze.js +0 -1
- package/dist/assets/FeaturePreviewScreen-BpVrGVPq.js +0 -1
- package/dist/assets/MagicLinkRoutes-DsWR1Cjg.js +0 -72
- package/dist/assets/MagicLinkSignInScreen-DlkgV1Z3.js +0 -12
- package/dist/assets/NotFoundScreen-ClHj7JWB.js +0 -1
- package/dist/assets/PerformanceRoutes-DdVgwzjx.js +0 -1
- package/dist/assets/RewardsRoutes-B7CBXK5j.js +0 -1
- package/dist/assets/SignInScreen-BmYSO_nO.js +0 -1
- package/dist/assets/SignOutScreen-kE-3hEpL.js +0 -9
- package/dist/assets/TaskRoutes-BaQsCuUy.js +0 -9
- package/dist/assets/TransactionDetailRoutes-D--EBwAj.js +0 -1
- package/dist/assets/WiseConfirmationScreen-Cy7oxgWV.js +0 -12
- package/dist/assets/getLocaleForTenant-DVON2lLJ.js +0 -1
- package/dist/assets/useAskAiCfoHostNavButtonProps-B7HVYURz.js +0 -1
- package/dist/assets/useFetchSuggestedQuestionsWhenReady-CE9JYbxS.js +0 -1
package/dist/assets/{CustomerOnboardingRoutes-BeHfvWk3.js → CustomerOnboardingRoutes-DNuKHrz2.js}
RENAMED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import{j as a}from"./liveblocks-
|
|
1
|
+
import{j as a}from"./liveblocks-CQd3J_Jz.js";import{t as $e,A as Ce}from"./AddressScreen-fg6k52x4.js";import ze from"./NotFoundScreen-DKiPvQrK.js";import{a as g}from"./sentry-BO53Tmje.js";import{j as oe,u as se,h as ie,l as re,g as D,N as E,k as ce,i as Me,n as Qe,o as M}from"./core-CHx9v1R3.js";import{Y as de,S as le,z as B,i as ue,h as qe,s as _,v as V,x as Y,c as N,B as je,e as W,ak as Je,J as Ke,al as Ie,j as te,am as Ze,an as ke,o as Ye,ao as He,ap as Ee,aq as We}from"./index-_YbuoSTd.js";import{bm as Xe,eM as ee,fb as et,eT as pe,eR as me,bu as tt,mf as at,f7 as nt,bL as ot,i_ as ae,j1 as ve,IY as st,bQ as it,b$ as ge,rH as fe,rs as rt,J8 as X,rI as _e,GE as ct,k2 as Ue,J9 as Ve,Ja as dt,Jb as lt,Jc as ut,iY as pt,i$ as mt,ru as Be,rG as gt,bB as Te,cr as ft,rU as xe,pB as ht,pp as yt,jW as St,fA as bt,fz as Ct,fy as It,Jd as kt,rm as Et,rV as Tt,rY as xt,r$ as Ot,s5 as Pt,cR as At}from"./zeni-epic-state-T7UkKQQw.js";import{n as he}from"./mui-B5MJXy46.js";import{g as Dt,h as Ft,q as ne}from"./QBOConnectionScreen-CHf-hKza.js";import"./recharts-nKX4-UUs.js";import"./analytics-DuZD1FBf.js";import"./plaid-CcgrQve1.js";import"./dnd-Ci4anwe2.js";import"./stripe-DMRn4zHo.js";import"./lottie-Dnly7PBz.js";import"./lexical-DQpmcVQ9.js";import"./pdf-DYwn2DuC.js";import"./utils-DpJstXha.js";import"./empty-DC_zzPcD.js";import"./pdf-lib-DV6Dg2jz.js";import"./index-DvW5_poC.js";import"./url-kAF8xbJK.js";import"./index-DXrrGmep.js";import"./decodeURIComponentSafe-IyDHJK_-.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]="1deecfdd-4518-42ee-bc61-c2460fd7c99f",t._sentryDebugIdIdentifier="sentry-dbid-1deecfdd-4518-42ee-bc61-c2460fd7c99f")}catch{}})();const wt=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"}})}}})(Je),jt=()=>{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(),f=Xe(i),{useFeatureGate:m}=ue(),k=qe(),{isFeatureEnabled:T}=m(_.isApAgingFeatureEnabled),{isFeatureEnabled:x}=m(_.isArAgingFeatureEnabled),{isFeatureEnabled:I}=m(_.isDepositAccountsFeatureEnabled),{isFeatureEnabled:h}=m(_.isReferralFeatureEnabled),{isFeatureEnabled:U}=m(_.isExpenseAutomationEnabled),{isFeatureEnabled:C}=m(_.isExpenseAutomationEnabledV2),{isFeatureEnabled:F}=m(_.isDebitCardFeatureEnabled),$=C||U&&f,c=D(l=>ee(l)),{isFeatureEnabled:L}=m(_.isTreasuryEnabled),w=c.company!=null&&et(c.company),R=L&&w,O=D(l=>l.onboardingCustomerViewState.fetchState),b=c.excludedResources,G=c.companyId??B.getSignedInUserTenant(e)?.companyId;if(i==null)throw Error("Can't access onboarding flow without signing in...");const j=pe(F,c),P=me(c),A=[],J=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,q=b?.resources?.find(l=>l.resource==="/reimbursements")==null;if(J===!1&&A.push("top_expenses"),z===!1&&A.push("task_card"),v===!1&&A.push("bill_pay_card","bill_pay_promo_card"),q===!1&&A.push("reimbursement_card","reimbursement_promo_card"),I===!1&&A.push("zeni_accounts_promo_card"),h===!1&&A.push("rewards_card"),g.useEffect(()=>{O!=="Completed"||d||j||P||(r(!0),s(at(i.userId,G,c.tenantId,!0,!1,A)))},[d,O,j,P,i,c.tenantId,s]),g.useEffect(()=>{(j||P)&&setTimeout(()=>{S(!0)},5e3)},[j,P]),O!=="Completed")return a.jsx(E,{to:"../"});if(O==="Completed"&&p){const l=V(o.state?.pathnameStackToGoBack,o.pathname);if(j)return a.jsx(E,{to:"../../checking",state:{...o.state,pathnameStackToGoBack:l,message:"activation"}});if(P)return a.jsx(E,{to:"../../cards",state:{...o.state,pathnameStackToGoBack:l,message:"activation"}})}return n?.loggedInUserRoleMap!=null?a.jsxs(a.Fragment,{children:[a.jsx(Y,{analytics:N,onLoad:l=>(K=>K.trackPageLoaded(W.Event.onboardingDashboardActivation))(l)}),a.jsx(wt,{navigate:t,location:o,themeState:u,signedInUser:i,isApAgingFeatureEnabled:T,isArAgingFeatureEnabled:x,shouldFetchZeniAccountsPromoCard:I,shouldFetchRewardsPlanCard:h,isExpenseAutomationEnabledForUser:$,isExpenseAutomationFeatureEnabledV2:C,isTreasuryEnabled:R,loggedInUserRoleMap:n?.loggedInUserRoleMap})]}):a.jsx(je,{fetchState:"In-Progress",style:{backgroundColor:k.colors.grey5}})},Oe=he.div`
|
|
2
2
|
display: flex;
|
|
3
3
|
height: 100vh;
|
|
4
4
|
background-color: ${t=>t.theme.colors.grey4};
|
|
5
|
-
`,Pe=
|
|
5
|
+
`,Pe=he.div`
|
|
6
6
|
display: flex;
|
|
7
7
|
flex-direction: column;
|
|
8
8
|
align-items: center;
|
|
@@ -16,8 +16,8 @@ import{j as a}from"./liveblocks-BGrTvYCQ.js";import{t as $e,A as Ce}from"./Addre
|
|
|
16
16
|
}
|
|
17
17
|
|
|
18
18
|
${t=>t.windowSize!=="small"?"overflow: auto;":""}
|
|
19
|
-
`,Ae=ce(function(t,o){const{companyId:s,isAdmin:u,currentTenant:d,isOnAddressPage:r}=o,p=B.getSignedInUser(),
|
|
19
|
+
`,Ae=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=fe(t,s),f=Ve(t),m=ge(d?.userRole??[])&&i.updateStatus.fetchState!=="In-Progress"?void 0:"readonly",k=dt(t.userRoleConfigState);return{onboardingCustomerView:i,analytics:N,isRefreshingViewInBackground:!1,isDisabled:m,companyTitles:k.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:f,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(Pt(e,n))},onEstablishConnectionClick:(e,n)=>{t(Ot(e,n))},onUpdatePaymentAccountStatus:(e,n,i)=>{t(xt(e,n,i))},onUpdatePaymentAccountLoginStatus:(e,n)=>{t(Tt(!1,e,n))},onEstablishConnectionSuccess:()=>{t(Et(s,!0,!1))},handleOnConnectClick:()=>{N.trackOnboardingConnectQBO(),ne.handleClick()},updateQBOPopupState:e=>{t(X({isQBOPopupOpen:e}))},onCompanyOfficerUpdated:e=>{const n=e.map(i=>{const{officerType:f,userId:m,name:k,email:T,ssn:x,nationalityCountryCode:I,dob:h,phone:U,syncToken:C,selectDocument:F,role:$,ownership:c,isSelectedForVerification:L,userVerificationStatus:w,fileIds:R,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:f,userId:m,firstName:k.firstName,lastName:k.lastName,email:T,ssn:x,nationalityCountryCode:I?.selectedOption!=null?Ee(I.selectedOption):void 0,phone:U,birthday:h!=null?Te(h?.toString()):h,syncToken:C,titleAtCompany:$.selectedOption,ownershipInCompany:c,documentTypeSelectedForVerification:b,isSelectedForVerification:L,userVerificationStatus:w,fileIds:R,additionalDocumentTypesRequestedForVerification:[],additionalSubmittedDocumentsForVerificationFileIds:[],areAdditionalDocumentsRequestedForVerification:!1,areAdditionalDocumentsSubmittedForVerification:!1,isPhoneVerified:O}});t(xe({officers:n}))},onGetOtp:(e,n)=>{t(It(e,"CustomerOnboarding")),n!=null&&t(kt({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(ht(e,n.split(".")[0]))},onCompanyDetailsChanged:e=>{const{companyDescription:n,companyIndustry:i,companyIndustryType:f,companyLegalName:m,companyTaxId:k,companyWebsite:T,companyPhone:x,primaryContactEmail:I,primaryContactName:h,primaryContactUserId:U,primaryContactSyncToken:C,syncToken:F,fileIds:$,typeOfIncorporation:c,stateOfIncorporation:L,incDate:w,companySourceOfFunds:R,companySourceOfFundsDescription:O,companySubIndustry:b,countriesOfOperations:G,purposeOfAccount:j,purposeOfAccountDescription:P,regulatedStatus:A,regulatedStatusDescription:J,transactionVolume:z,transactionVolumeDescription:Q,usNexus:v,usNexusTypes:q}=e,l={companyId:s,companyDescription:n,companyIndustry:i.selectedOption,companyIndustryType:f?.selectedOption??"",companyLegalName:m,taxIdOrEIN:k,website:T!=""&&T!=null?ft(T):void 0,phone:x,syncToken:F,fileIds:$,incDate:w!=null?Te(w?.toString()):w,typeOfIncorporation:c?.selectedOption??"",stateOfIncorporation:L?.selectedOption??"",companySourceOfFunds:R?.selectedOption??"",companySourceOfFundsDescription:O,companySubIndustry:b?.selectedOption??"",countriesOfOperations:G?.selectedOptions.map(Z=>Z.length===2?Z:Ee(Z))??[],purposeOfAccount:j?.selectedOption??"",purposeOfAccountDescription:P,regulatedStatus:A??"",regulatedStatusDescription:J,transactionVolume:z?.selectedOption??"",transactionVolumeDescription:Q,usNexus:v,usNexusTypes:q?.selectedOptions??[]},K={userId:U,firstName:h.firstName,lastName:h.lastName,email:I,syncToken:C};t(xe({companyDetails:l,primaryContactDetails:K}))},onAddressClick:(e,n)=>{const i=De(S,e,n),f=V(p.state?.pathnameStackToGoBack,p.pathname);r(i,{state:{pathnameStackToGoBack:f}})},onRegisteredAddressClick:(e,n)=>{const i=De(S,e,n),f=V(p.state?.pathnameStackToGoBack,p.pathname);r(i,{state:{pathnameStackToGoBack:f}})},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=Ke(),S=de(),[e,n]=g.useState(!1),[i,f]=g.useState(!1),[m,k]=g.useState(!1),{tenantEmailDomain:T}=re(),x=le(),{useFeatureGate:I}=ue(),{isFeatureEnabled:h}=I(_.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),w=D(y=>y.cardPaymentViewState),R=Ie(w.addCardPaymentSourceStatus.fetchState),O=w.addCardPaymentSourceStatus.fetchState,{code:b,realmId:G,state:j}=Dt(d.search),P=c.externalConnections?.accounting[0],A=P?.connectionType,J=P?.connectionName,z=P?.connectionId??"",Q=B.getSignedInUser()?.userId??"";g.useEffect(()=>{i||(f(!0),r(ae()))},[i,r]),g.useEffect(()=>{m||(ve(["card"]),k(!0))},[m]),g.useEffect(()=>{R==="In-Progress"&&O==="Completed"&&r(ae())},[R,O]),g.useEffect(()=>{Ft(b,G,j,z,Q)===!0&&c.externalConnections?.saveConnectionState!=="In-Progress"&&C==="Completed"&&(r(st(c.tenantId,{connection_type:A??"accounting",connection_name:J??"quickbooks_online",authorization_code:b,realm_id:G,connection_id:z,user_id:Q},it(window.location.origin+"/onboarding/auth"))),N.trackOnboardingSaveQBOConnection(G,z),u(d.pathname))},[b,G,j,d.pathname,C]),g.useEffect(()=>{ne.isInitiated===!1&&C==="Completed"&&ne.init("/onboarding/auth",c.tenantEmailDomain)},[C]);const v=c.companyId??B.getSignedInUserTenant(T)?.companyId,q=ge(c?.userRole??[]),l=D(y=>fe(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 K=Ie(l.companyDetailsLocalData?.addressStatus);g.useEffect(()=>{l.companyDetailsLocalData?.registeredAddressStatus?.addressToCreate==null&&l.companyDetailsLocalData?.addressStatus?.addressToCreate!=null&&K==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(h,c),Re=me(c),ye=c.company?.companyOnboardingInfo.isOnboardingCompleted,Se=y=>y.trackPageLoaded(W.Event.onboardingPage),be=c.productSettings.isOtherProductsEnabled,Ge=c.productSettings.isTreasuryEnabled;if(ye===!0){if(!be)return Ge?a.jsx(E,{to:"../../treasury"}):Le?a.jsx(E,{to:"../../checking"}):Re?a.jsx(E,{to:"../../cards"}):a.jsx(E,{to:"../../dashboard"});const y=l.updateStatus.fetchState==="In-Progress";if(be&&!y)return t?a.jsxs(Oe,{children:[a.jsx(Y,{analytics:N,onLoad:Ne=>Se(Ne)}),a.jsx(Ae,{navigate:u,location:d,companyId:v,currentTenant:c,isAdmin:q,isOnAddressPage:o,themeState:S,googleAPIKey:te.googleMapsAPIKey}),s!=null?a.jsx(Pe,{windowSize:p,children:s}):null]}):a.jsx(E,{to:"../../onboarding/thankyou"})}else if(ye===!1&&x?.loggedInUserRoleMap!=null)return Z===!0?a.jsx(E,{to:"../../onboarding/thankyou"}):a.jsxs(Oe,{children:[a.jsx(Y,{analytics:N,onLoad:y=>Se(y)}),a.jsx(Ae,{navigate:u,location:d,companyId:v,currentTenant:c,isAdmin:q,isOnAddressPage:o,themeState:S,googleAPIKey:te.googleMapsAPIKey}),s!=null?a.jsx(Pe,{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=he.div`
|
|
20
20
|
display: flex;
|
|
21
21
|
height: 100vh;
|
|
22
22
|
background-color: ${t=>t.theme.colors.grey4};
|
|
23
|
-
`,we=ce(function(t,o){const{companyId:s,currentTenant:u}=o,d=
|
|
23
|
+
`,we=ce(function(t,o){const{companyId:s,currentTenant:u}=o,d=fe(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"}})}}})(We),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(h=>ee(h)),f=i.productSettings.isOtherProductsEnabled;g.useEffect(()=>{o(Be(m,!1,!f))},[]);const m=i.companyId??B.getSignedInUserTenant(p)?.companyId;if(S.loggedInUser==null)throw Error("Can't access onboarding flow without signing in...");const k=pe(r,i),T=me(i),x=D(h=>h.onboardingCustomerViewState.updateStatus.fetchState),I=i.company?.companyOnboardingInfo.isOnboardingCompleted;return I!==!0||f?x==="Completed"&&I===!0&&f&&S?.loggedInUserRoleMap!=null?a.jsxs(Fe,{children:[a.jsx(Y,{analytics:N,onLoad:h=>{h.trackPageLoaded(W.Event.onboardingLandingPage,"Onboarding",At(i.productSettings))}}),a.jsx(we,{navigate:t,showUpdatePaymentDetailButton:f,location:s,companyId:m,currentTenant:i,themeState:u,isVisitingFirstTime:e})]}):x==="Completed"&&I===!1&&S?.loggedInUserRoleMap!=null?a.jsxs(Fe,{children:[a.jsx(Y,{analytics:N,onLoad:h=>{h.trackPageLoaded(W.Event.onboardingInterimPage)}}),a.jsx(we,{navigate:t,showUpdatePaymentDetailButton:f,location:s,companyId:m,currentTenant:i,themeState:u,isVisitingFirstTime:e})]}):a.jsx(je,{fetchState:x}):k?a.jsx(E,{to:"../../checking"}):T?a.jsx(E,{to:"../../cards"}):a.jsx(E,{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(jt,{})}),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 i}from"./liveblocks-BGrTvYCQ.js";import{l as G,g as k,u as $,h as V,j as q,k as Z,n as We,o as D}from"./core-cQ_UGuA8.js";import{eM as j,Jt as Fe,bB as Ut,bp as de,KG as Va,hO as Na,KH as Tt,KI as Ga,hR as Qe,KJ as we,KK as za,hW as $a,KL as wt,KM as qa,h_ as et,KN as xe,KO as Za,cN as at,KP as Ha,KQ as Ja,JN as Xa,iU as Wa,KR as Qa,bm as _e,KS as Yt,Jh as Q,bc as Kt,j6 as Vt,mp as Nt,iR as Gt,Jj as ee,Ji as z,KT as en,KU as tn,KV as zt,KW as pe,tx as ke,ty as ye,tV as ue,tP as te,tC as Se,KX as an,KY as nn,KZ as on,K_ as $t,K$ as he,L0 as sn,dF as Oe,q9 as qt,L1 as rn,L2 as cn,L3 as ln,L4 as nt,IE as ot,jm as st,u1 as rt,qh as dn,L5 as un,tz as xt,qc as ie,q8 as Zt,L6 as oe,L7 as mn,L8 as ct,ID as it,s9 as Ht,L9 as pn,La as hn,Lb as fn,Lc as lt,sm as gn,Ld as bn,tB as Dt,s8 as Jt,Le as se,Lf as Cn,bu as Xt,u5 as Wt,Lg as _n,Lh as kn,Li as yn,Lj as dt,u0 as Sn,Lk as vn,tA as Ft,u4 as Qt,Ll as re,Lm as In,Ln as An,Lo as ea,jb as ta,mm as aa,jg as na,mk as oa,mj as sa,mi as ra,rx as En,fb as Tn,cK as wn,cL as xn,mf as Dn,f7 as Fn,mv as On,Lp as Pn,D9 as Bn,Lq as Rn,Lr as jn,Ls as Ln,b5 as ut,eZ as Mn,gw as Un,fC as Yn,mq as Kn,iK as Vn,mn as Nn,ml as Gn,eT as zn,eR as $n}from"./zeni-epic-state-BObvmHAZ.js";import{z as B,T as H,v as F,d as S,D as N,aP as qn,K as Pe,w as ve,aQ as ca,f as Y,aR as Zn,S as Ie,aS as ia,i as mt,s as L,h as Hn,aT as Jn,aU as Xn,aV as Ae,aW as Wn,a as Qn,al as eo,aI as to,q as ao,M as no,aX as oo,aY as ge}from"./index-D90Egw4V.js";import{n as pt}from"./mui-bgnk9Y8D.js";import{a as _}from"./sentry-B-sG2CiU.js";import{w as la}from"./withTransactionSidePanel-o5Urauag.js";import{b as da,t as me,e as ae,a as ht,v as so}from"./routePaths-D-FUiDMc.js";import{u as Be}from"./useAskAiCfoHostNavButtonProps-B7HVYURz.js";import{c as Re}from"./useFetchSuggestedQuestionsWhenReady-CE9JYbxS.js";import Ce from"./NotFoundScreen-ClHj7JWB.js";import{t as ua}from"./analyticsHelper-DpEWp8DR.js";import{C as ro}from"./CompanyPassportScreen-CL7XHD_F.js";import{F as co}from"./FeaturePreviewScreen-BpVrGVPq.js";import{R as io}from"./ReferralListScreen-DdUl0T7k.js";import"./recharts-d-EnR1VF.js";import"./analytics-YTm4e0V2.js";import"./plaid-D86kekqV.js";import"./dnd-BKb14efZ.js";import"./stripe-DMRn4zHo.js";import"./lottie-DunuFFva.js";import"./lexical-Dhe13gAE.js";import"./pdf-pb-ViLbf.js";import"./utils-CU50wlH3.js";import"./TransactionDetailScreen-C2vSq-tp.js";import"./decodeURIComponentSafe-CzQtaU9d.js";import"./MobileAppDrawer-D4Lm7SnG.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]="02390172-c454-4582-82fc-4f27cafa9342",e._sentryDebugIdIdentifier="sentry-dbid-02390172-c454-4582-82fc-4f27cafa9342")}catch{}})();const lo=la(function({openTransactionPanel:e,panelContent:a,sidePanelIsOpen:t,sidePanelIsFullView:n}){const{vendorId:o,reportDate:r}=G(),s=B.getSignedInUser(),c=k(T=>T.tenantState.currentTenantId),u=k(T=>j(T)),{tenantEmailDomain:m}=G(),C=$(),b=u?.companyName??"",h={userId:s?.userId??"",sessionId:s?.zeniSessionId??"",tenantId:c??""},l=_.useMemo(()=>({authParams:h,companyName:b,downloadEndPoint:`${H}/agingDetailedReport`,timezone:Fe()}),[]),d=_.useMemo(()=>r!=null?Ut(r):de(),[r]),p=V(),g=q(),f=k(T=>Va(T,d,o)),v=_.useCallback(()=>{o!=null&&f.fetchState!=="In-Progress"&&f.fetchState!=="Completed"&&p(Na(o,d))},[d]),E=_.useCallback(()=>{g("../../",{relative:"path"})},[]),R=_.useCallback((T,J)=>{p(Tt({sortKey:T,sortOrder:J}))},[]),A=_.useCallback(T=>{p(Tt({downloadState:T}))},[]),I=_.useCallback(T=>{if(e)e(T.transactionId,T.transactionType);else if(m!=null){const J=da({id:T.transactionId,type:T.transactionType},m);g(J);const Le=F(C.state?.pathnameStackToGoBack,C.pathname);g(J,{state:{pathnameStackToGoBack:Le}})}},[m,e]),x=_.useCallback(()=>{f.vendor!=null&&S.trackApAgingDetail("AP Aging",d.format(N.getLocalizedStrings().dateFormat.analytics.YYYYDashMMDashDDFormat),f.vendor.id,f.vendor.name)},[f.vendor,d]);return _.useEffect(()=>{v()},[]),_.useEffect(()=>{f.fetchState==="Completed"&&x()},[x,f.fetchState]),i.jsx(qn,{apAgingDetail:f,downloadParams:l,reportDate:d,analytics:S,onTransactionClick:I,onReload:v,onBackClick:E,onColumnSortConfigChanged:R,updateDownloadStateHandler:A,panelContent:a,sidePanelIsOpen:t,sidePanelIsFullView:n})}),uo=()=>{const{isAiCfoOpen:e,setIsAiCfoOpen:a}=Pe(),t=V(),n=q(),o=k(I=>Ga(I)),{isAiCfoAccessEnabled:r,onAskAiCfoClick:s}=Be({isAiCfoOpen:e,setIsAiCfoOpen:a,mobileExploreReferrer:"AP Aging"});Re({isDataReady:o.fetchState==="Completed"});const c=B.getSignedInUser(),u=k(I=>I.tenantState.currentTenantId),m=k(I=>j(I)),C=m?.companyName??"",b={userId:c?.userId??"",sessionId:c?.zeniSessionId??"",tenantId:u??""},h=_.useMemo(()=>({authParams:b,companyName:C,downloadEndPoint:`${H}/agingReport`,timezone:Fe()}),[]),l=o.apAgingUIState.selectedDate??de(),d=_.useCallback(()=>{o.fetchState!=="In-Progress"&&o.fetchState!=="Completed"&&t(Qe(l))},[]);_.useEffect(()=>{d()},[]);const p=_.useCallback(()=>{n("../",{relative:"path"})},[]),g=_.useCallback(I=>{t(we({searchString:I}))},[]),f=_.useCallback((I,x)=>{t(we({sortKey:x,sortOrder:I}))},[]),v=_.useCallback(I=>{n(`./${I}/${l.format(N.getLocalizedStrings().dateFormat.analytics.YYYYDashMMDashDDFormat)}`)},[l]),E=_.useCallback(I=>{t(we({downloadState:I}))},[]),R=_.useCallback((I,x)=>{},[]),A=_.useCallback((I,x)=>{t(we({selectedDate:I,agingDateSelectionType:x})),t(Qe(I))},[]);return i.jsxs(i.Fragment,{children:[o.fetchState==="Completed"?i.jsx(ve,{analytics:S,onLoad:I=>I.trackPageLoaded(Y.Event.agingReport,"AP Aging")}):null,i.jsx(ca,{uiState:o.apAgingUIState,report:o,downloadParams:h,analytics:S,onReloadReport:d,onBackClick:p,onSearchTextChange:g,onSortOrderChange:f,onEntityNameClick:v,updateDownloadStateHandler:E,onSelectedDateChanged:A,onNodeCollapseToggled:R,isAiCfoAccessEnabled:r,onAskAiCfoClick:s})]})},mo=la(function({openTransactionPanel:e,panelContent:a,sidePanelIsOpen:t,sidePanelIsFullView:n}){const{customerId:o,reportDate:r}=G(),s=B.getSignedInUser(),c=k(x=>j(x)),{tenantEmailDomain:u}=G(),m=$(),C=c.companyName,b={userId:s?.userId??"",sessionId:s?.zeniSessionId??"",tenantId:c.tenantId},h=_.useMemo(()=>({authParams:b,companyName:C,downloadEndPoint:`${H}/agingDetailedReport`,timezone:Fe()}),[]),l=_.useMemo(()=>r!=null?Ut(r):de(),[r]),d=V(),p=q(),g=k(x=>za(x,l,o)),f=_.useCallback(()=>{o!=null&&g.fetchState!=="In-Progress"&&g.fetchState!=="Completed"&&d($a(o,l))},[l]),v=_.useCallback(()=>{p("../../",{relative:"path"})},[]),E=_.useCallback((x,T)=>{d(wt({sortKey:x,sortOrder:T}))},[]),R=_.useCallback(x=>{d(wt({downloadState:x}))},[]),A=_.useCallback(x=>{if(e)e(x.transactionId,x.transactionType);else if(u!=null){const T=da({id:x.transactionId,type:x.transactionType},u);p(T);const J=F(m.state?.pathnameStackToGoBack,m.pathname);p(T,{state:{pathnameStackToGoBack:J}})}},[u,e]),I=_.useCallback(()=>{g.customer!=null&&S.trackArAgingDetail("AR Aging",l.format(N.getLocalizedStrings().dateFormat.analytics.YYYYDashMMDashDDFormat),g.customer.id,g.customer.name)},[g.customer,l]);return _.useEffect(()=>{f()},[]),_.useEffect(()=>{g.fetchState==="Completed"&&I()},[g.fetchState,I]),i.jsx(Zn,{arAgingDetail:g,downloadParams:h,reportDate:l,analytics:S,onTransactionClick:A,onReload:f,onBackClick:v,onColumnSortConfigChanged:E,updateDownloadStateHandler:R,panelContent:a,sidePanelIsOpen:t,sidePanelIsFullView:n})}),po=()=>{const{isAiCfoOpen:e,setIsAiCfoOpen:a}=Pe(),t=V(),n=q(),o=k(A=>qa(A)),{isAiCfoAccessEnabled:r,onAskAiCfoClick:s}=Be({isAiCfoOpen:e,setIsAiCfoOpen:a,mobileExploreReferrer:"AR Aging"});Re({isDataReady:o.fetchState==="Completed"});const c=B.getSignedInUser(),u=k(A=>j(A)),m=u.companyName,C={userId:c?.userId??"",sessionId:c?.zeniSessionId??"",tenantId:u.tenantId},b=_.useMemo(()=>({authParams:C,companyName:m,downloadEndPoint:`${H}/agingReport`,timezone:Fe()}),[]),h=o.arAgingUIState.selectedDate??de(),l=_.useCallback(()=>{o.fetchState!=="In-Progress"&&o.fetchState!=="Completed"&&t(et(h))},[]);_.useEffect(()=>{l()},[]);const d=_.useCallback(()=>{n("../",{relative:"path"})},[]),p=_.useCallback(A=>{t(xe({searchString:A}))},[]),g=_.useCallback((A,I)=>{t(xe({sortKey:I,sortOrder:A}))},[]),f=_.useCallback(A=>{n(`./${A}/${h.format(N.getLocalizedStrings().dateFormat.analytics.YYYYDashMMDashDDFormat)}`)},[h]),v=_.useCallback(A=>{t(xe({downloadState:A}))},[]),E=_.useCallback((A,I)=>{t(xe({selectedDate:A,agingDateSelectionType:I})),t(et(A))},[]),R=_.useCallback((A,I)=>{t(Za({nodeId:A,isCollapsed:I}))},[]);return i.jsxs(i.Fragment,{children:[o.fetchState==="Completed"?i.jsx(ve,{analytics:S,onLoad:A=>A.trackPageLoaded(Y.Event.agingReport,"AR Aging")}):null,i.jsx(ca,{uiState:o.arAgingUIState,report:o,downloadParams:b,analytics:S,onReloadReport:l,onBackClick:d,onSearchTextChange:p,onSortOrderChange:g,onEntityNameClick:f,updateDownloadStateHandler:v,onSelectedDateChanged:E,onNodeCollapseToggled:R,isAiCfoAccessEnabled:r,onAskAiCfoClick:s})]})},ma=(e,a)=>({key:a,title:e.accountName,amount:e.balance?.available,logoUri:e.logo?.toString(),source:e});function pa(e,a){const t=Xa(a.firstMonthOfFY);return{onItemClick:(n,o)=>{const r=o.accountName===""?o.accountDescription:o.accountName,s=me(a.tenantEmailDomain,o.accountId,o.accountType,r,"quarter",t,!1),c=F(a.location.state?.pathnameStackToGoBack,a.location.pathname);a.navigate(s,{state:{pathnameStackToGoBack:c,referrer:a.referrerType}})},onSetAccountsStatementDate:(n,o)=>{e(Wa(n,o))},onPromoCardBtnClick:n=>{if(a.isZeniAccountsAdmin){let o=`../../checking/${n}`;n?S.trackZeniAccountsCashBalancePromoClicked("Move Money"):(S.trackZeniAccountsCashBalancePromoClicked("Sign Up for Free"),o="../../checking/promo");const r=F(a.location.state?.pathnameStackToGoBack,a.location.pathname);a.navigate(o,{state:{pathnameStackToGoBack:r}})}else S.trackZeniAccountsCashBalancePromoClicked("Learn More"),window.open("https://www.zeni.ai/product/business-checking-accounts","_blank")}}}const ho=Z(function(e){const a=Ha(e).accountsInOrder.map((n,o)=>ma(n,o)),t=Ja(e);return{sectionTitle:N.getLocalizedStrings().balanceCard.cashBalanceSectionTitle,transactionArray:a,zeniAccountsPromoCardReport:t,fetchState:e.cashBalanceState.fetchState,analytics:S}},pa)(ia),fo=Z(function(e){const a=Qa(e).accountsInOrder.map((o,r)=>ma(o,r)),t=B.getSignedInUser(),n=_e(t);return{sectionTitle:N.getLocalizedStrings().balanceCard.cardBalanceSectionTitle,transactionArray:a,isZeniUser:n,fetchState:e.cardBalanceState.fetchState,analytics:S}},pa)(ia);function go(){const e=q(),a=$(),{tenantEmailDomain:t}=G(),n=Ie(),o=k(s=>j(s).company?.companyInfo.firstMonthOfFY??1),r=at(n?.loggedInUserRoleMap);return k(s=>s.cashBalanceState.fetchState)==="Error"?i.jsx(Ce,{}):i.jsx(ho,{tenantEmailDomain:t,location:a,referrerType:"Cash Balance",navigate:e,isZeniAccountsAdmin:r,firstMonthOfFY:o})}function bo(){const e=q(),a=$(),{tenantEmailDomain:t}=G(),n=Ie(),o=at(n?.loggedInUserRoleMap),r=k(s=>j(s).company?.companyInfo.firstMonthOfFY??1);return k(s=>s.cardBalanceState.fetchState)==="Error"?i.jsx(Ce,{}):i.jsx(fo,{tenantEmailDomain:t,location:a,referrerType:"Card Balance",navigate:e,isZeniAccountsAdmin:o,firstMonthOfFY:r})}const Co=pt.div`
|
|
1
|
+
import{j as i}from"./liveblocks-CQd3J_Jz.js";import{l as G,g as k,u as $,h as V,j as q,k as Z,n as We,o as D}from"./core-CHx9v1R3.js";import{eM as j,Jt as Fe,bB as Ut,bp as de,KG as Va,hO as Na,KH as Tt,KI as Ga,hR as Qe,KJ as we,KK as za,hW as $a,KL as wt,KM as qa,h_ as et,KN as xe,KO as Za,cN as at,KP as Ha,KQ as Ja,JN as Xa,iU as Wa,KR as Qa,bm as _e,KS as Yt,Jh as Q,bc as Kt,j6 as Vt,mp as Nt,iR as Gt,Jj as ee,Ji as z,KT as en,KU as tn,KV as zt,KW as pe,tx as ke,ty as ye,tV as ue,tP as te,tC as Se,KX as an,KY as nn,KZ as on,K_ as $t,K$ as he,L0 as sn,dF as Oe,q9 as qt,L1 as rn,L2 as cn,L3 as ln,L4 as nt,IE as ot,jm as st,u1 as rt,qh as dn,L5 as un,tz as xt,qc as ie,q8 as Zt,L6 as oe,L7 as mn,L8 as ct,ID as it,s9 as Ht,L9 as pn,La as hn,Lb as fn,Lc as lt,sm as gn,Ld as bn,tB as Dt,s8 as Jt,Le as se,Lf as Cn,bu as Xt,u5 as Wt,Lg as _n,Lh as kn,Li as yn,Lj as dt,u0 as Sn,Lk as vn,tA as Ft,u4 as Qt,Ll as re,Lm as In,Ln as An,Lo as ea,jb as ta,mm as aa,jg as na,mk as oa,mj as sa,mi as ra,rx as En,fb as Tn,cK as wn,cL as xn,mf as Dn,f7 as Fn,mv as On,Lp as Pn,D9 as Bn,Lq as Rn,Lr as jn,Ls as Ln,b5 as ut,eZ as Mn,gw as Un,fC as Yn,mq as Kn,iK as Vn,mn as Nn,ml as Gn,eT as zn,eR as $n}from"./zeni-epic-state-T7UkKQQw.js";import{z as B,T as H,v as F,c as S,D as N,aP as qn,K as Pe,x as ve,aQ as ca,e as Y,aR as Zn,S as Ie,aS as ia,i as mt,s as L,h as Hn,aT as Jn,aU as Xn,aV as Ae,aW as Wn,a as Qn,al as eo,aI as to,q as ao,N as no,aX as oo,aY as ge}from"./index-_YbuoSTd.js";import{n as pt}from"./mui-B5MJXy46.js";import{a as _}from"./sentry-BO53Tmje.js";import{w as la}from"./withTransactionSidePanel-Bvasj9MO.js";import{b as da,t as me,e as ae,a as ht,v as so}from"./routePaths-abbP8AF2.js";import{u as Be}from"./useAskAiCfoHostNavButtonProps-BndHsfWo.js";import{c as Re}from"./useFetchSuggestedQuestionsWhenReady-B8UnhkhU.js";import Ce from"./NotFoundScreen-DKiPvQrK.js";import{t as ua}from"./analyticsHelper-CezXrIid.js";import{C as ro}from"./CompanyPassportScreen-Dof8QyCO.js";import{F as co}from"./FeaturePreviewScreen-BDotwidZ.js";import{R as io}from"./ReferralListScreen-DmQVP2Me.js";import"./recharts-nKX4-UUs.js";import"./analytics-DuZD1FBf.js";import"./plaid-CcgrQve1.js";import"./dnd-Ci4anwe2.js";import"./stripe-DMRn4zHo.js";import"./lottie-Dnly7PBz.js";import"./lexical-DQpmcVQ9.js";import"./pdf-DYwn2DuC.js";import"./utils-DpJstXha.js";import"./TransactionDetailScreen-B_ny21sj.js";import"./decodeURIComponentSafe-IyDHJK_-.js";import"./MobileAppDrawer-gMG7WLxC.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]="0f07319b-42b7-40c7-90ef-263c4c4328b7",e._sentryDebugIdIdentifier="sentry-dbid-0f07319b-42b7-40c7-90ef-263c4c4328b7")}catch{}})();const lo=la(function({openTransactionPanel:e,panelContent:a,sidePanelIsOpen:t,sidePanelIsFullView:n}){const{vendorId:o,reportDate:r}=G(),s=B.getSignedInUser(),c=k(T=>T.tenantState.currentTenantId),u=k(T=>j(T)),{tenantEmailDomain:m}=G(),C=$(),b=u?.companyName??"",h={userId:s?.userId??"",sessionId:s?.zeniSessionId??"",tenantId:c??""},l=_.useMemo(()=>({authParams:h,companyName:b,downloadEndPoint:`${H}/agingDetailedReport`,timezone:Fe()}),[]),d=_.useMemo(()=>r!=null?Ut(r):de(),[r]),p=V(),g=q(),f=k(T=>Va(T,d,o)),v=_.useCallback(()=>{o!=null&&f.fetchState!=="In-Progress"&&f.fetchState!=="Completed"&&p(Na(o,d))},[d]),E=_.useCallback(()=>{g("../../",{relative:"path"})},[]),R=_.useCallback((T,J)=>{p(Tt({sortKey:T,sortOrder:J}))},[]),A=_.useCallback(T=>{p(Tt({downloadState:T}))},[]),I=_.useCallback(T=>{if(e)e(T.transactionId,T.transactionType);else if(m!=null){const J=da({id:T.transactionId,type:T.transactionType},m);g(J);const Le=F(C.state?.pathnameStackToGoBack,C.pathname);g(J,{state:{pathnameStackToGoBack:Le}})}},[m,e]),x=_.useCallback(()=>{f.vendor!=null&&S.trackApAgingDetail("AP Aging",d.format(N.getLocalizedStrings().dateFormat.analytics.YYYYDashMMDashDDFormat),f.vendor.id,f.vendor.name)},[f.vendor,d]);return _.useEffect(()=>{v()},[]),_.useEffect(()=>{f.fetchState==="Completed"&&x()},[x,f.fetchState]),i.jsx(qn,{apAgingDetail:f,downloadParams:l,reportDate:d,analytics:S,onTransactionClick:I,onReload:v,onBackClick:E,onColumnSortConfigChanged:R,updateDownloadStateHandler:A,panelContent:a,sidePanelIsOpen:t,sidePanelIsFullView:n})}),uo=()=>{const{isAiCfoOpen:e,setIsAiCfoOpen:a}=Pe(),t=V(),n=q(),o=k(I=>Ga(I)),{isAiCfoAccessEnabled:r,onAskAiCfoClick:s}=Be({isAiCfoOpen:e,setIsAiCfoOpen:a,mobileExploreReferrer:"AP Aging"});Re({isDataReady:o.fetchState==="Completed"});const c=B.getSignedInUser(),u=k(I=>I.tenantState.currentTenantId),m=k(I=>j(I)),C=m?.companyName??"",b={userId:c?.userId??"",sessionId:c?.zeniSessionId??"",tenantId:u??""},h=_.useMemo(()=>({authParams:b,companyName:C,downloadEndPoint:`${H}/agingReport`,timezone:Fe()}),[]),l=o.apAgingUIState.selectedDate??de(),d=_.useCallback(()=>{o.fetchState!=="In-Progress"&&o.fetchState!=="Completed"&&t(Qe(l))},[]);_.useEffect(()=>{d()},[]);const p=_.useCallback(()=>{n("../",{relative:"path"})},[]),g=_.useCallback(I=>{t(we({searchString:I}))},[]),f=_.useCallback((I,x)=>{t(we({sortKey:x,sortOrder:I}))},[]),v=_.useCallback(I=>{n(`./${I}/${l.format(N.getLocalizedStrings().dateFormat.analytics.YYYYDashMMDashDDFormat)}`)},[l]),E=_.useCallback(I=>{t(we({downloadState:I}))},[]),R=_.useCallback((I,x)=>{},[]),A=_.useCallback((I,x)=>{t(we({selectedDate:I,agingDateSelectionType:x})),t(Qe(I))},[]);return i.jsxs(i.Fragment,{children:[o.fetchState==="Completed"?i.jsx(ve,{analytics:S,onLoad:I=>I.trackPageLoaded(Y.Event.agingReport,"AP Aging")}):null,i.jsx(ca,{uiState:o.apAgingUIState,report:o,downloadParams:h,analytics:S,onReloadReport:d,onBackClick:p,onSearchTextChange:g,onSortOrderChange:f,onEntityNameClick:v,updateDownloadStateHandler:E,onSelectedDateChanged:A,onNodeCollapseToggled:R,isAiCfoAccessEnabled:r,onAskAiCfoClick:s})]})},mo=la(function({openTransactionPanel:e,panelContent:a,sidePanelIsOpen:t,sidePanelIsFullView:n}){const{customerId:o,reportDate:r}=G(),s=B.getSignedInUser(),c=k(x=>j(x)),{tenantEmailDomain:u}=G(),m=$(),C=c.companyName,b={userId:s?.userId??"",sessionId:s?.zeniSessionId??"",tenantId:c.tenantId},h=_.useMemo(()=>({authParams:b,companyName:C,downloadEndPoint:`${H}/agingDetailedReport`,timezone:Fe()}),[]),l=_.useMemo(()=>r!=null?Ut(r):de(),[r]),d=V(),p=q(),g=k(x=>za(x,l,o)),f=_.useCallback(()=>{o!=null&&g.fetchState!=="In-Progress"&&g.fetchState!=="Completed"&&d($a(o,l))},[l]),v=_.useCallback(()=>{p("../../",{relative:"path"})},[]),E=_.useCallback((x,T)=>{d(wt({sortKey:x,sortOrder:T}))},[]),R=_.useCallback(x=>{d(wt({downloadState:x}))},[]),A=_.useCallback(x=>{if(e)e(x.transactionId,x.transactionType);else if(u!=null){const T=da({id:x.transactionId,type:x.transactionType},u);p(T);const J=F(m.state?.pathnameStackToGoBack,m.pathname);p(T,{state:{pathnameStackToGoBack:J}})}},[u,e]),I=_.useCallback(()=>{g.customer!=null&&S.trackArAgingDetail("AR Aging",l.format(N.getLocalizedStrings().dateFormat.analytics.YYYYDashMMDashDDFormat),g.customer.id,g.customer.name)},[g.customer,l]);return _.useEffect(()=>{f()},[]),_.useEffect(()=>{g.fetchState==="Completed"&&I()},[g.fetchState,I]),i.jsx(Zn,{arAgingDetail:g,downloadParams:h,reportDate:l,analytics:S,onTransactionClick:A,onReload:f,onBackClick:v,onColumnSortConfigChanged:E,updateDownloadStateHandler:R,panelContent:a,sidePanelIsOpen:t,sidePanelIsFullView:n})}),po=()=>{const{isAiCfoOpen:e,setIsAiCfoOpen:a}=Pe(),t=V(),n=q(),o=k(A=>qa(A)),{isAiCfoAccessEnabled:r,onAskAiCfoClick:s}=Be({isAiCfoOpen:e,setIsAiCfoOpen:a,mobileExploreReferrer:"AR Aging"});Re({isDataReady:o.fetchState==="Completed"});const c=B.getSignedInUser(),u=k(A=>j(A)),m=u.companyName,C={userId:c?.userId??"",sessionId:c?.zeniSessionId??"",tenantId:u.tenantId},b=_.useMemo(()=>({authParams:C,companyName:m,downloadEndPoint:`${H}/agingReport`,timezone:Fe()}),[]),h=o.arAgingUIState.selectedDate??de(),l=_.useCallback(()=>{o.fetchState!=="In-Progress"&&o.fetchState!=="Completed"&&t(et(h))},[]);_.useEffect(()=>{l()},[]);const d=_.useCallback(()=>{n("../",{relative:"path"})},[]),p=_.useCallback(A=>{t(xe({searchString:A}))},[]),g=_.useCallback((A,I)=>{t(xe({sortKey:I,sortOrder:A}))},[]),f=_.useCallback(A=>{n(`./${A}/${h.format(N.getLocalizedStrings().dateFormat.analytics.YYYYDashMMDashDDFormat)}`)},[h]),v=_.useCallback(A=>{t(xe({downloadState:A}))},[]),E=_.useCallback((A,I)=>{t(xe({selectedDate:A,agingDateSelectionType:I})),t(et(A))},[]),R=_.useCallback((A,I)=>{t(Za({nodeId:A,isCollapsed:I}))},[]);return i.jsxs(i.Fragment,{children:[o.fetchState==="Completed"?i.jsx(ve,{analytics:S,onLoad:A=>A.trackPageLoaded(Y.Event.agingReport,"AR Aging")}):null,i.jsx(ca,{uiState:o.arAgingUIState,report:o,downloadParams:b,analytics:S,onReloadReport:l,onBackClick:d,onSearchTextChange:p,onSortOrderChange:g,onEntityNameClick:f,updateDownloadStateHandler:v,onSelectedDateChanged:E,onNodeCollapseToggled:R,isAiCfoAccessEnabled:r,onAskAiCfoClick:s})]})},ma=(e,a)=>({key:a,title:e.accountName,amount:e.balance?.available,logoUri:e.logo?.toString(),source:e});function pa(e,a){const t=Xa(a.firstMonthOfFY);return{onItemClick:(n,o)=>{const r=o.accountName===""?o.accountDescription:o.accountName,s=me(a.tenantEmailDomain,o.accountId,o.accountType,r,"quarter",t,!1),c=F(a.location.state?.pathnameStackToGoBack,a.location.pathname);a.navigate(s,{state:{pathnameStackToGoBack:c,referrer:a.referrerType}})},onSetAccountsStatementDate:(n,o)=>{e(Wa(n,o))},onPromoCardBtnClick:n=>{if(a.isZeniAccountsAdmin){let o=`../../checking/${n}`;n?S.trackZeniAccountsCashBalancePromoClicked("Move Money"):(S.trackZeniAccountsCashBalancePromoClicked("Sign Up for Free"),o="../../checking/promo");const r=F(a.location.state?.pathnameStackToGoBack,a.location.pathname);a.navigate(o,{state:{pathnameStackToGoBack:r}})}else S.trackZeniAccountsCashBalancePromoClicked("Learn More"),window.open("https://www.zeni.ai/product/business-checking-accounts","_blank")}}}const ho=Z(function(e){const a=Ha(e).accountsInOrder.map((n,o)=>ma(n,o)),t=Ja(e);return{sectionTitle:N.getLocalizedStrings().balanceCard.cashBalanceSectionTitle,transactionArray:a,zeniAccountsPromoCardReport:t,fetchState:e.cashBalanceState.fetchState,analytics:S}},pa)(ia),fo=Z(function(e){const a=Qa(e).accountsInOrder.map((o,r)=>ma(o,r)),t=B.getSignedInUser(),n=_e(t);return{sectionTitle:N.getLocalizedStrings().balanceCard.cardBalanceSectionTitle,transactionArray:a,isZeniUser:n,fetchState:e.cardBalanceState.fetchState,analytics:S}},pa)(ia);function go(){const e=q(),a=$(),{tenantEmailDomain:t}=G(),n=Ie(),o=k(s=>j(s).company?.companyInfo.firstMonthOfFY??1),r=at(n?.loggedInUserRoleMap);return k(s=>s.cashBalanceState.fetchState)==="Error"?i.jsx(Ce,{}):i.jsx(ho,{tenantEmailDomain:t,location:a,referrerType:"Cash Balance",navigate:e,isZeniAccountsAdmin:r,firstMonthOfFY:o})}function bo(){const e=q(),a=$(),{tenantEmailDomain:t}=G(),n=Ie(),o=at(n?.loggedInUserRoleMap),r=k(s=>j(s).company?.companyInfo.firstMonthOfFY??1);return k(s=>s.cardBalanceState.fetchState)==="Error"?i.jsx(Ce,{}):i.jsx(fo,{tenantEmailDomain:t,location:a,referrerType:"Card Balance",navigate:e,isZeniAccountsAdmin:o,firstMonthOfFY:r})}const Co=pt.div`
|
|
2
2
|
display: flex;
|
|
3
3
|
flex: 1 1 auto;
|
|
4
4
|
min-height: 100%;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{j as v}from"./liveblocks-
|
|
1
|
+
import{j as v}from"./liveblocks-CQd3J_Jz.js";import{a as u}from"./sentry-BO53Tmje.js";import{h as y,g as b,k as w,u as A,N as k}from"./core-CHx9v1R3.js";import{Ic as N,eM as _,fj as U,Id as L,mh as R,Ie as z}from"./zeni-epic-state-T7UkKQQw.js";import{u as j,z as f,L as T,t as S,D as O,b as $}from"./index-_YbuoSTd.js";import"./mui-B5MJXy46.js";import{t as P}from"./getLocaleForTenant-BobWg4Hu.js";import"./recharts-nKX4-UUs.js";import"./analytics-DuZD1FBf.js";import"./plaid-CcgrQve1.js";import"./dnd-Ci4anwe2.js";import"./stripe-DMRn4zHo.js";import"./lottie-Dnly7PBz.js";import"./lexical-DQpmcVQ9.js";import"./pdf-DYwn2DuC.js";import"./utils-DpJstXha.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]="6edb8790-83dc-44ea-9d73-f957931ec959",t._sentryDebugIdIdentifier="sentry-dbid-6edb8790-83dc-44ea-9d73-f957931ec959")}catch{}})();const Q=w(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=y(),{setLoading:s,clearAllLoading:o}=j(),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||(O.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};
|
package/dist/assets/{DomesticWireDetailScreen-D--tuAm3.js → DomesticWireDetailScreen-BknvyqFc.js}
RENAMED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{j as l}from"./liveblocks-
|
|
1
|
+
import{j as l}from"./liveblocks-CQd3J_Jz.js";import{j as w,u as C,g as h,k as A,l as B}from"./core-CHx9v1R3.js";import{Ma as k,Mh as _,fA as J,fz as q,fy as L,ii as W,Ji as K,ps as Q,eM as V,LI as D,ig as T,Mb as v,Mk as F,id as G,iC as j}from"./zeni-epic-state-T7UkKQQw.js";import{bj as X,J as R,i as N,z as U,h as M,q as p,s as S,B as z,bk as Y,o as O,bl as ee,v as ae}from"./index-_YbuoSTd.js";import{n as Z}from"./mui-B5MJXy46.js";import"./sentry-BO53Tmje.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]="acaef878-aac3-4311-a462-afbdca4232da",e._sentryDebugIdIdentifier="sentry-dbid-acaef878-aac3-4311-a462-afbdca4232da")}catch{}})();const te=A(null,function(e,a){return{onSaveVendor:t=>{e(W(a.vendorId!==void 0?a.vendorId:void 0,a.billId,void 0,a.isExpressPayPage)),e(K("common")),t!=null&&e(Q(t))},onGetOtp:t=>{e(L(t,"BillPayVendor"))},onResendOtp:t=>{e(q(t,"BillPayVendor"))},onVerifyOtp:(t,n)=>{e(J(t,n,"BillPayVendor"))},onVerifyOtpSuccess:(t,n,o)=>{e(_(t,n,o))}}})(X);function H({vendorId:e,billId:a,isExpressPayPage:t}){const n=w(),o=C(),s=h(c=>k(c,e));return l.jsx(te,{location:o,navigate:n,vendorId:e,billId:a,vendorViewDetails:s,isExpressPayPage:t??!1})}const ne=Z.div`
|
|
2
2
|
display: flex;
|
|
3
3
|
height: 100vh;
|
|
4
4
|
width: 100%;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{j as d}from"./liveblocks-
|
|
1
|
+
import{j as d}from"./liveblocks-CQd3J_Jz.js";import{J as l,C as f,h as b}from"./index-_YbuoSTd.js";import{D as c}from"./mui-B5MJXy46.js";import"./sentry-BO53Tmje.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]="8b1eb99b-980f-433e-8113-44fe445caabb",e._sentryDebugIdIdentifier="sentry-dbid-8b1eb99b-980f-433e-8113-44fe445caabb")}catch{}})();const p={drawerLeftMargin:new f(0,0,240)};function h(e){const{isOpen:r,drawerLeftMargin:o,children:t,onClose:a}=e,n=l(),s=o?.valuePx(n)??p.drawerLeftMargin.valuePx(n),i=b();return d.jsx(c,{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};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{j as s}from"./liveblocks-
|
|
1
|
+
import{j as s}from"./liveblocks-CQd3J_Jz.js";import{a as d}from"./sentry-BO53Tmje.js";import{j as A,h as B,u as J,l as q,g as l,N as F,k as M,n as O,o as N}from"./core-CHx9v1R3.js";import{Kp as _,eM as K,JO as R,km as W,Gw as k,Ku as Y,Jh as $,jm as z,Gx as S,JT as U,JU as V,Jj as H,Ji as L}from"./zeni-epic-state-T7UkKQQw.js";import{aM as Q,c as X,q as Z,v as tt}from"./index-_YbuoSTd.js";import"./mui-B5MJXy46.js";import{d as b}from"./decodeURIComponentSafe-IyDHJK_-.js";import{w as et}from"./withTransactionSidePanel-Bvasj9MO.js";import{e as at,b as nt}from"./routePaths-abbP8AF2.js";import"./recharts-nKX4-UUs.js";import"./analytics-DuZD1FBf.js";import"./plaid-CcgrQve1.js";import"./dnd-Ci4anwe2.js";import"./stripe-DMRn4zHo.js";import"./lottie-Dnly7PBz.js";import"./lexical-DQpmcVQ9.js";import"./pdf-DYwn2DuC.js";import"./utils-DpJstXha.js";import"./useAskAiCfoHostNavButtonProps-BndHsfWo.js";import"./useFetchSuggestedQuestionsWhenReady-B8UnhkhU.js";import"./TransactionDetailScreen-B_ny21sj.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]="4ee1a195-5526-4beb-9eb3-dc56a1f4c5e8",a._sentryDebugIdIdentifier="sentry-dbid-4ee1a195-5526-4beb-9eb3-dc56a1f4c5e8")}catch{}})();const ot=M(function(a,t){const e=t.entity,o=Y(a,t.entity,"EntityDetail");return{selectedEntity:e,autoCompleteData:{autoCompleteText:e.name,entityAutoCompleteView:$(a,"common")},trendWithTransactionsReport:o,analytics:X,isAccountingClassesEnabled:z(a)}},function(a,t){return{onTransactionItemClick:e=>{if(t.openTransactionPanel)return void t.openTransactionPanel(e.id,e.type);const o=`${nt(e,t.tenantEmailDomain)}`,c=tt(t.location.state?.pathnameStackToGoBack,t.location.pathname);t.navigate(o,{state:{pathnameStackToGoBack:c}})},autoCompleteActions:{onAutoCompleteInputChange:e=>{e.trim().length>=2?a(H({searchString:e,searchOrigin:"common"})):e.trim().length===0&&a(L("common"))},onAutoCompleteEntity:e=>{const o=at(e,t.tenantEmailDomain);a(U()),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??I();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(k(t.entity,"EntityDetail",{timeframe:e.timeframe,timePeriod:e.addTimePeriod})),a(S(t.entity,"EntityDetail",{timeframe:e.timeframe,timePeriod:o}))}}}})(Q),it=et(function({entityType:a,...t}){const e=A(),o=B(),c=J(),[m,T]=d.useState(!1),[h,D]=d.useState(!1),{tenantEmailDomain:C,entityIdEncoded:j,entityNameEncoded:x}=q(),r=b(j??""),p=b(x??""),u=rt(r,p),w=[r,p].filter(n=>n!=null),i={name:p,id:r,type:a,zeniId:r,qboId:r},g=l(n=>_(n.customerIncomeState,n.vendorExpenseState,n.trendState,i,"quarter")),G=l(n=>K(n).company?.companyInfo.firstMonthOfFY??1),f=l(n=>R(n.trendWithTransactionsState,i,"EntityDetail"));d.useEffect(()=>{m===!1&&u===!0&&(T(!0),o(W(i)))},[m,u,i]);const E=l(n=>n.trendState.fetchState),P=f?.selectedPeriod?.timePeriod??g,v=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&&E==="Completed"&&(D(!0),P!=null&&o(k(i,"EntityDetail",{timeframe:f?.selectedPeriod?.timeframe??"quarter",timePeriod:P})))},[m,h,E]),u?s.jsx(ot,{firstMonthOfFY:G,tenantEmailDomain:C,location:c,navigate:e,entity:i,defaultTransactionTimePeriod:v,resetTrendIsFetchedStates:()=>{T(!1),D(!1)},...t}):s.jsx(F,{to:I(w.length)})}),rt=(a,t)=>t!=null&&t.length>0&&a!=null&&a.length>0,I=(a=2)=>{let t="../";for(let e=0;e<a;e++)t=`${t}../`;return t};function xt({entityType:a}){return s.jsx(O,{children:s.jsx(N,{path:"/:entityIdEncoded/:entityNameEncoded/*",element:s.jsx(it,{entityType:a})})})}export{xt as EntityDetailRoutes,xt as default};
|
package/dist/assets/{ExpenseAutomationRoutes-g5zvTO2O.js → ExpenseAutomationRoutes--qEGkNAZ.js}
RENAMED
|
@@ -1,20 +1,20 @@
|
|
|
1
|
-
import{j as u}from"./liveblocks-
|
|
1
|
+
import{j as u}from"./liveblocks-CQd3J_Jz.js";import un from"./NotFoundScreen-DKiPvQrK.js";import{a as l}from"./sentry-BO53Tmje.js";import{n as Te,D as St,S as ze}from"./mui-B5MJXy46.js";import{h as he,j as It,u as Ve,g as V,l as nt,k as mn,n as hn,o as Be}from"./core-CHx9v1R3.js";import{eM as $e,OI as pn,f0 as me,fe as gn,q3 as Cn,OJ as je,mI as ft,mO as kt,OK as Et,nb as Sn,OL as yt,mB as In,pB as fn,OM as kn,jy as En,ON as yn,Fx as bn,eY as Me,pg as bt,Kq as at,Ks as vn,jp as Tn,Kt as An,jw as Pn,cT as wn,t5 as Le,Jh as xn,jx as Rn,e_ as Dn,mP as vt,ng as ve,ob as Tt,oK as Un,e$ as At,nf as ot,mG as ae,ni as Pt,nk as Bn,bB as On,kV as Fn,kS as _n,nj as Ee,nh as ue,OO as Vn,nA as st,Bd as wt,OP as xt,s2 as Rt,oG as jn,jm as Mn,OQ as Ln,Jj as ct,Ji as ke,OR as it,jN as zn,OS as $n,OT as Gn,OU as qn,OV as Yn,mY as Jn,OW as Kn,OX as Nn,OY as Zn,nq as Hn,jA as Qn,jr as Wn,OZ as Xn,jz as lt,KA as ea,O_ as ta,O$ as na,pc as aa,oT as oa,oS as Oe,P0 as sa,P1 as ca,l4 as ia,bp as la,k$ as rt,kN as ra,P2 as da,gy as dt,fL as ua,kY as ma,u_ as ha,P3 as pa,nR as ga,nM as Ca,nQ as Sa,nB as Ia,P4 as fa,n4 as ka,mV as Ea,ff as ut,nl as ya,P5 as ba,P6 as va,P7 as Ta,P8 as Aa,P9 as Pa,Pa as mt,po as wa,oB as xa,ok as ht,ot as Ra,og as Da,oH as Ua,ol as Ba,Pb as Oa,Pc as Fa,n_ as _a,Pd as Va,nY as ja,nZ as Ma,nW as La,ov as za}from"./zeni-epic-state-T7UkKQQw.js";import{K as Dt,i as Ut,s as ye,c as M,v as H,N as Bt,cq as $a,h as Ot,z as Ae,cr as Ga,ao as be,cs as qa,B as Ft,ct as Ya,cu as Ja,al as Fe,Y as Ka,S as Na,aI as Za,cv as Ha,aZ as Qa,C as Wa,D as Xa,cw as eo,T as to,cx as no}from"./index-_YbuoSTd.js";import{u as _t}from"./useAskAiCfoHostNavButtonProps-BndHsfWo.js";import{c as Vt}from"./useFetchSuggestedQuestionsWhenReady-B8UnhkhU.js";import{c as pt,C as ao}from"./TransactionDetailScreen-B_ny21sj.js";import{w as oo}from"./withTransactionSidePanel-Bvasj9MO.js";import{h as so,v as co}from"./routePaths-abbP8AF2.js";import{g as _e}from"./accountMappingHelper-DUJwjv4V.js";import{D as io}from"./DrawerScreen-CPuMvDg7.js";import"./recharts-nKX4-UUs.js";import"./analytics-DuZD1FBf.js";import"./plaid-CcgrQve1.js";import"./dnd-Ci4anwe2.js";import"./stripe-DMRn4zHo.js";import"./lottie-Dnly7PBz.js";import"./lexical-DQpmcVQ9.js";import"./pdf-DYwn2DuC.js";import"./utils-DpJstXha.js";import"./decodeURIComponentSafe-IyDHJK_-.js";(function(){try{var t=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},c=new t.Error().stack;c&&(t._sentryDebugIds=t._sentryDebugIds||{},t._sentryDebugIds[c]="26eab456-4be1-4582-b67b-fa7e25750391",t._sentryDebugIdIdentifier="sentry-dbid-26eab456-4be1-4582-b67b-fa7e25750391")}catch{}})();const lo=()=>{const{isAiCfoOpen:t,setIsAiCfoOpen:c}=Dt(),w=he(),A=It(),y=Ve(),r=V(p=>$e(p)),{useFeatureGate:m}=Ut(),{isFeatureEnabled:x}=m(ye.isRealtimeInsightsFeatureEnabled),g=V(p=>p.expenseAutomationViewState.selectedPeriodByTenantId),a=V(p=>pn(p,r.tenantId)),{isAiCfoAccessEnabled:j,onAskAiCfoClick:b}=_t({isAiCfoOpen:t,setIsAiCfoOpen:c,mobileExploreReferrer:"Month-End Close Overview"}),I=l.useCallback((p,E,U=!1)=>{w(me({tenantId:E,period:{month:p.month,year:p.year},refreshViewInBackground:U}))},[]),$=l.useCallback(p=>{const E=y.state?.referrer;a.monthEndCloseChecks?.auditSummary!=null&&M.trackMonthCloseAuditPage(p.month,p.year,a.monthEndCloseChecks.reportEmailSentDate!=null?"closed":"in-review",a.monthEndCloseChecks.auditSummary.auditScorePercentage,!1,E??null),w(gn(r.tenantId,p))},[r.tenantId,a.monthEndCloseChecks?.auditSummary,a.monthEndCloseChecks?.reportEmailSentDate]),S=g[r.tenantId],k=l.useCallback(()=>{const p=y.state?.referrer;a.monthEndCloseChecks?.auditSummary!=null&&M.trackMonthCloseAuditPage(S.month,S.year,a.monthEndCloseChecks.reportEmailSentDate!=null?"closed":"in-review",a.monthEndCloseChecks.auditSummary.auditScorePercentage,!0,p??null),I(S,r.tenantId,!0)},[I,S,r.tenantId,a.monthEndCloseChecks?.auditSummary,a.monthEndCloseChecks?.reportEmailSentDate]),L=H(y.state?.pathnameStackToGoBack,y.pathname),K=l.useCallback(()=>{if(a.monthEndCloseChecks!=null&&S!=null){const p=a.monthEndCloseChecks.monthEndCloseCheckList.find(E=>E.progress<100);if(p!=null)return void A(`./${p.id}/${S.month}-${S.year}`,{state:{pathnameStackToGoBack:L,message:"comingFromOverview"}});A(`./month_end_insights/${S.month}-${S.year}`,{state:{pathnameStackToGoBack:L,message:"comingFromOverview"}})}},[a.monthEndCloseChecks,S]),{areTenantIdsInSync:d}=Bt();return Vt({isDataReady:a.fetchState==="Completed"}),l.useEffect(()=>{S!=null&&a.fetchState!=="In-Progress"&&a.fetchState!=="Completed"&&d&&I(S,r.tenantId)},[I,S,a.fetchState,r.tenantId,d]),l.useEffect(()=>{S!=null&&a.monthClosePerformanceTrendFetchStatus.fetchState!=="In-Progress"&&a.monthClosePerformanceTrendFetchStatus.fetchState!=="Completed"&&d&&w(Cn(S))},[S,a.monthClosePerformanceTrendFetchStatus.fetchState,d]),l.useEffect(()=>{const p=setInterval(()=>{a.fetchState!=="In-Progress"&&a.fetchState==="Completed"&&k()},3e5);return()=>clearInterval(p)},[a.fetchState]),l.useEffect(()=>{if(a.fetchState==="Completed"&&a.monthEndCloseChecks?.auditSummary!=null){const p=y.state?.referrer;M.trackMonthCloseAuditPage(a.selectedPeriod.month,a.selectedPeriod.year,a.monthEndCloseChecks.reportEmailSentDate!=null?"closed":"in-review",a.monthEndCloseChecks.auditSummary.auditScorePercentage,!1,p??null)}},[a.fetchState,a.selectedPeriod,a.monthEndCloseChecks?.auditSummary,a.monthEndCloseChecks?.reportEmailSentDate]),u.jsx(ro,{children:u.jsx($a,{monthEndCloseChecksView:a,isRealtimeInsightsFeatureEnabled:x,onMonthEndCheckClick:p=>{A(`./${p}/${S.month}-${S.year}`,{state:{pathnameStackToGoBack:L,message:"comingFromOverview",referrer:"Expense Automation - Overview"}})},onPeriodChange:$,handleReviewButtonClick:K,onBackClick:()=>{A("../../dashboard")},onReload:k,isAiCfoAccessEnabled:j,onAskAiCfoClick:b})})},ro=Te.div`
|
|
2
2
|
display: flex;
|
|
3
3
|
height: 100vh;
|
|
4
4
|
width: 100%;
|
|
5
5
|
flex: 1 1 auto;
|
|
6
6
|
flex-direction: column;
|
|
7
7
|
background-color: ${t=>t.theme.colors.grey4};
|
|
8
|
-
`,uo="512px",mo=({reconciliation:t,selectedDrawerAccountId:c,onFetchLinkTokenClick:w,onEstablishConnectionClick:A})=>{const y=Ot(),r=he(),m=Ae.getSignedInUser(),x=V(s=>$e(s)),g=t.excludedAccountIDs,a={userId:m?.userId??"",sessionId:m?.zeniSessionId??"",tenantId:x.tenantId??""},{accountReconciliationsByAccountID:
|
|
8
|
+
`,uo="512px",mo=({reconciliation:t,selectedDrawerAccountId:c,onFetchLinkTokenClick:w,onEstablishConnectionClick:A})=>{const y=Ot(),r=he(),m=Ae.getSignedInUser(),x=V(s=>$e(s)),g=t.excludedAccountIDs,a={userId:m?.userId??"",sessionId:m?.zeniSessionId??"",tenantId:x.tenantId??""},{accountReconciliationsByAccountID:j,monthYearPeriod:b,statementUploadChosen:I}=t,$=c!=null?j[c]:void 0,S=$?.accountReconEntity.statementMetaData?.statementUploadId,k=l.useCallback(()=>{c!=null&&r(je({selectedDrawerAccountId:void 0}))},[r,c]),L=(s,C)=>{r(fn(s,C.split(".")[0]))},K=s=>{S!=null&&r(In({accountId:c??"",selectedPeriod:b,fileId:s,statementUploadId:S}))},d=()=>{r(Et({statementUploadChosen:!1}))},p=s=>{c!=null&&r(Sn({accountId:c,selectedPeriod:b,payload:s}))},E=s=>{c!=null&&r(yt({accountId:c,selectedPeriod:b,localData:{accountSource:s}}))},U=l.useCallback(()=>{c!=null&&r(ft({accountId:c}))},[r,c]),e=l.useCallback(()=>{c!=null&&r(kt({accountId:c}))},[r,c]),n=g.includes(c??"")?t.excludedAccountReconciliationByAccountID[c??""]:void 0,o=$!=null?u.jsx(Ga,{excludeAccountFetch:t.excludeAccountFetchState,accountReconciliation:$,monthYearPeriod:b,onDismissClick:k,plaidConnectionDetails:t.plaidConnectionDetails,onFetchLinkTokenClick:w,onEstablishConnectionClick:A,onEditFileName:L,onDeleteFile:K,onSelectSourceType:E,filesEndPoint:`${be.fileMicroServiceBaseUrl}`,authParams:a,openFilePicker:I,onStatementUploadSuccess:p,onUploadWindowOpenedOnce:d,onExcludeFromReconciliation:U}):n!=null?u.jsx(qa,{excludedAccountReconciliation:n,includeAccountFetch:t.includeAccountFetchState,onIncludeIntoReconciliation:e}):null;return o==null?null:u.jsx(St,{anchor:"right",open:c!=null,PaperProps:{style:{width:uo,color:y.colors.grey4}},slotProps:{backdrop:{style:{backgroundColor:"transparent",cursor:"pointer"}}},onClose:()=>k(),children:u.jsx(ho,{onClick:s=>s.stopPropagation(),children:o})})},ho=Te(ze)`
|
|
9
9
|
display: flex;
|
|
10
10
|
min-height: 100%;
|
|
11
11
|
flex-direction: column;
|
|
12
|
-
`;function po({companyId:t,closeCustomerRequestDrawer:c,addCustomerRequest:w,resetCustomerRequest:A}){const y=Ae.getSignedInUser();if(y==null)throw Error("Can't access Customer Request page without signing in...");const r=V(m=>kn(m,t,y));return l.useEffect(()=>{A()},[]),u.jsx(u.Fragment,{children:r.fetchState==="In-Progress"||r.companyMonthEndReportTemplatesData.fetchState==="In-Progress"?u.jsx(Ft,{fetchState:"In-Progress"}):u.jsx(
|
|
12
|
+
`;function po({companyId:t,closeCustomerRequestDrawer:c,addCustomerRequest:w,resetCustomerRequest:A}){const y=Ae.getSignedInUser();if(y==null)throw Error("Can't access Customer Request page without signing in...");const r=V(m=>kn(m,t,y));return l.useEffect(()=>{A()},[]),u.jsx(u.Fragment,{children:r.fetchState==="In-Progress"||r.companyMonthEndReportTemplatesData.fetchState==="In-Progress"?u.jsx(Ft,{fetchState:"In-Progress"}):u.jsx(Ya,{onCloseClick:c,addCustomerRequest:w,snippets:r.companyMonthEndReportTemplatesData,bulletPoints:r.zeniRequestsData??[]})})}const go=t=>u.jsx(Ja,{...t}),Co="512px",So=({selectedTransactionId:t,onClose:c})=>{const w=Ot(),A=he(),y=V(g=>t==null?void 0:En(g.transactionState,t)),r=y?.qboId,m=V(g=>r==null?void 0:yn(g,r));l.useEffect(()=>{r!=null&&A(bn(r))},[A,t,r]);const x=l.useCallback(()=>{c()},[c]);return t==null||m==null?null:u.jsx(St,{anchor:"right",open:t!=null,PaperProps:{style:{width:Co,color:w.colors.grey4}},slotProps:{backdrop:{style:{backgroundColor:"transparent",cursor:"pointer"}}},onClose:x,children:u.jsx(Io,{onClick:g=>g.stopPropagation(),children:u.jsx(go,{transactionActivityLogSelectorView:m,onClose:x})})})},Io=Te(ze)`
|
|
13
13
|
display: flex;
|
|
14
14
|
min-height: 100%;
|
|
15
15
|
flex-direction: column;
|
|
16
|
-
`,fo=t=>t.sections.generalExpense.vendors.length+t.sections.reimbursement.vendors.length,{common:{strings:{hyphen:ko,comma:gt,space:Eo}},dateFormat:Mt}=Xa.getLocalizedStrings(),Ct=za,yo=mn(function(t,c){const{uncategorizedAccounts:w,vendorSearchAutoCompleteData:A,monthEndInsightsCustomerRequestData:y,monthEndInsightsPreviewMode:r,companyId:m,isMissingReceiptsBulkUploadEnabled:x,isTransactionActivityEnabled:g}=c,a=Ae.getSignedInUser(),M=t.tenantState.currentTenantId,v={userId:a?.userId??"",sessionId:a?.zeniSessionId??"",tenantId:M??""},I=je(t),{selectedTransactionCategorizationTab:$}=I;return{expenseAutomationViewSelector:I,bulkUploadSelector:I.missingReceipts.bulkUpload,vendorSearchAutoCompleteData:A,authParams:v,receiptUploadEndpoint:`${ve.accountMicroServiceBaseUrl}`,transactionAttachmentsEndpoint:`${to}/transaction_attachments`,bulkUploadEndpoint:x===!0?`${ve.communicationAgentMicroServiceBaseUrl}/1.0/receipts/bulk-upload`:void 0,isDisabled:!1,currentTab:$,monthEndInsightsCustomerRequestData:y,monthEndInsightsPreviewMode:r,allThreadsSectionOpen:!1,enableMonthEndInsightsZeniGPTFeature:!1,loggedInUser:a,uncategorizedAccounts:w,companyId:m,isTransactionActivityEnabled:g,isAccountingClassesEnabled:jn(t)}},function(t,c){const{themeState:w,isCOTEnabled:A,isUncategorizedExpenseCategoryEnabled:y,isMissingReceiptsBulkUploadEnabled:r,location:m,vendorSearchAutoCompleteData:x,expenseAutomationViewSelector:g,currentTenant:a,uncategorizedAccounts:M,navigate:v,onClickCustomerRequest:I,handleEditClick:$,setActivityLogTransactionId:S}=c,{selectedPeriod:k,currentSelectedView:L,reconciliation:{selectedAccountId:K}}=g,{accountSettingsView:d}=g.jeSchedules,p=bt(k),E=be(p.start),U=be(p.end);return{onZeniLogoClick:()=>{w.toggle()},onUploadReceiptAttachment:e=>{j.trackMissingReceiptAttached(k.month,k.year),t(xa(e))},onUploadTransactionReceipt:(e,n,o,s,C,h)=>{t(mt(e,n,{fetchState:"In-Progress"}));const f=()=>t(mt(e,n,{fetchState:"Error"}));no(`${ve.accountMicroServiceBaseUrl}/1.0/transactions/${n}/attachments`,h,n,o,s,C).then(b=>{b!=null?t(wa(e,b)):f()}).catch(f)},onMissingReceiptsRowClick:(e,n)=>{if(c.openTransactionPanel)return void c.openTransactionPanel(e,n);const o=H(m.state?.pathnameStackToGoBack,m.pathname);v(`../../transaction/${n}/${e}`,{state:{pathnameStackToGoBack:o,message:"expenseAutomation",origin:"missing_receipts"}})},onUploadReceiptComplete:(e,n)=>{t(Pa(e,n)),a!=null&&t(me({tenantId:a.tenantId,period:n,refreshViewInBackground:!0}))},onUploadReceiptFetchStatus:(e,n,o,s)=>{t(Aa(e,{fetchState:n,error:o})),o!=null&&t(dt({messageSection:"missing_receipts_attachment",messageText:"failed",type:"error",showStatusIcon:!0,variables:[{variableName:"__message__",variableValue:s!=null?Eo+ko+s+gt:gt}]}))},onUpdateJESchedulesUIState:e=>{t(Ta(e))},onUpdateMissingReceiptsUIState:e=>{t(ba(e))},onFetchMissingReceiptsList:()=>{U!=null&&E!=null&&t(Pt({start:E,end:U},{amount:75,currencyCode:"USD",currencySymbol:"$"},!0,!1))},...r===!0?{onBulkUploadFiles:e=>{t(La(e))},onBulkUploadProgress:e=>{t(ja(e))},onBulkUploadSuccess:e=>{t(Ma({batchId:e}))},onBulkUploadUploadedFileCount:e=>{t(Va(e))},onConfirmBulkUploadMatch:(e,n,o,s,C)=>{t(_a(e,n,o,s,C))},onBulkUploadConfirmMatchAcknowledged:()=>{t(Fa())},onSetBulkUploadResultsTab:e=>{t(Oa(e))},onSetBulkUploadCompletedSubTab:e=>{t(Ba(e))},onSetBulkUploadSortConfig:(e,n)=>{t(ht({sortKey:e,sortOrder:n}))},onClearBulkUpload:()=>{t(Ua())},onSearchTransactionsForManualMatch:(e,n)=>{t(Ct(e,n??void 0))},onLoadMoreManualSearch:()=>{const{manualSearch:e}=g.missingReceipts.bulkUpload;e.nextPageToken!=null&&e.searchQuery!==""&&t(Ct(e.searchQuery,e.nextPageToken))},onFetchCompletedTransactions:(e,n)=>{t(Da(e,n))},onFetchBulkUploadBatches:e=>{t(Tt(e))},onFetchMoreBatchDetails:()=>{t(Ra())},onResetBulkUploadSort:()=>{t(ht({sortKey:"date",sortOrder:"descending"}))}}:{},onClearMissingReceiptsTabNavigation:()=>{t(va())},onSearchTextChanged:e=>{const n=g.currentSelectedView,o=g.selectedTransactionCategorizationTab;n==="transaction_categorization"&&(t(Oe({selectedTab:o,uiState:{searchString:e}})),U!=null&&E!=null&&t(ue(o,{start:E,end:U},!0,!1,e,void 0,!0)))},onRefresh:()=>{c.trackExpenseAutomationTabAnalytics(!0),t(ya(y))},onClose:()=>{L==="reconciliation"&&K!=null&&t(ut({selectedAccountId:void 0})),v("../")},onBack:()=>{L==="reconciliation"&&K!=null&&t(ut({selectedAccountId:void 0}))},onSaveReconciliation:e=>{t(Ea(e))},onSaveReconciliationReview:e=>{t(ka(e))},onUpdateStep:e=>{const{selectedPeriod:n}=g,o=H(m.state?.pathnameStackToGoBack,m.pathname);v(`../${e}/${n.month}-${n.year}`,{state:{pathnameStackToGoBack:o,referrer:g.currentSelectedView}}),t(At(e))},handleLogOutClick:()=>{const e=H(m.state?.pathnameStackToGoBack,m.pathname);v("/signout",{replace:!0,state:{pathnameStackToGoBack:e,message:"logout"}})},onJeAccountSettingsChange:e=>{const{vendorsAccountSection:n}=e,{prepaidExpensesAccount:o,fixedAssetsAccount:s,accruedExpensesAccount:C}=n,h=_e(d.prepaidExpensesAccountList,o.selectedOptions),f=_e(d.fixedAssetsAccountList,s.selectedOptions),b=_e(d.accruedExpensesAccountList,C.selectedOptions),z={selectedPrepaidExpensesAccountIds:h.map(B=>B.accountId),selectedFixedAssetsAccountIds:f.map(B=>B.accountId),selectedAccruedExpensesAccountIds:b.map(B=>B.accountId)};t(fa({data:z}))},onSaveJeAccountSettingsClick:()=>{t(Ia())},onJESchedulesFormDataChange(e,n){const{jeScheduleID:o,accumulatedDepreciationCategory:s,scheduleClass:C,scheduleExpenseCategory:h,vendor:f}=n,{allAccountList:b,allClassList:z,allDepreciationAccountList:B}=g.jeSchedules,N=x.entityAutoCompleteView.vendor.length>0?x.entityAutoCompleteView.vendor.find(G=>G.id===f?.selectedOption):void 0,oe={id:N?.zeniId??f?.selectedOption??"",name:N?.name??f?.defaultOptions.find(G=>G.value===f?.selectedOption)?.label??"",logo:N?.logo},pe=h?.selectedOption!=null?b.find(G=>G.qboId===h.selectedOption):void 0,Pe=C?.selectedOption!=null?z.find(G=>G.classId===C.selectedOption):void 0,te=s?.selectedOption!=null?B.find(G=>G.qboId===s.selectedOption):void 0;t(Sa({scheduledJournalEntryID:e,localData:{jeScheduleID:o,scheduledJournalEntryID:e,updatedCategoryId:pe?.accountId,updatedClassId:Pe?.classId,updatedAccumulatedDepreciationCategoryID:te?.accountId,updatedVendor:{id:oe.id,name:oe.name}}}))},ignoreRecommendedJeSchedule(e,n){t(Ca(e,n))},vendorSearchAutoCompleteActions:{onAutoCompleteInputChange:(e,n)=>{e.trim().length>=2?t(ct({searchString:e,entityType:n,searchOrigin:"common"})):e.trim().length===0&&t(ke("common"))},onCancelAutoComplete:()=>{t(ke("common"))}},onPostJESchedule(e,n){t(ga({scheduledJournalEntryID:e,jeScheduleTransactionKey:n}))},clearJeScheduleLocalData(){t(pa())},handleJeScheduleClick:(e,n,o)=>{t(ha({selectedJEScheduleKey:n}));const s=H(m.state?.pathnameStackToGoBack,m.pathname);v(`../../vendors/schedules/${o}/details/${e}`,{state:{pathnameStackToGoBack:s,message:"expenseAutomation",origin:"je_schedules"}})},improveMonthEndInsightsUsingZeniGPTClick:e=>{a!=null&&t(ma(e,a.companyId,a.tenantId))},onClickCustomerRequest:I,setActivityLogTransactionId:S,onCloseAllThreadsSection:()=>{},onCloseFileAttachmentSnackBar:()=>{t(ua())},onOpenFileAttachmentSnackBar:()=>{t(dt({messageSection:"cockpit_month_end_email_attachment_upload",messageText:"failed",type:"error",showStatusIcon:!0}))},onRemoveFileAttachment:e=>{t(da(e))},onUpdateFileAttachment:e=>{t(ra({files:e}))},previewMonthEndReport:(e,n,o,s)=>{a!=null&&t(rt(e,a.companyId,n,!0,o,s,a.tenantId))},saveMonthEndReport:(e,n,o,s)=>{a!=null&&t(rt(e,a.companyId,n,!1,o,s,a.tenantId))},onEditMonthEndInsightsClick:$,sendMonthEndReport:e=>{const n=m.state?.referrer,{selectedPeriod:o,auditSummary:s}=g;a!=null&&s?.auditScorePercentage!=null&&(t(ia(a.companyId,e,a.tenantId)),j.trackInsightsEmailPage(o.month,o.year,!1,"draft",s.auditScorePercentage,la().format(Mt.analytics.MMMDDCommaYYYYformat),n??null))},onTransactionCategorizationRowClick:(e,n)=>{if(c.openTransactionPanel)return void c.openTransactionPanel(e,n);const o=H(m.state?.pathnameStackToGoBack,m.pathname);v(`../../transaction/${n}/${e}`,{state:{pathnameStackToGoBack:o,message:"expenseAutomation",origin:"transaction_categorization"}})},setLocalDataForCategoryAndClass:(e,n,o,s,C,h,f,b,z,B,N)=>{t(ca(e,n,o,s,M,C,h,f,b,z,B,N))},onCancelAutoComplete:()=>{t(ke("common"))},updateExpenseAutomationReconListScrollPosition:e=>{t(it({scrollPosition:e}))},onUpdateTab:e=>{c.closeSidePanel?.(),U!=null&&E!=null&&(t(ue(e,{start:E,end:U},!1,!1)),t(sa(e)))},onUpdateTransactionCategorizationUIState:(e,n)=>{t(Oe({selectedTab:e,uiState:n})),U!=null&&E!=null&&t(ue(e,{start:E,end:U},!1,!1,n.searchString,null,!0))},onUpdateScrollYOffSetTransactionCategorizationUIState:(e,n)=>{t(Oe({selectedTab:e,uiState:n}))},onFetchTransactionCategorizationList:(e,n,o,s,C,h,f)=>{U!=null&&E!=null&&t(ue(e,{start:E,end:U},!0,o,n,s,C,h,f))},resetTransactionCategorizationLocalData:(e,n,o,s,C,h,f,b)=>{t(oa(e,n,o,s,b??null,C,h,!1,f))},updateSelectedVendorForTransaction:(e,n,o,s,C)=>{t(lt({selectedTab:e,transactionId:n,lineId:o,selectedTransaction:s,uncategorizedAccounts:M,updatedVendor:C}))},onSaveUpdateTransactionCategorization:(e,n,o)=>{const s=m.state?.referrer;e==="autoCategorized"?j.trackTransactionsAutoCategorisedPage(k.month,k.year,g.transactionView.totalCountByTab.autoCategorized,n.length,!1,s??null):j.trackTransactionsReviewPage(k.month,k.year,g.transactionView.totalCountByTab.review,n.length,!1,s??null),t(aa(e,n,o,y))},onUpdateSelectedCheckboxTransactionIds:(e,n)=>{t(na({selectedTab:e,transactionIds:n}))},onFetchRecommendationsForEntityCategorizationWithCustomer:(e,n,o,s,C,h,f)=>{const{transactionId:b,transaction:z,lineIds:B}=n;h!=null&&t(ea({transactionId:b,customerUpdates:h})),t(ta({selectedTab:s,transactionId:b.id,lineId:B[0],selectedTransaction:z,uncategorizedAccounts:M,updatedCustomer:h,selectedEntity:C,isUncategorizedExpenseCategoryEnabled:f})),C!=null&&t(Le(C,e,n,o,!0,A,f))},onFetchRecommendationsForEntityCategorization:(e,n,o,s,C,h,f)=>{const{transactionId:b,transaction:z,lineIds:B}=n;h!=null&&(t(Qn({transactionId:b,vendorUpdates:{name:h.name,id:h.id?h.id:void 0}})),t(Wn({vendorId:h.id?h.id:void 0,localData:{vendorName:h.name,vendorId:h.id?h.id:void 0}}))),h?.id?(t(lt({selectedTab:s,transactionId:b.id,lineId:B[0],selectedTransaction:z,uncategorizedAccounts:M,updatedVendor:h,selectedEntity:C,isUncategorizedExpenseCategoryEnabled:f})),C!=null&&t(Le(C,e,n,o,!0,A,f))):t(Xn({selectedTab:s,transactionId:b.id,lineId:B[0]}))},fetchFluxViewOnScroll:(e,n)=>{t(Ee(e,!0,!1,n,!1,!0))},onFetchFluxViewList:()=>{t(Ee(k,!0,!1,null,!1,!1))},markAsReview:(e,n,o,s)=>{j.trackFluxAnalysisReviewed(o.month,o.year,s??!1,e),t(Hn(n,e,o,s??!1))},onUpdateFluxAnalysisUIState:e=>{t(Zn(e))},updateOperatingExpensesIdsForReview:e=>{t(Nn({operatingExpenseIds:e,selectedPeriod:k}))},redirectToVendorDetailPage:e=>{if(c.tenantEmailDomain!=null){const n=co(e.id,e.qboId,c.tenantEmailDomain),o=H(c.location.state?.pathnameStackToGoBack,c.location.pathname);c.navigate(n,{state:{pathnameStackToGoBack:o,message:"expenseAutomation",referrer:"Vendor List",origin:"flux_analysis"}})}},updateSectionIdsForReview:e=>{t(Kn({sectionId:e,selectedPeriod:k}))},onFetchReimbursementView:(e,n,o)=>{t(Ee(e,!0,!1,n,!0,o))},onReviewClicked:e=>{t(ae(k,e))},setOpenDrawerClicked:e=>{t(Me({selectedDrawerAccountId:e}))},onFetchLinkTokenClick:(e,n)=>{t(Rt("expense_automation_reconcile",e,n))},onEstablishConnectionClick:(e,n)=>{const o=a?.companyId;o!=null&&(t(wt(e,o,"expense_automation_reconcile",void 0,"link_account_no_microdeposit",n)),t(xt({accountId:n,connectionInProgress:!0})))},onAddStatementClick:e=>{t(Me({selectedDrawerAccountId:e})),t(yt({accountId:e,selectedPeriod:k,localData:{accountSource:"bank_statement"}})),t(Et({statementUploadChosen:!0}))},onReloadReconciliationListPage:()=>{t(ae(k,void 0,!0,!1))},onUpdateReconcileTabLocalData:e=>{t(Yn({selectedTransactionIds:e}))},onReconTabColumnSortConfigChanged:(e,n)=>{t(Jn({sortKey:e,sortOrder:n}))},onReconReviewTabColumnSortConfigChanged:(e,n)=>{t(qn({sortKey:e,sortOrder:n}))},onReconTabUpdate:e=>{c.closeSidePanel?.(),t(Gn({selectedTab:e}))},updateReconReviewTabLocalData:(e,n,o)=>{const s=e.vendor?.id;o&&s!=null&&t(zn(s)),t($n({data:e,transactionId:n}))},onReconMatchedTransactionClick:e=>{if(c.openTransactionPanel)return void c.openTransactionPanel(e,vt("bill"));const n=H(m.state?.pathnameStackToGoBack,m.pathname);v(`../../transaction/bill/${e}`,{state:{pathnameStackToGoBack:n,message:"expenseAutomation",origin:"reconciliation"}})},onReloadPage:()=>{window.location.reload()},onBackClick:()=>{v(-1)},onReconListPageScroll:e=>{t(it({scrollPosition:e}))},onVendorAutoCompleteInputChange:e=>{e.trim().length>=2?t(ct({searchString:e,searchOrigin:"common"})):e.trim().length===0&&t(ke("common"))},onReconNodeCollapseToggled:(e,n)=>{t(Ln({nodeId:e,collapsed:n}))},updateSectionCollapseStatus:()=>{},onExcludeAccountFromReconciliation:e=>{t(ft({accountId:e}))},onIncludeAccountIntoReconciliation:e=>{t(kt({accountId:e}))}}},(t,c,w)=>{const{isMissingReceiptsBulkUploadEnabled:A,...y}=w;return function(r,m,x){return{...r,...m,...x,onUploadTransactionReceipt:(g,a,M,v,I)=>{m.onUploadTransactionReceipt(g,a,M,v,I,r.authParams)}}}(t,c,y)})(eo),vo=oo(({closeSidePanel:t,openTransactionPanel:c,panelContent:w,sidePanelIsFullView:A,sidePanelIsOpen:y})=>{const{isAiCfoOpen:r,setIsAiCfoOpen:m}=Dt(),x=It(),g=Ve(),a=he(),{isAiCfoAccessEnabled:M,onAskAiCfoClick:v}=_t({isAiCfoOpen:r,setIsAiCfoOpen:m,mobileExploreReferrer:"Transaction categorization"}),{areTenantIdsInSync:I}=Bt(),$=(()=>{const i=V(q=>je(q)),T=Ve(),{currentSelectedViewFetchState:D,currentSelectedView:F,selectedPeriod:R}=i,de=Fe(F),X=Fe(D.fetchState),Se=l.useCallback(q=>{const Z=T.state?.referrer;F==="transaction_categorization"&&(i.selectedTransactionCategorizationTab==="review"?j.trackTransactionsReviewPage(R.month,R.year,i.transactionView.totalCountByTab.review,0,q,Z??null):j.trackTransactionsAutoCategorisedPage(R.month,R.year,i.transactionView.totalCountByTab.autoCategorized,0,q,Z??null)),F==="missing_receipts"&&j.trackMissingReceiptsPage(R.month,R.year,q,i.missingReceipts.transactions.length,Z??null),F==="je_schedules"&&j.trackMonthCloseScheduleListPage(R.month,R.year,q,i.jeSchedules.draftSchedules.length,i.jeSchedules.resolveSchedules.length,Z??null),F==="flux_analysis"&&j.trackFluxAnalysisPage(R.month,R.year,q,fo(i.fluxAnalysis),Z??null),F==="month_end_insights"&&i.auditSummary?.auditScorePercentage!=null&&j.trackInsightsEmailPage(R.month,R.year,q,"draft",i.auditSummary.auditScorePercentage,null,Z??null)},[R,i]);return l.useEffect(()=>{X===D.fetchState&&F===de||D.fetchState!=="Completed"||Se(!1)},[F,D.fetchState,de]),Se})(),S=Ka(),[k,L]=l.useState(!1),K=V(i=>at(i)),d=V(i=>$e(i)),[p,E]=l.useState(!1),[U,e]=l.useState(!1),[n,o]=l.useState([]),[s,C]=l.useState(void 0),[h,f]=l.useState(!1),b=l.useRef(!1),{selectedTab:z}=nt(),{tenantEmailDomain:B}=nt(),[N,oe]=l.useState(g.state?.message==="comingFromTransactionDetail"),pe=g.state?.message==="comingFromOverview",Pe=Na(),te=Ae.getSignedInUser(),{useDynamicConfig:G,useFeatureGate:we}=Ut(),{configValue:jt}=G(Za.enableUncategorizedExpenseCategory),Q=jt?.uncategorized_expense_category_enabled===!0,{isFeatureEnabled:Ge}=we(ye.isRealtimeInsightsFeatureEnabled),{isFeatureEnabled:se}=we(ye.isMissingReceiptsBulkUploadEnabled),{isFeatureEnabled:qe}=we(ye.isTransactionActivityEnabled),Lt=V(i=>xn(i,"common")),_=V(i=>je(i)),{monthEndCloseChecksView:Y,currentSelectedView:O,selectedPeriod:P,selectedTransactionCategorizationTab:Je,currentSelectedViewBackgroundRefreshFetchState:zt,currentSelectedViewFetchState:W,jeSchedules:xe,reconciliation:$t}=_,{selectedAccountId:ce}=$t,Ye=Fe(xe.accountSettingsView.saveState.fetchState),Gt=V(i=>Rn(i.accountState,i.accountListState,"accountList")),ie=z!=null?Dn(z):O,qt=V(i=>i.entityAutoCompleteState.autoCompleteText.common);if(Vt({isDataReady:W.fetchState==="Completed"}),te==null)throw Error("Can't access expense automation screen without signing in...");const Ke=bt(P),le=be(Ke.start),re=be(Ke.end);if(le==null||re==null)throw Error(`Invalid start - ${le} and end - ${re} period from given ${P}`);const Jt=l.useCallback(()=>{E(!1)},[]),Yt=l.useCallback(()=>{e(!0)},[]),Kt=l.useCallback(i=>{o(i),e(!1)},[]),Nt=l.useCallback(()=>{o([])},[]),Re=`private-${te.userId}`,Ne="missing-receipts-batch-completed",ge=Ha();l.useEffect(()=>{if(ge==null||O!=="missing_receipts"||se===!1)return;const i=ge.channel(Re)??ge.subscribe(Re),T=D=>{a(Mn({batchId:D.batch_id,progress:D.progress,status:D.status.toLowerCase()}))};return i.bind(Ne,T),()=>{i.unbind(Ne,T)}},[ge,O,Re,a,se]);const Ce=_.missingReceipts.bulkUpload.phase,Ze=_.missingReceipts.bulkUpload.currentBatchId;l.useEffect(()=>{O==="missing_receipts"&&Ce==="matching"&&Ze!=null&&a(Tt({cacheOverride:!0}))},[O,Ce,Ze,a]);const He=te?.userId,Zt=P.month,Ht=P.year,Qe=d?.tenantId;l.useEffect(()=>{O==="missing_receipts"&&se!==!1&&Ce==="idle"&&He!=null&&Qe!=null&&a(Un())},[O,se,Ce,He,Qe,Zt,Ht,a]),l.useEffect(()=>{K.newVendorState?.vendorDetailLocalData?.vendorName!=null?L(!0):L(!1)},[K.newVendorState?.vendorDetailLocalData?.vendorName]),l.useEffect(()=>{ie!=null&&O!==ie&&a(At(ie))},[ie]),l.useEffect(()=>{h!==!1||W.fetchState!=="Completed"&&W.fetchState!=="Error"||!I||(f(!0),a(ot(!1,!1,Q)))},[h,W,I,Q]),l.useEffect(()=>{!pe&&I&&(a(ot(!1,!1,Q)),a(ae(P,ce,!1,!1)))},[P.month,P.year,I,Q]);const We=l.useCallback((i=!1,T=!1)=>{const D={start:le,end:re};switch(O){case"transaction_categorization":a(ue(Je,D,i,!N,void 0,void 0,T,void 0,Q)),oe(!1);break;case"flux_analysis":a(Ee(P,i,T,null));break;case"month_end_insights":if(T===!1){const F=new Date(P.year,P.month,0),R=On(F.toDateString()).format(Mt.analytics.YYYYDashMMDashDDFormat);a(Fn(!0,d.companyId,d.tenantId,R)),a(_n(d.companyId,d.tenantId))}break;case"je_schedules":a(Bn(D,T));break;case"missing_receipts":a(Pt(D,{amount:75,currencyCode:"USD",currencySymbol:"$"},i,T));break;default:a(ae(P,ce,i,T))}},[O,le,re,d.companyId,d.tenantId,Je,P,ce,N,oe,Q]);l.useEffect(()=>{O===ie&&W.fetchState==="Not-Started"&&I&&We(!0)},[W,le,re,d.companyId,d.tenantId,I]),l.useEffect(()=>{pe||N||b.current||zt.fetchState==="In-Progress"||W.fetchState!=="Completed"||(b.current=!0,We(!0,!0))},[]),l.useEffect(()=>{Y.fetchState!=="In-Progress"&&Y.fetchState!=="Completed"&&a(me({tenantId:d.tenantId,period:P,refreshViewInBackground:!1}))},[Y.fetchState,d.tenantId]),l.useEffect(()=>{_.monthEndInsights?.previewMonthEndReportStatus?.fetchState==="Completed"?E(!0):E(!1)},[_.monthEndInsights?.previewMonthEndReportStatus?.fetchState]),l.useEffect(()=>{_.monthEndInsights?.sendMonthEndReportStatus?.fetchState==="Completed"&&I&&(a(me({tenantId:d.tenantId,period:P,refreshViewInBackground:!0})),a(Vn({companyId:d.companyId})),x("../"))},[_.monthEndInsights?.sendMonthEndReportStatus?.fetchState,d.tenantId,P,d.companyId,I]),l.useEffect(()=>{const i=setInterval(()=>{Y.fetchState!=="In-Progress"&&Y.fetchState==="Completed"&&a(me({tenantId:d.tenantId,period:P,refreshViewInBackground:!0}))},3e5);return()=>clearInterval(i)},[Y.fetchState,d.tenantId,P,a]),l.useEffect(()=>{const i=setInterval(()=>{O==="reconciliation"&&ce==null&&_.reconciliation.fetchStatus.fetchState==="Completed"&&_.reconciliation.refreshStatus.fetchState!=="In-Progress"&&a(ae(P,void 0,!0,!0))},3e5);return()=>clearInterval(i)},[O,a,_.reconciliation.fetchStatus.fetchState,_.reconciliation.refreshStatus.fetchState,ae,ce,P]);const Qt=pt();l.useEffect(()=>{const i=(Y.monthEndCloseChecks?.monthEndCloseCheckList.find(T=>T.id==="month_end_insights")?.isDisabled??!1)&&!Ge;O!=="month_end_insights"||!i&&Y.monthEndCloseChecks?.reportEmailSentDate==null||x("../")},[O,Y.monthEndCloseChecks]);const Wt=_.reconciliation.selectedDrawerAccountId;l.useEffect(()=>{Ye==="In-Progress"&&xe.accountSettingsView.saveState.fetchState==="Completed"&&a(st())},[Ye,xe.accountSettingsView.saveState.fetchState,st]);const{transactionId:Xe,onSaveVendor:Xt,onSaveSuccess:en,onCancel:tn,vendorViewDetails:nn}=(({expenseAutomationViewSelector:i,closeDrawerHandler:T,currentSelectedView:D})=>{const F=he();let R,de,X;const Se=pt(),q=i.transactionView;let Z=()=>{};const{transactions:an,selectedTransactionId:ne,selectedTransactionLineId:Ie,transactionLocalData:on}=q;if(D==="transaction_categorization"){const De=on.find(ee=>ee.transactionId===ne),J=an.find(ee=>ee.id===ne),et=Ie!=null?De?.transactionReviewLocalData?.lineItemById[Ie]:void 0,tt=et?.account;de=et?.class?.classId,R=["Uncategorized Income","Uncategorized Expense"].includes(tt?.accountName??"")?void 0:tt?.accountId;const cn=so(ne,J?.typeOfTransaction);J!=null&&cn&&(X={id:ne,type:vt(J.typeOfTransaction)}),Z=()=>{if(ne!=null&&Ie!=null&&J!=null){const ee=q.transactionLocalData.find(fe=>fe.transactionId===ne)?.transactionReviewLocalData;if(ee!=null&&J.lines!=null&&J.lines.length>0){const fe=ee.lineItemById[Ie];let Ue=ee.selectedEntity;if(wn(J)||(Ue=fe.selectedEntityLine),Ue!=null){const ln=Ue,rn={transactionId:{id:J.id,type:J.type},transaction:J,lineIds:J.lines.map(dn=>dn.id)??[]};F(Le(ln,fe.amount.amount,rn,!1,!0,Se))}}}}}const sn=V(De=>at(De,void 0,R,de));return{transactionId:X,onSaveVendor:()=>{F(Pn(X,void 0,!1,!0))},onSaveSuccess:Z,onCancel:()=>{X!=null&&F(bn({transactionId:X})),F(Tn()),F(An()),T()},vendorViewDetails:sn}})({expenseAutomationViewSelector:_,closeDrawerHandler:()=>{L(!1)},currentSelectedView:O});return Pe?.loggedInUserRoleMap==null?Y.fetchState==="Error"?u.jsx(Qa,{onGoHome:()=>x("../",{replace:!0}),onReload:()=>window.location.reload()}):u.jsx(Ft,{fetchState:"In-Progress"}):u.jsxs(u.Fragment,{children:[u.jsx(io,{isOpen:U,drawerLeftMargin:new Wa(0,0,300,650),onClose:()=>{e(!1)},children:u.jsx(bo,{onClick:i=>i.stopPropagation(),children:u.jsx(po,{companyId:d.companyId,closeCustomerRequestDrawer:()=>e(!1),addCustomerRequest:Kt,resetCustomerRequest:Nt})})}),Xe!=null&&k&&u.jsx(ao,{isOpen:k,transactionId:Xe,onSaveVendor:Xt,onSaveSuccess:en,onCancel:tn,vendorViewDetails:nn}),u.jsx(mo,{selectedDrawerAccountId:Wt,reconciliation:_.reconciliation,onFetchLinkTokenClick:(i,T)=>{a(Rt("expense_automation_reconcile",i,T))},onEstablishConnectionClick:(i,T)=>{const D=d?.companyId;D!=null&&(a(wt(i,D,"expense_automation_reconcile",void 0,"link_account_no_microdeposit",T)),a(xt({accountId:T,connectionInProgress:!0})))}}),qe&&u.jsx(So,{selectedTransactionId:s,onClose:()=>C(void 0)}),u.jsx(yo,{navigate:x,location:g,themeState:S,vendorSearchAutoCompleteData:{autoCompleteText:qt,entityAutoCompleteView:Lt},expenseAutomationViewSelector:_,isMissingReceiptsBulkUploadEnabled:se,monthEndInsightsPreviewMode:p,monthEndInsightsCustomerRequestData:n,isRealtimeInsightsFeatureEnabled:Ge,isUncategorizedExpenseCategoryEnabled:Q,isCOTEnabled:Qt,currentTenant:d,companyId:d.companyId,signedInUser:te,isTransactionActivityEnabled:qe,uncategorizedAccounts:Gt,onClickCustomerRequest:Yt,handleEditClick:Jt,tenantEmailDomain:B,trackExpenseAutomationTabAnalytics:$,setActivityLogTransactionId:C,closeSidePanel:t,openTransactionPanel:c,sidePanelIsOpen:y,sidePanelIsFullView:A,panelContent:w,isAiCfoAccessEnabled:M,onAskAiCfoClick:v})]})}),bo=Te(ze)`
|
|
16
|
+
`,fo=t=>t.sections.generalExpense.vendors.length+t.sections.reimbursement.vendors.length,{common:{strings:{hyphen:ko,comma:gt,space:Eo}},dateFormat:jt}=Xa.getLocalizedStrings(),Ct=za,yo=mn(function(t,c){const{uncategorizedAccounts:w,vendorSearchAutoCompleteData:A,monthEndInsightsCustomerRequestData:y,monthEndInsightsPreviewMode:r,companyId:m,isMissingReceiptsBulkUploadEnabled:x,isTransactionActivityEnabled:g}=c,a=Ae.getSignedInUser(),j=t.tenantState.currentTenantId,b={userId:a?.userId??"",sessionId:a?.zeniSessionId??"",tenantId:j??""},I=Me(t),{selectedTransactionCategorizationTab:$}=I;return{expenseAutomationViewSelector:I,bulkUploadSelector:I.missingReceipts.bulkUpload,vendorSearchAutoCompleteData:A,authParams:b,receiptUploadEndpoint:`${be.accountMicroServiceBaseUrl}`,transactionAttachmentsEndpoint:`${to}/transaction_attachments`,bulkUploadEndpoint:x===!0?`${be.communicationAgentMicroServiceBaseUrl}/1.0/receipts/bulk-upload`:void 0,isDisabled:!1,currentTab:$,monthEndInsightsCustomerRequestData:y,monthEndInsightsPreviewMode:r,allThreadsSectionOpen:!1,enableMonthEndInsightsZeniGPTFeature:!1,loggedInUser:a,uncategorizedAccounts:w,companyId:m,isTransactionActivityEnabled:g,isAccountingClassesEnabled:Mn(t)}},function(t,c){const{themeState:w,isCOTEnabled:A,isUncategorizedExpenseCategoryEnabled:y,isMissingReceiptsBulkUploadEnabled:r,location:m,vendorSearchAutoCompleteData:x,expenseAutomationViewSelector:g,currentTenant:a,uncategorizedAccounts:j,navigate:b,onClickCustomerRequest:I,handleEditClick:$,setActivityLogTransactionId:S}=c,{selectedPeriod:k,currentSelectedView:L,reconciliation:{selectedAccountId:K}}=g,{accountSettingsView:d}=g.jeSchedules,p=vt(k),E=ve(p.start),U=ve(p.end);return{onZeniLogoClick:()=>{w.toggle()},onUploadReceiptAttachment:e=>{M.trackMissingReceiptAttached(k.month,k.year),t(xa(e))},onUploadTransactionReceipt:(e,n,o,s,C,h)=>{t(mt(e,n,{fetchState:"In-Progress"}));const f=()=>t(mt(e,n,{fetchState:"Error"}));no(`${be.accountMicroServiceBaseUrl}/1.0/transactions/${n}/attachments`,h,n,o,s,C).then(v=>{v!=null?t(wa(e,v)):f()}).catch(f)},onMissingReceiptsRowClick:(e,n)=>{if(c.openTransactionPanel)return void c.openTransactionPanel(e,n);const o=H(m.state?.pathnameStackToGoBack,m.pathname);b(`../../transaction/${n}/${e}`,{state:{pathnameStackToGoBack:o,message:"expenseAutomation",origin:"missing_receipts"}})},onUploadReceiptComplete:(e,n)=>{t(Pa(e,n)),a!=null&&t(me({tenantId:a.tenantId,period:n,refreshViewInBackground:!0}))},onUploadReceiptFetchStatus:(e,n,o,s)=>{t(Aa(e,{fetchState:n,error:o})),o!=null&&t(dt({messageSection:"missing_receipts_attachment",messageText:"failed",type:"error",showStatusIcon:!0,variables:[{variableName:"__message__",variableValue:s!=null?Eo+ko+s+gt:gt}]}))},onUpdateJESchedulesUIState:e=>{t(Ta(e))},onUpdateMissingReceiptsUIState:e=>{t(va(e))},onFetchMissingReceiptsList:()=>{U!=null&&E!=null&&t(Pt({start:E,end:U},{amount:75,currencyCode:"USD",currencySymbol:"$"},!0,!1))},...r===!0?{onBulkUploadFiles:e=>{t(La(e))},onBulkUploadProgress:e=>{t(Ma(e))},onBulkUploadSuccess:e=>{t(ja({batchId:e}))},onBulkUploadUploadedFileCount:e=>{t(Va(e))},onConfirmBulkUploadMatch:(e,n,o,s,C)=>{t(_a(e,n,o,s,C))},onBulkUploadConfirmMatchAcknowledged:()=>{t(Fa())},onSetBulkUploadResultsTab:e=>{t(Oa(e))},onSetBulkUploadCompletedSubTab:e=>{t(Ba(e))},onSetBulkUploadSortConfig:(e,n)=>{t(ht({sortKey:e,sortOrder:n}))},onClearBulkUpload:()=>{t(Ua())},onSearchTransactionsForManualMatch:(e,n)=>{t(Ct(e,n??void 0))},onLoadMoreManualSearch:()=>{const{manualSearch:e}=g.missingReceipts.bulkUpload;e.nextPageToken!=null&&e.searchQuery!==""&&t(Ct(e.searchQuery,e.nextPageToken))},onFetchCompletedTransactions:(e,n)=>{t(Da(e,n))},onFetchBulkUploadBatches:e=>{t(Tt(e))},onFetchMoreBatchDetails:()=>{t(Ra())},onResetBulkUploadSort:()=>{t(ht({sortKey:"date",sortOrder:"descending"}))}}:{},onClearMissingReceiptsTabNavigation:()=>{t(ba())},onSearchTextChanged:e=>{const n=g.currentSelectedView,o=g.selectedTransactionCategorizationTab;n==="transaction_categorization"&&(t(Oe({selectedTab:o,uiState:{searchString:e}})),U!=null&&E!=null&&t(ue(o,{start:E,end:U},!0,!1,e,void 0,!0)))},onRefresh:()=>{c.trackExpenseAutomationTabAnalytics(!0),t(ya(y))},onClose:()=>{L==="reconciliation"&&K!=null&&t(ut({selectedAccountId:void 0})),b("../")},onBack:()=>{L==="reconciliation"&&K!=null&&t(ut({selectedAccountId:void 0}))},onSaveReconciliation:e=>{t(Ea(e))},onSaveReconciliationReview:e=>{t(ka(e))},onUpdateStep:e=>{const{selectedPeriod:n}=g,o=H(m.state?.pathnameStackToGoBack,m.pathname);b(`../${e}/${n.month}-${n.year}`,{state:{pathnameStackToGoBack:o,referrer:g.currentSelectedView}}),t(At(e))},handleLogOutClick:()=>{const e=H(m.state?.pathnameStackToGoBack,m.pathname);b("/signout",{replace:!0,state:{pathnameStackToGoBack:e,message:"logout"}})},onJeAccountSettingsChange:e=>{const{vendorsAccountSection:n}=e,{prepaidExpensesAccount:o,fixedAssetsAccount:s,accruedExpensesAccount:C}=n,h=_e(d.prepaidExpensesAccountList,o.selectedOptions),f=_e(d.fixedAssetsAccountList,s.selectedOptions),v=_e(d.accruedExpensesAccountList,C.selectedOptions),z={selectedPrepaidExpensesAccountIds:h.map(B=>B.accountId),selectedFixedAssetsAccountIds:f.map(B=>B.accountId),selectedAccruedExpensesAccountIds:v.map(B=>B.accountId)};t(fa({data:z}))},onSaveJeAccountSettingsClick:()=>{t(Ia())},onJESchedulesFormDataChange(e,n){const{jeScheduleID:o,accumulatedDepreciationCategory:s,scheduleClass:C,scheduleExpenseCategory:h,vendor:f}=n,{allAccountList:v,allClassList:z,allDepreciationAccountList:B}=g.jeSchedules,N=x.entityAutoCompleteView.vendor.length>0?x.entityAutoCompleteView.vendor.find(G=>G.id===f?.selectedOption):void 0,oe={id:N?.zeniId??f?.selectedOption??"",name:N?.name??f?.defaultOptions.find(G=>G.value===f?.selectedOption)?.label??"",logo:N?.logo},pe=h?.selectedOption!=null?v.find(G=>G.qboId===h.selectedOption):void 0,Pe=C?.selectedOption!=null?z.find(G=>G.classId===C.selectedOption):void 0,te=s?.selectedOption!=null?B.find(G=>G.qboId===s.selectedOption):void 0;t(Sa({scheduledJournalEntryID:e,localData:{jeScheduleID:o,scheduledJournalEntryID:e,updatedCategoryId:pe?.accountId,updatedClassId:Pe?.classId,updatedAccumulatedDepreciationCategoryID:te?.accountId,updatedVendor:{id:oe.id,name:oe.name}}}))},ignoreRecommendedJeSchedule(e,n){t(Ca(e,n))},vendorSearchAutoCompleteActions:{onAutoCompleteInputChange:(e,n)=>{e.trim().length>=2?t(ct({searchString:e,entityType:n,searchOrigin:"common"})):e.trim().length===0&&t(ke("common"))},onCancelAutoComplete:()=>{t(ke("common"))}},onPostJESchedule(e,n){t(ga({scheduledJournalEntryID:e,jeScheduleTransactionKey:n}))},clearJeScheduleLocalData(){t(pa())},handleJeScheduleClick:(e,n,o)=>{t(ha({selectedJEScheduleKey:n}));const s=H(m.state?.pathnameStackToGoBack,m.pathname);b(`../../vendors/schedules/${o}/details/${e}`,{state:{pathnameStackToGoBack:s,message:"expenseAutomation",origin:"je_schedules"}})},improveMonthEndInsightsUsingZeniGPTClick:e=>{a!=null&&t(ma(e,a.companyId,a.tenantId))},onClickCustomerRequest:I,setActivityLogTransactionId:S,onCloseAllThreadsSection:()=>{},onCloseFileAttachmentSnackBar:()=>{t(ua())},onOpenFileAttachmentSnackBar:()=>{t(dt({messageSection:"cockpit_month_end_email_attachment_upload",messageText:"failed",type:"error",showStatusIcon:!0}))},onRemoveFileAttachment:e=>{t(da(e))},onUpdateFileAttachment:e=>{t(ra({files:e}))},previewMonthEndReport:(e,n,o,s)=>{a!=null&&t(rt(e,a.companyId,n,!0,o,s,a.tenantId))},saveMonthEndReport:(e,n,o,s)=>{a!=null&&t(rt(e,a.companyId,n,!1,o,s,a.tenantId))},onEditMonthEndInsightsClick:$,sendMonthEndReport:e=>{const n=m.state?.referrer,{selectedPeriod:o,auditSummary:s}=g;a!=null&&s?.auditScorePercentage!=null&&(t(ia(a.companyId,e,a.tenantId)),M.trackInsightsEmailPage(o.month,o.year,!1,"draft",s.auditScorePercentage,la().format(jt.analytics.MMMDDCommaYYYYformat),n??null))},onTransactionCategorizationRowClick:(e,n)=>{if(c.openTransactionPanel)return void c.openTransactionPanel(e,n);const o=H(m.state?.pathnameStackToGoBack,m.pathname);b(`../../transaction/${n}/${e}`,{state:{pathnameStackToGoBack:o,message:"expenseAutomation",origin:"transaction_categorization"}})},setLocalDataForCategoryAndClass:(e,n,o,s,C,h,f,v,z,B,N)=>{t(ca(e,n,o,s,j,C,h,f,v,z,B,N))},onCancelAutoComplete:()=>{t(ke("common"))},updateExpenseAutomationReconListScrollPosition:e=>{t(it({scrollPosition:e}))},onUpdateTab:e=>{c.closeSidePanel?.(),U!=null&&E!=null&&(t(ue(e,{start:E,end:U},!1,!1)),t(sa(e)))},onUpdateTransactionCategorizationUIState:(e,n)=>{t(Oe({selectedTab:e,uiState:n})),U!=null&&E!=null&&t(ue(e,{start:E,end:U},!1,!1,n.searchString,null,!0))},onUpdateScrollYOffSetTransactionCategorizationUIState:(e,n)=>{t(Oe({selectedTab:e,uiState:n}))},onFetchTransactionCategorizationList:(e,n,o,s,C,h,f)=>{U!=null&&E!=null&&t(ue(e,{start:E,end:U},!0,o,n,s,C,h,f))},resetTransactionCategorizationLocalData:(e,n,o,s,C,h,f,v)=>{t(oa(e,n,o,s,v??null,C,h,!1,f))},updateSelectedVendorForTransaction:(e,n,o,s,C)=>{t(lt({selectedTab:e,transactionId:n,lineId:o,selectedTransaction:s,uncategorizedAccounts:j,updatedVendor:C}))},onSaveUpdateTransactionCategorization:(e,n,o)=>{const s=m.state?.referrer;e==="autoCategorized"?M.trackTransactionsAutoCategorisedPage(k.month,k.year,g.transactionView.totalCountByTab.autoCategorized,n.length,!1,s??null):M.trackTransactionsReviewPage(k.month,k.year,g.transactionView.totalCountByTab.review,n.length,!1,s??null),t(aa(e,n,o,y))},onUpdateSelectedCheckboxTransactionIds:(e,n)=>{t(na({selectedTab:e,transactionIds:n}))},onFetchRecommendationsForEntityCategorizationWithCustomer:(e,n,o,s,C,h,f)=>{const{transactionId:v,transaction:z,lineIds:B}=n;h!=null&&t(ea({transactionId:v,customerUpdates:h})),t(ta({selectedTab:s,transactionId:v.id,lineId:B[0],selectedTransaction:z,uncategorizedAccounts:j,updatedCustomer:h,selectedEntity:C,isUncategorizedExpenseCategoryEnabled:f})),C!=null&&t(Le(C,e,n,o,!0,A,f))},onFetchRecommendationsForEntityCategorization:(e,n,o,s,C,h,f)=>{const{transactionId:v,transaction:z,lineIds:B}=n;h!=null&&(t(Qn({transactionId:v,vendorUpdates:{name:h.name,id:h.id?h.id:void 0}})),t(Wn({vendorId:h.id?h.id:void 0,localData:{vendorName:h.name,vendorId:h.id?h.id:void 0}}))),h?.id?(t(lt({selectedTab:s,transactionId:v.id,lineId:B[0],selectedTransaction:z,uncategorizedAccounts:j,updatedVendor:h,selectedEntity:C,isUncategorizedExpenseCategoryEnabled:f})),C!=null&&t(Le(C,e,n,o,!0,A,f))):t(Xn({selectedTab:s,transactionId:v.id,lineId:B[0]}))},fetchFluxViewOnScroll:(e,n)=>{t(Ee(e,!0,!1,n,!1,!0))},onFetchFluxViewList:()=>{t(Ee(k,!0,!1,null,!1,!1))},markAsReview:(e,n,o,s)=>{M.trackFluxAnalysisReviewed(o.month,o.year,s??!1,e),t(Hn(n,e,o,s??!1))},onUpdateFluxAnalysisUIState:e=>{t(Zn(e))},updateOperatingExpensesIdsForReview:e=>{t(Nn({operatingExpenseIds:e,selectedPeriod:k}))},redirectToVendorDetailPage:e=>{if(c.tenantEmailDomain!=null){const n=co(e.id,e.qboId,c.tenantEmailDomain),o=H(c.location.state?.pathnameStackToGoBack,c.location.pathname);c.navigate(n,{state:{pathnameStackToGoBack:o,message:"expenseAutomation",referrer:"Vendor List",origin:"flux_analysis"}})}},updateSectionIdsForReview:e=>{t(Kn({sectionId:e,selectedPeriod:k}))},onFetchReimbursementView:(e,n,o)=>{t(Ee(e,!0,!1,n,!0,o))},onReviewClicked:e=>{t(ae(k,e))},setOpenDrawerClicked:e=>{t(je({selectedDrawerAccountId:e}))},onFetchLinkTokenClick:(e,n)=>{t(Rt("expense_automation_reconcile",e,n))},onEstablishConnectionClick:(e,n)=>{const o=a?.companyId;o!=null&&(t(wt(e,o,"expense_automation_reconcile",void 0,"link_account_no_microdeposit",n)),t(xt({accountId:n,connectionInProgress:!0})))},onAddStatementClick:e=>{t(je({selectedDrawerAccountId:e})),t(yt({accountId:e,selectedPeriod:k,localData:{accountSource:"bank_statement"}})),t(Et({statementUploadChosen:!0}))},onReloadReconciliationListPage:()=>{t(ae(k,void 0,!0,!1))},onUpdateReconcileTabLocalData:e=>{t(Jn({selectedTransactionIds:e}))},onReconTabColumnSortConfigChanged:(e,n)=>{t(Yn({sortKey:e,sortOrder:n}))},onReconReviewTabColumnSortConfigChanged:(e,n)=>{t(qn({sortKey:e,sortOrder:n}))},onReconTabUpdate:e=>{c.closeSidePanel?.(),t(Gn({selectedTab:e}))},updateReconReviewTabLocalData:(e,n,o)=>{const s=e.vendor?.id;o&&s!=null&&t(zn(s)),t($n({data:e,transactionId:n}))},onReconMatchedTransactionClick:e=>{if(c.openTransactionPanel)return void c.openTransactionPanel(e,bt("bill"));const n=H(m.state?.pathnameStackToGoBack,m.pathname);b(`../../transaction/bill/${e}`,{state:{pathnameStackToGoBack:n,message:"expenseAutomation",origin:"reconciliation"}})},onReloadPage:()=>{window.location.reload()},onBackClick:()=>{b(-1)},onReconListPageScroll:e=>{t(it({scrollPosition:e}))},onVendorAutoCompleteInputChange:e=>{e.trim().length>=2?t(ct({searchString:e,searchOrigin:"common"})):e.trim().length===0&&t(ke("common"))},onReconNodeCollapseToggled:(e,n)=>{t(Ln({nodeId:e,collapsed:n}))},updateSectionCollapseStatus:()=>{},onExcludeAccountFromReconciliation:e=>{t(ft({accountId:e}))},onIncludeAccountIntoReconciliation:e=>{t(kt({accountId:e}))}}},(t,c,w)=>{const{isMissingReceiptsBulkUploadEnabled:A,...y}=w;return function(r,m,x){return{...r,...m,...x,onUploadTransactionReceipt:(g,a,j,b,I)=>{m.onUploadTransactionReceipt(g,a,j,b,I,r.authParams)}}}(t,c,y)})(eo),bo=oo(({closeSidePanel:t,openTransactionPanel:c,panelContent:w,sidePanelIsFullView:A,sidePanelIsOpen:y})=>{const{isAiCfoOpen:r,setIsAiCfoOpen:m}=Dt(),x=It(),g=Ve(),a=he(),{isAiCfoAccessEnabled:j,onAskAiCfoClick:b}=_t({isAiCfoOpen:r,setIsAiCfoOpen:m,mobileExploreReferrer:"Transaction categorization"}),{areTenantIdsInSync:I}=Bt(),$=(()=>{const i=V(q=>Me(q)),T=Ve(),{currentSelectedViewFetchState:D,currentSelectedView:F,selectedPeriod:R}=i,de=Fe(F),X=Fe(D.fetchState),Se=l.useCallback(q=>{const Z=T.state?.referrer;F==="transaction_categorization"&&(i.selectedTransactionCategorizationTab==="review"?M.trackTransactionsReviewPage(R.month,R.year,i.transactionView.totalCountByTab.review,0,q,Z??null):M.trackTransactionsAutoCategorisedPage(R.month,R.year,i.transactionView.totalCountByTab.autoCategorized,0,q,Z??null)),F==="missing_receipts"&&M.trackMissingReceiptsPage(R.month,R.year,q,i.missingReceipts.transactions.length,Z??null),F==="je_schedules"&&M.trackMonthCloseScheduleListPage(R.month,R.year,q,i.jeSchedules.draftSchedules.length,i.jeSchedules.resolveSchedules.length,Z??null),F==="flux_analysis"&&M.trackFluxAnalysisPage(R.month,R.year,q,fo(i.fluxAnalysis),Z??null),F==="month_end_insights"&&i.auditSummary?.auditScorePercentage!=null&&M.trackInsightsEmailPage(R.month,R.year,q,"draft",i.auditSummary.auditScorePercentage,null,Z??null)},[R,i]);return l.useEffect(()=>{X===D.fetchState&&F===de||D.fetchState!=="Completed"||Se(!1)},[F,D.fetchState,de]),Se})(),S=Ka(),[k,L]=l.useState(!1),K=V(i=>at(i)),d=V(i=>$e(i)),[p,E]=l.useState(!1),[U,e]=l.useState(!1),[n,o]=l.useState([]),[s,C]=l.useState(void 0),[h,f]=l.useState(!1),v=l.useRef(!1),{selectedTab:z}=nt(),{tenantEmailDomain:B}=nt(),[N,oe]=l.useState(g.state?.message==="comingFromTransactionDetail"),pe=g.state?.message==="comingFromOverview",Pe=Na(),te=Ae.getSignedInUser(),{useDynamicConfig:G,useFeatureGate:we}=Ut(),{configValue:Mt}=G(Za.enableUncategorizedExpenseCategory),Q=Mt?.uncategorized_expense_category_enabled===!0,{isFeatureEnabled:Ge}=we(ye.isRealtimeInsightsFeatureEnabled),{isFeatureEnabled:se}=we(ye.isMissingReceiptsBulkUploadEnabled),{isFeatureEnabled:qe}=we(ye.isTransactionActivityEnabled),Lt=V(i=>xn(i,"common")),_=V(i=>Me(i)),{monthEndCloseChecksView:J,currentSelectedView:O,selectedPeriod:P,selectedTransactionCategorizationTab:Ye,currentSelectedViewBackgroundRefreshFetchState:zt,currentSelectedViewFetchState:W,jeSchedules:xe,reconciliation:$t}=_,{selectedAccountId:ce}=$t,Je=Fe(xe.accountSettingsView.saveState.fetchState),Gt=V(i=>Rn(i.accountState,i.accountListState,"accountList")),ie=z!=null?Dn(z):O,qt=V(i=>i.entityAutoCompleteState.autoCompleteText.common);if(Vt({isDataReady:W.fetchState==="Completed"}),te==null)throw Error("Can't access expense automation screen without signing in...");const Ke=vt(P),le=ve(Ke.start),re=ve(Ke.end);if(le==null||re==null)throw Error(`Invalid start - ${le} and end - ${re} period from given ${P}`);const Yt=l.useCallback(()=>{E(!1)},[]),Jt=l.useCallback(()=>{e(!0)},[]),Kt=l.useCallback(i=>{o(i),e(!1)},[]),Nt=l.useCallback(()=>{o([])},[]),Re=`private-${te.userId}`,Ne="missing-receipts-batch-completed",ge=Ha();l.useEffect(()=>{if(ge==null||O!=="missing_receipts"||se===!1)return;const i=ge.channel(Re)??ge.subscribe(Re),T=D=>{a(jn({batchId:D.batch_id,progress:D.progress,status:D.status.toLowerCase()}))};return i.bind(Ne,T),()=>{i.unbind(Ne,T)}},[ge,O,Re,a,se]);const Ce=_.missingReceipts.bulkUpload.phase,Ze=_.missingReceipts.bulkUpload.currentBatchId;l.useEffect(()=>{O==="missing_receipts"&&Ce==="matching"&&Ze!=null&&a(Tt({cacheOverride:!0}))},[O,Ce,Ze,a]);const He=te?.userId,Zt=P.month,Ht=P.year,Qe=d?.tenantId;l.useEffect(()=>{O==="missing_receipts"&&se!==!1&&Ce==="idle"&&He!=null&&Qe!=null&&a(Un())},[O,se,Ce,He,Qe,Zt,Ht,a]),l.useEffect(()=>{K.newVendorState?.vendorDetailLocalData?.vendorName!=null?L(!0):L(!1)},[K.newVendorState?.vendorDetailLocalData?.vendorName]),l.useEffect(()=>{ie!=null&&O!==ie&&a(At(ie))},[ie]),l.useEffect(()=>{h!==!1||W.fetchState!=="Completed"&&W.fetchState!=="Error"||!I||(f(!0),a(ot(!1,!1,Q)))},[h,W,I,Q]),l.useEffect(()=>{!pe&&I&&(a(ot(!1,!1,Q)),a(ae(P,ce,!1,!1)))},[P.month,P.year,I,Q]);const We=l.useCallback((i=!1,T=!1)=>{const D={start:le,end:re};switch(O){case"transaction_categorization":a(ue(Ye,D,i,!N,void 0,void 0,T,void 0,Q)),oe(!1);break;case"flux_analysis":a(Ee(P,i,T,null));break;case"month_end_insights":if(T===!1){const F=new Date(P.year,P.month,0),R=On(F.toDateString()).format(jt.analytics.YYYYDashMMDashDDFormat);a(Fn(!0,d.companyId,d.tenantId,R)),a(_n(d.companyId,d.tenantId))}break;case"je_schedules":a(Bn(D,T));break;case"missing_receipts":a(Pt(D,{amount:75,currencyCode:"USD",currencySymbol:"$"},i,T));break;default:a(ae(P,ce,i,T))}},[O,le,re,d.companyId,d.tenantId,Ye,P,ce,N,oe,Q]);l.useEffect(()=>{O===ie&&W.fetchState==="Not-Started"&&I&&We(!0)},[W,le,re,d.companyId,d.tenantId,I]),l.useEffect(()=>{pe||N||v.current||zt.fetchState==="In-Progress"||W.fetchState!=="Completed"||(v.current=!0,We(!0,!0))},[]),l.useEffect(()=>{J.fetchState!=="In-Progress"&&J.fetchState!=="Completed"&&a(me({tenantId:d.tenantId,period:P,refreshViewInBackground:!1}))},[J.fetchState,d.tenantId]),l.useEffect(()=>{_.monthEndInsights?.previewMonthEndReportStatus?.fetchState==="Completed"?E(!0):E(!1)},[_.monthEndInsights?.previewMonthEndReportStatus?.fetchState]),l.useEffect(()=>{_.monthEndInsights?.sendMonthEndReportStatus?.fetchState==="Completed"&&I&&(a(me({tenantId:d.tenantId,period:P,refreshViewInBackground:!0})),a(Vn({companyId:d.companyId})),x("../"))},[_.monthEndInsights?.sendMonthEndReportStatus?.fetchState,d.tenantId,P,d.companyId,I]),l.useEffect(()=>{const i=setInterval(()=>{J.fetchState!=="In-Progress"&&J.fetchState==="Completed"&&a(me({tenantId:d.tenantId,period:P,refreshViewInBackground:!0}))},3e5);return()=>clearInterval(i)},[J.fetchState,d.tenantId,P,a]),l.useEffect(()=>{const i=setInterval(()=>{O==="reconciliation"&&ce==null&&_.reconciliation.fetchStatus.fetchState==="Completed"&&_.reconciliation.refreshStatus.fetchState!=="In-Progress"&&a(ae(P,void 0,!0,!0))},3e5);return()=>clearInterval(i)},[O,a,_.reconciliation.fetchStatus.fetchState,_.reconciliation.refreshStatus.fetchState,ae,ce,P]);const Qt=pt();l.useEffect(()=>{const i=(J.monthEndCloseChecks?.monthEndCloseCheckList.find(T=>T.id==="month_end_insights")?.isDisabled??!1)&&!Ge;O!=="month_end_insights"||!i&&J.monthEndCloseChecks?.reportEmailSentDate==null||x("../")},[O,J.monthEndCloseChecks]);const Wt=_.reconciliation.selectedDrawerAccountId;l.useEffect(()=>{Je==="In-Progress"&&xe.accountSettingsView.saveState.fetchState==="Completed"&&a(st())},[Je,xe.accountSettingsView.saveState.fetchState,st]);const{transactionId:Xe,onSaveVendor:Xt,onSaveSuccess:en,onCancel:tn,vendorViewDetails:nn}=(({expenseAutomationViewSelector:i,closeDrawerHandler:T,currentSelectedView:D})=>{const F=he();let R,de,X;const Se=pt(),q=i.transactionView;let Z=()=>{};const{transactions:an,selectedTransactionId:ne,selectedTransactionLineId:Ie,transactionLocalData:on}=q;if(D==="transaction_categorization"){const De=on.find(ee=>ee.transactionId===ne),Y=an.find(ee=>ee.id===ne),et=Ie!=null?De?.transactionReviewLocalData?.lineItemById[Ie]:void 0,tt=et?.account;de=et?.class?.classId,R=["Uncategorized Income","Uncategorized Expense"].includes(tt?.accountName??"")?void 0:tt?.accountId;const cn=so(ne,Y?.typeOfTransaction);Y!=null&&cn&&(X={id:ne,type:bt(Y.typeOfTransaction)}),Z=()=>{if(ne!=null&&Ie!=null&&Y!=null){const ee=q.transactionLocalData.find(fe=>fe.transactionId===ne)?.transactionReviewLocalData;if(ee!=null&&Y.lines!=null&&Y.lines.length>0){const fe=ee.lineItemById[Ie];let Ue=ee.selectedEntity;if(wn(Y)||(Ue=fe.selectedEntityLine),Ue!=null){const ln=Ue,rn={transactionId:{id:Y.id,type:Y.type},transaction:Y,lineIds:Y.lines.map(dn=>dn.id)??[]};F(Le(ln,fe.amount.amount,rn,!1,!0,Se))}}}}}const sn=V(De=>at(De,void 0,R,de));return{transactionId:X,onSaveVendor:()=>{F(Pn(X,void 0,!1,!0))},onSaveSuccess:Z,onCancel:()=>{X!=null&&F(vn({transactionId:X})),F(Tn()),F(An()),T()},vendorViewDetails:sn}})({expenseAutomationViewSelector:_,closeDrawerHandler:()=>{L(!1)},currentSelectedView:O});return Pe?.loggedInUserRoleMap==null?J.fetchState==="Error"?u.jsx(Qa,{onGoHome:()=>x("../",{replace:!0}),onReload:()=>window.location.reload()}):u.jsx(Ft,{fetchState:"In-Progress"}):u.jsxs(u.Fragment,{children:[u.jsx(io,{isOpen:U,drawerLeftMargin:new Wa(0,0,300,650),onClose:()=>{e(!1)},children:u.jsx(vo,{onClick:i=>i.stopPropagation(),children:u.jsx(po,{companyId:d.companyId,closeCustomerRequestDrawer:()=>e(!1),addCustomerRequest:Kt,resetCustomerRequest:Nt})})}),Xe!=null&&k&&u.jsx(ao,{isOpen:k,transactionId:Xe,onSaveVendor:Xt,onSaveSuccess:en,onCancel:tn,vendorViewDetails:nn}),u.jsx(mo,{selectedDrawerAccountId:Wt,reconciliation:_.reconciliation,onFetchLinkTokenClick:(i,T)=>{a(Rt("expense_automation_reconcile",i,T))},onEstablishConnectionClick:(i,T)=>{const D=d?.companyId;D!=null&&(a(wt(i,D,"expense_automation_reconcile",void 0,"link_account_no_microdeposit",T)),a(xt({accountId:T,connectionInProgress:!0})))}}),qe&&u.jsx(So,{selectedTransactionId:s,onClose:()=>C(void 0)}),u.jsx(yo,{navigate:x,location:g,themeState:S,vendorSearchAutoCompleteData:{autoCompleteText:qt,entityAutoCompleteView:Lt},expenseAutomationViewSelector:_,isMissingReceiptsBulkUploadEnabled:se,monthEndInsightsPreviewMode:p,monthEndInsightsCustomerRequestData:n,isRealtimeInsightsFeatureEnabled:Ge,isUncategorizedExpenseCategoryEnabled:Q,isCOTEnabled:Qt,currentTenant:d,companyId:d.companyId,signedInUser:te,isTransactionActivityEnabled:qe,uncategorizedAccounts:Gt,onClickCustomerRequest:Jt,handleEditClick:Yt,tenantEmailDomain:B,trackExpenseAutomationTabAnalytics:$,setActivityLogTransactionId:C,closeSidePanel:t,openTransactionPanel:c,sidePanelIsOpen:y,sidePanelIsFullView:A,panelContent:w,isAiCfoAccessEnabled:j,onAskAiCfoClick:b})]})}),vo=Te(ze)`
|
|
17
17
|
display: flex;
|
|
18
18
|
min-height: 100%;
|
|
19
19
|
flex-direction: column;
|
|
20
|
-
`;function Zo(){return u.jsxs(hn,{children:[u.jsx(Be,{path:"*",element:u.jsx(lo,{})}),u.jsx(Be,{path:"/:selectedTab/:selectedPeriod/*",element:u.jsx(
|
|
20
|
+
`;function Zo(){return u.jsxs(hn,{children:[u.jsx(Be,{path:"*",element:u.jsx(lo,{})}),u.jsx(Be,{path:"/:selectedTab/:selectedPeriod/*",element:u.jsx(bo,{})}),u.jsx(Be,{path:"*",element:u.jsx(un,{})})]})}export{Zo as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{j as s}from"./liveblocks-CQd3J_Jz.js";import{a as r}from"./sentry-BO53Tmje.js";import{X as i,$ as l,Z as p,q as d}from"./index-_YbuoSTd.js";import"./mui-B5MJXy46.js";import m from"./NotFoundScreen-DKiPvQrK.js";import{j as b,u}from"./core-CHx9v1R3.js";(function(){try{var a=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},e=new a.Error().stack;e&&(a._sentryDebugIds=a._sentryDebugIds||{},a._sentryDebugIds[e]="f0a431af-9ff7-4bb4-8c6c-80849a1f61cb",a._sentryDebugIdIdentifier="sentry-dbid-f0a431af-9ff7-4bb4-8c6c-80849a1f61cb")}catch{}})();const D=()=>{const a=b(),e=u(),t=r.useCallback(()=>{window.open("https://www.zeni.ai/demo/request","_blank")},[]),f=r.useCallback(()=>{(()=>{const n=d(e.state?.pathnameStackToGoBack),c=n.poppedPathname??k();a(c,{state:{pathnameStackToGoBack:n.newStack}})})()},[]),o=i(e.pathname);return o!=null?s.jsx(l,{menuItem:p(o),onDemoClick:t,onGoBack:f}):s.jsx(m,{})},k=(a=2)=>{let e="../";for(let t=0;t<a;t++)e=`${e}../`;return e};export{D as F};
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
import{j as a}from"./liveblocks-CQd3J_Jz.js";import{l as b,k as x,j,u as y,h as Z,q as ee,g as A,N as ae,n as te,o as p}from"./core-CHx9v1R3.js";import{Iu as S,Iv as k,Iw as N,yQ as $,yC as L,Ix as C,Iy as ne,Iz as oe,yG as ie,eN as I,yN as se,yK as le}from"./zeni-epic-state-T7UkKQQw.js";import{J as g,o as r,E as re,c as v,j as E,p as de,q as ce,r as me,v as F,i as pe,s as ue,R as he,Y as xe,h as ge,B as fe,x as we,k as be,y as ye,A as Se,C as ke,M as ve}from"./index-_YbuoSTd.js";import{n as c}from"./mui-B5MJXy46.js";import f from"./NotFoundScreen-DKiPvQrK.js";import{a as P}from"./sentry-BO53Tmje.js";import"./recharts-nKX4-UUs.js";import"./analytics-DuZD1FBf.js";import"./plaid-CcgrQve1.js";import"./dnd-Ci4anwe2.js";import"./stripe-DMRn4zHo.js";import"./lottie-Dnly7PBz.js";import"./lexical-DQpmcVQ9.js";import"./pdf-DYwn2DuC.js";import"./utils-DpJstXha.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]="0a570bad-c742-4b8e-9722-1340e1a3f86c",e._sentryDebugIdIdentifier="sentry-dbid-0a570bad-c742-4b8e-9722-1340e1a3f86c")}catch{}})();const Ie=c.div`
|
|
2
|
+
display: flex;
|
|
3
|
+
height: 100%;
|
|
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
|
+
box-shadow: ${e=>`0px 2px ${r.sp1} ${e.theme.colors.dropShadowNormal}`};
|
|
10
|
+
`,je=x(function(e){const t=S(e),n=k(e),{companyName:o}=t;return{companyName:o,isDisabled:t.fetchState!=="Completed"?"disabled":void 0,magicLinkBankAccountDetails:n,magicLinkViewState:t}},function(e,t){const{vendorId:n,billId:o}=t;return{onFetchBankName:i=>{e(L(i))},onSaveHandler:i=>{v.trackBillPayMagicLinkSubmitBankAccountDetails(o),e($(i,"standard",n,o))},onACHDetailsUpdated:i=>{const{bankAccountSection:l}=i;e(N({data:l}))}}})(re);function z(){const e=g(),{vendorId:t,billId:n}=b();return t==null||n==null?a.jsx(f,{}):a.jsx(a.Fragment,{children:a.jsx(Ie,{windowSize:e,children:a.jsx(je,{vendorId:t,billId:n})})})}const $e=c.div`
|
|
11
|
+
display: flex;
|
|
12
|
+
height: 100vh;
|
|
13
|
+
width: 100%;
|
|
14
|
+
flex: 1 1 auto;
|
|
15
|
+
flex-direction: column;
|
|
16
|
+
align-items: center;
|
|
17
|
+
background-color: ${e=>e.theme.colors.grey4};
|
|
18
|
+
box-shadow: ${e=>`0px 2px ${r.sp1} ${e.theme.colors.dropShadowNormal}`};
|
|
19
|
+
`,Ce=x(function(e,t){const{isSubPage:n}=t;return{addressToEdit:C(e),googleAPIKey:E.googleMapsAPIKey,isSubPage:n}},function(e,t){const{navigate:n,location:o}=t,i=()=>{const l=ce(o.state?.pathnameStackToGoBack),s=l.poppedPathname??De();n(s,{state:{pathnameStackToGoBack:l.newStack}})};return{onSubmitHandler:l=>{const s=Ae(l);e(ne({addressToCreate:s})),i()},onCancel:()=>{i()}}})(de);function Be({isSubPage:e}){const t=j(),n=y(),o=g();return a.jsx(a.Fragment,{children:a.jsx($e,{windowSize:o,children:a.jsx(Ce,{location:n,navigate:t,isSubPage:e===!0,googleAPIKey:E.googleMapsAPIKey})})})}const De=(e=2)=>{let t="../";for(let n=0;n<e;n++)t=`${t}../`;return t},Ae=e=>({street:[e.street.addressString,e.suite,e.secondaryInfo],city:e.city,state:e.state,country:e.country.selectedOption??"",countryCode:e.countryCode,postalCode:e.postalCode,latitude:e.street.addressValue?.locationLat,longitude:e.street.addressValue?.locationLng}),Pe=c.div`
|
|
20
|
+
display: flex;
|
|
21
|
+
height: 100%;
|
|
22
|
+
width: 100%;
|
|
23
|
+
flex: 1 1 auto;
|
|
24
|
+
flex-direction: column;
|
|
25
|
+
align-items: center;
|
|
26
|
+
background-color: ${e=>e.theme.colors.grey4};
|
|
27
|
+
box-shadow: ${e=>`0px 2px ${r.sp1} ${e.theme.colors.dropShadowNormal}`};
|
|
28
|
+
`,ze=x(function(e){const t=S(e),n=k(e),o=C(e),{companyName:i}=t;return{companyName:i,isDisabled:t.fetchState!=="Completed"?"disabled":void 0,magicLinkBankAccountDetails:n,mailingAddressDetails:o,magicLinkViewState:t}},function(e,t){const{navigate:n,location:o,vendorId:i,billId:l}=t;return{onFetchBankName:s=>{e(L(s))},onSaveHandler:s=>{v.trackBillPayMagicLinkSubmitBankAccountDetails(l),e($(s,"us-domestic",i,l))},onWireDetailsUpdated:s=>{const{bankAccountSection:d}=s;e(N({data:d}))},onAddressClick:()=>{const s=o.pathname.replace("us-domestic","address"),d=F(o.state?.pathnameStackToGoBack,o.pathname);n(s,{state:{pathnameStackToGoBack:d}})}}})(me);function Ne(){const e=j(),t=y(),n=g(),{vendorId:o,billId:i}=b();return o==null||i==null?a.jsx(f,{}):a.jsx(a.Fragment,{children:a.jsx(Pe,{windowSize:n,children:a.jsx(ze,{location:t,navigate:e,vendorId:o,billId:i})})})}const Le=c.div`
|
|
29
|
+
display: flex;
|
|
30
|
+
height: 100%;
|
|
31
|
+
width: 100%;
|
|
32
|
+
flex: 1 1 auto;
|
|
33
|
+
flex-direction: column;
|
|
34
|
+
align-items: center;
|
|
35
|
+
background-color: ${e=>e.theme.colors.grey4};
|
|
36
|
+
box-shadow: ${e=>`0px 2px ${r.sp1} ${e.theme.colors.dropShadowNormal}`};
|
|
37
|
+
`,Ee=x(function(e){const t=S(e),n=k(e),o=C(e),{companyName:i}=t;return{companyName:i,isDisabled:t.fetchState!=="Completed"?"disabled":void 0,magicLinkBankAccountDetails:n,mailingAddressDetails:o,magicLinkViewState:t}},function(e,t){const{navigate:n,location:o,vendorId:i,billId:l}=t;return{onFetchBankNameBySwift:s=>{e(ie(s))},onSaveHandler:s=>{v.trackBillPayMagicLinkSubmitBankAccountDetails(l),e($(s,"international",i,l,t.isLocalCurrencyEnabled))},onBankDetailsUpdated:s=>{const{internationalWireSwiftAccountSection:d}=s;e(oe({data:d}))},onAddressClick:()=>{const s=o.pathname.replace("international","address"),d=F(o.state?.pathnameStackToGoBack,o.pathname);n(s,{state:{pathnameStackToGoBack:d}})}}})(he);function Fe(){const e=j(),t=y(),n=g(),{vendorId:o,billId:i}=b(),{useFeatureGate:l}=pe(),{isFeatureEnabled:s}=l(ue.isBillPayLocalCurrencyFeatureEnabled);return o==null||i==null?a.jsx(f,{}):a.jsx(Le,{windowSize:n,children:a.jsx(Ee,{location:t,navigate:e,vendorId:o,billId:i,isLocalCurrencyEnabled:s})})}const Te={containerWidth:new ke(100,58)},Ge=c(ye)`
|
|
38
|
+
width: ${r.sp4};
|
|
39
|
+
height: ${r.sp4};
|
|
40
|
+
margin-bottom: ${r.sp3};
|
|
41
|
+
margin-top: ${r.sp3};
|
|
42
|
+
margin-left: ${r.sp8};
|
|
43
|
+
cursor: pointer;
|
|
44
|
+
position: absolute;
|
|
45
|
+
color: ${e=>e.theme.colors.brandColorJade};
|
|
46
|
+
`,Me=c.div`
|
|
47
|
+
display: flex;
|
|
48
|
+
height: 100vh;
|
|
49
|
+
flex-direction: ${e=>e.windowSize==="small"?"column":"row"};
|
|
50
|
+
width: 100vw;
|
|
51
|
+
overflow-y: scroll;
|
|
52
|
+
background-color: ${e=>e.theme.colors.grey4};
|
|
53
|
+
`,He=c.div`
|
|
54
|
+
display: flex;
|
|
55
|
+
flex-direction: ${e=>e.windowSize==="small"?"column":"row"};
|
|
56
|
+
flex-direction: column;
|
|
57
|
+
width: ${e=>`${Te.containerWidth.value(e.windowSize)}%`};
|
|
58
|
+
${e=>e.windowSize!=="small"?"overflow: auto;":""}
|
|
59
|
+
box-shadow: ${e=>`0px 2px ${r.sp1} ${e.theme.colors.dropShadowNormal}`};
|
|
60
|
+
padding-top: ${e=>e.windowSize!=="small"?r.sp2:"0px"};
|
|
61
|
+
`,Ke=c.div`
|
|
62
|
+
display: flex;
|
|
63
|
+
flex-direction: column;
|
|
64
|
+
align-items: center;
|
|
65
|
+
justify-content: center;
|
|
66
|
+
padding: ${e=>e.windowSize==="small"?r.sp3:`62px ${r.sp6} ${r.sp9} ${r.sp8}`};
|
|
67
|
+
height: ${e=>e.windowSize==="small"?"490px":"auto"};
|
|
68
|
+
overflow: ${e=>e.windowSize==="small"?"unset":"hidden"};
|
|
69
|
+
width: ${e=>e.windowSize=="small"?"auto":"42%"};
|
|
70
|
+
background-color: ${e=>e.windowSize==="small"?e.theme.colors.grey4:e.theme.colors.background};
|
|
71
|
+
margin-top: ${e=>e.windowSize==="small"?e.isAddressPage?"0px":"186px":"unset"};
|
|
72
|
+
`,Ve=x(function(e,t){return{file:t.file,type:t.type}})(Se);function h({appContent:e}){const t=Z(),n=y(),{tenantEmailDomain:o,vendorId:i,billId:l}=b(),[s]=ee(),d=s.get("token"),T=n.pathname.includes("address"),w=g(),G=xe(),B=ge(),M=()=>{G.toggle()},H=A(u=>S(u)),K=A(u=>k(u)),{authParams:V,fetchState:m,billAttachment:W,billFetchState:D,companyName:_,currencySymbol:U,amount:q}=H,{tenantId:J,userId:O,sessionId:Q}=V,{fetchState:R,internationalBankAccountCreateStatus:Y}=K;return P.useEffect(()=>{I(),m==="Not-Started"&&i!=null&&o!=null&&d!=null&&t(se(i,o,d))},[]),P.useEffect(()=>{m==="Completed"&&(I(O,Q,J),l!=null&&t(le(l)))},[m]),m==="Error"?a.jsx(f,{}):R==="Completed"||Y.fetchState==="Completed"?(I(),a.jsx(ae,{to:"../../../../../../../bank/account/save/success",replace:!0,relative:"path"})):m==="In-Progress"?a.jsx(fe,{fetchState:m,style:{height:"100vh",backgroundColor:B.colors.grey5,boxShadow:`0px 2px ${r.sp1} ${B.colors.dropShadowNormal}`}}):a.jsxs(a.Fragment,{children:[m==="Completed"&&D==="Completed"&&a.jsx(we,{analytics:v,onLoad:u=>(X=>X.trackBillPayMagicLinkPageLoad(o??"",i??"",_,l??"",We(n.pathname),U,q))(u)}),a.jsxs(Me,{windowSize:w,children:[w!=="small"?a.jsx(Ge,{onClick:M}):null,a.jsx(Ke,{windowSize:w,isAddressPage:T,children:D==="In-Progress"?a.jsx(be,{size:"ExtraLarge",start:!0}):a.jsx(Ve,{file:W,type:"bill"})}),a.jsx(He,{windowSize:w,children:e})]})]})}const We=e=>`${e.split("/").at(-2)}_${e.split("/").at(-1)}`;function _e(){return a.jsx(ve,{})}function la(){return a.jsxs(te,{children:[a.jsx(p,{path:"bank/account/save/success",element:a.jsx(_e,{})}),a.jsx(p,{path:":tenantEmailDomain/vendor/:vendorId/bill/:billId/ach/standard",element:a.jsx(h,{appContent:a.jsx(z,{})})}),a.jsx(p,{path:":tenantEmailDomain/vendor/:vendorId/bill/:billId/ach/same-day",element:a.jsx(h,{appContent:a.jsx(z,{})})}),a.jsx(p,{path:":tenantEmailDomain/vendor/:vendorId/bill/:billId/wire/address",element:a.jsx(h,{appContent:a.jsx(Be,{isSubPage:!0})})}),a.jsx(p,{path:":tenantEmailDomain/vendor/:vendorId/bill/:billId/wire/us-domestic",element:a.jsx(h,{appContent:a.jsx(Ne,{})})}),a.jsx(p,{path:":tenantEmailDomain/vendor/:vendorId/bill/:billId/wire/international",element:a.jsx(h,{appContent:a.jsx(Fe,{})})}),a.jsx(p,{path:"*",element:a.jsx(f,{})})]})}export{la as default};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import{j as u}from"./liveblocks-CQd3J_Jz.js";import{a as f}from"./sentry-BO53Tmje.js";import{h as U,u as w,j as _,q as M,g as l,N as T}from"./core-CHx9v1R3.js";import{z as r,h as P,D as V,d as A,c as N,e as q,w as R,k as W,g as $}from"./index-_YbuoSTd.js";import{eM as B,Ie as G,Ip as H,If as J,eN as K,fi as Q,Il as X,fF as Y,cR as Z,Iq as ee,Ir as te}from"./zeni-epic-state-T7UkKQQw.js";import{n as ne}from"./mui-B5MJXy46.js";import{u as ae}from"./useDeviceId-J1-jcXdc.js";import{f as se}from"./analyticsHelper-CezXrIid.js";import{t as ie}from"./getLocaleForTenant-BobWg4Hu.js";import"./recharts-nKX4-UUs.js";import"./analytics-DuZD1FBf.js";import"./plaid-CcgrQve1.js";import"./dnd-Ci4anwe2.js";import"./stripe-DMRn4zHo.js";import"./lottie-Dnly7PBz.js";import"./lexical-DQpmcVQ9.js";import"./pdf-DYwn2DuC.js";import"./utils-DpJstXha.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]="c31c3e87-f625-4a2f-b43b-e7ea45ae5d4a",t._sentryDebugIdIdentifier="sentry-dbid-c31c3e87-f625-4a2f-b43b-e7ea45ae5d4a")}catch{}})();const D=(t,s)=>t!=null&&t.length>0&&s==="magic_links";function De(){const t=U(),s=w(),m=_(),[b]=M(),n=b.get("token"),p=b.get("stytch_token_type"),g=r.getMagicLinkCodeVerifier(),i=ae(),{otpChallenge:d,twoFAPhoneNumber:x,magicLinkEmail:c,verifyDeviceFetchState:z,resendVerifyDeviceOTPFetchState:C}=l(e=>e.tenantState),I=l(e=>e.tenantState.fetchState),y=l(e=>e.tenantState.activeTenantFetchState.fetchState),S=l(e=>e.tenantState.signInState),h=l(e=>e.tenantState.magicLinkSignInFetchState.fetchState),a=l(e=>e.tenantState.loggedInUser),o=l(e=>B(e)),k=l(e=>G(e)),E=r.getSignedInUser(),v=P().mode;f.useEffect(()=>{a?.zeniSessionId==null&&n!=null&&D(n,p)&&i!=null&&g!=null&&(r.saveMagicLinkTriggered(n),t(H(n,i,g)))},[n,p,t,i,g,a?.zeniSessionId]),f.useEffect(()=>{S!=="In-Progress"||I!=="Completed"&&y!=="Completed"||a?.zeniSessionId==null||o==null||(n!=null&&r.saveLastUsedMagicLinkToken(n),r.saveSignedInUserWithSession(a,a.zeniSessionId),r.saveSignedInUserTenants(J(k.tenantsInOrder),a.zeniSessionId),K(a.userId,a.zeniSessionId,o.tenantId),t(Q(o.tenantId)),r.saveActiveTenantDomainForUser(o.tenantEmailDomain),t(X("Completed")),V.updateAppLocaleID(ie(o)),se(a,o,v,void 0,k.tenantsInOrder),Y().then(()=>{const e=$();e!=null&&A(e)}),setTimeout(()=>{N.trackLogin(q.Event.loginSuccess,"email",Z(o.productSettings))},2e3))},[S,I,y,a,o,k,v,s.state,t]);const F=f.useCallback(()=>{m("/signin/auth")},[m]),j=f.useCallback(()=>{i!=null&&d!=null&&c!=null&&t(ee(i,c,d))},[i,d,t,c]),O=f.useCallback(e=>{i!=null&&n!=null&&c!=null&&d!=null&&t(te(e,i,c,d))},[i,n,t,c,d]);if(h==="Completed"&&d!=null)return u.jsx(R,{phoneNumber:x,verifyOtpFetchState:z.fetchState,resendVerifyDeviceOTPFetchState:C,onResendOtp:j,onVerifyOtp:O,onCancelVerifyDevice:F});if(S==="In-Progress"&&I==="Completed"&&a?.zeniSessionId!=null&&o!=null||E!=null){const e=s.state?.origin??"/";return u.jsx(T,{to:e,state:{...s.state,origin:""}})}if(!D(n,p)||g==null||h==="Error"){const e=s.state?.origin??"/",L=n!=null&&r.getLastUsedMagicLinkToken()===n;return u.jsx(T,{to:e,state:{...s.state,origin:"",magicLinkAlreadyUsed:L,magicLinkExpired:!L&&(r.isMagicLinkTriggered(n??"")||h==="Error"&&a?.zeniSessionId==null)}})}return u.jsx(oe,{"data-testid":"smooth-loader",children:u.jsx(W,{size:"ExtraLarge",start:!0})})}const oe=ne.div`
|
|
2
|
+
position: fixed;
|
|
3
|
+
top: 0;
|
|
4
|
+
left: 0;
|
|
5
|
+
right: 0;
|
|
6
|
+
bottom: 0;
|
|
7
|
+
display: flex;
|
|
8
|
+
align-items: center;
|
|
9
|
+
justify-content: center;
|
|
10
|
+
z-index: 9999;
|
|
11
|
+
background-color: ${t=>t.theme.colors.background};
|
|
12
|
+
`;export{De as default};
|