@zeniai/web-app-ui 5.0.37-dev → 5.0.38-dev

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (116) hide show
  1. package/dist/assets/AddressRoutes-CFlzwdul.js +1 -0
  2. package/dist/assets/AddressScreen-Cw-dklU2.js +9 -0
  3. package/dist/assets/AiCfoScreen-CS983lgP.js +11 -0
  4. package/dist/assets/{BillPayApprovalRoutes-DfhQ7tb1.js → BillPayApprovalRoutes-xlaTTs0C.js} +1 -1
  5. package/dist/assets/{BillPayRoutes-D2K3qoux.js → BillPayRoutes-D1VOPUoh.js} +1 -1
  6. package/dist/assets/{BusinessVerificationPageScreen-CxvBDJaY.js → BusinessVerificationPageScreen-DkwOmH2q.js} +2 -2
  7. package/dist/assets/{ChargeCardRoutes-CuIHumzC.js → ChargeCardRoutes-D3YURNcK.js} +8 -8
  8. package/dist/assets/{CompanyPassportScreen-Bw91AYxH.js → CompanyPassportScreen-C9mXVXr2.js} +1 -1
  9. package/dist/assets/{ConnectionAuthScreen-Bdyb7R6J.js → ConnectionAuthScreen-C5Rpfpbz.js} +1 -1
  10. package/dist/assets/CustomerOnboardingAuthScreen-7kd7LmmV.js +1 -0
  11. package/dist/assets/{CustomerOnboardingRoutes-CJ-osdy2.js → CustomerOnboardingRoutes-jyaMTpEJ.js} +3 -3
  12. package/dist/assets/{DashboardRoutes-D0LMRifq.js → DashboardRoutes-DOzvVzpe.js} +1 -1
  13. package/dist/assets/{DefaultTenantHome-BvGdHX4R.js → DefaultTenantHome-C1eNf6k6.js} +1 -1
  14. package/dist/assets/{DomesticWireDetailScreen-CFlHRVc3.js → DomesticWireDetailScreen-BtQ6Rgup.js} +3 -3
  15. package/dist/assets/DrawerScreen-DMCWWoqu.js +1 -0
  16. package/dist/assets/{EntityDetailRoutes-BECfPIXU.js → EntityDetailRoutes-DYK4VtQ3.js} +1 -1
  17. package/dist/assets/{ExpenseAutomationRoutes-M_Kzq0tR.js → ExpenseAutomationRoutes-B4M_VHfs.js} +3 -3
  18. package/dist/assets/FeaturePreviewScreen-C9nGcb2y.js +1 -0
  19. package/dist/assets/{MagicLinkRoutes-TUZvcmCe.js → MagicLinkRoutes-R6EiOSCx.js} +18 -18
  20. package/dist/assets/MagicLinkSignInScreen-B9R6T5PL.js +12 -0
  21. package/dist/assets/{MobileAppDrawer-DYUc4UJc.js → MobileAppDrawer-DuACKsl0.js} +1 -1
  22. package/dist/assets/NotFoundScreen-By6iX_AK.js +1 -0
  23. package/dist/assets/{NotificationRoutes-6-ZD9vkn.js → NotificationRoutes-CckRRzHX.js} +1 -1
  24. package/dist/assets/{PandLWithForecastRoutes-COgIpZDn.js → PandLWithForecastRoutes-Dlw30mT3.js} +1 -1
  25. package/dist/assets/PeopleRoutes-DoaUfpUb.js +22 -0
  26. package/dist/assets/PerformanceRoutes-pWHyN4NV.js +1 -0
  27. package/dist/assets/{Preview-CzG48e-W.js → Preview-cHYFAIpu.js} +1 -1
  28. package/dist/assets/{QBOConnectionScreen-DjFBwwSu.js → QBOConnectionScreen-DKGxKd0E.js} +1 -1
  29. package/dist/assets/{ReferralListScreen-BeXPCJMu.js → ReferralListScreen-7JoEaSvx.js} +2 -2
  30. package/dist/assets/{ReimbursementApprovalRoutes-BTeMl7pk.js → ReimbursementApprovalRoutes-q_xqohRp.js} +1 -1
  31. package/dist/assets/{ReimbursementApprovalRuleDetailScreen-Ck3EFIM0.js → ReimbursementApprovalRuleDetailScreen-DYUjSPeD.js} +1 -1
  32. package/dist/assets/{ReimbursementRoutes-D2RgNvha.js → ReimbursementRoutes-nLXGYdhr.js} +4 -4
  33. package/dist/assets/{ReportsRoutes-DMZ3NU4K.js → ReportsRoutes-cpKf6Nnv.js} +1 -1
  34. package/dist/assets/RewardsRoutes-eJMK01sJ.js +1 -0
  35. package/dist/assets/ScreenRoutes-gbWBIULy.js +2 -0
  36. package/dist/assets/{SettingsRoutes-BIysLxSk.js → SettingsRoutes-5cOxrdTC.js} +4 -4
  37. package/dist/assets/{SetupPagesScreen-DUUuRG76.js → SetupPagesScreen-sAZpJNGi.js} +5 -5
  38. package/dist/assets/{SignInScreen-DXMh6a-Z.js → SignInScreen-DPfGBdeh.js} +1 -1
  39. package/dist/assets/SignOutScreen-BsvCrb0A.js +9 -0
  40. package/dist/assets/{TaskListScreen-Cg75Xn5J.js → TaskListScreen-BYNqXG0-.js} +2 -2
  41. package/dist/assets/TaskRoutes-DDPxg7CG.js +9 -0
  42. package/dist/assets/TransactionDetailRoutes-BVkzBZ86.js +1 -0
  43. package/dist/assets/{TransactionDetailScreen-ydTyfutJ.js → TransactionDetailScreen-B5lMAMSc.js} +2 -2
  44. package/dist/assets/{TransactionListRoutes-CZVoSwl4.js → TransactionListRoutes-qyh1PD-Z.js} +1 -1
  45. package/dist/assets/{TreasuryRoutes-DbiYEN5X.js → TreasuryRoutes-DuPOO_Nm.js} +5 -5
  46. package/dist/assets/{VendorsRoutes-Ca9BmqrB.js → VendorsRoutes-B7HHnZHh.js} +16 -16
  47. package/dist/assets/WiseConfirmationScreen-HWW7D6Im.js +12 -0
  48. package/dist/assets/{ZeniAccountRoutes-DOijEoFM.js → ZeniAccountRoutes-DXp1wP2W.js} +10 -10
  49. package/dist/assets/ZeniAccountStatementScreen-kuKTdjdd.js +9 -0
  50. package/dist/assets/{accountMappingHelper-ZbK9tvHJ.js → accountMappingHelper-L2gJ16H8.js} +1 -1
  51. package/dist/assets/{analytics-Dr0EwPvr.js → analytics-DaGIvUkL.js} +1 -1
  52. package/dist/assets/{analyticsHelper-CJYxYU1f.js → analyticsHelper-DPM8WM8o.js} +1 -1
  53. package/dist/assets/{core-DD1dfJeB.js → core-D5Hit8x-.js} +1 -1
  54. package/dist/assets/{decodeURIComponentSafe-BYsApOnw.js → decodeURIComponentSafe-DDEb_ZPT.js} +1 -1
  55. package/dist/assets/{dnd-B-YE4tPm.js → dnd-BWi02USV.js} +1 -1
  56. package/dist/assets/{empty-BnKMMwK8.js → empty-CEC058x9.js} +1 -1
  57. package/dist/assets/{empty-BFN9bAJ8.js → empty-Dcm4EccV.js} +1 -1
  58. package/dist/assets/{emptyVideoElement-DBywPuDz.js → emptyVideoElement-Cg1_5pdj.js} +1 -1
  59. package/dist/assets/{epic-Cp1KDVw1.js → epic-DqLG1WPh.js} +1 -1
  60. package/dist/assets/getLocaleForTenant-BDiDnhsV.js +1 -0
  61. package/dist/assets/{index-B9py0zpe.js → index-1TQnr6ma.js} +1 -1
  62. package/dist/assets/{index-Cvrq5UXP.js → index-B51-hBP4.js} +1 -1
  63. package/dist/assets/{index-CAmZOuIR.js → index-Bv05727x.js} +1 -1
  64. package/dist/assets/{index-C29VuC_u.js → index-BzkVYl7p.js} +2 -2
  65. package/dist/assets/{index-BkSp81D-.js → index-C7yI3-qS.js} +9622 -9621
  66. package/dist/assets/{index-DtF5ksXF.js → index-CFTsy12u.js} +1 -1
  67. package/dist/assets/{index-BriiJl_5.js → index-D7pxWynk.js} +1 -1
  68. package/dist/assets/{lexical-BY-JRpCA.js → lexical-yXjK_sjC.js} +1 -1
  69. package/dist/assets/{liveblocks-n5yWztsO.js → liveblocks-BPC8B-82.js} +1 -1
  70. package/dist/assets/{lottie-RycEs72p.js → lottie-CgXU1WMN.js} +1 -1
  71. package/dist/assets/{mui-BTXLmTm-.js → mui-DW04nVBh.js} +1 -1
  72. package/dist/assets/{pathToGoBack-DIjRMr0j.js → pathToGoBack-DqR4pfCe.js} +1 -1
  73. package/dist/assets/{pdf-C2zvD-z9.js → pdf-D6P4p3u8.js} +4 -4
  74. package/dist/assets/{pdf-lib-n_9QJvCM.js → pdf-lib-CL8r24Xn.js} +1 -1
  75. package/dist/assets/{plaid-Dky97stA.js → plaid-BnTbuxYK.js} +1 -1
  76. package/dist/assets/{pusher-lN5nN-BF.js → pusher-DqEBDOP6.js} +1 -1
  77. package/dist/assets/{react-BF3FU52q.js → react-BgBQCF9f.js} +1 -1
  78. package/dist/assets/{react-CjZlDWfK.js → react-CJQgzcbn.js} +1 -1
  79. package/dist/assets/{react-DKEgEJnA.js → react-D-TJl3XF.js} +1 -1
  80. package/dist/assets/{react-CWCM7dE6.js → react-D8etWraJ.js} +1 -1
  81. package/dist/assets/{react-CRK6cUqm.js → react-DvihdbV2.js} +1 -1
  82. package/dist/assets/{react-B5Btq0Sg.js → react-wL8RpiLQ.js} +1 -1
  83. package/dist/assets/{recharts-DiMUqhPC.js → recharts-BAxVJ6il.js} +1 -1
  84. package/dist/assets/{routePaths-C6iDb53I.js → routePaths-DpkdUp-r.js} +1 -1
  85. package/dist/assets/{sentry-BKXoW7cS.js → sentry-CWaXw80H.js} +1 -1
  86. package/dist/assets/{url-mlO0QoUa.js → url-BFVr25rm.js} +1 -1
  87. package/dist/assets/{url-D3XswWcD.js → url-wSZ4fiLg.js} +1 -1
  88. package/dist/assets/useAskAiCfoHostNavButtonProps-COcfEAPF.js +1 -0
  89. package/dist/assets/{useDeviceId-DITDQ_Q4.js → useDeviceId-CgooY8pH.js} +1 -1
  90. package/dist/assets/useFetchSuggestedQuestionsWhenReady-Dye8etNE.js +1 -0
  91. package/dist/assets/{useInitialThreadRequest-Dm5r1FEx.js → useInitialThreadRequest-7gkW3kbz.js} +1 -1
  92. package/dist/assets/{utils-Becml5Y0.js → utils-DjtfEx4B.js} +1 -1
  93. package/dist/assets/{withTransactionSidePanel-Bymyb22-.js → withTransactionSidePanel-BgPYSbeD.js} +1 -1
  94. package/dist/assets/{zeni-epic-state-EPc5wQ9y.js → zeni-epic-state-CVuyWhoX.js} +6 -6
  95. package/dist/index.html +1 -1
  96. package/package.json +3 -3
  97. package/dist/assets/AddressRoutes-CT7pQKIn.js +0 -1
  98. package/dist/assets/AddressScreen-BWYniaqN.js +0 -9
  99. package/dist/assets/AiCfoScreen-DuWotxD-.js +0 -11
  100. package/dist/assets/CustomerOnboardingAuthScreen-Y_2UdYgu.js +0 -1
  101. package/dist/assets/DrawerScreen-15BrD-Mz.js +0 -1
  102. package/dist/assets/FeaturePreviewScreen-DYmob-8E.js +0 -1
  103. package/dist/assets/MagicLinkSignInScreen-D3xW8SPM.js +0 -12
  104. package/dist/assets/NotFoundScreen-BRYvV6H8.js +0 -1
  105. package/dist/assets/PeopleRoutes-BisrtcTN.js +0 -22
  106. package/dist/assets/PerformanceRoutes-D9et8wLK.js +0 -1
  107. package/dist/assets/RewardsRoutes-Bs-y5Squ.js +0 -1
  108. package/dist/assets/ScreenRoutes-DiGKb5LA.js +0 -2
  109. package/dist/assets/SignOutScreen-FPDYO6L7.js +0 -9
  110. package/dist/assets/TaskRoutes-DyYjnw-G.js +0 -9
  111. package/dist/assets/TransactionDetailRoutes-CRz7uF2c.js +0 -1
  112. package/dist/assets/WiseConfirmationScreen-DzVqaBXK.js +0 -12
  113. package/dist/assets/ZeniAccountStatementScreen-DlfKBh5c.js +0 -9
  114. package/dist/assets/getLocaleForTenant-BWKTh50p.js +0 -1
  115. package/dist/assets/useAskAiCfoHostNavButtonProps-C6C0w9_M.js +0 -1
  116. package/dist/assets/useFetchSuggestedQuestionsWhenReady-CDvirjAz.js +0 -1
@@ -1,4 +1,4 @@
1
- import{j as a}from"./liveblocks-n5yWztsO.js";import{l as b,k as x,j,u as y,h as Y,q as ee,g as A,N as ae,n as te,o as p}from"./core-DD1dfJeB.js";import{Iy as S,Iz as k,IA as L,yU as $,yG as N,IB as C,IC as ne,ID as oe,yK as ie,eO as I,yR as se,yO as le}from"./zeni-epic-state-EPc5wQ9y.js";import{Z as g,o as d,n as de,e as v,j as E,s as re,p as ce,q as me,r as F,a as pe,d as ue,v as he,w as xe,h as ge,B as fe,x as we,m as be,S as ye,O as Se,y as ke,C as ve}from"./index-BkSp81D-.js";import{n as c}from"./mui-BTXLmTm-.js";import f from"./NotFoundScreen-BRYvV6H8.js";import{a as P}from"./sentry-BKXoW7cS.js";import"./recharts-DiMUqhPC.js";import"./analytics-Dr0EwPvr.js";import"./plaid-Dky97stA.js";import"./dnd-B-YE4tPm.js";import"./stripe-DMRn4zHo.js";import"./lottie-RycEs72p.js";import"./lexical-BY-JRpCA.js";import"./pdf-C2zvD-z9.js";import"./utils-Becml5Y0.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]="06de9ca4-13be-48d1-94b4-8fc703ff3d9a",e._sentryDebugIdIdentifier="sentry-dbid-06de9ca4-13be-48d1-94b4-8fc703ff3d9a")}catch{}})();const Ie=c.div`
1
+ import{j as a}from"./liveblocks-BPC8B-82.js";import{l as w,k as x,j,u as y,h as Y,q as ee,g as A,N as ae,n as te,o as p}from"./core-D5Hit8x-.js";import{Iy as S,Iz as k,IA as L,yU as $,yG as N,IB as C,IC as ne,ID as oe,yK as ie,eO as I,yR as se,yO as le}from"./zeni-epic-state-CVuyWhoX.js";import{Z as g,o as r,k as re,e as v,j as E,m as de,p as ce,n as me,r as F,a as pe,d as ue,s as he,x as xe,h as ge,v as be,w as fe,T as we,S as ye,y as Se,C as ke,E as ve}from"./index-C7yI3-qS.js";import{n as c}from"./mui-DW04nVBh.js";import b from"./NotFoundScreen-By6iX_AK.js";import{a as P}from"./sentry-CWaXw80H.js";import"./recharts-BAxVJ6il.js";import"./analytics-DaGIvUkL.js";import"./plaid-BnTbuxYK.js";import"./dnd-BWi02USV.js";import"./stripe-DMRn4zHo.js";import"./lottie-CgXU1WMN.js";import"./lexical-yXjK_sjC.js";import"./pdf-D6P4p3u8.js";import"./utils-DjtfEx4B.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]="042b2790-fca9-4629-a3bb-bb1c78fac711",e._sentryDebugIdIdentifier="sentry-dbid-042b2790-fca9-4629-a3bb-bb1c78fac711")}catch{}})();const Ie=c.div`
2
2
  display: flex;
