@zeniai/web-app-ui 5.1.55-qa → 5.1.56-qa

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (129) hide show
  1. package/dist/assets/AddressRoutes-DsuoPslx.js +1 -0
  2. package/dist/assets/{AddressScreen-CvPxhYFs.js → AddressScreen-Jgfq0eWZ.js} +2 -2
  3. package/dist/assets/{AiCfoScreen-DTTgGSqT.js → AiCfoScreen-ngmwmSfT.js} +2 -2
  4. package/dist/assets/{BillPayApprovalRoutes-2y_Smb3L.js → BillPayApprovalRoutes-DjjjDtRL.js} +1 -1
  5. package/dist/assets/{BillPayRoutes-D1KmPs-P.js → BillPayRoutes-zXfejo42.js} +9 -9
  6. package/dist/assets/BusinessVerificationPageScreen-BiV9G1-i.js +9 -0
  7. package/dist/assets/CardsAiCfoScreen-Z2PndTe3.js +14 -0
  8. package/dist/assets/{ChargeCardRoutes-YoDH7ylN.js → ChargeCardRoutes-CBFlKgnf.js} +12 -12
  9. package/dist/assets/{CompanyPassportScreen-CfrYFFuL.js → CompanyPassportScreen-CE4f1mRO.js} +1 -1
  10. package/dist/assets/ConnectionAuthScreen-BFW2NVDD.js +11 -0
  11. package/dist/assets/CustomerOnboardingAuthScreen-DZoaiMvV.js +1 -0
  12. package/dist/assets/{CustomerOnboardingRoutes-BAxjCtaH.js → CustomerOnboardingRoutes-Doltk1XW.js} +4 -4
  13. package/dist/assets/{DashboardRoutes-Cnv2Os-7.js → DashboardRoutes-YclW7oS0.js} +3 -3
  14. package/dist/assets/{DefaultTenantHome-D1mjvDxR.js → DefaultTenantHome-cEuyRwZp.js} +1 -1
  15. package/dist/assets/DomesticWireDetailScreen-3X6dnm4U.js +18 -0
  16. package/dist/assets/DrawerScreen-DcUdH_zJ.js +1 -0
  17. package/dist/assets/EntityDetailRoutes-D020FlPl.js +1 -0
  18. package/dist/assets/{ExpenseAutomationRoutes-UMX9R2ZB.js → ExpenseAutomationRoutes-CTZlVWwO.js} +4 -4
  19. package/dist/assets/FeaturePreviewScreen-DgqstYkZ.js +1 -0
  20. package/dist/assets/HubSpotOAuthCallbackScreen-DlnwVV1p.js +1 -0
  21. package/dist/assets/MagicLinkRoutes-C901TSTh.js +72 -0
  22. package/dist/assets/MagicLinkSignInScreen-DFljjGc3.js +12 -0
  23. package/dist/assets/MobileAppDrawer-B4f1me8_.js +1 -0
  24. package/dist/assets/NotFoundScreen-CxRYls3k.js +1 -0
  25. package/dist/assets/NotificationRoutes-Dw__n9YA.js +1 -0
  26. package/dist/assets/OAuthConsentScreen-Ur-mQS8z.js +1 -0
  27. package/dist/assets/PandLWithForecastRoutes-DSq1hcWm.js +1 -0
  28. package/dist/assets/{PeopleRoutes-DwtjCeU9.js → PeopleRoutes-CUtLjfXT.js} +3 -3
  29. package/dist/assets/PerformanceRoutes-D4zDazyB.js +1 -0
  30. package/dist/assets/{Preview-JiizEL_C.js → Preview-f2ns8xny.js} +1 -1
  31. package/dist/assets/{QBOConnectionScreen-BD3gRv9C.js → QBOConnectionScreen-CSgGZuyl.js} +1 -1
  32. package/dist/assets/{ReferralListScreen-DPPvxoTI.js → ReferralListScreen-CbCeYBu8.js} +2 -2
  33. package/dist/assets/ReimbursementApprovalRoutes-CQrzmhSh.js +1 -0
  34. package/dist/assets/{ReimbursementApprovalRuleDetailScreen-CcTmDK2L.js → ReimbursementApprovalRuleDetailScreen-DTZkQzQY.js} +1 -1
  35. package/dist/assets/{ReimbursementRoutes-DHjMtvfB.js → ReimbursementRoutes-CzlU6LYx.js} +7 -7
  36. package/dist/assets/{ReportsRoutes-B4rkl99K.js → ReportsRoutes-D_wjWb18.js} +1 -1
  37. package/dist/assets/RewardsRoutes-Bfg59urI.js +1 -0
  38. package/dist/assets/ScreenRoutes-D5k4uqAt.js +2 -0
  39. package/dist/assets/{SettingsRoutes-Bvbg8LVY.js → SettingsRoutes-3hV9qN1I.js} +7 -7
  40. package/dist/assets/{SetupPagesScreen-N7NZbMog.js → SetupPagesScreen-CPey4cOW.js} +5 -5
  41. package/dist/assets/SignInScreen-gQzAHzdj.js +1 -0
  42. package/dist/assets/SignOutScreen-GvUCBNk6.js +9 -0
  43. package/dist/assets/{TaskListScreen-DNjQxRsg.js → TaskListScreen-Cuce7GNl.js} +2 -2
  44. package/dist/assets/TaskRoutes-DmGo1lNA.js +9 -0
  45. package/dist/assets/{TransactionDetailRoutes-9wsPGvQA.js → TransactionDetailRoutes-CgKCf_lf.js} +1 -1
  46. package/dist/assets/{TransactionDetailScreen-DdyjxpNe.js → TransactionDetailScreen-CoGsdLTa.js} +2 -2
  47. package/dist/assets/{TransactionListRoutes-Y3HUjCX4.js → TransactionListRoutes-C4QYqCpP.js} +1 -1
  48. package/dist/assets/{TreasuryRoutes-Po66nW-G.js → TreasuryRoutes-jiXgJCAb.js} +5 -5
  49. package/dist/assets/{VendorsRoutes-Bhe46MLu.js → VendorsRoutes-BZFmR2hI.js} +14 -14
  50. package/dist/assets/WiseConfirmationScreen-BLK_tJR5.js +12 -0
  51. package/dist/assets/{ZeniAccountRoutes-BVrcLxAX.js → ZeniAccountRoutes-DVnj5-p6.js} +13 -13
  52. package/dist/assets/ZeniAccountStatementScreen-3bZVHWI7.js +9 -0
  53. package/dist/assets/{accountMappingHelper-BfrLGhoG.js → accountMappingHelper-DS9ya8eF.js} +1 -1
  54. package/dist/assets/{analytics-CQmVOD4d.js → analytics-BLbM2ksu.js} +1 -1
  55. package/dist/assets/{analyticsHelper-Bvqx3iRr.js → analyticsHelper-BU5wlVa9.js} +1 -1
  56. package/dist/assets/{core-CbpoBsNm.js → core-OMb8nkC1.js} +1 -1
  57. package/dist/assets/{decodeURIComponentSafe-9Mzf3G8U.js → decodeURIComponentSafe-CrZYJ6cg.js} +1 -1
  58. package/dist/assets/{dnd-CX5suNP6.js → dnd-DVcQZAG5.js} +1 -1
  59. package/dist/assets/{empty-DhAifQ6-.js → empty-BACf_dXg.js} +1 -1
  60. package/dist/assets/{empty-BijKctOw.js → empty-CyDTyMxd.js} +1 -1
  61. package/dist/assets/{emptyVideoElement-D-mIIbkx.js → emptyVideoElement-wUn7k4Wi.js} +1 -1
  62. package/dist/assets/{epic-D_RLnD_Y.js → epic-C0I2MvV5.js} +1 -1
  63. package/dist/assets/getLocaleForTenant-Bn16hOPH.js +1 -0
  64. package/dist/assets/{index-B781xFYL.js → index-5gq8gNHx.js} +2 -2
  65. package/dist/assets/{index-Mdt1gUpR.js → index-BNIZfLgU.js} +1 -1
  66. package/dist/assets/{index-Bg6fgf4p.js → index-BQIzm-tN.js} +1 -1
  67. package/dist/assets/{index-D-GsKzyX.js → index-CPre97x9.js} +1 -1
  68. package/dist/assets/{index-CR_Xz42r.js → index-CVJX5WNC.js} +1 -1
  69. package/dist/assets/{index-CTRa-Eva.js → index-DmsNrKhC.js} +1 -1
  70. package/dist/assets/{index-aZImxzjX.js → index-NcZU0lXl.js} +7454 -7454
  71. package/dist/assets/{index-cXBO33fb.js → index-SfOqAjbR.js} +1 -1
  72. package/dist/assets/{lexical-BS7d_1CV.js → lexical-CNfNgAkp.js} +1 -1
  73. package/dist/assets/{liveblocks-BLlSTcoD.js → liveblocks-BUQfB0Zp.js} +1 -1
  74. package/dist/assets/{lottie-BY8e0Ufw.js → lottie-DDI83OWz.js} +1 -1
  75. package/dist/assets/{mui-DcNGd9L2.js → mui-JZY-3hhJ.js} +1 -1
  76. package/dist/assets/{pathToGoBack-C2QnAeVh.js → pathToGoBack-iJW8VSI1.js} +1 -1
  77. package/dist/assets/{pdf-BslZhgI8.js → pdf-6FZlivdz.js} +4 -4
  78. package/dist/assets/{pdf-lib-BxiXr152.js → pdf-lib-CtBKoWQc.js} +1 -1
  79. package/dist/assets/{plaid-B62punae.js → plaid-B_OuebQv.js} +1 -1
  80. package/dist/assets/{pusher-yI34WBaU.js → pusher-BqrLLY7v.js} +1 -1
  81. package/dist/assets/{react-bALoVfnT.js → react-BVW_zt6p.js} +1 -1
  82. package/dist/assets/{react-BhNVTcBK.js → react-Crq75Q-S.js} +1 -1
  83. package/dist/assets/{react-D4d29E8H.js → react-D-VI0x0-.js} +1 -1
  84. package/dist/assets/{react-Bxt57-xI.js → react-PG_EpTGq.js} +1 -1
  85. package/dist/assets/{react-CcJOgdcP.js → react-axoushfz.js} +1 -1
  86. package/dist/assets/{react-DP_wuGKo.js → react-uplfhPO2.js} +1 -1
  87. package/dist/assets/{recharts-C0aThBg3.js → recharts-DAM4r1-u.js} +1 -1
  88. package/dist/assets/{routePaths-DyIc-n3M.js → routePaths-DZldr9mG.js} +1 -1
  89. package/dist/assets/{sentry-D_xp3E3Q.js → sentry-BLIwU6uZ.js} +1 -1
  90. package/dist/assets/{url-Cn_1-HsX.js → url-BMb7_G4N.js} +1 -1
  91. package/dist/assets/{url-DZdoYQOC.js → url-CbGZb3kM.js} +1 -1
  92. package/dist/assets/{useAiCfoDashboardSuggestedQuestionsChips-ClwyrxTK.js → useAiCfoDashboardSuggestedQuestionsChips-DEWGXdch.js} +1 -1
  93. package/dist/assets/{useAskAiCfoHostNavButtonProps-BZImc5qT.js → useAskAiCfoHostNavButtonProps-DS5Fxq3U.js} +1 -1
  94. package/dist/assets/useCashManagementBanner-CtcuIjhq.js +1 -0
  95. package/dist/assets/{useDeviceId-BX67JldO.js → useDeviceId-l9JfwAte.js} +1 -1
  96. package/dist/assets/{useInitialThreadRequest-DVxzaQcg.js → useInitialThreadRequest-Bh1NrHII.js} +1 -1
  97. package/dist/assets/{utils-BQO84dIV.js → utils-Bia5qc4p.js} +1 -1
  98. package/dist/assets/{withTransactionSidePanel-MinVWpma.js → withTransactionSidePanel-DxHfrYsZ.js} +4 -4
  99. package/dist/assets/{zeni-epic-state-CkeDRiud.js → zeni-epic-state-BZ6N8nVI.js} +6 -6
  100. package/dist/index.html +1 -1
  101. package/package.json +3 -3
  102. package/dist/assets/AddressRoutes-ENVkkepY.js +0 -1
  103. package/dist/assets/BusinessVerificationPageScreen-D2N5zUvV.js +0 -9
  104. package/dist/assets/CardsAiCfoScreen-bhVF9e_F.js +0 -14
  105. package/dist/assets/ConnectionAuthScreen-B6tGghLx.js +0 -11
  106. package/dist/assets/CustomerOnboardingAuthScreen-CpXzEPeL.js +0 -1
  107. package/dist/assets/DomesticWireDetailScreen-DEZpmV1y.js +0 -18
  108. package/dist/assets/DrawerScreen-CfPgZFbu.js +0 -1
  109. package/dist/assets/EntityDetailRoutes-ByNAOdBV.js +0 -1
  110. package/dist/assets/FeaturePreviewScreen-Bbo-4gXG.js +0 -1
  111. package/dist/assets/HubSpotOAuthCallbackScreen-Cngdo8vI.js +0 -1
  112. package/dist/assets/MagicLinkRoutes-CP3FxH4t.js +0 -72
  113. package/dist/assets/MagicLinkSignInScreen-DfMGZywc.js +0 -12
  114. package/dist/assets/MobileAppDrawer-CWBhYKqW.js +0 -1
  115. package/dist/assets/NotFoundScreen-Bnx2UPHv.js +0 -1
  116. package/dist/assets/NotificationRoutes-Qy8HYHkb.js +0 -1
  117. package/dist/assets/OAuthConsentScreen-DffRqRWT.js +0 -1
  118. package/dist/assets/PandLWithForecastRoutes-DzMNbzsJ.js +0 -1
  119. package/dist/assets/PerformanceRoutes-DJjg_nmN.js +0 -1
  120. package/dist/assets/ReimbursementApprovalRoutes-BwiPly2p.js +0 -1
  121. package/dist/assets/RewardsRoutes-CmWH02Nb.js +0 -1
  122. package/dist/assets/ScreenRoutes-BVhH5D33.js +0 -2
  123. package/dist/assets/SignInScreen-DqCXO7t5.js +0 -1
  124. package/dist/assets/SignOutScreen-PgaK8hUe.js +0 -9
  125. package/dist/assets/TaskRoutes-DddYQsp2.js +0 -9
  126. package/dist/assets/WiseConfirmationScreen-gcw35kRr.js +0 -12
  127. package/dist/assets/ZeniAccountStatementScreen-NjdxQEux.js +0 -9
  128. package/dist/assets/getLocaleForTenant-9euvow3p.js +0 -1
  129. package/dist/assets/useCashManagementBanner-BWjfwjGa.js +0 -1
