@zeniai/web-app-ui 5.0.98-dev → 5.0.98-qa

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (60) hide show
  1. package/dist/assets/{AddressRoutes-DDaIV4eZ.js → AddressRoutes-CZnINFd1.js} +1 -1
  2. package/dist/assets/{AddressScreen-DxaubiXq.js → AddressScreen-CWbRsmbp.js} +1 -1
  3. package/dist/assets/{AiCfoScreen-m8Zgq_GS.js → AiCfoScreen-ByJaMYdf.js} +1 -1
  4. package/dist/assets/{BillPayApprovalRoutes-B4r-0-50.js → BillPayApprovalRoutes-B3i4J9uo.js} +1 -1
  5. package/dist/assets/{BillPayRoutes-DQzlGeQi.js → BillPayRoutes-6NMIykXi.js} +1 -1
  6. package/dist/assets/{BusinessVerificationPageScreen-BIrHn3fq.js → BusinessVerificationPageScreen-CKWDQbki.js} +1 -1
  7. package/dist/assets/{ChargeCardRoutes-Qksh7aEY.js → ChargeCardRoutes-CuET-m0-.js} +1 -1
  8. package/dist/assets/{CompanyPassportScreen-Bh0KRqU9.js → CompanyPassportScreen-gi1zQDQy.js} +1 -1
  9. package/dist/assets/{ConnectionAuthScreen-9JU_wknG.js → ConnectionAuthScreen-De-vuICZ.js} +1 -1
  10. package/dist/assets/{CustomerOnboardingAuthScreen-Bmz9Q3W4.js → CustomerOnboardingAuthScreen-Cm9qzjcw.js} +1 -1
  11. package/dist/assets/{CustomerOnboardingRoutes-X_ZDpwiP.js → CustomerOnboardingRoutes-3ZdetMQC.js} +1 -1
  12. package/dist/assets/{DashboardRoutes-BogZbtoT.js → DashboardRoutes-B4iMdus4.js} +1 -1
  13. package/dist/assets/{DefaultTenantHome-Q-dqiquI.js → DefaultTenantHome-CmtmKMal.js} +1 -1
  14. package/dist/assets/{DomesticWireDetailScreen-BY-jUiMw.js → DomesticWireDetailScreen-i5P7thz2.js} +1 -1
  15. package/dist/assets/{DrawerScreen-Drpask10.js → DrawerScreen-8pLwC76h.js} +1 -1
  16. package/dist/assets/{EntityDetailRoutes-CbdIl_vZ.js → EntityDetailRoutes-Dr3SOu7N.js} +1 -1
  17. package/dist/assets/{ExpenseAutomationRoutes-DtnWFchZ.js → ExpenseAutomationRoutes-TQM73kS9.js} +1 -1
  18. package/dist/assets/{FeaturePreviewScreen-DvNQU3gG.js → FeaturePreviewScreen-C1MJa7gv.js} +1 -1
  19. package/dist/assets/{HubSpotOAuthCallbackScreen-DQMaXQ2W.js → HubSpotOAuthCallbackScreen-B7ampOQu.js} +1 -1
  20. package/dist/assets/{MagicLinkRoutes-TtaU4o7n.js → MagicLinkRoutes-NEjpbABr.js} +1 -1
  21. package/dist/assets/{MagicLinkSignInScreen-ZdC4mZB_.js → MagicLinkSignInScreen-CosgA8eP.js} +1 -1
  22. package/dist/assets/{MobileAppDrawer-BkelcJG3.js → MobileAppDrawer-n526oWrk.js} +1 -1
  23. package/dist/assets/{NotFoundScreen-Dpz39bup.js → NotFoundScreen-Brpo5hIh.js} +1 -1
  24. package/dist/assets/{NotificationRoutes-DMPt7wnb.js → NotificationRoutes-VqdMKuyJ.js} +1 -1
  25. package/dist/assets/{OAuthConsentScreen-CUDMrd3J.js → OAuthConsentScreen-BB710FHj.js} +1 -1
  26. package/dist/assets/{PandLWithForecastRoutes-gaSgTRi0.js → PandLWithForecastRoutes-ZxQLGrNQ.js} +1 -1
  27. package/dist/assets/{PeopleRoutes-ulChxGY4.js → PeopleRoutes-CAPFlXeC.js} +1 -1
  28. package/dist/assets/{PerformanceRoutes-FHM73Dcm.js → PerformanceRoutes-DRea1YUE.js} +1 -1
  29. package/dist/assets/{QBOConnectionScreen-CPvxeBk6.js → QBOConnectionScreen-DvvmYU71.js} +1 -1
  30. package/dist/assets/{ReferralListScreen-D2RlSd8S.js → ReferralListScreen-D8LbwXaw.js} +1 -1
  31. package/dist/assets/{ReimbursementApprovalRoutes-ClT51Soc.js → ReimbursementApprovalRoutes-DRpummvD.js} +1 -1
  32. package/dist/assets/{ReimbursementApprovalRuleDetailScreen-Ck-1sOnS.js → ReimbursementApprovalRuleDetailScreen-DqylTjul.js} +1 -1
  33. package/dist/assets/{ReimbursementRoutes-D9TuG6Wi.js → ReimbursementRoutes-Ck-7Lo_C.js} +1 -1
  34. package/dist/assets/{ReportsRoutes-B8B68Eos.js → ReportsRoutes-Cmht3lbb.js} +1 -1
  35. package/dist/assets/{RewardsRoutes-C2gyLmQq.js → RewardsRoutes-PWORm-gP.js} +1 -1
  36. package/dist/assets/{ScreenRoutes-CrkYMUz1.js → ScreenRoutes-CA8fUnaP.js} +2 -2
  37. package/dist/assets/{SettingsRoutes-CpAwrhPW.js → SettingsRoutes-Dni4ADoP.js} +1 -1
  38. package/dist/assets/{SetupPagesScreen-NIC2w04g.js → SetupPagesScreen-_IKYoHXM.js} +1 -1
  39. package/dist/assets/{SignInScreen-_pR-7wM2.js → SignInScreen-RaghIVhM.js} +1 -1
  40. package/dist/assets/{SignOutScreen-BPL7WsWD.js → SignOutScreen-CNkJNt7x.js} +1 -1
  41. package/dist/assets/{TaskListScreen-tKxgJp9M.js → TaskListScreen-D8kgWT4b.js} +1 -1
  42. package/dist/assets/{TaskRoutes-CnDOH5U1.js → TaskRoutes-Cz1ZyHoB.js} +1 -1
  43. package/dist/assets/{TransactionDetailRoutes-AzvoZbPr.js → TransactionDetailRoutes-63tKIp6E.js} +1 -1
  44. package/dist/assets/{TransactionDetailScreen-VjAJduyc.js → TransactionDetailScreen-DioDP0gW.js} +1 -1
  45. package/dist/assets/{TransactionListRoutes-DAers0Rg.js → TransactionListRoutes-Dtm4HNMN.js} +1 -1
  46. package/dist/assets/{TreasuryRoutes-jwSS6VHf.js → TreasuryRoutes-BhRZ97cm.js} +1 -1
  47. package/dist/assets/{VendorsRoutes-BVKYJ6yV.js → VendorsRoutes-ODAB2xhO.js} +1 -1
  48. package/dist/assets/{WiseConfirmationScreen-Bp7k95gU.js → WiseConfirmationScreen-BXqYXseQ.js} +1 -1
  49. package/dist/assets/{ZeniAccountRoutes-9-ipmrl8.js → ZeniAccountRoutes-RdAjME8K.js} +1 -1
  50. package/dist/assets/{ZeniAccountStatementScreen-CYFmOZM9.js → ZeniAccountStatementScreen-Dh6yAFkp.js} +1 -1
  51. package/dist/assets/{analyticsHelper-StfDTSGk.js → analyticsHelper-CnXSrEd_.js} +1 -1
  52. package/dist/assets/{getLocaleForTenant-JJvZDWEQ.js → getLocaleForTenant-B-vHrKHL.js} +1 -1
  53. package/dist/assets/{index-BcoFhJ4O.js → index-Sm9Ycasn.js} +5 -5
  54. package/dist/assets/{routePaths-BPSPu97F.js → routePaths-Pqm-PNC8.js} +1 -1
  55. package/dist/assets/{useAiCfoDashboardSuggestedQuestionsChips-CRHV9fCR.js → useAiCfoDashboardSuggestedQuestionsChips-CUpKl9RP.js} +1 -1
  56. package/dist/assets/{useAskAiCfoHostNavButtonProps-HZkyXVvQ.js → useAskAiCfoHostNavButtonProps-B40bGqEV.js} +1 -1
  57. package/dist/assets/{useInitialThreadRequest-Ro9Y0en9.js → useInitialThreadRequest-ELLLToSA.js} +1 -1
  58. package/dist/assets/{withTransactionSidePanel-Bez35evJ.js → withTransactionSidePanel-Dk7__fUW.js} +1 -1
  59. package/dist/index.html +1 -1
  60. package/package.json +1 -1
@@ -1 +1 @@
1
- import{j as e}from"./liveblocks-D1TxH59e.js";import{A as d}from"./AddressScreen-DxaubiXq.js";import i from"./NotFoundScreen-Dpz39bup.js";import"./sentry-5pTQe3BK.js";import{o as s,p as r}from"./core-Fwwp8hop.js";import"./zeni-epic-state-i1VxNGkd.js";import"./recharts-DuOI9Nsb.js";import"./index-BcoFhJ4O.js";import"./mui-Dar_oGjJ.js";import"./analytics-D310XSjQ.js";import"./plaid-BGhwh8RZ.js";import"./dnd-B_nt-Uf4.js";import"./stripe-DMRn4zHo.js";import"./lottie-BGeomX3N.js";import"./lexical-D4DqnnDh.js";import"./pdf-BftxTBXg.js";import"./utils-3_hFkWEq.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]="4677917c-1bd8-4b00-9bd0-d308073173a3",t._sentryDebugIdIdentifier="sentry-dbid-4677917c-1bd8-4b00-9bd0-d308073173a3")}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
+ import{j as e}from"./liveblocks-D1TxH59e.js";import{A as d}from"./AddressScreen-CWbRsmbp.js";import i from"./NotFoundScreen-Brpo5hIh.js";import"./sentry-5pTQe3BK.js";import{o as s,p as r}from"./core-Fwwp8hop.js";import"./zeni-epic-state-i1VxNGkd.js";import"./recharts-DuOI9Nsb.js";import"./index-Sm9Ycasn.js";import"./mui-Dar_oGjJ.js";import"./analytics-D310XSjQ.js";import"./plaid-BGhwh8RZ.js";import"./dnd-B_nt-Uf4.js";import"./stripe-DMRn4zHo.js";import"./lottie-BGeomX3N.js";import"./lexical-D4DqnnDh.js";import"./pdf-BftxTBXg.js";import"./utils-3_hFkWEq.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]="4677917c-1bd8-4b00-9bd0-d308073173a3",t._sentryDebugIdIdentifier="sentry-dbid-4677917c-1bd8-4b00-9bd0-d308073173a3")}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 n}from"./liveblocks-D1TxH59e.js";import{a as h}from"./sentry-5pTQe3BK.js";import{h as T,u as _,g as j,i as E,j as K,n as B}from"./core-Fwwp8hop.js";import{J as M,h as $,z as D,k as L,q as R,H as z,c as C,e as m,W as F,i as b,p as N}from"./index-BcoFhJ4O.js";import{K8 as k,g_ as U,eP as q,K9 as G,c2 as H,Ka as O,kj as V}from"./zeni-epic-state-i1VxNGkd.js";import{n as J}from"./mui-Dar_oGjJ.js";import W from"./NotFoundScreen-Dpz39bup.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]="695580be-2930-4051-b136-714845200769",e._sentryDebugIdIdentifier="sentry-dbid-695580be-2930-4051-b136-714845200769")}catch{}})();const Q=J.div`
1
+ import{j as n}from"./liveblocks-D1TxH59e.js";import{a as h}from"./sentry-5pTQe3BK.js";import{h as T,u as _,g as j,i as E,j as K,n as B}from"./core-Fwwp8hop.js";import{J as M,h as $,z as D,k as L,q as R,H as z,c as C,e as m,W as F,i as b,p as N}from"./index-Sm9Ycasn.js";import{K8 as k,g_ as U,eP as q,K9 as G,c2 as H,Ka as O,kj as V}from"./zeni-epic-state-i1VxNGkd.js";import{n as J}from"./mui-Dar_oGjJ.js";import W from"./NotFoundScreen-Brpo5hIh.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]="695580be-2930-4051-b136-714845200769",e._sentryDebugIdIdentifier="sentry-dbid-695580be-2930-4051-b136-714845200769")}catch{}})();const Q=J.div`
2
2
  display: flex;
3
3
  height: 100vh;
4
4
  width: 100%;
@@ -1,4 +1,4 @@
1
- import{j as c}from"./liveblocks-D1TxH59e.js";import{a as r}from"./sentry-5pTQe3BK.js";import{u as ge,h as Ce,g as be,j as J,i as Ie,n as ke}from"./core-Fwwp8hop.js";import{T as we,z as xe,J as Pe,cQ as Ee,cR as Te,b4 as K,cS as Qe,b3 as Z,p as R,H as L,c as b,cT as F,cU as ve,cV as ye,a1 as _e,e as Oe,a7 as Ae,cW as Ue,a2 as je,m as Le,b0 as Fe,cX as De}from"./index-BcoFhJ4O.js";import{fI as Re,eO as ee,eP as Be,hE as Me,QL as Ve,eS as Ge,hO as $e,hK as Ne,eQ as D,ft as qe,fm as We,fq as X,fu as ze,fv as He,fw as Je,fx as Ke,fy as Xe}from"./zeni-epic-state-i1VxNGkd.js";import{D as Ye,n as I,S as Ze,P as et}from"./mui-Dar_oGjJ.js";import{u as tt}from"./useAiCfoDashboardSuggestedQuestionsChips-CRHV9fCR.js";import{p as st}from"./pathToGoBack-CFMq10u8.js";import"./recharts-DuOI9Nsb.js";import"./analytics-D310XSjQ.js";import"./plaid-BGhwh8RZ.js";import"./dnd-B_nt-Uf4.js";import"./stripe-DMRn4zHo.js";import"./lottie-BGeomX3N.js";import"./lexical-D4DqnnDh.js";import"./pdf-BftxTBXg.js";import"./utils-3_hFkWEq.js";(function(){try{var a=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},i=new a.Error().stack;i&&(a._sentryDebugIds=a._sentryDebugIds||{},a._sentryDebugIds[i]="ccfecbb2-b4ff-4edd-ab0a-009015d992bc",a._sentryDebugIdIdentifier="sentry-dbid-ccfecbb2-b4ff-4edd-ab0a-009015d992bc")}catch{}})();const te="chat-response-generated",ot=ke(function(a,i){const s=ee(a),m=i.isSubmitting;return{showSampleQuestions:i.sessionFromUrl==="explore"&&s.uiState.currentChatSessionId==null,aiCfoView:s,isSubmitting:m,isNewChatSession:i.sessionFromUrl==="new_chat"||i.sessionFromUrl==="explore",isFullView:!0,tableDownloadEndPoint:`${je}/tableDownload`,emailLinkQuestion:i.emailLinkQuestion,autoSubmitEmailLinkQuestion:i.autoSubmitEmailLinkQuestion,onEmailLinkQuestionProcessed:i.onEmailLinkQuestionProcessed,routedInitialQuestionSource:i.routedInitialQuestionSource,routedInitialQuestionSuggestionIndex:i.routedInitialQuestionSuggestionIndex,exploreSuggestedPromptQuestions:i.exploreSuggestedPromptQuestions,exploreSuggestedPromptQuestionsLoading:i.exploreSuggestedPromptQuestionsLoading,isFileUploadEnabled:i.isFileUploadEnabled,isUploadPromoVisible:i.isUploadPromoVisible,onUploadPromoClose:i.onUploadPromoClose}},function(a,i){const{location:s,currentTenant:m,userId:l,navigate:S,currentChatSessionId:h,allSessionsWithOrderedQuestionAnswers:d,setIsAiCfoOpen:f}=i;return{onEventReceived:(e,p)=>{if(e===te&&typeof p.text=="string"&&typeof p.metadata=="object"){const o=p,u=He(o.type),t=o.metadata.chat_session_id??null,{currentChatSession:E,currentQuestionAnswer:k,currentQuestionAnswerSummary:T}=Z(d,t);u!=="answer"?b.trackAICFOChatResponseGenerated(u,k?.question.questionText??"",o.text,t,De(T,E),o.metadata.message_id??null):b.trackAICFOChatAnswerGenerated(o.text,k?.question.questionText??"",(o.follow_up_questions?.length??0)>0,!!o.assumptions,!!o.insights,o.visualization!=null,Je(o.visualization?.type??"")??null,t,o.summarized_title,o.metadata.message_id??null),a(Ke({chatSessionId:o.metadata.chat_session_id,responseType:u,fetchState:{fetchState:"Completed",error:void 0}})),a(Xe({chatSessionId:o.metadata.chat_session_id,answerPayload:o,userId:l}))}},onSubmit:(e,p,o,u)=>{e&&Fe(a,e,p,h,d,l,u,o)},updateCurrentInput:e=>{a(X(e))},onStopSubmit:()=>{},onUpdateScrollYOffset:e=>{a(ze(e))},onSelectSampleQuestion:()=>{},onBackClick:()=>{S(-1)},onCloseClick:()=>{const e=R(s.state?.pathnameStackToGoBack),p=e.poppedPathname??st(1);S(p,{state:{...s.state,pathnameStackToGoBack:e.newStack}}),a(X(""))},togglePageView:()=>{const e=R(s.state?.pathnameStackToGoBack),p=e.poppedPathname??`/${m.tenantEmailDomain}/dashboard`;S(p,{state:{...s.state,pathnameStackToGoBack:e.newStack,message:"open_ai_cfo_drawer"}}),f(!0)},onCopy:()=>{},onThumbsUp:()=>{},onThumbsDown:()=>{},onTogglePageView:()=>{S(-1)},onNewChatClick:()=>{h!=null&&a(We());const e=Le(s.state?.pathnameStackToGoBack,s.pathname);S(`/${m.tenantEmailDomain}/ai-cfo/new_chat`,{state:{pathnameStackToGoBack:e.slice(0,-1),referrer:"Sidebar"}})},onToggleCotCollapsed:(e,p)=>{a(qe({questionAnswerId:e,isCollapsed:p}))},onMenuClick:i.onMenuClick}})(Ae(Ue)),Et=({isFileUploadEnabled:a})=>{const{setIsAiCfoOpen:i}=we(),s=ge(),m=Ce(),l=be(),[S,h]=r.useState(!1);r.useEffect(()=>{s(Re())},[s]);const d=J(n=>ee(n)),f=xe.getSignedInUser(),{session_id:e}=Ie(),p=Pe(),o=_e(p),u=J(n=>Be(n)),t=d.uiState.currentChatSessionId,E=u.tenantEmailDomain,{handleUploadPromoClose:k,isUploadPromoVisible:T}=Ee({isFileUploadEnabled:a,tenantEmailDomain:E}),Q=Te({currentTenant:u,currentChatSessionId:t,aiCfoView:d}),{isSuggestedQuestionsLoading:se,suggestedPromptQuestions:oe}=tt(),w=l.state,x=w?.aiCfoInitialQuestion,B=!!w?.aiCfoShouldSubmit;r.useEffect(()=>{const n=l.state;if(n?.[K]!==!0)return;h(!0);const g={...n};delete g[K],m(l,{replace:!0,state:g})},[l.pathname,l.search,l.state,m]);const[ae,v]=r.useState(null),[ne,y]=r.useState(!1),[ie,_]=r.useState(void 0),[re,O]=r.useState(void 0),M=r.useRef(!1);r.useEffect(()=>{if(!M.current&&x!=null&&x!==""){const n=l.state;v(x),y(B),_(n?.aiCfoInitialSubmissionSource!=null?n.aiCfoInitialSubmissionSource:void 0);const g=n?.aiCfoSuggestionIndex;O(typeof g=="number"?g:void 0),M.current=!0}},[x,B,l.state]);const le=r.useCallback(()=>{v(null),y(!1),_(void 0),O(void 0)},[]),V=r.useMemo(()=>new URLSearchParams(l.search),[l.search]),G=V.get("ref")??w?.aiCfoRef,A=V.get("emailRefId")??w?.aiCfoEmailRefId,$=r.useRef(!1);r.useEffect(()=>{$.current||G!=="month-end-email"||A==null||t!=null||f==null||(s(Me("controller",f.userId,A,"MONTH_END_EMAIL")),$.current=!0)},[G,A,t,s,f]);const P=d.uiState.lastContextMessage;r.useEffect(()=>{P!=null&&P!==""&&t!=null&&(v(P),y(!0),_(void 0),O(void 0),s(Ve()))},[P,t,s]);const ce=u.masterTOSInfo,C=ce?.isMasterTOSAccepted??!1,{visitedSessions:N}=Qe(t),U=d.fetchState,j=d.uiState.chatSessionsNextPageToken.hasMore||!d.uiState.chatSessionsFirstPageFetched,q=t!=null?d.fetchChatSessionHistoryByChatSessionId?.[t]?.fetchState??"Not-Started":"Not-Started",W=t==null||(d.uiState.chatHistoryNextPageToken[t]?.hasMore??!0),z=d.allSessionsWithOrderedQuestionAnswers,{currentSessionQuestionAnswers:ue}=Z(z,t),de=ue.length===0;r.useEffect(()=>{C||o||m("../dashboard",{state:{...l.state,message:"open_ai_cfo_drawer"}})},[C,o,m,l.state]);const me=r.useCallback(()=>{const n=R(l.state?.pathnameStackToGoBack),g=u.tenantEmailDomain;m(n.poppedPathname??(g!=null?`/${g}/dashboard`:".."),{state:{...l.state,pathnameStackToGoBack:n.newStack}})},[u.tenantEmailDomain,l.state,m]);r.useEffect(()=>{t!=null&&e!==t&&m(`../ai-cfo/${t}`,{state:{...l.state}})},[t,e]),r.useEffect(()=>{e!=null&&t==null&&e!=="new_chat"&&e!=="explore"&&s(Ge({sessionId:e,agentId:"controller"}))},[]);const pe=r.useMemo(()=>({events:N.map(n=>`private-encrypted-chat-${n}.${te}`),eventCallback:(n,g,fe)=>fe.onEventReceived(n,g)}),[N]);r.useEffect(()=>{U!=="In-Progress"&&j&&s($e())},[U,j,s]),r.useEffect(()=>{t!=null&&q!=="In-Progress"&&W&&f!=null&&U==="Completed"&&!j&&s(Ne(t,f.userId))},[q,W,t,f,s]);const H=n=>n.trackAICFOOnboardingScreenStateChanged("open","first_visit");if(f==null||e==null)throw Error("Can't access AI Controller page without signing in...");const he=t!=null&&d.responseStateByChatSessionId?.[t]?.answer?.fetchState==="In-Progress";if(!C&&o)return c.jsxs(nt,{children:[c.jsx(L,{analytics:b,onLoad:H}),Q.drawerElement,c.jsx(it,{children:c.jsx(Y,{children:c.jsx(F,{isTOSAccepted:!1,acceptMasterTOSState:d.masterTOSAcceptanceState,onCloseClick:me,onCompleteClick:()=>{u.userRoleId!=null&&s(D(u.userRoleId))}})})})]});const Se=c.jsxs(c.Fragment,{children:[S&&!C?c.jsx(L,{analytics:b,onLoad:H}):null,c.jsx(F,{isTOSAccepted:C,acceptMasterTOSState:d.masterTOSAcceptanceState,showHeader:!1,togglePageView:C?()=>h(!1):void 0,onCloseClick:()=>h(!1),onCompleteClick:()=>{C||u.userRoleId==null||s(D(u.userRoleId)),h(!1)}})]});return c.jsxs(c.Fragment,{children:[c.jsxs(at,{children:[c.jsx(L,{analytics:b,onLoad:n=>n.trackPageLoaded(Oe.Event.aiCFOPage)}),o&&Q.drawerElement,c.jsx(ot,{...pe,currentChatSessionId:t,allSessionsWithOrderedQuestionAnswers:z,openOnboardingPage:()=>h(!0),userId:f.userId,setIsAiCfoOpen:i,navigate:m,sessionFromUrl:e,location:l,isSubmitting:he,isEmptyChatWithSession:de,currentTenant:u,emailLinkQuestion:ae??void 0,autoSubmitEmailLinkQuestion:ne,onEmailLinkQuestionProcessed:le,routedInitialQuestionSource:ie,routedInitialQuestionSuggestionIndex:re,onMenuClick:o?Q.open:void 0,isFileUploadEnabled:a,isUploadPromoVisible:T,onUploadPromoClose:k,exploreSuggestedPromptQuestions:oe,exploreSuggestedPromptQuestionsLoading:se}),S&&o?c.jsx(Ye,{anchor:"right",open:S,transitionDuration:250,PaperProps:{component:rt,style:{width:"100%"}},slotProps:{backdrop:{style:{backgroundColor:"transparent",cursor:"pointer"}}},onClose:()=>h(!1),children:c.jsx(Y,{onClick:n=>n.stopPropagation(),children:c.jsx(F,{isTOSAccepted:C,acceptMasterTOSState:d.masterTOSAcceptanceState,onCloseClick:()=>h(!1),onCompleteClick:()=>{C||u.userRoleId==null||s(D(u.userRoleId)),h(!1)}})})}):null]}),S&&!o?c.jsx(ve,{open:S,onClose:()=>h(!1),children:c.jsx(ye,{children:Se})}):null]})},Y=I(Ze)`
1
+ import{j as c}from"./liveblocks-D1TxH59e.js";import{a as r}from"./sentry-5pTQe3BK.js";import{u as ge,h as Ce,g as be,j as J,i as Ie,n as ke}from"./core-Fwwp8hop.js";import{T as we,z as xe,J as Pe,cQ as Ee,cR as Te,b4 as K,cS as Qe,b3 as Z,p as R,H as L,c as b,cT as F,cU as ve,cV as ye,a1 as _e,e as Oe,a7 as Ae,cW as Ue,a2 as je,m as Le,b0 as Fe,cX as De}from"./index-Sm9Ycasn.js";import{fI as Re,eO as ee,eP as Be,hE as Me,QL as Ve,eS as Ge,hO as $e,hK as Ne,eQ as D,ft as qe,fm as We,fq as X,fu as ze,fv as He,fw as Je,fx as Ke,fy as Xe}from"./zeni-epic-state-i1VxNGkd.js";import{D as Ye,n as I,S as Ze,P as et}from"./mui-Dar_oGjJ.js";import{u as tt}from"./useAiCfoDashboardSuggestedQuestionsChips-CUpKl9RP.js";import{p as st}from"./pathToGoBack-CFMq10u8.js";import"./recharts-DuOI9Nsb.js";import"./analytics-D310XSjQ.js";import"./plaid-BGhwh8RZ.js";import"./dnd-B_nt-Uf4.js";import"./stripe-DMRn4zHo.js";import"./lottie-BGeomX3N.js";import"./lexical-D4DqnnDh.js";import"./pdf-BftxTBXg.js";import"./utils-3_hFkWEq.js";(function(){try{var a=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},i=new a.Error().stack;i&&(a._sentryDebugIds=a._sentryDebugIds||{},a._sentryDebugIds[i]="ccfecbb2-b4ff-4edd-ab0a-009015d992bc",a._sentryDebugIdIdentifier="sentry-dbid-ccfecbb2-b4ff-4edd-ab0a-009015d992bc")}catch{}})();const te="chat-response-generated",ot=ke(function(a,i){const s=ee(a),m=i.isSubmitting;return{showSampleQuestions:i.sessionFromUrl==="explore"&&s.uiState.currentChatSessionId==null,aiCfoView:s,isSubmitting:m,isNewChatSession:i.sessionFromUrl==="new_chat"||i.sessionFromUrl==="explore",isFullView:!0,tableDownloadEndPoint:`${je}/tableDownload`,emailLinkQuestion:i.emailLinkQuestion,autoSubmitEmailLinkQuestion:i.autoSubmitEmailLinkQuestion,onEmailLinkQuestionProcessed:i.onEmailLinkQuestionProcessed,routedInitialQuestionSource:i.routedInitialQuestionSource,routedInitialQuestionSuggestionIndex:i.routedInitialQuestionSuggestionIndex,exploreSuggestedPromptQuestions:i.exploreSuggestedPromptQuestions,exploreSuggestedPromptQuestionsLoading:i.exploreSuggestedPromptQuestionsLoading,isFileUploadEnabled:i.isFileUploadEnabled,isUploadPromoVisible:i.isUploadPromoVisible,onUploadPromoClose:i.onUploadPromoClose}},function(a,i){const{location:s,currentTenant:m,userId:l,navigate:S,currentChatSessionId:h,allSessionsWithOrderedQuestionAnswers:d,setIsAiCfoOpen:f}=i;return{onEventReceived:(e,p)=>{if(e===te&&typeof p.text=="string"&&typeof p.metadata=="object"){const o=p,u=He(o.type),t=o.metadata.chat_session_id??null,{currentChatSession:E,currentQuestionAnswer:k,currentQuestionAnswerSummary:T}=Z(d,t);u!=="answer"?b.trackAICFOChatResponseGenerated(u,k?.question.questionText??"",o.text,t,De(T,E),o.metadata.message_id??null):b.trackAICFOChatAnswerGenerated(o.text,k?.question.questionText??"",(o.follow_up_questions?.length??0)>0,!!o.assumptions,!!o.insights,o.visualization!=null,Je(o.visualization?.type??"")??null,t,o.summarized_title,o.metadata.message_id??null),a(Ke({chatSessionId:o.metadata.chat_session_id,responseType:u,fetchState:{fetchState:"Completed",error:void 0}})),a(Xe({chatSessionId:o.metadata.chat_session_id,answerPayload:o,userId:l}))}},onSubmit:(e,p,o,u)=>{e&&Fe(a,e,p,h,d,l,u,o)},updateCurrentInput:e=>{a(X(e))},onStopSubmit:()=>{},onUpdateScrollYOffset:e=>{a(ze(e))},onSelectSampleQuestion:()=>{},onBackClick:()=>{S(-1)},onCloseClick:()=>{const e=R(s.state?.pathnameStackToGoBack),p=e.poppedPathname??st(1);S(p,{state:{...s.state,pathnameStackToGoBack:e.newStack}}),a(X(""))},togglePageView:()=>{const e=R(s.state?.pathnameStackToGoBack),p=e.poppedPathname??`/${m.tenantEmailDomain}/dashboard`;S(p,{state:{...s.state,pathnameStackToGoBack:e.newStack,message:"open_ai_cfo_drawer"}}),f(!0)},onCopy:()=>{},onThumbsUp:()=>{},onThumbsDown:()=>{},onTogglePageView:()=>{S(-1)},onNewChatClick:()=>{h!=null&&a(We());const e=Le(s.state?.pathnameStackToGoBack,s.pathname);S(`/${m.tenantEmailDomain}/ai-cfo/new_chat`,{state:{pathnameStackToGoBack:e.slice(0,-1),referrer:"Sidebar"}})},onToggleCotCollapsed:(e,p)=>{a(qe({questionAnswerId:e,isCollapsed:p}))},onMenuClick:i.onMenuClick}})(Ae(Ue)),Et=({isFileUploadEnabled:a})=>{const{setIsAiCfoOpen:i}=we(),s=ge(),m=Ce(),l=be(),[S,h]=r.useState(!1);r.useEffect(()=>{s(Re())},[s]);const d=J(n=>ee(n)),f=xe.getSignedInUser(),{session_id:e}=Ie(),p=Pe(),o=_e(p),u=J(n=>Be(n)),t=d.uiState.currentChatSessionId,E=u.tenantEmailDomain,{handleUploadPromoClose:k,isUploadPromoVisible:T}=Ee({isFileUploadEnabled:a,tenantEmailDomain:E}),Q=Te({currentTenant:u,currentChatSessionId:t,aiCfoView:d}),{isSuggestedQuestionsLoading:se,suggestedPromptQuestions:oe}=tt(),w=l.state,x=w?.aiCfoInitialQuestion,B=!!w?.aiCfoShouldSubmit;r.useEffect(()=>{const n=l.state;if(n?.[K]!==!0)return;h(!0);const g={...n};delete g[K],m(l,{replace:!0,state:g})},[l.pathname,l.search,l.state,m]);const[ae,v]=r.useState(null),[ne,y]=r.useState(!1),[ie,_]=r.useState(void 0),[re,O]=r.useState(void 0),M=r.useRef(!1);r.useEffect(()=>{if(!M.current&&x!=null&&x!==""){const n=l.state;v(x),y(B),_(n?.aiCfoInitialSubmissionSource!=null?n.aiCfoInitialSubmissionSource:void 0);const g=n?.aiCfoSuggestionIndex;O(typeof g=="number"?g:void 0),M.current=!0}},[x,B,l.state]);const le=r.useCallback(()=>{v(null),y(!1),_(void 0),O(void 0)},[]),V=r.useMemo(()=>new URLSearchParams(l.search),[l.search]),G=V.get("ref")??w?.aiCfoRef,A=V.get("emailRefId")??w?.aiCfoEmailRefId,$=r.useRef(!1);r.useEffect(()=>{$.current||G!=="month-end-email"||A==null||t!=null||f==null||(s(Me("controller",f.userId,A,"MONTH_END_EMAIL")),$.current=!0)},[G,A,t,s,f]);const P=d.uiState.lastContextMessage;r.useEffect(()=>{P!=null&&P!==""&&t!=null&&(v(P),y(!0),_(void 0),O(void 0),s(Ve()))},[P,t,s]);const ce=u.masterTOSInfo,C=ce?.isMasterTOSAccepted??!1,{visitedSessions:N}=Qe(t),U=d.fetchState,j=d.uiState.chatSessionsNextPageToken.hasMore||!d.uiState.chatSessionsFirstPageFetched,q=t!=null?d.fetchChatSessionHistoryByChatSessionId?.[t]?.fetchState??"Not-Started":"Not-Started",W=t==null||(d.uiState.chatHistoryNextPageToken[t]?.hasMore??!0),z=d.allSessionsWithOrderedQuestionAnswers,{currentSessionQuestionAnswers:ue}=Z(z,t),de=ue.length===0;r.useEffect(()=>{C||o||m("../dashboard",{state:{...l.state,message:"open_ai_cfo_drawer"}})},[C,o,m,l.state]);const me=r.useCallback(()=>{const n=R(l.state?.pathnameStackToGoBack),g=u.tenantEmailDomain;m(n.poppedPathname??(g!=null?`/${g}/dashboard`:".."),{state:{...l.state,pathnameStackToGoBack:n.newStack}})},[u.tenantEmailDomain,l.state,m]);r.useEffect(()=>{t!=null&&e!==t&&m(`../ai-cfo/${t}`,{state:{...l.state}})},[t,e]),r.useEffect(()=>{e!=null&&t==null&&e!=="new_chat"&&e!=="explore"&&s(Ge({sessionId:e,agentId:"controller"}))},[]);const pe=r.useMemo(()=>({events:N.map(n=>`private-encrypted-chat-${n}.${te}`),eventCallback:(n,g,fe)=>fe.onEventReceived(n,g)}),[N]);r.useEffect(()=>{U!=="In-Progress"&&j&&s($e())},[U,j,s]),r.useEffect(()=>{t!=null&&q!=="In-Progress"&&W&&f!=null&&U==="Completed"&&!j&&s(Ne(t,f.userId))},[q,W,t,f,s]);const H=n=>n.trackAICFOOnboardingScreenStateChanged("open","first_visit");if(f==null||e==null)throw Error("Can't access AI Controller page without signing in...");const he=t!=null&&d.responseStateByChatSessionId?.[t]?.answer?.fetchState==="In-Progress";if(!C&&o)return c.jsxs(nt,{children:[c.jsx(L,{analytics:b,onLoad:H}),Q.drawerElement,c.jsx(it,{children:c.jsx(Y,{children:c.jsx(F,{isTOSAccepted:!1,acceptMasterTOSState:d.masterTOSAcceptanceState,onCloseClick:me,onCompleteClick:()=>{u.userRoleId!=null&&s(D(u.userRoleId))}})})})]});const Se=c.jsxs(c.Fragment,{children:[S&&!C?c.jsx(L,{analytics:b,onLoad:H}):null,c.jsx(F,{isTOSAccepted:C,acceptMasterTOSState:d.masterTOSAcceptanceState,showHeader:!1,togglePageView:C?()=>h(!1):void 0,onCloseClick:()=>h(!1),onCompleteClick:()=>{C||u.userRoleId==null||s(D(u.userRoleId)),h(!1)}})]});return c.jsxs(c.Fragment,{children:[c.jsxs(at,{children:[c.jsx(L,{analytics:b,onLoad:n=>n.trackPageLoaded(Oe.Event.aiCFOPage)}),o&&Q.drawerElement,c.jsx(ot,{...pe,currentChatSessionId:t,allSessionsWithOrderedQuestionAnswers:z,openOnboardingPage:()=>h(!0),userId:f.userId,setIsAiCfoOpen:i,navigate:m,sessionFromUrl:e,location:l,isSubmitting:he,isEmptyChatWithSession:de,currentTenant:u,emailLinkQuestion:ae??void 0,autoSubmitEmailLinkQuestion:ne,onEmailLinkQuestionProcessed:le,routedInitialQuestionSource:ie,routedInitialQuestionSuggestionIndex:re,onMenuClick:o?Q.open:void 0,isFileUploadEnabled:a,isUploadPromoVisible:T,onUploadPromoClose:k,exploreSuggestedPromptQuestions:oe,exploreSuggestedPromptQuestionsLoading:se}),S&&o?c.jsx(Ye,{anchor:"right",open:S,transitionDuration:250,PaperProps:{component:rt,style:{width:"100%"}},slotProps:{backdrop:{style:{backgroundColor:"transparent",cursor:"pointer"}}},onClose:()=>h(!1),children:c.jsx(Y,{onClick:n=>n.stopPropagation(),children:c.jsx(F,{isTOSAccepted:C,acceptMasterTOSState:d.masterTOSAcceptanceState,onCloseClick:()=>h(!1),onCompleteClick:()=>{C||u.userRoleId==null||s(D(u.userRoleId)),h(!1)}})})}):null]}),S&&!o?c.jsx(ve,{open:S,onClose:()=>h(!1),children:c.jsx(ye,{children:Se})}):null]})},Y=I(Ze)`
2
2
  display: flex;
