@zeniai/web-app-ui 5.0.62-dev → 5.0.62-prod
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/assets/AddressRoutes-B8gHQGLk.js +1 -0
- package/dist/assets/{AddressScreen-BeHKG8v1.js → AddressScreen-1oCzT4yV.js} +1 -1
- package/dist/assets/{AiCfoScreen-BJfPMTeD.js → AiCfoScreen-BeXWrOPS.js} +1 -1
- package/dist/assets/{BillPayApprovalRoutes-72raP4Au.js → BillPayApprovalRoutes-DKOPEwPw.js} +1 -1
- package/dist/assets/{BillPayRoutes-CEWbGQhV.js → BillPayRoutes-Do52bIQ6.js} +1 -1
- package/dist/assets/{BusinessVerificationPageScreen-BUCm7Odf.js → BusinessVerificationPageScreen-Bgq_t0NA.js} +1 -1
- package/dist/assets/{ChargeCardRoutes-CGWte3py.js → ChargeCardRoutes-CyddzB3p.js} +1 -1
- package/dist/assets/{CompanyPassportScreen-BmSdom0e.js → CompanyPassportScreen-Cp1GFxbd.js} +1 -1
- package/dist/assets/{ConnectionAuthScreen-DF0fkXNR.js → ConnectionAuthScreen-Dpq8E6k_.js} +1 -1
- package/dist/assets/CustomerOnboardingAuthScreen-auYECsLY.js +1 -0
- package/dist/assets/{CustomerOnboardingRoutes-COxgmIX3.js → CustomerOnboardingRoutes-BwRSYAqT.js} +1 -1
- package/dist/assets/{DashboardRoutes-B9AUZ_Md.js → DashboardRoutes-QTmZjBM5.js} +3 -3
- package/dist/assets/{DefaultTenantHome-Bce_0IOJ.js → DefaultTenantHome-D4WqEebi.js} +1 -1
- package/dist/assets/{DomesticWireDetailScreen-BVFVWlSA.js → DomesticWireDetailScreen-T_mFhVD_.js} +1 -1
- package/dist/assets/{DrawerScreen-BWViotCB.js → DrawerScreen-CorzJQg_.js} +1 -1
- package/dist/assets/{EntityDetailRoutes-CKRWkL2F.js → EntityDetailRoutes-DsDAByqg.js} +1 -1
- package/dist/assets/{ExpenseAutomationRoutes-DDrxLrQX.js → ExpenseAutomationRoutes-CLD03bQE.js} +1 -1
- package/dist/assets/{FeaturePreviewScreen-Bu3Nmz6L.js → FeaturePreviewScreen-Bm1Z6CGq.js} +1 -1
- package/dist/assets/{MagicLinkRoutes-Cdzcjinn.js → MagicLinkRoutes-7TsZiyJt.js} +1 -1
- package/dist/assets/{MagicLinkSignInScreen-XzPOaXDf.js → MagicLinkSignInScreen-DupTpVnZ.js} +1 -1
- package/dist/assets/{MobileAppDrawer-BuQb2buy.js → MobileAppDrawer-dFU_MMpQ.js} +1 -1
- package/dist/assets/NotFoundScreen-CkYvqje3.js +1 -0
- package/dist/assets/{NotificationRoutes-DQOd5pN1.js → NotificationRoutes-C086iWWg.js} +1 -1
- package/dist/assets/{PandLWithForecastRoutes-Ch0vhwLL.js → PandLWithForecastRoutes-DrSoNuWe.js} +1 -1
- package/dist/assets/{PeopleRoutes-DxzAopRH.js → PeopleRoutes-DrpP16z7.js} +1 -1
- package/dist/assets/{PerformanceRoutes-BOLxnqNA.js → PerformanceRoutes-CrbAq_VV.js} +1 -1
- package/dist/assets/{Preview-C1kzMAT1.js → Preview-Ele6CGEN.js} +1 -1
- package/dist/assets/{QBOConnectionScreen-DowWnT4I.js → QBOConnectionScreen-vJPPBcm2.js} +1 -1
- package/dist/assets/{ReferralListScreen-Dj04SxiV.js → ReferralListScreen-By2iHqCj.js} +1 -1
- package/dist/assets/{ReimbursementApprovalRoutes-Dce13zkV.js → ReimbursementApprovalRoutes-BLUI1hwk.js} +1 -1
- package/dist/assets/{ReimbursementApprovalRuleDetailScreen-CErT0hoJ.js → ReimbursementApprovalRuleDetailScreen-CBSWs1rW.js} +1 -1
- package/dist/assets/{ReimbursementRoutes-DbOJcy-l.js → ReimbursementRoutes-CuZ2Cq95.js} +1 -1
- package/dist/assets/{ReportsRoutes-m8OaVZVD.js → ReportsRoutes-BbMT8I_l.js} +1 -1
- package/dist/assets/{RewardsRoutes-Bhpz6tDz.js → RewardsRoutes-BlEzgWWT.js} +1 -1
- package/dist/assets/{ScreenRoutes-D3nR_ZAq.js → ScreenRoutes-D6QBilOh.js} +2 -2
- package/dist/assets/{SettingsRoutes-DXnpxjv_.js → SettingsRoutes-dmnPiCin.js} +1 -1
- package/dist/assets/{SetupPagesScreen-RaBTeZ3X.js → SetupPagesScreen-Bv0bHMSf.js} +1 -1
- package/dist/assets/{SignInScreen-BdxXXdlE.js → SignInScreen-DiTaRKq1.js} +1 -1
- package/dist/assets/{SignOutScreen-Bpj0-554.js → SignOutScreen-CnVFOG3w.js} +1 -1
- package/dist/assets/{TaskListScreen-DucJZ5Tc.js → TaskListScreen-IC7HYgNo.js} +1 -1
- package/dist/assets/{TaskRoutes-BauTuLET.js → TaskRoutes-BQnHNNnm.js} +1 -1
- package/dist/assets/TransactionDetailRoutes-eX0AMtDy.js +1 -0
- package/dist/assets/{TransactionDetailScreen-DB2dMdqL.js → TransactionDetailScreen-D6SMUj-6.js} +1 -1
- package/dist/assets/{TransactionListRoutes-SZ1iphEM.js → TransactionListRoutes-D9uoe8PQ.js} +1 -1
- package/dist/assets/{TreasuryRoutes-CGEviXlY.js → TreasuryRoutes-B48DCkf_.js} +1 -1
- package/dist/assets/{VendorsRoutes-CIeivuDV.js → VendorsRoutes-3L1VncvD.js} +1 -1
- package/dist/assets/{WiseConfirmationScreen-C2YdpQUX.js → WiseConfirmationScreen-DbIoe_Ze.js} +1 -1
- package/dist/assets/{ZeniAccountRoutes-WZ6oPa1B.js → ZeniAccountRoutes-DP9dH7TH.js} +1 -1
- package/dist/assets/{ZeniAccountStatementScreen-BcTdJcif.js → ZeniAccountStatementScreen-D0LuGOsw.js} +1 -1
- package/dist/assets/{accountMappingHelper-Bqj2mJfi.js → accountMappingHelper-TVtdCboQ.js} +1 -1
- package/dist/assets/{analytics-B_uP5uGX.js → analytics-CahmTVDu.js} +1 -1
- package/dist/assets/{analyticsHelper-CsFRydiU.js → analyticsHelper-BjzoDw_T.js} +1 -1
- package/dist/assets/{core-Cgen4kAj.js → core-BAyxh70Z.js} +1 -1
- package/dist/assets/{decodeURIComponentSafe-DztnZ-A4.js → decodeURIComponentSafe-Do2kSkVE.js} +1 -1
- package/dist/assets/{dnd-DhFfs1wM.js → dnd-BSIjjfrd.js} +1 -1
- package/dist/assets/{empty-CfLsUtpF.js → empty-B-ys610U.js} +1 -1
- package/dist/assets/{empty-Dt-07Rye.js → empty-BEss6U26.js} +1 -1
- package/dist/assets/{emptyVideoElement-v9g3UWiq.js → emptyVideoElement-Bk8MqTr4.js} +1 -1
- package/dist/assets/{epic-lM2FfDOS.js → epic-CyXFDvQU.js} +1 -1
- package/dist/assets/{getLocaleForTenant-Di1C7dV7.js → getLocaleForTenant-CTxSISA1.js} +1 -1
- package/dist/assets/{index-Dwqwe5m-.js → index-B3vca5dn.js} +1 -1
- package/dist/assets/{index-BkCX5jRI.js → index-BfXUsd4V.js} +1 -1
- package/dist/assets/{index-Dprn4SY3.js → index-C9lUuMK6.js} +1 -1
- package/dist/assets/{index-CiK_CtQ4.js → index-CoAgW-qI.js} +1 -1
- package/dist/assets/{index-C_giOD7z.js → index-D27MUyWe.js} +1 -1
- package/dist/assets/{index-trlF__w8.js → index-EjFBjGdj.js} +7 -7
- package/dist/assets/{index-nofE1fwv.js → index-Qdzugp0_.js} +2 -2
- package/dist/assets/{lexical-DJV7tysr.js → lexical-0b05ScDc.js} +1 -1
- package/dist/assets/{liveblocks-CF908iAG.js → liveblocks-B6wl2zlB.js} +1 -1
- package/dist/assets/{lottie-Ega9gP0x.js → lottie-BANYn_n3.js} +1 -1
- package/dist/assets/{mui-C7dUqSqV.js → mui-_J7ULT9g.js} +1 -1
- package/dist/assets/{pathToGoBack-C7m35zDG.js → pathToGoBack-mIT56Yg7.js} +1 -1
- package/dist/assets/{pdf-CSmOdS_B.js → pdf-b6pQct0d.js} +3 -3
- package/dist/assets/{pdf-lib-D5gPNITG.js → pdf-lib-DX5EW-ja.js} +1 -1
- package/dist/assets/{plaid-CChs9PMx.js → plaid-BGvkfr4M.js} +1 -1
- package/dist/assets/{pusher-C5oHaaZM.js → pusher-CwykzOoQ.js} +1 -1
- package/dist/assets/{react-ClL_vZpV.js → react--qhFC5bv.js} +1 -1
- package/dist/assets/{react-CVXgK0Ih.js → react-84_RJA0E.js} +1 -1
- package/dist/assets/{react-DrZcp68n.js → react-BhQH2jax.js} +1 -1
- package/dist/assets/{react-CrvQ92fR.js → react-CSdTGKBv.js} +1 -1
- package/dist/assets/{react-CsMGsa1f.js → react-D5Tnpa7s.js} +1 -1
- package/dist/assets/{react-CU9NYGdL.js → react-DuKpQGzz.js} +1 -1
- package/dist/assets/{recharts-Dyhe2tpB.js → recharts-BAmCdxCr.js} +1 -1
- package/dist/assets/{routePaths-CqnfURaJ.js → routePaths-DYIKJgSA.js} +1 -1
- package/dist/assets/{sentry-cfxuOFew.js → sentry-Br5FXUqA.js} +1 -1
- package/dist/assets/{url-B1qVva4A.js → url-6eZuId4d.js} +1 -1
- package/dist/assets/{url-DOBNPG6D.js → url-Bak3o9qf.js} +1 -1
- package/dist/assets/{useAskAiCfoHostNavButtonProps-C2mAQ-5p.js → useAskAiCfoHostNavButtonProps-DCq-odIp.js} +1 -1
- package/dist/assets/{useDeviceId-43L8M3To.js → useDeviceId-RDjiosQe.js} +1 -1
- package/dist/assets/{useFetchSuggestedQuestionsWhenReady-B5mF_k6O.js → useFetchSuggestedQuestionsWhenReady-CxmYBvZJ.js} +1 -1
- package/dist/assets/{useInitialThreadRequest-CME_1dn5.js → useInitialThreadRequest-Deo98O2e.js} +1 -1
- package/dist/assets/{utils-DumEze_M.js → utils-D7Q_r6EF.js} +1 -1
- package/dist/assets/{withTransactionSidePanel-Dq1wepy8.js → withTransactionSidePanel-C4ykQCaK.js} +1 -1
- package/dist/assets/{zeni-epic-state-DrGehtra.js → zeni-epic-state-BviKG7zC.js} +3 -3
- package/dist/index.html +1 -1
- package/package.json +1 -1
- package/dist/assets/AddressRoutes-CWbtPs0T.js +0 -1
- package/dist/assets/CustomerOnboardingAuthScreen--LKCq1mD.js +0 -1
- package/dist/assets/NotFoundScreen-DXPtR234.js +0 -1
- package/dist/assets/TransactionDetailRoutes-DkbxIzsT.js +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{j as e}from"./liveblocks-B6wl2zlB.js";import{A as d}from"./AddressScreen-1oCzT4yV.js";import i from"./NotFoundScreen-CkYvqje3.js";import"./sentry-Br5FXUqA.js";import{n as s,o as r}from"./core-BAyxh70Z.js";import"./zeni-epic-state-BviKG7zC.js";import"./recharts-BAmCdxCr.js";import"./index-EjFBjGdj.js";import"./mui-_J7ULT9g.js";import"./analytics-CahmTVDu.js";import"./plaid-BGvkfr4M.js";import"./dnd-BSIjjfrd.js";import"./stripe-DMRn4zHo.js";import"./lottie-BANYn_n3.js";import"./lexical-0b05ScDc.js";import"./pdf-b6pQct0d.js";import"./utils-D7Q_r6EF.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]="4bd15e18-5b5f-4be1-8d33-8bd696c76da2",t._sentryDebugIdIdentifier="sentry-dbid-4bd15e18-5b5f-4be1-8d33-8bd696c76da2")}catch{}})();function _(){return e.jsxs(s,{children:[e.jsx(r,{path:"/edit/:addressType/:addressId",element:e.jsx(d,{})}),e.jsx(r,{path:"/new/:addressType",element:e.jsx(d,{})}),e.jsx(r,{path:"*",element:e.jsx(i,{})})]})}export{_ as default};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{j as d}from"./liveblocks-
|
|
1
|
+
import{j as d}from"./liveblocks-B6wl2zlB.js";import{a as h}from"./sentry-Br5FXUqA.js";import{j as T,h as _,u as j,l as E,g as B,k as M}from"./core-BAyxh70Z.js";import{q as $,h as D,z as L,j as K,B as N,A as R,d as C,f as m,w as z,k as b,n as F}from"./index-EjFBjGdj.js";import{I$ as k,gM as U,eN as q,J0 as G,c0 as J,J1 as O,k6 as V}from"./zeni-epic-state-BviKG7zC.js";import{n as H}from"./mui-_J7ULT9g.js";import Q from"./NotFoundScreen-CkYvqje3.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]="15bcc565-359a-4e12-9c99-2467f8f64885",e._sentryDebugIdIdentifier="sentry-dbid-15bcc565-359a-4e12-9c99-2467f8f64885")}catch{}})();const W=H.div`
|
|
2
2
|
display: flex;
|
|
3
3
|
height: 100vh;
|
|
4
4
|
width: 100%;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{j as h}from"./liveblocks-
|
|
1
|
+
import{j as h}from"./liveblocks-B6wl2zlB.js";import{a as r}from"./sentry-Br5FXUqA.js";import{h as oe,j as ne,u as ie,g as j,l as re,k as le}from"./core-BAyxh70Z.js";import{K as ce,cG as ue,z as de,q as me,cH as pe,cI as fe,cJ as he,cK as $,A as Se,d as v,O as q,cL as ge,cM as Ce,f as be,a1 as ke,cN as we,Q as Ie,s as Pe,n as G,aY as Ee,cO as Te}from"./index-EjFBjGdj.js";import{fD as ye,f2 as H,eN as _e,hq as xe,Px as ve,eM as Ue,hA as Ae,hw as Oe,ft as Qe,fn as De,fg as Fe,fk as V,fo as Me,fp as Le,fq as Be,fr as Re,fs as Ne}from"./zeni-epic-state-BviKG7zC.js";import{D as je,n as U,P as qe,S as Ge}from"./mui-_J7ULT9g.js";import{p as Ve}from"./pathToGoBack-mIT56Yg7.js";import"./recharts-BAmCdxCr.js";import"./analytics-CahmTVDu.js";import"./plaid-BGvkfr4M.js";import"./dnd-BSIjjfrd.js";import"./stripe-DMRn4zHo.js";import"./lottie-BANYn_n3.js";import"./lexical-0b05ScDc.js";import"./pdf-b6pQct0d.js";import"./utils-D7Q_r6EF.js";(function(){try{var s=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},i=new s.Error().stack;i&&(s._sentryDebugIds=s._sentryDebugIds||{},s._sentryDebugIds[i]="7bd1083e-e5c8-49d1-b300-c4d6c6d5bb07",s._sentryDebugIdIdentifier="sentry-dbid-7bd1083e-e5c8-49d1-b300-c4d6c6d5bb07")}catch{}})();const W="chat-response-generated",$e=le(function(s,i){const a=H(s),m=i.isSubmitting;return{showSampleQuestions:i.sessionFromUrl==="explore"&&a.uiState.currentChatSessionId==null,aiCfoView:a,isSubmitting:m,isNewChatSession:i.sessionFromUrl==="new_chat"||i.sessionFromUrl==="explore",isFullView:!0,tableDownloadEndPoint:`${Ie}/tableDownload`,emailLinkQuestion:i.emailLinkQuestion,autoSubmitEmailLinkQuestion:i.autoSubmitEmailLinkQuestion,onEmailLinkQuestionProcessed:i.onEmailLinkQuestionProcessed,isFileUploadEnabled:i.isFileUploadEnabled,isUploadPromoVisible:i.isUploadPromoVisible,onUploadPromoClose:i.onUploadPromoClose}},function(s,i){const{location:a,currentTenant:m,userId:d,navigate:p,currentChatSessionId:f,allSessionsWithOrderedQuestionAnswers:S,setIsAiCfoOpen:l}=i;return{onEventReceived:(e,o)=>{if(e===W&&typeof o.text=="string"&&typeof o.metadata=="object"){const n=o,c=Le(n.type),t=n.metadata.chat_session_id??null,{currentChatSession:I,currentQuestionAnswer:g,currentQuestionAnswerSummary:P}=$(S,t);c!=="answer"?v.trackAICFOChatResponseGenerated(c,g?.question.questionText??"",n.text,t,Te(P,I),n.metadata.message_id??null):v.trackAICFOChatAnswerGenerated(n.text,g?.question.questionText??"",(n.follow_up_questions?.length??0)>0,!!n.assumptions,!!n.insights,n.visualization!=null,Be(n.visualization?.type??"")??null,t,n.summarized_title,n.metadata.message_id??null),s(Re({chatSessionId:n.metadata.chat_session_id,responseType:c,fetchState:{fetchState:"Completed",error:void 0}})),s(Ne({chatSessionId:n.metadata.chat_session_id,answerPayload:n,userId:d}))}},onSubmit:(e,o,n,c)=>{e&&Ee(s,e,o,f,S,d,c,n)},updateCurrentInput:e=>{s(V(e))},onStopSubmit:()=>{},onUpdateScrollYOffset:e=>{s(Me(e))},onSelectSampleQuestion:()=>{},onBackClick:()=>{p(-1)},onCloseClick:()=>{const e=G(a.state?.pathnameStackToGoBack),o=e.poppedPathname??Ve(1);p(o,{state:{...a.state,pathnameStackToGoBack:e.newStack}}),s(V(""))},togglePageView:()=>{const e=G(a.state?.pathnameStackToGoBack),o=e.poppedPathname??`/${m.tenantEmailDomain}/dashboard`;p(o,{state:{...a.state,pathnameStackToGoBack:e.newStack,message:"open_ai_cfo_drawer"}}),l(!0)},onCopy:()=>{},onThumbsUp:()=>{},onThumbsDown:()=>{},onTogglePageView:()=>{p(-1)},onNewChatClick:()=>{f!=null&&s(Fe());const e=Pe(a.state?.pathnameStackToGoBack,a.pathname);p(`/${m.tenantEmailDomain}/ai-cfo/new_chat`,{state:{pathnameStackToGoBack:e.slice(0,-1),referrer:"Sidebar"}})},onToggleCotCollapsed:(e,o)=>{s(De({questionAnswerId:e,isCollapsed:o}))},onMenuClick:i.onMenuClick}})(ke(we)),dt=({isFileUploadEnabled:s})=>{const{setIsAiCfoOpen:i}=ce(),a=oe(),m=ne(),d=ie(),[p,f]=r.useState(!1);r.useEffect(()=>{a(ye())},[a]);const{customPageTitle:S}=ue(),l=j(u=>H(u)),e=de.getSignedInUser(),{session_id:o}=re(),n=me(),c=j(u=>_e(u)),t=l.uiState.currentChatSessionId,I=c.tenantEmailDomain,{handleUploadPromoClose:g,isUploadPromoVisible:P}=pe({isFileUploadEnabled:s,tenantEmailDomain:I}),A=fe({currentTenant:c,currentChatSessionId:t,aiCfoView:l}),C=d.state,b=C?.aiCfoInitialQuestion,O=!!C?.aiCfoShouldSubmit,[z,E]=r.useState(null),[K,T]=r.useState(!1),Q=r.useRef(!1);r.useEffect(()=>{Q.current||b==null||b===""||(E(b),T(O),Q.current=!0)},[b,O]);const Y=r.useCallback(()=>{E(null),T(!1)},[]),D=r.useMemo(()=>new URLSearchParams(d.search),[d.search]),F=D.get("ref")??C?.aiCfoRef,y=D.get("emailRefId")??C?.aiCfoEmailRefId,M=r.useRef(!1);r.useEffect(()=>{M.current||F!=="month-end-email"||y==null||t!=null||e==null||(a(xe("controller",e.userId,y,"MONTH_END_EMAIL")),M.current=!0)},[F,y,t,a,e]);const k=l.uiState.lastContextMessage;r.useEffect(()=>{k!=null&&k!==""&&t!=null&&(E(k),T(!0),a(ve()))},[k,t,a]);const J=c.masterTOSInfo,w=J?.isMasterTOSAccepted??!1,{visitedSessions:L}=he(t),_=l.fetchState,x=l.uiState.chatSessionsNextPageToken.hasMore||!l.uiState.chatSessionsFirstPageFetched,B=t!=null?l.fetchChatSessionHistoryByChatSessionId?.[t]?.fetchState??"Not-Started":"Not-Started",R=t==null||(l.uiState.chatHistoryNextPageToken[t]?.hasMore??!0),N=l.allSessionsWithOrderedQuestionAnswers,{currentSessionQuestionAnswers:Z}=$(N,t),X=Z.length===0;r.useEffect(()=>{w||m("../dashboard",{state:{...d.state,message:"open_ai_cfo_drawer"}})},[w]),r.useEffect(()=>{t!=null&&o!==t&&m(`../ai-cfo/${t}`,{state:{...d.state}})},[t,o]),r.useEffect(()=>{o!=null&&t==null&&o!=="new_chat"&&o!=="explore"&&a(Ue({sessionId:o,agentId:"controller"}))},[]);const ee=r.useMemo(()=>({events:L.map(u=>`private-chat-${u}.${W}`),eventCallback:(u,se,ae)=>ae.onEventReceived(u,se)}),[L]);if(r.useEffect(()=>{_!=="In-Progress"&&x&&a(Ae())},[_,x,a]),r.useEffect(()=>{t!=null&&B!=="In-Progress"&&R&&e!=null&&_==="Completed"&&!x&&a(Oe(t,e.userId))},[B,R,t,e,a]),e==null||o==null)throw Error("Can't access AI Controller page without signing in...");const te=t!=null&&l.responseStateByChatSessionId?.[t]?.answer?.fetchState==="In-Progress";return h.jsxs(We,{children:[h.jsx(Se,{analytics:v,onLoad:u=>u.trackPageLoaded(be.Event.aiCFOPage)}),q(n)&&A.drawerElement,h.jsx($e,{...ee,currentChatSessionId:t,allSessionsWithOrderedQuestionAnswers:N,openOnboardingPage:()=>f(!0),userId:e.userId,setIsAiCfoOpen:i,navigate:m,sessionFromUrl:o,location:d,isSubmitting:te,isEmptyChatWithSession:X,customPageTitle:S,currentTenant:c,emailLinkQuestion:z??void 0,autoSubmitEmailLinkQuestion:K,onEmailLinkQuestionProcessed:Y,onMenuClick:q(n)?A.open:void 0,isFileUploadEnabled:s,isUploadPromoVisible:P,onUploadPromoClose:g}),h.jsx(je,{anchor:"right",open:p,transitionDuration:250,PaperProps:{component:ze,style:{width:`${ge}vw`}},slotProps:{backdrop:{style:{backgroundColor:"transparent",cursor:"pointer"}}},onClose:()=>f(!1),children:h.jsx(He,{onClick:u=>u.stopPropagation(),children:h.jsx(Ce,{isTOSAccepted:w,acceptMasterTOSState:l.masterTOSAcceptanceState,customPageTitle:S,onCloseClick:()=>f(!1),onCompleteClick:()=>{w||c.userRoleId==null||a(Qe(c.userRoleId)),f(!1)}})})})]})},He=U(Ge)`
|
|
2
2
|
display: flex;
|
|
3
3
|
min-height: 100%;
|
|
4
4
|
flex-direction: column;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{j as l}from"./liveblocks-
|
|
1
|
+
import{j as l}from"./liveblocks-B6wl2zlB.js";import{a as y}from"./sentry-Br5FXUqA.js";import{j as B,u as U,h as j,g as f,N as $,k as T,l as N,n as O,o as b}from"./core-BAyxh70Z.js";import{eN as L,Mi as A,L_ as h,x8 as w,x2 as F,x6 as x,wX as z,M0 as M,w_ as W,xa as q,x9 as C}from"./zeni-epic-state-BviKG7zC.js";import{h as P,z as k,B as _,a1 as X,by as G,ab as V,bz as H}from"./index-EjFBjGdj.js";import"./mui-_J7ULT9g.js";import{i as J}from"./ReimbursementApprovalRuleDetailScreen-CBSWs1rW.js";import K from"./NotFoundScreen-CkYvqje3.js";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},o=new e.Error().stack;o&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[o]="1652140b-cd3b-4b71-94a3-d1be6dd93611",e._sentryDebugIdIdentifier="sentry-dbid-1652140b-cd3b-4b71-94a3-d1be6dd93611")}catch{}})();const I="bill-approval-rule-update",Q=T(function(e){return{approvalView:A(e),billPaySetupApproverViewUpdateData:h(e).billPaySetupApproverViewUpdateData}},function(e,o){const{navigate:t,location:p}=o;return{onApprovalRulesEventReceived:a=>{a.endsWith(I)&&e(M(!1))},onBackClick:()=>{V(p)?t("../../"):t("../../../bills/setup")},onDeleteRuleClick:a=>{e(z(a))},onEditRuleClick:a=>{a!=null?(e(x(a)),t(`./${a}/edit`)):(e(x()),t("./new"))}}})(X(G)),Y=()=>{const e=B(),o=U(),t=j(),[p,a]=y.useState(!1),[u,s]=y.useState(!1),d=P(),n=f(i=>i.billPaySetupApproverViewState.fetchState),c=f(i=>L(i)),r=f(i=>A(i)),g=f(i=>h(i).billPaySetupApproverViewUpdateData);if(y.useEffect(()=>{g?.updateStatus.fetchState==="Completed"&&t(w())},[g]),y.useEffect(()=>{p||n!=="Not-Started"||(a(!0),t(F(!0)))},[p,n,t]),k.getSignedInUser()==null)throw Error("Can't access billpay approval without signing in...");y.useEffect(()=>{r.allApprovalRules.length===0&&r.fetchState==="Completed"&&(u||(s(!0),t(x())),e("./new"))},[u,r,t]);const v={events:c.companyId!=null?[`private-${c.companyId}.${I}`]:[],eventCallback:(i,R,m)=>{i.endsWith(I)&&m.onApprovalRulesEventReceived(i)}};return c.companyBillPayInfo?.info?.isBillPayTOSAccepted===!1?l.jsx($,{to:"../../promo"}):c.companyBillPayInfo?.info?.isBillPayTOSAccepted!==!0||r.fetchState!=="Completed"&&r.fetchState!=="Error"?l.jsx(_,{fetchState:"In-Progress",style:{backgroundColor:d.colors.grey5}}):l.jsx(Q,{currentTenant:c,location:o,navigate:e,...v})},Z=T(function(e,o){const t=h(e),p=t.billPaySetupApproverViewUpdateData?.type??"approval_create",a=p==="approval_create"&&t.allApprovalRules.length!==0;let u=t.allApprovalRules.length===0;return o.approvalRuleId&&(u=t.allApprovalRules.findIndex(s=>s.approvalRuleId===o.approvalRuleId)===0),{localData:t,hideUpperBoundField:a,isLowerBoundDisabled:u,approvalUpdateActionType:p}},function(e,o){const{navigate:t,approvalUpdateDataView:p,approverViewData:a,approvalRuleId:u}=o,s=p.billPaySetupApproverViewUpdateData?.type,d=V(o.location);return{onApprovalRuleDataUpdated:n=>{const c=r=>{const g=[];return r.forEach(v=>{const i=v.actors.selectedUsers.map(S=>({type:"user",userId:S.userId,isImplicitActor:!1})),R=v.actors.selectedNonUsers.map(S=>{const E=!!J(S.value);return{type:E?"attribute":"role",subType:S.value,userId:void 0,idType:void 0,isImplicitActor:!E}}),m=i.concat(R);g.push({action:v.stepType.selectedOption,actors:m,operator:m.length>1?v.stepType.selectedOption==="require_approval"?"or":"and":"is"})}),g};if(s==="approval_create"){const r={criteria:{rangeType:"range",rangeEntity:"currency",range:{min:{amount:n.lowerBound,currencyCode:"USD",currencySymbol:"$"},max:{amount:n.upperBound,currencyCode:"USD",currencySymbol:"$"}}},steps:c(n.steps),isApplicableOnPendingApprovalEntity:n.applyToExistingBills.includes("applyToExistingBills")};e(C(r))}else{const r={approvalRuleId:u,criteria:{rangeType:"range",rangeEntity:"currency",range:{min:{amount:n.lowerBound,currencyCode:"USD",currencySymbol:"$"},max:{amount:n.upperBound,currencyCode:"USD",currencySymbol:"$"}}},steps:c(n.steps),isApplicableOnPendingApprovalEntity:n.applyToExistingBills.includes("applyToExistingBills")};e(C(r))}},onResetClick:()=>{e(w()),s==="approval_update"||d?t("../"):a.allApprovalRules.length===0&&a.fetchState==="Completed"?t("../../setup"):t("../")},onBackClick:()=>{e(w()),s==="approval_update"||d?t("../"):a.allApprovalRules.length===0&&a.fetchState==="Completed"?t("../../setup"):t("../")},onSaveRuleClick:()=>{e(q())},onSaveRuleSuccess:()=>{t("../")}}})(H);function D(){const e=B(),o=j(),t=U(),{approvalRuleId:p}=N(),a=k.getSignedInUser(),u=P(),s=f(r=>h(r)),d=f(r=>A(r)),[n,c]=y.useState(!1);if(y.useEffect(()=>{n||(c(!0),o(W(!0)))}),y.useEffect(()=>{d.fetchState==="Not-Started"&&e(p!=null?"../../":"../")},[d,p]),a==null)throw Error("Can't access address page without signing in...");return s.approverListFetchStatus.fetchState=="Not-Started"||s.approverListFetchStatus.fetchState==="In-Progress"?l.jsx(_,{fetchState:s.approverListFetchStatus.fetchState,style:{backgroundColor:u.colors.grey5}}):l.jsx(Z,{navigate:e,approvalUpdateDataView:s,approvalRuleId:p,approverViewData:d,location:t})}function se(){return l.jsxs(O,{children:[l.jsx(b,{path:"/",element:l.jsx(Y,{})}),l.jsx(b,{path:"/new",element:l.jsx(D,{})}),l.jsx(b,{path:"/:approvalRuleId/edit",element:l.jsx(D,{})}),l.jsx(b,{path:"*",element:l.jsx(K,{})})]})}export{se as B};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{j as a}from"./liveblocks-CF908iAG.js";import{j as K,h as se,u as Q,l as ae,g as v,N as te,k as X,i as na,n as ia,o as S}from"./core-Cgen4kAj.js";import{eN as Z,LA as Ue,bv as It,GD as oa,bo as wt,bD as pe,LB as xt,ws as Bt,xC as Ve,w$ as la,bn as De,LC as sa,LD as ra,c0 as ca,LE as da,jq as Ct,LF as At,LG as Et,yb as _e,wH as Ce,LH as ua,wg as tt,LI as pa,Bn as ma,wk as ba,wq as Dt,LJ as ke,LK as Ge,xD as Oe,LL as ha,LM as ga,xG as Ne,LN as ya,xT as Sa,LO as jt,xn as at,xs as fa,LP as ka,LQ as ue,LR as Tt,LS as Pt,LT as Ft,fH as va,wM as $e,cv as Rt,LU as Ia,gC as wa,LV as xa,LW as Ba,eT as Lt,eR as Vt,LX as ze,LY as Ca,LZ as Aa,Jj as Ze,L_ as Ea,Jk as oe,Jl as He,L$ as Da,M0 as ja,M1 as Ta,xu as nt,xr as Pa,M2 as Fa,M3 as Ra,M4 as La,xd as Va,M5 as $a,M6 as Ma,M7 as Ua,cj as $t,cL as Mt,jB as _a,bJ as Ga,bq as Ut,bK as _t,vy as Oa,M8 as Na,Ba as za,Bg as Za,s5 as Ha,xE as Wa,yi as qa,jO as fe,M9 as Ja,Ma as Gt,kg as Ka,jI as Ot,k1 as Nt,k0 as it,bC as be,bI as Qa,Mb as Xa,Mc as ve,ik as Ya,Md as ot,Me as en,ip as tn,iK as an,yw as nn,Mf as on,k9 as ln,ym as sn,Mg as lt,yq as rn,yv as cn,ys as dn,yk as un,Mh as zt,wB as pn,Mi as mn,Mj as bn,fz as hn,fy as gn,fx as yn,jR as Sn,k7 as st,ki as fn,pE as kn,j_ as vn,yo as In,iv as wn,kn as xn,Mk as Bn,im as Cn,pv as An,Ml as En,xj as Dn,bE as jn,bs as Tn,Ik as Pn,cN as Fn,cM as Rn,cu as Ln,cA as Vn}from"./zeni-epic-state-DrGehtra.js";import{h as me,z as L,j as Ie,a as le,p as y,aJ as Ae,B as re,o as A,A as je,d as D,b5 as $n,n as z,Q as We,s as E,q as we,b6 as rt,b7 as ct,b8 as Mn,ag as Un,G as _n,aD as Gn,F as Zt,D as qe,H as Je,b9 as On,ap as Ht,ba as Nn,M as zn,f as Wt,a1 as Zn,bb as Hn,bc as Wn,bd as qn,be as Jn,bf as Kn,bg as Qn,bh as Xn,bi as Yn,bj as ei,v as ti,bk as ai,b1 as ni,bl as ii,bm as oi,a5 as li}from"./index-trlF__w8.js";import{n as M,S as si}from"./mui-C7dUqSqV.js";import{A as dt}from"./AddressScreen-BeHKG8v1.js";import{g as ie,a as Te,i as qt,V as Ke,b as Qe,c as ri,v as ci,d as di,A as he,D as ge}from"./DomesticWireDetailScreen-BVFVWlSA.js";import{a as f}from"./sentry-cfxuOFew.js";import{u as Xe}from"./useAskAiCfoHostNavButtonProps-C2mAQ-5p.js";import{c as Ye}from"./useFetchSuggestedQuestionsWhenReady-B5mF_k6O.js";import{u as Jt}from"./useInitialThreadRequest-CME_1dn5.js";import Ee from"./NotFoundScreen-DXPtR234.js";import{D as ui}from"./DrawerScreen-BWViotCB.js";import{M as Kt}from"./MobileAppDrawer-BuQb2buy.js";import{F as Qt}from"./FeaturePreviewScreen-Bu3Nmz6L.js";import{S as Pe}from"./SetupPagesScreen-RaBTeZ3X.js";import{B as pi}from"./BillPayApprovalRoutes-72raP4Au.js";import{FallBackRoute as mi}from"./ScreenRoutes-D3nR_ZAq.js";import"./recharts-Dyhe2tpB.js";import"./analytics-B_uP5uGX.js";import"./plaid-CChs9PMx.js";import"./dnd-DhFfs1wM.js";import"./stripe-DMRn4zHo.js";import"./lottie-Ega9gP0x.js";import"./lexical-DJV7tysr.js";import"./pdf-CSmOdS_B.js";import"./utils-DumEze_M.js";import"./analyticsHelper-CsFRydiU.js";import"./routePaths-CqnfURaJ.js";import"./BusinessVerificationPageScreen-BUCm7Odf.js";import"./ReimbursementApprovalRuleDetailScreen-CErT0hoJ.js";import"./getLocaleForTenant-Di1C7dV7.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]="6fea99ea-feed-497b-a763-fe5fcae4594c",e._sentryDebugIdIdentifier="sentry-dbid-6fea99ea-feed-497b-a763-fe5fcae4594c")}catch{}})();const bi=X(function(e,t){const l=Ue(e,t.billId),i=L.getSignedInUser(),c=e.tenantState.currentTenantId,r={userId:i?.userId??"",sessionId:i?.zeniSessionId??"",tenantId:c??""},u=z(t.location.state?.pathnameStackToGoBack);let o=!0;u.poppedPathname?.includes("bills")===!0&&(o=!1);let s=`${l.createdBy?.firstName??"Zeni"} ${l.createdBy?.lastName??""}`;const n=De(i);n||!l.createdBy?.email?.includes("zeni.ai")||(s="Zeni");let d=!1,p=!1;if(l?.billActivities.length>0){const{isApprovalorRejectBtnVisible:g,isMarkAsPaidBtnVisible:b}=sa(l.billActivities,ra(t.currentTenant),i);d=g,p=b}const m=ca(t.currentTenant?.userRole??[]),h=l.transactionDetails!=null&&da(l.transactionDetails,m,i);return{billDetails:l,isAccountingClassesEnabled:Ct(e),createdBy:s,authParams:r,transactionAttachmentEndpoint:`${We}/transaction_attachment`,signedInUser:i,showBackButton:o,isAdmin:m,isRealTimeApprovalEnabled:t.isRealTimeApprovalEnabled,showApproveRejectBtns:d,showMarkAsPaidButtonToApprover:p,hasZeniAssistAccess:t.hasZeniAssistAccess,analytics:D,showMarkAsPaidButtonToCreator:h,isZeniUser:n}},function(e,t){const{billId:l,currentTenant:i,location:c,navigate:r}=t,{tenantEmailDomain:u}=i;return{redirectToBillsScreen:()=>{const o=ie(u),s=E(c.state?.pathnameStackToGoBack,c.pathname);r(o,{state:{pathnameStackToGoBack:s}})},redirectToEditableBillScreen:()=>{const o=E(c.state?.pathnameStackToGoBack,c.pathname);r("./edit",{state:{pathnameStackToGoBack:o}})},discardBillDetailsFromLocalStore:()=>{e(ke({}))},deleteBill:o=>{D.trackBillPayDeleteBill(l,o),e(Dt(l))},cancelAndDeleteBill:(o,s)=>{s===!0?D.trackBillPayCancelAndDeleteBill(l,o):D.trackBillPayCancelBill(l),e(ba(l,s))},onSaveRealTimeApprovals:o=>{e(ma(l,"bill_pay",o))},updateEditRealTimeApproverClicked:o=>{e(pa({isEdit:o,entityId:l,entityType:"bill_pay"}))},approveOrRejectBill:o=>{o.type==="approved"?e(tt(l,o.type,"")):e(tt(l,o.type,o.description??""))},retryOrRefundBill:o=>{o.type==="retry"?e(Ce(l,"retry")):e(Ce(l,"refund"))},onAddNewRule:()=>{r("../../bills/approval-rules")},onAttachmentClick:(o,s)=>{const n=Te(u,o,s),d=E(c.state?.pathnameStackToGoBack,c.pathname);r(n,{state:{pathnameStackToGoBack:d}})},onBackClick:()=>{const o=z(t.location.state?.pathnameStackToGoBack),s=o.poppedPathname??ie(u);r(s,{state:{pathnameStackToGoBack:o.newStack}})},onRetryPaymentClick:()=>{const o=E(c.state?.pathnameStackToGoBack,c.pathname);r("./edit",{state:{pathnameStackToGoBack:o}}),e(ua({billId:t.billId}))},onRefundPaymentClick:()=>{e(Ce(t.billId,"refund"))},saveBillDetails:(o,s,n)=>{o&&e(Et({data:n,billId:l})),e(_e(o?"paid":"pending_approval",o,s,l))},discardOutsideZeniPaymentData:()=>{e(At({billId:l}))}}})($n);function hi(){const e=K(),t=se(),l=Q(),{billId:i}=ae(),c=me(),r=L.getSignedInUser(),u=Ie(),o=v(O=>Z(O)),s=v(O=>Ue(O,i??"")),n=s.transactionDetails?.billPayInfo.stage.code==="draft"&&s.transactionDetails.isDeleted===!1,d=Jt(o?.companyId,{clearParams:s.fetchState==="Completed"&&!n}),{isAiCfoAccessEnabled:p,onAskAiCfoClick:m}=Xe({mobileExploreReferrer:"Bill Details"});Ye({isDataReady:s.fetchState==="Completed"});const h=o?.userRole!=null&&It(o?.userRole),g=o?.company==null||o.company.featuresActivationInfo?.isBillPayFeatureEnabled&&!h,[b,k]=f.useState(!1),[j,x]=f.useState(!1),[B,_]=f.useState(!1),{useFeatureGate:T,useDynamicConfig:U}=le(),{isFeatureEnabled:V}=T(y.isShowDeletedBillsFeatureEnabled),{isFeatureEnabled:I}=T(y.isBillPayCommentingEnabled),{isFeatureEnabled:H}=T(y.isBillPayDetectInsufficientFundsEnabled),{configValue:G}=U(Ae.zeniAssistConfig),C=oa(o),q=wt(o.userRole),W=g&&pe(u?.loggedInUserRoleMap),$=G.user_ids!=null&&r?.userId!=null&&G.user_ids.includes(r?.userId),{isFeatureEnabled:J}=T(y.isInternationalPaymentShaVsOurFeatureEnabled),{isFeatureEnabled:Y}=T(y.billPaySetupShowInternationalPaymentByWise);if(f.useEffect(()=>{V&&s.transactionDetails?.isDeleted===!0||o.isZeni===!0&&r?.userEmailDomain==="zeni.ai"&&C===!1?_(!1):_(s.billActivities[0]?.isRealTimeApprovalEnabled&&(q||W||s.allApprovers.find(O=>O.user.userId===r?.userId)!=null||s.transactionDetails?.lastUpdatedByUserId===r?.userId))},[s.billActivities[0]?.isRealTimeApprovalEnabled,s.allApprovers,s.transactionDetails?.lastUpdatedByUserId,q,W,o.isZeni,C,r]),f.useEffect(()=>{i!=null&&t(xt(i))},[i]),f.useEffect(()=>{b||s.fetchState=="Completed"||s.fetchState=="In-Progress"||(k(!0),t(Bt(i??"",V,$,!1)))},[b,s,i,t]),f.useEffect(()=>{j||s.fetchState!="Completed"||s.transactionDetails?.billPayInfo.stage.code=="paid"||(x(!0),t(Ve(!1,V,$,Y,i)),s.billActivities[0]?.isRealTimeApprovalEnabled===!0&&t(la()))},[j,s,i,t]),r==null)throw Error("Can't access address page without signing in...");return s.transactionDetails?.billPayInfo.stage.code==="draft"&&s.transactionDetails.isDeleted===!1?a.jsx(te,{to:`./edit${l.search}`}):s.deleteStatus.fetchState==="In-Progress"||s.cancelAndDeleteStatus.fetchState==="In-Progress"||s.cancelStatus.fetchState==="In-Progress"?a.jsx(re,{fetchState:s.deleteStatus.fetchState,style:{boxShadow:`0px 2px ${A.sp1} ${c.colors.dropShadowNormal}`}}):a.jsxs(a.Fragment,{children:[a.jsx(je,{analytics:D,onLoad:O=>(ee=>{i!=null&&ee.trackBillPayBillDetails(i,s.isRecurring)})(O)}),a.jsx(bi,{initialOpenThreadRequest:d??void 0,isShowDeletedBillsEnabled:V,location:l,navigate:e,isBillPayCommentingEnabled:I,isRealTimeApprovalEnabled:B,currentTenant:o,billId:i??"",isInternationalPaymentShaVsOurEnabled:J,hasZeniAssistAccess:$,isDetectInsufficientFundsEnabled:H,isAiCfoAccessEnabled:p,onAskAiCfoClick:m})]})}const ye=qe.getLocalizedStrings().spendManagement.billPay.billDetails,gi={containerWidth:new Zt(100,58)},ut=X(function(e,t){const l=L.getSignedInUser(),i=e.tenantState.currentTenantId,c={userId:l?.userId??"",sessionId:l?.zeniSessionId??"",tenantId:i??""},r=t.showActionButtons,u=r&&t.file==null;return{uploadInvoiceEndPoint:`${Ht.communicationAgentMicroServiceBaseUrl}`,authParams:c,billId:t.billId,file:t.file,showAutofill:t.showAutofill,analytics:D,entityId:t.billId,showTitlebarIcon:r,showTitlebar:r&&t?.file!=null,uploadStatus:t.uploadStatus,shouldNotShowAttachment:u,style:{paddingTop:A.sp10,paddingRight:A.sp3,paddingBottom:"15px",paddingLeft:A.sp5,...t.showAutofill?{}:{backgroundColor:t.backgroundColor,paddingBottom:"128px"}}}},function(e,t){const l=L.getSignedInUser();return{onInvoiceUpload:i=>{i!=null&&(t.file!=null||t.billId!=null||t.isInitialEdit?(t.setPayload(i),t.setShowConfirmationPopup(!0)):e(Ne(i,t.isVendorRecommendationEnabled,t.billId)))},updateInvoiceUploadFetchState:i=>{e(Sa({fetchState:{fetchState:i,error:void 0},billId:t.billId}))},onSkipAutofill:i=>{D?.trackBillPaySkipAutofill(),e(Oe(i))},onDeleteClick:()=>{e(ya({billId:t.billId})),D?.trackInvoiceActionClick(t.billStage??"","delete",l?.userEmail??"",null)}}})(Gn);function w({appContent:e}){const t=se(),l=K(),{billId:i}=ae(),c=Q(),r=c.pathname,u=r.includes("bill/new")||r.includes("/edit"),o=we(),s=me(),n=L.getSignedInUser(),{useFeatureGate:d,useDynamicConfig:p}=le(),{isFeatureEnabled:m}=d(y.isVendorRecommendationFeatureEnabled),{isFeatureEnabled:h}=d(y.isShowDeletedBillsFeatureEnabled),{isFeatureEnabled:g}=d(y.isDepositAccountsFeatureEnabled),{isFeatureEnabled:b}=d(y.billPaySetupShowInternationalPaymentByWise),{configValue:k}=p(Ae.zeniAssistConfig),j=k.user_ids!=null&&n?.userId!=null&&k.user_ids.includes(n?.userId),x=v(F=>Z(F)),[B,_]=f.useState(!1),[T,U]=f.useState(!1),[V,I]=f.useState(!1),[H,G]=f.useState(),C=v(F=>Ge(F,m,g,i));let q=C.fetchState,W=C.file,$=C.showAutofill;const J=v(F=>Ue(F,i??""));u===!1&&(q=J.fetchState,W=J.transactionDetails?.attachments?.[0],$=!1);const Y=C.billPayInfo!=null&&C.billPayInfo.stage.code==="pending_approval"?C.billPayInfo.billStatus.code:C.billStage;f.useEffect(()=>{i==null&&t(Oe(!0))},[i,t]),f.useEffect(()=>{q==="Not-Started"&&(u&&T?U(!1):!u&&B&&_(!1))},[i]),f.useEffect(()=>{B||i==null||u||(_(!0),t(Bt(i,h,j,!1)),T||(U(!0),t(Ve(!1,h,j,b,i)))),u&&!T&&(U(!0),t(Ve(!1,h,j,b,i)))},[B,T,u,i,t]);const O={onOkClick:()=>{if(I(!1),!H)return;const F=W!=null?"replace":"upload";D?.trackInvoiceActionClick(Y??"",F,n?.userEmail??"","yes"),t(ga({replaceBillData:!0,billId:i})),t(Ne(H,m,i))},onCancelClick:()=>{if(I(!1),!H)return;const F=W!=null?"replace":"upload";D?.trackInvoiceActionClick(Y??"",F,n?.userEmail??"","no"),t(ha({file:H,billId:i}))}},ee=f.useCallback(()=>{const F=z(c.state?.pathnameStackToGoBack),ce=F.poppedPathname??ie(x.tenantEmailDomain);t(ke({billId:i})),l(ce,{state:{pathnameStackToGoBack:F.newStack}})},[c.state,x.tenantEmailDomain,i,t,l]);if(n==null)throw Error("Can't access address page without signing in...");if(q==="Error"||J.fetchState==="Error")return a.jsx(Ee,{});if(q!="Completed")return i==null&&o!=="small"?a.jsx(rt,{fallback:ee,children:a.jsxs(Fe,{windowSize:o,children:[a.jsx(mt,{}),a.jsx(Re,{}),a.jsx(ut,{backgroundColor:s.colors.grey4,billId:i,file:W,showAutofill:!0,uploadStatus:C.uploadStatus,isVendorRecommendationEnabled:m,attachmentTitle:void 0,setShowConfirmationPopup:I,setPayload:G,showActionButtons:!1,isInitialEdit:!!C.isInitialEdit,billStage:Y}),a.jsx(Le,{windowSize:o,children:a.jsx(ct,{isNewBill:!0})})]})}):a.jsxs(Fe,{windowSize:o,children:[o==="small"||$?null:a.jsx(pt,{children:a.jsx(Xt,{onClick:ee,"data-testid":"nav-bar-back-click"})}),o!=="small"?a.jsx(Re,{}):null,a.jsx(Mn,{}),a.jsx(Le,{windowSize:o,children:a.jsx(ct,{isNewBill:i==null})})]});{const F=C.billPayInfo!=null&&C.billPayInfo.stage.code==="pending_approval"?C.billPayInfo.billStatus.code:C.billStage;return a.jsx(rt,{fallback:ee,children:a.jsxs(Fe,{windowSize:o,children:[$&&o!=="small"?a.jsx(mt,{}):null,V?a.jsx(Un,{titleComponent:a.jsx(wi,{children:ye.overwriteTitle}),descriptionComponent:a.jsx(xi,{children:ye.overwriteDescription}),primaryButtonText:ye.buttons.yes,secondaryButtonText:ye.buttons.no,action:O,isEditPopup:!0}):null,o==="small"||$?null:a.jsx(pt,{children:a.jsx(yi,{})}),o!=="small"?a.jsx(Re,{}):null,a.jsx(ut,{backgroundColor:s.colors.grey4,billId:i,file:W,showAutofill:$,uploadStatus:C.uploadStatus,isVendorRecommendationEnabled:m,attachmentTitle:Si(u,J,C),setShowConfirmationPopup:I,setPayload:G,showActionButtons:fi(u,C),isInitialEdit:!!C.isInitialEdit,billStage:F}),a.jsx(Le,{windowSize:o,children:e})]})})}}function yi(){const{triggerBack:e}=On();return a.jsx(Xt,{onClick:e,"data-testid":"nav-bar-back-click"})}function Si(e,t,l){let i,c;return e?(i=l.recurringConfig?.currentInstance,c=l.recurringConfig?.totalPaymentCycles):(i=t.transactionDetails?.recurringBillInstance,c=t.recurringBillConfigDetail?.totalPaymentCycles),t?.isRecurring===!0?a.jsxs(ki,{children:[a.jsx(vi,{children:`${ye.recurringBill.recurringCycle}
|
|
1
|
+
import{j as a}from"./liveblocks-B6wl2zlB.js";import{j as K,h as se,u as Q,l as ae,g as v,N as te,k as X,i as na,n as ia,o as S}from"./core-BAyxh70Z.js";import{eN as Z,LA as Ue,bv as It,GD as oa,bo as wt,bD as pe,LB as xt,ws as Bt,xC as Ve,w$ as la,bn as De,LC as sa,LD as ra,c0 as ca,LE as da,jq as Ct,LF as At,LG as Et,yb as _e,wH as Ce,LH as ua,wg as tt,LI as pa,Bn as ma,wk as ba,wq as Dt,LJ as ke,LK as Ge,xD as Oe,LL as ha,LM as ga,xG as Ne,LN as ya,xT as Sa,LO as jt,xn as at,xs as fa,LP as ka,LQ as ue,LR as Tt,LS as Pt,LT as Ft,fH as va,wM as $e,cv as Rt,LU as Ia,gC as wa,LV as xa,LW as Ba,eT as Lt,eR as Vt,LX as ze,LY as Ca,LZ as Aa,Jj as Ze,L_ as Ea,Jk as oe,Jl as He,L$ as Da,M0 as ja,M1 as Ta,xu as nt,xr as Pa,M2 as Fa,M3 as Ra,M4 as La,xd as Va,M5 as $a,M6 as Ma,M7 as Ua,cj as $t,cL as Mt,jB as _a,bJ as Ga,bq as Ut,bK as _t,vy as Oa,M8 as Na,Ba as za,Bg as Za,s5 as Ha,xE as Wa,yi as qa,jO as fe,M9 as Ja,Ma as Gt,kg as Ka,jI as Ot,k1 as Nt,k0 as it,bC as be,bI as Qa,Mb as Xa,Mc as ve,ik as Ya,Md as ot,Me as en,ip as tn,iK as an,yw as nn,Mf as on,k9 as ln,ym as sn,Mg as lt,yq as rn,yv as cn,ys as dn,yk as un,Mh as zt,wB as pn,Mi as mn,Mj as bn,fz as hn,fy as gn,fx as yn,jR as Sn,k7 as st,ki as fn,pE as kn,j_ as vn,yo as In,iv as wn,kn as xn,Mk as Bn,im as Cn,pv as An,Ml as En,xj as Dn,bE as jn,bs as Tn,Ik as Pn,cN as Fn,cM as Rn,cu as Ln,cA as Vn}from"./zeni-epic-state-BviKG7zC.js";import{h as me,z as L,j as Ie,a as le,p as y,aJ as Ae,B as re,o as A,A as je,d as D,b5 as $n,n as z,Q as We,s as E,q as we,b6 as rt,b7 as ct,b8 as Mn,ag as Un,G as _n,aD as Gn,F as Zt,D as qe,H as Je,b9 as On,ap as Ht,ba as Nn,M as zn,f as Wt,a1 as Zn,bb as Hn,bc as Wn,bd as qn,be as Jn,bf as Kn,bg as Qn,bh as Xn,bi as Yn,bj as ei,v as ti,bk as ai,b1 as ni,bl as ii,bm as oi,a5 as li}from"./index-EjFBjGdj.js";import{n as M,S as si}from"./mui-_J7ULT9g.js";import{A as dt}from"./AddressScreen-1oCzT4yV.js";import{g as ie,a as Te,i as qt,V as Ke,b as Qe,c as ri,v as ci,d as di,A as he,D as ge}from"./DomesticWireDetailScreen-T_mFhVD_.js";import{a as f}from"./sentry-Br5FXUqA.js";import{u as Xe}from"./useAskAiCfoHostNavButtonProps-DCq-odIp.js";import{c as Ye}from"./useFetchSuggestedQuestionsWhenReady-CxmYBvZJ.js";import{u as Jt}from"./useInitialThreadRequest-Deo98O2e.js";import Ee from"./NotFoundScreen-CkYvqje3.js";import{D as ui}from"./DrawerScreen-CorzJQg_.js";import{M as Kt}from"./MobileAppDrawer-dFU_MMpQ.js";import{F as Qt}from"./FeaturePreviewScreen-Bm1Z6CGq.js";import{S as Pe}from"./SetupPagesScreen-Bv0bHMSf.js";import{B as pi}from"./BillPayApprovalRoutes-DKOPEwPw.js";import{FallBackRoute as mi}from"./ScreenRoutes-D6QBilOh.js";import"./recharts-BAmCdxCr.js";import"./analytics-CahmTVDu.js";import"./plaid-BGvkfr4M.js";import"./dnd-BSIjjfrd.js";import"./stripe-DMRn4zHo.js";import"./lottie-BANYn_n3.js";import"./lexical-0b05ScDc.js";import"./pdf-b6pQct0d.js";import"./utils-D7Q_r6EF.js";import"./analyticsHelper-BjzoDw_T.js";import"./routePaths-DYIKJgSA.js";import"./BusinessVerificationPageScreen-Bgq_t0NA.js";import"./ReimbursementApprovalRuleDetailScreen-CBSWs1rW.js";import"./getLocaleForTenant-CTxSISA1.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]="6fea99ea-feed-497b-a763-fe5fcae4594c",e._sentryDebugIdIdentifier="sentry-dbid-6fea99ea-feed-497b-a763-fe5fcae4594c")}catch{}})();const bi=X(function(e,t){const l=Ue(e,t.billId),i=L.getSignedInUser(),c=e.tenantState.currentTenantId,r={userId:i?.userId??"",sessionId:i?.zeniSessionId??"",tenantId:c??""},u=z(t.location.state?.pathnameStackToGoBack);let o=!0;u.poppedPathname?.includes("bills")===!0&&(o=!1);let s=`${l.createdBy?.firstName??"Zeni"} ${l.createdBy?.lastName??""}`;const n=De(i);n||!l.createdBy?.email?.includes("zeni.ai")||(s="Zeni");let d=!1,p=!1;if(l?.billActivities.length>0){const{isApprovalorRejectBtnVisible:g,isMarkAsPaidBtnVisible:b}=sa(l.billActivities,ra(t.currentTenant),i);d=g,p=b}const m=ca(t.currentTenant?.userRole??[]),h=l.transactionDetails!=null&&da(l.transactionDetails,m,i);return{billDetails:l,isAccountingClassesEnabled:Ct(e),createdBy:s,authParams:r,transactionAttachmentEndpoint:`${We}/transaction_attachment`,signedInUser:i,showBackButton:o,isAdmin:m,isRealTimeApprovalEnabled:t.isRealTimeApprovalEnabled,showApproveRejectBtns:d,showMarkAsPaidButtonToApprover:p,hasZeniAssistAccess:t.hasZeniAssistAccess,analytics:D,showMarkAsPaidButtonToCreator:h,isZeniUser:n}},function(e,t){const{billId:l,currentTenant:i,location:c,navigate:r}=t,{tenantEmailDomain:u}=i;return{redirectToBillsScreen:()=>{const o=ie(u),s=E(c.state?.pathnameStackToGoBack,c.pathname);r(o,{state:{pathnameStackToGoBack:s}})},redirectToEditableBillScreen:()=>{const o=E(c.state?.pathnameStackToGoBack,c.pathname);r("./edit",{state:{pathnameStackToGoBack:o}})},discardBillDetailsFromLocalStore:()=>{e(ke({}))},deleteBill:o=>{D.trackBillPayDeleteBill(l,o),e(Dt(l))},cancelAndDeleteBill:(o,s)=>{s===!0?D.trackBillPayCancelAndDeleteBill(l,o):D.trackBillPayCancelBill(l),e(ba(l,s))},onSaveRealTimeApprovals:o=>{e(ma(l,"bill_pay",o))},updateEditRealTimeApproverClicked:o=>{e(pa({isEdit:o,entityId:l,entityType:"bill_pay"}))},approveOrRejectBill:o=>{o.type==="approved"?e(tt(l,o.type,"")):e(tt(l,o.type,o.description??""))},retryOrRefundBill:o=>{o.type==="retry"?e(Ce(l,"retry")):e(Ce(l,"refund"))},onAddNewRule:()=>{r("../../bills/approval-rules")},onAttachmentClick:(o,s)=>{const n=Te(u,o,s),d=E(c.state?.pathnameStackToGoBack,c.pathname);r(n,{state:{pathnameStackToGoBack:d}})},onBackClick:()=>{const o=z(t.location.state?.pathnameStackToGoBack),s=o.poppedPathname??ie(u);r(s,{state:{pathnameStackToGoBack:o.newStack}})},onRetryPaymentClick:()=>{const o=E(c.state?.pathnameStackToGoBack,c.pathname);r("./edit",{state:{pathnameStackToGoBack:o}}),e(ua({billId:t.billId}))},onRefundPaymentClick:()=>{e(Ce(t.billId,"refund"))},saveBillDetails:(o,s,n)=>{o&&e(Et({data:n,billId:l})),e(_e(o?"paid":"pending_approval",o,s,l))},discardOutsideZeniPaymentData:()=>{e(At({billId:l}))}}})($n);function hi(){const e=K(),t=se(),l=Q(),{billId:i}=ae(),c=me(),r=L.getSignedInUser(),u=Ie(),o=v(O=>Z(O)),s=v(O=>Ue(O,i??"")),n=s.transactionDetails?.billPayInfo.stage.code==="draft"&&s.transactionDetails.isDeleted===!1,d=Jt(o?.companyId,{clearParams:s.fetchState==="Completed"&&!n}),{isAiCfoAccessEnabled:p,onAskAiCfoClick:m}=Xe({mobileExploreReferrer:"Bill Details"});Ye({isDataReady:s.fetchState==="Completed"});const h=o?.userRole!=null&&It(o?.userRole),g=o?.company==null||o.company.featuresActivationInfo?.isBillPayFeatureEnabled&&!h,[b,k]=f.useState(!1),[j,x]=f.useState(!1),[B,_]=f.useState(!1),{useFeatureGate:T,useDynamicConfig:U}=le(),{isFeatureEnabled:V}=T(y.isShowDeletedBillsFeatureEnabled),{isFeatureEnabled:I}=T(y.isBillPayCommentingEnabled),{isFeatureEnabled:H}=T(y.isBillPayDetectInsufficientFundsEnabled),{configValue:G}=U(Ae.zeniAssistConfig),C=oa(o),q=wt(o.userRole),W=g&&pe(u?.loggedInUserRoleMap),$=G.user_ids!=null&&r?.userId!=null&&G.user_ids.includes(r?.userId),{isFeatureEnabled:J}=T(y.isInternationalPaymentShaVsOurFeatureEnabled),{isFeatureEnabled:Y}=T(y.billPaySetupShowInternationalPaymentByWise);if(f.useEffect(()=>{V&&s.transactionDetails?.isDeleted===!0||o.isZeni===!0&&r?.userEmailDomain==="zeni.ai"&&C===!1?_(!1):_(s.billActivities[0]?.isRealTimeApprovalEnabled&&(q||W||s.allApprovers.find(O=>O.user.userId===r?.userId)!=null||s.transactionDetails?.lastUpdatedByUserId===r?.userId))},[s.billActivities[0]?.isRealTimeApprovalEnabled,s.allApprovers,s.transactionDetails?.lastUpdatedByUserId,q,W,o.isZeni,C,r]),f.useEffect(()=>{i!=null&&t(xt(i))},[i]),f.useEffect(()=>{b||s.fetchState=="Completed"||s.fetchState=="In-Progress"||(k(!0),t(Bt(i??"",V,$,!1)))},[b,s,i,t]),f.useEffect(()=>{j||s.fetchState!="Completed"||s.transactionDetails?.billPayInfo.stage.code=="paid"||(x(!0),t(Ve(!1,V,$,Y,i)),s.billActivities[0]?.isRealTimeApprovalEnabled===!0&&t(la()))},[j,s,i,t]),r==null)throw Error("Can't access address page without signing in...");return s.transactionDetails?.billPayInfo.stage.code==="draft"&&s.transactionDetails.isDeleted===!1?a.jsx(te,{to:`./edit${l.search}`}):s.deleteStatus.fetchState==="In-Progress"||s.cancelAndDeleteStatus.fetchState==="In-Progress"||s.cancelStatus.fetchState==="In-Progress"?a.jsx(re,{fetchState:s.deleteStatus.fetchState,style:{boxShadow:`0px 2px ${A.sp1} ${c.colors.dropShadowNormal}`}}):a.jsxs(a.Fragment,{children:[a.jsx(je,{analytics:D,onLoad:O=>(ee=>{i!=null&&ee.trackBillPayBillDetails(i,s.isRecurring)})(O)}),a.jsx(bi,{initialOpenThreadRequest:d??void 0,isShowDeletedBillsEnabled:V,location:l,navigate:e,isBillPayCommentingEnabled:I,isRealTimeApprovalEnabled:B,currentTenant:o,billId:i??"",isInternationalPaymentShaVsOurEnabled:J,hasZeniAssistAccess:$,isDetectInsufficientFundsEnabled:H,isAiCfoAccessEnabled:p,onAskAiCfoClick:m})]})}const ye=qe.getLocalizedStrings().spendManagement.billPay.billDetails,gi={containerWidth:new Zt(100,58)},ut=X(function(e,t){const l=L.getSignedInUser(),i=e.tenantState.currentTenantId,c={userId:l?.userId??"",sessionId:l?.zeniSessionId??"",tenantId:i??""},r=t.showActionButtons,u=r&&t.file==null;return{uploadInvoiceEndPoint:`${Ht.communicationAgentMicroServiceBaseUrl}`,authParams:c,billId:t.billId,file:t.file,showAutofill:t.showAutofill,analytics:D,entityId:t.billId,showTitlebarIcon:r,showTitlebar:r&&t?.file!=null,uploadStatus:t.uploadStatus,shouldNotShowAttachment:u,style:{paddingTop:A.sp10,paddingRight:A.sp3,paddingBottom:"15px",paddingLeft:A.sp5,...t.showAutofill?{}:{backgroundColor:t.backgroundColor,paddingBottom:"128px"}}}},function(e,t){const l=L.getSignedInUser();return{onInvoiceUpload:i=>{i!=null&&(t.file!=null||t.billId!=null||t.isInitialEdit?(t.setPayload(i),t.setShowConfirmationPopup(!0)):e(Ne(i,t.isVendorRecommendationEnabled,t.billId)))},updateInvoiceUploadFetchState:i=>{e(Sa({fetchState:{fetchState:i,error:void 0},billId:t.billId}))},onSkipAutofill:i=>{D?.trackBillPaySkipAutofill(),e(Oe(i))},onDeleteClick:()=>{e(ya({billId:t.billId})),D?.trackInvoiceActionClick(t.billStage??"","delete",l?.userEmail??"",null)}}})(Gn);function w({appContent:e}){const t=se(),l=K(),{billId:i}=ae(),c=Q(),r=c.pathname,u=r.includes("bill/new")||r.includes("/edit"),o=we(),s=me(),n=L.getSignedInUser(),{useFeatureGate:d,useDynamicConfig:p}=le(),{isFeatureEnabled:m}=d(y.isVendorRecommendationFeatureEnabled),{isFeatureEnabled:h}=d(y.isShowDeletedBillsFeatureEnabled),{isFeatureEnabled:g}=d(y.isDepositAccountsFeatureEnabled),{isFeatureEnabled:b}=d(y.billPaySetupShowInternationalPaymentByWise),{configValue:k}=p(Ae.zeniAssistConfig),j=k.user_ids!=null&&n?.userId!=null&&k.user_ids.includes(n?.userId),x=v(F=>Z(F)),[B,_]=f.useState(!1),[T,U]=f.useState(!1),[V,I]=f.useState(!1),[H,G]=f.useState(),C=v(F=>Ge(F,m,g,i));let q=C.fetchState,W=C.file,$=C.showAutofill;const J=v(F=>Ue(F,i??""));u===!1&&(q=J.fetchState,W=J.transactionDetails?.attachments?.[0],$=!1);const Y=C.billPayInfo!=null&&C.billPayInfo.stage.code==="pending_approval"?C.billPayInfo.billStatus.code:C.billStage;f.useEffect(()=>{i==null&&t(Oe(!0))},[i,t]),f.useEffect(()=>{q==="Not-Started"&&(u&&T?U(!1):!u&&B&&_(!1))},[i]),f.useEffect(()=>{B||i==null||u||(_(!0),t(Bt(i,h,j,!1)),T||(U(!0),t(Ve(!1,h,j,b,i)))),u&&!T&&(U(!0),t(Ve(!1,h,j,b,i)))},[B,T,u,i,t]);const O={onOkClick:()=>{if(I(!1),!H)return;const F=W!=null?"replace":"upload";D?.trackInvoiceActionClick(Y??"",F,n?.userEmail??"","yes"),t(ga({replaceBillData:!0,billId:i})),t(Ne(H,m,i))},onCancelClick:()=>{if(I(!1),!H)return;const F=W!=null?"replace":"upload";D?.trackInvoiceActionClick(Y??"",F,n?.userEmail??"","no"),t(ha({file:H,billId:i}))}},ee=f.useCallback(()=>{const F=z(c.state?.pathnameStackToGoBack),ce=F.poppedPathname??ie(x.tenantEmailDomain);t(ke({billId:i})),l(ce,{state:{pathnameStackToGoBack:F.newStack}})},[c.state,x.tenantEmailDomain,i,t,l]);if(n==null)throw Error("Can't access address page without signing in...");if(q==="Error"||J.fetchState==="Error")return a.jsx(Ee,{});if(q!="Completed")return i==null&&o!=="small"?a.jsx(rt,{fallback:ee,children:a.jsxs(Fe,{windowSize:o,children:[a.jsx(mt,{}),a.jsx(Re,{}),a.jsx(ut,{backgroundColor:s.colors.grey4,billId:i,file:W,showAutofill:!0,uploadStatus:C.uploadStatus,isVendorRecommendationEnabled:m,attachmentTitle:void 0,setShowConfirmationPopup:I,setPayload:G,showActionButtons:!1,isInitialEdit:!!C.isInitialEdit,billStage:Y}),a.jsx(Le,{windowSize:o,children:a.jsx(ct,{isNewBill:!0})})]})}):a.jsxs(Fe,{windowSize:o,children:[o==="small"||$?null:a.jsx(pt,{children:a.jsx(Xt,{onClick:ee,"data-testid":"nav-bar-back-click"})}),o!=="small"?a.jsx(Re,{}):null,a.jsx(Mn,{}),a.jsx(Le,{windowSize:o,children:a.jsx(ct,{isNewBill:i==null})})]});{const F=C.billPayInfo!=null&&C.billPayInfo.stage.code==="pending_approval"?C.billPayInfo.billStatus.code:C.billStage;return a.jsx(rt,{fallback:ee,children:a.jsxs(Fe,{windowSize:o,children:[$&&o!=="small"?a.jsx(mt,{}):null,V?a.jsx(Un,{titleComponent:a.jsx(wi,{children:ye.overwriteTitle}),descriptionComponent:a.jsx(xi,{children:ye.overwriteDescription}),primaryButtonText:ye.buttons.yes,secondaryButtonText:ye.buttons.no,action:O,isEditPopup:!0}):null,o==="small"||$?null:a.jsx(pt,{children:a.jsx(yi,{})}),o!=="small"?a.jsx(Re,{}):null,a.jsx(ut,{backgroundColor:s.colors.grey4,billId:i,file:W,showAutofill:$,uploadStatus:C.uploadStatus,isVendorRecommendationEnabled:m,attachmentTitle:Si(u,J,C),setShowConfirmationPopup:I,setPayload:G,showActionButtons:fi(u,C),isInitialEdit:!!C.isInitialEdit,billStage:F}),a.jsx(Le,{windowSize:o,children:e})]})})}}function yi(){const{triggerBack:e}=On();return a.jsx(Xt,{onClick:e,"data-testid":"nav-bar-back-click"})}function Si(e,t,l){let i,c;return e?(i=l.recurringConfig?.currentInstance,c=l.recurringConfig?.totalPaymentCycles):(i=t.transactionDetails?.recurringBillInstance,c=t.recurringBillConfigDetail?.totalPaymentCycles),t?.isRecurring===!0?a.jsxs(ki,{children:[a.jsx(vi,{children:`${ye.recurringBill.recurringCycle}
|
|
2
2
|
${i}/${c}`}),a.jsx(Ii,{})]}):void 0}function fi(e,t){const l=t.billActivities?.[0],i=t.billStage==="pending_approval"&&l?.areApprovalsSerialized===!0&&l?.currentPendingStepIndex===0;return e&&(t.billStage==="draft"||i)}const pt=M.div`
|
|
3
3
|
margin-bottom: 20px;
|
|
4
4
|
margin-top: 20px;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{j as k}from"./liveblocks-
|
|
1
|
+
import{j as k}from"./liveblocks-B6wl2zlB.js";import{a as V}from"./sentry-Br5FXUqA.js";import{j as ae,u as ne,h as se,l as ie,g as C,N as oe,k as re}from"./core-BAyxh70Z.js";import{j as ce,a as ue,aJ as de,z as E,A as pe,d as M,ab as x,f as z,bu as le,ap as me,s as B,aq as R}from"./index-EjFBjGdj.js";import{M6 as fe,eN as G,rw as ye,GH as Se,xd as ge,zW as Ie,Ct as he,D6 as be,D$ as De,Mt as Oe,Mu as Te,Mv as ke,Mw as Ce,Mx as Ve,J0 as we,Lv as Ae,Jc as Ne,k6 as _e,fz as ve,fy as Fe,fx as xe,pE as ze,pv as Ee,ps as Me,j_ as Be,rF as Re,rD as P,bC as L,rR as j,ct as Pe}from"./zeni-epic-state-BviKG7zC.js";import{n as Le}from"./mui-_J7ULT9g.js";import{c as U}from"./routePaths-DYIKJgSA.js";import{M as je}from"./MobileAppDrawer-dFU_MMpQ.js";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},d=new e.Error().stack;d&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[d]="02e3eed2-6b65-4789-92ad-1fdcc4f55590",e._sentryDebugIdIdentifier="sentry-dbid-02e3eed2-6b65-4789-92ad-1fdcc4f55590")}catch{}})();const Ue=Le.div`
|
|
2
2
|
display: flex;
|
|
3
3
|
min-height: 100%;
|
|
4
4
|
width: 100%;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{j as s}from"./liveblocks-CF908iAG.js";import{j as le,l as ia,h as ue,g as y,u as ge,k as pe,N as ga,q as lt,n as Kt,o as te}from"./core-Cgen4kAj.js";import{eN as ie,bs as Ue,NZ as ka,eR as be,eS as ye,eT as Se,fO as ze,cq as $e,N_ as Ge,N$ as Ma,sL as ba,jy as ya,O0 as Sa,gC as oa,zd as Xe,zf as za,zg as $a,jo as ut,O1 as Ye,z1 as mt,O2 as Wt,O3 as qt,z4 as Da,O4 as Jt,Mq as _a,qX as Ct,za as Ga,gN as Qt,O5 as pt,O6 as Ze,bq as Xt,O7 as en,fz as wa,fy as Pa,zK as an,fx as Ta,M6 as tn,O8 as ht,cj as ft,cL as nn,Mp as da,Ak as rn,O9 as tt,zW as Fa,Oa as gt,Al as sn,MQ as on,Am as cn,Bg as dn,s5 as ln,Ba as un,zv as bt,zo as mn,Ob as Cn,fQ as pn,zE as yt,zI as St,fP as hn,Oc as fn,A6 as It,Od as gn,Oe as bn,Of as yn,zG as At,zr as Et,z7 as kt,zA as Dt,zy as _t,zC as Sn,ze as nt,Og as wt,Oh as va,zT as Ia,J5 as Pt,cM as Ya,Oi as In,Oj as An,Ok as En,Ol as kn,zQ as Na,Ad as Dn,A9 as _n,zM as wn,Ab as Pn,A1 as Tn,A3 as Fn,Om as Tt,Aj as Ft,GD as vn,On as xn,Oo as Ln,Op as On,Oq as vt,Or as Bn,AG as Un,zV as xt,zP as ca,zU as Rn,Os as jn,Ot as Nn,y_ as Vn,Ou as Lt,Ov as Ot,Ow as Hn,z0 as Mn,y$ as rt,Ox as zn,Oy as $n,Oz as Gn,J1 as Yn,OA as Za,OB as Zn,vB as Bt,k6 as Kn,gD as Wn,AL as qn,OC as Ut,OD as Jn,AM as Qn,OE as Xn,dc as er,sF as ar,AB as tr,Av as Be,bv as nr,bD as rr,cv as sr,bE as or,Ik as cr}from"./zeni-epic-state-DrGehtra.js";import{z as X,j as je,a as ce,p as Y,B as Ke,bY as xa,c7 as ir,n as ve,c8 as dr,c9 as lr,q as la,aJ as Fe,s as fe,bf as Ka,ca as ur,F as ua,k as La,h as Wa,d as J,D as qa,cb as mr,am as Ja,br as Je,cc as Va,cd as Cr,A as Qa,a1 as pr,ce as hr,ap as Rt,Q as Ha,M as jt,f as Nt,cf as fr,cg as gr,ch as br,ci as yr,cj as Sr,o as Aa,ck as Ir,cl as Ar,cm as Ua,v as Er,cn as kr,co as Dr,cp as _r,cq as wr,a5 as Pr}from"./index-trlF__w8.js";import{n as _e,D as Vt,S as Tr}from"./mui-C7dUqSqV.js";import{a as i}from"./sentry-cfxuOFew.js";import{g as Ce,a as ma,b as Ht,c as Ie,d as Ae,e as Re,f as Ne,A as Fr,h as Xa,P as vr,i as et,s as Qe,j as Mt,k as Me,l as zt,m as xr,n as $t,p as Lr,S as st}from"./SetupPagesScreen-RaBTeZ3X.js";import Oa from"./NotFoundScreen-DXPtR234.js";import{M as Ca}from"./MobileAppDrawer-BuQb2buy.js";import{u as Gt}from"./useAskAiCfoHostNavButtonProps-C2mAQ-5p.js";import{c as Yt}from"./useFetchSuggestedQuestionsWhenReady-B5mF_k6O.js";import{v as ot}from"./utils-DumEze_M.js";import{t as Or}from"./AddressScreen-BeHKG8v1.js";import"./recharts-Dyhe2tpB.js";import"./analytics-B_uP5uGX.js";import"./plaid-CChs9PMx.js";import"./dnd-DhFfs1wM.js";import"./stripe-DMRn4zHo.js";import"./lottie-Ega9gP0x.js";import"./lexical-DJV7tysr.js";import"./pdf-CSmOdS_B.js";import"./analyticsHelper-CsFRydiU.js";import"./routePaths-CqnfURaJ.js";import"./BusinessVerificationPageScreen-BUCm7Odf.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]="52dc4d9e-21eb-4f03-8b06-b680f05d8ba3",e._sentryDebugIdIdentifier="sentry-dbid-52dc4d9e-21eb-4f03-8b06-b680f05d8ba3")}catch{}})();function Br(){const e=le(),{cardId:t}=ia(),a=ue(),r=X.getSignedInUser(),n=y(Q=>ie(Q)),m=je(),C=Ue(m?.loggedInUserRoleMap),{useFeatureGate:p}=ce();if(r==null)throw Error("Can't access Add To Wallet Page without signing in...");const[S,o]=i.useState(!1),c=y(Q=>ka(Q).firstViewAfterActivation);if(t==null)throw Error("Empty card id is not valid...");const _=n.userRole.includes("charge_card_user"),{isFeatureEnabled:A}=p(Y.isChargeCardFeatureEnabled),f=!!n.companyChargeCardInfo?.info?.isChargeCardEnabled,{isFeatureEnabled:U}=p(Y.isDebitCardFeatureEnabled),F=be(n),k=ye(n),h=Se(U,n),b=n.companyChargeCardInfo?.info?.chargeCardsCreditAccountLimit??0,g=Ie({isDebitCardFeatureEnabled:U,isBankingOnlyTenant:h}),d=Ae({isCardsOnlyTenant:F,isChargeCardFeatureEnabled:A,isBookKeepingTenant:k,isDebitCardProductVisible:g,chargeCardsCreditAccountLimit:b}),D=!!n.companyDebitCardInfo?.info?.isDebitCardEnabled,v=y(Q=>ze(Q,n.companyId)),j=$e(v.controllers),{creditAccount:O,creditAccountRepayment:P}=y(Q=>Ge(Q)),V=y(Q=>Q.classListState.fetchState),u=!_&&d&&f,l=y(Q=>Ma(Q,t,u,d)),[w,T]=i.useState(!1),H=l.chargeCard,B=H?.cardCreatedByUser?.userId,K=y(Q=>B!=null?ba(Q.userRoleState,B):void 0),I=K?.accountingClassIDs[0],L=y(Q=>I!=null?ya(Q.classState,{classId:I,reportId:"class_list"}):void 0),N=H?.cardHolderUser?.userId,R=y(Q=>N!=null?ba(Q.userRoleState,N):void 0),W=R?.accountingClassIDs[0],E=y(Q=>W!=null?ya(Q.classState,{classId:W,reportId:"class_list"}):void 0),G=H?.type.code==="business_physical_credit_card"||H?.type.code==="business_physical_debit_card",q=H?.type.code==="business_physical_debit_card";i.useEffect(()=>{c&&S===!1&&G&&(o(!0),setTimeout(()=>{a(Sa()),q&&a(oa({messageSection:"set_debit_card_pin",messageText:"success",type:"success",showStatusIcon:!0}))},5e3))},[c,S,G,q]),i.useEffect(()=>{w||l.fetchState==="Completed"||l.fetchState==="In-Progress"||t==null||(T(!0),a(Xe(t,u,!1)))},[w,l,t,a]),i.useEffect(()=>{if(l.fetchState==="Completed"&&(G===!1||G&&H?.status?.code!=="active"||H?.cardHolderUserId!==r.userId||c===!1&&S===!1||H?.type.code==="business_physical_debit_card"||H?.type.code==="business_virtual_debit_card")){const Q=Ce(n.tenantEmailDomain,t,r,H,c);e(Q)}},[l.fetchState,c,G]),i.useEffect(()=>{O.fetchState!=="Completed"&&O.fetchState!=="In-Progress"&&d&&f&&C&&a(za()),P.fetchState!=="Completed"&&P.fetchState!=="In-Progress"&&d&&f&&C&&a($a()),V!=="Completed"&&V!=="In-Progress"&&a(ut())},[O.fetchState,P.fetchState,a,d,f,C,V]);const $=()=>{if(r!=null&&t!=null){a(Sa());const Q=Ce(n.tenantEmailDomain,t,r);e(Q)}},x=H?.type.code==="business_physical_debit_card"||H?.type.code==="business_virtual_debit_card",se=Re(d,g,D,f),ae=ma(d,f,C,O,P),ne=Ht(x,l);return l.fetchState!=="Completed"?s.jsx(Ke,{fetchState:"In-Progress"}):s.jsxs(s.Fragment,{children:[s.jsx(xa,{showConfetti:c}),s.jsx(ir,{onGotItClick:$,isDebitCard:H?.type.code==="business_physical_debit_card",controllerEmails:j,isChargeCardFeatureEnabled:d,isDebitCardFeatureEnabled:g,isDebitCardSetupEnabled:D,isChargeCardSetupEnabled:f,productInformation:se,creditAccountInformation:ae,debitAccountInformation:ne,chargeCardDetailView:l,creditAccount:O,classListFetchState:V,creditAccountRepayment:P,cardIssuedByRoles:K?.userRoles,cardIssuedByDepartmentName:L?.className,cardHolderRoles:R?.userRoles,cardHolderDepartmentName:E?.className})]})}const Ur=pe(function(e){const t=Ye(e);return{insightsData:t.insight,cashbackByPeriod:t.cashbackByPeriod,uiState:t.uiState,cashbackSummary:t.cashbackSummary}},function(e){return{onColumnSortConfigChanged:(t,a)=>{e(Wt({uiState:{sortKey:t,sortOrder:a}}))}}})(lr);function Rr(){const e=le(),t=ue(),a=ge(),r=X.getSignedInUser(),n=y(o=>ie(o)),[m,C]=i.useState(!1),p=y(o=>Ye(o)),S=i.useCallback(()=>{const o=ve(a.state?.pathnameStackToGoBack),c=o.poppedPathname??jr(n.tenantEmailDomain);e(c,{state:{pathnameStackToGoBack:o.newStack}})},[e,a,n.tenantEmailDomain]);if(i.useEffect(()=>{m||p.fetchState==="Completed"||p.fetchState==="In-Progress"||(C(!0),t(mt()))},[m,p,t]),r==null)throw Error("Can't access cashback detail page without signing in...");return p.fetchState==="In-Progress"?s.jsx(dr,{onBackClick:S}):p.cashbackSummary.cashbackEarned.amount===0&&p.fetchState==="Completed"?s.jsx(Oa,{}):s.jsx(Ur,{onBackClick:S})}const jr=e=>`/${e}/cards`,Nr={containerWidth:new ua(100,58)},Vr=({appContent:e})=>{const t=la(),a=ue(),r=le(),{cardId:n}=ia(),m=ge(),{useDynamicConfig:C}=ce(),[p,S]=i.useState(!1),[o,c]=i.useState(!1),[_,A]=i.useState(!1),[f,U]=i.useState(!1),F=X.getSignedInUser();if(F==null)throw Error("Can't access onboarding card page without signing in...");const k=y(E=>ie(E));if(n==null)throw Error("Empty card id is not valid...");const{configValue:h}=C(Fe.zeniCardsConfig),b=h.max_charge_card_activation_attempts_by_card_id,g=y(E=>qt(E,n)),d=g.chargeCard,D=y(E=>E.chargeCardConfigState.fetchState),{useFeatureGate:v}=ce(),{isFeatureEnabled:j}=v(Y.isChargeCardFeatureEnabled),{isFeatureEnabled:O}=v(Y.isDebitCardFeatureEnabled),P=Se(O,k),V=Ie({isDebitCardFeatureEnabled:O,isBankingOnlyTenant:P}),u=!!k.companyChargeCardInfo?.info?.isChargeCardEnabled,l=k.userRole.includes("charge_card_user"),w=be(k),T=ye(k),H=k.companyChargeCardInfo?.info?.chargeCardsCreditAccountLimit??0,B=Ae({isCardsOnlyTenant:w,isChargeCardFeatureEnabled:j,isBookKeepingTenant:T,isDebitCardProductVisible:V,chargeCardsCreditAccountLimit:H}),K=!l&&B&&u;i.useEffect(()=>{p===!1&&D!=="In-Progress"&&D!=="Completed"&&(a(Da()),S(!0)),o===!1&&g.fetchState==="Not-Started"&&(c(!0),a(Xe(n,K,B)))},[o,g.fetchState,p,D]);const I=d?.type.code==="business_physical_credit_card"||d?.type.code==="business_physical_debit_card";i.useEffect(()=>{if(g.fetchState==="Completed"){if(_===!1&&(I===!1||I&&d?.status?.code!=="inactive"||d?.cardHolderUserId!==F.userId)){const E=Ce(k.tenantEmailDomain,n,F,d,!0),G=fe(m.state?.pathnameStackToGoBack,m.pathname);r(E,{state:{pathnameStackToGoBack:G}})}else if(_&&g.isRefreshingViewInBackground===!1&&d?.status?.code==="active"){a(Jt({chargeCardId:n}));const E=Ce(k.tenantEmailDomain,n,F,d,!0),G=fe(m.state?.pathnameStackToGoBack,m.pathname);a(_a()),r(E,{state:{pathnameStackToGoBack:G}})}}},[g.fetchState,d?.type.code,_,g.isRefreshingViewInBackground]);const L=X.getZeniOtpTokenForCardHolder(n),N=y(E=>Ct(E.userState,F.userId)),R=()=>{d?.status?.code!=="active"&&a(Ga(n,!0))};i.useEffect(()=>{g.updatePhysicalChargeCardAttemptFetchState.fetchState==="Completed"&&d?.cardActivationAttemptHistory.some(E=>E.statusCode==="success")===!0&&_===!1&&(setTimeout(R,3e3),A(!0))},[g.updatePhysicalChargeCardAttemptFetchState.fetchState,d?.cardActivationAttemptHistory]);const W=E=>{U(E)};if(D!=="Completed"||d==null)return s.jsx(Ke,{fetchState:"In-Progress"});if(d.shippingAddressId==null)throw Error("Can't access shippingAddressId.");if(N?.phone==null)throw Error("Can't access user phone number.");return s.jsxs(zr,{children:[s.jsx(Ca,{isAppContentDrawerOpen:f,handleDrawerToggle:W}),s.jsx(Hr,{cardId:n,card:d,shippingAddressId:d.shippingAddressId,phone:N.phone,signedInUser:F,isSandboxEnv:Ka(),chargeCardDetailState:g,signedInUserToken:L,navigate:r,currentTenant:k,location:m,maxChargeCardActivationAttempts:b[n]!=null?b[n]:h.default_max_charge_card_activation_attempts!=null?h.default_max_charge_card_activation_attempts:3,chargeCardCashbackRatePerTransaction:h.charge_card_cashback_rate_per_transaction!=null?h.charge_card_cashback_rate_per_transaction:.0175,onClickMenuIcon:()=>{W(!0)}}),e!=null?s.jsx(Mr,{windowSize:t,children:e}):null]})},Hr=pe(function(e,{chargeCardDetailState:t,shippingAddressId:a,location:r,cardId:n}){const m=Qt(e.addressState,a);if(m==null)throw Error("Can't access shippingAddress.");const C=pt(e,n),p=t.updateStatus,S=Ze(e,!1,!1,!1);let o=!1;S.fetchState==="Completed"&&S.cards.length<=1&&(o=!0);const c=r.state?.message==="comingFromV2UrlPath";return{showActivatePage:t.chargeCard?.providerCardCreateTime!=null&&t.chargeCard.providerCardCreateTime.add(24,"h").isBefore(Xt())||c,showMenuIcon:o,shippingAddress:m,vgsVaultId:La.cardVaultId,twoFAView:C,activationWaitStatus:p,isRefreshingViewInBackground:t.isRefreshingViewInBackground}},function(e,t){const{navigate:a,cardId:r,location:n,currentTenant:m,chargeCardDetailState:C}=t,p=C.chargeCard?.cardProviderID,{tenantEmailDomain:S}=m;return{onGetOtp:o=>{p!=null&&e(Ta(o,"ChargeCardHolder",r))},onUpdatePhysicalChargeCardAttempt:o=>{e(an(r,o))},onResendOtp:o=>{p!=null&&e(Pa(o,"ChargeCardHolder",r))},onVerifyOtp:(o,c)=>{p!=null&&e(wa(o,c,"ChargeCardHolder",r))},onVerifyOtpSuccess:o=>{o!=null&&X.saveZeniOtpTokenForCardHolder(o,r)},onCVVActivateSuccess:()=>{e(en({chargeCardId:r}))},onBackClick:()=>{const o=ve(n.state?.pathnameStackToGoBack),c=o.poppedPathname==null||o.poppedPathname.includes("onboard")===!0?Ne(S):o.poppedPathname;a(c,{state:{pathnameStackToGoBack:o.newStack}})}}})(ur),Mr=_e.div`
|
|
1
|
+
import{j as s}from"./liveblocks-B6wl2zlB.js";import{j as le,l as ia,h as ue,g as y,u as ge,k as pe,N as ga,q as lt,n as Kt,o as te}from"./core-BAyxh70Z.js";import{eN as ie,bs as Ue,NZ as ka,eR as be,eS as ye,eT as Se,fO as ze,cq as $e,N_ as Ge,N$ as Ma,sL as ba,jy as ya,O0 as Sa,gC as oa,zd as Xe,zf as za,zg as $a,jo as ut,O1 as Ye,z1 as mt,O2 as Wt,O3 as qt,z4 as Da,O4 as Jt,Mq as _a,qX as Ct,za as Ga,gN as Qt,O5 as pt,O6 as Ze,bq as Xt,O7 as en,fz as wa,fy as Pa,zK as an,fx as Ta,M6 as tn,O8 as ht,cj as ft,cL as nn,Mp as da,Ak as rn,O9 as tt,zW as Fa,Oa as gt,Al as sn,MQ as on,Am as cn,Bg as dn,s5 as ln,Ba as un,zv as bt,zo as mn,Ob as Cn,fQ as pn,zE as yt,zI as St,fP as hn,Oc as fn,A6 as It,Od as gn,Oe as bn,Of as yn,zG as At,zr as Et,z7 as kt,zA as Dt,zy as _t,zC as Sn,ze as nt,Og as wt,Oh as va,zT as Ia,J5 as Pt,cM as Ya,Oi as In,Oj as An,Ok as En,Ol as kn,zQ as Na,Ad as Dn,A9 as _n,zM as wn,Ab as Pn,A1 as Tn,A3 as Fn,Om as Tt,Aj as Ft,GD as vn,On as xn,Oo as Ln,Op as On,Oq as vt,Or as Bn,AG as Un,zV as xt,zP as ca,zU as Rn,Os as jn,Ot as Nn,y_ as Vn,Ou as Lt,Ov as Ot,Ow as Hn,z0 as Mn,y$ as rt,Ox as zn,Oy as $n,Oz as Gn,J1 as Yn,OA as Za,OB as Zn,vB as Bt,k6 as Kn,gD as Wn,AL as qn,OC as Ut,OD as Jn,AM as Qn,OE as Xn,dc as er,sF as ar,AB as tr,Av as Be,bv as nr,bD as rr,cv as sr,bE as or,Ik as cr}from"./zeni-epic-state-BviKG7zC.js";import{z as X,j as je,a as ce,p as Y,B as Ke,bY as xa,c7 as ir,n as ve,c8 as dr,c9 as lr,q as la,aJ as Fe,s as fe,bf as Ka,ca as ur,F as ua,k as La,h as Wa,d as J,D as qa,cb as mr,am as Ja,br as Je,cc as Va,cd as Cr,A as Qa,a1 as pr,ce as hr,ap as Rt,Q as Ha,M as jt,f as Nt,cf as fr,cg as gr,ch as br,ci as yr,cj as Sr,o as Aa,ck as Ir,cl as Ar,cm as Ua,v as Er,cn as kr,co as Dr,cp as _r,cq as wr,a5 as Pr}from"./index-EjFBjGdj.js";import{n as _e,D as Vt,S as Tr}from"./mui-_J7ULT9g.js";import{a as i}from"./sentry-Br5FXUqA.js";import{g as Ce,a as ma,b as Ht,c as Ie,d as Ae,e as Re,f as Ne,A as Fr,h as Xa,P as vr,i as et,s as Qe,j as Mt,k as Me,l as zt,m as xr,n as $t,p as Lr,S as st}from"./SetupPagesScreen-Bv0bHMSf.js";import Oa from"./NotFoundScreen-CkYvqje3.js";import{M as Ca}from"./MobileAppDrawer-dFU_MMpQ.js";import{u as Gt}from"./useAskAiCfoHostNavButtonProps-DCq-odIp.js";import{c as Yt}from"./useFetchSuggestedQuestionsWhenReady-CxmYBvZJ.js";import{v as ot}from"./utils-D7Q_r6EF.js";import{t as Or}from"./AddressScreen-1oCzT4yV.js";import"./recharts-BAmCdxCr.js";import"./analytics-CahmTVDu.js";import"./plaid-BGvkfr4M.js";import"./dnd-BSIjjfrd.js";import"./stripe-DMRn4zHo.js";import"./lottie-BANYn_n3.js";import"./lexical-0b05ScDc.js";import"./pdf-b6pQct0d.js";import"./analyticsHelper-BjzoDw_T.js";import"./routePaths-DYIKJgSA.js";import"./BusinessVerificationPageScreen-Bgq_t0NA.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]="52dc4d9e-21eb-4f03-8b06-b680f05d8ba3",e._sentryDebugIdIdentifier="sentry-dbid-52dc4d9e-21eb-4f03-8b06-b680f05d8ba3")}catch{}})();function Br(){const e=le(),{cardId:t}=ia(),a=ue(),r=X.getSignedInUser(),n=y(Q=>ie(Q)),m=je(),C=Ue(m?.loggedInUserRoleMap),{useFeatureGate:p}=ce();if(r==null)throw Error("Can't access Add To Wallet Page without signing in...");const[S,o]=i.useState(!1),c=y(Q=>ka(Q).firstViewAfterActivation);if(t==null)throw Error("Empty card id is not valid...");const _=n.userRole.includes("charge_card_user"),{isFeatureEnabled:A}=p(Y.isChargeCardFeatureEnabled),f=!!n.companyChargeCardInfo?.info?.isChargeCardEnabled,{isFeatureEnabled:U}=p(Y.isDebitCardFeatureEnabled),F=be(n),k=ye(n),h=Se(U,n),b=n.companyChargeCardInfo?.info?.chargeCardsCreditAccountLimit??0,g=Ie({isDebitCardFeatureEnabled:U,isBankingOnlyTenant:h}),d=Ae({isCardsOnlyTenant:F,isChargeCardFeatureEnabled:A,isBookKeepingTenant:k,isDebitCardProductVisible:g,chargeCardsCreditAccountLimit:b}),D=!!n.companyDebitCardInfo?.info?.isDebitCardEnabled,v=y(Q=>ze(Q,n.companyId)),j=$e(v.controllers),{creditAccount:O,creditAccountRepayment:P}=y(Q=>Ge(Q)),V=y(Q=>Q.classListState.fetchState),u=!_&&d&&f,l=y(Q=>Ma(Q,t,u,d)),[w,T]=i.useState(!1),H=l.chargeCard,B=H?.cardCreatedByUser?.userId,K=y(Q=>B!=null?ba(Q.userRoleState,B):void 0),I=K?.accountingClassIDs[0],L=y(Q=>I!=null?ya(Q.classState,{classId:I,reportId:"class_list"}):void 0),N=H?.cardHolderUser?.userId,R=y(Q=>N!=null?ba(Q.userRoleState,N):void 0),W=R?.accountingClassIDs[0],E=y(Q=>W!=null?ya(Q.classState,{classId:W,reportId:"class_list"}):void 0),G=H?.type.code==="business_physical_credit_card"||H?.type.code==="business_physical_debit_card",q=H?.type.code==="business_physical_debit_card";i.useEffect(()=>{c&&S===!1&&G&&(o(!0),setTimeout(()=>{a(Sa()),q&&a(oa({messageSection:"set_debit_card_pin",messageText:"success",type:"success",showStatusIcon:!0}))},5e3))},[c,S,G,q]),i.useEffect(()=>{w||l.fetchState==="Completed"||l.fetchState==="In-Progress"||t==null||(T(!0),a(Xe(t,u,!1)))},[w,l,t,a]),i.useEffect(()=>{if(l.fetchState==="Completed"&&(G===!1||G&&H?.status?.code!=="active"||H?.cardHolderUserId!==r.userId||c===!1&&S===!1||H?.type.code==="business_physical_debit_card"||H?.type.code==="business_virtual_debit_card")){const Q=Ce(n.tenantEmailDomain,t,r,H,c);e(Q)}},[l.fetchState,c,G]),i.useEffect(()=>{O.fetchState!=="Completed"&&O.fetchState!=="In-Progress"&&d&&f&&C&&a(za()),P.fetchState!=="Completed"&&P.fetchState!=="In-Progress"&&d&&f&&C&&a($a()),V!=="Completed"&&V!=="In-Progress"&&a(ut())},[O.fetchState,P.fetchState,a,d,f,C,V]);const $=()=>{if(r!=null&&t!=null){a(Sa());const Q=Ce(n.tenantEmailDomain,t,r);e(Q)}},x=H?.type.code==="business_physical_debit_card"||H?.type.code==="business_virtual_debit_card",se=Re(d,g,D,f),ae=ma(d,f,C,O,P),ne=Ht(x,l);return l.fetchState!=="Completed"?s.jsx(Ke,{fetchState:"In-Progress"}):s.jsxs(s.Fragment,{children:[s.jsx(xa,{showConfetti:c}),s.jsx(ir,{onGotItClick:$,isDebitCard:H?.type.code==="business_physical_debit_card",controllerEmails:j,isChargeCardFeatureEnabled:d,isDebitCardFeatureEnabled:g,isDebitCardSetupEnabled:D,isChargeCardSetupEnabled:f,productInformation:se,creditAccountInformation:ae,debitAccountInformation:ne,chargeCardDetailView:l,creditAccount:O,classListFetchState:V,creditAccountRepayment:P,cardIssuedByRoles:K?.userRoles,cardIssuedByDepartmentName:L?.className,cardHolderRoles:R?.userRoles,cardHolderDepartmentName:E?.className})]})}const Ur=pe(function(e){const t=Ye(e);return{insightsData:t.insight,cashbackByPeriod:t.cashbackByPeriod,uiState:t.uiState,cashbackSummary:t.cashbackSummary}},function(e){return{onColumnSortConfigChanged:(t,a)=>{e(Wt({uiState:{sortKey:t,sortOrder:a}}))}}})(lr);function Rr(){const e=le(),t=ue(),a=ge(),r=X.getSignedInUser(),n=y(o=>ie(o)),[m,C]=i.useState(!1),p=y(o=>Ye(o)),S=i.useCallback(()=>{const o=ve(a.state?.pathnameStackToGoBack),c=o.poppedPathname??jr(n.tenantEmailDomain);e(c,{state:{pathnameStackToGoBack:o.newStack}})},[e,a,n.tenantEmailDomain]);if(i.useEffect(()=>{m||p.fetchState==="Completed"||p.fetchState==="In-Progress"||(C(!0),t(mt()))},[m,p,t]),r==null)throw Error("Can't access cashback detail page without signing in...");return p.fetchState==="In-Progress"?s.jsx(dr,{onBackClick:S}):p.cashbackSummary.cashbackEarned.amount===0&&p.fetchState==="Completed"?s.jsx(Oa,{}):s.jsx(Ur,{onBackClick:S})}const jr=e=>`/${e}/cards`,Nr={containerWidth:new ua(100,58)},Vr=({appContent:e})=>{const t=la(),a=ue(),r=le(),{cardId:n}=ia(),m=ge(),{useDynamicConfig:C}=ce(),[p,S]=i.useState(!1),[o,c]=i.useState(!1),[_,A]=i.useState(!1),[f,U]=i.useState(!1),F=X.getSignedInUser();if(F==null)throw Error("Can't access onboarding card page without signing in...");const k=y(E=>ie(E));if(n==null)throw Error("Empty card id is not valid...");const{configValue:h}=C(Fe.zeniCardsConfig),b=h.max_charge_card_activation_attempts_by_card_id,g=y(E=>qt(E,n)),d=g.chargeCard,D=y(E=>E.chargeCardConfigState.fetchState),{useFeatureGate:v}=ce(),{isFeatureEnabled:j}=v(Y.isChargeCardFeatureEnabled),{isFeatureEnabled:O}=v(Y.isDebitCardFeatureEnabled),P=Se(O,k),V=Ie({isDebitCardFeatureEnabled:O,isBankingOnlyTenant:P}),u=!!k.companyChargeCardInfo?.info?.isChargeCardEnabled,l=k.userRole.includes("charge_card_user"),w=be(k),T=ye(k),H=k.companyChargeCardInfo?.info?.chargeCardsCreditAccountLimit??0,B=Ae({isCardsOnlyTenant:w,isChargeCardFeatureEnabled:j,isBookKeepingTenant:T,isDebitCardProductVisible:V,chargeCardsCreditAccountLimit:H}),K=!l&&B&&u;i.useEffect(()=>{p===!1&&D!=="In-Progress"&&D!=="Completed"&&(a(Da()),S(!0)),o===!1&&g.fetchState==="Not-Started"&&(c(!0),a(Xe(n,K,B)))},[o,g.fetchState,p,D]);const I=d?.type.code==="business_physical_credit_card"||d?.type.code==="business_physical_debit_card";i.useEffect(()=>{if(g.fetchState==="Completed"){if(_===!1&&(I===!1||I&&d?.status?.code!=="inactive"||d?.cardHolderUserId!==F.userId)){const E=Ce(k.tenantEmailDomain,n,F,d,!0),G=fe(m.state?.pathnameStackToGoBack,m.pathname);r(E,{state:{pathnameStackToGoBack:G}})}else if(_&&g.isRefreshingViewInBackground===!1&&d?.status?.code==="active"){a(Jt({chargeCardId:n}));const E=Ce(k.tenantEmailDomain,n,F,d,!0),G=fe(m.state?.pathnameStackToGoBack,m.pathname);a(_a()),r(E,{state:{pathnameStackToGoBack:G}})}}},[g.fetchState,d?.type.code,_,g.isRefreshingViewInBackground]);const L=X.getZeniOtpTokenForCardHolder(n),N=y(E=>Ct(E.userState,F.userId)),R=()=>{d?.status?.code!=="active"&&a(Ga(n,!0))};i.useEffect(()=>{g.updatePhysicalChargeCardAttemptFetchState.fetchState==="Completed"&&d?.cardActivationAttemptHistory.some(E=>E.statusCode==="success")===!0&&_===!1&&(setTimeout(R,3e3),A(!0))},[g.updatePhysicalChargeCardAttemptFetchState.fetchState,d?.cardActivationAttemptHistory]);const W=E=>{U(E)};if(D!=="Completed"||d==null)return s.jsx(Ke,{fetchState:"In-Progress"});if(d.shippingAddressId==null)throw Error("Can't access shippingAddressId.");if(N?.phone==null)throw Error("Can't access user phone number.");return s.jsxs(zr,{children:[s.jsx(Ca,{isAppContentDrawerOpen:f,handleDrawerToggle:W}),s.jsx(Hr,{cardId:n,card:d,shippingAddressId:d.shippingAddressId,phone:N.phone,signedInUser:F,isSandboxEnv:Ka(),chargeCardDetailState:g,signedInUserToken:L,navigate:r,currentTenant:k,location:m,maxChargeCardActivationAttempts:b[n]!=null?b[n]:h.default_max_charge_card_activation_attempts!=null?h.default_max_charge_card_activation_attempts:3,chargeCardCashbackRatePerTransaction:h.charge_card_cashback_rate_per_transaction!=null?h.charge_card_cashback_rate_per_transaction:.0175,onClickMenuIcon:()=>{W(!0)}}),e!=null?s.jsx(Mr,{windowSize:t,children:e}):null]})},Hr=pe(function(e,{chargeCardDetailState:t,shippingAddressId:a,location:r,cardId:n}){const m=Qt(e.addressState,a);if(m==null)throw Error("Can't access shippingAddress.");const C=pt(e,n),p=t.updateStatus,S=Ze(e,!1,!1,!1);let o=!1;S.fetchState==="Completed"&&S.cards.length<=1&&(o=!0);const c=r.state?.message==="comingFromV2UrlPath";return{showActivatePage:t.chargeCard?.providerCardCreateTime!=null&&t.chargeCard.providerCardCreateTime.add(24,"h").isBefore(Xt())||c,showMenuIcon:o,shippingAddress:m,vgsVaultId:La.cardVaultId,twoFAView:C,activationWaitStatus:p,isRefreshingViewInBackground:t.isRefreshingViewInBackground}},function(e,t){const{navigate:a,cardId:r,location:n,currentTenant:m,chargeCardDetailState:C}=t,p=C.chargeCard?.cardProviderID,{tenantEmailDomain:S}=m;return{onGetOtp:o=>{p!=null&&e(Ta(o,"ChargeCardHolder",r))},onUpdatePhysicalChargeCardAttempt:o=>{e(an(r,o))},onResendOtp:o=>{p!=null&&e(Pa(o,"ChargeCardHolder",r))},onVerifyOtp:(o,c)=>{p!=null&&e(wa(o,c,"ChargeCardHolder",r))},onVerifyOtpSuccess:o=>{o!=null&&X.saveZeniOtpTokenForCardHolder(o,r)},onCVVActivateSuccess:()=>{e(en({chargeCardId:r}))},onBackClick:()=>{const o=ve(n.state?.pathnameStackToGoBack),c=o.poppedPathname==null||o.poppedPathname.includes("onboard")===!0?Ne(S):o.poppedPathname;a(c,{state:{pathnameStackToGoBack:o.newStack}})}}})(ur),Mr=_e.div`
|
|
2
2
|
display: flex;
|
|
3
3
|
flex-direction: column;
|
|
4
4
|
width: ${e=>`${Nr.containerWidth.value(e.windowSize)}%`};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{j as m}from"./liveblocks-
|
|
1
|
+
import{j as m}from"./liveblocks-B6wl2zlB.js";import{a as g}from"./sentry-Br5FXUqA.js";import{j as v,h as k,u as x,l as T,g as b,k as E}from"./core-BAyxh70Z.js";import{z as N,b1 as F,A as P,d as L,f as V,ab as O,b2 as j,ap as A,aq as U,s as B}from"./index-EjFBjGdj.js";import{eN as D,fB as _,rw as M,fw as R,c0 as z,Lv as G,bn as Y,pE as q,ps as H,j_ as Z,lu as S,Lw as $,bC as J,ct as C,lC as K,lF as Q}from"./zeni-epic-state-BviKG7zC.js";import"./mui-_J7ULT9g.js";import{c as W}from"./routePaths-DYIKJgSA.js";import{M as X}from"./MobileAppDrawer-dFU_MMpQ.js";(function(){try{var t=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},a=new t.Error().stack;a&&(t._sentryDebugIds=t._sentryDebugIds||{},t._sentryDebugIds[a]="8396202e-56b9-4b94-9107-d5eb383b0464",t._sentryDebugIdIdentifier="sentry-dbid-8396202e-56b9-4b94-9107-d5eb383b0464")}catch{}})();const ee=E(function(t){const a=R(t),i=N.getSignedInUser(),l=D(t),c=l.tenantId,p={userId:i?.userId??"",sessionId:i?.zeniSessionId??"",tenantId:c??""},f=z(l?.userRole??[])&&a.localData.updateStatus.fetchState!=="In-Progress"?void 0:"readonly",e=G(t.companyConfigState),n=t.countryListState?.byCountryListCode?.nationalityCountryList?.countries??[];return{isCompanyVerified:a.companyView?.company?.company?.companyBillPayInfo?.companyVerificationStatus?.code==="verified",companyPassportView:a,allIndustries:e.companyIndustries??[],allNationalityCountries:n,isDisabled:f,authParams:p,filesEndPoint:`${A.fileMicroServiceBaseUrl}`,isZeniUser:Y(i)}},function(t,a){const{companyId:i,currentTenant:l,navigate:c,location:p}=a,{tenantEmailDomain:f}=l;return{onScheduleClick:e=>{let n=e.href;n.includes("http")||(n="https://".concat(n)),window.open(n,"_blank")},onSaveAll:()=>{t(Q())},onAddressClick:e=>{const n=W(f,e),o=B(p.state?.pathnameStackToGoBack,p.pathname);c(n,{state:{pathnameStackToGoBack:o}})},onResetClick:()=>{t(K({companyId:i}))},onBackClick:()=>{c("../")},onCompanyDetailsChanged:e=>{const{companyInfo:n,incInfo:o,taxDetails:r,zeniFinanceTeam:d}=e,{website:u}=n,{meetingLink:y}=d,{incDate:s}=o,{taxesFiledYears:h}=r,w={companyInfo:{...n,website:u!=""&&u!=null?C(u):void 0,meetingLink:y!=""&&y!=null?C(y):void 0,industry:n.industry.selectedOption,companyIndustryType:n.companyIndustryType?.selectedOption??void 0,companySubIndustry:n.companySubIndustry?.selectedOption??void 0,businessModel:n.businessModel.selectedOption??"",companySourceOfFunds:n.companySourceOfFunds?.selectedOption,companySourceOfFundsDescription:n.companySourceOfFundsDescription??void 0,countriesOfOperations:n.countriesOfOperations?.selectedOptions?.map(I=>I.length===2?I:U(I))??[],transactionVolume:n.transactionVolume?.selectedOption??void 0,transactionVolumeDescription:n.transactionVolumeDescription??void 0,regulatedStatus:n.regulatedStatus??void 0,regulatedStatusDescription:n.regulatedStatusDescription??void 0,usNexus:n.usNexus??void 0,usNexusTypes:n.usNexusTypes?.selectedOptions??[],purposeOfAccount:n.purposeOfAccount?.selectedOption??void 0,purposeOfAccountDescription:n.purposeOfAccountDescription??void 0},incInfo:{typeOfInc:o.typeOfInc.selectedOption??"",stateOfInc:o.stateOfInc.selectedOption??"",incDate:s!=null?J(s?.toString()):s,fileId:o.fileIds[0]},taxDetails:{taxIdOrEIN:r.taxIdOrEIN,sicCode:r.sicCode,naicsCode:r.naicsCode,dunsNumber:r.dunsNumber,taxesFiledYears:h.selectedOptions.map(I=>parseInt(I)),fileId:r.fileIds[0]}};t(S({companyDetails:w}))},onPrimaryContactDetailsUpdated:e=>{t(S({primaryContact:{userId:e.userId,email:e.email.trim(),firstName:e.name.firstName,lastName:e.name.lastName}}))},onNewCompanyOfficerAdded:e=>{t(S({officers:[{officerType:e.officerType,email:e.email.trim(),phone:e.phone,firstName:e.name.firstName,lastName:e.name.lastName,userId:void 0}]}))},onNewCompanyOfficerRemoved:e=>{t($(e))},onCompanyOfficerUpdated:e=>{t(S({officers:[{officerType:e.officerType,email:e.email.trim(),phone:e.phone,firstName:e.name.firstName,lastName:e.name.lastName,userId:e.userId}]}))},updateFilesEntity:e=>{t(Z({files:e}))},onDeleteFile:e=>{t(H(e))},onEditFileName:(e,n)=>{t(q(e,n.split(".")[0]))}}})(j);function de(){const t=v(),a=k(),i=x(),{tenantEmailDomain:l}=T(),[c,p]=g.useState(!1),[f,e]=g.useState(!1),n=b(s=>s.companyViewState.passportView.fetchState),o=b(s=>s.companyConfigState.fetchState),r=b(s=>D(s)),d=r.companyId??N.getSignedInUserTenant(l)?.companyId;if(N.getSignedInUser()==null)throw Error("Can't access company details page without signing in...");g.useEffect(()=>{c||n!=="Not-Started"||d==null||(p(!0),a(_(d)))},[c,n,d,a]),g.useEffect(()=>{o==="Not-Started"&&a(M())},[o,a]);const u=s=>{e(s)},y=n==="Not-Started"||n==="In-Progress"||o==="Not-Started"||o==="In-Progress";return d!=null&&n==="Error"?m.jsx(F,{onGoHome:()=>t("../",{replace:!0}),onReload:()=>window.location.reload()}):m.jsxs(m.Fragment,{children:[m.jsx(P,{analytics:L,onLoad:s=>s.trackPageLoaded(V.Event.companyPassport,O(i)?"Settings":"Company Passport")}),O(i)?m.jsx(X,{isAppContentDrawerOpen:f,handleDrawerToggle:u}):null,m.jsx(ee,{companyId:d,navigate:t,location:i,isLoading:y,currentTenant:r,isSettings:O(i),onClickMenuIcon:()=>{u(!0)}})]})}export{de as C};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{j as C}from"./liveblocks-
|
|
1
|
+
import{j as C}from"./liveblocks-B6wl2zlB.js";import{a}from"./sentry-Br5FXUqA.js";import{h as D,u as v,g as m,N as w}from"./core-BAyxh70Z.js";import{Ig as O,eN as A,fi as _,ml as U,fK as E,fh as j,eO as L,In as F}from"./zeni-epic-state-BviKG7zC.js";import{u as $,z as u,L as g,D as k,o as H}from"./index-EjFBjGdj.js";import{n as z}from"./mui-_J7ULT9g.js";import{t as R}from"./getLocaleForTenant-CTxSISA1.js";import{g as P,Q as G}from"./QBOConnectionScreen-vJPPBcm2.js";import"./recharts-BAmCdxCr.js";import"./analytics-CahmTVDu.js";import"./plaid-BGvkfr4M.js";import"./dnd-BSIjjfrd.js";import"./stripe-DMRn4zHo.js";import"./lottie-BANYn_n3.js";import"./lexical-0b05ScDc.js";import"./pdf-b6pQct0d.js";import"./utils-D7Q_r6EF.js";import"./empty-B-ys610U.js";import"./pdf-lib-DX5EW-ja.js";import"./index-C9lUuMK6.js";import"./url-6eZuId4d.js";import"./index-D27MUyWe.js";import"./decodeURIComponentSafe-Do2kSkVE.js";(function(){try{var t=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},i=new t.Error().stack;i&&(t._sentryDebugIds=t._sentryDebugIds||{},t._sentryDebugIds[i]="f8f6cb81-5e78-403d-a489-46afc299ebc0",t._sentryDebugIdIdentifier="sentry-dbid-f8f6cb81-5e78-403d-a489-46afc299ebc0")}catch{}})();const K=z.div`
|
|
2
2
|
display: flex;
|
|
3
3
|
flex: 1 1 auto;
|
|
4
4
|
flex-direction: row;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{j as d}from"./liveblocks-B6wl2zlB.js";import{z as n}from"./index-EjFBjGdj.js";import{g as p}from"./QBOConnectionScreen-vJPPBcm2.js";import"./sentry-Br5FXUqA.js";import{u as a,N as i}from"./core-BAyxh70Z.js";import"./zeni-epic-state-BviKG7zC.js";import"./recharts-BAmCdxCr.js";import"./mui-_J7ULT9g.js";import"./analytics-CahmTVDu.js";import"./plaid-BGvkfr4M.js";import"./dnd-BSIjjfrd.js";import"./stripe-DMRn4zHo.js";import"./lottie-BANYn_n3.js";import"./lexical-0b05ScDc.js";import"./pdf-b6pQct0d.js";import"./utils-D7Q_r6EF.js";import"./empty-B-ys610U.js";import"./pdf-lib-DX5EW-ja.js";import"./index-C9lUuMK6.js";import"./url-6eZuId4d.js";import"./index-D27MUyWe.js";import"./decodeURIComponentSafe-Do2kSkVE.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]="b68d0d57-e81d-4cfb-97e6-d4dd5e5b7ebd",t._sentryDebugIdIdentifier="sentry-dbid-b68d0d57-e81d-4cfb-97e6-d4dd5e5b7ebd")}catch{}})();const U=()=>{const t=a(),{code:o,realmId:r,state:e}=p(t.search),s=n.getSignedInUser()?.userId??"";if(f(o,r,e,s)===!0){const m=`../../${e}/onboarding?code=${o}&realmId=${r}&state=auth_flow`;return d.jsx(i,{to:m})}return d.jsx(i,{to:"../../"})},f=(t,o,r,e)=>t!=""&&o!=""&&r!=""&&e!=null&&e!="";export{U as default,f as hasValidParams};
|
package/dist/assets/{CustomerOnboardingRoutes-COxgmIX3.js → CustomerOnboardingRoutes-BwRSYAqT.js}
RENAMED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{j as a}from"./liveblocks-
|
|
1
|
+
import{j as a}from"./liveblocks-B6wl2zlB.js";import{t as $e,A as Ce}from"./AddressScreen-1oCzT4yV.js";import ze from"./NotFoundScreen-CkYvqje3.js";import{a as g}from"./sentry-Br5FXUqA.js";import{j as oe,u as se,h as ie,l as re,g as D,N as x,k as ce,i as Me,n as qe,o as M}from"./core-BAyxh70Z.js";import{v as de,j as le,z as B,a as ue,h as Je,p as _,s as V,A as H,d as N,B as we,f as X,al as Ke,q as Qe,am as Ie,k as te,an as Ze,ao as ke,o as He,ap as We,aq as xe,ar as Xe}from"./index-EjFBjGdj.js";import{bn as Ye,eN as ee,fa as et,eT as pe,eR as me,bv as tt,mj as at,f6 as nt,bM as ot,j2 as ae,j5 as ve,I_ as st,bR as it,c0 as ge,rK as he,rv as rt,Ja as Y,rL as _e,GH as ct,k6 as Ue,Jb as Ve,Jc as dt,Jd as lt,Je as ut,j0 as pt,j3 as mt,rx as Be,rJ as gt,bC as Ee,ct as ht,rX as Te,pE as ft,ps as yt,j_ as St,fz as bt,fy as Ct,fx as It,Jf as kt,rp as xt,rY as Et,r$ as Tt,s2 as Ot,s8 as Pt,cS as At}from"./zeni-epic-state-BviKG7zC.js";import{n as fe}from"./mui-_J7ULT9g.js";import{g as Dt,h as Ft,q as ne}from"./QBOConnectionScreen-vJPPBcm2.js";import"./recharts-BAmCdxCr.js";import"./analytics-CahmTVDu.js";import"./plaid-BGvkfr4M.js";import"./dnd-BSIjjfrd.js";import"./stripe-DMRn4zHo.js";import"./lottie-BANYn_n3.js";import"./lexical-0b05ScDc.js";import"./pdf-b6pQct0d.js";import"./utils-D7Q_r6EF.js";import"./empty-B-ys610U.js";import"./pdf-lib-DX5EW-ja.js";import"./index-C9lUuMK6.js";import"./url-6eZuId4d.js";import"./index-D27MUyWe.js";import"./decodeURIComponentSafe-Do2kSkVE.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]="94497845-8e2d-474e-8c38-1d8203771543",t._sentryDebugIdIdentifier="sentry-dbid-94497845-8e2d-474e-8c38-1d8203771543")}catch{}})();const jt=ce(function(t,o){const s=[];o.isApAgingFeatureEnabled===!1&&s.push("accounts_payable_aging"),o.isArAgingFeatureEnabled===!1&&s.push("accounts_receivable_aging"),o.shouldFetchZeniAccountsPromoCard===!1&&s.push("zeni_accounts_promo_card"),o.shouldFetchRewardsPlanCard===!1&&s.push("rewards_card"),o.isExpenseAutomationEnabledForUser===!1&&s.push("expense_automation_card");const u=nt(t,s,o.signedInUser,o.isExpenseAutomationFeatureEnabledV2,o.isExpenseAutomationEnabledForUser,o.isTreasuryEnabled);return{dashboardFetchState:ot(u.reportsInOrder.map(d=>({fetchState:d.fetchState,error:d.error}))).fetchState}},function(t,o){const{themeState:s,navigate:u,location:d}=o;return{onZeniLogoClick:()=>{s.toggle()},onDashboardFetchDone:()=>{const r=V(d.state?.pathnameStackToGoBack,d.pathname);u("../../dashboard",{state:{pathnameStackToGoBack:r,message:"activation"}})}}})(Ke),wt=()=>{const t=oe(),o=se(),s=ie(),u=de(),[d,r]=g.useState(!1),[p,S]=g.useState(!1),{tenantEmailDomain:e}=re(),n=le(),i=B.getSignedInUser(),h=Ye(i),{useFeatureGate:m}=ue(),k=Je(),{isFeatureEnabled:E}=m(_.isApAgingFeatureEnabled),{isFeatureEnabled:T}=m(_.isArAgingFeatureEnabled),{isFeatureEnabled:I}=m(_.isDepositAccountsFeatureEnabled),{isFeatureEnabled:f}=m(_.isReferralFeatureEnabled),{isFeatureEnabled:U}=m(_.isExpenseAutomationEnabled),{isFeatureEnabled:C}=m(_.isExpenseAutomationEnabledV2),{isFeatureEnabled:F}=m(_.isDebitCardFeatureEnabled),$=C||U&&h,c=D(l=>ee(l)),{isFeatureEnabled:L}=m(_.isTreasuryEnabled),j=c.company!=null&&et(c.company),R=L&&j,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 w=pe(F,c),P=me(c),A=[],K=b?.resources?.find(l=>l.resource==="/reports/top_expenses")==null,z=b?.resources?.find(l=>l.resource==="/reports/task_card")==null,q=c?.userRole!=null&&tt(c?.userRole),v=b?.resources?.find(l=>l.resource==="/bills")==null&&!q,J=b?.resources?.find(l=>l.resource==="/reimbursements")==null;if(K===!1&&A.push("top_expenses"),z===!1&&A.push("task_card"),v===!1&&A.push("bill_pay_card","bill_pay_promo_card"),J===!1&&A.push("reimbursement_card","reimbursement_promo_card"),I===!1&&A.push("zeni_accounts_promo_card"),f===!1&&A.push("rewards_card"),g.useEffect(()=>{O!=="Completed"||d||w||P||(r(!0),s(at(i.userId,G,c.tenantId,!0,!1,A)))},[d,O,w,P,i,c.tenantId,s]),g.useEffect(()=>{(w||P)&&setTimeout(()=>{S(!0)},5e3)},[w,P]),O!=="Completed")return a.jsx(x,{to:"../"});if(O==="Completed"&&p){const l=V(o.state?.pathnameStackToGoBack,o.pathname);if(w)return a.jsx(x,{to:"../../checking",state:{...o.state,pathnameStackToGoBack:l,message:"activation"}});if(P)return a.jsx(x,{to:"../../cards",state:{...o.state,pathnameStackToGoBack:l,message:"activation"}})}return n?.loggedInUserRoleMap!=null?a.jsxs(a.Fragment,{children:[a.jsx(H,{analytics:N,onLoad:l=>(Q=>Q.trackPageLoaded(X.Event.onboardingDashboardActivation))(l)}),a.jsx(jt,{navigate:t,location:o,themeState:u,signedInUser:i,isApAgingFeatureEnabled:E,isArAgingFeatureEnabled:T,shouldFetchZeniAccountsPromoCard:I,shouldFetchRewardsPlanCard:f,isExpenseAutomationEnabledForUser:$,isExpenseAutomationFeatureEnabledV2:C,isTreasuryEnabled:R,loggedInUserRoleMap:n?.loggedInUserRoleMap})]}):a.jsx(we,{fetchState:"In-Progress",style:{backgroundColor:k.colors.grey5}})},Oe=fe.div`
|
|
2
2
|
display: flex;
|
|
3
3
|
height: 100vh;
|
|
4
4
|
background-color: ${t=>t.theme.colors.grey4};
|