@zeniai/web-app-ui 5.3.71-qa → 5.3.72-dev
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/assets/{AccountMappingScreen-Da8kjow8.js → AccountMappingScreen-Dv_mcE-s.js} +2 -2
- package/dist/assets/{ActualMatchingMatchDetailScreen-RoPWu4_o.js → ActualMatchingMatchDetailScreen-DQhBSzc_.js} +1 -1
- package/dist/assets/AddressRoutes-CY6bt6oR.js +1 -0
- package/dist/assets/{AddressScreen-CPpf4Cpj.js → AddressScreen-DAE2XqXc.js} +2 -2
- package/dist/assets/AiCfoScreen-BPlLSgy4.js +22 -0
- package/dist/assets/{AppDrawer-BxZ3HI7E.js → AppDrawer-B_kTdlDU.js} +2 -2
- package/dist/assets/{BillPayApprovalRoutes-c7b3I5yJ.js → BillPayApprovalRoutes-txmAkDB9.js} +1 -1
- package/dist/assets/{BillPayRoutes-BDhRNd6v.js → BillPayRoutes-CWUxKmBT.js} +18 -18
- package/dist/assets/BusinessVerificationPageScreen-BvUcXpAj.js +9 -0
- package/dist/assets/CardsAiCfoScreen-nNC3ePcB.js +14 -0
- package/dist/assets/{ChargeCardRoutes-CWxqs0Z9.js → ChargeCardRoutes-Bbt0_9Bb.js} +6 -6
- package/dist/assets/{CompanyPassportScreen-CIym85mw.js → CompanyPassportScreen-rWKenTzd.js} +1 -1
- package/dist/assets/ConnectionAuthScreen-CztazncJ.js +11 -0
- package/dist/assets/CustomerOnboardingAuthScreen-yZ66vYtS.js +1 -0
- package/dist/assets/CustomerOnboardingRoutes-D8GPJqi3.js +30 -0
- package/dist/assets/{DashboardRoutes-Bq7IQcLO.js → DashboardRoutes-B_JSZLqZ.js} +3 -3
- package/dist/assets/{DefaultTenantHome-Bpge3yFF.js → DefaultTenantHome-IBmbS2vi.js} +1 -1
- package/dist/assets/{DomesticWireDetailScreen-ZaeUg4I5.js → DomesticWireDetailScreen-DdWDhL04.js} +4 -4
- package/dist/assets/{DrawerScreen-bhsbfXgO.js → DrawerScreen-I1OXPpov.js} +1 -1
- package/dist/assets/EntityDetailRoutes-DxNEAh7j.js +1 -0
- package/dist/assets/{ExpenseAutomationRoutes-Dab9nQ3b.js → ExpenseAutomationRoutes-BJiDP5Wv.js} +6 -6
- package/dist/assets/FeaturePreviewScreen-BbHZWhrI.js +1 -0
- package/dist/assets/HubSpotOAuthCallbackScreen-CEvleGfK.js +1 -0
- package/dist/assets/{InboxNotificationsProvider-Vlyx5Pej.js → InboxNotificationsProvider-CH-l5W7V.js} +1 -1
- package/dist/assets/InvoicingRoutes-CaFgkG0d.js +2 -0
- package/dist/assets/{MagicLinkRoutes-DonztJNa.js → MagicLinkRoutes-DEWQ6tjb.js} +20 -20
- package/dist/assets/MagicLinkSignInScreen-D7kTTahR.js +12 -0
- package/dist/assets/MobileAppDrawer-8BZVS4o3.js +1 -0
- package/dist/assets/NotFoundScreen-DnqoRCYC.js +1 -0
- package/dist/assets/NotificationRoutes-B6eJv18K.js +1 -0
- package/dist/assets/OAuthConsentScreen-9x_SIQZM.js +1 -0
- package/dist/assets/PandLWithForecastRoutes-2XL-q-Jt.js +1 -0
- package/dist/assets/{PaymentLinkScreen-43J_ZGED.js → PaymentLinkScreen-C1S1ghTR.js} +5 -5
- package/dist/assets/PeopleRoutes-DVpXinz3.js +22 -0
- package/dist/assets/PerformanceRoutes-BRj-_-uP.js +1 -0
- package/dist/assets/{Preview-DqlOJJpJ.js → Preview-Ch5xsyMl.js} +1 -1
- package/dist/assets/{QBOConnectionScreen-Czz6muQW.js → QBOConnectionScreen-Dnjt4r9I.js} +1 -1
- package/dist/assets/ReimbursementApprovalRoutes-CzHkAZyB.js +1 -0
- package/dist/assets/{ReimbursementApprovalRuleDetailScreen-DN9la9Dm.js → ReimbursementApprovalRuleDetailScreen-DulfuoGj.js} +1 -1
- package/dist/assets/{ReimbursementRoutes-BGNOeI_H.js → ReimbursementRoutes-BE0aOAON.js} +7 -7
- package/dist/assets/{ReportsRoutes-D-cpB-sX.js → ReportsRoutes-NzIYaPVq.js} +1 -1
- package/dist/assets/RewardsRoutes-CwZUzIe1.js +1 -0
- package/dist/assets/{ScheduleDetailsPrepaidExpensesScreen-CNF1ceQn.js → ScheduleDetailsPrepaidExpensesScreen-JrbhJns8.js} +5 -5
- package/dist/assets/ScreenRoutes-DwyFQCfk.js +2 -0
- package/dist/assets/{SettingsRoutes-D_LLhbJv.js → SettingsRoutes-C1rh1f5s.js} +6 -6
- package/dist/assets/SetupPagesScreen-Cl5BAT-o.js +29 -0
- package/dist/assets/SignInScreen-_U7Bj35k.js +1 -0
- package/dist/assets/SignOutScreen-BgEdGGQF.js +9 -0
- package/dist/assets/TaskListScreen-CvKGMIZk.js +9 -0
- package/dist/assets/TaskRoutes-CEJdgyOG.js +9 -0
- package/dist/assets/TransactionDetailRoutes-S-naEoj9.js +1 -0
- package/dist/assets/{TransactionDetailScreen-CWo5MdmD.js → TransactionDetailScreen-CNGUSd_b.js} +2 -2
- package/dist/assets/TransactionListRoutes-ChCViJl9.js +1 -0
- package/dist/assets/{TreasuryRoutes-B1C-ovJX.js → TreasuryRoutes-xGBsDsbG.js} +3 -3
- package/dist/assets/{VendorsRoutes-DoSPbM9C.js → VendorsRoutes-CxbN9ffS.js} +13 -13
- package/dist/assets/WiseConfirmationScreen--1X8GtN8.js +12 -0
- package/dist/assets/ZeniAccountRoutes-DKMn9Mvs.js +57 -0
- package/dist/assets/{ZeniAccountStatementScreen-kiOSzYpp.js → ZeniAccountStatementScreen-CY8Yij9t.js} +2 -2
- package/dist/assets/{accountMappingHelper-CeXF1Q4Q.js → accountMappingHelper-CnG-eRj3.js} +1 -1
- package/dist/assets/{analytics-DI5uqxwC.js → analytics-DlzSqyvZ.js} +1 -1
- package/dist/assets/{analyticsHelper-Df3DOmUB.js → analyticsHelper-Cq1viJip.js} +1 -1
- package/dist/assets/{core-_cqItzd_.js → core-D07hD3KT.js} +1 -1
- package/dist/assets/{decodeURIComponentSafe-CzbN3zRu.js → decodeURIComponentSafe-D3MFRtCF.js} +1 -1
- package/dist/assets/{dnd-BzHSvmGV.js → dnd-B-KpYfWT.js} +1 -1
- package/dist/assets/{empty-CTsBwHYQ.js → empty-DRbThjIF.js} +1 -1
- package/dist/assets/{empty-IeCSs-Vp.js → empty-aXh7noZx.js} +1 -1
- package/dist/assets/{emptyVideoElement-BDIFj1OP.js → emptyVideoElement-BZocj0UF.js} +1 -1
- package/dist/assets/epic-Du2AdUHP.js +2 -0
- package/dist/assets/expenseAutomationHelper-CL7YOVzM.js +1 -0
- package/dist/assets/{getLocaleForTenant-DNtLZSig.js → getLocaleForTenant-4ThGApJK.js} +1 -1
- package/dist/assets/{index-_QekaZI8.js → index-54OCX1PW.js} +1 -1
- package/dist/assets/{index-DVhAab8j.js → index-B1xlAtau.js} +16884 -16790
- package/dist/assets/{index-CFtxbACp.js → index-BIOOl02m.js} +1 -1
- package/dist/assets/{index-z7nFmc82.js → index-BVdX_ubi.js} +2 -2
- package/dist/assets/{index-LjABwt4q.js → index-BxmwktwS.js} +1 -1
- package/dist/assets/{index-B_Z1rAKT.js → index-D5s14gxd.js} +1 -1
- package/dist/assets/{index-CMOD4X8_.js → index-YyHAbx34.js} +1 -1
- package/dist/assets/{index-aNhAY0yh.js → index-z9Fh-4S1.js} +1 -1
- package/dist/assets/{lexical-CXRKir6z.js → lexical-NIxvAmS2.js} +1 -1
- package/dist/assets/{liveblocks-gNIoHksP.js → liveblocks-CQOAuUNI.js} +1 -1
- package/dist/assets/{lottie-CjJcvZ3r.js → lottie-BIKpYE12.js} +1 -1
- package/dist/assets/{mui-CDH3xRD_.js → mui-XiTT8YBC.js} +1 -1
- package/dist/assets/{pathToGoBack-DqZRBX-C.js → pathToGoBack-RICxbZCJ.js} +1 -1
- package/dist/assets/{pdf-BZVEJwNE.js → pdf-Dli3mGO_.js} +3 -3
- package/dist/assets/{pdf-lib-DnzapqoA.js → pdf-lib-D9XJLVoD.js} +1 -1
- package/dist/assets/{plaid-Dvn5Z296.js → plaid-BG3pJamN.js} +1 -1
- package/dist/assets/{pusher-CcIFKuUn.js → pusher-D9DkHuMx.js} +1 -1
- package/dist/assets/{react-CPb70X99.js → react-BLzCbojr.js} +1 -1
- package/dist/assets/{react-AHfmXvhq.js → react-C-5ZNsBH.js} +1 -1
- package/dist/assets/{react-DClAw2ak.js → react-C1d1ocIu.js} +1 -1
- package/dist/assets/{react-t3XyoKqw.js → react-CrrxpEIc.js} +1 -1
- package/dist/assets/{react-DAXlQZC6.js → react-D2I9LF0A.js} +1 -1
- package/dist/assets/{react-CuiiYztJ.js → react-DkT18Fv5.js} +1 -1
- package/dist/assets/{recharts-BgEcqT8y.js → recharts-CgYqsGTH.js} +1 -1
- package/dist/assets/{routePaths-DM8AEJT0.js → routePaths-Byv4I0Ax.js} +1 -1
- package/dist/assets/{sentry-BzzHvh63.js → sentry-pp_6zWNc.js} +1 -1
- package/dist/assets/{stripSplatSuffix-D8FyJbXM.js → stripSplatSuffix-DA-gXJ77.js} +1 -1
- package/dist/assets/{url-BuE-ZvDR.js → url-TK5h7pVR.js} +1 -1
- package/dist/assets/{url-0BMhJWUX.js → url-yI9BET_f.js} +1 -1
- package/dist/assets/useActualMatchingMatchDetail-DTg70T-B.js +1 -0
- package/dist/assets/{useAiCfoDashboardSuggestedQuestionsChips-C6pX9M29.js → useAiCfoDashboardSuggestedQuestionsChips-BtQMXCJn.js} +1 -1
- package/dist/assets/useAskAiCfoHostNavButtonProps-gzIjh_Rc.js +1 -0
- package/dist/assets/{useChargeCardPusherEvents-pc-PEvCr.js → useChargeCardPusherEvents-BYYn6vOu.js} +1 -1
- package/dist/assets/{useDeviceId-DYE-WS_B.js → useDeviceId-DCPRNX-s.js} +1 -1
- package/dist/assets/useEmailConnectResultRefresh-C_tEfW8U.js +1 -0
- package/dist/assets/{useInitialThreadRequest-CSR_bJDf.js → useInitialThreadRequest-Cuwjfmqu.js} +1 -1
- package/dist/assets/useTaskManagerAccess-Y5qsn5_D.js +1 -0
- package/dist/assets/{useTaskManagerPusherEvents-C0fOaGqk.js → useTaskManagerPusherEvents-CgwVJFYR.js} +1 -1
- package/dist/assets/{utils-DZX8_JTm.js → utils-CrOdvv6w.js} +1 -1
- package/dist/assets/{withTransactionSidePanel-BKXId2BT.js → withTransactionSidePanel-BqueNlFJ.js} +4 -4
- package/dist/assets/{zeni-epic-state-ClqSlu6d.js → zeni-epic-state-B3TABHgO.js} +6 -6
- package/dist/index.html +1 -1
- package/package.json +4 -4
- package/dist/assets/AddressRoutes-C13OMsQB.js +0 -1
- package/dist/assets/AiCfoScreen-C1Zi5BWJ.js +0 -22
- package/dist/assets/BusinessVerificationPageScreen-CaVy5wIy.js +0 -9
- package/dist/assets/CardsAiCfoScreen-BHtNOqz6.js +0 -14
- package/dist/assets/ConnectionAuthScreen-C6aejitU.js +0 -11
- package/dist/assets/CustomerOnboardingAuthScreen-abpr3s2K.js +0 -1
- package/dist/assets/CustomerOnboardingRoutes-DVMAQtsb.js +0 -30
- package/dist/assets/EntityDetailRoutes-bilW2_CZ.js +0 -1
- package/dist/assets/FeaturePreviewScreen-ADHB7kMI.js +0 -1
- package/dist/assets/HubSpotOAuthCallbackScreen-7DU1Mbfq.js +0 -1
- package/dist/assets/InvoicingRoutes-CiTJXDwp.js +0 -2
- package/dist/assets/MagicLinkSignInScreen-DdvxD6Sl.js +0 -12
- package/dist/assets/MobileAppDrawer-Boi7lIY0.js +0 -1
- package/dist/assets/NotFoundScreen-XQ69x1V9.js +0 -1
- package/dist/assets/NotificationRoutes-CjruMuyg.js +0 -1
- package/dist/assets/OAuthConsentScreen-fv9EuWPU.js +0 -1
- package/dist/assets/PandLWithForecastRoutes-CwPS1KT_.js +0 -1
- package/dist/assets/PeopleRoutes-B4wBQVwY.js +0 -22
- package/dist/assets/PerformanceRoutes-BaUrr9_i.js +0 -1
- package/dist/assets/ReimbursementApprovalRoutes-BoJxAtXM.js +0 -1
- package/dist/assets/RewardsRoutes-Cp5QwRpd.js +0 -1
- package/dist/assets/ScreenRoutes-DSM6zpE1.js +0 -2
- package/dist/assets/SetupPagesScreen-PMDfztMD.js +0 -29
- package/dist/assets/SignInScreen-DXEwLRRd.js +0 -1
- package/dist/assets/SignOutScreen-rRGrVkZi.js +0 -9
- package/dist/assets/TaskListScreen-C_FDDeaV.js +0 -9
- package/dist/assets/TaskRoutes-DIOgMKYK.js +0 -9
- package/dist/assets/TransactionDetailRoutes-C6i9gm0l.js +0 -1
- package/dist/assets/TransactionListRoutes-DMziXkI4.js +0 -1
- package/dist/assets/WiseConfirmationScreen-CYU0SXmY.js +0 -12
- package/dist/assets/ZeniAccountRoutes-4rPFLUgD.js +0 -57
- package/dist/assets/epic-BpPMSALI.js +0 -2
- package/dist/assets/expenseAutomationHelper-CTin--xN.js +0 -1
- package/dist/assets/useActualMatchingMatchDetail-CQqHF-gN.js +0 -1
- package/dist/assets/useAskAiCfoHostNavButtonProps-DQSYAHEz.js +0 -1
- package/dist/assets/useEmailConnectResultRefresh-XR0U1MaM.js +0 -1
- package/dist/assets/useTaskManagerAccess-CZYVdWyJ.js +0 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{j as D}from"./liveblocks-
|
|
1
|
+
import{j as D}from"./liveblocks-CQOAuUNI.js";import{a as o}from"./sentry-pp_6zWNc.js";import{h as J,g as W,u as X,j as m,s as q,l as K}from"./core-D07hD3KT.js";import{ai as Z,H as ee,y as Q,z as te,q as $,aj as ne,k as ae,U as ce}from"./index-B1xlAtau.js";import{bn as se,fI as oe,gY as ie,oE as R,UU as re,ib as G,gk as ue,ov as le,UV as de,UW as pe,ug as ge,m2 as me,ot as Ae,op as be,oA as Ie,id as ye,UX as fe,UY as Se}from"./zeni-epic-state-B3TABHgO.js";import{n as he}from"./mui-XiTT8YBC.js";import{M as Ee}from"./MobileAppDrawer-8BZVS4o3.js";import{q as Y}from"./QBOConnectionScreen-Dnjt4r9I.js";import{g as h,a as E,m as ze}from"./accountMappingHelper-CnG-eRj3.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]="600e27d9-0fe4-4928-9d34-36235311825a",a._sentryDebugIdIdentifier="sentry-dbid-600e27d9-0fe4-4928-9d34-36235311825a")}catch{}})();const u="zeni_pending_projects_enable",l={pending:"pending",ready:"ready"},ve=he.div`
|
|
2
2
|
display: flex;
|
|
3
3
|
height: 100%;
|
|
4
4
|
width: 100%;
|
|
@@ -6,4 +6,4 @@ import{j as D}from"./liveblocks-gNIoHksP.js";import{a as o}from"./sentry-BzzHvh6
|
|
|
6
6
|
flex-direction: column;
|
|
7
7
|
align-items: center;
|
|
8
8
|
background-color: ${a=>a.theme.colors.grey4};
|
|
9
|
-
`,we=
|
|
9
|
+
`,we=K((function(a,e){return{accountMappingView:e.accountMappingView,isFiling1099FeatureEnabled:e.isFiling1099FeatureEnabled,isAccruedExpensesFeatureEnabled:e.isAccruedExpensesFeatureEnabled,isAccountingClassesEnabled:me(a),isAccountingClassesUpdateInProgress:a.companyViewState.passportView?.accountingClassesUpdateStatus?.fetchState==="In-Progress",isAccountingProjectsEnabled:ge(a),isAccountingProjectsUpdateInProgress:(()=>{const i=sessionStorage.getItem(u),c=i===l.pending||i===l.ready;return a.companyViewState.passportView?.accountingProjectsUpdateStatus?.fetchState==="In-Progress"||c})(),isCapitalizationFeatureEnabled:e.isCapitalizationFeatureEnabled,capitalizableAccounts:e.capitalizableAccounts,accountNamesById:e.accountNamesById,capitalizableAccountOverrides:e.capitalizableAccountOverrides,isCapitalizationThresholdSaving:e.isCapitalizationThresholdSaving,onSaveCapitalizationAccountThreshold:e.onSaveCapitalizationAccountThreshold}}),(function(a,e){const{navigate:i,location:c,isFiling1099FeatureEnabled:A}=e;return{onAccountMappingChange:r=>{const{uncategorizedAccountSection:d,billsAccountSection:z,reimbursementsAccountSection:v,vendorsAccountSection:w,filing1099Section:C}=r,{incomeAccount:x,expenseAccount:F}=d,{billPayAccount:s}=z,{reimbursementsAccount:V}=v,{prepaidExpensesAccount:p,fixedAssetsAccount:T,accruedExpensesAccount:O}=w,{bankAccount:k,expenseCategory1099:M}=C,b=h(e.accountMappingView.incomeAccountList,x.selectedOption),j=h(e.accountMappingView.expenseAccountList,F.selectedOption),I=h(e.accountMappingView.billPayAccountList,s.selectedOption),_=h(e.accountMappingView.reimbursementsAccountList,V.selectedOption),P=E(e.accountMappingView.prepaidExpensesAccountList,p.selectedOptions),U=E(e.accountMappingView.fixedAssetsAccountList,T.selectedOptions),y=E(e.accountMappingView.accruedExpensesAccountList,O.selectedOptions),L=E(e.accountMappingView.bankAccounts1099FilingAccountList,k.selectedOptions),f=ze(e.accountMappingView.expenseAccounts1099FilingAccountList,M),t={selectedIncomeAccountId:b?.accountId,selectedExpenseAccountId:j?.accountId,selectedBillPayAccountId:I?.accountId,selectedReimbursementsAccountId:_?.accountId,selectedPrepaidExpensesAccountIds:P.map((n=>n.accountId)),selectedFixedAssetsAccountIds:U.map((n=>n.accountId)),selectedAccruedExpensesAccountIds:y.map((n=>n.accountId)),selectedBankAccounts1099FilingAccountIds:L.map((n=>n.accountId)),selectedExpenseAccounts1099FilingAccountIds:f};a(Se({data:t}))},onBackClick:()=>{$(c)===!1?(i("../../dashboard"),a(fe())):a(G())},onSaveClick:()=>{a(ye()),A&&ae.track(ce.Event.vendor1099AccountingSettingsSave)},onAccountingClassesToggle:r=>{a(Ie(e.currentTenant.companyId,r))},onAccountingProjectsToggle:r=>{const d=sessionStorage.getItem(u);d===l.pending||d===l.ready||a(r?Ae(e.currentTenant.companyId):be(e.currentTenant.companyId))}}}))(ne),_e=()=>{const a=Z(),e=J(),i=W(),c=X(),{useFeatureGate:A,useDynamicConfig:r}=ee(),{isFeatureEnabled:d}=A(Q.isFiling1099FeatureEnabled),{isFeatureEnabled:z}=A(Q.isScheduledJEAccruedExpensesFeatureEnabled),{configValue:v,isDynamicConfigLoading:w}=r("transaction_categorization_config"),C=!w&&v?.capitalization_enabled===!0,x=te.getSignedInUser(),F=se(x),s=m((t=>oe(t))),{capitalizableAccounts:V,capitalizableAccountOverrides:p,isCapitalizationThresholdSaving:T,currencySymbol:O}=m((t=>{const n=t.tenantState.currentTenantId,g=n!=null?t.tenantState.tenantsById[n]:void 0,S=ie(t.companyState,s.companyId);return{capitalizableAccounts:g?.capitalizableAccounts??null,capitalizableAccountOverrides:g?.capitalizableAccountOverrides??null,isCapitalizationThresholdSaving:t.companyViewState.passportView?.capitalizationThresholdUpdateStatus?.fetchState==="In-Progress",currencySymbol:S?.company.companyLocaleInfo?.currencySymbol??"$"}}),q),k=o.useCallback(((t,n)=>{c(R(s.companyId,t,n))}),[c,s.companyId]),M=o.useCallback((t=>{const n={...p??{}},g=Object.entries(t);for(const[B,N]of g)N===null?delete n[B]:n[B]=N;const[S,H]=g[0]??[];S!=null&&c(R(s.companyId,S,H,void 0,Object.keys(n).length>0?n:null))}),[c,s.companyId,p]),b=m((t=>re(t.accountState)),q),j=o.useMemo((()=>{const t={};for(const n of b)n.accountId!=null&&n.accountName!=null&&(t[n.accountId]=n.accountName);return t}),[b]),[I,_]=o.useState(!1),[P,U]=o.useState(!1);o.useEffect((()=>{I===!1&&(c(G()),_(!0))}),[I]);const y=m((t=>t.companyViewState.passportView?.needsQboProjectsReconnect===!0));o.useEffect((()=>{sessionStorage.getItem(u)===l.pending&&(sessionStorage.removeItem(u),c(ue({messageSection:"accounting_projects_qbo_reconnect_failed",messageText:"failed",type:"error"})))}),[c]),o.useEffect((()=>{sessionStorage.getItem(u)===l.ready&&s?.companyId!=null&&(sessionStorage.removeItem(u),c(le(s.companyId)))}),[s?.companyId,c]),o.useEffect((()=>{y&&s?.tenantEmailDomain!=null&&(sessionStorage.setItem(u,l.pending),c(de()),Y.init("/connection/auth",s.tenantEmailDomain),Y.handleClick())}),[y,s?.tenantEmailDomain,c]);const L=m((t=>pe(t))),f=t=>{U(t)};return D.jsxs(ve,{children:[D.jsx(Ee,{isAppContentDrawerOpen:P,handleDrawerToggle:f}),D.jsx(we,{currentTenant:s,navigate:e,meetingUrl:a("account_mapping"),accountMappingView:L,isFiling1099FeatureEnabled:d&&F,isAccruedExpensesFeatureEnabled:z,isCapitalizationFeatureEnabled:C,capitalizableAccounts:V,accountNamesById:j,capitalizableAccountOverrides:p,currencySymbol:O,isCapitalizationThresholdSaving:T,onSaveCapitalizationAccountThreshold:k,onSaveCapitalizationAccountThresholds:M,location:i,isSettings:$(i),onClickMenuIcon:()=>f(!0)})]})};export{u as P,_e as U,l as a};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{j as s}from"./liveblocks-
|
|
1
|
+
import{j as s}from"./liveblocks-CQOAuUNI.js";import{a as y}from"./sentry-pp_6zWNc.js";import{a4 as A,dP as v}from"./index-B1xlAtau.js";import"./mui-XiTT8YBC.js";import{u as F}from"./useActualMatchingMatchDetail-DTg70T-B.js";import R from"./NotFoundScreen-DnqoRCYC.js";import{i as P,h as U,g as w}from"./core-D07hD3KT.js";import"./zeni-epic-state-B3TABHgO.js";import"./recharts-CgYqsGTH.js";import"./analytics-DlzSqyvZ.js";import"./plaid-BG3pJamN.js";import"./dnd-B-KpYfWT.js";import"./stripe-cKAAJElX.js";import"./lottie-BIKpYE12.js";import"./lexical-NIxvAmS2.js";import"./pdf-Dli3mGO_.js";import"./utils-CrOdvv6w.js";import"./stripSplatSuffix-DA-gXJ77.js";import"./decodeURIComponentSafe-D3MFRtCF.js";import"./routePaths-Byv4I0Ax.js";(function(){try{var t=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},e=new t.Error().stack;e&&(t._sentryDebugIds=t._sentryDebugIds||{},t._sentryDebugIds[e]="06e6c5cf-6a6d-4607-a833-06969abfb8bb",t._sentryDebugIdIdentifier="sentry-dbid-06e6c5cf-6a6d-4607-a833-06969abfb8bb")}catch{}})();function V(){const{matchId:t,tenantEmailDomain:e}=P(),o=U(),n=w(),k=F(t??""),r=y.useCallback((()=>{const b=A(n.state?.pathnameStackToGoBack);o(b.poppedPathname??`/${e??""}/month_end_close_checks/review`,{state:{pathnameStackToGoBack:b.newStack}})}),[n.state,o,e]);if(t==null)return s.jsx(R,{});const{match:i,detailFetchState:a,handleOpenBill:l,handleRefresh:h,handleUndoReversal:c,handleApproveAndReverse:d,handleIgnoreMatchSuggestion:f,lastMatchResults:p,lastUndoResults:g,refreshStatus:m,ignoreStatus:u,matchAndReverseStatus:S,undoReversalStatus:I}=k;return i==null?a.fetchState==="Not-Started"||a.fetchState==="In-Progress"?s.jsx(v,{detailFetchState:a.fetchState,isIgnoreInFlight:u.fetchState==="In-Progress",isApproveInFlight:S.fetchState==="In-Progress",isUndoInFlight:I.fetchState==="In-Progress",refreshStatus:m.fetchState,onNavigateBack:r,onOpenBill:l,onApproveAndReverse:d,onIgnoreMatchSuggestion:f,onRefresh:h,onUndoReversal:c,lastMatchResults:p,lastUndoResults:g}):s.jsx(R,{}):s.jsx(v,{match:i,detailFetchState:a.fetchState,isIgnoreInFlight:u.fetchState==="In-Progress",isApproveInFlight:S.fetchState==="In-Progress",isUndoInFlight:I.fetchState==="In-Progress",refreshStatus:m.fetchState,onNavigateBack:r,onOpenBill:l,onApproveAndReverse:d,onIgnoreMatchSuggestion:f,onRefresh:h,onUndoReversal:c,lastMatchResults:p,lastUndoResults:g})}export{V as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{j as e}from"./liveblocks-CQOAuUNI.js";import{A as i}from"./AddressScreen-DAE2XqXc.js";import s from"./NotFoundScreen-DnqoRCYC.js";import"./sentry-pp_6zWNc.js";import{n as d,o as r}from"./core-D07hD3KT.js";import"./zeni-epic-state-B3TABHgO.js";import"./recharts-CgYqsGTH.js";import"./index-B1xlAtau.js";import"./mui-XiTT8YBC.js";import"./analytics-DlzSqyvZ.js";import"./plaid-BG3pJamN.js";import"./dnd-B-KpYfWT.js";import"./stripe-cKAAJElX.js";import"./lottie-BIKpYE12.js";import"./lexical-NIxvAmS2.js";import"./pdf-Dli3mGO_.js";import"./utils-CrOdvv6w.js";(function(){try{var t=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},o=new t.Error().stack;o&&(t._sentryDebugIds=t._sentryDebugIds||{},t._sentryDebugIds[o]="81cbb5c1-1b56-4d87-a240-ae6c03b91825",t._sentryDebugIdIdentifier="sentry-dbid-81cbb5c1-1b56-4d87-a240-ae6c03b91825")}catch{}})();function _(){return e.jsxs(d,{children:[e.jsx(r,{path:"/edit/:addressType/:addressId",element:e.jsx(i,{})}),e.jsx(r,{path:"/new/:addressType",element:e.jsx(i,{})}),e.jsx(r,{path:"*",element:e.jsx(s,{})})]})}export{_ as default};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{j as n}from"./liveblocks-
|
|
1
|
+
import{j as n}from"./liveblocks-CQOAuUNI.js";import{a as h}from"./sentry-pp_6zWNc.js";import{h as T,u as P,g as j,i as E,j as B,l as M}from"./core-D07hD3KT.js";import{a1 as $,E as D,z as K,W as L,a7 as V,a8 as U,k as C,U as S,a3 as z,Z as b,a4 as F}from"./index-B1xlAtau.js";import{Vz as _,is as R,fI as G,VA as N,c9 as O,VB as q,mK as H}from"./zeni-epic-state-B3TABHgO.js";import{n as W}from"./mui-XiTT8YBC.js";import Z from"./NotFoundScreen-DnqoRCYC.js";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},s=new e.Error().stack;s&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[s]="b4225413-d381-4779-99a8-3f7ecdc1b821",e._sentryDebugIdIdentifier="sentry-dbid-b4225413-d381-4779-99a8-3f7ecdc1b821")}catch{}})();const J=W.div`
|
|
2
2
|
display: flex;
|
|
3
3
|
height: 100vh;
|
|
4
4
|
width: 100%;
|
|
@@ -6,4 +6,4 @@ import{j as n}from"./liveblocks-gNIoHksP.js";import{a as h}from"./sentry-BzzHvh6
|
|
|
6
6
|
flex-direction: column;
|
|
7
7
|
align-items: center;
|
|
8
8
|
background-color: ${e=>e.theme.colors.grey4};
|
|
9
|
-
`,
|
|
9
|
+
`,Q=M((function(e,s){const{addressId:o,isSubPage:i,addressType:c}=s,l=G(e),a=s.roleMap!=null&&N(s.roleMap),d=i||c==="user_address"||O(l?.userRole??[])||a?void 0:"readonly";if(o==null){const t=q(c,e);return{addressToEdit:t?.addressToCreate,loadingState:t?.status?.fetchState,googleAPIKey:b.googleMapsAPIKey,isDisabled:d,isSubPage:i,dontShowSaveConfirmationPopup:s.dontShowSaveConfirmation}}const r=_(e,o);return{addressToEdit:r.address,loadingState:r.fetchState,googleAPIKey:b.googleMapsAPIKey,isDisabled:d}}),(function(e,s){const{navigate:o,location:i,addressType:c}=s,l=a=>{if(a==="express-pay")o("../express-pay/add-wire");else{const d=i.state,r=F(d?.pathnameStackToGoBack);let t=r.poppedPathname??v();const u=d?.queryParams;if(u){const g=new URLSearchParams(u).toString();g&&(t=`${t}?${g}`)}o(t,{state:{pathnameStackToGoBack:r.newStack}})}};return{onSubmitHandler:a=>{const d=X(a);e(H({addressType:c,addressToCreate:d})),C?.trackSaveAddressClicked(S.Event.saveAddressClicked,{street:a.street.addressString,city:a.city,state:a.state,country:a.country.selectedOption??"",postalCode:a.postalCode,suite:a.suite,secondaryInfo:a.secondaryInfo}),l(s.bankAccountContext)},onCancel:()=>{l(s.bankAccountContext)}}}))(z);function ne({isSubPage:e,hideAddressSubTitle:s=!1,hideAddressBackButton:o=!1,dontShowSaveConfirmation:i,accountContext:c,addressTypeParam:l}){const a=T(),d=P(),r=j(),{addressId:t,addressType:u}=E(),g=$(),w=D(),I=K.getSignedInUser(),[p,k]=h.useState(t==null),f=B((m=>t!=null?_(m,t).fetchState:"Not-Started")),x=L();if(I==null)throw Error("Can't access address page without signing in...");const A=m=>m.trackPageLoaded(t!=null?S.Event.editAddress:S.Event.addAddress),y=l??u;return h.useEffect((()=>{p||t==null||(k(!0),d(R(t,!1)))}),[p,t,d]),y==null||y.match(/(user_address|company_address|company_registered_address|vendor_address|officer_([1-9]|10)_address|invoicing_customer_billing_address|invoicing_subscription_shipping_address|invoicing_business_address)$/g)?!p&&f==="Not-Started"||p&&f==="In-Progress"?n.jsx(V,{fetchState:f,style:{backgroundColor:w.colors.grey5}}):t!=null&&f==="Error"?(a(`${v(1)}/new`,{replace:!0}),n.jsx(n.Fragment,{})):n.jsxs(n.Fragment,{children:[n.jsx(U,{analytics:C,onLoad:A}),n.jsx(J,{windowSize:g,children:n.jsx(Q,{location:r,navigate:a,isSubPage:e===!0,hideAddressBackButton:o,hideAddressSubTitle:s,addressId:t,addressType:y,dontShowSaveConfirmation:i,bankAccountContext:c,roleMap:x?.loggedInUserRoleMap})})]}):n.jsx(Z,{})}const v=(e=2)=>{let s="../";for(let o=0;o<e;o++)s=`${s}../`;return s},X=e=>({street:[e.street.addressString,e.suite,e.secondaryInfo],city:e.city,state:e.state,country:e.country.selectedOption??"",countryCode:e.countryCode,postalCode:e.postalCode,latitude:e.street.addressValue?.locationLat,longitude:e.street.addressValue?.locationLng});export{ne as A,X as t};
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import{j as S}from"./liveblocks-CQOAuUNI.js";import{a as n}from"./sentry-pp_6zWNc.js";import{u as Qt,h as Lt,i as Bt,g as Mt,j as v,l as Ft}from"./core-D07hD3KT.js";import{e6 as Vt,a as $t,h as Nt,e7 as Gt,z as Ht,a1 as qt,e8 as zt,e9 as Wt,ea as Yt,bp as Be,eb as We,ec as Jt,bo as Ye,a4 as ge,a8 as ce,k as V,ed as me,ee as Xt,ef as Kt,au as Zt,U as es,w as ts,eg as ss,eh as ns,av as as,ei as os,ej as is,ek as rs,el as ls,p as us,bk as Me,em as ds}from"./index-B1xlAtau.js";import{fH as F,gw as R,Uh as cs,a2u as ms,a2v as Ss,jP as hs,a2w as ps,jM as fs,a2x as Se,js as J,jV as X,jy as Ie,jf as he,jd as gs,jX as Is,jH as Je,Uq as Fe,gy as $,gN as Cs,Up as ks,Ua as Ve,fI as bs,j6 as vs,a2y as Es,gb as Ps,jo as ys,jk as ws,fJ as pe,gi as xs,a2z as Rs,a2A as Ts,a2B as js,gx as Os,gr as $e,k7 as Ne,gt as Ge,gz as As,a2C as He,jY as _s,jh as Us,jB as Ds,jT as qe,jE as Qs,gA as Ls,gB as Bs,gC as Ms,gD as Fs}from"./zeni-epic-state-B3TABHgO.js";import{D as Vs,n as N,S as $s,P as Ns}from"./mui-XiTT8YBC.js";import{u as Gs}from"./useAiCfoDashboardSuggestedQuestionsChips-BtQMXCJn.js";import{p as Hs}from"./pathToGoBack-RICxbZCJ.js";import{j as qs}from"./routePaths-Byv4I0Ax.js";import{u as zs}from"./useTaskManagerPusherEvents-CgwVJFYR.js";import"./recharts-CgYqsGTH.js";import"./analytics-DlzSqyvZ.js";import"./plaid-BG3pJamN.js";import"./dnd-B-KpYfWT.js";import"./stripe-cKAAJElX.js";import"./lottie-BIKpYE12.js";import"./lexical-NIxvAmS2.js";import"./pdf-Dli3mGO_.js";import"./utils-CrOdvv6w.js";(function(){try{var t=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},r=new t.Error().stack;r&&(t._sentryDebugIds=t._sentryDebugIds||{},t._sentryDebugIds[r]="b1e120a3-2e68-4be2-af09-8897dfbb5fd3",t._sentryDebugIdIdentifier="sentry-dbid-b1e120a3-2e68-4be2-af09-8897dfbb5fd3")}catch{}})();const Ws=["claimed","running","succeeded","failed","timeout"],fe=t=>typeof t=="string"&&t!=="",Xe="chat-response-generated";function Ys(t,r){if(r.kind!=="save")return;if(r.fetchState==="In-Progress")return{status:"saving"};if(r.fetchState==="Error")return{status:"failed"};if(r.fetchState!=="Completed")return;const h=R(t).skills.find((s=>s.macroId===r.savedMacroId));return h==null?void 0:{status:"saved",command:h.name}}const Js=Ft((function(t,r){const h=F(t),s=r.isSubmitting,d=h.uiState?.currentChatSessionId,l=d!=null?xs(t.aiCfoState,d):[],i=ns(t,{allUsers:r.allUsers,onCardPolicyVendorSearchTextChange:r.onCardPolicyVendorSearchTextChange}),g=Rs(t),p=Ts(t),f=js(t);return{showSampleQuestions:r.sessionFromUrl==="explore"&&h.uiState.currentChatSessionId==null,aiCfoView:h,isSubmitting:s,isNewChatSession:r.sessionFromUrl==="new_chat"||r.sessionFromUrl==="explore",isFullView:!0,tableDownloadEndPoint:`${as}/tableDownload`,exportDownloadEndPoint:rs(),emailLinkQuestion:r.emailLinkQuestion,autoSubmitEmailLinkQuestion:r.autoSubmitEmailLinkQuestion,onEmailLinkQuestionProcessed:r.onEmailLinkQuestionProcessed,routedInitialQuestionSource:r.routedInitialQuestionSource,routedInitialQuestionSuggestionIndex:r.routedInitialQuestionSuggestionIndex,exploreSuggestedPromptQuestions:r.exploreSuggestedPromptQuestions,exploreSuggestedPromptQuestionsLoading:r.exploreSuggestedPromptQuestionsLoading,isFileUploadEnabled:r.isFileUploadEnabled,isUploadPromoVisible:r.isUploadPromoVisible,onUploadPromoClose:r.onUploadPromoClose,skills:R(t).skills,skillSaveState:Ys(t,f),skillsEnabled:R(t).skillsEnabled,skillsList:R(t).skills,skillsListError:R(t).fetchState==="Error",skillsListLoading:R(t).fetchState==="In-Progress",skillsCanPublish:R(t).canPublish,skillSaving:f.fetchState==="In-Progress",skillSaveError:f.fetchState==="Error",skillVersionHistory:g.macroId!=null?{macroId:g.macroId,versions:g.versions,error:g.fetchState==="Error",loading:g.fetchState==="In-Progress"}:void 0,skillRestoreBody:p.macroId!=null&&p.version!=null?{macroId:p.macroId,version:p.version,instructions:p.instructions,error:p.fetchState==="Error",loading:p.fetchState==="In-Progress"}:void 0,skillDetail:X(t).detail,skillDetailError:X(t).fetchState==="Error",skillDetailLoading:X(t).fetchState==="In-Progress",syntheticAnswers:l,resolveSyntheticAnswerCardTile:is(t),resolveSyntheticAnswerPolicyTile:os(t),...i}}),(function(t,r){const{location:h,currentTenant:s,userId:d,navigate:l,currentChatSessionId:i,allSessionsWithOrderedQuestionAnswers:g,isAiCardCreationEnabled:p,isCardPolicyEnabled:f,setIsAiCfoOpen:L}=r,B=s.tenantEmailDomain;return{onEventReceived:(a,o)=>{if(a===Xe&&typeof o.text=="string"&&typeof o.metadata=="object"){const c=o,j=Ls(c.type),E=c.metadata.chat_session_id??null,{currentChatSession:O,currentQuestionAnswer:G,currentQuestionAnswerSummary:A}=Ye(g,E);j!=="answer"?V.trackAICFOChatResponseGenerated(j,G?.question.questionText??"",c.text,E,ds(A,O),c.metadata.message_id??null):V.trackAICFOChatAnswerGenerated(c.text,G?.question.questionText??"",(c.follow_up_questions?.length??0)>0,!!c.assumptions,!!c.insights,c.visualization!=null,Bs(c.visualization?.type??"")??null,E,c.summarized_title,c.metadata.message_id??null),t(Ms({chatSessionId:c.metadata.chat_session_id,responseType:j,fetchState:{fetchState:"Completed",error:void 0}})),t(Fs({chatSessionId:c.metadata.chat_session_id,answerPayload:c,userId:d}))}},onSubmit:(a,o,c,j,E)=>{a&&Me(t,a,o,i,g,d,j,c,void 0,E)},onFetchSkills:()=>{t(Je())},onOpenSkill:a=>{t(Ie({macroId:a})),t(Qs({macroId:a}))},onSaveSkill:(a,o)=>{t(qe({draft:a,macroId:o}))},onSaveSkillDraft:a=>{const o=a.displayName?.trim()??"",c=a.name?.trim()??"";t(qe({draft:{name:o.length>0?o:c,description:a.description?.trim()??null,instructions:a.instructions,visibility:"private"}}))},onFetchSkillVersionBody:(a,o)=>{t(Ds({macroId:a,version:o}))},onDeleteSkill:a=>{t(Us({macroId:a}))},onSetSkillVisibility:(a,o)=>{t(_s({macroId:a,visibility:o}))},onCloseSkillDetail:()=>{t(He())},onRunSkill:(a,o)=>{t($()),t($e()),Me(t,o,"user_input",void 0,g,d,void 0,void 0,void 0,a),t(He())},updateCurrentInput:a=>{t(Ge(a))},onStopSubmit:()=>{},onUpdateScrollYOffset:a=>{t(As(a))},onSelectSampleQuestion:()=>{},onBackClick:()=>{l(-1)},onCloseClick:()=>{const a=ge(h.state?.pathnameStackToGoBack),o=a.poppedPathname??Hs(1);l(o,{state:{...h.state,pathnameStackToGoBack:a.newStack}}),t(Ge(""))},togglePageView:()=>{const a=ge(h.state?.pathnameStackToGoBack),o=a.poppedPathname??`/${s.tenantEmailDomain}/dashboard`;l(o,{state:{...We(h.state),pathnameStackToGoBack:a.newStack,message:"open_ai_cfo_drawer"}}),L(!0)},onCopy:()=>{},onThumbsUp:(a,o)=>{i!=null&&o?.messageId!=null&&t(Ne(i,o.messageId,"positive",o.questionText,o.answerText))},onThumbsDown:(a,o)=>{i!=null&&o?.messageId!=null&&t(Ne(i,o.messageId,"negative",o.questionText,o.answerText))},onTogglePageView:()=>{l(-1)},onNewChatClick:()=>{t($()),i!=null&&t($e());const a=us(h.state?.pathnameStackToGoBack,h.pathname);l(`/${s.tenantEmailDomain}/ai-cfo/new_chat`,{state:{pathnameStackToGoBack:a.slice(0,-1),referrer:"Sidebar"}})},onToggleCotCollapsed:(a,o)=>{t(Os({questionAnswerId:a,isCollapsed:o}))},onMenuClick:r.onMenuClick,...ls(t,{isAiCardCreationEnabled:p,isCardPolicyEnabled:f,currentChatSessionId:i,onAfterCardsCreationSubmit:()=>{L(!0),l(`/${B}/cards`,{state:{...h.state}})},onAfterCardPolicySubmit:()=>{L(!0),l(`/${B}/cards/policy`,{state:{...h.state}})}})}}))(ts(ss)),bn=({isFileUploadEnabled:t})=>{const r=Vt(),{setIsAiCfoOpen:h}=$t(),s=Qt(),d=Lt(),{session_id:l}=Bt(),i=Mt(),g=new URLSearchParams(i.search).get("routine")??void 0,[p,f]=n.useState(!1),L=v((e=>F(e).uiState.isSkillsBrowserOpen===!0)),B=v((e=>R(e).skillsEnabled)),a=v((e=>F(e).uiState.isRoutinesBrowserOpen===!0)),o=v((e=>cs(e))),c=v((e=>ms(e))),j=v((e=>Ss(e))),[E,O]=n.useState(void 0),[G,A]=n.useState(!1),[Ke,Ce]=n.useState(void 0),Ze=n.useCallback((()=>{Ce(void 0),O(void 0),A(!0)}),[]),et=n.useCallback((e=>{O(e),A(!0)}),[]),tt=n.useCallback((()=>{O(void 0),A(!1)}),[]),st=n.useCallback((e=>{s(hs({draft:e,...E!=null&&{scheduleId:E.scheduleId}})),O(void 0),A(!1)}),[s,E]),P=g,ke=o.routines.find((e=>e.scheduleId===P)),C=v((e=>ps(e))),nt=n.useCallback((e=>{s(fs({scheduleId:e.scheduleId}))}),[s]);n.useEffect((()=>{s(P!=null?J({scheduleId:P}):Se())}),[s,P]);const M=ke?.macroId,at=v((e=>X(e))),be=M!=null&&M!==""&&at.fetchState==="Not-Started";n.useEffect((()=>{be&&M!=null&&s(Ie({macroId:M}))}),[s,be,M]);const ot=v((e=>F(e).uiState.currentChatSessionId))??l,k=o.routines.find((e=>e.scheduleId===g))??o.routines.find((e=>e.scheduleId===Nt(ot))),T=k?.scheduleId??null,[ve,it]=n.useState(!0);n.useEffect((()=>{T!=null&&s(J({scheduleId:T}))}),[s,T]);const Ee=C.runs.some((e=>e.status==="claimed"||e.status==="running"))===!0;n.useEffect((()=>{if(P==null||Ee!==!0)return;const e=window.setInterval((()=>{s(J({scheduleId:P})),s(he())}),5e3);return()=>window.clearInterval(e)}),[s,Ee,P]);const rt=n.useCallback((e=>{Ce(e),O(void 0),A(!0)}),[]),lt=n.useCallback((e=>{s(gs({scheduleId:e.scheduleId}))}),[s]),ut=n.useCallback(((e,m)=>{s(Is({enabled:m,scheduleId:e.scheduleId}))}),[s]);n.useEffect((()=>{a&&s(he())}),[s,a]);const Pe=v((e=>R(e).skills)),K=n.useMemo((()=>Pe.map((e=>({macroId:e.macroId,name:e.displayName??e.name})))),[Pe]),dt=n.useCallback((e=>{s(Ie({macroId:e}))}),[s]),Z=n.useCallback((()=>{s(Je()),s(Fe())}),[s]),ct=n.useCallback((()=>{s($())}),[s]),{allUsers:mt,isAiCardCreationEnabled:St,isCardPolicyEnabled:ht,onCardPolicyVendorSearchTextChange:pt}=Gt();n.useEffect((()=>{s(Cs())}),[s]);const I=v((e=>F(e))),w=Ht.getSignedInUser();n.useEffect((()=>l==="routines"?(s($()),void s(ks())):l==="skills"?(s(Se()),s(Ve()),void s(Fe())):(T==null&&s(Se()),s(Ve()),void s($()))),[s,T,g,l]);const ft=qt(),_=Zt(ft),b=v((e=>bs(e))),u=I.uiState.currentChatSessionId,y=b.tenantEmailDomain,Q=y!=null&&y!=="",ee=n.useCallback((e=>{Q&&d(`/${y}/ai-cfo/routines?routine=${encodeURIComponent(e.scheduleId)}`)}),[Q,d,y]),te=n.useCallback((()=>{Q&&d(`/${y}/ai-cfo/routines`)}),[Q,d,y]),se=n.useCallback(((e,m)=>{const U=e.sessionId??C.sessionId;U!=null&&Q&&d(`/${y}/ai-cfo/${U}?routine=${encodeURIComponent(m)}`)}),[Q,d,C.sessionId,y]),gt=n.useMemo((()=>k==null?void 0:{error:C.fetchState==="Error",kind:"routineRuns",loading:C.fetchState==="In-Progress"||C.fetchState==="Not-Started",routineName:k.name,schedule:zt(k),skillName:k.isAdHoc===!0?void 0:K.find((e=>e.macroId===k.macroId))?.name,onOpenSkill:k.isAdHoc===!0?void 0:Z,runs:C.runs,tzName:k.tzName,unreadCount:k.unreadRuns,open:ve,onToggle:()=>it((e=>!e)),onOpenRun:e=>se(e,k.scheduleId),onOpenRoutine:()=>ee(k),onOpenRoutines:te}),[Z,te,ee,se,ve,k,C.fetchState,C.runs,K]),{handleUploadPromoClose:It,isUploadPromoVisible:Ct}=Wt({isFileUploadEnabled:t,tenantEmailDomain:y}),ne=Yt({currentTenant:b,currentChatSessionId:u,aiCfoView:I,skillsEnabled:B,onCloseSkills:ct,onOpenSkills:Z}),{isSuggestedQuestionsLoading:kt,suggestedPromptQuestions:bt}=Gs(),H=i.state,q=H?.aiCfoInitialQuestion,ye=!!H?.aiCfoShouldSubmit;n.useEffect((()=>{const e=i.state;if(e?.[Be]!==!0)return;f(!0);const m={...e};delete m[Be],d(i,{replace:!0,state:m})}),[i.pathname,i.search,i.state,d]);const[vt,ae]=n.useState(null),[Et,oe]=n.useState(!1),[Pt,ie]=n.useState(void 0),[yt,re]=n.useState(void 0),we=n.useRef(!1);n.useEffect((()=>{if(!we.current&&q!=null&&q!==""){const e=i.state;ae(q),oe(ye),ie(e?.aiCfoInitialSubmissionSource!=null?e.aiCfoInitialSubmissionSource:void 0);const m=e?.aiCfoSuggestionIndex;re(typeof m=="number"?m:void 0),we.current=!0}}),[q,ye,i.state]);const wt=n.useCallback((()=>{ae(null),oe(!1),ie(void 0),re(void 0),d(i.pathname,{replace:!0,state:We(i.state)})}),[i.pathname,i.state,d]),xe=n.useMemo((()=>new URLSearchParams(i.search)),[i.search]),Re=xe.get("ref")??H?.aiCfoRef,le=xe.get("emailRefId")??H?.aiCfoEmailRefId,Te=n.useRef(!1);n.useEffect((()=>{Te.current||Re!=="month-end-email"||le==null||u!=null||w==null||(s(vs("controller",w.userId,le,"MONTH_END_EMAIL")),Te.current=!0)}),[Re,le,u,s,w]);const z=I.uiState.lastContextMessage;n.useEffect((()=>{z!=null&&z!==""&&u!=null&&(ae(z),oe(!0),ie(void 0),re(void 0),s(Es()))}),[z,u,s]);const xt=b.masterTOSInfo,x=xt?.isMasterTOSAccepted??!1,{visitedSessions:je}=Jt(u),W=I.fetchState,Y=I.uiState.chatSessionsNextPageToken.hasMore||!I.uiState.chatSessionsFirstPageFetched,Oe=u!=null?I.fetchChatSessionHistoryByChatSessionId?.[u]?.fetchState??"Not-Started":"Not-Started",Ae=u==null||(I.uiState.chatHistoryNextPageToken[u]?.hasMore??!0),_e=I.allSessionsWithOrderedQuestionAnswers,{currentSessionQuestionAnswers:Rt}=Ye(_e,u),Tt=Rt.length===0;n.useEffect((()=>{x||_||d("../dashboard",{state:{...i.state,message:"open_ai_cfo_drawer"}})}),[x,_,d,i.state]);const jt=n.useCallback((()=>{const e=ge(i.state?.pathnameStackToGoBack),m=b.tenantEmailDomain;d(e.poppedPathname??(m!=null?`/${m}/dashboard`:".."),{state:{...i.state,pathnameStackToGoBack:e.newStack}})}),[b.tenantEmailDomain,i.state,d]),Ue=n.useRef(void 0),De=n.useRef(void 0);n.useEffect((()=>{const e=l!==Ue.current,m=u!==De.current;Ue.current=l,De.current=u,l!==u&&(!e||l==null||qs(l)?m&&u!=null&&d(`../ai-cfo/${u}`,{state:{...i.state}}):s(Ps({sessionId:l,agentId:"controller"})))}),[u,l]);const Ot=n.useMemo((()=>({events:je.map((e=>`private-encrypted-chat-${e}.${Xe}`)),eventCallback:(e,m,U)=>U.onEventReceived(e,m)})),[je]);n.useEffect((()=>{W!=="In-Progress"&&Y&&s(ys())}),[W,Y,s]),n.useEffect((()=>{u!=null&&Oe!=="In-Progress"&&Ae&&w!=null&&(l===u||W==="Completed"&&!Y)&&s(ws(u,w.userId))}),[Oe,W,Ae,Y,u,w,l,s]);const ue=w?.userId,At=n.useMemo((()=>{return ue==null?[]:[(e=ue,`private-encrypted-routines-${e}.routine-run-updated`)];var e}),[ue]),Qe=n.useCallback((e=>{const m=e!=null&&(e===P||e===T);(a||m)&&s(he()),m&&s(J({scheduleId:e}))}),[s,a,T,P]);zs({events:At,onSubscribed:()=>Qe(P??T),onEvent:(e,m)=>{const U=(de=>{if(de==null||typeof de!="object")return null;const D=de;return fe(D.schedule_id)&&fe(D.run_id)?{scheduleId:D.schedule_id,runId:D.run_id,status:Ws.find((Dt=>Dt===D.status))??null,finishedAt:fe(D.finished_at)?D.finished_at:null}:null})(m);U!=null&&Qe(U.scheduleId)}});const Le=e=>e.trackAICFOOnboardingScreenStateChanged("open","first_visit");if(w==null||l==null)throw Error("Can't access AI Controller page without signing in...");const _t=u!=null&&I.responseStateByChatSessionId?.[u]?.answer?.fetchState==="In-Progress";if(!x&&_)return S.jsxs(Ks,{children:[S.jsx(ce,{analytics:V,onLoad:Le}),ne.drawerElement,S.jsx(Zs,{children:S.jsx(ze,{children:S.jsx(me,{isTOSAccepted:!1,acceptMasterTOSState:I.masterTOSAcceptanceState,onCloseClick:jt,onCompleteClick:()=>{b.userRoleId!=null&&s(pe(b.userRoleId))}})})})]});const Ut=S.jsxs(S.Fragment,{children:[p&&!x?S.jsx(ce,{analytics:V,onLoad:Le}):null,S.jsx(me,{isTOSAccepted:x,acceptMasterTOSState:I.masterTOSAcceptanceState,showHeader:!1,togglePageView:x?()=>f(!1):void 0,onCloseClick:()=>f(!1),onCompleteClick:()=>{x||b.userRoleId==null||s(pe(b.userRoleId)),f(!1)}})]});return S.jsxs(S.Fragment,{children:[S.jsxs(Xs,{children:[S.jsx(ce,{analytics:V,onLoad:e=>e.trackPageLoaded(es.Event.aiCFOPage)}),_&&ne.drawerElement,S.jsx(Js,{answerExportEndPoint:r,...Ot,currentChatSessionId:u,allSessionsWithOrderedQuestionAnswers:_e,allUsers:mt,isAiCardCreationEnabled:St,isCardPolicyEnabled:ht,openOnboardingPage:()=>f(!0),userId:w.userId,setIsAiCfoOpen:h,navigate:d,sessionFromUrl:l,location:i,isSubmitting:_t,isEmptyChatWithSession:Tt,currentTenant:b,emailLinkQuestion:vt??void 0,autoSubmitEmailLinkQuestion:Et,onEmailLinkQuestionProcessed:wt,routedInitialQuestionSource:Pt,routedInitialQuestionSuggestionIndex:yt,onCardPolicyVendorSearchTextChange:pt,onMenuClick:_?ne.open:void 0,isFileUploadEnabled:t,isUploadPromoVisible:Ct,onUploadPromoClose:It,exploreSuggestedPromptQuestions:bt,exploreSuggestedPromptQuestionsLoading:kt,isSkillsOpen:L,isRoutinesOpen:a,routineCanCreate:j,routineEditing:E,routineEditorOpen:G,routineListError:o.fetchState==="Error",routineListLoading:o.fetchState==="In-Progress",routineMaxRoutines:o.maxRoutines,routineSaveError:c.fetchState==="Error",routineSaving:c.fetchState==="In-Progress",routineSchedulableSkills:K,routines:o.routines,onRoutineCreate:Ze,onRoutineDelete:lt,routineHistoryError:C.fetchState==="Error",routineHistoryLoading:C.fetchState==="In-Progress",chatSidePanel:gt,routineDetail:ke,routineRunningScheduleId:c.runningScheduleId,routineRuns:C.runs,onRoutineEdit:et,onRoutineOpenRun:(e,m)=>se(m,e.scheduleId),onRoutineRun:nt,onRoutineCloseDetail:te,onRoutineDraft:rt,routineDraftPrompt:Ke,onRoutineOpenDetail:ee,onRoutineEditorCancel:tt,onRoutineLoadSkillInstructions:dt,onRoutineSave:st,onRoutineSetEnabled:ut,isCreateSkillEnabled:B,promoDismissalScope:y}),p&&_?S.jsx(Vs,{anchor:"right",open:p,transitionDuration:250,PaperProps:{component:en,style:{width:"100%"}},slotProps:{backdrop:{style:{backgroundColor:"transparent",cursor:"pointer"}}},onClose:()=>f(!1),children:S.jsx(ze,{onClick:e=>e.stopPropagation(),children:S.jsx(me,{isTOSAccepted:x,acceptMasterTOSState:I.masterTOSAcceptanceState,onCloseClick:()=>f(!1),onCompleteClick:()=>{x||b.userRoleId==null||s(pe(b.userRoleId)),f(!1)}})})}):null]}),p&&!_?S.jsx(Xt,{open:p,onClose:()=>f(!1),children:S.jsx(Kt,{children:Ut})}):null]})},ze=N($s)`
|
|
2
|
+
display: flex;
|
|
3
|
+
min-height: 100%;
|
|
4
|
+
flex-direction: column;
|
|
5
|
+
`,Xs=N.div`
|
|
6
|
+
height: 100vh;
|
|
7
|
+
width: 100%;
|
|
8
|
+
`,Ks=N.div`
|
|
9
|
+
height: 100vh;
|
|
10
|
+
width: 100%;
|
|
11
|
+
display: flex;
|
|
12
|
+
flex-direction: column;
|
|
13
|
+
min-height: 0;
|
|
14
|
+
`,Zs=N.div`
|
|
15
|
+
flex: 1;
|
|
16
|
+
min-height: 0;
|
|
17
|
+
display: flex;
|
|
18
|
+
flex-direction: column;
|
|
19
|
+
`,en=N(Ns)`
|
|
20
|
+
box-shadow: ${({theme:t})=>t.colors.elevation2};
|
|
21
|
+
color: ${({theme:t})=>t.colors.grey4};
|
|
22
|
+
`;export{bn as default};
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import{j as d}from"./liveblocks-gNIoHksP.js";import{a as o,R as ya}from"./sentry-BzzHvh63.js";import{u as Me,j as r,g as Ta,h as $a,q as R}from"./core-_cqItzd_.js";import{fI as Ue,U4 as Ba,U5 as Fe,gc as Aa,gy as J,U6 as K,jH as Ie,jf as ve,U7 as xa,U8 as _a,gR as Da,q2 as Ma,U9 as Ua,Ua as ye,gp as Fa,Ub as $,fH as Ga,gw as Ra,Uc as Za,Ud as Ha,Ue as ja,Uf as Te,Ug as Va,Uh as $e,Ui as Na,Eh as Pa,gq as La,h4 as Oa,cW as qa,Uj as za,Uk as Ya,qF as Wa,gb as Ja,j9 as Ka,Ul as Qa,Um as Xa,wA as et,gr as at}from"./zeni-epic-state-ClqSlu6d.js";import{w as tt,i as nt,a as ot,c as st,E as rt,_ as it,f as m,d as lt,u as dt,e as ct,g as ut,h as mt,j as Ct,k as pt,l as ht,m as ft,z as gt,n as Z,p,o as Be,q as bt,r as St,s as Ae,v as kt,x as xe,y as Et,H as wt,A as X,B as Q,C as It,D as vt,F as yt,L as Tt,I as $t,J as Bt,K as ee,M as At,N as xt}from"./index-DVhAab8j.js";import{A as _t,b as Dt,I as Mt,a as _e,d as Ut,D as De}from"./mui-CDH3xRD_.js";import{u as Ft}from"./InboxNotificationsProvider-Vlyx5Pej.js";import{u as Gt}from"./useTaskManagerAccess-CZYVdWyJ.js";import{u as Rt}from"./expenseAutomationHelper-CTin--xN.js";import"./recharts-BgEcqT8y.js";import"./analytics-DI5uqxwC.js";import"./plaid-Dvn5Z296.js";import"./dnd-BzHSvmGV.js";import"./stripe-cKAAJElX.js";import"./lottie-CjJcvZ3r.js";import"./lexical-CXRKir6z.js";import"./pdf-BZVEJwNE.js";import"./utils-DZX8_JTm.js";(function(){try{var a=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},C=new a.Error().stack;C&&(a._sentryDebugIds=a._sentryDebugIds||{},a._sentryDebugIds[C]="919afa98-a44e-43b0-bee4-804bfdd5cb19",a._sentryDebugIdIdentifier="sentry-dbid-919afa98-a44e-43b0-bee4-804bfdd5cb19")}catch{}})();const B="AppDrawer",c={root:`${B}-root`,drawer:`${B}-drawer`,appBar:`${B}-appBar`,menuButton:`${B}-menuButton`,appBarZenilogo:`${B}-appBarZenilogo`,drawerZenilogo:`${B}-drawerZenilogo`},Zt=ee("div",{slot:"Root"})((({theme:a})=>({[`&.${c.root}`]:{display:"flex"},[`& .${c.drawer}`]:{[a.breakpoints.up("md")]:{width:X,flexShrink:0,backgroundColor:a.colors.background}},[`& .${c.appBar}`]:{color:a.colors.primary,backgroundColor:a.colors.background,boxShadow:"none"},"& .MuiToolbar-root":{backgroundColor:a.colors.background},[`& .${c.menuButton}`]:{marginRight:a.spacing(2),[a.breakpoints.up("md")]:{display:"none"}},[`& .${c.appBarZenilogo}`]:{fill:a.colors.primary,cursor:"pointer",width:"100%",marginLeft:a.spacing(-6)},[`& .${c.drawerZenilogo}`]:{margin:`${a.spacing(3)} ${a.spacing(3)} ${a.spacing(0)}`,fill:a.colors.primary,cursor:"pointer"}}))),Ht=tt((function({tenantEmailDomain:a}){const{isAiCfoOpen:C,setIsAiCfoOpen:b}=ot(),[H,x]=ya.useState(!1),[S,Ge]=o.useState(!1),t=Ta(),s=$a(),ae=Aa(),te=st(),n=Me(),[Re,Ze]=o.useState(!1),j=rt(),ne=t.pathname.includes("/ai-cfo/");o.useEffect((()=>{ne||(n(J()),n(K()))}),[n,ne]),o.useEffect((()=>{n(J()),n(K())}),[n,a]);const{useFeatureGate:u}=it(),{isFeatureEnabled:oe}=u(m.isDebitCardFeatureEnabled),k=lt(),i=r((e=>Ue(e))),V=i.masterTOSInfo?.isMasterTOSAccepted??!1,{setLoading:He}=dt(),E=ct(),{isTaskManagerAccessEnabled:_,isZeniUser:je}=Gt(k),se=ut(),w=mt();o.useEffect((()=>{w&&E&&(n(Ie()),n(ve()))}),[n,w,i.tenantId,E]);const[N,Ve]=o.useState(void 0),Ne=!!i.company?.companyZeniAccountInfo?.isZeniAccountEnabled,{isFeatureEnabled:Pe}=u(m.isChargeCardFeatureEnabled),Le=Ct(i,Pe,oe),{isFeatureEnabled:Oe}=u(m.isSettingsFeatureEnabled),{isFeatureEnabled:D}=u(m.isReferralFeatureEnabled),qe=i.companyTreasuryInfo?.info?.businessVerificationStatus?.code==="verified",re=r((e=>xa(e)));o.useEffect((()=>{const e=()=>{Ze(window.scrollY>10)};return window.addEventListener("scroll",e),()=>{window.removeEventListener("scroll",e)}}),[]);const P=r((e=>_a(e))),h=r((e=>e.expenseAutomationViewState.selectedPeriodByTenantId)),f=r((e=>Da(e))),{monthEndCloseChecksView:I}=f,ze=R("/signout")!==null,M=R("/:tenantEmailDomain/dashboard")!==null,ie=R("/:tenantEmailDomain/reports")!==null,g=R("/:tenantEmailDomain/onboarding/*")!==null,le=Rt();o.useEffect((()=>{w&&D&&!g&&P.fetchState==="Not-Started"&&n(Ma(!0))}),[w,D,P.fetchState,g]),o.useEffect((()=>{if(le){const e=t.state?.origin;if(e!=null){const l=Ua(e);l!=null&&n(ye(l))}}}),[le,t.state]);const Ye=ze||g,L=r((e=>e.tenantState)),We=r((e=>L.fetchState==="Completed"?Fa(e):[])),{isFeatureEnabled:Je}=u(m.isApAgingFeatureEnabled),{isFeatureEnabled:Ke}=u(m.isArAgingFeatureEnabled),{isFeatureEnabled:Qe}=u(m.isDashboardSidebarHalloweenAnimationEnabled),{isFeatureEnabled:Xe}=u(m.isDashboardSidebarThanksGivingAnimationEnabled),{isFeatureEnabled:ea}=u(m.isDashboardSidebarChristmasAnimationEnabled),{isFeatureEnabled:aa}=u(m.isDashboardSidebarNewYearAnimationEnabled),ta=r((e=>$(e).totalUnreadCount)),na=r((e=>$(e).notificationDetailsByTab.tasks.uiState.unreadCount)),oa=r((e=>$(e).notificationDetailsByTab.comments.uiState.unreadCount)),sa=r((e=>$(e).reducedFetchCountState)),de=r((e=>$(e).notificationDetailsByTab.tasks.fetchCountState)),O=r((e=>Ga(e))),ra=r((e=>Ra(e).skillsEnabled)),ia=r((e=>Za(e))),ce=r((e=>Ha(e).routines)),la=o.useMemo((()=>ce.filter((e=>e.sessionId!=null)).map((e=>({cadence:pt(e),name:e.name,scheduleId:e.scheduleId,sessionId:e.sessionId,unreadRuns:e.unreadRuns})))),[ce]),da=new URLSearchParams(t.search).get("routine")??ht(t.pathname.split("/ai-cfo/")[1])??void 0,ca=o.useCallback(((e,l)=>{s(l!=null&&l!==""?`/${a}/ai-cfo/${encodeURIComponent(l)}`:`/${a}/ai-cfo/routines?routine=${encodeURIComponent(e)}`)}),[s,a]),{status:ue}=r(ja),[v,q]=o.useState(void 0),z=O.uiState.currentChatSessionId,U=v!=null?O.deleteChatSessionStateByChatSessionId[v]?.fetchState:void 0,me=ft(U),{inboxNotifications:Y,isLoading:Ce,isFetchingMore:pe,hasFetchedAll:he,fetchMore:ua}=Ft(),F=r((e=>$(e).notificationDetailsByTab.comments.fetchCountState));o.useEffect((()=>{const e=setTimeout((()=>ua?.()),0);return()=>clearTimeout(e)})),o.useEffect((()=>{if(v!=null)return me==="In-Progress"&&U==="Completed"?(n(Te({chatSessionId:v})),q(void 0),void s(`/${a}/ai-cfo/explore`,{state:{...t.state,referrer:"Sidebar"}})):void(U==="Error"&&(n(Te({chatSessionId:v})),q(void 0)))}),[n,t.state,s,U,v,me,a]),o.useEffect((()=>{if(Ce===!1&&pe===!1&&he===!0&&i?.companyId!=null&&Y!=null){const e=`dashboard_${i.companyId}`;Ve(Y.filter((l=>l.roomId===e&&l.readAt==null)).length)}}),[Ce,pe,he,i?.companyId,Y]),o.useEffect((()=>{w&&_&&!g&&de.fetchState==="Not-Started"&&ae.tenantId!=null&&n(Va("task_manager","dashboard"))}),[w,_,g,de.fetchState,ae.tenantId,n]),o.useEffect((()=>{g||F.fetchState!=="Not-Started"||n($e({fetchCountState:{fetchState:"In-Progress",error:void 0}},"comments"))}),[g,F.fetchState,n]),o.useEffect((()=>{if(N!=null){const{fetchState:e}=F;e!=="In-Progress"&&e!=="Completed"||(e==="In-Progress"&&n($e({fetchCountState:{fetchState:"Completed",error:void 0}},"comments")),n(Fe({unreadCount:N},"comments")))}}),[N,F.fetchState]);const ma={fetchStatus:sa,count:ta},y=[];Je===!1&&y.push("accounts_payable_aging"),Ke===!1&&y.push("accounts_receivable_aging"),y.push("zeni_accounts_promo_card","treasury_promo_card"),D===!1&&y.push("rewards_card"),se===!1&&y.push("expense_automation_card");const fe=r((e=>Na(e,y).fetchState)),ge=r((e=>Pa(e).fetchState)),be=a!=null?gt.getSignedInUserTenant(a):null,Se=r((e=>be?.tenantId!=null?La(e,be.tenantId):void 0)),Ca=M&&(fe==="Completed"||fe==="Error")||ie&&(ge==="Completed"||ge==="Error")||!M&&!ie?void 0:"disabled",pa=o.useMemo((()=>Oa(i.userRole)),[i.userRole]),ha=qa(pa),T=e=>{x(e)},fa=qe,ga=i?.rewardsLastViewedTime==null,ba=k?.userEmail!=null&&re.fetchState==="Completed"&&za(re.notificationSettings,k.userEmail,oe,i,_),Sa=o.useCallback((e=>{const l=t.state?.referrer;if(I.monthEndCloseChecks?.auditSummary!=null&&Z.trackMonthCloseAuditPage(e.month,e.year,I.monthEndCloseChecks.reportEmailSentDate!=null?"closed":"in-review",I.monthEndCloseChecks.auditSummary.auditScorePercentage,!1,l??null),n(Ya(i.tenantId,e)),h[i.tenantId]!=null){const A=p(t.state?.pathnameStackToGoBack,t.pathname);s(`/${a}/month_end_close_checks/review/${f.currentSelectedView}/${e.month}-${e.year}`,{state:{pathnameStackToGoBack:A,referrer:f.currentSelectedView}})}n(ye(f.currentSelectedView)),f.reconciliation.selectedAccountId!=null&&n(Wa({selectedAccountId:void 0}))}),[f.reconciliation.selectedAccountId,f.currentSelectedView,i.tenantId,I.monthEndCloseChecks?.auditSummary,I.monthEndCloseChecks?.reportEmailSentDate,h,a,t.state,t.pathname]),ka=o.useMemo((()=>({zIndex:S?12:Be[2]})),[S]),Ea=E&&bt(t),ke=d.jsx(St,{signedInUser:k,currentTenantId:L.currentTenantId??"",tenants:L.fetchState==="Completed"?We:Se!=null?[Se]:[],rewardsConfiguration:{isRewardsTabVisible:D,isRewardsAnimated:ga,rewardsPlan:P.rewardsPlan},selectedMenu:C===!0?xe("ai_cfo"):Ae(t)&&ue!=="completed"?xe("invoicing"):Et(t),isTenantDropdownDisabled:Ca,isSettings:kt(t),isInvoicing:Ae(t)&&ue==="completed",isSettingsFeatureEnabled:Oe,currentTenant:i,isVendorsTabVisible:ha,isZeniAccountEnabled:Ne,isChargeCardEnabled:Le,isTreasuryEnabled:fa,isNotificationsTabVisible:ba,notificationCountDetails:ma,isExpenseAutomationEnabledForUser:se,isAiCfoAccessEnabled:E,skillsEnabled:ra&&E,routinesEnabled:ia===!0&&E,routines:la,selectedRoutineId:da,onRoutineSelect:ca,onNotificationIconClick:()=>{T(!1);const e=je?na===0&&oa>0?"notifications/comments":"notifications/tasks":"notifications/comments",l=p(t.state?.pathnameStackToGoBack,t.pathname);s(`${a}/${e}`,{state:{pathnameStackToGoBack:l}})},onZeniLogoClick:()=>{te.toggle()},handleTenantSelect:e=>{He(Tt.TENANT_SWITCHING),T(!1),$t({dispatch:n,navigate:s,pathToNavigate:Bt(e.tenantEmailDomain,t),selectedTenant:e,signedInUser:k})},handleMenuChange:(e,l)=>{if(k!=null&&Z.trackSidePanelClicked(e.type,e.group),T(!1),a==null)return;if(e.type==="routines")return V?(n(ve()),n(Qa()),void s(`/${a}/ai-cfo/routines`,{state:{pathnameStackToGoBack:p(t.state?.pathnameStackToGoBack,t.pathname),referrer:"Sidebar"}})):void Q({location:t,navigate:s,mergeState:{referrer:"Sidebar"}});if(e.type==="skills")return V?(n(Ie()),n(Xa()),void s(`/${a}/ai-cfo/skills`,{state:{pathnameStackToGoBack:p(t.state?.pathnameStackToGoBack,t.pathname),referrer:"Sidebar"}})):void Q({location:t,navigate:s,mergeState:{referrer:"Sidebar"}});if(n(J()),n(K()),e.type==="invoicing")return C&&b(!1),n(et({cacheOverride:!1})),void s(`../${a}/invoicing/overview`,{state:{pathnameStackToGoBack:p(t.state?.pathnameStackToGoBack,t.pathname),referrer:"Sidebar"}});if(C&&It(e.type)&&b(!1),e.type==="ai_cfo"){if(Z.trackAICFOChatScreenStateChanged("viewed","left_menu",z??null,null),!V)return void Q({location:t,navigate:s,mergeState:{referrer:"Sidebar"}});const G=p(t.state?.pathnameStackToGoBack,t.pathname);return void s(`/${a}/ai-cfo/explore`,{state:{pathnameStackToGoBack:G,referrer:"Sidebar"}})}const A=p(t.state?.pathnameStackToGoBack,t.pathname),W=e.type,we=xt(W)&&W!=="command_center";if(W!=="command_center"&&!we||h[i.tenantId]==null||Z.trackMonthEndCloseClicked(h[i.tenantId].month,h[i.tenantId].year,"Sidebar"),we&&h[i.tenantId]!=null){const G=h[i.tenantId];return void s(`/${a}/month_end_close_checks/review/${e.type}/${G.month}-${G.year}`,{state:{pathnameStackToGoBack:A,message:l,referrer:"Sidebar"}})}const va=vt(e.type);yt(e.type)?(z!=null&&n(at()),s(`/${a}/ai-cfo/${e.type}`,{state:{pathnameStackToGoBack:A.slice(0,-1),message:l,referrer:"Sidebar"}})):s(`../${a}/${va}`,{state:{pathnameStackToGoBack:A,message:l,referrer:"Sidebar"}})},onDeleteChatSession:e=>{n(Ka(e)),z===e&&q(e)},handleLogOutClick:()=>{T(!1);const e=p(t.state?.pathnameStackToGoBack,t.pathname);s("/signout",{replace:!0,state:{pathnameStackToGoBack:e,message:"logout"}})},handleMyProfileClick:()=>{s(`${a}/settings/my_profile`)},handleReferralsClick:()=>{s(`${a}/rewards/refer`)},handleBackClick:()=>{s(`${a}/dashboard`)},handleCockpitClick:()=>{window.open("/cockpit")},monthEndCloseChecksView:I,onPeriodChange:Sa,onCalendarOpen:Ge,aiCfoView:O,isAiCfo:Ea,isOnDashboard:M,isTaskManagerAccessEnabled:_,updateCurrentChatSessionId:e=>{n(Ja({sessionId:e,agentId:"controller"})),s(`../${a}/ai-cfo/${e}`,{state:{...t.state}})},halloweenAnimationEnabled:Qe,thanksGivingAnimationEnabled:Xe,christmasAnimationEnabled:ea,newYearAnimationEnabled:aa}),wa=d.jsx(_t,{position:"fixed",className:c.appBar,style:{borderBottom:Re?`1px solid ${j.colors.grey2}`:""},children:d.jsxs(Dt,{style:{minHeight:wt},children:[d.jsx(Mt,{color:"inherit","aria-label":"open drawer",edge:"start",onClick:()=>T(!0),className:c.menuButton,size:"large",children:d.jsx(jt,{})}),d.jsx(Vt,{className:c.appBarZenilogo,onClick:()=>{te.toggle()}})]})}),Ee=_e((e=>e.breakpoints.up("md"))),Ia=_e((e=>e.breakpoints.down("md")));return a==null?null:d.jsxs(Zt,{className:c.root,children:[d.jsx(Ut,{}),Ye===!1?d.jsxs(d.Fragment,{children:[Ee||!M?null:wa,d.jsxs("nav",{className:c.drawer,children:[Ee?null:d.jsx(De,{container:window.document.body,variant:"temporary",open:H,onClose:()=>T(!1),PaperProps:{sx:{width:X,zIndex:Be[2],borderRight:"none",backgroundImage:"none",backgroundColor:j.colors.background}},ModalProps:{keepMounted:!0},children:ke}),Ia?null:d.jsx(De,{PaperProps:{sx:{width:X,borderRight:"none",backgroundImage:"none",backgroundColor:j.colors.background,...ka}},variant:"permanent",open:!0,children:ke})]})]}):null]})})),r1=({tenantEmailDomain:a})=>{const C=Me(),b=r((x=>Ue(x))),H={events:b.userRoleId!=null?[`private-encrypted-${b.userRoleId}.dashboard-user-notification`]:[],eventCallback:(x,S)=>{nt(S)&&Ba(S.mode)==="dashboard"&&C(Fe({unreadCount:S.data.unread},"tasks"))}};return d.jsx(Ht,{tenantEmailDomain:a,...H})},jt=ee((a=>o.createElement("svg",{viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",...a},o.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M0.604839 4.51889C0.333157 4.57797 0.0879194 4.8318 0.0182541 5.12602C-0.00534674 5.22569 -0.00534674 5.4412 0.0182541 5.54086C0.0523791 5.685 0.117181 5.80198 0.22956 5.92229C0.346814 6.04782 0.459133 6.11627 0.600351 6.14826C0.726193 6.17676 23.2738 6.17676 23.3997 6.14826C23.5409 6.11627 23.6532 6.04782 23.7704 5.92229C23.9348 5.74632 24 5.57908 24 5.33344C24 5.1793 23.9797 5.08352 23.9199 4.95575C23.8455 4.79698 23.6879 4.63709 23.5343 4.56468C23.3857 4.49468 24.2116 4.49926 11.9899 4.50058C2.66632 4.50157 0.669677 4.50479 0.604839 4.51889ZM0.669895 11.1732C0.365117 11.2113 0.0889356 11.4752 0.0182179 11.7958C-0.00468131 11.8996 -0.00469357 12.0996 0.0181935 12.2034C0.0806855 12.4867 0.305734 12.7294 0.581516 12.8108C0.65573 12.8327 1.1761 12.8337 12 12.8337C22.8591 12.8337 23.3441 12.8327 23.4192 12.8106C23.6933 12.7297 23.9196 12.4855 23.9818 12.2034C24.0047 12.0996 24.0047 11.8997 23.9818 11.7959C23.9201 11.516 23.7014 11.2776 23.425 11.1888C23.3558 11.1665 22.8817 11.1655 12.0544 11.164C5.84032 11.1631 0.717278 11.1672 0.669895 11.1732ZM0.594774 17.8516C0.458952 17.8831 0.344939 17.9535 0.22956 18.077C0.0652015 18.253 0 18.4202 0 18.6659C0 18.82 0.0203225 18.9158 0.0801289 19.0435C0.154452 19.2023 0.312097 19.3622 0.465726 19.4346C0.614214 19.5046 -0.209758 19.4999 12 19.4999C21.8294 19.4999 23.3082 19.4975 23.3881 19.4811C23.6596 19.4256 23.9122 19.1669 23.9817 18.8733C24.0053 18.7736 24.0053 18.5581 23.9817 18.4584C23.9476 18.3143 23.8828 18.1973 23.7704 18.077C23.6532 17.9515 23.5409 17.883 23.3997 17.851C23.2779 17.8235 0.713601 17.824 0.594774 17.8516Z",fill:"currentColor"}))))`
|
|
1
|
+
import{j as d}from"./liveblocks-CQOAuUNI.js";import{a as o,R as ya}from"./sentry-pp_6zWNc.js";import{u as Me,j as r,g as Ta,h as $a,q as R}from"./core-D07hD3KT.js";import{fI as Ue,U8 as Ba,U9 as Fe,gc as xa,gy as J,Ua as K,jH as Ie,jf as ve,Ub as Aa,Uc as _a,gR as Da,q2 as Ma,Ud as Ua,Ue as ye,gp as Fa,Uf as $,fH as Ga,gw as Ra,Ug as Za,Uh as Ha,Ui as ja,Uj as Te,Uk as Va,Ul as $e,Um as Na,Ei as Pa,gq as La,h4 as Oa,cW as qa,Un as za,Uo as Ya,qF as Wa,gb as Ja,j9 as Ka,Up as Qa,Uq as Xa,wC as et,gr as at}from"./zeni-epic-state-B3TABHgO.js";import{w as tt,i as nt,a as ot,D as st,E as rt,H as it,y as m,c as lt,u as dt,d as ct,e as ut,f as mt,g as Ct,s as pt,h as ht,j as ft,z as gt,k as Z,p,m as Be,l as bt,n as St,o as xe,q as kt,r as Ae,v as Et,x as wt,A as X,B as Q,C as It,F as vt,I as yt,L as Tt,J as $t,K as Bt,M as ee,N as xt,O as At}from"./index-B1xlAtau.js";import{A as _t,b as Dt,I as Mt,a as _e,d as Ut,D as De}from"./mui-XiTT8YBC.js";import{u as Ft}from"./InboxNotificationsProvider-CH-l5W7V.js";import{u as Gt}from"./useTaskManagerAccess-Y5qsn5_D.js";import{u as Rt}from"./expenseAutomationHelper-CL7YOVzM.js";import"./recharts-CgYqsGTH.js";import"./analytics-DlzSqyvZ.js";import"./plaid-BG3pJamN.js";import"./dnd-B-KpYfWT.js";import"./stripe-cKAAJElX.js";import"./lottie-BIKpYE12.js";import"./lexical-NIxvAmS2.js";import"./pdf-Dli3mGO_.js";import"./utils-CrOdvv6w.js";(function(){try{var a=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},C=new a.Error().stack;C&&(a._sentryDebugIds=a._sentryDebugIds||{},a._sentryDebugIds[C]="fb34f77b-9ad7-49c1-9531-2b5e89bfa30f",a._sentryDebugIdIdentifier="sentry-dbid-fb34f77b-9ad7-49c1-9531-2b5e89bfa30f")}catch{}})();const B="AppDrawer",c={root:`${B}-root`,drawer:`${B}-drawer`,appBar:`${B}-appBar`,menuButton:`${B}-menuButton`,appBarZenilogo:`${B}-appBarZenilogo`,drawerZenilogo:`${B}-drawerZenilogo`},Zt=ee("div",{slot:"Root"})((({theme:a})=>({[`&.${c.root}`]:{display:"flex"},[`& .${c.drawer}`]:{[a.breakpoints.up("md")]:{width:X,flexShrink:0,backgroundColor:a.colors.background}},[`& .${c.appBar}`]:{color:a.colors.primary,backgroundColor:a.colors.background,boxShadow:"none"},"& .MuiToolbar-root":{backgroundColor:a.colors.background},[`& .${c.menuButton}`]:{marginRight:a.spacing(2),[a.breakpoints.up("md")]:{display:"none"}},[`& .${c.appBarZenilogo}`]:{fill:a.colors.primary,cursor:"pointer",width:"100%",marginLeft:a.spacing(-6)},[`& .${c.drawerZenilogo}`]:{margin:`${a.spacing(3)} ${a.spacing(3)} ${a.spacing(0)}`,fill:a.colors.primary,cursor:"pointer"}}))),Ht=tt((function({tenantEmailDomain:a}){const{isAiCfoOpen:C,setIsAiCfoOpen:b}=ot(),[H,A]=ya.useState(!1),[S,Ge]=o.useState(!1),t=Ta(),s=$a(),ae=xa(),te=st(),n=Me(),[Re,Ze]=o.useState(!1),j=rt(),ne=t.pathname.includes("/ai-cfo/");o.useEffect((()=>{ne||(n(J()),n(K()))}),[n,ne]),o.useEffect((()=>{n(J()),n(K())}),[n,a]);const{useFeatureGate:u}=it(),{isFeatureEnabled:oe}=u(m.isDebitCardFeatureEnabled),k=lt(),i=r((e=>Ue(e))),V=i.masterTOSInfo?.isMasterTOSAccepted??!1,{setLoading:He}=dt(),E=ct(),{isTaskManagerAccessEnabled:_,isZeniUser:je}=Gt(k),se=ut(),w=mt();o.useEffect((()=>{w&&E&&(n(Ie()),n(ve()))}),[n,w,i.tenantId,E]);const[N,Ve]=o.useState(void 0),Ne=!!i.company?.companyZeniAccountInfo?.isZeniAccountEnabled,{isFeatureEnabled:Pe}=u(m.isChargeCardFeatureEnabled),Le=Ct(i,Pe,oe),{isFeatureEnabled:Oe}=u(m.isSettingsFeatureEnabled),{isFeatureEnabled:D}=u(m.isReferralFeatureEnabled),qe=i.companyTreasuryInfo?.info?.businessVerificationStatus?.code==="verified",re=r((e=>Aa(e)));o.useEffect((()=>{const e=()=>{Ze(window.scrollY>10)};return window.addEventListener("scroll",e),()=>{window.removeEventListener("scroll",e)}}),[]);const P=r((e=>_a(e))),h=r((e=>e.expenseAutomationViewState.selectedPeriodByTenantId)),f=r((e=>Da(e))),{monthEndCloseChecksView:I}=f,ze=R("/signout")!==null,M=R("/:tenantEmailDomain/dashboard")!==null,ie=R("/:tenantEmailDomain/reports")!==null,g=R("/:tenantEmailDomain/onboarding/*")!==null,le=Rt();o.useEffect((()=>{w&&D&&!g&&P.fetchState==="Not-Started"&&n(Ma(!0))}),[w,D,P.fetchState,g]),o.useEffect((()=>{if(le){const e=t.state?.origin;if(e!=null){const l=Ua(e);l!=null&&n(ye(l))}}}),[le,t.state]);const Ye=ze||g,L=r((e=>e.tenantState)),We=r((e=>L.fetchState==="Completed"?Fa(e):[])),{isFeatureEnabled:Je}=u(m.isApAgingFeatureEnabled),{isFeatureEnabled:Ke}=u(m.isArAgingFeatureEnabled),{isFeatureEnabled:Qe}=u(m.isDashboardSidebarHalloweenAnimationEnabled),{isFeatureEnabled:Xe}=u(m.isDashboardSidebarThanksGivingAnimationEnabled),{isFeatureEnabled:ea}=u(m.isDashboardSidebarChristmasAnimationEnabled),{isFeatureEnabled:aa}=u(m.isDashboardSidebarNewYearAnimationEnabled),ta=r((e=>$(e).totalUnreadCount)),na=r((e=>$(e).notificationDetailsByTab.tasks.uiState.unreadCount)),oa=r((e=>$(e).notificationDetailsByTab.comments.uiState.unreadCount)),sa=r((e=>$(e).reducedFetchCountState)),de=r((e=>$(e).notificationDetailsByTab.tasks.fetchCountState)),O=r((e=>Ga(e))),ra=r((e=>Ra(e).skillsEnabled)),ia=r((e=>Za(e))),ce=r((e=>Ha(e).routines)),la=o.useMemo((()=>ce.filter((e=>e.sessionId!=null)).map((e=>({cadence:pt(e),name:e.name,scheduleId:e.scheduleId,sessionId:e.sessionId,unreadRuns:e.unreadRuns})))),[ce]),da=new URLSearchParams(t.search).get("routine")??ht(t.pathname.split("/ai-cfo/")[1])??void 0,ca=o.useCallback(((e,l)=>{s(l!=null&&l!==""?`/${a}/ai-cfo/${encodeURIComponent(l)}`:`/${a}/ai-cfo/routines?routine=${encodeURIComponent(e)}`)}),[s,a]),{status:ue}=r(ja),[v,q]=o.useState(void 0),z=O.uiState.currentChatSessionId,U=v!=null?O.deleteChatSessionStateByChatSessionId[v]?.fetchState:void 0,me=ft(U),{inboxNotifications:Y,isLoading:Ce,isFetchingMore:pe,hasFetchedAll:he,fetchMore:ua}=Ft(),F=r((e=>$(e).notificationDetailsByTab.comments.fetchCountState));o.useEffect((()=>{const e=setTimeout((()=>ua?.()),0);return()=>clearTimeout(e)})),o.useEffect((()=>{if(v!=null)return me==="In-Progress"&&U==="Completed"?(n(Te({chatSessionId:v})),q(void 0),void s(`/${a}/ai-cfo/explore`,{state:{...t.state,referrer:"Sidebar"}})):void(U==="Error"&&(n(Te({chatSessionId:v})),q(void 0)))}),[n,t.state,s,U,v,me,a]),o.useEffect((()=>{if(Ce===!1&&pe===!1&&he===!0&&i?.companyId!=null&&Y!=null){const e=`dashboard_${i.companyId}`;Ve(Y.filter((l=>l.roomId===e&&l.readAt==null)).length)}}),[Ce,pe,he,i?.companyId,Y]),o.useEffect((()=>{w&&_&&!g&&de.fetchState==="Not-Started"&&ae.tenantId!=null&&n(Va("task_manager","dashboard"))}),[w,_,g,de.fetchState,ae.tenantId,n]),o.useEffect((()=>{g||F.fetchState!=="Not-Started"||n($e({fetchCountState:{fetchState:"In-Progress",error:void 0}},"comments"))}),[g,F.fetchState,n]),o.useEffect((()=>{if(N!=null){const{fetchState:e}=F;e!=="In-Progress"&&e!=="Completed"||(e==="In-Progress"&&n($e({fetchCountState:{fetchState:"Completed",error:void 0}},"comments")),n(Fe({unreadCount:N},"comments")))}}),[N,F.fetchState]);const ma={fetchStatus:sa,count:ta},y=[];Je===!1&&y.push("accounts_payable_aging"),Ke===!1&&y.push("accounts_receivable_aging"),y.push("zeni_accounts_promo_card","treasury_promo_card"),D===!1&&y.push("rewards_card"),se===!1&&y.push("expense_automation_card");const fe=r((e=>Na(e,y).fetchState)),ge=r((e=>Pa(e).fetchState)),be=a!=null?gt.getSignedInUserTenant(a):null,Se=r((e=>be?.tenantId!=null?La(e,be.tenantId):void 0)),Ca=M&&(fe==="Completed"||fe==="Error")||ie&&(ge==="Completed"||ge==="Error")||!M&&!ie?void 0:"disabled",pa=o.useMemo((()=>Oa(i.userRole)),[i.userRole]),ha=qa(pa),T=e=>{A(e)},fa=qe,ga=i?.rewardsLastViewedTime==null,ba=k?.userEmail!=null&&re.fetchState==="Completed"&&za(re.notificationSettings,k.userEmail,oe,i,_),Sa=o.useCallback((e=>{const l=t.state?.referrer;if(I.monthEndCloseChecks?.auditSummary!=null&&Z.trackMonthCloseAuditPage(e.month,e.year,I.monthEndCloseChecks.reportEmailSentDate!=null?"closed":"in-review",I.monthEndCloseChecks.auditSummary.auditScorePercentage,!1,l??null),n(Ya(i.tenantId,e)),h[i.tenantId]!=null){const x=p(t.state?.pathnameStackToGoBack,t.pathname);s(`/${a}/month_end_close_checks/review/${f.currentSelectedView}/${e.month}-${e.year}`,{state:{pathnameStackToGoBack:x,referrer:f.currentSelectedView}})}n(ye(f.currentSelectedView)),f.reconciliation.selectedAccountId!=null&&n(Wa({selectedAccountId:void 0}))}),[f.reconciliation.selectedAccountId,f.currentSelectedView,i.tenantId,I.monthEndCloseChecks?.auditSummary,I.monthEndCloseChecks?.reportEmailSentDate,h,a,t.state,t.pathname]),ka=o.useMemo((()=>({zIndex:S?12:Be[2]})),[S]),Ea=E&&bt(t),ke=d.jsx(St,{signedInUser:k,currentTenantId:L.currentTenantId??"",tenants:L.fetchState==="Completed"?We:Se!=null?[Se]:[],rewardsConfiguration:{isRewardsTabVisible:D,isRewardsAnimated:ga,rewardsPlan:P.rewardsPlan},selectedMenu:C===!0?Ae("ai_cfo"):xe(t)&&ue!=="completed"?Ae("invoicing"):Et(t),isTenantDropdownDisabled:Ca,isSettings:kt(t),isInvoicing:xe(t)&&ue==="completed",isSettingsFeatureEnabled:Oe,currentTenant:i,isVendorsTabVisible:ha,isZeniAccountEnabled:Ne,isChargeCardEnabled:Le,isTreasuryEnabled:fa,isNotificationsTabVisible:ba,notificationCountDetails:ma,isExpenseAutomationEnabledForUser:se,isAiCfoAccessEnabled:E,skillsEnabled:ra&&E,routinesEnabled:ia===!0&&E,routines:la,selectedRoutineId:da,onRoutineSelect:ca,onNotificationIconClick:()=>{T(!1);const e=je?na===0&&oa>0?"notifications/comments":"notifications/tasks":"notifications/comments",l=p(t.state?.pathnameStackToGoBack,t.pathname);s(`${a}/${e}`,{state:{pathnameStackToGoBack:l}})},onZeniLogoClick:()=>{te.toggle()},handleTenantSelect:e=>{He(Tt.TENANT_SWITCHING),T(!1),$t({dispatch:n,navigate:s,pathToNavigate:Bt(e.tenantEmailDomain,t),selectedTenant:e,signedInUser:k})},handleMenuChange:(e,l)=>{if(k!=null&&Z.trackSidePanelClicked(e.type,e.group),T(!1),a==null)return;if(e.type==="routines")return V?(n(ve()),n(Qa()),void s(`/${a}/ai-cfo/routines`,{state:{pathnameStackToGoBack:p(t.state?.pathnameStackToGoBack,t.pathname),referrer:"Sidebar"}})):void Q({location:t,navigate:s,mergeState:{referrer:"Sidebar"}});if(e.type==="skills")return V?(n(Ie()),n(Xa()),void s(`/${a}/ai-cfo/skills`,{state:{pathnameStackToGoBack:p(t.state?.pathnameStackToGoBack,t.pathname),referrer:"Sidebar"}})):void Q({location:t,navigate:s,mergeState:{referrer:"Sidebar"}});if(n(J()),n(K()),e.type==="invoicing")return C&&b(!1),n(et({cacheOverride:!1})),void s(`../${a}/invoicing/overview`,{state:{pathnameStackToGoBack:p(t.state?.pathnameStackToGoBack,t.pathname),referrer:"Sidebar"}});if(C&&It(e.type)&&b(!1),e.type==="ai_cfo"){if(Z.trackAICFOChatScreenStateChanged("viewed","left_menu",z??null,null),!V)return void Q({location:t,navigate:s,mergeState:{referrer:"Sidebar"}});const G=p(t.state?.pathnameStackToGoBack,t.pathname);return void s(`/${a}/ai-cfo/explore`,{state:{pathnameStackToGoBack:G,referrer:"Sidebar"}})}const x=p(t.state?.pathnameStackToGoBack,t.pathname),W=e.type,we=At(W)&&W!=="command_center";if(W!=="command_center"&&!we||h[i.tenantId]==null||Z.trackMonthEndCloseClicked(h[i.tenantId].month,h[i.tenantId].year,"Sidebar"),we&&h[i.tenantId]!=null){const G=h[i.tenantId];return void s(`/${a}/month_end_close_checks/review/${e.type}/${G.month}-${G.year}`,{state:{pathnameStackToGoBack:x,message:l,referrer:"Sidebar"}})}const va=vt(e.type);yt(e.type)?(z!=null&&n(at()),s(`/${a}/ai-cfo/${e.type}`,{state:{pathnameStackToGoBack:x.slice(0,-1),message:l,referrer:"Sidebar"}})):s(`../${a}/${va}`,{state:{pathnameStackToGoBack:x,message:l,referrer:"Sidebar"}})},onDeleteChatSession:e=>{n(Ka(e)),z===e&&q(e)},handleLogOutClick:()=>{T(!1);const e=p(t.state?.pathnameStackToGoBack,t.pathname);s("/signout",{replace:!0,state:{pathnameStackToGoBack:e,message:"logout"}})},handleMyProfileClick:()=>{s(`${a}/settings/my_profile`)},handleReferralsClick:()=>{s(`${a}/rewards/refer`)},handleBackClick:()=>{s(`${a}/dashboard`)},handleCockpitClick:()=>{window.open("/cockpit")},monthEndCloseChecksView:I,onPeriodChange:Sa,onCalendarOpen:Ge,aiCfoView:O,isAiCfo:Ea,isOnDashboard:M,isTaskManagerAccessEnabled:_,updateCurrentChatSessionId:e=>{n(Ja({sessionId:e,agentId:"controller"})),s(`../${a}/ai-cfo/${e}`,{state:{...t.state}})},halloweenAnimationEnabled:Qe,thanksGivingAnimationEnabled:Xe,christmasAnimationEnabled:ea,newYearAnimationEnabled:aa}),wa=d.jsx(_t,{position:"fixed",className:c.appBar,style:{borderBottom:Re?`1px solid ${j.colors.grey2}`:""},children:d.jsxs(Dt,{style:{minHeight:wt},children:[d.jsx(Mt,{color:"inherit","aria-label":"open drawer",edge:"start",onClick:()=>T(!0),className:c.menuButton,size:"large",children:d.jsx(jt,{})}),d.jsx(Vt,{className:c.appBarZenilogo,onClick:()=>{te.toggle()}})]})}),Ee=_e((e=>e.breakpoints.up("md"))),Ia=_e((e=>e.breakpoints.down("md")));return a==null?null:d.jsxs(Zt,{className:c.root,children:[d.jsx(Ut,{}),Ye===!1?d.jsxs(d.Fragment,{children:[Ee||!M?null:wa,d.jsxs("nav",{className:c.drawer,children:[Ee?null:d.jsx(De,{container:window.document.body,variant:"temporary",open:H,onClose:()=>T(!1),PaperProps:{sx:{width:X,zIndex:Be[2],borderRight:"none",backgroundImage:"none",backgroundColor:j.colors.background}},ModalProps:{keepMounted:!0},children:ke}),Ia?null:d.jsx(De,{PaperProps:{sx:{width:X,borderRight:"none",backgroundImage:"none",backgroundColor:j.colors.background,...ka}},variant:"permanent",open:!0,children:ke})]})]}):null]})})),r1=({tenantEmailDomain:a})=>{const C=Me(),b=r((A=>Ue(A))),H={events:b.userRoleId!=null?[`private-encrypted-${b.userRoleId}.dashboard-user-notification`]:[],eventCallback:(A,S)=>{nt(S)&&Ba(S.mode)==="dashboard"&&C(Fe({unreadCount:S.data.unread},"tasks"))}};return d.jsx(Ht,{tenantEmailDomain:a,...H})},jt=ee((a=>o.createElement("svg",{viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",...a},o.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M0.604839 4.51889C0.333157 4.57797 0.0879194 4.8318 0.0182541 5.12602C-0.00534674 5.22569 -0.00534674 5.4412 0.0182541 5.54086C0.0523791 5.685 0.117181 5.80198 0.22956 5.92229C0.346814 6.04782 0.459133 6.11627 0.600351 6.14826C0.726193 6.17676 23.2738 6.17676 23.3997 6.14826C23.5409 6.11627 23.6532 6.04782 23.7704 5.92229C23.9348 5.74632 24 5.57908 24 5.33344C24 5.1793 23.9797 5.08352 23.9199 4.95575C23.8455 4.79698 23.6879 4.63709 23.5343 4.56468C23.3857 4.49468 24.2116 4.49926 11.9899 4.50058C2.66632 4.50157 0.669677 4.50479 0.604839 4.51889ZM0.669895 11.1732C0.365117 11.2113 0.0889356 11.4752 0.0182179 11.7958C-0.00468131 11.8996 -0.00469357 12.0996 0.0181935 12.2034C0.0806855 12.4867 0.305734 12.7294 0.581516 12.8108C0.65573 12.8327 1.1761 12.8337 12 12.8337C22.8591 12.8337 23.3441 12.8327 23.4192 12.8106C23.6933 12.7297 23.9196 12.4855 23.9818 12.2034C24.0047 12.0996 24.0047 11.8997 23.9818 11.7959C23.9201 11.516 23.7014 11.2776 23.425 11.1888C23.3558 11.1665 22.8817 11.1655 12.0544 11.164C5.84032 11.1631 0.717278 11.1672 0.669895 11.1732ZM0.594774 17.8516C0.458952 17.8831 0.344939 17.9535 0.22956 18.077C0.0652015 18.253 0 18.4202 0 18.6659C0 18.82 0.0203225 18.9158 0.0801289 19.0435C0.154452 19.2023 0.312097 19.3622 0.465726 19.4346C0.614214 19.5046 -0.209758 19.4999 12 19.4999C21.8294 19.4999 23.3082 19.4975 23.3881 19.4811C23.6596 19.4256 23.9122 19.1669 23.9817 18.8733C24.0053 18.7736 24.0053 18.5581 23.9817 18.4584C23.9476 18.3143 23.8828 18.1973 23.7704 18.077C23.6532 17.9515 23.5409 17.883 23.3997 17.851C23.2779 17.8235 0.713601 17.824 0.594774 17.8516Z",fill:"currentColor"}))))`
|
|
2
2
|
height: 20px;
|
|
3
3
|
width: 20px;
|
|
4
4
|
color: ${a=>a.theme.colors.primary};
|
|
5
5
|
`,Vt=ee((a=>o.createElement("svg",{viewBox:"0 0 102 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",...a},o.createElement("path",{d:"M73.4046 13.2609H57.77C58.0392 15.0844 58.8324 16.5249 60.352 17.5133C61.5784 18.3113 62.9424 18.5733 64.3842 18.407C64.8867 18.3484 65.3952 18.2539 65.8738 18.0935C67.1433 17.6676 68.0945 16.8923 68.4559 15.5031H73.2777C73.1629 16.3885 72.8877 17.1866 72.4845 17.938C71.4734 19.8189 69.9228 21.1159 67.9414 21.8302C64.3076 23.138 60.7875 22.9178 57.5642 20.6588C55.1293 18.9526 53.7318 16.5465 53.3034 13.6055C52.9959 11.4973 53.2065 9.43809 54.1374 7.49857C55.6988 4.2453 58.2761 2.29381 61.8273 1.67642C64.048 1.28995 66.2124 1.54361 68.2202 2.60969C71.2784 4.23333 73.0085 6.79743 73.4405 10.2314C73.5649 11.2161 73.5374 12.202 73.407 13.2621L73.4046 13.2609ZM68.3554 9.72765C68.3278 9.51706 68.3159 9.334 68.2788 9.15692C68.0622 8.12913 67.4915 7.32388 66.6767 6.68735C65.7697 5.97902 64.7264 5.68349 63.5825 5.62486C61.0543 5.49444 58.8289 7.02356 58.0918 9.44408C58.0655 9.52903 58.0595 9.62116 58.0416 9.72765H68.3566H68.3554Z",fill:"currentColor"}),o.createElement("path",{d:"M52.7423 17.86V21.9162C52.7423 22.0478 52.6346 22.1555 52.503 22.1555H34.5854C34.5854 22.1555 34.595 19.9659 34.5783 19.1008C34.5723 18.7861 34.662 18.5528 34.8786 18.3183C38.3664 14.535 41.8458 10.7445 45.3276 6.95397C45.452 6.81877 45.744 6.49093 45.744 6.49093H35.6396C35.5079 6.49093 35.4003 6.38324 35.4003 6.25163V2.14645C35.4003 2.01483 35.5079 1.90715 35.6396 1.90715H52.6334C52.6334 1.90715 52.6274 4.18288 52.6418 5.17239C52.6454 5.41767 52.5341 5.57321 52.3833 5.73713C50.1543 8.15884 41.5048 17.6219 41.5048 17.6219H52.5042C52.6358 17.6219 52.7435 17.7296 52.7435 17.8612L52.7423 17.86Z",fill:"currentColor"}),o.createElement("path",{d:"M94.0631 22.0758H89.7353C89.6037 22.0758 89.496 21.9694 89.496 21.8377C89.4925 20.5539 89.4733 14.3919 89.4769 11.3696C89.4769 10.6397 89.4195 9.92064 89.2041 9.21829C88.6142 7.29553 87.0528 6.12056 85.0367 6.07151C83.7122 6.0392 82.5288 6.37542 81.58 7.34578C80.8406 8.10196 80.4386 9.02686 80.2998 10.0642C80.2388 10.5213 80.2148 10.9879 80.2136 11.4498C80.2076 14.429 80.2088 20.5539 80.21 21.8365C80.21 21.9682 80.1023 22.0758 79.9707 22.0758H75.6047C75.4731 22.0758 75.3654 21.9705 75.3654 21.8389C75.3606 20.512 75.3403 13.9576 75.387 10.6349C75.4205 8.27546 76.1838 6.1433 77.78 4.36411C79.2062 2.77516 80.9973 1.84189 83.1056 1.52243C84.8441 1.258 86.5658 1.3286 88.2254 1.93642C91.4727 3.12454 93.3954 5.47924 94.093 8.83302C94.2557 9.61314 94.3072 10.4268 94.3131 11.226C94.3335 14.3321 94.3083 20.5503 94.3036 21.8401C94.3036 21.9717 94.1959 22.077 94.0643 22.077L94.0631 22.0758Z",fill:"currentColor"}),o.createElement("path",{d:"M97.2196 1.90527H101.482C101.613 1.90527 101.721 2.01176 101.721 2.14338L101.772 21.9035C101.772 22.0363 101.666 22.144 101.533 22.144H97.2256C97.094 22.144 96.9863 22.0363 96.9863 21.9047L96.9803 2.14457C96.9803 2.01296 97.088 1.90527 97.2196 1.90527Z",fill:"currentColor"}),o.createElement("path",{d:"M17.1795 0.0270299C16.9776 -0.0551712 16.7491 0.057251 16.6911 0.267589C16.6706 0.342537 16.6476 0.417486 16.6234 0.491225C16.4022 1.1573 16.0299 1.76655 15.5197 2.27789C14.6566 3.14221 13.5082 3.61971 12.2861 3.62091H12.2825C11.0627 3.62091 9.91435 3.14584 9.05124 2.28394C8.54111 1.77381 8.16636 1.16455 7.94394 0.499687C7.91976 0.425947 7.89679 0.350999 7.87503 0.276051C7.81701 0.0657128 7.58854 -0.0455005 7.38666 0.0367007C6.20321 0.522655 5.108 1.17906 4.13125 1.97447C4.00795 2.07481 3.96806 2.24525 4.02729 2.39273C4.07686 2.51603 4.13004 2.63813 4.18565 2.7578C4.62204 3.70916 5.22888 4.58557 5.99166 5.34714C7.67316 7.02501 9.90589 7.94977 12.2813 7.94977H12.2897C14.6675 7.94736 16.9027 7.01897 18.5829 5.33626C19.3445 4.57348 19.9489 3.69586 20.3841 2.7445C20.4397 2.62362 20.4917 2.50153 20.5413 2.37823C20.6005 2.23075 20.5606 2.0603 20.4373 1.95997C19.4594 1.16576 18.3629 0.511775 17.1795 0.0270299Z",fill:"#97C3B9"}),o.createElement("path",{d:"M20.3984 21.2422C19.962 20.2933 19.3564 19.4193 18.596 18.6602C16.9133 16.9799 14.6733 16.0527 12.2979 16.0575C8.71131 16.0611 5.61789 18.196 4.2108 21.2604C4.1564 21.38 4.10321 21.5009 4.05244 21.623C3.992 21.7705 4.03189 21.9422 4.1564 22.0437C5.13435 22.8367 6.22956 23.4895 7.41181 23.973C7.61369 24.0552 7.84095 23.944 7.90018 23.7337C7.92073 23.6575 7.9437 23.5838 7.96908 23.5088C8.57713 21.698 10.2876 20.3888 12.3016 20.3864H12.3064C13.5261 20.3864 14.6745 20.8615 15.5376 21.7234C16.0466 22.2311 16.4189 22.8379 16.6413 23.5004C16.6667 23.5741 16.6897 23.649 16.7102 23.724C16.7694 23.9343 16.9967 24.0455 17.1986 23.9621C18.382 23.4762 19.476 22.821 20.4528 22.0256C20.5761 21.9252 20.616 21.7536 20.5567 21.6061C20.5072 21.4828 20.454 21.3619 20.3984 21.241V21.2422Z",fill:"#97C3B9"}),o.createElement("path",{d:"M0.494416 9.85376C0.31309 9.85376 0.161985 9.98795 0.13539 10.1669C0.045936 10.7676 0 11.3829 0 12.0091C0 12.6401 0.0483536 13.2603 0.141434 13.8659C0.169238 14.0448 0.320343 14.1778 0.501669 14.1778L24.0934 14.1427C24.2747 14.1427 24.4258 14.0086 24.4524 13.8296C24.5419 13.2288 24.589 12.6135 24.5878 11.9862C24.5878 11.3551 24.5395 10.735 24.4464 10.1294C24.4186 9.95047 24.2675 9.8175 24.0862 9.8175L0.494416 9.85256V9.85376Z",fill:"#97C3B9"}))))`
|
|
6
|
-
height: ${
|
|
6
|
+
height: ${xt.sp4};
|
|
7
7
|
width: 102px;
|
|
8
8
|
color: ${a=>a.theme.colors.primary};
|
|
9
9
|
cursor: pointer;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{j as u}from"./liveblocks-gNIoHksP.js";import{a as d}from"./sentry-BzzHvh63.js";import{h as U,g as j,u as B,j as y,N as F,l as V,i as W,n as te,o as x}from"./core-_cqItzd_.js";import{fI as P,Z6 as w,YP as R,HR as E,HL as q,HP as A,HE as K,YR as Y,HI as ae,HT as oe,HH as Z,HW as z,HS as C}from"./zeni-epic-state-ClqSlu6d.js";import{z as T,w as J,bZ as pe,v as O,bT as G,b_ as le,E as M,a7 as Q,b$ as se,c0 as ne}from"./index-DVhAab8j.js";import"./mui-CDH3xRD_.js";import{u as X,i as re}from"./ReimbursementApprovalRuleDetailScreen-DN9la9Dm.js";import ie from"./NotFoundScreen-XQ69x1V9.js";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},l=new e.Error().stack;l&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[l]="24715bbb-5be9-473d-84f0-602414ddb7f8",e._sentryDebugIdIdentifier="sentry-dbid-24715bbb-5be9-473d-84f0-602414ddb7f8")}catch{}})();const k="bill-approval-rule-update",ce=V((function(e){return{approvalView:w(e),billPaySetupApproverViewUpdateData:R(e).billPaySetupApproverViewUpdateData}}),(function(e,l){const{navigate:t,location:o}=l;return{onApprovalRulesEventReceived:a=>{a.endsWith(k)&&e(Y(!1))},onBackClick:()=>{O(o)?t("../../"):t("../../../bills/setup")},onDeleteRuleClick:a=>{e(K(a,!1))},onEditRuleClick:a=>{a!=null?(e(A(a)),t(`./${a}/edit`)):(e(A()),t("./new"))}}}))(J(pe)),ue=({isLoading:e})=>{const l=U(),t=j(),o=B(),[a,n]=d.useState(!1),[s,v]=d.useState(!1),p=y((r=>r.billPaySetupApproverViewState.fetchState)),f=y((r=>P(r))),c=y((r=>w(r))),S=y((r=>R(r).billPaySetupApproverViewUpdateData));if(d.useEffect((()=>{S?.updateStatus.fetchState==="Completed"&&o(E())}),[S]),d.useEffect((()=>{a||p!=="Not-Started"||e||(n(!0),o(q(!0,!0,!1)))}),[a,p,e,o]),T.getSignedInUser()==null)throw Error("Can't access billpay approval without signing in...");d.useEffect((()=>{c.allApprovalRules.length===0&&c.fetchState==="Completed"&&(s||(v(!0),o(A())),l("./new"))}),[s,c,o]);const g={events:f.companyId!=null?[`private-encrypted-${f.companyId}.${k}`]:[],eventCallback:(r,h,b)=>{r.endsWith(k)&&b.onApprovalRulesEventReceived(r)}};return f?.companyBillPayInfo?.info?.isBillPayTOSAccepted===!1?u.jsx(F,{to:"../../promo"}):u.jsx(ce,{currentTenant:f,location:t,navigate:l,...g})},L="bill-approval-rule-update",de=V((function(e){const l=w(e),t=R(e).billPaySetupApproverViewUpdateData,o={};for(const n of Object.values(e.vendorState.vendorByID))n?.id!=null&&(o[n.id]=n.name);const a={};for(const n of Object.values(e.classState.classesByKey))n?.classId!=null&&(a[n.classId]=n.className);return{approvalView:l,billPaySetupApproverViewUpdateData:t,vendorNamesById:o,departmentNamesById:a}}),(function(e,l){const{navigate:t,location:o}=l;return{onApprovalRulesEventReceived:a=>{a.endsWith(L)&&e(Y(!1))},onBackClick:()=>{O(o)?t("../../"):t("../../../bills/setup")},onDeleteRuleClick:a=>{e(K(a,!0))},onEditRuleClick:a=>{a!=null?(e(A(a)),t(`./${a}/edit`)):(e(A()),t("./new"))},onReorderRules:a=>{e(oe(a,!0))}}}))(J(le)),ve=()=>{const e=y((o=>P(o))),{isApprovalRulesV3Enabled:l,isLoading:t}=G(e?.tenantId);return l?u.jsx(fe,{isLoading:t}):u.jsx(ue,{isLoading:t})},fe=({isLoading:e})=>{const l=U(),t=j(),o=B(),[a,n]=d.useState(!1),[s,v]=d.useState(!1),[p,f]=d.useState(!1),c=y((i=>i.billPaySetupApproverViewState.fetchState)),S=y((i=>i.billPaySetupApproverViewState.approverListState.fetchStatus.fetchState)),g=y((i=>P(i)));X();const r=y((i=>w(i))),h=y((i=>R(i).billPaySetupApproverViewUpdateData));if(d.useEffect((()=>{h?.updateStatus.fetchState==="Completed"&&o(E())}),[h]),d.useEffect((()=>{a||c!=="Not-Started"||e||(n(!0),o(q(!0,!0,!0)))}),[a,c,e,o]),d.useEffect((()=>{s||S!=="Not-Started"||e||(v(!0),o(ae(!1,!0)))}),[s,S,e,o]),T.getSignedInUser()==null)throw Error("Can't access billpay approval without signing in...");d.useEffect((()=>{r.allApprovalRules.length===0&&r.fetchState==="Completed"&&(p||(f(!0),o(A())),l("./new"))}),[p,r,o]);const b={events:g.companyId!=null?[`private-encrypted-${g.companyId}.${L}`]:[],eventCallback:(i,I,m)=>{i.endsWith(L)&&m.onApprovalRulesEventReceived(i)}};return g?.companyBillPayInfo?.info?.isBillPayTOSAccepted===!1?u.jsx(F,{to:"../../promo"}):u.jsx(de,{currentTenant:g,location:t,navigate:l,isLoading:e,...b})},ye=V((function(e,l){const t=R(e),o=t.billPaySetupApproverViewUpdateData?.type??"approval_create",a=o==="approval_create"&&t.allApprovalRules.length!==0;let n=t.allApprovalRules.length===0;return l.approvalRuleId&&(n=t.allApprovalRules.findIndex((s=>s.approvalRuleId===l.approvalRuleId))===0),{localData:t,hideUpperBoundField:a,isLowerBoundDisabled:n,approvalUpdateActionType:o}}),(function(e,l){const{navigate:t,approvalUpdateDataView:o,approverViewData:a,approvalRuleId:n}=l,s=o.billPaySetupApproverViewUpdateData?.type,v=O(l.location);return{onApprovalRuleDataUpdated:p=>{const f=S=>{const g=[];return S.forEach((r=>{const h=r.actors.selectedUsers.map((I=>({type:"user",userId:I.userId,isImplicitActor:!1}))),b=r.actors.selectedNonUsers.map((I=>{const m=!!re(I.value);return{type:m?"attribute":"role",subType:I.value,userId:void 0,idType:void 0,isImplicitActor:!m}})),i=h.concat(b);g.push({action:r.stepType.selectedOption,actors:i,operator:i.length>1?r.stepType.selectedOption==="require_approval"?"or":"and":"is"})})),g},c={amount:{type:"amount",comparator:"range",min:{amount:p.lowerBound,currencyCode:"USD",currencySymbol:"$"},max:{amount:p.upperBound,currencyCode:"USD",currencySymbol:"$"}}};if(s==="approval_create"){const S={criteria:c,steps:f(p.steps),isApplicableOnPendingApprovalEntity:p.applyToExistingBills.includes("applyToExistingBills")};e(C(S))}else{const S={approvalRuleId:n,criteria:c,steps:f(p.steps),isApplicableOnPendingApprovalEntity:p.applyToExistingBills.includes("applyToExistingBills")};e(C(S))}},onResetClick:()=>{e(E()),s==="approval_update"||v?t("../"):a.allApprovalRules.length===0&&a.fetchState==="Completed"?t("../../setup"):t("../")},onBackClick:()=>{e(E()),s==="approval_update"||v?t("../"):a.allApprovalRules.length===0&&a.fetchState==="Completed"?t("../../setup"):t("../")},onSaveRuleClick:()=>{e(z(!1))},onSaveRuleSuccess:()=>{t("../")}}}))(se);function Se(){const e=U(),l=B(),t=j(),{approvalRuleId:o}=W(),a=T.getSignedInUser(),n=M(),s=y((c=>R(c))),v=y((c=>w(c))),[p,f]=d.useState(!1);if(d.useEffect((()=>{p||(f(!0),l(Z(!0)))})),d.useEffect((()=>{v.fetchState==="Not-Started"&&e(o!=null?"../../":"../")}),[v,o]),a==null)throw Error("Can't access address page without signing in...");return s.approverListFetchStatus.fetchState=="Not-Started"||s.approverListFetchStatus.fetchState==="In-Progress"?u.jsx(Q,{fetchState:s.approverListFetchStatus.fetchState,style:{backgroundColor:n.colors.grey5}}):u.jsx(ye,{navigate:e,approvalUpdateDataView:s,approvalRuleId:o,approverViewData:v,location:t})}const ge=V((function(e,l){const t=R(e),o=t.billPaySetupApproverViewUpdateData?.type??"approval_create",a=[],n={};for(const s of Object.values(e.vendorState.vendorByID))s?.id!=null&&(a.push(s.id),n[s.id]=s.name);return{localData:t,approvalUpdateActionType:o,allVendorIds:a,vendorNamesById:n,editingRuleId:o==="approval_update"?l.approvalRuleId:void 0,allApprovalRulesWithUser:w(e).allApprovalRules}}),(function(e,l){const{navigate:t,approvalUpdateDataView:o,approverViewData:a,approvalRuleId:n}=l,s=o.billPaySetupApproverViewUpdateData?.type,v=O(l.location);return{onApprovalRuleDataUpdated:p=>{const f=i=>{const I=[];return i.forEach((m=>{const N=m.actorKind?.selectedOption,ee=m.selectedRole?.selectedNonUsers??[];let D=[];N==="role"?D=ee.map((_=>({type:"attribute",subType:_.value,userId:void 0,idType:void 0,isImplicitActor:!1}))):N==="specific_person"&&(D=(m.persons?.selectedUsers??[]).map((_=>({type:"user",userId:_.userId,isImplicitActor:!1}))));const $=m.action??"require_approval";I.push({action:$,actors:D,operator:D.length>1?$==="require_approval"?"or":"and":"is"})})),I},c=p.amountCriteria,S=p.vendorCriteria,g=p.departmentCriteria,r={};if(c!=null&&c.comparator.selectedOption!=null){const i=c.comparator.selectedOption;r.amount={type:"amount",comparator:i,min:i==="less_than"?void 0:c.min,max:i==="greater_than"?void 0:c.max}}const h=S?.selection.selectedOptions??[];h.length>0&&(r.vendor={type:"vendor",operator:S?.operator.selectedOption??"is",vendorIds:h});const b=g?.selection.selectedOptions??[];if(b.length>0&&(r.department={type:"department",operator:g?.operator.selectedOption??"is",departmentIds:b}),s==="approval_create"){const i={name:p.name,description:p.description,separationOfDuties:p.separationOfDuties,criteria:r,steps:f(p.steps),isApplicableOnPendingApprovalEntity:p.applyToExistingBills.includes("applyToExistingBills")};e(C(i))}else{const i={approvalRuleId:n,name:p.name,description:p.description,separationOfDuties:p.separationOfDuties,criteria:r,steps:f(p.steps),isApplicableOnPendingApprovalEntity:p.applyToExistingBills.includes("applyToExistingBills")};e(C(i))}},onResetClick:()=>{e(E()),s==="approval_update"||v?t("../"):a.allApprovalRules.length===0&&a.fetchState==="Completed"?t("../../setup"):t("../")},onBackClick:()=>{e(E()),s==="approval_update"||v?t("../"):a.allApprovalRules.length===0&&a.fetchState==="Completed"?t("../../setup"):t("../")},onSaveRuleClick:()=>{e(z(!0))},onSaveRuleSuccess:()=>{t("../")},onEditExistingRule:p=>{e(A(p)),t(s==="approval_update"?`../../${p}/edit`:`../${p}/edit`)}}}))(ne);function H(){const e=y((t=>P(t))),{isApprovalRulesV3Enabled:l}=G(e?.tenantId);return l?u.jsx(me,{}):u.jsx(Se,{})}function me(){const e=U(),l=B(),t=j(),{approvalRuleId:o}=W(),a=T.getSignedInUser(),n=M(),s=y((c=>R(c))),v=y((c=>w(c))),[p,f]=d.useState(!1);if(X(),d.useEffect((()=>{p||(f(!0),l(Z(!1)))})),d.useEffect((()=>{v.fetchState==="Not-Started"&&e(o!=null?"../../":"../")}),[v,o]),a==null)throw Error("Can't access address page without signing in...");return s.approverListFetchStatus.fetchState=="Not-Started"||s.approverListFetchStatus.fetchState==="In-Progress"?u.jsx(Q,{fetchState:s.approverListFetchStatus.fetchState,style:{backgroundColor:n.colors.grey5}}):u.jsx(ge,{navigate:e,approvalUpdateDataView:s,approvalRuleId:o,approverViewData:v,location:t},o??"new")}function xe(){return u.jsxs(te,{children:[u.jsx(x,{path:"/",element:u.jsx(ve,{})}),u.jsx(x,{path:"/new",element:u.jsx(H,{})}),u.jsx(x,{path:"/:approvalRuleId/edit",element:u.jsx(H,{})}),u.jsx(x,{path:"*",element:u.jsx(ie,{})})]})}export{xe as B};
|
|
1
|
+
import{j as u}from"./liveblocks-CQOAuUNI.js";import{a as d}from"./sentry-pp_6zWNc.js";import{h as U,g as j,u as B,j as y,N as F,l as V,i as W,n as te,o as x}from"./core-D07hD3KT.js";import{fI as T,Za as w,YT as R,HS as E,HM as q,HQ as A,HF as K,YV as Y,HJ as ae,HU as oe,HI as Z,HX as z,HT as C}from"./zeni-epic-state-B3TABHgO.js";import{z as P,w as J,bZ as pe,q as O,bT as M,b_ as le,E as Q,a7 as X,b$ as se,c0 as ne}from"./index-B1xlAtau.js";import"./mui-XiTT8YBC.js";import{u as G,i as re}from"./ReimbursementApprovalRuleDetailScreen-DulfuoGj.js";import ie from"./NotFoundScreen-DnqoRCYC.js";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},l=new e.Error().stack;l&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[l]="87c3e8e0-a642-4c5a-a7f1-f66f62a0af7a",e._sentryDebugIdIdentifier="sentry-dbid-87c3e8e0-a642-4c5a-a7f1-f66f62a0af7a")}catch{}})();const k="bill-approval-rule-update",ce=V((function(e){return{approvalView:w(e),billPaySetupApproverViewUpdateData:R(e).billPaySetupApproverViewUpdateData}}),(function(e,l){const{navigate:t,location:o}=l;return{onApprovalRulesEventReceived:a=>{a.endsWith(k)&&e(Y(!1))},onBackClick:()=>{O(o)?t("../../"):t("../../../bills/setup")},onDeleteRuleClick:a=>{e(K(a,!1))},onEditRuleClick:a=>{a!=null?(e(A(a)),t(`./${a}/edit`)):(e(A()),t("./new"))}}}))(J(pe)),ue=({isLoading:e})=>{const l=U(),t=j(),o=B(),[a,n]=d.useState(!1),[s,v]=d.useState(!1),p=y((r=>r.billPaySetupApproverViewState.fetchState)),f=y((r=>T(r))),c=y((r=>w(r))),S=y((r=>R(r).billPaySetupApproverViewUpdateData));if(d.useEffect((()=>{S?.updateStatus.fetchState==="Completed"&&o(E())}),[S]),d.useEffect((()=>{a||p!=="Not-Started"||e||(n(!0),o(q(!0,!0,!1)))}),[a,p,e,o]),P.getSignedInUser()==null)throw Error("Can't access billpay approval without signing in...");d.useEffect((()=>{c.allApprovalRules.length===0&&c.fetchState==="Completed"&&(s||(v(!0),o(A())),l("./new"))}),[s,c,o]);const g={events:f.companyId!=null?[`private-encrypted-${f.companyId}.${k}`]:[],eventCallback:(r,h,I)=>{r.endsWith(k)&&I.onApprovalRulesEventReceived(r)}};return f?.companyBillPayInfo?.info?.isBillPayTOSAccepted===!1?u.jsx(F,{to:"../../promo"}):u.jsx(ce,{currentTenant:f,location:t,navigate:l,...g})},L="bill-approval-rule-update",de=V((function(e){const l=w(e),t=R(e).billPaySetupApproverViewUpdateData,o={};for(const n of Object.values(e.vendorState.vendorByID))n?.id!=null&&(o[n.id]=n.name);const a={};for(const n of Object.values(e.classState.classesByKey))n?.classId!=null&&(a[n.classId]=n.className);return{approvalView:l,billPaySetupApproverViewUpdateData:t,vendorNamesById:o,departmentNamesById:a}}),(function(e,l){const{navigate:t,location:o}=l;return{onApprovalRulesEventReceived:a=>{a.endsWith(L)&&e(Y(!1))},onBackClick:()=>{O(o)?t("../../"):t("../../../bills/setup")},onDeleteRuleClick:a=>{e(K(a,!0))},onEditRuleClick:a=>{a!=null?(e(A(a)),t(`./${a}/edit`)):(e(A()),t("./new"))},onReorderRules:a=>{e(oe(a,!0))}}}))(J(le)),ve=()=>{const e=y((o=>T(o))),{isApprovalRulesV3Enabled:l,isLoading:t}=M(e?.tenantId);return l?u.jsx(fe,{isLoading:t}):u.jsx(ue,{isLoading:t})},fe=({isLoading:e})=>{const l=U(),t=j(),o=B(),[a,n]=d.useState(!1),[s,v]=d.useState(!1),[p,f]=d.useState(!1),c=y((i=>i.billPaySetupApproverViewState.fetchState)),S=y((i=>i.billPaySetupApproverViewState.approverListState.fetchStatus.fetchState)),g=y((i=>T(i)));G();const r=y((i=>w(i))),h=y((i=>R(i).billPaySetupApproverViewUpdateData));if(d.useEffect((()=>{h?.updateStatus.fetchState==="Completed"&&o(E())}),[h]),d.useEffect((()=>{a||c!=="Not-Started"||e||(n(!0),o(q(!0,!0,!0)))}),[a,c,e,o]),d.useEffect((()=>{s||S!=="Not-Started"||e||(v(!0),o(ae(!1,!0)))}),[s,S,e,o]),P.getSignedInUser()==null)throw Error("Can't access billpay approval without signing in...");d.useEffect((()=>{r.allApprovalRules.length===0&&r.fetchState==="Completed"&&(p||(f(!0),o(A())),l("./new"))}),[p,r,o]);const I={events:g.companyId!=null?[`private-encrypted-${g.companyId}.${L}`]:[],eventCallback:(i,b,m)=>{i.endsWith(L)&&m.onApprovalRulesEventReceived(i)}};return g?.companyBillPayInfo?.info?.isBillPayTOSAccepted===!1?u.jsx(F,{to:"../../promo"}):u.jsx(de,{currentTenant:g,location:t,navigate:l,isLoading:e,...I})},ye=V((function(e,l){const t=R(e),o=t.billPaySetupApproverViewUpdateData?.type??"approval_create",a=o==="approval_create"&&t.allApprovalRules.length!==0;let n=t.allApprovalRules.length===0;return l.approvalRuleId&&(n=t.allApprovalRules.findIndex((s=>s.approvalRuleId===l.approvalRuleId))===0),{localData:t,hideUpperBoundField:a,isLowerBoundDisabled:n,approvalUpdateActionType:o}}),(function(e,l){const{navigate:t,approvalUpdateDataView:o,approverViewData:a,approvalRuleId:n}=l,s=o.billPaySetupApproverViewUpdateData?.type,v=O(l.location);return{onApprovalRuleDataUpdated:p=>{const f=S=>{const g=[];return S.forEach((r=>{const h=r.actors.selectedUsers.map((b=>({type:"user",userId:b.userId,isImplicitActor:!1}))),I=r.actors.selectedNonUsers.map((b=>{const m=!!re(b.value);return{type:m?"attribute":"role",subType:b.value,userId:void 0,idType:void 0,isImplicitActor:!m}})),i=h.concat(I);g.push({action:r.stepType.selectedOption,actors:i,operator:i.length>1?r.stepType.selectedOption==="require_approval"?"or":"and":"is"})})),g},c={amount:{type:"amount",comparator:"range",min:{amount:p.lowerBound,currencyCode:"USD",currencySymbol:"$"},max:{amount:p.upperBound,currencyCode:"USD",currencySymbol:"$"}}};if(s==="approval_create"){const S={criteria:c,steps:f(p.steps),isApplicableOnPendingApprovalEntity:p.applyToExistingBills.includes("applyToExistingBills")};e(C(S))}else{const S={approvalRuleId:n,criteria:c,steps:f(p.steps),isApplicableOnPendingApprovalEntity:p.applyToExistingBills.includes("applyToExistingBills")};e(C(S))}},onResetClick:()=>{e(E()),s==="approval_update"||v?t("../"):a.allApprovalRules.length===0&&a.fetchState==="Completed"?t("../../setup"):t("../")},onBackClick:()=>{e(E()),s==="approval_update"||v?t("../"):a.allApprovalRules.length===0&&a.fetchState==="Completed"?t("../../setup"):t("../")},onSaveRuleClick:()=>{e(z(!1))},onSaveRuleSuccess:()=>{t("../")}}}))(se);function Se(){const e=U(),l=B(),t=j(),{approvalRuleId:o}=W(),a=P.getSignedInUser(),n=Q(),s=y((c=>R(c))),v=y((c=>w(c))),[p,f]=d.useState(!1);if(d.useEffect((()=>{p||(f(!0),l(Z(!0)))})),d.useEffect((()=>{v.fetchState==="Not-Started"&&e(o!=null?"../../":"../")}),[v,o]),a==null)throw Error("Can't access address page without signing in...");return s.approverListFetchStatus.fetchState=="Not-Started"||s.approverListFetchStatus.fetchState==="In-Progress"?u.jsx(X,{fetchState:s.approverListFetchStatus.fetchState,style:{backgroundColor:n.colors.grey5}}):u.jsx(ye,{navigate:e,approvalUpdateDataView:s,approvalRuleId:o,approverViewData:v,location:t})}const ge=V((function(e,l){const t=R(e),o=t.billPaySetupApproverViewUpdateData?.type??"approval_create",a=[],n={};for(const s of Object.values(e.vendorState.vendorByID))s?.id!=null&&(a.push(s.id),n[s.id]=s.name);return{localData:t,approvalUpdateActionType:o,allVendorIds:a,vendorNamesById:n,editingRuleId:o==="approval_update"?l.approvalRuleId:void 0,allApprovalRulesWithUser:w(e).allApprovalRules}}),(function(e,l){const{navigate:t,approvalUpdateDataView:o,approverViewData:a,approvalRuleId:n}=l,s=o.billPaySetupApproverViewUpdateData?.type,v=O(l.location);return{onApprovalRuleDataUpdated:p=>{const f=i=>{const b=[];return i.forEach((m=>{const N=m.actorKind?.selectedOption,ee=m.selectedRole?.selectedNonUsers??[];let D=[];N==="role"?D=ee.map((_=>({type:"attribute",subType:_.value,userId:void 0,idType:void 0,isImplicitActor:!1}))):N==="specific_person"&&(D=(m.persons?.selectedUsers??[]).map((_=>({type:"user",userId:_.userId,isImplicitActor:!1}))));const $=m.action??"require_approval";b.push({action:$,actors:D,operator:D.length>1?$==="require_approval"?"or":"and":"is"})})),b},c=p.amountCriteria,S=p.vendorCriteria,g=p.departmentCriteria,r={};if(c!=null&&c.comparator.selectedOption!=null){const i=c.comparator.selectedOption;r.amount={type:"amount",comparator:i,min:i==="less_than"?void 0:c.min,max:i==="greater_than"?void 0:c.max}}const h=S?.selection.selectedOptions??[];h.length>0&&(r.vendor={type:"vendor",operator:S?.operator.selectedOption??"is",vendorIds:h});const I=g?.selection.selectedOptions??[];if(I.length>0&&(r.department={type:"department",operator:g?.operator.selectedOption??"is",departmentIds:I}),s==="approval_create"){const i={name:p.name,description:p.description,separationOfDuties:p.separationOfDuties,criteria:r,steps:f(p.steps),isApplicableOnPendingApprovalEntity:p.applyToExistingBills.includes("applyToExistingBills")};e(C(i))}else{const i={approvalRuleId:n,name:p.name,description:p.description,separationOfDuties:p.separationOfDuties,criteria:r,steps:f(p.steps),isApplicableOnPendingApprovalEntity:p.applyToExistingBills.includes("applyToExistingBills")};e(C(i))}},onResetClick:()=>{e(E()),s==="approval_update"||v?t("../"):a.allApprovalRules.length===0&&a.fetchState==="Completed"?t("../../setup"):t("../")},onBackClick:()=>{e(E()),s==="approval_update"||v?t("../"):a.allApprovalRules.length===0&&a.fetchState==="Completed"?t("../../setup"):t("../")},onSaveRuleClick:()=>{e(z(!0))},onSaveRuleSuccess:()=>{t("../")},onEditExistingRule:p=>{e(A(p)),t(s==="approval_update"?`../../${p}/edit`:`../${p}/edit`)}}}))(ne);function H(){const e=y((t=>T(t))),{isApprovalRulesV3Enabled:l}=M(e?.tenantId);return l?u.jsx(me,{}):u.jsx(Se,{})}function me(){const e=U(),l=B(),t=j(),{approvalRuleId:o}=W(),a=P.getSignedInUser(),n=Q(),s=y((c=>R(c))),v=y((c=>w(c))),[p,f]=d.useState(!1);if(G(),d.useEffect((()=>{p||(f(!0),l(Z(!1)))})),d.useEffect((()=>{v.fetchState==="Not-Started"&&e(o!=null?"../../":"../")}),[v,o]),a==null)throw Error("Can't access address page without signing in...");return s.approverListFetchStatus.fetchState=="Not-Started"||s.approverListFetchStatus.fetchState==="In-Progress"?u.jsx(X,{fetchState:s.approverListFetchStatus.fetchState,style:{backgroundColor:n.colors.grey5}}):u.jsx(ge,{navigate:e,approvalUpdateDataView:s,approvalRuleId:o,approverViewData:v,location:t},o??"new")}function xe(){return u.jsxs(te,{children:[u.jsx(x,{path:"/",element:u.jsx(ve,{})}),u.jsx(x,{path:"/new",element:u.jsx(H,{})}),u.jsx(x,{path:"/:approvalRuleId/edit",element:u.jsx(H,{})}),u.jsx(x,{path:"*",element:u.jsx(ie,{})})]})}export{xe as B};
|