@zeniai/web-app-ui 5.1.56-dev → 5.1.56-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.
Files changed (62) hide show
  1. package/dist/assets/{AddressRoutes-DOG6BtAE.js → AddressRoutes-DsuoPslx.js} +1 -1
  2. package/dist/assets/{AddressScreen-w3BS5T__.js → AddressScreen-Jgfq0eWZ.js} +1 -1
  3. package/dist/assets/{AiCfoScreen-C4K6FzbI.js → AiCfoScreen-ngmwmSfT.js} +1 -1
  4. package/dist/assets/{BillPayApprovalRoutes-D2l3MfyU.js → BillPayApprovalRoutes-DjjjDtRL.js} +1 -1
  5. package/dist/assets/{BillPayRoutes-puCF7hIb.js → BillPayRoutes-zXfejo42.js} +1 -1
  6. package/dist/assets/{BusinessVerificationPageScreen-BCOKpvnp.js → BusinessVerificationPageScreen-BiV9G1-i.js} +1 -1
  7. package/dist/assets/{CardsAiCfoScreen-DkQHJJyD.js → CardsAiCfoScreen-Z2PndTe3.js} +1 -1
  8. package/dist/assets/{ChargeCardRoutes-Ch4Au-Rk.js → ChargeCardRoutes-CBFlKgnf.js} +1 -1
  9. package/dist/assets/{CompanyPassportScreen-CLNMvqEv.js → CompanyPassportScreen-CE4f1mRO.js} +1 -1
  10. package/dist/assets/{ConnectionAuthScreen-yTkCaoK1.js → ConnectionAuthScreen-BFW2NVDD.js} +1 -1
  11. package/dist/assets/{CustomerOnboardingAuthScreen-DSnDsx1L.js → CustomerOnboardingAuthScreen-DZoaiMvV.js} +1 -1
  12. package/dist/assets/{CustomerOnboardingRoutes-_QxL9WL8.js → CustomerOnboardingRoutes-Doltk1XW.js} +1 -1
  13. package/dist/assets/{DashboardRoutes-BKcrEPsw.js → DashboardRoutes-YclW7oS0.js} +1 -1
  14. package/dist/assets/{DefaultTenantHome-DWIyuza_.js → DefaultTenantHome-cEuyRwZp.js} +1 -1
  15. package/dist/assets/{DomesticWireDetailScreen-CG8HU9uQ.js → DomesticWireDetailScreen-3X6dnm4U.js} +1 -1
  16. package/dist/assets/{DrawerScreen-BkOQSI_V.js → DrawerScreen-DcUdH_zJ.js} +1 -1
  17. package/dist/assets/{EntityDetailRoutes-QX_SVg1Y.js → EntityDetailRoutes-D020FlPl.js} +1 -1
  18. package/dist/assets/{ExpenseAutomationRoutes-BoyNxPcQ.js → ExpenseAutomationRoutes-CTZlVWwO.js} +1 -1
  19. package/dist/assets/{FeaturePreviewScreen-DVS7yzIQ.js → FeaturePreviewScreen-DgqstYkZ.js} +1 -1
  20. package/dist/assets/{HubSpotOAuthCallbackScreen-Dsb1nJdq.js → HubSpotOAuthCallbackScreen-DlnwVV1p.js} +1 -1
  21. package/dist/assets/{MagicLinkRoutes-C4TLmrqp.js → MagicLinkRoutes-C901TSTh.js} +1 -1
  22. package/dist/assets/{MagicLinkSignInScreen-Cp5Vo4Py.js → MagicLinkSignInScreen-DFljjGc3.js} +1 -1
  23. package/dist/assets/{MobileAppDrawer-BzjU__HS.js → MobileAppDrawer-B4f1me8_.js} +1 -1
  24. package/dist/assets/{NotFoundScreen-uCKl6Wx4.js → NotFoundScreen-CxRYls3k.js} +1 -1
  25. package/dist/assets/{NotificationRoutes-CC398QC1.js → NotificationRoutes-Dw__n9YA.js} +1 -1
  26. package/dist/assets/{OAuthConsentScreen-DNPJKfDX.js → OAuthConsentScreen-Ur-mQS8z.js} +1 -1
  27. package/dist/assets/{PandLWithForecastRoutes-C3ftWleu.js → PandLWithForecastRoutes-DSq1hcWm.js} +1 -1
  28. package/dist/assets/{PeopleRoutes-DAFt_Bcx.js → PeopleRoutes-CUtLjfXT.js} +1 -1
  29. package/dist/assets/{PerformanceRoutes-DbR-tZSr.js → PerformanceRoutes-D4zDazyB.js} +1 -1
  30. package/dist/assets/{QBOConnectionScreen-BEi0Zm8x.js → QBOConnectionScreen-CSgGZuyl.js} +1 -1
  31. package/dist/assets/{ReferralListScreen-DUY0_-v6.js → ReferralListScreen-CbCeYBu8.js} +1 -1
  32. package/dist/assets/{ReimbursementApprovalRoutes-Chh2ITQV.js → ReimbursementApprovalRoutes-CQrzmhSh.js} +1 -1
  33. package/dist/assets/{ReimbursementApprovalRuleDetailScreen-CoaTNR2u.js → ReimbursementApprovalRuleDetailScreen-DTZkQzQY.js} +1 -1
  34. package/dist/assets/{ReimbursementRoutes-COtGoxgk.js → ReimbursementRoutes-CzlU6LYx.js} +1 -1
  35. package/dist/assets/{ReportsRoutes-BcPE2nyn.js → ReportsRoutes-D_wjWb18.js} +1 -1
  36. package/dist/assets/{RewardsRoutes-Dok3xTzo.js → RewardsRoutes-Bfg59urI.js} +1 -1
  37. package/dist/assets/{ScreenRoutes-C6QOgyjY.js → ScreenRoutes-D5k4uqAt.js} +2 -2
  38. package/dist/assets/{SettingsRoutes-NVzDxtS7.js → SettingsRoutes-3hV9qN1I.js} +1 -1
  39. package/dist/assets/{SetupPagesScreen-Df4FCfYh.js → SetupPagesScreen-CPey4cOW.js} +1 -1
  40. package/dist/assets/{SignInScreen-DroHIon2.js → SignInScreen-gQzAHzdj.js} +1 -1
  41. package/dist/assets/{SignOutScreen-DoPJci6D.js → SignOutScreen-GvUCBNk6.js} +1 -1
  42. package/dist/assets/{TaskListScreen-NFjvdEWw.js → TaskListScreen-Cuce7GNl.js} +1 -1
  43. package/dist/assets/{TaskRoutes-8aOjIEkV.js → TaskRoutes-DmGo1lNA.js} +1 -1
  44. package/dist/assets/{TransactionDetailRoutes-D3MSXmNL.js → TransactionDetailRoutes-CgKCf_lf.js} +1 -1
  45. package/dist/assets/{TransactionDetailScreen-CSArdLSZ.js → TransactionDetailScreen-CoGsdLTa.js} +1 -1
  46. package/dist/assets/{TransactionListRoutes-UucRW17G.js → TransactionListRoutes-C4QYqCpP.js} +1 -1
  47. package/dist/assets/{TreasuryRoutes-DwgadYGN.js → TreasuryRoutes-jiXgJCAb.js} +1 -1
  48. package/dist/assets/{VendorsRoutes-Im4S2wjo.js → VendorsRoutes-BZFmR2hI.js} +1 -1
  49. package/dist/assets/{WiseConfirmationScreen-C6UoDkmK.js → WiseConfirmationScreen-BLK_tJR5.js} +1 -1
  50. package/dist/assets/{ZeniAccountRoutes-Dczw62ti.js → ZeniAccountRoutes-DVnj5-p6.js} +1 -1
  51. package/dist/assets/{ZeniAccountStatementScreen-prmZg4t5.js → ZeniAccountStatementScreen-3bZVHWI7.js} +1 -1
  52. package/dist/assets/{analyticsHelper-B_k9Kjrd.js → analyticsHelper-BU5wlVa9.js} +1 -1
  53. package/dist/assets/{getLocaleForTenant-CDmBpg_y.js → getLocaleForTenant-Bn16hOPH.js} +1 -1
  54. package/dist/assets/{index-DLAYU8mN.js → index-NcZU0lXl.js} +5 -5
  55. package/dist/assets/{routePaths-CLQbotzs.js → routePaths-DZldr9mG.js} +1 -1
  56. package/dist/assets/{useAiCfoDashboardSuggestedQuestionsChips-Dtkjagus.js → useAiCfoDashboardSuggestedQuestionsChips-DEWGXdch.js} +1 -1
  57. package/dist/assets/{useAskAiCfoHostNavButtonProps-Cw5yceVN.js → useAskAiCfoHostNavButtonProps-DS5Fxq3U.js} +1 -1
  58. package/dist/assets/{useCashManagementBanner-COC9VygZ.js → useCashManagementBanner-CtcuIjhq.js} +1 -1
  59. package/dist/assets/{useInitialThreadRequest-CgLG7-4I.js → useInitialThreadRequest-Bh1NrHII.js} +1 -1
  60. package/dist/assets/{withTransactionSidePanel-Dtr8LlVa.js → withTransactionSidePanel-DxHfrYsZ.js} +1 -1
  61. package/dist/index.html +1 -1
  62. package/package.json +1 -1