@@ -1,4 +1,4 @@
1
- import{j as Ol}from"./liveblocks-BLlSTcoD.js";import{p as Q,e as xc,d as kc,g as jl,a as xl}from"./sentry-D_xp3E3Q.js";import{L as dt,bY as Tc,eW as Ac,Ly as Rc,M0 as kl,c7 as Tl,f_ as Al,f$ as Rl}from"./zeni-epic-state-CkeDRiud.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-BQO84dIV.js";import{r as un}from"./empty-DhAifQ6-.js";import{r as Fl,a as Bl,b as Ul,c as ql}from"./pdf-lib-BxiXr152.js";import{r as Gl}from"./index-D-GsKzyX.js";import{r as zl}from"./index-Bg6fgf4p.js";import{h as Zl,g as Hl,u as Vl,j as En,n as Yl}from"./core-CbpoBsNm.js";import{u as Kl,z as Pc,L as Wl,O as Jl,Q as Xl,h as Ql,d as tf}from"./index-aZImxzjX.js";import"./mui-DcNGd9L2.js";import{d as Pe}from"./decodeURIComponentSafe-9Mzf3G8U.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]="6c38cfeb-aef0-4018-aef4-876ae2644f5d",t._sentryDebugIdIdentifier="sentry-dbid-6c38cfeb-aef0-4018-aef4-876ae2644f5d")}catch{}})();var _n,Sn={exports:{}},On,jn,xn,kn,Tn,An,Rn,In,Pn,Ne,Nn,Ln,$n,Mn,Cn,Dn,Fn,Bn,Un,qn,Gn,Le,zn,Zn,Hn,Vn,Yn,Kn,Wn,$e,Jn,Xn,Qn,to,eo,ro,no,Me={exports:{}},Ce={exports:{}},De={};function Nc(){if(On)return De;function t(r){return t=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},t(r)}function f(r,e){return f=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(a,p){return a.__proto__=p,a},f(r,e)}function m(r){var e=function(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}();return function(){var a,p=s(r);if(e){var h=s(this).constructor;a=Reflect.construct(p,arguments,h)}else a=p.apply(this,arguments);return function(d,b){if(b&&(t(b)==="object"||typeof b=="function"))return b;if(b!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return function(g){if(g===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return g}(d)}(this,a)}}function s(r){return s=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},s(r)}On=1;var l,o,n={};function i(r,e,a){a||(a=Error);var p=function(h){(function(c,y){if(typeof y!="function"&&y!==null)throw new TypeError("Super expression must either be null or a function");c.prototype=Object.create(y&&y.prototype,{constructor:{value:c,writable:!0,configurable:!0}}),Object.defineProperty(c,"prototype",{writable:!1}),y&&f(c,y)})(g,h);var d,b=m(g);function g(c,y,v){var S;return function(w,_){if(!(w instanceof _))throw new TypeError("Cannot call a class as a function")}(this,g),S=b.call(this,function(w,_,M){return typeof e=="string"?e:e(w,_,M)}(c,y,v)),S.code=r,S}return d=g,Object.defineProperty(d,"prototype",{writable:!1}),d}(a);n[r]=p}function u(r,e){if(Array.isArray(r)){var a=r.length;return r=r.map(function(p){return String(p)}),a>2?"one of ".concat(e," ").concat(r.slice(0,a-1).join(", "),", or ")+r[a-1]:a===2?"one of ".concat(e," ").concat(r[0]," or ").concat(r[1]):"of ".concat(e," ").concat(r[0])}return"of ".concat(e," ").concat(String(r))}return i("ERR_AMBIGUOUS_ARGUMENT",'The "%s" argument is ambiguous. %s',TypeError),i("ERR_INVALID_ARG_TYPE",function(r,e,a){var p,h,d;if(l===void 0&&(l=ie()),l(typeof r=="string","'name' must be a string"),typeof e=="string"&&(h="not ",e.substr(0,h.length)===h)?(p="must not be",e=e.replace(/^not /,"")):p="must be",function(g,c,y){return(y===void 0||y>g.length)&&(y=g.length),g.substring(y-c.length,y)===c}(r," argument"))d="The ".concat(r," ").concat(p," ").concat(u(e,"type"));else{var b=function(g,c,y){return typeof y!="number"&&(y=0),!(y+c.length>g.length)&&g.indexOf(c,y)!==-1}(r,".")?"property":"argument";d='The "'.concat(r,'" ').concat(b," ").concat(p," ").concat(u(e,"type"))}return d+=". Received type ".concat(t(a))},TypeError),i("ERR_INVALID_ARG_VALUE",function(r,e){var a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:"is invalid";o===void 0&&(o=lt());var p=o.inspect(e);return p.length>128&&(p="".concat(p.slice(0,128),"...")),"The argument '".concat(r,"' ").concat(a,". Received ").concat(p)},TypeError),i("ERR_INVALID_RETURN_VALUE",function(r,e,a){var p;return p=a&&a.constructor&&a.constructor.name?"instance of ".concat(a.constructor.name):"type ".concat(t(a)),"Expected ".concat(r,' to be returned from the "').concat(e,'"')+" function but got ".concat(p,".")},TypeError),i("ERR_MISSING_ARGS",function(){for(var r=arguments.length,e=new Array(r),a=0;a<r;a++)e[a]=arguments[a];l===void 0&&(l=ie()),l(e.length>0,"At least one arg needs to be specified");var p="The ",h=e.length;switch(e=e.map(function(d){return'"'.concat(d,'"')}),h){case 1:p+="".concat(e[0]," argument");break;case 2:p+="".concat(e[0]," and ").concat(e[1]," arguments");break;default:p+=e.slice(0,h-1).join(", "),p+=", and ".concat(e[h-1]," arguments")}return"".concat(p," must be specified")},TypeError),De.codes=n,De}function ef(){if(xn)return jn;function t(k,E){var j=Object.keys(k);if(Object.getOwnPropertySymbols){var x=Object.getOwnPropertySymbols(k);E&&(x=x.filter(function(O){return Object.getOwnPropertyDescriptor(k,O).enumerable})),j.push.apply(j,x)}return j}function f(k){for(var E=1;E<arguments.length;E++){var j=arguments[E]!=null?arguments[E]:{};E%2?t(Object(j),!0).forEach(function(x){m(k,x,j[x])}):Object.getOwnPropertyDescriptors?Object.defineProperties(k,Object.getOwnPropertyDescriptors(j)):t(Object(j)).forEach(function(x){Object.defineProperty(k,x,Object.getOwnPropertyDescriptor(j,x))})}return k}function m(k,E,j){return(E=l(E))in k?Object.defineProperty(k,E,{value:j,enumerable:!0,configurable:!0,writable:!0}):k[E]=j,k}function s(k,E,j){return E&&function(x,O){for(var $=0;$<O.length;$++){var N=O[$];N.enumerable=N.enumerable||!1,N.configurable=!0,"value"in N&&(N.writable=!0),Object.defineProperty(x,l(N.key),N)}}(k.prototype,E),Object.defineProperty(k,"prototype",{writable:!1}),k}function l(k){var E=function(j,x){if(p(j)!=="object"||j===null)return j;var O=j[Symbol.toPrimitive];if(O!==void 0){var $=O.call(j,x);if(p($)!=="object")return $;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(j)}(k,"string");return p(E)==="symbol"?E:String(E)}function o(k,E){if(E&&(p(E)==="object"||typeof E=="function"))return E;if(E!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return n(k)}function n(k){if(k===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return k}function i(k){var E=typeof Map=="function"?new Map:void 0;return i=function(j){if(j===null||(x=j,Function.toString.call(x).indexOf("[native code]")===-1))return j;var x;if(typeof j!="function")throw new TypeError("Super expression must either be null or a function");if(E!==void 0){if(E.has(j))return E.get(j);E.set(j,O)}function O(){return u(j,arguments,a(this).constructor)}return O.prototype=Object.create(j.prototype,{constructor:{value:O,enumerable:!1,writable:!0,configurable:!0}}),e(O,j)},i(k)}function u(k,E,j){return u=r()?Reflect.construct.bind():function(x,O,$){var N=[null];N.push.apply(N,O);var P=new(Function.bind.apply(x,N));return $&&e(P,$.prototype),P},u.apply(null,arguments)}function r(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function e(k,E){return e=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(j,x){return j.__proto__=x,j},e(k,E)}function a(k){return a=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(E){return E.__proto__||Object.getPrototypeOf(E)},a(k)}function p(k){return p=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(E){return typeof E}:function(E){return E&&typeof Symbol=="function"&&E.constructor===Symbol&&E!==Symbol.prototype?"symbol":typeof E},p(k)}xn=1;var h=lt().inspect,d=Nc().codes.ERR_INVALID_ARG_TYPE;function b(k,E,j){return(j===void 0||j>k.length)&&(j=k.length),k.substring(j-E.length,j)===E}var g="",c="",y="",v="",S={deepStrictEqual:"Expected values to be strictly deep-equal:",strictEqual:"Expected values to be strictly equal:",strictEqualObject:'Expected "actual" to be reference-equal to "expected":',deepEqual:"Expected values to be loosely deep-equal:",equal:"Expected values to be loosely equal:",notDeepStrictEqual:'Expected "actual" not to be strictly deep-equal to:',notStrictEqual:'Expected "actual" to be strictly unequal to:',notStrictEqualObject:'Expected "actual" not to be reference-equal to "expected":',notDeepEqual:'Expected "actual" not to be loosely deep-equal to:',notEqual:'Expected "actual" to be loosely unequal to:',notIdentical:"Values identical but not reference-equal:"};function w(k){var E=Object.keys(k),j=Object.create(Object.getPrototypeOf(k));return E.forEach(function(x){j[x]=k[x]}),Object.defineProperty(j,"message",{value:k.message}),j}function _(k){return h(k,{compact:!1,customInspect:!1,depth:1e3,maxArrayLength:1/0,showHidden:!1,breakLength:1/0,showProxy:!1,sorted:!0,getters:!0})}function M(k,E,j){var x="",O="",$=0,N="",P=!1,G=_(k),A=G.split(`
1
+ import{j as Ol}from"./liveblocks-BUQfB0Zp.js";import{p as Q,e as xc,d as kc,g as jl,a as xl}from"./sentry-BLIwU6uZ.js";import{L as dt,bY as Tc,eV as Ac,Lx as Rc,L$ as kl,c6 as Tl,fZ as Al,f_ as Rl}from"./zeni-epic-state-BZ6N8nVI.js";import{a as lt,b as Il,c as Pl,d as Nl,e as an,f as Ll,g as $l,h as Ml,i as Vt,j as Ic,k as oe,l as je,m as Cl,o as Yt,p as ue,q as Dl}from"./utils-Bia5qc4p.js";import{r as un}from"./empty-BACf_dXg.js";import{r as Fl,a as Bl,b as Ul,c as ql}from"./pdf-lib-CtBKoWQc.js";import{r as Gl}from"./index-CPre97x9.js";import{r as zl}from"./index-BQIzm-tN.js";import{h as Zl,g as Hl,u as Vl,j as En,n as Yl}from"./core-OMb8nkC1.js";import{u as Kl,z as Pc,L as Wl,K as Jl,O as Xl,k as Ql,d as tf}from"./index-NcZU0lXl.js";import"./mui-JZY-3hhJ.js";import{d as Pe}from"./decodeURIComponentSafe-CrZYJ6cg.js";(function(){try{var t=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},f=new t.Error().stack;f&&(t._sentryDebugIds=t._sentryDebugIds||{},t._sentryDebugIds[f]="c000f512-6d89-4684-a3f3-429ae0d91ade",t._sentryDebugIdIdentifier="sentry-dbid-c000f512-6d89-4684-a3f3-429ae0d91ade")}catch{}})();var _n,Sn={exports:{}},On,jn,xn,kn,Tn,An,Rn,In,Pn,Ne,Nn,Ln,$n,Mn,Cn,Dn,Fn,Bn,Un,qn,Gn,Le,zn,Zn,Hn,Vn,Yn,Kn,Wn,$e,Jn,Xn,Qn,to,eo,ro,no,Me={exports:{}},Ce={exports:{}},De={};function Nc(){if(On)return De;function t(r){return t=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},t(r)}function f(r,e){return f=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(a,p){return a.__proto__=p,a},f(r,e)}function m(r){var e=function(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}();return function(){var a,p=s(r);if(e){var h=s(this).constructor;a=Reflect.construct(p,arguments,h)}else a=p.apply(this,arguments);return function(d,b){if(b&&(t(b)==="object"||typeof b=="function"))return b;if(b!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return function(g){if(g===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return g}(d)}(this,a)}}function s(r){return s=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},s(r)}On=1;var l,o,n={};function i(r,e,a){a||(a=Error);var p=function(h){(function(c,y){if(typeof y!="function"&&y!==null)throw new TypeError("Super expression must either be null or a function");c.prototype=Object.create(y&&y.prototype,{constructor:{value:c,writable:!0,configurable:!0}}),Object.defineProperty(c,"prototype",{writable:!1}),y&&f(c,y)})(g,h);var d,b=m(g);function g(c,y,v){var S;return function(w,_){if(!(w instanceof _))throw new TypeError("Cannot call a class as a function")}(this,g),S=b.call(this,function(w,_,M){return typeof e=="string"?e:e(w,_,M)}(c,y,v)),S.code=r,S}return d=g,Object.defineProperty(d,"prototype",{writable:!1}),d}(a);n[r]=p}function u(r,e){if(Array.isArray(r)){var a=r.length;return r=r.map(function(p){return String(p)}),a>2?"one of ".concat(e," ").concat(r.slice(0,a-1).join(", "),", or ")+r[a-1]:a===2?"one of ".concat(e," ").concat(r[0]," or ").concat(r[1]):"of ".concat(e," ").concat(r[0])}return"of ".concat(e," ").concat(String(r))}return i("ERR_AMBIGUOUS_ARGUMENT",'The "%s" argument is ambiguous. %s',TypeError),i("ERR_INVALID_ARG_TYPE",function(r,e,a){var p,h,d;if(l===void 0&&(l=ie()),l(typeof r=="string","'name' must be a string"),typeof e=="string"&&(h="not ",e.substr(0,h.length)===h)?(p="must not be",e=e.replace(/^not /,"")):p="must be",function(g,c,y){return(y===void 0||y>g.length)&&(y=g.length),g.substring(y-c.length,y)===c}(r," argument"))d="The ".concat(r," ").concat(p," ").concat(u(e,"type"));else{var b=function(g,c,y){return typeof y!="number"&&(y=0),!(y+c.length>g.length)&&g.indexOf(c,y)!==-1}(r,".")?"property":"argument";d='The "'.concat(r,'" ').concat(b," ").concat(p," ").concat(u(e,"type"))}return d+=". Received type ".concat(t(a))},TypeError),i("ERR_INVALID_ARG_VALUE",function(r,e){var a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:"is invalid";o===void 0&&(o=lt());var p=o.inspect(e);return p.length>128&&(p="".concat(p.slice(0,128),"...")),"The argument '".concat(r,"' ").concat(a,". Received ").concat(p)},TypeError),i("ERR_INVALID_RETURN_VALUE",function(r,e,a){var p;return p=a&&a.constructor&&a.constructor.name?"instance of ".concat(a.constructor.name):"type ".concat(t(a)),"Expected ".concat(r,' to be returned from the "').concat(e,'"')+" function but got ".concat(p,".")},TypeError),i("ERR_MISSING_ARGS",function(){for(var r=arguments.length,e=new Array(r),a=0;a<r;a++)e[a]=arguments[a];l===void 0&&(l=ie()),l(e.length>0,"At least one arg needs to be specified");var p="The ",h=e.length;switch(e=e.map(function(d){return'"'.concat(d,'"')}),h){case 1:p+="".concat(e[0]," argument");break;case 2:p+="".concat(e[0]," and ").concat(e[1]," arguments");break;default:p+=e.slice(0,h-1).join(", "),p+=", and ".concat(e[h-1]," arguments")}return"".concat(p," must be specified")},TypeError),De.codes=n,De}function ef(){if(xn)return jn;function t(k,E){var j=Object.keys(k);if(Object.getOwnPropertySymbols){var x=Object.getOwnPropertySymbols(k);E&&(x=x.filter(function(O){return Object.getOwnPropertyDescriptor(k,O).enumerable})),j.push.apply(j,x)}return j}function f(k){for(var E=1;E<arguments.length;E++){var j=arguments[E]!=null?arguments[E]:{};E%2?t(Object(j),!0).forEach(function(x){m(k,x,j[x])}):Object.getOwnPropertyDescriptors?Object.defineProperties(k,Object.getOwnPropertyDescriptors(j)):t(Object(j)).forEach(function(x){Object.defineProperty(k,x,Object.getOwnPropertyDescriptor(j,x))})}return k}function m(k,E,j){return(E=l(E))in k?Object.defineProperty(k,E,{value:j,enumerable:!0,configurable:!0,writable:!0}):k[E]=j,k}function s(k,E,j){return E&&function(x,O){for(var $=0;$<O.length;$++){var N=O[$];N.enumerable=N.enumerable||!1,N.configurable=!0,"value"in N&&(N.writable=!0),Object.defineProperty(x,l(N.key),N)}}(k.prototype,E),Object.defineProperty(k,"prototype",{writable:!1}),k}function l(k){var E=function(j,x){if(p(j)!=="object"||j===null)return j;var O=j[Symbol.toPrimitive];if(O!==void 0){var $=O.call(j,x);if(p($)!=="object")return $;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(j)}(k,"string");return p(E)==="symbol"?E:String(E)}function o(k,E){if(E&&(p(E)==="object"||typeof E=="function"))return E;if(E!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return n(k)}function n(k){if(k===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return k}function i(k){var E=typeof Map=="function"?new Map:void 0;return i=function(j){if(j===null||(x=j,Function.toString.call(x).indexOf("[native code]")===-1))return j;var x;if(typeof j!="function")throw new TypeError("Super expression must either be null or a function");if(E!==void 0){if(E.has(j))return E.get(j);E.set(j,O)}function O(){return u(j,arguments,a(this).constructor)}return O.prototype=Object.create(j.prototype,{constructor:{value:O,enumerable:!1,writable:!0,configurable:!0}}),e(O,j)},i(k)}function u(k,E,j){return u=r()?Reflect.construct.bind():function(x,O,$){var N=[null];N.push.apply(N,O);var P=new(Function.bind.apply(x,N));return $&&e(P,$.prototype),P},u.apply(null,arguments)}function r(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function e(k,E){return e=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(j,x){return j.__proto__=x,j},e(k,E)}function a(k){return a=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(E){return E.__proto__||Object.getPrototypeOf(E)},a(k)}function p(k){return p=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(E){return typeof E}:function(E){return E&&typeof Symbol=="function"&&E.constructor===Symbol&&E!==Symbol.prototype?"symbol":typeof E},p(k)}xn=1;var h=lt().inspect,d=Nc().codes.ERR_INVALID_ARG_TYPE;function b(k,E,j){return(j===void 0||j>k.length)&&(j=k.length),k.substring(j-E.length,j)===E}var g="",c="",y="",v="",S={deepStrictEqual:"Expected values to be strictly deep-equal:",strictEqual:"Expected values to be strictly equal:",strictEqualObject:'Expected "actual" to be reference-equal to "expected":',deepEqual:"Expected values to be loosely deep-equal:",equal:"Expected values to be loosely equal:",notDeepStrictEqual:'Expected "actual" not to be strictly deep-equal to:',notStrictEqual:'Expected "actual" to be strictly unequal to:',notStrictEqualObject:'Expected "actual" not to be reference-equal to "expected":',notDeepEqual:'Expected "actual" not to be loosely deep-equal to:',notEqual:'Expected "actual" to be loosely unequal to:',notIdentical:"Values identical but not reference-equal:"};function w(k){var E=Object.keys(k),j=Object.create(Object.getPrototypeOf(k));return E.forEach(function(x){j[x]=k[x]}),Object.defineProperty(j,"message",{value:k.message}),j}function _(k){return h(k,{compact:!1,customInspect:!1,depth:1e3,maxArrayLength:1/0,showHidden:!1,breakLength:1/0,showProxy:!1,sorted:!0,getters:!0})}function M(k,E,j){var x="",O="",$=0,N="",P=!1,G=_(k),A=G.split(`
2
2
  `),I=_(E).split(`
3
3
  `),R=0,B="";if(j==="strictEqual"&&p(k)==="object"&&p(E)==="object"&&k!==null&&E!==null&&(j="strictEqualObject"),A.length===1&&I.length===1&&A[0]!==I[0]){var V=A[0].length+I[0].length;if(V<=10){if(!(p(k)==="object"&&k!==null||p(E)==="object"&&E!==null||k===0&&E===0))return"".concat(S[j],`
4
4
 
@@ -1,5 +1,5 @@
1
- import{j as s}from"./liveblocks-BLlSTcoD.js";import{a as o}from"./sentry-D_xp3E3Q.js";import{j as f,h as F,u as H,g as _,n as V}from"./core-CbpoBsNm.js";import{m as W,K as M,z as R,bb as U,G as N,X as $,_ as z,A as G,d as l,f as X,a7 as K,bc as q}from"./index-aZImxzjX.js";import{fF as J,eW as Q,OS as P,OT as Y,vs as Z,vi as g,fH as ee,bS as re,vn as ae,OU as ne}from"./zeni-epic-state-CkeDRiud.js";import{D as te,e as se,n as oe,S as ie}from"./mui-DcNGd9L2.js";import{u as le}from"./useAskAiCfoHostNavButtonProps-BZImc5qT.js";import{M as ce}from"./MobileAppDrawer-CWBhYKqW.js";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},r=new e.Error().stack;r&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[r]="8e93c2d2-bf91-426f-b382-c546c634b3c4",e._sentryDebugIdIdentifier="sentry-dbid-8e93c2d2-bf91-426f-b382-c546c634b3c4")}catch{}})();const de={overlayWidth:new N(100,100,30)},fe=({isReferralDrawerOpen:e,closeDrawerHandler:r})=>{const a=W(),n=M();if(R.getSignedInUser()==null)throw Error("Can't access How Referral works without signing in...");const i=()=>{r(!0)},u=f(c=>J(c));return s.jsx(te,{anchor:"right",open:e,PaperProps:{style:{width:de.overlayWidth.valuePercentage(n),boxShadow:"none"}},slotProps:{backdrop:{style:{opacity:.75,backgroundColor:a.colors.black,cursor:"pointer"}}},onClose:()=>i(),children:s.jsx(se,{in:e,direction:"left",children:s.jsx(ue,{onClick:c=>c.stopPropagation(),children:s.jsx(U,{onDismissClick:i,rewardsPlan:u.rewardsPlan})})})})},ue=oe(ie)`
1
+ import{j as s}from"./liveblocks-BUQfB0Zp.js";import{a as o}from"./sentry-BLIwU6uZ.js";import{j as f,h as B,u as _,g as H,n as W}from"./core-OMb8nkC1.js";import{m as F,J as M,z as R,bb as N,A as U,W as $,_ as z,E as G,d as l,f as q,a7 as J,bc as K}from"./index-NcZU0lXl.js";import{fE as Q,eV as X,OR as P,OS as Y,vr as Z,vh as g,fG as ee,bS as re,vm as ae,OT as ne}from"./zeni-epic-state-BZ6N8nVI.js";import{D as te,e as se,n as oe,S as ie}from"./mui-JZY-3hhJ.js";import{u as le}from"./useAskAiCfoHostNavButtonProps-DS5Fxq3U.js";import{M as ce}from"./MobileAppDrawer-B4f1me8_.js";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},r=new e.Error().stack;r&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[r]="3fb55748-b11c-47f4-9254-31c588544b2c",e._sentryDebugIdIdentifier="sentry-dbid-3fb55748-b11c-47f4-9254-31c588544b2c")}catch{}})();const de={overlayWidth:new U(100,100,30)},fe=({isReferralDrawerOpen:e,closeDrawerHandler:r})=>{const a=F(),n=M();if(R.getSignedInUser()==null)throw Error("Can't access How Referral works without signing in...");const i=()=>{r(!0)},u=f(c=>Q(c));return s.jsx(te,{anchor:"right",open:e,PaperProps:{style:{width:de.overlayWidth.valuePercentage(n),boxShadow:"none"}},slotProps:{backdrop:{style:{opacity:.75,backgroundColor:a.colors.black,cursor:"pointer"}}},onClose:()=>i(),children:s.jsx(se,{in:e,direction:"left",children:s.jsx(ue,{onClick:c=>c.stopPropagation(),children:s.jsx(N,{onDismissClick:i,rewardsPlan:u.rewardsPlan})})})})},ue=oe(ie)`
2
2
  display: flex;
3
3
  min-height: 100%;
4
4
  flex-direction: column;
5
- `,I="refer-and-earn-status-update",we=V(function(e){const r=P(e),a=e.referralViewState.rewardsPlanFetchState,n=re([r,a]);return{inviteList:r.invitations,uiState:r.uiState,pendingBonus:r.pendingBonus,earnedBonus:r.earnedBonus,pendingReferrals:r.pendingReferrals,fetchState:n.fetchState,rewardsPlan:r.rewardsPlan}},function(e,r){const{navigate:a}=r;return{onColumnSortConfigChanged:(n,i)=>{e(ne({sortOrder:i,sortkey:n}))},onInviteClick:()=>{l.trackRewardsPageClicked("invite via email"),a("../refer")},onHowItWorksClick:()=>{l.trackRewardsPageClicked("know more"),a("../how-it-works")},onResendInviteClick:n=>{l.trackRewardsPageClicked("resend invite"),e(ae(n))},onBackClick:()=>{a("../",{relative:"path"})},onReloadInvitees:()=>{e(g(!0))},onCopyReferralLink:()=>{l.trackRewardsPageClicked("copy referral link")},onClickRefer:()=>{l.trackRewardsPageClicked("refer")},onEventReceived:n=>{n===I&&e(g(!0,!0))}}})(K(q));function Se({isReferralDrawerOpen:e}){const r=F(),a=H(),n=_(),[i,u]=o.useState(!1),[c,x]=o.useState(!1),[D,E]=o.useState(!1),[k,C]=o.useState(!1),w=R.getSignedInUser(),b=f(t=>Q(t)),h=f(t=>P(t)),m=h.fetchState,p=f(t=>t.referralViewState.rewardsPlanFetchState),v=Y([h,p]),{areTenantIdsInSync:d}=$();o.useEffect(()=>{b?.rewardsLastViewedTime==null&&D===!1&&(a(Z()),E(!0))},[]),o.useEffect(()=>{!i&&m==="Not-Started"&&d&&(u(!0),a(g(!0)))},[m,a,d]),o.useEffect(()=>{!c&&p.fetchState==="Not-Started"&&d&&(x(!0),a(ee(!0)))},[p,a,d]),o.useEffect(()=>{C(e!=null&&e===!0)},[e]);const[j,A]=o.useState(!1),S=t=>{A(t)},{isAiCfoAccessEnabled:O,onAskAiCfoClick:T}=le({mobileExploreReferrer:"Rewards"});z({isDataReady:v===!0});const L={events:w?.userId!=null?[`private-encrypted-${w.userId}.${I}`]:[],eventCallback:(t,y,B)=>{B.onEventReceived(t)}};return s.jsxs(s.Fragment,{children:[v===!0?s.jsx(G,{analytics:l,onLoad:t=>(y=>{w!=null&&y.trackPageLoaded(X.Event.rewardsPageViewed)})(t)}):null,s.jsx(ce,{isAppContentDrawerOpen:j,handleDrawerToggle:S}),k===!0?s.jsx(fe,{closeDrawerHandler:()=>{C(!1),r("..")},isReferralDrawerOpen:k}):null,s.jsx(we,{location:n,navigate:r,currentTenant:b,onClickMenuIcon:()=>{S(!0)},isAiCfoAccessEnabled:O,onAskAiCfoClick:T,...L})]})}export{Se as R};
5
+ `,I="refer-and-earn-status-update",we=W(function(e){const r=P(e),a=e.referralViewState.rewardsPlanFetchState,n=re([r,a]);return{inviteList:r.invitations,uiState:r.uiState,pendingBonus:r.pendingBonus,earnedBonus:r.earnedBonus,pendingReferrals:r.pendingReferrals,fetchState:n.fetchState,rewardsPlan:r.rewardsPlan}},function(e,r){const{navigate:a}=r;return{onColumnSortConfigChanged:(n,i)=>{e(ne({sortOrder:i,sortkey:n}))},onInviteClick:()=>{l.trackRewardsPageClicked("invite via email"),a("../refer")},onHowItWorksClick:()=>{l.trackRewardsPageClicked("know more"),a("../how-it-works")},onResendInviteClick:n=>{l.trackRewardsPageClicked("resend invite"),e(ae(n))},onBackClick:()=>{a("../",{relative:"path"})},onReloadInvitees:()=>{e(g(!0))},onCopyReferralLink:()=>{l.trackRewardsPageClicked("copy referral link")},onClickRefer:()=>{l.trackRewardsPageClicked("refer")},onEventReceived:n=>{n===I&&e(g(!0,!0))}}})(J(K));function Se({isReferralDrawerOpen:e}){const r=B(),a=_(),n=H(),[i,u]=o.useState(!1),[c,D]=o.useState(!1),[E,x]=o.useState(!1),[k,h]=o.useState(!1),w=R.getSignedInUser(),C=f(t=>X(t)),b=f(t=>P(t)),m=b.fetchState,p=f(t=>t.referralViewState.rewardsPlanFetchState),v=Y([b,p]),{areTenantIdsInSync:d}=$();o.useEffect(()=>{C?.rewardsLastViewedTime==null&&E===!1&&(a(Z()),x(!0))},[]),o.useEffect(()=>{!i&&m==="Not-Started"&&d&&(u(!0),a(g(!0)))},[m,a,d]),o.useEffect(()=>{!c&&p.fetchState==="Not-Started"&&d&&(D(!0),a(ee(!0)))},[p,a,d]),o.useEffect(()=>{h(e!=null&&e===!0)},[e]);const[j,A]=o.useState(!1),S=t=>{A(t)},{isAiCfoAccessEnabled:O,onAskAiCfoClick:T}=le({mobileExploreReferrer:"Rewards"});z({isDataReady:v===!0});const L={events:w?.userId!=null?[`private-encrypted-${w.userId}.${I}`]:[],eventCallback:(t,y,V)=>{V.onEventReceived(t)}};return s.jsxs(s.Fragment,{children:[v===!0?s.jsx(G,{analytics:l,onLoad:t=>(y=>{w!=null&&y.trackPageLoaded(q.Event.rewardsPageViewed)})(t)}):null,s.jsx(ce,{isAppContentDrawerOpen:j,handleDrawerToggle:S}),k===!0?s.jsx(fe,{closeDrawerHandler:()=>{h(!1),r("..")},isReferralDrawerOpen:k}):null,s.jsx(we,{location:n,navigate:r,currentTenant:C,onClickMenuIcon:()=>{S(!0)},isAiCfoAccessEnabled:O,onAskAiCfoClick:T,...L})]})}export{Se as R};
@@ -0,0 +1 @@
1
+ import{j as r}from"./liveblocks-BUQfB0Zp.js";import F from"./NotFoundScreen-CxRYls3k.js";import{a as p}from"./sentry-BLIwU6uZ.js";import{h as E,g as x,u as C,j as u,N as D,n as V,o as O,p as g}from"./core-OMb8nkC1.js";import{eV as I,PL as b,P$ as S,Fe as k,En as U,Fd as d,F4 as L,Qf as $,Fg as _}from"./zeni-epic-state-BZ6N8nVI.js";import{z as N,a7 as B,bW as z,af as T,bz as P,bX as K}from"./index-NcZU0lXl.js";import"./mui-JZY-3hhJ.js";import{u as Q,R as A}from"./ReimbursementApprovalRuleDetailScreen-DTZkQzQY.js";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},o=new e.Error().stack;o&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[o]="aefe3d82-f812-4964-91dc-2caec822bcce",e._sentryDebugIdIdentifier="sentry-dbid-aefe3d82-f812-4964-91dc-2caec822bcce")}catch{}})();const y="reimbursement-approval-rule-update",X=V(function(e){return{approvalView:b(e),remiSetupApproverViewUpdateData:S(e).remiSetupApproverViewUpdateData}},function(e,o){const{navigate:s,location:n}=o;return{onApprovalRulesEventReceived:t=>{t.endsWith(y)&&e($(!1))},onBackClick:()=>{T(n)?s("../../"):s("../../../reimbursements/setup")},onDeleteRuleClick:t=>{e(L(t,!1))},onEditRuleClick:t=>{t!=null?(e(d(t)),s(`./${t}/edit`)):(e(d()),s("./new"))}}})(B(z)),q=({isLoading:e})=>{const o=E(),s=x(),n=C(),[t,i]=p.useState(!1),[m,w]=p.useState(!1),f=u(a=>a.remiSetupApproverViewState.fetchState),l=u(a=>I(a)),c=u(a=>b(a)),v=u(a=>S(a).remiSetupApproverViewUpdateData);if(p.useEffect(()=>{v?.updateStatus.fetchState==="Completed"&&n(k())},[v]),p.useEffect(()=>{t||f!=="Not-Started"||e||(i(!0),n(U(!0,!1,!1,!1)))},[t,f,e,n]),N.getSignedInUser()==null)throw Error("Can't access reimbursement approval without signing in...");p.useEffect(()=>{c.allApprovalRules.length===0&&c.fetchState==="Completed"&&(m||(w(!0),n(d())),o("./new"))},[m,c,n]);const R={events:l.companyId!=null?[`private-encrypted-${l.companyId}.${y}`]:[],eventCallback:(a,W,h)=>{a.endsWith(y)&&h.onApprovalRulesEventReceived(a)}};return l?.companyReimbursementInfo?.info?.isReimbursementTOSAccepted===!1?r.jsx(D,{to:"../../promo"}):r.jsx(X,{currentTenant:l,location:s,navigate:o,...R})},j="reimbursement-approval-rule-update",G=V(function(e){const o=b(e),s=S(e).remiSetupApproverViewUpdateData,n={};for(const i of Object.values(e.vendorState.vendorByID))i?.id!=null&&(n[i.id]=i.name);const t={};for(const i of Object.values(e.classState.classesByKey))i?.classId!=null&&(t[i.classId]=i.className);return{approvalView:o,remiSetupApproverViewUpdateData:s,vendorNamesById:n,departmentNamesById:t}},function(e,o){const{navigate:s,location:n}=o;return{onApprovalRulesEventReceived:t=>{t.endsWith(j)&&e($(!1))},onBackClick:()=>{T(n)?s("../../"):s("../../../reimbursements/setup")},onDeleteRuleClick:t=>{e(L(t,!0))},onEditRuleClick:t=>{t!=null?(e(d(t)),s(`./${t}/edit`)):(e(d()),s("./new"))},onReorderRules:t=>{e(_(t,!0))}}})(B(K)),H=()=>{const e=u(n=>I(n)),{isApprovalRulesV3Enabled:o,isLoading:s}=P(e?.tenantId);return o?r.jsx(J,{isLoading:s}):r.jsx(q,{isLoading:s})},J=({isLoading:e})=>{const o=E(),s=x(),n=C(),[t,i]=p.useState(!1),[m,w]=p.useState(!1),f=u(a=>a.remiSetupApproverViewState.fetchState),l=u(a=>I(a)),c=u(a=>b(a));Q();const v=u(a=>S(a).remiSetupApproverViewUpdateData);if(p.useEffect(()=>{v?.updateStatus.fetchState==="Completed"&&n(k())},[v]),p.useEffect(()=>{t||f!=="Not-Started"||e||(i(!0),n(U(!0,!1,!1,!0)))},[t,f,e,n]),N.getSignedInUser()==null)throw Error("Can't access reimbursement approval without signing in...");p.useEffect(()=>{c.allApprovalRules.length===0&&c.fetchState==="Completed"&&(m||(w(!0),n(d())),o("./new"))},[m,c,n]);const R={events:l.companyId!=null?[`private-encrypted-${l.companyId}.${j}`]:[],eventCallback:(a,W,h)=>{a.endsWith(j)&&h.onApprovalRulesEventReceived(a)}};return l?.companyReimbursementInfo?.info?.isReimbursementTOSAccepted===!1?r.jsx(D,{to:"../../promo"}):r.jsx(G,{currentTenant:l,location:s,navigate:o,isLoading:e,...R})};function oe(){return r.jsxs(O,{children:[r.jsx(g,{path:"/",element:r.jsx(H,{})}),r.jsx(g,{path:"/new",element:r.jsx(A,{})}),r.jsx(g,{path:"/:approvalRuleId/edit",element:r.jsx(A,{})}),r.jsx(g,{path:"*",element:r.jsx(F,{})})]})}export{oe as R};
@@ -1 +1 @@
1
- import{j as h}from"./liveblocks-BLlSTcoD.js";import{a as f}from"./sentry-D_xp3E3Q.js";import{u as w,j as y,h as _,g as O,i as k,n as F}from"./core-CbpoBsNm.js";import{kT as z,Q0 as T,PM as U,F8 as V,Fk as B,Ff as A,Fg as E,Q1 as j,eW as M,Fe as Q}from"./zeni-epic-state-CkeDRiud.js";import{z as N,m as P,B as $,bM as W,af as q,bz as K,bN as G}from"./index-aZImxzjX.js";import"./mui-DcNGd9L2.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]="2343f18b-bf70-49ed-929f-d2c5a2200d3a",e._sentryDebugIdIdentifier="sentry-dbid-2343f18b-bf70-49ed-929f-d2c5a2200d3a")}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(z({})))},[p,t,e])}const J=F(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 u=v=>{const b=[];return v.forEach(d=>{const I=d.actors.selectedUsers.map(m=>({type:"user",subType:void 0,userId:m.userId,idType:"user",isImplicitActor:!1})),R=d.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=I.concat(R);b.push({action:d.stepType.selectedOption,actors:c,operator:c.length>1?d.stepType.selectedOption==="require_approval"?"or":"and":"is"})}),b},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:u(a.steps),isApplicableOnPendingApprovalEntity:a.applyToExistingReimbursements.includes("applyToExistingReimbursements")};e(E(v))}else{const v={approvalRuleId:l,criteria:n,steps:u(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("../")}}})(W);function X(){const e=_(),s=w(),t=O(),{approvalRuleId:p}=k(),o=N.getSignedInUser(),l=P(),r=y(n=>T(n)),i=y(n=>U(n)),[a,u]=f.useState(!1);if(f.useEffect(()=>{a||(u(!0),s(V(!0)))}),f.useEffect(()=>{i.fetchState==="Not-Started"&&e(p!=null?"../../":"../")},[i,p]),o==null)throw Error("Can't access address page without signing in...");return r.approversDetailsFetchStatus.fetchState=="Not-Started"||r.approversDetailsFetchStatus.fetchState==="In-Progress"?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 Y=F(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 u=c=>{const m=[];return c.forEach(g=>{const S=g.actorKind?.selectedOption,x=g.selectedRole?.selectedOption;let D=[];S==="role"&&x!=null?D=[{type:"attribute",subType:x,userId:void 0,idType:void 0,isImplicitActor:!1}]:S==="specific_person"&&(D=(g.persons?.selectedUsers??[]).map(L=>({type:"user",subType:void 0,userId:L.userId,idType:"user",isImplicitActor:!1})));const C=g.action??"require_approval";m.push({action:C,actors:D,operator:D.length>1?C==="require_approval"?"or":"and":"is"})}),m},n=a.amountCriteria,v=a.vendorCriteria,b=a.departmentCriteria,d={};if(n!=null&&n.comparator.selectedOption!=null){const c=n.comparator.selectedOption;d.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&&(d.vendor={type:"vendor",operator:v?.operator.selectedOption??"is",vendorIds:I});const R=b?.selection.selectedOptions??[];if(R.length>0&&(d.department={type:"department",operator:b?.operator.selectedOption??"is",departmentIds:R}),r==="approval_create"){const c={name:a.name,description:a.description,separationOfDuties:a.separationOfDuties,isFallback:a.isFallback,criteria:d,steps:u(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:d,steps:u(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(Q(a)),t(r==="approval_update"?`../../${a}/edit`:`../${a}/edit`)}}})(G);function ne(){const e=y(t=>M(t)),{isApprovalRulesV3Enabled:s}=K(e?.tenantId);return s?h.jsx(Z,{}):h.jsx(X,{})}function Z(){const e=_(),s=w(),t=O(),{approvalRuleId:p}=k(),o=N.getSignedInUser(),l=P(),r=y(n=>T(n)),i=y(n=>U(n)),[a,u]=f.useState(!1);if(H(),f.useEffect(()=>{a||(u(!0),s(V(!0)))}),f.useEffect(()=>{i.fetchState==="Not-Started"&&e(p!=null?"../../":"../")},[i,p]),o==null)throw Error("Can't access address page without signing in...");return r.approversDetailsFetchStatus.fetchState=="Not-Started"||r.approversDetailsFetchStatus.fetchState==="In-Progress"?h.jsx($,{fetchState:r.approversDetailsFetchStatus.fetchState,style:{backgroundColor:l.colors.grey5}}):h.jsx(Y,{navigate:e,approvalUpdateDataView:r,approvalRuleId:p,approverViewData:i,location:t},p??"new")}export{ne as R,pe as i,H as u};
1
+ import{j as b}from"./liveblocks-BUQfB0Zp.js";import{a as f}from"./sentry-BLIwU6uZ.js";import{u as T,j as g,h as _,g as O,i as k,n as F}from"./core-OMb8nkC1.js";import{kS as z,P$ as w,PL as U,F7 as V,Fj as B,Fe as A,Ff as E,Q0 as j,eV as K,Fd as M}from"./zeni-epic-state-BZ6N8nVI.js";import{z as P,m as N,B as $,bM as Q,af as L,bz as W,bN as G}from"./index-NcZU0lXl.js";import"./mui-JZY-3hhJ.js";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},s=new e.Error().stack;s&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[s]="db059be0-57be-4fda-882c-718a293598c2",e._sentryDebugIdIdentifier="sentry-dbid-db059be0-57be-4fda-882c-718a293598c2")}catch{}})();function H(){const e=T(),s=f.useRef(!1),t=g(o=>o.vendorListState.fetchStateBillsTab.fetchState??"Not-Started"),p=g(o=>o.vendorListState.allVendorIdsBillsTab.length>0);f.useEffect(()=>{s.current||p||t==="Completed"||t==="In-Progress"||(s.current=!0,e(z({})))},[p,t,e])}const J=F(function(e,s){const t=w(e),p=t.remiSetupApproverViewUpdateData?.type??"approval_create",o=p==="approval_create"&&t.allApprovalRules.length!==0;let l=t.allApprovalRules.length===0;return s.approvalRuleId&&(l=t.allApprovalRules.findIndex(r=>r.approvalRuleId===s.approvalRuleId)===0),{localData:t,hideUpperBoundField:o,isLowerBoundDisabled:l,approvalUpdateActionType:p}},function(e,s){const{navigate:t,approvalUpdateDataView:p,approverViewData:o,approvalRuleId:l}=s,r=p.remiSetupApproverViewUpdateData?.type,i=L(s.location);return{onApprovalRuleDataUpdated:a=>{const d=v=>{const h=[];return v.forEach(u=>{const I=u.actors.selectedUsers.map(m=>({type:"user",subType:void 0,userId:m.userId,idType:"user",isImplicitActor:!1})),R=u.actors.selectedNonUsers.map(m=>{const y=(S=m.value,j(S)==null);var S;return{type:y?"attribute":"role",subType:m.value,userId:void 0,idType:void 0,isImplicitActor:!y}}),c=I.concat(R);h.push({action:u.stepType.selectedOption,actors:c,operator:c.length>1?u.stepType.selectedOption==="require_approval"?"or":"and":"is"})}),h},n={amount:{type:"amount",comparator:"range",min:{amount:a.lowerBound,currencyCode:"USD",currencySymbol:"$"},max:{amount:a.upperBound,currencyCode:"USD",currencySymbol:"$"}}};if(r==="approval_create"){const v={criteria:n,steps:d(a.steps),isApplicableOnPendingApprovalEntity:a.applyToExistingReimbursements.includes("applyToExistingReimbursements")};e(E(v))}else{const v={approvalRuleId:l,criteria:n,steps:d(a.steps),isApplicableOnPendingApprovalEntity:a.applyToExistingReimbursements.includes("applyToExistingReimbursements")};e(E(v))}},onResetClick:()=>{e(A()),r==="approval_update"||i?t("../"):o.allApprovalRules.length===0&&o.fetchState==="Completed"?t("../../setup"):t("../")},onBackClick:()=>{e(A()),r==="approval_update"||i?t("../"):o.allApprovalRules.length===0&&o.fetchState==="Completed"?t("../../setup"):t("../")},onSaveRuleClick:()=>{e(B(!1))},onSaveRuleSuccess:()=>{t("../")}}})(Q);function X(){const e=_(),s=T(),t=O(),{approvalRuleId:p}=k(),o=P.getSignedInUser(),l=N(),r=g(n=>w(n)),i=g(n=>U(n)),[a,d]=f.useState(!1);if(f.useEffect(()=>{a||(d(!0),s(V(!0)))}),f.useEffect(()=>{i.fetchState==="Not-Started"&&e(p!=null?"../../":"../")},[i,p]),o==null)throw Error("Can't access address page without signing in...");return r.approversDetailsFetchStatus.fetchState=="Not-Started"||r.approversDetailsFetchStatus.fetchState==="In-Progress"?b.jsx($,{fetchState:r.approversDetailsFetchStatus.fetchState,style:{backgroundColor:l.colors.grey5}}):b.jsx(J,{navigate:e,approvalUpdateDataView:r,approvalRuleId:p,approverViewData:i,location:t})}function pe(e){return j(e)==null}const Y=F(function(e,s){const t=w(e),p=t.remiSetupApproverViewUpdateData?.type??"approval_create",o=[],l={};for(const r of Object.values(e.vendorState.vendorByID))r?.id!=null&&(o.push(r.id),l[r.id]=r.name);return{localData:t,approvalUpdateActionType:p,allVendorIds:o,vendorNamesById:l,editingRuleId:p==="approval_update"?s.approvalRuleId:void 0,allApprovalRulesWithUser:U(e).allApprovalRules}},function(e,s){const{navigate:t,approvalUpdateDataView:p,approverViewData:o,approvalRuleId:l}=s,r=p.remiSetupApproverViewUpdateData?.type,i=L(s.location);return{onApprovalRuleDataUpdated:a=>{const d=c=>{const m=[];return c.forEach(y=>{const S=y.actorKind?.selectedOption,x=y.selectedRole?.selectedOption;let D=[];S==="role"&&x!=null?D=[{type:"attribute",subType:x,userId:void 0,idType:void 0,isImplicitActor:!1}]:S==="specific_person"&&(D=(y.persons?.selectedUsers??[]).map(q=>({type:"user",subType:void 0,userId:q.userId,idType:"user",isImplicitActor:!1})));const C=y.action??"require_approval";m.push({action:C,actors:D,operator:D.length>1?C==="require_approval"?"or":"and":"is"})}),m},n=a.amountCriteria,v=a.vendorCriteria,h=a.departmentCriteria,u={};if(n!=null&&n.comparator.selectedOption!=null){const c=n.comparator.selectedOption;u.amount={type:"amount",comparator:c,min:c==="less_than"?void 0:n.min,max:c==="greater_than"?void 0:n.max}}const I=v?.selection.selectedOptions??[];I.length>0&&(u.vendor={type:"vendor",operator:v?.operator.selectedOption??"is",vendorIds:I});const R=h?.selection.selectedOptions??[];if(R.length>0&&(u.department={type:"department",operator:h?.operator.selectedOption??"is",departmentIds:R}),r==="approval_create"){const c={name:a.name,description:a.description,separationOfDuties:a.separationOfDuties,isFallback:a.isFallback,criteria:u,steps:d(a.steps),isApplicableOnPendingApprovalEntity:a.applyToExistingReimbursements.includes("applyToExistingReimbursements")};e(E(c))}else{const c={approvalRuleId:l,name:a.name,description:a.description,separationOfDuties:a.separationOfDuties,isFallback:a.isFallback,criteria:u,steps:d(a.steps),isApplicableOnPendingApprovalEntity:a.applyToExistingReimbursements.includes("applyToExistingReimbursements")};e(E(c))}},onResetClick:()=>{e(A()),r==="approval_update"||i?t("../"):o.allApprovalRules.length===0&&o.fetchState==="Completed"?t("../../setup"):t("../")},onBackClick:()=>{e(A()),r==="approval_update"||i?t("../"):o.allApprovalRules.length===0&&o.fetchState==="Completed"?t("../../setup"):t("../")},onSaveRuleClick:()=>{e(B(!0))},onSaveRuleSuccess:()=>{t("../")},onEditExistingRule:a=>{e(M(a)),t(r==="approval_update"?`../../${a}/edit`:`../${a}/edit`)}}})(G);function ne(){const e=g(t=>K(t)),{isApprovalRulesV3Enabled:s}=W(e?.tenantId);return s?b.jsx(Z,{}):b.jsx(X,{})}function Z(){const e=_(),s=T(),t=O(),{approvalRuleId:p}=k(),o=P.getSignedInUser(),l=N(),r=g(n=>w(n)),i=g(n=>U(n)),[a,d]=f.useState(!1);if(H(),f.useEffect(()=>{a||(d(!0),s(V(!0)))}),f.useEffect(()=>{i.fetchState==="Not-Started"&&e(p!=null?"../../":"../")},[i,p]),o==null)throw Error("Can't access address page without signing in...");return r.approversDetailsFetchStatus.fetchState=="Not-Started"||r.approversDetailsFetchStatus.fetchState==="In-Progress"?b.jsx($,{fetchState:r.approversDetailsFetchStatus.fetchState,style:{backgroundColor:l.colors.grey5}}):b.jsx(Y,{navigate:e,approvalUpdateDataView:r,approvalRuleId:p,approverViewData:i,location:t},p??"new")}export{ne as R,pe as i,H as u};
@@ -1,18 +1,18 @@
1
- import{j as s}from"./liveblocks-BLlSTcoD.js";import{h as W,u as re,g as H,i as X,j as E,N as _,n as J,l as mt,o as ct,p as C}from"./core-CbpoBsNm.js";import{eW as Z,Qh as le,c7 as me,Ej as Be,kC as dt,Ew as ne,Ev as ae,Qi as ut,bn as ce,gn as Te,Qj as pt,ME as bt,kr as je,MF as Se,MG as gt,jm as ht,Py as ft,jB as St,E7 as It,tZ as yt,jt as Rt,ET as De,Qk as Fe,Ql as At,Qm as kt,Qn as vt,Qo as Ct,Qp as Et,ED as Ie,jH as wt,PH as xt,Ex as Bt,Eh as Tt,Qq as jt,Eg as Dt,Qr as Ft,Ep as ye,EH as Ut,EG as Lt,EC as Pt,Qs as Ue,JS as $t,bo as Mt,Es as _t,F9 as Qt,Qt as Nt,Qu as Ot,EP as Gt,EM as Re,P1 as zt,Ee as Ht,Qv as Le,FB as Ae,FJ as Zt,Qw as Vt,Qx as G,Qy as Wt,Qz as Pe,QA as Jt,QB as $e,QC as Me,E$ as se,bu as qt,bK as de,cH as ue,fB as _e,fz as Qe,QD as Kt,fw as Xt,Pe as Yt,QE as en,QF as Ne,Pi as tn,Q0 as nn,QG as an,Qg as sn,FG as ke,FF as on,QH as rn,QI as ln,QJ as mn,QK as cn,QL as dn,PN as un,Fw as pn,FA as bn,bt as gn,bJ as hn,cB as fn,cp as Sn,bs as In,LA as yn,cR as Rn,cT as An,cS as kn,cA as vn}from"./zeni-epic-state-CkeDRiud.js";import{w as Oe,K as Ge,F as Y,x as k,z as $,bY as ze,A as ee,d as v,aH as ve,o as D,at as K,I as Cn,D as He,bZ as En,s as z,_ as Ze,b_ as wn,j as te,b$ as xn,X as Bn,G as Tn,B as pe,f as Ve,a7 as jn,bk as Dn,a2 as Fn,m as We,c0 as Un,a9 as Ln}from"./index-aZImxzjX.js";import{n as Q,S as Pn}from"./mui-DcNGd9L2.js";import ie from"./NotFoundScreen-Bnx2UPHv.js";import{S as Ce}from"./SetupPagesScreen-N7NZbMog.js";import{F as Je}from"./FeaturePreviewScreen-Bbo-4gXG.js";import{a as f}from"./sentry-D_xp3E3Q.js";import{u as be}from"./useAskAiCfoHostNavButtonProps-BZImc5qT.js";import{u as qe}from"./useInitialThreadRequest-DVxzaQcg.js";import{D as $n}from"./DrawerScreen-CfPgZFbu.js";import{M as Ke}from"./MobileAppDrawer-CWBhYKqW.js";import{R as Mn}from"./ReimbursementApprovalRoutes-BwiPly2p.js";import{FallBackRoute as _n}from"./ScreenRoutes-BVhH5D33.js";import"./recharts-C0aThBg3.js";import"./analytics-CQmVOD4d.js";import"./plaid-B62punae.js";import"./dnd-CX5suNP6.js";import"./stripe-DMRn4zHo.js";import"./lottie-BY8e0Ufw.js";import"./lexical-BS7d_1CV.js";import"./pdf-BslZhgI8.js";import"./utils-BQO84dIV.js";import"./analyticsHelper-Bvqx3iRr.js";import"./routePaths-DyIc-n3M.js";import"./BusinessVerificationPageScreen-D2N5zUvV.js";import"./ReimbursementApprovalRuleDetailScreen-CcTmDK2L.js";import"./getLocaleForTenant-9euvow3p.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]="1f9b21a6-6436-4c79-9d25-29dfd063cd1a",e._sentryDebugIdIdentifier="sentry-dbid-1f9b21a6-6436-4c79-9d25-29dfd063cd1a")}catch{}})();const Xe=e=>`/${e}/reimbursements`,Qn=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"})),{spendManagement:{reimbursement:{reimbursementDetail:L}}}=He.getLocalizedStrings(),Nn=J(function(e,t){const n=t.currentTenant?.companyId,r=ut(e.plaidAccountViewState,"user_reimbursement_account"),d=$.getSignedInUser(),c=ce(d),m=r.plaidConnectionDetails,o=Te(e.companyState,n),a=e.tenantState.currentTenantId,i={userId:d?.userId??"",sessionId:d?.zeniSessionId??"",tenantId:a??""},l=le(e,t.reimbursementId),b=pt(e,d?.userId??"");let R=`${d?.firstName} ${d?.lastName}`,h=!0;t.reimbursementId!=null&&(R=`${l.createdBy?.firstName??"Zeni"} ${l.createdBy?.lastName??""}`,h=d?.userId===l.createdBy?.userId);const T=e.entityAutoCompleteState?.autoCompleteText?.common,u=bt(e,"common");return{remiDetails:l,uploadInvoiceEndPoint:`${K.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:R,isUserAdmin:me(t.currentTenant?.userRole??[]),isZeniUser:c,plaidConnectionDetails:m,bankNameByRouting:l.bankNameByRouting,bankAccountCreationState:b.bankAccountCreationState,bankAccounts:b.bankAccounts,analytics:v,bankAccountToCreate:l.bankAccountToCreate,fetchBankNameByRoutingStatus:l.fetchBankNameByRoutingStatus,isSignedInUserReimbursementCreator:h,disableInternalOverlay:t.disableInternalOverlay,showSkipAutoFill:t.showSkipAutoFill,setShowSkipAutoFill:t.setShowSkipAutoFill,isAccountingClassesEnabled:je(e)}},function(e,t){const{reimbursementId:n,currentTenant:r,location:d,navigate:c,themeState:m}=t,{tenantEmailDomain:o}=r,a=$.getSignedInUser();return{onReceiptsUpload:(i,l,b)=>{i!=null&&e(ae(i,l,b,n,a?.userId))},onExistingMerchantChange:(i,l)=>{e(ye(!1,l,n,i,void 0))},fetchDuplicateReimbursement:()=>{a?.userId!=null&&e(Pt(a.userId,!0,n))},clearDuplicateReimbursementDetail:()=>{e(Lt())},clearRemiSaveStatus:()=>{e(Ut("Not-Started",n))},onDuplicateLineClick:(i,l)=>window.open(`/${o}/reimbursement/${i}#L${l}`),onNewMerchantChange:(i,l)=>{e(ye(!1,l,n,void 0,i))},removeFileFromLine:i=>{e(Ft({lineId:i,reimbursementId:n}))},onAmountChanged:(i,l)=>{e(Dt(l,i,n))},updateReimbursementType:(i,l,b)=>{e(jt({reimbursementId:b,lineId:l,reimbursementType:i}))},onHomeCurrencyConversionUpdate:(i,l,b)=>{e(Tt({reimbursementId:b,lineId:l,amountPayload:{amount:i.amount,currency_code:i.currencyCode,currency_symbol:i.currencySymbol}}))},onReimbursementDetailsChanged:i=>{e(Bt({remiDetailLocalData:i,reimbursementId:n}))},saveRemiDetails:i=>{e(Ie(i,!1,n))},onUserBankDetailsUpdated:i=>{const{bankAccountSection:l}=i;e(xt({data:l}))},onFetchBankName:i=>{e(wt(i))},submitRemiDetails:()=>{e(Ie("pending_approval",!0,n))},discardReimbursementDetailsFromLocalStore:i=>{e(Et({reimbursementId:i}))},updateInvoiceUploadFetchState:i=>{e(ne({reimbursementId:n,fetchState:i}))},clearTentativeNameForLine:i=>{e(Ct({reimbursementId:n,lineId:i}))},removeDuplicateReimbursementForLine:i=>{e(vt({lineId:i}))},onZeniLogoClick:()=>{m.toggle()},clearAddRemiAutoFields:i=>{e(kt({reimbursementId:n,lineId:i}))},redirectToReimbursementListScreen:()=>{e(Fe()),e(At());const i=Xe(o),l=z(d.state?.pathnameStackToGoBack,d.pathname);c(i,{state:{pathnameStackToGoBack:l}})},redirectToReimbursementDetailScreen:()=>{t.navigate("../")},deleteReimbursement:()=>{n!=null&&(v.trackReimbursementDeleteReimbursement(n),e(De(n)))},onSaveBankAccount:()=>{a?.userId&&e(Rt(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(St(i,a?.userId??""))},onBackClickFromBankAccountPage:()=>{e(ht({fetchState:"Not-Started"})),e(ft())},customerSearchAutoCompleteActions:{onAutoCompleteInputChange:(i,l)=>{i.trim().length>=2?e(gt({searchString:i,entityType:l,searchOrigin:"common"})):e(Se("common"))},onCancelAutoComplete:()=>{e(Se("common"))}}}})(En);function Ee(){const e=W(),t=re(),n=H(),{reimbursementId:r}=X(),d=Oe(),c=Ge(),[m,o]=f.useState(r==null),[a,i]=f.useState(1),{useFeatureGate:l}=Y(),{isFeatureEnabled:b}=l(k.isLimitedCategoryForReimbursement),{isFeatureEnabled:R}=l(k.isShowDeletedReimbursementsFeatureEnabled),{isFeatureEnabled:h}=l(k.isReimbursementCommentingEnabled),{isAiCfoAccessEnabled:T,onAskAiCfoClick:u}=be({mobileExploreReferrer:"Reimbursement Details"}),w=H().pathname,j=w.includes("edit"),A=w.includes("reimbursement/new"),[F,x]=f.useState(!1),B=$.getSignedInUser(),I=E(p=>Z(p)),g=E(p=>le(p,r)),P=qe(I?.companyId,{clearParams:g.fetchState==="Completed"}),U=me(I?.userRole??[]);f.useEffect(()=>{(A&&!F||j&&g.fetchState!="Completed"&&g.fetchState!="In-Progress")&&(x(!0),t(Be(!1,b,R,r)))});const M=E(p=>dt(p.accountState,p.accountListState,"reimbursementAccountList"));if(B==null)throw Error("Can't access address page without signing in...");const y={pathname:`../${r}`,search:n.search};return g.isDeleted===!0||g.billStage=="paid"||g.billStage=="scheduled"||g.fetchState=="Not-Started"||U&&g.billStatus==="rejected"||U===!1&&g.billStage==="pending_approval"&&g.billStatus!=="rejected"?s.jsx(_,{to:y}):g.deleteStatus.fetchState==="In-Progress"||g.fetchState!=="Completed"?s.jsx(ze,{isNewReimbursement:r==null}):s.jsxs(On,{windowSize:c,children:[s.jsx(ee,{analytics:v,onLoad:p=>(V=>{r!=null&&g.deleteStatus.fetchState!=="Completed"&&V.trackReimbursementEditReimbursement(r)})(p)}),m&&c!=="small"?s.jsx(Gn,{}):null,m&&c!=="small"?s.jsx(zn,{children:s.jsx(ve,{showAutofill:m,uploadInvoiceEndPoint:`${K.communicationAgentMicroServiceBaseUrl}`,authParams:{userId:B?.userId??"",sessionId:B?.zeniSessionId??"",tenantId:I?.tenantId??""},onSkipAutofill:()=>o(!1),onInvoiceUpload:p=>{p!=null&&t(ae(p,a,!0,r,B?.userId))},updateInvoiceUploadFetchState:p=>{t(ne({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:L.dropReceipt.upload,single:L.dropReceipt.single,or:L.dropReceipt.or,multiple:L.dropReceipt.multiple,receipts:L.dropReceipt.receipts}})}):null,m&&c==="small"?s.jsxs(Hn,{children:[s.jsx(Zn,{onClick:()=>o(!1),children:s.jsx(Qn,{})}),s.jsx(ve,{showAutofill:m,uploadInvoiceEndPoint:`${K.communicationAgentMicroServiceBaseUrl}`,authParams:{userId:B?.userId??"",sessionId:B?.zeniSessionId??"",tenantId:I?.tenantId??""},onSkipAutofill:()=>o(!1),onInvoiceUpload:p=>{p!=null&&t(ae(p,a,!0,r,B?.userId))},updateInvoiceUploadFetchState:p=>{t(ne({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:L.dropReceipt.upload,single:L.dropReceipt.single,or:L.dropReceipt.or,multiple:L.dropReceipt.multiple,receipts:L.dropReceipt.receipts}})]}):null,s.jsx(Vn,{windowSize:c,children:s.jsx(Nn,{initialOpenThreadRequest:P??void 0,isReimbursementCommentingEnabled:h,location:n,navigate:e,currentTenant:I,reimbursementId:r,themeState:d,uncategorizedAccounts:M,disableInternalOverlay:!0,showSkipAutoFill:m,setShowSkipAutoFill:o,onCurrentLineIdForUploadChange:i,isAiCfoAccessEnabled:T,onAskAiCfoClick:u})})]})}const On=Q.div`
1
+ import{j as s}from"./liveblocks-BUQfB0Zp.js";import{h as W,u as re,g as H,i as Y,j as C,N as _,n as q,l as mt,o as ct,p as E}from"./core-OMb8nkC1.js";import{eV as Z,Qg as le,c6 as me,Ei as Be,kB as dt,Ev as ne,Eu as ae,Qh as ut,bn as ce,gm as Te,Qi as pt,MD as bt,kq as je,ME as Se,MF as gt,jl as ht,Px as ft,jA as St,E6 as It,tY as yt,js as Rt,ES as De,Qj as Fe,Qk as At,Ql as vt,Qm as kt,Qn as Et,Qo as Ct,EC as Ie,jG as wt,PG as xt,Ew as Bt,Eg as Tt,Qp as jt,Ef as Dt,Qq as Ft,Eo as ye,EG as Ut,EF as Lt,EB as Pt,Qr as Ue,JR as $t,bq as Mt,Er as _t,F8 as Qt,Qs as Nt,Qt as Ot,EO as zt,EL as Re,P0 as Gt,Ed as Ht,Qu as Le,FA as Ae,FI as Zt,Qv as Vt,Qw as z,Qx as Wt,Qy as Pe,Qz as qt,QA as $e,QB as Me,E_ as se,bu as Jt,bK as de,cG as ue,fA as _e,fy as Qe,QC as Kt,fv as Yt,Pd as Xt,QD as en,QE as Ne,Ph as tn,P$ as nn,QF as an,Qf as sn,FF as ve,FE as on,QG as rn,QH as ln,QI as mn,QJ as cn,QK as dn,PM as un,Fv as pn,Fz as bn,bs as gn,bJ as hn,cA as fn,co as Sn,bt as In,Lz as yn,cQ as Rn,cS as An,cR as vn,cz as kn}from"./zeni-epic-state-BZ6N8nVI.js";import{Z as Oe,J as ze,a as X,F as v,z as $,bY as Ge,E as ee,d as k,aH as ke,o as D,at as K,H as En,D as He,bZ as Cn,s as G,_ as Ze,b_ as wn,j as te,b$ as xn,W as Bn,A as Tn,B as pe,f as Ve,a7 as jn,bk as Dn,a2 as Fn,m as We,c0 as Un,a9 as Ln}from"./index-NcZU0lXl.js";import{n as Q,S as Pn}from"./mui-JZY-3hhJ.js";import ie from"./NotFoundScreen-CxRYls3k.js";import{S as Ee}from"./SetupPagesScreen-CPey4cOW.js";import{F as qe}from"./FeaturePreviewScreen-DgqstYkZ.js";import{a as f}from"./sentry-BLIwU6uZ.js";import{u as be}from"./useAskAiCfoHostNavButtonProps-DS5Fxq3U.js";import{u as Je}from"./useInitialThreadRequest-Bh1NrHII.js";import{D as $n}from"./DrawerScreen-DcUdH_zJ.js";import{M as Ke}from"./MobileAppDrawer-B4f1me8_.js";import{R as Mn}from"./ReimbursementApprovalRoutes-CQrzmhSh.js";import{FallBackRoute as _n}from"./ScreenRoutes-D5k4uqAt.js";import"./recharts-DAM4r1-u.js";import"./analytics-BLbM2ksu.js";import"./plaid-B_OuebQv.js";import"./dnd-DVcQZAG5.js";import"./stripe-DMRn4zHo.js";import"./lottie-DDI83OWz.js";import"./lexical-CNfNgAkp.js";import"./pdf-6FZlivdz.js";import"./utils-Bia5qc4p.js";import"./analyticsHelper-BU5wlVa9.js";import"./routePaths-DZldr9mG.js";import"./BusinessVerificationPageScreen-BiV9G1-i.js";import"./ReimbursementApprovalRuleDetailScreen-DTZkQzQY.js";import"./getLocaleForTenant-Bn16hOPH.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]="db7f95b4-2509-4fab-8458-e885c5a6eb55",e._sentryDebugIdIdentifier="sentry-dbid-db7f95b4-2509-4fab-8458-e885c5a6eb55")}catch{}})();const Ye=e=>`/${e}/reimbursements`,Qn=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"})),{spendManagement:{reimbursement:{reimbursementDetail:L}}}=He.getLocalizedStrings(),Nn=q(function(e,t){const n=t.currentTenant?.companyId,r=ut(e.plaidAccountViewState,"user_reimbursement_account"),d=$.getSignedInUser(),c=ce(d),m=r.plaidConnectionDetails,o=Te(e.companyState,n),a=e.tenantState.currentTenantId,i={userId:d?.userId??"",sessionId:d?.zeniSessionId??"",tenantId:a??""},l=le(e,t.reimbursementId),b=pt(e,d?.userId??"");let R=`${d?.firstName} ${d?.lastName}`,h=!0;t.reimbursementId!=null&&(R=`${l.createdBy?.firstName??"Zeni"} ${l.createdBy?.lastName??""}`,h=d?.userId===l.createdBy?.userId);const T=e.entityAutoCompleteState?.autoCompleteText?.common,u=bt(e,"common");return{remiDetails:l,uploadInvoiceEndPoint:`${K.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:R,isUserAdmin:me(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:je(e)}},function(e,t){const{reimbursementId:n,currentTenant:r,location:d,navigate:c,themeState:m}=t,{tenantEmailDomain:o}=r,a=$.getSignedInUser();return{onReceiptsUpload:(i,l,b)=>{i!=null&&e(ae(i,l,b,n,a?.userId))},onExistingMerchantChange:(i,l)=>{e(ye(!1,l,n,i,void 0))},fetchDuplicateReimbursement:()=>{a?.userId!=null&&e(Pt(a.userId,!0,n))},clearDuplicateReimbursementDetail:()=>{e(Lt())},clearRemiSaveStatus:()=>{e(Ut("Not-Started",n))},onDuplicateLineClick:(i,l)=>window.open(`/${o}/reimbursement/${i}#L${l}`),onNewMerchantChange:(i,l)=>{e(ye(!1,l,n,void 0,i))},removeFileFromLine:i=>{e(Ft({lineId:i,reimbursementId:n}))},onAmountChanged:(i,l)=>{e(Dt(l,i,n))},updateReimbursementType:(i,l,b)=>{e(jt({reimbursementId:b,lineId:l,reimbursementType:i}))},onHomeCurrencyConversionUpdate:(i,l,b)=>{e(Tt({reimbursementId:b,lineId:l,amountPayload:{amount:i.amount,currency_code:i.currencyCode,currency_symbol:i.currencySymbol}}))},onReimbursementDetailsChanged:i=>{e(Bt({remiDetailLocalData:i,reimbursementId:n}))},saveRemiDetails:i=>{e(Ie(i,!1,n))},onUserBankDetailsUpdated:i=>{const{bankAccountSection:l}=i;e(xt({data:l}))},onFetchBankName:i=>{e(wt(i))},submitRemiDetails:()=>{e(Ie("pending_approval",!0,n))},discardReimbursementDetailsFromLocalStore:i=>{e(Ct({reimbursementId:i}))},updateInvoiceUploadFetchState:i=>{e(ne({reimbursementId:n,fetchState:i}))},clearTentativeNameForLine:i=>{e(Et({reimbursementId:n,lineId:i}))},removeDuplicateReimbursementForLine:i=>{e(kt({lineId:i}))},onZeniLogoClick:()=>{m.toggle()},clearAddRemiAutoFields:i=>{e(vt({reimbursementId:n,lineId:i}))},redirectToReimbursementListScreen:()=>{e(Fe()),e(At());const i=Ye(o),l=G(d.state?.pathnameStackToGoBack,d.pathname);c(i,{state:{pathnameStackToGoBack:l}})},redirectToReimbursementDetailScreen:()=>{t.navigate("../")},deleteReimbursement:()=>{n!=null&&(k.trackReimbursementDeleteReimbursement(n),e(De(n)))},onSaveBankAccount:()=>{a?.userId&&e(Rt(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(St(i,a?.userId??""))},onBackClickFromBankAccountPage:()=>{e(ht({fetchState:"Not-Started"})),e(ft())},customerSearchAutoCompleteActions:{onAutoCompleteInputChange:(i,l)=>{i.trim().length>=2?e(gt({searchString:i,entityType:l,searchOrigin:"common"})):e(Se("common"))},onCancelAutoComplete:()=>{e(Se("common"))}}}})(Cn);function Ce(){const e=W(),t=re(),n=H(),{reimbursementId:r}=Y(),d=Oe(),c=ze(),[m,o]=f.useState(r==null),[a,i]=f.useState(1),{useFeatureGate:l}=X(),{isFeatureEnabled:b}=l(v.isLimitedCategoryForReimbursement),{isFeatureEnabled:R}=l(v.isShowDeletedReimbursementsFeatureEnabled),{isFeatureEnabled:h}=l(v.isReimbursementCommentingEnabled),{isAiCfoAccessEnabled:T,onAskAiCfoClick:u}=be({mobileExploreReferrer:"Reimbursement Details"}),w=H().pathname,j=w.includes("edit"),A=w.includes("reimbursement/new"),[F,x]=f.useState(!1),B=$.getSignedInUser(),I=C(p=>Z(p)),g=C(p=>le(p,r)),P=Je(I?.companyId,{clearParams:g.fetchState==="Completed"}),U=me(I?.userRole??[]);f.useEffect(()=>{(A&&!F||j&&g.fetchState!="Completed"&&g.fetchState!="In-Progress")&&(x(!0),t(Be(!1,b,R,r)))});const M=C(p=>dt(p.accountState,p.accountListState,"reimbursementAccountList"));if(B==null)throw Error("Can't access address page without signing in...");const y={pathname:`../${r}`,search:n.search};return g.isDeleted===!0||g.billStage=="paid"||g.billStage=="scheduled"||g.fetchState=="Not-Started"||U&&g.billStatus==="rejected"||U===!1&&g.billStage==="pending_approval"&&g.billStatus!=="rejected"?s.jsx(_,{to:y}):g.deleteStatus.fetchState==="In-Progress"||g.fetchState!=="Completed"?s.jsx(Ge,{isNewReimbursement:r==null}):s.jsxs(On,{windowSize:c,children:[s.jsx(ee,{analytics:k,onLoad:p=>(V=>{r!=null&&g.deleteStatus.fetchState!=="Completed"&&V.trackReimbursementEditReimbursement(r)})(p)}),m&&c!=="small"?s.jsx(zn,{}):null,m&&c!=="small"?s.jsx(Gn,{children:s.jsx(ke,{showAutofill:m,uploadInvoiceEndPoint:`${K.communicationAgentMicroServiceBaseUrl}`,authParams:{userId:B?.userId??"",sessionId:B?.zeniSessionId??"",tenantId:I?.tenantId??""},onSkipAutofill:()=>o(!1),onInvoiceUpload:p=>{p!=null&&t(ae(p,a,!0,r,B?.userId))},updateInvoiceUploadFetchState:p=>{t(ne({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:L.dropReceipt.upload,single:L.dropReceipt.single,or:L.dropReceipt.or,multiple:L.dropReceipt.multiple,receipts:L.dropReceipt.receipts}})}):null,m&&c==="small"?s.jsxs(Hn,{children:[s.jsx(Zn,{onClick:()=>o(!1),children:s.jsx(Qn,{})}),s.jsx(ke,{showAutofill:m,uploadInvoiceEndPoint:`${K.communicationAgentMicroServiceBaseUrl}`,authParams:{userId:B?.userId??"",sessionId:B?.zeniSessionId??"",tenantId:I?.tenantId??""},onSkipAutofill:()=>o(!1),onInvoiceUpload:p=>{p!=null&&t(ae(p,a,!0,r,B?.userId))},updateInvoiceUploadFetchState:p=>{t(ne({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:L.dropReceipt.upload,single:L.dropReceipt.single,or:L.dropReceipt.or,multiple:L.dropReceipt.multiple,receipts:L.dropReceipt.receipts}})]}):null,s.jsx(Vn,{windowSize:c,children:s.jsx(Nn,{initialOpenThreadRequest:P??void 0,isReimbursementCommentingEnabled:h,location:n,navigate:e,currentTenant:I,reimbursementId:r,themeState:d,uncategorizedAccounts:M,disableInternalOverlay:!0,showSkipAutoFill:m,setShowSkipAutoFill:o,onCurrentLineIdForUploadChange:i,isAiCfoAccessEnabled:T,onAskAiCfoClick:u})})]})}const On=Q.div`
2
2
  display: flex;
3
3
  position: relative;
4
4
  height: 100vh;
5
5
  flex-direction: ${e=>e.windowSize==="small"?"column":"row"};
6
6
  background-color: ${e=>e.theme.colors.grey4};
7
- `,Gn=Q.div`
7
+ `,zn=Q.div`
8
8
  position: fixed;
9
9
  top: 0;
10
10
  left: 0;
11
11
  right: 0;
12
12
  bottom: 0;
13
- background-color: ${Cn.overlayBackgroundBlack};
13
+ background-color: ${En.overlayBackgroundBlack};
14
14
  z-index: 5;
15
- `,zn=Q.div`
15
+ `,Gn=Q.div`
16
16
  position: absolute;
17
17
  top: 0;
18
18
  left: 0;
@@ -53,7 +53,7 @@ import{j as s}from"./liveblocks-BLlSTcoD.js";import{h as W,u as re,g as H,i as X
53
53
  flex-direction: column;
54
54
  width: 100%;
55
55
  ${e=>e.windowSize!=="small"?"overflow: auto;":""}
56
- `,Wn=J(function(e,t){const n=Ue(e,t.reimbursementId),r=$.getSignedInUser(),d=ce(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=Nt(n.remiActivities,Ot(t.currentTenant),r));const i=me(t.currentTenant?.userRole??[]),l=r?.userId===n.createdBy?.userId;return{remiDetails:n,uploadInvoiceEndPoint:`${K.communicationAgentMicroServiceBaseUrl}`,authParams:m,signedInUser:r,createdBy:o,isRealTimeApprovalEnabled:t.isRealTimeApprovalEnabled,isAdmin:i,showApproveRejectBtns:a,isZeniUser:d,isSignedInUserReimbursementCreator:l,isAccountingClassesEnabled:je(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(Fe());const a=Xe(o),i=z(d.state?.pathnameStackToGoBack,d.pathname);c(a,{state:{pathnameStackToGoBack:i}})},onSaveRealTimeApprovals:a=>{e(Ht(n,"reimbursement",a))},updateEditRealTimeApproverClicked:a=>{e(zt({isEdit:a,entityId:n,entityType:"reimbursement"}))},approveOrRejectRemi:a=>{a.type==="approved"?e(Re(n,a.type,"")):e(Re(n,a.type,a.description??""))},redirectToEditableReimbursementScreen:()=>{const a=z(d.state?.pathnameStackToGoBack,d.pathname);c("./edit",{state:{pathnameStackToGoBack:a}})},deleteReimbursement:()=>{v.trackReimbursementDeleteReimbursement(n),e(De(n))},cancelAndDeleteReport:a=>{a===!0?v.trackReimbursementCancelAndDeleteReimbursement(n):v.trackReimbursementCancelReimbursement(n),e(Gt(n,a))},handleZeniLogoClick:()=>{m.toggle()}}})(wn);function Jn(){const e=W(),t=re(),n=H(),r=n.hash.substring(1),d=Oe(),{reimbursementId:c}=X(),m=$.getSignedInUser(),o=E(y=>Z(y)),a=E(y=>Ue(y,c??"")),i=a.remiDetails?.reimbursementInfo.stage.code==="draft",l=qe(o?.companyId,{clearParams:a.fetchState==="Completed"&&!i}),{isAiCfoAccessEnabled:b,onAskAiCfoClick:R}=be({mobileExploreReferrer:"Reimbursement Details"});Ze({isDataReady:a.fetchState==="Completed"});const{useFeatureGate:h}=Y(),{isFeatureEnabled:T}=h(k.isLimitedCategoryForReimbursement),[u,w]=f.useState(!1),[j,A]=f.useState(!1),[F,x]=f.useState(!1),{isFeatureEnabled:B}=h(k.isReimbursementCommentingEnabled),{isFeatureEnabled:I}=h(k.isShowDeletedReimbursementsFeatureEnabled),g=E(y=>le(y,c??"")),P=$t(o),U=Mt(o.userRole),M=a.fetchState;if(f.useEffect(()=>{u||c==null?u==1&&M==="Error"&&e("page-not-found",{replace:!0}):(w(!0),t(_t(c,!1,I)))},[u,c,t,M]),f.useEffect(()=>{I&&a.remiDetails?.isDeleted===!0||o.isZeni===!0&&m?.userEmailDomain==="zeni.ai"&&P===!1?x(!1):x(a.remiActivities[0]?.isRealTimeApprovalEnabled&&(U||a.allApprovers.find(y=>y.user.userId===m?.userId)!=null||a.remiDetails?.lastUpdatedBy===m?.userId))},[a.remiActivities[0]?.isRealTimeApprovalEnabled,a.allApprovers,a.remiDetails?.lastUpdatedBy,U,o.isZeni,P,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"||(A(!0),t(Be(!1,T,I,c)),a.remiActivities[0]?.isRealTimeApprovalEnabled===!0&&t(Qt(!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(ze,{}):s.jsxs(s.Fragment,{children:[s.jsx(ee,{analytics:v,onLoad:y=>(p=>{c!=null&&p.trackReimbursementReimbursementDetails(c)})(y)}),s.jsx(Wn,{initialOpenThreadRequest:l??void 0,scrollId:r,isReimbursementCommentingEnabled:B,isShowDeletedReimbursementEnabled:I,location:n,navigate:e,isRealTimeApprovalEnabled:F,currentTenant:o,reimbursementId:c??"",themeState:d,isAiCfoAccessEnabled:b,onAskAiCfoClick:R})]})}const qn=J(function(e,t){return{remisReviewView:Le(e),analytics:t.analytics}},function(e,t){return{onCloseOverlay:()=>{t.navigate("./"),e(G())},onCloseReviewItem:n=>{e(Vt(n))},onProceedForBulkActionClick:(n,r)=>{switch(n){case"send_for_approval":e(Zt());break;case"approve":e(Ae("approved",r??""));break;case"reject":e(Ae("rejected",r??""))}}}})(xn);function Kn(){const e=W(),t=E(c=>c.remisBulkActionViewState.bulkSubmissionFetchState.fetchState),{remisForReview:n}=E(c=>Le(c)),r=te(),d=r?.loggedInUserRole?.includes("admin")===!0;return f.useEffect(()=>{t!=="Completed"&&n.length!==0||e("./")},[t,n.length]),s.jsx(qn,{navigate:e,analytics:v,isAdmin:d})}const O=tn(),Ye="bulk-operation-update",oe="reimbursement-approval-rule-update",{spendManagement:Xn,common:we}=He.getLocalizedStrings(),xe=Xn.reimbursement.bulkActions,Yn=Q.div`
56
+ `,Wn=q(function(e,t){const n=Ue(e,t.reimbursementId),r=$.getSignedInUser(),d=ce(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=Nt(n.remiActivities,Ot(t.currentTenant),r));const i=me(t.currentTenant?.userRole??[]),l=r?.userId===n.createdBy?.userId;return{remiDetails:n,uploadInvoiceEndPoint:`${K.communicationAgentMicroServiceBaseUrl}`,authParams:m,signedInUser:r,createdBy:o,isRealTimeApprovalEnabled:t.isRealTimeApprovalEnabled,isAdmin:i,showApproveRejectBtns:a,isZeniUser:d,isSignedInUserReimbursementCreator:l,isAccountingClassesEnabled:je(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(Fe());const a=Ye(o),i=G(d.state?.pathnameStackToGoBack,d.pathname);c(a,{state:{pathnameStackToGoBack:i}})},onSaveRealTimeApprovals:a=>{e(Ht(n,"reimbursement",a))},updateEditRealTimeApproverClicked:a=>{e(Gt({isEdit:a,entityId:n,entityType:"reimbursement"}))},approveOrRejectRemi:a=>{a.type==="approved"?e(Re(n,a.type,"")):e(Re(n,a.type,a.description??""))},redirectToEditableReimbursementScreen:()=>{const a=G(d.state?.pathnameStackToGoBack,d.pathname);c("./edit",{state:{pathnameStackToGoBack:a}})},deleteReimbursement:()=>{k.trackReimbursementDeleteReimbursement(n),e(De(n))},cancelAndDeleteReport:a=>{a===!0?k.trackReimbursementCancelAndDeleteReimbursement(n):k.trackReimbursementCancelReimbursement(n),e(zt(n,a))},handleZeniLogoClick:()=>{m.toggle()}}})(wn);function qn(){const e=W(),t=re(),n=H(),r=n.hash.substring(1),d=Oe(),{reimbursementId:c}=Y(),m=$.getSignedInUser(),o=C(y=>Z(y)),a=C(y=>Ue(y,c??"")),i=a.remiDetails?.reimbursementInfo.stage.code==="draft",l=Je(o?.companyId,{clearParams:a.fetchState==="Completed"&&!i}),{isAiCfoAccessEnabled:b,onAskAiCfoClick:R}=be({mobileExploreReferrer:"Reimbursement Details"});Ze({isDataReady:a.fetchState==="Completed"});const{useFeatureGate:h}=X(),{isFeatureEnabled:T}=h(v.isLimitedCategoryForReimbursement),[u,w]=f.useState(!1),[j,A]=f.useState(!1),[F,x]=f.useState(!1),{isFeatureEnabled:B}=h(v.isReimbursementCommentingEnabled),{isFeatureEnabled:I}=h(v.isShowDeletedReimbursementsFeatureEnabled),g=C(y=>le(y,c??"")),P=$t(o),U=Mt(o.userRole),M=a.fetchState;if(f.useEffect(()=>{u||c==null?u==1&&M==="Error"&&e("page-not-found",{replace:!0}):(w(!0),t(_t(c,!1,I)))},[u,c,t,M]),f.useEffect(()=>{I&&a.remiDetails?.isDeleted===!0||o.isZeni===!0&&m?.userEmailDomain==="zeni.ai"&&P===!1?x(!1):x(a.remiActivities[0]?.isRealTimeApprovalEnabled&&(U||a.allApprovers.find(y=>y.user.userId===m?.userId)!=null||a.remiDetails?.lastUpdatedBy===m?.userId))},[a.remiActivities[0]?.isRealTimeApprovalEnabled,a.allApprovers,a.remiDetails?.lastUpdatedBy,U,o.isZeni,P,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"||(A(!0),t(Be(!1,T,I,c)),a.remiActivities[0]?.isRealTimeApprovalEnabled===!0&&t(Qt(!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(Ge,{}):s.jsxs(s.Fragment,{children:[s.jsx(ee,{analytics:k,onLoad:y=>(p=>{c!=null&&p.trackReimbursementReimbursementDetails(c)})(y)}),s.jsx(Wn,{initialOpenThreadRequest:l??void 0,scrollId:r,isReimbursementCommentingEnabled:B,isShowDeletedReimbursementEnabled:I,location:n,navigate:e,isRealTimeApprovalEnabled:F,currentTenant:o,reimbursementId:c??"",themeState:d,isAiCfoAccessEnabled:b,onAskAiCfoClick:R})]})}const Jn=q(function(e,t){return{remisReviewView:Le(e),analytics:t.analytics}},function(e,t){return{onCloseOverlay:()=>{t.navigate("./"),e(z())},onCloseReviewItem:n=>{e(Vt(n))},onProceedForBulkActionClick:(n,r)=>{switch(n){case"send_for_approval":e(Zt());break;case"approve":e(Ae("approved",r??""));break;case"reject":e(Ae("rejected",r??""))}}}})(xn);function Kn(){const e=W(),t=C(c=>c.remisBulkActionViewState.bulkSubmissionFetchState.fetchState),{remisForReview:n}=C(c=>Le(c)),r=te(),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=tn(),Xe="bulk-operation-update",oe="reimbursement-approval-rule-update",{spendManagement:Yn,common:we}=He.getLocalizedStrings(),xe=Yn.reimbursement.bulkActions,Xn=Q.div`
57
57
  display: flex;
58
58
  min-height: 100%;
59
59
  width: 100%;
@@ -61,8 +61,8 @@ import{j as s}from"./liveblocks-BLlSTcoD.js";import{h as W,u as re,g as H,i as X
61
61
  flex-direction: column;
62
62
  align-items: center;
63
63
  background-color: ${e=>e.theme.colors.grey4};
64
- `,ea=J(function(e,t){const n=Me(e,O,t.isBulkActionEnabled);let r=n.allSubTabs;const d=$.getSignedInUser(),c=ce(d),m=e.tenantState.currentTenantId,o=Z(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,R=nn(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:v,uiState:n.uiState,searchText:n.searchText,filters:n.filters,downloadParams:{authParams:i,companyName:a,timePeriod:O,spendManagementEndPoint:`${Fn}/spendManagement`,isShowDeletedBillsEnabled:t.isShowDeletedBillsEnabled,isShowDeletedReimbursementEnabled:t.isShowDeletedReimbursementEnabled},downloadState:l,isBulkActionAllowed:n.remiListBulkActionInfo?.isBulkActionAllowed,transactionsSelectedForBulkAction:n.remiListBulkActionInfo?.remisSelectedForBulkAction,allowedBulkActions:n.remiListBulkActionInfo?.allowedBulkActions,remiApprovalRulesAffectedEntityIds:R.affectedEntityIds}},function(e,t){const{navigate:n,currentTenant:r,location:d,period:c}=t,{tenantEmailDomain:m}=r;return{updateTabToState:o=>{e(G()),e(Pe(o))},onSubtabChange:o=>{e(G()),e($e(o))},onTransactionClick:(o,a)=>{const i=aa(m,o,a),l=z(d.state?.pathnameStackToGoBack,d.pathname);n(i,{state:{pathnameStackToGoBack:l}})},onClickSetupIcon:()=>{const o=na(m),a=z(d.state?.pathnameStackToGoBack,d.pathname);n(o,{state:{pathnameStackToGoBack:a}})},onAddTransactionClick:()=>{const{tenantEmailDomain:o}=t.currentTenant;v?.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(dn({uiState:{sortKey:o,sortOrder:a},period:t.period}))},onSearchTextChanged:o=>{e(cn(o))},onFiltersChange:o=>{e(mn({filters:o})),o.categories.every(a=>a.field!=null&&a.values?.length!==0)&&v.trackSpendManagmentFilterChange("reimbursement",o.categories.map(a=>`${a.field}-${JSON.stringify(a.values)}`))},updateDownloadStateHandler:o=>{o==="In-Progress"&&v.trackSpendManagementDownloadClick("reimbursement"),e(ln({uiState:{downloadState:o}}))},onReloadTransactions:()=>{e(se(c,!0,t.isShowDeletedReimbursementEnabled,!1,!0))},onBackClick:()=>{n("../",{relative:"path"})},onNavigateToSettings:()=>{n("../reimbursements/setup")},updateBulkActionList:o=>{e(rn(o))},removeAllTransactionsFromBulkActionList:()=>{e(G())},onProceedForBulkActionClick:(o,a)=>{switch(o){case"delete":case"cancel":e(on(o,a??""));break;case"send_for_approval":e(ke("send_for_approval")),t.navigate("./bulk-review");break;case"review":e(ke("approve")),t.navigate("./bulk-review")}},onReimbursementApprovalRulesEventReceived:o=>{o.endsWith(oe)&&e(sn(!1))},onEventReceived:o=>{o===Ye&&e(an())}}})(jn(Dn));function ta(){const e=W(),t=re(),n=H(),r=n.state,d=Ge(),[c,m]=f.useState(null),o=mt("/:tenantEmailDomain/reimbursements/bulk-review")!=null;f.useEffect(()=>{if(r?.tab!=null&&r?.subTab!=null){const S=Wt(r.tab.toString());S!=null?t(Pe(S)):console.log("Warning:Not a valid remiListTab");const N=Jt(r.subTab.toString());N!=null?t($e(N)):console.log("Warning:Not a valid remiListSubTab")}return()=>{t(G())}},[]);const{useFeatureGate:a}=Y(),{isFeatureEnabled:i}=a(k.isShowDeletedBillsFeatureEnabled),{isFeatureEnabled:l}=a(k.isShowDeletedReimbursementsFeatureEnabled),{isFeatureEnabled:b}=a(k.isBillPayCommentingEnabled),{isFeatureEnabled:R}=a(k.isReimbursementCommentingEnabled),{isFeatureEnabled:h}=a(k.isReimbursementBulkActionEnabled),T=$.getSignedInUser(),u=E(S=>Z(S)),[w,j]=f.useState(!1),[A,F]=f.useState(!1),x=te(),B=x?.loggedInUserRole?.includes("admin")===!0,I=E(S=>Me(S,O,h)),{areTenantIdsInSync:g}=Bn(),P=I.fetchState,{isAiCfoAccessEnabled:U,onAskAiCfoClick:M}=be({mobileExploreReferrer:"Reimbursement List"});if(Ze({isDataReady:P==="Completed"}),f.useEffect(()=>{!A&&g&&(F(!0),t(se(O,!0,l,!1,!0)))},[A,O,t,g]),T==null)throw Error("Can't access address page without signing in...");const y=!!u?.userRole&&qt(u),p=de(x?.loggedInUserRoleMap),V=ue(x?.loggedInUserRoleMap),et=!!u.userReimbursementInfo?.isReimbursementTOSAccepted,tt=!!u.companyReimbursementInfo?.info?.isReimbursementEnabled,nt=!!u.companyReimbursementInfo?.info?.isReimbursementTOSAccepted,at=E(S=>Te(S.companyState,u.companyId)),st=at?.company.featuresActivationInfo.connectedAccountProvider,ge=S=>{j(S)},{isFeatureEnabled:it}=a(k.isDebitCardFeatureEnabled),ot=_e(it,u),rt=Qe(u),{remisProcessed:q,remisProcessing:he}=E(S=>Kt(S));f.useEffect(()=>{q===he&&c!=null&&(t(Xt({messageSection:"reimbursement_bulk_processed",messageText:"success",type:"success",showStatusIcon:!0,variables:[{variableName:"_report_",variableValue:q>1?xe.reports:xe.report},{variableName:"_has_",variableValue:q>1?we.texts.have:we.texts.has},{variableName:"_action_",variableValue:Yt(c)}]})),t(en()),setTimeout(()=>{t(se(O,!0,l,!1,!0,!0))},3e3),m(null))},[q,he]);const lt={events:u.companyId!=null?[`private-encrypted-${u.companyId}.${Ye}`,`private-encrypted-${u.companyId}.${oe}`]:[],eventCallback:(S,N,fe)=>{S.endsWith(oe)?fe.onReimbursementApprovalRulesEventReceived?.(S):N.entity_type==="reimbursement"&&(m(N.operation_type),fe.onEventReceived(S))}};return n.pathname.endsWith("/reimbursements/")||n.pathname.endsWith("/reimbursements")||n.pathname.endsWith("/reimbursements/bulk-review")?ot===!0||rt===!0?s.jsx(Je,{}):tt&&(!y||p)||V&&et?s.jsxs(s.Fragment,{children:[P==="Completed"?s.jsx(ee,{analytics:v,onLoad:S=>(N=>N.trackPageLoaded(Ve.Event.reimbursementHome))(S)}):null,s.jsx(Ke,{isAppContentDrawerOpen:w,handleDrawerToggle:ge}),s.jsxs(Yn,{windowSize:d,children:[s.jsx($n,{isOpen:o,drawerLeftMargin:new Tn(0,0,300,600),onClose:()=>{e("./"),t(G())},children:s.jsx(sa,{onClick:S=>S.stopPropagation(),children:s.jsx(Kn,{})})}),s.jsx(ea,{isShowDeletedBillsEnabled:i,isShowDeletedReimbursementEnabled:l,isBillPayCommentingEnabled:b,isReimbursementCommentingEnabled:R,location:n,navigate:e,currentTenant:u,period:O,isAdmin:B,isEmployee:y,entity:"reimbursement",onClickMenuIcon:()=>{ge(!0)},createdByUserList:I.createdByUserList,createdByUserListFetchState:I.createdByUserListFetchState,isDownloadEnabled:I.isDownloadEnabled,connectedAccountProvider:st,isBulkActionEnabled:h,bulkSubmissionLimit:I.remiBulkSubmissionLimit,bulkSubmissionFetchState:I.remiListBulkActionInfo.bulkSubmissionFetchState,isAiCfoAccessEnabled:U,onAskAiCfoClick:M,...lt})]})]}):nt&&p?s.jsx(_,{to:"../setup"}):x!=null&&Ne(u,x.loggedInUserRoleMap)?s.jsx(_,{to:"../promo"}):s.jsx(pe,{fetchState:"In-Progress"}):s.jsx(ie,{})}const na=e=>`/${e}/reimbursements/setup`,aa=(e,t,n)=>{let r=`/${e}/reimbursement/${encodeURIComponent(t)}`;return n=="draft"&&(r+="/edit"),r},sa=Q(Pn)`
64
+ `,ea=q(function(e,t){const n=Me(e,O,t.isBulkActionEnabled);let r=n.allSubTabs;const d=$.getSignedInUser(),c=ce(d),m=e.tenantState.currentTenantId,o=Z(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,R=nn(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:`${Fn}/spendManagement`,isShowDeletedBillsEnabled:t.isShowDeletedBillsEnabled,isShowDeletedReimbursementEnabled:t.isShowDeletedReimbursementEnabled},downloadState:l,isBulkActionAllowed:n.remiListBulkActionInfo?.isBulkActionAllowed,transactionsSelectedForBulkAction:n.remiListBulkActionInfo?.remisSelectedForBulkAction,allowedBulkActions:n.remiListBulkActionInfo?.allowedBulkActions,remiApprovalRulesAffectedEntityIds:R.affectedEntityIds}},function(e,t){const{navigate:n,currentTenant:r,location:d,period:c}=t,{tenantEmailDomain:m}=r;return{updateTabToState:o=>{e(z()),e(Pe(o))},onSubtabChange:o=>{e(z()),e($e(o))},onTransactionClick:(o,a)=>{const i=aa(m,o,a),l=G(d.state?.pathnameStackToGoBack,d.pathname);n(i,{state:{pathnameStackToGoBack:l}})},onClickSetupIcon:()=>{const o=na(m),a=G(d.state?.pathnameStackToGoBack,d.pathname);n(o,{state:{pathnameStackToGoBack:a}})},onAddTransactionClick:()=>{const{tenantEmailDomain:o}=t.currentTenant;k?.trackReimbursementNewReimbursement();const a=`/${o}/reimbursement/new`,i=G(t.location.state?.pathnameStackToGoBack,t.location.pathname);t.navigate(a,{state:{pathnameStackToGoBack:i}})},onColumnSortConfigChanged:(o,a)=>{e(dn({uiState:{sortKey:o,sortOrder:a},period:t.period}))},onSearchTextChanged:o=>{e(cn(o))},onFiltersChange:o=>{e(mn({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(ln({uiState:{downloadState:o}}))},onReloadTransactions:()=>{e(se(c,!0,t.isShowDeletedReimbursementEnabled,!1,!0))},onBackClick:()=>{n("../",{relative:"path"})},onNavigateToSettings:()=>{n("../reimbursements/setup")},updateBulkActionList:o=>{e(rn(o))},removeAllTransactionsFromBulkActionList:()=>{e(z())},onProceedForBulkActionClick:(o,a)=>{switch(o){case"delete":case"cancel":e(on(o,a??""));break;case"send_for_approval":e(ve("send_for_approval")),t.navigate("./bulk-review");break;case"review":e(ve("approve")),t.navigate("./bulk-review")}},onReimbursementApprovalRulesEventReceived:o=>{o.endsWith(oe)&&e(sn(!1))},onEventReceived:o=>{o===Xe&&e(an())}}})(jn(Dn));function ta(){const e=W(),t=re(),n=H(),r=n.state,d=ze(),[c,m]=f.useState(null),o=mt("/:tenantEmailDomain/reimbursements/bulk-review")!=null;f.useEffect(()=>{if(r?.tab!=null&&r?.subTab!=null){const S=Wt(r.tab.toString());S!=null?t(Pe(S)):console.log("Warning:Not a valid remiListTab");const N=qt(r.subTab.toString());N!=null?t($e(N)):console.log("Warning:Not a valid remiListSubTab")}return()=>{t(z())}},[]);const{useFeatureGate:a}=X(),{isFeatureEnabled:i}=a(v.isShowDeletedBillsFeatureEnabled),{isFeatureEnabled:l}=a(v.isShowDeletedReimbursementsFeatureEnabled),{isFeatureEnabled:b}=a(v.isBillPayCommentingEnabled),{isFeatureEnabled:R}=a(v.isReimbursementCommentingEnabled),{isFeatureEnabled:h}=a(v.isReimbursementBulkActionEnabled),T=$.getSignedInUser(),u=C(S=>Z(S)),[w,j]=f.useState(!1),[A,F]=f.useState(!1),x=te(),B=x?.loggedInUserRole?.includes("admin")===!0,I=C(S=>Me(S,O,h)),{areTenantIdsInSync:g}=Bn(),P=I.fetchState,{isAiCfoAccessEnabled:U,onAskAiCfoClick:M}=be({mobileExploreReferrer:"Reimbursement List"});if(Ze({isDataReady:P==="Completed"}),f.useEffect(()=>{!A&&g&&(F(!0),t(se(O,!0,l,!1,!0)))},[A,O,t,g]),T==null)throw Error("Can't access address page without signing in...");const y=!!u?.userRole&&Jt(u),p=de(x?.loggedInUserRoleMap),V=ue(x?.loggedInUserRoleMap),et=!!u.userReimbursementInfo?.isReimbursementTOSAccepted,tt=!!u.companyReimbursementInfo?.info?.isReimbursementEnabled,nt=!!u.companyReimbursementInfo?.info?.isReimbursementTOSAccepted,at=C(S=>Te(S.companyState,u.companyId)),st=at?.company.featuresActivationInfo.connectedAccountProvider,ge=S=>{j(S)},{isFeatureEnabled:it}=a(v.isDebitCardFeatureEnabled),ot=_e(it,u),rt=Qe(u),{remisProcessed:J,remisProcessing:he}=C(S=>Kt(S));f.useEffect(()=>{J===he&&c!=null&&(t(Yt({messageSection:"reimbursement_bulk_processed",messageText:"success",type:"success",showStatusIcon:!0,variables:[{variableName:"_report_",variableValue:J>1?xe.reports:xe.report},{variableName:"_has_",variableValue:J>1?we.texts.have:we.texts.has},{variableName:"_action_",variableValue:Xt(c)}]})),t(en()),setTimeout(()=>{t(se(O,!0,l,!1,!0,!0))},3e3),m(null))},[J,he]);const lt={events:u.companyId!=null?[`private-encrypted-${u.companyId}.${Xe}`,`private-encrypted-${u.companyId}.${oe}`]:[],eventCallback:(S,N,fe)=>{S.endsWith(oe)?fe.onReimbursementApprovalRulesEventReceived?.(S):N.entity_type==="reimbursement"&&(m(N.operation_type),fe.onEventReceived(S))}};return n.pathname.endsWith("/reimbursements/")||n.pathname.endsWith("/reimbursements")||n.pathname.endsWith("/reimbursements/bulk-review")?ot===!0||rt===!0?s.jsx(qe,{}):tt&&(!y||p)||V&&et?s.jsxs(s.Fragment,{children:[P==="Completed"?s.jsx(ee,{analytics:k,onLoad:S=>(N=>N.trackPageLoaded(Ve.Event.reimbursementHome))(S)}):null,s.jsx(Ke,{isAppContentDrawerOpen:w,handleDrawerToggle:ge}),s.jsxs(Xn,{windowSize:d,children:[s.jsx($n,{isOpen:o,drawerLeftMargin:new Tn(0,0,300,600),onClose:()=>{e("./"),t(z())},children:s.jsx(sa,{onClick:S=>S.stopPropagation(),children:s.jsx(Kn,{})})}),s.jsx(ea,{isShowDeletedBillsEnabled:i,isShowDeletedReimbursementEnabled:l,isBillPayCommentingEnabled:b,isReimbursementCommentingEnabled:R,location:n,navigate:e,currentTenant:u,period:O,isAdmin:B,isEmployee:y,entity:"reimbursement",onClickMenuIcon:()=>{ge(!0)},createdByUserList:I.createdByUserList,createdByUserListFetchState:I.createdByUserListFetchState,isDownloadEnabled:I.isDownloadEnabled,connectedAccountProvider:st,isBulkActionEnabled:h,bulkSubmissionLimit:I.remiBulkSubmissionLimit,bulkSubmissionFetchState:I.remiListBulkActionInfo.bulkSubmissionFetchState,isAiCfoAccessEnabled:U,onAskAiCfoClick:M,...lt})]})]}):nt&&p?s.jsx(_,{to:"../setup"}):x!=null&&Ne(u,x.loggedInUserRoleMap)?s.jsx(_,{to:"../promo"}):s.jsx(pe,{fetchState:"In-Progress"}):s.jsx(ie,{})}const na=e=>`/${e}/reimbursements/setup`,aa=(e,t,n)=>{let r=`/${e}/reimbursement/${encodeURIComponent(t)}`;return n=="draft"&&(r+="/edit"),r},sa=Q(Pn)`
65
65
  display: flex;
66
66
  min-height: 100%;
67
67
  flex-direction: column;
68
- `,ia=J(function(e,t){const{companyId:n}=t;return{reimbursementSetupView:un(e,n),analytics:v,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(bn(n))},onCreateNewRemiButtonClick:()=>{e(pn(t.userRoleId))},onBackClick:()=>{r("../..",{relative:"path"})},onSetupReimbursementSuccess:()=>{t.isEmployee?r("../../reimbursement/new",{relative:"path"}):r("../reimbursements/setup",{relative:"path"})}}})(Un),oa=()=>{const e=W(),t=H(),{tenantEmailDomain:n}=X(),r=We(),[d,c]=f.useState(!1),m=E(A=>Z(A)),o=$.getSignedInUserTenant(n)?.companyId??m.companyId,a=$.getSignedInUser(),i=m.userRoleId,l=!!m.userRole?.includes("reimbursements_user"),b=te(),R=de(b?.loggedInUserRoleMap),h=ue(b?.loggedInUserRoleMap),T=!!m.userReimbursementInfo?.isReimbursementTOSAccepted,u=!!m.companyReimbursementInfo?.info?.isReimbursementEnabled,w=!!m.companyReimbursementInfo?.info?.isReimbursementTOSAccepted,j=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"}):w&&R?s.jsx(_,{to:"../../reimbursements/setup"}):m.companyReimbursementInfo&&!w||m.userReimbursementInfo&&h&&T===!1?s.jsxs(s.Fragment,{children:[s.jsx(ee,{analytics:v,onLoad:A=>(F=>F.trackPageLoaded(Ve.Event.reimbursementPromoPage))(A)}),s.jsx(Ke,{isAppContentDrawerOpen:d,handleDrawerToggle:j}),s.jsx(ia,{companyId:o,navigate:e,location:t,userReimbursementInfo:m.userReimbursementInfo,userRoleId:i,isEmployee:l,onClickMenuIcon:()=>{j(!0)}})]}):s.jsx(pe,{fetchState:"In-Progress",style:{backgroundColor:r.colors.grey5}})};function Pa(){const e=E(V=>Z(V)),t=te(),n=!!e.company?.companyReimbursementInfo.isReimbursementEnabled,r=We(),d=!!e.company?.companyReimbursementInfo.isReimbursementTOSAccepted,c=!!e.userReimbursementInfo?.isReimbursementTOSAccepted,{useFeatureGate:m}=Y(),{isFeatureEnabled:o}=m(k.isChargeCardFeatureEnabled),{isFeatureEnabled:a}=m(k.isDebitCardFeatureEnabled),i=_e(a,e),l=Qe(e),b=e?.userRole!=null&&gn(e?.userRole),R=(e?.company==null||e.company.featuresActivationInfo?.isBillPayFeatureEnabled&&!b)&&hn(t?.loggedInUserRoleMap),h=fn(t?.loggedInUserRoleMap),T=e?.company==null||e.company.featuresActivationInfo?.isReimbursementFeatureEnabled&&!b,u=de(t?.loggedInUserRoleMap),w=T&&u,{isFeatureEnabled:j}=m(k.isDepositAccountsFeatureEnabled),A=j&&!b&&Sn(t?.loggedInUserRoleMap),F=Ln(e,o,a)&&!b&&In(t?.loggedInUserRoleMap),x=yn(t?.loggedInUserRoleMap),B=Rn(t?.loggedInUserRoleMap),I=An(t?.loggedInUserRoleMap),g=kn(t?.loggedInUserRoleMap),P=vn(t?.loggedInUserRoleMap),U=ue(t?.loggedInUserRoleMap),{tenantEmailDomain:M}=X(),y=H(),p=n===!0&&(u||U&&c);return s.jsxs(ct,{children:[y.pathname.includes("/reimbursements")?s.jsxs(s.Fragment,{children:[s.jsx(C,{path:"verification",element:s.jsx(Ce,{isBillPayAdminLevelAccess:R,isUserHasOnlyBillPayAccess:h,isReimbursementAdminLevelAccess:w,isZeniAccountAdminLevelAccess:A,isChargeCardAdminLevelAccess:F,isUserHasOnlyCardAccess:x,productType:"reimbursement",type:"verification"})}),s.jsx(C,{path:"setup",element:s.jsx(Ce,{isBillPayAdminLevelAccess:R,isUserHasOnlyBillPayAccess:h,isReimbursementAdminLevelAccess:w,isZeniAccountAdminLevelAccess:A,isChargeCardAdminLevelAccess:F,isUserHasOnlyCardAccess:x,productType:"reimbursement",type:"setup"})}),s.jsx(C,{path:"promo",element:s.jsx(oa,{})}),s.jsx(C,{path:"approval-rules/*",element:w?s.jsx(Mn,{}):s.jsx(_n,{isUserHasZeniAccountsAccess:B,isUserHasChargeCardAccess:g,isUserHasBillPayAccess:P,isUserHasReimbursementAccess:U,isUserHasTreasuryAccess:I,isTenantBankingOnly:i,tenantEmailDomain:M??""})}),p&&s.jsx(C,{path:"*",element:s.jsx(ta,{})}),(i===!0||l===!0)&&s.jsx(C,{path:"/*",element:s.jsx(Je,{})}),t!=null&&Ne(e,t?.loggedInUserRoleMap)&&s.jsx(C,{path:"*",element:s.jsx(_,{to:"../promo"})}),d&&u&&s.jsx(C,{path:"*",element:s.jsx(_,{to:"../setup"})})]}):y.pathname.includes("/reimbursement")?s.jsxs(s.Fragment,{children:[s.jsx(C,{path:"new",element:s.jsx(Ee,{})}),s.jsx(C,{path:":reimbursementId",element:s.jsx(Jn,{})}),s.jsx(C,{path:":reimbursementId/edit",element:s.jsx(Ee,{})}),s.jsx(C,{path:"*",element:s.jsx(ie,{})})]}):s.jsx(C,{path:"*",element:s.jsx(pe,{fetchState:"In-Progress",style:{backgroundColor:r.colors.grey5,boxShadow:`0px 2px ${D.sp1} ${r.colors.dropShadowNormal}`}})}),s.jsx(C,{path:"*",element:s.jsx(ie,{})})]})}export{Pa as default};
68
+ `,ia=q(function(e,t){const{companyId:n}=t;return{reimbursementSetupView:un(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(bn(n))},onCreateNewRemiButtonClick:()=>{e(pn(t.userRoleId))},onBackClick:()=>{r("../..",{relative:"path"})},onSetupReimbursementSuccess:()=>{t.isEmployee?r("../../reimbursement/new",{relative:"path"}):r("../reimbursements/setup",{relative:"path"})}}})(Un),oa=()=>{const e=W(),t=H(),{tenantEmailDomain:n}=Y(),r=We(),[d,c]=f.useState(!1),m=C(A=>Z(A)),o=$.getSignedInUserTenant(n)?.companyId??m.companyId,a=$.getSignedInUser(),i=m.userRoleId,l=!!m.userRole?.includes("reimbursements_user"),b=te(),R=de(b?.loggedInUserRoleMap),h=ue(b?.loggedInUserRoleMap),T=!!m.userReimbursementInfo?.isReimbursementTOSAccepted,u=!!m.companyReimbursementInfo?.info?.isReimbursementEnabled,w=!!m.companyReimbursementInfo?.info?.isReimbursementTOSAccepted,j=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"}):w&&R?s.jsx(_,{to:"../../reimbursements/setup"}):m.companyReimbursementInfo&&!w||m.userReimbursementInfo&&h&&T===!1?s.jsxs(s.Fragment,{children:[s.jsx(ee,{analytics:k,onLoad:A=>(F=>F.trackPageLoaded(Ve.Event.reimbursementPromoPage))(A)}),s.jsx(Ke,{isAppContentDrawerOpen:d,handleDrawerToggle:j}),s.jsx(ia,{companyId:o,navigate:e,location:t,userReimbursementInfo:m.userReimbursementInfo,userRoleId:i,isEmployee:l,onClickMenuIcon:()=>{j(!0)}})]}):s.jsx(pe,{fetchState:"In-Progress",style:{backgroundColor:r.colors.grey5}})};function Pa(){const e=C(V=>Z(V)),t=te(),n=!!e.company?.companyReimbursementInfo.isReimbursementEnabled,r=We(),d=!!e.company?.companyReimbursementInfo.isReimbursementTOSAccepted,c=!!e.userReimbursementInfo?.isReimbursementTOSAccepted,{useFeatureGate:m}=X(),{isFeatureEnabled:o}=m(v.isChargeCardFeatureEnabled),{isFeatureEnabled:a}=m(v.isDebitCardFeatureEnabled),i=_e(a,e),l=Qe(e),b=e?.userRole!=null&&gn(e?.userRole),R=(e?.company==null||e.company.featuresActivationInfo?.isBillPayFeatureEnabled&&!b)&&hn(t?.loggedInUserRoleMap),h=fn(t?.loggedInUserRoleMap),T=e?.company==null||e.company.featuresActivationInfo?.isReimbursementFeatureEnabled&&!b,u=de(t?.loggedInUserRoleMap),w=T&&u,{isFeatureEnabled:j}=m(v.isDepositAccountsFeatureEnabled),A=j&&!b&&Sn(t?.loggedInUserRoleMap),F=Ln(e,o,a)&&!b&&In(t?.loggedInUserRoleMap),x=yn(t?.loggedInUserRoleMap),B=Rn(t?.loggedInUserRoleMap),I=An(t?.loggedInUserRoleMap),g=vn(t?.loggedInUserRoleMap),P=kn(t?.loggedInUserRoleMap),U=ue(t?.loggedInUserRoleMap),{tenantEmailDomain:M}=Y(),y=H(),p=n===!0&&(u||U&&c);return s.jsxs(ct,{children:[y.pathname.includes("/reimbursements")?s.jsxs(s.Fragment,{children:[s.jsx(E,{path:"verification",element:s.jsx(Ee,{isBillPayAdminLevelAccess:R,isUserHasOnlyBillPayAccess:h,isReimbursementAdminLevelAccess:w,isZeniAccountAdminLevelAccess:A,isChargeCardAdminLevelAccess:F,isUserHasOnlyCardAccess:x,productType:"reimbursement",type:"verification"})}),s.jsx(E,{path:"setup",element:s.jsx(Ee,{isBillPayAdminLevelAccess:R,isUserHasOnlyBillPayAccess:h,isReimbursementAdminLevelAccess:w,isZeniAccountAdminLevelAccess:A,isChargeCardAdminLevelAccess:F,isUserHasOnlyCardAccess:x,productType:"reimbursement",type:"setup"})}),s.jsx(E,{path:"promo",element:s.jsx(oa,{})}),s.jsx(E,{path:"approval-rules/*",element:w?s.jsx(Mn,{}):s.jsx(_n,{isUserHasZeniAccountsAccess:B,isUserHasChargeCardAccess:g,isUserHasBillPayAccess:P,isUserHasReimbursementAccess:U,isUserHasTreasuryAccess:I,isTenantBankingOnly:i,tenantEmailDomain:M??""})}),p&&s.jsx(E,{path:"*",element:s.jsx(ta,{})}),(i===!0||l===!0)&&s.jsx(E,{path:"/*",element:s.jsx(qe,{})}),t!=null&&Ne(e,t?.loggedInUserRoleMap)&&s.jsx(E,{path:"*",element:s.jsx(_,{to:"../promo"})}),d&&u&&s.jsx(E,{path:"*",element:s.jsx(_,{to:"../setup"})})]}):y.pathname.includes("/reimbursement")?s.jsxs(s.Fragment,{children:[s.jsx(E,{path:"new",element:s.jsx(Ce,{})}),s.jsx(E,{path:":reimbursementId",element:s.jsx(qn,{})}),s.jsx(E,{path:":reimbursementId/edit",element:s.jsx(Ce,{})}),s.jsx(E,{path:"*",element:s.jsx(ie,{})})]}):s.jsx(E,{path:"*",element:s.jsx(pe,{fetchState:"In-Progress",style:{backgroundColor:r.colors.grey5,boxShadow:`0px 2px ${D.sp1} ${r.colors.dropShadowNormal}`}})}),s.jsx(E,{path:"*",element:s.jsx(ie,{})})]})}export{Pa as default};
@@ -1 +1 @@
1
- import{j as p}from"./liveblocks-BLlSTcoD.js";import{g as G,h as ge,u as Ce,i as Ie,j as d,n as we,o as Se,p as Y}from"./core-CbpoBsNm.js";import{eW as v,fQ as I,M1 as Te,kr as J,qM as K,rB as A,kf as Re,jj as Me,uY as X,rG as Oe,bt as Ae,M2 as ke,bn as Fe,w5 as je,M3 as De,M4 as Ee,uQ as Pe,M5 as H,M6 as ve,M7 as Be,M8 as Le,M9 as Ve,Ma as w,Mb as k,Mc as F,Md as N,Me as j,Mf as D,dJ as Ue,vN as xe,vB as $,vC as q,vT as ze,vG as Z,vZ as Ge,Mg as Ye,Mh as He,Mi as Ne,Mj as $e,Mk as qe,fB as Ze,fz as Qe}from"./zeni-epic-state-CkeDRiud.js";import{T as We,U as Je,V as Ke,W as Xe,K as ea,F as ee,x as E,z as ae,X as aa,j as sa,a as ta,Z as oa,_ as na,A as ra,d as P,f as ia,$ as la,s as se,a0 as ca,a1 as da,a2 as pa}from"./index-aZImxzjX.js";import"./mui-DcNGd9L2.js";import fa from"./NotFoundScreen-Bnx2UPHv.js";import{F as ma}from"./FeaturePreviewScreen-Bbo-4gXG.js";import{a as _}from"./sentry-D_xp3E3Q.js";import{u as ua}from"./useInitialThreadRequest-DVxzaQcg.js";import{t as Q,a as W,b as _a}from"./routePaths-DyIc-n3M.js";import{M as ha}from"./MobileAppDrawer-CWBhYKqW.js";import"./recharts-C0aThBg3.js";import"./analytics-CQmVOD4d.js";import"./plaid-B62punae.js";import"./dnd-CX5suNP6.js";import"./stripe-DMRn4zHo.js";import"./lottie-BY8e0Ufw.js";import"./lexical-BS7d_1CV.js";import"./pdf-BslZhgI8.js";import"./utils-BQO84dIV.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]="afe54083-556e-42a6-a629-4f9d0f79899d",e._sentryDebugIdIdentifier="sentry-dbid-afe54083-556e-42a6-a629-4f9d0f79899d")}catch{}})();const ba=["profit_loss","balance_sheet","cash_flow"],y=e=>{e(D({resetLeftScroll:!0})),e(j({resetLeftScroll:!0})),e(F({resetLeftScroll:!0})),e(k({resetLeftScroll:!0}))},ya=e=>{e(He()),e(Ne()),e($e()),e(qe())},ga=we(function(e){const o=ae.getSignedInUser(),f=e.tenantState.currentTenantId,u=v(e),a=u?.companyName??"",s={userId:o?.userId??"",sessionId:o?.zeniSessionId??"",tenantId:f??""},t=I(e),r=ke(u);return{fetchState:t.fetchState,selectedTimeframe:t.filter.timeframe,selectedReport:t.selectedReportId,displayOrder:t.displayOrder,reportFormat:t.reportFormat,dataAvailable:t.dataAvailable,balancesInTimeframe:t.balancesInTimeframe,allTimeframeTicks:t.allTimeframeTicks,selectedCOABalancesRange:t.filter.balancesRange,isCompareMode:t.isCompareModeOn,profitAndLossReport:t.profitAndLossReport,profitAndLossClassesViewReport:t.profitAndLossByClassReport,profitAndLossProjectViewReport:t.profitAndLossByProjectReport,profitAndLossByClassHorizontalReport:t.profitAndLossByClassHorizontalReport,balanceSheetReport:t.balanceSheetReport,cashFlowReport:t.cashFlowReport,downloadState:t.downloadState,analytics:P,isZeniUser:Fe(o),showAccountGroups:r===!0,isAccountingClassesEnabled:J(e),isAccountingProjectsEnabled:K(e),currentTenantCompanyName:a,statementEndPoint:`${pa}/statement`,authParams:s,isZeniCOAUsed:r}},function(e,o){const{navigate:f,handleDrawerToggle:u}=o;return{onReloadReport:()=>{o.signedInUser!=null&&e(A(o.signedInUser.userId,!0,!1))},updateDownloadStateHandler:a=>{e(Ye(a))},onTimeframeSelectionChanged:(a,s,t)=>{if(e(Ge(a)),s){const{isCompareModeOn:r,filter:l}=o,{additionalBalances:m,balancesRange:c}=l;let i=[...m];a==="year"&&(i=i.filter(g=>g!=="this_period_vs_same_period_last_year"&&g!=="this_period_vs_same_period_last_year_percent"&&g!=="same_period_last_year")),e($(o.firstMonthOfFY,r,c.numberOfPeriods<1?1:c.numberOfPeriods,i)),m.length>0&&e(q(o.firstMonthOfFY,i.includes("this_period_vs_last_period")?"compare_mode_amount":"compare_mode_percent",c.numberOfPeriods<1?1:c.numberOfPeriods,i))}t!==!0&&setTimeout(()=>y(e),50)},onReportSelectionChanged:a=>{const s=o.selectedReportID;if(a===s)return;const t=o.classViewLayout;e(w(a)),(a==="balance_sheet"||a==="cash_flow")&&s==="profit_and_loss_by_classes"&&t==="horizontal"&&e(Z({numberOfPeriods:1,orderBy:"ascending_date"})),a!=="profit_and_loss"&&a!=="profit_and_loss_by_classes"&&s==="profit_and_loss_by_classes"&&t==="horizontal"&&e(H({classViewLayout:"vertical"})),y(e)},onCOABalancesRangeChanged:(a,s)=>{e(Z(a,s)),y(e)},onThisPeriodChanged:(a,s,t)=>{e(ze(o.firstMonthOfFY,a,s<1?1:s)),t!==!0&&y(e)},onAdditionalBalanceSelectionChanged:(a,s,t,r)=>{e($(o.firstMonthOfFY,a,t<1?1:t,s)),s.length>0&&e(q(o.firstMonthOfFY,s.includes("this_period_vs_last_period")?"compare_mode_amount":"compare_mode_percent",t<1?1:t,s)),r!==!0&&o.isCompareModeOn===a||setTimeout(()=>y(e),50)},onUpdateHighlightedNumberOfPeriods:(a,s,t,r)=>{e(xe({firstMonthOfFY:o.firstMonthOfFY,isCompareModeOn:s,additionalBalances:a,maxNumOfPeriodsToHighlight:t<1?1:t,coaBalances:r}))},onAccountBalanceClick:o.hasTransactionAccess!==!0?void 0:(a,s,t)=>{let r,l;if(s.balanceTimeFrame==="month"||s.balanceTimeFrame==="quarter"?(r=s.balanceTimeFrame,l=Ue(s)):s.balanceTimeFrame==="year"?(r="quarter",l={startDate:s.endDate.startOf("quarter"),endDate:s.endDate}):console.error(`timeframe ${s.balanceTimeFrame} is not supported`),l!=null&&r!=null){const m=a.accountName===""?a.accountDescription:a.accountName,c=(()=>{if(o.selectedReportID==="profit_and_loss_by_classes"&&o.classViewLayout==="horizontal"&&a.accountType!=null){if(t?.isHorizontalClassTotalColumn===!0)return Q(o.tenantEmailDomain,a.accountId,a.accountType,m,r,l);if(t?.isHorizontalClassColumn===!0&&s.id!=null)return W(o.tenantEmailDomain,a.accountId,a.accountType,s.id,m,r,l)}return a.projectsViewParentId?.projectId!=null&&a.accountType!=null?_a(o.tenantEmailDomain,a.accountId,a.accountType,a.projectsViewParentId.projectId,m,r,l):a.classesViewParentId!=null&&a.classesViewParentId.parentClassId!=null&&a.accountType!=null?W(o.tenantEmailDomain,a.accountId,a.accountType,a.classesViewParentId.parentClassId[0],m,r,l):a.accountType!=null?Q(o.tenantEmailDomain,a.accountId,a.accountType,m,r,l):void 0})();if(c!=null){const i=se(o.location.state?.pathnameStackToGoBack,o.location.pathname);f(c,{state:{pathnameStackToGoBack:i,referrer:S(o.selectedReportID)}})}}},onTableScroll:(a,s)=>{switch(a){case"profit_and_loss":e(D({scrollPosition:s}));break;case"profit_and_loss_by_classes":e(j({scrollPosition:s}));break;case"profit_and_loss_by_projects":e(N({scrollPosition:s}));break;case"balance_sheet":e(F({scrollPosition:s}));break;case"cash_flow":e(k({scrollPosition:s}));break;default:console.log(`Table Scroll state for ${a} is not handled`)}},onElementCollapseStateChanged:(a,s,t)=>{switch(a){case"profit_and_loss":e(D({nodeCollapseState:{nodeId:s,isCollapsed:t}}));break;case"profit_and_loss_by_classes":e(j({nodeCollapseState:{nodeId:s,isCollapsed:t}}));break;case"profit_and_loss_by_projects":e(N({nodeCollapseState:{nodeId:s,isCollapsed:t}}));break;case"balance_sheet":e(F({nodeCollapseState:{nodeId:s,isCollapsed:t}}));break;case"cash_flow":e(k({nodeCollapseState:{nodeId:s,isCollapsed:t}}));break;default:console.log(`Collapse state toggle for ${a} is not handled`)}},onBackClick:()=>{f("../../")},onUpdateAccountViewMode:a=>{e(Le({viewMode:a})),e(Ve({viewMode:a})),a==="classes"?(o.analytics?.trackGroupBySwitch("Classes",S(o.selectedReportID)),e(w("profit_and_loss_by_classes"))):a==="project"?(o.analytics?.trackGroupBySwitch("Projects",S(o.selectedReportID)),e(w("profit_and_loss_by_projects"))):(o.analytics?.trackGroupBySwitch("Accounts",S(o.selectedReportID)),e(w("profit_and_loss"))),y(e)},onUpdateClassesToFilterOut:a=>{e(Be({classesToFilterOut:a}))},onUpdateProjectsToFilterOut:a=>{e(ve({projectsToFilterOut:a}))},onUpdateClassViewLayout:a=>{e(H({classViewLayout:a}))},onOpenAccountViewMode:()=>{o.isAccountingClassesEnabled&&e(Pe()),o.isAccountingProjectsEnabled&&e(X())},onUpdateDisplayOrder:a=>{e(Ee(a))},onUpdateReportFormat:a=>{ya(e),e(De(a))},onClickMenuIcon:()=>{u(!0)},onResyncReports:()=>{e(je("profit_and_loss_by_classes"))}}})(ca);function Ca(){const{isAiCfoOpen:e,setIsAiCfoOpen:o}=Xe(),f=ea(),u=da(f),a=ge(),s=Ce(),t=G(),{tenantEmailDomain:r}=Ie(),{useFeatureGate:l}=ee(),{isFeatureEnabled:m}=l(E.isReportsHorizontalClassLayoutSwitchEnabled),c=ae.getSignedInUser(),[i,g]=_.useState(!1),[B,te]=_.useState(!1),{isFeatureEnabled:L}=l(E.isReportsCommentingEnabled);if(c==null)throw Error("Can't access reports page without signing in...");const T=d(n=>v(n)),oe=T.masterTOSInfo?.isMasterTOSAccepted??!1,ne=T.company?.companyInfo.firstMonthOfFY??1,re=ua(L?T?.companyId:void 0),C=d(n=>I(n).fetchState),ie=d(n=>Te(n)),{areTenantIdsInSync:h}=aa(),R=d(n=>n.financeStatementState.selectedReportId),V=d(n=>J(n)),M=d(n=>K(n)),le=d(n=>I(n).isCompareModeOn),b=d(n=>I(n).filter),O=d(n=>I(n).selectedReportAndTimeframeFetchState),ce=d(n=>n.profitAndLossClassesViewState.uiState.classViewLayout);_.useEffect(()=>{!i&&h&&(g(!0),s(A(c.userId,!0,!0,!1)))},[i,c,s,h]),_.useEffect(()=>{i&&!B&&C==="Completed"&&h&&(s(A(c.userId,!1,!0,!1)),te(!0))},[i,B,C,h]),_.useEffect(()=>{if(i&&O.fetchState==="Not-Started"&&b.timeframe!=="free_range"&&b.timeframe!=="week"&&h)switch(R){case"profit_and_loss":case"profit_and_loss_by_classes":s(Oe(b.timeframe));break;case"profit_and_loss_by_projects":M&&s(X());break;case"balance_sheet":s(Me(b.timeframe));break;case"cash_flow":s(Re(b.timeframe))}},[i,R,O,h,V,M]);const U=sa(),de=U?.loggedInUserRole!=null&&Ae(U?.loggedInUserRole)!==!0,[pe,fe]=_.useState(!1),x=n=>{fe(n)},me=ta(),ue=oa();return function(n){const{isDataReady:_e}=n,{pathname:he}=G(),z=We(he??"")==="reports",be=Je(_e),ye=_.useMemo(()=>z?ba:void 0,[z]);Ke({canFetchSuggestedQuestions:be,pageContexts:ye})}({isDataReady:C==="Completed"}),na({isDataReady:C==="Completed"}),p.jsxs(p.Fragment,{children:[C==="Completed"?p.jsx(ra,{analytics:P,onLoad:n=>n.trackPageLoaded(ia.Event.reports)}):null,p.jsx(ha,{isAppContentDrawerOpen:pe,handleDrawerToggle:x}),p.jsx(ga,{firstMonthOfFY:ne,tenantEmailDomain:r,location:t,navigate:a,windowSize:f,classViewLayout:ce,selectedReportID:R,analytics:P,filter:b,isAccountingClassesEnabled:V,isAccountingProjectsEnabled:M,isCompareModeOn:le,hasTransactionAccess:de,signedInUser:c,selectedReportAndTimeframeFetchState:O,handleDrawerToggle:x,reportsResyncFetchState:ie.reportsResyncFetchState,isAiCfoAccessEnabled:ue&&me&&!e,onAskAiCfoClick:()=>{if(oe)if(u){const n=se(t.state?.pathnameStackToGoBack,t.pathname);a(`/${r}/ai-cfo/explore`,{state:{pathnameStackToGoBack:n,referrer:"Reports"}})}else o(!0);else la({location:t,navigate:a,mergeState:{referrer:"Reports"}})},isHorizontalClassReportSwitchEnabled:m,isReportsCommentingEnabled:L,initialOpenThreadRequest:re})]})}const S=e=>{switch(e){case"profit_and_loss":return"Profit & Loss";case"balance_sheet":return"Balance Sheet";case"cash_flow":return"Cash Flow";default:return"Reports"}};function za(){const e=d(s=>v(s)),{useFeatureGate:o}=ee(),{isFeatureEnabled:f}=o(E.isDebitCardFeatureEnabled),u=Ze(f,e),a=Qe(e);return u===!0||a===!0?p.jsx(ma,{}):p.jsxs(Se,{children:[p.jsx(Y,{path:"/",element:p.jsx(Ca,{})}),p.jsx(Y,{path:"*",element:p.jsx(fa,{})})]})}export{za as default};
1
+ import{j as p}from"./liveblocks-BUQfB0Zp.js";import{g as G,h as ge,u as Ce,i as Ie,j as d,n as Se,o as we,p as Y}from"./core-OMb8nkC1.js";import{eV as L,fP as I,M0 as Te,kq as J,qL as W,rA as F,ke as Re,ji as Me,uX as K,rF as Ae,bs as Fe,M1 as Oe,bn as ke,w4 as je,M2 as De,M3 as Pe,uP as Ee,M4 as H,M5 as Le,M6 as ve,M7 as Be,M8 as Ve,M9 as S,Ma as O,Mb as k,Mc as N,Md as j,Me as D,dI as Ue,vM as xe,vA as q,vB as $,vS as ze,vF as X,vY as Ge,Mf as Ye,Mg as He,Mh as Ne,Mi as qe,Mj as $e,fA as Xe,fy as Ze}from"./zeni-epic-state-BZ6N8nVI.js";import{R as Qe,T as Je,U as We,V as Ke,J as ea,a as ee,F as P,z as ae,W as aa,j as sa,c as ta,X as oa,_ as na,E as ra,d as E,f as ia,$ as la,s as se,a0 as ca,a1 as da,a2 as pa}from"./index-NcZU0lXl.js";import"./mui-JZY-3hhJ.js";import fa from"./NotFoundScreen-CxRYls3k.js";import{F as ma}from"./FeaturePreviewScreen-DgqstYkZ.js";import{a as _}from"./sentry-BLIwU6uZ.js";import{u as ua}from"./useInitialThreadRequest-Bh1NrHII.js";import{t as Z,a as Q,b as _a}from"./routePaths-DZldr9mG.js";import{M as ba}from"./MobileAppDrawer-B4f1me8_.js";import"./recharts-DAM4r1-u.js";import"./analytics-BLbM2ksu.js";import"./plaid-B_OuebQv.js";import"./dnd-DVcQZAG5.js";import"./stripe-DMRn4zHo.js";import"./lottie-DDI83OWz.js";import"./lexical-CNfNgAkp.js";import"./pdf-6FZlivdz.js";import"./utils-Bia5qc4p.js";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},o=new e.Error().stack;o&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[o]="0bcc0b83-4a7b-4ea2-b7eb-c1db590e5fc9",e._sentryDebugIdIdentifier="sentry-dbid-0bcc0b83-4a7b-4ea2-b7eb-c1db590e5fc9")}catch{}})();const ha=["profit_loss","balance_sheet","cash_flow"],y=e=>{e(D({resetLeftScroll:!0})),e(j({resetLeftScroll:!0})),e(k({resetLeftScroll:!0})),e(O({resetLeftScroll:!0}))},ya=e=>{e(He()),e(Ne()),e(qe()),e($e())},ga=Se(function(e){const o=ae.getSignedInUser(),f=e.tenantState.currentTenantId,u=L(e),a=u?.companyName??"",s={userId:o?.userId??"",sessionId:o?.zeniSessionId??"",tenantId:f??""},t=I(e),r=Oe(u);return{fetchState:t.fetchState,selectedTimeframe:t.filter.timeframe,selectedReport:t.selectedReportId,displayOrder:t.displayOrder,reportFormat:t.reportFormat,dataAvailable:t.dataAvailable,balancesInTimeframe:t.balancesInTimeframe,allTimeframeTicks:t.allTimeframeTicks,selectedCOABalancesRange:t.filter.balancesRange,isCompareMode:t.isCompareModeOn,profitAndLossReport:t.profitAndLossReport,profitAndLossClassesViewReport:t.profitAndLossByClassReport,profitAndLossProjectViewReport:t.profitAndLossByProjectReport,profitAndLossByClassHorizontalReport:t.profitAndLossByClassHorizontalReport,balanceSheetReport:t.balanceSheetReport,cashFlowReport:t.cashFlowReport,downloadState:t.downloadState,analytics:E,isZeniUser:ke(o),showAccountGroups:r===!0,isAccountingClassesEnabled:J(e),isAccountingProjectsEnabled:W(e),currentTenantCompanyName:a,statementEndPoint:`${pa}/statement`,authParams:s,isZeniCOAUsed:r}},function(e,o){const{navigate:f,handleDrawerToggle:u}=o;return{onReloadReport:()=>{o.signedInUser!=null&&e(F(o.signedInUser.userId,!0,!1))},updateDownloadStateHandler:a=>{e(Ye(a))},onTimeframeSelectionChanged:(a,s,t)=>{if(e(Ge(a)),s){const{isCompareModeOn:r,filter:l}=o,{additionalBalances:m,balancesRange:c}=l;let i=[...m];a==="year"&&(i=i.filter(g=>g!=="this_period_vs_same_period_last_year"&&g!=="this_period_vs_same_period_last_year_percent"&&g!=="same_period_last_year")),e(q(o.firstMonthOfFY,r,c.numberOfPeriods<1?1:c.numberOfPeriods,i)),m.length>0&&e($(o.firstMonthOfFY,i.includes("this_period_vs_last_period")?"compare_mode_amount":"compare_mode_percent",c.numberOfPeriods<1?1:c.numberOfPeriods,i))}t!==!0&&setTimeout(()=>y(e),50)},onReportSelectionChanged:a=>{const s=o.selectedReportID;if(a===s)return;const t=o.classViewLayout;e(S(a)),(a==="balance_sheet"||a==="cash_flow")&&s==="profit_and_loss_by_classes"&&t==="horizontal"&&e(X({numberOfPeriods:1,orderBy:"ascending_date"})),a!=="profit_and_loss"&&a!=="profit_and_loss_by_classes"&&s==="profit_and_loss_by_classes"&&t==="horizontal"&&e(H({classViewLayout:"vertical"})),y(e)},onCOABalancesRangeChanged:(a,s)=>{e(X(a,s)),y(e)},onThisPeriodChanged:(a,s,t)=>{e(ze(o.firstMonthOfFY,a,s<1?1:s)),t!==!0&&y(e)},onAdditionalBalanceSelectionChanged:(a,s,t,r)=>{e(q(o.firstMonthOfFY,a,t<1?1:t,s)),s.length>0&&e($(o.firstMonthOfFY,s.includes("this_period_vs_last_period")?"compare_mode_amount":"compare_mode_percent",t<1?1:t,s)),r!==!0&&o.isCompareModeOn===a||setTimeout(()=>y(e),50)},onUpdateHighlightedNumberOfPeriods:(a,s,t,r)=>{e(xe({firstMonthOfFY:o.firstMonthOfFY,isCompareModeOn:s,additionalBalances:a,maxNumOfPeriodsToHighlight:t<1?1:t,coaBalances:r}))},onAccountBalanceClick:o.hasTransactionAccess!==!0?void 0:(a,s,t)=>{let r,l;if(s.balanceTimeFrame==="month"||s.balanceTimeFrame==="quarter"?(r=s.balanceTimeFrame,l=Ue(s)):s.balanceTimeFrame==="year"?(r="quarter",l={startDate:s.endDate.startOf("quarter"),endDate:s.endDate}):console.error(`timeframe ${s.balanceTimeFrame} is not supported`),l!=null&&r!=null){const m=a.accountName===""?a.accountDescription:a.accountName,c=(()=>{if(o.selectedReportID==="profit_and_loss_by_classes"&&o.classViewLayout==="horizontal"&&a.accountType!=null){if(t?.isHorizontalClassTotalColumn===!0)return Z(o.tenantEmailDomain,a.accountId,a.accountType,m,r,l);if(t?.isHorizontalClassColumn===!0&&s.id!=null)return Q(o.tenantEmailDomain,a.accountId,a.accountType,s.id,m,r,l)}return a.projectsViewParentId?.projectId!=null&&a.accountType!=null?_a(o.tenantEmailDomain,a.accountId,a.accountType,a.projectsViewParentId.projectId,m,r,l):a.classesViewParentId!=null&&a.classesViewParentId.parentClassId!=null&&a.accountType!=null?Q(o.tenantEmailDomain,a.accountId,a.accountType,a.classesViewParentId.parentClassId[0],m,r,l):a.accountType!=null?Z(o.tenantEmailDomain,a.accountId,a.accountType,m,r,l):void 0})();if(c!=null){const i=se(o.location.state?.pathnameStackToGoBack,o.location.pathname);f(c,{state:{pathnameStackToGoBack:i,referrer:w(o.selectedReportID)}})}}},onTableScroll:(a,s)=>{switch(a){case"profit_and_loss":e(D({scrollPosition:s}));break;case"profit_and_loss_by_classes":e(j({scrollPosition:s}));break;case"profit_and_loss_by_projects":e(N({scrollPosition:s}));break;case"balance_sheet":e(k({scrollPosition:s}));break;case"cash_flow":e(O({scrollPosition:s}));break;default:console.log(`Table Scroll state for ${a} is not handled`)}},onElementCollapseStateChanged:(a,s,t)=>{switch(a){case"profit_and_loss":e(D({nodeCollapseState:{nodeId:s,isCollapsed:t}}));break;case"profit_and_loss_by_classes":e(j({nodeCollapseState:{nodeId:s,isCollapsed:t}}));break;case"profit_and_loss_by_projects":e(N({nodeCollapseState:{nodeId:s,isCollapsed:t}}));break;case"balance_sheet":e(k({nodeCollapseState:{nodeId:s,isCollapsed:t}}));break;case"cash_flow":e(O({nodeCollapseState:{nodeId:s,isCollapsed:t}}));break;default:console.log(`Collapse state toggle for ${a} is not handled`)}},onBackClick:()=>{f("../../")},onUpdateAccountViewMode:a=>{e(Be({viewMode:a})),e(Ve({viewMode:a})),a==="classes"?(o.analytics?.trackGroupBySwitch("Classes",w(o.selectedReportID)),e(S("profit_and_loss_by_classes"))):a==="project"?(o.analytics?.trackGroupBySwitch("Projects",w(o.selectedReportID)),e(S("profit_and_loss_by_projects"))):(o.analytics?.trackGroupBySwitch("Accounts",w(o.selectedReportID)),e(S("profit_and_loss"))),y(e)},onUpdateClassesToFilterOut:a=>{e(ve({classesToFilterOut:a}))},onUpdateProjectsToFilterOut:a=>{e(Le({projectsToFilterOut:a}))},onUpdateClassViewLayout:a=>{e(H({classViewLayout:a}))},onOpenAccountViewMode:()=>{o.isAccountingClassesEnabled&&e(Ee()),o.isAccountingProjectsEnabled&&e(K())},onUpdateDisplayOrder:a=>{e(Pe(a))},onUpdateReportFormat:a=>{ya(e),e(De(a))},onClickMenuIcon:()=>{u(!0)},onResyncReports:()=>{e(je("profit_and_loss_by_classes"))}}})(ca);function Ca(){const{isAiCfoOpen:e,setIsAiCfoOpen:o}=Ke(),f=ea(),u=da(f),a=ge(),s=Ce(),t=G(),{tenantEmailDomain:r}=Ie(),{useFeatureGate:l}=ee(),{isFeatureEnabled:m}=l(P.isReportsHorizontalClassLayoutSwitchEnabled),c=ae.getSignedInUser(),[i,g]=_.useState(!1),[v,te]=_.useState(!1),{isFeatureEnabled:B}=l(P.isReportsCommentingEnabled);if(c==null)throw Error("Can't access reports page without signing in...");const T=d(n=>L(n)),oe=T.masterTOSInfo?.isMasterTOSAccepted??!1,ne=T.company?.companyInfo.firstMonthOfFY??1,re=ua(B?T?.companyId:void 0),C=d(n=>I(n).fetchState),ie=d(n=>Te(n)),{areTenantIdsInSync:b}=aa(),R=d(n=>n.financeStatementState.selectedReportId),V=d(n=>J(n)),M=d(n=>W(n)),le=d(n=>I(n).isCompareModeOn),h=d(n=>I(n).filter),A=d(n=>I(n).selectedReportAndTimeframeFetchState),ce=d(n=>n.profitAndLossClassesViewState.uiState.classViewLayout);_.useEffect(()=>{!i&&b&&(g(!0),s(F(c.userId,!0,!0,!1)))},[i,c,s,b]),_.useEffect(()=>{i&&!v&&C==="Completed"&&b&&(s(F(c.userId,!1,!0,!1)),te(!0))},[i,v,C,b]),_.useEffect(()=>{if(i&&A.fetchState==="Not-Started"&&h.timeframe!=="free_range"&&h.timeframe!=="week"&&b)switch(R){case"profit_and_loss":case"profit_and_loss_by_classes":s(Ae(h.timeframe));break;case"profit_and_loss_by_projects":M&&s(K());break;case"balance_sheet":s(Me(h.timeframe));break;case"cash_flow":s(Re(h.timeframe))}},[i,R,A,b,V,M]);const U=sa(),de=U?.loggedInUserRole!=null&&Fe(U?.loggedInUserRole)!==!0,[pe,fe]=_.useState(!1),x=n=>{fe(n)},me=ta(),ue=oa();return function(n){const{isDataReady:_e}=n,{pathname:be}=G(),z=Qe(be??"")==="reports",he=Je(_e),ye=_.useMemo(()=>z?ha:void 0,[z]);We({canFetchSuggestedQuestions:he,pageContexts:ye})}({isDataReady:C==="Completed"}),na({isDataReady:C==="Completed"}),p.jsxs(p.Fragment,{children:[C==="Completed"?p.jsx(ra,{analytics:E,onLoad:n=>n.trackPageLoaded(ia.Event.reports)}):null,p.jsx(ba,{isAppContentDrawerOpen:pe,handleDrawerToggle:x}),p.jsx(ga,{firstMonthOfFY:ne,tenantEmailDomain:r,location:t,navigate:a,windowSize:f,classViewLayout:ce,selectedReportID:R,analytics:E,filter:h,isAccountingClassesEnabled:V,isAccountingProjectsEnabled:M,isCompareModeOn:le,hasTransactionAccess:de,signedInUser:c,selectedReportAndTimeframeFetchState:A,handleDrawerToggle:x,reportsResyncFetchState:ie.reportsResyncFetchState,isAiCfoAccessEnabled:ue&&me&&!e,onAskAiCfoClick:()=>{if(oe)if(u){const n=se(t.state?.pathnameStackToGoBack,t.pathname);a(`/${r}/ai-cfo/explore`,{state:{pathnameStackToGoBack:n,referrer:"Reports"}})}else o(!0);else la({location:t,navigate:a,mergeState:{referrer:"Reports"}})},isHorizontalClassReportSwitchEnabled:m,isReportsCommentingEnabled:B,initialOpenThreadRequest:re})]})}const w=e=>{switch(e){case"profit_and_loss":return"Profit & Loss";case"balance_sheet":return"Balance Sheet";case"cash_flow":return"Cash Flow";default:return"Reports"}};function za(){const e=d(s=>L(s)),{useFeatureGate:o}=ee(),{isFeatureEnabled:f}=o(P.isDebitCardFeatureEnabled),u=Xe(f,e),a=Ze(e);return u===!0||a===!0?p.jsx(ma,{}):p.jsxs(we,{children:[p.jsx(Y,{path:"/",element:p.jsx(Ca,{})}),p.jsx(Y,{path:"*",element:p.jsx(fa,{})})]})}export{za as default};
@@ -0,0 +1 @@
1
+ import{j as a}from"./liveblocks-BUQfB0Zp.js";import{a as x,z as w,aN as y,E as I,d as p,f as F,d5 as P,F as T}from"./index-NcZU0lXl.js";import"./mui-JZY-3hhJ.js";import m from"./NotFoundScreen-CxRYls3k.js";import{a as f}from"./sentry-BLIwU6uZ.js";import{u as L,j as b,h as V,g as A,n as R,o as U,p as u}from"./core-OMb8nkC1.js";import{eV as z,T9 as C,Pq as G,Ta as v,vr as Y,fG as q,Tb as O,vp as B}from"./zeni-epic-state-BZ6N8nVI.js";import{R as j}from"./ReferralListScreen-CbCeYBu8.js";import"./recharts-DAM4r1-u.js";import"./analytics-BLbM2ksu.js";import"./plaid-B_OuebQv.js";import"./dnd-DVcQZAG5.js";import"./stripe-DMRn4zHo.js";import"./lottie-DDI83OWz.js";import"./lexical-CNfNgAkp.js";import"./pdf-6FZlivdz.js";import"./utils-Bia5qc4p.js";import"./useAskAiCfoHostNavButtonProps-DS5Fxq3U.js";import"./MobileAppDrawer-B4f1me8_.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]="fa50d74f-9079-408e-9778-1cbb070a03ee",e._sentryDebugIdIdentifier="sentry-dbid-fa50d74f-9079-408e-9778-1cbb070a03ee")}catch{}})();const H=R(function(e,t){const n=C(e);return{inviteFormView:n.localData,submitStatus:n.saveStatus,userName:t.userName,rewardsPlan:n.rewardsPlan,companyLegalName:t.companyName}},function(e,t){const{navigate:n}=t,i=w.getSignedInUser();return{onDismissClick:()=>{e(v()),n("..")},onSendClick:()=>{if(i!=null){const s=[],r=[];t.inviteFormCompayData.forEach(c=>{s.push(c.companyName),r.push(c.emailIds[0])}),p.trackInviteEmailClicked("send",s,r,s.length)}e(B())},onUpdateInviteFormLocalData:s=>{e(O({localData:s}))},onSubmitSuccess:()=>{n("../../")},onCancelClick:()=>{i!=null&&p.trackInviteEmailClicked("cancel")}}})(P),J=()=>{const e=L(),[t,n]=f.useState(!1),[i,s]=f.useState(!1),r=b(o=>z(o)),c=V(),D=A(),{useDynamicConfig:g}=x(),d=w.getSignedInUser();if(d==null)throw Error("Can't access invite referral screen without signing in...");const l=b(o=>C(o)),_=d?.firstName!=null?d.firstName:"User",{configValue:h}=g(y.zeniCardsConfig),{configValue:k}=g(y.zeniAccountsConfig),N=G(k);f.useEffect(()=>{e(v()),r?.rewardsLastViewedTime==null&&i===!1&&(e(Y()),s(!0))},[]),f.useEffect(()=>{t||l.fetchState!=="Not-Started"||(n(!0),e(q(!0)))},[l.fetchState,e]);const S=r.company?.companyInfo.companyLegalName??r.companyName;return a.jsxs(a.Fragment,{children:[l.fetchState==="Completed"?a.jsx(I,{analytics:p,onLoad:o=>(E=>E.trackPageLoaded(F.Event.inviteEmailViewed))(o)}):null,a.jsx(H,{navigate:c,location:D,currentTenant:r,companyName:S,userName:_,inviteFormCompayData:l.localData,chargeCardCashbackRatePerTransaction:h.charge_card_cashback_rate_per_transaction!=null?h.charge_card_cashback_rate_per_transaction:.0175,maxAnnualPercentageYield:N.maxAnnualPercentageYield})]})};function ue(){const{useFeatureGate:e}=x(),{isFeatureEnabled:t}=e(T.isReferralFeatureEnabled);return a.jsxs(U,{children:[a.jsx(u,{path:"/",element:t?a.jsx(j,{}):a.jsx(m,{})}),a.jsx(u,{path:"how-it-works",element:t?a.jsx(j,{isReferralDrawerOpen:!0}):a.jsx(m,{})}),a.jsx(u,{path:"refer/*",element:t?a.jsx(J,{}):a.jsx(m,{})}),a.jsx(u,{path:"*",element:a.jsx(m,{})})]})}export{ue as default};
@@ -0,0 +1,2 @@
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/DashboardRoutes-YclW7oS0.js","assets/sentry-BLIwU6uZ.js","assets/core-OMb8nkC1.js","assets/zeni-epic-state-BZ6N8nVI.js","assets/index-NcZU0lXl.js","assets/mui-JZY-3hhJ.js","assets/analytics-BLbM2ksu.js","assets/utils-Bia5qc4p.js","assets/withTransactionSidePanel-DxHfrYsZ.js","assets/useAskAiCfoHostNavButtonProps-DS5Fxq3U.js","assets/TransactionDetailScreen-CoGsdLTa.js","assets/decodeURIComponentSafe-CrZYJ6cg.js","assets/routePaths-DZldr9mG.js","assets/NotFoundScreen-CxRYls3k.js","assets/useInitialThreadRequest-Bh1NrHII.js","assets/analyticsHelper-BU5wlVa9.js","assets/CompanyPassportScreen-CE4f1mRO.js","assets/MobileAppDrawer-B4f1me8_.js","assets/useAiCfoDashboardSuggestedQuestionsChips-DEWGXdch.js","assets/FeaturePreviewScreen-DgqstYkZ.js","assets/ReferralListScreen-CbCeYBu8.js","assets/index-BUmr5maU.css","assets/BillPayRoutes-zXfejo42.js","assets/AddressScreen-Jgfq0eWZ.js","assets/DomesticWireDetailScreen-3X6dnm4U.js","assets/DrawerScreen-DcUdH_zJ.js","assets/SetupPagesScreen-CPey4cOW.js","assets/BusinessVerificationPageScreen-BiV9G1-i.js","assets/BillPayApprovalRoutes-DjjjDtRL.js","assets/ReimbursementApprovalRuleDetailScreen-DTZkQzQY.js","assets/getLocaleForTenant-Bn16hOPH.js","assets/ReimbursementRoutes-CzlU6LYx.js","assets/ReimbursementApprovalRoutes-CQrzmhSh.js","assets/TransactionListRoutes-C4QYqCpP.js","assets/ZeniAccountStatementScreen-3bZVHWI7.js","assets/SettingsRoutes-3hV9qN1I.js","assets/accountMappingHelper-DS9ya8eF.js","assets/QBOConnectionScreen-CSgGZuyl.js","assets/empty-BACf_dXg.js","assets/index-CPre97x9.js","assets/url-BMb7_G4N.js","assets/index-BQIzm-tN.js","assets/ReportsRoutes-D_wjWb18.js","assets/ChargeCardRoutes-CBFlKgnf.js","assets/PeopleRoutes-CUtLjfXT.js","assets/ExpenseAutomationRoutes-CTZlVWwO.js","assets/TreasuryRoutes-jiXgJCAb.js","assets/useCashManagementBanner-CtcuIjhq.js","assets/VendorsRoutes-BZFmR2hI.js","assets/pathToGoBack-iJW8VSI1.js","assets/ZeniAccountRoutes-DVnj5-p6.js","assets/AddressRoutes-DsuoPslx.js","assets/PandLWithForecastRoutes-DSq1hcWm.js","assets/CustomerOnboardingRoutes-Doltk1XW.js","assets/TransactionDetailRoutes-CgKCf_lf.js","assets/EntityDetailRoutes-D020FlPl.js","assets/NotificationRoutes-Dw__n9YA.js","assets/PerformanceRoutes-D4zDazyB.js","assets/RewardsRoutes-Bfg59urI.js","assets/TaskRoutes-DmGo1lNA.js","assets/TaskListScreen-Cuce7GNl.js","assets/AiCfoScreen-ngmwmSfT.js","assets/CardsAiCfoScreen-Z2PndTe3.js"])))=>i.map(i=>d[i]);
2
+ import{_ as a,bn as is,eV as rs,fA as os,fy as ls,fz as cs,gh as ds,fn as ms,cT as ge,cA as us,fQ as _s,cs as As,bE as ps,bo as Es,fV as gs,v as xs,Ly as Is,bs as Ts,Lz as js,bK as hs,fS as Us,bJ as bs,bt as Rs,co as Hs,LA as Ds,LB as ys,cQ as fs,cS as Cs,cR as vs,cz as Os,cG as Ps,o3 as xe,fw as Ie,gr as Fs,fZ as Te,go as je,gp as he,f_ as Ls}from"./zeni-epic-state-BZ6N8nVI.js";import{j as e}from"./liveblocks-BUQfB0Zp.js";import{a as v}from"./sentry-BLIwU6uZ.js";import{u as ks,h as Bs,i as Vs,g as Ss,j as G,l as Ue,N as c,o as Ns,p as t}from"./core-OMb8nkC1.js";import{m as Zs,u as Ms,z as R,a as ws,c as zs,h as Gs,F as B,j as $s,L as F,D as be,t as _,P as Ys,d as ee,l}from"./index-NcZU0lXl.js";import"./mui-JZY-3hhJ.js";import{f as Re}from"./analyticsHelper-BU5wlVa9.js";import{t as Ws}from"./getLocaleForTenant-Bn16hOPH.js";import"./recharts-DAM4r1-u.js";import"./analytics-BLbM2ksu.js";import"./plaid-B_OuebQv.js";import"./dnd-DVcQZAG5.js";import"./stripe-DMRn4zHo.js";import"./lottie-DDI83OWz.js";import"./lexical-CNfNgAkp.js";import"./pdf-6FZlivdz.js";import"./utils-Bia5qc4p.js";(function(){try{var i=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},U=new i.Error().stack;U&&(i._sentryDebugIds=i._sentryDebugIds||{},i._sentryDebugIds[U]="5ce4eb22-b965-47f6-8c98-e9d2edbab707",i._sentryDebugIdIdentifier="sentry-dbid-5ce4eb22-b965-47f6-8c98-e9d2edbab707")}catch{}})();const qs={dashboard:()=>a(()=>import("./DashboardRoutes-YclW7oS0.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21])),bills:()=>a(()=>import("./BillPayRoutes-zXfejo42.js"),__vite__mapDeps([22,1,2,3,4,5,6,7,23,13,24,9,14,25,17,19,26,15,12,27,28,29,30,21])),reimbursement:()=>a(()=>import("./ReimbursementRoutes-CzlU6LYx.js"),__vite__mapDeps([31,1,2,3,4,5,6,7,13,26,17,15,12,27,19,9,14,25,32,29,30,21])),transactions:()=>a(()=>import("./TransactionListRoutes-C4QYqCpP.js"),__vite__mapDeps([33,1,2,3,4,5,6,7,8,9,10,11,12,34,21])),settings:()=>a(()=>import("./SettingsRoutes-3hV9qN1I.js"),__vite__mapDeps([35,1,2,3,4,5,6,7,17,36,23,13,15,27,12,16,37,38,39,40,41,11,28,29,32,21])),reports:()=>a(()=>import("./ReportsRoutes-D_wjWb18.js"),__vite__mapDeps([42,1,2,3,4,5,6,7,13,19,14,12,17,21])),chargeCards:()=>a(()=>import("./ChargeCardRoutes-CBFlKgnf.js"),__vite__mapDeps([43,1,2,3,4,5,6,7,9,17,26,13,15,12,27,14,23,21])),people:()=>a(()=>import("./PeopleRoutes-CUtLjfXT.js"),__vite__mapDeps([44,1,2,3,4,5,6,7,13,9,17,21])),expenseAutomation:()=>a(()=>import("./ExpenseAutomationRoutes-CTZlVWwO.js"),__vite__mapDeps([45,1,2,3,13,4,5,6,7,9,10,11,12,8,36,25,21])),treasury:()=>a(()=>import("./TreasuryRoutes-jiXgJCAb.js"),__vite__mapDeps([46,1,2,3,4,5,6,7,13,26,17,15,12,27,9,14,47,19,21])),vendors:()=>a(()=>import("./VendorsRoutes-BZFmR2hI.js"),__vite__mapDeps([48,1,2,3,4,5,6,7,23,13,19,12,49,9,17,25,36,21])),zeniAccounts:()=>a(()=>import("./ZeniAccountRoutes-DVnj5-p6.js"),__vite__mapDeps([50,1,2,3,4,5,6,7,47,13,26,17,15,12,27,19,24,23,9,34,21]))},Qs=["bills","transactions","settings","reimbursement","reports","chargeCards","people"],se=i=>{"requestIdleCallback"in window?requestIdleCallback(i):setTimeout(i,100)},Js=l(()=>a(()=>import("./ReportsRoutes-D_wjWb18.js"),__vite__mapDeps([42,1,2,3,4,5,6,7,13,19,14,12,17,21]))),Ks=l(()=>a(()=>import("./AddressRoutes-DsuoPslx.js"),__vite__mapDeps([51,1,2,3,23,4,5,6,7,13,21]))),Xs=l(()=>a(()=>import("./PeopleRoutes-CUtLjfXT.js"),__vite__mapDeps([44,1,2,3,4,5,6,7,13,9,17,21]))),ea=l(()=>a(()=>import("./PandLWithForecastRoutes-DSq1hcWm.js"),__vite__mapDeps([52,1,2,3,4,5,6,7,13,19,9,14,12,17,21]))),sa=l(()=>a(()=>import("./CustomerOnboardingRoutes-Doltk1XW.js"),__vite__mapDeps([53,1,2,3,23,4,5,6,7,13,37,38,39,40,41,11,21]))),aa=l(()=>a(()=>import("./VendorsRoutes-BZFmR2hI.js"),__vite__mapDeps([48,1,2,3,4,5,6,7,23,13,19,12,49,9,17,25,36,21]))),na=l(()=>a(()=>import("./TransactionDetailRoutes-CgKCf_lf.js"),__vite__mapDeps([54,1,2,3,13,4,5,6,7,10,9,11,12,21]))),He=l(()=>a(()=>import("./EntityDetailRoutes-D020FlPl.js"),__vite__mapDeps([55,1,2,3,4,5,6,7,11,8,9,10,12,21]))),ta=l(()=>a(()=>import("./DashboardRoutes-YclW7oS0.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21]))),De=l(()=>a(()=>import("./BillPayRoutes-zXfejo42.js"),__vite__mapDeps([22,1,2,3,4,5,6,7,23,13,24,9,14,25,17,19,26,15,12,27,28,29,30,21]))),ia=l(()=>a(()=>import("./SettingsRoutes-3hV9qN1I.js"),__vite__mapDeps([35,1,2,3,4,5,6,7,17,36,23,13,15,27,12,16,37,38,39,40,41,11,28,29,32,21]))),ye=l(()=>a(()=>import("./ReimbursementRoutes-CzlU6LYx.js"),__vite__mapDeps([31,1,2,3,4,5,6,7,13,26,17,15,12,27,19,9,14,25,32,29,30,21]))),ra=l(()=>a(()=>import("./ZeniAccountRoutes-DVnj5-p6.js"),__vite__mapDeps([50,1,2,3,4,5,6,7,47,13,26,17,15,12,27,19,24,23,9,34,21]))),oa=l(()=>a(()=>import("./TreasuryRoutes-jiXgJCAb.js"),__vite__mapDeps([46,1,2,3,4,5,6,7,13,26,17,15,12,27,9,14,47,19,21]))),la=l(()=>a(()=>import("./TransactionListRoutes-C4QYqCpP.js"),__vite__mapDeps([33,1,2,3,4,5,6,7,8,9,10,11,12,34,21]))),ca=l(()=>a(()=>import("./ChargeCardRoutes-CBFlKgnf.js"),__vite__mapDeps([43,1,2,3,4,5,6,7,9,17,26,13,15,12,27,14,23,21]))),da=l(()=>a(()=>import("./NotificationRoutes-Dw__n9YA.js"),__vite__mapDeps([56,1,2,3,13,4,5,6,7,9,21]))),ma=l(()=>a(()=>import("./PerformanceRoutes-D4zDazyB.js"),__vite__mapDeps([57,1,2,3,13,4,5,6,7,9,17,21]))),ua=l(()=>a(()=>import("./ExpenseAutomationRoutes-CTZlVWwO.js"),__vite__mapDeps([45,1,2,3,13,4,5,6,7,9,10,11,12,8,36,25,21]))),_a=l(()=>a(()=>import("./RewardsRoutes-Bfg59urI.js"),__vite__mapDeps([58,1,2,3,4,5,6,7,13,20,9,17,21]))),Aa=l(()=>a(()=>import("./TaskRoutes-DmGo1lNA.js"),__vite__mapDeps([59,1,2,3,13,4,5,6,7,14,17,60,9,21]))),pa=l(()=>a(()=>import("./AiCfoScreen-ngmwmSfT.js"),__vite__mapDeps([61,1,2,3,4,5,6,7,18,49,21]))),fe=l(()=>a(()=>import("./CardsAiCfoScreen-Z2PndTe3.js"),__vite__mapDeps([62,1,2,3,4,5,6,7,21]))),D=l(()=>a(()=>import("./NotFoundScreen-CxRYls3k.js"),__vite__mapDeps([13,1,2,3,4,5,6,7,21]))),Ea=l(()=>a(()=>import("./TaskListScreen-Cuce7GNl.js"),__vite__mapDeps([60,1,2,3,4,5,6,7,9,17,21])));function Na({setTenantEmailDomain:i}){const U=ks(),V=Bs(),{tenantEmailDomain:o}=Vs(),S=Zs().mode,{setLoading:f,clearAllLoading:O,clearLoading:M}=Ms(),y=R.getSignedInUserTenant(o)?.tenantId,j=R.getSignedInUser(),ae=is(j),$=Ss(),[N,ve]=v.useState(!1),r=G(n=>rs(n)),{useFeatureGate:L}=ws(),w=zs(),ne=Gs(),{isFeatureEnabled:Oe}=L(B.isDepositAccountsFeatureEnabled),{isFeatureEnabled:Pe}=L(B.isTreasuryEnabled),{isFeatureEnabled:Fe}=L(B.isChargeCardFeatureEnabled),{isFeatureEnabled:te}=L(B.isDebitCardFeatureEnabled),h=G(n=>n.tenantState.fetchState),p=G(n=>n.tenantState.activeTenantFetchState.fetchState),u=p==="Completed"||h==="Completed"?os(te,r):void 0,Y=p==="Completed"||h==="Completed"?ls(r):void 0,Le=p==="Completed"||h==="Completed"?cs(r):void 0,ke=Fe||te||!!Le||!!Y||!!u,{isFeatureEnabled:Be}=L(B.isSettingsFeatureEnabled),{isFeatureEnabled:J}=L(B.isAiCfoFileUploadEnabled),W=G(n=>ds(n));if(o!=null){const n=R.getSignedInUserTenant(o);j!=null&&n!=null&&Re(j,r,S)}const z={tenantId:y,userId:j?.userId,sessionId:j?.zeniSessionId},ie=ms(),A=$s(),Ve=r.company==null||A?.loggedInUserRoleMap!=null&&ge(A.loggedInUserRole),Se=us(A?.loggedInUserRoleMap),re=v.useRef(!0),oe=Ue("/:tenantEmailDomain/onboarding/*")!==null,K=Ue("/:tenantEmailDomain/month_end_close_checks/review/:selectedTab/:selectedPeriod/*"),Ne=G(n=>z.tenantId!=null?_s(n,z.tenantId):void 0);v.useEffect(()=>{f(F.TENANT_FETCHING),i(o)},[o]),v.useEffect(()=>{if(K!=null&&y!=null){const n=K.params.selectedPeriod;if(n!=null){const b=n.split("-");if(b.length===2){const d=As(Number(b[0])),s=Number(b[1]),m=ps(`01-${d<10?`0${d}`:d}-${s}`,be.getLocalizedStrings().dateFormat.analytics.DDDashMMDashYYYY),Z=Es();m.isAfter(Z,"month")===!1?U(gs(y,{month:d,year:s})):V("./month_end_close_checks/review")}}}},[K,y]),v.useEffect(()=>{N||(ve(!0),f(F.TENANT_FETCHING)),re.current?re.current=!1:!xs(ie,z)&&R.isSignedIn()&&(f(F.TENANT_FETCHING),function(n,b,d,s){if(Ie(b?.userId,b?.zeniSessionId,n.tenantId),d(Fs(!0)),d(Te(n.tenantId)),n.tenantId!=null&&_.clearTenant(n.tenantId),n.tenantId!=null){const m=R.getSignedInUserTenantWithId(n.tenantId);s&&be.updateAppLocaleID(Ws(s)),m?.tenantEmailDomain!=null&&R.saveActiveTenantDomainForUser(m?.tenantEmailDomain)}n.userId!=null?ee.identify(n.userId,{tenant_id:n.tenantId}):ee.resetUserIdentity()}(z,j,U,Ne))},[z,ie,j,U,R]),v.useEffect(()=>{R.isSignedIn()&&(f(F.TENANT_FETCHING),function(n,b,d,s,m,Z,k){if(d==null&&s==null)return void console.warn("There is no current tenant selected!!");const q=s!=null&&m?.zeniSessionId!=null,as=d==null||d.tenantId!==s,ns=d!=null&&d.excludedResources==null,ts=d!=null&&d.externalConnections==null;if(q&&as){k(Te(s));const Q=R.getSignedInUserTenantWithId(s);Q?.tenantEmailDomain!=null&&R.saveActiveTenantDomainForUser(Q?.tenantEmailDomain),Ie(m?.userId,m?.zeniSessionId,s),_.shouldFetchExcludedResources(s)&&(_.markExcludedResourcesFetchStarted(s),k(je(m.userId,s))),_.shouldFetchConnections(s)&&(_.markConnectionsFetchStarted(s),k(he(m.userId,s)))}else q&&ns&&_.shouldFetchExcludedResources(s)&&(_.markExcludedResourcesFetchStarted(s),k(je(m.userId,s))),q&&ts&&_.shouldFetchConnections(s)&&(_.markConnectionsFetchStarted(s),k(he(m.userId,s)));if(q){ee.identify(m.userId,{tenant_id:s});const Q=s==null||s!=null&&(b==="Completed"||b==="Error");n==="Completed"||b!=="Not-Started"&&b!=="Error"||s==null||!_.shouldFetchActiveTenant(s)||(_.markActiveTenantFetchStarted(s),Z(F.TENANT_FETCHING),k(Ls(m.userId,s,m.zeniSessionId))),Q&&(n==="Not-Started"||n==="Error")&&_.shouldFetchAllTenants()&&(_.markAllTenantsFetchStarted(),k(xe(m.userId,m.zeniSessionId)))}}(h,p,r,y,j,f,U))},[y,p]),v.useEffect(()=>{R.isSignedIn()&&h==="Completed"&&W.tenantsBaseInOrder.length>0&&(M(F.TENANT_FETCHING),R.saveSignedInUserTenants(Is(W.tenantsBaseInOrder)),j!=null&&Re(j,r,S,void 0,W.tenantsBaseInOrder))},[W,h,r,j]),v.useEffect(()=>{p==="In-Progress"&&f(F.TENANT_FETCHING),p!=="Completed"&&p!=="Error"||(p==="Completed"&&y!=null?(O(),_.markActiveTenantFetchCompleted(y)):p==="Error"&&y!=null&&(_.markActiveTenantFetchFailed(y),M(F.TENANT_FETCHING),M(F.TENANT_SWITCHING))),h!=="Completed"&&h!=="Error"||(h==="Completed"?_.markAllTenantsFetchCompleted():h==="Error"&&_.markAllTenantsFetchFailed())},[p,h,y,N]);const le=v.useRef(!1);v.useEffect(()=>{!le.current&&p==="Completed"&&N&&(le.current=!0,function(n=Qs,b=3e3){setTimeout(()=>{const d=s=>{if(s>=n.length)return;const m=n[s],Z=qs[m];Z!=null?Z().then(()=>se(()=>d(s+1))).catch(()=>se(()=>d(s+1))):d(s+1)};se(()=>d(0))},b)}())},[p,N]);const C=r?.userRole!=null&&Ts(r?.userRole),{isFeatureEnabled:Ze}=L(B.isReferralFeatureEnabled),Me=r?.userRole!=null&&r.userRole.includes("charge_card_user"),we=r?.userRole!=null&&r.userRole.includes("charge_card_admin"),P=r?.userRole!=null&&ge(r.userRole),ce=r?.company==null||r.company.featuresActivationInfo?.isBillPayFeatureEnabled&&!C,de=ke&&!C,ze=js(A?.loggedInUserRoleMap),Ge=r.externalConnections?.accounting[0]?.isValid,me=r.company?.companyOnboardingInfo.isOnboardingCompleted,ue=r?.company==null||r.company.featuresActivationInfo?.isReimbursementFeatureEnabled&&!C,_e=ue&&hs(A?.loggedInUserRoleMap),Ae=Oe&&!C,$e=r.company!=null&&Us(r.company),Ye=Pe&&$e===!0&&!C,We=ce&&bs(A?.loggedInUserRoleMap),qe=de&&Rs(A?.loggedInUserRoleMap),Qe=Ae&&Hs(A?.loggedInUserRoleMap),Je=Ds(A?.loggedInUserRoleMap),Ke=ys(A?.loggedInUserRoleMap),E=fs(A?.loggedInUserRoleMap),g=Cs(A?.loggedInUserRoleMap),x=vs(A?.loggedInUserRoleMap),I=Os(A?.loggedInUserRoleMap),T=Ps(A?.loggedInUserRoleMap),pe=ce&&I,Ee=ue&&T,Xe=Ae&&E,es=Ye&&g,X=de&&x,ss=r.excludedResources?.resources?.find(n=>n.resource==="/invites")!=null||Se===!0||ze===!0||Je===!0||Ke===!0;return R.isSignedIn()?y==null?h==="Completed"?e.jsx(c,{to:"/",replace:!0,state:{...$.state,message:"...",origin:$.pathname}}):(j!=null&&h!=="In-Progress"&&U(xe(j.userId,j.zeniSessionId)),null):p!=="In-Progress"&&p!=="Not-Started"||h==="Completed"?(me===!0||ae&&!oe)&&Ge===!1&&u===!1&&Y===!1?(i(void 0),e.jsx(c,{to:"/connection/auth",replace:!0})):!N||me!==!1||oe||ae?N&&r?.userRole&&u!=null&&Y!=null&&o!=null&&Object.keys(A.loggedInUserRoleMap).length>0?e.jsx(Ns,{children:e.jsxs(t,{element:e.jsx(Ys,{}),children:[e.jsx(t,{path:"/",element:e.jsx(ga,{isDashboardAccess:P,isUserHasZeniAccountsAccess:E,isUserHasChargeCardAccess:x,isUserHasBillPayAccess:I,isUserHasReimbursementAccess:T,isUserHasTreasuryAccess:g,isTenantBankingOnly:u,isTenantCardsOnly:Y})}),e.jsx(t,{path:"dashboard/*",element:P?e.jsx(ta,{}):e.jsx(H,{isUserHasZeniAccountsAccess:E,isUserHasChargeCardAccess:x,isUserHasBillPayAccess:I,isUserHasReimbursementAccess:T,isUserHasTreasuryAccess:g,isTenantBankingOnly:u,tenantEmailDomain:o})}),e.jsx(t,{path:"reports/*",element:P?e.jsx(Js,{}):e.jsx(H,{isUserHasZeniAccountsAccess:E,isUserHasChargeCardAccess:x,isUserHasBillPayAccess:I,isUserHasReimbursementAccess:T,isUserHasTreasuryAccess:g,isTenantBankingOnly:u,tenantEmailDomain:o})}),e.jsx(t,{path:"people/*",element:ss||P?e.jsx(Xs,{}):e.jsx(H,{isUserHasZeniAccountsAccess:E,isUserHasChargeCardAccess:x,isUserHasBillPayAccess:I,isUserHasReimbursementAccess:T,isUserHasTreasuryAccess:g,isTenantBankingOnly:u,tenantEmailDomain:o})}),e.jsx(t,{path:"forecast/*",element:P?e.jsx(ea,{}):e.jsx(H,{isUserHasZeniAccountsAccess:E,isUserHasChargeCardAccess:x,isUserHasBillPayAccess:I,isUserHasReimbursementAccess:T,isUserHasTreasuryAccess:g,isTenantBankingOnly:u,tenantEmailDomain:o})}),e.jsx(t,{path:"onboarding/*",element:e.jsx(sa,{})}),e.jsx(t,{path:"transaction/*",element:P&&C===!1||Me||we?e.jsx(na,{}):e.jsx(H,{isUserHasZeniAccountsAccess:E,isUserHasChargeCardAccess:x,isUserHasBillPayAccess:I,isUserHasReimbursementAccess:T,isUserHasTreasuryAccess:g,isTenantBankingOnly:u,tenantEmailDomain:o})}),e.jsx(t,{path:"transactions/*",element:P&&C===!1?e.jsx(la,{}):e.jsx(H,{isUserHasZeniAccountsAccess:E,isUserHasChargeCardAccess:x,isUserHasBillPayAccess:I,isUserHasReimbursementAccess:T,isUserHasTreasuryAccess:g,isTenantBankingOnly:u,tenantEmailDomain:o})}),e.jsx(t,{path:"customer/*",element:P&&C===!1?e.jsx(He,{entityType:"customer"}):e.jsx(H,{isUserHasZeniAccountsAccess:E,isUserHasChargeCardAccess:x,isUserHasBillPayAccess:I,isUserHasReimbursementAccess:T,isTenantBankingOnly:u,isUserHasTreasuryAccess:g,tenantEmailDomain:o})}),e.jsx(t,{path:"vendor/*",element:P&&C===!1?e.jsx(He,{entityType:"vendor"}):e.jsx(H,{isUserHasZeniAccountsAccess:E,isUserHasChargeCardAccess:x,isUserHasBillPayAccess:I,isUserHasReimbursementAccess:T,isUserHasTreasuryAccess:g,isTenantBankingOnly:u,tenantEmailDomain:o})}),e.jsx(t,{path:"tasks",element:e.jsx(Ea,{})}),e.jsx(t,{path:"tasks/*",element:e.jsx(Aa,{})}),e.jsx(t,{path:"address/*",element:We||_e||Qe||qe?e.jsx(Ks,{}):e.jsx(H,{isUserHasZeniAccountsAccess:E,isUserHasChargeCardAccess:x,isUserHasBillPayAccess:I,isUserHasReimbursementAccess:T,isUserHasTreasuryAccess:g,isTenantBankingOnly:u,tenantEmailDomain:o})}),e.jsx(t,{path:"checking/*",element:Xe?e.jsx(ra,{}):e.jsx(D,{})}),e.jsx(t,{path:"treasury/*",element:es?e.jsx(oa,{}):e.jsx(D,{})}),e.jsx(t,{path:"performance",element:ne===!0?e.jsx(ma,{}):e.jsx(Ce,{tenantEmailDomain:o})}),e.jsx(t,{path:"month_end_close_checks/review/*",element:ne===!0&&C===!1?e.jsx(ua,{}):e.jsx(Ce,{tenantEmailDomain:o})}),e.jsx(t,{path:"notifications/*",element:e.jsx(da,{})}),e.jsx(t,{path:"vendors/*",element:Ve?e.jsx(aa,{}):e.jsx(D,{})}),e.jsx(t,{path:"bill/*",element:pe?e.jsx(De,{}):e.jsx(H,{isUserHasZeniAccountsAccess:E,isUserHasChargeCardAccess:x,isUserHasBillPayAccess:I,isUserHasReimbursementAccess:T,isUserHasTreasuryAccess:g,isTenantBankingOnly:u,tenantEmailDomain:o})}),e.jsx(t,{path:"bills/*",element:pe?e.jsx(De,{}):e.jsx(H,{isUserHasZeniAccountsAccess:E,isUserHasChargeCardAccess:x,isUserHasBillPayAccess:I,isUserHasReimbursementAccess:T,isUserHasTreasuryAccess:g,isTenantBankingOnly:u,tenantEmailDomain:o})}),e.jsx(t,{path:"reimbursement/*",element:Ee?e.jsx(ye,{}):e.jsx(H,{isUserHasZeniAccountsAccess:E,isUserHasChargeCardAccess:x,isUserHasBillPayAccess:I,isUserHasReimbursementAccess:T,isUserHasTreasuryAccess:g,isTenantBankingOnly:u,tenantEmailDomain:o})}),e.jsx(t,{path:"reimbursements/*",element:Ee?e.jsx(ye,{}):e.jsx(H,{isUserHasZeniAccountsAccess:E,isUserHasChargeCardAccess:x,isUserHasBillPayAccess:I,isUserHasReimbursementAccess:T,isUserHasTreasuryAccess:g,isTenantBankingOnly:u,tenantEmailDomain:o})}),e.jsx(t,{path:"settings/*",element:Be?e.jsx(ia,{hasAdminLevelAccess:_e}):e.jsx(D,{})}),e.jsx(t,{path:"cards/ask",element:X&&w?e.jsx(fe,{isFileUploadEnabled:J}):e.jsx(D,{})}),e.jsx(t,{path:"cards/ask/:session_id",element:X&&w?e.jsx(fe,{isFileUploadEnabled:J}):e.jsx(D,{})}),e.jsx(t,{path:"cards/*",element:X?e.jsx(ca,{}):e.jsx(D,{})}),e.jsx(t,{path:"rewards/*",element:Ze?e.jsx(_a,{}):e.jsx(D,{})}),e.jsx(t,{path:"/ai-cfo",element:w?e.jsx(c,{to:"explore"}):e.jsx(D,{})}),e.jsx(t,{path:"/ai-cfo/",element:w?e.jsx(c,{to:"explore"}):e.jsx(D,{})}),e.jsx(t,{path:"/ai-cfo/:session_id",element:w?e.jsx(pa,{isFileUploadEnabled:J}):e.jsx(D,{})}),e.jsx(t,{path:"*",element:e.jsx(D,{})})]})}):null:(i(void 0),e.jsx(c,{to:"onboarding",replace:!0})):null:(console.warn("User logged out!!"),i(void 0),e.jsx(c,{to:"/signin/auth",replace:!0,state:{...$.state,message:"...",origin:$.pathname}}))}const ga=({isDashboardAccess:i,isUserHasZeniAccountsAccess:U,isUserHasChargeCardAccess:V,isUserHasBillPayAccess:o,isUserHasReimbursementAccess:S,isUserHasTreasuryAccess:f,isTenantBankingOnly:O,isTenantCardsOnly:M})=>O===!0&&U?e.jsx(c,{to:"checking"}):M===!0?e.jsx(c,{to:"cards"}):i?e.jsx(c,{to:"dashboard"}):U?e.jsx(c,{to:"checking"}):f?e.jsx(c,{to:"treasury"}):V?e.jsx(c,{to:"cards"}):o?e.jsx(c,{to:"bills"}):S?e.jsx(c,{to:"reimbursements"}):e.jsx(c,{to:"dashboard"}),H=({isUserHasZeniAccountsAccess:i,isUserHasChargeCardAccess:U,isUserHasBillPayAccess:V,isUserHasReimbursementAccess:o,isUserHasTreasuryAccess:S,isTenantBankingOnly:f,tenantEmailDomain:O})=>f===!0||i?e.jsx(ja,{tenantEmailDomain:O}):S?e.jsx(Ta,{tenantEmailDomain:O}):U?e.jsx(ha,{tenantEmailDomain:O}):V?e.jsx(Ia,{tenantEmailDomain:O}):o?e.jsx(xa,{tenantEmailDomain:O}):e.jsx(D,{}),xa=({tenantEmailDomain:i})=>e.jsx(c,{to:`/${i}/reimbursements`}),Ia=({tenantEmailDomain:i})=>e.jsx(c,{to:`/${i}/bills`}),Ta=({tenantEmailDomain:i})=>e.jsx(c,{to:`/${i}/treasury`}),ja=({tenantEmailDomain:i})=>e.jsx(c,{to:`/${i}/checking`}),ha=({tenantEmailDomain:i})=>e.jsx(c,{to:`/${i}/cards`}),Ce=({tenantEmailDomain:i})=>e.jsx(c,{to:`/${i}/dashboard`});export{H as FallBackRoute,Na as default};