@zeniai/web-app-ui 5.0.35-dev-betaML1 → 5.0.35-qa
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/assets/AddressRoutes-Dx8p4PG3.js +1 -0
- package/dist/assets/AddressScreen-DHoJdSM2.js +9 -0
- package/dist/assets/AiCfoScreen-CQx4VupC.js +11 -0
- package/dist/assets/BillPayApprovalRoutes-Dbtvf6_p.js +1 -0
- package/dist/assets/BillPayRoutes-0OGzB9O5.js +119 -0
- package/dist/assets/BusinessVerificationPageScreen-BgGPN2BY.js +9 -0
- package/dist/assets/ChargeCardRoutes-DdTRoQcU.js +71 -0
- package/dist/assets/CompanyPassportScreen-Btbca7X1.js +1 -0
- package/dist/assets/ConnectionAuthScreen-Mb97yuMO.js +11 -0
- package/dist/assets/CustomerOnboardingAuthScreen-DGG1eGt-.js +1 -0
- package/dist/assets/CustomerOnboardingRoutes-roF_evTM.js +23 -0
- package/dist/assets/DashboardRoutes-YVVLdj0y.js +20 -0
- package/dist/assets/DefaultTenantHome-CE3DRntd.js +1 -0
- package/dist/assets/DomesticWireDetailScreen-DfsbCbMc.js +18 -0
- package/dist/assets/DrawerScreen-GQyZ0U84.js +1 -0
- package/dist/assets/EntityDetailRoutes-rOxrHNIu.js +1 -0
- package/dist/assets/ExpenseAutomationRoutes-CPLVoqfI.js +25 -0
- package/dist/assets/FeaturePreviewScreen-BlTlevCF.js +1 -0
- package/dist/assets/MagicLinkRoutes-DvaIRF-u.js +72 -0
- package/dist/assets/MagicLinkSignInScreen-DWeFPHt3.js +12 -0
- package/dist/assets/MobileAppDrawer-BMQB-H-F.js +1 -0
- package/dist/assets/NotFoundScreen-DxfUGj1s.js +1 -0
- package/dist/assets/NotificationRoutes-DT6G1yzW.js +1 -0
- package/dist/assets/PandLWithForecastRoutes-i63gC3rA.js +1 -0
- package/dist/assets/PeopleRoutes-BHG7N7Z5.js +22 -0
- package/dist/assets/PerformanceRoutes-6t4ZzWuF.js +1 -0
- package/dist/assets/Preview-BbVH-6bH.js +1 -0
- package/dist/assets/QBOConnectionScreen-B2N0sAlT.js +100 -0
- package/dist/assets/ReferralListScreen-CT_FmWg_.js +5 -0
- package/dist/assets/ReimbursementApprovalRoutes-Dkhk0km3.js +1 -0
- package/dist/assets/ReimbursementApprovalRuleDetailScreen-DpgM8hdS.js +1 -0
- package/dist/assets/ReimbursementRoutes-CgI7Ap22.js +68 -0
- package/dist/assets/ReportsRoutes-CtoM4g6k.js +1 -0
- package/dist/assets/RewardsRoutes-BTxG--n5.js +1 -0
- package/dist/assets/ScreenRoutes-BiBN0Iue.js +2 -0
- package/dist/assets/SettingsRoutes-DAwx5C_8.js +57 -0
- package/dist/assets/SetupPagesScreen-CPC76Yqt.js +29 -0
- package/dist/assets/SignInScreen-jMnsylPT.js +1 -0
- package/dist/assets/SignOutScreen-B3j78WGh.js +9 -0
- package/dist/assets/TaskListScreen-b7Tm7m9s.js +9 -0
- package/dist/assets/TaskRoutes-BC6Imkeq.js +9 -0
- package/dist/assets/TransactionDetailRoutes-BwnRPA2Q.js +1 -0
- package/dist/assets/TransactionDetailScreen-FB6rYbKx.js +5 -0
- package/dist/assets/TransactionListRoutes-C_rCnKIT.js +1 -0
- package/dist/assets/TreasuryRoutes-Ci89O_ph.js +37 -0
- package/dist/assets/VendorsRoutes-M21vcfPO.js +112 -0
- package/dist/assets/WiseConfirmationScreen-vFbqW942.js +12 -0
- package/dist/assets/ZeniAccountRoutes-CeZIchqP.js +66 -0
- package/dist/assets/ZeniAccountStatementScreen-CRWM5OZx.js +9 -0
- package/dist/assets/accountMappingHelper-xZvH7myI.js +1 -0
- package/dist/assets/analytics-ZBaPMYvi.js +68 -0
- package/dist/assets/analyticsHelper-C_jV_Bj8.js +1 -0
- package/dist/assets/core-DM1rowt8.js +12 -0
- package/dist/assets/decodeURIComponentSafe-D0zhq0x7.js +1 -0
- package/dist/assets/dnd-C-Lnhdag.js +6 -0
- package/dist/assets/empty-CzFL6xhQ.js +1 -0
- package/dist/assets/empty-D1U7YTsh.js +1 -0
- package/dist/assets/emptyVideoElement-B21ksJRH.js +1 -0
- package/dist/assets/epic-BmEhQOaL.js +2 -0
- package/dist/assets/favicon-D56XvgAH.ico +0 -0
- package/dist/assets/getLocaleForTenant-DoiNlyMK.js +1 -0
- package/dist/assets/index-Bc34frN_.css +1 -0
- package/dist/assets/index-BrzMHfEZ.js +2 -0
- package/dist/assets/index-CID5TSpA.js +1 -0
- package/dist/assets/index-CS4Iv8Vc.js +71853 -0
- package/dist/assets/index-CrSe_x4f.js +1 -0
- package/dist/assets/index-DoOZkXVc.js +1 -0
- package/dist/assets/index-NBq_W8MN.js +1 -0
- package/dist/assets/index-qDQ5flzN.js +3385 -0
- package/dist/assets/lexical-C5McV7XP.js +21 -0
- package/dist/assets/liveblocks-BjW28Jor.js +54 -0
- package/dist/assets/logo192-CqcTe-t4.png +0 -0
- package/dist/assets/lottie-Lcmd6dcO.js +2 -0
- package/dist/assets/manifest-icT4lOF5.json +49 -0
- package/dist/assets/mui-D2eUyq0K.js +109 -0
- package/dist/assets/pathToGoBack-BzV0PkoJ.js +1 -0
- package/dist/assets/pdf-CnfUruOo.js +13 -0
- package/dist/assets/pdf-lib-w9llU0aY.js +39 -0
- package/dist/assets/plaid-BjrBUBaH.js +2 -0
- package/dist/assets/pusher-C56PjV1T.js +1 -0
- package/dist/assets/react-BAZC123N.js +34 -0
- package/dist/assets/react-Bj4rG6HA.js +19 -0
- package/dist/assets/react-C1mjYQZn.js +22 -0
- package/dist/assets/react-CZyOFSB_.js +21 -0
- package/dist/assets/react-DJgT0dzX.js +19 -0
- package/dist/assets/react-DTlWrv59.js +17 -0
- package/dist/assets/recharts-Boi6IWgf.js +65 -0
- package/dist/assets/routePaths-ChKhxwsZ.js +1 -0
- package/dist/assets/sentry-Cxwj7RZa.js +500 -0
- package/dist/assets/stripe-DMRn4zHo.js +1 -0
- package/dist/assets/url-DP5jm42y.js +1 -0
- package/dist/assets/url-YwSHsZ0_.js +6 -0
- package/dist/assets/useAskAiCfoHostNavButtonProps-DRpYvsoM.js +1 -0
- package/dist/assets/useDeviceId-VctjeswX.js +13 -0
- package/dist/assets/useFetchSuggestedQuestionsWhenReady-C6t_ljZW.js +1 -0
- package/dist/assets/useInitialThreadRequest-CKF3u5kw.js +1 -0
- package/dist/assets/utils-DnmDUA9M.js +36 -0
- package/dist/assets/web-vitals-D_vxw1oG.js +1 -0
- package/dist/assets/withTransactionSidePanel-BQ4RNwwf.js +21 -0
- package/dist/assets/zeni-epic-state-CsIRSm_7.js +14 -0
- package/dist/index.html +1 -0
- package/package.json +1 -1
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import{j as b}from"./liveblocks-BjW28Jor.js";import{a as d}from"./sentry-Cxwj7RZa.js";import{h as K,g as S,u as re,j as le,l as de,N as Ke,k as je}from"./core-DM1rowt8.js";import{bn as $e,eN as q,cO as ue,bv as me,pk as H,Jr as w,Ks as pe,Kt as Y,JR as fe,jC as he,Ku as ge,JW as X,JX as Z,kr as Se,GA as Q,Jl as _,jw as Te,ju as ye,jG as Je,Kv as Me,Kw as We,t9 as G,jB as ve,FX as Ee,cT as qe,cU as He,Kx as Ye,Jk as Xe,Ky as Ze,td as Qe,Kz as ea,KA as aa,KB as ta,KC as na,KD as oa,jF as sa,KE as ia,KF as ca,Jm as ra,KG as la,KH as da,KI as ua,FR as ma,FF as pa,G7 as fa,jH as ha,GB as ie,FO as ga}from"./zeni-epic-state-CsIRSm_7.js";import{z as Ce,a as ee,d as F,aI as De,h as Sa,Z as Ta,aJ as ya,x as va,p as M,A as Ea,aK as Ca,q as W,G as Da,e as Ie,aL as Ia,ao as ba,N as J}from"./index-CS4Iv8Vc.js";import{n as ka,S as Aa,D as Ua}from"./mui-D2eUyq0K.js";import{u as xa}from"./useAskAiCfoHostNavButtonProps-DRpYvsoM.js";import{c as _a}from"./useFetchSuggestedQuestionsWhenReady-C6t_ljZW.js";import{d as be}from"./decodeURIComponentSafe-D0zhq0x7.js";import{h as ke,g as Fa,d as Va,b as Ba}from"./routePaths-ChKhxwsZ.js";import{t as wa}from"./utils-DnmDUA9M.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]="ace89f72-a19a-4fea-881f-7d56f7500472",a._sentryDebugIdIdentifier="sentry-dbid-ace89f72-a19a-4fea-881f-7d56f7500472")}catch{}})();const ae=()=>{const a=Ce.getSignedInUser(),{useFeatureGate:e}=ee(),{isFeatureEnabled:s}=e(F.isChainOfThoughtEnabled);return d.useMemo(()=>$e(a)&&s,[a,s])};function Ae(a){if(a!=null){if("customer"in a&&a.customer!=null){const{customer:e}=a;return{id:e.id,name:e.name,logo:e.logo,type:"customer",zeniId:e.id,qboId:e.id}}if("vendor"in a&&a.vendor!=null){const{vendor:e}=a;return{id:e.id,name:e.name,logo:e.logo,type:"vendor",zeniId:e.id,qboId:e.id}}}}function Qa(a,e){const s=K(),{useFeatureGate:t,useDynamicConfig:n}=ee(),o=S(u=>q(u)),i=o.userRole.includes("charge_card_user")||o.userRole.includes("charge_card_admin"),l=o.userRole!=null&&ue(o.userRole),g=o.userRole!=null&&me(o.userRole),{isFeatureEnabled:T}=t(F.isVendorBulkUpdateOnTransactionEnabled),{isFeatureEnabled:I}=t(F.isExpenseAutomationEnabled),{configValue:f}=n(De.enableUncategorizedExpenseCategory),h=f?.uncategorized_expense_category_enabled===!0,k=ae(),y=d.useMemo(()=>({id:a,type:H(e)}),[a,e]),m=S(u=>w(u,y)),D=S(u=>{const z=w(u,y)?.transactionDetailLocalData.vendorUpdates?.id;return z==null?"Not-Started":u.transactionVendorViewState.editVendorStateById[z]?.saveStatus.fetchState??"Not-Started"}),p=d.useMemo(()=>m?.fetchState==="Completed"?Ae(m?.transaction):void 0,[m?.fetchState,m?.transaction]),E=S(u=>{if(p!=null)return pe(u.customerIncomeState,u.vendorExpenseState,u.trendState,p,"month")}),A=S(u=>Y(u)),V=S(u=>{if(p!=null)return fe(u.trendWithTransactionsState,p,"TransactionDetail")}),j=o.company?.companyInfo.firstMonthOfFY??1,$=S(u=>he(u.accountState,u.accountListState,"accountList")),[P,B]=d.useState(!1),[L,v]=d.useState(!1),[c,O]=d.useState(!1);d.useEffect(()=>{B(!1),v(!1),O(!1)},[a,e]);const C=d.useCallback(()=>{B(!1),v(!1)},[]),[U,x]=d.useState(!1),R=V?.selectedPeriod?.timePeriod;return d.useEffect(()=>{c||m==null||m.transaction==null||(s(ge({id:m.transaction.id,type:m.transaction.type})),O(!0)),p!=null&&(!i||l&&g===!1)&&(P?L||E==null||(v(!0),s(Q(p,"TransactionDetail",{timeframe:"month",timePeriod:R??E}))):(s(X()),s(Z()),B(!0),s(Se(p))))},[s,c,m?.fetchState,m?.transaction,p,i,l,g,P,L,E,R]),d.useEffect(()=>{A.newVendorState?.vendorDetailLocalData?.vendorName!=null?x(!0):x(!1)},[A.newVendorState?.vendorDetailLocalData?.vendorName]),d.useEffect(()=>()=>{s(_("common"))},[s]),{currentTenant:o,loggedInUserHasCardUserOrAdminRole:i,isUserHasDashboardAccess:l,isUserHasInvestorOrBankerAccess:g,isVendorBulkUpdateOnTransactionEnabled:T,isExpenseAutomationEnabled:I,isUncategorizedExpenseCategoryEnabled:h,isChainOfThoughtEnabled:k,selectedTransaction:y,transactionDetail:m,vendorSaveStatus:D,tranEntity:p,defaultTrendTransactionTimePeriod:E,vendorViewDetails:A,uiState:V,firstMonthOfFY:j,uncategorizedAccounts:$,resetTrendIsFetchedStates:C,isCreateVendorDrawerOpen:U,setIsCreateVendorDrawerOpen:x}}const Pa={overlayWidth:new va(100,100,58)},La=({isOpen:a,onSaveVendor:e,onSaveSuccess:s,onCancel:t,vendorViewDetails:n})=>{const o=Sa(),i=Ta(),l=K(),g=S(f=>Y(f)),T=()=>{t()},I={vendorDetailView:n??g,onSaveSuccess:()=>{l(ye()),l(Je("Not-Started")),s()},onSaveVendor:e,onCancelClick:T,saveVendorDetailLocalData:f=>{l(Te({vendorId:void 0,localData:f}))}};return b.jsx(Ua,{anchor:"right",open:a,PaperProps:{style:{width:Pa.overlayWidth.valuePercentage(i),boxShadow:"none"}},slotProps:{backdrop:{style:{backgroundColor:o.colors.black,opacity:.4,cursor:"pointer"}}},onClose:T,children:b.jsx(Oa,{onClick:f=>f.stopPropagation(),children:b.jsx(ya,{...I})})})},Oa=ka(Aa)`
|
|
2
|
+
display: flex;
|
|
3
|
+
min-height: 100%;
|
|
4
|
+
flex-direction: column;
|
|
5
|
+
`,Ra=({closeDrawerHandler:a,overrideTransactionId:e,overrideTransactionType:s})=>{const t=re(),n=le(),o=K(),i=ae(),{transactionTypeEncoded:l,transactionId:g}=de(),T=e??g,I=s??be(l??"");let f;ke(T,I)&&(f={id:T,type:H(I)});const h=f!=null?S(y=>w(y,f)):void 0,k=()=>{const y=M(t.state?.pathnameStackToGoBack),m=y.poppedPathname??((D=2)=>{let p="../";for(let E=0;E<D;E++)p=`${p}../`;return p})(1);n(m,{state:{pathnameStackToGoBack:y.newStack}})};return{transactionId:f,onSaveVendor:()=>{o(ve(f,void 0))},onSaveSuccess:()=>{if(h!=null&&h?.transaction&&h?.transactionDetailLocalData.vendorUpdates?.qboId!=null&&h?.transactionDetailLocalData.vendorUpdates?.id!=null){const y=h?.transactionDetailLocalData.vendorUpdates,m={id:h?.transactionDetailLocalData.vendorUpdates?.qboId,zeniId:h?.transactionDetailLocalData.vendorUpdates?.id,type:"vendor",name:y?.name,qboId:h?.transactionDetailLocalData.vendorUpdates?.qboId??""},D={transactionId:{id:h?.transaction?.id,type:h?.transaction?.type},transaction:h?.transaction,lineIds:h?.transaction?.lines?.map(p=>p.id)??[]};o(G(m,h?.transaction?.amount.amount,D,!1,!1,i))}k()},onCancel:()=>{f!=null&&o(Me({transactionId:f})),o(ye()),o(We()),a(!0),k()}}},za=je(function(a,e){const s=w(a,e.selectedTransaction);let t;s==null&&console.warn("Check if the you've selected the transaction before getting the details");const n=Ce.getSignedInUser(),o=a.tenantState.currentTenantId,i={userId:n?.userId??"",sessionId:n?.zeniSessionId??"",tenantId:o??""};s!=null&&s.fetchState==="Completed"&&s.transaction!=null&&e.entity!=null&&(t=Ye(a,e.entity,"TransactionDetail"));const l=a.entityAutoCompleteState.autoCompleteText.common,g=Xe(a,"common"),T=q(a);return{transactionDetail:s,transactionAttachmentEndpointToDownload:`${J}/transaction_attachment`,transactionAttachmentsEndpointToFetch:T.externalConnections?.accounting[0]?.connectionName==="netsuite"?`${J}/transaction_attachments_accounting_provider`:`${J}/transaction_attachments`,attachmentUploadEndpoint:`${ba.accountMicroServiceBaseUrl}`,isCOTEnabled:e.isCOTEnabled,authParams:i,trendReport:t,analytics:Ie,uncategorizedAccounts:e.uncategorizedAccounts,autoCompleteData:{autoCompleteText:l,entityAutoCompleteView:g},isVendorBulkUpdateOnTransactionEnabled:e.isVendorBulkUpdateOnTransactionEnabled,isExpenseAutomationEnabled:e.isExpenseAutomationEnabled,isUncategorizedExpenseCategoryEnabled:e.isUncategorizedExpenseCategoryEnabled,enableBackClickOnSave:e.location.state?.message?.startsWith("comingFromScheduleDetails")}},function(a,e){const{isCOTEnabled:s}=e;return{onBackClick:()=>{if(a(_("common")),e.onBackClick!=null)return void e.onBackClick();const t=M(e.location.state?.pathnameStackToGoBack),n=t.poppedPathname??Ue(2);e.navigate(n,{state:{pathnameStackToGoBack:t.newStack,message:"comingFromTransactionDetail"}})},discardTransactionDetailLocalData:(t,n)=>{e.transaction!=null&&a(ga({transactionId:{id:e.transaction.id,type:e.transaction.type},vendorId:t,customerId:n}))},onTransactionClick:t=>{e.resetTrendIsFetchedStates(),a(X()),a(Z());const n=W(e.location.state?.pathnameStackToGoBack,e.location.pathname);e.navigate(Ba(t,e.tenantEmailDomain),{state:{pathnameStackToGoBack:n}})},onTrendSelectedPeriodChange:t=>{if(t==null)e.defaultTrendTransactionTimePeriod!=null&&a(ie(e.entity,"TransactionDetail",{timeframe:"month",timePeriod:e.defaultTrendTransactionTimePeriod}));else{const n=t.currentTimePeriod==null?t.addTimePeriod:{startDate:t.addTimePeriod.startDate,endDate:t.currentTimePeriod.endDate};a(Q(e.entity,"TransactionDetail",{timeframe:t.timeframe,timePeriod:t.addTimePeriod})),a(ie(e.entity,"TransactionDetail",{timeframe:t.timeframe,timePeriod:n}))}},onSaveUpdates:(t,n,o,i)=>{a(i===!0&&o!=null?ve(t,o,!0,e.isExpenseAutomationEnabled,e.isUncategorizedExpenseCategoryEnabled):ha({transactionId:t,isExpenseAutomationEnabled:e.isExpenseAutomationEnabled,cotTransactionTracking:n,isUncategorizedExpenseCategoryEnabled:e.isUncategorizedExpenseCategoryEnabled})),a(_("common"))},onUploadAttachmentAttachment:t=>{a(fa(t))},onDeleteAttachment:t=>{e.transaction!=null&&a(pa(t,{id:e.transaction.id,type:e.transaction.type}))},onSaveTransactionDetailLocalData:(t,n)=>{a(ma({transactionId:t,transactionLocalData:n}))},onUpdateAllChecked:(t,n,o,i)=>{e.transaction!=null&&a(ua(e.selectedTransaction,e.transaction,t,n,o,i))},onResetLineItemsCategoryClassInLocalData:(t,n,o,i,l,g)=>{a(da(t,n,o,i,l,g))},onChangeCategoryClassWhenUpdateAllIsChecked:(t,n)=>{e.transaction!=null&&a(la({id:e.transaction.id,type:e.transaction.type},e.transaction,t,n))},onSaveSuccess:()=>{const t=M(e.location.state?.pathnameStackToGoBack);if(t.poppedPathname!=null){const n=wa(t.poppedPathname,"/").split("/"),o=n[n.length-1];if(["uncategorized-income","uncategorized-expense","missing-receipts"].includes(o)&&e.navigate(t.poppedPathname,{state:{pathnameStackToGoBack:t.newStack}}),e.location.state?.message==="comingFromScheduleDetails"){const i=`${Fa(e.tenantEmailDomain)}`;e.navigate(i)}else if(e.location.state?.message==="comingFromScheduleDetailsFixedAssets"){const i=`${Va(e.tenantEmailDomain)}`;e.navigate(i)}}},onPageRefresh:()=>{a(Ee(e.selectedTransaction,!0))},autoCompleteActions:{onAutoCompleteInputChange:(t,n)=>{t.trim().length>=2?a(ra({searchString:t,entityType:n,searchOrigin:"common"})):t.trim().length===0&&a(_("common"))},onCancelAutoComplete:()=>{a(_("common"))}},onFetchRecommendationsForEntity:(t,n,o,i)=>{a(G(t,n,o,i,!1,s))},clearRecommendationForLineId:t=>{const{transactionId:n,transaction:o,lineId:i}=t;a(ca(n,o,i))},resetUpdateErrorState:()=>{const t={id:e.selectedTransaction.id,type:e.selectedTransaction.type};a(ia(t))},onSaveVendorInLocalData:(t,n,o,i,l)=>{if(a(sa({transactionId:t,vendorUpdates:n,entity:o})),n.id!=null&&o!=null&&i!=null&&l!=null&&a(G(o,i,l,!1,!1,s)),a(Te({vendorId:n.id?n.id:void 0,localData:{vendorName:n.name,vendorId:n.id?n.id:void 0}})),!n.id&&e.transaction!=null){const g=e.transaction,T=W(e.location.state?.pathnameStackToGoBack,e.location.pathname);e.navigate(`/${e.tenantEmailDomain}/transaction/${encodeURIComponent(g.type??"")}/${g.id}/vendor/create`,{state:{pathnameStackToGoBack:T}})}},onSaveCustomerInLocalData:(t,n,o,i,l)=>{a(oa({transactionId:t,customerUpdates:n,entity:o})),n.id!=null&&o!=null&&i!=null&&l!=null&&a(G(o,i,l,!1,!1,s))},onUpdateAllTranactionsWithCurrentVendorChecked:t=>{a(na({transactionId:{id:e.selectedTransaction.id,type:e.selectedTransaction.type},isUpdateEnabled:t}))},onClickUpdateVendorToAllLineItems:(t,n,o)=>{a(ta(t,n,o))},onResetVendorToAllLineItems:(t,n,o)=>{a(aa(t,n,o))},saveLatestSelectedEntity:(t,n,o)=>{a(ea({transactionId:t,lineId:n,entity:o}))},updateVendorBulkRecommendationsFetchStatus:(t,n)=>{a(Qe(t,n))},setIsVendorUpdateAllChecked:(t,n,o)=>{a(Ze(t,n,o))}}})(Ia);function et(){const a=le(),e=K(),s=re(),{useFeatureGate:t,useDynamicConfig:n}=ee(),o=Ea(),i=S(r=>q(r)),l=i.userRole.includes("charge_card_user")||i.userRole.includes("charge_card_admin"),g=i.userRole!=null&&ue(i.userRole),T=i.userRole!=null&&me(i.userRole),{isFeatureEnabled:I}=t(F.isVendorBulkUpdateOnTransactionEnabled),{isFeatureEnabled:f}=t(F.isExpenseAutomationEnabled),{configValue:h}=n(De.enableUncategorizedExpenseCategory),k=h?.uncategorized_expense_category_enabled===!0,{tenantEmailDomain:y,transactionTypeEncoded:m,transactionId:D}=de(),[p,E]=d.useState(!1),A=be(m??""),V=ke(D,A),j=S(r=>r.transactionVendorViewState),$=ae(),{isFeatureEnabled:P}=t(F.isTransactionCommentingEnabled),B=o?.currentTenant?.companyId,L=o?.currentTenant?.companyName;let v;V&&(v={id:D,type:H(A)});const c=v!=null?S(r=>w(r,v)):void 0,O=c?.transactionDetailLocalData.vendorUpdates?.id!=null?j.editVendorStateById[c?.transactionDetailLocalData.vendorUpdates.id]?.saveStatus.fetchState:"Not-Started",C=c?.fetchState==="Completed"?Ae(c?.transaction):void 0,U=S(r=>C!=null?pe(r.customerIncomeState,r.vendorExpenseState,r.trendState,C,"month"):void 0),x=S(r=>Y(r)),R=S(r=>C!=null?fe(r.trendWithTransactionsState,C,"TransactionDetail"):void 0),u=i.company?.companyInfo.firstMonthOfFY??1,z=S(r=>he(r.accountState,r.accountListState,"accountList")),[xe,te]=d.useState(!1),[_e,ne]=d.useState(!1),[Fe,Ve]=d.useState(!1),oe=()=>{te(!1),ne(!1)},Be=Ca();d.useEffect(()=>{if(v!=null&&c!=null&&c.fetchState==="Not-Started")e(Ee(v)),oe();else if(v!=null&&c!=null&&c.fetchState==="Error"){const r=W(s.state?.pathnameStackToGoBack,s.pathname),N={pathnameStackToGoBack:r,message:"pageNotFound",origin:"transaction_detail"};Be&&(N.message="expenseAutomation",N.origin="transaction_categorization",N.pathnameStackToGoBack=r),a("page-not-found",{replace:!0,state:N})}},[v]),d.useEffect(()=>{Fe||c==null||c.transaction==null||(e(ge({id:c.transaction.id,type:c.transaction.type})),Ve(!0)),C==null&&c?.fetchState==="Completed"&&ce(c?.transaction),C!=null&&(!l||g&&T===!1)&&(xe?_e||U==null||(ne(!0),e(Q(C,"TransactionDetail",{timeframe:"month",timePeriod:R?.selectedPeriod?.timePeriod??U}))):(e(X()),e(Z()),ce(c?.transaction),te(!0),e(Se(C))))},[c?.fetchState,c?.transaction,U,l]),d.useEffect(()=>{x.newVendorState?.vendorDetailLocalData?.vendorName!=null?E(!0):E(!1)},[x.newVendorState?.vendorDetailLocalData?.vendorName]),d.useEffect(()=>()=>{e(_("common"))},[]);const we=[m,D].filter(r=>r!=null),{transactionId:se,onSaveVendor:Pe,onSaveSuccess:Le,onCancel:Oe}=Ra({closeDrawerHandler:r=>{E(!1),a(r?"../":"../..")}}),{isAiCfoOpen:Re,setIsAiCfoOpen:ze}=Da(),{isAiCfoAccessEnabled:Ne,onAskAiCfoClick:Ge}=xa({isAiCfoOpen:Re,setIsAiCfoOpen:ze,mobileExploreReferrer:"Transaction Details"});return _a({isDataReady:c?.fetchState==="Completed"}),V?b.jsxs(b.Fragment,{children:[se!=null&&p&&b.jsx(La,{isOpen:p,transactionId:se,onSaveVendor:Pe,onSaveSuccess:Le,onCancel:Oe}),b.jsx(za,{hideDeleteAttachment:!0,firstMonthOfFY:u,isDisabled:c?.transaction?.type==="transfer"&&o?.connectionName==="netsuite"?"readonly":void 0,tenantEmailDomain:y,location:s,navigate:a,selectedTransaction:v,entity:C,isCOTEnabled:$,defaultTrendTransactionTimePeriod:U,resetTrendIsFetchedStates:oe,transaction:c?.transaction,uncategorizedAccounts:z,vendorSaveStatus:O,isVendorBulkUpdateOnTransactionEnabled:I,isExpenseAutomationEnabled:f,isUncategorizedExpenseCategoryEnabled:k,isAiCfoAccessEnabled:Ne,onAskAiCfoClick:Ge,isTransactionCommentingEnabled:P,companyId:B,companyName:L})]}):b.jsx(Ke,{to:Ue(we.length)})}const Ue=(a=2)=>{let e="../";for(let s=0;s<a;s++)e=`${e}../`;return e},ce=a=>{if(a!=null){const{transactionCategory:e,transactionClass:s}=Na(a),t=Ga(a);Ie.trackTransactionDetails(a.account?.accountId,a.account?.accountName,a.id,t,e.length>0?e:void 0,s.length>0?s:void 0,a.type,a.amount,a.memo,a.lines?.length??0,a.attachments?.map(n=>n.fileName))}},Na=a=>{const e=[],s=[];return a.lines?.forEach(t=>{switch(t.type){case"transaction_with_account_and_class_line":case"transaction_with_product_or_service_line":case"journal_entry_transaction_line":case"linked_transaction_line":{const n=t;n!=null&&n.account!=null&&n.account.accountName?.length>0&&e.push(n.account.accountName),n.class!=null&&n.class.className?.length>0&&s.push(n.class.className);break}}}),{transactionCategory:e,transactionClass:s}},Ga=a=>qe(a)===!0?a.customer?.name??"":He(a)===!0?a.vendor?.name??"":a.memo!=null?a.memo:a.type;export{La as C,et as T,Ra as a,za as b,ae as c,Qa as u};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{j as i}from"./liveblocks-BjW28Jor.js";import{j as J,u as w,h as U,l as H,g as L,N as C,k as Q,n as Ae,o as v}from"./core-DM1rowt8.js";import{eN as R,iQ as T,NP as Z,Gr as ue,bq as ie,NQ as he,jr as W,JT as X,NR as se,NS as Se,bC as x,Go as me,NT as ke,NU as re,NV as Ie,NW as pe,NX as be,NY as ve,NZ as de,HE as Ye,bn as xe}from"./zeni-epic-state-CsIRSm_7.js";import{D as K,e as B,c5 as ee,q as _,p as te,a as fe,d as q,H as Ee,z as Pe}from"./index-CS4Iv8Vc.js";import"./mui-D2eUyq0K.js";import{a as A}from"./sentry-Cxwj7RZa.js";import{w as ae}from"./withTransactionSidePanel-BQ4RNwwf.js";import{p as ne,b as ce}from"./routePaths-ChKhxwsZ.js";import{u as Le}from"./utils-DnmDUA9M.js";import{d as P}from"./decodeURIComponentSafe-D0zhq0x7.js";import{Z as je}from"./ZeniAccountStatementScreen-CRWM5OZx.js";import"./recharts-Boi6IWgf.js";import"./analytics-ZBaPMYvi.js";import"./plaid-BjrBUBaH.js";import"./dnd-C-Lnhdag.js";import"./stripe-DMRn4zHo.js";import"./lottie-Lcmd6dcO.js";import"./lexical-C5McV7XP.js";import"./pdf-CnfUruOo.js";import"./useAskAiCfoHostNavButtonProps-DRpYvsoM.js";import"./useFetchSuggestedQuestionsWhenReady-C6t_ljZW.js";import"./TransactionDetailScreen-FB6rYbKx.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]="58134ff4-608f-4a14-abf8-d396c1fdf914",a._sentryDebugIdIdentifier="sentry-dbid-58134ff4-608f-4a14-abf8-d396c1fdf914")}catch{}})();const G=a=>Le(a),ze=Q(function(a,e){const t=he(a.transactionState,a.transactionListState,e.selectedAccount.period,e.selectedAccount.timeframe,G(e.selectedAccount.tranListType));return{title:e.selectedAccount.title,subTitle:e.selectedAccount.subTitle,timeframe:e.selectedAccount.timeframe,timePeriod:X(e.selectedAccount.period),dataAvailableForPeriod:e.dataAvailableForPeriod,report:t,currentScrollYOffset:t.uiState?.scrollYOffset??0,isAccountingClassesEnabled:W(a)}},function(a,e){return{onBackClick:()=>{const t=te(e.location.state?.pathnameStackToGoBack),n=t.poppedPathname??"../../";e.navigate(n,{state:{pathnameStackToGoBack:t.newStack}})},onTimePeriodChange:(t,n,c)=>{e.closeSidePanel?.();const o=K.getLocalizedStrings(),r=G(e.selectedAccount.tranListType),s=Be(t,n,c,r,e.bookCloseDate);B.trackTransactionList(void 0,void 0,void 0,e.selectedAccount.title,void 0,!0),a(se({uiState:{dateRange:s},type:G(e.selectedAccount.tranListType)})),a(ue(r,T(s),!1,r==="missingReceipts"?o.uncategorizedTransactionList.missingReceipt.missingReceiptMinAmount:void 0)),e.onSelectedTimePeriodChange(T(s))},onTransactionItemClick:t=>{if(e.openTransactionPanel)return void e.openTransactionPanel(t.id,t.type);const n=ce(t,e.tenantEmailDomain),c=_(e.location.state?.pathnameStackToGoBack,e.location.pathname);e.navigate(n,{state:{pathnameStackToGoBack:c}})},onTransactionListScroll:t=>{a(se({uiState:{scrollYOffset:t},type:G(e.selectedAccount.tranListType)}))}}})(ee),F=ae(function({...a}){const e=J(),t=w(),n=U(),c=t.pathname.substring(t.pathname.lastIndexOf("/")+1),{tenantEmailDomain:o}=H(),r=K.getLocalizedStrings(),{accountType:s,title:u,subTitle:h}=Me(c),D="month",g=L(p=>R(p)),Y=g.company?.companyInfo.firstMonthOfFY??1,{dataAvailable:y,initialTimeframeTick:S}=Ce(c,Y,g.bookCloseDate),[k,j]=A.useState(!1),[z,E]=A.useState(void 0),m=A.useMemo(()=>{const p=T(S);return{tranListType:c,accountType:Z(s),title:u,subTitle:h,timeframe:D,period:p}},[c,D,s,y]);A.useEffect(()=>{if(!k&&m!=null){j(!0),B.trackTransactionList(void 0,void 0,void 0,m.title);const p=G(m.tranListType);n(ue(p,m.period,!0,p==="missingReceipts"?r.uncategorizedTransactionList.missingReceipt.missingReceiptMinAmount:void 0))}},[k,m,n]);let I=m;return m!=null&&z!=null&&(I={...m,period:z}),I==null?i.jsx(C,{to:"../"}):i.jsx(ze,{firstMonthOfFY:Y,tenantEmailDomain:o,location:t,useFixedPeriod:{timeframe:"month",numberOfPeriods:12},dataAvailableForPeriod:y,navigate:e,selectedAccount:I,referrerType:c,bookCloseDate:g.bookCloseDate,onSelectedTimePeriodChange:p=>E(p),...a})}),Me=a=>{let e="",t="",n="";const c=K.getLocalizedStrings();switch(a){case"uncategorized-income":e="income",t=c.uncategorizedTransactionList.income.title,n=c.uncategorizedTransactionList.income.subTitle;break;case"uncategorized-expense":e="expenses",t=c.uncategorizedTransactionList.expense.title,n=c.uncategorizedTransactionList.expense.subTitle;break;case"miscategorized-expense":e="expenses",t=c.miscategorizedTransactionList.expense.title,n=c.miscategorizedTransactionList.expense.subTitle;break;case"miscategorized-income":e="income",t=c.miscategorizedTransactionList.income.title,n=c.miscategorizedTransactionList.income.subTitle;break;case"missing-receipts":t=c.uncategorizedTransactionList.missingReceipt.title,n=c.uncategorizedTransactionList.missingReceipt.subTitle}return{accountType:e,title:t,subTitle:n}},Ce=(a,e,t)=>{const n=ie();let c=ie().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:ne(5,e),initialTimeframeTick:{startDate:c,endDate:n}}},Be=(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},Oe=Q(function(a,e){const t=ke(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:X(e.selectedAccount.period),dataAvailableForPeriod:ne(5,e.firstMonthOfFY),report:t,currentScrollYOffset:t.uiState?.scrollYOffset??0,isAccountingClassesEnabled:W(a)}},function(a,e){return{onBackClick:()=>{const t=te(e.location.state?.pathnameStackToGoBack),n=t.poppedPathname??Te();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)}`),B.trackTransactionList(e.selectedAccount.accountId,void 0,e.referrerType,e.selectedAccount.title,void 0,!0),a(re({accountId:e.selectedAccount.accountId,accountType:e.selectedAccount.accountType,classId:e.selectedAccount.classId,uiState:{dateRange:o}})),a(me(e.selectedAccount.accountId,e.selectedAccount.accountType,e.selectedAccount.classId,T(o))),e.onSelectedTimePeriodChange(T(o))},onTransactionItemClick:t=>{if(e.openTransactionPanel)return void e.openTransactionPanel(t.id,t.type);const n=ce(t,e.tenantEmailDomain),c=_(e.location.state?.pathnameStackToGoBack,e.location.pathname);e.navigate(n,{state:{pathnameStackToGoBack:c}})},onTransactionListScroll:t=>{a(re({accountId:e.selectedAccount.accountId,accountType:e.selectedAccount.accountType,classId:e.selectedAccount.classId,uiState:{scrollYOffset:t}}))}}})(ee),Fe=ae(function({referrerType:a,...e}){const t=J(),n=w(),c=U(),{tenantEmailDomain:o,accountTypeEncoded:r,accountIdEncoded:s,classIdEncoded:u,timeframe:h,startDate:D,endDate:g,titleEncoded:Y}=H(),y=P(r??""),S=P(s??""),k=P(u??""),j=P(Y??""),z=L(f=>Se(f.transactionListState,S,y,k)),[E,m]=A.useState(!1),[I,p]=A.useState(void 0),N=L(f=>R(f)),$=N.company?.companyInfo.firstMonthOfFY??1;let d;const l=Ge(y,S,k,h,D,g,j);if(l){const f={startDate:x(D,"YYYY-MM-DD"),endDate:x(g,"YYYY-MM-DD")},V=Ne(z?.dateRange,f);d={accountId:S,accountType:Z(y),classId:k,title:j,timeframe:h,period:V}}A.useEffect(()=>{E||d==null||(m(!0),B.trackTransactionList(d.accountId,void 0,a,d.title),c(me(d.accountId,d.accountType,d.classId,d.period)))},[E,d,c]);let M=d;d!=null&&I!=null&&(M={...d,period:I});const O=[r,s,u,h,D,g,Y].filter(f=>f!=null);return l&&M!=null?i.jsx(Oe,{firstMonthOfFY:$,tenantEmailDomain:o,location:n,navigate:t,selectedAccount:M,referrerType:a,onSelectedTimePeriodChange:f=>p(f),...e}):i.jsx(C,{to:Te(O.length)})}),Te=(a=7)=>{let e="../";for(let t=0;t<a;t++)e=`${e}../`;return e},Ge=(a,e,t,n,c,o,r)=>a!=null&&e!=null&&t!=null&&n!=null&&c!=null&&o!=null&&(n==="month"||n==="quarter")&&x(c,"YYYY-MM-DD").isValid()&&x(o,"YYYY-MM-DD").isValid()&&r!=null,Ne=(a,e)=>a!=null&&a.endDate.isSame(e.endDate,"day")&&a.startDate.isBefore(e.startDate,"day")?T(a):T(e),_e=Q(function(a,e){const t=be(a.transactionState,a.transactionListState,e.selectedAccount.accountId,e.selectedAccount.accountType,e.selectedAccount.timeframe,e.selectedAccount.period),n=t.account?.coaId,c=e.isConnectedAccountProviderUnit&&ve(n??"");return{accountId:e.selectedAccount.accountId,accountType:e.selectedAccount.accountType,title:e.selectedAccount.title,timeframe:e.selectedAccount.timeframe,timePeriod:X(e.selectedAccount.period),dataAvailableForPeriod:ne(5,e.firstMonthOfFY),report:t,currentScrollYOffset:t.uiState?.scrollYOffset??0,showStatementPageIcon:c,isAccountingClassesEnabled:W(a)}},function(a,e){return{onBackClick:()=>{const t=te(e.location.state?.pathnameStackToGoBack),n=t.poppedPathname??De();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)}`),B.trackTransactionList(e.selectedAccount.accountId,void 0,e.referrerType,e.selectedAccount.title,void 0,!0),a(de({accountId:e.selectedAccount.accountId,accountType:e.selectedAccount.accountType,uiState:{dateRange:o}})),a(pe(e.selectedAccount.accountId,e.selectedAccount.accountType,T(o))),e.onSelectedTimePeriodChange(T(o))},onTransactionItemClick:t=>{if(e.openTransactionPanel)return void e.openTransactionPanel(t.id,t.type);const n=ce(t,e.tenantEmailDomain),c=_(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,uiState:{scrollYOffset:t}}))},onStatementPageIconClick:()=>{const t=$e(e.tenantEmailDomain),n=_(e.location.state?.pathnameStackToGoBack,e.location.pathname);e.navigate(t,{state:{pathnameStackToGoBack:n}})}}})(ee),le=ae(function({referrerType:a,...e}){const t=J(),n=w(),c=U(),{tenantEmailDomain:o,accountTypeEncoded:r,accountIdEncoded:s,timeframe:u,startDate:h,endDate:D,titleEncoded:g,excludeSubAccounts:Y}=H(),y=P(r??""),S=P(s??""),k=P(g??""),j=!(Y!=null&&Y==="exclude_subaccounts"),z=L(b=>Ie(b.transactionListState,S,y)),[E,m]=A.useState(!1),[I,p]=A.useState(void 0),N=L(b=>R(b)),$=N.company?.featuresActivationInfo.connectedAccountProvider==="unit",d=N.company?.companyInfo.firstMonthOfFY??1;let l;const M=we(y,S,u,h,D,k);if(M){const b={startDate:x(h,"YYYY-MM-DD"),endDate:x(D,"YYYY-MM-DD")},ye=Re(z?.dateRange,b);l={accountId:S,accountType:Z(y),title:k,timeframe:u,period:ye}}let O=l;l!=null&&I!=null&&(O={...l,period:I});const{useFeatureGate:f}=fe(),{isFeatureEnabled:V}=f(q.isTransactionCommentingEnabled),{areTenantIdsInSync:oe}=Ee();A.useEffect(()=>{!E&&l!=null&&oe&&(m(!0),B.trackTransactionList(l.accountId,void 0,a,l.title),c(pe(l.accountId,l.accountType,l.period,void 0,!1,j)))},[E,l,c,oe]);const ge=[r,s,u,h,D,g].filter(b=>b!=null);return M&&O!=null?i.jsx(_e,{firstMonthOfFY:d,tenantEmailDomain:o,location:n,navigate:t,isConnectedAccountProviderUnit:$,isTransactionCommentingEnabled:V,selectedAccount:O,referrerType:a,onSelectedTimePeriodChange:b=>p(b),...e}):i.jsx(C,{to:De(ge.length)})}),De=(a=7)=>{let e="../";for(let t=0;t<a;t++)e=`${e}../`;return e},we=(a,e,t,n,c,o)=>a!=null&&e!=null&&t!=null&&n!=null&&c!=null&&(t==="month"||t==="quarter")&&x(n,"YYYY-MM-DD").isValid()&&x(c,"YYYY-MM-DD").isValid()&&o!=null,Re=(a,e)=>a!=null&&a.endDate.isSame(e.endDate,"day")&&a.startDate.isBefore(e.startDate,"day")?T(a):T(e),$e=a=>`/${a}/transactions/${Ye}/statements`;function mt(){const a=w().state?.referrer,e=Pe.getSignedInUser(),t=xe(e),{useFeatureGate:n}=fe(),{isFeatureEnabled:c}=n(q.isExpenseAutomationEnabled),o=L(u=>u.expenseAutomationViewState.selectedPeriodByTenantId)[L(u=>R(u)).tenantId],{isFeatureEnabled:r}=n(q.isExpenseAutomationEnabledV2),s=r||c&&t;return i.jsxs(Ae,{children:[i.jsx(v,{path:"/:accountTypeEncoded/:accountIdEncoded/:timeframe/:startDate/:endDate/:titleEncoded/:excludeSubAccounts/*",element:i.jsx(le,{referrerType:a})}),i.jsx(v,{path:"/zeni-clearing-account/statements",element:i.jsx(je,{})}),i.jsx(v,{path:"/*",element:i.jsx(le,{referrerType:a})}),i.jsx(v,{path:"/uncategorized-income/*",element:i.jsx(F,{})}),i.jsx(v,{path:"/uncategorized-expense/*",element:s?i.jsx(C,{to:`../../month_end_close_checks/review/transaction_categorization/${o.month}-${o.year}`}):i.jsx(F,{})}),i.jsx(v,{path:"/miscategorized-income/*",element:i.jsx(F,{})}),i.jsx(v,{path:"/miscategorized-expense/*",element:s?i.jsx(C,{to:`../../month_end_close_checks/review/transaction_categorization/${o.month}-${o.year}`}):i.jsx(F,{})}),i.jsx(v,{path:"/missing-receipts/*",element:s?i.jsx(C,{to:`../../month_end_close_checks/review/missing_receipts/${o.month}-${o.year}`}):i.jsx(F,{})}),i.jsx(v,{path:"/by-class/:accountTypeEncoded/:accountIdEncoded/:classIdEncoded/:timeframe/:startDate/:endDate/:titleEncoded/*",element:i.jsx(Fe,{referrerType:a})})]})}export{mt as default};
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import{j as e}from"./liveblocks-BjW28Jor.js";import{j as B,u as U,h as M,l as O,g as f,N as L,k as N,n as Ce,o as k}from"./core-DM1rowt8.js";import{ck as V,eN as D,MB as R,D7 as ae,fc as Z,CR as ne,MD as Ie,Da as we,Mz as ke,MA as se,MR as be,Bh as Ae,s6 as je,MF as Ee,Dl as ve,MC as re,cN as W,wc as oe,eR as De,eT as Fe,NM as Le,NN as Be,CS as Ue,NO as Me,CT as Re,D0 as Pe,bv as Oe,bD as Ne,cv as Ve,bE as _e,cj as ze,fb as $e,bs as Ge,Il as He,ci as Ze}from"./zeni-epic-state-CsIRSm_7.js";import{A as _,al as We,z as j,w as z,e as b,b_ as qe,b$ as Je,c0 as H,Z as q,h as Ke,H as Qe,G as Xe,a as ie,d as v,x as Ye,s as et,c1 as tt,ao as J,q as at,c2 as nt,p as K,c3 as st,T as X,c4 as rt,a4 as ot}from"./index-CS4Iv8Vc.js";import{D as it,n as P,S as ct}from"./mui-D2eUyq0K.js";import lt from"./NotFoundScreen-DxfUGj1s.js";import{S as Y}from"./SetupPagesScreen-CPC76Yqt.js";import{a as d}from"./sentry-Cxwj7RZa.js";import{u as ut}from"./useAskAiCfoHostNavButtonProps-DRpYvsoM.js";import{c as dt}from"./useFetchSuggestedQuestionsWhenReady-C6t_ljZW.js";import{M as ce}from"./MobileAppDrawer-BMQB-H-F.js";import{F as pt}from"./FeaturePreviewScreen-BlTlevCF.js";import{a as ee}from"./analyticsHelper-C_jV_Bj8.js";import"./recharts-Boi6IWgf.js";import"./analytics-ZBaPMYvi.js";import"./plaid-BjrBUBaH.js";import"./dnd-C-Lnhdag.js";import"./stripe-DMRn4zHo.js";import"./lottie-Lcmd6dcO.js";import"./lexical-C5McV7XP.js";import"./pdf-CnfUruOo.js";import"./utils-DnmDUA9M.js";import"./routePaths-ChKhxwsZ.js";import"./BusinessVerificationPageScreen-BgGPN2BY.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]="841ad8e3-6bca-4778-b27d-f95afc820c35",t._sentryDebugIdIdentifier="sentry-dbid-841ad8e3-6bca-4778-b27d-f95afc820c35")}catch{}})();const mt=N(function(t,a){const{companyId:n}=a;return{treasurySetupView:R(t,n),analytics:b}},function(t,a){const{navigate:n,analytics:o,treasurySetupView:p}=a;return{onBackClick:()=>{n("../")},onNextClick:()=>{const r=p.fundAllocationLocalData;o.trackTreasuryPortfolioConfirm(r.riskScore,ee(r)),t(we(!0))},onUpdateFundAllocation:r=>{o.trackTreasuryAllocationAction("update",ee(r)),t(Ie(r))}}})(qe);function ft(){const t=B(),a=U(),n=M(),{tenantEmailDomain:o}=O(),p=_(),r=f(w=>w.treasurySetupViewState.portfolioAllocationUpdateStatus?.fetchState),m=We(r),s=V(p?.loggedInUserRoleMap),[c,i]=d.useState(!1),[y,I]=d.useState(!1),[u,l]=d.useState(!1),g=f(w=>D(w)),h=j.getSignedInUserTenant(o)?.companyId??g.companyId,T=j.getSignedInUser(),S=f(w=>R(w,h)),C=f(w=>w.treasurySetupViewState.fetchState),x=f(w=>w.treasurySetupViewState.currentAllocation.fetchStatus?.fetchState),F=f(w=>w.treasurySetupViewState.treasuryFundsDetails?.fetchStatus?.fetchState);if(T==null)throw Error("Can't access treasury portfolio allocation page without signing in...");if(d.useEffect(()=>{c||C!=="Not-Started"||h==null||(i(!0),n(ae(h,!0,!1)))},[c,C,h,n]),d.useEffect(()=>{u||F!=="Not-Started"||h==null||(l(!0),n(Z()))},[u,F,h,n]),d.useEffect(()=>{y||x!=="Not-Started"||h==null||(I(!0),n(ne()))},[y,x,h,n]),d.useEffect(()=>{m==="In-Progress"&&r==="Completed"&&t("../")},[m,r,t]),g.companyTreasuryInfo?.info?.isTreasuryTOSAccepted===!1)return e.jsx(L,{to:"../promo"});const E=g.companyTreasuryInfo?.info?.isTreasuryTOSAccepted!==!0||C!=="Completed";return e.jsxs(e.Fragment,{children:[!E&&e.jsx(z,{analytics:b,onLoad:()=>{}}),e.jsx(mt,{navigate:t,location:a,companyId:h,isEditMode:!0,isLoading:E,isReadOnly:!s,treasurySetupView:S,analytics:b})]})}const yt=N(function(t,a){const n=a.currentTenant?.companyId;return{plaidConnectionDetails:be(t,n,"zeni_treasury","treasury_setup").plaidConnectionDetails,treasurySetupView:R(t,n)}},function(t,a){const{navigate:n,transferDetails:o,treasurySetupView:p}=a,r=o.treasuryTransferMoneyLocalData,m=p.fundAllocationLocalData;return{onCancelClick:()=>{H(a.analytics,"cancel",r,m,"Transfer"),t(se()),n("../")},onTransferClick:()=>{H(a.analytics,"confirm",r,m,"Transfer"),t(ve())},onSaveChangesToLocalStore:s=>{t(Ee(s))},onFetchLinkTokenClick:s=>{t(je("treasury_setup",s))},onEstablishConnectionClick:s=>{t(Ae(s,a.currentTenant?.companyId,"treasury_setup","zeni_treasury"))}}})(Je),gt=({isFirstTransfer:t})=>{const a=B(),{tenantEmailDomain:n}=O(),o=M(),[p,r]=d.useState(!1),[m,s]=d.useState(!1),[c,i]=d.useState(!1),[y,I]=d.useState(!1),u=f(x=>x.treasurySetupViewState.fetchState),l=f(x=>x.treasurySetupViewState.treasuryFundsDetails?.fetchStatus?.fetchState),g=f(x=>x.treasurySetupViewState.currentAllocation.fetchStatus?.fetchState),h=f(x=>D(x)),T=j.getSignedInUserTenant(n)?.companyId??h.companyId,S=f(x=>ke(x)),C=f(x=>R(x,T));if(j.getSignedInUser()==null)throw Error("Can't access treasury transfer page without signing in...");return d.useEffect(()=>{m||u!=="Not-Started"||T==null||(s(!0),o(ae(T,!0,!1)))},[m,u,T,o]),d.useEffect(()=>{c||l!=="Not-Started"||T==null||(i(!0),o(Z()))},[c,l,T,o]),d.useEffect(()=>{y||g!=="Not-Started"||T==null||(I(!0),o(ne()))},[y,g,T,o]),e.jsxs(e.Fragment,{children:[e.jsx(z,{analytics:b,onLoad:()=>{}}),e.jsx(yt,{analytics:b,navigate:a,transferDetails:S,onAnotherTransferClick:()=>{r(!1),o(se())},currentTenant:h,treasurySetupView:C,showReviewContent:p,maxInsuredAmount:5e5,onReviewClick:()=>{H(b,"review",S.treasuryTransferMoneyLocalData,C.fundAllocationLocalData,"Transfer"),r(!0)},isFirstTransfer:t,setShowReviewContent:r,onBackClick:()=>{}})]})},ht=P.div`
|
|
2
|
+
display: flex;
|
|
3
|
+
min-height: 100%;
|
|
4
|
+
width: 100%;
|
|
5
|
+
flex: 1 1 auto;
|
|
6
|
+
flex-direction: column;
|
|
7
|
+
align-items: center;
|
|
8
|
+
background-color: ${t=>t.theme.colors.grey4};
|
|
9
|
+
`,St={overlayWidth:new Ye(100,100,48)},xt=N(function(t,a){const n=re(t),{companyId:o}=a;return{treasuryDetail:n,treasurySetupView:R(t,o),downloadEndPoint:`${J.bankingMicroServiceBaseUrl}/1.0/treasury-account/statements?query={"statement_type":"tax_statement"}`}},function(t,a){const{navigate:n,currentTenant:o,location:p,handleDrawerToggle:r,analytics:m}=a,{tenantEmailDomain:s}=o;return{onSettingsClick:()=>{m.trackAccountsListPageClicked("Settings Icon"),n("setup")},onReloadTransactions:()=>{t(oe(!0))},handleTreasuryOptionSelection:c=>{let i="page-not-found";c==="editPortfolio"?i=Tt(s):c==="statements"?i=Ct(s):c==="taxLetter"?i=It(s):c==="settings"&&(i=wt(s));const y=at(p.state?.pathnameStackToGoBack,p.pathname);n(i,{state:{pathnameStackToGoBack:y}})},onColumnSortConfigChanged:(c,i)=>{t(Le({uiState:{sortKey:c,sortOrder:i}}))},onTransferClick:()=>{n("./transfer")},onBackClick:()=>{n("../../")},onClickMenuIcon:()=>{r(!0)},onAutoTransferClick:()=>{n("../../checking/auto-transfer")}}})(tt);function G({isTransferDrawerOpen:t,isEditPortfolioDrawerOpen:a}){const n=U(),o=B(),p=M(),r=q(),m=Ke(),s=f(A=>D(A)),{tenantEmailDomain:c}=O(),i=s.companyId??j.getSignedInUserTenant(c)?.companyId,[y,I]=d.useState(!1),u=f(A=>re(A)),l=u.fetchState,g=u.accountSummary?.totalBalance?.amount,h=f(A=>A.treasurySetupViewState.treasuryFundsDetails?.fetchStatus),T=s.companyTreasuryInfo?.info?.businessVerificationStatus?.code==="verified",S=_(),C=!!s.companyTreasuryInfo?.info?.isTreasuryTOSAccepted,x=V(S?.loggedInUserRoleMap),F=W(S?.loggedInUserRoleMap),{areTenantIdsInSync:E}=Qe();d.useEffect(()=>{l==="Not-Started"&&!y&&E&&(I(!0),p(oe(!0)))},[y,p,l,E]),d.useEffect(()=>{u.transactionsFetchState.fetchState==="Completed"&&u.transactions.length===0&&!n.pathname.includes("transfer")&&x&&o("./transfer")},[u.transactionsFetchState.fetchState,u.transactions.length]);const w=()=>{o("..")},[le,ue]=d.useState(!1),Q=A=>{ue(A)},{isAiCfoOpen:de,setIsAiCfoOpen:pe}=Xe(),{isAiCfoAccessEnabled:me,onAskAiCfoClick:fe}=ut({isAiCfoOpen:de,setIsAiCfoOpen:pe,mobileExploreReferrer:"Treasury"});dt({isDataReady:l==="Completed"});const{useFeatureGate:$}=ie(),{isFeatureEnabled:ye}=$(v.isDebitCardFeatureEnabled),{isFeatureEnabled:ge}=$(v.isAutoTransferRuleEnabled),{isFeatureEnabled:he}=$(v.isTreasuryCommentingEnabled),Se=De(s),xe=Fe(ye,s);if(Se===!0&&xe!==!0)return e.jsx(pt,{});if(T){const A=h?.fetchState!=="Completed"||u.accountSummaryFetchState.fetchState!=="Completed";return e.jsxs(e.Fragment,{children:[u.accountSummaryFetchState.fetchState==="Completed"&&h?.fetchState==="Completed"&&t===!1&&a===!1?e.jsx(z,{analytics:b,onLoad:()=>{}}):null,e.jsx(it,{onClose:w,anchor:"right",open:a||t,transitionDuration:250,PaperProps:{style:{width:St.overlayWidth.valuePercentage(r),boxShadow:"none"}},slotProps:{backdrop:{style:{backgroundColor:m.colors.black,opacity:.75,cursor:"pointer"}}},children:e.jsxs(kt,{onClick:Te=>Te.stopPropagation(),children:[t===!0?e.jsx(gt,{isFirstTransfer:u.transactions.length===0||g===0}):null,a===!0?e.jsx(ft,{}):null]})}),e.jsxs(ht,{windowSize:r,children:[e.jsx(ce,{isAppContentDrawerOpen:le,handleDrawerToggle:Q}),e.jsx(xt,{treasuryDetailsView:u,isAutoTransferRuleEnabled:ge,navigate:o,currentTenant:s,location:n,companyId:i,analytics:b,isTreasuryCommentingEnabled:he,handleDrawerToggle:Q,isLoading:A,isAiCfoAccessEnabled:me,onAskAiCfoClick:fe})]})]})}return C&&x?e.jsx(L,{to:"../setup"}):s.companyTreasuryInfo?.info&&!C&&F?e.jsx(L,{to:"../promo",state:n.state}):e.jsx(et,{fetchState:"In-Progress",style:{backgroundColor:m.colors.grey5}})}const Tt=t=>`/${t}/treasury/edit-portfolio`,Ct=t=>`/${t}/treasury/statements`,It=t=>`/${t}/treasury/tax-letter`,wt=t=>`/${t}/treasury/setup`,kt=P(ct)`
|
|
10
|
+
display: flex;
|
|
11
|
+
min-height: 100%;
|
|
12
|
+
flex-direction: column;
|
|
13
|
+
`,bt=P.div`
|
|
14
|
+
display: flex;
|
|
15
|
+
height: 100vh;
|
|
16
|
+
width: 100%;
|
|
17
|
+
flex: 1 1 auto;
|
|
18
|
+
flex-direction: column;
|
|
19
|
+
align-items: center;
|
|
20
|
+
background-color: ${t=>t.theme.colors.grey4};
|
|
21
|
+
`;function At(){const t=B(),a=M(),n=q(),o=U(),p=`${J.bankingMicroServiceBaseUrl}/1.0/treasury-account`,[r,m]=d.useState(!1),s=f(l=>Be(l));d.useEffect(()=>{r||s.fetchState!=="Not-Started"||(m(!0),a(Ue(!1)))},[r,s.fetchState,a]);const c=j.getSignedInUser(),i=f(l=>D(l)),y={userId:c?.userId??"",sessionId:c?.zeniSessionId??"",tenantId:i.tenantId??""},I=i.company?.companyInfo.companyLegalName??i.companyName;if(c==null)throw Error("Can't access statements page without signing in...");const u=s.fetchState!=="Completed";return e.jsx(bt,{windowSize:n,children:e.jsx(nt,{currentTenantCompanyName:I,statementListView:s,isLoading:u,onBackClick:()=>{const l=K(o.state?.pathnameStackToGoBack),g=l.poppedPathname??"..";t(g,{state:{pathnameStackToGoBack:l.newStack}})},authParams:y,downloadEndPoint:p})})}const jt=P.div`
|
|
22
|
+
display: flex;
|
|
23
|
+
height: 100vh;
|
|
24
|
+
width: 100%;
|
|
25
|
+
flex: 1 1 auto;
|
|
26
|
+
flex-direction: column;
|
|
27
|
+
align-items: center;
|
|
28
|
+
background-color: ${t=>t.theme.colors.grey4};
|
|
29
|
+
`;function Et(){const t=B(),a=q(),n=U(),o=M(),p=`${J.bankingMicroServiceBaseUrl}/1.0/treasury-account`,[r,m]=d.useState(!1),s=f(l=>Me(l));d.useEffect(()=>{r||s.fetchState!=="Not-Started"||(m(!0),o(Re(!1)))},[r,s.fetchState,o]);const c=j.getSignedInUser(),i=f(l=>D(l)),y={userId:c?.userId??"",sessionId:c?.zeniSessionId??"",tenantId:i.tenantId??""},I=i.company?.companyInfo.companyLegalName??i.companyName;if(c==null)throw Error("Can't access tax letter page without signing in...");const u=s.fetchState!=="Completed";return e.jsx(jt,{windowSize:a,children:e.jsx(st,{currentTenantCompanyName:I,taxLetterListView:s,isLoading:u,onBackClick:()=>{const l=K(n.state?.pathnameStackToGoBack),g=l.poppedPathname??"..";t(g,{state:{pathnameStackToGoBack:l.newStack}})},authParams:y,downloadEndPoint:p})})}const vt=N(function(t,a){const{companyId:n}=a,o=R(t,n);return{treasurySetupView:o,isSetupComplete:o.companyTreasuryInfo?.businessVerificationStatus?.code==="verified",videoUrl:"https://www.youtube.com/watch?v=sqvJWKCMZgk",meetingUrl:"https://meetings.hubspot.com/yoshi-araki/treasury-product-schedule-demo-link?embed=true"}},function(t,a){const{navigate:n,companyId:o}=a;return{onSetupButtonClick:()=>{t(Pe(o))},onBackClick:()=>{n("../..",{relative:"path"})},onTreasurySetupSuccess:p=>{n(p?"..":"../setup",{relative:"path"})}}})(rt),Dt=()=>{const t=B(),a=U(),n=M(),{tenantEmailDomain:o}=O(),[p,r]=d.useState(!1),m=f(S=>D(S)),[s,c]=d.useState(!1),i=f(S=>S.treasurySetupViewState.treasuryFundsDetails?.fetchStatus);d.useEffect(()=>{s||i?.fetchState!=="Not-Started"||y==null||(c(!0),n(Z()))},[i,n]);const y=j.getSignedInUserTenant(o)?.companyId??m.companyId,I=j.getSignedInUser(),u=!!m.companyTreasuryInfo?.info?.isTreasuryTOSAccepted,l=S=>{r(S)};if(I==null)throw Error("Can't access treasury promo page without signing in...");const g=_(),h=V(g?.loggedInUserRoleMap),T=W(g?.loggedInUserRoleMap);if(u&&h)return e.jsx(L,{to:"../../treasury/setup"});if(m.company?.companyTreasuryInfo&&(!u&&h||T)){if(a.state?.message==="activation"){const S=K(a.state?.pathnameStackToGoBack);t(a.pathname,{state:{...a.state,message:void 0,pathnameStackToGoBack:S.newStack}})}return i?.fetchState!=="Completed"?e.jsx(te,{children:e.jsx(X,{size:"ExtraLarge",start:!0})}):e.jsxs(e.Fragment,{children:[e.jsx(z,{analytics:b,onLoad:S=>(C=>C.trackTreasuryPromoView("Treasury Promo Page"))(S)}),e.jsx(ce,{isAppContentDrawerOpen:p,handleDrawerToggle:l}),e.jsx(vt,{analytics:b,navigate:t,companyId:y,onClickMenuIcon:()=>{l(!0)}})]})}return e.jsx(te,{children:e.jsx(X,{size:"ExtraLarge",start:!0})})},te=P.div`
|
|
30
|
+
display: flex;
|
|
31
|
+
width: 100%;
|
|
32
|
+
height: 100%;
|
|
33
|
+
flex-direction: row;
|
|
34
|
+
justify-content: center;
|
|
35
|
+
align-items: center;
|
|
36
|
+
background-color: ${t=>t.theme.colors.grey5};
|
|
37
|
+
`;function ta(){const t=U(),a=f(E=>D(E)),{useFeatureGate:n}=ie(),{isFeatureEnabled:o}=n(v.isTreasuryEnabled),p=!!a.company?.companyTreasuryInfo?.isTreasuryTOSAccepted,r=_(),m=W(r?.loggedInUserRoleMap),s=a?.userRole!=null&&Oe(a?.userRole),c=(a?.company==null||a.company.featuresActivationInfo?.isBillPayFeatureEnabled&&!s)&&Ne(r?.loggedInUserRoleMap),i=Ve(r?.loggedInUserRoleMap),y=(a?.company==null||a.company.featuresActivationInfo?.isReimbursementFeatureEnabled&&!s)&&_e(r?.loggedInUserRoleMap),{isFeatureEnabled:I}=n(v.isDepositAccountsFeatureEnabled),u=I&&!s&&ze(r?.loggedInUserRoleMap),l=a.company!=null&&$e(a.company),g=o&&l===!0&&!s&&V(r?.loggedInUserRoleMap),{isFeatureEnabled:h}=n(v.isChargeCardFeatureEnabled),{isFeatureEnabled:T}=n(v.isDebitCardFeatureEnabled),S=ot(a,h,T)&&!s&&Ge(r?.loggedInUserRoleMap),C=He(r?.loggedInUserRoleMap),x=Ze(r?.loggedInUserRoleMap),F=a.companyTreasuryInfo?.info?.businessVerificationStatus?.code==="verified";return e.jsxs(Ce,{children:[x?null:e.jsx(k,{path:"setup",element:e.jsx(Y,{isBillPayAdminLevelAccess:c,isReimbursementAdminLevelAccess:y,isZeniAccountAdminLevelAccess:u,isChargeCardAdminLevelAccess:S,isTreasuryAdminLevelAccess:g,isUserHasOnlyCardAccess:C,isUserHasOnlyBillPayAccess:i,productType:"zeni_treasury",type:"setup"})}),x?null:e.jsx(k,{path:"verification",element:e.jsx(Y,{isBillPayAdminLevelAccess:c,isUserHasOnlyBillPayAccess:i,isReimbursementAdminLevelAccess:y,isZeniAccountAdminLevelAccess:u,isChargeCardAdminLevelAccess:S,isTreasuryAdminLevelAccess:g,isUserHasOnlyCardAccess:C,productType:"zeni_treasury",type:"verification"})}),e.jsx(k,{path:"promo",element:e.jsx(Dt,{})}),e.jsx(k,{path:"statements",element:e.jsx(At,{})}),e.jsx(k,{path:"tax-letter",element:e.jsx(Et,{})}),F?e.jsxs(e.Fragment,{children:[e.jsx(k,{path:"/",element:e.jsx(G,{isTransferDrawerOpen:!1,isEditPortfolioDrawerOpen:!1})}),g?e.jsxs(e.Fragment,{children:[e.jsx(k,{path:"edit-portfolio",element:e.jsx(G,{isEditPortfolioDrawerOpen:!0,isTransferDrawerOpen:!1})}),e.jsx(k,{path:"transfer",element:e.jsx(G,{isTransferDrawerOpen:!0,isEditPortfolioDrawerOpen:!1})})]}):null,e.jsx(k,{path:"*",element:e.jsx(lt,{})})]}):p&&g?e.jsx(k,{path:"*",element:e.jsx(L,{to:"../setup"})}):a.company?.companyZeniAccountInfo&&m?e.jsx(k,{path:"*",element:e.jsx(L,{to:"../promo",state:t.state})}):e.jsx(k,{path:"*",element:null})]})}export{ta as default};
|
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
import{j as l}from"./liveblocks-BjW28Jor.js";import{a as g}from"./sentry-Cxwj7RZa.js";import{j as M,u as q,l as J,g as S,k as G,h as Y,n as nt,o as B,N as K}from"./core-DM1rowt8.js";import{eN as O,Jh as Ie,Ji as Ue,fP as ee,cq as Ee,cr as ke,uN as ft,Jj as st,uR as Yt,Hv as te,jr as ae,uL as qt,uF as Ht,Jk as Ne,ux as Wt,uw as Qt,uq as Zt,uC as Xt,uS as ea,Jl as pe,Jm as Me,uy as ta,Jn as he,eY as gt,v5 as vt,u_ as xt,Jo as Tt,nT as Ct,uV as yt,uT as Dt,Jp as bt,vc as It,v9 as Et,uW as kt,vb as Ge,FX as wt,Jq as aa,Jr as na,ct as sa,Js as oa,Jt as la,Ju as me,Jv as ce,Jw as we,Hw as $e,vr as ye,Hu as De,ve as At,uO as Ke,Jx as ia,Hx as W,Jy as ze,uI as ca,Jz as da,JA as ra,JB as Ye,JC as qe,JD as He,JE as We,vl as Ae,JF as jt,v2 as Ft,JG as ua,JH as pa,JI as ha,JJ as ma,JK as Sa,JL as fa,JM as ga,JN as va,si as xa,sj as Ta,GB as Fe,JO as Ca,JP as ya,iQ as Pe,bq as Da,JQ as ba,JR as Ia,kp as Ea,ky as ka,GA as _e,bC as ot,JS as Pt,Gg as _t,JT as wa,JU as Aa,JV as ja,kA as Fa,JW as lt,JX as it,JY as ct,JZ as dt,J_ as Pa,kw as _a,J$ as Va,kz as La,K0 as Oa,K1 as Vt,GX as Lt,jP as Ba,K2 as Ja,K3 as Ve,K4 as Ot,GV as Bt,xE as Ra,K5 as Ua,K6 as Na,k7 as Jt,K7 as Ma,K8 as Ga,H7 as $a,p_ as Ka,K9 as Rt,Ka as rt,H4 as Le,Kb as ut,Kc as za,H9 as Ya,Kd as qa,Ke as Ha,Kf as Wa,Kg as Qa,Kh as Za,q1 as Xa,Ki as en,Hy as tn,Kj as an,GO as Oe,gy as nn,Kk as sn,Kl as on,gw as ln,Km as cn,Kn as dn,xI as rn,Ko as un,Kp as pn,Kq as hn,Kr as mn,jT as Sn,bn as fn,eT as gn,eR as vn}from"./zeni-epic-state-CsIRSm_7.js";import{z as R,al as Be,s as Ut,w as Z,e as P,N as X,ar as xn,q as N,D as be,r as de,as as Qe,at as Tn,au as Cn,p as Ze,av as yn,h as Dn,Z as re,x as Xe,a as ne,d as z,aw as bn,j as et,G as Se,ax as In,ay as Nt,H as En,az as kn,A as wn,aA as An,ao as Mt,aB as jn,o as Q,S as Fn,y as Gt,E as Pn,aC as _n,aD as Vn,g as tt,aE as Ln,aF as On,n as Bn,aG as Jn,aH as Rn}from"./index-CS4Iv8Vc.js";import{n as U,D as Un,S as $t}from"./mui-D2eUyq0K.js";import{t as Nn,A as Mn}from"./AddressScreen-DHoJdSM2.js";import ie from"./NotFoundScreen-DxfUGj1s.js";import{F as Gn}from"./FeaturePreviewScreen-BlTlevCF.js";import{b as H,v as at,c as $n}from"./routePaths-ChKhxwsZ.js";import{p as Kt}from"./pathToGoBack-BzV0PkoJ.js";import{u as fe}from"./useAskAiCfoHostNavButtonProps-DRpYvsoM.js";import{c as ge}from"./useFetchSuggestedQuestionsWhenReady-C6t_ljZW.js";import{M as ve}from"./MobileAppDrawer-BMQB-H-F.js";import{D as Kn}from"./DrawerScreen-GQyZ0U84.js";import{g as zn,m as Yn}from"./accountMappingHelper-xZvH7myI.js";import"./recharts-Boi6IWgf.js";import"./analytics-ZBaPMYvi.js";import"./plaid-BjrBUBaH.js";import"./dnd-C-Lnhdag.js";import"./stripe-DMRn4zHo.js";import"./lottie-Lcmd6dcO.js";import"./lexical-C5McV7XP.js";import"./pdf-CnfUruOo.js";import"./utils-DnmDUA9M.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]="34e1fbeb-b7c5-4f2b-b318-a2c64db5a958",e._sentryDebugIdIdentifier="sentry-dbid-34e1fbeb-b7c5-4f2b-b318-a2c64db5a958")}catch{}})();const qn=be.getLocalizedStrings(),Hn=G(function(e,a){const s=Ue(e,a.scheduleTab),t=e.tenantState.currentTenantId;return{authParams:{userId:a.signedInUser.userId??"",sessionId:a.signedInUser.zeniSessionId??"",tenantId:t??""},linkBillExpenseView:s.linkBillExpenseView,transactions:s.linkBillExpenseView.transactions}},function(e,a){const{navigate:s,location:t}=a;return{onTransactionSelect(n){e(st({selectedTransaction:n}))},onBackClick:()=>{s("..",{relative:"path"})},onCancel(){e(st({selectedTransaction:void 0})),e(Yt()),s("..",{relative:"path"})},onTransactionClick:n=>{const o=`${H(n,a.tenantEmailDomain)}`,c=N(t.state?.pathnameStackToGoBack,t.pathname);s(o,{state:{pathnameStackToGoBack:c}})},onLinkSave(){a.setShouldNavigateBack(!1),e(ft(a.scheduleTab,a.scheduleAccruedDetailsView.selectedJEAccruedSchedule?.jeScheduleId))}}})(xn),Wn=({setShouldNavigateBack:e})=>{const a=M(),s=q(),{scheduleDetailId:t,tenantEmailDomain:n}=J(),{scheduleType:o}=J();if(n==null)throw Error("Can't access Link Bill Expense page without tenant Email Domain");const c=S(f=>O(f)),d=Ie(o)??"accrued_expenses",u=R.getSignedInUser();if(u==null)throw Error("Can't access Link Bill Expensedetail page without signing in...");if(t==null)throw Error("Invalid Schedule Detail Id");const i=S(f=>Ue(f,d)),m=i.selectedJELinkRowIndex,r=S(f=>ee(f,c.companyId)),p=Be(i.updateStatus.fetchState);g.useEffect(()=>{p==="In-Progress"&&i.updateStatus.fetchState==="Completed"&&a("..",{relative:"path"})},[p,i.updateStatus.fetchState]),g.useEffect(()=>{i.fetchState==="Not-Started"&&a("..",{relative:"path"})},[]),g.useEffect(()=>{i.selectedJEAccruedSchedule!=null&&i.selectedJELinkRowIndex!=null||a("..",{relative:"path"})},[i.selectedJEAccruedSchedule,i.selectedJELinkRowIndex]);const h=i.linkBillExpenseView.fetchState==="Completed";return l.jsx(l.Fragment,{children:i.linkBillExpenseView.fetchState==="In-Progress"?l.jsx(Ut,{fetchState:i.linkBillExpenseView.fetchState}):i.selectedJEAccruedSchedule!=null&&m!=null?l.jsxs(l.Fragment,{children:[h===!0?l.jsx(Z,{analytics:P,onLoad:()=>{Qn(i,d,r)}}):null,l.jsx(Hn,{signedInUser:u,attachmentEndPoint:`${X}/vendor_attachments`,setShouldNavigateBack:e,scheduleVendorId:i.selectedJEAccruedSchedule.vendor.id??"",location:s,tenantEmailDomain:n,scheduleAccruedDetailsView:i,saveFetchState:i.updateStatus.fetchState,scheduleTab:d,navigate:a,analytics:P,controllerUserDetails:r,saveStatus:i.updateStatus.fetchState,jeAccruedSchedule:i.selectedJEAccruedSchedule,localData:i.scheduleAccruedDetailsLocalData.jeScheduleDetails[m]})]}):null})},zt=e=>{const a=qn.dateFormat.analytics.YYYYDashMMDashDDFormat;return{scheduleCreateDate:e.createTime.format(a)??null,scheduleMonthlyAmount:e.recurringAmount??null,startingBalance:e.otherAttributes.startingBalance??null,scheduleAccountCategory:e.jeCredit.account?.accountName??null,description:e.memo,runningBalance:e.balanceAsOfToday??null,currentBalance:e.balanceAsOfToday??null,currentStatus:e.status.label,period:e.period??null,startMonth:e.startDate?.format(a)??null,endMonth:e.endDate?.format(a)??null}},Qn=(e,a,s)=>{const t=e.selectedJEAccruedSchedule,n=e.selectedJELinkRowIndex;let o;n!=null&&t!=null&&(o=t.scheduledJournalEntry[n]);const{transactions:c}=e.linkBillExpenseView,d=c.some(m=>m.isRecommendedTransaction===!0),u=Ee(s.controllers),i=ke(s.controllerUserIds);t!=null&&P.trackScheduleAccruedDetailsJournalEntryLinkedLoaded({scheduleType:a,schedule:{...zt(t)},scheduleExpenseCategoryAndClass:{expenseCategory:t.jeDebit.account?.accountName??null,expenseClass:t.jeDebit.accountingClass?.className??null},journalEntryDetails:{wasRecommendationAvailable:d,journalEntryPostingStatus:o?.status.label??""},vendorName:t.vendor.name??null,controllerEmails:u,controllerUserIds:i})},Zn=U.div`
|
|
2
|
+
display: flex;
|
|
3
|
+
min-height: 100%;
|
|
4
|
+
width: 100%;
|
|
5
|
+
flex: 1 0 auto;
|
|
6
|
+
flex-direction: column;
|
|
7
|
+
align-items: center;
|
|
8
|
+
background-color: ${e=>e.theme.colors.grey4};
|
|
9
|
+
`,Xn=G(function(e){const a=O(e),s=e.entityAutoCompleteState.autoCompleteText.common,t=Ne(e,"common");return{tenantName:a.companyName,vendorSearchAutoCompleteData:{autoCompleteText:s,entityAutoCompleteView:t}}},function(e,a){const{navigate:s,location:t}=a,n="accrued_expenses";return{onNavigateBack:()=>{s("../schedules/accrued_expenses")},onZeniLogoClick:()=>{a.themeState.toggle()},onSave:o=>{a.setShouldNavigateBack(!0),e(ft(n,o))},onDelete:o=>{e(ta(n,o))},vendorSearchAutoCompleteActions:{onAutoCompleteInputChange:(o,c)=>{o.trim().length>=2?e(Me({searchString:o,entityType:c,searchOrigin:"common"})):o.trim().length===0&&e(pe("common"))},onCancelAutoComplete:()=>{e(pe("common"))}},onEditAmount:(o,c)=>{e(ea(n,o,c))},onJELinkClick:o=>{e(Xt({selectedJELinkRowIndex:o})),s("./edit_link")},onCancelAccrual:(o,c,d)=>{e(Zt(o,c,d))},onTransactionClick:o=>{const c=`${H(o,a.tenantEmailDomain)}`,d=N(t.state?.pathnameStackToGoBack,t.pathname);s(c,{state:{pathnameStackToGoBack:d}})},onViewPostedJE:o=>{const c=`${H(o,a.tenantEmailDomain)}`,d=N(t.state?.pathnameStackToGoBack,t.pathname);s(c,{state:{pathnameStackToGoBack:d}})},onViewRecordedJE:o=>{const c=`${H(o,a.tenantEmailDomain)}`,d=N(t.state?.pathnameStackToGoBack,t.pathname);s(c,{state:{pathnameStackToGoBack:d}})},onViewBillExpense:o=>{const c=`${H(o,a.tenantEmailDomain)}`,d=N(t.state?.pathnameStackToGoBack,t.pathname);s(c,{state:{pathnameStackToGoBack:d}})},onDetailPageChange:(o,c,d)=>{const{scheduleDetailsAccruedExpensesSection:u}=o,{amount:i,memo:m,months:r,scheduleAccruedExpenseCategory:p,scheduleClass:h,scheduleExpenseCategory:f,startDate:C,vendor:y}=u,I=h.selectedOption!=null?a.classList.find(k=>k.classId===h.selectedOption):void 0,D=f.selectedOption!=null?a.accountList.find(k=>k.qboId===f.selectedOption):void 0,b=p.selectedOption!=null?a.accruedAccountList.find(k=>k.qboId===p.selectedOption):void 0,w=r?.selectedOption;e(Wt({scheduleType:n,localData:c,selectedJeScheduleDetailId:a.scheduleDetailId})),d!==!1||a.scheduleDetailId!=null||D?.accountId==null||a.isAccountingClassesEnabled!==!1&&I?.classId==null||b==null||y.selectedOption==null||m==null||i==null&&i==0||C==null||w==null||e(Qt({scheduleType:n}))}}})(Tn),es=({shouldNavigateBack:e,setShouldNavigateBack:a})=>{const s=M(),t=q(),n=Y(),o=de(),{tenantEmailDomain:c}=J(),[d,u]=g.useState(!1);if(c==null)throw new Error("Can't access this page without a tenantEmailDomain");const{scheduleDetailId:i}=J();let m;i!=="new"&&(m=i);const r=ts(i),p=S(x=>x.scheduleAccruedDetailState.selectedJEAccruedScheduleKey),h="accrued_expenses",f=S(x=>Ue(x,"accrued_expenses")),C=S(x=>te(x)),y=S(x=>x.classListState.fetchState),I=S(x=>ae(x)),D=C!=="Completed"||y!=="Completed";g.useEffect(()=>{d===!1&&D?(n(qt(h,m)),u(!0)):D===!1&&d===!1&&i!=="new"&&(n(Ht(h,i)),u(!0))},[d]);const b=S(x=>O(x)),w=S(x=>ee(x,b.companyId)),k=f.fetchState,E=f.allAccountList,j=f.allClassList,F=f.allAccruedAccountList,V=f.scheduleAccruedDetailsLocalData;if(r!==!0||f.fetchState==="Error")return l.jsx(ie,{});const L=k==="Completed"&&d===!0;return k!=="Completed"&&k!=="Not-Started"?l.jsx(Qe,{}):l.jsxs(Zn,{children:[L===!0?l.jsx(Z,{analytics:P,onLoad:()=>{as(f,h,w)}}):null,l.jsx(Xn,{setShouldNavigateBack:a,scheduleAccruedDetailsView:f,location:t,navigate:s,classList:j,accountList:E,shouldNavigateBack:e,accruedAccountList:F,scheduleLocalData:V,selectedJEScheduleKey:p,scheduleDetailId:m,selectedScheduledJournalEntries:f.selectedJEAccruedSchedule?.scheduledJournalEntry??[],themeState:o,tenantEmailDomain:c,analytics:P,controllerUserDetails:w,isAccountingClassesEnabled:I,status:f.selectedJEAccruedSchedule?.status.code})]})},ts=e=>e!=null,as=(e,a,s)=>{const t=e.selectedJEAccruedSchedule,n=Ee(s.controllers),o=ke(s.controllerUserIds);t!=null&&P.trackScheduleAccruedDetailsLoaded({scheduleType:a,scheduleExpenseCategoryAndClass:{expenseCategory:t.jeDebit.account?.accountName??null,expenseClass:t.jeDebit.accountingClass?.className??null},schedule:{...zt(t)},vendorName:t.vendor.name??null,controllerEmails:n,controllerUserIds:o})},ns=U.div`
|
|
10
|
+
display: flex;
|
|
11
|
+
min-height: 100%;
|
|
12
|
+
width: 100%;
|
|
13
|
+
flex: 1 0 auto;
|
|
14
|
+
flex-direction: column;
|
|
15
|
+
align-items: center;
|
|
16
|
+
background-color: ${e=>e.theme.colors.grey4};
|
|
17
|
+
`,Je=be.getLocalizedStrings().dateFormat.analytics.YYYYDashMMDashDDFormat,ss=G(function(e){const a=O(e),s=he(e,"fixed_assets");return{tenantName:a.companyName,scheduleDetailsView:s}},function(e,a){const{navigate:s,location:t,vendorSearchAutoCompleteData:n,selectedScheduledJournalEntries:o}=a,c="fixed_assets",d=t.state?.message==="expenseAutomation",u=o.flatMap(i=>i.error).filter(i=>!!i)??[];return{onNavigateBack:()=>{if(d===!0){const i=Ze(a.location.state?.pathnameStackToGoBack),m=i.poppedPathname??Kt(2);a.navigate(m,{state:{pathnameStackToGoBack:i.newStack}})}else s("../schedules/fixed_assets")},onZeniLogoClick:()=>{a.themeState.toggle()},onSave:i=>{e(Ge(c,i,u.length>0))},onDelete:i=>{e(kt(c,i))},onMarkAsComplete:()=>{a.selectedJEScheduleKey!=null&&e(Et(c,a.selectedJEScheduleKey))},onEditAmount:(i,m)=>{e(It(c,i,m))},onJELinkClick:i=>{e(bt({selectedJELinkRowIndex:i})),s("./edit_link")},onTransactionClick:i=>{const m=`${H(i,a.tenantEmailDomain)}`,r=N(t.state?.pathnameStackToGoBack,t.pathname);s(m,{state:{pathnameStackToGoBack:r,message:"comingFromScheduleDetailsFixedAssets"}})},onViewLinkedJE:i=>{const m=`${H(i,a.tenantEmailDomain)}`,r=N(t.state?.pathnameStackToGoBack,t.pathname);s(m,{state:{pathnameStackToGoBack:r}})},vendorSearchAutoCompleteActions:{onAutoCompleteInputChange:(i,m)=>{i.trim().length>=2?e(Me({searchString:i,entityType:m,searchOrigin:"common"})):i.trim().length===0&&e(pe("common"))},onCancelAutoComplete:()=>{e(pe("common"))}},onDetailPageChange:(i,m)=>{const{scheduleDetailsFixedAssetsSection:r,scheduleDetailsListSection:p}=i,{scheduleClass:h,scheduleExpenseCategory:f,accumulatedDepreciationCategory:C,assetId:y,months:I,startDate:D,postingDate:b,vendor:w}=r,k=n.entityAutoCompleteView.vendor.length>0?n.entityAutoCompleteView.vendor.find(A=>A.id===w?.selectedOption):void 0,E={id:k?.zeniId??w?.selectedOption??"",name:k?.name??w?.defaultOptions.find(A=>A.value===w?.selectedOption)?.label??"",logo:k?.logo},j=h.selectedOption!=null?a.classList.find(A=>A.classId===h.selectedOption):void 0,F=f.selectedOption!=null?a.accountList.find(A=>A.qboId===f.selectedOption):void 0,V=C.selectedOption!=null?a.depAccountList.find(A=>A.qboId===C.selectedOption):void 0,L=I?.selectedOption,x=p.map((A,$)=>({...a.scheduleLocalData.jeScheduleDetails[$],amount:{...a.scheduleLocalData.jeScheduleDetails[$].amount,amount:A.amount}})),_=b.type==="day"?b.dayOfMonth?b.dayOfMonth:1:void 0,T=b.type==="lastDayOfMonth"||void 0;e(yt({scheduleType:c,localData:{selectedAccount:F?.accountId,selectedClass:j?.classId,selectedAccumulatedDepreciationCategory:V?.accountId,selectedDate:D,selectedMonths:L,assetId:y,jeScheduleDetails:x,lastDayOfMonth:T,selectedDayOfMonth:_,selectedVendor:E},selectedJeScheduleDetailId:a.scheduleDetailId})),m!==!1||V?.accountId==null||a.scheduleDetailId!=null&&a.status!=="draft"&&a.status!=="marked_as_completed"||F?.accountId==null||a.isAccountingClassesEnabled!==!1&&j?.classId==null||D==null||L==null||T!==!0&&_==null||e(Dt({scheduleType:c}))}}})(Cn),os=()=>{const e=M(),a=q(),s=Y(),t=de(),{tenantEmailDomain:n}=J(),[o,c]=g.useState(!1),{scheduleDetailId:d}=J(),u=a.state?.message==="expenseAutomation",i=ls(d),m=S(T=>T.scheduleDetailState.selectedJEScheduleKey);g.useEffect(()=>{m!=null&&m.length!==0||d!=="new"||e("../schedules/fixed_assets")},[m,d]);const r="fixed_assets",p=S(T=>he(T,r)),h=S(T=>T.entityAutoCompleteState.autoCompleteText.common),f=S(T=>Ne(T,"common")),C=S(T=>te(T)),y=S(T=>T.classListState.fetchState),I=S(T=>ae(T)),D=S(T=>gt(T).selectedPeriod),b=C!=="Completed"||y!=="Completed";g.useEffect(()=>{o===!1&&b?(s(vt(r,x,!0)),c(!0)):b===!1&&o===!1&&(s(xt(r,d==="new"?void 0:d,!0)),c(!0))},[o]),g.useEffect(()=>{if(p.markAsCompleteStatus.fetchState==="Completed")if(s(Tt()),u===!0){const{month:T,year:A}=D;e(`../../month_end_close_checks/review/je_schedules/${T}-${A}`)}else e("../schedules/fixed_assets")},[p.markAsCompleteStatus.fetchState]);const w=S(T=>O(T)),k=S(T=>ee(T,w.companyId)),E=p.fetchState,j=p.allAccountList,F=p.allClassList,V=p.allDepreciationAccountList,L=p.scheduleDetailsLocalData.fixed_assets;let x;if(d!=="new"&&(x=d),i!==!0||p.fetchState==="Error")return l.jsx(ie,{});const _=E==="Completed"&&o===!0;return E!=="Completed"?l.jsx(Qe,{}):l.jsxs(ns,{children:[_===!0?l.jsx(Z,{analytics:P,onLoad:()=>{cs(p,r,k)}}):null,l.jsx(ss,{location:a,navigate:e,classList:F,vendorSearchEntityAutoCompleteView:f,vendorSearchAutoCompleteData:{autoCompleteText:h,entityAutoCompleteView:f},expenseAutomationSelectedPeriod:D,usedInExpenseAutomation:u,removeJeScheduleTransactionKey:(T,A)=>{s(Ct(T,A))},accountList:j,depAccountList:V,scheduleLocalData:L,selectedJEScheduleKey:m,scheduleDetailId:x,selectedScheduledJournalEntries:p.selectedJEScheduleTransaction?.scheduledJournalEntry??[],themeState:t,tenantEmailDomain:n,analytics:P,controllerUserDetails:k,isAccountingClassesEnabled:I,status:p.selectedJEScheduleTransaction?.status.code})]})},ls=e=>e!=null,is=e=>({transactionDate:e.date.format(Je),transactionAmount:e.amount,scheduleCategory:e.account.accountName,scheduleClass:e.classBase?.className??null,description:e.memo}),cs=(e,a,s)=>{const t=e.selectedJEScheduleTransaction?.baseTransaction,n=e.selectedJEScheduleTransaction,o=Ee(s.controllers),c=ke(s.controllerUserIds);var d;t!=null&&n!=null&&P.trackScheduleDetailsLoaded({scheduleType:a,transaction:{...is(t)},scheduleExpenseCategoryAndClass:{expenseCategory:n.jeDebit.account?.accountName??null,expenseClass:n.jeDebit.accountingClass?.className??null},scheduledTransaction:{...(d=n,{currentBalance:d.balanceAsOfToday??null,currentStatus:d.status.label,period:d.period??null,startMonth:d.startDate?.format(Je)??null,endMonth:d.endDate?.format(Je)??null})},vendorName:n.vendor.name??null,fixedAssetsDetails:{accumulatedDepreciationCategory:n.jeCredit.account?.accountName??null,assetId:n.otherAttributes.assetId??null},controllerEmails:o,controllerUserIds:c})},ds=U.div`
|
|
18
|
+
display: flex;
|
|
19
|
+
min-height: 100%;
|
|
20
|
+
width: 100%;
|
|
21
|
+
flex: 1 0 auto;
|
|
22
|
+
flex-direction: column;
|
|
23
|
+
align-items: center;
|
|
24
|
+
background-color: ${e=>e.theme.colors.grey4};
|
|
25
|
+
`,Re=be.getLocalizedStrings().dateFormat.analytics.YYYYDashMMDashDDFormat,rs=G(function(e,a){const s=O(e),t=he(e,a.scheduleTab);return{tenantName:s.companyName,scheduleDetailsView:t}},function(e,a){const{navigate:s,location:t,usedInExpenseAutomation:n,vendorSearchAutoCompleteData:o,selectedScheduledJournalEntries:c}=a,d=c.flatMap(u=>u.error).filter(u=>!!u)??[];return{onNavigateBack:()=>{if(n===!0){const u=Ze(a.location.state?.pathnameStackToGoBack),i=u.poppedPathname??Kt(2);a.navigate(i,{state:{pathnameStackToGoBack:u.newStack}})}else s("../schedules/prepaid_expenses")},onZeniLogoClick:()=>{a.themeState.toggle()},onSave:u=>{e(Ge(a.scheduleTab,u,d.length>0))},onDelete:u=>{e(kt(a.scheduleTab,u))},onMarkAsComplete:()=>{a.selectedJEScheduleKey!=null&&e(Et(a.scheduleTab,a.selectedJEScheduleKey))},onEditAmount:(u,i)=>{e(It(a.scheduleTab,u,i))},onJELinkClick:u=>{e(bt({selectedJELinkRowIndex:u})),s("./edit_link")},onTransactionClick:u=>{const i=`${H(u,a.tenantEmailDomain)}`,m=N(t.state?.pathnameStackToGoBack,t.pathname);s(i,{state:{pathnameStackToGoBack:m,message:"comingFromScheduleDetails"}})},onViewLinkedJE:u=>{const i=`${H(u,a.tenantEmailDomain)}`,m=N(t.state?.pathnameStackToGoBack,t.pathname);s(i,{state:{pathnameStackToGoBack:m}})},vendorSearchAutoCompleteActions:{onAutoCompleteInputChange:(u,i)=>{u.trim().length>=2?e(Me({searchString:u,entityType:i,searchOrigin:"common"})):u.trim().length===0&&e(pe("common"))},onCancelAutoComplete:()=>{e(pe("common"))}},onDetailPageChange:(u,i)=>{const{scheduleDetailsSection:m,scheduleDetailsListSection:r}=u,{scheduleClass:p,scheduleExpenseCategory:h,months:f,startDate:C,postingDate:y,vendor:I}=m,D=o.entityAutoCompleteView.vendor.length>0?o.entityAutoCompleteView.vendor.find(x=>x.id===I?.selectedOption):void 0,b={id:D?.zeniId??I?.selectedOption??"",name:D?.name??I?.defaultOptions.find(x=>x.value===I?.selectedOption)?.label??"",logo:D?.logo},w=p.selectedOption!=null?a.classList.find(x=>x.classId===p.selectedOption):void 0,k=h.selectedOption!=null?a.accountList.find(x=>x.qboId===h.selectedOption):void 0,E=f?.selectedOption,j=r.map((x,_)=>({...a.scheduleLocalData.jeScheduleDetails[_],amount:{...a.scheduleLocalData.jeScheduleDetails[_].amount,amount:x.amount}})),F=y.type==="day"?y.dayOfMonth?y.dayOfMonth:1:void 0,V=y.type==="lastDayOfMonth"||void 0,L={selectedAccount:k?.accountId,selectedClass:w?.classId,selectedDate:C,selectedMonths:E,jeScheduleDetails:j,lastDayOfMonth:V,selectedVendor:b,selectedDayOfMonth:F};e(yt({scheduleType:a.scheduleTab,localData:L,selectedJeScheduleDetailId:a.scheduleDetailId})),i!==!1||a.scheduleDetailId!=null&&a.status!=="draft"&&a.status!=="marked_as_completed"||k?.accountId==null||a.isAccountingClassesEnabled!==!1&&w?.classId==null||C==null||E==null||V!==!0&&F==null||e(Dt({scheduleType:a.scheduleTab}))}}})(yn),us=()=>{const e=M(),a=q(),s=Y(),t=de(),{tenantEmailDomain:n}=J(),[o,c]=g.useState(!1),d=a.state?.message==="expenseAutomation",{scheduleType:u,scheduleDetailId:i}=J(),m=ps(u,i),r=S(T=>T.scheduleDetailState.selectedJEScheduleKey);g.useEffect(()=>{r!=null&&r.length!==0||i!=="new"||e("../schedules/prepaid_expenses")},[r,i]);const p=Ie(u)??"prepaid_expenses",h=S(T=>he(T,p)),f=S(T=>T.entityAutoCompleteState.autoCompleteText.common),C=S(T=>Ne(T,"common")),y=S(T=>te(T)),I=S(T=>T.classListState.fetchState),D=S(T=>ae(T)),b=S(T=>gt(T).selectedPeriod),w=y!=="Completed"||I!=="Completed";g.useEffect(()=>{o===!1&&w?(s(vt(p,x,!0)),c(!0)):w===!1&&o===!1&&(s(xt(p,i==="new"?void 0:i,!0)),c(!0))},[o]),g.useEffect(()=>{if(h.markAsCompleteStatus.fetchState==="Completed")if(s(Tt()),d===!0){const{month:T,year:A}=b;e(`../../month_end_close_checks/review/je_schedules/${T}-${A}`)}else e("../schedules/prepaid_expenses")},[h.markAsCompleteStatus.fetchState]);const k=S(T=>O(T)),E=S(T=>ee(T,k.companyId)),j=h.fetchState,F=h.allAccountList,V=h.allClassList,L=h.scheduleDetailsLocalData;let x;if(i!=="new"&&(x=i),m!==!0||h.fetchState==="Error")return l.jsx(ie,{});const _=j==="Completed"&&o===!0;return j!=="Completed"?l.jsx(Qe,{}):l.jsxs(ds,{children:[_===!0?l.jsx(Z,{analytics:P,onLoad:()=>{ms(h,p,E)}}):null,l.jsx(rs,{location:a,vendorSearchEntityAutoCompleteView:C,vendorSearchAutoCompleteData:{autoCompleteText:f,entityAutoCompleteView:C},usedInExpenseAutomation:d,removeJeScheduleTransactionKey:(T,A)=>{s(Ct(T,A))},expenseAutomationSelectedPeriod:b,navigate:e,classList:V,accountList:F,scheduleLocalData:L[p],selectedJEScheduleKey:r,scheduleDetailId:x,selectedScheduledJournalEntries:h.selectedJEScheduleTransaction?.scheduledJournalEntry??[],themeState:t,tenantEmailDomain:n,scheduleTab:p,analytics:P,controllerUserDetails:E,isAccountingClassesEnabled:D,status:h.selectedJEScheduleTransaction?.status.code})]})},ps=(e,a)=>Ie(e)!=null&&a!=null,hs=e=>({transactionDate:e.date.format(Re),transactionAmount:e.amount,scheduleCategory:e.account.accountName,scheduleClass:e.classBase?.className??null,description:e.memo}),ms=(e,a,s)=>{const t=e.selectedJEScheduleTransaction?.baseTransaction,n=e.selectedJEScheduleTransaction,o=Ee(s.controllers),c=ke(s.controllerUserIds);var d;t!=null&&n!=null&&P.trackScheduleDetailsLoaded({scheduleType:a,transaction:{...hs(t)},scheduleExpenseCategoryAndClass:{expenseCategory:n.jeDebit.account?.accountName??null,expenseClass:n.jeDebit.accountingClass?.className??null},scheduledTransaction:{...(d=n,{currentBalance:d.balanceAsOfToday??null,currentStatus:d.status.label,period:d.period??null,startMonth:d.startDate?.format(Re)??null,endMonth:d.endDate?.format(Re)??null})},vendorName:n.vendor.name??null,controllerEmails:o,controllerUserIds:c})},Ss={drawerLeftMargin:new Xe(0,0,100,200)},fs=G(function(e,a){const{jeScheduledTransaction:s,selectedJERow:t,scheduleType:n,isVendorBulkUpdateOnTransactionEnabled:o}=a,{scheduleDetailsLocalData:c,updateStatus:d}=he(e,a.scheduleType),u=O(e),i=c[n].jeScheduleDetails[t].jeLink,m=i.type==="recommended"?i.recommendedTransactionID:i.transactionDetailID,r=m!=null?na(e,m):void 0,p=R.getSignedInUser(),h=e.tenantState.currentTenantId,f={userId:p?.userId??"",sessionId:p?.zeniSessionId??"",tenantId:u.tenantId??h},C=u?.company?.companyInfo?.firstMonthOfFY??1;return{jeScheduledTransaction:s,transactionDetail:r,localData:c[n].jeScheduleDetails[t],saveStatus:d.fetchState,authParams:f,isVendorBulkUpdateOnTransactionEnabled:o,firstMonthOfFY:C,isDisabled:d.fetchState==="In-Progress"?"readonly":void 0,analytics:P,qboAppUrl:sa(et.qboRedirectionUrl)}},function(e,a){const{selectedJERow:s,jeScheduleDetailId:t,navigate:n}=a;return{onUpdateLocalData:o=>{const c=o.linkJETransaction.qboURL;c!=null&&e(la({scheduleType:a.scheduleType,jeScheduleDetailId:t,rowId:s,jeLink:c}))},onFetchTransactionClick:o=>{e(wt(o))},onSaveClick:()=>{e(Ge(a.scheduleType,t))},onBackClick:()=>{n("..",{relative:"path"})},onCancelClick:()=>{const o=a.jeScheduledTransaction.scheduledJournalEntry[s];e(oa({scheduleType:a.scheduleType,jeScheduleDetailId:t,rowId:s,originalScheduledJE:o})),n("..",{relative:"path"})}}})(bn),gs=()=>{const e=Dn(),a=M(),s=Y(),{scheduleDetailId:t}=J(),n=re(),o=Ss.drawerLeftMargin.valuePx(n),{scheduleType:c}=J(),{useFeatureGate:d}=ne(),{isFeatureEnabled:u}=d(z.isVendorBulkUpdateOnTransactionEnabled),i=Ie(c)??"prepaid_expenses",[m,r]=g.useState(!1);if(R.getSignedInUser()==null)throw Error("Can't access Account detail page without signing in...");if(t==null)throw Error("Invalid Schedule Detail Id");const p=S(D=>he(D,i));g.useEffect(()=>{p.fetchState==="Not-Started"&&a("..",{relative:"path"})},[]);const h=p.selectedJELinkRowIndex,f=h!=null?p.scheduleDetailsLocalData[i].jeScheduleDetails[h]?.jeLink:null,C=f?.type==="recommended"?f.recommendedTransactionID:f?.transactionDetailID;g.useEffect(()=>{C!=null&&s(wt(C))},[]),g.useEffect(()=>{f?.type==="recommended"&&m===!1&&h!=null&&(r(!0),s(aa({scheduleType:i,jeScheduleDetailId:t,rowId:h})))});const y=S(D=>O(D)),I=S(D=>ee(D,y.companyId));return l.jsx(Un,{anchor:"right",open:!0,PaperProps:{style:{width:`calc(100% - ${o})`,boxShadow:"none"}},slotProps:{backdrop:{style:{backgroundColor:e.colors.black,opacity:.75,cursor:"pointer"}}},onClose:()=>a("..",{relative:"path"}),children:l.jsx(vs,{onClick:D=>D.stopPropagation(),children:p.fetchState!=="Completed"||p.selectedJEScheduleTransaction==null||h==null?l.jsx(Ut,{fetchState:p.fetchState}):l.jsx(fs,{scheduleType:i,jeScheduleDetailId:t,selectedJERow:h,jeScheduledTransaction:p.selectedJEScheduleTransaction,isCOTEnabled:!1,navigate:a,scheduleTab:i,controllerUserDetails:I,isVendorBulkUpdateOnTransactionEnabled:u})})})},vs=U($t)`
|
|
26
|
+
display: flex;
|
|
27
|
+
min-height: 100%;
|
|
28
|
+
flex-direction: column;
|
|
29
|
+
`,xe=e=>{switch(e){case"vendors_tab":return"../summary";case"filing_1099":return"../filing_1099";case"prepaid_expenses":return"../schedules/prepaid_expenses";case"fixed_assets":return"../schedules/fixed_assets";case"accrued_expenses":return"../schedules/accrued_expenses";default:return"../opex"}},Te=e=>{switch(e){case"prepaid_expenses":return"prepaid_expenses";case"fixed_assets":return"fixed_assets";case"accrued_expenses":return"accrued_expenses";case"operating_expenses_by_vendor":return"operating_expenses";default:return"vendors_list"}},Ce=()=>{const e=q(),a=Y(),s=S(t=>me(t));return g.useEffect(()=>{const t=e.pathname.split("/").pop();if(t!=null){const n=(o=>{switch(o){case"prepaid_expenses":return"prepaid_expenses";case"fixed_assets":return"fixed_assets";case"accrued_expenses":return"accrued_expenses";case"opex":return"operating_expenses";case"filing_1099":return"filing_1099";default:return"vendors_list"}})(t);n!==s.currentTab&&a(ce(n))}},[e.pathname,s.currentTab,a]),s},se="accrued_expenses",xs=G(function(e,a){const s=O(e),t=me(e);return{tenantName:s.companyName,vendorTabsToShow:a.vendorTabsToShow,report:a.scheduleListReport,downloadParams:a.downloadParams,companyIncorporationDate:a.companyIncDate,vendorTabView:t,isAccountingClassesEnabled:ae(e)}},function(e,a){const{navigate:s}=a;return{onBackClick:()=>{s("../../..")},onVendorTabSelectionChanged:t=>{const n=xe(t);s(n),e(ce(Te(t)))},onSortOrderChanged:(t,n)=>{e(We({scheduleType:se,sortKey:t,sortOrder:n}))},onChangeSubTab:t=>{e(He({scheduleType:se,subTab:t}))},onSearchTextChanged:t=>{e(qe({scheduleType:se,searchText:t}))},onReloadReport:()=>{e(At(se))},onScroll:t=>{e(Ye({scheduleType:se,scrollYOffset:t}))},onClickNewButton:()=>{e(da()),e(ra()),P.trackScheduleAccruedDetailsNewRequested({scheduleType:"accrued_expenses"}),s("details/new")},onClickSchedule:t=>{e(ca({selectedJEScheduleKey:t}));const n=a.scheduleListReport.jeAccruedSchedules.find(o=>o.jeAccruedScheduleKey===t);s(`details/${n?.jeScheduleId}`)},updateDownloadStateHandler:t=>{e(ze({scheduleType:se,fetchState:t}))}}})(In),Ts=({vendorTabsToShow:e,previousTabPosition:a,setPreviousTabPosition:s})=>{const{isAiCfoOpen:t,setIsAiCfoOpen:n}=Se(),[o,c]=g.useState(!1),[d,u]=g.useState(!1),i=M(),m=Y(),{useFeatureGate:r}=ne(),p=de();Ce();const{isFeatureEnabled:h,isFeatureGateLoading:f}=r(z.isOpexByVendorFeatureEnabled),C=R.getSignedInUser(),y=S(v=>O(v)),I={userId:C?.userId??"",sessionId:C?.zeniSessionId??"",tenantId:y.tenantId},D=g.useMemo(()=>({authParams:I,jeScheduleEndPoint:`${X}/jeScheduleReports`,timezone:we(),companyName:y.companyName}),[]),[b,w]=g.useState(!1),k=S(v=>te(v)),E=S(v=>$e(v,"accrued_expenses")),j=e.includes("prepaid_expenses"),F=e.includes("fixed_assets"),V=e.includes("accrued_expenses");g.useEffect(()=>{(j||F||V)&&b===!1&&k!=="Completed"&&(m(ye()),w(!0))},[b]),g.useEffect(()=>{f===!1&&(m(De({shouldFetchAccruedExpenses:V,shouldFetchFixedAssets:!0,shouldFetchPrepaidExpenses:j,shouldFetchOpexByVendor:h,shouldFetchVendorsList:!1,shouldFetchFiling1099Vendor:!1})),c(!0))},[k,F,f,h]),g.useEffect(()=>{o===!1&&E==="Completed"&&m(At("accrued_expenses",{selectedTimeframe:Ke("accrued_expenses"),selectedCategoryId:"all"},!0))},[o,E]);const L=S(v=>ia(v,se)),{isAiCfoAccessEnabled:x,onAskAiCfoClick:_}=fe({isAiCfoOpen:t,setIsAiCfoOpen:n,mobileExploreReferrer:"Vendors — Accrued Expenses"});ge({isDataReady:L.fetchState==="Completed"});const T=S(v=>W(v).isReportGenerated);S(v=>W(v).fetchState)!=="Completed"||T!==!0||h!==!0||e.includes("operating_expenses_by_vendor")||e.splice(1,0,"operating_expenses_by_vendor"),V||i("../opex");const A=S(v=>ee(v,y.companyId)),$=v=>{u(v)};return l.jsxs(l.Fragment,{children:[l.jsx(ve,{isAppContentDrawerOpen:d,handleDrawerToggle:$}),l.jsx(xs,{navigate:i,previousTabPosition:a,setPreviousTabPosition:s,scheduleListReport:L,downloadParams:D,themeState:p,vendorTabsToShow:e,analytics:P,controllerUserDetails:A,isAiCfoAccessEnabled:x,onAskAiCfoClick:_,onClickMenuIcon:()=>$(!0)})]})},oe="fixed_assets",Cs=G(function(e,a){const s=O(e),t=me(e);return{tenantName:s.companyName,vendorTabsToShow:a.vendorTabsToShow,report:a.scheduleListReport,downloadParams:a.downloadParams,companyIncorporationDate:a.companyIncDate,controllerUserDetails:a.controllerUserDetails,vendorTabView:t,isAccountingClassesEnabled:ae(e)}},function(e,a){const{navigate:s}=a;return{onBackClick:()=>{s("../../..")},onVendorTabSelectionChanged:t=>{const n=xe(t);s(n),e(ce(Te(t)))},onSortOrderChanged:(t,n)=>{e(We({scheduleType:oe,sortKey:t,sortOrder:n}))},onChangeSubTab:t=>{e(He({scheduleType:oe,subTab:t}))},onSearchTextChanged:t=>{e(qe({scheduleType:oe,searchText:t}))},onReloadReport:()=>{e(Ae(oe))},onScroll:t=>{e(Ye({scheduleType:oe,scrollYOffset:t}))},onClickSchedule:t=>{e(Ft({selectedJEScheduleKey:t}));const n=a.scheduleListReport.jeScheduledTransactions.find(o=>o.jeScheduleTransactionKey===t);s(n?.jeScheduleId==null?"details/new":`details/${n.jeScheduleId}`)},updateDownloadStateHandler:t=>{e(ze({scheduleType:oe,fetchState:t}))}}})(Nt),ys=({vendorTabsToShow:e,previousTabPosition:a,setPreviousTabPosition:s})=>{const{isAiCfoOpen:t,setIsAiCfoOpen:n}=Se(),[o,c]=g.useState(!1),d=M(),u=Y();Ce();const{useFeatureGate:i}=ne(),m=de(),{isFeatureEnabled:r,isFeatureGateLoading:p}=i(z.isOpexByVendorFeatureEnabled),h=R.getSignedInUser(),f=S(v=>O(v)),C={userId:h?.userId??"",sessionId:h?.zeniSessionId??"",tenantId:f.tenantId},y=g.useMemo(()=>({authParams:C,jeScheduleEndPoint:`${X}/jeScheduleReports`,timezone:we(),companyName:f.companyName}),[]),[I,D]=g.useState(!1),b=S(v=>te(v)),w=S(v=>$e(v,"fixed_assets")),k=e.includes("prepaid_expenses"),E=e.includes("fixed_assets"),j=e.includes("accrued_expenses");g.useEffect(()=>{(k||E||j)&&I===!1&&b!=="Completed"&&(u(ye()),D(!0))},[I]),g.useEffect(()=>{p===!1&&(u(De({shouldFetchAccruedExpenses:j,shouldFetchFixedAssets:!0,shouldFetchPrepaidExpenses:k,shouldFetchOpexByVendor:r,shouldFetchVendorsList:!1,shouldFetchFiling1099Vendor:!1})),c(!0))},[b,E,p,r]),g.useEffect(()=>{o===!1&&w==="Completed"&&u(Ae("fixed_assets",{selectedTimeframe:Ke("fixed_assets"),selectedCategoryId:"all"},!0))},[o,w]);const F=S(v=>jt(v,oe)),{isAiCfoAccessEnabled:V,onAskAiCfoClick:L}=fe({isAiCfoOpen:t,setIsAiCfoOpen:n,mobileExploreReferrer:"Vendors — Fixed Assets"});ge({isDataReady:F.fetchState==="Completed"});const x=S(v=>W(v).isReportGenerated);S(v=>W(v).fetchState)!=="Completed"||x!==!0||r!==!0||e.includes("operating_expenses_by_vendor")||e.splice(1,0,"operating_expenses_by_vendor"),E||d("../opex");const _=S(v=>ee(v,f.companyId)),[T,A]=g.useState(!1),$=v=>{A(v)};return l.jsxs(l.Fragment,{children:[l.jsx(ve,{isAppContentDrawerOpen:T,handleDrawerToggle:$}),l.jsx(Cs,{navigate:d,scheduleListReport:F,downloadParams:y,previousTabPosition:a,setPreviousTabPosition:s,themeState:m,vendorTabsToShow:e,analytics:P,controllerUserDetails:_,isAiCfoAccessEnabled:V,onAskAiCfoClick:L,onClickMenuIcon:()=>{$(!0)}})]})},Ds=U.div`
|
|
30
|
+
display: flex;
|
|
31
|
+
min-height: 100%;
|
|
32
|
+
width: 100%;
|
|
33
|
+
flex: 1 1 auto;
|
|
34
|
+
flex-direction: column;
|
|
35
|
+
align-items: center;
|
|
36
|
+
background-color: ${e=>e.theme.colors.grey4};
|
|
37
|
+
`,bs=G(function(e,a){const s=R.getSignedInUser(),t=e.tenantState.currentTenantId,n=O(e),o=n?.companyName??"",c={userId:s?.userId??"",sessionId:s?.zeniSessionId??"",tenantId:t??""},d=W(e),u=ua(e);return{report:d,uiState:u,isAccountingClassesEnabled:ae(e),analytics:P,vendorTabsToShow:a.vendorTabsToShow,downloadParams:{downloadState:u.downloadState,currentTenantCompanyName:o,statementEndPoint:`${X}/opexByVendor`,authParams:c,timezone:we()}}},function(e,a){const{navigate:s}=a;return{onFetchOpExByVendors:(t,n,o)=>{e(Ta(t,n,o))},onVendorNameAndBalanceClicked:(t,n)=>{if(a.tenantEmailDomain!=null){const o=at(t.id,t.qboId,a.tenantEmailDomain,n),c=N(a.location.state?.pathnameStackToGoBack,a.location.pathname);a.navigate(o,{state:{pathnameStackToGoBack:c,referrer:"Operating Expenses By Vendor"}})}},onReloadReport:()=>{e(xa(!0))},onBackClick:()=>{s("../../dashboard")},onTimeframeSelectionChanged:t=>{e(va(t))},onAdditionalBalanceSelectionChanged:(t,n)=>{e(ga({isCompareModeOn:t,additionalBalances:n}))},onSortOrderChanged:(t,n,o)=>{e(fa({sortkey:n,sortOrder:t,timeframe:o}))},onVendorTabSelectionChanged:t=>{const n=xe(t);s(n),e(ce(Te(t)))},onSortOrSearchStarted:t=>{e(Sa(t))},onPageFetchStarted:()=>{e(ma(!0))},updateDownloadStateHandler:t=>{e(ha(t))},onClearSearch:t=>{e(pa({timeframe:t}))}}})(kn);function Is({vendorTabsToShow:e,previousTabPosition:a,setPreviousTabPosition:s}){const{isAiCfoOpen:t,setIsAiCfoOpen:n}=Se(),o=M(),c=Y(),d=q(),{tenantEmailDomain:u}=J(),i=re(),m=R.getSignedInUser(),{useFeatureGate:r}=ne(),{isFeatureEnabled:p,isFeatureGateLoading:h}=r(z.isOpexByVendorFeatureEnabled),f=S(_=>W(_));if(m==null)throw Error("Can't access opex by vendor page without signing in...");Ce();const[C,y]=g.useState(!1),I=S(_=>te(_)),D=e.includes("prepaid_expenses"),b=e.includes("fixed_assets"),w=e.includes("accrued_expenses"),k=S(_=>me(_)),{isAiCfoAccessEnabled:E,onAskAiCfoClick:j}=fe({isAiCfoOpen:t,setIsAiCfoOpen:n,mobileExploreReferrer:"Vendors — Operating Expenses by Vendor"});ge({isDataReady:f.fetchState==="Completed"&&f.isReportGenerated===!0});const{areTenantIdsInSync:F}=En();g.useEffect(()=>{(D||b||w)&&C===!1&&I!=="Completed"&&F&&(c(ye()),y(!0))},[C,F]),g.useEffect(()=>{F&&c(De({shouldFetchAccruedExpenses:w,shouldFetchFixedAssets:b,shouldFetchPrepaidExpenses:D,shouldFetchOpexByVendor:p===!0&&h===!1,shouldFetchVendorsList:!1,shouldFetchFiling1099Vendor:!1}))},[I,b,h,p,F]),f.fetchState!=="Completed"||f.isReportGenerated!==!0||p!==!0||e.includes("operating_expenses_by_vendor")||e.splice(1,0,"operating_expenses_by_vendor"),(f.isReportGenerated===!1&&f.fetchState==="Completed"||p===!1&&h===!1)&&o("../summary");const[V,L]=g.useState(!1),x=_=>{L(_)};return l.jsxs(Ds,{windowSize:i,children:[f.fetchState==="Completed"?l.jsx(Z,{analytics:P,onLoad:_=>{k.previousTab==null?_.trackVendorOperatingExpensesPageLoaded("Side Panel"):_.trackVendorOperatingExpenses(k.currentTab,k.previousTab??null)}}):null,l.jsx(ve,{isAppContentDrawerOpen:V,handleDrawerToggle:x}),l.jsx(bs,{location:d,navigate:o,previousTabPosition:a,setPreviousTabPosition:s,tenantEmailDomain:u,vendorTabsToShow:e,isAiCfoAccessEnabled:E,onAskAiCfoClick:j,onClickMenuIcon:()=>{x(!0)}})]})}const le="prepaid_expenses",Es=G(function(e,a){const s=O(e),t=me(e);return{tenantName:s.companyName,vendorTabsToShow:a.vendorTabsToShow,report:a.scheduleListReport,downloadParams:a.downloadParams,companyIncorporationDate:a.companyIncDate,controllerUserDetails:a.controllerUserDetails,vendorTabView:t,isAccountingClassesEnabled:ae(e)}},function(e,a){const{navigate:s}=a;return{onBackClick:()=>{s("../../..")},onVendorTabSelectionChanged:t=>{const n=xe(t);s(n),e(ce(Te(t)))},onSortOrderChanged:(t,n)=>{e(We({scheduleType:le,sortKey:t,sortOrder:n}))},onChangeSubTab:t=>{e(He({scheduleType:le,subTab:t}))},onSearchTextChanged:t=>{e(qe({scheduleType:le,searchText:t}))},onReloadReport:()=>{e(Ae(le))},onScroll:t=>{e(Ye({scheduleType:le,scrollYOffset:t}))},onClickSchedule:t=>{e(Ft({selectedJEScheduleKey:t}));const n=a.scheduleListReport.jeScheduledTransactions.find(o=>o.jeScheduleTransactionKey===t);s(n?.jeScheduleId==null?"details/new":`details/${n.jeScheduleId}`)},updateDownloadStateHandler:t=>{e(ze({scheduleType:le,fetchState:t}))}}})(Nt),ks=({vendorTabsToShow:e,previousTabPosition:a,setPreviousTabPosition:s})=>{const{isAiCfoOpen:t,setIsAiCfoOpen:n}=Se(),[o,c]=g.useState(!1),d=M(),u=Y(),{useFeatureGate:i}=ne(),m=de();Ce();const r=R.getSignedInUser(),{isFeatureEnabled:p,isFeatureGateLoading:h}=i(z.isOpexByVendorFeatureEnabled),f=S(v=>O(v)),C=S(v=>$e(v,"prepaid_expenses")),y={userId:r?.userId??"",sessionId:r?.zeniSessionId??"",tenantId:f.tenantId},I=g.useMemo(()=>({authParams:y,jeScheduleEndPoint:`${X}/jeScheduleReports`,timezone:we(),companyName:f.companyName}),[]),[D,b]=g.useState(!1),w=S(v=>te(v)),k=e.includes("prepaid_expenses"),E=e.includes("fixed_assets"),j=e.includes("accrued_expenses");g.useEffect(()=>{(k||E||j)&&D===!1&&w!=="Completed"&&(u(ye()),b(!0))},[D]),g.useEffect(()=>{o===!1&&C==="Completed"&&u(Ae("prepaid_expenses",{selectedTimeframe:Ke("prepaid_expenses"),selectedCategoryId:"all"},!0))},[o,C]),g.useEffect(()=>{h===!1&&(u(De({shouldFetchAccruedExpenses:j,shouldFetchFixedAssets:E,shouldFetchPrepaidExpenses:!0,shouldFetchOpexByVendor:p,shouldFetchVendorsList:!1,shouldFetchFiling1099Vendor:!1})),c(!0))},[w,E,h,p]);const F=S(v=>jt(v,le)),{isAiCfoAccessEnabled:V,onAskAiCfoClick:L}=fe({isAiCfoOpen:t,setIsAiCfoOpen:n,mobileExploreReferrer:"Vendors — Prepaid Expenses"});ge({isDataReady:F.fetchState==="Completed"});const x=S(v=>W(v).isReportGenerated);S(v=>W(v).fetchState)!=="Completed"||x!==!0||p!==!0||e.includes("operating_expenses_by_vendor")||e.splice(1,0,"operating_expenses_by_vendor"),k||d("../opex");const _=S(v=>ee(v,f.companyId)),[T,A]=g.useState(!1),$=v=>{A(v)};return l.jsxs(l.Fragment,{children:[l.jsx(ve,{isAppContentDrawerOpen:T,handleDrawerToggle:$}),l.jsx(Es,{navigate:d,previousTabPosition:a,setPreviousTabPosition:s,scheduleListReport:F,downloadParams:I,themeState:m,vendorTabsToShow:e,analytics:P,controllerUserDetails:_,isAiCfoAccessEnabled:V,onAskAiCfoClick:L,onClickMenuIcon:()=>{$(!0)}})]})},ws=U.div`
|
|
38
|
+
display: flex;
|
|
39
|
+
min-height: 100%;
|
|
40
|
+
width: 100%;
|
|
41
|
+
flex: 1 1 auto;
|
|
42
|
+
flex-direction: column;
|
|
43
|
+
align-items: center;
|
|
44
|
+
background-color: ${e=>e.theme.colors.grey4};
|
|
45
|
+
`,As=G(function(e,a){const{isFiling1099FeatureEnabled:s,vendorDetailView:t,selectedVendor:n,firstMonthOfFY:o,currentTenant:c,currentUserRoleMap:d}=a,u=R.getSignedInUser(),i={userId:u?.userId??"",sessionId:u?.zeniSessionId??"",tenantId:c.tenantId??""};return{firstMonthOfFY:o,isFiling1099FeatureEnabled:s,vendorDetailView:t,allTransactions:t?.allVendorTransactionsView,allTransactionsTabData:t?.allTransactionsTabData!=null?{timePeriod:wa(t?.allTransactionsTabData.timePeriod),numberOfQuartersFetched:t?.allTransactionsTabData.numberOfQuartersFetched}:void 0,vendorLogo:n?.logo,readOnlyMode:d?.bookkeeping_user===!0,filesEndPoint:Mt.fileMicroServiceBaseUrl,authParams:i,scrollToTrend:a.isTrendPeriodSelected}},function(e,a){const{navigate:s,vendorDetailView:t,vendorId:n,defaultTransactionTimePeriod:o,vendorEntity:c,tenantEmailDomain:d,location:u,firstMonthOfFY:i}=a,m=()=>{const r=Ze(u.state?.pathnameStackToGoBack),p=r.poppedPathname??((h=2)=>{let f=h;a.isTrendPeriodSelected===!0&&(f=5);let C="../";for(let y=0;y<f;y++)C=`${C}../`;return C})(1);s(p,{state:{pathnameStackToGoBack:r.newStack}})};return{onSaveVendor:()=>{t!=null&&((r,p)=>{const{vendorId:h,vendorName:f,existingCategory:C,existingClass:y,existingOwner:I,selectedCategory:D,selectedClass:b,selectedOwner:w,isRecommendedCategorySelected:k,isRecommendedClassSelected:E,categoryRecommendationTypeSelected:j,classRecommendationTypeSelected:F}=Oa(r,p);h!=null&&P.trackVendorDetailsSave(h,f??"",C,y,I,D,b,w,k,E,j,F)})(t?.vendorViewDetails,t?.vendorViewDetails.ownerList),n!=null&&e(La(n,void 0))},onVendorSpendTrendFilterTabClick:r=>{e(Va(r))},saveVendorDetailLocalData:r=>{n!=null&&e(_a({vendorId:n,localData:r}))},saveContactsInVendorTabDetailLocalData:(r,p)=>{e(Pa({vendorId:r,localData:{contacts:p}}))},onCancelClick:()=>{var r;t?.vendorViewDetails.vendorView?.vendorBasic!=null&&(r=t.vendorViewDetails.vendorView.vendorBasic).id!=null&&P.trackVendorDetailsCancel(r.id??"",r.name,r.account?.accountName,r.class?.className,r.owner?.email),e(lt()),e(it()),e(ct()),e(dt()),m()},handleSpendTrendPercentChangeClick:()=>{var r;t?.vendorViewDetails.vendorView?.vendorBasic!=null&&(r=t.vendorViewDetails.vendorView?.vendorBasic,r.id!=null&&P.trackVendorDetailsSpendTrendHotlinkClicked(r.id??"",r.name,r.account?.accountName,r.class?.className,r.owner?.email))},onSaveSuccess:()=>{n!=null&&e(Fa("Not-Started",n)),e(lt()),e(it()),e(ct()),e(dt()),m()},onTrendSelectedPeriodChange:r=>{if(r==null)o!=null&&e(Fe(c,"EntityDetail",{timeframe:"quarter",timePeriod:o}));else{const p=r.currentTimePeriod==null?r.addTimePeriod:{startDate:r.addTimePeriod.startDate,endDate:r.currentTimePeriod.endDate};e(_e(c,"EntityDetail",{timeframe:r.timeframe,timePeriod:r.addTimePeriod},i)),e(Fe(c,"EntityDetail",{timeframe:r.timeframe,timePeriod:p}))}},onVendorTabSelectionChanged:r=>{e(ja(r))},onAddressClick:(r,p)=>{if(d==null)return;const h=$n(d,r,p),f=N(u.state?.pathnameStackToGoBack,u.pathname);s(h,{state:{pathnameStackToGoBack:f}})},onVendorDetailUIChange:r=>{e(Aa({collapsableStatus:r}))},onTransactionItemClick:r=>{const p=`${H(r,d)}`,h=N(u.state?.pathnameStackToGoBack,u.pathname);s(p,{state:{pathnameStackToGoBack:h}})},onLoadPreviousTransactionsClick:(r,p)=>{e(Pt({timePeriod:Pe(r),numberOfQuartersFetched:p})),e(_t(c,Pe(r),!0,!0))}}})(An);function pt({referrerType:e,isFiling1099FeatureEnabled:a}){const s=Y(),t=q(),n=M(),o=wn(),[c,d]=g.useState(!1),[u,i]=g.useState(!1),[m,r]=g.useState(!1),p=J(),h=p.vendorId,f=p.qboId,{tenantEmailDomain:C,timeframe:y,startDate:I,endDate:D}=p,b={id:f??"",name:"",type:"vendor",zeniId:h??"",qboId:f??""};g.useEffect(()=>{y!=null&&I!=null&&D!=null?d(!0):(d(!1),m===!1&&(r(!0),s(Fe(b,"EntityDetail"))))},[y,I,D]);const w=re(),k=S(v=>O(v)),E=S(v=>h!=null?Ca(v,h,b):void 0),j=S(v=>v.vendorState.vendorByID[h??""]),F=S(v=>O(v).company?.companyInfo.firstMonthOfFY??1),V=S(()=>ya(F,2)),L=Pe({startDate:V.startDate,endDate:Da()}),x=ba(F),_=S(v=>Ia(v.trendWithTransactionsState,b,"EntityDetail")),[T,A]=g.useState(!1),$=c===!1&&m===!1?void 0:_?.selectedPeriod?.timePeriod??x;return g.useEffect(()=>(e==null&&E?.fetchState!=="Not-Started"||h==null||s(Ea(h,b)),()=>{e!=null&&h!=null&&s(ka(h))}),[h,t.state,s]),g.useEffect(()=>{E?.fetchState==="Completed"&&E?.vendorViewDetails.vendorView?.vendorBasic!=null&&((v,ue,je)=>{v.id!=null&&P.trackVendorDetails(v.id,v.name,je,v.account?.accountName,v.class?.className,v.owner?.email,ue.percentChange,ue.last30DaysSpend,ue.last90DaysSpend,ue.yearToDateSpend)})(E?.vendorViewDetails.vendorView?.vendorBasic,E?.vendorSpend,e),A(!1)},[E?.fetchState]),g.useEffect(()=>{if(E?.fetchState==="Completed"&&T===!1){$!=null&&c===!1&&(s(_e(b,"EntityDetail",{timeframe:_?.selectedPeriod?.timeframe??"quarter",timePeriod:$},F)),A(!0));const v=be.getLocalizedStrings().dateFormat.analytics;if(c===!0&&y!=null&&I!=null&&D!=null){A(!0);const ue=y,je={startDate:ot(I,v.YYYYDashMMDashDDFormat),endDate:ot(D,v.YYYYDashMMDashDDFormat)};s(_e(b,"EntityDetail",{timeframe:ue,timePeriod:je}))}}},[E?.fetchState,$,_?.selectedPeriod?.timeframe,c,F]),g.useEffect(()=>{E?.fetchState==="Completed"&&u===!1&&(s(Pt({timePeriod:L,numberOfQuartersFetched:3})),s(_t(b,E.allTransactionsTabData?.timePeriod??L,!1,!0)),i(!0))},[E?.fetchState,u]),h==null?l.jsx(ie,{}):l.jsx(ws,{windowSize:w,children:l.jsx(As,{location:t,navigate:n,isFiling1099FeatureEnabled:a,vendorDetailView:E,vendorId:h,currentTenant:k,selectedVendor:j,firstMonthOfFY:F,isTrendPeriodSelected:c,selectedPeriodTimePeriod:_?.selectedPeriod?.timePeriod,defaultTransactionTimePeriod:x,vendorEntity:b,currentUserRoleMap:o?.loggedInUserRoleMap,tenantEmailDomain:C})})}const js=be.getLocalizedStrings().spendManagement.billPay.vendorCreation.vendorDetails,Fs={containerWidth:new Xe(100,58)},Ps=U(Fn)`
|
|
46
|
+
width: ${Q.sp4};
|
|
47
|
+
height: ${Q.sp4};
|
|
48
|
+
cursor: pointer;
|
|
49
|
+
color: ${e=>e.theme.colors.brandColorJade};
|
|
50
|
+
`,_s=U.div`
|
|
51
|
+
display: flex;
|
|
52
|
+
height: 100vh;
|
|
53
|
+
flex-direction: ${e=>e.windowSize==="small"?"column":"row"};
|
|
54
|
+
width: 100%;
|
|
55
|
+
overflow-y: scroll;
|
|
56
|
+
background-color: ${e=>e.theme.colors.grey4};
|
|
57
|
+
`,Vs=U.div`
|
|
58
|
+
display: flex;
|
|
59
|
+
flex-direction: column;
|
|
60
|
+
width: ${e=>`${Fs.containerWidth.value(e.windowSize)}%`};
|
|
61
|
+
${e=>e.windowSize!=="small"?"overflow: auto;":""}
|
|
62
|
+
`,Ls=G(function(e,a){const s=R.getSignedInUser(),t=e.tenantState.currentTenantId,n={userId:s?.userId??"",sessionId:s?.zeniSessionId??"",tenantId:t??""},o=e.vendorFiling1099UploadDetailsState,c=e.vendorFiling1099UploadDetailsState;let d={fetchState:"Not-Started",error:void 0};return a.vendorId!=null&&(d=e.vendorViewState.editVendorStateById[a.vendorId]?.fetchStatus),{uploadInvoiceEndPoint:`${Mt.documentAIMicroServiceBaseUrl}`,vendorFiling1099UploadDetailsState:o,vendorFiling1099UploadDetailsViewState:c,uploadStaus:c.w9FormUploadStatus,authParams:n,billId:a.billId,vendorId:a.vendorId,file:a.file,showAutofill:a.showAutofill,type:a.type,analytics:P,entityId:a.billId,fetchVendorFetchStatus:d,vendorLegalName:a.vendorLegalName}},function(e,a){const s=a.vendorId;return{onInvoiceUpload:t=>{if(function(n){return n!=null&&"w9_form"in n}(t)&&(e(Ua({w9FormFile:t.files[0]})),t.w9_form[0]!=null)){e(Na({ocrData:t.w9_form[0],vendorId:s}));const n=(o=>({street:[o.street.join(" ")],city:o.city,state:o.state,postalCode:o.postal_code,countryCode:o.country_code??void 0,country:o.country??""}))(t.w9_form[0].address);e(Jt({addressType:"vendor_address",addressToCreate:n}))}},updateInvoiceUploadFetchState:t=>{e(Ve({fetchState:t,error:void 0}))},onSkipAutofill:t=>{e(Ra(t))},onVendorFiling1099UploadDetailsSave:t=>{e(Bt(t))},onDeleteClick:()=>{e(Ve({fetchState:"Not-Started",error:void 0})),e(Ot({vendorId:s,w9Documents:[]}))}}})(_n);function ht({appContent:e,showFullScreenSkeletonWhileLoading:a}){const s=Y(),t=M(),{vendorId:n}=J(),o=re(),c=de(),d=R.getSignedInUser(),[u,i]=g.useState(!1),{useFeatureGate:m}=ne(),{isFeatureEnabled:r}=m(z.isVendorRecommendationFeatureEnabled),p=S(x=>O(x)).companyName,h=new AbortController,f=h.signal;let C,y,I,D,b;if(n==null)throw new Error("Vendor ID not found for Vendor Filing 1099 Details Screen");C=S(x=>Vt(x,n)),y=S(x=>x.vendorFiling1099UploadDetailsState.vendor1099DetailsSaveStatus),I=S(x=>x.vendorViewState.editVendorStateById[n]?.fetchStatus),b=S(x=>x.vendorFiling1099UploadDetailsState.vendor1099DetailsLocalData.w9Documents?.[0]),D=S(x=>x.vendorFiling1099UploadDetailsState);const w=I?.fetchState==="In-Progress"||D?.w9FormUploadStatus?.fetchState==="In-Progress",k=()=>{c.toggle()};g.useEffect(()=>()=>{h.abort(),s(Lt(n))},[]),g.useEffect(()=>{u||n!=null&&(i(!0),s(Ba(!1,n,f)))},[n]);const E=Be(I?.fetchState),j=Be(y?.fetchState),F=C.vendor?.contactIds,V=F?.[F.length-1],L=S(x=>x.contactState.contactById[V]);if(g.useEffect(()=>{n!=null&&E==="In-Progress"&&I?.fetchState==="Completed"&&C?.vendor!=null&&(s(Ja(n,C.vendor,L)),C?.vendor.filing1099W9Files?.[0]!=null&&s(Ve({fetchState:"Completed",error:void 0})))},[n,C?.vendor]),g.useEffect(()=>{j==="In-Progress"&&y?.fetchState==="Completed"&&t("../../vendors/filing_1099")},[y?.fetchState]),a===!0&&I?.fetchState!=="Completed"&&I?.fetchState!=="Error")return l.jsx(Us,{children:l.jsx(jn,{})});if(d==null)throw Error("Can't access VendorFiling1099UploadScreen without signing in...");return l.jsxs(_s,{windowSize:o,children:[o!=="small"?l.jsxs(Bs,{children:[l.jsx(Ps,{onClick:k}),l.jsxs(Os,{showContent:d.userEmailDomain==="zeni.ai",children:[l.jsx(Js,{showAutofill:!1}),l.jsx(Rs,{showAutofill:!1,children:p})]})]}):null,l.jsx(Ls,{vendorId:n,file:b,showAutofill:!1,type:"w9",isVendorRecommendationEnabled:r,pdfTitle:b?js.w9FormTitle:void 0,showTitlebar:!0,showTitlebarIcon:!0,vendorLegalName:C?.vendor?.legalName,isLoading:w}),l.jsx(Vs,{windowSize:o,children:e})]})}const Os=U.div`
|
|
63
|
+
display: ${e=>e.showContent?"flex":"none"};
|
|
64
|
+
align-items: center;
|
|
65
|
+
`,Bs=U.div`
|
|
66
|
+
margin-bottom: ${Q.sp3};
|
|
67
|
+
margin-top: ${Q.sp3};
|
|
68
|
+
margin-left: ${Q.sp8};
|
|
69
|
+
position: absolute;
|
|
70
|
+
display: flex;
|
|
71
|
+
align-items: center;
|
|
72
|
+
`,Js=U.div`
|
|
73
|
+
width: 1px;
|
|
74
|
+
height: ${Q.sp3};
|
|
75
|
+
margin: ${Q.sp0} ${Q.sp3};
|
|
76
|
+
background-color: ${e=>e.showAutofill?Gt.neutralGrey1Light:e.theme.colors.hero};
|
|
77
|
+
`,Rs=U(Pn.StandardMedium)`
|
|
78
|
+
color: ${e=>e.showAutofill?Gt.neutralGrey5Light:e.theme.colors.primary};
|
|
79
|
+
`,Us=U.div`
|
|
80
|
+
width: 100%;
|
|
81
|
+
height: 100vh;
|
|
82
|
+
overflow: hidden;
|
|
83
|
+
background-color: ${e=>e.theme.colors.grey4};
|
|
84
|
+
`,Ns=G(function(e){const a=Ma(e);return{vendorDetailView:Ga(e),globalMerchantView:a}},function(e,a){const{navigate:s}=a;return{updateVendorDetailLocalData:t=>{e(Rt({vendorDetails:t}))},fetchRecommendation:t=>{e(Ka("tenant",t))},onSaveClick:()=>{e($a())},onBackClick:()=>{s("../review")}}})(Vn);function Ms(){const e=M();return l.jsx(Ns,{navigate:e})}const Gs=U.div`
|
|
85
|
+
display: flex;
|
|
86
|
+
min-height: 100%;
|
|
87
|
+
width: 100%;
|
|
88
|
+
flex: 1 1 auto;
|
|
89
|
+
flex-direction: column;
|
|
90
|
+
align-items: center;
|
|
91
|
+
background-color: ${e=>e.theme.colors.grey4};
|
|
92
|
+
`,$s=G(function(e,a){const{vendorFirstReviewDetails:s}=a,t=e.globalMerchantAutoCompleteState.autoCompleteText,n=R.getSignedInUser(),o=e.tenantState.currentTenantId,c={userId:n?.userId??"",sessionId:n?.zeniSessionId??"",tenantId:o??""},d=O(e);return{vendorFirstReviewView:s,globalMerchantAutoCompleteData:{globalMerchantAutoCompleteView:s.globalMerchantAutoCompleteView,autoCompleteText:t},analytics:P,authParams:c,attachmentEndpoint:d.externalConnections?.accounting[0]?.connectionName==="netsuite"?`${X}/vendor_attachments_accounting_provider`:`${X}/vendor_attachments`}},function(e,a){const{navigate:s}=a;return{onFetchVendorReviewView:(t,n,o)=>{e(Le(t,n,o))},onGlobalMerchantAutoCompleteInputChange:(t,n)=>{t.trim().length>=2?e(Xa({searchString:t,globalMerchantType:n??"vendor"})):t.trim().length===0&&e(ut())},onUpdateLocalData:(t,n,o,c)=>{if(n!=null){const d=Ks(n);e(Za({vendorId:t,currentSelection:d,selectedGlobalMerchantId:o,vendorRenamedText:c}))}},onResetVendorLocalData:t=>{e(Qa({vendorId:t}))},onVendorNameClick:(t,n)=>{if(a.tenantEmailDomain!=null){const o=at(t,n,a.tenantEmailDomain),c=N(a.location.state?.pathnameStackToGoBack,a.location.pathname);a.navigate(o,{state:{pathnameStackToGoBack:c}})}},onUpdatePageToken:t=>{e(Wa({pageToken:t}))},onUpdateSortUiState:(t,n)=>{e(Ha({sortOrder:t,sortKey:n}))},onUpdateScrollYOffset:t=>{e(qa({scrollYOffset:t}))},onClickSave:(t,n,o)=>{e(Ya(t,n,o))},onClickCancelPopup:()=>{e(za())},onClearGlobalMerchantAutoCompleteResults:()=>{e(ut())},onClickRedirectToQBO:()=>{window.open(`${et.qboRedirectionUrl}/vendors`,"_blank")},updateVendorDetailLocalData:t=>{e(Rt({vendorDetails:t})),s(`./vendor/${t.id}`)},onBackClick:()=>{s("../..")},onReloadList:()=>{e(Le(null))}}})(Ln);function mt(){const e=M(),a=Y(),s=q(),{tenantEmailDomain:t}=J(),n=re(),o=R.getSignedInUser(),{vendorId:c}=J(),d=S(p=>rt(p)),[u,i]=g.useState(!1),m=S(p=>rt(p).fetchState);if(g.useEffect(()=>{m==="Not-Started"&&u===!1&&(a(Le(null)),i(!0))},[]),o==null)throw Error("Can't access first review page without signing in...");const r=p=>p.trackPageLoaded(tt.Event.vendorTenantReviewListPage);return l.jsxs(l.Fragment,{children:[m==="Completed"?l.jsx(Z,{analytics:P,onLoad:r}):null,l.jsx(Z,{analytics:P,onLoad:r}),l.jsx(Kn,{isOpen:c!=null,drawerLeftMargin:new Xe(0,0,300,600),onClose:()=>{e("../review")},children:l.jsx(zs,{onClick:p=>p.stopPropagation(),children:l.jsx(Ms,{})})}),l.jsx(Gs,{windowSize:n,children:l.jsx($s,{location:s,navigate:e,vendorFirstReviewDetails:d,tenantEmailDomain:t})})]})}const Ks=e=>e.recommendedFirst===!0?"recommendedFirst":e.recommendedSecond===!0?"recommendedSecond":e.retain===!0?"retain":e.rename===!0?"rename":e.customMerchant===!0?"customMerchant":null,zs=U($t)`
|
|
93
|
+
display: flex;
|
|
94
|
+
min-height: 100%;
|
|
95
|
+
flex-direction: column;
|
|
96
|
+
`,Ys=G(function(e,a){const s=R.getSignedInUser(),t=e.tenantState.currentTenantId,n=e.vendorFiling1099UploadDetailsState,o={userId:s?.userId??"",sessionId:s?.zeniSessionId??"",tenantId:t??""};let c={fetchState:"Not-Started",error:void 0};return a.vendorId!=null&&(c=e.vendorViewState.editVendorStateById[a.vendorId]?.fetchStatus),{analytics:P,vendorFiling1099UploadDetailsViewState:n,authParams:o,googleAPIKey:et.googleMapsAPIKey,vendorId:a.vendorId,fetchVendorFetchStatus:c,vendor:a.vendorFiling1099UploadDetails?.vendor}},function(e,a){const{currentTenant:s,navigate:t,location:n,vendorId:o,vendorFiling1099UploadDetails:c}=a,{tenantEmailDomain:d}=s;return{onVendorFiling1099UploadDetailsSave:u=>{e(Bt(u)),P.trackVendor1099DetailSave(c.vendor.legalName??"")},onSaveChangesToLocalStore:u=>{e(Ot(u))},onResetVendorFiling1099FormStatus:()=>{e(en())},onAddressEditHandler:u=>{const i=Nn((m=>({street:m.vendor1099FilingSectionId.street,suite:m.vendor1099FilingSectionId.suite,city:m.vendor1099FilingSectionId.city,state:m.vendor1099FilingSectionId.state,country:m.vendor1099FilingSectionId.country,countryCode:m.vendor1099FilingSectionId.countryCode,postalCode:m.vendor1099FilingSectionId.postalCode,secondaryInfo:m.vendor1099FilingSectionId.secondaryInfo}))(u));e(Jt({addressType:"vendor_address",addressToCreate:i}))},goBackToListPage:()=>{e(Lt(o));const u=`/${d}/vendors/filing_1099/`,i=N(n.state?.pathnameStackToGoBack,n.pathname);t(u,{state:{pathnameStackToGoBack:i}})},onAddressClick:u=>{const i=function(r,p,h){let f=`/${r}/vendors/filing_1099/upload/${h}/edit`;return f=f.concat(`/new/${p}`),f}(d,u,o),m=N(n.state?.pathnameStackToGoBack,n.pathname);t(i,{state:{pathnameStackToGoBack:m}})},AddressFormPage:Bn}})(On);function qs(){const e=M(),a=q(),{vendorId:s}=J(),t=S(d=>O(d));let n;if(s==null)throw new Error("Vendor ID not found for Vendor Filing 1099 Details Screen");n=S(d=>Vt(d,s));const{tenantEmailDomain:o}=t,c=t.companyId??R.getSignedInUserTenant(o)?.companyId;if(c==null)throw new Error("Company ID not found for Vendor Filing 1099 Details Screen");return l.jsx(Ys,{location:a,navigate:e,currentTenant:t,vendorId:s,vendorFiling1099UploadDetails:n,companyId:c})}const Hs=U.div`
|
|
97
|
+
display: flex;
|
|
98
|
+
min-height: 100%;
|
|
99
|
+
width: 100%;
|
|
100
|
+
flex: 1 1 auto;
|
|
101
|
+
flex-direction: column;
|
|
102
|
+
align-items: center;
|
|
103
|
+
background-color: ${e=>e.theme.colors.grey4};
|
|
104
|
+
`,Ws=G(function(e,a){const{vendorsFiling1099ListDetails:s,accountMappingView:t,analytics:n}=a;return{analytics:n,vendorsFiling1099List:s.vendors,isVendor1099Populated:s.isVendor1099Populated,accountMappingView:t,fetchState:s.fetchState,uiState:s.uiState,lastRefreshSuccessTime:s.lastRefreshSuccessTime,vendorTabsToShow:a.vendorTabsToShow}},function(e,a){const{navigate:s,analytics:t}=a;return{onUpdateSortUiState:(n,o)=>{e(dn({sortOrder:n,sortKey:o}))},onUpdateSearchUiState:n=>{e(cn({searchString:n}))},onVendorRowClick:n=>{if(a.tenantEmailDomain!=null){const o=`/${a.tenantEmailDomain}/vendors/filing_1099/upload/${encodeURIComponent(n)}/edit`,c=N(a.location.state?.pathnameStackToGoBack,a.location.pathname);a.navigate(o,{state:{pathnameStackToGoBack:c}})}},onReloadVendors:()=>{e(Oe(!0))},onBackClick:()=>{e(on()),e(ln())},onVendorTabSelectionChanged:n=>{const o=xe(n);s(o),e(ce(Te(n)))},onAccountMappingChange:n=>{const{filing1099:o}=n,{bankAccount:c,expenseCategory1099:d}=o,u=zn(a.accountMappingView.bankAccounts1099FilingAccountList,c.selectedOptions),i=Yn(a.accountMappingView.expenseAccounts1099FilingAccountList,d),m={selectedBankAccounts1099FilingAccountIds:u.map(r=>r.accountId),selectedExpenseAccounts1099FilingAccountIds:i};e(sn({data:m}))},onSaveClick:()=>{e(nn()),t.track(tt.Event.vendor1099TabSettingsSave)}}})(Jn);function St({vendorTabsToShow:e,previousTabPosition:a,setPreviousTabPosition:s}){const{isAiCfoOpen:t,setIsAiCfoOpen:n}=Se(),o=M(),c=Y(),d=q(),{tenantEmailDomain:u}=J(),i=re(),m=R.getSignedInUser(),[r,p]=g.useState(!1),[h,f]=g.useState(!1);if(m==null)throw Error("Can't access vendor filing 1099 page without signing in...");Ce();const C=S(j=>tn(j)),y=S(j=>an(j)),{isAiCfoAccessEnabled:I,onAskAiCfoClick:D}=fe({isAiCfoOpen:t,setIsAiCfoOpen:n,mobileExploreReferrer:"Vendors — 1099"});ge({isDataReady:C.fetchState==="Completed"}),g.useEffect(()=>{h||(f(!0),c(Oe(!1)))},[h,f]),g.useEffect(()=>{y.saveState.fetchState==="Completed"&&c(Oe(!1))},[y.saveState.fetchState]);const b=j=>{p(j)},w=S(j=>O(j)),k={userId:m?.userId??"",sessionId:m?.zeniSessionId??"",tenantId:w.tenantId},E=g.useMemo(()=>({authParams:k,tenantName:w.companyName,filing1099ReportEndPoint:`${X}/filing1099Reports`}),[]);return l.jsxs(l.Fragment,{children:[C.fetchState==="Completed"?l.jsx(l.Fragment,{children:l.jsx(Z,{analytics:P,onLoad:()=>P.trackPageLoaded(tt.Event.vendor1099ListPage)})}):null,l.jsxs(Hs,{windowSize:i,children:[l.jsx(ve,{isAppContentDrawerOpen:r,handleDrawerToggle:b}),l.jsx(Ws,{location:d,navigate:o,previousTabPosition:a,setPreviousTabPosition:s,analytics:P,vendorsFiling1099ListDetails:C,vendorTypeList:C.vendorTypeList,accountMappingView:y,downloadParams:E,tenantEmailDomain:u,vendorTabsToShow:e,isAiCfoAccessEnabled:I,onAskAiCfoClick:D,onClickMenuIcon:()=>{b(!0)}})]})]})}const Qs=U.div`
|
|
105
|
+
display: flex;
|
|
106
|
+
min-height: 100%;
|
|
107
|
+
width: 100%;
|
|
108
|
+
flex: 1 1 auto;
|
|
109
|
+
flex-direction: column;
|
|
110
|
+
align-items: center;
|
|
111
|
+
background-color: ${e=>e.theme.colors.grey4};
|
|
112
|
+
`,Zs=G(function(e,a){const{vendorsListDetails:s}=a;return{vendorsList:s.vendors,totalVendorCount:s.totalVendorCount,fetchState:s.fetchState,uiState:s.uiState,searchText:s.searchString,lastRefreshSuccessTime:s.lastRefreshSuccessTime,vendorTabsToShow:a.vendorTabsToShow,isAccountingClassesEnabled:ae(e),analytics:P}},function(e,a){const{navigate:s}=a;return{onFetchVendorsList:(t="",n,o)=>{e(Sn({searchString:t,keepExistingListItems:n,view:"vendorsTab",pageToken:o}))},onUpdatePageToken:t=>{e(mn({pageToken:t}))},onUpdateSortUiState:(t,n)=>{e(hn({sortOrder:t,sortkey:n}))},onUpdateCurrentYTDSelection:t=>{e(pn({ytdSpendSelection:t}))},onVendorRowClick:(t,n)=>{if(a.tenantEmailDomain!=null){const o=at(t,n,a.tenantEmailDomain),c=N(a.location.state?.pathnameStackToGoBack,a.location.pathname);a.navigate(o,{state:{pathnameStackToGoBack:c,referrer:"Vendor List"}})}},onReloadVendors:()=>{console.log("Reload vendors")},onUpdateScrollYOffset:t=>{e(un({scrollYOffset:t}))},onBackClick:()=>{s("../..")},onVendorTabSelectionChanged:t=>{const n=xe(t);s(n),e(ce(Te(t)))}}})(Rn);function Xs({vendorTabsToShow:e,previousTabPosition:a,setPreviousTabPosition:s}){const{isAiCfoOpen:t,setIsAiCfoOpen:n}=Se(),o=M(),c=Y(),d=q(),{tenantEmailDomain:u}=J(),i=re(),m=R.getSignedInUser(),{useFeatureGate:r}=ne(),{isFeatureEnabled:p,isFeatureGateLoading:h}=r(z.isOpexByVendorFeatureEnabled);Ce();const f=e.includes("prepaid_expenses"),C=e.includes("fixed_assets"),y=e.includes("accrued_expenses"),I=S(A=>me(A));let D={};D=S(A=>rn(A,"vendorsTab"));const[b,w]=g.useState(!1),{isAiCfoAccessEnabled:k,onAskAiCfoClick:E}=fe({isAiCfoOpen:t,setIsAiCfoOpen:n,mobileExploreReferrer:"Vendors Summary"});ge({isDataReady:D.fetchState==="Completed"});const j=S(A=>te(A)),F=S(A=>W(A).isReportGenerated);S(A=>W(A).fetchState)==="Completed"&&F&&p&&!e.includes("operating_expenses_by_vendor")&&e.splice(1,0,"operating_expenses_by_vendor");const[V,L]=g.useState(!1);if(g.useEffect(()=>{(f||C)&&V===!1&&j!=="Completed"&&(c(ye()),L(!0))},[V]),g.useEffect(()=>{c(De({shouldFetchAccruedExpenses:y,shouldFetchFixedAssets:C,shouldFetchPrepaidExpenses:f,shouldFetchOpexByVendor:p&&h===!1,shouldFetchVendorsList:!0,shouldFetchFiling1099Vendor:!1}))},[j,C,h,p]),g.useEffect(()=>{b||D.fetchState!=="Completed"||(w(!0),P.trackVendorList(I.currentTab,I.previousTab??null,D.totalVendorCount,D.uiState.sortKey,D.uiState.ytdSpendSelection))},[D.fetchState]),m==null)throw Error("Can't access address page without signing in...");const[x,_]=g.useState(!1),T=A=>{_(A)};return l.jsxs(Qs,{windowSize:i,children:[l.jsx(ve,{isAppContentDrawerOpen:x,handleDrawerToggle:T}),l.jsx(Zs,{location:d,navigate:o,vendorsListDetails:D,tenantEmailDomain:u,vendorTabsToShow:e,onClickMenuIcon:()=>{T(!0)},previousTabPosition:a,setPreviousTabPosition:s,isAiCfoAccessEnabled:k,onAskAiCfoClick:E})]})}function Eo(){const{useFeatureGate:e}=ne(),a=q().state?.referrer,[s,t]=g.useState(!1),[n,o]=g.useState(0),c=R.getSignedInUser(),d=fn(c),{isFeatureEnabled:u}=e(z.isOpexByVendorFeatureEnabled),{isFeatureEnabled:i}=e(z.isVendorReviewFeatureEnabled),{isFeatureEnabled:m}=e(z.isScheduledJEPrepaidExpensesFeatureEnabled),{isFeatureEnabled:r}=e(z.isScheduledJEFixedAssetsFeatureEnabled),{isFeatureEnabled:p}=e(z.isScheduledJEAccruedExpensesFeatureEnabled),{isFeatureEnabled:h}=e(z.isFiling1099FeatureEnabled),f=S(w=>O(w)),C=f?.externalConnections?.accounting[0]?.connectionName,y=["vendors_tab"];C!=="netsuite"&&m===!0&&y.push("prepaid_expenses"),C!=="netsuite"&&r===!0&&y.push("fixed_assets"),C!=="netsuite"&&p===!0&&y.push("accrued_expenses"),C!=="netsuite"&&h&&d&&(y.push("filing_1099"),u&&y.splice(1,0,"operating_expenses_by_vendor"));const{isFeatureEnabled:I}=e(z.isDebitCardFeatureEnabled),D=gn(I,f),b=vn(f);return D===!0||b===!0?l.jsx(nt,{children:l.jsx(B,{path:"/*",element:l.jsx(Gn,{})})}):l.jsxs(nt,{children:[l.jsx(B,{path:"/opex",element:u===!0?l.jsx(Is,{previousTabPosition:n,setPreviousTabPosition:o,vendorTabsToShow:y}):l.jsx(K,{to:"../summary"})}),l.jsx(B,{path:"/summary",element:l.jsx(Xs,{previousTabPosition:n,setPreviousTabPosition:o,vendorTabsToShow:y})}),l.jsx(B,{path:"schedules/fixed_assets/details/:scheduleDetailId",element:r===!0?l.jsx(os,{}):l.jsx(K,{to:"../../vendors/opex"})}),l.jsx(B,{path:"schedules/accrued_expenses/details/:scheduleDetailId",element:r===!0?l.jsx(es,{shouldNavigateBack:s,setShouldNavigateBack:t}):l.jsx(K,{to:"../../vendors/opex"})}),l.jsx(B,{path:"schedules/:scheduleType/details/:scheduleDetailId",element:m===!0?l.jsx(us,{}):l.jsx(K,{to:"../../vendors/opex"})}),l.jsx(B,{path:"schedules/:scheduleType/details/:scheduleDetailId/edit_link",element:m===!0||r===!0?l.jsx(gs,{}):l.jsx(K,{to:"../../vendors/opex"})}),l.jsx(B,{path:"schedules/accrued_expenses/details/:scheduleDetailId/edit_link",element:p===!0?l.jsx(Wn,{setShouldNavigateBack:t}):l.jsx(K,{to:"../../vendors/opex"})}),l.jsx(B,{path:"schedules/prepaid_expenses",element:m===!0?l.jsx(ks,{previousTabPosition:n,setPreviousTabPosition:o,vendorTabsToShow:y}):l.jsx(K,{to:"../opex"})}),l.jsx(B,{path:"schedules/fixed_assets",element:r===!0?l.jsx(ys,{previousTabPosition:n,setPreviousTabPosition:o,vendorTabsToShow:y}):l.jsx(K,{to:"../opex"})}),l.jsx(B,{path:"schedules/accrued_expenses",element:p===!0?l.jsx(Ts,{previousTabPosition:n,setPreviousTabPosition:o,vendorTabsToShow:y}):l.jsx(K,{to:"../opex"})}),l.jsx(B,{path:"/filing_1099",element:h&&d?l.jsx(St,{previousTabPosition:n,setPreviousTabPosition:o,vendorTabsToShow:y}):l.jsx(K,{to:"../opex"})}),l.jsx(B,{path:"/filing_1099/:vendorId",element:h&&d?l.jsx(St,{vendorTabsToShow:y,previousTabPosition:n,setPreviousTabPosition:o}):l.jsx(K,{to:"../opex"})}),l.jsx(B,{path:"/filing_1099/upload/:vendorId/edit",element:h&&d?l.jsx(ht,{appContent:l.jsx(qs,{}),showFullScreenSkeletonWhileLoading:!0}):l.jsx(K,{to:"../opex"})}),l.jsx(B,{path:"/filing_1099/upload/:vendorId/edit/new/:addressType",element:h&&d?l.jsx(ht,{appContent:l.jsx(Mn,{isSubPage:!0,hideAddressBackButton:!0,hideAddressSubTitle:!0})}):l.jsx(K,{to:"../opex"})}),l.jsx(B,{path:"/summary/:vendorId/:qboId",element:l.jsx(pt,{referrerType:a,isFiling1099FeatureEnabled:h&&d})}),l.jsx(B,{path:"/summary/:vendorId/:qboId/:timeframe/:startDate/:endDate",element:l.jsx(pt,{referrerType:a,isFiling1099FeatureEnabled:h&&d})}),l.jsx(B,{path:"/review",element:i===!0?l.jsx(mt,{}):l.jsx(ie,{})}),l.jsx(B,{path:"/review/vendor/:vendorId",element:i?l.jsx(mt,{}):l.jsx(ie,{})}),l.jsx(B,{path:"/",element:l.jsx(K,{to:"summary"})}),l.jsx(B,{path:"*",element:l.jsx(ie,{})})]})}export{Eo as default};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import{j as o}from"./liveblocks-BjW28Jor.js";import{a as f}from"./sentry-Cxwj7RZa.js";import{q as u,h,g as y,N as b}from"./core-DM1rowt8.js";import{IE as I,eO as w,yZ as x}from"./zeni-epic-state-CsIRSm_7.js";import{z as l,s as j,y as S,E}from"./index-CS4Iv8Vc.js";import{n as g}from"./mui-D2eUyq0K.js";import"./recharts-Boi6IWgf.js";import"./analytics-ZBaPMYvi.js";import"./plaid-BjrBUBaH.js";import"./dnd-C-Lnhdag.js";import"./stripe-DMRn4zHo.js";import"./lottie-Lcmd6dcO.js";import"./lexical-C5McV7XP.js";import"./pdf-CnfUruOo.js";import"./utils-DnmDUA9M.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]="90be6621-b44a-4e0a-98cf-d7b268fa3d7a",e._sentryDebugIdIdentifier="sentry-dbid-90be6621-b44a-4e0a-98cf-d7b268fa3d7a")}catch{}})();const A=()=>{const[e]=u(),t=e.get("code")??"",s=e.get("state")??"",p=e.get("profileId")??"",[n,c]=f.useState(!1),a=h(),i=y(m=>I(m)),r=l.getSignedInUser(),d=l.getSignedInUserTenantWithId(s);if(r==null||d==null)return o.jsx(b,{to:"/signin/auth",replace:!0});if(r==null)throw Error("Can't access this page without signing in...");return w(r.userId,r.zeniSessionId,d?.tenantId),f.useEffect(()=>{n||(c(!0),a(x(t,p,s)))},[n,a]),i.fetchState==="Error"?o.jsx(D,{children:o.jsx(_,{children:i.error?.message??""})}):(i.fetchState==="Completed"&&window.close(),o.jsx(j,{fetchState:"In-Progress"}))},D=g.div`
|
|
2
|
+
display: flex;
|
|
3
|
+
width: 100%;
|
|
4
|
+
height: 100vh;
|
|
5
|
+
flex-direction: row;
|
|
6
|
+
justify-content: center;
|
|
7
|
+
align-items: center;
|
|
8
|
+
background-color: ${e=>e.theme.colors.grey5};
|
|
9
|
+
`,_=g(E.LargeRegular)`
|
|
10
|
+
display: flex;
|
|
11
|
+
color: ${S.important};
|
|
12
|
+
`;export{A as default};
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
import{j as n}from"./liveblocks-BjW28Jor.js";import{j as Z,u as W,h as z,l as H,g as w,k as Y,N as ne,n as $e,o as k}from"./core-DM1rowt8.js";import{eN as N,Nr as we,Ns as He,cj as te,ck as Ge,fb as Ze,wa as Ae,An as We,w4 as Fn,Nt as Rn,Nu as Ln,w7 as Un,we as Ce,w1 as zn,v_ as Nn,Me as ue,Nv as Mn,DH as _n,Jk as Vn,DJ as $n,k8 as Fe,Nw as Hn,pF as Ye,pt as Je,j$ as qe,k2 as Re,Jl as Le,Jm as Gn,Nx as Zn,k1 as Wn,ko as Yn,jS as Jn,ip as qn,io as Kn,Ny as Qn,Nz as xe,Do as Xn,NA as et,NB as nt,M7 as De,NC as Ue,ND as tt,DU as at,MR as ot,Bh as Ke,s6 as Qe,NE as st,DR as it,NF as Xe,cL as Ie,DY as en,fc as rt,eR as nn,eT as Se,DW as ct,Bb as lt,DO as dt,NG as tn,NH as an,Dq as on,DA as ze,NI as ut,Du as pt,NJ as mt,MG as ht,DZ as ft,bv as gt,bD as yt,cv as Ct,bE as xt,bs as kt,Il as wt}from"./zeni-epic-state-CsIRSm_7.js";import{A as ae,a as V,z as D,d as O,h as M,s as pe,bO as At,N as be,Z as _,x as J,p as sn,al as Dt,aa as Ne,e as R,bP as It,ao as ve,bQ as St,w as me,bR as bt,g as Ee,aI as G,bS as vt,H as Et,G as rn,a7 as jt,bT as Me,bU as Pt,q as ee,bV as Tt,bW as Ot,bX as Bt,bY as Ft,a4 as Rt,o as Lt}from"./index-CS4Iv8Vc.js";import{n as L,D as q,S as K}from"./mui-D2eUyq0K.js";import de from"./NotFoundScreen-DxfUGj1s.js";import{S as _e}from"./SetupPagesScreen-CPC76Yqt.js";import{F as cn}from"./FeaturePreviewScreen-BlTlevCF.js";import{a as u}from"./sentry-Cxwj7RZa.js";import{M as he}from"./MobileAppDrawer-BMQB-H-F.js";import{A as Ut,D as zt,V as Nt}from"./DomesticWireDetailScreen-DfsbCbMc.js";import{A as Mt}from"./AddressScreen-DHoJdSM2.js";import{u as ln}from"./useAskAiCfoHostNavButtonProps-DRpYvsoM.js";import{c as dn}from"./useFetchSuggestedQuestionsWhenReady-C6t_ljZW.js";import{Z as _t}from"./ZeniAccountStatementScreen-CRWM5OZx.js";import"./recharts-Boi6IWgf.js";import"./analytics-ZBaPMYvi.js";import"./plaid-BjrBUBaH.js";import"./dnd-C-Lnhdag.js";import"./stripe-DMRn4zHo.js";import"./lottie-Lcmd6dcO.js";import"./lexical-C5McV7XP.js";import"./pdf-CnfUruOo.js";import"./utils-DnmDUA9M.js";import"./analyticsHelper-C_jV_Bj8.js";import"./routePaths-ChKhxwsZ.js";import"./BusinessVerificationPageScreen-BgGPN2BY.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]="1f0a4e07-5c99-43f9-87a1-9a1b16174c60",e._sentryDebugIdIdentifier="sentry-dbid-1f0a4e07-5c99-43f9-87a1-9a1b16174c60")}catch{}})();const Vt=L.div`
|
|
2
|
+
display: flex;
|
|
3
|
+
min-height: 100%;
|
|
4
|
+
width: 100%;
|
|
5
|
+
flex: 1 1 auto;
|
|
6
|
+
flex-direction: column;
|
|
7
|
+
align-items: center;
|
|
8
|
+
background-color: ${e=>e.theme.colors.grey4};
|
|
9
|
+
`,$t=Y(function(e){return{autoTransferRuleView:we(e),downloadAccountDetailEndPoint:`${be}/account_details`,transferLimit:5e5,depositAccountListView:We(e.depositAccountState,e.depositAccountListState)}},function(e,t){const{navigate:s,handleDrawerToggle:o}=t;return{onBackClick:()=>{s("..")},onClickMenuIcon:()=>{o(!0)},onFetchAutoTransferRules:a=>{e(Ae(a))},onCreateRule:()=>{e(Nn())},onUpdateRule:a=>{e(Ce(a))},onDeleteClick:a=>{e(zn(a))},onPauseClick:a=>{e(Ce(a,!0,!1))},onResumeClick:a=>{e(Ce(a,!1,!0))},onActivityClick:(a,i)=>{e(Un(a,i))},onUpdateRuleLocalData:a=>{e(Ln(a))},clearRuleLocalData:()=>{e(Rn())},onEditClick:a=>{s(`./${a}/edit`)},onEditDrawerClose:()=>{s("../../",{relative:"path"})},onReviewClick:()=>{e(Fn())}}})(At);function Ve({isEditDrawerOpen:e}){const t=Z(),s=W(),o=z(),a=ae(),{ruleId:i,tenantEmailDomain:d}=H(),{useFeatureGate:c}=V(),[p,m]=u.useState(!1),[C,r]=u.useState(!1),l=w(y=>N(y)),h=w(y=>we(y)),x=h?.fetchState??"Not-Started",b=w(y=>He(y)),f=l?.companyId??D.getSignedInUserTenant(d)?.companyId,A=te(a?.loggedInUserRoleMap)||Ge(a?.loggedInUserRoleMap),{isFeatureEnabled:I}=c(O.isTreasuryEnabled),g=l?.company!=null&&Ze(l.company),S=I&&g,B=D.getSignedInUser(),U=l.tenantId,P={userId:B?.userId??"",sessionId:B?.zeniSessionId??"",tenantId:U??""},E=l.companyName;u.useEffect(()=>{!C&&x==="Not-Started"&&f&&(r(!0),o(Ae(!0)))},[C,x,f,o]);const v=y=>{m(y)},T=M(),j=!!s.state?.scrollToAddRule;return h?.fetchState!=="Completed"?n.jsx(pe,{fetchState:"In-Progress",style:{backgroundColor:T.colors.grey5}}):n.jsxs(Vt,{children:[n.jsx(he,{isAppContentDrawerOpen:p,handleDrawerToggle:v}),n.jsx($t,{navigate:t,location:s,currentTenant:l,companyName:E,handleDrawerToggle:v,isEditDrawerOpen:e,editingRuleId:i,authParams:P,includeTreasuryOption:S,hasAdminLevelAccess:A,zeniAccountsConfigDetail:b,scrollToAddRule:j})]})}const Ht={overlayWidth:new J(100,100,58)},Gt=({vendorId:e,isDrawerOpen:t,closeDrawerHandler:s})=>{const o=z(),a=M(),i=_();if(D.getSignedInUser()==null)throw Error("Can't access ach account page without signing in...");return n.jsx(q,{onClose:()=>{s(!0),o(ue())},anchor:"right",open:t,PaperProps:{style:{width:Ht.overlayWidth.valuePercentage(i),boxShadow:"none"}},slotProps:{backdrop:{style:{backgroundColor:a.colors.black,opacity:.75,cursor:"pointer"}}},children:n.jsx(Zt,{onClick:d=>d.stopPropagation(),children:n.jsx(Ut,{vendorIdParam:e,accountContext:"express-pay"})})})},Zt=L(K)`
|
|
10
|
+
display: flex;
|
|
11
|
+
min-height: 100%;
|
|
12
|
+
flex-direction: column;
|
|
13
|
+
`,Wt={overlayWidth:new J(100,100,58)},Yt=({isDrawerOpen:e,closeDrawerHandler:t})=>{const s=z(),o=M(),a=_();if(D.getSignedInUser()==null)throw Error("Can't access address page without signing in...");return n.jsx(q,{onClose:()=>{t(!0),s(ue())},anchor:"right",open:e,PaperProps:{style:{width:Wt.overlayWidth.valuePercentage(a),boxShadow:"none"}},slotProps:{backdrop:{style:{backgroundColor:o.colors.black,opacity:.75,cursor:"pointer"}}},children:n.jsx(Jt,{onClick:i=>i.stopPropagation(),children:n.jsx(Mt,{accountContext:"express-pay",addressTypeParam:"vendor_address"})})})},Jt=L(K)`
|
|
14
|
+
display: flex;
|
|
15
|
+
min-height: 100%;
|
|
16
|
+
flex-direction: column;
|
|
17
|
+
`,qt={overlayWidth:new J(100,100,58)},Kt=({vendorId:e,isDrawerOpen:t,closeDrawerHandler:s})=>{const o=z(),a=M(),i=_();if(D.getSignedInUser()==null)throw Error("Can't access ach account page without signing in...");return n.jsx(q,{onClose:()=>{s(!0),o(ue())},anchor:"right",open:t,PaperProps:{style:{width:qt.overlayWidth.valuePercentage(i),boxShadow:"none"}},slotProps:{backdrop:{style:{backgroundColor:a.colors.black,opacity:.75,cursor:"pointer"}}},children:n.jsx(Qt,{onClick:d=>d.stopPropagation(),children:n.jsx(zt,{vendorIdParam:e,accountContext:"express-pay"})})})},Qt=L(K)`
|
|
18
|
+
display: flex;
|
|
19
|
+
min-height: 100%;
|
|
20
|
+
flex-direction: column;
|
|
21
|
+
`,Xt=L.div`
|
|
22
|
+
display: flex;
|
|
23
|
+
height: 100vh;
|
|
24
|
+
width: 100%;
|
|
25
|
+
flex: 1 1 auto;
|
|
26
|
+
flex-direction: column;
|
|
27
|
+
align-items: center;
|
|
28
|
+
background-color: ${e=>e.theme.colors.grey4};
|
|
29
|
+
`,ea=Y(function(e,t){const s=N(e),o=D.getSignedInUser(),a=s.tenantId,i={userId:o?.userId??"",sessionId:o?.zeniSessionId??"",tenantId:a??""},d=t.expressPayDetails,c=e.entityAutoCompleteState.autoCompleteText.common,p=Vn(e,"common");return{expressPayDetails:d,fileProps:{authParams:i,filesEndPoint:`${ve.fileMicroServiceBaseUrl}`},vendorSearchAutoCompleteData:{autoCompleteText:c,entityAutoCompleteView:p},analytics:t.analytics}},function(e,t){const{navigate:s}=t;return{onSaveVendor:o=>{e(Kn(o,void 0,void 0,!0))},saveVendorDetailLocalData:(o,a)=>{e(Re({vendorId:a,localData:o}))},saveExpressPayLocalData:o=>{e(qn({localData:o}))},onVendorSelected:o=>{o!=null&&e(Jn(o,!1))},updateSelectedVendorForCreate:o=>{e(Yn(o))},initializeVendorAddress:()=>{e(Wn())},resetVendorSaveStatus:o=>{e(Zn({vendorId:o}))},vendorSearchAutoCompleteActions:{onAutoCompleteInputChange:(o,a)=>{o.trim().length>=2?e(Gn({searchString:o,entityType:a,searchOrigin:"common"})):o.trim().length===0&&e(Le("common"))},onCancelAutoComplete:()=>{e(Le("common"))}},chooseNewVendor:o=>{e(Re({localData:{vendorName:o}}))},onClickAddAccount:o=>{o.method.toLowerCase().indexOf("ach")!==-1?s("./add-ach",{relative:"path"}):o.method.toLowerCase().indexOf("wire")!==-1&&o.method.toLowerCase().indexOf("domestic")!==-1&&s("./add-wire",{relative:"path"})},updateFilesEntity:o=>{e(qe({files:o}))},onDeleteFile:o=>{e(Je(o))},onEditFileName:(o,a)=>{e(Ye(o,a.split(".")[0]))},onBackClick:o=>{o!=null&&e(Fe(o)),e(Fe()),e(Hn()),e(ue()),s("../",{relative:"path"})},onSchedulePayment:()=>{e($n())}}})(It);function ce({isAddACHDrawerOpen:e,isAddWireDrawerOpen:t,isAddAddressDrawerOpen:s}){const o=Z(),a=W(),i=z(),[d,c]=u.useState(!1),{tenantEmailDomain:p}=H(),m=ae(),C=w(y=>y.expressPayState.fetchState),r=w(y=>N(y)),l=w(y=>Mn(y)),h=l.expressPayLocalData?.vendorId,x=r.companyId??D.getSignedInUserTenant(p)?.companyId,[b,f]=u.useState(!1),[A,I]=u.useState(!1),[g,S]=u.useState(!1),B=sn(a.state?.pathnameStackToGoBack),{poppedPathname:U}=B,P=U?.split("/"),E=P?.[P.length-1];u.useEffect(()=>{e===!0?f(!0):(f(!1),document.body.style.overflow="auto")},[e]),u.useEffect(()=>{t===!0?I(!0):(I(!1),document.body.style.overflow="auto")},[t]),u.useEffect(()=>{s===!0?S(!0):(S(!1),document.body.style.overflow="auto")},[s]),u.useEffect(()=>{C==="Not-Started"&&i(_n(!0,!0))},[C,i]);const v=Dt(l.vendorViewDetails.bankAccountCreationState?.fetchState);if(u.useEffect(()=>{v==="In-Progress"&&l.vendorViewDetails.bankAccountCreationState?.fetchState==="Completed"&&j()},[v,l.vendorViewDetails.bankAccountCreationState?.fetchState]),D.getSignedInUser()==null)throw Error("Can't access express pay page without signing in...");const T=y=>{c(y)},j=()=>{f(!1),I(!1),o("../",{relative:"path"})};return n.jsxs(Xt,{children:[Ne(a)?n.jsx(he,{isAppContentDrawerOpen:d,handleDrawerToggle:T}):null,b===!0?n.jsx(Gt,{vendorId:h,closeDrawerHandler:j,isDrawerOpen:b}):null,A===!0?n.jsx(Kt,{vendorId:h,closeDrawerHandler:j,isDrawerOpen:A}):null,g===!0?n.jsx(Yt,{closeDrawerHandler:j,isDrawerOpen:g}):null,n.jsx(Nt,{vendorId:h,isExpressPayPage:!0}),n.jsx(ea,{navigate:o,location:a,companyId:x,accountId:E,analytics:R,currentTenant:r,vendorId:h,roleMap:m?.loggedInUserRoleMap,isSettings:Ne(a),expressPayDetails:l,onClickMenuIcon:()=>{T(!0)}})]})}const na={overlayWidth:new J(100,100,58)},ta=({authParams:e,downloadAccountDetailEndPoint:t,isAccountInfoDrawerOpen:s,zeniBankAccountDetail:o,closeDrawerHandler:a})=>{const i=M(),d=_(),c=w(r=>He(r)),p=w(r=>N(r));if(D.getSignedInUser()==null)throw Error("Can't access Account detail page without signing in...");const m=()=>{a(!0)},C={depositAccount:o,onDismissClick:m,zeniAccountsConfigDetail:c,authParams:e,downloadAccountDetailEndPoint:t,currentTenant:p};return n.jsx(q,{anchor:"right",open:s,PaperProps:{style:{width:na.overlayWidth.valuePercentage(d),boxShadow:"none"}},slotProps:{backdrop:{style:{backgroundColor:i.colors.black,opacity:.75,cursor:"pointer"}}},onClose:()=>m(),children:n.jsx(aa,{onClick:r=>r.stopPropagation(),children:n.jsx(St,{...C})})})},aa=L(K)`
|
|
30
|
+
display: flex;
|
|
31
|
+
min-height: 100%;
|
|
32
|
+
flex-direction: column;
|
|
33
|
+
`,oa={overlayWidth:new J(100,100,58)},un=({isCheckDepositDrawerOpen:e,closeDrawerHandler:t})=>{const s=M(),o=_(),a=z(),i=w(r=>N(r)),d=D.getSignedInUser(),c=i.tenantId,p={userId:d?.userId??"",sessionId:d?.zeniSessionId??"",tenantId:c??""};if(d==null)throw Error("Can't access check deposit page without signing in...");const m=w(r=>Qn(r)),C={analytics:R,checkDeposit:m,filesEndPoint:`${ve.fileMicroServiceBaseUrl}`,authParams:p,onSaveChangesToLocalStore:r=>{a(et(r))},updateFilesEntity:r=>{a(qe({files:r}))},onAnotherTransferClick:()=>{a(xe())},onDeleteFile:r=>{a(Je(r))},onEditFileName:(r,l)=>{a(Ye(r,l.split(".")[0]))},onCheckDpositClick:()=>{a(Xn())},onDismissClick:()=>{t(!0),a(xe())}};return n.jsxs(n.Fragment,{children:[n.jsx(me,{analytics:R,onLoad:r=>(l=>l.trackPageLoaded(Ee.Event.accountsDepositCheckFormViewed))(r)}),n.jsx(q,{anchor:"right",open:e,PaperProps:{style:{width:oa.overlayWidth.valuePercentage(o),boxShadow:"none",zIndex:8}},slotProps:{backdrop:{style:{backgroundColor:s.colors.black,opacity:.75,cursor:"pointer"}}},onClose:(r,l)=>(l==="backdropClick"||l==="escapeKeyDown")&&(t(!0),void a(xe())),children:n.jsx(sa,{onClick:r=>r.stopPropagation(),children:n.jsx(bt,{...C})})})]})},sa=L(K)`
|
|
34
|
+
display: flex;
|
|
35
|
+
min-height: 100%;
|
|
36
|
+
flex-direction: column;
|
|
37
|
+
`,ia={overlayWidth:new J(100,100,58)},ra=Y(function(e,t){const s=t.currentTenant?.companyId;return{plaidConnectionDetails:ot(e,s,"zeni_accounts","external_account").plaidConnectionDetails,depositAccountListView:We(e.depositAccountState,e.depositAccountListState)}},function(e,t){return{onReviewClick:()=>e(it()),clearReviewTransferDetail:()=>e(st()),onFetchLinkTokenClick:s=>{e(Qe("external_account",s))},onEstablishConnectionClick:s=>{e(Ke(s,t.currentTenant?.companyId,"external_account",void 0,"link_external_account"))}}})(vt),pn=({isTransferDrawerOpen:e,authParams:t,downloadAccountDetailEndPoint:s,closeDrawerHandler:o,zeniAccountsConfig:a})=>{const i=w(g=>nt(g)),d=w(g=>N(g)),c=M(),p=_(),m=z(),{accountId:C}=H(),[r,l]=u.useState("achTransfer"),[h,x]=u.useState(!1);if(D.getSignedInUser()==null)throw Error("Can't access invite people page without signing in...");const{useDynamicConfig:b}=V(),{configValue:f}=b(G.zeniAccountsConfig),A=De(f),I=()=>{o(!0),m(Ue())};return u.useEffect(()=>{i.reviewTransferDetail.fetchState==="Completed"&&x(!0)},[x,i.reviewTransferDetail.fetchState]),n.jsxs(n.Fragment,{children:[n.jsx(me,{analytics:R,onLoad:g=>(S=>S.trackPageLoaded(Ee.Event.zeniAccountsTransferFormViewed))(g)}),n.jsx(q,{onClose:()=>{(r==="achTransfer"&&h===!1||r==="achTransfer"&&h&&i.fetchState==="Completed")&&I()},anchor:"right",open:e,PaperProps:{style:{width:ia.overlayWidth.valuePercentage(p),boxShadow:"none"}},slotProps:{backdrop:{style:{backgroundColor:c.colors.black,opacity:.75,cursor:"pointer"}}},children:n.jsx(ca,{onClick:g=>g.stopPropagation(),children:n.jsx(ra,{analytics:R,transferDetails:i,authParams:t,downloadAccountDetailEndPoint:s,onTransferClick:()=>{R.trackTransferBetweenAccountsFormClicked("Transfer",i.reviewTransferDetail.reviewTransferMoney.isShowDailyAchLimitWarning?"Review Split Transfer":"Review Transfer",i.transferDetailLocalData.transferFrom?.label,i.transferDetailLocalData.transferTo?.label,i.transferDetailLocalData.amount.amount,i.reviewTransferDetail.reviewTransferMoney.isShowDailyAchLimitWarning,i.reviewTransferDetail.reviewTransferMoney.transferSchedules.length,i.transferDetailLocalData.transferFrom?.accType==="paymentAccount"&&i.transferDetailLocalData.transferTo?.accType==="depositAccount"&&a.zeniAccountsConfigDetail.depositProductConfig.depositProducts?.[0].range?.[1]!=null&&i.transferDetailLocalData.amount.amount>a.zeniAccountsConfigDetail.depositProductConfig.depositProducts[0].range[1]),m(at(C))},onDismissClick:I,onSaveChangesToLocalStore:g=>{m(tt(g))},onAnotherTransferClick:()=>{x(!1),m(Ue())},currentTenant:d,zeniAccountsConfigDetail:a,currentDrawerContent:r,setCurrentDrawerContent:l,showReviewContent:h,setShowReviewContent:x,onBackClick:()=>{},maxInsuredAmount:A.maxInsuredAmount})})})]})},ca=L(K)`
|
|
38
|
+
display: flex;
|
|
39
|
+
min-height: 100%;
|
|
40
|
+
flex-direction: column;
|
|
41
|
+
`,la=L.div`
|
|
42
|
+
display: flex;
|
|
43
|
+
min-height: 100%;
|
|
44
|
+
width: 100%;
|
|
45
|
+
flex: 1 1 auto;
|
|
46
|
+
flex-direction: column;
|
|
47
|
+
align-items: center;
|
|
48
|
+
background-color: ${e=>e.theme.colors.grey4};
|
|
49
|
+
`,da=Y(function(e,t){return{zeniAccountListView:Xe(e),isExpressPayEnabled:t.isExpressPayEnabled,analytics:t.analytics}},function(e,t){const{navigate:s,currentTenant:o,location:a,companyId:i,handleDrawerToggle:d,analytics:c,isBillPayEnabled:p,isDebitCardFeatureEnabled:m}=t,{tenantEmailDomain:C}=o;return{onZeniAccountClick:(r,l)=>{c.trackAccountsListPageClicked("Accounts Row Item Click",l,"active");const h=ua(C,r),x=ee(a.state?.pathnameStackToGoBack,a.pathname);s(h,{state:{pathnameStackToGoBack:x}})},onSettingsClick:()=>{c.trackAccountsListPageClicked("Settings Icon"),s("setup")},onReloadTransactions:()=>{e(en(!1))},handleMoveMoneyOptionSelection:(r,l)=>{let h="page-not-found";r==="sendMoney"&&(h=gn(C)),r==="payBill"?h=mn(o,p,m):r==="transfer"?(h=hn(C),l!=null&&e(tn(l))):r==="checkDeposit"&&(h=fn(C));const x=ee(a.state?.pathnameStackToGoBack,a.pathname);s(h,{state:{pathnameStackToGoBack:x}})},unlinkPaymentAccount:(r,l)=>{c.trackAccountsListPageClicked("Unlink Account",l),e(dt(r))},onFetchLinkTokenClick:(r,l)=>{e(Qe("external_account",r,l))},onUpdatePaymentAccountStatus:(r,l,h)=>{e(lt(r,l,"zeni_accounts","external_account",h))},onEstablishConnectionClick:r=>{e(Ke(r,i,"external_account",void 0,"link_external_account"))},onCreateCheckingClick:r=>{e(ct(r))},onClickMenuIcon:()=>{d(!0)},onTreasuryGetStartedClick:()=>{s("../../treasury/promo")},onAutoTransferClick:r=>{r?s("./auto-transfer",{state:{...a.state,scrollToAddRule:!0}}):s("./auto-transfer")}}})(Pt);function ke({isTransferDrawerOpen:e,isCheckDepositDrawerOpen:t}){const s=W(),o=Z(),a=z(),i=_(),{tenantEmailDomain:d}=H(),{useDynamicConfig:c,useFeatureGate:p}=V(),m=M(),{configValue:C}=c(G.zeniAccountsConfig),{isFeatureEnabled:r}=p(O.isTreasuryEnabled),{isFeatureEnabled:l}=p(O.isDebitCardFeatureEnabled),{isFeatureEnabled:h}=p(O.isAutoTransferRuleEnabled),{isFeatureEnabled:x}=p(O.isCheckingCommentingEnabled),b=De(C),f=w(F=>N(F)),A=f.companyId??D.getSignedInUserTenant(d)?.companyId,{configValue:I}=c(G.expressPayConfig),g=I.is_enable_all_tenants===!0||I.tenant_ids!=null&&I.tenant_ids.includes(f.tenantId),[S,B]=u.useState(!1),[U,P]=u.useState(!1),[E,v]=u.useState(!1),[T,j]=u.useState(!1),y=w(F=>Xe(F)),$=y.fetchState,oe=w(F=>we(F)),se=oe?.fetchState??"Not-Started",fe=!!f.companyZeniAccountInfo?.info?.isZeniAccountEnabled,ie=ae(),re=!!f.companyZeniAccountInfo?.info?.isZeniAccountTOSAccepted,Q=!!f.companyTreasuryInfo?.info?.isTreasuryTOSAccepted,X=te(ie?.loggedInUserRoleMap),yn=Ie(ie?.loggedInUserRoleMap),Cn=!!f.companyBillPayInfo?.info?.isBillPayEnabled,je=D.getSignedInUser(),xn={userId:je?.userId??"",sessionId:je?.zeniSessionId??"",tenantId:f.tenantId??""},kn=`${be}/account_details`,{areTenantIdsInSync:Pe}=Et();u.useEffect(()=>{!S&&Pe&&(B(!0),a(en(!1)))},[S,a,$,Pe]),u.useEffect(()=>{!U&&se==="Not-Started"&&A&&(P(!0),a(Ae(!0)))},[U,se,A,a]),u.useEffect(()=>{e!=null&&e===!0?v(!0):(v(!1),document.body.style.overflow="auto")},[e]),u.useEffect(()=>{j(t!=null&&t===!0)},[t]);const Te=()=>{v(!1),o("..")},[wn,An]=u.useState(!1),Oe=F=>{An(F)},{isAiCfoOpen:Dn,setIsAiCfoOpen:In}=rn(),{isAiCfoAccessEnabled:Sn,onAskAiCfoClick:bn}=ln({isAiCfoOpen:Dn,setIsAiCfoOpen:In,mobileExploreReferrer:"Checking Accounts"});dn({isDataReady:$==="Completed"});const vn=f.company!=null&&Ze(f.company),ge=(r&&vn)===!0&&!Q,[En,jn]=u.useState(!1),ye=w(F=>F.treasurySetupViewState.treasuryFundsDetails),Pn=ye.fundsDetails,Tn=jt(Pn);u.useEffect(()=>{ge!==!0||En||ye?.fetchStatus.fetchState!=="Not-Started"||(jn(!0),a(rt()))},[ye.fetchStatus,a]);const On=nn(f),Bn=Se(l,f);return On===!0&&Bn!==!0?n.jsx(cn,{}):fe?n.jsxs(n.Fragment,{children:[y.fetchState==="Completed"&&E===!1&&T===!1?n.jsx(me,{analytics:R,onLoad:F=>(Be=>{Be.trackAccountsListPageViewed(y.depositAccountsSelectorView.depositAccounts.length,y.externalAccountsSelectorView.paymentAccounts.length,Me(y.summary?.totalBalance.available.amount??0),Me(y.summary?.totalInterest.available.amount??0),y.zeniAccountsConfig.zeniAccountsConfigDetail.annualPercentageYield),ge&&Be.trackTreasuryPromoView("Checking Promo Banner")})(F)}):null,E===!0?n.jsx(pn,{closeDrawerHandler:Te,isTransferDrawerOpen:E,zeniAccountsConfig:y.zeniAccountsConfig,authParams:xn,downloadAccountDetailEndPoint:kn}):null,T===!0?n.jsx(un,{closeDrawerHandler:Te,isCheckDepositDrawerOpen:T}):null,n.jsxs(la,{windowSize:i,children:[n.jsx(he,{isAppContentDrawerOpen:wn,handleDrawerToggle:Oe}),n.jsx(da,{zeniBankListView:y,navigate:o,currentTenant:f,location:s,companyId:A,analytics:R,maxInsuredAmount:b.maxInsuredAmount,isExpressPayEnabled:g,isBillPayEnabled:Cn,isCheckingCommentingEnabled:x,isDebitCardFeatureEnabled:l,isAutoTransferRuleEnabled:h,handleDrawerToggle:Oe,showTreasuryPromo:ge,treasuryYieldPercentage:Tn,treasuryInsuredAmount:5e5,isAiCfoAccessEnabled:Sn,onAskAiCfoClick:bn})]})]}):re&&X?n.jsx(ne,{to:"../setup"}):f.companyZeniAccountInfo?.info&&!re&&yn?n.jsx(ne,{to:"../promo",state:s.state}):n.jsx(pe,{fetchState:"In-Progress",style:{backgroundColor:m.colors.grey5}})}const mn=(e,t,s)=>{const o=Se(s,e),{tenantEmailDomain:a}=e;return o===!0||t===!1?`/${a}/bills`:`/${a}/bill/new`},ua=(e,t)=>`/${e}/checking/${t}`,hn=(e,t)=>t==null?`/${e}/checking/transfer`:`/${e}/checking/${t}/transfer`,fn=(e,t)=>t==null?`/${e}/checking/check-deposit`:`/${e}/checking/${t}/check-deposit`,gn=e=>`/${e}/checking/express-pay`,pa=L.div`
|
|
50
|
+
display: flex;
|
|
51
|
+
width: 100%;
|
|
52
|
+
flex: 1 1 auto;
|
|
53
|
+
flex-direction: column;
|
|
54
|
+
align-items: center;
|
|
55
|
+
min-height: 100vh;
|
|
56
|
+
background-color: ${e=>e.theme.colors.grey4};
|
|
57
|
+
`,ma=Y(function(e,t){const{currentTenant:s}=t,o=an(e,t.accountId),a=D.getSignedInUser(),i=e.tenantState.currentTenantId,d={userId:a?.userId??"",sessionId:a?.zeniSessionId??"",tenantId:i??""},c=o.accountDetail?.id??"";return{currentTenantCompanyName:s.companyName??"",authParams:d,downloadEndPoint:`${ve.bankingMicroServiceBaseUrl}/1.0/deposit-accounts/${c}`,zeniAccountDetail:o,isExpressPayEnabled:t.isExpressPayEnabled,fetchState:o.fetchState}},function(e,t){const{navigate:s,currentTenant:o,location:a,accountId:i}=t,{tenantEmailDomain:d}=o;return{handleMoveMoneyOptionSelection:(c,p)=>{let m="page-not-found";c==="sendMoney"?m=gn(d):c==="payBill"?m=mn(o,t.isBillPayEnabled,t.isDebitCardFeatureEnabled):c==="transfer"?(m=hn(d,i),p!=null&&e(tn(p))):c==="checkDeposit"?(m=fn(d,i),p!=null&&e(ut(p))):c==="accountStatement"&&(m=ga(d,i));const C=ee(a.state?.pathnameStackToGoBack,a.pathname);s(m,{state:{pathnameStackToGoBack:C}})},onViewAllTransactionClick:()=>{const c=fa(d,i),p=ee(a.state?.pathnameStackToGoBack,a.pathname);s(c,{state:{pathnameStackToGoBack:p}})},onAccountDetailClick:()=>{const c=ha(d,i),p=ee(a.state?.pathnameStackToGoBack,a.pathname);s(c,{state:{pathnameStackToGoBack:p}})},onEditNameClick:c=>{e(ze(i,"editName",c))},onReloadZeniAccountDetailPage:()=>{e(on(i,!1))},onCloseAccountClick:()=>{e(ze(i,"closeAccount",""))},onBackClick:()=>{s("../",{relative:"path"})}}})(Tt);function le({isTransferDrawerOpen:e,isCheckDepositDrawerOpen:t,isAccountInfoDrawerOpen:s}){const o=W(),a=Z(),i=z(),d=_(),{tenantEmailDomain:c,accountId:p}=H(),{useDynamicConfig:m}=V(),{useFeatureGate:C}=V(),{isFeatureEnabled:r}=C(O.isDebitCardFeatureEnabled),{isFeatureEnabled:l}=C(O.isCheckingCommentingEnabled),h=w(X=>N(X)),{configValue:x}=m(G.expressPayConfig),b=x.is_enable_all_tenants===!0||x.tenant_ids!=null&&x.tenant_ids.includes(h.tenantId),f=!!h.companyBillPayInfo?.info?.isBillPayEnabled,A=D.getSignedInUser(),I=h.companyId??D.getSignedInUserTenant(c)?.companyId,g={userId:A?.userId??"",sessionId:A?.zeniSessionId??"",tenantId:h.tenantId??""},S=`${be}/account_details`,[B,U]=u.useState(!1),[P,E]=u.useState(!1),[v,T]=u.useState(!1),[j,y]=u.useState(!1),$=w(X=>an(X,p??"")),oe=$.fetchState,{isAiCfoOpen:se,setIsAiCfoOpen:fe}=rn(),{isAiCfoAccessEnabled:ie,onAskAiCfoClick:re}=ln({isAiCfoOpen:se,setIsAiCfoOpen:fe,mobileExploreReferrer:"Checking Account Detail"});dn({isDataReady:oe==="Completed"}),u.useEffect(()=>{B||(i(on(p??"",!1)),U(!0))},[B,i,oe]),u.useEffect(()=>{y(s!=null&&s===!0)},[s]),u.useEffect(()=>{e!=null&&e===!0?E(!0):(E(!1),document.body.style.overflow="auto")},[e]),u.useEffect(()=>{T(t!=null&&t===!0)},[t]);const Q=()=>{y(!1),a("..")};return n.jsxs(n.Fragment,{children:[j===!0&&$.accountDetail!=null?n.jsx(ta,{authParams:g,downloadAccountDetailEndPoint:S,closeDrawerHandler:Q,isAccountInfoDrawerOpen:j,zeniBankAccountDetail:$.accountDetail}):null,P===!0?n.jsx(pn,{closeDrawerHandler:Q,isTransferDrawerOpen:P,zeniAccountsConfig:$.zeniAccountsConfig,authParams:g,downloadAccountDetailEndPoint:S}):null,v===!0?n.jsx(un,{closeDrawerHandler:Q,isCheckDepositDrawerOpen:v}):null,n.jsx(pa,{windowSize:d,children:n.jsx(ma,{navigate:a,currentTenant:h,location:o,companyId:I,isDebitCardFeatureEnabled:r,accountId:p??"",isBillPayEnabled:f,isCheckingCommentingEnabled:l,isExpressPayEnabled:b,isAiCfoAccessEnabled:ie,onAskAiCfoClick:re})})]})}const ha=(e,t)=>`/${e}/checking/${t}/account-info`,fa=(e,t)=>`/${e}/checking/${t}/transactions`,ga=(e,t)=>`/${e}/checking/${t}/statements`,ya=L.div`
|
|
58
|
+
display: flex;
|
|
59
|
+
height: 100vh;
|
|
60
|
+
width: 100%;
|
|
61
|
+
flex: 1 1 auto;
|
|
62
|
+
flex-direction: column;
|
|
63
|
+
overflow: auto;
|
|
64
|
+
align-items: center;
|
|
65
|
+
background-color: ${e=>e.theme.colors.grey4};
|
|
66
|
+
`;function Ca(){const e=Z(),t=z(),s=_(),{accountId:o}=H(),{useFeatureGate:a}=V(),{isFeatureEnabled:i}=a(O.isCheckingCommentingEnabled),[d,c]=u.useState(!1);u.useEffect(()=>{d||(c(!0),t(pt(o??"",!1)))},[d,t]);const p=w(m=>mt(m,o??""));if(D.getSignedInUser()==null)throw Error("Can't access address page without signing in...");return n.jsx(ya,{windowSize:s,children:n.jsx(Ot,{transactionListView:p,depositAccountId:o??"",isCheckingCommentingEnabled:i,onBackClick:()=>{e("../")}})})}const xa=Y(function(e,t){const{companyId:s}=t;return{zeniAccountSetupView:ht(e,s),meetingUrl:"https://meetings.hubspot.com/niharn/demo-accounts?embed=true"}},function(e,t){const{navigate:s,companyId:o}=t;return{onSetupButtonClick:()=>{R.trackAccountsPromoPageClicked("Setup Accounts"),e(ft(o))},onBackClick:()=>{s("../..",{relative:"path"})},onSetupZeniAccountSuccess:()=>{s("../setup",{relative:"path"})}}})(Ft),ka=()=>{const e=Z(),t=W(),{tenantEmailDomain:s}=H(),{useDynamicConfig:o}=V(),a=M(),[i,d]=u.useState(!1),[c,p]=u.useState(!1),m=w(g=>N(g)),{configValue:C}=o(G.zeniAccountsConfig),r=De(C);u.useEffect(()=>{c===!1&&t.state?.message==="activation"&&p(!0)},[t.state]);const l=D.getSignedInUserTenant(s)?.companyId??m.companyId,h=D.getSignedInUser(),x=!!m.companyZeniAccountInfo?.info?.isZeniAccountTOSAccepted,b=g=>{d(g)};if(h==null)throw Error("Can't access Zeni account promo page without signing in...");const f=ae(),A=te(f?.loggedInUserRoleMap),I=Ie(f?.loggedInUserRoleMap);if(x&&A)return n.jsx(ne,{to:"../../checking/setup"});if(m.company?.companyZeniAccountInfo&&(!x&&A||I)){if(t.state?.message==="activation"){const g=sn(t.state?.pathnameStackToGoBack);e(t.pathname,{state:{...t.state,message:void 0,pathnameStackToGoBack:g.newStack}})}return n.jsxs(n.Fragment,{children:[n.jsx(Bt,{showConfetti:c}),n.jsx(me,{analytics:R,onLoad:g=>(S=>S.trackPageLoaded(Ee.Event.accountsPromoPageViewed))(g)}),n.jsx(he,{isAppContentDrawerOpen:i,handleDrawerToggle:b}),n.jsx(xa,{analytics:R,navigate:e,companyId:l,onClickMenuIcon:()=>{b(!0)},maxAnnualPercentageYield:r.maxAnnualPercentageYield,maxInsuredAmount:r.maxInsuredAmount,exampleBankBalance:3e6})]})}return n.jsx(pe,{fetchState:"In-Progress",style:{backgroundColor:a.colors.grey5}})};function Ja(){const e=W(),t=w(j=>N(j)),s=M(),{useFeatureGate:o,useDynamicConfig:a}=V(),i=ae(),d=te(i?.loggedInUserRoleMap),c=Ie(i?.loggedInUserRoleMap),p=!!t.company?.companyZeniAccountInfo.isZeniAccountEnabled,m=!!t.company?.companyZeniAccountInfo.isZeniAccountTOSAccepted,{isFeatureEnabled:C}=o(O.isChargeCardFeatureEnabled),{isFeatureEnabled:r}=o(O.isDebitCardFeatureEnabled),l=nn(t),h=Se(r,t),x=t?.userRole!=null&>(t?.userRole),b=(t?.company==null||t.company.featuresActivationInfo?.isBillPayFeatureEnabled&&!x)&&yt(i?.loggedInUserRoleMap),f=Ct(i?.loggedInUserRoleMap),A=(t?.company==null||t.company.featuresActivationInfo?.isReimbursementFeatureEnabled&&!x)&&xt(i?.loggedInUserRoleMap),{isFeatureEnabled:I}=o(O.isDepositAccountsFeatureEnabled),g=I&&!x,{configValue:S}=a(G.expressPayConfig),B=S.is_enable_all_tenants===!0||S.tenant_ids!=null&&S.tenant_ids.includes(t.tenantId),{isFeatureEnabled:U}=o(O.isAutoTransferRuleEnabled),P=Rt(t,C,r)&&!x&&kt(i?.loggedInUserRoleMap),E=wt(i?.loggedInUserRoleMap),v=g&&te(i?.loggedInUserRoleMap),T=v||Ge(i?.loggedInUserRoleMap);return n.jsxs($e,{children:[n.jsx(k,{path:"setup",element:n.jsx(_e,{isBillPayAdminLevelAccess:b,isUserHasOnlyBillPayAccess:f,isReimbursementAdminLevelAccess:A,isZeniAccountAdminLevelAccess:v,isChargeCardAdminLevelAccess:P,isUserHasOnlyCardAccess:E,productType:"zeni_accounts",type:"setup"})}),n.jsx(k,{path:"verification",element:n.jsx(_e,{isBillPayAdminLevelAccess:b,isUserHasOnlyBillPayAccess:f,isReimbursementAdminLevelAccess:A,isZeniAccountAdminLevelAccess:v,isChargeCardAdminLevelAccess:P,isUserHasOnlyCardAccess:E,productType:"zeni_accounts",type:"verification"})}),U?n.jsxs(n.Fragment,{children:[n.jsx(k,{path:"auto-transfer",element:n.jsx(Ve,{})}),T?n.jsx(k,{path:"auto-transfer/:ruleId/edit",element:n.jsx(Ve,{isEditDrawerOpen:!0})}):null]}):n.jsx(k,{path:"auto-transfer",element:n.jsx(de,{})}),B&&d?n.jsxs(n.Fragment,{children:[n.jsx(k,{path:"express-pay",element:n.jsx(ce,{})}),n.jsx(k,{path:"express-pay/add-ach",element:n.jsx(ce,{isAddACHDrawerOpen:!0})}),n.jsx(k,{path:"express-pay/add-wire/add-address",element:n.jsx(ce,{isAddAddressDrawerOpen:!0})}),n.jsx(k,{path:"express-pay/add-wire",element:n.jsx(ce,{isAddWireDrawerOpen:!0})})]}):n.jsx(k,{path:"express-pay",element:n.jsx(de,{})}),n.jsx(k,{path:"promo",element:n.jsx(ka,{})}),l&&!h?n.jsx(k,{path:"/*",element:n.jsx(cn,{})}):p?n.jsxs(n.Fragment,{children:[n.jsx(k,{path:"/",element:n.jsx(ke,{})}),n.jsx(k,{path:"transfer",element:n.jsx(ke,{isTransferDrawerOpen:!0})}),n.jsx(k,{path:"check-deposit",element:n.jsx(ke,{isCheckDepositDrawerOpen:!0})}),n.jsx(k,{path:":accountId/*",element:n.jsx(wa,{})}),n.jsx(k,{path:"*",element:n.jsx(de,{})})]}):m&&d?n.jsx(k,{path:"*",element:n.jsx(ne,{to:"../setup"})}):t.company?.companyZeniAccountInfo&&c?n.jsx(k,{path:"*",element:n.jsx(ne,{to:"../promo",state:e.state})}):n.jsx(k,{path:"*",element:n.jsx(pe,{fetchState:"In-Progress",style:{backgroundColor:s.colors.grey5,boxShadow:`0px 2px ${Lt.sp1} ${s.colors.dropShadowNormal}`}})})]})}function wa(){return n.jsxs($e,{children:[n.jsx(k,{path:"/",element:n.jsx(le,{})}),n.jsx(k,{path:"account-info",element:n.jsx(le,{isAccountInfoDrawerOpen:!0})}),n.jsx(k,{path:"transfer",element:n.jsx(le,{isTransferDrawerOpen:!0})}),n.jsx(k,{path:"check-deposit",element:n.jsx(le,{isCheckDepositDrawerOpen:!0})}),n.jsx(k,{path:"transactions",element:n.jsx(Ca,{})}),n.jsx(k,{path:"statements",element:n.jsx(_t,{})}),n.jsx(k,{path:"*",element:n.jsx(de,{})})]})}export{Ja as default};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import{j as i}from"./liveblocks-BjW28Jor.js";import{a as u}from"./sentry-Cxwj7RZa.js";import{j as x,h as N,u as $,l as j,g as p}from"./core-DM1rowt8.js";import{HE as s,HD as v,NK as B,eN as C,NL as D}from"./zeni-epic-state-CsIRSm_7.js";import{Z as E,ao as b,h as L,z as T,s as z,bZ as P,p as U}from"./index-CS4Iv8Vc.js";import{n as _}from"./mui-D2eUyq0K.js";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},n=new e.Error().stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="d7131b64-8c21-4bb4-91d9-ffe0db11755b",e._sentryDebugIdIdentifier="sentry-dbid-d7131b64-8c21-4bb4-91d9-ffe0db11755b")}catch{}})();const Z=_.div`
|
|
2
|
+
display: flex;
|
|
3
|
+
height: 100vh;
|
|
4
|
+
width: 100%;
|
|
5
|
+
flex: 1 1 auto;
|
|
6
|
+
flex-direction: column;
|
|
7
|
+
align-items: center;
|
|
8
|
+
background-color: ${e=>e.theme.colors.grey4};
|
|
9
|
+
`;function q(){const e=x(),n=N(),d=E(),l=$();let{accountId:a}=j(),f=`${b.bankingMicroServiceBaseUrl}/1.0/deposit-accounts/${a}`;a==null&&l.pathname.includes(`${s}/statements`)&&(a=s,f=`${b.bankingMicroServiceBaseUrl}/1.0/${s}`);const[m,g]=u.useState(!1),h=L();u.useEffect(()=>{m||(g(!0),n(v(a??"",!1)))},[m,n]);const o=p(t=>B(t,a??"")),y=()=>{const t=U(l.state?.pathnameStackToGoBack),S=t.poppedPathname??"..";e(S,{state:{pathnameStackToGoBack:t.newStack}})},r=T.getSignedInUser(),c=p(t=>C(t)),I={userId:r?.userId??"",sessionId:r?.zeniSessionId??"",tenantId:c.tenantId??""},w=D(a??"")===!0?s:o.zeniAccountDetail?.accountLast4??"",k=c.company?.companyInfo.companyLegalName??c.companyName;if(r==null)throw Error("Can't access address page without signing in...");return o.fetchState!=="Completed"?i.jsx(z,{fetchState:"In-Progress",style:{backgroundColor:h.colors.grey5}}):i.jsx(Z,{windowSize:d,children:i.jsx(P,{currentTenantCompanyName:k,statementListView:o,accountLast4:w,onBackClick:y,authParams:I,downloadEndPoint:f})})}export{q as Z};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import"./sentry-Cxwj7RZa.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]="aeade864-8999-4b65-a5fe-284d93c9cae4",e._sentryDebugIdIdentifier="sentry-dbid-aeade864-8999-4b65-a5fe-284d93c9cae4")}catch{}})();function d(e,t){if(t!=null)return e.find(n=>n.qboId===t)}function i(e,t){return e.filter(n=>n.qboId!=null&&t.includes(n.qboId))}function a(e,t){return t.map(n=>({accountId:d(e,n.accountId.selectedOption)?.accountId??"",expenseType:n.expenseType.selectedOption??"",type1099:n.type1099.selectedOption??"",boxType:n.boxType.selectedOption??""}))}export{d as a,i as g,a as m};
|