@zeniai/web-app-ui 5.2.16-qa → 5.2.17-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 (142) hide show
  1. package/dist/assets/AddressRoutes-B2KIG7En.js +1 -0
  2. package/dist/assets/AddressScreen-BRHUGjlq.js +9 -0
  3. package/dist/assets/{AiCfoScreen-DiSXwSAy.js → AiCfoScreen-HMy5Y7Mq.js} +4 -4
  4. package/dist/assets/{BillPayApprovalRoutes-Bzj_wN2N.js → BillPayApprovalRoutes-ClKax7IT.js} +1 -1
  5. package/dist/assets/BillPayRoutes-BChpGQL2.js +119 -0
  6. package/dist/assets/BusinessVerificationPageScreen-BwMN9nGs.js +9 -0
  7. package/dist/assets/{CardsAiCfoScreen-CvKPSEX_.js → CardsAiCfoScreen-DO_y52lp.js} +3 -3
  8. package/dist/assets/{ChargeCardRoutes-B_kWsesI.js → ChargeCardRoutes-Dv5pDzqZ.js} +8 -8
  9. package/dist/assets/CompanyPassportScreen-DpirfeBa.js +1 -0
  10. package/dist/assets/ConnectionAuthScreen-rOB6ynUK.js +11 -0
  11. package/dist/assets/CustomerOnboardingAuthScreen-C98l4ZVS.js +1 -0
  12. package/dist/assets/{CustomerOnboardingRoutes-fNU7A_X6.js → CustomerOnboardingRoutes-D_6fNZiA.js} +6 -6
  13. package/dist/assets/{DashboardRoutes-vwFGyOnq.js → DashboardRoutes-Cp_J4k4_.js} +1 -1
  14. package/dist/assets/DefaultTenantHome-D0bfOiik.js +1 -0
  15. package/dist/assets/DomesticWireDetailScreen-CEzBRH9X.js +18 -0
  16. package/dist/assets/DrawerScreen-CTCbWuBb.js +1 -0
  17. package/dist/assets/EntityDetailRoutes-8jxY5Riu.js +1 -0
  18. package/dist/assets/{ExpenseAutomationRoutes-Bcbqp-xi.js → ExpenseAutomationRoutes-BLGJhe2d.js} +3 -3
  19. package/dist/assets/{FeaturePreviewScreen-CQa-Dzig.js → FeaturePreviewScreen-BYw0siNX.js} +1 -1
  20. package/dist/assets/HubSpotOAuthCallbackScreen-D5JpfjXx.js +1 -0
  21. package/dist/assets/MagicLinkRoutes-DJ8XQppN.js +72 -0
  22. package/dist/assets/MagicLinkSignInScreen-Pc9aSzuu.js +12 -0
  23. package/dist/assets/MobileAppDrawer-C850zeFL.js +1 -0
  24. package/dist/assets/NotFoundScreen-D8y3QSjF.js +1 -0
  25. package/dist/assets/NotificationRoutes-CgDlCmJS.js +1 -0
  26. package/dist/assets/OAuthConsentScreen-BHm1bSWe.js +1 -0
  27. package/dist/assets/PandLWithForecastRoutes-CxkAljmn.js +1 -0
  28. package/dist/assets/PeopleRoutes-Cwuko2wK.js +22 -0
  29. package/dist/assets/PerformanceRoutes-Cpl-d1r4.js +1 -0
  30. package/dist/assets/{Preview-CcprGnkI.js → Preview-BD6Y1F_q.js} +1 -1
  31. package/dist/assets/{QBOConnectionScreen-TnPId4Sm.js → QBOConnectionScreen-BlMcHgbG.js} +1 -1
  32. package/dist/assets/ReimbursementApprovalRoutes-nJxxaKUX.js +1 -0
  33. package/dist/assets/{ReimbursementApprovalRuleDetailScreen-DdpFdkik.js → ReimbursementApprovalRuleDetailScreen-DXovejDg.js} +1 -1
  34. package/dist/assets/{ReimbursementRoutes-CEVKaVBL.js → ReimbursementRoutes-41mQ1voL.js} +10 -10
  35. package/dist/assets/{ReportsRoutes-B1TQ9Bhd.js → ReportsRoutes-CPxhUqlo.js} +1 -1
  36. package/dist/assets/RewardsRoutes-BXExREiG.js +1 -0
  37. package/dist/assets/ScreenRoutes-DBgtMxcS.js +2 -0
  38. package/dist/assets/{SettingsRoutes-Cwng1-zQ.js → SettingsRoutes-C3VXjgEl.js} +8 -8
  39. package/dist/assets/{SetupPagesScreen-DFoSoY9W.js → SetupPagesScreen-BX3zI3tV.js} +5 -5
  40. package/dist/assets/SignInScreen-DYVSrH1Q.js +1 -0
  41. package/dist/assets/SignOutScreen-D8IS2BPQ.js +9 -0
  42. package/dist/assets/TaskListScreen-DbBL-EqC.js +9 -0
  43. package/dist/assets/TaskRoutes-CP206xuh.js +9 -0
  44. package/dist/assets/{TransactionDetailRoutes-djuKroPk.js → TransactionDetailRoutes-8oHAjr2u.js} +1 -1
  45. package/dist/assets/{TransactionDetailScreen-D5r3-Mgi.js → TransactionDetailScreen-Bfy3N_JT.js} +2 -2
  46. package/dist/assets/{TransactionListRoutes-DZo7bIuR.js → TransactionListRoutes-C46bH8Mo.js} +1 -1
  47. package/dist/assets/{TreasuryRoutes-Dicm3fpM.js → TreasuryRoutes-CzmHsChK.js} +5 -5
  48. package/dist/assets/{VendorsRoutes-CSBYzvJD.js → VendorsRoutes-CUyxWOUM.js} +14 -14
  49. package/dist/assets/WiseConfirmationScreen-lyjRGpZ9.js +12 -0
  50. package/dist/assets/{ZeniAccountRoutes-BZkpbBgO.js → ZeniAccountRoutes-8seJMANR.js} +11 -11
  51. package/dist/assets/ZeniAccountStatementScreen-D_5y24R6.js +9 -0
  52. package/dist/assets/{accountMappingHelper-DvHt_faU.js → accountMappingHelper-Cg1rcuy8.js} +1 -1
  53. package/dist/assets/{analytics-fzE8ssbj.js → analytics-CP-wGaZJ.js} +1 -1
  54. package/dist/assets/analyticsHelper-BZTNTJma.js +1 -0
  55. package/dist/assets/{core-Bnb5S7eF.js → core-4nWRIid2.js} +1 -1
  56. package/dist/assets/{decodeURIComponentSafe-IB5WoVjO.js → decodeURIComponentSafe-B-9vw5Be.js} +1 -1
  57. package/dist/assets/{dnd-BclBZkmc.js → dnd-DPx0nGIt.js} +1 -1
  58. package/dist/assets/{empty-CGGO74v5.js → empty-BWSUSl2t.js} +1 -1
  59. package/dist/assets/{empty-BXrJtoVu.js → empty-dwCpPdyI.js} +1 -1
  60. package/dist/assets/{emptyVideoElement-DBjMlLZt.js → emptyVideoElement-Cgz9sC1U.js} +1 -1
  61. package/dist/assets/epic-BIxKmwU7.js +2 -0
  62. package/dist/assets/getLocaleForTenant-Bpp7IHaZ.js +1 -0
  63. package/dist/assets/{index-D7gFR706.js → index-B89XzExo.js} +1 -1
  64. package/dist/assets/{index-BfeFOTnu.js → index-BEdY_Av6.js} +1 -1
  65. package/dist/assets/{index-BSl9hMca.js → index-C53rjstg.js} +2 -2
  66. package/dist/assets/{index-DQqz4S7_.js → index-CbGX11uA.js} +33478 -32829
  67. package/dist/assets/index-Cx4f0JbF.css +1 -0
  68. package/dist/assets/{index-oAxAWZsp.js → index-D7c6Pfp9.js} +1 -1
  69. package/dist/assets/{index-B9FzYJpE.js → index-DmHtkhiK.js} +1 -1
  70. package/dist/assets/{index-DRI9BXaF.js → index-P8XH9v_Z.js} +1 -1
  71. package/dist/assets/{index-gZ-YqOdE.js → index-ot86Rern.js} +1 -1
  72. package/dist/assets/{lexical-DbVLnI8g.js → lexical-Dce73siJ.js} +1 -1
  73. package/dist/assets/liveblocks-BqtYq8PY.js +54 -0
  74. package/dist/assets/{lottie-CosVBOrn.js → lottie-C6mBeCcV.js} +1 -1
  75. package/dist/assets/{mui-BAFflVdx.js → mui-ChRNPf14.js} +1 -1
  76. package/dist/assets/{pathToGoBack-BX0vhbVE.js → pathToGoBack-DjzKcd4A.js} +1 -1
  77. package/dist/assets/{pdf-Ba7sOjY6.js → pdf-CHegScPw.js} +3 -3
  78. package/dist/assets/{pdf-lib-Sz3Y8uGi.js → pdf-lib-xuF5byC3.js} +1 -1
  79. package/dist/assets/{plaid-Il6Pn-tK.js → plaid-j-SLH4pe.js} +1 -1
  80. package/dist/assets/{pusher-DSTN6BAp.js → pusher-BK7gFb-W.js} +1 -1
  81. package/dist/assets/{react-DjsKx-MP.js → react-Bo9yX59J.js} +1 -1
  82. package/dist/assets/{react-DF-XRbvU.js → react-CWkBMv_4.js} +1 -1
  83. package/dist/assets/{react-Ahj_9ocn.js → react-D_MXXpOM.js} +1 -1
  84. package/dist/assets/{react-BQr1_2Lm.js → react-Dy3J-4XE.js} +1 -1
  85. package/dist/assets/{react-DV1w5wyt.js → react-YqzjdluA.js} +1 -1
  86. package/dist/assets/{react-wreqxVEC.js → react-wzy7xDal.js} +1 -1
  87. package/dist/assets/{recharts-B3FaT6ex.js → recharts-UIIeT-6j.js} +1 -1
  88. package/dist/assets/routePaths-BYuMJjxP.js +1 -0
  89. package/dist/assets/{sentry-Bj_fC7Ll.js → sentry-BtWdTNDK.js} +1 -1
  90. package/dist/assets/{url-CRSVA0N_.js → url-CUWwwyN4.js} +1 -1
  91. package/dist/assets/{url-Cv9qurGb.js → url-CkFCyaeM.js} +1 -1
  92. package/dist/assets/{useAiCfoDashboardSuggestedQuestionsChips-C3L5nQ7N.js → useAiCfoDashboardSuggestedQuestionsChips-7YoEarS7.js} +1 -1
  93. package/dist/assets/useAskAiCfoHostNavButtonProps-DuEP5Klm.js +1 -0
  94. package/dist/assets/useCashManagementBanner-_9igQwqA.js +1 -0
  95. package/dist/assets/{useChargeCardPusherEvents-t2lV6Mj_.js → useChargeCardPusherEvents-DCjAMeeL.js} +1 -1
  96. package/dist/assets/{useDeviceId-CnUmsNEA.js → useDeviceId-BVGc_c85.js} +1 -1
  97. package/dist/assets/useEmailConnectResultRefresh-BTnBt-Sy.js +1 -0
  98. package/dist/assets/{useInitialThreadRequest-DA5ML13t.js → useInitialThreadRequest-BMuxer3t.js} +1 -1
  99. package/dist/assets/{utils-BKBg63lI.js → utils-BGj88Dzy.js} +1 -1
  100. package/dist/assets/{withTransactionSidePanel-ZD8SIzTb.js → withTransactionSidePanel-MO-qZsKE.js} +2 -2
  101. package/dist/assets/{zeni-epic-state-GXytJkko.js → zeni-epic-state-Brhydpej.js} +6 -6
  102. package/dist/index.html +1 -1
  103. package/package.json +8 -5
  104. package/dist/assets/AddressRoutes-CvVopZml.js +0 -1
  105. package/dist/assets/AddressScreen-DWZ3m1W6.js +0 -9
  106. package/dist/assets/BillPayRoutes-Bf6AaWgJ.js +0 -119
  107. package/dist/assets/BusinessVerificationPageScreen-DFVMEcvH.js +0 -9
  108. package/dist/assets/CompanyPassportScreen-D3CNonob.js +0 -1
  109. package/dist/assets/ConnectionAuthScreen-BN3ff9tH.js +0 -11
  110. package/dist/assets/CustomerOnboardingAuthScreen-DlKfeAMx.js +0 -1
  111. package/dist/assets/DefaultTenantHome-COmsVe67.js +0 -1
  112. package/dist/assets/DomesticWireDetailScreen-Bmq0Ta-G.js +0 -18
  113. package/dist/assets/DrawerScreen-CFNs8DOc.js +0 -1
  114. package/dist/assets/EntityDetailRoutes-BhHCRnyf.js +0 -1
  115. package/dist/assets/HubSpotOAuthCallbackScreen-yv2-7Ea8.js +0 -1
  116. package/dist/assets/MagicLinkRoutes-DSjPLdSb.js +0 -72
  117. package/dist/assets/MagicLinkSignInScreen-D_r-xHBU.js +0 -12
  118. package/dist/assets/MobileAppDrawer-CcKlE5IP.js +0 -1
  119. package/dist/assets/NotFoundScreen-DlOrYovK.js +0 -1
  120. package/dist/assets/NotificationRoutes-gyrenPAq.js +0 -1
  121. package/dist/assets/OAuthConsentScreen-1d0A0tZs.js +0 -1
  122. package/dist/assets/PandLWithForecastRoutes-DjhLwT7A.js +0 -1
  123. package/dist/assets/PeopleRoutes-B4_xTiyk.js +0 -22
  124. package/dist/assets/PerformanceRoutes-DylBZUt_.js +0 -1
  125. package/dist/assets/ReimbursementApprovalRoutes-POVUD6sL.js +0 -1
  126. package/dist/assets/RewardsRoutes-DfP429d0.js +0 -1
  127. package/dist/assets/ScreenRoutes-B4XnnElP.js +0 -2
  128. package/dist/assets/SignInScreen-e-dzxuhM.js +0 -1
  129. package/dist/assets/SignOutScreen-zX0f3nhU.js +0 -9
  130. package/dist/assets/TaskListScreen-DDBul9iH.js +0 -9
  131. package/dist/assets/TaskRoutes-8qo7Ls7z.js +0 -9
  132. package/dist/assets/WiseConfirmationScreen-Cq4Two3C.js +0 -12
  133. package/dist/assets/ZeniAccountStatementScreen-CrIZG1fJ.js +0 -9
  134. package/dist/assets/analyticsHelper-H9dml3jr.js +0 -1
  135. package/dist/assets/epic-Bq9rvz3h.js +0 -2
  136. package/dist/assets/getLocaleForTenant-CqG7z-4D.js +0 -1
  137. package/dist/assets/index-Czu7h9lW.css +0 -1
  138. package/dist/assets/liveblocks-bqFl_SVp.js +0 -54
  139. package/dist/assets/routePaths-BU7xzRci.js +0 -1
  140. package/dist/assets/useAskAiCfoHostNavButtonProps-C8xAByz8.js +0 -1
  141. package/dist/assets/useCashManagementBanner-7vax8nj5.js +0 -1
  142. package/dist/assets/useEmailConnectResultRefresh-GsUIcf-d.js +0 -1
