@zeniai/web-app-ui 5.1.81-next → 5.1.82-betaDI1

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 (109) hide show
  1. package/package.json +4 -4
  2. package/dist/assets/AddressRoutes-CZ001L0B.js +0 -1
  3. package/dist/assets/AddressScreen-Cy07AeqE.js +0 -9
  4. package/dist/assets/AiCfoScreen-CAf6ZEes.js +0 -22
  5. package/dist/assets/BillPayApprovalRoutes-OOK37dzM.js +0 -1
  6. package/dist/assets/BillPayRoutes-DrJrm73Q.js +0 -119
  7. package/dist/assets/BusinessVerificationPageScreen-B-L9gdz1.js +0 -9
  8. package/dist/assets/CardsAiCfoScreen-DiqdjAjj.js +0 -14
  9. package/dist/assets/ChargeCardRoutes-BJkVxY8Z.js +0 -71
  10. package/dist/assets/CompanyPassportScreen-BUOnzTWw.js +0 -1
  11. package/dist/assets/ConnectionAuthScreen-Bwq_fx00.js +0 -11
  12. package/dist/assets/CustomerOnboardingAuthScreen-CZ5xQsEB.js +0 -1
  13. package/dist/assets/CustomerOnboardingRoutes-BMCNuzuH.js +0 -30
  14. package/dist/assets/DashboardRoutes-0cSeXm67.js +0 -20
  15. package/dist/assets/DefaultTenantHome-CP8NoId0.js +0 -1
  16. package/dist/assets/DomesticWireDetailScreen-C6o7L4nH.js +0 -18
  17. package/dist/assets/DrawerScreen-BkNTuZZn.js +0 -1
  18. package/dist/assets/EntityDetailRoutes-D9Vk0h73.js +0 -1
  19. package/dist/assets/ExpenseAutomationRoutes-CVabqqUr.js +0 -25
  20. package/dist/assets/FeaturePreviewScreen-dZphyDK8.js +0 -1
  21. package/dist/assets/HubSpotOAuthCallbackScreen-C2-Grd2S.js +0 -1
  22. package/dist/assets/MagicLinkRoutes-qhstyQJu.js +0 -72
  23. package/dist/assets/MagicLinkSignInScreen-Dac_EZMw.js +0 -12
  24. package/dist/assets/MobileAppDrawer-BWG5ZoNF.js +0 -1
  25. package/dist/assets/NotFoundScreen-B_nzx2PP.js +0 -1
  26. package/dist/assets/NotificationRoutes-BrjbH91S.js +0 -1
  27. package/dist/assets/OAuthConsentScreen-CvlBFjdq.js +0 -1
  28. package/dist/assets/PandLWithForecastRoutes-C_x9Tcg0.js +0 -1
  29. package/dist/assets/PeopleRoutes-DUzH3GNv.js +0 -22
  30. package/dist/assets/PerformanceRoutes-Dm8N0j9j.js +0 -1
  31. package/dist/assets/Preview-Bxn_o2ub.js +0 -1
  32. package/dist/assets/QBOConnectionScreen-1f76Cjry.js +0 -100
  33. package/dist/assets/ReferralListScreen-zKATmg7m.js +0 -5
  34. package/dist/assets/ReimbursementApprovalRoutes-DztBHkQc.js +0 -1
  35. package/dist/assets/ReimbursementApprovalRuleDetailScreen-_5mmwBdu.js +0 -1
  36. package/dist/assets/ReimbursementRoutes-DiSfNuHZ.js +0 -68
  37. package/dist/assets/ReportsRoutes-Bty3VgNj.js +0 -1
  38. package/dist/assets/RewardsRoutes-BtSnOW_p.js +0 -1
  39. package/dist/assets/ScreenRoutes-Du9VLb80.js +0 -2
  40. package/dist/assets/SettingsRoutes-DYDw5CwH.js +0 -57
  41. package/dist/assets/SetupPagesScreen-DEnNlIFZ.js +0 -29
  42. package/dist/assets/SignInScreen-Bd-bOFs3.js +0 -1
  43. package/dist/assets/SignOutScreen-Dqwjcbl7.js +0 -9
  44. package/dist/assets/TaskListScreen-YLciClaW.js +0 -9
  45. package/dist/assets/TaskRoutes-BEsI3ohS.js +0 -9
  46. package/dist/assets/TransactionDetailRoutes-DeXE01z1.js +0 -1
  47. package/dist/assets/TransactionDetailScreen-DYaYb3Dh.js +0 -5
  48. package/dist/assets/TransactionListRoutes-DRRo4Xlk.js +0 -1
  49. package/dist/assets/TreasuryRoutes-BkY0fzik.js +0 -37
  50. package/dist/assets/VendorsRoutes-CAoEQXHS.js +0 -112
  51. package/dist/assets/WiseConfirmationScreen-b0LDNO5l.js +0 -12
  52. package/dist/assets/ZeniAccountRoutes-B68Pe7No.js +0 -73
  53. package/dist/assets/ZeniAccountStatementScreen-wVpVNvAj.js +0 -9
  54. package/dist/assets/accountMappingHelper-D5Bw0mp6.js +0 -1
  55. package/dist/assets/analytics-CpUJgE1w.js +0 -68
  56. package/dist/assets/analyticsHelper-CLhyHcZM.js +0 -1
  57. package/dist/assets/core-CDuxXgNT.js +0 -12
  58. package/dist/assets/decodeURIComponentSafe-B8X6jXbR.js +0 -1
  59. package/dist/assets/dnd-VtUMJCWH.js +0 -6
  60. package/dist/assets/empty-CI6jmlvd.js +0 -1
  61. package/dist/assets/empty-Dy_Rugh4.js +0 -1
  62. package/dist/assets/emptyVideoElement-CzSTlf8_.js +0 -1
  63. package/dist/assets/epic-DQIIhelC.js +0 -2
  64. package/dist/assets/favicon-D56XvgAH.ico +0 -0
  65. package/dist/assets/getLocaleForTenant-xMQqjCWD.js +0 -1
  66. package/dist/assets/index-BQ1ZKP1g.js +0 -1
  67. package/dist/assets/index-BSsnhNl3.js +0 -3385
  68. package/dist/assets/index-BUfNuy7H.js +0 -1
  69. package/dist/assets/index-BUmr5maU.css +0 -1
  70. package/dist/assets/index-BqsTwZNl.js +0 -1
  71. package/dist/assets/index-D4fNRtH0.js +0 -1
  72. package/dist/assets/index-D72vEAAO.js +0 -2
  73. package/dist/assets/index-DUxBJrom.js +0 -2
  74. package/dist/assets/index-DzOogTqR.js +0 -80963
  75. package/dist/assets/lexical-CIqawAn4.js +0 -21
  76. package/dist/assets/liveblocks-C5Zo4IsV.js +0 -54
  77. package/dist/assets/logo192-CqcTe-t4.png +0 -0
  78. package/dist/assets/lottie-B-fnnIRm.js +0 -2
  79. package/dist/assets/manifest-icT4lOF5.json +0 -49
  80. package/dist/assets/mui-BWYOl-fu.js +0 -109
  81. package/dist/assets/pathToGoBack-YzaQ63IA.js +0 -1
  82. package/dist/assets/pdf-WEHP-u0u.js +0 -13
  83. package/dist/assets/pdf-lib-eYFk39VK.js +0 -39
  84. package/dist/assets/plaid-2PJJQmCk.js +0 -2
  85. package/dist/assets/pusher-DG4S91VG.js +0 -1
  86. package/dist/assets/react-BBaLVZIY.js +0 -21
  87. package/dist/assets/react-BruMptWV.js +0 -19
  88. package/dist/assets/react-DxeNPC39.js +0 -34
  89. package/dist/assets/react-DyOgz1S3.js +0 -19
  90. package/dist/assets/react-L4KlSlqR.js +0 -22
  91. package/dist/assets/react-xbt6TvfU.js +0 -17
  92. package/dist/assets/recharts-DOA55GXl.js +0 -65
  93. package/dist/assets/routePaths-rmRxk_gU.js +0 -1
  94. package/dist/assets/sentry-pTjqe1GE.js +0 -500
  95. package/dist/assets/stripe-DMRn4zHo.js +0 -1
  96. package/dist/assets/url--qGqS-sp.js +0 -6
  97. package/dist/assets/url-Bx8KkYZ2.js +0 -1
  98. package/dist/assets/useAiCfoDashboardSuggestedQuestionsChips-Ch-s-OUg.js +0 -1
  99. package/dist/assets/useAskAiCfoHostNavButtonProps-DVKlzRut.js +0 -1
  100. package/dist/assets/useCashManagementBanner-BEqGoY3j.js +0 -1
  101. package/dist/assets/useChargeCardPusherEvents-DikWnVw6.js +0 -1
  102. package/dist/assets/useDeviceId-DxgjldI-.js +0 -13
  103. package/dist/assets/useEmailConnectResultRefresh-BZf1BjuU.js +0 -1
  104. package/dist/assets/useInitialThreadRequest-C_oymrXt.js +0 -1
  105. package/dist/assets/utils-C-pFPw5l.js +0 -36
  106. package/dist/assets/web-vitals-D_vxw1oG.js +0 -1
  107. package/dist/assets/withTransactionSidePanel-BzAvEIvv.js +0 -21
  108. package/dist/assets/zeni-epic-state-aFTbMOAR.js +0 -13
  109. package/dist/index.html +0 -1
