@zeniai/web-app-ui 5.4.0-qa → 5.4.1-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-BHZEG6ns.js → AccountMappingScreen-BdtNjCBI.js} +1 -1
- package/dist/assets/{ActualMatchingMatchDetailScreen-BciFIvNN.js → ActualMatchingMatchDetailScreen-DgD9-vsh.js} +1 -1
- package/dist/assets/AddressRoutes-DK5Vvq-X.js +1 -0
- package/dist/assets/{AddressScreen-D05tHWjw.js → AddressScreen-C7sDNd06.js} +1 -1
- package/dist/assets/{AiCfoScreen-B3AHaBQv.js → AiCfoScreen-CCkwAPqN.js} +4 -4
- package/dist/assets/{AppDrawer-Dgvbq7R7.js → AppDrawer-CWQ1asO3.js} +1 -1
- package/dist/assets/{BillPayApprovalRoutes-DYDdepPi.js → BillPayApprovalRoutes-C0ruzPoZ.js} +1 -1
- package/dist/assets/{BillPayRoutes-CerKH4Je.js → BillPayRoutes-CV9mDJiA.js} +8 -8
- package/dist/assets/{BusinessVerificationPageScreen-DziO6Y6W.js → BusinessVerificationPageScreen-CPavKmhf.js} +2 -2
- package/dist/assets/{CardsAiCfoScreen-Y9nUChY-.js → CardsAiCfoScreen-DszL1fJa.js} +1 -1
- package/dist/assets/{ChargeCardRoutes-B6m-WAIt.js → ChargeCardRoutes-DJMJStiR.js} +1 -1
- package/dist/assets/{CompanyPassportScreen-CfviW0SD.js → CompanyPassportScreen-CIGUDZ1Q.js} +1 -1
- package/dist/assets/{ConnectionAuthScreen-CmipgAEW.js → ConnectionAuthScreen-BbmNog_4.js} +2 -2
- package/dist/assets/CustomerOnboardingAuthScreen-C_JF03U2.js +1 -0
- package/dist/assets/{CustomerOnboardingRoutes-ZrWU71lI.js → CustomerOnboardingRoutes-DO2-x5Dx.js} +3 -3
- package/dist/assets/{DashboardRoutes-D2u3BFds.js → DashboardRoutes-CDHfwzF8.js} +3 -3
- package/dist/assets/{DefaultTenantHome-B5zBbTiK.js → DefaultTenantHome-IpUFcj-v.js} +1 -1
- package/dist/assets/{DomesticWireDetailScreen-NRVfuSCD.js → DomesticWireDetailScreen-Citgr--D.js} +3 -3
- package/dist/assets/{DrawerScreen-4tj6oHqG.js → DrawerScreen-CRNbz1gn.js} +1 -1
- package/dist/assets/{EntityDetailRoutes-C9vWwrzo.js → EntityDetailRoutes-z2LJmKvw.js} +1 -1
- package/dist/assets/ExpenseAutomationRoutes-CSdM2SYG.js +38 -0
- package/dist/assets/FeaturePreviewScreen-Jnj2USgZ.js +1 -0
- package/dist/assets/{HubSpotOAuthCallbackScreen-LleH2hOw.js → HubSpotOAuthCallbackScreen-CvAgMLyP.js} +1 -1
- package/dist/assets/{InboxNotificationsProvider-BtoJ02lN.js → InboxNotificationsProvider-TM2N59sT.js} +1 -1
- package/dist/assets/{InvoicingRoutes-CLRCZdC2.js → InvoicingRoutes-DsiW7avo.js} +1 -1
- package/dist/assets/{MagicLinkRoutes-TXgYshv6.js → MagicLinkRoutes-CoB6xZJH.js} +8 -8
- package/dist/assets/MagicLinkSignInScreen-D3x0Vkxy.js +12 -0
- package/dist/assets/{MobileAppDrawer-DDyJ1dKI.js → MobileAppDrawer-DVEpwTSb.js} +1 -1
- package/dist/assets/NotFoundScreen-CgHV3hZC.js +1 -0
- package/dist/assets/{NotificationRoutes-DsYgUlEP.js → NotificationRoutes-BgRe6yDH.js} +1 -1
- package/dist/assets/{OAuthConsentScreen-Bh0pW1OB.js → OAuthConsentScreen-BlWg9xpv.js} +1 -1
- package/dist/assets/{PandLWithForecastRoutes-Cwx31YVn.js → PandLWithForecastRoutes-DCylgwyr.js} +1 -1
- package/dist/assets/{PaymentLinkScreen-D7E4blOi.js → PaymentLinkScreen-zJNZOLxG.js} +4 -4
- package/dist/assets/{PeopleRoutes-BPRtxbgy.js → PeopleRoutes-BTMtvnWM.js} +3 -3
- package/dist/assets/PerformanceRoutes-DDd1pzav.js +1 -0
- package/dist/assets/{Preview-DRH5kKjM.js → Preview-DdNlHcw7.js} +1 -1
- package/dist/assets/{QBOConnectionScreen-CUdqTZno.js → QBOConnectionScreen-B8my3HK2.js} +1 -1
- package/dist/assets/{ReimbursementApprovalRoutes-9_o8dSDt.js → ReimbursementApprovalRoutes-DbHjrDG1.js} +1 -1
- package/dist/assets/ReimbursementApprovalRuleDetailScreen-BOO5QQZQ.js +1 -0
- package/dist/assets/{ReimbursementRoutes-BgcjwNq2.js → ReimbursementRoutes-CIvtHgV3.js} +4 -4
- package/dist/assets/{ReportsRoutes-BruyuqGe.js → ReportsRoutes-CqTVhtIe.js} +1 -1
- package/dist/assets/{RewardsRoutes-DS1psEiZ.js → RewardsRoutes-CdxGa5FH.js} +1 -1
- package/dist/assets/{ScheduleDetailsPrepaidExpensesScreen-DAi6A6on.js → ScheduleDetailsPrepaidExpensesScreen-DPJPIIjz.js} +1 -1
- package/dist/assets/ScreenRoutes-BW0Nfg5n.js +2 -0
- package/dist/assets/{SettingsRoutes-C1-HDzWF.js → SettingsRoutes-BZ6-ok7C.js} +1 -1
- package/dist/assets/{SetupPagesScreen-B0utjOUd.js → SetupPagesScreen-CWaKuALw.js} +1 -1
- package/dist/assets/{SignInScreen-CDoF91Yu.js → SignInScreen-C6Coynvq.js} +1 -1
- package/dist/assets/{SignOutScreen-Cu6LoFmz.js → SignOutScreen-5ap7jROI.js} +1 -1
- package/dist/assets/{TaskListScreen-4YGOn7cl.js → TaskListScreen-Tr5pYH2M.js} +2 -2
- package/dist/assets/{TaskRoutes-D0uA5ieh.js → TaskRoutes-DD87OV_2.js} +2 -2
- package/dist/assets/TransactionDetailRoutes-C2tJZ49c.js +1 -0
- package/dist/assets/{TransactionDetailScreen-BoMK5OlK.js → TransactionDetailScreen-DGgQpMc5.js} +1 -1
- package/dist/assets/{TransactionListRoutes-BFSW41Xi.js → TransactionListRoutes-BfRuV8RM.js} +1 -1
- package/dist/assets/{TreasuryRoutes-mFbcF_z1.js → TreasuryRoutes-CCh_KTDj.js} +1 -1
- package/dist/assets/{VendorsRoutes-Dvra9uf-.js → VendorsRoutes-DjYMshEP.js} +1 -1
- package/dist/assets/{WiseConfirmationScreen-BXriYUI0.js → WiseConfirmationScreen-DfNXRsaU.js} +1 -1
- package/dist/assets/{ZeniAccountRoutes-BOc1xcYg.js → ZeniAccountRoutes-CKgCFBgo.js} +9 -9
- package/dist/assets/{ZeniAccountStatementScreen-DLrNUYlL.js → ZeniAccountStatementScreen-BhXX83Ao.js} +1 -1
- package/dist/assets/{accountMappingHelper-DIK6ipdq.js → accountMappingHelper-DpK2x2pO.js} +1 -1
- package/dist/assets/{analytics-C1w-0aDX.js → analytics-CvDaD8K9.js} +1 -1
- package/dist/assets/{analyticsHelper-B8WYQP7y.js → analyticsHelper-VdIlZC-X.js} +1 -1
- package/dist/assets/{core-DQmS6IoY.js → core-BEvMNwAD.js} +1 -1
- package/dist/assets/{decodeURIComponentSafe-CW6B5n7w.js → decodeURIComponentSafe-CYLAirQ0.js} +1 -1
- package/dist/assets/{dnd-BkAObQW8.js → dnd-B2-znEgk.js} +1 -1
- package/dist/assets/{empty-Dk8_qsQc.js → empty-MCEjxjzc.js} +1 -1
- package/dist/assets/{empty-BqcDmrkU.js → empty-YxcYKzZr.js} +1 -1
- package/dist/assets/{emptyVideoElement-scIS7v-h.js → emptyVideoElement-B-77FBVY.js} +1 -1
- package/dist/assets/{epic-CH-INQ2b.js → epic-DBYEx4XZ.js} +1 -1
- package/dist/assets/{expenseAutomationHelper-DSEcmXke.js → expenseAutomationHelper-n1rnu5_l.js} +1 -1
- package/dist/assets/{getLocaleForTenant-DAViYN31.js → getLocaleForTenant-GfQpMbrO.js} +1 -1
- package/dist/assets/{index-CT9iHjgk.js → index-B8gVWGQ4.js} +1 -1
- package/dist/assets/{index-B-1gKi6p.js → index-BLeLfbhZ.js} +2 -2
- package/dist/assets/{index-C-lkNrkt.js → index-BNJSTOyr.js} +1 -1
- package/dist/assets/{index-DW-MdAfq.js → index-BRtn7Fg5.js} +1 -1
- package/dist/assets/{index-CZKOIAsv.js → index-Bfnxdwcm.js} +13561 -13542
- package/dist/assets/{index-gxRUPuVr.js → index-Bo2P7yfm.js} +1 -1
- package/dist/assets/{index-ktN_K7CH.js → index-CHQdsKk6.js} +1 -1
- package/dist/assets/{index-Bych-lqD.js → index-CknhGBud.js} +1 -1
- package/dist/assets/{lexical-DDHrbB2s.js → lexical-VH-Dh1bf.js} +1 -1
- package/dist/assets/{liveblocks-ClXFfXis.js → liveblocks-DXMWX-Ft.js} +1 -1
- package/dist/assets/{lottie-Dxiqblcp.js → lottie-CunmMvLM.js} +1 -1
- package/dist/assets/{mui-3IbG8WRT.js → mui-Bueuo6bM.js} +1 -1
- package/dist/assets/{pathToGoBack-BzG2fNwf.js → pathToGoBack-Mm2jhyqa.js} +1 -1
- package/dist/assets/{pdf-CbQClC4y.js → pdf-byaFE2JF.js} +4 -4
- package/dist/assets/{pdf-lib-RrzsEOvg.js → pdf-lib-Dvs_Xgmp.js} +1 -1
- package/dist/assets/{plaid-DHBKfVUI.js → plaid-QK7fwo4O.js} +1 -1
- package/dist/assets/{pusher-Dmr6luFq.js → pusher-C7Bm4ma8.js} +1 -1
- package/dist/assets/{react-D1TGDgR7.js → react-B64enUeQ.js} +1 -1
- package/dist/assets/{react-1RWP7ld6.js → react-Cb2nvCGx.js} +1 -1
- package/dist/assets/{react-B6qQOksS.js → react-D6s1bFFI.js} +1 -1
- package/dist/assets/{react-C0F-_pol.js → react-DIKP2Ov_.js} +1 -1
- package/dist/assets/{react-BNg2N8ca.js → react-DThrm6Ze.js} +1 -1
- package/dist/assets/{react-BGruhT7s.js → react-DaoXpjNM.js} +1 -1
- package/dist/assets/{recharts-DAXcVNlo.js → recharts-DktJiIze.js} +1 -1
- package/dist/assets/{reportTimeframe-DJr-1zgz.js → reportTimeframe-oMu7u5jv.js} +1 -1
- package/dist/assets/{routePaths-KO_SJ4IJ.js → routePaths-D1-5FufF.js} +1 -1
- package/dist/assets/{sentry-Bywn7nUR.js → sentry-B8ZcloT9.js} +1 -1
- package/dist/assets/{stripSplatSuffix-Dk1DHu0d.js → stripSplatSuffix-DqLj2OQc.js} +1 -1
- package/dist/assets/{url-DKd4WT89.js → url-BhMCuX-k.js} +1 -1
- package/dist/assets/{url-DNpBzH31.js → url-BjOfzwJn.js} +1 -1
- package/dist/assets/useActualMatchingMatchDetail-BOoloLk9.js +1 -0
- package/dist/assets/{useAiCfoDashboardSuggestedQuestionsChips-BM0lNnwP.js → useAiCfoDashboardSuggestedQuestionsChips-D10zF3m4.js} +1 -1
- package/dist/assets/useAskAiCfoHostNavButtonProps-CGDjoe-C.js +1 -0
- package/dist/assets/{useChargeCardPusherEvents-DVXNKcS6.js → useChargeCardPusherEvents-BscXbqVG.js} +1 -1
- package/dist/assets/{useDeviceId-YxBfbetZ.js → useDeviceId-TkNUqREt.js} +1 -1
- package/dist/assets/{useEmailConnectResultRefresh-Cq_W3q20.js → useEmailConnectResultRefresh-LdJl4Ytr.js} +1 -1
- package/dist/assets/{useEnsureVendorListLoaded-hsg4Ceo6.js → useEnsureVendorListLoaded-CbpMm19m.js} +1 -1
- package/dist/assets/{useInitialThreadRequest-Dv03Rsaw.js → useInitialThreadRequest-U0N2vfd2.js} +1 -1
- package/dist/assets/{useTaskManagerAccess-CsXMLOyO.js → useTaskManagerAccess-CRuBFsxT.js} +1 -1
- package/dist/assets/{useTaskManagerPusherEvents-Dc_UINNc.js → useTaskManagerPusherEvents-DQJBsAoF.js} +1 -1
- package/dist/assets/{utils-Dt9Z_-ao.js → utils-BVoHYbte.js} +1 -1
- package/dist/assets/{withTransactionSidePanel-DsLNnWcW.js → withTransactionSidePanel-DEhOfD8m.js} +1 -1
- package/dist/assets/{zeni-epic-state-BZdgF4nr.js → zeni-epic-state-D1qILDrP.js} +7 -7
- package/dist/index.html +1 -1
- package/package.json +4 -4
- package/dist/assets/AddressRoutes-CNZseI8S.js +0 -1
- package/dist/assets/CustomerOnboardingAuthScreen-ChrccxDx.js +0 -1
- package/dist/assets/ExpenseAutomationRoutes-KBtAmE5Y.js +0 -38
- package/dist/assets/FeaturePreviewScreen-EXDoNYcc.js +0 -1
- package/dist/assets/MagicLinkSignInScreen-BS3CqSro.js +0 -12
- package/dist/assets/NotFoundScreen-CQU7vngQ.js +0 -1
- package/dist/assets/PerformanceRoutes-DFUwsKj-.js +0 -1
- package/dist/assets/ReimbursementApprovalRuleDetailScreen-D4hv5xCL.js +0 -1
- package/dist/assets/ScreenRoutes-BGPTRmqP.js +0 -2
- package/dist/assets/TransactionDetailRoutes-Cg_OxL6U.js +0 -1
- package/dist/assets/useActualMatchingMatchDetail-CHOtjwIw.js +0 -1
- package/dist/assets/useAskAiCfoHostNavButtonProps-3zB_zIt7.js +0 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{j as B}from"./liveblocks-
|
|
1
|
+
import{j as B}from"./liveblocks-DXMWX-Ft.js";import{a as o}from"./sentry-B8ZcloT9.js";import{h as H,g as K,u as W,j as m,s as q,l as X}from"./core-BEvMNwAD.js";import{ag as Y,c as ee,F as R,z as te,q as G,ah as ne,k as ae,R as ce}from"./index-Bfnxdwcm.js";import{bn as se,fI as oe,gZ as ie,oF as Q,Vu as ue,ic as J,gk as re,ow as le,Vv as de,Vw as pe,uh as ge,m3 as me,ou as Ae,oq as be,oB as fe,ie as Ie,Vx as ye,Vy as Se}from"./zeni-epic-state-D1qILDrP.js";import{n as he}from"./mui-Bueuo6bM.js";import{M as Ee}from"./MobileAppDrawer-DVEpwTSb.js";import{q as $}from"./QBOConnectionScreen-B8my3HK2.js";import{g as h,a as E,m as we}from"./accountMappingHelper-DpK2x2pO.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]="df2cf263-a07b-4f83-8a5b-6b9f382fd532",a._sentryDebugIdIdentifier="sentry-dbid-df2cf263-a07b-4f83-8a5b-6b9f382fd532")}catch{}})();const r="zeni_pending_projects_enable",l={pending:"pending",ready:"ready"},ze=he.div`
|
|
2
2
|
display: flex;
|
|
3
3
|
height: 100%;
|
|
4
4
|
width: 100%;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{j as s}from"./liveblocks-
|
|
1
|
+
import{j as s}from"./liveblocks-DXMWX-Ft.js";import{a as y}from"./sentry-B8ZcloT9.js";import{a2 as A,dP as v}from"./index-Bfnxdwcm.js";import"./mui-Bueuo6bM.js";import{u as F}from"./useActualMatchingMatchDetail-BOoloLk9.js";import R from"./NotFoundScreen-CgHV3hZC.js";import{i as P,h as U,g as w}from"./core-BEvMNwAD.js";import"./zeni-epic-state-D1qILDrP.js";import"./recharts-DktJiIze.js";import"./analytics-CvDaD8K9.js";import"./plaid-QK7fwo4O.js";import"./dnd-B2-znEgk.js";import"./stripe-cKAAJElX.js";import"./lottie-CunmMvLM.js";import"./lexical-VH-Dh1bf.js";import"./pdf-byaFE2JF.js";import"./utils-BVoHYbte.js";import"./stripSplatSuffix-DqLj2OQc.js";import"./decodeURIComponentSafe-CYLAirQ0.js";import"./routePaths-D1-5FufF.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]="d983674b-8653-4e6a-aa34-fb0424b786be",t._sentryDebugIdIdentifier="sentry-dbid-d983674b-8653-4e6a-aa34-fb0424b786be")}catch{}})();function V(){const{matchId:t,tenantEmailDomain:e}=P(),o=U(),n=w(),k=F(t??""),r=y.useCallback((()=>{const b=A(n.state?.pathnameStackToGoBack);o(b.poppedPathname??`/${e??""}/month_end_close_checks/review`,{state:{pathnameStackToGoBack:b.newStack}})}),[n.state,o,e]);if(t==null)return s.jsx(R,{});const{match:i,detailFetchState:a,handleOpenBill:l,handleRefresh:h,handleUndoReversal:d,handleApproveAndReverse:c,handleIgnoreMatchSuggestion:p,lastMatchResults:f,lastUndoResults:g,refreshStatus:m,ignoreStatus:u,matchAndReverseStatus:S,undoReversalStatus:I}=k;return i==null?a.fetchState==="Not-Started"||a.fetchState==="In-Progress"?s.jsx(v,{detailFetchState:a.fetchState,isIgnoreInFlight:u.fetchState==="In-Progress",isApproveInFlight:S.fetchState==="In-Progress",isUndoInFlight:I.fetchState==="In-Progress",refreshStatus:m.fetchState,onNavigateBack:r,onOpenBill:l,onApproveAndReverse:c,onIgnoreMatchSuggestion:p,onRefresh:h,onUndoReversal:d,lastMatchResults:f,lastUndoResults:g}):s.jsx(R,{}):s.jsx(v,{match:i,detailFetchState:a.fetchState,isIgnoreInFlight:u.fetchState==="In-Progress",isApproveInFlight:S.fetchState==="In-Progress",isUndoInFlight:I.fetchState==="In-Progress",refreshStatus:m.fetchState,onNavigateBack:r,onOpenBill:l,onApproveAndReverse:c,onIgnoreMatchSuggestion:p,onRefresh:h,onUndoReversal:d,lastMatchResults:f,lastUndoResults:g})}export{V as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{j as e}from"./liveblocks-DXMWX-Ft.js";import{A as i}from"./AddressScreen-C7sDNd06.js";import s from"./NotFoundScreen-CgHV3hZC.js";import"./sentry-B8ZcloT9.js";import{n as d,o as r}from"./core-BEvMNwAD.js";import"./zeni-epic-state-D1qILDrP.js";import"./recharts-DktJiIze.js";import"./index-Bfnxdwcm.js";import"./mui-Bueuo6bM.js";import"./analytics-CvDaD8K9.js";import"./plaid-QK7fwo4O.js";import"./dnd-B2-znEgk.js";import"./stripe-cKAAJElX.js";import"./lottie-CunmMvLM.js";import"./lexical-VH-Dh1bf.js";import"./pdf-byaFE2JF.js";import"./utils-BVoHYbte.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]="da3bef66-2720-4570-8362-1786283303d9",t._sentryDebugIdIdentifier="sentry-dbid-da3bef66-2720-4570-8362-1786283303d9")}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-DXMWX-Ft.js";import{a as S}from"./sentry-B8ZcloT9.js";import{h as T,u as P,g as j,i as E,j as $,l as B}from"./core-BEvMNwAD.js";import{$ as L,z as M,V as D,a5 as K,a6 as R,k as C,R as m,a1 as W,W as h,a2 as z}from"./index-Bfnxdwcm.js";import{Wa as _,it as F,fI as U,Wb as V,ca as G,Wc as N,mL as O}from"./zeni-epic-state-D1qILDrP.js";import{u as q,n as H}from"./mui-Bueuo6bM.js";import J from"./NotFoundScreen-CgHV3hZC.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]="33b60b70-99ec-4c7b-9a4d-34a97e53b49c",e._sentryDebugIdIdentifier="sentry-dbid-33b60b70-99ec-4c7b-9a4d-34a97e53b49c")}catch{}})();const Q=H.div`
|
|
2
2
|
display: flex;
|
|
3
3
|
height: 100vh;
|
|
4
4
|
width: 100%;
|
|
@@ -1,17 +1,17 @@
|
|
|
1
|
-
import{j as S}from"./liveblocks-ClXFfXis.js";import{a as n}from"./sentry-Bywn7nUR.js";import{u as Dt,h as Lt,i as Bt,g as Ft,j as v,l as Mt}from"./core-DQmS6IoY.js";import{e7 as $t,a as Nt,X as Vt,e8 as Gt,z as qt,$ as Ht,e9 as zt,ea as Wt,eb as Yt,bp as Be,ec as We,ed as Jt,bo as Ye,a2 as ge,a6 as ce,k as $,ee as me,ef as Xt,eg as Zt,as as Kt,R as es,w as ts,eh as ss,ei as ns,at as as,ej as os,ek as is,el as rs,em as ls,p as ds,bk as Fe,en as us}from"./index-CZKOIAsv.js";import{fH as M,gw as R,UT as cs,a3i as ms,a3j as Ss,jQ as hs,a3k as ps,jN as fs,a3l as Se,jt as J,jW as X,jz as Ie,jg as he,je as gs,jY as Is,jI as Je,V0 as Me,gy as N,gN as Cs,U$ as ks,UM as $e,fI as bs,j7 as vs,a3m as Es,gb as Ps,jp as ws,jl as ys,fJ as pe,gi as xs,a3n as Rs,a3o as Ts,a3p as js,gx as Os,gr as Ne,k8 as Ve,gt as Ge,gz as As,a3q as qe,jZ as _s,ji as Qs,jC as Us,jU as He,jF as Ds,gA as Ls,gB as Bs,gC as Fs,gD as Ms}from"./zeni-epic-state-BZdgF4nr.js";import{D as $s,n as V,S as Ns,v as Vs}from"./mui-3IbG8WRT.js";import{u as Gs}from"./useAiCfoDashboardSuggestedQuestionsChips-BM0lNnwP.js";import{p as qs}from"./pathToGoBack-BzG2fNwf.js";import{k as Hs}from"./routePaths-KO_SJ4IJ.js";import{u as zs}from"./useTaskManagerPusherEvents-Dc_UINNc.js";import"./recharts-DAXcVNlo.js";import"./analytics-C1w-0aDX.js";import"./plaid-DHBKfVUI.js";import"./dnd-BkAObQW8.js";import"./stripe-cKAAJElX.js";import"./lottie-Dxiqblcp.js";import"./lexical-DDHrbB2s.js";import"./pdf-CbQClC4y.js";import"./utils-Dt9Z_-ao.js";(function(){try{var t=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},r=new t.Error().stack;r&&(t._sentryDebugIds=t._sentryDebugIds||{},t._sentryDebugIds[r]="9170038d-9cfd-4dc3-b53b-d275cd300ebe",t._sentryDebugIdIdentifier="sentry-dbid-9170038d-9cfd-4dc3-b53b-d275cd300ebe")}catch{}})();const Ws=["claimed","running","succeeded","failed","timeout"],fe=t=>typeof t=="string"&&t!=="",Xe="chat-response-generated";function Ys(t,r){if(r.kind!=="save")return;if(r.fetchState==="In-Progress")return{status:"saving"};if(r.fetchState==="Error")return{status:"failed"};if(r.fetchState!=="Completed")return;const h=R(t).skills.find((s=>s.macroId===r.savedMacroId));return h==null?void 0:{status:"saved",command:h.name}}const Js=Mt((function(t,r){const h=M(t),s=r.isSubmitting,u=h.uiState?.currentChatSessionId,l=u!=null?xs(t.aiCfoState,u):[],i=ns(t,{allUsers:r.allUsers,onCardPolicyVendorSearchTextChange:r.onCardPolicyVendorSearchTextChange}),g=Rs(t),p=Ts(t),f=js(t);return{showSampleQuestions:r.sessionFromUrl==="explore"&&h.uiState.currentChatSessionId==null,aiCfoView:h,isSubmitting:s,isNewChatSession:r.sessionFromUrl==="new_chat"||r.sessionFromUrl==="explore",isFullView:!0,tableDownloadEndPoint:`${as}/tableDownload`,exportDownloadEndPoint:rs(),emailLinkQuestion:r.emailLinkQuestion,autoSubmitEmailLinkQuestion:r.autoSubmitEmailLinkQuestion,onEmailLinkQuestionProcessed:r.onEmailLinkQuestionProcessed,routedInitialQuestionSource:r.routedInitialQuestionSource,routedInitialQuestionSuggestionIndex:r.routedInitialQuestionSuggestionIndex,exploreSuggestedPromptQuestions:r.exploreSuggestedPromptQuestions,exploreSuggestedPromptQuestionsLoading:r.exploreSuggestedPromptQuestionsLoading,isFileUploadEnabled:r.isFileUploadEnabled,isUploadPromoVisible:r.isUploadPromoVisible,onUploadPromoClose:r.onUploadPromoClose,skills:R(t).skills,skillSaveState:Ys(t,f),skillsEnabled:R(t).skillsEnabled,skillsList:R(t).skills,skillsListError:R(t).fetchState==="Error",skillsListLoading:R(t).fetchState==="In-Progress",skillsCanPublish:R(t).canPublish,skillSaving:f.fetchState==="In-Progress",skillSaveError:f.fetchState==="Error",skillVersionHistory:g.macroId!=null?{macroId:g.macroId,versions:g.versions,error:g.fetchState==="Error",loading:g.fetchState==="In-Progress"}:void 0,skillRestoreBody:p.macroId!=null&&p.version!=null?{macroId:p.macroId,version:p.version,instructions:p.instructions,error:p.fetchState==="Error",loading:p.fetchState==="In-Progress"}:void 0,skillDetail:X(t).detail,skillDetailError:X(t).fetchState==="Error",skillDetailLoading:X(t).fetchState==="In-Progress",syntheticAnswers:l,resolveSyntheticAnswerCardTile:is(t),resolveSyntheticAnswerPolicyTile:os(t),...i}}),(function(t,r){const{location:h,currentTenant:s,userId:u,navigate:l,currentChatSessionId:i,allSessionsWithOrderedQuestionAnswers:g,isAiCardCreationEnabled:p,isCardPolicyEnabled:f,setIsAiCfoOpen:L}=r,B=s.tenantEmailDomain;return{onEventReceived:(a,o)=>{if(a===Xe&&typeof o.text=="string"&&typeof o.metadata=="object"){const c=o,j=Ls(c.type),E=c.metadata.chat_session_id??null,{currentChatSession:O,currentQuestionAnswer:G,currentQuestionAnswerSummary:A}=Ye(g,E);j!=="answer"?$.trackAICFOChatResponseGenerated(j,G?.question.questionText??"",c.text,E,us(A,O),c.metadata.message_id??null):$.trackAICFOChatAnswerGenerated(c.text,G?.question.questionText??"",(c.follow_up_questions?.length??0)>0,!!c.assumptions,!!c.insights,c.visualization!=null,Bs(c.visualization?.type??"")??null,E,c.summarized_title,c.metadata.message_id??null),t(Fs({chatSessionId:c.metadata.chat_session_id,responseType:j,fetchState:{fetchState:"Completed",error:void 0}})),t(Ms({chatSessionId:c.metadata.chat_session_id,answerPayload:c,userId:u}))}},onSubmit:(a,o,c,j,E)=>{a&&Fe(t,a,o,i,g,u,j,c,void 0,E)},onFetchSkills:()=>{t(Je())},onOpenSkill:a=>{t(Ie({macroId:a})),t(Ds({macroId:a}))},onSaveSkill:(a,o)=>{t(He({draft:a,macroId:o}))},onSaveSkillDraft:a=>{const o=a.displayName?.trim()??"",c=a.name?.trim()??"";t(He({draft:{name:o.length>0?o:c,description:a.description?.trim()??null,instructions:a.instructions,visibility:"private"}}))},onFetchSkillVersionBody:(a,o)=>{t(Us({macroId:a,version:o}))},onDeleteSkill:a=>{t(Qs({macroId:a}))},onSetSkillVisibility:(a,o)=>{t(_s({macroId:a,visibility:o}))},onCloseSkillDetail:()=>{t(qe())},onRunSkill:(a,o)=>{t(N()),t(Ne()),Fe(t,o,"user_input",void 0,g,u,void 0,void 0,void 0,a),t(qe())},updateCurrentInput:a=>{t(Ge(a))},onStopSubmit:()=>{},onUpdateScrollYOffset:a=>{t(As(a))},onSelectSampleQuestion:()=>{},onBackClick:()=>{l(-1)},onCloseClick:()=>{const a=ge(h.state?.pathnameStackToGoBack),o=a.poppedPathname??qs(1);l(o,{state:{...h.state,pathnameStackToGoBack:a.newStack}}),t(Ge(""))},togglePageView:()=>{const a=ge(h.state?.pathnameStackToGoBack),o=a.poppedPathname??`/${s.tenantEmailDomain}/dashboard`;l(o,{state:{...We(h.state),pathnameStackToGoBack:a.newStack,message:"open_ai_cfo_drawer"}}),L(!0)},onCopy:()=>{},onThumbsUp:(a,o)=>{i!=null&&o?.messageId!=null&&t(Ve(i,o.messageId,"positive",o.questionText,o.answerText))},onThumbsDown:(a,o)=>{i!=null&&o?.messageId!=null&&t(Ve(i,o.messageId,"negative",o.questionText,o.answerText))},onTogglePageView:()=>{l(-1)},onNewChatClick:()=>{t(N()),i!=null&&t(Ne());const a=ds(h.state?.pathnameStackToGoBack,h.pathname);l(`/${s.tenantEmailDomain}/ai-cfo/new_chat`,{state:{pathnameStackToGoBack:a.slice(0,-1),referrer:"Sidebar"}})},onToggleCotCollapsed:(a,o)=>{t(Os({questionAnswerId:a,isCollapsed:o}))},onMenuClick:r.onMenuClick,...ls(t,{isAiCardCreationEnabled:p,isCardPolicyEnabled:f,currentChatSessionId:i,onAfterCardsCreationSubmit:()=>{L(!0),l(`/${B}/cards`,{state:{...h.state}})},onAfterCardPolicySubmit:()=>{L(!0),l(`/${B}/cards/policy`,{state:{...h.state}})}})}}))(ts(ss)),bn=({isFileUploadEnabled:t})=>{const r=$t(),{setIsAiCfoOpen:h}=Nt(),s=Dt(),u=Lt(),{session_id:l}=Bt(),i=Ft(),g=new URLSearchParams(i.search).get("routine")??void 0,[p,f]=n.useState(!1),L=v((e=>M(e).uiState.isSkillsBrowserOpen===!0)),B=v((e=>R(e).skillsEnabled)),a=v((e=>M(e).uiState.isRoutinesBrowserOpen===!0)),o=v((e=>cs(e))),c=v((e=>ms(e))),j=v((e=>Ss(e))),[E,O]=n.useState(void 0),[G,A]=n.useState(!1),[Ze,Ce]=n.useState(void 0),Ke=n.useCallback((()=>{Ce(void 0),O(void 0),A(!0)}),[]),et=n.useCallback((e=>{O(e),A(!0)}),[]),tt=n.useCallback((()=>{O(void 0),A(!1)}),[]),st=n.useCallback((e=>{s(hs({draft:e,...E!=null&&{scheduleId:E.scheduleId}})),O(void 0),A(!1)}),[s,E]),P=g,ke=o.routines.find((e=>e.scheduleId===P)),C=v((e=>ps(e))),nt=n.useCallback((e=>{s(fs({scheduleId:e.scheduleId}))}),[s]);n.useEffect((()=>{s(P!=null?J({scheduleId:P}):Se())}),[s,P]);const F=ke?.macroId,at=v((e=>X(e))),be=F!=null&&F!==""&&at.fetchState==="Not-Started";n.useEffect((()=>{be&&F!=null&&s(Ie({macroId:F}))}),[s,be,F]);const ot=v((e=>M(e).uiState.currentChatSessionId))??l,k=o.routines.find((e=>e.scheduleId===g))??o.routines.find((e=>e.scheduleId===Vt(ot))),T=k?.scheduleId??null,[ve,it]=n.useState(!0);n.useEffect((()=>{T!=null&&s(J({scheduleId:T}))}),[s,T]);const Ee=C.runs.some((e=>e.status==="claimed"||e.status==="running"))===!0;n.useEffect((()=>{if(P==null||Ee!==!0)return;const e=window.setInterval((()=>{s(J({scheduleId:P})),s(he())}),5e3);return()=>window.clearInterval(e)}),[s,Ee,P]);const rt=n.useCallback((e=>{Ce(e),O(void 0),A(!0)}),[]),lt=n.useCallback((e=>{s(gs({scheduleId:e.scheduleId}))}),[s]),dt=n.useCallback(((e,m)=>{s(Is({enabled:m,scheduleId:e.scheduleId}))}),[s]);n.useEffect((()=>{a&&s(he())}),[s,a]);const Pe=v((e=>R(e).skills)),Z=n.useMemo((()=>Pe.map((e=>({macroId:e.macroId,name:e.displayName??e.name})))),[Pe]),ut=n.useCallback((e=>{s(Ie({macroId:e}))}),[s]),K=n.useCallback((()=>{s(Je()),s(Me())}),[s]),ct=n.useCallback((()=>{s(N())}),[s]),{allUsers:mt,isAiCardCreationEnabled:St,isCardPolicyEnabled:ht,onCardPolicyVendorSearchTextChange:pt}=Gt();n.useEffect((()=>{s(Cs())}),[s]);const I=v((e=>M(e))),y=qt.getSignedInUser();n.useEffect((()=>l==="routines"?(s(N()),void s(ks())):l==="skills"?(s(Se()),s($e()),void s(Me())):(T==null&&s(Se()),s($e()),void s(N()))),[s,T,g,l]);const ft=Ht(),_=Kt(ft),b=v((e=>bs(e))),d=I.uiState.currentChatSessionId,w=b.tenantEmailDomain,D=w!=null&&w!=="",ee=n.useCallback((e=>{D&&u(`/${w}/ai-cfo/routines?routine=${encodeURIComponent(e.scheduleId)}`)}),[D,u,w]),te=n.useCallback((()=>{D&&u(`/${w}/ai-cfo/routines`)}),[D,u,w]),se=n.useCallback(((e,m)=>{const Q=e.sessionId??C.sessionId;Q!=null&&D&&u(`/${w}/ai-cfo/${Q}?routine=${encodeURIComponent(m)}`)}),[D,u,C.sessionId,w]),gt=n.useMemo((()=>k==null?void 0:{error:C.fetchState==="Error",kind:"routineRuns",loading:C.fetchState==="In-Progress"||C.fetchState==="Not-Started",routineName:k.name,schedule:zt(k),skillName:k.isAdHoc===!0?void 0:Z.find((e=>e.macroId===k.macroId))?.name,onOpenSkill:k.isAdHoc===!0?void 0:K,runs:C.runs,tzName:k.tzName,unreadCount:k.unreadRuns,open:ve,onToggle:()=>it((e=>!e)),onOpenRun:e=>se(e,k.scheduleId),onOpenRoutine:()=>ee(k),onOpenRoutines:te}),[K,te,ee,se,ve,k,C.fetchState,C.runs,Z]),{handleUploadPromoClose:It,isUploadPromoVisible:Ct}=Wt({isFileUploadEnabled:t,tenantEmailDomain:w}),ne=Yt({currentTenant:b,currentChatSessionId:d,aiCfoView:I,skillsEnabled:B,onCloseSkills:ct,onOpenSkills:K}),{isSuggestedQuestionsLoading:kt,suggestedPromptQuestions:bt}=Gs(),q=i.state,H=q?.aiCfoInitialQuestion,we=!!q?.aiCfoShouldSubmit;n.useEffect((()=>{const e=i.state;if(e?.[Be]!==!0)return;f(!0);const m={...e};delete m[Be],u(i,{replace:!0,state:m})}),[i.pathname,i.search,i.state,u]);const[vt,ae]=n.useState(null),[Et,oe]=n.useState(!1),[Pt,ie]=n.useState(void 0),[wt,re]=n.useState(void 0),ye=n.useRef(!1);n.useEffect((()=>{if(!ye.current&&H!=null&&H!==""){const e=i.state;ae(H),oe(we),ie(e?.aiCfoInitialSubmissionSource!=null?e.aiCfoInitialSubmissionSource:void 0);const m=e?.aiCfoSuggestionIndex;re(typeof m=="number"?m:void 0),ye.current=!0}}),[H,we,i.state]);const yt=n.useCallback((()=>{ae(null),oe(!1),ie(void 0),re(void 0),u(i.pathname,{replace:!0,state:We(i.state)})}),[i.pathname,i.state,u]),xe=n.useMemo((()=>new URLSearchParams(i.search)),[i.search]),Re=xe.get("ref")??q?.aiCfoRef,le=xe.get("emailRefId")??q?.aiCfoEmailRefId,Te=n.useRef(!1);n.useEffect((()=>{Te.current||Re!=="month-end-email"||le==null||d!=null||y==null||(s(vs("controller",y.userId,le,"MONTH_END_EMAIL")),Te.current=!0)}),[Re,le,d,s,y]);const z=I.uiState.lastContextMessage;n.useEffect((()=>{z!=null&&z!==""&&d!=null&&(ae(z),oe(!0),ie(void 0),re(void 0),s(Es()))}),[z,d,s]);const xt=b.masterTOSInfo,x=xt?.isMasterTOSAccepted??!1,{visitedSessions:je}=Jt(d),W=I.fetchState,Y=I.uiState.chatSessionsNextPageToken.hasMore||!I.uiState.chatSessionsFirstPageFetched,Oe=d!=null?I.fetchChatSessionHistoryByChatSessionId?.[d]?.fetchState??"Not-Started":"Not-Started",Ae=d==null||(I.uiState.chatHistoryNextPageToken[d]?.hasMore??!0),_e=I.allSessionsWithOrderedQuestionAnswers,{currentSessionQuestionAnswers:Rt}=Ye(_e,d),Tt=Rt.length===0;n.useEffect((()=>{x||_||u("../dashboard",{state:{...i.state,message:"open_ai_cfo_drawer"}})}),[x,_,u,i.state]);const jt=n.useCallback((()=>{const e=ge(i.state?.pathnameStackToGoBack),m=b.tenantEmailDomain;u(e.poppedPathname??(m!=null?`/${m}/dashboard`:".."),{state:{...i.state,pathnameStackToGoBack:e.newStack}})}),[b.tenantEmailDomain,i.state,u]),Qe=n.useRef(void 0),Ue=n.useRef(void 0);n.useEffect((()=>{const e=l!==Qe.current,m=d!==Ue.current;Qe.current=l,Ue.current=d,l!==d&&(!e||l==null||Hs(l)?m&&d!=null&&u(`../ai-cfo/${d}`,{state:{...i.state}}):s(Ps({sessionId:l,agentId:"controller"})))}),[d,l]);const Ot=n.useMemo((()=>({events:je.map((e=>`private-encrypted-chat-${e}.${Xe}`)),eventCallback:(e,m,Q)=>Q.onEventReceived(e,m)})),[je]);n.useEffect((()=>{W!=="In-Progress"&&Y&&s(ws())}),[W,Y,s]),n.useEffect((()=>{d!=null&&Oe!=="In-Progress"&&Ae&&y!=null&&(l===d||W==="Completed"&&!Y)&&s(ys(d,y.userId))}),[Oe,W,Ae,Y,d,y,l,s]);const de=y?.userId,At=n.useMemo((()=>{return de==null?[]:[(e=de,`private-encrypted-routines-${e}.routine-run-updated`)];var e}),[de]),De=n.useCallback((e=>{const m=e!=null&&(e===P||e===T);(a||m)&&s(he()),m&&s(J({scheduleId:e}))}),[s,a,T,P]);zs({events:At,onSubscribed:()=>De(P??T),onEvent:(e,m)=>{const Q=(ue=>{if(ue==null||typeof ue!="object")return null;const U=ue;return fe(U.schedule_id)&&fe(U.run_id)?{scheduleId:U.schedule_id,runId:U.run_id,status:Ws.find((Ut=>Ut===U.status))??null,finishedAt:fe(U.finished_at)?U.finished_at:null}:null})(m);Q!=null&&De(Q.scheduleId)}});const Le=e=>e.trackAICFOOnboardingScreenStateChanged("open","first_visit");if(y==null||l==null)throw Error("Can't access AI Controller page without signing in...");const _t=d!=null&&I.responseStateByChatSessionId?.[d]?.answer?.fetchState==="In-Progress";if(!x&&_)return S.jsxs(Zs,{children:[S.jsx(ce,{analytics:$,onLoad:Le}),ne.drawerElement,S.jsx(Ks,{children:S.jsx(ze,{children:S.jsx(me,{isTOSAccepted:!1,acceptMasterTOSState:I.masterTOSAcceptanceState,onCloseClick:jt,onCompleteClick:()=>{b.userRoleId!=null&&s(pe(b.userRoleId))}})})})]});const Qt=S.jsxs(S.Fragment,{children:[p&&!x?S.jsx(ce,{analytics:$,onLoad:Le}):null,S.jsx(me,{isTOSAccepted:x,acceptMasterTOSState:I.masterTOSAcceptanceState,showHeader:!1,togglePageView:x?()=>f(!1):void 0,onCloseClick:()=>f(!1),onCompleteClick:()=>{x||b.userRoleId==null||s(pe(b.userRoleId)),f(!1)}})]});return S.jsxs(S.Fragment,{children:[S.jsxs(Xs,{children:[S.jsx(ce,{analytics:$,onLoad:e=>e.trackPageLoaded(es.Event.aiCFOPage)}),_&&ne.drawerElement,S.jsx(Js,{answerExportEndPoint:r,...Ot,currentChatSessionId:d,allSessionsWithOrderedQuestionAnswers:_e,allUsers:mt,isAiCardCreationEnabled:St,isCardPolicyEnabled:ht,openOnboardingPage:()=>f(!0),userId:y.userId,setIsAiCfoOpen:h,navigate:u,sessionFromUrl:l,location:i,isSubmitting:_t,isEmptyChatWithSession:Tt,currentTenant:b,emailLinkQuestion:vt??void 0,autoSubmitEmailLinkQuestion:Et,onEmailLinkQuestionProcessed:yt,routedInitialQuestionSource:Pt,routedInitialQuestionSuggestionIndex:wt,onCardPolicyVendorSearchTextChange:pt,onMenuClick:_?ne.open:void 0,isFileUploadEnabled:t,isUploadPromoVisible:Ct,onUploadPromoClose:It,exploreSuggestedPromptQuestions:bt,exploreSuggestedPromptQuestionsLoading:kt,isSkillsOpen:L,isRoutinesOpen:a,routineCanCreate:j,routineEditing:E,routineEditorOpen:G,routineListError:o.fetchState==="Error",routineListLoading:o.fetchState==="In-Progress",routineMaxRoutines:o.maxRoutines,routineSaveError:c.fetchState==="Error",routineSaving:c.fetchState==="In-Progress",routineSchedulableSkills:Z,routines:o.routines,onRoutineCreate:Ke,onRoutineDelete:lt,routineHistoryError:C.fetchState==="Error",routineHistoryLoading:C.fetchState==="In-Progress",chatSidePanel:gt,routineDetail:ke,routineRunningScheduleId:c.runningScheduleId,routineRuns:C.runs,onRoutineEdit:et,onRoutineOpenRun:(e,m)=>se(m,e.scheduleId),onRoutineRun:nt,onRoutineCloseDetail:te,onRoutineDraft:rt,routineDraftPrompt:Ze,onRoutineOpenDetail:ee,onRoutineEditorCancel:tt,onRoutineLoadSkillInstructions:ut,onRoutineSave:st,onRoutineSetEnabled:dt,isCreateSkillEnabled:B,promoDismissalScope:w}),p&&_?S.jsx($s,{anchor:"right",open:p,transitionDuration:250,PaperProps:{component:en,style:{width:"100%"}},slotProps:{backdrop:{style:{backgroundColor:"transparent",cursor:"pointer"}}},onClose:()=>f(!1),children:S.jsx(ze,{onClick:e=>e.stopPropagation(),children:S.jsx(me,{isTOSAccepted:x,acceptMasterTOSState:I.masterTOSAcceptanceState,onCloseClick:()=>f(!1),onCompleteClick:()=>{x||b.userRoleId==null||s(pe(b.userRoleId)),f(!1)}})})}):null]}),p&&!_?S.jsx(Xt,{open:p,onClose:()=>f(!1),children:S.jsx(Zt,{children:Qt})}):null]})},ze=V(Ns)`
|
|
1
|
+
import{j as S}from"./liveblocks-DXMWX-Ft.js";import{a as n}from"./sentry-B8ZcloT9.js";import{u as Dt,h as Lt,i as Bt,g as Ft,j as v,l as Mt}from"./core-BEvMNwAD.js";import{e8 as $t,a as Nt,s as Vt,e9 as Gt,z as qt,$ as Ht,ea as zt,eb as Wt,ec as Yt,bp as Be,ed as We,ee as Jt,bo as Ye,a2 as ge,a6 as ce,k as $,ef as me,eg as Zt,eh as Kt,as as Xt,R as es,w as ts,ei as ss,ej as ns,at as as,ek as os,el as is,em as rs,en as ls,p as us,bk as Fe,eo as ds}from"./index-Bfnxdwcm.js";import{fH as M,gw as R,UT as cs,a3j as ms,a3k as Ss,jQ as hs,a3l as ps,jN as fs,a3m as Se,jt as J,jW as Z,jz as Ie,jg as he,je as gs,jY as Is,jI as Je,V0 as Me,gy as N,gN as Cs,U$ as ks,UM as $e,fI as bs,j7 as vs,a3n as Es,gb as Ps,jp as ws,jl as ys,fJ as pe,gi as xs,a3o as Rs,a3p as Ts,a3q as js,gx as Os,gr as Ne,k8 as Ve,gt as Ge,gz as As,a3r as qe,jZ as _s,ji as Qs,jC as Us,jU as He,jF as Ds,gA as Ls,gB as Bs,gC as Fs,gD as Ms}from"./zeni-epic-state-D1qILDrP.js";import{D as $s,n as V,S as Ns,v as Vs}from"./mui-Bueuo6bM.js";import{u as Gs}from"./useAiCfoDashboardSuggestedQuestionsChips-D10zF3m4.js";import{p as qs}from"./pathToGoBack-Mm2jhyqa.js";import{k as Hs}from"./routePaths-D1-5FufF.js";import{u as zs}from"./useTaskManagerPusherEvents-DQJBsAoF.js";import"./recharts-DktJiIze.js";import"./analytics-CvDaD8K9.js";import"./plaid-QK7fwo4O.js";import"./dnd-B2-znEgk.js";import"./stripe-cKAAJElX.js";import"./lottie-CunmMvLM.js";import"./lexical-VH-Dh1bf.js";import"./pdf-byaFE2JF.js";import"./utils-BVoHYbte.js";(function(){try{var t=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},r=new t.Error().stack;r&&(t._sentryDebugIds=t._sentryDebugIds||{},t._sentryDebugIds[r]="94b94169-fc1d-4ae8-9161-a1d69a4e88d5",t._sentryDebugIdIdentifier="sentry-dbid-94b94169-fc1d-4ae8-9161-a1d69a4e88d5")}catch{}})();const Ws=["claimed","running","succeeded","failed","timeout"],fe=t=>typeof t=="string"&&t!=="",Ze="chat-response-generated";function Ys(t,r){if(r.kind!=="save")return;if(r.fetchState==="In-Progress")return{status:"saving"};if(r.fetchState==="Error")return{status:"failed"};if(r.fetchState!=="Completed")return;const h=R(t).skills.find((s=>s.macroId===r.savedMacroId));return h==null?void 0:{status:"saved",command:h.name}}const Js=Mt((function(t,r){const h=M(t),s=r.isSubmitting,d=h.uiState?.currentChatSessionId,l=d!=null?xs(t.aiCfoState,d):[],i=ns(t,{allUsers:r.allUsers,onCardPolicyVendorSearchTextChange:r.onCardPolicyVendorSearchTextChange}),g=Rs(t),p=Ts(t),f=js(t);return{showSampleQuestions:r.sessionFromUrl==="explore"&&h.uiState.currentChatSessionId==null,aiCfoView:h,isSubmitting:s,isNewChatSession:r.sessionFromUrl==="new_chat"||r.sessionFromUrl==="explore",isFullView:!0,tableDownloadEndPoint:`${as}/tableDownload`,exportDownloadEndPoint:rs(),emailLinkQuestion:r.emailLinkQuestion,autoSubmitEmailLinkQuestion:r.autoSubmitEmailLinkQuestion,onEmailLinkQuestionProcessed:r.onEmailLinkQuestionProcessed,routedInitialQuestionSource:r.routedInitialQuestionSource,routedInitialQuestionSuggestionIndex:r.routedInitialQuestionSuggestionIndex,exploreSuggestedPromptQuestions:r.exploreSuggestedPromptQuestions,exploreSuggestedPromptQuestionsLoading:r.exploreSuggestedPromptQuestionsLoading,isFileUploadEnabled:r.isFileUploadEnabled,isUploadPromoVisible:r.isUploadPromoVisible,onUploadPromoClose:r.onUploadPromoClose,skills:R(t).skills,skillSaveState:Ys(t,f),skillsEnabled:R(t).skillsEnabled,skillsList:R(t).skills,skillsListError:R(t).fetchState==="Error",skillsListLoading:R(t).fetchState==="In-Progress",skillsCanPublish:R(t).canPublish,skillSaving:f.fetchState==="In-Progress",skillSaveError:f.fetchState==="Error",skillVersionHistory:g.macroId!=null?{macroId:g.macroId,versions:g.versions,error:g.fetchState==="Error",loading:g.fetchState==="In-Progress"}:void 0,skillRestoreBody:p.macroId!=null&&p.version!=null?{macroId:p.macroId,version:p.version,instructions:p.instructions,error:p.fetchState==="Error",loading:p.fetchState==="In-Progress"}:void 0,skillDetail:Z(t).detail,skillDetailError:Z(t).fetchState==="Error",skillDetailLoading:Z(t).fetchState==="In-Progress",syntheticAnswers:l,resolveSyntheticAnswerCardTile:is(t),resolveSyntheticAnswerPolicyTile:os(t),...i}}),(function(t,r){const{location:h,currentTenant:s,userId:d,navigate:l,currentChatSessionId:i,allSessionsWithOrderedQuestionAnswers:g,isAiCardCreationEnabled:p,isCardPolicyEnabled:f,setIsAiCfoOpen:L}=r,B=s.tenantEmailDomain;return{onEventReceived:(a,o)=>{if(a===Ze&&typeof o.text=="string"&&typeof o.metadata=="object"){const c=o,j=Ls(c.type),E=c.metadata.chat_session_id??null,{currentChatSession:O,currentQuestionAnswer:G,currentQuestionAnswerSummary:A}=Ye(g,E);j!=="answer"?$.trackAICFOChatResponseGenerated(j,G?.question.questionText??"",c.text,E,ds(A,O),c.metadata.message_id??null):$.trackAICFOChatAnswerGenerated(c.text,G?.question.questionText??"",(c.follow_up_questions?.length??0)>0,!!c.assumptions,!!c.insights,c.visualization!=null,Bs(c.visualization?.type??"")??null,E,c.summarized_title,c.metadata.message_id??null),t(Fs({chatSessionId:c.metadata.chat_session_id,responseType:j,fetchState:{fetchState:"Completed",error:void 0}})),t(Ms({chatSessionId:c.metadata.chat_session_id,answerPayload:c,userId:d}))}},onSubmit:(a,o,c,j,E)=>{a&&Fe(t,a,o,i,g,d,j,c,void 0,E)},onFetchSkills:()=>{t(Je())},onOpenSkill:a=>{t(Ie({macroId:a})),t(Ds({macroId:a}))},onSaveSkill:(a,o)=>{t(He({draft:a,macroId:o}))},onSaveSkillDraft:a=>{const o=a.displayName?.trim()??"",c=a.name?.trim()??"";t(He({draft:{name:o.length>0?o:c,description:a.description?.trim()??null,instructions:a.instructions,visibility:"private"}}))},onFetchSkillVersionBody:(a,o)=>{t(Us({macroId:a,version:o}))},onDeleteSkill:a=>{t(Qs({macroId:a}))},onSetSkillVisibility:(a,o)=>{t(_s({macroId:a,visibility:o}))},onCloseSkillDetail:()=>{t(qe())},onRunSkill:(a,o)=>{t(N()),t(Ne()),Fe(t,o,"user_input",void 0,g,d,void 0,void 0,void 0,a),t(qe())},updateCurrentInput:a=>{t(Ge(a))},onStopSubmit:()=>{},onUpdateScrollYOffset:a=>{t(As(a))},onSelectSampleQuestion:()=>{},onBackClick:()=>{l(-1)},onCloseClick:()=>{const a=ge(h.state?.pathnameStackToGoBack),o=a.poppedPathname??qs(1);l(o,{state:{...h.state,pathnameStackToGoBack:a.newStack}}),t(Ge(""))},togglePageView:()=>{const a=ge(h.state?.pathnameStackToGoBack),o=a.poppedPathname??`/${s.tenantEmailDomain}/dashboard`;l(o,{state:{...We(h.state),pathnameStackToGoBack:a.newStack,message:"open_ai_cfo_drawer"}}),L(!0)},onCopy:()=>{},onThumbsUp:(a,o)=>{i!=null&&o?.messageId!=null&&t(Ve(i,o.messageId,"positive",o.questionText,o.answerText))},onThumbsDown:(a,o)=>{i!=null&&o?.messageId!=null&&t(Ve(i,o.messageId,"negative",o.questionText,o.answerText))},onTogglePageView:()=>{l(-1)},onNewChatClick:()=>{t(N()),i!=null&&t(Ne());const a=us(h.state?.pathnameStackToGoBack,h.pathname);l(`/${s.tenantEmailDomain}/ai-cfo/new_chat`,{state:{pathnameStackToGoBack:a.slice(0,-1),referrer:"Sidebar"}})},onToggleCotCollapsed:(a,o)=>{t(Os({questionAnswerId:a,isCollapsed:o}))},onMenuClick:r.onMenuClick,...ls(t,{isAiCardCreationEnabled:p,isCardPolicyEnabled:f,currentChatSessionId:i,onAfterCardsCreationSubmit:()=>{L(!0),l(`/${B}/cards`,{state:{...h.state}})},onAfterCardPolicySubmit:()=>{L(!0),l(`/${B}/cards/policy`,{state:{...h.state}})}})}}))(ts(ss)),bn=({isFileUploadEnabled:t})=>{const r=$t(),{setIsAiCfoOpen:h}=Nt(),s=Dt(),d=Lt(),{session_id:l}=Bt(),i=Ft(),g=new URLSearchParams(i.search).get("routine")??void 0,[p,f]=n.useState(!1),L=v((e=>M(e).uiState.isSkillsBrowserOpen===!0)),B=v((e=>R(e).skillsEnabled)),a=v((e=>M(e).uiState.isRoutinesBrowserOpen===!0)),o=v((e=>cs(e))),c=v((e=>ms(e))),j=v((e=>Ss(e))),[E,O]=n.useState(void 0),[G,A]=n.useState(!1),[Ke,Ce]=n.useState(void 0),Xe=n.useCallback((()=>{Ce(void 0),O(void 0),A(!0)}),[]),et=n.useCallback((e=>{O(e),A(!0)}),[]),tt=n.useCallback((()=>{O(void 0),A(!1)}),[]),st=n.useCallback((e=>{s(hs({draft:e,...E!=null&&{scheduleId:E.scheduleId}})),O(void 0),A(!1)}),[s,E]),P=g,ke=o.routines.find((e=>e.scheduleId===P)),C=v((e=>ps(e))),nt=n.useCallback((e=>{s(fs({scheduleId:e.scheduleId}))}),[s]);n.useEffect((()=>{s(P!=null?J({scheduleId:P}):Se())}),[s,P]);const F=ke?.macroId,at=v((e=>Z(e))),be=F!=null&&F!==""&&at.fetchState==="Not-Started";n.useEffect((()=>{be&&F!=null&&s(Ie({macroId:F}))}),[s,be,F]);const ot=v((e=>M(e).uiState.currentChatSessionId))??l,k=o.routines.find((e=>e.scheduleId===g))??o.routines.find((e=>e.scheduleId===Vt(ot))),T=k?.scheduleId??null,[ve,it]=n.useState(!0);n.useEffect((()=>{T!=null&&s(J({scheduleId:T}))}),[s,T]);const Ee=C.runs.some((e=>e.status==="claimed"||e.status==="running"))===!0;n.useEffect((()=>{if(P==null||Ee!==!0)return;const e=window.setInterval((()=>{s(J({scheduleId:P})),s(he())}),5e3);return()=>window.clearInterval(e)}),[s,Ee,P]);const rt=n.useCallback((e=>{Ce(e),O(void 0),A(!0)}),[]),lt=n.useCallback((e=>{s(gs({scheduleId:e.scheduleId}))}),[s]),ut=n.useCallback(((e,m)=>{s(Is({enabled:m,scheduleId:e.scheduleId}))}),[s]);n.useEffect((()=>{a&&s(he())}),[s,a]);const Pe=v((e=>R(e).skills)),K=n.useMemo((()=>Pe.map((e=>({macroId:e.macroId,name:e.displayName??e.name})))),[Pe]),dt=n.useCallback((e=>{s(Ie({macroId:e}))}),[s]),X=n.useCallback((()=>{s(Je()),s(Me())}),[s]),ct=n.useCallback((()=>{s(N())}),[s]),{allUsers:mt,isAiCardCreationEnabled:St,isCardPolicyEnabled:ht,onCardPolicyVendorSearchTextChange:pt}=Gt();n.useEffect((()=>{s(Cs())}),[s]);const I=v((e=>M(e))),y=qt.getSignedInUser();n.useEffect((()=>l==="routines"?(s(N()),void s(ks())):l==="skills"?(s(Se()),s($e()),void s(Me())):(T==null&&s(Se()),s($e()),void s(N()))),[s,T,g,l]);const ft=Ht(),_=Xt(ft),b=v((e=>bs(e))),u=I.uiState.currentChatSessionId,w=b.tenantEmailDomain,D=w!=null&&w!=="",ee=n.useCallback((e=>{D&&d(`/${w}/ai-cfo/routines?routine=${encodeURIComponent(e.scheduleId)}`)}),[D,d,w]),te=n.useCallback((()=>{D&&d(`/${w}/ai-cfo/routines`)}),[D,d,w]),se=n.useCallback(((e,m)=>{const Q=e.sessionId??C.sessionId;Q!=null&&D&&d(`/${w}/ai-cfo/${Q}?routine=${encodeURIComponent(m)}`)}),[D,d,C.sessionId,w]),gt=n.useMemo((()=>k==null?void 0:{error:C.fetchState==="Error",kind:"routineRuns",loading:C.fetchState==="In-Progress"||C.fetchState==="Not-Started",routineName:k.name,schedule:zt(k),skillName:k.isAdHoc===!0?void 0:K.find((e=>e.macroId===k.macroId))?.name,onOpenSkill:k.isAdHoc===!0?void 0:X,runs:C.runs,tzName:k.tzName,unreadCount:k.unreadRuns,open:ve,onToggle:()=>it((e=>!e)),onOpenRun:e=>se(e,k.scheduleId),onOpenRoutine:()=>ee(k),onOpenRoutines:te}),[X,te,ee,se,ve,k,C.fetchState,C.runs,K]),{handleUploadPromoClose:It,isUploadPromoVisible:Ct}=Wt({isFileUploadEnabled:t,tenantEmailDomain:w}),ne=Yt({currentTenant:b,currentChatSessionId:u,aiCfoView:I,skillsEnabled:B,onCloseSkills:ct,onOpenSkills:X}),{isSuggestedQuestionsLoading:kt,suggestedPromptQuestions:bt}=Gs(),q=i.state,H=q?.aiCfoInitialQuestion,we=!!q?.aiCfoShouldSubmit;n.useEffect((()=>{const e=i.state;if(e?.[Be]!==!0)return;f(!0);const m={...e};delete m[Be],d(i,{replace:!0,state:m})}),[i.pathname,i.search,i.state,d]);const[vt,ae]=n.useState(null),[Et,oe]=n.useState(!1),[Pt,ie]=n.useState(void 0),[wt,re]=n.useState(void 0),ye=n.useRef(!1);n.useEffect((()=>{if(!ye.current&&H!=null&&H!==""){const e=i.state;ae(H),oe(we),ie(e?.aiCfoInitialSubmissionSource!=null?e.aiCfoInitialSubmissionSource:void 0);const m=e?.aiCfoSuggestionIndex;re(typeof m=="number"?m:void 0),ye.current=!0}}),[H,we,i.state]);const yt=n.useCallback((()=>{ae(null),oe(!1),ie(void 0),re(void 0),d(i.pathname,{replace:!0,state:We(i.state)})}),[i.pathname,i.state,d]),xe=n.useMemo((()=>new URLSearchParams(i.search)),[i.search]),Re=xe.get("ref")??q?.aiCfoRef,le=xe.get("emailRefId")??q?.aiCfoEmailRefId,Te=n.useRef(!1);n.useEffect((()=>{Te.current||Re!=="month-end-email"||le==null||u!=null||y==null||(s(vs("controller",y.userId,le,"MONTH_END_EMAIL")),Te.current=!0)}),[Re,le,u,s,y]);const z=I.uiState.lastContextMessage;n.useEffect((()=>{z!=null&&z!==""&&u!=null&&(ae(z),oe(!0),ie(void 0),re(void 0),s(Es()))}),[z,u,s]);const xt=b.masterTOSInfo,x=xt?.isMasterTOSAccepted??!1,{visitedSessions:je}=Jt(u),W=I.fetchState,Y=I.uiState.chatSessionsNextPageToken.hasMore||!I.uiState.chatSessionsFirstPageFetched,Oe=u!=null?I.fetchChatSessionHistoryByChatSessionId?.[u]?.fetchState??"Not-Started":"Not-Started",Ae=u==null||(I.uiState.chatHistoryNextPageToken[u]?.hasMore??!0),_e=I.allSessionsWithOrderedQuestionAnswers,{currentSessionQuestionAnswers:Rt}=Ye(_e,u),Tt=Rt.length===0;n.useEffect((()=>{x||_||d("../dashboard",{state:{...i.state,message:"open_ai_cfo_drawer"}})}),[x,_,d,i.state]);const jt=n.useCallback((()=>{const e=ge(i.state?.pathnameStackToGoBack),m=b.tenantEmailDomain;d(e.poppedPathname??(m!=null?`/${m}/dashboard`:".."),{state:{...i.state,pathnameStackToGoBack:e.newStack}})}),[b.tenantEmailDomain,i.state,d]),Qe=n.useRef(void 0),Ue=n.useRef(void 0);n.useEffect((()=>{const e=l!==Qe.current,m=u!==Ue.current;Qe.current=l,Ue.current=u,l!==u&&(!e||l==null||Hs(l)?m&&u!=null&&d(`../ai-cfo/${u}`,{state:{...i.state}}):s(Ps({sessionId:l,agentId:"controller"})))}),[u,l]);const Ot=n.useMemo((()=>({events:je.map((e=>`private-encrypted-chat-${e}.${Ze}`)),eventCallback:(e,m,Q)=>Q.onEventReceived(e,m)})),[je]);n.useEffect((()=>{W!=="In-Progress"&&Y&&s(ws())}),[W,Y,s]),n.useEffect((()=>{u!=null&&Oe!=="In-Progress"&&Ae&&y!=null&&(l===u||W==="Completed"&&!Y)&&s(ys(u,y.userId))}),[Oe,W,Ae,Y,u,y,l,s]);const ue=y?.userId,At=n.useMemo((()=>{return ue==null?[]:[(e=ue,`private-encrypted-routines-${e}.routine-run-updated`)];var e}),[ue]),De=n.useCallback((e=>{const m=e!=null&&(e===P||e===T);(a||m)&&s(he()),m&&s(J({scheduleId:e}))}),[s,a,T,P]);zs({events:At,onSubscribed:()=>De(P??T),onEvent:(e,m)=>{const Q=(de=>{if(de==null||typeof de!="object")return null;const U=de;return fe(U.schedule_id)&&fe(U.run_id)?{scheduleId:U.schedule_id,runId:U.run_id,status:Ws.find((Ut=>Ut===U.status))??null,finishedAt:fe(U.finished_at)?U.finished_at:null}:null})(m);Q!=null&&De(Q.scheduleId)}});const Le=e=>e.trackAICFOOnboardingScreenStateChanged("open","first_visit");if(y==null||l==null)throw Error("Can't access AI Controller page without signing in...");const _t=u!=null&&I.responseStateByChatSessionId?.[u]?.answer?.fetchState==="In-Progress";if(!x&&_)return S.jsxs(Ks,{children:[S.jsx(ce,{analytics:$,onLoad:Le}),ne.drawerElement,S.jsx(Xs,{children:S.jsx(ze,{children:S.jsx(me,{isTOSAccepted:!1,acceptMasterTOSState:I.masterTOSAcceptanceState,onCloseClick:jt,onCompleteClick:()=>{b.userRoleId!=null&&s(pe(b.userRoleId))}})})})]});const Qt=S.jsxs(S.Fragment,{children:[p&&!x?S.jsx(ce,{analytics:$,onLoad:Le}):null,S.jsx(me,{isTOSAccepted:x,acceptMasterTOSState:I.masterTOSAcceptanceState,showHeader:!1,togglePageView:x?()=>f(!1):void 0,onCloseClick:()=>f(!1),onCompleteClick:()=>{x||b.userRoleId==null||s(pe(b.userRoleId)),f(!1)}})]});return S.jsxs(S.Fragment,{children:[S.jsxs(Zs,{children:[S.jsx(ce,{analytics:$,onLoad:e=>e.trackPageLoaded(es.Event.aiCFOPage)}),_&&ne.drawerElement,S.jsx(Js,{answerExportEndPoint:r,...Ot,currentChatSessionId:u,allSessionsWithOrderedQuestionAnswers:_e,allUsers:mt,isAiCardCreationEnabled:St,isCardPolicyEnabled:ht,openOnboardingPage:()=>f(!0),userId:y.userId,setIsAiCfoOpen:h,navigate:d,sessionFromUrl:l,location:i,isSubmitting:_t,isEmptyChatWithSession:Tt,currentTenant:b,emailLinkQuestion:vt??void 0,autoSubmitEmailLinkQuestion:Et,onEmailLinkQuestionProcessed:yt,routedInitialQuestionSource:Pt,routedInitialQuestionSuggestionIndex:wt,onCardPolicyVendorSearchTextChange:pt,onMenuClick:_?ne.open:void 0,isFileUploadEnabled:t,isUploadPromoVisible:Ct,onUploadPromoClose:It,exploreSuggestedPromptQuestions:bt,exploreSuggestedPromptQuestionsLoading:kt,isSkillsOpen:L,isRoutinesOpen:a,routineCanCreate:j,routineEditing:E,routineEditorOpen:G,routineListError:o.fetchState==="Error",routineListLoading:o.fetchState==="In-Progress",routineMaxRoutines:o.maxRoutines,routineSaveError:c.fetchState==="Error",routineSaving:c.fetchState==="In-Progress",routineSchedulableSkills:K,routines:o.routines,onRoutineCreate:Xe,onRoutineDelete:lt,routineHistoryError:C.fetchState==="Error",routineHistoryLoading:C.fetchState==="In-Progress",chatSidePanel:gt,routineDetail:ke,routineRunningScheduleId:c.runningScheduleId,routineRuns:C.runs,onRoutineEdit:et,onRoutineOpenRun:(e,m)=>se(m,e.scheduleId),onRoutineRun:nt,onRoutineCloseDetail:te,onRoutineDraft:rt,routineDraftPrompt:Ke,onRoutineOpenDetail:ee,onRoutineEditorCancel:tt,onRoutineLoadSkillInstructions:dt,onRoutineSave:st,onRoutineSetEnabled:ut,isCreateSkillEnabled:B,promoDismissalScope:w}),p&&_?S.jsx($s,{anchor:"right",open:p,transitionDuration:250,PaperProps:{component:en,style:{width:"100%"}},slotProps:{backdrop:{style:{backgroundColor:"transparent",cursor:"pointer"}}},onClose:()=>f(!1),children:S.jsx(ze,{onClick:e=>e.stopPropagation(),children:S.jsx(me,{isTOSAccepted:x,acceptMasterTOSState:I.masterTOSAcceptanceState,onCloseClick:()=>f(!1),onCompleteClick:()=>{x||b.userRoleId==null||s(pe(b.userRoleId)),f(!1)}})})}):null]}),p&&!_?S.jsx(Zt,{open:p,onClose:()=>f(!1),children:S.jsx(Kt,{children:Qt})}):null]})},ze=V(Ns)`
|
|
2
2
|
display: flex;
|
|
3
3
|
min-height: 100%;
|
|
4
4
|
flex-direction: column;
|
|
5
|
-
`,
|
|
5
|
+
`,Zs=V.div`
|
|
6
6
|
height: 100vh;
|
|
7
7
|
width: 100%;
|
|
8
|
-
`,
|
|
8
|
+
`,Ks=V.div`
|
|
9
9
|
height: 100vh;
|
|
10
10
|
width: 100%;
|
|
11
11
|
display: flex;
|
|
12
12
|
flex-direction: column;
|
|
13
13
|
min-height: 0;
|
|
14
|
-
`,
|
|
14
|
+
`,Xs=V.div`
|
|
15
15
|
flex: 1;
|
|
16
16
|
min-height: 0;
|
|
17
17
|
display: flex;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{j as d}from"./liveblocks-ClXFfXis.js";import{a as o,R as Ta}from"./sentry-Bywn7nUR.js";import{u as Fe,j as r,g as $a,h as Ba,q as H}from"./core-DQmS6IoY.js";import{fI as Re,UK as xa,UL as Ze,gc as Aa,gy as Q,UM as ee,jI as ye,jg as Te,UN as Da,UO as _a,gS as Ma,q3 as Ua,UP as Fa,UQ as $e,gp as Ra,UR as x,fH as Za,gw as Ga,US as Va,UT as Ha,UU as La,UV as Be,UW as ja,UX as xe,UY as Pa,ED as Na,gq as Oa,h5 as qa,cX as za,UZ as Ya,U_ as Xa,qG as Wa,gb as Ja,ja as Ka,U$ as Qa,V0 as et,wL as at,gr as tt}from"./zeni-epic-state-BZdgF4nr.js";import{w as nt,i as ot,a as st,Q as rt,c as it,F as m,d as lt,u as dt,e as ct,h as ut,f as mt,g as Ct,J as pt,X as ht,j as ft,z as gt,k as L,p as h,m as Ae,l as bt,s as St,n as De,o as kt,q as _e,r as Et,v as wt,x as te,y as ae,A as It,B as vt,C as yt,L as Tt,D as $t,E as Bt,H as xt,I as At}from"./index-CZKOIAsv.js";import{u as Dt,q as _t,r as Mt,I as Ut,p as Me,t as Ft,D as Ue,s as ne}from"./mui-3IbG8WRT.js";import{u as Rt}from"./InboxNotificationsProvider-BtoJ02lN.js";import{u as Zt}from"./useTaskManagerAccess-CsXMLOyO.js";import{u as Gt}from"./expenseAutomationHelper-DSEcmXke.js";import"./recharts-DAXcVNlo.js";import"./analytics-C1w-0aDX.js";import"./plaid-DHBKfVUI.js";import"./dnd-BkAObQW8.js";import"./stripe-cKAAJElX.js";import"./lottie-Dxiqblcp.js";import"./lexical-DDHrbB2s.js";import"./pdf-CbQClC4y.js";import"./utils-Dt9Z_-ao.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]="56f16c37-3f4e-4a9b-8408-defa0c8469d6",a._sentryDebugIdIdentifier="sentry-dbid-56f16c37-3f4e-4a9b-8408-defa0c8469d6")}catch{}})();const A="AppDrawer",c={root:`${A}-root`,drawer:`${A}-drawer`,appBar:`${A}-appBar`,menuButton:`${A}-menuButton`,appBarZenilogo:`${A}-appBarZenilogo`,drawerZenilogo:`${A}-drawerZenilogo`},Vt=ne("div",{slot:"Root"})((({theme:a})=>({[`&.${c.root}`]:{display:"flex"},[`& .${c.drawer}`]:{[a.breakpoints.up("md")]:{width:te,flexShrink:0,backgroundColor:a.colors.background}},[`& .${c.appBar}`]:{color:a.colors.primary,backgroundColor:a.colors.background,boxShadow:"none"},"& .MuiToolbar-root":{backgroundColor:a.colors.background},[`& .${c.menuButton}`]:{marginRight:a.spacing(2),[a.breakpoints.up("md")]:{display:"none"}},[`& .${c.appBarZenilogo}`]:{fill:a.colors.primary,cursor:"pointer",width:"100%",marginLeft:a.spacing(-6)},[`& .${c.drawerZenilogo}`]:{margin:`${a.spacing(3)} ${a.spacing(3)} ${a.spacing(0)}`,fill:a.colors.primary,cursor:"pointer"}}))),Ht=nt((function({tenantEmailDomain:a}){const{isAiCfoOpen:C,setIsAiCfoOpen:S}=st(),[j,D]=Ta.useState(!1),[k,Ge]=o.useState(!1),t=$a(),s=Ba(),oe=Aa(),se=rt(),n=Fe(),[Ve,He]=o.useState(!1),P=Dt(),re=t.pathname.includes("/ai-cfo/");o.useEffect((()=>{re||(n(Q()),n(ee()))}),[n,re]),o.useEffect((()=>{n(Q()),n(ee())}),[n,a]);const{useFeatureGate:u}=it(),{isFeatureEnabled:ie}=u(m.isDebitCardFeatureEnabled),E=lt(),i=r((e=>Re(e))),N=i.masterTOSInfo?.isMasterTOSAccepted??!1,{setLoading:Le}=dt(),w=ct(),{isTaskManagerAccessEnabled:_,isZeniUser:je}=Zt(E),le=ut(),I=mt(),M=(function(e=2e3){const[l,p]=o.useState(!1);return o.useEffect((()=>{if(l)return;const B=window.requestIdleCallback;if(B==null){const K=window.setTimeout((()=>p(!0)),e);return()=>window.clearTimeout(K)}const G=B((()=>p(!0)),{timeout:e});return()=>{window.cancelIdleCallback?.(G)}}),[e,l]),l})();o.useEffect((()=>{M&&I&&w&&(n(ye()),n(Te()))}),[n,M,I,i.tenantId,w]);const[O,Pe]=o.useState(void 0),Ne=!!i.company?.companyZeniAccountInfo?.isZeniAccountEnabled,{isFeatureEnabled:Oe}=u(m.isChargeCardFeatureEnabled),qe=Ct(i,Oe,ie),{isFeatureEnabled:ze}=u(m.isSettingsFeatureEnabled),{isFeatureEnabled:U}=u(m.isReferralFeatureEnabled),Ye=i.companyTreasuryInfo?.info?.businessVerificationStatus?.code==="verified",de=r((e=>Da(e)));o.useEffect((()=>{const e=()=>{He(window.scrollY>10)};return window.addEventListener("scroll",e),()=>{window.removeEventListener("scroll",e)}}),[]);const q=r((e=>_a(e))),f=r((e=>e.expenseAutomationViewState.selectedPeriodByTenantId)),g=r((e=>Ma(e))),{monthEndCloseChecksView:v}=g,Xe=H("/signout")!==null,F=H("/:tenantEmailDomain/dashboard")!==null,ce=H("/:tenantEmailDomain/reports")!==null,b=H("/:tenantEmailDomain/onboarding/*")!==null,ue=Gt();o.useEffect((()=>{M&&I&&U&&!b&&q.fetchState==="Not-Started"&&n(Ua(!0))}),[M,I,U,q.fetchState,b]),o.useEffect((()=>{if(ue){const e=t.state?.origin;if(e!=null){const l=Fa(e);l!=null&&n($e(l))}}}),[ue,t.state]);const We=Xe||b,z=r((e=>e.tenantState)),Je=r((e=>z.fetchState==="Completed"?Ra(e):[])),{isFeatureEnabled:Ke}=u(m.isApAgingFeatureEnabled),{isFeatureEnabled:Qe}=u(m.isArAgingFeatureEnabled),{isFeatureEnabled:ea}=u(m.isDashboardSidebarHalloweenAnimationEnabled),{isFeatureEnabled:aa}=u(m.isDashboardSidebarThanksGivingAnimationEnabled),{isFeatureEnabled:ta}=u(m.isDashboardSidebarChristmasAnimationEnabled),{isFeatureEnabled:na}=u(m.isDashboardSidebarNewYearAnimationEnabled),oa=r((e=>x(e).totalUnreadCount)),sa=r((e=>x(e).notificationDetailsByTab.tasks.uiState.unreadCount)),ra=r((e=>x(e).notificationDetailsByTab.comments.uiState.unreadCount)),ia=r((e=>x(e).reducedFetchCountState)),me=r((e=>x(e).notificationDetailsByTab.tasks.fetchCountState)),Y=r((e=>Za(e))),la=r((e=>Ga(e).skillsEnabled)),da=r((e=>Va(e))),Ce=r((e=>Ha(e).routines)),ca=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]),ua=new URLSearchParams(t.search).get("routine")??ht(t.pathname.split("/ai-cfo/")[1])??void 0,ma=o.useCallback(((e,l)=>{s(l!=null&&l!==""?`/${a}/ai-cfo/${encodeURIComponent(l)}`:`/${a}/ai-cfo/routines?routine=${encodeURIComponent(e)}`)}),[s,a]),{status:pe}=r(La),[y,X]=o.useState(void 0),W=Y.uiState.currentChatSessionId,R=y!=null?Y.deleteChatSessionStateByChatSessionId[y]?.fetchState:void 0,he=ft(R),{inboxNotifications:J,isLoading:fe,isFetchingMore:ge,hasFetchedAll:be,fetchMore:Ca}=Rt(),Z=r((e=>x(e).notificationDetailsByTab.comments.fetchCountState));o.useEffect((()=>{const e=setTimeout((()=>Ca?.()),0);return()=>clearTimeout(e)})),o.useEffect((()=>{if(y!=null)return he==="In-Progress"&&R==="Completed"?(n(Be({chatSessionId:y})),X(void 0),void s(`/${a}/ai-cfo/explore`,{state:{...t.state,referrer:"Sidebar"}})):void(R==="Error"&&(n(Be({chatSessionId:y})),X(void 0)))}),[n,t.state,s,R,y,he,a]),o.useEffect((()=>{if(fe===!1&&ge===!1&&be===!0&&i?.companyId!=null&&J!=null){const e=`dashboard_${i.companyId}`;Pe(J.filter((l=>l.roomId===e&&l.readAt==null)).length)}}),[fe,ge,be,i?.companyId,J]),o.useEffect((()=>{I&&_&&!b&&me.fetchState==="Not-Started"&&oe.tenantId!=null&&n(ja("task_manager","dashboard"))}),[I,_,b,me.fetchState,oe.tenantId,n]),o.useEffect((()=>{b||Z.fetchState!=="Not-Started"||n(xe({fetchCountState:{fetchState:"In-Progress",error:void 0}},"comments"))}),[b,Z.fetchState,n]),o.useEffect((()=>{if(O!=null){const{fetchState:e}=Z;e!=="In-Progress"&&e!=="Completed"||(e==="In-Progress"&&n(xe({fetchCountState:{fetchState:"Completed",error:void 0}},"comments")),n(Ze({unreadCount:O},"comments")))}}),[O,Z.fetchState]);const pa={fetchStatus:ia,count:oa},T=[];Ke===!1&&T.push("accounts_payable_aging"),Qe===!1&&T.push("accounts_receivable_aging"),T.push("zeni_accounts_promo_card","treasury_promo_card"),U===!1&&T.push("rewards_card"),le===!1&&T.push("expense_automation_card");const Se=r((e=>Pa(e,T).fetchState)),ke=r((e=>Na(e).fetchState)),Ee=a!=null?gt.getSignedInUserTenant(a):null,we=r((e=>Ee?.tenantId!=null?Oa(e,Ee.tenantId):void 0)),ha=F&&(Se==="Completed"||Se==="Error")||ce&&(ke==="Completed"||ke==="Error")||!F&&!ce?void 0:"disabled",fa=o.useMemo((()=>qa(i.userRole)),[i.userRole]),ga=za(fa),$=e=>{D(e)},ba=Ye,Sa=i?.rewardsLastViewedTime==null,ka=E?.userEmail!=null&&de.fetchState==="Completed"&&Ya(de.notificationSettings,E.userEmail,ie,i,_),Ea=o.useCallback((e=>{const l=t.state?.referrer;if(v.monthEndCloseChecks?.auditSummary!=null&&L.trackMonthCloseAuditPage(e.month,e.year,v.monthEndCloseChecks.reportEmailSentDate!=null?"closed":"in-review",v.monthEndCloseChecks.auditSummary.auditScorePercentage,!1,l??null),n(Xa(i.tenantId,e)),f[i.tenantId]!=null){const p=h(t.state?.pathnameStackToGoBack,t.pathname);s(`/${a}/month_end_close_checks/review/${g.currentSelectedView}/${e.month}-${e.year}`,{state:{pathnameStackToGoBack:p,referrer:g.currentSelectedView}})}n($e(g.currentSelectedView)),g.reconciliation.selectedAccountId!=null&&n(Wa({selectedAccountId:void 0}))}),[g.reconciliation.selectedAccountId,g.currentSelectedView,i.tenantId,v.monthEndCloseChecks?.auditSummary,v.monthEndCloseChecks?.reportEmailSentDate,f,a,t.state,t.pathname]),wa=o.useMemo((()=>({zIndex:k?12:Ae[2]})),[k]),Ia=w&&bt(t),Ie=d.jsx(St,{signedInUser:E,currentTenantId:z.currentTenantId??"",tenants:z.fetchState==="Completed"?Je:we!=null?[we]:[],rewardsConfiguration:{isRewardsTabVisible:U,isRewardsAnimated:Sa,rewardsPlan:q.rewardsPlan},selectedMenu:C===!0?_e("ai_cfo"):De(t)&&pe!=="completed"?_e("invoicing"):Et(t),isTenantDropdownDisabled:ha,isSettings:kt(t),isInvoicing:De(t)&&pe==="completed",isSettingsFeatureEnabled:ze,currentTenant:i,isVendorsTabVisible:ga,isZeniAccountEnabled:Ne,isChargeCardEnabled:qe,isTreasuryEnabled:ba,isNotificationsTabVisible:ka,notificationCountDetails:pa,isExpenseAutomationEnabledForUser:le,isAiCfoAccessEnabled:w,skillsEnabled:la&&w,routinesEnabled:da===!0&&w,routines:ca,selectedRoutineId:ua,onRoutineSelect:ma,onNotificationIconClick:()=>{$(!1);const e=je?sa===0&&ra>0?"notifications/comments":"notifications/tasks":"notifications/comments",l=h(t.state?.pathnameStackToGoBack,t.pathname);s(`${a}/${e}`,{state:{pathnameStackToGoBack:l}})},onZeniLogoClick:()=>{se.toggle()},handleTenantSelect:e=>{Le(Tt.TENANT_SWITCHING),$(!1),$t({dispatch:n,navigate:s,pathToNavigate:Bt(e.tenantEmailDomain,t),selectedTenant:e,signedInUser:E})},handleMenuChange:(e,l)=>{if(E!=null&&L.trackSidePanelClicked(e.type,e.group),$(!1),a==null)return;if(e.type==="routines")return N?(n(Te()),n(Qa()),void s(`/${a}/ai-cfo/routines`,{state:{pathnameStackToGoBack:h(t.state?.pathnameStackToGoBack,t.pathname),referrer:"Sidebar"}})):void ae({location:t,navigate:s,mergeState:{referrer:"Sidebar"}});if(e.type==="skills")return N?(n(ye()),n(et()),void s(`/${a}/ai-cfo/skills`,{state:{pathnameStackToGoBack:h(t.state?.pathnameStackToGoBack,t.pathname),referrer:"Sidebar"}})):void ae({location:t,navigate:s,mergeState:{referrer:"Sidebar"}});if(n(Q()),n(ee()),e.type==="invoicing")return C&&S(!1),n(at({cacheOverride:!1})),void s(`../${a}/invoicing/overview`,{state:{pathnameStackToGoBack:h(t.state?.pathnameStackToGoBack,t.pathname),referrer:"Sidebar"}});if(C&&It(e.type)&&S(!1),e.type==="ai_cfo"){if(L.trackAICFOChatScreenStateChanged("viewed","left_menu",W??null,null),!N)return void ae({location:t,navigate:s,mergeState:{referrer:"Sidebar"}});const V=h(t.state?.pathnameStackToGoBack,t.pathname);return void s(`/${a}/ai-cfo/explore`,{state:{pathnameStackToGoBack:V,referrer:"Sidebar"}})}const p=h(t.state?.pathnameStackToGoBack,t.pathname),B=e.type,G=At(B)&&B!=="command_center";if(B!=="command_center"&&!G||f[i.tenantId]==null||L.trackMonthEndCloseClicked(f[i.tenantId].month,f[i.tenantId].year,"Sidebar"),G&&f[i.tenantId]!=null){const V=f[i.tenantId];return void s(`/${a}/month_end_close_checks/review/${e.type}/${V.month}-${V.year}`,{state:{pathnameStackToGoBack:p,message:l,referrer:"Sidebar"}})}const K=vt(e.type);yt(e.type)?(W!=null&&n(tt()),s(`/${a}/ai-cfo/${e.type}`,{state:{pathnameStackToGoBack:p.slice(0,-1),message:l,referrer:"Sidebar"}})):s(`../${a}/${K}`,{state:{pathnameStackToGoBack:p,message:l,referrer:"Sidebar"}})},onDeleteChatSession:e=>{n(Ka(e)),W===e&&X(e)},handleLogOutClick:()=>{$(!1);const e=h(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:v,onPeriodChange:Ea,onCalendarOpen:Ge,aiCfoView:Y,isAiCfo:Ia,isOnDashboard:F,isTaskManagerAccessEnabled:_,updateCurrentChatSessionId:e=>{n(Ja({sessionId:e,agentId:"controller"})),s(`../${a}/ai-cfo/${e}`,{state:{...t.state}})},halloweenAnimationEnabled:ea,thanksGivingAnimationEnabled:aa,christmasAnimationEnabled:ta,newYearAnimationEnabled:na}),va=d.jsx(_t,{position:"fixed",className:c.appBar,style:{borderBottom:Ve?`1px solid ${P.colors.grey2}`:""},children:d.jsxs(Mt,{style:{minHeight:wt},children:[d.jsx(Ut,{color:"inherit","aria-label":"open drawer",edge:"start",onClick:()=>$(!0),className:c.menuButton,size:"large",children:d.jsx(Lt,{})}),d.jsx(jt,{className:c.appBarZenilogo,onClick:()=>{se.toggle()}})]})}),ve=Me((e=>e.breakpoints.up("md"))),ya=Me((e=>e.breakpoints.down("md")));return a==null?null:d.jsxs(Vt,{className:c.root,children:[d.jsx(Ft,{}),We===!1?d.jsxs(d.Fragment,{children:[ve||!F?null:va,d.jsxs("nav",{className:c.drawer,children:[ve?null:d.jsx(Ue,{container:window.document.body,variant:"temporary",open:j,onClose:()=>$(!1),PaperProps:{sx:{width:te,zIndex:Ae[2],borderRight:"none",backgroundImage:"none",backgroundColor:P.colors.background}},ModalProps:{keepMounted:!0},children:Ie}),ya?null:d.jsx(Ue,{PaperProps:{sx:{width:te,borderRight:"none",backgroundImage:"none",backgroundColor:P.colors.background,...wa}},variant:"permanent",open:!0,children:Ie})]})]}):null]})})),i1=({tenantEmailDomain:a})=>{const C=Fe(),S=r((D=>Re(D))),j={events:S.userRoleId!=null?[`private-encrypted-${S.userRoleId}.dashboard-user-notification`]:[],eventCallback:(D,k)=>{ot(k)&&xa(k.mode)==="dashboard"&&C(Ze({unreadCount:k.data.unread},"tasks"))}};return d.jsx(Ht,{tenantEmailDomain:a,...j})},Lt=ne((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-DXMWX-Ft.js";import{a as o,R as Ta}from"./sentry-B8ZcloT9.js";import{u as Fe,j as r,g as $a,h as Ba,q as H}from"./core-BEvMNwAD.js";import{fI as Re,UK as xa,UL as Ze,gc as Aa,gy as Q,UM as ee,jI as ye,jg as Te,UN as Da,UO as _a,gS as Ma,q3 as Ua,UP as Fa,UQ as $e,gp as Ra,UR as x,fH as Za,gw as Ga,US as Va,UT as Ha,UU as La,UV as Be,UW as ja,UX as xe,UY as Pa,ED as Na,gq as Oa,h5 as qa,cX as za,UZ as Ya,U_ as Ka,qG as Wa,gb as Xa,ja as Ja,U$ as Qa,V0 as et,wL as at,gr as tt}from"./zeni-epic-state-D1qILDrP.js";import{w as nt,i as ot,a as st,Y as rt,c as it,F as m,d as lt,u as dt,e as ct,f as ut,g as mt,h as Ct,r as pt,s as ht,j as ft,z as gt,k as L,p as h,m as Ae,l as bt,n as St,o as De,q as kt,v as _e,x as Et,y as wt,A as te,B as ae,C as It,D as vt,E as yt,L as Tt,H as $t,I as Bt,J as xt,K as At}from"./index-Bfnxdwcm.js";import{u as Dt,q as _t,r as Mt,I as Ut,p as Me,t as Ft,D as Ue,s as ne}from"./mui-Bueuo6bM.js";import{u as Rt}from"./InboxNotificationsProvider-TM2N59sT.js";import{u as Zt}from"./useTaskManagerAccess-CRuBFsxT.js";import{u as Gt}from"./expenseAutomationHelper-n1rnu5_l.js";import"./recharts-DktJiIze.js";import"./analytics-CvDaD8K9.js";import"./plaid-QK7fwo4O.js";import"./dnd-B2-znEgk.js";import"./stripe-cKAAJElX.js";import"./lottie-CunmMvLM.js";import"./lexical-VH-Dh1bf.js";import"./pdf-byaFE2JF.js";import"./utils-BVoHYbte.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]="9b137dac-90e9-4c37-927f-ef81dacc7238",a._sentryDebugIdIdentifier="sentry-dbid-9b137dac-90e9-4c37-927f-ef81dacc7238")}catch{}})();const A="AppDrawer",c={root:`${A}-root`,drawer:`${A}-drawer`,appBar:`${A}-appBar`,menuButton:`${A}-menuButton`,appBarZenilogo:`${A}-appBarZenilogo`,drawerZenilogo:`${A}-drawerZenilogo`},Vt=ne("div",{slot:"Root"})((({theme:a})=>({[`&.${c.root}`]:{display:"flex"},[`& .${c.drawer}`]:{[a.breakpoints.up("md")]:{width:te,flexShrink:0,backgroundColor:a.colors.background}},[`& .${c.appBar}`]:{color:a.colors.primary,backgroundColor:a.colors.background,boxShadow:"none"},"& .MuiToolbar-root":{backgroundColor:a.colors.background},[`& .${c.menuButton}`]:{marginRight:a.spacing(2),[a.breakpoints.up("md")]:{display:"none"}},[`& .${c.appBarZenilogo}`]:{fill:a.colors.primary,cursor:"pointer",width:"100%",marginLeft:a.spacing(-6)},[`& .${c.drawerZenilogo}`]:{margin:`${a.spacing(3)} ${a.spacing(3)} ${a.spacing(0)}`,fill:a.colors.primary,cursor:"pointer"}}))),Ht=nt((function({tenantEmailDomain:a}){const{isAiCfoOpen:C,setIsAiCfoOpen:S}=st(),[j,D]=Ta.useState(!1),[k,Ge]=o.useState(!1),t=$a(),s=Ba(),oe=Aa(),se=rt(),n=Fe(),[Ve,He]=o.useState(!1),P=Dt(),re=t.pathname.includes("/ai-cfo/");o.useEffect((()=>{re||(n(Q()),n(ee()))}),[n,re]),o.useEffect((()=>{n(Q()),n(ee())}),[n,a]);const{useFeatureGate:u}=it(),{isFeatureEnabled:ie}=u(m.isDebitCardFeatureEnabled),E=lt(),i=r((e=>Re(e))),N=i.masterTOSInfo?.isMasterTOSAccepted??!1,{setLoading:Le}=dt(),w=ct(),{isTaskManagerAccessEnabled:_,isZeniUser:je}=Zt(E),le=ut(),I=mt(),M=(function(e=2e3){const[l,p]=o.useState(!1);return o.useEffect((()=>{if(l)return;const B=window.requestIdleCallback;if(B==null){const J=window.setTimeout((()=>p(!0)),e);return()=>window.clearTimeout(J)}const G=B((()=>p(!0)),{timeout:e});return()=>{window.cancelIdleCallback?.(G)}}),[e,l]),l})();o.useEffect((()=>{M&&I&&w&&(n(ye()),n(Te()))}),[n,M,I,i.tenantId,w]);const[O,Pe]=o.useState(void 0),Ne=!!i.company?.companyZeniAccountInfo?.isZeniAccountEnabled,{isFeatureEnabled:Oe}=u(m.isChargeCardFeatureEnabled),qe=Ct(i,Oe,ie),{isFeatureEnabled:ze}=u(m.isSettingsFeatureEnabled),{isFeatureEnabled:U}=u(m.isReferralFeatureEnabled),Ye=i.companyTreasuryInfo?.info?.businessVerificationStatus?.code==="verified",de=r((e=>Da(e)));o.useEffect((()=>{const e=()=>{He(window.scrollY>10)};return window.addEventListener("scroll",e),()=>{window.removeEventListener("scroll",e)}}),[]);const q=r((e=>_a(e))),f=r((e=>e.expenseAutomationViewState.selectedPeriodByTenantId)),g=r((e=>Ma(e))),{monthEndCloseChecksView:v}=g,Ke=H("/signout")!==null,F=H("/:tenantEmailDomain/dashboard")!==null,ce=H("/:tenantEmailDomain/reports")!==null,b=H("/:tenantEmailDomain/onboarding/*")!==null,ue=Gt();o.useEffect((()=>{M&&I&&U&&!b&&q.fetchState==="Not-Started"&&n(Ua(!0))}),[M,I,U,q.fetchState,b]),o.useEffect((()=>{if(ue){const e=t.state?.origin;if(e!=null){const l=Fa(e);l!=null&&n($e(l))}}}),[ue,t.state]);const We=Ke||b,z=r((e=>e.tenantState)),Xe=r((e=>z.fetchState==="Completed"?Ra(e):[])),{isFeatureEnabled:Je}=u(m.isApAgingFeatureEnabled),{isFeatureEnabled:Qe}=u(m.isArAgingFeatureEnabled),{isFeatureEnabled:ea}=u(m.isDashboardSidebarHalloweenAnimationEnabled),{isFeatureEnabled:aa}=u(m.isDashboardSidebarThanksGivingAnimationEnabled),{isFeatureEnabled:ta}=u(m.isDashboardSidebarChristmasAnimationEnabled),{isFeatureEnabled:na}=u(m.isDashboardSidebarNewYearAnimationEnabled),oa=r((e=>x(e).totalUnreadCount)),sa=r((e=>x(e).notificationDetailsByTab.tasks.uiState.unreadCount)),ra=r((e=>x(e).notificationDetailsByTab.comments.uiState.unreadCount)),ia=r((e=>x(e).reducedFetchCountState)),me=r((e=>x(e).notificationDetailsByTab.tasks.fetchCountState)),Y=r((e=>Za(e))),la=r((e=>Ga(e).skillsEnabled)),da=r((e=>Va(e))),Ce=r((e=>Ha(e).routines)),ca=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]),ua=new URLSearchParams(t.search).get("routine")??ht(t.pathname.split("/ai-cfo/")[1])??void 0,ma=o.useCallback(((e,l)=>{s(l!=null&&l!==""?`/${a}/ai-cfo/${encodeURIComponent(l)}`:`/${a}/ai-cfo/routines?routine=${encodeURIComponent(e)}`)}),[s,a]),{status:pe}=r(La),[y,K]=o.useState(void 0),W=Y.uiState.currentChatSessionId,R=y!=null?Y.deleteChatSessionStateByChatSessionId[y]?.fetchState:void 0,he=ft(R),{inboxNotifications:X,isLoading:fe,isFetchingMore:ge,hasFetchedAll:be,fetchMore:Ca}=Rt(),Z=r((e=>x(e).notificationDetailsByTab.comments.fetchCountState));o.useEffect((()=>{const e=setTimeout((()=>Ca?.()),0);return()=>clearTimeout(e)})),o.useEffect((()=>{if(y!=null)return he==="In-Progress"&&R==="Completed"?(n(Be({chatSessionId:y})),K(void 0),void s(`/${a}/ai-cfo/explore`,{state:{...t.state,referrer:"Sidebar"}})):void(R==="Error"&&(n(Be({chatSessionId:y})),K(void 0)))}),[n,t.state,s,R,y,he,a]),o.useEffect((()=>{if(fe===!1&&ge===!1&&be===!0&&i?.companyId!=null&&X!=null){const e=`dashboard_${i.companyId}`;Pe(X.filter((l=>l.roomId===e&&l.readAt==null)).length)}}),[fe,ge,be,i?.companyId,X]),o.useEffect((()=>{I&&_&&!b&&me.fetchState==="Not-Started"&&oe.tenantId!=null&&n(ja("task_manager","dashboard"))}),[I,_,b,me.fetchState,oe.tenantId,n]),o.useEffect((()=>{b||Z.fetchState!=="Not-Started"||n(xe({fetchCountState:{fetchState:"In-Progress",error:void 0}},"comments"))}),[b,Z.fetchState,n]),o.useEffect((()=>{if(O!=null){const{fetchState:e}=Z;e!=="In-Progress"&&e!=="Completed"||(e==="In-Progress"&&n(xe({fetchCountState:{fetchState:"Completed",error:void 0}},"comments")),n(Ze({unreadCount:O},"comments")))}}),[O,Z.fetchState]);const pa={fetchStatus:ia,count:oa},T=[];Je===!1&&T.push("accounts_payable_aging"),Qe===!1&&T.push("accounts_receivable_aging"),T.push("zeni_accounts_promo_card","treasury_promo_card"),U===!1&&T.push("rewards_card"),le===!1&&T.push("expense_automation_card");const Se=r((e=>Pa(e,T).fetchState)),ke=r((e=>Na(e).fetchState)),Ee=a!=null?gt.getSignedInUserTenant(a):null,we=r((e=>Ee?.tenantId!=null?Oa(e,Ee.tenantId):void 0)),ha=F&&(Se==="Completed"||Se==="Error")||ce&&(ke==="Completed"||ke==="Error")||!F&&!ce?void 0:"disabled",fa=o.useMemo((()=>qa(i.userRole)),[i.userRole]),ga=za(fa),$=e=>{D(e)},ba=Ye,Sa=i?.rewardsLastViewedTime==null,ka=E?.userEmail!=null&&de.fetchState==="Completed"&&Ya(de.notificationSettings,E.userEmail,ie,i,_),Ea=o.useCallback((e=>{const l=t.state?.referrer;if(v.monthEndCloseChecks?.auditSummary!=null&&L.trackMonthCloseAuditPage(e.month,e.year,v.monthEndCloseChecks.reportEmailSentDate!=null?"closed":"in-review",v.monthEndCloseChecks.auditSummary.auditScorePercentage,!1,l??null),n(Ka(i.tenantId,e)),f[i.tenantId]!=null){const p=h(t.state?.pathnameStackToGoBack,t.pathname);s(`/${a}/month_end_close_checks/review/${g.currentSelectedView}/${e.month}-${e.year}`,{state:{pathnameStackToGoBack:p,referrer:g.currentSelectedView}})}n($e(g.currentSelectedView)),g.reconciliation.selectedAccountId!=null&&n(Wa({selectedAccountId:void 0}))}),[g.reconciliation.selectedAccountId,g.currentSelectedView,i.tenantId,v.monthEndCloseChecks?.auditSummary,v.monthEndCloseChecks?.reportEmailSentDate,f,a,t.state,t.pathname]),wa=o.useMemo((()=>({zIndex:k?12:Ae[2]})),[k]),Ia=w&&bt(t),Ie=d.jsx(St,{signedInUser:E,currentTenantId:z.currentTenantId??"",tenants:z.fetchState==="Completed"?Xe:we!=null?[we]:[],rewardsConfiguration:{isRewardsTabVisible:U,isRewardsAnimated:Sa,rewardsPlan:q.rewardsPlan},selectedMenu:C===!0?_e("ai_cfo"):De(t)&&pe!=="completed"?_e("invoicing"):Et(t),isTenantDropdownDisabled:ha,isSettings:kt(t),isInvoicing:De(t)&&pe==="completed",isSettingsFeatureEnabled:ze,currentTenant:i,isVendorsTabVisible:ga,isZeniAccountEnabled:Ne,isChargeCardEnabled:qe,isTreasuryEnabled:ba,isNotificationsTabVisible:ka,notificationCountDetails:pa,isExpenseAutomationEnabledForUser:le,isAiCfoAccessEnabled:w,skillsEnabled:la&&w,routinesEnabled:da===!0&&w,routines:ca,selectedRoutineId:ua,onRoutineSelect:ma,onNotificationIconClick:()=>{$(!1);const e=je?sa===0&&ra>0?"notifications/comments":"notifications/tasks":"notifications/comments",l=h(t.state?.pathnameStackToGoBack,t.pathname);s(`${a}/${e}`,{state:{pathnameStackToGoBack:l}})},onZeniLogoClick:()=>{se.toggle()},handleTenantSelect:e=>{Le(Tt.TENANT_SWITCHING),$(!1),$t({dispatch:n,navigate:s,pathToNavigate:Bt(e.tenantEmailDomain,t),selectedTenant:e,signedInUser:E})},handleMenuChange:(e,l)=>{if(E!=null&&L.trackSidePanelClicked(e.type,e.group),$(!1),a==null)return;if(e.type==="routines")return N?(n(Te()),n(Qa()),void s(`/${a}/ai-cfo/routines`,{state:{pathnameStackToGoBack:h(t.state?.pathnameStackToGoBack,t.pathname),referrer:"Sidebar"}})):void ae({location:t,navigate:s,mergeState:{referrer:"Sidebar"}});if(e.type==="skills")return N?(n(ye()),n(et()),void s(`/${a}/ai-cfo/skills`,{state:{pathnameStackToGoBack:h(t.state?.pathnameStackToGoBack,t.pathname),referrer:"Sidebar"}})):void ae({location:t,navigate:s,mergeState:{referrer:"Sidebar"}});if(n(Q()),n(ee()),e.type==="invoicing")return C&&S(!1),n(at({cacheOverride:!1})),void s(`../${a}/invoicing/overview`,{state:{pathnameStackToGoBack:h(t.state?.pathnameStackToGoBack,t.pathname),referrer:"Sidebar"}});if(C&&It(e.type)&&S(!1),e.type==="ai_cfo"){if(L.trackAICFOChatScreenStateChanged("viewed","left_menu",W??null,null),!N)return void ae({location:t,navigate:s,mergeState:{referrer:"Sidebar"}});const V=h(t.state?.pathnameStackToGoBack,t.pathname);return void s(`/${a}/ai-cfo/explore`,{state:{pathnameStackToGoBack:V,referrer:"Sidebar"}})}const p=h(t.state?.pathnameStackToGoBack,t.pathname),B=e.type,G=At(B)&&B!=="command_center";if(B!=="command_center"&&!G||f[i.tenantId]==null||L.trackMonthEndCloseClicked(f[i.tenantId].month,f[i.tenantId].year,"Sidebar"),G&&f[i.tenantId]!=null){const V=f[i.tenantId];return void s(`/${a}/month_end_close_checks/review/${e.type}/${V.month}-${V.year}`,{state:{pathnameStackToGoBack:p,message:l,referrer:"Sidebar"}})}const J=vt(e.type);yt(e.type)?(W!=null&&n(tt()),s(`/${a}/ai-cfo/${e.type}`,{state:{pathnameStackToGoBack:p.slice(0,-1),message:l,referrer:"Sidebar"}})):s(`../${a}/${J}`,{state:{pathnameStackToGoBack:p,message:l,referrer:"Sidebar"}})},onDeleteChatSession:e=>{n(Ja(e)),W===e&&K(e)},handleLogOutClick:()=>{$(!1);const e=h(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:v,onPeriodChange:Ea,onCalendarOpen:Ge,aiCfoView:Y,isAiCfo:Ia,isOnDashboard:F,isTaskManagerAccessEnabled:_,updateCurrentChatSessionId:e=>{n(Xa({sessionId:e,agentId:"controller"})),s(`../${a}/ai-cfo/${e}`,{state:{...t.state}})},halloweenAnimationEnabled:ea,thanksGivingAnimationEnabled:aa,christmasAnimationEnabled:ta,newYearAnimationEnabled:na}),va=d.jsx(_t,{position:"fixed",className:c.appBar,style:{borderBottom:Ve?`1px solid ${P.colors.grey2}`:""},children:d.jsxs(Mt,{style:{minHeight:wt},children:[d.jsx(Ut,{color:"inherit","aria-label":"open drawer",edge:"start",onClick:()=>$(!0),className:c.menuButton,size:"large",children:d.jsx(Lt,{})}),d.jsx(jt,{className:c.appBarZenilogo,onClick:()=>{se.toggle()}})]})}),ve=Me((e=>e.breakpoints.up("md"))),ya=Me((e=>e.breakpoints.down("md")));return a==null?null:d.jsxs(Vt,{className:c.root,children:[d.jsx(Ft,{}),We===!1?d.jsxs(d.Fragment,{children:[ve||!F?null:va,d.jsxs("nav",{className:c.drawer,children:[ve?null:d.jsx(Ue,{container:window.document.body,variant:"temporary",open:j,onClose:()=>$(!1),PaperProps:{sx:{width:te,zIndex:Ae[2],borderRight:"none",backgroundImage:"none",backgroundColor:P.colors.background}},ModalProps:{keepMounted:!0},children:Ie}),ya?null:d.jsx(Ue,{PaperProps:{sx:{width:te,borderRight:"none",backgroundImage:"none",backgroundColor:P.colors.background,...wa}},variant:"permanent",open:!0,children:Ie})]})]}):null]})})),i1=({tenantEmailDomain:a})=>{const C=Fe(),S=r((D=>Re(D))),j={events:S.userRoleId!=null?[`private-encrypted-${S.userRoleId}.dashboard-user-notification`]:[],eventCallback:(D,k)=>{ot(k)&&xa(k.mode)==="dashboard"&&C(Ze({unreadCount:k.data.unread},"tasks"))}};return d.jsx(Ht,{tenantEmailDomain:a,...j})},Lt=ne((a=>o.createElement("svg",{viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",...a},o.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M0.604839 4.51889C0.333157 4.57797 0.0879194 4.8318 0.0182541 5.12602C-0.00534674 5.22569 -0.00534674 5.4412 0.0182541 5.54086C0.0523791 5.685 0.117181 5.80198 0.22956 5.92229C0.346814 6.04782 0.459133 6.11627 0.600351 6.14826C0.726193 6.17676 23.2738 6.17676 23.3997 6.14826C23.5409 6.11627 23.6532 6.04782 23.7704 5.92229C23.9348 5.74632 24 5.57908 24 5.33344C24 5.1793 23.9797 5.08352 23.9199 4.95575C23.8455 4.79698 23.6879 4.63709 23.5343 4.56468C23.3857 4.49468 24.2116 4.49926 11.9899 4.50058C2.66632 4.50157 0.669677 4.50479 0.604839 4.51889ZM0.669895 11.1732C0.365117 11.2113 0.0889356 11.4752 0.0182179 11.7958C-0.00468131 11.8996 -0.00469357 12.0996 0.0181935 12.2034C0.0806855 12.4867 0.305734 12.7294 0.581516 12.8108C0.65573 12.8327 1.1761 12.8337 12 12.8337C22.8591 12.8337 23.3441 12.8327 23.4192 12.8106C23.6933 12.7297 23.9196 12.4855 23.9818 12.2034C24.0047 12.0996 24.0047 11.8997 23.9818 11.7959C23.9201 11.516 23.7014 11.2776 23.425 11.1888C23.3558 11.1665 22.8817 11.1655 12.0544 11.164C5.84032 11.1631 0.717278 11.1672 0.669895 11.1732ZM0.594774 17.8516C0.458952 17.8831 0.344939 17.9535 0.22956 18.077C0.0652015 18.253 0 18.4202 0 18.6659C0 18.82 0.0203225 18.9158 0.0801289 19.0435C0.154452 19.2023 0.312097 19.3622 0.465726 19.4346C0.614214 19.5046 -0.209758 19.4999 12 19.4999C21.8294 19.4999 23.3082 19.4975 23.3881 19.4811C23.6596 19.4256 23.9122 19.1669 23.9817 18.8733C24.0053 18.7736 24.0053 18.5581 23.9817 18.4584C23.9476 18.3143 23.8828 18.1973 23.7704 18.077C23.6532 17.9515 23.5409 17.883 23.3997 17.851C23.2779 17.8235 0.713601 17.824 0.594774 17.8516Z",fill:"currentColor"}))))`
|
|
2
2
|
height: 20px;
|
|
3
3
|
width: 20px;
|
|
4
4
|
color: ${a=>a.theme.colors.primary};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{j as d}from"./liveblocks-ClXFfXis.js";import{a as u}from"./sentry-Bywn7nUR.js";import{h as U,g as B,u as j,j as y,N as W,l as V,i as Z,n as te,o as x}from"./core-DQmS6IoY.js";import{fI as P,ZU as w,ZB as R,Ic as E,I6 as q,Ia as A,H$ as K,ZD as z,I3 as ae,Ie as oe,I2 as H,Ih as G,Id as C}from"./zeni-epic-state-BZdgF4nr.js";import{z as T,w as J,bZ as pe,o as O,bT as M,b_ as le,a5 as Q,b$ as se,c0 as ne}from"./index-CZKOIAsv.js";import{u as X}from"./mui-3IbG8WRT.js";import{u as Y}from"./useEnsureVendorListLoaded-hsg4Ceo6.js";import{i as re}from"./ReimbursementApprovalRuleDetailScreen-D4hv5xCL.js";import ie from"./NotFoundScreen-CQU7vngQ.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]="64bd8c02-e1eb-4727-8fc9-3fdd7d5de625",e._sentryDebugIdIdentifier="sentry-dbid-64bd8c02-e1eb-4727-8fc9-3fdd7d5de625")}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(z(!1))},onBackClick:()=>{O(o)?t("../../"):t("../../../bills/setup")},onDeleteRuleClick:a=>{e(K(a,!1))},onEditRuleClick:a=>{a!=null?(e(A(a)),t(`./${a}/edit`)):(e(A()),t("./new"))}}}))(J(pe)),de=({isLoading:e})=>{const l=U(),t=B(),o=j(),[a,n]=u.useState(!1),[s,v]=u.useState(!1),p=y((r=>r.billPaySetupApproverViewState.fetchState)),f=y((r=>P(r))),c=y((r=>w(r))),m=y((r=>R(r).billPaySetupApproverViewUpdateData));if(u.useEffect((()=>{m?.updateStatus.fetchState==="Completed"&&o(E())}),[m]),u.useEffect((()=>{a||p!=="Not-Started"||e||(n(!0),o(q(!0,!0,!1)))}),[a,p,e,o]),T.getSignedInUser()==null)throw Error("Can't access billpay approval without signing in...");u.useEffect((()=>{c.allApprovalRules.length===0&&c.fetchState==="Completed"&&(s||(v(!0),o(A())),l("./new"))}),[s,c,o]);const S={events:f.companyId!=null?[`private-encrypted-${f.companyId}.${k}`]:[],eventCallback:(r,h,I)=>{r.endsWith(k)&&I.onApprovalRulesEventReceived(r)}};return f?.companyBillPayInfo?.info?.isBillPayTOSAccepted===!1?d.jsx(W,{to:"../../promo"}):d.jsx(ce,{currentTenant:f,location:t,navigate:l,...S})},L="bill-approval-rule-update",ue=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(K(a,!0))},onEditRuleClick:a=>{a!=null?(e(A(a)),t(`./${a}/edit`)):(e(A()),t("./new"))},onReorderRules:a=>{e(oe(a,!0))}}}))(J(le)),ve=()=>{const e=y((o=>P(o))),{isApprovalRulesV3Enabled:l,isLoading:t}=M(e?.tenantId);return l?d.jsx(fe,{isLoading:t}):d.jsx(de,{isLoading:t})},fe=({isLoading:e})=>{const l=U(),t=B(),o=j(),[a,n]=u.useState(!1),[s,v]=u.useState(!1),[p,f]=u.useState(!1),c=y((i=>i.billPaySetupApproverViewState.fetchState)),m=y((i=>i.billPaySetupApproverViewState.approverListState.fetchStatus.fetchState)),S=y((i=>P(i)));Y();const r=y((i=>w(i))),h=y((i=>R(i).billPaySetupApproverViewUpdateData));if(u.useEffect((()=>{h?.updateStatus.fetchState==="Completed"&&o(E())}),[h]),u.useEffect((()=>{a||c!=="Not-Started"||e||(n(!0),o(q(!0,!0,!0)))}),[a,c,e,o]),u.useEffect((()=>{s||m!=="Not-Started"||e||(v(!0),o(ae(!1,!0)))}),[s,m,e,o]),T.getSignedInUser()==null)throw Error("Can't access billpay approval without signing in...");u.useEffect((()=>{r.allApprovalRules.length===0&&r.fetchState==="Completed"&&(p||(f(!0),o(A())),l("./new"))}),[p,r,o]);const I={events:S.companyId!=null?[`private-encrypted-${S.companyId}.${L}`]:[],eventCallback:(i,b,g)=>{i.endsWith(L)&&g.onApprovalRulesEventReceived(i)}};return S?.companyBillPayInfo?.info?.isBillPayTOSAccepted===!1?d.jsx(W,{to:"../../promo"}):d.jsx(ue,{currentTenant:S,location:t,navigate:l,isLoading:e,...I})},ye=V((function(e,l){const t=R(e),o=t.billPaySetupApproverViewUpdateData?.type??"approval_create",a=o==="approval_create"&&t.allApprovalRules.length!==0;let n=t.allApprovalRules.length===0;return l.approvalRuleId&&(n=t.allApprovalRules.findIndex((s=>s.approvalRuleId===l.approvalRuleId))===0),{localData:t,hideUpperBoundField:a,isLowerBoundDisabled:n,approvalUpdateActionType:o}}),(function(e,l){const{navigate:t,approvalUpdateDataView:o,approverViewData:a,approvalRuleId:n}=l,s=o.billPaySetupApproverViewUpdateData?.type,v=O(l.location);return{onApprovalRuleDataUpdated:p=>{const f=m=>{const S=[];return m.forEach((r=>{const h=r.actors.selectedUsers.map((b=>({type:"user",userId:b.userId,isImplicitActor:!1}))),I=r.actors.selectedNonUsers.map((b=>{const g=!!re(b.value);return{type:g?"attribute":"role",subType:b.value,userId:void 0,idType:void 0,isImplicitActor:!g}})),i=h.concat(I);S.push({action:r.stepType.selectedOption,actors:i,operator:i.length>1?r.stepType.selectedOption==="require_approval"?"or":"and":"is"})})),S},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 m={criteria:c,steps:f(p.steps),isApplicableOnPendingApprovalEntity:p.applyToExistingBills.includes("applyToExistingBills")};e(C(m))}else{const m={approvalRuleId:n,criteria:c,steps:f(p.steps),isApplicableOnPendingApprovalEntity:p.applyToExistingBills.includes("applyToExistingBills")};e(C(m))}},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(G(!1))},onSaveRuleSuccess:()=>{t("../")}}}))(se);function me(){const e=U(),l=j(),t=B(),{approvalRuleId:o}=Z(),a=T.getSignedInUser(),n=X(),s=y((c=>R(c))),v=y((c=>w(c))),[p,f]=u.useState(!1);if(u.useEffect((()=>{p||(f(!0),l(H(!0)))})),u.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"?d.jsx(Q,{fetchState:s.approverListFetchStatus.fetchState,style:{backgroundColor:n.colors.grey5}}):d.jsx(ye,{navigate:e,approvalUpdateDataView:s,approvalRuleId:o,approverViewData:v,location:t})}const Se=V((function(e,l){const t=R(e),o=t.billPaySetupApproverViewUpdateData?.type??"approval_create",a=[],n={};for(const s of Object.values(e.vendorState.vendorByID))s?.id!=null&&(a.push(s.id),n[s.id]=s.name);return{localData:t,approvalUpdateActionType:o,allVendorIds:a,vendorNamesById:n,editingRuleId:o==="approval_update"?l.approvalRuleId:void 0,allApprovalRulesWithUser:w(e).allApprovalRules}}),(function(e,l){const{navigate:t,approvalUpdateDataView:o,approverViewData:a,approvalRuleId:n}=l,s=o.billPaySetupApproverViewUpdateData?.type,v=O(l.location);return{onApprovalRuleDataUpdated:p=>{const f=i=>{const b=[];return i.forEach((g=>{const N=g.actorKind?.selectedOption,ee=g.selectedRole?.selectedNonUsers??[];let D=[];N==="role"?D=ee.map((_=>({type:"attribute",subType:_.value,userId:void 0,idType:void 0,isImplicitActor:!1}))):N==="specific_person"&&(D=(g.persons?.selectedUsers??[]).map((_=>({type:"user",userId:_.userId,isImplicitActor:!1}))));const $=g.action??"require_approval";b.push({action:$,actors:D,operator:D.length>1?$==="require_approval"?"or":"and":"is"})})),b},c=p.amountCriteria,m=p.vendorCriteria,S=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=m?.selection.selectedOptions??[];h.length>0&&(r.vendor={type:"vendor",operator:m?.operator.selectedOption??"is",vendorIds:h});const I=S?.selection.selectedOptions??[];if(I.length>0&&(r.department={type:"department",operator:S?.operator.selectedOption??"is",departmentIds:I}),s==="approval_create"){const i={name:p.name,description:p.description,separationOfDuties:p.separationOfDuties,criteria:r,steps:f(p.steps),isApplicableOnPendingApprovalEntity:p.applyToExistingBills.includes("applyToExistingBills")};e(C(i))}else{const i={approvalRuleId:n,name:p.name,description:p.description,separationOfDuties:p.separationOfDuties,criteria:r,steps:f(p.steps),isApplicableOnPendingApprovalEntity:p.applyToExistingBills.includes("applyToExistingBills")};e(C(i))}},onResetClick:()=>{e(E()),s==="approval_update"||v?t("../"):a.allApprovalRules.length===0&&a.fetchState==="Completed"?t("../../setup"):t("../")},onBackClick:()=>{e(E()),s==="approval_update"||v?t("../"):a.allApprovalRules.length===0&&a.fetchState==="Completed"?t("../../setup"):t("../")},onSaveRuleClick:()=>{e(G(!0))},onSaveRuleSuccess:()=>{t("../")},onEditExistingRule:p=>{e(A(p)),t(s==="approval_update"?`../../${p}/edit`:`../${p}/edit`)}}}))(ne);function F(){const e=y((t=>P(t))),{isApprovalRulesV3Enabled:l}=M(e?.tenantId);return l?d.jsx(ge,{}):d.jsx(me,{})}function ge(){const e=U(),l=j(),t=B(),{approvalRuleId:o}=Z(),a=T.getSignedInUser(),n=X(),s=y((c=>R(c))),v=y((c=>w(c))),[p,f]=u.useState(!1);if(Y(),u.useEffect((()=>{p||(f(!0),l(H(!1)))})),u.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"?d.jsx(Q,{fetchState:s.approverListFetchStatus.fetchState,style:{backgroundColor:n.colors.grey5}}):d.jsx(Se,{navigate:e,approvalUpdateDataView:s,approvalRuleId:o,approverViewData:v,location:t},o??"new")}function Ce(){return d.jsxs(te,{children:[d.jsx(x,{path:"/",element:d.jsx(ve,{})}),d.jsx(x,{path:"/new",element:d.jsx(F,{})}),d.jsx(x,{path:"/:approvalRuleId/edit",element:d.jsx(F,{})}),d.jsx(x,{path:"*",element:d.jsx(ie,{})})]})}export{Ce as B};
|
|
1
|
+
import{j as u}from"./liveblocks-DXMWX-Ft.js";import{a as d}from"./sentry-B8ZcloT9.js";import{h as U,g as B,u as j,j as y,N as W,l as V,i as q,n as te,o as x}from"./core-BEvMNwAD.js";import{fI as P,ZU as w,ZB as R,Ic as E,I6 as Z,Ia as A,H$ as K,ZD as z,I3 as ae,Ie as oe,I2 as H,Ih as G,Id as C}from"./zeni-epic-state-D1qILDrP.js";import{z as T,w as J,bZ as pe,q as O,bT as M,b_ as le,a5 as Q,b$ as se,c0 as ne}from"./index-Bfnxdwcm.js";import{u as X}from"./mui-Bueuo6bM.js";import{u as Y}from"./useEnsureVendorListLoaded-CbpMm19m.js";import{i as re}from"./ReimbursementApprovalRuleDetailScreen-BOO5QQZQ.js";import ie from"./NotFoundScreen-CgHV3hZC.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]="2f246bb8-e793-4f9f-9ade-cbc5f1913ec1",e._sentryDebugIdIdentifier="sentry-dbid-2f246bb8-e793-4f9f-9ade-cbc5f1913ec1")}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(z(!1))},onBackClick:()=>{O(o)?t("../../"):t("../../../bills/setup")},onDeleteRuleClick:a=>{e(K(a,!1))},onEditRuleClick:a=>{a!=null?(e(A(a)),t(`./${a}/edit`)):(e(A()),t("./new"))}}}))(J(pe)),ue=({isLoading:e})=>{const l=U(),t=B(),o=j(),[a,n]=d.useState(!1),[s,v]=d.useState(!1),p=y((r=>r.billPaySetupApproverViewState.fetchState)),f=y((r=>P(r))),c=y((r=>w(r))),m=y((r=>R(r).billPaySetupApproverViewUpdateData));if(d.useEffect((()=>{m?.updateStatus.fetchState==="Completed"&&o(E())}),[m]),d.useEffect((()=>{a||p!=="Not-Started"||e||(n(!0),o(Z(!0,!0,!1)))}),[a,p,e,o]),T.getSignedInUser()==null)throw Error("Can't access billpay approval without signing in...");d.useEffect((()=>{c.allApprovalRules.length===0&&c.fetchState==="Completed"&&(s||(v(!0),o(A())),l("./new"))}),[s,c,o]);const S={events:f.companyId!=null?[`private-encrypted-${f.companyId}.${k}`]:[],eventCallback:(r,h,I)=>{r.endsWith(k)&&I.onApprovalRulesEventReceived(r)}};return f?.companyBillPayInfo?.info?.isBillPayTOSAccepted===!1?u.jsx(W,{to:"../../promo"}):u.jsx(ce,{currentTenant:f,location:t,navigate:l,...S})},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(K(a,!0))},onEditRuleClick:a=>{a!=null?(e(A(a)),t(`./${a}/edit`)):(e(A()),t("./new"))},onReorderRules:a=>{e(oe(a,!0))}}}))(J(le)),ve=()=>{const e=y((o=>P(o))),{isApprovalRulesV3Enabled:l,isLoading:t}=M(e?.tenantId);return l?u.jsx(fe,{isLoading:t}):u.jsx(ue,{isLoading:t})},fe=({isLoading:e})=>{const l=U(),t=B(),o=j(),[a,n]=d.useState(!1),[s,v]=d.useState(!1),[p,f]=d.useState(!1),c=y((i=>i.billPaySetupApproverViewState.fetchState)),m=y((i=>i.billPaySetupApproverViewState.approverListState.fetchStatus.fetchState)),S=y((i=>P(i)));Y();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(Z(!0,!0,!0)))}),[a,c,e,o]),d.useEffect((()=>{s||m!=="Not-Started"||e||(v(!0),o(ae(!1,!0)))}),[s,m,e,o]),T.getSignedInUser()==null)throw Error("Can't access billpay approval without signing in...");d.useEffect((()=>{r.allApprovalRules.length===0&&r.fetchState==="Completed"&&(p||(f(!0),o(A())),l("./new"))}),[p,r,o]);const I={events:S.companyId!=null?[`private-encrypted-${S.companyId}.${L}`]:[],eventCallback:(i,b,g)=>{i.endsWith(L)&&g.onApprovalRulesEventReceived(i)}};return S?.companyBillPayInfo?.info?.isBillPayTOSAccepted===!1?u.jsx(W,{to:"../../promo"}):u.jsx(de,{currentTenant:S,location:t,navigate:l,isLoading:e,...I})},ye=V((function(e,l){const t=R(e),o=t.billPaySetupApproverViewUpdateData?.type??"approval_create",a=o==="approval_create"&&t.allApprovalRules.length!==0;let n=t.allApprovalRules.length===0;return l.approvalRuleId&&(n=t.allApprovalRules.findIndex((s=>s.approvalRuleId===l.approvalRuleId))===0),{localData:t,hideUpperBoundField:a,isLowerBoundDisabled:n,approvalUpdateActionType:o}}),(function(e,l){const{navigate:t,approvalUpdateDataView:o,approverViewData:a,approvalRuleId:n}=l,s=o.billPaySetupApproverViewUpdateData?.type,v=O(l.location);return{onApprovalRuleDataUpdated:p=>{const f=m=>{const S=[];return m.forEach((r=>{const h=r.actors.selectedUsers.map((b=>({type:"user",userId:b.userId,isImplicitActor:!1}))),I=r.actors.selectedNonUsers.map((b=>{const g=!!re(b.value);return{type:g?"attribute":"role",subType:b.value,userId:void 0,idType:void 0,isImplicitActor:!g}})),i=h.concat(I);S.push({action:r.stepType.selectedOption,actors:i,operator:i.length>1?r.stepType.selectedOption==="require_approval"?"or":"and":"is"})})),S},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 m={criteria:c,steps:f(p.steps),isApplicableOnPendingApprovalEntity:p.applyToExistingBills.includes("applyToExistingBills")};e(C(m))}else{const m={approvalRuleId:n,criteria:c,steps:f(p.steps),isApplicableOnPendingApprovalEntity:p.applyToExistingBills.includes("applyToExistingBills")};e(C(m))}},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(G(!1))},onSaveRuleSuccess:()=>{t("../")}}}))(se);function me(){const e=U(),l=j(),t=B(),{approvalRuleId:o}=q(),a=T.getSignedInUser(),n=X(),s=y((c=>R(c))),v=y((c=>w(c))),[p,f]=d.useState(!1);if(d.useEffect((()=>{p||(f(!0),l(H(!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 Se=V((function(e,l){const t=R(e),o=t.billPaySetupApproverViewUpdateData?.type??"approval_create",a=[],n={};for(const s of Object.values(e.vendorState.vendorByID))s?.id!=null&&(a.push(s.id),n[s.id]=s.name);return{localData:t,approvalUpdateActionType:o,allVendorIds:a,vendorNamesById:n,editingRuleId:o==="approval_update"?l.approvalRuleId:void 0,allApprovalRulesWithUser:w(e).allApprovalRules}}),(function(e,l){const{navigate:t,approvalUpdateDataView:o,approverViewData:a,approvalRuleId:n}=l,s=o.billPaySetupApproverViewUpdateData?.type,v=O(l.location);return{onApprovalRuleDataUpdated:p=>{const f=i=>{const b=[];return i.forEach((g=>{const N=g.actorKind?.selectedOption,ee=g.selectedRole?.selectedNonUsers??[];let D=[];N==="role"?D=ee.map((_=>({type:"attribute",subType:_.value,userId:void 0,idType:void 0,isImplicitActor:!1}))):N==="specific_person"&&(D=(g.persons?.selectedUsers??[]).map((_=>({type:"user",userId:_.userId,isImplicitActor:!1}))));const $=g.action??"require_approval";b.push({action:$,actors:D,operator:D.length>1?$==="require_approval"?"or":"and":"is"})})),b},c=p.amountCriteria,m=p.vendorCriteria,S=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=m?.selection.selectedOptions??[];h.length>0&&(r.vendor={type:"vendor",operator:m?.operator.selectedOption??"is",vendorIds:h});const I=S?.selection.selectedOptions??[];if(I.length>0&&(r.department={type:"department",operator:S?.operator.selectedOption??"is",departmentIds:I}),s==="approval_create"){const i={name:p.name,description:p.description,separationOfDuties:p.separationOfDuties,criteria:r,steps:f(p.steps),isApplicableOnPendingApprovalEntity:p.applyToExistingBills.includes("applyToExistingBills")};e(C(i))}else{const i={approvalRuleId:n,name:p.name,description:p.description,separationOfDuties:p.separationOfDuties,criteria:r,steps:f(p.steps),isApplicableOnPendingApprovalEntity:p.applyToExistingBills.includes("applyToExistingBills")};e(C(i))}},onResetClick:()=>{e(E()),s==="approval_update"||v?t("../"):a.allApprovalRules.length===0&&a.fetchState==="Completed"?t("../../setup"):t("../")},onBackClick:()=>{e(E()),s==="approval_update"||v?t("../"):a.allApprovalRules.length===0&&a.fetchState==="Completed"?t("../../setup"):t("../")},onSaveRuleClick:()=>{e(G(!0))},onSaveRuleSuccess:()=>{t("../")},onEditExistingRule:p=>{e(A(p)),t(s==="approval_update"?`../../${p}/edit`:`../${p}/edit`)}}}))(ne);function F(){const e=y((t=>P(t))),{isApprovalRulesV3Enabled:l}=M(e?.tenantId);return l?u.jsx(ge,{}):u.jsx(me,{})}function ge(){const e=U(),l=j(),t=B(),{approvalRuleId:o}=q(),a=T.getSignedInUser(),n=X(),s=y((c=>R(c))),v=y((c=>w(c))),[p,f]=d.useState(!1);if(Y(),d.useEffect((()=>{p||(f(!0),l(H(!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(Se,{navigate:e,approvalUpdateDataView:s,approvalRuleId:o,approverViewData:v,location:t},o??"new")}function Ce(){return u.jsxs(te,{children:[u.jsx(x,{path:"/",element:u.jsx(ve,{})}),u.jsx(x,{path:"/new",element:u.jsx(F,{})}),u.jsx(x,{path:"/:approvalRuleId/edit",element:u.jsx(F,{})}),u.jsx(x,{path:"*",element:u.jsx(ie,{})})]})}export{Ce as B};
|