@zeniai/web-app-ui 5.3.43-qa → 5.3.44-qa
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/assets/{AccountMappingScreen-A78kjWMW.js → AccountMappingScreen-B400AyQJ.js} +2 -2
- package/dist/assets/{ActualMatchingMatchDetailScreen-H6FIHzKS.js → ActualMatchingMatchDetailScreen-at2idxY8.js} +1 -1
- package/dist/assets/AddressRoutes-Bf2-WRel.js +1 -0
- package/dist/assets/{AddressScreen-DbL2JK9V.js → AddressScreen-Cbo3iSD8.js} +2 -2
- package/dist/assets/AiCfoScreen-C2YvBVu2.js +22 -0
- package/dist/assets/{AppDrawer-B21egTDJ.js → AppDrawer-D0KfLMaT.js} +2 -2
- package/dist/assets/{BillPayApprovalRoutes-C0QG7H0A.js → BillPayApprovalRoutes-LmedJ5XD.js} +1 -1
- package/dist/assets/{BillPayRoutes-BquhDc0u.js → BillPayRoutes-CDWH4S4C.js} +1 -1
- package/dist/assets/{BusinessVerificationPageScreen-DlH1zL57.js → BusinessVerificationPageScreen-BVXryUGP.js} +2 -2
- package/dist/assets/{CardsAiCfoScreen-B3hOZl8l.js → CardsAiCfoScreen-CyRzyeQR.js} +2 -2
- package/dist/assets/{ChargeCardRoutes-CWYnFFCQ.js → ChargeCardRoutes-00uaD3zR.js} +9 -9
- package/dist/assets/CompanyPassportScreen-DSUfEnP2.js +1 -0
- package/dist/assets/ConnectionAuthScreen-DlFUg2cH.js +11 -0
- package/dist/assets/CustomerOnboardingAuthScreen-DGrAYURi.js +1 -0
- package/dist/assets/{CustomerOnboardingRoutes-DZOpRUqN.js → CustomerOnboardingRoutes-CfsElRde.js} +3 -3
- package/dist/assets/{DashboardRoutes-BWa2chAm.js → DashboardRoutes-CsjwE5Mt.js} +3 -3
- package/dist/assets/{DefaultTenantHome-DLN4EyYk.js → DefaultTenantHome-BmcgKJw_.js} +1 -1
- package/dist/assets/DomesticWireDetailScreen-BHofWD_4.js +18 -0
- package/dist/assets/DrawerScreen-eoSileBw.js +1 -0
- package/dist/assets/EntityDetailRoutes-BTuykNTu.js +1 -0
- package/dist/assets/{ExpenseAutomationRoutes-ChA7_dQU.js → ExpenseAutomationRoutes-C41VbCrR.js} +5 -5
- package/dist/assets/FeaturePreviewScreen-BAENITNo.js +1 -0
- package/dist/assets/HubSpotOAuthCallbackScreen-B57X4QKD.js +1 -0
- package/dist/assets/InboxNotificationsProvider-CMdsyY0A.js +1 -0
- package/dist/assets/InvoicingRoutes-C6flJIVP.js +2 -0
- package/dist/assets/{MagicLinkRoutes-DSIncfO5.js → MagicLinkRoutes-Bo0FAVj9.js} +6 -6
- package/dist/assets/MagicLinkSignInScreen-Dusac1BV.js +12 -0
- package/dist/assets/MobileAppDrawer-Bm1u6Ken.js +1 -0
- package/dist/assets/NotFoundScreen-BHAnIkPW.js +1 -0
- package/dist/assets/NotificationRoutes-DxiudUgY.js +1 -0
- package/dist/assets/OAuthConsentScreen-yUIZ6DV2.js +1 -0
- package/dist/assets/PandLWithForecastRoutes-eu7U2LpI.js +1 -0
- package/dist/assets/{PaymentLinkScreen-B64FHPQ1.js → PaymentLinkScreen-DiueSn16.js} +7 -7
- package/dist/assets/PeopleRoutes-D0lDTK4i.js +22 -0
- package/dist/assets/PerformanceRoutes-UIwOxwXM.js +1 -0
- package/dist/assets/{Preview-DKbH4DZo.js → Preview-DEgobwYA.js} +1 -1
- package/dist/assets/{QBOConnectionScreen-DSxjIxzn.js → QBOConnectionScreen-Dcslm4FM.js} +1 -1
- package/dist/assets/{ReimbursementApprovalRoutes-BkXOBY6f.js → ReimbursementApprovalRoutes-C0yLDyE9.js} +1 -1
- package/dist/assets/{ReimbursementApprovalRuleDetailScreen-CgsllBgS.js → ReimbursementApprovalRuleDetailScreen-C95Tlh44.js} +1 -1
- package/dist/assets/{ReimbursementRoutes-BoLFmFGU.js → ReimbursementRoutes-Sdsth_9q.js} +7 -7
- package/dist/assets/{ReportsRoutes-CrzZ0bl7.js → ReportsRoutes-DA2ZKfqn.js} +1 -1
- package/dist/assets/RewardsRoutes-MCkqCd4q.js +1 -0
- package/dist/assets/{ScheduleDetailsPrepaidExpensesScreen-DAsZ0K0d.js → ScheduleDetailsPrepaidExpensesScreen-BinEqncH.js} +5 -5
- package/dist/assets/ScreenRoutes-CoBHM0a5.js +2 -0
- package/dist/assets/{SettingsRoutes-_eJ2ckP-.js → SettingsRoutes-Cwcsb2Ys.js} +6 -6
- package/dist/assets/{SetupPagesScreen-Bn2r0Ale.js → SetupPagesScreen-C64hdzmo.js} +5 -5
- package/dist/assets/SignInScreen-D-UWxMUC.js +1 -0
- package/dist/assets/SignOutScreen-CLMaxTgY.js +9 -0
- package/dist/assets/{TaskListScreen-B7cUAwfe.js → TaskListScreen-BBXffRbT.js} +2 -2
- package/dist/assets/TaskRoutes-DvNx4Qap.js +9 -0
- package/dist/assets/TransactionDetailRoutes-Bz8OXpUB.js +1 -0
- package/dist/assets/{TransactionDetailScreen-C2_EB_46.js → TransactionDetailScreen-DcuSfVKO.js} +2 -2
- package/dist/assets/{TransactionListRoutes-DpOuohtl.js → TransactionListRoutes-B_voFmAT.js} +1 -1
- package/dist/assets/{TreasuryRoutes-DchkL4da.js → TreasuryRoutes-CXgACPbz.js} +6 -6
- package/dist/assets/{VendorsRoutes-DVyJDGrt.js → VendorsRoutes-DdY9Fw_b.js} +11 -11
- package/dist/assets/WiseConfirmationScreen-BLw9xWiw.js +12 -0
- package/dist/assets/{ZeniAccountRoutes-C4eET6j1.js → ZeniAccountRoutes-OVjm5L3x.js} +11 -11
- package/dist/assets/ZeniAccountStatementScreen-CJ2iauJ5.js +9 -0
- package/dist/assets/{accountMappingHelper-CQrmB6jj.js → accountMappingHelper-Djr6f8Xt.js} +1 -1
- package/dist/assets/{analytics-BTvt2K3S.js → analytics-B06OpwA-.js} +1 -1
- package/dist/assets/{analyticsHelper-sj9huSc9.js → analyticsHelper-xKlm2_zz.js} +1 -1
- package/dist/assets/{core-BwK6FGJd.js → core-Bl4MLhFi.js} +1 -1
- package/dist/assets/{decodeURIComponentSafe-iAavL6tS.js → decodeURIComponentSafe-Buybgpqw.js} +1 -1
- package/dist/assets/{dnd-Cbdx7tVf.js → dnd-CimhpTrK.js} +1 -1
- package/dist/assets/{empty-CTWnX7jn.js → empty-B4WpR10s.js} +1 -1
- package/dist/assets/{empty-DbO4voXD.js → empty-BTbLiTP7.js} +1 -1
- package/dist/assets/{emptyVideoElement-BdvQlKL1.js → emptyVideoElement-Do1ktOmR.js} +1 -1
- package/dist/assets/epic-Ck-sEMUn.js +2 -0
- package/dist/assets/expenseAutomationHelper-CkBJgYs_.js +1 -0
- package/dist/assets/{getLocaleForTenant-B-DdN2Lw.js → getLocaleForTenant-NAFAfy2t.js} +1 -1
- package/dist/assets/{index-Bexws62p.js → index-BKWyG8Iu.js} +1 -1
- package/dist/assets/{index-DCOMaDuK.js → index-BXYzwgW0.js} +1 -1
- package/dist/assets/{index-SQoDfHg2.js → index-Bmwrrrme.js} +1 -1
- package/dist/assets/{index-BhX9D2PW.js → index-CivWMXxp.js} +1 -1
- package/dist/assets/{index-DstkpwOZ.js → index-DFR56SYR.js} +2 -2
- package/dist/assets/{index-CavSpTx-.js → index-D_qRPRIi.js} +26965 -26965
- package/dist/assets/{index-D2_EUTG6.js → index-H-kll8aI.js} +1 -1
- package/dist/assets/{index-B_VJsceg.js → index-jyJQzleF.js} +1 -1
- package/dist/assets/{lexical-DRfKJLK3.js → lexical-BbBoQdpc.js} +1 -1
- package/dist/assets/{liveblocks-y3zMPGKB.js → liveblocks-BXyXenK7.js} +2 -2
- package/dist/assets/{lottie-BQlGSG2c.js → lottie-2qUppQdg.js} +1 -1
- package/dist/assets/{mui-CxIkaR9n.js → mui-CyP-P4av.js} +1 -1
- package/dist/assets/{pathToGoBack-QMp9zrtx.js → pathToGoBack-sGBxvK0B.js} +1 -1
- package/dist/assets/{pdf-DGzvSuDl.js → pdf-BENieWk6.js} +4 -4
- package/dist/assets/{pdf-lib-Bm6tpkCo.js → pdf-lib-CLkFJB86.js} +1 -1
- package/dist/assets/{plaid-CQqwPn97.js → plaid-C0aCR9wu.js} +1 -1
- package/dist/assets/{pusher-DpL50lnb.js → pusher-B9dsvvYE.js} +1 -1
- package/dist/assets/{react-8Gpe_kpB.js → react-BqELFJJh.js} +1 -1
- package/dist/assets/{react-ZBsIhK1t.js → react-BvpkKAe3.js} +1 -1
- package/dist/assets/{react-Tycrsh8q.js → react-C4fns4CR.js} +1 -1
- package/dist/assets/{react-CwBUDYOl.js → react-DEsZRrdi.js} +1 -1
- package/dist/assets/{react-12W2NDka.js → react-DIwVQX4M.js} +1 -1
- package/dist/assets/{react-CCyW6CxJ.js → react-Do3Z3oDl.js} +1 -1
- package/dist/assets/{recharts-CoAMGh71.js → recharts-CZKBTuPa.js} +1 -1
- package/dist/assets/{routePaths-D5zGcGZG.js → routePaths-D20OKXnM.js} +1 -1
- package/dist/assets/{sentry-Jm7O5sR0.js → sentry-D4svnzxK.js} +1 -1
- package/dist/assets/{stripSplatSuffix-nQAZVh5Z.js → stripSplatSuffix-G7yC23v6.js} +1 -1
- package/dist/assets/{url-D9zjpdeS.js → url-SRUWz_6t.js} +1 -1
- package/dist/assets/{url-B9xXiyVk.js → url-m7LStd7o.js} +1 -1
- package/dist/assets/useActualMatchingMatchDetail-DjU1UsXK.js +1 -0
- package/dist/assets/{useAiCfoDashboardSuggestedQuestionsChips-B8_gxBhe.js → useAiCfoDashboardSuggestedQuestionsChips-BfYubNz7.js} +1 -1
- package/dist/assets/useAskAiCfoHostNavButtonProps-DYVVwney.js +1 -0
- package/dist/assets/{useChargeCardPusherEvents-BZNmvp7i.js → useChargeCardPusherEvents-CLgbV2wJ.js} +1 -1
- package/dist/assets/{useDeviceId-DdPl1EVl.js → useDeviceId-4WJY9vuN.js} +1 -1
- package/dist/assets/useEmailConnectResultRefresh-fWgBKuNg.js +1 -0
- package/dist/assets/{useInitialThreadRequest-BRvCrjqu.js → useInitialThreadRequest-R2hAErYY.js} +1 -1
- package/dist/assets/useTaskManagerAccess-Rxke8A9H.js +1 -0
- package/dist/assets/{utils-BVIT21dc.js → utils-Bycom664.js} +1 -1
- package/dist/assets/{withTransactionSidePanel-tINIzPX1.js → withTransactionSidePanel-rDK0lUVX.js} +2 -2
- package/dist/assets/{zeni-epic-state-BugXGzus.js → zeni-epic-state-UM7IPCLf.js} +6 -6
- package/dist/index.html +1 -1
- package/package.json +3 -3
- package/dist/assets/AddressRoutes-NMfqz3GH.js +0 -1
- package/dist/assets/AiCfoScreen-DQ-_2zus.js +0 -22
- package/dist/assets/CompanyPassportScreen-D55YyxAR.js +0 -1
- package/dist/assets/ConnectionAuthScreen-BzzSw1MN.js +0 -11
- package/dist/assets/CustomerOnboardingAuthScreen-CBDPd-_k.js +0 -1
- package/dist/assets/DomesticWireDetailScreen-Di0HmEb7.js +0 -18
- package/dist/assets/DrawerScreen-BKD3lmi2.js +0 -1
- package/dist/assets/EntityDetailRoutes-Dkd2Wwk0.js +0 -1
- package/dist/assets/FeaturePreviewScreen-DFQePQma.js +0 -1
- package/dist/assets/HubSpotOAuthCallbackScreen-Bho75VRj.js +0 -1
- package/dist/assets/InboxNotificationsProvider-ozJWRqdQ.js +0 -1
- package/dist/assets/InvoicingRoutes-BIJoBfxF.js +0 -2
- package/dist/assets/MagicLinkSignInScreen-CEPRWAV6.js +0 -12
- package/dist/assets/MobileAppDrawer-Ce8Zx46w.js +0 -1
- package/dist/assets/NotFoundScreen-Duy6T6m3.js +0 -1
- package/dist/assets/NotificationRoutes-RjDVJiKf.js +0 -1
- package/dist/assets/OAuthConsentScreen-CtkoMagm.js +0 -1
- package/dist/assets/PandLWithForecastRoutes-GmhxMHoN.js +0 -1
- package/dist/assets/PeopleRoutes-ecEzCyKE.js +0 -22
- package/dist/assets/PerformanceRoutes-BTYsYwgQ.js +0 -1
- package/dist/assets/RewardsRoutes-Bw-VJeWb.js +0 -1
- package/dist/assets/ScreenRoutes-BLctPWdO.js +0 -2
- package/dist/assets/SignInScreen-CV_GUIAF.js +0 -1
- package/dist/assets/SignOutScreen-CJIt_MEN.js +0 -9
- package/dist/assets/TaskRoutes-CTl9GKlH.js +0 -9
- package/dist/assets/TransactionDetailRoutes-DWBtPRgg.js +0 -1
- package/dist/assets/WiseConfirmationScreen-DxziV1eR.js +0 -12
- package/dist/assets/ZeniAccountStatementScreen-33Pf07v4.js +0 -9
- package/dist/assets/epic-BUtbsU0k.js +0 -2
- package/dist/assets/expenseAutomationHelper-MxNxlZNN.js +0 -1
- package/dist/assets/useActualMatchingMatchDetail-CxpYQNp7.js +0 -1
- package/dist/assets/useAskAiCfoHostNavButtonProps-DQ3F86Nw.js +0 -1
- package/dist/assets/useEmailConnectResultRefresh-98UHJ7hj.js +0 -1
- package/dist/assets/useTaskManagerAccess-B9_LRJIF.js +0 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{j as D}from"./liveblocks-
|
|
1
|
+
import{j as D}from"./liveblocks-BXyXenK7.js";import{a as o}from"./sentry-D4svnzxK.js";import{h as K,g as W,u as X,j as m,s as R,l as Y}from"./core-Bl4MLhFi.js";import{ai as Z,N as ee,d as q,z as te,o as J,aj as ne,k as ae,S as ce}from"./index-D_qRPRIi.js";import{bn as se,fE as oe,gU as ie,oA as $,Uv as re,i7 as Q,gg as le,or as ue,Uw as de,Ux as pe,u5 as ge,l_ as me,op as Ae,ol as be,ow as fe,i9 as ye,Uy as Ie,Uz as Se}from"./zeni-epic-state-UM7IPCLf.js";import{n as he}from"./mui-CyP-P4av.js";import{M as Ee}from"./MobileAppDrawer-Bm1u6Ken.js";import{q as G}from"./QBOConnectionScreen-Dcslm4FM.js";import{g as h,a as E,m as ze}from"./accountMappingHelper-Djr6f8Xt.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]="dc77a519-14d7-43af-b0fc-f4d87e4eb1f0",a._sentryDebugIdIdentifier="sentry-dbid-dc77a519-14d7-43af-b0fc-f4d87e4eb1f0")}catch{}})();const l="zeni_pending_projects_enable",u={pending:"pending",ready:"ready"},we=he.div`
|
|
2
2
|
display: flex;
|
|
3
3
|
height: 100%;
|
|
4
4
|
width: 100%;
|
|
@@ -6,4 +6,4 @@ import{j as D}from"./liveblocks-y3zMPGKB.js";import{a as o}from"./sentry-Jm7O5sR
|
|
|
6
6
|
flex-direction: column;
|
|
7
7
|
align-items: center;
|
|
8
8
|
background-color: ${a=>a.theme.colors.grey4};
|
|
9
|
-
`,ve=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:
|
|
9
|
+
`,ve=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:w,vendorsAccountSection:v,filing1099Section:x}=r,{incomeAccount:C,expenseAccount:F}=d,{billPayAccount:s}=z,{reimbursementsAccount:T}=w,{prepaidExpensesAccount:p,fixedAssetsAccount:V,accruedExpensesAccount:O}=v,{bankAccount:M,expenseCategory1099:_}=x,b=h(e.accountMappingView.incomeAccountList,C.selectedOption),j=h(e.accountMappingView.expenseAccountList,F.selectedOption),f=h(e.accountMappingView.billPayAccountList,s.selectedOption),k=h(e.accountMappingView.reimbursementsAccountList,T.selectedOption),P=E(e.accountMappingView.prepaidExpensesAccountList,p.selectedOptions),U=E(e.accountMappingView.fixedAssetsAccountList,V.selectedOptions),y=E(e.accountMappingView.accruedExpensesAccountList,O.selectedOptions),L=E(e.accountMappingView.bankAccounts1099FilingAccountList,M.selectedOptions),I=ze(e.accountMappingView.expenseAccounts1099FilingAccountList,_),t={selectedIncomeAccountId:b?.accountId,selectedExpenseAccountId:j?.accountId,selectedBillPayAccountId:f?.accountId,selectedReimbursementsAccountId:k?.accountId,selectedPrepaidExpensesAccountIds:P.map((n=>n.accountId)),selectedFixedAssetsAccountIds:U.map((n=>n.accountId)),selectedAccruedExpensesAccountIds:y.map((n=>n.accountId)),selectedBankAccounts1099FilingAccountIds:L.map((n=>n.accountId)),selectedExpenseAccounts1099FilingAccountIds:I};a(Se({data:t}))},onBackClick:()=>{J(c)===!1?(i("../../dashboard"),a(Ie())):a(Q())},onSaveClick:()=>{a(ye()),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),ke=()=>{const a=Z(),e=K(),i=W(),c=X(),{useFeatureGate:A,useDynamicConfig:r}=ee(),{isFeatureEnabled:d}=A(q.isFiling1099FeatureEnabled),{isFeatureEnabled:z}=A(q.isScheduledJEAccruedExpensesFeatureEnabled),{configValue:w,isDynamicConfigLoading:v}=r("transaction_categorization_config"),x=!v&&w?.capitalization_enabled===!0,C=te.getSignedInUser(),F=se(C),s=m((t=>oe(t))),{capitalizableAccounts:T,capitalizableAccountOverrides:p,isCapitalizationThresholdSaving:V,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??"$"}}),R),M=o.useCallback(((t,n)=>{c($(s.companyId,t,n))}),[c,s.companyId]),_=o.useCallback((t=>{const n={...p??{}},g=Object.entries(t);for(const[B,N]of g)N===null?delete n[B]:n[B]=N;const[S,H]=g[0]??[];S!=null&&c($(s.companyId,S,H,void 0,Object.keys(n).length>0?n:null))}),[c,s.companyId,p]),b=m((t=>re(t.accountState)),R),j=o.useMemo((()=>{const t={};for(const n of b)n.accountId!=null&&n.accountName!=null&&(t[n.accountId]=n.accountName);return t}),[b]),[f,k]=o.useState(!1),[P,U]=o.useState(!1);o.useEffect((()=>{f===!1&&(c(Q()),k(!0))}),[f]);const y=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((()=>{y&&s?.tenantEmailDomain!=null&&(sessionStorage.setItem(l,u.pending),c(de()),G.init("/connection/auth",s.tenantEmailDomain),G.handleClick())}),[y,s?.tenantEmailDomain,c]);const L=m((t=>pe(t))),I=t=>{U(t)};return D.jsxs(we,{children:[D.jsx(Ee,{isAppContentDrawerOpen:P,handleDrawerToggle:I}),D.jsx(ve,{currentTenant:s,navigate:e,meetingUrl:a("account_mapping"),accountMappingView:L,isFiling1099FeatureEnabled:d&&F,isAccruedExpensesFeatureEnabled:z,isCapitalizationFeatureEnabled:x,capitalizableAccounts:T,accountNamesById:j,capitalizableAccountOverrides:p,currencySymbol:O,isCapitalizationThresholdSaving:V,onSaveCapitalizationAccountThreshold:M,onSaveCapitalizationAccountThresholds:_,location:i,isSettings:J(i),onClickMenuIcon:()=>I(!0)})]})};export{l as P,ke as U,u as a};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{j as s}from"./liveblocks-
|
|
1
|
+
import{j as s}from"./liveblocks-BXyXenK7.js";import{a as k}from"./sentry-D4svnzxK.js";import{a4 as I,dR as g}from"./index-D_qRPRIi.js";import"./mui-CyP-P4av.js";import{u as y}from"./useActualMatchingMatchDetail-DjU1UsXK.js";import R from"./NotFoundScreen-BHAnIkPW.js";import{i as v,h as U,g as w}from"./core-Bl4MLhFi.js";import"./zeni-epic-state-UM7IPCLf.js";import"./recharts-CZKBTuPa.js";import"./analytics-B06OpwA-.js";import"./plaid-C0aCR9wu.js";import"./dnd-CimhpTrK.js";import"./stripe-cKAAJElX.js";import"./lottie-2qUppQdg.js";import"./lexical-BbBoQdpc.js";import"./pdf-BENieWk6.js";import"./utils-Bycom664.js";import"./stripSplatSuffix-G7yC23v6.js";import"./decodeURIComponentSafe-Buybgpqw.js";import"./routePaths-D20OKXnM.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]="ce9c10db-7449-433c-997f-f15acb078a66",t._sentryDebugIdIdentifier="sentry-dbid-ce9c10db-7449-433c-997f-f15acb078a66")}catch{}})();function K(){const{matchId:t,tenantEmailDomain:e}=v(),n=U(),r=w(),b=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(R,{});const{match:i,detailFetchState:o,handleOpenBill:l,handleRefresh:c,handleUndoReversal:d,handleContinueMatch:h,lastMatchResults:f,lastUndoResults:m,refreshStatus:p,undoReversalStatus:u}=b;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(R,{}):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{K as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{j as e}from"./liveblocks-BXyXenK7.js";import{A as i}from"./AddressScreen-Cbo3iSD8.js";import s from"./NotFoundScreen-BHAnIkPW.js";import"./sentry-D4svnzxK.js";import{n as d,o as r}from"./core-Bl4MLhFi.js";import"./zeni-epic-state-UM7IPCLf.js";import"./recharts-CZKBTuPa.js";import"./index-D_qRPRIi.js";import"./mui-CyP-P4av.js";import"./analytics-B06OpwA-.js";import"./plaid-C0aCR9wu.js";import"./dnd-CimhpTrK.js";import"./stripe-cKAAJElX.js";import"./lottie-2qUppQdg.js";import"./lexical-BbBoQdpc.js";import"./pdf-BENieWk6.js";import"./utils-Bycom664.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 r}from"./liveblocks-
|
|
1
|
+
import{j as r}from"./liveblocks-BXyXenK7.js";import{a as b}from"./sentry-D4svnzxK.js";import{h as T,u as P,g as j,i as E,j as B,l as M}from"./core-Bl4MLhFi.js";import{a1 as $,c as D,z as L,U as V,a7 as K,a8 as U,k as C,S,a3 as z,Z as h,a4 as F}from"./index-D_qRPRIi.js";import{Va as _,io as G,fE as R,Vb as N,c8 as O,Vc as q,mG as H}from"./zeni-epic-state-UM7IPCLf.js";import{n as Z}from"./mui-CyP-P4av.js";import J from"./NotFoundScreen-BHAnIkPW.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]="68dcb300-40f2-4e5e-9cf2-6e7bf5fca262",e._sentryDebugIdIdentifier="sentry-dbid-68dcb300-40f2-4e5e-9cf2-6e7bf5fca262")}catch{}})();const Q=Z.div`
|
|
2
2
|
display: flex;
|
|
3
3
|
height: 100vh;
|
|
4
4
|
width: 100%;
|
|
@@ -6,4 +6,4 @@ import{j as r}from"./liveblocks-y3zMPGKB.js";import{a as h}from"./sentry-Jm7O5sR
|
|
|
6
6
|
flex-direction: column;
|
|
7
7
|
align-items: center;
|
|
8
8
|
background-color: ${e=>e.theme.colors.grey4};
|
|
9
|
-
`,W=M((function(e,s){const{addressId:o,isSubPage:i,addressType:c}=s,l=R(e),a=s.roleMap!=null&&N(s.roleMap),n=i||c==="user_address"||O(l?.userRole??[])||a?void 0:"readonly";if(o==null){const t=q(c,e);return{addressToEdit:t?.addressToCreate,loadingState:t?.status?.fetchState,googleAPIKey:
|
|
9
|
+
`,W=M((function(e,s){const{addressId:o,isSubPage:i,addressType:c}=s,l=R(e),a=s.roleMap!=null&&N(s.roleMap),n=i||c==="user_address"||O(l?.userRole??[])||a?void 0:"readonly";if(o==null){const t=q(c,e);return{addressToEdit:t?.addressToCreate,loadingState:t?.status?.fetchState,googleAPIKey:h.googleMapsAPIKey,isDisabled:n,isSubPage:i,dontShowSaveConfirmationPopup:s.dontShowSaveConfirmation}}const d=_(e,o);return{addressToEdit:d.address,loadingState:d.fetchState,googleAPIKey:h.googleMapsAPIKey,isDisabled:n}}),(function(e,s){const{navigate:o,location:i,addressType:c}=s,l=a=>{if(a==="express-pay")o("../express-pay/add-wire");else{const n=i.state,d=F(n?.pathnameStackToGoBack);let t=d.poppedPathname??v();const u=n?.queryParams;if(u){const f=new URLSearchParams(u).toString();f&&(t=`${t}?${f}`)}o(t,{state:{pathnameStackToGoBack:d.newStack}})}};return{onSubmitHandler:a=>{const n=X(a);e(H({addressType:c,addressToCreate:n})),C?.trackSaveAddressClicked(S.Event.saveAddressClicked,{street:a.street.addressString,city:a.city,state:a.state,country:a.country.selectedOption??"",postalCode:a.postalCode,suite:a.suite,secondaryInfo:a.secondaryInfo}),l(s.bankAccountContext)},onCancel:()=>{l(s.bankAccountContext)}}}))(z);function re({isSubPage:e,hideAddressSubTitle:s=!1,hideAddressBackButton:o=!1,dontShowSaveConfirmation:i,accountContext:c,addressTypeParam:l}){const a=T(),n=P(),d=j(),{addressId:t,addressType:u}=E(),f=$(),I=D(),k=L.getSignedInUser(),[g,w]=b.useState(t==null),p=B((m=>t!=null?_(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 b.useEffect((()=>{g||t==null||(w(!0),n(G(t,!1)))}),[g,t,n]),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"?r.jsx(K,{fetchState:p,style:{backgroundColor:I.colors.grey5}}):t!=null&&p==="Error"?(a(`${v(1)}/new`,{replace:!0}),r.jsx(r.Fragment,{})):r.jsxs(r.Fragment,{children:[r.jsx(U,{analytics:C,onLoad:A}),r.jsx(Q,{windowSize:f,children:r.jsx(W,{location:d,navigate:a,isSubPage:e===!0,hideAddressBackButton:o,hideAddressSubTitle:s,addressId:t,addressType:y,dontShowSaveConfirmation:i,bankAccountContext:c,roleMap:x?.loggedInUserRoleMap})})]}):r.jsx(J,{})}const v=(e=2)=>{let s="../";for(let o=0;o<e;o++)s=`${s}../`;return s},X=e=>({street:[e.street.addressString,e.suite,e.secondaryInfo],city:e.city,state:e.state,country:e.country.selectedOption??"",countryCode:e.countryCode,postalCode:e.postalCode,latitude:e.street.addressValue?.locationLat,longitude:e.street.addressValue?.locationLng});export{re as A,X as t};
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import{j as S}from"./liveblocks-BXyXenK7.js";import{a}from"./sentry-D4svnzxK.js";import{u as Rt,h as Tt,i as Ot,g as jt,j as b,l as At}from"./core-Bl4MLhFi.js";import{a as Qt,O as Ut,e8 as Dt,z as Lt,a1 as _t,e9 as Ft,ea as Bt,eb as Mt,bo as Ae,ec as $e,ed as Vt,bn as Ge,a4 as me,a8 as re,k as F,ee as le,ef as Nt,eg as $t,au as Gt,S as qt,w as Ht,eh as zt,ei as Wt,av as Jt,ej as Yt,ek as Kt,el as Xt,em as Zt,p as es,bk as Qe,en as ts}from"./index-D_qRPRIi.js";import{fD as _,gs as y,TU as ss,a20 as as,a21 as ns,jL as os,a22 as is,jI as rs,a23 as ue,jC as de,jS as z,jk as Se,jA as Ue,jy as ls,jP as us,jt as qe,U1 as De,gu as B,gJ as ds,U0 as cs,TN as Le,fE as ms,j2 as Ss,a24 as hs,g7 as ps,jg as fs,jc as gs,fF as ce,ge as Cs,a25 as Is,a26 as ks,a27 as bs,gt as vs,gn as _e,k3 as Fe,gp as Be,gv as Es,a28 as Me,jU as Ps,j9 as ws,jn as ys,jQ as Ve,jq as xs,gw as Rs,gx as Ts,gy as Os,gz as js}from"./zeni-epic-state-UM7IPCLf.js";import{D as As,n as M,S as Qs,P as Us}from"./mui-CyP-P4av.js";import{u as Ds}from"./useAiCfoDashboardSuggestedQuestionsChips-BfYubNz7.js";import{p as Ls}from"./pathToGoBack-sGBxvK0B.js";import{j as _s}from"./routePaths-D20OKXnM.js";import"./recharts-CZKBTuPa.js";import"./analytics-B06OpwA-.js";import"./plaid-C0aCR9wu.js";import"./dnd-CimhpTrK.js";import"./stripe-cKAAJElX.js";import"./lottie-2qUppQdg.js";import"./lexical-BbBoQdpc.js";import"./pdf-BENieWk6.js";import"./utils-Bycom664.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]="9901b39a-f3f8-4522-ac89-b37fa9193c97",s._sentryDebugIdIdentifier="sentry-dbid-9901b39a-f3f8-4522-ac89-b37fa9193c97")}catch{}})();const He="chat-response-generated";function Fs(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=y(s).skills.find((l=>l.macroId===r.savedMacroId));return t==null?void 0:{status:"saved",command:t.name}}const Bs=At((function(s,r){const t=_(s),l=r.isSubmitting,d=t.uiState?.currentChatSessionId,i=d!=null?Cs(s.aiCfoState,d):[],f=Wt(s,{allUsers:r.allUsers,onCardPolicyVendorSearchTextChange:r.onCardPolicyVendorSearchTextChange}),p=Is(s),m=ks(s),T=bs(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:`${Jt}/tableDownload`,exportDownloadEndPoint:Xt(),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:y(s).skills,skillSaveState:Fs(s,T),skillsEnabled:y(s).skillsEnabled,skillsList:y(s).skills,skillsListError:y(s).fetchState==="Error",skillsListLoading:y(s).fetchState==="In-Progress",skillsCanPublish:y(s).canPublish,skillSaving:T.fetchState==="In-Progress",skillSaveError:T.fetchState==="Error",skillVersionHistory:p.macroId!=null?{macroId:p.macroId,versions:p.versions,error:p.fetchState==="Error",loading:p.fetchState==="In-Progress"}:void 0,skillRestoreBody:m.macroId!=null&&m.version!=null?{macroId:m.macroId,version:m.version,instructions:m.instructions,error:m.fetchState==="Error",loading:m.fetchState==="In-Progress"}:void 0,skillDetail:z(s).detail,skillDetailError:z(s).fetchState==="Error",skillDetailLoading:z(s).fetchState==="In-Progress",syntheticAnswers:i,resolveSyntheticAnswerCardTile:Kt(s),resolveSyntheticAnswerPolicyTile:Yt(s),...f}}),(function(s,r){const{location:t,currentTenant:l,userId:d,navigate:i,currentChatSessionId:f,allSessionsWithOrderedQuestionAnswers:p,isAiCardCreationEnabled:m,isCardPolicyEnabled:T,setIsAiCfoOpen:A}=r,Q=l.tenantEmailDomain;return{onEventReceived:(n,o)=>{if(n===He&&typeof o.text=="string"&&typeof o.metadata=="object"){const c=o,E=Rs(c.type),v=c.metadata.chat_session_id??null,{currentChatSession:W,currentQuestionAnswer:x,currentQuestionAnswerSummary:J}=Ge(p,v);E!=="answer"?F.trackAICFOChatResponseGenerated(E,x?.question.questionText??"",c.text,v,ts(J,W),c.metadata.message_id??null):F.trackAICFOChatAnswerGenerated(c.text,x?.question.questionText??"",(c.follow_up_questions?.length??0)>0,!!c.assumptions,!!c.insights,c.visualization!=null,Ts(c.visualization?.type??"")??null,v,c.summarized_title,c.metadata.message_id??null),s(Os({chatSessionId:c.metadata.chat_session_id,responseType:E,fetchState:{fetchState:"Completed",error:void 0}})),s(js({chatSessionId:c.metadata.chat_session_id,answerPayload:c,userId:d}))}},onSubmit:(n,o,c,E,v)=>{n&&Qe(s,n,o,f,p,d,E,c,void 0,v)},onFetchSkills:()=>{s(qe())},onOpenSkill:n=>{s(Se({macroId:n})),s(xs({macroId:n}))},onSaveSkill:(n,o)=>{s(Ve({draft:n,macroId:o}))},onSaveSkillDraft:n=>{const o=n.displayName?.trim()??"",c=n.name?.trim()??"";s(Ve({draft:{name:o.length>0?o:c,description:n.description?.trim()??null,instructions:n.instructions,visibility:"private"}}))},onFetchSkillVersionBody:(n,o)=>{s(ys({macroId:n,version:o}))},onDeleteSkill:n=>{s(ws({macroId:n}))},onSetSkillVisibility:(n,o)=>{s(Ps({macroId:n,visibility:o}))},onCloseSkillDetail:()=>{s(Me())},onRunSkill:(n,o)=>{s(B()),s(_e()),Qe(s,o,"user_input",void 0,p,d,void 0,void 0,void 0,n),s(Me())},updateCurrentInput:n=>{s(Be(n))},onStopSubmit:()=>{},onUpdateScrollYOffset:n=>{s(Es(n))},onSelectSampleQuestion:()=>{},onBackClick:()=>{i(-1)},onCloseClick:()=>{const n=me(t.state?.pathnameStackToGoBack),o=n.poppedPathname??Ls(1);i(o,{state:{...t.state,pathnameStackToGoBack:n.newStack}}),s(Be(""))},togglePageView:()=>{const n=me(t.state?.pathnameStackToGoBack),o=n.poppedPathname??`/${l.tenantEmailDomain}/dashboard`;i(o,{state:{...$e(t.state),pathnameStackToGoBack:n.newStack,message:"open_ai_cfo_drawer"}}),A(!0)},onCopy:()=>{},onThumbsUp:(n,o)=>{f!=null&&o?.messageId!=null&&s(Fe(f,o.messageId,"positive",o.questionText,o.answerText))},onThumbsDown:(n,o)=>{f!=null&&o?.messageId!=null&&s(Fe(f,o.messageId,"negative",o.questionText,o.answerText))},onTogglePageView:()=>{i(-1)},onNewChatClick:()=>{s(B()),f!=null&&s(_e());const n=es(t.state?.pathnameStackToGoBack,t.pathname);i(`/${l.tenantEmailDomain}/ai-cfo/new_chat`,{state:{pathnameStackToGoBack:n.slice(0,-1),referrer:"Sidebar"}})},onToggleCotCollapsed:(n,o)=>{s(vs({questionAnswerId:n,isCollapsed:o}))},onMenuClick:r.onMenuClick,...Zt(s,{isAiCardCreationEnabled:m,isCardPolicyEnabled:T,currentChatSessionId:f,onAfterCardsCreationSubmit:()=>{A(!0),i(`/${Q}/cards`,{state:{...t.state}})},onAfterCardPolicySubmit:()=>{A(!0),i(`/${Q}/cards/policy`,{state:{...t.state}})}})}}))(Ht(zt)),la=({isFileUploadEnabled:s})=>{const{setIsAiCfoOpen:r}=Qt(),t=Rt(),l=Tt(),{session_id:d}=Ot(),i=jt(),f=new URLSearchParams(i.search).get("routine")??void 0,[p,m]=a.useState(!1),T=b((e=>_(e).uiState.isSkillsBrowserOpen===!0)),A=b((e=>y(e).skillsEnabled)),Q=b((e=>_(e).uiState.isRoutinesBrowserOpen===!0)),n=b((e=>ss(e))),o=b((e=>as(e))),c=b((e=>ns(e))),[E,v]=a.useState(void 0),[W,x]=a.useState(!1),[J,he]=a.useState(void 0),ze=a.useCallback((()=>{he(void 0),v(void 0),x(!0)}),[]),We=a.useCallback((e=>{v(e),x(!0)}),[]),Je=a.useCallback((()=>{v(void 0),x(!1)}),[]),Ye=a.useCallback((e=>{t(os({draft:e,...E!=null&&{scheduleId:E.scheduleId}})),v(void 0),x(!1)}),[t,E]),O=f,pe=n.routines.find((e=>e.scheduleId===O)),C=b((e=>is(e))),Ke=a.useCallback((e=>{t(rs({scheduleId:e.scheduleId}))}),[t]);a.useEffect((()=>{t(O!=null?de({scheduleId:O}):ue())}),[t,O]);const D=pe?.macroId,Xe=b((e=>z(e))),fe=D!=null&&D!==""&&Xe.fetchState==="Not-Started";a.useEffect((()=>{fe&&D!=null&&t(Se({macroId:D}))}),[t,fe,D]);const Ze=b((e=>_(e).uiState.currentChatSessionId))??d,I=n.routines.find((e=>e.scheduleId===f))??n.routines.find((e=>e.scheduleId===Ut(Ze))),L=I?.scheduleId??null,[ge,et]=a.useState(!0);a.useEffect((()=>{L!=null&&t(de({scheduleId:L}))}),[t,L]);const Ce=C.runs.some((e=>e.status==="claimed"||e.status==="running"))===!0;a.useEffect((()=>{if(O==null||Ce!==!0)return;const e=window.setInterval((()=>{t(de({scheduleId:O})),t(Ue())}),5e3);return()=>window.clearInterval(e)}),[t,Ce,O]);const tt=a.useCallback((e=>{he(e),v(void 0),x(!0)}),[]),st=a.useCallback((e=>{t(ls({scheduleId:e.scheduleId}))}),[t]),at=a.useCallback(((e,h)=>{t(us({enabled:h,scheduleId:e.scheduleId}))}),[t]);a.useEffect((()=>{Q&&t(Ue())}),[t,Q]);const Ie=b((e=>y(e).skills)),Y=a.useMemo((()=>Ie.map((e=>({macroId:e.macroId,name:e.displayName??e.name})))),[Ie]),nt=a.useCallback((e=>{t(Se({macroId:e}))}),[t]),K=a.useCallback((()=>{t(qe()),t(De())}),[t]),ot=a.useCallback((()=>{t(B())}),[t]),{allUsers:it,isAiCardCreationEnabled:rt,isCardPolicyEnabled:lt,onCardPolicyVendorSearchTextChange:ut}=Dt();a.useEffect((()=>{t(ds())}),[t]);const g=b((e=>_(e))),R=Lt.getSignedInUser();a.useEffect((()=>d==="routines"?(t(B()),void t(cs())):d==="skills"?(t(ue()),t(Le()),void t(De())):(L==null&&t(ue()),t(Le()),void t(B()))),[t,L,f,d]);const dt=_t(),j=Gt(dt),k=b((e=>ms(e))),u=g.uiState.currentChatSessionId,P=k.tenantEmailDomain,U=P!=null&&P!=="",X=a.useCallback((e=>{U&&l(`/${P}/ai-cfo/routines?routine=${encodeURIComponent(e.scheduleId)}`)}),[U,l,P]),Z=a.useCallback((()=>{U&&l(`/${P}/ai-cfo/routines`)}),[U,l,P]),ee=a.useCallback(((e,h)=>{const H=e.sessionId??C.sessionId;H!=null&&U&&l(`/${P}/ai-cfo/${H}?routine=${encodeURIComponent(h)}`)}),[U,l,C.sessionId,P]),ct=a.useMemo((()=>I==null?void 0:{error:C.fetchState==="Error",kind:"routineRuns",loading:C.fetchState==="In-Progress"||C.fetchState==="Not-Started",routineName:I.name,schedule:Ft(I),skillName:I.isAdHoc===!0?void 0:Y.find((e=>e.macroId===I.macroId))?.name,onOpenSkill:I.isAdHoc===!0?void 0:K,runs:C.runs,tzName:I.tzName,unreadCount:I.unreadRuns,open:ge,onToggle:()=>et((e=>!e)),onOpenRun:e=>ee(e,I.scheduleId),onOpenRoutine:()=>X(I),onOpenRoutines:Z}),[K,Z,X,ee,ge,I,C.fetchState,C.runs,Y]),{handleUploadPromoClose:mt,isUploadPromoVisible:St}=Bt({isFileUploadEnabled:s,tenantEmailDomain:P}),te=Mt({currentTenant:k,currentChatSessionId:u,aiCfoView:g,skillsEnabled:A,onCloseSkills:ot,onOpenSkills:K}),{isSuggestedQuestionsLoading:ht,suggestedPromptQuestions:pt}=Ds(),V=i.state,N=V?.aiCfoInitialQuestion,ke=!!V?.aiCfoShouldSubmit;a.useEffect((()=>{const e=i.state;if(e?.[Ae]!==!0)return;m(!0);const h={...e};delete h[Ae],l(i,{replace:!0,state:h})}),[i.pathname,i.search,i.state,l]);const[ft,se]=a.useState(null),[gt,ae]=a.useState(!1),[Ct,ne]=a.useState(void 0),[It,oe]=a.useState(void 0),be=a.useRef(!1);a.useEffect((()=>{if(!be.current&&N!=null&&N!==""){const e=i.state;se(N),ae(ke),ne(e?.aiCfoInitialSubmissionSource!=null?e.aiCfoInitialSubmissionSource:void 0);const h=e?.aiCfoSuggestionIndex;oe(typeof h=="number"?h:void 0),be.current=!0}}),[N,ke,i.state]);const kt=a.useCallback((()=>{se(null),ae(!1),ne(void 0),oe(void 0),l(i.pathname,{replace:!0,state:$e(i.state)})}),[i.pathname,i.state,l]),ve=a.useMemo((()=>new URLSearchParams(i.search)),[i.search]),Ee=ve.get("ref")??V?.aiCfoRef,ie=ve.get("emailRefId")??V?.aiCfoEmailRefId,Pe=a.useRef(!1);a.useEffect((()=>{Pe.current||Ee!=="month-end-email"||ie==null||u!=null||R==null||(t(Ss("controller",R.userId,ie,"MONTH_END_EMAIL")),Pe.current=!0)}),[Ee,ie,u,t,R]);const $=g.uiState.lastContextMessage;a.useEffect((()=>{$!=null&&$!==""&&u!=null&&(se($),ae(!0),ne(void 0),oe(void 0),t(hs()))}),[$,u,t]);const bt=k.masterTOSInfo,w=bt?.isMasterTOSAccepted??!1,{visitedSessions:we}=Vt(u),G=g.fetchState,q=g.uiState.chatSessionsNextPageToken.hasMore||!g.uiState.chatSessionsFirstPageFetched,ye=u!=null?g.fetchChatSessionHistoryByChatSessionId?.[u]?.fetchState??"Not-Started":"Not-Started",xe=u==null||(g.uiState.chatHistoryNextPageToken[u]?.hasMore??!0),Re=g.allSessionsWithOrderedQuestionAnswers,{currentSessionQuestionAnswers:vt}=Ge(Re,u),Et=vt.length===0;a.useEffect((()=>{w||j||l("../dashboard",{state:{...i.state,message:"open_ai_cfo_drawer"}})}),[w,j,l,i.state]);const Pt=a.useCallback((()=>{const e=me(i.state?.pathnameStackToGoBack),h=k.tenantEmailDomain;l(e.poppedPathname??(h!=null?`/${h}/dashboard`:".."),{state:{...i.state,pathnameStackToGoBack:e.newStack}})}),[k.tenantEmailDomain,i.state,l]),Te=a.useRef(void 0),Oe=a.useRef(void 0);a.useEffect((()=>{const e=d!==Te.current,h=u!==Oe.current;Te.current=d,Oe.current=u,d!==u&&(!e||d==null||_s(d)?h&&u!=null&&l(`../ai-cfo/${u}`,{state:{...i.state}}):t(ps({sessionId:d,agentId:"controller"})))}),[u,d]);const wt=a.useMemo((()=>({events:we.map((e=>`private-encrypted-chat-${e}.${He}`)),eventCallback:(e,h,H)=>H.onEventReceived(e,h)})),[we]);a.useEffect((()=>{G!=="In-Progress"&&q&&t(fs())}),[G,q,t]),a.useEffect((()=>{u!=null&&ye!=="In-Progress"&&xe&&R!=null&&(d===u||G==="Completed"&&!q)&&t(gs(u,R.userId))}),[ye,G,xe,q,u,R,d,t]);const je=e=>e.trackAICFOOnboardingScreenStateChanged("open","first_visit");if(R==null||d==null)throw Error("Can't access AI Controller page without signing in...");const yt=u!=null&&g.responseStateByChatSessionId?.[u]?.answer?.fetchState==="In-Progress";if(!w&&j)return S.jsxs(Vs,{children:[S.jsx(re,{analytics:F,onLoad:je}),te.drawerElement,S.jsx(Ns,{children:S.jsx(Ne,{children:S.jsx(le,{isTOSAccepted:!1,acceptMasterTOSState:g.masterTOSAcceptanceState,onCloseClick:Pt,onCompleteClick:()=>{k.userRoleId!=null&&t(ce(k.userRoleId))}})})})]});const xt=S.jsxs(S.Fragment,{children:[p&&!w?S.jsx(re,{analytics:F,onLoad:je}):null,S.jsx(le,{isTOSAccepted:w,acceptMasterTOSState:g.masterTOSAcceptanceState,showHeader:!1,togglePageView:w?()=>m(!1):void 0,onCloseClick:()=>m(!1),onCompleteClick:()=>{w||k.userRoleId==null||t(ce(k.userRoleId)),m(!1)}})]});return S.jsxs(S.Fragment,{children:[S.jsxs(Ms,{children:[S.jsx(re,{analytics:F,onLoad:e=>e.trackPageLoaded(qt.Event.aiCFOPage)}),j&&te.drawerElement,S.jsx(Bs,{...wt,currentChatSessionId:u,allSessionsWithOrderedQuestionAnswers:Re,allUsers:it,isAiCardCreationEnabled:rt,isCardPolicyEnabled:lt,openOnboardingPage:()=>m(!0),userId:R.userId,setIsAiCfoOpen:r,navigate:l,sessionFromUrl:d,location:i,isSubmitting:yt,isEmptyChatWithSession:Et,currentTenant:k,emailLinkQuestion:ft??void 0,autoSubmitEmailLinkQuestion:gt,onEmailLinkQuestionProcessed:kt,routedInitialQuestionSource:Ct,routedInitialQuestionSuggestionIndex:It,onCardPolicyVendorSearchTextChange:ut,onMenuClick:j?te.open:void 0,isFileUploadEnabled:s,isUploadPromoVisible:St,onUploadPromoClose:mt,exploreSuggestedPromptQuestions:pt,exploreSuggestedPromptQuestionsLoading:ht,isSkillsOpen:T,isRoutinesOpen:Q,routineCanCreate:c,routineEditing:E,routineEditorOpen:W,routineListError:n.fetchState==="Error",routineListLoading:n.fetchState==="In-Progress",routineMaxRoutines:n.maxRoutines,routineSaveError:o.fetchState==="Error",routineSaving:o.fetchState==="In-Progress",routineSchedulableSkills:Y,routines:n.routines,onRoutineCreate:ze,onRoutineDelete:st,routineHistoryError:C.fetchState==="Error",routineHistoryLoading:C.fetchState==="In-Progress",chatSidePanel:ct,routineDetail:pe,routineRunningScheduleId:o.runningScheduleId,routineRuns:C.runs,onRoutineEdit:We,onRoutineOpenRun:(e,h)=>ee(h,e.scheduleId),onRoutineRun:Ke,onRoutineCloseDetail:Z,onRoutineDraft:tt,routineDraftPrompt:J,onRoutineOpenDetail:X,onRoutineEditorCancel:Je,onRoutineLoadSkillInstructions:nt,onRoutineSave:Ye,onRoutineSetEnabled:at,isCreateSkillEnabled:A,promoDismissalScope:P}),p&&j?S.jsx(As,{anchor:"right",open:p,transitionDuration:250,PaperProps:{component:$s,style:{width:"100%"}},slotProps:{backdrop:{style:{backgroundColor:"transparent",cursor:"pointer"}}},onClose:()=>m(!1),children:S.jsx(Ne,{onClick:e=>e.stopPropagation(),children:S.jsx(le,{isTOSAccepted:w,acceptMasterTOSState:g.masterTOSAcceptanceState,onCloseClick:()=>m(!1),onCompleteClick:()=>{w||k.userRoleId==null||t(ce(k.userRoleId)),m(!1)}})})}):null]}),p&&!j?S.jsx(Nt,{open:p,onClose:()=>m(!1),children:S.jsx($t,{children:xt})}):null]})},Ne=M(Qs)`
|
|
2
|
+
display: flex;
|
|
3
|
+
min-height: 100%;
|
|
4
|
+
flex-direction: column;
|
|
5
|
+
`,Ms=M.div`
|
|
6
|
+
height: 100vh;
|
|
7
|
+
width: 100%;
|
|
8
|
+
`,Vs=M.div`
|
|
9
|
+
height: 100vh;
|
|
10
|
+
width: 100%;
|
|
11
|
+
display: flex;
|
|
12
|
+
flex-direction: column;
|
|
13
|
+
min-height: 0;
|
|
14
|
+
`,Ns=M.div`
|
|
15
|
+
flex: 1;
|
|
16
|
+
min-height: 0;
|
|
17
|
+
display: flex;
|
|
18
|
+
flex-direction: column;
|
|
19
|
+
`,$s=M(Us)`
|
|
20
|
+
box-shadow: ${({theme:s})=>s.colors.elevation2};
|
|
21
|
+
color: ${({theme:s})=>s.colors.grey4};
|
|
22
|
+
`;export{la as default};
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import{j as d}from"./liveblocks-y3zMPGKB.js";import{a as o,R as va}from"./sentry-Jm7O5sR0.js";import{u as Me,j as r,g as ya,h as $a,q as G}from"./core-BwK6FGJd.js";import{fE as Fe,TJ as Ba,TK as Ze,g8 as Aa,gu as K,TL as W,jt as Te,jA as Ie,TM as xa,TN as _a,gN as Da,p_ as Ma,TO as Fa,TP as ve,gl as Za,TQ as $,fD as Ra,gs as Ga,TR as Pa,TS as Va,TT as ja,TU as ye,TV as Ha,TW as $e,TX as La,D_ as Na,gm as Oa,h0 as Ua,cV as za,TY as Ya,TZ as qa,qB as Ja,g7 as Ka,j5 as Wa,T_ as Qa,T$ as Xa,wp as et,gn as at}from"./zeni-epic-state-BugXGzus.js";import{w as tt,i as nt,a as ot,$ as st,E as rt,O as it,c as m,d as lt,u as dt,e as ct,B as ut,f as mt,g as Ct,h as pt,y as ht,j as ft,z as gt,k as P,p,m as Be,l as bt,S as St,n as Ae,o as kt,q as xe,r as Et,s as wt,v as X,x as Q,A as Tt,C as It,D as vt,L as yt,F as $t,H as Bt,I as ee,J as At,K as xt}from"./index-CavSpTx-.js";import{A as _t,b as Dt,I as Mt,a as _e,d as Ft,D as De}from"./mui-CxIkaR9n.js";import{u as Zt}from"./InboxNotificationsProvider-ozJWRqdQ.js";import{u as Rt}from"./useTaskManagerAccess-B9_LRJIF.js";import{u as Gt}from"./expenseAutomationHelper-MxNxlZNN.js";import"./recharts-CoAMGh71.js";import"./analytics-BTvt2K3S.js";import"./plaid-CQqwPn97.js";import"./dnd-Cbdx7tVf.js";import"./stripe-cKAAJElX.js";import"./lottie-BQlGSG2c.js";import"./lexical-DRfKJLK3.js";import"./pdf-DGzvSuDl.js";import"./utils-BVIT21dc.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]="75803c07-87c7-474a-93a5-80a93950b248",a._sentryDebugIdIdentifier="sentry-dbid-75803c07-87c7-474a-93a5-80a93950b248")}catch{}})();const B="AppDrawer",c={root:`${B}-root`,drawer:`${B}-drawer`,appBar:`${B}-appBar`,menuButton:`${B}-menuButton`,appBarZenilogo:`${B}-appBarZenilogo`,drawerZenilogo:`${B}-drawerZenilogo`},Pt=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,x]=va.useState(!1),[S,Re]=o.useState(!1),t=ya(),s=$a(),ae=Aa(),te=st(),n=Me(),[Ge,Pe]=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(Te()),n(Ie()))}),[n,w,i.tenantId,E]);const[L,He]=o.useState(void 0),Le=!!i.company?.companyZeniAccountInfo?.isZeniAccountEnabled,{isFeatureEnabled:Ne}=u(m.isChargeCardFeatureEnabled),Oe=Ct(i,Ne,oe),{isFeatureEnabled:Ue}=u(m.isSettingsFeatureEnabled),{isFeatureEnabled:D}=u(m.isReferralFeatureEnabled),ze=i.companyTreasuryInfo?.info?.businessVerificationStatus?.code==="verified",re=r((e=>xa(e)));o.useEffect((()=>{const e=()=>{Pe(window.scrollY>10)};return window.addEventListener("scroll",e),()=>{window.removeEventListener("scroll",e)}}),[]);const N=r((e=>_a(e))),h=r((e=>e.expenseAutomationViewState.selectedPeriodByTenantId)),f=r((e=>Da(e))),{monthEndCloseChecksView:T}=f,Ye=G("/signout")!==null,M=G("/:tenantEmailDomain/dashboard")!==null,ie=G("/:tenantEmailDomain/reports")!==null,g=G("/:tenantEmailDomain/onboarding/*")!==null,le=Gt();o.useEffect((()=>{w&&D&&!g&&N.fetchState==="Not-Started"&&n(Ma(!0))}),[w,D,N.fetchState,g]),o.useEffect((()=>{if(le){const e=t.state?.origin;if(e!=null){const l=Fa(e);l!=null&&n(ve(l))}}}),[le,t.state]);const qe=Ye||g,O=r((e=>e.tenantState)),Je=r((e=>O.fetchState==="Completed"?Za(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)),U=r((e=>Ra(e))),ra=r((e=>Ga(e).skillsEnabled)),ia=r((e=>Pa(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),[I,z]=o.useState(void 0),Y=U.uiState.currentChatSessionId,F=I!=null?U.deleteChatSessionStateByChatSessionId[I]?.fetchState:void 0,me=ft(F),{inboxNotifications:q,isLoading:Ce,isFetchingMore:pe,hasFetchedAll:he,fetchMore:ua}=Zt(),Z=r((e=>$(e).notificationDetailsByTab.comments.fetchCountState));o.useEffect((()=>{const e=setTimeout((()=>ua?.()),0);return()=>clearTimeout(e)})),o.useEffect((()=>{if(I!=null)return me==="In-Progress"&&F==="Completed"?(n(ye({chatSessionId:I})),z(void 0),void s(`/${a}/ai-cfo/explore`,{state:{...t.state,referrer:"Sidebar"}})):void(F==="Error"&&(n(ye({chatSessionId:I})),z(void 0)))}),[n,t.state,s,F,I,me,a]),o.useEffect((()=>{if(Ce===!1&&pe===!1&&he===!0&&i?.companyId!=null&&q!=null){const e=`dashboard_${i.companyId}`;He(q.filter((l=>l.roomId===e&&l.readAt==null)).length)}}),[Ce,pe,he,i?.companyId,q]),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||Z.fetchState!=="Not-Started"||n($e({fetchCountState:{fetchState:"In-Progress",error:void 0}},"comments"))}),[g,Z.fetchState,n]),o.useEffect((()=>{if(L!=null){const{fetchState:e}=Z;e!=="In-Progress"&&e!=="Completed"||(e==="In-Progress"&&n($e({fetchCountState:{fetchState:"Completed",error:void 0}},"comments")),n(Ze({unreadCount:L},"comments")))}}),[L,Z.fetchState]);const ma={fetchStatus:sa,count:ta},v=[];Ke===!1&&v.push("accounts_payable_aging"),We===!1&&v.push("accounts_receivable_aging"),v.push("zeni_accounts_promo_card","treasury_promo_card"),D===!1&&v.push("rewards_card"),se===!1&&v.push("expense_automation_card");const fe=r((e=>La(e,v).fetchState)),ge=r((e=>Na(e).fetchState)),be=a!=null?gt.getSignedInUserTenant(a):null,Se=r((e=>be?.tenantId!=null?Oa(e,be.tenantId):void 0)),Ca=M&&(fe==="Completed"||fe==="Error")||ie&&(ge==="Completed"||ge==="Error")||!M&&!ie?void 0:"disabled",pa=o.useMemo((()=>Ua(i.userRole)),[i.userRole]),ha=za(pa),y=e=>{x(e)},fa=ze,ga=i?.rewardsLastViewedTime==null,ba=k?.userEmail!=null&&re.fetchState==="Completed"&&Ya(re.notificationSettings,k.userEmail,oe,i,_),Sa=o.useCallback((e=>{const l=t.state?.referrer;if(T.monthEndCloseChecks?.auditSummary!=null&&P.trackMonthCloseAuditPage(e.month,e.year,T.monthEndCloseChecks.reportEmailSentDate!=null?"closed":"in-review",T.monthEndCloseChecks.auditSummary.auditScorePercentage,!1,l??null),n(qa(i.tenantId,e)),h[i.tenantId]!=null){const A=p(t.state?.pathnameStackToGoBack,t.pathname);s(`/${a}/month_end_close_checks/review/${f.currentSelectedView}/${e.month}-${e.year}`,{state:{pathnameStackToGoBack:A,referrer:f.currentSelectedView}})}n(ve(f.currentSelectedView)),f.reconciliation.selectedAccountId!=null&&n(Ja({selectedAccountId:void 0}))}),[f.reconciliation.selectedAccountId,f.currentSelectedView,i.tenantId,T.monthEndCloseChecks?.auditSummary,T.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:O.currentTenantId??"",tenants:O.fetchState==="Completed"?Je:Se!=null?[Se]:[],rewardsConfiguration:{isRewardsTabVisible:D,isRewardsAnimated:ga,rewardsPlan:N.rewardsPlan},selectedMenu:C===!0?xe("ai_cfo"):Ae(t)&&ue!=="completed"?xe("invoicing"):Et(t),isTenantDropdownDisabled:Ca,isSettings:kt(t),isInvoicing:Ae(t)&&ue==="completed",isSettingsFeatureEnabled:Ue,currentTenant:i,isVendorsTabVisible:ha,isZeniAccountEnabled:Le,isChargeCardEnabled:Oe,isTreasuryEnabled:fa,isNotificationsTabVisible:ba,notificationCountDetails:ma,isExpenseAutomationEnabledForUser:se,isAiCfoAccessEnabled:E,skillsEnabled:ra&&E,routinesEnabled:ia===!0&&E,routines:la,selectedRoutineId:da,onRoutineSelect:ca,onNotificationIconClick:()=>{y(!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(yt.TENANT_SWITCHING),y(!1),$t({dispatch:n,navigate:s,pathToNavigate:Bt(e.tenantEmailDomain,t),selectedTenant:e,signedInUser:k})},handleMenuChange:(e,l)=>{if(k!=null&&P.trackSidePanelClicked(e.type,e.group),y(!1),a==null)return;if(e.type==="routines")return H?(n(Ie()),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(Te()),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&&Tt(e.type)&&b(!1),e.type==="ai_cfo"){if(P.trackAICFOChatScreenStateChanged("viewed","left_menu",Y??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 A=p(t.state?.pathnameStackToGoBack,t.pathname),J=e.type,we=xt(J)&&J!=="command_center";if(J!=="command_center"&&!we||h[i.tenantId]==null||P.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:A,message:l,referrer:"Sidebar"}})}const Ia=It(e.type);vt(e.type)?(Y!=null&&n(at()),s(`/${a}/ai-cfo/${e.type}`,{state:{pathnameStackToGoBack:A.slice(0,-1),message:l,referrer:"Sidebar"}})):s(`../${a}/${Ia}`,{state:{pathnameStackToGoBack:A,message:l,referrer:"Sidebar"}})},onDeleteChatSession:e=>{n(Wa(e)),Y===e&&z(e)},handleLogOutClick:()=>{y(!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:T,onPeriodChange:Sa,onCalendarOpen:Re,aiCfoView:U,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:Ge?`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:()=>y(!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"))),Ta=_e((e=>e.breakpoints.down("md")));return a==null?null:d.jsxs(Pt,{className:c.root,children:[d.jsx(Ft,{}),qe===!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:()=>y(!1),PaperProps:{sx:{width:X,zIndex:Be[2],borderRight:"none",backgroundImage:"none",backgroundColor:j.colors.background}},ModalProps:{keepMounted:!0},children:ke}),Ta?null:d.jsx(De,{PaperProps:{sx:{width:X,borderRight:"none",backgroundImage:"none",backgroundColor:j.colors.background,...ka}},variant:"permanent",open:!0,children:ke})]})]}):null]})})),r1=({tenantEmailDomain:a})=>{const C=Me(),b=r((x=>Fe(x))),V={events:b.userRoleId!=null?[`private-encrypted-${b.userRoleId}.dashboard-user-notification`]:[],eventCallback:(x,S)=>{nt(S)&&Ba(S.mode)==="dashboard"&&C(Ze({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-BXyXenK7.js";import{a as o,R as va}from"./sentry-D4svnzxK.js";import{u as Me,j as r,g as ya,h as $a,q as G}from"./core-Bl4MLhFi.js";import{fE as Fe,TL as Ba,TM as Re,g8 as Aa,gu as Q,TN as X,jt as Te,jA as Ie,TO as xa,TP as _a,gN as Da,p_ as Ma,TQ as Fa,TR as ve,gl as Ra,TS as $,fD as Za,gs as Ga,TT as Pa,TU as Va,TV as Na,TW as ye,TX as ja,TY as $e,TZ as Ha,E0 as La,gm as Ua,h0 as Oa,cV as za,T_ as Ya,T$ as qa,qB as Wa,g7 as Qa,j5 as Xa,U0 as Ja,U1 as Ka,wp as et,gn as at}from"./zeni-epic-state-UM7IPCLf.js";import{w as tt,i as nt,a as ot,E as st,c as rt,N as it,d as m,e as lt,u as dt,f as ct,q as ut,g as mt,h as Ct,R as pt,O as ht,j as ft,z as gt,k as P,p,m as Be,l as bt,V as St,n as Ae,o as kt,r as xe,s as Et,P as wt,v as K,x as J,y as Tt,A as It,B as vt,L as yt,C as $t,D as Bt,F as ee,H as At,W as xt}from"./index-D_qRPRIi.js";import{A as _t,b as Dt,I as Mt,a as _e,d as Ft,D as De}from"./mui-CyP-P4av.js";import{u as Rt}from"./InboxNotificationsProvider-CMdsyY0A.js";import{u as Zt}from"./useTaskManagerAccess-Rxke8A9H.js";import{u as Gt}from"./expenseAutomationHelper-CkBJgYs_.js";import"./recharts-CZKBTuPa.js";import"./analytics-B06OpwA-.js";import"./plaid-C0aCR9wu.js";import"./dnd-CimhpTrK.js";import"./stripe-cKAAJElX.js";import"./lottie-2qUppQdg.js";import"./lexical-BbBoQdpc.js";import"./pdf-BENieWk6.js";import"./utils-Bycom664.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]="f154413b-76f4-4995-9987-1954df440510",a._sentryDebugIdIdentifier="sentry-dbid-f154413b-76f4-4995-9987-1954df440510")}catch{}})();const B="AppDrawer",c={root:`${B}-root`,drawer:`${B}-drawer`,appBar:`${B}-appBar`,menuButton:`${B}-menuButton`,appBarZenilogo:`${B}-appBarZenilogo`,drawerZenilogo:`${B}-drawerZenilogo`},Pt=ee("div",{slot:"Root"})((({theme:a})=>({[`&.${c.root}`]:{display:"flex"},[`& .${c.drawer}`]:{[a.breakpoints.up("md")]:{width:K,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,x]=va.useState(!1),[S,Ze]=o.useState(!1),t=ya(),s=$a(),ae=Aa(),te=st(),n=Me(),[Ge,Pe]=o.useState(!1),N=rt(),ne=t.pathname.includes("/ai-cfo/");o.useEffect((()=>{ne||(n(Q()),n(X()))}),[n,ne]),o.useEffect((()=>{n(Q()),n(X())}),[n,a]);const{useFeatureGate:u}=it(),{isFeatureEnabled:oe}=u(m.isDebitCardFeatureEnabled),k=lt(),i=r((e=>Fe(e))),j=i.masterTOSInfo?.isMasterTOSAccepted??!1,{setLoading:Ve}=dt(),E=ct(),{isTaskManagerAccessEnabled:_,isZeniUser:Ne}=Zt(k),se=ut(),w=mt();o.useEffect((()=>{w&&E&&(n(Te()),n(Ie()))}),[n,w,i.tenantId,E]);const[H,je]=o.useState(void 0),He=!!i.company?.companyZeniAccountInfo?.isZeniAccountEnabled,{isFeatureEnabled:Le}=u(m.isChargeCardFeatureEnabled),Ue=Ct(i,Le,oe),{isFeatureEnabled:Oe}=u(m.isSettingsFeatureEnabled),{isFeatureEnabled:D}=u(m.isReferralFeatureEnabled),ze=i.companyTreasuryInfo?.info?.businessVerificationStatus?.code==="verified",re=r((e=>xa(e)));o.useEffect((()=>{const e=()=>{Pe(window.scrollY>10)};return window.addEventListener("scroll",e),()=>{window.removeEventListener("scroll",e)}}),[]);const L=r((e=>_a(e))),h=r((e=>e.expenseAutomationViewState.selectedPeriodByTenantId)),f=r((e=>Da(e))),{monthEndCloseChecksView:T}=f,Ye=G("/signout")!==null,M=G("/:tenantEmailDomain/dashboard")!==null,ie=G("/:tenantEmailDomain/reports")!==null,g=G("/:tenantEmailDomain/onboarding/*")!==null,le=Gt();o.useEffect((()=>{w&&D&&!g&&L.fetchState==="Not-Started"&&n(Ma(!0))}),[w,D,L.fetchState,g]),o.useEffect((()=>{if(le){const e=t.state?.origin;if(e!=null){const l=Fa(e);l!=null&&n(ve(l))}}}),[le,t.state]);const qe=Ye||g,U=r((e=>e.tenantState)),We=r((e=>U.fetchState==="Completed"?Ra(e):[])),{isFeatureEnabled:Qe}=u(m.isApAgingFeatureEnabled),{isFeatureEnabled:Xe}=u(m.isArAgingFeatureEnabled),{isFeatureEnabled:Je}=u(m.isDashboardSidebarHalloweenAnimationEnabled),{isFeatureEnabled:Ke}=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=>Za(e))),ra=r((e=>Ga(e).skillsEnabled)),ia=r((e=>Pa(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(Na),[I,z]=o.useState(void 0),Y=O.uiState.currentChatSessionId,F=I!=null?O.deleteChatSessionStateByChatSessionId[I]?.fetchState:void 0,me=ft(F),{inboxNotifications:q,isLoading:Ce,isFetchingMore:pe,hasFetchedAll:he,fetchMore:ua}=Rt(),R=r((e=>$(e).notificationDetailsByTab.comments.fetchCountState));o.useEffect((()=>{const e=setTimeout((()=>ua?.()),0);return()=>clearTimeout(e)})),o.useEffect((()=>{if(I!=null)return me==="In-Progress"&&F==="Completed"?(n(ye({chatSessionId:I})),z(void 0),void s(`/${a}/ai-cfo/explore`,{state:{...t.state,referrer:"Sidebar"}})):void(F==="Error"&&(n(ye({chatSessionId:I})),z(void 0)))}),[n,t.state,s,F,I,me,a]),o.useEffect((()=>{if(Ce===!1&&pe===!1&&he===!0&&i?.companyId!=null&&q!=null){const e=`dashboard_${i.companyId}`;je(q.filter((l=>l.roomId===e&&l.readAt==null)).length)}}),[Ce,pe,he,i?.companyId,q]),o.useEffect((()=>{w&&_&&!g&&de.fetchState==="Not-Started"&&ae.tenantId!=null&&n(ja("task_manager","dashboard"))}),[w,_,g,de.fetchState,ae.tenantId,n]),o.useEffect((()=>{g||R.fetchState!=="Not-Started"||n($e({fetchCountState:{fetchState:"In-Progress",error:void 0}},"comments"))}),[g,R.fetchState,n]),o.useEffect((()=>{if(H!=null){const{fetchState:e}=R;e!=="In-Progress"&&e!=="Completed"||(e==="In-Progress"&&n($e({fetchCountState:{fetchState:"Completed",error:void 0}},"comments")),n(Re({unreadCount:H},"comments")))}}),[H,R.fetchState]);const ma={fetchStatus:sa,count:ta},v=[];Qe===!1&&v.push("accounts_payable_aging"),Xe===!1&&v.push("accounts_receivable_aging"),v.push("zeni_accounts_promo_card","treasury_promo_card"),D===!1&&v.push("rewards_card"),se===!1&&v.push("expense_automation_card");const fe=r((e=>Ha(e,v).fetchState)),ge=r((e=>La(e).fetchState)),be=a!=null?gt.getSignedInUserTenant(a):null,Se=r((e=>be?.tenantId!=null?Ua(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),y=e=>{x(e)},fa=ze,ga=i?.rewardsLastViewedTime==null,ba=k?.userEmail!=null&&re.fetchState==="Completed"&&Ya(re.notificationSettings,k.userEmail,oe,i,_),Sa=o.useCallback((e=>{const l=t.state?.referrer;if(T.monthEndCloseChecks?.auditSummary!=null&&P.trackMonthCloseAuditPage(e.month,e.year,T.monthEndCloseChecks.reportEmailSentDate!=null?"closed":"in-review",T.monthEndCloseChecks.auditSummary.auditScorePercentage,!1,l??null),n(qa(i.tenantId,e)),h[i.tenantId]!=null){const A=p(t.state?.pathnameStackToGoBack,t.pathname);s(`/${a}/month_end_close_checks/review/${f.currentSelectedView}/${e.month}-${e.year}`,{state:{pathnameStackToGoBack:A,referrer:f.currentSelectedView}})}n(ve(f.currentSelectedView)),f.reconciliation.selectedAccountId!=null&&n(Wa({selectedAccountId:void 0}))}),[f.reconciliation.selectedAccountId,f.currentSelectedView,i.tenantId,T.monthEndCloseChecks?.auditSummary,T.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:U.currentTenantId??"",tenants:U.fetchState==="Completed"?We:Se!=null?[Se]:[],rewardsConfiguration:{isRewardsTabVisible:D,isRewardsAnimated:ga,rewardsPlan:L.rewardsPlan},selectedMenu:C===!0?xe("ai_cfo"):Ae(t)&&ue!=="completed"?xe("invoicing"):Et(t),isTenantDropdownDisabled:Ca,isSettings:kt(t),isInvoicing:Ae(t)&&ue==="completed",isSettingsFeatureEnabled:Oe,currentTenant:i,isVendorsTabVisible:ha,isZeniAccountEnabled:He,isChargeCardEnabled:Ue,isTreasuryEnabled:fa,isNotificationsTabVisible:ba,notificationCountDetails:ma,isExpenseAutomationEnabledForUser:se,isAiCfoAccessEnabled:E,skillsEnabled:ra&&E,routinesEnabled:ia===!0&&E,routines:la,selectedRoutineId:da,onRoutineSelect:ca,onNotificationIconClick:()=>{y(!1);const e=Ne?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(yt.TENANT_SWITCHING),y(!1),$t({dispatch:n,navigate:s,pathToNavigate:Bt(e.tenantEmailDomain,t),selectedTenant:e,signedInUser:k})},handleMenuChange:(e,l)=>{if(k!=null&&P.trackSidePanelClicked(e.type,e.group),y(!1),a==null)return;if(e.type==="routines")return j?(n(Ie()),n(Ja()),void s(`/${a}/ai-cfo/routines`,{state:{pathnameStackToGoBack:p(t.state?.pathnameStackToGoBack,t.pathname),referrer:"Sidebar"}})):void J({location:t,navigate:s,mergeState:{referrer:"Sidebar"}});if(e.type==="skills")return j?(n(Te()),n(Ka()),void s(`/${a}/ai-cfo/skills`,{state:{pathnameStackToGoBack:p(t.state?.pathnameStackToGoBack,t.pathname),referrer:"Sidebar"}})):void J({location:t,navigate:s,mergeState:{referrer:"Sidebar"}});if(n(Q()),n(X()),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&&Tt(e.type)&&b(!1),e.type==="ai_cfo"){if(P.trackAICFOChatScreenStateChanged("viewed","left_menu",Y??null,null),!j)return void J({location:t,navigate:s,mergeState:{referrer:"Sidebar"}});const Z=p(t.state?.pathnameStackToGoBack,t.pathname);return void s(`/${a}/ai-cfo/explore`,{state:{pathnameStackToGoBack:Z,referrer:"Sidebar"}})}const A=p(t.state?.pathnameStackToGoBack,t.pathname),W=e.type,we=xt(W)&&W!=="command_center";if(W!=="command_center"&&!we||h[i.tenantId]==null||P.trackMonthEndCloseClicked(h[i.tenantId].month,h[i.tenantId].year,"Sidebar"),we&&h[i.tenantId]!=null){const Z=h[i.tenantId];return void s(`/${a}/month_end_close_checks/review/${e.type}/${Z.month}-${Z.year}`,{state:{pathnameStackToGoBack:A,message:l,referrer:"Sidebar"}})}const Ia=It(e.type);vt(e.type)?(Y!=null&&n(at()),s(`/${a}/ai-cfo/${e.type}`,{state:{pathnameStackToGoBack:A.slice(0,-1),message:l,referrer:"Sidebar"}})):s(`../${a}/${Ia}`,{state:{pathnameStackToGoBack:A,message:l,referrer:"Sidebar"}})},onDeleteChatSession:e=>{n(Xa(e)),Y===e&&z(e)},handleLogOutClick:()=>{y(!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:T,onPeriodChange:Sa,onCalendarOpen:Ze,aiCfoView:O,isAiCfo:Ea,isOnDashboard:M,isTaskManagerAccessEnabled:_,updateCurrentChatSessionId:e=>{n(Qa({sessionId:e,agentId:"controller"})),s(`../${a}/ai-cfo/${e}`,{state:{...t.state}})},halloweenAnimationEnabled:Je,thanksGivingAnimationEnabled:Ke,christmasAnimationEnabled:ea,newYearAnimationEnabled:aa}),wa=d.jsx(_t,{position:"fixed",className:c.appBar,style:{borderBottom:Ge?`1px solid ${N.colors.grey2}`:""},children:d.jsxs(Dt,{style:{minHeight:wt},children:[d.jsx(Mt,{color:"inherit","aria-label":"open drawer",edge:"start",onClick:()=>y(!0),className:c.menuButton,size:"large",children:d.jsx(Nt,{})}),d.jsx(jt,{className:c.appBarZenilogo,onClick:()=>{te.toggle()}})]})}),Ee=_e((e=>e.breakpoints.up("md"))),Ta=_e((e=>e.breakpoints.down("md")));return a==null?null:d.jsxs(Pt,{className:c.root,children:[d.jsx(Ft,{}),qe===!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:()=>y(!1),PaperProps:{sx:{width:K,zIndex:Be[2],borderRight:"none",backgroundImage:"none",backgroundColor:N.colors.background}},ModalProps:{keepMounted:!0},children:ke}),Ta?null:d.jsx(De,{PaperProps:{sx:{width:K,borderRight:"none",backgroundImage:"none",backgroundColor:N.colors.background,...ka}},variant:"permanent",open:!0,children:ke})]})]}):null]})})),r1=({tenantEmailDomain:a})=>{const C=Me(),b=r((x=>Fe(x))),V={events:b.userRoleId!=null?[`private-encrypted-${b.userRoleId}.dashboard-user-notification`]:[],eventCallback:(x,S)=>{nt(S)&&Ba(S.mode)==="dashboard"&&C(Re({unreadCount:S.data.unread},"tasks"))}};return d.jsx(Vt,{tenantEmailDomain:a,...V})},Nt=ee((a=>o.createElement("svg",{viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",...a},o.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M0.604839 4.51889C0.333157 4.57797 0.0879194 4.8318 0.0182541 5.12602C-0.00534674 5.22569 -0.00534674 5.4412 0.0182541 5.54086C0.0523791 5.685 0.117181 5.80198 0.22956 5.92229C0.346814 6.04782 0.459133 6.11627 0.600351 6.14826C0.726193 6.17676 23.2738 6.17676 23.3997 6.14826C23.5409 6.11627 23.6532 6.04782 23.7704 5.92229C23.9348 5.74632 24 5.57908 24 5.33344C24 5.1793 23.9797 5.08352 23.9199 4.95575C23.8455 4.79698 23.6879 4.63709 23.5343 4.56468C23.3857 4.49468 24.2116 4.49926 11.9899 4.50058C2.66632 4.50157 0.669677 4.50479 0.604839 4.51889ZM0.669895 11.1732C0.365117 11.2113 0.0889356 11.4752 0.0182179 11.7958C-0.00468131 11.8996 -0.00469357 12.0996 0.0181935 12.2034C0.0806855 12.4867 0.305734 12.7294 0.581516 12.8108C0.65573 12.8327 1.1761 12.8337 12 12.8337C22.8591 12.8337 23.3441 12.8327 23.4192 12.8106C23.6933 12.7297 23.9196 12.4855 23.9818 12.2034C24.0047 12.0996 24.0047 11.8997 23.9818 11.7959C23.9201 11.516 23.7014 11.2776 23.425 11.1888C23.3558 11.1665 22.8817 11.1655 12.0544 11.164C5.84032 11.1631 0.717278 11.1672 0.669895 11.1732ZM0.594774 17.8516C0.458952 17.8831 0.344939 17.9535 0.22956 18.077C0.0652015 18.253 0 18.4202 0 18.6659C0 18.82 0.0203225 18.9158 0.0801289 19.0435C0.154452 19.2023 0.312097 19.3622 0.465726 19.4346C0.614214 19.5046 -0.209758 19.4999 12 19.4999C21.8294 19.4999 23.3082 19.4975 23.3881 19.4811C23.6596 19.4256 23.9122 19.1669 23.9817 18.8733C24.0053 18.7736 24.0053 18.5581 23.9817 18.4584C23.9476 18.3143 23.8828 18.1973 23.7704 18.077C23.6532 17.9515 23.5409 17.883 23.3997 17.851C23.2779 17.8235 0.713601 17.824 0.594774 17.8516Z",fill:"currentColor"}))))`
|
|
2
2
|
height: 20px;
|
|
3
3
|
width: 20px;
|
|
4
4
|
color: ${a=>a.theme.colors.primary};
|
|
5
|
-
`,
|
|
5
|
+
`,jt=ee((a=>o.createElement("svg",{viewBox:"0 0 102 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",...a},o.createElement("path",{d:"M73.4046 13.2609H57.77C58.0392 15.0844 58.8324 16.5249 60.352 17.5133C61.5784 18.3113 62.9424 18.5733 64.3842 18.407C64.8867 18.3484 65.3952 18.2539 65.8738 18.0935C67.1433 17.6676 68.0945 16.8923 68.4559 15.5031H73.2777C73.1629 16.3885 72.8877 17.1866 72.4845 17.938C71.4734 19.8189 69.9228 21.1159 67.9414 21.8302C64.3076 23.138 60.7875 22.9178 57.5642 20.6588C55.1293 18.9526 53.7318 16.5465 53.3034 13.6055C52.9959 11.4973 53.2065 9.43809 54.1374 7.49857C55.6988 4.2453 58.2761 2.29381 61.8273 1.67642C64.048 1.28995 66.2124 1.54361 68.2202 2.60969C71.2784 4.23333 73.0085 6.79743 73.4405 10.2314C73.5649 11.2161 73.5374 12.202 73.407 13.2621L73.4046 13.2609ZM68.3554 9.72765C68.3278 9.51706 68.3159 9.334 68.2788 9.15692C68.0622 8.12913 67.4915 7.32388 66.6767 6.68735C65.7697 5.97902 64.7264 5.68349 63.5825 5.62486C61.0543 5.49444 58.8289 7.02356 58.0918 9.44408C58.0655 9.52903 58.0595 9.62116 58.0416 9.72765H68.3566H68.3554Z",fill:"currentColor"}),o.createElement("path",{d:"M52.7423 17.86V21.9162C52.7423 22.0478 52.6346 22.1555 52.503 22.1555H34.5854C34.5854 22.1555 34.595 19.9659 34.5783 19.1008C34.5723 18.7861 34.662 18.5528 34.8786 18.3183C38.3664 14.535 41.8458 10.7445 45.3276 6.95397C45.452 6.81877 45.744 6.49093 45.744 6.49093H35.6396C35.5079 6.49093 35.4003 6.38324 35.4003 6.25163V2.14645C35.4003 2.01483 35.5079 1.90715 35.6396 1.90715H52.6334C52.6334 1.90715 52.6274 4.18288 52.6418 5.17239C52.6454 5.41767 52.5341 5.57321 52.3833 5.73713C50.1543 8.15884 41.5048 17.6219 41.5048 17.6219H52.5042C52.6358 17.6219 52.7435 17.7296 52.7435 17.8612L52.7423 17.86Z",fill:"currentColor"}),o.createElement("path",{d:"M94.0631 22.0758H89.7353C89.6037 22.0758 89.496 21.9694 89.496 21.8377C89.4925 20.5539 89.4733 14.3919 89.4769 11.3696C89.4769 10.6397 89.4195 9.92064 89.2041 9.21829C88.6142 7.29553 87.0528 6.12056 85.0367 6.07151C83.7122 6.0392 82.5288 6.37542 81.58 7.34578C80.8406 8.10196 80.4386 9.02686 80.2998 10.0642C80.2388 10.5213 80.2148 10.9879 80.2136 11.4498C80.2076 14.429 80.2088 20.5539 80.21 21.8365C80.21 21.9682 80.1023 22.0758 79.9707 22.0758H75.6047C75.4731 22.0758 75.3654 21.9705 75.3654 21.8389C75.3606 20.512 75.3403 13.9576 75.387 10.6349C75.4205 8.27546 76.1838 6.1433 77.78 4.36411C79.2062 2.77516 80.9973 1.84189 83.1056 1.52243C84.8441 1.258 86.5658 1.3286 88.2254 1.93642C91.4727 3.12454 93.3954 5.47924 94.093 8.83302C94.2557 9.61314 94.3072 10.4268 94.3131 11.226C94.3335 14.3321 94.3083 20.5503 94.3036 21.8401C94.3036 21.9717 94.1959 22.077 94.0643 22.077L94.0631 22.0758Z",fill:"currentColor"}),o.createElement("path",{d:"M97.2196 1.90527H101.482C101.613 1.90527 101.721 2.01176 101.721 2.14338L101.772 21.9035C101.772 22.0363 101.666 22.144 101.533 22.144H97.2256C97.094 22.144 96.9863 22.0363 96.9863 21.9047L96.9803 2.14457C96.9803 2.01296 97.088 1.90527 97.2196 1.90527Z",fill:"currentColor"}),o.createElement("path",{d:"M17.1795 0.0270299C16.9776 -0.0551712 16.7491 0.057251 16.6911 0.267589C16.6706 0.342537 16.6476 0.417486 16.6234 0.491225C16.4022 1.1573 16.0299 1.76655 15.5197 2.27789C14.6566 3.14221 13.5082 3.61971 12.2861 3.62091H12.2825C11.0627 3.62091 9.91435 3.14584 9.05124 2.28394C8.54111 1.77381 8.16636 1.16455 7.94394 0.499687C7.91976 0.425947 7.89679 0.350999 7.87503 0.276051C7.81701 0.0657128 7.58854 -0.0455005 7.38666 0.0367007C6.20321 0.522655 5.108 1.17906 4.13125 1.97447C4.00795 2.07481 3.96806 2.24525 4.02729 2.39273C4.07686 2.51603 4.13004 2.63813 4.18565 2.7578C4.62204 3.70916 5.22888 4.58557 5.99166 5.34714C7.67316 7.02501 9.90589 7.94977 12.2813 7.94977H12.2897C14.6675 7.94736 16.9027 7.01897 18.5829 5.33626C19.3445 4.57348 19.9489 3.69586 20.3841 2.7445C20.4397 2.62362 20.4917 2.50153 20.5413 2.37823C20.6005 2.23075 20.5606 2.0603 20.4373 1.95997C19.4594 1.16576 18.3629 0.511775 17.1795 0.0270299Z",fill:"#97C3B9"}),o.createElement("path",{d:"M20.3984 21.2422C19.962 20.2933 19.3564 19.4193 18.596 18.6602C16.9133 16.9799 14.6733 16.0527 12.2979 16.0575C8.71131 16.0611 5.61789 18.196 4.2108 21.2604C4.1564 21.38 4.10321 21.5009 4.05244 21.623C3.992 21.7705 4.03189 21.9422 4.1564 22.0437C5.13435 22.8367 6.22956 23.4895 7.41181 23.973C7.61369 24.0552 7.84095 23.944 7.90018 23.7337C7.92073 23.6575 7.9437 23.5838 7.96908 23.5088C8.57713 21.698 10.2876 20.3888 12.3016 20.3864H12.3064C13.5261 20.3864 14.6745 20.8615 15.5376 21.7234C16.0466 22.2311 16.4189 22.8379 16.6413 23.5004C16.6667 23.5741 16.6897 23.649 16.7102 23.724C16.7694 23.9343 16.9967 24.0455 17.1986 23.9621C18.382 23.4762 19.476 22.821 20.4528 22.0256C20.5761 21.9252 20.616 21.7536 20.5567 21.6061C20.5072 21.4828 20.454 21.3619 20.3984 21.241V21.2422Z",fill:"#97C3B9"}),o.createElement("path",{d:"M0.494416 9.85376C0.31309 9.85376 0.161985 9.98795 0.13539 10.1669C0.045936 10.7676 0 11.3829 0 12.0091C0 12.6401 0.0483536 13.2603 0.141434 13.8659C0.169238 14.0448 0.320343 14.1778 0.501669 14.1778L24.0934 14.1427C24.2747 14.1427 24.4258 14.0086 24.4524 13.8296C24.5419 13.2288 24.589 12.6135 24.5878 11.9862C24.5878 11.3551 24.5395 10.735 24.4464 10.1294C24.4186 9.95047 24.2675 9.8175 24.0862 9.8175L0.494416 9.85256V9.85376Z",fill:"#97C3B9"}))))`
|
|
6
6
|
height: ${At.sp4};
|
|
7
7
|
width: 102px;
|
|
8
8
|
color: ${a=>a.theme.colors.primary};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{j as u}from"./liveblocks-y3zMPGKB.js";import{a as d}from"./sentry-Jm7O5sR0.js";import{h as U,g as j,u as B,j as y,N as F,l as V,i as W,n as te,o as D}from"./core-BwK6FGJd.js";import{fE as P,YK as w,Yr as R,Hv as E,Hp as Y,Ht as A,Hi as q,Yt as K,Hm as ae,Hx as oe,Hl as z,HA as Z,Hw as C}from"./zeni-epic-state-BugXGzus.js";import{z as O,w as J,bY as pe,o as T,bS as G,bZ as le,E as M,a7 as Q,b_ as se,b$ as ne}from"./index-CavSpTx-.js";import"./mui-CxIkaR9n.js";import{u as X,i as re}from"./ReimbursementApprovalRuleDetailScreen-CgsllBgS.js";import ie from"./NotFoundScreen-Duy6T6m3.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]="f42901f3-a735-4721-a859-fff4d6b2b4f0",e._sentryDebugIdIdentifier="sentry-dbid-f42901f3-a735-4721-a859-fff4d6b2b4f0")}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(q(a,!1))},onEditRuleClick:a=>{a!=null?(e(A(a)),t(`./${a}/edit`)):(e(A()),t("./new"))}}}))(J(pe)),ue=({isLoading:e})=>{const l=U(),t=j(),o=B(),[a,n]=d.useState(!1),[s,v]=d.useState(!1),p=y((r=>r.billPaySetupApproverViewState.fetchState)),f=y((r=>P(r))),c=y((r=>w(r))),S=y((r=>R(r).billPaySetupApproverViewUpdateData));if(d.useEffect((()=>{S?.updateStatus.fetchState==="Completed"&&o(E())}),[S]),d.useEffect((()=>{a||p!=="Not-Started"||e||(n(!0),o(Y(!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 m={events:f.companyId!=null?[`private-encrypted-${f.companyId}.${k}`]:[],eventCallback:(r,h,b)=>{r.endsWith(k)&&b.onApprovalRulesEventReceived(r)}};return f?.companyBillPayInfo?.info?.isBillPayTOSAccepted===!1?u.jsx(F,{to:"../../promo"}):u.jsx(ce,{currentTenant:f,location:t,navigate:l,...m})},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(q(a,!0))},onEditRuleClick:a=>{a!=null?(e(A(a)),t(`./${a}/edit`)):(e(A()),t("./new"))},onReorderRules:a=>{e(oe(a,!0))}}}))(J(le)),ve=()=>{const e=y((o=>P(o))),{isApprovalRulesV3Enabled:l,isLoading:t}=G(e?.tenantId);return l?u.jsx(fe,{isLoading:t}):u.jsx(ue,{isLoading:t})},fe=({isLoading:e})=>{const l=U(),t=j(),o=B(),[a,n]=d.useState(!1),[s,v]=d.useState(!1),[p,f]=d.useState(!1),c=y((i=>i.billPaySetupApproverViewState.fetchState)),S=y((i=>i.billPaySetupApproverViewState.approverListState.fetchStatus.fetchState)),m=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(Y(!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 b={events:m.companyId!=null?[`private-encrypted-${m.companyId}.${L}`]:[],eventCallback:(i,I,g)=>{i.endsWith(L)&&g.onApprovalRulesEventReceived(i)}};return m?.companyBillPayInfo?.info?.isBillPayTOSAccepted===!1?u.jsx(F,{to:"../../promo"}):u.jsx(de,{currentTenant:m,location:t,navigate:l,isLoading:e,...b})},ye=V((function(e,l){const t=R(e),o=t.billPaySetupApproverViewUpdateData?.type??"approval_create",a=o==="approval_create"&&t.allApprovalRules.length!==0;let n=t.allApprovalRules.length===0;return l.approvalRuleId&&(n=t.allApprovalRules.findIndex((s=>s.approvalRuleId===l.approvalRuleId))===0),{localData:t,hideUpperBoundField:a,isLowerBoundDisabled:n,approvalUpdateActionType:o}}),(function(e,l){const{navigate:t,approvalUpdateDataView:o,approverViewData:a,approvalRuleId:n}=l,s=o.billPaySetupApproverViewUpdateData?.type,v=T(l.location);return{onApprovalRuleDataUpdated:p=>{const f=S=>{const m=[];return S.forEach((r=>{const h=r.actors.selectedUsers.map((I=>({type:"user",userId:I.userId,isImplicitActor:!1}))),b=r.actors.selectedNonUsers.map((I=>{const g=!!re(I.value);return{type:g?"attribute":"role",subType:I.value,userId:void 0,idType:void 0,isImplicitActor:!g}})),i=h.concat(b);m.push({action:r.stepType.selectedOption,actors:i,operator:i.length>1?r.stepType.selectedOption==="require_approval"?"or":"and":"is"})})),m},c={amount:{type:"amount",comparator:"range",min:{amount:p.lowerBound,currencyCode:"USD",currencySymbol:"$"},max:{amount:p.upperBound,currencyCode:"USD",currencySymbol:"$"}}};if(s==="approval_create"){const S={criteria:c,steps:f(p.steps),isApplicableOnPendingApprovalEntity:p.applyToExistingBills.includes("applyToExistingBills")};e(C(S))}else{const S={approvalRuleId:n,criteria:c,steps:f(p.steps),isApplicableOnPendingApprovalEntity:p.applyToExistingBills.includes("applyToExistingBills")};e(C(S))}},onResetClick:()=>{e(E()),s==="approval_update"||v?t("../"):a.allApprovalRules.length===0&&a.fetchState==="Completed"?t("../../setup"):t("../")},onBackClick:()=>{e(E()),s==="approval_update"||v?t("../"):a.allApprovalRules.length===0&&a.fetchState==="Completed"?t("../../setup"):t("../")},onSaveRuleClick:()=>{e(Z(!1))},onSaveRuleSuccess:()=>{t("../")}}}))(se);function Se(){const e=U(),l=B(),t=j(),{approvalRuleId:o}=W(),a=O.getSignedInUser(),n=M(),s=y((c=>R(c))),v=y((c=>w(c))),[p,f]=d.useState(!1);if(d.useEffect((()=>{p||(f(!0),l(z(!0)))})),d.useEffect((()=>{v.fetchState==="Not-Started"&&e(o!=null?"../../":"../")}),[v,o]),a==null)throw Error("Can't access address page without signing in...");return s.approverListFetchStatus.fetchState=="Not-Started"||s.approverListFetchStatus.fetchState==="In-Progress"?u.jsx(Q,{fetchState:s.approverListFetchStatus.fetchState,style:{backgroundColor:n.colors.grey5}}):u.jsx(ye,{navigate:e,approvalUpdateDataView:s,approvalRuleId:o,approverViewData:v,location:t})}const me=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 I=[];return i.forEach((g=>{const N=g.actorKind?.selectedOption,ee=g.selectedRole?.selectedNonUsers??[];let x=[];N==="role"?x=ee.map((_=>({type:"attribute",subType:_.value,userId:void 0,idType:void 0,isImplicitActor:!1}))):N==="specific_person"&&(x=(g.persons?.selectedUsers??[]).map((_=>({type:"user",userId:_.userId,isImplicitActor:!1}))));const $=g.action??"require_approval";I.push({action:$,actors:x,operator:x.length>1?$==="require_approval"?"or":"and":"is"})})),I},c=p.amountCriteria,S=p.vendorCriteria,m=p.departmentCriteria,r={};if(c!=null&&c.comparator.selectedOption!=null){const i=c.comparator.selectedOption;r.amount={type:"amount",comparator:i,min:i==="less_than"?void 0:c.min,max:i==="greater_than"?void 0:c.max}}const h=S?.selection.selectedOptions??[];h.length>0&&(r.vendor={type:"vendor",operator:S?.operator.selectedOption??"is",vendorIds:h});const b=m?.selection.selectedOptions??[];if(b.length>0&&(r.department={type:"department",operator:m?.operator.selectedOption??"is",departmentIds:b}),s==="approval_create"){const i={name:p.name,description:p.description,separationOfDuties:p.separationOfDuties,criteria:r,steps:f(p.steps),isApplicableOnPendingApprovalEntity:p.applyToExistingBills.includes("applyToExistingBills")};e(C(i))}else{const i={approvalRuleId:n,name:p.name,description:p.description,separationOfDuties:p.separationOfDuties,criteria:r,steps:f(p.steps),isApplicableOnPendingApprovalEntity:p.applyToExistingBills.includes("applyToExistingBills")};e(C(i))}},onResetClick:()=>{e(E()),s==="approval_update"||v?t("../"):a.allApprovalRules.length===0&&a.fetchState==="Completed"?t("../../setup"):t("../")},onBackClick:()=>{e(E()),s==="approval_update"||v?t("../"):a.allApprovalRules.length===0&&a.fetchState==="Completed"?t("../../setup"):t("../")},onSaveRuleClick:()=>{e(Z(!0))},onSaveRuleSuccess:()=>{t("../")},onEditExistingRule:p=>{e(A(p)),t(s==="approval_update"?`../../${p}/edit`:`../${p}/edit`)}}}))(ne);function H(){const e=y((t=>P(t))),{isApprovalRulesV3Enabled:l}=G(e?.tenantId);return l?u.jsx(ge,{}):u.jsx(Se,{})}function ge(){const e=U(),l=B(),t=j(),{approvalRuleId:o}=W(),a=O.getSignedInUser(),n=M(),s=y((c=>R(c))),v=y((c=>w(c))),[p,f]=d.useState(!1);if(X(),d.useEffect((()=>{p||(f(!0),l(z(!1)))})),d.useEffect((()=>{v.fetchState==="Not-Started"&&e(o!=null?"../../":"../")}),[v,o]),a==null)throw Error("Can't access address page without signing in...");return s.approverListFetchStatus.fetchState=="Not-Started"||s.approverListFetchStatus.fetchState==="In-Progress"?u.jsx(Q,{fetchState:s.approverListFetchStatus.fetchState,style:{backgroundColor:n.colors.grey5}}):u.jsx(me,{navigate:e,approvalUpdateDataView:s,approvalRuleId:o,approverViewData:v,location:t},o??"new")}function De(){return u.jsxs(te,{children:[u.jsx(D,{path:"/",element:u.jsx(ve,{})}),u.jsx(D,{path:"/new",element:u.jsx(H,{})}),u.jsx(D,{path:"/:approvalRuleId/edit",element:u.jsx(H,{})}),u.jsx(D,{path:"*",element:u.jsx(ie,{})})]})}export{De as B};
|
|
1
|
+
import{j as u}from"./liveblocks-BXyXenK7.js";import{a as d}from"./sentry-D4svnzxK.js";import{h as U,g as j,u as B,j as y,N as F,l as V,i as W,n as te,o as D}from"./core-Bl4MLhFi.js";import{fE as P,YM as w,Yt as R,Hx as E,Hr as Y,Hv as A,Hk as q,Yv as z,Ho as ae,Hz as oe,Hn as K,HC as M,Hy as C}from"./zeni-epic-state-UM7IPCLf.js";import{z as k,w as J,bY as pe,o as O,bS as Z,bZ as le,c as G,a7 as Q,b_ as se,b$ as ne}from"./index-D_qRPRIi.js";import"./mui-CyP-P4av.js";import{u as X,i as re}from"./ReimbursementApprovalRuleDetailScreen-C95Tlh44.js";import ie from"./NotFoundScreen-BHAnIkPW.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]="51ec73ef-a00c-4ae2-af39-c4418fbc8ba2",e._sentryDebugIdIdentifier="sentry-dbid-51ec73ef-a00c-4ae2-af39-c4418fbc8ba2")}catch{}})();const _="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(_)&&e(z(!1))},onBackClick:()=>{O(o)?t("../../"):t("../../../bills/setup")},onDeleteRuleClick:a=>{e(q(a,!1))},onEditRuleClick:a=>{a!=null?(e(A(a)),t(`./${a}/edit`)):(e(A()),t("./new"))}}}))(J(pe)),ue=({isLoading:e})=>{const l=U(),t=j(),o=B(),[a,n]=d.useState(!1),[s,v]=d.useState(!1),p=y((r=>r.billPaySetupApproverViewState.fetchState)),f=y((r=>P(r))),c=y((r=>w(r))),S=y((r=>R(r).billPaySetupApproverViewUpdateData));if(d.useEffect((()=>{S?.updateStatus.fetchState==="Completed"&&o(E())}),[S]),d.useEffect((()=>{a||p!=="Not-Started"||e||(n(!0),o(Y(!0,!0,!1)))}),[a,p,e,o]),k.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}.${_}`]:[],eventCallback:(r,h,b)=>{r.endsWith(_)&&b.onApprovalRulesEventReceived(r)}};return f?.companyBillPayInfo?.info?.isBillPayTOSAccepted===!1?u.jsx(F,{to:"../../promo"}):u.jsx(ce,{currentTenant:f,location:t,navigate:l,...g})},L="bill-approval-rule-update",de=V((function(e){const l=w(e),t=R(e).billPaySetupApproverViewUpdateData,o={};for(const n of Object.values(e.vendorState.vendorByID))n?.id!=null&&(o[n.id]=n.name);const a={};for(const n of Object.values(e.classState.classesByKey))n?.classId!=null&&(a[n.classId]=n.className);return{approvalView:l,billPaySetupApproverViewUpdateData:t,vendorNamesById:o,departmentNamesById:a}}),(function(e,l){const{navigate:t,location:o}=l;return{onApprovalRulesEventReceived:a=>{a.endsWith(L)&&e(z(!1))},onBackClick:()=>{O(o)?t("../../"):t("../../../bills/setup")},onDeleteRuleClick:a=>{e(q(a,!0))},onEditRuleClick:a=>{a!=null?(e(A(a)),t(`./${a}/edit`)):(e(A()),t("./new"))},onReorderRules:a=>{e(oe(a,!0))}}}))(J(le)),ve=()=>{const e=y((o=>P(o))),{isApprovalRulesV3Enabled:l,isLoading:t}=Z(e?.tenantId);return l?u.jsx(fe,{isLoading:t}):u.jsx(ue,{isLoading:t})},fe=({isLoading:e})=>{const l=U(),t=j(),o=B(),[a,n]=d.useState(!1),[s,v]=d.useState(!1),[p,f]=d.useState(!1),c=y((i=>i.billPaySetupApproverViewState.fetchState)),S=y((i=>i.billPaySetupApproverViewState.approverListState.fetchStatus.fetchState)),g=y((i=>P(i)));X();const r=y((i=>w(i))),h=y((i=>R(i).billPaySetupApproverViewUpdateData));if(d.useEffect((()=>{h?.updateStatus.fetchState==="Completed"&&o(E())}),[h]),d.useEffect((()=>{a||c!=="Not-Started"||e||(n(!0),o(Y(!0,!0,!0)))}),[a,c,e,o]),d.useEffect((()=>{s||S!=="Not-Started"||e||(v(!0),o(ae(!1,!0)))}),[s,S,e,o]),k.getSignedInUser()==null)throw Error("Can't access billpay approval without signing in...");d.useEffect((()=>{r.allApprovalRules.length===0&&r.fetchState==="Completed"&&(p||(f(!0),o(A())),l("./new"))}),[p,r,o]);const b={events:g.companyId!=null?[`private-encrypted-${g.companyId}.${L}`]:[],eventCallback:(i,I,m)=>{i.endsWith(L)&&m.onApprovalRulesEventReceived(i)}};return g?.companyBillPayInfo?.info?.isBillPayTOSAccepted===!1?u.jsx(F,{to:"../../promo"}):u.jsx(de,{currentTenant:g,location:t,navigate:l,isLoading:e,...b})},ye=V((function(e,l){const t=R(e),o=t.billPaySetupApproverViewUpdateData?.type??"approval_create",a=o==="approval_create"&&t.allApprovalRules.length!==0;let n=t.allApprovalRules.length===0;return l.approvalRuleId&&(n=t.allApprovalRules.findIndex((s=>s.approvalRuleId===l.approvalRuleId))===0),{localData:t,hideUpperBoundField:a,isLowerBoundDisabled:n,approvalUpdateActionType:o}}),(function(e,l){const{navigate:t,approvalUpdateDataView:o,approverViewData:a,approvalRuleId:n}=l,s=o.billPaySetupApproverViewUpdateData?.type,v=O(l.location);return{onApprovalRuleDataUpdated:p=>{const f=S=>{const g=[];return S.forEach((r=>{const h=r.actors.selectedUsers.map((I=>({type:"user",userId:I.userId,isImplicitActor:!1}))),b=r.actors.selectedNonUsers.map((I=>{const m=!!re(I.value);return{type:m?"attribute":"role",subType:I.value,userId:void 0,idType:void 0,isImplicitActor:!m}})),i=h.concat(b);g.push({action:r.stepType.selectedOption,actors:i,operator:i.length>1?r.stepType.selectedOption==="require_approval"?"or":"and":"is"})})),g},c={amount:{type:"amount",comparator:"range",min:{amount:p.lowerBound,currencyCode:"USD",currencySymbol:"$"},max:{amount:p.upperBound,currencyCode:"USD",currencySymbol:"$"}}};if(s==="approval_create"){const S={criteria:c,steps:f(p.steps),isApplicableOnPendingApprovalEntity:p.applyToExistingBills.includes("applyToExistingBills")};e(C(S))}else{const S={approvalRuleId:n,criteria:c,steps:f(p.steps),isApplicableOnPendingApprovalEntity:p.applyToExistingBills.includes("applyToExistingBills")};e(C(S))}},onResetClick:()=>{e(E()),s==="approval_update"||v?t("../"):a.allApprovalRules.length===0&&a.fetchState==="Completed"?t("../../setup"):t("../")},onBackClick:()=>{e(E()),s==="approval_update"||v?t("../"):a.allApprovalRules.length===0&&a.fetchState==="Completed"?t("../../setup"):t("../")},onSaveRuleClick:()=>{e(M(!1))},onSaveRuleSuccess:()=>{t("../")}}}))(se);function Se(){const e=U(),l=B(),t=j(),{approvalRuleId:o}=W(),a=k.getSignedInUser(),n=G(),s=y((c=>R(c))),v=y((c=>w(c))),[p,f]=d.useState(!1);if(d.useEffect((()=>{p||(f(!0),l(K(!0)))})),d.useEffect((()=>{v.fetchState==="Not-Started"&&e(o!=null?"../../":"../")}),[v,o]),a==null)throw Error("Can't access address page without signing in...");return s.approverListFetchStatus.fetchState=="Not-Started"||s.approverListFetchStatus.fetchState==="In-Progress"?u.jsx(Q,{fetchState:s.approverListFetchStatus.fetchState,style:{backgroundColor:n.colors.grey5}}):u.jsx(ye,{navigate:e,approvalUpdateDataView:s,approvalRuleId:o,approverViewData:v,location:t})}const ge=V((function(e,l){const t=R(e),o=t.billPaySetupApproverViewUpdateData?.type??"approval_create",a=[],n={};for(const s of Object.values(e.vendorState.vendorByID))s?.id!=null&&(a.push(s.id),n[s.id]=s.name);return{localData:t,approvalUpdateActionType:o,allVendorIds:a,vendorNamesById:n,editingRuleId:o==="approval_update"?l.approvalRuleId:void 0,allApprovalRulesWithUser:w(e).allApprovalRules}}),(function(e,l){const{navigate:t,approvalUpdateDataView:o,approverViewData:a,approvalRuleId:n}=l,s=o.billPaySetupApproverViewUpdateData?.type,v=O(l.location);return{onApprovalRuleDataUpdated:p=>{const f=i=>{const I=[];return i.forEach((m=>{const N=m.actorKind?.selectedOption,ee=m.selectedRole?.selectedNonUsers??[];let x=[];N==="role"?x=ee.map((T=>({type:"attribute",subType:T.value,userId:void 0,idType:void 0,isImplicitActor:!1}))):N==="specific_person"&&(x=(m.persons?.selectedUsers??[]).map((T=>({type:"user",userId:T.userId,isImplicitActor:!1}))));const $=m.action??"require_approval";I.push({action:$,actors:x,operator:x.length>1?$==="require_approval"?"or":"and":"is"})})),I},c=p.amountCriteria,S=p.vendorCriteria,g=p.departmentCriteria,r={};if(c!=null&&c.comparator.selectedOption!=null){const i=c.comparator.selectedOption;r.amount={type:"amount",comparator:i,min:i==="less_than"?void 0:c.min,max:i==="greater_than"?void 0:c.max}}const h=S?.selection.selectedOptions??[];h.length>0&&(r.vendor={type:"vendor",operator:S?.operator.selectedOption??"is",vendorIds:h});const b=g?.selection.selectedOptions??[];if(b.length>0&&(r.department={type:"department",operator:g?.operator.selectedOption??"is",departmentIds:b}),s==="approval_create"){const i={name:p.name,description:p.description,separationOfDuties:p.separationOfDuties,criteria:r,steps:f(p.steps),isApplicableOnPendingApprovalEntity:p.applyToExistingBills.includes("applyToExistingBills")};e(C(i))}else{const i={approvalRuleId:n,name:p.name,description:p.description,separationOfDuties:p.separationOfDuties,criteria:r,steps:f(p.steps),isApplicableOnPendingApprovalEntity:p.applyToExistingBills.includes("applyToExistingBills")};e(C(i))}},onResetClick:()=>{e(E()),s==="approval_update"||v?t("../"):a.allApprovalRules.length===0&&a.fetchState==="Completed"?t("../../setup"):t("../")},onBackClick:()=>{e(E()),s==="approval_update"||v?t("../"):a.allApprovalRules.length===0&&a.fetchState==="Completed"?t("../../setup"):t("../")},onSaveRuleClick:()=>{e(M(!0))},onSaveRuleSuccess:()=>{t("../")},onEditExistingRule:p=>{e(A(p)),t(s==="approval_update"?`../../${p}/edit`:`../${p}/edit`)}}}))(ne);function H(){const e=y((t=>P(t))),{isApprovalRulesV3Enabled:l}=Z(e?.tenantId);return l?u.jsx(me,{}):u.jsx(Se,{})}function me(){const e=U(),l=B(),t=j(),{approvalRuleId:o}=W(),a=k.getSignedInUser(),n=G(),s=y((c=>R(c))),v=y((c=>w(c))),[p,f]=d.useState(!1);if(X(),d.useEffect((()=>{p||(f(!0),l(K(!1)))})),d.useEffect((()=>{v.fetchState==="Not-Started"&&e(o!=null?"../../":"../")}),[v,o]),a==null)throw Error("Can't access address page without signing in...");return s.approverListFetchStatus.fetchState=="Not-Started"||s.approverListFetchStatus.fetchState==="In-Progress"?u.jsx(Q,{fetchState:s.approverListFetchStatus.fetchState,style:{backgroundColor:n.colors.grey5}}):u.jsx(ge,{navigate:e,approvalUpdateDataView:s,approvalRuleId:o,approverViewData:v,location:t},o??"new")}function De(){return u.jsxs(te,{children:[u.jsx(D,{path:"/",element:u.jsx(ve,{})}),u.jsx(D,{path:"/new",element:u.jsx(H,{})}),u.jsx(D,{path:"/:approvalRuleId/edit",element:u.jsx(H,{})}),u.jsx(D,{path:"*",element:u.jsx(ie,{})})]})}export{De as B};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{j as a}from"./liveblocks-y3zMPGKB.js";import{h as K,u as le,g as Q,i as te,j as k,N as ee,l as X,q as na,n as ia,o as y}from"./core-BwK6FGJd.js";import{fE as Z,Y1 as Ue,bq as kt,S2 as oa,bo as wt,bJ as de,Y2 as Bt,GP as Ct,I0 as Ve,Hm as la,bn as Ae,Y3 as sa,Y4 as ra,c8 as ca,Y5 as da,l_ as xt,Y6 as At,Y7 as Et,IB as _e,H2 as Ce,Y8 as ua,GD as at,Y9 as pa,Mq as ma,GH as ba,GN as Dt,Ya as Se,Yb as Me,I1 as Oe,Yc as ha,Yd as ga,I4 as Ne,Ye as Sa,Ih as ya,Yf as Tt,HN as nt,HS as fa,Yg as Ia,Yh as ce,Yi as jt,Yj as Pt,Yk as Ft,gU as va,H7 as $e,cG as Rt,Yl as ka,gg as wa,Ym as Ba,Yn as Ca,dZ as Vt,dY as $t,Yo as Ye,Yp as xa,Yq as Aa,WC as ze,Yr as Ea,WD as ie,WE as He,Ys as Da,Yt as Ta,Yu as ja,HU as it,HR as Pa,Yv as Fa,Yw as Ra,Yx as Va,HD as $a,Yy as La,Yz as Ga,cu as Lt,d9 as Gt,m9 as Ua,bO as _a,br as Ut,bP as _t,FS as Ma,YA as Oa,Md as Na,Mj as Ya,C2 as za,I2 as Ha,II as Za,mm as ge,YB as Wa,YC as Mt,mQ as qa,mg as Ot,mB as Nt,mA as ot,bE as pe,bN as Ja,YD as Ka,YE as ye,kM as Qa,YF as lt,YG as Xa,kQ as en,l9 as tn,IW as an,YH as nn,mJ as on,IM as ln,YI as st,IQ as sn,IV as rn,IT as cn,IK as dn,YJ as Yt,GY as un,YK as pn,YL as mn,gF as bn,gE as hn,gD as gn,mp as Sn,mH as rt,mS as yn,uS as fn,my as In,IO as vn,kW as kn,mX as wn,YM as Bn,kO as Cn,uJ as xn,YN as An,HJ as En,bK as Dn,bt as Tn,U1 as jn,dc as Pn,db as Fn,cF as Rn,cM as Vn}from"./zeni-epic-state-BugXGzus.js";import{E as ue,z as L,U as fe,as as Ze,O as oe,c as g,bi as We,a7 as se,J as A,a8 as Ee,k as j,bu as $n,a4 as H,av as qe,p as T,a1 as Ie,bv as ct,bw as dt,bx as Ln,az as Gn,af as Un,aS as _n,ab as zt,G as De,ag as Je,by as Mn,ae as Ht,bz as On,aq as Nn,T as Zt,w as Yn,bA as zn,bB as Hn,bC as Zn,bD as Wn,bE as qn,bF as Jn,bG as Kn,bH as Qn,bI as Xn,$ as ei,bJ as ti,br as ai,bK as ni,ai as ii,bL as oi,g as li}from"./index-CavSpTx-.js";import{n as U,S as si}from"./mui-CxIkaR9n.js";import{A as ut}from"./AddressScreen-DbL2JK9V.js";import{g as ne,a as Te,i as Wt,V as Ke,b as Qe,c as ri,v as ci,d as di,A as me,D as be}from"./DomesticWireDetailScreen-Di0HmEb7.js";import{a as f}from"./sentry-Jm7O5sR0.js";import{u as Xe}from"./useAskAiCfoHostNavButtonProps-DQ3F86Nw.js";import{u as qt}from"./useInitialThreadRequest-BRvCrjqu.js";import{u as ui}from"./BusinessVerificationPageScreen-DlH1zL57.js";import xe from"./NotFoundScreen-Duy6T6m3.js";import{D as pi}from"./DrawerScreen-BKD3lmi2.js";import{M as Jt}from"./MobileAppDrawer-Ce8Zx46w.js";import{F as Kt}from"./FeaturePreviewScreen-DFQePQma.js";import{S as je}from"./SetupPagesScreen-Bn2r0Ale.js";import{B as mi}from"./BillPayApprovalRoutes-C0QG7H0A.js";import{F as bi}from"./ScreenRoutes-BLctPWdO.js";import"./recharts-CoAMGh71.js";import"./analytics-BTvt2K3S.js";import"./plaid-CQqwPn97.js";import"./dnd-Cbdx7tVf.js";import"./stripe-cKAAJElX.js";import"./lottie-BQlGSG2c.js";import"./lexical-DRfKJLK3.js";import"./pdf-DGzvSuDl.js";import"./utils-BVIT21dc.js";import"./routePaths-D5zGcGZG.js";import"./InboxNotificationsProvider-ozJWRqdQ.js";import"./useTaskManagerAccess-B9_LRJIF.js";import"./analyticsHelper-sj9huSc9.js";import"./ReimbursementApprovalRuleDetailScreen-CgsllBgS.js";import"./getLocaleForTenant-B-DdN2Lw.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]="9c994475-1ca6-493d-87a1-0c67d4953b7a",e._sentryDebugIdIdentifier="sentry-dbid-9c994475-1ca6-493d-87a1-0c67d4953b7a")}catch{}})();const hi=X((function(e,t){const l=Ue(e,t.billId),n=L.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??""}`;Ae(n)||!l.createdBy?.email?.includes("zeni.ai")||(s="Zeni");let i=!1,d=!1;if(l?.billActivities.length>0){const{isApprovalorRejectBtnVisible:S,isMarkAsPaidBtnVisible:h}=sa(l.billActivities,ra(t.currentTenant),n);i=S,d=h}const p=ca(t.currentTenant?.userRole??[]),m=l.transactionDetails!=null&&da(l.transactionDetails,p,n);return{billDetails:l,isAccountingClassesEnabled:xt(e),createdBy:s,authParams:r,transactionAttachmentEndpoint:`${qe}/transaction_attachment`,signedInUser:n,showBackButton:o,isAdmin:p,isRealTimeApprovalEnabled:t.isRealTimeApprovalEnabled,showApproveRejectBtns:i,showMarkAsPaidButtonToApprover:d,hasZeniAssistAccess:t.hasZeniAssistAccess,analytics:j,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=T(c.state?.pathnameStackToGoBack,c.pathname);r(o,{state:{pathnameStackToGoBack:s}})},redirectToEditableBillScreen:()=>{const o=T(c.state?.pathnameStackToGoBack,c.pathname);r("./edit",{state:{pathnameStackToGoBack:o}})},discardBillDetailsFromLocalStore:()=>{e(Se({}))},deleteBill:o=>{j.trackBillPayDeleteBill(l,o),e(Dt(l))},cancelAndDeleteBill:(o,s)=>{s===!0?j.trackBillPayCancelAndDeleteBill(l,o):j.trackBillPayCancelBill(l),e(ba(l,s))},onSaveRealTimeApprovals:o=>{e(ma(l,"bill_pay",o))},updateEditRealTimeApproverClicked:o=>{e(pa({isEdit:o,entityId:l,entityType:"bill_pay"}))},approveOrRejectBill:o=>{o.type==="approved"?e(at(l,o.type,"")):e(at(l,o.type,o.description??""))},retryOrRefundBill:o=>{o.type==="retry"?e(Ce(l,"retry")):e(Ce(l,"refund"))},onAddNewRule:()=>{r("../../bills/approval-rules")},onAttachmentClick:(o,s)=>{const i=Te(u,o,s),d=T(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=T(c.state?.pathnameStackToGoBack,c.pathname);r("./edit",{state:{pathnameStackToGoBack:o}}),e(ua({billId:t.billId}))},onRefundPaymentClick:()=>{e(Ce(t.billId,"refund"))},saveBillDetails:(o,s,i)=>{o&&e(Et({data:i,billId:l})),e(_e(o?"paid":"pending_approval",o,s,l))},discardOutsideZeniPaymentData:()=>{e(At({billId:l}))}}}))($n);function gi(){const e=K(),t=le(),l=Q(),{billId:n}=te(),c=ue(),r=L.getSignedInUser(),u=fe(),o=k((z=>Z(z))),s=k((z=>Ue(z,n??""))),i=s.transactionDetails?.billPayInfo.stage.code==="draft"&&s.transactionDetails.isDeleted===!1,d=qt(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&&kt(o?.userRole),h=o?.company==null||o.company.featuresActivationInfo?.isBillPayFeatureEnabled&&!S,[b,I]=f.useState(!1),[E,C]=f.useState(!1),[x,_]=f.useState(!1),{useFeatureGate:D,useDynamicConfig:B}=oe(),{isFeatureEnabled:O}=D(g.isShowDeletedBillsFeatureEnabled),{isFeatureEnabled:V}=D(g.isBillPayCommentingEnabled),{isFeatureEnabled:W}=D(g.isBillPayDetectInsufficientFundsEnabled),{configValue:N}=B(We.zeniAssistConfig),v=oa(o),Y=wt(o.userRole),M=h&&de(u?.loggedInUserRoleMap),$=N.user_ids!=null&&r?.userId!=null&&N.user_ids.includes(r?.userId),{isFeatureEnabled:q}=D(g.isInternationalPaymentShaVsOurFeatureEnabled),{isFeatureEnabled:J}=D(g.billPaySetupShowInternationalPaymentByWise);if(f.useEffect((()=>{O&&s.transactionDetails?.isDeleted===!0||o.isZeni===!0&&r?.userEmailDomain==="zeni.ai"&&v===!1?_(!1):_(s.billActivities[0]?.isRealTimeApprovalEnabled&&(Y||M||s.allApprovers.find((z=>z.user.userId===r?.userId))!=null||s.transactionDetails?.lastUpdatedByUserId===r?.userId))}),[s.billActivities[0]?.isRealTimeApprovalEnabled,s.allApprovers,s.transactionDetails?.lastUpdatedByUserId,Y,M,o.isZeni,v,r]),f.useEffect((()=>{n!=null&&t(Bt(n))}),[n]),f.useEffect((()=>{b||s.fetchState=="Completed"||s.fetchState=="In-Progress"||(I(!0),t(Ct(n??"",O,$,!1)))}),[b,s,n,t]),f.useEffect((()=>{E||s.fetchState!="Completed"||s.transactionDetails?.billPayInfo.stage.code=="paid"||(C(!0),t(Ve(!1,O,$,J,n)),s.billActivities[0]?.isRealTimeApprovalEnabled===!0&&t(la()))}),[E,s,n,t,O,$,J]),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(ee,{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(Ee,{analytics:j,onLoad:z=>(G=>{n!=null&&G.trackBillPayBillDetails(n,s.isRecurring)})(z)}),a.jsx(hi,{initialOpenThreadRequest:d??void 0,isShowDeletedBillsEnabled:O,location:l,navigate:e,isBillPayCommentingEnabled:V,isRealTimeApprovalEnabled:x,currentTenant:o,billId:n??"",isInternationalPaymentShaVsOurEnabled:q,hasZeniAssistAccess:$,isDetectInsufficientFundsEnabled:W,isAiCfoAccessEnabled:p,onAskAiCfoClick:m})]})}const Le=De.getLocalizedStrings().spendManagement.billPay.billDetails,pt=De.getLocalizedStrings().common,Si={containerWidth:new zt(100,58)},mt=X((function(e,t){const l=L.getSignedInUser(),n=e.tenantState.currentTenantId,c={userId:l?.userId??"",sessionId:l?.zeniSessionId??"",tenantId:n??""},r=t.showActionButtons,u=r&&t.file==null;return{uploadInvoiceEndPoint:`${Ht.communicationAgentMicroServiceBaseUrl}`,authParams:c,billId:t.billId,file:t.file,showAutofill:t.showAutofill,analytics:j,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=L.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(ya({fetchState:{fetchState:n,error:void 0},billId:t.billId}))},onSkipAutofill:n=>{j?.trackBillPaySkipAutofill(),e(Oe(n))},onDeleteClick:()=>{e(Sa({billId:t.billId})),j?.trackInvoiceActionClick(t.billStage??"","delete",l?.userEmail??"",null)}}}))(_n);function w({appContent:e}){const t=le(),l=K(),{billId:n}=te(),c=Q(),r=c.pathname,u=r.includes("bill/new")||r.includes("/edit"),o=Ie(),s=ue(),i=L.getSignedInUser(),{useFeatureGate:d,useDynamicConfig:p}=oe(),{isFeatureEnabled:m}=d(g.isVendorRecommendationFeatureEnabled),{isFeatureEnabled:S}=d(g.isShowDeletedBillsFeatureEnabled),{isFeatureEnabled:h}=d(g.isDepositAccountsFeatureEnabled),{isFeatureEnabled:b}=d(g.billPaySetupShowInternationalPaymentByWise),{configValue:I}=p(We.zeniAssistConfig),E=I.user_ids!=null&&i?.userId!=null&&I.user_ids.includes(i?.userId),C=k((F=>Z(F)));ui();const[x,_]=f.useState(!1),[D,B]=f.useState(!1),[O,V]=f.useState(!1),[W,N]=f.useState(),v=k((F=>Me(F,m,h,n)));let Y=v.fetchState,M=v.file,$=v.showAutofill;const q=k((F=>Ue(F,n??"")));u===!1&&(Y=q.fetchState,M=q.transactionDetails?.attachments?.[0],$=!1);const J=v.billPayInfo!=null&&v.billPayInfo.stage.code==="pending_approval"?v.billPayInfo.billStatus.code:v.billStage;f.useEffect((()=>{n==null&&t(Oe(!0))}),[n,t]),f.useEffect((()=>{Y==="Not-Started"&&(u&&D?B(!1):!u&&x&&_(!1))}),[n]),f.useEffect((()=>{x||n==null||u||(_(!0),t(Ct(n,S,E,!1)),D||(B(!0),t(Ve(!1,S,E,b,n)))),u&&!D&&(B(!0),t(Ve(!1,S,E,b,n)))}),[x,D,u,n,t,S,E,b]);const z={onOkClick:()=>{if(V(!1),!W)return;const F=M!=null?"replace":"upload";j?.trackInvoiceActionClick(J??"",F,i?.userEmail??"","yes"),t(ga({replaceBillData:!0,billId:n})),t(Ne(W,m,n))},onCancelClick:()=>{if(V(!1),!W)return;const F=M!=null?"replace":"upload";j?.trackInvoiceActionClick(J??"",F,i?.userEmail??"","no"),t(ha({file:W,billId:n}))}},G=f.useCallback((()=>{const F=H(c.state?.pathnameStackToGoBack),ve=F.poppedPathname??ne(C.tenantEmailDomain);t(Se({billId:n})),l(ve,{state:{pathnameStackToGoBack:F.newStack}})}),[c.state,C.tenantEmailDomain,n,t,l]);if(i==null)throw Error("Can't access address page without signing in...");if(Y==="Error"||q.fetchState==="Error")return a.jsx(xe,{});if(Y!="Completed")return n==null&&o!=="small"?a.jsx(ct,{fallback:G,children:a.jsxs(Pe,{windowSize:o,children:[a.jsx(ht,{}),a.jsx(Fe,{}),a.jsx(mt,{backgroundColor:s.colors.grey4,billId:n,file:M,showAutofill:!0,uploadStatus:v.uploadStatus,isVendorRecommendationEnabled:m,attachmentTitle:void 0,setShowConfirmationPopup:V,setPayload:N,showActionButtons:!1,isInitialEdit:!!v.isInitialEdit,billStage:J}),a.jsx(Re,{windowSize:o,children:a.jsx(dt,{isNewBill:!0})})]})}):a.jsxs(Pe,{windowSize:o,children:[o==="small"||$?null:a.jsx(bt,{children:a.jsx(Qt,{onClick:G,"data-testid":"nav-bar-back-click"})}),o!=="small"?a.jsx(Fe,{}):null,a.jsx(Ln,{}),a.jsx(Re,{windowSize:o,children:a.jsx(dt,{isNewBill:n==null})})]});{const F=v.billPayInfo!=null&&v.billPayInfo.stage.code==="pending_approval"?v.billPayInfo.billStatus.code:v.billStage;return a.jsx(ct,{fallback:G,children:a.jsxs(Pe,{windowSize:o,children:[$&&o!=="small"?a.jsx(ht,{}):null,O?a.jsx(Gn,{titleComponent:a.jsx(Bi,{children:Le.overwriteTitle}),descriptionComponent:a.jsx(Ci,{children:Le.overwriteDescription}),primaryButtonText:pt.yes,secondaryButtonText:pt.no,action:z,isEditPopup:!0}):null,o==="small"||$?null:a.jsx(bt,{children:a.jsx(yi,{})}),o!=="small"?a.jsx(Fe,{}):null,a.jsx(mt,{backgroundColor:s.colors.grey4,billId:n,file:M,showAutofill:$,uploadStatus:v.uploadStatus,isVendorRecommendationEnabled:m,attachmentTitle:fi(u,q,v),setShowConfirmationPopup:V,setPayload:N,showActionButtons:Ii(u,v),isInitialEdit:!!v.isInitialEdit,billStage:F}),a.jsx(Re,{windowSize:o,children:e})]})})}}function yi(){const{triggerBack:e}=Mn();return a.jsx(Qt,{onClick:e,"data-testid":"nav-bar-back-click"})}function fi(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(vi,{children:[a.jsx(ki,{children:`${Le.recurringBill.recurringCycle}
|
|
1
|
+
import{j as a}from"./liveblocks-BXyXenK7.js";import{h as K,u as le,g as Q,i as te,j as k,N as ee,l as X,q as na,n as ia,o as y}from"./core-Bl4MLhFi.js";import{fE as Z,Y3 as Ue,bq as kt,S4 as oa,bo as wt,bJ as de,Y4 as Bt,GR as Ct,I2 as Ve,Ho as la,bn as Ae,Y5 as sa,Y6 as ra,c8 as ca,Y7 as da,l_ as xt,Y8 as At,Y9 as Et,ID as _e,H4 as Ce,Ya as ua,GF as at,Yb as pa,Ms as ma,GJ as ba,GP as Dt,Yc as Se,Yd as Me,I3 as Oe,Ye as ha,Yf as ga,I6 as Ne,Yg as Sa,Ij as ya,Yh as Tt,HP as nt,HU as fa,Yi as Ia,Yj as ce,Yk as jt,Yl as Pt,Ym as Ft,gU as va,H9 as $e,cG as Rt,Yn as ka,gg as wa,Yo as Ba,Yp as Ca,dZ as Vt,dY as $t,Yq as Ye,Yr as xa,Ys as Aa,WE as ze,Yt as Ea,WF as ie,WG as He,Yu as Da,Yv as Ta,Yw as ja,HW as it,HT as Pa,Yx as Fa,Yy as Ra,Yz as Va,HF as $a,YA as La,YB as Ga,cu as Lt,d9 as Gt,m9 as Ua,bO as _a,br as Ut,bP as _t,FU as Ma,YC as Oa,Mf as Na,Ml as Ya,C4 as za,I4 as Ha,IK as Za,mm as ge,YD as Wa,YE as Mt,mQ as qa,mg as Ot,mB as Nt,mA as ot,bE as pe,bN as Ja,YF as Ka,YG as ye,kM as Qa,YH as lt,YI as Xa,kQ as en,l9 as tn,IY as an,YJ as nn,mJ as on,IO as ln,YK as st,IS as sn,IX as rn,IV as cn,IM as dn,YL as Yt,G_ as un,YM as pn,YN as mn,gF as bn,gE as hn,gD as gn,mp as Sn,mH as rt,mS as yn,uS as fn,my as In,IQ as vn,kW as kn,mX as wn,YO as Bn,kO as Cn,uJ as xn,YP as An,HL as En,bK as Dn,bt as Tn,U3 as jn,dc as Pn,db as Fn,cF as Rn,cM as Vn}from"./zeni-epic-state-UM7IPCLf.js";import{c as ue,z as L,U as fe,as as Ze,N as oe,d as g,bi as We,a7 as se,H as A,a8 as Ee,k as j,bu as $n,a4 as H,av as qe,p as T,a1 as Ie,bv as ct,bw as dt,bx as Ln,az as Gn,af as Un,aS as _n,ab as zt,G as De,ag as Je,by as Mn,ae as Ht,bz as On,aq as Nn,S as Zt,w as Yn,bA as zn,bB as Hn,bC as Zn,bD as Wn,bE as qn,bF as Jn,bG as Kn,bH as Qn,bI as Xn,E as ei,bJ as ti,br as ai,bK as ni,ai as ii,bL as oi,h as li}from"./index-D_qRPRIi.js";import{n as U,S as si}from"./mui-CyP-P4av.js";import{A as ut}from"./AddressScreen-Cbo3iSD8.js";import{g as ne,a as Te,i as Wt,V as Ke,b as Qe,c as ri,v as ci,d as di,A as me,D as be}from"./DomesticWireDetailScreen-BHofWD_4.js";import{a as f}from"./sentry-D4svnzxK.js";import{u as Xe}from"./useAskAiCfoHostNavButtonProps-DYVVwney.js";import{u as qt}from"./useInitialThreadRequest-R2hAErYY.js";import{u as ui}from"./BusinessVerificationPageScreen-BVXryUGP.js";import xe from"./NotFoundScreen-BHAnIkPW.js";import{D as pi}from"./DrawerScreen-eoSileBw.js";import{M as Jt}from"./MobileAppDrawer-Bm1u6Ken.js";import{F as Kt}from"./FeaturePreviewScreen-BAENITNo.js";import{S as je}from"./SetupPagesScreen-C64hdzmo.js";import{B as mi}from"./BillPayApprovalRoutes-LmedJ5XD.js";import{F as bi}from"./ScreenRoutes-CoBHM0a5.js";import"./recharts-CZKBTuPa.js";import"./analytics-B06OpwA-.js";import"./plaid-C0aCR9wu.js";import"./dnd-CimhpTrK.js";import"./stripe-cKAAJElX.js";import"./lottie-2qUppQdg.js";import"./lexical-BbBoQdpc.js";import"./pdf-BENieWk6.js";import"./utils-Bycom664.js";import"./routePaths-D20OKXnM.js";import"./InboxNotificationsProvider-CMdsyY0A.js";import"./useTaskManagerAccess-Rxke8A9H.js";import"./analyticsHelper-xKlm2_zz.js";import"./ReimbursementApprovalRuleDetailScreen-C95Tlh44.js";import"./getLocaleForTenant-NAFAfy2t.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]="357ae37f-a7fa-42e7-a0ff-fcbface52c15",e._sentryDebugIdIdentifier="sentry-dbid-357ae37f-a7fa-42e7-a0ff-fcbface52c15")}catch{}})();const hi=X((function(e,t){const l=Ue(e,t.billId),n=L.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??""}`;Ae(n)||!l.createdBy?.email?.includes("zeni.ai")||(s="Zeni");let i=!1,d=!1;if(l?.billActivities.length>0){const{isApprovalorRejectBtnVisible:S,isMarkAsPaidBtnVisible:h}=sa(l.billActivities,ra(t.currentTenant),n);i=S,d=h}const p=ca(t.currentTenant?.userRole??[]),m=l.transactionDetails!=null&&da(l.transactionDetails,p,n);return{billDetails:l,isAccountingClassesEnabled:xt(e),createdBy:s,authParams:r,transactionAttachmentEndpoint:`${qe}/transaction_attachment`,signedInUser:n,showBackButton:o,isAdmin:p,isRealTimeApprovalEnabled:t.isRealTimeApprovalEnabled,showApproveRejectBtns:i,showMarkAsPaidButtonToApprover:d,hasZeniAssistAccess:t.hasZeniAssistAccess,analytics:j,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=T(c.state?.pathnameStackToGoBack,c.pathname);r(o,{state:{pathnameStackToGoBack:s}})},redirectToEditableBillScreen:()=>{const o=T(c.state?.pathnameStackToGoBack,c.pathname);r("./edit",{state:{pathnameStackToGoBack:o}})},discardBillDetailsFromLocalStore:()=>{e(Se({}))},deleteBill:o=>{j.trackBillPayDeleteBill(l,o),e(Dt(l))},cancelAndDeleteBill:(o,s)=>{s===!0?j.trackBillPayCancelAndDeleteBill(l,o):j.trackBillPayCancelBill(l),e(ba(l,s))},onSaveRealTimeApprovals:o=>{e(ma(l,"bill_pay",o))},updateEditRealTimeApproverClicked:o=>{e(pa({isEdit:o,entityId:l,entityType:"bill_pay"}))},approveOrRejectBill:o=>{o.type==="approved"?e(at(l,o.type,"")):e(at(l,o.type,o.description??""))},retryOrRefundBill:o=>{o.type==="retry"?e(Ce(l,"retry")):e(Ce(l,"refund"))},onAddNewRule:()=>{r("../../bills/approval-rules")},onAttachmentClick:(o,s)=>{const i=Te(u,o,s),d=T(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=T(c.state?.pathnameStackToGoBack,c.pathname);r("./edit",{state:{pathnameStackToGoBack:o}}),e(ua({billId:t.billId}))},onRefundPaymentClick:()=>{e(Ce(t.billId,"refund"))},saveBillDetails:(o,s,i)=>{o&&e(Et({data:i,billId:l})),e(_e(o?"paid":"pending_approval",o,s,l))},discardOutsideZeniPaymentData:()=>{e(At({billId:l}))}}}))($n);function gi(){const e=K(),t=le(),l=Q(),{billId:n}=te(),c=ue(),r=L.getSignedInUser(),u=fe(),o=k((z=>Z(z))),s=k((z=>Ue(z,n??""))),i=s.transactionDetails?.billPayInfo.stage.code==="draft"&&s.transactionDetails.isDeleted===!1,d=qt(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&&kt(o?.userRole),h=o?.company==null||o.company.featuresActivationInfo?.isBillPayFeatureEnabled&&!S,[b,I]=f.useState(!1),[E,C]=f.useState(!1),[x,_]=f.useState(!1),{useFeatureGate:D,useDynamicConfig:B}=oe(),{isFeatureEnabled:O}=D(g.isShowDeletedBillsFeatureEnabled),{isFeatureEnabled:V}=D(g.isBillPayCommentingEnabled),{isFeatureEnabled:W}=D(g.isBillPayDetectInsufficientFundsEnabled),{configValue:N}=B(We.zeniAssistConfig),v=oa(o),Y=wt(o.userRole),M=h&&de(u?.loggedInUserRoleMap),$=N.user_ids!=null&&r?.userId!=null&&N.user_ids.includes(r?.userId),{isFeatureEnabled:q}=D(g.isInternationalPaymentShaVsOurFeatureEnabled),{isFeatureEnabled:J}=D(g.billPaySetupShowInternationalPaymentByWise);if(f.useEffect((()=>{O&&s.transactionDetails?.isDeleted===!0||o.isZeni===!0&&r?.userEmailDomain==="zeni.ai"&&v===!1?_(!1):_(s.billActivities[0]?.isRealTimeApprovalEnabled&&(Y||M||s.allApprovers.find((z=>z.user.userId===r?.userId))!=null||s.transactionDetails?.lastUpdatedByUserId===r?.userId))}),[s.billActivities[0]?.isRealTimeApprovalEnabled,s.allApprovers,s.transactionDetails?.lastUpdatedByUserId,Y,M,o.isZeni,v,r]),f.useEffect((()=>{n!=null&&t(Bt(n))}),[n]),f.useEffect((()=>{b||s.fetchState=="Completed"||s.fetchState=="In-Progress"||(I(!0),t(Ct(n??"",O,$,!1)))}),[b,s,n,t]),f.useEffect((()=>{E||s.fetchState!="Completed"||s.transactionDetails?.billPayInfo.stage.code=="paid"||(C(!0),t(Ve(!1,O,$,J,n)),s.billActivities[0]?.isRealTimeApprovalEnabled===!0&&t(la()))}),[E,s,n,t,O,$,J]),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(ee,{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(Ee,{analytics:j,onLoad:z=>(G=>{n!=null&&G.trackBillPayBillDetails(n,s.isRecurring)})(z)}),a.jsx(hi,{initialOpenThreadRequest:d??void 0,isShowDeletedBillsEnabled:O,location:l,navigate:e,isBillPayCommentingEnabled:V,isRealTimeApprovalEnabled:x,currentTenant:o,billId:n??"",isInternationalPaymentShaVsOurEnabled:q,hasZeniAssistAccess:$,isDetectInsufficientFundsEnabled:W,isAiCfoAccessEnabled:p,onAskAiCfoClick:m})]})}const Le=De.getLocalizedStrings().spendManagement.billPay.billDetails,pt=De.getLocalizedStrings().common,Si={containerWidth:new zt(100,58)},mt=X((function(e,t){const l=L.getSignedInUser(),n=e.tenantState.currentTenantId,c={userId:l?.userId??"",sessionId:l?.zeniSessionId??"",tenantId:n??""},r=t.showActionButtons,u=r&&t.file==null;return{uploadInvoiceEndPoint:`${Ht.communicationAgentMicroServiceBaseUrl}`,authParams:c,billId:t.billId,file:t.file,showAutofill:t.showAutofill,analytics:j,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=L.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(ya({fetchState:{fetchState:n,error:void 0},billId:t.billId}))},onSkipAutofill:n=>{j?.trackBillPaySkipAutofill(),e(Oe(n))},onDeleteClick:()=>{e(Sa({billId:t.billId})),j?.trackInvoiceActionClick(t.billStage??"","delete",l?.userEmail??"",null)}}}))(_n);function w({appContent:e}){const t=le(),l=K(),{billId:n}=te(),c=Q(),r=c.pathname,u=r.includes("bill/new")||r.includes("/edit"),o=Ie(),s=ue(),i=L.getSignedInUser(),{useFeatureGate:d,useDynamicConfig:p}=oe(),{isFeatureEnabled:m}=d(g.isVendorRecommendationFeatureEnabled),{isFeatureEnabled:S}=d(g.isShowDeletedBillsFeatureEnabled),{isFeatureEnabled:h}=d(g.isDepositAccountsFeatureEnabled),{isFeatureEnabled:b}=d(g.billPaySetupShowInternationalPaymentByWise),{configValue:I}=p(We.zeniAssistConfig),E=I.user_ids!=null&&i?.userId!=null&&I.user_ids.includes(i?.userId),C=k((F=>Z(F)));ui();const[x,_]=f.useState(!1),[D,B]=f.useState(!1),[O,V]=f.useState(!1),[W,N]=f.useState(),v=k((F=>Me(F,m,h,n)));let Y=v.fetchState,M=v.file,$=v.showAutofill;const q=k((F=>Ue(F,n??"")));u===!1&&(Y=q.fetchState,M=q.transactionDetails?.attachments?.[0],$=!1);const J=v.billPayInfo!=null&&v.billPayInfo.stage.code==="pending_approval"?v.billPayInfo.billStatus.code:v.billStage;f.useEffect((()=>{n==null&&t(Oe(!0))}),[n,t]),f.useEffect((()=>{Y==="Not-Started"&&(u&&D?B(!1):!u&&x&&_(!1))}),[n]),f.useEffect((()=>{x||n==null||u||(_(!0),t(Ct(n,S,E,!1)),D||(B(!0),t(Ve(!1,S,E,b,n)))),u&&!D&&(B(!0),t(Ve(!1,S,E,b,n)))}),[x,D,u,n,t,S,E,b]);const z={onOkClick:()=>{if(V(!1),!W)return;const F=M!=null?"replace":"upload";j?.trackInvoiceActionClick(J??"",F,i?.userEmail??"","yes"),t(ga({replaceBillData:!0,billId:n})),t(Ne(W,m,n))},onCancelClick:()=>{if(V(!1),!W)return;const F=M!=null?"replace":"upload";j?.trackInvoiceActionClick(J??"",F,i?.userEmail??"","no"),t(ha({file:W,billId:n}))}},G=f.useCallback((()=>{const F=H(c.state?.pathnameStackToGoBack),ve=F.poppedPathname??ne(C.tenantEmailDomain);t(Se({billId:n})),l(ve,{state:{pathnameStackToGoBack:F.newStack}})}),[c.state,C.tenantEmailDomain,n,t,l]);if(i==null)throw Error("Can't access address page without signing in...");if(Y==="Error"||q.fetchState==="Error")return a.jsx(xe,{});if(Y!="Completed")return n==null&&o!=="small"?a.jsx(ct,{fallback:G,children:a.jsxs(Pe,{windowSize:o,children:[a.jsx(ht,{}),a.jsx(Fe,{}),a.jsx(mt,{backgroundColor:s.colors.grey4,billId:n,file:M,showAutofill:!0,uploadStatus:v.uploadStatus,isVendorRecommendationEnabled:m,attachmentTitle:void 0,setShowConfirmationPopup:V,setPayload:N,showActionButtons:!1,isInitialEdit:!!v.isInitialEdit,billStage:J}),a.jsx(Re,{windowSize:o,children:a.jsx(dt,{isNewBill:!0})})]})}):a.jsxs(Pe,{windowSize:o,children:[o==="small"||$?null:a.jsx(bt,{children:a.jsx(Qt,{onClick:G,"data-testid":"nav-bar-back-click"})}),o!=="small"?a.jsx(Fe,{}):null,a.jsx(Ln,{}),a.jsx(Re,{windowSize:o,children:a.jsx(dt,{isNewBill:n==null})})]});{const F=v.billPayInfo!=null&&v.billPayInfo.stage.code==="pending_approval"?v.billPayInfo.billStatus.code:v.billStage;return a.jsx(ct,{fallback:G,children:a.jsxs(Pe,{windowSize:o,children:[$&&o!=="small"?a.jsx(ht,{}):null,O?a.jsx(Gn,{titleComponent:a.jsx(Bi,{children:Le.overwriteTitle}),descriptionComponent:a.jsx(Ci,{children:Le.overwriteDescription}),primaryButtonText:pt.yes,secondaryButtonText:pt.no,action:z,isEditPopup:!0}):null,o==="small"||$?null:a.jsx(bt,{children:a.jsx(yi,{})}),o!=="small"?a.jsx(Fe,{}):null,a.jsx(mt,{backgroundColor:s.colors.grey4,billId:n,file:M,showAutofill:$,uploadStatus:v.uploadStatus,isVendorRecommendationEnabled:m,attachmentTitle:fi(u,q,v),setShowConfirmationPopup:V,setPayload:N,showActionButtons:Ii(u,v),isInitialEdit:!!v.isInitialEdit,billStage:F}),a.jsx(Re,{windowSize:o,children:e})]})})}}function yi(){const{triggerBack:e}=Mn();return a.jsx(Qt,{onClick:e,"data-testid":"nav-bar-back-click"})}function fi(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(vi,{children:[a.jsx(ki,{children:`${Le.recurringBill.recurringCycle}
|
|
2
2
|
${n}/${c}`}),a.jsx(wi,{})]}):void 0}function Ii(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 bt=U.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-D4svnzxK.js";import{u as Y,j as h,h as ne,g as se,i as oe,N as ie,l as re}from"./core-Bl4MLhFi.js";import{fE as z,Hr as ce,YX as ue,Bv as de,S7 as pe,HF as le,KQ as me,ND as fe,Oh as ye,P6 as Se,YY as ge,YZ as Ie,Y_ as be,Y$ as he,Z0 as Te,Vb as De,Y1 as Oe,Vq as Ce,LU as ke,Vr as Ve,LY as Ae,mG as we,gF as Ne,gE as Fe,gD as _e,uS as ve,uJ as Ee,uG as xe,my as Be,BE as ze,BC as U,bE as P,BQ as L,cE as Ue}from"./zeni-epic-state-UM7IPCLf.js";import{bS as Pe,U as Le,N as Re,bi as Me,z as B,a8 as je,k as R,o as E,S as x,bU as Ge,ae as Ye,p as M,aG as j}from"./index-D_qRPRIi.js";import{n as Ze}from"./mui-CyP-P4av.js";import{j as k}from"./liveblocks-BXyXenK7.js";import{d as G}from"./routePaths-D20OKXnM.js";import{M as qe}from"./MobileAppDrawer-Bm1u6Ken.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]="7207c929-e813-4d99-b8b9-cc5d3654abad",t._sentryDebugIdIdentifier="sentry-dbid-7207c929-e813-4d99-b8b9-cc5d3654abad")}catch{}})();function nt(){const t=Y(),u=h((r=>z(r))),n=u?.tenantId,{isApprovalRulesV3Enabled:i,isLoading:d}=Pe(n),p=h((r=>r.billPaySetupApproverViewState.fetchState));V.useEffect((()=>{n==null||d||p==="Not-Started"&&t(ce(!0,!0,i))}),[n,d,i,p,t])}const $e=Ze.div`
|
|
2
2
|
display: flex;
|
|
3
3
|
min-height: 100%;
|
|
4
4
|
width: 100%;
|
|
@@ -6,4 +6,4 @@ import{a as V}from"./sentry-Jm7O5sR0.js";import{u as Y,j as h,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
|
-
`,
|
|
9
|
+
`,He=re((function(t,u){const{businessVerificationDetails:n}=u,i=z(t),d=B.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:`${Ye.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:A,stateOfIncorporation:w,sourceOfFunds:N,companySubIndustry:F,countriesOfOperations:b,companySourceOfFunds:Z,companySourceOfFundsDescription:q,transactionVolume:$,transactionVolumeDescription:H,purposeOfAccount:Q,purposeOfAccountDescription:J,regulatedStatus:K,regulatedStatusDescription:W,usNexus:X,usNexusTypes:ee}=e,_=O?.selectedOption,te={companyId:n,companyDescription:s,companyIndustry:m.selectedOption,companyIndustryType:_==null||_===""?void 0:_,companyLegalName:C,taxIdOrEIN:g,website:y!=""&&y!=null?Ue(y):void 0,phone:I,syncToken:S,fileIds:a,incDate:f!=null?P(f?.toString()):f,typeOfIncorporation:A?.selectedOption??"",stateOfIncorporation:w?.selectedOption??"",sourceOfFunds:N?.selectedOption??"",companySubIndustry:F?.selectedOption??"",countriesOfOperations:b?.selectedOptions.map((v=>v.length===2?v:j(v)))??[],companySourceOfFunds:Z?.selectedOption??"",companySourceOfFundsDescription:q,transactionVolume:$?.selectedOption??"",transactionVolumeDescription:H,purposeOfAccount:Q?.selectedOption??"",purposeOfAccountDescription:J,regulatedStatus:K??"",regulatedStatusDescription:W,usNexus:X,usNexusTypes:ee?.selectedOptions??[]},ae={userId:l,firstName:o.firstName,lastName:o.lastName,email:c,syncToken:D};t(L({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:A,userVerificationStatus:w,treasuryUserVerificationStatus:N,fileIds:F}=m;let b;return S.selectDocumentType==="driverLicense"?b="driving_license":S.selectDocumentType==="passport"?b="passport":S.selectDocumentType==="stateId"?b="id_document":S.selectDocumentType==="ssnCard"&&(b="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?P(o?.toString()):o,syncToken:D,titleAtCompany:a.selectedOption,ownershipInCompany:f,documentTypeSelectedForVerification:b,isSelectedForVerification:A,userVerificationStatus:w,treasuryUserVerificationStatus:N,fileIds:F,additionalDocumentTypesRequestedForVerification:[],additionalSubmittedDocumentsForVerificationFileIds:[],areAdditionalDocumentsRequestedForVerification:!1,areAdditionalDocumentsSubmittedForVerification:!1}}));t(L({officers:s}))},onSaveDetailsClick:e=>{t(U(n,e,i))},onSendForVerificationClick:e=>{t(U(n,e,i,!0))},onAddressClick:e=>{const s=G(T,e),m=M(r.state?.pathnameStackToGoBack,r.pathname);p(s,{state:{pathnameStackToGoBack:m}})},onRegisteredAddressClick:e=>{const s=G(T,e),m=M(r.state?.pathnameStackToGoBack,r.pathname);p(s,{state:{pathnameStackToGoBack:m}})},onBackClick:()=>{t(ze({companyId:n})),p("../setup")},updateFilesEntity:e=>{t(Be({files:e}))},onDeleteFile:e=>{t(xe(e))},onDeleteFileList:e=>{t(Ee(e))},onEditFileName:(e,s)=>{t(ve(e,s.split(".")[0]))},onGetOtp:e=>{t(_e(e,"SpendManagementSetup"))},onResendOtp:e=>{t(Fe(e,"SpendManagementSetup"))},onVerifyOtp:(e,s)=>{t(Ne(e,s,"SpendManagementSetup"))},saveNewAddressInLocalStore:(e,s)=>{t(we({addressType:e,addressToCreate:s}))},onIdentityDocumentUploadedForAutofill:e=>{if(n==null)return;const s=Ve(e.documentType);s!=null&&t(Ae({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}))}}}))(Ge),st=({productType:t})=>{const u=ne(),n=se(),i=Y(),[d,p]=V.useState(!1),[r,T]=V.useState(!1),{tenantEmailDomain:e}=oe(),s=Le(),{useDynamicConfig:m}=Re(),{configValue:O}=m(Me.zeniAccountsConfig),C=ue(O),g=h((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=h((a=>a.companyConfigState.fetchState)),I=h((a=>a.userRoleConfigState.fetchState)),c=h((a=>z(a))),o=c.companyId??B.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]),B.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=h((a=>{switch(t){case"zeni_accounts":return Te(a,o);case"zeni_treasury":return he(a,o);case"charge_cards":return be(a,o);case"reimbursement":return Ie(a,o);default:return ge(a,o)}}));return l===!1?k.jsx(ie,{to:"../promo"}):k.jsxs($e,{children:[k.jsx(je,{analytics:R,onLoad:a=>(f=>{switch(t){case"zeni_accounts":return f.trackPageLoaded(x.Event.zeniAccountsBusinessVerification);case"reimbursement":case"charge_cards":return f.trackPageLoaded(x.Event.reimbursementBusinessVerification);default:return f.trackPageLoaded(x.Event.billPayBusinessVerification,E(n)?"Settings":void 0)}})(a)}),E(n)?k.jsx(qe,{isAppContentDrawerOpen:r,handleDrawerToggle:D}):null,k.jsx(He,{businessVerificationDetails:S,navigate:u,location:n,companyId:o,analytics:R,currentTenant:c,productType:t,isSettings:E(n),roleMap:s?.loggedInUserRoleMap??{},onClickMenuIcon:()=>{D(!0)},maxInsuredAmount:C.maxInsuredAmount})]})};export{st as B,nt as u};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{j as
|
|
1
|
+
import{j as g}from"./liveblocks-BXyXenK7.js";import{a as l}from"./sentry-D4svnzxK.js";import{u as pe,h as he,g as Ce,j as M,i as fe,l as Se}from"./core-Bl4MLhFi.js";import{a as ge,e8 as be,z as ye,ea as Pe,ec as N,ed as Ie,bn as W,a8 as we,k as D,ee as H,eo as Ee,G as ke,S as xe,w as Ae,eh as Te,ei as Ue,av as _e,el as ve,em as Oe,bk as Qe,en as Fe}from"./index-D_qRPRIi.js";import{gJ as De,fD as G,fE as $e,g7 as je,jg as Le,jc as Ve,fF as z,gt as Re,gn as qe,gp as B,gv as Me,gw as He,gx as ze,gy as Be,gz as Ne}from"./zeni-epic-state-UM7IPCLf.js";import{D as We,n as j,P as Ge,S as Je}from"./mui-CyP-P4av.js";import"./recharts-CZKBTuPa.js";import"./analytics-B06OpwA-.js";import"./plaid-C0aCR9wu.js";import"./dnd-CimhpTrK.js";import"./stripe-cKAAJElX.js";import"./lottie-2qUppQdg.js";import"./lexical-BbBoQdpc.js";import"./pdf-BENieWk6.js";import"./utils-Bycom664.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]="3b67e4ee-2648-4160-8661-6a59f7314d4f",e._sentryDebugIdIdentifier="sentry-dbid-3b67e4ee-2648-4160-8661-6a59f7314d4f")}catch{}})();const J="chat-response-generated",Y="cards/ask",K="card_policy_hero";function $(e){return`/${e}/cards`}function X(e){return`/${e}/cards/policy`}const Ye=Se((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:ve(),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:A,isCardPolicyEnabled:T,cardPolicyPageContext:U}=a,i=c.tenantEmailDomain,C=o.state?.referrer,p=C===K?X(i):$(i);return{onEventReceived:(n,t)=>{if(n===J&&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"?D.trackAICFOChatResponseGenerated(f,u?.question.questionText??"",s.text,b,Fe(P,y),s.metadata.message_id??null):D.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(qe()),m((function(n){return`/${n}/${Y}`})(i),{state:{...o.state}})},onToggleCotCollapsed:(n,t)=>{e(Re({questionAnswerId:n,isCollapsed:t}))},...Oe(e,{isAiCardCreationEnabled:A,isCardPolicyEnabled:T,currentChatSessionId:h,onAfterCardsCreationSubmit:()=>{a.setIsAiCfoOpen(!0),m($(i),{state:{...o.state}})},onAfterCardPolicySubmit:()=>{a.setIsAiCfoOpen(!0),m(`/${i}/cards/policy`,{state:{...o.state}})}})}}))(Ae(Te)),{spendManagement:{chargeCard:{cardsAiCfoHero:Z,cardPolicyAiCfoHero:ee}}}=ke.getLocalizedStrings(),x=Z.pageTitle,Ke=ee.pageTitle,Xe=Z.chatHeaderSubtitle,Ze=ee.chatHeaderSubtitle,gt=({isFileUploadEnabled:e})=>{const{setIsAiCfoOpen:a}=ge(),o=pe(),c=he(),d=Ce(),[m,h]=l.useState(!1),{allUsers:E,isAiCardCreationEnabled:A,isCardPolicyEnabled:T,onCardPolicyVendorSearchTextChange:U}=be();l.useEffect((()=>{o(De())}),[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,I=y?.referrer===K,te=I?"card_policy":void 0,se=l.useMemo((()=>({title:I?Ke:x,subtitle:I?Ze:Xe})),[I]),[ae,_]=l.useState(null),[oe,v]=l.useState(!1),O=l.useRef(!1);l.useEffect((()=>{O.current||u==null||u===""||(_(u),v(P),O.current=!0)}),[u,P]);const ne=l.useCallback((()=>{_(null),v(!1),c(d.pathname,{replace:!0,state:N(d.state)})}),[d.pathname,d.state,c]),ie=n.masterTOSInfo,S=ie?.isMasterTOSAccepted??!1,k=l.useRef(null);l.useEffect((()=>{if(S&&k.current!=null){const{question:r,shouldSubmit:w}=k.current;k.current=null,_(r),v(w),O.current=!1}}),[S]);const{visitedSessions:L}=Ie(t),Q=i.fetchState,F=i.uiState.chatSessionsNextPageToken.hasMore||!i.uiState.chatSessionsFirstPageFetched,V=t!=null?i.fetchChatSessionHistoryByChatSessionId?.[t]?.fetchState??"Not-Started":"Not-Started",R=t==null||(i.uiState.chatHistoryNextPageToken[t]?.hasMore??!0),q=i.allSessionsWithOrderedQuestionAnswers,{currentSessionQuestionAnswers:re}=W(q,t),le=re.length===0;l.useEffect((()=>{t!=null&&p!==t&&c((function(r,w){return`/${r}/${Y}/${w}`})(s,t),{state:{...d.state},replace:!0})}),[t,p,s,c,d.state]),l.useEffect((()=>{p!=null&&t==null&&p!=="new_chat"&&o(je({sessionId:p,agentId:"controller"}))}),[]);const de=l.useMemo((()=>({events:L.map((r=>`private-encrypted-chat-${r}.${J}`)),eventCallback:(r,w,me)=>me.onEventReceived(r,w)})),[L]);if(l.useEffect((()=>{Q!=="In-Progress"&&F&&o(Le())}),[Q,F,o]),l.useEffect((()=>{t!=null&&V!=="In-Progress"&&R&&C!=null&&Q==="Completed"&&!F&&o(Ve(t,C.userId))}),[V,R,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 g.jsxs(tt,{children:[g.jsx(we,{analytics:D,onLoad:r=>r.trackPageLoaded(xe.Event.aiCFOPage)}),S?g.jsx(Ye,{...de,currentChatSessionId:t,allSessionsWithOrderedQuestionAnswers:q,allUsers:E,isAiCardCreationEnabled:A,isCardPolicyEnabled:T,openOnboardingPage:()=>h(!0),userId:C.userId,setIsAiCfoOpen:a,navigate:c,sessionFromUrl:ce,location:d,isSubmitting:ue,isEmptyChatWithSession:le,customPageTitle:x,chatHeader:se,currentTenant:n,emailLinkQuestion:ae??void 0,autoSubmitEmailLinkQuestion:oe,onEmailLinkQuestionProcessed:ne,isFileUploadEnabled:e,isUploadPromoVisible:b,onUploadPromoClose:f,onCardPolicyVendorSearchTextChange:U,cardPolicyPageContext:te}):g.jsx(H,{isTOSAccepted:S,acceptMasterTOSState:i.masterTOSAcceptanceState,customPageTitle:x,onCloseClick:()=>{c(I?X(s):$(s),{state:{...d.state}})},onCompleteClick:()=>{S||n.userRoleId==null||(u!=null&&u!==""&&(k.current={question:u,shouldSubmit:P}),o(z(n.userRoleId)))}}),g.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:g.jsx(et,{onClick:r=>r.stopPropagation(),children:g.jsx(H,{isTOSAccepted:S,acceptMasterTOSState:i.masterTOSAcceptanceState,customPageTitle:x,onCloseClick:()=>h(!1),onCompleteClick:()=>{S||n.userRoleId==null||o(z(n.userRoleId)),h(!1)}})})})]})},et=j(Je)`
|
|
2
2
|
display: flex;
|
|
3
3
|
min-height: 100%;
|
|
4
4
|
flex-direction: column;
|
|
@@ -11,4 +11,4 @@ import{j as S}from"./liveblocks-y3zMPGKB.js";import{a as l}from"./sentry-Jm7O5sR
|
|
|
11
11
|
`,st=j(Ge)`
|
|
12
12
|
box-shadow: ${({theme:e})=>e.colors.elevation2};
|
|
13
13
|
color: ${({theme:e})=>e.colors.grey4};
|
|
14
|
-
`;export{
|
|
14
|
+
`;export{gt as default};
|