@@ -1 +1 @@
1
- import{j as v}from"./liveblocks-BUQfB0Zp.js";import{a as u}from"./sentry-BLIwU6uZ.js";import{u as w,j as b,n as y,g as A,N as L}from"./core-OMb8nkC1.js";import{Lv as N,eV as _,f_ as U,Lw as k,o3 as R,Lx as z}from"./zeni-epic-state-BZ6N8nVI.js";import{u as j,z as f,L as T,t as I,D as O,b as $}from"./index-DLAYU8mN.js";import"./mui-JZY-3hhJ.js";import{t as P}from"./getLocaleForTenant-CDmBpg_y.js";import"./recharts-DAM4r1-u.js";import"./analytics-BLbM2ksu.js";import"./plaid-B_OuebQv.js";import"./dnd-DVcQZAG5.js";import"./stripe-DMRn4zHo.js";import"./lottie-DDI83OWz.js";import"./lexical-CNfNgAkp.js";import"./pdf-6FZlivdz.js";import"./utils-Bia5qc4p.js";(function(){try{var t=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},s=new t.Error().stack;s&&(t._sentryDebugIds=t._sentryDebugIds||{},t._sentryDebugIds[s]="edd8baba-dc9d-4cc0-93e0-776522fd5189",t._sentryDebugIdIdentifier="sentry-dbid-edd8baba-dc9d-4cc0-93e0-776522fd5189")}catch{}})();const Q=y(function(t){return{fetchState:t.tenantState.fetchState,activeTenantFetchState:t.tenantState.activeTenantFetchState.fetchState,currentTenant:_(t),tenantsInOrder:z(t).tenantsInOrder}})(function({fetchState:t,activeTenantFetchState:s,currentTenant:o,tenantsInOrder:h}){const r=A(),p=new URLSearchParams(r.search);if(o==null||t!=="Completed"&&s!=="Completed")return null;{let m="";const n=h.map(l=>l.tenantEmailDomain),i=r.state?.origin,a=r.state?.queryParams;let c=`../${o.tenantEmailDomain}`,d=null,e=!1,g=null,S=null;const C=E(r.pathname);if(C!=null)c=`../${o.tenantEmailDomain}/${C}`,m="comingFromV2UrlPath",C==="ai-cfo/explore"&&(d=p.get("question")?.replace(/^["']|["']$/g,"")??null,e=p.get("should_submit")==="true");else if(i!=null)if(n.reduce((l,F)=>l||i.split("/").find(D=>D===F)!=null,!1))c=i,i.includes("ai-cfo")&&a!=null&&(g=a.aiCfoRef??null,S=a.aiCfoEmailRefId??null);else{const l=E(i);l!=null?(c=`../${o.tenantEmailDomain}/${l}`,m="comingFromV2UrlPath",l==="ai-cfo/explore"&&a!=null&&(a.aiCfoQuestion!=null&&(d=a.aiCfoQuestion),a.aiCfoShouldSubmit==="true"&&(e=!0))):console.warn("Don't have access to previous path tenant!")}const x=$(c,p);return v.jsx(L,{to:x,replace:!0,state:{...r.state,origin:"",message:m,aiCfoInitialQuestion:d,aiCfoShouldSubmit:e,aiCfoRef:g,aiCfoEmailRefId:S}})}});function oe(){const t=w(),{setLoading:s,clearAllLoading:o}=j(),h=u.useRef(!1),r=u.useRef(!1),p=u.useRef(null),m=b(e=>N(e)),n=b(e=>e.tenantState.fetchState),i=b(e=>e.tenantState.error),a=b(e=>e.tenantState.activeTenantFetchState.fetchState),c=b(e=>_(e)),d=f.getSignedInUser();return u.useLayoutEffect(()=>{const e=f.getActiveTenantForUser()?.tenantId??null;p.current!==e&&(p.current=e,h.current=!1,r.current=!1,s(T.TENANT_FETCHING)),!h.current||a!=="Completed"&&a!=="Error"||(h.current=!1),!r.current||n!=="Completed"&&n!=="Error"||(r.current=!1)},[a,n]),u.useEffect(()=>{const e=f.getActiveTenantForUser()?.tenantId;h.current===!1&&d!=null&&e!=null&&I.shouldFetchActiveTenant(e)&&(h.current=!0,I.markActiveTenantFetchStarted(e),n==="Completed"||a!=="Not-Started"&&a!=="Error"||(s(T.TENANT_FETCHING),t(U(d.userId,e))))},[n,a,d,t]),u.useEffect(()=>{const e=f.getSignedInUser(),g=f.getActiveTenantForUser()?.tenantId,S=g==null||a==="Completed"||a==="Error";r.current===!1&&e!=null&&S&&I.shouldFetchAllTenants()&&(r.current=!0,I.markAllTenantsFetchStarted(),(n==="Not-Started"||n==="Error"&&!k(i))&&t(R(e.userId)))},[n,a,i,d,t]),u.useEffect(()=>{f.isSignedIn()&&n==="Completed"&&m.tenantsCoreDetailsInOrder.length>0&&(f.saveSignedInUserTenants(m.tenantsCoreDetailsInOrder),o())},[m.tenantsCoreDetailsInOrder,n]),u.useEffect(()=>{!f.isSignedIn()||n!=="Completed"&&a!=="Completed"||c==null||(O.updateAppLocaleID(P(c)),o())},[n,a,c]),v.jsx(Q,{})}const V=["dashboard/cash-balance","dashboard/card-balance","dashboard/operating-expenses","dashboard/revenue","dashboard/burn-rate","dashboard/cash-position","dashboard/top-expenses","dashboard/cash-in-cash-out","dashboard","reports","forecast","uncategorized-expense","uncategorized-income","missing-receipts","bills","cards/activate","cards","reimbursements","wise","checking","aicfo"],q={"dashboard/cash-balance":"dashboard/cash_balance","dashboard/card-balance":"dashboard/card_balance","dashboard/operating-expenses":"dashboard/operating_expenses","dashboard/revenue":"dashboard/revenue","dashboard/burn-rate":"dashboard/net_burn_or_income","dashboard/cash-position":"dashboard/cash_position","dashboard/top-expenses":"dashboard/top_expenses","dashboard/cash-in-cash-out":"dashboard/cash_in_cash_out",dashboard:"dashboard",reports:"reports",forecast:"forecast","uncategorized-expense":"transactions/uncategorized-expense","uncategorized-income":"transactions/uncategorized-income","missing-receipts":"transactions/missing-receipts",bills:"bills",reimbursements:"reimbursements","cards/activate":"cards/activate",cards:"cards",wise:"bills/wise/callback/link-account",checking:"checking",aicfo:"ai-cfo/explore"};function E(t){for(const s of V)if(t.toLocaleLowerCase().includes(s))return q[s]}export{oe as default};
1
+ import{j as v}from"./liveblocks-BUQfB0Zp.js";import{a as u}from"./sentry-BLIwU6uZ.js";import{u as w,j as b,n as y,g as A,N as L}from"./core-OMb8nkC1.js";import{Lv as N,eV as _,f_ as U,Lw as k,o3 as R,Lx as z}from"./zeni-epic-state-BZ6N8nVI.js";import{u as j,z as f,L as T,t as I,D as O,b as $}from"./index-NcZU0lXl.js";import"./mui-JZY-3hhJ.js";import{t as P}from"./getLocaleForTenant-Bn16hOPH.js";import"./recharts-DAM4r1-u.js";import"./analytics-BLbM2ksu.js";import"./plaid-B_OuebQv.js";import"./dnd-DVcQZAG5.js";import"./stripe-DMRn4zHo.js";import"./lottie-DDI83OWz.js";import"./lexical-CNfNgAkp.js";import"./pdf-6FZlivdz.js";import"./utils-Bia5qc4p.js";(function(){try{var t=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},s=new t.Error().stack;s&&(t._sentryDebugIds=t._sentryDebugIds||{},t._sentryDebugIds[s]="edd8baba-dc9d-4cc0-93e0-776522fd5189",t._sentryDebugIdIdentifier="sentry-dbid-edd8baba-dc9d-4cc0-93e0-776522fd5189")}catch{}})();const Q=y(function(t){return{fetchState:t.tenantState.fetchState,activeTenantFetchState:t.tenantState.activeTenantFetchState.fetchState,currentTenant:_(t),tenantsInOrder:z(t).tenantsInOrder}})(function({fetchState:t,activeTenantFetchState:s,currentTenant:o,tenantsInOrder:h}){const r=A(),p=new URLSearchParams(r.search);if(o==null||t!=="Completed"&&s!=="Completed")return null;{let m="";const n=h.map(l=>l.tenantEmailDomain),i=r.state?.origin,a=r.state?.queryParams;let c=`../${o.tenantEmailDomain}`,d=null,e=!1,g=null,S=null;const C=E(r.pathname);if(C!=null)c=`../${o.tenantEmailDomain}/${C}`,m="comingFromV2UrlPath",C==="ai-cfo/explore"&&(d=p.get("question")?.replace(/^["']|["']$/g,"")??null,e=p.get("should_submit")==="true");else if(i!=null)if(n.reduce((l,F)=>l||i.split("/").find(D=>D===F)!=null,!1))c=i,i.includes("ai-cfo")&&a!=null&&(g=a.aiCfoRef??null,S=a.aiCfoEmailRefId??null);else{const l=E(i);l!=null?(c=`../${o.tenantEmailDomain}/${l}`,m="comingFromV2UrlPath",l==="ai-cfo/explore"&&a!=null&&(a.aiCfoQuestion!=null&&(d=a.aiCfoQuestion),a.aiCfoShouldSubmit==="true"&&(e=!0))):console.warn("Don't have access to previous path tenant!")}const x=$(c,p);return v.jsx(L,{to:x,replace:!0,state:{...r.state,origin:"",message:m,aiCfoInitialQuestion:d,aiCfoShouldSubmit:e,aiCfoRef:g,aiCfoEmailRefId:S}})}});function oe(){const t=w(),{setLoading:s,clearAllLoading:o}=j(),h=u.useRef(!1),r=u.useRef(!1),p=u.useRef(null),m=b(e=>N(e)),n=b(e=>e.tenantState.fetchState),i=b(e=>e.tenantState.error),a=b(e=>e.tenantState.activeTenantFetchState.fetchState),c=b(e=>_(e)),d=f.getSignedInUser();return u.useLayoutEffect(()=>{const e=f.getActiveTenantForUser()?.tenantId??null;p.current!==e&&(p.current=e,h.current=!1,r.current=!1,s(T.TENANT_FETCHING)),!h.current||a!=="Completed"&&a!=="Error"||(h.current=!1),!r.current||n!=="Completed"&&n!=="Error"||(r.current=!1)},[a,n]),u.useEffect(()=>{const e=f.getActiveTenantForUser()?.tenantId;h.current===!1&&d!=null&&e!=null&&I.shouldFetchActiveTenant(e)&&(h.current=!0,I.markActiveTenantFetchStarted(e),n==="Completed"||a!=="Not-Started"&&a!=="Error"||(s(T.TENANT_FETCHING),t(U(d.userId,e))))},[n,a,d,t]),u.useEffect(()=>{const e=f.getSignedInUser(),g=f.getActiveTenantForUser()?.tenantId,S=g==null||a==="Completed"||a==="Error";r.current===!1&&e!=null&&S&&I.shouldFetchAllTenants()&&(r.current=!0,I.markAllTenantsFetchStarted(),(n==="Not-Started"||n==="Error"&&!k(i))&&t(R(e.userId)))},[n,a,i,d,t]),u.useEffect(()=>{f.isSignedIn()&&n==="Completed"&&m.tenantsCoreDetailsInOrder.length>0&&(f.saveSignedInUserTenants(m.tenantsCoreDetailsInOrder),o())},[m.tenantsCoreDetailsInOrder,n]),u.useEffect(()=>{!f.isSignedIn()||n!=="Completed"&&a!=="Completed"||c==null||(O.updateAppLocaleID(P(c)),o())},[n,a,c]),v.jsx(Q,{})}const V=["dashboard/cash-balance","dashboard/card-balance","dashboard/operating-expenses","dashboard/revenue","dashboard/burn-rate","dashboard/cash-position","dashboard/top-expenses","dashboard/cash-in-cash-out","dashboard","reports","forecast","uncategorized-expense","uncategorized-income","missing-receipts","bills","cards/activate","cards","reimbursements","wise","checking","aicfo"],q={"dashboard/cash-balance":"dashboard/cash_balance","dashboard/card-balance":"dashboard/card_balance","dashboard/operating-expenses":"dashboard/operating_expenses","dashboard/revenue":"dashboard/revenue","dashboard/burn-rate":"dashboard/net_burn_or_income","dashboard/cash-position":"dashboard/cash_position","dashboard/top-expenses":"dashboard/top_expenses","dashboard/cash-in-cash-out":"dashboard/cash_in_cash_out",dashboard:"dashboard",reports:"reports",forecast:"forecast","uncategorized-expense":"transactions/uncategorized-expense","uncategorized-income":"transactions/uncategorized-income","missing-receipts":"transactions/missing-receipts",bills:"bills",reimbursements:"reimbursements","cards/activate":"cards/activate",cards:"cards",wise:"bills/wise/callback/link-account",checking:"checking",aicfo:"ai-cfo/explore"};function E(t){for(const s of V)if(t.toLocaleLowerCase().includes(s))return q[s]}export{oe as default};
@@ -1,4 +1,4 @@
1
- import{j as l}from"./liveblocks-BUQfB0Zp.js";import{h as w,g as C,j as h,n as P,i as V}from"./core-OMb8nkC1.js";import{Pw as k,PD as q,ge as J,gd as M,gc as W,jn as K,ME as L,rn as Q,eV as B,P2 as D,jl as j,Px as S,PG as F,jj as G,jG as T}from"./zeni-epic-state-BZ6N8nVI.js";import{bw as X,J as R,a as N,z as U,m as O,q as p,F as v,B as Z,bx as Y,o as z,by as ee,s as te}from"./index-DLAYU8mN.js";import{n as H}from"./mui-JZY-3hhJ.js";import"./sentry-BLIwU6uZ.js";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="887bc821-b10f-4866-bb3e-8e05c0214a0e",e._sentryDebugIdIdentifier="sentry-dbid-887bc821-b10f-4866-bb3e-8e05c0214a0e")}catch{}})();const ne=P(null,function(e,t){return{onSaveVendor:n=>{e(K(t.vendorId!==void 0?t.vendorId:void 0,t.billId,void 0,t.isExpressPayPage)),e(L("common")),n!=null&&e(Q(n))},onGetOtp:n=>{e(W(n,"BillPayVendor"))},onResendOtp:n=>{e(M(n,"BillPayVendor"))},onVerifyOtp:(n,a)=>{e(J(n,a,"BillPayVendor"))},onVerifyOtpSuccess:(n,a,o)=>{e(q(n,a,o))}}})(X);function _({vendorId:e,billId:t,isExpressPayPage:n}){const a=w(),o=C(),s=h(r=>k(r,e));return l.jsx(ne,{location:o,navigate:a,vendorId:e,billId:t,vendorViewDetails:s,isExpressPayPage:n??!1})}const ae=H.div`
1
+ import{j as l}from"./liveblocks-BUQfB0Zp.js";import{h as w,g as C,j as h,n as P,i as V}from"./core-OMb8nkC1.js";import{Pw as k,PD as q,ge as J,gd as M,gc as W,jn as K,ME as L,rn as Q,eV as B,P2 as D,jl as j,Px as S,PG as F,jj as G,jG as T}from"./zeni-epic-state-BZ6N8nVI.js";import{bw as X,J as R,a as N,z as U,m as O,q as p,F as v,B as Z,bx as Y,o as z,by as ee,s as te}from"./index-NcZU0lXl.js";import{n as H}from"./mui-JZY-3hhJ.js";import"./sentry-BLIwU6uZ.js";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="887bc821-b10f-4866-bb3e-8e05c0214a0e",e._sentryDebugIdIdentifier="sentry-dbid-887bc821-b10f-4866-bb3e-8e05c0214a0e")}catch{}})();const ne=P(null,function(e,t){return{onSaveVendor:n=>{e(K(t.vendorId!==void 0?t.vendorId:void 0,t.billId,void 0,t.isExpressPayPage)),e(L("common")),n!=null&&e(Q(n))},onGetOtp:n=>{e(W(n,"BillPayVendor"))},onResendOtp:n=>{e(M(n,"BillPayVendor"))},onVerifyOtp:(n,a)=>{e(J(n,a,"BillPayVendor"))},onVerifyOtpSuccess:(n,a,o)=>{e(q(n,a,o))}}})(X);function _({vendorId:e,billId:t,isExpressPayPage:n}){const a=w(),o=C(),s=h(r=>k(r,e));return l.jsx(ne,{location:o,navigate:a,vendorId:e,billId:t,vendorViewDetails:s,isExpressPayPage:n??!1})}const ae=H.div`
2
2
  display: flex;
3
3
  height: 100vh;
4
4
  width: 100%;
@@ -1 +1 @@
1
- import{j as i}from"./liveblocks-BUQfB0Zp.js";import{J as f,A as l,m as c}from"./index-DLAYU8mN.js";import{D as b}from"./mui-JZY-3hhJ.js";import"./sentry-BLIwU6uZ.js";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},r=new e.Error().stack;r&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[r]="55f76821-2be0-486b-a7fc-493ddb9425df",e._sentryDebugIdIdentifier="sentry-dbid-55f76821-2be0-486b-a7fc-493ddb9425df")}catch{}})();const p={drawerLeftMargin:new l(0,0,240)};function m(e){const{isOpen:r,drawerLeftMargin:o,children:t,onClose:s}=e,n=f(),d=o?.valuePx(n)??p.drawerLeftMargin.valuePx(n),a=c();return i.jsx(b,{anchor:"right",open:r,PaperProps:{style:{width:`calc(100% - ${d})`}},slotProps:{backdrop:{style:{backgroundColor:a.colors.black,opacity:.8,cursor:"pointer"}}},onClose:s,children:t})}export{m as D};
1
+ import{j as i}from"./liveblocks-BUQfB0Zp.js";import{J as f,A as l,m as c}from"./index-NcZU0lXl.js";import{D as b}from"./mui-JZY-3hhJ.js";import"./sentry-BLIwU6uZ.js";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},r=new e.Error().stack;r&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[r]="55f76821-2be0-486b-a7fc-493ddb9425df",e._sentryDebugIdIdentifier="sentry-dbid-55f76821-2be0-486b-a7fc-493ddb9425df")}catch{}})();const p={drawerLeftMargin:new l(0,0,240)};function m(e){const{isOpen:r,drawerLeftMargin:o,children:t,onClose:s}=e,n=f(),d=o?.valuePx(n)??p.drawerLeftMargin.valuePx(n),a=c();return i.jsx(b,{anchor:"right",open:r,PaperProps:{style:{width:`calc(100% - ${d})`}},slotProps:{backdrop:{style:{backgroundColor:a.colors.black,opacity:.8,cursor:"pointer"}}},onClose:s,children:t})}export{m as D};
@@ -1 +1 @@
1
- import{j as s}from"./liveblocks-BUQfB0Zp.js";import{a as d}from"./sentry-BLIwU6uZ.js";import{h as w,u as A,g as G,i as B,j as l,N as M,n as F,o as O,p as R}from"./core-OMb8nkC1.js";import{NM as _,eV as J,N8 as V,lq as W,JN as I,NR as Y,MD as $,kq as z,JO as S,Nd as H,Ne as K,MF as L,ME as Q}from"./zeni-epic-state-BZ6N8nVI.js";import{aS as U,d as X,q as Z,s as tt}from"./index-DLAYU8mN.js";import"./mui-JZY-3hhJ.js";import{d as k}from"./decodeURIComponentSafe-CrZYJ6cg.js";import{w as et}from"./withTransactionSidePanel-Dtr8LlVa.js";import{f as at,c as nt}from"./routePaths-CLQbotzs.js";import"./recharts-DAM4r1-u.js";import"./analytics-BLbM2ksu.js";import"./plaid-B_OuebQv.js";import"./dnd-DVcQZAG5.js";import"./stripe-DMRn4zHo.js";import"./lottie-DDI83OWz.js";import"./lexical-CNfNgAkp.js";import"./pdf-6FZlivdz.js";import"./utils-Bia5qc4p.js";import"./useAskAiCfoHostNavButtonProps-Cw5yceVN.js";import"./TransactionDetailScreen-CSArdLSZ.js";(function(){try{var a=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new a.Error().stack;t&&(a._sentryDebugIds=a._sentryDebugIds||{},a._sentryDebugIds[t]="8c50f047-0772-4e32-8aa9-8caf2a170829",a._sentryDebugIdIdentifier="sentry-dbid-8c50f047-0772-4e32-8aa9-8caf2a170829")}catch{}})();const ot=F(function(a,t){const e=t.entity,o=Y(a,t.entity,"EntityDetail");return{selectedEntity:e,autoCompleteData:{autoCompleteText:e.name,entityAutoCompleteView:$(a,"common")},trendWithTransactionsReport:o,analytics:X,isAccountingClassesEnabled:z(a)}},function(a,t){return{onTransactionItemClick:e=>{if(t.openTransactionPanel)return void t.openTransactionPanel(e.id,e.type);const o=`${nt(e,t.tenantEmailDomain)}`,c=tt(t.location.state?.pathnameStackToGoBack,t.location.pathname);t.navigate(o,{state:{pathnameStackToGoBack:c}})},autoCompleteActions:{onAutoCompleteInputChange:e=>{e.trim().length>=2?a(L({searchString:e,searchOrigin:"common"})):e.trim().length===0&&a(Q("common"))},onAutoCompleteEntity:e=>{const o=at(e,t.tenantEmailDomain);a(H()),a(K()),t.resetTrendIsFetchedStates(),t.navigate(o,{replace:!0,state:{pathnameStackToGoBack:t.location.state?.pathnameStackToGoBack}})},onCancelAutoComplete:()=>{const e=Z(t.location.state?.pathnameStackToGoBack),o=e.poppedPathname??C();t.navigate(o,{state:{pathnameStackToGoBack:e.newStack}})}},onTrendSelectedPeriodChange:e=>{if(t.closeSidePanel?.(),e==null)t.defaultTransactionTimePeriod!=null&&a(S(t.entity,"EntityDetail",{timeframe:"quarter",timePeriod:t.defaultTransactionTimePeriod}));else{const o=e.currentTimePeriod==null?e.addTimePeriod:{startDate:e.addTimePeriod.startDate,endDate:e.currentTimePeriod.endDate};a(I(t.entity,"EntityDetail",{timeframe:e.timeframe,timePeriod:e.addTimePeriod})),a(S(t.entity,"EntityDetail",{timeframe:e.timeframe,timePeriod:o}))}}}})(U),it=et(function({entityType:a,...t}){const e=w(),o=A(),c=G(),[m,T]=d.useState(!1),[h,D]=d.useState(!1),{tenantEmailDomain:b,entityIdEncoded:x,entityNameEncoded:N}=B(),r=k(x??""),p=k(N??""),f=rt(r,p),j=[r,p].filter(n=>n!=null),i={name:p,id:r,type:a,zeniId:r,qboId:r},g=l(n=>_(n.customerIncomeState,n.vendorExpenseState,n.trendState,i,"quarter")),q=l(n=>J(n).company?.companyInfo.firstMonthOfFY??1),u=l(n=>V(n.trendWithTransactionsState,i,"EntityDetail"));d.useEffect(()=>{m===!1&&f===!0&&(T(!0),o(W(i)))},[m,f,i]);const E=l(n=>n.trendState.fetchState),P=u?.selectedPeriod?.timePeriod??g,v=function(n,y){return n!=null&&y!=null?{startDate:n.startDate,endDate:y?.endDate}:y}(u?.selectedPeriod?.timePeriod,g);return d.useEffect(()=>{m===!0&&h===!1&&E==="Completed"&&(D(!0),P!=null&&o(I(i,"EntityDetail",{timeframe:u?.selectedPeriod?.timeframe??"quarter",timePeriod:P})))},[m,h,E]),f?s.jsx(ot,{firstMonthOfFY:q,tenantEmailDomain:b,location:c,navigate:e,entity:i,defaultTransactionTimePeriod:v,resetTrendIsFetchedStates:()=>{T(!1),D(!1)},...t}):s.jsx(M,{to:C(j.length)})}),rt=(a,t)=>t!=null&&t.length>0&&a!=null&&a.length>0,C=(a=2)=>{let t="../";for(let e=0;e<a;e++)t=`${t}../`;return t};function xt({entityType:a}){return s.jsx(O,{children:s.jsx(R,{path:"/:entityIdEncoded/:entityNameEncoded/*",element:s.jsx(it,{entityType:a})})})}export{xt as EntityDetailRoutes,xt as default};
1
+ import{j as s}from"./liveblocks-BUQfB0Zp.js";import{a as d}from"./sentry-BLIwU6uZ.js";import{h as w,u as A,g as G,i as B,j as l,N as M,n as F,o as O,p as R}from"./core-OMb8nkC1.js";import{NM as _,eV as J,N8 as V,lq as W,JN as I,NR as Y,MD as $,kq as z,JO as S,Nd as H,Ne as K,MF as L,ME as Q}from"./zeni-epic-state-BZ6N8nVI.js";import{aS as U,d as X,q as Z,s as tt}from"./index-NcZU0lXl.js";import"./mui-JZY-3hhJ.js";import{d as k}from"./decodeURIComponentSafe-CrZYJ6cg.js";import{w as et}from"./withTransactionSidePanel-DxHfrYsZ.js";import{f as at,c as nt}from"./routePaths-DZldr9mG.js";import"./recharts-DAM4r1-u.js";import"./analytics-BLbM2ksu.js";import"./plaid-B_OuebQv.js";import"./dnd-DVcQZAG5.js";import"./stripe-DMRn4zHo.js";import"./lottie-DDI83OWz.js";import"./lexical-CNfNgAkp.js";import"./pdf-6FZlivdz.js";import"./utils-Bia5qc4p.js";import"./useAskAiCfoHostNavButtonProps-DS5Fxq3U.js";import"./TransactionDetailScreen-CoGsdLTa.js";(function(){try{var a=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new a.Error().stack;t&&(a._sentryDebugIds=a._sentryDebugIds||{},a._sentryDebugIds[t]="8c50f047-0772-4e32-8aa9-8caf2a170829",a._sentryDebugIdIdentifier="sentry-dbid-8c50f047-0772-4e32-8aa9-8caf2a170829")}catch{}})();const ot=F(function(a,t){const e=t.entity,o=Y(a,t.entity,"EntityDetail");return{selectedEntity:e,autoCompleteData:{autoCompleteText:e.name,entityAutoCompleteView:$(a,"common")},trendWithTransactionsReport:o,analytics:X,isAccountingClassesEnabled:z(a)}},function(a,t){return{onTransactionItemClick:e=>{if(t.openTransactionPanel)return void t.openTransactionPanel(e.id,e.type);const o=`${nt(e,t.tenantEmailDomain)}`,c=tt(t.location.state?.pathnameStackToGoBack,t.location.pathname);t.navigate(o,{state:{pathnameStackToGoBack:c}})},autoCompleteActions:{onAutoCompleteInputChange:e=>{e.trim().length>=2?a(L({searchString:e,searchOrigin:"common"})):e.trim().length===0&&a(Q("common"))},onAutoCompleteEntity:e=>{const o=at(e,t.tenantEmailDomain);a(H()),a(K()),t.resetTrendIsFetchedStates(),t.navigate(o,{replace:!0,state:{pathnameStackToGoBack:t.location.state?.pathnameStackToGoBack}})},onCancelAutoComplete:()=>{const e=Z(t.location.state?.pathnameStackToGoBack),o=e.poppedPathname??C();t.navigate(o,{state:{pathnameStackToGoBack:e.newStack}})}},onTrendSelectedPeriodChange:e=>{if(t.closeSidePanel?.(),e==null)t.defaultTransactionTimePeriod!=null&&a(S(t.entity,"EntityDetail",{timeframe:"quarter",timePeriod:t.defaultTransactionTimePeriod}));else{const o=e.currentTimePeriod==null?e.addTimePeriod:{startDate:e.addTimePeriod.startDate,endDate:e.currentTimePeriod.endDate};a(I(t.entity,"EntityDetail",{timeframe:e.timeframe,timePeriod:e.addTimePeriod})),a(S(t.entity,"EntityDetail",{timeframe:e.timeframe,timePeriod:o}))}}}})(U),it=et(function({entityType:a,...t}){const e=w(),o=A(),c=G(),[m,T]=d.useState(!1),[h,D]=d.useState(!1),{tenantEmailDomain:b,entityIdEncoded:x,entityNameEncoded:N}=B(),r=k(x??""),p=k(N??""),f=rt(r,p),j=[r,p].filter(n=>n!=null),i={name:p,id:r,type:a,zeniId:r,qboId:r},g=l(n=>_(n.customerIncomeState,n.vendorExpenseState,n.trendState,i,"quarter")),q=l(n=>J(n).company?.companyInfo.firstMonthOfFY??1),u=l(n=>V(n.trendWithTransactionsState,i,"EntityDetail"));d.useEffect(()=>{m===!1&&f===!0&&(T(!0),o(W(i)))},[m,f,i]);const E=l(n=>n.trendState.fetchState),P=u?.selectedPeriod?.timePeriod??g,v=function(n,y){return n!=null&&y!=null?{startDate:n.startDate,endDate:y?.endDate}:y}(u?.selectedPeriod?.timePeriod,g);return d.useEffect(()=>{m===!0&&h===!1&&E==="Completed"&&(D(!0),P!=null&&o(I(i,"EntityDetail",{timeframe:u?.selectedPeriod?.timeframe??"quarter",timePeriod:P})))},[m,h,E]),f?s.jsx(ot,{firstMonthOfFY:q,tenantEmailDomain:b,location:c,navigate:e,entity:i,defaultTransactionTimePeriod:v,resetTrendIsFetchedStates:()=>{T(!1),D(!1)},...t}):s.jsx(M,{to:C(j.length)})}),rt=(a,t)=>t!=null&&t.length>0&&a!=null&&a.length>0,C=(a=2)=>{let t="../";for(let e=0;e<a;e++)t=`${t}../`;return t};function xt({entityType:a}){return s.jsx(O,{children:s.jsx(R,{path:"/:entityIdEncoded/:entityNameEncoded/*",element:s.jsx(it,{entityType:a})})})}export{xt as EntityDetailRoutes,xt as default};
@@ -1,4 +1,4 @@
1
- import{j as h}from"./liveblocks-BUQfB0Zp.js";import oa from"./NotFoundScreen-uCKl6Wx4.js";import{a as o,b as Jt}from"./sentry-BLIwU6uZ.js";import{n as Ue,S as sa}from"./mui-JZY-3hhJ.js";import{u as pe,h as Yt,g as Qe,j as P,n as ca,i as Pt,o as ia,p as Ge}from"./core-OMb8nkC1.js";import{eV as xe,Sy as la,od as Ee,fV as ra,r_ as da,ov as Qt,oQ as Zt,Sz as Kt,o_ as ua,SA as Wt,oo as ma,rw as pa,fF as Ie,SB as De,tY as Ht,E6 as Xt,SC as en,SD as ha,r4 as Ze,NN as Rt,NP as Sa,kt as ga,NQ as Ca,kA as fa,cZ as Ia,v8 as Ke,oB as tn,p3 as Fe,ot as de,SE as Ea,MF as xt,ME as we,SF as Dt,kR as ka,SG as ya,SH as ba,SI as Ta,SJ as va,oI as Aa,p6 as Pe,SK as wa,SL as Pa,SM as Ra,pd as xa,kE as Da,kv as Fa,SN as Ua,kD as Ft,NX as Ba,SO as Va,SP as _a,r0 as Oa,qE as za,p4 as me,qD as Ne,SQ as Ma,SR as ja,SS as La,m8 as $a,bo as qa,m3 as Ut,lR as Ga,ST as Na,fv as Bt,gu as Ja,m0 as Ya,x1 as Qa,SU as Za,pE as Ka,pz as Wa,pD as Ha,po as Xa,SV as eo,fI as nn,oT as to,oE as no,fW as Vt,p8 as ao,SW as oo,SX as so,p5 as an,SY as co,SZ as io,S_ as lo,S$ as ro,T0 as _t,rc as uo,qv as mo,MD as po,T1 as ho,T2 as So,kC as go,T3 as Co,IO as fo,kB as Io,kq as Eo,fH as ko,q1 as on,qn as yo,p2 as Ot,p7 as bo,bE as To,lZ as vo,lW as Ao,T4 as wo,pn as zt,qj as Mt,qh as Po,T5 as Ro,q6 as xo,pO as Do,qk as Fo,T6 as Uo,T7 as Bo,pS as Vo,T8 as _o,pJ as Oo,pR as zo,pP as Mo,qq as jo}from"./zeni-epic-state-BZ6N8nVI.js";import{a as sn,F as X,d as q,s as ae,W as cn,_ as ln,cX as Lo,z as Be,cY as $o,at as Re,cZ as qo,aU as jt,B as rn,c_ as Go,aq as Je,D as No,a7 as Jo,c$ as Yo,a2 as Qo,d0 as Zo,V as Ko,d1 as Wo,d2 as Ho,Z as Xo,j as es,aN as ts,d3 as ns,d4 as as,b9 as os,A as ss,aQ as cs}from"./index-DLAYU8mN.js";import{u as dn}from"./useAskAiCfoHostNavButtonProps-Cw5yceVN.js";import{f as Lt,a as is,b as ls,g as rs,C as ds}from"./TransactionDetailScreen-CSArdLSZ.js";import{w as us}from"./withTransactionSidePanel-Dtr8LlVa.js";import{h as ms,v as ps}from"./routePaths-CLQbotzs.js";import{g as Ye}from"./accountMappingHelper-DS9ya8eF.js";import{D as hs}from"./DrawerScreen-BkOQSI_V.js";import"./recharts-DAM4r1-u.js";import"./analytics-BLbM2ksu.js";import"./plaid-B_OuebQv.js";import"./dnd-DVcQZAG5.js";import"./stripe-DMRn4zHo.js";import"./lottie-DDI83OWz.js";import"./lexical-CNfNgAkp.js";import"./pdf-6FZlivdz.js";import"./utils-Bia5qc4p.js";import"./decodeURIComponentSafe-CrZYJ6cg.js";(function(){try{var t=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},l=new t.Error().stack;l&&(t._sentryDebugIds=t._sentryDebugIds||{},t._sentryDebugIds[l]="8deb561b-d87f-4ab8-baea-4d0fec62d9ad",t._sentryDebugIdIdentifier="sentry-dbid-8deb561b-d87f-4ab8-baea-4d0fec62d9ad")}catch{}})();const Ss=()=>{const t=pe(),l=Yt(),B=Qe(),f=P(d=>xe(d)),{useFeatureGate:T}=sn(),{isFeatureEnabled:C}=T(X.isRealtimeInsightsFeatureEnabled),{isFeatureEnabled:r}=T(X.aiAuditScorePercentage),I=P(d=>d.expenseAutomationViewState.selectedPeriodByTenantId),s=P(d=>la(d,f.tenantId)),{isAiCfoAccessEnabled:p,onAskAiCfoClick:u}=dn({mobileExploreReferrer:"Month-End Close Overview"}),k=o.useCallback((d,G,ee=!1)=>{t(Ee({tenantId:G,period:{month:d.month,year:d.year},refreshViewInBackground:ee}))},[]),v=o.useCallback(d=>{const G=B.state?.referrer;s.monthEndCloseChecks?.auditSummary!=null&&q.trackMonthCloseAuditPage(d.month,d.year,s.monthEndCloseChecks.reportEmailSentDate!=null?"closed":"in-review",s.monthEndCloseChecks.auditSummary.auditScorePercentage,!1,G??null),t(ra(f.tenantId,d))},[f.tenantId,s.monthEndCloseChecks?.auditSummary,s.monthEndCloseChecks?.reportEmailSentDate]),S=I[f.tenantId],m=o.useCallback(()=>{const d=B.state?.referrer;s.monthEndCloseChecks?.auditSummary!=null&&q.trackMonthCloseAuditPage(S.month,S.year,s.monthEndCloseChecks.reportEmailSentDate!=null?"closed":"in-review",s.monthEndCloseChecks.auditSummary.auditScorePercentage,!0,d??null),k(S,f.tenantId,!0)},[k,S,f.tenantId,s.monthEndCloseChecks?.auditSummary,s.monthEndCloseChecks?.reportEmailSentDate]),R=ae(B.state?.pathnameStackToGoBack,B.pathname),E=o.useCallback(()=>{if(s.monthEndCloseChecks!=null&&S!=null){const d=s.monthEndCloseChecks.monthEndCloseCheckList.find(G=>G.progress<100);if(d!=null)return void l(`./${d.id}/${S.month}-${S.year}`,{state:{pathnameStackToGoBack:R,message:"comingFromOverview"}});l(`./month_end_insights/${S.month}-${S.year}`,{state:{pathnameStackToGoBack:R,message:"comingFromOverview"}})}},[s.monthEndCloseChecks,S]),{areTenantIdsInSync:y}=cn();return ln({isDataReady:s.fetchState==="Completed"}),o.useEffect(()=>{S!=null&&s.fetchState!=="In-Progress"&&s.fetchState!=="Completed"&&y&&k(S,f.tenantId)},[k,S,s.fetchState,f.tenantId,y]),o.useEffect(()=>{S!=null&&s.monthClosePerformanceTrendFetchStatus.fetchState!=="In-Progress"&&s.monthClosePerformanceTrendFetchStatus.fetchState!=="Completed"&&y&&t(da(S))},[S,s.monthClosePerformanceTrendFetchStatus.fetchState,y]),o.useEffect(()=>{const d=setInterval(()=>{s.fetchState!=="In-Progress"&&s.fetchState==="Completed"&&m()},3e5);return()=>clearInterval(d)},[s.fetchState]),o.useEffect(()=>{if(s.fetchState==="Completed"&&s.monthEndCloseChecks?.auditSummary!=null){const d=B.state?.referrer;q.trackMonthCloseAuditPage(s.selectedPeriod.month,s.selectedPeriod.year,s.monthEndCloseChecks.reportEmailSentDate!=null?"closed":"in-review",s.monthEndCloseChecks.auditSummary.auditScorePercentage,!1,d??null)}},[s.fetchState,s.selectedPeriod,s.monthEndCloseChecks?.auditSummary,s.monthEndCloseChecks?.reportEmailSentDate]),h.jsx(gs,{children:h.jsx(Lo,{monthEndCloseChecksView:s,isRealtimeInsightsFeatureEnabled:C,onMonthEndCheckClick:d=>{l(`./${d}/${S.month}-${S.year}`,{state:{pathnameStackToGoBack:R,message:"comingFromOverview",referrer:"Expense Automation - Overview"}})},onPeriodChange:v,handleReviewButtonClick:E,onBackClick:()=>{l("../../dashboard")},onReload:m,isAiCfoAccessEnabled:p,onAskAiCfoClick:u,aiAuditScorePercentageEnabled:r})})},gs=Ue.div`
1
+ import{j as h}from"./liveblocks-BUQfB0Zp.js";import oa from"./NotFoundScreen-CxRYls3k.js";import{a as o,b as Jt}from"./sentry-BLIwU6uZ.js";import{n as Ue,S as sa}from"./mui-JZY-3hhJ.js";import{u as pe,h as Yt,g as Qe,j as P,n as ca,i as Pt,o as ia,p as Ge}from"./core-OMb8nkC1.js";import{eV as xe,Sy as la,od as Ee,fV as ra,r_ as da,ov as Qt,oQ as Zt,Sz as Kt,o_ as ua,SA as Wt,oo as ma,rw as pa,fF as Ie,SB as De,tY as Ht,E6 as Xt,SC as en,SD as ha,r4 as Ze,NN as Rt,NP as Sa,kt as ga,NQ as Ca,kA as fa,cZ as Ia,v8 as Ke,oB as tn,p3 as Fe,ot as de,SE as Ea,MF as xt,ME as we,SF as Dt,kR as ka,SG as ya,SH as ba,SI as Ta,SJ as va,oI as Aa,p6 as Pe,SK as wa,SL as Pa,SM as Ra,pd as xa,kE as Da,kv as Fa,SN as Ua,kD as Ft,NX as Ba,SO as Va,SP as _a,r0 as Oa,qE as za,p4 as me,qD as Ne,SQ as Ma,SR as ja,SS as La,m8 as $a,bo as qa,m3 as Ut,lR as Ga,ST as Na,fv as Bt,gu as Ja,m0 as Ya,x1 as Qa,SU as Za,pE as Ka,pz as Wa,pD as Ha,po as Xa,SV as eo,fI as nn,oT as to,oE as no,fW as Vt,p8 as ao,SW as oo,SX as so,p5 as an,SY as co,SZ as io,S_ as lo,S$ as ro,T0 as _t,rc as uo,qv as mo,MD as po,T1 as ho,T2 as So,kC as go,T3 as Co,IO as fo,kB as Io,kq as Eo,fH as ko,q1 as on,qn as yo,p2 as Ot,p7 as bo,bE as To,lZ as vo,lW as Ao,T4 as wo,pn as zt,qj as Mt,qh as Po,T5 as Ro,q6 as xo,pO as Do,qk as Fo,T6 as Uo,T7 as Bo,pS as Vo,T8 as _o,pJ as Oo,pR as zo,pP as Mo,qq as jo}from"./zeni-epic-state-BZ6N8nVI.js";import{a as sn,F as X,d as q,s as ae,W as cn,_ as ln,cX as Lo,z as Be,cY as $o,at as Re,cZ as qo,aU as jt,B as rn,c_ as Go,aq as Je,D as No,a7 as Jo,c$ as Yo,a2 as Qo,d0 as Zo,V as Ko,d1 as Wo,d2 as Ho,Z as Xo,j as es,aN as ts,d3 as ns,d4 as as,b9 as os,A as ss,aQ as cs}from"./index-NcZU0lXl.js";import{u as dn}from"./useAskAiCfoHostNavButtonProps-DS5Fxq3U.js";import{f as Lt,a as is,b as ls,g as rs,C as ds}from"./TransactionDetailScreen-CoGsdLTa.js";import{w as us}from"./withTransactionSidePanel-DxHfrYsZ.js";import{h as ms,v as ps}from"./routePaths-DZldr9mG.js";import{g as Ye}from"./accountMappingHelper-DS9ya8eF.js";import{D as hs}from"./DrawerScreen-DcUdH_zJ.js";import"./recharts-DAM4r1-u.js";import"./analytics-BLbM2ksu.js";import"./plaid-B_OuebQv.js";import"./dnd-DVcQZAG5.js";import"./stripe-DMRn4zHo.js";import"./lottie-DDI83OWz.js";import"./lexical-CNfNgAkp.js";import"./pdf-6FZlivdz.js";import"./utils-Bia5qc4p.js";import"./decodeURIComponentSafe-CrZYJ6cg.js";(function(){try{var t=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},l=new t.Error().stack;l&&(t._sentryDebugIds=t._sentryDebugIds||{},t._sentryDebugIds[l]="8deb561b-d87f-4ab8-baea-4d0fec62d9ad",t._sentryDebugIdIdentifier="sentry-dbid-8deb561b-d87f-4ab8-baea-4d0fec62d9ad")}catch{}})();const Ss=()=>{const t=pe(),l=Yt(),B=Qe(),f=P(d=>xe(d)),{useFeatureGate:T}=sn(),{isFeatureEnabled:C}=T(X.isRealtimeInsightsFeatureEnabled),{isFeatureEnabled:r}=T(X.aiAuditScorePercentage),I=P(d=>d.expenseAutomationViewState.selectedPeriodByTenantId),s=P(d=>la(d,f.tenantId)),{isAiCfoAccessEnabled:p,onAskAiCfoClick:u}=dn({mobileExploreReferrer:"Month-End Close Overview"}),k=o.useCallback((d,G,ee=!1)=>{t(Ee({tenantId:G,period:{month:d.month,year:d.year},refreshViewInBackground:ee}))},[]),v=o.useCallback(d=>{const G=B.state?.referrer;s.monthEndCloseChecks?.auditSummary!=null&&q.trackMonthCloseAuditPage(d.month,d.year,s.monthEndCloseChecks.reportEmailSentDate!=null?"closed":"in-review",s.monthEndCloseChecks.auditSummary.auditScorePercentage,!1,G??null),t(ra(f.tenantId,d))},[f.tenantId,s.monthEndCloseChecks?.auditSummary,s.monthEndCloseChecks?.reportEmailSentDate]),S=I[f.tenantId],m=o.useCallback(()=>{const d=B.state?.referrer;s.monthEndCloseChecks?.auditSummary!=null&&q.trackMonthCloseAuditPage(S.month,S.year,s.monthEndCloseChecks.reportEmailSentDate!=null?"closed":"in-review",s.monthEndCloseChecks.auditSummary.auditScorePercentage,!0,d??null),k(S,f.tenantId,!0)},[k,S,f.tenantId,s.monthEndCloseChecks?.auditSummary,s.monthEndCloseChecks?.reportEmailSentDate]),R=ae(B.state?.pathnameStackToGoBack,B.pathname),E=o.useCallback(()=>{if(s.monthEndCloseChecks!=null&&S!=null){const d=s.monthEndCloseChecks.monthEndCloseCheckList.find(G=>G.progress<100);if(d!=null)return void l(`./${d.id}/${S.month}-${S.year}`,{state:{pathnameStackToGoBack:R,message:"comingFromOverview"}});l(`./month_end_insights/${S.month}-${S.year}`,{state:{pathnameStackToGoBack:R,message:"comingFromOverview"}})}},[s.monthEndCloseChecks,S]),{areTenantIdsInSync:y}=cn();return ln({isDataReady:s.fetchState==="Completed"}),o.useEffect(()=>{S!=null&&s.fetchState!=="In-Progress"&&s.fetchState!=="Completed"&&y&&k(S,f.tenantId)},[k,S,s.fetchState,f.tenantId,y]),o.useEffect(()=>{S!=null&&s.monthClosePerformanceTrendFetchStatus.fetchState!=="In-Progress"&&s.monthClosePerformanceTrendFetchStatus.fetchState!=="Completed"&&y&&t(da(S))},[S,s.monthClosePerformanceTrendFetchStatus.fetchState,y]),o.useEffect(()=>{const d=setInterval(()=>{s.fetchState!=="In-Progress"&&s.fetchState==="Completed"&&m()},3e5);return()=>clearInterval(d)},[s.fetchState]),o.useEffect(()=>{if(s.fetchState==="Completed"&&s.monthEndCloseChecks?.auditSummary!=null){const d=B.state?.referrer;q.trackMonthCloseAuditPage(s.selectedPeriod.month,s.selectedPeriod.year,s.monthEndCloseChecks.reportEmailSentDate!=null?"closed":"in-review",s.monthEndCloseChecks.auditSummary.auditScorePercentage,!1,d??null)}},[s.fetchState,s.selectedPeriod,s.monthEndCloseChecks?.auditSummary,s.monthEndCloseChecks?.reportEmailSentDate]),h.jsx(gs,{children:h.jsx(Lo,{monthEndCloseChecksView:s,isRealtimeInsightsFeatureEnabled:C,onMonthEndCheckClick:d=>{l(`./${d}/${S.month}-${S.year}`,{state:{pathnameStackToGoBack:R,message:"comingFromOverview",referrer:"Expense Automation - Overview"}})},onPeriodChange:v,handleReviewButtonClick:E,onBackClick:()=>{l("../../dashboard")},onReload:m,isAiCfoAccessEnabled:p,onAskAiCfoClick:u,aiAuditScorePercentageEnabled:r})})},gs=Ue.div`
2
2
  display: flex;