3
3
  height: 100%;
4
4
  width: 100%;
@@ -6,8 +6,8 @@ import{j as a}from"./liveblocks-n5yWztsO.js";import{l as b,k as x,j,u as y,h as
6
6
  flex-direction: column;
7
7
  align-items: center;
8
8
  background-color: ${e=>e.theme.colors.grey4};
9
- box-shadow: ${e=>`0px 2px ${d.sp1} ${e.theme.colors.dropShadowNormal}`};
10
- `,je=x(function(e){const t=S(e),n=k(e),{companyName:o}=t;return{companyName:o,isDisabled:t.fetchState!=="Completed"?"disabled":void 0,magicLinkBankAccountDetails:n,magicLinkViewState:t}},function(e,t){const{vendorId:n,billId:o}=t;return{onFetchBankName:i=>{e(N(i))},onSaveHandler:i=>{v.trackBillPayMagicLinkSubmitBankAccountDetails(o),e($(i,"standard",n,o))},onACHDetailsUpdated:i=>{const{bankAccountSection:l}=i;e(L({data:l}))}}})(de);function z(){const e=g(),{vendorId:t,billId:n}=b();return t==null||n==null?a.jsx(f,{}):a.jsx(a.Fragment,{children:a.jsx(Ie,{windowSize:e,children:a.jsx(je,{vendorId:t,billId:n})})})}const $e=c.div`
9
+ box-shadow: ${e=>`0px 2px ${r.sp1} ${e.theme.colors.dropShadowNormal}`};
10
+ `,je=x(function(e){const t=S(e),n=k(e),{companyName:o}=t;return{companyName:o,isDisabled:t.fetchState!=="Completed"?"disabled":void 0,magicLinkBankAccountDetails:n,magicLinkViewState:t}},function(e,t){const{vendorId:n,billId:o}=t;return{onFetchBankName:i=>{e(N(i))},onSaveHandler:i=>{v.trackBillPayMagicLinkSubmitBankAccountDetails(o),e($(i,"standard",n,o))},onACHDetailsUpdated:i=>{const{bankAccountSection:l}=i;e(L({data:l}))}}})(re);function z(){const e=g(),{vendorId:t,billId:n}=w();return t==null||n==null?a.jsx(b,{}):a.jsx(a.Fragment,{children:a.jsx(Ie,{windowSize:e,children:a.jsx(je,{vendorId:t,billId:n})})})}const $e=c.div`
11
11
  display: flex;
12
12
  height: 100vh;
13
13
  width: 100%;
@@ -15,8 +15,8 @@ import{j as a}from"./liveblocks-n5yWztsO.js";import{l as b,k as x,j,u as y,h as
15
15
  flex-direction: column;
16
16
  align-items: center;
17
17
  background-color: ${e=>e.theme.colors.grey4};
18
- box-shadow: ${e=>`0px 2px ${d.sp1} ${e.theme.colors.dropShadowNormal}`};
19
- `,Ce=x(function(e,t){const{isSubPage:n}=t;return{addressToEdit:C(e),googleAPIKey:E.googleMapsAPIKey,isSubPage:n}},function(e,t){const{navigate:n,location:o}=t,i=()=>{const l=ce(o.state?.pathnameStackToGoBack),s=l.poppedPathname??De();n(s,{state:{pathnameStackToGoBack:l.newStack}})};return{onSubmitHandler:l=>{const s=Ae(l);e(ne({addressToCreate:s})),i()},onCancel:()=>{i()}}})(re);function Be({isSubPage:e}){const t=j(),n=y(),o=g();return a.jsx(a.Fragment,{children:a.jsx($e,{windowSize:o,children:a.jsx(Ce,{location:n,navigate:t,isSubPage:e===!0,googleAPIKey:E.googleMapsAPIKey})})})}const De=(e=2)=>{let t="../";for(let n=0;n<e;n++)t=`${t}../`;return t},Ae=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}),Pe=c.div`
18
+ box-shadow: ${e=>`0px 2px ${r.sp1} ${e.theme.colors.dropShadowNormal}`};
19
+ `,Ce=x(function(e,t){const{isSubPage:n}=t;return{addressToEdit:C(e),googleAPIKey:E.googleMapsAPIKey,isSubPage:n}},function(e,t){const{navigate:n,location:o}=t,i=()=>{const l=ce(o.state?.pathnameStackToGoBack),s=l.poppedPathname??Be();n(s,{state:{pathnameStackToGoBack:l.newStack}})};return{onSubmitHandler:l=>{const s=Ae(l);e(ne({addressToCreate:s})),i()},onCancel:()=>{i()}}})(de);function De({isSubPage:e}){const t=j(),n=y(),o=g();return a.jsx(a.Fragment,{children:a.jsx($e,{windowSize:o,children:a.jsx(Ce,{location:n,navigate:t,isSubPage:e===!0,googleAPIKey:E.googleMapsAPIKey})})})}const Be=(e=2)=>{let t="../";for(let n=0;n<e;n++)t=`${t}../`;return t},Ae=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}),Pe=c.div`
20
20
  display: flex;
21
21
  height: 100%;
22
22
  width: 100%;
@@ -24,8 +24,8 @@ import{j as a}from"./liveblocks-n5yWztsO.js";import{l as b,k as x,j,u as y,h as
24
24
  flex-direction: column;
25
25
  align-items: center;
26
26
  background-color: ${e=>e.theme.colors.grey4};
27
- box-shadow: ${e=>`0px 2px ${d.sp1} ${e.theme.colors.dropShadowNormal}`};
28
- `,ze=x(function(e){const t=S(e),n=k(e),o=C(e),{companyName:i}=t;return{companyName:i,isDisabled:t.fetchState!=="Completed"?"disabled":void 0,magicLinkBankAccountDetails:n,mailingAddressDetails:o,magicLinkViewState:t}},function(e,t){const{navigate:n,location:o,vendorId:i,billId:l}=t;return{onFetchBankName:s=>{e(N(s))},onSaveHandler:s=>{v.trackBillPayMagicLinkSubmitBankAccountDetails(l),e($(s,"us-domestic",i,l))},onWireDetailsUpdated:s=>{const{bankAccountSection:r}=s;e(L({data:r}))},onAddressClick:()=>{const s=o.pathname.replace("us-domestic","address"),r=F(o.state?.pathnameStackToGoBack,o.pathname);n(s,{state:{pathnameStackToGoBack:r}})}}})(me);function Le(){const e=j(),t=y(),n=g(),{vendorId:o,billId:i}=b();return o==null||i==null?a.jsx(f,{}):a.jsx(a.Fragment,{children:a.jsx(Pe,{windowSize:n,children:a.jsx(ze,{location:t,navigate:e,vendorId:o,billId:i})})})}const Ne=c.div`
27
+ box-shadow: ${e=>`0px 2px ${r.sp1} ${e.theme.colors.dropShadowNormal}`};
28
+ `,ze=x(function(e){const t=S(e),n=k(e),o=C(e),{companyName:i}=t;return{companyName:i,isDisabled:t.fetchState!=="Completed"?"disabled":void 0,magicLinkBankAccountDetails:n,mailingAddressDetails:o,magicLinkViewState:t}},function(e,t){const{navigate:n,location:o,vendorId:i,billId:l}=t;return{onFetchBankName:s=>{e(N(s))},onSaveHandler:s=>{v.trackBillPayMagicLinkSubmitBankAccountDetails(l),e($(s,"us-domestic",i,l))},onWireDetailsUpdated:s=>{const{bankAccountSection:d}=s;e(L({data:d}))},onAddressClick:()=>{const s=o.pathname.replace("us-domestic","address"),d=F(o.state?.pathnameStackToGoBack,o.pathname);n(s,{state:{pathnameStackToGoBack:d}})}}})(me);function Le(){const e=j(),t=y(),n=g(),{vendorId:o,billId:i}=w();return o==null||i==null?a.jsx(b,{}):a.jsx(a.Fragment,{children:a.jsx(Pe,{windowSize:n,children:a.jsx(ze,{location:t,navigate:e,vendorId:o,billId:i})})})}const Ne=c.div`
29
29
  display: flex;
30
30
  height: 100%;
31
31
  width: 100%;
@@ -33,13 +33,13 @@ import{j as a}from"./liveblocks-n5yWztsO.js";import{l as b,k as x,j,u as y,h as
33
33
  flex-direction: column;
34
34
  align-items: center;
35
35
  background-color: ${e=>e.theme.colors.grey4};
36
- box-shadow: ${e=>`0px 2px ${d.sp1} ${e.theme.colors.dropShadowNormal}`};
37
- `,Ee=x(function(e){const t=S(e),n=k(e),o=C(e),{companyName:i}=t;return{companyName:i,isDisabled:t.fetchState!=="Completed"?"disabled":void 0,magicLinkBankAccountDetails:n,mailingAddressDetails:o,magicLinkViewState:t}},function(e,t){const{navigate:n,location:o,vendorId:i,billId:l}=t;return{onFetchBankNameBySwift:s=>{e(ie(s))},onSaveHandler:s=>{v.trackBillPayMagicLinkSubmitBankAccountDetails(l),e($(s,"international",i,l,t.isLocalCurrencyEnabled))},onBankDetailsUpdated:s=>{const{internationalWireSwiftAccountSection:r}=s;e(oe({data:r}))},onAddressClick:()=>{const s=o.pathname.replace("international","address"),r=F(o.state?.pathnameStackToGoBack,o.pathname);n(s,{state:{pathnameStackToGoBack:r}})}}})(he);function Fe(){const e=j(),t=y(),n=g(),{vendorId:o,billId:i}=b(),{useFeatureGate:l}=pe(),{isFeatureEnabled:s}=l(ue.isBillPayLocalCurrencyFeatureEnabled);return o==null||i==null?a.jsx(f,{}):a.jsx(Ne,{windowSize:n,children:a.jsx(Ee,{location:t,navigate:e,vendorId:o,billId:i,isLocalCurrencyEnabled:s})})}const Te={containerWidth:new ke(100,58)},Ge=c(ye)`
38
- width: ${d.sp4};
39
- height: ${d.sp4};
40
- margin-bottom: ${d.sp3};
41
- margin-top: ${d.sp3};
42
- margin-left: ${d.sp8};
36
+ box-shadow: ${e=>`0px 2px ${r.sp1} ${e.theme.colors.dropShadowNormal}`};
37
+ `,Ee=x(function(e){const t=S(e),n=k(e),o=C(e),{companyName:i}=t;return{companyName:i,isDisabled:t.fetchState!=="Completed"?"disabled":void 0,magicLinkBankAccountDetails:n,mailingAddressDetails:o,magicLinkViewState:t}},function(e,t){const{navigate:n,location:o,vendorId:i,billId:l}=t;return{onFetchBankNameBySwift:s=>{e(ie(s))},onSaveHandler:s=>{v.trackBillPayMagicLinkSubmitBankAccountDetails(l),e($(s,"international",i,l,t.isLocalCurrencyEnabled))},onBankDetailsUpdated:s=>{const{internationalWireSwiftAccountSection:d}=s;e(oe({data:d}))},onAddressClick:()=>{const s=o.pathname.replace("international","address"),d=F(o.state?.pathnameStackToGoBack,o.pathname);n(s,{state:{pathnameStackToGoBack:d}})}}})(he);function Fe(){const e=j(),t=y(),n=g(),{vendorId:o,billId:i}=w(),{useFeatureGate:l}=pe(),{isFeatureEnabled:s}=l(ue.isBillPayLocalCurrencyFeatureEnabled);return o==null||i==null?a.jsx(b,{}):a.jsx(Ne,{windowSize:n,children:a.jsx(Ee,{location:t,navigate:e,vendorId:o,billId:i,isLocalCurrencyEnabled:s})})}const Te={containerWidth:new ke(100,58)},Ge=c(ye)`
38
+ width: ${r.sp4};
39
+ height: ${r.sp4};
40
+ margin-bottom: ${r.sp3};
41
+ margin-top: ${r.sp3};
42
+ margin-left: ${r.sp8};
43
43
  cursor: pointer;
44
44
  position: absolute;
45
45
  color: ${e=>e.theme.colors.brandColorJade};
@@ -56,17 +56,17 @@ import{j as a}from"./liveblocks-n5yWztsO.js";import{l as b,k as x,j,u as y,h as
56
56
  flex-direction: column;
57
57
  width: ${e=>`${Te.containerWidth.value(e.windowSize)}%`};
58
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"};
59
+ box-shadow: ${e=>`0px 2px ${r.sp1} ${e.theme.colors.dropShadowNormal}`};
60
+ padding-top: ${e=>e.windowSize!=="small"?r.sp2:"0px"};
61
61
  `,Me=c.div`
62
62
  display: flex;
63
63
  flex-direction: column;
64
64
  align-items: center;
65
65
  justify-content: center;
66
- padding: ${e=>e.windowSize==="small"?d.sp3:`62px ${d.sp6} ${d.sp9} ${d.sp8}`};
66
+ padding: ${e=>e.windowSize==="small"?r.sp3:`62px ${r.sp6} ${r.sp9} ${r.sp8}`};
67
67
  height: ${e=>e.windowSize==="small"?"490px":"auto"};
68
68
  overflow: ${e=>e.windowSize==="small"?"unset":"hidden"};
69
69
  width: ${e=>e.windowSize=="small"?"auto":"42%"};
70
70
  background-color: ${e=>e.windowSize==="small"?e.theme.colors.grey4:e.theme.colors.background};
71
71
  margin-top: ${e=>e.windowSize==="small"?e.isAddressPage?"0px":"186px":"unset"};
72
- `,Ve=x(function(e,t){return{file:t.file,type:t.type}})(Se);function h({appContent:e}){const t=Y(),n=y(),{tenantEmailDomain:o,vendorId:i,billId:l}=b(),[s]=ee(),r=s.get("token"),T=n.pathname.includes("address"),w=g(),G=xe(),B=ge(),H=()=>{G.toggle()},K=A(u=>S(u)),M=A(u=>k(u)),{authParams:V,fetchState:m,billAttachment:O,billFetchState:D,companyName:U,currencySymbol:_,amount:W}=K,{tenantId:q,userId:J,sessionId:R}=V,{fetchState:Z,internationalBankAccountCreateStatus:Q}=M;return P.useEffect(()=>{I(),m==="Not-Started"&&i!=null&&o!=null&&r!=null&&t(se(i,o,r))},[]),P.useEffect(()=>{m==="Completed"&&(I(J,R,q),l!=null&&t(le(l)))},[m]),m==="Error"?a.jsx(f,{}):Z==="Completed"||Q.fetchState==="Completed"?(I(),a.jsx(ae,{to:"../../../../../../../bank/account/save/success",replace:!0,relative:"path"})):m==="In-Progress"?a.jsx(fe,{fetchState:m,style:{height:"100vh",backgroundColor:B.colors.grey5,boxShadow:`0px 2px ${d.sp1} ${B.colors.dropShadowNormal}`}}):a.jsxs(a.Fragment,{children:[m==="Completed"&&D==="Completed"&&a.jsx(we,{analytics:v,onLoad:u=>(X=>X.trackBillPayMagicLinkPageLoad(o??"",i??"",U,l??"",Oe(n.pathname),_,W))(u)}),a.jsxs(He,{windowSize:w,children:[w!=="small"?a.jsx(Ge,{onClick:H}):null,a.jsx(Me,{windowSize:w,isAddressPage:T,children:D==="In-Progress"?a.jsx(be,{size:"ExtraLarge",start:!0}):a.jsx(Ve,{file:O,type:"bill"})}),a.jsx(Ke,{windowSize:w,children:e})]})]})}const Oe=e=>`${e.split("/").at(-2)}_${e.split("/").at(-1)}`;function Ue(){return a.jsx(ve,{})}function la(){return a.jsxs(te,{children:[a.jsx(p,{path:"bank/account/save/success",element:a.jsx(Ue,{})}),a.jsx(p,{path:":tenantEmailDomain/vendor/:vendorId/bill/:billId/ach/standard",element:a.jsx(h,{appContent:a.jsx(z,{})})}),a.jsx(p,{path:":tenantEmailDomain/vendor/:vendorId/bill/:billId/ach/same-day",element:a.jsx(h,{appContent:a.jsx(z,{})})}),a.jsx(p,{path:":tenantEmailDomain/vendor/:vendorId/bill/:billId/wire/address",element:a.jsx(h,{appContent:a.jsx(Be,{isSubPage:!0})})}),a.jsx(p,{path:":tenantEmailDomain/vendor/:vendorId/bill/:billId/wire/us-domestic",element:a.jsx(h,{appContent:a.jsx(Le,{})})}),a.jsx(p,{path:":tenantEmailDomain/vendor/:vendorId/bill/:billId/wire/international",element:a.jsx(h,{appContent:a.jsx(Fe,{})})}),a.jsx(p,{path:"*",element:a.jsx(f,{})})]})}export{la as default};
72
+ `,Ve=x(function(e,t){return{file:t.file,type:t.type}})(Se);function h({appContent:e}){const t=Y(),n=y(),{tenantEmailDomain:o,vendorId:i,billId:l}=w(),[s]=ee(),d=s.get("token"),T=n.pathname.includes("address"),f=g(),G=xe(),D=ge(),H=()=>{G.toggle()},K=A(u=>S(u)),M=A(u=>k(u)),{authParams:V,fetchState:m,billAttachment:U,billFetchState:B,companyName:W,currencySymbol:_,amount:O}=K,{tenantId:J,userId:R,sessionId:q}=V,{fetchState:Z,internationalBankAccountCreateStatus:Q}=M;return P.useEffect(()=>{I(),m==="Not-Started"&&i!=null&&o!=null&&d!=null&&t(se(i,o,d))},[]),P.useEffect(()=>{m==="Completed"&&(I(R,q,J),l!=null&&t(le(l)))},[m]),m==="Error"?a.jsx(b,{}):Z==="Completed"||Q.fetchState==="Completed"?(I(),a.jsx(ae,{to:"../../../../../../../bank/account/save/success",replace:!0,relative:"path"})):m==="In-Progress"?a.jsx(be,{fetchState:m,style:{height:"100vh",backgroundColor:D.colors.grey5,boxShadow:`0px 2px ${r.sp1} ${D.colors.dropShadowNormal}`}}):a.jsxs(a.Fragment,{children:[m==="Completed"&&B==="Completed"&&a.jsx(fe,{analytics:v,onLoad:u=>(X=>X.trackBillPayMagicLinkPageLoad(o??"",i??"",W,l??"",Ue(n.pathname),_,O))(u)}),a.jsxs(He,{windowSize:f,children:[f!=="small"?a.jsx(Ge,{onClick:H}):null,a.jsx(Me,{windowSize:f,isAddressPage:T,children:B==="In-Progress"?a.jsx(we,{size:"ExtraLarge",start:!0}):a.jsx(Ve,{file:U,type:"bill"})}),a.jsx(Ke,{windowSize:f,children:e})]})]})}const Ue=e=>`${e.split("/").at(-2)}_${e.split("/").at(-1)}`;function We(){return a.jsx(ve,{})}function la(){return a.jsxs(te,{children:[a.jsx(p,{path:"bank/account/save/success",element:a.jsx(We,{})}),a.jsx(p,{path:":tenantEmailDomain/vendor/:vendorId/bill/:billId/ach/standard",element:a.jsx(h,{appContent:a.jsx(z,{})})}),a.jsx(p,{path:":tenantEmailDomain/vendor/:vendorId/bill/:billId/ach/same-day",element:a.jsx(h,{appContent:a.jsx(z,{})})}),a.jsx(p,{path:":tenantEmailDomain/vendor/:vendorId/bill/:billId/wire/address",element:a.jsx(h,{appContent:a.jsx(De,{isSubPage:!0})})}),a.jsx(p,{path:":tenantEmailDomain/vendor/:vendorId/bill/:billId/wire/us-domestic",element:a.jsx(h,{appContent:a.jsx(Le,{})})}),a.jsx(p,{path:":tenantEmailDomain/vendor/:vendorId/bill/:billId/wire/international",element:a.jsx(h,{appContent:a.jsx(Fe,{})})}),a.jsx(p,{path:"*",element:a.jsx(b,{})})]})}export{la as default};
@@ -0,0 +1,12 @@
1
+ import{j as u}from"./liveblocks-BPC8B-82.js";import{a as f}from"./sentry-CWaXw80H.js";import{h as O,u as _,j as w,q as M,g as l,N as T}from"./core-D5Hit8x-.js";import{z as r,h as P,D as V,f as A,e as N,g as q,q as H,T as R,i as W}from"./index-C7yI3-qS.js";import{eN as $,Ij as B,It as G,Ik as J,eO as K,fi as Q,Ip as X,fH as Y,cS as Z,Iu as ee,Iv as te}from"./zeni-epic-state-CVuyWhoX.js";import{n as ne}from"./mui-DW04nVBh.js";import{u as se}from"./useDeviceId-CgooY8pH.js";import{f as ie}from"./analyticsHelper-DPM8WM8o.js";import{t as ae}from"./getLocaleForTenant-BDiDnhsV.js";import"./recharts-BAxVJ6il.js";import"./analytics-DaGIvUkL.js";import"./plaid-BnTbuxYK.js";import"./dnd-BWi02USV.js";import"./stripe-DMRn4zHo.js";import"./lottie-CgXU1WMN.js";import"./lexical-yXjK_sjC.js";import"./pdf-D6P4p3u8.js";import"./utils-DjtfEx4B.js";(function(){try{var t=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},i=new t.Error().stack;i&&(t._sentryDebugIds=t._sentryDebugIds||{},t._sentryDebugIds[i]="b9f72397-7414-42b2-a7cc-5bef1d82a2c6",t._sentryDebugIdIdentifier="sentry-dbid-b9f72397-7414-42b2-a7cc-5bef1d82a2c6")}catch{}})();const C=(t,i)=>t!=null&&t.length>0&&i==="magic_links";function Ce(){const t=O(),i=_(),m=w(),[k]=M(),n=k.get("token"),p=k.get("stytch_token_type"),g=r.getMagicLinkCodeVerifier(),a=se(),{otpChallenge:d,twoFAPhoneNumber:D,magicLinkEmail:c,verifyDeviceFetchState:x,resendVerifyDeviceOTPFetchState:z}=l(e=>e.tenantState),I=l(e=>e.tenantState.fetchState),y=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)),b=l(e=>B(e)),E=r.getSignedInUser(),v=P().mode;f.useEffect(()=>{s?.zeniSessionId==null&&n!=null&&C(n,p)&&a!=null&&g!=null&&(r.saveMagicLinkTriggered(n),t(G(n,a,g)))},[n,p,t,a,g,s?.zeniSessionId]),f.useEffect(()=>{S!=="In-Progress"||I!=="Completed"&&y!=="Completed"||s?.zeniSessionId==null||o==null||(n!=null&&r.saveLastUsedMagicLinkToken(n),r.saveSignedInUserWithSession(s,s.zeniSessionId),r.saveSignedInUserTenants(J(b.tenantsInOrder),s.zeniSessionId),K(s.userId,s.zeniSessionId,o.tenantId),t(Q(o.tenantId)),r.saveActiveTenantDomainForUser(o.tenantEmailDomain),t(X("Completed")),V.updateAppLocaleID(ae(o)),ie(s,o,v,void 0,b.tenantsInOrder),Y().then(()=>{const e=W();e!=null&&A(e)}),setTimeout(()=>{N.trackLogin(q.Event.loginSuccess,"email",Z(o.productSettings))},2e3))},[S,I,y,s,o,b,v,i.state,t]);const j=f.useCallback(()=>{m("/signin/auth")},[m]),U=f.useCallback(()=>{a!=null&&d!=null&&c!=null&&t(ee(a,c,d))},[a,d,t,c]),F=f.useCallback(e=>{a!=null&&n!=null&&c!=null&&d!=null&&t(te(e,a,c,d))},[a,n,t,c,d]);if(h==="Completed"&&d!=null)return u.jsx(H,{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=i.state?.origin??"/";return u.jsx(T,{to:e,state:{...i.state,origin:""}})}if(!C(n,p)||g==null||h==="Error"){const e=i.state?.origin??"/",L=n!=null&&r.getLastUsedMagicLinkToken()===n;return u.jsx(T,{to:e,state:{...i.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};
@@ -1 +1 @@
1
- import{j as U}from"./liveblocks-n5yWztsO.js";import{a as c}from"./sentry-BKXoW7cS.js";import{h as pe,g as t,l as We,u as Xe,j as qe,i as M}from"./core-DD1dfJeB.js";import{eN as he,eU as Je,eV as Se,eP as Ke,bn as Qe,f3 as ea,eW as aa,eX as ta,eZ as na,f1 as sa,fb as oa,f2 as g,f5 as ia,f6 as ue,f9 as ra,f7 as da,f8 as la,fa as ca,cH as ua,fd as ma,cN as fa,bv as ba,eM as pa,fi as ha,fj as Sa,fh as ga}from"./zeni-epic-state-EPc5wQ9y.js";import{a1 as Ea,a2 as ka,w as Ca,a as ya,z as k,a3 as Ia,u as Ta,d as r,a4 as wa,a5 as Aa,A as Fa,c as _a,a6 as Da,X as va,a7 as $a,a8 as Ba,a9 as me,aa as fe,L as Ga,ab as Pa,ac as be,e as R,r as A,ad as N,ae as Ma}from"./index-BkSp81D-.js";import{D as Ra}from"./mui-BTXLmTm-.js";(function(){try{var m=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},d=new m.Error().stack;d&&(m._sentryDebugIds=m._sentryDebugIds||{},m._sentryDebugIds[d]="d15411f0-aac0-4e08-ba3b-71c9e53451ed",m._sentryDebugIdIdentifier="sentry-dbid-d15411f0-aac0-4e08-ba3b-71c9e53451ed")}catch{}})();const Na=Ea(({isAppContentDrawerOpen:m,handleDrawerToggle:d})=>{const{tenantEmailDomain:n}=We(),a=Xe(),C=Ca(),o=qe(),V=Ke(),f=pe(),{useFeatureGate:i}=ya(),x=k.getSignedInUser(),F=Qe(x),s=t(e=>he(e)),j=t(e=>ea(e)),L=j.uiState.currentChatSessionId,y=Ia(),{setLoading:ge}=Ta(),[_,O]=c.useState(void 0),D=M("/:tenantEmailDomain/dashboard")!==null,z=M("/:tenantEmailDomain/reports")!==null,I=M("/:tenantEmailDomain/onboarding/*")!==null,{isFeatureEnabled:H}=i(r.isDepositAccountsFeatureEnabled),{isFeatureEnabled:Ee}=i(r.isChargeCardFeatureEnabled),{isFeatureEnabled:Y}=i(r.isDebitCardFeatureEnabled),ke=wa(s,Ee,Y),{isFeatureEnabled:Ce}=i(r.isSettingsFeatureEnabled),Z=t(e=>aa(e)),{isFeatureEnabled:T}=i(r.isReferralFeatureEnabled),v=t(e=>ta(e));c.useEffect(()=>{y&&T&&!I&&v.fetchState==="Not-Started"&&f(na(!0))},[y,T,v.fetchState,I]);const h=k.getSignedInUser(),$=t(e=>e.tenantState),ye=t(e=>$.fetchState==="Completed"?sa(e):[]),E=t(e=>e.expenseAutomationViewState.selectedPeriodByTenantId),{isFeatureEnabled:Ie}=i(r.isApAgingFeatureEnabled),{isFeatureEnabled:Te}=i(r.isArAgingFeatureEnabled),{isFeatureEnabled:W}=i(r.isExpenseAutomationEnabled),{isFeatureEnabled:X}=i(r.isExpenseAutomationEnabledV2),q=X||W&&F,{isFeatureEnabled:we}=i(r.isDashboardSidebarHalloweenAnimationEnabled),{isFeatureEnabled:Ae}=i(r.isDashboardSidebarThanksGivingAnimationEnabled),{isFeatureEnabled:Fe}=i(r.isDashboardSidebarChristmasAnimationEnabled),{isFeatureEnabled:_e}=i(r.isDashboardSidebarNewYearAnimationEnabled),{isFeatureEnabled:De}=i(r.isTreasuryEnabled),{isFeatureEnabled:ve}=i(r.isTaskManagerCustomerUserAccessEnabled),$e=F||!F&&ve,Be=s.company!=null&&oa(s.company),w=De&&Be,Ge=t(e=>g(e).totalUnreadCount),Pe=t(e=>g(e).reducedFetchCountState),J=t(e=>g(e).notificationDetailsByTab.tasks.uiState.unreadCount),K=t(e=>g(e).notificationDetailsByTab.comments.uiState.unreadCount),Me=t(e=>g(e).notificationDetailsByTab.tasks.fetchCountState),B=t(e=>g(e).notificationDetailsByTab.comments.fetchCountState),{inboxNotifications:Q,isLoading:ee,isFetchingMore:ae,hasFetchedAll:te,fetchMore:Re}=Aa();c.useEffect(()=>{const e=setTimeout(()=>Re?.(),0);return()=>clearTimeout(e)}),c.useEffect(()=>{if(ee===!1&&ae===!1&&te===!0)if(s?.companyId!=null&&Q!=null){const e=`dashboard_${s.companyId}`;O(Q.filter(u=>u.roomId===e&&u.readAt==null).length)}else O(0)},[ee,ae,te]),c.useEffect(()=>{y&&!I&&Me.fetchState==="Not-Started"&&V.tenantId!=null&&f(ia("task_manager","dashboard"))},[y,V.tenantId]),c.useEffect(()=>{I||B.fetchState!=="Not-Started"||f(ue({fetchCountState:{fetchState:"In-Progress",error:void 0}},"comments"))},[]),c.useEffect(()=>{_!=null&&B.fetchState==="In-Progress"&&(f(ue({fetchCountState:{fetchState:"Completed",error:void 0}},"comments")),f(Se({unreadCount:_},"comments")))},[_,B.fetchState]);const Ne={fetchStatus:Pe,count:Ge},ne=n!=null?k.getSignedInUserTenant(n):null,se=t(e=>ne?.tenantId!=null?ra(e,ne.tenantId):void 0),S=[];Ie===!1&&S.push("accounts_payable_aging"),Te===!1&&S.push("accounts_receivable_aging"),H===!1&&S.push("zeni_accounts_promo_card"),T===!1&&S.push("rewards_card"),q===!1&&S.push("expense_automation_card");const Ue=Fa(),oe=t(e=>da(e,S,h,X,W,w).fetchState),ie=t(e=>la(e).fetchState),Ve=D&&(oe==="Completed"||oe==="Error")||z&&(ie==="Completed"||ie==="Error")||!D&&!z?void 0:"disabled",xe=c.useMemo(()=>ca(s.userRole),[s.userRole]),je=ua(xe),Le=s?.rewardsLastViewedTime==null,Oe=h?.userEmail!=null&&Z.fetchState==="Completed"&&ma(Z.notificationSettings,h.userEmail,Y,s),re=_a(),ze=re&&Da(a),de=fa(Ue?.loggedInUserRoleMap),le=s.companyTreasuryInfo?.info?.isTreasuryTOSAccepted,G=c.useCallback(()=>w&&de&&!k.getTreasuryPopupSeen(n??"")&&le===!1&&va(a.pathname)!=="treasury",[w,de,le,a.pathname,n]),[He,ce]=c.useState(G);c.useEffect(()=>{ce(G())},[G]);const Ye=t(e=>e.treasurySetupViewState.treasuryFundsDetails).fundsDetails,Ze=$a(Ye);return U.jsx(Ra,{container:window.document.body,variant:"temporary",open:m,onClose:()=>d(!1),PaperProps:{sx:{width:240,zIndex:8,borderRight:"none",backgroundImage:"none"}},ModalProps:{keepMounted:!0},children:U.jsx(Ba,{signedInUser:x,currentTenantId:$.currentTenantId??"",tenants:$.fetchState==="Completed"?ye:se!=null?[se]:[],currentTenant:s,isTenantDropdownDisabled:Ve,isSettings:fe(a),isSettingsFeatureEnabled:Ce,isVendorsTabVisible:je,isZeniAccountEnabled:H,isChargeCardEnabled:ke,isTreasuryEnabled:w,treasuryYieldPercentage:Ze,isTreasuryPopupVisible:He,isNotificationsTabVisible:Oe,notificationCountDetails:Ne,isExpenseAutomationEnabledForUser:q&&ba(s.userRole)===!1,selectedMenu:me(a),rewardsConfiguration:{isRewardsTabVisible:T,isRewardsAnimated:Le,rewardsPlan:v.rewardsPlan},isAiCfoAccessEnabled:re,onNotificationIconClick:()=>{d(!1);let e=J===0&&K>0?"notifications/comments":"notifications/tasks";fe(a)&&(e=J===0&&K>0?"../../notifications/comments":"../../notifications/tasks");const u=A(a.state?.pathnameStackToGoBack,a.pathname);o(e,{state:{pathnameStackToGoBack:u}})},handleCockpitClick:()=>{window.open("/cockpit")},handleLogOutClick:()=>{d(!1);const e=A(a.state?.pathnameStackToGoBack,a.pathname);o("/signout",{replace:!0,state:{pathnameStackToGoBack:e,message:"logout"}})},handleMenuChange:e=>{if(d(!1),e.type==="ai_cfo"){const p=A(a.state?.pathnameStackToGoBack,a.pathname);return R.trackAICFOChatScreenStateChanged("viewed","left_menu",L??null,null),void o(`/${n}/ai-cfo/explore`,{state:{pathnameStackToGoBack:p,referrer:"Sidebar"}})}const u=A(a.state?.pathnameStackToGoBack,a.pathname),l=e.type,b=N(l)&&l!=="command_center";if(N(e.type)&&E[s.tenantId]!=null&&R.trackMonthEndCloseClicked(E[s.tenantId].month,E[s.tenantId].year,"Sidebar"),b&&E[s.tenantId]!=null){const p=E[s.tenantId];return void o(`/${n}/month_end_close_checks/review/${e.type}/${p.month}-${p.year}`,{state:{pathnameStackToGoBack:u,referrer:"Sidebar"}})}const P=Ma(e.type);be(e.type)?(L!=null&&f(ga()),o(`/${n}/ai-cfo/${e.type}`,{state:{pathnameStackToGoBack:u.slice(0,-1),referrer:"Sidebar"}})):o(`/${n}/${P}`,{state:{pathnameStackToGoBack:u,referrer:"Sidebar"}})},handleMyProfileClick:()=>{d(!1),o(`/${n}/settings/my_profile`)},handleReferralsClick:()=>{d(!1),o(`/${n}/rewards`)},handleBackClick:()=>{o(`/${n}/dashboard`)},handleTenantSelect:e=>{ge(Ga.TENANT_SWITCHING),d(!1);const u=e.tenantEmailDomain,l=me(a);let b=`/${encodeURIComponent(u)}/`;const P=N(l);l==="home"?b+="dashboard":l==="users_and_roles"?b+="people":Pa(l)?b+="settings/my_profile":be(l)?b+=`ai-cfo/${l}`:b+=l==="task_checklist"?"tasks":P?"month_end_close_checks/review":encodeURIComponent(l),o(b,{replace:!0}),h!=null&&(f(ha(e.tenantId)),f(Sa(h.userId,e.tenantId,h.zeniSessionId)));const p=e;R.trackCompanySwitch(p.companyId,p.companyName,p.userRole)},handlePopupClose:()=>{k.saveTreasuryPopupSeen(n??"",!0),ce(!1)},onZeniLogoClick:()=>{C.toggle()},isAiCfo:ze,aiCfoView:j,isOnDashboard:D,updateCurrentChatSessionId:e=>{f(pa({sessionId:e,agentId:"controller"})),o(`/${n}/ai-cfo/${e}`,{state:{...a.state}})},halloweenAnimationEnabled:we,isTaskManagerAccessEnabled:$e,thanksGivingAnimationEnabled:Ae,christmasAnimationEnabled:Fe,newYearAnimationEnabled:_e})})}),za=m=>{const d=pe(),n=t(C=>he(C)),a={events:n.userRoleId!=null?[`private-${n.userRoleId}.dashboard-user-notification`]:[],eventCallback:(C,o)=>{ka(o)&&Je(o.mode)==="dashboard"&&d(Se({unreadCount:o.data.unread},"tasks"))}};return U.jsx(Na,{...m,...a})};export{za as M};
1
+ import{j as V}from"./liveblocks-BPC8B-82.js";import{a as c}from"./sentry-CWaXw80H.js";import{h as pe,g as t,l as We,u as Xe,j as qe,i as M}from"./core-D5Hit8x-.js";import{eN as he,eU as Je,eV as Se,eP as Ke,bn as Qe,f3 as ea,eW as aa,eX as ta,eZ as na,f1 as sa,fb as oa,f2 as g,f5 as ia,f6 as ue,f9 as ra,f7 as da,f8 as la,fa as ca,cH as ua,fd as fa,cN as ma,bv as ba,eM as pa,fi as ha,fj as Sa,fh as ga}from"./zeni-epic-state-CVuyWhoX.js";import{a1 as Ea,a2 as ka,x as Ca,a as ya,z as k,a3 as Ia,u as Ta,d as r,a4 as wa,a5 as Aa,A as Fa,c as _a,a6 as Da,V as va,a7 as $a,a8 as Ba,a9 as fe,aa as me,L as Ga,ab as xa,ac as be,e as R,r as A,ad as N,ae as Ma}from"./index-C7yI3-qS.js";import{D as Ra}from"./mui-DW04nVBh.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]="e8b7d7f1-1bbf-4bda-846d-c471f779a21d",f._sentryDebugIdIdentifier="sentry-dbid-e8b7d7f1-1bbf-4bda-846d-c471f779a21d")}catch{}})();const Na=Ea(({isAppContentDrawerOpen:f,handleDrawerToggle:d})=>{const{tenantEmailDomain:n}=We(),a=Xe(),C=Ca(),o=qe(),U=Ke(),m=pe(),{useFeatureGate:i}=ya(),P=k.getSignedInUser(),F=Qe(P),s=t(e=>he(e)),j=t(e=>ea(e)),L=j.uiState.currentChatSessionId,y=Ia(),{setLoading:ge}=Ta(),[_,O]=c.useState(void 0),D=M("/:tenantEmailDomain/dashboard")!==null,z=M("/:tenantEmailDomain/reports")!==null,I=M("/:tenantEmailDomain/onboarding/*")!==null,{isFeatureEnabled:H}=i(r.isDepositAccountsFeatureEnabled),{isFeatureEnabled:Ee}=i(r.isChargeCardFeatureEnabled),{isFeatureEnabled:Y}=i(r.isDebitCardFeatureEnabled),ke=wa(s,Ee,Y),{isFeatureEnabled:Ce}=i(r.isSettingsFeatureEnabled),Z=t(e=>aa(e)),{isFeatureEnabled:T}=i(r.isReferralFeatureEnabled),v=t(e=>ta(e));c.useEffect(()=>{y&&T&&!I&&v.fetchState==="Not-Started"&&m(na(!0))},[y,T,v.fetchState,I]);const h=k.getSignedInUser(),$=t(e=>e.tenantState),ye=t(e=>$.fetchState==="Completed"?sa(e):[]),E=t(e=>e.expenseAutomationViewState.selectedPeriodByTenantId),{isFeatureEnabled:Ie}=i(r.isApAgingFeatureEnabled),{isFeatureEnabled:Te}=i(r.isArAgingFeatureEnabled),{isFeatureEnabled:W}=i(r.isExpenseAutomationEnabled),{isFeatureEnabled:X}=i(r.isExpenseAutomationEnabledV2),q=X||W&&F,{isFeatureEnabled:we}=i(r.isDashboardSidebarHalloweenAnimationEnabled),{isFeatureEnabled:Ae}=i(r.isDashboardSidebarThanksGivingAnimationEnabled),{isFeatureEnabled:Fe}=i(r.isDashboardSidebarChristmasAnimationEnabled),{isFeatureEnabled:_e}=i(r.isDashboardSidebarNewYearAnimationEnabled),{isFeatureEnabled:De}=i(r.isTreasuryEnabled),{isFeatureEnabled:ve}=i(r.isTaskManagerCustomerUserAccessEnabled),$e=F||!F&&ve,Be=s.company!=null&&oa(s.company),w=De&&Be,Ge=t(e=>g(e).totalUnreadCount),xe=t(e=>g(e).reducedFetchCountState),J=t(e=>g(e).notificationDetailsByTab.tasks.uiState.unreadCount),K=t(e=>g(e).notificationDetailsByTab.comments.uiState.unreadCount),Me=t(e=>g(e).notificationDetailsByTab.tasks.fetchCountState),B=t(e=>g(e).notificationDetailsByTab.comments.fetchCountState),{inboxNotifications:Q,isLoading:ee,isFetchingMore:ae,hasFetchedAll:te,fetchMore:Re}=Aa();c.useEffect(()=>{const e=setTimeout(()=>Re?.(),0);return()=>clearTimeout(e)}),c.useEffect(()=>{if(ee===!1&&ae===!1&&te===!0)if(s?.companyId!=null&&Q!=null){const e=`dashboard_${s.companyId}`;O(Q.filter(u=>u.roomId===e&&u.readAt==null).length)}else O(0)},[ee,ae,te]),c.useEffect(()=>{y&&!I&&Me.fetchState==="Not-Started"&&U.tenantId!=null&&m(ia("task_manager","dashboard"))},[y,U.tenantId]),c.useEffect(()=>{I||B.fetchState!=="Not-Started"||m(ue({fetchCountState:{fetchState:"In-Progress",error:void 0}},"comments"))},[]),c.useEffect(()=>{_!=null&&B.fetchState==="In-Progress"&&(m(ue({fetchCountState:{fetchState:"Completed",error:void 0}},"comments")),m(Se({unreadCount:_},"comments")))},[_,B.fetchState]);const Ne={fetchStatus:xe,count:Ge},ne=n!=null?k.getSignedInUserTenant(n):null,se=t(e=>ne?.tenantId!=null?ra(e,ne.tenantId):void 0),S=[];Ie===!1&&S.push("accounts_payable_aging"),Te===!1&&S.push("accounts_receivable_aging"),H===!1&&S.push("zeni_accounts_promo_card"),T===!1&&S.push("rewards_card"),q===!1&&S.push("expense_automation_card");const Ve=Fa(),oe=t(e=>da(e,S,h,X,W,w).fetchState),ie=t(e=>la(e).fetchState),Ue=D&&(oe==="Completed"||oe==="Error")||z&&(ie==="Completed"||ie==="Error")||!D&&!z?void 0:"disabled",Pe=c.useMemo(()=>ca(s.userRole),[s.userRole]),je=ua(Pe),Le=s?.rewardsLastViewedTime==null,Oe=h?.userEmail!=null&&Z.fetchState==="Completed"&&fa(Z.notificationSettings,h.userEmail,Y,s),re=_a(),ze=re&&Da(a),de=ma(Ve?.loggedInUserRoleMap),le=s.companyTreasuryInfo?.info?.isTreasuryTOSAccepted,G=c.useCallback(()=>w&&de&&!k.getTreasuryPopupSeen(n??"")&&le===!1&&va(a.pathname)!=="treasury",[w,de,le,a.pathname,n]),[He,ce]=c.useState(G);c.useEffect(()=>{ce(G())},[G]);const Ye=t(e=>e.treasurySetupViewState.treasuryFundsDetails).fundsDetails,Ze=$a(Ye);return V.jsx(Ra,{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:V.jsx(Ba,{signedInUser:P,currentTenantId:$.currentTenantId??"",tenants:$.fetchState==="Completed"?ye:se!=null?[se]:[],currentTenant:s,isTenantDropdownDisabled:Ue,isSettings:me(a),isSettingsFeatureEnabled:Ce,isVendorsTabVisible:je,isZeniAccountEnabled:H,isChargeCardEnabled:ke,isTreasuryEnabled:w,treasuryYieldPercentage:Ze,isTreasuryPopupVisible:He,isNotificationsTabVisible:Oe,notificationCountDetails:Ne,isExpenseAutomationEnabledForUser:q&&ba(s.userRole)===!1,selectedMenu:fe(a),rewardsConfiguration:{isRewardsTabVisible:T,isRewardsAnimated:Le,rewardsPlan:v.rewardsPlan},isAiCfoAccessEnabled:re,onNotificationIconClick:()=>{d(!1);let e=J===0&&K>0?"notifications/comments":"notifications/tasks";me(a)&&(e=J===0&&K>0?"../../notifications/comments":"../../notifications/tasks");const u=A(a.state?.pathnameStackToGoBack,a.pathname);o(e,{state:{pathnameStackToGoBack:u}})},handleCockpitClick:()=>{window.open("/cockpit")},handleLogOutClick:()=>{d(!1);const e=A(a.state?.pathnameStackToGoBack,a.pathname);o("/signout",{replace:!0,state:{pathnameStackToGoBack:e,message:"logout"}})},handleMenuChange:e=>{if(d(!1),e.type==="ai_cfo"){const p=A(a.state?.pathnameStackToGoBack,a.pathname);return R.trackAICFOChatScreenStateChanged("viewed","left_menu",L??null,null),void o(`/${n}/ai-cfo/explore`,{state:{pathnameStackToGoBack:p,referrer:"Sidebar"}})}const u=A(a.state?.pathnameStackToGoBack,a.pathname),l=e.type,b=N(l)&&l!=="command_center";if(N(e.type)&&E[s.tenantId]!=null&&R.trackMonthEndCloseClicked(E[s.tenantId].month,E[s.tenantId].year,"Sidebar"),b&&E[s.tenantId]!=null){const p=E[s.tenantId];return void o(`/${n}/month_end_close_checks/review/${e.type}/${p.month}-${p.year}`,{state:{pathnameStackToGoBack:u,referrer:"Sidebar"}})}const x=Ma(e.type);be(e.type)?(L!=null&&m(ga()),o(`/${n}/ai-cfo/${e.type}`,{state:{pathnameStackToGoBack:u.slice(0,-1),referrer:"Sidebar"}})):o(`/${n}/${x}`,{state:{pathnameStackToGoBack:u,referrer:"Sidebar"}})},handleMyProfileClick:()=>{d(!1),o(`/${n}/settings/my_profile`)},handleReferralsClick:()=>{d(!1),o(`/${n}/rewards`)},handleBackClick:()=>{o(`/${n}/dashboard`)},handleTenantSelect:e=>{ge(Ga.TENANT_SWITCHING),d(!1);const u=e.tenantEmailDomain,l=fe(a);let b=`/${encodeURIComponent(u)}/`;const x=N(l);l==="home"?b+="dashboard":l==="users_and_roles"?b+="people":xa(l)?b+="settings/my_profile":be(l)?b+=`ai-cfo/${l}`:b+=l==="task_checklist"?"tasks":x?"month_end_close_checks/review":encodeURIComponent(l),o(b,{replace:!0}),h!=null&&(m(ha(e.tenantId)),m(Sa(h.userId,e.tenantId,h.zeniSessionId)));const p=e;R.trackCompanySwitch(p.companyId,p.companyName,p.userRole)},handlePopupClose:()=>{k.saveTreasuryPopupSeen(n??"",!0),ce(!1)},onZeniLogoClick:()=>{C.toggle()},isAiCfo:ze,aiCfoView:j,isOnDashboard:D,updateCurrentChatSessionId:e=>{m(pa({sessionId:e,agentId:"controller"})),o(`/${n}/ai-cfo/${e}`,{state:{...a.state}})},halloweenAnimationEnabled:we,isTaskManagerAccessEnabled:$e,thanksGivingAnimationEnabled:Ae,christmasAnimationEnabled:Fe,newYearAnimationEnabled:_e})})}),za=f=>{const d=pe(),n=t(C=>he(C)),a={events:n.userRoleId!=null?[`private-${n.userRoleId}.dashboard-user-notification`]:[],eventCallback:(C,o)=>{ka(o)&&Je(o.mode)==="dashboard"&&d(Se({unreadCount:o.data.unread},"tasks"))}};return V.jsx(Na,{...f,...a})};export{za as M};
@@ -0,0 +1 @@
1
+ import{j as r}from"./liveblocks-BPC8B-82.js";import{j as e,k as i}from"./core-D5Hit8x-.js";import{R as n}from"./index-C7yI3-qS.js";import"./mui-DW04nVBh.js";import"./sentry-CWaXw80H.js";import"./zeni-epic-state-CVuyWhoX.js";import"./recharts-BAxVJ6il.js";import"./analytics-DaGIvUkL.js";import"./plaid-BnTbuxYK.js";import"./dnd-BWi02USV.js";import"./stripe-DMRn4zHo.js";import"./lottie-CgXU1WMN.js";import"./lexical-yXjK_sjC.js";import"./pdf-D6P4p3u8.js";import"./utils-DjtfEx4B.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]="b01df3c4-110c-4040-bc67-78b2276eb150",o._sentryDebugIdIdentifier="sentry-dbid-b01df3c4-110c-4040-bc67-78b2276eb150")}catch{}})();const s=i(null,function(o,t){return{onGoBack:()=>{t.navigate(-1)},onGoHome:()=>{t.navigate("/")}}})(n);function h(){const o=e();return r.jsx(s,{navigate:o})}export{h as default};
@@ -1 +1 @@
1
- import{l as dt,a as lt,m as ft,j as _}from"./liveblocks-n5yWztsO.js";import ut from"./NotFoundScreen-BRYvV6H8.js";import{a as k}from"./sentry-BKXoW7cS.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-DD1dfJeB.js";import{cp as It,eW as K,eN as X,fa as Ct,f2 as b,OG as Q,f6 as d,eV as A,qr as M,vF as Tt,OH as At,eU as yt,fd as Et,qw as _t,OI as F,bq as $,gD as x,qA as z,OJ as Nt,cA as Bt,cu as wt}from"./zeni-epic-state-EPc5wQ9y.js";import{I as xt,z as Dt,a as Rt,d as Ut,H as vt,cq as Gt,r as N,a1 as Pt,cr as Ft,a2 as $t,p as Mt}from"./index-BkSp81D-.js";import"./mui-BTXLmTm-.js";import{u as jt}from"./useAskAiCfoHostNavButtonProps-C6C0w9_M.js";import{c as Ot}from"./useFetchSuggestedQuestionsWhenReady-CDvirjAz.js";import"./recharts-DiMUqhPC.js";import"./analytics-Dr0EwPvr.js";import"./plaid-Dky97stA.js";import"./dnd-B-YE4tPm.js";import"./stripe-DMRn4zHo.js";import"./lottie-RycEs72p.js";import"./lexical-BY-JRpCA.js";import"./pdf-C2zvD-z9.js";import"./utils-Becml5Y0.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]="666922a8-bb5d-45cd-8eb5-95754c2ac374",t._sentryDebugIdIdentifier="sentry-dbid-666922a8-bb5d-45cd-8eb5-95754c2ac374")}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=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:D}=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(z("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")&&!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(Q(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 D?.()},onUpdateNotificationStatus:(a,o,m,c)=>{a==="tasks"?t(z("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(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,$())),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=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)),Ht=()=>{const t=ht(),l=pt(),{tenantEmailDomain:n,selectedTab:u}=kt(),{areTenantIdsInSync:g}=xt(),i=It(u??""),s=gt(),h=Dt.getSignedInUser(),[B,D]=k.useState(!1),a=S(e=>K(e)),o=S(e=>X(e)),{useFeatureGate:m}=Rt(),{isFeatureEnabled:c}=m(Ut.isDebitCardFeatureEnabled),{isAiCfoOpen:r,setIsAiCfoOpen:I}=vt(),{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:w,isLoading:y,hasFetchedAll:C,isFetchingMore:v,fetchMore:nt}=dt(),{threads:q,isLoading:V,fetchMore:H,isFetchingMore:W,hasFetchedAll:J}=lt({query:{metadata:{companyId:o.companyId,application:"dashboard"}}});k.useEffect(()=>{if(O!==i&&i!=null&&s(Q(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(M("task_manager","dashboard",["read","unread"]))},[g]),k.useEffect(()=>{const e=setTimeout(()=>nt?.(),0);return()=>clearTimeout(e)});const G=y||v===!0||C!==!0||y||v===!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&&(D(!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}:(W||J===!0||H==null||H(),null)}).filter(f=>f!=null);s(d({allNotificationsIds:E},"comments")),s(A({totalCount:E.length,unreadCount:T.length},"comments")),s(At(ct))}},[y,v,W,C,J,V,w?.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(L,{path:"/:selectedTab",element:_.jsx(Ht,{})}),_.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-BPC8B-82.js";import ut from"./NotFoundScreen-By6iX_AK.js";import{a as k}from"./sentry-CWaXw80H.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 J}from"./core-D5Hit8x-.js";import{cp as It,eW as K,eN as X,fa as Ct,f2 as b,OG as Q,f6 as d,eV as A,qr as M,vF as Tt,OH as At,eU as yt,fd as Et,qw as _t,OI as F,bq as $,gD as x,qA as z,OJ as Nt,cA as Bt,cu as wt}from"./zeni-epic-state-CVuyWhoX.js";import{J as xt,z as Dt,a as Rt,d as Ut,H as vt,cq as Gt,r as N,a1 as Pt,cr as Ft,a2 as $t,p as Mt}from"./index-C7yI3-qS.js";import"./mui-DW04nVBh.js";import{u as jt}from"./useAskAiCfoHostNavButtonProps-COcfEAPF.js";import{c as Ot}from"./useFetchSuggestedQuestionsWhenReady-Dye8etNE.js";import"./recharts-BAxVJ6il.js";import"./analytics-DaGIvUkL.js";import"./plaid-BnTbuxYK.js";import"./dnd-BWi02USV.js";import"./stripe-DMRn4zHo.js";import"./lottie-CgXU1WMN.js";import"./lexical-yXjK_sjC.js";import"./pdf-D6P4p3u8.js";import"./utils-DjtfEx4B.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]="ec85d960-824f-4181-bdcc-c63821be9125",t._sentryDebugIdIdentifier="sentry-dbid-ec85d960-824f-4181-bdcc-c63821be9125")}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=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:D}=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(z("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")&&!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(Q(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 D?.()},onUpdateNotificationStatus:(a,o,m,c)=>{a==="tasks"?t(z("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(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,$())),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=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)),Ht=()=>{const t=ht(),l=pt(),{tenantEmailDomain:n,selectedTab:u}=kt(),{areTenantIdsInSync:g}=xt(),i=It(u??""),s=gt(),h=Dt.getSignedInUser(),[B,D]=k.useState(!1),a=S(e=>K(e)),o=S(e=>X(e)),{useFeatureGate:m}=Rt(),{isFeatureEnabled:c}=m(Ut.isDebitCardFeatureEnabled),{isAiCfoOpen:r,setIsAiCfoOpen:I}=vt(),{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:w,isLoading:y,hasFetchedAll:C,isFetchingMore:v,fetchMore:nt}=dt(),{threads:q,isLoading:V,fetchMore:H,isFetchingMore:L,hasFetchedAll:W}=lt({query:{metadata:{companyId:o.companyId,application:"dashboard"}}});k.useEffect(()=>{if(O!==i&&i!=null&&s(Q(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(M("task_manager","dashboard",["read","unread"]))},[g]),k.useEffect(()=>{const e=setTimeout(()=>nt?.(),0);return()=>clearTimeout(e)});const G=y||v===!0||C!==!0||y||v===!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&&(D(!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}:(L||W===!0||H==null||H(),null)}).filter(f=>f!=null);s(d({allNotificationsIds:E},"comments")),s(A({totalCount:E.length,unreadCount:T.length},"comments")),s(At(ct))}},[y,v,L,C,W,V,w?.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(J,{path:"/:selectedTab",element:_.jsx(Ht,{})}),_.jsx(J,{path:"*",element:_.jsx(ut,{})})]})}export{me as default};
@@ -1 +1 @@
1
- import{j as n}from"./liveblocks-n5yWztsO.js";import{j as Z,h as H,u as K,l as Q,g as d,k as X,n as ee,o as C}from"./core-DD1dfJeB.js";import{eN as M,qf as v,pP as ae,J8 as $,pK as A,bv as te,bn as se,bR as oe,pL as re,J9 as ne,IV as T,dB as ie,tC as ce,Ja as le,tZ as de,eT as me,eR as fe}from"./zeni-epic-state-EPc5wQ9y.js";import{H as pe,z as ue,I as he,A as ge,a as w,d as N,x as Fe,e as B,aj as Ie,r as be}from"./index-BkSp81D-.js";import"./mui-BTXLmTm-.js";import Ce from"./NotFoundScreen-BRYvV6H8.js";import{F as Te}from"./FeaturePreviewScreen-DYmob-8E.js";import{a as h}from"./sentry-BKXoW7cS.js";import{u as Ae}from"./useAskAiCfoHostNavButtonProps-C6C0w9_M.js";import{c as Se}from"./useFetchSuggestedQuestionsWhenReady-CDvirjAz.js";import{u as ye}from"./useInitialThreadRequest-Dm5r1FEx.js";import{t as xe}from"./routePaths-C6iDb53I.js";import{M as ke}from"./MobileAppDrawer-DYUc4UJc.js";import"./recharts-DiMUqhPC.js";import"./analytics-Dr0EwPvr.js";import"./plaid-Dky97stA.js";import"./dnd-B-YE4tPm.js";import"./stripe-DMRn4zHo.js";import"./lottie-RycEs72p.js";import"./lexical-BY-JRpCA.js";import"./pdf-C2zvD-z9.js";import"./utils-Becml5Y0.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]="fc987e28-941a-4235-83c3-5782d80e6ebf",s._sentryDebugIdIdentifier="sentry-dbid-fc987e28-941a-4235-83c3-5782d80e6ebf")}catch{}})();const S=(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($(e,o)),a.isPandLReportFetched(e)||s(A(e)),S(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=xe(a.tenantEmailDomain,e.accountId,e.accountType,g,r,i),p=be(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("../../")}}})(Ie);function U(){const{isAiCfoOpen:s,setIsAiCfoOpen:a}=pe(),e=Z(),o=H(),r=K(),{forecastId:i,tenantEmailDomain:g}=Q(),[f,p]=h.useState(!1),[F,y]=h.useState(!1),u=ue.getSignedInUser(),x=d(t=>M(t)),q=x.company?.companyInfo.firstMonthOfFY??1,c=d(t=>v(t.forecastState,t.forecastListState)),l=d(t=>t.forecastListState.fetchState==="Completed"),k=d(t=>t.profitAndLossState),D=d(t=>t.reportUIOptionsState.selectedForecast),j=t=>k.pandLByForecastID[t]!=null&&re(t,k).reducedAllFetchState.fetchState==="Completed",{areTenantIdsInSync:I}=he();Se({isDataReady:l});const{isAiCfoAccessEnabled:G,onAskAiCfoClick:_}=Ae({isAiCfoOpen:s,setIsAiCfoOpen:a,mobileExploreReferrer:"Forecast"});h.useEffect(()=>{if(!f&&I)p(!0),l||o(ae());else if(l&&!F){y(!0);const t=((m,R,P)=>R!=null?m.forecasts.findIndex(b=>b.id===R):P!=null?m.forecasts.findIndex(b=>b.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($(c.forecasts[t].id,t)),S(i,c.forecasts[t].id,e,r.search)):i==null&&t!==-1&&S(void 0,c.forecasts[t].id,e,r.search),t!==-1&&!j(c.forecasts[t].id)&&I&&o(A(c.forecasts[t].id))}},[f,p,o,l,c,F,y,v,A,I]);const L=ge(),V=L?.loggedInUserRole!=null&&te(L.loggedInUserRole),{useFeatureGate:W}=w(),{isFeatureEnabled:E}=W(N.isReportsCommentingEnabled),Y=ye(E?x?.companyId:void 0,{clearParams:l&&F}),[J,z]=h.useState(!1),O=t=>{z(t)};return n.jsxs(n.Fragment,{children:[l?n.jsx(Fe,{analytics:B,onLoad:t=>(m=>m.trackForecast())(t)}):null,n.jsx(ke,{isAppContentDrawerOpen:J,handleDrawerToggle:O}),n.jsx(De,{firstMonthOfFY:q,tenantEmailDomain:g,forecastIdFromUrlPath:i,navigate:e,location:r,isPandLReportFetched:j,meetingUrl:oe(`https://meetings.hubspot.com/svitlana-grankovska?firstname=${u?.firstName}&lastname=${u?.lastName}&email=${u?.userEmail}`),hasTransactionAccess:V,isAiCfoAccessEnabled:G,onAskAiCfoClick:_,isReportsCommentingEnabled:E,isZeniUser:se(u),initialOpenThreadRequest:Y,onClickMenuIcon:()=>{O(!0)}})]})}function He(){const s=d(i=>M(i)),{useFeatureGate:a}=w(),{isFeatureEnabled:e}=a(N.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(U,{})}),n.jsx(C,{path:"/:forecastId",element:n.jsx(U,{})}),n.jsx(C,{path:"/:forecastId/*",element:n.jsx(Ce,{})})]})}export{He as PandLWithForecastRoutes,He as default};
1
+ import{j as n}from"./liveblocks-BPC8B-82.js";import{j as Z,h as H,u as K,l as Q,g as d,k as X,n as ee,o as C}from"./core-D5Hit8x-.js";import{eN as M,qf as v,pP as ae,J8 as w,pK as A,bv as te,bn as se,bR as oe,pL as re,J9 as ne,IV as T,dB as ie,tC as ce,Ja as le,tZ as de,eT as me,eR as fe}from"./zeni-epic-state-CVuyWhoX.js";import{H as pe,z as ue,J as he,A as ge,a as $,d as N,w as Fe,e as B,aj as be,r as Ie}from"./index-C7yI3-qS.js";import"./mui-DW04nVBh.js";import Ce from"./NotFoundScreen-By6iX_AK.js";import{F as Te}from"./FeaturePreviewScreen-C9nGcb2y.js";import{a as h}from"./sentry-CWaXw80H.js";import{u as Ae}from"./useAskAiCfoHostNavButtonProps-COcfEAPF.js";import{c as Se}from"./useFetchSuggestedQuestionsWhenReady-Dye8etNE.js";import{u as ye}from"./useInitialThreadRequest-7gkW3kbz.js";import{t as ke}from"./routePaths-DpkdUp-r.js";import{M as xe}from"./MobileAppDrawer-DuACKsl0.js";import"./recharts-BAxVJ6il.js";import"./analytics-DaGIvUkL.js";import"./plaid-BnTbuxYK.js";import"./dnd-BWi02USV.js";import"./stripe-DMRn4zHo.js";import"./lottie-CgXU1WMN.js";import"./lexical-yXjK_sjC.js";import"./pdf-D6P4p3u8.js";import"./utils-DjtfEx4B.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]="36d247ae-1568-4ed9-b65b-2a15026e49c6",s._sentryDebugIdIdentifier="sentry-dbid-36d247ae-1568-4ed9-b65b-2a15026e49c6")}catch{}})();const S=(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(w(e,o)),a.isPandLReportFetched(e)||s(A(e)),S(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 U(){const{isAiCfoOpen:s,setIsAiCfoOpen:a}=pe(),e=Z(),o=H(),r=K(),{forecastId:i,tenantEmailDomain:g}=Q(),[f,p]=h.useState(!1),[F,y]=h.useState(!1),u=ue.getSignedInUser(),k=d(t=>M(t)),q=k.company?.companyInfo.firstMonthOfFY??1,c=d(t=>v(t.forecastState,t.forecastListState)),l=d(t=>t.forecastListState.fetchState==="Completed"),x=d(t=>t.profitAndLossState),D=d(t=>t.reportUIOptionsState.selectedForecast),j=t=>x.pandLByForecastID[t]!=null&&re(t,x).reducedAllFetchState.fetchState==="Completed",{areTenantIdsInSync:b}=he();Se({isDataReady:l});const{isAiCfoAccessEnabled:G,onAskAiCfoClick:_}=Ae({isAiCfoOpen:s,setIsAiCfoOpen:a,mobileExploreReferrer:"Forecast"});h.useEffect(()=>{if(!f&&b)p(!0),l||o(ae());else if(l&&!F){y(!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(w(c.forecasts[t].id,t)),S(i,c.forecasts[t].id,e,r.search)):i==null&&t!==-1&&S(void 0,c.forecasts[t].id,e,r.search),t!==-1&&!j(c.forecasts[t].id)&&b&&o(A(c.forecasts[t].id))}},[f,p,o,l,c,F,y,v,A,b]);const L=ge(),J=L?.loggedInUserRole!=null&&te(L.loggedInUserRole),{useFeatureGate:V}=$(),{isFeatureEnabled:E}=V(N.isReportsCommentingEnabled),W=ye(E?k?.companyId:void 0,{clearParams:l&&F}),[Y,z]=h.useState(!1),O=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:O}),n.jsx(De,{firstMonthOfFY:q,tenantEmailDomain:g,forecastIdFromUrlPath:i,navigate:e,location:r,isPandLReportFetched:j,meetingUrl:oe(`https://meetings.hubspot.com/svitlana-grankovska?firstname=${u?.firstName}&lastname=${u?.lastName}&email=${u?.userEmail}`),hasTransactionAccess:J,isAiCfoAccessEnabled:G,onAskAiCfoClick:_,isReportsCommentingEnabled:E,isZeniUser:se(u),initialOpenThreadRequest:W,onClickMenuIcon:()=>{O(!0)}})]})}function He(){const s=d(i=>M(i)),{useFeatureGate:a}=$(),{isFeatureEnabled:e}=a(N.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(U,{})}),n.jsx(C,{path:"/:forecastId",element:n.jsx(U,{})}),n.jsx(C,{path:"/:forecastId/*",element:n.jsx(Ce,{})})]})}export{He as PandLWithForecastRoutes,He as default};
@@ -0,0 +1,22 @@
1
+ import{j as s}from"./liveblocks-BPC8B-82.js";import{J3 as oe,eN as X,jr as W,eT as q,eR as ie,GE as Y,IH as re,sK as ke,J4 as Q,sy as Pe,sT as je,sN as le,sC as de,sR as Te,sO as Le,J5 as ce,uo as ve,J6 as Fe,fx as Ae,J7 as J,sH as pe,sF as ue,sW as Oe,c0 as Re}from"./zeni-epic-state-CVuyWhoX.js";import{Z as me,a as ee,d as E,z as K,a4 as ge,F as he,af as fe,ag as Ve,C as Ce,o as A,Q as ye,D as be,ah as Ue,J as Ze,H as Be,w as $e,e as we,g as He,r as Je,ai as ze,A as Ge}from"./index-C7yI3-qS.js";import{D as Se,n as M,S as De}from"./mui-DW04nVBh.js";import te from"./NotFoundScreen-By6iX_AK.js";import{a as l}from"./sentry-CWaXw80H.js";import{h as se,l as We,g,j as Ke,u as Me,k as _e,n as ne,o as H}from"./core-D5Hit8x-.js";import{u as Ne}from"./useAskAiCfoHostNavButtonProps-COcfEAPF.js";import{c as Qe}from"./useFetchSuggestedQuestionsWhenReady-Dye8etNE.js";import{M as Xe}from"./MobileAppDrawer-DuACKsl0.js";import"./recharts-BAxVJ6il.js";import"./analytics-DaGIvUkL.js";import"./plaid-BnTbuxYK.js";import"./dnd-BWi02USV.js";import"./stripe-DMRn4zHo.js";import"./lottie-CgXU1WMN.js";import"./lexical-yXjK_sjC.js";import"./pdf-D6P4p3u8.js";import"./utils-DjtfEx4B.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]="464e14ef-a98f-4245-9d8a-7ee67c3ce2d0",e._sentryDebugIdIdentifier="sentry-dbid-464e14ef-a98f-4245-9d8a-7ee67c3ce2d0")}catch{}})();const qe={overlayWidth:new Ce(100,100,48)},z=be.getLocalizedStrings().peoplePage.invitePage,Ye=({companyId:e,managersListView:n,companyPassportView:d,classListView:o,mode:h,isEditPeopleDrawerOpen:i,closeDrawerHandler:b})=>{const f=me(),u=se(),[O,R]=l.useState(!1),[k,w]=l.useState(!1),{userId:S}=We(),c=g(t=>oe(t)),m=g(t=>X(t)),D=g(t=>W(t)),{useFeatureGate:C}=ee(),{isFeatureEnabled:I}=C(E.isDebitCardFeatureEnabled),P=q(I,m),L=ie(m),v=Y(m),V=re(m),U=!!m.company?.featuresActivationInfo?.isReimbursementFeatureEnabled,x=!P&&D&&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 y=()=>{u(Q()),b()},F=()=>{O===!0?w(!0):y()},Z=d.companyView?.controllers?.map(t=>t.user),{isFeatureEnabled:B}=C(E.isDepositAccountsFeatureEnabled),{isFeatureEnabled:$}=C(E.isChargeCardFeatureEnabled),p=ge(m,$,I),{isFeatureEnabled:j}=C(E.isTreasuryEnabled),T={peopleDetails:c,classList:o.classes,managersList:n.users,controllersList:Z,mode:h,isZeniTenant:v,isAccountingClassesEnabled:D,isReimbursementDisabled:U===!1,isZeniAccountsDisabled:B===!1,isChargeCardDisabled:p===!1,isTreasuryDisabled:j===!1,isLiteRoleDisabled:V===!1,isBankingOnlyTenant:P,isCardsOnlyTenant:L,onResetClick:y,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),y()},onCancelClick:()=>{w(!1)}};return l.useEffect(()=>{x===!1&&S!=null&&u(ke(S))},[x,S]),l.useEffect(()=>{c.updatePersonState.fetchState==="Completed"&&y()},[c.updatePersonState.fetchState]),s.jsx(Se,{anchor:"right",open:i,PaperProps:{style:{width:qe.overlayWidth.valuePercentage(f),boxShadow:"none"}},slotProps:{backdrop:{style:{backgroundColor:he.overlayDark,cursor:"pointer"}}},onClose:F,children:s.jsxs(es,{onClick:t=>t.stopPropagation(),children:[k===!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:r,isEditPopup:!0}):null,s.jsx(Ve,{...T})]})})},es=M(De)`
2
+ display: flex;
3
+ min-height: 100%;
4
+ flex-direction: column;
5
+ `,xe=M(ye.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=M(ye.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)},G=be.getLocalizedStrings().peoplePage.invitePage,as=({companyId:e,managersListView:n,companyPassportView:d,classListView:o,mode:h,isInvitePeopleDrawerOpen:i,closeDrawerHandler:b})=>{const f=me(),u=se(),[O,R]=l.useState(!1),[k,w]=l.useState(!1),S=g(r=>oe(r)),c=g(r=>X(r)),m=g(r=>W(r)),{useFeatureGate:D}=ee(),{isFeatureEnabled:C}=D(E.isDebitCardFeatureEnabled),I=q(C,c),P=ie(c),L=Y(c),v=re(c),V=!!c.company?.featuresActivationInfo?.isReimbursementFeatureEnabled,U=!I&&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=()=>{b(),u(Q())},y=()=>{O===!0?w(!0):x()},F={onOkClick:()=>{w(!1),x()},onCancelClick:()=>{w(!1)}},Z=d.companyView?.controllers.map(r=>r.user),{isFeatureEnabled:B}=D(E.isDepositAccountsFeatureEnabled),{isFeatureEnabled:$}=D(E.isChargeCardFeatureEnabled),p=ge(c,$,C),{isFeatureEnabled:j}=D(E.isTreasuryEnabled),T={classList:o.classes,managersList:n.users,controllersList:Z,mode:h,isZeniTenant:L,onPeopleLocalDataUpdated:r=>{u(le({peopleLocalData:r})),R(!0)},onResetClick:x,onSaveClick:()=>{u(h==="zeni_only"?Te(e):Le())},onCloseClick:y,peopleDetails:S,isAccountingClassesEnabled:m,isReimbursementDisabled:V===!1,isLiteRoleDisabled:v===!1,isZeniAccountsDisabled:B===!1,isChargeCardDisabled:p===!1,isTreasuryDisabled:j===!1,isBankingOnlyTenant:I,isCardsOnlyTenant:P,isLoading:U};return l.useEffect(()=>{S.invitePersonState.fetchState==="Completed"&&(b(),u(Q()))},[S.invitePersonState.fetchState]),s.jsx(Se,{anchor:"right",open:i,PaperProps:{style:{width:ss.overlayWidth.valuePercentage(f),boxShadow:"none"}},slotProps:{backdrop:{style:{backgroundColor:he.overlayDark,cursor:"pointer"}}},onClose:y,children:s.jsxs(ts,{onClick:r=>r.stopPropagation(),children:[k===!0?s.jsx(fe,{titleComponent:s.jsx(xe,{children:G.discardTitle}),descriptionComponent:s.jsx(Ee,{children:G.discardDescription}),primaryButtonText:G.discard,secondaryButtonText:G.no,action:F}):null,s.jsx(Ue,{...T})]})})},ts=M(De)`
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:W(e),analytics:we}},function(e,n){const{navigate:d,companyId:o,shouldFetchClasses:h}=n;return{personAction:{onPersonDelete:(i,b)=>{e(de(i,b))},onResendInvite:i=>{e(Oe(i))},onReloadPeople:()=>{e(pe()),e(ue(o,h))},onBackClick:()=>{d("../../")},onModeChange:i=>{e(J({mode:i,searchText:"",sortKey:"name",sortOrder:"ascending"}))},onSearchTextChanged:i=>{e(J({searchText:i}))}}}})(ze);function N({isInvitePeopleDrawerOpen:e,isEditPeopleDrawerOpen:n}){const d=Ke(),o=se(),h=Me(),{areTenantIdsInSync:i}=Ze(),b=K.getSignedInUser(),f=g(a=>X(a)),{useFeatureGate:u}=ee(),{isFeatureEnabled:O}=u(E.isDebitCardFeatureEnabled),R=g(a=>W(a)),k=!q(O,f)&&R,w=Y(f),S=f?.tenantId,{tenantEmailDomain:c}=f,[m,D]=l.useState(!1),[C,I]=l.useState(!1),[P,L]=l.useState(!1),[v,V]=l.useState("off"),[U,x]=l.useState(!1),y=a=>{x(a)},{isAiCfoOpen:F,setIsAiCfoOpen:Z}=Be(),{isAiCfoAccessEnabled:B,onAskAiCfoClick:$}=Ne({isAiCfoOpen:F,setIsAiCfoOpen:Z,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(J({searchText:"",sortKey:"name",sortOrder:"ascending"})),V(p.uiState.mode),D(!0),o(pe()))},[m,b,S,o,p.uiState.mode,i]),l.useEffect(()=>{t!=null&&i&&o(ue(t,k))},[t,k,i]),l.useEffect(()=>{I(e!=null&&e===!0),L(n!=null&&n===!0&&n)},[e,n]),l.useEffect(()=>{o(J({searchText:"",sortKey:"name",sortOrder:"ascending"}))},[]);const ae=()=>{I(!1),L(!1),d("../")};return s.jsxs(s.Fragment,{children:[p.fetchState==="Completed"?s.jsx($e,{analytics:we,onLoad:a=>a.trackPageLoaded(He.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(Xe,{isAppContentDrawerOpen:U,handleDrawerToggle:y}),s.jsx(ns,{navigate:d,signedInUser:b,isZeni:f.isZeni,isZeniTenant:w,peopleUIState:p.uiState,companyId:t,shouldFetchClasses:k,classList:j,managersView:T,peopleView:p,onInvitePeopleClick:()=>{d("./new")},onColumnSortConfigChanged:(a,_)=>{o(J({sortKey:a,sortOrder:_}))},onRowClick:a=>{const _=`/${c}/people/${encodeURIComponent(a)}/edit`,Ie=Je(h.state?.pathnameStackToGoBack,h.pathname);d(_,{state:{pathnameStackToGoBack:Ie}})},onClickMenuIcon:()=>{y(!0)},isAiCfoAccessEnabled:B,onAskAiCfoClick:$})]})}function Es(){const e=Ge();return Re(e?.loggedInUserRole??[])?s.jsxs(ne,{children:[s.jsx(H,{path:"/",element:s.jsx(N,{})}),s.jsx(H,{path:"new",element:s.jsx(N,{isInvitePeopleDrawerOpen:!0})}),s.jsx(H,{path:":userId/edit",element:s.jsx(N,{isEditPeopleDrawerOpen:!0})}),s.jsx(H,{path:"*",element:s.jsx(te,{})})]}):s.jsx(ne,{children:s.jsx(H,{path:"*",element:s.jsx(te,{})})})}export{Es as default};
@@ -0,0 +1 @@
1
+ import{j as a}from"./liveblocks-BPC8B-82.js";import _ from"./NotFoundScreen-By6iX_AK.js";import{a as o}from"./sentry-CWaXw80H.js";import{j as v,u as M,g,l as U,h as P,N as z,k as N,n as V,o as h}from"./core-D5Hit8x-.js";import{eN as B,OK as b,bo as F,bn as H,h7 as K,gD as $}from"./zeni-epic-state-CVuyWhoX.js";import{x as q,z as I,H as G,cs as J}from"./index-C7yI3-qS.js";import"./mui-DW04nVBh.js";import{u as L}from"./useAskAiCfoHostNavButtonProps-COcfEAPF.js";import{c as Q}from"./useFetchSuggestedQuestionsWhenReady-Dye8etNE.js";import{M as W}from"./MobileAppDrawer-DuACKsl0.js";import"./recharts-BAxVJ6il.js";import"./analytics-DaGIvUkL.js";import"./plaid-BnTbuxYK.js";import"./dnd-BWi02USV.js";import"./stripe-DMRn4zHo.js";import"./lottie-CgXU1WMN.js";import"./lexical-yXjK_sjC.js";import"./pdf-D6P4p3u8.js";import"./utils-DjtfEx4B.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]="82f7075d-2ed9-42e9-815f-242a44d3d72a",e._sentryDebugIdIdentifier="sentry-dbid-82f7075d-2ed9-42e9-815f-242a44d3d72a")}catch{}})();const X=N(function(e){const t=I.getSignedInUser(),d=e.tenantState.currentTenantId,r={userId:t?.userId??"",sessionId:t?.zeniSessionId??"",tenantId:d??""},{aggregatedReportViewState:n}=b(e);return{authParams:r,isDisabled:!1,loggedInUser:t,aggregatedReport:n}},function(e,t){return{onBackClick:()=>{t.navigate("../../")},onClickMenuIcon:()=>{t.handleDrawerToggle(!0)}}})(J),Y=()=>{const e=v(),t=M(),d=q(),r=g(s=>B(s)),{aggregatedReportViewState:n}=g(s=>b(s)),{tenantEmailDomain:m}=U(),p=P(),l=I.getSignedInUser();if(l==null)throw new Error("Can't access this page without signing in...");const f=o.useRef(!1),[C,S]=o.useState(!1),k=F(r?.userRole??[]),w=r?.userRole?.includes("bookkeeping_admin")??!1,D=H(l),x=k||w||D,c=o.useCallback((s,i,O)=>{p(K({fromMonth:s,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 A=o.useCallback((s,i)=>{n!=null&&n?.fetchState==="In-Progress"||c(s,i,!0),f.current=!0},[n?.fetchState,c]),y=o.useCallback((s,i)=>{c(s,i,!1)},[c]),u=s=>{S(s)},{isAiCfoOpen:j,setIsAiCfoOpen:R}=G(),{isAiCfoAccessEnabled:T,onAskAiCfoClick:E}=L({isAiCfoOpen:j,setIsAiCfoOpen:R,mobileExploreReferrer:"Performance"});return Q({isDataReady:n?.fetchState==="Completed"}),x?a.jsxs(a.Fragment,{children:[a.jsx(W,{isAppContentDrawerOpen:C,handleDrawerToggle:u}),a.jsx(X,{navigate:e,location:t,themeState:d,currentTenant:r,signedInUser:l,tenantEmailDomain:m,onReload:A,onTimeRangeSelect:y,handleDrawerToggle:u,isAiCfoAccessEnabled:T,onAskAiCfoClick:E})]}):a.jsx(z,{to:`/${m}/dashboard`,replace:!0})};function Ie(){return a.jsxs(V,{children:[a.jsx(h,{path:"*",element:a.jsx(Y,{})}),a.jsx(h,{path:"*",element:a.jsx(_,{})})]})}export{Ie as default};
@@ -1 +1 @@
1
- import{a as h,b as t}from"./sentry-BKXoW7cS.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-CWaXw80H.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-n5yWztsO.js";import{p as Q,e as xc,d as kc,g as jl,a as xl}from"./sentry-BKXoW7cS.js";import{L as dt,bR as Tc,eN as Ac,Ij as Rc,I$ as kl,c0 as Tl,fi as Al,fj as Rl}from"./zeni-epic-state-EPc5wQ9y.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-Becml5Y0.js";import{r as un}from"./empty-BnKMMwK8.js";import{r as Fl,a as Bl,b as Ul,c as ql}from"./pdf-lib-n_9QJvCM.js";import{r as Gl}from"./index-DtF5ksXF.js";import{r as zl}from"./index-B9py0zpe.js";import{j as Zl,u as Hl,h as Vl,g as En,k as Yl}from"./core-DD1dfJeB.js";import{u as Kl,z as Pc,L as Wl,M as Jl,Q as Xl,j as Ql,e as tf}from"./index-BkSp81D-.js";import"./mui-BTXLmTm-.js";import{d as Pe}from"./decodeURIComponentSafe-BYsApOnw.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]="f7ff0c00-87aa-4844-a82a-2450c9b8b8d6",t._sentryDebugIdIdentifier="sentry-dbid-f7ff0c00-87aa-4844-a82a-2450c9b8b8d6")}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-BPC8B-82.js";import{p as Q,e as xc,d as kc,g as jl,a as xl}from"./sentry-CWaXw80H.js";import{L as dt,bR as Tc,eN as Ac,Ij as Rc,I$ as kl,c0 as Tl,fi as Al,fj as Rl}from"./zeni-epic-state-CVuyWhoX.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-DjtfEx4B.js";import{r as un}from"./empty-CEC058x9.js";import{r as Fl,a as Bl,b as Ul,c as ql}from"./pdf-lib-CL8r24Xn.js";import{r as Gl}from"./index-CFTsy12u.js";import{r as zl}from"./index-1TQnr6ma.js";import{j as Zl,u as Hl,h as Vl,g as En,k as Yl}from"./core-D5Hit8x-.js";import{u as Kl,z as Pc,L as Wl,N as Jl,O as Xl,j as Ql,e as tf}from"./index-C7yI3-qS.js";import"./mui-DW04nVBh.js";import{d as Pe}from"./decodeURIComponentSafe-DDEb_ZPT.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]="145c7acc-9d57-4ed6-9b77-43c2a9a1aeb1",t._sentryDebugIdIdentifier="sentry-dbid-145c7acc-9d57-4ed6-9b77-43c2a9a1aeb1")}catch{}})();var _n,Sn={exports:{}},On,jn,xn,kn,Tn,An,Rn,In,Pn,Ne,Nn,Ln,$n,Mn,Cn,Dn,Fn,Bn,Un,qn,Gn,Le,zn,Zn,Hn,Vn,Yn,Kn,Wn,$e,Jn,Xn,Qn,to,eo,ro,no,Me={exports:{}},Ce={exports:{}},De={};function Nc(){if(On)return De;function t(r){return t=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},t(r)}function f(r,e){return f=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(a,p){return a.__proto__=p,a},f(r,e)}function m(r){var e=function(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}();return function(){var a,p=s(r);if(e){var h=s(this).constructor;a=Reflect.construct(p,arguments,h)}else a=p.apply(this,arguments);return function(d,b){if(b&&(t(b)==="object"||typeof b=="function"))return b;if(b!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return function(g){if(g===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return g}(d)}(this,a)}}function s(r){return s=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},s(r)}On=1;var l,o,n={};function i(r,e,a){a||(a=Error);var p=function(h){(function(c,y){if(typeof y!="function"&&y!==null)throw new TypeError("Super expression must either be null or a function");c.prototype=Object.create(y&&y.prototype,{constructor:{value:c,writable:!0,configurable:!0}}),Object.defineProperty(c,"prototype",{writable:!1}),y&&f(c,y)})(g,h);var d,b=m(g);function g(c,y,v){var S;return function(w,_){if(!(w instanceof _))throw new TypeError("Cannot call a class as a function")}(this,g),S=b.call(this,function(w,_,M){return typeof e=="string"?e:e(w,_,M)}(c,y,v)),S.code=r,S}return d=g,Object.defineProperty(d,"prototype",{writable:!1}),d}(a);n[r]=p}function u(r,e){if(Array.isArray(r)){var a=r.length;return r=r.map(function(p){return String(p)}),a>2?"one of ".concat(e," ").concat(r.slice(0,a-1).join(", "),", or ")+r[a-1]:a===2?"one of ".concat(e," ").concat(r[0]," or ").concat(r[1]):"of ".concat(e," ").concat(r[0])}return"of ".concat(e," ").concat(String(r))}return i("ERR_AMBIGUOUS_ARGUMENT",'The "%s" argument is ambiguous. %s',TypeError),i("ERR_INVALID_ARG_TYPE",function(r,e,a){var p,h,d;if(l===void 0&&(l=ie()),l(typeof r=="string","'name' must be a string"),typeof e=="string"&&(h="not ",e.substr(0,h.length)===h)?(p="must not be",e=e.replace(/^not /,"")):p="must be",function(g,c,y){return(y===void 0||y>g.length)&&(y=g.length),g.substring(y-c.length,y)===c}(r," argument"))d="The ".concat(r," ").concat(p," ").concat(u(e,"type"));else{var b=function(g,c,y){return typeof y!="number"&&(y=0),!(y+c.length>g.length)&&g.indexOf(c,y)!==-1}(r,".")?"property":"argument";d='The "'.concat(r,'" ').concat(b," ").concat(p," ").concat(u(e,"type"))}return d+=". Received type ".concat(t(a))},TypeError),i("ERR_INVALID_ARG_VALUE",function(r,e){var a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:"is invalid";o===void 0&&(o=lt());var p=o.inspect(e);return p.length>128&&(p="".concat(p.slice(0,128),"...")),"The argument '".concat(r,"' ").concat(a,". Received ").concat(p)},TypeError),i("ERR_INVALID_RETURN_VALUE",function(r,e,a){var p;return p=a&&a.constructor&&a.constructor.name?"instance of ".concat(a.constructor.name):"type ".concat(t(a)),"Expected ".concat(r,' to be returned from the "').concat(e,'"')+" function but got ".concat(p,".")},TypeError),i("ERR_MISSING_ARGS",function(){for(var r=arguments.length,e=new Array(r),a=0;a<r;a++)e[a]=arguments[a];l===void 0&&(l=ie()),l(e.length>0,"At least one arg needs to be specified");var p="The ",h=e.length;switch(e=e.map(function(d){return'"'.concat(d,'"')}),h){case 1:p+="".concat(e[0]," argument");break;case 2:p+="".concat(e[0]," and ").concat(e[1]," arguments");break;default:p+=e.slice(0,h-1).join(", "),p+=", and ".concat(e[h-1]," arguments")}return"".concat(p," must be specified")},TypeError),De.codes=n,De}function ef(){if(xn)return jn;function t(k,E){var j=Object.keys(k);if(Object.getOwnPropertySymbols){var x=Object.getOwnPropertySymbols(k);E&&(x=x.filter(function(O){return Object.getOwnPropertyDescriptor(k,O).enumerable})),j.push.apply(j,x)}return j}function f(k){for(var E=1;E<arguments.length;E++){var j=arguments[E]!=null?arguments[E]:{};E%2?t(Object(j),!0).forEach(function(x){m(k,x,j[x])}):Object.getOwnPropertyDescriptors?Object.defineProperties(k,Object.getOwnPropertyDescriptors(j)):t(Object(j)).forEach(function(x){Object.defineProperty(k,x,Object.getOwnPropertyDescriptor(j,x))})}return k}function m(k,E,j){return(E=l(E))in k?Object.defineProperty(k,E,{value:j,enumerable:!0,configurable:!0,writable:!0}):k[E]=j,k}function s(k,E,j){return E&&function(x,O){for(var $=0;$<O.length;$++){var N=O[$];N.enumerable=N.enumerable||!1,N.configurable=!0,"value"in N&&(N.writable=!0),Object.defineProperty(x,l(N.key),N)}}(k.prototype,E),Object.defineProperty(k,"prototype",{writable:!1}),k}function l(k){var E=function(j,x){if(p(j)!=="object"||j===null)return j;var O=j[Symbol.toPrimitive];if(O!==void 0){var $=O.call(j,x);if(p($)!=="object")return $;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(j)}(k,"string");return p(E)==="symbol"?E:String(E)}function o(k,E){if(E&&(p(E)==="object"||typeof E=="function"))return E;if(E!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return n(k)}function n(k){if(k===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return k}function i(k){var E=typeof Map=="function"?new Map:void 0;return i=function(j){if(j===null||(x=j,Function.toString.call(x).indexOf("[native code]")===-1))return j;var x;if(typeof j!="function")throw new TypeError("Super expression must either be null or a function");if(E!==void 0){if(E.has(j))return E.get(j);E.set(j,O)}function O(){return u(j,arguments,a(this).constructor)}return O.prototype=Object.create(j.prototype,{constructor:{value:O,enumerable:!1,writable:!0,configurable:!0}}),e(O,j)},i(k)}function u(k,E,j){return u=r()?Reflect.construct.bind():function(x,O,$){var N=[null];N.push.apply(N,O);var P=new(Function.bind.apply(x,N));return $&&e(P,$.prototype),P},u.apply(null,arguments)}function r(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function e(k,E){return e=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(j,x){return j.__proto__=x,j},e(k,E)}function a(k){return a=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(E){return E.__proto__||Object.getPrototypeOf(E)},a(k)}function p(k){return p=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(E){return typeof E}:function(E){return E&&typeof Symbol=="function"&&E.constructor===Symbol&&E!==Symbol.prototype?"symbol":typeof E},p(k)}xn=1;var h=lt().inspect,d=Nc().codes.ERR_INVALID_ARG_TYPE;function b(k,E,j){return(j===void 0||j>k.length)&&(j=k.length),k.substring(j-E.length,j)===E}var g="",c="",y="",v="",S={deepStrictEqual:"Expected values to be strictly deep-equal:",strictEqual:"Expected values to be strictly equal:",strictEqualObject:'Expected "actual" to be reference-equal to "expected":',deepEqual:"Expected values to be loosely deep-equal:",equal:"Expected values to be loosely equal:",notDeepStrictEqual:'Expected "actual" not to be strictly deep-equal to:',notStrictEqual:'Expected "actual" to be strictly unequal to:',notStrictEqualObject:'Expected "actual" not to be reference-equal to "expected":',notDeepEqual:'Expected "actual" not to be loosely deep-equal to:',notEqual:'Expected "actual" to be loosely unequal to:',notIdentical:"Values identical but not reference-equal:"};function w(k){var E=Object.keys(k),j=Object.create(Object.getPrototypeOf(k));return E.forEach(function(x){j[x]=k[x]}),Object.defineProperty(j,"message",{value:k.message}),j}function _(k){return h(k,{compact:!1,customInspect:!1,depth:1e3,maxArrayLength:1/0,showHidden:!1,breakLength:1/0,showProxy:!1,sorted:!0,getters:!0})}function M(k,E,j){var x="",O="",$=0,N="",P=!1,G=_(k),A=G.split(`
2
2
  `),I=_(E).split(`
3
3
  `),R=0,B="";if(j==="strictEqual"&&p(k)==="object"&&p(E)==="object"&&k!==null&&E!==null&&(j="strictEqualObject"),A.length===1&&I.length===1&&A[0]!==I[0]){var V=A[0].length+I[0].length;if(V<=10){if(!(p(k)==="object"&&k!==null||p(E)==="object"&&E!==null||k===0&&E===0))return"".concat(S[j],`
4
4
 
@@ -1,5 +1,5 @@
1
- import{j as s}from"./liveblocks-n5yWztsO.js";import{a as o}from"./sentry-BKXoW7cS.js";import{g as f,j as N,h as V,u as W,k as M}from"./core-DD1dfJeB.js";import{h as _,Z as z,z as R,b2 as U,y as Z,I as $,H as X,x as q,e as l,g as G,a1 as J,b3 as Q}from"./index-BkSp81D-.js";import{eX as K,eN as Y,Ly as I,Lz as ee,ts as ae,ti as g,eZ as re,bM as ne,tn as te,LA as se}from"./zeni-epic-state-EPc5wQ9y.js";import{D as oe,e as ie,n as le,S as de}from"./mui-BTXLmTm-.js";import{u as ce}from"./useAskAiCfoHostNavButtonProps-C6C0w9_M.js";import{c as fe}from"./useFetchSuggestedQuestionsWhenReady-CDvirjAz.js";import{M as ue}from"./MobileAppDrawer-DYUc4UJc.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]="29d8e3cc-a6e4-4e02-a0d6-3ebad9355a68",e._sentryDebugIdIdentifier="sentry-dbid-29d8e3cc-a6e4-4e02-a0d6-3ebad9355a68")}catch{}})();const pe={overlayWidth:new Z(100,100,30)},we=({isReferralDrawerOpen:e,closeDrawerHandler:a})=>{const r=_(),n=z();if(R.getSignedInUser()==null)throw Error("Can't access How Referral works without signing in...");const i=()=>{a(!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:r.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)`
1
+ import{j as s}from"./liveblocks-BPC8B-82.js";import{a as o}from"./sentry-CWaXw80H.js";import{g as f,j as N,h as V,u as W,k as M}from"./core-D5Hit8x-.js";import{h as _,Z as z,z as R,b2 as U,C as Z,J as $,H as J,w as X,e as l,g as q,a1 as G,b3 as Q}from"./index-C7yI3-qS.js";import{eX as K,eN as Y,Ly as I,Lz as ee,ts as ae,ti as g,eZ as re,bM as ne,tn as te,LA as se}from"./zeni-epic-state-CVuyWhoX.js";import{D as oe,e as ie,n as le,S as ce}from"./mui-DW04nVBh.js";import{u as de}from"./useAskAiCfoHostNavButtonProps-COcfEAPF.js";import{c as fe}from"./useFetchSuggestedQuestionsWhenReady-Dye8etNE.js";import{M as ue}from"./MobileAppDrawer-DuACKsl0.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]="673b426e-b6fa-44fc-8289-e9715edea31c",e._sentryDebugIdIdentifier="sentry-dbid-673b426e-b6fa-44fc-8289-e9715edea31c")}catch{}})();const pe={overlayWidth:new Z(100,100,30)},we=({isReferralDrawerOpen:e,closeDrawerHandler:a})=>{const r=_(),n=z();if(R.getSignedInUser()==null)throw Error("Can't access How Referral works without signing in...");const i=()=>{a(!0)},u=f(c=>K(c));return s.jsx(oe,{anchor:"right",open:e,PaperProps:{style:{width:pe.overlayWidth.valuePercentage(n),boxShadow:"none"}},slotProps:{backdrop:{style:{opacity:.75,backgroundColor:r.colors.black,cursor:"pointer"}}},onClose:()=>i(),children:s.jsx(ie,{in:e,direction:"left",children:s.jsx(ge,{onClick:c=>c.stopPropagation(),children:s.jsx(U,{onDismissClick:i,rewardsPlan:u.rewardsPlan})})})})},ge=le(ce)`
2
2
  display: flex;
3
3
  min-height: 100%;
4
4
  flex-direction: column;
5
- `,P="refer-and-earn-status-update",ke=M(function(e){const a=I(e),r=e.referralViewState.rewardsPlanFetchState,n=ne([a,r]);return{inviteList:a.invitations,uiState:a.uiState,pendingBonus:a.pendingBonus,earnedBonus:a.earnedBonus,pendingReferrals:a.pendingReferrals,fetchState:n.fetchState,rewardsPlan:a.rewardsPlan}},function(e,a){const{navigate:r}=a;return{onColumnSortConfigChanged:(n,i)=>{e(se({sortOrder:i,sortkey:n}))},onInviteClick:()=>{l.trackRewardsPageClicked("invite via email"),r("../refer")},onHowItWorksClick:()=>{l.trackRewardsPageClicked("know more"),r("../how-it-works")},onResendInviteClick:n=>{l.trackRewardsPageClicked("resend invite"),e(te(n))},onBackClick:()=>{r("../",{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 a=N(),r=V(),n=W(),[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}=$();o.useEffect(()=>{h?.rewardsLastViewedTime==null&&D===!1&&(r(ae()),A(!0))},[]),o.useEffect(()=>{!i&&y==="Not-Started"&&c&&(u(!0),r(g(!0)))},[y,r,c]),o.useEffect(()=>{!d&&w.fetchState==="Not-Started"&&c&&(x(!0),r(re(!0)))},[w,r,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,F)=>{F.onEventReceived(t)}};return s.jsxs(s.Fragment,{children:[b===!0?s.jsx(q,{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),a("..")},isReferralDrawerOpen:k}):null,s.jsx(ke,{location:n,navigate:a,currentTenant:h,onClickMenuIcon:()=>{v(!0)},isAiCfoAccessEnabled:T,onAskAiCfoClick:B,...H})]})}export{Pe as R};
5
+ `,P="refer-and-earn-status-update",ke=M(function(e){const a=I(e),r=e.referralViewState.rewardsPlanFetchState,n=ne([a,r]);return{inviteList:a.invitations,uiState:a.uiState,pendingBonus:a.pendingBonus,earnedBonus:a.earnedBonus,pendingReferrals:a.pendingReferrals,fetchState:n.fetchState,rewardsPlan:a.rewardsPlan}},function(e,a){const{navigate:r}=a;return{onColumnSortConfigChanged:(n,i)=>{e(se({sortOrder:i,sortkey:n}))},onInviteClick:()=>{l.trackRewardsPageClicked("invite via email"),r("../refer")},onHowItWorksClick:()=>{l.trackRewardsPageClicked("know more"),r("../how-it-works")},onResendInviteClick:n=>{l.trackRewardsPageClicked("resend invite"),e(te(n))},onBackClick:()=>{r("../",{relative:"path"})},onReloadInvitees:()=>{e(g(!0))},onCopyReferralLink:()=>{l.trackRewardsPageClicked("copy referral link")},onClickRefer:()=>{l.trackRewardsPageClicked("refer")},onEventReceived:n=>{n===P&&e(g(!0,!0))}}})(G(Q));function Pe({isReferralDrawerOpen:e}){const a=N(),r=V(),n=W(),[i,u]=o.useState(!1),[c,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)),b=m.fetchState,w=f(t=>t.referralViewState.rewardsPlanFetchState),y=ee([m,w]),{areTenantIdsInSync:d}=$();o.useEffect(()=>{h?.rewardsLastViewedTime==null&&D===!1&&(r(ae()),A(!0))},[]),o.useEffect(()=>{!i&&b==="Not-Started"&&d&&(u(!0),r(g(!0)))},[b,r,d]),o.useEffect(()=>{!c&&w.fetchState==="Not-Started"&&d&&(x(!0),r(re(!0)))},[w,r,d]),o.useEffect(()=>{C(e!=null&&e===!0)},[e]);const[E,j]=o.useState(!1),v=t=>{j(t)},{isAiCfoOpen:O,setIsAiCfoOpen:L}=J(),{isAiCfoAccessEnabled:T,onAskAiCfoClick:B}=de({isAiCfoOpen:O,setIsAiCfoOpen:L,mobileExploreReferrer:"Rewards"});fe({isDataReady:y===!0});const H={events:p?.userId!=null?[`private-${p.userId}.${P}`]:[],eventCallback:(t,S,F)=>{F.onEventReceived(t)}};return s.jsxs(s.Fragment,{children:[y===!0?s.jsx(X,{analytics:l,onLoad:t=>(S=>{p!=null&&S.trackPageLoaded(q.Event.rewardsPageViewed)})(t)}):null,s.jsx(ue,{isAppContentDrawerOpen:E,handleDrawerToggle:v}),k===!0?s.jsx(we,{closeDrawerHandler:()=>{C(!1),a("..")},isReferralDrawerOpen:k}):null,s.jsx(ke,{location:n,navigate:a,currentTenant:h,onClickMenuIcon:()=>{v(!0)},isAiCfoAccessEnabled:T,onAskAiCfoClick:B,...H})]})}export{Pe as R};
@@ -1 +1 @@
1
- import{j as t}from"./liveblocks-n5yWztsO.js";import R from"./NotFoundScreen-BRYvV6H8.js";import{a as p}from"./sentry-BKXoW7cS.js";import{j as x,u as C,h as A,g as u,N as E,k,n as D,o as c}from"./core-DD1dfJeB.js";import{eN as T,Ms as g,MI as S,Cp as V,By as U,Co as m,Cf as _,MX as B}from"./zeni-epic-state-EPc5wQ9y.js";import{h as M,z as N,B as $,a1 as O,bI as W,aa as z}from"./index-BkSp81D-.js";import"./mui-BTXLmTm-.js";import{R as v}from"./ReimbursementApprovalRuleDetailScreen-Ck3EFIM0.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]="8bc8b1a8-d9d0-4e15-9f9e-06a5f43b4c3b",e._sentryDebugIdIdentifier="sentry-dbid-8bc8b1a8-d9d0-4e15-9f9e-06a5f43b4c3b")}catch{}})();const d="reimbursement-approval-rule-update",P=k(function(e){return{approvalView:g(e),remiSetupApproverViewUpdateData:S(e).remiSetupApproverViewUpdateData}},function(e,r){const{navigate:a,location:l}=r;return{onApprovalRulesEventReceived:n=>{n.endsWith(d)&&e(B(!1))},onBackClick:()=>{z(l)?a("../../"):a("../../../reimbursements/setup")},onDeleteRuleClick:n=>{e(_(n))},onEditRuleClick:n=>{n!=null?(e(m(n)),a(`./${n}/edit`)):(e(m()),a("./new"))}}})(O(W)),X=()=>{const e=x(),r=C(),a=A(),[l,n]=p.useState(!1),[f,y]=p.useState(!1),b=u(s=>s.remiSetupApproverViewState.fetchState),o=u(s=>T(s)),w=M(),i=u(s=>g(s)),h=u(s=>S(s).remiSetupApproverViewUpdateData);if(p.useEffect(()=>{h?.updateStatus.fetchState==="Completed"&&a(V())},[h]),p.useEffect(()=>{l||b!=="Not-Started"||(n(!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(m())),e("./new"))},[f,i,a]);const j={events:o.companyId!=null?[`private-${o.companyId}.${d}`]:[],eventCallback:(s,q,I)=>{s.endsWith(d)&&I.onApprovalRulesEventReceived(s)}};return o.companyReimbursementInfo?.info?.isReimbursementTOSAccepted===!1?t.jsx(E,{to:"../../promo"}):o.companyReimbursementInfo?.info?.isReimbursementTOSAccepted!==!0||i.fetchState!=="Completed"&&i.fetchState!=="Error"?t.jsx($,{fetchState:"In-Progress",style:{backgroundColor:w.colors.grey5}}):t.jsx(P,{currentTenant:o,location:r,navigate:e,...j})};function Z(){return t.jsxs(D,{children:[t.jsx(c,{path:"/",element:t.jsx(X,{})}),t.jsx(c,{path:"/new",element:t.jsx(v,{})}),t.jsx(c,{path:"/:approvalRuleId/edit",element:t.jsx(v,{})}),t.jsx(c,{path:"*",element:t.jsx(R,{})})]})}export{Z as R};
1
+ import{j as t}from"./liveblocks-BPC8B-82.js";import R from"./NotFoundScreen-By6iX_AK.js";import{a as p}from"./sentry-CWaXw80H.js";import{j as x,u as C,h as A,g as u,N as E,k,n as D,o as c}from"./core-D5Hit8x-.js";import{eN as T,Ms as g,MI as S,Cp as V,By as U,Co as m,Cf as _,MX as M}from"./zeni-epic-state-CVuyWhoX.js";import{h as N,z as $,v as B,a1 as O,bI as W,aa as z}from"./index-C7yI3-qS.js";import"./mui-DW04nVBh.js";import{R as v}from"./ReimbursementApprovalRuleDetailScreen-DYUjSPeD.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]="4d516225-e492-42b1-9275-ea366c3039eb",e._sentryDebugIdIdentifier="sentry-dbid-4d516225-e492-42b1-9275-ea366c3039eb")}catch{}})();const d="reimbursement-approval-rule-update",P=k(function(e){return{approvalView:g(e),remiSetupApproverViewUpdateData:S(e).remiSetupApproverViewUpdateData}},function(e,r){const{navigate:a,location:l}=r;return{onApprovalRulesEventReceived:n=>{n.endsWith(d)&&e(M(!1))},onBackClick:()=>{z(l)?a("../../"):a("../../../reimbursements/setup")},onDeleteRuleClick:n=>{e(_(n))},onEditRuleClick:n=>{n!=null?(e(m(n)),a(`./${n}/edit`)):(e(m()),a("./new"))}}})(O(W)),X=()=>{const e=x(),r=C(),a=A(),[l,n]=p.useState(!1),[f,y]=p.useState(!1),b=u(s=>s.remiSetupApproverViewState.fetchState),o=u(s=>T(s)),w=N(),i=u(s=>g(s)),h=u(s=>S(s).remiSetupApproverViewUpdateData);if(p.useEffect(()=>{h?.updateStatus.fetchState==="Completed"&&a(V())},[h]),p.useEffect(()=>{l||b!=="Not-Started"||(n(!0),a(U(!0)))},[l,b,a]),$.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(m())),e("./new"))},[f,i,a]);const j={events:o.companyId!=null?[`private-${o.companyId}.${d}`]:[],eventCallback:(s,q,I)=>{s.endsWith(d)&&I.onApprovalRulesEventReceived(s)}};return o.companyReimbursementInfo?.info?.isReimbursementTOSAccepted===!1?t.jsx(E,{to:"../../promo"}):o.companyReimbursementInfo?.info?.isReimbursementTOSAccepted!==!0||i.fetchState!=="Completed"&&i.fetchState!=="Error"?t.jsx(B,{fetchState:"In-Progress",style:{backgroundColor:w.colors.grey5}}):t.jsx(P,{currentTenant:o,location:r,navigate:e,...j})};function Z(){return t.jsxs(D,{children:[t.jsx(c,{path:"/",element:t.jsx(X,{})}),t.jsx(c,{path:"/new",element:t.jsx(v,{})}),t.jsx(c,{path:"/:approvalRuleId/edit",element:t.jsx(v,{})}),t.jsx(c,{path:"*",element:t.jsx(R,{})})]})}export{Z as R};
@@ -1 +1 @@
1
- import{j as g}from"./liveblocks-n5yWztsO.js";import{a as y}from"./sentry-BKXoW7cS.js";import{j as w,h as A,u as C,l as T,g as b,k as U}from"./core-DD1dfJeB.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-EPc5wQ9y.js";import{z as k,h as V,B as j,bz as F,aa as O}from"./index-BkSp81D-.js";import"./mui-BTXLmTm-.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-BPC8B-82.js";import{a as y}from"./sentry-CWaXw80H.js";import{j as w,h as A,u as C,l as T,g as b,k as U}from"./core-D5Hit8x-.js";import{MI as R,Ms as E,Ci as x,Cr as _,Cp as S,Cq as h,MJ as k}from"./zeni-epic-state-CVuyWhoX.js";import{z as B,h as V,v as j,bz as F,aa as O}from"./index-C7yI3-qS.js";import"./mui-DW04nVBh.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]="1d55c97f-9210-4449-bfe8-2015c892173d",e._sentryDebugIdIdentifier="sentry-dbid-1d55c97f-9210-4449-bfe8-2015c892173d")}catch{}})();function $(e){return k(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(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=B.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};