@zeniai/web-app-ui 5.0.54-qa → 5.0.55-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 (125) hide show
  1. package/dist/assets/AddressRoutes-DmNqU45X.js +1 -0
  2. package/dist/assets/{AddressScreen-ChjeKEBH.js → AddressScreen-CD02bE7U.js} +2 -2
  3. package/dist/assets/{AiCfoScreen-Bn1ZDZwq.js → AiCfoScreen-twy_oEHo.js} +1 -1
  4. package/dist/assets/{BillPayApprovalRoutes-DrVfWwhS.js → BillPayApprovalRoutes-2MMsFms-.js} +1 -1
  5. package/dist/assets/{BillPayRoutes-BjdJSzTb.js → BillPayRoutes-DabCBXCD.js} +7 -7
  6. package/dist/assets/{BusinessVerificationPageScreen-AcNcSrfm.js → BusinessVerificationPageScreen-DY36UKxh.js} +2 -2
  7. package/dist/assets/{ChargeCardRoutes-BZ-GpRol.js → ChargeCardRoutes-BKvKKz6Y.js} +8 -8
  8. package/dist/assets/CompanyPassportScreen-Deb1Mskj.js +1 -0
  9. package/dist/assets/ConnectionAuthScreen-AkiKcrRN.js +11 -0
  10. package/dist/assets/CustomerOnboardingAuthScreen-B7puRRld.js +1 -0
  11. package/dist/assets/{CustomerOnboardingRoutes-BsfNG_4M.js → CustomerOnboardingRoutes-reDt__4U.js} +3 -3
  12. package/dist/assets/{DashboardRoutes-C4CcYbYI.js → DashboardRoutes-B6YOY8LT.js} +3 -3
  13. package/dist/assets/{DefaultTenantHome-G20Laxjh.js → DefaultTenantHome-CG3A8Zld.js} +1 -1
  14. package/dist/assets/DomesticWireDetailScreen-CHZr0Rwr.js +18 -0
  15. package/dist/assets/DrawerScreen-C9oSGPfX.js +1 -0
  16. package/dist/assets/EntityDetailRoutes-BJ_l6xDX.js +1 -0
  17. package/dist/assets/ExpenseAutomationRoutes-jv6wUEHc.js +25 -0
  18. package/dist/assets/FeaturePreviewScreen-Dvylx-Wk.js +1 -0
  19. package/dist/assets/MagicLinkRoutes-DHuoixGe.js +72 -0
  20. package/dist/assets/MagicLinkSignInScreen-Cy0ox9On.js +12 -0
  21. package/dist/assets/MobileAppDrawer-BCaWgXZQ.js +1 -0
  22. package/dist/assets/NotFoundScreen-B8ppov_c.js +1 -0
  23. package/dist/assets/{NotificationRoutes-BL6Ye5sk.js → NotificationRoutes-CzsQHWBP.js} +1 -1
  24. package/dist/assets/PandLWithForecastRoutes-rl7st3Iq.js +1 -0
  25. package/dist/assets/PeopleRoutes-BGm45BRK.js +22 -0
  26. package/dist/assets/PerformanceRoutes-5okn2Dl7.js +1 -0
  27. package/dist/assets/{Preview-Dd1RgxSx.js → Preview-CPDm5N-k.js} +1 -1
  28. package/dist/assets/{QBOConnectionScreen-CwcXMmNE.js → QBOConnectionScreen-DYw5d1DS.js} +1 -1
  29. package/dist/assets/ReferralListScreen-B2bhjkxb.js +5 -0
  30. package/dist/assets/ReimbursementApprovalRoutes-C_ldCyqW.js +1 -0
  31. package/dist/assets/{ReimbursementApprovalRuleDetailScreen-BoCrHkhT.js → ReimbursementApprovalRuleDetailScreen-BM0wb7RO.js} +1 -1
  32. package/dist/assets/{ReimbursementRoutes-BhSlMM0p.js → ReimbursementRoutes-C1eoHxke.js} +9 -9
  33. package/dist/assets/{ReportsRoutes-R-2ogc4m.js → ReportsRoutes-aH8NyeQL.js} +1 -1
  34. package/dist/assets/RewardsRoutes-BG1TYOwi.js +1 -0
  35. package/dist/assets/{ScreenRoutes-BeF5_NIp.js → ScreenRoutes-Be433Rce.js} +2 -2
  36. package/dist/assets/{SettingsRoutes-BWvITHR2.js → SettingsRoutes-Dkedlq8H.js} +6 -6
  37. package/dist/assets/{SetupPagesScreen-JUPsQ0S4.js → SetupPagesScreen-DrXS3IRK.js} +5 -5
  38. package/dist/assets/SignInScreen-B584l1AV.js +1 -0
  39. package/dist/assets/SignOutScreen--i7fPI83.js +9 -0
  40. package/dist/assets/{TaskListScreen-CMvx-0XC.js → TaskListScreen-CbCuzBgx.js} +2 -2
  41. package/dist/assets/TaskRoutes-C6JGvbta.js +9 -0
  42. package/dist/assets/TransactionDetailRoutes-DWhYtS5p.js +1 -0
  43. package/dist/assets/{TransactionDetailScreen-B-hqlTRL.js → TransactionDetailScreen-B0sPog3q.js} +2 -2
  44. package/dist/assets/{TransactionListRoutes-CtcO3OOT.js → TransactionListRoutes-DbOVYmb-.js} +1 -1
  45. package/dist/assets/{TreasuryRoutes-KBaLMYzC.js → TreasuryRoutes-Bw9U7ZrB.js} +5 -5
  46. package/dist/assets/{VendorsRoutes-DQ6Ab1QZ.js → VendorsRoutes-CYu2rHMN.js} +1 -1
  47. package/dist/assets/WiseConfirmationScreen-CT1Vk2du.js +12 -0
  48. package/dist/assets/{ZeniAccountRoutes-DXq3JSQF.js → ZeniAccountRoutes-C-OLyEIo.js} +11 -11
  49. package/dist/assets/ZeniAccountStatementScreen-Dufb_RXJ.js +9 -0
  50. package/dist/assets/{accountMappingHelper-Bcmi4v71.js → accountMappingHelper-CQSFsM6N.js} +1 -1
  51. package/dist/assets/{analytics-zC4vJBLG.js → analytics-ByrfXPqG.js} +1 -1
  52. package/dist/assets/{analyticsHelper-CYuyeE-z.js → analyticsHelper-xeJXIGDO.js} +1 -1
  53. package/dist/assets/{core-sRr8O2Ja.js → core-DcM32IW_.js} +1 -1
  54. package/dist/assets/{decodeURIComponentSafe-DfA0P9Xn.js → decodeURIComponentSafe-mAxyJdJ8.js} +1 -1
  55. package/dist/assets/{dnd-CZEKCPsp.js → dnd-36WXho_9.js} +1 -1
  56. package/dist/assets/{empty-CwKXvn2c.js → empty-GSTAUqhH.js} +1 -1
  57. package/dist/assets/{empty-CA_4wgdA.js → empty-lHXrwReA.js} +1 -1
  58. package/dist/assets/{emptyVideoElement-SkqYxom1.js → emptyVideoElement-Bsa6If51.js} +1 -1
  59. package/dist/assets/epic-DhZTt5cl.js +2 -0
  60. package/dist/assets/{getLocaleForTenant-CUETA9qT.js → getLocaleForTenant-Fu8c_Haa.js} +1 -1
  61. package/dist/assets/{index-B8scoeQA.js → index-BZDuIo7x.js} +10539 -10509
  62. package/dist/assets/{index-BWlUPwOb.js → index-Bw9qJkeB.js} +1 -1
  63. package/dist/assets/{index-Cu-Qhunl.js → index-CR2DVZE0.js} +2 -2
  64. package/dist/assets/{index-DatNfK53.js → index-CjaQ8-D2.js} +1 -1
  65. package/dist/assets/{index-BnBIcb2M.js → index-DTGcnfLC.js} +1 -1
  66. package/dist/assets/{index-B53H88q7.js → index-Dq0r4E9j.js} +1 -1
  67. package/dist/assets/{index-CkGuUxlY.js → index-p7Us2Fcf.js} +1 -1
  68. package/dist/assets/{lexical-CtDGfH8b.js → lexical-CYAYrhLa.js} +1 -1
  69. package/dist/assets/{liveblocks-XXI3_E1y.js → liveblocks-BeS4QmMp.js} +1 -1
  70. package/dist/assets/{lottie-CbW-xVFB.js → lottie-Bdncx-qB.js} +1 -1
  71. package/dist/assets/{mui-CL-iXERd.js → mui--qrGbwFJ.js} +1 -1
  72. package/dist/assets/{pathToGoBack-DHgKJexU.js → pathToGoBack-Cn4t6MOa.js} +1 -1
  73. package/dist/assets/{pdf-BVi8zWaH.js → pdf-6nmWWkz8.js} +4 -4
  74. package/dist/assets/{pdf-lib-Dkp2Hlcw.js → pdf-lib-rQgtUIvp.js} +1 -1
  75. package/dist/assets/{plaid-BUQgPXGQ.js → plaid-BZ0BFqP0.js} +1 -1
  76. package/dist/assets/{pusher-DAE3v-KB.js → pusher-4QLniNXV.js} +1 -1
  77. package/dist/assets/{react-Bsc5-Np9.js → react-BFaux__7.js} +1 -1
  78. package/dist/assets/{react-CdSc8RjC.js → react-BOWjwOm8.js} +1 -1
  79. package/dist/assets/{react-D4LK66mF.js → react-BszWSDWQ.js} +1 -1
  80. package/dist/assets/{react-CMgbSfhl.js → react-C3zOniDH.js} +1 -1
  81. package/dist/assets/{react-DQEvqRaf.js → react-DCTwOcr5.js} +1 -1
  82. package/dist/assets/{react-C8RqDmaV.js → react-DKUlDjBa.js} +1 -1
  83. package/dist/assets/{recharts-z_5Sq5F0.js → recharts-DoWl4vaN.js} +1 -1
  84. package/dist/assets/{routePaths-0yQK7ZVo.js → routePaths-DLti7tZb.js} +1 -1
  85. package/dist/assets/{sentry-DrlL61Aq.js → sentry-BlmJH5WH.js} +1 -1
  86. package/dist/assets/{url-D3wKu-Ai.js → url-AJ2wpRsW.js} +1 -1
  87. package/dist/assets/{url-CnXg07em.js → url-BG92tf7R.js} +1 -1
  88. package/dist/assets/useAskAiCfoHostNavButtonProps-CHoGbMpp.js +1 -0
  89. package/dist/assets/{useDeviceId-D2RgNqNP.js → useDeviceId-DaD3aMiS.js} +1 -1
  90. package/dist/assets/useFetchSuggestedQuestionsWhenReady-DVUj1bst.js +1 -0
  91. package/dist/assets/useInitialThreadRequest-CV6--y9X.js +1 -0
  92. package/dist/assets/{utils-DCRx3jP7.js → utils-RmRP6xA4.js} +1 -1
  93. package/dist/assets/{withTransactionSidePanel-CiVcMng7.js → withTransactionSidePanel-BOlkvwMK.js} +3 -3
  94. package/dist/assets/{zeni-epic-state-BlOBva0w.js → zeni-epic-state-ChnjRetZ.js} +3 -3
  95. package/dist/index.html +1 -1
  96. package/package.json +4 -4
  97. package/dist/assets/AddressRoutes-Ct3N3W-B.js +0 -1
  98. package/dist/assets/CompanyPassportScreen--lpPP9CU.js +0 -1
  99. package/dist/assets/ConnectionAuthScreen-HswO-C2z.js +0 -11
  100. package/dist/assets/CustomerOnboardingAuthScreen-GS886dgA.js +0 -1
  101. package/dist/assets/DomesticWireDetailScreen-ChnkS-X_.js +0 -18
  102. package/dist/assets/DrawerScreen-CeA1faKQ.js +0 -1
  103. package/dist/assets/EntityDetailRoutes-CR2Mdgzj.js +0 -1
  104. package/dist/assets/ExpenseAutomationRoutes-B566g1Vp.js +0 -25
  105. package/dist/assets/FeaturePreviewScreen-CCmVMubZ.js +0 -1
  106. package/dist/assets/MagicLinkRoutes-BTJQzdvS.js +0 -72
  107. package/dist/assets/MagicLinkSignInScreen-Bt05nG5m.js +0 -12
  108. package/dist/assets/MobileAppDrawer-C7qAXiy5.js +0 -1
  109. package/dist/assets/NotFoundScreen-C3kD1egL.js +0 -1
  110. package/dist/assets/PandLWithForecastRoutes-Do8X3aTE.js +0 -1
  111. package/dist/assets/PeopleRoutes-hAxuAtgj.js +0 -22
  112. package/dist/assets/PerformanceRoutes-CoYX1bLH.js +0 -1
  113. package/dist/assets/ReferralListScreen-ChBnSKTx.js +0 -5
  114. package/dist/assets/ReimbursementApprovalRoutes-CifzxX44.js +0 -1
  115. package/dist/assets/RewardsRoutes-DfIrbqL5.js +0 -1
  116. package/dist/assets/SignInScreen-u7i70eJz.js +0 -1
  117. package/dist/assets/SignOutScreen-CHQKEgxw.js +0 -9
  118. package/dist/assets/TaskRoutes-DHBPZIrq.js +0 -9
  119. package/dist/assets/TransactionDetailRoutes-BPCCZduy.js +0 -1
  120. package/dist/assets/WiseConfirmationScreen-D789SzxE.js +0 -12
  121. package/dist/assets/ZeniAccountStatementScreen-K6t_uhF6.js +0 -9
  122. package/dist/assets/epic-C5JPN_0a.js +0 -2
  123. package/dist/assets/useAskAiCfoHostNavButtonProps-Bt4hMVmk.js +0 -1
  124. package/dist/assets/useFetchSuggestedQuestionsWhenReady-B6OFe2QI.js +0 -1
  125. package/dist/assets/useInitialThreadRequest-oa3yZUCF.js +0 -1