@@ -1,9 +0,0 @@
1
- import{j as n}from"./liveblocks-C5Zo4IsV.js";import se from"./NotFoundScreen-B_nzx2PP.js";import{a as l}from"./sentry-pTjqe1GE.js";import{h as M,u as O,j as f,g as ne,i as oe,N as ie,n as re,o as le,p as g}from"./core-CDuxXgNT.js";import{I6 as Z,I9 as ce,I3 as de,eX as H,TG as J,In as Q,I0 as pe,IT as ue,IM as ke,TH as K,TI as V,HY as me,HV as ge,rD as fe,rr as he,l6 as Ie,Ih as Se,TJ as Te,Iy as be,Iv as Ee,Ic as Ge,Is as Ce,Ir as De}from"./zeni-epic-state-aFTbMOAR.js";import{z as C,d8 as xe,A as ye,Q as je,e as b,s as W,v as w,J as ve,f as z,h as we,d9 as Re,n as A,at as Fe}from"./index-DzOogTqR.js";import{n as Be}from"./mui-BWYOl-fu.js";import{u as Pe}from"./useInitialThreadRequest-C_oymrXt.js";import{M as Ue}from"./MobileAppDrawer-BWG5ZoNF.js";import Le from"./TaskListScreen-YLciClaW.js";import"./recharts-DOA55GXl.js";import"./analytics-CpUJgE1w.js";import"./plaid-2PJJQmCk.js";import"./dnd-VtUMJCWH.js";import"./stripe-DMRn4zHo.js";import"./lottie-B-fnnIRm.js";import"./lexical-CIqawAn4.js";import"./pdf-WEHP-u0u.js";import"./utils-C-pFPw5l.js";import"./useAskAiCfoHostNavButtonProps-DVKlzRut.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]="995b98a7-a614-4634-891a-387a0d26b138",e._sentryDebugIdIdentifier="sentry-dbid-995b98a7-a614-4634-891a-387a0d26b138")}catch{}})();function $e(){const e=M(),t=O(),s=C.getSignedInUser(),{cannedResponses:u,fetchState:r,saveFetchState:d}=f(o=>o.cannedResponsesState),c=l.useCallback(()=>{t(Z())},[t]),k=l.useCallback((o,h,I)=>{t(ce({name:o,content:h,cannedResponseId:I}))},[t]),a=l.useCallback(o=>{t(de({cannedResponseId:o}))},[t]);if(s==null)throw Error("Can't access quick responses page without signing in...");return n.jsx(xe,{cannedResponses:u,isLoading:r==="In-Progress"||r==="Not-Started",isSaving:d==="In-Progress",onBackClick:()=>e(-1),onDelete:a,onFetch:c,onSave:k})}let _,q=[];const Ne=re(function(e,t){const{location:s,taskGroupId:u}=t,r=K(e,t.taskId),d=H(e),c=r.taskGroupId??u,k=c!=null?V(e.taskGroupState,c):void 0,a=C.getSignedInUser(),o=d.tenantId,h={userId:a?.userId??"",sessionId:a?.zeniSessionId??"",tenantId:o??""},I=J(e),{tenantEmailDomain:D}=d,E=r.recurringSourceTaskId,x=E!=null?`${A.appUrl}/${D}/tasks/${encodeURIComponent(E)}`:void 0;var S;return{taskDetailSelectorView:r,authParams:h,isZeniUser:C.isZeniUser(),userGroupList:((S=e.userGroupsState.userGroupByUserGroupId)!==_&&(_=S,q=Object.values(S)),q),isNewClicked:s.state?.message==="comingFromTaskListPage",filesEndPoint:Fe.fileMicroServiceBaseUrl,companyName:t.currentTenant.companyName,companyId:t.currentTenant.companyId,currentUrl:`${A.appUrl}${t.location.pathname}`,cannedResponses:e.cannedResponsesState.cannedResponses,isCannedResponsesLoading:e.cannedResponsesState.fetchState==="In-Progress",recurringSourceTaskUrl:x,tagListView:I,taskGroupName:c!=null&&k!=null&&k.isDefault===!1?k.name:void 0,taskGroupList:e.taskGroupViewState.taskGroupsIds.map(p=>V(e.taskGroupState,p)).filter(p=>p!=null&&!p.isDeleted).map(p=>({id:p.id,name:p.name,isDefault:p.isDefault}))}},function(e,t){const{taskId:s,navigate:u,currentTenant:r,location:d,taskGroupId:c}=t,{tenantEmailDomain:k}=r;return{onSaveChangesToLocalStore:a=>{e(De({taskDetailLocalData:a,taskId:s}))},onSaveDetailClick:a=>{e(Ce(s,a??c))},onArchiveTaskClick:()=>{t.taskId!=null&&e(Ge(t.taskId))},onSnoozeTask:(a,o)=>{e(Ee(a,o))},onUnsnoozeTask:a=>{e(be(a))},onDismissClick:()=>{if(d.state?.message==="triggerBackClick"){const a=W(d.state?.pathnameStackToGoBack),o=a.poppedPathname??"../../dashboard";u(o,{state:{pathnameStackToGoBack:a.newStack}})}else{const a=R(k),o=w(d.state?.pathnameStackToGoBack,d.pathname);u(a,{state:{pathnameStackToGoBack:o}})}e(Te({taskId:s}))},onDeleteTaskClick:()=>{e(Se(s))},updateFilesEntity:a=>{e(Ie({files:a}))},onDeleteFile:a=>{e(he(a))},onEditFileName:(a,o)=>{e(fe(a,o.split(".")[0]))},onReloadTaskDetailPage:()=>{e(Q(!1,s))},onCreateTagClick:a=>{e(ge(a,s))},onDeleteTagClick:a=>{e(me(a,s))},onFetchCannedResponses:()=>{e(Z())},onManageTemplatesClick:()=>{u(`/${r.tenantEmailDomain}/tasks/quick-responses`)}}})(Re);function v(){const e=M(),t=O(),s=ne(),u=ye(),{taskId:r,taskGroupId:d}=oe(),c=f(i=>H(i)),k=Pe(c?.companyId),{useFeatureGate:a}=je(),{isFeatureEnabled:o}=a(b.isTaskSnoozeEnabled),{isFeatureEnabled:h}=a(b.isTaskVisibilityEnabled),{isFeatureEnabled:I}=a(b.isTaskCannedResponsesEnabled),{isFeatureEnabled:D}=a(b.isTaskRecurringParentEnabled),{isFeatureEnabled:E}=a(b.isTaskGroupAssigneesEnabled),[x,S]=l.useState(!1),[p,X]=l.useState(!1),[F,Y]=l.useState(!1),[B,ee]=l.useState(!1),[P,y]=l.useState(!1),T=l.useRef(!1),G=f(i=>i.taskListState.updateTasksFetchState.fetchState),U=f(i=>J(i)),L=f(i=>i.taskGroupViewState.fetchState);l.useEffect(()=>{p||(X(!0),t(Q(!1,r)))},[p,t]),l.useEffect(()=>{F||U.fetchState==="Completed"||(Y(!0),t(pe()))},[F,t,U.fetchState]),l.useEffect(()=>{B||L==="Completed"||(ee(!0),t(ue()))},[B,t,L]);const ae=l.useCallback(()=>{r!=null&&(T.current=!1,t(ke([r],null,{isArchived:!1})),y(!0))},[t,r]);l.useEffect(()=>{if(P)if(G!=="In-Progress"){if(T.current){if(G==="Error")return y(!1),void(T.current=!1);if(G==="Completed"){y(!1),T.current=!1;const{tenantEmailDomain:i}=c;if(s.state?.message==="triggerBackClick"){const m=W(s.state?.pathnameStackToGoBack);e(m.poppedPathname??"../../dashboard",{state:{pathnameStackToGoBack:m.newStack}})}else{const m=R(i);e(m,{state:{pathnameStackToGoBack:w(s.state?.pathnameStackToGoBack,s.pathname)}})}}}}else T.current=!0},[P,G,c,s,e]);const $=f(i=>K(i,r)),j=$.fetchState,N=C.getSignedInUser();if(N==null)throw Error("Can't access task detail page without signing in...");if(j==="Error"&&$.error?.code===400){const{tenantEmailDomain:i}=c,m=R(i),te=w(s.state?.pathnameStackToGoBack,s.pathname);return n.jsx(ie,{to:m,state:{pathnameStackToGoBack:te}})}return n.jsxs(n.Fragment,{children:[j==="Completed"?n.jsx(ve,{analytics:z,onLoad:i=>(m=>m.trackPageLoaded(we.Event.taskDetailPage))(i)}):null,n.jsxs(Ve,{children:[n.jsx(Ue,{isAppContentDrawerOpen:x,handleDrawerToggle:i=>{S(i)}}),n.jsx(Ne,{analytics:z,currentTenant:c,handleZeniLogoClick:()=>{u.toggle()},initialOpenThreadRequest:k,location:s,loggedInUser:N,navigate:e,taskGroupId:d,taskId:r,taskDetailFetchState:j,onUnarchiveTaskClick:ae,isTaskSnoozeEnabled:o,isTaskVisibilityEnabled:h,isTaskCannedResponsesEnabled:I,isTaskRecurringParentEnabled:D,isTaskGroupAssigneesEnabled:E})]})]})}const Ve=Be.div`
2
- display: flex;
3
- min-height: 100%;
4
- width: 100%;
5
- flex: 1 1 auto;
6
- flex-direction: column;
7
- align-items: center;
8
- background-color: ${e=>e.theme.colors.grey4};
9
- `,R=e=>`/${e}/tasks`;function ia(){return n.jsxs(le,{children:[n.jsx(g,{path:"/new",element:n.jsx(v,{})}),n.jsx(g,{path:"/new/:taskGroupId",element:n.jsx(v,{})}),n.jsx(g,{path:"/group/:taskGroupId",element:n.jsx(Le,{})}),n.jsx(g,{path:"/quick-responses",element:n.jsx($e,{})}),n.jsx(g,{path:"/:taskId",element:n.jsx(v,{})}),n.jsx(g,{path:"*",element:n.jsx(se,{})})]})}export{ia as default};
@@ -1 +0,0 @@
1
- import{j as t}from"./liveblocks-C5Zo4IsV.js";import i from"./NotFoundScreen-B_nzx2PP.js";import{T as r}from"./TransactionDetailScreen-DYaYb3Dh.js";import"./sentry-pTjqe1GE.js";import{o as s,p as o}from"./core-CDuxXgNT.js";import"./zeni-epic-state-aFTbMOAR.js";import"./recharts-DOA55GXl.js";import"./index-DzOogTqR.js";import"./mui-BWYOl-fu.js";import"./analytics-CpUJgE1w.js";import"./plaid-2PJJQmCk.js";import"./dnd-VtUMJCWH.js";import"./stripe-DMRn4zHo.js";import"./lottie-B-fnnIRm.js";import"./lexical-CIqawAn4.js";import"./pdf-WEHP-u0u.js";import"./utils-C-pFPw5l.js";import"./useAskAiCfoHostNavButtonProps-DVKlzRut.js";import"./decodeURIComponentSafe-B8X6jXbR.js";import"./routePaths-rmRxk_gU.js";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},n=new e.Error().stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="a4852925-22e4-4d6c-b9c0-7fe8ce24ec96",e._sentryDebugIdIdentifier="sentry-dbid-a4852925-22e4-4d6c-b9c0-7fe8ce24ec96")}catch{}})();function k(){return t.jsxs(s,{children:[t.jsx(o,{path:"/:transactionTypeEncoded/:transactionId",element:t.jsx(r,{})}),t.jsx(o,{path:"/:transactionTypeEncoded/:transactionId/page-not-found",element:t.jsx(i,{})}),t.jsx(o,{path:"/:transactionTypeEncoded/:transactionId/vendor/create",element:t.jsx(r,{})}),t.jsx(o,{path:"/*",element:t.jsx(r,{})})]})}export{k as default};
@@ -1,5 +0,0 @@
1
- import{j as x}from"./liveblocks-C5Zo4IsV.js";import{a as i}from"./sentry-pTjqe1GE.js";import{u as q,k as Ye,j as S,s as fe,g as ge,h as Te,i as be,N as Qe,n as Xe}from"./core-CDuxXgNT.js";import{nP as he,eX as Q,gq as Ze,Og as et,n0 as tt,mK as at,bn as nt,cU as Ee,bs as ve,rb as W,Nf as H,Oh as Ie,Oi as oe,NF as De,kJ as Ce,Oj as ke,NK as se,NL as ce,ly as Ae,Ka as ie,N9 as M,kD as Oe,kB as Ue,kN as ot,nC as st,Ok as ct,Ol as it,vp as Y,kI as xe,Jv as we,cZ as rt,c_ as lt,Om as dt,N8 as ut,On as mt,vl as pt,Oo as ft,Op as ht,Oq as yt,Or as St,Os as gt,kM as Tt,Ot as bt,Ou as Et,Na as vt,Ov as It,Ow as Dt,Ox as Ct,Jp as kt,Jf as At,JE as Ot,kO as Ut,Kb as ye,nH as xt}from"./zeni-epic-state-aFTbMOAR.js";import{Q as J,e as w,z as _e,aR as Pe,m as wt,Z as _t,aS as Pt,D as Ft,s as ae,I as Vt,aT as Bt,v as ne,$ as Nt,aU as Rt,f as Fe,aV as Lt,at as zt,a3 as te}from"./index-DzOogTqR.js";import{n as Gt,S as jt,D as $t}from"./mui-BWYOl-fu.js";import{u as Mt}from"./useAskAiCfoHostNavButtonProps-DVKlzRut.js";import{d as Ve}from"./decodeURIComponentSafe-B8X6jXbR.js";import{h as Be,c as Ne,g as qt,e as Wt}from"./routePaths-rmRxk_gU.js";import{u as Ht}from"./utils-C-pFPw5l.js";(function(){try{var t=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},e=new t.Error().stack;e&&(t._sentryDebugIds=t._sentryDebugIds||{},t._sentryDebugIds[e]="3a24396a-5271-46dc-ad61-d5b79b251212",t._sentryDebugIdIdentifier="sentry-dbid-3a24396a-5271-46dc-ad61-d5b79b251212")}catch{}})();function Jt(t=!0){const e=q(),s=Ye(),{useFeatureGate:a}=J(),{isFeatureEnabled:n}=a(w.isCreateTransferEntryFromExpenseEnabled);i.useEffect(()=>{if(!t||n!==!0)return;const o=c=>{const r=s.getState().createTransferEntryState.transferAccountsByType[c].fetchState;return r!=="In-Progress"&&r!=="Completed"};o("transferEntryEligible")&&e(he({kind:"transferEntryEligible"})),o("creditCardOnlyEligible")&&e(he({kind:"creditCardOnlyEligible"}))},[t,n,e,s])}function Kt(t,e){const s=function(){const r=q(),[p,g]=i.useState(!1),[A,y]=i.useState(null),[m,O]=i.useState(null),{useDynamicConfig:T}=J(),{configValue:f,isDynamicConfigLoading:C}=T("transaction_categorization_config"),I=!C&&f?.capitalization_enabled===!0,k=S(h=>Q(h)),b=k.companyId,U=S(h=>Ze(h.companyState,k.companyId)?.company.companyLocaleInfo?.currencySymbol??"$"),{capitalizableAccounts:_,capitalizableAccountOverrides:B,dismissedAccounts:z}=S(h=>{const E=h.tenantState.currentTenantId,u=E!=null?h.tenantState.tenantsById[E]:void 0;return{capitalizableAccounts:u?.capitalizableAccounts??null,capitalizableAccountOverrides:u?.capitalizableAccountOverrides??null,dismissedAccounts:u?.capitalizationOnboardingDismissedAccounts??null}},fe),G=i.useRef(_);G.current=_;const N=i.useRef(B);N.current=B;const P=i.useRef(z);P.current=z;const R=S(h=>et(h.accountState),fe),v=i.useMemo(()=>{const h={};for(const E of R)E.accountId!=null&&E.accountName!=null&&(h[E.accountId]=E.accountName);return h},[R]),l=m!=null?v[m]??null:null,j=i.useCallback(h=>{if(!I)return;const E=G.current;if(E==null)return;const u=E.accounts??[],$=new Set(h),X=N.current??{},K=P.current;for(const L of u)if($.has(L.accountId)&&X[L.accountId]==null&&K?.[L.accountId]==null)return y(L.classificationType),O(L.accountId),void g(!0)},[I]),D=i.useCallback((h,E)=>{r(tt(b,h,E,!0)),g(!1),y(null),O(null)},[r,b]),F=i.useCallback(()=>{m!=null&&(r(at(b,m)),g(!1),y(null),O(null))},[r,b,m]);return{showPopup:p&&I,popupType:A,popupAccountId:m,popupAccountName:l,currencySymbol:U,checkAndShowPopup:j,handleSubmit:D,handleDismiss:F}}(),a=i.useRef(void 0),n=i.useRef([]),o=i.useRef(s.checkAndShowPopup);o.current=s.checkAndShowPopup;const c=i.useRef(e);return c.current=e,i.useEffect(()=>{t==="In-Progress"&&(n.current=c.current()),t==="Completed"&&a.current==="In-Progress"&&n.current.length>0&&(o.current(n.current),n.current=[]),a.current=t},[t]),s}const re=()=>{const t=_e.getSignedInUser(),{useFeatureGate:e}=J(),{isFeatureEnabled:s}=e(w.isChainOfThoughtEnabled);return i.useMemo(()=>nt(t)&&s,[t,s])};function Re(t){if(t!=null){if("customer"in t&&t.customer!=null){const{customer:e}=t;return{id:e.id,name:e.name,logo:e.logo,type:"customer",zeniId:e.id,qboId:e.id}}if("vendor"in t&&t.vendor!=null){const{vendor:e}=t;return{id:e.id,name:e.name,logo:e.logo,type:"vendor",zeniId:e.id,qboId:e.id}}}}function ha(t,e){const s=q(),{useFeatureGate:a,useDynamicConfig:n}=J(),o=S(u=>Q(u)),c=o.userRole.includes("charge_card_user")||o.userRole.includes("charge_card_admin"),r=o.userRole!=null&&Ee(o.userRole),p=o.userRole!=null&&ve(o.userRole),{isFeatureEnabled:g}=a(w.isVendorBulkUpdateOnTransactionEnabled),{isFeatureEnabled:A}=a(w.isExpenseAutomationEnabled),{configValue:y}=n(Pe.enableUncategorizedExpenseCategory),m=y?.uncategorized_expense_category_enabled===!0,O=re(),T=i.useMemo(()=>({id:t,type:W(e)}),[t,e]),f=S(u=>H(u,T)),C=f?.transactionDetailUpdateStatus?.fetchState,I=f?.transactionDetailLocalData?.lineItemById,k=S(u=>{const $=H(u,T)?.transactionDetailLocalData.vendorUpdates?.id;return $==null?"Not-Started":u.transactionVendorViewState.editVendorStateById[$]?.saveStatus.fetchState??"Not-Started"}),b=i.useMemo(()=>f?.fetchState==="Completed"?Re(f?.transaction):void 0,[f?.fetchState,f?.transaction]),U=S(u=>{if(b!=null)return Ie(u.customerIncomeState,u.vendorExpenseState,u.trendState,b,"month")}),_=S(u=>oe(u)),B=S(u=>{if(b!=null)return De(u.trendWithTransactionsState,b,"TransactionDetail")}),z=o.company?.companyInfo.firstMonthOfFY??1,G=S(u=>Ce(u.accountState,u.accountListState,"accountList")),[N,P]=i.useState(!1),[R,v]=i.useState(!1),[l,j]=i.useState(!1);i.useEffect(()=>{P(!1),v(!1),j(!1)},[t,e]);const D=i.useCallback(()=>{P(!1),v(!1)},[]),[F,h]=i.useState(!1),E=B?.selectedPeriod?.timePeriod;return i.useEffect(()=>{l||f==null||f.transaction==null||(s(ke({id:f.transaction.id,type:f.transaction.type})),j(!0)),b!=null&&(!c||r&&p===!1)&&(N?R||U==null||(v(!0),s(ie(b,"TransactionDetail",{timeframe:"month",timePeriod:E??U}))):(s(se()),s(ce()),P(!0),s(Ae(b))))},[s,l,f?.fetchState,f?.transaction,b,c,r,p,N,R,U,E]),i.useEffect(()=>{_.newVendorState?.vendorDetailLocalData?.vendorName!=null?h(!0):h(!1)},[_.newVendorState?.vendorDetailLocalData?.vendorName]),i.useEffect(()=>()=>{s(M("common"))},[s]),{currentTenant:o,loggedInUserHasCardUserOrAdminRole:c,isUserHasDashboardAccess:r,isUserHasInvestorOrBankerAccess:p,isVendorBulkUpdateOnTransactionEnabled:g,isExpenseAutomationEnabled:A,isUncategorizedExpenseCategoryEnabled:m,isChainOfThoughtEnabled:O,selectedTransaction:T,transactionDetail:f,rawDetailSaveStatus:C,rawDetailLineItemById:I,vendorSaveStatus:k,tranEntity:b,defaultTrendTransactionTimePeriod:U,vendorViewDetails:_,uiState:B,firstMonthOfFY:z,uncategorizedAccounts:G,resetTrendIsFetchedStates:D,isCreateVendorDrawerOpen:F,setIsCreateVendorDrawerOpen:h}}const Yt={overlayWidth:new Ft(100,100,58)},Qt=({isOpen:t,onSaveVendor:e,onSaveSuccess:s,onCancel:a,vendorViewDetails:n})=>{const o=wt(),c=_t(),r=q(),p=S(y=>oe(y)),g=()=>{a()},A={vendorDetailView:n??p,onSaveSuccess:()=>{r(Ue()),r(ot("Not-Started")),s()},onSaveVendor:e,onCancelClick:g,saveVendorDetailLocalData:y=>{r(Oe({vendorId:void 0,localData:y}))}};return x.jsx($t,{anchor:"right",open:t,PaperProps:{style:{width:Yt.overlayWidth.valuePercentage(c),boxShadow:"none"}},slotProps:{backdrop:{style:{backgroundColor:o.colors.black,opacity:.4,cursor:"pointer"}}},onClose:g,children:x.jsx(Xt,{onClick:y=>y.stopPropagation(),children:x.jsx(Pt,{...A})})})},Xt=Gt(jt)`
2
- display: flex;
3
- min-height: 100%;
4
- flex-direction: column;
5
- `;function Zt(t,e){t(st({transactionId:e.transactionId,creditAccountIntegrationId:e.creditAccountIntegrationId,debitAccountIntegrationId:e.debitAccountIntegrationId,memo:e.memo,transactionType:W(e.transactionType),sourceTransactionType:W(e.sourceTransactionType)}))}function ea({currentTransactionId:t,enabled:e=!0,buildPath:s,beforeNavigate:a,navigate:n,navigateState:o}){const c=S(p=>p.createTransferEntryState.lastTransferEntryReplacement),r=i.useRef(null);i.useEffect(()=>{if(!e||c==null||t==null||r.current===c)return;const{previousTransactionId:p,newTransactionId:g}=c;t.id===p.id&&t.type===p.type&&(r.current=c,a?.(),n(s(g),{replace:!0,state:o}))},[e,c,t,s,a,n,o])}const ta=({closeDrawerHandler:t,overrideTransactionId:e,overrideTransactionType:s})=>{const a=ge(),n=Te(),o=q(),c=re(),{transactionTypeEncoded:r,transactionId:p}=be(),g=e??p,A=s??Ve(r??"");let y;Be(g,A)&&(y={id:g,type:W(A)});const m=y!=null?S(T=>H(T,y)):void 0,O=()=>{const T=ae(a.state?.pathnameStackToGoBack),f=T.poppedPathname??((C=2)=>{let I="../";for(let k=0;k<C;k++)I=`${I}../`;return I})(1);n(f,{state:{pathnameStackToGoBack:T.newStack}})};return{transactionId:y,onSaveVendor:()=>{o(xe(y,void 0))},onSaveSuccess:()=>{if(m!=null&&m?.transaction&&m?.transactionDetailLocalData.vendorUpdates?.qboId!=null&&m?.transactionDetailLocalData.vendorUpdates?.id!=null){const T=m?.transactionDetailLocalData.vendorUpdates,f={id:m?.transactionDetailLocalData.vendorUpdates?.qboId,zeniId:m?.transactionDetailLocalData.vendorUpdates?.id,type:"vendor",name:T?.name,qboId:m?.transactionDetailLocalData.vendorUpdates?.qboId??""},C={transactionId:{id:m?.transaction?.id,type:m?.transaction?.type},transaction:m?.transaction,lineIds:m?.transaction?.lines?.map(I=>I.id)??[]};o(Y({entity:f,amount:m?.transaction?.amount.amount,transactionDetails:C,flowType:"detail",isFetchCOT:c}))}O()},onCancel:()=>{y!=null&&o(ct({transactionId:y})),o(Ue()),o(it()),t(!0),O()}}},aa=Xe(function(t,e){const s=H(t,e.selectedTransaction);let a;s==null&&console.warn("Check if the you've selected the transaction before getting the details");const n=_e.getSignedInUser(),o=t.tenantState.currentTenantId,c={userId:n?.userId??"",sessionId:n?.zeniSessionId??"",tenantId:o??""};s!=null&&s.fetchState==="Completed"&&s.transaction!=null&&e.entity!=null&&(a=dt(t,e.entity,"TransactionDetail"));const r=t.entityAutoCompleteState.autoCompleteText.common,p=ut(t,"common"),g=Q(t);return{transactionDetail:s,transactionAttachmentEndpointToDownload:`${te}/transaction_attachment`,transactionAttachmentsEndpointToFetch:g.externalConnections?.accounting[0]?.connectionName==="netsuite"?`${te}/transaction_attachments_accounting_provider`:`${te}/transaction_attachments`,attachmentUploadEndpoint:`${zt.accountMicroServiceBaseUrl}`,isCOTEnabled:e.isCOTEnabled,authParams:c,trendReport:a,analytics:Fe,uncategorizedAccounts:e.uncategorizedAccounts,autoCompleteData:{autoCompleteText:r,entityAutoCompleteView:p},isVendorBulkUpdateOnTransactionEnabled:e.isVendorBulkUpdateOnTransactionEnabled,isExpenseAutomationEnabled:e.isExpenseAutomationEnabled,isUncategorizedExpenseCategoryEnabled:e.isUncategorizedExpenseCategoryEnabled,enableBackClickOnSave:e.location.state?.message?.startsWith("comingFromScheduleDetails")}},function(t,e){const{isCOTEnabled:s}=e;return{onBackClick:()=>{if(t(M("common")),e.onBackClick!=null)return void e.onBackClick();const a=ae(e.location.state?.pathnameStackToGoBack),n=a.poppedPathname??Le(2);e.navigate(n,{state:{pathnameStackToGoBack:a.newStack,message:"comingFromTransactionDetail"}})},discardTransactionDetailLocalData:(a,n)=>{e.transaction!=null&&t(xt({transactionId:{id:e.transaction.id,type:e.transaction.type},vendorId:a,customerId:n}))},onTransactionClick:a=>{e.resetTrendIsFetchedStates(),t(se()),t(ce());const n=ne(e.location.state?.pathnameStackToGoBack,e.location.pathname);e.navigate(Ne(a,e.tenantEmailDomain),{state:{pathnameStackToGoBack:n}})},onTrendSelectedPeriodChange:a=>{if(a==null)e.defaultTrendTransactionTimePeriod!=null&&t(ye(e.entity,"TransactionDetail",{timeframe:"month",timePeriod:e.defaultTrendTransactionTimePeriod}));else{const n=a.currentTimePeriod==null?a.addTimePeriod:{startDate:a.addTimePeriod.startDate,endDate:a.currentTimePeriod.endDate};t(ie(e.entity,"TransactionDetail",{timeframe:a.timeframe,timePeriod:a.addTimePeriod})),t(ye(e.entity,"TransactionDetail",{timeframe:a.timeframe,timePeriod:n}))}},onSaveUpdates:(a,n,o,c)=>{t(c===!0&&o!=null?xe(a,o,!0,e.isExpenseAutomationEnabled,e.isUncategorizedExpenseCategoryEnabled):Ut({transactionId:a,isExpenseAutomationEnabled:e.isExpenseAutomationEnabled,cotTransactionTracking:n,isUncategorizedExpenseCategoryEnabled:e.isUncategorizedExpenseCategoryEnabled})),t(M("common"))},onUploadAttachmentAttachment:a=>{t(Ot(a))},onDeleteAttachment:a=>{e.transaction!=null&&t(At(a,{id:e.transaction.id,type:e.transaction.type}))},onSaveTransactionDetailLocalData:(a,n)=>{t(kt({transactionId:a,transactionLocalData:n}))},onUpdateAllChecked:(a,n,o,c)=>{e.transaction!=null&&t(Ct(e.selectedTransaction,e.transaction,a,n,o,c))},onResetLineItemsCategoryClassInLocalData:(a,n,o,c,r,p)=>{t(Dt(a,n,o,c,r,p))},onChangeCategoryClassWhenUpdateAllIsChecked:(a,n)=>{e.transaction!=null&&t(It({id:e.transaction.id,type:e.transaction.type},e.transaction,a,n))},onSaveSuccess:()=>{const a=ae(e.location.state?.pathnameStackToGoBack);if(a.poppedPathname!=null){const n=Ht(a.poppedPathname,"/").split("/"),o=n[n.length-1];if(["uncategorized-income","uncategorized-expense","missing-receipts"].includes(o)&&e.navigate(a.poppedPathname,{state:{pathnameStackToGoBack:a.newStack}}),e.location.state?.message==="comingFromScheduleDetails"){const c=`${qt(e.tenantEmailDomain)}`;e.navigate(c)}else if(e.location.state?.message==="comingFromScheduleDetailsFixedAssets"){const c=`${Wt(e.tenantEmailDomain)}`;e.navigate(c)}}},onPageRefresh:()=>{t(we(e.selectedTransaction,!0))},autoCompleteActions:{onAutoCompleteInputChange:(a,n)=>{a.trim().length>=2?t(vt({searchString:a,entityType:n,searchOrigin:"common"})):a.trim().length===0&&t(M("common"))},onCancelAutoComplete:()=>{t(M("common"))}},onFetchRecommendationsForEntity:(a,n,o,c)=>{t(Y({entity:a,amount:n,transactionDetails:o,flowType:"detail",isFetchCOT:s}))},clearRecommendationForLineId:a=>{const{transactionId:n,transaction:o,lineId:c}=a;t(Et(n,o,c))},resetUpdateErrorState:()=>{const a={id:e.selectedTransaction.id,type:e.selectedTransaction.type};t(bt(a))},onSaveVendorInLocalData:(a,n,o,c,r)=>{if(t(Tt({transactionId:a,vendorUpdates:n,entity:o})),n.id!=null&&o!=null&&c!=null&&r!=null&&t(Y({entity:o,amount:c,transactionDetails:r,flowType:"detail",isFetchCOT:s})),t(Oe({vendorId:n.id?n.id:void 0,localData:{vendorName:n.name,vendorId:n.id?n.id:void 0}})),!n.id&&e.transaction!=null){const p=e.transaction,g=ne(e.location.state?.pathnameStackToGoBack,e.location.pathname);e.navigate(`/${e.tenantEmailDomain}/transaction/${encodeURIComponent(p.type??"")}/${p.id}/vendor/create`,{state:{pathnameStackToGoBack:g}})}},onSaveCustomerInLocalData:(a,n,o,c,r)=>{t(gt({transactionId:a,customerUpdates:n,entity:o})),n.id!=null&&o!=null&&c!=null&&r!=null&&t(Y({entity:o,amount:c,transactionDetails:r,flowType:"detail",isFetchCOT:s}))},onUpdateAllTranactionsWithCurrentVendorChecked:a=>{t(St({transactionId:{id:e.selectedTransaction.id,type:e.selectedTransaction.type},isUpdateEnabled:a}))},onClickUpdateVendorToAllLineItems:(a,n,o)=>{t(yt(a,n,o))},onResetVendorToAllLineItems:(a,n,o)=>{t(ht(a,n,o))},saveLatestSelectedEntity:(a,n,o)=>{t(ft({transactionId:a,lineId:n,entity:o}))},updateVendorBulkRecommendationsFetchStatus:(a,n)=>{t(pt(a,n))},setIsVendorUpdateAllChecked:(a,n,o)=>{t(mt(a,n,o))},onCreateTransferEntry:e.isCreateTransferEntryFromExpenseEnabled===!0?a=>Zt(t,a):void 0}})(Lt);function ya(){const t=Te(),e=q(),s=ge(),{useFeatureGate:a,useDynamicConfig:n}=J(),o=Vt(),c=S(d=>Q(d)),r=c.userRole.includes("charge_card_user")||c.userRole.includes("charge_card_admin"),p=c.userRole!=null&&Ee(c.userRole),g=c.userRole!=null&&ve(c.userRole),{isFeatureEnabled:A}=a(w.isVendorBulkUpdateOnTransactionEnabled),{isFeatureEnabled:y}=a(w.isExpenseAutomationEnabled),{configValue:m}=n(Pe.enableUncategorizedExpenseCategory),O=m?.uncategorized_expense_category_enabled===!0,{tenantEmailDomain:T,transactionTypeEncoded:f,transactionId:C}=be(),[I,k]=i.useState(!1),b=Ve(f??""),U=Be(C,b),_=S(d=>d.transactionVendorViewState),B=re(),{isFeatureEnabled:z}=a(w.isTransactionCommentingEnabled),{isFeatureEnabled:G}=a(w.isCreateTransferEntryFromExpenseEnabled),{isFeatureEnabled:N}=a(w.isProjectsTransactionsEnabled),P=o?.currentTenant?.companyId,R=o?.currentTenant?.companyName,v=i.useMemo(()=>{if(U)return{id:C,type:W(b)}},[U,C,b]),l=v!=null?S(d=>H(d,v)):void 0,j=l?.transactionDetailLocalData.vendorUpdates?.id!=null?_.editVendorStateById[l?.transactionDetailLocalData.vendorUpdates.id]?.saveStatus.fetchState:"Not-Started",D=l?.fetchState==="Completed"?Re(l?.transaction):void 0,F=S(d=>D!=null?Ie(d.customerIncomeState,d.vendorExpenseState,d.trendState,D,"month"):void 0),h=S(d=>oe(d)),E=S(d=>D!=null?De(d.trendWithTransactionsState,D,"TransactionDetail"):void 0),u=c.company?.companyInfo.firstMonthOfFY??1,$=S(d=>Ce(d.accountState,d.accountListState,"accountList")),[X,K]=i.useState(!1),[L,le]=i.useState(!1),[ze,de]=i.useState(!1),Ge=i.useCallback(d=>Ne(d,T??"")+s.search,[T,s.search]),je=i.useCallback(()=>{de(!1)},[]);ea({currentTransactionId:v,enabled:T!=null&&T!=="",buildPath:Ge,beforeNavigate:je,navigate:t,navigateState:s.state});const ue=()=>{K(!1),le(!1)},me=Bt();Jt();const Z=i.useRef(l?.transaction);Z.current=l?.transaction;const $e=l?.transactionDetailUpdateStatus?.fetchState,V=Kt($e,()=>{const d=[];if(Z.current!=null)for(const ee of Z.current.lines??[])"account"in ee&&ee.account?.accountId!=null&&d.push(ee.account.accountId);return d});i.useEffect(()=>{v!=null&&l!=null&&l.fetchState==="Not-Started"&&(e(we(v,!1)),ue())},[e,v,l?.fetchState]),i.useEffect(()=>{if(v!=null&&l?.fetchState==="Error"){const d=ne(s.state?.pathnameStackToGoBack,s.pathname);t("page-not-found",{replace:!0,state:me?{pathnameStackToGoBack:d,message:"expenseAutomation",origin:"transaction_categorization"}:{pathnameStackToGoBack:d,message:"pageNotFound",origin:"transaction_detail"}})}},[v,l?.fetchState,t,s.state,s.pathname,me]),i.useEffect(()=>{ze||l==null||l.transaction==null||(e(ke({id:l.transaction.id,type:l.transaction.type})),de(!0)),D==null&&l?.fetchState==="Completed"&&Se(l?.transaction),D!=null&&(!r||p&&g===!1)&&(X?L||F==null||(le(!0),e(ie(D,"TransactionDetail",{timeframe:"month",timePeriod:E?.selectedPeriod?.timePeriod??F}))):(e(se()),e(ce()),Se(l?.transaction),K(!0),e(Ae(D))))},[l?.fetchState,l?.transaction,F,r]),i.useEffect(()=>{h.newVendorState?.vendorDetailLocalData?.vendorName!=null?k(!0):k(!1)},[h.newVendorState?.vendorDetailLocalData?.vendorName]),i.useEffect(()=>()=>{e(M("common"))},[]);const Me=[f,C].filter(d=>d!=null),{transactionId:pe,onSaveVendor:qe,onSaveSuccess:We,onCancel:He}=ta({closeDrawerHandler:d=>{k(!1),t(d?"../":"../..")}}),{isAiCfoAccessEnabled:Je,onAskAiCfoClick:Ke}=Mt({mobileExploreReferrer:"Transaction Details"});return Nt({isDataReady:l?.fetchState==="Completed"}),U?x.jsxs(x.Fragment,{children:[pe!=null&&I&&x.jsx(Qt,{isOpen:I,transactionId:pe,onSaveVendor:qe,onSaveSuccess:We,onCancel:He}),x.jsx(aa,{hideDeleteAttachment:!0,firstMonthOfFY:u,isDisabled:l?.transaction?.type==="transfer"&&o?.connectionName==="netsuite"?"readonly":void 0,tenantEmailDomain:T,location:s,navigate:t,selectedTransaction:v,entity:D,isCOTEnabled:B,defaultTrendTransactionTimePeriod:F,resetTrendIsFetchedStates:ue,transaction:l?.transaction,uncategorizedAccounts:$,vendorSaveStatus:j,isVendorBulkUpdateOnTransactionEnabled:A,isCreateTransferEntryFromExpenseEnabled:G,isExpenseAutomationEnabled:y,isUncategorizedExpenseCategoryEnabled:O,isAiCfoAccessEnabled:Je,onAskAiCfoClick:Ke,isTransactionCommentingEnabled:z,isProjectsTransactionsEnabled:N,companyId:P,companyName:R}),V.showPopup&&V.popupType!=null&&x.jsx(Rt,{popupType:V.popupType,currencySymbol:V.currencySymbol,accountId:V.popupAccountId??"",accountName:V.popupAccountName??"",onSubmit:V.handleSubmit,onDismiss:V.handleDismiss})]}):x.jsx(Qe,{to:Le(Me.length)})}const Le=(t=2)=>{let e="../";for(let s=0;s<t;s++)e=`${e}../`;return e},Se=t=>{if(t!=null){const{transactionCategory:e,transactionClass:s}=na(t),a=oa(t);Fe.trackTransactionDetails(t.account?.accountId,t.account?.accountName,t.id,a,e.length>0?e:void 0,s.length>0?s:void 0,t.type,t.amount,t.memo,t.lines?.length??0,t.attachments?.map(n=>n.fileName))}},na=t=>{const e=[],s=[];return t.lines?.forEach(a=>{switch(a.type){case"transaction_with_account_and_class_line":case"transaction_with_product_or_service_line":case"journal_entry_transaction_line":case"linked_transaction_line":{const n=a;n!=null&&n.account!=null&&n.account.accountName?.length>0&&e.push(n.account.accountName),n.class!=null&&n.class.className?.length>0&&s.push(n.class.className);break}}}),{transactionCategory:e,transactionClass:s}},oa=t=>rt(t)===!0?t.customer?.name??"":lt(t)===!0?t.vendor?.name??"":t.memo!=null?t.memo:t.type;export{Qt as C,ya as T,Jt as a,Kt as b,ta as c,aa as d,ea as e,re as f,Zt as g,ha as u};
@@ -1 +0,0 @@
1
- import{j as s}from"./liveblocks-C5Zo4IsV.js";import{h as Q,g as H,u as X,i as U,j as S,N as z,n as Z,o as ve,p as j}from"./core-CDuxXgNT.js";import{eX as K,qS as W,jX as u,RG as ee,K1 as De,bo as le,RH as be,ky as te,NH as ae,RI as ue,RJ as Pe,bE as Y,JZ as ye,RK as Ee,RL as me,RM as je,K0 as Ae,RN as xe,RO as pe,RP as Me,RQ as ge,RR as Le,RS as Ce,RT as fe,Ld as Be}from"./zeni-epic-state-aFTbMOAR.js";import{a as de,Q as ne,e as q,f as G,cp as ce,v as V,s as oe,Y as Fe,d as Oe}from"./index-DzOogTqR.js";import"./mui-BWYOl-fu.js";import{a as g}from"./sentry-pTjqe1GE.js";import{w as se}from"./withTransactionSidePanel-BzAvEIvv.js";import{p as ie,c as re}from"./routePaths-rmRxk_gU.js";import{v as Re}from"./utils-C-pFPw5l.js";import{d as b}from"./decodeURIComponentSafe-B8X6jXbR.js";import{Z as Ge}from"./ZeniAccountStatementScreen-wVpVNvAj.js";import"./recharts-DOA55GXl.js";import"./analytics-CpUJgE1w.js";import"./plaid-2PJJQmCk.js";import"./dnd-VtUMJCWH.js";import"./stripe-DMRn4zHo.js";import"./lottie-B-fnnIRm.js";import"./lexical-CIqawAn4.js";import"./pdf-WEHP-u0u.js";import"./useAskAiCfoHostNavButtonProps-DVKlzRut.js";import"./TransactionDetailScreen-DYaYb3Dh.js";(function(){try{var a=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},e=new a.Error().stack;e&&(a._sentryDebugIds=a._sentryDebugIds||{},a._sentryDebugIds[e]="98e644de-189e-4e90-9a13-b9dbf763a822",a._sentryDebugIdIdentifier="sentry-dbid-98e644de-189e-4e90-9a13-b9dbf763a822")}catch{}})();const ze=["uncategorized-income","uncategorized-expense","miscategorized-income","miscategorized-expense","missing-receipts"],J=a=>Re(a),we=Z(function(a,e){const t=be(a.transactionState,a.transactionListState,e.selectedAccount.period,e.selectedAccount.timeframe,J(e.selectedAccount.tranListType));return{title:e.selectedAccount.title,subTitle:e.selectedAccount.subTitle,timeframe:e.selectedAccount.timeframe,timePeriod:ae(e.selectedAccount.period),dataAvailableForPeriod:e.dataAvailableForPeriod,report:t,currentScrollYOffset:t.uiState?.scrollYOffset??0,isAccountingClassesEnabled:te(a)}},function(a,e){return{onBackClick:()=>{const t=oe(e.location.state?.pathnameStackToGoBack),n=t.poppedPathname??"../../";e.navigate(n,{state:{pathnameStackToGoBack:t.newStack}})},onTimePeriodChange:(t,n,c)=>{e.closeSidePanel?.();const o=de.getLocalizedStrings(),l=J(e.selectedAccount.tranListType),m=Ne(t,n,c,l,e.bookCloseDate);G.trackTransactionList(void 0,void 0,void 0,e.selectedAccount.title,void 0,!0),a(ue({uiState:{dateRange:m},type:J(e.selectedAccount.tranListType)})),a(De(l,u(m),!1,l==="missingReceipts"?o.uncategorizedTransactionList.missingReceipt.missingReceiptMinAmount:void 0)),e.onSelectedTimePeriodChange(u(m))},onTransactionItemClick:t=>{if(e.openTransactionPanel)return void e.openTransactionPanel(t.id,t.type);const n=re(t,e.tenantEmailDomain),c=V(e.location.state?.pathnameStackToGoBack,e.location.pathname);e.navigate(n,{state:{pathnameStackToGoBack:c}})},onTransactionListScroll:t=>{a(ue({uiState:{scrollYOffset:t},type:J(e.selectedAccount.tranListType)}))}}})(ce),N=se(function({...a}){const e=Q(),t=H(),n=X(),c=t.pathname.split("/").find(r=>ze.includes(r)),o=c??"uncategorized-expense",{tenantEmailDomain:l}=U(),m=de.getLocalizedStrings(),{accountType:h,title:T,subTitle:D}=_e(o),y="month",I=S(r=>K(r)),p=I.company?.companyInfo.firstMonthOfFY??1,{useFeatureGate:A}=ne(),{isFeatureEnabled:k}=A(q.isProjectsTransactionsEnabled),x=S(r=>W(r))&&k,{dataAvailable:C,initialTimeframeTick:P}=$e(o,p,I.bookCloseDate),[B,E]=g.useState(!1),[F,O]=g.useState(void 0),f=g.useMemo(()=>{const r=u(P);return{tranListType:o,accountType:ee(h),title:T,subTitle:D,timeframe:y,period:r}},[o,y,h,C]);g.useEffect(()=>{if(!B&&f!=null){E(!0),G.trackTransactionList(void 0,void 0,void 0,f.title);const r=J(f.tranListType);n(De(r,f.period,!0,r==="missingReceipts"?m.uncategorizedTransactionList.missingReceipt.missingReceiptMinAmount:void 0))}},[B,f,n]);let M=f;return f!=null&&F!=null&&(M={...f,period:F}),c==null||M==null?s.jsx(z,{to:"../"}):s.jsx(we,{firstMonthOfFY:p,tenantEmailDomain:l,location:t,useFixedPeriod:{timeframe:"month",numberOfPeriods:12},dataAvailableForPeriod:C,navigate:e,showProjectField:x,selectedAccount:M,referrerType:o,bookCloseDate:I.bookCloseDate,onSelectedTimePeriodChange:r=>O(r),...a})}),_e=a=>{let e="",t="";const n=de.getLocalizedStrings();switch(a){case"uncategorized-income":e="income",t=n.uncategorizedTransactionList.income.title;break;case"uncategorized-expense":e="expenses",t=n.uncategorizedTransactionList.expense.title;break;case"miscategorized-expense":e="expenses",t=n.miscategorizedTransactionList.expense.title;break;case"miscategorized-income":e="income",t=n.miscategorizedTransactionList.income.title;break;case"missing-receipts":t=n.uncategorizedTransactionList.missingReceipt.title}return{accountType:e,title:t,subTitle:""}},$e=(a,e,t)=>{const n=le();let c=le().startOf("month").subtract(11,"month");return t!=null&&a!=="missing-receipts"?t.add(1,"day").isBefore(c)?{dataAvailable:{startDate:t.add(1,"day"),endDate:n},initialTimeframeTick:{startDate:c,endDate:n}}:(c=t.add(1,"day"),{dataAvailable:{startDate:c,endDate:n},initialTimeframeTick:{startDate:c,endDate:n}}):{dataAvailable:ie(5,e),initialTimeframeTick:{startDate:c,endDate:n}}},Ne=(a,e,t,n,c)=>{let o=e;return n==="missingReceipts"||c==null?a.startDate.isBefore(e.startDate,t)?o={startDate:a.startDate,endDate:e.endDate}:a.startDate.isAfter(e.endDate,t)?o={startDate:e.startDate,endDate:a.endDate}:console.error(`Invalid addTimePeriod ${JSON.stringify(a)}`):o=a.startDate.isBefore(c,t)?{startDate:c.add(1,"day"),endDate:e.endDate}:{startDate:a.startDate,endDate:e.endDate},o},Je=Z(function(a,e){const t=Ee(a.transactionState,a.transactionListState,e.selectedAccount.accountId,e.selectedAccount.accountType,e.selectedAccount.classId,e.selectedAccount.timeframe,e.selectedAccount.period);return{accountId:e.selectedAccount.accountId,accountType:e.selectedAccount.accountType,title:e.selectedAccount.title,timeframe:e.selectedAccount.timeframe,timePeriod:ae(e.selectedAccount.period),dataAvailableForPeriod:ie(5,e.firstMonthOfFY),report:t,currentScrollYOffset:t.uiState?.scrollYOffset??0,isAccountingClassesEnabled:te(a)}},function(a,e){return{onBackClick:()=>{const t=oe(e.location.state?.pathnameStackToGoBack),n=t.poppedPathname??Se();e.navigate(n,{state:{pathnameStackToGoBack:t.newStack}})},onTimePeriodChange:(t,n,c)=>{e.closeSidePanel?.();let o=n;t.startDate.isBefore(n.startDate,c)?o={startDate:t.startDate,endDate:n.endDate}:t.startDate.isAfter(n.endDate,c)?o={startDate:n.startDate,endDate:t.endDate}:console.error(`Invalid addTimePeriod ${JSON.stringify(t)}`),G.trackTransactionList(e.selectedAccount.accountId,void 0,e.referrerType,e.selectedAccount.title,void 0,!0),a(me({accountId:e.selectedAccount.accountId,accountType:e.selectedAccount.accountType,classId:e.selectedAccount.classId,uiState:{dateRange:o}})),a(ye(e.selectedAccount.accountId,e.selectedAccount.accountType,e.selectedAccount.classId,u(o))),e.onSelectedTimePeriodChange(u(o))},onTransactionItemClick:t=>{if(e.openTransactionPanel)return void e.openTransactionPanel(t.id,t.type);const n=re(t,e.tenantEmailDomain),c=V(e.location.state?.pathnameStackToGoBack,e.location.pathname);e.navigate(n,{state:{pathnameStackToGoBack:c}})},onTransactionListScroll:t=>{a(me({accountId:e.selectedAccount.accountId,accountType:e.selectedAccount.accountType,classId:e.selectedAccount.classId,uiState:{scrollYOffset:t}}))}}})(ce),qe=se(function({referrerType:a,...e}){const t=Q(),n=H(),c=X(),{tenantEmailDomain:o,accountTypeEncoded:l,accountIdEncoded:m,classIdEncoded:h,timeframe:T,startDate:D,endDate:y,titleEncoded:I}=U(),p=b(l??""),A=b(m??""),k=b(h??""),x=b(I??""),C=S(d=>Pe(d.transactionListState,A,p,k)),[P,B]=g.useState(!1),[E,F]=g.useState(void 0),O=S(d=>K(d)),f=O.company?.companyInfo.firstMonthOfFY??1,{useFeatureGate:M}=ne(),{isFeatureEnabled:r}=M(q.isProjectsTransactionsEnabled),w=S(d=>W(d))&&r;let i;const R=Ve(p,A,k,T,D,y,x);if(R){const d={startDate:Y(D,"YYYY-MM-DD"),endDate:Y(y,"YYYY-MM-DD")},_=He(C?.dateRange,d);i={accountId:A,accountType:ee(p),classId:k,title:x,timeframe:T,period:_}}g.useEffect(()=>{P||i==null||(B(!0),G.trackTransactionList(i.accountId,void 0,a,i.title),c(ye(i.accountId,i.accountType,i.classId,i.period)))},[P,i,c]);let L=i;i!=null&&E!=null&&(L={...i,period:E});const $=[l,m,h,T,D,y,I].filter(d=>d!=null);return R&&L!=null?s.jsx(Je,{firstMonthOfFY:f,tenantEmailDomain:o,location:n,navigate:t,showProjectField:w,selectedAccount:L,referrerType:a,onSelectedTimePeriodChange:d=>F(d),...e}):s.jsx(z,{to:Se($.length)})}),Se=(a=7)=>{let e="../";for(let t=0;t<a;t++)e=`${e}../`;return e},Ve=(a,e,t,n,c,o,l)=>a!=null&&e!=null&&t!=null&&n!=null&&c!=null&&o!=null&&(n==="month"||n==="quarter")&&Y(c,"YYYY-MM-DD").isValid()&&Y(o,"YYYY-MM-DD").isValid()&&l!=null,He=(a,e)=>a!=null&&a.endDate.isSame(e.endDate,"day")&&a.startDate.isBefore(e.startDate,"day")?u(a):u(e),Ke=Z(function(a,e){const t=xe(a.transactionState,a.transactionListState,e.selectedAccount.accountId,e.selectedAccount.accountType,e.selectedAccount.projectId,e.selectedAccount.timeframe,e.selectedAccount.period);return{accountId:e.selectedAccount.accountId,accountType:e.selectedAccount.accountType,title:e.selectedAccount.title,timeframe:e.selectedAccount.timeframe,timePeriod:ae(e.selectedAccount.period),dataAvailableForPeriod:ie(5,e.firstMonthOfFY),report:t,currentScrollYOffset:t.uiState?.scrollYOffset??0,isAccountingClassesEnabled:te(a)}},function(a,e){return{onBackClick:()=>{const t=oe(e.location.state?.pathnameStackToGoBack),n=t.poppedPathname??he();e.navigate(n,{state:{pathnameStackToGoBack:t.newStack}})},onTimePeriodChange:(t,n,c)=>{e.closeSidePanel?.();let o=n;t.startDate.isBefore(n.startDate,c)?o={startDate:t.startDate,endDate:n.endDate}:t.startDate.isAfter(n.endDate,c)?o={startDate:n.startDate,endDate:t.endDate}:console.error(`Invalid addTimePeriod ${JSON.stringify(t)}`),G.trackTransactionList(e.selectedAccount.accountId,void 0,e.referrerType,e.selectedAccount.title,void 0,!0),a(pe({accountId:e.selectedAccount.accountId,accountType:e.selectedAccount.accountType,projectId:e.selectedAccount.projectId,uiState:{dateRange:o}})),a(Ae(e.selectedAccount.accountId,e.selectedAccount.accountType,e.selectedAccount.projectId,u(o))),e.onSelectedTimePeriodChange(u(o))},onTransactionItemClick:t=>{if(e.openTransactionPanel)return void e.openTransactionPanel(t.id,t.type);const n=re(t,e.tenantEmailDomain),c=V(e.location.state?.pathnameStackToGoBack,e.location.pathname);e.navigate(n,{state:{pathnameStackToGoBack:c}})},onTransactionListScroll:t=>{a(pe({accountId:e.selectedAccount.accountId,accountType:e.selectedAccount.accountType,projectId:e.selectedAccount.projectId,uiState:{scrollYOffset:t}}))}}})(ce),Qe=se(function({referrerType:a,...e}){const t=Q(),n=H(),c=X(),{tenantEmailDomain:o,accountTypeEncoded:l,accountIdEncoded:m,projectIdEncoded:h,timeframe:T,startDate:D,endDate:y,titleEncoded:I}=U(),p=b(l??""),A=b(m??""),k=b(h??""),x=b(I??""),C=S(d=>je(d.transactionListState,A,p,k)),[P,B]=g.useState(!1),[E,F]=g.useState(void 0),O=S(d=>K(d)),f=O.company?.companyInfo.firstMonthOfFY??1,{useFeatureGate:M}=ne(),{isFeatureEnabled:r}=M(q.isProjectsTransactionsEnabled),w=S(d=>W(d))&&r;let i;const R=Xe(p,A,k,T,D,y,x);if(R){const d={startDate:Y(D,"YYYY-MM-DD"),endDate:Y(y,"YYYY-MM-DD")},_=Ue(C?.dateRange,d);i={accountId:A,accountType:ee(p),projectId:k,title:x,timeframe:T,period:_}}g.useEffect(()=>{P||i==null||(B(!0),G.trackTransactionList(i.accountId,void 0,a,i.title),c(Ae(i.accountId,i.accountType,i.projectId,i.period)))},[P,i,c]);let L=i;i!=null&&E!=null&&(L={...i,period:E});const $=[l,m,h,T,D,y,I].filter(d=>d!=null);return R&&L!=null?s.jsx(Ke,{firstMonthOfFY:f,tenantEmailDomain:o,location:n,navigate:t,showProjectField:w,selectedAccount:L,referrerType:a,onSelectedTimePeriodChange:d=>F(d),...e}):s.jsx(z,{to:he($.length)})}),he=(a=7)=>{let e="../";for(let t=0;t<a;t++)e=`${e}../`;return e},Xe=(a,e,t,n,c,o,l)=>a!=null&&e!=null&&t!=null&&n!=null&&c!=null&&o!=null&&(n==="month"||n==="quarter")&&Y(c,"YYYY-MM-DD").isValid()&&Y(o,"YYYY-MM-DD").isValid()&&l!=null,Ue=(a,e)=>a!=null&&a.endDate.isSame(e.endDate,"day")&&a.startDate.isBefore(e.startDate,"day")?u(a):u(e),Ze=Z(function(a,e){const t=Le(a.transactionState,a.transactionListState,e.selectedAccount.accountId,e.selectedAccount.accountType,e.selectedAccount.timeframe,e.selectedAccount.period),n=t.account?.coaId,c=e.isConnectedAccountProviderUnit&&Ce(n??"");return{accountId:e.selectedAccount.accountId,accountType:e.selectedAccount.accountType,title:e.selectedAccount.title,timeframe:e.selectedAccount.timeframe,timePeriod:ae(e.selectedAccount.period),dataAvailableForPeriod:ie(5,e.firstMonthOfFY),report:t,currentScrollYOffset:t.uiState?.scrollYOffset??0,showStatementPageIcon:c,isAccountingClassesEnabled:te(a)}},function(a,e){return{onBackClick:()=>{const t=oe(e.location.state?.pathnameStackToGoBack),n=t.poppedPathname??Ie();e.navigate(n,{state:{pathnameStackToGoBack:t.newStack}})},onTimePeriodChange:(t,n,c)=>{e.closeSidePanel?.();let o=n;t.startDate.isBefore(n.startDate,c)?o={startDate:t.startDate,endDate:n.endDate}:t.startDate.isAfter(n.endDate,c)?o={startDate:n.startDate,endDate:t.endDate}:console.error(`Invalid addTimePeriod ${JSON.stringify(t)}`),G.trackTransactionList(e.selectedAccount.accountId,void 0,e.referrerType,e.selectedAccount.title,void 0,!0),a(fe({accountId:e.selectedAccount.accountId,accountType:e.selectedAccount.accountType,uiState:{dateRange:o}})),a(ge(e.selectedAccount.accountId,e.selectedAccount.accountType,u(o))),e.onSelectedTimePeriodChange(u(o))},onTransactionItemClick:t=>{if(e.openTransactionPanel)return void e.openTransactionPanel(t.id,t.type);const n=re(t,e.tenantEmailDomain),c=V(e.location.state?.pathnameStackToGoBack,e.location.pathname);e.navigate(n,{state:{pathnameStackToGoBack:c}})},onTransactionListScroll:t=>{a(fe({accountId:e.selectedAccount.accountId,accountType:e.selectedAccount.accountType,uiState:{scrollYOffset:t}}))},onStatementPageIconClick:()=>{const t=tt(e.tenantEmailDomain),n=V(e.location.state?.pathnameStackToGoBack,e.location.pathname);e.navigate(t,{state:{pathnameStackToGoBack:n}})}}})(ce),Te=se(function({referrerType:a,...e}){const t=Q(),n=H(),c=X(),{tenantEmailDomain:o,accountTypeEncoded:l,accountIdEncoded:m,timeframe:h,startDate:T,endDate:D,titleEncoded:y,excludeSubAccounts:I}=U(),p=b(l??""),A=b(m??""),k=b(y??""),x=!(I!=null&&I==="exclude_subaccounts"),C=S(v=>Me(v.transactionListState,A,p)),[P,B]=g.useState(!1),[E,F]=g.useState(void 0),O=S(v=>K(v)),f=O.company?.featuresActivationInfo.connectedAccountProvider==="unit",M=O.company?.companyInfo.firstMonthOfFY??1;let r;const w=We(p,A,h,T,D,k);if(w){const v={startDate:Y(T,"YYYY-MM-DD"),endDate:Y(D,"YYYY-MM-DD")},Ye=et(C?.dateRange,v);r={accountId:A,accountType:ee(p),title:k,timeframe:h,period:Ye}}let i=r;r!=null&&E!=null&&(i={...r,period:E});const{useFeatureGate:R}=ne(),{isFeatureEnabled:L}=R(q.isTransactionCommentingEnabled),{isFeatureEnabled:$}=R(q.isProjectsTransactionsEnabled),d=S(v=>W(v))&&$,{areTenantIdsInSync:_}=Fe();g.useEffect(()=>{!P&&r!=null&&_&&(B(!0),G.trackTransactionList(r.accountId,void 0,a,r.title),c(ge(r.accountId,r.accountType,r.period,void 0,!1,x)))},[P,r,c,_]);const ke=[l,m,h,T,D,y].filter(v=>v!=null);return w&&i!=null?s.jsx(Ze,{firstMonthOfFY:M,tenantEmailDomain:o,location:n,navigate:t,isConnectedAccountProviderUnit:f,isTransactionCommentingEnabled:L,showProjectField:d,selectedAccount:i,referrerType:a,onSelectedTimePeriodChange:v=>F(v),...e}):s.jsx(z,{to:Ie(ke.length)})}),Ie=(a=7)=>{let e="../";for(let t=0;t<a;t++)e=`${e}../`;return e},We=(a,e,t,n,c,o)=>a!=null&&e!=null&&t!=null&&n!=null&&c!=null&&(t==="month"||t==="quarter")&&Y(n,"YYYY-MM-DD").isValid()&&Y(c,"YYYY-MM-DD").isValid()&&o!=null,et=(a,e)=>a!=null&&a.endDate.isSame(e.endDate,"day")&&a.startDate.isBefore(e.startDate,"day")?u(a):u(e),tt=a=>`/${a}/transactions/${Be}/statements`;function kt(){const a=H().state?.referrer,e=S(n=>n.expenseAutomationViewState.selectedPeriodByTenantId)[S(n=>K(n)).tenantId],t=Oe();return s.jsxs(ve,{children:[s.jsx(j,{path:"/:accountTypeEncoded/:accountIdEncoded/:timeframe/:startDate/:endDate/:titleEncoded/:excludeSubAccounts/*",element:s.jsx(Te,{referrerType:a})}),s.jsx(j,{path:"/zeni-clearing-account/statements",element:s.jsx(Ge,{})}),s.jsx(j,{path:"/*",element:s.jsx(Te,{referrerType:a})}),s.jsx(j,{path:"/uncategorized-income/*",element:s.jsx(N,{})}),s.jsx(j,{path:"/uncategorized-expense/*",element:t?s.jsx(z,{to:`../../month_end_close_checks/review/transaction_categorization/${e.month}-${e.year}`}):s.jsx(N,{})}),s.jsx(j,{path:"/miscategorized-income/*",element:s.jsx(N,{})}),s.jsx(j,{path:"/miscategorized-expense/*",element:t?s.jsx(z,{to:`../../month_end_close_checks/review/transaction_categorization/${e.month}-${e.year}`}):s.jsx(N,{})}),s.jsx(j,{path:"/missing-receipts/*",element:t?s.jsx(z,{to:`../../month_end_close_checks/review/missing_receipts/${e.month}-${e.year}`}):s.jsx(N,{})}),s.jsx(j,{path:"/by-class/:accountTypeEncoded/:accountIdEncoded/:classIdEncoded/:timeframe/:startDate/:endDate/:titleEncoded/*",element:s.jsx(qe,{referrerType:a})}),s.jsx(j,{path:"/by-project/:accountTypeEncoded/:accountIdEncoded/:projectIdEncoded/:timeframe/:startDate/:endDate/:titleEncoded/*",element:s.jsx(Qe,{referrerType:a})})]})}export{kt as default};
@@ -1,37 +0,0 @@
1
- import{j as e}from"./liveblocks-C5Zo4IsV.js";import{h as U,g as B,u as P,i as O,j as y,N as L,n as N,o as we,p as k}from"./core-CDuxXgNT.js";import{cp as G,eX as D,Qp as R,Go as ae,fX as q,G6 as ne,Qr as Ie,Gr as ke,Qn as be,Qo as se,QE as je,Ev as Ee,uc as Ae,Qt as ve,GK as De,Qq as re,cT as Z,ys as oe,fC as Fe,fE as Le,RD as Ue,RE as Be,G7 as Pe,RF as Re,G8 as Me,Gh as Ve,bs as Oe,bJ as Ne,cA as Ge,bK as _e,co as $e,fW as ze,bt as Qe,LY as qe,cn as Ze}from"./zeni-epic-state-aFTbMOAR.js";import{I as _,aq as He,z as E,J as $,f as b,ci as Ke,cj as Je,ck as Q,Z as H,m as We,Y as Xe,$ as Ye,Q as ie,e as A,D as et,y as tt,cl as at,at as K,v as nt,cm as st,s as J,cn as rt,F as X,co as ot,i as it}from"./index-DzOogTqR.js";import{D as ct,n as M,S as lt}from"./mui-BWYOl-fu.js";import ut from"./NotFoundScreen-B_nzx2PP.js";import{S as Y}from"./SetupPagesScreen-DEnNlIFZ.js";import{a as p}from"./sentry-pTjqe1GE.js";import{u as dt}from"./useAskAiCfoHostNavButtonProps-DVKlzRut.js";import{u as pt}from"./useInitialThreadRequest-C_oymrXt.js";import{u as mt}from"./useCashManagementBanner-BEqGoY3j.js";import{M as ce}from"./MobileAppDrawer-BWG5ZoNF.js";import{F as ft}from"./FeaturePreviewScreen-dZphyDK8.js";import{a as ee}from"./analyticsHelper-CLhyHcZM.js";import"./recharts-DOA55GXl.js";import"./analytics-CpUJgE1w.js";import"./plaid-2PJJQmCk.js";import"./dnd-VtUMJCWH.js";import"./stripe-DMRn4zHo.js";import"./lottie-B-fnnIRm.js";import"./lexical-CIqawAn4.js";import"./pdf-WEHP-u0u.js";import"./utils-C-pFPw5l.js";import"./routePaths-rmRxk_gU.js";import"./BusinessVerificationPageScreen-B-L9gdz1.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]="ec6644a1-2266-42bd-83c7-b4780d13d710",t._sentryDebugIdIdentifier="sentry-dbid-ec6644a1-2266-42bd-83c7-b4780d13d710")}catch{}})();const yt=N(function(t,a){const{companyId:n}=a;return{treasurySetupView:R(t,n),analytics:b}},function(t,a){const{navigate:n,analytics:o,treasurySetupView:m}=a;return{onBackClick:()=>{n("../")},onNextClick:()=>{const s=m.fundAllocationLocalData;o.trackTreasuryPortfolioConfirm(s.riskScore,ee(s)),t(ke(!0))},onUpdateFundAllocation:s=>{o.trackTreasuryAllocationAction("update",ee(s)),t(Ie(s))}}})(Ke);function gt(){const t=U(),a=B(),n=P(),{tenantEmailDomain:o}=O(),m=_(),s=y(I=>I.treasurySetupViewState.portfolioAllocationUpdateStatus?.fetchState),f=He(s),r=G(m?.loggedInUserRoleMap),[l,i]=p.useState(!1),[u,T]=p.useState(!1),[d,c]=p.useState(!1),h=y(I=>D(I)),g=E.getSignedInUserTenant(o)?.companyId??h.companyId,C=E.getSignedInUser(),S=y(I=>R(I,g)),w=y(I=>I.treasurySetupViewState.fetchState),x=y(I=>I.treasurySetupViewState.currentAllocation.fetchStatus?.fetchState),F=y(I=>I.treasurySetupViewState.treasuryFundsDetails?.fetchStatus?.fetchState);if(C==null)throw Error("Can't access treasury portfolio allocation page without signing in...");if(p.useEffect(()=>{l||w!=="Not-Started"||g==null||(i(!0),n(ae(g,!0,!1)))},[l,w,g,n]),p.useEffect(()=>{d||F!=="Not-Started"||g==null||(c(!0),n(q()))},[d,F,g,n]),p.useEffect(()=>{u||x!=="Not-Started"||g==null||(T(!0),n(ne()))},[u,x,g,n]),p.useEffect(()=>{f==="In-Progress"&&s==="Completed"&&t("../")},[f,s,t]),h.companyTreasuryInfo?.info?.isTreasuryTOSAccepted===!1)return e.jsx(L,{to:"../promo"});const v=h.companyTreasuryInfo?.info?.isTreasuryTOSAccepted!==!0||w!=="Completed";return e.jsxs(e.Fragment,{children:[!v&&e.jsx($,{analytics:b,onLoad:()=>{}}),e.jsx(yt,{navigate:t,location:a,companyId:g,isEditMode:!0,isLoading:v,isReadOnly:!r,treasurySetupView:S,analytics:b})]})}const ht=N(function(t,a){const n=a.currentTenant?.companyId;return{plaidConnectionDetails:je(t,n,"zeni_treasury","treasury_setup").plaidConnectionDetails,treasurySetupView:R(t,n)}},function(t,a){const{navigate:n,transferDetails:o,treasurySetupView:m}=a,s=o.treasuryTransferMoneyLocalData,f=m.fundAllocationLocalData;return{onCancelClick:()=>{Q(a.analytics,"cancel",s,f,"Transfer"),t(se()),n("../")},onTransferClick:()=>{Q(a.analytics,"confirm",s,f,"Transfer"),t(De())},onSaveChangesToLocalStore:r=>{t(ve(r))},onFetchLinkTokenClick:r=>{t(Ae("treasury_setup",r))},onEstablishConnectionClick:r=>{t(Ee(r,a.currentTenant?.companyId,"treasury_setup","zeni_treasury"))}}})(Je),St=({isFirstTransfer:t})=>{const a=U(),{tenantEmailDomain:n}=O(),o=P(),[m,s]=p.useState(!1),[f,r]=p.useState(!1),[l,i]=p.useState(!1),[u,T]=p.useState(!1),d=y(x=>x.treasurySetupViewState.fetchState),c=y(x=>x.treasurySetupViewState.treasuryFundsDetails?.fetchStatus?.fetchState),h=y(x=>x.treasurySetupViewState.currentAllocation.fetchStatus?.fetchState),g=y(x=>D(x)),C=E.getSignedInUserTenant(n)?.companyId??g.companyId,S=y(x=>be(x)),w=y(x=>R(x,C));if(E.getSignedInUser()==null)throw Error("Can't access treasury transfer page without signing in...");return p.useEffect(()=>{f||d!=="Not-Started"||C==null||(r(!0),o(ae(C,!0,!1)))},[f,d,C,o]),p.useEffect(()=>{l||c!=="Not-Started"||C==null||(i(!0),o(q()))},[l,c,C,o]),p.useEffect(()=>{u||h!=="Not-Started"||C==null||(T(!0),o(ne()))},[u,h,C,o]),e.jsxs(e.Fragment,{children:[e.jsx($,{analytics:b,onLoad:()=>{}}),e.jsx(ht,{analytics:b,navigate:a,transferDetails:S,onAnotherTransferClick:()=>{s(!1),o(se())},currentTenant:g,treasurySetupView:w,showReviewContent:m,maxInsuredAmount:5e5,onReviewClick:()=>{Q(b,"review",S.treasuryTransferMoneyLocalData,w.fundAllocationLocalData,"Transfer"),s(!0)},isFirstTransfer:t,setShowReviewContent:s,onBackClick:()=>{}})]})},xt=M.div`
2
- display: flex;
3
- min-height: 100%;
4
- width: 100%;
5
- flex: 1 1 auto;
6
- flex-direction: column;
7
- align-items: center;
8
- background-color: ${t=>t.theme.colors.grey4};
9
- `,Ct={overlayWidth:new et(100,100,48)},Tt=N(function(t,a){const n=re(t),{companyId:o}=a;return{treasuryDetail:n,treasurySetupView:R(t,o),downloadEndPoint:`${K.bankingMicroServiceBaseUrl}/1.0/treasury-account/statements?query={"statement_type":"tax_statement"}`}},function(t,a){const{navigate:n,currentTenant:o,location:m,handleDrawerToggle:s,analytics:f,isCashManagementFeatureEnabled:r}=a,{tenantEmailDomain:l}=o;return{onSettingsClick:()=>{f.trackAccountsListPageClicked("Settings Icon"),n("setup")},onReloadTransactions:()=>{t(oe(!0))},handleTreasuryOptionSelection:i=>{let u="page-not-found";i==="editPortfolio"?u=wt(l):i==="statements"?u=It(l):i==="taxLetter"?u=kt(l):i==="settings"&&(u=bt(l));const T=nt(m.state?.pathnameStackToGoBack,m.pathname);n(u,{state:{pathnameStackToGoBack:T}})},onColumnSortConfigChanged:(i,u)=>{t(Ue({uiState:{sortKey:i,sortOrder:u}}))},onTransferClick:()=>{n("./transfer")},onBackClick:()=>{n("../../")},onClickMenuIcon:()=>{s(!0)},onAutoTransferClick:()=>{n(r?"../../checking/cash_management/auto-transfer":"../../checking/auto-transfer")},onCashManagementClick:()=>{n(`/${l}/checking/cash_management`)}}})(at);function z({isTransferDrawerOpen:t,isEditPortfolioDrawerOpen:a}){const n=B(),o=U(),m=P(),s=H(),f=We(),r=y(j=>D(j)),{tenantEmailDomain:l}=O(),i=r.companyId??E.getSignedInUserTenant(l)?.companyId,[u,T]=p.useState(!1),d=y(j=>re(j)),c=d.fetchState,h=d.accountSummary?.totalBalance?.amount,g=y(j=>j.treasurySetupViewState.treasuryFundsDetails?.fetchStatus),C=r.companyTreasuryInfo?.info?.businessVerificationStatus?.code==="verified",S=_(),w=!!r.companyTreasuryInfo?.info?.isTreasuryTOSAccepted,x=G(S?.loggedInUserRoleMap),F=Z(S?.loggedInUserRoleMap),{areTenantIdsInSync:v}=Xe();p.useEffect(()=>{c==="Not-Started"&&!u&&v&&(T(!0),m(oe(!0)))},[u,m,c,v]),p.useEffect(()=>{d.transactionsFetchState.fetchState==="Completed"&&d.transactions.length===0&&!n.pathname.includes("transfer")&&x&&o("./transfer")},[d.transactionsFetchState.fetchState,d.transactions.length]);const I=()=>{o("..")},[le,ue]=p.useState(!1),W=j=>{ue(j)},{isAiCfoAccessEnabled:de,onAskAiCfoClick:pe}=dt({mobileExploreReferrer:"Treasury"});Ye({isDataReady:c==="Completed"});const me=mt(),{useFeatureGate:V}=ie(),{isFeatureEnabled:fe}=V(A.isDebitCardFeatureEnabled),{isFeatureEnabled:ye}=V(A.isAutoTransferRuleEnabled),{isFeatureEnabled:ge}=V(A.isTreasuryCommentingEnabled),{isFeatureEnabled:he}=V(A.isCashManagementFeatureEnabled),Se=pt(i,{clearParams:c==="Completed"&&g?.fetchState==="Completed"}),xe=Fe(r),Ce=Le(fe,r);if(xe===!0&&Ce!==!0)return e.jsx(ft,{});if(C){const j=g?.fetchState!=="Completed"||d.accountSummaryFetchState.fetchState!=="Completed";return e.jsxs(e.Fragment,{children:[d.accountSummaryFetchState.fetchState==="Completed"&&g?.fetchState==="Completed"&&t===!1&&a===!1?e.jsx($,{analytics:b,onLoad:()=>{}}):null,e.jsx(ct,{onClose:I,anchor:"right",open:a||t,transitionDuration:250,PaperProps:{style:{width:Ct.overlayWidth.valuePercentage(s),boxShadow:"none"}},slotProps:{backdrop:{style:{backgroundColor:f.colors.black,opacity:.75,cursor:"pointer"}}},children:e.jsxs(jt,{onClick:Te=>Te.stopPropagation(),children:[t===!0?e.jsx(St,{isFirstTransfer:d.transactions.length===0||h===0}):null,a===!0?e.jsx(gt,{}):null]})}),e.jsxs(xt,{windowSize:s,children:[e.jsx(ce,{isAppContentDrawerOpen:le,handleDrawerToggle:W}),e.jsx(Tt,{treasuryDetailsView:d,isAutoTransferRuleEnabled:ye,navigate:o,currentTenant:r,location:n,companyId:i,analytics:b,cashManagementBannerProps:me,isCashManagementFeatureEnabled:he,isTreasuryCommentingEnabled:ge,handleDrawerToggle:W,initialOpenThreadRequest:Se,isLoading:j,isAiCfoAccessEnabled:de,onAskAiCfoClick:pe})]})]})}return w&&x?e.jsx(L,{to:"../setup"}):r.companyTreasuryInfo?.info&&!w&&F?e.jsx(L,{to:"../promo",state:n.state}):e.jsx(tt,{fetchState:"In-Progress",style:{backgroundColor:f.colors.grey5}})}const wt=t=>`/${t}/treasury/edit-portfolio`,It=t=>`/${t}/treasury/statements`,kt=t=>`/${t}/treasury/tax-letter`,bt=t=>`/${t}/treasury/setup`,jt=M(lt)`
10
- display: flex;
11
- min-height: 100%;
12
- flex-direction: column;
13
- `,Et=M.div`
14
- display: flex;
15
- height: 100vh;
16
- width: 100%;
17
- flex: 1 1 auto;
18
- flex-direction: column;
19
- align-items: center;
20
- background-color: ${t=>t.theme.colors.grey4};
21
- `;function At(){const t=U(),a=P(),n=H(),o=B(),m=`${K.bankingMicroServiceBaseUrl}/1.0/treasury-account`,[s,f]=p.useState(!1),r=y(c=>Be(c));p.useEffect(()=>{s||r.fetchState!=="Not-Started"||(f(!0),a(Pe(!1)))},[s,r.fetchState,a]);const l=E.getSignedInUser(),i=y(c=>D(c)),u={userId:l?.userId??"",sessionId:l?.zeniSessionId??"",tenantId:i.tenantId??""},T=i.company?.companyInfo.companyLegalName??i.companyName;if(l==null)throw Error("Can't access statements page without signing in...");const d=r.fetchState!=="Completed";return e.jsx(Et,{windowSize:n,children:e.jsx(st,{currentTenantCompanyName:T,statementListView:r,isLoading:d,onBackClick:()=>{const c=J(o.state?.pathnameStackToGoBack),h=c.poppedPathname??"..";t(h,{state:{pathnameStackToGoBack:c.newStack}})},authParams:u,downloadEndPoint:m})})}const vt=M.div`
22
- display: flex;
23
- height: 100vh;
24
- width: 100%;
25
- flex: 1 1 auto;
26
- flex-direction: column;
27
- align-items: center;
28
- background-color: ${t=>t.theme.colors.grey4};
29
- `;function Dt(){const t=U(),a=H(),n=B(),o=P(),m=`${K.bankingMicroServiceBaseUrl}/1.0/treasury-account`,[s,f]=p.useState(!1),r=y(c=>Re(c));p.useEffect(()=>{s||r.fetchState!=="Not-Started"||(f(!0),o(Me(!1)))},[s,r.fetchState,o]);const l=E.getSignedInUser(),i=y(c=>D(c)),u={userId:l?.userId??"",sessionId:l?.zeniSessionId??"",tenantId:i.tenantId??""},T=i.company?.companyInfo.companyLegalName??i.companyName;if(l==null)throw Error("Can't access tax letter page without signing in...");const d=r.fetchState!=="Completed";return e.jsx(vt,{windowSize:a,children:e.jsx(rt,{currentTenantCompanyName:T,taxLetterListView:r,isLoading:d,onBackClick:()=>{const c=J(n.state?.pathnameStackToGoBack),h=c.poppedPathname??"..";t(h,{state:{pathnameStackToGoBack:c.newStack}})},authParams:u,downloadEndPoint:m})})}const Ft=N(function(t,a){const{companyId:n}=a,o=R(t,n);return{treasurySetupView:o,isSetupComplete:o.companyTreasuryInfo?.businessVerificationStatus?.code==="verified",videoUrl:"https://www.youtube.com/watch?v=sqvJWKCMZgk",meetingUrl:"https://meetings.hubspot.com/yoshi-araki/treasury-product-schedule-demo-link?embed=true"}},function(t,a){const{navigate:n,companyId:o}=a;return{onSetupButtonClick:()=>{t(Ve(o))},onBackClick:()=>{n("../..",{relative:"path"})},onTreasurySetupSuccess:m=>{n(m?"..":"../setup",{relative:"path"})}}})(ot),Lt=()=>{const t=U(),a=B(),n=P(),{tenantEmailDomain:o}=O(),[m,s]=p.useState(!1),f=y(S=>D(S)),[r,l]=p.useState(!1),i=y(S=>S.treasurySetupViewState.treasuryFundsDetails?.fetchStatus);p.useEffect(()=>{r||i?.fetchState!=="Not-Started"||u==null||(l(!0),n(q()))},[i,n]);const u=E.getSignedInUserTenant(o)?.companyId??f.companyId,T=E.getSignedInUser(),d=!!f.companyTreasuryInfo?.info?.isTreasuryTOSAccepted,c=S=>{s(S)};if(T==null)throw Error("Can't access treasury promo page without signing in...");const h=_(),g=G(h?.loggedInUserRoleMap),C=Z(h?.loggedInUserRoleMap);if(d&&g)return e.jsx(L,{to:"../../treasury/setup"});if(f.company?.companyTreasuryInfo&&(!d&&g||C)){if(a.state?.message==="activation"){const S=J(a.state?.pathnameStackToGoBack);t(a.pathname,{state:{...a.state,message:void 0,pathnameStackToGoBack:S.newStack}})}return i?.fetchState!=="Completed"?e.jsx(te,{children:e.jsx(X,{size:"ExtraLarge",start:!0})}):e.jsxs(e.Fragment,{children:[e.jsx($,{analytics:b,onLoad:S=>(w=>w.trackTreasuryPromoView("Treasury Promo Page"))(S)}),e.jsx(ce,{isAppContentDrawerOpen:m,handleDrawerToggle:c}),e.jsx(Ft,{analytics:b,navigate:t,companyId:u,onClickMenuIcon:()=>{c(!0)}})]})}return e.jsx(te,{children:e.jsx(X,{size:"ExtraLarge",start:!0})})},te=M.div`
30
- display: flex;
31
- width: 100%;
32
- height: 100%;
33
- flex-direction: row;
34
- justify-content: center;
35
- align-items: center;
36
- background-color: ${t=>t.theme.colors.grey5};
37
- `;function sa(){const t=B(),a=y(v=>D(v)),{useFeatureGate:n}=ie(),{isFeatureEnabled:o}=n(A.isTreasuryEnabled),m=!!a.company?.companyTreasuryInfo?.isTreasuryTOSAccepted,s=_(),f=Z(s?.loggedInUserRoleMap),r=a?.userRole!=null&&Oe(a?.userRole),l=(a?.company==null||a.company.featuresActivationInfo?.isBillPayFeatureEnabled&&!r)&&Ne(s?.loggedInUserRoleMap),i=Ge(s?.loggedInUserRoleMap),u=(a?.company==null||a.company.featuresActivationInfo?.isReimbursementFeatureEnabled&&!r)&&_e(s?.loggedInUserRoleMap),{isFeatureEnabled:T}=n(A.isDepositAccountsFeatureEnabled),d=T&&!r&&$e(s?.loggedInUserRoleMap),c=a.company!=null&&ze(a.company),h=o&&c===!0&&!r&&G(s?.loggedInUserRoleMap),{isFeatureEnabled:g}=n(A.isChargeCardFeatureEnabled),{isFeatureEnabled:C}=n(A.isDebitCardFeatureEnabled),S=it(a,g,C)&&!r&&Qe(s?.loggedInUserRoleMap),w=qe(s?.loggedInUserRoleMap),x=Ze(s?.loggedInUserRoleMap),F=a.companyTreasuryInfo?.info?.businessVerificationStatus?.code==="verified";return e.jsxs(we,{children:[x?null:e.jsx(k,{path:"setup",element:e.jsx(Y,{isBillPayAdminLevelAccess:l,isReimbursementAdminLevelAccess:u,isZeniAccountAdminLevelAccess:d,isChargeCardAdminLevelAccess:S,isTreasuryAdminLevelAccess:h,isUserHasOnlyCardAccess:w,isUserHasOnlyBillPayAccess:i,productType:"zeni_treasury",type:"setup"})}),x?null:e.jsx(k,{path:"verification",element:e.jsx(Y,{isBillPayAdminLevelAccess:l,isUserHasOnlyBillPayAccess:i,isReimbursementAdminLevelAccess:u,isZeniAccountAdminLevelAccess:d,isChargeCardAdminLevelAccess:S,isTreasuryAdminLevelAccess:h,isUserHasOnlyCardAccess:w,productType:"zeni_treasury",type:"verification"})}),e.jsx(k,{path:"promo",element:e.jsx(Lt,{})}),e.jsx(k,{path:"statements",element:e.jsx(At,{})}),e.jsx(k,{path:"tax-letter",element:e.jsx(Dt,{})}),F?e.jsxs(e.Fragment,{children:[e.jsx(k,{path:"/",element:e.jsx(z,{isTransferDrawerOpen:!1,isEditPortfolioDrawerOpen:!1})}),h?e.jsxs(e.Fragment,{children:[e.jsx(k,{path:"edit-portfolio",element:e.jsx(z,{isEditPortfolioDrawerOpen:!0,isTransferDrawerOpen:!1})}),e.jsx(k,{path:"transfer",element:e.jsx(z,{isTransferDrawerOpen:!0,isEditPortfolioDrawerOpen:!1})})]}):null,e.jsx(k,{path:"*",element:e.jsx(ut,{})})]}):m&&h?e.jsx(k,{path:"*",element:e.jsx(L,{to:"../setup"})}):a.company?.companyZeniAccountInfo&&f?e.jsx(k,{path:"*",element:e.jsx(L,{to:"../promo",state:t.state})}):e.jsx(k,{path:"*",element:null})]})}export{sa as default};
@@ -1,112 +0,0 @@
1
- import{j as l}from"./liveblocks-C5Zo4IsV.js";import{a as g}from"./sentry-pTjqe1GE.js";import{h as J,g as K,i as O,j as S,n as G,u as z,o as at,p as N,N as $}from"./core-CDuxXgNT.js";import{eX as L,N5 as Ee,N6 as Re,gx as X,cv as be,cw as Ie,x1 as St,N7 as nt,x5 as zt,L4 as ee,ky as te,w$ as Kt,wV as qt,N8 as Ue,wN as Ht,wM as Qt,wG as Wt,wS as Zt,x6 as Xt,N9 as he,Na as Me,wO as ea,Nb as pe,fJ as ft,xl as gt,xe as vt,Nc as xt,pI as Tt,x9 as yt,x7 as Dt,Nd as Ct,xs as Et,xp as bt,xa as It,xr as Je,Jv as wt,Ne as ta,Nf as aa,cy as na,Ng as sa,Nh as oa,Ni as me,Nj as ie,Nk as we,L5 as Ge,xH as ye,L3 as De,xu as kt,x2 as $e,Nl as la,L6 as H,Nm as Ye,wY as ia,Nn as ca,No as da,Np as ze,Nq as Ke,Nr as qe,Ns as He,xB as ke,Nt as At,xi as Ft,Nu as ra,Nv as ua,Nw as ha,Nx as pa,Ny as ma,Nz as Sa,NA as fa,NB as ga,uo as va,up as xa,Kb as Fe,NC as Ta,ND as ya,jX as je,bo as Da,NE as Ca,NF as Ea,lw as ba,lF as Ia,Ka as Pe,bE as st,NG as jt,JN as Pt,NH as wa,NI as ka,NJ as Aa,lH as Fa,NK as ot,NL as lt,NM as it,NN as ct,NO as ja,lD as Pa,NP as _a,lG as Va,NQ as La,NR as _t,Kw as Vt,kW as Na,NS as Ba,NT as _e,NU as Lt,Ku as Nt,zZ as Oa,NV as Ra,NW as Ua,le as Bt,NX as Ma,NY as Ja,KI as Ga,rY as $a,NZ as Ot,N_ as dt,KF as Ve,N$ as rt,O0 as Ya,KK as za,O1 as Ka,O2 as qa,O3 as Ha,O4 as Qa,O5 as Wa,r$ as Za,O6 as Xa,L7 as en,O7 as tn,Kn as Le,hI as an,O8 as nn,O9 as sn,hG as on,Oa as ln,Ob as cn,A1 as dn,Oc as rn,Od as un,Oe as hn,Of as pn,k_ as mn,bn as Sn,fE as fn,fC as gn}from"./zeni-epic-state-aFTbMOAR.js";import{z as R,aq as Ne,y as Rt,J as W,f as F,a3 as Z,aA as vn,v as M,a as Ce,A as ce,aB as Qe,aC as xn,aD as Tn,s as We,aE as yn,m as Dn,Z as de,D as Ze,Q as ae,e as Y,aF as Cn,n as Xe,$ as Se,aG as En,aH as Ut,Y as bn,aI as In,I as wn,aJ as kn,at as Mt,aK as An,o as Q,S as Fn,H as Jt,K as jn,aL as Pn,aM as _n,h as et,aN as Vn,aO as Ln,r as Nn,aP as Bn,aQ as On}from"./index-DzOogTqR.js";import{n as U,D as Rn,S as Gt}from"./mui-BWYOl-fu.js";import{t as Un,A as Mn}from"./AddressScreen-Cy07AeqE.js";import le from"./NotFoundScreen-B_nzx2PP.js";import{F as Jn}from"./FeaturePreviewScreen-dZphyDK8.js";import{c as q,v as tt,d as Gn}from"./routePaths-rmRxk_gU.js";import{p as $t}from"./pathToGoBack-YzaQ63IA.js";import{u as fe}from"./useAskAiCfoHostNavButtonProps-DVKlzRut.js";import{M as ge}from"./MobileAppDrawer-BWG5ZoNF.js";import{D as $n}from"./DrawerScreen-BkNTuZZn.js";import{g as Yn,m as zn}from"./accountMappingHelper-D5Bw0mp6.js";import"./recharts-DOA55GXl.js";import"./analytics-CpUJgE1w.js";import"./plaid-2PJJQmCk.js";import"./dnd-VtUMJCWH.js";import"./stripe-DMRn4zHo.js";import"./lottie-B-fnnIRm.js";import"./lexical-CIqawAn4.js";import"./pdf-WEHP-u0u.js";import"./utils-C-pFPw5l.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]="98782d01-9967-40e9-9dc2-d1ddb551ff3a",e._sentryDebugIdIdentifier="sentry-dbid-98782d01-9967-40e9-9dc2-d1ddb551ff3a")}catch{}})();const Kn=Ce.getLocalizedStrings(),qn=G(function(e,a){const s=Re(e,a.scheduleTab),t=e.tenantState.currentTenantId;return{authParams:{userId:a.signedInUser.userId??"",sessionId:a.signedInUser.zeniSessionId??"",tenantId:t??""},linkBillExpenseView:s.linkBillExpenseView,transactions:s.linkBillExpenseView.transactions}},function(e,a){const{navigate:s,location:t}=a;return{onTransactionSelect(n){e(nt({selectedTransaction:n}))},onBackClick:()=>{s("..",{relative:"path"})},onCancel(){e(nt({selectedTransaction:void 0})),e(zt()),s("..",{relative:"path"})},onTransactionClick:n=>{const o=`${q(n,a.tenantEmailDomain)}`,c=M(t.state?.pathnameStackToGoBack,t.pathname);s(o,{state:{pathnameStackToGoBack:c}})},onLinkSave(){a.setShouldNavigateBack(!1),e(St(a.scheduleTab,a.scheduleAccruedDetailsView.selectedJEAccruedSchedule?.jeScheduleId))}}})(vn),Hn=({setShouldNavigateBack:e})=>{const a=J(),s=K(),{scheduleDetailId:t,tenantEmailDomain:n}=O(),{scheduleType:o}=O();if(n==null)throw Error("Can't access Link Bill Expense page without tenant Email Domain");const c=S(f=>L(f)),r=Ee(o)??"accrued_expenses",h=R.getSignedInUser();if(h==null)throw Error("Can't access Link Bill Expensedetail page without signing in...");if(t==null)throw Error("Invalid Schedule Detail Id");const i=S(f=>Re(f,r)),m=i.selectedJELinkRowIndex,d=S(f=>X(f,c.companyId)),u=Ne(i.updateStatus.fetchState);g.useEffect(()=>{u==="In-Progress"&&i.updateStatus.fetchState==="Completed"&&a("..",{relative:"path"})},[u,i.updateStatus.fetchState]),g.useEffect(()=>{i.fetchState==="Not-Started"&&a("..",{relative:"path"})},[]),g.useEffect(()=>{i.selectedJEAccruedSchedule!=null&&i.selectedJELinkRowIndex!=null||a("..",{relative:"path"})},[i.selectedJEAccruedSchedule,i.selectedJELinkRowIndex]);const p=i.linkBillExpenseView.fetchState==="Completed";return l.jsx(l.Fragment,{children:i.linkBillExpenseView.fetchState==="In-Progress"?l.jsx(Rt,{fetchState:i.linkBillExpenseView.fetchState}):i.selectedJEAccruedSchedule!=null&&m!=null?l.jsxs(l.Fragment,{children:[p===!0?l.jsx(W,{analytics:F,onLoad:()=>{Qn(i,r,d)}}):null,l.jsx(qn,{signedInUser:h,attachmentEndPoint:`${Z}/vendor_attachments`,setShouldNavigateBack:e,scheduleVendorId:i.selectedJEAccruedSchedule.vendor.id??"",location:s,tenantEmailDomain:n,scheduleAccruedDetailsView:i,saveFetchState:i.updateStatus.fetchState,scheduleTab:r,navigate:a,analytics:F,controllerUserDetails:d,saveStatus:i.updateStatus.fetchState,jeAccruedSchedule:i.selectedJEAccruedSchedule,localData:i.scheduleAccruedDetailsLocalData.jeScheduleDetails[m]})]}):null})},Yt=e=>{const a=Kn.dateFormat.analytics.YYYYDashMMDashDDFormat;return{scheduleCreateDate:e.createTime.format(a)??null,scheduleMonthlyAmount:e.recurringAmount??null,startingBalance:e.otherAttributes.startingBalance??null,scheduleAccountCategory:e.jeCredit.account?.accountName??null,description:e.memo,runningBalance:e.balanceAsOfToday??null,currentBalance:e.balanceAsOfToday??null,currentStatus:e.status.label,period:e.period??null,startMonth:e.startDate?.format(a)??null,endMonth:e.endDate?.format(a)??null}},Qn=(e,a,s)=>{const t=e.selectedJEAccruedSchedule,n=e.selectedJELinkRowIndex;let o;n!=null&&t!=null&&(o=t.scheduledJournalEntry[n]);const{transactions:c}=e.linkBillExpenseView,r=c.some(m=>m.isRecommendedTransaction===!0),h=be(s.controllers),i=Ie(s.controllerUserIds);t!=null&&F.trackScheduleAccruedDetailsJournalEntryLinkedLoaded({scheduleType:a,schedule:{...Yt(t)},scheduleExpenseCategoryAndClass:{expenseCategory:t.jeDebit.account?.accountName??null,expenseClass:t.jeDebit.accountingClass?.className??null},journalEntryDetails:{wasRecommendationAvailable:r,journalEntryPostingStatus:o?.status.label??""},vendorName:t.vendor.name??null,controllerEmails:h,controllerUserIds:i})},Wn=U.div`
2
- display: flex;
3
- min-height: 100%;
4
- width: 100%;
5
- flex: 1 0 auto;
6
- flex-direction: column;
7
- align-items: center;
8
- background-color: ${e=>e.theme.colors.grey4};
9
- `,Zn=G(function(e){const a=L(e),s=e.entityAutoCompleteState.autoCompleteText.common,t=Ue(e,"common");return{tenantName:a.companyName,vendorSearchAutoCompleteData:{autoCompleteText:s,entityAutoCompleteView:t}}},function(e,a){const{navigate:s,location:t}=a,n="accrued_expenses";return{onNavigateBack:()=>{s("../schedules/accrued_expenses")},onZeniLogoClick:()=>{a.themeState.toggle()},onSave:o=>{a.setShouldNavigateBack(!0),e(St(n,o))},onDelete:o=>{e(ea(n,o))},vendorSearchAutoCompleteActions:{onAutoCompleteInputChange:(o,c)=>{o.trim().length>=2?e(Me({searchString:o,entityType:c,searchOrigin:"common"})):o.trim().length===0&&e(he("common"))},onCancelAutoComplete:()=>{e(he("common"))}},onEditAmount:(o,c)=>{e(Xt(n,o,c))},onJELinkClick:o=>{e(Zt({selectedJELinkRowIndex:o})),s("./edit_link")},onCancelAccrual:(o,c,r)=>{e(Wt(o,c,r))},onTransactionClick:o=>{const c=`${q(o,a.tenantEmailDomain)}`,r=M(t.state?.pathnameStackToGoBack,t.pathname);s(c,{state:{pathnameStackToGoBack:r}})},onViewPostedJE:o=>{const c=`${q(o,a.tenantEmailDomain)}`,r=M(t.state?.pathnameStackToGoBack,t.pathname);s(c,{state:{pathnameStackToGoBack:r}})},onViewRecordedJE:o=>{const c=`${q(o,a.tenantEmailDomain)}`,r=M(t.state?.pathnameStackToGoBack,t.pathname);s(c,{state:{pathnameStackToGoBack:r}})},onViewBillExpense:o=>{const c=`${q(o,a.tenantEmailDomain)}`,r=M(t.state?.pathnameStackToGoBack,t.pathname);s(c,{state:{pathnameStackToGoBack:r}})},onDetailPageChange:(o,c,r)=>{const{scheduleDetailsAccruedExpensesSection:h}=o,{amount:i,memo:m,months:d,scheduleAccruedExpenseCategory:u,scheduleClass:p,scheduleExpenseCategory:f,startDate:D,vendor:x}=h,b=p.selectedOption!=null?a.classList.find(I=>I.classId===p.selectedOption):void 0,C=f.selectedOption!=null?a.accountList.find(I=>I.qboId===f.selectedOption):void 0,E=u.selectedOption!=null?a.accruedAccountList.find(I=>I.qboId===u.selectedOption):void 0,k=d?.selectedOption;e(Ht({scheduleType:n,localData:c,selectedJeScheduleDetailId:a.scheduleDetailId})),r!==!1||a.scheduleDetailId!=null||C?.accountId==null||a.isAccountingClassesEnabled!==!1&&b?.classId==null||E==null||x.selectedOption==null||m==null||i==null&&i==0||D==null||k==null||e(Qt({scheduleType:n}))}}})(xn),Xn=({shouldNavigateBack:e,setShouldNavigateBack:a})=>{const s=J(),t=K(),n=z(),o=ce(),{tenantEmailDomain:c}=O(),[r,h]=g.useState(!1);if(c==null)throw new Error("Can't access this page without a tenantEmailDomain");const{scheduleDetailId:i}=O();let m;i!=="new"&&(m=i);const d=es(i),u=S(y=>y.scheduleAccruedDetailState.selectedJEAccruedScheduleKey),p="accrued_expenses",f=S(y=>Re(y,"accrued_expenses")),D=S(y=>ee(y)),x=S(y=>y.classListState.fetchState),b=S(y=>te(y)),C=D!=="Completed"||x!=="Completed";g.useEffect(()=>{r===!1&&C?(n(Kt(p,m)),h(!0)):C===!1&&r===!1&&i!=="new"&&(n(qt(p,i)),h(!0))},[r]);const E=S(y=>L(y)),k=S(y=>X(y,E.companyId)),I=f.fetchState,w=f.allAccountList,_=f.allClassList,j=f.allAccruedAccountList,V=f.scheduleAccruedDetailsLocalData;if(d!==!0||f.fetchState==="Error")return l.jsx(le,{});const A=I==="Completed"&&r===!0;return I!=="Completed"&&I!=="Not-Started"?l.jsx(Qe,{}):l.jsxs(Wn,{children:[A===!0?l.jsx(W,{analytics:F,onLoad:()=>{ts(f,p,k)}}):null,l.jsx(Zn,{setShouldNavigateBack:a,scheduleAccruedDetailsView:f,location:t,navigate:s,classList:_,accountList:w,shouldNavigateBack:e,accruedAccountList:j,scheduleLocalData:V,selectedJEScheduleKey:u,scheduleDetailId:m,selectedScheduledJournalEntries:f.selectedJEAccruedSchedule?.scheduledJournalEntry??[],themeState:o,tenantEmailDomain:c,analytics:F,controllerUserDetails:k,isAccountingClassesEnabled:b,status:f.selectedJEAccruedSchedule?.status.code})]})},es=e=>e!=null,ts=(e,a,s)=>{const t=e.selectedJEAccruedSchedule,n=be(s.controllers),o=Ie(s.controllerUserIds);t!=null&&F.trackScheduleAccruedDetailsLoaded({scheduleType:a,scheduleExpenseCategoryAndClass:{expenseCategory:t.jeDebit.account?.accountName??null,expenseClass:t.jeDebit.accountingClass?.className??null},schedule:{...Yt(t)},vendorName:t.vendor.name??null,controllerEmails:n,controllerUserIds:o})},as=U.div`
10
- display: flex;
11
- min-height: 100%;
12
- width: 100%;
13
- flex: 1 0 auto;
14
- flex-direction: column;
15
- align-items: center;
16
- background-color: ${e=>e.theme.colors.grey4};
17
- `,Be=Ce.getLocalizedStrings().dateFormat.analytics.YYYYDashMMDashDDFormat,ns=G(function(e){const a=L(e),s=pe(e,"fixed_assets");return{tenantName:a.companyName,scheduleDetailsView:s}},function(e,a){const{navigate:s,location:t,vendorSearchAutoCompleteData:n,selectedScheduledJournalEntries:o}=a,c="fixed_assets",r=t.state?.message==="expenseAutomation",h=o.flatMap(i=>i.error).filter(i=>!!i)??[];return{onNavigateBack:()=>{if(r===!0){const i=We(a.location.state?.pathnameStackToGoBack),m=i.poppedPathname??$t(2);a.navigate(m,{state:{pathnameStackToGoBack:i.newStack}})}else s("../schedules/fixed_assets")},onZeniLogoClick:()=>{a.themeState.toggle()},onSave:i=>{e(Je(c,i,h.length>0))},onDelete:i=>{e(It(c,i))},onMarkAsComplete:()=>{a.selectedJEScheduleKey!=null&&e(bt(c,a.selectedJEScheduleKey))},onEditAmount:(i,m)=>{e(Et(c,i,m))},onJELinkClick:i=>{e(Ct({selectedJELinkRowIndex:i})),s("./edit_link")},onTransactionClick:i=>{const m=`${q(i,a.tenantEmailDomain)}`,d=M(t.state?.pathnameStackToGoBack,t.pathname);s(m,{state:{pathnameStackToGoBack:d,message:"comingFromScheduleDetailsFixedAssets"}})},onViewLinkedJE:i=>{const m=`${q(i,a.tenantEmailDomain)}`,d=M(t.state?.pathnameStackToGoBack,t.pathname);s(m,{state:{pathnameStackToGoBack:d}})},vendorSearchAutoCompleteActions:{onAutoCompleteInputChange:(i,m)=>{i.trim().length>=2?e(Me({searchString:i,entityType:m,searchOrigin:"common"})):i.trim().length===0&&e(he("common"))},onCancelAutoComplete:()=>{e(he("common"))}},onDetailPageChange:(i,m)=>{const{scheduleDetailsFixedAssetsSection:d,scheduleDetailsListSection:u}=i,{scheduleClass:p,scheduleExpenseCategory:f,accumulatedDepreciationCategory:D,assetId:x,months:b,startDate:C,postingDate:E,vendor:k}=d,I=n.entityAutoCompleteView.vendor.length>0?n.entityAutoCompleteView.vendor.find(v=>v.id===k?.selectedOption):void 0,w={id:I?.zeniId??k?.selectedOption??"",name:I?.name??k?.defaultOptions.find(v=>v.value===k?.selectedOption)?.label??"",logo:I?.logo},_=p.selectedOption!=null?a.classList.find(v=>v.classId===p.selectedOption):void 0,j=f.selectedOption!=null?a.accountList.find(v=>v.qboId===f.selectedOption):void 0,V=D.selectedOption!=null?a.depAccountList.find(v=>v.qboId===D.selectedOption):void 0,A=b?.selectedOption,y=u.map((v,re)=>({...a.scheduleLocalData.jeScheduleDetails[re],amount:{...a.scheduleLocalData.jeScheduleDetails[re].amount,amount:v.amount}})),P=E.type==="day"?E.dayOfMonth?E.dayOfMonth:1:void 0,T=E.type==="lastDayOfMonth"||void 0;e(yt({scheduleType:c,localData:{selectedAccount:j?.accountId,selectedClass:_?.classId,selectedAccumulatedDepreciationCategory:V?.accountId,selectedDate:C,selectedMonths:A,assetId:x,jeScheduleDetails:y,lastDayOfMonth:T,selectedDayOfMonth:P,selectedVendor:w},selectedJeScheduleDetailId:a.scheduleDetailId})),m!==!1||V?.accountId==null||a.scheduleDetailId!=null&&a.status!=="draft"&&a.status!=="marked_as_completed"||j?.accountId==null||a.isAccountingClassesEnabled!==!1&&_?.classId==null||C==null||A==null||T!==!0&&P==null||e(Dt({scheduleType:c}))}}})(Tn),ss=()=>{const e=J(),a=K(),s=z(),t=ce(),{tenantEmailDomain:n}=O(),[o,c]=g.useState(!1),{scheduleDetailId:r}=O(),h=a.state?.message==="expenseAutomation",i=os(r),m=S(T=>T.scheduleDetailState.selectedJEScheduleKey);g.useEffect(()=>{m!=null&&m.length!==0||r!=="new"||e("../schedules/fixed_assets")},[m,r]);const d="fixed_assets",u=S(T=>pe(T,d)),p=S(T=>T.entityAutoCompleteState.autoCompleteText.common),f=S(T=>Ue(T,"common")),D=S(T=>ee(T)),x=S(T=>T.classListState.fetchState),b=S(T=>te(T)),C=S(T=>ft(T).selectedPeriod),E=D!=="Completed"||x!=="Completed";g.useEffect(()=>{o===!1&&E?(s(gt(d,y,!0)),c(!0)):E===!1&&o===!1&&(s(vt(d,r==="new"?void 0:r,!0)),c(!0))},[o]),g.useEffect(()=>{if(u.markAsCompleteStatus.fetchState==="Completed")if(s(xt()),h===!0){const{month:T,year:v}=C;e(`../../month_end_close_checks/review/je_schedules/${T}-${v}`)}else e("../schedules/fixed_assets")},[u.markAsCompleteStatus.fetchState]);const k=S(T=>L(T)),I=S(T=>X(T,k.companyId)),w=u.fetchState,_=u.allAccountList,j=u.allClassList,V=u.allDepreciationAccountList,A=u.scheduleDetailsLocalData.fixed_assets;let y;if(r!=="new"&&(y=r),i!==!0||u.fetchState==="Error")return l.jsx(le,{});const P=w==="Completed"&&o===!0;return w!=="Completed"?l.jsx(Qe,{}):l.jsxs(as,{children:[P===!0?l.jsx(W,{analytics:F,onLoad:()=>{is(u,d,I)}}):null,l.jsx(ns,{location:a,navigate:e,classList:j,vendorSearchEntityAutoCompleteView:f,vendorSearchAutoCompleteData:{autoCompleteText:p,entityAutoCompleteView:f},expenseAutomationSelectedPeriod:C,usedInExpenseAutomation:h,removeJeScheduleTransactionKey:(T,v)=>{s(Tt(T,v))},accountList:_,depAccountList:V,scheduleLocalData:A,selectedJEScheduleKey:m,scheduleDetailId:y,selectedScheduledJournalEntries:u.selectedJEScheduleTransaction?.scheduledJournalEntry??[],themeState:t,tenantEmailDomain:n,analytics:F,controllerUserDetails:I,isAccountingClassesEnabled:b,status:u.selectedJEScheduleTransaction?.status.code})]})},os=e=>e!=null,ls=e=>({transactionDate:e.date.format(Be),transactionAmount:e.amount,scheduleCategory:e.account.accountName,scheduleClass:e.classBase?.className??null,description:e.memo}),is=(e,a,s)=>{const t=e.selectedJEScheduleTransaction?.baseTransaction,n=e.selectedJEScheduleTransaction,o=be(s.controllers),c=Ie(s.controllerUserIds);var r;t!=null&&n!=null&&F.trackScheduleDetailsLoaded({scheduleType:a,transaction:{...ls(t)},scheduleExpenseCategoryAndClass:{expenseCategory:n.jeDebit.account?.accountName??null,expenseClass:n.jeDebit.accountingClass?.className??null},scheduledTransaction:{...(r=n,{currentBalance:r.balanceAsOfToday??null,currentStatus:r.status.label,period:r.period??null,startMonth:r.startDate?.format(Be)??null,endMonth:r.endDate?.format(Be)??null})},vendorName:n.vendor.name??null,fixedAssetsDetails:{accumulatedDepreciationCategory:n.jeCredit.account?.accountName??null,assetId:n.otherAttributes.assetId??null},controllerEmails:o,controllerUserIds:c})},cs=U.div`
18
- display: flex;
19
- min-height: 100%;
20
- width: 100%;
21
- flex: 1 0 auto;
22
- flex-direction: column;
23
- align-items: center;
24
- background-color: ${e=>e.theme.colors.grey4};
25
- `,Oe=Ce.getLocalizedStrings().dateFormat.analytics.YYYYDashMMDashDDFormat,ds=G(function(e,a){const s=L(e),t=pe(e,a.scheduleTab);return{tenantName:s.companyName,scheduleDetailsView:t}},function(e,a){const{navigate:s,location:t,usedInExpenseAutomation:n,vendorSearchAutoCompleteData:o,selectedScheduledJournalEntries:c}=a,r=c.flatMap(h=>h.error).filter(h=>!!h)??[];return{onNavigateBack:()=>{if(n===!0){const h=We(a.location.state?.pathnameStackToGoBack),i=h.poppedPathname??$t(2);a.navigate(i,{state:{pathnameStackToGoBack:h.newStack}})}else s("../schedules/prepaid_expenses")},onZeniLogoClick:()=>{a.themeState.toggle()},onSave:h=>{e(Je(a.scheduleTab,h,r.length>0))},onDelete:h=>{e(It(a.scheduleTab,h))},onMarkAsComplete:()=>{a.selectedJEScheduleKey!=null&&e(bt(a.scheduleTab,a.selectedJEScheduleKey))},onEditAmount:(h,i)=>{e(Et(a.scheduleTab,h,i))},onJELinkClick:h=>{e(Ct({selectedJELinkRowIndex:h})),s("./edit_link")},onTransactionClick:h=>{const i=`${q(h,a.tenantEmailDomain)}`,m=M(t.state?.pathnameStackToGoBack,t.pathname);s(i,{state:{pathnameStackToGoBack:m,message:"comingFromScheduleDetails"}})},onViewLinkedJE:h=>{const i=`${q(h,a.tenantEmailDomain)}`,m=M(t.state?.pathnameStackToGoBack,t.pathname);s(i,{state:{pathnameStackToGoBack:m}})},vendorSearchAutoCompleteActions:{onAutoCompleteInputChange:(h,i)=>{h.trim().length>=2?e(Me({searchString:h,entityType:i,searchOrigin:"common"})):h.trim().length===0&&e(he("common"))},onCancelAutoComplete:()=>{e(he("common"))}},onDetailPageChange:(h,i)=>{const{scheduleDetailsSection:m,scheduleDetailsListSection:d}=h,{scheduleClass:u,scheduleExpenseCategory:p,months:f,startDate:D,postingDate:x,vendor:b}=m,C=o.entityAutoCompleteView.vendor.length>0?o.entityAutoCompleteView.vendor.find(y=>y.id===b?.selectedOption):void 0,E={id:C?.zeniId??b?.selectedOption??"",name:C?.name??b?.defaultOptions.find(y=>y.value===b?.selectedOption)?.label??"",logo:C?.logo},k=u.selectedOption!=null?a.classList.find(y=>y.classId===u.selectedOption):void 0,I=p.selectedOption!=null?a.accountList.find(y=>y.qboId===p.selectedOption):void 0,w=f?.selectedOption,_=d.map((y,P)=>({...a.scheduleLocalData.jeScheduleDetails[P],amount:{...a.scheduleLocalData.jeScheduleDetails[P].amount,amount:y.amount}})),j=x.type==="day"?x.dayOfMonth?x.dayOfMonth:1:void 0,V=x.type==="lastDayOfMonth"||void 0,A={selectedAccount:I?.accountId,selectedClass:k?.classId,selectedDate:D,selectedMonths:w,jeScheduleDetails:_,lastDayOfMonth:V,selectedVendor:E,selectedDayOfMonth:j};e(yt({scheduleType:a.scheduleTab,localData:A,selectedJeScheduleDetailId:a.scheduleDetailId})),i!==!1||a.scheduleDetailId!=null&&a.status!=="draft"&&a.status!=="marked_as_completed"||I?.accountId==null||a.isAccountingClassesEnabled!==!1&&k?.classId==null||D==null||w==null||V!==!0&&j==null||e(Dt({scheduleType:a.scheduleTab}))}}})(yn),rs=()=>{const e=J(),a=K(),s=z(),t=ce(),{tenantEmailDomain:n}=O(),[o,c]=g.useState(!1),r=a.state?.message==="expenseAutomation",{scheduleType:h,scheduleDetailId:i}=O(),m=us(h,i),d=S(T=>T.scheduleDetailState.selectedJEScheduleKey);g.useEffect(()=>{d!=null&&d.length!==0||i!=="new"||e("../schedules/prepaid_expenses")},[d,i]);const u=Ee(h)??"prepaid_expenses",p=S(T=>pe(T,u)),f=S(T=>T.entityAutoCompleteState.autoCompleteText.common),D=S(T=>Ue(T,"common")),x=S(T=>ee(T)),b=S(T=>T.classListState.fetchState),C=S(T=>te(T)),E=S(T=>ft(T).selectedPeriod),k=x!=="Completed"||b!=="Completed";g.useEffect(()=>{o===!1&&k?(s(gt(u,y,!0)),c(!0)):k===!1&&o===!1&&(s(vt(u,i==="new"?void 0:i,!0)),c(!0))},[o]),g.useEffect(()=>{if(p.markAsCompleteStatus.fetchState==="Completed")if(s(xt()),r===!0){const{month:T,year:v}=E;e(`../../month_end_close_checks/review/je_schedules/${T}-${v}`)}else e("../schedules/prepaid_expenses")},[p.markAsCompleteStatus.fetchState]);const I=S(T=>L(T)),w=S(T=>X(T,I.companyId)),_=p.fetchState,j=p.allAccountList,V=p.allClassList,A=p.scheduleDetailsLocalData;let y;if(i!=="new"&&(y=i),m!==!0||p.fetchState==="Error")return l.jsx(le,{});const P=_==="Completed"&&o===!0;return _!=="Completed"?l.jsx(Qe,{}):l.jsxs(cs,{children:[P===!0?l.jsx(W,{analytics:F,onLoad:()=>{ps(p,u,w)}}):null,l.jsx(ds,{location:a,vendorSearchEntityAutoCompleteView:D,vendorSearchAutoCompleteData:{autoCompleteText:f,entityAutoCompleteView:D},usedInExpenseAutomation:r,removeJeScheduleTransactionKey:(T,v)=>{s(Tt(T,v))},expenseAutomationSelectedPeriod:E,navigate:e,classList:V,accountList:j,scheduleLocalData:A[u],selectedJEScheduleKey:d,scheduleDetailId:y,selectedScheduledJournalEntries:p.selectedJEScheduleTransaction?.scheduledJournalEntry??[],themeState:t,tenantEmailDomain:n,scheduleTab:u,analytics:F,controllerUserDetails:w,isAccountingClassesEnabled:C,status:p.selectedJEScheduleTransaction?.status.code})]})},us=(e,a)=>Ee(e)!=null&&a!=null,hs=e=>({transactionDate:e.date.format(Oe),transactionAmount:e.amount,scheduleCategory:e.account.accountName,scheduleClass:e.classBase?.className??null,description:e.memo}),ps=(e,a,s)=>{const t=e.selectedJEScheduleTransaction?.baseTransaction,n=e.selectedJEScheduleTransaction,o=be(s.controllers),c=Ie(s.controllerUserIds);var r;t!=null&&n!=null&&F.trackScheduleDetailsLoaded({scheduleType:a,transaction:{...hs(t)},scheduleExpenseCategoryAndClass:{expenseCategory:n.jeDebit.account?.accountName??null,expenseClass:n.jeDebit.accountingClass?.className??null},scheduledTransaction:{...(r=n,{currentBalance:r.balanceAsOfToday??null,currentStatus:r.status.label,period:r.period??null,startMonth:r.startDate?.format(Oe)??null,endMonth:r.endDate?.format(Oe)??null})},vendorName:n.vendor.name??null,controllerEmails:o,controllerUserIds:c})},ms={drawerLeftMargin:new Ze(0,0,100,200)},Ss=G(function(e,a){const{jeScheduledTransaction:s,selectedJERow:t,scheduleType:n,isVendorBulkUpdateOnTransactionEnabled:o}=a,{scheduleDetailsLocalData:c,updateStatus:r}=pe(e,a.scheduleType),h=L(e),i=c[n].jeScheduleDetails[t].jeLink,m=i.type==="recommended"?i.recommendedTransactionID:i.transactionDetailID,d=m!=null?aa(e,m):void 0,u=R.getSignedInUser(),p=e.tenantState.currentTenantId,f={userId:u?.userId??"",sessionId:u?.zeniSessionId??"",tenantId:h.tenantId??p},D=h?.company?.companyInfo?.firstMonthOfFY??1;return{jeScheduledTransaction:s,transactionDetail:d,localData:c[n].jeScheduleDetails[t],saveStatus:r.fetchState,authParams:f,isVendorBulkUpdateOnTransactionEnabled:o,firstMonthOfFY:D,isDisabled:r.fetchState==="In-Progress"?"readonly":void 0,analytics:F,qboAppUrl:na(Xe.qboRedirectionUrl)}},function(e,a){const{selectedJERow:s,jeScheduleDetailId:t,navigate:n}=a;return{onUpdateLocalData:o=>{const c=o.linkJETransaction.qboURL;c!=null&&e(oa({scheduleType:a.scheduleType,jeScheduleDetailId:t,rowId:s,jeLink:c}))},onFetchTransactionClick:o=>{e(wt(o))},onSaveClick:()=>{e(Je(a.scheduleType,t))},onBackClick:()=>{n("..",{relative:"path"})},onCancelClick:()=>{const o=a.jeScheduledTransaction.scheduledJournalEntry[s];e(sa({scheduleType:a.scheduleType,jeScheduleDetailId:t,rowId:s,originalScheduledJE:o})),n("..",{relative:"path"})}}})(Cn),fs=()=>{const e=Dn(),a=J(),s=z(),{scheduleDetailId:t}=O(),n=de(),o=ms.drawerLeftMargin.valuePx(n),{scheduleType:c}=O(),{useFeatureGate:r}=ae(),{isFeatureEnabled:h}=r(Y.isVendorBulkUpdateOnTransactionEnabled),i=Ee(c)??"prepaid_expenses",[m,d]=g.useState(!1);if(R.getSignedInUser()==null)throw Error("Can't access Account detail page without signing in...");if(t==null)throw Error("Invalid Schedule Detail Id");const u=S(C=>pe(C,i));g.useEffect(()=>{u.fetchState==="Not-Started"&&a("..",{relative:"path"})},[]);const p=u.selectedJELinkRowIndex,f=p!=null?u.scheduleDetailsLocalData[i].jeScheduleDetails[p]?.jeLink:null,D=f?.type==="recommended"?f.recommendedTransactionID:f?.transactionDetailID;g.useEffect(()=>{D!=null&&s(wt(D))},[]),g.useEffect(()=>{f?.type==="recommended"&&m===!1&&p!=null&&(d(!0),s(ta({scheduleType:i,jeScheduleDetailId:t,rowId:p})))});const x=S(C=>L(C)),b=S(C=>X(C,x.companyId));return l.jsx(Rn,{anchor:"right",open:!0,PaperProps:{style:{width:`calc(100% - ${o})`,boxShadow:"none"}},slotProps:{backdrop:{style:{backgroundColor:e.colors.black,opacity:.75,cursor:"pointer"}}},onClose:()=>a("..",{relative:"path"}),children:l.jsx(gs,{onClick:C=>C.stopPropagation(),children:u.fetchState!=="Completed"||u.selectedJEScheduleTransaction==null||p==null?l.jsx(Rt,{fetchState:u.fetchState}):l.jsx(Ss,{scheduleType:i,jeScheduleDetailId:t,selectedJERow:p,jeScheduledTransaction:u.selectedJEScheduleTransaction,isCOTEnabled:!1,navigate:a,scheduleTab:i,controllerUserDetails:b,isVendorBulkUpdateOnTransactionEnabled:h})})})},gs=U(Gt)`
26
- display: flex;
27
- min-height: 100%;
28
- flex-direction: column;
29
- `,ve=e=>{switch(e){case"vendors_tab":return"../summary";case"filing_1099":return"../filing_1099";case"prepaid_expenses":return"../schedules/prepaid_expenses";case"fixed_assets":return"../schedules/fixed_assets";case"accrued_expenses":return"../schedules/accrued_expenses";default:return"../opex"}},xe=e=>{switch(e){case"prepaid_expenses":return"prepaid_expenses";case"fixed_assets":return"fixed_assets";case"accrued_expenses":return"accrued_expenses";case"operating_expenses_by_vendor":return"operating_expenses";default:return"vendors_list"}},Te=()=>{const e=K(),a=z(),s=S(t=>me(t));return g.useEffect(()=>{const t=e.pathname.split("/").pop();if(t!=null){const n=(o=>{switch(o){case"prepaid_expenses":return"prepaid_expenses";case"fixed_assets":return"fixed_assets";case"accrued_expenses":return"accrued_expenses";case"opex":return"operating_expenses";case"filing_1099":return"filing_1099";default:return"vendors_list"}})(t);n!==s.currentTab&&a(ie(n))}},[e.pathname,s.currentTab,a]),s},ne="accrued_expenses",vs=G(function(e,a){const s=L(e),t=me(e);return{tenantName:s.companyName,vendorTabsToShow:a.vendorTabsToShow,report:a.scheduleListReport,downloadParams:a.downloadParams,companyIncorporationDate:a.companyIncDate,vendorTabView:t,isAccountingClassesEnabled:te(e)}},function(e,a){const{navigate:s}=a;return{onBackClick:()=>{s("../../..")},onVendorTabSelectionChanged:t=>{const n=ve(t);s(n),e(ie(xe(t)))},onSortOrderChanged:(t,n)=>{e(He({scheduleType:ne,sortKey:t,sortOrder:n}))},onChangeSubTab:t=>{e(qe({scheduleType:ne,subTab:t}))},onSearchTextChanged:t=>{e(Ke({scheduleType:ne,searchText:t}))},onReloadReport:()=>{e(kt(ne))},onScroll:t=>{e(ze({scheduleType:ne,scrollYOffset:t}))},onClickNewButton:()=>{e(ca()),e(da()),F.trackScheduleAccruedDetailsNewRequested({scheduleType:"accrued_expenses"}),s("details/new")},onClickSchedule:t=>{e(ia({selectedJEScheduleKey:t}));const n=a.scheduleListReport.jeAccruedSchedules.find(o=>o.jeAccruedScheduleKey===t);s(`details/${n?.jeScheduleId}`)},updateDownloadStateHandler:t=>{e(Ye({scheduleType:ne,fetchState:t}))}}})(En),xs=({vendorTabsToShow:e,previousTabPosition:a,setPreviousTabPosition:s})=>{const[t,n]=g.useState(!1),[o,c]=g.useState(!1),r=J(),h=z(),{useFeatureGate:i}=ae(),m=ce();Te();const{isFeatureEnabled:d,isFeatureGateLoading:u}=i(Y.isOpexByVendorFeatureEnabled),p=R.getSignedInUser(),f=S(v=>L(v)),D={userId:p?.userId??"",sessionId:p?.zeniSessionId??"",tenantId:f.tenantId},x=g.useMemo(()=>({authParams:D,jeScheduleEndPoint:`${Z}/jeScheduleReports`,timezone:we(),companyName:f.companyName}),[]),[b,C]=g.useState(!1),E=S(v=>ee(v)),k=S(v=>Ge(v,"accrued_expenses")),I=e.includes("prepaid_expenses"),w=e.includes("fixed_assets"),_=e.includes("accrued_expenses");g.useEffect(()=>{(I||w||_)&&b===!1&&E!=="Completed"&&(h(ye()),C(!0))},[b]),g.useEffect(()=>{u===!1&&(h(De({shouldFetchAccruedExpenses:_,shouldFetchFixedAssets:!0,shouldFetchPrepaidExpenses:I,shouldFetchOpexByVendor:d,shouldFetchVendorsList:!1,shouldFetchFiling1099Vendor:!1})),n(!0))},[E,w,u,d]),g.useEffect(()=>{t===!1&&k==="Completed"&&h(kt("accrued_expenses",{selectedTimeframe:$e("accrued_expenses"),selectedCategoryId:"all"},!0))},[t,k]);const j=S(v=>la(v,ne)),{isAiCfoAccessEnabled:V,onAskAiCfoClick:A}=fe({mobileExploreReferrer:"Vendors — Accrued Expenses"});Se({isDataReady:j.fetchState==="Completed"});const y=S(v=>H(v).isReportGenerated);S(v=>H(v).fetchState)!=="Completed"||y!==!0||d!==!0||e.includes("operating_expenses_by_vendor")||e.splice(1,0,"operating_expenses_by_vendor"),_||r("../opex");const P=S(v=>X(v,f.companyId)),T=v=>{c(v)};return l.jsxs(l.Fragment,{children:[l.jsx(ge,{isAppContentDrawerOpen:o,handleDrawerToggle:T}),l.jsx(vs,{navigate:r,previousTabPosition:a,setPreviousTabPosition:s,scheduleListReport:j,downloadParams:x,themeState:m,vendorTabsToShow:e,analytics:F,controllerUserDetails:P,isAiCfoAccessEnabled:V,onAskAiCfoClick:A,onClickMenuIcon:()=>T(!0)})]})},se="fixed_assets",Ts=G(function(e,a){const s=L(e),t=me(e);return{tenantName:s.companyName,vendorTabsToShow:a.vendorTabsToShow,report:a.scheduleListReport,downloadParams:a.downloadParams,companyIncorporationDate:a.companyIncDate,controllerUserDetails:a.controllerUserDetails,vendorTabView:t,isAccountingClassesEnabled:te(e)}},function(e,a){const{navigate:s}=a;return{onBackClick:()=>{s("../../..")},onVendorTabSelectionChanged:t=>{const n=ve(t);s(n),e(ie(xe(t)))},onSortOrderChanged:(t,n)=>{e(He({scheduleType:se,sortKey:t,sortOrder:n}))},onChangeSubTab:t=>{e(qe({scheduleType:se,subTab:t}))},onSearchTextChanged:t=>{e(Ke({scheduleType:se,searchText:t}))},onReloadReport:()=>{e(ke(se))},onScroll:t=>{e(ze({scheduleType:se,scrollYOffset:t}))},onClickSchedule:t=>{e(Ft({selectedJEScheduleKey:t}));const n=a.scheduleListReport.jeScheduledTransactions.find(o=>o.jeScheduleTransactionKey===t);s(n?.jeScheduleId==null?"details/new":`details/${n.jeScheduleId}`)},updateDownloadStateHandler:t=>{e(Ye({scheduleType:se,fetchState:t}))}}})(Ut),ys=({vendorTabsToShow:e,previousTabPosition:a,setPreviousTabPosition:s})=>{const[t,n]=g.useState(!1),o=J(),c=z();Te();const{useFeatureGate:r}=ae(),h=ce(),{isFeatureEnabled:i,isFeatureGateLoading:m}=r(Y.isOpexByVendorFeatureEnabled),d=R.getSignedInUser(),u=S(v=>L(v)),p={userId:d?.userId??"",sessionId:d?.zeniSessionId??"",tenantId:u.tenantId},f=g.useMemo(()=>({authParams:p,jeScheduleEndPoint:`${Z}/jeScheduleReports`,timezone:we(),companyName:u.companyName}),[]),[D,x]=g.useState(!1),b=S(v=>ee(v)),C=S(v=>Ge(v,"fixed_assets")),E=e.includes("prepaid_expenses"),k=e.includes("fixed_assets"),I=e.includes("accrued_expenses");g.useEffect(()=>{(E||k||I)&&D===!1&&b!=="Completed"&&(c(ye()),x(!0))},[D]),g.useEffect(()=>{m===!1&&(c(De({shouldFetchAccruedExpenses:I,shouldFetchFixedAssets:!0,shouldFetchPrepaidExpenses:E,shouldFetchOpexByVendor:i,shouldFetchVendorsList:!1,shouldFetchFiling1099Vendor:!1})),n(!0))},[b,k,m,i]),g.useEffect(()=>{t===!1&&C==="Completed"&&c(ke("fixed_assets",{selectedTimeframe:$e("fixed_assets"),selectedCategoryId:"all"},!0))},[t,C]);const w=S(v=>At(v,se)),{isAiCfoAccessEnabled:_,onAskAiCfoClick:j}=fe({mobileExploreReferrer:"Vendors — Fixed Assets"});Se({isDataReady:w.fetchState==="Completed"});const V=S(v=>H(v).isReportGenerated);S(v=>H(v).fetchState)!=="Completed"||V!==!0||i!==!0||e.includes("operating_expenses_by_vendor")||e.splice(1,0,"operating_expenses_by_vendor"),k||o("../opex");const A=S(v=>X(v,u.companyId)),[y,P]=g.useState(!1),T=v=>{P(v)};return l.jsxs(l.Fragment,{children:[l.jsx(ge,{isAppContentDrawerOpen:y,handleDrawerToggle:T}),l.jsx(Ts,{navigate:o,scheduleListReport:w,downloadParams:f,previousTabPosition:a,setPreviousTabPosition:s,themeState:h,vendorTabsToShow:e,analytics:F,controllerUserDetails:A,isAiCfoAccessEnabled:_,onAskAiCfoClick:j,onClickMenuIcon:()=>{T(!0)}})]})},Ds=U.div`
30
- display: flex;
31
- min-height: 100%;
32
- width: 100%;
33
- flex: 1 1 auto;
34
- flex-direction: column;
35
- align-items: center;
36
- background-color: ${e=>e.theme.colors.grey4};
37
- `,Cs=G(function(e,a){const s=R.getSignedInUser(),t=e.tenantState.currentTenantId,n=L(e),o=n?.companyName??"",c={userId:s?.userId??"",sessionId:s?.zeniSessionId??"",tenantId:t??""},r=H(e),h=ra(e);return{report:r,uiState:h,isAccountingClassesEnabled:te(e),analytics:F,vendorTabsToShow:a.vendorTabsToShow,downloadParams:{downloadState:h.downloadState,currentTenantCompanyName:o,statementEndPoint:`${Z}/opexByVendor`,authParams:c,timezone:we()}}},function(e,a){const{navigate:s}=a;return{onFetchOpExByVendors:(t,n,o)=>{e(xa(t,n,o))},onVendorNameAndBalanceClicked:(t,n)=>{if(a.tenantEmailDomain!=null){const o=tt(t.id,t.qboId,a.tenantEmailDomain,n),c=M(a.location.state?.pathnameStackToGoBack,a.location.pathname);a.navigate(o,{state:{pathnameStackToGoBack:c,referrer:"Operating Expenses By Vendor"}})}},onReloadReport:()=>{e(va(!0))},onBackClick:()=>{s("../../dashboard")},onTimeframeSelectionChanged:t=>{e(ga(t))},onAdditionalBalanceSelectionChanged:(t,n)=>{e(fa({isCompareModeOn:t,additionalBalances:n}))},onSortOrderChanged:(t,n,o)=>{e(Sa({sortkey:n,sortOrder:t,timeframe:o}))},onVendorTabSelectionChanged:t=>{const n=ve(t);s(n),e(ie(xe(t)))},onSortOrSearchStarted:t=>{e(ma(t))},onPageFetchStarted:()=>{e(pa(!0))},updateDownloadStateHandler:t=>{e(ha(t))},onClearSearch:t=>{e(ua({timeframe:t}))}}})(In);function Es({vendorTabsToShow:e,previousTabPosition:a,setPreviousTabPosition:s}){const t=J(),n=z(),o=K(),{tenantEmailDomain:c}=O(),r=de(),h=R.getSignedInUser(),{useFeatureGate:i}=ae(),{isFeatureEnabled:m,isFeatureGateLoading:d}=i(Y.isOpexByVendorFeatureEnabled),u=S(A=>H(A));if(h==null)throw Error("Can't access opex by vendor page without signing in...");Te();const[p,f]=g.useState(!1),D=S(A=>ee(A)),x=e.includes("prepaid_expenses"),b=e.includes("fixed_assets"),C=e.includes("accrued_expenses"),E=S(A=>me(A)),{isAiCfoAccessEnabled:k,onAskAiCfoClick:I}=fe({mobileExploreReferrer:"Vendors — Operating Expenses by Vendor"});Se({isDataReady:u.fetchState==="Completed"&&u.isReportGenerated===!0});const{areTenantIdsInSync:w}=bn();g.useEffect(()=>{(x||b||C)&&p===!1&&D!=="Completed"&&w&&(n(ye()),f(!0))},[p,w]),g.useEffect(()=>{w&&n(De({shouldFetchAccruedExpenses:C,shouldFetchFixedAssets:b,shouldFetchPrepaidExpenses:x,shouldFetchOpexByVendor:m===!0&&d===!1,shouldFetchVendorsList:!1,shouldFetchFiling1099Vendor:!1}))},[D,b,d,m,w]),u.fetchState!=="Completed"||u.isReportGenerated!==!0||m!==!0||e.includes("operating_expenses_by_vendor")||e.splice(1,0,"operating_expenses_by_vendor"),(u.isReportGenerated===!1&&u.fetchState==="Completed"||m===!1&&d===!1)&&t("../summary");const[_,j]=g.useState(!1),V=A=>{j(A)};return l.jsxs(Ds,{windowSize:r,children:[u.fetchState==="Completed"?l.jsx(W,{analytics:F,onLoad:A=>{E.previousTab==null?A.trackVendorOperatingExpensesPageLoaded("Side Panel"):A.trackVendorOperatingExpenses(E.currentTab,E.previousTab??null)}}):null,l.jsx(ge,{isAppContentDrawerOpen:_,handleDrawerToggle:V}),l.jsx(Cs,{location:o,navigate:t,previousTabPosition:a,setPreviousTabPosition:s,tenantEmailDomain:c,vendorTabsToShow:e,isAiCfoAccessEnabled:k,onAskAiCfoClick:I,onClickMenuIcon:()=>{V(!0)}})]})}const oe="prepaid_expenses",bs=G(function(e,a){const s=L(e),t=me(e);return{tenantName:s.companyName,vendorTabsToShow:a.vendorTabsToShow,report:a.scheduleListReport,downloadParams:a.downloadParams,companyIncorporationDate:a.companyIncDate,controllerUserDetails:a.controllerUserDetails,vendorTabView:t,isAccountingClassesEnabled:te(e)}},function(e,a){const{navigate:s}=a;return{onBackClick:()=>{s("../../..")},onVendorTabSelectionChanged:t=>{const n=ve(t);s(n),e(ie(xe(t)))},onSortOrderChanged:(t,n)=>{e(He({scheduleType:oe,sortKey:t,sortOrder:n}))},onChangeSubTab:t=>{e(qe({scheduleType:oe,subTab:t}))},onSearchTextChanged:t=>{e(Ke({scheduleType:oe,searchText:t}))},onReloadReport:()=>{e(ke(oe))},onScroll:t=>{e(ze({scheduleType:oe,scrollYOffset:t}))},onClickSchedule:t=>{e(Ft({selectedJEScheduleKey:t}));const n=a.scheduleListReport.jeScheduledTransactions.find(o=>o.jeScheduleTransactionKey===t);s(n?.jeScheduleId==null?"details/new":`details/${n.jeScheduleId}`)},updateDownloadStateHandler:t=>{e(Ye({scheduleType:oe,fetchState:t}))}}})(Ut),Is=({vendorTabsToShow:e,previousTabPosition:a,setPreviousTabPosition:s})=>{const[t,n]=g.useState(!1),o=J(),c=z(),{useFeatureGate:r}=ae(),h=ce();Te();const i=R.getSignedInUser(),{isFeatureEnabled:m,isFeatureGateLoading:d}=r(Y.isOpexByVendorFeatureEnabled),u=S(v=>L(v)),p=S(v=>Ge(v,"prepaid_expenses")),f={userId:i?.userId??"",sessionId:i?.zeniSessionId??"",tenantId:u.tenantId},D=g.useMemo(()=>({authParams:f,jeScheduleEndPoint:`${Z}/jeScheduleReports`,timezone:we(),companyName:u.companyName}),[]),[x,b]=g.useState(!1),C=S(v=>ee(v)),E=e.includes("prepaid_expenses"),k=e.includes("fixed_assets"),I=e.includes("accrued_expenses");g.useEffect(()=>{(E||k||I)&&x===!1&&C!=="Completed"&&(c(ye()),b(!0))},[x]),g.useEffect(()=>{t===!1&&p==="Completed"&&c(ke("prepaid_expenses",{selectedTimeframe:$e("prepaid_expenses"),selectedCategoryId:"all"},!0))},[t,p]),g.useEffect(()=>{d===!1&&(c(De({shouldFetchAccruedExpenses:I,shouldFetchFixedAssets:k,shouldFetchPrepaidExpenses:!0,shouldFetchOpexByVendor:m,shouldFetchVendorsList:!1,shouldFetchFiling1099Vendor:!1})),n(!0))},[C,k,d,m]);const w=S(v=>At(v,oe)),{isAiCfoAccessEnabled:_,onAskAiCfoClick:j}=fe({mobileExploreReferrer:"Vendors — Prepaid Expenses"});Se({isDataReady:w.fetchState==="Completed"});const V=S(v=>H(v).isReportGenerated);S(v=>H(v).fetchState)!=="Completed"||V!==!0||m!==!0||e.includes("operating_expenses_by_vendor")||e.splice(1,0,"operating_expenses_by_vendor"),E||o("../opex");const A=S(v=>X(v,u.companyId)),[y,P]=g.useState(!1),T=v=>{P(v)};return l.jsxs(l.Fragment,{children:[l.jsx(ge,{isAppContentDrawerOpen:y,handleDrawerToggle:T}),l.jsx(bs,{navigate:o,previousTabPosition:a,setPreviousTabPosition:s,scheduleListReport:w,downloadParams:D,themeState:h,vendorTabsToShow:e,analytics:F,controllerUserDetails:A,isAiCfoAccessEnabled:_,onAskAiCfoClick:j,onClickMenuIcon:()=>{T(!0)}})]})},ws=U.div`
38
- display: flex;
39
- min-height: 100%;
40
- width: 100%;
41
- flex: 1 1 auto;
42
- flex-direction: column;
43
- align-items: center;
44
- background-color: ${e=>e.theme.colors.grey4};
45
- `,ks=G(function(e,a){const{isFiling1099FeatureEnabled:s,vendorDetailView:t,selectedVendor:n,firstMonthOfFY:o,currentTenant:c,currentUserRoleMap:r}=a,h=R.getSignedInUser(),i={userId:h?.userId??"",sessionId:h?.zeniSessionId??"",tenantId:c.tenantId??""};return{firstMonthOfFY:o,isFiling1099FeatureEnabled:s,vendorDetailView:t,allTransactions:t?.allVendorTransactionsView,allTransactionsTabData:t?.allTransactionsTabData!=null?{timePeriod:wa(t?.allTransactionsTabData.timePeriod),numberOfQuartersFetched:t?.allTransactionsTabData.numberOfQuartersFetched}:void 0,vendorLogo:n?.logo,readOnlyMode:r?.bookkeeping_user===!0,filesEndPoint:Mt.fileMicroServiceBaseUrl,authParams:i,scrollToTrend:a.isTrendPeriodSelected}},function(e,a){const{navigate:s,vendorDetailView:t,vendorId:n,defaultTransactionTimePeriod:o,vendorEntity:c,tenantEmailDomain:r,location:h,firstMonthOfFY:i}=a,m=()=>{const d=We(h.state?.pathnameStackToGoBack),u=d.poppedPathname??((p=2)=>{let f=p;a.isTrendPeriodSelected===!0&&(f=5);let D="../";for(let x=0;x<f;x++)D=`${D}../`;return D})(1);s(u,{state:{pathnameStackToGoBack:d.newStack}})};return{onSaveVendor:()=>{t!=null&&((d,u)=>{const{vendorId:p,vendorName:f,existingCategory:D,existingClass:x,existingOwner:b,selectedCategory:C,selectedClass:E,selectedOwner:k,isRecommendedCategorySelected:I,isRecommendedClassSelected:w,categoryRecommendationTypeSelected:_,classRecommendationTypeSelected:j}=La(d,u);p!=null&&F.trackVendorDetailsSave(p,f??"",D,x,b,C,E,k,I,w,_,j)})(t?.vendorViewDetails,t?.vendorViewDetails.ownerList),n!=null&&e(Va(n,void 0))},onVendorSpendTrendFilterTabClick:d=>{e(_a(d))},saveVendorDetailLocalData:d=>{n!=null&&e(Pa({vendorId:n,localData:d}))},saveContactsInVendorTabDetailLocalData:(d,u)=>{e(ja({vendorId:d,localData:{contacts:u}}))},onCancelClick:()=>{var d;t?.vendorViewDetails.vendorView?.vendorBasic!=null&&(d=t.vendorViewDetails.vendorView.vendorBasic).id!=null&&F.trackVendorDetailsCancel(d.id??"",d.name,d.account?.accountName,d.class?.className,d.owner?.email),e(ot()),e(lt()),e(it()),e(ct()),m()},handleSpendTrendPercentChangeClick:()=>{var d;t?.vendorViewDetails.vendorView?.vendorBasic!=null&&(d=t.vendorViewDetails.vendorView?.vendorBasic,d.id!=null&&F.trackVendorDetailsSpendTrendHotlinkClicked(d.id??"",d.name,d.account?.accountName,d.class?.className,d.owner?.email))},onSaveSuccess:()=>{n!=null&&e(Fa("Not-Started",n)),e(ot()),e(lt()),e(it()),e(ct()),m()},onTrendSelectedPeriodChange:d=>{if(d==null)o!=null&&e(Fe(c,"EntityDetail",{timeframe:"quarter",timePeriod:o}));else{const u=d.currentTimePeriod==null?d.addTimePeriod:{startDate:d.addTimePeriod.startDate,endDate:d.currentTimePeriod.endDate};e(Pe(c,"EntityDetail",{timeframe:d.timeframe,timePeriod:d.addTimePeriod},i)),e(Fe(c,"EntityDetail",{timeframe:d.timeframe,timePeriod:u}))}},onVendorTabSelectionChanged:d=>{e(Aa(d))},onAddressClick:(d,u)=>{if(r==null)return;const p=Gn(r,d,u),f=M(h.state?.pathnameStackToGoBack,h.pathname);s(p,{state:{pathnameStackToGoBack:f}})},onVendorDetailUIChange:d=>{e(ka({collapsableStatus:d}))},onTransactionItemClick:d=>{const u=`${q(d,r)}`,p=M(h.state?.pathnameStackToGoBack,h.pathname);s(u,{state:{pathnameStackToGoBack:p}})},onLoadPreviousTransactionsClick:(d,u)=>{e(jt({timePeriod:je(d),numberOfQuartersFetched:u})),e(Pt(c,je(d),!0,!0))}}})(kn);function ut({referrerType:e,isFiling1099FeatureEnabled:a}){const s=z(),t=K(),n=J(),o=wn(),[c,r]=g.useState(!1),[h,i]=g.useState(!1),[m,d]=g.useState(!1),u=O(),p=u.vendorId,f=u.qboId,{tenantEmailDomain:D,timeframe:x,startDate:b,endDate:C}=u,E={id:f??"",name:"",type:"vendor",zeniId:p??"",qboId:f??""};g.useEffect(()=>{x!=null&&b!=null&&C!=null?r(!0):(r(!1),m===!1&&(d(!0),s(Fe(E,"EntityDetail"))))},[x,b,C]);const k=de(),I=S(B=>L(B)),w=S(B=>p!=null?Ta(B,p,E):void 0),_=S(B=>B.vendorState.vendorByID[p??""]),j=S(B=>L(B).company?.companyInfo.firstMonthOfFY??1),V=S(()=>ya(j,2)),A=je({startDate:V.startDate,endDate:Da()}),y=Ca(j),P=S(B=>Ea(B.trendWithTransactionsState,E,"EntityDetail")),[T,v]=g.useState(!1),re=c===!1&&m===!1?void 0:P?.selectedPeriod?.timePeriod??y;return g.useEffect(()=>(e==null&&w?.fetchState!=="Not-Started"||p==null||s(ba(p,E)),()=>{e!=null&&p!=null&&s(Ia(p))}),[p,t.state,s]),g.useEffect(()=>{w?.fetchState==="Completed"&&w?.vendorViewDetails.vendorView?.vendorBasic!=null&&((B,ue,Ae)=>{B.id!=null&&F.trackVendorDetails(B.id,B.name,Ae,B.account?.accountName,B.class?.className,B.owner?.email,ue.percentChange,ue.last30DaysSpend,ue.last90DaysSpend,ue.yearToDateSpend)})(w?.vendorViewDetails.vendorView?.vendorBasic,w?.vendorSpend,e),v(!1)},[w?.fetchState]),g.useEffect(()=>{if(w?.fetchState==="Completed"&&T===!1){re!=null&&c===!1&&(s(Pe(E,"EntityDetail",{timeframe:P?.selectedPeriod?.timeframe??"quarter",timePeriod:re},j)),v(!0));const B=Ce.getLocalizedStrings().dateFormat.analytics;if(c===!0&&x!=null&&b!=null&&C!=null){v(!0);const ue=x,Ae={startDate:st(b,B.YYYYDashMMDashDDFormat),endDate:st(C,B.YYYYDashMMDashDDFormat)};s(Pe(E,"EntityDetail",{timeframe:ue,timePeriod:Ae}))}}},[w?.fetchState,re,P?.selectedPeriod?.timeframe,c,j]),g.useEffect(()=>{w?.fetchState==="Completed"&&h===!1&&(s(jt({timePeriod:A,numberOfQuartersFetched:3})),s(Pt(E,w.allTransactionsTabData?.timePeriod??A,!1,!0)),i(!0))},[w?.fetchState,h]),p==null?l.jsx(le,{}):l.jsx(ws,{windowSize:k,children:l.jsx(ks,{location:t,navigate:n,isFiling1099FeatureEnabled:a,vendorDetailView:w,vendorId:p,currentTenant:I,selectedVendor:_,firstMonthOfFY:j,isTrendPeriodSelected:c,selectedPeriodTimePeriod:P?.selectedPeriod?.timePeriod,defaultTransactionTimePeriod:y,vendorEntity:E,currentUserRoleMap:o?.loggedInUserRoleMap,tenantEmailDomain:D})})}const As=Ce.getLocalizedStrings().spendManagement.billPay.vendorCreation.vendorDetails,Fs={containerWidth:new Ze(100,58)},js=U(Fn)`
46
- width: ${Q.sp4};
47
- height: ${Q.sp4};
48
- cursor: pointer;
49
- color: ${e=>e.theme.colors.brandColorJade};
50
- `,Ps=U.div`
51
- display: flex;
52
- height: 100vh;
53
- flex-direction: ${e=>e.windowSize==="small"?"column":"row"};
54
- width: 100%;
55
- overflow-y: scroll;
56
- background-color: ${e=>e.theme.colors.grey4};
57
- `,_s=U.div`
58
- display: flex;
59
- flex-direction: column;
60
- width: ${e=>`${Fs.containerWidth.value(e.windowSize)}%`};
61
- ${e=>e.windowSize!=="small"?"overflow: auto;":""}
62
- `,Vs=G(function(e,a){const s=R.getSignedInUser(),t=e.tenantState.currentTenantId,n={userId:s?.userId??"",sessionId:s?.zeniSessionId??"",tenantId:t??""},o=e.vendorFiling1099UploadDetailsState,c=e.vendorFiling1099UploadDetailsState;let r={fetchState:"Not-Started",error:void 0};return a.vendorId!=null&&(r=e.vendorViewState.editVendorStateById[a.vendorId]?.fetchStatus),{uploadInvoiceEndPoint:`${Mt.documentAIMicroServiceBaseUrl}`,vendorFiling1099UploadDetailsState:o,vendorFiling1099UploadDetailsViewState:c,uploadStaus:c.w9FormUploadStatus,authParams:n,billId:a.billId,vendorId:a.vendorId,file:a.file,showAutofill:a.showAutofill,type:a.type,analytics:F,entityId:a.billId,fetchVendorFetchStatus:r,vendorLegalName:a.vendorLegalName}},function(e,a){const s=a.vendorId;return{onInvoiceUpload:t=>{if(function(n){return n!=null&&"w9_form"in n}(t)&&(e(Ra({w9FormFile:t.files[0]})),t.w9_form[0]!=null)){e(Ua({ocrData:t.w9_form[0],vendorId:s}));const n=(o=>({street:[o.street.join(" ")],city:o.city,state:o.state,postalCode:o.postal_code,countryCode:o.country_code??void 0,country:o.country??""}))(t.w9_form[0].address);e(Bt({addressType:"vendor_address",addressToCreate:n}))}},updateInvoiceUploadFetchState:t=>{e(_e({fetchState:t,error:void 0}))},onSkipAutofill:t=>{e(Oa(t))},onVendorFiling1099UploadDetailsSave:t=>{e(Nt(t))},onDeleteClick:()=>{e(_e({fetchState:"Not-Started",error:void 0})),e(Lt({vendorId:s,w9Documents:[]}))}}})(Pn);function ht({appContent:e,showFullScreenSkeletonWhileLoading:a}){const s=z(),t=J(),{vendorId:n}=O(),o=de(),c=ce(),r=R.getSignedInUser(),[h,i]=g.useState(!1),{useFeatureGate:m}=ae(),{isFeatureEnabled:d}=m(Y.isVendorRecommendationFeatureEnabled),u=S(y=>L(y)).companyName,p=new AbortController,f=p.signal;let D,x,b,C,E;if(n==null)throw new Error("Vendor ID not found for Vendor Filing 1099 Details Screen");D=S(y=>_t(y,n)),x=S(y=>y.vendorFiling1099UploadDetailsState.vendor1099DetailsSaveStatus),b=S(y=>y.vendorViewState.editVendorStateById[n]?.fetchStatus),E=S(y=>y.vendorFiling1099UploadDetailsState.vendor1099DetailsLocalData.w9Documents?.[0]),C=S(y=>y.vendorFiling1099UploadDetailsState);const k=b?.fetchState==="In-Progress"||C?.w9FormUploadStatus?.fetchState==="In-Progress",I=()=>{c.toggle()};g.useEffect(()=>()=>{p.abort(),s(Vt(n))},[]),g.useEffect(()=>{h||n!=null&&(i(!0),s(Na(!1,n,f)))},[n]);const w=Ne(b?.fetchState),_=Ne(x?.fetchState),j=D.vendor?.contactIds,V=j?.[j.length-1],A=S(y=>y.contactState.contactById[V]);if(g.useEffect(()=>{n!=null&&w==="In-Progress"&&b?.fetchState==="Completed"&&D?.vendor!=null&&(s(Ba(n,D.vendor,A)),D?.vendor.filing1099W9Files?.[0]!=null&&s(_e({fetchState:"Completed",error:void 0})))},[n,D?.vendor]),g.useEffect(()=>{_==="In-Progress"&&x?.fetchState==="Completed"&&t("../../vendors/filing_1099")},[x?.fetchState]),a===!0&&b?.fetchState!=="Completed"&&b?.fetchState!=="Error")return l.jsx(Rs,{children:l.jsx(An,{})});if(r==null)throw Error("Can't access VendorFiling1099UploadScreen without signing in...");return l.jsxs(Ps,{windowSize:o,children:[o!=="small"?l.jsxs(Ns,{children:[l.jsx(js,{onClick:I}),l.jsxs(Ls,{showContent:r.userEmailDomain==="zeni.ai",children:[l.jsx(Bs,{showAutofill:!1}),l.jsx(Os,{showAutofill:!1,children:u})]})]}):null,l.jsx(Vs,{vendorId:n,file:E,showAutofill:!1,type:"w9",isVendorRecommendationEnabled:d,pdfTitle:E?As.w9FormTitle:void 0,showTitlebar:!0,showTitlebarIcon:!0,vendorLegalName:D?.vendor?.legalName,isLoading:k}),l.jsx(_s,{windowSize:o,children:e})]})}const Ls=U.div`
63
- display: ${e=>e.showContent?"flex":"none"};
64
- align-items: center;
65
- `,Ns=U.div`
66
- margin-bottom: ${Q.sp3};
67
- margin-top: ${Q.sp3};
68
- margin-left: ${Q.sp8};
69
- position: absolute;
70
- display: flex;
71
- align-items: center;
72
- `,Bs=U.div`
73
- width: 1px;
74
- height: ${Q.sp3};
75
- margin: ${Q.sp0} ${Q.sp3};
76
- background-color: ${e=>e.showAutofill?Jt.neutralGrey1Light:e.theme.colors.hero};
77
- `,Os=U(jn.StandardMedium)`
78
- color: ${e=>e.showAutofill?Jt.neutralGrey5Light:e.theme.colors.primary};
79
- `,Rs=U.div`
80
- width: 100%;
81
- height: 100vh;
82
- overflow: hidden;
83
- background-color: ${e=>e.theme.colors.grey4};
84
- `,Us=G(function(e){const a=Ma(e);return{vendorDetailView:Ja(e),globalMerchantView:a}},function(e,a){const{navigate:s}=a;return{updateVendorDetailLocalData:t=>{e(Ot({vendorDetails:t}))},fetchRecommendation:t=>{e($a("tenant",t))},onSaveClick:()=>{e(Ga())},onBackClick:()=>{s("../review")}}})(_n);function Ms(){const e=J();return l.jsx(Us,{navigate:e})}const Js=U.div`
85
- display: flex;
86
- min-height: 100%;
87
- width: 100%;
88
- flex: 1 1 auto;
89
- flex-direction: column;
90
- align-items: center;
91
- background-color: ${e=>e.theme.colors.grey4};
92
- `,Gs=G(function(e,a){const{vendorFirstReviewDetails:s}=a,t=e.globalMerchantAutoCompleteState.autoCompleteText,n=R.getSignedInUser(),o=e.tenantState.currentTenantId,c={userId:n?.userId??"",sessionId:n?.zeniSessionId??"",tenantId:o??""},r=L(e);return{vendorFirstReviewView:s,globalMerchantAutoCompleteData:{globalMerchantAutoCompleteView:s.globalMerchantAutoCompleteView,autoCompleteText:t},analytics:F,authParams:c,attachmentEndpoint:r.externalConnections?.accounting[0]?.connectionName==="netsuite"?`${Z}/vendor_attachments_accounting_provider`:`${Z}/vendor_attachments`}},function(e,a){const{navigate:s}=a;return{onFetchVendorReviewView:(t,n,o)=>{e(Ve(t,n,o))},onGlobalMerchantAutoCompleteInputChange:(t,n)=>{t.trim().length>=2?e(Za({searchString:t,globalMerchantType:n??"vendor"})):t.trim().length===0&&e(rt())},onUpdateLocalData:(t,n,o,c)=>{if(n!=null){const r=$s(n);e(Wa({vendorId:t,currentSelection:r,selectedGlobalMerchantId:o,vendorRenamedText:c}))}},onResetVendorLocalData:t=>{e(Qa({vendorId:t}))},onVendorNameClick:(t,n)=>{if(a.tenantEmailDomain!=null){const o=tt(t,n,a.tenantEmailDomain),c=M(a.location.state?.pathnameStackToGoBack,a.location.pathname);a.navigate(o,{state:{pathnameStackToGoBack:c}})}},onUpdatePageToken:t=>{e(Ha({pageToken:t}))},onUpdateSortUiState:(t,n)=>{e(qa({sortOrder:t,sortKey:n}))},onUpdateScrollYOffset:t=>{e(Ka({scrollYOffset:t}))},onClickSave:(t,n,o)=>{e(za(t,n,o))},onClickCancelPopup:()=>{e(Ya())},onClearGlobalMerchantAutoCompleteResults:()=>{e(rt())},onClickRedirectToQBO:()=>{window.open(`${Xe.qboRedirectionUrl}/vendors`,"_blank")},updateVendorDetailLocalData:t=>{e(Ot({vendorDetails:t})),s(`./vendor/${t.id}`)},onBackClick:()=>{s("../..")},onReloadList:()=>{e(Ve(null))}}})(Vn);function pt(){const e=J(),a=z(),s=K(),{tenantEmailDomain:t}=O(),n=de(),o=R.getSignedInUser(),{vendorId:c}=O(),r=S(u=>dt(u)),[h,i]=g.useState(!1),m=S(u=>dt(u).fetchState);if(g.useEffect(()=>{m==="Not-Started"&&h===!1&&(a(Ve(null)),i(!0))},[]),o==null)throw Error("Can't access first review page without signing in...");const d=u=>u.trackPageLoaded(et.Event.vendorTenantReviewListPage);return l.jsxs(l.Fragment,{children:[m==="Completed"?l.jsx(W,{analytics:F,onLoad:d}):null,l.jsx(W,{analytics:F,onLoad:d}),l.jsx($n,{isOpen:c!=null,drawerLeftMargin:new Ze(0,0,300,600),onClose:()=>{e("../review")},children:l.jsx(Ys,{onClick:u=>u.stopPropagation(),children:l.jsx(Ms,{})})}),l.jsx(Js,{windowSize:n,children:l.jsx(Gs,{location:s,navigate:e,vendorFirstReviewDetails:r,tenantEmailDomain:t})})]})}const $s=e=>e.recommendedFirst===!0?"recommendedFirst":e.recommendedSecond===!0?"recommendedSecond":e.retain===!0?"retain":e.rename===!0?"rename":e.customMerchant===!0?"customMerchant":null,Ys=U(Gt)`
93
- display: flex;
94
- min-height: 100%;
95
- flex-direction: column;
96
- `,zs=G(function(e,a){const s=R.getSignedInUser(),t=e.tenantState.currentTenantId,n=e.vendorFiling1099UploadDetailsState,o={userId:s?.userId??"",sessionId:s?.zeniSessionId??"",tenantId:t??""};let c={fetchState:"Not-Started",error:void 0};return a.vendorId!=null&&(c=e.vendorViewState.editVendorStateById[a.vendorId]?.fetchStatus),{analytics:F,vendorFiling1099UploadDetailsViewState:n,authParams:o,googleAPIKey:Xe.googleMapsAPIKey,vendorId:a.vendorId,fetchVendorFetchStatus:c,vendor:a.vendorFiling1099UploadDetails?.vendor}},function(e,a){const{currentTenant:s,navigate:t,location:n,vendorId:o,vendorFiling1099UploadDetails:c}=a,{tenantEmailDomain:r}=s;return{onVendorFiling1099UploadDetailsSave:h=>{e(Nt(h)),F.trackVendor1099DetailSave(c.vendor.legalName??"")},onSaveChangesToLocalStore:h=>{e(Lt(h))},onResetVendorFiling1099FormStatus:()=>{e(Xa())},onAddressEditHandler:h=>{const i=Un((m=>({street:m.vendor1099FilingSectionId.street,suite:m.vendor1099FilingSectionId.suite,city:m.vendor1099FilingSectionId.city,state:m.vendor1099FilingSectionId.state,country:m.vendor1099FilingSectionId.country,countryCode:m.vendor1099FilingSectionId.countryCode,postalCode:m.vendor1099FilingSectionId.postalCode,secondaryInfo:m.vendor1099FilingSectionId.secondaryInfo}))(h));e(Bt({addressType:"vendor_address",addressToCreate:i}))},goBackToListPage:()=>{e(Vt(o));const h=`/${r}/vendors/filing_1099/`,i=M(n.state?.pathnameStackToGoBack,n.pathname);t(h,{state:{pathnameStackToGoBack:i}})},onAddressClick:h=>{const i=function(d,u,p){let f=`/${d}/vendors/filing_1099/upload/${p}/edit`;return f=f.concat(`/new/${u}`),f}(r,h,o),m=M(n.state?.pathnameStackToGoBack,n.pathname);t(i,{state:{pathnameStackToGoBack:m}})},AddressFormPage:Nn}})(Ln);function Ks(){const e=J(),a=K(),{vendorId:s}=O(),t=S(r=>L(r));let n;if(s==null)throw new Error("Vendor ID not found for Vendor Filing 1099 Details Screen");n=S(r=>_t(r,s));const{tenantEmailDomain:o}=t,c=t.companyId??R.getSignedInUserTenant(o)?.companyId;if(c==null)throw new Error("Company ID not found for Vendor Filing 1099 Details Screen");return l.jsx(zs,{location:a,navigate:e,currentTenant:t,vendorId:s,vendorFiling1099UploadDetails:n,companyId:c})}const qs=U.div`
97
- display: flex;
98
- min-height: 100%;
99
- width: 100%;
100
- flex: 1 1 auto;
101
- flex-direction: column;
102
- align-items: center;
103
- background-color: ${e=>e.theme.colors.grey4};
104
- `,Hs=G(function(e,a){const{vendorsFiling1099ListDetails:s,accountMappingView:t,analytics:n}=a;return{analytics:n,vendorsFiling1099List:s.vendors,isVendor1099Populated:s.isVendor1099Populated,accountMappingView:t,fetchState:s.fetchState,uiState:s.uiState,lastRefreshSuccessTime:s.lastRefreshSuccessTime,vendorTabsToShow:a.vendorTabsToShow}},function(e,a){const{navigate:s,analytics:t}=a;return{onUpdateSortUiState:(n,o)=>{e(cn({sortOrder:n,sortKey:o}))},onUpdateSearchUiState:n=>{e(ln({searchString:n}))},onVendorRowClick:n=>{if(a.tenantEmailDomain!=null){const o=`/${a.tenantEmailDomain}/vendors/filing_1099/upload/${encodeURIComponent(n)}/edit`,c=M(a.location.state?.pathnameStackToGoBack,a.location.pathname);a.navigate(o,{state:{pathnameStackToGoBack:c}})}},onReloadVendors:()=>{e(Le(!0))},onBackClick:()=>{e(sn()),e(on())},onVendorTabSelectionChanged:n=>{const o=ve(n);s(o),e(ie(xe(n)))},onAccountMappingChange:n=>{const{filing1099:o}=n,{bankAccount:c,expenseCategory1099:r}=o,h=Yn(a.accountMappingView.bankAccounts1099FilingAccountList,c.selectedOptions),i=zn(a.accountMappingView.expenseAccounts1099FilingAccountList,r),m={selectedBankAccounts1099FilingAccountIds:h.map(d=>d.accountId),selectedExpenseAccounts1099FilingAccountIds:i};e(nn({data:m}))},onSaveClick:()=>{e(an()),t.track(et.Event.vendor1099TabSettingsSave)}}})(Bn);function mt({vendorTabsToShow:e,previousTabPosition:a,setPreviousTabPosition:s}){const t=J(),n=z(),o=K(),{tenantEmailDomain:c}=O(),r=de(),h=R.getSignedInUser(),[i,m]=g.useState(!1),[d,u]=g.useState(!1);if(h==null)throw Error("Can't access vendor filing 1099 page without signing in...");Te();const p=S(I=>en(I)),f=S(I=>tn(I)),{isAiCfoAccessEnabled:D,onAskAiCfoClick:x}=fe({mobileExploreReferrer:"Vendors — 1099"});Se({isDataReady:p.fetchState==="Completed"}),g.useEffect(()=>{d||(u(!0),n(Le(!1)))},[d,u]),g.useEffect(()=>{f.saveState.fetchState==="Completed"&&n(Le(!1))},[f.saveState.fetchState]);const b=I=>{m(I)},C=S(I=>L(I)),E={userId:h?.userId??"",sessionId:h?.zeniSessionId??"",tenantId:C.tenantId},k=g.useMemo(()=>({authParams:E,tenantName:C.companyName,filing1099ReportEndPoint:`${Z}/filing1099Reports`}),[]);return l.jsxs(l.Fragment,{children:[p.fetchState==="Completed"?l.jsx(l.Fragment,{children:l.jsx(W,{analytics:F,onLoad:()=>F.trackPageLoaded(et.Event.vendor1099ListPage)})}):null,l.jsxs(qs,{windowSize:r,children:[l.jsx(ge,{isAppContentDrawerOpen:i,handleDrawerToggle:b}),l.jsx(Hs,{location:o,navigate:t,previousTabPosition:a,setPreviousTabPosition:s,analytics:F,vendorsFiling1099ListDetails:p,vendorTypeList:p.vendorTypeList,accountMappingView:f,downloadParams:k,tenantEmailDomain:c,vendorTabsToShow:e,isAiCfoAccessEnabled:D,onAskAiCfoClick:x,onClickMenuIcon:()=>{b(!0)}})]})]})}const Qs=U.div`
105
- display: flex;
106
- min-height: 100%;
107
- width: 100%;
108
- flex: 1 1 auto;
109
- flex-direction: column;
110
- align-items: center;
111
- background-color: ${e=>e.theme.colors.grey4};
112
- `,Ws=G(function(e,a){const{vendorsListDetails:s}=a;return{vendorsList:s.vendors,totalVendorCount:s.totalVendorCount,fetchState:s.fetchState,uiState:s.uiState,searchText:s.searchString,lastRefreshSuccessTime:s.lastRefreshSuccessTime,vendorTabsToShow:a.vendorTabsToShow,isAccountingClassesEnabled:te(e),analytics:F}},function(e,a){const{navigate:s}=a;return{onFetchVendorsList:(t="",n,o)=>{e(mn({searchString:t,keepExistingListItems:n,view:"vendorsTab",pageToken:o}))},onUpdatePageToken:t=>{e(pn({pageToken:t}))},onUpdateSortUiState:(t,n)=>{e(hn({sortOrder:t,sortkey:n}))},onUpdateCurrentYTDSelection:t=>{e(un({ytdSpendSelection:t}))},onVendorRowClick:(t,n)=>{if(a.tenantEmailDomain!=null){const o=tt(t,n,a.tenantEmailDomain),c=M(a.location.state?.pathnameStackToGoBack,a.location.pathname);a.navigate(o,{state:{pathnameStackToGoBack:c,referrer:"Vendor List"}})}},onReloadVendors:()=>{console.log("Reload vendors")},onUpdateScrollYOffset:t=>{e(rn({scrollYOffset:t}))},onBackClick:()=>{s("../..")},onVendorTabSelectionChanged:t=>{const n=ve(t);s(n),e(ie(xe(t)))}}})(On);function Zs({vendorTabsToShow:e,previousTabPosition:a,setPreviousTabPosition:s}){const t=J(),n=z(),o=K(),{tenantEmailDomain:c}=O(),r=de(),h=R.getSignedInUser(),{useFeatureGate:i}=ae(),{isFeatureEnabled:m,isFeatureGateLoading:d}=i(Y.isOpexByVendorFeatureEnabled);Te();const u=e.includes("prepaid_expenses"),p=e.includes("fixed_assets"),f=e.includes("accrued_expenses"),D=S(P=>me(P));let x={};x=S(P=>dn(P,"vendorsTab"));const[b,C]=g.useState(!1),{isAiCfoAccessEnabled:E,onAskAiCfoClick:k}=fe({mobileExploreReferrer:"Vendors Summary"});Se({isDataReady:x.fetchState==="Completed"});const I=S(P=>ee(P)),w=S(P=>H(P).isReportGenerated);S(P=>H(P).fetchState)==="Completed"&&w&&m&&!e.includes("operating_expenses_by_vendor")&&e.splice(1,0,"operating_expenses_by_vendor");const[_,j]=g.useState(!1);if(g.useEffect(()=>{(u||p)&&_===!1&&I!=="Completed"&&(n(ye()),j(!0))},[_]),g.useEffect(()=>{n(De({shouldFetchAccruedExpenses:f,shouldFetchFixedAssets:p,shouldFetchPrepaidExpenses:u,shouldFetchOpexByVendor:m&&d===!1,shouldFetchVendorsList:!0,shouldFetchFiling1099Vendor:!1}))},[I,p,d,m]),g.useEffect(()=>{b||x.fetchState!=="Completed"||(C(!0),F.trackVendorList(D.currentTab,D.previousTab??null,x.totalVendorCount,x.uiState.sortKey,x.uiState.ytdSpendSelection))},[x.fetchState]),h==null)throw Error("Can't access address page without signing in...");const[V,A]=g.useState(!1),y=P=>{A(P)};return l.jsxs(Qs,{windowSize:r,children:[l.jsx(ge,{isAppContentDrawerOpen:V,handleDrawerToggle:y}),l.jsx(Ws,{location:o,navigate:t,vendorsListDetails:x,tenantEmailDomain:c,vendorTabsToShow:e,onClickMenuIcon:()=>{y(!0)},previousTabPosition:a,setPreviousTabPosition:s,isAiCfoAccessEnabled:E,onAskAiCfoClick:k})]})}function Eo(){const{useFeatureGate:e}=ae(),a=K().state?.referrer,[s,t]=g.useState(!1),[n,o]=g.useState(0),c=R.getSignedInUser(),r=Sn(c),{isFeatureEnabled:h}=e(Y.isOpexByVendorFeatureEnabled),{isFeatureEnabled:i}=e(Y.isVendorReviewFeatureEnabled),{isFeatureEnabled:m}=e(Y.isScheduledJEPrepaidExpensesFeatureEnabled),{isFeatureEnabled:d}=e(Y.isScheduledJEFixedAssetsFeatureEnabled),{isFeatureEnabled:u}=e(Y.isScheduledJEAccruedExpensesFeatureEnabled),{isFeatureEnabled:p}=e(Y.isFiling1099FeatureEnabled),f=S(k=>L(k)),D=f?.externalConnections?.accounting[0]?.connectionName,x=["vendors_tab"];D!=="netsuite"&&m===!0&&x.push("prepaid_expenses"),D!=="netsuite"&&d===!0&&x.push("fixed_assets"),D!=="netsuite"&&u===!0&&x.push("accrued_expenses"),D!=="netsuite"&&p&&r&&(x.push("filing_1099"),h&&x.splice(1,0,"operating_expenses_by_vendor"));const{isFeatureEnabled:b}=e(Y.isDebitCardFeatureEnabled),C=fn(b,f),E=gn(f);return C===!0||E===!0?l.jsx(at,{children:l.jsx(N,{path:"/*",element:l.jsx(Jn,{})})}):l.jsxs(at,{children:[l.jsx(N,{path:"/opex",element:h===!0?l.jsx(Es,{previousTabPosition:n,setPreviousTabPosition:o,vendorTabsToShow:x}):l.jsx($,{to:"../summary"})}),l.jsx(N,{path:"/summary",element:l.jsx(Zs,{previousTabPosition:n,setPreviousTabPosition:o,vendorTabsToShow:x})}),l.jsx(N,{path:"schedules/fixed_assets/details/:scheduleDetailId",element:d===!0?l.jsx(ss,{}):l.jsx($,{to:"../../vendors/opex"})}),l.jsx(N,{path:"schedules/accrued_expenses/details/:scheduleDetailId",element:d===!0?l.jsx(Xn,{shouldNavigateBack:s,setShouldNavigateBack:t}):l.jsx($,{to:"../../vendors/opex"})}),l.jsx(N,{path:"schedules/:scheduleType/details/:scheduleDetailId",element:m===!0?l.jsx(rs,{}):l.jsx($,{to:"../../vendors/opex"})}),l.jsx(N,{path:"schedules/:scheduleType/details/:scheduleDetailId/edit_link",element:m===!0||d===!0?l.jsx(fs,{}):l.jsx($,{to:"../../vendors/opex"})}),l.jsx(N,{path:"schedules/accrued_expenses/details/:scheduleDetailId/edit_link",element:u===!0?l.jsx(Hn,{setShouldNavigateBack:t}):l.jsx($,{to:"../../vendors/opex"})}),l.jsx(N,{path:"schedules/prepaid_expenses",element:m===!0?l.jsx(Is,{previousTabPosition:n,setPreviousTabPosition:o,vendorTabsToShow:x}):l.jsx($,{to:"../opex"})}),l.jsx(N,{path:"schedules/fixed_assets",element:d===!0?l.jsx(ys,{previousTabPosition:n,setPreviousTabPosition:o,vendorTabsToShow:x}):l.jsx($,{to:"../opex"})}),l.jsx(N,{path:"schedules/accrued_expenses",element:u===!0?l.jsx(xs,{previousTabPosition:n,setPreviousTabPosition:o,vendorTabsToShow:x}):l.jsx($,{to:"../opex"})}),l.jsx(N,{path:"/filing_1099",element:p&&r?l.jsx(mt,{previousTabPosition:n,setPreviousTabPosition:o,vendorTabsToShow:x}):l.jsx($,{to:"../opex"})}),l.jsx(N,{path:"/filing_1099/:vendorId",element:p&&r?l.jsx(mt,{vendorTabsToShow:x,previousTabPosition:n,setPreviousTabPosition:o}):l.jsx($,{to:"../opex"})}),l.jsx(N,{path:"/filing_1099/upload/:vendorId/edit",element:p&&r?l.jsx(ht,{appContent:l.jsx(Ks,{}),showFullScreenSkeletonWhileLoading:!0}):l.jsx($,{to:"../opex"})}),l.jsx(N,{path:"/filing_1099/upload/:vendorId/edit/new/:addressType",element:p&&r?l.jsx(ht,{appContent:l.jsx(Mn,{isSubPage:!0,hideAddressBackButton:!0,hideAddressSubTitle:!0})}):l.jsx($,{to:"../opex"})}),l.jsx(N,{path:"/summary/:vendorId/:qboId",element:l.jsx(ut,{referrerType:a,isFiling1099FeatureEnabled:p&&r})}),l.jsx(N,{path:"/summary/:vendorId/:qboId/:timeframe/:startDate/:endDate",element:l.jsx(ut,{referrerType:a,isFiling1099FeatureEnabled:p&&r})}),l.jsx(N,{path:"/review",element:i===!0?l.jsx(pt,{}):l.jsx(le,{})}),l.jsx(N,{path:"/review/vendor/:vendorId",element:i?l.jsx(pt,{}):l.jsx(le,{})}),l.jsx(N,{path:"/",element:l.jsx($,{to:"summary"})}),l.jsx(N,{path:"*",element:l.jsx(le,{})})]})}export{Eo as default};
@@ -1,12 +0,0 @@
1
- import{j as o}from"./liveblocks-C5Zo4IsV.js";import{a as f}from"./sentry-pTjqe1GE.js";import{t as u,u as h,j as y,N as I}from"./core-CDuxXgNT.js";import{Mf as b,fA as w,Bi as j}from"./zeni-epic-state-aFTbMOAR.js";import{z as l,y as x,H as S,K as D}from"./index-DzOogTqR.js";import{n as c}from"./mui-BWYOl-fu.js";import"./recharts-DOA55GXl.js";import"./analytics-CpUJgE1w.js";import"./plaid-2PJJQmCk.js";import"./dnd-VtUMJCWH.js";import"./stripe-DMRn4zHo.js";import"./lottie-B-fnnIRm.js";import"./lexical-CIqawAn4.js";import"./pdf-WEHP-u0u.js";import"./utils-C-pFPw5l.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]="56e39bf4-7d7f-4860-8df4-f59cc76d2d17",e._sentryDebugIdIdentifier="sentry-dbid-56e39bf4-7d7f-4860-8df4-f59cc76d2d17")}catch{}})();const R=()=>{const[e]=u(),t=e.get("code")??"",i=e.get("state")??"",p=e.get("profileId")??"",[n,g]=f.useState(!1),d=h(),s=y(m=>b(m)),r=l.getSignedInUser(),a=l.getSignedInUserTenantWithId(i);if(r==null||a==null)return o.jsx(I,{to:"/signin/auth",replace:!0});if(r==null)throw Error("Can't access this page without signing in...");return w(r.userId,r.zeniSessionId,a?.tenantId),f.useEffect(()=>{n||(g(!0),d(j(t,p,i)))},[n,d]),s.fetchState==="Error"?o.jsx(E,{children:o.jsx(_,{children:s.error?.message??""})}):(s.fetchState==="Completed"&&window.close(),o.jsx(x,{fetchState:"In-Progress"}))},E=c.div`
2
- display: flex;
3
- width: 100%;
4
- height: 100vh;
5
- flex-direction: row;
6
- justify-content: center;
7
- align-items: center;
8
- background-color: ${e=>e.theme.colors.grey5};
9
- `,_=c(D.LargeRegular)`
10
- display: flex;
11
- color: ${S.important};
12
- `;export{R as default};