3
3
  height: 100vh;
4
4
  width: 100%;
@@ -1 +1 @@
1
- import{j as s}from"./liveblocks-BUQfB0Zp.js";import{a as r}from"./sentry-BLIwU6uZ.js";import{a3 as i,a4 as l,a5 as p,q as f}from"./index-DLAYU8mN.js";import"./mui-JZY-3hhJ.js";import m from"./NotFoundScreen-uCKl6Wx4.js";import{h as u,g as b}from"./core-OMb8nkC1.js";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},a=new e.Error().stack;a&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[a]="76cf16b7-b9dc-4e1e-8437-479ed67c5ac2",e._sentryDebugIdIdentifier="sentry-dbid-76cf16b7-b9dc-4e1e-8437-479ed67c5ac2")}catch{}})();const _=()=>{const e=u(),a=b(),t=r.useCallback(()=>{window.open("https://www.zeni.ai/demo/request","_blank")},[]),c=r.useCallback(()=>{(()=>{const n=f(a.state?.pathnameStackToGoBack),d=n.poppedPathname??k();e(d,{state:{pathnameStackToGoBack:n.newStack}})})()},[]),o=i(a.pathname);return o!=null?s.jsx(l,{menuItem:p(o),onDemoClick:t,onGoBack:c}):s.jsx(m,{})},k=(e=2)=>{let a="../";for(let t=0;t<e;t++)a=`${a}../`;return a};export{_ as F};
1
+ import{j as s}from"./liveblocks-BUQfB0Zp.js";import{a as r}from"./sentry-BLIwU6uZ.js";import{a3 as i,a4 as l,a5 as p,q as f}from"./index-NcZU0lXl.js";import"./mui-JZY-3hhJ.js";import m from"./NotFoundScreen-CxRYls3k.js";import{h as u,g as b}from"./core-OMb8nkC1.js";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},a=new e.Error().stack;a&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[a]="76cf16b7-b9dc-4e1e-8437-479ed67c5ac2",e._sentryDebugIdIdentifier="sentry-dbid-76cf16b7-b9dc-4e1e-8437-479ed67c5ac2")}catch{}})();const _=()=>{const e=u(),a=b(),t=r.useCallback(()=>{window.open("https://www.zeni.ai/demo/request","_blank")},[]),c=r.useCallback(()=>{(()=>{const n=f(a.state?.pathnameStackToGoBack),d=n.poppedPathname??k();e(d,{state:{pathnameStackToGoBack:n.newStack}})})()},[]),o=i(a.pathname);return o!=null?s.jsx(l,{menuItem:p(o),onDemoClick:t,onGoBack:c}):s.jsx(m,{})},k=(e=2)=>{let a="../";for(let t=0;t<e;t++)a=`${a}../`;return a};export{_ as F};
@@ -1 +1 @@
1
- import{a as r}from"./sentry-BLIwU6uZ.js";import{u as l,h as m,g as p}from"./core-OMb8nkC1.js";import{hm as f,LT as g,LU as b}from"./zeni-epic-state-BZ6N8nVI.js";import{u as _,L as h,z as y}from"./index-DLAYU8mN.js";import"./liveblocks-BUQfB0Zp.js";import"./recharts-DAM4r1-u.js";import"./mui-JZY-3hhJ.js";import"./analytics-BLbM2ksu.js";import"./plaid-B_OuebQv.js";import"./dnd-DVcQZAG5.js";import"./stripe-DMRn4zHo.js";import"./lottie-DDI83OWz.js";import"./lexical-CNfNgAkp.js";import"./pdf-6FZlivdz.js";import"./utils-Bia5qc4p.js";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},n=new e.Error().stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="64109727-3b7c-4928-b1c5-2dc73ea2b45a",e._sentryDebugIdIdentifier="sentry-dbid-64109727-3b7c-4928-b1c5-2dc73ea2b45a")}catch{}})();function j(){const e=l(),n=m(),o=p(),{setLoading:i,clearAllLoading:d}=_(),s=r.useRef(!1);return r.useLayoutEffect(()=>{i(h.CONNECTION_AUTH)},[i]),r.useEffect(()=>{if(s.current)return;s.current=!0;const a=new URLSearchParams(o.search).get("code"),c=sessionStorage.getItem("hubspot_oauth_pending");if(sessionStorage.removeItem("hubspot_oauth_pending"),a!=null&&c!=null){const t=JSON.parse(c);e(f(t.tenant_id,t.connection_id,g("revenue"),b("hubspot"),{authorization_code:a,client_id:t.client_id,client_secret:t.client_secret,redirect_uri:t.redirect_uri}))}d();const u=y.getActiveTenantForUser();n(u?.tenantEmailDomain!=null?`/${u.tenantEmailDomain}/settings/integrations`:"/",{replace:!0})},[]),null}export{j as default};
1
+ import{a as r}from"./sentry-BLIwU6uZ.js";import{u as l,h as m,g as p}from"./core-OMb8nkC1.js";import{hm as f,LT as g,LU as b}from"./zeni-epic-state-BZ6N8nVI.js";import{u as _,L as h,z as y}from"./index-NcZU0lXl.js";import"./liveblocks-BUQfB0Zp.js";import"./recharts-DAM4r1-u.js";import"./mui-JZY-3hhJ.js";import"./analytics-BLbM2ksu.js";import"./plaid-B_OuebQv.js";import"./dnd-DVcQZAG5.js";import"./stripe-DMRn4zHo.js";import"./lottie-DDI83OWz.js";import"./lexical-CNfNgAkp.js";import"./pdf-6FZlivdz.js";import"./utils-Bia5qc4p.js";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},n=new e.Error().stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="64109727-3b7c-4928-b1c5-2dc73ea2b45a",e._sentryDebugIdIdentifier="sentry-dbid-64109727-3b7c-4928-b1c5-2dc73ea2b45a")}catch{}})();function j(){const e=l(),n=m(),o=p(),{setLoading:i,clearAllLoading:d}=_(),s=r.useRef(!1);return r.useLayoutEffect(()=>{i(h.CONNECTION_AUTH)},[i]),r.useEffect(()=>{if(s.current)return;s.current=!0;const a=new URLSearchParams(o.search).get("code"),c=sessionStorage.getItem("hubspot_oauth_pending");if(sessionStorage.removeItem("hubspot_oauth_pending"),a!=null&&c!=null){const t=JSON.parse(c);e(f(t.tenant_id,t.connection_id,g("revenue"),b("hubspot"),{authorization_code:a,client_id:t.client_id,client_secret:t.client_secret,redirect_uri:t.redirect_uri}))}d();const u=y.getActiveTenantForUser();n(u?.tenantEmailDomain!=null?`/${u.tenantEmailDomain}/settings/integrations`:"/",{replace:!0})},[]),null}export{j as default};
@@ -1,4 +1,4 @@
1
- import{j as t}from"./liveblocks-BUQfB0Zp.js";import{i as S,n as x,h as C,g as y,u as ee,t as te,j as E,N as ae,o as ne,p}from"./core-OMb8nkC1.js";import{LM as k,LN as v,LO as T,AY as A,AK as M,LP as B,LQ as oe,LR as se,AO as ie,fw as $,AV as le,AS as re}from"./zeni-epic-state-BZ6N8nVI.js";import{J as g,o as r,p as de,d as j,k as G,x as ce,q as me,r as pe,s as H,a as ue,F as he,v as xe,Z as ge,m as fe,w as we,B as be,E as Se,M as ye,S as ke,y as ve,A as je,C as $e}from"./index-DLAYU8mN.js";import{n as m}from"./mui-JZY-3hhJ.js";import f from"./NotFoundScreen-uCKl6Wx4.js";import{a as I}from"./sentry-BLIwU6uZ.js";import"./recharts-DAM4r1-u.js";import"./analytics-BLbM2ksu.js";import"./plaid-B_OuebQv.js";import"./dnd-DVcQZAG5.js";import"./stripe-DMRn4zHo.js";import"./lottie-DDI83OWz.js";import"./lexical-CNfNgAkp.js";import"./pdf-6FZlivdz.js";import"./utils-Bia5qc4p.js";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},a=new e.Error().stack;a&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[a]="f39f09be-48c3-4bc5-ae9a-956f499591b1",e._sentryDebugIdIdentifier="sentry-dbid-f39f09be-48c3-4bc5-ae9a-956f499591b1")}catch{}})();const Ie=m.div`
1
+ import{j as t}from"./liveblocks-BUQfB0Zp.js";import{i as S,n as x,h as C,g as y,u as ee,t as te,j as E,N as ae,o as ne,p}from"./core-OMb8nkC1.js";import{LM as k,LN as v,LO as T,AY as A,AK as M,LP as B,LQ as oe,LR as se,AO as ie,fw as $,AV as le,AS as re}from"./zeni-epic-state-BZ6N8nVI.js";import{J as g,o as r,p as de,d as j,k as G,x as ce,q as me,r as pe,s as H,a as ue,F as he,v as xe,Z as ge,m as fe,w as we,B as be,E as Se,M as ye,S as ke,y as ve,A as je,C as $e}from"./index-NcZU0lXl.js";import{n as m}from"./mui-JZY-3hhJ.js";import f from"./NotFoundScreen-CxRYls3k.js";import{a as I}from"./sentry-BLIwU6uZ.js";import"./recharts-DAM4r1-u.js";import"./analytics-BLbM2ksu.js";import"./plaid-B_OuebQv.js";import"./dnd-DVcQZAG5.js";import"./stripe-DMRn4zHo.js";import"./lottie-DDI83OWz.js";import"./lexical-CNfNgAkp.js";import"./pdf-6FZlivdz.js";import"./utils-Bia5qc4p.js";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},a=new e.Error().stack;a&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[a]="f39f09be-48c3-4bc5-ae9a-956f499591b1",e._sentryDebugIdIdentifier="sentry-dbid-f39f09be-48c3-4bc5-ae9a-956f499591b1")}catch{}})();const Ie=m.div`
2
2
  display: flex;
3
3
  height: 100%;
4
4
  width: 100%;
@@ -1,4 +1,4 @@
1
- import{j as u}from"./liveblocks-BUQfB0Zp.js";import{a as g}from"./sentry-BLIwU6uZ.js";import{u as U,g as w,h as _,t as M,j as l,N as D}from"./core-OMb8nkC1.js";import{z as r,m as V,D as P,e as A,d as N,f as H,Y as J,M as R,g as W}from"./index-DLAYU8mN.js";import{eV as X,Lx as Y,LH as Z,Ly as $,fw as q,fZ as B,LD as G,gl as K,cX as Q,LI as ee,LJ as te}from"./zeni-epic-state-BZ6N8nVI.js";import{n as ne}from"./mui-JZY-3hhJ.js";import{u as ae}from"./useDeviceId-l9JfwAte.js";import{f as se}from"./analyticsHelper-B_k9Kjrd.js";import{t as ie}from"./getLocaleForTenant-CDmBpg_y.js";import"./recharts-DAM4r1-u.js";import"./analytics-BLbM2ksu.js";import"./plaid-B_OuebQv.js";import"./dnd-DVcQZAG5.js";import"./stripe-DMRn4zHo.js";import"./lottie-DDI83OWz.js";import"./lexical-CNfNgAkp.js";import"./pdf-6FZlivdz.js";import"./utils-Bia5qc4p.js";(function(){try{var t=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},s=new t.Error().stack;s&&(t._sentryDebugIds=t._sentryDebugIds||{},t._sentryDebugIds[s]="a8a46c61-b9ea-4640-b47e-83a0f31dfe02",t._sentryDebugIdIdentifier="sentry-dbid-a8a46c61-b9ea-4640-b47e-83a0f31dfe02")}catch{}})();const x=(t,s)=>t!=null&&t.length>0&&s==="magic_links";function xe(){const t=U(),s=w(),m=_(),[y]=M(),n=y.get("token"),p=y.get("stytch_token_type"),f=r.getMagicLinkCodeVerifier(),i=ae(),{otpChallenge:d,twoFAPhoneNumber:T,magicLinkEmail:c,verifyDeviceFetchState:z,resendVerifyDeviceOTPFetchState:C}=l(e=>e.tenantState),S=l(e=>e.tenantState.fetchState),k=l(e=>e.tenantState.activeTenantFetchState.fetchState),I=l(e=>e.tenantState.signInState),h=l(e=>e.tenantState.magicLinkSignInFetchState.fetchState),a=l(e=>e.tenantState.loggedInUser),o=l(e=>X(e)),b=l(e=>Y(e)),E=r.getSignedInUser(),L=V().mode;g.useEffect(()=>{a?.zeniSessionId==null&&n!=null&&x(n,p)&&i!=null&&f!=null&&(r.saveMagicLinkTriggered(n),t(Z(n,i,f)))},[n,p,t,i,f,a?.zeniSessionId]),g.useEffect(()=>{I!=="In-Progress"||S!=="Completed"&&k!=="Completed"||a?.zeniSessionId==null||o==null||(n!=null&&r.saveLastUsedMagicLinkToken(n),r.saveSignedInUserWithSession(a,a.zeniSessionId),r.saveSignedInUserTenants($(b.tenantsInOrder),a.zeniSessionId),q(a.userId,a.zeniSessionId,o.tenantId),t(B(o.tenantId)),r.saveActiveTenantDomainForUser(o.tenantEmailDomain),t(G("Completed")),P.updateAppLocaleID(ie(o)),se(a,o,L,void 0,b.tenantsInOrder),K().then(()=>{const e=W();e!=null&&A(e)}),setTimeout(()=>{N.trackLogin(H.Event.loginSuccess,"email",Q(o.productSettings))},2e3))},[I,S,k,a,o,b,L,s.state,t]);const j=g.useCallback(()=>{m("/signin/auth")},[m]),F=g.useCallback(()=>{i!=null&&d!=null&&c!=null&&t(ee(i,c,d))},[i,d,t,c]),O=g.useCallback(e=>{i!=null&&n!=null&&c!=null&&d!=null&&t(te(e,i,c,d))},[i,n,t,c,d]);if(h==="Completed"&&d!=null)return u.jsx(J,{phoneNumber:T,verifyOtpFetchState:z.fetchState,resendVerifyDeviceOTPFetchState:C,onResendOtp:F,onVerifyOtp:O,onCancelVerifyDevice:j});if(I==="In-Progress"&&S==="Completed"&&a?.zeniSessionId!=null&&o!=null||E!=null){const e=s.state?.origin??"/";return u.jsx(D,{to:e,state:{...s.state,origin:""}})}if(!x(n,p)||f==null||h==="Error"){const e=s.state?.origin??"/",v=n!=null&&r.getLastUsedMagicLinkToken()===n;return u.jsx(D,{to:e,state:{...s.state,origin:"",magicLinkAlreadyUsed:v,magicLinkExpired:!v&&(r.isMagicLinkTriggered(n??"")||h==="Error"&&a?.zeniSessionId==null)}})}return u.jsx(oe,{"data-testid":"smooth-loader",children:u.jsx(R,{size:"ExtraLarge",start:!0})})}const oe=ne.div`
1
+ import{j as u}from"./liveblocks-BUQfB0Zp.js";import{a as g}from"./sentry-BLIwU6uZ.js";import{u as U,g as w,h as _,t as M,j as l,N as D}from"./core-OMb8nkC1.js";import{z as r,m as V,D as P,e as A,d as N,f as H,Y as J,M as R,g as W}from"./index-NcZU0lXl.js";import{eV as X,Lx as Y,LH as Z,Ly as $,fw as q,fZ as B,LD as G,gl as K,cX as Q,LI as ee,LJ as te}from"./zeni-epic-state-BZ6N8nVI.js";import{n as ne}from"./mui-JZY-3hhJ.js";import{u as ae}from"./useDeviceId-l9JfwAte.js";import{f as se}from"./analyticsHelper-BU5wlVa9.js";import{t as ie}from"./getLocaleForTenant-Bn16hOPH.js";import"./recharts-DAM4r1-u.js";import"./analytics-BLbM2ksu.js";import"./plaid-B_OuebQv.js";import"./dnd-DVcQZAG5.js";import"./stripe-DMRn4zHo.js";import"./lottie-DDI83OWz.js";import"./lexical-CNfNgAkp.js";import"./pdf-6FZlivdz.js";import"./utils-Bia5qc4p.js";(function(){try{var t=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},s=new t.Error().stack;s&&(t._sentryDebugIds=t._sentryDebugIds||{},t._sentryDebugIds[s]="a8a46c61-b9ea-4640-b47e-83a0f31dfe02",t._sentryDebugIdIdentifier="sentry-dbid-a8a46c61-b9ea-4640-b47e-83a0f31dfe02")}catch{}})();const x=(t,s)=>t!=null&&t.length>0&&s==="magic_links";function xe(){const t=U(),s=w(),m=_(),[y]=M(),n=y.get("token"),p=y.get("stytch_token_type"),f=r.getMagicLinkCodeVerifier(),i=ae(),{otpChallenge:d,twoFAPhoneNumber:T,magicLinkEmail:c,verifyDeviceFetchState:z,resendVerifyDeviceOTPFetchState:C}=l(e=>e.tenantState),S=l(e=>e.tenantState.fetchState),k=l(e=>e.tenantState.activeTenantFetchState.fetchState),I=l(e=>e.tenantState.signInState),h=l(e=>e.tenantState.magicLinkSignInFetchState.fetchState),a=l(e=>e.tenantState.loggedInUser),o=l(e=>X(e)),b=l(e=>Y(e)),E=r.getSignedInUser(),L=V().mode;g.useEffect(()=>{a?.zeniSessionId==null&&n!=null&&x(n,p)&&i!=null&&f!=null&&(r.saveMagicLinkTriggered(n),t(Z(n,i,f)))},[n,p,t,i,f,a?.zeniSessionId]),g.useEffect(()=>{I!=="In-Progress"||S!=="Completed"&&k!=="Completed"||a?.zeniSessionId==null||o==null||(n!=null&&r.saveLastUsedMagicLinkToken(n),r.saveSignedInUserWithSession(a,a.zeniSessionId),r.saveSignedInUserTenants($(b.tenantsInOrder),a.zeniSessionId),q(a.userId,a.zeniSessionId,o.tenantId),t(B(o.tenantId)),r.saveActiveTenantDomainForUser(o.tenantEmailDomain),t(G("Completed")),P.updateAppLocaleID(ie(o)),se(a,o,L,void 0,b.tenantsInOrder),K().then(()=>{const e=W();e!=null&&A(e)}),setTimeout(()=>{N.trackLogin(H.Event.loginSuccess,"email",Q(o.productSettings))},2e3))},[I,S,k,a,o,b,L,s.state,t]);const j=g.useCallback(()=>{m("/signin/auth")},[m]),F=g.useCallback(()=>{i!=null&&d!=null&&c!=null&&t(ee(i,c,d))},[i,d,t,c]),O=g.useCallback(e=>{i!=null&&n!=null&&c!=null&&d!=null&&t(te(e,i,c,d))},[i,n,t,c,d]);if(h==="Completed"&&d!=null)return u.jsx(J,{phoneNumber:T,verifyOtpFetchState:z.fetchState,resendVerifyDeviceOTPFetchState:C,onResendOtp:F,onVerifyOtp:O,onCancelVerifyDevice:j});if(I==="In-Progress"&&S==="Completed"&&a?.zeniSessionId!=null&&o!=null||E!=null){const e=s.state?.origin??"/";return u.jsx(D,{to:e,state:{...s.state,origin:""}})}if(!x(n,p)||f==null||h==="Error"){const e=s.state?.origin??"/",v=n!=null&&r.getLastUsedMagicLinkToken()===n;return u.jsx(D,{to:e,state:{...s.state,origin:"",magicLinkAlreadyUsed:v,magicLinkExpired:!v&&(r.isMagicLinkTriggered(n??"")||h==="Error"&&a?.zeniSessionId==null)}})}return u.jsx(oe,{"data-testid":"smooth-loader",children:u.jsx(R,{size:"ExtraLarge",start:!0})})}const oe=ne.div`
2
2
  position: fixed;
3
3
  top: 0;
4
4
  left: 0;