3
3
  min-height: 100%;
4
4
  flex-direction: column;
@@ -1 +1 @@
1
- import{j as l}from"./liveblocks-D1TxH59e.js";import{a as f}from"./sentry-5pTQe3BK.js";import{h as U,g as B,u as T,j as v,N,n as j,i as $,o as O,p as h}from"./core-Fwwp8hop.js";import{eP as F,Nr as R,N7 as b,xR as x,xL as L,xP as I,xE as q,N9 as W,xH as z,xT as G,xS as C}from"./zeni-epic-state-i1VxNGkd.js";import{h as P,z as k,q as V,a7 as H,bF as J,af as _,bG as K}from"./index-BcoFhJ4O.js";import"./mui-Dar_oGjJ.js";import{i as M}from"./ReimbursementApprovalRuleDetailScreen-Ck-1sOnS.js";import Q from"./NotFoundScreen-Dpz39bup.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]="619d4160-416a-4092-a18c-3f87174b4fee",e._sentryDebugIdIdentifier="sentry-dbid-619d4160-416a-4092-a18c-3f87174b4fee")}catch{}})();const w="bill-approval-rule-update",X=j(function(e){return{approvalView:R(e),billPaySetupApproverViewUpdateData:b(e).billPaySetupApproverViewUpdateData}},function(e,o){const{navigate:t,location:p}=o;return{onApprovalRulesEventReceived:a=>{a.endsWith(w)&&e(W(!1))},onBackClick:()=>{_(p)?t("../../"):t("../../../bills/setup")},onDeleteRuleClick:a=>{e(q(a))},onEditRuleClick:a=>{a!=null?(e(I(a)),t(`./${a}/edit`)):(e(I()),t("./new"))}}})(H(J)),Y=()=>{const e=U(),o=B(),t=T(),[p,a]=f.useState(!1),[u,s]=f.useState(!1),d=P(),n=v(i=>i.billPaySetupApproverViewState.fetchState),c=v(i=>F(i)),r=v(i=>R(i)),g=v(i=>b(i).billPaySetupApproverViewUpdateData);if(f.useEffect(()=>{g?.updateStatus.fetchState==="Completed"&&t(x())},[g]),f.useEffect(()=>{p||n!=="Not-Started"||(a(!0),t(L(!0)))},[p,n,t]),k.getSignedInUser()==null)throw Error("Can't access billpay approval without signing in...");f.useEffect(()=>{r.allApprovalRules.length===0&&r.fetchState==="Completed"&&(u||(s(!0),t(I())),e("./new"))},[u,r,t]);const y={events:c.companyId!=null?[`private-encrypted-${c.companyId}.${w}`]:[],eventCallback:(i,A,S)=>{i.endsWith(w)&&S.onApprovalRulesEventReceived(i)}};return c.companyBillPayInfo?.info?.isBillPayTOSAccepted===!1?l.jsx(N,{to:"../../promo"}):c.companyBillPayInfo?.info?.isBillPayTOSAccepted!==!0||r.fetchState!=="Completed"&&r.fetchState!=="Error"?l.jsx(V,{fetchState:"In-Progress",style:{backgroundColor:d.colors.grey5}}):l.jsx(X,{currentTenant:c,location:o,navigate:e,...y})},Z=j(function(e,o){const t=b(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=_(o.location);return{onApprovalRuleDataUpdated:n=>{const c=r=>{const g=[];return r.forEach(y=>{const i=y.actors.selectedUsers.map(m=>({type:"user",userId:m.userId,isImplicitActor:!1})),A=y.actors.selectedNonUsers.map(m=>{const E=!!M(m.value);return{type:E?"attribute":"role",subType:m.value,userId:void 0,idType:void 0,isImplicitActor:!E}}),S=i.concat(A);g.push({action:y.stepType.selectedOption,actors:S,operator:S.length>1?y.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(x()),s==="approval_update"||d?t("../"):a.allApprovalRules.length===0&&a.fetchState==="Completed"?t("../../setup"):t("../")},onBackClick:()=>{e(x()),s==="approval_update"||d?t("../"):a.allApprovalRules.length===0&&a.fetchState==="Completed"?t("../../setup"):t("../")},onSaveRuleClick:()=>{e(G())},onSaveRuleSuccess:()=>{t("../")}}})(K);function D(){const e=U(),o=T(),t=B(),{approvalRuleId:p}=$(),a=k.getSignedInUser(),u=P(),s=v(r=>b(r)),d=v(r=>R(r)),[n,c]=f.useState(!1);if(f.useEffect(()=>{n||(c(!0),o(z(!0)))}),f.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(V,{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(h,{path:"/",element:l.jsx(Y,{})}),l.jsx(h,{path:"/new",element:l.jsx(D,{})}),l.jsx(h,{path:"/:approvalRuleId/edit",element:l.jsx(D,{})}),l.jsx(h,{path:"*",element:l.jsx(Q,{})})]})}export{se as B};
1
+ import{j as l}from"./liveblocks-D1TxH59e.js";import{a as f}from"./sentry-5pTQe3BK.js";import{h as U,g as B,u as T,j as v,N,n as j,i as $,o as O,p as h}from"./core-Fwwp8hop.js";import{eP as F,Nr as R,N7 as b,xR as x,xL as L,xP as I,xE as q,N9 as W,xH as z,xT as G,xS as C}from"./zeni-epic-state-i1VxNGkd.js";import{h as P,z as k,q as V,a7 as H,bF as J,af as _,bG as K}from"./index-Sm9Ycasn.js";import"./mui-Dar_oGjJ.js";import{i as M}from"./ReimbursementApprovalRuleDetailScreen-DqylTjul.js";import Q from"./NotFoundScreen-Brpo5hIh.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]="619d4160-416a-4092-a18c-3f87174b4fee",e._sentryDebugIdIdentifier="sentry-dbid-619d4160-416a-4092-a18c-3f87174b4fee")}catch{}})();const w="bill-approval-rule-update",X=j(function(e){return{approvalView:R(e),billPaySetupApproverViewUpdateData:b(e).billPaySetupApproverViewUpdateData}},function(e,o){const{navigate:t,location:p}=o;return{onApprovalRulesEventReceived:a=>{a.endsWith(w)&&e(W(!1))},onBackClick:()=>{_(p)?t("../../"):t("../../../bills/setup")},onDeleteRuleClick:a=>{e(q(a))},onEditRuleClick:a=>{a!=null?(e(I(a)),t(`./${a}/edit`)):(e(I()),t("./new"))}}})(H(J)),Y=()=>{const e=U(),o=B(),t=T(),[p,a]=f.useState(!1),[u,s]=f.useState(!1),d=P(),n=v(i=>i.billPaySetupApproverViewState.fetchState),c=v(i=>F(i)),r=v(i=>R(i)),g=v(i=>b(i).billPaySetupApproverViewUpdateData);if(f.useEffect(()=>{g?.updateStatus.fetchState==="Completed"&&t(x())},[g]),f.useEffect(()=>{p||n!=="Not-Started"||(a(!0),t(L(!0)))},[p,n,t]),k.getSignedInUser()==null)throw Error("Can't access billpay approval without signing in...");f.useEffect(()=>{r.allApprovalRules.length===0&&r.fetchState==="Completed"&&(u||(s(!0),t(I())),e("./new"))},[u,r,t]);const y={events:c.companyId!=null?[`private-encrypted-${c.companyId}.${w}`]:[],eventCallback:(i,A,S)=>{i.endsWith(w)&&S.onApprovalRulesEventReceived(i)}};return c.companyBillPayInfo?.info?.isBillPayTOSAccepted===!1?l.jsx(N,{to:"../../promo"}):c.companyBillPayInfo?.info?.isBillPayTOSAccepted!==!0||r.fetchState!=="Completed"&&r.fetchState!=="Error"?l.jsx(V,{fetchState:"In-Progress",style:{backgroundColor:d.colors.grey5}}):l.jsx(X,{currentTenant:c,location:o,navigate:e,...y})},Z=j(function(e,o){const t=b(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=_(o.location);return{onApprovalRuleDataUpdated:n=>{const c=r=>{const g=[];return r.forEach(y=>{const i=y.actors.selectedUsers.map(m=>({type:"user",userId:m.userId,isImplicitActor:!1})),A=y.actors.selectedNonUsers.map(m=>{const E=!!M(m.value);return{type:E?"attribute":"role",subType:m.value,userId:void 0,idType:void 0,isImplicitActor:!E}}),S=i.concat(A);g.push({action:y.stepType.selectedOption,actors:S,operator:S.length>1?y.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(x()),s==="approval_update"||d?t("../"):a.allApprovalRules.length===0&&a.fetchState==="Completed"?t("../../setup"):t("../")},onBackClick:()=>{e(x()),s==="approval_update"||d?t("../"):a.allApprovalRules.length===0&&a.fetchState==="Completed"?t("../../setup"):t("../")},onSaveRuleClick:()=>{e(G())},onSaveRuleSuccess:()=>{t("../")}}})(K);function D(){const e=U(),o=T(),t=B(),{approvalRuleId:p}=$(),a=k.getSignedInUser(),u=P(),s=v(r=>b(r)),d=v(r=>R(r)),[n,c]=f.useState(!1);if(f.useEffect(()=>{n||(c(!0),o(z(!0)))}),f.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(V,{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(h,{path:"/",element:l.jsx(Y,{})}),l.jsx(h,{path:"/new",element:l.jsx(D,{})}),l.jsx(h,{path:"/:approvalRuleId/edit",element:l.jsx(D,{})}),l.jsx(h,{path:"*",element:l.jsx(Q,{})})]})}export{se as B};
@@ -1,4 +1,4 @@
1
- import{j as a}from"./liveblocks-D1TxH59e.js";import{h as J,u as se,g as Y,i as ae,j as v,N as te,n as Q,l as na,o as ia,p as S}from"./core-Fwwp8hop.js";import{eP as Z,MJ as Me,bt as It,HD as oa,bo as wt,bF as pe,MK as xt,x9 as Ct,yj as $e,xI as la,bn as De,ML as sa,MM as ra,c2 as ca,MN as da,jD as At,MO as Bt,MP as Et,yU as Ne,xo as Ae,MQ as ua,wZ as tt,MR as pa,C4 as ma,x1 as ba,x7 as Dt,MS as ke,MT as _e,yk as Ge,MU as ha,MV as ga,yn as Oe,MW as ya,yA as Sa,MX as jt,y4 as at,y9 as fa,MY as ka,MZ as ue,M_ as Tt,M$ as Pt,N0 as Ft,fM as va,xt as Ue,cx as Rt,N1 as Ia,gQ as wa,N2 as xa,N3 as Ca,e_ as Vt,eY as $t,N4 as ze,N5 as Aa,N6 as Ba,Ks as Ze,N7 as Ea,Kt as oe,Ku as He,N8 as Da,N9 as ja,Na as Ta,yb as nt,y8 as Pa,Nb as Fa,Nc as Ra,Nd as Va,xW as $a,Ne as Ua,Nf as La,Ng as Ma,cl as Ut,cM as Lt,jO as Na,bL as _a,bq as Mt,bM as Nt,wf as Ga,Nh as Oa,BT as za,BZ as Za,sM as Ha,yl as Wa,y$ as qa,j$ as fe,Ni as Ka,Nj as _t,kt as Ja,jV as Gt,ke as Ot,kd as it,bE as be,bK as Ya,Nk as Qa,Nl as ve,iy as Xa,Nm as ot,Nn as en,iC as tn,iX as an,zd as nn,No as on,km as ln,z3 as sn,Np as lt,z7 as rn,zc as cn,z9 as dn,z1 as un,Nq as zt,xi as pn,Nr as mn,Ns as bn,fE as hn,fD as gn,fC as yn,k2 as Sn,kk as st,kv as fn,qc as kn,kb as vn,z5 as In,iI as wn,kA as xn,Nt as Cn,iA as An,q3 as Bn,Nu as En,y0 as Dn,bG as jn,bs as Tn,Jn as Pn,cO as Fn,cN as Rn,cw as Vn,cC as $n}from"./zeni-epic-state-i1VxNGkd.js";import{h as me,z as V,k as Ie,Y as We,$ as le,I as y,aN as Be,q as re,o as B,H as je,c as D,bc as Un,p as z,a2 as qe,m as E,J as we,bd as rt,be as ct,bf as Ln,ak as Mn,v as Nn,aH as _n,s as Zt,O as Ke,w as Je,bg as Gn,at as Ht,bh as On,U as zn,e as Wt,a7 as Zn,bi as Hn,bj as Wn,bk as qn,bl as Kn,bm as Jn,bn as Yn,bo as Qn,bp as Xn,bq as ei,F as ti,br as ai,b7 as ni,bs as ii,bt as oi,a9 as li}from"./index-BcoFhJ4O.js";import{n as L,S as si}from"./mui-Dar_oGjJ.js";import{A as dt}from"./AddressScreen-DxaubiXq.js";import{g as ie,a as Te,i as qt,V as Ye,b as Qe,c as ri,v as ci,d as di,A as he,D as ge}from"./DomesticWireDetailScreen-BY-jUiMw.js";import{a as f}from"./sentry-5pTQe3BK.js";import{u as Xe}from"./useAskAiCfoHostNavButtonProps-HZkyXVvQ.js";import{u as Kt}from"./useInitialThreadRequest-Ro9Y0en9.js";import Ee from"./NotFoundScreen-Dpz39bup.js";import{D as ui}from"./DrawerScreen-Drpask10.js";import{M as Jt}from"./MobileAppDrawer-BkelcJG3.js";import{F as Yt}from"./FeaturePreviewScreen-DvNQU3gG.js";import{S as Pe}from"./SetupPagesScreen-NIC2w04g.js";import{B as pi}from"./BillPayApprovalRoutes-B4r-0-50.js";import{FallBackRoute as mi}from"./ScreenRoutes-CrkYMUz1.js";import"./recharts-DuOI9Nsb.js";import"./analytics-D310XSjQ.js";import"./plaid-BGhwh8RZ.js";import"./dnd-B_nt-Uf4.js";import"./stripe-DMRn4zHo.js";import"./lottie-BGeomX3N.js";import"./lexical-D4DqnnDh.js";import"./pdf-BftxTBXg.js";import"./utils-3_hFkWEq.js";import"./analyticsHelper-StfDTSGk.js";import"./routePaths-BPSPu97F.js";import"./BusinessVerificationPageScreen-BIrHn3fq.js";import"./ReimbursementApprovalRuleDetailScreen-Ck-1sOnS.js";import"./getLocaleForTenant-JJvZDWEQ.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]="569f4174-d048-4f0c-87f0-a1d0b8332b33",e._sentryDebugIdIdentifier="sentry-dbid-569f4174-d048-4f0c-87f0-a1d0b8332b33")}catch{}})();const bi=Q(function(e,t){const l=Me(e,t.billId),i=V.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:At(e),createdBy:s,authParams:r,transactionAttachmentEndpoint:`${qe}/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(Ae(l,"retry")):e(Ae(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(Ae(t.billId,"refund"))},saveBillDetails:(o,s,n)=>{o&&e(Et({data:n,billId:l})),e(Ne(o?"paid":"pending_approval",o,s,l))},discardOutsideZeniPaymentData:()=>{e(Bt({billId:l}))}}})(Un);function hi(){const e=J(),t=se(),l=Y(),{billId:i}=ae(),c=me(),r=V.getSignedInUser(),u=Ie(),o=v(G=>Z(G)),s=v(G=>Me(G,i??"")),n=s.transactionDetails?.billPayInfo.stage.code==="draft"&&s.transactionDetails.isDeleted===!1,d=Kt(o?.companyId,{clearParams:s.fetchState==="Completed"&&!n}),{isAiCfoAccessEnabled:p,onAskAiCfoClick:m}=Xe({mobileExploreReferrer:"Bill Details"});We({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),[C,N]=f.useState(!1),{useFeatureGate:T,useDynamicConfig:M}=le(),{isFeatureEnabled:$}=T(y.isShowDeletedBillsFeatureEnabled),{isFeatureEnabled:I}=T(y.isBillPayCommentingEnabled),{isFeatureEnabled:H}=T(y.isBillPayDetectInsufficientFundsEnabled),{configValue:_}=M(Be.zeniAssistConfig),A=oa(o),q=wt(o.userRole),W=g&&pe(u?.loggedInUserRoleMap),U=_.user_ids!=null&&r?.userId!=null&&_.user_ids.includes(r?.userId),{isFeatureEnabled:K}=T(y.isInternationalPaymentShaVsOurFeatureEnabled),{isFeatureEnabled:X}=T(y.billPaySetupShowInternationalPaymentByWise);if(f.useEffect(()=>{$&&s.transactionDetails?.isDeleted===!0||o.isZeni===!0&&r?.userEmailDomain==="zeni.ai"&&A===!1?N(!1):N(s.billActivities[0]?.isRealTimeApprovalEnabled&&(q||W||s.allApprovers.find(G=>G.user.userId===r?.userId)!=null||s.transactionDetails?.lastUpdatedByUserId===r?.userId))},[s.billActivities[0]?.isRealTimeApprovalEnabled,s.allApprovers,s.transactionDetails?.lastUpdatedByUserId,q,W,o.isZeni,A,r]),f.useEffect(()=>{i!=null&&t(xt(i))},[i]),f.useEffect(()=>{b||s.fetchState=="Completed"||s.fetchState=="In-Progress"||(k(!0),t(Ct(i??"",$,U,!1)))},[b,s,i,t]),f.useEffect(()=>{j||s.fetchState!="Completed"||s.transactionDetails?.billPayInfo.stage.code=="paid"||(x(!0),t($e(!1,$,U,X,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 ${B.sp1} ${c.colors.dropShadowNormal}`}}):a.jsxs(a.Fragment,{children:[a.jsx(je,{analytics:D,onLoad:G=>(ee=>{i!=null&&ee.trackBillPayBillDetails(i,s.isRecurring)})(G)}),a.jsx(bi,{initialOpenThreadRequest:d??void 0,isShowDeletedBillsEnabled:$,location:l,navigate:e,isBillPayCommentingEnabled:I,isRealTimeApprovalEnabled:C,currentTenant:o,billId:i??"",isInternationalPaymentShaVsOurEnabled:K,hasZeniAssistAccess:U,isDetectInsufficientFundsEnabled:H,isAiCfoAccessEnabled:p,onAskAiCfoClick:m})]})}const ye=Ke.getLocalizedStrings().spendManagement.billPay.billDetails,gi={containerWidth:new Zt(100,58)},ut=Q(function(e,t){const l=V.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:B.sp10,paddingRight:B.sp3,paddingBottom:"15px",paddingLeft:B.sp5,...t.showAutofill?{}:{backgroundColor:t.backgroundColor,paddingBottom:"128px"}}}},function(e,t){const l=V.getSignedInUser();return{onInvoiceUpload:i=>{i!=null&&(t.file!=null||t.billId!=null||t.isInitialEdit?(t.setPayload(i),t.setShowConfirmationPopup(!0)):e(Oe(i,t.isVendorRecommendationEnabled,t.billId)))},updateInvoiceUploadFetchState:i=>{e(Sa({fetchState:{fetchState:i,error:void 0},billId:t.billId}))},onSkipAutofill:i=>{D?.trackBillPaySkipAutofill(),e(Ge(i))},onDeleteClick:()=>{e(ya({billId:t.billId})),D?.trackInvoiceActionClick(t.billStage??"","delete",l?.userEmail??"",null)}}})(_n);function w({appContent:e}){const t=se(),l=J(),{billId:i}=ae(),c=Y(),r=c.pathname,u=r.includes("bill/new")||r.includes("/edit"),o=we(),s=me(),n=V.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(Be.zeniAssistConfig),j=k.user_ids!=null&&n?.userId!=null&&k.user_ids.includes(n?.userId),x=v(F=>Z(F)),[C,N]=f.useState(!1),[T,M]=f.useState(!1),[$,I]=f.useState(!1),[H,_]=f.useState(),A=v(F=>_e(F,m,g,i));let q=A.fetchState,W=A.file,U=A.showAutofill;const K=v(F=>Me(F,i??""));u===!1&&(q=K.fetchState,W=K.transactionDetails?.attachments?.[0],U=!1);const X=A.billPayInfo!=null&&A.billPayInfo.stage.code==="pending_approval"?A.billPayInfo.billStatus.code:A.billStage;f.useEffect(()=>{i==null&&t(Ge(!0))},[i,t]),f.useEffect(()=>{q==="Not-Started"&&(u&&T?M(!1):!u&&C&&N(!1))},[i]),f.useEffect(()=>{C||i==null||u||(N(!0),t(Ct(i,h,j,!1)),T||(M(!0),t($e(!1,h,j,b,i)))),u&&!T&&(M(!0),t($e(!1,h,j,b,i)))},[C,T,u,i,t]);const G={onOkClick:()=>{if(I(!1),!H)return;const F=W!=null?"replace":"upload";D?.trackInvoiceActionClick(X??"",F,n?.userEmail??"","yes"),t(ga({replaceBillData:!0,billId:i})),t(Oe(H,m,i))},onCancelClick:()=>{if(I(!1),!H)return;const F=W!=null?"replace":"upload";D?.trackInvoiceActionClick(X??"",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"||K.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:A.uploadStatus,isVendorRecommendationEnabled:m,attachmentTitle:void 0,setShowConfirmationPopup:I,setPayload:_,showActionButtons:!1,isInitialEdit:!!A.isInitialEdit,billStage:X}),a.jsx(Ve,{windowSize:o,children:a.jsx(ct,{isNewBill:!0})})]})}):a.jsxs(Fe,{windowSize:o,children:[o==="small"||U?null:a.jsx(pt,{children:a.jsx(Qt,{onClick:ee,"data-testid":"nav-bar-back-click"})}),o!=="small"?a.jsx(Re,{}):null,a.jsx(Ln,{}),a.jsx(Ve,{windowSize:o,children:a.jsx(ct,{isNewBill:i==null})})]});{const F=A.billPayInfo!=null&&A.billPayInfo.stage.code==="pending_approval"?A.billPayInfo.billStatus.code:A.billStage;return a.jsx(rt,{fallback:ee,children:a.jsxs(Fe,{windowSize:o,children:[U&&o!=="small"?a.jsx(mt,{}):null,$?a.jsx(Mn,{titleComponent:a.jsx(wi,{children:ye.overwriteTitle}),descriptionComponent:a.jsx(xi,{children:ye.overwriteDescription}),primaryButtonText:ye.buttons.yes,secondaryButtonText:ye.buttons.no,action:G,isEditPopup:!0}):null,o==="small"||U?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:U,uploadStatus:A.uploadStatus,isVendorRecommendationEnabled:m,attachmentTitle:Si(u,K,A),setShowConfirmationPopup:I,setPayload:_,showActionButtons:fi(u,A),isInitialEdit:!!A.isInitialEdit,billStage:F}),a.jsx(Ve,{windowSize:o,children:e})]})})}}function yi(){const{triggerBack:e}=Gn();return a.jsx(Qt,{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-D1TxH59e.js";import{h as J,u as se,g as Y,i as ae,j as v,N as te,n as Q,l as na,o as ia,p as S}from"./core-Fwwp8hop.js";import{eP as Z,MJ as Me,bt as It,HD as oa,bo as wt,bF as pe,MK as xt,x9 as Ct,yj as $e,xI as la,bn as De,ML as sa,MM as ra,c2 as ca,MN as da,jD as At,MO as Bt,MP as Et,yU as Ne,xo as Ae,MQ as ua,wZ as tt,MR as pa,C4 as ma,x1 as ba,x7 as Dt,MS as ke,MT as _e,yk as Ge,MU as ha,MV as ga,yn as Oe,MW as ya,yA as Sa,MX as jt,y4 as at,y9 as fa,MY as ka,MZ as ue,M_ as Tt,M$ as Pt,N0 as Ft,fM as va,xt as Ue,cx as Rt,N1 as Ia,gQ as wa,N2 as xa,N3 as Ca,e_ as Vt,eY as $t,N4 as ze,N5 as Aa,N6 as Ba,Ks as Ze,N7 as Ea,Kt as oe,Ku as He,N8 as Da,N9 as ja,Na as Ta,yb as nt,y8 as Pa,Nb as Fa,Nc as Ra,Nd as Va,xW as $a,Ne as Ua,Nf as La,Ng as Ma,cl as Ut,cM as Lt,jO as Na,bL as _a,bq as Mt,bM as Nt,wf as Ga,Nh as Oa,BT as za,BZ as Za,sM as Ha,yl as Wa,y$ as qa,j$ as fe,Ni as Ka,Nj as _t,kt as Ja,jV as Gt,ke as Ot,kd as it,bE as be,bK as Ya,Nk as Qa,Nl as ve,iy as Xa,Nm as ot,Nn as en,iC as tn,iX as an,zd as nn,No as on,km as ln,z3 as sn,Np as lt,z7 as rn,zc as cn,z9 as dn,z1 as un,Nq as zt,xi as pn,Nr as mn,Ns as bn,fE as hn,fD as gn,fC as yn,k2 as Sn,kk as st,kv as fn,qc as kn,kb as vn,z5 as In,iI as wn,kA as xn,Nt as Cn,iA as An,q3 as Bn,Nu as En,y0 as Dn,bG as jn,bs as Tn,Jn as Pn,cO as Fn,cN as Rn,cw as Vn,cC as $n}from"./zeni-epic-state-i1VxNGkd.js";import{h as me,z as V,k as Ie,Y as We,$ as le,I as y,aN as Be,q as re,o as B,H as je,c as D,bc as Un,p as z,a2 as qe,m as E,J as we,bd as rt,be as ct,bf as Ln,ak as Mn,v as Nn,aH as _n,s as Zt,O as Ke,w as Je,bg as Gn,at as Ht,bh as On,U as zn,e as Wt,a7 as Zn,bi as Hn,bj as Wn,bk as qn,bl as Kn,bm as Jn,bn as Yn,bo as Qn,bp as Xn,bq as ei,F as ti,br as ai,b7 as ni,bs as ii,bt as oi,a9 as li}from"./index-Sm9Ycasn.js";import{n as L,S as si}from"./mui-Dar_oGjJ.js";import{A as dt}from"./AddressScreen-CWbRsmbp.js";import{g as ie,a as Te,i as qt,V as Ye,b as Qe,c as ri,v as ci,d as di,A as he,D as ge}from"./DomesticWireDetailScreen-i5P7thz2.js";import{a as f}from"./sentry-5pTQe3BK.js";import{u as Xe}from"./useAskAiCfoHostNavButtonProps-B40bGqEV.js";import{u as Kt}from"./useInitialThreadRequest-ELLLToSA.js";import Ee from"./NotFoundScreen-Brpo5hIh.js";import{D as ui}from"./DrawerScreen-8pLwC76h.js";import{M as Jt}from"./MobileAppDrawer-n526oWrk.js";import{F as Yt}from"./FeaturePreviewScreen-C1MJa7gv.js";import{S as Pe}from"./SetupPagesScreen-_IKYoHXM.js";import{B as pi}from"./BillPayApprovalRoutes-B3i4J9uo.js";import{FallBackRoute as mi}from"./ScreenRoutes-CA8fUnaP.js";import"./recharts-DuOI9Nsb.js";import"./analytics-D310XSjQ.js";import"./plaid-BGhwh8RZ.js";import"./dnd-B_nt-Uf4.js";import"./stripe-DMRn4zHo.js";import"./lottie-BGeomX3N.js";import"./lexical-D4DqnnDh.js";import"./pdf-BftxTBXg.js";import"./utils-3_hFkWEq.js";import"./analyticsHelper-CnXSrEd_.js";import"./routePaths-Pqm-PNC8.js";import"./BusinessVerificationPageScreen-CKWDQbki.js";import"./ReimbursementApprovalRuleDetailScreen-DqylTjul.js";import"./getLocaleForTenant-B-vHrKHL.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]="569f4174-d048-4f0c-87f0-a1d0b8332b33",e._sentryDebugIdIdentifier="sentry-dbid-569f4174-d048-4f0c-87f0-a1d0b8332b33")}catch{}})();const bi=Q(function(e,t){const l=Me(e,t.billId),i=V.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:At(e),createdBy:s,authParams:r,transactionAttachmentEndpoint:`${qe}/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(Ae(l,"retry")):e(Ae(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(Ae(t.billId,"refund"))},saveBillDetails:(o,s,n)=>{o&&e(Et({data:n,billId:l})),e(Ne(o?"paid":"pending_approval",o,s,l))},discardOutsideZeniPaymentData:()=>{e(Bt({billId:l}))}}})(Un);function hi(){const e=J(),t=se(),l=Y(),{billId:i}=ae(),c=me(),r=V.getSignedInUser(),u=Ie(),o=v(G=>Z(G)),s=v(G=>Me(G,i??"")),n=s.transactionDetails?.billPayInfo.stage.code==="draft"&&s.transactionDetails.isDeleted===!1,d=Kt(o?.companyId,{clearParams:s.fetchState==="Completed"&&!n}),{isAiCfoAccessEnabled:p,onAskAiCfoClick:m}=Xe({mobileExploreReferrer:"Bill Details"});We({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),[C,N]=f.useState(!1),{useFeatureGate:T,useDynamicConfig:M}=le(),{isFeatureEnabled:$}=T(y.isShowDeletedBillsFeatureEnabled),{isFeatureEnabled:I}=T(y.isBillPayCommentingEnabled),{isFeatureEnabled:H}=T(y.isBillPayDetectInsufficientFundsEnabled),{configValue:_}=M(Be.zeniAssistConfig),A=oa(o),q=wt(o.userRole),W=g&&pe(u?.loggedInUserRoleMap),U=_.user_ids!=null&&r?.userId!=null&&_.user_ids.includes(r?.userId),{isFeatureEnabled:K}=T(y.isInternationalPaymentShaVsOurFeatureEnabled),{isFeatureEnabled:X}=T(y.billPaySetupShowInternationalPaymentByWise);if(f.useEffect(()=>{$&&s.transactionDetails?.isDeleted===!0||o.isZeni===!0&&r?.userEmailDomain==="zeni.ai"&&A===!1?N(!1):N(s.billActivities[0]?.isRealTimeApprovalEnabled&&(q||W||s.allApprovers.find(G=>G.user.userId===r?.userId)!=null||s.transactionDetails?.lastUpdatedByUserId===r?.userId))},[s.billActivities[0]?.isRealTimeApprovalEnabled,s.allApprovers,s.transactionDetails?.lastUpdatedByUserId,q,W,o.isZeni,A,r]),f.useEffect(()=>{i!=null&&t(xt(i))},[i]),f.useEffect(()=>{b||s.fetchState=="Completed"||s.fetchState=="In-Progress"||(k(!0),t(Ct(i??"",$,U,!1)))},[b,s,i,t]),f.useEffect(()=>{j||s.fetchState!="Completed"||s.transactionDetails?.billPayInfo.stage.code=="paid"||(x(!0),t($e(!1,$,U,X,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 ${B.sp1} ${c.colors.dropShadowNormal}`}}):a.jsxs(a.Fragment,{children:[a.jsx(je,{analytics:D,onLoad:G=>(ee=>{i!=null&&ee.trackBillPayBillDetails(i,s.isRecurring)})(G)}),a.jsx(bi,{initialOpenThreadRequest:d??void 0,isShowDeletedBillsEnabled:$,location:l,navigate:e,isBillPayCommentingEnabled:I,isRealTimeApprovalEnabled:C,currentTenant:o,billId:i??"",isInternationalPaymentShaVsOurEnabled:K,hasZeniAssistAccess:U,isDetectInsufficientFundsEnabled:H,isAiCfoAccessEnabled:p,onAskAiCfoClick:m})]})}const ye=Ke.getLocalizedStrings().spendManagement.billPay.billDetails,gi={containerWidth:new Zt(100,58)},ut=Q(function(e,t){const l=V.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:B.sp10,paddingRight:B.sp3,paddingBottom:"15px",paddingLeft:B.sp5,...t.showAutofill?{}:{backgroundColor:t.backgroundColor,paddingBottom:"128px"}}}},function(e,t){const l=V.getSignedInUser();return{onInvoiceUpload:i=>{i!=null&&(t.file!=null||t.billId!=null||t.isInitialEdit?(t.setPayload(i),t.setShowConfirmationPopup(!0)):e(Oe(i,t.isVendorRecommendationEnabled,t.billId)))},updateInvoiceUploadFetchState:i=>{e(Sa({fetchState:{fetchState:i,error:void 0},billId:t.billId}))},onSkipAutofill:i=>{D?.trackBillPaySkipAutofill(),e(Ge(i))},onDeleteClick:()=>{e(ya({billId:t.billId})),D?.trackInvoiceActionClick(t.billStage??"","delete",l?.userEmail??"",null)}}})(_n);function w({appContent:e}){const t=se(),l=J(),{billId:i}=ae(),c=Y(),r=c.pathname,u=r.includes("bill/new")||r.includes("/edit"),o=we(),s=me(),n=V.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(Be.zeniAssistConfig),j=k.user_ids!=null&&n?.userId!=null&&k.user_ids.includes(n?.userId),x=v(F=>Z(F)),[C,N]=f.useState(!1),[T,M]=f.useState(!1),[$,I]=f.useState(!1),[H,_]=f.useState(),A=v(F=>_e(F,m,g,i));let q=A.fetchState,W=A.file,U=A.showAutofill;const K=v(F=>Me(F,i??""));u===!1&&(q=K.fetchState,W=K.transactionDetails?.attachments?.[0],U=!1);const X=A.billPayInfo!=null&&A.billPayInfo.stage.code==="pending_approval"?A.billPayInfo.billStatus.code:A.billStage;f.useEffect(()=>{i==null&&t(Ge(!0))},[i,t]),f.useEffect(()=>{q==="Not-Started"&&(u&&T?M(!1):!u&&C&&N(!1))},[i]),f.useEffect(()=>{C||i==null||u||(N(!0),t(Ct(i,h,j,!1)),T||(M(!0),t($e(!1,h,j,b,i)))),u&&!T&&(M(!0),t($e(!1,h,j,b,i)))},[C,T,u,i,t]);const G={onOkClick:()=>{if(I(!1),!H)return;const F=W!=null?"replace":"upload";D?.trackInvoiceActionClick(X??"",F,n?.userEmail??"","yes"),t(ga({replaceBillData:!0,billId:i})),t(Oe(H,m,i))},onCancelClick:()=>{if(I(!1),!H)return;const F=W!=null?"replace":"upload";D?.trackInvoiceActionClick(X??"",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"||K.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:A.uploadStatus,isVendorRecommendationEnabled:m,attachmentTitle:void 0,setShowConfirmationPopup:I,setPayload:_,showActionButtons:!1,isInitialEdit:!!A.isInitialEdit,billStage:X}),a.jsx(Ve,{windowSize:o,children:a.jsx(ct,{isNewBill:!0})})]})}):a.jsxs(Fe,{windowSize:o,children:[o==="small"||U?null:a.jsx(pt,{children:a.jsx(Qt,{onClick:ee,"data-testid":"nav-bar-back-click"})}),o!=="small"?a.jsx(Re,{}):null,a.jsx(Ln,{}),a.jsx(Ve,{windowSize:o,children:a.jsx(ct,{isNewBill:i==null})})]});{const F=A.billPayInfo!=null&&A.billPayInfo.stage.code==="pending_approval"?A.billPayInfo.billStatus.code:A.billStage;return a.jsx(rt,{fallback:ee,children:a.jsxs(Fe,{windowSize:o,children:[U&&o!=="small"?a.jsx(mt,{}):null,$?a.jsx(Mn,{titleComponent:a.jsx(wi,{children:ye.overwriteTitle}),descriptionComponent:a.jsx(xi,{children:ye.overwriteDescription}),primaryButtonText:ye.buttons.yes,secondaryButtonText:ye.buttons.no,action:G,isEditPopup:!0}):null,o==="small"||U?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:U,uploadStatus:A.uploadStatus,isVendorRecommendationEnabled:m,attachmentTitle:Si(u,K,A),setShowConfirmationPopup:I,setPayload:_,showActionButtons:fi(u,A),isInitialEdit:!!A.isInitialEdit,billStage:F}),a.jsx(Ve,{windowSize:o,children:e})]})})}}function yi(){const{triggerBack:e}=Gn();return a.jsx(Qt,{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=L.div`
3
3
  margin-bottom: 20px;
4
4
  margin-top: 20px;
@@ -1,4 +1,4 @@
1
- import{j as T}from"./liveblocks-D1TxH59e.js";import{a as N}from"./sentry-5pTQe3BK.js";import{h as ae,g as ne,u as se,i as ie,j as C,N as oe,n as re}from"./core-Fwwp8hop.js";import{k as ce,$ as ue,aN as de,z as B,H as pe,c as z,af as E,e as x,bB as le,at as me,m as P,au as R}from"./index-BcoFhJ4O.js";import{Nf as fe,eP as G,sb as ye,HH as Se,xW as ge,AD as Ie,Da as be,DP as he,EI as De,NC as ke,ND as Oe,NE as Te,NF as Ce,NG as Ne,K9 as Ve,ME as we,Kl as Ae,kj as _e,fE as Fe,fD as ve,fC as Ee,qc as xe,q3 as Be,q0 as ze,kb as Pe,sk as Re,si as M,bE as j,sw as L,cv as Me}from"./zeni-epic-state-i1VxNGkd.js";import{n as je}from"./mui-Dar_oGjJ.js";import{d as U}from"./routePaths-BPSPu97F.js";import{M as Le}from"./MobileAppDrawer-BkelcJG3.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]="7d4a420d-8e9b-4906-9b91-cd45dc484136",e._sentryDebugIdIdentifier="sentry-dbid-7d4a420d-8e9b-4906-9b91-cd45dc484136")}catch{}})();const Ue=je.div`
1
+ import{j as T}from"./liveblocks-D1TxH59e.js";import{a as N}from"./sentry-5pTQe3BK.js";import{h as ae,g as ne,u as se,i as ie,j as C,N as oe,n as re}from"./core-Fwwp8hop.js";import{k as ce,$ as ue,aN as de,z as B,H as pe,c as z,af as E,e as x,bB as le,at as me,m as P,au as R}from"./index-Sm9Ycasn.js";import{Nf as fe,eP as G,sb as ye,HH as Se,xW as ge,AD as Ie,Da as be,DP as he,EI as De,NC as ke,ND as Oe,NE as Te,NF as Ce,NG as Ne,K9 as Ve,ME as we,Kl as Ae,kj as _e,fE as Fe,fD as ve,fC as Ee,qc as xe,q3 as Be,q0 as ze,kb as Pe,sk as Re,si as M,bE as j,sw as L,cv as Me}from"./zeni-epic-state-i1VxNGkd.js";import{n as je}from"./mui-Dar_oGjJ.js";import{d as U}from"./routePaths-Pqm-PNC8.js";import{M as Le}from"./MobileAppDrawer-n526oWrk.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]="7d4a420d-8e9b-4906-9b91-cd45dc484136",e._sentryDebugIdIdentifier="sentry-dbid-7d4a420d-8e9b-4906-9b91-cd45dc484136")}catch{}})();const Ue=je.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-D1TxH59e.js";import{h as le,i as ca,u as ue,j as y,g as ge,n as pe,N as ga,s as ut,o as Wt,p as te}from"./core-Fwwp8hop.js";import{eP as ce,bs as Ue,Pa as ka,eY as be,eZ as ye,e_ as Se,fT as Ge,cs as ze,Pb as Ye,Pc as Ma,tq as ba,jL as ya,Pd as Sa,gQ as oa,zW as Xe,zY as $a,zZ as Ga,jB as mt,Pe as Ze,zK as Ct,Pf as qt,Pg as Qt,zN as Da,Ph as Jt,Nz as _a,rC as pt,zT as za,g$ as Xt,Pi as ht,Pj as Ke,bq as en,Pk as an,fE as Pa,fD as wa,Ar as tn,fC as Ta,Nf as nn,Pl as ft,cl as gt,cM as rn,Ny as da,B1 as sn,Pm as tt,AD as Fa,Pn as bt,B2 as on,N_ as cn,B3 as dn,BZ as ln,sM as un,BT as mn,Ac as yt,A5 as Cn,Po as pn,fV as hn,Al as St,Ap as It,fU as fn,Pp as gn,AP as At,Pq as bn,Pr as yn,Ps as Sn,An as Et,A8 as kt,zQ as Dt,Ah as _t,Af as Pt,Aj as In,zX as nt,Pt as wt,Pu as va,AA as Ia,Ke as Tt,cN as Ya,Pv as An,Pw as En,Px as kn,Py as Dn,Ax as Na,AW as _n,AS as Pn,At as wn,AU as Tn,AK as Fn,AM as vn,Pz as Ft,B0 as vt,HD as xn,PA as Bn,PB as Ln,PC as Rn,PD as xt,PE as Un,Bn as On,AC as Bt,Aw as ia,AB as jn,PF as Nn,PG as Vn,zH as Hn,PH as Lt,PI as Rt,PJ as Mn,zJ as $n,zI as rt,PK as Gn,PL as zn,PM as Yn,Ka as Zn,PN as Za,PO as Kn,wi as Ut,kj as Wn,gR as qn,Bs as Qn,PP as Ot,PQ as Jn,Bt as Xn,PR as er,de as ar,tk as tr,Bi as nr,Bc as Re,bt as rr,bF as sr,cx as or,bG as ir,Jn as cr}from"./zeni-epic-state-i1VxNGkd.js";import{z as X,k as je,$ as se,I as Y,q as la,c3 as xa,ce as dr,p as ve,cf as lr,cg as ur,J as ua,aN as Fe,m as fe,bm as Ka,ch as mr,s as ma,i as Ba,h as Wa,c as Q,O as qa,ci as Cr,Y as jt,aq as Qa,by as Qe,cj as Va,ck as pr,H as Ja,a7 as hr,cl as fr,at as Nt,a2 as Ha,U as Vt,e as Ht,cm as gr,cn as br,co as yr,cp as Sr,cq as Ir,cr as Ar,o as Aa,cs as Er,ct as kr,cu as Ua,F as Dr,cv as _r,cw as Pr,cx as wr,cy as Tr,cz as Fr,a9 as vr}from"./index-BcoFhJ4O.js";import{n as _e,D as Mt,S as xr}from"./mui-Dar_oGjJ.js";import{a as c}from"./sentry-5pTQe3BK.js";import{g as Ce,a as Ca,b as $t,c as Ie,d as Ae,e as Oe,f as Ne,A as Br,h as Xa,P as Lr,i as et,s as Je,j as Gt,k as Me,l as zt,m as Rr,n as Yt,p as Ur,S as st}from"./SetupPagesScreen-NIC2w04g.js";import{u as Or}from"./useInitialThreadRequest-Ro9Y0en9.js";import La from"./NotFoundScreen-Dpz39bup.js";import{M as $e}from"./MobileAppDrawer-BkelcJG3.js";import{u as Zt}from"./useAskAiCfoHostNavButtonProps-HZkyXVvQ.js";import{v as ot}from"./utils-3_hFkWEq.js";import{t as jr}from"./AddressScreen-DxaubiXq.js";import"./recharts-DuOI9Nsb.js";import"./analytics-D310XSjQ.js";import"./plaid-BGhwh8RZ.js";import"./dnd-B_nt-Uf4.js";import"./stripe-DMRn4zHo.js";import"./lottie-BGeomX3N.js";import"./lexical-D4DqnnDh.js";import"./pdf-BftxTBXg.js";import"./analyticsHelper-StfDTSGk.js";import"./routePaths-BPSPu97F.js";import"./BusinessVerificationPageScreen-BIrHn3fq.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]="01f23871-ba8e-4401-9d03-2ad4353bafb0",e._sentryDebugIdIdentifier="sentry-dbid-01f23871-ba8e-4401-9d03-2ad4353bafb0")}catch{}})();function Nr(){const e=le(),{cardId:t}=ca(),a=ue(),r=X.getSignedInUser(),n=y(J=>ce(J)),m=je(),u=Ue(m?.loggedInUserRoleMap),{useFeatureGate:f}=se();if(r==null)throw Error("Can't access Add To Wallet Page without signing in...");const[I,o]=c.useState(!1),i=y(J=>ka(J).firstViewAfterActivation);if(t==null)throw Error("Empty card id is not valid...");const E=n.userRole.includes("charge_card_user"),{isFeatureEnabled:S}=f(Y.isChargeCardFeatureEnabled),h=!!n.companyChargeCardInfo?.info?.isChargeCardEnabled,{isFeatureEnabled:U}=f(Y.isDebitCardFeatureEnabled),v=be(n),k=ye(n),C=Se(U,n),b=n.companyChargeCardInfo?.info?.chargeCardsCreditAccountLimit??0,g=Ie({isDebitCardFeatureEnabled:U,isBankingOnlyTenant:C}),d=Ae({isCardsOnlyTenant:v,isChargeCardFeatureEnabled:S,isBookKeepingTenant:k,isDebitCardProductVisible:g,chargeCardsCreditAccountLimit:b}),D=!!n.companyDebitCardInfo?.info?.isDebitCardEnabled,T=y(J=>Ge(J,n.companyId)),V=ze(T.controllers),{creditAccount:L,creditAccountRepayment:w}=y(J=>Ye(J)),H=y(J=>J.classListState.fetchState),p=!E&&d&&h,l=y(J=>Ma(J,t,p,d)),[_,F]=c.useState(!1),N=l.chargeCard,R=N?.cardCreatedByUser?.userId,G=y(J=>R!=null?ba(J.userRoleState,R):void 0),P=G?.accountingClassIDs[0],B=y(J=>P!=null?ya(J.classState,{classId:P,reportId:"class_list"}):void 0),j=N?.cardHolderUser?.userId,O=y(J=>j!=null?ba(J.userRoleState,j):void 0),W=O?.accountingClassIDs[0],A=y(J=>W!=null?ya(J.classState,{classId:W,reportId:"class_list"}):void 0),Z=N?.type.code==="business_physical_credit_card"||N?.type.code==="business_physical_debit_card",q=N?.type.code==="business_physical_debit_card";c.useEffect(()=>{i&&I===!1&&Z&&(o(!0),setTimeout(()=>{a(Sa()),q&&a(oa({messageSection:"set_debit_card_pin",messageText:"success",type:"success",showStatusIcon:!0}))},5e3))},[i,I,Z,q]),c.useEffect(()=>{_||l.fetchState==="Completed"||l.fetchState==="In-Progress"||t==null||(F(!0),a(Xe(t,p,!1)))},[_,l,t,a]),c.useEffect(()=>{if(l.fetchState==="Completed"&&(Z===!1||Z&&N?.status?.code!=="active"||N?.cardHolderUserId!==r.userId||i===!1&&I===!1||N?.type.code==="business_physical_debit_card"||N?.type.code==="business_virtual_debit_card")){const J=Ce(n.tenantEmailDomain,t,r,N,i);e(J)}},[l.fetchState,i,Z]),c.useEffect(()=>{L.fetchState!=="Completed"&&L.fetchState!=="In-Progress"&&d&&h&&u&&a($a()),w.fetchState!=="Completed"&&w.fetchState!=="In-Progress"&&d&&h&&u&&a(Ga()),H!=="Completed"&&H!=="In-Progress"&&a(mt())},[L.fetchState,w.fetchState,a,d,h,u,H]);const z=()=>{if(r!=null&&t!=null){a(Sa());const J=Ce(n.tenantEmailDomain,t,r);e(J)}},x=N?.type.code==="business_physical_debit_card"||N?.type.code==="business_virtual_debit_card",oe=Oe(d,g,D,h),ae=Ca(d,h,u,L,w),ne=$t(x,l);return l.fetchState!=="Completed"?s.jsx(la,{fetchState:"In-Progress"}):s.jsxs(s.Fragment,{children:[s.jsx(xa,{showConfetti:i}),s.jsx(dr,{onGotItClick:z,isDebitCard:N?.type.code==="business_physical_debit_card",controllerEmails:V,isChargeCardFeatureEnabled:d,isDebitCardFeatureEnabled:g,isDebitCardSetupEnabled:D,isChargeCardSetupEnabled:h,productInformation:oe,creditAccountInformation:ae,debitAccountInformation:ne,chargeCardDetailView:l,creditAccount:L,classListFetchState:H,creditAccountRepayment:w,cardIssuedByRoles:G?.userRoles,cardIssuedByDepartmentName:B?.className,cardHolderRoles:O?.userRoles,cardHolderDepartmentName:A?.className})]})}const Vr=pe(function(e){const t=Ze(e);return{insightsData:t.insight,cashbackByPeriod:t.cashbackByPeriod,uiState:t.uiState,cashbackSummary:t.cashbackSummary}},function(e){return{onColumnSortConfigChanged:(t,a)=>{e(qt({uiState:{sortKey:t,sortOrder:a}}))}}})(ur);function Hr(){const e=le(),t=ue(),a=ge(),r=X.getSignedInUser(),n=y(S=>ce(S)),{useFeatureGate:m}=se(),{isFeatureEnabled:u}=m(Y.isCardsCommentingEnabled),[f,I]=c.useState(!1),o=y(S=>Ze(S)),i=Or(n.companyId,{clearParams:o.fetchState==="Completed"}),E=c.useCallback(()=>{const S=ve(a.state?.pathnameStackToGoBack),h=S.poppedPathname??Mr(n.tenantEmailDomain);e(h,{state:{pathnameStackToGoBack:S.newStack}})},[e,a,n.tenantEmailDomain]);if(c.useEffect(()=>{f||o.fetchState==="Completed"||o.fetchState==="In-Progress"||(I(!0),t(Ct()))},[f,o,t]),r==null)throw Error("Can't access cashback detail page without signing in...");return o.fetchState==="In-Progress"?s.jsx(lr,{onBackClick:E}):o.cashbackSummary.cashbackEarned.amount===0&&o.fetchState==="Completed"?s.jsx(La,{}):s.jsx(Vr,{onBackClick:E,isCardsCommentingEnabled:u,initialOpenThreadRequest:i})}const Mr=e=>`/${e}/cards`,$r={containerWidth:new ma(100,58)},Gr=({appContent:e})=>{const t=ua(),a=ue(),r=le(),{cardId:n}=ca(),m=ge(),{useDynamicConfig:u}=se(),[f,I]=c.useState(!1),[o,i]=c.useState(!1),[E,S]=c.useState(!1),[h,U]=c.useState(!1),v=X.getSignedInUser();if(v==null)throw Error("Can't access onboarding card page without signing in...");const k=y(A=>ce(A));if(n==null)throw Error("Empty card id is not valid...");const{configValue:C}=u(Fe.zeniCardsConfig),b=C.max_charge_card_activation_attempts_by_card_id,g=y(A=>Qt(A,n)),d=g.chargeCard,D=y(A=>A.chargeCardConfigState.fetchState),{useFeatureGate:T}=se(),{isFeatureEnabled:V}=T(Y.isChargeCardFeatureEnabled),{isFeatureEnabled:L}=T(Y.isDebitCardFeatureEnabled),w=Se(L,k),H=Ie({isDebitCardFeatureEnabled:L,isBankingOnlyTenant:w}),p=!!k.companyChargeCardInfo?.info?.isChargeCardEnabled,l=k.userRole.includes("charge_card_user"),_=be(k),F=ye(k),N=k.companyChargeCardInfo?.info?.chargeCardsCreditAccountLimit??0,R=Ae({isCardsOnlyTenant:_,isChargeCardFeatureEnabled:V,isBookKeepingTenant:F,isDebitCardProductVisible:H,chargeCardsCreditAccountLimit:N}),G=!l&&R&&p;c.useEffect(()=>{f===!1&&D!=="In-Progress"&&D!=="Completed"&&(a(Da()),I(!0)),o===!1&&g.fetchState==="Not-Started"&&(i(!0),a(Xe(n,G,R)))},[o,g.fetchState,f,D]);const P=d?.type.code==="business_physical_credit_card"||d?.type.code==="business_physical_debit_card";c.useEffect(()=>{if(g.fetchState==="Completed"){if(E===!1&&(P===!1||P&&d?.status?.code!=="inactive"||d?.cardHolderUserId!==v.userId)){const A=Ce(k.tenantEmailDomain,n,v,d,!0),Z=fe(m.state?.pathnameStackToGoBack,m.pathname);r(A,{state:{pathnameStackToGoBack:Z}})}else if(E&&g.isRefreshingViewInBackground===!1&&d?.status?.code==="active"){a(Jt({chargeCardId:n}));const A=Ce(k.tenantEmailDomain,n,v,d,!0),Z=fe(m.state?.pathnameStackToGoBack,m.pathname);a(_a()),r(A,{state:{pathnameStackToGoBack:Z}})}}},[g.fetchState,d?.type.code,E,g.isRefreshingViewInBackground]);const B=X.getZeniOtpTokenForCardHolder(n),j=y(A=>pt(A.userState,v.userId)),O=()=>{d?.status?.code!=="active"&&a(za(n,!0))};c.useEffect(()=>{g.updatePhysicalChargeCardAttemptFetchState.fetchState==="Completed"&&d?.cardActivationAttemptHistory.some(A=>A.statusCode==="success")===!0&&E===!1&&(setTimeout(O,3e3),S(!0))},[g.updatePhysicalChargeCardAttemptFetchState.fetchState,d?.cardActivationAttemptHistory]);const W=A=>{U(A)};if(D!=="Completed"||d==null)return s.jsx(la,{fetchState:"In-Progress"});if(d.shippingAddressId==null)throw Error("Can't access shippingAddressId.");if(j?.phone==null)throw Error("Can't access user phone number.");return s.jsxs(Zr,{children:[s.jsx($e,{isAppContentDrawerOpen:h,handleDrawerToggle:W}),s.jsx(zr,{cardId:n,card:d,shippingAddressId:d.shippingAddressId,phone:j.phone,signedInUser:v,isSandboxEnv:Ka(),chargeCardDetailState:g,signedInUserToken:B,navigate:r,currentTenant:k,location:m,maxChargeCardActivationAttempts:b[n]!=null?b[n]:C.default_max_charge_card_activation_attempts!=null?C.default_max_charge_card_activation_attempts:3,chargeCardCashbackRatePerTransaction:C.charge_card_cashback_rate_per_transaction!=null?C.charge_card_cashback_rate_per_transaction:.0175,onClickMenuIcon:()=>{W(!0)}}),e!=null?s.jsx(Yr,{windowSize:t,children:e}):null]})},zr=pe(function(e,{chargeCardDetailState:t,shippingAddressId:a,location:r,cardId:n}){const m=Xt(e.addressState,a);if(m==null)throw Error("Can't access shippingAddress.");const u=ht(e,n),f=t.updateStatus,I=Ke(e,!1,!1,!1);let o=!1;I.fetchState==="Completed"&&I.cards.length<=1&&(o=!0);const i=r.state?.message==="comingFromV2UrlPath";return{showActivatePage:t.chargeCard?.providerCardCreateTime!=null&&t.chargeCard.providerCardCreateTime.add(24,"h").isBefore(en())||i,showMenuIcon:o,shippingAddress:m,vgsVaultId:Ba.cardVaultId,twoFAView:u,activationWaitStatus:f,isRefreshingViewInBackground:t.isRefreshingViewInBackground}},function(e,t){const{navigate:a,cardId:r,location:n,currentTenant:m,chargeCardDetailState:u}=t,f=u.chargeCard?.cardProviderID,{tenantEmailDomain:I}=m;return{onGetOtp:o=>{f!=null&&e(Ta(o,"ChargeCardHolder",r))},onUpdatePhysicalChargeCardAttempt:o=>{e(tn(r,o))},onResendOtp:o=>{f!=null&&e(wa(o,"ChargeCardHolder",r))},onVerifyOtp:(o,i)=>{f!=null&&e(Pa(o,i,"ChargeCardHolder",r))},onVerifyOtpSuccess:o=>{o!=null&&X.saveZeniOtpTokenForCardHolder(o,r)},onCVVActivateSuccess:()=>{e(an({chargeCardId:r}))},onBackClick:()=>{const o=ve(n.state?.pathnameStackToGoBack),i=o.poppedPathname==null||o.poppedPathname.includes("onboard")===!0?Ne(I):o.poppedPathname;a(i,{state:{pathnameStackToGoBack:o.newStack}})}}})(mr),Yr=_e.div`
1
+ import{j as s}from"./liveblocks-D1TxH59e.js";import{h as le,i as ca,u as ue,j as y,g as ge,n as pe,N as ga,s as ut,o as Wt,p as te}from"./core-Fwwp8hop.js";import{eP as ce,bs as Ue,Pa as ka,eY as be,eZ as ye,e_ as Se,fT as Ge,cs as ze,Pb as Ye,Pc as Ma,tq as ba,jL as ya,Pd as Sa,gQ as oa,zW as Xe,zY as $a,zZ as Ga,jB as mt,Pe as Ze,zK as Ct,Pf as qt,Pg as Qt,zN as Da,Ph as Jt,Nz as _a,rC as pt,zT as za,g$ as Xt,Pi as ht,Pj as Ke,bq as en,Pk as an,fE as Pa,fD as wa,Ar as tn,fC as Ta,Nf as nn,Pl as ft,cl as gt,cM as rn,Ny as da,B1 as sn,Pm as tt,AD as Fa,Pn as bt,B2 as on,N_ as cn,B3 as dn,BZ as ln,sM as un,BT as mn,Ac as yt,A5 as Cn,Po as pn,fV as hn,Al as St,Ap as It,fU as fn,Pp as gn,AP as At,Pq as bn,Pr as yn,Ps as Sn,An as Et,A8 as kt,zQ as Dt,Ah as _t,Af as Pt,Aj as In,zX as nt,Pt as wt,Pu as va,AA as Ia,Ke as Tt,cN as Ya,Pv as An,Pw as En,Px as kn,Py as Dn,Ax as Na,AW as _n,AS as Pn,At as wn,AU as Tn,AK as Fn,AM as vn,Pz as Ft,B0 as vt,HD as xn,PA as Bn,PB as Ln,PC as Rn,PD as xt,PE as Un,Bn as On,AC as Bt,Aw as ia,AB as jn,PF as Nn,PG as Vn,zH as Hn,PH as Lt,PI as Rt,PJ as Mn,zJ as $n,zI as rt,PK as Gn,PL as zn,PM as Yn,Ka as Zn,PN as Za,PO as Kn,wi as Ut,kj as Wn,gR as qn,Bs as Qn,PP as Ot,PQ as Jn,Bt as Xn,PR as er,de as ar,tk as tr,Bi as nr,Bc as Re,bt as rr,bF as sr,cx as or,bG as ir,Jn as cr}from"./zeni-epic-state-i1VxNGkd.js";import{z as X,k as je,$ as se,I as Y,q as la,c3 as xa,ce as dr,p as ve,cf as lr,cg as ur,J as ua,aN as Fe,m as fe,bm as Ka,ch as mr,s as ma,i as Ba,h as Wa,c as Q,O as qa,ci as Cr,Y as jt,aq as Qa,by as Qe,cj as Va,ck as pr,H as Ja,a7 as hr,cl as fr,at as Nt,a2 as Ha,U as Vt,e as Ht,cm as gr,cn as br,co as yr,cp as Sr,cq as Ir,cr as Ar,o as Aa,cs as Er,ct as kr,cu as Ua,F as Dr,cv as _r,cw as Pr,cx as wr,cy as Tr,cz as Fr,a9 as vr}from"./index-Sm9Ycasn.js";import{n as _e,D as Mt,S as xr}from"./mui-Dar_oGjJ.js";import{a as c}from"./sentry-5pTQe3BK.js";import{g as Ce,a as Ca,b as $t,c as Ie,d as Ae,e as Oe,f as Ne,A as Br,h as Xa,P as Lr,i as et,s as Je,j as Gt,k as Me,l as zt,m as Rr,n as Yt,p as Ur,S as st}from"./SetupPagesScreen-_IKYoHXM.js";import{u as Or}from"./useInitialThreadRequest-ELLLToSA.js";import La from"./NotFoundScreen-Brpo5hIh.js";import{M as $e}from"./MobileAppDrawer-n526oWrk.js";import{u as Zt}from"./useAskAiCfoHostNavButtonProps-B40bGqEV.js";import{v as ot}from"./utils-3_hFkWEq.js";import{t as jr}from"./AddressScreen-CWbRsmbp.js";import"./recharts-DuOI9Nsb.js";import"./analytics-D310XSjQ.js";import"./plaid-BGhwh8RZ.js";import"./dnd-B_nt-Uf4.js";import"./stripe-DMRn4zHo.js";import"./lottie-BGeomX3N.js";import"./lexical-D4DqnnDh.js";import"./pdf-BftxTBXg.js";import"./analyticsHelper-CnXSrEd_.js";import"./routePaths-Pqm-PNC8.js";import"./BusinessVerificationPageScreen-CKWDQbki.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]="01f23871-ba8e-4401-9d03-2ad4353bafb0",e._sentryDebugIdIdentifier="sentry-dbid-01f23871-ba8e-4401-9d03-2ad4353bafb0")}catch{}})();function Nr(){const e=le(),{cardId:t}=ca(),a=ue(),r=X.getSignedInUser(),n=y(J=>ce(J)),m=je(),u=Ue(m?.loggedInUserRoleMap),{useFeatureGate:f}=se();if(r==null)throw Error("Can't access Add To Wallet Page without signing in...");const[I,o]=c.useState(!1),i=y(J=>ka(J).firstViewAfterActivation);if(t==null)throw Error("Empty card id is not valid...");const E=n.userRole.includes("charge_card_user"),{isFeatureEnabled:S}=f(Y.isChargeCardFeatureEnabled),h=!!n.companyChargeCardInfo?.info?.isChargeCardEnabled,{isFeatureEnabled:U}=f(Y.isDebitCardFeatureEnabled),v=be(n),k=ye(n),C=Se(U,n),b=n.companyChargeCardInfo?.info?.chargeCardsCreditAccountLimit??0,g=Ie({isDebitCardFeatureEnabled:U,isBankingOnlyTenant:C}),d=Ae({isCardsOnlyTenant:v,isChargeCardFeatureEnabled:S,isBookKeepingTenant:k,isDebitCardProductVisible:g,chargeCardsCreditAccountLimit:b}),D=!!n.companyDebitCardInfo?.info?.isDebitCardEnabled,T=y(J=>Ge(J,n.companyId)),V=ze(T.controllers),{creditAccount:L,creditAccountRepayment:w}=y(J=>Ye(J)),H=y(J=>J.classListState.fetchState),p=!E&&d&&h,l=y(J=>Ma(J,t,p,d)),[_,F]=c.useState(!1),N=l.chargeCard,R=N?.cardCreatedByUser?.userId,G=y(J=>R!=null?ba(J.userRoleState,R):void 0),P=G?.accountingClassIDs[0],B=y(J=>P!=null?ya(J.classState,{classId:P,reportId:"class_list"}):void 0),j=N?.cardHolderUser?.userId,O=y(J=>j!=null?ba(J.userRoleState,j):void 0),W=O?.accountingClassIDs[0],A=y(J=>W!=null?ya(J.classState,{classId:W,reportId:"class_list"}):void 0),Z=N?.type.code==="business_physical_credit_card"||N?.type.code==="business_physical_debit_card",q=N?.type.code==="business_physical_debit_card";c.useEffect(()=>{i&&I===!1&&Z&&(o(!0),setTimeout(()=>{a(Sa()),q&&a(oa({messageSection:"set_debit_card_pin",messageText:"success",type:"success",showStatusIcon:!0}))},5e3))},[i,I,Z,q]),c.useEffect(()=>{_||l.fetchState==="Completed"||l.fetchState==="In-Progress"||t==null||(F(!0),a(Xe(t,p,!1)))},[_,l,t,a]),c.useEffect(()=>{if(l.fetchState==="Completed"&&(Z===!1||Z&&N?.status?.code!=="active"||N?.cardHolderUserId!==r.userId||i===!1&&I===!1||N?.type.code==="business_physical_debit_card"||N?.type.code==="business_virtual_debit_card")){const J=Ce(n.tenantEmailDomain,t,r,N,i);e(J)}},[l.fetchState,i,Z]),c.useEffect(()=>{L.fetchState!=="Completed"&&L.fetchState!=="In-Progress"&&d&&h&&u&&a($a()),w.fetchState!=="Completed"&&w.fetchState!=="In-Progress"&&d&&h&&u&&a(Ga()),H!=="Completed"&&H!=="In-Progress"&&a(mt())},[L.fetchState,w.fetchState,a,d,h,u,H]);const z=()=>{if(r!=null&&t!=null){a(Sa());const J=Ce(n.tenantEmailDomain,t,r);e(J)}},x=N?.type.code==="business_physical_debit_card"||N?.type.code==="business_virtual_debit_card",oe=Oe(d,g,D,h),ae=Ca(d,h,u,L,w),ne=$t(x,l);return l.fetchState!=="Completed"?s.jsx(la,{fetchState:"In-Progress"}):s.jsxs(s.Fragment,{children:[s.jsx(xa,{showConfetti:i}),s.jsx(dr,{onGotItClick:z,isDebitCard:N?.type.code==="business_physical_debit_card",controllerEmails:V,isChargeCardFeatureEnabled:d,isDebitCardFeatureEnabled:g,isDebitCardSetupEnabled:D,isChargeCardSetupEnabled:h,productInformation:oe,creditAccountInformation:ae,debitAccountInformation:ne,chargeCardDetailView:l,creditAccount:L,classListFetchState:H,creditAccountRepayment:w,cardIssuedByRoles:G?.userRoles,cardIssuedByDepartmentName:B?.className,cardHolderRoles:O?.userRoles,cardHolderDepartmentName:A?.className})]})}const Vr=pe(function(e){const t=Ze(e);return{insightsData:t.insight,cashbackByPeriod:t.cashbackByPeriod,uiState:t.uiState,cashbackSummary:t.cashbackSummary}},function(e){return{onColumnSortConfigChanged:(t,a)=>{e(qt({uiState:{sortKey:t,sortOrder:a}}))}}})(ur);function Hr(){const e=le(),t=ue(),a=ge(),r=X.getSignedInUser(),n=y(S=>ce(S)),{useFeatureGate:m}=se(),{isFeatureEnabled:u}=m(Y.isCardsCommentingEnabled),[f,I]=c.useState(!1),o=y(S=>Ze(S)),i=Or(n.companyId,{clearParams:o.fetchState==="Completed"}),E=c.useCallback(()=>{const S=ve(a.state?.pathnameStackToGoBack),h=S.poppedPathname??Mr(n.tenantEmailDomain);e(h,{state:{pathnameStackToGoBack:S.newStack}})},[e,a,n.tenantEmailDomain]);if(c.useEffect(()=>{f||o.fetchState==="Completed"||o.fetchState==="In-Progress"||(I(!0),t(Ct()))},[f,o,t]),r==null)throw Error("Can't access cashback detail page without signing in...");return o.fetchState==="In-Progress"?s.jsx(lr,{onBackClick:E}):o.cashbackSummary.cashbackEarned.amount===0&&o.fetchState==="Completed"?s.jsx(La,{}):s.jsx(Vr,{onBackClick:E,isCardsCommentingEnabled:u,initialOpenThreadRequest:i})}const Mr=e=>`/${e}/cards`,$r={containerWidth:new ma(100,58)},Gr=({appContent:e})=>{const t=ua(),a=ue(),r=le(),{cardId:n}=ca(),m=ge(),{useDynamicConfig:u}=se(),[f,I]=c.useState(!1),[o,i]=c.useState(!1),[E,S]=c.useState(!1),[h,U]=c.useState(!1),v=X.getSignedInUser();if(v==null)throw Error("Can't access onboarding card page without signing in...");const k=y(A=>ce(A));if(n==null)throw Error("Empty card id is not valid...");const{configValue:C}=u(Fe.zeniCardsConfig),b=C.max_charge_card_activation_attempts_by_card_id,g=y(A=>Qt(A,n)),d=g.chargeCard,D=y(A=>A.chargeCardConfigState.fetchState),{useFeatureGate:T}=se(),{isFeatureEnabled:V}=T(Y.isChargeCardFeatureEnabled),{isFeatureEnabled:L}=T(Y.isDebitCardFeatureEnabled),w=Se(L,k),H=Ie({isDebitCardFeatureEnabled:L,isBankingOnlyTenant:w}),p=!!k.companyChargeCardInfo?.info?.isChargeCardEnabled,l=k.userRole.includes("charge_card_user"),_=be(k),F=ye(k),N=k.companyChargeCardInfo?.info?.chargeCardsCreditAccountLimit??0,R=Ae({isCardsOnlyTenant:_,isChargeCardFeatureEnabled:V,isBookKeepingTenant:F,isDebitCardProductVisible:H,chargeCardsCreditAccountLimit:N}),G=!l&&R&&p;c.useEffect(()=>{f===!1&&D!=="In-Progress"&&D!=="Completed"&&(a(Da()),I(!0)),o===!1&&g.fetchState==="Not-Started"&&(i(!0),a(Xe(n,G,R)))},[o,g.fetchState,f,D]);const P=d?.type.code==="business_physical_credit_card"||d?.type.code==="business_physical_debit_card";c.useEffect(()=>{if(g.fetchState==="Completed"){if(E===!1&&(P===!1||P&&d?.status?.code!=="inactive"||d?.cardHolderUserId!==v.userId)){const A=Ce(k.tenantEmailDomain,n,v,d,!0),Z=fe(m.state?.pathnameStackToGoBack,m.pathname);r(A,{state:{pathnameStackToGoBack:Z}})}else if(E&&g.isRefreshingViewInBackground===!1&&d?.status?.code==="active"){a(Jt({chargeCardId:n}));const A=Ce(k.tenantEmailDomain,n,v,d,!0),Z=fe(m.state?.pathnameStackToGoBack,m.pathname);a(_a()),r(A,{state:{pathnameStackToGoBack:Z}})}}},[g.fetchState,d?.type.code,E,g.isRefreshingViewInBackground]);const B=X.getZeniOtpTokenForCardHolder(n),j=y(A=>pt(A.userState,v.userId)),O=()=>{d?.status?.code!=="active"&&a(za(n,!0))};c.useEffect(()=>{g.updatePhysicalChargeCardAttemptFetchState.fetchState==="Completed"&&d?.cardActivationAttemptHistory.some(A=>A.statusCode==="success")===!0&&E===!1&&(setTimeout(O,3e3),S(!0))},[g.updatePhysicalChargeCardAttemptFetchState.fetchState,d?.cardActivationAttemptHistory]);const W=A=>{U(A)};if(D!=="Completed"||d==null)return s.jsx(la,{fetchState:"In-Progress"});if(d.shippingAddressId==null)throw Error("Can't access shippingAddressId.");if(j?.phone==null)throw Error("Can't access user phone number.");return s.jsxs(Zr,{children:[s.jsx($e,{isAppContentDrawerOpen:h,handleDrawerToggle:W}),s.jsx(zr,{cardId:n,card:d,shippingAddressId:d.shippingAddressId,phone:j.phone,signedInUser:v,isSandboxEnv:Ka(),chargeCardDetailState:g,signedInUserToken:B,navigate:r,currentTenant:k,location:m,maxChargeCardActivationAttempts:b[n]!=null?b[n]:C.default_max_charge_card_activation_attempts!=null?C.default_max_charge_card_activation_attempts:3,chargeCardCashbackRatePerTransaction:C.charge_card_cashback_rate_per_transaction!=null?C.charge_card_cashback_rate_per_transaction:.0175,onClickMenuIcon:()=>{W(!0)}}),e!=null?s.jsx(Yr,{windowSize:t,children:e}):null]})},zr=pe(function(e,{chargeCardDetailState:t,shippingAddressId:a,location:r,cardId:n}){const m=Xt(e.addressState,a);if(m==null)throw Error("Can't access shippingAddress.");const u=ht(e,n),f=t.updateStatus,I=Ke(e,!1,!1,!1);let o=!1;I.fetchState==="Completed"&&I.cards.length<=1&&(o=!0);const i=r.state?.message==="comingFromV2UrlPath";return{showActivatePage:t.chargeCard?.providerCardCreateTime!=null&&t.chargeCard.providerCardCreateTime.add(24,"h").isBefore(en())||i,showMenuIcon:o,shippingAddress:m,vgsVaultId:Ba.cardVaultId,twoFAView:u,activationWaitStatus:f,isRefreshingViewInBackground:t.isRefreshingViewInBackground}},function(e,t){const{navigate:a,cardId:r,location:n,currentTenant:m,chargeCardDetailState:u}=t,f=u.chargeCard?.cardProviderID,{tenantEmailDomain:I}=m;return{onGetOtp:o=>{f!=null&&e(Ta(o,"ChargeCardHolder",r))},onUpdatePhysicalChargeCardAttempt:o=>{e(tn(r,o))},onResendOtp:o=>{f!=null&&e(wa(o,"ChargeCardHolder",r))},onVerifyOtp:(o,i)=>{f!=null&&e(Pa(o,i,"ChargeCardHolder",r))},onVerifyOtpSuccess:o=>{o!=null&&X.saveZeniOtpTokenForCardHolder(o,r)},onCVVActivateSuccess:()=>{e(an({chargeCardId:r}))},onBackClick:()=>{const o=ve(n.state?.pathnameStackToGoBack),i=o.poppedPathname==null||o.poppedPathname.includes("onboard")===!0?Ne(I):o.poppedPathname;a(i,{state:{pathnameStackToGoBack:o.newStack}})}}})(mr),Yr=_e.div`
2
2
  display: flex;
3
3
  flex-direction: column;
4
4
  width: ${e=>`${$r.containerWidth.value(e.windowSize)}%`};
@@ -1 +1 @@
1
- import{j as m}from"./liveblocks-D1TxH59e.js";import{a as g}from"./sentry-5pTQe3BK.js";import{h as w,u as k,g as x,i as T,j as O,n as E}from"./core-Fwwp8hop.js";import{z as C,b7 as P,H as F,c as V,e as j,af as b,b8 as A,at as L,au as M,m as U}from"./index-BcoFhJ4O.js";import{eP as D,fG as B,sb as _,fB as G,c2 as R,ME as z,bn as H,qc as q,q0 as Y,kb as Z,lH as S,MF as $,bE as J,cv as N,lP as K,lS as Q}from"./zeni-epic-state-i1VxNGkd.js";import"./mui-Dar_oGjJ.js";import{d as W}from"./routePaths-BPSPu97F.js";import{M as X}from"./MobileAppDrawer-BkelcJG3.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]="e50ec17b-6eea-4c1c-a5c3-7df42d87fc61",t._sentryDebugIdIdentifier="sentry-dbid-e50ec17b-6eea-4c1c-a5c3-7df42d87fc61")}catch{}})();const ee=E(function(t){const a=G(t),i=C.getSignedInUser(),l=D(t),c=l.tenantId,p={userId:i?.userId??"",sessionId:i?.zeniSessionId??"",tenantId:c??""},f=R(l?.userRole??[])&&a.localData.updateStatus.fetchState!=="In-Progress"?void 0:"readonly",e=z(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:`${L.fileMicroServiceBaseUrl}`,isZeniUser:H(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=U(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,v={companyInfo:{...n,website:u!=""&&u!=null?N(u):void 0,meetingLink:y!=""&&y!=null?N(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:M(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:v}))},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(Y(e))},onEditFileName:(e,n)=>{t(q(e,n.split(".")[0]))}}})(A);function de(){const t=w(),a=k(),i=x(),{tenantEmailDomain:l}=T(),[c,p]=g.useState(!1),[f,e]=g.useState(!1),n=O(s=>s.companyViewState.passportView.fetchState),o=O(s=>s.companyConfigState.fetchState),r=O(s=>D(s)),d=r.companyId??C.getSignedInUserTenant(l)?.companyId;if(C.getSignedInUser()==null)throw Error("Can't access company details page without signing in...");g.useEffect(()=>{c||n!=="Not-Started"||d==null||(p(!0),a(B(d)))},[c,n,d,a]),g.useEffect(()=>{o==="Not-Started"&&a(_())},[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(P,{onGoHome:()=>t("../",{replace:!0}),onReload:()=>window.location.reload()}):m.jsxs(m.Fragment,{children:[m.jsx(F,{analytics:V,onLoad:s=>s.trackPageLoaded(j.Event.companyPassport,b(i)?"Settings":"Company Passport")}),b(i)?m.jsx(X,{isAppContentDrawerOpen:f,handleDrawerToggle:u}):null,m.jsx(ee,{companyId:d,navigate:t,location:i,isLoading:y,currentTenant:r,isSettings:b(i),onClickMenuIcon:()=>{u(!0)}})]})}export{de as C};
1
+ import{j as m}from"./liveblocks-D1TxH59e.js";import{a as g}from"./sentry-5pTQe3BK.js";import{h as w,u as k,g as x,i as T,j as O,n as E}from"./core-Fwwp8hop.js";import{z as C,b7 as P,H as F,c as V,e as j,af as b,b8 as A,at as L,au as M,m as U}from"./index-Sm9Ycasn.js";import{eP as D,fG as B,sb as _,fB as G,c2 as R,ME as z,bn as H,qc as q,q0 as Y,kb as Z,lH as S,MF as $,bE as J,cv as N,lP as K,lS as Q}from"./zeni-epic-state-i1VxNGkd.js";import"./mui-Dar_oGjJ.js";import{d as W}from"./routePaths-Pqm-PNC8.js";import{M as X}from"./MobileAppDrawer-n526oWrk.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]="e50ec17b-6eea-4c1c-a5c3-7df42d87fc61",t._sentryDebugIdIdentifier="sentry-dbid-e50ec17b-6eea-4c1c-a5c3-7df42d87fc61")}catch{}})();const ee=E(function(t){const a=G(t),i=C.getSignedInUser(),l=D(t),c=l.tenantId,p={userId:i?.userId??"",sessionId:i?.zeniSessionId??"",tenantId:c??""},f=R(l?.userRole??[])&&a.localData.updateStatus.fetchState!=="In-Progress"?void 0:"readonly",e=z(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:`${L.fileMicroServiceBaseUrl}`,isZeniUser:H(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=U(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,v={companyInfo:{...n,website:u!=""&&u!=null?N(u):void 0,meetingLink:y!=""&&y!=null?N(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:M(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:v}))},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(Y(e))},onEditFileName:(e,n)=>{t(q(e,n.split(".")[0]))}}})(A);function de(){const t=w(),a=k(),i=x(),{tenantEmailDomain:l}=T(),[c,p]=g.useState(!1),[f,e]=g.useState(!1),n=O(s=>s.companyViewState.passportView.fetchState),o=O(s=>s.companyConfigState.fetchState),r=O(s=>D(s)),d=r.companyId??C.getSignedInUserTenant(l)?.companyId;if(C.getSignedInUser()==null)throw Error("Can't access company details page without signing in...");g.useEffect(()=>{c||n!=="Not-Started"||d==null||(p(!0),a(B(d)))},[c,n,d,a]),g.useEffect(()=>{o==="Not-Started"&&a(_())},[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(P,{onGoHome:()=>t("../",{replace:!0}),onReload:()=>window.location.reload()}):m.jsxs(m.Fragment,{children:[m.jsx(F,{analytics:V,onLoad:s=>s.trackPageLoaded(j.Event.companyPassport,b(i)?"Settings":"Company Passport")}),b(i)?m.jsx(X,{isAppContentDrawerOpen:f,handleDrawerToggle:u}):null,m.jsx(ee,{companyId:d,navigate:t,location:i,isLoading:y,currentTenant:r,isSettings:b(i),onClickMenuIcon:()=>{u(!0)}})]})}export{de as C};
@@ -1,4 +1,4 @@
1
- import{j as C}from"./liveblocks-D1TxH59e.js";import{a}from"./sentry-5pTQe3BK.js";import{u as D,g as v,j as u,N as w}from"./core-Fwwp8hop.js";import{Jj as O,eP as j,fo as A,mT as U,fP as h,fn as _,eW as L,Jq as F}from"./zeni-epic-state-i1VxNGkd.js";import{u as P,z as p,L as g,O as $,o as k}from"./index-BcoFhJ4O.js";import{n as H}from"./mui-Dar_oGjJ.js";import{t as z}from"./getLocaleForTenant-JJvZDWEQ.js";import{g as R,Q as J}from"./QBOConnectionScreen-CPvxeBk6.js";import"./recharts-DuOI9Nsb.js";import"./analytics-D310XSjQ.js";import"./plaid-BGhwh8RZ.js";import"./dnd-B_nt-Uf4.js";import"./stripe-DMRn4zHo.js";import"./lottie-BGeomX3N.js";import"./lexical-D4DqnnDh.js";import"./pdf-BftxTBXg.js";import"./utils-3_hFkWEq.js";import"./empty-BOxndxwD.js";import"./pdf-lib-oQPUkPP1.js";import"./index-D6xVpTbl.js";import"./url-CfkU6Gnm.js";import"./index-CfQpPMgv.js";import"./decodeURIComponentSafe-DaWuthXc.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]="d1cb094e-b022-44a6-a38f-561589a663de",t._sentryDebugIdIdentifier="sentry-dbid-d1cb094e-b022-44a6-a38f-561589a663de")}catch{}})();const q=H.div`
1
+ import{j as C}from"./liveblocks-D1TxH59e.js";import{a}from"./sentry-5pTQe3BK.js";import{u as D,g as v,j as u,N as w}from"./core-Fwwp8hop.js";import{Jj as O,eP as j,fo as A,mT as U,fP as h,fn as _,eW as L,Jq as F}from"./zeni-epic-state-i1VxNGkd.js";import{u as P,z as p,L as g,O as $,o as k}from"./index-Sm9Ycasn.js";import{n as H}from"./mui-Dar_oGjJ.js";import{t as z}from"./getLocaleForTenant-B-vHrKHL.js";import{g as R,Q as J}from"./QBOConnectionScreen-DvvmYU71.js";import"./recharts-DuOI9Nsb.js";import"./analytics-D310XSjQ.js";import"./plaid-BGhwh8RZ.js";import"./dnd-B_nt-Uf4.js";import"./stripe-DMRn4zHo.js";import"./lottie-BGeomX3N.js";import"./lexical-D4DqnnDh.js";import"./pdf-BftxTBXg.js";import"./utils-3_hFkWEq.js";import"./empty-BOxndxwD.js";import"./pdf-lib-oQPUkPP1.js";import"./index-D6xVpTbl.js";import"./url-CfkU6Gnm.js";import"./index-CfQpPMgv.js";import"./decodeURIComponentSafe-DaWuthXc.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]="d1cb094e-b022-44a6-a38f-561589a663de",t._sentryDebugIdIdentifier="sentry-dbid-d1cb094e-b022-44a6-a38f-561589a663de")}catch{}})();const q=H.div`
2
2
  display: flex;
3
3
  flex: 1 1 auto;
4
4
  flex-direction: row;
@@ -1 +1 @@
1
- import{j as i}from"./liveblocks-D1TxH59e.js";import{z as n}from"./index-BcoFhJ4O.js";import{g as d}from"./QBOConnectionScreen-CPvxeBk6.js";import"./sentry-5pTQe3BK.js";import{g as p,N as a}from"./core-Fwwp8hop.js";import"./zeni-epic-state-i1VxNGkd.js";import"./recharts-DuOI9Nsb.js";import"./mui-Dar_oGjJ.js";import"./analytics-D310XSjQ.js";import"./plaid-BGhwh8RZ.js";import"./dnd-B_nt-Uf4.js";import"./stripe-DMRn4zHo.js";import"./lottie-BGeomX3N.js";import"./lexical-D4DqnnDh.js";import"./pdf-BftxTBXg.js";import"./utils-3_hFkWEq.js";import"./empty-BOxndxwD.js";import"./pdf-lib-oQPUkPP1.js";import"./index-D6xVpTbl.js";import"./url-CfkU6Gnm.js";import"./index-CfQpPMgv.js";import"./decodeURIComponentSafe-DaWuthXc.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]="e53e9b9f-4e1e-4d41-afae-a46e42efc4b3",e._sentryDebugIdIdentifier="sentry-dbid-e53e9b9f-4e1e-4d41-afae-a46e42efc4b3")}catch{}})();const U=()=>{const e=p(),{code:t,realmId:o,state:r}=d(e.search),s=n.getSignedInUser()?.userId??"";if(f(t,o,r,s)===!0){const m=`../../${r}/onboarding?code=${t}&realmId=${o}&state=auth_flow`;return i.jsx(a,{to:m})}return i.jsx(a,{to:"../../"})},f=(e,t,o,r)=>e!=""&&t!=""&&o!=""&&r!=null&&r!="";export{U as default,f as hasValidParams};
1
+ import{j as i}from"./liveblocks-D1TxH59e.js";import{z as n}from"./index-Sm9Ycasn.js";import{g as d}from"./QBOConnectionScreen-DvvmYU71.js";import"./sentry-5pTQe3BK.js";import{g as p,N as a}from"./core-Fwwp8hop.js";import"./zeni-epic-state-i1VxNGkd.js";import"./recharts-DuOI9Nsb.js";import"./mui-Dar_oGjJ.js";import"./analytics-D310XSjQ.js";import"./plaid-BGhwh8RZ.js";import"./dnd-B_nt-Uf4.js";import"./stripe-DMRn4zHo.js";import"./lottie-BGeomX3N.js";import"./lexical-D4DqnnDh.js";import"./pdf-BftxTBXg.js";import"./utils-3_hFkWEq.js";import"./empty-BOxndxwD.js";import"./pdf-lib-oQPUkPP1.js";import"./index-D6xVpTbl.js";import"./url-CfkU6Gnm.js";import"./index-CfQpPMgv.js";import"./decodeURIComponentSafe-DaWuthXc.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]="e53e9b9f-4e1e-4d41-afae-a46e42efc4b3",e._sentryDebugIdIdentifier="sentry-dbid-e53e9b9f-4e1e-4d41-afae-a46e42efc4b3")}catch{}})();const U=()=>{const e=p(),{code:t,realmId:o,state:r}=d(e.search),s=n.getSignedInUser()?.userId??"";if(f(t,o,r,s)===!0){const m=`../../${r}/onboarding?code=${t}&realmId=${o}&state=auth_flow`;return i.jsx(a,{to:m})}return i.jsx(a,{to:"../../"})},f=(e,t,o,r)=>e!=""&&t!=""&&o!=""&&r!=null&&r!="";export{U as default,f as hasValidParams};
@@ -1,4 +1,4 @@
1
- import{j as a}from"./liveblocks-D1TxH59e.js";import{t as $e,A as Ce}from"./AddressScreen-DxaubiXq.js";import Ke from"./NotFoundScreen-Dpz39bup.js";import{a as g}from"./sentry-5pTQe3BK.js";import{h as oe,g as se,u as ie,i as re,j as A,N as E,n as ce,l as qe,o as ze,p as q}from"./core-Fwwp8hop.js";import{F as de,k as le,z as B,$ as ue,h as Me,I as _,m as V,H as J,c as N,q as we,e as Y,ap as Qe,J as Ze,aq as ke,i as te,ar as He,as as Ie,o as Je,at as We,au as Ee,av as Ye}from"./index-BcoFhJ4O.js";import{bn as Xe,eP as ee,fg as et,e_ as pe,eY as me,bt as tt,mR as at,fc as nt,bO as ot,jf as ae,ji as ve,JP as st,bT as it,c2 as ge,sp as he,sa as rt,Kj as X,sq as _e,HH as ct,kj as Ue,Kk as Ve,Kl as dt,Km as lt,Kn as ut,jd as pt,jg as mt,sc as Be,so as gt,bE as Te,cv as ht,sC as xe,qc as ft,q0 as yt,kb as bt,fE as St,fD as Ct,fC as kt,Ko as It,s4 as Et,sD as Tt,sG as xt,sJ as Ot,sP as Pt,cT as Dt}from"./zeni-epic-state-i1VxNGkd.js";import{n as fe}from"./mui-Dar_oGjJ.js";import{g as At,h as Ft,q as ne}from"./QBOConnectionScreen-CPvxeBk6.js";import"./recharts-DuOI9Nsb.js";import"./analytics-D310XSjQ.js";import"./plaid-BGhwh8RZ.js";import"./dnd-B_nt-Uf4.js";import"./stripe-DMRn4zHo.js";import"./lottie-BGeomX3N.js";import"./lexical-D4DqnnDh.js";import"./pdf-BftxTBXg.js";import"./utils-3_hFkWEq.js";import"./empty-BOxndxwD.js";import"./pdf-lib-oQPUkPP1.js";import"./index-D6xVpTbl.js";import"./url-CfkU6Gnm.js";import"./index-CfQpPMgv.js";import"./decodeURIComponentSafe-DaWuthXc.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]="1c20dba0-3ed2-4d18-9f43-26bec3004a04",t._sentryDebugIdIdentifier="sentry-dbid-1c20dba0-3ed2-4d18-9f43-26bec3004a04")}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"}})}}})(Qe),wt=()=>{const t=oe(),o=se(),s=ie(),u=de(),[d,r]=g.useState(!1),[p,b]=g.useState(!1),{tenantEmailDomain:e}=re(),n=le(),i=B.getSignedInUser(),h=Xe(i),{useFeatureGate:m}=ue(),I=Me(),{isFeatureEnabled:T}=m(_.isApAgingFeatureEnabled),{isFeatureEnabled:x}=m(_.isArAgingFeatureEnabled),{isFeatureEnabled:k}=m(_.isDepositAccountsFeatureEnabled),{isFeatureEnabled:f}=m(_.isReferralFeatureEnabled),{isFeatureEnabled:U}=m(_.isExpenseAutomationEnabled),{isFeatureEnabled:C}=m(_.isExpenseAutomationEnabledV2),{isFeatureEnabled:F}=m(_.isDebitCardFeatureEnabled),$=C||U&&h,c=A(l=>ee(l)),{isFeatureEnabled:L}=m(_.isTreasuryEnabled),j=c.company!=null&&et(c.company),R=L&&j,O=A(l=>l.onboardingCustomerViewState.fetchState),S=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),D=[],Q=S?.resources?.find(l=>l.resource==="/reports/top_expenses")==null,K=S?.resources?.find(l=>l.resource==="/reports/task_card")==null,z=c?.userRole!=null&&tt(c?.userRole),v=S?.resources?.find(l=>l.resource==="/bills")==null&&!z,M=S?.resources?.find(l=>l.resource==="/reimbursements")==null;if(Q===!1&&D.push("top_expenses"),K===!1&&D.push("task_card"),v===!1&&D.push("bill_pay_card","bill_pay_promo_card"),M===!1&&D.push("reimbursement_card","reimbursement_promo_card"),k===!1&&D.push("zeni_accounts_promo_card"),f===!1&&D.push("rewards_card"),g.useEffect(()=>{O!=="Completed"||d||w||P||(r(!0),s(at(i.userId,G,c.tenantId,!0,!1,D)))},[d,O,w,P,i,c.tenantId,s]),g.useEffect(()=>{(w||P)&&setTimeout(()=>{b(!0)},5e3)},[w,P]),O!=="Completed")return a.jsx(E,{to:"../"});if(O==="Completed"&&p){const l=V(o.state?.pathnameStackToGoBack,o.pathname);if(w)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(J,{analytics:N,onLoad:l=>(Z=>Z.trackPageLoaded(Y.Event.onboardingDashboardActivation))(l)}),a.jsx(jt,{navigate:t,location:o,themeState:u,signedInUser:i,isApAgingFeatureEnabled:T,isArAgingFeatureEnabled:x,shouldFetchZeniAccountsPromoCard:k,shouldFetchRewardsPlanCard:f,isExpenseAutomationEnabledForUser:$,isExpenseAutomationFeatureEnabledV2:C,isTreasuryEnabled:R,loggedInUserRoleMap:n?.loggedInUserRoleMap})]}):a.jsx(we,{fetchState:"In-Progress",style:{backgroundColor:I.colors.grey5}})},Oe=fe.div`
1
+ import{j as a}from"./liveblocks-D1TxH59e.js";import{t as $e,A as Ce}from"./AddressScreen-CWbRsmbp.js";import Ke from"./NotFoundScreen-Brpo5hIh.js";import{a as g}from"./sentry-5pTQe3BK.js";import{h as oe,g as se,u as ie,i as re,j as A,N as E,n as ce,l as qe,o as ze,p as q}from"./core-Fwwp8hop.js";import{F as de,k as le,z as B,$ as ue,h as Me,I as _,m as V,H as J,c as N,q as we,e as Y,ap as Qe,J as Ze,aq as ke,i as te,ar as He,as as Ie,o as Je,at as We,au as Ee,av as Ye}from"./index-Sm9Ycasn.js";import{bn as Xe,eP as ee,fg as et,e_ as pe,eY as me,bt as tt,mR as at,fc as nt,bO as ot,jf as ae,ji as ve,JP as st,bT as it,c2 as ge,sp as he,sa as rt,Kj as X,sq as _e,HH as ct,kj as Ue,Kk as Ve,Kl as dt,Km as lt,Kn as ut,jd as pt,jg as mt,sc as Be,so as gt,bE as Te,cv as ht,sC as xe,qc as ft,q0 as yt,kb as bt,fE as St,fD as Ct,fC as kt,Ko as It,s4 as Et,sD as Tt,sG as xt,sJ as Ot,sP as Pt,cT as Dt}from"./zeni-epic-state-i1VxNGkd.js";import{n as fe}from"./mui-Dar_oGjJ.js";import{g as At,h as Ft,q as ne}from"./QBOConnectionScreen-DvvmYU71.js";import"./recharts-DuOI9Nsb.js";import"./analytics-D310XSjQ.js";import"./plaid-BGhwh8RZ.js";import"./dnd-B_nt-Uf4.js";import"./stripe-DMRn4zHo.js";import"./lottie-BGeomX3N.js";import"./lexical-D4DqnnDh.js";import"./pdf-BftxTBXg.js";import"./utils-3_hFkWEq.js";import"./empty-BOxndxwD.js";import"./pdf-lib-oQPUkPP1.js";import"./index-D6xVpTbl.js";import"./url-CfkU6Gnm.js";import"./index-CfQpPMgv.js";import"./decodeURIComponentSafe-DaWuthXc.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]="1c20dba0-3ed2-4d18-9f43-26bec3004a04",t._sentryDebugIdIdentifier="sentry-dbid-1c20dba0-3ed2-4d18-9f43-26bec3004a04")}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"}})}}})(Qe),wt=()=>{const t=oe(),o=se(),s=ie(),u=de(),[d,r]=g.useState(!1),[p,b]=g.useState(!1),{tenantEmailDomain:e}=re(),n=le(),i=B.getSignedInUser(),h=Xe(i),{useFeatureGate:m}=ue(),I=Me(),{isFeatureEnabled:T}=m(_.isApAgingFeatureEnabled),{isFeatureEnabled:x}=m(_.isArAgingFeatureEnabled),{isFeatureEnabled:k}=m(_.isDepositAccountsFeatureEnabled),{isFeatureEnabled:f}=m(_.isReferralFeatureEnabled),{isFeatureEnabled:U}=m(_.isExpenseAutomationEnabled),{isFeatureEnabled:C}=m(_.isExpenseAutomationEnabledV2),{isFeatureEnabled:F}=m(_.isDebitCardFeatureEnabled),$=C||U&&h,c=A(l=>ee(l)),{isFeatureEnabled:L}=m(_.isTreasuryEnabled),j=c.company!=null&&et(c.company),R=L&&j,O=A(l=>l.onboardingCustomerViewState.fetchState),S=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),D=[],Q=S?.resources?.find(l=>l.resource==="/reports/top_expenses")==null,K=S?.resources?.find(l=>l.resource==="/reports/task_card")==null,z=c?.userRole!=null&&tt(c?.userRole),v=S?.resources?.find(l=>l.resource==="/bills")==null&&!z,M=S?.resources?.find(l=>l.resource==="/reimbursements")==null;if(Q===!1&&D.push("top_expenses"),K===!1&&D.push("task_card"),v===!1&&D.push("bill_pay_card","bill_pay_promo_card"),M===!1&&D.push("reimbursement_card","reimbursement_promo_card"),k===!1&&D.push("zeni_accounts_promo_card"),f===!1&&D.push("rewards_card"),g.useEffect(()=>{O!=="Completed"||d||w||P||(r(!0),s(at(i.userId,G,c.tenantId,!0,!1,D)))},[d,O,w,P,i,c.tenantId,s]),g.useEffect(()=>{(w||P)&&setTimeout(()=>{b(!0)},5e3)},[w,P]),O!=="Completed")return a.jsx(E,{to:"../"});if(O==="Completed"&&p){const l=V(o.state?.pathnameStackToGoBack,o.pathname);if(w)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(J,{analytics:N,onLoad:l=>(Z=>Z.trackPageLoaded(Y.Event.onboardingDashboardActivation))(l)}),a.jsx(jt,{navigate:t,location:o,themeState:u,signedInUser:i,isApAgingFeatureEnabled:T,isArAgingFeatureEnabled:x,shouldFetchZeniAccountsPromoCard:k,shouldFetchRewardsPlanCard:f,isExpenseAutomationEnabledForUser:$,isExpenseAutomationFeatureEnabledV2:C,isTreasuryEnabled:R,loggedInUserRoleMap:n?.loggedInUserRoleMap})]}):a.jsx(we,{fetchState:"In-Progress",style:{backgroundColor:I.colors.grey5}})},Oe=fe.div`
2
2
  display: flex;