@@ -0,0 +1,25 @@
1
+ import{j as p}from"./liveblocks-BeS4QmMp.js";import Rn from"./NotFoundScreen-B8ppov_c.js";import{a as s,b as Pt}from"./sentry-BlmJH5WH.js";import{n as De,S as xn}from"./mui--qrGbwFJ.js";import{h as se,j as wt,u as qe,g as F,k as Dn,l as rt,n as Un,o as je}from"./core-DcM32IW_.js";import{eN as we,OK as On,mv as Ce,fd as Fn,q6 as Bn,mN as Rt,n6 as xt,OL as Dt,ng as _n,OM as Ut,mG as Vn,pE as Mn,eY as he,ON as Re,s5 as Ot,Bg as Ft,OO as Bt,OP as jn,pj as Ge,Ks as dt,Ku as zn,jt as Ln,Kv as $n,jA as qn,cU as Gn,t8 as Je,jq as Jn,mT as _t,nl as xe,OQ as Nn,Jl as ut,Jk as Ae,OR as mt,jR as Yn,OS as Kn,OT as Wn,OU as Zn,OV as Hn,m_ as Qn,mL as ce,no as Te,OW as Xn,OX as ea,OY as ta,nv as na,jE as aa,jv as oa,OZ as sa,jD as ht,KC as ca,O_ as ia,O$ as la,pf as ra,oW as da,nm as pe,oV as ze,P0 as ua,P1 as ma,l8 as ha,bq as pa,l3 as pt,kR as ga,P2 as Ca,gC as gt,fP as Sa,l0 as Ia,v1 as fa,P3 as ka,nW as Ea,nR as va,nV as ya,nG as ba,P4 as Aa,e$ as Vt,n9 as Ta,mW as Pa,fe as Ct,nq as wa,P5 as Ra,nn as Mt,P6 as xa,P7 as Da,P8 as Ua,P9 as Oa,Pa as St,pr as Fa,oM as Ba,Jj as _a,jC as Va,Pb as Ma,FA as ja,jB as za,e_ as La,ol as jt,oE as $a,nk as It,np as qa,bC as Ga,kZ as Ja,kW as Na,Pc as Ya,nF as ft,oC as kt,oA as Ka,oq as Wa,o5 as Za,oD as Ha,Pd as Qa,Pe as Xa,o9 as eo,Pf as to,n$ as no,o8 as ao,o6 as oo,oH as so}from"./zeni-epic-state-ChnjRetZ.js";import{M as zt,a as Lt,p as ge,d as L,v as H,N as $t,cu as co,z as Ue,cv as io,ap as Pe,cw as lo,aP as Et,B as qt,cx as ro,am as Le,D as uo,cy as mo,R as ho,cz as po,cA as go,cB as Co,y as So,k as Io,aJ as fo,b1 as ko,F as Eo,cC as vo}from"./index-BZDuIo7x.js";import{u as Gt}from"./useAskAiCfoHostNavButtonProps-CHoGbMpp.js";import{c as Jt}from"./useFetchSuggestedQuestionsWhenReady-DVUj1bst.js";import{c as vt,C as yo}from"./TransactionDetailScreen-B0sPog3q.js";import{w as bo}from"./withTransactionSidePanel-BOlkvwMK.js";import{h as Ao,v as To}from"./routePaths-DLti7tZb.js";import{g as $e}from"./accountMappingHelper-CQSFsM6N.js";import{D as Po}from"./DrawerScreen-C9oSGPfX.js";import"./recharts-DoWl4vaN.js";import"./analytics-ByrfXPqG.js";import"./plaid-BZ0BFqP0.js";import"./dnd-36WXho_9.js";import"./stripe-DMRn4zHo.js";import"./lottie-Bdncx-qB.js";import"./lexical-CYAYrhLa.js";import"./pdf-6nmWWkz8.js";import"./utils-RmRP6xA4.js";import"./decodeURIComponentSafe-mAxyJdJ8.js";(function(){try{var t=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},d=new t.Error().stack;d&&(t._sentryDebugIds=t._sentryDebugIds||{},t._sentryDebugIds[d]="75421bdd-2bcd-404a-9717-7b0472f6c611",t._sentryDebugIdIdentifier="sentry-dbid-75421bdd-2bcd-404a-9717-7b0472f6c611")}catch{}})();const wo=()=>{const{isAiCfoOpen:t,setIsAiCfoOpen:d}=zt(),U=se(),E=wt(),S=qe(),u=F(g=>we(g)),{useFeatureGate:c}=Lt(),{isFeatureEnabled:B}=c(ge.isRealtimeInsightsFeatureEnabled),m=F(g=>g.expenseAutomationViewState.selectedPeriodByTenantId),o=F(g=>On(g,u.tenantId)),{isAiCfoAccessEnabled:v,onAskAiCfoClick:f}=Gt({isAiCfoOpen:t,setIsAiCfoOpen:d,mobileExploreReferrer:"Month-End Close Overview"}),y=s.useCallback((g,T,_=!1)=>{U(Ce({tenantId:T,period:{month:g.month,year:g.year},refreshViewInBackground:_}))},[]),V=s.useCallback(g=>{const T=S.state?.referrer;o.monthEndCloseChecks?.auditSummary!=null&&L.trackMonthCloseAuditPage(g.month,g.year,o.monthEndCloseChecks.reportEmailSentDate!=null?"closed":"in-review",o.monthEndCloseChecks.auditSummary.auditScorePercentage,!1,T??null),U(Fn(u.tenantId,g))},[u.tenantId,o.monthEndCloseChecks?.auditSummary,o.monthEndCloseChecks?.reportEmailSentDate]),i=m[u.tenantId],h=s.useCallback(()=>{const g=S.state?.referrer;o.monthEndCloseChecks?.auditSummary!=null&&L.trackMonthCloseAuditPage(i.month,i.year,o.monthEndCloseChecks.reportEmailSentDate!=null?"closed":"in-review",o.monthEndCloseChecks.auditSummary.auditScorePercentage,!0,g??null),y(i,u.tenantId,!0)},[y,i,u.tenantId,o.monthEndCloseChecks?.auditSummary,o.monthEndCloseChecks?.reportEmailSentDate]),w=H(S.state?.pathnameStackToGoBack,S.pathname),A=s.useCallback(()=>{if(o.monthEndCloseChecks!=null&&i!=null){const g=o.monthEndCloseChecks.monthEndCloseCheckList.find(T=>T.progress<100);if(g!=null)return void E(`./${g.id}/${i.month}-${i.year}`,{state:{pathnameStackToGoBack:w,message:"comingFromOverview"}});E(`./month_end_insights/${i.month}-${i.year}`,{state:{pathnameStackToGoBack:w,message:"comingFromOverview"}})}},[o.monthEndCloseChecks,i]),{areTenantIdsInSync:R}=$t();return Jt({isDataReady:o.fetchState==="Completed"}),s.useEffect(()=>{i!=null&&o.fetchState!=="In-Progress"&&o.fetchState!=="Completed"&&R&&y(i,u.tenantId)},[y,i,o.fetchState,u.tenantId,R]),s.useEffect(()=>{i!=null&&o.monthClosePerformanceTrendFetchStatus.fetchState!=="In-Progress"&&o.monthClosePerformanceTrendFetchStatus.fetchState!=="Completed"&&R&&U(Bn(i))},[i,o.monthClosePerformanceTrendFetchStatus.fetchState,R]),s.useEffect(()=>{const g=setInterval(()=>{o.fetchState!=="In-Progress"&&o.fetchState==="Completed"&&h()},3e5);return()=>clearInterval(g)},[o.fetchState]),s.useEffect(()=>{if(o.fetchState==="Completed"&&o.monthEndCloseChecks?.auditSummary!=null){const g=S.state?.referrer;L.trackMonthCloseAuditPage(o.selectedPeriod.month,o.selectedPeriod.year,o.monthEndCloseChecks.reportEmailSentDate!=null?"closed":"in-review",o.monthEndCloseChecks.auditSummary.auditScorePercentage,!1,g??null)}},[o.fetchState,o.selectedPeriod,o.monthEndCloseChecks?.auditSummary,o.monthEndCloseChecks?.reportEmailSentDate]),p.jsx(Ro,{children:p.jsx(co,{monthEndCloseChecksView:o,isRealtimeInsightsFeatureEnabled:B,onMonthEndCheckClick:g=>{E(`./${g}/${i.month}-${i.year}`,{state:{pathnameStackToGoBack:w,message:"comingFromOverview",referrer:"Expense Automation - Overview"}})},onPeriodChange:V,handleReviewButtonClick:A,onBackClick:()=>{E("../../dashboard")},onReload:h,isAiCfoAccessEnabled:v,onAskAiCfoClick:f})})},Ro=De.div`
2
+ display: flex;
3
+ height: 100vh;
4
+ width: 100%;
5
+ flex: 1 1 auto;
6
+ flex-direction: column;
7
+ background-color: ${t=>t.theme.colors.grey4};
8
+ `,xo=Pt.memo(({reconciliation:t,selectedDrawerAccountId:d,onClose:U,onFetchLinkTokenClick:E,onEstablishConnectionClick:S})=>{const u=se(),c=Ue.getSignedInUser(),B=F(n=>we(n)),m=t.excludedAccountIDs,o=s.useMemo(()=>({userId:c?.userId??"",sessionId:c?.zeniSessionId??"",tenantId:B?.tenantId??""}),[c?.userId,c?.zeniSessionId,B?.tenantId]),{accountReconciliationsByAccountID:v,monthYearPeriod:f,statementUploadChosen:y}=t,V=v[d],i=V?.accountReconEntity.statementMetaData?.statementUploadId,h=(n,a)=>{u(Mn(n,a.split(".")[0]))},w=n=>{i!=null&&u(Vn({accountId:d,selectedPeriod:f,fileId:n,statementUploadId:i}))},A=()=>{u(Dt({statementUploadChosen:!1}))},R=n=>{u(_n({accountId:d,selectedPeriod:f,payload:n}))},g=n=>{u(Ut({accountId:d,selectedPeriod:f,localData:{accountSource:n}}))},T=s.useCallback(()=>{u(Rt({accountId:d}))},[u,d]),_=s.useCallback(()=>{u(xt({accountId:d}))},[u,d]),e=m.includes(d)?t.excludedAccountReconciliationByAccountID[d]:void 0;return V!=null?p.jsx(yt,{children:p.jsx(bt,{children:p.jsx(io,{excludeAccountFetch:t.excludeAccountFetchState,accountReconciliation:V,monthYearPeriod:f,onDismissClick:U,plaidConnectionDetails:t.plaidConnectionDetails,onFetchLinkTokenClick:E,onEstablishConnectionClick:S,onEditFileName:h,onDeleteFile:w,onSelectSourceType:g,filesEndPoint:Pe.fileMicroServiceBaseUrl,authParams:o,openFilePicker:y,onStatementUploadSuccess:R,onUploadWindowOpenedOnce:A,onExcludeFromReconciliation:T})})}):e!=null?p.jsx(yt,{children:p.jsx(bt,{children:p.jsx(lo,{excludedAccountReconciliation:e,includeAccountFetch:t.includeAccountFetchState,onIncludeIntoReconciliation:_})})}):null}),yt=De.div`
9
+ display: flex;
10
+ flex-direction: column;
11
+ height: 100%;
12
+ `,bt=De.div`
13
+ flex: 1;
14
+ min-height: 0;
15
+ display: flex;
16
+ flex-direction: column;
17
+ box-sizing: border-box;
18
+ min-width: 0;
19
+ overflow-x: hidden;
20
+ overflow-y: auto;
21
+ `;function Do({companyId:t,closeCustomerRequestDrawer:d,addCustomerRequest:U,resetCustomerRequest:E}){const S=Ue.getSignedInUser();if(S==null)throw Error("Can't access Customer Request page without signing in...");const u=F(c=>jn(c,t,S));return s.useEffect(()=>{E()},[]),p.jsx(p.Fragment,{children:u.fetchState==="In-Progress"||u.companyMonthEndReportTemplatesData.fetchState==="In-Progress"?p.jsx(qt,{fetchState:"In-Progress"}):p.jsx(ro,{onCloseClick:d,addCustomerRequest:U,snippets:u.companyMonthEndReportTemplatesData,bulletPoints:u.zeniRequestsData??[]})})}const Uo=t=>t.sections.generalExpense.vendors.length+t.sections.reimbursement.vendors.length,{common:{strings:{hyphen:Oo,comma:At,space:Fo}},dateFormat:Nt}=uo.getLocalizedStrings(),Tt=so,Bo=Dn(function(t,d){const{uncategorizedAccounts:U,vendorSearchAutoCompleteData:E,monthEndInsightsCustomerRequestData:S,monthEndInsightsPreviewMode:u,companyId:c,isMissingReceiptsBulkUploadEnabled:B,isTransactionActivityEnabled:m}=d,o=Ue.getSignedInUser(),v=t.tenantState.currentTenantId,f={userId:o?.userId??"",sessionId:o?.zeniSessionId??"",tenantId:v??""},y=he(t),{selectedTransactionCategorizationTab:V}=y;return{expenseAutomationViewSelector:y,bulkUploadSelector:B===!0?y.missingReceipts.bulkUpload:void 0,vendorSearchAutoCompleteData:E,authParams:f,receiptUploadEndpoint:`${Pe.accountMicroServiceBaseUrl}`,transactionAttachmentsEndpoint:`${ho}/transaction_attachments`,bulkUploadEndpoint:B===!0?`${Pe.communicationAgentMicroServiceBaseUrl}/1.0/receipts/bulk-upload`:void 0,isDisabled:!1,currentTab:V,monthEndInsightsCustomerRequestData:S,monthEndInsightsPreviewMode:u,allThreadsSectionOpen:!1,enableMonthEndInsightsZeniGPTFeature:!1,loggedInUser:o,uncategorizedAccounts:U,companyId:c,isTransactionActivityEnabled:m,isAccountingClassesEnabled:Jn(t)}},function(t,d){const{themeState:U,isCOTEnabled:E,isUncategorizedExpenseCategoryEnabled:S,isMissingReceiptsBulkUploadEnabled:u,location:c,vendorSearchAutoCompleteData:B,expenseAutomationViewSelector:m,currentTenant:o,uncategorizedAccounts:v,navigate:f,onClickCustomerRequest:y,handleEditClick:V,setActivityLogTransactionId:i}=d,{selectedPeriod:h,currentSelectedView:w,reconciliation:{selectedAccountId:A}}=m,{accountSettingsView:R}=m.jeSchedules,g=_t(h),T=xe(g.start),_=xe(g.end);return{onZeniLogoClick:()=>{U.toggle()},onUploadReceiptAttachment:e=>{L.trackMissingReceiptAttached(h.month,h.year),t(Ba(e))},onUploadTransactionReceipt:(e,n,a,r,I,C)=>{t(St(e,n,{fetchState:"In-Progress"}));const k=()=>t(St(e,n,{fetchState:"Error"}));po(`${Pe.accountMicroServiceBaseUrl}/1.0/transactions/${n}/attachments`,C,n,a,r,I).then(x=>{x!=null?t(Fa(e,x)):k()}).catch(k)},onMissingReceiptsRowClick:(e,n)=>{if(d.openTransactionPanel)return void d.openTransactionPanel(e,n);const a=H(c.state?.pathnameStackToGoBack,c.pathname);f(`../../transaction/${n}/${e}`,{state:{pathnameStackToGoBack:a,message:"expenseAutomation",origin:"missing_receipts"}})},onUploadReceiptComplete:(e,n)=>{t(Oa(e,n)),o!=null&&t(Ce({tenantId:o.tenantId,period:n,refreshViewInBackground:!0}))},onUploadReceiptFetchStatus:(e,n,a,r)=>{t(Ua(e,{fetchState:n,error:a})),a!=null&&t(gt({messageSection:"missing_receipts_attachment",messageText:"failed",type:"error",showStatusIcon:!0,variables:[{variableName:"__message__",variableValue:r!=null?Fo+Oo+r+At:At}]}))},onUpdateJESchedulesUIState:e=>{t(Da(e))},onUpdateMissingReceiptsUIState:e=>{t(xa(e))},onFetchMissingReceiptsList:()=>{_!=null&&T!=null&&t(Mt({start:T,end:_},{amount:75,currencyCode:"USD",currencySymbol:"$"},!0,!1))},...u===!0?{onBulkUploadFiles:e=>{t(oo(e))},onBulkUploadProgress:e=>{t(ao(e))},onBulkUploadSuccess:e=>{t(no({batchId:e}))},onBulkUploadUploadedFileCount:e=>{t(to(e))},onConfirmBulkUploadMatch:(e,n,a,r,I)=>{t(eo(e,n,a,r,I))},onBulkUploadConfirmMatchAcknowledged:()=>{t(Xa())},onSetBulkUploadResultsTab:e=>{t(Qa(e))},onSetBulkUploadCompletedSubTab:e=>{t(Ha(e))},onSetBulkUploadSortConfig:(e,n)=>{t(kt({sortKey:e,sortOrder:n}))},onClearBulkUpload:()=>{t(Za())},onSearchTransactionsForManualMatch:(e,n)=>{t(Tt(e,n??void 0))},onLoadMoreManualSearch:()=>{const{manualSearch:e}=m.missingReceipts.bulkUpload;e.nextPageToken!=null&&e.searchQuery!==""&&t(Tt(e.searchQuery,e.nextPageToken))},onFetchCompletedTransactions:(e,n)=>{t(Wa(e,n))},onFetchBulkUploadBatches:e=>{t(jt(e))},onFetchMoreBatchDetails:()=>{t(Ka())},onResetBulkUploadSort:()=>{t(kt({sortKey:void 0,sortOrder:void 0}))}}:{},onClearMissingReceiptsTabNavigation:()=>{t(Ra())},onSearchTextChanged:e=>{const n=m.currentSelectedView,a=m.selectedTransactionCategorizationTab;n==="transaction_categorization"&&(t(ze({selectedTab:a,uiState:{searchString:e}})),_!=null&&T!=null&&t(pe(a,{start:T,end:_},!0,!1,e,void 0,!0)))},onRefresh:()=>{d.trackExpenseAutomationTabAnalytics(!0),t(wa(S))},onClose:()=>{w==="reconciliation"&&A!=null&&t(Ct({selectedAccountId:void 0})),f("../")},onBack:()=>{w==="reconciliation"&&A!=null&&t(Ct({selectedAccountId:void 0}))},onSaveReconciliation:e=>{t(Pa(e))},onSaveReconciliationReview:e=>{t(Ta(e))},onUpdateStep:e=>{const{selectedPeriod:n}=m,a=H(c.state?.pathnameStackToGoBack,c.pathname);f(`../${e}/${n.month}-${n.year}`,{state:{pathnameStackToGoBack:a,referrer:m.currentSelectedView}}),t(Vt(e))},handleLogOutClick:()=>{const e=H(c.state?.pathnameStackToGoBack,c.pathname);f("/signout",{replace:!0,state:{pathnameStackToGoBack:e,message:"logout"}})},onJeAccountSettingsChange:e=>{const{vendorsAccountSection:n}=e,{prepaidExpensesAccount:a,fixedAssetsAccount:r,accruedExpensesAccount:I}=n,C=$e(R.prepaidExpensesAccountList,a.selectedOptions),k=$e(R.fixedAssetsAccountList,r.selectedOptions),x=$e(R.accruedExpensesAccountList,I.selectedOptions),q={selectedPrepaidExpensesAccountIds:C.map(b=>b.accountId),selectedFixedAssetsAccountIds:k.map(b=>b.accountId),selectedAccruedExpensesAccountIds:x.map(b=>b.accountId)};t(Aa({data:q}))},onSaveJeAccountSettingsClick:()=>{t(ba())},onJESchedulesFormDataChange(e,n){const{jeScheduleID:a,accumulatedDepreciationCategory:r,scheduleClass:I,scheduleExpenseCategory:C,vendor:k}=n,{allAccountList:x,allClassList:q,allDepreciationAccountList:b}=m.jeSchedules,G=B.entityAutoCompleteView.vendor.length>0?B.entityAutoCompleteView.vendor.find(j=>j.id===k?.selectedOption):void 0,W={id:G?.zeniId??k?.selectedOption??"",name:G?.name??k?.defaultOptions.find(j=>j.value===k?.selectedOption)?.label??"",logo:G?.logo},Oe=C?.selectedOption!=null?x.find(j=>j.qboId===C.selectedOption):void 0,Se=I?.selectedOption!=null?q.find(j=>j.classId===I.selectedOption):void 0,Ie=r?.selectedOption!=null?b.find(j=>j.qboId===r.selectedOption):void 0;t(ya({scheduledJournalEntryID:e,localData:{jeScheduleID:a,scheduledJournalEntryID:e,updatedCategoryId:Oe?.accountId,updatedClassId:Se?.classId,updatedAccumulatedDepreciationCategoryID:Ie?.accountId,updatedVendor:{id:W.id,name:W.name}}}))},ignoreRecommendedJeSchedule(e,n){t(va(e,n))},vendorSearchAutoCompleteActions:{onAutoCompleteInputChange:(e,n)=>{e.trim().length>=2?t(ut({searchString:e,entityType:n,searchOrigin:"common"})):e.trim().length===0&&t(Ae("common"))},onCancelAutoComplete:()=>{t(Ae("common"))}},onPostJESchedule(e,n){t(Ea({scheduledJournalEntryID:e,jeScheduleTransactionKey:n}))},clearJeScheduleLocalData(){t(ka())},handleJeScheduleClick:(e,n,a)=>{t(fa({selectedJEScheduleKey:n}));const r=H(c.state?.pathnameStackToGoBack,c.pathname);f(`../../vendors/schedules/${a}/details/${e}`,{state:{pathnameStackToGoBack:r,message:"expenseAutomation",origin:"je_schedules"}})},improveMonthEndInsightsUsingZeniGPTClick:e=>{o!=null&&t(Ia(e,o.companyId,o.tenantId))},onClickCustomerRequest:y,setActivityLogTransactionId:i,onCloseAllThreadsSection:()=>{},onCloseFileAttachmentSnackBar:()=>{t(Sa())},onOpenFileAttachmentSnackBar:()=>{t(gt({messageSection:"cockpit_month_end_email_attachment_upload",messageText:"failed",type:"error",showStatusIcon:!0}))},onRemoveFileAttachment:e=>{t(Ca(e))},onUpdateFileAttachment:e=>{t(ga({files:e}))},previewMonthEndReport:(e,n,a,r)=>{o!=null&&t(pt(e,o.companyId,n,!0,a,r,o.tenantId))},saveMonthEndReport:(e,n,a,r)=>{o!=null&&t(pt(e,o.companyId,n,!1,a,r,o.tenantId))},onEditMonthEndInsightsClick:V,sendMonthEndReport:e=>{const n=c.state?.referrer,{selectedPeriod:a,auditSummary:r}=m;o!=null&&r?.auditScorePercentage!=null&&(t(ha(o.companyId,e,o.tenantId)),L.trackInsightsEmailPage(a.month,a.year,!1,"draft",r.auditScorePercentage,pa().format(Nt.analytics.MMMDDCommaYYYYformat),n??null))},onTransactionCategorizationRowClick:(e,n)=>{if(d.openTransactionPanel)return void d.openTransactionPanel(e,n);const a=H(c.state?.pathnameStackToGoBack,c.pathname);f(`../../transaction/${n}/${e}`,{state:{pathnameStackToGoBack:a,message:"expenseAutomation",origin:"transaction_categorization"}})},setLocalDataForCategoryAndClass:(e,n,a,r,I,C,k,x,q,b,G)=>{t(ma(e,n,a,r,v,I,C,k,x,q,b,G))},onCancelAutoComplete:()=>{t(Ae("common"))},updateExpenseAutomationReconListScrollPosition:e=>{t(mt({scrollPosition:e}))},onUpdateTab:e=>{d.closeSidePanel?.(),_!=null&&T!=null&&(t(pe(e,{start:T,end:_},!1,!1)),t(ua(e)))},onUpdateTransactionCategorizationUIState:(e,n)=>{t(ze({selectedTab:e,uiState:n})),_!=null&&T!=null&&t(pe(e,{start:T,end:_},!1,!1,n.searchString,null,!0))},onUpdateScrollYOffSetTransactionCategorizationUIState:(e,n)=>{t(ze({selectedTab:e,uiState:n}))},onFetchTransactionCategorizationList:(e,n,a,r,I,C,k)=>{_!=null&&T!=null&&t(pe(e,{start:T,end:_},!0,a,n,r,I,C,k))},resetTransactionCategorizationLocalData:(e,n,a,r,I,C,k,x)=>{t(da(e,n,a,r,x??null,I,C,!1,k))},updateSelectedVendorForTransaction:(e,n,a,r,I)=>{t(ht({selectedTab:e,transactionId:n,lineId:a,selectedTransaction:r,uncategorizedAccounts:v,updatedVendor:I}))},onSaveUpdateTransactionCategorization:(e,n,a)=>{const r=c.state?.referrer;e==="autoCategorized"?L.trackTransactionsAutoCategorisedPage(h.month,h.year,m.transactionView.totalCountByTab.autoCategorized,n.length,!1,r??null):L.trackTransactionsReviewPage(h.month,h.year,m.transactionView.totalCountByTab.review,n.length,!1,r??null),t(ra(e,n,a,S))},onUpdateSelectedCheckboxTransactionIds:(e,n)=>{t(la({selectedTab:e,transactionIds:n}))},onFetchRecommendationsForEntityCategorizationWithCustomer:(e,n,a,r,I,C,k)=>{const{transactionId:x,transaction:q,lineIds:b}=n;C!=null&&t(ca({transactionId:x,customerUpdates:C})),t(ia({selectedTab:r,transactionId:x.id,lineId:b[0],selectedTransaction:q,uncategorizedAccounts:v,updatedCustomer:C,selectedEntity:I,isUncategorizedExpenseCategoryEnabled:k})),I!=null&&t(Je(I,e,n,a,!0,E,k))},onFetchRecommendationsForEntityCategorization:(e,n,a,r,I,C,k)=>{const{transactionId:x,transaction:q,lineIds:b}=n;C!=null&&(t(aa({transactionId:x,vendorUpdates:{name:C.name,id:C.id?C.id:void 0}})),t(oa({vendorId:C.id?C.id:void 0,localData:{vendorName:C.name,vendorId:C.id?C.id:void 0}}))),C?.id?(t(ht({selectedTab:r,transactionId:x.id,lineId:b[0],selectedTransaction:q,uncategorizedAccounts:v,updatedVendor:C,selectedEntity:I,isUncategorizedExpenseCategoryEnabled:k})),I!=null&&t(Je(I,e,n,a,!0,E,k))):t(sa({selectedTab:r,transactionId:x.id,lineId:b[0]}))},fetchFluxViewOnScroll:(e,n)=>{t(Te(e,!0,!1,n,!1,!0))},onFetchFluxViewList:()=>{t(Te(h,!0,!1,null,!1,!1))},markAsReview:(e,n,a,r)=>{L.trackFluxAnalysisReviewed(a.month,a.year,r??!1,e),t(na(n,e,a,r??!1))},onUpdateFluxAnalysisUIState:e=>{t(ta(e))},updateOperatingExpensesIdsForReview:e=>{t(ea({operatingExpenseIds:e,selectedPeriod:h}))},redirectToVendorDetailPage:e=>{if(d.tenantEmailDomain!=null){const n=To(e.id,e.qboId,d.tenantEmailDomain),a=H(d.location.state?.pathnameStackToGoBack,d.location.pathname);d.navigate(n,{state:{pathnameStackToGoBack:a,message:"expenseAutomation",referrer:"Vendor List",origin:"flux_analysis"}})}},updateSectionIdsForReview:e=>{t(Xn({sectionId:e,selectedPeriod:h}))},onFetchReimbursementView:(e,n,a)=>{t(Te(e,!0,!1,n,!0,a))},onReviewClicked:e=>{t(ce(h,e))},setOpenDrawerClicked:e=>{t(Re({selectedDrawerAccountId:e}))},onFetchLinkTokenClick:(e,n)=>{t(Ot("expense_automation_reconcile",e,n))},onEstablishConnectionClick:(e,n)=>{const a=o?.companyId;a!=null&&(t(Ft(e,a,"expense_automation_reconcile",void 0,"link_account_no_microdeposit",n)),t(Bt({accountId:n,connectionInProgress:!0})))},onAddStatementClick:e=>{t(Re({selectedDrawerAccountId:e})),t(Ut({accountId:e,selectedPeriod:h,localData:{accountSource:"bank_statement"}})),t(Dt({statementUploadChosen:!0}))},onReloadReconciliationListPage:()=>{t(ce(h,void 0,!0,!1))},onUpdateReconcileTabLocalData:e=>{t(Qn({selectedTransactionIds:e}))},onReconTabColumnSortConfigChanged:(e,n)=>{t(Hn({sortKey:e,sortOrder:n}))},onReconReviewTabColumnSortConfigChanged:(e,n)=>{t(Zn({sortKey:e,sortOrder:n}))},onReconTabUpdate:e=>{d.closeSidePanel?.(),t(Wn({selectedTab:e}))},updateReconReviewTabLocalData:(e,n,a)=>{const r=e.vendor?.id;a&&r!=null&&t(Yn(r)),t(Kn({data:e,transactionId:n}))},onReconMatchedTransactionClick:e=>{if(d.openTransactionPanel)return void d.openTransactionPanel(e,Ge("bill"));const n=H(c.state?.pathnameStackToGoBack,c.pathname);f(`../../transaction/bill/${e}`,{state:{pathnameStackToGoBack:n,message:"expenseAutomation",origin:"reconciliation"}})},onReloadPage:()=>{window.location.reload()},onBackClick:()=>{f(-1)},onReconListPageScroll:e=>{t(mt({scrollPosition:e}))},onVendorAutoCompleteInputChange:e=>{e.trim().length>=2?t(ut({searchString:e,searchOrigin:"common"})):e.trim().length===0&&t(Ae("common"))},onReconNodeCollapseToggled:(e,n)=>{t(Nn({nodeId:e,collapsed:n}))},updateSectionCollapseStatus:()=>{},onExcludeAccountFromReconciliation:e=>{t(Rt({accountId:e}))},onIncludeAccountIntoReconciliation:e=>{t(xt({accountId:e}))}}},(t,d,U)=>{const{isMissingReceiptsBulkUploadEnabled:E,...S}=U;return function(u,c,B){return{...u,...c,...B,onUploadTransactionReceipt:(m,o,v,f,y)=>{c.onUploadTransactionReceipt(m,o,v,f,y,u.authParams)}}}(t,d,S)})(mo),_o=bo(function(t){const d=t.displayName??t.name??"Component",U=Pt.memo(t),E=S=>{const u=se(),c=function(){const h=se(),w=F(A=>he(A).reconciliation.selectedDrawerAccountId);return{isOpen:w!=null,selectedAccountId:w,openPanel:s.useCallback(A=>{h(Re({selectedDrawerAccountId:A}))},[h]),closePanel:s.useCallback(()=>{h(Re({selectedDrawerAccountId:void 0}))},[h])}}(),B=F(h=>he(h).reconciliation),m=F(h=>we(h)),o=s.useCallback((h,w)=>{u(Ot("expense_automation_reconcile",h,w))},[u]),v=s.useCallback((h,w)=>{const A=m?.companyId;A!=null&&(u(Ft(h,A,"expense_automation_reconcile",void 0,"link_account_no_microdeposit",w)),u(Bt({accountId:w,connectionInProgress:!0})))},[u,m?.companyId]),f=s.useMemo(()=>{if(c.isOpen&&c.selectedAccountId!=null)return p.jsx(xo,{reconciliation:B,selectedDrawerAccountId:c.selectedAccountId,onClose:c.closePanel,onFetchLinkTokenClick:o,onEstablishConnectionClick:v})},[c.isOpen,c.selectedAccountId,c.closePanel,B,o,v]),y=s.useMemo(()=>({reconPanelContent:f,reconSidePanelIsOpen:c.isOpen,closeReconSidePanel:c.closePanel}),[f,c.isOpen,c.closePanel]),V=s.useContext(Et),i=s.useMemo(()=>c.isOpen?{closePanel:c.closePanel,selectedItemId:c.selectedAccountId}:V,[c.isOpen,c.closePanel,c.selectedAccountId,V]);return p.jsx(Et.Provider,{value:i,children:p.jsx(U,{...S,...y})})};return E.displayName=`withReconSidePanel(${d})`,E}(({closeSidePanel:t,openTransactionPanel:d,panelContent:U,sidePanelIsFullView:E,sidePanelIsOpen:S,reconPanelContent:u,reconSidePanelIsOpen:c,closeReconSidePanel:B})=>{const{isAiCfoOpen:m,setIsAiCfoOpen:o}=zt(),v=go(),{isOpen:f}=Co(),y=wt(),V=qe(),i=se(),{isAiCfoAccessEnabled:h,onAskAiCfoClick:w}=Gt({isAiCfoOpen:m,setIsAiCfoOpen:o,mobileExploreReferrer:"Transaction categorization"}),A=s.useCallback(()=>{S===!0&&E!==!0&&t?.()},[t,S,E]),{areTenantIdsInSync:R}=$t(),g=(()=>{const l=F(J=>he(J)),z=qe(),{currentSelectedViewFetchState:K,currentSelectedView:M,selectedPeriod:O}=l,me=Le(M),ee=Le(K.fetchState),ve=s.useCallback(J=>{const Z=z.state?.referrer;M==="transaction_categorization"&&(l.selectedTransactionCategorizationTab==="review"?L.trackTransactionsReviewPage(O.month,O.year,l.transactionView.totalCountByTab.review,0,J,Z??null):L.trackTransactionsAutoCategorisedPage(O.month,O.year,l.transactionView.totalCountByTab.autoCategorized,0,J,Z??null)),M==="missing_receipts"&&L.trackMissingReceiptsPage(O.month,O.year,J,l.missingReceipts.transactions.length,Z??null),M==="je_schedules"&&L.trackMonthCloseScheduleListPage(O.month,O.year,J,l.jeSchedules.draftSchedules.length,l.jeSchedules.resolveSchedules.length,Z??null),M==="flux_analysis"&&L.trackFluxAnalysisPage(O.month,O.year,J,Uo(l.fluxAnalysis),Z??null),M==="month_end_insights"&&l.auditSummary?.auditScorePercentage!=null&&L.trackInsightsEmailPage(O.month,O.year,J,"draft",l.auditSummary.auditScorePercentage,null,Z??null)},[O,l]);return s.useEffect(()=>{ee===K.fetchState&&M===me||K.fetchState!=="Completed"||ve(!1)},[M,K.fetchState,me]),ve})(),T=So(),[_,e]=s.useState(!1),n=F(l=>dt(l)),a=F(l=>we(l)),[r,I]=s.useState(!1),[C,k]=s.useState(!1),[x,q]=s.useState([]),[b,G]=s.useState(void 0),W=s.useCallback(l=>{l!=null&&(m&&o(!1),v(),A()),G(l)},[A,m,v,o]),Oe=s.useCallback(()=>{v(),G(void 0),A(),w()},[A,w,v]),Se=s.useRef(m);s.useEffect(()=>{m===!0&&Se.current===!1&&(v(),G(void 0),A()),Se.current=m},[A,m,v]);const Ie=s.useRef(f);s.useEffect(()=>{f===!0&&Ie.current===!1&&(m&&o(!1),G(void 0),S===!0&&E!==!0&&t?.()),Ie.current=f},[t,f,m,o,E,S]);const j=S===!0&&E!==!0,Ne=s.useRef(j);s.useEffect(()=>{j&&!Ne.current&&(m&&o(!1),v(),G(void 0)),Ne.current=j},[m,j,v,o]);const[Ye,Yt]=s.useState(!1),Ke=s.useRef(!1),{selectedTab:We}=rt(),{tenantEmailDomain:Kt}=rt(),[Fe,Ze]=s.useState(V.state?.message==="comingFromTransactionDetail"),He=V.state?.message==="comingFromOverview",Wt=Io(),Be=Ue.getSignedInUser(),{useDynamicConfig:Zt,useFeatureGate:fe}=Lt(),{configValue:Ht}=Zt(fo.enableUncategorizedExpenseCategory),Q=Ht?.uncategorized_expense_category_enabled===!0,{isFeatureEnabled:Qe}=fe(ge.isRealtimeInsightsFeatureEnabled),{isFeatureEnabled:ie}=fe(ge.isMissingReceiptsBulkUploadEnabled),{isFeatureEnabled:Xe}=fe(ge.isTransactionActivityEnabled),{isFeatureEnabled:Qt}=fe(ge.isExpenseAutomationCommentingEnabled),Xt=s.useCallback(l=>{const z=Ge(l.view==="reconciliation"?"bill":"expense");d?.(l.entityId,z)},[d]),en=F(l=>_a(l,"common")),$=F(l=>he(l)),{monthEndCloseChecksView:Y,currentSelectedView:P,selectedPeriod:D,selectedTransactionCategorizationTab:ne,currentSelectedViewBackgroundRefreshFetchState:tn,currentSelectedViewFetchState:X,jeSchedules:_e,reconciliation:nn}=$;s.useEffect(()=>{P==="transaction_categorization"&&S!==!0||W(void 0)},[P,W,S]);const ke=s.useRef(null);s.useEffect(()=>{ke.current!==null?ke.current!==ne&&(ke.current=ne,P==="transaction_categorization"&&W(void 0)):ke.current=ne},[P,ne,W]);const an=F(l=>b==null?void 0:Va(l.transactionState,b)),ae=an?.qboId,on=F(l=>ae==null?void 0:Ma(l,ae));s.useEffect(()=>{ae!=null&&i(ja(ae))},[i,ae]);const{selectedAccountId:le}=nn,et=Le(_e.accountSettingsView.saveState.fetchState),sn=F(l=>za(l.accountState,l.accountListState,"accountList")),re=We!=null?La(We):P,cn=F(l=>l.entityAutoCompleteState.autoCompleteText.common);if(Jt({isDataReady:X.fetchState==="Completed"}),Be==null)throw Error("Can't access expense automation screen without signing in...");const tt=_t(D),de=xe(tt.start),ue=xe(tt.end);if(de==null||ue==null)throw Error(`Invalid start - ${de} and end - ${ue} period from given ${D}`);const ln=s.useCallback(()=>{I(!1)},[]),rn=s.useCallback(()=>{k(!0)},[]),dn=s.useCallback(l=>{q(l),k(!1)},[]),un=s.useCallback(()=>{q([])},[]),Ee=$.missingReceipts.bulkUpload.phase,nt=$.missingReceipts.bulkUpload.currentBatchId;s.useEffect(()=>{ie===!0&&P==="missing_receipts"&&Ee==="matching"&&nt!=null&&i(jt({cacheOverride:!0}))},[ie,P,Ee,nt,i]);const at=Be?.userId,mn=D.month,hn=D.year,ot=a?.tenantId;s.useEffect(()=>{P==="missing_receipts"&&ie!==!1&&Ee==="idle"&&at!=null&&ot!=null&&i($a())},[P,ie,Ee,at,ot,mn,hn,i]),s.useEffect(()=>{n.newVendorState?.vendorDetailLocalData?.vendorName!=null?e(!0):e(!1)},[n.newVendorState?.vendorDetailLocalData?.vendorName]),s.useEffect(()=>{re!=null&&P!==re&&i(Vt(re))},[re]),s.useEffect(()=>{Ye!==!1||X.fetchState!=="Completed"&&X.fetchState!=="Error"||!R||(Yt(!0),i(It(!1,!1,Q)))},[Ye,X,R,Q]),s.useEffect(()=>{!He&&R&&(i(It(!1,!1,Q)),i(ce(D,le,!1,!1)))},[D.month,D.year,R,Q]);const st=s.useCallback((l=!1,z=!1)=>{const K={start:de,end:ue};switch(P){case"transaction_categorization":i(pe(ne,K,l,!Fe,void 0,void 0,z,void 0,Q)),Ze(!1);break;case"flux_analysis":i(Te(D,l,z,null));break;case"month_end_insights":if(z===!1){const M=new Date(D.year,D.month,0),O=Ga(M.toDateString()).format(Nt.analytics.YYYYDashMMDashDDFormat);i(Ja(!0,a.companyId,a.tenantId,O)),i(Na(a.companyId,a.tenantId))}break;case"je_schedules":i(qa(K,z));break;case"missing_receipts":i(Mt(K,{amount:75,currencyCode:"USD",currencySymbol:"$"},l,z));break;default:i(ce(D,le,l,z))}},[P,de,ue,a.companyId,a.tenantId,ne,D,le,Fe,Ze,Q]);s.useEffect(()=>{P===re&&X.fetchState==="Not-Started"&&R&&st(!0)},[X,de,ue,a.companyId,a.tenantId,R]),s.useEffect(()=>{He||Fe||Ke.current||tn.fetchState==="In-Progress"||X.fetchState!=="Completed"||(Ke.current=!0,st(!0,!0))},[]),s.useEffect(()=>{Y.fetchState!=="In-Progress"&&Y.fetchState!=="Completed"&&i(Ce({tenantId:a.tenantId,period:D,refreshViewInBackground:!1}))},[Y.fetchState,a.tenantId]),s.useEffect(()=>{$.monthEndInsights?.previewMonthEndReportStatus?.fetchState==="Completed"?I(!0):I(!1)},[$.monthEndInsights?.previewMonthEndReportStatus?.fetchState]),s.useEffect(()=>{$.monthEndInsights?.sendMonthEndReportStatus?.fetchState==="Completed"&&R&&(i(Ce({tenantId:a.tenantId,period:D,refreshViewInBackground:!0})),i(Ya({companyId:a.companyId})),y("../"))},[$.monthEndInsights?.sendMonthEndReportStatus?.fetchState,a.tenantId,D,a.companyId,R]),s.useEffect(()=>{const l=setInterval(()=>{Y.fetchState!=="In-Progress"&&Y.fetchState==="Completed"&&i(Ce({tenantId:a.tenantId,period:D,refreshViewInBackground:!0}))},3e5);return()=>clearInterval(l)},[Y.fetchState,a.tenantId,D,i]),s.useEffect(()=>{const l=setInterval(()=>{P==="reconciliation"&&le==null&&$.reconciliation.fetchStatus.fetchState==="Completed"&&$.reconciliation.refreshStatus.fetchState!=="In-Progress"&&i(ce(D,void 0,!0,!0))},3e5);return()=>clearInterval(l)},[P,i,$.reconciliation.fetchStatus.fetchState,$.reconciliation.refreshStatus.fetchState,ce,le,D]);const pn=vt();s.useEffect(()=>{const l=(Y.monthEndCloseChecks?.monthEndCloseCheckList.find(z=>z.id==="month_end_insights")?.isDisabled??!1)&&!Qe;P!=="month_end_insights"||!l&&Y.monthEndCloseChecks?.reportEmailSentDate==null||y("../")},[P,Y.monthEndCloseChecks]);const gn=c===!0?u:U,Cn=c===!0||S===!0,Sn=c===!0?B:t;s.useEffect(()=>{et==="In-Progress"&&_e.accountSettingsView.saveState.fetchState==="Completed"&&i(ft())},[et,_e.accountSettingsView.saveState.fetchState,ft]);const{transactionId:ct,onSaveVendor:In,onSaveSuccess:fn,onCancel:kn,vendorViewDetails:En}=(({expenseAutomationViewSelector:l,closeDrawerHandler:z,currentSelectedView:K})=>{const M=se();let O,me,ee;const ve=vt(),J=l.transactionView;let Z=()=>{};const{transactions:vn,selectedTransactionId:oe,selectedTransactionLineId:ye,transactionLocalData:yn}=J;if(K==="transaction_categorization"){const Ve=yn.find(te=>te.transactionId===oe),N=vn.find(te=>te.id===oe),it=ye!=null?Ve?.transactionReviewLocalData?.lineItemById[ye]:void 0,lt=it?.account;me=it?.class?.classId,O=["Uncategorized Income","Uncategorized Expense"].includes(lt?.accountName??"")?void 0:lt?.accountId;const An=Ao(oe,N?.typeOfTransaction);N!=null&&An&&(ee={id:oe,type:Ge(N.typeOfTransaction)}),Z=()=>{if(oe!=null&&ye!=null&&N!=null){const te=J.transactionLocalData.find(be=>be.transactionId===oe)?.transactionReviewLocalData;if(te!=null&&N.lines!=null&&N.lines.length>0){const be=te.lineItemById[ye];let Me=te.selectedEntity;if(Gn(N)||(Me=be.selectedEntityLine),Me!=null){const Tn=Me,Pn={transactionId:{id:N.id,type:N.type},transaction:N,lineIds:N.lines.map(wn=>wn.id)??[]};M(Je(Tn,be.amount.amount,Pn,!1,!0,ve))}}}}}const bn=F(Ve=>dt(Ve,void 0,O,me));return{transactionId:ee,onSaveVendor:()=>{M(qn(ee,void 0,!1,!0))},onSaveSuccess:Z,onCancel:()=>{ee!=null&&M(zn({transactionId:ee})),M(Ln()),M($n()),z()},vendorViewDetails:bn}})({expenseAutomationViewSelector:$,closeDrawerHandler:()=>{e(!1)},currentSelectedView:P});return Wt?.loggedInUserRoleMap==null?Y.fetchState==="Error"?p.jsx(ko,{onGoHome:()=>y("../",{replace:!0}),onReload:()=>window.location.reload()}):p.jsx(qt,{fetchState:"In-Progress"}):p.jsxs(p.Fragment,{children:[p.jsx(Po,{isOpen:C,drawerLeftMargin:new Eo(0,0,300,650),onClose:()=>{k(!1)},children:p.jsx(Vo,{onClick:l=>l.stopPropagation(),children:p.jsx(Do,{companyId:a.companyId,closeCustomerRequestDrawer:()=>k(!1),addCustomerRequest:dn,resetCustomerRequest:un})})}),ct!=null&&_&&p.jsx(yo,{isOpen:_,transactionId:ct,onSaveVendor:In,onSaveSuccess:fn,onCancel:kn,vendorViewDetails:En}),p.jsx(Bo,{navigate:y,location:V,themeState:T,vendorSearchAutoCompleteData:{autoCompleteText:cn,entityAutoCompleteView:en},expenseAutomationViewSelector:$,isMissingReceiptsBulkUploadEnabled:ie,monthEndInsightsPreviewMode:r,monthEndInsightsCustomerRequestData:x,isRealtimeInsightsFeatureEnabled:Qe,isUncategorizedExpenseCategoryEnabled:Q,isCOTEnabled:pn,currentTenant:a,companyId:a.companyId,signedInUser:Be,isTransactionActivityEnabled:Xe,activityLogTransactionId:P==="transaction_categorization"?b:void 0,activityLogPanel:P==="transaction_categorization"&&Xe===!0&&b!=null?p.jsx(vo,{activityLogView:on,qboId:ae,onClose:()=>W(void 0),selectedTransactionId:b},String(b)):null,uncategorizedAccounts:sn,onClickCustomerRequest:rn,handleEditClick:ln,tenantEmailDomain:Kt,trackExpenseAutomationTabAnalytics:g,setActivityLogTransactionId:W,closeSidePanel:Sn,openTransactionPanel:d,sidePanelIsOpen:Cn,sidePanelIsFullView:c!==!0&&E,panelContent:gn,isAiCfoAccessEnabled:h,onAskAiCfoClick:Oe,isExpenseAutomationCommentingEnabled:Qt,onExpenseAutomationCommentingThreadClick:Xt,sidePanelListPercent:c===!0?66:void 0})]})})),Vo=De(xn)`
22
+ display: flex;
23
+ min-height: 100%;
24
+ flex-direction: column;
25
+ `;function ls(){return p.jsxs(Un,{children:[p.jsx(je,{path:"*",element:p.jsx(wo,{})}),p.jsx(je,{path:"/:selectedTab/:selectedPeriod/*",element:p.jsx(_o,{})}),p.jsx(je,{path:"*",element:p.jsx(Rn,{})})]})}export{ls as default};
@@ -0,0 +1 @@
1
+ import{j as s}from"./liveblocks-BeS4QmMp.js";import{a as r}from"./sentry-BlmJH5WH.js";import{Y as c,_ as l,$ as p,r as f}from"./index-BZDuIo7x.js";import"./mui--qrGbwFJ.js";import m from"./NotFoundScreen-B8ppov_c.js";import{j as u,u as b}from"./core-DcM32IW_.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]="fd703c1c-5b84-4ab3-8453-943d8682648a",e._sentryDebugIdIdentifier="sentry-dbid-fd703c1c-5b84-4ab3-8453-943d8682648a")}catch{}})();const j=()=>{const e=u(),a=b(),t=r.useCallback(()=>{window.open("https://www.zeni.ai/demo/request","_blank")},[]),d=r.useCallback(()=>{(()=>{const n=f(a.state?.pathnameStackToGoBack),i=n.poppedPathname??k();e(i,{state:{pathnameStackToGoBack:n.newStack}})})()},[]),o=c(a.pathname);return o!=null?s.jsx(l,{menuItem:p(o),onDemoClick:t,onGoBack:d}):s.jsx(m,{})},k=(e=2)=>{let a="../";for(let t=0;t<e;t++)a=`${a}../`;return a};export{j as F};
@@ -0,0 +1,72 @@
1
+ import{j as t}from"./liveblocks-BeS4QmMp.js";import{l as y,k as x,j as C,u as S,h as ee,q as te,g as E,N as ae,n as ne,o as p}from"./core-DcM32IW_.js";import{Ix as k,Iy as v,Iz as T,yT as B,yF as G,IA as A,IB as oe,IC as se,yJ as ie,eO as j,yQ as le,yN as de}from"./zeni-epic-state-ChnjRetZ.js";import{q as g,o as d,I as re,d as I,j as M,w as ce,r as me,s as pe,v as V,a as ue,p as he,x as xe,y as ge,h as fe,A as we,B as be,C as ye,T as Se,S as ke,E as ve,F as Ie,G as je}from"./index-BZDuIo7x.js";import{n as m}from"./mui--qrGbwFJ.js";import f from"./NotFoundScreen-B8ppov_c.js";import{a as $}from"./sentry-BlmJH5WH.js";import"./recharts-DoWl4vaN.js";import"./analytics-ByrfXPqG.js";import"./plaid-BZ0BFqP0.js";import"./dnd-36WXho_9.js";import"./stripe-DMRn4zHo.js";import"./lottie-Bdncx-qB.js";import"./lexical-CYAYrhLa.js";import"./pdf-6nmWWkz8.js";import"./utils-RmRP6xA4.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]="87fd243d-b10c-4d94-a0c4-44a344941d00",e._sentryDebugIdIdentifier="sentry-dbid-87fd243d-b10c-4d94-a0c4-44a344941d00")}catch{}})();const $e=m.div`
2
+ display: flex;
3
+ height: 100%;
4
+ width: 100%;
5
+ flex: 1 1 auto;
6
+ flex-direction: column;
7
+ align-items: center;
8
+ background-color: ${e=>e.theme.colors.grey4};
9
+ box-shadow: ${e=>`0px 2px ${d.sp1} ${e.theme.colors.dropShadowNormal}`};
10
+ `,Ce=x(function(e){const a=k(e),n=v(e),{companyName:o}=a;return{companyName:o,isDisabled:a.fetchState!=="Completed"?"disabled":void 0,magicLinkBankAccountDetails:n,magicLinkViewState:a}},function(e,a){const{vendorId:n,billId:o}=a;return{onFetchBankName:s=>{e(G(s))},onSaveHandler:s=>{I.trackBillPayMagicLinkSubmitBankAccountDetails(o),e(B(s,"standard",n,o))},onACHDetailsUpdated:s=>{const{bankAccountSection:l}=s;e(T({data:l}))}}})(re);function F(){const e=g(),{vendorId:a,billId:n}=y();return a==null||n==null?t.jsx(f,{}):t.jsx(t.Fragment,{children:t.jsx($e,{windowSize:e,children:t.jsx(Ce,{vendorId:a,billId:n})})})}const Be=m.div`
11
+ display: flex;
12
+ height: 100vh;
13
+ width: 100%;
14
+ flex: 1 1 auto;
15
+ flex-direction: column;
16
+ align-items: center;
17
+ background-color: ${e=>e.theme.colors.grey4};
18
+ box-shadow: ${e=>`0px 2px ${d.sp1} ${e.theme.colors.dropShadowNormal}`};
19
+ `,Ae=x(function(e,a){const{isSubPage:n}=a;return{addressToEdit:A(e),googleAPIKey:M.googleMapsAPIKey,isSubPage:n}},function(e,a){const{navigate:n,location:o}=a,s=()=>{const l=me(o.state?.pathnameStackToGoBack),i=l.poppedPathname??Pe();n(i,{state:{pathnameStackToGoBack:l.newStack}})};return{onSubmitHandler:l=>{const i=ze(l);e(oe({addressToCreate:i})),s()},onCancel:()=>{s()}}})(ce);function De({isSubPage:e}){const a=C(),n=S(),o=g();return t.jsx(t.Fragment,{children:t.jsx(Be,{windowSize:o,children:t.jsx(Ae,{location:n,navigate:a,isSubPage:e===!0,googleAPIKey:M.googleMapsAPIKey})})})}const Pe=(e=2)=>{let a="../";for(let n=0;n<e;n++)a=`${a}../`;return a},ze=e=>({street:[e.street.addressString,e.suite,e.secondaryInfo],city:e.city,state:e.state,country:e.country.selectedOption??"",countryCode:e.countryCode,postalCode:e.postalCode,latitude:e.street.addressValue?.locationLat,longitude:e.street.addressValue?.locationLng}),Ne=m.div`
20
+ display: flex;
21
+ height: 100%;
22
+ width: 100%;
23
+ flex: 1 1 auto;
24
+ flex-direction: column;
25
+ align-items: center;
26
+ background-color: ${e=>e.theme.colors.grey4};
27
+ box-shadow: ${e=>`0px 2px ${d.sp1} ${e.theme.colors.dropShadowNormal}`};
28
+ `,Le=x(function(e){const a=k(e),n=v(e),o=A(e),{companyName:s}=a;return{companyName:s,isDisabled:a.fetchState!=="Completed"?"disabled":void 0,magicLinkBankAccountDetails:n,mailingAddressDetails:o,magicLinkViewState:a}},function(e,a){const{navigate:n,location:o,vendorId:s,billId:l}=a;return{onFetchBankName:i=>{e(G(i))},onSaveHandler:i=>{I.trackBillPayMagicLinkSubmitBankAccountDetails(l),e(B(i,"us-domestic",s,l))},onWireDetailsUpdated:i=>{const{bankAccountSection:r}=i;e(T({data:r}))},onAddressClick:()=>{const i=o.pathname.replace("us-domestic","address"),r=V(o.state?.pathnameStackToGoBack,o.pathname);n(i,{state:{pathnameStackToGoBack:r}})}}})(pe);function Ee(){const e=C(),a=S(),n=g(),{vendorId:o,billId:s}=y();return o==null||s==null?t.jsx(f,{}):t.jsx(t.Fragment,{children:t.jsx(Ne,{windowSize:n,children:t.jsx(Le,{location:a,navigate:e,vendorId:o,billId:s})})})}const Fe=m.div`
29
+ display: flex;
30
+ height: 100%;
31
+ width: 100%;
32
+ flex: 1 1 auto;
33
+ flex-direction: column;
34
+ align-items: center;
35
+ background-color: ${e=>e.theme.colors.grey4};
36
+ box-shadow: ${e=>`0px 2px ${d.sp1} ${e.theme.colors.dropShadowNormal}`};
37
+ `,Te=x(function(e){const a=k(e),n=v(e),o=A(e),{companyName:s}=a;return{companyName:s,isDisabled:a.fetchState!=="Completed"?"disabled":void 0,magicLinkBankAccountDetails:n,mailingAddressDetails:o,magicLinkViewState:a}},function(e,a){const{navigate:n,location:o,vendorId:s,billId:l}=a;return{onFetchBankNameBySwift:i=>{e(ie(i))},onSaveHandler:i=>{I.trackBillPayMagicLinkSubmitBankAccountDetails(l),e(B(i,"international",s,l,a.isLocalCurrencyEnabled))},onBankDetailsUpdated:i=>{const{internationalWireSwiftAccountSection:r}=i;e(se({data:r}))},onAddressClick:()=>{const i=o.pathname.replace("international","address"),r=V(o.state?.pathnameStackToGoBack,o.pathname);n(i,{state:{pathnameStackToGoBack:r}})}}})(xe);function Ge(){const e=C(),a=S(),n=g(),{vendorId:o,billId:s}=y(),{useFeatureGate:l}=ue(),{isFeatureEnabled:i}=l(he.isBillPayLocalCurrencyFeatureEnabled);return o==null||s==null?t.jsx(f,{}):t.jsx(Fe,{windowSize:n,children:t.jsx(Te,{location:a,navigate:e,vendorId:o,billId:s,isLocalCurrencyEnabled:i})})}const Me={containerWidth:new Ie(100,58)},Ve=m(ke)`
38
+ width: ${d.sp4};
39
+ height: ${d.sp4};
40
+ margin-bottom: ${d.sp3};
41
+ margin-top: ${d.sp3};
42
+ margin-left: ${d.sp8};
43
+ cursor: pointer;
44
+ position: absolute;
45
+ color: ${e=>e.theme.colors.brandColorJade};
46
+ `,_e=m.div`
47
+ display: flex;
48
+ height: 100vh;
49
+ flex-direction: ${e=>e.windowSize==="small"?"column":"row"};
50
+ width: 100vw;
51
+ overflow-y: scroll;
52
+ background-color: ${e=>e.theme.colors.grey4};
53
+ `,He=m.div`
54
+ display: flex;
55
+ flex-direction: ${e=>e.windowSize==="small"?"column":"row"};
56
+ flex-direction: column;
57
+ width: ${e=>`${Me.containerWidth.value(e.windowSize)}%`};
58
+ ${e=>e.windowSize!=="small"?"overflow: auto;":""}
59
+ box-shadow: ${e=>`0px 2px ${d.sp1} ${e.theme.colors.dropShadowNormal}`};
60
+ padding-top: ${e=>e.windowSize!=="small"?d.sp2:"0px"};
61
+ `,Ke=m.div`
62
+ display: flex;
63
+ flex-direction: column;
64
+ align-items: center;
65
+ justify-content: center;
66
+ padding: ${e=>e.windowSize==="small"?d.sp3:`62px ${d.sp6} ${d.sp9} ${d.sp8}`};
67
+ height: ${e=>e.windowSize==="small"?"490px":"auto"};
68
+ overflow: ${e=>e.windowSize==="small"?"unset":"hidden"};
69
+ width: ${e=>e.windowSize=="small"?"auto":"42%"};
70
+ background-color: ${e=>e.windowSize==="small"?e.theme.colors.grey4:e.theme.colors.background};
71
+ margin-top: ${e=>e.windowSize==="small"?e.isAddressPage?"0px":"186px":"unset"};
72
+ `,We=x(function(e,a){return{file:a.file,type:a.type}})(ve);function h({appContent:e}){const a=ee(),n=S(),{tenantEmailDomain:o,vendorId:s,billId:l}=y(),[i]=te(),r=i.get("token"),_=n.pathname.includes("address"),w=g(),H=ge(),D=fe(),b=we(),K=()=>{H.toggle()},W=E(u=>k(u)),U=E(u=>v(u)),{authParams:J,fetchState:c,billAttachment:q,billFetchState:P,companyName:O,currencySymbol:Q,amount:R}=W,{tenantId:z,userId:N,sessionId:L}=J,{fetchState:X,internationalBankAccountCreateStatus:Y}=U;return $.useEffect(()=>{j()},[]),$.useEffect(()=>{b&&c==="Not-Started"&&s!=null&&o!=null&&r!=null&&a(le(s,o,r))},[b,c,s,o,r,a]),$.useEffect(()=>{b&&c==="Completed"&&(j(N,L,z),l!=null&&a(de(l)))},[c,b,N,L,z,l,a]),c==="Error"?t.jsx(f,{}):X==="Completed"||Y.fetchState==="Completed"?(j(),t.jsx(ae,{to:"../../../../../../../bank/account/save/success",replace:!0,relative:"path"})):c==="In-Progress"?t.jsx(be,{fetchState:c,style:{height:"100vh",backgroundColor:D.colors.grey5,boxShadow:`0px 2px ${d.sp1} ${D.colors.dropShadowNormal}`}}):t.jsxs(t.Fragment,{children:[c==="Completed"&&P==="Completed"&&t.jsx(ye,{analytics:I,onLoad:u=>(Z=>Z.trackBillPayMagicLinkPageLoad(o??"",s??"",O,l??"",Ue(n.pathname),Q,R))(u)}),t.jsxs(_e,{windowSize:w,children:[w!=="small"?t.jsx(Ve,{onClick:K}):null,t.jsx(Ke,{windowSize:w,isAddressPage:_,children:P==="In-Progress"?t.jsx(Se,{size:"ExtraLarge",start:!0}):t.jsx(We,{file:q,type:"bill"})}),t.jsx(He,{windowSize:w,children:e})]})]})}const Ue=e=>`${e.split("/").at(-2)}_${e.split("/").at(-1)}`;function Je(){return t.jsx(je,{})}function rt(){return t.jsxs(ne,{children:[t.jsx(p,{path:"bank/account/save/success",element:t.jsx(Je,{})}),t.jsx(p,{path:":tenantEmailDomain/vendor/:vendorId/bill/:billId/ach/standard",element:t.jsx(h,{appContent:t.jsx(F,{})})}),t.jsx(p,{path:":tenantEmailDomain/vendor/:vendorId/bill/:billId/ach/same-day",element:t.jsx(h,{appContent:t.jsx(F,{})})}),t.jsx(p,{path:":tenantEmailDomain/vendor/:vendorId/bill/:billId/wire/address",element:t.jsx(h,{appContent:t.jsx(De,{isSubPage:!0})})}),t.jsx(p,{path:":tenantEmailDomain/vendor/:vendorId/bill/:billId/wire/us-domestic",element:t.jsx(h,{appContent:t.jsx(Ee,{})})}),t.jsx(p,{path:":tenantEmailDomain/vendor/:vendorId/bill/:billId/wire/international",element:t.jsx(h,{appContent:t.jsx(Ge,{})})}),t.jsx(p,{path:"*",element:t.jsx(f,{})})]})}export{rt as default};
@@ -0,0 +1,12 @@
1
+ import{j as u}from"./liveblocks-BeS4QmMp.js";import{a as f}from"./sentry-BlmJH5WH.js";import{h as O,u as _,j as w,q as M,g as l,N as T}from"./core-DcM32IW_.js";import{z as r,h as P,D as V,e as A,d as N,f as q,m as G,T as R,i as W}from"./index-BZDuIo7x.js";import{eN as $,Ii as B,Is as H,Ij as J,eO as K,fh as Q,Io as X,fG as Y,cS as Z,It as ee,Iu as te}from"./zeni-epic-state-ChnjRetZ.js";import{n as ne}from"./mui--qrGbwFJ.js";import{u as se}from"./useDeviceId-DaD3aMiS.js";import{f as ae}from"./analyticsHelper-xeJXIGDO.js";import{t as ie}from"./getLocaleForTenant-Fu8c_Haa.js";import"./recharts-DoWl4vaN.js";import"./analytics-ByrfXPqG.js";import"./plaid-BZ0BFqP0.js";import"./dnd-36WXho_9.js";import"./stripe-DMRn4zHo.js";import"./lottie-Bdncx-qB.js";import"./lexical-CYAYrhLa.js";import"./pdf-6nmWWkz8.js";import"./utils-RmRP6xA4.js";(function(){try{var t=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},a=new t.Error().stack;a&&(t._sentryDebugIds=t._sentryDebugIds||{},t._sentryDebugIds[a]="c42ae15e-19c1-4e00-bcee-c5dfcaf588a9",t._sentryDebugIdIdentifier="sentry-dbid-c42ae15e-19c1-4e00-bcee-c5dfcaf588a9")}catch{}})();const C=(t,a)=>t!=null&&t.length>0&&a==="magic_links";function Ce(){const t=O(),a=_(),m=w(),[y]=M(),n=y.get("token"),p=y.get("stytch_token_type"),g=r.getMagicLinkCodeVerifier(),i=se(),{otpChallenge:c,twoFAPhoneNumber:D,magicLinkEmail:d,verifyDeviceFetchState:x,resendVerifyDeviceOTPFetchState:z}=l(e=>e.tenantState),I=l(e=>e.tenantState.fetchState),b=l(e=>e.tenantState.activeTenantFetchState.fetchState),S=l(e=>e.tenantState.signInState),h=l(e=>e.tenantState.magicLinkSignInFetchState.fetchState),s=l(e=>e.tenantState.loggedInUser),o=l(e=>$(e)),k=l(e=>B(e)),E=r.getSignedInUser(),v=P().mode;f.useEffect(()=>{s?.zeniSessionId==null&&n!=null&&C(n,p)&&i!=null&&g!=null&&(r.saveMagicLinkTriggered(n),t(H(n,i,g)))},[n,p,t,i,g,s?.zeniSessionId]),f.useEffect(()=>{S!=="In-Progress"||I!=="Completed"&&b!=="Completed"||s?.zeniSessionId==null||o==null||(n!=null&&r.saveLastUsedMagicLinkToken(n),r.saveSignedInUserWithSession(s,s.zeniSessionId),r.saveSignedInUserTenants(J(k.tenantsInOrder),s.zeniSessionId),K(s.userId,s.zeniSessionId,o.tenantId),t(Q(o.tenantId)),r.saveActiveTenantDomainForUser(o.tenantEmailDomain),t(X("Completed")),V.updateAppLocaleID(ie(o)),ae(s,o,v,void 0,k.tenantsInOrder),Y().then(()=>{const e=W();e!=null&&A(e)}),setTimeout(()=>{N.trackLogin(q.Event.loginSuccess,"email",Z(o.productSettings))},2e3))},[S,I,b,s,o,k,v,a.state,t]);const j=f.useCallback(()=>{m("/signin/auth")},[m]),U=f.useCallback(()=>{i!=null&&c!=null&&d!=null&&t(ee(i,d,c))},[i,c,t,d]),F=f.useCallback(e=>{i!=null&&n!=null&&d!=null&&c!=null&&t(te(e,i,d,c))},[i,n,t,d,c]);if(h==="Completed"&&c!=null)return u.jsx(G,{phoneNumber:D,verifyOtpFetchState:x.fetchState,resendVerifyDeviceOTPFetchState:z,onResendOtp:U,onVerifyOtp:F,onCancelVerifyDevice:j});if(S==="In-Progress"&&I==="Completed"&&s?.zeniSessionId!=null&&o!=null||E!=null){const e=a.state?.origin??"/";return u.jsx(T,{to:e,state:{...a.state,origin:""}})}if(!C(n,p)||g==null||h==="Error"){const e=a.state?.origin??"/",L=n!=null&&r.getLastUsedMagicLinkToken()===n;return u.jsx(T,{to:e,state:{...a.state,origin:"",magicLinkAlreadyUsed:L,magicLinkExpired:!L&&(r.isMagicLinkTriggered(n??"")||h==="Error"&&s?.zeniSessionId==null)}})}return u.jsx(oe,{"data-testid":"smooth-loader",children:u.jsx(R,{size:"ExtraLarge",start:!0})})}const oe=ne.div`
2
+ position: fixed;
3
+ top: 0;
4
+ left: 0;
5
+ right: 0;
6
+ bottom: 0;
7
+ display: flex;
8
+ align-items: center;
9
+ justify-content: center;
10
+ z-index: 9999;
11
+ background-color: ${t=>t.theme.colors.background};
12
+ `;export{Ce as default};
@@ -0,0 +1 @@
1
+ import{j as U}from"./liveblocks-BeS4QmMp.js";import{a as c}from"./sentry-BlmJH5WH.js";import{h as be,g as s,l as Je,u as Ke,j as Qe,i as R}from"./core-DcM32IW_.js";import{eN as he,eU as ea,eV as Se,eP as aa,bn as ta,f2 as na,eW as sa,eX as oa,eZ as ia,f0 as ra,fa as da,f1 as g,f4 as la,f5 as ue,f8 as ca,f6 as ua,f7 as fa,f9 as ma,cH as pa,fc as ba,cN as ha,bv as Sa,eM as ga,fh as Ea,fi as ka,fg as Ca}from"./zeni-epic-state-ChnjRetZ.js";import{a2 as ya,a3 as Ia,y as Ta,a as wa,z as k,a4 as _a,M as Aa,A as Fa,u as Da,p as r,a5 as va,a6 as $a,k as Ba,c as Ma,a7 as Pa,Y as Ra,a8 as xa,a9 as Na,aa as fe,ab as me,L as Ua,ac as Va,ad as pe,d as x,v as _,ae as N,af as Ga}from"./index-BZDuIo7x.js";import{D as Oa}from"./mui--qrGbwFJ.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]="42f92540-67dd-4d51-89f8-f2a766649604",f._sentryDebugIdIdentifier="sentry-dbid-42f92540-67dd-4d51-89f8-f2a766649604")}catch{}})();const La=ya(({isAppContentDrawerOpen:f,handleDrawerToggle:d})=>{const{tenantEmailDomain:a}=Je(),t=Ke(),C=Ta(),o=Qe(),V=aa(),m=be(),{useFeatureGate:i}=wa(),G=k.getSignedInUser(),A=ta(G),n=s(e=>he(e)),ge=_a(),Ee=n.masterTOSInfo?.isMasterTOSAccepted??!1,{setIsAiCfoOpen:ke}=Aa(),O=s(e=>na(e)),L=O.uiState.currentChatSessionId,y=Fa(),{setLoading:Ce}=Da(),[F,j]=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:ye}=i(r.isChargeCardFeatureEnabled),{isFeatureEnabled:H}=i(r.isDebitCardFeatureEnabled),Ie=va(n,ye,H),{isFeatureEnabled:Te}=i(r.isSettingsFeatureEnabled),Z=s(e=>sa(e)),{isFeatureEnabled:T}=i(r.isReferralFeatureEnabled),v=s(e=>oa(e));c.useEffect(()=>{y&&T&&!I&&v.fetchState==="Not-Started"&&m(ia(!0))},[y,T,v.fetchState,I]);const h=k.getSignedInUser(),$=s(e=>e.tenantState),we=s(e=>$.fetchState==="Completed"?ra(e):[]),E=s(e=>e.expenseAutomationViewState.selectedPeriodByTenantId),{isFeatureEnabled:_e}=i(r.isApAgingFeatureEnabled),{isFeatureEnabled:Ae}=i(r.isArAgingFeatureEnabled),{isFeatureEnabled:W}=i(r.isExpenseAutomationEnabled),{isFeatureEnabled:X}=i(r.isExpenseAutomationEnabledV2),q=X||W&&A,{isFeatureEnabled:Fe}=i(r.isDashboardSidebarHalloweenAnimationEnabled),{isFeatureEnabled:De}=i(r.isDashboardSidebarThanksGivingAnimationEnabled),{isFeatureEnabled:ve}=i(r.isDashboardSidebarChristmasAnimationEnabled),{isFeatureEnabled:$e}=i(r.isDashboardSidebarNewYearAnimationEnabled),{isFeatureEnabled:Be}=i(r.isTreasuryEnabled),{isFeatureEnabled:Me}=i(r.isTaskManagerCustomerUserAccessEnabled),Pe=A||!A&&Me,Re=n.company!=null&&da(n.company),w=Be&&Re,xe=s(e=>g(e).totalUnreadCount),Ne=s(e=>g(e).reducedFetchCountState),J=s(e=>g(e).notificationDetailsByTab.tasks.uiState.unreadCount),K=s(e=>g(e).notificationDetailsByTab.comments.uiState.unreadCount),Ue=s(e=>g(e).notificationDetailsByTab.tasks.fetchCountState),B=s(e=>g(e).notificationDetailsByTab.comments.fetchCountState),{inboxNotifications:Q,isLoading:ee,isFetchingMore:ae,hasFetchedAll:te,fetchMore:Ve}=$a();c.useEffect(()=>{const e=setTimeout(()=>Ve?.(),0);return()=>clearTimeout(e)}),c.useEffect(()=>{if(ee===!1&&ae===!1&&te===!0)if(n?.companyId!=null&&Q!=null){const e=`dashboard_${n.companyId}`;j(Q.filter(u=>u.roomId===e&&u.readAt==null).length)}else j(0)},[ee,ae,te]),c.useEffect(()=>{y&&!I&&Ue.fetchState==="Not-Started"&&V.tenantId!=null&&m(la("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 Ge={fetchStatus:Ne,count:xe},ne=a!=null?k.getSignedInUserTenant(a):null,se=s(e=>ne?.tenantId!=null?ca(e,ne.tenantId):void 0),S=[];_e===!1&&S.push("accounts_payable_aging"),Ae===!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 Oe=Ba(),oe=s(e=>ua(e,S,h,X,W,w).fetchState),ie=s(e=>fa(e).fetchState),Le=D&&(oe==="Completed"||oe==="Error")||z&&(ie==="Completed"||ie==="Error")||!D&&!z?void 0:"disabled",je=c.useMemo(()=>ma(n.userRole),[n.userRole]),ze=pa(je),Ye=n?.rewardsLastViewedTime==null,He=h?.userEmail!=null&&Z.fetchState==="Completed"&&ba(Z.notificationSettings,h.userEmail,H,n),re=Ma(),Ze=re&&Pa(t),de=ha(Oe?.loggedInUserRoleMap),le=n.companyTreasuryInfo?.info?.isTreasuryTOSAccepted,M=c.useCallback(()=>w&&de&&!k.getTreasuryPopupSeen(a??"")&&le===!1&&Ra(t.pathname)!=="treasury",[w,de,le,t.pathname,a]),[We,ce]=c.useState(M);c.useEffect(()=>{ce(M())},[M]);const Xe=s(e=>e.treasurySetupViewState.treasuryFundsDetails).fundsDetails,qe=xa(Xe);return U.jsx(Oa,{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(Na,{signedInUser:G,currentTenantId:$.currentTenantId??"",tenants:$.fetchState==="Completed"?we:se!=null?[se]:[],currentTenant:n,isTenantDropdownDisabled:Le,isSettings:me(t),isSettingsFeatureEnabled:Te,isVendorsTabVisible:ze,isZeniAccountEnabled:Y,isChargeCardEnabled:Ie,isTreasuryEnabled:w,treasuryYieldPercentage:qe,isTreasuryPopupVisible:We,isNotificationsTabVisible:He,notificationCountDetails:Ge,isExpenseAutomationEnabledForUser:q&&Sa(n.userRole)===!1,selectedMenu:fe(t),rewardsConfiguration:{isRewardsTabVisible:T,isRewardsAnimated:Ye,rewardsPlan:v.rewardsPlan},isAiCfoAccessEnabled:re,onNotificationIconClick:()=>{d(!1);let e=J===0&&K>0?"notifications/comments":"notifications/tasks";me(t)&&(e=J===0&&K>0?"../../notifications/comments":"../../notifications/tasks");const u=_(t.state?.pathnameStackToGoBack,t.pathname);o(e,{state:{pathnameStackToGoBack:u}})},handleCockpitClick:()=>{window.open("/cockpit")},handleLogOutClick:()=>{d(!1);const e=_(t.state?.pathnameStackToGoBack,t.pathname);o("/signout",{replace:!0,state:{pathnameStackToGoBack:e,message:"logout"}})},handleMenuChange:e=>{if(d(!1),a==null)return;if(e.type==="ai_cfo"){const p=_(t.state?.pathnameStackToGoBack,t.pathname);return x.trackAICFOChatScreenStateChanged("viewed","left_menu",L??null,null),Ee?void o(`/${a}/ai-cfo/explore`,{state:{pathnameStackToGoBack:p,referrer:"Sidebar"}}):void(ge?ke(!0):o(`/${a}/dashboard`,{state:{pathnameStackToGoBack:p,referrer:"Sidebar",message:"open_ai_cfo_drawer"}}))}const u=_(t.state?.pathnameStackToGoBack,t.pathname),l=e.type,b=N(l)&&l!=="command_center";if(N(e.type)&&E[n.tenantId]!=null&&x.trackMonthEndCloseClicked(E[n.tenantId].month,E[n.tenantId].year,"Sidebar"),b&&E[n.tenantId]!=null){const p=E[n.tenantId];return void o(`/${a}/month_end_close_checks/review/${e.type}/${p.month}-${p.year}`,{state:{pathnameStackToGoBack:u,referrer:"Sidebar"}})}const P=Ga(e.type);pe(e.type)?(L!=null&&m(Ca()),o(`/${a}/ai-cfo/${e.type}`,{state:{pathnameStackToGoBack:u.slice(0,-1),referrer:"Sidebar"}})):o(`/${a}/${P}`,{state:{pathnameStackToGoBack:u,referrer:"Sidebar"}})},handleMyProfileClick:()=>{d(!1),o(`/${a}/settings/my_profile`)},handleReferralsClick:()=>{d(!1),o(`/${a}/rewards`)},handleBackClick:()=>{o(`/${a}/dashboard`)},handleTenantSelect:e=>{Ce(Ua.TENANT_SWITCHING),d(!1);const u=e.tenantEmailDomain,l=fe(t);let b=`/${encodeURIComponent(u)}/`;const P=N(l);l==="home"?b+="dashboard":l==="users_and_roles"?b+="people":Va(l)?b+="settings/my_profile":pe(l)?b+=`ai-cfo/${l}`:b+=l==="task_checklist"?"tasks":P?"month_end_close_checks/review":encodeURIComponent(l),o(b,{replace:!0}),h!=null&&(m(Ea(e.tenantId)),m(ka(h.userId,e.tenantId,h.zeniSessionId)));const p=e;x.trackCompanySwitch(p.companyId,p.companyName,p.userRole)},handlePopupClose:()=>{k.saveTreasuryPopupSeen(a??"",!0),ce(!1)},onZeniLogoClick:()=>{C.toggle()},isAiCfo:Ze,aiCfoView:O,isOnDashboard:D,updateCurrentChatSessionId:e=>{m(ga({sessionId:e,agentId:"controller"})),o(`/${a}/ai-cfo/${e}`,{state:{...t.state}})},halloweenAnimationEnabled:Fe,isTaskManagerAccessEnabled:Pe,thanksGivingAnimationEnabled:De,christmasAnimationEnabled:ve,newYearAnimationEnabled:$e})})}),Xa=f=>{const d=be(),a=s(C=>he(C)),t={events:a.userRoleId!=null?[`private-${a.userRoleId}.dashboard-user-notification`]:[],eventCallback:(C,o)=>{Ia(o)&&ea(o.mode)==="dashboard"&&d(Se({unreadCount:o.data.unread},"tasks"))}};return U.jsx(La,{...f,...t})};export{Xa as M};
@@ -0,0 +1 @@
1
+ import{j as e}from"./liveblocks-BeS4QmMp.js";import{j as r,k as i}from"./core-DcM32IW_.js";import{X as n}from"./index-BZDuIo7x.js";import"./mui--qrGbwFJ.js";import"./sentry-BlmJH5WH.js";import"./zeni-epic-state-ChnjRetZ.js";import"./recharts-DoWl4vaN.js";import"./analytics-ByrfXPqG.js";import"./plaid-BZ0BFqP0.js";import"./dnd-36WXho_9.js";import"./stripe-DMRn4zHo.js";import"./lottie-Bdncx-qB.js";import"./lexical-CYAYrhLa.js";import"./pdf-6nmWWkz8.js";import"./utils-RmRP6xA4.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]="08a1fb90-c2ee-45d3-8148-a56dffb2c13c",o._sentryDebugIdIdentifier="sentry-dbid-08a1fb90-c2ee-45d3-8148-a56dffb2c13c")}catch{}})();const a=i(null,function(o,t){return{onGoBack:()=>{t.navigate(-1)},onGoHome:()=>{t.navigate("/")}}})(n);function h(){const o=r();return e.jsx(a,{navigate:o})}export{h as default};
@@ -1 +1 @@
1
- import{l as dt,a as lt,m as ft,j as _}from"./liveblocks-XXI3_E1y.js";import ut from"./NotFoundScreen-C3kD1egL.js";import{a as k}from"./sentry-DrlL61Aq.js";import{j as ht,u as pt,l as kt,h as gt,g as S,k as St,n as bt,o as L}from"./core-sRr8O2Ja.js";import{cp as It,eW as K,eN as Q,f9 as Ct,f1 as b,OG as X,f5 as d,eV as A,qr as $,vF as Tt,OH as At,eU as yt,fc as Et,qw as _t,OI as F,bq as M,gC as x,qA as H,OJ as Nt,cA as Bt,cu as wt}from"./zeni-epic-state-BlOBva0w.js";import{M as xt,z as Rt,a as Ut,p as vt,K as Dt,cq as Gt,s as N,a1 as Pt,cr as Ft,a2 as Mt,r as $t}from"./index-B8scoeQA.js";import"./mui-CL-iXERd.js";import{u as jt}from"./useAskAiCfoHostNavButtonProps-Bt4hMVmk.js";import{c as Ot}from"./useFetchSuggestedQuestionsWhenReady-B6OFe2QI.js";import"./recharts-z_5Sq5F0.js";import"./analytics-zC4vJBLG.js";import"./plaid-BUQgPXGQ.js";import"./dnd-CZEKCPsp.js";import"./stripe-DMRn4zHo.js";import"./lottie-CbW-xVFB.js";import"./lexical-CtDGfH8b.js";import"./pdf-BVi8zWaH.js";import"./utils-DCRx3jP7.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]="04897a73-d274-4dac-8726-9b4c6e1be9fb",t._sentryDebugIdIdentifier="sentry-dbid-04897a73-d274-4dac-8726-9b4c6e1be9fb")}catch{}})();const qt=(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)})}),Vt=St(function(t,l){const n=K(t),{signedInUser:u,isDebitCardFeatureEnabled:g}=l,i=b(t),s=Q(t),{currentTab:h}=i;return{notificationView:i,isNotificationSettingsVisible:u.userEmail!=null&&Et(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(H("task_manager","read",[a],!1))},onCommentNotificationClick:(a,o,m)=>{const c=o.toString().split(`/${u}/`);if(c[1]!=null){m==="unread"&&(B(a),t(F([a],M())));let r=`/${u}/${c[1]}`;const I=N(n.state?.pathnameStackToGoBack,n.pathname);c[1].startsWith("reimbursement")&&!Bt(g)&&(r="not-found"),c[1].startsWith("bill")&&!wt(g)&&(r="not-found"),h(r,{state:{pathnameStackToGoBack:I,message:"triggerBackClick"}})}},onUpdateNotificationViewUIState:(a,o)=>{t(A(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(Nt(a))},onFetchMoreNotifications:(a,o)=>{if(a==="tasks"){const m=[];o==="all"?m.push("read","unread"):o!=="mentions"&&m.push(o),t($("task_manager","dashboard",m))}else R?.()},onUpdateNotificationStatus:(a,o,m,c)=>{a==="tasks"?t(H("task_manager",m,c)):(t(d({markAsReadState:{fetchState:"In-Progress",error:void 0}},"comments")),Promise.all(c.map(r=>{m==="read"&&(B(r),t(F([r],M())))})).then(()=>{t(d({markAsReadState:{fetchState:"Completed",error:void 0},selectedNotificationIds:[]},"comments")),t(A({unreadCount:i-c.length>0?i-c.length:0},"comments")),t(x({messageSection:"notification_mark_as_read",messageText:"success",type:"success",showStatusIcon:!0}))},r=>{t(d({markAsReadState:{fetchState:"Error",error:r}},"comments")),t(x({messageSection:"notification_mark_as_read",messageText:"failed",type:"error",showStatusIcon:!0}))}).catch(r=>{t(d({markAsReadState:{fetchState:"Error",error:r}},"comments")),t(x({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")),qt(s,B).then(()=>{t(F(s,M())),t(d({markAsAllReadState:{fetchState:"Completed",error:void 0}},"comments")),t(A({unreadCount:0},"comments")),t(x({messageSection:"notification_mark_as_read",messageText:"success",type:"success",showStatusIcon:!0}))}).catch(o=>{t(d({markAsAllReadState:{fetchState:"Error",error:o}},"comments")),t(x({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}})}}})(Pt(Ft)),Wt=()=>{const t=ht(),l=pt(),{tenantEmailDomain:n,selectedTab:u}=kt(),{areTenantIdsInSync:g}=xt(),i=It(u??""),s=gt(),h=Rt.getSignedInUser(),[B,R]=k.useState(!1),a=S(e=>K(e)),o=S(e=>Q(e)),{useFeatureGate:m}=Ut(),{isFeatureEnabled:c}=m(vt.isDebitCardFeatureEnabled),{isAiCfoOpen:r,setIsAiCfoOpen:I}=Dt(),{isAiCfoAccessEnabled:Y,onAskAiCfoClick:Z}=jt({isAiCfoOpen:r,setIsAiCfoOpen:I,mobileExploreReferrer:"Notifications"});Ot({isDataReady:!0});const tt=Ct(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),O=S(e=>b(e).currentTab),U=S(e=>b(e).currentSubTab),et=S(e=>b(e).notificationDetailsByTab.comments.fetchCountState),v=S(e=>b(e).notificationDetailsByTab.comments.fetchState),at=S(e=>b(e).notificationDetailsByTab.comments.uiState.unreadCount),ot=S(e=>b(e).allExternalNotifications).filter(e=>e.inboxNotification.readAt==null).map(e=>e.inboxNotification.id),st=Gt().allUsers,{inboxNotifications:w,isLoading:y,hasFetchedAll:C,isFetchingMore:D,fetchMore:nt}=dt(),{threads:q,isLoading:V,fetchMore:W,isFetchingMore:z,hasFetchedAll:J}=lt({query:{metadata:{companyId:o.companyId,application:"dashboard"}}});k.useEffect(()=>{if(O!==i&&i!=null&&s(X(i)),i==null){const e=`../${O}`,p=N(l.state?.pathnameStackToGoBack,l.pathname);t(e,{state:{pathnameStackToGoBack:p}})}},[i]),k.useEffect(()=>{et.fetchState==="Not-Started"&&s(d({fetchCountState:{fetchState:"In-Progress",error:void 0}},"comments"))},[]),k.useEffect(()=>{if(y===!1&&C===!0&&o?.companyId!=null&&w!=null){const e=`dashboard_${o.companyId}`,p=w.filter(T=>T.roomId===e&&T.readAt==null).length;s(d({fetchCountState:{fetchState:"Completed",error:void 0}},"comments")),s(A({unreadCount:p},"comments"))}},[y,C]),k.useEffect(()=>{j!=="In-Progress"&&g&&s($("task_manager","dashboard",["read","unread"]))},[g]),k.useEffect(()=>{const e=setTimeout(()=>nt?.(),0);return()=>clearTimeout(e)});const G=y||D===!0||C!==!0||y||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(A({hasMore:C!==!0},"comments"))},[C]),k.useEffect(()=>{a.fetchState!=="In-Progress"&&a.fetchState!=="Completed"&&B===!1&&(R(!0),s(Tt()))},[a.fetchState]),k.useEffect(()=>{if(y===!1&&V===!1&&w!=null&&q!=null){const e=`dashboard_${o.companyId}`,p=w.filter(f=>f.roomId===e).filter(f=>f.kind==="thread"),T=p.filter(f=>f.readAt==null),E=p.map(f=>f.id),ct=p.map(f=>{const P=q.find(mt=>mt.id===f.threadId);return P!=null?{inboxNotification:{...f,threadId:P.id},thread:P}:(z||J===!0||W==null||W(),null)}).filter(f=>f!=null);s(d({allNotificationsIds:E},"comments")),s(A({totalCount:E.length,unreadCount:T.length},"comments")),s(At(ct))}},[y,D,z,C,J,V,w?.length]);const it={events:o.userRoleId!=null?[`private-${o.userRoleId}.dashboard-user-notification`]:[],eventCallback:(e,p)=>{if(Mt(p)){const T=yt(p.mode);if(T==="dashboard"&&s(A({unreadCount:p.data.unread},"tasks")),j!=="In-Progress"){const E=[];U==="all"?E.push("read","unread"):U!=="mentions"&&E.push(U),s($("task_manager",T,E,!0))}}}},rt=ft();return _.jsx(Vt,{tenantEmailDomain:n,loggedInUserRoleMap:tt,signedInUser:h,externalNotificationsUnreadCount:at,location:l,navigate:t,isDebitCardFeatureEnabled:c,users:st,markInboxNotificationAsRead:rt,allUnreadCommentsNotificationIds:ot,isAiCfoAccessEnabled:Y,onAskAiCfoClick:Z,...it})};function me(){return _.jsxs(bt,{children:[_.jsx(L,{path:"/:selectedTab",element:_.jsx(Wt,{})}),_.jsx(L,{path:"*",element:_.jsx(ut,{})})]})}export{me as default};
1
+ import{l as dt,a as lt,m as ft,j as _}from"./liveblocks-BeS4QmMp.js";import ut from"./NotFoundScreen-B8ppov_c.js";import{a as k}from"./sentry-BlmJH5WH.js";import{j as ht,u as pt,l as kt,h as gt,g as S,k as St,n as bt,o as H}from"./core-DcM32IW_.js";import{cp as It,eW as Q,eN as X,f9 as Ct,f1 as b,OF as J,f5 as d,eV as A,qq as M,vE as Tt,OG as At,eU as yt,fc as Et,qv as _t,OH as F,bq as $,gC as w,qz as K,OI as Nt,cA as Bt,cu as xt}from"./zeni-epic-state-ChnjRetZ.js";import{N as wt,z as vt,a as Rt,p as Ut,M as Dt,cr as Gt,v as N,a2 as Pt,cs as Ft,a3 as $t,r as Mt}from"./index-BZDuIo7x.js";import"./mui--qrGbwFJ.js";import{u as jt}from"./useAskAiCfoHostNavButtonProps-CHoGbMpp.js";import{c as Ot}from"./useFetchSuggestedQuestionsWhenReady-DVUj1bst.js";import"./recharts-DoWl4vaN.js";import"./analytics-ByrfXPqG.js";import"./plaid-BZ0BFqP0.js";import"./dnd-36WXho_9.js";import"./stripe-DMRn4zHo.js";import"./lottie-Bdncx-qB.js";import"./lexical-CYAYrhLa.js";import"./pdf-6nmWWkz8.js";import"./utils-RmRP6xA4.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]="2184fe51-d661-43f9-b691-d89184993e36",t._sentryDebugIdIdentifier="sentry-dbid-2184fe51-d661-43f9-b691-d89184993e36")}catch{}})();const qt=(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)})}),Vt=St(function(t,l){const n=Q(t),{signedInUser:u,isDebitCardFeatureEnabled:g}=l,i=b(t),s=X(t),{currentTab:h}=i;return{notificationView:i,isNotificationSettingsVisible:u.userEmail!=null&&Et(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:v}=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(K("task_manager","read",[a],!1))},onCommentNotificationClick:(a,o,m)=>{const c=o.toString().split(`/${u}/`);if(c[1]!=null){m==="unread"&&(B(a),t(F([a],$())));let r=`/${u}/${c[1]}`;const I=N(n.state?.pathnameStackToGoBack,n.pathname);c[1].startsWith("reimbursement")&&!Bt(g)&&(r="not-found"),c[1].startsWith("bill")&&!xt(g)&&(r="not-found"),h(r,{state:{pathnameStackToGoBack:I,message:"triggerBackClick"}})}},onUpdateNotificationViewUIState:(a,o)=>{t(A(a,o))},onUpdateNotificationTabState:(a,o)=>{t(d(a,o))},onUpdateNotificationViewCurrentTabAndSubTab:(a,o)=>{t(J(a,o));const m=`../${a}`,c=N(n.state?.pathnameStackToGoBack,n.pathname);h(m,{state:{pathnameStackToGoBack:c}})},onUpdateNotificationViewSubTab:a=>{t(Nt(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 v?.()},onUpdateNotificationStatus:(a,o,m,c)=>{a==="tasks"?t(K("task_manager",m,c)):(t(d({markAsReadState:{fetchState:"In-Progress",error:void 0}},"comments")),Promise.all(c.map(r=>{m==="read"&&(B(r),t(F([r],$())))})).then(()=>{t(d({markAsReadState:{fetchState:"Completed",error:void 0},selectedNotificationIds:[]},"comments")),t(A({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")),qt(s,B).then(()=>{t(F(s,$())),t(d({markAsAllReadState:{fetchState:"Completed",error:void 0}},"comments")),t(A({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=Mt(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}})}}})(Pt(Ft)),zt=()=>{const t=ht(),l=pt(),{tenantEmailDomain:n,selectedTab:u}=kt(),{areTenantIdsInSync:g}=wt(),i=It(u??""),s=gt(),h=vt.getSignedInUser(),[B,v]=k.useState(!1),a=S(e=>Q(e)),o=S(e=>X(e)),{useFeatureGate:m}=Rt(),{isFeatureEnabled:c}=m(Ut.isDebitCardFeatureEnabled),{isAiCfoOpen:r,setIsAiCfoOpen:I}=Dt(),{isAiCfoAccessEnabled:Y,onAskAiCfoClick:Z}=jt({isAiCfoOpen:r,setIsAiCfoOpen:I,mobileExploreReferrer:"Notifications"});Ot({isDataReady:!0});const tt=Ct(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),O=S(e=>b(e).currentTab),R=S(e=>b(e).currentSubTab),et=S(e=>b(e).notificationDetailsByTab.comments.fetchCountState),U=S(e=>b(e).notificationDetailsByTab.comments.fetchState),at=S(e=>b(e).notificationDetailsByTab.comments.uiState.unreadCount),ot=S(e=>b(e).allExternalNotifications).filter(e=>e.inboxNotification.readAt==null).map(e=>e.inboxNotification.id),st=Gt().allUsers,{inboxNotifications:x,isLoading:y,hasFetchedAll:C,isFetchingMore:D,fetchMore:nt}=dt(),{threads:q,isLoading:V,fetchMore:z,isFetchingMore:W,hasFetchedAll:L}=lt({query:{metadata:{companyId:o.companyId,application:"dashboard"}}});k.useEffect(()=>{if(O!==i&&i!=null&&s(J(i)),i==null){const e=`../${O}`,p=N(l.state?.pathnameStackToGoBack,l.pathname);t(e,{state:{pathnameStackToGoBack:p}})}},[i]),k.useEffect(()=>{et.fetchState==="Not-Started"&&s(d({fetchCountState:{fetchState:"In-Progress",error:void 0}},"comments"))},[]),k.useEffect(()=>{if(y===!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(A({unreadCount:p},"comments"))}},[y,C]),k.useEffect(()=>{j!=="In-Progress"&&g&&s(M("task_manager","dashboard",["read","unread"]))},[g]),k.useEffect(()=>{const e=setTimeout(()=>nt?.(),0);return()=>clearTimeout(e)});const G=y||D===!0||C!==!0||y||D===!0||C!==!0;k.useEffect(()=>{G&&U!=="In-Progress"?s(d({fetchState:"In-Progress",error:void 0},"comments")):G||U!=="In-Progress"||s(d({fetchState:"Completed",error:void 0},"comments"))},[G,U]),k.useEffect(()=>{s(A({hasMore:C!==!0},"comments"))},[C]),k.useEffect(()=>{a.fetchState!=="In-Progress"&&a.fetchState!=="Completed"&&B===!1&&(v(!0),s(Tt()))},[a.fetchState]),k.useEffect(()=>{if(y===!1&&V===!1&&x!=null&&q!=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),ct=p.map(f=>{const P=q.find(mt=>mt.id===f.threadId);return P!=null?{inboxNotification:{...f,threadId:P.id},thread:P}:(W||L===!0||z==null||z(),null)}).filter(f=>f!=null);s(d({allNotificationsIds:E},"comments")),s(A({totalCount:E.length,unreadCount:T.length},"comments")),s(At(ct))}},[y,D,W,C,L,V,x?.length]);const it={events:o.userRoleId!=null?[`private-${o.userRoleId}.dashboard-user-notification`]:[],eventCallback:(e,p)=>{if($t(p)){const T=yt(p.mode);if(T==="dashboard"&&s(A({unreadCount:p.data.unread},"tasks")),j!=="In-Progress"){const E=[];R==="all"?E.push("read","unread"):R!=="mentions"&&E.push(R),s(M("task_manager",T,E,!0))}}}},rt=ft();return _.jsx(Vt,{tenantEmailDomain:n,loggedInUserRoleMap:tt,signedInUser:h,externalNotificationsUnreadCount:at,location:l,navigate:t,isDebitCardFeatureEnabled:c,users:st,markInboxNotificationAsRead:rt,allUnreadCommentsNotificationIds:ot,isAiCfoAccessEnabled:Y,onAskAiCfoClick:Z,...it})};function me(){return _.jsxs(bt,{children:[_.jsx(H,{path:"/:selectedTab",element:_.jsx(zt,{})}),_.jsx(H,{path:"*",element:_.jsx(ut,{})})]})}export{me as default};
@@ -0,0 +1 @@
1
+ import{j as n}from"./liveblocks-BeS4QmMp.js";import{j as K,h as Z,u as H,l as Q,g as d,k as X,n as ee,o as C}from"./core-DcM32IW_.js";import{eN as M,qe as U,pO as ae,J7 as N,pJ as S,bv as te,bn as se,bR as oe,pK as re,J8 as ne,IU as T,dB as ie,tB as ce,J9 as le,tY as de,eT as me,eR as fe}from"./zeni-epic-state-ChnjRetZ.js";import{M as pe,z as ue,N as he,k as ge,a as $,p as w,C as Fe,d as B,ak as be,v as Ie}from"./index-BZDuIo7x.js";import"./mui--qrGbwFJ.js";import Ce from"./NotFoundScreen-B8ppov_c.js";import{F as Te}from"./FeaturePreviewScreen-Dvylx-Wk.js";import{a as h}from"./sentry-BlmJH5WH.js";import{u as Se}from"./useAskAiCfoHostNavButtonProps-CHoGbMpp.js";import{c as ye}from"./useFetchSuggestedQuestionsWhenReady-DVUj1bst.js";import{u as Ae}from"./useInitialThreadRequest-CV6--y9X.js";import{t as ke}from"./routePaths-DLti7tZb.js";import{M as xe}from"./MobileAppDrawer-BCaWgXZQ.js";import"./recharts-DoWl4vaN.js";import"./analytics-ByrfXPqG.js";import"./plaid-BZ0BFqP0.js";import"./dnd-36WXho_9.js";import"./stripe-DMRn4zHo.js";import"./lottie-Bdncx-qB.js";import"./lexical-CYAYrhLa.js";import"./pdf-6nmWWkz8.js";import"./utils-RmRP6xA4.js";(function(){try{var s=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},a=new s.Error().stack;a&&(s._sentryDebugIds=s._sentryDebugIds||{},s._sentryDebugIds[a]="053ce498-89b7-47f0-bf76-6543c050daac",s._sentryDebugIdIdentifier="sentry-dbid-053ce498-89b7-47f0-bf76-6543c050daac")}catch{}})();const y=(s,a,e,o)=>{if(s!=a){const r=o??"";s!=null&&s.length>0?e(`../${a}${r}`,{replace:!0}):e(`${a}${r}`,{replace:!0})}},De=X(function(s){const a=ne(s),e={},o=a.pandLReportWithForecast.uiState.nodeCollapseState;return Object.keys(o).forEach(r=>{e[r]=o[r]===!1}),{selectedTimeframe:a.selectedTimeframe,isForecastVsActualOn:a.isForecastVsActualOn,compareMode:a.compareMode,forecastList:a.forecastList,selectedForecast:a.selectedForecast,pandLreport:a.pandLReportWithForecast,scrollPosition:a.pandLReportWithForecast.uiState.scrollPosition,nodeOpenStatus:e,type:"name+balances_forecast",analytics:B}},function(s,a){return{onForecastSelectionChanged:(e,o)=>{s(N(e,o)),a.isPandLReportFetched(e)||s(S(e)),y(a.forecastIdFromUrlPath,e,a.navigate)},onTimeframeChanged:e=>{s(de(e))},onForecastVsActualsCompareToggle:e=>{s(le(e)),s(T({forecastId:a.forecastIdFromUrlPath,scrollPosition:{scrollLeft:0,scrollTop:0}}))},onCompareModeChanged:e=>{s(ce(a.firstMonthOfFY,e,0,[]))},onAccountBalanceClick:a.hasTransactionAccess!==!0?void 0:(e,o)=>{let r,i;const g=e.accountName===""?e.accountDescription:e.accountName;if(o.balanceTimeFrame==="month"||o.balanceTimeFrame==="quarter"?(r=o.balanceTimeFrame,i=ie(o)):o.balanceTimeFrame==="year"?(r="quarter",i={startDate:o.endDate.startOf("quarter"),endDate:o.endDate}):console.error(`timeframe ${o.balanceTimeFrame} is not supported`),i!=null&&r!=null){const f=ke(a.tenantEmailDomain,e.accountId,e.accountType,g,r,i),p=Ie(a.location.state?.pathnameStackToGoBack,a.location.pathname);a.navigate(f,{state:{pathnameStackToGoBack:p,referrer:"Forecast"}})}},onNodeCollapseToggled:(e,o)=>{s(T({forecastId:a.forecastIdFromUrlPath,nodeCollapseState:{nodeId:e,isCollapsed:o===!1}}))},onTableScroll:e=>{s(T({forecastId:a.forecastIdFromUrlPath,scrollPosition:e}))},onBackClick:()=>{a.navigate("../../")}}})(be);function v(){const{isAiCfoOpen:s,setIsAiCfoOpen:a}=pe(),e=K(),o=Z(),r=H(),{forecastId:i,tenantEmailDomain:g}=Q(),[f,p]=h.useState(!1),[F,A]=h.useState(!1),u=ue.getSignedInUser(),k=d(t=>M(t)),q=k.company?.companyInfo.firstMonthOfFY??1,c=d(t=>U(t.forecastState,t.forecastListState)),l=d(t=>t.forecastListState.fetchState==="Completed"),x=d(t=>t.profitAndLossState),D=d(t=>t.reportUIOptionsState.selectedForecast),L=t=>x.pandLByForecastID[t]!=null&&re(t,x).reducedAllFetchState.fetchState==="Completed",{areTenantIdsInSync:b}=he();ye({isDataReady:l});const{isAiCfoAccessEnabled:G,onAskAiCfoClick:_}=Se({isAiCfoOpen:s,setIsAiCfoOpen:a,mobileExploreReferrer:"Forecast"});h.useEffect(()=>{if(!f&&b)p(!0),l||o(ae());else if(l&&!F){A(!0);const t=((m,R,P)=>R!=null?m.forecasts.findIndex(I=>I.id===R):P!=null?m.forecasts.findIndex(I=>I.id===P):m.forecasts.length>0?0:-1)(c,i,D?.id);t===-1&&i!=null?e("page-not-found",{replace:!0}):t!==-1&&t!=D?.index?(o(N(c.forecasts[t].id,t)),y(i,c.forecasts[t].id,e,r.search)):i==null&&t!==-1&&y(void 0,c.forecasts[t].id,e,r.search),t!==-1&&!L(c.forecasts[t].id)&&b&&o(S(c.forecasts[t].id))}},[f,p,o,l,c,F,A,U,S,b]);const O=ge(),J=O?.loggedInUserRole!=null&&te(O.loggedInUserRole),{useFeatureGate:V}=$(),{isFeatureEnabled:j}=V(w.isReportsCommentingEnabled),W=Ae(j?k?.companyId:void 0,{clearParams:l&&F}),[Y,z]=h.useState(!1),E=t=>{z(t)};return n.jsxs(n.Fragment,{children:[l?n.jsx(Fe,{analytics:B,onLoad:t=>(m=>m.trackForecast())(t)}):null,n.jsx(xe,{isAppContentDrawerOpen:Y,handleDrawerToggle:E}),n.jsx(De,{firstMonthOfFY:q,tenantEmailDomain:g,forecastIdFromUrlPath:i,navigate:e,location:r,isPandLReportFetched:L,meetingUrl:oe(`https://meetings.hubspot.com/svitlana-grankovska?firstname=${u?.firstName}&lastname=${u?.lastName}&email=${u?.userEmail}`),hasTransactionAccess:J,isAiCfoAccessEnabled:G,onAskAiCfoClick:_,isReportsCommentingEnabled:j,isZeniUser:se(u),initialOpenThreadRequest:W,onClickMenuIcon:()=>{E(!0)}})]})}function Ze(){const s=d(i=>M(i)),{useFeatureGate:a}=$(),{isFeatureEnabled:e}=a(w.isDebitCardFeatureEnabled),o=me(e,s),r=fe(s);return o===!0||r===!0?n.jsx(Te,{}):n.jsxs(ee,{children:[n.jsx(C,{path:"/",element:n.jsx(v,{})}),n.jsx(C,{path:"/:forecastId",element:n.jsx(v,{})}),n.jsx(C,{path:"/:forecastId/*",element:n.jsx(Ce,{})})]})}export{Ze as PandLWithForecastRoutes,Ze as default};
@@ -0,0 +1,22 @@
1
+ import{j as s}from"./liveblocks-BeS4QmMp.js";import{J2 as oe,eN as q,jq as M,eT as X,eR as ie,GD as Y,IH as re,sJ as Ie,J3 as Q,sx as Pe,sS as je,sM as le,sB as de,sQ as Te,sN as Le,J4 as ce,un as ve,J5 as Fe,fw as Ae,J6 as G,sG as pe,sE as ue,sV as Oe,c0 as Re}from"./zeni-epic-state-ChnjRetZ.js";import{q as me,a as ee,p as E,z as K,a5 as ge,H as he,ag as fe,ah as Ve,F as Ce,o as A,J as be,D as ye,ai as Ue,N as Be,M as Ze,C as $e,d as we,f as Je,v as Ge,aj as He,k as ze}from"./index-BZDuIo7x.js";import{D as De,n as W,S as Se}from"./mui--qrGbwFJ.js";import te from"./NotFoundScreen-B8ppov_c.js";import{a as l}from"./sentry-BlmJH5WH.js";import{h as se,l as Me,g,j as Ke,u as We,k as _e,n as ne,o as J}from"./core-DcM32IW_.js";import{u as Ne}from"./useAskAiCfoHostNavButtonProps-CHoGbMpp.js";import{c as Qe}from"./useFetchSuggestedQuestionsWhenReady-DVUj1bst.js";import{M as qe}from"./MobileAppDrawer-BCaWgXZQ.js";import"./recharts-DoWl4vaN.js";import"./analytics-ByrfXPqG.js";import"./plaid-BZ0BFqP0.js";import"./dnd-36WXho_9.js";import"./stripe-DMRn4zHo.js";import"./lottie-Bdncx-qB.js";import"./lexical-CYAYrhLa.js";import"./pdf-6nmWWkz8.js";import"./utils-RmRP6xA4.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]="4e13178d-0d8f-4187-9ac8-c7dedb567086",e._sentryDebugIdIdentifier="sentry-dbid-4e13178d-0d8f-4187-9ac8-c7dedb567086")}catch{}})();const Xe={overlayWidth:new Ce(100,100,48)},H=ye.getLocalizedStrings().peoplePage.invitePage,Ye=({companyId:e,managersListView:n,companyPassportView:d,classListView:o,mode:h,isEditPeopleDrawerOpen:i,closeDrawerHandler:y})=>{const f=me(),u=se(),[O,R]=l.useState(!1),[I,w]=l.useState(!1),{userId:D}=Me(),c=g(t=>oe(t)),m=g(t=>q(t)),S=g(t=>M(t)),{useFeatureGate:C}=ee(),{isFeatureEnabled:k}=C(E.isDebitCardFeatureEnabled),P=X(k,m),L=ie(m),v=Y(m),V=re(m),U=!!m.company?.featuresActivationInfo?.isReimbursementFeatureEnabled,x=!P&&S&&o.fetchState!=="Completed"||n.fetchState!=="Completed"||d.fetchState!=="Completed"||e==null;if(K.getSignedInUser()==null)throw Error("Can't access invite people page without signing in...");const b=()=>{u(Q()),y()},F=()=>{O===!0?w(!0):b()},B=d.companyView?.controllers?.map(t=>t.user),{isFeatureEnabled:Z}=C(E.isDepositAccountsFeatureEnabled),{isFeatureEnabled:$}=C(E.isChargeCardFeatureEnabled),p=ge(m,$,k),{isFeatureEnabled:j}=C(E.isTreasuryEnabled),T={peopleDetails:c,classList:o.classes,managersList:n.users,controllersList:B,mode:h,isZeniTenant:v,isAccountingClassesEnabled:S,isReimbursementDisabled:U===!1,isZeniAccountsDisabled:Z===!1,isChargeCardDisabled:p===!1,isTreasuryDisabled:j===!1,isLiteRoleDisabled:V===!1,isBankingOnlyTenant:P,isCardsOnlyTenant:L,onResetClick:b,onDeleteUser:t=>{u(de(t.userId,t.userRole.userRoleId))},onPeopleLocalDataUpdated:t=>{u(le({peopleLocalData:t})),R(!0)},onSaveClick:()=>{u(h==="zeni_only"?Pe(e):je(v))},onCloseClick:F,isLoading:x||c.person==null},r={onOkClick:()=>{w(!1),b()},onCancelClick:()=>{w(!1)}};return l.useEffect(()=>{x===!1&&D!=null&&u(Ie(D))},[x,D]),l.useEffect(()=>{c.updatePersonState.fetchState==="Completed"&&b()},[c.updatePersonState.fetchState]),s.jsx(De,{anchor:"right",open:i,PaperProps:{style:{width:Xe.overlayWidth.valuePercentage(f),boxShadow:"none"}},slotProps:{backdrop:{style:{backgroundColor:he.overlayDark,cursor:"pointer"}}},onClose:F,children:s.jsxs(es,{onClick:t=>t.stopPropagation(),children:[I===!0?s.jsx(fe,{titleComponent:s.jsx(xe,{children:H.discardTitle}),descriptionComponent:s.jsx(Ee,{children:H.discardDescription}),primaryButtonText:H.discard,secondaryButtonText:H.no,action:r,isEditPopup:!0}):null,s.jsx(Ve,{...T})]})})},es=W(Se)`
2
+ display: flex;
3
+ min-height: 100%;
4
+ flex-direction: column;
5
+ `,xe=W(be.H6Regular)`
6
+ margin-top: ${A.sp7};
7
+ padding-left: ${A.sp8};
8
+ padding-right: ${A.sp8};
9
+ color: ${e=>e.theme.colors.primary};
10
+ word-break: break-word;
11
+ `,Ee=W(be.LargeRegularSp)`
12
+ color: ${e=>e.theme.colors.hero};
13
+ padding-left: ${A.sp8};
14
+ padding-right: ${A.sp8};
15
+ margin-bottom: 30px;
16
+ margin-top: ${A.sp4};
17
+ white-space: pre-line;
18
+ `,ss={overlayWidth:new Ce(100,100,48)},z=ye.getLocalizedStrings().peoplePage.invitePage,as=({companyId:e,managersListView:n,companyPassportView:d,classListView:o,mode:h,isInvitePeopleDrawerOpen:i,closeDrawerHandler:y})=>{const f=me(),u=se(),[O,R]=l.useState(!1),[I,w]=l.useState(!1),D=g(r=>oe(r)),c=g(r=>q(r)),m=g(r=>M(r)),{useFeatureGate:S}=ee(),{isFeatureEnabled:C}=S(E.isDebitCardFeatureEnabled),k=X(C,c),P=ie(c),L=Y(c),v=re(c),V=!!c.company?.featuresActivationInfo?.isReimbursementFeatureEnabled,U=!k&&m&&o.fetchState!=="Completed"||n.fetchState!=="Completed"||d.fetchState!=="Completed"||e==null;if(K.getSignedInUser()==null)throw Error("Can't access invite people page without signing in...");const x=()=>{y(),u(Q())},b=()=>{O===!0?w(!0):x()},F={onOkClick:()=>{w(!1),x()},onCancelClick:()=>{w(!1)}},B=d.companyView?.controllers.map(r=>r.user),{isFeatureEnabled:Z}=S(E.isDepositAccountsFeatureEnabled),{isFeatureEnabled:$}=S(E.isChargeCardFeatureEnabled),p=ge(c,$,C),{isFeatureEnabled:j}=S(E.isTreasuryEnabled),T={classList:o.classes,managersList:n.users,controllersList:B,mode:h,isZeniTenant:L,onPeopleLocalDataUpdated:r=>{u(le({peopleLocalData:r})),R(!0)},onResetClick:x,onSaveClick:()=>{u(h==="zeni_only"?Te(e):Le())},onCloseClick:b,peopleDetails:D,isAccountingClassesEnabled:m,isReimbursementDisabled:V===!1,isLiteRoleDisabled:v===!1,isZeniAccountsDisabled:Z===!1,isChargeCardDisabled:p===!1,isTreasuryDisabled:j===!1,isBankingOnlyTenant:k,isCardsOnlyTenant:P,isLoading:U};return l.useEffect(()=>{D.invitePersonState.fetchState==="Completed"&&(y(),u(Q()))},[D.invitePersonState.fetchState]),s.jsx(De,{anchor:"right",open:i,PaperProps:{style:{width:ss.overlayWidth.valuePercentage(f),boxShadow:"none"}},slotProps:{backdrop:{style:{backgroundColor:he.overlayDark,cursor:"pointer"}}},onClose:b,children:s.jsxs(ts,{onClick:r=>r.stopPropagation(),children:[I===!0?s.jsx(fe,{titleComponent:s.jsx(xe,{children:z.discardTitle}),descriptionComponent:s.jsx(Ee,{children:z.discardDescription}),primaryButtonText:z.discard,secondaryButtonText:z.no,action:F}):null,s.jsx(Ue,{...T})]})})},ts=W(Se)`
19
+ display: flex;
20
+ min-height: 100%;
21
+ flex-direction: column;
22
+ `,ns=_e(function(e,n){const d=ce(e),o=K.getSignedInUser();return{data:d,loggedinUserId:o?.userId??"",isZeniTenant:n.isZeniTenant===!0,shouldFetchClasses:n.shouldFetchClasses,isZeniAdminUser:o?.userEmailDomain==="zeni.ai"&&n.isZeni===!0,isAccountingClassesEnabled:M(e),analytics:we}},function(e,n){const{navigate:d,companyId:o,shouldFetchClasses:h}=n;return{personAction:{onPersonDelete:(i,y)=>{e(de(i,y))},onResendInvite:i=>{e(Oe(i))},onReloadPeople:()=>{e(pe()),e(ue(o,h))},onBackClick:()=>{d("../../")},onModeChange:i=>{e(G({mode:i,searchText:"",sortKey:"name",sortOrder:"ascending"}))},onSearchTextChanged:i=>{e(G({searchText:i}))}}}})(He);function N({isInvitePeopleDrawerOpen:e,isEditPeopleDrawerOpen:n}){const d=Ke(),o=se(),h=We(),{areTenantIdsInSync:i}=Be(),y=K.getSignedInUser(),f=g(a=>q(a)),{useFeatureGate:u}=ee(),{isFeatureEnabled:O}=u(E.isDebitCardFeatureEnabled),R=g(a=>M(a)),I=!X(O,f)&&R,w=Y(f),D=f?.tenantId,{tenantEmailDomain:c}=f,[m,S]=l.useState(!1),[C,k]=l.useState(!1),[P,L]=l.useState(!1),[v,V]=l.useState("off"),[U,x]=l.useState(!1),b=a=>{x(a)},{isAiCfoOpen:F,setIsAiCfoOpen:B}=Ze(),{isAiCfoAccessEnabled:Z,onAskAiCfoClick:$}=Ne({isAiCfoOpen:F,setIsAiCfoOpen:B,mobileExploreReferrer:"People"}),p=g(a=>ce(a));Qe({isDataReady:p.fetchState==="Completed"});const j=g(a=>ve(a.classState,a.classListState)),T=g(a=>Fe(a.userState,a.userRoleState,a.userListViewState,"manager")),r=g(a=>Ae(a)),t=f?.companyId;l.useEffect(()=>{m&&v===p.uiState.mode||!i||(o(G({searchText:"",sortKey:"name",sortOrder:"ascending"})),V(p.uiState.mode),S(!0),o(pe()))},[m,y,D,o,p.uiState.mode,i]),l.useEffect(()=>{t!=null&&i&&o(ue(t,I))},[t,I,i]),l.useEffect(()=>{k(e!=null&&e===!0),L(n!=null&&n===!0&&n)},[e,n]),l.useEffect(()=>{o(G({searchText:"",sortKey:"name",sortOrder:"ascending"}))},[]);const ae=()=>{k(!1),L(!1),d("../")};return s.jsxs(s.Fragment,{children:[p.fetchState==="Completed"?s.jsx($e,{analytics:we,onLoad:a=>a.trackPageLoaded(Je.Event.members)}):null,C===!0?s.jsx(as,{closeDrawerHandler:ae,isInvitePeopleDrawerOpen:C,managersListView:T,companyPassportView:r,classListView:j,companyId:t,mode:p.uiState.mode}):null,P===!0?s.jsx(Ye,{closeDrawerHandler:ae,isEditPeopleDrawerOpen:P,managersListView:T,companyPassportView:r,classListView:j,companyId:t,mode:p.uiState.mode}):null,s.jsx(qe,{isAppContentDrawerOpen:U,handleDrawerToggle:b}),s.jsx(ns,{navigate:d,signedInUser:y,isZeni:f.isZeni,isZeniTenant:w,peopleUIState:p.uiState,companyId:t,shouldFetchClasses:I,classList:j,managersView:T,peopleView:p,onInvitePeopleClick:()=>{d("./new")},onColumnSortConfigChanged:(a,_)=>{o(G({sortKey:a,sortOrder:_}))},onRowClick:a=>{const _=`/${c}/people/${encodeURIComponent(a)}/edit`,ke=Ge(h.state?.pathnameStackToGoBack,h.pathname);d(_,{state:{pathnameStackToGoBack:ke}})},onClickMenuIcon:()=>{b(!0)},isAiCfoAccessEnabled:Z,onAskAiCfoClick:$})]})}function Es(){const e=ze();return Re(e?.loggedInUserRole??[])?s.jsxs(ne,{children:[s.jsx(J,{path:"/",element:s.jsx(N,{})}),s.jsx(J,{path:"new",element:s.jsx(N,{isInvitePeopleDrawerOpen:!0})}),s.jsx(J,{path:":userId/edit",element:s.jsx(N,{isEditPeopleDrawerOpen:!0})}),s.jsx(J,{path:"*",element:s.jsx(te,{})})]}):s.jsx(ne,{children:s.jsx(J,{path:"*",element:s.jsx(te,{})})})}export{Es as default};
@@ -0,0 +1 @@
1
+ import{j as s}from"./liveblocks-BeS4QmMp.js";import _ from"./NotFoundScreen-B8ppov_c.js";import{a as o}from"./sentry-BlmJH5WH.js";import{j as M,u as v,g,l as U,h as P,N as z,k as N,n as V,o as b}from"./core-DcM32IW_.js";import{eN as B,OJ as h,bo as F,bn as J,h6 as H,gC as $}from"./zeni-epic-state-ChnjRetZ.js";import{y as q,z as C,M as G,ct as K}from"./index-BZDuIo7x.js";import"./mui--qrGbwFJ.js";import{u as L}from"./useAskAiCfoHostNavButtonProps-CHoGbMpp.js";import{c as Q}from"./useFetchSuggestedQuestionsWhenReady-DVUj1bst.js";import{M as W}from"./MobileAppDrawer-BCaWgXZQ.js";import"./recharts-DoWl4vaN.js";import"./analytics-ByrfXPqG.js";import"./plaid-BZ0BFqP0.js";import"./dnd-36WXho_9.js";import"./stripe-DMRn4zHo.js";import"./lottie-Bdncx-qB.js";import"./lexical-CYAYrhLa.js";import"./pdf-6nmWWkz8.js";import"./utils-RmRP6xA4.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]="02a21bd2-cc93-4a59-8b2f-b1ae38f91b0c",e._sentryDebugIdIdentifier="sentry-dbid-02a21bd2-cc93-4a59-8b2f-b1ae38f91b0c")}catch{}})();const X=N(function(e){const t=C.getSignedInUser(),c=e.tenantState.currentTenantId,r={userId:t?.userId??"",sessionId:t?.zeniSessionId??"",tenantId:c??""},{aggregatedReportViewState:n}=h(e);return{authParams:r,isDisabled:!1,loggedInUser:t,aggregatedReport:n}},function(e,t){return{onBackClick:()=>{t.navigate("../../")},onClickMenuIcon:()=>{t.handleDrawerToggle(!0)}}})(K),Y=()=>{const e=M(),t=v(),c=q(),r=g(a=>B(a)),{aggregatedReportViewState:n}=g(a=>h(a)),{tenantEmailDomain:m}=U(),p=P(),d=C.getSignedInUser();if(d==null)throw new Error("Can't access this page without signing in...");const f=o.useRef(!1),[I,S]=o.useState(!1),k=F(r?.userRole??[]),w=r?.userRole?.includes("bookkeeping_admin")??!1,y=J(d),A=k||w||y,l=o.useCallback((a,i,O)=>{p(H({fromMonth:a,toMonth:i,cacheOverride:O}))},[]);o.useEffect(()=>{n?.fetchState==="Completed"&&f.current&&(p($({messageSection:"data_refresh_update",messageText:"success",type:"success",showStatusIcon:!0})),f.current=!1)},[n?.fetchState]);const D=o.useCallback((a,i)=>{n!=null&&n?.fetchState==="In-Progress"||l(a,i,!0),f.current=!0},[n?.fetchState,l]),x=o.useCallback((a,i)=>{l(a,i,!1)},[l]),u=a=>{S(a)},{isAiCfoOpen:j,setIsAiCfoOpen:R}=G(),{isAiCfoAccessEnabled:T,onAskAiCfoClick:E}=L({isAiCfoOpen:j,setIsAiCfoOpen:R,mobileExploreReferrer:"Performance"});return Q({isDataReady:n?.fetchState==="Completed"}),A?s.jsxs(s.Fragment,{children:[s.jsx(W,{isAppContentDrawerOpen:I,handleDrawerToggle:u}),s.jsx(X,{navigate:e,location:t,themeState:c,currentTenant:r,signedInUser:d,tenantEmailDomain:m,onReload:D,onTimeRangeSelect:x,handleDrawerToggle:u,isAiCfoAccessEnabled:T,onAskAiCfoClick:E})]}):s.jsx(z,{to:`/${m}/dashboard`,replace:!0})};function Ce(){return s.jsxs(V,{children:[s.jsx(b,{path:"*",element:s.jsx(Y,{})}),s.jsx(b,{path:"*",element:s.jsx(_,{})})]})}export{Ce as default};
@@ -1 +1 @@
1
- import{a as h,b as t}from"./sentry-DrlL61Aq.js";(function(){try{var r=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},a=new r.Error().stack;a&&(r._sentryDebugIds=r._sentryDebugIds||{},r._sentryDebugIds[a]="a301a95b-8420-43bd-aa56-5738077199ba",r._sentryDebugIdIdentifier="sentry-dbid-a301a95b-8420-43bd-aa56-5738077199ba")}catch{}})();const c="64px",b={};var k=({src:r,light:a,oEmbedUrl:n,onClickPreview:l,playIcon:w,previewTabIndex:m,previewAriaLabel:u})=>{const[p,i]=h.useState(null);h.useEffect(()=>{r&&a&&n&&v({src:r,light:a,oEmbedUrl:n})},[r,a,n]);const v=async({src:e,light:d,oEmbedUrl:I})=>{if(t.isValidElement(d))return;if(typeof d=="string")return void i(d);if(b[e])return void i(b[e]);i(null);const E=await fetch(I.replace("{url}",e)),g=await E.json();if(g.thumbnail_url){const f=g.thumbnail_url.replace("height=100","height=480").replace("-d_295x166","-d_640");i(f),b[e]=f}},o=t.isValidElement(a),y={display:"flex",alignItems:"center",justifyContent:"center"},s={preview:{width:"100%",height:"100%",backgroundImage:p&&!o?`url(${p})`:void 0,backgroundSize:"cover",backgroundPosition:"center",cursor:"pointer",...y},shadow:{background:"radial-gradient(rgb(0, 0, 0, 0.3), rgba(0, 0, 0, 0) 60%)",borderRadius:c,width:c,height:c,position:o?"absolute":void 0,...y},playIcon:{borderStyle:"solid",borderWidth:"16px 0 16px 26px",borderColor:"transparent transparent transparent white",marginLeft:"7px"}},_=t.createElement("div",{style:s.shadow,className:"react-player__shadow"},t.createElement("div",{style:s.playIcon,className:"react-player__play-icon"}));return t.createElement("div",{style:s.preview,className:"react-player__preview",tabIndex:m,onClick:e=>{l?.(e)},onKeyDown:e=>{e.key!=="Enter"&&e.key!==" "||l==null||l(e)},...u?{"aria-label":u}:{}},o?a:null,w||_)};export{k as default};
1
+ import{a as h,b as t}from"./sentry-BlmJH5WH.js";(function(){try{var r=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},a=new r.Error().stack;a&&(r._sentryDebugIds=r._sentryDebugIds||{},r._sentryDebugIds[a]="a301a95b-8420-43bd-aa56-5738077199ba",r._sentryDebugIdIdentifier="sentry-dbid-a301a95b-8420-43bd-aa56-5738077199ba")}catch{}})();const c="64px",b={};var k=({src:r,light:a,oEmbedUrl:n,onClickPreview:l,playIcon:w,previewTabIndex:m,previewAriaLabel:u})=>{const[p,i]=h.useState(null);h.useEffect(()=>{r&&a&&n&&v({src:r,light:a,oEmbedUrl:n})},[r,a,n]);const v=async({src:e,light:d,oEmbedUrl:I})=>{if(t.isValidElement(d))return;if(typeof d=="string")return void i(d);if(b[e])return void i(b[e]);i(null);const E=await fetch(I.replace("{url}",e)),g=await E.json();if(g.thumbnail_url){const f=g.thumbnail_url.replace("height=100","height=480").replace("-d_295x166","-d_640");i(f),b[e]=f}},o=t.isValidElement(a),y={display:"flex",alignItems:"center",justifyContent:"center"},s={preview:{width:"100%",height:"100%",backgroundImage:p&&!o?`url(${p})`:void 0,backgroundSize:"cover",backgroundPosition:"center",cursor:"pointer",...y},shadow:{background:"radial-gradient(rgb(0, 0, 0, 0.3), rgba(0, 0, 0, 0) 60%)",borderRadius:c,width:c,height:c,position:o?"absolute":void 0,...y},playIcon:{borderStyle:"solid",borderWidth:"16px 0 16px 26px",borderColor:"transparent transparent transparent white",marginLeft:"7px"}},_=t.createElement("div",{style:s.shadow,className:"react-player__shadow"},t.createElement("div",{style:s.playIcon,className:"react-player__play-icon"}));return t.createElement("div",{style:s.preview,className:"react-player__preview",tabIndex:m,onClick:e=>{l?.(e)},onKeyDown:e=>{e.key!=="Enter"&&e.key!==" "||l==null||l(e)},...u?{"aria-label":u}:{}},o?a:null,w||_)};export{k as default};
@@ -1,4 +1,4 @@
1
- import{j as Ol}from"./liveblocks-XXI3_E1y.js";import{p as Q,e as xc,d as kc,g as jl,a as xl}from"./sentry-DrlL61Aq.js";import{L as dt,bR as Tc,eN as Ac,Ij as Rc,I$ as kl,c0 as Tl,fh as Al,fi as Rl}from"./zeni-epic-state-BlOBva0w.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,n as Yt,o as ue,p as Dl}from"./utils-DCRx3jP7.js";import{r as un}from"./empty-CwKXvn2c.js";import{r as Fl,a as Bl,b as Ul,c as ql}from"./pdf-lib-Dkp2Hlcw.js";import{r as Gl}from"./index-B53H88q7.js";import{r as zl}from"./index-DatNfK53.js";import{j as Zl,u as Hl,h as Vl,g as En,k as Yl}from"./core-sRr8O2Ja.js";import{u as Kl,z as Pc,L as Wl,U as Jl,V as Xl,j as Ql,d as tf}from"./index-B8scoeQA.js";import"./mui-CL-iXERd.js";import{d as Pe}from"./decodeURIComponentSafe-DfA0P9Xn.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]="5e424db1-bbc4-4f6d-9d32-4300082e8b74",t._sentryDebugIdIdentifier="sentry-dbid-5e424db1-bbc4-4f6d-9d32-4300082e8b74")}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-BeS4QmMp.js";import{p as Q,e as xc,d as kc,g as jl,a as xl}from"./sentry-BlmJH5WH.js";import{L as dt,bR as Tc,eN as Ac,Ii as Rc,I_ as kl,c0 as Tl,fh as Al,fi as Rl}from"./zeni-epic-state-ChnjRetZ.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,n as Yt,o as ue,p as Dl}from"./utils-RmRP6xA4.js";import{r as un}from"./empty-GSTAUqhH.js";import{r as Fl,a as Bl,b as Ul,c as ql}from"./pdf-lib-rQgtUIvp.js";import{r as Gl}from"./index-Dq0r4E9j.js";import{r as zl}from"./index-CjaQ8-D2.js";import{j as Zl,u as Hl,h as Vl,g as En,k as Yl}from"./core-DcM32IW_.js";import{u as Kl,z as Pc,L as Wl,U as Jl,V as Xl,j as Ql,d as tf}from"./index-BZDuIo7x.js";import"./mui--qrGbwFJ.js";import{d as Pe}from"./decodeURIComponentSafe-mAxyJdJ8.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]="a0ce3f0d-bd85-4d2e-a1b5-24b5bb0db15c",t._sentryDebugIdIdentifier="sentry-dbid-a0ce3f0d-bd85-4d2e-a1b5-24b5bb0db15c")}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
 
@@ -0,0 +1,5 @@
1
+ import{j as s}from"./liveblocks-BeS4QmMp.js";import{a as o}from"./sentry-BlmJH5WH.js";import{g as f,j as F,h as M,u as V,k as W}from"./core-DcM32IW_.js";import{h as _,q as z,z as R,b3 as U,F as $,N as q,M as X,C as Z,d as l,f as G,a2 as J,b4 as Q}from"./index-BZDuIo7x.js";import{eX as K,eN as Y,Lx as I,Ly as ee,tr as re,th as g,eZ as ae,bM as ne,tm as te,Lz as se}from"./zeni-epic-state-ChnjRetZ.js";import{D as oe,e as ie,n as le,S as de}from"./mui--qrGbwFJ.js";import{u as ce}from"./useAskAiCfoHostNavButtonProps-CHoGbMpp.js";import{c as fe}from"./useFetchSuggestedQuestionsWhenReady-DVUj1bst.js";import{M as ue}from"./MobileAppDrawer-BCaWgXZQ.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]="3f3c181f-8885-4fe1-823d-46ab6208967f",e._sentryDebugIdIdentifier="sentry-dbid-3f3c181f-8885-4fe1-823d-46ab6208967f")}catch{}})();const pe={overlayWidth:new $(100,100,30)},we=({isReferralDrawerOpen:e,closeDrawerHandler:r})=>{const a=_(),n=z();if(R.getSignedInUser()==null)throw Error("Can't access How Referral works without signing in...");const i=()=>{r(!0)},u=f(d=>K(d));return s.jsx(oe,{anchor:"right",open:e,PaperProps:{style:{width:pe.overlayWidth.valuePercentage(n),boxShadow:"none"}},slotProps:{backdrop:{style:{opacity:.75,backgroundColor:a.colors.black,cursor:"pointer"}}},onClose:()=>i(),children:s.jsx(ie,{in:e,direction:"left",children:s.jsx(ge,{onClick:d=>d.stopPropagation(),children:s.jsx(U,{onDismissClick:i,rewardsPlan:u.rewardsPlan})})})})},ge=le(de)`
2
+ display: flex;
3
+ min-height: 100%;
4
+ flex-direction: column;
5
+ `,P="refer-and-earn-status-update",ke=W(function(e){const r=I(e),a=e.referralViewState.rewardsPlanFetchState,n=ne([r,a]);return{inviteList:r.invitations,uiState:r.uiState,pendingBonus:r.pendingBonus,earnedBonus:r.earnedBonus,pendingReferrals:r.pendingReferrals,fetchState:n.fetchState,rewardsPlan:r.rewardsPlan}},function(e,r){const{navigate:a}=r;return{onColumnSortConfigChanged:(n,i)=>{e(se({sortOrder:i,sortkey:n}))},onInviteClick:()=>{l.trackRewardsPageClicked("invite via email"),a("../refer")},onHowItWorksClick:()=>{l.trackRewardsPageClicked("know more"),a("../how-it-works")},onResendInviteClick:n=>{l.trackRewardsPageClicked("resend invite"),e(te(n))},onBackClick:()=>{a("../",{relative:"path"})},onReloadInvitees:()=>{e(g(!0))},onCopyReferralLink:()=>{l.trackRewardsPageClicked("copy referral link")},onClickRefer:()=>{l.trackRewardsPageClicked("refer")},onEventReceived:n=>{n===P&&e(g(!0,!0))}}})(J(Q));function Pe({isReferralDrawerOpen:e}){const r=F(),a=M(),n=V(),[i,u]=o.useState(!1),[d,x]=o.useState(!1),[D,A]=o.useState(!1),[k,C]=o.useState(!1),p=R.getSignedInUser(),h=f(t=>Y(t)),m=f(t=>I(t)),y=m.fetchState,w=f(t=>t.referralViewState.rewardsPlanFetchState),b=ee([m,w]),{areTenantIdsInSync:c}=q();o.useEffect(()=>{h?.rewardsLastViewedTime==null&&D===!1&&(a(re()),A(!0))},[]),o.useEffect(()=>{!i&&y==="Not-Started"&&c&&(u(!0),a(g(!0)))},[y,a,c]),o.useEffect(()=>{!d&&w.fetchState==="Not-Started"&&c&&(x(!0),a(ae(!0)))},[w,a,c]),o.useEffect(()=>{C(e!=null&&e===!0)},[e]);const[E,j]=o.useState(!1),v=t=>{j(t)},{isAiCfoOpen:O,setIsAiCfoOpen:L}=X(),{isAiCfoAccessEnabled:T,onAskAiCfoClick:B}=ce({isAiCfoOpen:O,setIsAiCfoOpen:L,mobileExploreReferrer:"Rewards"});fe({isDataReady:b===!0});const H={events:p?.userId!=null?[`private-${p.userId}.${P}`]:[],eventCallback:(t,S,N)=>{N.onEventReceived(t)}};return s.jsxs(s.Fragment,{children:[b===!0?s.jsx(Z,{analytics:l,onLoad:t=>(S=>{p!=null&&S.trackPageLoaded(G.Event.rewardsPageViewed)})(t)}):null,s.jsx(ue,{isAppContentDrawerOpen:E,handleDrawerToggle:v}),k===!0?s.jsx(we,{closeDrawerHandler:()=>{C(!1),r("..")},isReferralDrawerOpen:k}):null,s.jsx(ke,{location:n,navigate:r,currentTenant:h,onClickMenuIcon:()=>{v(!0)},isAiCfoAccessEnabled:T,onAskAiCfoClick:B,...H})]})}export{Pe as R};
@@ -0,0 +1 @@
1
+ import{j as t}from"./liveblocks-BeS4QmMp.js";import R from"./NotFoundScreen-B8ppov_c.js";import{a as p}from"./sentry-BlmJH5WH.js";import{j as C,u as I,h as A,g as u,N as E,k,n as D,o as m}from"./core-DcM32IW_.js";import{eN as T,Mr as g,MH as S,Co as V,Bx as U,Cn as d,Ce as _,MW as B}from"./zeni-epic-state-ChnjRetZ.js";import{h as M,z as N,B as W,a2 as $,bJ as O,ab as z}from"./index-BZDuIo7x.js";import"./mui--qrGbwFJ.js";import{R as v}from"./ReimbursementApprovalRuleDetailScreen-BM0wb7RO.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]="062bf074-137b-45ad-9466-3be3d0464901",e._sentryDebugIdIdentifier="sentry-dbid-062bf074-137b-45ad-9466-3be3d0464901")}catch{}})();const c="reimbursement-approval-rule-update",H=k(function(e){return{approvalView:g(e),remiSetupApproverViewUpdateData:S(e).remiSetupApproverViewUpdateData}},function(e,r){const{navigate:a,location:l}=r;return{onApprovalRulesEventReceived:s=>{s.endsWith(c)&&e(B(!1))},onBackClick:()=>{z(l)?a("../../"):a("../../../reimbursements/setup")},onDeleteRuleClick:s=>{e(_(s))},onEditRuleClick:s=>{s!=null?(e(d(s)),a(`./${s}/edit`)):(e(d()),a("./new"))}}})($(O)),J=()=>{const e=C(),r=I(),a=A(),[l,s]=p.useState(!1),[f,y]=p.useState(!1),b=u(n=>n.remiSetupApproverViewState.fetchState),o=u(n=>T(n)),w=M(),i=u(n=>g(n)),h=u(n=>S(n).remiSetupApproverViewUpdateData);if(p.useEffect(()=>{h?.updateStatus.fetchState==="Completed"&&a(V())},[h]),p.useEffect(()=>{l||b!=="Not-Started"||(s(!0),a(U(!0)))},[l,b,a]),N.getSignedInUser()==null)throw Error("Can't access reimbursement approval without signing in...");p.useEffect(()=>{i.allApprovalRules.length===0&&i.fetchState==="Completed"&&(f||(y(!0),a(d())),e("./new"))},[f,i,a]);const j={events:o.companyId!=null?[`private-${o.companyId}.${c}`]:[],eventCallback:(n,P,x)=>{n.endsWith(c)&&x.onApprovalRulesEventReceived(n)}};return o.companyReimbursementInfo?.info?.isReimbursementTOSAccepted===!1?t.jsx(E,{to:"../../promo"}):o.companyReimbursementInfo?.info?.isReimbursementTOSAccepted!==!0||i.fetchState!=="Completed"&&i.fetchState!=="Error"?t.jsx(W,{fetchState:"In-Progress",style:{backgroundColor:w.colors.grey5}}):t.jsx(H,{currentTenant:o,location:r,navigate:e,...j})};function Z(){return t.jsxs(D,{children:[t.jsx(m,{path:"/",element:t.jsx(J,{})}),t.jsx(m,{path:"/new",element:t.jsx(v,{})}),t.jsx(m,{path:"/:approvalRuleId/edit",element:t.jsx(v,{})}),t.jsx(m,{path:"*",element:t.jsx(R,{})})]})}export{Z as R};
@@ -1 +1 @@
1
- import{j as g}from"./liveblocks-XXI3_E1y.js";import{a as y}from"./sentry-DrlL61Aq.js";import{j as w,h as A,u as C,l as T,g as b,k as U}from"./core-sRr8O2Ja.js";import{MI as R,Ms as E,Ci as x,Cr as _,Cp as S,Cq as h,MJ as B}from"./zeni-epic-state-BlOBva0w.js";import{z as k,h as V,B as j,bz as F,aa as O}from"./index-B8scoeQA.js";import"./mui-CL-iXERd.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]="f365dc0b-f143-456b-a827-b32eaa25d66f",e._sentryDebugIdIdentifier="sentry-dbid-f365dc0b-f143-456b-a827-b32eaa25d66f")}catch{}})();function $(e){return B(e)==null}const M=U(function(e,a){const t=R(e),s=t.remiSetupApproverViewUpdateData?.type??"approval_create",n=s==="approval_create"&&t.allApprovalRules.length!==0;let l=t.allApprovalRules.length===0;return a.approvalRuleId&&(l=t.allApprovalRules.findIndex(r=>r.approvalRuleId===a.approvalRuleId)===0),{localData:t,hideUpperBoundField:n,isLowerBoundDisabled:l,approvalUpdateActionType:s}},function(e,a){const{navigate:t,approvalUpdateDataView:s,approverViewData:n,approvalRuleId:l}=a,r=s.remiSetupApproverViewUpdateData?.type,i=O(a.location);return{onApprovalRuleDataUpdated:o=>{const u=p=>{const f=[];return p.forEach(c=>{const D=c.actors.selectedUsers.map(d=>({type:"user",subType:void 0,userId:d.userId,idType:"user",isImplicitActor:!1})),I=c.actors.selectedNonUsers.map(d=>{const m=!!$(d.value);return{type:m?"attribute":"role",subType:d.value,userId:void 0,idType:void 0,isImplicitActor:!m}}),v=D.concat(I);f.push({action:c.stepType.selectedOption,actors:v,operator:v.length>1?c.stepType.selectedOption==="require_approval"?"or":"and":"is"})}),f};if(r==="approval_create"){const p={criteria:{rangeType:"range",rangeEntity:"currency",range:{min:{amount:o.lowerBound,currencyCode:"USD",currencySymbol:"$"},max:{amount:o.upperBound,currencyCode:"USD",currencySymbol:"$"}}},steps:u(o.steps),isApplicableOnPendingApprovalEntity:o.applyToExistingReimbursements.includes("applyToExistingReimbursements")};e(h(p))}else{const p={approvalRuleId:l,criteria:{rangeType:"range",rangeEntity:"currency",range:{min:{amount:o.lowerBound,currencyCode:"USD",currencySymbol:"$"},max:{amount:o.upperBound,currencyCode:"USD",currencySymbol:"$"}}},steps:u(o.steps),isApplicableOnPendingApprovalEntity:o.applyToExistingReimbursements.includes("applyToExistingReimbursements")};e(h(p))}},onResetClick:()=>{e(S()),r==="approval_update"||i?t("../"):n.allApprovalRules.length===0&&n.fetchState==="Completed"?t("../../setup"):t("../")},onBackClick:()=>{e(S()),r==="approval_update"||i?t("../"):n.allApprovalRules.length===0&&n.fetchState==="Completed"?t("../../setup"):t("../")},onSaveRuleClick:()=>{e(_())},onSaveRuleSuccess:()=>{t("../")}}})(F);function G(){const e=w(),a=A(),t=C(),{approvalRuleId:s}=T(),n=k.getSignedInUser(),l=V(),r=b(p=>R(p)),i=b(p=>E(p)),[o,u]=y.useState(!1);if(y.useEffect(()=>{o||(u(!0),a(x(!0)))}),y.useEffect(()=>{i.fetchState==="Not-Started"&&e(s!=null?"../../":"../")},[i,s]),n==null)throw Error("Can't access address page without signing in...");return r.approversDetailsFetchStatus.fetchState=="Not-Started"||r.approversDetailsFetchStatus.fetchState==="In-Progress"?g.jsx(j,{fetchState:r.approversDetailsFetchStatus.fetchState,style:{backgroundColor:l.colors.grey5}}):g.jsx(M,{navigate:e,approvalUpdateDataView:r,approvalRuleId:s,approverViewData:i,location:t})}export{G as R,$ as i};
1
+ import{j as g}from"./liveblocks-BeS4QmMp.js";import{a as y}from"./sentry-BlmJH5WH.js";import{j as A,h as w,u as C,l as T,g as b,k as U}from"./core-DcM32IW_.js";import{MH as R,Mr as E,Ch as x,Cq as _,Co as h,Cp as S,MI as B}from"./zeni-epic-state-ChnjRetZ.js";import{z as k,h as V,B as j,bA as F,ab as O}from"./index-BZDuIo7x.js";import"./mui--qrGbwFJ.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]="45689b19-8831-4b3e-a594-55a3d94fe9fb",e._sentryDebugIdIdentifier="sentry-dbid-45689b19-8831-4b3e-a594-55a3d94fe9fb")}catch{}})();function $(e){return B(e)==null}const M=U(function(e,a){const t=R(e),s=t.remiSetupApproverViewUpdateData?.type??"approval_create",n=s==="approval_create"&&t.allApprovalRules.length!==0;let l=t.allApprovalRules.length===0;return a.approvalRuleId&&(l=t.allApprovalRules.findIndex(r=>r.approvalRuleId===a.approvalRuleId)===0),{localData:t,hideUpperBoundField:n,isLowerBoundDisabled:l,approvalUpdateActionType:s}},function(e,a){const{navigate:t,approvalUpdateDataView:s,approverViewData:n,approvalRuleId:l}=a,r=s.remiSetupApproverViewUpdateData?.type,i=O(a.location);return{onApprovalRuleDataUpdated:o=>{const u=p=>{const v=[];return p.forEach(c=>{const D=c.actors.selectedUsers.map(d=>({type:"user",subType:void 0,userId:d.userId,idType:"user",isImplicitActor:!1})),I=c.actors.selectedNonUsers.map(d=>{const m=!!$(d.value);return{type:m?"attribute":"role",subType:d.value,userId:void 0,idType:void 0,isImplicitActor:!m}}),f=D.concat(I);v.push({action:c.stepType.selectedOption,actors:f,operator:f.length>1?c.stepType.selectedOption==="require_approval"?"or":"and":"is"})}),v};if(r==="approval_create"){const p={criteria:{rangeType:"range",rangeEntity:"currency",range:{min:{amount:o.lowerBound,currencyCode:"USD",currencySymbol:"$"},max:{amount:o.upperBound,currencyCode:"USD",currencySymbol:"$"}}},steps:u(o.steps),isApplicableOnPendingApprovalEntity:o.applyToExistingReimbursements.includes("applyToExistingReimbursements")};e(S(p))}else{const p={approvalRuleId:l,criteria:{rangeType:"range",rangeEntity:"currency",range:{min:{amount:o.lowerBound,currencyCode:"USD",currencySymbol:"$"},max:{amount:o.upperBound,currencyCode:"USD",currencySymbol:"$"}}},steps:u(o.steps),isApplicableOnPendingApprovalEntity:o.applyToExistingReimbursements.includes("applyToExistingReimbursements")};e(S(p))}},onResetClick:()=>{e(h()),r==="approval_update"||i?t("../"):n.allApprovalRules.length===0&&n.fetchState==="Completed"?t("../../setup"):t("../")},onBackClick:()=>{e(h()),r==="approval_update"||i?t("../"):n.allApprovalRules.length===0&&n.fetchState==="Completed"?t("../../setup"):t("../")},onSaveRuleClick:()=>{e(_())},onSaveRuleSuccess:()=>{t("../")}}})(F);function G(){const e=A(),a=w(),t=C(),{approvalRuleId:s}=T(),n=k.getSignedInUser(),l=V(),r=b(p=>R(p)),i=b(p=>E(p)),[o,u]=y.useState(!1);if(y.useEffect(()=>{o||(u(!0),a(x(!0)))}),y.useEffect(()=>{i.fetchState==="Not-Started"&&e(s!=null?"../../":"../")},[i,s]),n==null)throw Error("Can't access address page without signing in...");return r.approversDetailsFetchStatus.fetchState=="Not-Started"||r.approversDetailsFetchStatus.fetchState==="In-Progress"?g.jsx(j,{fetchState:r.approversDetailsFetchStatus.fetchState,style:{backgroundColor:l.colors.grey5}}):g.jsx(M,{navigate:e,approvalUpdateDataView:r,approvalRuleId:s,approverViewData:i,location:t})}export{G as R,$ as i};