@@ -1 +1 @@
1
- import{j as U}from"./liveblocks-BUQfB0Zp.js";import{a as c}from"./sentry-BLIwU6uZ.js";import{u as be,j as s,i as Ke,g as Qe,h as We,l as R}from"./core-OMb8nkC1.js";import{eV as he,fB as qe,fC as Se,fn as Xe,bn as ea,eU as aa,fD as ta,fE as na,fG as sa,fJ as oa,fS as ia,fK as g,fM as ra,fN as ue,fQ as da,fO as la,fP as ca,fR as ua,cN as fa,fU as ma,cS as pa,bs as ba,fm as ha,fZ as Sa,f_ as ga,fY as Ea}from"./zeni-epic-state-BZ6N8nVI.js";import{a7 as Ca,a8 as ka,Z as ya,a as Ia,z as C,w as Ta,u as wa,F as r,a9 as _a,aa as Aa,j as Fa,c as Da,ab as va,a3 as $a,ac as Ba,ad as Pa,ae as fe,af as me,L as Ga,ag as Ra,ah as pe,d as x,$ as xa,s as _,ai as N,aj as Na}from"./index-DLAYU8mN.js";import{D as Ua}from"./mui-JZY-3hhJ.js";(function(){try{var f=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},d=new f.Error().stack;d&&(f._sentryDebugIds=f._sentryDebugIds||{},f._sentryDebugIds[d]="8e6256fd-423f-472c-8fc8-efd7f87dfa48",f._sentryDebugIdIdentifier="sentry-dbid-8e6256fd-423f-472c-8fc8-efd7f87dfa48")}catch{}})();const Va=Ca(({isAppContentDrawerOpen:f,handleDrawerToggle:d})=>{const{tenantEmailDomain:t}=Ke(),a=Qe(),k=ya(),o=We(),V=Xe(),m=be(),{useFeatureGate:i}=Ia(),M=C.getSignedInUser(),A=ea(M),n=s(e=>he(e)),ge=n.masterTOSInfo?.isMasterTOSAccepted??!1,O=s(e=>aa(e)),j=O.uiState.currentChatSessionId,y=Ta(),{setLoading:Ee}=wa(),[F,L]=c.useState(void 0),D=R("/:tenantEmailDomain/dashboard")!==null,z=R("/:tenantEmailDomain/reports")!==null,I=R("/:tenantEmailDomain/onboarding/*")!==null,{isFeatureEnabled:Y}=i(r.isDepositAccountsFeatureEnabled),{isFeatureEnabled:Ce}=i(r.isChargeCardFeatureEnabled),{isFeatureEnabled:Z}=i(r.isDebitCardFeatureEnabled),ke=_a(n,Ce,Z),{isFeatureEnabled:ye}=i(r.isSettingsFeatureEnabled),H=s(e=>ta(e)),{isFeatureEnabled:T}=i(r.isReferralFeatureEnabled),v=s(e=>na(e));c.useEffect(()=>{y&&T&&!I&&v.fetchState==="Not-Started"&&m(sa(!0))},[y,T,v.fetchState,I]);const h=C.getSignedInUser(),$=s(e=>e.tenantState),Ie=s(e=>$.fetchState==="Completed"?oa(e):[]),E=s(e=>e.expenseAutomationViewState.selectedPeriodByTenantId),{isFeatureEnabled:Te}=i(r.isApAgingFeatureEnabled),{isFeatureEnabled:we}=i(r.isArAgingFeatureEnabled),{isFeatureEnabled:J}=i(r.isExpenseAutomationEnabled),{isFeatureEnabled:K}=i(r.isExpenseAutomationEnabledV2),Q=K||J&&A,{isFeatureEnabled:_e}=i(r.isDashboardSidebarHalloweenAnimationEnabled),{isFeatureEnabled:Ae}=i(r.isDashboardSidebarThanksGivingAnimationEnabled),{isFeatureEnabled:Fe}=i(r.isDashboardSidebarChristmasAnimationEnabled),{isFeatureEnabled:De}=i(r.isDashboardSidebarNewYearAnimationEnabled),{isFeatureEnabled:ve}=i(r.isTreasuryEnabled),{isFeatureEnabled:$e}=i(r.isTaskManagerCustomerUserAccessEnabled),Be=A||!A&&$e,Pe=n.company!=null&&ia(n.company),w=ve&&Pe,Ge=s(e=>g(e).totalUnreadCount),Re=s(e=>g(e).reducedFetchCountState),W=s(e=>g(e).notificationDetailsByTab.tasks.uiState.unreadCount),q=s(e=>g(e).notificationDetailsByTab.comments.uiState.unreadCount),xe=s(e=>g(e).notificationDetailsByTab.tasks.fetchCountState),B=s(e=>g(e).notificationDetailsByTab.comments.fetchCountState),{inboxNotifications:X,isLoading:ee,isFetchingMore:ae,hasFetchedAll:te,fetchMore:Ne}=Aa();c.useEffect(()=>{const e=setTimeout(()=>Ne?.(),0);return()=>clearTimeout(e)}),c.useEffect(()=>{if(ee===!1&&ae===!1&&te===!0)if(n?.companyId!=null&&X!=null){const e=`dashboard_${n.companyId}`;L(X.filter(u=>u.roomId===e&&u.readAt==null).length)}else L(0)},[ee,ae,te]),c.useEffect(()=>{y&&!I&&xe.fetchState==="Not-Started"&&V.tenantId!=null&&m(ra("task_manager","dashboard"))},[y,V.tenantId]),c.useEffect(()=>{I||B.fetchState!=="Not-Started"||m(ue({fetchCountState:{fetchState:"In-Progress",error:void 0}},"comments"))},[]),c.useEffect(()=>{F!=null&&B.fetchState==="In-Progress"&&(m(ue({fetchCountState:{fetchState:"Completed",error:void 0}},"comments")),m(Se({unreadCount:F},"comments")))},[F,B.fetchState]);const Ue={fetchStatus:Re,count:Ge},ne=t!=null?C.getSignedInUserTenant(t):null,se=s(e=>ne?.tenantId!=null?da(e,ne.tenantId):void 0),S=[];Te===!1&&S.push("accounts_payable_aging"),we===!1&&S.push("accounts_receivable_aging"),Y===!1&&S.push("zeni_accounts_promo_card"),T===!1&&S.push("rewards_card"),Q===!1&&S.push("expense_automation_card");const Ve=Fa(),oe=s(e=>la(e,S,h,K,J,w).fetchState),ie=s(e=>ca(e).fetchState),Me=D&&(oe==="Completed"||oe==="Error")||z&&(ie==="Completed"||ie==="Error")||!D&&!z?void 0:"disabled",Oe=c.useMemo(()=>ua(n.userRole),[n.userRole]),je=fa(Oe),Le=n?.rewardsLastViewedTime==null,ze=h?.userEmail!=null&&H.fetchState==="Completed"&&ma(H.notificationSettings,h.userEmail,Z,n),re=Da(),Ye=re&&va(a),de=pa(Ve?.loggedInUserRoleMap),le=n.companyTreasuryInfo?.info?.isTreasuryTOSAccepted,P=c.useCallback(()=>w&&de&&!C.getTreasuryPopupSeen(t??"")&&le===!1&&$a(a.pathname)!=="treasury",[w,de,le,a.pathname,t]),[Ze,ce]=c.useState(P);c.useEffect(()=>{ce(P())},[P]);const He=s(e=>e.treasurySetupViewState.treasuryFundsDetails).fundsDetails,Je=Ba(He);return U.jsx(Ua,{container:window.document.body,variant:"temporary",open:f,onClose:()=>d(!1),PaperProps:{sx:{width:240,zIndex:8,borderRight:"none",backgroundImage:"none"}},ModalProps:{keepMounted:!0},children:U.jsx(Pa,{signedInUser:M,currentTenantId:$.currentTenantId??"",tenants:$.fetchState==="Completed"?Ie:se!=null?[se]:[],currentTenant:n,isTenantDropdownDisabled:Me,isSettings:me(a),isSettingsFeatureEnabled:ye,isVendorsTabVisible:je,isZeniAccountEnabled:Y,isChargeCardEnabled:ke,isTreasuryEnabled:w,treasuryYieldPercentage:Je,isTreasuryPopupVisible:Ze,isNotificationsTabVisible:ze,notificationCountDetails:Ue,isExpenseAutomationEnabledForUser:Q&&ba(n.userRole)===!1,selectedMenu:fe(a),rewardsConfiguration:{isRewardsTabVisible:T,isRewardsAnimated:Le,rewardsPlan:v.rewardsPlan},isAiCfoAccessEnabled:re,onNotificationIconClick:()=>{d(!1);let e=W===0&&q>0?"notifications/comments":"notifications/tasks";me(a)&&(e=W===0&&q>0?"../../notifications/comments":"../../notifications/tasks");const u=_(a.state?.pathnameStackToGoBack,a.pathname);o(e,{state:{pathnameStackToGoBack:u}})},handleCockpitClick:()=>{window.open("/cockpit")},handleLogOutClick:()=>{d(!1);const e=_(a.state?.pathnameStackToGoBack,a.pathname);o("/signout",{replace:!0,state:{pathnameStackToGoBack:e,message:"logout"}})},handleMenuChange:e=>{if(d(!1),t==null)return;if(e.type==="ai_cfo"){if(x.trackAICFOChatScreenStateChanged("viewed","left_menu",j??null,null),!ge)return void xa({location:a,navigate:o,mergeState:{referrer:"Sidebar"}});const b=_(a.state?.pathnameStackToGoBack,a.pathname);return void o(`/${t}/ai-cfo/explore`,{state:{pathnameStackToGoBack:b,referrer:"Sidebar"}})}const u=_(a.state?.pathnameStackToGoBack,a.pathname),l=e.type,p=N(l)&&l!=="command_center";if(N(e.type)&&E[n.tenantId]!=null&&x.trackMonthEndCloseClicked(E[n.tenantId].month,E[n.tenantId].year,"Sidebar"),p&&E[n.tenantId]!=null){const b=E[n.tenantId];return void o(`/${t}/month_end_close_checks/review/${e.type}/${b.month}-${b.year}`,{state:{pathnameStackToGoBack:u,referrer:"Sidebar"}})}const G=Na(e.type);pe(e.type)?(j!=null&&m(Ea()),o(`/${t}/ai-cfo/${e.type}`,{state:{pathnameStackToGoBack:u.slice(0,-1),referrer:"Sidebar"}})):o(`/${t}/${G}`,{state:{pathnameStackToGoBack:u,referrer:"Sidebar"}})},handleMyProfileClick:()=>{d(!1),o(`/${t}/settings/my_profile`)},handleReferralsClick:()=>{d(!1),o(`/${t}/rewards`)},handleBackClick:()=>{o(`/${t}/dashboard`)},handleTenantSelect:e=>{Ee(Ga.TENANT_SWITCHING),d(!1);const u=e.tenantEmailDomain,l=fe(a);let p=`/${encodeURIComponent(u)}/`;const G=N(l);l==="home"?p+="dashboard":l==="users_and_roles"?p+="people":Ra(l)?p+="settings/my_profile":pe(l)?p+=`ai-cfo/${l}`:p+=l==="task_checklist"?"tasks":G?"month_end_close_checks/review":encodeURIComponent(l),o(p,{replace:!0}),h!=null&&(m(Sa(e.tenantId)),m(ga(h.userId,e.tenantId,h.zeniSessionId)));const b=e;x.trackCompanySwitch(b.companyId,b.companyName,b.userRole)},handlePopupClose:()=>{C.saveTreasuryPopupSeen(t??"",!0),ce(!1)},onZeniLogoClick:()=>{k.toggle()},isAiCfo:Ye,aiCfoView:O,isOnDashboard:D,updateCurrentChatSessionId:e=>{m(ha({sessionId:e,agentId:"controller"})),o(`/${t}/ai-cfo/${e}`,{state:{...a.state}})},halloweenAnimationEnabled:_e,isTaskManagerAccessEnabled:Be,thanksGivingAnimationEnabled:Ae,christmasAnimationEnabled:Fe,newYearAnimationEnabled:De})})}),Za=f=>{const d=be(),t=s(k=>he(k)),a={events:t.userRoleId!=null?[`private-encrypted-${t.userRoleId}.dashboard-user-notification`]:[],eventCallback:(k,o)=>{ka(o)&&qe(o.mode)==="dashboard"&&d(Se({unreadCount:o.data.unread},"tasks"))}};return U.jsx(Va,{...f,...a})};export{Za as M};
1
+ import{j as U}from"./liveblocks-BUQfB0Zp.js";import{a as c}from"./sentry-BLIwU6uZ.js";import{u as be,j as s,i as Ke,g as Qe,h as We,l as R}from"./core-OMb8nkC1.js";import{eV as he,fB as qe,fC as Se,fn as Xe,bn as ea,eU as aa,fD as ta,fE as na,fG as sa,fJ as oa,fS as ia,fK as g,fM as ra,fN as ue,fQ as da,fO as la,fP as ca,fR as ua,cN as fa,fU as ma,cS as pa,bs as ba,fm as ha,fZ as Sa,f_ as ga,fY as Ea}from"./zeni-epic-state-BZ6N8nVI.js";import{a7 as Ca,a8 as ka,Z as ya,a as Ia,z as C,w as Ta,u as wa,F as r,a9 as _a,aa as Aa,j as Fa,c as Da,ab as va,a3 as $a,ac as Ba,ad as Pa,ae as fe,af as me,L as Ga,ag as Ra,ah as pe,d as x,$ as xa,s as _,ai as N,aj as Na}from"./index-NcZU0lXl.js";import{D as Ua}from"./mui-JZY-3hhJ.js";(function(){try{var f=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},d=new f.Error().stack;d&&(f._sentryDebugIds=f._sentryDebugIds||{},f._sentryDebugIds[d]="8e6256fd-423f-472c-8fc8-efd7f87dfa48",f._sentryDebugIdIdentifier="sentry-dbid-8e6256fd-423f-472c-8fc8-efd7f87dfa48")}catch{}})();const Va=Ca(({isAppContentDrawerOpen:f,handleDrawerToggle:d})=>{const{tenantEmailDomain:t}=Ke(),a=Qe(),k=ya(),o=We(),V=Xe(),m=be(),{useFeatureGate:i}=Ia(),M=C.getSignedInUser(),A=ea(M),n=s(e=>he(e)),ge=n.masterTOSInfo?.isMasterTOSAccepted??!1,O=s(e=>aa(e)),j=O.uiState.currentChatSessionId,y=Ta(),{setLoading:Ee}=wa(),[F,L]=c.useState(void 0),D=R("/:tenantEmailDomain/dashboard")!==null,z=R("/:tenantEmailDomain/reports")!==null,I=R("/:tenantEmailDomain/onboarding/*")!==null,{isFeatureEnabled:Y}=i(r.isDepositAccountsFeatureEnabled),{isFeatureEnabled:Ce}=i(r.isChargeCardFeatureEnabled),{isFeatureEnabled:Z}=i(r.isDebitCardFeatureEnabled),ke=_a(n,Ce,Z),{isFeatureEnabled:ye}=i(r.isSettingsFeatureEnabled),H=s(e=>ta(e)),{isFeatureEnabled:T}=i(r.isReferralFeatureEnabled),v=s(e=>na(e));c.useEffect(()=>{y&&T&&!I&&v.fetchState==="Not-Started"&&m(sa(!0))},[y,T,v.fetchState,I]);const h=C.getSignedInUser(),$=s(e=>e.tenantState),Ie=s(e=>$.fetchState==="Completed"?oa(e):[]),E=s(e=>e.expenseAutomationViewState.selectedPeriodByTenantId),{isFeatureEnabled:Te}=i(r.isApAgingFeatureEnabled),{isFeatureEnabled:we}=i(r.isArAgingFeatureEnabled),{isFeatureEnabled:J}=i(r.isExpenseAutomationEnabled),{isFeatureEnabled:K}=i(r.isExpenseAutomationEnabledV2),Q=K||J&&A,{isFeatureEnabled:_e}=i(r.isDashboardSidebarHalloweenAnimationEnabled),{isFeatureEnabled:Ae}=i(r.isDashboardSidebarThanksGivingAnimationEnabled),{isFeatureEnabled:Fe}=i(r.isDashboardSidebarChristmasAnimationEnabled),{isFeatureEnabled:De}=i(r.isDashboardSidebarNewYearAnimationEnabled),{isFeatureEnabled:ve}=i(r.isTreasuryEnabled),{isFeatureEnabled:$e}=i(r.isTaskManagerCustomerUserAccessEnabled),Be=A||!A&&$e,Pe=n.company!=null&&ia(n.company),w=ve&&Pe,Ge=s(e=>g(e).totalUnreadCount),Re=s(e=>g(e).reducedFetchCountState),W=s(e=>g(e).notificationDetailsByTab.tasks.uiState.unreadCount),q=s(e=>g(e).notificationDetailsByTab.comments.uiState.unreadCount),xe=s(e=>g(e).notificationDetailsByTab.tasks.fetchCountState),B=s(e=>g(e).notificationDetailsByTab.comments.fetchCountState),{inboxNotifications:X,isLoading:ee,isFetchingMore:ae,hasFetchedAll:te,fetchMore:Ne}=Aa();c.useEffect(()=>{const e=setTimeout(()=>Ne?.(),0);return()=>clearTimeout(e)}),c.useEffect(()=>{if(ee===!1&&ae===!1&&te===!0)if(n?.companyId!=null&&X!=null){const e=`dashboard_${n.companyId}`;L(X.filter(u=>u.roomId===e&&u.readAt==null).length)}else L(0)},[ee,ae,te]),c.useEffect(()=>{y&&!I&&xe.fetchState==="Not-Started"&&V.tenantId!=null&&m(ra("task_manager","dashboard"))},[y,V.tenantId]),c.useEffect(()=>{I||B.fetchState!=="Not-Started"||m(ue({fetchCountState:{fetchState:"In-Progress",error:void 0}},"comments"))},[]),c.useEffect(()=>{F!=null&&B.fetchState==="In-Progress"&&(m(ue({fetchCountState:{fetchState:"Completed",error:void 0}},"comments")),m(Se({unreadCount:F},"comments")))},[F,B.fetchState]);const Ue={fetchStatus:Re,count:Ge},ne=t!=null?C.getSignedInUserTenant(t):null,se=s(e=>ne?.tenantId!=null?da(e,ne.tenantId):void 0),S=[];Te===!1&&S.push("accounts_payable_aging"),we===!1&&S.push("accounts_receivable_aging"),Y===!1&&S.push("zeni_accounts_promo_card"),T===!1&&S.push("rewards_card"),Q===!1&&S.push("expense_automation_card");const Ve=Fa(),oe=s(e=>la(e,S,h,K,J,w).fetchState),ie=s(e=>ca(e).fetchState),Me=D&&(oe==="Completed"||oe==="Error")||z&&(ie==="Completed"||ie==="Error")||!D&&!z?void 0:"disabled",Oe=c.useMemo(()=>ua(n.userRole),[n.userRole]),je=fa(Oe),Le=n?.rewardsLastViewedTime==null,ze=h?.userEmail!=null&&H.fetchState==="Completed"&&ma(H.notificationSettings,h.userEmail,Z,n),re=Da(),Ye=re&&va(a),de=pa(Ve?.loggedInUserRoleMap),le=n.companyTreasuryInfo?.info?.isTreasuryTOSAccepted,P=c.useCallback(()=>w&&de&&!C.getTreasuryPopupSeen(t??"")&&le===!1&&$a(a.pathname)!=="treasury",[w,de,le,a.pathname,t]),[Ze,ce]=c.useState(P);c.useEffect(()=>{ce(P())},[P]);const He=s(e=>e.treasurySetupViewState.treasuryFundsDetails).fundsDetails,Je=Ba(He);return U.jsx(Ua,{container:window.document.body,variant:"temporary",open:f,onClose:()=>d(!1),PaperProps:{sx:{width:240,zIndex:8,borderRight:"none",backgroundImage:"none"}},ModalProps:{keepMounted:!0},children:U.jsx(Pa,{signedInUser:M,currentTenantId:$.currentTenantId??"",tenants:$.fetchState==="Completed"?Ie:se!=null?[se]:[],currentTenant:n,isTenantDropdownDisabled:Me,isSettings:me(a),isSettingsFeatureEnabled:ye,isVendorsTabVisible:je,isZeniAccountEnabled:Y,isChargeCardEnabled:ke,isTreasuryEnabled:w,treasuryYieldPercentage:Je,isTreasuryPopupVisible:Ze,isNotificationsTabVisible:ze,notificationCountDetails:Ue,isExpenseAutomationEnabledForUser:Q&&ba(n.userRole)===!1,selectedMenu:fe(a),rewardsConfiguration:{isRewardsTabVisible:T,isRewardsAnimated:Le,rewardsPlan:v.rewardsPlan},isAiCfoAccessEnabled:re,onNotificationIconClick:()=>{d(!1);let e=W===0&&q>0?"notifications/comments":"notifications/tasks";me(a)&&(e=W===0&&q>0?"../../notifications/comments":"../../notifications/tasks");const u=_(a.state?.pathnameStackToGoBack,a.pathname);o(e,{state:{pathnameStackToGoBack:u}})},handleCockpitClick:()=>{window.open("/cockpit")},handleLogOutClick:()=>{d(!1);const e=_(a.state?.pathnameStackToGoBack,a.pathname);o("/signout",{replace:!0,state:{pathnameStackToGoBack:e,message:"logout"}})},handleMenuChange:e=>{if(d(!1),t==null)return;if(e.type==="ai_cfo"){if(x.trackAICFOChatScreenStateChanged("viewed","left_menu",j??null,null),!ge)return void xa({location:a,navigate:o,mergeState:{referrer:"Sidebar"}});const b=_(a.state?.pathnameStackToGoBack,a.pathname);return void o(`/${t}/ai-cfo/explore`,{state:{pathnameStackToGoBack:b,referrer:"Sidebar"}})}const u=_(a.state?.pathnameStackToGoBack,a.pathname),l=e.type,p=N(l)&&l!=="command_center";if(N(e.type)&&E[n.tenantId]!=null&&x.trackMonthEndCloseClicked(E[n.tenantId].month,E[n.tenantId].year,"Sidebar"),p&&E[n.tenantId]!=null){const b=E[n.tenantId];return void o(`/${t}/month_end_close_checks/review/${e.type}/${b.month}-${b.year}`,{state:{pathnameStackToGoBack:u,referrer:"Sidebar"}})}const G=Na(e.type);pe(e.type)?(j!=null&&m(Ea()),o(`/${t}/ai-cfo/${e.type}`,{state:{pathnameStackToGoBack:u.slice(0,-1),referrer:"Sidebar"}})):o(`/${t}/${G}`,{state:{pathnameStackToGoBack:u,referrer:"Sidebar"}})},handleMyProfileClick:()=>{d(!1),o(`/${t}/settings/my_profile`)},handleReferralsClick:()=>{d(!1),o(`/${t}/rewards`)},handleBackClick:()=>{o(`/${t}/dashboard`)},handleTenantSelect:e=>{Ee(Ga.TENANT_SWITCHING),d(!1);const u=e.tenantEmailDomain,l=fe(a);let p=`/${encodeURIComponent(u)}/`;const G=N(l);l==="home"?p+="dashboard":l==="users_and_roles"?p+="people":Ra(l)?p+="settings/my_profile":pe(l)?p+=`ai-cfo/${l}`:p+=l==="task_checklist"?"tasks":G?"month_end_close_checks/review":encodeURIComponent(l),o(p,{replace:!0}),h!=null&&(m(Sa(e.tenantId)),m(ga(h.userId,e.tenantId,h.zeniSessionId)));const b=e;x.trackCompanySwitch(b.companyId,b.companyName,b.userRole)},handlePopupClose:()=>{C.saveTreasuryPopupSeen(t??"",!0),ce(!1)},onZeniLogoClick:()=>{k.toggle()},isAiCfo:Ye,aiCfoView:O,isOnDashboard:D,updateCurrentChatSessionId:e=>{m(ha({sessionId:e,agentId:"controller"})),o(`/${t}/ai-cfo/${e}`,{state:{...a.state}})},halloweenAnimationEnabled:_e,isTaskManagerAccessEnabled:Be,thanksGivingAnimationEnabled:Ae,christmasAnimationEnabled:Fe,newYearAnimationEnabled:De})})}),Za=f=>{const d=be(),t=s(k=>he(k)),a={events:t.userRoleId!=null?[`private-encrypted-${t.userRoleId}.dashboard-user-notification`]:[],eventCallback:(k,o)=>{ka(o)&&qe(o.mode)==="dashboard"&&d(Se({unreadCount:o.data.unread},"tasks"))}};return U.jsx(Va,{...f,...a})};export{Za as M};
@@ -1 +1 @@
1
- import{j as e}from"./liveblocks-BUQfB0Zp.js";import{h as r,n}from"./core-OMb8nkC1.js";import{Q as i}from"./index-DLAYU8mN.js";import"./mui-JZY-3hhJ.js";import"./sentry-BLIwU6uZ.js";import"./zeni-epic-state-BZ6N8nVI.js";import"./recharts-DAM4r1-u.js";import"./analytics-BLbM2ksu.js";import"./plaid-B_OuebQv.js";import"./dnd-DVcQZAG5.js";import"./stripe-DMRn4zHo.js";import"./lottie-DDI83OWz.js";import"./lexical-CNfNgAkp.js";import"./pdf-6FZlivdz.js";import"./utils-Bia5qc4p.js";(function(){try{var o=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new o.Error().stack;t&&(o._sentryDebugIds=o._sentryDebugIds||{},o._sentryDebugIds[t]="e552295f-ad8f-4911-819f-e7382b348622",o._sentryDebugIdIdentifier="sentry-dbid-e552295f-ad8f-4911-819f-e7382b348622")}catch{}})();const f=n(null,function(o,t){return{onGoBack:()=>{t.navigate(-1)},onGoHome:()=>{t.navigate("/")}}})(i);function _(){const o=r();return e.jsx(f,{navigate:o})}export{_ as default};
1
+ import{j as e}from"./liveblocks-BUQfB0Zp.js";import{h as r,n}from"./core-OMb8nkC1.js";import{Q as i}from"./index-NcZU0lXl.js";import"./mui-JZY-3hhJ.js";import"./sentry-BLIwU6uZ.js";import"./zeni-epic-state-BZ6N8nVI.js";import"./recharts-DAM4r1-u.js";import"./analytics-BLbM2ksu.js";import"./plaid-B_OuebQv.js";import"./dnd-DVcQZAG5.js";import"./stripe-DMRn4zHo.js";import"./lottie-DDI83OWz.js";import"./lexical-CNfNgAkp.js";import"./pdf-6FZlivdz.js";import"./utils-Bia5qc4p.js";(function(){try{var o=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new o.Error().stack;t&&(o._sentryDebugIds=o._sentryDebugIds||{},o._sentryDebugIds[t]="e552295f-ad8f-4911-819f-e7382b348622",o._sentryDebugIdIdentifier="sentry-dbid-e552295f-ad8f-4911-819f-e7382b348622")}catch{}})();const f=n(null,function(o,t){return{onGoBack:()=>{t.navigate(-1)},onGoHome:()=>{t.navigate("/")}}})(i);function _(){const o=r();return e.jsx(f,{navigate:o})}export{_ as default};
@@ -1 +1 @@
1
- import{l as ct,a as mt,m as dt,j as A}from"./liveblocks-BUQfB0Zp.js";import lt from"./NotFoundScreen-uCKl6Wx4.js";import{a as k}from"./sentry-BLIwU6uZ.js";import{h as ft,g as ut,i as ht,u as pt,j as S,n as kt,o as gt,p as O}from"./core-OMb8nkC1.js";import{cu as St,fD as H,eV as J,fR as bt,fK as b,St as X,fN as d,fC as y,si as M,xE as It,Su as Ct,fB as Tt,fU as yt,sn as _t,Sv as $,bo as F,fv as w,sr as Q,Sw as Et,cG as At,cz as Nt}from"./zeni-epic-state-BZ6N8nVI.js";import{W as Bt,z as xt,a as wt,F as Rt,_ as Ut,cU as vt,s as N,a7 as Dt,cV as Gt,a8 as Pt,q as $t}from"./index-DLAYU8mN.js";import"./mui-JZY-3hhJ.js";import{u as Ft}from"./useAskAiCfoHostNavButtonProps-Cw5yceVN.js";import"./recharts-DAM4r1-u.js";import"./analytics-BLbM2ksu.js";import"./plaid-B_OuebQv.js";import"./dnd-DVcQZAG5.js";import"./stripe-DMRn4zHo.js";import"./lottie-DDI83OWz.js";import"./lexical-CNfNgAkp.js";import"./pdf-6FZlivdz.js";import"./utils-Bia5qc4p.js";(function(){try{var t=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},l=new t.Error().stack;l&&(t._sentryDebugIds=t._sentryDebugIds||{},t._sentryDebugIds[l]="07b10cbe-5bde-4052-b96e-ed6bdbc73259",t._sentryDebugIdIdentifier="sentry-dbid-07b10cbe-5bde-4052-b96e-ed6bdbc73259")}catch{}})();const Mt=(t,l)=>new Promise((n,u)=>{const g=t.map(i=>new Promise(s=>{l(i),s()}));Promise.all(g).then(()=>{setTimeout(()=>{n()},2e3)}).catch(i=>{u(i)})}),jt=kt(function(t,l){const n=H(t),{signedInUser:u,isDebitCardFeatureEnabled:g}=l,i=b(t),s=J(t),{currentTab:h}=i;return{notificationView:i,isNotificationSettingsVisible:u.userEmail!=null&&yt(n.notificationSettings,u.userEmail,g,s),isDisabled:i.notificationDetailsByTab[h].fetchState==="In-Progress"?"disabled":void 0}},function(t,l){const{location:n,tenantEmailDomain:u,loggedInUserRoleMap:g,externalNotificationsUnreadCount:i,allUnreadCommentsNotificationIds:s,navigate:h,markInboxNotificationAsRead:B,fetchMoreCommentsNotifications:R}=l;return{onNotificationClick:(a,o,m,c)=>{if(c==="task_deleted"){const r=`/${u}/tasks`,I=N(n.state?.pathnameStackToGoBack,n.pathname);h(r,{state:{pathnameStackToGoBack:I,message:"triggerBackClick"}})}else{const r=`/${u}/tasks/${o}`,I=N(n.state?.pathnameStackToGoBack,n.pathname);h(r,{state:{pathnameStackToGoBack:I,message:"triggerBackClick"}})}m==="unread"&&t(Q("task_manager","read",[a],!1))},onCommentNotificationClick:(a,o,m)=>{const c=o.toString().split(`/${u}/`);if(c[1]!=null){m==="unread"&&(B(a),t($([a],F())));let r=`/${u}/${c[1]}`;const I=N(n.state?.pathnameStackToGoBack,n.pathname);c[1].startsWith("reimbursement")&&!At(g)&&(r="not-found"),c[1].startsWith("bill")&&!Nt(g)&&(r="not-found"),h(r,{state:{pathnameStackToGoBack:I,message:"triggerBackClick"}})}},onUpdateNotificationViewUIState:(a,o)=>{t(y(a,o))},onUpdateNotificationTabState:(a,o)=>{t(d(a,o))},onUpdateNotificationViewCurrentTabAndSubTab:(a,o)=>{t(X(a,o));const m=`../${a}`,c=N(n.state?.pathnameStackToGoBack,n.pathname);h(m,{state:{pathnameStackToGoBack:c}})},onUpdateNotificationViewSubTab:a=>{t(Et(a))},onFetchMoreNotifications:(a,o)=>{if(a==="tasks"){const m=[];o==="all"?m.push("read","unread"):o!=="mentions"&&m.push(o),t(M("task_manager","dashboard",m))}else R?.()},onUpdateNotificationStatus:(a,o,m,c)=>{a==="tasks"?t(Q("task_manager",m,c)):(t(d({markAsReadState:{fetchState:"In-Progress",error:void 0}},"comments")),Promise.all(c.map(r=>{m==="read"&&(B(r),t($([r],F())))})).then(()=>{t(d({markAsReadState:{fetchState:"Completed",error:void 0},selectedNotificationIds:[]},"comments")),t(y({unreadCount:i-c.length>0?i-c.length:0},"comments")),t(w({messageSection:"notification_mark_as_read",messageText:"success",type:"success",showStatusIcon:!0}))},r=>{t(d({markAsReadState:{fetchState:"Error",error:r}},"comments")),t(w({messageSection:"notification_mark_as_read",messageText:"failed",type:"error",showStatusIcon:!0}))}).catch(r=>{t(d({markAsReadState:{fetchState:"Error",error:r}},"comments")),t(w({messageSection:"notification_mark_as_read",messageText:"failed",type:"error",showStatusIcon:!0}))}))},onMarkAllNotificationsAsRead:a=>{a==="tasks"?t(_t("task_manager","read")):(t(d({markAsAllReadState:{fetchState:"In-Progress",error:void 0}},"comments")),Mt(s,B).then(()=>{t($(s,F())),t(d({markAsAllReadState:{fetchState:"Completed",error:void 0}},"comments")),t(y({unreadCount:0},"comments")),t(w({messageSection:"notification_mark_as_read",messageText:"success",type:"success",showStatusIcon:!0}))}).catch(o=>{t(d({markAsAllReadState:{fetchState:"Error",error:o}},"comments")),t(w({messageSection:"notification_mark_as_read",messageText:"failed",type:"error",showStatusIcon:!0}))}))},onBackClick:()=>{const a=$t(n.state?.pathnameStackToGoBack),o=a.poppedPathname??"../../dashboard";h(o,{state:{pathnameStackToGoBack:a.newStack}})},onSettingsClick:()=>{const a=N(n.state?.pathnameStackToGoBack,n.pathname);h("../../settings/notifications",{state:{pathnameStackToGoBack:a}})}}})(Dt(Gt)),Vt=()=>{const t=ft(),l=ut(),{tenantEmailDomain:n,selectedTab:u}=ht(),{areTenantIdsInSync:g}=Bt(),i=St(u??""),s=pt(),h=xt.getSignedInUser(),[B,R]=k.useState(!1),a=S(e=>H(e)),o=S(e=>J(e)),{useFeatureGate:m}=wt(),{isFeatureEnabled:c}=m(Rt.isDebitCardFeatureEnabled),{isAiCfoAccessEnabled:r,onAskAiCfoClick:I}=Ft({mobileExploreReferrer:"Notifications"});Ut({isDataReady:!0});const Y=bt(o.userRole);if(o==null||n==null||o.companyId==null)throw Error("Can't access notifications page without current tenant...");if(h==null)throw Error("Can't access notifications page without signed in...");const j=S(e=>b(e).notificationDetailsByTab.tasks.fetchState),V=S(e=>b(e).currentTab),U=S(e=>b(e).currentSubTab),Z=S(e=>b(e).notificationDetailsByTab.comments.fetchCountState),v=S(e=>b(e).notificationDetailsByTab.comments.fetchState),tt=S(e=>b(e).notificationDetailsByTab.comments.uiState.unreadCount),et=S(e=>b(e).allExternalNotifications).filter(e=>e.inboxNotification.readAt==null).map(e=>e.inboxNotification.id),at=vt().allUsers,{inboxNotifications:x,isLoading:_,hasFetchedAll:C,isFetchingMore:D,fetchMore:ot}=ct(),{threads:W,isLoading:z,fetchMore:L,isFetchingMore:q,hasFetchedAll:K}=mt({query:{metadata:{companyId:o.companyId,application:"dashboard"}}});k.useEffect(()=>{if(V!==i&&i!=null&&s(X(i)),i==null){const e=`../${V}`,p=N(l.state?.pathnameStackToGoBack,l.pathname);t(e,{state:{pathnameStackToGoBack:p}})}},[i]),k.useEffect(()=>{Z.fetchState==="Not-Started"&&s(d({fetchCountState:{fetchState:"In-Progress",error:void 0}},"comments"))},[]),k.useEffect(()=>{if(_===!1&&C===!0&&o?.companyId!=null&&x!=null){const e=`dashboard_${o.companyId}`,p=x.filter(T=>T.roomId===e&&T.readAt==null).length;s(d({fetchCountState:{fetchState:"Completed",error:void 0}},"comments")),s(y({unreadCount:p},"comments"))}},[_,C]),k.useEffect(()=>{j!=="In-Progress"&&g&&s(M("task_manager","dashboard",["read","unread"]))},[g]),k.useEffect(()=>{const e=setTimeout(()=>ot?.(),0);return()=>clearTimeout(e)});const G=_||D===!0||C!==!0||_||D===!0||C!==!0;k.useEffect(()=>{G&&v!=="In-Progress"?s(d({fetchState:"In-Progress",error:void 0},"comments")):G||v!=="In-Progress"||s(d({fetchState:"Completed",error:void 0},"comments"))},[G,v]),k.useEffect(()=>{s(y({hasMore:C!==!0},"comments"))},[C]),k.useEffect(()=>{a.fetchState!=="In-Progress"&&a.fetchState!=="Completed"&&B===!1&&(R(!0),s(It()))},[a.fetchState]),k.useEffect(()=>{if(_===!1&&z===!1&&x!=null&&W!=null){const e=`dashboard_${o.companyId}`,p=x.filter(f=>f.roomId===e).filter(f=>f.kind==="thread"),T=p.filter(f=>f.readAt==null),E=p.map(f=>f.id),it=p.map(f=>{const P=W.find(rt=>rt.id===f.threadId);return P!=null?{inboxNotification:{...f,threadId:P.id},thread:P}:(q||K===!0||L==null||L(),null)}).filter(f=>f!=null);s(d({allNotificationsIds:E},"comments")),s(y({totalCount:E.length,unreadCount:T.length},"comments")),s(Ct(it))}},[_,D,q,C,K,z,x?.length]);const st={events:o.userRoleId!=null?[`private-encrypted-${o.userRoleId}.dashboard-user-notification`]:[],eventCallback:(e,p)=>{if(Pt(p)){const T=Tt(p.mode);if(T==="dashboard"&&s(y({unreadCount:p.data.unread},"tasks")),j!=="In-Progress"){const E=[];U==="all"?E.push("read","unread"):U!=="mentions"&&E.push(U),s(M("task_manager",T,E,!0))}}}},nt=dt();return A.jsx(jt,{tenantEmailDomain:n,loggedInUserRoleMap:Y,signedInUser:h,externalNotificationsUnreadCount:tt,location:l,navigate:t,isDebitCardFeatureEnabled:c,users:at,markInboxNotificationAsRead:nt,allUnreadCommentsNotificationIds:et,isAiCfoAccessEnabled:r,onAskAiCfoClick:I,...st})};function ne(){return A.jsxs(gt,{children:[A.jsx(O,{path:"/:selectedTab",element:A.jsx(Vt,{})}),A.jsx(O,{path:"*",element:A.jsx(lt,{})})]})}export{ne as default};
1
+ import{l as ct,a as mt,m as dt,j as A}from"./liveblocks-BUQfB0Zp.js";import lt from"./NotFoundScreen-CxRYls3k.js";import{a as k}from"./sentry-BLIwU6uZ.js";import{h as ft,g as ut,i as ht,u as pt,j as S,n as kt,o as gt,p as O}from"./core-OMb8nkC1.js";import{cu as St,fD as H,eV as J,fR as bt,fK as b,St as X,fN as d,fC as y,si as M,xE as It,Su as Ct,fB as Tt,fU as yt,sn as _t,Sv as $,bo as F,fv as w,sr as Q,Sw as Et,cG as At,cz as Nt}from"./zeni-epic-state-BZ6N8nVI.js";import{W as Bt,z as xt,a as wt,F as Rt,_ as Ut,cU as vt,s as N,a7 as Dt,cV as Gt,a8 as Pt,q as $t}from"./index-NcZU0lXl.js";import"./mui-JZY-3hhJ.js";import{u as Ft}from"./useAskAiCfoHostNavButtonProps-DS5Fxq3U.js";import"./recharts-DAM4r1-u.js";import"./analytics-BLbM2ksu.js";import"./plaid-B_OuebQv.js";import"./dnd-DVcQZAG5.js";import"./stripe-DMRn4zHo.js";import"./lottie-DDI83OWz.js";import"./lexical-CNfNgAkp.js";import"./pdf-6FZlivdz.js";import"./utils-Bia5qc4p.js";(function(){try{var t=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},l=new t.Error().stack;l&&(t._sentryDebugIds=t._sentryDebugIds||{},t._sentryDebugIds[l]="07b10cbe-5bde-4052-b96e-ed6bdbc73259",t._sentryDebugIdIdentifier="sentry-dbid-07b10cbe-5bde-4052-b96e-ed6bdbc73259")}catch{}})();const Mt=(t,l)=>new Promise((n,u)=>{const g=t.map(i=>new Promise(s=>{l(i),s()}));Promise.all(g).then(()=>{setTimeout(()=>{n()},2e3)}).catch(i=>{u(i)})}),jt=kt(function(t,l){const n=H(t),{signedInUser:u,isDebitCardFeatureEnabled:g}=l,i=b(t),s=J(t),{currentTab:h}=i;return{notificationView:i,isNotificationSettingsVisible:u.userEmail!=null&&yt(n.notificationSettings,u.userEmail,g,s),isDisabled:i.notificationDetailsByTab[h].fetchState==="In-Progress"?"disabled":void 0}},function(t,l){const{location:n,tenantEmailDomain:u,loggedInUserRoleMap:g,externalNotificationsUnreadCount:i,allUnreadCommentsNotificationIds:s,navigate:h,markInboxNotificationAsRead:B,fetchMoreCommentsNotifications:R}=l;return{onNotificationClick:(a,o,m,c)=>{if(c==="task_deleted"){const r=`/${u}/tasks`,I=N(n.state?.pathnameStackToGoBack,n.pathname);h(r,{state:{pathnameStackToGoBack:I,message:"triggerBackClick"}})}else{const r=`/${u}/tasks/${o}`,I=N(n.state?.pathnameStackToGoBack,n.pathname);h(r,{state:{pathnameStackToGoBack:I,message:"triggerBackClick"}})}m==="unread"&&t(Q("task_manager","read",[a],!1))},onCommentNotificationClick:(a,o,m)=>{const c=o.toString().split(`/${u}/`);if(c[1]!=null){m==="unread"&&(B(a),t($([a],F())));let r=`/${u}/${c[1]}`;const I=N(n.state?.pathnameStackToGoBack,n.pathname);c[1].startsWith("reimbursement")&&!At(g)&&(r="not-found"),c[1].startsWith("bill")&&!Nt(g)&&(r="not-found"),h(r,{state:{pathnameStackToGoBack:I,message:"triggerBackClick"}})}},onUpdateNotificationViewUIState:(a,o)=>{t(y(a,o))},onUpdateNotificationTabState:(a,o)=>{t(d(a,o))},onUpdateNotificationViewCurrentTabAndSubTab:(a,o)=>{t(X(a,o));const m=`../${a}`,c=N(n.state?.pathnameStackToGoBack,n.pathname);h(m,{state:{pathnameStackToGoBack:c}})},onUpdateNotificationViewSubTab:a=>{t(Et(a))},onFetchMoreNotifications:(a,o)=>{if(a==="tasks"){const m=[];o==="all"?m.push("read","unread"):o!=="mentions"&&m.push(o),t(M("task_manager","dashboard",m))}else R?.()},onUpdateNotificationStatus:(a,o,m,c)=>{a==="tasks"?t(Q("task_manager",m,c)):(t(d({markAsReadState:{fetchState:"In-Progress",error:void 0}},"comments")),Promise.all(c.map(r=>{m==="read"&&(B(r),t($([r],F())))})).then(()=>{t(d({markAsReadState:{fetchState:"Completed",error:void 0},selectedNotificationIds:[]},"comments")),t(y({unreadCount:i-c.length>0?i-c.length:0},"comments")),t(w({messageSection:"notification_mark_as_read",messageText:"success",type:"success",showStatusIcon:!0}))},r=>{t(d({markAsReadState:{fetchState:"Error",error:r}},"comments")),t(w({messageSection:"notification_mark_as_read",messageText:"failed",type:"error",showStatusIcon:!0}))}).catch(r=>{t(d({markAsReadState:{fetchState:"Error",error:r}},"comments")),t(w({messageSection:"notification_mark_as_read",messageText:"failed",type:"error",showStatusIcon:!0}))}))},onMarkAllNotificationsAsRead:a=>{a==="tasks"?t(_t("task_manager","read")):(t(d({markAsAllReadState:{fetchState:"In-Progress",error:void 0}},"comments")),Mt(s,B).then(()=>{t($(s,F())),t(d({markAsAllReadState:{fetchState:"Completed",error:void 0}},"comments")),t(y({unreadCount:0},"comments")),t(w({messageSection:"notification_mark_as_read",messageText:"success",type:"success",showStatusIcon:!0}))}).catch(o=>{t(d({markAsAllReadState:{fetchState:"Error",error:o}},"comments")),t(w({messageSection:"notification_mark_as_read",messageText:"failed",type:"error",showStatusIcon:!0}))}))},onBackClick:()=>{const a=$t(n.state?.pathnameStackToGoBack),o=a.poppedPathname??"../../dashboard";h(o,{state:{pathnameStackToGoBack:a.newStack}})},onSettingsClick:()=>{const a=N(n.state?.pathnameStackToGoBack,n.pathname);h("../../settings/notifications",{state:{pathnameStackToGoBack:a}})}}})(Dt(Gt)),Vt=()=>{const t=ft(),l=ut(),{tenantEmailDomain:n,selectedTab:u}=ht(),{areTenantIdsInSync:g}=Bt(),i=St(u??""),s=pt(),h=xt.getSignedInUser(),[B,R]=k.useState(!1),a=S(e=>H(e)),o=S(e=>J(e)),{useFeatureGate:m}=wt(),{isFeatureEnabled:c}=m(Rt.isDebitCardFeatureEnabled),{isAiCfoAccessEnabled:r,onAskAiCfoClick:I}=Ft({mobileExploreReferrer:"Notifications"});Ut({isDataReady:!0});const Y=bt(o.userRole);if(o==null||n==null||o.companyId==null)throw Error("Can't access notifications page without current tenant...");if(h==null)throw Error("Can't access notifications page without signed in...");const j=S(e=>b(e).notificationDetailsByTab.tasks.fetchState),V=S(e=>b(e).currentTab),U=S(e=>b(e).currentSubTab),Z=S(e=>b(e).notificationDetailsByTab.comments.fetchCountState),v=S(e=>b(e).notificationDetailsByTab.comments.fetchState),tt=S(e=>b(e).notificationDetailsByTab.comments.uiState.unreadCount),et=S(e=>b(e).allExternalNotifications).filter(e=>e.inboxNotification.readAt==null).map(e=>e.inboxNotification.id),at=vt().allUsers,{inboxNotifications:x,isLoading:_,hasFetchedAll:C,isFetchingMore:D,fetchMore:ot}=ct(),{threads:W,isLoading:z,fetchMore:L,isFetchingMore:q,hasFetchedAll:K}=mt({query:{metadata:{companyId:o.companyId,application:"dashboard"}}});k.useEffect(()=>{if(V!==i&&i!=null&&s(X(i)),i==null){const e=`../${V}`,p=N(l.state?.pathnameStackToGoBack,l.pathname);t(e,{state:{pathnameStackToGoBack:p}})}},[i]),k.useEffect(()=>{Z.fetchState==="Not-Started"&&s(d({fetchCountState:{fetchState:"In-Progress",error:void 0}},"comments"))},[]),k.useEffect(()=>{if(_===!1&&C===!0&&o?.companyId!=null&&x!=null){const e=`dashboard_${o.companyId}`,p=x.filter(T=>T.roomId===e&&T.readAt==null).length;s(d({fetchCountState:{fetchState:"Completed",error:void 0}},"comments")),s(y({unreadCount:p},"comments"))}},[_,C]),k.useEffect(()=>{j!=="In-Progress"&&g&&s(M("task_manager","dashboard",["read","unread"]))},[g]),k.useEffect(()=>{const e=setTimeout(()=>ot?.(),0);return()=>clearTimeout(e)});const G=_||D===!0||C!==!0||_||D===!0||C!==!0;k.useEffect(()=>{G&&v!=="In-Progress"?s(d({fetchState:"In-Progress",error:void 0},"comments")):G||v!=="In-Progress"||s(d({fetchState:"Completed",error:void 0},"comments"))},[G,v]),k.useEffect(()=>{s(y({hasMore:C!==!0},"comments"))},[C]),k.useEffect(()=>{a.fetchState!=="In-Progress"&&a.fetchState!=="Completed"&&B===!1&&(R(!0),s(It()))},[a.fetchState]),k.useEffect(()=>{if(_===!1&&z===!1&&x!=null&&W!=null){const e=`dashboard_${o.companyId}`,p=x.filter(f=>f.roomId===e).filter(f=>f.kind==="thread"),T=p.filter(f=>f.readAt==null),E=p.map(f=>f.id),it=p.map(f=>{const P=W.find(rt=>rt.id===f.threadId);return P!=null?{inboxNotification:{...f,threadId:P.id},thread:P}:(q||K===!0||L==null||L(),null)}).filter(f=>f!=null);s(d({allNotificationsIds:E},"comments")),s(y({totalCount:E.length,unreadCount:T.length},"comments")),s(Ct(it))}},[_,D,q,C,K,z,x?.length]);const st={events:o.userRoleId!=null?[`private-encrypted-${o.userRoleId}.dashboard-user-notification`]:[],eventCallback:(e,p)=>{if(Pt(p)){const T=Tt(p.mode);if(T==="dashboard"&&s(y({unreadCount:p.data.unread},"tasks")),j!=="In-Progress"){const E=[];U==="all"?E.push("read","unread"):U!=="mentions"&&E.push(U),s(M("task_manager",T,E,!0))}}}},nt=dt();return A.jsx(jt,{tenantEmailDomain:n,loggedInUserRoleMap:Y,signedInUser:h,externalNotificationsUnreadCount:tt,location:l,navigate:t,isDebitCardFeatureEnabled:c,users:at,markInboxNotificationAsRead:nt,allUnreadCommentsNotificationIds:et,isAiCfoAccessEnabled:r,onAskAiCfoClick:I,...st})};function ne(){return A.jsxs(gt,{children:[A.jsx(O,{path:"/:selectedTab",element:A.jsx(Vt,{})}),A.jsx(O,{path:"*",element:A.jsx(lt,{})})]})}export{ne as default};
@@ -1 +1 @@
1
- import{j as m}from"./liveblocks-BUQfB0Zp.js";import{a as r}from"./sentry-BLIwU6uZ.js";import{u as T,g as A,j as o,N as j}from"./core-OMb8nkC1.js";import{LW as C,eV as P,fJ as x,LX as z,LY as D,LZ as M,L_ as R,o3 as k,KT as N}from"./zeni-epic-state-BZ6N8nVI.js";import{z as h,I}from"./index-DLAYU8mN.js";import"./mui-JZY-3hhJ.js";import"./recharts-DAM4r1-u.js";import"./analytics-BLbM2ksu.js";import"./plaid-B_OuebQv.js";import"./dnd-DVcQZAG5.js";import"./stripe-DMRn4zHo.js";import"./lottie-DDI83OWz.js";import"./lexical-CNfNgAkp.js";import"./pdf-6FZlivdz.js";import"./utils-Bia5qc4p.js";(function(){try{var n=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},a=new n.Error().stack;a&&(n._sentryDebugIds=n._sentryDebugIds||{},n._sentryDebugIds[a]="829cb450-ab43-4998-ad80-03a06c6bdfe5",n._sentryDebugIdIdentifier="sentry-dbid-829cb450-ab43-4998-ad80-03a06c6bdfe5")}catch{}})();function ee(){const n=T(),a=A(),{params:t,error:i}=r.useMemo(()=>C(a.search),[a.search]),w=r.useMemo(()=>new URLSearchParams(a.search).get("client_name")??t?.clientId??"Unknown Application",[a.search,t]),p=h.isSignedIn(),s=h.getSignedInUser(),f=o(e=>P(e)),l=o(e=>x(e)),d=o(e=>e.tenantState.fetchState),b=o(z),y=o(D),c=o(M),[v,S]=r.useState(null),[E,_]=r.useState(null);r.useEffect(()=>{document.querySelector("#app-shell-loader")?.remove()},[]),r.useEffect(()=>()=>{n(R())},[n,a.search]),r.useEffect(()=>{i!=null&&console.warn("[OAuthConsent] invalid params:",i)},[i]);const g=r.useRef(!1);r.useEffect(()=>{p&&s!=null&&!g.current&&(d!=="Not-Started"&&d!=="Error"||(g.current=!0,n(k(s.userId,s.zeniSessionId??void 0))))},[p,s,d,n]),r.useEffect(()=>{c!=null&&c!==""&&(window.location.href=c)},[c]);const U=r.useMemo(()=>{if(f?.tenantId!=null)return f.tenantId;const e=h.getActiveTenantForUser()?.tenantId;return e!=null&&l.some(L=>L.tenantId===e)?e:l.length===1?l[0].tenantId:null},[f?.tenantId,l]),u=v??U;return i!=null?m.jsx(I,{variant:"invalid_params",paramsError:i}):p?m.jsx(I,{variant:"signed_in",clientName:w,userEmail:s?.userEmail,isInitializing:d!=="Completed",tenants:l,selectedTenantId:u,onSelectTenant:S,approveError:E??y,isApproving:b==="In-Progress",showAllowButton:u!=null,onApprove:()=>{t!=null&&s!=null&&u!=null&&n(N(s.userId,s.zeniSessionId??void 0,u,t.clientId,t.redirectUri,t.codeChallenge,t.codeChallengeMethod,t.state,t.responseType))},onDeny:()=>{if(t!=null)try{const e=new URL(t.redirectUri);e.searchParams.set("error","access_denied"),e.searchParams.set("error_description","The user denied the request"),e.searchParams.set("state",t.state),window.location.href=e.toString()}catch{_("Unable to deny: redirect_uri is not a valid URL. Close this window or contact support.")}}}):m.jsx(j,{to:"/signin/auth",state:{origin:a.pathname+a.search},replace:!0})}export{ee as default};
1
+ import{j as m}from"./liveblocks-BUQfB0Zp.js";import{a as r}from"./sentry-BLIwU6uZ.js";import{u as T,g as A,j as o,N as j}from"./core-OMb8nkC1.js";import{LW as C,eV as P,fJ as x,LX as z,LY as D,LZ as M,L_ as R,o3 as k,KT as N}from"./zeni-epic-state-BZ6N8nVI.js";import{z as h,I}from"./index-NcZU0lXl.js";import"./mui-JZY-3hhJ.js";import"./recharts-DAM4r1-u.js";import"./analytics-BLbM2ksu.js";import"./plaid-B_OuebQv.js";import"./dnd-DVcQZAG5.js";import"./stripe-DMRn4zHo.js";import"./lottie-DDI83OWz.js";import"./lexical-CNfNgAkp.js";import"./pdf-6FZlivdz.js";import"./utils-Bia5qc4p.js";(function(){try{var n=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},a=new n.Error().stack;a&&(n._sentryDebugIds=n._sentryDebugIds||{},n._sentryDebugIds[a]="829cb450-ab43-4998-ad80-03a06c6bdfe5",n._sentryDebugIdIdentifier="sentry-dbid-829cb450-ab43-4998-ad80-03a06c6bdfe5")}catch{}})();function ee(){const n=T(),a=A(),{params:t,error:i}=r.useMemo(()=>C(a.search),[a.search]),w=r.useMemo(()=>new URLSearchParams(a.search).get("client_name")??t?.clientId??"Unknown Application",[a.search,t]),p=h.isSignedIn(),s=h.getSignedInUser(),f=o(e=>P(e)),l=o(e=>x(e)),d=o(e=>e.tenantState.fetchState),b=o(z),y=o(D),c=o(M),[v,S]=r.useState(null),[E,_]=r.useState(null);r.useEffect(()=>{document.querySelector("#app-shell-loader")?.remove()},[]),r.useEffect(()=>()=>{n(R())},[n,a.search]),r.useEffect(()=>{i!=null&&console.warn("[OAuthConsent] invalid params:",i)},[i]);const g=r.useRef(!1);r.useEffect(()=>{p&&s!=null&&!g.current&&(d!=="Not-Started"&&d!=="Error"||(g.current=!0,n(k(s.userId,s.zeniSessionId??void 0))))},[p,s,d,n]),r.useEffect(()=>{c!=null&&c!==""&&(window.location.href=c)},[c]);const U=r.useMemo(()=>{if(f?.tenantId!=null)return f.tenantId;const e=h.getActiveTenantForUser()?.tenantId;return e!=null&&l.some(L=>L.tenantId===e)?e:l.length===1?l[0].tenantId:null},[f?.tenantId,l]),u=v??U;return i!=null?m.jsx(I,{variant:"invalid_params",paramsError:i}):p?m.jsx(I,{variant:"signed_in",clientName:w,userEmail:s?.userEmail,isInitializing:d!=="Completed",tenants:l,selectedTenantId:u,onSelectTenant:S,approveError:E??y,isApproving:b==="In-Progress",showAllowButton:u!=null,onApprove:()=>{t!=null&&s!=null&&u!=null&&n(N(s.userId,s.zeniSessionId??void 0,u,t.clientId,t.redirectUri,t.codeChallenge,t.codeChallengeMethod,t.state,t.responseType))},onDeny:()=>{if(t!=null)try{const e=new URL(t.redirectUri);e.searchParams.set("error","access_denied"),e.searchParams.set("error_description","The user denied the request"),e.searchParams.set("state",t.state),window.location.href=e.toString()}catch{_("Unable to deny: redirect_uri is not a valid URL. Close this window or contact support.")}}}):m.jsx(j,{to:"/signin/auth",state:{origin:a.pathname+a.search},replace:!0})}export{ee as default};
@@ -1 +1 @@
1
- import{j as n}from"./liveblocks-BUQfB0Zp.js";import{h as z,u as Z,g as H,i as J,j as d,n as K,o as Q,p as I}from"./core-OMb8nkC1.js";import{eV as M,s6 as P,rG as X,Mr as O,rB as y,bs as ee,bn as ae,bY as te,rC as se,Ms as oe,Me as C,dI as re,vB as ne,Mt as ce,vY as ie,fA as le,fy as de}from"./zeni-epic-state-BZ6N8nVI.js";import{z as me,W as fe,_ as pe,j as ue,a as U,F as B,E as he,d as $,ao as be,s as Fe}from"./index-DLAYU8mN.js";import"./mui-JZY-3hhJ.js";import ge from"./NotFoundScreen-uCKl6Wx4.js";import{F as Ie}from"./FeaturePreviewScreen-DVS7yzIQ.js";import{a as b}from"./sentry-BLIwU6uZ.js";import{u as Ce}from"./useAskAiCfoHostNavButtonProps-Cw5yceVN.js";import{u as ye}from"./useInitialThreadRequest-CgLG7-4I.js";import{t as Se}from"./routePaths-CLQbotzs.js";import{M as Te}from"./MobileAppDrawer-BzjU__HS.js";import"./recharts-DAM4r1-u.js";import"./analytics-BLbM2ksu.js";import"./plaid-B_OuebQv.js";import"./dnd-DVcQZAG5.js";import"./stripe-DMRn4zHo.js";import"./lottie-DDI83OWz.js";import"./lexical-CNfNgAkp.js";import"./pdf-6FZlivdz.js";import"./utils-Bia5qc4p.js";(function(){try{var s=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},e=new s.Error().stack;e&&(s._sentryDebugIds=s._sentryDebugIds||{},s._sentryDebugIds[e]="c9badcbc-caf1-4bc8-aa0a-1bb89d6b4102",s._sentryDebugIdIdentifier="sentry-dbid-c9badcbc-caf1-4bc8-aa0a-1bb89d6b4102")}catch{}})();const S=(s,e,a,o)=>{if(s!=e){const r=o??"";s!=null&&s.length>0?a(`../${e}${r}`,{replace:!0}):a(`${e}${r}`,{replace:!0})}},Ae=K(function(s){const e=oe(s),a={},o=e.pandLReportWithForecast.uiState.nodeCollapseState;return Object.keys(o).forEach(r=>{a[r]=o[r]===!1}),{selectedTimeframe:e.selectedTimeframe,isForecastVsActualOn:e.isForecastVsActualOn,compareMode:e.compareMode,forecastList:e.forecastList,selectedForecast:e.selectedForecast,pandLreport:e.pandLReportWithForecast,scrollPosition:e.pandLReportWithForecast.uiState.scrollPosition,nodeOpenStatus:a,type:"name+balances_forecast",analytics:$}},function(s,e){return{onForecastSelectionChanged:(a,o)=>{s(O(a,o)),e.isPandLReportFetched(a)||s(y(a)),S(e.forecastIdFromUrlPath,a,e.navigate)},onTimeframeChanged:a=>{s(ie(a))},onForecastVsActualsCompareToggle:a=>{s(ce(a)),s(C({forecastId:e.forecastIdFromUrlPath,scrollPosition:{scrollLeft:0,scrollTop:0}}))},onCompareModeChanged:a=>{s(ne(e.firstMonthOfFY,a,0,[]))},onAccountBalanceClick:e.hasTransactionAccess!==!0?void 0:(a,o)=>{let r,c;const p=a.accountName===""?a.accountDescription:a.accountName;if(o.balanceTimeFrame==="month"||o.balanceTimeFrame==="quarter"?(r=o.balanceTimeFrame,c=re(o)):o.balanceTimeFrame==="year"?(r="quarter",c={startDate:o.endDate.startOf("quarter"),endDate:o.endDate}):console.error(`timeframe ${o.balanceTimeFrame} is not supported`),c!=null&&r!=null){const m=Se(e.tenantEmailDomain,a.accountId,a.accountType,p,r,c),u=Fe(e.location.state?.pathnameStackToGoBack,e.location.pathname);e.navigate(m,{state:{pathnameStackToGoBack:u,referrer:"Forecast"}})}},onNodeCollapseToggled:(a,o)=>{s(C({forecastId:e.forecastIdFromUrlPath,nodeCollapseState:{nodeId:a,isCollapsed:o===!1}}))},onTableScroll:a=>{s(C({forecastId:e.forecastIdFromUrlPath,scrollPosition:a}))},onBackClick:()=>{e.navigate("../../")}}})(be);function v(){const s=z(),e=Z(),a=H(),{forecastId:o,tenantEmailDomain:r}=J(),[c,p]=b.useState(!1),[m,u]=b.useState(!1),h=me.getSignedInUser(),T=d(t=>M(t)),w=T.company?.companyInfo.firstMonthOfFY??1,i=d(t=>P(t.forecastState,t.forecastListState)),l=d(t=>t.forecastListState.fetchState==="Completed"),A=d(t=>t.profitAndLossState),k=d(t=>t.reportUIOptionsState.selectedForecast),x=t=>A.pandLByForecastID[t]!=null&&se(t,A).reducedAllFetchState.fetchState==="Completed",{areTenantIdsInSync:F}=fe();pe({isDataReady:l});const{isAiCfoAccessEnabled:G,onAskAiCfoClick:W}=Ce({mobileExploreReferrer:"Forecast"});b.useEffect(()=>{if(!c&&F)p(!0),l||e(X());else if(l&&!m){u(!0);const t=((f,L,R)=>L!=null?f.forecasts.findIndex(g=>g.id===L):R!=null?f.forecasts.findIndex(g=>g.id===R):f.forecasts.length>0?0:-1)(i,o,k?.id);t===-1&&o!=null?s("page-not-found",{replace:!0}):t!==-1&&t!=k?.index?(e(O(i.forecasts[t].id,t)),S(o,i.forecasts[t].id,s,a.search)):o==null&&t!==-1&&S(void 0,i.forecasts[t].id,s,a.search),t!==-1&&!x(i.forecasts[t].id)&&F&&e(y(i.forecasts[t].id))}},[c,p,e,l,i,m,u,P,y,F]);const D=ue(),_=D?.loggedInUserRole!=null&&ee(D.loggedInUserRole),{useFeatureGate:N}=U(),{isFeatureEnabled:j}=N(B.isReportsCommentingEnabled),Y=ye(j?T?.companyId:void 0,{clearParams:l&&m}),[q,V]=b.useState(!1),E=t=>{V(t)};return n.jsxs(n.Fragment,{children:[l?n.jsx(he,{analytics:$,onLoad:t=>(f=>f.trackForecast())(t)}):null,n.jsx(Te,{isAppContentDrawerOpen:q,handleDrawerToggle:E}),n.jsx(Ae,{firstMonthOfFY:w,tenantEmailDomain:r,forecastIdFromUrlPath:o,navigate:s,location:a,isPandLReportFetched:x,meetingUrl:te(`https://meetings.hubspot.com/svitlana-grankovska?firstname=${h?.firstName}&lastname=${h?.lastName}&email=${h?.userEmail}`),hasTransactionAccess:_,isAiCfoAccessEnabled:G,onAskAiCfoClick:W,isReportsCommentingEnabled:j,isZeniUser:ae(h),initialOpenThreadRequest:Y,onClickMenuIcon:()=>{E(!0)}})]})}function Ve(){const s=d(c=>M(c)),{useFeatureGate:e}=U(),{isFeatureEnabled:a}=e(B.isDebitCardFeatureEnabled),o=le(a,s),r=de(s);return o===!0||r===!0?n.jsx(Ie,{}):n.jsxs(Q,{children:[n.jsx(I,{path:"/",element:n.jsx(v,{})}),n.jsx(I,{path:"/:forecastId",element:n.jsx(v,{})}),n.jsx(I,{path:"/:forecastId/*",element:n.jsx(ge,{})})]})}export{Ve as PandLWithForecastRoutes,Ve as default};
1
+ import{j as n}from"./liveblocks-BUQfB0Zp.js";import{h as z,u as Z,g as H,i as J,j as d,n as K,o as Q,p as I}from"./core-OMb8nkC1.js";import{eV as M,s6 as P,rG as X,Mr as O,rB as y,bs as ee,bn as ae,bY as te,rC as se,Ms as oe,Me as C,dI as re,vB as ne,Mt as ce,vY as ie,fA as le,fy as de}from"./zeni-epic-state-BZ6N8nVI.js";import{z as me,W as fe,_ as pe,j as ue,a as U,F as B,E as he,d as $,ao as be,s as Fe}from"./index-NcZU0lXl.js";import"./mui-JZY-3hhJ.js";import ge from"./NotFoundScreen-CxRYls3k.js";import{F as Ie}from"./FeaturePreviewScreen-DgqstYkZ.js";import{a as b}from"./sentry-BLIwU6uZ.js";import{u as Ce}from"./useAskAiCfoHostNavButtonProps-DS5Fxq3U.js";import{u as ye}from"./useInitialThreadRequest-Bh1NrHII.js";import{t as Se}from"./routePaths-DZldr9mG.js";import{M as Te}from"./MobileAppDrawer-B4f1me8_.js";import"./recharts-DAM4r1-u.js";import"./analytics-BLbM2ksu.js";import"./plaid-B_OuebQv.js";import"./dnd-DVcQZAG5.js";import"./stripe-DMRn4zHo.js";import"./lottie-DDI83OWz.js";import"./lexical-CNfNgAkp.js";import"./pdf-6FZlivdz.js";import"./utils-Bia5qc4p.js";(function(){try{var s=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},e=new s.Error().stack;e&&(s._sentryDebugIds=s._sentryDebugIds||{},s._sentryDebugIds[e]="c9badcbc-caf1-4bc8-aa0a-1bb89d6b4102",s._sentryDebugIdIdentifier="sentry-dbid-c9badcbc-caf1-4bc8-aa0a-1bb89d6b4102")}catch{}})();const S=(s,e,a,o)=>{if(s!=e){const r=o??"";s!=null&&s.length>0?a(`../${e}${r}`,{replace:!0}):a(`${e}${r}`,{replace:!0})}},Ae=K(function(s){const e=oe(s),a={},o=e.pandLReportWithForecast.uiState.nodeCollapseState;return Object.keys(o).forEach(r=>{a[r]=o[r]===!1}),{selectedTimeframe:e.selectedTimeframe,isForecastVsActualOn:e.isForecastVsActualOn,compareMode:e.compareMode,forecastList:e.forecastList,selectedForecast:e.selectedForecast,pandLreport:e.pandLReportWithForecast,scrollPosition:e.pandLReportWithForecast.uiState.scrollPosition,nodeOpenStatus:a,type:"name+balances_forecast",analytics:$}},function(s,e){return{onForecastSelectionChanged:(a,o)=>{s(O(a,o)),e.isPandLReportFetched(a)||s(y(a)),S(e.forecastIdFromUrlPath,a,e.navigate)},onTimeframeChanged:a=>{s(ie(a))},onForecastVsActualsCompareToggle:a=>{s(ce(a)),s(C({forecastId:e.forecastIdFromUrlPath,scrollPosition:{scrollLeft:0,scrollTop:0}}))},onCompareModeChanged:a=>{s(ne(e.firstMonthOfFY,a,0,[]))},onAccountBalanceClick:e.hasTransactionAccess!==!0?void 0:(a,o)=>{let r,c;const p=a.accountName===""?a.accountDescription:a.accountName;if(o.balanceTimeFrame==="month"||o.balanceTimeFrame==="quarter"?(r=o.balanceTimeFrame,c=re(o)):o.balanceTimeFrame==="year"?(r="quarter",c={startDate:o.endDate.startOf("quarter"),endDate:o.endDate}):console.error(`timeframe ${o.balanceTimeFrame} is not supported`),c!=null&&r!=null){const m=Se(e.tenantEmailDomain,a.accountId,a.accountType,p,r,c),u=Fe(e.location.state?.pathnameStackToGoBack,e.location.pathname);e.navigate(m,{state:{pathnameStackToGoBack:u,referrer:"Forecast"}})}},onNodeCollapseToggled:(a,o)=>{s(C({forecastId:e.forecastIdFromUrlPath,nodeCollapseState:{nodeId:a,isCollapsed:o===!1}}))},onTableScroll:a=>{s(C({forecastId:e.forecastIdFromUrlPath,scrollPosition:a}))},onBackClick:()=>{e.navigate("../../")}}})(be);function v(){const s=z(),e=Z(),a=H(),{forecastId:o,tenantEmailDomain:r}=J(),[c,p]=b.useState(!1),[m,u]=b.useState(!1),h=me.getSignedInUser(),T=d(t=>M(t)),w=T.company?.companyInfo.firstMonthOfFY??1,i=d(t=>P(t.forecastState,t.forecastListState)),l=d(t=>t.forecastListState.fetchState==="Completed"),A=d(t=>t.profitAndLossState),k=d(t=>t.reportUIOptionsState.selectedForecast),x=t=>A.pandLByForecastID[t]!=null&&se(t,A).reducedAllFetchState.fetchState==="Completed",{areTenantIdsInSync:F}=fe();pe({isDataReady:l});const{isAiCfoAccessEnabled:G,onAskAiCfoClick:W}=Ce({mobileExploreReferrer:"Forecast"});b.useEffect(()=>{if(!c&&F)p(!0),l||e(X());else if(l&&!m){u(!0);const t=((f,L,R)=>L!=null?f.forecasts.findIndex(g=>g.id===L):R!=null?f.forecasts.findIndex(g=>g.id===R):f.forecasts.length>0?0:-1)(i,o,k?.id);t===-1&&o!=null?s("page-not-found",{replace:!0}):t!==-1&&t!=k?.index?(e(O(i.forecasts[t].id,t)),S(o,i.forecasts[t].id,s,a.search)):o==null&&t!==-1&&S(void 0,i.forecasts[t].id,s,a.search),t!==-1&&!x(i.forecasts[t].id)&&F&&e(y(i.forecasts[t].id))}},[c,p,e,l,i,m,u,P,y,F]);const D=ue(),_=D?.loggedInUserRole!=null&&ee(D.loggedInUserRole),{useFeatureGate:N}=U(),{isFeatureEnabled:j}=N(B.isReportsCommentingEnabled),Y=ye(j?T?.companyId:void 0,{clearParams:l&&m}),[q,V]=b.useState(!1),E=t=>{V(t)};return n.jsxs(n.Fragment,{children:[l?n.jsx(he,{analytics:$,onLoad:t=>(f=>f.trackForecast())(t)}):null,n.jsx(Te,{isAppContentDrawerOpen:q,handleDrawerToggle:E}),n.jsx(Ae,{firstMonthOfFY:w,tenantEmailDomain:r,forecastIdFromUrlPath:o,navigate:s,location:a,isPandLReportFetched:x,meetingUrl:te(`https://meetings.hubspot.com/svitlana-grankovska?firstname=${h?.firstName}&lastname=${h?.lastName}&email=${h?.userEmail}`),hasTransactionAccess:_,isAiCfoAccessEnabled:G,onAskAiCfoClick:W,isReportsCommentingEnabled:j,isZeniUser:ae(h),initialOpenThreadRequest:Y,onClickMenuIcon:()=>{E(!0)}})]})}function Ve(){const s=d(c=>M(c)),{useFeatureGate:e}=U(),{isFeatureEnabled:a}=e(B.isDebitCardFeatureEnabled),o=le(a,s),r=de(s);return o===!0||r===!0?n.jsx(Ie,{}):n.jsxs(Q,{children:[n.jsx(I,{path:"/",element:n.jsx(v,{})}),n.jsx(I,{path:"/:forecastId",element:n.jsx(v,{})}),n.jsx(I,{path:"/:forecastId/*",element:n.jsx(ge,{})})]})}export{Ve as PandLWithForecastRoutes,Ve as default};
@@ -1,4 +1,4 @@
1
- import{j as s}from"./liveblocks-BUQfB0Zp.js";import{Mn as te,eV as J,kq as G,fA as X,fy as ne,JR as Q,M1 as oe,uz as Ee,Mo as N,uo as ke,uI as Ie,uC as ie,us as re,uG as Pe,uD as je,Mp as le,wn as Le,fk as Te,gb as ve,Mq as M,uw as de,uv as ce,uL as Fe,c6 as Ae}from"./zeni-epic-state-BZ6N8nVI.js";import{J as pe,a as Y,F as E,z as H,a9 as ue,H as me,ak as ge,al as Re,A as he,o as R,N as fe,D as Ce,am as Oe,W as Ve,_ as Ue,E as Be,d as be,f as Ze,s as $e,an as Me,j as _e}from"./index-DLAYU8mN.js";import{D as ye,n as W,S as we}from"./mui-JZY-3hhJ.js";import ae from"./NotFoundScreen-uCKl6Wx4.js";import{a as r}from"./sentry-BLIwU6uZ.js";import{u as ee,i as ze,j as m,h as Ge,g as He,n as We,o as se,p as $}from"./core-OMb8nkC1.js";import{u as qe}from"./useAskAiCfoHostNavButtonProps-Cw5yceVN.js";import{M as Ke}from"./MobileAppDrawer-BzjU__HS.js";import"./recharts-DAM4r1-u.js";import"./analytics-BLbM2ksu.js";import"./plaid-B_OuebQv.js";import"./dnd-DVcQZAG5.js";import"./stripe-DMRn4zHo.js";import"./lottie-DDI83OWz.js";import"./lexical-CNfNgAkp.js";import"./pdf-6FZlivdz.js";import"./utils-Bia5qc4p.js";(function(){try{var a=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new a.Error().stack;t&&(a._sentryDebugIds=a._sentryDebugIds||{},a._sentryDebugIds[t]="5281461f-1edf-4109-b234-5e3c7407123f",a._sentryDebugIdIdentifier="sentry-dbid-5281461f-1edf-4109-b234-5e3c7407123f")}catch{}})();const Ne={overlayWidth:new he(100,100,48)},_=Ce.getLocalizedStrings().peoplePage.invitePage,Je=({companyId:a,managersListView:t,companyPassportView:l,classListView:n,mode:g,isEditPeopleDrawerOpen:o,closeDrawerHandler:y})=>{const h=pe(),p=ee(),[O,V]=r.useState(!1),[I,w]=r.useState(!1),{userId:S}=ze(),d=m(e=>te(e)),u=m(e=>J(e)),D=m(e=>G(e)),{useFeatureGate:f}=Y(),{isFeatureEnabled:k}=f(E.isDebitCardFeatureEnabled),P=X(k,u),T=ne(u),v=Q(u),U=oe(u),B=!!u.company?.featuresActivationInfo?.isReimbursementFeatureEnabled,x=!P&&D&&n.fetchState!=="Completed"||t.fetchState!=="Completed"||l.fetchState!=="Completed"||a==null;if(H.getSignedInUser()==null)throw Error("Can't access invite people page without signing in...");const C=()=>{p(N()),y()},F=()=>{O===!0?w(!0):C()},Z=l.companyView?.controllers?.map(e=>e.user),{isFeatureEnabled:c}=f(E.isDepositAccountsFeatureEnabled),{isFeatureEnabled:j}=f(E.isChargeCardFeatureEnabled),L=ue(u,j,k),{isFeatureEnabled:A}=f(E.isTreasuryEnabled),b={peopleDetails:d,classList:n.classes,managersList:t.users,controllersList:Z,mode:g,isZeniTenant:v,isAccountingClassesEnabled:D,isReimbursementDisabled:B===!1,isZeniAccountsDisabled:c===!1,isChargeCardDisabled:L===!1,isTreasuryDisabled:A===!1,isLiteRoleDisabled:U===!1,isBankingOnlyTenant:P,isCardsOnlyTenant:T,onResetClick:C,onDeleteUser:e=>{p(re(e.userId,e.userRole.userRoleId))},onPeopleLocalDataUpdated:e=>{p(ie({peopleLocalData:e})),V(!0)},onSaveClick:()=>{p(g==="zeni_only"?ke(a):Ie(v))},onCloseClick:F,isLoading:x||d.person==null},i={onOkClick:()=>{w(!1),C()},onCancelClick:()=>{w(!1)}};return r.useEffect(()=>{x===!1&&S!=null&&p(Ee(S))},[x,S]),r.useEffect(()=>{d.updatePersonState.fetchState==="Completed"&&C()},[d.updatePersonState.fetchState]),s.jsx(ye,{anchor:"right",open:o,PaperProps:{style:{width:Ne.overlayWidth.valuePercentage(h),boxShadow:"none"}},slotProps:{backdrop:{style:{backgroundColor:me.overlayDark,cursor:"pointer"}}},onClose:F,children:s.jsxs(Xe,{onClick:e=>e.stopPropagation(),children:[I===!0?s.jsx(ge,{titleComponent:s.jsx(Se,{children:_.discardTitle}),descriptionComponent:s.jsx(De,{children:_.discardDescription}),primaryButtonText:_.discard,secondaryButtonText:_.no,action:i,isEditPopup:!0}):null,s.jsx(Re,{...b})]})})},Xe=W(we)`
1
+ import{j as s}from"./liveblocks-BUQfB0Zp.js";import{Mn as te,eV as J,kq as G,fA as X,fy as ne,JR as Q,M1 as oe,uz as Ee,Mo as N,uo as ke,uI as Ie,uC as ie,us as re,uG as Pe,uD as je,Mp as le,wn as Le,fk as Te,gb as ve,Mq as M,uw as de,uv as ce,uL as Fe,c6 as Ae}from"./zeni-epic-state-BZ6N8nVI.js";import{J as pe,a as Y,F as E,z as H,a9 as ue,H as me,ak as ge,al as Re,A as he,o as R,N as fe,D as Ce,am as Oe,W as Ve,_ as Ue,E as Be,d as be,f as Ze,s as $e,an as Me,j as _e}from"./index-NcZU0lXl.js";import{D as ye,n as W,S as we}from"./mui-JZY-3hhJ.js";import ae from"./NotFoundScreen-CxRYls3k.js";import{a as r}from"./sentry-BLIwU6uZ.js";import{u as ee,i as ze,j as m,h as Ge,g as He,n as We,o as se,p as $}from"./core-OMb8nkC1.js";import{u as qe}from"./useAskAiCfoHostNavButtonProps-DS5Fxq3U.js";import{M as Ke}from"./MobileAppDrawer-B4f1me8_.js";import"./recharts-DAM4r1-u.js";import"./analytics-BLbM2ksu.js";import"./plaid-B_OuebQv.js";import"./dnd-DVcQZAG5.js";import"./stripe-DMRn4zHo.js";import"./lottie-DDI83OWz.js";import"./lexical-CNfNgAkp.js";import"./pdf-6FZlivdz.js";import"./utils-Bia5qc4p.js";(function(){try{var a=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new a.Error().stack;t&&(a._sentryDebugIds=a._sentryDebugIds||{},a._sentryDebugIds[t]="5281461f-1edf-4109-b234-5e3c7407123f",a._sentryDebugIdIdentifier="sentry-dbid-5281461f-1edf-4109-b234-5e3c7407123f")}catch{}})();const Ne={overlayWidth:new he(100,100,48)},_=Ce.getLocalizedStrings().peoplePage.invitePage,Je=({companyId:a,managersListView:t,companyPassportView:l,classListView:n,mode:g,isEditPeopleDrawerOpen:o,closeDrawerHandler:y})=>{const h=pe(),p=ee(),[O,V]=r.useState(!1),[I,w]=r.useState(!1),{userId:S}=ze(),d=m(e=>te(e)),u=m(e=>J(e)),D=m(e=>G(e)),{useFeatureGate:f}=Y(),{isFeatureEnabled:k}=f(E.isDebitCardFeatureEnabled),P=X(k,u),T=ne(u),v=Q(u),U=oe(u),B=!!u.company?.featuresActivationInfo?.isReimbursementFeatureEnabled,x=!P&&D&&n.fetchState!=="Completed"||t.fetchState!=="Completed"||l.fetchState!=="Completed"||a==null;if(H.getSignedInUser()==null)throw Error("Can't access invite people page without signing in...");const C=()=>{p(N()),y()},F=()=>{O===!0?w(!0):C()},Z=l.companyView?.controllers?.map(e=>e.user),{isFeatureEnabled:c}=f(E.isDepositAccountsFeatureEnabled),{isFeatureEnabled:j}=f(E.isChargeCardFeatureEnabled),L=ue(u,j,k),{isFeatureEnabled:A}=f(E.isTreasuryEnabled),b={peopleDetails:d,classList:n.classes,managersList:t.users,controllersList:Z,mode:g,isZeniTenant:v,isAccountingClassesEnabled:D,isReimbursementDisabled:B===!1,isZeniAccountsDisabled:c===!1,isChargeCardDisabled:L===!1,isTreasuryDisabled:A===!1,isLiteRoleDisabled:U===!1,isBankingOnlyTenant:P,isCardsOnlyTenant:T,onResetClick:C,onDeleteUser:e=>{p(re(e.userId,e.userRole.userRoleId))},onPeopleLocalDataUpdated:e=>{p(ie({peopleLocalData:e})),V(!0)},onSaveClick:()=>{p(g==="zeni_only"?ke(a):Ie(v))},onCloseClick:F,isLoading:x||d.person==null},i={onOkClick:()=>{w(!1),C()},onCancelClick:()=>{w(!1)}};return r.useEffect(()=>{x===!1&&S!=null&&p(Ee(S))},[x,S]),r.useEffect(()=>{d.updatePersonState.fetchState==="Completed"&&C()},[d.updatePersonState.fetchState]),s.jsx(ye,{anchor:"right",open:o,PaperProps:{style:{width:Ne.overlayWidth.valuePercentage(h),boxShadow:"none"}},slotProps:{backdrop:{style:{backgroundColor:me.overlayDark,cursor:"pointer"}}},onClose:F,children:s.jsxs(Xe,{onClick:e=>e.stopPropagation(),children:[I===!0?s.jsx(ge,{titleComponent:s.jsx(Se,{children:_.discardTitle}),descriptionComponent:s.jsx(De,{children:_.discardDescription}),primaryButtonText:_.discard,secondaryButtonText:_.no,action:i,isEditPopup:!0}):null,s.jsx(Re,{...b})]})})},Xe=W(we)`
2
2
  display: flex;