3
3
  height: 100vh;
4
4
  background-color: ${t=>t.theme.colors.grey4};
@@ -1,4 +1,4 @@
1
- import{j as d}from"./liveblocks-D1TxH59e.js";import{i as K,j as _,g as H,u as z,h as W,n as te,k as oa,o as gt,p as F}from"./core-Fwwp8hop.js";import{eP as U,KE as Xe,bE as sa,bq as xe,LR as In,i3 as Tn,LS as Nt,LT as xn,i6 as bt,LU as Qe,LV as Dn,ib as wn,LW as $t,LX as Fn,ig as Ct,LY as He,LZ as On,cl as St,L_ as Pn,L$ as Mn,KY as Rn,j9 as Bn,M0 as jn,bn as Ge,M1 as ra,Ks as ce,bc as ia,jn as ca,m$ as la,j6 as da,Ku as le,Kt as ee,eO as ua,eU as Ln,fq as kt,M2 as Un,M3 as Gn,M4 as ma,M5 as Re,uh as Ye,ui as Ve,uF as De,uz as de,um as Ne,M6 as Yn,M7 as Vn,M8 as Nn,M9 as pa,Ma as Be,Mb as $n,dE as Je,qM as ha,Mc as zn,Md as Kn,Me as qn,Mf as yt,JR as At,jD as we,uN as vt,qU as Zn,Mg as Qn,uj as zt,qP as Ie,qL as fa,Mh as ge,Mi as Hn,Mj as Et,JQ as It,sT as ga,Mk as Wn,Ml as Xn,Mm as Jn,Mn as Tt,t4 as eo,Mo as to,ul as Kt,sS as ba,Mp as be,Mq as ao,bt as Ca,uR as ka,Mr as no,Ms as oo,Mt as so,Mu as xt,uM as ro,Mv as io,uk as qt,uQ as _a,Mw as Ce,Mx as co,My as lo,Mz as Sa,js as ya,mY as Aa,jx as va,mW as Ea,mV as Ia,mU as Ta,sf as uo,fg as mo,cN as po,cO as ho,mR as fo,fc as go,n6 as bo,DV as Zt,MA as Co,MB as ko,MC as _o,MD as So,b5 as et,f4 as yo,gO as Ao,fG as vo,n0 as Eo,i$ as Io,mZ as To,mX as xo,e_ as Do,eY as wo}from"./zeni-epic-state-i1VxNGkd.js";import{z as j,a2 as ae,m as D,c as x,O as q,aU as Fo,Y as $e,H as ze,aV as xa,e as N,aW as Oo,k as _e,aX as Da,$ as Se,I as R,h as Po,aY as Mo,aZ as Ro,T as wa,J as Fa,a as Oa,X as Bo,a_ as jo,N as Lo,aN as Pa,Z as se,a$ as Ma,b0 as Ra,a1 as Ba,b1 as Uo,b2 as Go,aq as Yo,p as Vo,U as No,b3 as $o,b4 as zo,b5 as Ko,b6 as ke}from"./index-BcoFhJ4O.js";import{n as Dt}from"./mui-Dar_oGjJ.js";import{a as b}from"./sentry-5pTQe3BK.js";import{w as ja}from"./withTransactionSidePanel-Bez35evJ.js";import{c as La,t as Fe,f as ue,a as wt,v as qo}from"./routePaths-BPSPu97F.js";import{u as ne}from"./useAskAiCfoHostNavButtonProps-HZkyXVvQ.js";import Ue from"./NotFoundScreen-Dpz39bup.js";import{u as Ft}from"./useInitialThreadRequest-Ro9Y0en9.js";import{t as Ua}from"./analyticsHelper-StfDTSGk.js";import{C as Zo}from"./CompanyPassportScreen-Bh0KRqU9.js";import{u as Qo}from"./useAiCfoDashboardSuggestedQuestionsChips-CRHV9fCR.js";import{F as Ho}from"./FeaturePreviewScreen-DvNQU3gG.js";import{R as Wo}from"./ReferralListScreen-D2RlSd8S.js";import"./recharts-DuOI9Nsb.js";import"./analytics-D310XSjQ.js";import"./plaid-BGhwh8RZ.js";import"./dnd-B_nt-Uf4.js";import"./stripe-DMRn4zHo.js";import"./lottie-BGeomX3N.js";import"./lexical-D4DqnnDh.js";import"./pdf-BftxTBXg.js";import"./utils-3_hFkWEq.js";import"./TransactionDetailScreen-VjAJduyc.js";import"./decodeURIComponentSafe-DaWuthXc.js";import"./MobileAppDrawer-BkelcJG3.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]="8d6b37bc-e157-46a0-99a5-ac5d48c4ab92",e._sentryDebugIdIdentifier="sentry-dbid-8d6b37bc-e157-46a0-99a5-ac5d48c4ab92")}catch{}})();const Xo=ja(function({openTransactionPanel:e,panelContent:a,sidePanelIsOpen:t,sidePanelIsFullView:n}){const{vendorId:o,reportDate:r}=K(),s=j.getSignedInUser(),i=_(y=>y.tenantState.currentTenantId),c=_(y=>U(y)),{tenantEmailDomain:m}=K(),g=H(),C=c?.companyName??"",u={userId:s?.userId??"",sessionId:s?.zeniSessionId??"",tenantId:i??""},l=b.useMemo(()=>({authParams:u,companyName:C,downloadEndPoint:`${ae}/agingDetailedReport`,timezone:Xe()}),[]),h=b.useMemo(()=>r!=null?sa(r):xe(),[r]),p=z(),f=W(),A=_(y=>In(y,h,o)),E=b.useCallback(()=>{o!=null&&A.fetchState!=="In-Progress"&&A.fetchState!=="Completed"&&p(Tn(o,h))},[h]),S=b.useCallback(()=>{f("../../",{relative:"path"})},[]),I=b.useCallback((y,M)=>{p(Nt({sortKey:y,sortOrder:M}))},[]),T=b.useCallback(y=>{p(Nt({downloadState:y}))},[]),L=b.useCallback(y=>{if(e)e(y.transactionId,y.transactionType);else if(m!=null){const M=La({id:y.transactionId,type:y.transactionType},m);f(M);const X=D(g.state?.pathnameStackToGoBack,g.pathname);f(M,{state:{pathnameStackToGoBack:X}})}},[m,e]),k=b.useCallback(()=>{A.vendor!=null&&x.trackApAgingDetail("AP Aging",h.format(q.getLocalizedStrings().dateFormat.analytics.YYYYDashMMDashDDFormat),A.vendor.id,A.vendor.name)},[A.vendor,h]);return b.useEffect(()=>{E()},[]),b.useEffect(()=>{A.fetchState==="Completed"&&k()},[k,A.fetchState]),d.jsx(Fo,{apAgingDetail:A,downloadParams:l,reportDate:h,analytics:x,onTransactionClick:L,onReload:E,onBackClick:S,onColumnSortConfigChanged:I,updateDownloadStateHandler:T,panelContent:a,sidePanelIsOpen:t,sidePanelIsFullView:n})}),Jo=()=>{const e=z(),a=W(),t=_(I=>xn(I)),{isAiCfoAccessEnabled:n,onAskAiCfoClick:o}=ne({mobileExploreReferrer:"AP Aging"});$e({isDataReady:t.fetchState==="Completed"});const r=j.getSignedInUser(),s=_(I=>I.tenantState.currentTenantId),i=_(I=>U(I)),c=i?.companyName??"",m={userId:r?.userId??"",sessionId:r?.zeniSessionId??"",tenantId:s??""},g=b.useMemo(()=>({authParams:m,companyName:c,downloadEndPoint:`${ae}/agingReport`,timezone:Xe()}),[]),C=t.apAgingUIState.selectedDate??xe(),u=b.useCallback(()=>{t.fetchState!=="In-Progress"&&t.fetchState!=="Completed"&&e(bt(C))},[]);b.useEffect(()=>{u()},[]);const l=b.useCallback(()=>{a("../",{relative:"path"})},[]),h=b.useCallback(I=>{e(Qe({searchString:I}))},[]),p=b.useCallback((I,T)=>{e(Qe({sortKey:T,sortOrder:I}))},[]),f=b.useCallback(I=>{a(`./${I}/${C.format(q.getLocalizedStrings().dateFormat.analytics.YYYYDashMMDashDDFormat)}`)},[C]),A=b.useCallback(I=>{e(Qe({downloadState:I}))},[]),E=b.useCallback((I,T)=>{},[]),S=b.useCallback((I,T)=>{e(Qe({selectedDate:I,agingDateSelectionType:T})),e(bt(I))},[]);return d.jsxs(d.Fragment,{children:[t.fetchState==="Completed"?d.jsx(ze,{analytics:x,onLoad:I=>I.trackPageLoaded(N.Event.agingReport,"AP Aging")}):null,d.jsx(xa,{uiState:t.apAgingUIState,report:t,downloadParams:g,analytics:x,onReloadReport:u,onBackClick:l,onSearchTextChange:h,onSortOrderChange:p,onEntityNameClick:f,updateDownloadStateHandler:A,onSelectedDateChanged:S,onNodeCollapseToggled:E,isAiCfoAccessEnabled:n,onAskAiCfoClick:o})]})},es=ja(function({openTransactionPanel:e,panelContent:a,sidePanelIsOpen:t,sidePanelIsFullView:n}){const{customerId:o,reportDate:r}=K(),s=j.getSignedInUser(),i=_(k=>U(k)),{tenantEmailDomain:c}=K(),m=H(),g=i.companyName,C={userId:s?.userId??"",sessionId:s?.zeniSessionId??"",tenantId:i.tenantId},u=b.useMemo(()=>({authParams:C,companyName:g,downloadEndPoint:`${ae}/agingDetailedReport`,timezone:Xe()}),[]),l=b.useMemo(()=>r!=null?sa(r):xe(),[r]),h=z(),p=W(),f=_(k=>Dn(k,l,o)),A=b.useCallback(()=>{o!=null&&f.fetchState!=="In-Progress"&&f.fetchState!=="Completed"&&h(wn(o,l))},[l]),E=b.useCallback(()=>{p("../../",{relative:"path"})},[]),S=b.useCallback((k,y)=>{h($t({sortKey:k,sortOrder:y}))},[]),I=b.useCallback(k=>{h($t({downloadState:k}))},[]),T=b.useCallback(k=>{if(e)e(k.transactionId,k.transactionType);else if(c!=null){const y=La({id:k.transactionId,type:k.transactionType},c);p(y);const M=D(m.state?.pathnameStackToGoBack,m.pathname);p(y,{state:{pathnameStackToGoBack:M}})}},[c,e]),L=b.useCallback(()=>{f.customer!=null&&x.trackArAgingDetail("AR Aging",l.format(q.getLocalizedStrings().dateFormat.analytics.YYYYDashMMDashDDFormat),f.customer.id,f.customer.name)},[f.customer,l]);return b.useEffect(()=>{A()},[]),b.useEffect(()=>{f.fetchState==="Completed"&&L()},[f.fetchState,L]),d.jsx(Oo,{arAgingDetail:f,downloadParams:u,reportDate:l,analytics:x,onTransactionClick:T,onReload:A,onBackClick:E,onColumnSortConfigChanged:S,updateDownloadStateHandler:I,panelContent:a,sidePanelIsOpen:t,sidePanelIsFullView:n})}),ts=()=>{const e=z(),a=W(),t=_(S=>Fn(S)),{isAiCfoAccessEnabled:n,onAskAiCfoClick:o}=ne({mobileExploreReferrer:"AR Aging"});$e({isDataReady:t.fetchState==="Completed"});const r=j.getSignedInUser(),s=_(S=>U(S)),i=s.companyName,c={userId:r?.userId??"",sessionId:r?.zeniSessionId??"",tenantId:s.tenantId},m=b.useMemo(()=>({authParams:c,companyName:i,downloadEndPoint:`${ae}/agingReport`,timezone:Xe()}),[]),g=t.arAgingUIState.selectedDate??xe(),C=b.useCallback(()=>{t.fetchState!=="In-Progress"&&t.fetchState!=="Completed"&&e(Ct(g))},[]);b.useEffect(()=>{C()},[]);const u=b.useCallback(()=>{a("../",{relative:"path"})},[]),l=b.useCallback(S=>{e(He({searchString:S}))},[]),h=b.useCallback((S,I)=>{e(He({sortKey:I,sortOrder:S}))},[]),p=b.useCallback(S=>{a(`./${S}/${g.format(q.getLocalizedStrings().dateFormat.analytics.YYYYDashMMDashDDFormat)}`)},[g]),f=b.useCallback(S=>{e(He({downloadState:S}))},[]),A=b.useCallback((S,I)=>{e(He({selectedDate:S,agingDateSelectionType:I})),e(Ct(S))},[]),E=b.useCallback((S,I)=>{e(On({nodeId:S,isCollapsed:I}))},[]);return d.jsxs(d.Fragment,{children:[t.fetchState==="Completed"?d.jsx(ze,{analytics:x,onLoad:S=>S.trackPageLoaded(N.Event.agingReport,"AR Aging")}):null,d.jsx(xa,{uiState:t.arAgingUIState,report:t,downloadParams:m,analytics:x,onReloadReport:C,onBackClick:u,onSearchTextChange:l,onSortOrderChange:h,onEntityNameClick:p,updateDownloadStateHandler:f,onSelectedDateChanged:A,onNodeCollapseToggled:E,isAiCfoAccessEnabled:n,onAskAiCfoClick:o})]})},Ga=(e,a)=>({key:a,title:e.accountName,amount:e.balance?.available,logoUri:e.logo?.toString(),source:e});function Ya(e,a){const t=Rn(a.firstMonthOfFY);return{onItemClick:(n,o)=>{const r=o.accountName===""?o.accountDescription:o.accountName,s=Fe(a.tenantEmailDomain,o.accountId,o.accountType,r,"quarter",t,!1),i=D(a.location.state?.pathnameStackToGoBack,a.location.pathname);a.navigate(s,{state:{pathnameStackToGoBack:i,referrer:a.referrerType}})},onSetAccountsStatementDate:(n,o)=>{e(Bn(n,o))},onPromoCardBtnClick:n=>{if(a.isZeniAccountsAdmin){let o=`../../checking/${n}`;n?x.trackZeniAccountsCashBalancePromoClicked("Move Money"):(x.trackZeniAccountsCashBalancePromoClicked("Sign Up for Free"),o="../../checking/promo");const r=D(a.location.state?.pathnameStackToGoBack,a.location.pathname);a.navigate(o,{state:{pathnameStackToGoBack:r}})}else x.trackZeniAccountsCashBalancePromoClicked("Learn More"),window.open("https://www.zeni.ai/product/business-checking-accounts","_blank")}}}const as=te(function(e){const a=Pn(e).accountsInOrder.map((n,o)=>Ga(n,o)),t=Mn(e);return{sectionTitle:q.getLocalizedStrings().balanceCard.cashBalanceSectionTitle,transactionArray:a,zeniAccountsPromoCardReport:t,fetchState:e.cashBalanceState.fetchState,analytics:x}},Ya)(Da),ns=te(function(e){const a=jn(e).accountsInOrder.map((o,r)=>Ga(o,r)),t=j.getSignedInUser(),n=Ge(t);return{sectionTitle:q.getLocalizedStrings().balanceCard.cardBalanceSectionTitle,transactionArray:a,isZeniUser:n,fetchState:e.cardBalanceState.fetchState,analytics:x}},Ya)(Da);function os(){const e=W(),a=H(),{tenantEmailDomain:t}=K(),n=_e(),o=_(s=>U(s).company?.companyInfo.firstMonthOfFY??1),r=St(n?.loggedInUserRoleMap);return _(s=>s.cashBalanceState.fetchState)==="Error"?d.jsx(Ue,{}):d.jsx(as,{tenantEmailDomain:t,location:a,referrerType:"Cash Balance",navigate:e,isZeniAccountsAdmin:r,firstMonthOfFY:o})}function ss(){const e=W(),a=H(),{tenantEmailDomain:t}=K(),n=_e(),o=St(n?.loggedInUserRoleMap),r=_(s=>U(s).company?.companyInfo.firstMonthOfFY??1);return _(s=>s.cardBalanceState.fetchState)==="Error"?d.jsx(Ue,{}):d.jsx(ns,{tenantEmailDomain:t,location:a,referrerType:"Card Balance",navigate:e,isZeniAccountsAdmin:o,firstMonthOfFY:r})}const rs=Dt.div`
1
+ import{j as d}from"./liveblocks-D1TxH59e.js";import{i as K,j as _,g as H,u as z,h as W,n as te,k as oa,o as gt,p as F}from"./core-Fwwp8hop.js";import{eP as U,KE as Xe,bE as sa,bq as xe,LR as In,i3 as Tn,LS as Nt,LT as xn,i6 as bt,LU as Qe,LV as Dn,ib as wn,LW as $t,LX as Fn,ig as Ct,LY as He,LZ as On,cl as St,L_ as Pn,L$ as Mn,KY as Rn,j9 as Bn,M0 as jn,bn as Ge,M1 as ra,Ks as ce,bc as ia,jn as ca,m$ as la,j6 as da,Ku as le,Kt as ee,eO as ua,eU as Ln,fq as kt,M2 as Un,M3 as Gn,M4 as ma,M5 as Re,uh as Ye,ui as Ve,uF as De,uz as de,um as Ne,M6 as Yn,M7 as Vn,M8 as Nn,M9 as pa,Ma as Be,Mb as $n,dE as Je,qM as ha,Mc as zn,Md as Kn,Me as qn,Mf as yt,JR as At,jD as we,uN as vt,qU as Zn,Mg as Qn,uj as zt,qP as Ie,qL as fa,Mh as ge,Mi as Hn,Mj as Et,JQ as It,sT as ga,Mk as Wn,Ml as Xn,Mm as Jn,Mn as Tt,t4 as eo,Mo as to,ul as Kt,sS as ba,Mp as be,Mq as ao,bt as Ca,uR as ka,Mr as no,Ms as oo,Mt as so,Mu as xt,uM as ro,Mv as io,uk as qt,uQ as _a,Mw as Ce,Mx as co,My as lo,Mz as Sa,js as ya,mY as Aa,jx as va,mW as Ea,mV as Ia,mU as Ta,sf as uo,fg as mo,cN as po,cO as ho,mR as fo,fc as go,n6 as bo,DV as Zt,MA as Co,MB as ko,MC as _o,MD as So,b5 as et,f4 as yo,gO as Ao,fG as vo,n0 as Eo,i$ as Io,mZ as To,mX as xo,e_ as Do,eY as wo}from"./zeni-epic-state-i1VxNGkd.js";import{z as j,a2 as ae,m as D,c as x,O as q,aU as Fo,Y as $e,H as ze,aV as xa,e as N,aW as Oo,k as _e,aX as Da,$ as Se,I as R,h as Po,aY as Mo,aZ as Ro,T as wa,J as Fa,a as Oa,X as Bo,a_ as jo,N as Lo,aN as Pa,Z as se,a$ as Ma,b0 as Ra,a1 as Ba,b1 as Uo,b2 as Go,aq as Yo,p as Vo,U as No,b3 as $o,b4 as zo,b5 as Ko,b6 as ke}from"./index-Sm9Ycasn.js";import{n as Dt}from"./mui-Dar_oGjJ.js";import{a as b}from"./sentry-5pTQe3BK.js";import{w as ja}from"./withTransactionSidePanel-Dk7__fUW.js";import{c as La,t as Fe,f as ue,a as wt,v as qo}from"./routePaths-Pqm-PNC8.js";import{u as ne}from"./useAskAiCfoHostNavButtonProps-B40bGqEV.js";import Ue from"./NotFoundScreen-Brpo5hIh.js";import{u as Ft}from"./useInitialThreadRequest-ELLLToSA.js";import{t as Ua}from"./analyticsHelper-CnXSrEd_.js";import{C as Zo}from"./CompanyPassportScreen-gi1zQDQy.js";import{u as Qo}from"./useAiCfoDashboardSuggestedQuestionsChips-CUpKl9RP.js";import{F as Ho}from"./FeaturePreviewScreen-C1MJa7gv.js";import{R as Wo}from"./ReferralListScreen-D8LbwXaw.js";import"./recharts-DuOI9Nsb.js";import"./analytics-D310XSjQ.js";import"./plaid-BGhwh8RZ.js";import"./dnd-B_nt-Uf4.js";import"./stripe-DMRn4zHo.js";import"./lottie-BGeomX3N.js";import"./lexical-D4DqnnDh.js";import"./pdf-BftxTBXg.js";import"./utils-3_hFkWEq.js";import"./TransactionDetailScreen-DioDP0gW.js";import"./decodeURIComponentSafe-DaWuthXc.js";import"./MobileAppDrawer-n526oWrk.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]="8d6b37bc-e157-46a0-99a5-ac5d48c4ab92",e._sentryDebugIdIdentifier="sentry-dbid-8d6b37bc-e157-46a0-99a5-ac5d48c4ab92")}catch{}})();const Xo=ja(function({openTransactionPanel:e,panelContent:a,sidePanelIsOpen:t,sidePanelIsFullView:n}){const{vendorId:o,reportDate:r}=K(),s=j.getSignedInUser(),i=_(y=>y.tenantState.currentTenantId),c=_(y=>U(y)),{tenantEmailDomain:m}=K(),g=H(),C=c?.companyName??"",u={userId:s?.userId??"",sessionId:s?.zeniSessionId??"",tenantId:i??""},l=b.useMemo(()=>({authParams:u,companyName:C,downloadEndPoint:`${ae}/agingDetailedReport`,timezone:Xe()}),[]),h=b.useMemo(()=>r!=null?sa(r):xe(),[r]),p=z(),f=W(),A=_(y=>In(y,h,o)),E=b.useCallback(()=>{o!=null&&A.fetchState!=="In-Progress"&&A.fetchState!=="Completed"&&p(Tn(o,h))},[h]),S=b.useCallback(()=>{f("../../",{relative:"path"})},[]),I=b.useCallback((y,M)=>{p(Nt({sortKey:y,sortOrder:M}))},[]),T=b.useCallback(y=>{p(Nt({downloadState:y}))},[]),L=b.useCallback(y=>{if(e)e(y.transactionId,y.transactionType);else if(m!=null){const M=La({id:y.transactionId,type:y.transactionType},m);f(M);const X=D(g.state?.pathnameStackToGoBack,g.pathname);f(M,{state:{pathnameStackToGoBack:X}})}},[m,e]),k=b.useCallback(()=>{A.vendor!=null&&x.trackApAgingDetail("AP Aging",h.format(q.getLocalizedStrings().dateFormat.analytics.YYYYDashMMDashDDFormat),A.vendor.id,A.vendor.name)},[A.vendor,h]);return b.useEffect(()=>{E()},[]),b.useEffect(()=>{A.fetchState==="Completed"&&k()},[k,A.fetchState]),d.jsx(Fo,{apAgingDetail:A,downloadParams:l,reportDate:h,analytics:x,onTransactionClick:L,onReload:E,onBackClick:S,onColumnSortConfigChanged:I,updateDownloadStateHandler:T,panelContent:a,sidePanelIsOpen:t,sidePanelIsFullView:n})}),Jo=()=>{const e=z(),a=W(),t=_(I=>xn(I)),{isAiCfoAccessEnabled:n,onAskAiCfoClick:o}=ne({mobileExploreReferrer:"AP Aging"});$e({isDataReady:t.fetchState==="Completed"});const r=j.getSignedInUser(),s=_(I=>I.tenantState.currentTenantId),i=_(I=>U(I)),c=i?.companyName??"",m={userId:r?.userId??"",sessionId:r?.zeniSessionId??"",tenantId:s??""},g=b.useMemo(()=>({authParams:m,companyName:c,downloadEndPoint:`${ae}/agingReport`,timezone:Xe()}),[]),C=t.apAgingUIState.selectedDate??xe(),u=b.useCallback(()=>{t.fetchState!=="In-Progress"&&t.fetchState!=="Completed"&&e(bt(C))},[]);b.useEffect(()=>{u()},[]);const l=b.useCallback(()=>{a("../",{relative:"path"})},[]),h=b.useCallback(I=>{e(Qe({searchString:I}))},[]),p=b.useCallback((I,T)=>{e(Qe({sortKey:T,sortOrder:I}))},[]),f=b.useCallback(I=>{a(`./${I}/${C.format(q.getLocalizedStrings().dateFormat.analytics.YYYYDashMMDashDDFormat)}`)},[C]),A=b.useCallback(I=>{e(Qe({downloadState:I}))},[]),E=b.useCallback((I,T)=>{},[]),S=b.useCallback((I,T)=>{e(Qe({selectedDate:I,agingDateSelectionType:T})),e(bt(I))},[]);return d.jsxs(d.Fragment,{children:[t.fetchState==="Completed"?d.jsx(ze,{analytics:x,onLoad:I=>I.trackPageLoaded(N.Event.agingReport,"AP Aging")}):null,d.jsx(xa,{uiState:t.apAgingUIState,report:t,downloadParams:g,analytics:x,onReloadReport:u,onBackClick:l,onSearchTextChange:h,onSortOrderChange:p,onEntityNameClick:f,updateDownloadStateHandler:A,onSelectedDateChanged:S,onNodeCollapseToggled:E,isAiCfoAccessEnabled:n,onAskAiCfoClick:o})]})},es=ja(function({openTransactionPanel:e,panelContent:a,sidePanelIsOpen:t,sidePanelIsFullView:n}){const{customerId:o,reportDate:r}=K(),s=j.getSignedInUser(),i=_(k=>U(k)),{tenantEmailDomain:c}=K(),m=H(),g=i.companyName,C={userId:s?.userId??"",sessionId:s?.zeniSessionId??"",tenantId:i.tenantId},u=b.useMemo(()=>({authParams:C,companyName:g,downloadEndPoint:`${ae}/agingDetailedReport`,timezone:Xe()}),[]),l=b.useMemo(()=>r!=null?sa(r):xe(),[r]),h=z(),p=W(),f=_(k=>Dn(k,l,o)),A=b.useCallback(()=>{o!=null&&f.fetchState!=="In-Progress"&&f.fetchState!=="Completed"&&h(wn(o,l))},[l]),E=b.useCallback(()=>{p("../../",{relative:"path"})},[]),S=b.useCallback((k,y)=>{h($t({sortKey:k,sortOrder:y}))},[]),I=b.useCallback(k=>{h($t({downloadState:k}))},[]),T=b.useCallback(k=>{if(e)e(k.transactionId,k.transactionType);else if(c!=null){const y=La({id:k.transactionId,type:k.transactionType},c);p(y);const M=D(m.state?.pathnameStackToGoBack,m.pathname);p(y,{state:{pathnameStackToGoBack:M}})}},[c,e]),L=b.useCallback(()=>{f.customer!=null&&x.trackArAgingDetail("AR Aging",l.format(q.getLocalizedStrings().dateFormat.analytics.YYYYDashMMDashDDFormat),f.customer.id,f.customer.name)},[f.customer,l]);return b.useEffect(()=>{A()},[]),b.useEffect(()=>{f.fetchState==="Completed"&&L()},[f.fetchState,L]),d.jsx(Oo,{arAgingDetail:f,downloadParams:u,reportDate:l,analytics:x,onTransactionClick:T,onReload:A,onBackClick:E,onColumnSortConfigChanged:S,updateDownloadStateHandler:I,panelContent:a,sidePanelIsOpen:t,sidePanelIsFullView:n})}),ts=()=>{const e=z(),a=W(),t=_(S=>Fn(S)),{isAiCfoAccessEnabled:n,onAskAiCfoClick:o}=ne({mobileExploreReferrer:"AR Aging"});$e({isDataReady:t.fetchState==="Completed"});const r=j.getSignedInUser(),s=_(S=>U(S)),i=s.companyName,c={userId:r?.userId??"",sessionId:r?.zeniSessionId??"",tenantId:s.tenantId},m=b.useMemo(()=>({authParams:c,companyName:i,downloadEndPoint:`${ae}/agingReport`,timezone:Xe()}),[]),g=t.arAgingUIState.selectedDate??xe(),C=b.useCallback(()=>{t.fetchState!=="In-Progress"&&t.fetchState!=="Completed"&&e(Ct(g))},[]);b.useEffect(()=>{C()},[]);const u=b.useCallback(()=>{a("../",{relative:"path"})},[]),l=b.useCallback(S=>{e(He({searchString:S}))},[]),h=b.useCallback((S,I)=>{e(He({sortKey:I,sortOrder:S}))},[]),p=b.useCallback(S=>{a(`./${S}/${g.format(q.getLocalizedStrings().dateFormat.analytics.YYYYDashMMDashDDFormat)}`)},[g]),f=b.useCallback(S=>{e(He({downloadState:S}))},[]),A=b.useCallback((S,I)=>{e(He({selectedDate:S,agingDateSelectionType:I})),e(Ct(S))},[]),E=b.useCallback((S,I)=>{e(On({nodeId:S,isCollapsed:I}))},[]);return d.jsxs(d.Fragment,{children:[t.fetchState==="Completed"?d.jsx(ze,{analytics:x,onLoad:S=>S.trackPageLoaded(N.Event.agingReport,"AR Aging")}):null,d.jsx(xa,{uiState:t.arAgingUIState,report:t,downloadParams:m,analytics:x,onReloadReport:C,onBackClick:u,onSearchTextChange:l,onSortOrderChange:h,onEntityNameClick:p,updateDownloadStateHandler:f,onSelectedDateChanged:A,onNodeCollapseToggled:E,isAiCfoAccessEnabled:n,onAskAiCfoClick:o})]})},Ga=(e,a)=>({key:a,title:e.accountName,amount:e.balance?.available,logoUri:e.logo?.toString(),source:e});function Ya(e,a){const t=Rn(a.firstMonthOfFY);return{onItemClick:(n,o)=>{const r=o.accountName===""?o.accountDescription:o.accountName,s=Fe(a.tenantEmailDomain,o.accountId,o.accountType,r,"quarter",t,!1),i=D(a.location.state?.pathnameStackToGoBack,a.location.pathname);a.navigate(s,{state:{pathnameStackToGoBack:i,referrer:a.referrerType}})},onSetAccountsStatementDate:(n,o)=>{e(Bn(n,o))},onPromoCardBtnClick:n=>{if(a.isZeniAccountsAdmin){let o=`../../checking/${n}`;n?x.trackZeniAccountsCashBalancePromoClicked("Move Money"):(x.trackZeniAccountsCashBalancePromoClicked("Sign Up for Free"),o="../../checking/promo");const r=D(a.location.state?.pathnameStackToGoBack,a.location.pathname);a.navigate(o,{state:{pathnameStackToGoBack:r}})}else x.trackZeniAccountsCashBalancePromoClicked("Learn More"),window.open("https://www.zeni.ai/product/business-checking-accounts","_blank")}}}const as=te(function(e){const a=Pn(e).accountsInOrder.map((n,o)=>Ga(n,o)),t=Mn(e);return{sectionTitle:q.getLocalizedStrings().balanceCard.cashBalanceSectionTitle,transactionArray:a,zeniAccountsPromoCardReport:t,fetchState:e.cashBalanceState.fetchState,analytics:x}},Ya)(Da),ns=te(function(e){const a=jn(e).accountsInOrder.map((o,r)=>Ga(o,r)),t=j.getSignedInUser(),n=Ge(t);return{sectionTitle:q.getLocalizedStrings().balanceCard.cardBalanceSectionTitle,transactionArray:a,isZeniUser:n,fetchState:e.cardBalanceState.fetchState,analytics:x}},Ya)(Da);function os(){const e=W(),a=H(),{tenantEmailDomain:t}=K(),n=_e(),o=_(s=>U(s).company?.companyInfo.firstMonthOfFY??1),r=St(n?.loggedInUserRoleMap);return _(s=>s.cashBalanceState.fetchState)==="Error"?d.jsx(Ue,{}):d.jsx(as,{tenantEmailDomain:t,location:a,referrerType:"Cash Balance",navigate:e,isZeniAccountsAdmin:r,firstMonthOfFY:o})}function ss(){const e=W(),a=H(),{tenantEmailDomain:t}=K(),n=_e(),o=St(n?.loggedInUserRoleMap),r=_(s=>U(s).company?.companyInfo.firstMonthOfFY??1);return _(s=>s.cardBalanceState.fetchState)==="Error"?d.jsx(Ue,{}):d.jsx(ns,{tenantEmailDomain:t,location:a,referrerType:"Card Balance",navigate:e,isZeniAccountsAdmin:o,firstMonthOfFY:r})}const rs=Dt.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-D1TxH59e.js";import{a as u}from"./sentry-5pTQe3BK.js";import{u as y,j as b,n as w,g as A,N as k}from"./core-Fwwp8hop.js";import{Jj as N,eP as _,fo as U,Jk as L,mT as R,Jl as z}from"./zeni-epic-state-i1VxNGkd.js";import{u as O,z as f,L as T,t as I,O as j,b as $}from"./index-BcoFhJ4O.js";import"./mui-Dar_oGjJ.js";import{t as P}from"./getLocaleForTenant-JJvZDWEQ.js";import"./recharts-DuOI9Nsb.js";import"./analytics-D310XSjQ.js";import"./plaid-BGhwh8RZ.js";import"./dnd-B_nt-Uf4.js";import"./stripe-DMRn4zHo.js";import"./lottie-BGeomX3N.js";import"./lexical-D4DqnnDh.js";import"./pdf-BftxTBXg.js";import"./utils-3_hFkWEq.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]="bb461043-7c8e-4cb2-88cd-c02ca9e7c126",t._sentryDebugIdIdentifier="sentry-dbid-bb461043-7c8e-4cb2-88cd-c02ca9e7c126")}catch{}})();const J=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),c=r.state?.origin,a=r.state?.queryParams;let i=`../${o.tenantEmailDomain}`,d=null,e=!1,g=null,S=null;const C=E(r.pathname);if(C!=null)i=`../${o.tenantEmailDomain}/${C}`,m="comingFromV2UrlPath",C==="ai-cfo/explore"&&(d=p.get("question")?.replace(/^["']|["']$/g,"")??null,e=p.get("should_submit")==="true");else if(c!=null)if(n.reduce((l,F)=>l||c.split("/").find(D=>D===F)!=null,!1))i=c,c.includes("ai-cfo")&&a!=null&&(g=a.aiCfoRef??null,S=a.aiCfoEmailRefId??null);else{const l=E(c);l!=null?(i=`../${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=$(i,p);return v.jsx(k,{to:x,replace:!0,state:{...r.state,origin:"",message:m,aiCfoInitialQuestion:d,aiCfoShouldSubmit:e,aiCfoRef:g,aiCfoEmailRefId:S}})}});function oe(){const t=y(),{setLoading:s,clearAllLoading:o}=O(),h=u.useRef(!1),r=u.useRef(!1),p=u.useRef(null),m=b(e=>N(e)),n=b(e=>e.tenantState.fetchState),c=b(e=>e.tenantState.error),a=b(e=>e.tenantState.activeTenantFetchState.fetchState),i=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&&I.shouldFetchActiveTenant(e)&&(h.current=!0,I.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,S=g==null||a==="Completed"||a==="Error";r.current===!1&&e!=null&&S&&I.shouldFetchAllTenants()&&(r.current=!0,I.markAllTenantsFetchStarted(),(n==="Not-Started"||n==="Error"&&!L(c))&&t(R(e.userId)))},[n,a,c,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"||i==null||(j.updateAppLocaleID(P(i)),o())},[n,a,i]),v.jsx(J,{})}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"],q={"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 q[s]}export{oe as default};
1
+ import{j as v}from"./liveblocks-D1TxH59e.js";import{a as u}from"./sentry-5pTQe3BK.js";import{u as y,j as b,n as w,g as A,N as k}from"./core-Fwwp8hop.js";import{Jj as N,eP as _,fo as U,Jk as L,mT as R,Jl as z}from"./zeni-epic-state-i1VxNGkd.js";import{u as O,z as f,L as T,t as I,O as j,b as $}from"./index-Sm9Ycasn.js";import"./mui-Dar_oGjJ.js";import{t as P}from"./getLocaleForTenant-B-vHrKHL.js";import"./recharts-DuOI9Nsb.js";import"./analytics-D310XSjQ.js";import"./plaid-BGhwh8RZ.js";import"./dnd-B_nt-Uf4.js";import"./stripe-DMRn4zHo.js";import"./lottie-BGeomX3N.js";import"./lexical-D4DqnnDh.js";import"./pdf-BftxTBXg.js";import"./utils-3_hFkWEq.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]="bb461043-7c8e-4cb2-88cd-c02ca9e7c126",t._sentryDebugIdIdentifier="sentry-dbid-bb461043-7c8e-4cb2-88cd-c02ca9e7c126")}catch{}})();const J=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),c=r.state?.origin,a=r.state?.queryParams;let i=`../${o.tenantEmailDomain}`,d=null,e=!1,g=null,S=null;const C=E(r.pathname);if(C!=null)i=`../${o.tenantEmailDomain}/${C}`,m="comingFromV2UrlPath",C==="ai-cfo/explore"&&(d=p.get("question")?.replace(/^["']|["']$/g,"")??null,e=p.get("should_submit")==="true");else if(c!=null)if(n.reduce((l,F)=>l||c.split("/").find(D=>D===F)!=null,!1))i=c,c.includes("ai-cfo")&&a!=null&&(g=a.aiCfoRef??null,S=a.aiCfoEmailRefId??null);else{const l=E(c);l!=null?(i=`../${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=$(i,p);return v.jsx(k,{to:x,replace:!0,state:{...r.state,origin:"",message:m,aiCfoInitialQuestion:d,aiCfoShouldSubmit:e,aiCfoRef:g,aiCfoEmailRefId:S}})}});function oe(){const t=y(),{setLoading:s,clearAllLoading:o}=O(),h=u.useRef(!1),r=u.useRef(!1),p=u.useRef(null),m=b(e=>N(e)),n=b(e=>e.tenantState.fetchState),c=b(e=>e.tenantState.error),a=b(e=>e.tenantState.activeTenantFetchState.fetchState),i=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&&I.shouldFetchActiveTenant(e)&&(h.current=!0,I.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,S=g==null||a==="Completed"||a==="Error";r.current===!1&&e!=null&&S&&I.shouldFetchAllTenants()&&(r.current=!0,I.markAllTenantsFetchStarted(),(n==="Not-Started"||n==="Error"&&!L(c))&&t(R(e.userId)))},[n,a,c,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"||i==null||(j.updateAppLocaleID(P(i)),o())},[n,a,i]),v.jsx(J,{})}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"],q={"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 q[s]}export{oe as default};
@@ -1,4 +1,4 @@
1
- import{j as l}from"./liveblocks-D1TxH59e.js";import{h as w,g as C,j as h,n as A,i as V}from"./core-Fwwp8hop.js";import{Nl as k,Ns as q,fE as J,fD as K,fC as M,iA as W,Kt as L,q3 as Q,eP as B,MT as D,iy as T,Nm as v,Nv as F,iw as G,iT as N}from"./zeni-epic-state-i1VxNGkd.js";import{bu as X,J as j,$ as R,z as U,h as O,p,I as S,q as Z,bv as Y,o as z,bw as ee,m as te}from"./index-BcoFhJ4O.js";import{n as H}from"./mui-Dar_oGjJ.js";import"./sentry-5pTQe3BK.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]="4807eabc-1c5f-4b6c-9233-6d2f0cfccbc7",e._sentryDebugIdIdentifier="sentry-dbid-4807eabc-1c5f-4b6c-9233-6d2f0cfccbc7")}catch{}})();const ne=A(null,function(e,t){return{onSaveVendor:n=>{e(W(t.vendorId!==void 0?t.vendorId:void 0,t.billId,void 0,t.isExpressPayPage)),e(L("common")),n!=null&&e(Q(n))},onGetOtp:n=>{e(M(n,"BillPayVendor"))},onResendOtp:n=>{e(K(n,"BillPayVendor"))},onVerifyOtp:(n,a)=>{e(J(n,a,"BillPayVendor"))},onVerifyOtpSuccess:(n,a,o)=>{e(q(n,a,o))}}})(X);function _({vendorId:e,billId:t,isExpressPayPage:n}){const a=w(),o=C(),s=h(r=>k(r,e));return l.jsx(ne,{location:o,navigate:a,vendorId:e,billId:t,vendorViewDetails:s,isExpressPayPage:n??!1})}const ae=H.div`
1
+ import{j as l}from"./liveblocks-D1TxH59e.js";import{h as w,g as C,j as h,n as A,i as V}from"./core-Fwwp8hop.js";import{Nl as k,Ns as q,fE as J,fD as K,fC as M,iA as W,Kt as L,q3 as Q,eP as B,MT as D,iy as T,Nm as v,Nv as F,iw as G,iT as N}from"./zeni-epic-state-i1VxNGkd.js";import{bu as X,J as j,$ as R,z as U,h as O,p,I as S,q as Z,bv as Y,o as z,bw as ee,m as te}from"./index-Sm9Ycasn.js";import{n as H}from"./mui-Dar_oGjJ.js";import"./sentry-5pTQe3BK.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]="4807eabc-1c5f-4b6c-9233-6d2f0cfccbc7",e._sentryDebugIdIdentifier="sentry-dbid-4807eabc-1c5f-4b6c-9233-6d2f0cfccbc7")}catch{}})();const ne=A(null,function(e,t){return{onSaveVendor:n=>{e(W(t.vendorId!==void 0?t.vendorId:void 0,t.billId,void 0,t.isExpressPayPage)),e(L("common")),n!=null&&e(Q(n))},onGetOtp:n=>{e(M(n,"BillPayVendor"))},onResendOtp:n=>{e(K(n,"BillPayVendor"))},onVerifyOtp:(n,a)=>{e(J(n,a,"BillPayVendor"))},onVerifyOtpSuccess:(n,a,o)=>{e(q(n,a,o))}}})(X);function _({vendorId:e,billId:t,isExpressPayPage:n}){const a=w(),o=C(),s=h(r=>k(r,e));return l.jsx(ne,{location:o,navigate:a,vendorId:e,billId:t,vendorViewDetails:s,isExpressPayPage:n??!1})}const ae=H.div`
2
2
  display: flex;
3
3
  height: 100vh;
4
4
  width: 100%;
@@ -1 +1 @@
1
- import{j as i}from"./liveblocks-D1TxH59e.js";import{J as l,s as c,h as f}from"./index-BcoFhJ4O.js";import{D as p}from"./mui-Dar_oGjJ.js";import"./sentry-5pTQe3BK.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]="33e15337-9daa-4a10-ac68-a7ea0591c1e3",e._sentryDebugIdIdentifier="sentry-dbid-33e15337-9daa-4a10-ac68-a7ea0591c1e3")}catch{}})();const u={drawerLeftMargin:new c(0,0,240)};function h(e){const{isOpen:r,drawerLeftMargin:o,children:n,onClose:t}=e,a=l(),s=o?.valuePx(a)??u.drawerLeftMargin.valuePx(a),d=f();return i.jsx(p,{anchor:"right",open:r,PaperProps:{style:{width:`calc(100% - ${s})`}},slotProps:{backdrop:{style:{backgroundColor:d.colors.black,opacity:.8,cursor:"pointer"}}},onClose:t,children:n})}export{h as D};
1
+ import{j as i}from"./liveblocks-D1TxH59e.js";import{J as l,s as c,h as f}from"./index-Sm9Ycasn.js";import{D as p}from"./mui-Dar_oGjJ.js";import"./sentry-5pTQe3BK.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]="33e15337-9daa-4a10-ac68-a7ea0591c1e3",e._sentryDebugIdIdentifier="sentry-dbid-33e15337-9daa-4a10-ac68-a7ea0591c1e3")}catch{}})();const u={drawerLeftMargin:new c(0,0,240)};function h(e){const{isOpen:r,drawerLeftMargin:o,children:n,onClose:t}=e,a=l(),s=o?.valuePx(a)??u.drawerLeftMargin.valuePx(a),d=f();return i.jsx(p,{anchor:"right",open:r,PaperProps:{style:{width:`calc(100% - ${s})`}},slotProps:{backdrop:{style:{backgroundColor:d.colors.black,opacity:.8,cursor:"pointer"}}},onClose:t,children:n})}export{h as D};
@@ -1 +1 @@
1
- import{j as s}from"./liveblocks-D1TxH59e.js";import{a as d}from"./sentry-5pTQe3BK.js";import{h as B,u as G,g as F,i as K,j as l,N as q,n as L,o as N,p as _}from"./core-Fwwp8hop.js";import{LA as z,eP as O,KZ as R,kD as H,Hz as I,LF as M,Ks as W,jD as Y,HA as S,L2 as $,L3 as V,Ku as Z,Kt as J}from"./zeni-epic-state-i1VxNGkd.js";import{aR as Q,c as U,p as X,m as tt}from"./index-BcoFhJ4O.js";import"./mui-Dar_oGjJ.js";import{d as k}from"./decodeURIComponentSafe-DaWuthXc.js";import{w as et}from"./withTransactionSidePanel-Bez35evJ.js";import{f as at,c as nt}from"./routePaths-BPSPu97F.js";import"./recharts-DuOI9Nsb.js";import"./analytics-D310XSjQ.js";import"./plaid-BGhwh8RZ.js";import"./dnd-B_nt-Uf4.js";import"./stripe-DMRn4zHo.js";import"./lottie-BGeomX3N.js";import"./lexical-D4DqnnDh.js";import"./pdf-BftxTBXg.js";import"./utils-3_hFkWEq.js";import"./useAskAiCfoHostNavButtonProps-HZkyXVvQ.js";import"./TransactionDetailScreen-VjAJduyc.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]="f05df252-0378-4766-881b-6646ffd05cf9",a._sentryDebugIdIdentifier="sentry-dbid-f05df252-0378-4766-881b-6646ffd05cf9")}catch{}})();const ot=L(function(a,t){const e=t.entity,o=M(a,t.entity,"EntityDetail");return{selectedEntity:e,autoCompleteData:{autoCompleteText:e.name,entityAutoCompleteView:W(a,"common")},trendWithTransactionsReport:o,analytics:U,isAccountingClassesEnabled:Y(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(Z({searchString:e,searchOrigin:"common"})):e.trim().length===0&&a(J("common"))},onAutoCompleteEntity:e=>{const o=at(e,t.tenantEmailDomain);a($()),a(V()),t.resetTrendIsFetchedStates(),t.navigate(o,{replace:!0,state:{pathnameStackToGoBack:t.location.state?.pathnameStackToGoBack}})},onCancelAutoComplete:()=>{const e=X(t.location.state?.pathnameStackToGoBack),o=e.poppedPathname??b();t.navigate(o,{state:{pathnameStackToGoBack:e.newStack}})}},onTrendSelectedPeriodChange:e=>{if(t.closeSidePanel?.(),e==null)t.defaultTransactionTimePeriod!=null&&a(S(t.entity,"EntityDetail",{timeframe:"quarter",timePeriod:t.defaultTransactionTimePeriod}));else{const o=e.currentTimePeriod==null?e.addTimePeriod:{startDate:e.addTimePeriod.startDate,endDate:e.currentTimePeriod.endDate};a(I(t.entity,"EntityDetail",{timeframe:e.timeframe,timePeriod:e.addTimePeriod})),a(S(t.entity,"EntityDetail",{timeframe:e.timeframe,timePeriod:o}))}}}})(Q),it=et(function({entityType:a,...t}){const e=B(),o=G(),c=F(),[m,T]=d.useState(!1),[h,D]=d.useState(!1),{tenantEmailDomain:C,entityIdEncoded:j,entityNameEncoded:x}=K(),r=k(j??""),f=k(x??""),p=rt(r,f),v=[r,f].filter(n=>n!=null),i={name:f,id:r,type:a,zeniId:r,qboId:r},g=l(n=>z(n.customerIncomeState,n.vendorExpenseState,n.trendState,i,"quarter")),w=l(n=>O(n).company?.companyInfo.firstMonthOfFY??1),u=l(n=>R(n.trendWithTransactionsState,i,"EntityDetail"));d.useEffect(()=>{m===!1&&p===!0&&(T(!0),o(H(i)))},[m,p,i]);const P=l(n=>n.trendState.fetchState),E=u?.selectedPeriod?.timePeriod??g,A=function(n,y){return n!=null&&y!=null?{startDate:n.startDate,endDate:y?.endDate}:y}(u?.selectedPeriod?.timePeriod,g);return d.useEffect(()=>{m===!0&&h===!1&&P==="Completed"&&(D(!0),E!=null&&o(I(i,"EntityDetail",{timeframe:u?.selectedPeriod?.timeframe??"quarter",timePeriod:E})))},[m,h,P]),p?s.jsx(ot,{firstMonthOfFY:w,tenantEmailDomain:C,location:c,navigate:e,entity:i,defaultTransactionTimePeriod:A,resetTrendIsFetchedStates:()=>{T(!1),D(!1)},...t}):s.jsx(q,{to:b(v.length)})}),rt=(a,t)=>t!=null&&t.length>0&&a!=null&&a.length>0,b=(a=2)=>{let t="../";for(let e=0;e<a;e++)t=`${t}../`;return t};function jt({entityType:a}){return s.jsx(N,{children:s.jsx(_,{path:"/:entityIdEncoded/:entityNameEncoded/*",element:s.jsx(it,{entityType:a})})})}export{jt as EntityDetailRoutes,jt as default};
1
+ import{j as s}from"./liveblocks-D1TxH59e.js";import{a as d}from"./sentry-5pTQe3BK.js";import{h as B,u as G,g as F,i as K,j as l,N as q,n as L,o as N,p as _}from"./core-Fwwp8hop.js";import{LA as z,eP as O,KZ as R,kD as H,Hz as I,LF as M,Ks as W,jD as Y,HA as S,L2 as $,L3 as V,Ku as Z,Kt as J}from"./zeni-epic-state-i1VxNGkd.js";import{aR as Q,c as U,p as X,m as tt}from"./index-Sm9Ycasn.js";import"./mui-Dar_oGjJ.js";import{d as k}from"./decodeURIComponentSafe-DaWuthXc.js";import{w as et}from"./withTransactionSidePanel-Dk7__fUW.js";import{f as at,c as nt}from"./routePaths-Pqm-PNC8.js";import"./recharts-DuOI9Nsb.js";import"./analytics-D310XSjQ.js";import"./plaid-BGhwh8RZ.js";import"./dnd-B_nt-Uf4.js";import"./stripe-DMRn4zHo.js";import"./lottie-BGeomX3N.js";import"./lexical-D4DqnnDh.js";import"./pdf-BftxTBXg.js";import"./utils-3_hFkWEq.js";import"./useAskAiCfoHostNavButtonProps-B40bGqEV.js";import"./TransactionDetailScreen-DioDP0gW.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]="f05df252-0378-4766-881b-6646ffd05cf9",a._sentryDebugIdIdentifier="sentry-dbid-f05df252-0378-4766-881b-6646ffd05cf9")}catch{}})();const ot=L(function(a,t){const e=t.entity,o=M(a,t.entity,"EntityDetail");return{selectedEntity:e,autoCompleteData:{autoCompleteText:e.name,entityAutoCompleteView:W(a,"common")},trendWithTransactionsReport:o,analytics:U,isAccountingClassesEnabled:Y(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(Z({searchString:e,searchOrigin:"common"})):e.trim().length===0&&a(J("common"))},onAutoCompleteEntity:e=>{const o=at(e,t.tenantEmailDomain);a($()),a(V()),t.resetTrendIsFetchedStates(),t.navigate(o,{replace:!0,state:{pathnameStackToGoBack:t.location.state?.pathnameStackToGoBack}})},onCancelAutoComplete:()=>{const e=X(t.location.state?.pathnameStackToGoBack),o=e.poppedPathname??b();t.navigate(o,{state:{pathnameStackToGoBack:e.newStack}})}},onTrendSelectedPeriodChange:e=>{if(t.closeSidePanel?.(),e==null)t.defaultTransactionTimePeriod!=null&&a(S(t.entity,"EntityDetail",{timeframe:"quarter",timePeriod:t.defaultTransactionTimePeriod}));else{const o=e.currentTimePeriod==null?e.addTimePeriod:{startDate:e.addTimePeriod.startDate,endDate:e.currentTimePeriod.endDate};a(I(t.entity,"EntityDetail",{timeframe:e.timeframe,timePeriod:e.addTimePeriod})),a(S(t.entity,"EntityDetail",{timeframe:e.timeframe,timePeriod:o}))}}}})(Q),it=et(function({entityType:a,...t}){const e=B(),o=G(),c=F(),[m,T]=d.useState(!1),[h,D]=d.useState(!1),{tenantEmailDomain:C,entityIdEncoded:j,entityNameEncoded:x}=K(),r=k(j??""),f=k(x??""),p=rt(r,f),v=[r,f].filter(n=>n!=null),i={name:f,id:r,type:a,zeniId:r,qboId:r},g=l(n=>z(n.customerIncomeState,n.vendorExpenseState,n.trendState,i,"quarter")),w=l(n=>O(n).company?.companyInfo.firstMonthOfFY??1),u=l(n=>R(n.trendWithTransactionsState,i,"EntityDetail"));d.useEffect(()=>{m===!1&&p===!0&&(T(!0),o(H(i)))},[m,p,i]);const P=l(n=>n.trendState.fetchState),E=u?.selectedPeriod?.timePeriod??g,A=function(n,y){return n!=null&&y!=null?{startDate:n.startDate,endDate:y?.endDate}:y}(u?.selectedPeriod?.timePeriod,g);return d.useEffect(()=>{m===!0&&h===!1&&P==="Completed"&&(D(!0),E!=null&&o(I(i,"EntityDetail",{timeframe:u?.selectedPeriod?.timeframe??"quarter",timePeriod:E})))},[m,h,P]),p?s.jsx(ot,{firstMonthOfFY:w,tenantEmailDomain:C,location:c,navigate:e,entity:i,defaultTransactionTimePeriod:A,resetTrendIsFetchedStates:()=>{T(!1),D(!1)},...t}):s.jsx(q,{to:b(v.length)})}),rt=(a,t)=>t!=null&&t.length>0&&a!=null&&a.length>0,b=(a=2)=>{let t="../";for(let e=0;e<a;e++)t=`${t}../`;return t};function jt({entityType:a}){return s.jsx(N,{children:s.jsx(_,{path:"/:entityIdEncoded/:entityNameEncoded/*",element:s.jsx(it,{entityType:a})})})}export{jt as EntityDetailRoutes,jt as default};
@@ -1,4 +1,4 @@
1
- import{j as C}from"./liveblocks-D1TxH59e.js";import Rn from"./NotFoundScreen-Dpz39bup.js";import{a,b as Pt}from"./sentry-5pTQe3BK.js";import{n as Fe,S as Dn}from"./mui-Dar_oGjJ.js";import{u as re,h as wt,g as Ge,j as U,n as Un,i as rt,o as Fn,p as Le}from"./core-Fwwp8hop.js";import{eP as Re,PX as Bn,n1 as ke,fj as _n,qG as Vn,nj as xt,nE as Rt,PY as Dt,nO as On,PZ as Ut,nc as jn,qc as Mn,f3 as fe,P_ as De,sM as Ft,BZ as Bt,P$ as _t,Q0 as Ln,pT as qe,LB as dt,LD as zn,jG as Qn,LE as $n,jN as Gn,cV as qn,tR as Ye,np as Vt,nT as Ue,Q1 as Yn,Ku as ut,Kt as Pe,Q2 as mt,k2 as Jn,Q3 as Nn,Q4 as Kn,Q5 as Hn,Q6 as Zn,nw as Wn,nh as de,nW as we,Q7 as Xn,Q8 as ea,Q9 as ta,o1 as na,jR as aa,jI as oa,Qa as sa,jQ as ht,LL as ca,Qb as ia,Qc as la,pP as ra,ps as da,nU as Ie,pr as ze,Qd as ua,Qe as ma,ll as ha,bq as pa,lg as pt,l2 as ga,Qf as Ca,gQ as gt,fU as Sa,ld as fa,vK as Ia,Qg as ka,os as Ea,on as va,or as ya,oc as ba,Qh as Ta,f6 as Ot,nH as Aa,ns as Pa,fk as Ct,nY as wa,Qi as xa,nV as jt,Qj as Ra,Qk as Da,Ql as Ua,Qm as Fa,Qn as St,p$ as Ba,pi as _a,Ks as Va,jP as Oa,Qo as ja,Gv as Ma,jO as La,jD as za,f5 as Qa,oT as Mt,pa as $a,nS as ft,nX as Ga,bE as qa,la as Ya,l7 as Ja,Qp as Na,ob as It,p8 as kt,p6 as Ka,oY as Ha,oD as Za,p9 as Wa,Qq as Xa,Qr as eo,oH as to,Qs as no,ox as ao,oG as oo,oE as so,pd as co}from"./zeni-epic-state-i1VxNGkd.js";import{$ as Lt,I as le,c as L,m as H,U as zt,Y as Qt,cD as io,z as Be,cE as lo,at as xe,cF as ro,aT as Et,q as $t,cG as uo,aq as Qe,O as mo,cH as ho,a2 as po,cI as go,T as Co,cJ as So,cK as fo,F as Io,k as ko,aN as Eo,b7 as vo,s as yo,cL as bo}from"./index-BcoFhJ4O.js";import{u as Gt}from"./useAskAiCfoHostNavButtonProps-HZkyXVvQ.js";import{c as vt,C as To}from"./TransactionDetailScreen-VjAJduyc.js";import{w as Ao}from"./withTransactionSidePanel-Bez35evJ.js";import{h as Po,v as wo}from"./routePaths-BPSPu97F.js";import{g as $e}from"./accountMappingHelper-pKhoHYRw.js";import{D as xo}from"./DrawerScreen-Drpask10.js";import"./recharts-DuOI9Nsb.js";import"./analytics-D310XSjQ.js";import"./plaid-BGhwh8RZ.js";import"./dnd-B_nt-Uf4.js";import"./stripe-DMRn4zHo.js";import"./lottie-BGeomX3N.js";import"./lexical-D4DqnnDh.js";import"./pdf-BftxTBXg.js";import"./utils-3_hFkWEq.js";import"./decodeURIComponentSafe-DaWuthXc.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]="6f07ef31-00fb-44ef-b5d7-af2b7602e9ee",t._sentryDebugIdIdentifier="sentry-dbid-6f07ef31-00fb-44ef-b5d7-af2b7602e9ee")}catch{}})();const Ro=()=>{const t=re(),i=wt(),T=Ge(),I=U(d=>Re(d)),{useFeatureGate:E}=Lt(),{isFeatureEnabled:g}=E(le.isRealtimeInsightsFeatureEnabled),u=U(d=>d.expenseAutomationViewState.selectedPeriodByTenantId),o=U(d=>Bn(d,I.tenantId)),{isAiCfoAccessEnabled:v,onAskAiCfoClick:S}=Gt({mobileExploreReferrer:"Month-End Close Overview"}),m=a.useCallback((d,R,N=!1)=>{t(ke({tenantId:R,period:{month:d.month,year:d.year},refreshViewInBackground:N}))},[]),y=a.useCallback(d=>{const R=T.state?.referrer;o.monthEndCloseChecks?.auditSummary!=null&&L.trackMonthCloseAuditPage(d.month,d.year,o.monthEndCloseChecks.reportEmailSentDate!=null?"closed":"in-review",o.monthEndCloseChecks.auditSummary.auditScorePercentage,!1,R??null),t(_n(I.tenantId,d))},[I.tenantId,o.monthEndCloseChecks?.auditSummary,o.monthEndCloseChecks?.reportEmailSentDate]),r=u[I.tenantId],B=a.useCallback(()=>{const d=T.state?.referrer;o.monthEndCloseChecks?.auditSummary!=null&&L.trackMonthCloseAuditPage(r.month,r.year,o.monthEndCloseChecks.reportEmailSentDate!=null?"closed":"in-review",o.monthEndCloseChecks.auditSummary.auditScorePercentage,!0,d??null),m(r,I.tenantId,!0)},[m,r,I.tenantId,o.monthEndCloseChecks?.auditSummary,o.monthEndCloseChecks?.reportEmailSentDate]),h=H(T.state?.pathnameStackToGoBack,T.pathname),A=a.useCallback(()=>{if(o.monthEndCloseChecks!=null&&r!=null){const d=o.monthEndCloseChecks.monthEndCloseCheckList.find(R=>R.progress<100);if(d!=null)return void i(`./${d.id}/${r.month}-${r.year}`,{state:{pathnameStackToGoBack:h,message:"comingFromOverview"}});i(`./month_end_insights/${r.month}-${r.year}`,{state:{pathnameStackToGoBack:h,message:"comingFromOverview"}})}},[o.monthEndCloseChecks,r]),{areTenantIdsInSync:f}=zt();return Qt({isDataReady:o.fetchState==="Completed"}),a.useEffect(()=>{r!=null&&o.fetchState!=="In-Progress"&&o.fetchState!=="Completed"&&f&&m(r,I.tenantId)},[m,r,o.fetchState,I.tenantId,f]),a.useEffect(()=>{r!=null&&o.monthClosePerformanceTrendFetchStatus.fetchState!=="In-Progress"&&o.monthClosePerformanceTrendFetchStatus.fetchState!=="Completed"&&f&&t(Vn(r))},[r,o.monthClosePerformanceTrendFetchStatus.fetchState,f]),a.useEffect(()=>{const d=setInterval(()=>{o.fetchState!=="In-Progress"&&o.fetchState==="Completed"&&B()},3e5);return()=>clearInterval(d)},[o.fetchState]),a.useEffect(()=>{if(o.fetchState==="Completed"&&o.monthEndCloseChecks?.auditSummary!=null){const d=T.state?.referrer;L.trackMonthCloseAuditPage(o.selectedPeriod.month,o.selectedPeriod.year,o.monthEndCloseChecks.reportEmailSentDate!=null?"closed":"in-review",o.monthEndCloseChecks.auditSummary.auditScorePercentage,!1,d??null)}},[o.fetchState,o.selectedPeriod,o.monthEndCloseChecks?.auditSummary,o.monthEndCloseChecks?.reportEmailSentDate]),C.jsx(Do,{children:C.jsx(io,{monthEndCloseChecksView:o,isRealtimeInsightsFeatureEnabled:g,onMonthEndCheckClick:d=>{i(`./${d}/${r.month}-${r.year}`,{state:{pathnameStackToGoBack:h,message:"comingFromOverview",referrer:"Expense Automation - Overview"}})},onPeriodChange:y,handleReviewButtonClick:A,onBackClick:()=>{i("../../dashboard")},onReload:B,isAiCfoAccessEnabled:v,onAskAiCfoClick:S})})},Do=Fe.div`
1
+ import{j as C}from"./liveblocks-D1TxH59e.js";import Rn from"./NotFoundScreen-Brpo5hIh.js";import{a,b as Pt}from"./sentry-5pTQe3BK.js";import{n as Fe,S as Dn}from"./mui-Dar_oGjJ.js";import{u as re,h as wt,g as Ge,j as U,n as Un,i as rt,o as Fn,p as Le}from"./core-Fwwp8hop.js";import{eP as Re,PX as Bn,n1 as ke,fj as _n,qG as Vn,nj as xt,nE as Rt,PY as Dt,nO as On,PZ as Ut,nc as jn,qc as Mn,f3 as fe,P_ as De,sM as Ft,BZ as Bt,P$ as _t,Q0 as Ln,pT as qe,LB as dt,LD as zn,jG as Qn,LE as $n,jN as Gn,cV as qn,tR as Ye,np as Vt,nT as Ue,Q1 as Yn,Ku as ut,Kt as Pe,Q2 as mt,k2 as Jn,Q3 as Nn,Q4 as Kn,Q5 as Hn,Q6 as Zn,nw as Wn,nh as de,nW as we,Q7 as Xn,Q8 as ea,Q9 as ta,o1 as na,jR as aa,jI as oa,Qa as sa,jQ as ht,LL as ca,Qb as ia,Qc as la,pP as ra,ps as da,nU as Ie,pr as ze,Qd as ua,Qe as ma,ll as ha,bq as pa,lg as pt,l2 as ga,Qf as Ca,gQ as gt,fU as Sa,ld as fa,vK as Ia,Qg as ka,os as Ea,on as va,or as ya,oc as ba,Qh as Ta,f6 as Ot,nH as Aa,ns as Pa,fk as Ct,nY as wa,Qi as xa,nV as jt,Qj as Ra,Qk as Da,Ql as Ua,Qm as Fa,Qn as St,p$ as Ba,pi as _a,Ks as Va,jP as Oa,Qo as ja,Gv as Ma,jO as La,jD as za,f5 as Qa,oT as Mt,pa as $a,nS as ft,nX as Ga,bE as qa,la as Ya,l7 as Ja,Qp as Na,ob as It,p8 as kt,p6 as Ka,oY as Ha,oD as Za,p9 as Wa,Qq as Xa,Qr as eo,oH as to,Qs as no,ox as ao,oG as oo,oE as so,pd as co}from"./zeni-epic-state-i1VxNGkd.js";import{$ as Lt,I as le,c as L,m as H,U as zt,Y as Qt,cD as io,z as Be,cE as lo,at as xe,cF as ro,aT as Et,q as $t,cG as uo,aq as Qe,O as mo,cH as ho,a2 as po,cI as go,T as Co,cJ as So,cK as fo,F as Io,k as ko,aN as Eo,b7 as vo,s as yo,cL as bo}from"./index-Sm9Ycasn.js";import{u as Gt}from"./useAskAiCfoHostNavButtonProps-B40bGqEV.js";import{c as vt,C as To}from"./TransactionDetailScreen-DioDP0gW.js";import{w as Ao}from"./withTransactionSidePanel-Dk7__fUW.js";import{h as Po,v as wo}from"./routePaths-Pqm-PNC8.js";import{g as $e}from"./accountMappingHelper-pKhoHYRw.js";import{D as xo}from"./DrawerScreen-8pLwC76h.js";import"./recharts-DuOI9Nsb.js";import"./analytics-D310XSjQ.js";import"./plaid-BGhwh8RZ.js";import"./dnd-B_nt-Uf4.js";import"./stripe-DMRn4zHo.js";import"./lottie-BGeomX3N.js";import"./lexical-D4DqnnDh.js";import"./pdf-BftxTBXg.js";import"./utils-3_hFkWEq.js";import"./decodeURIComponentSafe-DaWuthXc.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]="6f07ef31-00fb-44ef-b5d7-af2b7602e9ee",t._sentryDebugIdIdentifier="sentry-dbid-6f07ef31-00fb-44ef-b5d7-af2b7602e9ee")}catch{}})();const Ro=()=>{const t=re(),i=wt(),T=Ge(),I=U(d=>Re(d)),{useFeatureGate:E}=Lt(),{isFeatureEnabled:g}=E(le.isRealtimeInsightsFeatureEnabled),u=U(d=>d.expenseAutomationViewState.selectedPeriodByTenantId),o=U(d=>Bn(d,I.tenantId)),{isAiCfoAccessEnabled:v,onAskAiCfoClick:S}=Gt({mobileExploreReferrer:"Month-End Close Overview"}),m=a.useCallback((d,R,N=!1)=>{t(ke({tenantId:R,period:{month:d.month,year:d.year},refreshViewInBackground:N}))},[]),y=a.useCallback(d=>{const R=T.state?.referrer;o.monthEndCloseChecks?.auditSummary!=null&&L.trackMonthCloseAuditPage(d.month,d.year,o.monthEndCloseChecks.reportEmailSentDate!=null?"closed":"in-review",o.monthEndCloseChecks.auditSummary.auditScorePercentage,!1,R??null),t(_n(I.tenantId,d))},[I.tenantId,o.monthEndCloseChecks?.auditSummary,o.monthEndCloseChecks?.reportEmailSentDate]),r=u[I.tenantId],B=a.useCallback(()=>{const d=T.state?.referrer;o.monthEndCloseChecks?.auditSummary!=null&&L.trackMonthCloseAuditPage(r.month,r.year,o.monthEndCloseChecks.reportEmailSentDate!=null?"closed":"in-review",o.monthEndCloseChecks.auditSummary.auditScorePercentage,!0,d??null),m(r,I.tenantId,!0)},[m,r,I.tenantId,o.monthEndCloseChecks?.auditSummary,o.monthEndCloseChecks?.reportEmailSentDate]),h=H(T.state?.pathnameStackToGoBack,T.pathname),A=a.useCallback(()=>{if(o.monthEndCloseChecks!=null&&r!=null){const d=o.monthEndCloseChecks.monthEndCloseCheckList.find(R=>R.progress<100);if(d!=null)return void i(`./${d.id}/${r.month}-${r.year}`,{state:{pathnameStackToGoBack:h,message:"comingFromOverview"}});i(`./month_end_insights/${r.month}-${r.year}`,{state:{pathnameStackToGoBack:h,message:"comingFromOverview"}})}},[o.monthEndCloseChecks,r]),{areTenantIdsInSync:f}=zt();return Qt({isDataReady:o.fetchState==="Completed"}),a.useEffect(()=>{r!=null&&o.fetchState!=="In-Progress"&&o.fetchState!=="Completed"&&f&&m(r,I.tenantId)},[m,r,o.fetchState,I.tenantId,f]),a.useEffect(()=>{r!=null&&o.monthClosePerformanceTrendFetchStatus.fetchState!=="In-Progress"&&o.monthClosePerformanceTrendFetchStatus.fetchState!=="Completed"&&f&&t(Vn(r))},[r,o.monthClosePerformanceTrendFetchStatus.fetchState,f]),a.useEffect(()=>{const d=setInterval(()=>{o.fetchState!=="In-Progress"&&o.fetchState==="Completed"&&B()},3e5);return()=>clearInterval(d)},[o.fetchState]),a.useEffect(()=>{if(o.fetchState==="Completed"&&o.monthEndCloseChecks?.auditSummary!=null){const d=T.state?.referrer;L.trackMonthCloseAuditPage(o.selectedPeriod.month,o.selectedPeriod.year,o.monthEndCloseChecks.reportEmailSentDate!=null?"closed":"in-review",o.monthEndCloseChecks.auditSummary.auditScorePercentage,!1,d??null)}},[o.fetchState,o.selectedPeriod,o.monthEndCloseChecks?.auditSummary,o.monthEndCloseChecks?.reportEmailSentDate]),C.jsx(Do,{children:C.jsx(io,{monthEndCloseChecksView:o,isRealtimeInsightsFeatureEnabled:g,onMonthEndCheckClick:d=>{i(`./${d}/${r.month}-${r.year}`,{state:{pathnameStackToGoBack:h,message:"comingFromOverview",referrer:"Expense Automation - Overview"}})},onPeriodChange:y,handleReviewButtonClick:A,onBackClick:()=>{i("../../dashboard")},onReload:B,isAiCfoAccessEnabled:v,onAskAiCfoClick:S})})},Do=Fe.div`
2
2
  display: flex;
3
3
  height: 100vh;
4
4
  width: 100%;
@@ -1 +1 @@
1
- import{j as s}from"./liveblocks-D1TxH59e.js";import{a as r}from"./sentry-5pTQe3BK.js";import{a3 as f,a4 as l,a5 as p,p as m}from"./index-BcoFhJ4O.js";import"./mui-Dar_oGjJ.js";import c from"./NotFoundScreen-Dpz39bup.js";import{h as u,g as b}from"./core-Fwwp8hop.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]="720da2d7-8f85-4925-8f09-ee6187521283",e._sentryDebugIdIdentifier="sentry-dbid-720da2d7-8f85-4925-8f09-ee6187521283")}catch{}})();const _=()=>{const e=u(),a=b(),t=r.useCallback(()=>{window.open("https://www.zeni.ai/demo/request","_blank")},[]),d=r.useCallback(()=>{(()=>{const n=m(a.state?.pathnameStackToGoBack),i=n.poppedPathname??k();e(i,{state:{pathnameStackToGoBack:n.newStack}})})()},[]),o=f(a.pathname);return o!=null?s.jsx(l,{menuItem:p(o),onDemoClick:t,onGoBack:d}):s.jsx(c,{})},k=(e=2)=>{let a="../";for(let t=0;t<e;t++)a=`${a}../`;return a};export{_ as F};
1
+ import{j as s}from"./liveblocks-D1TxH59e.js";import{a as r}from"./sentry-5pTQe3BK.js";import{a3 as f,a4 as l,a5 as p,p as m}from"./index-Sm9Ycasn.js";import"./mui-Dar_oGjJ.js";import c from"./NotFoundScreen-Brpo5hIh.js";import{h as u,g as b}from"./core-Fwwp8hop.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]="720da2d7-8f85-4925-8f09-ee6187521283",e._sentryDebugIdIdentifier="sentry-dbid-720da2d7-8f85-4925-8f09-ee6187521283")}catch{}})();const _=()=>{const e=u(),a=b(),t=r.useCallback(()=>{window.open("https://www.zeni.ai/demo/request","_blank")},[]),d=r.useCallback(()=>{(()=>{const n=m(a.state?.pathnameStackToGoBack),i=n.poppedPathname??k();e(i,{state:{pathnameStackToGoBack:n.newStack}})})()},[]),o=f(a.pathname);return o!=null?s.jsx(l,{menuItem:p(o),onDemoClick:t,onGoBack:d}):s.jsx(c,{})},k=(e=2)=>{let a="../";for(let t=0;t<e;t++)a=`${a}../`;return a};export{_ as F};
@@ -1 +1 @@
1
- import{a as r}from"./sentry-5pTQe3BK.js";import{u as l,h as f,g as m}from"./core-Fwwp8hop.js";import{gx as p,JH as g,JI as _}from"./zeni-epic-state-i1VxNGkd.js";import{u as b,L as h,z as y}from"./index-BcoFhJ4O.js";import"./liveblocks-D1TxH59e.js";import"./recharts-DuOI9Nsb.js";import"./mui-Dar_oGjJ.js";import"./analytics-D310XSjQ.js";import"./plaid-BGhwh8RZ.js";import"./dnd-B_nt-Uf4.js";import"./stripe-DMRn4zHo.js";import"./lottie-BGeomX3N.js";import"./lexical-D4DqnnDh.js";import"./pdf-BftxTBXg.js";import"./utils-3_hFkWEq.js";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},n=new e.Error().stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="1c64556d-d610-4366-a7b5-7e46a63af10c",e._sentryDebugIdIdentifier="sentry-dbid-1c64556d-d610-4366-a7b5-7e46a63af10c")}catch{}})();function C(){const e=l(),n=f(),o=m(),{setLoading:i,clearAllLoading:u}=b(),s=r.useRef(!1);return r.useLayoutEffect(()=>{i(h.CONNECTION_AUTH)},[i]),r.useEffect(()=>{if(s.current)return;s.current=!0;const a=new URLSearchParams(o.search).get("code"),c=sessionStorage.getItem("hubspot_oauth_pending");if(sessionStorage.removeItem("hubspot_oauth_pending"),a!=null&&c!=null){const t=JSON.parse(c);e(p(t.tenant_id,t.connection_id,g("revenue"),_("hubspot"),{authorization_code:a,client_id:t.client_id,client_secret:t.client_secret,redirect_uri:t.redirect_uri}))}u();const d=y.getActiveTenantForUser();n(d?.tenantEmailDomain!=null?`/${d.tenantEmailDomain}/settings/integrations`:"/",{replace:!0})},[]),null}export{C as default};
1
+ import{a as r}from"./sentry-5pTQe3BK.js";import{u as l,h as f,g as m}from"./core-Fwwp8hop.js";import{gx as p,JH as g,JI as _}from"./zeni-epic-state-i1VxNGkd.js";import{u as b,L as h,z as y}from"./index-Sm9Ycasn.js";import"./liveblocks-D1TxH59e.js";import"./recharts-DuOI9Nsb.js";import"./mui-Dar_oGjJ.js";import"./analytics-D310XSjQ.js";import"./plaid-BGhwh8RZ.js";import"./dnd-B_nt-Uf4.js";import"./stripe-DMRn4zHo.js";import"./lottie-BGeomX3N.js";import"./lexical-D4DqnnDh.js";import"./pdf-BftxTBXg.js";import"./utils-3_hFkWEq.js";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},n=new e.Error().stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="1c64556d-d610-4366-a7b5-7e46a63af10c",e._sentryDebugIdIdentifier="sentry-dbid-1c64556d-d610-4366-a7b5-7e46a63af10c")}catch{}})();function C(){const e=l(),n=f(),o=m(),{setLoading:i,clearAllLoading:u}=b(),s=r.useRef(!1);return r.useLayoutEffect(()=>{i(h.CONNECTION_AUTH)},[i]),r.useEffect(()=>{if(s.current)return;s.current=!0;const a=new URLSearchParams(o.search).get("code"),c=sessionStorage.getItem("hubspot_oauth_pending");if(sessionStorage.removeItem("hubspot_oauth_pending"),a!=null&&c!=null){const t=JSON.parse(c);e(p(t.tenant_id,t.connection_id,g("revenue"),_("hubspot"),{authorization_code:a,client_id:t.client_id,client_secret:t.client_secret,redirect_uri:t.redirect_uri}))}u();const d=y.getActiveTenantForUser();n(d?.tenantEmailDomain!=null?`/${d.tenantEmailDomain}/settings/integrations`:"/",{replace:!0})},[]),null}export{C as default};
@@ -1,4 +1,4 @@
1
- import{j as t}from"./liveblocks-D1TxH59e.js";import{i as S,n as x,h as C,g as y,u as ee,s as te,j as E,N as ae,o as ne,p}from"./core-Fwwp8hop.js";import{JA as k,JB as v,JC as T,zA as D,zm as J,JD as B,JE as oe,JF as se,zq as ie,eW as $,zx as le,zu as re}from"./zeni-epic-state-i1VxNGkd.js";import{J as g,o as r,R as de,c as j,i as G,W as ce,p as me,M as pe,m as H,$ as ue,I as he,_ as xe,F as ge,h as fe,n as be,q as we,H as Se,B as ye,S as ke,r as ve,s as je,D as $e}from"./index-BcoFhJ4O.js";import{n as m}from"./mui-Dar_oGjJ.js";import f from"./NotFoundScreen-Dpz39bup.js";import{a as I}from"./sentry-5pTQe3BK.js";import"./recharts-DuOI9Nsb.js";import"./analytics-D310XSjQ.js";import"./plaid-BGhwh8RZ.js";import"./dnd-B_nt-Uf4.js";import"./stripe-DMRn4zHo.js";import"./lottie-BGeomX3N.js";import"./lexical-D4DqnnDh.js";import"./pdf-BftxTBXg.js";import"./utils-3_hFkWEq.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]="8bf036cc-f75f-469d-9191-8bab9c2da988",e._sentryDebugIdIdentifier="sentry-dbid-8bf036cc-f75f-469d-9191-8bab9c2da988")}catch{}})();const Ie=m.div`
1
+ import{j as t}from"./liveblocks-D1TxH59e.js";import{i as S,n as x,h as C,g as y,u as ee,s as te,j as E,N as ae,o as ne,p}from"./core-Fwwp8hop.js";import{JA as k,JB as v,JC as T,zA as D,zm as J,JD as B,JE as oe,JF as se,zq as ie,eW as $,zx as le,zu as re}from"./zeni-epic-state-i1VxNGkd.js";import{J as g,o as r,R as de,c as j,i as G,W as ce,p as me,M as pe,m as H,$ as ue,I as he,_ as xe,F as ge,h as fe,n as be,q as we,H as Se,B as ye,S as ke,r as ve,s as je,D as $e}from"./index-Sm9Ycasn.js";import{n as m}from"./mui-Dar_oGjJ.js";import f from"./NotFoundScreen-Brpo5hIh.js";import{a as I}from"./sentry-5pTQe3BK.js";import"./recharts-DuOI9Nsb.js";import"./analytics-D310XSjQ.js";import"./plaid-BGhwh8RZ.js";import"./dnd-B_nt-Uf4.js";import"./stripe-DMRn4zHo.js";import"./lottie-BGeomX3N.js";import"./lexical-D4DqnnDh.js";import"./pdf-BftxTBXg.js";import"./utils-3_hFkWEq.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]="8bf036cc-f75f-469d-9191-8bab9c2da988",e._sentryDebugIdIdentifier="sentry-dbid-8bf036cc-f75f-469d-9191-8bab9c2da988")}catch{}})();const Ie=m.div`
2
2
  display: flex;
3
3
  height: 100%;
4
4
  width: 100%;