@@ -0,0 +1,72 @@
1
+ import{j as a}from"./liveblocks-BqtYq8PY.js";import{i as S,n as x,h as C,g as y,u as ee,t as ae,j as N,N as te,o as ne,p}from"./core-4nWRIid2.js";import{MG as k,MH as v,MI as M,BC as B,Bo as T,MJ as D,MK as oe,ML as se,Bs as ie,fE as $,Bz as le,Bw as re}from"./zeni-epic-state-Brhydpej.js";import{J as g,o as r,r as de,e as j,m as G,s as ce,v as me,O as pe,x as H,w as ue,i as he,y as xe,A as ge,E as fe,B as we,C as be,Z as Se,Q as ye,S as ke,F as ve,G as je,H as $e}from"./index-CbGX11uA.js";import{n as m}from"./mui-ChRNPf14.js";import f from"./NotFoundScreen-D8y3QSjF.js";import{a as I}from"./sentry-BtWdTNDK.js";import"./recharts-UIIeT-6j.js";import"./analytics-CP-wGaZJ.js";import"./plaid-j-SLH4pe.js";import"./dnd-DPx0nGIt.js";import"./stripe-cKAAJElX.js";import"./lottie-C6mBeCcV.js";import"./lexical-Dce73siJ.js";import"./pdf-CHegScPw.js";import"./utils-BGj88Dzy.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]="b245afc9-ada8-4ea7-97c7-75c36a326dca",e._sentryDebugIdIdentifier="sentry-dbid-b245afc9-ada8-4ea7-97c7-75c36a326dca")}catch{}})();const Ie=m.div`
2
+ display: flex;
3
+ height: 100%;
4
+ width: 100%;
5
+ flex: 1 1 auto;
6
+ flex-direction: column;
7
+ align-items: center;
8
+ background-color: ${e=>e.theme.colors.grey4};
9
+ box-shadow: ${e=>`0px 2px ${r.sp1} ${e.theme.colors.dropShadowNormal}`};
10
+ `,Ce=x((function(e){const t=k(e),n=v(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:s=>{e(T(s))},onSaveHandler:s=>{j.trackBillPayMagicLinkSubmitBankAccountDetails(o),e(B(s,"standard",n,o))},onACHDetailsUpdated:s=>{const{bankAccountSection:l}=s;e(M({data:l}))}}}))(de);function F(){const e=g(),{vendorId:t,billId:n}=S();return t==null||n==null?a.jsx(f,{}):a.jsx(a.Fragment,{children:a.jsx(Ie,{windowSize:e,children:a.jsx(Ce,{vendorId:t,billId:n})})})}const Be=m.div`
11
+ display: flex;
12
+ height: 100vh;
13
+ width: 100%;
14
+ flex: 1 1 auto;
15
+ flex-direction: column;
16
+ align-items: center;
17
+ background-color: ${e=>e.theme.colors.grey4};
18
+ box-shadow: ${e=>`0px 2px ${r.sp1} ${e.theme.colors.dropShadowNormal}`};
19
+ `,De=x((function(e,t){const{isSubPage:n}=t;return{addressToEdit:D(e),googleAPIKey:G.googleMapsAPIKey,isSubPage:n}}),(function(e,t){const{navigate:n,location:o}=t,s=()=>{const l=me(o.state?.pathnameStackToGoBack),i=l.poppedPathname??Pe();n(i,{state:{pathnameStackToGoBack:l.newStack}})};return{onSubmitHandler:l=>{const i=ze(l);e(oe({addressToCreate:i})),s()},onCancel:()=>{s()}}}))(ce);function Ae({isSubPage:e}){const t=C(),n=y(),o=g();return a.jsx(a.Fragment,{children:a.jsx(Be,{windowSize:o,children:a.jsx(De,{location:n,navigate:t,isSubPage:e===!0,googleAPIKey:G.googleMapsAPIKey})})})}const Pe=(e=2)=>{let t="../";for(let n=0;n<e;n++)t=`${t}../`;return t},ze=e=>({street:[e.street.addressString,e.suite,e.secondaryInfo],city:e.city,state:e.state,country:e.country.selectedOption??"",countryCode:e.countryCode,postalCode:e.postalCode,latitude:e.street.addressValue?.locationLat,longitude:e.street.addressValue?.locationLng}),Le=m.div`
20
+ display: flex;
21
+ height: 100%;
22
+ width: 100%;
23
+ flex: 1 1 auto;
24
+ flex-direction: column;
25
+ align-items: center;
26
+ background-color: ${e=>e.theme.colors.grey4};
27
+ box-shadow: ${e=>`0px 2px ${r.sp1} ${e.theme.colors.dropShadowNormal}`};
28
+ `,Ee=x((function(e){const t=k(e),n=v(e),o=D(e),{companyName:s}=t;return{companyName:s,isDisabled:t.fetchState!=="Completed"?"disabled":void 0,magicLinkBankAccountDetails:n,mailingAddressDetails:o,magicLinkViewState:t}}),(function(e,t){const{navigate:n,location:o,vendorId:s,billId:l}=t;return{onFetchBankName:i=>{e(T(i))},onSaveHandler:i=>{j.trackBillPayMagicLinkSubmitBankAccountDetails(l),e(B(i,"us-domestic",s,l))},onWireDetailsUpdated:i=>{const{bankAccountSection:d}=i;e(M({data:d}))},onAddressClick:()=>{const i=o.pathname.replace("us-domestic","address"),d=H(o.state?.pathnameStackToGoBack,o.pathname);n(i,{state:{pathnameStackToGoBack:d}})}}}))(pe);function Ne(){const e=C(),t=y(),n=g(),{vendorId:o,billId:s}=S();return o==null||s==null?a.jsx(f,{}):a.jsx(a.Fragment,{children:a.jsx(Le,{windowSize:n,children:a.jsx(Ee,{location:t,navigate:e,vendorId:o,billId:s})})})}const Fe=m.div`
29
+ display: flex;
30
+ height: 100%;
31
+ width: 100%;
32
+ flex: 1 1 auto;
33
+ flex-direction: column;
34
+ align-items: center;
35
+ background-color: ${e=>e.theme.colors.grey4};
36
+ box-shadow: ${e=>`0px 2px ${r.sp1} ${e.theme.colors.dropShadowNormal}`};
37
+ `,Me=x((function(e){const t=k(e),n=v(e),o=D(e),{companyName:s}=t;return{companyName:s,isDisabled:t.fetchState!=="Completed"?"disabled":void 0,magicLinkBankAccountDetails:n,mailingAddressDetails:o,magicLinkViewState:t}}),(function(e,t){const{navigate:n,location:o,vendorId:s,billId:l}=t;return{onFetchBankNameBySwift:i=>{e(ie(i))},onSaveHandler:i=>{j.trackBillPayMagicLinkSubmitBankAccountDetails(l),e(B(i,"international",s,l,t.isLocalCurrencyEnabled))},onBankDetailsUpdated:i=>{const{internationalWireSwiftAccountSection:d}=i;e(se({data:d}))},onAddressClick:()=>{const i=o.pathname.replace("international","address"),d=H(o.state?.pathnameStackToGoBack,o.pathname);n(i,{state:{pathnameStackToGoBack:d}})}}}))(xe);function Te(){const e=C(),t=y(),n=g(),{vendorId:o,billId:s}=S(),{useFeatureGate:l}=ue(),{isFeatureEnabled:i}=l(he.isBillPayLocalCurrencyFeatureEnabled);return o==null||s==null?a.jsx(f,{}):a.jsx(Fe,{windowSize:n,children:a.jsx(Me,{location:t,navigate:e,vendorId:o,billId:s,isLocalCurrencyEnabled:i})})}const Ge={containerWidth:new je(100,58)},He=m(ke)`
38
+ width: ${r.sp4};
39
+ height: ${r.sp4};
40
+ margin-bottom: ${r.sp3};
41
+ margin-top: ${r.sp3};
42
+ margin-left: ${r.sp8};
43
+ cursor: pointer;
44
+ position: absolute;
45
+ color: ${e=>e.theme.colors.brandColorJade};
46
+ `,Ke=m.div`
47
+ display: flex;
48
+ height: 100vh;
49
+ flex-direction: ${e=>e.windowSize==="small"?"column":"row"};
50
+ width: 100vw;
51
+ overflow-y: scroll;
52
+ background-color: ${e=>e.theme.colors.grey4};
53
+ `,Ve=m.div`
54
+ display: flex;
55
+ flex-direction: ${e=>e.windowSize==="small"?"column":"row"};
56
+ flex-direction: column;
57
+ width: ${e=>`${Ge.containerWidth.value(e.windowSize)}%`};
58
+ ${e=>e.windowSize!=="small"?"overflow: auto;":""}
59
+ box-shadow: ${e=>`0px 2px ${r.sp1} ${e.theme.colors.dropShadowNormal}`};
60
+ padding-top: ${e=>e.windowSize!=="small"?r.sp2:"0px"};
61
+ `,_e=m.div`
62
+ display: flex;
63
+ flex-direction: column;
64
+ align-items: center;
65
+ justify-content: center;
66
+ padding: ${e=>e.windowSize==="small"?r.sp3:`62px ${r.sp6} ${r.sp9} ${r.sp8}`};
67
+ height: ${e=>e.windowSize==="small"?"490px":"auto"};
68
+ overflow: ${e=>e.windowSize==="small"?"unset":"hidden"};
69
+ width: ${e=>e.windowSize=="small"?"auto":"42%"};
70
+ background-color: ${e=>e.windowSize==="small"?e.theme.colors.grey4:e.theme.colors.background};
71
+ margin-top: ${e=>e.windowSize==="small"?e.isAddressPage?"0px":"186px":"unset"};
72
+ `,We=x((function(e,t){return{file:t.file,type:t.type}}))(ve);function h({appContent:e}){const t=ee(),n=y(),{tenantEmailDomain:o,vendorId:s,billId:l}=S(),[i]=ae(),d=i.get("token"),K=n.pathname.includes("address"),w=g(),V=ge(),A=fe(),b=we(),_=()=>{V.toggle()},W=N((u=>k(u))),J=N((u=>v(u))),{authParams:U,fetchState:c,billAttachment:O,billFetchState:P,companyName:Z,currencySymbol:q,amount:Q}=W,{tenantId:z,userId:L,sessionId:E}=U,{fetchState:R,internationalBankAccountCreateStatus:X}=J;return I.useEffect((()=>{$()}),[]),I.useEffect((()=>{b&&c==="Not-Started"&&s!=null&&o!=null&&d!=null&&t(le(s,o,d))}),[b,c,s,o,d,t]),I.useEffect((()=>{b&&c==="Completed"&&($(L,E,z),l!=null&&t(re(l)))}),[c,b,L,E,z,l,t]),c==="Error"?a.jsx(f,{}):R==="Completed"||X.fetchState==="Completed"?($(),a.jsx(te,{to:"../../../../../../../bank/account/save/success",replace:!0,relative:"path"})):c==="In-Progress"?a.jsx(be,{fetchState:c,style:{height:"100vh",backgroundColor:A.colors.grey5,boxShadow:`0px 2px ${r.sp1} ${A.colors.dropShadowNormal}`}}):a.jsxs(a.Fragment,{children:[c==="Completed"&&P==="Completed"&&a.jsx(Se,{analytics:j,onLoad:u=>(Y=>Y.trackBillPayMagicLinkPageLoad(o??"",s??"",Z,l??"",Je(n.pathname),q,Q))(u)}),a.jsxs(Ke,{windowSize:w,children:[w!=="small"?a.jsx(He,{onClick:_}):null,a.jsx(_e,{windowSize:w,isAddressPage:K,children:P==="In-Progress"?a.jsx(ye,{size:"ExtraLarge",start:!0}):a.jsx(We,{file:O,type:"bill"})}),a.jsx(Ve,{windowSize:w,children:e})]})]})}const Je=e=>`${e.split("/").at(-2)}_${e.split("/").at(-1)}`;function Ue(){return a.jsx($e,{})}function da(){return a.jsxs(ne,{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(F,{})})}),a.jsx(p,{path:":tenantEmailDomain/vendor/:vendorId/bill/:billId/ach/same-day",element:a.jsx(h,{appContent:a.jsx(F,{})})}),a.jsx(p,{path:":tenantEmailDomain/vendor/:vendorId/bill/:billId/wire/address",element:a.jsx(h,{appContent:a.jsx(Ae,{isSubPage:!0})})}),a.jsx(p,{path:":tenantEmailDomain/vendor/:vendorId/bill/:billId/wire/us-domestic",element:a.jsx(h,{appContent:a.jsx(Ne,{})})}),a.jsx(p,{path:":tenantEmailDomain/vendor/:vendorId/bill/:billId/wire/international",element:a.jsx(h,{appContent:a.jsx(Te,{})})}),a.jsx(p,{path:"*",element:a.jsx(f,{})})]})}export{da as default};
@@ -0,0 +1,12 @@
1
+ import{j as u}from"./liveblocks-BqtYq8PY.js";import{a as f}from"./sentry-BtWdTNDK.js";import{u as F,g as _,h as O,t as w,j as l,N as x}from"./core-4nWRIid2.js";import{z as r,E as P,a as V,f as A,e as N,h as $,n as B,Q,k as R}from"./index-CbGX11uA.js";import{e$ as W,Mr as q,MB as G,Ms as H,fE as J,g4 as K,Mx as X,gu as Y,c_ as Z,MC as ee,MD as te}from"./zeni-epic-state-Brhydpej.js";import{n as ne}from"./mui-ChRNPf14.js";import{u as ae}from"./useDeviceId-BVGc_c85.js";import{f as se}from"./analyticsHelper-BZTNTJma.js";import{t as ie}from"./getLocaleForTenant-Bpp7IHaZ.js";import"./recharts-UIIeT-6j.js";import"./analytics-CP-wGaZJ.js";import"./plaid-j-SLH4pe.js";import"./dnd-DPx0nGIt.js";import"./stripe-cKAAJElX.js";import"./lottie-C6mBeCcV.js";import"./lexical-Dce73siJ.js";import"./pdf-CHegScPw.js";import"./utils-BGj88Dzy.js";(function(){try{var t=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},s=new t.Error().stack;s&&(t._sentryDebugIds=t._sentryDebugIds||{},t._sentryDebugIds[s]="26bf91bf-a9b5-41ac-a73a-cb6ccfc5f161",t._sentryDebugIdIdentifier="sentry-dbid-26bf91bf-a9b5-41ac-a73a-cb6ccfc5f161")}catch{}})();const C=(t,s)=>t!=null&&t.length>0&&s==="magic_links";function Ce(){const t=F(),s=_(),m=O(),[k]=w(),n=k.get("token"),p=k.get("stytch_token_type"),g=r.getMagicLinkCodeVerifier(),i=ae(),{otpChallenge:c,twoFAPhoneNumber:D,magicLinkEmail:d,verifyDeviceFetchState:E,resendVerifyDeviceOTPFetchState:M}=l((e=>e.tenantState)),S=l((e=>e.tenantState.fetchState)),y=l((e=>e.tenantState.activeTenantFetchState.fetchState)),h=l((e=>e.tenantState.signInState)),I=l((e=>e.tenantState.magicLinkSignInFetchState.fetchState)),a=l((e=>e.tenantState.loggedInUser)),o=l((e=>W(e))),b=l((e=>q(e))),T=r.getSignedInUser(),v=P().mode;f.useEffect((()=>{a?.zeniSessionId==null&&n!=null&&C(n,p)&&i!=null&&g!=null&&(r.saveMagicLinkTriggered(n),t(G(n,i,g)))}),[n,p,t,i,g,a?.zeniSessionId]),f.useEffect((()=>{h!=="In-Progress"||S!=="Completed"&&y!=="Completed"||a?.zeniSessionId==null||o==null||(n!=null&&r.saveLastUsedMagicLinkToken(n),r.saveSignedInUserWithSession(a,a.zeniSessionId),r.saveSignedInUserTenants(H(b.tenantsInOrder),a.zeniSessionId),J(a.userId,a.zeniSessionId,o.tenantId),t(K(o.tenantId)),r.saveActiveTenantDomainForUser(o.tenantEmailDomain),t(X("Completed")),V.updateAppLocaleID(ie(o)),se(a,o,v,void 0,b.tenantsInOrder),Y().then((()=>{const e=R();e!=null&&A(e)})),setTimeout((()=>{N.trackLogin($.Event.loginSuccess,"email",Z(o.productSettings))}),2e3))}),[h,S,y,a,o,b,v,s.state,t]);const z=f.useCallback((()=>{m("/signin/auth")}),[m]),U=f.useCallback((()=>{i!=null&&c!=null&&d!=null&&t(ee(i,d,c))}),[i,c,t,d]),j=f.useCallback((e=>{i!=null&&n!=null&&d!=null&&c!=null&&t(te(e,i,d,c))}),[i,n,t,d,c]);if(I==="Completed"&&c!=null)return u.jsx(B,{phoneNumber:D,verifyOtpFetchState:E.fetchState,resendVerifyDeviceOTPFetchState:M,onResendOtp:U,onVerifyOtp:j,onCancelVerifyDevice:z});if(h==="In-Progress"&&S==="Completed"&&a?.zeniSessionId!=null&&o!=null||T!=null){const e=s.state?.origin??"/";return u.jsx(x,{to:e,state:{...s.state,origin:""}})}if(!C(n,p)||g==null||I==="Error"){const e=s.state?.origin??"/",L=n!=null&&r.getLastUsedMagicLinkToken()===n;return u.jsx(x,{to:e,state:{...s.state,origin:"",magicLinkAlreadyUsed:L,magicLinkExpired:!L&&(r.isMagicLinkTriggered(n??"")||I==="Error"&&a?.zeniSessionId==null)}})}return u.jsx(oe,{"data-testid":"smooth-loader",children:u.jsx(Q,{size:"ExtraLarge",start:!0})})}const oe=ne.div`
2
+ position: fixed;
3
+ top: 0;
4
+ left: 0;
5
+ right: 0;
6
+ bottom: 0;
7
+ display: flex;
8
+ align-items: center;
9
+ justify-content: center;
10
+ z-index: 9999;
11
+ background-color: ${t=>t.theme.colors.background};
12
+ `;export{Ce as default};
@@ -0,0 +1 @@
1
+ import{j as B}from"./liveblocks-BqtYq8PY.js";import{a as c}from"./sentry-BtWdTNDK.js";import{u as fe,j as n,i as We,g as He,h as Je,l as R}from"./core-4nWRIid2.js";import{e$ as me,fJ as Ke,fK as pe,fv as Qe,bn as Xe,e_ as qe,fL as ea,fM as aa,fO as ta,fR as na,fS as g,fU as sa,fV as de,fY as oa,fW as ia,fX as ra,fZ as da,cQ as la,f$ as ca,cW as ua,fu as fa,g4 as ma,g5 as pa,g3 as ba}from"./zeni-epic-state-Brhydpej.js";import{a9 as ha,aa as Sa,A as ga,w as Ea,z as k,B as ka,u as Ca,i as r,d as ya,R as Ia,ab as Ta,D as _a,c as wa,ac as Aa,a5 as Da,ad as Fa,ae as va,af as le,ag as ce,L as $a,ah as xa,ai as ue,e as G,a1 as Ma,x as _,aj as P,ak as Ra}from"./index-CbGX11uA.js";import{D as Ga}from"./mui-ChRNPf14.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]="141e3a32-ae66-4913-9711-f2175b9c3bae",f._sentryDebugIdIdentifier="sentry-dbid-141e3a32-ae66-4913-9711-f2175b9c3bae")}catch{}})();const Pa=ha((({isAppContentDrawerOpen:f,handleDrawerToggle:d})=>{const{tenantEmailDomain:t}=We(),a=He(),C=ga(),o=Je(),V=Qe(),m=fe(),{useFeatureGate:i}=Ea(),N=k.getSignedInUser(),U=Xe(N),s=n((e=>me(e))),be=s.masterTOSInfo?.isMasterTOSAccepted??!1,O=n((e=>qe(e))),L=O.uiState.currentChatSessionId,y=ka(),{setLoading:he}=Ca(),[w,j]=c.useState(void 0),A=R("/:tenantEmailDomain/dashboard")!==null,Z=R("/:tenantEmailDomain/reports")!==null,I=R("/:tenantEmailDomain/onboarding/*")!==null,Se=!!s.company?.companyZeniAccountInfo?.isZeniAccountEnabled,{isFeatureEnabled:ge}=i(r.isChargeCardFeatureEnabled),{isFeatureEnabled:z}=i(r.isDebitCardFeatureEnabled),Ee=ya(s,ge,z),{isFeatureEnabled:ke}=i(r.isSettingsFeatureEnabled),Y=n((e=>ea(e))),{isFeatureEnabled:T}=i(r.isReferralFeatureEnabled),D=n((e=>aa(e)));c.useEffect((()=>{y&&T&&!I&&D.fetchState==="Not-Started"&&m(ta(!0))}),[y,T,D.fetchState,I]);const h=k.getSignedInUser(),F=n((e=>e.tenantState)),Ce=n((e=>F.fetchState==="Completed"?na(e):[])),E=n((e=>e.expenseAutomationViewState.selectedPeriodByTenantId)),{isFeatureEnabled:ye}=i(r.isApAgingFeatureEnabled),{isFeatureEnabled:Ie}=i(r.isArAgingFeatureEnabled),{isFeatureEnabled:Te}=i(r.isExpenseAutomationEnabled),{isFeatureEnabled:_e}=i(r.isExpenseAutomationEnabledV2),W=Ia(),{isFeatureEnabled:we}=i(r.isDashboardSidebarHalloweenAnimationEnabled),{isFeatureEnabled:Ae}=i(r.isDashboardSidebarThanksGivingAnimationEnabled),{isFeatureEnabled:De}=i(r.isDashboardSidebarChristmasAnimationEnabled),{isFeatureEnabled:Fe}=i(r.isDashboardSidebarNewYearAnimationEnabled),v=s.companyTreasuryInfo?.info?.businessVerificationStatus?.code==="verified",{isFeatureEnabled:ve}=i(r.isTaskManagerCustomerUserAccessEnabled),$e=U||!U&&ve,xe=n((e=>g(e).totalUnreadCount)),Me=n((e=>g(e).reducedFetchCountState)),H=n((e=>g(e).notificationDetailsByTab.tasks.uiState.unreadCount)),J=n((e=>g(e).notificationDetailsByTab.comments.uiState.unreadCount)),Re=n((e=>g(e).notificationDetailsByTab.tasks.fetchCountState)),$=n((e=>g(e).notificationDetailsByTab.comments.fetchCountState)),{inboxNotifications:K,isLoading:Q,isFetchingMore:X,hasFetchedAll:q,fetchMore:Ge}=Ta();c.useEffect((()=>{const e=setTimeout((()=>Ge?.()),0);return()=>clearTimeout(e)})),c.useEffect((()=>{if(Q===!1&&X===!1&&q===!0)if(s?.companyId!=null&&K!=null){const e=`dashboard_${s.companyId}`;j(K.filter((u=>u.roomId===e&&u.readAt==null)).length)}else j(0)}),[Q,X,q]),c.useEffect((()=>{y&&!I&&Re.fetchState==="Not-Started"&&V.tenantId!=null&&m(sa("task_manager","dashboard"))}),[y,V.tenantId]),c.useEffect((()=>{I||$.fetchState!=="Not-Started"||m(de({fetchCountState:{fetchState:"In-Progress",error:void 0}},"comments"))}),[]),c.useEffect((()=>{w!=null&&$.fetchState==="In-Progress"&&(m(de({fetchCountState:{fetchState:"Completed",error:void 0}},"comments")),m(pe({unreadCount:w},"comments")))}),[w,$.fetchState]);const Pe={fetchStatus:Me,count:xe},ee=t!=null?k.getSignedInUserTenant(t):null,ae=n((e=>ee?.tenantId!=null?oa(e,ee.tenantId):void 0)),S=[];ye===!1&&S.push("accounts_payable_aging"),Ie===!1&&S.push("accounts_receivable_aging"),S.push("zeni_accounts_promo_card","treasury_promo_card"),T===!1&&S.push("rewards_card"),W===!1&&S.push("expense_automation_card");const Be=_a(),te=n((e=>ia(e,S,h,_e,Te).fetchState)),ne=n((e=>ra(e).fetchState)),Ve=A&&(te==="Completed"||te==="Error")||Z&&(ne==="Completed"||ne==="Error")||!A&&!Z?void 0:"disabled",Ne=c.useMemo((()=>da(s.userRole)),[s.userRole]),Ue=la(Ne),Oe=s?.rewardsLastViewedTime==null,Le=h?.userEmail!=null&&Y.fetchState==="Completed"&&ca(Y.notificationSettings,h.userEmail,z,s),se=wa(),je=se&&Aa(a),oe=ua(Be?.loggedInUserRoleMap),ie=s.companyTreasuryInfo?.info?.isTreasuryTOSAccepted,x=c.useCallback((()=>v&&oe&&!k.getTreasuryPopupSeen(t??"")&&ie===!1&&Da(a.pathname)!=="treasury"),[v,oe,ie,a.pathname,t]),[Ze,re]=c.useState(x);c.useEffect((()=>{re(x())}),[x]);const ze=n((e=>e.treasurySetupViewState.treasuryFundsDetails)).fundsDetails,Ye=Fa(ze);return B.jsx(Ga,{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:B.jsx(va,{signedInUser:N,currentTenantId:F.currentTenantId??"",tenants:F.fetchState==="Completed"?Ce:ae!=null?[ae]:[],currentTenant:s,isTenantDropdownDisabled:Ve,isSettings:ce(a),isSettingsFeatureEnabled:ke,isVendorsTabVisible:Ue,isZeniAccountEnabled:Se,isChargeCardEnabled:Ee,isTreasuryEnabled:v,treasuryYieldPercentage:Ye,isTreasuryPopupVisible:Ze,isNotificationsTabVisible:Le,notificationCountDetails:Pe,isExpenseAutomationEnabledForUser:W,selectedMenu:le(a),rewardsConfiguration:{isRewardsTabVisible:T,isRewardsAnimated:Oe,rewardsPlan:D.rewardsPlan},isAiCfoAccessEnabled:se,onNotificationIconClick:()=>{d(!1);let e=H===0&&J>0?"notifications/comments":"notifications/tasks";ce(a)&&(e=H===0&&J>0?"../../notifications/comments":"../../notifications/tasks");const u=_(a.state?.pathnameStackToGoBack,a.pathname);o(e,{state:{pathnameStackToGoBack:u}})},handleCockpitClick:()=>{window.open("/cockpit")},handleLogOutClick:()=>{d(!1);const e=_(a.state?.pathnameStackToGoBack,a.pathname);o("/signout",{replace:!0,state:{pathnameStackToGoBack:e,message:"logout"}})},handleMenuChange:e=>{if(d(!1),t==null)return;if(e.type==="ai_cfo"){if(G.trackAICFOChatScreenStateChanged("viewed","left_menu",L??null,null),!be)return void Ma({location:a,navigate:o,mergeState:{referrer:"Sidebar"}});const b=_(a.state?.pathnameStackToGoBack,a.pathname);return void o(`/${t}/ai-cfo/explore`,{state:{pathnameStackToGoBack:b,referrer:"Sidebar"}})}const u=_(a.state?.pathnameStackToGoBack,a.pathname),l=e.type,p=P(l)&&l!=="command_center";if(P(e.type)&&E[s.tenantId]!=null&&G.trackMonthEndCloseClicked(E[s.tenantId].month,E[s.tenantId].year,"Sidebar"),p&&E[s.tenantId]!=null){const b=E[s.tenantId];return void o(`/${t}/month_end_close_checks/review/${e.type}/${b.month}-${b.year}`,{state:{pathnameStackToGoBack:u,referrer:"Sidebar"}})}const M=Ra(e.type);ue(e.type)?(L!=null&&m(ba()),o(`/${t}/ai-cfo/${e.type}`,{state:{pathnameStackToGoBack:u.slice(0,-1),referrer:"Sidebar"}})):o(`/${t}/${M}`,{state:{pathnameStackToGoBack:u,referrer:"Sidebar"}})},handleMyProfileClick:()=>{d(!1),o(`/${t}/settings/my_profile`)},handleReferralsClick:()=>{d(!1),o(`/${t}/rewards`)},handleBackClick:()=>{o(`/${t}/dashboard`)},handleTenantSelect:e=>{he($a.TENANT_SWITCHING),d(!1);const u=e.tenantEmailDomain,l=le(a);let p=`/${encodeURIComponent(u)}/`;const M=P(l);l==="home"?p+="dashboard":l==="users_and_roles"?p+="people":xa(l)?p+="settings/my_profile":ue(l)?p+=`ai-cfo/${l}`:p+=l==="task_checklist"?"tasks":M?"month_end_close_checks/review":encodeURIComponent(l),o(p,{replace:!0}),h!=null&&(m(ma(e.tenantId)),m(pa(h.userId,e.tenantId,h.zeniSessionId)));const b=e;G.trackCompanySwitch(b.companyId,b.companyName,b.userRole)},handlePopupClose:()=>{k.saveTreasuryPopupSeen(t??"",!0),re(!1)},onZeniLogoClick:()=>{C.toggle()},isAiCfo:je,aiCfoView:O,isOnDashboard:A,updateCurrentChatSessionId:e=>{m(fa({sessionId:e,agentId:"controller"})),o(`/${t}/ai-cfo/${e}`,{state:{...a.state}})},halloweenAnimationEnabled:we,isTaskManagerAccessEnabled:$e,thanksGivingAnimationEnabled:Ae,christmasAnimationEnabled:De,newYearAnimationEnabled:Fe})})})),ja=f=>{const d=fe(),t=n((C=>me(C))),a={events:t.userRoleId!=null?[`private-encrypted-${t.userRoleId}.dashboard-user-notification`]:[],eventCallback:(C,o)=>{Sa(o)&&Ke(o.mode)==="dashboard"&&d(pe({unreadCount:o.data.unread},"tasks"))}};return B.jsx(Pa,{...f,...a})};export{ja as M};
@@ -0,0 +1 @@
1
+ import{j as r}from"./liveblocks-BqtYq8PY.js";import{h as n,n as e}from"./core-4nWRIid2.js";import{U as i}from"./index-CbGX11uA.js";import"./mui-ChRNPf14.js";import"./sentry-BtWdTNDK.js";import"./zeni-epic-state-Brhydpej.js";import"./recharts-UIIeT-6j.js";import"./analytics-CP-wGaZJ.js";import"./plaid-j-SLH4pe.js";import"./dnd-DPx0nGIt.js";import"./stripe-cKAAJElX.js";import"./lottie-C6mBeCcV.js";import"./lexical-Dce73siJ.js";import"./pdf-CHegScPw.js";import"./utils-BGj88Dzy.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]="8f21ada1-163d-445e-848f-3449dc675a20",o._sentryDebugIdIdentifier="sentry-dbid-8f21ada1-163d-445e-848f-3449dc675a20")}catch{}})();const a=e(null,(function(o,t){return{onGoBack:()=>{t.navigate(-1)},onGoHome:()=>{t.navigate("/")}}}))(i);function _(){const o=n();return r.jsx(a,{navigate:o})}export{_ as default};
@@ -0,0 +1 @@
1
+ import{m as ct,a as mt,n as dt,j as E}from"./liveblocks-BqtYq8PY.js";import lt from"./NotFoundScreen-D8y3QSjF.js";import{a as k}from"./sentry-BtWdTNDK.js";import{h as ft,g as ut,i as ht,u as pt,j as S,n as kt,o as gt,p as q}from"./core-4nWRIid2.js";import{cx as St,fL as H,e$ as K,fZ as bt,fS as b,Ts as O,fV as d,fK as y,sM as F,yi as It,Tt,fJ as Ct,f$ as yt,sR as _t,Tu as $,bo as M,fD as w,sV as z,Tv as At,cJ as Et,cC as Nt}from"./zeni-epic-state-Brhydpej.js";import{_ as xt,z as Bt,w as wt,i as Rt,a0 as vt,cW as Dt,x as N,a9 as Pt,cX as Ut,aa as Gt,v as $t}from"./index-CbGX11uA.js";import"./mui-ChRNPf14.js";import{u as Mt}from"./useAskAiCfoHostNavButtonProps-DuEP5Klm.js";import"./recharts-UIIeT-6j.js";import"./analytics-CP-wGaZJ.js";import"./plaid-j-SLH4pe.js";import"./dnd-DPx0nGIt.js";import"./stripe-cKAAJElX.js";import"./lottie-C6mBeCcV.js";import"./lexical-Dce73siJ.js";import"./pdf-CHegScPw.js";import"./utils-BGj88Dzy.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]="28619c7e-9778-4597-a9c8-fe1bcb49fc90",t._sentryDebugIdIdentifier="sentry-dbid-28619c7e-9778-4597-a9c8-fe1bcb49fc90")}catch{}})();const Ft=(t,l)=>new Promise(((n,u)=>{const g=t.map((i=>new Promise((s=>{l(i),s()}))));Promise.all(g).then((()=>{setTimeout((()=>{n()}),2e3)})).catch((i=>{u(i)}))})),jt=kt((function(t,l){const n=H(t),{signedInUser:u,isDebitCardFeatureEnabled:g}=l,i=b(t),s=K(t),{currentTab:h}=i;return{notificationView:i,isNotificationSettingsVisible:u.userEmail!=null&&yt(n.notificationSettings,u.userEmail,g,s),isDisabled:i.notificationDetailsByTab[h].fetchState==="In-Progress"?"disabled":void 0}}),(function(t,l){const{location:n,tenantEmailDomain:u,loggedInUserRoleMap:g,externalNotificationsUnreadCount:i,allUnreadCommentsNotificationIds:s,navigate:h,markInboxNotificationAsRead:x,fetchMoreCommentsNotifications:R}=l;return{onNotificationClick:(a,o,m,c)=>{if(c==="task_deleted"){const r=`/${u}/tasks`,I=N(n.state?.pathnameStackToGoBack,n.pathname);h(r,{state:{pathnameStackToGoBack:I,message:"triggerBackClick"}})}else{const r=`/${u}/tasks/${o}`,I=N(n.state?.pathnameStackToGoBack,n.pathname);h(r,{state:{pathnameStackToGoBack:I,message:"triggerBackClick"}})}m==="unread"&&t(z("task_manager","read",[a],!1))},onCommentNotificationClick:(a,o,m)=>{const c=o.toString().split(`/${u}/`);if(c[1]!=null){m==="unread"&&(x(a),t($([a],M())));let r=`/${u}/${c[1]}`;const I=N(n.state?.pathnameStackToGoBack,n.pathname);c[1].startsWith("reimbursement")&&!Et(g)&&(r="not-found"),c[1].startsWith("bill")&&!Nt(g)&&(r="not-found"),h(r,{state:{pathnameStackToGoBack:I,message:"triggerBackClick"}})}},onUpdateNotificationViewUIState:(a,o)=>{t(y(a,o))},onUpdateNotificationTabState:(a,o)=>{t(d(a,o))},onUpdateNotificationViewCurrentTabAndSubTab:(a,o)=>{t(O(a,o));const m=`../${a}`,c=N(n.state?.pathnameStackToGoBack,n.pathname);h(m,{state:{pathnameStackToGoBack:c}})},onUpdateNotificationViewSubTab:a=>{t(At(a))},onFetchMoreNotifications:(a,o)=>{if(a==="tasks"){const m=[];o==="all"?m.push("read","unread"):o!=="mentions"&&m.push(o),t(F("task_manager","dashboard",m))}else R?.()},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"&&(x(r),t($([r],M())))}))).then((()=>{t(d({markAsReadState:{fetchState:"Completed",error:void 0},selectedNotificationIds:[]},"comments")),t(y({unreadCount:i-c.length>0?i-c.length:0},"comments")),t(w({messageSection:"notification_mark_as_read",messageText:"success",type:"success",showStatusIcon:!0}))}),(r=>{t(d({markAsReadState:{fetchState:"Error",error:r}},"comments")),t(w({messageSection:"notification_mark_as_read",messageText:"failed",type:"error",showStatusIcon:!0}))})).catch((r=>{t(d({markAsReadState:{fetchState:"Error",error:r}},"comments")),t(w({messageSection:"notification_mark_as_read",messageText:"failed",type:"error",showStatusIcon:!0}))})))},onMarkAllNotificationsAsRead:a=>{a==="tasks"?t(_t("task_manager","read")):(t(d({markAsAllReadState:{fetchState:"In-Progress",error:void 0}},"comments")),Ft(s,x).then((()=>{t($(s,M())),t(d({markAsAllReadState:{fetchState:"Completed",error:void 0}},"comments")),t(y({unreadCount:0},"comments")),t(w({messageSection:"notification_mark_as_read",messageText:"success",type:"success",showStatusIcon:!0}))})).catch((o=>{t(d({markAsAllReadState:{fetchState:"Error",error:o}},"comments")),t(w({messageSection:"notification_mark_as_read",messageText:"failed",type:"error",showStatusIcon:!0}))})))},onBackClick:()=>{const a=$t(n.state?.pathnameStackToGoBack),o=a.poppedPathname??"../../dashboard";h(o,{state:{pathnameStackToGoBack:a.newStack}})},onSettingsClick:()=>{const a=N(n.state?.pathnameStackToGoBack,n.pathname);h("../../settings/notifications",{state:{pathnameStackToGoBack:a}})}}}))(Pt(Ut)),Vt=()=>{const t=ft(),l=ut(),{tenantEmailDomain:n,selectedTab:u}=ht(),{areTenantIdsInSync:g}=xt(),i=St(u??""),s=pt(),h=Bt.getSignedInUser(),[x,R]=k.useState(!1),a=S((e=>H(e))),o=S((e=>K(e))),{useFeatureGate:m}=wt(),{isFeatureEnabled:c}=m(Rt.isDebitCardFeatureEnabled),{isAiCfoAccessEnabled:r,onAskAiCfoClick:I}=Mt({mobileExploreReferrer:"Notifications"});vt({isDataReady:!0});const Q=bt(o.userRole);if(o==null||n==null||o.companyId==null)throw Error("Can't access notifications page without current tenant...");if(h==null)throw Error("Can't access notifications page without signed in...");const j=S((e=>b(e).notificationDetailsByTab.tasks.fetchState)),V=S((e=>b(e).currentTab)),v=S((e=>b(e).currentSubTab)),Y=S((e=>b(e).notificationDetailsByTab.comments.fetchCountState)),D=S((e=>b(e).notificationDetailsByTab.comments.fetchState)),tt=S((e=>b(e).notificationDetailsByTab.comments.uiState.unreadCount)),et=S((e=>b(e).allExternalNotifications)).filter((e=>e.inboxNotification.readAt==null)).map((e=>e.inboxNotification.id)),at=Dt().allUsers,{inboxNotifications:B,isLoading:_,hasFetchedAll:T,isFetchingMore:P,fetchMore:ot}=ct(),{threads:L,isLoading:W,fetchMore:J,isFetchingMore:X,hasFetchedAll:Z}=mt({query:{metadata:{companyId:o.companyId,application:"dashboard"}}});k.useEffect((()=>{if(V!==i&&i!=null&&s(O(i)),i==null){const e=`../${V}`,p=N(l.state?.pathnameStackToGoBack,l.pathname);t(e,{state:{pathnameStackToGoBack:p}})}}),[i]),k.useEffect((()=>{Y.fetchState==="Not-Started"&&s(d({fetchCountState:{fetchState:"In-Progress",error:void 0}},"comments"))}),[]),k.useEffect((()=>{if(_===!1&&T===!0&&o?.companyId!=null&&B!=null){const e=`dashboard_${o.companyId}`,p=B.filter((C=>C.roomId===e&&C.readAt==null)).length;s(d({fetchCountState:{fetchState:"Completed",error:void 0}},"comments")),s(y({unreadCount:p},"comments"))}}),[_,T]),k.useEffect((()=>{j!=="In-Progress"&&g&&s(F("task_manager","dashboard",["read","unread"]))}),[g]),k.useEffect((()=>{const e=setTimeout((()=>ot?.()),0);return()=>clearTimeout(e)}));const U=_||P===!0||T!==!0||_||P===!0||T!==!0;k.useEffect((()=>{U&&D!=="In-Progress"?s(d({fetchState:"In-Progress",error:void 0},"comments")):U||D!=="In-Progress"||s(d({fetchState:"Completed",error:void 0},"comments"))}),[U,D]),k.useEffect((()=>{s(y({hasMore:T!==!0},"comments"))}),[T]),k.useEffect((()=>{a.fetchState!=="In-Progress"&&a.fetchState!=="Completed"&&x===!1&&(R(!0),s(It()))}),[a.fetchState]),k.useEffect((()=>{if(_===!1&&W===!1&&B!=null&&L!=null){const e=`dashboard_${o.companyId}`,p=B.filter((f=>f.roomId===e)).filter((f=>f.kind==="thread")),C=p.filter((f=>f.readAt==null)),A=p.map((f=>f.id)),it=p.map((f=>{const G=L.find((rt=>rt.id===f.threadId));return G!=null?{inboxNotification:{...f,threadId:G.id},thread:G}:(X||Z===!0||J==null||J(),null)})).filter((f=>f!=null));s(d({allNotificationsIds:A},"comments")),s(y({totalCount:A.length,unreadCount:C.length},"comments")),s(Tt(it))}}),[_,P,X,T,Z,W,B?.length]);const st={events:o.userRoleId!=null?[`private-encrypted-${o.userRoleId}.dashboard-user-notification`]:[],eventCallback:(e,p)=>{if(Gt(p)){const C=Ct(p.mode);if(C==="dashboard"&&s(y({unreadCount:p.data.unread},"tasks")),j!=="In-Progress"){const A=[];v==="all"?A.push("read","unread"):v!=="mentions"&&A.push(v),s(F("task_manager",C,A,!0))}}}},nt=dt();return E.jsx(jt,{tenantEmailDomain:n,loggedInUserRoleMap:Q,signedInUser:h,externalNotificationsUnreadCount:tt,location:l,navigate:t,isDebitCardFeatureEnabled:c,users:at,markInboxNotificationAsRead:nt,allUnreadCommentsNotificationIds:et,isAiCfoAccessEnabled:r,onAskAiCfoClick:I,...st})};function ne(){return E.jsxs(gt,{children:[E.jsx(q,{path:"/:selectedTab",element:E.jsx(Vt,{})}),E.jsx(q,{path:"*",element:E.jsx(lt,{})})]})}export{ne as default};
@@ -0,0 +1 @@
1
+ import{j as f}from"./liveblocks-BqtYq8PY.js";import{a as r}from"./sentry-BtWdTNDK.js";import{u as T,g as A,j as o,N as R}from"./core-4nWRIid2.js";import{MQ as j,e$ as C,fR as P,MR as x,MS as z,MT as D,MU as L,ok as N,LN as k}from"./zeni-epic-state-Brhydpej.js";import{z as h,M as I}from"./index-CbGX11uA.js";import"./mui-ChRNPf14.js";import"./recharts-UIIeT-6j.js";import"./analytics-CP-wGaZJ.js";import"./plaid-j-SLH4pe.js";import"./dnd-DPx0nGIt.js";import"./stripe-cKAAJElX.js";import"./lottie-C6mBeCcV.js";import"./lexical-Dce73siJ.js";import"./pdf-CHegScPw.js";import"./utils-BGj88Dzy.js";(function(){try{var n=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},s=new n.Error().stack;s&&(n._sentryDebugIds=n._sentryDebugIds||{},n._sentryDebugIds[s]="a8e0b81d-2257-4d8c-bcb7-43630c5dd631",n._sentryDebugIdIdentifier="sentry-dbid-a8e0b81d-2257-4d8c-bcb7-43630c5dd631")}catch{}})();function ee(){const n=T(),s=A(),{params:t,error:i}=r.useMemo((()=>j(s.search)),[s.search]),w=r.useMemo((()=>new URLSearchParams(s.search).get("client_name")??t?.clientId??"Unknown Application"),[s.search,t]),p=h.isSignedIn(),a=h.getSignedInUser(),m=o((e=>C(e))),l=o((e=>P(e))),d=o((e=>e.tenantState.fetchState)),b=o(x),y=o(z),c=o(D),[S,v]=r.useState(null),[E,M]=r.useState(null);r.useEffect((()=>{document.querySelector("#app-shell-loader")?.remove()}),[]),r.useEffect((()=>()=>{n(L())}),[n,s.search]),r.useEffect((()=>{i!=null&&console.warn("[OAuthConsent] invalid params:",i)}),[i]);const g=r.useRef(!1);r.useEffect((()=>{p&&a!=null&&!g.current&&(d!=="Not-Started"&&d!=="Error"||(g.current=!0,n(N(a.userId,a.zeniSessionId??void 0))))}),[p,a,d,n]),r.useEffect((()=>{c!=null&&c!==""&&(window.location.href=c)}),[c]);const U=r.useMemo((()=>{if(m?.tenantId!=null)return m.tenantId;const e=h.getActiveTenantForUser()?.tenantId;return e!=null&&l.some((_=>_.tenantId===e))?e:l.length===1?l[0].tenantId:null}),[m?.tenantId,l]),u=S??U;return i!=null?f.jsx(I,{variant:"invalid_params",paramsError:i}):p?f.jsx(I,{variant:"signed_in",clientName:w,userEmail:a?.userEmail,isInitializing:d!=="Completed",tenants:l,selectedTenantId:u,onSelectTenant:v,approveError:E??y,isApproving:b==="In-Progress",showAllowButton:u!=null,onApprove:()=>{t!=null&&a!=null&&u!=null&&n(k(a.userId,a.zeniSessionId??void 0,u,t.clientId,t.redirectUri,t.codeChallenge,t.codeChallengeMethod,t.state,t.responseType))},onDeny:()=>{if(t!=null)try{const e=new URL(t.redirectUri);e.searchParams.set("error","access_denied"),e.searchParams.set("error_description","The user denied the request"),e.searchParams.set("state",t.state),window.location.href=e.toString()}catch{M("Unable to deny: redirect_uri is not a valid URL. Close this window or contact support.")}}}):f.jsx(R,{to:"/signin/auth",state:{origin:s.pathname+s.search},replace:!0})}export{ee as default};
@@ -0,0 +1 @@
1
+ import{j as n}from"./liveblocks-BqtYq8PY.js";import{h as V,u as z,g as H,i as J,j as d,n as K,o as Q,p as I}from"./core-4nWRIid2.js";import{e$ as U,sA as R,s8 as X,Nl as v,s3 as S,bs as ee,bn as ae,bZ as te,s4 as se,Nm as oe,N8 as C,dL as re,wf as ne,Nn as ce,wC as ie,fI as le,fG as de}from"./zeni-epic-state-Brhydpej.js";import{z as me,_ as fe,a0 as pe,D as ue,w,i as N,Z as he,e as M,ap as ge,x as Fe}from"./index-CbGX11uA.js";import"./mui-ChRNPf14.js";import be from"./NotFoundScreen-D8y3QSjF.js";import{F as Ie}from"./FeaturePreviewScreen-BYw0siNX.js";import{a as g}from"./sentry-BtWdTNDK.js";import{u as Ce}from"./useAskAiCfoHostNavButtonProps-DuEP5Klm.js";import{u as Se}from"./useInitialThreadRequest-BMuxer3t.js";import{t as Te}from"./routePaths-BYuMJjxP.js";import{M as ye}from"./MobileAppDrawer-C850zeFL.js";import"./recharts-UIIeT-6j.js";import"./analytics-CP-wGaZJ.js";import"./plaid-j-SLH4pe.js";import"./dnd-DPx0nGIt.js";import"./stripe-cKAAJElX.js";import"./lottie-C6mBeCcV.js";import"./lexical-Dce73siJ.js";import"./pdf-CHegScPw.js";import"./utils-BGj88Dzy.js";(function(){try{var s=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},e=new s.Error().stack;e&&(s._sentryDebugIds=s._sentryDebugIds||{},s._sentryDebugIds[e]="3e5fa4ad-958f-4b79-a5aa-ee910c33c0c8",s._sentryDebugIdIdentifier="sentry-dbid-3e5fa4ad-958f-4b79-a5aa-ee910c33c0c8")}catch{}})();const T=(s,e,a,o)=>{if(s!=e){const r=o??"";s!=null&&s.length>0?a(`../${e}${r}`,{replace:!0}):a(`${e}${r}`,{replace:!0})}},xe=K((function(s){const e=oe(s),a={},o=e.pandLReportWithForecast.uiState.nodeCollapseState;return Object.keys(o).forEach((r=>{a[r]=o[r]===!1})),{selectedTimeframe:e.selectedTimeframe,isForecastVsActualOn:e.isForecastVsActualOn,compareMode:e.compareMode,forecastList:e.forecastList,selectedForecast:e.selectedForecast,pandLreport:e.pandLReportWithForecast,scrollPosition:e.pandLReportWithForecast.uiState.scrollPosition,nodeOpenStatus:a,type:"name+balances_forecast",analytics:M}}),(function(s,e){return{onForecastSelectionChanged:(a,o)=>{s(v(a,o)),e.isPandLReportFetched(a)||s(S(a)),T(e.forecastIdFromUrlPath,a,e.navigate)},onTimeframeChanged:a=>{s(ie(a))},onForecastVsActualsCompareToggle:a=>{s(ce(a)),s(C({forecastId:e.forecastIdFromUrlPath,scrollPosition:{scrollLeft:0,scrollTop:0}}))},onCompareModeChanged:a=>{s(ne(e.firstMonthOfFY,a,0,[]))},onAccountBalanceClick:e.hasTransactionAccess!==!0?void 0:(a,o)=>{let r,c;const p=a.accountName===""?a.accountDescription:a.accountName;if(o.balanceTimeFrame==="month"||o.balanceTimeFrame==="quarter"?(r=o.balanceTimeFrame,c=re(o)):o.balanceTimeFrame==="year"?(r="quarter",c={startDate:o.endDate.startOf("quarter"),endDate:o.endDate}):console.error(`timeframe ${o.balanceTimeFrame} is not supported`),c!=null&&r!=null){const m=Te(e.tenantEmailDomain,a.accountId,a.accountType,p,r,c),u=Fe(e.location.state?.pathnameStackToGoBack,e.location.pathname);e.navigate(m,{state:{pathnameStackToGoBack:u,referrer:"Forecast"}})}},onNodeCollapseToggled:(a,o)=>{s(C({forecastId:e.forecastIdFromUrlPath,nodeCollapseState:{nodeId:a,isCollapsed:o===!1}}))},onTableScroll:a=>{s(C({forecastId:e.forecastIdFromUrlPath,scrollPosition:a}))},onBackClick:()=>{e.navigate("../../")}}}))(ge);function O(){const s=V(),e=z(),a=H(),{forecastId:o,tenantEmailDomain:r}=J(),[c,p]=g.useState(!1),[m,u]=g.useState(!1),h=me.getSignedInUser(),y=d((t=>U(t))),$=y.company?.companyInfo.firstMonthOfFY??1,i=d((t=>R(t.forecastState,t.forecastListState))),l=d((t=>t.forecastListState.fetchState==="Completed")),x=d((t=>t.profitAndLossState)),A=d((t=>t.reportUIOptionsState.selectedForecast)),D=t=>x.pandLByForecastID[t]!=null&&se(t,x).reducedAllFetchState.fetchState==="Completed",{areTenantIdsInSync:F}=fe();pe({isDataReady:l});const{isAiCfoAccessEnabled:_,onAskAiCfoClick:q}=Ce({mobileExploreReferrer:"Forecast"});g.useEffect((()=>{if(!c&&F)p(!0),l||e(X());else if(l&&!m){u(!0);const t=((f,E,P)=>E!=null?f.forecasts.findIndex((b=>b.id===E)):P!=null?f.forecasts.findIndex((b=>b.id===P)):f.forecasts.length>0?0:-1)(i,o,A?.id);t===-1&&o!=null?s("page-not-found",{replace:!0}):t!==-1&&t!=A?.index?(e(v(i.forecasts[t].id,t)),T(o,i.forecasts[t].id,s,a.search)):o==null&&t!==-1&&T(void 0,i.forecasts[t].id,s,a.search),t!==-1&&!D(i.forecasts[t].id)&&F&&e(S(i.forecasts[t].id))}}),[c,p,e,l,i,m,u,R,S,F]);const k=ue(),B=k?.loggedInUserRole!=null&&ee(k.loggedInUserRole),{useFeatureGate:G}=w(),{isFeatureEnabled:L}=G(N.isReportsCommentingEnabled),W=Se(L?y?.companyId:void 0,{clearParams:l&&m}),[Y,Z]=g.useState(!1),j=t=>{Z(t)};return n.jsxs(n.Fragment,{children:[l?n.jsx(he,{analytics:M,onLoad:t=>(f=>f.trackForecast())(t)}):null,n.jsx(ye,{isAppContentDrawerOpen:Y,handleDrawerToggle:j}),n.jsx(xe,{firstMonthOfFY:$,tenantEmailDomain:r,forecastIdFromUrlPath:o,navigate:s,location:a,isPandLReportFetched:D,meetingUrl:te(`https://meetings.hubspot.com/svitlana-grankovska?firstname=${h?.firstName}&lastname=${h?.lastName}&email=${h?.userEmail}`),hasTransactionAccess:B,isAiCfoAccessEnabled:_,onAskAiCfoClick:q,isReportsCommentingEnabled:L,isZeniUser:ae(h),initialOpenThreadRequest:W,onClickMenuIcon:()=>{j(!0)}})]})}function Ze(){const s=d((c=>U(c))),{useFeatureGate:e}=w(),{isFeatureEnabled:a}=e(N.isDebitCardFeatureEnabled),o=le(a,s),r=de(s);return o===!0||r===!0?n.jsx(Ie,{}):n.jsxs(Q,{children:[n.jsx(I,{path:"/",element:n.jsx(O,{})}),n.jsx(I,{path:"/:forecastId",element:n.jsx(O,{})}),n.jsx(I,{path:"/:forecastId/*",element:n.jsx(be,{})})]})}export{Ze as PandLWithForecastRoutes,Ze as default};
@@ -0,0 +1,22 @@
1
+ import{j as a}from"./liveblocks-BqtYq8PY.js";import{Nh as oe,e$ as J,kI as H,fI as Q,fG as ie,KL as ee,MX as re,vc as ke,Ni as Y,v1 as ve,vm as Ee,vg as le,v5 as ce,vk as Pe,vh as je,Nj as de,x1 as Le,fs as Te,gk as Ae,Nk as _,v9 as pe,v8 as ue,vp as Re,c7 as Fe}from"./zeni-epic-state-Brhydpej.js";import{J as me,w as ae,i as G,z as K,d as ge,g as fe,I as he,al as Ce,am as Oe,G as ye,o as O,K as be,a as M,an as Ve,_ as Ze,a0 as Be,Z as Ue,e as Se,h as $e,x as ze,ao as _e,D as Ge}from"./index-CbGX11uA.js";import{D as we,n as N,S as xe}from"./mui-ChRNPf14.js";import te from"./NotFoundScreen-D8y3QSjF.js";import{a as c}from"./sentry-BtWdTNDK.js";import{u as se,i as He,j as g,h as Ke,g as Me,n as Ne,o as ne,p as z}from"./core-4nWRIid2.js";import{u as We}from"./useAskAiCfoHostNavButtonProps-DuEP5Klm.js";import{M as Xe}from"./MobileAppDrawer-C850zeFL.js";import"./recharts-UIIeT-6j.js";import"./analytics-CP-wGaZJ.js";import"./plaid-j-SLH4pe.js";import"./dnd-DPx0nGIt.js";import"./stripe-cKAAJElX.js";import"./lottie-C6mBeCcV.js";import"./lexical-Dce73siJ.js";import"./pdf-CHegScPw.js";import"./utils-BGj88Dzy.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]="15c1a0fc-ba67-480c-98f3-5fc84b414dea",e._sentryDebugIdIdentifier="sentry-dbid-15c1a0fc-ba67-480c-98f3-5fc84b414dea")}catch{}})();const qe={overlayWidth:new ye(100,100,48)},W=M.getLocalizedStrings().peoplePage.invitePage,Ye=M.getLocalizedStrings().common,Je=({companyId:e,managersListView:t,companyPassportView:d,classListView:n,mode:f,isEditPeopleDrawerOpen:i,closeDrawerHandler:b})=>{const h=me(),m=se(),[V,Z]=c.useState(!1),[k,S]=c.useState(!1),{userId:w}=He(),r=g((l=>oe(l))),p=g((l=>J(l))),v=g((l=>H(l))),{useFeatureGate:D}=ae(),{isFeatureEnabled:I}=D(G.isDebitCardFeatureEnabled),E=Q(I,p),L=ie(p),T=ee(p),B=re(p),U=!!p.company?.featuresActivationInfo?.isReimbursementFeatureEnabled,x=!E&&v&&n.fetchState!=="Completed"||t.fetchState!=="Completed"||d.fetchState!=="Completed"||e==null;if(K.getSignedInUser()==null)throw Error("Can't access invite people page without signing in...");const C=()=>{m(Y()),b()},A=()=>{V===!0?S(!0):C()},$=d.companyView?.controllers?.map((l=>l.user)),u=!!p.company?.companyZeniAccountInfo?.isZeniAccountEnabled,{isFeatureEnabled:P}=D(G.isChargeCardFeatureEnabled),j=ge(p,P,I),{isCardsHidden:R}=fe(p?.tenantId),y=!j||R,F=p.companyTreasuryInfo?.info?.businessVerificationStatus?.code==="verified",s={peopleDetails:r,classList:n.classes,managersList:t.users,controllersList:$,mode:f,isZeniTenant:T,isAccountingClassesEnabled:v,isReimbursementDisabled:U===!1,isZeniAccountsDisabled:u===!1,isChargeCardDisabled:y,isTreasuryDisabled:F===!1,isLiteRoleDisabled:B===!1,isBankingOnlyTenant:E,isCardsOnlyTenant:L,onResetClick:C,onDeleteUser:l=>{m(ce(l.userId,l.userRole.userRoleId))},onPeopleLocalDataUpdated:l=>{m(le({peopleLocalData:l})),Z(!0)},onSaveClick:()=>{m(f==="zeni_only"?ve(e):Ee(T))},onCloseClick:A,isLoading:x||r.person==null},o={onOkClick:()=>{S(!1),C()},onCancelClick:()=>{S(!1)}};return c.useEffect((()=>{x===!1&&w!=null&&m(ke(w))}),[x,w]),c.useEffect((()=>{r.updatePersonState.fetchState==="Completed"&&C()}),[r.updatePersonState.fetchState]),a.jsx(we,{anchor:"right",open:i,PaperProps:{style:{width:qe.overlayWidth.valuePercentage(h),boxShadow:"none"}},slotProps:{backdrop:{style:{backgroundColor:he.overlayDark,cursor:"pointer"}}},onClose:A,children:a.jsxs(Qe,{onClick:l=>l.stopPropagation(),children:[k===!0?a.jsx(Ce,{titleComponent:a.jsx(De,{children:W.discardTitle}),descriptionComponent:a.jsx(Ie,{children:W.discardDescription}),primaryButtonText:W.discard,secondaryButtonText:Ye.no,action:o,isEditPopup:!0}):null,a.jsx(Oe,{...s})]})})},Qe=N(xe)`
2
+ display: flex;
3
+ min-height: 100%;
4
+ flex-direction: column;
5
+ `,De=N(be.H6Regular)`
6
+ margin-top: ${O.sp7};
7
+ padding-left: ${O.sp8};
8
+ padding-right: ${O.sp8};
9
+ color: ${e=>e.theme.colors.primary};
10
+ word-break: break-word;
11
+ `,Ie=N(be.LargeRegularSp)`
12
+ color: ${e=>e.theme.colors.hero};
13
+ padding-left: ${O.sp8};
14
+ padding-right: ${O.sp8};
15
+ margin-bottom: 30px;
16
+ margin-top: ${O.sp4};
17
+ white-space: pre-line;
18
+ `,ea={overlayWidth:new ye(100,100,48)},X=M.getLocalizedStrings().peoplePage.invitePage,aa=M.getLocalizedStrings().common,sa=({companyId:e,managersListView:t,companyPassportView:d,classListView:n,mode:f,isInvitePeopleDrawerOpen:i,closeDrawerHandler:b})=>{const h=me(),m=se(),[V,Z]=c.useState(!1),[k,S]=c.useState(!1),w=g((o=>oe(o))),r=g((o=>J(o))),p=g((o=>H(o))),{useFeatureGate:v}=ae(),{isFeatureEnabled:D}=v(G.isDebitCardFeatureEnabled),I=Q(D,r),E=ie(r),L=ee(r),T=re(r),B=!!r.company?.featuresActivationInfo?.isReimbursementFeatureEnabled,U=!I&&p&&n.fetchState!=="Completed"||t.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(),m(Y())},C=()=>{V===!0?S(!0):x()},A={onOkClick:()=>{S(!1),x()},onCancelClick:()=>{S(!1)}},$=d.companyView?.controllers.map((o=>o.user)),u=!!r.company?.companyZeniAccountInfo?.isZeniAccountEnabled,{isFeatureEnabled:P}=v(G.isChargeCardFeatureEnabled),j=ge(r,P,D),{isCardsHidden:R}=fe(r?.tenantId),y=!j||R,F=r.companyTreasuryInfo?.info?.businessVerificationStatus?.code==="verified",s={classList:n.classes,managersList:t.users,controllersList:$,mode:f,isZeniTenant:L,onPeopleLocalDataUpdated:o=>{m(le({peopleLocalData:o})),Z(!0)},onResetClick:x,onSaveClick:()=>{m(f==="zeni_only"?Pe(e):je())},onCloseClick:C,peopleDetails:w,isAccountingClassesEnabled:p,isReimbursementDisabled:B===!1,isLiteRoleDisabled:T===!1,isZeniAccountsDisabled:u===!1,isChargeCardDisabled:y,isTreasuryDisabled:F===!1,isBankingOnlyTenant:I,isCardsOnlyTenant:E,isLoading:U};return c.useEffect((()=>{w.invitePersonState.fetchState==="Completed"&&(b(),m(Y()))}),[w.invitePersonState.fetchState]),a.jsx(we,{anchor:"right",open:i,PaperProps:{style:{width:ea.overlayWidth.valuePercentage(h),boxShadow:"none"}},slotProps:{backdrop:{style:{backgroundColor:he.overlayDark,cursor:"pointer"}}},onClose:C,children:a.jsxs(ta,{onClick:o=>o.stopPropagation(),children:[k===!0?a.jsx(Ce,{titleComponent:a.jsx(De,{children:X.discardTitle}),descriptionComponent:a.jsx(Ie,{children:X.discardDescription}),primaryButtonText:X.discard,secondaryButtonText:aa.no,action:A}):null,a.jsx(Ve,{...s})]})})},ta=N(xe)`
19
+ display: flex;
20
+ min-height: 100%;
21
+ flex-direction: column;
22
+ `,na=Ne((function(e,t){const d=de(e),n=K.getSignedInUser();return{data:d,loggedinUserId:n?.userId??"",isZeniTenant:t.isZeniTenant===!0,shouldFetchClasses:t.shouldFetchClasses,isZeniAdminUser:n?.userEmailDomain==="zeni.ai"&&t.isZeni===!0,isAccountingClassesEnabled:H(e),analytics:Se}}),(function(e,t){const{navigate:d,companyId:n,shouldFetchClasses:f}=t;return{personAction:{onPersonDelete:(i,b)=>{e(ce(i,b))},onResendInvite:i=>{e(Re(i))},onReloadPeople:()=>{e(pe()),e(ue(n,f))},onBackClick:()=>{d("../../")},onModeChange:i=>{e(_({mode:i,searchText:"",sortKey:"name",sortOrder:"ascending"}))},onSearchTextChanged:i=>{e(_({searchText:i}))}}}}))(_e);function q({isInvitePeopleDrawerOpen:e,isEditPeopleDrawerOpen:t}){const d=Ke(),n=se(),f=Me(),{areTenantIdsInSync:i}=Ze(),b=K.getSignedInUser(),h=g((s=>J(s))),{useFeatureGate:m}=ae(),{isFeatureEnabled:V}=m(G.isDebitCardFeatureEnabled),Z=g((s=>H(s))),k=!Q(V,h)&&Z,S=ee(h),w=h?.tenantId,{tenantEmailDomain:r}=h,[p,v]=c.useState(!1),[D,I]=c.useState(!1),[E,L]=c.useState(!1),[T,B]=c.useState("off"),[U,x]=c.useState(!1),C=s=>{x(s)},{isAiCfoAccessEnabled:A,onAskAiCfoClick:$}=We({mobileExploreReferrer:"People"}),u=g((s=>de(s)));Be({isDataReady:u.fetchState==="Completed"});const P=g((s=>Le(s.classState,s.classListState))),j=g((s=>Te(s.userState,s.userRoleState,s.userListViewState,"manager"))),R=g((s=>Ae(s))),y=h?.companyId;c.useEffect((()=>{p&&T===u.uiState.mode||!i||(n(_({searchText:"",sortKey:"name",sortOrder:"ascending"})),B(u.uiState.mode),v(!0),n(pe()))}),[p,b,w,n,u.uiState.mode,i]),c.useEffect((()=>{y!=null&&i&&n(ue(y,k))}),[y,k,i]),c.useEffect((()=>{I(e!=null&&e===!0),L(t!=null&&t===!0&&t)}),[e,t]),c.useEffect((()=>{n(_({searchText:"",sortKey:"name",sortOrder:"ascending"}))}),[]);const F=()=>{I(!1),L(!1),d("../")};return a.jsxs(a.Fragment,{children:[u.fetchState==="Completed"?a.jsx(Ue,{analytics:Se,onLoad:s=>s.trackPageLoaded($e.Event.members)}):null,D===!0?a.jsx(sa,{closeDrawerHandler:F,isInvitePeopleDrawerOpen:D,managersListView:j,companyPassportView:R,classListView:P,companyId:y,mode:u.uiState.mode}):null,E===!0?a.jsx(Je,{closeDrawerHandler:F,isEditPeopleDrawerOpen:E,managersListView:j,companyPassportView:R,classListView:P,companyId:y,mode:u.uiState.mode}):null,a.jsx(Xe,{isAppContentDrawerOpen:U,handleDrawerToggle:C}),a.jsx(na,{navigate:d,signedInUser:b,isZeni:h.isZeni,isZeniTenant:S,peopleUIState:u.uiState,companyId:y,shouldFetchClasses:k,classList:P,managersView:j,peopleView:u,onInvitePeopleClick:()=>{d("./new")},onColumnSortConfigChanged:(s,o)=>{n(_({sortKey:s,sortOrder:o}))},onRowClick:s=>{const o=`/${r}/people/${encodeURIComponent(s)}/edit`,l=ze(f.state?.pathnameStackToGoBack,f.pathname);d(o,{state:{pathnameStackToGoBack:l}})},onClickMenuIcon:()=>{C(!0)},isAiCfoAccessEnabled:A,onAskAiCfoClick:$})]})}function Da(){const e=Ge();return Fe(e?.loggedInUserRole??[])?a.jsxs(ne,{children:[a.jsx(z,{path:"/",element:a.jsx(q,{})}),a.jsx(z,{path:"new",element:a.jsx(q,{isInvitePeopleDrawerOpen:!0})}),a.jsx(z,{path:":userId/edit",element:a.jsx(q,{isEditPeopleDrawerOpen:!0})}),a.jsx(z,{path:"*",element:a.jsx(te,{})})]}):a.jsx(ne,{children:a.jsx(z,{path:"*",element:a.jsx(te,{})})})}export{Da as default};
@@ -0,0 +1 @@
1
+ import{j as s}from"./liveblocks-BqtYq8PY.js";import E from"./NotFoundScreen-D8y3QSjF.js";import{a as r}from"./sentry-BtWdTNDK.js";import{h as _,g as v,j as p,i as M,u as U,N as P,n as z,o as O,p as h}from"./core-4nWRIid2.js";import{e$ as B,Tw as b,bq as F,bn as N,il as V,fD as $}from"./zeni-epic-state-Brhydpej.js";import{A as q,z as I,a0 as Y,cY as G}from"./index-CbGX11uA.js";import"./mui-ChRNPf14.js";import{u as H}from"./useAskAiCfoHostNavButtonProps-DuEP5Klm.js";import{M as J}from"./MobileAppDrawer-C850zeFL.js";import"./recharts-UIIeT-6j.js";import"./analytics-CP-wGaZJ.js";import"./plaid-j-SLH4pe.js";import"./dnd-DPx0nGIt.js";import"./stripe-cKAAJElX.js";import"./lottie-C6mBeCcV.js";import"./lexical-Dce73siJ.js";import"./pdf-CHegScPw.js";import"./utils-BGj88Dzy.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]="0fd05386-003a-4fce-9f9c-675eb25395a1",e._sentryDebugIdIdentifier="sentry-dbid-0fd05386-003a-4fce-9f9c-675eb25395a1")}catch{}})();const K=z((function(e){const t=I.getSignedInUser(),c=e.tenantState.currentTenantId,o={userId:t?.userId??"",sessionId:t?.zeniSessionId??"",tenantId:c??""},{aggregatedReportViewState:n}=b(e);return{authParams:o,isDisabled:!1,loggedInUser:t,aggregatedReport:n}}),(function(e,t){return{onBackClick:()=>{t.navigate("../../")},onClickMenuIcon:()=>{t.handleDrawerToggle(!0)}}}))(G),L=()=>{const e=_(),t=v(),c=q(),o=p((a=>B(a))),{aggregatedReportViewState:n}=p((a=>b(a))),{tenantEmailDomain:m}=M(),u=U(),d=I.getSignedInUser();if(d==null)throw new Error("Can't access this page without signing in...");const f=r.useRef(!1),[w,S]=r.useState(!1),C=F(o?.userRole??[]),D=o?.userRole?.includes("bookkeeping_admin")??!1,k=N(d),x=C||D||k,l=r.useCallback(((a,i,T)=>{u(V({fromMonth:a,toMonth:i,cacheOverride:T}))}),[]);r.useEffect((()=>{n?.fetchState==="Completed"&&f.current&&(u($({messageSection:"data_refresh_update",messageText:"success",type:"success",showStatusIcon:!0})),f.current=!1)}),[n?.fetchState]);const y=r.useCallback(((a,i)=>{n!=null&&n?.fetchState==="In-Progress"||l(a,i,!0),f.current=!0}),[n?.fetchState,l]),j=r.useCallback(((a,i)=>{l(a,i,!1)}),[l]),g=a=>{S(a)},{isAiCfoAccessEnabled:A,onAskAiCfoClick:R}=H({mobileExploreReferrer:"Performance"});return Y({isDataReady:n?.fetchState==="Completed"}),x?s.jsxs(s.Fragment,{children:[s.jsx(J,{isAppContentDrawerOpen:w,handleDrawerToggle:g}),s.jsx(K,{navigate:e,location:t,themeState:c,currentTenant:o,signedInUser:d,tenantEmailDomain:m,onReload:y,onTimeRangeSelect:j,handleDrawerToggle:g,isAiCfoAccessEnabled:A,onAskAiCfoClick:R})]}):s.jsx(P,{to:`/${m}/dashboard`,replace:!0})};function ge(){return s.jsxs(O,{children:[s.jsx(h,{path:"*",element:s.jsx(L,{})}),s.jsx(h,{path:"*",element:s.jsx(E,{})})]})}export{ge as default};
@@ -1 +1 @@
1
- import{a as h,b as t}from"./sentry-Bj_fC7Ll.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-BtWdTNDK.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-bqFl_SVp.js";import{p as Q,e as xc,d as kc,g as jl,a as xl}from"./sentry-Bj_fC7Ll.js";import{L as dt,bZ as Tc,eZ as Ac,Mh as Rc,ML as kl,c7 as Tl,g2 as Al,g3 as Rl}from"./zeni-epic-state-GXytJkko.js";import{a as lt,b as Il,c as Pl,d as Nl,e as an,f as Ll,g as $l,h as Ml,i as Vt,j as Ic,k as oe,l as je,m as Cl,o as Yt,p as ue,q as Dl}from"./utils-BKBg63lI.js";import{r as un}from"./empty-BXrJtoVu.js";import{r as Fl,a as Bl,b as Ul,c as ql}from"./pdf-lib-Sz3Y8uGi.js";import{r as Gl}from"./index-B9FzYJpE.js";import{r as zl}from"./index-gZ-YqOdE.js";import{h as Zl,g as Hl,u as Vl,j as En,n as Yl}from"./core-Bnb5S7eF.js";import{u as Kl,z as Pc,L as Wl,Q as Jl,T as Xl,n as Ql,g as tf}from"./index-DQqz4S7_.js";import"./mui-BAFflVdx.js";import{d as Pe}from"./decodeURIComponentSafe-IB5WoVjO.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]="99165218-5556-418a-b30c-4e97216ec8e2",t._sentryDebugIdIdentifier="sentry-dbid-99165218-5556-418a-b30c-4e97216ec8e2")}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-BqtYq8PY.js";import{p as Q,e as xc,d as kc,g as jl,a as xl}from"./sentry-BtWdTNDK.js";import{L as dt,bZ as Tc,e$ as Ac,Mr as Rc,MV as kl,c7 as Tl,g4 as Al,g5 as Rl}from"./zeni-epic-state-Brhydpej.js";import{a as lt,b as Il,c as Pl,d as Nl,e as an,f as Ll,g as $l,h as Ml,i as Vt,j as Ic,k as oe,l as je,m as Cl,o as Yt,p as ue,q as Dl}from"./utils-BGj88Dzy.js";import{r as un}from"./empty-dwCpPdyI.js";import{r as Fl,a as Bl,b as Ul,c as ql}from"./pdf-lib-xuF5byC3.js";import{r as Gl}from"./index-DmHtkhiK.js";import{r as zl}from"./index-ot86Rern.js";import{h as Zl,g as Hl,u as Vl,j as En,n as Yl}from"./core-4nWRIid2.js";import{u as Kl,z as Pc,L as Wl,N as Jl,T as Xl,m as Ql,e as tf}from"./index-CbGX11uA.js";import"./mui-ChRNPf14.js";import{d as Pe}from"./decodeURIComponentSafe-B-9vw5Be.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]="1f3d7c37-3dfb-46f6-9dc3-b822c7f222e9",t._sentryDebugIdIdentifier="sentry-dbid-1f3d7c37-3dfb-46f6-9dc3-b822c7f222e9")}catch{}})();var _n,Sn={exports:{}},On,jn,xn,kn,Tn,An,Rn,In,Pn,Ne,Nn,Ln,$n,Mn,Cn,Dn,Fn,Bn,Un,qn,Gn,Le,zn,Zn,Hn,Vn,Yn,Kn,Wn,$e,Jn,Xn,Qn,to,eo,ro,no,Me={exports:{}},Ce={exports:{}},De={};function Nc(){if(On)return De;function t(r){return t=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},t(r)}function f(r,e){return f=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(a,p){return a.__proto__=p,a},f(r,e)}function m(r){var e=(function(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch{return!1}})();return function(){var a,p=s(r);if(e){var h=s(this).constructor;a=Reflect.construct(p,arguments,h)}else a=p.apply(this,arguments);return(function(d,b){if(b&&(t(b)==="object"||typeof b=="function"))return b;if(b!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return(function(g){if(g===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return g})(d)})(this,a)}}function s(r){return s=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},s(r)}On=1;var l,o,n={};function i(r,e,a){a||(a=Error);var p=(function(h){(function(c,y){if(typeof y!="function"&&y!==null)throw new TypeError("Super expression must either be null or a function");c.prototype=Object.create(y&&y.prototype,{constructor:{value:c,writable:!0,configurable:!0}}),Object.defineProperty(c,"prototype",{writable:!1}),y&&f(c,y)})(g,h);var d,b=m(g);function g(c,y,v){var S;return(function(w,_){if(!(w instanceof _))throw new TypeError("Cannot call a class as a function")})(this,g),S=b.call(this,(function(w,_,M){return typeof e=="string"?e:e(w,_,M)})(c,y,v)),S.code=r,S}return d=g,Object.defineProperty(d,"prototype",{writable:!1}),d})(a);n[r]=p}function u(r,e){if(Array.isArray(r)){var a=r.length;return r=r.map((function(p){return String(p)})),a>2?"one of ".concat(e," ").concat(r.slice(0,a-1).join(", "),", or ")+r[a-1]:a===2?"one of ".concat(e," ").concat(r[0]," or ").concat(r[1]):"of ".concat(e," ").concat(r[0])}return"of ".concat(e," ").concat(String(r))}return i("ERR_AMBIGUOUS_ARGUMENT",'The "%s" argument is ambiguous. %s',TypeError),i("ERR_INVALID_ARG_TYPE",(function(r,e,a){var p,h,d;if(l===void 0&&(l=ie()),l(typeof r=="string","'name' must be a string"),typeof e=="string"&&(h="not ",e.substr(0,h.length)===h)?(p="must not be",e=e.replace(/^not /,"")):p="must be",(function(g,c,y){return(y===void 0||y>g.length)&&(y=g.length),g.substring(y-c.length,y)===c})(r," argument"))d="The ".concat(r," ").concat(p," ").concat(u(e,"type"));else{var b=(function(g,c,y){return typeof y!="number"&&(y=0),!(y+c.length>g.length)&&g.indexOf(c,y)!==-1})(r,".")?"property":"argument";d='The "'.concat(r,'" ').concat(b," ").concat(p," ").concat(u(e,"type"))}return d+=". Received type ".concat(t(a))}),TypeError),i("ERR_INVALID_ARG_VALUE",(function(r,e){var a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:"is invalid";o===void 0&&(o=lt());var p=o.inspect(e);return p.length>128&&(p="".concat(p.slice(0,128),"...")),"The argument '".concat(r,"' ").concat(a,". Received ").concat(p)}),TypeError),i("ERR_INVALID_RETURN_VALUE",(function(r,e,a){var p;return p=a&&a.constructor&&a.constructor.name?"instance of ".concat(a.constructor.name):"type ".concat(t(a)),"Expected ".concat(r,' to be returned from the "').concat(e,'"')+" function but got ".concat(p,".")}),TypeError),i("ERR_MISSING_ARGS",(function(){for(var r=arguments.length,e=new Array(r),a=0;a<r;a++)e[a]=arguments[a];l===void 0&&(l=ie()),l(e.length>0,"At least one arg needs to be specified");var p="The ",h=e.length;switch(e=e.map((function(d){return'"'.concat(d,'"')})),h){case 1:p+="".concat(e[0]," argument");break;case 2:p+="".concat(e[0]," and ").concat(e[1]," arguments");break;default:p+=e.slice(0,h-1).join(", "),p+=", and ".concat(e[h-1]," arguments")}return"".concat(p," must be specified")}),TypeError),De.codes=n,De}function ef(){if(xn)return jn;function t(k,E){var j=Object.keys(k);if(Object.getOwnPropertySymbols){var x=Object.getOwnPropertySymbols(k);E&&(x=x.filter((function(O){return Object.getOwnPropertyDescriptor(k,O).enumerable}))),j.push.apply(j,x)}return j}function f(k){for(var E=1;E<arguments.length;E++){var j=arguments[E]!=null?arguments[E]:{};E%2?t(Object(j),!0).forEach((function(x){m(k,x,j[x])})):Object.getOwnPropertyDescriptors?Object.defineProperties(k,Object.getOwnPropertyDescriptors(j)):t(Object(j)).forEach((function(x){Object.defineProperty(k,x,Object.getOwnPropertyDescriptor(j,x))}))}return k}function m(k,E,j){return(E=l(E))in k?Object.defineProperty(k,E,{value:j,enumerable:!0,configurable:!0,writable:!0}):k[E]=j,k}function s(k,E,j){return E&&(function(x,O){for(var $=0;$<O.length;$++){var N=O[$];N.enumerable=N.enumerable||!1,N.configurable=!0,"value"in N&&(N.writable=!0),Object.defineProperty(x,l(N.key),N)}})(k.prototype,E),Object.defineProperty(k,"prototype",{writable:!1}),k}function l(k){var E=(function(j,x){if(p(j)!=="object"||j===null)return j;var O=j[Symbol.toPrimitive];if(O!==void 0){var $=O.call(j,x);if(p($)!=="object")return $;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(j)})(k,"string");return p(E)==="symbol"?E:String(E)}function o(k,E){if(E&&(p(E)==="object"||typeof E=="function"))return E;if(E!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return n(k)}function n(k){if(k===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return k}function i(k){var E=typeof Map=="function"?new Map:void 0;return i=function(j){if(j===null||(x=j,Function.toString.call(x).indexOf("[native code]")===-1))return j;var x;if(typeof j!="function")throw new TypeError("Super expression must either be null or a function");if(E!==void 0){if(E.has(j))return E.get(j);E.set(j,O)}function O(){return u(j,arguments,a(this).constructor)}return O.prototype=Object.create(j.prototype,{constructor:{value:O,enumerable:!1,writable:!0,configurable:!0}}),e(O,j)},i(k)}function u(k,E,j){return u=r()?Reflect.construct.bind():function(x,O,$){var N=[null];N.push.apply(N,O);var P=new(Function.bind.apply(x,N));return $&&e(P,$.prototype),P},u.apply(null,arguments)}function r(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch{return!1}}function e(k,E){return e=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(j,x){return j.__proto__=x,j},e(k,E)}function a(k){return a=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(E){return E.__proto__||Object.getPrototypeOf(E)},a(k)}function p(k){return p=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(E){return typeof E}:function(E){return E&&typeof Symbol=="function"&&E.constructor===Symbol&&E!==Symbol.prototype?"symbol":typeof E},p(k)}xn=1;var h=lt().inspect,d=Nc().codes.ERR_INVALID_ARG_TYPE;function b(k,E,j){return(j===void 0||j>k.length)&&(j=k.length),k.substring(j-E.length,j)===E}var g="",c="",y="",v="",S={deepStrictEqual:"Expected values to be strictly deep-equal:",strictEqual:"Expected values to be strictly equal:",strictEqualObject:'Expected "actual" to be reference-equal to "expected":',deepEqual:"Expected values to be loosely deep-equal:",equal:"Expected values to be loosely equal:",notDeepStrictEqual:'Expected "actual" not to be strictly deep-equal to:',notStrictEqual:'Expected "actual" to be strictly unequal to:',notStrictEqualObject:'Expected "actual" not to be reference-equal to "expected":',notDeepEqual:'Expected "actual" not to be loosely deep-equal to:',notEqual:'Expected "actual" to be loosely unequal to:',notIdentical:"Values identical but not reference-equal:"};function w(k){var E=Object.keys(k),j=Object.create(Object.getPrototypeOf(k));return E.forEach((function(x){j[x]=k[x]})),Object.defineProperty(j,"message",{value:k.message}),j}function _(k){return h(k,{compact:!1,customInspect:!1,depth:1e3,maxArrayLength:1/0,showHidden:!1,breakLength:1/0,showProxy:!1,sorted:!0,getters:!0})}function M(k,E,j){var x="",O="",$=0,N="",P=!1,G=_(k),A=G.split(`
2
2
  `),I=_(E).split(`
