@zeniai/web-app-ui 5.3.63-dev → 5.3.64-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-BRZHYOUR.js → AccountMappingScreen-xfXO279W.js} +2 -2
- package/dist/assets/{ActualMatchingMatchDetailScreen-CT_TfQgQ.js → ActualMatchingMatchDetailScreen-ByqHVLf7.js} +1 -1
- package/dist/assets/AddressRoutes-BWVJyPk8.js +1 -0
- package/dist/assets/{AddressScreen-CrINuapd.js → AddressScreen-CrPViFiu.js} +2 -2
- package/dist/assets/{AiCfoScreen-BXw0LDjo.js → AiCfoScreen-DXsXYKZU.js} +1 -1
- package/dist/assets/{AppDrawer-DZIMVdFc.js → AppDrawer-B2rHD8Zo.js} +1 -1
- package/dist/assets/{BillPayApprovalRoutes-Dp_PkbIk.js → BillPayApprovalRoutes-CMAUuUUB.js} +1 -1
- package/dist/assets/{BillPayRoutes-CUUjBefv.js → BillPayRoutes-Dmusj5HX.js} +1 -1
- package/dist/assets/{BusinessVerificationPageScreen-DFamYzxa.js → BusinessVerificationPageScreen-C-aPhqey.js} +2 -2
- package/dist/assets/CardsAiCfoScreen-CTX5PjYy.js +14 -0
- package/dist/assets/{ChargeCardRoutes-DzIBuJeY.js → ChargeCardRoutes-JBiL4Thy.js} +1 -1
- package/dist/assets/CompanyPassportScreen-Df3GjmsH.js +1 -0
- package/dist/assets/ConnectionAuthScreen-CRXLzdg9.js +11 -0
- package/dist/assets/CustomerOnboardingAuthScreen-DSYY256B.js +1 -0
- package/dist/assets/{CustomerOnboardingRoutes-CjmJGGJm.js → CustomerOnboardingRoutes-C2sAsjXY.js} +3 -3
- package/dist/assets/{DashboardRoutes-ByHBLKcB.js → DashboardRoutes-B3_TJQND.js} +4 -4
- package/dist/assets/{DefaultTenantHome-Dm9FOXup.js → DefaultTenantHome-4mMU5w7G.js} +1 -1
- package/dist/assets/{DomesticWireDetailScreen-086WQWRB.js → DomesticWireDetailScreen-DQXD1NSK.js} +3 -3
- package/dist/assets/{DrawerScreen-B5BqRZEJ.js → DrawerScreen-DyQejCID.js} +1 -1
- package/dist/assets/{EntityDetailRoutes-BuN3sXNp.js → EntityDetailRoutes-0npRYuOC.js} +1 -1
- package/dist/assets/{ExpenseAutomationRoutes-Ce3IicTe.js → ExpenseAutomationRoutes-SlF4KM3u.js} +7 -7
- package/dist/assets/FeaturePreviewScreen-OtBPdCPK.js +1 -0
- package/dist/assets/{HubSpotOAuthCallbackScreen-BRUwb2B6.js → HubSpotOAuthCallbackScreen-CtTG0u9D.js} +1 -1
- package/dist/assets/{InboxNotificationsProvider-x0fdv66l.js → InboxNotificationsProvider-CYNlrTK-.js} +1 -1
- package/dist/assets/InvoicingRoutes-DBwLj6Ir.js +2 -0
- package/dist/assets/{MagicLinkRoutes-C5BKMtwW.js → MagicLinkRoutes-D5UwoWcf.js} +8 -8
- package/dist/assets/{MagicLinkSignInScreen-9LYlxmop.js → MagicLinkSignInScreen-B_572HKC.js} +1 -1
- package/dist/assets/{MobileAppDrawer-DX2JnkbM.js → MobileAppDrawer-DLFLa7hS.js} +1 -1
- package/dist/assets/NotFoundScreen-DzxbROot.js +1 -0
- package/dist/assets/{NotificationRoutes-DICT3yoM.js → NotificationRoutes-D7MHUmyT.js} +1 -1
- package/dist/assets/{OAuthConsentScreen-BmiLDdxn.js → OAuthConsentScreen-iNKlAsfd.js} +1 -1
- package/dist/assets/{PandLWithForecastRoutes-DAq9XRB1.js → PandLWithForecastRoutes-COCZ3G6X.js} +1 -1
- package/dist/assets/{PaymentLinkScreen-Cz1wlNqO.js → PaymentLinkScreen-Bh4jK9uE.js} +9 -9
- package/dist/assets/{PeopleRoutes-DgYtveDU.js → PeopleRoutes-BkRUXc0D.js} +5 -5
- package/dist/assets/{PerformanceRoutes-B6iTINLg.js → PerformanceRoutes-BzDFWREu.js} +1 -1
- package/dist/assets/{Preview-Dz6yJNce.js → Preview-Cqz8sG2s.js} +1 -1
- package/dist/assets/{QBOConnectionScreen-D8eeXRWb.js → QBOConnectionScreen-DreC-yDW.js} +1 -1
- package/dist/assets/{ReimbursementApprovalRoutes-CE6y6IwA.js → ReimbursementApprovalRoutes-DPScUcq4.js} +1 -1
- package/dist/assets/{ReimbursementApprovalRuleDetailScreen-BT_O_PEv.js → ReimbursementApprovalRuleDetailScreen-BxglZgWl.js} +1 -1
- package/dist/assets/{ReimbursementRoutes-BmOT-3C-.js → ReimbursementRoutes-DveTyQyE.js} +4 -4
- package/dist/assets/{ReportsRoutes-CqUKv9Uh.js → ReportsRoutes-BZjyXdiB.js} +1 -1
- package/dist/assets/RewardsRoutes-zL93sOaR.js +1 -0
- package/dist/assets/{ScheduleDetailsPrepaidExpensesScreen-CLEogplJ.js → ScheduleDetailsPrepaidExpensesScreen-PbMzJVD9.js} +5 -5
- package/dist/assets/{ScreenRoutes-xDjhbdP1.js → ScreenRoutes-Bl2EONFe.js} +2 -2
- package/dist/assets/{SettingsRoutes-QcMcR-j3.js → SettingsRoutes-hveOvbi9.js} +4 -4
- package/dist/assets/{SetupPagesScreen-fuvb0IYd.js → SetupPagesScreen-B8kiMdZf.js} +5 -5
- package/dist/assets/SignInScreen-CGBu1NjI.js +1 -0
- package/dist/assets/SignOutScreen-D0F6FeVm.js +9 -0
- package/dist/assets/{TaskListScreen-C2urPjKT.js → TaskListScreen-Bi73r_uo.js} +2 -2
- package/dist/assets/{TaskRoutes-BuzkCbPW.js → TaskRoutes-DCW1uZnF.js} +2 -2
- package/dist/assets/TransactionDetailRoutes-CWMSCIXL.js +1 -0
- package/dist/assets/{TransactionDetailScreen-CQr1YyP0.js → TransactionDetailScreen-DVFrl6h2.js} +2 -2
- package/dist/assets/{TransactionListRoutes-BTidVr9Z.js → TransactionListRoutes-B3tJhd_n.js} +1 -1
- package/dist/assets/{TreasuryRoutes-CbD79DO8.js → TreasuryRoutes-BPVOZ6Bj.js} +5 -5
- package/dist/assets/{VendorsRoutes-CCYu89Uf.js → VendorsRoutes-CHDVO5Sr.js} +1 -1
- package/dist/assets/{WiseConfirmationScreen-B0HeU8Sh.js → WiseConfirmationScreen-Du3rEKnE.js} +1 -1
- package/dist/assets/{ZeniAccountRoutes-CoRmS3Mc.js → ZeniAccountRoutes-BzLWpyYJ.js} +9 -9
- package/dist/assets/{ZeniAccountStatementScreen-BnpFJ5jB.js → ZeniAccountStatementScreen-DaV7I7ku.js} +1 -1
- package/dist/assets/{accountMappingHelper-tmyjt9rr.js → accountMappingHelper-Gh8rpbjD.js} +1 -1
- package/dist/assets/analytics-S5MhEivL.js +68 -0
- package/dist/assets/{analyticsHelper-BEL0ra9X.js → analyticsHelper-Ch9SsWjb.js} +1 -1
- package/dist/assets/{core-CHD8T-IM.js → core-Cc7wW2EM.js} +1 -1
- package/dist/assets/{decodeURIComponentSafe-p_nrn8Pg.js → decodeURIComponentSafe-DhqIXi_U.js} +1 -1
- package/dist/assets/{dnd-Dwi6R-ey.js → dnd-DEyyKSEC.js} +1 -1
- package/dist/assets/{empty-CeRjDJvl.js → empty-6MFM8UPN.js} +1 -1
- package/dist/assets/{empty-CZC5CrVC.js → empty-CjY9w6q2.js} +1 -1
- package/dist/assets/{emptyVideoElement-BQ5qxpg6.js → emptyVideoElement-MGXFhhLz.js} +1 -1
- package/dist/assets/{epic-BW8jUHg5.js → epic-D9Y6xcsI.js} +1 -1
- package/dist/assets/{expenseAutomationHelper-kGR6VZFG.js → expenseAutomationHelper-iXuIUZiF.js} +1 -1
- package/dist/assets/{getLocaleForTenant-D-or0iZO.js → getLocaleForTenant-Bgt5rFzV.js} +1 -1
- package/dist/assets/{index-BVHBHjSe.js → index-2QCkbhu2.js} +1 -1
- package/dist/assets/{index-BMy5YH8G.js → index-BZ6qOKkD.js} +1 -1
- package/dist/assets/{index-yiW1aZfy.js → index-Cm43WhAF.js} +2 -2
- package/dist/assets/{index-CKiMoeFX.js → index-D2oCZR3F.js} +1 -1
- package/dist/assets/{index-XRUedCJ0.js → index-DpnxiqBj.js} +1 -1
- package/dist/assets/{index-C1KaIuMT.js → index-gtGWrJ79.js} +1 -1
- package/dist/assets/{index-w09kaOHP.js → index-ldlm2cjp.js} +1 -1
- package/dist/assets/{index-DKH4PK2B.js → index-vIt7RQvO.js} +4561 -4561
- package/dist/assets/{lexical-CMNdypK6.js → lexical-DXgKWO29.js} +1 -1
- package/dist/assets/{liveblocks-e6rGc1UF.js → liveblocks-CgHUgeBY.js} +1 -1
- package/dist/assets/{lottie-B778bt56.js → lottie-C1A2hiZE.js} +1 -1
- package/dist/assets/{mui-NTaF3UaY.js → mui-C4zFSCiU.js} +1 -1
- package/dist/assets/{pathToGoBack-3T3qt1CN.js → pathToGoBack-C17GqrA7.js} +1 -1
- package/dist/assets/{pdf-lib-CSbJ_JNk.js → pdf-lib-CsM74zBq.js} +1 -1
- package/dist/assets/{pdf-Bx92ZlM_.js → pdf-rXyPRm1U.js} +3 -3
- package/dist/assets/{plaid-DdTo7m1-.js → plaid-vsHcqLdj.js} +1 -1
- package/dist/assets/{pusher-TnSBrmnt.js → pusher-C0EhdUPA.js} +1 -1
- package/dist/assets/{react-BRi8TcMI.js → react-BU_8yW5D.js} +1 -1
- package/dist/assets/{react-Ci1ltUcy.js → react-CEepHjWP.js} +1 -1
- package/dist/assets/{react-Ba46BK4D.js → react-CzfY0Vx3.js} +1 -1
- package/dist/assets/{react-DJOUavGZ.js → react-DG8YneWb.js} +1 -1
- package/dist/assets/{react-B75Gnqob.js → react-Gc0eJCMR.js} +1 -1
- package/dist/assets/{react-COkaiBQo.js → react-Yy9ZuxR6.js} +1 -1
- package/dist/assets/{recharts-C6xUtcdL.js → recharts-DJGeJ2v_.js} +1 -1
- package/dist/assets/{routePaths-CGyE-cU7.js → routePaths-C0UIXwMQ.js} +1 -1
- package/dist/assets/{sentry-DsyKtMW2.js → sentry-DSWD_gIh.js} +1 -1
- package/dist/assets/{stripSplatSuffix-CKrdD9MQ.js → stripSplatSuffix-kLnY55Qt.js} +1 -1
- package/dist/assets/{url-Zl9uXQ4e.js → url-DCbpXgdk.js} +1 -1
- package/dist/assets/{url-ClJewK9Y.js → url-DUlo21cY.js} +1 -1
- package/dist/assets/{useActualMatchingMatchDetail-Cc17Q5Tv.js → useActualMatchingMatchDetail-CwcmHDQ8.js} +1 -1
- package/dist/assets/{useAiCfoDashboardSuggestedQuestionsChips-CHbHmZzx.js → useAiCfoDashboardSuggestedQuestionsChips-BFr557mr.js} +1 -1
- package/dist/assets/useAskAiCfoHostNavButtonProps-7-6nPEHY.js +1 -0
- package/dist/assets/{useChargeCardPusherEvents-BWi4_PP5.js → useChargeCardPusherEvents-BVr00Fos.js} +1 -1
- package/dist/assets/{useDeviceId-VsdzmSZI.js → useDeviceId-B5zol9VP.js} +1 -1
- package/dist/assets/{useEmailConnectResultRefresh-ClXdZp-6.js → useEmailConnectResultRefresh-HcMCYvt9.js} +1 -1
- package/dist/assets/{useInitialThreadRequest-DDr_z_RH.js → useInitialThreadRequest-D4Y8xhXu.js} +1 -1
- package/dist/assets/{useTaskManagerAccess-CUv6a62x.js → useTaskManagerAccess-BeNfkHpZ.js} +1 -1
- package/dist/assets/{useTaskManagerPusherEvents-DCIopLVZ.js → useTaskManagerPusherEvents-X_H33C0C.js} +1 -1
- package/dist/assets/{utils-CCA3F0sZ.js → utils-DiIEQ7_h.js} +1 -1
- package/dist/assets/{withTransactionSidePanel-B_xgLNm6.js → withTransactionSidePanel-DkQdwLfY.js} +4 -4
- package/dist/assets/{zeni-epic-state-BO3zdDfL.js → zeni-epic-state-BVJjEVAA.js} +3 -3
- package/dist/index.html +1 -1
- package/package.json +3 -3
- package/dist/assets/AddressRoutes-CisWqyoC.js +0 -1
- package/dist/assets/CardsAiCfoScreen-Cx5KkOYw.js +0 -14
- package/dist/assets/CompanyPassportScreen-CENbDnLW.js +0 -1
- package/dist/assets/ConnectionAuthScreen-DTyZxcME.js +0 -11
- package/dist/assets/CustomerOnboardingAuthScreen-zLmHJyqv.js +0 -1
- package/dist/assets/FeaturePreviewScreen-D54Nwanb.js +0 -1
- package/dist/assets/InvoicingRoutes-IQsFojD0.js +0 -2
- package/dist/assets/NotFoundScreen-CtgFRYZy.js +0 -1
- package/dist/assets/RewardsRoutes-D5CR9NnI.js +0 -1
- package/dist/assets/SignInScreen-ekGlkjLH.js +0 -1
- package/dist/assets/SignOutScreen-9NJIr2hr.js +0 -9
- package/dist/assets/TransactionDetailRoutes-D99Yv6kv.js +0 -1
- package/dist/assets/analytics-C3e3An3a.js +0 -68
- package/dist/assets/useAskAiCfoHostNavButtonProps-BcCbRGDK.js +0 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{j as D}from"./liveblocks-
|
|
1
|
+
import{j as D}from"./liveblocks-CgHUgeBY.js";import{a as o}from"./sentry-DSWD_gIh.js";import{h as H,g as W,u as X,j as m,s as q,l as Y}from"./core-Cc7wW2EM.js";import{aj as Z,N as ee,f as $,z as te,q as G,ak as ne,j as ae,U as ce}from"./index-vIt7RQvO.js";import{bn as se,fF as oe,gV as ie,oB as Q,UK as re,i8 as J,gh as le,os as ue,UL as de,UM as pe,ua as ge,l$ as me,oq as Ae,om as be,ox as fe,ia as Ie,UN as ye,UO as Se}from"./zeni-epic-state-BVJjEVAA.js";import{n as he}from"./mui-C4zFSCiU.js";import{M as Ee}from"./MobileAppDrawer-DLFLa7hS.js";import{q as R}from"./QBOConnectionScreen-DreC-yDW.js";import{g as h,a as E,m as ze}from"./accountMappingHelper-Gh8rpbjD.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]="b6c9b4fc-f52a-4004-91d5-c333afa9e0e4",a._sentryDebugIdIdentifier="sentry-dbid-b6c9b4fc-f52a-4004-91d5-c333afa9e0e4")}catch{}})();const l="zeni_pending_projects_enable",u={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-e6rGc1UF.js";import{a as o}from"./sentry-DsyKtMW
|
|
|
6
6
|
flex-direction: column;
|
|
7
7
|
align-items: center;
|
|
8
8
|
background-color: ${a=>a.theme.colors.grey4};
|
|
9
|
-
`,we=Y((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(l),c=i===u.pending||i===u.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:x}=r,{incomeAccount:C,expenseAccount:F}=d,{billPayAccount:s}=z,{reimbursementsAccount:V}=v,{prepaidExpensesAccount:p,fixedAssetsAccount:T,accruedExpensesAccount:O}=w,{bankAccount:M,expenseCategory1099:
|
|
9
|
+
`,we=Y((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(l),c=i===u.pending||i===u.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:x}=r,{incomeAccount:C,expenseAccount:F}=d,{billPayAccount:s}=z,{reimbursementsAccount:V}=v,{prepaidExpensesAccount:p,fixedAssetsAccount:T,accruedExpensesAccount:O}=w,{bankAccount:M,expenseCategory1099:j}=x,b=h(e.accountMappingView.incomeAccountList,C.selectedOption),k=h(e.accountMappingView.expenseAccountList,F.selectedOption),f=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),I=E(e.accountMappingView.accruedExpensesAccountList,O.selectedOptions),L=E(e.accountMappingView.bankAccounts1099FilingAccountList,M.selectedOptions),y=ze(e.accountMappingView.expenseAccounts1099FilingAccountList,j),t={selectedIncomeAccountId:b?.accountId,selectedExpenseAccountId:k?.accountId,selectedBillPayAccountId:f?.accountId,selectedReimbursementsAccountId:_?.accountId,selectedPrepaidExpensesAccountIds:P.map((n=>n.accountId)),selectedFixedAssetsAccountIds:U.map((n=>n.accountId)),selectedAccruedExpensesAccountIds:I.map((n=>n.accountId)),selectedBankAccounts1099FilingAccountIds:L.map((n=>n.accountId)),selectedExpenseAccounts1099FilingAccountIds:y};a(Se({data:t}))},onBackClick:()=>{G(c)===!1?(i("../../dashboard"),a(ye())):a(J())},onSaveClick:()=>{a(Ie()),A&&ae.track(ce.Event.vendor1099AccountingSettingsSave)},onAccountingClassesToggle:r=>{a(fe(e.currentTenant.companyId,r))},onAccountingProjectsToggle:r=>{const d=sessionStorage.getItem(l);d===u.pending||d===u.ready||a(r?Ae(e.currentTenant.companyId):be(e.currentTenant.companyId))}}}))(ne),_e=()=>{const a=Z(),e=H(),i=W(),c=X(),{useFeatureGate:A,useDynamicConfig:r}=ee(),{isFeatureEnabled:d}=A($.isFiling1099FeatureEnabled),{isFeatureEnabled:z}=A($.isScheduledJEAccruedExpensesFeatureEnabled),{configValue:v,isDynamicConfigLoading:w}=r("transaction_categorization_config"),x=!w&&v?.capitalization_enabled===!0,C=te.getSignedInUser(),F=se(C),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),M=o.useCallback(((t,n)=>{c(Q(s.companyId,t,n))}),[c,s.companyId]),j=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,K]=g[0]??[];S!=null&&c(Q(s.companyId,S,K,void 0,Object.keys(n).length>0?n:null))}),[c,s.companyId,p]),b=m((t=>re(t.accountState)),q),k=o.useMemo((()=>{const t={};for(const n of b)n.accountId!=null&&n.accountName!=null&&(t[n.accountId]=n.accountName);return t}),[b]),[f,_]=o.useState(!1),[P,U]=o.useState(!1);o.useEffect((()=>{f===!1&&(c(J()),_(!0))}),[f]);const I=m((t=>t.companyViewState.passportView?.needsQboProjectsReconnect===!0));o.useEffect((()=>{sessionStorage.getItem(l)===u.pending&&(sessionStorage.removeItem(l),c(le({messageSection:"accounting_projects_qbo_reconnect_failed",messageText:"failed",type:"error"})))}),[c]),o.useEffect((()=>{sessionStorage.getItem(l)===u.ready&&s?.companyId!=null&&(sessionStorage.removeItem(l),c(ue(s.companyId)))}),[s?.companyId,c]),o.useEffect((()=>{I&&s?.tenantEmailDomain!=null&&(sessionStorage.setItem(l,u.pending),c(de()),R.init("/connection/auth",s.tenantEmailDomain),R.handleClick())}),[I,s?.tenantEmailDomain,c]);const L=m((t=>pe(t))),y=t=>{U(t)};return D.jsxs(ve,{children:[D.jsx(Ee,{isAppContentDrawerOpen:P,handleDrawerToggle:y}),D.jsx(we,{currentTenant:s,navigate:e,meetingUrl:a("account_mapping"),accountMappingView:L,isFiling1099FeatureEnabled:d&&F,isAccruedExpensesFeatureEnabled:z,isCapitalizationFeatureEnabled:x,capitalizableAccounts:V,accountNamesById:k,capitalizableAccountOverrides:p,currencySymbol:O,isCapitalizationThresholdSaving:T,onSaveCapitalizationAccountThreshold:M,onSaveCapitalizationAccountThresholds:j,location:i,isSettings:G(i),onClickMenuIcon:()=>y(!0)})]})};export{l as P,_e as U,u as a};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{j as s}from"./liveblocks-
|
|
1
|
+
import{j as s}from"./liveblocks-CgHUgeBY.js";import{a as k}from"./sentry-DSWD_gIh.js";import{a5 as I,dQ as g}from"./index-vIt7RQvO.js";import"./mui-C4zFSCiU.js";import{u as y}from"./useActualMatchingMatchDetail-CwcmHDQ8.js";import b from"./NotFoundScreen-DzxbROot.js";import{i as v,h as U,g as w}from"./core-Cc7wW2EM.js";import"./zeni-epic-state-BVJjEVAA.js";import"./recharts-DJGeJ2v_.js";import"./analytics-S5MhEivL.js";import"./plaid-vsHcqLdj.js";import"./dnd-DEyyKSEC.js";import"./stripe-cKAAJElX.js";import"./lottie-C1A2hiZE.js";import"./lexical-DXgKWO29.js";import"./pdf-rXyPRm1U.js";import"./utils-DiIEQ7_h.js";import"./stripSplatSuffix-kLnY55Qt.js";import"./decodeURIComponentSafe-DhqIXi_U.js";import"./routePaths-C0UIXwMQ.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]="0b9cbf63-f788-4a28-96e6-d5ee605ae585",t._sentryDebugIdIdentifier="sentry-dbid-0b9cbf63-f788-4a28-96e6-d5ee605ae585")}catch{}})();function J(){const{matchId:t,tenantEmailDomain:e}=v(),n=U(),r=w(),R=y(t??""),a=k.useCallback((()=>{const S=I(r.state?.pathnameStackToGoBack);n(S.poppedPathname??`/${e??""}/month_end_close_checks/review`,{state:{pathnameStackToGoBack:S.newStack}})}),[r.state,n,e]);if(t==null)return s.jsx(b,{});const{match:i,detailFetchState:o,handleOpenBill:l,handleRefresh:c,handleUndoReversal:d,handleContinueMatch:h,lastMatchResults:f,lastUndoResults:m,refreshStatus:p,undoReversalStatus:u}=R;return i==null?o.fetchState==="Not-Started"||o.fetchState==="In-Progress"?s.jsx(g,{detailFetchState:o.fetchState,isUndoInFlight:u.fetchState==="In-Progress",refreshStatus:p.fetchState,onNavigateBack:a,onOpenBill:l,onContinueMatch:()=>{h(),a()},onRefresh:c,onUndoReversal:d,lastMatchResults:f,lastUndoResults:m}):s.jsx(b,{}):s.jsx(g,{match:i,detailFetchState:o.fetchState,isUndoInFlight:u.fetchState==="In-Progress",refreshStatus:p.fetchState,onNavigateBack:a,onOpenBill:l,onContinueMatch:()=>{h(),a()},onRefresh:c,onUndoReversal:d,lastMatchResults:f,lastUndoResults:m})}export{J as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{j as e}from"./liveblocks-CgHUgeBY.js";import{A as i}from"./AddressScreen-CrPViFiu.js";import s from"./NotFoundScreen-DzxbROot.js";import"./sentry-DSWD_gIh.js";import{n as d,o as r}from"./core-Cc7wW2EM.js";import"./zeni-epic-state-BVJjEVAA.js";import"./recharts-DJGeJ2v_.js";import"./index-vIt7RQvO.js";import"./mui-C4zFSCiU.js";import"./analytics-S5MhEivL.js";import"./plaid-vsHcqLdj.js";import"./dnd-DEyyKSEC.js";import"./stripe-cKAAJElX.js";import"./lottie-C1A2hiZE.js";import"./lexical-DXgKWO29.js";import"./pdf-rXyPRm1U.js";import"./utils-DiIEQ7_h.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-CgHUgeBY.js";import{a as h}from"./sentry-DSWD_gIh.js";import{h as P,u as T,g as j,i as E,j as B,l as M}from"./core-Cc7wW2EM.js";import{a2 as $,E as D,z as L,P as V,a8 as K,a9 as U,j as _,U as S,a4 as F,_ as b,a5 as z}from"./index-vIt7RQvO.js";import{Vp as C,ip as R,fF as q,Vq as G,c8 as H,Vr as N,mH as O}from"./zeni-epic-state-BVJjEVAA.js";import{n as J}from"./mui-C4zFSCiU.js";import Q from"./NotFoundScreen-DzxbROot.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]="7ff08ddd-13b4-44d5-af43-d1f6de882a17",e._sentryDebugIdIdentifier="sentry-dbid-7ff08ddd-13b4-44d5-af43-d1f6de882a17")}catch{}})();const W=J.div`
|
|
2
2
|
display: flex;
|
|
3
3
|
height: 100vh;
|
|
4
4
|
width: 100%;
|
|
@@ -6,4 +6,4 @@ import{j as n}from"./liveblocks-e6rGc1UF.js";import{a as S}from"./sentry-DsyKtMW
|
|
|
6
6
|
flex-direction: column;
|
|
7
7
|
align-items: center;
|
|
8
8
|
background-color: ${e=>e.theme.colors.grey4};
|
|
9
|
-
`,X=M((function(e,s){const{addressId:o,isSubPage:i,addressType:c}=s,l=q(e),a=s.roleMap!=null&&G(s.roleMap),d=i||c==="user_address"||H(l?.userRole??[])||a?void 0:"readonly";if(o==null){const t=N(c,e);return{addressToEdit:t?.addressToCreate,loadingState:t?.status?.fetchState,googleAPIKey:
|
|
9
|
+
`,X=M((function(e,s){const{addressId:o,isSubPage:i,addressType:c}=s,l=q(e),a=s.roleMap!=null&&G(s.roleMap),d=i||c==="user_address"||H(l?.userRole??[])||a?void 0:"readonly";if(o==null){const t=N(c,e);return{addressToEdit:t?.addressToCreate,loadingState:t?.status?.fetchState,googleAPIKey:b.googleMapsAPIKey,isDisabled:d,isSubPage:i,dontShowSaveConfirmationPopup:s.dontShowSaveConfirmation}}const r=C(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=z(d?.pathnameStackToGoBack);let t=r.poppedPathname??v();const u=d?.queryParams;if(u){const f=new URLSearchParams(u).toString();f&&(t=`${t}?${f}`)}o(t,{state:{pathnameStackToGoBack:r.newStack}})}};return{onSubmitHandler:a=>{const d=Y(a);e(O({addressType:c,addressToCreate:d})),_?.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)}}}))(F);function ne({isSubPage:e,hideAddressSubTitle:s=!1,hideAddressBackButton:o=!1,dontShowSaveConfirmation:i,accountContext:c,addressTypeParam:l}){const a=P(),d=T(),r=j(),{addressId:t,addressType:u}=E(),f=$(),I=D(),k=L.getSignedInUser(),[g,w]=h.useState(t==null),p=B((m=>t!=null?C(m,t).fetchState:"Not-Started")),x=V();if(k==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((()=>{g||t==null||(w(!0),d(R(t,!1)))}),[g,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)?!g&&p==="Not-Started"||g&&p==="In-Progress"?n.jsx(K,{fetchState:p,style:{backgroundColor:I.colors.grey5}}):t!=null&&p==="Error"?(a(`${v(1)}/new`,{replace:!0}),n.jsx(n.Fragment,{})):n.jsxs(n.Fragment,{children:[n.jsx(U,{analytics:_,onLoad:A}),n.jsx(W,{windowSize:f,children:n.jsx(X,{location:r,navigate:a,isSubPage:e===!0,hideAddressBackButton:o,hideAddressSubTitle:s,addressId:t,addressType:y,dontShowSaveConfirmation:i,bankAccountContext:c,roleMap:x?.loggedInUserRoleMap})})]}):n.jsx(Q,{})}const v=(e=2)=>{let s="../";for(let o=0;o<e;o++)s=`${s}../`;return s},Y=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,Y as t};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{j as h}from"./liveblocks-e6rGc1UF.js";import{a as n}from"./sentry-DsyKtMW2.js";import{u as _t,h as Dt,i as Lt,g as Bt,j as b,l as Ft}from"./core-CHD8T-IM.js";import{a as Mt,j as Vt,e7 as $t,z as Nt,a2 as qt,e8 as Gt,e9 as Ht,ea as zt,bq as Be,eb as We,ec as Wt,bp as Je,a5 as ge,a9 as ce,k as M,ed as me,ee as Jt,ef as Kt,av as Yt,U as Xt,w as Zt,eg as es,eh as ts,aw as ss,ei as ns,ej as as,ek as os,el as is,p as rs,bl as Fe,em as ls}from"./index-DKH4PK2B.js";import{fE as F,gt as R,U7 as us,a2h as ds,a2i as cs,jM as ms,a2j as Ss,jJ as hs,a2k as Se,jp as W,jS as J,jv as Ie,jc as he,ja as ps,jU as fs,jE as Ke,Ug as Me,gv as V,gK as gs,Uf as Is,U0 as Ve,fF as Cs,j3 as ks,a2l as bs,g8 as vs,jl as Es,jh as Ps,fG as pe,gf as ys,a2m as ws,a2n as xs,a2o as Rs,gu as Ts,go as $e,k4 as Ne,gq as qe,gw as js,a2p as Ge,jV as Os,je as As,jy as Us,jQ as He,jB as Qs,gx as _s,gy as Ds,gz as Ls,gA as Bs}from"./zeni-epic-state-BO3zdDfL.js";import{D as Fs,n as $,S as Ms,P as Vs}from"./mui-NTaF3UaY.js";import{u as $s}from"./useAiCfoDashboardSuggestedQuestionsChips-CHbHmZzx.js";import{p as Ns}from"./pathToGoBack-3T3qt1CN.js";import{j as qs}from"./routePaths-CGyE-cU7.js";import{u as Gs}from"./useTaskManagerPusherEvents-DCIopLVZ.js";import"./recharts-C6xUtcdL.js";import"./analytics-C3e3An3a.js";import"./plaid-DdTo7m1-.js";import"./dnd-Dwi6R-ey.js";import"./stripe-cKAAJElX.js";import"./lottie-B778bt56.js";import"./lexical-CMNdypK6.js";import"./pdf-Bx92ZlM_.js";import"./utils-CCA3F0sZ.js";(function(){try{var s=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},r=new s.Error().stack;r&&(s._sentryDebugIds=s._sentryDebugIds||{},s._sentryDebugIds[r]="0b79597a-2151-42cc-9328-0c5118ebfe7e",s._sentryDebugIdIdentifier="sentry-dbid-0b79597a-2151-42cc-9328-0c5118ebfe7e")}catch{}})();const Hs=["claimed","running","succeeded","failed","timeout"],fe=s=>typeof s=="string"&&s!=="",Ye="chat-response-generated";function zs(s,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 t=R(s).skills.find((l=>l.macroId===r.savedMacroId));return t==null?void 0:{status:"saved",command:t.name}}const Ws=Ft((function(s,r){const t=F(s),l=r.isSubmitting,c=t.uiState?.currentChatSessionId,i=c!=null?ys(s.aiCfoState,c):[],f=ts(s,{allUsers:r.allUsers,onCardPolicyVendorSearchTextChange:r.onCardPolicyVendorSearchTextChange}),p=ws(s),S=xs(s),A=Rs(s);return{showSampleQuestions:r.sessionFromUrl==="explore"&&t.uiState.currentChatSessionId==null,aiCfoView:t,isSubmitting:l,isNewChatSession:r.sessionFromUrl==="new_chat"||r.sessionFromUrl==="explore",isFullView:!0,tableDownloadEndPoint:`${ss}/tableDownload`,exportDownloadEndPoint:os(),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(s).skills,skillSaveState:zs(s,A),skillsEnabled:R(s).skillsEnabled,skillsList:R(s).skills,skillsListError:R(s).fetchState==="Error",skillsListLoading:R(s).fetchState==="In-Progress",skillsCanPublish:R(s).canPublish,skillSaving:A.fetchState==="In-Progress",skillSaveError:A.fetchState==="Error",skillVersionHistory:p.macroId!=null?{macroId:p.macroId,versions:p.versions,error:p.fetchState==="Error",loading:p.fetchState==="In-Progress"}:void 0,skillRestoreBody:S.macroId!=null&&S.version!=null?{macroId:S.macroId,version:S.version,instructions:S.instructions,error:S.fetchState==="Error",loading:S.fetchState==="In-Progress"}:void 0,skillDetail:J(s).detail,skillDetailError:J(s).fetchState==="Error",skillDetailLoading:J(s).fetchState==="In-Progress",syntheticAnswers:i,resolveSyntheticAnswerCardTile:as(s),resolveSyntheticAnswerPolicyTile:ns(s),...f}}),(function(s,r){const{location:t,currentTenant:l,userId:c,navigate:i,currentChatSessionId:f,allSessionsWithOrderedQuestionAnswers:p,isAiCardCreationEnabled:S,isCardPolicyEnabled:A,setIsAiCfoOpen:D}=r,T=l.tenantEmailDomain;return{onEventReceived:(a,o)=>{if(a===Ye&&typeof o.text=="string"&&typeof o.metadata=="object"){const m=o,E=_s(m.type),v=m.metadata.chat_session_id??null,{currentChatSession:K,currentQuestionAnswer:j,currentQuestionAnswerSummary:Y}=Je(p,v);E!=="answer"?M.trackAICFOChatResponseGenerated(E,j?.question.questionText??"",m.text,v,ls(Y,K),m.metadata.message_id??null):M.trackAICFOChatAnswerGenerated(m.text,j?.question.questionText??"",(m.follow_up_questions?.length??0)>0,!!m.assumptions,!!m.insights,m.visualization!=null,Ds(m.visualization?.type??"")??null,v,m.summarized_title,m.metadata.message_id??null),s(Ls({chatSessionId:m.metadata.chat_session_id,responseType:E,fetchState:{fetchState:"Completed",error:void 0}})),s(Bs({chatSessionId:m.metadata.chat_session_id,answerPayload:m,userId:c}))}},onSubmit:(a,o,m,E,v)=>{a&&Fe(s,a,o,f,p,c,E,m,void 0,v)},onFetchSkills:()=>{s(Ke())},onOpenSkill:a=>{s(Ie({macroId:a})),s(Qs({macroId:a}))},onSaveSkill:(a,o)=>{s(He({draft:a,macroId:o}))},onSaveSkillDraft:a=>{const o=a.displayName?.trim()??"",m=a.name?.trim()??"";s(He({draft:{name:o.length>0?o:m,description:a.description?.trim()??null,instructions:a.instructions,visibility:"private"}}))},onFetchSkillVersionBody:(a,o)=>{s(Us({macroId:a,version:o}))},onDeleteSkill:a=>{s(As({macroId:a}))},onSetSkillVisibility:(a,o)=>{s(Os({macroId:a,visibility:o}))},onCloseSkillDetail:()=>{s(Ge())},onRunSkill:(a,o)=>{s(V()),s($e()),Fe(s,o,"user_input",void 0,p,c,void 0,void 0,void 0,a),s(Ge())},updateCurrentInput:a=>{s(qe(a))},onStopSubmit:()=>{},onUpdateScrollYOffset:a=>{s(js(a))},onSelectSampleQuestion:()=>{},onBackClick:()=>{i(-1)},onCloseClick:()=>{const a=ge(t.state?.pathnameStackToGoBack),o=a.poppedPathname??Ns(1);i(o,{state:{...t.state,pathnameStackToGoBack:a.newStack}}),s(qe(""))},togglePageView:()=>{const a=ge(t.state?.pathnameStackToGoBack),o=a.poppedPathname??`/${l.tenantEmailDomain}/dashboard`;i(o,{state:{...We(t.state),pathnameStackToGoBack:a.newStack,message:"open_ai_cfo_drawer"}}),D(!0)},onCopy:()=>{},onThumbsUp:(a,o)=>{f!=null&&o?.messageId!=null&&s(Ne(f,o.messageId,"positive",o.questionText,o.answerText))},onThumbsDown:(a,o)=>{f!=null&&o?.messageId!=null&&s(Ne(f,o.messageId,"negative",o.questionText,o.answerText))},onTogglePageView:()=>{i(-1)},onNewChatClick:()=>{s(V()),f!=null&&s($e());const a=rs(t.state?.pathnameStackToGoBack,t.pathname);i(`/${l.tenantEmailDomain}/ai-cfo/new_chat`,{state:{pathnameStackToGoBack:a.slice(0,-1),referrer:"Sidebar"}})},onToggleCotCollapsed:(a,o)=>{s(Ts({questionAnswerId:a,isCollapsed:o}))},onMenuClick:r.onMenuClick,...is(s,{isAiCardCreationEnabled:S,isCardPolicyEnabled:A,currentChatSessionId:f,onAfterCardsCreationSubmit:()=>{D(!0),i(`/${T}/cards`,{state:{...t.state}})},onAfterCardPolicySubmit:()=>{D(!0),i(`/${T}/cards/policy`,{state:{...t.state}})}})}}))(Zt(es)),Cn=({isFileUploadEnabled:s})=>{const{setIsAiCfoOpen:r}=Mt(),t=_t(),l=Dt(),{session_id:c}=Lt(),i=Bt(),f=new URLSearchParams(i.search).get("routine")??void 0,[p,S]=n.useState(!1),A=b((e=>F(e).uiState.isSkillsBrowserOpen===!0)),D=b((e=>R(e).skillsEnabled)),T=b((e=>F(e).uiState.isRoutinesBrowserOpen===!0)),a=b((e=>us(e))),o=b((e=>ds(e))),m=b((e=>cs(e))),[E,v]=n.useState(void 0),[K,j]=n.useState(!1),[Y,Ce]=n.useState(void 0),Xe=n.useCallback((()=>{Ce(void 0),v(void 0),j(!0)}),[]),Ze=n.useCallback((e=>{v(e),j(!0)}),[]),et=n.useCallback((()=>{v(void 0),j(!1)}),[]),tt=n.useCallback((e=>{t(ms({draft:e,...E!=null&&{scheduleId:E.scheduleId}})),v(void 0),j(!1)}),[t,E]),P=f,ke=a.routines.find((e=>e.scheduleId===P)),I=b((e=>Ss(e))),st=n.useCallback((e=>{t(hs({scheduleId:e.scheduleId}))}),[t]);n.useEffect((()=>{t(P!=null?W({scheduleId:P}):Se())}),[t,P]);const B=ke?.macroId,nt=b((e=>J(e))),be=B!=null&&B!==""&&nt.fetchState==="Not-Started";n.useEffect((()=>{be&&B!=null&&t(Ie({macroId:B}))}),[t,be,B]);const at=b((e=>F(e).uiState.currentChatSessionId))??c,C=a.routines.find((e=>e.scheduleId===f))??a.routines.find((e=>e.scheduleId===Vt(at))),O=C?.scheduleId??null,[ve,ot]=n.useState(!0);n.useEffect((()=>{O!=null&&t(W({scheduleId:O}))}),[t,O]);const Ee=I.runs.some((e=>e.status==="claimed"||e.status==="running"))===!0;n.useEffect((()=>{if(P==null||Ee!==!0)return;const e=window.setInterval((()=>{t(W({scheduleId:P})),t(he())}),5e3);return()=>window.clearInterval(e)}),[t,Ee,P]);const it=n.useCallback((e=>{Ce(e),v(void 0),j(!0)}),[]),rt=n.useCallback((e=>{t(ps({scheduleId:e.scheduleId}))}),[t]),lt=n.useCallback(((e,d)=>{t(fs({enabled:d,scheduleId:e.scheduleId}))}),[t]);n.useEffect((()=>{T&&t(he())}),[t,T]);const Pe=b((e=>R(e).skills)),X=n.useMemo((()=>Pe.map((e=>({macroId:e.macroId,name:e.displayName??e.name})))),[Pe]),ut=n.useCallback((e=>{t(Ie({macroId:e}))}),[t]),Z=n.useCallback((()=>{t(Ke()),t(Me())}),[t]),dt=n.useCallback((()=>{t(V())}),[t]),{allUsers:ct,isAiCardCreationEnabled:mt,isCardPolicyEnabled:St,onCardPolicyVendorSearchTextChange:ht}=$t();n.useEffect((()=>{t(gs())}),[t]);const g=b((e=>F(e))),w=Nt.getSignedInUser();n.useEffect((()=>c==="routines"?(t(V()),void t(Is())):c==="skills"?(t(Se()),t(Ve()),void t(Me())):(O==null&&t(Se()),t(Ve()),void t(V()))),[t,O,f,c]);const pt=qt(),U=Yt(pt),k=b((e=>Cs(e))),u=g.uiState.currentChatSessionId,y=k.tenantEmailDomain,L=y!=null&&y!=="",ee=n.useCallback((e=>{L&&l(`/${y}/ai-cfo/routines?routine=${encodeURIComponent(e.scheduleId)}`)}),[L,l,y]),te=n.useCallback((()=>{L&&l(`/${y}/ai-cfo/routines`)}),[L,l,y]),se=n.useCallback(((e,d)=>{const Q=e.sessionId??I.sessionId;Q!=null&&L&&l(`/${y}/ai-cfo/${Q}?routine=${encodeURIComponent(d)}`)}),[L,l,I.sessionId,y]),ft=n.useMemo((()=>C==null?void 0:{error:I.fetchState==="Error",kind:"routineRuns",loading:I.fetchState==="In-Progress"||I.fetchState==="Not-Started",routineName:C.name,schedule:Gt(C),skillName:C.isAdHoc===!0?void 0:X.find((e=>e.macroId===C.macroId))?.name,onOpenSkill:C.isAdHoc===!0?void 0:Z,runs:I.runs,tzName:C.tzName,unreadCount:C.unreadRuns,open:ve,onToggle:()=>ot((e=>!e)),onOpenRun:e=>se(e,C.scheduleId),onOpenRoutine:()=>ee(C),onOpenRoutines:te}),[Z,te,ee,se,ve,C,I.fetchState,I.runs,X]),{handleUploadPromoClose:gt,isUploadPromoVisible:It}=Ht({isFileUploadEnabled:s,tenantEmailDomain:y}),ne=zt({currentTenant:k,currentChatSessionId:u,aiCfoView:g,skillsEnabled:D,onCloseSkills:dt,onOpenSkills:Z}),{isSuggestedQuestionsLoading:Ct,suggestedPromptQuestions:kt}=$s(),N=i.state,q=N?.aiCfoInitialQuestion,ye=!!N?.aiCfoShouldSubmit;n.useEffect((()=>{const e=i.state;if(e?.[Be]!==!0)return;S(!0);const d={...e};delete d[Be],l(i,{replace:!0,state:d})}),[i.pathname,i.search,i.state,l]);const[bt,ae]=n.useState(null),[vt,oe]=n.useState(!1),[Et,ie]=n.useState(void 0),[Pt,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 d=e?.aiCfoSuggestionIndex;re(typeof d=="number"?d:void 0),we.current=!0}}),[q,ye,i.state]);const yt=n.useCallback((()=>{ae(null),oe(!1),ie(void 0),re(void 0),l(i.pathname,{replace:!0,state:We(i.state)})}),[i.pathname,i.state,l]),xe=n.useMemo((()=>new URLSearchParams(i.search)),[i.search]),Re=xe.get("ref")??N?.aiCfoRef,le=xe.get("emailRefId")??N?.aiCfoEmailRefId,Te=n.useRef(!1);n.useEffect((()=>{Te.current||Re!=="month-end-email"||le==null||u!=null||w==null||(t(ks("controller",w.userId,le,"MONTH_END_EMAIL")),Te.current=!0)}),[Re,le,u,t,w]);const G=g.uiState.lastContextMessage;n.useEffect((()=>{G!=null&&G!==""&&u!=null&&(ae(G),oe(!0),ie(void 0),re(void 0),t(bs()))}),[G,u,t]);const wt=k.masterTOSInfo,x=wt?.isMasterTOSAccepted??!1,{visitedSessions:je}=Wt(u),H=g.fetchState,z=g.uiState.chatSessionsNextPageToken.hasMore||!g.uiState.chatSessionsFirstPageFetched,Oe=u!=null?g.fetchChatSessionHistoryByChatSessionId?.[u]?.fetchState??"Not-Started":"Not-Started",Ae=u==null||(g.uiState.chatHistoryNextPageToken[u]?.hasMore??!0),Ue=g.allSessionsWithOrderedQuestionAnswers,{currentSessionQuestionAnswers:xt}=Je(Ue,u),Rt=xt.length===0;n.useEffect((()=>{x||U||l("../dashboard",{state:{...i.state,message:"open_ai_cfo_drawer"}})}),[x,U,l,i.state]);const Tt=n.useCallback((()=>{const e=ge(i.state?.pathnameStackToGoBack),d=k.tenantEmailDomain;l(e.poppedPathname??(d!=null?`/${d}/dashboard`:".."),{state:{...i.state,pathnameStackToGoBack:e.newStack}})}),[k.tenantEmailDomain,i.state,l]),Qe=n.useRef(void 0),_e=n.useRef(void 0);n.useEffect((()=>{const e=c!==Qe.current,d=u!==_e.current;Qe.current=c,_e.current=u,c!==u&&(!e||c==null||qs(c)?d&&u!=null&&l(`../ai-cfo/${u}`,{state:{...i.state}}):t(vs({sessionId:c,agentId:"controller"})))}),[u,c]);const jt=n.useMemo((()=>({events:je.map((e=>`private-encrypted-chat-${e}.${Ye}`)),eventCallback:(e,d,Q)=>Q.onEventReceived(e,d)})),[je]);n.useEffect((()=>{H!=="In-Progress"&&z&&t(Es())}),[H,z,t]),n.useEffect((()=>{u!=null&&Oe!=="In-Progress"&&Ae&&w!=null&&(c===u||H==="Completed"&&!z)&&t(Ps(u,w.userId))}),[Oe,H,Ae,z,u,w,c,t]);const ue=w?.userId,Ot=n.useMemo((()=>{return ue==null?[]:[(e=ue,`private-encrypted-routines-${e}.routine-run-updated`)];var e}),[ue]),De=n.useCallback((e=>{const d=e!=null&&(e===P||e===O);(T||d)&&t(he()),d&&t(W({scheduleId:e}))}),[t,T,O,P]);Gs({events:Ot,onSubscribed:()=>De(P??O),onEvent:(e,d)=>{const Q=(de=>{if(de==null||typeof de!="object")return null;const _=de;return fe(_.schedule_id)&&fe(_.run_id)?{scheduleId:_.schedule_id,runId:_.run_id,status:Hs.find((Qt=>Qt===_.status))??null,finishedAt:fe(_.finished_at)?_.finished_at:null}:null})(d);Q!=null&&De(Q.scheduleId)}});const Le=e=>e.trackAICFOOnboardingScreenStateChanged("open","first_visit");if(w==null||c==null)throw Error("Can't access AI Controller page without signing in...");const At=u!=null&&g.responseStateByChatSessionId?.[u]?.answer?.fetchState==="In-Progress";if(!x&&U)return h.jsxs(Ks,{children:[h.jsx(ce,{analytics:M,onLoad:Le}),ne.drawerElement,h.jsx(Ys,{children:h.jsx(ze,{children:h.jsx(me,{isTOSAccepted:!1,acceptMasterTOSState:g.masterTOSAcceptanceState,onCloseClick:Tt,onCompleteClick:()=>{k.userRoleId!=null&&t(pe(k.userRoleId))}})})})]});const Ut=h.jsxs(h.Fragment,{children:[p&&!x?h.jsx(ce,{analytics:M,onLoad:Le}):null,h.jsx(me,{isTOSAccepted:x,acceptMasterTOSState:g.masterTOSAcceptanceState,showHeader:!1,togglePageView:x?()=>S(!1):void 0,onCloseClick:()=>S(!1),onCompleteClick:()=>{x||k.userRoleId==null||t(pe(k.userRoleId)),S(!1)}})]});return h.jsxs(h.Fragment,{children:[h.jsxs(Js,{children:[h.jsx(ce,{analytics:M,onLoad:e=>e.trackPageLoaded(Xt.Event.aiCFOPage)}),U&&ne.drawerElement,h.jsx(Ws,{...jt,currentChatSessionId:u,allSessionsWithOrderedQuestionAnswers:Ue,allUsers:ct,isAiCardCreationEnabled:mt,isCardPolicyEnabled:St,openOnboardingPage:()=>S(!0),userId:w.userId,setIsAiCfoOpen:r,navigate:l,sessionFromUrl:c,location:i,isSubmitting:At,isEmptyChatWithSession:Rt,currentTenant:k,emailLinkQuestion:bt??void 0,autoSubmitEmailLinkQuestion:vt,onEmailLinkQuestionProcessed:yt,routedInitialQuestionSource:Et,routedInitialQuestionSuggestionIndex:Pt,onCardPolicyVendorSearchTextChange:ht,onMenuClick:U?ne.open:void 0,isFileUploadEnabled:s,isUploadPromoVisible:It,onUploadPromoClose:gt,exploreSuggestedPromptQuestions:kt,exploreSuggestedPromptQuestionsLoading:Ct,isSkillsOpen:A,isRoutinesOpen:T,routineCanCreate:m,routineEditing:E,routineEditorOpen:K,routineListError:a.fetchState==="Error",routineListLoading:a.fetchState==="In-Progress",routineMaxRoutines:a.maxRoutines,routineSaveError:o.fetchState==="Error",routineSaving:o.fetchState==="In-Progress",routineSchedulableSkills:X,routines:a.routines,onRoutineCreate:Xe,onRoutineDelete:rt,routineHistoryError:I.fetchState==="Error",routineHistoryLoading:I.fetchState==="In-Progress",chatSidePanel:ft,routineDetail:ke,routineRunningScheduleId:o.runningScheduleId,routineRuns:I.runs,onRoutineEdit:Ze,onRoutineOpenRun:(e,d)=>se(d,e.scheduleId),onRoutineRun:st,onRoutineCloseDetail:te,onRoutineDraft:it,routineDraftPrompt:Y,onRoutineOpenDetail:ee,onRoutineEditorCancel:et,onRoutineLoadSkillInstructions:ut,onRoutineSave:tt,onRoutineSetEnabled:lt,isCreateSkillEnabled:D,promoDismissalScope:y}),p&&U?h.jsx(Fs,{anchor:"right",open:p,transitionDuration:250,PaperProps:{component:Xs,style:{width:"100%"}},slotProps:{backdrop:{style:{backgroundColor:"transparent",cursor:"pointer"}}},onClose:()=>S(!1),children:h.jsx(ze,{onClick:e=>e.stopPropagation(),children:h.jsx(me,{isTOSAccepted:x,acceptMasterTOSState:g.masterTOSAcceptanceState,onCloseClick:()=>S(!1),onCompleteClick:()=>{x||k.userRoleId==null||t(pe(k.userRoleId)),S(!1)}})})}):null]}),p&&!U?h.jsx(Jt,{open:p,onClose:()=>S(!1),children:h.jsx(Kt,{children:Ut})}):null]})},ze=$(Ms)`
|
|
1
|
+
import{j as h}from"./liveblocks-CgHUgeBY.js";import{a as n}from"./sentry-DSWD_gIh.js";import{u as _t,h as Dt,i as Lt,g as Bt,j as b,l as Ft}from"./core-Cc7wW2EM.js";import{a as Mt,h as Vt,e7 as $t,z as Nt,a2 as qt,e8 as Gt,e9 as Ht,ea as zt,bq as Be,eb as We,ec as Wt,bp as Je,a5 as ge,a9 as ce,j as M,ed as me,ee as Jt,ef as Kt,av as Yt,U as Xt,w as Zt,eg as es,eh as ts,aw as ss,ei as ns,ej as as,ek as os,el as is,p as rs,bl as Fe,em as ls}from"./index-vIt7RQvO.js";import{fE as F,gt as R,U7 as us,a2h as ds,a2i as cs,jM as ms,a2j as Ss,jJ as hs,a2k as Se,jp as W,jS as J,jv as Ie,jc as he,ja as ps,jU as fs,jE as Ke,Ug as Me,gv as V,gK as gs,Uf as Is,U0 as Ve,fF as Cs,j3 as ks,a2l as bs,g8 as vs,jl as Es,jh as Ps,fG as pe,gf as ys,a2m as ws,a2n as xs,a2o as Rs,gu as Ts,go as $e,k4 as Ne,gq as qe,gw as js,a2p as Ge,jV as Os,je as As,jy as Us,jQ as He,jB as Qs,gx as _s,gy as Ds,gz as Ls,gA as Bs}from"./zeni-epic-state-BVJjEVAA.js";import{D as Fs,n as $,S as Ms,P as Vs}from"./mui-C4zFSCiU.js";import{u as $s}from"./useAiCfoDashboardSuggestedQuestionsChips-BFr557mr.js";import{p as Ns}from"./pathToGoBack-C17GqrA7.js";import{j as qs}from"./routePaths-C0UIXwMQ.js";import{u as Gs}from"./useTaskManagerPusherEvents-X_H33C0C.js";import"./recharts-DJGeJ2v_.js";import"./analytics-S5MhEivL.js";import"./plaid-vsHcqLdj.js";import"./dnd-DEyyKSEC.js";import"./stripe-cKAAJElX.js";import"./lottie-C1A2hiZE.js";import"./lexical-DXgKWO29.js";import"./pdf-rXyPRm1U.js";import"./utils-DiIEQ7_h.js";(function(){try{var s=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},r=new s.Error().stack;r&&(s._sentryDebugIds=s._sentryDebugIds||{},s._sentryDebugIds[r]="6b33b95e-44da-44b6-af1f-263ccc18525f",s._sentryDebugIdIdentifier="sentry-dbid-6b33b95e-44da-44b6-af1f-263ccc18525f")}catch{}})();const Hs=["claimed","running","succeeded","failed","timeout"],fe=s=>typeof s=="string"&&s!=="",Ye="chat-response-generated";function zs(s,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 t=R(s).skills.find((l=>l.macroId===r.savedMacroId));return t==null?void 0:{status:"saved",command:t.name}}const Ws=Ft((function(s,r){const t=F(s),l=r.isSubmitting,c=t.uiState?.currentChatSessionId,i=c!=null?ys(s.aiCfoState,c):[],f=ts(s,{allUsers:r.allUsers,onCardPolicyVendorSearchTextChange:r.onCardPolicyVendorSearchTextChange}),p=ws(s),S=xs(s),A=Rs(s);return{showSampleQuestions:r.sessionFromUrl==="explore"&&t.uiState.currentChatSessionId==null,aiCfoView:t,isSubmitting:l,isNewChatSession:r.sessionFromUrl==="new_chat"||r.sessionFromUrl==="explore",isFullView:!0,tableDownloadEndPoint:`${ss}/tableDownload`,exportDownloadEndPoint:os(),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(s).skills,skillSaveState:zs(s,A),skillsEnabled:R(s).skillsEnabled,skillsList:R(s).skills,skillsListError:R(s).fetchState==="Error",skillsListLoading:R(s).fetchState==="In-Progress",skillsCanPublish:R(s).canPublish,skillSaving:A.fetchState==="In-Progress",skillSaveError:A.fetchState==="Error",skillVersionHistory:p.macroId!=null?{macroId:p.macroId,versions:p.versions,error:p.fetchState==="Error",loading:p.fetchState==="In-Progress"}:void 0,skillRestoreBody:S.macroId!=null&&S.version!=null?{macroId:S.macroId,version:S.version,instructions:S.instructions,error:S.fetchState==="Error",loading:S.fetchState==="In-Progress"}:void 0,skillDetail:J(s).detail,skillDetailError:J(s).fetchState==="Error",skillDetailLoading:J(s).fetchState==="In-Progress",syntheticAnswers:i,resolveSyntheticAnswerCardTile:as(s),resolveSyntheticAnswerPolicyTile:ns(s),...f}}),(function(s,r){const{location:t,currentTenant:l,userId:c,navigate:i,currentChatSessionId:f,allSessionsWithOrderedQuestionAnswers:p,isAiCardCreationEnabled:S,isCardPolicyEnabled:A,setIsAiCfoOpen:D}=r,T=l.tenantEmailDomain;return{onEventReceived:(a,o)=>{if(a===Ye&&typeof o.text=="string"&&typeof o.metadata=="object"){const m=o,E=_s(m.type),v=m.metadata.chat_session_id??null,{currentChatSession:K,currentQuestionAnswer:j,currentQuestionAnswerSummary:Y}=Je(p,v);E!=="answer"?M.trackAICFOChatResponseGenerated(E,j?.question.questionText??"",m.text,v,ls(Y,K),m.metadata.message_id??null):M.trackAICFOChatAnswerGenerated(m.text,j?.question.questionText??"",(m.follow_up_questions?.length??0)>0,!!m.assumptions,!!m.insights,m.visualization!=null,Ds(m.visualization?.type??"")??null,v,m.summarized_title,m.metadata.message_id??null),s(Ls({chatSessionId:m.metadata.chat_session_id,responseType:E,fetchState:{fetchState:"Completed",error:void 0}})),s(Bs({chatSessionId:m.metadata.chat_session_id,answerPayload:m,userId:c}))}},onSubmit:(a,o,m,E,v)=>{a&&Fe(s,a,o,f,p,c,E,m,void 0,v)},onFetchSkills:()=>{s(Ke())},onOpenSkill:a=>{s(Ie({macroId:a})),s(Qs({macroId:a}))},onSaveSkill:(a,o)=>{s(He({draft:a,macroId:o}))},onSaveSkillDraft:a=>{const o=a.displayName?.trim()??"",m=a.name?.trim()??"";s(He({draft:{name:o.length>0?o:m,description:a.description?.trim()??null,instructions:a.instructions,visibility:"private"}}))},onFetchSkillVersionBody:(a,o)=>{s(Us({macroId:a,version:o}))},onDeleteSkill:a=>{s(As({macroId:a}))},onSetSkillVisibility:(a,o)=>{s(Os({macroId:a,visibility:o}))},onCloseSkillDetail:()=>{s(Ge())},onRunSkill:(a,o)=>{s(V()),s($e()),Fe(s,o,"user_input",void 0,p,c,void 0,void 0,void 0,a),s(Ge())},updateCurrentInput:a=>{s(qe(a))},onStopSubmit:()=>{},onUpdateScrollYOffset:a=>{s(js(a))},onSelectSampleQuestion:()=>{},onBackClick:()=>{i(-1)},onCloseClick:()=>{const a=ge(t.state?.pathnameStackToGoBack),o=a.poppedPathname??Ns(1);i(o,{state:{...t.state,pathnameStackToGoBack:a.newStack}}),s(qe(""))},togglePageView:()=>{const a=ge(t.state?.pathnameStackToGoBack),o=a.poppedPathname??`/${l.tenantEmailDomain}/dashboard`;i(o,{state:{...We(t.state),pathnameStackToGoBack:a.newStack,message:"open_ai_cfo_drawer"}}),D(!0)},onCopy:()=>{},onThumbsUp:(a,o)=>{f!=null&&o?.messageId!=null&&s(Ne(f,o.messageId,"positive",o.questionText,o.answerText))},onThumbsDown:(a,o)=>{f!=null&&o?.messageId!=null&&s(Ne(f,o.messageId,"negative",o.questionText,o.answerText))},onTogglePageView:()=>{i(-1)},onNewChatClick:()=>{s(V()),f!=null&&s($e());const a=rs(t.state?.pathnameStackToGoBack,t.pathname);i(`/${l.tenantEmailDomain}/ai-cfo/new_chat`,{state:{pathnameStackToGoBack:a.slice(0,-1),referrer:"Sidebar"}})},onToggleCotCollapsed:(a,o)=>{s(Ts({questionAnswerId:a,isCollapsed:o}))},onMenuClick:r.onMenuClick,...is(s,{isAiCardCreationEnabled:S,isCardPolicyEnabled:A,currentChatSessionId:f,onAfterCardsCreationSubmit:()=>{D(!0),i(`/${T}/cards`,{state:{...t.state}})},onAfterCardPolicySubmit:()=>{D(!0),i(`/${T}/cards/policy`,{state:{...t.state}})}})}}))(Zt(es)),Cn=({isFileUploadEnabled:s})=>{const{setIsAiCfoOpen:r}=Mt(),t=_t(),l=Dt(),{session_id:c}=Lt(),i=Bt(),f=new URLSearchParams(i.search).get("routine")??void 0,[p,S]=n.useState(!1),A=b((e=>F(e).uiState.isSkillsBrowserOpen===!0)),D=b((e=>R(e).skillsEnabled)),T=b((e=>F(e).uiState.isRoutinesBrowserOpen===!0)),a=b((e=>us(e))),o=b((e=>ds(e))),m=b((e=>cs(e))),[E,v]=n.useState(void 0),[K,j]=n.useState(!1),[Y,Ce]=n.useState(void 0),Xe=n.useCallback((()=>{Ce(void 0),v(void 0),j(!0)}),[]),Ze=n.useCallback((e=>{v(e),j(!0)}),[]),et=n.useCallback((()=>{v(void 0),j(!1)}),[]),tt=n.useCallback((e=>{t(ms({draft:e,...E!=null&&{scheduleId:E.scheduleId}})),v(void 0),j(!1)}),[t,E]),P=f,ke=a.routines.find((e=>e.scheduleId===P)),I=b((e=>Ss(e))),st=n.useCallback((e=>{t(hs({scheduleId:e.scheduleId}))}),[t]);n.useEffect((()=>{t(P!=null?W({scheduleId:P}):Se())}),[t,P]);const B=ke?.macroId,nt=b((e=>J(e))),be=B!=null&&B!==""&&nt.fetchState==="Not-Started";n.useEffect((()=>{be&&B!=null&&t(Ie({macroId:B}))}),[t,be,B]);const at=b((e=>F(e).uiState.currentChatSessionId))??c,C=a.routines.find((e=>e.scheduleId===f))??a.routines.find((e=>e.scheduleId===Vt(at))),O=C?.scheduleId??null,[ve,ot]=n.useState(!0);n.useEffect((()=>{O!=null&&t(W({scheduleId:O}))}),[t,O]);const Ee=I.runs.some((e=>e.status==="claimed"||e.status==="running"))===!0;n.useEffect((()=>{if(P==null||Ee!==!0)return;const e=window.setInterval((()=>{t(W({scheduleId:P})),t(he())}),5e3);return()=>window.clearInterval(e)}),[t,Ee,P]);const it=n.useCallback((e=>{Ce(e),v(void 0),j(!0)}),[]),rt=n.useCallback((e=>{t(ps({scheduleId:e.scheduleId}))}),[t]),lt=n.useCallback(((e,d)=>{t(fs({enabled:d,scheduleId:e.scheduleId}))}),[t]);n.useEffect((()=>{T&&t(he())}),[t,T]);const Pe=b((e=>R(e).skills)),X=n.useMemo((()=>Pe.map((e=>({macroId:e.macroId,name:e.displayName??e.name})))),[Pe]),ut=n.useCallback((e=>{t(Ie({macroId:e}))}),[t]),Z=n.useCallback((()=>{t(Ke()),t(Me())}),[t]),dt=n.useCallback((()=>{t(V())}),[t]),{allUsers:ct,isAiCardCreationEnabled:mt,isCardPolicyEnabled:St,onCardPolicyVendorSearchTextChange:ht}=$t();n.useEffect((()=>{t(gs())}),[t]);const g=b((e=>F(e))),w=Nt.getSignedInUser();n.useEffect((()=>c==="routines"?(t(V()),void t(Is())):c==="skills"?(t(Se()),t(Ve()),void t(Me())):(O==null&&t(Se()),t(Ve()),void t(V()))),[t,O,f,c]);const pt=qt(),U=Yt(pt),k=b((e=>Cs(e))),u=g.uiState.currentChatSessionId,y=k.tenantEmailDomain,L=y!=null&&y!=="",ee=n.useCallback((e=>{L&&l(`/${y}/ai-cfo/routines?routine=${encodeURIComponent(e.scheduleId)}`)}),[L,l,y]),te=n.useCallback((()=>{L&&l(`/${y}/ai-cfo/routines`)}),[L,l,y]),se=n.useCallback(((e,d)=>{const Q=e.sessionId??I.sessionId;Q!=null&&L&&l(`/${y}/ai-cfo/${Q}?routine=${encodeURIComponent(d)}`)}),[L,l,I.sessionId,y]),ft=n.useMemo((()=>C==null?void 0:{error:I.fetchState==="Error",kind:"routineRuns",loading:I.fetchState==="In-Progress"||I.fetchState==="Not-Started",routineName:C.name,schedule:Gt(C),skillName:C.isAdHoc===!0?void 0:X.find((e=>e.macroId===C.macroId))?.name,onOpenSkill:C.isAdHoc===!0?void 0:Z,runs:I.runs,tzName:C.tzName,unreadCount:C.unreadRuns,open:ve,onToggle:()=>ot((e=>!e)),onOpenRun:e=>se(e,C.scheduleId),onOpenRoutine:()=>ee(C),onOpenRoutines:te}),[Z,te,ee,se,ve,C,I.fetchState,I.runs,X]),{handleUploadPromoClose:gt,isUploadPromoVisible:It}=Ht({isFileUploadEnabled:s,tenantEmailDomain:y}),ne=zt({currentTenant:k,currentChatSessionId:u,aiCfoView:g,skillsEnabled:D,onCloseSkills:dt,onOpenSkills:Z}),{isSuggestedQuestionsLoading:Ct,suggestedPromptQuestions:kt}=$s(),N=i.state,q=N?.aiCfoInitialQuestion,ye=!!N?.aiCfoShouldSubmit;n.useEffect((()=>{const e=i.state;if(e?.[Be]!==!0)return;S(!0);const d={...e};delete d[Be],l(i,{replace:!0,state:d})}),[i.pathname,i.search,i.state,l]);const[bt,ae]=n.useState(null),[vt,oe]=n.useState(!1),[Et,ie]=n.useState(void 0),[Pt,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 d=e?.aiCfoSuggestionIndex;re(typeof d=="number"?d:void 0),we.current=!0}}),[q,ye,i.state]);const yt=n.useCallback((()=>{ae(null),oe(!1),ie(void 0),re(void 0),l(i.pathname,{replace:!0,state:We(i.state)})}),[i.pathname,i.state,l]),xe=n.useMemo((()=>new URLSearchParams(i.search)),[i.search]),Re=xe.get("ref")??N?.aiCfoRef,le=xe.get("emailRefId")??N?.aiCfoEmailRefId,Te=n.useRef(!1);n.useEffect((()=>{Te.current||Re!=="month-end-email"||le==null||u!=null||w==null||(t(ks("controller",w.userId,le,"MONTH_END_EMAIL")),Te.current=!0)}),[Re,le,u,t,w]);const G=g.uiState.lastContextMessage;n.useEffect((()=>{G!=null&&G!==""&&u!=null&&(ae(G),oe(!0),ie(void 0),re(void 0),t(bs()))}),[G,u,t]);const wt=k.masterTOSInfo,x=wt?.isMasterTOSAccepted??!1,{visitedSessions:je}=Wt(u),H=g.fetchState,z=g.uiState.chatSessionsNextPageToken.hasMore||!g.uiState.chatSessionsFirstPageFetched,Oe=u!=null?g.fetchChatSessionHistoryByChatSessionId?.[u]?.fetchState??"Not-Started":"Not-Started",Ae=u==null||(g.uiState.chatHistoryNextPageToken[u]?.hasMore??!0),Ue=g.allSessionsWithOrderedQuestionAnswers,{currentSessionQuestionAnswers:xt}=Je(Ue,u),Rt=xt.length===0;n.useEffect((()=>{x||U||l("../dashboard",{state:{...i.state,message:"open_ai_cfo_drawer"}})}),[x,U,l,i.state]);const Tt=n.useCallback((()=>{const e=ge(i.state?.pathnameStackToGoBack),d=k.tenantEmailDomain;l(e.poppedPathname??(d!=null?`/${d}/dashboard`:".."),{state:{...i.state,pathnameStackToGoBack:e.newStack}})}),[k.tenantEmailDomain,i.state,l]),Qe=n.useRef(void 0),_e=n.useRef(void 0);n.useEffect((()=>{const e=c!==Qe.current,d=u!==_e.current;Qe.current=c,_e.current=u,c!==u&&(!e||c==null||qs(c)?d&&u!=null&&l(`../ai-cfo/${u}`,{state:{...i.state}}):t(vs({sessionId:c,agentId:"controller"})))}),[u,c]);const jt=n.useMemo((()=>({events:je.map((e=>`private-encrypted-chat-${e}.${Ye}`)),eventCallback:(e,d,Q)=>Q.onEventReceived(e,d)})),[je]);n.useEffect((()=>{H!=="In-Progress"&&z&&t(Es())}),[H,z,t]),n.useEffect((()=>{u!=null&&Oe!=="In-Progress"&&Ae&&w!=null&&(c===u||H==="Completed"&&!z)&&t(Ps(u,w.userId))}),[Oe,H,Ae,z,u,w,c,t]);const ue=w?.userId,Ot=n.useMemo((()=>{return ue==null?[]:[(e=ue,`private-encrypted-routines-${e}.routine-run-updated`)];var e}),[ue]),De=n.useCallback((e=>{const d=e!=null&&(e===P||e===O);(T||d)&&t(he()),d&&t(W({scheduleId:e}))}),[t,T,O,P]);Gs({events:Ot,onSubscribed:()=>De(P??O),onEvent:(e,d)=>{const Q=(de=>{if(de==null||typeof de!="object")return null;const _=de;return fe(_.schedule_id)&&fe(_.run_id)?{scheduleId:_.schedule_id,runId:_.run_id,status:Hs.find((Qt=>Qt===_.status))??null,finishedAt:fe(_.finished_at)?_.finished_at:null}:null})(d);Q!=null&&De(Q.scheduleId)}});const Le=e=>e.trackAICFOOnboardingScreenStateChanged("open","first_visit");if(w==null||c==null)throw Error("Can't access AI Controller page without signing in...");const At=u!=null&&g.responseStateByChatSessionId?.[u]?.answer?.fetchState==="In-Progress";if(!x&&U)return h.jsxs(Ks,{children:[h.jsx(ce,{analytics:M,onLoad:Le}),ne.drawerElement,h.jsx(Ys,{children:h.jsx(ze,{children:h.jsx(me,{isTOSAccepted:!1,acceptMasterTOSState:g.masterTOSAcceptanceState,onCloseClick:Tt,onCompleteClick:()=>{k.userRoleId!=null&&t(pe(k.userRoleId))}})})})]});const Ut=h.jsxs(h.Fragment,{children:[p&&!x?h.jsx(ce,{analytics:M,onLoad:Le}):null,h.jsx(me,{isTOSAccepted:x,acceptMasterTOSState:g.masterTOSAcceptanceState,showHeader:!1,togglePageView:x?()=>S(!1):void 0,onCloseClick:()=>S(!1),onCompleteClick:()=>{x||k.userRoleId==null||t(pe(k.userRoleId)),S(!1)}})]});return h.jsxs(h.Fragment,{children:[h.jsxs(Js,{children:[h.jsx(ce,{analytics:M,onLoad:e=>e.trackPageLoaded(Xt.Event.aiCFOPage)}),U&&ne.drawerElement,h.jsx(Ws,{...jt,currentChatSessionId:u,allSessionsWithOrderedQuestionAnswers:Ue,allUsers:ct,isAiCardCreationEnabled:mt,isCardPolicyEnabled:St,openOnboardingPage:()=>S(!0),userId:w.userId,setIsAiCfoOpen:r,navigate:l,sessionFromUrl:c,location:i,isSubmitting:At,isEmptyChatWithSession:Rt,currentTenant:k,emailLinkQuestion:bt??void 0,autoSubmitEmailLinkQuestion:vt,onEmailLinkQuestionProcessed:yt,routedInitialQuestionSource:Et,routedInitialQuestionSuggestionIndex:Pt,onCardPolicyVendorSearchTextChange:ht,onMenuClick:U?ne.open:void 0,isFileUploadEnabled:s,isUploadPromoVisible:It,onUploadPromoClose:gt,exploreSuggestedPromptQuestions:kt,exploreSuggestedPromptQuestionsLoading:Ct,isSkillsOpen:A,isRoutinesOpen:T,routineCanCreate:m,routineEditing:E,routineEditorOpen:K,routineListError:a.fetchState==="Error",routineListLoading:a.fetchState==="In-Progress",routineMaxRoutines:a.maxRoutines,routineSaveError:o.fetchState==="Error",routineSaving:o.fetchState==="In-Progress",routineSchedulableSkills:X,routines:a.routines,onRoutineCreate:Xe,onRoutineDelete:rt,routineHistoryError:I.fetchState==="Error",routineHistoryLoading:I.fetchState==="In-Progress",chatSidePanel:ft,routineDetail:ke,routineRunningScheduleId:o.runningScheduleId,routineRuns:I.runs,onRoutineEdit:Ze,onRoutineOpenRun:(e,d)=>se(d,e.scheduleId),onRoutineRun:st,onRoutineCloseDetail:te,onRoutineDraft:it,routineDraftPrompt:Y,onRoutineOpenDetail:ee,onRoutineEditorCancel:et,onRoutineLoadSkillInstructions:ut,onRoutineSave:tt,onRoutineSetEnabled:lt,isCreateSkillEnabled:D,promoDismissalScope:y}),p&&U?h.jsx(Fs,{anchor:"right",open:p,transitionDuration:250,PaperProps:{component:Xs,style:{width:"100%"}},slotProps:{backdrop:{style:{backgroundColor:"transparent",cursor:"pointer"}}},onClose:()=>S(!1),children:h.jsx(ze,{onClick:e=>e.stopPropagation(),children:h.jsx(me,{isTOSAccepted:x,acceptMasterTOSState:g.masterTOSAcceptanceState,onCloseClick:()=>S(!1),onCompleteClick:()=>{x||k.userRoleId==null||t(pe(k.userRoleId)),S(!1)}})})}):null]}),p&&!U?h.jsx(Jt,{open:p,onClose:()=>S(!1),children:h.jsx(Kt,{children:Ut})}):null]})},ze=$(Ms)`
|
|
2
2
|
display: flex;
|
|
3
3
|
min-height: 100%;
|
|
4
4
|
flex-direction: column;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{j as d}from"./liveblocks-e6rGc1UF.js";import{a as o,R as ya}from"./sentry-DsyKtMW2.js";import{u as Me,j as r,g as Ta,h as $a,q as R}from"./core-CHD8T-IM.js";import{fF as Fe,T_ as Ba,T$ as Ue,g9 as xa,gv as K,U0 as Q,jE as Ie,jc as ve,U1 as Aa,U2 as _a,gO as Da,p$ as Ma,U3 as Fa,U4 as ye,gm as Ua,U5 as $,fE as Ga,gt as Ra,U6 as Za,U7 as Va,U8 as ja,U9 as Te,Ua as Ha,Ub as $e,Uc as Na,Eb as Pa,gn as La,h1 as Oa,cV as za,Ud as qa,Ue as Ya,qC as Ja,g8 as Ka,j6 as Qa,Uf as Wa,Ug as Xa,wu as et,go as at}from"./zeni-epic-state-BO3zdDfL.js";import{w as tt,i as nt,a as ot,F as st,E as rt,N as it,f as m,c as lt,u as dt,d as ct,Q as ut,e as mt,g as Ct,h as pt,j as ht,l as ft,z as gt,k as Z,p,m as Be,n as bt,o as St,q as xe,r as kt,R as Ae,s as Et,v as wt,x as X,y as W,A as It,B as vt,C as yt,L as Tt,D as $t,H as Bt,I as ee,J as xt,K as At}from"./index-DKH4PK2B.js";import{A as _t,b as Dt,I as Mt,a as _e,d as Ft,D as De}from"./mui-NTaF3UaY.js";import{u as Ut}from"./InboxNotificationsProvider-x0fdv66l.js";import{u as Gt}from"./useTaskManagerAccess-CUv6a62x.js";import{u as Rt}from"./expenseAutomationHelper-kGR6VZFG.js";import"./recharts-C6xUtcdL.js";import"./analytics-C3e3An3a.js";import"./plaid-DdTo7m1-.js";import"./dnd-Dwi6R-ey.js";import"./stripe-cKAAJElX.js";import"./lottie-B778bt56.js";import"./lexical-CMNdypK6.js";import"./pdf-Bx92ZlM_.js";import"./utils-CCA3F0sZ.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]="7e331d0d-2f81-4513-b92b-045f1e943eed",a._sentryDebugIdIdentifier="sentry-dbid-7e331d0d-2f81-4513-b92b-045f1e943eed")}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"}}))),Vt=tt((function({tenantEmailDomain:a}){const{isAiCfoOpen:C,setIsAiCfoOpen:b}=ot(),[V,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(K()),n(Q()))}),[n,ne]),o.useEffect((()=>{n(K()),n(Q())}),[n,a]);const{useFeatureGate:u}=it(),{isFeatureEnabled:oe}=u(m.isDebitCardFeatureEnabled),k=lt(),i=r((e=>Fe(e))),H=i.masterTOSInfo?.isMasterTOSAccepted??!1,{setLoading:Ve}=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,He]=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),ze=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,qe=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=Fa(e);l!=null&&n(ye(l))}}}),[le,t.state]);const Ye=qe||g,L=r((e=>e.tenantState)),Je=r((e=>L.fetchState==="Completed"?Ua(e):[])),{isFeatureEnabled:Ke}=u(m.isApAgingFeatureEnabled),{isFeatureEnabled:Qe}=u(m.isArAgingFeatureEnabled),{isFeatureEnabled:We}=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=>Va(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,z]=o.useState(void 0),q=O.uiState.currentChatSessionId,F=v!=null?O.deleteChatSessionStateByChatSessionId[v]?.fetchState:void 0,me=ft(F),{inboxNotifications:Y,isLoading:Ce,isFetchingMore:pe,hasFetchedAll:he,fetchMore:ua}=Ut(),U=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"&&F==="Completed"?(n(Te({chatSessionId:v})),z(void 0),void s(`/${a}/ai-cfo/explore`,{state:{...t.state,referrer:"Sidebar"}})):void(F==="Error"&&(n(Te({chatSessionId:v})),z(void 0)))}),[n,t.state,s,F,v,me,a]),o.useEffect((()=>{if(Ce===!1&&pe===!1&&he===!0&&i?.companyId!=null&&Y!=null){const e=`dashboard_${i.companyId}`;He(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(Ha("task_manager","dashboard"))}),[w,_,g,de.fetchState,ae.tenantId,n]),o.useEffect((()=>{g||U.fetchState!=="Not-Started"||n($e({fetchCountState:{fetchState:"In-Progress",error:void 0}},"comments"))}),[g,U.fetchState,n]),o.useEffect((()=>{if(N!=null){const{fetchState:e}=U;e!=="In-Progress"&&e!=="Completed"||(e==="In-Progress"&&n($e({fetchCountState:{fetchState:"Completed",error:void 0}},"comments")),n(Ue({unreadCount:N},"comments")))}}),[N,U.fetchState]);const ma={fetchStatus:sa,count:ta},y=[];Ke===!1&&y.push("accounts_payable_aging"),Qe===!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=za(pa),T=e=>{A(e)},fa=ze,ga=i?.rewardsLastViewedTime==null,ba=k?.userEmail!=null&&re.fetchState==="Completed"&&qa(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(Ja({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"?Je: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=>{Ve(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 H?(n(ve()),n(Wa()),void s(`/${a}/ai-cfo/routines`,{state:{pathnameStackToGoBack:p(t.state?.pathnameStackToGoBack,t.pathname),referrer:"Sidebar"}})):void W({location:t,navigate:s,mergeState:{referrer:"Sidebar"}});if(e.type==="skills")return H?(n(Ie()),n(Xa()),void s(`/${a}/ai-cfo/skills`,{state:{pathnameStackToGoBack:p(t.state?.pathnameStackToGoBack,t.pathname),referrer:"Sidebar"}})):void W({location:t,navigate:s,mergeState:{referrer:"Sidebar"}});if(n(K()),n(Q()),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",q??null,null),!H)return void W({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),J=e.type,we=At(J)&&J!=="command_center";if(J!=="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)?(q!=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(Qa(e)),q===e&&z(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(Ka({sessionId:e,agentId:"controller"})),s(`../${a}/ai-cfo/${e}`,{state:{...t.state}})},halloweenAnimationEnabled:We,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(Ht,{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(Ft,{}),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:V,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=>Fe(A))),V={events:b.userRoleId!=null?[`private-encrypted-${b.userRoleId}.dashboard-user-notification`]:[],eventCallback:(A,S)=>{nt(S)&&Ba(S.mode)==="dashboard"&&C(Ue({unreadCount:S.data.unread},"tasks"))}};return d.jsx(Vt,{tenantEmailDomain:a,...V})},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-CgHUgeBY.js";import{a as o,R as ya}from"./sentry-DSWD_gIh.js";import{u as Me,j as r,g as Ta,h as $a,q as Z}from"./core-Cc7wW2EM.js";import{fF as Fe,T_ as Ba,T$ as Ue,g9 as xa,gv as K,U0 as W,jE as Ie,jc as ve,U1 as Aa,U2 as _a,gO as Da,p$ as Ma,U3 as Fa,U4 as ye,gm as Ua,U5 as $,fE as Ra,gt as Za,U6 as Ga,U7 as Va,U8 as ja,U9 as Te,Ua as Ha,Ub as $e,Uc as Na,Eb as Pa,gn as La,h1 as Oa,cV as za,Ud as qa,Ue as Ya,qC as Ja,g8 as Ka,j6 as Wa,Uf as Qa,Ug as Xa,wu as et,go as at}from"./zeni-epic-state-BVJjEVAA.js";import{w as tt,i as nt,a as ot,F as st,E as rt,N as it,f as m,c as lt,u as dt,d as ct,V as ut,e as mt,g as Ct,B as pt,h as ht,l as ft,z as gt,j as G,p,m as Be,k as bt,n as St,o as xe,q as kt,D as Ae,r as Et,s as wt,v as X,x as Q,y as It,A as vt,C as yt,L as Tt,H as $t,I as Bt,J as ee,K as xt,O as At}from"./index-vIt7RQvO.js";import{A as _t,b as Dt,I as Mt,a as _e,d as Ft,D as De}from"./mui-C4zFSCiU.js";import{u as Ut}from"./InboxNotificationsProvider-CYNlrTK-.js";import{u as Rt}from"./useTaskManagerAccess-BeNfkHpZ.js";import{u as Zt}from"./expenseAutomationHelper-iXuIUZiF.js";import"./recharts-DJGeJ2v_.js";import"./analytics-S5MhEivL.js";import"./plaid-vsHcqLdj.js";import"./dnd-DEyyKSEC.js";import"./stripe-cKAAJElX.js";import"./lottie-C1A2hiZE.js";import"./lexical-DXgKWO29.js";import"./pdf-rXyPRm1U.js";import"./utils-DiIEQ7_h.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]="7dcc849f-1712-4677-8e90-8f3bc77b754f",a._sentryDebugIdIdentifier="sentry-dbid-7dcc849f-1712-4677-8e90-8f3bc77b754f")}catch{}})();const B="AppDrawer",c={root:`${B}-root`,drawer:`${B}-drawer`,appBar:`${B}-appBar`,menuButton:`${B}-menuButton`,appBarZenilogo:`${B}-appBarZenilogo`,drawerZenilogo:`${B}-drawerZenilogo`},Gt=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"}}))),Vt=tt((function({tenantEmailDomain:a}){const{isAiCfoOpen:C,setIsAiCfoOpen:b}=ot(),[V,A]=ya.useState(!1),[S,Re]=o.useState(!1),t=Ta(),s=$a(),ae=xa(),te=st(),n=Me(),[Ze,Ge]=o.useState(!1),j=rt(),ne=t.pathname.includes("/ai-cfo/");o.useEffect((()=>{ne||(n(K()),n(W()))}),[n,ne]),o.useEffect((()=>{n(K()),n(W())}),[n,a]);const{useFeatureGate:u}=it(),{isFeatureEnabled:oe}=u(m.isDebitCardFeatureEnabled),k=lt(),i=r((e=>Fe(e))),H=i.masterTOSInfo?.isMasterTOSAccepted??!1,{setLoading:Ve}=dt(),E=ct(),{isTaskManagerAccessEnabled:_,isZeniUser:je}=Rt(k),se=ut(),w=mt();o.useEffect((()=>{w&&E&&(n(Ie()),n(ve()))}),[n,w,i.tenantId,E]);const[N,He]=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),ze=i.companyTreasuryInfo?.info?.businessVerificationStatus?.code==="verified",re=r((e=>Aa(e)));o.useEffect((()=>{const e=()=>{Ge(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,qe=Z("/signout")!==null,M=Z("/:tenantEmailDomain/dashboard")!==null,ie=Z("/:tenantEmailDomain/reports")!==null,g=Z("/:tenantEmailDomain/onboarding/*")!==null,le=Zt();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=Fa(e);l!=null&&n(ye(l))}}}),[le,t.state]);const Ye=qe||g,L=r((e=>e.tenantState)),Je=r((e=>L.fetchState==="Completed"?Ua(e):[])),{isFeatureEnabled:Ke}=u(m.isApAgingFeatureEnabled),{isFeatureEnabled:We}=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=>Ra(e))),ra=r((e=>Za(e).skillsEnabled)),ia=r((e=>Ga(e))),ce=r((e=>Va(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,z]=o.useState(void 0),q=O.uiState.currentChatSessionId,F=v!=null?O.deleteChatSessionStateByChatSessionId[v]?.fetchState:void 0,me=ft(F),{inboxNotifications:Y,isLoading:Ce,isFetchingMore:pe,hasFetchedAll:he,fetchMore:ua}=Ut(),U=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"&&F==="Completed"?(n(Te({chatSessionId:v})),z(void 0),void s(`/${a}/ai-cfo/explore`,{state:{...t.state,referrer:"Sidebar"}})):void(F==="Error"&&(n(Te({chatSessionId:v})),z(void 0)))}),[n,t.state,s,F,v,me,a]),o.useEffect((()=>{if(Ce===!1&&pe===!1&&he===!0&&i?.companyId!=null&&Y!=null){const e=`dashboard_${i.companyId}`;He(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(Ha("task_manager","dashboard"))}),[w,_,g,de.fetchState,ae.tenantId,n]),o.useEffect((()=>{g||U.fetchState!=="Not-Started"||n($e({fetchCountState:{fetchState:"In-Progress",error:void 0}},"comments"))}),[g,U.fetchState,n]),o.useEffect((()=>{if(N!=null){const{fetchState:e}=U;e!=="In-Progress"&&e!=="Completed"||(e==="In-Progress"&&n($e({fetchCountState:{fetchState:"Completed",error:void 0}},"comments")),n(Ue({unreadCount:N},"comments")))}}),[N,U.fetchState]);const ma={fetchStatus:sa,count:ta},y=[];Ke===!1&&y.push("accounts_payable_aging"),We===!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=za(pa),T=e=>{A(e)},fa=ze,ga=i?.rewardsLastViewedTime==null,ba=k?.userEmail!=null&&re.fetchState==="Completed"&&qa(re.notificationSettings,k.userEmail,oe,i,_),Sa=o.useCallback((e=>{const l=t.state?.referrer;if(I.monthEndCloseChecks?.auditSummary!=null&&G.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(Ja({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"?Je: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=>{Ve(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&&G.trackSidePanelClicked(e.type,e.group),T(!1),a==null)return;if(e.type==="routines")return H?(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 H?(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(K()),n(W()),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(G.trackAICFOChatScreenStateChanged("viewed","left_menu",q??null,null),!H)return void Q({location:t,navigate:s,mergeState:{referrer:"Sidebar"}});const R=p(t.state?.pathnameStackToGoBack,t.pathname);return void s(`/${a}/ai-cfo/explore`,{state:{pathnameStackToGoBack:R,referrer:"Sidebar"}})}const x=p(t.state?.pathnameStackToGoBack,t.pathname),J=e.type,we=At(J)&&J!=="command_center";if(J!=="command_center"&&!we||h[i.tenantId]==null||G.trackMonthEndCloseClicked(h[i.tenantId].month,h[i.tenantId].year,"Sidebar"),we&&h[i.tenantId]!=null){const R=h[i.tenantId];return void s(`/${a}/month_end_close_checks/review/${e.type}/${R.month}-${R.year}`,{state:{pathnameStackToGoBack:x,message:l,referrer:"Sidebar"}})}const va=vt(e.type);yt(e.type)?(q!=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(Wa(e)),q===e&&z(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:Re,aiCfoView:O,isAiCfo:Ea,isOnDashboard:M,isTaskManagerAccessEnabled:_,updateCurrentChatSessionId:e=>{n(Ka({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:Ze?`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(Ht,{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(Gt,{className:c.root,children:[d.jsx(Ft,{}),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:V,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=>Fe(A))),V={events:b.userRoleId!=null?[`private-encrypted-${b.userRoleId}.dashboard-user-notification`]:[],eventCallback:(A,S)=>{nt(S)&&Ba(S.mode)==="dashboard"&&C(Ue({unreadCount:S.data.unread},"tasks"))}};return d.jsx(Vt,{tenantEmailDomain:a,...V})},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};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{j as u}from"./liveblocks-e6rGc1UF.js";import{a as d}from"./sentry-DsyKtMW2.js";import{h as U,g as B,u as j,j as y,N as H,l as V,i as W,n as te,o as x}from"./core-CHD8T-IM.js";import{fF as P,Z0 as w,YJ as R,HL as E,HF as q,HJ as A,Hy as J,YL as K,HC as ae,HN as oe,HB as Y,HQ as z,HM as C}from"./zeni-epic-state-BO3zdDfL.js";import{z as O,w as M,b_ as pe,r as T,bU as Q,b$ as le,E as Z,a8 as G,c0 as se,c1 as ne}from"./index-DKH4PK2B.js";import"./mui-NTaF3UaY.js";import{u as X,i as re}from"./ReimbursementApprovalRuleDetailScreen-BT_O_PEv.js";import ie from"./NotFoundScreen-CtgFRYZy.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]="3a59128f-29a8-45e7-a280-235f5d944616",e._sentryDebugIdIdentifier="sentry-dbid-3a59128f-29a8-45e7-a280-235f5d944616")}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(K(!1))},onBackClick:()=>{T(o)?t("../../"):t("../../../bills/setup")},onDeleteRuleClick:a=>{e(J(a,!1))},onEditRuleClick:a=>{a!=null?(e(A(a)),t(`./${a}/edit`)):(e(A()),t("./new"))}}}))(M(pe)),ue=({isLoading:e})=>{const l=U(),t=B(),o=j(),[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]),O.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(H,{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(K(!1))},onBackClick:()=>{T(o)?t("../../"):t("../../../bills/setup")},onDeleteRuleClick:a=>{e(J(a,!0))},onEditRuleClick:a=>{a!=null?(e(A(a)),t(`./${a}/edit`)):(e(A()),t("./new"))},onReorderRules:a=>{e(oe(a,!0))}}}))(M(le)),ve=()=>{const e=y((o=>P(o))),{isApprovalRulesV3Enabled:l,isLoading:t}=Q(e?.tenantId);return l?u.jsx(fe,{isLoading:t}):u.jsx(ue,{isLoading:t})},fe=({isLoading:e})=>{const l=U(),t=B(),o=j(),[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]),O.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(H,{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=T(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=j(),t=B(),{approvalRuleId:o}=W(),a=O.getSignedInUser(),n=Z(),s=y((c=>R(c))),v=y((c=>w(c))),[p,f]=d.useState(!1);if(d.useEffect((()=>{p||(f(!0),l(Y(!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(G,{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=T(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 F(){const e=y((t=>P(t))),{isApprovalRulesV3Enabled:l}=Q(e?.tenantId);return l?u.jsx(me,{}):u.jsx(Se,{})}function me(){const e=U(),l=j(),t=B(),{approvalRuleId:o}=W(),a=O.getSignedInUser(),n=Z(),s=y((c=>R(c))),v=y((c=>w(c))),[p,f]=d.useState(!1);if(X(),d.useEffect((()=>{p||(f(!0),l(Y(!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(G,{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(F,{})}),u.jsx(x,{path:"/:approvalRuleId/edit",element:u.jsx(F,{})}),u.jsx(x,{path:"*",element:u.jsx(ie,{})})]})}export{xe as B};
|
|
1
|
+
import{j as u}from"./liveblocks-CgHUgeBY.js";import{a as d}from"./sentry-DSWD_gIh.js";import{h as U,g as B,u as j,j as y,N as H,l as V,i as W,n as te,o as x}from"./core-Cc7wW2EM.js";import{fF as P,Z0 as w,YJ as R,HL as E,HF as q,HJ as A,Hy as J,YL as K,HC as ae,HN as oe,HB as Y,HQ as z,HM as C}from"./zeni-epic-state-BVJjEVAA.js";import{z as O,w as M,b_ as pe,q as T,bU as Q,b$ as le,E as Z,a8 as G,c0 as se,c1 as ne}from"./index-vIt7RQvO.js";import"./mui-C4zFSCiU.js";import{u as X,i as re}from"./ReimbursementApprovalRuleDetailScreen-BxglZgWl.js";import ie from"./NotFoundScreen-DzxbROot.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]="759eaa3a-209e-418c-8497-a31855b30031",e._sentryDebugIdIdentifier="sentry-dbid-759eaa3a-209e-418c-8497-a31855b30031")}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(K(!1))},onBackClick:()=>{T(o)?t("../../"):t("../../../bills/setup")},onDeleteRuleClick:a=>{e(J(a,!1))},onEditRuleClick:a=>{a!=null?(e(A(a)),t(`./${a}/edit`)):(e(A()),t("./new"))}}}))(M(pe)),ue=({isLoading:e})=>{const l=U(),t=B(),o=j(),[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]),O.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(H,{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(K(!1))},onBackClick:()=>{T(o)?t("../../"):t("../../../bills/setup")},onDeleteRuleClick:a=>{e(J(a,!0))},onEditRuleClick:a=>{a!=null?(e(A(a)),t(`./${a}/edit`)):(e(A()),t("./new"))},onReorderRules:a=>{e(oe(a,!0))}}}))(M(le)),ve=()=>{const e=y((o=>P(o))),{isApprovalRulesV3Enabled:l,isLoading:t}=Q(e?.tenantId);return l?u.jsx(fe,{isLoading:t}):u.jsx(ue,{isLoading:t})},fe=({isLoading:e})=>{const l=U(),t=B(),o=j(),[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]),O.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(H,{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=T(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=j(),t=B(),{approvalRuleId:o}=W(),a=O.getSignedInUser(),n=Z(),s=y((c=>R(c))),v=y((c=>w(c))),[p,f]=d.useState(!1);if(d.useEffect((()=>{p||(f(!0),l(Y(!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(G,{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=T(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 F(){const e=y((t=>P(t))),{isApprovalRulesV3Enabled:l}=Q(e?.tenantId);return l?u.jsx(me,{}):u.jsx(Se,{})}function me(){const e=U(),l=j(),t=B(),{approvalRuleId:o}=W(),a=O.getSignedInUser(),n=Z(),s=y((c=>R(c))),v=y((c=>w(c))),[p,f]=d.useState(!1);if(X(),d.useEffect((()=>{p||(f(!0),l(Y(!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(G,{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(F,{})}),u.jsx(x,{path:"/:approvalRuleId/edit",element:u.jsx(F,{})}),u.jsx(x,{path:"*",element:u.jsx(ie,{})})]})}export{xe as B};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{j as a}from"./liveblocks-e6rGc1UF.js";import{h as J,u as le,g as K,i as ee,j as v,N as Q,l as X,q as aa,n as na,o as y}from"./core-CHD8T-IM.js";import{fF as W,Yj as Ge,bq as It,Sj as ia,bo as vt,bJ as de,Yk as kt,G$ as wt,Io as Re,HC as oa,bn as Ce,Yl as la,Ym as sa,c8 as ra,Yn as ca,l$ as xt,Yo as Bt,Yp as Ct,IS as Ue,Hi as xe,Yq as da,GP as et,Yr as ua,MH as pa,GT as ma,GZ as At,Ys as Se,Yt as _e,Ip as Me,Hf as Dt,Yu as ba,Yv as ha,Is as Ne,Yw as ga,Iy as Sa,Yx as Et,I1 as tt,I6 as ya,Yy as fa,Yz as ce,YA as Tt,YB as jt,YC as Pt,gV as Ia,Hn as Ve,cG as Ft,YD as va,gh as ka,YE as wa,YF as xa,d_ as Rt,dZ as Vt,YG as Oe,YH as Ba,YI as Ca,WT as Ye,YJ as Aa,WU as ie,WV as ze,YK as Da,YL as Ea,YM as Ta,I8 as at,I5 as ja,YN as Pa,YO as Fa,YP as Ra,HT as Va,YQ as $a,YR as La,cu as $t,da as Lt,ma as Ga,bO as Ua,br as Gt,bP as Ut,G3 as _a,YS as Ma,Mu as Na,MA as Oa,Cd as Ya,Iq as za,IZ as Za,mn as ge,YT as Ha,YU as _t,mR as Wa,mh as Mt,mC as Nt,mB as nt,bE as pe,bN as qa,YV as Ja,YW as ye,kN as Ka,YX as it,YY as Xa,kR as Qa,la as en,Jb as tn,YZ as an,mK as nn,J1 as on,Y_ as ot,J5 as ln,Ja as sn,J8 as rn,I$ as cn,Y$ as Ot,H8 as dn,Z0 as un,Z1 as pn,gG as mn,gF as bn,gE as hn,mq as gn,mI as lt,mT as Sn,uX as yn,mz as fn,J3 as In,kX as vn,mY as kn,Z2 as wn,kP as xn,uO as Bn,Z3 as Cn,HZ as An,bK as Dn,bt as En,Ui as Tn,dd as jn,dc as Pn,cF as Fn,cM as Rn}from"./zeni-epic-state-BO3zdDfL.js";import{E as ue,z as V,W as fe,at as Ze,N as oe,f,bj as He,a8 as se,J as A,a9 as Ae,k as E,bw as Vn,a5 as H,aw as We,p as D,a2 as Ie,bx as st,by as rt,bz as $n,aA as Ln,ag as Gn,aT as Un,ac as Yt,G as De,ah as qe,bA as _n,af as zt,bB as Mn,ar as Nn,U as Zt,w as On,bC as Yn,bD as zn,bE as Zn,bF as Hn,bG as Wn,bH as qn,bI as Jn,bJ as Kn,bK as Xn,F as Qn,bL as ei,bt as ti,bM as ai,aj as ni,bN as ii,g as oi}from"./index-DKH4PK2B.js";import{n as G,S as li}from"./mui-NTaF3UaY.js";import{A as ct}from"./AddressScreen-CrINuapd.js";import{g as ne,a as Ee,i as Ht,V as Je,b as Ke,c as si,v as ri,d as ci,A as me,D as be}from"./DomesticWireDetailScreen-086WQWRB.js";import{a as g}from"./sentry-DsyKtMW2.js";import{u as Xe}from"./useAskAiCfoHostNavButtonProps-BcCbRGDK.js";import{u as Wt}from"./useInitialThreadRequest-DDr_z_RH.js";import{u as di}from"./BusinessVerificationPageScreen-DFamYzxa.js";import Be from"./NotFoundScreen-CtgFRYZy.js";import{D as ui}from"./DrawerScreen-B5BqRZEJ.js";import{M as qt}from"./MobileAppDrawer-DX2JnkbM.js";import{F as Jt}from"./FeaturePreviewScreen-D54Nwanb.js";import{S as Te}from"./SetupPagesScreen-fuvb0IYd.js";import{B as pi}from"./BillPayApprovalRoutes-Dp_PkbIk.js";import{F as mi}from"./ScreenRoutes-xDjhbdP1.js";import"./recharts-C6xUtcdL.js";import"./analytics-C3e3An3a.js";import"./plaid-DdTo7m1-.js";import"./dnd-Dwi6R-ey.js";import"./stripe-cKAAJElX.js";import"./lottie-B778bt56.js";import"./lexical-CMNdypK6.js";import"./pdf-Bx92ZlM_.js";import"./utils-CCA3F0sZ.js";import"./routePaths-CGyE-cU7.js";import"./InboxNotificationsProvider-x0fdv66l.js";import"./useTaskManagerAccess-CUv6a62x.js";import"./analyticsHelper-BEL0ra9X.js";import"./ReimbursementApprovalRuleDetailScreen-BT_O_PEv.js";import"./getLocaleForTenant-D-or0iZO.js";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="a80e23ac-5429-4ee0-a355-cfed7716dddb",e._sentryDebugIdIdentifier="sentry-dbid-a80e23ac-5429-4ee0-a355-cfed7716dddb")}catch{}})();const bi=X((function(e,t){const l=Ge(e,t.billId),n=V.getSignedInUser(),c=e.tenantState.currentTenantId,r={userId:n?.userId??"",sessionId:n?.zeniSessionId??"",tenantId:c??""},u=H(t.location.state?.pathnameStackToGoBack);let o=!0;u.poppedPathname?.includes("bills")===!0&&(o=!1);let s=`${l.createdBy?.firstName??"Zeni"} ${l.createdBy?.lastName??""}`;Ce(n)||!l.createdBy?.email?.includes("zeni.ai")||(s="Zeni");let i=!1,d=!1;if(l?.billActivities.length>0){const{isApprovalorRejectBtnVisible:S,isMarkAsPaidBtnVisible:h}=la(l.billActivities,sa(t.currentTenant),n);i=S,d=h}const p=ra(t.currentTenant?.userRole??[]),m=l.transactionDetails!=null&&ca(l.transactionDetails,p,n);return{billDetails:l,isAccountingClassesEnabled:xt(e),createdBy:s,authParams:r,transactionAttachmentEndpoint:`${We}/transaction_attachment`,signedInUser:n,showBackButton:o,isAdmin:p,isRealTimeApprovalEnabled:t.isRealTimeApprovalEnabled,showApproveRejectBtns:i,showMarkAsPaidButtonToApprover:d,hasZeniAssistAccess:t.hasZeniAssistAccess,analytics:E,showMarkAsPaidButtonToCreator:m}}),(function(e,t){const{billId:l,currentTenant:n,location:c,navigate:r}=t,{tenantEmailDomain:u}=n;return{redirectToBillsScreen:()=>{const o=ne(u),s=D(c.state?.pathnameStackToGoBack,c.pathname);r(o,{state:{pathnameStackToGoBack:s}})},redirectToEditableBillScreen:()=>{const o=D(c.state?.pathnameStackToGoBack,c.pathname);r("./edit",{state:{pathnameStackToGoBack:o}})},discardBillDetailsFromLocalStore:()=>{e(Se({}))},deleteBill:o=>{E.trackBillPayDeleteBill(l,o),e(At(l))},cancelAndDeleteBill:(o,s)=>{s===!0?E.trackBillPayCancelAndDeleteBill(l,o):E.trackBillPayCancelBill(l),e(ma(l,s))},onSaveRealTimeApprovals:o=>{e(pa(l,"bill_pay",o))},updateEditRealTimeApproverClicked:o=>{e(ua({isEdit:o,entityId:l,entityType:"bill_pay"}))},approveOrRejectBill:o=>{o.type==="approved"?e(et(l,o.type,"")):e(et(l,o.type,o.description??""))},retryOrRefundBill:o=>{o.type==="retry"?e(xe(l,"retry")):e(xe(l,"refund"))},onAddNewRule:()=>{r("../../bills/approval-rules")},onAttachmentClick:(o,s)=>{const i=Ee(u,o,s),d=D(c.state?.pathnameStackToGoBack,c.pathname);r(i,{state:{pathnameStackToGoBack:d}})},onBackClick:()=>{const o=H(t.location.state?.pathnameStackToGoBack),s=o.poppedPathname??ne(u);r(s,{state:{pathnameStackToGoBack:o.newStack}})},onRetryPaymentClick:()=>{const o=D(c.state?.pathnameStackToGoBack,c.pathname);r("./edit",{state:{pathnameStackToGoBack:o}}),e(da({billId:t.billId}))},onRefundPaymentClick:()=>{e(xe(t.billId,"refund"))},saveBillDetails:(o,s,i)=>{o&&e(Ct({data:i,billId:l})),e(Ue(o?"paid":"pending_approval",o,s,l))},discardOutsideZeniPaymentData:()=>{e(Bt({billId:l}))}}}))(Vn);function hi(){const e=J(),t=le(),l=K(),{billId:n}=ee(),c=ue(),r=V.getSignedInUser(),u=fe(),o=v((U=>W(U))),s=v((U=>Ge(U,n??""))),i=s.transactionDetails?.billPayInfo.stage.code==="draft"&&s.transactionDetails.isDeleted===!1,d=Wt(o?.companyId,{clearParams:s.fetchState==="Completed"&&!i}),{isAiCfoAccessEnabled:p,onAskAiCfoClick:m}=Xe({mobileExploreReferrer:"Bill Details"});Ze({isDataReady:s.fetchState==="Completed"});const S=o?.userRole!=null&&It(o?.userRole),h=o?.company==null||o.company.featuresActivationInfo?.isBillPayFeatureEnabled&&!S,[b,C]=g.useState(!1),[I,j]=g.useState(!1),[B,T]=g.useState(!1),{useFeatureGate:k,useDynamicConfig:$}=oe(),{isFeatureEnabled:O}=k(f.isShowDeletedBillsFeatureEnabled),{isFeatureEnabled:_}=k(f.isBillPayDetectInsufficientFundsEnabled),{configValue:Y}=$(He.zeniAssistConfig),z=ia(o),w=vt(o.userRole),M=h&&de(u?.loggedInUserRoleMap),L=Y.user_ids!=null&&r?.userId!=null&&Y.user_ids.includes(r?.userId),{isFeatureEnabled:Z}=k(f.isInternationalPaymentShaVsOurFeatureEnabled),{isFeatureEnabled:q}=k(f.billPaySetupShowInternationalPaymentByWise);if(g.useEffect((()=>{O&&s.transactionDetails?.isDeleted===!0||o.isZeni===!0&&r?.userEmailDomain==="zeni.ai"&&z===!1?T(!1):T(s.billActivities[0]?.isRealTimeApprovalEnabled&&(w||M||s.allApprovers.find((U=>U.user.userId===r?.userId))!=null||s.transactionDetails?.lastUpdatedByUserId===r?.userId))}),[s.billActivities[0]?.isRealTimeApprovalEnabled,s.allApprovers,s.transactionDetails?.lastUpdatedByUserId,w,M,o.isZeni,z,r]),g.useEffect((()=>{n!=null&&t(kt(n))}),[n]),g.useEffect((()=>{b||s.fetchState=="Completed"||s.fetchState=="In-Progress"||(C(!0),t(wt(n??"",O,L,!1)))}),[b,s,n,t]),g.useEffect((()=>{I||s.fetchState!="Completed"||s.transactionDetails?.billPayInfo.stage.code=="paid"||(j(!0),t(Re(!1,O,L,q,n)),s.billActivities[0]?.isRealTimeApprovalEnabled===!0&&t(oa()))}),[I,s,n,t,O,L,q]),r==null)throw Error("Can't access address page without signing in...");return s.transactionDetails?.billPayInfo.stage.code==="draft"&&s.transactionDetails.isDeleted===!1?a.jsx(Q,{to:`./edit${l.search}`}):s.deleteStatus.fetchState==="In-Progress"||s.cancelAndDeleteStatus.fetchState==="In-Progress"||s.cancelStatus.fetchState==="In-Progress"?a.jsx(se,{fetchState:s.deleteStatus.fetchState,style:{boxShadow:`0px 2px ${A.sp1} ${c.colors.dropShadowNormal}`}}):a.jsxs(a.Fragment,{children:[a.jsx(Ae,{analytics:E,onLoad:U=>(N=>{n!=null&&N.trackBillPayBillDetails(n,s.isRecurring)})(U)}),a.jsx(bi,{initialOpenThreadRequest:d??void 0,isShowDeletedBillsEnabled:O,location:l,navigate:e,isRealTimeApprovalEnabled:B,currentTenant:o,billId:n??"",isInternationalPaymentShaVsOurEnabled:Z,hasZeniAssistAccess:L,isDetectInsufficientFundsEnabled:_,isAiCfoAccessEnabled:p,onAskAiCfoClick:m})]})}const $e=De.getLocalizedStrings().spendManagement.billPay.billDetails,dt=De.getLocalizedStrings().common,gi={containerWidth:new Yt(100,58)},ut=X((function(e,t){const l=V.getSignedInUser(),n=e.tenantState.currentTenantId,c={userId:l?.userId??"",sessionId:l?.zeniSessionId??"",tenantId:n??""},r=t.showActionButtons,u=r&&t.file==null;return{uploadInvoiceEndPoint:`${zt.communicationAgentMicroServiceBaseUrl}`,authParams:c,billId:t.billId,file:t.file,showAutofill:t.showAutofill,analytics:E,entityId:t.billId,showTitlebarIcon:r,showTitlebar:r&&t?.file!=null,uploadStatus:t.uploadStatus,shouldNotShowAttachment:u,style:{paddingTop:A.sp10,paddingRight:A.sp3,paddingBottom:"15px",paddingLeft:A.sp5,...t.showAutofill?{}:{backgroundColor:t.backgroundColor,paddingBottom:"128px"}}}}),(function(e,t){const l=V.getSignedInUser();return{onInvoiceUpload:n=>{n!=null&&(t.file!=null||t.billId!=null||t.isInitialEdit?(t.setPayload(n),t.setShowConfirmationPopup(!0)):e(Ne(n,t.isVendorRecommendationEnabled,t.billId)))},updateInvoiceUploadFetchState:n=>{e(Sa({fetchState:{fetchState:n,error:void 0},billId:t.billId}))},onSkipAutofill:n=>{E?.trackBillPaySkipAutofill(),e(Me(n))},onDeleteClick:()=>{e(ga({billId:t.billId})),E?.trackInvoiceActionClick(t.billStage??"","delete",l?.userEmail??"",null)}}}))(Un);function x({appContent:e}){const t=le(),l=J(),{billId:n}=ee(),c=K(),r=c.pathname,u=r.includes("bill/new")||r.includes("/edit"),o=Ie(),s=ue(),i=V.getSignedInUser(),{useFeatureGate:d,useDynamicConfig:p}=oe(),{isFeatureEnabled:m}=d(f.isVendorRecommendationFeatureEnabled),{isFeatureEnabled:S}=d(f.isShowDeletedBillsFeatureEnabled),{isFeatureEnabled:h}=d(f.isDepositAccountsFeatureEnabled),{isFeatureEnabled:b}=d(f.billPaySetupShowInternationalPaymentByWise),{configValue:C}=p(He.zeniAssistConfig),I=C.user_ids!=null&&i?.userId!=null&&C.user_ids.includes(i?.userId),j=v((P=>W(P)));di();const[B,T]=g.useState(!1),[k,$]=g.useState(!1),[O,_]=g.useState(!1),[Y,z]=g.useState(),w=v((P=>_e(P,m,h,n)));let M=w.fetchState,L=w.file,Z=w.showAutofill;const q=v((P=>Ge(P,n??"")));u===!1&&(M=q.fetchState,L=q.transactionDetails?.attachments?.[0],Z=!1);const U=w.billPayInfo!=null&&w.billPayInfo.stage.code==="pending_approval"?w.billPayInfo.billStatus.code:w.billStage;g.useEffect((()=>{n==null&&t(Me(!0))}),[n,t]),g.useEffect((()=>{M==="Not-Started"&&(u&&k?$(!1):!u&&B&&T(!1))}),[n]),g.useEffect((()=>{B||n==null||u||(T(!0),t(wt(n,S,I,!1)),t(Dt(n)),k||($(!0),t(Re(!1,S,I,b,n)))),u&&!k&&($(!0),t(Re(!1,S,I,b,n)))}),[B,k,u,n,t,S,I,b]);const N={onOkClick:()=>{if(_(!1),!Y)return;const P=L!=null?"replace":"upload";E?.trackInvoiceActionClick(U??"",P,i?.userEmail??"","yes"),t(ha({replaceBillData:!0,billId:n})),t(Ne(Y,m,n))},onCancelClick:()=>{if(_(!1),!Y)return;const P=L!=null?"replace":"upload";E?.trackInvoiceActionClick(U??"",P,i?.userEmail??"","no"),t(ba({file:Y,billId:n}))}},te=g.useCallback((()=>{const P=H(c.state?.pathnameStackToGoBack),ve=P.poppedPathname??ne(j.tenantEmailDomain);t(Se({billId:n})),l(ve,{state:{pathnameStackToGoBack:P.newStack}})}),[c.state,j.tenantEmailDomain,n,t,l]);if(i==null)throw Error("Can't access address page without signing in...");if(M==="Error"||q.fetchState==="Error")return a.jsx(Be,{});if(M!="Completed")return n==null&&o!=="small"?a.jsx(st,{fallback:te,children:a.jsxs(je,{windowSize:o,children:[a.jsx(mt,{}),a.jsx(Pe,{}),a.jsx(ut,{backgroundColor:s.colors.grey4,billId:n,file:L,showAutofill:!0,uploadStatus:w.uploadStatus,isVendorRecommendationEnabled:m,attachmentTitle:void 0,setShowConfirmationPopup:_,setPayload:z,showActionButtons:!1,isInitialEdit:!!w.isInitialEdit,billStage:U}),a.jsx(Fe,{windowSize:o,children:a.jsx(rt,{isNewBill:!0})})]})}):a.jsxs(je,{windowSize:o,children:[o==="small"||Z?null:a.jsx(pt,{children:a.jsx(Kt,{onClick:te,"data-testid":"nav-bar-back-click"})}),o!=="small"?a.jsx(Pe,{}):null,a.jsx($n,{}),a.jsx(Fe,{windowSize:o,children:a.jsx(rt,{isNewBill:n==null})})]});{const P=w.billPayInfo!=null&&w.billPayInfo.stage.code==="pending_approval"?w.billPayInfo.billStatus.code:w.billStage;return a.jsx(st,{fallback:te,children:a.jsxs(je,{windowSize:o,children:[Z&&o!=="small"?a.jsx(mt,{}):null,O?a.jsx(Ln,{titleComponent:a.jsx(wi,{children:$e.overwriteTitle}),descriptionComponent:a.jsx(xi,{children:$e.overwriteDescription}),primaryButtonText:dt.yes,secondaryButtonText:dt.no,action:N,isEditPopup:!0}):null,o==="small"||Z?null:a.jsx(pt,{children:a.jsx(Si,{})}),o!=="small"?a.jsx(Pe,{}):null,a.jsx(ut,{backgroundColor:s.colors.grey4,billId:n,file:L,showAutofill:Z,uploadStatus:w.uploadStatus,isVendorRecommendationEnabled:m,attachmentTitle:yi(u,q,w),setShowConfirmationPopup:_,setPayload:z,showActionButtons:fi(u,w),isInitialEdit:!!w.isInitialEdit,billStage:P}),a.jsx(Fe,{windowSize:o,children:e})]})})}}function Si(){const{triggerBack:e}=_n();return a.jsx(Kt,{onClick:e,"data-testid":"nav-bar-back-click"})}function yi(e,t,l){let n,c;return e?(n=l.recurringConfig?.currentInstance,c=l.recurringConfig?.totalPaymentCycles):(n=t.transactionDetails?.recurringBillInstance,c=t.recurringBillConfigDetail?.totalPaymentCycles),t?.isRecurring===!0?a.jsxs(Ii,{children:[a.jsx(vi,{children:`${$e.recurringBill.recurringCycle}
|
|
1
|
+
import{j as a}from"./liveblocks-CgHUgeBY.js";import{h as J,u as le,g as K,i as ee,j as v,N as Q,l as X,q as aa,n as na,o as y}from"./core-Cc7wW2EM.js";import{fF as W,Yj as Ge,bq as It,Sj as ia,bo as vt,bJ as de,Yk as kt,G$ as wt,Io as Re,HC as oa,bn as Ce,Yl as la,Ym as sa,c8 as ra,Yn as ca,l$ as xt,Yo as Bt,Yp as Ct,IS as Ue,Hi as xe,Yq as da,GP as et,Yr as ua,MH as pa,GT as ma,GZ as At,Ys as Se,Yt as _e,Ip as Me,Hf as Dt,Yu as ba,Yv as ha,Is as Ne,Yw as ga,Iy as Sa,Yx as Et,I1 as tt,I6 as ya,Yy as fa,Yz as ce,YA as Tt,YB as jt,YC as Pt,gV as Ia,Hn as Ve,cG as Ft,YD as va,gh as ka,YE as wa,YF as xa,d_ as Rt,dZ as Vt,YG as Oe,YH as Ba,YI as Ca,WT as Ye,YJ as Aa,WU as ie,WV as ze,YK as Da,YL as Ea,YM as Ta,I8 as at,I5 as ja,YN as Pa,YO as Fa,YP as Ra,HT as Va,YQ as $a,YR as La,cu as $t,da as Lt,ma as Ga,bO as Ua,br as Gt,bP as Ut,G3 as _a,YS as Ma,Mu as Na,MA as Oa,Cd as Ya,Iq as za,IZ as Za,mn as ge,YT as Ha,YU as _t,mR as Wa,mh as Mt,mC as Nt,mB as nt,bE as pe,bN as qa,YV as Ja,YW as ye,kN as Ka,YX as it,YY as Xa,kR as Qa,la as en,Jb as tn,YZ as an,mK as nn,J1 as on,Y_ as ot,J5 as ln,Ja as sn,J8 as rn,I$ as cn,Y$ as Ot,H8 as dn,Z0 as un,Z1 as pn,gG as mn,gF as bn,gE as hn,mq as gn,mI as lt,mT as Sn,uX as yn,mz as fn,J3 as In,kX as vn,mY as kn,Z2 as wn,kP as xn,uO as Bn,Z3 as Cn,HZ as An,bK as Dn,bt as En,Ui as Tn,dd as jn,dc as Pn,cF as Fn,cM as Rn}from"./zeni-epic-state-BVJjEVAA.js";import{E as ue,z as V,P as fe,at as Ze,N as oe,f,bj as He,a8 as se,K as A,a9 as Ae,j as E,bw as Vn,a5 as H,aw as We,p as D,a2 as Ie,bx as st,by as rt,bz as $n,aA as Ln,ag as Gn,aT as Un,ac as Yt,G as De,ah as qe,bA as _n,af as zt,bB as Mn,ar as Nn,U as Zt,w as On,bC as Yn,bD as zn,bE as Zn,bF as Hn,bG as Wn,bH as qn,bI as Jn,bJ as Kn,bK as Xn,F as Qn,bL as ei,bt as ti,bM as ai,aj as ni,bN as ii,g as oi}from"./index-vIt7RQvO.js";import{n as G,S as li}from"./mui-C4zFSCiU.js";import{A as ct}from"./AddressScreen-CrPViFiu.js";import{g as ne,a as Ee,i as Ht,V as Je,b as Ke,c as si,v as ri,d as ci,A as me,D as be}from"./DomesticWireDetailScreen-DQXD1NSK.js";import{a as g}from"./sentry-DSWD_gIh.js";import{u as Xe}from"./useAskAiCfoHostNavButtonProps-7-6nPEHY.js";import{u as Wt}from"./useInitialThreadRequest-D4Y8xhXu.js";import{u as di}from"./BusinessVerificationPageScreen-C-aPhqey.js";import Be from"./NotFoundScreen-DzxbROot.js";import{D as ui}from"./DrawerScreen-DyQejCID.js";import{M as qt}from"./MobileAppDrawer-DLFLa7hS.js";import{F as Jt}from"./FeaturePreviewScreen-OtBPdCPK.js";import{S as Te}from"./SetupPagesScreen-B8kiMdZf.js";import{B as pi}from"./BillPayApprovalRoutes-CMAUuUUB.js";import{F as mi}from"./ScreenRoutes-Bl2EONFe.js";import"./recharts-DJGeJ2v_.js";import"./analytics-S5MhEivL.js";import"./plaid-vsHcqLdj.js";import"./dnd-DEyyKSEC.js";import"./stripe-cKAAJElX.js";import"./lottie-C1A2hiZE.js";import"./lexical-DXgKWO29.js";import"./pdf-rXyPRm1U.js";import"./utils-DiIEQ7_h.js";import"./routePaths-C0UIXwMQ.js";import"./InboxNotificationsProvider-CYNlrTK-.js";import"./useTaskManagerAccess-BeNfkHpZ.js";import"./analyticsHelper-Ch9SsWjb.js";import"./ReimbursementApprovalRuleDetailScreen-BxglZgWl.js";import"./getLocaleForTenant-Bgt5rFzV.js";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="cc7a48ad-aee2-4c25-9510-bc7c98452d17",e._sentryDebugIdIdentifier="sentry-dbid-cc7a48ad-aee2-4c25-9510-bc7c98452d17")}catch{}})();const bi=X((function(e,t){const l=Ge(e,t.billId),n=V.getSignedInUser(),c=e.tenantState.currentTenantId,r={userId:n?.userId??"",sessionId:n?.zeniSessionId??"",tenantId:c??""},u=H(t.location.state?.pathnameStackToGoBack);let o=!0;u.poppedPathname?.includes("bills")===!0&&(o=!1);let s=`${l.createdBy?.firstName??"Zeni"} ${l.createdBy?.lastName??""}`;Ce(n)||!l.createdBy?.email?.includes("zeni.ai")||(s="Zeni");let i=!1,d=!1;if(l?.billActivities.length>0){const{isApprovalorRejectBtnVisible:S,isMarkAsPaidBtnVisible:h}=la(l.billActivities,sa(t.currentTenant),n);i=S,d=h}const p=ra(t.currentTenant?.userRole??[]),m=l.transactionDetails!=null&&ca(l.transactionDetails,p,n);return{billDetails:l,isAccountingClassesEnabled:xt(e),createdBy:s,authParams:r,transactionAttachmentEndpoint:`${We}/transaction_attachment`,signedInUser:n,showBackButton:o,isAdmin:p,isRealTimeApprovalEnabled:t.isRealTimeApprovalEnabled,showApproveRejectBtns:i,showMarkAsPaidButtonToApprover:d,hasZeniAssistAccess:t.hasZeniAssistAccess,analytics:E,showMarkAsPaidButtonToCreator:m}}),(function(e,t){const{billId:l,currentTenant:n,location:c,navigate:r}=t,{tenantEmailDomain:u}=n;return{redirectToBillsScreen:()=>{const o=ne(u),s=D(c.state?.pathnameStackToGoBack,c.pathname);r(o,{state:{pathnameStackToGoBack:s}})},redirectToEditableBillScreen:()=>{const o=D(c.state?.pathnameStackToGoBack,c.pathname);r("./edit",{state:{pathnameStackToGoBack:o}})},discardBillDetailsFromLocalStore:()=>{e(Se({}))},deleteBill:o=>{E.trackBillPayDeleteBill(l,o),e(At(l))},cancelAndDeleteBill:(o,s)=>{s===!0?E.trackBillPayCancelAndDeleteBill(l,o):E.trackBillPayCancelBill(l),e(ma(l,s))},onSaveRealTimeApprovals:o=>{e(pa(l,"bill_pay",o))},updateEditRealTimeApproverClicked:o=>{e(ua({isEdit:o,entityId:l,entityType:"bill_pay"}))},approveOrRejectBill:o=>{o.type==="approved"?e(et(l,o.type,"")):e(et(l,o.type,o.description??""))},retryOrRefundBill:o=>{o.type==="retry"?e(xe(l,"retry")):e(xe(l,"refund"))},onAddNewRule:()=>{r("../../bills/approval-rules")},onAttachmentClick:(o,s)=>{const i=Ee(u,o,s),d=D(c.state?.pathnameStackToGoBack,c.pathname);r(i,{state:{pathnameStackToGoBack:d}})},onBackClick:()=>{const o=H(t.location.state?.pathnameStackToGoBack),s=o.poppedPathname??ne(u);r(s,{state:{pathnameStackToGoBack:o.newStack}})},onRetryPaymentClick:()=>{const o=D(c.state?.pathnameStackToGoBack,c.pathname);r("./edit",{state:{pathnameStackToGoBack:o}}),e(da({billId:t.billId}))},onRefundPaymentClick:()=>{e(xe(t.billId,"refund"))},saveBillDetails:(o,s,i)=>{o&&e(Ct({data:i,billId:l})),e(Ue(o?"paid":"pending_approval",o,s,l))},discardOutsideZeniPaymentData:()=>{e(Bt({billId:l}))}}}))(Vn);function hi(){const e=J(),t=le(),l=K(),{billId:n}=ee(),c=ue(),r=V.getSignedInUser(),u=fe(),o=v((U=>W(U))),s=v((U=>Ge(U,n??""))),i=s.transactionDetails?.billPayInfo.stage.code==="draft"&&s.transactionDetails.isDeleted===!1,d=Wt(o?.companyId,{clearParams:s.fetchState==="Completed"&&!i}),{isAiCfoAccessEnabled:p,onAskAiCfoClick:m}=Xe({mobileExploreReferrer:"Bill Details"});Ze({isDataReady:s.fetchState==="Completed"});const S=o?.userRole!=null&&It(o?.userRole),h=o?.company==null||o.company.featuresActivationInfo?.isBillPayFeatureEnabled&&!S,[b,C]=g.useState(!1),[I,j]=g.useState(!1),[B,T]=g.useState(!1),{useFeatureGate:k,useDynamicConfig:$}=oe(),{isFeatureEnabled:O}=k(f.isShowDeletedBillsFeatureEnabled),{isFeatureEnabled:_}=k(f.isBillPayDetectInsufficientFundsEnabled),{configValue:Y}=$(He.zeniAssistConfig),z=ia(o),w=vt(o.userRole),M=h&&de(u?.loggedInUserRoleMap),L=Y.user_ids!=null&&r?.userId!=null&&Y.user_ids.includes(r?.userId),{isFeatureEnabled:Z}=k(f.isInternationalPaymentShaVsOurFeatureEnabled),{isFeatureEnabled:q}=k(f.billPaySetupShowInternationalPaymentByWise);if(g.useEffect((()=>{O&&s.transactionDetails?.isDeleted===!0||o.isZeni===!0&&r?.userEmailDomain==="zeni.ai"&&z===!1?T(!1):T(s.billActivities[0]?.isRealTimeApprovalEnabled&&(w||M||s.allApprovers.find((U=>U.user.userId===r?.userId))!=null||s.transactionDetails?.lastUpdatedByUserId===r?.userId))}),[s.billActivities[0]?.isRealTimeApprovalEnabled,s.allApprovers,s.transactionDetails?.lastUpdatedByUserId,w,M,o.isZeni,z,r]),g.useEffect((()=>{n!=null&&t(kt(n))}),[n]),g.useEffect((()=>{b||s.fetchState=="Completed"||s.fetchState=="In-Progress"||(C(!0),t(wt(n??"",O,L,!1)))}),[b,s,n,t]),g.useEffect((()=>{I||s.fetchState!="Completed"||s.transactionDetails?.billPayInfo.stage.code=="paid"||(j(!0),t(Re(!1,O,L,q,n)),s.billActivities[0]?.isRealTimeApprovalEnabled===!0&&t(oa()))}),[I,s,n,t,O,L,q]),r==null)throw Error("Can't access address page without signing in...");return s.transactionDetails?.billPayInfo.stage.code==="draft"&&s.transactionDetails.isDeleted===!1?a.jsx(Q,{to:`./edit${l.search}`}):s.deleteStatus.fetchState==="In-Progress"||s.cancelAndDeleteStatus.fetchState==="In-Progress"||s.cancelStatus.fetchState==="In-Progress"?a.jsx(se,{fetchState:s.deleteStatus.fetchState,style:{boxShadow:`0px 2px ${A.sp1} ${c.colors.dropShadowNormal}`}}):a.jsxs(a.Fragment,{children:[a.jsx(Ae,{analytics:E,onLoad:U=>(N=>{n!=null&&N.trackBillPayBillDetails(n,s.isRecurring)})(U)}),a.jsx(bi,{initialOpenThreadRequest:d??void 0,isShowDeletedBillsEnabled:O,location:l,navigate:e,isRealTimeApprovalEnabled:B,currentTenant:o,billId:n??"",isInternationalPaymentShaVsOurEnabled:Z,hasZeniAssistAccess:L,isDetectInsufficientFundsEnabled:_,isAiCfoAccessEnabled:p,onAskAiCfoClick:m})]})}const $e=De.getLocalizedStrings().spendManagement.billPay.billDetails,dt=De.getLocalizedStrings().common,gi={containerWidth:new Yt(100,58)},ut=X((function(e,t){const l=V.getSignedInUser(),n=e.tenantState.currentTenantId,c={userId:l?.userId??"",sessionId:l?.zeniSessionId??"",tenantId:n??""},r=t.showActionButtons,u=r&&t.file==null;return{uploadInvoiceEndPoint:`${zt.communicationAgentMicroServiceBaseUrl}`,authParams:c,billId:t.billId,file:t.file,showAutofill:t.showAutofill,analytics:E,entityId:t.billId,showTitlebarIcon:r,showTitlebar:r&&t?.file!=null,uploadStatus:t.uploadStatus,shouldNotShowAttachment:u,style:{paddingTop:A.sp10,paddingRight:A.sp3,paddingBottom:"15px",paddingLeft:A.sp5,...t.showAutofill?{}:{backgroundColor:t.backgroundColor,paddingBottom:"128px"}}}}),(function(e,t){const l=V.getSignedInUser();return{onInvoiceUpload:n=>{n!=null&&(t.file!=null||t.billId!=null||t.isInitialEdit?(t.setPayload(n),t.setShowConfirmationPopup(!0)):e(Ne(n,t.isVendorRecommendationEnabled,t.billId)))},updateInvoiceUploadFetchState:n=>{e(Sa({fetchState:{fetchState:n,error:void 0},billId:t.billId}))},onSkipAutofill:n=>{E?.trackBillPaySkipAutofill(),e(Me(n))},onDeleteClick:()=>{e(ga({billId:t.billId})),E?.trackInvoiceActionClick(t.billStage??"","delete",l?.userEmail??"",null)}}}))(Un);function x({appContent:e}){const t=le(),l=J(),{billId:n}=ee(),c=K(),r=c.pathname,u=r.includes("bill/new")||r.includes("/edit"),o=Ie(),s=ue(),i=V.getSignedInUser(),{useFeatureGate:d,useDynamicConfig:p}=oe(),{isFeatureEnabled:m}=d(f.isVendorRecommendationFeatureEnabled),{isFeatureEnabled:S}=d(f.isShowDeletedBillsFeatureEnabled),{isFeatureEnabled:h}=d(f.isDepositAccountsFeatureEnabled),{isFeatureEnabled:b}=d(f.billPaySetupShowInternationalPaymentByWise),{configValue:C}=p(He.zeniAssistConfig),I=C.user_ids!=null&&i?.userId!=null&&C.user_ids.includes(i?.userId),j=v((P=>W(P)));di();const[B,T]=g.useState(!1),[k,$]=g.useState(!1),[O,_]=g.useState(!1),[Y,z]=g.useState(),w=v((P=>_e(P,m,h,n)));let M=w.fetchState,L=w.file,Z=w.showAutofill;const q=v((P=>Ge(P,n??"")));u===!1&&(M=q.fetchState,L=q.transactionDetails?.attachments?.[0],Z=!1);const U=w.billPayInfo!=null&&w.billPayInfo.stage.code==="pending_approval"?w.billPayInfo.billStatus.code:w.billStage;g.useEffect((()=>{n==null&&t(Me(!0))}),[n,t]),g.useEffect((()=>{M==="Not-Started"&&(u&&k?$(!1):!u&&B&&T(!1))}),[n]),g.useEffect((()=>{B||n==null||u||(T(!0),t(wt(n,S,I,!1)),t(Dt(n)),k||($(!0),t(Re(!1,S,I,b,n)))),u&&!k&&($(!0),t(Re(!1,S,I,b,n)))}),[B,k,u,n,t,S,I,b]);const N={onOkClick:()=>{if(_(!1),!Y)return;const P=L!=null?"replace":"upload";E?.trackInvoiceActionClick(U??"",P,i?.userEmail??"","yes"),t(ha({replaceBillData:!0,billId:n})),t(Ne(Y,m,n))},onCancelClick:()=>{if(_(!1),!Y)return;const P=L!=null?"replace":"upload";E?.trackInvoiceActionClick(U??"",P,i?.userEmail??"","no"),t(ba({file:Y,billId:n}))}},te=g.useCallback((()=>{const P=H(c.state?.pathnameStackToGoBack),ve=P.poppedPathname??ne(j.tenantEmailDomain);t(Se({billId:n})),l(ve,{state:{pathnameStackToGoBack:P.newStack}})}),[c.state,j.tenantEmailDomain,n,t,l]);if(i==null)throw Error("Can't access address page without signing in...");if(M==="Error"||q.fetchState==="Error")return a.jsx(Be,{});if(M!="Completed")return n==null&&o!=="small"?a.jsx(st,{fallback:te,children:a.jsxs(je,{windowSize:o,children:[a.jsx(mt,{}),a.jsx(Pe,{}),a.jsx(ut,{backgroundColor:s.colors.grey4,billId:n,file:L,showAutofill:!0,uploadStatus:w.uploadStatus,isVendorRecommendationEnabled:m,attachmentTitle:void 0,setShowConfirmationPopup:_,setPayload:z,showActionButtons:!1,isInitialEdit:!!w.isInitialEdit,billStage:U}),a.jsx(Fe,{windowSize:o,children:a.jsx(rt,{isNewBill:!0})})]})}):a.jsxs(je,{windowSize:o,children:[o==="small"||Z?null:a.jsx(pt,{children:a.jsx(Kt,{onClick:te,"data-testid":"nav-bar-back-click"})}),o!=="small"?a.jsx(Pe,{}):null,a.jsx($n,{}),a.jsx(Fe,{windowSize:o,children:a.jsx(rt,{isNewBill:n==null})})]});{const P=w.billPayInfo!=null&&w.billPayInfo.stage.code==="pending_approval"?w.billPayInfo.billStatus.code:w.billStage;return a.jsx(st,{fallback:te,children:a.jsxs(je,{windowSize:o,children:[Z&&o!=="small"?a.jsx(mt,{}):null,O?a.jsx(Ln,{titleComponent:a.jsx(wi,{children:$e.overwriteTitle}),descriptionComponent:a.jsx(xi,{children:$e.overwriteDescription}),primaryButtonText:dt.yes,secondaryButtonText:dt.no,action:N,isEditPopup:!0}):null,o==="small"||Z?null:a.jsx(pt,{children:a.jsx(Si,{})}),o!=="small"?a.jsx(Pe,{}):null,a.jsx(ut,{backgroundColor:s.colors.grey4,billId:n,file:L,showAutofill:Z,uploadStatus:w.uploadStatus,isVendorRecommendationEnabled:m,attachmentTitle:yi(u,q,w),setShowConfirmationPopup:_,setPayload:z,showActionButtons:fi(u,w),isInitialEdit:!!w.isInitialEdit,billStage:P}),a.jsx(Fe,{windowSize:o,children:e})]})})}}function Si(){const{triggerBack:e}=_n();return a.jsx(Kt,{onClick:e,"data-testid":"nav-bar-back-click"})}function yi(e,t,l){let n,c;return e?(n=l.recurringConfig?.currentInstance,c=l.recurringConfig?.totalPaymentCycles):(n=t.transactionDetails?.recurringBillInstance,c=t.recurringBillConfigDetail?.totalPaymentCycles),t?.isRecurring===!0?a.jsxs(Ii,{children:[a.jsx(vi,{children:`${$e.recurringBill.recurringCycle}
|
|
2
2
|
${n}/${c}`}),a.jsx(ki,{})]}):void 0}function fi(e,t){const l=t.billActivities?.[0],n=t.billStage==="pending_approval"&&l?.areApprovalsSerialized===!0&&l?.currentPendingStepIndex===0;return e&&(t.billStage==="draft"||n)}const pt=G.div`
|
|
3
3
|
margin-bottom: 20px;
|
|
4
4
|
margin-top: 20px;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{a as V}from"./sentry-
|
|
1
|
+
import{a as V}from"./sentry-DSWD_gIh.js";import{u as G,j as b,h as ne,g as se,i as oe,N as ie,l as re}from"./core-Cc7wW2EM.js";import{fF as z,HF as ce,Zb as ue,BE as de,Sm as pe,HT as le,L3 as me,NS as fe,Ow as ye,Pl as Se,Zc as ge,Zd as Ie,Ze as he,Zf as be,Zg as Te,Vq as De,Yh as Oe,VF as Ce,M7 as ke,VG as Ve,Mb as we,mH as Ae,gG as Ne,gF as Fe,gE as ve,uX as _e,uO as Ee,uL as Be,mz as xe,BN as ze,BL as P,bE as L,BZ as U,cE as Pe}from"./zeni-epic-state-BVJjEVAA.js";import{bU as Le,P as Ue,N as Me,bj as Re,z as x,a9 as je,j as M,q as E,U as B,bW as Ze,af as Ge,p as R,aH as j}from"./index-vIt7RQvO.js";import{n as qe}from"./mui-C4zFSCiU.js";import{j as k}from"./liveblocks-CgHUgeBY.js";import{d as Z}from"./routePaths-C0UIXwMQ.js";import{M as He}from"./MobileAppDrawer-DLFLa7hS.js";(function(){try{var t=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},u=new t.Error().stack;u&&(t._sentryDebugIds=t._sentryDebugIds||{},t._sentryDebugIds[u]="e6f48858-8c55-4c88-9f88-71c0310410ad",t._sentryDebugIdIdentifier="sentry-dbid-e6f48858-8c55-4c88-9f88-71c0310410ad")}catch{}})();function nt(){const t=G(),u=b((r=>z(r))),n=u?.tenantId,{isApprovalRulesV3Enabled:i,isLoading:d}=Le(n),p=b((r=>r.billPaySetupApproverViewState.fetchState));V.useEffect((()=>{n==null||d||p==="Not-Started"&&t(ce(!0,!0,i))}),[n,d,i,p,t])}const We=qe.div`
|
|
2
2
|
display: flex;
|
|
3
3
|
min-height: 100%;
|
|
4
4
|
width: 100%;
|
|
@@ -6,4 +6,4 @@ import{a as V}from"./sentry-DsyKtMW2.js";import{u as G,j as b,h as ne,g as se,i
|
|
|
6
6
|
flex-direction: column;
|
|
7
7
|
align-items: center;
|
|
8
8
|
background-color: ${t=>t.theme.colors.grey4};
|
|
9
|
-
`,$e=re((function(t,u){const{businessVerificationDetails:n}=u,i=z(t),d=x.getSignedInUser(),p=i.tenantId,r={userId:d?.userId??"",sessionId:d?.zeniSessionId??"",tenantId:p??""},T=De(u.roleMap)&&n.updateStatus.fetchState!=="In-Progress"?void 0:"readonly",e=Oe(t.companyConfigState),s=Ce(t.userRoleConfigState);return{businessVerificationDetails:n,verficationDetailsFetchState:n.fetchState,isRefreshingViewInBackground:n.isRefreshingViewInBackground,allNationalityCountries:n.allNationalityCountries,filesEndPoint:`${Ge.fileMicroServiceBaseUrl}`,authParams:r,isDisabled:T,allIndustries:e.companyIndustries??[],companyTitles:s.companyTitles}}),(function(t,u){const{companyId:n,productType:i,currentTenant:d,navigate:p,location:r}=u,{tenantEmailDomain:T}=d;return{onCompanyDetailsChanged:e=>{const{companyDescription:s,companyIndustry:m,companyIndustryType:O,companyLegalName:C,companyTaxId:g,companyWebsite:y,companyPhone:I,primaryContactEmail:c,primaryContactName:o,primaryContactUserId:l,primaryContactSyncToken:D,syncToken:S,fileIds:a,incDate:f,typeOfIncorporation:w,stateOfIncorporation:A,sourceOfFunds:N,companySubIndustry:F,countriesOfOperations:h,companySourceOfFunds:
|
|
9
|
+
`,$e=re((function(t,u){const{businessVerificationDetails:n}=u,i=z(t),d=x.getSignedInUser(),p=i.tenantId,r={userId:d?.userId??"",sessionId:d?.zeniSessionId??"",tenantId:p??""},T=De(u.roleMap)&&n.updateStatus.fetchState!=="In-Progress"?void 0:"readonly",e=Oe(t.companyConfigState),s=Ce(t.userRoleConfigState);return{businessVerificationDetails:n,verficationDetailsFetchState:n.fetchState,isRefreshingViewInBackground:n.isRefreshingViewInBackground,allNationalityCountries:n.allNationalityCountries,filesEndPoint:`${Ge.fileMicroServiceBaseUrl}`,authParams:r,isDisabled:T,allIndustries:e.companyIndustries??[],companyTitles:s.companyTitles}}),(function(t,u){const{companyId:n,productType:i,currentTenant:d,navigate:p,location:r}=u,{tenantEmailDomain:T}=d;return{onCompanyDetailsChanged:e=>{const{companyDescription:s,companyIndustry:m,companyIndustryType:O,companyLegalName:C,companyTaxId:g,companyWebsite:y,companyPhone:I,primaryContactEmail:c,primaryContactName:o,primaryContactUserId:l,primaryContactSyncToken:D,syncToken:S,fileIds:a,incDate:f,typeOfIncorporation:w,stateOfIncorporation:A,sourceOfFunds:N,companySubIndustry:F,countriesOfOperations:h,companySourceOfFunds:q,companySourceOfFundsDescription:H,transactionVolume:W,transactionVolumeDescription:$,purposeOfAccount:X,purposeOfAccountDescription:Y,regulatedStatus:J,regulatedStatusDescription:K,usNexus:Q,usNexusTypes:ee}=e,v=O?.selectedOption,te={companyId:n,companyDescription:s,companyIndustry:m.selectedOption,companyIndustryType:v==null||v===""?void 0:v,companyLegalName:C,taxIdOrEIN:g,website:y!=""&&y!=null?Pe(y):void 0,phone:I,syncToken:S,fileIds:a,incDate:f!=null?L(f?.toString()):f,typeOfIncorporation:w?.selectedOption??"",stateOfIncorporation:A?.selectedOption??"",sourceOfFunds:N?.selectedOption??"",companySubIndustry:F?.selectedOption??"",countriesOfOperations:h?.selectedOptions.map((_=>_.length===2?_:j(_)))??[],companySourceOfFunds:q?.selectedOption??"",companySourceOfFundsDescription:H,transactionVolume:W?.selectedOption??"",transactionVolumeDescription:$,purposeOfAccount:X?.selectedOption??"",purposeOfAccountDescription:Y,regulatedStatus:J??"",regulatedStatusDescription:K,usNexus:Q,usNexusTypes:ee?.selectedOptions??[]},ae={userId:l,firstName:o.firstName,lastName:o.lastName,email:c,syncToken:D};t(U({companyDetails:te,primaryContactDetails:ae}))},onCompanyOfficerUpdated:e=>{const s=e.map((m=>{const{officerType:O,userId:C,name:g,email:y,nationalityCountryCode:I,ssn:c,dob:o,phone:l,syncToken:D,selectDocument:S,role:a,ownership:f,isSelectedForVerification:w,userVerificationStatus:A,treasuryUserVerificationStatus:N,fileIds:F}=m;let h;return S.selectDocumentType==="driverLicense"?h="driving_license":S.selectDocumentType==="passport"?h="passport":S.selectDocumentType==="stateId"?h="id_document":S.selectDocumentType==="ssnCard"&&(h="social_security_card"),{officerType:O,userId:C,firstName:g.firstName,lastName:g.lastName,email:y,ssn:c,nationalityCountryCode:I?.selectedOption!=null?j(I.selectedOption):void 0,phone:l,birthday:o!=null?L(o?.toString()):o,syncToken:D,titleAtCompany:a.selectedOption,ownershipInCompany:f,documentTypeSelectedForVerification:h,isSelectedForVerification:w,userVerificationStatus:A,treasuryUserVerificationStatus:N,fileIds:F,additionalDocumentTypesRequestedForVerification:[],additionalSubmittedDocumentsForVerificationFileIds:[],areAdditionalDocumentsRequestedForVerification:!1,areAdditionalDocumentsSubmittedForVerification:!1}}));t(U({officers:s}))},onSaveDetailsClick:e=>{t(P(n,e,i))},onSendForVerificationClick:e=>{t(P(n,e,i,!0))},onAddressClick:e=>{const s=Z(T,e),m=R(r.state?.pathnameStackToGoBack,r.pathname);p(s,{state:{pathnameStackToGoBack:m}})},onRegisteredAddressClick:e=>{const s=Z(T,e),m=R(r.state?.pathnameStackToGoBack,r.pathname);p(s,{state:{pathnameStackToGoBack:m}})},onBackClick:()=>{t(ze({companyId:n})),p("../setup")},updateFilesEntity:e=>{t(xe({files:e}))},onDeleteFile:e=>{t(Be(e))},onDeleteFileList:e=>{t(Ee(e))},onEditFileName:(e,s)=>{t(_e(e,s.split(".")[0]))},onGetOtp:e=>{t(ve(e,"SpendManagementSetup"))},onResendOtp:e=>{t(Fe(e,"SpendManagementSetup"))},onVerifyOtp:(e,s)=>{t(Ne(e,s,"SpendManagementSetup"))},saveNewAddressInLocalStore:(e,s)=>{t(Ae({addressType:e,addressToCreate:s}))},onIdentityDocumentUploadedForAutofill:e=>{if(n==null)return;const s=Ve(e.documentType);s!=null&&t(we({target:"setup",companyId:n,officerType:e.officerType,fileId:e.fileId,documentType:s}))},onCompanyDocumentUploadedForAutofill:e=>{n!=null&&t(ke({target:"setup",companyId:n,fileId:e.fileId,documentType:e.documentType}))}}}))(Ze),st=({productType:t})=>{const u=ne(),n=se(),i=G(),[d,p]=V.useState(!1),[r,T]=V.useState(!1),{tenantEmailDomain:e}=oe(),s=Ue(),{useDynamicConfig:m}=Me(),{configValue:O}=m(Re.zeniAccountsConfig),C=ue(O),g=b((a=>{switch(t){case"zeni_accounts":return a.zeniAccountSetupViewState.fetchState;case"reimbursement":return a.remiSetupViewState.fetchState;case"charge_cards":return a.chargeCardSetupViewState.fetchState;case"zeni_treasury":return a.treasurySetupViewState.fetchState;default:return a.billPaySetupViewState.fetchState}})),y=b((a=>a.companyConfigState.fetchState)),I=b((a=>a.userRoleConfigState.fetchState)),c=b((a=>z(a))),o=c.companyId??x.getSignedInUserTenant(e)?.companyId;if(V.useEffect((()=>{y==="Not-Started"&&i(de()),I==="Not-Started"&&i(pe(!0))}),[y,I,i]),V.useEffect((()=>{if(!d&&g==="Not-Started"&&o!=null)switch(p(!0),t){case"zeni_accounts":i(Se(o,!0));break;case"zeni_treasury":i(ye(o,!0));break;case"reimbursement":i(fe(o,!0));break;case"charge_cards":i(me(o,!0));break;default:i(le(o,!0))}}),[d,g,o,i]),x.getSignedInUser()==null)throw Error("Can't access business verification without signing in...");let l;switch(t){case"zeni_accounts":l=c.companyZeniAccountInfo?.info?.isZeniAccountTOSAccepted;break;case"reimbursement":l=c.companyReimbursementInfo?.info?.isReimbursementTOSAccepted;break;case"charge_cards":l=c.companyChargeCardInfo?.info?.isChargeCardTOSAccepted===!0||c.companyDebitCardInfo?.info?.isDebitCardTOSAccepted;break;case"zeni_treasury":l=c.companyTreasuryInfo?.info?.isTreasuryTOSAccepted;break;default:l=c.companyBillPayInfo?.info?.isBillPayTOSAccepted}const D=a=>{T(a)},S=b((a=>{switch(t){case"zeni_accounts":return Te(a,o);case"zeni_treasury":return be(a,o);case"charge_cards":return he(a,o);case"reimbursement":return Ie(a,o);default:return ge(a,o)}}));return l===!1?k.jsx(ie,{to:"../promo"}):k.jsxs(We,{children:[k.jsx(je,{analytics:M,onLoad:a=>(f=>{switch(t){case"zeni_accounts":return f.trackPageLoaded(B.Event.zeniAccountsBusinessVerification);case"reimbursement":case"charge_cards":return f.trackPageLoaded(B.Event.reimbursementBusinessVerification);default:return f.trackPageLoaded(B.Event.billPayBusinessVerification,E(n)?"Settings":void 0)}})(a)}),E(n)?k.jsx(He,{isAppContentDrawerOpen:r,handleDrawerToggle:D}):null,k.jsx($e,{businessVerificationDetails:S,navigate:u,location:n,companyId:o,analytics:M,currentTenant:c,productType:t,isSettings:E(n),roleMap:s?.loggedInUserRoleMap??{},onClickMenuIcon:()=>{D(!0)},maxInsuredAmount:C.maxInsuredAmount})]})};export{st as B,nt as u};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import{j as S}from"./liveblocks-CgHUgeBY.js";import{a as l}from"./sentry-DSWD_gIh.js";import{u as pe,h as he,g as Ce,j as M,i as fe,l as ge}from"./core-Cc7wW2EM.js";import{a as Se,e7 as be,z as ye,e9 as Pe,eb as N,ec as we,bp as W,a9 as Ie,j,ed as H,en as Ee,G as ke,U as Ae,w as xe,eg as Te,eh as Ue,aw as _e,ek as Oe,el as ve,bl as Qe,em as Fe}from"./index-vIt7RQvO.js";import{gK as je,fE as G,fF as $e,g8 as De,jl as Le,jh as Ve,fG as z,gu as qe,go as Re,gq as B,gw as Me,gx as He,gy as ze,gz as Be,gA as Ne}from"./zeni-epic-state-BVJjEVAA.js";import{D as We,n as D,P as Ge,S as Ke}from"./mui-C4zFSCiU.js";import"./recharts-DJGeJ2v_.js";import"./analytics-S5MhEivL.js";import"./plaid-vsHcqLdj.js";import"./dnd-DEyyKSEC.js";import"./stripe-cKAAJElX.js";import"./lottie-C1A2hiZE.js";import"./lexical-DXgKWO29.js";import"./pdf-rXyPRm1U.js";import"./utils-DiIEQ7_h.js";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},a=new e.Error().stack;a&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[a]="2e6bd76d-48f0-4173-aa4f-6ebfccd03e03",e._sentryDebugIdIdentifier="sentry-dbid-2e6bd76d-48f0-4173-aa4f-6ebfccd03e03")}catch{}})();const K="chat-response-generated",Y="cards/ask",J="card_policy_hero";function $(e){return`/${e}/cards`}function X(e){return`/${e}/cards/policy`}const Ye=ge((function(e,a){const o=G(e),c=a.isSubmitting,d=Ue(e,{allUsers:a.allUsers,onCardPolicyVendorSearchTextChange:a.onCardPolicyVendorSearchTextChange});return{showSampleQuestions:a.sessionFromUrl==="new_chat"&&o.uiState.currentChatSessionId==null,aiCfoView:o,isSubmitting:c,isNewChatSession:a.sessionFromUrl==="new_chat",isFullView:!0,tableDownloadEndPoint:`${_e}/tableDownload`,exportDownloadEndPoint:Oe(),emailLinkQuestion:a.emailLinkQuestion,autoSubmitEmailLinkQuestion:a.autoSubmitEmailLinkQuestion,onEmailLinkQuestionProcessed:a.onEmailLinkQuestionProcessed,isFileUploadEnabled:a.isFileUploadEnabled,isUploadPromoVisible:a.isUploadPromoVisible,onUploadPromoClose:a.onUploadPromoClose,...d}}),(function(e,a){const{location:o,currentTenant:c,userId:d,navigate:m,currentChatSessionId:h,allSessionsWithOrderedQuestionAnswers:E,isAiCardCreationEnabled:x,isCardPolicyEnabled:T,cardPolicyPageContext:U}=a,i=c.tenantEmailDomain,C=o.state?.referrer,p=C===J?X(i):$(i);return{onEventReceived:(n,t)=>{if(n===K&&typeof t.text=="string"&&typeof t.metadata=="object"){const s=t,f=He(s.type),b=s.metadata.chat_session_id??null,{currentChatSession:y,currentQuestionAnswer:u,currentQuestionAnswerSummary:P}=W(E,b);f!=="answer"?j.trackAICFOChatResponseGenerated(f,u?.question.questionText??"",s.text,b,Fe(P,y),s.metadata.message_id??null):j.trackAICFOChatAnswerGenerated(s.text,u?.question.questionText??"",(s.follow_up_questions?.length??0)>0,!!s.assumptions,!!s.insights,s.visualization!=null,ze(s.visualization?.type??"")??null,b,s.summarized_title,s.metadata.message_id??null),e(Be({chatSessionId:s.metadata.chat_session_id,responseType:f,fetchState:{fetchState:"Completed",error:void 0}})),e(Ne({chatSessionId:s.metadata.chat_session_id,answerPayload:s,userId:d}))}},onSubmit:(n,t,s,f)=>{n&&Qe(e,n,t,h,E,d,f,s,U)},updateCurrentInput:n=>{e(B(n))},onStopSubmit:()=>{},onUpdateScrollYOffset:n=>{e(Me(n))},onSelectSampleQuestion:()=>{},onBackClick:()=>{m(-1)},onCloseClick:()=>{m(p,{state:{...o.state}}),e(B(""))},togglePageView:()=>{m(p,{state:N(o.state)}),a.setIsAiCfoOpen(!0)},onCopy:()=>{},onThumbsUp:()=>{},onThumbsDown:()=>{},onTogglePageView:()=>{m(-1)},onNewChatClick:()=>{h!=null&&e(Re()),m((function(n){return`/${n}/${Y}`})(i),{state:{...o.state}})},onToggleCotCollapsed:(n,t)=>{e(qe({questionAnswerId:n,isCollapsed:t}))},...ve(e,{isAiCardCreationEnabled:x,isCardPolicyEnabled:T,currentChatSessionId:h,onAfterCardsCreationSubmit:()=>{a.setIsAiCfoOpen(!0),m($(i),{state:{...o.state}})},onAfterCardPolicySubmit:()=>{a.setIsAiCfoOpen(!0),m(`/${i}/cards/policy`,{state:{...o.state}})}})}}))(xe(Te)),{spendManagement:{chargeCard:{cardsAiCfoHero:Z,cardPolicyAiCfoHero:ee}}}=ke.getLocalizedStrings(),A=Z.pageTitle,Je=ee.pageTitle,Xe=Z.chatHeaderSubtitle,Ze=ee.chatHeaderSubtitle,St=({isFileUploadEnabled:e})=>{const{setIsAiCfoOpen:a}=Se(),o=pe(),c=he(),d=Ce(),[m,h]=l.useState(!1),{allUsers:E,isAiCardCreationEnabled:x,isCardPolicyEnabled:T,onCardPolicyVendorSearchTextChange:U}=be();l.useEffect((()=>{o(je())}),[o]);const i=M((r=>G(r))),C=ye.getSignedInUser(),{session_id:p}=fe(),n=M((r=>$e(r))),t=i.uiState.currentChatSessionId,s=n.tenantEmailDomain,{handleUploadPromoClose:f,isUploadPromoVisible:b}=Pe({isFileUploadEnabled:e,tenantEmailDomain:s}),y=d.state,u=y?.aiCfoInitialQuestion??null,P=!!y?.aiCfoShouldSubmit,w=y?.referrer===J,te=w?"card_policy":void 0,se=l.useMemo((()=>({title:w?Je:A,subtitle:w?Ze:Xe})),[w]),[ae,_]=l.useState(null),[oe,O]=l.useState(!1),v=l.useRef(!1);l.useEffect((()=>{v.current||u==null||u===""||(_(u),O(P),v.current=!0)}),[u,P]);const ne=l.useCallback((()=>{_(null),O(!1),c(d.pathname,{replace:!0,state:N(d.state)})}),[d.pathname,d.state,c]),ie=n.masterTOSInfo,g=ie?.isMasterTOSAccepted??!1,k=l.useRef(null);l.useEffect((()=>{if(g&&k.current!=null){const{question:r,shouldSubmit:I}=k.current;k.current=null,_(r),O(I),v.current=!1}}),[g]);const{visitedSessions:L}=we(t),Q=i.fetchState,F=i.uiState.chatSessionsNextPageToken.hasMore||!i.uiState.chatSessionsFirstPageFetched,V=t!=null?i.fetchChatSessionHistoryByChatSessionId?.[t]?.fetchState??"Not-Started":"Not-Started",q=t==null||(i.uiState.chatHistoryNextPageToken[t]?.hasMore??!0),R=i.allSessionsWithOrderedQuestionAnswers,{currentSessionQuestionAnswers:re}=W(R,t),le=re.length===0;l.useEffect((()=>{t!=null&&p!==t&&c((function(r,I){return`/${r}/${Y}/${I}`})(s,t),{state:{...d.state},replace:!0})}),[t,p,s,c,d.state]),l.useEffect((()=>{p!=null&&t==null&&p!=="new_chat"&&o(De({sessionId:p,agentId:"controller"}))}),[]);const de=l.useMemo((()=>({events:L.map((r=>`private-encrypted-chat-${r}.${K}`)),eventCallback:(r,I,me)=>me.onEventReceived(r,I)})),[L]);if(l.useEffect((()=>{Q!=="In-Progress"&&F&&o(Le())}),[Q,F,o]),l.useEffect((()=>{t!=null&&V!=="In-Progress"&&q&&C!=null&&Q==="Completed"&&!F&&o(Ve(t,C.userId))}),[V,q,t,C,o]),C==null)throw Error("Can't access Cards AI CFO page without signing in...");const ce=p??"new_chat",ue=t!=null&&i.responseStateByChatSessionId?.[t]?.answer?.fetchState==="In-Progress";return S.jsxs(tt,{children:[S.jsx(Ie,{analytics:j,onLoad:r=>r.trackPageLoaded(Ae.Event.aiCFOPage)}),g?S.jsx(Ye,{...de,currentChatSessionId:t,allSessionsWithOrderedQuestionAnswers:R,allUsers:E,isAiCardCreationEnabled:x,isCardPolicyEnabled:T,openOnboardingPage:()=>h(!0),userId:C.userId,setIsAiCfoOpen:a,navigate:c,sessionFromUrl:ce,location:d,isSubmitting:ue,isEmptyChatWithSession:le,customPageTitle:A,chatHeader:se,currentTenant:n,emailLinkQuestion:ae??void 0,autoSubmitEmailLinkQuestion:oe,onEmailLinkQuestionProcessed:ne,isFileUploadEnabled:e,isUploadPromoVisible:b,onUploadPromoClose:f,onCardPolicyVendorSearchTextChange:U,cardPolicyPageContext:te}):S.jsx(H,{isTOSAccepted:g,acceptMasterTOSState:i.masterTOSAcceptanceState,customPageTitle:A,onCloseClick:()=>{c(w?X(s):$(s),{state:{...d.state}})},onCompleteClick:()=>{g||n.userRoleId==null||(u!=null&&u!==""&&(k.current={question:u,shouldSubmit:P}),o(z(n.userRoleId)))}}),S.jsx(We,{anchor:"right",open:m,transitionDuration:250,PaperProps:{component:st,style:{width:`${Ee}vw`}},slotProps:{backdrop:{style:{backgroundColor:"transparent",cursor:"pointer"}}},onClose:()=>h(!1),children:S.jsx(et,{onClick:r=>r.stopPropagation(),children:S.jsx(H,{isTOSAccepted:g,acceptMasterTOSState:i.masterTOSAcceptanceState,customPageTitle:A,onCloseClick:()=>h(!1),onCompleteClick:()=>{g||n.userRoleId==null||o(z(n.userRoleId)),h(!1)}})})})]})},et=D(Ke)`
|
|
2
|
+
display: flex;
|
|
3
|
+
min-height: 100%;
|
|
4
|
+
flex-direction: column;
|
|
5
|
+
`,tt=D.div`
|
|
6
|
+
flex: 1 1 auto;
|
|
7
|
+
display: flex;
|
|
8
|
+
flex-direction: column;
|
|
9
|
+
min-height: 0;
|
|
10
|
+
width: 100%;
|
|
11
|
+
`,st=D(Ge)`
|
|
12
|
+
box-shadow: ${({theme:e})=>e.colors.elevation2};
|
|
13
|
+
color: ${({theme:e})=>e.colors.grey4};
|
|
14
|
+
`;export{St as default};
|