3
3
  min-height: 100%;
4
4
  flex-direction: column;
@@ -1 +1 @@
1
- import{j as s}from"./liveblocks-BUQfB0Zp.js";import E from"./NotFoundScreen-uCKl6Wx4.js";import{a as r}from"./sentry-BLIwU6uZ.js";import{h as _,g as v,j as p,i as M,u as U,N as P,n as V,o as z,p as h}from"./core-OMb8nkC1.js";import{eV as B,Sx as b,bq as F,bn as N,i7 as O,fv as q}from"./zeni-epic-state-BZ6N8nVI.js";import{Z as W,z as I,_ as Z,cW as $}from"./index-DLAYU8mN.js";import"./mui-JZY-3hhJ.js";import{u as G}from"./useAskAiCfoHostNavButtonProps-Cw5yceVN.js";import{M as H}from"./MobileAppDrawer-BzjU__HS.js";import"./recharts-DAM4r1-u.js";import"./analytics-BLbM2ksu.js";import"./plaid-B_OuebQv.js";import"./dnd-DVcQZAG5.js";import"./stripe-DMRn4zHo.js";import"./lottie-DDI83OWz.js";import"./lexical-CNfNgAkp.js";import"./pdf-6FZlivdz.js";import"./utils-Bia5qc4p.js";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="1d76e940-9b1b-4dd8-9319-d509ac07bf26",e._sentryDebugIdIdentifier="sentry-dbid-1d76e940-9b1b-4dd8-9319-d509ac07bf26")}catch{}})();const J=V(function(e){const t=I.getSignedInUser(),d=e.tenantState.currentTenantId,o={userId:t?.userId??"",sessionId:t?.zeniSessionId??"",tenantId:d??""},{aggregatedReportViewState:n}=b(e);return{authParams:o,isDisabled:!1,loggedInUser:t,aggregatedReport:n}},function(e,t){return{onBackClick:()=>{t.navigate("../../")},onClickMenuIcon:()=>{t.handleDrawerToggle(!0)}}})($),K=()=>{const e=_(),t=v(),d=W(),o=p(a=>B(a)),{aggregatedReportViewState:n}=p(a=>b(a)),{tenantEmailDomain:f}=M(),u=U(),l=I.getSignedInUser();if(l==null)throw new Error("Can't access this page without signing in...");const m=r.useRef(!1),[S,w]=r.useState(!1),C=F(o?.userRole??[]),x=o?.userRole?.includes("bookkeeping_admin")??!1,k=N(l),y=C||x||k,c=r.useCallback((a,i,T)=>{u(O({fromMonth:a,toMonth:i,cacheOverride:T}))},[]);r.useEffect(()=>{n?.fetchState==="Completed"&&m.current&&(u(q({messageSection:"data_refresh_update",messageText:"success",type:"success",showStatusIcon:!0})),m.current=!1)},[n?.fetchState]);const D=r.useCallback((a,i)=>{n!=null&&n?.fetchState==="In-Progress"||c(a,i,!0),m.current=!0},[n?.fetchState,c]),j=r.useCallback((a,i)=>{c(a,i,!1)},[c]),g=a=>{w(a)},{isAiCfoAccessEnabled:R,onAskAiCfoClick:A}=G({mobileExploreReferrer:"Performance"});return Z({isDataReady:n?.fetchState==="Completed"}),y?s.jsxs(s.Fragment,{children:[s.jsx(H,{isAppContentDrawerOpen:S,handleDrawerToggle:g}),s.jsx(J,{navigate:e,location:t,themeState:d,currentTenant:o,signedInUser:l,tenantEmailDomain:f,onReload:D,onTimeRangeSelect:j,handleDrawerToggle:g,isAiCfoAccessEnabled:R,onAskAiCfoClick:A})]}):s.jsx(P,{to:`/${f}/dashboard`,replace:!0})};function ge(){return s.jsxs(z,{children:[s.jsx(h,{path:"*",element:s.jsx(K,{})}),s.jsx(h,{path:"*",element:s.jsx(E,{})})]})}export{ge as default};
1
+ import{j as s}from"./liveblocks-BUQfB0Zp.js";import E from"./NotFoundScreen-CxRYls3k.js";import{a as r}from"./sentry-BLIwU6uZ.js";import{h as _,g as v,j as p,i as M,u as U,N as P,n as V,o as z,p as h}from"./core-OMb8nkC1.js";import{eV as B,Sx as b,bq as F,bn as N,i7 as O,fv as q}from"./zeni-epic-state-BZ6N8nVI.js";import{Z as W,z as I,_ as Z,cW as $}from"./index-NcZU0lXl.js";import"./mui-JZY-3hhJ.js";import{u as G}from"./useAskAiCfoHostNavButtonProps-DS5Fxq3U.js";import{M as H}from"./MobileAppDrawer-B4f1me8_.js";import"./recharts-DAM4r1-u.js";import"./analytics-BLbM2ksu.js";import"./plaid-B_OuebQv.js";import"./dnd-DVcQZAG5.js";import"./stripe-DMRn4zHo.js";import"./lottie-DDI83OWz.js";import"./lexical-CNfNgAkp.js";import"./pdf-6FZlivdz.js";import"./utils-Bia5qc4p.js";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="1d76e940-9b1b-4dd8-9319-d509ac07bf26",e._sentryDebugIdIdentifier="sentry-dbid-1d76e940-9b1b-4dd8-9319-d509ac07bf26")}catch{}})();const J=V(function(e){const t=I.getSignedInUser(),d=e.tenantState.currentTenantId,o={userId:t?.userId??"",sessionId:t?.zeniSessionId??"",tenantId:d??""},{aggregatedReportViewState:n}=b(e);return{authParams:o,isDisabled:!1,loggedInUser:t,aggregatedReport:n}},function(e,t){return{onBackClick:()=>{t.navigate("../../")},onClickMenuIcon:()=>{t.handleDrawerToggle(!0)}}})($),K=()=>{const e=_(),t=v(),d=W(),o=p(a=>B(a)),{aggregatedReportViewState:n}=p(a=>b(a)),{tenantEmailDomain:f}=M(),u=U(),l=I.getSignedInUser();if(l==null)throw new Error("Can't access this page without signing in...");const m=r.useRef(!1),[S,w]=r.useState(!1),C=F(o?.userRole??[]),x=o?.userRole?.includes("bookkeeping_admin")??!1,k=N(l),y=C||x||k,c=r.useCallback((a,i,T)=>{u(O({fromMonth:a,toMonth:i,cacheOverride:T}))},[]);r.useEffect(()=>{n?.fetchState==="Completed"&&m.current&&(u(q({messageSection:"data_refresh_update",messageText:"success",type:"success",showStatusIcon:!0})),m.current=!1)},[n?.fetchState]);const D=r.useCallback((a,i)=>{n!=null&&n?.fetchState==="In-Progress"||c(a,i,!0),m.current=!0},[n?.fetchState,c]),j=r.useCallback((a,i)=>{c(a,i,!1)},[c]),g=a=>{w(a)},{isAiCfoAccessEnabled:R,onAskAiCfoClick:A}=G({mobileExploreReferrer:"Performance"});return Z({isDataReady:n?.fetchState==="Completed"}),y?s.jsxs(s.Fragment,{children:[s.jsx(H,{isAppContentDrawerOpen:S,handleDrawerToggle:g}),s.jsx(J,{navigate:e,location:t,themeState:d,currentTenant:o,signedInUser:l,tenantEmailDomain:f,onReload:D,onTimeRangeSelect:j,handleDrawerToggle:g,isAiCfoAccessEnabled:R,onAskAiCfoClick:A})]}):s.jsx(P,{to:`/${f}/dashboard`,replace:!0})};function ge(){return s.jsxs(z,{children:[s.jsx(h,{path:"*",element:s.jsx(K,{})}),s.jsx(h,{path:"*",element:s.jsx(E,{})})]})}export{ge as default};
@@ -1,4 +1,4 @@
1
- import{j as Ol}from"./liveblocks-BUQfB0Zp.js";import{p as Q,e as xc,d as kc,g as jl,a as xl}from"./sentry-BLIwU6uZ.js";import{L as dt,bY as Tc,eV as Ac,Lx as Rc,L$ as kl,c6 as Tl,fZ as Al,f_ as Rl}from"./zeni-epic-state-BZ6N8nVI.js";import{a as lt,b as Il,c as Pl,d as Nl,e as an,f as Ll,g as $l,h as Ml,i as Vt,j as Ic,k as oe,l as je,m as Cl,o as Yt,p as ue,q as Dl}from"./utils-Bia5qc4p.js";import{r as un}from"./empty-BACf_dXg.js";import{r as Fl,a as Bl,b as Ul,c as ql}from"./pdf-lib-CtBKoWQc.js";import{r as Gl}from"./index-CPre97x9.js";import{r as zl}from"./index-BQIzm-tN.js";import{h as Zl,g as Hl,u as Vl,j as En,n as Yl}from"./core-OMb8nkC1.js";import{u as Kl,z as Pc,L as Wl,K as Jl,O as Xl,k as Ql,d as tf}from"./index-DLAYU8mN.js";import"./mui-JZY-3hhJ.js";import{d as Pe}from"./decodeURIComponentSafe-CrZYJ6cg.js";(function(){try{var t=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},f=new t.Error().stack;f&&(t._sentryDebugIds=t._sentryDebugIds||{},t._sentryDebugIds[f]="c000f512-6d89-4684-a3f3-429ae0d91ade",t._sentryDebugIdIdentifier="sentry-dbid-c000f512-6d89-4684-a3f3-429ae0d91ade")}catch{}})();var _n,Sn={exports:{}},On,jn,xn,kn,Tn,An,Rn,In,Pn,Ne,Nn,Ln,$n,Mn,Cn,Dn,Fn,Bn,Un,qn,Gn,Le,zn,Zn,Hn,Vn,Yn,Kn,Wn,$e,Jn,Xn,Qn,to,eo,ro,no,Me={exports:{}},Ce={exports:{}},De={};function Nc(){if(On)return De;function t(r){return t=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},t(r)}function f(r,e){return f=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(a,p){return a.__proto__=p,a},f(r,e)}function m(r){var e=function(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}();return function(){var a,p=s(r);if(e){var h=s(this).constructor;a=Reflect.construct(p,arguments,h)}else a=p.apply(this,arguments);return function(d,b){if(b&&(t(b)==="object"||typeof b=="function"))return b;if(b!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return function(g){if(g===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return g}(d)}(this,a)}}function s(r){return s=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},s(r)}On=1;var l,o,n={};function i(r,e,a){a||(a=Error);var p=function(h){(function(c,y){if(typeof y!="function"&&y!==null)throw new TypeError("Super expression must either be null or a function");c.prototype=Object.create(y&&y.prototype,{constructor:{value:c,writable:!0,configurable:!0}}),Object.defineProperty(c,"prototype",{writable:!1}),y&&f(c,y)})(g,h);var d,b=m(g);function g(c,y,v){var S;return function(w,_){if(!(w instanceof _))throw new TypeError("Cannot call a class as a function")}(this,g),S=b.call(this,function(w,_,M){return typeof e=="string"?e:e(w,_,M)}(c,y,v)),S.code=r,S}return d=g,Object.defineProperty(d,"prototype",{writable:!1}),d}(a);n[r]=p}function u(r,e){if(Array.isArray(r)){var a=r.length;return r=r.map(function(p){return String(p)}),a>2?"one of ".concat(e," ").concat(r.slice(0,a-1).join(", "),", or ")+r[a-1]:a===2?"one of ".concat(e," ").concat(r[0]," or ").concat(r[1]):"of ".concat(e," ").concat(r[0])}return"of ".concat(e," ").concat(String(r))}return i("ERR_AMBIGUOUS_ARGUMENT",'The "%s" argument is ambiguous. %s',TypeError),i("ERR_INVALID_ARG_TYPE",function(r,e,a){var p,h,d;if(l===void 0&&(l=ie()),l(typeof r=="string","'name' must be a string"),typeof e=="string"&&(h="not ",e.substr(0,h.length)===h)?(p="must not be",e=e.replace(/^not /,"")):p="must be",function(g,c,y){return(y===void 0||y>g.length)&&(y=g.length),g.substring(y-c.length,y)===c}(r," argument"))d="The ".concat(r," ").concat(p," ").concat(u(e,"type"));else{var b=function(g,c,y){return typeof y!="number"&&(y=0),!(y+c.length>g.length)&&g.indexOf(c,y)!==-1}(r,".")?"property":"argument";d='The "'.concat(r,'" ').concat(b," ").concat(p," ").concat(u(e,"type"))}return d+=". Received type ".concat(t(a))},TypeError),i("ERR_INVALID_ARG_VALUE",function(r,e){var a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:"is invalid";o===void 0&&(o=lt());var p=o.inspect(e);return p.length>128&&(p="".concat(p.slice(0,128),"...")),"The argument '".concat(r,"' ").concat(a,". Received ").concat(p)},TypeError),i("ERR_INVALID_RETURN_VALUE",function(r,e,a){var p;return p=a&&a.constructor&&a.constructor.name?"instance of ".concat(a.constructor.name):"type ".concat(t(a)),"Expected ".concat(r,' to be returned from the "').concat(e,'"')+" function but got ".concat(p,".")},TypeError),i("ERR_MISSING_ARGS",function(){for(var r=arguments.length,e=new Array(r),a=0;a<r;a++)e[a]=arguments[a];l===void 0&&(l=ie()),l(e.length>0,"At least one arg needs to be specified");var p="The ",h=e.length;switch(e=e.map(function(d){return'"'.concat(d,'"')}),h){case 1:p+="".concat(e[0]," argument");break;case 2:p+="".concat(e[0]," and ").concat(e[1]," arguments");break;default:p+=e.slice(0,h-1).join(", "),p+=", and ".concat(e[h-1]," arguments")}return"".concat(p," must be specified")},TypeError),De.codes=n,De}function ef(){if(xn)return jn;function t(k,E){var j=Object.keys(k);if(Object.getOwnPropertySymbols){var x=Object.getOwnPropertySymbols(k);E&&(x=x.filter(function(O){return Object.getOwnPropertyDescriptor(k,O).enumerable})),j.push.apply(j,x)}return j}function f(k){for(var E=1;E<arguments.length;E++){var j=arguments[E]!=null?arguments[E]:{};E%2?t(Object(j),!0).forEach(function(x){m(k,x,j[x])}):Object.getOwnPropertyDescriptors?Object.defineProperties(k,Object.getOwnPropertyDescriptors(j)):t(Object(j)).forEach(function(x){Object.defineProperty(k,x,Object.getOwnPropertyDescriptor(j,x))})}return k}function m(k,E,j){return(E=l(E))in k?Object.defineProperty(k,E,{value:j,enumerable:!0,configurable:!0,writable:!0}):k[E]=j,k}function s(k,E,j){return E&&function(x,O){for(var $=0;$<O.length;$++){var N=O[$];N.enumerable=N.enumerable||!1,N.configurable=!0,"value"in N&&(N.writable=!0),Object.defineProperty(x,l(N.key),N)}}(k.prototype,E),Object.defineProperty(k,"prototype",{writable:!1}),k}function l(k){var E=function(j,x){if(p(j)!=="object"||j===null)return j;var O=j[Symbol.toPrimitive];if(O!==void 0){var $=O.call(j,x);if(p($)!=="object")return $;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(j)}(k,"string");return p(E)==="symbol"?E:String(E)}function o(k,E){if(E&&(p(E)==="object"||typeof E=="function"))return E;if(E!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return n(k)}function n(k){if(k===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return k}function i(k){var E=typeof Map=="function"?new Map:void 0;return i=function(j){if(j===null||(x=j,Function.toString.call(x).indexOf("[native code]")===-1))return j;var x;if(typeof j!="function")throw new TypeError("Super expression must either be null or a function");if(E!==void 0){if(E.has(j))return E.get(j);E.set(j,O)}function O(){return u(j,arguments,a(this).constructor)}return O.prototype=Object.create(j.prototype,{constructor:{value:O,enumerable:!1,writable:!0,configurable:!0}}),e(O,j)},i(k)}function u(k,E,j){return u=r()?Reflect.construct.bind():function(x,O,$){var N=[null];N.push.apply(N,O);var P=new(Function.bind.apply(x,N));return $&&e(P,$.prototype),P},u.apply(null,arguments)}function r(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function e(k,E){return e=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(j,x){return j.__proto__=x,j},e(k,E)}function a(k){return a=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(E){return E.__proto__||Object.getPrototypeOf(E)},a(k)}function p(k){return p=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(E){return typeof E}:function(E){return E&&typeof Symbol=="function"&&E.constructor===Symbol&&E!==Symbol.prototype?"symbol":typeof E},p(k)}xn=1;var h=lt().inspect,d=Nc().codes.ERR_INVALID_ARG_TYPE;function b(k,E,j){return(j===void 0||j>k.length)&&(j=k.length),k.substring(j-E.length,j)===E}var g="",c="",y="",v="",S={deepStrictEqual:"Expected values to be strictly deep-equal:",strictEqual:"Expected values to be strictly equal:",strictEqualObject:'Expected "actual" to be reference-equal to "expected":',deepEqual:"Expected values to be loosely deep-equal:",equal:"Expected values to be loosely equal:",notDeepStrictEqual:'Expected "actual" not to be strictly deep-equal to:',notStrictEqual:'Expected "actual" to be strictly unequal to:',notStrictEqualObject:'Expected "actual" not to be reference-equal to "expected":',notDeepEqual:'Expected "actual" not to be loosely deep-equal to:',notEqual:'Expected "actual" to be loosely unequal to:',notIdentical:"Values identical but not reference-equal:"};function w(k){var E=Object.keys(k),j=Object.create(Object.getPrototypeOf(k));return E.forEach(function(x){j[x]=k[x]}),Object.defineProperty(j,"message",{value:k.message}),j}function _(k){return h(k,{compact:!1,customInspect:!1,depth:1e3,maxArrayLength:1/0,showHidden:!1,breakLength:1/0,showProxy:!1,sorted:!0,getters:!0})}function M(k,E,j){var x="",O="",$=0,N="",P=!1,G=_(k),A=G.split(`
1
+ import{j as Ol}from"./liveblocks-BUQfB0Zp.js";import{p as Q,e as xc,d as kc,g as jl,a as xl}from"./sentry-BLIwU6uZ.js";import{L as dt,bY as Tc,eV as Ac,Lx as Rc,L$ as kl,c6 as Tl,fZ as Al,f_ as Rl}from"./zeni-epic-state-BZ6N8nVI.js";import{a as lt,b as Il,c as Pl,d as Nl,e as an,f as Ll,g as $l,h as Ml,i as Vt,j as Ic,k as oe,l as je,m as Cl,o as Yt,p as ue,q as Dl}from"./utils-Bia5qc4p.js";import{r as un}from"./empty-BACf_dXg.js";import{r as Fl,a as Bl,b as Ul,c as ql}from"./pdf-lib-CtBKoWQc.js";import{r as Gl}from"./index-CPre97x9.js";import{r as zl}from"./index-BQIzm-tN.js";import{h as Zl,g as Hl,u as Vl,j as En,n as Yl}from"./core-OMb8nkC1.js";import{u as Kl,z as Pc,L as Wl,K as Jl,O as Xl,k as Ql,d as tf}from"./index-NcZU0lXl.js";import"./mui-JZY-3hhJ.js";import{d as Pe}from"./decodeURIComponentSafe-CrZYJ6cg.js";(function(){try{var t=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},f=new t.Error().stack;f&&(t._sentryDebugIds=t._sentryDebugIds||{},t._sentryDebugIds[f]="c000f512-6d89-4684-a3f3-429ae0d91ade",t._sentryDebugIdIdentifier="sentry-dbid-c000f512-6d89-4684-a3f3-429ae0d91ade")}catch{}})();var _n,Sn={exports:{}},On,jn,xn,kn,Tn,An,Rn,In,Pn,Ne,Nn,Ln,$n,Mn,Cn,Dn,Fn,Bn,Un,qn,Gn,Le,zn,Zn,Hn,Vn,Yn,Kn,Wn,$e,Jn,Xn,Qn,to,eo,ro,no,Me={exports:{}},Ce={exports:{}},De={};function Nc(){if(On)return De;function t(r){return t=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},t(r)}function f(r,e){return f=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(a,p){return a.__proto__=p,a},f(r,e)}function m(r){var e=function(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}();return function(){var a,p=s(r);if(e){var h=s(this).constructor;a=Reflect.construct(p,arguments,h)}else a=p.apply(this,arguments);return function(d,b){if(b&&(t(b)==="object"||typeof b=="function"))return b;if(b!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return function(g){if(g===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return g}(d)}(this,a)}}function s(r){return s=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},s(r)}On=1;var l,o,n={};function i(r,e,a){a||(a=Error);var p=function(h){(function(c,y){if(typeof y!="function"&&y!==null)throw new TypeError("Super expression must either be null or a function");c.prototype=Object.create(y&&y.prototype,{constructor:{value:c,writable:!0,configurable:!0}}),Object.defineProperty(c,"prototype",{writable:!1}),y&&f(c,y)})(g,h);var d,b=m(g);function g(c,y,v){var S;return function(w,_){if(!(w instanceof _))throw new TypeError("Cannot call a class as a function")}(this,g),S=b.call(this,function(w,_,M){return typeof e=="string"?e:e(w,_,M)}(c,y,v)),S.code=r,S}return d=g,Object.defineProperty(d,"prototype",{writable:!1}),d}(a);n[r]=p}function u(r,e){if(Array.isArray(r)){var a=r.length;return r=r.map(function(p){return String(p)}),a>2?"one of ".concat(e," ").concat(r.slice(0,a-1).join(", "),", or ")+r[a-1]:a===2?"one of ".concat(e," ").concat(r[0]," or ").concat(r[1]):"of ".concat(e," ").concat(r[0])}return"of ".concat(e," ").concat(String(r))}return i("ERR_AMBIGUOUS_ARGUMENT",'The "%s" argument is ambiguous. %s',TypeError),i("ERR_INVALID_ARG_TYPE",function(r,e,a){var p,h,d;if(l===void 0&&(l=ie()),l(typeof r=="string","'name' must be a string"),typeof e=="string"&&(h="not ",e.substr(0,h.length)===h)?(p="must not be",e=e.replace(/^not /,"")):p="must be",function(g,c,y){return(y===void 0||y>g.length)&&(y=g.length),g.substring(y-c.length,y)===c}(r," argument"))d="The ".concat(r," ").concat(p," ").concat(u(e,"type"));else{var b=function(g,c,y){return typeof y!="number"&&(y=0),!(y+c.length>g.length)&&g.indexOf(c,y)!==-1}(r,".")?"property":"argument";d='The "'.concat(r,'" ').concat(b," ").concat(p," ").concat(u(e,"type"))}return d+=". Received type ".concat(t(a))},TypeError),i("ERR_INVALID_ARG_VALUE",function(r,e){var a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:"is invalid";o===void 0&&(o=lt());var p=o.inspect(e);return p.length>128&&(p="".concat(p.slice(0,128),"...")),"The argument '".concat(r,"' ").concat(a,". Received ").concat(p)},TypeError),i("ERR_INVALID_RETURN_VALUE",function(r,e,a){var p;return p=a&&a.constructor&&a.constructor.name?"instance of ".concat(a.constructor.name):"type ".concat(t(a)),"Expected ".concat(r,' to be returned from the "').concat(e,'"')+" function but got ".concat(p,".")},TypeError),i("ERR_MISSING_ARGS",function(){for(var r=arguments.length,e=new Array(r),a=0;a<r;a++)e[a]=arguments[a];l===void 0&&(l=ie()),l(e.length>0,"At least one arg needs to be specified");var p="The ",h=e.length;switch(e=e.map(function(d){return'"'.concat(d,'"')}),h){case 1:p+="".concat(e[0]," argument");break;case 2:p+="".concat(e[0]," and ").concat(e[1]," arguments");break;default:p+=e.slice(0,h-1).join(", "),p+=", and ".concat(e[h-1]," arguments")}return"".concat(p," must be specified")},TypeError),De.codes=n,De}function ef(){if(xn)return jn;function t(k,E){var j=Object.keys(k);if(Object.getOwnPropertySymbols){var x=Object.getOwnPropertySymbols(k);E&&(x=x.filter(function(O){return Object.getOwnPropertyDescriptor(k,O).enumerable})),j.push.apply(j,x)}return j}function f(k){for(var E=1;E<arguments.length;E++){var j=arguments[E]!=null?arguments[E]:{};E%2?t(Object(j),!0).forEach(function(x){m(k,x,j[x])}):Object.getOwnPropertyDescriptors?Object.defineProperties(k,Object.getOwnPropertyDescriptors(j)):t(Object(j)).forEach(function(x){Object.defineProperty(k,x,Object.getOwnPropertyDescriptor(j,x))})}return k}function m(k,E,j){return(E=l(E))in k?Object.defineProperty(k,E,{value:j,enumerable:!0,configurable:!0,writable:!0}):k[E]=j,k}function s(k,E,j){return E&&function(x,O){for(var $=0;$<O.length;$++){var N=O[$];N.enumerable=N.enumerable||!1,N.configurable=!0,"value"in N&&(N.writable=!0),Object.defineProperty(x,l(N.key),N)}}(k.prototype,E),Object.defineProperty(k,"prototype",{writable:!1}),k}function l(k){var E=function(j,x){if(p(j)!=="object"||j===null)return j;var O=j[Symbol.toPrimitive];if(O!==void 0){var $=O.call(j,x);if(p($)!=="object")return $;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(j)}(k,"string");return p(E)==="symbol"?E:String(E)}function o(k,E){if(E&&(p(E)==="object"||typeof E=="function"))return E;if(E!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return n(k)}function n(k){if(k===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return k}function i(k){var E=typeof Map=="function"?new Map:void 0;return i=function(j){if(j===null||(x=j,Function.toString.call(x).indexOf("[native code]")===-1))return j;var x;if(typeof j!="function")throw new TypeError("Super expression must either be null or a function");if(E!==void 0){if(E.has(j))return E.get(j);E.set(j,O)}function O(){return u(j,arguments,a(this).constructor)}return O.prototype=Object.create(j.prototype,{constructor:{value:O,enumerable:!1,writable:!0,configurable:!0}}),e(O,j)},i(k)}function u(k,E,j){return u=r()?Reflect.construct.bind():function(x,O,$){var N=[null];N.push.apply(N,O);var P=new(Function.bind.apply(x,N));return $&&e(P,$.prototype),P},u.apply(null,arguments)}function r(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function e(k,E){return e=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(j,x){return j.__proto__=x,j},e(k,E)}function a(k){return a=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(E){return E.__proto__||Object.getPrototypeOf(E)},a(k)}function p(k){return p=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(E){return typeof E}:function(E){return E&&typeof Symbol=="function"&&E.constructor===Symbol&&E!==Symbol.prototype?"symbol":typeof E},p(k)}xn=1;var h=lt().inspect,d=Nc().codes.ERR_INVALID_ARG_TYPE;function b(k,E,j){return(j===void 0||j>k.length)&&(j=k.length),k.substring(j-E.length,j)===E}var g="",c="",y="",v="",S={deepStrictEqual:"Expected values to be strictly deep-equal:",strictEqual:"Expected values to be strictly equal:",strictEqualObject:'Expected "actual" to be reference-equal to "expected":',deepEqual:"Expected values to be loosely deep-equal:",equal:"Expected values to be loosely equal:",notDeepStrictEqual:'Expected "actual" not to be strictly deep-equal to:',notStrictEqual:'Expected "actual" to be strictly unequal to:',notStrictEqualObject:'Expected "actual" not to be reference-equal to "expected":',notDeepEqual:'Expected "actual" not to be loosely deep-equal to:',notEqual:'Expected "actual" to be loosely unequal to:',notIdentical:"Values identical but not reference-equal:"};function w(k){var E=Object.keys(k),j=Object.create(Object.getPrototypeOf(k));return E.forEach(function(x){j[x]=k[x]}),Object.defineProperty(j,"message",{value:k.message}),j}function _(k){return h(k,{compact:!1,customInspect:!1,depth:1e3,maxArrayLength:1/0,showHidden:!1,breakLength:1/0,showProxy:!1,sorted:!0,getters:!0})}function M(k,E,j){var x="",O="",$=0,N="",P=!1,G=_(k),A=G.split(`
2
2
  `),I=_(E).split(`
3
3
  `),R=0,B="";if(j==="strictEqual"&&p(k)==="object"&&p(E)==="object"&&k!==null&&E!==null&&(j="strictEqualObject"),A.length===1&&I.length===1&&A[0]!==I[0]){var V=A[0].length+I[0].length;if(V<=10){if(!(p(k)==="object"&&k!==null||p(E)==="object"&&E!==null||k===0&&E===0))return"".concat(S[j],`
4
4
 
@@ -1,4 +1,4 @@
1
- import{j as s}from"./liveblocks-BUQfB0Zp.js";import{a as o}from"./sentry-BLIwU6uZ.js";import{j as f,h as B,u as _,g as H,n as W}from"./core-OMb8nkC1.js";import{m as F,J as M,z as R,bb as N,A as U,W as $,_ as z,E as G,d as l,f as q,a7 as J,bc as K}from"./index-DLAYU8mN.js";import{fE as Q,eV as X,OR as P,OS as Y,vr as Z,vh as g,fG as ee,bS as re,vm as ae,OT as ne}from"./zeni-epic-state-BZ6N8nVI.js";import{D as te,e as se,n as oe,S as ie}from"./mui-JZY-3hhJ.js";import{u as le}from"./useAskAiCfoHostNavButtonProps-Cw5yceVN.js";import{M as ce}from"./MobileAppDrawer-BzjU__HS.js";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},r=new e.Error().stack;r&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[r]="3fb55748-b11c-47f4-9254-31c588544b2c",e._sentryDebugIdIdentifier="sentry-dbid-3fb55748-b11c-47f4-9254-31c588544b2c")}catch{}})();const de={overlayWidth:new U(100,100,30)},fe=({isReferralDrawerOpen:e,closeDrawerHandler:r})=>{const a=F(),n=M();if(R.getSignedInUser()==null)throw Error("Can't access How Referral works without signing in...");const i=()=>{r(!0)},u=f(c=>Q(c));return s.jsx(te,{anchor:"right",open:e,PaperProps:{style:{width:de.overlayWidth.valuePercentage(n),boxShadow:"none"}},slotProps:{backdrop:{style:{opacity:.75,backgroundColor:a.colors.black,cursor:"pointer"}}},onClose:()=>i(),children:s.jsx(se,{in:e,direction:"left",children:s.jsx(ue,{onClick:c=>c.stopPropagation(),children:s.jsx(N,{onDismissClick:i,rewardsPlan:u.rewardsPlan})})})})},ue=oe(ie)`
1
+ import{j as s}from"./liveblocks-BUQfB0Zp.js";import{a as o}from"./sentry-BLIwU6uZ.js";import{j as f,h as B,u as _,g as H,n as W}from"./core-OMb8nkC1.js";import{m as F,J as M,z as R,bb as N,A as U,W as $,_ as z,E as G,d as l,f as q,a7 as J,bc as K}from"./index-NcZU0lXl.js";import{fE as Q,eV as X,OR as P,OS as Y,vr as Z,vh as g,fG as ee,bS as re,vm as ae,OT as ne}from"./zeni-epic-state-BZ6N8nVI.js";import{D as te,e as se,n as oe,S as ie}from"./mui-JZY-3hhJ.js";import{u as le}from"./useAskAiCfoHostNavButtonProps-DS5Fxq3U.js";import{M as ce}from"./MobileAppDrawer-B4f1me8_.js";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},r=new e.Error().stack;r&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[r]="3fb55748-b11c-47f4-9254-31c588544b2c",e._sentryDebugIdIdentifier="sentry-dbid-3fb55748-b11c-47f4-9254-31c588544b2c")}catch{}})();const de={overlayWidth:new U(100,100,30)},fe=({isReferralDrawerOpen:e,closeDrawerHandler:r})=>{const a=F(),n=M();if(R.getSignedInUser()==null)throw Error("Can't access How Referral works without signing in...");const i=()=>{r(!0)},u=f(c=>Q(c));return s.jsx(te,{anchor:"right",open:e,PaperProps:{style:{width:de.overlayWidth.valuePercentage(n),boxShadow:"none"}},slotProps:{backdrop:{style:{opacity:.75,backgroundColor:a.colors.black,cursor:"pointer"}}},onClose:()=>i(),children:s.jsx(se,{in:e,direction:"left",children:s.jsx(ue,{onClick:c=>c.stopPropagation(),children:s.jsx(N,{onDismissClick:i,rewardsPlan:u.rewardsPlan})})})})},ue=oe(ie)`
2
2
  display: flex;
3
3
  min-height: 100%;
4
4
  flex-direction: column;
@@ -1 +1 @@
1
- import{j as r}from"./liveblocks-BUQfB0Zp.js";import F from"./NotFoundScreen-uCKl6Wx4.js";import{a as p}from"./sentry-BLIwU6uZ.js";import{h as E,g as x,u as C,j as u,N as D,n as V,o as O,p as g}from"./core-OMb8nkC1.js";import{eV as I,PL as b,P$ as S,Fe as k,En as U,Fd as d,F4 as L,Qf as $,Fg as _}from"./zeni-epic-state-BZ6N8nVI.js";import{z as N,a7 as B,bW as z,af as T,bz as P,bX as K}from"./index-DLAYU8mN.js";import"./mui-JZY-3hhJ.js";import{u as Q,R as A}from"./ReimbursementApprovalRuleDetailScreen-CoaTNR2u.js";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},o=new e.Error().stack;o&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[o]="aefe3d82-f812-4964-91dc-2caec822bcce",e._sentryDebugIdIdentifier="sentry-dbid-aefe3d82-f812-4964-91dc-2caec822bcce")}catch{}})();const y="reimbursement-approval-rule-update",X=V(function(e){return{approvalView:b(e),remiSetupApproverViewUpdateData:S(e).remiSetupApproverViewUpdateData}},function(e,o){const{navigate:s,location:n}=o;return{onApprovalRulesEventReceived:t=>{t.endsWith(y)&&e($(!1))},onBackClick:()=>{T(n)?s("../../"):s("../../../reimbursements/setup")},onDeleteRuleClick:t=>{e(L(t,!1))},onEditRuleClick:t=>{t!=null?(e(d(t)),s(`./${t}/edit`)):(e(d()),s("./new"))}}})(B(z)),q=({isLoading:e})=>{const o=E(),s=x(),n=C(),[t,i]=p.useState(!1),[m,w]=p.useState(!1),f=u(a=>a.remiSetupApproverViewState.fetchState),l=u(a=>I(a)),c=u(a=>b(a)),v=u(a=>S(a).remiSetupApproverViewUpdateData);if(p.useEffect(()=>{v?.updateStatus.fetchState==="Completed"&&n(k())},[v]),p.useEffect(()=>{t||f!=="Not-Started"||e||(i(!0),n(U(!0,!1,!1,!1)))},[t,f,e,n]),N.getSignedInUser()==null)throw Error("Can't access reimbursement approval without signing in...");p.useEffect(()=>{c.allApprovalRules.length===0&&c.fetchState==="Completed"&&(m||(w(!0),n(d())),o("./new"))},[m,c,n]);const R={events:l.companyId!=null?[`private-encrypted-${l.companyId}.${y}`]:[],eventCallback:(a,W,h)=>{a.endsWith(y)&&h.onApprovalRulesEventReceived(a)}};return l?.companyReimbursementInfo?.info?.isReimbursementTOSAccepted===!1?r.jsx(D,{to:"../../promo"}):r.jsx(X,{currentTenant:l,location:s,navigate:o,...R})},j="reimbursement-approval-rule-update",G=V(function(e){const o=b(e),s=S(e).remiSetupApproverViewUpdateData,n={};for(const i of Object.values(e.vendorState.vendorByID))i?.id!=null&&(n[i.id]=i.name);const t={};for(const i of Object.values(e.classState.classesByKey))i?.classId!=null&&(t[i.classId]=i.className);return{approvalView:o,remiSetupApproverViewUpdateData:s,vendorNamesById:n,departmentNamesById:t}},function(e,o){const{navigate:s,location:n}=o;return{onApprovalRulesEventReceived:t=>{t.endsWith(j)&&e($(!1))},onBackClick:()=>{T(n)?s("../../"):s("../../../reimbursements/setup")},onDeleteRuleClick:t=>{e(L(t,!0))},onEditRuleClick:t=>{t!=null?(e(d(t)),s(`./${t}/edit`)):(e(d()),s("./new"))},onReorderRules:t=>{e(_(t,!0))}}})(B(K)),H=()=>{const e=u(n=>I(n)),{isApprovalRulesV3Enabled:o,isLoading:s}=P(e?.tenantId);return o?r.jsx(J,{isLoading:s}):r.jsx(q,{isLoading:s})},J=({isLoading:e})=>{const o=E(),s=x(),n=C(),[t,i]=p.useState(!1),[m,w]=p.useState(!1),f=u(a=>a.remiSetupApproverViewState.fetchState),l=u(a=>I(a)),c=u(a=>b(a));Q();const v=u(a=>S(a).remiSetupApproverViewUpdateData);if(p.useEffect(()=>{v?.updateStatus.fetchState==="Completed"&&n(k())},[v]),p.useEffect(()=>{t||f!=="Not-Started"||e||(i(!0),n(U(!0,!1,!1,!0)))},[t,f,e,n]),N.getSignedInUser()==null)throw Error("Can't access reimbursement approval without signing in...");p.useEffect(()=>{c.allApprovalRules.length===0&&c.fetchState==="Completed"&&(m||(w(!0),n(d())),o("./new"))},[m,c,n]);const R={events:l.companyId!=null?[`private-encrypted-${l.companyId}.${j}`]:[],eventCallback:(a,W,h)=>{a.endsWith(j)&&h.onApprovalRulesEventReceived(a)}};return l?.companyReimbursementInfo?.info?.isReimbursementTOSAccepted===!1?r.jsx(D,{to:"../../promo"}):r.jsx(G,{currentTenant:l,location:s,navigate:o,isLoading:e,...R})};function oe(){return r.jsxs(O,{children:[r.jsx(g,{path:"/",element:r.jsx(H,{})}),r.jsx(g,{path:"/new",element:r.jsx(A,{})}),r.jsx(g,{path:"/:approvalRuleId/edit",element:r.jsx(A,{})}),r.jsx(g,{path:"*",element:r.jsx(F,{})})]})}export{oe as R};
1
+ import{j as r}from"./liveblocks-BUQfB0Zp.js";import F from"./NotFoundScreen-CxRYls3k.js";import{a as p}from"./sentry-BLIwU6uZ.js";import{h as E,g as x,u as C,j as u,N as D,n as V,o as O,p as g}from"./core-OMb8nkC1.js";import{eV as I,PL as b,P$ as S,Fe as k,En as U,Fd as d,F4 as L,Qf as $,Fg as _}from"./zeni-epic-state-BZ6N8nVI.js";import{z as N,a7 as B,bW as z,af as T,bz as P,bX as K}from"./index-NcZU0lXl.js";import"./mui-JZY-3hhJ.js";import{u as Q,R as A}from"./ReimbursementApprovalRuleDetailScreen-DTZkQzQY.js";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},o=new e.Error().stack;o&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[o]="aefe3d82-f812-4964-91dc-2caec822bcce",e._sentryDebugIdIdentifier="sentry-dbid-aefe3d82-f812-4964-91dc-2caec822bcce")}catch{}})();const y="reimbursement-approval-rule-update",X=V(function(e){return{approvalView:b(e),remiSetupApproverViewUpdateData:S(e).remiSetupApproverViewUpdateData}},function(e,o){const{navigate:s,location:n}=o;return{onApprovalRulesEventReceived:t=>{t.endsWith(y)&&e($(!1))},onBackClick:()=>{T(n)?s("../../"):s("../../../reimbursements/setup")},onDeleteRuleClick:t=>{e(L(t,!1))},onEditRuleClick:t=>{t!=null?(e(d(t)),s(`./${t}/edit`)):(e(d()),s("./new"))}}})(B(z)),q=({isLoading:e})=>{const o=E(),s=x(),n=C(),[t,i]=p.useState(!1),[m,w]=p.useState(!1),f=u(a=>a.remiSetupApproverViewState.fetchState),l=u(a=>I(a)),c=u(a=>b(a)),v=u(a=>S(a).remiSetupApproverViewUpdateData);if(p.useEffect(()=>{v?.updateStatus.fetchState==="Completed"&&n(k())},[v]),p.useEffect(()=>{t||f!=="Not-Started"||e||(i(!0),n(U(!0,!1,!1,!1)))},[t,f,e,n]),N.getSignedInUser()==null)throw Error("Can't access reimbursement approval without signing in...");p.useEffect(()=>{c.allApprovalRules.length===0&&c.fetchState==="Completed"&&(m||(w(!0),n(d())),o("./new"))},[m,c,n]);const R={events:l.companyId!=null?[`private-encrypted-${l.companyId}.${y}`]:[],eventCallback:(a,W,h)=>{a.endsWith(y)&&h.onApprovalRulesEventReceived(a)}};return l?.companyReimbursementInfo?.info?.isReimbursementTOSAccepted===!1?r.jsx(D,{to:"../../promo"}):r.jsx(X,{currentTenant:l,location:s,navigate:o,...R})},j="reimbursement-approval-rule-update",G=V(function(e){const o=b(e),s=S(e).remiSetupApproverViewUpdateData,n={};for(const i of Object.values(e.vendorState.vendorByID))i?.id!=null&&(n[i.id]=i.name);const t={};for(const i of Object.values(e.classState.classesByKey))i?.classId!=null&&(t[i.classId]=i.className);return{approvalView:o,remiSetupApproverViewUpdateData:s,vendorNamesById:n,departmentNamesById:t}},function(e,o){const{navigate:s,location:n}=o;return{onApprovalRulesEventReceived:t=>{t.endsWith(j)&&e($(!1))},onBackClick:()=>{T(n)?s("../../"):s("../../../reimbursements/setup")},onDeleteRuleClick:t=>{e(L(t,!0))},onEditRuleClick:t=>{t!=null?(e(d(t)),s(`./${t}/edit`)):(e(d()),s("./new"))},onReorderRules:t=>{e(_(t,!0))}}})(B(K)),H=()=>{const e=u(n=>I(n)),{isApprovalRulesV3Enabled:o,isLoading:s}=P(e?.tenantId);return o?r.jsx(J,{isLoading:s}):r.jsx(q,{isLoading:s})},J=({isLoading:e})=>{const o=E(),s=x(),n=C(),[t,i]=p.useState(!1),[m,w]=p.useState(!1),f=u(a=>a.remiSetupApproverViewState.fetchState),l=u(a=>I(a)),c=u(a=>b(a));Q();const v=u(a=>S(a).remiSetupApproverViewUpdateData);if(p.useEffect(()=>{v?.updateStatus.fetchState==="Completed"&&n(k())},[v]),p.useEffect(()=>{t||f!=="Not-Started"||e||(i(!0),n(U(!0,!1,!1,!0)))},[t,f,e,n]),N.getSignedInUser()==null)throw Error("Can't access reimbursement approval without signing in...");p.useEffect(()=>{c.allApprovalRules.length===0&&c.fetchState==="Completed"&&(m||(w(!0),n(d())),o("./new"))},[m,c,n]);const R={events:l.companyId!=null?[`private-encrypted-${l.companyId}.${j}`]:[],eventCallback:(a,W,h)=>{a.endsWith(j)&&h.onApprovalRulesEventReceived(a)}};return l?.companyReimbursementInfo?.info?.isReimbursementTOSAccepted===!1?r.jsx(D,{to:"../../promo"}):r.jsx(G,{currentTenant:l,location:s,navigate:o,isLoading:e,...R})};function oe(){return r.jsxs(O,{children:[r.jsx(g,{path:"/",element:r.jsx(H,{})}),r.jsx(g,{path:"/new",element:r.jsx(A,{})}),r.jsx(g,{path:"/:approvalRuleId/edit",element:r.jsx(A,{})}),r.jsx(g,{path:"*",element:r.jsx(F,{})})]})}export{oe as R};
@@ -1 +1 @@
1
- import{j as b}from"./liveblocks-BUQfB0Zp.js";import{a as f}from"./sentry-BLIwU6uZ.js";import{u as T,j as g,h as _,g as O,i as k,n as F}from"./core-OMb8nkC1.js";import{kS as z,P$ as w,PL as U,F7 as V,Fj as B,Fe as A,Ff as E,Q0 as j,eV as K,Fd as M}from"./zeni-epic-state-BZ6N8nVI.js";import{z as P,m as N,B as $,bM as Q,af as L,bz as W,bN as G}from"./index-DLAYU8mN.js";import"./mui-JZY-3hhJ.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]="db059be0-57be-4fda-882c-718a293598c2",e._sentryDebugIdIdentifier="sentry-dbid-db059be0-57be-4fda-882c-718a293598c2")}catch{}})();function H(){const e=T(),s=f.useRef(!1),t=g(o=>o.vendorListState.fetchStateBillsTab.fetchState??"Not-Started"),p=g(o=>o.vendorListState.allVendorIdsBillsTab.length>0);f.useEffect(()=>{s.current||p||t==="Completed"||t==="In-Progress"||(s.current=!0,e(z({})))},[p,t,e])}const J=F(function(e,s){const t=w(e),p=t.remiSetupApproverViewUpdateData?.type??"approval_create",o=p==="approval_create"&&t.allApprovalRules.length!==0;let l=t.allApprovalRules.length===0;return s.approvalRuleId&&(l=t.allApprovalRules.findIndex(r=>r.approvalRuleId===s.approvalRuleId)===0),{localData:t,hideUpperBoundField:o,isLowerBoundDisabled:l,approvalUpdateActionType:p}},function(e,s){const{navigate:t,approvalUpdateDataView:p,approverViewData:o,approvalRuleId:l}=s,r=p.remiSetupApproverViewUpdateData?.type,i=L(s.location);return{onApprovalRuleDataUpdated:a=>{const d=v=>{const h=[];return v.forEach(u=>{const I=u.actors.selectedUsers.map(m=>({type:"user",subType:void 0,userId:m.userId,idType:"user",isImplicitActor:!1})),R=u.actors.selectedNonUsers.map(m=>{const y=(S=m.value,j(S)==null);var S;return{type:y?"attribute":"role",subType:m.value,userId:void 0,idType:void 0,isImplicitActor:!y}}),c=I.concat(R);h.push({action:u.stepType.selectedOption,actors:c,operator:c.length>1?u.stepType.selectedOption==="require_approval"?"or":"and":"is"})}),h},n={amount:{type:"amount",comparator:"range",min:{amount:a.lowerBound,currencyCode:"USD",currencySymbol:"$"},max:{amount:a.upperBound,currencyCode:"USD",currencySymbol:"$"}}};if(r==="approval_create"){const v={criteria:n,steps:d(a.steps),isApplicableOnPendingApprovalEntity:a.applyToExistingReimbursements.includes("applyToExistingReimbursements")};e(E(v))}else{const v={approvalRuleId:l,criteria:n,steps:d(a.steps),isApplicableOnPendingApprovalEntity:a.applyToExistingReimbursements.includes("applyToExistingReimbursements")};e(E(v))}},onResetClick:()=>{e(A()),r==="approval_update"||i?t("../"):o.allApprovalRules.length===0&&o.fetchState==="Completed"?t("../../setup"):t("../")},onBackClick:()=>{e(A()),r==="approval_update"||i?t("../"):o.allApprovalRules.length===0&&o.fetchState==="Completed"?t("../../setup"):t("../")},onSaveRuleClick:()=>{e(B(!1))},onSaveRuleSuccess:()=>{t("../")}}})(Q);function X(){const e=_(),s=T(),t=O(),{approvalRuleId:p}=k(),o=P.getSignedInUser(),l=N(),r=g(n=>w(n)),i=g(n=>U(n)),[a,d]=f.useState(!1);if(f.useEffect(()=>{a||(d(!0),s(V(!0)))}),f.useEffect(()=>{i.fetchState==="Not-Started"&&e(p!=null?"../../":"../")},[i,p]),o==null)throw Error("Can't access address page without signing in...");return r.approversDetailsFetchStatus.fetchState=="Not-Started"||r.approversDetailsFetchStatus.fetchState==="In-Progress"?b.jsx($,{fetchState:r.approversDetailsFetchStatus.fetchState,style:{backgroundColor:l.colors.grey5}}):b.jsx(J,{navigate:e,approvalUpdateDataView:r,approvalRuleId:p,approverViewData:i,location:t})}function pe(e){return j(e)==null}const Y=F(function(e,s){const t=w(e),p=t.remiSetupApproverViewUpdateData?.type??"approval_create",o=[],l={};for(const r of Object.values(e.vendorState.vendorByID))r?.id!=null&&(o.push(r.id),l[r.id]=r.name);return{localData:t,approvalUpdateActionType:p,allVendorIds:o,vendorNamesById:l,editingRuleId:p==="approval_update"?s.approvalRuleId:void 0,allApprovalRulesWithUser:U(e).allApprovalRules}},function(e,s){const{navigate:t,approvalUpdateDataView:p,approverViewData:o,approvalRuleId:l}=s,r=p.remiSetupApproverViewUpdateData?.type,i=L(s.location);return{onApprovalRuleDataUpdated:a=>{const d=c=>{const m=[];return c.forEach(y=>{const S=y.actorKind?.selectedOption,x=y.selectedRole?.selectedOption;let D=[];S==="role"&&x!=null?D=[{type:"attribute",subType:x,userId:void 0,idType:void 0,isImplicitActor:!1}]:S==="specific_person"&&(D=(y.persons?.selectedUsers??[]).map(q=>({type:"user",subType:void 0,userId:q.userId,idType:"user",isImplicitActor:!1})));const C=y.action??"require_approval";m.push({action:C,actors:D,operator:D.length>1?C==="require_approval"?"or":"and":"is"})}),m},n=a.amountCriteria,v=a.vendorCriteria,h=a.departmentCriteria,u={};if(n!=null&&n.comparator.selectedOption!=null){const c=n.comparator.selectedOption;u.amount={type:"amount",comparator:c,min:c==="less_than"?void 0:n.min,max:c==="greater_than"?void 0:n.max}}const I=v?.selection.selectedOptions??[];I.length>0&&(u.vendor={type:"vendor",operator:v?.operator.selectedOption??"is",vendorIds:I});const R=h?.selection.selectedOptions??[];if(R.length>0&&(u.department={type:"department",operator:h?.operator.selectedOption??"is",departmentIds:R}),r==="approval_create"){const c={name:a.name,description:a.description,separationOfDuties:a.separationOfDuties,isFallback:a.isFallback,criteria:u,steps:d(a.steps),isApplicableOnPendingApprovalEntity:a.applyToExistingReimbursements.includes("applyToExistingReimbursements")};e(E(c))}else{const c={approvalRuleId:l,name:a.name,description:a.description,separationOfDuties:a.separationOfDuties,isFallback:a.isFallback,criteria:u,steps:d(a.steps),isApplicableOnPendingApprovalEntity:a.applyToExistingReimbursements.includes("applyToExistingReimbursements")};e(E(c))}},onResetClick:()=>{e(A()),r==="approval_update"||i?t("../"):o.allApprovalRules.length===0&&o.fetchState==="Completed"?t("../../setup"):t("../")},onBackClick:()=>{e(A()),r==="approval_update"||i?t("../"):o.allApprovalRules.length===0&&o.fetchState==="Completed"?t("../../setup"):t("../")},onSaveRuleClick:()=>{e(B(!0))},onSaveRuleSuccess:()=>{t("../")},onEditExistingRule:a=>{e(M(a)),t(r==="approval_update"?`../../${a}/edit`:`../${a}/edit`)}}})(G);function ne(){const e=g(t=>K(t)),{isApprovalRulesV3Enabled:s}=W(e?.tenantId);return s?b.jsx(Z,{}):b.jsx(X,{})}function Z(){const e=_(),s=T(),t=O(),{approvalRuleId:p}=k(),o=P.getSignedInUser(),l=N(),r=g(n=>w(n)),i=g(n=>U(n)),[a,d]=f.useState(!1);if(H(),f.useEffect(()=>{a||(d(!0),s(V(!0)))}),f.useEffect(()=>{i.fetchState==="Not-Started"&&e(p!=null?"../../":"../")},[i,p]),o==null)throw Error("Can't access address page without signing in...");return r.approversDetailsFetchStatus.fetchState=="Not-Started"||r.approversDetailsFetchStatus.fetchState==="In-Progress"?b.jsx($,{fetchState:r.approversDetailsFetchStatus.fetchState,style:{backgroundColor:l.colors.grey5}}):b.jsx(Y,{navigate:e,approvalUpdateDataView:r,approvalRuleId:p,approverViewData:i,location:t},p??"new")}export{ne as R,pe as i,H as u};
1
+ import{j as b}from"./liveblocks-BUQfB0Zp.js";import{a as f}from"./sentry-BLIwU6uZ.js";import{u as T,j as g,h as _,g as O,i as k,n as F}from"./core-OMb8nkC1.js";import{kS as z,P$ as w,PL as U,F7 as V,Fj as B,Fe as A,Ff as E,Q0 as j,eV as K,Fd as M}from"./zeni-epic-state-BZ6N8nVI.js";import{z as P,m as N,B as $,bM as Q,af as L,bz as W,bN as G}from"./index-NcZU0lXl.js";import"./mui-JZY-3hhJ.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]="db059be0-57be-4fda-882c-718a293598c2",e._sentryDebugIdIdentifier="sentry-dbid-db059be0-57be-4fda-882c-718a293598c2")}catch{}})();function H(){const e=T(),s=f.useRef(!1),t=g(o=>o.vendorListState.fetchStateBillsTab.fetchState??"Not-Started"),p=g(o=>o.vendorListState.allVendorIdsBillsTab.length>0);f.useEffect(()=>{s.current||p||t==="Completed"||t==="In-Progress"||(s.current=!0,e(z({})))},[p,t,e])}const J=F(function(e,s){const t=w(e),p=t.remiSetupApproverViewUpdateData?.type??"approval_create",o=p==="approval_create"&&t.allApprovalRules.length!==0;let l=t.allApprovalRules.length===0;return s.approvalRuleId&&(l=t.allApprovalRules.findIndex(r=>r.approvalRuleId===s.approvalRuleId)===0),{localData:t,hideUpperBoundField:o,isLowerBoundDisabled:l,approvalUpdateActionType:p}},function(e,s){const{navigate:t,approvalUpdateDataView:p,approverViewData:o,approvalRuleId:l}=s,r=p.remiSetupApproverViewUpdateData?.type,i=L(s.location);return{onApprovalRuleDataUpdated:a=>{const d=v=>{const h=[];return v.forEach(u=>{const I=u.actors.selectedUsers.map(m=>({type:"user",subType:void 0,userId:m.userId,idType:"user",isImplicitActor:!1})),R=u.actors.selectedNonUsers.map(m=>{const y=(S=m.value,j(S)==null);var S;return{type:y?"attribute":"role",subType:m.value,userId:void 0,idType:void 0,isImplicitActor:!y}}),c=I.concat(R);h.push({action:u.stepType.selectedOption,actors:c,operator:c.length>1?u.stepType.selectedOption==="require_approval"?"or":"and":"is"})}),h},n={amount:{type:"amount",comparator:"range",min:{amount:a.lowerBound,currencyCode:"USD",currencySymbol:"$"},max:{amount:a.upperBound,currencyCode:"USD",currencySymbol:"$"}}};if(r==="approval_create"){const v={criteria:n,steps:d(a.steps),isApplicableOnPendingApprovalEntity:a.applyToExistingReimbursements.includes("applyToExistingReimbursements")};e(E(v))}else{const v={approvalRuleId:l,criteria:n,steps:d(a.steps),isApplicableOnPendingApprovalEntity:a.applyToExistingReimbursements.includes("applyToExistingReimbursements")};e(E(v))}},onResetClick:()=>{e(A()),r==="approval_update"||i?t("../"):o.allApprovalRules.length===0&&o.fetchState==="Completed"?t("../../setup"):t("../")},onBackClick:()=>{e(A()),r==="approval_update"||i?t("../"):o.allApprovalRules.length===0&&o.fetchState==="Completed"?t("../../setup"):t("../")},onSaveRuleClick:()=>{e(B(!1))},onSaveRuleSuccess:()=>{t("../")}}})(Q);function X(){const e=_(),s=T(),t=O(),{approvalRuleId:p}=k(),o=P.getSignedInUser(),l=N(),r=g(n=>w(n)),i=g(n=>U(n)),[a,d]=f.useState(!1);if(f.useEffect(()=>{a||(d(!0),s(V(!0)))}),f.useEffect(()=>{i.fetchState==="Not-Started"&&e(p!=null?"../../":"../")},[i,p]),o==null)throw Error("Can't access address page without signing in...");return r.approversDetailsFetchStatus.fetchState=="Not-Started"||r.approversDetailsFetchStatus.fetchState==="In-Progress"?b.jsx($,{fetchState:r.approversDetailsFetchStatus.fetchState,style:{backgroundColor:l.colors.grey5}}):b.jsx(J,{navigate:e,approvalUpdateDataView:r,approvalRuleId:p,approverViewData:i,location:t})}function pe(e){return j(e)==null}const Y=F(function(e,s){const t=w(e),p=t.remiSetupApproverViewUpdateData?.type??"approval_create",o=[],l={};for(const r of Object.values(e.vendorState.vendorByID))r?.id!=null&&(o.push(r.id),l[r.id]=r.name);return{localData:t,approvalUpdateActionType:p,allVendorIds:o,vendorNamesById:l,editingRuleId:p==="approval_update"?s.approvalRuleId:void 0,allApprovalRulesWithUser:U(e).allApprovalRules}},function(e,s){const{navigate:t,approvalUpdateDataView:p,approverViewData:o,approvalRuleId:l}=s,r=p.remiSetupApproverViewUpdateData?.type,i=L(s.location);return{onApprovalRuleDataUpdated:a=>{const d=c=>{const m=[];return c.forEach(y=>{const S=y.actorKind?.selectedOption,x=y.selectedRole?.selectedOption;let D=[];S==="role"&&x!=null?D=[{type:"attribute",subType:x,userId:void 0,idType:void 0,isImplicitActor:!1}]:S==="specific_person"&&(D=(y.persons?.selectedUsers??[]).map(q=>({type:"user",subType:void 0,userId:q.userId,idType:"user",isImplicitActor:!1})));const C=y.action??"require_approval";m.push({action:C,actors:D,operator:D.length>1?C==="require_approval"?"or":"and":"is"})}),m},n=a.amountCriteria,v=a.vendorCriteria,h=a.departmentCriteria,u={};if(n!=null&&n.comparator.selectedOption!=null){const c=n.comparator.selectedOption;u.amount={type:"amount",comparator:c,min:c==="less_than"?void 0:n.min,max:c==="greater_than"?void 0:n.max}}const I=v?.selection.selectedOptions??[];I.length>0&&(u.vendor={type:"vendor",operator:v?.operator.selectedOption??"is",vendorIds:I});const R=h?.selection.selectedOptions??[];if(R.length>0&&(u.department={type:"department",operator:h?.operator.selectedOption??"is",departmentIds:R}),r==="approval_create"){const c={name:a.name,description:a.description,separationOfDuties:a.separationOfDuties,isFallback:a.isFallback,criteria:u,steps:d(a.steps),isApplicableOnPendingApprovalEntity:a.applyToExistingReimbursements.includes("applyToExistingReimbursements")};e(E(c))}else{const c={approvalRuleId:l,name:a.name,description:a.description,separationOfDuties:a.separationOfDuties,isFallback:a.isFallback,criteria:u,steps:d(a.steps),isApplicableOnPendingApprovalEntity:a.applyToExistingReimbursements.includes("applyToExistingReimbursements")};e(E(c))}},onResetClick:()=>{e(A()),r==="approval_update"||i?t("../"):o.allApprovalRules.length===0&&o.fetchState==="Completed"?t("../../setup"):t("../")},onBackClick:()=>{e(A()),r==="approval_update"||i?t("../"):o.allApprovalRules.length===0&&o.fetchState==="Completed"?t("../../setup"):t("../")},onSaveRuleClick:()=>{e(B(!0))},onSaveRuleSuccess:()=>{t("../")},onEditExistingRule:a=>{e(M(a)),t(r==="approval_update"?`../../${a}/edit`:`../${a}/edit`)}}})(G);function ne(){const e=g(t=>K(t)),{isApprovalRulesV3Enabled:s}=W(e?.tenantId);return s?b.jsx(Z,{}):b.jsx(X,{})}function Z(){const e=_(),s=T(),t=O(),{approvalRuleId:p}=k(),o=P.getSignedInUser(),l=N(),r=g(n=>w(n)),i=g(n=>U(n)),[a,d]=f.useState(!1);if(H(),f.useEffect(()=>{a||(d(!0),s(V(!0)))}),f.useEffect(()=>{i.fetchState==="Not-Started"&&e(p!=null?"../../":"../")},[i,p]),o==null)throw Error("Can't access address page without signing in...");return r.approversDetailsFetchStatus.fetchState=="Not-Started"||r.approversDetailsFetchStatus.fetchState==="In-Progress"?b.jsx($,{fetchState:r.approversDetailsFetchStatus.fetchState,style:{backgroundColor:l.colors.grey5}}):b.jsx(Y,{navigate:e,approvalUpdateDataView:r,approvalRuleId:p,approverViewData:i,location:t},p??"new")}export{ne as R,pe as i,H as u};