3
3
  `),R=0,B="";if(j==="strictEqual"&&p(k)==="object"&&p(E)==="object"&&k!==null&&E!==null&&(j="strictEqualObject"),A.length===1&&I.length===1&&A[0]!==I[0]){var V=A[0].length+I[0].length;if(V<=10){if(!(p(k)==="object"&&k!==null||p(E)==="object"&&E!==null||k===0&&E===0))return"".concat(S[j],`
4
4
 
@@ -0,0 +1 @@
1
+ import{j as r}from"./liveblocks-BqtYq8PY.js";import _ from"./NotFoundScreen-D8y3QSjF.js";import{a as p}from"./sentry-BtWdTNDK.js";import{h as x,g as C,u as E,j as u,N as D,n as k,o as W,p as g}from"./core-4nWRIid2.js";import{e$ as I,QO as b,R2 as S,G0 as V,F9 as U,F$ as d,FS as $,Rf as B,G2 as F}from"./zeni-epic-state-Brhydpej.js";import{z as N,a9 as L,bZ as G,ag as T,bC as z,b_ as K}from"./index-CbGX11uA.js";import"./mui-ChRNPf14.js";import{u as Q,R as A}from"./ReimbursementApprovalRuleDetailScreen-DXovejDg.js";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},o=new e.Error().stack;o&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[o]="7768e317-ad5b-4e01-8e46-fc30afeed881",e._sentryDebugIdIdentifier="sentry-dbid-7768e317-ad5b-4e01-8e46-fc30afeed881")}catch{}})();const y="reimbursement-approval-rule-update",Z=k((function(e){return{approvalView:b(e),remiSetupApproverViewUpdateData:S(e).remiSetupApproverViewUpdateData}}),(function(e,o){const{navigate:s,location:n}=o;return{onApprovalRulesEventReceived:t=>{t.endsWith(y)&&e(B(!1))},onBackClick:()=>{T(n)?s("../../"):s("../../../reimbursements/setup")},onDeleteRuleClick:t=>{e($(t,!1))},onEditRuleClick:t=>{t!=null?(e(d(t)),s(`./${t}/edit`)):(e(d()),s("./new"))}}}))(L(G)),q=({isLoading:e})=>{const o=x(),s=C(),n=E(),[t,i]=p.useState(!1),[m,R]=p.useState(!1),f=u((a=>a.remiSetupApproverViewState.fetchState)),l=u((a=>I(a))),c=u((a=>b(a))),v=u((a=>S(a).remiSetupApproverViewUpdateData));if(p.useEffect((()=>{v?.updateStatus.fetchState==="Completed"&&n(V())}),[v]),p.useEffect((()=>{t||f!=="Not-Started"||e||(i(!0),n(U(!0,!1,!1,!1)))}),[t,f,e,n]),N.getSignedInUser()==null)throw Error("Can't access reimbursement approval without signing in...");p.useEffect((()=>{c.allApprovalRules.length===0&&c.fetchState==="Completed"&&(m||(R(!0),n(d())),o("./new"))}),[m,c,n]);const w={events:l.companyId!=null?[`private-encrypted-${l.companyId}.${y}`]:[],eventCallback:(a,O,h)=>{a.endsWith(y)&&h.onApprovalRulesEventReceived(a)}};return l?.companyReimbursementInfo?.info?.isReimbursementTOSAccepted===!1?r.jsx(D,{to:"../../promo"}):r.jsx(Z,{currentTenant:l,location:s,navigate:o,...w})},j="reimbursement-approval-rule-update",H=k((function(e){const o=b(e),s=S(e).remiSetupApproverViewUpdateData,n={};for(const i of Object.values(e.vendorState.vendorByID))i?.id!=null&&(n[i.id]=i.name);const t={};for(const i of Object.values(e.classState.classesByKey))i?.classId!=null&&(t[i.classId]=i.className);return{approvalView:o,remiSetupApproverViewUpdateData:s,vendorNamesById:n,departmentNamesById:t}}),(function(e,o){const{navigate:s,location:n}=o;return{onApprovalRulesEventReceived:t=>{t.endsWith(j)&&e(B(!1))},onBackClick:()=>{T(n)?s("../../"):s("../../../reimbursements/setup")},onDeleteRuleClick:t=>{e($(t,!0))},onEditRuleClick:t=>{t!=null?(e(d(t)),s(`./${t}/edit`)):(e(d()),s("./new"))},onReorderRules:t=>{e(F(t,!0))}}}))(L(K)),J=()=>{const e=u((n=>I(n))),{isApprovalRulesV3Enabled:o,isLoading:s}=z(e?.tenantId);return o?r.jsx(M,{isLoading:s}):r.jsx(q,{isLoading:s})},M=({isLoading:e})=>{const o=x(),s=C(),n=E(),[t,i]=p.useState(!1),[m,R]=p.useState(!1),f=u((a=>a.remiSetupApproverViewState.fetchState)),l=u((a=>I(a))),c=u((a=>b(a)));Q();const v=u((a=>S(a).remiSetupApproverViewUpdateData));if(p.useEffect((()=>{v?.updateStatus.fetchState==="Completed"&&n(V())}),[v]),p.useEffect((()=>{t||f!=="Not-Started"||e||(i(!0),n(U(!0,!1,!1,!0)))}),[t,f,e,n]),N.getSignedInUser()==null)throw Error("Can't access reimbursement approval without signing in...");p.useEffect((()=>{c.allApprovalRules.length===0&&c.fetchState==="Completed"&&(m||(R(!0),n(d())),o("./new"))}),[m,c,n]);const w={events:l.companyId!=null?[`private-encrypted-${l.companyId}.${j}`]:[],eventCallback:(a,O,h)=>{a.endsWith(j)&&h.onApprovalRulesEventReceived(a)}};return l?.companyReimbursementInfo?.info?.isReimbursementTOSAccepted===!1?r.jsx(D,{to:"../../promo"}):r.jsx(H,{currentTenant:l,location:s,navigate:o,isLoading:e,...w})};function oe(){return r.jsxs(W,{children:[r.jsx(g,{path:"/",element:r.jsx(J,{})}),r.jsx(g,{path:"/new",element:r.jsx(A,{})}),r.jsx(g,{path:"/:approvalRuleId/edit",element:r.jsx(A,{})}),r.jsx(g,{path:"*",element:r.jsx(_,{})})]})}export{oe as R};
@@ -1 +1 @@
1
- import{j as h}from"./liveblocks-bqFl_SVp.js";import{a as f}from"./sentry-Bj_fC7Ll.js";import{u as w,j as y,h as x,g as O,i as V,n as k}from"./core-Bnb5S7eF.js";import{l6 as L,QU as T,QE as U,FT as F,G3 as B,F_ as A,F$ as E,QV as j,eZ as Z,FZ as z}from"./zeni-epic-state-GXytJkko.js";import{z as P,E as N,B as $,bP as G,ag as Q,bC as K,bQ as W}from"./index-DQqz4S7_.js";import"./mui-BAFflVdx.js";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},s=new e.Error().stack;s&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[s]="466537f1-f59a-4dec-ae0f-fcece0c27357",e._sentryDebugIdIdentifier="sentry-dbid-466537f1-f59a-4dec-ae0f-fcece0c27357")}catch{}})();function H(){const e=w(),s=f.useRef(!1),t=y((o=>o.vendorListState.fetchStateBillsTab.fetchState??"Not-Started")),p=y((o=>o.vendorListState.allVendorIdsBillsTab.length>0));f.useEffect((()=>{s.current||p||t==="Completed"||t==="In-Progress"||(s.current=!0,e(L({})))}),[p,t,e])}const J=k((function(e,s){const t=T(e),p=t.remiSetupApproverViewUpdateData?.type??"approval_create",o=p==="approval_create"&&t.allApprovalRules.length!==0;let l=t.allApprovalRules.length===0;return s.approvalRuleId&&(l=t.allApprovalRules.findIndex((r=>r.approvalRuleId===s.approvalRuleId))===0),{localData:t,hideUpperBoundField:o,isLowerBoundDisabled:l,approvalUpdateActionType:p}}),(function(e,s){const{navigate:t,approvalUpdateDataView:p,approverViewData:o,approvalRuleId:l}=s,r=p.remiSetupApproverViewUpdateData?.type,i=Q(s.location);return{onApprovalRuleDataUpdated:a=>{const d=v=>{const S=[];return v.forEach((u=>{const I=u.actors.selectedUsers.map((m=>({type:"user",subType:void 0,userId:m.userId,idType:"user",isImplicitActor:!1}))),R=u.actors.selectedNonUsers.map((m=>{const g=(b=m.value,j(b)==null);var b;return{type:g?"attribute":"role",subType:m.value,userId:void 0,idType:void 0,isImplicitActor:!g}})),c=I.concat(R);S.push({action:u.stepType.selectedOption,actors:c,operator:c.length>1?u.stepType.selectedOption==="require_approval"?"or":"and":"is"})})),S},n={amount:{type:"amount",comparator:"range",min:{amount:a.lowerBound,currencyCode:"USD",currencySymbol:"$"},max:{amount:a.upperBound,currencyCode:"USD",currencySymbol:"$"}}};if(r==="approval_create"){const v={criteria:n,steps:d(a.steps),isApplicableOnPendingApprovalEntity:a.applyToExistingReimbursements.includes("applyToExistingReimbursements")};e(E(v))}else{const v={approvalRuleId:l,criteria:n,steps:d(a.steps),isApplicableOnPendingApprovalEntity:a.applyToExistingReimbursements.includes("applyToExistingReimbursements")};e(E(v))}},onResetClick:()=>{e(A()),r==="approval_update"||i?t("../"):o.allApprovalRules.length===0&&o.fetchState==="Completed"?t("../../setup"):t("../")},onBackClick:()=>{e(A()),r==="approval_update"||i?t("../"):o.allApprovalRules.length===0&&o.fetchState==="Completed"?t("../../setup"):t("../")},onSaveRuleClick:()=>{e(B(!1))},onSaveRuleSuccess:()=>{t("../")}}}))(G);function M(){const e=x(),s=w(),t=O(),{approvalRuleId:p}=V(),o=P.getSignedInUser(),l=N(),r=y((n=>T(n))),i=y((n=>U(n))),[a,d]=f.useState(!1);if(f.useEffect((()=>{a||(d(!0),s(F(!0)))})),f.useEffect((()=>{i.fetchState==="Not-Started"&&e(p!=null?"../../":"../")}),[i,p]),o==null)throw Error("Can't access address page without signing in...");return r.approversDetailsFetchStatus.fetchState=="Not-Started"||r.approversDetailsFetchStatus.fetchState==="In-Progress"?h.jsx($,{fetchState:r.approversDetailsFetchStatus.fetchState,style:{backgroundColor:l.colors.grey5}}):h.jsx(J,{navigate:e,approvalUpdateDataView:r,approvalRuleId:p,approverViewData:i,location:t})}function pe(e){return j(e)==null}const X=k((function(e,s){const t=T(e),p=t.remiSetupApproverViewUpdateData?.type??"approval_create",o=[],l={};for(const r of Object.values(e.vendorState.vendorByID))r?.id!=null&&(o.push(r.id),l[r.id]=r.name);return{localData:t,approvalUpdateActionType:p,allVendorIds:o,vendorNamesById:l,editingRuleId:p==="approval_update"?s.approvalRuleId:void 0,allApprovalRulesWithUser:U(e).allApprovalRules}}),(function(e,s){const{navigate:t,approvalUpdateDataView:p,approverViewData:o,approvalRuleId:l}=s,r=p.remiSetupApproverViewUpdateData?.type,i=Q(s.location);return{onApprovalRuleDataUpdated:a=>{const d=c=>{const m=[];return c.forEach((g=>{const b=g.actorKind?.selectedOption,C=g.selectedRole?.selectedOption;let D=[];b==="role"&&C!=null?D=[{type:"attribute",subType:C,userId:void 0,idType:void 0,isImplicitActor:!1}]:b==="specific_person"&&(D=(g.persons?.selectedUsers??[]).map((q=>({type:"user",subType:void 0,userId:q.userId,idType:"user",isImplicitActor:!1}))));const _=g.action??"require_approval";m.push({action:_,actors:D,operator:D.length>1?_==="require_approval"?"or":"and":"is"})})),m},n=a.amountCriteria,v=a.vendorCriteria,S=a.departmentCriteria,u={};if(n!=null&&n.comparator.selectedOption!=null){const c=n.comparator.selectedOption;u.amount={type:"amount",comparator:c,min:c==="less_than"?void 0:n.min,max:c==="greater_than"?void 0:n.max}}const I=v?.selection.selectedOptions??[];I.length>0&&(u.vendor={type:"vendor",operator:v?.operator.selectedOption??"is",vendorIds:I});const R=S?.selection.selectedOptions??[];if(R.length>0&&(u.department={type:"department",operator:S?.operator.selectedOption??"is",departmentIds:R}),r==="approval_create"){const c={name:a.name,description:a.description,separationOfDuties:a.separationOfDuties,isFallback:a.isFallback,criteria:u,steps:d(a.steps),isApplicableOnPendingApprovalEntity:a.applyToExistingReimbursements.includes("applyToExistingReimbursements")};e(E(c))}else{const c={approvalRuleId:l,name:a.name,description:a.description,separationOfDuties:a.separationOfDuties,isFallback:a.isFallback,criteria:u,steps:d(a.steps),isApplicableOnPendingApprovalEntity:a.applyToExistingReimbursements.includes("applyToExistingReimbursements")};e(E(c))}},onResetClick:()=>{e(A()),r==="approval_update"||i?t("../"):o.allApprovalRules.length===0&&o.fetchState==="Completed"?t("../../setup"):t("../")},onBackClick:()=>{e(A()),r==="approval_update"||i?t("../"):o.allApprovalRules.length===0&&o.fetchState==="Completed"?t("../../setup"):t("../")},onSaveRuleClick:()=>{e(B(!0))},onSaveRuleSuccess:()=>{t("../")},onEditExistingRule:a=>{e(z(a)),t(r==="approval_update"?`../../${a}/edit`:`../${a}/edit`)}}}))(W);function ne(){const e=y((t=>Z(t))),{isApprovalRulesV3Enabled:s}=K(e?.tenantId);return s?h.jsx(Y,{}):h.jsx(M,{})}function Y(){const e=x(),s=w(),t=O(),{approvalRuleId:p}=V(),o=P.getSignedInUser(),l=N(),r=y((n=>T(n))),i=y((n=>U(n))),[a,d]=f.useState(!1);if(H(),f.useEffect((()=>{a||(d(!0),s(F(!0)))})),f.useEffect((()=>{i.fetchState==="Not-Started"&&e(p!=null?"../../":"../")}),[i,p]),o==null)throw Error("Can't access address page without signing in...");return r.approversDetailsFetchStatus.fetchState=="Not-Started"||r.approversDetailsFetchStatus.fetchState==="In-Progress"?h.jsx($,{fetchState:r.approversDetailsFetchStatus.fetchState,style:{backgroundColor:l.colors.grey5}}):h.jsx(X,{navigate:e,approvalUpdateDataView:r,approvalRuleId:p,approverViewData:i,location:t},p??"new")}export{ne as R,pe as i,H as u};
1
+ import{j as b}from"./liveblocks-BqtYq8PY.js";import{a as f}from"./sentry-BtWdTNDK.js";import{u as T,j as y,h as O,g as _,i as V,n as k}from"./core-4nWRIid2.js";import{l8 as L,R2 as w,QO as C,FV as F,G5 as B,G0 as A,G1 as E,R3 as j,e$ as Q,F$ as z}from"./zeni-epic-state-Brhydpej.js";import{z as P,E as N,C as $,bP as K,ag as q,bC as W,bQ as H}from"./index-CbGX11uA.js";import"./mui-ChRNPf14.js";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},s=new e.Error().stack;s&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[s]="1c68969a-1d48-4cf6-9d83-94b96bc64b90",e._sentryDebugIdIdentifier="sentry-dbid-1c68969a-1d48-4cf6-9d83-94b96bc64b90")}catch{}})();function J(){const e=T(),s=f.useRef(!1),t=y((o=>o.vendorListState.fetchStateBillsTab.fetchState??"Not-Started")),p=y((o=>o.vendorListState.allVendorIdsBillsTab.length>0));f.useEffect((()=>{s.current||p||t==="Completed"||t==="In-Progress"||(s.current=!0,e(L({})))}),[p,t,e])}const M=k((function(e,s){const t=w(e),p=t.remiSetupApproverViewUpdateData?.type??"approval_create",o=p==="approval_create"&&t.allApprovalRules.length!==0;let l=t.allApprovalRules.length===0;return s.approvalRuleId&&(l=t.allApprovalRules.findIndex((r=>r.approvalRuleId===s.approvalRuleId))===0),{localData:t,hideUpperBoundField:o,isLowerBoundDisabled:l,approvalUpdateActionType:p}}),(function(e,s){const{navigate:t,approvalUpdateDataView:p,approverViewData:o,approvalRuleId:l}=s,r=p.remiSetupApproverViewUpdateData?.type,i=q(s.location);return{onApprovalRuleDataUpdated:a=>{const d=v=>{const h=[];return v.forEach((u=>{const R=u.actors.selectedUsers.map((m=>({type:"user",subType:void 0,userId:m.userId,idType:"user",isImplicitActor:!1}))),I=u.actors.selectedNonUsers.map((m=>{const g=(S=m.value,j(S)==null);var S;return{type:g?"attribute":"role",subType:m.value,userId:void 0,idType:void 0,isImplicitActor:!g}})),c=R.concat(I);h.push({action:u.stepType.selectedOption,actors:c,operator:c.length>1?u.stepType.selectedOption==="require_approval"?"or":"and":"is"})})),h},n={amount:{type:"amount",comparator:"range",min:{amount:a.lowerBound,currencyCode:"USD",currencySymbol:"$"},max:{amount:a.upperBound,currencyCode:"USD",currencySymbol:"$"}}};if(r==="approval_create"){const v={criteria:n,steps:d(a.steps),isApplicableOnPendingApprovalEntity:a.applyToExistingReimbursements.includes("applyToExistingReimbursements")};e(E(v))}else{const v={approvalRuleId:l,criteria:n,steps:d(a.steps),isApplicableOnPendingApprovalEntity:a.applyToExistingReimbursements.includes("applyToExistingReimbursements")};e(E(v))}},onResetClick:()=>{e(A()),r==="approval_update"||i?t("../"):o.allApprovalRules.length===0&&o.fetchState==="Completed"?t("../../setup"):t("../")},onBackClick:()=>{e(A()),r==="approval_update"||i?t("../"):o.allApprovalRules.length===0&&o.fetchState==="Completed"?t("../../setup"):t("../")},onSaveRuleClick:()=>{e(B(!1))},onSaveRuleSuccess:()=>{t("../")}}}))(K);function X(){const e=O(),s=T(),t=_(),{approvalRuleId:p}=V(),o=P.getSignedInUser(),l=N(),r=y((n=>w(n))),i=y((n=>C(n))),[a,d]=f.useState(!1);if(f.useEffect((()=>{a||(d(!0),s(F(!0)))})),f.useEffect((()=>{i.fetchState==="Not-Started"&&e(p!=null?"../../":"../")}),[i,p]),o==null)throw Error("Can't access address page without signing in...");return r.approversDetailsFetchStatus.fetchState=="Not-Started"||r.approversDetailsFetchStatus.fetchState==="In-Progress"?b.jsx($,{fetchState:r.approversDetailsFetchStatus.fetchState,style:{backgroundColor:l.colors.grey5}}):b.jsx(M,{navigate:e,approvalUpdateDataView:r,approvalRuleId:p,approverViewData:i,location:t})}function pe(e){return j(e)==null}const Y=k((function(e,s){const t=w(e),p=t.remiSetupApproverViewUpdateData?.type??"approval_create",o=[],l={};for(const r of Object.values(e.vendorState.vendorByID))r?.id!=null&&(o.push(r.id),l[r.id]=r.name);return{localData:t,approvalUpdateActionType:p,allVendorIds:o,vendorNamesById:l,editingRuleId:p==="approval_update"?s.approvalRuleId:void 0,allApprovalRulesWithUser:C(e).allApprovalRules}}),(function(e,s){const{navigate:t,approvalUpdateDataView:p,approverViewData:o,approvalRuleId:l}=s,r=p.remiSetupApproverViewUpdateData?.type,i=q(s.location);return{onApprovalRuleDataUpdated:a=>{const d=c=>{const m=[];return c.forEach((g=>{const S=g.actorKind?.selectedOption,U=g.selectedRole?.selectedOption;let D=[];S==="role"&&U!=null?D=[{type:"attribute",subType:U,userId:void 0,idType:void 0,isImplicitActor:!1}]:S==="specific_person"&&(D=(g.persons?.selectedUsers??[]).map((G=>({type:"user",subType:void 0,userId:G.userId,idType:"user",isImplicitActor:!1}))));const x=g.action??"require_approval";m.push({action:x,actors:D,operator:D.length>1?x==="require_approval"?"or":"and":"is"})})),m},n=a.amountCriteria,v=a.vendorCriteria,h=a.departmentCriteria,u={};if(n!=null&&n.comparator.selectedOption!=null){const c=n.comparator.selectedOption;u.amount={type:"amount",comparator:c,min:c==="less_than"?void 0:n.min,max:c==="greater_than"?void 0:n.max}}const R=v?.selection.selectedOptions??[];R.length>0&&(u.vendor={type:"vendor",operator:v?.operator.selectedOption??"is",vendorIds:R});const I=h?.selection.selectedOptions??[];if(I.length>0&&(u.department={type:"department",operator:h?.operator.selectedOption??"is",departmentIds:I}),r==="approval_create"){const c={name:a.name,description:a.description,separationOfDuties:a.separationOfDuties,isFallback:a.isFallback,criteria:u,steps:d(a.steps),isApplicableOnPendingApprovalEntity:a.applyToExistingReimbursements.includes("applyToExistingReimbursements")};e(E(c))}else{const c={approvalRuleId:l,name:a.name,description:a.description,separationOfDuties:a.separationOfDuties,isFallback:a.isFallback,criteria:u,steps:d(a.steps),isApplicableOnPendingApprovalEntity:a.applyToExistingReimbursements.includes("applyToExistingReimbursements")};e(E(c))}},onResetClick:()=>{e(A()),r==="approval_update"||i?t("../"):o.allApprovalRules.length===0&&o.fetchState==="Completed"?t("../../setup"):t("../")},onBackClick:()=>{e(A()),r==="approval_update"||i?t("../"):o.allApprovalRules.length===0&&o.fetchState==="Completed"?t("../../setup"):t("../")},onSaveRuleClick:()=>{e(B(!0))},onSaveRuleSuccess:()=>{t("../")},onEditExistingRule:a=>{e(z(a)),t(r==="approval_update"?`../../${a}/edit`:`../${a}/edit`)}}}))(H);function ne(){const e=y((t=>Q(t))),{isApprovalRulesV3Enabled:s}=W(e?.tenantId);return s?b.jsx(Z,{}):b.jsx(X,{})}function Z(){const e=O(),s=T(),t=_(),{approvalRuleId:p}=V(),o=P.getSignedInUser(),l=N(),r=y((n=>w(n))),i=y((n=>C(n))),[a,d]=f.useState(!1);if(J(),f.useEffect((()=>{a||(d(!0),s(F(!0)))})),f.useEffect((()=>{i.fetchState==="Not-Started"&&e(p!=null?"../../":"../")}),[i,p]),o==null)throw Error("Can't access address page without signing in...");return r.approversDetailsFetchStatus.fetchState=="Not-Started"||r.approversDetailsFetchStatus.fetchState==="In-Progress"?b.jsx($,{fetchState:r.approversDetailsFetchStatus.fetchState,style:{backgroundColor:l.colors.grey5}}):b.jsx(Y,{navigate:e,approvalUpdateDataView:r,approvalRuleId:p,approverViewData:i,location:t},p??"new")}export{ne as R,pe as i,J as u};
@@ -1,4 +1,4 @@
1
- import{j as s}from"./liveblocks-bqFl_SVp.js";import{h as q,u as de,g as V,i as Y,j as w,N as _,n as Q,l as ct,o as dt,p as C}from"./core-Bnb5S7eF.js";import{eZ as H,R6 as ue,c7 as pe,F2 as Ue,kR as ut,Ff as oe,Fe as re,R7 as pt,bn as be,gt as Le,R8 as bt,Nv as gt,kG as Pe,Nw as ve,Nx as ht,jB as ft,Qq as St,jQ as Rt,ES as It,uw as yt,jI as vt,FC as $e,R9 as Me,Ra as kt,Rb as At,Rc as Ct,Rd as Et,Re as wt,Fm as ke,jW as xt,Qz as Bt,Fg as Tt,F0 as jt,Rf as Ft,E$ as Dt,Rg as Ut,F8 as Ae,Fq as Lt,Fp as Pt,Fl as $t,Rh as _e,KB as Mt,bq as _t,Fb as Nt,FU as Gt,Ri as Ot,Rj as zt,Fy as Zt,Fv as Ce,PV as Vt,EZ as Ht,Rk as Ne,Gk as Ee,Gs as Wt,Rl as qt,Rm as z,Rn as Qt,Ro as Ge,Rp as Kt,Rq as Oe,Rr as ze,FK as le,bu as Jt,bK as ge,cI as he,fG as Ze,fE as Ve,Rs as Xt,fB as Yt,Q6 as en,Rt as tn,Ru as He,Qa as nn,QU as an,Rv as sn,R5 as on,Gp as we,Go as rn,Rw as ln,Rx as mn,Ry as cn,Rz as dn,RA as un,QF as pn,Gf as bn,Gj as gn,bs as hn,bJ as fn,cC as Sn,cq as Rn,bt as In,Mj as yn,cS as vn,cV as kn,cU as An,cB as Cn}from"./zeni-epic-state-GXytJkko.js";import{x as We,p as qe,y as ee,d as E,z as P,b$ as Qe,D as te,g as k,aM as xe,o as F,au as X,K as En,O as Ke,c0 as wn,w as Z,a0 as Je,c1 as xn,f as ne,c2 as Bn,_ as Tn,G as jn,B as fe,j as Xe,a9 as Fn,bn as Dn,a4 as Un,E as Ye,c3 as Ln,i as Pn}from"./index-DQqz4S7_.js";import{n as N,S as $n}from"./mui-BAFflVdx.js";import me from"./NotFoundScreen-DlOrYovK.js";import{S as Be}from"./SetupPagesScreen-DFoSoY9W.js";import{F as et}from"./FeaturePreviewScreen-CQa-Dzig.js";import{a as f}from"./sentry-Bj_fC7Ll.js";import{u as Se}from"./useAskAiCfoHostNavButtonProps-C8xAByz8.js";import{u as tt}from"./useInitialThreadRequest-DA5ML13t.js";import{D as Mn}from"./DrawerScreen-CFNs8DOc.js";import{M as nt}from"./MobileAppDrawer-CcKlE5IP.js";import{R as _n}from"./ReimbursementApprovalRoutes-POVUD6sL.js";import{FallBackRoute as Nn}from"./ScreenRoutes-B4XnnElP.js";import"./recharts-B3FaT6ex.js";import"./analytics-fzE8ssbj.js";import"./plaid-Il6Pn-tK.js";import"./dnd-BclBZkmc.js";import"./stripe-cKAAJElX.js";import"./lottie-CosVBOrn.js";import"./lexical-DbVLnI8g.js";import"./pdf-Ba7sOjY6.js";import"./utils-BKBg63lI.js";import"./analyticsHelper-H9dml3jr.js";import"./routePaths-BU7xzRci.js";import"./BusinessVerificationPageScreen-DFVMEcvH.js";import"./ReimbursementApprovalRuleDetailScreen-DdpFdkik.js";import"./getLocaleForTenant-CqG7z-4D.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]="717c5c88-053b-454a-94c8-d5a05fc9296e",e._sentryDebugIdIdentifier="sentry-dbid-717c5c88-053b-454a-94c8-d5a05fc9296e")}catch{}})();const at=e=>`/${e}/reimbursements`,Gn=e=>f.createElement("svg",{viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",...e},f.createElement("path",{d:"M12.5 3.5L3.5 12.5",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round"}),f.createElement("path",{d:"M12.5 12.5L3.5 3.5",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round"})),{common:Te,spendManagement:{reimbursement:{reimbursementDetail:M}}}=Ke.getLocalizedStrings(),On=Q((function(e,t){const n=t.currentTenant?.companyId,r=pt(e.plaidAccountViewState,"user_reimbursement_account"),d=P.getSignedInUser(),c=be(d),m=r.plaidConnectionDetails,o=Le(e.companyState,n),a=e.tenantState.currentTenantId,i={userId:d?.userId??"",sessionId:d?.zeniSessionId??"",tenantId:a??""},l=ue(e,t.reimbursementId),b=bt(e,d?.userId??"");let y=`${d?.firstName} ${d?.lastName}`,h=!0;t.reimbursementId!=null&&(y=`${l.createdBy?.firstName??"Zeni"} ${l.createdBy?.lastName??""}`,h=d?.userId===l.createdBy?.userId);const T=e.entityAutoCompleteState?.autoCompleteText?.common,u=gt(e,"common");return{remiDetails:l,uploadInvoiceEndPoint:`${X.communicationAgentMicroServiceBaseUrl}`,reimbursementId:t.reimbursementId,customerSearchAutoCompleteData:{autoCompleteText:T,entityAutoCompleteView:u},authParams:i,defaultCurrency:{currencySymbol:o?.company.companyLocaleInfo.currencySymbol??"$",currencyCode:o?.company.companyLocaleInfo.currencyCode??"USD"},companyMileageConfigInfo:o?.company.configInfo.mileageRateConfig,createdBy:y,isUserAdmin:pe(t.currentTenant?.userRole??[]),isZeniUser:c,plaidConnectionDetails:m,bankNameByRouting:l.bankNameByRouting,bankAccountCreationState:b.bankAccountCreationState,bankAccounts:b.bankAccounts,analytics:k,bankAccountToCreate:l.bankAccountToCreate,fetchBankNameByRoutingStatus:l.fetchBankNameByRoutingStatus,isSignedInUserReimbursementCreator:h,disableInternalOverlay:t.disableInternalOverlay,showSkipAutoFill:t.showSkipAutoFill,setShowSkipAutoFill:t.setShowSkipAutoFill,isAccountingClassesEnabled:Pe(e)}}),(function(e,t){const{reimbursementId:n,currentTenant:r,location:d,navigate:c,themeState:m}=t,{tenantEmailDomain:o}=r,a=P.getSignedInUser();return{onReceiptsUpload:(i,l,b)=>{i!=null&&e(re(i,l,b,n,a?.userId))},onExistingMerchantChange:(i,l)=>{e(Ae(!1,l,n,i,void 0))},fetchDuplicateReimbursement:()=>{a?.userId!=null&&e($t(a.userId,!0,n))},clearDuplicateReimbursementDetail:()=>{e(Pt())},clearRemiSaveStatus:()=>{e(Lt("Not-Started",n))},onDuplicateLineClick:(i,l)=>window.open(`/${o}/reimbursement/${i}#L${l}`),onNewMerchantChange:(i,l)=>{e(Ae(!1,l,n,void 0,i))},removeFileFromLine:i=>{e(Ut({lineId:i,reimbursementId:n}))},onAmountChanged:(i,l)=>{e(Dt(l,i,n))},updateReimbursementType:(i,l,b)=>{e(Ft({reimbursementId:b,lineId:l,reimbursementType:i}))},onHomeCurrencyConversionUpdate:(i,l,b)=>{e(jt({reimbursementId:b,lineId:l,amountPayload:{amount:i.amount,currency_code:i.currencyCode,currency_symbol:i.currencySymbol}}))},onReimbursementDetailsChanged:i=>{e(Tt({remiDetailLocalData:i,reimbursementId:n}))},saveRemiDetails:i=>{e(ke(i,!1,n))},onUserBankDetailsUpdated:i=>{const{bankAccountSection:l}=i;e(Bt({data:l}))},onFetchBankName:i=>{e(xt(i))},submitRemiDetails:()=>{e(ke("pending_approval",!0,n))},discardReimbursementDetailsFromLocalStore:i=>{e(wt({reimbursementId:i}))},updateInvoiceUploadFetchState:i=>{e(oe({reimbursementId:n,fetchState:i}))},clearTentativeNameForLine:i=>{e(Et({reimbursementId:n,lineId:i}))},removeDuplicateReimbursementForLine:i=>{e(Ct({lineId:i}))},onZeniLogoClick:()=>{m.toggle()},clearAddRemiAutoFields:i=>{e(At({reimbursementId:n,lineId:i}))},redirectToReimbursementListScreen:()=>{e(Me()),e(kt());const i=at(o),l=Z(d.state?.pathnameStackToGoBack,d.pathname);c(i,{state:{pathnameStackToGoBack:l}})},redirectToReimbursementDetailScreen:()=>{t.navigate("../")},deleteReimbursement:()=>{n!=null&&(k.trackReimbursementDeleteReimbursement(n),e($e(n)))},onSaveBankAccount:()=>{a?.userId&&e(vt(a?.userId,n))},onFetchLinkTokenClick:i=>{e(yt("user_reimbursement_account",i))},onEstablishConnectionClick:i=>{e(It(i,r.companyId,"user_reimbursement_account",void 0,"link_account_no_microdeposit"))},deleteBankAccount:i=>{e(Rt(i,a?.userId??""))},onBackClickFromBankAccountPage:()=>{e(ft({fetchState:"Not-Started"})),e(St())},customerSearchAutoCompleteActions:{onAutoCompleteInputChange:(i,l)=>{i.trim().length>=2?e(ht({searchString:i,entityType:l,searchOrigin:"common"})):e(ve("common"))},onCancelAutoComplete:()=>{e(ve("common"))}}}}))(wn);function je(){const e=q(),t=de(),n=V(),{reimbursementId:r}=Y(),d=We(),c=qe(),[m,o]=f.useState(r==null),[a,i]=f.useState(1),{useFeatureGate:l}=ee(),{isFeatureEnabled:b}=l(E.isLimitedCategoryForReimbursement),{isFeatureEnabled:y}=l(E.isShowDeletedReimbursementsFeatureEnabled),{isFeatureEnabled:h}=l(E.isReimbursementCommentingEnabled),{isAiCfoAccessEnabled:T,onAskAiCfoClick:u}=Se({mobileExploreReferrer:"Reimbursement Details"}),x=V().pathname,j=x.includes("edit"),v=x.includes("reimbursement/new"),[D,B]=f.useState(!1),A=P.getSignedInUser(),R=w((p=>H(p))),g=w((p=>ue(p,r))),U=tt(R?.companyId,{clearParams:g.fetchState==="Completed"}),L=pe(R?.userRole??[]);f.useEffect((()=>{(v&&!D||j&&g.fetchState!="Completed"&&g.fetchState!="In-Progress")&&(B(!0),t(Ue(!1,b,y,r)))}));const $=w((p=>ut(p.accountState,p.accountListState,"reimbursementAccountList")));if(A==null)throw Error("Can't access address page without signing in...");const I={pathname:`../${r}`,search:n.search};return g.isDeleted===!0||g.billStage=="paid"||g.billStage=="scheduled"||g.fetchState=="Not-Started"||L&&g.billStatus==="rejected"||L===!1&&g.billStage==="pending_approval"&&g.billStatus!=="rejected"?s.jsx(_,{to:I}):g.deleteStatus.fetchState==="In-Progress"||g.fetchState!=="Completed"?s.jsx(Qe,{isNewReimbursement:r==null}):s.jsxs(zn,{windowSize:c,children:[s.jsx(te,{analytics:k,onLoad:p=>(W=>{r!=null&&g.deleteStatus.fetchState!=="Completed"&&W.trackReimbursementEditReimbursement(r)})(p)}),m&&c!=="small"?s.jsx(Zn,{}):null,m&&c!=="small"?s.jsx(Vn,{children:s.jsx(xe,{showAutofill:m,uploadInvoiceEndPoint:`${X.communicationAgentMicroServiceBaseUrl}`,authParams:{userId:A?.userId??"",sessionId:A?.zeniSessionId??"",tenantId:R?.tenantId??""},onSkipAutofill:()=>o(!1),onInvoiceUpload:p=>{p!=null&&t(re(p,a,!0,r,A?.userId))},updateInvoiceUploadFetchState:p=>{t(oe({reimbursementId:r,fetchState:p}))},allowMultiFiles:m,showInfoText:!1,type:"reimbursement",style:{width:"100%",paddingTop:"78px",paddingRight:F.sp3,paddingBottom:"15px",paddingLeft:F.sp5},dropFilePlaceholder:{upload:Te.upload,single:M.dropReceipt.single,or:M.dropReceipt.or,multiple:M.dropReceipt.multiple,receipts:M.dropReceipt.receipts}})}):null,m&&c==="small"?s.jsxs(Hn,{children:[s.jsx(Wn,{onClick:()=>o(!1),children:s.jsx(Gn,{})}),s.jsx(xe,{showAutofill:m,uploadInvoiceEndPoint:`${X.communicationAgentMicroServiceBaseUrl}`,authParams:{userId:A?.userId??"",sessionId:A?.zeniSessionId??"",tenantId:R?.tenantId??""},onSkipAutofill:()=>o(!1),onInvoiceUpload:p=>{p!=null&&t(re(p,a,!0,r,A?.userId))},updateInvoiceUploadFetchState:p=>{t(oe({reimbursementId:r,fetchState:p}))},allowMultiFiles:m,showInfoText:!1,type:"reimbursement",style:{width:"100%",paddingTop:F.sp5,paddingRight:F.sp3,paddingBottom:F.sp5,paddingLeft:F.sp3},dropFilePlaceholder:{upload:Te.upload,single:M.dropReceipt.single,or:M.dropReceipt.or,multiple:M.dropReceipt.multiple,receipts:M.dropReceipt.receipts}})]}):null,s.jsx(qn,{windowSize:c,children:s.jsx(On,{initialOpenThreadRequest:U??void 0,isReimbursementCommentingEnabled:h,location:n,navigate:e,currentTenant:R,reimbursementId:r,themeState:d,uncategorizedAccounts:$,disableInternalOverlay:!0,showSkipAutoFill:m,setShowSkipAutoFill:o,onCurrentLineIdForUploadChange:i,isAiCfoAccessEnabled:T,onAskAiCfoClick:u})})]})}const zn=N.div`
1
+ import{j as s}from"./liveblocks-BqtYq8PY.js";import{h as J,u as de,g as H,i as X,j as w,N as _,n as Q,l as ct,o as dt,p as C}from"./core-4nWRIid2.js";import{e$ as V,Rg as ue,c7 as pe,F4 as Ue,kT as ut,Fh as oe,Fg as re,Rh as pt,bn as be,gv as Le,Ri as bt,NF as gt,kI as Pe,NG as Ae,NH as ht,jD as ft,QA as St,jS as Rt,EU as It,uy as yt,jK as At,FE as $e,Rj as Me,Rk as kt,Rl as vt,Rm as Ct,Rn as Et,Ro as wt,Fo as ke,jY as xt,QJ as Bt,Fi as Tt,F2 as Ft,Rp as Dt,F1 as jt,Rq as Ut,Fa as ve,Fs as Lt,Fr as Pt,Fn as $t,Rr as _e,KL as Mt,bq as _t,Fd as Nt,FW as Gt,Rs as Ot,Rt as zt,FA as Zt,Fx as Ce,Q3 as Ht,E$ as Vt,Ru as Ne,Gm as Ee,Gu as Wt,Rv as Jt,Rw as z,Rx as Qt,Ry as Ge,Rz as qt,RA as Oe,RB as ze,FM as le,bu as Kt,bK as ge,cJ as he,fI as Ze,fG as He,RC as Yt,fD as Xt,Qg as en,RD as tn,RE as Ve,Qk as nn,R2 as an,RF as sn,Rf as on,Gr as we,Gq as rn,RG as ln,RH as mn,RI as cn,RJ as dn,RK as un,QP as pn,Gh as bn,Gl as gn,bs as hn,bJ as fn,cD as Sn,cr as Rn,bt as In,Mt as yn,cT as An,cW as kn,cV as vn,cC as Cn}from"./zeni-epic-state-Brhydpej.js";import{A as We,J as Je,w as ee,i as E,z as P,b$ as Qe,Z as te,e as k,aM as xe,o as D,au as Y,I as En,a as qe,c0 as wn,x as Z,a0 as Ke,c1 as xn,D as ne,c2 as Bn,_ as Tn,G as Fn,C as fe,h as Ye,a9 as Dn,bn as jn,a4 as Un,E as Xe,c3 as Ln,d as Pn}from"./index-CbGX11uA.js";import{n as N,S as $n}from"./mui-ChRNPf14.js";import me from"./NotFoundScreen-D8y3QSjF.js";import{S as Be}from"./SetupPagesScreen-BX3zI3tV.js";import{F as et}from"./FeaturePreviewScreen-BYw0siNX.js";import{a as f}from"./sentry-BtWdTNDK.js";import{u as Se}from"./useAskAiCfoHostNavButtonProps-DuEP5Klm.js";import{u as tt}from"./useInitialThreadRequest-BMuxer3t.js";import{D as Mn}from"./DrawerScreen-CTCbWuBb.js";import{M as nt}from"./MobileAppDrawer-C850zeFL.js";import{R as _n}from"./ReimbursementApprovalRoutes-nJxxaKUX.js";import{FallBackRoute as Nn}from"./ScreenRoutes-DBgtMxcS.js";import"./recharts-UIIeT-6j.js";import"./analytics-CP-wGaZJ.js";import"./plaid-j-SLH4pe.js";import"./dnd-DPx0nGIt.js";import"./stripe-cKAAJElX.js";import"./lottie-C6mBeCcV.js";import"./lexical-Dce73siJ.js";import"./pdf-CHegScPw.js";import"./utils-BGj88Dzy.js";import"./analyticsHelper-BZTNTJma.js";import"./routePaths-BYuMJjxP.js";import"./BusinessVerificationPageScreen-BwMN9nGs.js";import"./ReimbursementApprovalRuleDetailScreen-DXovejDg.js";import"./getLocaleForTenant-Bpp7IHaZ.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]="85fcf059-ebf4-41ec-a636-d39f3467912a",e._sentryDebugIdIdentifier="sentry-dbid-85fcf059-ebf4-41ec-a636-d39f3467912a")}catch{}})();const at=e=>`/${e}/reimbursements`,Gn=e=>f.createElement("svg",{viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",...e},f.createElement("path",{d:"M12.5 3.5L3.5 12.5",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round"}),f.createElement("path",{d:"M12.5 12.5L3.5 3.5",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round"})),{common:Te,spendManagement:{reimbursement:{reimbursementDetail:M}}}=qe.getLocalizedStrings(),On=Q((function(e,t){const n=t.currentTenant?.companyId,r=pt(e.plaidAccountViewState,"user_reimbursement_account"),d=P.getSignedInUser(),c=be(d),m=r.plaidConnectionDetails,o=Le(e.companyState,n),a=e.tenantState.currentTenantId,i={userId:d?.userId??"",sessionId:d?.zeniSessionId??"",tenantId:a??""},l=ue(e,t.reimbursementId),b=bt(e,d?.userId??"");let y=`${d?.firstName} ${d?.lastName}`,h=!0;t.reimbursementId!=null&&(y=`${l.createdBy?.firstName??"Zeni"} ${l.createdBy?.lastName??""}`,h=d?.userId===l.createdBy?.userId);const T=e.entityAutoCompleteState?.autoCompleteText?.common,u=gt(e,"common");return{remiDetails:l,uploadInvoiceEndPoint:`${Y.communicationAgentMicroServiceBaseUrl}`,reimbursementId:t.reimbursementId,customerSearchAutoCompleteData:{autoCompleteText:T,entityAutoCompleteView:u},authParams:i,defaultCurrency:{currencySymbol:o?.company.companyLocaleInfo.currencySymbol??"$",currencyCode:o?.company.companyLocaleInfo.currencyCode??"USD"},companyMileageConfigInfo:o?.company.configInfo.mileageRateConfig,createdBy:y,isUserAdmin:pe(t.currentTenant?.userRole??[]),isZeniUser:c,plaidConnectionDetails:m,bankNameByRouting:l.bankNameByRouting,bankAccountCreationState:b.bankAccountCreationState,bankAccounts:b.bankAccounts,analytics:k,bankAccountToCreate:l.bankAccountToCreate,fetchBankNameByRoutingStatus:l.fetchBankNameByRoutingStatus,isSignedInUserReimbursementCreator:h,disableInternalOverlay:t.disableInternalOverlay,showSkipAutoFill:t.showSkipAutoFill,setShowSkipAutoFill:t.setShowSkipAutoFill,isAccountingClassesEnabled:Pe(e)}}),(function(e,t){const{reimbursementId:n,currentTenant:r,location:d,navigate:c,themeState:m}=t,{tenantEmailDomain:o}=r,a=P.getSignedInUser();return{onReceiptsUpload:(i,l,b)=>{i!=null&&e(re(i,l,b,n,a?.userId))},onExistingMerchantChange:(i,l)=>{e(ve(!1,l,n,i,void 0))},fetchDuplicateReimbursement:()=>{a?.userId!=null&&e($t(a.userId,!0,n))},clearDuplicateReimbursementDetail:()=>{e(Pt())},clearRemiSaveStatus:()=>{e(Lt("Not-Started",n))},onDuplicateLineClick:(i,l)=>window.open(`/${o}/reimbursement/${i}#L${l}`),onNewMerchantChange:(i,l)=>{e(ve(!1,l,n,void 0,i))},removeFileFromLine:i=>{e(Ut({lineId:i,reimbursementId:n}))},onAmountChanged:(i,l)=>{e(jt(l,i,n))},updateReimbursementType:(i,l,b)=>{e(Dt({reimbursementId:b,lineId:l,reimbursementType:i}))},onHomeCurrencyConversionUpdate:(i,l,b)=>{e(Ft({reimbursementId:b,lineId:l,amountPayload:{amount:i.amount,currency_code:i.currencyCode,currency_symbol:i.currencySymbol}}))},onReimbursementDetailsChanged:i=>{e(Tt({remiDetailLocalData:i,reimbursementId:n}))},saveRemiDetails:i=>{e(ke(i,!1,n))},onUserBankDetailsUpdated:i=>{const{bankAccountSection:l}=i;e(Bt({data:l}))},onFetchBankName:i=>{e(xt(i))},submitRemiDetails:()=>{e(ke("pending_approval",!0,n))},discardReimbursementDetailsFromLocalStore:i=>{e(wt({reimbursementId:i}))},updateInvoiceUploadFetchState:i=>{e(oe({reimbursementId:n,fetchState:i}))},clearTentativeNameForLine:i=>{e(Et({reimbursementId:n,lineId:i}))},removeDuplicateReimbursementForLine:i=>{e(Ct({lineId:i}))},onZeniLogoClick:()=>{m.toggle()},clearAddRemiAutoFields:i=>{e(vt({reimbursementId:n,lineId:i}))},redirectToReimbursementListScreen:()=>{e(Me()),e(kt());const i=at(o),l=Z(d.state?.pathnameStackToGoBack,d.pathname);c(i,{state:{pathnameStackToGoBack:l}})},redirectToReimbursementDetailScreen:()=>{t.navigate("../")},deleteReimbursement:()=>{n!=null&&(k.trackReimbursementDeleteReimbursement(n),e($e(n)))},onSaveBankAccount:()=>{a?.userId&&e(At(a?.userId,n))},onFetchLinkTokenClick:i=>{e(yt("user_reimbursement_account",i))},onEstablishConnectionClick:i=>{e(It(i,r.companyId,"user_reimbursement_account",void 0,"link_account_no_microdeposit"))},deleteBankAccount:i=>{e(Rt(i,a?.userId??""))},onBackClickFromBankAccountPage:()=>{e(ft({fetchState:"Not-Started"})),e(St())},customerSearchAutoCompleteActions:{onAutoCompleteInputChange:(i,l)=>{i.trim().length>=2?e(ht({searchString:i,entityType:l,searchOrigin:"common"})):e(Ae("common"))},onCancelAutoComplete:()=>{e(Ae("common"))}}}}))(wn);function Fe(){const e=J(),t=de(),n=H(),{reimbursementId:r}=X(),d=We(),c=Je(),[m,o]=f.useState(r==null),[a,i]=f.useState(1),{useFeatureGate:l}=ee(),{isFeatureEnabled:b}=l(E.isLimitedCategoryForReimbursement),{isFeatureEnabled:y}=l(E.isShowDeletedReimbursementsFeatureEnabled),{isFeatureEnabled:h}=l(E.isReimbursementCommentingEnabled),{isAiCfoAccessEnabled:T,onAskAiCfoClick:u}=Se({mobileExploreReferrer:"Reimbursement Details"}),x=H().pathname,F=x.includes("edit"),A=x.includes("reimbursement/new"),[j,B]=f.useState(!1),v=P.getSignedInUser(),R=w((p=>V(p))),g=w((p=>ue(p,r))),U=tt(R?.companyId,{clearParams:g.fetchState==="Completed"}),L=pe(R?.userRole??[]);f.useEffect((()=>{(A&&!j||F&&g.fetchState!="Completed"&&g.fetchState!="In-Progress")&&(B(!0),t(Ue(!1,b,y,r)))}));const $=w((p=>ut(p.accountState,p.accountListState,"reimbursementAccountList")));if(v==null)throw Error("Can't access address page without signing in...");const I={pathname:`../${r}`,search:n.search};return g.isDeleted===!0||g.billStage=="paid"||g.billStage=="scheduled"||g.fetchState=="Not-Started"||L&&g.billStatus==="rejected"||L===!1&&g.billStage==="pending_approval"&&g.billStatus!=="rejected"?s.jsx(_,{to:I}):g.deleteStatus.fetchState==="In-Progress"||g.fetchState!=="Completed"?s.jsx(Qe,{isNewReimbursement:r==null}):s.jsxs(zn,{windowSize:c,children:[s.jsx(te,{analytics:k,onLoad:p=>(W=>{r!=null&&g.deleteStatus.fetchState!=="Completed"&&W.trackReimbursementEditReimbursement(r)})(p)}),m&&c!=="small"?s.jsx(Zn,{}):null,m&&c!=="small"?s.jsx(Hn,{children:s.jsx(xe,{showAutofill:m,uploadInvoiceEndPoint:`${Y.communicationAgentMicroServiceBaseUrl}`,authParams:{userId:v?.userId??"",sessionId:v?.zeniSessionId??"",tenantId:R?.tenantId??""},onSkipAutofill:()=>o(!1),onInvoiceUpload:p=>{p!=null&&t(re(p,a,!0,r,v?.userId))},updateInvoiceUploadFetchState:p=>{t(oe({reimbursementId:r,fetchState:p}))},allowMultiFiles:m,showInfoText:!1,type:"reimbursement",style:{width:"100%",paddingTop:"78px",paddingRight:D.sp3,paddingBottom:"15px",paddingLeft:D.sp5},dropFilePlaceholder:{upload:Te.upload,single:M.dropReceipt.single,or:M.dropReceipt.or,multiple:M.dropReceipt.multiple,receipts:M.dropReceipt.receipts}})}):null,m&&c==="small"?s.jsxs(Vn,{children:[s.jsx(Wn,{onClick:()=>o(!1),children:s.jsx(Gn,{})}),s.jsx(xe,{showAutofill:m,uploadInvoiceEndPoint:`${Y.communicationAgentMicroServiceBaseUrl}`,authParams:{userId:v?.userId??"",sessionId:v?.zeniSessionId??"",tenantId:R?.tenantId??""},onSkipAutofill:()=>o(!1),onInvoiceUpload:p=>{p!=null&&t(re(p,a,!0,r,v?.userId))},updateInvoiceUploadFetchState:p=>{t(oe({reimbursementId:r,fetchState:p}))},allowMultiFiles:m,showInfoText:!1,type:"reimbursement",style:{width:"100%",paddingTop:D.sp5,paddingRight:D.sp3,paddingBottom:D.sp5,paddingLeft:D.sp3},dropFilePlaceholder:{upload:Te.upload,single:M.dropReceipt.single,or:M.dropReceipt.or,multiple:M.dropReceipt.multiple,receipts:M.dropReceipt.receipts}})]}):null,s.jsx(Jn,{windowSize:c,children:s.jsx(On,{initialOpenThreadRequest:U??void 0,isReimbursementCommentingEnabled:h,location:n,navigate:e,currentTenant:R,reimbursementId:r,themeState:d,uncategorizedAccounts:$,disableInternalOverlay:!0,showSkipAutoFill:m,setShowSkipAutoFill:o,onCurrentLineIdForUploadChange:i,isAiCfoAccessEnabled:T,onAskAiCfoClick:u})})]})}const zn=N.div`
2
2
  display: flex;
