@zeniai/web-app-ui 5.0.57-qa → 5.0.58-next
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/assets/AddressRoutes-gzjBzuUq.js +1 -0
- package/dist/assets/AddressScreen-e0Pj7PP8.js +9 -0
- package/dist/assets/{AiCfoScreen-Cln5kFvq.js → AiCfoScreen-CREn42qd.js} +1 -1
- package/dist/assets/{BillPayApprovalRoutes-BkiWlWG1.js → BillPayApprovalRoutes-dPyoK6Ak.js} +1 -1
- package/dist/assets/BillPayRoutes-Dr-0zZSu.js +119 -0
- package/dist/assets/{BusinessVerificationPageScreen-CETF7Xs2.js → BusinessVerificationPageScreen-Cd40kgea.js} +2 -2
- package/dist/assets/ChargeCardRoutes-yp4vXuBR.js +71 -0
- package/dist/assets/{CompanyPassportScreen-CEn8Hq_N.js → CompanyPassportScreen-v-A14_4c.js} +1 -1
- package/dist/assets/{ConnectionAuthScreen-DIDoz4Y4.js → ConnectionAuthScreen-CzUMtiLT.js} +1 -1
- package/dist/assets/CustomerOnboardingAuthScreen-BIdIyLkQ.js +1 -0
- package/dist/assets/{CustomerOnboardingRoutes-C6aBtTbj.js → CustomerOnboardingRoutes-DAl1N1ul.js} +4 -4
- package/dist/assets/DashboardRoutes-CfMUg2zu.js +20 -0
- package/dist/assets/{DefaultTenantHome-DrSW3qnP.js → DefaultTenantHome-C856UYmo.js} +1 -1
- package/dist/assets/{DomesticWireDetailScreen-DqS4Tcvr.js → DomesticWireDetailScreen-Dmty-wcu.js} +3 -3
- package/dist/assets/{DrawerScreen-CZjhB4M8.js → DrawerScreen-D_EfYa49.js} +1 -1
- package/dist/assets/{EntityDetailRoutes-uteOKaRW.js → EntityDetailRoutes-B_yOLFwg.js} +1 -1
- package/dist/assets/ExpenseAutomationRoutes-CD9fJQ1B.js +25 -0
- package/dist/assets/FeaturePreviewScreen-BLkw206M.js +1 -0
- package/dist/assets/{MagicLinkRoutes-CrxYhL_N.js → MagicLinkRoutes-DZdaDfp8.js} +2 -2
- package/dist/assets/MagicLinkSignInScreen-CXrLUJ69.js +12 -0
- package/dist/assets/{MobileAppDrawer-CsFu1SGJ.js → MobileAppDrawer-B4YhcBfV.js} +1 -1
- package/dist/assets/NotFoundScreen-BRSAD1CL.js +1 -0
- package/dist/assets/NotificationRoutes-BVFVKZIw.js +1 -0
- package/dist/assets/PandLWithForecastRoutes-DDylyD65.js +1 -0
- package/dist/assets/PeopleRoutes-C9Ddmzuf.js +22 -0
- package/dist/assets/PerformanceRoutes-DyWlaYl6.js +1 -0
- package/dist/assets/{Preview-DPJ5uAOV.js → Preview-CCYe3OR4.js} +1 -1
- package/dist/assets/{QBOConnectionScreen-ZbQqcTvr.js → QBOConnectionScreen-CXf7xZy7.js} +1 -1
- package/dist/assets/ReferralListScreen-DtxdROqg.js +5 -0
- package/dist/assets/ReimbursementApprovalRoutes-CepOXFom.js +1 -0
- package/dist/assets/{ReimbursementApprovalRuleDetailScreen-B4Iu7nC0.js → ReimbursementApprovalRuleDetailScreen-CXFTxe1t.js} +1 -1
- package/dist/assets/ReimbursementRoutes-BE22p95d.js +68 -0
- package/dist/assets/{ReportsRoutes-D-5WE4O3.js → ReportsRoutes-Dtvr-pPW.js} +1 -1
- package/dist/assets/RewardsRoutes-Bbnjgt-H.js +1 -0
- package/dist/assets/{ScreenRoutes-DAtAgM93.js → ScreenRoutes-JvctnGiS.js} +2 -2
- package/dist/assets/{SettingsRoutes-DiqY7ZzG.js → SettingsRoutes-e8aSak7Z.js} +6 -6
- package/dist/assets/{SetupPagesScreen-5gu402_s.js → SetupPagesScreen-DVBuL6-C.js} +5 -5
- package/dist/assets/{SignInScreen-Bv_CmdB4.js → SignInScreen-1JB_pjvd.js} +1 -1
- package/dist/assets/SignOutScreen-C4_OJSj1.js +9 -0
- package/dist/assets/TaskListScreen-Bv6jghVg.js +9 -0
- package/dist/assets/{TaskRoutes-XLr0JwdP.js → TaskRoutes-4j6qOv2b.js} +1 -1
- package/dist/assets/TransactionDetailRoutes-CB1i4hYU.js +1 -0
- package/dist/assets/TransactionDetailScreen-DW88Zsus.js +5 -0
- package/dist/assets/{TransactionListRoutes-CPz2tIys.js → TransactionListRoutes-CA_m8fcq.js} +1 -1
- package/dist/assets/TreasuryRoutes-YDcbDBXC.js +37 -0
- package/dist/assets/VendorsRoutes-BbLFNuvT.js +112 -0
- package/dist/assets/WiseConfirmationScreen-CSKHP9kL.js +12 -0
- package/dist/assets/ZeniAccountRoutes-X8SJrpX6.js +66 -0
- package/dist/assets/ZeniAccountStatementScreen-CAtmURw3.js +9 -0
- package/dist/assets/{accountMappingHelper-DXLz-vZu.js → accountMappingHelper-DvC_WWi8.js} +1 -1
- package/dist/assets/{analytics-C7fHeQaW.js → analytics-D1ODE1Ix.js} +1 -1
- package/dist/assets/{analyticsHelper-BI0zNJMo.js → analyticsHelper-DL8E6jB6.js} +1 -1
- package/dist/assets/{core-BojUR2ky.js → core-kd_mEvMc.js} +1 -1
- package/dist/assets/{decodeURIComponentSafe-Cj7RmfYA.js → decodeURIComponentSafe-CWCanM9M.js} +1 -1
- package/dist/assets/{dnd-CxlDz5d0.js → dnd-64rfSyZU.js} +1 -1
- package/dist/assets/{empty-U91QAR9K.js → empty-CPs1X-RI.js} +1 -1
- package/dist/assets/{empty-BfK9KfwA.js → empty-Cgt5sWdf.js} +1 -1
- package/dist/assets/{emptyVideoElement-CycntGaA.js → emptyVideoElement-fT8-FQ3f.js} +1 -1
- package/dist/assets/{epic-C89Urkp1.js → epic-CRJXeZGy.js} +1 -1
- package/dist/assets/getLocaleForTenant-CbdZJNMO.js +1 -0
- package/dist/assets/{index-DlIWyK0U.js → index-BA18ZHSY.js} +1 -1
- package/dist/assets/{index-Bl7KFfTZ.js → index-BDSGrZ82.js} +1 -1
- package/dist/assets/{index-BFSmByg_.js → index-CAQ6-ND6.js} +1 -1
- package/dist/assets/{index-LcueFkuq.js → index-CYDtjmC2.js} +1 -1
- package/dist/assets/{index-C30E8A69.js → index-Ci1GaydZ.js} +2 -2
- package/dist/assets/{index-CJekYpNM.js → index-DCaXcWXE.js} +1 -1
- package/dist/assets/{index-Dw0sYJvv.js → index-DzAxH0sX.js} +2503 -2475
- package/dist/assets/{lexical-BsuE2Lsd.js → lexical--COyOM8W.js} +1 -1
- package/dist/assets/{liveblocks-BJogRArg.js → liveblocks-BFnsX8B0.js} +1 -1
- package/dist/assets/{lottie-Cn4ueTxI.js → lottie-cF0OZPLg.js} +1 -1
- package/dist/assets/{mui-Bg09VkiQ.js → mui-HcBIKYw3.js} +1 -1
- package/dist/assets/{pathToGoBack-DkMRBkCy.js → pathToGoBack-D0tENoX2.js} +1 -1
- package/dist/assets/{pdf-unrI9041.js → pdf-C7R1L7h-.js} +3 -3
- package/dist/assets/{pdf-lib-CayRdH4_.js → pdf-lib-DDepbdus.js} +1 -1
- package/dist/assets/{plaid-DLEkn0-3.js → plaid-B2FXOAMc.js} +1 -1
- package/dist/assets/{pusher-0TzEhQ4N.js → pusher-D-h2s4xN.js} +1 -1
- package/dist/assets/{react-DqIU-sTG.js → react-B3xIIldn.js} +1 -1
- package/dist/assets/{react-DE-H5XLs.js → react-BSrBE3nc.js} +1 -1
- package/dist/assets/{react-OJ3jwYUc.js → react-Cf8SABl6.js} +1 -1
- package/dist/assets/{react-PyBVK2LU.js → react-Djk0KEGU.js} +1 -1
- package/dist/assets/{react-DrHghgwg.js → react-koHDI_aa.js} +1 -1
- package/dist/assets/{react-DroQkqxO.js → react-okDy65Yp.js} +1 -1
- package/dist/assets/{recharts-CYOGURoz.js → recharts-Td_75k_G.js} +1 -1
- package/dist/assets/{routePaths-DriCJPaW.js → routePaths-DTjzb3UO.js} +1 -1
- package/dist/assets/{sentry-WdXgkw90.js → sentry-BReBlZug.js} +1 -1
- package/dist/assets/{url-DF46HIMu.js → url-DIvgpV5A.js} +1 -1
- package/dist/assets/{url-BxFmO3XK.js → url-DwnSoc9u.js} +1 -1
- package/dist/assets/useAskAiCfoHostNavButtonProps-vEeThjOY.js +1 -0
- package/dist/assets/{useDeviceId-CYsEMtI-.js → useDeviceId-D301EHf1.js} +1 -1
- package/dist/assets/useFetchSuggestedQuestionsWhenReady-CqXHVPRH.js +1 -0
- package/dist/assets/{useInitialThreadRequest-DBmAMV6A.js → useInitialThreadRequest-yd2wjPhE.js} +1 -1
- package/dist/assets/{utils-CJNmQJBz.js → utils-B46LtKXi.js} +1 -1
- package/dist/assets/withTransactionSidePanel-BtsXx_bA.js +21 -0
- package/dist/assets/{zeni-epic-state-BJsXImBw.js → zeni-epic-state-B5rZ-c32.js} +3 -3
- package/dist/index.html +1 -1
- package/package.json +3 -3
- package/dist/assets/AddressRoutes-Bag7m6qW.js +0 -1
- package/dist/assets/AddressScreen-Ca2p0J93.js +0 -9
- package/dist/assets/BillPayRoutes-BUnKFudo.js +0 -119
- package/dist/assets/ChargeCardRoutes-DyrY3AOh.js +0 -71
- package/dist/assets/CustomerOnboardingAuthScreen-sEtdhf6t.js +0 -1
- package/dist/assets/DashboardRoutes-ibMx9tJv.js +0 -20
- package/dist/assets/ExpenseAutomationRoutes-vN-ZEfGB.js +0 -25
- package/dist/assets/FeaturePreviewScreen-Bb7LAhIT.js +0 -1
- package/dist/assets/MagicLinkSignInScreen-DMujXaBO.js +0 -12
- package/dist/assets/NotFoundScreen-DYeXrX7_.js +0 -1
- package/dist/assets/NotificationRoutes-KbJh7WKb.js +0 -1
- package/dist/assets/PandLWithForecastRoutes-DXlZi8qW.js +0 -1
- package/dist/assets/PeopleRoutes-Dfo2HPQ8.js +0 -22
- package/dist/assets/PerformanceRoutes-CtfzaZEr.js +0 -1
- package/dist/assets/ReferralListScreen-CJVut1-a.js +0 -5
- package/dist/assets/ReimbursementApprovalRoutes-DbWpAe_W.js +0 -1
- package/dist/assets/ReimbursementRoutes-DE6qZeFt.js +0 -68
- package/dist/assets/RewardsRoutes-Bse1jH88.js +0 -1
- package/dist/assets/SignOutScreen-Bg5nBSS2.js +0 -9
- package/dist/assets/TaskListScreen-CeAHUBwa.js +0 -9
- package/dist/assets/TransactionDetailRoutes-W70apOcQ.js +0 -1
- package/dist/assets/TransactionDetailScreen-DwslT8ci.js +0 -5
- package/dist/assets/TreasuryRoutes-CLsQ2k2B.js +0 -37
- package/dist/assets/VendorsRoutes-DBHqiibW.js +0 -112
- package/dist/assets/WiseConfirmationScreen-CUSz1saI.js +0 -12
- package/dist/assets/ZeniAccountRoutes-D7qmRpeW.js +0 -66
- package/dist/assets/ZeniAccountStatementScreen-YO51ZD4a.js +0 -9
- package/dist/assets/getLocaleForTenant-DXctzPv_.js +0 -1
- package/dist/assets/useAskAiCfoHostNavButtonProps-C3l35BIu.js +0 -1
- package/dist/assets/useFetchSuggestedQuestionsWhenReady-BonCp6Rh.js +0 -1
- package/dist/assets/withTransactionSidePanel-DUWL7sXt.js +0 -21
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import{j as s}from"./liveblocks-BJogRArg.js";import{a as n}from"./sentry-WdXgkw90.js";import{h as u,u as m,j as p,N as g}from"./core-BojUR2ky.js";import{z as f,B as b,t as y,d,f as h}from"./index-Dw0sYJvv.js";import{fL as I,fM as x,IE as j}from"./zeni-epic-state-BJsXImBw.js";import{n as w}from"./mui-Bg09VkiQ.js";import"./recharts-CYOGURoz.js";import"./analytics-C7fHeQaW.js";import"./plaid-DLEkn0-3.js";import"./dnd-CxlDz5d0.js";import"./stripe-DMRn4zHo.js";import"./lottie-Cn4ueTxI.js";import"./lexical-BsuE2Lsd.js";import"./pdf-unrI9041.js";import"./utils-CJNmQJBz.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]="87daac91-5bee-429d-bb3a-42090e257f5c",e._sentryDebugIdIdentifier="sentry-dbid-87daac91-5bee-429d-bb3a-42090e257f5c")}catch{}})();function $(){const e=u(),t=m(),i=p(),a=n.useRef(!1),c=f.isSignedIn(),r=t.state?.message==="logout",o=r||c;return n.useEffect(()=>{o&&!a.current&&(a.current=!0,setTimeout(()=>{try{f.clearAll(),e(I()),e(x(!1)),j(),y.reset(),d.trackLogout(h.Event.logoutSuccess),d.resetUserIdentity()}catch(l){console.error("Error during sign out:",l)}finally{r||i("/signin/auth",{replace:!0})}},0))},[o,r]),o?s.jsx(E,{children:s.jsx(b,{fetchState:"In-Progress"})}):s.jsx(g,{to:"../",replace:!0})}const E=w.div`
|
|
2
|
-
display: flex;
|
|
3
|
-
height: 100vh;
|
|
4
|
-
width: 100%;
|
|
5
|
-
flex: 1 1 auto;
|
|
6
|
-
flex-direction: column;
|
|
7
|
-
align-items: center;
|
|
8
|
-
background-color: ${e=>e.theme.colors.grey4};
|
|
9
|
-
`;export{$ as default};
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import{j as k}from"./liveblocks-BJogRArg.js";import{a as m}from"./sentry-WdXgkw90.js";import{j,h as N,u as v,g as G,l as R,k as $}from"./core-BojUR2ky.js";import{J as O,z as K,a as U,p as _,A as z,d as M,f as V,cF as W,x as f,v as q}from"./index-Dw0sYJvv.js";import{eN as J,Pn as B,Fs as y,Po as L,Pj as X,ET as S,Pp as H,EX as I,Ew as Q,Ft as b,Pq as w,gC as Y,Fi as Z,Fn as aa,Fa as ta,F8 as ea,Fo as sa,F5 as oa,Pr as na,Ps as ia,Pt as la,Pu as u,e9 as ra,Pv as ca,Pw as pa}from"./zeni-epic-state-BJsXImBw.js";import{n as ka}from"./mui-Bg09VkiQ.js";import{u as ua}from"./useAskAiCfoHostNavButtonProps-C3l35BIu.js";import{c as da}from"./useFetchSuggestedQuestionsWhenReady-BonCp6Rh.js";import{M as ma}from"./MobileAppDrawer-CsFu1SGJ.js";import"./recharts-CYOGURoz.js";import"./analytics-C7fHeQaW.js";import"./plaid-DLEkn0-3.js";import"./dnd-CxlDz5d0.js";import"./stripe-DMRn4zHo.js";import"./lottie-Cn4ueTxI.js";import"./lexical-BsuE2Lsd.js";import"./pdf-unrI9041.js";import"./utils-CJNmQJBz.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]="be12e733-3014-4b22-9fca-68a9d0188611",t._sentryDebugIdIdentifier="sentry-dbid-be12e733-3014-4b22-9fca-68a9d0188611")}catch{}})();const fa=ka.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
|
-
`,Ta=$(function(t,e){const o=B(t,e.isTaskTemplatesEnabled),{taskGroupId:i}=e,n=i!=null&&i!==""?{...o,taskGroupsWithTasksList:o.taskGroupsWithTasksList.map(l=>({...l,tasks:l.tasks.filter(r=>r.taskGroupIds.includes(i))})).filter(l=>l.tasks.length>0)}:o;return{taskListView:n,tagListView:X(t),localData:n.localData,isTaskTemplatesEnabled:e.isTaskTemplatesEnabled}},function(t,e){const{navigate:o,currentTenant:i,location:n,isTaskTemplatesEnabled:l}=e,{tenantEmailDomain:r}=i,{groupByKey:T}=e.uiState;return{onTaskManagementRowClick:a=>{const s=ga(r,a),p=f(n.state?.pathnameStackToGoBack,n.pathname);o(s,{state:{pathnameStackToGoBack:p}})},onReloadTasks:()=>{t(y(!0,l))},onNewTaskClick:()=>{if(e.localData.defaultTaskGroupId!=null){const a=C(r,e.localData.defaultTaskGroupId),s=f(n.state?.pathnameStackToGoBack,n.pathname);o(a,{state:{pathnameStackToGoBack:s,message:"comingFromTaskListPage"}})}},onColumnSortConfigChanged:(a,s)=>{t(w({uiState:{sortKey:a,sortOrder:s}}))},onFiltersChange:a=>{t(la({filters:a}))},onSearchTextChanged:a=>{t(ia({searchText:a}))},onReloadCards:()=>{t(y(!0,l))},onBackClick:()=>{if(n.state?.message==="triggerBackClick"){const a=q(n.state?.pathnameStackToGoBack),s=a.poppedPathname??"../";o(s,{state:{pathnameStackToGoBack:a.newStack}})}else o("../")},updateLocalData:a=>{t(na({localData:a}))},resetLocalData:()=>{t(L({taskGroupById:e.taskGroupState.taskGroupById}))},handleCreateGroup:a=>{t(oa(e.localData.newTaskGroupName,a))},assignGroupToTasks:a=>{t(ea(e.localData.selectedTaskIds,a,sa(e.uiState.groupByKey,a)))},onDeleteTaskGroup:a=>{t(ta(a))},onAddNewTaskToTaskGroup:a=>{if(e.localData.defaultTaskGroupId!=null){const s=ha(T,a);t(S({taskDetailLocalData:s}));const p=C(r,e.uiState.groupByKey==="groupName"?a:e.localData.defaultTaskGroupId),g=f(n.state?.pathnameStackToGoBack,n.pathname);o(p,{state:{pathnameStackToGoBack:g,message:"comingFromTaskListPage"}})}},onDragNDrop:(a,s)=>{t(aa(e.localData.selectedTaskIds.length>0?e.localData.selectedTaskIds:[a],s))},onTaskGroupRename:(a,s)=>{t(Z(a,s))},onTimeSpentUpdate:(a,s)=>{t(b({task:a,updates:s}))},onShowToast:a=>{t(Y(a))},onGroupByFilterChange:a=>{t(w({uiState:{groupByKey:a}}))},updateTask:(a,s)=>{t(b({task:a,updates:s}))},onCreateTagClick:(a,s)=>{t(Q(a,s))},handleGroupTemplateClick:a=>{t(I(a,[]))},handleGroupTemplateTaskClick:(a,s)=>{t(I(a,[s]))},handleNewTaskInitialization:a=>{if(t(S({taskDetailLocalData:{...H,name:a}})),e.localData.defaultTaskGroupId!=null){const s=C(r,e.localData.defaultTaskGroupId),p=f(n.state?.pathnameStackToGoBack,n.pathname);o(s,{state:{pathnameStackToGoBack:p,message:"comingFromTaskListPage"}})}},onTaskGroupNameClick:a=>{o(`/${r}/tasks/group/${a}`)}}})(W);function Ra(){const{isAiCfoOpen:t,setIsAiCfoOpen:e}=O(),o=j(),i=N(),n=v(),l=K.getSignedInUser(),r=G(c=>J(c)),{taskGroupId:T}=R(),{useFeatureGate:a}=U(),{isFeatureEnabled:s}=a(_.isTaskTemplatesEnabled),[p,g]=m.useState(!1),[E,F]=m.useState(!1),h=G(c=>B(c,s)),D=G(c=>c.taskGroupState),d=h.fetchState,{isAiCfoAccessEnabled:P,onAskAiCfoClick:A}=ua({isAiCfoOpen:t,setIsAiCfoOpen:e,mobileExploreReferrer:"Task Checklist"});if(da({isDataReady:d==="Completed"}),m.useEffect(()=>{p||(g(!0),i(y(!1,s)))},[p,i]),m.useEffect(()=>{d==="Completed"&&i(L({taskGroupById:D.taskGroupById}))},[d,D.taskGroupById]),l==null)throw Error("Can't access task list page without signing in...");return k.jsxs(k.Fragment,{children:[d==="Completed"?k.jsx(z,{analytics:M,onLoad:c=>(x=>x.trackPageLoaded(V.Event.taskListPage))(c)}):null,k.jsxs(fa,{children:[k.jsx(ma,{isAppContentDrawerOpen:E,handleDrawerToggle:c=>{F(c)}}),k.jsx(Ta,{location:n,navigate:o,currentTenant:r,taskGroupId:T,taskGroupState:D,localData:h.localData,uiState:h.uiState,isTaskTemplatesEnabled:s,taskListFetchState:d,isAiCfoAccessEnabled:P,onAskAiCfoClick:A})]})]})}const ga=(t,e)=>`/${t}/tasks/${encodeURIComponent(e)}`,C=(t,e)=>`/${t}/tasks/new/${e}`,ha=(t,e)=>{if(t==="assignee"){const o=e.split(",");return{...u.taskDetailLocalData,assignee:o}}if(t==="priority"){const o=ra(e);return{...u.taskDetailLocalData,priority:o}}if(t==="status"){const o=ca(e);return{...u.taskDetailLocalData,status:o}}if(t==="tag"){const o=e.split(",");return{...u.taskDetailLocalData,tagIds:o}}if(t==="dueDate"){const o=pa(e);return{...u.taskDetailLocalData,dueDate:o}}return{...u.taskDetailLocalData}};export{Ra as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{j as t}from"./liveblocks-BJogRArg.js";import i from"./NotFoundScreen-DYeXrX7_.js";import{T as r}from"./TransactionDetailScreen-DwslT8ci.js";import"./sentry-WdXgkw90.js";import{n as d,o as e}from"./core-BojUR2ky.js";import"./zeni-epic-state-BJsXImBw.js";import"./recharts-CYOGURoz.js";import"./index-Dw0sYJvv.js";import"./mui-Bg09VkiQ.js";import"./analytics-C7fHeQaW.js";import"./plaid-DLEkn0-3.js";import"./dnd-CxlDz5d0.js";import"./stripe-DMRn4zHo.js";import"./lottie-Cn4ueTxI.js";import"./lexical-BsuE2Lsd.js";import"./pdf-unrI9041.js";import"./utils-CJNmQJBz.js";import"./useAskAiCfoHostNavButtonProps-C3l35BIu.js";import"./useFetchSuggestedQuestionsWhenReady-BonCp6Rh.js";import"./decodeURIComponentSafe-Cj7RmfYA.js";import"./routePaths-DriCJPaW.js";(function(){try{var o=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},n=new o.Error().stack;n&&(o._sentryDebugIds=o._sentryDebugIds||{},o._sentryDebugIds[n]="256f287b-7a3d-4d6d-890e-a8cb9db8b86d",o._sentryDebugIdIdentifier="sentry-dbid-256f287b-7a3d-4d6d-890e-a8cb9db8b86d")}catch{}})();function q(){return t.jsxs(d,{children:[t.jsx(e,{path:"/:transactionTypeEncoded/:transactionId",element:t.jsx(r,{})}),t.jsx(e,{path:"/:transactionTypeEncoded/:transactionId/page-not-found",element:t.jsx(i,{})}),t.jsx(e,{path:"/:transactionTypeEncoded/:transactionId/vendor/create",element:t.jsx(r,{})}),t.jsx(e,{path:"/*",element:t.jsx(r,{})})]})}export{q as default};
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
import{j as b}from"./liveblocks-BJogRArg.js";import{a as d}from"./sentry-WdXgkw90.js";import{h as j,g as S,u as re,j as le,l as de,N as je,k as Ke}from"./core-BojUR2ky.js";import{bn as $e,eN as W,cO as ue,bv as me,pj as H,Jq as P,Kr as pe,Ks as Y,JQ as he,jB as fe,Kt as ge,JV as Q,JW as X,kq as Se,Gz as Z,Jk as _,jv as Te,jt as ve,jF as qe,Ku as Je,Kv as Me,t8 as G,jA as ye,FW as Ee,cT as We,cU as He,Kw as Ye,Jj as Qe,Kx as Xe,tc as Ze,Ky as ea,Kz as aa,KA as ta,KB as na,KC as oa,jE as sa,KD as ia,KE as ca,Jl as ra,KF as la,KG as da,KH as ua,FQ as ma,FE as pa,G6 as ha,jG as fa,GA as ie,FN as ga}from"./zeni-epic-state-BJsXImBw.js";import{z as Ce,a as ee,p as V,aJ as De,h as Sa,q as Ta,aK as va,C as ya,v as J,j as Ea,aL as Ca,x as M,J as Da,d as Ie,aM as Ia,ap as ba,O as q}from"./index-Dw0sYJvv.js";import{n as ka,S as Aa,D as Ua}from"./mui-Bg09VkiQ.js";import{u as xa}from"./useAskAiCfoHostNavButtonProps-C3l35BIu.js";import{c as _a}from"./useFetchSuggestedQuestionsWhenReady-BonCp6Rh.js";import{d as be}from"./decodeURIComponentSafe-Cj7RmfYA.js";import{h as ke,g as Va,d as Ba,b as Fa}from"./routePaths-DriCJPaW.js";import{t as Pa}from"./utils-CJNmQJBz.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]="32de806c-32f6-43fc-9691-9c4ed3a79470",a._sentryDebugIdIdentifier="sentry-dbid-32de806c-32f6-43fc-9691-9c4ed3a79470")}catch{}})();const ae=()=>{const a=Ce.getSignedInUser(),{useFeatureGate:e}=ee(),{isFeatureEnabled:s}=e(V.isChainOfThoughtEnabled);return d.useMemo(()=>$e(a)&&s,[a,s])};function Ae(a){if(a!=null){if("customer"in a&&a.customer!=null){const{customer:e}=a;return{id:e.id,name:e.name,logo:e.logo,type:"customer",zeniId:e.id,qboId:e.id}}if("vendor"in a&&a.vendor!=null){const{vendor:e}=a;return{id:e.id,name:e.name,logo:e.logo,type:"vendor",zeniId:e.id,qboId:e.id}}}}function Za(a,e){const s=j(),{useFeatureGate:t,useDynamicConfig:n}=ee(),o=S(u=>W(u)),i=o.userRole.includes("charge_card_user")||o.userRole.includes("charge_card_admin"),l=o.userRole!=null&&ue(o.userRole),g=o.userRole!=null&&me(o.userRole),{isFeatureEnabled:T}=t(V.isVendorBulkUpdateOnTransactionEnabled),{isFeatureEnabled:I}=t(V.isExpenseAutomationEnabled),{configValue:h}=n(De.enableUncategorizedExpenseCategory),f=h?.uncategorized_expense_category_enabled===!0,k=ae(),v=d.useMemo(()=>({id:a,type:H(e)}),[a,e]),m=S(u=>P(u,v)),D=S(u=>{const N=P(u,v)?.transactionDetailLocalData.vendorUpdates?.id;return N==null?"Not-Started":u.transactionVendorViewState.editVendorStateById[N]?.saveStatus.fetchState??"Not-Started"}),p=d.useMemo(()=>m?.fetchState==="Completed"?Ae(m?.transaction):void 0,[m?.fetchState,m?.transaction]),E=S(u=>{if(p!=null)return pe(u.customerIncomeState,u.vendorExpenseState,u.trendState,p,"month")}),A=S(u=>Y(u)),B=S(u=>{if(p!=null)return he(u.trendWithTransactionsState,p,"TransactionDetail")}),K=o.company?.companyInfo.firstMonthOfFY??1,$=S(u=>fe(u.accountState,u.accountListState,"accountList")),[w,F]=d.useState(!1),[L,y]=d.useState(!1),[c,O]=d.useState(!1);d.useEffect(()=>{F(!1),y(!1),O(!1)},[a,e]);const C=d.useCallback(()=>{F(!1),y(!1)},[]),[U,x]=d.useState(!1),z=B?.selectedPeriod?.timePeriod;return d.useEffect(()=>{c||m==null||m.transaction==null||(s(ge({id:m.transaction.id,type:m.transaction.type})),O(!0)),p!=null&&(!i||l&&g===!1)&&(w?L||E==null||(y(!0),s(Z(p,"TransactionDetail",{timeframe:"month",timePeriod:z??E}))):(s(Q()),s(X()),F(!0),s(Se(p))))},[s,c,m?.fetchState,m?.transaction,p,i,l,g,w,L,E,z]),d.useEffect(()=>{A.newVendorState?.vendorDetailLocalData?.vendorName!=null?x(!0):x(!1)},[A.newVendorState?.vendorDetailLocalData?.vendorName]),d.useEffect(()=>()=>{s(_("common"))},[s]),{currentTenant:o,loggedInUserHasCardUserOrAdminRole:i,isUserHasDashboardAccess:l,isUserHasInvestorOrBankerAccess:g,isVendorBulkUpdateOnTransactionEnabled:T,isExpenseAutomationEnabled:I,isUncategorizedExpenseCategoryEnabled:f,isChainOfThoughtEnabled:k,selectedTransaction:v,transactionDetail:m,vendorSaveStatus:D,tranEntity:p,defaultTrendTransactionTimePeriod:E,vendorViewDetails:A,uiState:B,firstMonthOfFY:K,uncategorizedAccounts:$,resetTrendIsFetchedStates:C,isCreateVendorDrawerOpen:U,setIsCreateVendorDrawerOpen:x}}const wa={overlayWidth:new ya(100,100,58)},La=({isOpen:a,onSaveVendor:e,onSaveSuccess:s,onCancel:t,vendorViewDetails:n})=>{const o=Sa(),i=Ta(),l=j(),g=S(h=>Y(h)),T=()=>{t()},I={vendorDetailView:n??g,onSaveSuccess:()=>{l(ve()),l(qe("Not-Started")),s()},onSaveVendor:e,onCancelClick:T,saveVendorDetailLocalData:h=>{l(Te({vendorId:void 0,localData:h}))}};return b.jsx(Ua,{anchor:"right",open:a,PaperProps:{style:{width:wa.overlayWidth.valuePercentage(i),boxShadow:"none"}},slotProps:{backdrop:{style:{backgroundColor:o.colors.black,opacity:.4,cursor:"pointer"}}},onClose:T,children:b.jsx(Oa,{onClick:h=>h.stopPropagation(),children:b.jsx(va,{...I})})})},Oa=ka(Aa)`
|
|
2
|
-
display: flex;
|
|
3
|
-
min-height: 100%;
|
|
4
|
-
flex-direction: column;
|
|
5
|
-
`,za=({closeDrawerHandler:a,overrideTransactionId:e,overrideTransactionType:s})=>{const t=re(),n=le(),o=j(),i=ae(),{transactionTypeEncoded:l,transactionId:g}=de(),T=e??g,I=s??be(l??"");let h;ke(T,I)&&(h={id:T,type:H(I)});const f=h!=null?S(v=>P(v,h)):void 0,k=()=>{const v=J(t.state?.pathnameStackToGoBack),m=v.poppedPathname??((D=2)=>{let p="../";for(let E=0;E<D;E++)p=`${p}../`;return p})(1);n(m,{state:{pathnameStackToGoBack:v.newStack}})};return{transactionId:h,onSaveVendor:()=>{o(ye(h,void 0))},onSaveSuccess:()=>{if(f!=null&&f?.transaction&&f?.transactionDetailLocalData.vendorUpdates?.qboId!=null&&f?.transactionDetailLocalData.vendorUpdates?.id!=null){const v=f?.transactionDetailLocalData.vendorUpdates,m={id:f?.transactionDetailLocalData.vendorUpdates?.qboId,zeniId:f?.transactionDetailLocalData.vendorUpdates?.id,type:"vendor",name:v?.name,qboId:f?.transactionDetailLocalData.vendorUpdates?.qboId??""},D={transactionId:{id:f?.transaction?.id,type:f?.transaction?.type},transaction:f?.transaction,lineIds:f?.transaction?.lines?.map(p=>p.id)??[]};o(G(m,f?.transaction?.amount.amount,D,!1,!1,i))}k()},onCancel:()=>{h!=null&&o(Je({transactionId:h})),o(ve()),o(Me()),a(!0),k()}}},Na=Ke(function(a,e){const s=P(a,e.selectedTransaction);let t;s==null&&console.warn("Check if the you've selected the transaction before getting the details");const n=Ce.getSignedInUser(),o=a.tenantState.currentTenantId,i={userId:n?.userId??"",sessionId:n?.zeniSessionId??"",tenantId:o??""};s!=null&&s.fetchState==="Completed"&&s.transaction!=null&&e.entity!=null&&(t=Ye(a,e.entity,"TransactionDetail"));const l=a.entityAutoCompleteState.autoCompleteText.common,g=Qe(a,"common"),T=W(a);return{transactionDetail:s,transactionAttachmentEndpointToDownload:`${q}/transaction_attachment`,transactionAttachmentsEndpointToFetch:T.externalConnections?.accounting[0]?.connectionName==="netsuite"?`${q}/transaction_attachments_accounting_provider`:`${q}/transaction_attachments`,attachmentUploadEndpoint:`${ba.accountMicroServiceBaseUrl}`,isCOTEnabled:e.isCOTEnabled,authParams:i,trendReport:t,analytics:Ie,uncategorizedAccounts:e.uncategorizedAccounts,autoCompleteData:{autoCompleteText:l,entityAutoCompleteView:g},isVendorBulkUpdateOnTransactionEnabled:e.isVendorBulkUpdateOnTransactionEnabled,isExpenseAutomationEnabled:e.isExpenseAutomationEnabled,isUncategorizedExpenseCategoryEnabled:e.isUncategorizedExpenseCategoryEnabled,enableBackClickOnSave:e.location.state?.message?.startsWith("comingFromScheduleDetails")}},function(a,e){const{isCOTEnabled:s}=e;return{onBackClick:()=>{if(a(_("common")),e.onBackClick!=null)return void e.onBackClick();const t=J(e.location.state?.pathnameStackToGoBack),n=t.poppedPathname??Ue(2);e.navigate(n,{state:{pathnameStackToGoBack:t.newStack,message:"comingFromTransactionDetail"}})},discardTransactionDetailLocalData:(t,n)=>{e.transaction!=null&&a(ga({transactionId:{id:e.transaction.id,type:e.transaction.type},vendorId:t,customerId:n}))},onTransactionClick:t=>{e.resetTrendIsFetchedStates(),a(Q()),a(X());const n=M(e.location.state?.pathnameStackToGoBack,e.location.pathname);e.navigate(Fa(t,e.tenantEmailDomain),{state:{pathnameStackToGoBack:n}})},onTrendSelectedPeriodChange:t=>{if(t==null)e.defaultTrendTransactionTimePeriod!=null&&a(ie(e.entity,"TransactionDetail",{timeframe:"month",timePeriod:e.defaultTrendTransactionTimePeriod}));else{const n=t.currentTimePeriod==null?t.addTimePeriod:{startDate:t.addTimePeriod.startDate,endDate:t.currentTimePeriod.endDate};a(Z(e.entity,"TransactionDetail",{timeframe:t.timeframe,timePeriod:t.addTimePeriod})),a(ie(e.entity,"TransactionDetail",{timeframe:t.timeframe,timePeriod:n}))}},onSaveUpdates:(t,n,o,i)=>{a(i===!0&&o!=null?ye(t,o,!0,e.isExpenseAutomationEnabled,e.isUncategorizedExpenseCategoryEnabled):fa({transactionId:t,isExpenseAutomationEnabled:e.isExpenseAutomationEnabled,cotTransactionTracking:n,isUncategorizedExpenseCategoryEnabled:e.isUncategorizedExpenseCategoryEnabled})),a(_("common"))},onUploadAttachmentAttachment:t=>{a(ha(t))},onDeleteAttachment:t=>{e.transaction!=null&&a(pa(t,{id:e.transaction.id,type:e.transaction.type}))},onSaveTransactionDetailLocalData:(t,n)=>{a(ma({transactionId:t,transactionLocalData:n}))},onUpdateAllChecked:(t,n,o,i)=>{e.transaction!=null&&a(ua(e.selectedTransaction,e.transaction,t,n,o,i))},onResetLineItemsCategoryClassInLocalData:(t,n,o,i,l,g)=>{a(da(t,n,o,i,l,g))},onChangeCategoryClassWhenUpdateAllIsChecked:(t,n)=>{e.transaction!=null&&a(la({id:e.transaction.id,type:e.transaction.type},e.transaction,t,n))},onSaveSuccess:()=>{const t=J(e.location.state?.pathnameStackToGoBack);if(t.poppedPathname!=null){const n=Pa(t.poppedPathname,"/").split("/"),o=n[n.length-1];if(["uncategorized-income","uncategorized-expense","missing-receipts"].includes(o)&&e.navigate(t.poppedPathname,{state:{pathnameStackToGoBack:t.newStack}}),e.location.state?.message==="comingFromScheduleDetails"){const i=`${Va(e.tenantEmailDomain)}`;e.navigate(i)}else if(e.location.state?.message==="comingFromScheduleDetailsFixedAssets"){const i=`${Ba(e.tenantEmailDomain)}`;e.navigate(i)}}},onPageRefresh:()=>{a(Ee(e.selectedTransaction,!0))},autoCompleteActions:{onAutoCompleteInputChange:(t,n)=>{t.trim().length>=2?a(ra({searchString:t,entityType:n,searchOrigin:"common"})):t.trim().length===0&&a(_("common"))},onCancelAutoComplete:()=>{a(_("common"))}},onFetchRecommendationsForEntity:(t,n,o,i)=>{a(G(t,n,o,i,!1,s))},clearRecommendationForLineId:t=>{const{transactionId:n,transaction:o,lineId:i}=t;a(ca(n,o,i))},resetUpdateErrorState:()=>{const t={id:e.selectedTransaction.id,type:e.selectedTransaction.type};a(ia(t))},onSaveVendorInLocalData:(t,n,o,i,l)=>{if(a(sa({transactionId:t,vendorUpdates:n,entity:o})),n.id!=null&&o!=null&&i!=null&&l!=null&&a(G(o,i,l,!1,!1,s)),a(Te({vendorId:n.id?n.id:void 0,localData:{vendorName:n.name,vendorId:n.id?n.id:void 0}})),!n.id&&e.transaction!=null){const g=e.transaction,T=M(e.location.state?.pathnameStackToGoBack,e.location.pathname);e.navigate(`/${e.tenantEmailDomain}/transaction/${encodeURIComponent(g.type??"")}/${g.id}/vendor/create`,{state:{pathnameStackToGoBack:T}})}},onSaveCustomerInLocalData:(t,n,o,i,l)=>{a(oa({transactionId:t,customerUpdates:n,entity:o})),n.id!=null&&o!=null&&i!=null&&l!=null&&a(G(o,i,l,!1,!1,s))},onUpdateAllTranactionsWithCurrentVendorChecked:t=>{a(na({transactionId:{id:e.selectedTransaction.id,type:e.selectedTransaction.type},isUpdateEnabled:t}))},onClickUpdateVendorToAllLineItems:(t,n,o)=>{a(ta(t,n,o))},onResetVendorToAllLineItems:(t,n,o)=>{a(aa(t,n,o))},saveLatestSelectedEntity:(t,n,o)=>{a(ea({transactionId:t,lineId:n,entity:o}))},updateVendorBulkRecommendationsFetchStatus:(t,n)=>{a(Ze(t,n))},setIsVendorUpdateAllChecked:(t,n,o)=>{a(Xe(t,n,o))}}})(Ia);function et(){const a=le(),e=j(),s=re(),{useFeatureGate:t,useDynamicConfig:n}=ee(),o=Ea(),i=S(r=>W(r)),l=i.userRole.includes("charge_card_user")||i.userRole.includes("charge_card_admin"),g=i.userRole!=null&&ue(i.userRole),T=i.userRole!=null&&me(i.userRole),{isFeatureEnabled:I}=t(V.isVendorBulkUpdateOnTransactionEnabled),{isFeatureEnabled:h}=t(V.isExpenseAutomationEnabled),{configValue:f}=n(De.enableUncategorizedExpenseCategory),k=f?.uncategorized_expense_category_enabled===!0,{tenantEmailDomain:v,transactionTypeEncoded:m,transactionId:D}=de(),[p,E]=d.useState(!1),A=be(m??""),B=ke(D,A),K=S(r=>r.transactionVendorViewState),$=ae(),{isFeatureEnabled:w}=t(V.isTransactionCommentingEnabled),F=o?.currentTenant?.companyId,L=o?.currentTenant?.companyName;let y;B&&(y={id:D,type:H(A)});const c=y!=null?S(r=>P(r,y)):void 0,O=c?.transactionDetailLocalData.vendorUpdates?.id!=null?K.editVendorStateById[c?.transactionDetailLocalData.vendorUpdates.id]?.saveStatus.fetchState:"Not-Started",C=c?.fetchState==="Completed"?Ae(c?.transaction):void 0,U=S(r=>C!=null?pe(r.customerIncomeState,r.vendorExpenseState,r.trendState,C,"month"):void 0),x=S(r=>Y(r)),z=S(r=>C!=null?he(r.trendWithTransactionsState,C,"TransactionDetail"):void 0),u=i.company?.companyInfo.firstMonthOfFY??1,N=S(r=>fe(r.accountState,r.accountListState,"accountList")),[xe,te]=d.useState(!1),[_e,ne]=d.useState(!1),[Ve,Be]=d.useState(!1),oe=()=>{te(!1),ne(!1)},Fe=Ca();d.useEffect(()=>{if(y!=null&&c!=null&&c.fetchState==="Not-Started")e(Ee(y)),oe();else if(y!=null&&c!=null&&c.fetchState==="Error"){const r=M(s.state?.pathnameStackToGoBack,s.pathname),R={pathnameStackToGoBack:r,message:"pageNotFound",origin:"transaction_detail"};Fe&&(R.message="expenseAutomation",R.origin="transaction_categorization",R.pathnameStackToGoBack=r),a("page-not-found",{replace:!0,state:R})}},[y]),d.useEffect(()=>{Ve||c==null||c.transaction==null||(e(ge({id:c.transaction.id,type:c.transaction.type})),Be(!0)),C==null&&c?.fetchState==="Completed"&&ce(c?.transaction),C!=null&&(!l||g&&T===!1)&&(xe?_e||U==null||(ne(!0),e(Z(C,"TransactionDetail",{timeframe:"month",timePeriod:z?.selectedPeriod?.timePeriod??U}))):(e(Q()),e(X()),ce(c?.transaction),te(!0),e(Se(C))))},[c?.fetchState,c?.transaction,U,l]),d.useEffect(()=>{x.newVendorState?.vendorDetailLocalData?.vendorName!=null?E(!0):E(!1)},[x.newVendorState?.vendorDetailLocalData?.vendorName]),d.useEffect(()=>()=>{e(_("common"))},[]);const Pe=[m,D].filter(r=>r!=null),{transactionId:se,onSaveVendor:we,onSaveSuccess:Le,onCancel:Oe}=za({closeDrawerHandler:r=>{E(!1),a(r?"../":"../..")}}),{isAiCfoOpen:ze,setIsAiCfoOpen:Ne}=Da(),{isAiCfoAccessEnabled:Re,onAskAiCfoClick:Ge}=xa({isAiCfoOpen:ze,setIsAiCfoOpen:Ne,mobileExploreReferrer:"Transaction Details"});return _a({isDataReady:c?.fetchState==="Completed"}),B?b.jsxs(b.Fragment,{children:[se!=null&&p&&b.jsx(La,{isOpen:p,transactionId:se,onSaveVendor:we,onSaveSuccess:Le,onCancel:Oe}),b.jsx(Na,{hideDeleteAttachment:!0,firstMonthOfFY:u,isDisabled:c?.transaction?.type==="transfer"&&o?.connectionName==="netsuite"?"readonly":void 0,tenantEmailDomain:v,location:s,navigate:a,selectedTransaction:y,entity:C,isCOTEnabled:$,defaultTrendTransactionTimePeriod:U,resetTrendIsFetchedStates:oe,transaction:c?.transaction,uncategorizedAccounts:N,vendorSaveStatus:O,isVendorBulkUpdateOnTransactionEnabled:I,isExpenseAutomationEnabled:h,isUncategorizedExpenseCategoryEnabled:k,isAiCfoAccessEnabled:Re,onAskAiCfoClick:Ge,isTransactionCommentingEnabled:w,companyId:F,companyName:L})]}):b.jsx(je,{to:Ue(Pe.length)})}const Ue=(a=2)=>{let e="../";for(let s=0;s<a;s++)e=`${e}../`;return e},ce=a=>{if(a!=null){const{transactionCategory:e,transactionClass:s}=Ra(a),t=Ga(a);Ie.trackTransactionDetails(a.account?.accountId,a.account?.accountName,a.id,t,e.length>0?e:void 0,s.length>0?s:void 0,a.type,a.amount,a.memo,a.lines?.length??0,a.attachments?.map(n=>n.fileName))}},Ra=a=>{const e=[],s=[];return a.lines?.forEach(t=>{switch(t.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=t;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}},Ga=a=>We(a)===!0?a.customer?.name??"":He(a)===!0?a.vendor?.name??"":a.memo!=null?a.memo:a.type;export{La as C,et as T,za as a,Na as b,ae as c,Za as u};
|
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
import{j as e}from"./liveblocks-BJogRArg.js";import{j as B,u as U,h as M,l as O,g as f,N as L,k as N,n as Ie,o as k}from"./core-BojUR2ky.js";import{ck as V,eN as D,MA as P,D6 as ae,fb as W,CQ as ne,MC as Te,D9 as we,My as ke,Mz as se,MQ as be,Bg as je,s5 as Ae,ME as Ee,Dk as ve,MB as re,cN as Z,wb as oe,eR as De,eT as Fe,NL as Le,NM as Be,CR as Ue,NN as Me,CS as Pe,C$ as Re,bv as Oe,bD as Ne,cv as Ve,bE as ze,cj as _e,fa as $e,bs as Ge,Ik as He,ci as We}from"./zeni-epic-state-BJsXImBw.js";import{j as z,am as Ze,z as A,A as _,d as b,b$ as qe,c0 as Je,c1 as H,q,h as Ke,K as Qe,J as Xe,a as ie,p as v,C as Ye,B as et,c2 as tt,ap as J,x as at,c3 as nt,v as K,c4 as st,I as X,c5 as rt,a5 as ot}from"./index-Dw0sYJvv.js";import{D as it,n as R,S as ct}from"./mui-Bg09VkiQ.js";import lt from"./NotFoundScreen-DYeXrX7_.js";import{S as Y}from"./SetupPagesScreen-5gu402_s.js";import{a as d}from"./sentry-WdXgkw90.js";import{u as ut}from"./useAskAiCfoHostNavButtonProps-C3l35BIu.js";import{c as dt}from"./useFetchSuggestedQuestionsWhenReady-BonCp6Rh.js";import{M as ce}from"./MobileAppDrawer-CsFu1SGJ.js";import{F as pt}from"./FeaturePreviewScreen-Bb7LAhIT.js";import{a as ee}from"./analyticsHelper-BI0zNJMo.js";import"./recharts-CYOGURoz.js";import"./analytics-C7fHeQaW.js";import"./plaid-DLEkn0-3.js";import"./dnd-CxlDz5d0.js";import"./stripe-DMRn4zHo.js";import"./lottie-Cn4ueTxI.js";import"./lexical-BsuE2Lsd.js";import"./pdf-unrI9041.js";import"./utils-CJNmQJBz.js";import"./routePaths-DriCJPaW.js";import"./BusinessVerificationPageScreen-CETF7Xs2.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]="f7aa8b86-f3d2-4e47-baaa-e03fea4c1133",t._sentryDebugIdIdentifier="sentry-dbid-f7aa8b86-f3d2-4e47-baaa-e03fea4c1133")}catch{}})();const mt=N(function(t,a){const{companyId:n}=a;return{treasurySetupView:P(t,n),analytics:b}},function(t,a){const{navigate:n,analytics:o,treasurySetupView:p}=a;return{onBackClick:()=>{n("../")},onNextClick:()=>{const r=p.fundAllocationLocalData;o.trackTreasuryPortfolioConfirm(r.riskScore,ee(r)),t(we(!0))},onUpdateFundAllocation:r=>{o.trackTreasuryAllocationAction("update",ee(r)),t(Te(r))}}})(qe);function ft(){const t=B(),a=U(),n=M(),{tenantEmailDomain:o}=O(),p=z(),r=f(w=>w.treasurySetupViewState.portfolioAllocationUpdateStatus?.fetchState),m=Ze(r),s=V(p?.loggedInUserRoleMap),[c,i]=d.useState(!1),[y,T]=d.useState(!1),[u,l]=d.useState(!1),g=f(w=>D(w)),h=A.getSignedInUserTenant(o)?.companyId??g.companyId,C=A.getSignedInUser(),S=f(w=>P(w,h)),I=f(w=>w.treasurySetupViewState.fetchState),x=f(w=>w.treasurySetupViewState.currentAllocation.fetchStatus?.fetchState),F=f(w=>w.treasurySetupViewState.treasuryFundsDetails?.fetchStatus?.fetchState);if(C==null)throw Error("Can't access treasury portfolio allocation page without signing in...");if(d.useEffect(()=>{c||I!=="Not-Started"||h==null||(i(!0),n(ae(h,!0,!1)))},[c,I,h,n]),d.useEffect(()=>{u||F!=="Not-Started"||h==null||(l(!0),n(W()))},[u,F,h,n]),d.useEffect(()=>{y||x!=="Not-Started"||h==null||(T(!0),n(ne()))},[y,x,h,n]),d.useEffect(()=>{m==="In-Progress"&&r==="Completed"&&t("../")},[m,r,t]),g.companyTreasuryInfo?.info?.isTreasuryTOSAccepted===!1)return e.jsx(L,{to:"../promo"});const E=g.companyTreasuryInfo?.info?.isTreasuryTOSAccepted!==!0||I!=="Completed";return e.jsxs(e.Fragment,{children:[!E&&e.jsx(_,{analytics:b,onLoad:()=>{}}),e.jsx(mt,{navigate:t,location:a,companyId:h,isEditMode:!0,isLoading:E,isReadOnly:!s,treasurySetupView:S,analytics:b})]})}const yt=N(function(t,a){const n=a.currentTenant?.companyId;return{plaidConnectionDetails:be(t,n,"zeni_treasury","treasury_setup").plaidConnectionDetails,treasurySetupView:P(t,n)}},function(t,a){const{navigate:n,transferDetails:o,treasurySetupView:p}=a,r=o.treasuryTransferMoneyLocalData,m=p.fundAllocationLocalData;return{onCancelClick:()=>{H(a.analytics,"cancel",r,m,"Transfer"),t(se()),n("../")},onTransferClick:()=>{H(a.analytics,"confirm",r,m,"Transfer"),t(ve())},onSaveChangesToLocalStore:s=>{t(Ee(s))},onFetchLinkTokenClick:s=>{t(Ae("treasury_setup",s))},onEstablishConnectionClick:s=>{t(je(s,a.currentTenant?.companyId,"treasury_setup","zeni_treasury"))}}})(Je),gt=({isFirstTransfer:t})=>{const a=B(),{tenantEmailDomain:n}=O(),o=M(),[p,r]=d.useState(!1),[m,s]=d.useState(!1),[c,i]=d.useState(!1),[y,T]=d.useState(!1),u=f(x=>x.treasurySetupViewState.fetchState),l=f(x=>x.treasurySetupViewState.treasuryFundsDetails?.fetchStatus?.fetchState),g=f(x=>x.treasurySetupViewState.currentAllocation.fetchStatus?.fetchState),h=f(x=>D(x)),C=A.getSignedInUserTenant(n)?.companyId??h.companyId,S=f(x=>ke(x)),I=f(x=>P(x,C));if(A.getSignedInUser()==null)throw Error("Can't access treasury transfer page without signing in...");return d.useEffect(()=>{m||u!=="Not-Started"||C==null||(s(!0),o(ae(C,!0,!1)))},[m,u,C,o]),d.useEffect(()=>{c||l!=="Not-Started"||C==null||(i(!0),o(W()))},[c,l,C,o]),d.useEffect(()=>{y||g!=="Not-Started"||C==null||(T(!0),o(ne()))},[y,g,C,o]),e.jsxs(e.Fragment,{children:[e.jsx(_,{analytics:b,onLoad:()=>{}}),e.jsx(yt,{analytics:b,navigate:a,transferDetails:S,onAnotherTransferClick:()=>{r(!1),o(se())},currentTenant:h,treasurySetupView:I,showReviewContent:p,maxInsuredAmount:5e5,onReviewClick:()=>{H(b,"review",S.treasuryTransferMoneyLocalData,I.fundAllocationLocalData,"Transfer"),r(!0)},isFirstTransfer:t,setShowReviewContent:r,onBackClick:()=>{}})]})},ht=R.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
|
-
`,St={overlayWidth:new Ye(100,100,48)},xt=N(function(t,a){const n=re(t),{companyId:o}=a;return{treasuryDetail:n,treasurySetupView:P(t,o),downloadEndPoint:`${J.bankingMicroServiceBaseUrl}/1.0/treasury-account/statements?query={"statement_type":"tax_statement"}`}},function(t,a){const{navigate:n,currentTenant:o,location:p,handleDrawerToggle:r,analytics:m}=a,{tenantEmailDomain:s}=o;return{onSettingsClick:()=>{m.trackAccountsListPageClicked("Settings Icon"),n("setup")},onReloadTransactions:()=>{t(oe(!0))},handleTreasuryOptionSelection:c=>{let i="page-not-found";c==="editPortfolio"?i=Ct(s):c==="statements"?i=It(s):c==="taxLetter"?i=Tt(s):c==="settings"&&(i=wt(s));const y=at(p.state?.pathnameStackToGoBack,p.pathname);n(i,{state:{pathnameStackToGoBack:y}})},onColumnSortConfigChanged:(c,i)=>{t(Le({uiState:{sortKey:c,sortOrder:i}}))},onTransferClick:()=>{n("./transfer")},onBackClick:()=>{n("../../")},onClickMenuIcon:()=>{r(!0)},onAutoTransferClick:()=>{n("../../checking/auto-transfer")}}})(tt);function G({isTransferDrawerOpen:t,isEditPortfolioDrawerOpen:a}){const n=U(),o=B(),p=M(),r=q(),m=Ke(),s=f(j=>D(j)),{tenantEmailDomain:c}=O(),i=s.companyId??A.getSignedInUserTenant(c)?.companyId,[y,T]=d.useState(!1),u=f(j=>re(j)),l=u.fetchState,g=u.accountSummary?.totalBalance?.amount,h=f(j=>j.treasurySetupViewState.treasuryFundsDetails?.fetchStatus),C=s.companyTreasuryInfo?.info?.businessVerificationStatus?.code==="verified",S=z(),I=!!s.companyTreasuryInfo?.info?.isTreasuryTOSAccepted,x=V(S?.loggedInUserRoleMap),F=Z(S?.loggedInUserRoleMap),{areTenantIdsInSync:E}=Qe();d.useEffect(()=>{l==="Not-Started"&&!y&&E&&(T(!0),p(oe(!0)))},[y,p,l,E]),d.useEffect(()=>{u.transactionsFetchState.fetchState==="Completed"&&u.transactions.length===0&&!n.pathname.includes("transfer")&&x&&o("./transfer")},[u.transactionsFetchState.fetchState,u.transactions.length]);const w=()=>{o("..")},[le,ue]=d.useState(!1),Q=j=>{ue(j)},{isAiCfoOpen:de,setIsAiCfoOpen:pe}=Xe(),{isAiCfoAccessEnabled:me,onAskAiCfoClick:fe}=ut({isAiCfoOpen:de,setIsAiCfoOpen:pe,mobileExploreReferrer:"Treasury"});dt({isDataReady:l==="Completed"});const{useFeatureGate:$}=ie(),{isFeatureEnabled:ye}=$(v.isDebitCardFeatureEnabled),{isFeatureEnabled:ge}=$(v.isAutoTransferRuleEnabled),{isFeatureEnabled:he}=$(v.isTreasuryCommentingEnabled),Se=De(s),xe=Fe(ye,s);if(Se===!0&&xe!==!0)return e.jsx(pt,{});if(C){const j=h?.fetchState!=="Completed"||u.accountSummaryFetchState.fetchState!=="Completed";return e.jsxs(e.Fragment,{children:[u.accountSummaryFetchState.fetchState==="Completed"&&h?.fetchState==="Completed"&&t===!1&&a===!1?e.jsx(_,{analytics:b,onLoad:()=>{}}):null,e.jsx(it,{onClose:w,anchor:"right",open:a||t,transitionDuration:250,PaperProps:{style:{width:St.overlayWidth.valuePercentage(r),boxShadow:"none"}},slotProps:{backdrop:{style:{backgroundColor:m.colors.black,opacity:.75,cursor:"pointer"}}},children:e.jsxs(kt,{onClick:Ce=>Ce.stopPropagation(),children:[t===!0?e.jsx(gt,{isFirstTransfer:u.transactions.length===0||g===0}):null,a===!0?e.jsx(ft,{}):null]})}),e.jsxs(ht,{windowSize:r,children:[e.jsx(ce,{isAppContentDrawerOpen:le,handleDrawerToggle:Q}),e.jsx(xt,{treasuryDetailsView:u,isAutoTransferRuleEnabled:ge,navigate:o,currentTenant:s,location:n,companyId:i,analytics:b,isTreasuryCommentingEnabled:he,handleDrawerToggle:Q,isLoading:j,isAiCfoAccessEnabled:me,onAskAiCfoClick:fe})]})]})}return I&&x?e.jsx(L,{to:"../setup"}):s.companyTreasuryInfo?.info&&!I&&F?e.jsx(L,{to:"../promo",state:n.state}):e.jsx(et,{fetchState:"In-Progress",style:{backgroundColor:m.colors.grey5}})}const Ct=t=>`/${t}/treasury/edit-portfolio`,It=t=>`/${t}/treasury/statements`,Tt=t=>`/${t}/treasury/tax-letter`,wt=t=>`/${t}/treasury/setup`,kt=R(ct)`
|
|
10
|
-
display: flex;
|
|
11
|
-
min-height: 100%;
|
|
12
|
-
flex-direction: column;
|
|
13
|
-
`,bt=R.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 jt(){const t=B(),a=M(),n=q(),o=U(),p=`${J.bankingMicroServiceBaseUrl}/1.0/treasury-account`,[r,m]=d.useState(!1),s=f(l=>Be(l));d.useEffect(()=>{r||s.fetchState!=="Not-Started"||(m(!0),a(Ue(!1)))},[r,s.fetchState,a]);const c=A.getSignedInUser(),i=f(l=>D(l)),y={userId:c?.userId??"",sessionId:c?.zeniSessionId??"",tenantId:i.tenantId??""},T=i.company?.companyInfo.companyLegalName??i.companyName;if(c==null)throw Error("Can't access statements page without signing in...");const u=s.fetchState!=="Completed";return e.jsx(bt,{windowSize:n,children:e.jsx(nt,{currentTenantCompanyName:T,statementListView:s,isLoading:u,onBackClick:()=>{const l=K(o.state?.pathnameStackToGoBack),g=l.poppedPathname??"..";t(g,{state:{pathnameStackToGoBack:l.newStack}})},authParams:y,downloadEndPoint:p})})}const At=R.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 Et(){const t=B(),a=q(),n=U(),o=M(),p=`${J.bankingMicroServiceBaseUrl}/1.0/treasury-account`,[r,m]=d.useState(!1),s=f(l=>Me(l));d.useEffect(()=>{r||s.fetchState!=="Not-Started"||(m(!0),o(Pe(!1)))},[r,s.fetchState,o]);const c=A.getSignedInUser(),i=f(l=>D(l)),y={userId:c?.userId??"",sessionId:c?.zeniSessionId??"",tenantId:i.tenantId??""},T=i.company?.companyInfo.companyLegalName??i.companyName;if(c==null)throw Error("Can't access tax letter page without signing in...");const u=s.fetchState!=="Completed";return e.jsx(At,{windowSize:a,children:e.jsx(st,{currentTenantCompanyName:T,taxLetterListView:s,isLoading:u,onBackClick:()=>{const l=K(n.state?.pathnameStackToGoBack),g=l.poppedPathname??"..";t(g,{state:{pathnameStackToGoBack:l.newStack}})},authParams:y,downloadEndPoint:p})})}const vt=N(function(t,a){const{companyId:n}=a,o=P(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(Re(o))},onBackClick:()=>{n("../..",{relative:"path"})},onTreasurySetupSuccess:p=>{n(p?"..":"../setup",{relative:"path"})}}})(rt),Dt=()=>{const t=B(),a=U(),n=M(),{tenantEmailDomain:o}=O(),[p,r]=d.useState(!1),m=f(S=>D(S)),[s,c]=d.useState(!1),i=f(S=>S.treasurySetupViewState.treasuryFundsDetails?.fetchStatus);d.useEffect(()=>{s||i?.fetchState!=="Not-Started"||y==null||(c(!0),n(W()))},[i,n]);const y=A.getSignedInUserTenant(o)?.companyId??m.companyId,T=A.getSignedInUser(),u=!!m.companyTreasuryInfo?.info?.isTreasuryTOSAccepted,l=S=>{r(S)};if(T==null)throw Error("Can't access treasury promo page without signing in...");const g=z(),h=V(g?.loggedInUserRoleMap),C=Z(g?.loggedInUserRoleMap);if(u&&h)return e.jsx(L,{to:"../../treasury/setup"});if(m.company?.companyTreasuryInfo&&(!u&&h||C)){if(a.state?.message==="activation"){const S=K(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=>(I=>I.trackTreasuryPromoView("Treasury Promo Page"))(S)}),e.jsx(ce,{isAppContentDrawerOpen:p,handleDrawerToggle:l}),e.jsx(vt,{analytics:b,navigate:t,companyId:y,onClickMenuIcon:()=>{l(!0)}})]})}return e.jsx(te,{children:e.jsx(X,{size:"ExtraLarge",start:!0})})},te=R.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 ta(){const t=U(),a=f(E=>D(E)),{useFeatureGate:n}=ie(),{isFeatureEnabled:o}=n(v.isTreasuryEnabled),p=!!a.company?.companyTreasuryInfo?.isTreasuryTOSAccepted,r=z(),m=Z(r?.loggedInUserRoleMap),s=a?.userRole!=null&&Oe(a?.userRole),c=(a?.company==null||a.company.featuresActivationInfo?.isBillPayFeatureEnabled&&!s)&&Ne(r?.loggedInUserRoleMap),i=Ve(r?.loggedInUserRoleMap),y=(a?.company==null||a.company.featuresActivationInfo?.isReimbursementFeatureEnabled&&!s)&&ze(r?.loggedInUserRoleMap),{isFeatureEnabled:T}=n(v.isDepositAccountsFeatureEnabled),u=T&&!s&&_e(r?.loggedInUserRoleMap),l=a.company!=null&&$e(a.company),g=o&&l===!0&&!s&&V(r?.loggedInUserRoleMap),{isFeatureEnabled:h}=n(v.isChargeCardFeatureEnabled),{isFeatureEnabled:C}=n(v.isDebitCardFeatureEnabled),S=ot(a,h,C)&&!s&&Ge(r?.loggedInUserRoleMap),I=He(r?.loggedInUserRoleMap),x=We(r?.loggedInUserRoleMap),F=a.companyTreasuryInfo?.info?.businessVerificationStatus?.code==="verified";return e.jsxs(Ie,{children:[x?null:e.jsx(k,{path:"setup",element:e.jsx(Y,{isBillPayAdminLevelAccess:c,isReimbursementAdminLevelAccess:y,isZeniAccountAdminLevelAccess:u,isChargeCardAdminLevelAccess:S,isTreasuryAdminLevelAccess:g,isUserHasOnlyCardAccess:I,isUserHasOnlyBillPayAccess:i,productType:"zeni_treasury",type:"setup"})}),x?null:e.jsx(k,{path:"verification",element:e.jsx(Y,{isBillPayAdminLevelAccess:c,isUserHasOnlyBillPayAccess:i,isReimbursementAdminLevelAccess:y,isZeniAccountAdminLevelAccess:u,isChargeCardAdminLevelAccess:S,isTreasuryAdminLevelAccess:g,isUserHasOnlyCardAccess:I,productType:"zeni_treasury",type:"verification"})}),e.jsx(k,{path:"promo",element:e.jsx(Dt,{})}),e.jsx(k,{path:"statements",element:e.jsx(jt,{})}),e.jsx(k,{path:"tax-letter",element:e.jsx(Et,{})}),F?e.jsxs(e.Fragment,{children:[e.jsx(k,{path:"/",element:e.jsx(G,{isTransferDrawerOpen:!1,isEditPortfolioDrawerOpen:!1})}),g?e.jsxs(e.Fragment,{children:[e.jsx(k,{path:"edit-portfolio",element:e.jsx(G,{isEditPortfolioDrawerOpen:!0,isTransferDrawerOpen:!1})}),e.jsx(k,{path:"transfer",element:e.jsx(G,{isTransferDrawerOpen:!0,isEditPortfolioDrawerOpen:!1})})]}):null,e.jsx(k,{path:"*",element:e.jsx(lt,{})})]}):p&&g?e.jsx(k,{path:"*",element:e.jsx(L,{to:"../setup"})}):a.company?.companyZeniAccountInfo&&m?e.jsx(k,{path:"*",element:e.jsx(L,{to:"../promo",state:t.state})}):e.jsx(k,{path:"*",element:null})]})}export{ta as default};
|
|
@@ -1,112 +0,0 @@
|
|
|
1
|
-
import{j as l}from"./liveblocks-BJogRArg.js";import{a as g}from"./sentry-WdXgkw90.js";import{j as M,u as q,l as J,g as S,k as G,h as Y,n as nt,o as B,N as K}from"./core-BojUR2ky.js";import{eN as O,Jg as Ee,Jh as Ue,fO as ee,cq as be,cr as ke,uM as ft,Ji as st,uQ as Yt,Hu as te,jq as ae,uK as qt,uE as Ht,Jj as Ne,uw as Wt,uv as Qt,up as Zt,uB as Xt,uR as ea,Jk as pe,Jl as Me,ux as ta,Jm as he,eY as gt,v4 as vt,uZ as xt,Jn as Tt,nT as Ct,uU as yt,uS as Dt,Jo as It,vb as Et,v8 as bt,uV as kt,va as Ge,FW as wt,Jp as aa,Jq as na,ct as sa,Jr as oa,Js as la,Jt as me,Ju as ce,Jv as we,Hv as $e,vq as ye,Ht as De,vd as At,uN as Ke,Jw as ia,Hw as W,Jx as ze,uH as ca,Jy as da,Jz as ra,JA as Ye,JB as qe,JC as He,JD as We,vk as Ae,JE as jt,v1 as Ft,JF as ua,JG as pa,JH as ha,JI as ma,JJ as Sa,JK as fa,JL as ga,JM as va,sh as xa,si as Ta,GA as Fe,JN as Ca,JO as ya,iP as Pe,bq as Da,JP as Ia,JQ as Ea,ko as ba,kx as ka,Gz as _e,bC as ot,JR as Pt,Gf as _t,JS as wa,JT as Aa,JU as ja,kz as Fa,JV as lt,JW as it,JX as ct,JY as dt,JZ as Pa,kv as _a,J_ as Va,ky as La,J$ as Oa,K0 as Vt,GW as Lt,jO as Ba,K1 as Ja,K2 as Ve,K3 as Ot,GU as Bt,xD as Ra,K4 as Ua,K5 as Na,k6 as Jt,K6 as Ma,K7 as Ga,H6 as $a,pZ as Ka,K8 as Rt,K9 as rt,H3 as Le,Ka as ut,Kb as za,H8 as Ya,Kc as qa,Kd as Ha,Ke as Wa,Kf as Qa,Kg as Za,q0 as Xa,Kh as en,Hx as tn,Ki as an,GN as Oe,gx as nn,Kj as sn,Kk as on,gv as ln,Kl as cn,Km as dn,xH as rn,Kn as un,Ko as pn,Kp as hn,Kq as mn,jS as Sn,bn as fn,eT as gn,eR as vn}from"./zeni-epic-state-BJsXImBw.js";import{z as R,am as Be,B as Ut,A as Z,d as P,O as X,as as xn,x as N,D as Ie,$ as de,at as Qe,au as Tn,av as Cn,v as Ze,aw as yn,h as Dn,q as re,C as Xe,a as ne,p as z,ax as In,k as et,J as Se,ay as En,az as Nt,K as bn,aA as kn,j as wn,aB as An,ap as Mt,aC as jn,o as Q,S as Fn,E as Gt,F as Pn,aD as _n,aE as Vn,f as tt,aF as Ln,aG as On,r as Bn,aH as Jn,aI as Rn}from"./index-Dw0sYJvv.js";import{n as U,D as Un,S as $t}from"./mui-Bg09VkiQ.js";import{t as Nn,A as Mn}from"./AddressScreen-Ca2p0J93.js";import ie from"./NotFoundScreen-DYeXrX7_.js";import{F as Gn}from"./FeaturePreviewScreen-Bb7LAhIT.js";import{b as H,v as at,c as $n}from"./routePaths-DriCJPaW.js";import{p as Kt}from"./pathToGoBack-DkMRBkCy.js";import{u as fe}from"./useAskAiCfoHostNavButtonProps-C3l35BIu.js";import{c as ge}from"./useFetchSuggestedQuestionsWhenReady-BonCp6Rh.js";import{M as ve}from"./MobileAppDrawer-CsFu1SGJ.js";import{D as Kn}from"./DrawerScreen-CZjhB4M8.js";import{g as zn,m as Yn}from"./accountMappingHelper-DXLz-vZu.js";import"./recharts-CYOGURoz.js";import"./analytics-C7fHeQaW.js";import"./plaid-DLEkn0-3.js";import"./dnd-CxlDz5d0.js";import"./stripe-DMRn4zHo.js";import"./lottie-Cn4ueTxI.js";import"./lexical-BsuE2Lsd.js";import"./pdf-unrI9041.js";import"./utils-CJNmQJBz.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]="873458d2-9e57-4b06-93fb-2de2c9501e1b",e._sentryDebugIdIdentifier="sentry-dbid-873458d2-9e57-4b06-93fb-2de2c9501e1b")}catch{}})();const qn=Ie.getLocalizedStrings(),Hn=G(function(e,a){const s=Ue(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(st({selectedTransaction:n}))},onBackClick:()=>{s("..",{relative:"path"})},onCancel(){e(st({selectedTransaction:void 0})),e(Yt()),s("..",{relative:"path"})},onTransactionClick:n=>{const o=`${H(n,a.tenantEmailDomain)}`,c=N(t.state?.pathnameStackToGoBack,t.pathname);s(o,{state:{pathnameStackToGoBack:c}})},onLinkSave(){a.setShouldNavigateBack(!1),e(ft(a.scheduleTab,a.scheduleAccruedDetailsView.selectedJEAccruedSchedule?.jeScheduleId))}}})(xn),Wn=({setShouldNavigateBack:e})=>{const a=M(),s=q(),{scheduleDetailId:t,tenantEmailDomain:n}=J(),{scheduleType:o}=J();if(n==null)throw Error("Can't access Link Bill Expense page without tenant Email Domain");const c=S(f=>O(f)),d=Ee(o)??"accrued_expenses",u=R.getSignedInUser();if(u==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=>Ue(f,d)),m=i.selectedJELinkRowIndex,r=S(f=>ee(f,c.companyId)),p=Be(i.updateStatus.fetchState);g.useEffect(()=>{p==="In-Progress"&&i.updateStatus.fetchState==="Completed"&&a("..",{relative:"path"})},[p,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 h=i.linkBillExpenseView.fetchState==="Completed";return l.jsx(l.Fragment,{children:i.linkBillExpenseView.fetchState==="In-Progress"?l.jsx(Ut,{fetchState:i.linkBillExpenseView.fetchState}):i.selectedJEAccruedSchedule!=null&&m!=null?l.jsxs(l.Fragment,{children:[h===!0?l.jsx(Z,{analytics:P,onLoad:()=>{Qn(i,d,r)}}):null,l.jsx(Hn,{signedInUser:u,attachmentEndPoint:`${X}/vendor_attachments`,setShouldNavigateBack:e,scheduleVendorId:i.selectedJEAccruedSchedule.vendor.id??"",location:s,tenantEmailDomain:n,scheduleAccruedDetailsView:i,saveFetchState:i.updateStatus.fetchState,scheduleTab:d,navigate:a,analytics:P,controllerUserDetails:r,saveStatus:i.updateStatus.fetchState,jeAccruedSchedule:i.selectedJEAccruedSchedule,localData:i.scheduleAccruedDetailsLocalData.jeScheduleDetails[m]})]}):null})},zt=e=>{const a=qn.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,d=c.some(m=>m.isRecommendedTransaction===!0),u=be(s.controllers),i=ke(s.controllerUserIds);t!=null&&P.trackScheduleAccruedDetailsJournalEntryLinkedLoaded({scheduleType:a,schedule:{...zt(t)},scheduleExpenseCategoryAndClass:{expenseCategory:t.jeDebit.account?.accountName??null,expenseClass:t.jeDebit.accountingClass?.className??null},journalEntryDetails:{wasRecommendationAvailable:d,journalEntryPostingStatus:o?.status.label??""},vendorName:t.vendor.name??null,controllerEmails:u,controllerUserIds:i})},Zn=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
|
-
`,Xn=G(function(e){const a=O(e),s=e.entityAutoCompleteState.autoCompleteText.common,t=Ne(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(ft(n,o))},onDelete:o=>{e(ta(n,o))},vendorSearchAutoCompleteActions:{onAutoCompleteInputChange:(o,c)=>{o.trim().length>=2?e(Me({searchString:o,entityType:c,searchOrigin:"common"})):o.trim().length===0&&e(pe("common"))},onCancelAutoComplete:()=>{e(pe("common"))}},onEditAmount:(o,c)=>{e(ea(n,o,c))},onJELinkClick:o=>{e(Xt({selectedJELinkRowIndex:o})),s("./edit_link")},onCancelAccrual:(o,c,d)=>{e(Zt(o,c,d))},onTransactionClick:o=>{const c=`${H(o,a.tenantEmailDomain)}`,d=N(t.state?.pathnameStackToGoBack,t.pathname);s(c,{state:{pathnameStackToGoBack:d}})},onViewPostedJE:o=>{const c=`${H(o,a.tenantEmailDomain)}`,d=N(t.state?.pathnameStackToGoBack,t.pathname);s(c,{state:{pathnameStackToGoBack:d}})},onViewRecordedJE:o=>{const c=`${H(o,a.tenantEmailDomain)}`,d=N(t.state?.pathnameStackToGoBack,t.pathname);s(c,{state:{pathnameStackToGoBack:d}})},onViewBillExpense:o=>{const c=`${H(o,a.tenantEmailDomain)}`,d=N(t.state?.pathnameStackToGoBack,t.pathname);s(c,{state:{pathnameStackToGoBack:d}})},onDetailPageChange:(o,c,d)=>{const{scheduleDetailsAccruedExpensesSection:u}=o,{amount:i,memo:m,months:r,scheduleAccruedExpenseCategory:p,scheduleClass:h,scheduleExpenseCategory:f,startDate:C,vendor:y}=u,E=h.selectedOption!=null?a.classList.find(k=>k.classId===h.selectedOption):void 0,D=f.selectedOption!=null?a.accountList.find(k=>k.qboId===f.selectedOption):void 0,I=p.selectedOption!=null?a.accruedAccountList.find(k=>k.qboId===p.selectedOption):void 0,w=r?.selectedOption;e(Wt({scheduleType:n,localData:c,selectedJeScheduleDetailId:a.scheduleDetailId})),d!==!1||a.scheduleDetailId!=null||D?.accountId==null||a.isAccountingClassesEnabled!==!1&&E?.classId==null||I==null||y.selectedOption==null||m==null||i==null&&i==0||C==null||w==null||e(Qt({scheduleType:n}))}}})(Tn),es=({shouldNavigateBack:e,setShouldNavigateBack:a})=>{const s=M(),t=q(),n=Y(),o=de(),{tenantEmailDomain:c}=J(),[d,u]=g.useState(!1);if(c==null)throw new Error("Can't access this page without a tenantEmailDomain");const{scheduleDetailId:i}=J();let m;i!=="new"&&(m=i);const r=ts(i),p=S(x=>x.scheduleAccruedDetailState.selectedJEAccruedScheduleKey),h="accrued_expenses",f=S(x=>Ue(x,"accrued_expenses")),C=S(x=>te(x)),y=S(x=>x.classListState.fetchState),E=S(x=>ae(x)),D=C!=="Completed"||y!=="Completed";g.useEffect(()=>{d===!1&&D?(n(qt(h,m)),u(!0)):D===!1&&d===!1&&i!=="new"&&(n(Ht(h,i)),u(!0))},[d]);const I=S(x=>O(x)),w=S(x=>ee(x,I.companyId)),k=f.fetchState,b=f.allAccountList,j=f.allClassList,F=f.allAccruedAccountList,V=f.scheduleAccruedDetailsLocalData;if(r!==!0||f.fetchState==="Error")return l.jsx(ie,{});const L=k==="Completed"&&d===!0;return k!=="Completed"&&k!=="Not-Started"?l.jsx(Qe,{}):l.jsxs(Zn,{children:[L===!0?l.jsx(Z,{analytics:P,onLoad:()=>{as(f,h,w)}}):null,l.jsx(Xn,{setShouldNavigateBack:a,scheduleAccruedDetailsView:f,location:t,navigate:s,classList:j,accountList:b,shouldNavigateBack:e,accruedAccountList:F,scheduleLocalData:V,selectedJEScheduleKey:p,scheduleDetailId:m,selectedScheduledJournalEntries:f.selectedJEAccruedSchedule?.scheduledJournalEntry??[],themeState:o,tenantEmailDomain:c,analytics:P,controllerUserDetails:w,isAccountingClassesEnabled:E,status:f.selectedJEAccruedSchedule?.status.code})]})},ts=e=>e!=null,as=(e,a,s)=>{const t=e.selectedJEAccruedSchedule,n=be(s.controllers),o=ke(s.controllerUserIds);t!=null&&P.trackScheduleAccruedDetailsLoaded({scheduleType:a,scheduleExpenseCategoryAndClass:{expenseCategory:t.jeDebit.account?.accountName??null,expenseClass:t.jeDebit.accountingClass?.className??null},schedule:{...zt(t)},vendorName:t.vendor.name??null,controllerEmails:n,controllerUserIds:o})},ns=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
|
-
`,Je=Ie.getLocalizedStrings().dateFormat.analytics.YYYYDashMMDashDDFormat,ss=G(function(e){const a=O(e),s=he(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",d=t.state?.message==="expenseAutomation",u=o.flatMap(i=>i.error).filter(i=>!!i)??[];return{onNavigateBack:()=>{if(d===!0){const i=Ze(a.location.state?.pathnameStackToGoBack),m=i.poppedPathname??Kt(2);a.navigate(m,{state:{pathnameStackToGoBack:i.newStack}})}else s("../schedules/fixed_assets")},onZeniLogoClick:()=>{a.themeState.toggle()},onSave:i=>{e(Ge(c,i,u.length>0))},onDelete:i=>{e(kt(c,i))},onMarkAsComplete:()=>{a.selectedJEScheduleKey!=null&&e(bt(c,a.selectedJEScheduleKey))},onEditAmount:(i,m)=>{e(Et(c,i,m))},onJELinkClick:i=>{e(It({selectedJELinkRowIndex:i})),s("./edit_link")},onTransactionClick:i=>{const m=`${H(i,a.tenantEmailDomain)}`,r=N(t.state?.pathnameStackToGoBack,t.pathname);s(m,{state:{pathnameStackToGoBack:r,message:"comingFromScheduleDetailsFixedAssets"}})},onViewLinkedJE:i=>{const m=`${H(i,a.tenantEmailDomain)}`,r=N(t.state?.pathnameStackToGoBack,t.pathname);s(m,{state:{pathnameStackToGoBack:r}})},vendorSearchAutoCompleteActions:{onAutoCompleteInputChange:(i,m)=>{i.trim().length>=2?e(Me({searchString:i,entityType:m,searchOrigin:"common"})):i.trim().length===0&&e(pe("common"))},onCancelAutoComplete:()=>{e(pe("common"))}},onDetailPageChange:(i,m)=>{const{scheduleDetailsFixedAssetsSection:r,scheduleDetailsListSection:p}=i,{scheduleClass:h,scheduleExpenseCategory:f,accumulatedDepreciationCategory:C,assetId:y,months:E,startDate:D,postingDate:I,vendor:w}=r,k=n.entityAutoCompleteView.vendor.length>0?n.entityAutoCompleteView.vendor.find(A=>A.id===w?.selectedOption):void 0,b={id:k?.zeniId??w?.selectedOption??"",name:k?.name??w?.defaultOptions.find(A=>A.value===w?.selectedOption)?.label??"",logo:k?.logo},j=h.selectedOption!=null?a.classList.find(A=>A.classId===h.selectedOption):void 0,F=f.selectedOption!=null?a.accountList.find(A=>A.qboId===f.selectedOption):void 0,V=C.selectedOption!=null?a.depAccountList.find(A=>A.qboId===C.selectedOption):void 0,L=E?.selectedOption,x=p.map((A,$)=>({...a.scheduleLocalData.jeScheduleDetails[$],amount:{...a.scheduleLocalData.jeScheduleDetails[$].amount,amount:A.amount}})),_=I.type==="day"?I.dayOfMonth?I.dayOfMonth:1:void 0,T=I.type==="lastDayOfMonth"||void 0;e(yt({scheduleType:c,localData:{selectedAccount:F?.accountId,selectedClass:j?.classId,selectedAccumulatedDepreciationCategory:V?.accountId,selectedDate:D,selectedMonths:L,assetId:y,jeScheduleDetails:x,lastDayOfMonth:T,selectedDayOfMonth:_,selectedVendor:b},selectedJeScheduleDetailId:a.scheduleDetailId})),m!==!1||V?.accountId==null||a.scheduleDetailId!=null&&a.status!=="draft"&&a.status!=="marked_as_completed"||F?.accountId==null||a.isAccountingClassesEnabled!==!1&&j?.classId==null||D==null||L==null||T!==!0&&_==null||e(Dt({scheduleType:c}))}}})(Cn),os=()=>{const e=M(),a=q(),s=Y(),t=de(),{tenantEmailDomain:n}=J(),[o,c]=g.useState(!1),{scheduleDetailId:d}=J(),u=a.state?.message==="expenseAutomation",i=ls(d),m=S(T=>T.scheduleDetailState.selectedJEScheduleKey);g.useEffect(()=>{m!=null&&m.length!==0||d!=="new"||e("../schedules/fixed_assets")},[m,d]);const r="fixed_assets",p=S(T=>he(T,r)),h=S(T=>T.entityAutoCompleteState.autoCompleteText.common),f=S(T=>Ne(T,"common")),C=S(T=>te(T)),y=S(T=>T.classListState.fetchState),E=S(T=>ae(T)),D=S(T=>gt(T).selectedPeriod),I=C!=="Completed"||y!=="Completed";g.useEffect(()=>{o===!1&&I?(s(vt(r,x,!0)),c(!0)):I===!1&&o===!1&&(s(xt(r,d==="new"?void 0:d,!0)),c(!0))},[o]),g.useEffect(()=>{if(p.markAsCompleteStatus.fetchState==="Completed")if(s(Tt()),u===!0){const{month:T,year:A}=D;e(`../../month_end_close_checks/review/je_schedules/${T}-${A}`)}else e("../schedules/fixed_assets")},[p.markAsCompleteStatus.fetchState]);const w=S(T=>O(T)),k=S(T=>ee(T,w.companyId)),b=p.fetchState,j=p.allAccountList,F=p.allClassList,V=p.allDepreciationAccountList,L=p.scheduleDetailsLocalData.fixed_assets;let x;if(d!=="new"&&(x=d),i!==!0||p.fetchState==="Error")return l.jsx(ie,{});const _=b==="Completed"&&o===!0;return b!=="Completed"?l.jsx(Qe,{}):l.jsxs(ns,{children:[_===!0?l.jsx(Z,{analytics:P,onLoad:()=>{cs(p,r,k)}}):null,l.jsx(ss,{location:a,navigate:e,classList:F,vendorSearchEntityAutoCompleteView:f,vendorSearchAutoCompleteData:{autoCompleteText:h,entityAutoCompleteView:f},expenseAutomationSelectedPeriod:D,usedInExpenseAutomation:u,removeJeScheduleTransactionKey:(T,A)=>{s(Ct(T,A))},accountList:j,depAccountList:V,scheduleLocalData:L,selectedJEScheduleKey:m,scheduleDetailId:x,selectedScheduledJournalEntries:p.selectedJEScheduleTransaction?.scheduledJournalEntry??[],themeState:t,tenantEmailDomain:n,analytics:P,controllerUserDetails:k,isAccountingClassesEnabled:E,status:p.selectedJEScheduleTransaction?.status.code})]})},ls=e=>e!=null,is=e=>({transactionDate:e.date.format(Je),transactionAmount:e.amount,scheduleCategory:e.account.accountName,scheduleClass:e.classBase?.className??null,description:e.memo}),cs=(e,a,s)=>{const t=e.selectedJEScheduleTransaction?.baseTransaction,n=e.selectedJEScheduleTransaction,o=be(s.controllers),c=ke(s.controllerUserIds);var d;t!=null&&n!=null&&P.trackScheduleDetailsLoaded({scheduleType:a,transaction:{...is(t)},scheduleExpenseCategoryAndClass:{expenseCategory:n.jeDebit.account?.accountName??null,expenseClass:n.jeDebit.accountingClass?.className??null},scheduledTransaction:{...(d=n,{currentBalance:d.balanceAsOfToday??null,currentStatus:d.status.label,period:d.period??null,startMonth:d.startDate?.format(Je)??null,endMonth:d.endDate?.format(Je)??null})},vendorName:n.vendor.name??null,fixedAssetsDetails:{accumulatedDepreciationCategory:n.jeCredit.account?.accountName??null,assetId:n.otherAttributes.assetId??null},controllerEmails:o,controllerUserIds:c})},ds=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
|
-
`,Re=Ie.getLocalizedStrings().dateFormat.analytics.YYYYDashMMDashDDFormat,rs=G(function(e,a){const s=O(e),t=he(e,a.scheduleTab);return{tenantName:s.companyName,scheduleDetailsView:t}},function(e,a){const{navigate:s,location:t,usedInExpenseAutomation:n,vendorSearchAutoCompleteData:o,selectedScheduledJournalEntries:c}=a,d=c.flatMap(u=>u.error).filter(u=>!!u)??[];return{onNavigateBack:()=>{if(n===!0){const u=Ze(a.location.state?.pathnameStackToGoBack),i=u.poppedPathname??Kt(2);a.navigate(i,{state:{pathnameStackToGoBack:u.newStack}})}else s("../schedules/prepaid_expenses")},onZeniLogoClick:()=>{a.themeState.toggle()},onSave:u=>{e(Ge(a.scheduleTab,u,d.length>0))},onDelete:u=>{e(kt(a.scheduleTab,u))},onMarkAsComplete:()=>{a.selectedJEScheduleKey!=null&&e(bt(a.scheduleTab,a.selectedJEScheduleKey))},onEditAmount:(u,i)=>{e(Et(a.scheduleTab,u,i))},onJELinkClick:u=>{e(It({selectedJELinkRowIndex:u})),s("./edit_link")},onTransactionClick:u=>{const i=`${H(u,a.tenantEmailDomain)}`,m=N(t.state?.pathnameStackToGoBack,t.pathname);s(i,{state:{pathnameStackToGoBack:m,message:"comingFromScheduleDetails"}})},onViewLinkedJE:u=>{const i=`${H(u,a.tenantEmailDomain)}`,m=N(t.state?.pathnameStackToGoBack,t.pathname);s(i,{state:{pathnameStackToGoBack:m}})},vendorSearchAutoCompleteActions:{onAutoCompleteInputChange:(u,i)=>{u.trim().length>=2?e(Me({searchString:u,entityType:i,searchOrigin:"common"})):u.trim().length===0&&e(pe("common"))},onCancelAutoComplete:()=>{e(pe("common"))}},onDetailPageChange:(u,i)=>{const{scheduleDetailsSection:m,scheduleDetailsListSection:r}=u,{scheduleClass:p,scheduleExpenseCategory:h,months:f,startDate:C,postingDate:y,vendor:E}=m,D=o.entityAutoCompleteView.vendor.length>0?o.entityAutoCompleteView.vendor.find(x=>x.id===E?.selectedOption):void 0,I={id:D?.zeniId??E?.selectedOption??"",name:D?.name??E?.defaultOptions.find(x=>x.value===E?.selectedOption)?.label??"",logo:D?.logo},w=p.selectedOption!=null?a.classList.find(x=>x.classId===p.selectedOption):void 0,k=h.selectedOption!=null?a.accountList.find(x=>x.qboId===h.selectedOption):void 0,b=f?.selectedOption,j=r.map((x,_)=>({...a.scheduleLocalData.jeScheduleDetails[_],amount:{...a.scheduleLocalData.jeScheduleDetails[_].amount,amount:x.amount}})),F=y.type==="day"?y.dayOfMonth?y.dayOfMonth:1:void 0,V=y.type==="lastDayOfMonth"||void 0,L={selectedAccount:k?.accountId,selectedClass:w?.classId,selectedDate:C,selectedMonths:b,jeScheduleDetails:j,lastDayOfMonth:V,selectedVendor:I,selectedDayOfMonth:F};e(yt({scheduleType:a.scheduleTab,localData:L,selectedJeScheduleDetailId:a.scheduleDetailId})),i!==!1||a.scheduleDetailId!=null&&a.status!=="draft"&&a.status!=="marked_as_completed"||k?.accountId==null||a.isAccountingClassesEnabled!==!1&&w?.classId==null||C==null||b==null||V!==!0&&F==null||e(Dt({scheduleType:a.scheduleTab}))}}})(yn),us=()=>{const e=M(),a=q(),s=Y(),t=de(),{tenantEmailDomain:n}=J(),[o,c]=g.useState(!1),d=a.state?.message==="expenseAutomation",{scheduleType:u,scheduleDetailId:i}=J(),m=ps(u,i),r=S(T=>T.scheduleDetailState.selectedJEScheduleKey);g.useEffect(()=>{r!=null&&r.length!==0||i!=="new"||e("../schedules/prepaid_expenses")},[r,i]);const p=Ee(u)??"prepaid_expenses",h=S(T=>he(T,p)),f=S(T=>T.entityAutoCompleteState.autoCompleteText.common),C=S(T=>Ne(T,"common")),y=S(T=>te(T)),E=S(T=>T.classListState.fetchState),D=S(T=>ae(T)),I=S(T=>gt(T).selectedPeriod),w=y!=="Completed"||E!=="Completed";g.useEffect(()=>{o===!1&&w?(s(vt(p,x,!0)),c(!0)):w===!1&&o===!1&&(s(xt(p,i==="new"?void 0:i,!0)),c(!0))},[o]),g.useEffect(()=>{if(h.markAsCompleteStatus.fetchState==="Completed")if(s(Tt()),d===!0){const{month:T,year:A}=I;e(`../../month_end_close_checks/review/je_schedules/${T}-${A}`)}else e("../schedules/prepaid_expenses")},[h.markAsCompleteStatus.fetchState]);const k=S(T=>O(T)),b=S(T=>ee(T,k.companyId)),j=h.fetchState,F=h.allAccountList,V=h.allClassList,L=h.scheduleDetailsLocalData;let x;if(i!=="new"&&(x=i),m!==!0||h.fetchState==="Error")return l.jsx(ie,{});const _=j==="Completed"&&o===!0;return j!=="Completed"?l.jsx(Qe,{}):l.jsxs(ds,{children:[_===!0?l.jsx(Z,{analytics:P,onLoad:()=>{ms(h,p,b)}}):null,l.jsx(rs,{location:a,vendorSearchEntityAutoCompleteView:C,vendorSearchAutoCompleteData:{autoCompleteText:f,entityAutoCompleteView:C},usedInExpenseAutomation:d,removeJeScheduleTransactionKey:(T,A)=>{s(Ct(T,A))},expenseAutomationSelectedPeriod:I,navigate:e,classList:V,accountList:F,scheduleLocalData:L[p],selectedJEScheduleKey:r,scheduleDetailId:x,selectedScheduledJournalEntries:h.selectedJEScheduleTransaction?.scheduledJournalEntry??[],themeState:t,tenantEmailDomain:n,scheduleTab:p,analytics:P,controllerUserDetails:b,isAccountingClassesEnabled:D,status:h.selectedJEScheduleTransaction?.status.code})]})},ps=(e,a)=>Ee(e)!=null&&a!=null,hs=e=>({transactionDate:e.date.format(Re),transactionAmount:e.amount,scheduleCategory:e.account.accountName,scheduleClass:e.classBase?.className??null,description:e.memo}),ms=(e,a,s)=>{const t=e.selectedJEScheduleTransaction?.baseTransaction,n=e.selectedJEScheduleTransaction,o=be(s.controllers),c=ke(s.controllerUserIds);var d;t!=null&&n!=null&&P.trackScheduleDetailsLoaded({scheduleType:a,transaction:{...hs(t)},scheduleExpenseCategoryAndClass:{expenseCategory:n.jeDebit.account?.accountName??null,expenseClass:n.jeDebit.accountingClass?.className??null},scheduledTransaction:{...(d=n,{currentBalance:d.balanceAsOfToday??null,currentStatus:d.status.label,period:d.period??null,startMonth:d.startDate?.format(Re)??null,endMonth:d.endDate?.format(Re)??null})},vendorName:n.vendor.name??null,controllerEmails:o,controllerUserIds:c})},Ss={drawerLeftMargin:new Xe(0,0,100,200)},fs=G(function(e,a){const{jeScheduledTransaction:s,selectedJERow:t,scheduleType:n,isVendorBulkUpdateOnTransactionEnabled:o}=a,{scheduleDetailsLocalData:c,updateStatus:d}=he(e,a.scheduleType),u=O(e),i=c[n].jeScheduleDetails[t].jeLink,m=i.type==="recommended"?i.recommendedTransactionID:i.transactionDetailID,r=m!=null?na(e,m):void 0,p=R.getSignedInUser(),h=e.tenantState.currentTenantId,f={userId:p?.userId??"",sessionId:p?.zeniSessionId??"",tenantId:u.tenantId??h},C=u?.company?.companyInfo?.firstMonthOfFY??1;return{jeScheduledTransaction:s,transactionDetail:r,localData:c[n].jeScheduleDetails[t],saveStatus:d.fetchState,authParams:f,isVendorBulkUpdateOnTransactionEnabled:o,firstMonthOfFY:C,isDisabled:d.fetchState==="In-Progress"?"readonly":void 0,analytics:P,qboAppUrl:sa(et.qboRedirectionUrl)}},function(e,a){const{selectedJERow:s,jeScheduleDetailId:t,navigate:n}=a;return{onUpdateLocalData:o=>{const c=o.linkJETransaction.qboURL;c!=null&&e(la({scheduleType:a.scheduleType,jeScheduleDetailId:t,rowId:s,jeLink:c}))},onFetchTransactionClick:o=>{e(wt(o))},onSaveClick:()=>{e(Ge(a.scheduleType,t))},onBackClick:()=>{n("..",{relative:"path"})},onCancelClick:()=>{const o=a.jeScheduledTransaction.scheduledJournalEntry[s];e(oa({scheduleType:a.scheduleType,jeScheduleDetailId:t,rowId:s,originalScheduledJE:o})),n("..",{relative:"path"})}}})(In),gs=()=>{const e=Dn(),a=M(),s=Y(),{scheduleDetailId:t}=J(),n=re(),o=Ss.drawerLeftMargin.valuePx(n),{scheduleType:c}=J(),{useFeatureGate:d}=ne(),{isFeatureEnabled:u}=d(z.isVendorBulkUpdateOnTransactionEnabled),i=Ee(c)??"prepaid_expenses",[m,r]=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 p=S(D=>he(D,i));g.useEffect(()=>{p.fetchState==="Not-Started"&&a("..",{relative:"path"})},[]);const h=p.selectedJELinkRowIndex,f=h!=null?p.scheduleDetailsLocalData[i].jeScheduleDetails[h]?.jeLink:null,C=f?.type==="recommended"?f.recommendedTransactionID:f?.transactionDetailID;g.useEffect(()=>{C!=null&&s(wt(C))},[]),g.useEffect(()=>{f?.type==="recommended"&&m===!1&&h!=null&&(r(!0),s(aa({scheduleType:i,jeScheduleDetailId:t,rowId:h})))});const y=S(D=>O(D)),E=S(D=>ee(D,y.companyId));return l.jsx(Un,{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(vs,{onClick:D=>D.stopPropagation(),children:p.fetchState!=="Completed"||p.selectedJEScheduleTransaction==null||h==null?l.jsx(Ut,{fetchState:p.fetchState}):l.jsx(fs,{scheduleType:i,jeScheduleDetailId:t,selectedJERow:h,jeScheduledTransaction:p.selectedJEScheduleTransaction,isCOTEnabled:!1,navigate:a,scheduleTab:i,controllerUserDetails:E,isVendorBulkUpdateOnTransactionEnabled:u})})})},vs=U($t)`
|
|
26
|
-
display: flex;
|
|
27
|
-
min-height: 100%;
|
|
28
|
-
flex-direction: column;
|
|
29
|
-
`,xe=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"}},Te=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"}},Ce=()=>{const e=q(),a=Y(),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(ce(n))}},[e.pathname,s.currentTab,a]),s},se="accrued_expenses",xs=G(function(e,a){const s=O(e),t=me(e);return{tenantName:s.companyName,vendorTabsToShow:a.vendorTabsToShow,report:a.scheduleListReport,downloadParams:a.downloadParams,companyIncorporationDate:a.companyIncDate,vendorTabView:t,isAccountingClassesEnabled:ae(e)}},function(e,a){const{navigate:s}=a;return{onBackClick:()=>{s("../../..")},onVendorTabSelectionChanged:t=>{const n=xe(t);s(n),e(ce(Te(t)))},onSortOrderChanged:(t,n)=>{e(We({scheduleType:se,sortKey:t,sortOrder:n}))},onChangeSubTab:t=>{e(He({scheduleType:se,subTab:t}))},onSearchTextChanged:t=>{e(qe({scheduleType:se,searchText:t}))},onReloadReport:()=>{e(At(se))},onScroll:t=>{e(Ye({scheduleType:se,scrollYOffset:t}))},onClickNewButton:()=>{e(da()),e(ra()),P.trackScheduleAccruedDetailsNewRequested({scheduleType:"accrued_expenses"}),s("details/new")},onClickSchedule:t=>{e(ca({selectedJEScheduleKey:t}));const n=a.scheduleListReport.jeAccruedSchedules.find(o=>o.jeAccruedScheduleKey===t);s(`details/${n?.jeScheduleId}`)},updateDownloadStateHandler:t=>{e(ze({scheduleType:se,fetchState:t}))}}})(En),Ts=({vendorTabsToShow:e,previousTabPosition:a,setPreviousTabPosition:s})=>{const{isAiCfoOpen:t,setIsAiCfoOpen:n}=Se(),[o,c]=g.useState(!1),[d,u]=g.useState(!1),i=M(),m=Y(),{useFeatureGate:r}=ne(),p=de();Ce();const{isFeatureEnabled:h,isFeatureGateLoading:f}=r(z.isOpexByVendorFeatureEnabled),C=R.getSignedInUser(),y=S(v=>O(v)),E={userId:C?.userId??"",sessionId:C?.zeniSessionId??"",tenantId:y.tenantId},D=g.useMemo(()=>({authParams:E,jeScheduleEndPoint:`${X}/jeScheduleReports`,timezone:we(),companyName:y.companyName}),[]),[I,w]=g.useState(!1),k=S(v=>te(v)),b=S(v=>$e(v,"accrued_expenses")),j=e.includes("prepaid_expenses"),F=e.includes("fixed_assets"),V=e.includes("accrued_expenses");g.useEffect(()=>{(j||F||V)&&I===!1&&k!=="Completed"&&(m(ye()),w(!0))},[I]),g.useEffect(()=>{f===!1&&(m(De({shouldFetchAccruedExpenses:V,shouldFetchFixedAssets:!0,shouldFetchPrepaidExpenses:j,shouldFetchOpexByVendor:h,shouldFetchVendorsList:!1,shouldFetchFiling1099Vendor:!1})),c(!0))},[k,F,f,h]),g.useEffect(()=>{o===!1&&b==="Completed"&&m(At("accrued_expenses",{selectedTimeframe:Ke("accrued_expenses"),selectedCategoryId:"all"},!0))},[o,b]);const L=S(v=>ia(v,se)),{isAiCfoAccessEnabled:x,onAskAiCfoClick:_}=fe({isAiCfoOpen:t,setIsAiCfoOpen:n,mobileExploreReferrer:"Vendors — Accrued Expenses"});ge({isDataReady:L.fetchState==="Completed"});const T=S(v=>W(v).isReportGenerated);S(v=>W(v).fetchState)!=="Completed"||T!==!0||h!==!0||e.includes("operating_expenses_by_vendor")||e.splice(1,0,"operating_expenses_by_vendor"),V||i("../opex");const A=S(v=>ee(v,y.companyId)),$=v=>{u(v)};return l.jsxs(l.Fragment,{children:[l.jsx(ve,{isAppContentDrawerOpen:d,handleDrawerToggle:$}),l.jsx(xs,{navigate:i,previousTabPosition:a,setPreviousTabPosition:s,scheduleListReport:L,downloadParams:D,themeState:p,vendorTabsToShow:e,analytics:P,controllerUserDetails:A,isAiCfoAccessEnabled:x,onAskAiCfoClick:_,onClickMenuIcon:()=>$(!0)})]})},oe="fixed_assets",Cs=G(function(e,a){const s=O(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:ae(e)}},function(e,a){const{navigate:s}=a;return{onBackClick:()=>{s("../../..")},onVendorTabSelectionChanged:t=>{const n=xe(t);s(n),e(ce(Te(t)))},onSortOrderChanged:(t,n)=>{e(We({scheduleType:oe,sortKey:t,sortOrder:n}))},onChangeSubTab:t=>{e(He({scheduleType:oe,subTab:t}))},onSearchTextChanged:t=>{e(qe({scheduleType:oe,searchText:t}))},onReloadReport:()=>{e(Ae(oe))},onScroll:t=>{e(Ye({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(ze({scheduleType:oe,fetchState:t}))}}})(Nt),ys=({vendorTabsToShow:e,previousTabPosition:a,setPreviousTabPosition:s})=>{const{isAiCfoOpen:t,setIsAiCfoOpen:n}=Se(),[o,c]=g.useState(!1),d=M(),u=Y();Ce();const{useFeatureGate:i}=ne(),m=de(),{isFeatureEnabled:r,isFeatureGateLoading:p}=i(z.isOpexByVendorFeatureEnabled),h=R.getSignedInUser(),f=S(v=>O(v)),C={userId:h?.userId??"",sessionId:h?.zeniSessionId??"",tenantId:f.tenantId},y=g.useMemo(()=>({authParams:C,jeScheduleEndPoint:`${X}/jeScheduleReports`,timezone:we(),companyName:f.companyName}),[]),[E,D]=g.useState(!1),I=S(v=>te(v)),w=S(v=>$e(v,"fixed_assets")),k=e.includes("prepaid_expenses"),b=e.includes("fixed_assets"),j=e.includes("accrued_expenses");g.useEffect(()=>{(k||b||j)&&E===!1&&I!=="Completed"&&(u(ye()),D(!0))},[E]),g.useEffect(()=>{p===!1&&(u(De({shouldFetchAccruedExpenses:j,shouldFetchFixedAssets:!0,shouldFetchPrepaidExpenses:k,shouldFetchOpexByVendor:r,shouldFetchVendorsList:!1,shouldFetchFiling1099Vendor:!1})),c(!0))},[I,b,p,r]),g.useEffect(()=>{o===!1&&w==="Completed"&&u(Ae("fixed_assets",{selectedTimeframe:Ke("fixed_assets"),selectedCategoryId:"all"},!0))},[o,w]);const F=S(v=>jt(v,oe)),{isAiCfoAccessEnabled:V,onAskAiCfoClick:L}=fe({isAiCfoOpen:t,setIsAiCfoOpen:n,mobileExploreReferrer:"Vendors — Fixed Assets"});ge({isDataReady:F.fetchState==="Completed"});const x=S(v=>W(v).isReportGenerated);S(v=>W(v).fetchState)!=="Completed"||x!==!0||r!==!0||e.includes("operating_expenses_by_vendor")||e.splice(1,0,"operating_expenses_by_vendor"),b||d("../opex");const _=S(v=>ee(v,f.companyId)),[T,A]=g.useState(!1),$=v=>{A(v)};return l.jsxs(l.Fragment,{children:[l.jsx(ve,{isAppContentDrawerOpen:T,handleDrawerToggle:$}),l.jsx(Cs,{navigate:d,scheduleListReport:F,downloadParams:y,previousTabPosition:a,setPreviousTabPosition:s,themeState:m,vendorTabsToShow:e,analytics:P,controllerUserDetails:_,isAiCfoAccessEnabled:V,onAskAiCfoClick:L,onClickMenuIcon:()=>{$(!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
|
-
`,Is=G(function(e,a){const s=R.getSignedInUser(),t=e.tenantState.currentTenantId,n=O(e),o=n?.companyName??"",c={userId:s?.userId??"",sessionId:s?.zeniSessionId??"",tenantId:t??""},d=W(e),u=ua(e);return{report:d,uiState:u,isAccountingClassesEnabled:ae(e),analytics:P,vendorTabsToShow:a.vendorTabsToShow,downloadParams:{downloadState:u.downloadState,currentTenantCompanyName:o,statementEndPoint:`${X}/opexByVendor`,authParams:c,timezone:we()}}},function(e,a){const{navigate:s}=a;return{onFetchOpExByVendors:(t,n,o)=>{e(Ta(t,n,o))},onVendorNameAndBalanceClicked:(t,n)=>{if(a.tenantEmailDomain!=null){const o=at(t.id,t.qboId,a.tenantEmailDomain,n),c=N(a.location.state?.pathnameStackToGoBack,a.location.pathname);a.navigate(o,{state:{pathnameStackToGoBack:c,referrer:"Operating Expenses By Vendor"}})}},onReloadReport:()=>{e(xa(!0))},onBackClick:()=>{s("../../dashboard")},onTimeframeSelectionChanged:t=>{e(va(t))},onAdditionalBalanceSelectionChanged:(t,n)=>{e(ga({isCompareModeOn:t,additionalBalances:n}))},onSortOrderChanged:(t,n,o)=>{e(fa({sortkey:n,sortOrder:t,timeframe:o}))},onVendorTabSelectionChanged:t=>{const n=xe(t);s(n),e(ce(Te(t)))},onSortOrSearchStarted:t=>{e(Sa(t))},onPageFetchStarted:()=>{e(ma(!0))},updateDownloadStateHandler:t=>{e(ha(t))},onClearSearch:t=>{e(pa({timeframe:t}))}}})(kn);function Es({vendorTabsToShow:e,previousTabPosition:a,setPreviousTabPosition:s}){const{isAiCfoOpen:t,setIsAiCfoOpen:n}=Se(),o=M(),c=Y(),d=q(),{tenantEmailDomain:u}=J(),i=re(),m=R.getSignedInUser(),{useFeatureGate:r}=ne(),{isFeatureEnabled:p,isFeatureGateLoading:h}=r(z.isOpexByVendorFeatureEnabled),f=S(_=>W(_));if(m==null)throw Error("Can't access opex by vendor page without signing in...");Ce();const[C,y]=g.useState(!1),E=S(_=>te(_)),D=e.includes("prepaid_expenses"),I=e.includes("fixed_assets"),w=e.includes("accrued_expenses"),k=S(_=>me(_)),{isAiCfoAccessEnabled:b,onAskAiCfoClick:j}=fe({isAiCfoOpen:t,setIsAiCfoOpen:n,mobileExploreReferrer:"Vendors — Operating Expenses by Vendor"});ge({isDataReady:f.fetchState==="Completed"&&f.isReportGenerated===!0});const{areTenantIdsInSync:F}=bn();g.useEffect(()=>{(D||I||w)&&C===!1&&E!=="Completed"&&F&&(c(ye()),y(!0))},[C,F]),g.useEffect(()=>{F&&c(De({shouldFetchAccruedExpenses:w,shouldFetchFixedAssets:I,shouldFetchPrepaidExpenses:D,shouldFetchOpexByVendor:p===!0&&h===!1,shouldFetchVendorsList:!1,shouldFetchFiling1099Vendor:!1}))},[E,I,h,p,F]),f.fetchState!=="Completed"||f.isReportGenerated!==!0||p!==!0||e.includes("operating_expenses_by_vendor")||e.splice(1,0,"operating_expenses_by_vendor"),(f.isReportGenerated===!1&&f.fetchState==="Completed"||p===!1&&h===!1)&&o("../summary");const[V,L]=g.useState(!1),x=_=>{L(_)};return l.jsxs(Ds,{windowSize:i,children:[f.fetchState==="Completed"?l.jsx(Z,{analytics:P,onLoad:_=>{k.previousTab==null?_.trackVendorOperatingExpensesPageLoaded("Side Panel"):_.trackVendorOperatingExpenses(k.currentTab,k.previousTab??null)}}):null,l.jsx(ve,{isAppContentDrawerOpen:V,handleDrawerToggle:x}),l.jsx(Is,{location:d,navigate:o,previousTabPosition:a,setPreviousTabPosition:s,tenantEmailDomain:u,vendorTabsToShow:e,isAiCfoAccessEnabled:b,onAskAiCfoClick:j,onClickMenuIcon:()=>{x(!0)}})]})}const le="prepaid_expenses",bs=G(function(e,a){const s=O(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:ae(e)}},function(e,a){const{navigate:s}=a;return{onBackClick:()=>{s("../../..")},onVendorTabSelectionChanged:t=>{const n=xe(t);s(n),e(ce(Te(t)))},onSortOrderChanged:(t,n)=>{e(We({scheduleType:le,sortKey:t,sortOrder:n}))},onChangeSubTab:t=>{e(He({scheduleType:le,subTab:t}))},onSearchTextChanged:t=>{e(qe({scheduleType:le,searchText:t}))},onReloadReport:()=>{e(Ae(le))},onScroll:t=>{e(Ye({scheduleType:le,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(ze({scheduleType:le,fetchState:t}))}}})(Nt),ks=({vendorTabsToShow:e,previousTabPosition:a,setPreviousTabPosition:s})=>{const{isAiCfoOpen:t,setIsAiCfoOpen:n}=Se(),[o,c]=g.useState(!1),d=M(),u=Y(),{useFeatureGate:i}=ne(),m=de();Ce();const r=R.getSignedInUser(),{isFeatureEnabled:p,isFeatureGateLoading:h}=i(z.isOpexByVendorFeatureEnabled),f=S(v=>O(v)),C=S(v=>$e(v,"prepaid_expenses")),y={userId:r?.userId??"",sessionId:r?.zeniSessionId??"",tenantId:f.tenantId},E=g.useMemo(()=>({authParams:y,jeScheduleEndPoint:`${X}/jeScheduleReports`,timezone:we(),companyName:f.companyName}),[]),[D,I]=g.useState(!1),w=S(v=>te(v)),k=e.includes("prepaid_expenses"),b=e.includes("fixed_assets"),j=e.includes("accrued_expenses");g.useEffect(()=>{(k||b||j)&&D===!1&&w!=="Completed"&&(u(ye()),I(!0))},[D]),g.useEffect(()=>{o===!1&&C==="Completed"&&u(Ae("prepaid_expenses",{selectedTimeframe:Ke("prepaid_expenses"),selectedCategoryId:"all"},!0))},[o,C]),g.useEffect(()=>{h===!1&&(u(De({shouldFetchAccruedExpenses:j,shouldFetchFixedAssets:b,shouldFetchPrepaidExpenses:!0,shouldFetchOpexByVendor:p,shouldFetchVendorsList:!1,shouldFetchFiling1099Vendor:!1})),c(!0))},[w,b,h,p]);const F=S(v=>jt(v,le)),{isAiCfoAccessEnabled:V,onAskAiCfoClick:L}=fe({isAiCfoOpen:t,setIsAiCfoOpen:n,mobileExploreReferrer:"Vendors — Prepaid Expenses"});ge({isDataReady:F.fetchState==="Completed"});const x=S(v=>W(v).isReportGenerated);S(v=>W(v).fetchState)!=="Completed"||x!==!0||p!==!0||e.includes("operating_expenses_by_vendor")||e.splice(1,0,"operating_expenses_by_vendor"),k||d("../opex");const _=S(v=>ee(v,f.companyId)),[T,A]=g.useState(!1),$=v=>{A(v)};return l.jsxs(l.Fragment,{children:[l.jsx(ve,{isAppContentDrawerOpen:T,handleDrawerToggle:$}),l.jsx(bs,{navigate:d,previousTabPosition:a,setPreviousTabPosition:s,scheduleListReport:F,downloadParams:E,themeState:m,vendorTabsToShow:e,analytics:P,controllerUserDetails:_,isAiCfoAccessEnabled:V,onAskAiCfoClick:L,onClickMenuIcon:()=>{$(!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
|
-
`,As=G(function(e,a){const{isFiling1099FeatureEnabled:s,vendorDetailView:t,selectedVendor:n,firstMonthOfFY:o,currentTenant:c,currentUserRoleMap:d}=a,u=R.getSignedInUser(),i={userId:u?.userId??"",sessionId:u?.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:d?.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:d,location:u,firstMonthOfFY:i}=a,m=()=>{const r=Ze(u.state?.pathnameStackToGoBack),p=r.poppedPathname??((h=2)=>{let f=h;a.isTrendPeriodSelected===!0&&(f=5);let C="../";for(let y=0;y<f;y++)C=`${C}../`;return C})(1);s(p,{state:{pathnameStackToGoBack:r.newStack}})};return{onSaveVendor:()=>{t!=null&&((r,p)=>{const{vendorId:h,vendorName:f,existingCategory:C,existingClass:y,existingOwner:E,selectedCategory:D,selectedClass:I,selectedOwner:w,isRecommendedCategorySelected:k,isRecommendedClassSelected:b,categoryRecommendationTypeSelected:j,classRecommendationTypeSelected:F}=Oa(r,p);h!=null&&P.trackVendorDetailsSave(h,f??"",C,y,E,D,I,w,k,b,j,F)})(t?.vendorViewDetails,t?.vendorViewDetails.ownerList),n!=null&&e(La(n,void 0))},onVendorSpendTrendFilterTabClick:r=>{e(Va(r))},saveVendorDetailLocalData:r=>{n!=null&&e(_a({vendorId:n,localData:r}))},saveContactsInVendorTabDetailLocalData:(r,p)=>{e(Pa({vendorId:r,localData:{contacts:p}}))},onCancelClick:()=>{var r;t?.vendorViewDetails.vendorView?.vendorBasic!=null&&(r=t.vendorViewDetails.vendorView.vendorBasic).id!=null&&P.trackVendorDetailsCancel(r.id??"",r.name,r.account?.accountName,r.class?.className,r.owner?.email),e(lt()),e(it()),e(ct()),e(dt()),m()},handleSpendTrendPercentChangeClick:()=>{var r;t?.vendorViewDetails.vendorView?.vendorBasic!=null&&(r=t.vendorViewDetails.vendorView?.vendorBasic,r.id!=null&&P.trackVendorDetailsSpendTrendHotlinkClicked(r.id??"",r.name,r.account?.accountName,r.class?.className,r.owner?.email))},onSaveSuccess:()=>{n!=null&&e(Fa("Not-Started",n)),e(lt()),e(it()),e(ct()),e(dt()),m()},onTrendSelectedPeriodChange:r=>{if(r==null)o!=null&&e(Fe(c,"EntityDetail",{timeframe:"quarter",timePeriod:o}));else{const p=r.currentTimePeriod==null?r.addTimePeriod:{startDate:r.addTimePeriod.startDate,endDate:r.currentTimePeriod.endDate};e(_e(c,"EntityDetail",{timeframe:r.timeframe,timePeriod:r.addTimePeriod},i)),e(Fe(c,"EntityDetail",{timeframe:r.timeframe,timePeriod:p}))}},onVendorTabSelectionChanged:r=>{e(ja(r))},onAddressClick:(r,p)=>{if(d==null)return;const h=$n(d,r,p),f=N(u.state?.pathnameStackToGoBack,u.pathname);s(h,{state:{pathnameStackToGoBack:f}})},onVendorDetailUIChange:r=>{e(Aa({collapsableStatus:r}))},onTransactionItemClick:r=>{const p=`${H(r,d)}`,h=N(u.state?.pathnameStackToGoBack,u.pathname);s(p,{state:{pathnameStackToGoBack:h}})},onLoadPreviousTransactionsClick:(r,p)=>{e(Pt({timePeriod:Pe(r),numberOfQuartersFetched:p})),e(_t(c,Pe(r),!0,!0))}}})(An);function pt({referrerType:e,isFiling1099FeatureEnabled:a}){const s=Y(),t=q(),n=M(),o=wn(),[c,d]=g.useState(!1),[u,i]=g.useState(!1),[m,r]=g.useState(!1),p=J(),h=p.vendorId,f=p.qboId,{tenantEmailDomain:C,timeframe:y,startDate:E,endDate:D}=p,I={id:f??"",name:"",type:"vendor",zeniId:h??"",qboId:f??""};g.useEffect(()=>{y!=null&&E!=null&&D!=null?d(!0):(d(!1),m===!1&&(r(!0),s(Fe(I,"EntityDetail"))))},[y,E,D]);const w=re(),k=S(v=>O(v)),b=S(v=>h!=null?Ca(v,h,I):void 0),j=S(v=>v.vendorState.vendorByID[h??""]),F=S(v=>O(v).company?.companyInfo.firstMonthOfFY??1),V=S(()=>ya(F,2)),L=Pe({startDate:V.startDate,endDate:Da()}),x=Ia(F),_=S(v=>Ea(v.trendWithTransactionsState,I,"EntityDetail")),[T,A]=g.useState(!1),$=c===!1&&m===!1?void 0:_?.selectedPeriod?.timePeriod??x;return g.useEffect(()=>(e==null&&b?.fetchState!=="Not-Started"||h==null||s(ba(h,I)),()=>{e!=null&&h!=null&&s(ka(h))}),[h,t.state,s]),g.useEffect(()=>{b?.fetchState==="Completed"&&b?.vendorViewDetails.vendorView?.vendorBasic!=null&&((v,ue,je)=>{v.id!=null&&P.trackVendorDetails(v.id,v.name,je,v.account?.accountName,v.class?.className,v.owner?.email,ue.percentChange,ue.last30DaysSpend,ue.last90DaysSpend,ue.yearToDateSpend)})(b?.vendorViewDetails.vendorView?.vendorBasic,b?.vendorSpend,e),A(!1)},[b?.fetchState]),g.useEffect(()=>{if(b?.fetchState==="Completed"&&T===!1){$!=null&&c===!1&&(s(_e(I,"EntityDetail",{timeframe:_?.selectedPeriod?.timeframe??"quarter",timePeriod:$},F)),A(!0));const v=Ie.getLocalizedStrings().dateFormat.analytics;if(c===!0&&y!=null&&E!=null&&D!=null){A(!0);const ue=y,je={startDate:ot(E,v.YYYYDashMMDashDDFormat),endDate:ot(D,v.YYYYDashMMDashDDFormat)};s(_e(I,"EntityDetail",{timeframe:ue,timePeriod:je}))}}},[b?.fetchState,$,_?.selectedPeriod?.timeframe,c,F]),g.useEffect(()=>{b?.fetchState==="Completed"&&u===!1&&(s(Pt({timePeriod:L,numberOfQuartersFetched:3})),s(_t(I,b.allTransactionsTabData?.timePeriod??L,!1,!0)),i(!0))},[b?.fetchState,u]),h==null?l.jsx(ie,{}):l.jsx(ws,{windowSize:w,children:l.jsx(As,{location:t,navigate:n,isFiling1099FeatureEnabled:a,vendorDetailView:b,vendorId:h,currentTenant:k,selectedVendor:j,firstMonthOfFY:F,isTrendPeriodSelected:c,selectedPeriodTimePeriod:_?.selectedPeriod?.timePeriod,defaultTransactionTimePeriod:x,vendorEntity:I,currentUserRoleMap:o?.loggedInUserRoleMap,tenantEmailDomain:C})})}const js=Ie.getLocalizedStrings().spendManagement.billPay.vendorCreation.vendorDetails,Fs={containerWidth:new Xe(100,58)},Ps=U(Fn)`
|
|
46
|
-
width: ${Q.sp4};
|
|
47
|
-
height: ${Q.sp4};
|
|
48
|
-
cursor: pointer;
|
|
49
|
-
color: ${e=>e.theme.colors.brandColorJade};
|
|
50
|
-
`,_s=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
|
-
`,Vs=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
|
-
`,Ls=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 d={fetchState:"Not-Started",error:void 0};return a.vendorId!=null&&(d=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:P,entityId:a.billId,fetchVendorFetchStatus:d,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(Ua({w9FormFile:t.files[0]})),t.w9_form[0]!=null)){e(Na({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(Jt({addressType:"vendor_address",addressToCreate:n}))}},updateInvoiceUploadFetchState:t=>{e(Ve({fetchState:t,error:void 0}))},onSkipAutofill:t=>{e(Ra(t))},onVendorFiling1099UploadDetailsSave:t=>{e(Bt(t))},onDeleteClick:()=>{e(Ve({fetchState:"Not-Started",error:void 0})),e(Ot({vendorId:s,w9Documents:[]}))}}})(_n);function ht({appContent:e,showFullScreenSkeletonWhileLoading:a}){const s=Y(),t=M(),{vendorId:n}=J(),o=re(),c=de(),d=R.getSignedInUser(),[u,i]=g.useState(!1),{useFeatureGate:m}=ne(),{isFeatureEnabled:r}=m(z.isVendorRecommendationFeatureEnabled),p=S(x=>O(x)).companyName,h=new AbortController,f=h.signal;let C,y,E,D,I;if(n==null)throw new Error("Vendor ID not found for Vendor Filing 1099 Details Screen");C=S(x=>Vt(x,n)),y=S(x=>x.vendorFiling1099UploadDetailsState.vendor1099DetailsSaveStatus),E=S(x=>x.vendorViewState.editVendorStateById[n]?.fetchStatus),I=S(x=>x.vendorFiling1099UploadDetailsState.vendor1099DetailsLocalData.w9Documents?.[0]),D=S(x=>x.vendorFiling1099UploadDetailsState);const w=E?.fetchState==="In-Progress"||D?.w9FormUploadStatus?.fetchState==="In-Progress",k=()=>{c.toggle()};g.useEffect(()=>()=>{h.abort(),s(Lt(n))},[]),g.useEffect(()=>{u||n!=null&&(i(!0),s(Ba(!1,n,f)))},[n]);const b=Be(E?.fetchState),j=Be(y?.fetchState),F=C.vendor?.contactIds,V=F?.[F.length-1],L=S(x=>x.contactState.contactById[V]);if(g.useEffect(()=>{n!=null&&b==="In-Progress"&&E?.fetchState==="Completed"&&C?.vendor!=null&&(s(Ja(n,C.vendor,L)),C?.vendor.filing1099W9Files?.[0]!=null&&s(Ve({fetchState:"Completed",error:void 0})))},[n,C?.vendor]),g.useEffect(()=>{j==="In-Progress"&&y?.fetchState==="Completed"&&t("../../vendors/filing_1099")},[y?.fetchState]),a===!0&&E?.fetchState!=="Completed"&&E?.fetchState!=="Error")return l.jsx(Us,{children:l.jsx(jn,{})});if(d==null)throw Error("Can't access VendorFiling1099UploadScreen without signing in...");return l.jsxs(_s,{windowSize:o,children:[o!=="small"?l.jsxs(Bs,{children:[l.jsx(Ps,{onClick:k}),l.jsxs(Os,{showContent:d.userEmailDomain==="zeni.ai",children:[l.jsx(Js,{showAutofill:!1}),l.jsx(Rs,{showAutofill:!1,children:p})]})]}):null,l.jsx(Ls,{vendorId:n,file:I,showAutofill:!1,type:"w9",isVendorRecommendationEnabled:r,pdfTitle:I?js.w9FormTitle:void 0,showTitlebar:!0,showTitlebarIcon:!0,vendorLegalName:C?.vendor?.legalName,isLoading:w}),l.jsx(Vs,{windowSize:o,children:e})]})}const Os=U.div`
|
|
63
|
-
display: ${e=>e.showContent?"flex":"none"};
|
|
64
|
-
align-items: center;
|
|
65
|
-
`,Bs=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
|
-
`,Js=U.div`
|
|
73
|
-
width: 1px;
|
|
74
|
-
height: ${Q.sp3};
|
|
75
|
-
margin: ${Q.sp0} ${Q.sp3};
|
|
76
|
-
background-color: ${e=>e.showAutofill?Gt.neutralGrey1Light:e.theme.colors.hero};
|
|
77
|
-
`,Rs=U(Pn.StandardMedium)`
|
|
78
|
-
color: ${e=>e.showAutofill?Gt.neutralGrey5Light:e.theme.colors.primary};
|
|
79
|
-
`,Us=U.div`
|
|
80
|
-
width: 100%;
|
|
81
|
-
height: 100vh;
|
|
82
|
-
overflow: hidden;
|
|
83
|
-
background-color: ${e=>e.theme.colors.grey4};
|
|
84
|
-
`,Ns=G(function(e){const a=Ma(e);return{vendorDetailView:Ga(e),globalMerchantView:a}},function(e,a){const{navigate:s}=a;return{updateVendorDetailLocalData:t=>{e(Rt({vendorDetails:t}))},fetchRecommendation:t=>{e(Ka("tenant",t))},onSaveClick:()=>{e($a())},onBackClick:()=>{s("../review")}}})(Vn);function Ms(){const e=M();return l.jsx(Ns,{navigate:e})}const Gs=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
|
-
`,$s=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??""},d=O(e);return{vendorFirstReviewView:s,globalMerchantAutoCompleteData:{globalMerchantAutoCompleteView:s.globalMerchantAutoCompleteView,autoCompleteText:t},analytics:P,authParams:c,attachmentEndpoint:d.externalConnections?.accounting[0]?.connectionName==="netsuite"?`${X}/vendor_attachments_accounting_provider`:`${X}/vendor_attachments`}},function(e,a){const{navigate:s}=a;return{onFetchVendorReviewView:(t,n,o)=>{e(Le(t,n,o))},onGlobalMerchantAutoCompleteInputChange:(t,n)=>{t.trim().length>=2?e(Xa({searchString:t,globalMerchantType:n??"vendor"})):t.trim().length===0&&e(ut())},onUpdateLocalData:(t,n,o,c)=>{if(n!=null){const d=Ks(n);e(Za({vendorId:t,currentSelection:d,selectedGlobalMerchantId:o,vendorRenamedText:c}))}},onResetVendorLocalData:t=>{e(Qa({vendorId:t}))},onVendorNameClick:(t,n)=>{if(a.tenantEmailDomain!=null){const o=at(t,n,a.tenantEmailDomain),c=N(a.location.state?.pathnameStackToGoBack,a.location.pathname);a.navigate(o,{state:{pathnameStackToGoBack:c}})}},onUpdatePageToken:t=>{e(Wa({pageToken:t}))},onUpdateSortUiState:(t,n)=>{e(Ha({sortOrder:t,sortKey:n}))},onUpdateScrollYOffset:t=>{e(qa({scrollYOffset:t}))},onClickSave:(t,n,o)=>{e(Ya(t,n,o))},onClickCancelPopup:()=>{e(za())},onClearGlobalMerchantAutoCompleteResults:()=>{e(ut())},onClickRedirectToQBO:()=>{window.open(`${et.qboRedirectionUrl}/vendors`,"_blank")},updateVendorDetailLocalData:t=>{e(Rt({vendorDetails:t})),s(`./vendor/${t.id}`)},onBackClick:()=>{s("../..")},onReloadList:()=>{e(Le(null))}}})(Ln);function mt(){const e=M(),a=Y(),s=q(),{tenantEmailDomain:t}=J(),n=re(),o=R.getSignedInUser(),{vendorId:c}=J(),d=S(p=>rt(p)),[u,i]=g.useState(!1),m=S(p=>rt(p).fetchState);if(g.useEffect(()=>{m==="Not-Started"&&u===!1&&(a(Le(null)),i(!0))},[]),o==null)throw Error("Can't access first review page without signing in...");const r=p=>p.trackPageLoaded(tt.Event.vendorTenantReviewListPage);return l.jsxs(l.Fragment,{children:[m==="Completed"?l.jsx(Z,{analytics:P,onLoad:r}):null,l.jsx(Z,{analytics:P,onLoad:r}),l.jsx(Kn,{isOpen:c!=null,drawerLeftMargin:new Xe(0,0,300,600),onClose:()=>{e("../review")},children:l.jsx(zs,{onClick:p=>p.stopPropagation(),children:l.jsx(Ms,{})})}),l.jsx(Gs,{windowSize:n,children:l.jsx($s,{location:s,navigate:e,vendorFirstReviewDetails:d,tenantEmailDomain:t})})]})}const Ks=e=>e.recommendedFirst===!0?"recommendedFirst":e.recommendedSecond===!0?"recommendedSecond":e.retain===!0?"retain":e.rename===!0?"rename":e.customMerchant===!0?"customMerchant":null,zs=U($t)`
|
|
93
|
-
display: flex;
|
|
94
|
-
min-height: 100%;
|
|
95
|
-
flex-direction: column;
|
|
96
|
-
`,Ys=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:P,vendorFiling1099UploadDetailsViewState:n,authParams:o,googleAPIKey:et.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:d}=s;return{onVendorFiling1099UploadDetailsSave:u=>{e(Bt(u)),P.trackVendor1099DetailSave(c.vendor.legalName??"")},onSaveChangesToLocalStore:u=>{e(Ot(u))},onResetVendorFiling1099FormStatus:()=>{e(en())},onAddressEditHandler:u=>{const i=Nn((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}))(u));e(Jt({addressType:"vendor_address",addressToCreate:i}))},goBackToListPage:()=>{e(Lt(o));const u=`/${d}/vendors/filing_1099/`,i=N(n.state?.pathnameStackToGoBack,n.pathname);t(u,{state:{pathnameStackToGoBack:i}})},onAddressClick:u=>{const i=function(r,p,h){let f=`/${r}/vendors/filing_1099/upload/${h}/edit`;return f=f.concat(`/new/${p}`),f}(d,u,o),m=N(n.state?.pathnameStackToGoBack,n.pathname);t(i,{state:{pathnameStackToGoBack:m}})},AddressFormPage:Bn}})(On);function qs(){const e=M(),a=q(),{vendorId:s}=J(),t=S(d=>O(d));let n;if(s==null)throw new Error("Vendor ID not found for Vendor Filing 1099 Details Screen");n=S(d=>Vt(d,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(Ys,{location:a,navigate:e,currentTenant:t,vendorId:s,vendorFiling1099UploadDetails:n,companyId:c})}const Hs=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
|
-
`,Ws=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(dn({sortOrder:n,sortKey:o}))},onUpdateSearchUiState:n=>{e(cn({searchString:n}))},onVendorRowClick:n=>{if(a.tenantEmailDomain!=null){const o=`/${a.tenantEmailDomain}/vendors/filing_1099/upload/${encodeURIComponent(n)}/edit`,c=N(a.location.state?.pathnameStackToGoBack,a.location.pathname);a.navigate(o,{state:{pathnameStackToGoBack:c}})}},onReloadVendors:()=>{e(Oe(!0))},onBackClick:()=>{e(on()),e(ln())},onVendorTabSelectionChanged:n=>{const o=xe(n);s(o),e(ce(Te(n)))},onAccountMappingChange:n=>{const{filing1099:o}=n,{bankAccount:c,expenseCategory1099:d}=o,u=zn(a.accountMappingView.bankAccounts1099FilingAccountList,c.selectedOptions),i=Yn(a.accountMappingView.expenseAccounts1099FilingAccountList,d),m={selectedBankAccounts1099FilingAccountIds:u.map(r=>r.accountId),selectedExpenseAccounts1099FilingAccountIds:i};e(sn({data:m}))},onSaveClick:()=>{e(nn()),t.track(tt.Event.vendor1099TabSettingsSave)}}})(Jn);function St({vendorTabsToShow:e,previousTabPosition:a,setPreviousTabPosition:s}){const{isAiCfoOpen:t,setIsAiCfoOpen:n}=Se(),o=M(),c=Y(),d=q(),{tenantEmailDomain:u}=J(),i=re(),m=R.getSignedInUser(),[r,p]=g.useState(!1),[h,f]=g.useState(!1);if(m==null)throw Error("Can't access vendor filing 1099 page without signing in...");Ce();const C=S(j=>tn(j)),y=S(j=>an(j)),{isAiCfoAccessEnabled:E,onAskAiCfoClick:D}=fe({isAiCfoOpen:t,setIsAiCfoOpen:n,mobileExploreReferrer:"Vendors — 1099"});ge({isDataReady:C.fetchState==="Completed"}),g.useEffect(()=>{h||(f(!0),c(Oe(!1)))},[h,f]),g.useEffect(()=>{y.saveState.fetchState==="Completed"&&c(Oe(!1))},[y.saveState.fetchState]);const I=j=>{p(j)},w=S(j=>O(j)),k={userId:m?.userId??"",sessionId:m?.zeniSessionId??"",tenantId:w.tenantId},b=g.useMemo(()=>({authParams:k,tenantName:w.companyName,filing1099ReportEndPoint:`${X}/filing1099Reports`}),[]);return l.jsxs(l.Fragment,{children:[C.fetchState==="Completed"?l.jsx(l.Fragment,{children:l.jsx(Z,{analytics:P,onLoad:()=>P.trackPageLoaded(tt.Event.vendor1099ListPage)})}):null,l.jsxs(Hs,{windowSize:i,children:[l.jsx(ve,{isAppContentDrawerOpen:r,handleDrawerToggle:I}),l.jsx(Ws,{location:d,navigate:o,previousTabPosition:a,setPreviousTabPosition:s,analytics:P,vendorsFiling1099ListDetails:C,vendorTypeList:C.vendorTypeList,accountMappingView:y,downloadParams:b,tenantEmailDomain:u,vendorTabsToShow:e,isAiCfoAccessEnabled:E,onAskAiCfoClick:D,onClickMenuIcon:()=>{I(!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
|
-
`,Zs=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:ae(e),analytics:P}},function(e,a){const{navigate:s}=a;return{onFetchVendorsList:(t="",n,o)=>{e(Sn({searchString:t,keepExistingListItems:n,view:"vendorsTab",pageToken:o}))},onUpdatePageToken:t=>{e(mn({pageToken:t}))},onUpdateSortUiState:(t,n)=>{e(hn({sortOrder:t,sortkey:n}))},onUpdateCurrentYTDSelection:t=>{e(pn({ytdSpendSelection:t}))},onVendorRowClick:(t,n)=>{if(a.tenantEmailDomain!=null){const o=at(t,n,a.tenantEmailDomain),c=N(a.location.state?.pathnameStackToGoBack,a.location.pathname);a.navigate(o,{state:{pathnameStackToGoBack:c,referrer:"Vendor List"}})}},onReloadVendors:()=>{console.log("Reload vendors")},onUpdateScrollYOffset:t=>{e(un({scrollYOffset:t}))},onBackClick:()=>{s("../..")},onVendorTabSelectionChanged:t=>{const n=xe(t);s(n),e(ce(Te(t)))}}})(Rn);function Xs({vendorTabsToShow:e,previousTabPosition:a,setPreviousTabPosition:s}){const{isAiCfoOpen:t,setIsAiCfoOpen:n}=Se(),o=M(),c=Y(),d=q(),{tenantEmailDomain:u}=J(),i=re(),m=R.getSignedInUser(),{useFeatureGate:r}=ne(),{isFeatureEnabled:p,isFeatureGateLoading:h}=r(z.isOpexByVendorFeatureEnabled);Ce();const f=e.includes("prepaid_expenses"),C=e.includes("fixed_assets"),y=e.includes("accrued_expenses"),E=S(A=>me(A));let D={};D=S(A=>rn(A,"vendorsTab"));const[I,w]=g.useState(!1),{isAiCfoAccessEnabled:k,onAskAiCfoClick:b}=fe({isAiCfoOpen:t,setIsAiCfoOpen:n,mobileExploreReferrer:"Vendors Summary"});ge({isDataReady:D.fetchState==="Completed"});const j=S(A=>te(A)),F=S(A=>W(A).isReportGenerated);S(A=>W(A).fetchState)==="Completed"&&F&&p&&!e.includes("operating_expenses_by_vendor")&&e.splice(1,0,"operating_expenses_by_vendor");const[V,L]=g.useState(!1);if(g.useEffect(()=>{(f||C)&&V===!1&&j!=="Completed"&&(c(ye()),L(!0))},[V]),g.useEffect(()=>{c(De({shouldFetchAccruedExpenses:y,shouldFetchFixedAssets:C,shouldFetchPrepaidExpenses:f,shouldFetchOpexByVendor:p&&h===!1,shouldFetchVendorsList:!0,shouldFetchFiling1099Vendor:!1}))},[j,C,h,p]),g.useEffect(()=>{I||D.fetchState!=="Completed"||(w(!0),P.trackVendorList(E.currentTab,E.previousTab??null,D.totalVendorCount,D.uiState.sortKey,D.uiState.ytdSpendSelection))},[D.fetchState]),m==null)throw Error("Can't access address page without signing in...");const[x,_]=g.useState(!1),T=A=>{_(A)};return l.jsxs(Qs,{windowSize:i,children:[l.jsx(ve,{isAppContentDrawerOpen:x,handleDrawerToggle:T}),l.jsx(Zs,{location:d,navigate:o,vendorsListDetails:D,tenantEmailDomain:u,vendorTabsToShow:e,onClickMenuIcon:()=>{T(!0)},previousTabPosition:a,setPreviousTabPosition:s,isAiCfoAccessEnabled:k,onAskAiCfoClick:b})]})}function bo(){const{useFeatureGate:e}=ne(),a=q().state?.referrer,[s,t]=g.useState(!1),[n,o]=g.useState(0),c=R.getSignedInUser(),d=fn(c),{isFeatureEnabled:u}=e(z.isOpexByVendorFeatureEnabled),{isFeatureEnabled:i}=e(z.isVendorReviewFeatureEnabled),{isFeatureEnabled:m}=e(z.isScheduledJEPrepaidExpensesFeatureEnabled),{isFeatureEnabled:r}=e(z.isScheduledJEFixedAssetsFeatureEnabled),{isFeatureEnabled:p}=e(z.isScheduledJEAccruedExpensesFeatureEnabled),{isFeatureEnabled:h}=e(z.isFiling1099FeatureEnabled),f=S(w=>O(w)),C=f?.externalConnections?.accounting[0]?.connectionName,y=["vendors_tab"];C!=="netsuite"&&m===!0&&y.push("prepaid_expenses"),C!=="netsuite"&&r===!0&&y.push("fixed_assets"),C!=="netsuite"&&p===!0&&y.push("accrued_expenses"),C!=="netsuite"&&h&&d&&(y.push("filing_1099"),u&&y.splice(1,0,"operating_expenses_by_vendor"));const{isFeatureEnabled:E}=e(z.isDebitCardFeatureEnabled),D=gn(E,f),I=vn(f);return D===!0||I===!0?l.jsx(nt,{children:l.jsx(B,{path:"/*",element:l.jsx(Gn,{})})}):l.jsxs(nt,{children:[l.jsx(B,{path:"/opex",element:u===!0?l.jsx(Es,{previousTabPosition:n,setPreviousTabPosition:o,vendorTabsToShow:y}):l.jsx(K,{to:"../summary"})}),l.jsx(B,{path:"/summary",element:l.jsx(Xs,{previousTabPosition:n,setPreviousTabPosition:o,vendorTabsToShow:y})}),l.jsx(B,{path:"schedules/fixed_assets/details/:scheduleDetailId",element:r===!0?l.jsx(os,{}):l.jsx(K,{to:"../../vendors/opex"})}),l.jsx(B,{path:"schedules/accrued_expenses/details/:scheduleDetailId",element:r===!0?l.jsx(es,{shouldNavigateBack:s,setShouldNavigateBack:t}):l.jsx(K,{to:"../../vendors/opex"})}),l.jsx(B,{path:"schedules/:scheduleType/details/:scheduleDetailId",element:m===!0?l.jsx(us,{}):l.jsx(K,{to:"../../vendors/opex"})}),l.jsx(B,{path:"schedules/:scheduleType/details/:scheduleDetailId/edit_link",element:m===!0||r===!0?l.jsx(gs,{}):l.jsx(K,{to:"../../vendors/opex"})}),l.jsx(B,{path:"schedules/accrued_expenses/details/:scheduleDetailId/edit_link",element:p===!0?l.jsx(Wn,{setShouldNavigateBack:t}):l.jsx(K,{to:"../../vendors/opex"})}),l.jsx(B,{path:"schedules/prepaid_expenses",element:m===!0?l.jsx(ks,{previousTabPosition:n,setPreviousTabPosition:o,vendorTabsToShow:y}):l.jsx(K,{to:"../opex"})}),l.jsx(B,{path:"schedules/fixed_assets",element:r===!0?l.jsx(ys,{previousTabPosition:n,setPreviousTabPosition:o,vendorTabsToShow:y}):l.jsx(K,{to:"../opex"})}),l.jsx(B,{path:"schedules/accrued_expenses",element:p===!0?l.jsx(Ts,{previousTabPosition:n,setPreviousTabPosition:o,vendorTabsToShow:y}):l.jsx(K,{to:"../opex"})}),l.jsx(B,{path:"/filing_1099",element:h&&d?l.jsx(St,{previousTabPosition:n,setPreviousTabPosition:o,vendorTabsToShow:y}):l.jsx(K,{to:"../opex"})}),l.jsx(B,{path:"/filing_1099/:vendorId",element:h&&d?l.jsx(St,{vendorTabsToShow:y,previousTabPosition:n,setPreviousTabPosition:o}):l.jsx(K,{to:"../opex"})}),l.jsx(B,{path:"/filing_1099/upload/:vendorId/edit",element:h&&d?l.jsx(ht,{appContent:l.jsx(qs,{}),showFullScreenSkeletonWhileLoading:!0}):l.jsx(K,{to:"../opex"})}),l.jsx(B,{path:"/filing_1099/upload/:vendorId/edit/new/:addressType",element:h&&d?l.jsx(ht,{appContent:l.jsx(Mn,{isSubPage:!0,hideAddressBackButton:!0,hideAddressSubTitle:!0})}):l.jsx(K,{to:"../opex"})}),l.jsx(B,{path:"/summary/:vendorId/:qboId",element:l.jsx(pt,{referrerType:a,isFiling1099FeatureEnabled:h&&d})}),l.jsx(B,{path:"/summary/:vendorId/:qboId/:timeframe/:startDate/:endDate",element:l.jsx(pt,{referrerType:a,isFiling1099FeatureEnabled:h&&d})}),l.jsx(B,{path:"/review",element:i===!0?l.jsx(mt,{}):l.jsx(ie,{})}),l.jsx(B,{path:"/review/vendor/:vendorId",element:i?l.jsx(mt,{}):l.jsx(ie,{})}),l.jsx(B,{path:"/",element:l.jsx(K,{to:"summary"})}),l.jsx(B,{path:"*",element:l.jsx(ie,{})})]})}export{bo as default};
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import{j as o}from"./liveblocks-BJogRArg.js";import{a as f}from"./sentry-WdXgkw90.js";import{q as u,h,g as y,N as I}from"./core-BojUR2ky.js";import{ID as b,eO as w,yY as x}from"./zeni-epic-state-BJsXImBw.js";import{z as l,B as j,E as S,F as D}from"./index-Dw0sYJvv.js";import{n as g}from"./mui-Bg09VkiQ.js";import"./recharts-CYOGURoz.js";import"./analytics-C7fHeQaW.js";import"./plaid-DLEkn0-3.js";import"./dnd-CxlDz5d0.js";import"./stripe-DMRn4zHo.js";import"./lottie-Cn4ueTxI.js";import"./lexical-BsuE2Lsd.js";import"./pdf-unrI9041.js";import"./utils-CJNmQJBz.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]="8f948297-feb9-4609-95a6-ae40d3f9ce27",e._sentryDebugIdIdentifier="sentry-dbid-8f948297-feb9-4609-95a6-ae40d3f9ce27")}catch{}})();const W=()=>{const[e]=u(),t=e.get("code")??"",s=e.get("state")??"",p=e.get("profileId")??"",[n,c]=f.useState(!1),a=h(),i=y(m=>b(m)),r=l.getSignedInUser(),d=l.getSignedInUserTenantWithId(s);if(r==null||d==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,d?.tenantId),f.useEffect(()=>{n||(c(!0),a(x(t,p,s)))},[n,a]),i.fetchState==="Error"?o.jsx(E,{children:o.jsx(_,{children:i.error?.message??""})}):(i.fetchState==="Completed"&&window.close(),o.jsx(j,{fetchState:"In-Progress"}))},E=g.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
|
-
`,_=g(D.LargeRegular)`
|
|
10
|
-
display: flex;
|
|
11
|
-
color: ${S.important};
|
|
12
|
-
`;export{W as default};
|
|
@@ -1,66 +0,0 @@
|
|
|
1
|
-
import{j as n}from"./liveblocks-BJogRArg.js";import{j as H,u as W,h as z,l as Z,g as w,k as Y,N as ne,n as $e,o as k}from"./core-BojUR2ky.js";import{eN as N,Nq as we,Nr as Ze,cj as te,ck as Ge,fa as He,w9 as Ae,Am as We,w3 as Fn,Ns as Rn,Nt as Ln,w6 as Un,wd as Ce,w0 as zn,vZ as Nn,Md as ue,Nu as Mn,DG as _n,Jj as Vn,DI as $n,k7 as Fe,Nv as Zn,pE as Ye,ps as Je,j_ as Qe,k1 as Re,Jk as Le,Jl as Gn,Nw as Hn,k0 as Wn,kn as Yn,jR as Jn,io as Qn,im as qn,Nx as Kn,Ny as xe,Dn as Xn,Nz as et,NA as nt,M6 as De,NB as Ue,NC as tt,DT as at,MQ as ot,Bg as qe,s5 as Ke,ND as st,DQ as it,NE as Xe,cL as Ie,DX as en,fb as rt,eR as nn,eT as Se,DV as ct,Ba as lt,DN as dt,NF as tn,NG as an,Dp as on,Dz as ze,NH as ut,Dt as pt,NI as mt,MF as ht,DY as gt,bv as ft,bD as yt,cv as Ct,bE as xt,bs as kt,Ik as wt}from"./zeni-epic-state-BJsXImBw.js";import{j as ae,a as V,z as D,p as B,h as M,B as pe,bP as At,O as be,q as _,C as J,v as sn,am as Dt,ab as Ne,d as R,bQ as It,ap as ve,bR as St,A as me,bS as bt,f as Ee,aJ as G,bT as vt,K as Et,J as rn,a8 as jt,bU as Me,bV as Pt,x as ee,bW as Tt,bX as Bt,bY as Ot,bZ as Ft,a5 as Rt,o as Lt}from"./index-Dw0sYJvv.js";import{n as L,D as Q,S as q}from"./mui-Bg09VkiQ.js";import de from"./NotFoundScreen-DYeXrX7_.js";import{S as _e}from"./SetupPagesScreen-5gu402_s.js";import{F as cn}from"./FeaturePreviewScreen-Bb7LAhIT.js";import{a as u}from"./sentry-WdXgkw90.js";import{M as he}from"./MobileAppDrawer-CsFu1SGJ.js";import{A as Ut,D as zt,V as Nt}from"./DomesticWireDetailScreen-DqS4Tcvr.js";import{A as Mt}from"./AddressScreen-Ca2p0J93.js";import{u as ln}from"./useAskAiCfoHostNavButtonProps-C3l35BIu.js";import{c as dn}from"./useFetchSuggestedQuestionsWhenReady-BonCp6Rh.js";import{Z as _t}from"./ZeniAccountStatementScreen-YO51ZD4a.js";import"./recharts-CYOGURoz.js";import"./analytics-C7fHeQaW.js";import"./plaid-DLEkn0-3.js";import"./dnd-CxlDz5d0.js";import"./stripe-DMRn4zHo.js";import"./lottie-Cn4ueTxI.js";import"./lexical-BsuE2Lsd.js";import"./pdf-unrI9041.js";import"./utils-CJNmQJBz.js";import"./analyticsHelper-BI0zNJMo.js";import"./routePaths-DriCJPaW.js";import"./BusinessVerificationPageScreen-CETF7Xs2.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]="5ba7c35b-1d23-4f36-b1a1-93041d24279e",e._sentryDebugIdIdentifier="sentry-dbid-5ba7c35b-1d23-4f36-b1a1-93041d24279e")}catch{}})();const Vt=L.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
|
-
`,$t=Y(function(e){return{autoTransferRuleView:we(e),downloadAccountDetailEndPoint:`${be}/account_details`,transferLimit:5e5,depositAccountListView:We(e.depositAccountState,e.depositAccountListState)}},function(e,t){const{navigate:s,handleDrawerToggle:o}=t;return{onBackClick:()=>{s("..")},onClickMenuIcon:()=>{o(!0)},onFetchAutoTransferRules:a=>{e(Ae(a))},onCreateRule:()=>{e(Nn())},onUpdateRule:a=>{e(Ce(a))},onDeleteClick:a=>{e(zn(a))},onPauseClick:a=>{e(Ce(a,!0,!1))},onResumeClick:a=>{e(Ce(a,!1,!0))},onActivityClick:(a,i)=>{e(Un(a,i))},onUpdateRuleLocalData:a=>{e(Ln(a))},clearRuleLocalData:()=>{e(Rn())},onEditClick:a=>{s(`./${a}/edit`)},onEditDrawerClose:()=>{s("../../",{relative:"path"})},onReviewClick:()=>{e(Fn())}}})(At);function Ve({isEditDrawerOpen:e}){const t=H(),s=W(),o=z(),a=ae(),{ruleId:i,tenantEmailDomain:d}=Z(),{useFeatureGate:c}=V(),[p,m]=u.useState(!1),[C,r]=u.useState(!1),l=w(y=>N(y)),h=w(y=>we(y)),x=h?.fetchState??"Not-Started",b=w(y=>Ze(y)),g=l?.companyId??D.getSignedInUserTenant(d)?.companyId,A=te(a?.loggedInUserRoleMap)||Ge(a?.loggedInUserRoleMap),{isFeatureEnabled:I}=c(B.isTreasuryEnabled),f=l?.company!=null&&He(l.company),S=I&&f,O=D.getSignedInUser(),U=l.tenantId,P={userId:O?.userId??"",sessionId:O?.zeniSessionId??"",tenantId:U??""},E=l.companyName;u.useEffect(()=>{!C&&x==="Not-Started"&&g&&(r(!0),o(Ae(!0)))},[C,x,g,o]);const v=y=>{m(y)},T=M(),j=!!s.state?.scrollToAddRule;return h?.fetchState!=="Completed"?n.jsx(pe,{fetchState:"In-Progress",style:{backgroundColor:T.colors.grey5}}):n.jsxs(Vt,{children:[n.jsx(he,{isAppContentDrawerOpen:p,handleDrawerToggle:v}),n.jsx($t,{navigate:t,location:s,currentTenant:l,companyName:E,handleDrawerToggle:v,isEditDrawerOpen:e,editingRuleId:i,authParams:P,includeTreasuryOption:S,hasAdminLevelAccess:A,zeniAccountsConfigDetail:b,scrollToAddRule:j})]})}const Zt={overlayWidth:new J(100,100,58)},Gt=({vendorId:e,isDrawerOpen:t,closeDrawerHandler:s})=>{const o=z(),a=M(),i=_();if(D.getSignedInUser()==null)throw Error("Can't access ach account page without signing in...");return n.jsx(Q,{onClose:()=>{s(!0),o(ue())},anchor:"right",open:t,PaperProps:{style:{width:Zt.overlayWidth.valuePercentage(i),boxShadow:"none"}},slotProps:{backdrop:{style:{backgroundColor:a.colors.black,opacity:.75,cursor:"pointer"}}},children:n.jsx(Ht,{onClick:d=>d.stopPropagation(),children:n.jsx(Ut,{vendorIdParam:e,accountContext:"express-pay"})})})},Ht=L(q)`
|
|
10
|
-
display: flex;
|
|
11
|
-
min-height: 100%;
|
|
12
|
-
flex-direction: column;
|
|
13
|
-
`,Wt={overlayWidth:new J(100,100,58)},Yt=({isDrawerOpen:e,closeDrawerHandler:t})=>{const s=z(),o=M(),a=_();if(D.getSignedInUser()==null)throw Error("Can't access address page without signing in...");return n.jsx(Q,{onClose:()=>{t(!0),s(ue())},anchor:"right",open:e,PaperProps:{style:{width:Wt.overlayWidth.valuePercentage(a),boxShadow:"none"}},slotProps:{backdrop:{style:{backgroundColor:o.colors.black,opacity:.75,cursor:"pointer"}}},children:n.jsx(Jt,{onClick:i=>i.stopPropagation(),children:n.jsx(Mt,{accountContext:"express-pay",addressTypeParam:"vendor_address"})})})},Jt=L(q)`
|
|
14
|
-
display: flex;
|
|
15
|
-
min-height: 100%;
|
|
16
|
-
flex-direction: column;
|
|
17
|
-
`,Qt={overlayWidth:new J(100,100,58)},qt=({vendorId:e,isDrawerOpen:t,closeDrawerHandler:s})=>{const o=z(),a=M(),i=_();if(D.getSignedInUser()==null)throw Error("Can't access ach account page without signing in...");return n.jsx(Q,{onClose:()=>{s(!0),o(ue())},anchor:"right",open:t,PaperProps:{style:{width:Qt.overlayWidth.valuePercentage(i),boxShadow:"none"}},slotProps:{backdrop:{style:{backgroundColor:a.colors.black,opacity:.75,cursor:"pointer"}}},children:n.jsx(Kt,{onClick:d=>d.stopPropagation(),children:n.jsx(zt,{vendorIdParam:e,accountContext:"express-pay"})})})},Kt=L(q)`
|
|
18
|
-
display: flex;
|
|
19
|
-
min-height: 100%;
|
|
20
|
-
flex-direction: column;
|
|
21
|
-
`,Xt=L.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: ${e=>e.theme.colors.grey4};
|
|
29
|
-
`,ea=Y(function(e,t){const s=N(e),o=D.getSignedInUser(),a=s.tenantId,i={userId:o?.userId??"",sessionId:o?.zeniSessionId??"",tenantId:a??""},d=t.expressPayDetails,c=e.entityAutoCompleteState.autoCompleteText.common,p=Vn(e,"common");return{expressPayDetails:d,fileProps:{authParams:i,filesEndPoint:`${ve.fileMicroServiceBaseUrl}`},vendorSearchAutoCompleteData:{autoCompleteText:c,entityAutoCompleteView:p},analytics:t.analytics}},function(e,t){const{navigate:s}=t;return{onSaveVendor:o=>{e(qn(o,void 0,void 0,!0))},saveVendorDetailLocalData:(o,a)=>{e(Re({vendorId:a,localData:o}))},saveExpressPayLocalData:o=>{e(Qn({localData:o}))},onVendorSelected:o=>{o!=null&&e(Jn(o,!1))},updateSelectedVendorForCreate:o=>{e(Yn(o))},initializeVendorAddress:()=>{e(Wn())},resetVendorSaveStatus:o=>{e(Hn({vendorId:o}))},vendorSearchAutoCompleteActions:{onAutoCompleteInputChange:(o,a)=>{o.trim().length>=2?e(Gn({searchString:o,entityType:a,searchOrigin:"common"})):o.trim().length===0&&e(Le("common"))},onCancelAutoComplete:()=>{e(Le("common"))}},chooseNewVendor:o=>{e(Re({localData:{vendorName:o}}))},onClickAddAccount:o=>{o.method.toLowerCase().indexOf("ach")!==-1?s("./add-ach",{relative:"path"}):o.method.toLowerCase().indexOf("wire")!==-1&&o.method.toLowerCase().indexOf("domestic")!==-1&&s("./add-wire",{relative:"path"})},updateFilesEntity:o=>{e(Qe({files:o}))},onDeleteFile:o=>{e(Je(o))},onEditFileName:(o,a)=>{e(Ye(o,a.split(".")[0]))},onBackClick:o=>{o!=null&&e(Fe(o)),e(Fe()),e(Zn()),e(ue()),s("../",{relative:"path"})},onSchedulePayment:()=>{e($n())}}})(It);function ce({isAddACHDrawerOpen:e,isAddWireDrawerOpen:t,isAddAddressDrawerOpen:s}){const o=H(),a=W(),i=z(),[d,c]=u.useState(!1),{tenantEmailDomain:p}=Z(),m=ae(),C=w(y=>y.expressPayState.fetchState),r=w(y=>N(y)),l=w(y=>Mn(y)),h=l.expressPayLocalData?.vendorId,x=r.companyId??D.getSignedInUserTenant(p)?.companyId,[b,g]=u.useState(!1),[A,I]=u.useState(!1),[f,S]=u.useState(!1),O=sn(a.state?.pathnameStackToGoBack),{poppedPathname:U}=O,P=U?.split("/"),E=P?.[P.length-1];u.useEffect(()=>{e===!0?g(!0):(g(!1),document.body.style.overflow="auto")},[e]),u.useEffect(()=>{t===!0?I(!0):(I(!1),document.body.style.overflow="auto")},[t]),u.useEffect(()=>{s===!0?S(!0):(S(!1),document.body.style.overflow="auto")},[s]),u.useEffect(()=>{C==="Not-Started"&&i(_n(!0,!0))},[C,i]);const v=Dt(l.vendorViewDetails.bankAccountCreationState?.fetchState);if(u.useEffect(()=>{v==="In-Progress"&&l.vendorViewDetails.bankAccountCreationState?.fetchState==="Completed"&&j()},[v,l.vendorViewDetails.bankAccountCreationState?.fetchState]),D.getSignedInUser()==null)throw Error("Can't access express pay page without signing in...");const T=y=>{c(y)},j=()=>{g(!1),I(!1),o("../",{relative:"path"})};return n.jsxs(Xt,{children:[Ne(a)?n.jsx(he,{isAppContentDrawerOpen:d,handleDrawerToggle:T}):null,b===!0?n.jsx(Gt,{vendorId:h,closeDrawerHandler:j,isDrawerOpen:b}):null,A===!0?n.jsx(qt,{vendorId:h,closeDrawerHandler:j,isDrawerOpen:A}):null,f===!0?n.jsx(Yt,{closeDrawerHandler:j,isDrawerOpen:f}):null,n.jsx(Nt,{vendorId:h,isExpressPayPage:!0}),n.jsx(ea,{navigate:o,location:a,companyId:x,accountId:E,analytics:R,currentTenant:r,vendorId:h,roleMap:m?.loggedInUserRoleMap,isSettings:Ne(a),expressPayDetails:l,onClickMenuIcon:()=>{T(!0)}})]})}const na={overlayWidth:new J(100,100,58)},ta=({authParams:e,downloadAccountDetailEndPoint:t,isAccountInfoDrawerOpen:s,zeniBankAccountDetail:o,closeDrawerHandler:a})=>{const i=M(),d=_(),c=w(r=>Ze(r)),p=w(r=>N(r));if(D.getSignedInUser()==null)throw Error("Can't access Account detail page without signing in...");const m=()=>{a(!0)},C={depositAccount:o,onDismissClick:m,zeniAccountsConfigDetail:c,authParams:e,downloadAccountDetailEndPoint:t,currentTenant:p};return n.jsx(Q,{anchor:"right",open:s,PaperProps:{style:{width:na.overlayWidth.valuePercentage(d),boxShadow:"none"}},slotProps:{backdrop:{style:{backgroundColor:i.colors.black,opacity:.75,cursor:"pointer"}}},onClose:()=>m(),children:n.jsx(aa,{onClick:r=>r.stopPropagation(),children:n.jsx(St,{...C})})})},aa=L(q)`
|
|
30
|
-
display: flex;
|
|
31
|
-
min-height: 100%;
|
|
32
|
-
flex-direction: column;
|
|
33
|
-
`,oa={overlayWidth:new J(100,100,58)},un=({isCheckDepositDrawerOpen:e,closeDrawerHandler:t})=>{const s=M(),o=_(),a=z(),i=w(r=>N(r)),d=D.getSignedInUser(),c=i.tenantId,p={userId:d?.userId??"",sessionId:d?.zeniSessionId??"",tenantId:c??""};if(d==null)throw Error("Can't access check deposit page without signing in...");const m=w(r=>Kn(r)),C={analytics:R,checkDeposit:m,filesEndPoint:`${ve.fileMicroServiceBaseUrl}`,authParams:p,onSaveChangesToLocalStore:r=>{a(et(r))},updateFilesEntity:r=>{a(Qe({files:r}))},onAnotherTransferClick:()=>{a(xe())},onDeleteFile:r=>{a(Je(r))},onEditFileName:(r,l)=>{a(Ye(r,l.split(".")[0]))},onCheckDpositClick:()=>{a(Xn())},onDismissClick:()=>{t(!0),a(xe())}};return n.jsxs(n.Fragment,{children:[n.jsx(me,{analytics:R,onLoad:r=>(l=>l.trackPageLoaded(Ee.Event.accountsDepositCheckFormViewed))(r)}),n.jsx(Q,{anchor:"right",open:e,PaperProps:{style:{width:oa.overlayWidth.valuePercentage(o),boxShadow:"none",zIndex:8}},slotProps:{backdrop:{style:{backgroundColor:s.colors.black,opacity:.75,cursor:"pointer"}}},onClose:(r,l)=>(l==="backdropClick"||l==="escapeKeyDown")&&(t(!0),void a(xe())),children:n.jsx(sa,{onClick:r=>r.stopPropagation(),children:n.jsx(bt,{...C})})})]})},sa=L(q)`
|
|
34
|
-
display: flex;
|
|
35
|
-
min-height: 100%;
|
|
36
|
-
flex-direction: column;
|
|
37
|
-
`,ia={overlayWidth:new J(100,100,58)},ra=Y(function(e,t){const s=t.currentTenant?.companyId;return{plaidConnectionDetails:ot(e,s,"zeni_accounts","external_account").plaidConnectionDetails,depositAccountListView:We(e.depositAccountState,e.depositAccountListState)}},function(e,t){return{onReviewClick:()=>e(it()),clearReviewTransferDetail:()=>e(st()),onFetchLinkTokenClick:s=>{e(Ke("external_account",s))},onEstablishConnectionClick:s=>{e(qe(s,t.currentTenant?.companyId,"external_account",void 0,"link_external_account"))}}})(vt),pn=({isTransferDrawerOpen:e,authParams:t,downloadAccountDetailEndPoint:s,closeDrawerHandler:o,zeniAccountsConfig:a})=>{const i=w(f=>nt(f)),d=w(f=>N(f)),c=M(),p=_(),m=z(),{accountId:C}=Z(),[r,l]=u.useState("achTransfer"),[h,x]=u.useState(!1);if(D.getSignedInUser()==null)throw Error("Can't access invite people page without signing in...");const{useDynamicConfig:b}=V(),{configValue:g}=b(G.zeniAccountsConfig),A=De(g),I=()=>{o(!0),m(Ue())};return u.useEffect(()=>{i.reviewTransferDetail.fetchState==="Completed"&&x(!0)},[x,i.reviewTransferDetail.fetchState]),n.jsxs(n.Fragment,{children:[n.jsx(me,{analytics:R,onLoad:f=>(S=>S.trackPageLoaded(Ee.Event.zeniAccountsTransferFormViewed))(f)}),n.jsx(Q,{onClose:()=>{(r==="achTransfer"&&h===!1||r==="achTransfer"&&h&&i.fetchState==="Completed")&&I()},anchor:"right",open:e,PaperProps:{style:{width:ia.overlayWidth.valuePercentage(p),boxShadow:"none"}},slotProps:{backdrop:{style:{backgroundColor:c.colors.black,opacity:.75,cursor:"pointer"}}},children:n.jsx(ca,{onClick:f=>f.stopPropagation(),children:n.jsx(ra,{analytics:R,transferDetails:i,authParams:t,downloadAccountDetailEndPoint:s,onTransferClick:()=>{R.trackTransferBetweenAccountsFormClicked("Transfer",i.reviewTransferDetail.reviewTransferMoney.isShowDailyAchLimitWarning?"Review Split Transfer":"Review Transfer",i.transferDetailLocalData.transferFrom?.label,i.transferDetailLocalData.transferTo?.label,i.transferDetailLocalData.amount.amount,i.reviewTransferDetail.reviewTransferMoney.isShowDailyAchLimitWarning,i.reviewTransferDetail.reviewTransferMoney.transferSchedules.length,i.transferDetailLocalData.transferFrom?.accType==="paymentAccount"&&i.transferDetailLocalData.transferTo?.accType==="depositAccount"&&a.zeniAccountsConfigDetail.depositProductConfig.depositProducts?.[0].range?.[1]!=null&&i.transferDetailLocalData.amount.amount>a.zeniAccountsConfigDetail.depositProductConfig.depositProducts[0].range[1]),m(at(C))},onDismissClick:I,onSaveChangesToLocalStore:f=>{m(tt(f))},onAnotherTransferClick:()=>{x(!1),m(Ue())},currentTenant:d,zeniAccountsConfigDetail:a,currentDrawerContent:r,setCurrentDrawerContent:l,showReviewContent:h,setShowReviewContent:x,onBackClick:()=>{},maxInsuredAmount:A.maxInsuredAmount})})})]})},ca=L(q)`
|
|
38
|
-
display: flex;
|
|
39
|
-
min-height: 100%;
|
|
40
|
-
flex-direction: column;
|
|
41
|
-
`,la=L.div`
|
|
42
|
-
display: flex;
|
|
43
|
-
min-height: 100%;
|
|
44
|
-
width: 100%;
|
|
45
|
-
flex: 1 1 auto;
|
|
46
|
-
flex-direction: column;
|
|
47
|
-
align-items: center;
|
|
48
|
-
background-color: ${e=>e.theme.colors.grey4};
|
|
49
|
-
`,da=Y(function(e,t){return{zeniAccountListView:Xe(e),isExpressPayEnabled:t.isExpressPayEnabled,analytics:t.analytics}},function(e,t){const{navigate:s,currentTenant:o,location:a,companyId:i,handleDrawerToggle:d,analytics:c,isBillPayEnabled:p,isDebitCardFeatureEnabled:m}=t,{tenantEmailDomain:C}=o;return{onZeniAccountClick:(r,l)=>{c.trackAccountsListPageClicked("Accounts Row Item Click",l,"active");const h=ua(C,r),x=ee(a.state?.pathnameStackToGoBack,a.pathname);s(h,{state:{pathnameStackToGoBack:x}})},onSettingsClick:()=>{c.trackAccountsListPageClicked("Settings Icon"),s("setup")},onReloadTransactions:()=>{e(en(!1))},handleMoveMoneyOptionSelection:(r,l)=>{let h="page-not-found";r==="sendMoney"&&(h=fn(C)),r==="payBill"?h=mn(o,p,m):r==="transfer"?(h=hn(C),l!=null&&e(tn(l))):r==="checkDeposit"&&(h=gn(C));const x=ee(a.state?.pathnameStackToGoBack,a.pathname);s(h,{state:{pathnameStackToGoBack:x}})},unlinkPaymentAccount:(r,l)=>{c.trackAccountsListPageClicked("Unlink Account",l),e(dt(r))},onFetchLinkTokenClick:(r,l)=>{e(Ke("external_account",r,l))},onUpdatePaymentAccountStatus:(r,l,h)=>{e(lt(r,l,"zeni_accounts","external_account",h))},onEstablishConnectionClick:r=>{e(qe(r,i,"external_account",void 0,"link_external_account"))},onCreateCheckingClick:r=>{e(ct(r))},onClickMenuIcon:()=>{d(!0)},onTreasuryGetStartedClick:()=>{s("../../treasury/promo")},onAutoTransferClick:r=>{r?s("./auto-transfer",{state:{...a.state,scrollToAddRule:!0}}):s("./auto-transfer")}}})(Pt);function ke({isTransferDrawerOpen:e,isCheckDepositDrawerOpen:t}){const s=W(),o=H(),a=z(),i=_(),{tenantEmailDomain:d}=Z(),{useDynamicConfig:c,useFeatureGate:p}=V(),m=M(),{configValue:C}=c(G.zeniAccountsConfig),{isFeatureEnabled:r}=p(B.isTreasuryEnabled),{isFeatureEnabled:l}=p(B.isDebitCardFeatureEnabled),{isFeatureEnabled:h}=p(B.isAutoTransferRuleEnabled),{isFeatureEnabled:x}=p(B.isCheckingCommentingEnabled),b=De(C),g=w(F=>N(F)),A=g.companyId??D.getSignedInUserTenant(d)?.companyId,{configValue:I}=c(G.expressPayConfig),f=I.is_enable_all_tenants===!0||I.tenant_ids!=null&&I.tenant_ids.includes(g.tenantId),[S,O]=u.useState(!1),[U,P]=u.useState(!1),[E,v]=u.useState(!1),[T,j]=u.useState(!1),y=w(F=>Xe(F)),$=y.fetchState,oe=w(F=>we(F)),se=oe?.fetchState??"Not-Started",ge=!!g.companyZeniAccountInfo?.info?.isZeniAccountEnabled,ie=ae(),re=!!g.companyZeniAccountInfo?.info?.isZeniAccountTOSAccepted,K=!!g.companyTreasuryInfo?.info?.isTreasuryTOSAccepted,X=te(ie?.loggedInUserRoleMap),yn=Ie(ie?.loggedInUserRoleMap),Cn=!!g.companyBillPayInfo?.info?.isBillPayEnabled,je=D.getSignedInUser(),xn={userId:je?.userId??"",sessionId:je?.zeniSessionId??"",tenantId:g.tenantId??""},kn=`${be}/account_details`,{areTenantIdsInSync:Pe}=Et();u.useEffect(()=>{!S&&Pe&&(O(!0),a(en(!1)))},[S,a,$,Pe]),u.useEffect(()=>{!U&&se==="Not-Started"&&A&&(P(!0),a(Ae(!0)))},[U,se,A,a]),u.useEffect(()=>{e!=null&&e===!0?v(!0):(v(!1),document.body.style.overflow="auto")},[e]),u.useEffect(()=>{j(t!=null&&t===!0)},[t]);const Te=()=>{v(!1),o("..")},[wn,An]=u.useState(!1),Be=F=>{An(F)},{isAiCfoOpen:Dn,setIsAiCfoOpen:In}=rn(),{isAiCfoAccessEnabled:Sn,onAskAiCfoClick:bn}=ln({isAiCfoOpen:Dn,setIsAiCfoOpen:In,mobileExploreReferrer:"Checking Accounts"});dn({isDataReady:$==="Completed"});const vn=g.company!=null&&He(g.company),fe=(r&&vn)===!0&&!K,[En,jn]=u.useState(!1),ye=w(F=>F.treasurySetupViewState.treasuryFundsDetails),Pn=ye.fundsDetails,Tn=jt(Pn);u.useEffect(()=>{fe!==!0||En||ye?.fetchStatus.fetchState!=="Not-Started"||(jn(!0),a(rt()))},[ye.fetchStatus,a]);const Bn=nn(g),On=Se(l,g);return Bn===!0&&On!==!0?n.jsx(cn,{}):ge?n.jsxs(n.Fragment,{children:[y.fetchState==="Completed"&&E===!1&&T===!1?n.jsx(me,{analytics:R,onLoad:F=>(Oe=>{Oe.trackAccountsListPageViewed(y.depositAccountsSelectorView.depositAccounts.length,y.externalAccountsSelectorView.paymentAccounts.length,Me(y.summary?.totalBalance.available.amount??0),Me(y.summary?.totalInterest.available.amount??0),y.zeniAccountsConfig.zeniAccountsConfigDetail.annualPercentageYield),fe&&Oe.trackTreasuryPromoView("Checking Promo Banner")})(F)}):null,E===!0?n.jsx(pn,{closeDrawerHandler:Te,isTransferDrawerOpen:E,zeniAccountsConfig:y.zeniAccountsConfig,authParams:xn,downloadAccountDetailEndPoint:kn}):null,T===!0?n.jsx(un,{closeDrawerHandler:Te,isCheckDepositDrawerOpen:T}):null,n.jsxs(la,{windowSize:i,children:[n.jsx(he,{isAppContentDrawerOpen:wn,handleDrawerToggle:Be}),n.jsx(da,{zeniBankListView:y,navigate:o,currentTenant:g,location:s,companyId:A,analytics:R,maxInsuredAmount:b.maxInsuredAmount,isExpressPayEnabled:f,isBillPayEnabled:Cn,isCheckingCommentingEnabled:x,isDebitCardFeatureEnabled:l,isAutoTransferRuleEnabled:h,handleDrawerToggle:Be,showTreasuryPromo:fe,treasuryYieldPercentage:Tn,treasuryInsuredAmount:5e5,isAiCfoAccessEnabled:Sn,onAskAiCfoClick:bn})]})]}):re&&X?n.jsx(ne,{to:"../setup"}):g.companyZeniAccountInfo?.info&&!re&&yn?n.jsx(ne,{to:"../promo",state:s.state}):n.jsx(pe,{fetchState:"In-Progress",style:{backgroundColor:m.colors.grey5}})}const mn=(e,t,s)=>{const o=Se(s,e),{tenantEmailDomain:a}=e;return o===!0||t===!1?`/${a}/bills`:`/${a}/bill/new`},ua=(e,t)=>`/${e}/checking/${t}`,hn=(e,t)=>t==null?`/${e}/checking/transfer`:`/${e}/checking/${t}/transfer`,gn=(e,t)=>t==null?`/${e}/checking/check-deposit`:`/${e}/checking/${t}/check-deposit`,fn=e=>`/${e}/checking/express-pay`,pa=L.div`
|
|
50
|
-
display: flex;
|
|
51
|
-
width: 100%;
|
|
52
|
-
flex: 1 1 auto;
|
|
53
|
-
flex-direction: column;
|
|
54
|
-
align-items: center;
|
|
55
|
-
min-height: 100vh;
|
|
56
|
-
background-color: ${e=>e.theme.colors.grey4};
|
|
57
|
-
`,ma=Y(function(e,t){const{currentTenant:s}=t,o=an(e,t.accountId),a=D.getSignedInUser(),i=e.tenantState.currentTenantId,d={userId:a?.userId??"",sessionId:a?.zeniSessionId??"",tenantId:i??""},c=o.accountDetail?.id??"";return{currentTenantCompanyName:s.companyName??"",authParams:d,downloadEndPoint:`${ve.bankingMicroServiceBaseUrl}/1.0/deposit-accounts/${c}`,zeniAccountDetail:o,isExpressPayEnabled:t.isExpressPayEnabled,fetchState:o.fetchState}},function(e,t){const{navigate:s,currentTenant:o,location:a,accountId:i}=t,{tenantEmailDomain:d}=o;return{handleMoveMoneyOptionSelection:(c,p)=>{let m="page-not-found";c==="sendMoney"?m=fn(d):c==="payBill"?m=mn(o,t.isBillPayEnabled,t.isDebitCardFeatureEnabled):c==="transfer"?(m=hn(d,i),p!=null&&e(tn(p))):c==="checkDeposit"?(m=gn(d,i),p!=null&&e(ut(p))):c==="accountStatement"&&(m=fa(d,i));const C=ee(a.state?.pathnameStackToGoBack,a.pathname);s(m,{state:{pathnameStackToGoBack:C}})},onViewAllTransactionClick:()=>{const c=ga(d,i),p=ee(a.state?.pathnameStackToGoBack,a.pathname);s(c,{state:{pathnameStackToGoBack:p}})},onAccountDetailClick:()=>{const c=ha(d,i),p=ee(a.state?.pathnameStackToGoBack,a.pathname);s(c,{state:{pathnameStackToGoBack:p}})},onEditNameClick:c=>{e(ze(i,"editName",c))},onReloadZeniAccountDetailPage:()=>{e(on(i,!1))},onCloseAccountClick:()=>{e(ze(i,"closeAccount",""))},onBackClick:()=>{s("../",{relative:"path"})}}})(Tt);function le({isTransferDrawerOpen:e,isCheckDepositDrawerOpen:t,isAccountInfoDrawerOpen:s}){const o=W(),a=H(),i=z(),d=_(),{tenantEmailDomain:c,accountId:p}=Z(),{useDynamicConfig:m}=V(),{useFeatureGate:C}=V(),{isFeatureEnabled:r}=C(B.isDebitCardFeatureEnabled),{isFeatureEnabled:l}=C(B.isCheckingCommentingEnabled),h=w(X=>N(X)),{configValue:x}=m(G.expressPayConfig),b=x.is_enable_all_tenants===!0||x.tenant_ids!=null&&x.tenant_ids.includes(h.tenantId),g=!!h.companyBillPayInfo?.info?.isBillPayEnabled,A=D.getSignedInUser(),I=h.companyId??D.getSignedInUserTenant(c)?.companyId,f={userId:A?.userId??"",sessionId:A?.zeniSessionId??"",tenantId:h.tenantId??""},S=`${be}/account_details`,[O,U]=u.useState(!1),[P,E]=u.useState(!1),[v,T]=u.useState(!1),[j,y]=u.useState(!1),$=w(X=>an(X,p??"")),oe=$.fetchState,{isAiCfoOpen:se,setIsAiCfoOpen:ge}=rn(),{isAiCfoAccessEnabled:ie,onAskAiCfoClick:re}=ln({isAiCfoOpen:se,setIsAiCfoOpen:ge,mobileExploreReferrer:"Checking Account Detail"});dn({isDataReady:oe==="Completed"}),u.useEffect(()=>{O||(i(on(p??"",!1)),U(!0))},[O,i,oe]),u.useEffect(()=>{y(s!=null&&s===!0)},[s]),u.useEffect(()=>{e!=null&&e===!0?E(!0):(E(!1),document.body.style.overflow="auto")},[e]),u.useEffect(()=>{T(t!=null&&t===!0)},[t]);const K=()=>{y(!1),a("..")};return n.jsxs(n.Fragment,{children:[j===!0&&$.accountDetail!=null?n.jsx(ta,{authParams:f,downloadAccountDetailEndPoint:S,closeDrawerHandler:K,isAccountInfoDrawerOpen:j,zeniBankAccountDetail:$.accountDetail}):null,P===!0?n.jsx(pn,{closeDrawerHandler:K,isTransferDrawerOpen:P,zeniAccountsConfig:$.zeniAccountsConfig,authParams:f,downloadAccountDetailEndPoint:S}):null,v===!0?n.jsx(un,{closeDrawerHandler:K,isCheckDepositDrawerOpen:v}):null,n.jsx(pa,{windowSize:d,children:n.jsx(ma,{navigate:a,currentTenant:h,location:o,companyId:I,isDebitCardFeatureEnabled:r,accountId:p??"",isBillPayEnabled:g,isCheckingCommentingEnabled:l,isExpressPayEnabled:b,isAiCfoAccessEnabled:ie,onAskAiCfoClick:re})})]})}const ha=(e,t)=>`/${e}/checking/${t}/account-info`,ga=(e,t)=>`/${e}/checking/${t}/transactions`,fa=(e,t)=>`/${e}/checking/${t}/statements`,ya=L.div`
|
|
58
|
-
display: flex;
|
|
59
|
-
height: 100vh;
|
|
60
|
-
width: 100%;
|
|
61
|
-
flex: 1 1 auto;
|
|
62
|
-
flex-direction: column;
|
|
63
|
-
overflow: auto;
|
|
64
|
-
align-items: center;
|
|
65
|
-
background-color: ${e=>e.theme.colors.grey4};
|
|
66
|
-
`;function Ca(){const e=H(),t=z(),s=_(),{accountId:o}=Z(),{useFeatureGate:a}=V(),{isFeatureEnabled:i}=a(B.isCheckingCommentingEnabled),[d,c]=u.useState(!1);u.useEffect(()=>{d||(c(!0),t(pt(o??"",!1)))},[d,t]);const p=w(m=>mt(m,o??""));if(D.getSignedInUser()==null)throw Error("Can't access address page without signing in...");return n.jsx(ya,{windowSize:s,children:n.jsx(Bt,{transactionListView:p,depositAccountId:o??"",isCheckingCommentingEnabled:i,onBackClick:()=>{e("../")}})})}const xa=Y(function(e,t){const{companyId:s}=t;return{zeniAccountSetupView:ht(e,s),meetingUrl:"https://meetings.hubspot.com/niharn/demo-accounts?embed=true"}},function(e,t){const{navigate:s,companyId:o}=t;return{onSetupButtonClick:()=>{R.trackAccountsPromoPageClicked("Setup Accounts"),e(gt(o))},onBackClick:()=>{s("../..",{relative:"path"})},onSetupZeniAccountSuccess:()=>{s("../setup",{relative:"path"})}}})(Ft),ka=()=>{const e=H(),t=W(),{tenantEmailDomain:s}=Z(),{useDynamicConfig:o}=V(),a=M(),[i,d]=u.useState(!1),[c,p]=u.useState(!1),m=w(f=>N(f)),{configValue:C}=o(G.zeniAccountsConfig),r=De(C);u.useEffect(()=>{c===!1&&t.state?.message==="activation"&&p(!0)},[t.state]);const l=D.getSignedInUserTenant(s)?.companyId??m.companyId,h=D.getSignedInUser(),x=!!m.companyZeniAccountInfo?.info?.isZeniAccountTOSAccepted,b=f=>{d(f)};if(h==null)throw Error("Can't access Zeni account promo page without signing in...");const g=ae(),A=te(g?.loggedInUserRoleMap),I=Ie(g?.loggedInUserRoleMap);if(x&&A)return n.jsx(ne,{to:"../../checking/setup"});if(m.company?.companyZeniAccountInfo&&(!x&&A||I)){if(t.state?.message==="activation"){const f=sn(t.state?.pathnameStackToGoBack);e(t.pathname,{state:{...t.state,message:void 0,pathnameStackToGoBack:f.newStack}})}return n.jsxs(n.Fragment,{children:[n.jsx(Ot,{showConfetti:c}),n.jsx(me,{analytics:R,onLoad:f=>(S=>S.trackPageLoaded(Ee.Event.accountsPromoPageViewed))(f)}),n.jsx(he,{isAppContentDrawerOpen:i,handleDrawerToggle:b}),n.jsx(xa,{analytics:R,navigate:e,companyId:l,onClickMenuIcon:()=>{b(!0)},maxAnnualPercentageYield:r.maxAnnualPercentageYield,maxInsuredAmount:r.maxInsuredAmount,exampleBankBalance:3e6})]})}return n.jsx(pe,{fetchState:"In-Progress",style:{backgroundColor:a.colors.grey5}})};function Ja(){const e=W(),t=w(j=>N(j)),s=M(),{useFeatureGate:o,useDynamicConfig:a}=V(),i=ae(),d=te(i?.loggedInUserRoleMap),c=Ie(i?.loggedInUserRoleMap),p=!!t.company?.companyZeniAccountInfo.isZeniAccountEnabled,m=!!t.company?.companyZeniAccountInfo.isZeniAccountTOSAccepted,{isFeatureEnabled:C}=o(B.isChargeCardFeatureEnabled),{isFeatureEnabled:r}=o(B.isDebitCardFeatureEnabled),l=nn(t),h=Se(r,t),x=t?.userRole!=null&&ft(t?.userRole),b=(t?.company==null||t.company.featuresActivationInfo?.isBillPayFeatureEnabled&&!x)&&yt(i?.loggedInUserRoleMap),g=Ct(i?.loggedInUserRoleMap),A=(t?.company==null||t.company.featuresActivationInfo?.isReimbursementFeatureEnabled&&!x)&&xt(i?.loggedInUserRoleMap),{isFeatureEnabled:I}=o(B.isDepositAccountsFeatureEnabled),f=I&&!x,{configValue:S}=a(G.expressPayConfig),O=S.is_enable_all_tenants===!0||S.tenant_ids!=null&&S.tenant_ids.includes(t.tenantId),{isFeatureEnabled:U}=o(B.isAutoTransferRuleEnabled),P=Rt(t,C,r)&&!x&&kt(i?.loggedInUserRoleMap),E=wt(i?.loggedInUserRoleMap),v=f&&te(i?.loggedInUserRoleMap),T=v||Ge(i?.loggedInUserRoleMap);return n.jsxs($e,{children:[n.jsx(k,{path:"setup",element:n.jsx(_e,{isBillPayAdminLevelAccess:b,isUserHasOnlyBillPayAccess:g,isReimbursementAdminLevelAccess:A,isZeniAccountAdminLevelAccess:v,isChargeCardAdminLevelAccess:P,isUserHasOnlyCardAccess:E,productType:"zeni_accounts",type:"setup"})}),n.jsx(k,{path:"verification",element:n.jsx(_e,{isBillPayAdminLevelAccess:b,isUserHasOnlyBillPayAccess:g,isReimbursementAdminLevelAccess:A,isZeniAccountAdminLevelAccess:v,isChargeCardAdminLevelAccess:P,isUserHasOnlyCardAccess:E,productType:"zeni_accounts",type:"verification"})}),U?n.jsxs(n.Fragment,{children:[n.jsx(k,{path:"auto-transfer",element:n.jsx(Ve,{})}),T?n.jsx(k,{path:"auto-transfer/:ruleId/edit",element:n.jsx(Ve,{isEditDrawerOpen:!0})}):null]}):n.jsx(k,{path:"auto-transfer",element:n.jsx(de,{})}),O&&d?n.jsxs(n.Fragment,{children:[n.jsx(k,{path:"express-pay",element:n.jsx(ce,{})}),n.jsx(k,{path:"express-pay/add-ach",element:n.jsx(ce,{isAddACHDrawerOpen:!0})}),n.jsx(k,{path:"express-pay/add-wire/add-address",element:n.jsx(ce,{isAddAddressDrawerOpen:!0})}),n.jsx(k,{path:"express-pay/add-wire",element:n.jsx(ce,{isAddWireDrawerOpen:!0})})]}):n.jsx(k,{path:"express-pay",element:n.jsx(de,{})}),n.jsx(k,{path:"promo",element:n.jsx(ka,{})}),l&&!h?n.jsx(k,{path:"/*",element:n.jsx(cn,{})}):p?n.jsxs(n.Fragment,{children:[n.jsx(k,{path:"/",element:n.jsx(ke,{})}),n.jsx(k,{path:"transfer",element:n.jsx(ke,{isTransferDrawerOpen:!0})}),n.jsx(k,{path:"check-deposit",element:n.jsx(ke,{isCheckDepositDrawerOpen:!0})}),n.jsx(k,{path:":accountId/*",element:n.jsx(wa,{})}),n.jsx(k,{path:"*",element:n.jsx(de,{})})]}):m&&d?n.jsx(k,{path:"*",element:n.jsx(ne,{to:"../setup"})}):t.company?.companyZeniAccountInfo&&c?n.jsx(k,{path:"*",element:n.jsx(ne,{to:"../promo",state:e.state})}):n.jsx(k,{path:"*",element:n.jsx(pe,{fetchState:"In-Progress",style:{backgroundColor:s.colors.grey5,boxShadow:`0px 2px ${Lt.sp1} ${s.colors.dropShadowNormal}`}})})]})}function wa(){return n.jsxs($e,{children:[n.jsx(k,{path:"/",element:n.jsx(le,{})}),n.jsx(k,{path:"account-info",element:n.jsx(le,{isAccountInfoDrawerOpen:!0})}),n.jsx(k,{path:"transfer",element:n.jsx(le,{isTransferDrawerOpen:!0})}),n.jsx(k,{path:"check-deposit",element:n.jsx(le,{isCheckDepositDrawerOpen:!0})}),n.jsx(k,{path:"transactions",element:n.jsx(Ca,{})}),n.jsx(k,{path:"statements",element:n.jsx(_t,{})}),n.jsx(k,{path:"*",element:n.jsx(de,{})})]})}export{Ja as default};
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import{j as i}from"./liveblocks-BJogRArg.js";import{a as u}from"./sentry-WdXgkw90.js";import{j as x,h as v,u as B,l as C,g as p}from"./core-BojUR2ky.js";import{HD as s,HC as N,NJ as $,eN as j,NK as D}from"./zeni-epic-state-BJsXImBw.js";import{q as T,ap as g,h as z,z as E,B as L,b_ as P,v as _}from"./index-Dw0sYJvv.js";import{n as U}from"./mui-Bg09VkiQ.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]="e9887df0-b156-4bbd-9aea-3401afc66946",e._sentryDebugIdIdentifier="sentry-dbid-e9887df0-b156-4bbd-9aea-3401afc66946")}catch{}})();const G=U.div`
|
|
2
|
-
display: flex;
|
|
3
|
-
height: 100vh;
|
|
4
|
-
width: 100%;
|
|
5
|
-
flex: 1 1 auto;
|
|
6
|
-
flex-direction: column;
|
|
7
|
-
align-items: center;
|
|
8
|
-
background-color: ${e=>e.theme.colors.grey4};
|
|
9
|
-
`;function V(){const e=x(),n=v(),d=T(),l=B();let{accountId:a}=C(),f=`${g.bankingMicroServiceBaseUrl}/1.0/deposit-accounts/${a}`;a==null&&l.pathname.includes(`${s}/statements`)&&(a=s,f=`${g.bankingMicroServiceBaseUrl}/1.0/${s}`);const[m,b]=u.useState(!1),h=z();u.useEffect(()=>{m||(b(!0),n(N(a??"",!1)))},[m,n]);const o=p(t=>$(t,a??"")),y=()=>{const t=_(l.state?.pathnameStackToGoBack),S=t.poppedPathname??"..";e(S,{state:{pathnameStackToGoBack:t.newStack}})},r=E.getSignedInUser(),c=p(t=>j(t)),I={userId:r?.userId??"",sessionId:r?.zeniSessionId??"",tenantId:c.tenantId??""},w=D(a??"")===!0?s:o.zeniAccountDetail?.accountLast4??"",k=c.company?.companyInfo.companyLegalName??c.companyName;if(r==null)throw Error("Can't access address page without signing in...");return o.fetchState!=="Completed"?i.jsx(L,{fetchState:"In-Progress",style:{backgroundColor:h.colors.grey5}}):i.jsx(G,{windowSize:d,children:i.jsx(P,{currentTenantCompanyName:k,statementListView:o,accountLast4:w,onBackClick:y,authParams:I,downloadEndPoint:f})})}export{V as Z};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{s as n}from"./index-Dw0sYJvv.js";import"./mui-Bg09VkiQ.js";import"./sentry-WdXgkw90.js";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},o=new e.Error().stack;o&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[o]="dd7bac7e-d9ed-4beb-9d05-38100444c129",e._sentryDebugIdIdentifier="sentry-dbid-dd7bac7e-d9ed-4beb-9d05-38100444c129")}catch{}})();function r(e){if(e.companyLocaleInfo!=null&&e.companyLocaleInfo.languageCode.length>0&&e.companyLocaleInfo.companyIncCountryCode.length>0){const o=`${e.companyLocaleInfo.languageCode.toLowerCase()}-${e.companyLocaleInfo.companyIncCountryCode.toUpperCase()}`;return console.warn(`localeID ${o}`),n(o)??"en"}return"en"}export{r as t};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{a as l}from"./sentry-WdXgkw90.js";import{q as p,c as b,x as m,N as u}from"./index-Dw0sYJvv.js";import"./mui-Bg09VkiQ.js";import{b as y}from"./useFetchSuggestedQuestionsWhenReady-BonCp6Rh.js";import{j as k,u as g,l as h}from"./core-BojUR2ky.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]="db033102-1aaf-4799-9eec-ccbd4fd7fe35",e._sentryDebugIdIdentifier="sentry-dbid-db033102-1aaf-4799-9eec-ccbd4fd7fe35")}catch{}})();function x(e){const{isAiCfoOpen:a,setIsAiCfoOpen:t,mobileExploreReferrer:n}=e,f=k(),o=g(),{tenantEmailDomain:s}=h(),i=p(),r=u(i),c=b();return{isAiCfoAccessEnabled:y()&&c&&!a,onAskAiCfoClick:l.useCallback(()=>{if(s!=null)if(r){const d=m(o.state?.pathnameStackToGoBack,o.pathname);f(`/${s}/ai-cfo/explore`,{state:{pathnameStackToGoBack:d,referrer:n}})}else t(!0)},[r,o.pathname,o.state,n,f,t,s])}}export{x as u};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{a as u}from"./sentry-WdXgkw90.js";import{h as i,s as d}from"./core-BojUR2ky.js";import{a as b,p as h,c as g,_ as m,K as C}from"./index-Dw0sYJvv.js";import"./mui-Bg09VkiQ.js";import{eK as l,hE as p}from"./zeni-epic-state-BJsXImBw.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]="da9245c2-f20f-4c25-9c52-6928a4697d93",e._sentryDebugIdIdentifier="sentry-dbid-da9245c2-f20f-4c25-9c52-6928a4697d93")}catch{}})();function x(){const{useFeatureGate:e}=b(),{isFeatureEnabled:t}=e(h.isAiCfoNavButtonEnabled),n=g();return t&&n}function y(e,t){return e!=="Completed"&&e!=="In-Progress"&&!(e==="Error"&&!t)}function I(e){const{areTenantIdsInSync:t}=C(),n=g(),a=x();return t&&e&&a&&n}function _(e){const{pageContexts:t,canFetchSuggestedQuestions:n}=e,a=i(),s=d(),o=u.useRef(null);u.useEffect(()=>{const r=o.current===!1&&n===!0;if(o.current=n,n&&t!=null&&t.length!==0)for(const c of t){const f=l(s.getState(),c)?.fetchState;y(f,r)&&a(p({pageContext:c}))}},[n,a,t,s])}function S(e){(function(t){const{pageContext:n,canFetchSuggestedQuestions:a}=t,s=i(),o=d(),r=u.useRef(null);u.useEffect(()=>{const c=r.current===!1&&a===!0;if(r.current=a,n==null||!a)return;const f=l(o.getState(),n)?.fetchState;y(f,c)&&s(p({pageContext:n}))},[a,s,n,o])})({canFetchSuggestedQuestions:I(e.isDataReady),pageContext:e.pageContext})}function Q(e){S({pageContext:m(),isDataReady:e.isDataReady})}export{_ as a,x as b,Q as c,I as u};
|