@zeniai/web-app-ui 5.3.32-qa → 5.3.33-dev
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/assets/AccountMappingScreen-DDC4e1RD.js +9 -0
- package/dist/assets/AddressRoutes-zzmrmZ16.js +1 -0
- package/dist/assets/AddressScreen-BtP59nWf.js +9 -0
- package/dist/assets/AiCfoScreen-0WwVR_RT.js +22 -0
- package/dist/assets/AppDrawer-C7u6yO5k.js +10 -0
- package/dist/assets/{BillPayApprovalRoutes-B-dRM1ET.js → BillPayApprovalRoutes-B12E_S91.js} +1 -1
- package/dist/assets/{BillPayRoutes-Bw7Zsd_q.js → BillPayRoutes-D3YiGZXB.js} +18 -18
- package/dist/assets/{BusinessVerificationPageScreen-BpB36lD4.js → BusinessVerificationPageScreen-Bh5Bjz_t.js} +2 -2
- package/dist/assets/CardsAiCfoScreen-StazhLCy.js +14 -0
- package/dist/assets/{ChargeCardRoutes-BN5gmMDY.js → ChargeCardRoutes-BpwgRJW2.js} +1 -1
- package/dist/assets/{CompanyPassportScreen-BgOKbeIV.js → CompanyPassportScreen-1B8KqxCX.js} +1 -1
- package/dist/assets/ConnectionAuthScreen-_WPAiqQD.js +11 -0
- package/dist/assets/CustomerOnboardingAuthScreen-B2-KkeTM.js +1 -0
- package/dist/assets/CustomerOnboardingRoutes-eoKq-jK4.js +30 -0
- package/dist/assets/{DashboardRoutes-C--0vzwA.js → DashboardRoutes-CKdZegGm.js} +4 -4
- package/dist/assets/DefaultTenantHome-CvzwpBoC.js +1 -0
- package/dist/assets/DomesticWireDetailScreen-BOxoSeoJ.js +18 -0
- package/dist/assets/DrawerScreen-Cvypy_pu.js +1 -0
- package/dist/assets/EntityDetailRoutes-BLeAjK3e.js +1 -0
- package/dist/assets/ExpenseAutomationRoutes-t_w4KaUv.js +38 -0
- package/dist/assets/FeaturePreviewScreen-KgN7vGcF.js +1 -0
- package/dist/assets/HubSpotOAuthCallbackScreen-Bj9Wgjht.js +1 -0
- package/dist/assets/InboxNotificationsProvider-B-NFQuyv.js +1 -0
- package/dist/assets/InvoicingRoutes-DD8ii9Jo.js +2 -0
- package/dist/assets/{MagicLinkRoutes-B3OI8_Y8.js → MagicLinkRoutes-B5onTuVg.js} +7 -7
- package/dist/assets/MagicLinkSignInScreen-Z_KEEjY_.js +12 -0
- package/dist/assets/MobileAppDrawer-PtjV_ofL.js +1 -0
- package/dist/assets/NotFoundScreen-BYb00fRD.js +1 -0
- package/dist/assets/NotificationRoutes-Ct_RdrSm.js +1 -0
- package/dist/assets/OAuthConsentScreen-Cp21VEUM.js +1 -0
- package/dist/assets/PandLWithForecastRoutes-B8aCeyQm.js +1 -0
- package/dist/assets/{PaymentLinkScreen-oiuP5YE8.js → PaymentLinkScreen-Dom-ZdiQ.js} +6 -6
- package/dist/assets/PeopleRoutes-CMQ5JoaT.js +22 -0
- package/dist/assets/PerformanceRoutes-BaFYyetl.js +1 -0
- package/dist/assets/{Preview-C7FOgz3Q.js → Preview-BUFd_sPW.js} +1 -1
- package/dist/assets/{QBOConnectionScreen-CiKgrKX6.js → QBOConnectionScreen-DLKvgPCe.js} +23 -23
- package/dist/assets/ReimbursementApprovalRoutes-yZ6qt8vR.js +1 -0
- package/dist/assets/{ReimbursementApprovalRuleDetailScreen-D7_1V-ZV.js → ReimbursementApprovalRuleDetailScreen-PjSqLE3K.js} +1 -1
- package/dist/assets/{ReimbursementRoutes-CfqcRhl_.js → ReimbursementRoutes-BHhFNphA.js} +9 -9
- package/dist/assets/ReportsRoutes-DwjpNsBH.js +1 -0
- package/dist/assets/RewardsRoutes-D1qLb1Hr.js +1 -0
- package/dist/assets/ScheduleDetailsPrepaidExpensesScreen-BXydpQNl.js +25 -0
- package/dist/assets/ScreenRoutes-C2Pczg6X.js +2 -0
- package/dist/assets/{SettingsRoutes-C_BHKgxc.js → SettingsRoutes-DNifcLKF.js} +6 -6
- package/dist/assets/{SetupPagesScreen-CZfthydR.js → SetupPagesScreen-DxyeAl-N.js} +5 -5
- package/dist/assets/SignInScreen-xjjVbfK1.js +1 -0
- package/dist/assets/SignOutScreen-z53qiWi7.js +9 -0
- package/dist/assets/{TaskListScreen-vihEMCMo.js → TaskListScreen-B_OtLRex.js} +2 -2
- package/dist/assets/TaskRoutes-CwGUiyuW.js +9 -0
- package/dist/assets/TransactionDetailRoutes-Dlicv1YU.js +1 -0
- package/dist/assets/{TransactionDetailScreen-dG3SEGK8.js → TransactionDetailScreen-C21UfodB.js} +2 -2
- package/dist/assets/TransactionListRoutes-c14Zp_GU.js +1 -0
- package/dist/assets/TreasuryRoutes-BOUBbZba.js +37 -0
- package/dist/assets/VendorsRoutes-DQPJ2ahX.js +88 -0
- package/dist/assets/WiseConfirmationScreen-BgAYLRbZ.js +12 -0
- package/dist/assets/{ZeniAccountRoutes-C9gyx-Lb.js → ZeniAccountRoutes-Cm5PZOYy.js} +10 -10
- package/dist/assets/ZeniAccountStatementScreen-C-8gKp6H.js +9 -0
- package/dist/assets/{accountMappingHelper-DOs7iAIL.js → accountMappingHelper-C_PJMCg9.js} +1 -1
- package/dist/assets/{analytics-DZ6cwnOO.js → analytics-elDziMbO.js} +1 -1
- package/dist/assets/{analyticsHelper-D6TeBlJQ.js → analyticsHelper-vLClPvL0.js} +1 -1
- package/dist/assets/{core-BL7rYGUF.js → core-DF6XZR6t.js} +1 -1
- package/dist/assets/{decodeURIComponentSafe-B4a7LpJx.js → decodeURIComponentSafe-DjR1JOrN.js} +1 -1
- package/dist/assets/{dnd-BsiKGZTJ.js → dnd-Cjk62kit.js} +1 -1
- package/dist/assets/{empty-SbPe4M90.js → empty-BFMGUQ5p.js} +1 -1
- package/dist/assets/{empty-qvcbLK7S.js → empty-Blp6QSRg.js} +1 -1
- package/dist/assets/{emptyVideoElement-BMPAb-cr.js → emptyVideoElement-BxiyyOIX.js} +1 -1
- package/dist/assets/{epic-Bt3rVBX8.js → epic-CjuOPpmP.js} +2 -2
- package/dist/assets/{expenseAutomationHelper-DfYMglD1.js → expenseAutomationHelper-DtYcu9lZ.js} +1 -1
- package/dist/assets/getLocaleForTenant-BghPhTTn.js +1 -0
- package/dist/assets/{index-CPdgrrgU.js → index-73l2EN6L.js} +1 -1
- package/dist/assets/{index-BRAI-aTk.js → index-BJMpQHkg.js} +1 -1
- package/dist/assets/{index-DLTi5gVy.js → index-BN3P-M0E.js} +1 -1
- package/dist/assets/{index-BtCYCCEX.js → index-CGw0d03E.js} +1 -1
- package/dist/assets/{index-te7nCILo.js → index-Cm1WGUI8.js} +1 -1
- package/dist/assets/{index-E1NwyJIP.js → index-DDlsb2Pe.js} +12665 -12665
- package/dist/assets/{index-B_AHleOS.js → index-DV9ITGuT.js} +2 -2
- package/dist/assets/{index-C4WC13bA.js → index-DvD4ADMb.js} +1 -1
- package/dist/assets/{lexical-BSRawlvX.js → lexical-CSD0azk6.js} +1 -1
- package/dist/assets/{liveblocks-BeSMR7a1.js → liveblocks-D4WYBu5d.js} +1 -1
- package/dist/assets/{lottie-joMwFamf.js → lottie-BmpBYIvu.js} +1 -1
- package/dist/assets/{mui-CPSuUssr.js → mui-B4yW9pH-.js} +1 -1
- package/dist/assets/{pathToGoBack-rem3sHLx.js → pathToGoBack-D8-KE8Du.js} +1 -1
- package/dist/assets/{pdf-CcTg_U5O.js → pdf-CGyqZzIC.js} +4 -4
- package/dist/assets/{pdf-lib-Cu5wZc2A.js → pdf-lib-Dh61rZh4.js} +1 -1
- package/dist/assets/{plaid-DMXel13h.js → plaid-D38FQUk-.js} +1 -1
- package/dist/assets/{pusher-IEbMI61m.js → pusher-CqUxDVhu.js} +1 -1
- package/dist/assets/{react-34F3zNgD.js → react-BMMd1waU.js} +1 -1
- package/dist/assets/{react-B6LrhCL-.js → react-BMRcwifd.js} +1 -1
- package/dist/assets/{react-D5rCBPHe.js → react-CIXsO3WM.js} +1 -1
- package/dist/assets/{react-p4SZ9iHE.js → react-DhQUnxri.js} +1 -1
- package/dist/assets/{react-Cyo5bdBF.js → react-DuBQLZ-9.js} +1 -1
- package/dist/assets/{react-BtgwZRYq.js → react-Uo80T9aY.js} +1 -1
- package/dist/assets/{recharts-BP8J0UHA.js → recharts-BiczA0FA.js} +1 -1
- package/dist/assets/routePaths-DGP8B7_s.js +1 -0
- package/dist/assets/{sentry-Uj7AWjah.js → sentry-xA0rcm0B.js} +1 -1
- package/dist/assets/{url-Cc0feVFM.js → url-D7Tfrndr.js} +1 -1
- package/dist/assets/{url-CnKkchc3.js → url-teROgVHf.js} +1 -1
- package/dist/assets/useAiCfoDashboardSuggestedQuestionsChips-p6fhiYGJ.js +1 -0
- package/dist/assets/useAskAiCfoHostNavButtonProps-d04WxUMr.js +1 -0
- package/dist/assets/useChargeCardPusherEvents-EdGQYrNX.js +1 -0
- package/dist/assets/{useDeviceId-CR3YwHzW.js → useDeviceId-CIwJhP5U.js} +1 -1
- package/dist/assets/useEmailConnectResultRefresh-DkeO72N3.js +1 -0
- package/dist/assets/useInitialThreadRequest-BCZ9SXeA.js +1 -0
- package/dist/assets/{useTaskManagerAccess-BVyRgvZH.js → useTaskManagerAccess-GgG1qznV.js} +1 -1
- package/dist/assets/{utils-Dn95OB7n.js → utils-Tr_0gxNT.js} +1 -1
- package/dist/assets/withTransactionSidePanel-DKKp2Btj.js +25 -0
- package/dist/assets/{zeni-epic-state-CxdZGPla.js → zeni-epic-state-C1PKBe4c.js} +5 -5
- package/dist/index.html +1 -1
- package/package.json +4 -4
- package/dist/assets/AccountMappingScreen-Cv_JISNl.js +0 -9
- package/dist/assets/AddressRoutes-D1wfXuM-.js +0 -1
- package/dist/assets/AddressScreen-DKIOTZOx.js +0 -9
- package/dist/assets/AiCfoScreen-BbhOSIw9.js +0 -22
- package/dist/assets/AppDrawer-DyJQZA6-.js +0 -10
- package/dist/assets/CardsAiCfoScreen-ZXvSY5tv.js +0 -14
- package/dist/assets/ConnectionAuthScreen-DXPq3qhF.js +0 -11
- package/dist/assets/CustomerOnboardingAuthScreen-C1BQROr2.js +0 -1
- package/dist/assets/CustomerOnboardingRoutes-BbMnpjPH.js +0 -30
- package/dist/assets/DefaultTenantHome-gR6Y3pYc.js +0 -1
- package/dist/assets/DomesticWireDetailScreen-B6SysKxJ.js +0 -18
- package/dist/assets/DrawerScreen-BUtXmCMv.js +0 -1
- package/dist/assets/EntityDetailRoutes-BJRFJx06.js +0 -1
- package/dist/assets/ExpenseAutomationRoutes-8h-9Hyes.js +0 -25
- package/dist/assets/FeaturePreviewScreen-07vQ7ieK.js +0 -1
- package/dist/assets/HubSpotOAuthCallbackScreen-B6PLbaf4.js +0 -1
- package/dist/assets/InboxNotificationsProvider-BH2D62uC.js +0 -1
- package/dist/assets/InvoicingRoutes-C2RjAxZA.js +0 -2
- package/dist/assets/MagicLinkSignInScreen-Y0R0oylb.js +0 -12
- package/dist/assets/MobileAppDrawer-CjyikhYJ.js +0 -1
- package/dist/assets/NotFoundScreen-C2tiSpQ7.js +0 -1
- package/dist/assets/NotificationRoutes-CFog6J5Q.js +0 -1
- package/dist/assets/OAuthConsentScreen-g72Ugnk9.js +0 -1
- package/dist/assets/PandLWithForecastRoutes-CMaqNXj1.js +0 -1
- package/dist/assets/PeopleRoutes-sgSiMpSO.js +0 -22
- package/dist/assets/PerformanceRoutes-CjfeH4u4.js +0 -1
- package/dist/assets/ReimbursementApprovalRoutes-LWePNTvC.js +0 -1
- package/dist/assets/ReportsRoutes-uMoEApCu.js +0 -1
- package/dist/assets/RewardsRoutes-CCLIDX41.js +0 -1
- package/dist/assets/ScreenRoutes-T2NqNjGF.js +0 -2
- package/dist/assets/SignInScreen-Ch6DTnK6.js +0 -1
- package/dist/assets/SignOutScreen-CfAh7qk3.js +0 -9
- package/dist/assets/TaskRoutes-DO-tMTQu.js +0 -9
- package/dist/assets/TransactionDetailRoutes-zmryAi6y.js +0 -1
- package/dist/assets/TransactionListRoutes-D_3U5FSp.js +0 -1
- package/dist/assets/TreasuryRoutes-XotmNx9W.js +0 -37
- package/dist/assets/VendorsRoutes-DCuo1D8L.js +0 -112
- package/dist/assets/WiseConfirmationScreen-D3ybpk8W.js +0 -12
- package/dist/assets/ZeniAccountStatementScreen-4u5gSdu6.js +0 -9
- package/dist/assets/getLocaleForTenant-akYNGA2f.js +0 -1
- package/dist/assets/routePaths-Cf2E-_nR.js +0 -1
- package/dist/assets/useAiCfoDashboardSuggestedQuestionsChips-DABf-MX6.js +0 -1
- package/dist/assets/useAskAiCfoHostNavButtonProps-CC7G-KyB.js +0 -1
- package/dist/assets/useChargeCardPusherEvents-DJOucGr5.js +0 -1
- package/dist/assets/useEmailConnectResultRefresh-DDRUKxe2.js +0 -1
- package/dist/assets/useInitialThreadRequest-DifgMaO6.js +0 -1
- package/dist/assets/withTransactionSidePanel-CPfQcd4u.js +0 -25
package/dist/assets/{TransactionDetailScreen-dG3SEGK8.js → TransactionDetailScreen-C21UfodB.js}
RENAMED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import{j as C}from"./liveblocks-
|
|
1
|
+
import{j as C}from"./liveblocks-D4WYBu5d.js";import{a as i}from"./sentry-xA0rcm0B.js";import{u as W,k as st,j as g,s as ge,g as De,h as Ce,i as Ae,N as ct,l as it}from"./core-DF6XZR6t.js";import{pu as Ie,fE as ee,gU as rt,TX as lt,oA as dt,oa as ut,CZ as se,bn as mt,de as we,bq as Re,sg as Q,V1 as Y,W9 as _e,Wa as le,Vr as Pe,m9 as Fe,Wb as Ue,Vw as de,Vx as ue,m_ as xe,Rt as me,W5 as G,m3 as Oe,m1 as Ve,md as pt,ph as ft,Wc as ht,Wd as St,CQ as J,m8 as Le,QO as Be,cm as yt,dk as Tt,We as bt,W4 as gt,Wf as It,Wg as kt,Wh as Et,Wi as vt,CM as Dt,Wj as Ct,Wk as At,Wl as wt,Wm as Rt,Wn as _t,mc as Pt,Wo as Ft,Wp as Ut,W6 as xt,Wq as Ot,Wr as Vt,Ws as Lt,QI as Bt,Qy as Nt,QX as Wt,me as zt,Ru as ke,pm as jt}from"./zeni-epic-state-C1PKBe4c.js";import{O as X,y as A,j as $,b2 as Mt,z as Ne,E as Gt,a1 as $t,b3 as qt,ab as Ht,a4 as ce,V as Qt,b4 as Yt,p as ie,as as Xt,b5 as Zt,b6 as Jt,b7 as Kt,ae as en,av as oe}from"./index-DDlsb2Pe.js";import{n as tn,S as nn,D as an}from"./mui-B4yW9pH-.js";import{u as on}from"./useAskAiCfoHostNavButtonProps-d04WxUMr.js";import{d as We}from"./decodeURIComponentSafe-DjR1JOrN.js";import{u as sn}from"./useInitialThreadRequest-BCZ9SXeA.js";import{h as ze,c as je,g as cn,e as rn}from"./routePaths-DGP8B7_s.js";import{u as ln}from"./expenseAutomationHelper-DtYcu9lZ.js";import{v as dn}from"./utils-Tr_0gxNT.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]="4b876913-da0e-4fcb-a6db-127011f53a16",t._sentryDebugIdIdentifier="sentry-dbid-4b876913-da0e-4fcb-a6db-127011f53a16")}catch{}})();function un(t=!0){const e=W(),o=st(),{useFeatureGate:n}=X(),{isFeatureEnabled:a}=n(A.isCreateTransferEntryFromExpenseEnabled);i.useEffect((()=>{if(!t||a!==!0)return;const s=c=>{const u=o.getState().createTransferEntryState.transferAccountsByType[c].fetchState;return u!=="In-Progress"&&u!=="Completed"};s("transferEntryEligible")&&e(Ie({kind:"transferEntryEligible"})),s("creditCardOnlyEligible")&&e(Ie({kind:"creditCardOnlyEligible"}))}),[t,a,e,o])}function mn(t,e){const o=(function(){const u=W(),[S,y]=i.useState(!1),[f,d]=i.useState(null),[r,h]=i.useState(null),{useDynamicConfig:I}=X(),{configValue:D,isDynamicConfigLoading:T}=I("transaction_categorization_config"),b=!T&&D?.capitalization_enabled===!0,k=g((l=>ee(l))),w=k.companyId,q=g((l=>rt(l.companyState,k.companyId)?.company.companyLocaleInfo?.currencySymbol??"$")),{capitalizableAccounts:U,capitalizableAccountOverrides:R,dismissedAccounts:_}=g((l=>{const E=l.tenantState.currentTenantId,v=E!=null?l.tenantState.tenantsById[E]:void 0;return{capitalizableAccounts:v?.capitalizableAccounts??null,capitalizableAccountOverrides:v?.capitalizableAccountOverrides??null,dismissedAccounts:v?.capitalizationOnboardingDismissedAccounts??null}}),ge),x=i.useRef(U);x.current=U;const P=i.useRef(R);P.current=R;const O=i.useRef(_);O.current=_;const V=g((l=>lt(l.accountState)),ge),H=i.useMemo((()=>{const l={};for(const E of V)E.accountId!=null&&E.accountName!=null&&(l[E.accountId]=E.accountName);return l}),[V]),z=r!=null?H[r]??null:null,L=i.useCallback((l=>{if(!b)return;const E=x.current;if(E==null)return;const v=E.accounts??[],M=new Set(l),Z=P.current??{},te=O.current;for(const B of v)if(M.has(B.accountId)&&Z[B.accountId]==null&&te?.[B.accountId]==null)return d(B.classificationType),h(B.accountId),void y(!0)}),[b]),j=i.useCallback(((l,E)=>{u(dt(w,l,E,!0)),y(!1),d(null),h(null)}),[u,w]),p=i.useCallback((()=>{r!=null&&(u(ut(w,r)),y(!1),d(null),h(null))}),[u,w,r]);return{showPopup:S&&b,popupType:f,popupAccountId:r,popupAccountName:z,currencySymbol:q,checkAndShowPopup:L,handleSubmit:j,handleDismiss:p}})(),n=i.useRef(void 0),a=i.useRef([]),s=i.useRef(o.checkAndShowPopup);s.current=o.checkAndShowPopup;const c=i.useRef(e);return c.current=e,i.useEffect((()=>{t==="In-Progress"&&(a.current=c.current()),t==="Completed"&&n.current==="In-Progress"&&a.current.length>0&&(s.current(a.current),a.current=[]),n.current=t}),[t]),o}const N=new Map,Ee=(t,e,o)=>`${t}|${e??""}|${o}`,K=(t,e)=>({recommendationFor:t.dimension,recommendationSetId:null,selectedSource:t.matchedSource,selectedRank:t.matchedRank,topPickSource:t.topPickSource,numberOfRecommendations:t.shownRecommendations.length,transactionId:e,lineId:t.lineId??null}),re=(t,e,o)=>({transactionId:e,lineId:t.lineId,dimension:t.dimension,outcome:t.outcome,selected:{name:t.selected.name,id:t.selected.id},matchedSource:t.matchedSource,matchedRank:t.matchedRank,topPickSource:t.topPickSource,shownRecommendations:t.shownRecommendations.map((n=>({source:n.source,rank:n.rank,value:{name:n.name,id:n.id},confidence:n.confidencePercentage!=null?n.confidencePercentage/100:void 0}))),...o}),Me=(t,e,o)=>{$.trackRecommendationFeedbackRetracted(K(e,o)),t(se(re(e,o,{outcome:"retracted"})))},On=(t,e)=>{const o=new Set(e.map(String));N.forEach(((n,a)=>{o.has(n.transactionId)&&(N.delete(a),Me(t,n.feedback,n.transactionId))}))},Vn=t=>{const e=new Set(t.map(String));N.forEach(((o,n)=>{e.has(o.transactionId)&&N.delete(n)}))};function pn(t){const e=W(),[o,n]=i.useState(null),{isEnabled:a,fallbackTransactionId:s}=t,c=i.useCallback((f=>f.transactionId??s??""),[s]),u=i.useCallback((f=>{if(!a)return;const d=c(f);if(d==="")return;if(f.outcome!=="accepted")return void n(f);((h,I,D,T)=>{const b=Ee(I,D,T),k=N.get(b);return k!=null&&(N.delete(b),Me(h,k.feedback,k.transactionId),!0)})(e,d,f.lineId,f.dimension)||(((h,I)=>{$.trackRecommendationAccepted({...K(h,I),recommendationConfidencePercentage:h.shownRecommendations[0]?.confidencePercentage??null})})(f,d),e(se(re(f,d,{}))))}),[a,c,e]),S=i.useCallback((f=>{if(o==null)return;const d=c(o);((r,h,I)=>{$.trackRecommendationFeedbackSubmitted({...K(r,h),feedbackOutcome:r.outcome,feedbackReasonLength:I,isNewEntitySelected:!1})})(o,d,f.length),e(se(re(o,d,{reasonText:f,skipped:!1}))),((r,h)=>{N.set(Ee(h,r.lineId,r.dimension),{feedback:r,transactionId:h})})(o,d),n(null)}),[o,c,e]),y=i.useCallback((()=>{var f,d;o!=null&&(f=o,d=c(o),$.trackRecommendationFeedbackSkipped({...K(f,d),feedbackOutcome:f.outcome,isNewEntitySelected:!1}),n(null))}),[o,c]);return{onRecommendationSelection:u,popup:o!=null?C.jsx(Mt,{feedback:o,onSubmit:S,onSkip:y}):null}}const pe=()=>{const t=Ne.getSignedInUser(),{useFeatureGate:e}=X(),{isFeatureEnabled:o}=e(A.isChainOfThoughtEnabled);return i.useMemo((()=>mt(t)&&o),[t,o])};function Ge(t){if(t!=null){if("customer"in t&&t.customer!=null){const{customer:e}=t;return{id:e.id,name:e.name,logo:e.logo,type:"customer",zeniId:e.id,qboId:e.id}}if("vendor"in t&&t.vendor!=null){const{vendor:e}=t;return{id:e.id,name:e.name,logo:e.logo,type:"vendor",zeniId:e.id,qboId:e.id}}}}function Ln(t,e){const o=W(),{useFeatureGate:n}=X(),a=g((p=>ee(p))),s=a.userRole.includes("charge_card_user")||a.userRole.includes("charge_card_admin"),c=a.userRole!=null&&we(a.userRole),u=a.userRole!=null&&Re(a.userRole),{isFeatureEnabled:S}=n(A.isVendorBulkUpdateOnTransactionEnabled),{isFeatureEnabled:y}=n(A.isExpenseAutomationEnabled),f=pe(),d=i.useMemo((()=>({id:t,type:Q(e)})),[t,e]),r=g((p=>Y(p,d))),h=r?.transactionDetailUpdateStatus?.fetchState,I=r?.transactionDetailLocalData?.lineItemById,D=g((p=>{const l=Y(p,d)?.transactionDetailLocalData.vendorUpdates?.id;return l==null?"Not-Started":p.transactionVendorViewState.editVendorStateById[l]?.saveStatus.fetchState??"Not-Started"})),T=i.useMemo((()=>r?.fetchState==="Completed"?Ge(r?.transaction):void 0),[r?.fetchState,r?.transaction]),b=g((p=>{if(T!=null)return _e(p.customerIncomeState,p.vendorExpenseState,p.trendState,T,"month")})),k=g((p=>le(p))),w=g((p=>{if(T!=null)return Pe(p.trendWithTransactionsState,T,"TransactionDetail")})),q=a.company?.companyInfo.firstMonthOfFY??1,U=g((p=>Fe(p.accountState,p.accountListState,"accountList"))),[R,_]=i.useState(!1),[x,P]=i.useState(!1),[O,V]=i.useState(!1);i.useEffect((()=>{_(!1),P(!1),V(!1)}),[t,e]);const H=i.useCallback((()=>{_(!1),P(!1)}),[]),[z,L]=i.useState(!1),j=w?.selectedPeriod?.timePeriod;return i.useEffect((()=>{O||r==null||r.transaction==null||(o(Ue({id:r.transaction.id,type:r.transaction.type})),V(!0)),T!=null&&(!s||c&&u===!1)&&(R?x||b==null||(P(!0),o(me(T,"TransactionDetail",{timeframe:"month",timePeriod:j??b}))):(o(de()),o(ue()),_(!0),o(xe(T))))}),[o,O,r?.fetchState,r?.transaction,T,s,c,u,R,x,b,j]),i.useEffect((()=>{k.newVendorState?.vendorDetailLocalData?.vendorName!=null?L(!0):L(!1)}),[k.newVendorState?.vendorDetailLocalData?.vendorName]),i.useEffect((()=>()=>{o(G("common"))}),[o]),{currentTenant:a,loggedInUserHasCardUserOrAdminRole:s,isUserHasDashboardAccess:c,isUserHasInvestorOrBankerAccess:u,isVendorBulkUpdateOnTransactionEnabled:S,isExpenseAutomationEnabled:y,isChainOfThoughtEnabled:f,selectedTransaction:d,transactionDetail:r,rawDetailSaveStatus:h,rawDetailLineItemById:I,vendorSaveStatus:D,tranEntity:T,defaultTrendTransactionTimePeriod:b,vendorViewDetails:k,uiState:w,firstMonthOfFY:q,uncategorizedAccounts:U,resetTrendIsFetchedStates:H,isCreateVendorDrawerOpen:z,setIsCreateVendorDrawerOpen:L}}const fn={overlayWidth:new Ht(100,100,58)},hn=({isOpen:t,onSaveVendor:e,onSaveSuccess:o,onCancel:n,vendorViewDetails:a})=>{const s=Gt(),c=$t(),u=W(),S=g((d=>le(d))),y=()=>{n()},f={vendorDetailView:a??S,onSaveSuccess:()=>{u(Ve()),u(pt("Not-Started")),o()},onSaveVendor:e,onCancelClick:y,saveVendorDetailLocalData:d=>{u(Oe({vendorId:void 0,localData:d}))}};return C.jsx(an,{anchor:"right",open:t,PaperProps:{style:{width:fn.overlayWidth.valuePercentage(c),boxShadow:"none"}},slotProps:{backdrop:{style:{backgroundColor:s.colors.black,opacity:.4,cursor:"pointer"}}},onClose:y,children:C.jsx(Sn,{onClick:d=>d.stopPropagation(),children:C.jsx(qt,{...f})})})},Sn=tn(nn)`
|
|
2
2
|
display: flex;
|
|
3
3
|
min-height: 100%;
|
|
4
4
|
flex-direction: column;
|
|
5
|
-
`;function yn(t,e){t(ft({transactionId:e.transactionId,creditAccountIntegrationId:e.creditAccountIntegrationId,debitAccountIntegrationId:e.debitAccountIntegrationId,memo:e.memo,transactionType:Q(e.transactionType),sourceTransactionType:Q(e.sourceTransactionType)}))}function Tn({currentTransactionId:t,enabled:e=!0,buildPath:o,beforeNavigate:n,navigate:a,navigateState:s}){const c=g((S=>S.createTransferEntryState.lastTransferEntryReplacement)),u=i.useRef(null);i.useEffect((()=>{if(!e||c==null||t==null||u.current===c)return;const{previousTransactionId:S,newTransactionId:y}=c;t.id===S.id&&t.type===S.type&&(u.current=c,n?.(),a(o(y),{replace:!0,state:s}))}),[e,c,t,o,n,a,s])}const bn=({closeDrawerHandler:t,overrideTransactionId:e,overrideTransactionType:o})=>{const n=De(),a=Ce(),s=z(),c=pe(),{transactionTypeEncoded:u,transactionId:S}=Ae(),y=e??S,f=o??ze(u??"");let d;We(y,f)&&(d={id:y,type:Q(f)});const r=d!=null?g((I=>Y(I,d))):void 0,h=()=>{const I=ce(n.state?.pathnameStackToGoBack),D=I.poppedPathname??((T=2)=>{let b="../";for(let k=0;k<T;k++)b=`${b}../`;return b})(1);a(D,{state:{pathnameStackToGoBack:I.newStack}})};return{transactionId:d,onSaveVendor:()=>{s(Le(d,void 0))},onSaveSuccess:()=>{if(r!=null&&r?.transaction&&r?.transactionDetailLocalData.vendorUpdates?.qboId!=null&&r?.transactionDetailLocalData.vendorUpdates?.id!=null){const I=r?.transactionDetailLocalData.vendorUpdates,D={id:r?.transactionDetailLocalData.vendorUpdates?.qboId,zeniId:r?.transactionDetailLocalData.vendorUpdates?.id,type:"vendor",name:I?.name,qboId:r?.transactionDetailLocalData.vendorUpdates?.qboId??""},T={transactionId:{id:r?.transaction?.id,type:r?.transaction?.type},transaction:r?.transaction,lineIds:r?.transaction?.lines?.map((b=>b.id))??[]};s(J({entity:D,amount:r?.transaction?.amount.amount,transactionDetails:T,flowType:"detail",isFetchCOT:c}))}h()},onCancel:()=>{d!=null&&s(ht({transactionId:d})),s(Ue()),s(St()),t(!0),h()}}},gn=it((function(t,e){const o=Y(t,e.selectedTransaction);let n;o==null&&console.warn("Check if the you've selected the transaction before getting the details");const a=Ne.getSignedInUser(),s=t.tenantState.currentTenantId,c={userId:a?.userId??"",sessionId:a?.zeniSessionId??"",tenantId:s??""};o!=null&&o.fetchState==="Completed"&&o.transaction!=null&&e.entity!=null&&(n=bt(t,e.entity,"TransactionDetail"));const u=t.entityAutoCompleteState.autoCompleteText.common,S=gt(t,"common"),y=ee(t);return{transactionDetail:o,transactionAttachmentEndpointToDownload:`${oe}/transaction_attachment`,transactionAttachmentsEndpointToFetch:y.externalConnections?.accounting[0]?.connectionName==="netsuite"?`${oe}/transaction_attachments_accounting_provider`:`${oe}/transaction_attachments`,attachmentUploadEndpoint:`${en.accountMicroServiceBaseUrl}`,isCOTEnabled:e.isCOTEnabled,authParams:c,trendReport:n,analytics:$,uncategorizedAccounts:e.uncategorizedAccounts,autoCompleteData:{autoCompleteText:u,entityAutoCompleteView:S},isVendorBulkUpdateOnTransactionEnabled:e.isVendorBulkUpdateOnTransactionEnabled,isExpenseAutomationEnabled:e.isExpenseAutomationEnabled,enableBackClickOnSave:e.location.state?.message?.startsWith("comingFromScheduleDetails"),isTransactionSplitEditMode:o?.transactionDetailLocalData?.editMode??!1}}),(function(t,e){const{isCOTEnabled:o}=e;return{onBackClick:()=>{if(t(G("common")),e.onBackClick!=null)return void e.onBackClick();const n=ce(e.location.state?.pathnameStackToGoBack),a=n.poppedPathname??$e(2);e.navigate(a,{state:{pathnameStackToGoBack:n.newStack,message:"comingFromTransactionDetail"}})},discardTransactionDetailLocalData:(n,a)=>{e.transaction!=null&&t(jt({transactionId:{id:e.transaction.id,type:e.transaction.type},vendorId:n,customerId:a}))},onTransactionClick:n=>{e.resetTrendIsFetchedStates(),t(de()),t(ue());const a=ie(e.location.state?.pathnameStackToGoBack,e.location.pathname);e.navigate(je(n,e.tenantEmailDomain),{state:{pathnameStackToGoBack:a}})},onTrendSelectedPeriodChange:n=>{if(n==null)e.defaultTrendTransactionTimePeriod!=null&&t(ke(e.entity,"TransactionDetail",{timeframe:"month",timePeriod:e.defaultTrendTransactionTimePeriod}));else{const a=n.currentTimePeriod==null?n.addTimePeriod:{startDate:n.addTimePeriod.startDate,endDate:n.currentTimePeriod.endDate};t(me(e.entity,"TransactionDetail",{timeframe:n.timeframe,timePeriod:n.addTimePeriod})),t(ke(e.entity,"TransactionDetail",{timeframe:n.timeframe,timePeriod:a}))}},onSaveUpdates:(n,a,s,c)=>{t(c===!0&&s!=null?Le(n,s,!0,e.isExpenseAutomationEnabled):Wt({transactionId:n,isExpenseAutomationEnabled:e.isExpenseAutomationEnabled,cotTransactionTracking:a})),t(G("common"))},onUploadAttachmentAttachment:n=>{t(zt(n))},onDeleteAttachment:n=>{e.transaction!=null&&t(Nt(n,{id:e.transaction.id,type:e.transaction.type}))},onSaveTransactionDetailLocalData:(n,a)=>{t(Bt({transactionId:n,transactionLocalData:a}))},onUpdateAllChecked:(n,a,s,c)=>{e.transaction!=null&&t(Lt(e.selectedTransaction,e.transaction,n,a,s,c))},onResetLineItemsCategoryClassInLocalData:(n,a,s,c,u,S)=>{t(Ut(n,a,s,c,u,S))},onChangeCategoryClassWhenUpdateAllIsChecked:(n,a)=>{e.transaction!=null&&t(Ot({id:e.transaction.id,type:e.transaction.type},e.transaction,n,a))},onSaveSuccess:()=>{const n=ce(e.location.state?.pathnameStackToGoBack);if(n.poppedPathname!=null){const a=dn(n.poppedPathname,"/").split("/"),s=a[a.length-1];if(["uncategorized-income","uncategorized-expense","missing-receipts"].includes(s)&&e.navigate(n.poppedPathname,{state:{pathnameStackToGoBack:n.newStack}}),e.location.state?.message==="comingFromScheduleDetails"){const c=`${cn(e.tenantEmailDomain)}`;e.navigate(c)}else if(e.location.state?.message==="comingFromScheduleDetailsFixedAssets"){const c=`${rn(e.tenantEmailDomain)}`;e.navigate(c)}}},onPageRefresh:()=>{t(Be(e.selectedTransaction,!0))},autoCompleteActions:{onAutoCompleteInputChange:(n,a)=>{n.trim().length>=2?t(xt({searchString:n,entityType:a,searchOrigin:"common"})):n.trim().length===0&&t(G("common"))},onCancelAutoComplete:()=>{t(G("common"))}},onFetchRecommendationsForEntity:(n,a,s,c)=>{t(J({entity:n,amount:a,transactionDetails:s,flowType:"detail",isBulkFetch:c,isFetchCOT:o}))},clearRecommendationForLineId:n=>{const{transactionId:a,transaction:s,lineId:c}=n;t(Vt(a,s,c))},resetUpdateErrorState:()=>{const n={id:e.selectedTransaction.id,type:e.selectedTransaction.type};t(Ft(n))},onSaveVendorInLocalData:(n,a,s,c,u)=>{if(t(Pt({transactionId:n,vendorUpdates:a,entity:s})),a.id!=null&&s!=null&&c!=null&&u!=null&&t(J({entity:s,amount:c,transactionDetails:u,flowType:"detail",isFetchCOT:o})),t(Oe({vendorId:a.id?a.id:void 0,localData:{vendorName:a.name,vendorId:a.id?a.id:void 0}})),!a.id&&e.transaction!=null){const S=e.transaction,y=ie(e.location.state?.pathnameStackToGoBack,e.location.pathname);e.navigate(`/${e.tenantEmailDomain}/transaction/${encodeURIComponent(S.type??"")}/${S.id}/vendor/create`,{state:{pathnameStackToGoBack:y}})}},onSaveCustomerInLocalData:(n,a,s,c,u)=>{t(wt({transactionId:n,customerUpdates:a,entity:s})),a.id!=null&&s!=null&&c!=null&&u!=null&&t(J({entity:s,amount:c,transactionDetails:u,flowType:"detail",isFetchCOT:o}))},onUpdateAllTranactionsWithCurrentVendorChecked:n=>{t(_t({transactionId:{id:e.selectedTransaction.id,type:e.selectedTransaction.type},isUpdateEnabled:n}))},onClickUpdateVendorToAllLineItems:(n,a,s)=>{t(Rt(n,a,s))},onResetVendorToAllLineItems:(n,a,s)=>{t(At(n,a,s))},saveLatestSelectedEntity:(n,a,s)=>{t(Ct({transactionId:n,lineId:a,entity:s}))},updateVendorBulkRecommendationsFetchStatus:(n,a)=>{t(Dt(n,a))},setIsVendorUpdateAllChecked:(n,a,s)=>{t(vt(n,a,s))},onCreateTransferEntry:e.isCreateTransferEntryFromExpenseEnabled===!0?n=>yn(t,n):void 0,onLineAdd:()=>{if(e.transaction==null)return;const n={id:e.transaction.id,type:e.transaction.type},a=e.transaction.type==="journal_entry",s=e.transaction.amount?.currencyCode??"",c=e.transaction.amount?.currencySymbol??"",u=a?{amount:{amount:0,currencyCode:s,currencySymbol:c},id:crypto.randomUUID(),isCategoryMiscategorized:!1,isClassMiscategorized:!1,lineDescription:"",platformLineDetailType:"journal_entry_line_detail",type:"journal_entry_transaction_line",postingType:void 0,postingTypeName:"",lineTransactionType:"journal_entry"}:{amount:{amount:0,currencyCode:s,currencySymbol:c},id:crypto.randomUUID(),isCategoryMiscategorized:!1,isClassMiscategorized:!1,lineDescription:"",platformLineDetailType:"account_based_expense_line_detail",type:"transaction_with_account_and_class_line"};t(Et(n,u))},onLineDelete:n=>{if(e.transaction==null)return;const a={id:e.transaction.id,type:e.transaction.type};t(kt(a,n))},onToggleSplitEditMode:n=>{if(e.transaction==null)return;const a={id:e.transaction.id,type:e.transaction.type};t(It(a,n))}}}))(Zt);function Bn(){const t=Ce(),e=z(),o=De(),{useFeatureGate:n}=X(),a=Qt(),s=g((m=>ee(m))),c=s.userRole.includes("charge_card_user")||s.userRole.includes("charge_card_admin"),u=s.userRole!=null&&Re(s.userRole),S=s.userRole!=null&&_e(s.userRole),{isFeatureEnabled:y}=n(A.isVendorBulkUpdateOnTransactionEnabled),{isFeatureEnabled:f}=n(A.isExpenseAutomationEnabled),{tenantEmailDomain:d,transactionTypeEncoded:r,transactionId:h}=Ae(),[I,D]=i.useState(!1),T=ze(r??""),b=We(h,T),k=g((m=>m.transactionVendorViewState)),R=pe(),{isFeatureEnabled:q}=n(A.isRecommendationFeedbackEnabled),V=Yt(),{onRecommendationSelection:_,popup:w}=pn({isEnabled:q,fallbackTransactionId:h}),x=i.useMemo((()=>({...V,onRecommendationSelection:_})),[V,_]),{isFeatureEnabled:P}=n(A.isTransactionCommentingEnabled),{isFeatureEnabled:O}=n(A.isCreateTransferEntryFromExpenseEnabled),{isFeatureEnabled:U}=n(A.isProjectsTransactionsEnabled),{isFeatureEnabled:H}=n(A.isTransactionSplitEnabled),W=a?.currentTenant?.companyId,L=a?.currentTenant?.companyName,j=sn(W),p=i.useMemo((()=>{if(b)return{id:h,type:Q(T)}}),[b,h,T]),l=p!=null?g((m=>Y(m,p))):void 0,E=l?.transactionDetailLocalData.vendorUpdates?.id!=null?k.editVendorStateById[l?.transactionDetailLocalData.vendorUpdates.id]?.saveStatus.fetchState:"Not-Started",v=l?.fetchState==="Completed"?Ge(l?.transaction):void 0,M=g((m=>v!=null?we(m.customerIncomeState,m.vendorExpenseState,m.trendState,v,"month"):void 0)),K=g((m=>le(m))),te=g((m=>v!=null?Pe(m.trendWithTransactionsState,v,"TransactionDetail"):void 0)),B=s.company?.companyInfo.firstMonthOfFY??1,qe=g((m=>Fe(m.accountState,m.accountListState,"accountList"))),[He,fe]=i.useState(!1),[Qe,he]=i.useState(!1),[Ye,Se]=i.useState(!1),Xe=i.useCallback((m=>je(m,d??"")+o.search),[d,o.search]),Ke=i.useCallback((()=>{Se(!1)}),[]);Tn({currentTransactionId:p,enabled:d!=null&&d!=="",buildPath:Xe,beforeNavigate:Ke,navigate:t,navigateState:o.state});const ye=()=>{fe(!1),he(!1)},Te=ln();un();const ne=i.useRef(l?.transaction);ne.current=l?.transaction;const Je=l?.transactionDetailUpdateStatus?.fetchState,F=mn(Je,(()=>{const m=[];if(ne.current!=null)for(const ae of ne.current.lines??[])"account"in ae&&ae.account?.accountId!=null&&m.push(ae.account.accountId);return m}));i.useEffect((()=>{p!=null&&l!=null&&l.fetchState==="Not-Started"&&(e(Be(p,!1)),ye())}),[e,p,l?.fetchState]),i.useEffect((()=>{if(p!=null&&l?.fetchState==="Error"){const m=ie(o.state?.pathnameStackToGoBack,o.pathname);t("page-not-found",{replace:!0,state:Te?{pathnameStackToGoBack:m,message:"expenseAutomation",origin:"transaction_categorization"}:{pathnameStackToGoBack:m,message:"pageNotFound",origin:"transaction_detail"}})}}),[p,l?.fetchState,t,o.state,o.pathname,Te]),i.useEffect((()=>{Ye||l==null||l.transaction==null||(e(Ve({id:l.transaction.id,type:l.transaction.type})),Se(!0));const m=o.state?.searchContext;v==null&&l?.fetchState==="Completed"&&ve(l?.transaction,m),v!=null&&(!c||u&&S===!1)&&(He?Qe||M==null||(he(!0),e(me(v,"TransactionDetail",{timeframe:"month",timePeriod:te?.selectedPeriod?.timePeriod??M}))):(e(de()),e(ue()),ve(l?.transaction,m),fe(!0),e(xe(v))))}),[l?.fetchState,l?.transaction,M,c]),i.useEffect((()=>{K.newVendorState?.vendorDetailLocalData?.vendorName!=null?D(!0):D(!1)}),[K.newVendorState?.vendorDetailLocalData?.vendorName]),i.useEffect((()=>()=>{e(G("common"))}),[]);const Ze=[r,h].filter((m=>m!=null)),{transactionId:be,onSaveVendor:et,onSaveSuccess:tt,onCancel:nt}=bn({closeDrawerHandler:m=>{D(!1),t(m?"../":"../..")}}),{isAiCfoAccessEnabled:at,onAskAiCfoClick:ot}=on({mobileExploreReferrer:"Transaction Details"});return Xt({isDataReady:l?.fetchState==="Completed"}),b?C.jsxs(C.Fragment,{children:[be!=null&&I&&C.jsx(hn,{isOpen:I,transactionId:be,onSaveVendor:et,onSaveSuccess:tt,onCancel:nt}),C.jsx(Kt,{toolkit:x,children:C.jsx(gn,{hideDeleteAttachment:!0,firstMonthOfFY:B,isDisabled:l?.transaction?.type==="transfer"&&a?.connectionName==="netsuite"?"readonly":void 0,tenantEmailDomain:d,location:o,navigate:t,selectedTransaction:p,entity:v,isCOTEnabled:R,defaultTrendTransactionTimePeriod:M,resetTrendIsFetchedStates:ye,transaction:l?.transaction,uncategorizedAccounts:qe,vendorSaveStatus:E,isVendorBulkUpdateOnTransactionEnabled:y,isCreateTransferEntryFromExpenseEnabled:O,isExpenseAutomationEnabled:f,isAiCfoAccessEnabled:at,onAskAiCfoClick:ot,isTransactionCommentingEnabled:P,isProjectsTransactionsEnabled:U,isTransactionSplitEnabled:H,companyId:W,companyName:L,initialOpenThreadRequest:j})}),w,F.showPopup&&F.popupType!=null&&C.jsx(Jt,{popupType:F.popupType,currencySymbol:F.currencySymbol,accountId:F.popupAccountId??"",accountName:F.popupAccountName??"",onSubmit:F.handleSubmit,onDismiss:F.handleDismiss})]}):C.jsx(ct,{to:$e(Ze.length)})}const $e=(t=2)=>{let e="../";for(let o=0;o<t;o++)e=`${e}../`;return e},ve=(t,e)=>{if(t!=null){const{transactionCategory:o,transactionClass:n}=In(t),a=kn(t);$.trackTransactionDetails(t.account?.accountId,t.account?.accountName,t.id,a,o.length>0?o:void 0,n.length>0?n:void 0,t.type,t.amount,t.memo,t.lines?.length??0,t.attachments?.map((s=>s.fileName)),e!=null?"Search":void 0,e?.searchTerm,e?.resultPosition,e?.resultsCount)}},In=t=>{const e=[],o=[];return t.lines?.forEach((n=>{switch(n.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 a=n;a!=null&&a.account!=null&&a.account.accountName?.length>0&&e.push(a.account.accountName),a.class!=null&&a.class.className?.length>0&&o.push(a.class.className);break}}})),{transactionCategory:e,transactionClass:o}},kn=t=>yt(t)===!0?t.customer?.name??"":Tt(t)===!0?t.vendor?.name??"":t.memo!=null?t.memo:t.type;export{hn as C,Bn as T,pn as a,un as b,mn as c,bn as d,gn as e,Tn as f,pe as g,Un as h,yn as i,ve as l,On as r,Ln as u};
|
|
5
|
+
`;function yn(t,e){t(ft({transactionId:e.transactionId,creditAccountIntegrationId:e.creditAccountIntegrationId,debitAccountIntegrationId:e.debitAccountIntegrationId,memo:e.memo,transactionType:Q(e.transactionType),sourceTransactionType:Q(e.sourceTransactionType)}))}function Tn({currentTransactionId:t,enabled:e=!0,buildPath:o,beforeNavigate:n,navigate:a,navigateState:s}){const c=g((S=>S.createTransferEntryState.lastTransferEntryReplacement)),u=i.useRef(null);i.useEffect((()=>{if(!e||c==null||t==null||u.current===c)return;const{previousTransactionId:S,newTransactionId:y}=c;t.id===S.id&&t.type===S.type&&(u.current=c,n?.(),a(o(y),{replace:!0,state:s}))}),[e,c,t,o,n,a,s])}const bn=({closeDrawerHandler:t,overrideTransactionId:e,overrideTransactionType:o})=>{const n=De(),a=Ce(),s=W(),c=pe(),{transactionTypeEncoded:u,transactionId:S}=Ae(),y=e??S,f=o??We(u??"");let d;ze(y,f)&&(d={id:y,type:Q(f)});const r=d!=null?g((I=>Y(I,d))):void 0,h=()=>{const I=ce(n.state?.pathnameStackToGoBack),D=I.poppedPathname??((T=2)=>{let b="../";for(let k=0;k<T;k++)b=`${b}../`;return b})(1);a(D,{state:{pathnameStackToGoBack:I.newStack}})};return{transactionId:d,onSaveVendor:()=>{s(Le(d,void 0))},onSaveSuccess:()=>{if(r!=null&&r?.transaction&&r?.transactionDetailLocalData.vendorUpdates?.qboId!=null&&r?.transactionDetailLocalData.vendorUpdates?.id!=null){const I=r?.transactionDetailLocalData.vendorUpdates,D={id:r?.transactionDetailLocalData.vendorUpdates?.qboId,zeniId:r?.transactionDetailLocalData.vendorUpdates?.id,type:"vendor",name:I?.name,qboId:r?.transactionDetailLocalData.vendorUpdates?.qboId??""},T={transactionId:{id:r?.transaction?.id,type:r?.transaction?.type},transaction:r?.transaction,lineIds:r?.transaction?.lines?.map((b=>b.id))??[]};s(J({entity:D,amount:r?.transaction?.amount.amount,transactionDetails:T,flowType:"detail",isFetchCOT:c}))}h()},onCancel:()=>{d!=null&&s(ht({transactionId:d})),s(Ve()),s(St()),t(!0),h()}}},gn=it((function(t,e){const o=Y(t,e.selectedTransaction);let n;o==null&&console.warn("Check if the you've selected the transaction before getting the details");const a=Ne.getSignedInUser(),s=t.tenantState.currentTenantId,c={userId:a?.userId??"",sessionId:a?.zeniSessionId??"",tenantId:s??""};o!=null&&o.fetchState==="Completed"&&o.transaction!=null&&e.entity!=null&&(n=bt(t,e.entity,"TransactionDetail"));const u=t.entityAutoCompleteState.autoCompleteText.common,S=gt(t,"common"),y=ee(t);return{transactionDetail:o,transactionAttachmentEndpointToDownload:`${oe}/transaction_attachment`,transactionAttachmentsEndpointToFetch:y.externalConnections?.accounting[0]?.connectionName==="netsuite"?`${oe}/transaction_attachments_accounting_provider`:`${oe}/transaction_attachments`,attachmentUploadEndpoint:`${en.accountMicroServiceBaseUrl}`,isCOTEnabled:e.isCOTEnabled,authParams:c,trendReport:n,analytics:$,uncategorizedAccounts:e.uncategorizedAccounts,autoCompleteData:{autoCompleteText:u,entityAutoCompleteView:S},isVendorBulkUpdateOnTransactionEnabled:e.isVendorBulkUpdateOnTransactionEnabled,isExpenseAutomationEnabled:e.isExpenseAutomationEnabled,enableBackClickOnSave:e.location.state?.message?.startsWith("comingFromScheduleDetails"),isTransactionSplitEditMode:o?.transactionDetailLocalData?.editMode??!1}}),(function(t,e){const{isCOTEnabled:o}=e;return{onBackClick:()=>{if(t(G("common")),e.onBackClick!=null)return void e.onBackClick();const n=ce(e.location.state?.pathnameStackToGoBack),a=n.poppedPathname??$e(2);e.navigate(a,{state:{pathnameStackToGoBack:n.newStack,message:"comingFromTransactionDetail"}})},discardTransactionDetailLocalData:(n,a)=>{e.transaction!=null&&t(jt({transactionId:{id:e.transaction.id,type:e.transaction.type},vendorId:n,customerId:a}))},onTransactionClick:n=>{e.resetTrendIsFetchedStates(),t(de()),t(ue());const a=ie(e.location.state?.pathnameStackToGoBack,e.location.pathname);e.navigate(je(n,e.tenantEmailDomain),{state:{pathnameStackToGoBack:a}})},onTrendSelectedPeriodChange:n=>{if(n==null)e.defaultTrendTransactionTimePeriod!=null&&t(ke(e.entity,"TransactionDetail",{timeframe:"month",timePeriod:e.defaultTrendTransactionTimePeriod}));else{const a=n.currentTimePeriod==null?n.addTimePeriod:{startDate:n.addTimePeriod.startDate,endDate:n.currentTimePeriod.endDate};t(me(e.entity,"TransactionDetail",{timeframe:n.timeframe,timePeriod:n.addTimePeriod})),t(ke(e.entity,"TransactionDetail",{timeframe:n.timeframe,timePeriod:a}))}},onSaveUpdates:(n,a,s,c)=>{t(c===!0&&s!=null?Le(n,s,!0,e.isExpenseAutomationEnabled):zt({transactionId:n,isExpenseAutomationEnabled:e.isExpenseAutomationEnabled,cotTransactionTracking:a})),t(G("common"))},onUploadAttachmentAttachment:n=>{t(Wt(n))},onDeleteAttachment:n=>{e.transaction!=null&&t(Nt(n,{id:e.transaction.id,type:e.transaction.type}))},onSaveTransactionDetailLocalData:(n,a)=>{t(Bt({transactionId:n,transactionLocalData:a}))},onUpdateAllChecked:(n,a,s,c)=>{e.transaction!=null&&t(Lt(e.selectedTransaction,e.transaction,n,a,s,c))},onResetLineItemsCategoryClassInLocalData:(n,a,s,c,u,S)=>{t(Vt(n,a,s,c,u,S))},onChangeCategoryClassWhenUpdateAllIsChecked:(n,a)=>{e.transaction!=null&&t(Ot({id:e.transaction.id,type:e.transaction.type},e.transaction,n,a))},onSaveSuccess:()=>{const n=ce(e.location.state?.pathnameStackToGoBack);if(n.poppedPathname!=null){const a=dn(n.poppedPathname,"/").split("/"),s=a[a.length-1];if(["uncategorized-income","uncategorized-expense","missing-receipts"].includes(s)&&e.navigate(n.poppedPathname,{state:{pathnameStackToGoBack:n.newStack}}),e.location.state?.message==="comingFromScheduleDetails"){const c=`${cn(e.tenantEmailDomain)}`;e.navigate(c)}else if(e.location.state?.message==="comingFromScheduleDetailsFixedAssets"){const c=`${rn(e.tenantEmailDomain)}`;e.navigate(c)}}},onPageRefresh:()=>{t(Be(e.selectedTransaction,!0))},autoCompleteActions:{onAutoCompleteInputChange:(n,a)=>{n.trim().length>=2?t(xt({searchString:n,entityType:a,searchOrigin:"common"})):n.trim().length===0&&t(G("common"))},onCancelAutoComplete:()=>{t(G("common"))}},onFetchRecommendationsForEntity:(n,a,s,c)=>{t(J({entity:n,amount:a,transactionDetails:s,flowType:"detail",isBulkFetch:c,isFetchCOT:o}))},clearRecommendationForLineId:n=>{const{transactionId:a,transaction:s,lineId:c}=n;t(Ut(a,s,c))},resetUpdateErrorState:()=>{const n={id:e.selectedTransaction.id,type:e.selectedTransaction.type};t(Ft(n))},onSaveVendorInLocalData:(n,a,s,c,u)=>{if(t(Pt({transactionId:n,vendorUpdates:a,entity:s})),a.id!=null&&s!=null&&c!=null&&u!=null&&t(J({entity:s,amount:c,transactionDetails:u,flowType:"detail",isFetchCOT:o})),t(Oe({vendorId:a.id?a.id:void 0,localData:{vendorName:a.name,vendorId:a.id?a.id:void 0}})),!a.id&&e.transaction!=null){const S=e.transaction,y=ie(e.location.state?.pathnameStackToGoBack,e.location.pathname);e.navigate(`/${e.tenantEmailDomain}/transaction/${encodeURIComponent(S.type??"")}/${S.id}/vendor/create`,{state:{pathnameStackToGoBack:y}})}},onSaveCustomerInLocalData:(n,a,s,c,u)=>{t(_t({transactionId:n,customerUpdates:a,entity:s})),a.id!=null&&s!=null&&c!=null&&u!=null&&t(J({entity:s,amount:c,transactionDetails:u,flowType:"detail",isFetchCOT:o}))},onUpdateAllTranactionsWithCurrentVendorChecked:n=>{t(Rt({transactionId:{id:e.selectedTransaction.id,type:e.selectedTransaction.type},isUpdateEnabled:n}))},onClickUpdateVendorToAllLineItems:(n,a,s)=>{t(wt(n,a,s))},onResetVendorToAllLineItems:(n,a,s)=>{t(At(n,a,s))},saveLatestSelectedEntity:(n,a,s)=>{t(Ct({transactionId:n,lineId:a,entity:s}))},updateVendorBulkRecommendationsFetchStatus:(n,a)=>{t(Dt(n,a))},setIsVendorUpdateAllChecked:(n,a,s)=>{t(vt(n,a,s))},onCreateTransferEntry:e.isCreateTransferEntryFromExpenseEnabled===!0?n=>yn(t,n):void 0,onLineAdd:()=>{if(e.transaction==null)return;const n={id:e.transaction.id,type:e.transaction.type},a=e.transaction.type==="journal_entry",s=e.transaction.amount?.currencyCode??"",c=e.transaction.amount?.currencySymbol??"",u=a?{amount:{amount:0,currencyCode:s,currencySymbol:c},id:crypto.randomUUID(),isCategoryMiscategorized:!1,isClassMiscategorized:!1,lineDescription:"",platformLineDetailType:"journal_entry_line_detail",type:"journal_entry_transaction_line",postingType:void 0,postingTypeName:"",lineTransactionType:"journal_entry"}:{amount:{amount:0,currencyCode:s,currencySymbol:c},id:crypto.randomUUID(),isCategoryMiscategorized:!1,isClassMiscategorized:!1,lineDescription:"",platformLineDetailType:"account_based_expense_line_detail",type:"transaction_with_account_and_class_line"};t(Et(n,u))},onLineDelete:n=>{if(e.transaction==null)return;const a={id:e.transaction.id,type:e.transaction.type};t(kt(a,n))},onToggleSplitEditMode:n=>{if(e.transaction==null)return;const a={id:e.transaction.id,type:e.transaction.type};t(It(a,n))}}}))(Kt);function Bn(){const t=Ce(),e=W(),o=De(),{useFeatureGate:n}=X(),a=Qt(),s=g((m=>ee(m))),c=s.userRole.includes("charge_card_user")||s.userRole.includes("charge_card_admin"),u=s.userRole!=null&&we(s.userRole),S=s.userRole!=null&&Re(s.userRole),{isFeatureEnabled:y}=n(A.isVendorBulkUpdateOnTransactionEnabled),{isFeatureEnabled:f}=n(A.isExpenseAutomationEnabled),{tenantEmailDomain:d,transactionTypeEncoded:r,transactionId:h}=Ae(),[I,D]=i.useState(!1),T=We(r??""),b=ze(h,T),k=g((m=>m.transactionVendorViewState)),w=pe(),{isFeatureEnabled:q}=n(A.isRecommendationFeedbackEnabled),U=Yt(),{onRecommendationSelection:R,popup:_}=pn({isEnabled:q,fallbackTransactionId:h}),x=i.useMemo((()=>({...U,onRecommendationSelection:R})),[U,R]),{isFeatureEnabled:P}=n(A.isTransactionCommentingEnabled),{isFeatureEnabled:O}=n(A.isCreateTransferEntryFromExpenseEnabled),{isFeatureEnabled:V}=n(A.isProjectsTransactionsEnabled),{isFeatureEnabled:H}=n(A.isTransactionSplitEnabled),z=a?.currentTenant?.companyId,L=a?.currentTenant?.companyName,j=sn(z),p=i.useMemo((()=>{if(b)return{id:h,type:Q(T)}}),[b,h,T]),l=p!=null?g((m=>Y(m,p))):void 0,E=l?.transactionDetailLocalData.vendorUpdates?.id!=null?k.editVendorStateById[l?.transactionDetailLocalData.vendorUpdates.id]?.saveStatus.fetchState:"Not-Started",v=l?.fetchState==="Completed"?Ge(l?.transaction):void 0,M=g((m=>v!=null?_e(m.customerIncomeState,m.vendorExpenseState,m.trendState,v,"month"):void 0)),Z=g((m=>le(m))),te=g((m=>v!=null?Pe(m.trendWithTransactionsState,v,"TransactionDetail"):void 0)),B=s.company?.companyInfo.firstMonthOfFY??1,qe=g((m=>Fe(m.accountState,m.accountListState,"accountList"))),[He,fe]=i.useState(!1),[Qe,he]=i.useState(!1),[Ye,Se]=i.useState(!1),Xe=i.useCallback((m=>je(m,d??"")+o.search),[d,o.search]),Ze=i.useCallback((()=>{Se(!1)}),[]);Tn({currentTransactionId:p,enabled:d!=null&&d!=="",buildPath:Xe,beforeNavigate:Ze,navigate:t,navigateState:o.state});const ye=()=>{fe(!1),he(!1)},Te=ln();un();const ne=i.useRef(l?.transaction);ne.current=l?.transaction;const Je=l?.transactionDetailUpdateStatus?.fetchState,F=mn(Je,(()=>{const m=[];if(ne.current!=null)for(const ae of ne.current.lines??[])"account"in ae&&ae.account?.accountId!=null&&m.push(ae.account.accountId);return m}));i.useEffect((()=>{p!=null&&l!=null&&l.fetchState==="Not-Started"&&(e(Be(p,!1)),ye())}),[e,p,l?.fetchState]),i.useEffect((()=>{if(p!=null&&l?.fetchState==="Error"){const m=ie(o.state?.pathnameStackToGoBack,o.pathname);t("page-not-found",{replace:!0,state:Te?{pathnameStackToGoBack:m,message:"expenseAutomation",origin:"transaction_categorization"}:{pathnameStackToGoBack:m,message:"pageNotFound",origin:"transaction_detail"}})}}),[p,l?.fetchState,t,o.state,o.pathname,Te]),i.useEffect((()=>{Ye||l==null||l.transaction==null||(e(Ue({id:l.transaction.id,type:l.transaction.type})),Se(!0));const m=o.state?.searchContext;v==null&&l?.fetchState==="Completed"&&ve(l?.transaction,m),v!=null&&(!c||u&&S===!1)&&(He?Qe||M==null||(he(!0),e(me(v,"TransactionDetail",{timeframe:"month",timePeriod:te?.selectedPeriod?.timePeriod??M}))):(e(de()),e(ue()),ve(l?.transaction,m),fe(!0),e(xe(v))))}),[l?.fetchState,l?.transaction,M,c]),i.useEffect((()=>{Z.newVendorState?.vendorDetailLocalData?.vendorName!=null?D(!0):D(!1)}),[Z.newVendorState?.vendorDetailLocalData?.vendorName]),i.useEffect((()=>()=>{e(G("common"))}),[]);const Ke=[r,h].filter((m=>m!=null)),{transactionId:be,onSaveVendor:et,onSaveSuccess:tt,onCancel:nt}=bn({closeDrawerHandler:m=>{D(!1),t(m?"../":"../..")}}),{isAiCfoAccessEnabled:at,onAskAiCfoClick:ot}=on({mobileExploreReferrer:"Transaction Details"});return Xt({isDataReady:l?.fetchState==="Completed"}),b?C.jsxs(C.Fragment,{children:[be!=null&&I&&C.jsx(hn,{isOpen:I,transactionId:be,onSaveVendor:et,onSaveSuccess:tt,onCancel:nt}),C.jsx(Zt,{toolkit:x,children:C.jsx(gn,{hideDeleteAttachment:!0,firstMonthOfFY:B,isDisabled:l?.transaction?.type==="transfer"&&a?.connectionName==="netsuite"?"readonly":void 0,tenantEmailDomain:d,location:o,navigate:t,selectedTransaction:p,entity:v,isCOTEnabled:w,defaultTrendTransactionTimePeriod:M,resetTrendIsFetchedStates:ye,transaction:l?.transaction,uncategorizedAccounts:qe,vendorSaveStatus:E,isVendorBulkUpdateOnTransactionEnabled:y,isCreateTransferEntryFromExpenseEnabled:O,isExpenseAutomationEnabled:f,isAiCfoAccessEnabled:at,onAskAiCfoClick:ot,isTransactionCommentingEnabled:P,isProjectsTransactionsEnabled:V,isTransactionSplitEnabled:H,companyId:z,companyName:L,initialOpenThreadRequest:j})}),_,F.showPopup&&F.popupType!=null&&C.jsx(Jt,{popupType:F.popupType,currencySymbol:F.currencySymbol,accountId:F.popupAccountId??"",accountName:F.popupAccountName??"",onSubmit:F.handleSubmit,onDismiss:F.handleDismiss})]}):C.jsx(ct,{to:$e(Ke.length)})}const $e=(t=2)=>{let e="../";for(let o=0;o<t;o++)e=`${e}../`;return e},ve=(t,e)=>{if(t!=null){const{transactionCategory:o,transactionClass:n}=In(t),a=kn(t);$.trackTransactionDetails(t.account?.accountId,t.account?.accountName,t.id,a,o.length>0?o:void 0,n.length>0?n:void 0,t.type,t.amount,t.memo,t.lines?.length??0,t.attachments?.map((s=>s.fileName)),e!=null?"Search":void 0,e?.searchTerm,e?.resultPosition,e?.resultsCount)}},In=t=>{const e=[],o=[];return t.lines?.forEach((n=>{switch(n.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 a=n;a!=null&&a.account!=null&&a.account.accountName?.length>0&&e.push(a.account.accountName),a.class!=null&&a.class.className?.length>0&&o.push(a.class.className);break}}})),{transactionCategory:e,transactionClass:o}},kn=t=>yt(t)===!0?t.customer?.name??"":Tt(t)===!0?t.vendor?.name??"":t.memo!=null?t.memo:t.type;export{hn as C,Bn as T,pn as a,un as b,mn as c,bn as d,gn as e,Tn as f,pe as g,Vn as h,yn as i,ve as l,On as r,Ln as u};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{j as s}from"./liveblocks-D4WYBu5d.js";import{h as Q,g as U,u as W,i as X,j as g,N as q,l as H,n as Me,o as C}from"./core-DF6XZR6t.js";import{fE as Z,tA as ee,le as p,ew as te,Rk as Se,br as pe,_Y as Be,l_ as ae,Vt as ne,_Z as fe,__ as Le,bE as k,Rg as he,_$ as Fe,$0 as Te,$1 as Oe,Rj as ge,$2 as Ge,$3 as De,$4 as we,$5 as Ie,$6 as $e,$7 as ze,$8 as ye,Sw as Re}from"./zeni-epic-state-C1PKBe4c.js";import{O as ce,y as J,j as F,G as ke,dc as oe,p as z,a4 as se,aq as _e,e as Ve}from"./index-DDlsb2Pe.js";import"./mui-B4yW9pH-.js";import{a as y}from"./sentry-xA0rcm0B.js";import{w as ie}from"./withTransactionSidePanel-DKKp2Btj.js";import{p as re,c as de}from"./routePaths-DGP8B7_s.js";import{w as Ne}from"./utils-Tr_0gxNT.js";import{d as j}from"./decodeURIComponentSafe-DjR1JOrN.js";import{Z as Je}from"./ZeniAccountStatementScreen-C-8gKp6H.js";import"./recharts-BiczA0FA.js";import"./analytics-elDziMbO.js";import"./plaid-D38FQUk-.js";import"./dnd-Cjk62kit.js";import"./stripe-cKAAJElX.js";import"./lottie-BmpBYIvu.js";import"./lexical-CSD0azk6.js";import"./pdf-CGyqZzIC.js";import"./useAskAiCfoHostNavButtonProps-d04WxUMr.js";import"./TransactionDetailScreen-C21UfodB.js";import"./useInitialThreadRequest-BCZ9SXeA.js";import"./expenseAutomationHelper-DtYcu9lZ.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]="8c77bc0a-4f62-46ca-be51-a06cbbcd53ec",a._sentryDebugIdIdentifier="sentry-dbid-8c77bc0a-4f62-46ca-be51-a06cbbcd53ec")}catch{}})();const Ue=["uncategorized-income","uncategorized-expense","miscategorized-income","miscategorized-expense","missing-receipts"],N=a=>Ne(a),Ye=()=>{const{common:a,uncategorizedTransactionList:e}=ke.getLocalizedStrings();return{amount:e.missingReceipt.missingReceiptMinAmount.amount,currencyCode:a.currency.currencyCode,currencySymbol:a.currency.currencySymbol}},qe=H((function(a,e){const t=Be(a.transactionState,a.transactionListState,e.selectedAccount.period,e.selectedAccount.timeframe,N(e.selectedAccount.tranListType));return{title:e.selectedAccount.title,subTitle:e.selectedAccount.subTitle,timeframe:e.selectedAccount.timeframe,timePeriod:ne(e.selectedAccount.period),dataAvailableForPeriod:e.dataAvailableForPeriod,report:t,currentScrollYOffset:t.uiState?.scrollYOffset??0,isAccountingClassesEnabled:ae(a)}}),(function(a,e){return{onBackClick:()=>{const t=se(e.location.state?.pathnameStackToGoBack),n=t.poppedPathname??"../../";e.navigate(n,{state:{pathnameStackToGoBack:t.newStack}})},onTimePeriodChange:(t,n,c)=>{e.closeSidePanel?.();const o=N(e.selectedAccount.tranListType),d=Qe(t,n,c,o,e.bookCloseDate);F.trackTransactionList(void 0,void 0,void 0,e.selectedAccount.title,void 0,!0),a(fe({uiState:{dateRange:d},type:N(e.selectedAccount.tranListType)})),a(Se(o,p(d),!1,o==="missingReceipts"?Ye():void 0)),e.onSelectedTimePeriodChange(p(d))},onTransactionItemClick:t=>{if(e.openTransactionPanel)return void e.openTransactionPanel(t.id,t.type);const n=de(t,e.tenantEmailDomain),c=z(e.location.state?.pathnameStackToGoBack,e.location.pathname);e.navigate(n,{state:{pathnameStackToGoBack:c}})},onTransactionListScroll:t=>{a(fe({uiState:{scrollYOffset:t},type:N(e.selectedAccount.tranListType)}))}}}))(oe),V=ie((function({...a}){const e=Q(),t=U(),n=W(),c=t.pathname.split("/").find((l=>Ue.includes(l))),o=c??"uncategorized-expense",{tenantEmailDomain:d}=X(),{accountType:Y,title:b,subTitle:A}=Ze(o),f="month",T=g((l=>Z(l))),v=T.company?.companyInfo.firstMonthOfFY??1,{useFeatureGate:S}=ce(),{isFeatureEnabled:h}=S(J.isProjectsTransactionsEnabled),I=g((l=>ee(l)))&&h,{dataAvailable:x,initialTimeframeTick:O}=Ke(o,v,T.bookCloseDate),[P,G]=y.useState(!1),[E,w]=y.useState(void 0),u=y.useMemo((()=>{const l=p(O);return{tranListType:o,accountType:te(Y),title:b,subTitle:A,timeframe:f,period:l}}),[o,f,Y,x]);y.useEffect((()=>{if(!P&&u!=null){G(!0),F.trackTransactionList(void 0,void 0,void 0,u.title);const l=N(u.tranListType);n(Se(l,u.period,!0,l==="missingReceipts"?Ye():void 0))}}),[P,u,n]);let M=u;return u!=null&&E!=null&&(M={...u,period:E}),c==null||M==null?s.jsx(q,{to:"../"}):s.jsx(qe,{firstMonthOfFY:v,tenantEmailDomain:d,location:t,useFixedPeriod:{timeframe:"month",numberOfPeriods:12},dataAvailableForPeriod:x,navigate:e,showProjectField:I,selectedAccount:M,referrerType:o,bookCloseDate:T.bookCloseDate,onSelectedTimePeriodChange:l=>w(l),...a})})),Ze=a=>{let e="",t="";const n=ke.getLocalizedStrings();switch(a){case"uncategorized-income":e="income",t=n.uncategorizedTransactionList.income.title;break;case"uncategorized-expense":e="expenses",t=n.common.texts.uncategorizedExpenses;break;case"miscategorized-expense":e="expenses",t=n.miscategorizedTransactionList.expense.title;break;case"miscategorized-income":e="income",t=n.miscategorizedTransactionList.income.title;break;case"missing-receipts":t=n.common.texts.receipts}return{accountType:e,title:t,subTitle:""}},Ke=(a,e,t)=>{const n=pe();let c=pe().startOf("month").subtract(11,"month");return t!=null&&a!=="missing-receipts"?t.add(1,"day").isBefore(c)?{dataAvailable:{startDate:t.add(1,"day"),endDate:n},initialTimeframeTick:{startDate:c,endDate:n}}:(c=t.add(1,"day"),{dataAvailable:{startDate:c,endDate:n},initialTimeframeTick:{startDate:c,endDate:n}}):{dataAvailable:re(5,e),initialTimeframeTick:{startDate:c,endDate:n}}},Qe=(a,e,t,n,c)=>{let o=e;return n==="missingReceipts"||c==null?a.startDate.isBefore(e.startDate,t)?o={startDate:a.startDate,endDate:e.endDate}:a.startDate.isAfter(e.endDate,t)?o={startDate:e.startDate,endDate:a.endDate}:console.error(`Invalid addTimePeriod ${JSON.stringify(a)}`):o=a.startDate.isBefore(c,t)?{startDate:c.add(1,"day"),endDate:e.endDate}:{startDate:a.startDate,endDate:e.endDate},o},We=H((function(a,e){const t=Fe(a.transactionState,a.transactionListState,e.selectedAccount.accountId,e.selectedAccount.accountType,e.selectedAccount.classId,e.selectedAccount.timeframe,e.selectedAccount.period);return{accountId:e.selectedAccount.accountId,accountType:e.selectedAccount.accountType,title:e.selectedAccount.title,timeframe:e.selectedAccount.timeframe,timePeriod:ne(e.selectedAccount.period),dataAvailableForPeriod:re(5,e.firstMonthOfFY),report:t,currentScrollYOffset:t.uiState?.scrollYOffset??0,isAccountingClassesEnabled:ae(a)}}),(function(a,e){return{onBackClick:()=>{const t=se(e.location.state?.pathnameStackToGoBack),n=t.poppedPathname??be();e.navigate(n,{state:{pathnameStackToGoBack:t.newStack}})},onTimePeriodChange:(t,n,c)=>{e.closeSidePanel?.();let o=n;t.startDate.isBefore(n.startDate,c)?o={startDate:t.startDate,endDate:n.endDate}:t.startDate.isAfter(n.endDate,c)?o={startDate:n.startDate,endDate:t.endDate}:console.error(`Invalid addTimePeriod ${JSON.stringify(t)}`),F.trackTransactionList(e.selectedAccount.accountId,void 0,e.referrerType,e.selectedAccount.title,void 0,!0),a(Te({accountId:e.selectedAccount.accountId,accountType:e.selectedAccount.accountType,classId:e.selectedAccount.classId,uiState:{dateRange:o}})),a(he(e.selectedAccount.accountId,e.selectedAccount.accountType,e.selectedAccount.classId,p(o))),e.onSelectedTimePeriodChange(p(o))},onTransactionItemClick:t=>{if(e.openTransactionPanel)return void e.openTransactionPanel(t.id,t.type);const n=de(t,e.tenantEmailDomain),c=z(e.location.state?.pathnameStackToGoBack,e.location.pathname);e.navigate(n,{state:{pathnameStackToGoBack:c}})},onTransactionListScroll:t=>{a(Te({accountId:e.selectedAccount.accountId,accountType:e.selectedAccount.accountType,classId:e.selectedAccount.classId,uiState:{scrollYOffset:t}}))}}}))(oe),Xe=ie((function({referrerType:a,...e}){const t=Q(),n=U(),c=W(),{tenantEmailDomain:o,accountTypeEncoded:d,accountIdEncoded:Y,classIdEncoded:b,timeframe:A,startDate:f,endDate:T,titleEncoded:v}=X(),S=j(d??""),h=j(Y??""),I=j(b??""),x=j(v??""),O=g((r=>Le(r.transactionListState,h,S,I))),[P,G]=y.useState(!1),[E,w]=y.useState(void 0),u=g((r=>Z(r))),M=u.company?.companyInfo.firstMonthOfFY??1,{useFeatureGate:l}=ce(),{isFeatureEnabled:m}=l(J.isProjectsTransactionsEnabled),$=g((r=>ee(r)))&&m;let i;const L=He(S,h,I,A,f,T,x);if(L){const r={startDate:k(f,"YYYY-MM-DD"),endDate:k(T,"YYYY-MM-DD")},_=et(O?.dateRange,r);i={accountId:h,accountType:te(S),classId:I,title:x,timeframe:A,period:_}}y.useEffect((()=>{P||i==null||(G(!0),F.trackTransactionList(i.accountId,void 0,a,i.title),c(he(i.accountId,i.accountType,i.classId,i.period)))}),[P,i,c]);let B=i;i!=null&&E!=null&&(B={...i,period:E});const R=[d,Y,b,A,f,T,v].filter((r=>r!=null));return L&&B!=null?s.jsx(We,{firstMonthOfFY:M,tenantEmailDomain:o,location:n,navigate:t,showProjectField:$,selectedAccount:B,referrerType:a,onSelectedTimePeriodChange:r=>w(r),...e}):s.jsx(q,{to:be(R.length)})})),be=(a=7)=>{let e="../";for(let t=0;t<a;t++)e=`${e}../`;return e},He=(a,e,t,n,c,o,d)=>a!=null&&e!=null&&t!=null&&n!=null&&c!=null&&o!=null&&(n==="month"||n==="quarter")&&k(c,"YYYY-MM-DD").isValid()&&k(o,"YYYY-MM-DD").isValid()&&d!=null,et=(a,e)=>a!=null&&a.endDate.isSame(e.endDate,"day")&&a.startDate.isBefore(e.startDate,"day")?p(a):p(e),tt=H((function(a,e){const t=Ge(a.transactionState,a.transactionListState,e.selectedAccount.accountId,e.selectedAccount.accountType,e.selectedAccount.projectId,e.selectedAccount.timeframe,e.selectedAccount.period);return{accountId:e.selectedAccount.accountId,accountType:e.selectedAccount.accountType,title:e.selectedAccount.title,timeframe:e.selectedAccount.timeframe,timePeriod:ne(e.selectedAccount.period),dataAvailableForPeriod:re(5,e.firstMonthOfFY),report:t,currentScrollYOffset:t.uiState?.scrollYOffset??0,isAccountingClassesEnabled:ae(a)}}),(function(a,e){return{onBackClick:()=>{const t=se(e.location.state?.pathnameStackToGoBack),n=t.poppedPathname??ve();e.navigate(n,{state:{pathnameStackToGoBack:t.newStack}})},onTimePeriodChange:(t,n,c)=>{e.closeSidePanel?.();let o=n;t.startDate.isBefore(n.startDate,c)?o={startDate:t.startDate,endDate:n.endDate}:t.startDate.isAfter(n.endDate,c)?o={startDate:n.startDate,endDate:t.endDate}:console.error(`Invalid addTimePeriod ${JSON.stringify(t)}`),F.trackTransactionList(e.selectedAccount.accountId,void 0,e.referrerType,e.selectedAccount.title,void 0,!0),a(De({accountId:e.selectedAccount.accountId,accountType:e.selectedAccount.accountType,projectId:e.selectedAccount.projectId,uiState:{dateRange:o}})),a(ge(e.selectedAccount.accountId,e.selectedAccount.accountType,e.selectedAccount.projectId,p(o))),e.onSelectedTimePeriodChange(p(o))},onTransactionItemClick:t=>{if(e.openTransactionPanel)return void e.openTransactionPanel(t.id,t.type);const n=de(t,e.tenantEmailDomain),c=z(e.location.state?.pathnameStackToGoBack,e.location.pathname);e.navigate(n,{state:{pathnameStackToGoBack:c}})},onTransactionListScroll:t=>{a(De({accountId:e.selectedAccount.accountId,accountType:e.selectedAccount.accountType,projectId:e.selectedAccount.projectId,uiState:{scrollYOffset:t}}))}}}))(oe),at=ie((function({referrerType:a,...e}){const t=Q(),n=U(),c=W(),{tenantEmailDomain:o,accountTypeEncoded:d,accountIdEncoded:Y,projectIdEncoded:b,timeframe:A,startDate:f,endDate:T,titleEncoded:v}=X(),S=j(d??""),h=j(Y??""),I=j(b??""),x=j(v??""),O=g((r=>Oe(r.transactionListState,h,S,I))),[P,G]=y.useState(!1),[E,w]=y.useState(void 0),u=g((r=>Z(r))),M=u.company?.companyInfo.firstMonthOfFY??1,{useFeatureGate:l}=ce(),{isFeatureEnabled:m}=l(J.isProjectsTransactionsEnabled),$=g((r=>ee(r)))&&m;let i;const L=nt(S,h,I,A,f,T,x);if(L){const r={startDate:k(f,"YYYY-MM-DD"),endDate:k(T,"YYYY-MM-DD")},_=ct(O?.dateRange,r);i={accountId:h,accountType:te(S),projectId:I,title:x,timeframe:A,period:_}}y.useEffect((()=>{P||i==null||(G(!0),F.trackTransactionList(i.accountId,void 0,a,i.title),c(ge(i.accountId,i.accountType,i.projectId,i.period)))}),[P,i,c]);let B=i;i!=null&&E!=null&&(B={...i,period:E});const R=[d,Y,b,A,f,T,v].filter((r=>r!=null));return L&&B!=null?s.jsx(tt,{firstMonthOfFY:M,tenantEmailDomain:o,location:n,navigate:t,showProjectField:$,selectedAccount:B,referrerType:a,onSelectedTimePeriodChange:r=>w(r),...e}):s.jsx(q,{to:ve(R.length)})})),ve=(a=7)=>{let e="../";for(let t=0;t<a;t++)e=`${e}../`;return e},nt=(a,e,t,n,c,o,d)=>a!=null&&e!=null&&t!=null&&n!=null&&c!=null&&o!=null&&(n==="month"||n==="quarter")&&k(c,"YYYY-MM-DD").isValid()&&k(o,"YYYY-MM-DD").isValid()&&d!=null,ct=(a,e)=>a!=null&&a.endDate.isSame(e.endDate,"day")&&a.startDate.isBefore(e.startDate,"day")?p(a):p(e),ot=H((function(a,e){const t=$e(a.transactionState,a.transactionListState,e.selectedAccount.accountId,e.selectedAccount.accountType,e.selectedAccount.timeframe,e.selectedAccount.period),n=t.account?.coaId,c=e.isConnectedAccountProviderUnit&&ze(n??"");return{accountId:e.selectedAccount.accountId,accountType:e.selectedAccount.accountType,title:e.selectedAccount.title,timeframe:e.selectedAccount.timeframe,timePeriod:ne(e.selectedAccount.period),dataAvailableForPeriod:re(5,e.firstMonthOfFY),report:t,currentScrollYOffset:t.uiState?.scrollYOffset??0,showStatementPageIcon:c,isAccountingClassesEnabled:ae(a)}}),(function(a,e){return{onBackClick:()=>{const t=se(e.location.state?.pathnameStackToGoBack),n=t.poppedPathname??Pe();e.navigate(n,{state:{pathnameStackToGoBack:t.newStack}})},onTimePeriodChange:(t,n,c)=>{e.closeSidePanel?.();let o=n;t.startDate.isBefore(n.startDate,c)?o={startDate:t.startDate,endDate:n.endDate}:t.startDate.isAfter(n.endDate,c)?o={startDate:n.startDate,endDate:t.endDate}:console.error(`Invalid addTimePeriod ${JSON.stringify(t)}`),F.trackTransactionList(e.selectedAccount.accountId,void 0,e.referrerType,e.selectedAccount.title,void 0,!0),a(ye({accountId:e.selectedAccount.accountId,accountType:e.selectedAccount.accountType,uiState:{dateRange:o}})),a(Ie(e.selectedAccount.accountId,e.selectedAccount.accountType,p(o))),e.onSelectedTimePeriodChange(p(o))},onTransactionItemClick:t=>{if(e.openTransactionPanel)return void e.openTransactionPanel(t.id,t.type);const n=de(t,e.tenantEmailDomain),c=z(e.location.state?.pathnameStackToGoBack,e.location.pathname);e.navigate(n,{state:{pathnameStackToGoBack:c}})},onTransactionListScroll:t=>{a(ye({accountId:e.selectedAccount.accountId,accountType:e.selectedAccount.accountType,uiState:{scrollYOffset:t}}))},onStatementPageIconClick:()=>{const t=rt(e.tenantEmailDomain),n=z(e.location.state?.pathnameStackToGoBack,e.location.pathname);e.navigate(t,{state:{pathnameStackToGoBack:n}})}}}))(oe),Ae=ie((function({referrerType:a,...e}){const t=Q(),n=U(),c=W(),{tenantEmailDomain:o,accountTypeEncoded:d,accountIdEncoded:Y,timeframe:b,startDate:A,endDate:f,titleEncoded:T,excludeSubAccounts:v}=X(),S=j(d??""),h=j(Y??""),I=j(T??""),x=!(v!=null&&v==="exclude_subaccounts"),O=g((D=>we(D.transactionListState,h,S))),[P,G]=y.useState(!1),[E,w]=y.useState(void 0),u=g((D=>Z(D))),M=u.company?.featuresActivationInfo.connectedAccountProvider==="unit",l=u.company?.companyInfo.firstMonthOfFY??1;let m;const $=st(S,h,b,A,f,I);if($){const D={startDate:k(A,"YYYY-MM-DD"),endDate:k(f,"YYYY-MM-DD")},le=it(O?.dateRange,D);m={accountId:h,accountType:te(S),title:I,timeframe:b,period:le}}let i=m;m!=null&&E!=null&&(i={...m,period:E});const{useFeatureGate:L}=ce(),{isFeatureEnabled:B}=L(J.isTransactionCommentingEnabled),R=y.useCallback(((D,le)=>{if(o==null)return;const me=D.url.split(`/${o}/`)[1];if(me==null)return;const[je,xe]=me.split("?"),K=new URLSearchParams(xe??"");K.set("view","full"),K.set("thread_id",le),K.set("entity_type",D.entityType);const Ce=z(n.state?.pathnameStackToGoBack,n.pathname);t(`/${o}/${je}?${K.toString()}`,{state:{pathnameStackToGoBack:Ce}})}),[t,o,n.state,n.pathname]),{isFeatureEnabled:r}=L(J.isProjectsTransactionsEnabled),_=g((D=>ee(D)))&&r,{areTenantIdsInSync:ue}=_e();y.useEffect((()=>{!P&&m!=null&&ue&&(G(!0),F.trackTransactionList(m.accountId,void 0,a,m.title),c(Ie(m.accountId,m.accountType,m.period,void 0,!1,x)))}),[P,m,c,ue]);const Ee=[d,Y,b,A,f,T].filter((D=>D!=null));return $&&i!=null?s.jsx(ot,{firstMonthOfFY:l,tenantEmailDomain:o,location:n,navigate:t,isConnectedAccountProviderUnit:M,isTransactionCommentingEnabled:B,onCommentThreadClick:R,showProjectField:_,selectedAccount:i,referrerType:a,onSelectedTimePeriodChange:D=>w(D),...e}):s.jsx(q,{to:Pe(Ee.length)})})),Pe=(a=7)=>{let e="../";for(let t=0;t<a;t++)e=`${e}../`;return e},st=(a,e,t,n,c,o)=>a!=null&&e!=null&&t!=null&&n!=null&&c!=null&&(t==="month"||t==="quarter")&&k(n,"YYYY-MM-DD").isValid()&&k(c,"YYYY-MM-DD").isValid()&&o!=null,it=(a,e)=>a!=null&&a.endDate.isSame(e.endDate,"day")&&a.startDate.isBefore(e.startDate,"day")?p(a):p(e),rt=a=>`/${a}/transactions/${Re}/statements`;function Mt(){const a=U().state?.referrer,e=g((n=>n.expenseAutomationViewState.selectedPeriodByTenantId))[g((n=>Z(n))).tenantId],t=Ve();return s.jsxs(Me,{children:[s.jsx(C,{path:"/:accountTypeEncoded/:accountIdEncoded/:timeframe/:startDate/:endDate/:titleEncoded/:excludeSubAccounts/*",element:s.jsx(Ae,{referrerType:a})}),s.jsx(C,{path:"/zeni-clearing-account/statements",element:s.jsx(Je,{})}),s.jsx(C,{path:"/*",element:s.jsx(Ae,{referrerType:a})}),s.jsx(C,{path:"/uncategorized-income/*",element:s.jsx(V,{})}),s.jsx(C,{path:"/uncategorized-expense/*",element:s.jsx(V,{})}),s.jsx(C,{path:"/miscategorized-income/*",element:s.jsx(V,{})}),s.jsx(C,{path:"/miscategorized-expense/*",element:s.jsx(V,{})}),s.jsx(C,{path:"/missing-receipts/*",element:t?s.jsx(q,{to:`../../month_end_close_checks/review/missing_receipts/${e.month}-${e.year}`}):s.jsx(V,{})}),s.jsx(C,{path:"/by-class/:accountTypeEncoded/:accountIdEncoded/:classIdEncoded/:timeframe/:startDate/:endDate/:titleEncoded/*",element:s.jsx(Xe,{referrerType:a})}),s.jsx(C,{path:"/by-project/:accountTypeEncoded/:accountIdEncoded/:projectIdEncoded/:timeframe/:startDate/:endDate/:titleEncoded/*",element:s.jsx(at,{referrerType:a})})]})}export{Mt as default};
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import{j as e}from"./liveblocks-D4WYBu5d.js";import{h as L,g as F,u as U,i as V,j as y,N as D,l as O,n as Te,o as k}from"./core-DF6XZR6t.js";import{cv as M,fE as v,Yv as B,NK as ae,Nr as q,Ns as ne,Yx as we,NN as Ie,Yt as Ce,Yu as se,YJ as ke,LO as je,Bx as Ae,Yz as be,NU as Ee,Yw as re,dc as Z,G1 as oe,dX as ve,dY as De,_V as Le,_W as Fe,Nt as Ue,_X as Be,Nu as Pe,ND as Re,bq as Ne,bJ as Ve,cG as Oe,bK as Me,cu as _e,bt as ze,Tw as Ge,ct as $e}from"./zeni-epic-state-C1PKBe4c.js";import{V as _,h as Ye,z as E,a8 as z,j as A,d5 as qe,d6 as Ze,d7 as Y,a1 as H,E as He,aq as Ke,as as We,O as ie,y as R,ab as Je,a7 as Xe,d8 as Qe,ae as K,p as et,d9 as tt,a4 as W,da as at,ai as nt,_ as X,db as st,g as rt}from"./index-DDlsb2Pe.js";import{D as ot,n as N,S as it}from"./mui-B4yW9pH-.js";import ct from"./NotFoundScreen-BYb00fRD.js";import{S as Q}from"./SetupPagesScreen-DxyeAl-N.js";import{a as p}from"./sentry-xA0rcm0B.js";import{u as lt}from"./useAskAiCfoHostNavButtonProps-d04WxUMr.js";import{u as ut}from"./useInitialThreadRequest-BCZ9SXeA.js";import{M as ce}from"./MobileAppDrawer-PtjV_ofL.js";import{F as dt}from"./FeaturePreviewScreen-KgN7vGcF.js";import{a as ee}from"./analyticsHelper-vLClPvL0.js";import"./recharts-BiczA0FA.js";import"./analytics-elDziMbO.js";import"./plaid-D38FQUk-.js";import"./dnd-Cjk62kit.js";import"./stripe-cKAAJElX.js";import"./lottie-BmpBYIvu.js";import"./lexical-CSD0azk6.js";import"./pdf-CGyqZzIC.js";import"./utils-Tr_0gxNT.js";import"./BusinessVerificationPageScreen-Bh5Bjz_t.js";import"./routePaths-DGP8B7_s.js";import"./InboxNotificationsProvider-B-NFQuyv.js";import"./useTaskManagerAccess-GgG1qznV.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]="ec27fbd9-6b59-46d5-ad07-1faa17adf7f0",t._sentryDebugIdIdentifier="sentry-dbid-ec27fbd9-6b59-46d5-ad07-1faa17adf7f0")}catch{}})();const pt=O((function(t,a){const{companyId:n}=a;return{treasurySetupView:B(t,n),analytics:A}}),(function(t,a){const{navigate:n,analytics:o,treasurySetupView:i}=a;return{onBackClick:()=>{n("../")},onNextClick:()=>{const r=i.fundAllocationLocalData;o.trackTreasuryPortfolioConfirm(r.riskScore,ee(r)),t(Ie(!0))},onUpdateFundAllocation:r=>{o.trackTreasuryAllocationAction("update",ee(r)),t(we(r))}}}))(qe);function mt(){const t=L(),a=F(),n=U(),{tenantEmailDomain:o}=V(),i=_(),r=y((I=>I.treasurySetupViewState.portfolioAllocationUpdateStatus?.fetchState)),m=Ye(r),s=M(i?.loggedInUserRoleMap),[d,c]=p.useState(!1),[S,T]=p.useState(!1),[l,u]=p.useState(!1),x=y((I=>v(I))),f=E.getSignedInUserTenant(o)?.companyId??x.companyId,C=E.getSignedInUser(),h=y((I=>B(I,f))),g=y((I=>I.treasurySetupViewState.fetchState)),j=y((I=>I.treasurySetupViewState.currentAllocation.fetchStatus?.fetchState)),w=y((I=>I.treasurySetupViewState.treasuryFundsDetails?.fetchStatus?.fetchState));if(C==null)throw Error("Can't access treasury portfolio allocation page without signing in...");if(p.useEffect((()=>{d||g!=="Not-Started"||f==null||(c(!0),n(ae(f,!0,!1)))}),[d,g,f,n]),p.useEffect((()=>{l||w!=="Not-Started"||f==null||(u(!0),n(q()))}),[l,w,f,n]),p.useEffect((()=>{S||j!=="Not-Started"||f==null||(T(!0),n(ne()))}),[S,j,f,n]),p.useEffect((()=>{m==="In-Progress"&&r==="Completed"&&t("../")}),[m,r,t]),x.companyTreasuryInfo?.info?.isTreasuryTOSAccepted===!1)return e.jsx(D,{to:"../promo"});const P=x.companyTreasuryInfo?.info?.isTreasuryTOSAccepted!==!0||g!=="Completed";return e.jsxs(e.Fragment,{children:[!P&&e.jsx(z,{analytics:A,onLoad:()=>{}}),e.jsx(pt,{navigate:t,location:a,companyId:f,isEditMode:!0,isLoading:P,isReadOnly:!s,treasurySetupView:h,analytics:A})]})}const ft=O((function(t,a){const n=a.currentTenant?.companyId;return{plaidConnectionDetails:ke(t,n,"zeni_treasury","treasury_setup").plaidConnectionDetails,treasurySetupView:B(t,n)}}),(function(t,a){const{navigate:n,transferDetails:o,treasurySetupView:i}=a,r=o.treasuryTransferMoneyLocalData,m=i.fundAllocationLocalData;return{onCancelClick:()=>{Y(a.analytics,"cancel",r,m,"Transfer"),t(se()),n("../")},onTransferClick:()=>{Y(a.analytics,"confirm",r,m,"Transfer"),t(Ee())},onSaveChangesToLocalStore:s=>{t(be(s))},onFetchLinkTokenClick:s=>{t(Ae("treasury_setup",s))},onEstablishConnectionClick:s=>{t(je(s,a.currentTenant?.companyId,"treasury_setup","zeni_treasury"))}}}))(Ze),yt=({isFirstTransfer:t,isTransactionsLoaded:a})=>{const n=L(),{tenantEmailDomain:o}=V(),i=U(),[r,m]=p.useState(!1),[s,d]=p.useState(!1),[c,S]=p.useState(!1),[T,l]=p.useState(!1),u=y((w=>w.treasurySetupViewState.fetchState)),x=y((w=>w.treasurySetupViewState.treasuryFundsDetails?.fetchStatus?.fetchState)),f=y((w=>w.treasurySetupViewState.currentAllocation.fetchStatus?.fetchState)),C=y((w=>v(w))),h=E.getSignedInUserTenant(o)?.companyId??C.companyId,g=y((w=>Ce(w))),j=y((w=>B(w,h)));if(E.getSignedInUser()==null)throw Error("Can't access treasury transfer page without signing in...");return p.useEffect((()=>{s||u!=="Not-Started"||h==null||(d(!0),i(ae(h,!0,!1)))}),[s,u,h,i]),p.useEffect((()=>{c||x!=="Not-Started"||h==null||(S(!0),i(q()))}),[c,x,h,i]),p.useEffect((()=>{T||f!=="Not-Started"||h==null||(l(!0),i(ne()))}),[T,f,h,i]),e.jsxs(e.Fragment,{children:[e.jsx(z,{analytics:A,onLoad:()=>{}}),e.jsx(ft,{analytics:A,navigate:n,transferDetails:g,onAnotherTransferClick:()=>{m(!1),i(se())},currentTenant:C,treasurySetupView:j,showReviewContent:r,maxInsuredAmount:5e5,onReviewClick:()=>{Y(A,"review",g.treasuryTransferMoneyLocalData,j.fundAllocationLocalData,"Transfer"),m(!0)},isFirstTransfer:t,isTransactionsLoaded:a,setShowReviewContent:m,onBackClick:()=>{}})]})},gt=N.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 Je(100,100,48)},ht=O((function(t,a){const n=re(t),{companyId:o}=a;return{treasuryDetail:n,treasurySetupView:B(t,o),downloadEndPoint:`${K.bankingMicroServiceBaseUrl}/1.0/treasury-account/statements?query={"statement_type":"tax_statement"}`}}),(function(t,a){const{navigate:n,currentTenant:o,location:i,handleDrawerToggle:r,analytics:m}=a,{tenantEmailDomain:s}=o;return{onSettingsClick:()=>{m.trackAccountsListPageClicked("Settings Icon"),n("setup")},onReloadTransactions:()=>{t(oe(!0))},handleTreasuryOptionSelection:d=>{let c="page-not-found";d==="editPortfolio"?c=xt(s):d==="statements"?c=Tt(s):d==="taxLetter"?c=wt(s):d==="settings"&&(c=It(s));const S=et(i.state?.pathnameStackToGoBack,i.pathname);n(c,{state:{pathnameStackToGoBack:S}})},onColumnSortConfigChanged:(d,c)=>{t(Le({uiState:{sortKey:d,sortOrder:c}}))},onTransferClick:()=>{n("./transfer")},onBackClick:()=>{n("../../")},onClickMenuIcon:()=>{r(!0)},onAutoTransferClick:()=>{n("../../checking/auto-transfer")}}}))(Qe);function $({isTransferDrawerOpen:t,isEditPortfolioDrawerOpen:a}){const n=F(),o=L(),i=U(),r=H(),m=He(),s=y((b=>v(b))),{tenantEmailDomain:d}=V(),c=s.companyId??E.getSignedInUserTenant(d)?.companyId,[S,T]=p.useState(!1),l=y((b=>re(b))),u=l.fetchState,x=l.accountSummary?.totalBalance?.amount,f=y((b=>b.treasurySetupViewState.treasuryFundsDetails?.fetchStatus)),C=s.companyTreasuryInfo?.info?.businessVerificationStatus?.code==="verified",h=_(),g=!!s.companyTreasuryInfo?.info?.isTreasuryTOSAccepted,j=M(h?.loggedInUserRoleMap),w=Z(h?.loggedInUserRoleMap),{areTenantIdsInSync:P}=Ke();p.useEffect((()=>{u==="Not-Started"&&!S&&P&&(T(!0),i(oe(!0)))}),[S,i,u,P]),p.useEffect((()=>{l.transactionsFetchState.fetchState==="Completed"&&l.transactions.length===0&&!n.pathname.includes("transfer")&&j&&o("./transfer")}),[l.transactionsFetchState.fetchState,l.transactions.length,n.pathname,j,o]);const I=()=>{o("..")},[le,ue]=p.useState(!1),J=b=>{ue(b)},{isAiCfoAccessEnabled:de,onAskAiCfoClick:pe}=lt({mobileExploreReferrer:"Treasury"});We({isDataReady:u==="Completed"});const{useFeatureGate:G}=ie(),{isFeatureEnabled:me}=G(R.isDebitCardFeatureEnabled),{isFeatureEnabled:fe}=G(R.isAutoTransferRuleEnabled),{isFeatureEnabled:ye}=G(R.isTreasuryCommentingEnabled),ge=ut(c,{clearParams:u==="Completed"&&f?.fetchState==="Completed"}),Se=ve(s),he=De(me,s);if(Se===!0&&he!==!0)return e.jsx(dt,{});if(C){const b=f?.fetchState!=="Completed"||l.accountSummaryFetchState.fetchState!=="Completed";return e.jsxs(e.Fragment,{children:[l.accountSummaryFetchState.fetchState==="Completed"&&f?.fetchState==="Completed"&&t===!1&&a===!1?e.jsx(z,{analytics:A,onLoad:()=>{}}):null,e.jsx(ot,{onClose:I,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(Ct,{onClick:xe=>xe.stopPropagation(),children:[t===!0?e.jsx(yt,{isFirstTransfer:l.transactions.length===0||x===0,isTransactionsLoaded:l.transactionsFetchState.fetchState!=="In-Progress"&&l.transactionsFetchState.fetchState!=="Not-Started"}):null,a===!0?e.jsx(mt,{}):null]})}),e.jsxs(gt,{windowSize:r,children:[e.jsx(ce,{isAppContentDrawerOpen:le,handleDrawerToggle:J}),e.jsx(ht,{treasuryDetailsView:l,isAutoTransferRuleEnabled:fe,navigate:o,currentTenant:s,location:n,companyId:c,analytics:A,isTreasuryCommentingEnabled:ye,handleDrawerToggle:J,initialOpenThreadRequest:ge,isLoading:b,isAiCfoAccessEnabled:de,onAskAiCfoClick:pe})]})]})}return g&&j?e.jsx(D,{to:"../setup"}):s.companyTreasuryInfo?.info&&!g&&w?e.jsx(D,{to:"../promo",state:n.state}):e.jsx(Xe,{fetchState:"In-Progress",style:{backgroundColor:m.colors.grey5}})}const xt=t=>`/${t}/treasury/edit-portfolio`,Tt=t=>`/${t}/treasury/statements`,wt=t=>`/${t}/treasury/tax-letter`,It=t=>`/${t}/treasury/setup`,Ct=N(it)`
|
|
10
|
+
display: flex;
|
|
11
|
+
min-height: 100%;
|
|
12
|
+
flex-direction: column;
|
|
13
|
+
`,kt=N.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=L(),a=U(),n=H(),o=F(),i=`${K.bankingMicroServiceBaseUrl}/1.0/treasury-account`,[r,m]=p.useState(!1),s=y((u=>Fe(u)));p.useEffect((()=>{r||s.fetchState!=="Not-Started"||(m(!0),a(Ue(!1)))}),[r,s.fetchState,a]);const d=E.getSignedInUser(),c=y((u=>v(u))),S={userId:d?.userId??"",sessionId:d?.zeniSessionId??"",tenantId:c.tenantId??""},T=c.company?.companyInfo.companyLegalName??c.companyName;if(d==null)throw Error("Can't access statements page without signing in...");const l=s.fetchState!=="Completed";return e.jsx(kt,{windowSize:n,children:e.jsx(tt,{currentTenantCompanyName:T,statementListView:s,isLoading:l,onBackClick:()=>{const u=W(o.state?.pathnameStackToGoBack),x=u.poppedPathname??"..";t(x,{state:{pathnameStackToGoBack:u.newStack}})},authParams:S,downloadEndPoint:i})})}const At=N.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 bt(){const t=L(),a=H(),n=F(),o=U(),i=`${K.bankingMicroServiceBaseUrl}/1.0/treasury-account`,[r,m]=p.useState(!1),s=y((u=>Be(u)));p.useEffect((()=>{r||s.fetchState!=="Not-Started"||(m(!0),o(Pe(!1)))}),[r,s.fetchState,o]);const d=E.getSignedInUser(),c=y((u=>v(u))),S={userId:d?.userId??"",sessionId:d?.zeniSessionId??"",tenantId:c.tenantId??""},T=c.company?.companyInfo.companyLegalName??c.companyName;if(d==null)throw Error("Can't access tax letter page without signing in...");const l=s.fetchState!=="Completed";return e.jsx(At,{windowSize:a,children:e.jsx(at,{currentTenantCompanyName:T,taxLetterListView:s,isLoading:l,onBackClick:()=>{const u=W(n.state?.pathnameStackToGoBack),x=u.poppedPathname??"..";t(x,{state:{pathnameStackToGoBack:u.newStack}})},authParams:S,downloadEndPoint:i})})}const Et=O((function(t,a){const{companyId:n}=a,o=B(t,n);return{treasurySetupView:o,isSetupComplete:o.companyTreasuryInfo?.businessVerificationStatus?.code==="verified",videoUrl:"https://www.youtube.com/watch?v=sqvJWKCMZgk"}}),(function(t,a){const{navigate:n,companyId:o}=a;return{onSetupButtonClick:()=>{t(Re(o))},onBackClick:()=>{n("../..",{relative:"path"})},onTreasurySetupSuccess:i=>{n(i?"..":"../setup",{relative:"path"})}}}))(st),vt=()=>{const t=nt(),a=L(),n=F(),o=U(),{tenantEmailDomain:i}=V(),[r,m]=p.useState(!1),s=y((g=>v(g))),[d,c]=p.useState(!1),S=y((g=>g.treasurySetupViewState.treasuryFundsDetails?.fetchStatus));p.useEffect((()=>{d||S?.fetchState!=="Not-Started"||T==null||(c(!0),o(q()))}),[S,o]);const T=E.getSignedInUserTenant(i)?.companyId??s.companyId,l=E.getSignedInUser(),u=!!s.companyTreasuryInfo?.info?.isTreasuryTOSAccepted,x=g=>{m(g)};if(l==null)throw Error("Can't access treasury promo page without signing in...");const f=_(),C=M(f?.loggedInUserRoleMap),h=Z(f?.loggedInUserRoleMap);if(u&&C)return e.jsx(D,{to:"../../treasury/setup"});if(s.company?.companyTreasuryInfo&&(!u&&C||h)){if(n.state?.message==="activation"){const g=W(n.state?.pathnameStackToGoBack);a(n.pathname,{state:{...n.state,message:void 0,pathnameStackToGoBack:g.newStack}})}return S?.fetchState!=="Completed"?e.jsx(te,{children:e.jsx(X,{size:"ExtraLarge",start:!0})}):e.jsxs(e.Fragment,{children:[e.jsx(z,{analytics:A,onLoad:g=>(j=>j.trackTreasuryPromoView("Treasury Promo Page"))(g)}),e.jsx(ce,{isAppContentDrawerOpen:r,handleDrawerToggle:x}),e.jsx(Et,{analytics:A,navigate:a,companyId:T,meetingUrl:t("treasury_promo"),onClickMenuIcon:()=>{x(!0)}})]})}return e.jsx(te,{children:e.jsx(X,{size:"ExtraLarge",start:!0})})},te=N.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 aa(){const t=F(),a=y((g=>v(g))),{useFeatureGate:n}=ie(),o=a.companyTreasuryInfo?.info?.businessVerificationStatus?.code==="verified",i=!!a.company?.companyTreasuryInfo?.isTreasuryTOSAccepted,r=_(),m=Z(r?.loggedInUserRoleMap),s=a?.userRole!=null&&Ne(a?.userRole),d=(a?.company==null||a.company.featuresActivationInfo?.isBillPayFeatureEnabled&&!s)&&Ve(r?.loggedInUserRoleMap),c=Oe(r?.loggedInUserRoleMap),S=(a?.company==null||a.company.featuresActivationInfo?.isReimbursementFeatureEnabled&&!s)&&Me(r?.loggedInUserRoleMap),T=!!a.company?.companyZeniAccountInfo?.isZeniAccountEnabled&&!s&&_e(r?.loggedInUserRoleMap),l=o&&!s&&M(r?.loggedInUserRoleMap),{isFeatureEnabled:u}=n(R.isChargeCardFeatureEnabled),{isFeatureEnabled:x}=n(R.isDebitCardFeatureEnabled),f=rt(a,u,x)&&!s&&ze(r?.loggedInUserRoleMap),C=Ge(r?.loggedInUserRoleMap),h=$e(r?.loggedInUserRoleMap);return e.jsxs(Te,{children:[h?null:e.jsx(k,{path:"setup",element:e.jsx(Q,{isBillPayAdminLevelAccess:d,isReimbursementAdminLevelAccess:S,isZeniAccountAdminLevelAccess:T,isChargeCardAdminLevelAccess:f,isTreasuryAdminLevelAccess:l,isUserHasOnlyCardAccess:C,isUserHasOnlyBillPayAccess:c,productType:"zeni_treasury",type:"setup"})}),h?null:e.jsx(k,{path:"verification",element:e.jsx(Q,{isBillPayAdminLevelAccess:d,isUserHasOnlyBillPayAccess:c,isReimbursementAdminLevelAccess:S,isZeniAccountAdminLevelAccess:T,isChargeCardAdminLevelAccess:f,isTreasuryAdminLevelAccess:l,isUserHasOnlyCardAccess:C,productType:"zeni_treasury",type:"verification"})}),e.jsx(k,{path:"promo",element:e.jsx(vt,{})}),e.jsx(k,{path:"statements",element:e.jsx(jt,{})}),e.jsx(k,{path:"tax-letter",element:e.jsx(bt,{})}),o?e.jsxs(e.Fragment,{children:[e.jsx(k,{path:"/",element:e.jsx($,{isTransferDrawerOpen:!1,isEditPortfolioDrawerOpen:!1})}),l?e.jsxs(e.Fragment,{children:[e.jsx(k,{path:"edit-portfolio",element:e.jsx($,{isEditPortfolioDrawerOpen:!0,isTransferDrawerOpen:!1})}),e.jsx(k,{path:"transfer",element:e.jsx($,{isTransferDrawerOpen:!0,isEditPortfolioDrawerOpen:!1})})]}):null,e.jsx(k,{path:"*",element:e.jsx(ct,{})})]}):i&&l?e.jsx(k,{path:"*",element:e.jsx(D,{to:"../setup"})}):a.company?.companyZeniAccountInfo&&m?e.jsx(k,{path:"*",element:e.jsx(D,{to:"../promo",state:t.state})}):e.jsx(k,{path:"*",element:null})]})}export{aa as default};
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
import{j as o}from"./liveblocks-D4WYBu5d.js";import{a as u}from"./sentry-xA0rcm0B.js";import{h as N,u as $,i as Y,j as f,l as G,g as H,n as Me,o as k,N as L}from"./core-DF6XZR6t.js";import{U_ as gt,U$ as Xe,QO as et,V0 as vt,fE as U,gZ as ge,V1 as Tt,cE as xt,V2 as bt,EZ as yt,V3 as wt,V4 as oe,V5 as te,V6 as ve,Sn as ue,So as Fe,Fd as pe,Sm as he,F0 as tt,Ez as ke,V7 as It,Sp as J,l_ as me,V8 as Pe,Et as Ct,V9 as Dt,Va as Vt,Vb as je,Vc as _e,Vd as Ae,Ve as Re,F7 as Te,Vf as nt,EQ as at,Vg as Et,Vh as Ft,Vi as kt,Vj as Pt,Vk as jt,Vl as _t,Vm as At,Vn as Rt,BJ as Ut,BR as Lt,BK as Bt,Ru as we,Vo as Ot,Vp as Mt,le as Ie,br as Nt,Vq as Gt,Vr as $t,mY as zt,n5 as Yt,Rt as Ce,bE as Ne,Vs as ot,R4 as st,Vt as Jt,Vu as qt,Vv as Kt,n7 as Ht,Vw as Ge,Vx as $e,Vy as ze,Vz as Ye,VA as Qt,n3 as Wt,VB as Zt,n6 as Xt,VC as en,VD as it,RP as rt,mm as tn,VE as nn,VF as De,VG as dt,RN as lt,Hw as an,VH as on,VI as sn,mG as ct,VJ as rn,VK as dn,R$ as ln,uG as cn,VL as ut,VM as Je,RY as Ve,VN as qe,VO as un,S1 as pn,VP as hn,VQ as mn,VR as fn,VS as Sn,VT as gn,uJ as vn,VU as Tn,Sq as xn,TZ as bn,RG as Ee,i9 as yn,T$ as wn,T_ as In,i7 as Cn,VV as Dn,VW as Vn,HB as En,VX as Fn,VY as kn,VZ as Pn,V_ as jn,mq as _n,bn as An,dY as Rn,dX as Un}from"./zeni-epic-state-C1PKBe4c.js";import{E as Ln,a1 as ne,ab as Ue,O as Q,y as M,z as R,a7 as Bn,aM as On,j as P,Y as Le,q as xe,av as ee,as as se,aN as Mn,aO as pt,aq as Nn,a8 as Se,aP as Gn,p as K,V as $n,G as ht,aQ as zn,ae as mt,a4 as Yn,h as Ke,aR as Jn,I as q,a9 as qn,af as ft,ag as Kn,aS as Hn,aT as Qn,S as Be,aU as Wn,aV as Zn,a3 as Xn,aW as ea,aX as ta}from"./index-DDlsb2Pe.js";import{D as na,n as B,S as St}from"./mui-B4yW9pH-.js";import{t as aa,A as oa}from"./AddressScreen-BtP59nWf.js";import fe from"./NotFoundScreen-BYb00fRD.js";import{F as sa}from"./FeaturePreviewScreen-KgN7vGcF.js";import{S as ia,a as ra,J as da,b as la,c as ca}from"./ScheduleDetailsPrepaidExpensesScreen-BXydpQNl.js";import{u as ie}from"./useAskAiCfoHostNavButtonProps-d04WxUMr.js";import{M as re}from"./MobileAppDrawer-PtjV_ofL.js";import{v as Oe,c as ua,d as pa}from"./routePaths-DGP8B7_s.js";import{D as ha}from"./DrawerScreen-Cvypy_pu.js";import{a as ma,m as fa}from"./accountMappingHelper-C_PJMCg9.js";import"./recharts-BiczA0FA.js";import"./analytics-elDziMbO.js";import"./plaid-D38FQUk-.js";import"./dnd-Cjk62kit.js";import"./stripe-cKAAJElX.js";import"./lottie-BmpBYIvu.js";import"./lexical-CSD0azk6.js";import"./pdf-CGyqZzIC.js";import"./utils-Tr_0gxNT.js";import"./pathToGoBack-D8-KE8Du.js";import"./InboxNotificationsProvider-B-NFQuyv.js";import"./useTaskManagerAccess-GgG1qznV.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]="6d6455aa-88b8-45cb-9d2a-a9571d785cdd",e._sentryDebugIdIdentifier="sentry-dbid-6d6455aa-88b8-45cb-9d2a-a9571d785cdd")}catch{}})();const Sa={drawerLeftMargin:new Ue(0,0,100,200)},ga=G((function(e,a){const{jeScheduledTransaction:s,selectedJERow:t,scheduleType:n,isVendorBulkUpdateOnTransactionEnabled:i}=a,{scheduleDetailsLocalData:l,updateStatus:p}=Xe(e,a.scheduleType),h=U(e),v=l[n].jeScheduleDetails[t].jeLink,m=v.type==="recommended"?v.recommendedTransactionID:v.transactionDetailID,r=m!=null?Tt(e,m):void 0,d=R.getSignedInUser(),c=e.tenantState.currentTenantId,T={userId:d?.userId??"",sessionId:d?.zeniSessionId??"",tenantId:h.tenantId??c},x=h?.company?.companyInfo?.firstMonthOfFY??1;return{jeScheduledTransaction:s,transactionDetail:r,localData:l[n].jeScheduleDetails[t],saveStatus:p.fetchState,authParams:T,isVendorBulkUpdateOnTransactionEnabled:i,firstMonthOfFY:x,isDisabled:p.fetchState==="In-Progress"?"readonly":void 0,analytics:P,qboAppUrl:xt(Le.qboRedirectionUrl)}}),(function(e,a){const{selectedJERow:s,jeScheduleDetailId:t,navigate:n}=a;return{onUpdateLocalData:i=>{const l=i.linkJETransaction.qboURL;l!=null&&e(wt({scheduleType:a.scheduleType,jeScheduleDetailId:t,rowId:s,jeLink:l}))},onFetchTransactionClick:i=>{e(et(i))},onSaveClick:()=>{e(yt(a.scheduleType,t))},onBackClick:()=>{n("..",{relative:"path"})},onCancelClick:()=>{const i=a.jeScheduledTransaction.scheduledJournalEntry[s];e(bt({scheduleType:a.scheduleType,jeScheduleDetailId:t,rowId:s,originalScheduledJE:i})),n("..",{relative:"path"})}}}))(On),va=()=>{const e=Ln(),a=N(),s=$(),{scheduleDetailId:t}=Y(),n=ne(),i=Sa.drawerLeftMargin.valuePx(n),{scheduleType:l}=Y(),{useFeatureGate:p}=Q(),{isFeatureEnabled:h}=p(M.isVendorBulkUpdateOnTransactionEnabled),v=gt(l)??"prepaid_expenses",[m,r]=u.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 d=f((b=>Xe(b,v)));u.useEffect((()=>{d.fetchState==="Not-Started"&&a("..",{relative:"path"})}),[]);const c=d.selectedJELinkRowIndex,T=c!=null?d.scheduleDetailsLocalData[v].jeScheduleDetails[c]?.jeLink:null,x=T?.type==="recommended"?T.recommendedTransactionID:T?.transactionDetailID;u.useEffect((()=>{x!=null&&s(et(x))}),[]),u.useEffect((()=>{T?.type==="recommended"&&m===!1&&c!=null&&(r(!0),s(vt({scheduleType:v,jeScheduleDetailId:t,rowId:c})))}));const g=f((b=>U(b))),y=f((b=>ge(b,g.companyId)));return o.jsx(na,{anchor:"right",open:!0,PaperProps:{style:{width:`calc(100% - ${i})`,boxShadow:"none"}},slotProps:{backdrop:{style:{backgroundColor:e.colors.black,opacity:.75,cursor:"pointer"}}},onClose:()=>a("..",{relative:"path"}),children:o.jsx(Ta,{onClick:b=>b.stopPropagation(),children:d.fetchState!=="Completed"||d.selectedJEScheduleTransaction==null||c==null?o.jsx(Bn,{fetchState:d.fetchState}):o.jsx(ga,{scheduleType:v,jeScheduleDetailId:t,selectedJERow:c,jeScheduledTransaction:d.selectedJEScheduleTransaction,isCOTEnabled:!1,navigate:a,scheduleTab:v,controllerUserDetails:y,isVendorBulkUpdateOnTransactionEnabled:h})})})},Ta=B(St)`
|
|
2
|
+
display: flex;
|
|
3
|
+
min-height: 100%;
|
|
4
|
+
flex-direction: column;
|
|
5
|
+
`,de=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"}},le=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=H(),a=$(),s=f((t=>oe(t)));return u.useEffect((()=>{const t=e.pathname.split("/").pop();if(t!=null){const n=(i=>{switch(i){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(te(n))}}),[e.pathname,s.currentTab,a]),s},W="accrued_expenses",xa=G((function(e,a){const s=U(e),t=oe(e);return{tenantName:s.companyName,vendorTabsToShow:a.vendorTabsToShow,report:a.scheduleListReport,downloadParams:a.downloadParams,companyIncorporationDate:a.companyIncDate,vendorTabView:t,isAccountingClassesEnabled:me(e)}}),(function(e,a){const{navigate:s}=a;return{onBackClick:()=>{s("../../..")},onVendorTabSelectionChanged:t=>{const n=de(t);s(n),e(te(le(t)))},onSortOrderChanged:(t,n)=>{e(Re({scheduleType:W,sortKey:t,sortOrder:n}))},onChangeSubTab:t=>{e(Ae({scheduleType:W,subTab:t}))},onSearchTextChanged:t=>{e(_e({scheduleType:W,searchText:t}))},onReloadReport:()=>{e(tt(W))},onScroll:t=>{e(je({scheduleType:W,scrollYOffset:t}))},onClickNewButton:()=>{e(Dt()),e(Vt()),P.trackScheduleAccruedDetailsNewRequested({scheduleType:"accrued_expenses"}),s("details/new")},onClickSchedule:t=>{e(Ct({selectedJEScheduleKey:t}));const n=a.scheduleListReport.jeAccruedSchedules.find((i=>i.jeAccruedScheduleKey===t));s(`details/${n?.jeScheduleId}`)},updateDownloadStateHandler:t=>{e(Pe({scheduleType:W,fetchState:t}))}}}))(Mn),ba=({vendorTabsToShow:e,previousTabPosition:a,setPreviousTabPosition:s})=>{const[t,n]=u.useState(!1),[i,l]=u.useState(!1),p=N(),h=$(),{useFeatureGate:v}=Q(),m=xe();ce();const{isFeatureEnabled:r,isFeatureGateLoading:d}=v(M.isOpexByVendorFeatureEnabled),c=R.getSignedInUser(),T=f((S=>U(S))),x={userId:c?.userId??"",sessionId:c?.zeniSessionId??"",tenantId:T.tenantId},g=u.useMemo((()=>({authParams:x,jeScheduleEndPoint:`${ee}/jeScheduleReports`,timezone:ve(),companyName:T.companyName})),[]),[y,b]=u.useState(!1),I=f((S=>ue(S))),V=f((S=>Fe(S,"accrued_expenses"))),C=e.includes("prepaid_expenses"),w=e.includes("fixed_assets"),A=e.includes("accrued_expenses");u.useEffect((()=>{(C||w||A)&&y===!1&&I!=="Completed"&&(h(pe()),b(!0))}),[y]),u.useEffect((()=>{d===!1&&(h(he({shouldFetchAccruedExpenses:A,shouldFetchFixedAssets:!0,shouldFetchPrepaidExpenses:C,shouldFetchOpexByVendor:r,shouldFetchVendorsList:!1,shouldFetchFiling1099Vendor:!1})),n(!0))}),[I,w,d,r]),u.useEffect((()=>{t===!1&&V==="Completed"&&h(tt("accrued_expenses",{selectedTimeframe:ke("accrued_expenses"),selectedCategoryId:"all"},!0))}),[t,V]);const j=f((S=>It(S,W))),{isAiCfoAccessEnabled:O,onAskAiCfoClick:E}=ie({mobileExploreReferrer:"Vendors — Accrued Expenses"});se({isDataReady:j.fetchState==="Completed"});const D=f((S=>J(S).isReportGenerated));f((S=>J(S).fetchState))!=="Completed"||D!==!0||r!==!0||e.includes("operating_expenses_by_vendor")||e.splice(1,0,"operating_expenses_by_vendor"),A||p("../opex");const F=f((S=>ge(S,T.companyId))),z=S=>{l(S)};return o.jsxs(o.Fragment,{children:[o.jsx(re,{isAppContentDrawerOpen:i,handleDrawerToggle:z}),o.jsx(xa,{navigate:p,previousTabPosition:a,setPreviousTabPosition:s,scheduleListReport:j,downloadParams:g,themeState:m,vendorTabsToShow:e,analytics:P,controllerUserDetails:F,isAiCfoAccessEnabled:O,onAskAiCfoClick:E,onClickMenuIcon:()=>z(!0)})]})},Z="fixed_assets",ya=G((function(e,a){const s=U(e),t=oe(e);return{tenantName:s.companyName,vendorTabsToShow:a.vendorTabsToShow,report:a.scheduleListReport,downloadParams:a.downloadParams,companyIncorporationDate:a.companyIncDate,controllerUserDetails:a.controllerUserDetails,vendorTabView:t,isAccountingClassesEnabled:me(e)}}),(function(e,a){const{navigate:s}=a;return{onBackClick:()=>{s("../../..")},onVendorTabSelectionChanged:t=>{const n=de(t);s(n),e(te(le(t)))},onSortOrderChanged:(t,n)=>{e(Re({scheduleType:Z,sortKey:t,sortOrder:n}))},onChangeSubTab:t=>{e(Ae({scheduleType:Z,subTab:t}))},onSearchTextChanged:t=>{e(_e({scheduleType:Z,searchText:t}))},onReloadReport:()=>{e(Te(Z))},onScroll:t=>{e(je({scheduleType:Z,scrollYOffset:t}))},onClickSchedule:t=>{e(at({selectedJEScheduleKey:t}));const n=a.scheduleListReport.jeScheduledTransactions.find((i=>i.jeScheduleTransactionKey===t));s(n?.jeScheduleId==null?"details/new":`details/${n.jeScheduleId}`)},updateDownloadStateHandler:t=>{e(Pe({scheduleType:Z,fetchState:t}))}}}))(pt),wa=({vendorTabsToShow:e,previousTabPosition:a,setPreviousTabPosition:s})=>{const[t,n]=u.useState(!1),i=N(),l=$();ce();const{useFeatureGate:p}=Q(),h=xe(),{isFeatureEnabled:v,isFeatureGateLoading:m}=p(M.isOpexByVendorFeatureEnabled),r=R.getSignedInUser(),d=f((S=>U(S))),c={userId:r?.userId??"",sessionId:r?.zeniSessionId??"",tenantId:d.tenantId},T=u.useMemo((()=>({authParams:c,jeScheduleEndPoint:`${ee}/jeScheduleReports`,timezone:ve(),companyName:d.companyName})),[]),[x,g]=u.useState(!1),y=f((S=>ue(S))),b=f((S=>Fe(S,"fixed_assets"))),I=e.includes("prepaid_expenses"),V=e.includes("fixed_assets"),C=e.includes("accrued_expenses");u.useEffect((()=>{(I||V||C)&&x===!1&&y!=="Completed"&&(l(pe()),g(!0))}),[x]),u.useEffect((()=>{m===!1&&(l(he({shouldFetchAccruedExpenses:C,shouldFetchFixedAssets:!0,shouldFetchPrepaidExpenses:I,shouldFetchOpexByVendor:v,shouldFetchVendorsList:!1,shouldFetchFiling1099Vendor:!1})),n(!0))}),[y,V,m,v]),u.useEffect((()=>{t===!1&&b==="Completed"&&l(Te("fixed_assets",{selectedTimeframe:ke("fixed_assets"),selectedCategoryId:"all"},!0))}),[t,b]);const w=f((S=>nt(S,Z))),{isAiCfoAccessEnabled:A,onAskAiCfoClick:j}=ie({mobileExploreReferrer:"Vendors — Fixed Assets"});se({isDataReady:w.fetchState==="Completed"});const O=f((S=>J(S).isReportGenerated));f((S=>J(S).fetchState))!=="Completed"||O!==!0||v!==!0||e.includes("operating_expenses_by_vendor")||e.splice(1,0,"operating_expenses_by_vendor"),V||i("../opex");const E=f((S=>ge(S,d.companyId))),[D,F]=u.useState(!1),z=S=>{F(S)};return o.jsxs(o.Fragment,{children:[o.jsx(re,{isAppContentDrawerOpen:D,handleDrawerToggle:z}),o.jsx(ya,{navigate:i,scheduleListReport:w,downloadParams:T,previousTabPosition:a,setPreviousTabPosition:s,themeState:h,vendorTabsToShow:e,analytics:P,controllerUserDetails:E,isAiCfoAccessEnabled:A,onAskAiCfoClick:j,onClickMenuIcon:()=>{z(!0)}})]})},Ia=B.div`
|
|
6
|
+
display: flex;
|
|
7
|
+
min-height: 100%;
|
|
8
|
+
width: 100%;
|
|
9
|
+
flex: 1 1 auto;
|
|
10
|
+
flex-direction: column;
|
|
11
|
+
align-items: center;
|
|
12
|
+
background-color: ${e=>e.theme.colors.grey4};
|
|
13
|
+
`,Ca=G((function(e,a){const s=R.getSignedInUser(),t=e.tenantState.currentTenantId,n=U(e),i=n?.companyName??"",l={userId:s?.userId??"",sessionId:s?.zeniSessionId??"",tenantId:t??""},p=J(e),h=Et(e);return{report:p,uiState:h,isAccountingClassesEnabled:me(e),analytics:P,vendorTabsToShow:a.vendorTabsToShow,downloadParams:{downloadState:h.downloadState,currentTenantCompanyName:i,statementEndPoint:`${ee}/opexByVendor`,authParams:l,timezone:ve()}}}),(function(e,a){const{navigate:s}=a;return{onFetchOpExByVendors:(t,n,i)=>{e(Bt(t,n,i))},onVendorNameAndBalanceClicked:(t,n)=>{if(a.tenantEmailDomain!=null){const i=Oe(t.id,t.qboId,a.tenantEmailDomain,n),l=K(a.location.state?.pathnameStackToGoBack,a.location.pathname);a.navigate(i,{state:{pathnameStackToGoBack:l,referrer:"Operating Expenses By Vendor"}})}},onRefresh:()=>{e(Lt())},onReloadReport:()=>{e(Ut(!0))},onBackClick:()=>{s("../../dashboard")},onTimeframeSelectionChanged:t=>{e(Rt(t))},onAdditionalBalanceSelectionChanged:(t,n)=>{e(At({isCompareModeOn:t,additionalBalances:n}))},onSortOrderChanged:(t,n,i)=>{e(_t({sortkey:n,sortOrder:t,timeframe:i}))},onVendorTabSelectionChanged:t=>{const n=de(t);s(n),e(te(le(t)))},onSortOrSearchStarted:t=>{e(jt(t))},onPageFetchStarted:()=>{e(Pt(!0))},updateDownloadStateHandler:t=>{e(kt(t))},onClearSearch:t=>{e(Ft({timeframe:t}))}}}))(Gn);function Da({vendorTabsToShow:e,previousTabPosition:a,setPreviousTabPosition:s}){const t=N(),n=$(),i=H(),{tenantEmailDomain:l}=Y(),p=ne(),h=R.getSignedInUser(),{useFeatureGate:v}=Q(),{isFeatureEnabled:m,isFeatureGateLoading:r}=v(M.isOpexByVendorFeatureEnabled),d=f((E=>J(E)));if(h==null)throw Error("Can't access opex by vendor page without signing in...");ce();const[c,T]=u.useState(!1),x=f((E=>ue(E))),g=e.includes("prepaid_expenses"),y=e.includes("fixed_assets"),b=e.includes("accrued_expenses"),I=f((E=>oe(E))),{isAiCfoAccessEnabled:V,onAskAiCfoClick:C}=ie({mobileExploreReferrer:"Vendors — Operating Expenses by Vendor"});se({isDataReady:d.fetchState==="Completed"&&d.isReportGenerated===!0});const{areTenantIdsInSync:w}=Nn();u.useEffect((()=>{(g||y||b)&&c===!1&&x!=="Completed"&&w&&(n(pe()),T(!0))}),[c,w]),u.useEffect((()=>{w&&n(he({shouldFetchAccruedExpenses:b,shouldFetchFixedAssets:y,shouldFetchPrepaidExpenses:g,shouldFetchOpexByVendor:m===!0&&r===!1,shouldFetchVendorsList:!1,shouldFetchFiling1099Vendor:!1}))}),[x,y,r,m,w]),d.fetchState!=="Completed"||d.isReportGenerated!==!0||m!==!0||e.includes("operating_expenses_by_vendor")||e.splice(1,0,"operating_expenses_by_vendor"),u.useEffect((()=>{w&&(d.isReportGenerated===!1&&d.fetchState==="Completed"||m===!1&&r===!1)&&t("../summary")}),[w,d.isReportGenerated,d.fetchState,m,r,t]);const[A,j]=u.useState(!1),O=E=>{j(E)};return o.jsxs(Ia,{windowSize:p,children:[d.fetchState==="Completed"?o.jsx(Se,{analytics:P,onLoad:E=>{I.previousTab==null?E.trackVendorOperatingExpensesPageLoaded("Side Panel"):E.trackVendorOperatingExpenses(I.currentTab,I.previousTab??null)}}):null,o.jsx(re,{isAppContentDrawerOpen:A,handleDrawerToggle:O}),o.jsx(Ca,{location:i,navigate:t,previousTabPosition:a,setPreviousTabPosition:s,tenantEmailDomain:l,vendorTabsToShow:e,isAiCfoAccessEnabled:V,onAskAiCfoClick:C,onClickMenuIcon:()=>{O(!0)}})]})}const X="prepaid_expenses",Va=G((function(e,a){const s=U(e),t=oe(e);return{tenantName:s.companyName,vendorTabsToShow:a.vendorTabsToShow,report:a.scheduleListReport,downloadParams:a.downloadParams,companyIncorporationDate:a.companyIncDate,controllerUserDetails:a.controllerUserDetails,vendorTabView:t,isAccountingClassesEnabled:me(e)}}),(function(e,a){const{navigate:s}=a;return{onBackClick:()=>{s("../../..")},onVendorTabSelectionChanged:t=>{const n=de(t);s(n),e(te(le(t)))},onSortOrderChanged:(t,n)=>{e(Re({scheduleType:X,sortKey:t,sortOrder:n}))},onChangeSubTab:t=>{e(Ae({scheduleType:X,subTab:t}))},onSearchTextChanged:t=>{e(_e({scheduleType:X,searchText:t}))},onReloadReport:()=>{e(Te(X))},onScroll:t=>{e(je({scheduleType:X,scrollYOffset:t}))},onClickSchedule:t=>{e(at({selectedJEScheduleKey:t}));const n=a.scheduleListReport.jeScheduledTransactions.find((i=>i.jeScheduleTransactionKey===t));s(n?.jeScheduleId==null?"details/new":`details/${n.jeScheduleId}`)},updateDownloadStateHandler:t=>{e(Pe({scheduleType:X,fetchState:t}))}}}))(pt),Ea=({vendorTabsToShow:e,previousTabPosition:a,setPreviousTabPosition:s})=>{const[t,n]=u.useState(!1),i=N(),l=$(),{useFeatureGate:p}=Q(),h=xe();ce();const v=R.getSignedInUser(),{isFeatureEnabled:m,isFeatureGateLoading:r}=p(M.isOpexByVendorFeatureEnabled),d=f((S=>U(S))),c=f((S=>Fe(S,"prepaid_expenses"))),T={userId:v?.userId??"",sessionId:v?.zeniSessionId??"",tenantId:d.tenantId},x=u.useMemo((()=>({authParams:T,jeScheduleEndPoint:`${ee}/jeScheduleReports`,timezone:ve(),companyName:d.companyName})),[]),[g,y]=u.useState(!1),b=f((S=>ue(S))),I=e.includes("prepaid_expenses"),V=e.includes("fixed_assets"),C=e.includes("accrued_expenses");u.useEffect((()=>{(I||V||C)&&g===!1&&b!=="Completed"&&(l(pe()),y(!0))}),[g]),u.useEffect((()=>{t===!1&&c==="Completed"&&l(Te("prepaid_expenses",{selectedTimeframe:ke("prepaid_expenses"),selectedCategoryId:"all"},!0))}),[t,c]),u.useEffect((()=>{r===!1&&(l(he({shouldFetchAccruedExpenses:C,shouldFetchFixedAssets:V,shouldFetchPrepaidExpenses:!0,shouldFetchOpexByVendor:m,shouldFetchVendorsList:!1,shouldFetchFiling1099Vendor:!1})),n(!0))}),[b,V,r,m]);const w=f((S=>nt(S,X))),{isAiCfoAccessEnabled:A,onAskAiCfoClick:j}=ie({mobileExploreReferrer:"Vendors — Prepaid Expenses"});se({isDataReady:w.fetchState==="Completed"});const O=f((S=>J(S).isReportGenerated));f((S=>J(S).fetchState))!=="Completed"||O!==!0||m!==!0||e.includes("operating_expenses_by_vendor")||e.splice(1,0,"operating_expenses_by_vendor"),I||i("../opex");const E=f((S=>ge(S,d.companyId))),[D,F]=u.useState(!1),z=S=>{F(S)};return o.jsxs(o.Fragment,{children:[o.jsx(re,{isAppContentDrawerOpen:D,handleDrawerToggle:z}),o.jsx(Va,{navigate:i,previousTabPosition:a,setPreviousTabPosition:s,scheduleListReport:w,downloadParams:x,themeState:h,vendorTabsToShow:e,analytics:P,controllerUserDetails:E,isAiCfoAccessEnabled:A,onAskAiCfoClick:j,onClickMenuIcon:()=>{z(!0)}})]})},Fa=B.div`
|
|
14
|
+
display: flex;
|
|
15
|
+
min-height: 100%;
|
|
16
|
+
width: 100%;
|
|
17
|
+
flex: 1 1 auto;
|
|
18
|
+
flex-direction: column;
|
|
19
|
+
align-items: center;
|
|
20
|
+
background-color: ${e=>e.theme.colors.grey4};
|
|
21
|
+
`,ka=G((function(e,a){const{isFiling1099FeatureEnabled:s,vendorDetailView:t,selectedVendor:n,firstMonthOfFY:i,currentTenant:l,currentUserRoleMap:p}=a,h=R.getSignedInUser(),v={userId:h?.userId??"",sessionId:h?.zeniSessionId??"",tenantId:l.tenantId??""};return{firstMonthOfFY:i,isFiling1099FeatureEnabled:s,vendorDetailView:t,allTransactions:t?.allVendorTransactionsView,allTransactionsTabData:t?.allTransactionsTabData!=null?{timePeriod:Jt(t?.allTransactionsTabData.timePeriod),numberOfQuartersFetched:t?.allTransactionsTabData.numberOfQuartersFetched}:void 0,vendorLogo:n?.logo,readOnlyMode:p?.bookkeeping_user===!0,filesEndPoint:mt.fileMicroServiceBaseUrl,authParams:v,scrollToTrend:a.isTrendPeriodSelected}}),(function(e,a){const{navigate:s,vendorDetailView:t,vendorId:n,defaultTransactionTimePeriod:i,vendorEntity:l,tenantEmailDomain:p,location:h,firstMonthOfFY:v}=a,m=()=>{const r=Yn(h.state?.pathnameStackToGoBack),d=r.poppedPathname??((c=2)=>{let T=c;a.isTrendPeriodSelected===!0&&(T=5);let x="../";for(let g=0;g<T;g++)x=`${x}../`;return x})(1);s(d,{state:{pathnameStackToGoBack:r.newStack}})};return{onSaveVendor:()=>{t!=null&&((r,d)=>{const{vendorId:c,vendorName:T,existingCategory:x,existingClass:g,existingOwner:y,selectedCategory:b,selectedClass:I,selectedOwner:V,isRecommendedCategorySelected:C,isRecommendedClassSelected:w,categoryRecommendationTypeSelected:A,classRecommendationTypeSelected:j}=en(r,d);c!=null&&P.trackVendorDetailsSave(c,T??"",x,g,y,b,I,V,C,w,A,j)})(t?.vendorViewDetails,t?.vendorViewDetails.ownerList),n!=null&&e(Xt(n,void 0))},onVendorSpendTrendFilterTabClick:r=>{e(Zt(r))},saveVendorDetailLocalData:r=>{n!=null&&e(Wt({vendorId:n,localData:r}))},saveContactsInVendorTabDetailLocalData:(r,d)=>{e(Qt({vendorId:r,localData:{contacts:d}}))},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(Ge()),e($e()),e(ze()),e(Ye()),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(Ht("Not-Started",n)),e(Ge()),e($e()),e(ze()),e(Ye()),m()},onTrendSelectedPeriodChange:r=>{if(r==null)i!=null&&e(we(l,"EntityDetail",{timeframe:"quarter",timePeriod:i}));else{const d=r.currentTimePeriod==null?r.addTimePeriod:{startDate:r.addTimePeriod.startDate,endDate:r.currentTimePeriod.endDate};e(Ce(l,"EntityDetail",{timeframe:r.timeframe,timePeriod:r.addTimePeriod},v)),e(we(l,"EntityDetail",{timeframe:r.timeframe,timePeriod:d}))}},onVendorTabSelectionChanged:r=>{e(Kt(r))},onAddressClick:(r,d)=>{if(p==null)return;const c=pa(p,r,d),T=K(h.state?.pathnameStackToGoBack,h.pathname);s(c,{state:{pathnameStackToGoBack:T}})},onVendorDetailUIChange:r=>{e(qt({collapsableStatus:r}))},onTransactionItemClick:r=>{const d=`${ua(r,p)}`,c=K(h.state?.pathnameStackToGoBack,h.pathname);s(d,{state:{pathnameStackToGoBack:c}})},onLoadPreviousTransactionsClick:(r,d)=>{e(ot({timePeriod:Ie(r),numberOfQuartersFetched:d})),e(st(l,Ie(r),!0,!0))}}}))(zn);function He({referrerType:e,isFiling1099FeatureEnabled:a}){const s=$(),t=H(),n=N(),i=$n(),[l,p]=u.useState(!1),[h,v]=u.useState(!1),[m,r]=u.useState(!1),d=Y(),c=d.vendorId,T=d.qboId,{tenantEmailDomain:x,timeframe:g,startDate:y,endDate:b}=d,I={id:T??"",name:"",type:"vendor",zeniId:c??"",qboId:T??""};u.useEffect((()=>{g!=null&&y!=null&&b!=null?p(!0):(p(!1),m===!1&&(r(!0),s(we(I,"EntityDetail"))))}),[g,y,b]);const V=ne(),C=f((_=>U(_))),w=f((_=>c!=null?Ot(_,c,I):void 0)),A=f((_=>_.vendorState.vendorByID[c??""])),j=f((_=>U(_).company?.companyInfo.firstMonthOfFY??1)),O=f((()=>Mt(j,2))),E=Ie({startDate:O.startDate,endDate:Nt()}),D=Gt(j),F=f((_=>$t(_.trendWithTransactionsState,I,"EntityDetail"))),[z,S]=u.useState(!1),be=l===!1&&m===!1?void 0:F?.selectedPeriod?.timePeriod??D;return u.useEffect((()=>(e==null&&w?.fetchState!=="Not-Started"||c==null||s(zt(c,I)),()=>{e!=null&&c!=null&&s(Yt(c))})),[c,t.state,s]),u.useEffect((()=>{w?.fetchState==="Completed"&&w?.vendorViewDetails.vendorView?.vendorBasic!=null&&((_,ae,ye)=>{_.id!=null&&P.trackVendorDetails(_.id,_.name,ye,_.account?.accountName,_.class?.className,_.owner?.email,ae.percentChange,ae.last30DaysSpend,ae.last90DaysSpend,ae.yearToDateSpend)})(w?.vendorViewDetails.vendorView?.vendorBasic,w?.vendorSpend,e),S(!1)}),[w?.fetchState]),u.useEffect((()=>{if(w?.fetchState==="Completed"&&z===!1){be!=null&&l===!1&&(s(Ce(I,"EntityDetail",{timeframe:F?.selectedPeriod?.timeframe??"quarter",timePeriod:be},j)),S(!0));const _=ht.getLocalizedStrings().dateFormat.analytics;if(l===!0&&g!=null&&y!=null&&b!=null){S(!0);const ae=g,ye={startDate:Ne(y,_.YYYYDashMMDashDDFormat),endDate:Ne(b,_.YYYYDashMMDashDDFormat)};s(Ce(I,"EntityDetail",{timeframe:ae,timePeriod:ye}))}}}),[w?.fetchState,be,F?.selectedPeriod?.timeframe,l,j]),u.useEffect((()=>{w?.fetchState==="Completed"&&h===!1&&(s(ot({timePeriod:E,numberOfQuartersFetched:3})),s(st(I,w.allTransactionsTabData?.timePeriod??E,!1,!0)),v(!0))}),[w?.fetchState,h]),c==null?o.jsx(fe,{}):o.jsx(Fa,{windowSize:V,children:o.jsx(ka,{location:t,navigate:n,isFiling1099FeatureEnabled:a,vendorDetailView:w,vendorId:c,currentTenant:C,selectedVendor:A,firstMonthOfFY:j,isTrendPeriodSelected:l,selectedPeriodTimePeriod:F?.selectedPeriod?.timePeriod,defaultTransactionTimePeriod:D,vendorEntity:I,currentUserRoleMap:i?.loggedInUserRoleMap,tenantEmailDomain:x})})}const Pa=ht.getLocalizedStrings().spendManagement.billPay.vendorCreation.vendorDetails,ja={containerWidth:new Ue(100,58)},_a=B(qn)`
|
|
22
|
+
width: ${q.sp4};
|
|
23
|
+
height: ${q.sp4};
|
|
24
|
+
cursor: pointer;
|
|
25
|
+
color: ${e=>e.theme.colors.brandColorJade};
|
|
26
|
+
`,Aa=B.div`
|
|
27
|
+
display: flex;
|
|
28
|
+
height: 100vh;
|
|
29
|
+
flex-direction: ${e=>e.windowSize==="small"?"column":"row"};
|
|
30
|
+
width: 100%;
|
|
31
|
+
overflow-y: scroll;
|
|
32
|
+
background-color: ${e=>e.theme.colors.grey4};
|
|
33
|
+
`,Ra=B.div`
|
|
34
|
+
display: flex;
|
|
35
|
+
flex-direction: column;
|
|
36
|
+
width: ${e=>`${ja.containerWidth.value(e.windowSize)}%`};
|
|
37
|
+
${e=>e.windowSize!=="small"?"overflow: auto;":""}
|
|
38
|
+
`,Ua=G((function(e,a){const s=R.getSignedInUser(),t=e.tenantState.currentTenantId,n={userId:s?.userId??"",sessionId:s?.zeniSessionId??"",tenantId:t??""},i=e.vendorFiling1099UploadDetailsState,l=e.vendorFiling1099UploadDetailsState;let p={fetchState:"Not-Started",error:void 0};return a.vendorId!=null&&(p=e.vendorViewState.editVendorStateById[a.vendorId]?.fetchStatus),{uploadInvoiceEndPoint:`${mt.documentAIMicroServiceBaseUrl}`,vendorFiling1099UploadDetailsState:i,vendorFiling1099UploadDetailsViewState:l,uploadStaus:l.w9FormUploadStatus,authParams:n,billId:a.billId,vendorId:a.vendorId,file:a.file,showAutofill:a.showAutofill,type:a.type,analytics:P,entityId:a.billId,fetchVendorFetchStatus:p,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(on({w9FormFile:t.files[0]})),t.w9_form[0]!=null)){e(sn({ocrData:t.w9_form[0],vendorId:s}));const n=(i=>({street:[i.street.join(" ")],city:i.city,state:i.state,postalCode:i.postal_code,countryCode:i.country_code??void 0,country:i.country??""}))(t.w9_form[0].address);e(ct({addressType:"vendor_address",addressToCreate:n}))}},updateInvoiceUploadFetchState:t=>{e(De({fetchState:t,error:void 0}))},onSkipAutofill:t=>{e(an(t))},onVendorFiling1099UploadDetailsSave:t=>{e(lt(t))},onDeleteClick:()=>{e(De({fetchState:"Not-Started",error:void 0})),e(dt({vendorId:s,w9Documents:[]}))}}}))(Hn);function Qe({appContent:e,showFullScreenSkeletonWhileLoading:a}){const s=$(),t=N(),{vendorId:n}=Y(),i=ne(),l=xe(),p=R.getSignedInUser(),[h,v]=u.useState(!1),{useFeatureGate:m}=Q(),{isFeatureEnabled:r}=m(M.isVendorRecommendationFeatureEnabled),d=f((D=>U(D))).companyName,c=new AbortController,T=c.signal;let x,g,y,b,I;if(n==null)throw new Error("Vendor ID not found for Vendor Filing 1099 Details Screen");x=f((D=>it(D,n))),g=f((D=>D.vendorFiling1099UploadDetailsState.vendor1099DetailsSaveStatus)),y=f((D=>D.vendorViewState.editVendorStateById[n]?.fetchStatus)),I=f((D=>D.vendorFiling1099UploadDetailsState.vendor1099DetailsLocalData.w9Documents?.[0])),b=f((D=>D.vendorFiling1099UploadDetailsState));const V=y?.fetchState==="In-Progress"||b?.w9FormUploadStatus?.fetchState==="In-Progress",C=()=>{l.toggle()};u.useEffect((()=>()=>{c.abort(),s(rt(n))}),[]),u.useEffect((()=>{h||n!=null&&(v(!0),s(tn(!1,n,T)))}),[n]);const w=Ke(y?.fetchState),A=Ke(g?.fetchState),j=x.vendor?.contactIds,O=j?.[j.length-1],E=f((D=>D.contactState.contactById[O]));if(u.useEffect((()=>{n!=null&&w==="In-Progress"&&y?.fetchState==="Completed"&&x?.vendor!=null&&(s(nn(n,x.vendor,E)),x?.vendor.filing1099W9Files?.[0]!=null&&s(De({fetchState:"Completed",error:void 0})))}),[n,x?.vendor]),u.useEffect((()=>{A==="In-Progress"&&g?.fetchState==="Completed"&&t("../../vendors/filing_1099")}),[g?.fetchState]),a===!0&&y?.fetchState!=="Completed"&&y?.fetchState!=="Error")return o.jsx(Na,{children:o.jsx(Jn,{})});if(p==null)throw Error("Can't access VendorFiling1099UploadScreen without signing in...");return o.jsxs(Aa,{windowSize:i,children:[i!=="small"?o.jsxs(Ba,{children:[o.jsx(_a,{onClick:C}),o.jsxs(La,{showContent:p.userEmailDomain==="zeni.ai",children:[o.jsx(Oa,{showAutofill:!1}),o.jsx(Ma,{showAutofill:!1,children:d})]})]}):null,o.jsx(Ua,{vendorId:n,file:I,showAutofill:!1,type:"w9",isVendorRecommendationEnabled:r,pdfTitle:I?Pa.w9FormTitle:void 0,showTitlebar:!0,showTitlebarIcon:!0,vendorLegalName:x?.vendor?.legalName,isLoading:V}),o.jsx(Ra,{windowSize:i,children:e})]})}const La=B.div`
|
|
39
|
+
display: ${e=>e.showContent?"flex":"none"};
|
|
40
|
+
align-items: center;
|
|
41
|
+
`,Ba=B.div`
|
|
42
|
+
margin-bottom: ${q.sp3};
|
|
43
|
+
margin-top: ${q.sp3};
|
|
44
|
+
margin-left: ${q.sp8};
|
|
45
|
+
position: absolute;
|
|
46
|
+
display: flex;
|
|
47
|
+
align-items: center;
|
|
48
|
+
`,Oa=B.div`
|
|
49
|
+
width: 1px;
|
|
50
|
+
height: ${q.sp3};
|
|
51
|
+
margin: ${q.sp0} ${q.sp3};
|
|
52
|
+
background-color: ${e=>e.showAutofill?ft.neutralGrey1Light:e.theme.colors.hero};
|
|
53
|
+
`,Ma=B(Kn.StandardMedium)`
|
|
54
|
+
color: ${e=>e.showAutofill?ft.neutralGrey5Light:e.theme.colors.primary};
|
|
55
|
+
`,Na=B.div`
|
|
56
|
+
width: 100%;
|
|
57
|
+
height: 100vh;
|
|
58
|
+
overflow: hidden;
|
|
59
|
+
background-color: ${e=>e.theme.colors.grey4};
|
|
60
|
+
`,Ga=G((function(e){const a=rn(e);return{vendorDetailView:dn(e),globalMerchantView:a}}),(function(e,a){const{navigate:s}=a;return{updateVendorDetailLocalData:t=>{e(ut({vendorDetails:t}))},fetchRecommendation:t=>{e(cn("tenant",t))},onSaveClick:()=>{e(ln())},onBackClick:()=>{s("../review")}}}))(Qn);function $a(){const e=N();return o.jsx(Ga,{navigate:e})}const za=B.div`
|
|
61
|
+
display: flex;
|
|
62
|
+
min-height: 100%;
|
|
63
|
+
width: 100%;
|
|
64
|
+
flex: 1 1 auto;
|
|
65
|
+
flex-direction: column;
|
|
66
|
+
align-items: center;
|
|
67
|
+
background-color: ${e=>e.theme.colors.grey4};
|
|
68
|
+
`,Ya=G((function(e,a){const{vendorFirstReviewDetails:s}=a,t=e.globalMerchantAutoCompleteState.autoCompleteText,n=R.getSignedInUser(),i=e.tenantState.currentTenantId,l={userId:n?.userId??"",sessionId:n?.zeniSessionId??"",tenantId:i??""},p=U(e);return{vendorFirstReviewView:s,globalMerchantAutoCompleteData:{globalMerchantAutoCompleteView:s.globalMerchantAutoCompleteView,autoCompleteText:t},analytics:P,authParams:l,attachmentEndpoint:p.externalConnections?.accounting[0]?.connectionName==="netsuite"?`${ee}/vendor_attachments_accounting_provider`:`${ee}/vendor_attachments`}}),(function(e,a){const{navigate:s}=a;return{onFetchVendorReviewView:(t,n,i)=>{e(Ve(t,n,i))},onGlobalMerchantAutoCompleteInputChange:(t,n)=>{t.trim().length>=2?e(vn({searchString:t,globalMerchantType:n??"vendor"})):t.trim().length===0&&e(qe())},onUpdateLocalData:(t,n,i,l)=>{if(n!=null){const p=Ja(n);e(gn({vendorId:t,currentSelection:p,selectedGlobalMerchantId:i,vendorRenamedText:l}))}},onResetVendorLocalData:t=>{e(Sn({vendorId:t}))},onVendorNameClick:(t,n)=>{if(a.tenantEmailDomain!=null){const i=Oe(t,n,a.tenantEmailDomain),l=K(a.location.state?.pathnameStackToGoBack,a.location.pathname);a.navigate(i,{state:{pathnameStackToGoBack:l}})}},onUpdatePageToken:t=>{e(fn({pageToken:t}))},onUpdateSortUiState:(t,n)=>{e(mn({sortOrder:t,sortKey:n}))},onUpdateScrollYOffset:t=>{e(hn({scrollYOffset:t}))},onClickSave:(t,n,i)=>{e(pn(t,n,i))},onClickCancelPopup:()=>{e(un())},onClearGlobalMerchantAutoCompleteResults:()=>{e(qe())},onClickRedirectToQBO:()=>{window.open(`${Le.qboRedirectionUrl}/vendors`,"_blank")},updateVendorDetailLocalData:t=>{e(ut({vendorDetails:t})),s(`./vendor/${t.id}`)},onBackClick:()=>{s("../..")},onReloadList:()=>{e(Ve(null))}}}))(Wn);function We(){const e=N(),a=$(),s=H(),{tenantEmailDomain:t}=Y(),n=ne(),i=R.getSignedInUser(),{vendorId:l}=Y(),p=f((d=>Je(d))),[h,v]=u.useState(!1),m=f((d=>Je(d).fetchState));if(u.useEffect((()=>{m==="Not-Started"&&h===!1&&(a(Ve(null)),v(!0))}),[]),i==null)throw Error("Can't access first review page without signing in...");const r=d=>d.trackPageLoaded(Be.Event.vendorTenantReviewListPage);return o.jsxs(o.Fragment,{children:[m==="Completed"?o.jsx(Se,{analytics:P,onLoad:r}):null,o.jsx(Se,{analytics:P,onLoad:r}),o.jsx(ha,{isOpen:l!=null,drawerLeftMargin:new Ue(0,0,300,600),onClose:()=>{e("../review")},children:o.jsx(qa,{onClick:d=>d.stopPropagation(),children:o.jsx($a,{})})}),o.jsx(za,{windowSize:n,children:o.jsx(Ya,{location:s,navigate:e,vendorFirstReviewDetails:p,tenantEmailDomain:t})})]})}const Ja=e=>e.recommendedFirst===!0?"recommendedFirst":e.recommendedSecond===!0?"recommendedSecond":e.retain===!0?"retain":e.rename===!0?"rename":e.customMerchant===!0?"customMerchant":null,qa=B(St)`
|
|
69
|
+
display: flex;
|
|
70
|
+
min-height: 100%;
|
|
71
|
+
flex-direction: column;
|
|
72
|
+
`,Ka=G((function(e,a){const s=R.getSignedInUser(),t=e.tenantState.currentTenantId,n=e.vendorFiling1099UploadDetailsState,i={userId:s?.userId??"",sessionId:s?.zeniSessionId??"",tenantId:t??""};let l={fetchState:"Not-Started",error:void 0};return a.vendorId!=null&&(l=e.vendorViewState.editVendorStateById[a.vendorId]?.fetchStatus),{analytics:P,vendorFiling1099UploadDetailsViewState:n,authParams:i,googleAPIKey:Le.googleMapsAPIKey,vendorId:a.vendorId,fetchVendorFetchStatus:l,vendor:a.vendorFiling1099UploadDetails?.vendor}}),(function(e,a){const{currentTenant:s,navigate:t,location:n,vendorId:i,vendorFiling1099UploadDetails:l}=a,{tenantEmailDomain:p}=s;return{onVendorFiling1099UploadDetailsSave:h=>{e(lt(h)),P.trackVendor1099DetailSave(l.vendor.legalName??"")},onSaveChangesToLocalStore:h=>{e(dt(h))},onResetVendorFiling1099FormStatus:()=>{e(Tn())},onAddressEditHandler:h=>{const v=aa((m=>({street:m.vendor1099FilingSectionId.street,suite:m.vendor1099FilingSectionId.suite,city:m.vendor1099FilingSectionId.city,state:m.vendor1099FilingSectionId.state,country:m.vendor1099FilingSectionId.country,countryCode:m.vendor1099FilingSectionId.countryCode,postalCode:m.vendor1099FilingSectionId.postalCode,secondaryInfo:m.vendor1099FilingSectionId.secondaryInfo}))(h));e(ct({addressType:"vendor_address",addressToCreate:v}))},goBackToListPage:()=>{e(rt(i));const h=`/${p}/vendors/filing_1099/`,v=K(n.state?.pathnameStackToGoBack,n.pathname);t(h,{state:{pathnameStackToGoBack:v}})},onAddressClick:h=>{const v=(function(r,d,c){let T=`/${r}/vendors/filing_1099/upload/${c}/edit`;return T=T.concat(`/new/${d}`),T})(p,h,i),m=K(n.state?.pathnameStackToGoBack,n.pathname);t(v,{state:{pathnameStackToGoBack:m}})},AddressFormPage:Xn}}))(Zn);function Ha(){const e=N(),a=H(),{vendorId:s}=Y(),t=f((p=>U(p)));let n;if(s==null)throw new Error("Vendor ID not found for Vendor Filing 1099 Details Screen");n=f((p=>it(p,s)));const{tenantEmailDomain:i}=t,l=t.companyId??R.getSignedInUserTenant(i)?.companyId;if(l==null)throw new Error("Company ID not found for Vendor Filing 1099 Details Screen");return o.jsx(Ka,{location:a,navigate:e,currentTenant:t,vendorId:s,vendorFiling1099UploadDetails:n,companyId:l})}const Qa=B.div`
|
|
73
|
+
display: flex;
|
|
74
|
+
min-height: 100%;
|
|
75
|
+
width: 100%;
|
|
76
|
+
flex: 1 1 auto;
|
|
77
|
+
flex-direction: column;
|
|
78
|
+
align-items: center;
|
|
79
|
+
background-color: ${e=>e.theme.colors.grey4};
|
|
80
|
+
`,Wa=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,i)=>{e(Vn({sortOrder:n,sortKey:i}))},onUpdateSearchUiState:n=>{e(Dn({searchString:n}))},onVendorRowClick:n=>{if(a.tenantEmailDomain!=null){const i=`/${a.tenantEmailDomain}/vendors/filing_1099/upload/${encodeURIComponent(n)}/edit`,l=K(a.location.state?.pathnameStackToGoBack,a.location.pathname);a.navigate(i,{state:{pathnameStackToGoBack:l}})}},onReloadVendors:()=>{e(Ee(!0))},onBackClick:()=>{e(In()),e(Cn())},onVendorTabSelectionChanged:n=>{const i=de(n);s(i),e(te(le(n)))},onAccountMappingChange:n=>{const{filing1099:i}=n,{bankAccount:l,expenseCategory1099:p}=i,h=ma(a.accountMappingView.bankAccounts1099FilingAccountList,l.selectedOptions),v=fa(a.accountMappingView.expenseAccounts1099FilingAccountList,p),m={selectedBankAccounts1099FilingAccountIds:h.map((r=>r.accountId)),selectedExpenseAccounts1099FilingAccountIds:v};e(wn({data:m}))},onSaveClick:()=>{e(yn()),t.track(Be.Event.vendor1099TabSettingsSave)}}}))(ea);function Ze({vendorTabsToShow:e,previousTabPosition:a,setPreviousTabPosition:s}){const t=N(),n=$(),i=H(),{tenantEmailDomain:l}=Y(),p=ne(),h=R.getSignedInUser(),[v,m]=u.useState(!1),[r,d]=u.useState(!1);if(h==null)throw Error("Can't access vendor filing 1099 page without signing in...");ce();const c=f((C=>xn(C))),T=f((C=>bn(C))),{isAiCfoAccessEnabled:x,onAskAiCfoClick:g}=ie({mobileExploreReferrer:"Vendors — 1099"});se({isDataReady:c.fetchState==="Completed"}),u.useEffect((()=>{r||(d(!0),n(Ee(!1)))}),[r,d]),u.useEffect((()=>{T.saveState.fetchState==="Completed"&&n(Ee(!1))}),[T.saveState.fetchState]);const y=C=>{m(C)},b=f((C=>U(C))),I={userId:h?.userId??"",sessionId:h?.zeniSessionId??"",tenantId:b.tenantId},V=u.useMemo((()=>({authParams:I,tenantName:b.companyName,filing1099ReportEndPoint:`${ee}/filing1099Reports`})),[]);return o.jsxs(o.Fragment,{children:[c.fetchState==="Completed"?o.jsx(o.Fragment,{children:o.jsx(Se,{analytics:P,onLoad:()=>P.trackPageLoaded(Be.Event.vendor1099ListPage)})}):null,o.jsxs(Qa,{windowSize:p,children:[o.jsx(re,{isAppContentDrawerOpen:v,handleDrawerToggle:y}),o.jsx(Wa,{location:i,navigate:t,previousTabPosition:a,setPreviousTabPosition:s,analytics:P,vendorsFiling1099ListDetails:c,vendorTypeList:c.vendorTypeList,accountMappingView:T,downloadParams:V,tenantEmailDomain:l,vendorTabsToShow:e,isAiCfoAccessEnabled:x,onAskAiCfoClick:g,onClickMenuIcon:()=>{y(!0)}})]})]})}const Za=B.div`
|
|
81
|
+
display: flex;
|
|
82
|
+
min-height: 100%;
|
|
83
|
+
width: 100%;
|
|
84
|
+
flex: 1 1 auto;
|
|
85
|
+
flex-direction: column;
|
|
86
|
+
align-items: center;
|
|
87
|
+
background-color: ${e=>e.theme.colors.grey4};
|
|
88
|
+
`,Xa=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:me(e),analytics:P}}),(function(e,a){const{navigate:s}=a;return{onFetchVendorsList:(t="",n,i)=>{e(_n({searchString:t,keepExistingListItems:n,view:"vendorsTab",pageToken:i}))},onUpdatePageToken:t=>{e(jn({pageToken:t}))},onUpdateSortUiState:(t,n)=>{e(Pn({sortOrder:t,sortkey:n}))},onUpdateCurrentYTDSelection:t=>{e(kn({ytdSpendSelection:t}))},onVendorRowClick:(t,n)=>{if(a.tenantEmailDomain!=null){const i=Oe(t,n,a.tenantEmailDomain),l=K(a.location.state?.pathnameStackToGoBack,a.location.pathname);a.navigate(i,{state:{pathnameStackToGoBack:l,referrer:"Vendor List"}})}},onReloadVendors:()=>{console.log("Reload vendors")},onUpdateScrollYOffset:t=>{e(Fn({scrollYOffset:t}))},onBackClick:()=>{s("../..")},onVendorTabSelectionChanged:t=>{const n=de(t);s(n),e(te(le(t)))}}}))(ta);function eo({vendorTabsToShow:e,previousTabPosition:a,setPreviousTabPosition:s}){const t=N(),n=$(),i=H(),{tenantEmailDomain:l}=Y(),p=ne(),h=R.getSignedInUser(),{useFeatureGate:v}=Q(),{isFeatureEnabled:m,isFeatureGateLoading:r}=v(M.isOpexByVendorFeatureEnabled);ce();const d=e.includes("prepaid_expenses"),c=e.includes("fixed_assets"),T=e.includes("accrued_expenses"),x=f((F=>oe(F)));let g={};g=f((F=>En(F,"vendorsTab")));const[y,b]=u.useState(!1),{isAiCfoAccessEnabled:I,onAskAiCfoClick:V}=ie({mobileExploreReferrer:"Vendors Summary"});se({isDataReady:g.fetchState==="Completed"});const C=f((F=>ue(F))),w=f((F=>J(F).isReportGenerated));f((F=>J(F).fetchState))==="Completed"&&w&&m&&!e.includes("operating_expenses_by_vendor")&&e.splice(1,0,"operating_expenses_by_vendor");const[A,j]=u.useState(!1);if(u.useEffect((()=>{(d||c)&&A===!1&&C!=="Completed"&&(n(pe()),j(!0))}),[A]),u.useEffect((()=>{n(he({shouldFetchAccruedExpenses:T,shouldFetchFixedAssets:c,shouldFetchPrepaidExpenses:d,shouldFetchOpexByVendor:m&&r===!1,shouldFetchVendorsList:!0,shouldFetchFiling1099Vendor:!1}))}),[C,c,r,m]),u.useEffect((()=>{y||g.fetchState!=="Completed"||(b(!0),P.trackVendorList(x.currentTab,x.previousTab??null,g.totalVendorCount,g.uiState.sortKey,g.uiState.ytdSpendSelection))}),[g.fetchState]),h==null)throw Error("Can't access address page without signing in...");const[O,E]=u.useState(!1),D=F=>{E(F)};return o.jsxs(Za,{windowSize:p,children:[o.jsx(re,{isAppContentDrawerOpen:O,handleDrawerToggle:D}),o.jsx(Xa,{location:i,navigate:t,vendorsListDetails:g,tenantEmailDomain:l,vendorTabsToShow:e,onClickMenuIcon:()=>{D(!0)},previousTabPosition:a,setPreviousTabPosition:s,isAiCfoAccessEnabled:I,onAskAiCfoClick:V})]})}function Fo(){const{useFeatureGate:e}=Q(),a=H().state?.referrer,[s,t]=u.useState(!1),[n,i]=u.useState(0),l=R.getSignedInUser(),p=An(l),{isFeatureEnabled:h}=e(M.isOpexByVendorFeatureEnabled),{isFeatureEnabled:v}=e(M.isVendorReviewFeatureEnabled),{isFeatureEnabled:m}=e(M.isScheduledJEPrepaidExpensesFeatureEnabled),{isFeatureEnabled:r}=e(M.isScheduledJEFixedAssetsFeatureEnabled),{isFeatureEnabled:d}=e(M.isScheduledJEAccruedExpensesFeatureEnabled),{isFeatureEnabled:c}=e(M.isFiling1099FeatureEnabled),T=f((V=>U(V))),x=T?.externalConnections?.accounting[0]?.connectionName,g=["vendors_tab"];x!=="netsuite"&&m===!0&&g.push("prepaid_expenses"),x!=="netsuite"&&r===!0&&g.push("fixed_assets"),x!=="netsuite"&&d===!0&&g.push("accrued_expenses"),x!=="netsuite"&&c&&p&&(g.push("filing_1099"),h&&g.splice(1,0,"operating_expenses_by_vendor"));const{isFeatureEnabled:y}=e(M.isDebitCardFeatureEnabled),b=Rn(y,T),I=Un(T);return b===!0||I===!0?o.jsx(Me,{children:o.jsx(k,{path:"/*",element:o.jsx(sa,{})})}):o.jsxs(Me,{children:[o.jsx(k,{path:"/opex",element:h===!0?o.jsx(Da,{previousTabPosition:n,setPreviousTabPosition:i,vendorTabsToShow:g}):o.jsx(L,{to:"../summary"})}),o.jsx(k,{path:"/summary",element:o.jsx(eo,{previousTabPosition:n,setPreviousTabPosition:i,vendorTabsToShow:g})}),o.jsx(k,{path:"schedules/fixed_assets/details/:scheduleDetailId",element:r===!0?o.jsx(ia,{}):o.jsx(L,{to:"../../vendors/opex"})}),o.jsx(k,{path:"schedules/accrued_expenses/details/:scheduleDetailId",element:r===!0?o.jsx(ra,{shouldNavigateBack:s,setShouldNavigateBack:t}):o.jsx(L,{to:"../../vendors/opex"})}),o.jsx(k,{path:"schedules/one_time_accrual/details/:accrualId",element:d===!0?o.jsx(da,{}):o.jsx(L,{to:"../../vendors/opex"})}),o.jsx(k,{path:"schedules/:scheduleType/details/:scheduleDetailId",element:m===!0?o.jsx(la,{}):o.jsx(L,{to:"../../vendors/opex"})}),o.jsx(k,{path:"schedules/:scheduleType/details/:scheduleDetailId/edit_link",element:m===!0||r===!0?o.jsx(va,{}):o.jsx(L,{to:"../../vendors/opex"})}),o.jsx(k,{path:"schedules/accrued_expenses/details/:scheduleDetailId/edit_link",element:d===!0?o.jsx(ca,{setShouldNavigateBack:t}):o.jsx(L,{to:"../../vendors/opex"})}),o.jsx(k,{path:"schedules/prepaid_expenses",element:m===!0?o.jsx(Ea,{previousTabPosition:n,setPreviousTabPosition:i,vendorTabsToShow:g}):o.jsx(L,{to:"../opex"})}),o.jsx(k,{path:"schedules/fixed_assets",element:r===!0?o.jsx(wa,{previousTabPosition:n,setPreviousTabPosition:i,vendorTabsToShow:g}):o.jsx(L,{to:"../opex"})}),o.jsx(k,{path:"schedules/accrued_expenses",element:d===!0?o.jsx(ba,{previousTabPosition:n,setPreviousTabPosition:i,vendorTabsToShow:g}):o.jsx(L,{to:"../opex"})}),o.jsx(k,{path:"/filing_1099",element:c&&p?o.jsx(Ze,{previousTabPosition:n,setPreviousTabPosition:i,vendorTabsToShow:g}):o.jsx(L,{to:"../opex"})}),o.jsx(k,{path:"/filing_1099/:vendorId",element:c&&p?o.jsx(Ze,{vendorTabsToShow:g,previousTabPosition:n,setPreviousTabPosition:i}):o.jsx(L,{to:"../opex"})}),o.jsx(k,{path:"/filing_1099/upload/:vendorId/edit",element:c&&p?o.jsx(Qe,{appContent:o.jsx(Ha,{}),showFullScreenSkeletonWhileLoading:!0}):o.jsx(L,{to:"../opex"})}),o.jsx(k,{path:"/filing_1099/upload/:vendorId/edit/new/:addressType",element:c&&p?o.jsx(Qe,{appContent:o.jsx(oa,{isSubPage:!0,hideAddressBackButton:!0,hideAddressSubTitle:!0})}):o.jsx(L,{to:"../opex"})}),o.jsx(k,{path:"/summary/:vendorId/:qboId",element:o.jsx(He,{referrerType:a,isFiling1099FeatureEnabled:c&&p})}),o.jsx(k,{path:"/summary/:vendorId/:qboId/:timeframe/:startDate/:endDate",element:o.jsx(He,{referrerType:a,isFiling1099FeatureEnabled:c&&p})}),o.jsx(k,{path:"/review",element:v===!0?o.jsx(We,{}):o.jsx(fe,{})}),o.jsx(k,{path:"/review/vendor/:vendorId",element:v?o.jsx(We,{}):o.jsx(fe,{})}),o.jsx(k,{path:"/",element:o.jsx(L,{to:"summary"})}),o.jsx(k,{path:"*",element:o.jsx(fe,{})})]})}export{Fo as default};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import{j as o}from"./liveblocks-D4WYBu5d.js";import{a as f}from"./sentry-xA0rcm0B.js";import{t as u,u as h,j as y,N as I}from"./core-DF6XZR6t.js";import{TO as b,gh as w,IR as j}from"./zeni-epic-state-C1PKBe4c.js";import{z as l,a7 as x,af as S,ag as D}from"./index-DDlsb2Pe.js";import{n as c}from"./mui-B4yW9pH-.js";import"./recharts-BiczA0FA.js";import"./analytics-elDziMbO.js";import"./plaid-D38FQUk-.js";import"./dnd-Cjk62kit.js";import"./stripe-cKAAJElX.js";import"./lottie-BmpBYIvu.js";import"./lexical-CSD0azk6.js";import"./pdf-CGyqZzIC.js";import"./utils-Tr_0gxNT.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]="41614c2c-2140-4e43-8f7e-1fe006b206d2",e._sentryDebugIdIdentifier="sentry-dbid-41614c2c-2140-4e43-8f7e-1fe006b206d2")}catch{}})();const B=()=>{const[e]=u(),t=e.get("code")??"",s=e.get("state")??"",g=e.get("profileId")??"",[n,p]=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||(p(!0),a(j(t,g,s)))}),[n,a]),i.fetchState==="Error"?o.jsx(E,{children:o.jsx(T,{children:i.error?.message??""})}):(i.fetchState==="Completed"&&window.close(),o.jsx(x,{fetchState:"In-Progress"}))},E=c.div`
|
|
2
|
+
display: flex;
|
|
3
|
+
width: 100%;
|
|
4
|
+
height: 100vh;
|
|
5
|
+
flex-direction: row;
|
|
6
|
+
justify-content: center;
|
|
7
|
+
align-items: center;
|
|
8
|
+
background-color: ${e=>e.theme.colors.grey5};
|
|
9
|
+
`,T=c(D.LargeRegular)`
|
|
10
|
+
display: flex;
|
|
11
|
+
color: ${S.important};
|
|
12
|
+
`;export{B as default};
|