3
3
  position: relative;
4
4
  height: 100vh;
@@ -12,7 +12,7 @@ import{j as s}from"./liveblocks-bqFl_SVp.js";import{h as q,u as de,g as V,i as Y
12
12
  bottom: 0;
13
13
  background-color: ${En.overlayBackgroundBlack};
14
14
  z-index: 5;
15
- `,Vn=N.div`
15
+ `,Hn=N.div`
16
16
  position: absolute;
17
17
  top: 0;
18
18
  left: 0;
@@ -22,7 +22,7 @@ import{j as s}from"./liveblocks-bqFl_SVp.js";import{h as q,u as de,g as V,i as Y
22
22
  display: flex;
23
23
  background-color: transparent;
24
24
  overflow: hidden;
25
- `,Hn=N.div`
25
+ `,Vn=N.div`
26
26
  position: fixed;
27
27
  top: 0;
28
28
  left: 0;
@@ -38,22 +38,22 @@ import{j as s}from"./liveblocks-bqFl_SVp.js";import{h as q,u as de,g as V,i as Y
38
38
  background: none;
39
39
  border: none;
40
40
  cursor: pointer;
41
- padding: ${F.sp2} ${F.sp3};
41
+ padding: ${D.sp2} ${D.sp3};
42
42
  line-height: 1;
43
43
  color: ${e=>e.theme.colors.hero};
44
44
  &:hover {
45
45
  color: ${e=>e.theme.colors.primary};
46
46
  }
47
47
  svg {
48
- width: ${F.sp4};
49
- height: ${F.sp4};
48
+ width: ${D.sp4};
49
+ height: ${D.sp4};
50
50
  }
51
- `,qn=N.div`
51
+ `,Jn=N.div`
52
52
  display: flex;
53
53
  flex-direction: column;
54
54
  width: 100%;
55
55
  ${e=>e.windowSize!=="small"?"overflow: auto;":""}
56
- `,Qn=Q((function(e,t){const n=_e(e,t.reimbursementId),r=P.getSignedInUser(),d=be(r),c=e.tenantState.currentTenantId,m={userId:r?.userId??"",sessionId:r?.zeniSessionId??"",tenantId:c??""},o=`${n.createdBy?.firstName??"Zeni"} ${n.createdBy?.lastName??""}`;let a=!1;n?.remiActivities.length>0&&(a=Ot(n.remiActivities,zt(t.currentTenant),r));const i=pe(t.currentTenant?.userRole??[]),l=r?.userId===n.createdBy?.userId;return{remiDetails:n,uploadInvoiceEndPoint:`${X.communicationAgentMicroServiceBaseUrl}`,authParams:m,signedInUser:r,createdBy:o,isRealTimeApprovalEnabled:t.isRealTimeApprovalEnabled,isAdmin:i,showApproveRejectBtns:a,isZeniUser:d,isSignedInUserReimbursementCreator:l,isAccountingClassesEnabled:Pe(e)}}),(function(e,t){const{reimbursementId:n,currentTenant:r,location:d,navigate:c,themeState:m}=t,{tenantEmailDomain:o}=r;return{onDuplicateLineClick:(a,i)=>window.open(`/${o}/reimbursement/${a}#L${i}`),redirectToReimbursementListScreen:()=>{e(Me());const a=at(o),i=Z(d.state?.pathnameStackToGoBack,d.pathname);c(a,{state:{pathnameStackToGoBack:i}})},onSaveRealTimeApprovals:a=>{e(Ht(n,"reimbursement",a))},updateEditRealTimeApproverClicked:a=>{e(Vt({isEdit:a,entityId:n,entityType:"reimbursement"}))},approveOrRejectRemi:a=>{a.type==="approved"?e(Ce(n,a.type,"")):e(Ce(n,a.type,a.description??""))},redirectToEditableReimbursementScreen:()=>{const a=Z(d.state?.pathnameStackToGoBack,d.pathname);c("./edit",{state:{pathnameStackToGoBack:a}})},deleteReimbursement:()=>{k.trackReimbursementDeleteReimbursement(n),e($e(n))},cancelAndDeleteReport:a=>{a===!0?k.trackReimbursementCancelAndDeleteReimbursement(n):k.trackReimbursementCancelReimbursement(n),e(Zt(n,a))},handleZeniLogoClick:()=>{m.toggle()}}}))(xn);function Kn(){const e=q(),t=de(),n=V(),r=n.hash.substring(1),d=We(),{reimbursementId:c}=Y(),m=P.getSignedInUser(),o=w((I=>H(I))),a=w((I=>_e(I,c??""))),i=a.remiDetails?.reimbursementInfo.stage.code==="draft",l=tt(o?.companyId,{clearParams:a.fetchState==="Completed"&&!i}),{isAiCfoAccessEnabled:b,onAskAiCfoClick:y}=Se({mobileExploreReferrer:"Reimbursement Details"});Je({isDataReady:a.fetchState==="Completed"});const{useFeatureGate:h}=ee(),{isFeatureEnabled:T}=h(E.isLimitedCategoryForReimbursement),[u,x]=f.useState(!1),[j,v]=f.useState(!1),[D,B]=f.useState(!1),{isFeatureEnabled:A}=h(E.isReimbursementCommentingEnabled),{isFeatureEnabled:R}=h(E.isShowDeletedReimbursementsFeatureEnabled),g=w((I=>ue(I,c??""))),U=Mt(o),L=_t(o.userRole),$=a.fetchState;if(f.useEffect((()=>{u||c==null?u==1&&$==="Error"&&e("page-not-found",{replace:!0}):(x(!0),t(Nt(c,!1,R)))}),[u,c,t,$]),f.useEffect((()=>{R&&a.remiDetails?.isDeleted===!0||o.isZeni===!0&&m?.userEmailDomain==="zeni.ai"&&U===!1?B(!1):B(a.remiActivities[0]?.isRealTimeApprovalEnabled&&(L||a.allApprovers.find((I=>I.user.userId===m?.userId))!=null||a.remiDetails?.lastUpdatedBy===m?.userId))}),[a.remiActivities[0]?.isRealTimeApprovalEnabled,a.allApprovers,a.remiDetails?.lastUpdatedBy,L,o.isZeni,U,m]),f.useEffect((()=>{j||a.fetchState!="Completed"||a.remiDetails?.reimbursementInfo.stage.code=="paid"||a.remiDetails?.reimbursementInfo.stage.code=="scheduled"||g.fetchState=="Completed"||g.fetchState=="In-Progress"||(v(!0),t(Ue(!1,T,R,c)),a.remiActivities[0]?.isRealTimeApprovalEnabled===!0&&t(Gt(!1,!0,!0,a.lastUpdatedByUserId)))}),[j,a,c,t]),m==null)throw Error("Can't access address page without signing in...");return a.remiDetails?.reimbursementInfo.stage.code=="draft"&&g.fetchState=="Completed"&&a.remiDetails.isDeleted===!1?s.jsx(_,{to:`./edit${n.search}`}):a.deleteStatus.fetchState==="In-Progress"||a.cancelAndDeleteStatus.fetchState==="In-Progress"||a.remiDetails?.reimbursementInfo.stage.code=="draft"&&g.fetchState!="Completed"||a.fetchState!="Completed"?s.jsx(Qe,{}):s.jsxs(s.Fragment,{children:[s.jsx(te,{analytics:k,onLoad:I=>(p=>{c!=null&&p.trackReimbursementReimbursementDetails(c)})(I)}),s.jsx(Qn,{initialOpenThreadRequest:l??void 0,scrollId:r,isReimbursementCommentingEnabled:A,isShowDeletedReimbursementEnabled:R,location:n,navigate:e,isRealTimeApprovalEnabled:D,currentTenant:o,reimbursementId:c??"",themeState:d,isAiCfoAccessEnabled:b,onAskAiCfoClick:y})]})}const Jn=Q((function(e,t){return{remisReviewView:Ne(e),analytics:t.analytics}}),(function(e,t){return{onCloseOverlay:()=>{t.navigate("./"),e(z())},onCloseReviewItem:n=>{e(qt(n))},onProceedForBulkActionClick:(n,r)=>{switch(n){case"send_for_approval":e(Wt());break;case"approve":e(Ee("approved",r??""));break;case"reject":e(Ee("rejected",r??""))}}}}))(Bn);function Xn(){const e=q(),t=w((c=>c.remisBulkActionViewState.bulkSubmissionFetchState.fetchState)),{remisForReview:n}=w((c=>Ne(c))),r=ne(),d=r?.loggedInUserRole?.includes("admin")===!0;return f.useEffect((()=>{t!=="Completed"&&n.length!==0||e("./")}),[t,n.length]),s.jsx(Jn,{navigate:e,analytics:k,isAdmin:d})}const O=nn(),st="bulk-operation-update",ce="reimbursement-approval-rule-update",{spendManagement:Yn,common:Fe}=Ke.getLocalizedStrings(),De=Yn.reimbursement.bulkActions,ea=N.div`
56
+ `,Qn=Q((function(e,t){const n=_e(e,t.reimbursementId),r=P.getSignedInUser(),d=be(r),c=e.tenantState.currentTenantId,m={userId:r?.userId??"",sessionId:r?.zeniSessionId??"",tenantId:c??""},o=`${n.createdBy?.firstName??"Zeni"} ${n.createdBy?.lastName??""}`;let a=!1;n?.remiActivities.length>0&&(a=Ot(n.remiActivities,zt(t.currentTenant),r));const i=pe(t.currentTenant?.userRole??[]),l=r?.userId===n.createdBy?.userId;return{remiDetails:n,uploadInvoiceEndPoint:`${Y.communicationAgentMicroServiceBaseUrl}`,authParams:m,signedInUser:r,createdBy:o,isRealTimeApprovalEnabled:t.isRealTimeApprovalEnabled,isAdmin:i,showApproveRejectBtns:a,isZeniUser:d,isSignedInUserReimbursementCreator:l,isAccountingClassesEnabled:Pe(e)}}),(function(e,t){const{reimbursementId:n,currentTenant:r,location:d,navigate:c,themeState:m}=t,{tenantEmailDomain:o}=r;return{onDuplicateLineClick:(a,i)=>window.open(`/${o}/reimbursement/${a}#L${i}`),redirectToReimbursementListScreen:()=>{e(Me());const a=at(o),i=Z(d.state?.pathnameStackToGoBack,d.pathname);c(a,{state:{pathnameStackToGoBack:i}})},onSaveRealTimeApprovals:a=>{e(Vt(n,"reimbursement",a))},updateEditRealTimeApproverClicked:a=>{e(Ht({isEdit:a,entityId:n,entityType:"reimbursement"}))},approveOrRejectRemi:a=>{a.type==="approved"?e(Ce(n,a.type,"")):e(Ce(n,a.type,a.description??""))},redirectToEditableReimbursementScreen:()=>{const a=Z(d.state?.pathnameStackToGoBack,d.pathname);c("./edit",{state:{pathnameStackToGoBack:a}})},deleteReimbursement:()=>{k.trackReimbursementDeleteReimbursement(n),e($e(n))},cancelAndDeleteReport:a=>{a===!0?k.trackReimbursementCancelAndDeleteReimbursement(n):k.trackReimbursementCancelReimbursement(n),e(Zt(n,a))},handleZeniLogoClick:()=>{m.toggle()}}}))(xn);function qn(){const e=J(),t=de(),n=H(),r=n.hash.substring(1),d=We(),{reimbursementId:c}=X(),m=P.getSignedInUser(),o=w((I=>V(I))),a=w((I=>_e(I,c??""))),i=a.remiDetails?.reimbursementInfo.stage.code==="draft",l=tt(o?.companyId,{clearParams:a.fetchState==="Completed"&&!i}),{isAiCfoAccessEnabled:b,onAskAiCfoClick:y}=Se({mobileExploreReferrer:"Reimbursement Details"});Ke({isDataReady:a.fetchState==="Completed"});const{useFeatureGate:h}=ee(),{isFeatureEnabled:T}=h(E.isLimitedCategoryForReimbursement),[u,x]=f.useState(!1),[F,A]=f.useState(!1),[j,B]=f.useState(!1),{isFeatureEnabled:v}=h(E.isReimbursementCommentingEnabled),{isFeatureEnabled:R}=h(E.isShowDeletedReimbursementsFeatureEnabled),g=w((I=>ue(I,c??""))),U=Mt(o),L=_t(o.userRole),$=a.fetchState;if(f.useEffect((()=>{u||c==null?u==1&&$==="Error"&&e("page-not-found",{replace:!0}):(x(!0),t(Nt(c,!1,R)))}),[u,c,t,$]),f.useEffect((()=>{R&&a.remiDetails?.isDeleted===!0||o.isZeni===!0&&m?.userEmailDomain==="zeni.ai"&&U===!1?B(!1):B(a.remiActivities[0]?.isRealTimeApprovalEnabled&&(L||a.allApprovers.find((I=>I.user.userId===m?.userId))!=null||a.remiDetails?.lastUpdatedBy===m?.userId))}),[a.remiActivities[0]?.isRealTimeApprovalEnabled,a.allApprovers,a.remiDetails?.lastUpdatedBy,L,o.isZeni,U,m]),f.useEffect((()=>{F||a.fetchState!="Completed"||a.remiDetails?.reimbursementInfo.stage.code=="paid"||a.remiDetails?.reimbursementInfo.stage.code=="scheduled"||g.fetchState=="Completed"||g.fetchState=="In-Progress"||(A(!0),t(Ue(!1,T,R,c)),a.remiActivities[0]?.isRealTimeApprovalEnabled===!0&&t(Gt(!1,!0,!0,a.lastUpdatedByUserId)))}),[F,a,c,t]),m==null)throw Error("Can't access address page without signing in...");return a.remiDetails?.reimbursementInfo.stage.code=="draft"&&g.fetchState=="Completed"&&a.remiDetails.isDeleted===!1?s.jsx(_,{to:`./edit${n.search}`}):a.deleteStatus.fetchState==="In-Progress"||a.cancelAndDeleteStatus.fetchState==="In-Progress"||a.remiDetails?.reimbursementInfo.stage.code=="draft"&&g.fetchState!="Completed"||a.fetchState!="Completed"?s.jsx(Qe,{}):s.jsxs(s.Fragment,{children:[s.jsx(te,{analytics:k,onLoad:I=>(p=>{c!=null&&p.trackReimbursementReimbursementDetails(c)})(I)}),s.jsx(Qn,{initialOpenThreadRequest:l??void 0,scrollId:r,isReimbursementCommentingEnabled:v,isShowDeletedReimbursementEnabled:R,location:n,navigate:e,isRealTimeApprovalEnabled:j,currentTenant:o,reimbursementId:c??"",themeState:d,isAiCfoAccessEnabled:b,onAskAiCfoClick:y})]})}const Kn=Q((function(e,t){return{remisReviewView:Ne(e),analytics:t.analytics}}),(function(e,t){return{onCloseOverlay:()=>{t.navigate("./"),e(z())},onCloseReviewItem:n=>{e(Jt(n))},onProceedForBulkActionClick:(n,r)=>{switch(n){case"send_for_approval":e(Wt());break;case"approve":e(Ee("approved",r??""));break;case"reject":e(Ee("rejected",r??""))}}}}))(Bn);function Yn(){const e=J(),t=w((c=>c.remisBulkActionViewState.bulkSubmissionFetchState.fetchState)),{remisForReview:n}=w((c=>Ne(c))),r=ne(),d=r?.loggedInUserRole?.includes("admin")===!0;return f.useEffect((()=>{t!=="Completed"&&n.length!==0||e("./")}),[t,n.length]),s.jsx(Kn,{navigate:e,analytics:k,isAdmin:d})}const O=nn(),st="bulk-operation-update",ce="reimbursement-approval-rule-update",{spendManagement:Xn,common:De}=qe.getLocalizedStrings(),je=Xn.reimbursement.bulkActions,ea=N.div`
57
57
  display: flex;
58
58
  min-height: 100%;
59
59
  width: 100%;
@@ -61,8 +61,8 @@ import{j as s}from"./liveblocks-bqFl_SVp.js";import{h as q,u as de,g as V,i as Y
61
61
  flex-direction: column;
62
62
  align-items: center;
63
63
  background-color: ${e=>e.theme.colors.grey4};
64
- `,ta=Q((function(e,t){const n=ze(e,O,t.isBulkActionEnabled);let r=n.allSubTabs;const d=P.getSignedInUser(),c=be(d),m=e.tenantState.currentTenantId,o=H(e),a=o?.companyName??"",i={userId:d?.userId??"",sessionId:d?.zeniSessionId??"",tenantId:m??""},l=e.remiListState.downloadUIState.downloadState;t.isShowDeletedReimbursementEnabled===!1&&(r=r.filter((h=>h!=="deleted")));const b=n.fetchState,y=an(e);return{transactionList:t.isShowDeletedReimbursementEnabled?n.reimbursements:n.reimbursements.filter((h=>h.isDeleted===!1)),isAdmin:t.isAdmin,isZeniUser:c,isBillPayCommentingEnabled:t.isBillPayCommentingEnabled,isReimbursementCommentingEnabled:t.isReimbursementCommentingEnabled,allSubTabs:r,isEmployee:t.isEmployee,currentTab:n.currentTab,currentSubTab:n.currentSubTab,approvalCount:n.approvalCount,fetchState:b,botEmail:n.reimbursementBotEmail,analytics:k,uiState:n.uiState,searchText:n.searchText,filters:n.filters,downloadParams:{authParams:i,companyName:a,timePeriod:O,spendManagementEndPoint:`${Un}/spendManagement`,isShowDeletedBillsEnabled:t.isShowDeletedBillsEnabled,isShowDeletedReimbursementEnabled:t.isShowDeletedReimbursementEnabled},downloadState:l,isBulkActionAllowed:n.remiListBulkActionInfo?.isBulkActionAllowed,transactionsSelectedForBulkAction:n.remiListBulkActionInfo?.remisSelectedForBulkAction,allowedBulkActions:n.remiListBulkActionInfo?.allowedBulkActions,remiApprovalRulesAffectedEntityIds:y.affectedEntityIds}}),(function(e,t){const{navigate:n,currentTenant:r,location:d,period:c}=t,{tenantEmailDomain:m}=r;return{updateTabToState:o=>{e(z()),e(Ge(o))},onSubtabChange:o=>{e(z()),e(Oe(o))},onTransactionClick:(o,a)=>{const i=sa(m,o,a),l=Z(d.state?.pathnameStackToGoBack,d.pathname);n(i,{state:{pathnameStackToGoBack:l}})},onClickSetupIcon:()=>{const o=aa(m),a=Z(d.state?.pathnameStackToGoBack,d.pathname);n(o,{state:{pathnameStackToGoBack:a}})},onAddTransactionClick:()=>{const{tenantEmailDomain:o}=t.currentTenant;k?.trackReimbursementNewReimbursement();const a=`/${o}/reimbursement/new`,i=Z(t.location.state?.pathnameStackToGoBack,t.location.pathname);t.navigate(a,{state:{pathnameStackToGoBack:i}})},onColumnSortConfigChanged:(o,a)=>{e(un({uiState:{sortKey:o,sortOrder:a},period:t.period}))},onSearchTextChanged:o=>{e(dn(o))},onFiltersChange:o=>{e(cn({filters:o})),o.categories.every((a=>a.field!=null&&a.values?.length!==0))&&k.trackSpendManagmentFilterChange("reimbursement",o.categories.map((a=>`${a.field}-${JSON.stringify(a.values)}`)))},updateDownloadStateHandler:o=>{o==="In-Progress"&&k.trackSpendManagementDownloadClick("reimbursement"),e(mn({uiState:{downloadState:o}}))},onReloadTransactions:()=>{e(le(c,!0,t.isShowDeletedReimbursementEnabled,!1,!0))},onBackClick:()=>{n("../",{relative:"path"})},onNavigateToSettings:()=>{n("../reimbursements/setup")},updateBulkActionList:o=>{e(ln(o))},removeAllTransactionsFromBulkActionList:()=>{e(z())},onProceedForBulkActionClick:(o,a)=>{switch(o){case"delete":case"cancel":e(rn(o,a??""));break;case"send_for_approval":e(we("send_for_approval")),t.navigate("./bulk-review");break;case"review":e(we("approve")),t.navigate("./bulk-review")}},onReimbursementApprovalRulesEventReceived:o=>{o.endsWith(ce)&&e(on(!1))},onEventReceived:o=>{o===st&&e(sn())}}}))(Fn(Dn));function na(){const e=q(),t=de(),n=V(),r=n.state,d=qe(),[c,m]=f.useState(null),o=ct("/:tenantEmailDomain/reimbursements/bulk-review")!=null;f.useEffect((()=>{if(r?.tab!=null&&r?.subTab!=null){const S=Qt(r.tab.toString());S!=null?t(Ge(S)):console.log("Warning:Not a valid remiListTab");const G=Kt(r.subTab.toString());G!=null?t(Oe(G)):console.log("Warning:Not a valid remiListSubTab")}return()=>{t(z())}}),[]);const{useFeatureGate:a}=ee(),{isFeatureEnabled:i}=a(E.isShowDeletedBillsFeatureEnabled),{isFeatureEnabled:l}=a(E.isShowDeletedReimbursementsFeatureEnabled),{isFeatureEnabled:b}=a(E.isBillPayCommentingEnabled),{isFeatureEnabled:y}=a(E.isReimbursementCommentingEnabled),{isFeatureEnabled:h}=a(E.isReimbursementBulkActionEnabled),T=P.getSignedInUser(),u=w((S=>H(S))),[x,j]=f.useState(!1),[v,D]=f.useState(!1),B=ne(),A=B?.loggedInUserRole?.includes("admin")===!0,R=w((S=>ze(S,O,h))),{areTenantIdsInSync:g}=Tn(),U=R.fetchState,{isAiCfoAccessEnabled:L,onAskAiCfoClick:$}=Se({mobileExploreReferrer:"Reimbursement List"});if(Je({isDataReady:U==="Completed"}),f.useEffect((()=>{!v&&g&&(D(!0),t(le(O,!0,l,!1,!0)))}),[v,O,t,g]),T==null)throw Error("Can't access address page without signing in...");const I=!!u?.userRole&&Jt(u),p=ge(B?.loggedInUserRoleMap),W=he(B?.loggedInUserRoleMap),ae=!!u.userReimbursementInfo?.isReimbursementTOSAccepted,K=!!u.companyReimbursementInfo?.info?.isReimbursementEnabled,se=!!u.companyReimbursementInfo?.info?.isReimbursementTOSAccepted,ie=w((S=>Le(S.companyState,u.companyId))),it=ie?.company.featuresActivationInfo.connectedAccountProvider,Re=S=>{j(S)},{isFeatureEnabled:ot}=a(E.isDebitCardFeatureEnabled),rt=Ze(ot,u),lt=Ve(u),{remisProcessed:J,remisProcessing:Ie}=w((S=>Xt(S)));f.useEffect((()=>{J===Ie&&c!=null&&(t(Yt({messageSection:"reimbursement_bulk_processed",messageText:"success",type:"success",showStatusIcon:!0,variables:[{variableName:"_report_",variableValue:J>1?De.reports:De.report},{variableName:"_has_",variableValue:J>1?Fe.texts.have:Fe.texts.has},{variableName:"_action_",variableValue:en(c)}]})),t(tn()),setTimeout((()=>{t(le(O,!0,l,!1,!0,!0))}),3e3),m(null))}),[J,Ie]);const mt={events:u.companyId!=null?[`private-encrypted-${u.companyId}.${st}`,`private-encrypted-${u.companyId}.${ce}`]:[],eventCallback:(S,G,ye)=>{S.endsWith(ce)?ye.onReimbursementApprovalRulesEventReceived?.(S):G.entity_type==="reimbursement"&&(m(G.operation_type),ye.onEventReceived(S))}};return n.pathname.endsWith("/reimbursements/")||n.pathname.endsWith("/reimbursements")||n.pathname.endsWith("/reimbursements/bulk-review")?rt===!0||lt===!0?s.jsx(et,{}):K&&(!I||p)||W&&ae?s.jsxs(s.Fragment,{children:[U==="Completed"?s.jsx(te,{analytics:k,onLoad:S=>(G=>G.trackPageLoaded(Xe.Event.reimbursementHome))(S)}):null,s.jsx(nt,{isAppContentDrawerOpen:x,handleDrawerToggle:Re}),s.jsxs(ea,{windowSize:d,children:[s.jsx(Mn,{isOpen:o,drawerLeftMargin:new jn(0,0,300,600),onClose:()=>{e("./"),t(z())},children:s.jsx(ia,{onClick:S=>S.stopPropagation(),children:s.jsx(Xn,{})})}),s.jsx(ta,{isShowDeletedBillsEnabled:i,isShowDeletedReimbursementEnabled:l,isBillPayCommentingEnabled:b,isReimbursementCommentingEnabled:y,location:n,navigate:e,currentTenant:u,period:O,isAdmin:A,isEmployee:I,entity:"reimbursement",onClickMenuIcon:()=>{Re(!0)},createdByUserList:R.createdByUserList,createdByUserListFetchState:R.createdByUserListFetchState,isDownloadEnabled:R.isDownloadEnabled,connectedAccountProvider:it,isBulkActionEnabled:h,bulkSubmissionLimit:R.remiBulkSubmissionLimit,bulkSubmissionFetchState:R.remiListBulkActionInfo.bulkSubmissionFetchState,isAiCfoAccessEnabled:L,onAskAiCfoClick:$,...mt})]})]}):se&&p?s.jsx(_,{to:"../setup"}):B!=null&&He(u,B.loggedInUserRoleMap)?s.jsx(_,{to:"../promo"}):s.jsx(fe,{fetchState:"In-Progress"}):s.jsx(me,{})}const aa=e=>`/${e}/reimbursements/setup`,sa=(e,t,n)=>{let r=`/${e}/reimbursement/${encodeURIComponent(t)}`;return n=="draft"&&(r+="/edit"),r},ia=N($n)`
64
+ `,ta=Q((function(e,t){const n=ze(e,O,t.isBulkActionEnabled);let r=n.allSubTabs;const d=P.getSignedInUser(),c=be(d),m=e.tenantState.currentTenantId,o=V(e),a=o?.companyName??"",i={userId:d?.userId??"",sessionId:d?.zeniSessionId??"",tenantId:m??""},l=e.remiListState.downloadUIState.downloadState;t.isShowDeletedReimbursementEnabled===!1&&(r=r.filter((h=>h!=="deleted")));const b=n.fetchState,y=an(e);return{transactionList:t.isShowDeletedReimbursementEnabled?n.reimbursements:n.reimbursements.filter((h=>h.isDeleted===!1)),isAdmin:t.isAdmin,isZeniUser:c,isBillPayCommentingEnabled:t.isBillPayCommentingEnabled,isReimbursementCommentingEnabled:t.isReimbursementCommentingEnabled,allSubTabs:r,isEmployee:t.isEmployee,currentTab:n.currentTab,currentSubTab:n.currentSubTab,approvalCount:n.approvalCount,fetchState:b,botEmail:n.reimbursementBotEmail,analytics:k,uiState:n.uiState,searchText:n.searchText,filters:n.filters,downloadParams:{authParams:i,companyName:a,timePeriod:O,spendManagementEndPoint:`${Un}/spendManagement`,isShowDeletedBillsEnabled:t.isShowDeletedBillsEnabled,isShowDeletedReimbursementEnabled:t.isShowDeletedReimbursementEnabled},downloadState:l,isBulkActionAllowed:n.remiListBulkActionInfo?.isBulkActionAllowed,transactionsSelectedForBulkAction:n.remiListBulkActionInfo?.remisSelectedForBulkAction,allowedBulkActions:n.remiListBulkActionInfo?.allowedBulkActions,remiApprovalRulesAffectedEntityIds:y.affectedEntityIds}}),(function(e,t){const{navigate:n,currentTenant:r,location:d,period:c}=t,{tenantEmailDomain:m}=r;return{updateTabToState:o=>{e(z()),e(Ge(o))},onSubtabChange:o=>{e(z()),e(Oe(o))},onTransactionClick:(o,a)=>{const i=sa(m,o,a),l=Z(d.state?.pathnameStackToGoBack,d.pathname);n(i,{state:{pathnameStackToGoBack:l}})},onClickSetupIcon:()=>{const o=aa(m),a=Z(d.state?.pathnameStackToGoBack,d.pathname);n(o,{state:{pathnameStackToGoBack:a}})},onAddTransactionClick:()=>{const{tenantEmailDomain:o}=t.currentTenant;k?.trackReimbursementNewReimbursement();const a=`/${o}/reimbursement/new`,i=Z(t.location.state?.pathnameStackToGoBack,t.location.pathname);t.navigate(a,{state:{pathnameStackToGoBack:i}})},onColumnSortConfigChanged:(o,a)=>{e(un({uiState:{sortKey:o,sortOrder:a},period:t.period}))},onSearchTextChanged:o=>{e(dn(o))},onFiltersChange:o=>{e(cn({filters:o})),o.categories.every((a=>a.field!=null&&a.values?.length!==0))&&k.trackSpendManagmentFilterChange("reimbursement",o.categories.map((a=>`${a.field}-${JSON.stringify(a.values)}`)))},updateDownloadStateHandler:o=>{o==="In-Progress"&&k.trackSpendManagementDownloadClick("reimbursement"),e(mn({uiState:{downloadState:o}}))},onReloadTransactions:()=>{e(le(c,!0,t.isShowDeletedReimbursementEnabled,!1,!0))},onBackClick:()=>{n("../",{relative:"path"})},onNavigateToSettings:()=>{n("../reimbursements/setup")},updateBulkActionList:o=>{e(ln(o))},removeAllTransactionsFromBulkActionList:()=>{e(z())},onProceedForBulkActionClick:(o,a)=>{switch(o){case"delete":case"cancel":e(rn(o,a??""));break;case"send_for_approval":e(we("send_for_approval")),t.navigate("./bulk-review");break;case"review":e(we("approve")),t.navigate("./bulk-review")}},onReimbursementApprovalRulesEventReceived:o=>{o.endsWith(ce)&&e(on(!1))},onEventReceived:o=>{o===st&&e(sn())}}}))(Dn(jn));function na(){const e=J(),t=de(),n=H(),r=n.state,d=Je(),[c,m]=f.useState(null),o=ct("/:tenantEmailDomain/reimbursements/bulk-review")!=null;f.useEffect((()=>{if(r?.tab!=null&&r?.subTab!=null){const S=Qt(r.tab.toString());S!=null?t(Ge(S)):console.log("Warning:Not a valid remiListTab");const G=qt(r.subTab.toString());G!=null?t(Oe(G)):console.log("Warning:Not a valid remiListSubTab")}return()=>{t(z())}}),[]);const{useFeatureGate:a}=ee(),{isFeatureEnabled:i}=a(E.isShowDeletedBillsFeatureEnabled),{isFeatureEnabled:l}=a(E.isShowDeletedReimbursementsFeatureEnabled),{isFeatureEnabled:b}=a(E.isBillPayCommentingEnabled),{isFeatureEnabled:y}=a(E.isReimbursementCommentingEnabled),{isFeatureEnabled:h}=a(E.isReimbursementBulkActionEnabled),T=P.getSignedInUser(),u=w((S=>V(S))),[x,F]=f.useState(!1),[A,j]=f.useState(!1),B=ne(),v=B?.loggedInUserRole?.includes("admin")===!0,R=w((S=>ze(S,O,h))),{areTenantIdsInSync:g}=Tn(),U=R.fetchState,{isAiCfoAccessEnabled:L,onAskAiCfoClick:$}=Se({mobileExploreReferrer:"Reimbursement List"});if(Ke({isDataReady:U==="Completed"}),f.useEffect((()=>{!A&&g&&(j(!0),t(le(O,!0,l,!1,!0)))}),[A,O,t,g]),T==null)throw Error("Can't access address page without signing in...");const I=!!u?.userRole&&Kt(u),p=ge(B?.loggedInUserRoleMap),W=he(B?.loggedInUserRoleMap),ae=!!u.userReimbursementInfo?.isReimbursementTOSAccepted,q=!!u.companyReimbursementInfo?.info?.isReimbursementEnabled,se=!!u.companyReimbursementInfo?.info?.isReimbursementTOSAccepted,ie=w((S=>Le(S.companyState,u.companyId))),it=ie?.company.featuresActivationInfo.connectedAccountProvider,Re=S=>{F(S)},{isFeatureEnabled:ot}=a(E.isDebitCardFeatureEnabled),rt=Ze(ot,u),lt=He(u),{remisProcessed:K,remisProcessing:Ie}=w((S=>Yt(S)));f.useEffect((()=>{K===Ie&&c!=null&&(t(Xt({messageSection:"reimbursement_bulk_processed",messageText:"success",type:"success",showStatusIcon:!0,variables:[{variableName:"_report_",variableValue:K>1?je.reports:je.report},{variableName:"_has_",variableValue:K>1?De.texts.have:De.texts.has},{variableName:"_action_",variableValue:en(c)}]})),t(tn()),setTimeout((()=>{t(le(O,!0,l,!1,!0,!0))}),3e3),m(null))}),[K,Ie]);const mt={events:u.companyId!=null?[`private-encrypted-${u.companyId}.${st}`,`private-encrypted-${u.companyId}.${ce}`]:[],eventCallback:(S,G,ye)=>{S.endsWith(ce)?ye.onReimbursementApprovalRulesEventReceived?.(S):G.entity_type==="reimbursement"&&(m(G.operation_type),ye.onEventReceived(S))}};return n.pathname.endsWith("/reimbursements/")||n.pathname.endsWith("/reimbursements")||n.pathname.endsWith("/reimbursements/bulk-review")?rt===!0||lt===!0?s.jsx(et,{}):q&&(!I||p)||W&&ae?s.jsxs(s.Fragment,{children:[U==="Completed"?s.jsx(te,{analytics:k,onLoad:S=>(G=>G.trackPageLoaded(Ye.Event.reimbursementHome))(S)}):null,s.jsx(nt,{isAppContentDrawerOpen:x,handleDrawerToggle:Re}),s.jsxs(ea,{windowSize:d,children:[s.jsx(Mn,{isOpen:o,drawerLeftMargin:new Fn(0,0,300,600),onClose:()=>{e("./"),t(z())},children:s.jsx(ia,{onClick:S=>S.stopPropagation(),children:s.jsx(Yn,{})})}),s.jsx(ta,{isShowDeletedBillsEnabled:i,isShowDeletedReimbursementEnabled:l,isBillPayCommentingEnabled:b,isReimbursementCommentingEnabled:y,location:n,navigate:e,currentTenant:u,period:O,isAdmin:v,isEmployee:I,entity:"reimbursement",onClickMenuIcon:()=>{Re(!0)},createdByUserList:R.createdByUserList,createdByUserListFetchState:R.createdByUserListFetchState,isDownloadEnabled:R.isDownloadEnabled,connectedAccountProvider:it,isBulkActionEnabled:h,bulkSubmissionLimit:R.remiBulkSubmissionLimit,bulkSubmissionFetchState:R.remiListBulkActionInfo.bulkSubmissionFetchState,isAiCfoAccessEnabled:L,onAskAiCfoClick:$,...mt})]})]}):se&&p?s.jsx(_,{to:"../setup"}):B!=null&&Ve(u,B.loggedInUserRoleMap)?s.jsx(_,{to:"../promo"}):s.jsx(fe,{fetchState:"In-Progress"}):s.jsx(me,{})}const aa=e=>`/${e}/reimbursements/setup`,sa=(e,t,n)=>{let r=`/${e}/reimbursement/${encodeURIComponent(t)}`;return n=="draft"&&(r+="/edit"),r},ia=N($n)`
65
65
  display: flex;
66
66
  min-height: 100%;
67
67
  flex-direction: column;
68
- `,oa=Q((function(e,t){const{companyId:n}=t;return{reimbursementSetupView:pn(e,n),analytics:k,meetingUrl:"https://meetings.hubspot.com/niharn/demo-reimbursements?embed=true",videoUrl:"https://player.vimeo.com/video/814821498?h=e7fd11e13e&badge=0&autopause=0&player_id=0&app_id=122963"}}),(function(e,t){const{companyId:n,navigate:r}=t;return{onSetupButtonClick:()=>{e(gn(n))},onCreateNewRemiButtonClick:()=>{e(bn(t.userRoleId))},onBackClick:()=>{r("../..",{relative:"path"})},onSetupReimbursementSuccess:()=>{t.isEmployee?r("../../reimbursement/new",{relative:"path"}):r("../reimbursements/setup",{relative:"path"})}}}))(Ln),ra=()=>{const e=q(),t=V(),{tenantEmailDomain:n}=Y(),r=Ye(),[d,c]=f.useState(!1),m=w((v=>H(v))),o=P.getSignedInUserTenant(n)?.companyId??m.companyId,a=P.getSignedInUser(),i=m.userRoleId,l=!!m.userRole?.includes("reimbursements_user"),b=ne(),y=ge(b?.loggedInUserRoleMap),h=he(b?.loggedInUserRoleMap),T=!!m.userReimbursementInfo?.isReimbursementTOSAccepted,u=!!m.companyReimbursementInfo?.info?.isReimbursementEnabled,x=!!m.companyReimbursementInfo?.info?.isReimbursementTOSAccepted,j=v=>{c(v)};if(a==null)throw Error("Can't access reimbursement promo page without signing in...");return u&&h&&T?s.jsx(_,{to:"../../../reimbursements"}):x&&y?s.jsx(_,{to:"../../reimbursements/setup"}):m.companyReimbursementInfo&&!x||m.userReimbursementInfo&&h&&T===!1?s.jsxs(s.Fragment,{children:[s.jsx(te,{analytics:k,onLoad:v=>(D=>D.trackPageLoaded(Xe.Event.reimbursementPromoPage))(v)}),s.jsx(nt,{isAppContentDrawerOpen:d,handleDrawerToggle:j}),s.jsx(oa,{companyId:o,navigate:e,location:t,userReimbursementInfo:m.userReimbursementInfo,userRoleId:i,isEmployee:l,onClickMenuIcon:()=>{j(!0)}})]}):s.jsx(fe,{fetchState:"In-Progress",style:{backgroundColor:r.colors.grey5}})};function $a(){const e=w((ie=>H(ie))),t=ne(),n=!!e.company?.companyReimbursementInfo.isReimbursementEnabled,r=Ye(),d=!!e.company?.companyReimbursementInfo.isReimbursementTOSAccepted,c=!!e.userReimbursementInfo?.isReimbursementTOSAccepted,{useFeatureGate:m}=ee(),{isFeatureEnabled:o}=m(E.isChargeCardFeatureEnabled),{isFeatureEnabled:a}=m(E.isDebitCardFeatureEnabled),i=Ze(a,e),l=Ve(e),b=e?.userRole!=null&&hn(e?.userRole),y=(e?.company==null||e.company.featuresActivationInfo?.isBillPayFeatureEnabled&&!b)&&fn(t?.loggedInUserRoleMap),h=Sn(t?.loggedInUserRoleMap),T=e?.company==null||e.company.featuresActivationInfo?.isReimbursementFeatureEnabled&&!b,u=ge(t?.loggedInUserRoleMap),x=T&&u,j=!!e.company?.companyZeniAccountInfo?.isZeniAccountEnabled&&!b,v=j&&Rn(t?.loggedInUserRoleMap),D=Pn(e,o,a)&&!b,B=D&&In(t?.loggedInUserRoleMap),A=yn(t?.loggedInUserRoleMap),R=vn(t?.loggedInUserRoleMap),g=kn(t?.loggedInUserRoleMap),U=j&&R,L=e.companyTreasuryInfo?.info?.businessVerificationStatus?.code==="verified"&&!b&&g,$=An(t?.loggedInUserRoleMap),I=Cn(t?.loggedInUserRoleMap),p=he(t?.loggedInUserRoleMap),W=D&&$,{tenantEmailDomain:ae}=Y(),K=V(),se=n===!0&&(u||p&&c);return s.jsxs(dt,{children:[K.pathname.includes("/reimbursements")?s.jsxs(s.Fragment,{children:[s.jsx(C,{path:"verification",element:s.jsx(Be,{isBillPayAdminLevelAccess:y,isUserHasOnlyBillPayAccess:h,isReimbursementAdminLevelAccess:x,isZeniAccountAdminLevelAccess:v,isChargeCardAdminLevelAccess:B,isUserHasOnlyCardAccess:A,productType:"reimbursement",type:"verification"})}),s.jsx(C,{path:"setup",element:s.jsx(Be,{isBillPayAdminLevelAccess:y,isUserHasOnlyBillPayAccess:h,isReimbursementAdminLevelAccess:x,isZeniAccountAdminLevelAccess:v,isChargeCardAdminLevelAccess:B,isUserHasOnlyCardAccess:A,productType:"reimbursement",type:"setup"})}),s.jsx(C,{path:"promo",element:s.jsx(ra,{})}),s.jsx(C,{path:"approval-rules/*",element:x?s.jsx(_n,{}):s.jsx(Nn,{showZeniAccountRoute:U,isUserHasBillPayAccess:I,isUserHasReimbursementAccess:p,showTreasuryRoute:L,isTenantBankingOnly:i,showChargeCardRoute:W,tenantEmailDomain:ae??""})}),se&&s.jsx(C,{path:"*",element:s.jsx(na,{})}),(i===!0||l===!0)&&s.jsx(C,{path:"/*",element:s.jsx(et,{})}),t!=null&&He(e,t?.loggedInUserRoleMap)&&s.jsx(C,{path:"*",element:s.jsx(_,{to:"../promo"})}),d&&u&&s.jsx(C,{path:"*",element:s.jsx(_,{to:"../setup"})})]}):K.pathname.includes("/reimbursement")?s.jsxs(s.Fragment,{children:[s.jsx(C,{path:"new",element:s.jsx(je,{})}),s.jsx(C,{path:":reimbursementId",element:s.jsx(Kn,{})}),s.jsx(C,{path:":reimbursementId/edit",element:s.jsx(je,{})}),s.jsx(C,{path:"*",element:s.jsx(me,{})})]}):s.jsx(C,{path:"*",element:s.jsx(fe,{fetchState:"In-Progress",style:{backgroundColor:r.colors.grey5,boxShadow:`0px 2px ${F.sp1} ${r.colors.dropShadowNormal}`}})}),s.jsx(C,{path:"*",element:s.jsx(me,{})})]})}export{$a as default};
68
+ `,oa=Q((function(e,t){const{companyId:n}=t;return{reimbursementSetupView:pn(e,n),analytics:k,meetingUrl:"https://meetings.hubspot.com/niharn/demo-reimbursements?embed=true",videoUrl:"https://player.vimeo.com/video/814821498?h=e7fd11e13e&badge=0&autopause=0&player_id=0&app_id=122963"}}),(function(e,t){const{companyId:n,navigate:r}=t;return{onSetupButtonClick:()=>{e(gn(n))},onCreateNewRemiButtonClick:()=>{e(bn(t.userRoleId))},onBackClick:()=>{r("../..",{relative:"path"})},onSetupReimbursementSuccess:()=>{t.isEmployee?r("../../reimbursement/new",{relative:"path"}):r("../reimbursements/setup",{relative:"path"})}}}))(Ln),ra=()=>{const e=J(),t=H(),{tenantEmailDomain:n}=X(),r=Xe(),[d,c]=f.useState(!1),m=w((A=>V(A))),o=P.getSignedInUserTenant(n)?.companyId??m.companyId,a=P.getSignedInUser(),i=m.userRoleId,l=!!m.userRole?.includes("reimbursements_user"),b=ne(),y=ge(b?.loggedInUserRoleMap),h=he(b?.loggedInUserRoleMap),T=!!m.userReimbursementInfo?.isReimbursementTOSAccepted,u=!!m.companyReimbursementInfo?.info?.isReimbursementEnabled,x=!!m.companyReimbursementInfo?.info?.isReimbursementTOSAccepted,F=A=>{c(A)};if(a==null)throw Error("Can't access reimbursement promo page without signing in...");return u&&h&&T?s.jsx(_,{to:"../../../reimbursements"}):x&&y?s.jsx(_,{to:"../../reimbursements/setup"}):m.companyReimbursementInfo&&!x||m.userReimbursementInfo&&h&&T===!1?s.jsxs(s.Fragment,{children:[s.jsx(te,{analytics:k,onLoad:A=>(j=>j.trackPageLoaded(Ye.Event.reimbursementPromoPage))(A)}),s.jsx(nt,{isAppContentDrawerOpen:d,handleDrawerToggle:F}),s.jsx(oa,{companyId:o,navigate:e,location:t,userReimbursementInfo:m.userReimbursementInfo,userRoleId:i,isEmployee:l,onClickMenuIcon:()=>{F(!0)}})]}):s.jsx(fe,{fetchState:"In-Progress",style:{backgroundColor:r.colors.grey5}})};function $a(){const e=w((ie=>V(ie))),t=ne(),n=!!e.company?.companyReimbursementInfo.isReimbursementEnabled,r=Xe(),d=!!e.company?.companyReimbursementInfo.isReimbursementTOSAccepted,c=!!e.userReimbursementInfo?.isReimbursementTOSAccepted,{useFeatureGate:m}=ee(),{isFeatureEnabled:o}=m(E.isChargeCardFeatureEnabled),{isFeatureEnabled:a}=m(E.isDebitCardFeatureEnabled),i=Ze(a,e),l=He(e),b=e?.userRole!=null&&hn(e?.userRole),y=(e?.company==null||e.company.featuresActivationInfo?.isBillPayFeatureEnabled&&!b)&&fn(t?.loggedInUserRoleMap),h=Sn(t?.loggedInUserRoleMap),T=e?.company==null||e.company.featuresActivationInfo?.isReimbursementFeatureEnabled&&!b,u=ge(t?.loggedInUserRoleMap),x=T&&u,F=!!e.company?.companyZeniAccountInfo?.isZeniAccountEnabled&&!b,A=F&&Rn(t?.loggedInUserRoleMap),j=Pn(e,o,a)&&!b,B=j&&In(t?.loggedInUserRoleMap),v=yn(t?.loggedInUserRoleMap),R=An(t?.loggedInUserRoleMap),g=kn(t?.loggedInUserRoleMap),U=F&&R,L=e.companyTreasuryInfo?.info?.businessVerificationStatus?.code==="verified"&&!b&&g,$=vn(t?.loggedInUserRoleMap),I=Cn(t?.loggedInUserRoleMap),p=he(t?.loggedInUserRoleMap),W=j&&$,{tenantEmailDomain:ae}=X(),q=H(),se=n===!0&&(u||p&&c);return s.jsxs(dt,{children:[q.pathname.includes("/reimbursements")?s.jsxs(s.Fragment,{children:[s.jsx(C,{path:"verification",element:s.jsx(Be,{isBillPayAdminLevelAccess:y,isUserHasOnlyBillPayAccess:h,isReimbursementAdminLevelAccess:x,isZeniAccountAdminLevelAccess:A,isChargeCardAdminLevelAccess:B,isUserHasOnlyCardAccess:v,productType:"reimbursement",type:"verification"})}),s.jsx(C,{path:"setup",element:s.jsx(Be,{isBillPayAdminLevelAccess:y,isUserHasOnlyBillPayAccess:h,isReimbursementAdminLevelAccess:x,isZeniAccountAdminLevelAccess:A,isChargeCardAdminLevelAccess:B,isUserHasOnlyCardAccess:v,productType:"reimbursement",type:"setup"})}),s.jsx(C,{path:"promo",element:s.jsx(ra,{})}),s.jsx(C,{path:"approval-rules/*",element:x?s.jsx(_n,{}):s.jsx(Nn,{showZeniAccountRoute:U,isUserHasBillPayAccess:I,isUserHasReimbursementAccess:p,showTreasuryRoute:L,isTenantBankingOnly:i,showChargeCardRoute:W,tenantEmailDomain:ae??""})}),se&&s.jsx(C,{path:"*",element:s.jsx(na,{})}),(i===!0||l===!0)&&s.jsx(C,{path:"/*",element:s.jsx(et,{})}),t!=null&&Ve(e,t?.loggedInUserRoleMap)&&s.jsx(C,{path:"*",element:s.jsx(_,{to:"../promo"})}),d&&u&&s.jsx(C,{path:"*",element:s.jsx(_,{to:"../setup"})})]}):q.pathname.includes("/reimbursement")?s.jsxs(s.Fragment,{children:[s.jsx(C,{path:"new",element:s.jsx(Fe,{})}),s.jsx(C,{path:":reimbursementId",element:s.jsx(qn,{})}),s.jsx(C,{path:":reimbursementId/edit",element:s.jsx(Fe,{})}),s.jsx(C,{path:"*",element:s.jsx(me,{})})]}):s.jsx(C,{path:"*",element:s.jsx(fe,{fetchState:"In-Progress",style:{backgroundColor:r.colors.grey5,boxShadow:`0px 2px ${D.sp1} ${r.colors.dropShadowNormal}`}})}),s.jsx(C,{path:"*",element:s.jsx(me,{})})]})}export{$a as default};